From 42823cea711eef152e08defaa796d2301f32390c Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Wed, 29 Apr 2020 12:40:56 +0200 Subject: [PATCH] Built motion from commit (unavailable).|2.4.15 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1070 files changed, 1070 insertions(+), 1070 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ce6d4af..5118646 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-04-29T08:25:23.335Z", + "time": "2020-04-29T10:16:27.490Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f013dd6..26dd788 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-04-29T08:25:23.335Z", + "time": "2020-04-29T10:16:27.490Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 2905d09..7b50a34 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6724=['action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','VIRTUAL','getDataValue'];(function(_0x2da98d,_0x4e6cb8){var _0x5c9efe=function(_0x5e9f91){while(--_0x5e9f91){_0x2da98d['push'](_0x2da98d['shift']());}};_0x5c9efe(++_0x4e6cb8);}(_0x6724,0x12e));var _0x4672=function(_0x2d0f6d,_0x467884){_0x2d0f6d=_0x2d0f6d-0x0;var _0x3aafd4=_0x6724[_0x2d0f6d];return _0x3aafd4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4672('0x0')],'get':function(_0x30f8bc){return this[_0x4672('0x1')](_0x4672('0x2'));}},'action':{'type':Sequelize[_0x4672('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4672('0x4'),_0x4672('0x5'),_0x4672('0x6'),_0x4672('0x7'),_0x4672('0x8'),_0x4672('0x9'),_0x4672('0xa'),_0x4672('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4672('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x4672('0x3')](0x1000),'comment':_0x4672('0xd')},'data3':{'type':Sequelize[_0x4672('0x3')](0x1000),'comment':_0x4672('0xe')},'data4':{'type':Sequelize[_0x4672('0x3')](0x1000)},'data5':{'type':Sequelize[_0x4672('0x3')](0x1000)},'data6':{'type':Sequelize[_0x4672('0x3')]},'data7':{'type':Sequelize[_0x4672('0xf')]}}; \ No newline at end of file +var _0x9530=['exports','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x2ea9d0,_0x32d1ca){var _0x384438=function(_0x5c9938){while(--_0x5c9938){_0x2ea9d0['push'](_0x2ea9d0['shift']());}};_0x384438(++_0x32d1ca);}(_0x9530,0x6f));var _0x0953=function(_0x391d16,_0x13c693){_0x391d16=_0x391d16-0x0;var _0x477286=_0x9530[_0x391d16];return _0x477286;};'use strict';var Sequelize=require(_0x0953('0x0'));module[_0x0953('0x1')]={'name':{'type':Sequelize[_0x0953('0x2')],'get':function(_0x4b8388){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x0953('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0953('0x4'),_0x0953('0x5'),_0x0953('0x6'),_0x0953('0x7'),_0x0953('0x8'),_0x0953('0x9'),'bot',_0x0953('0xa')]],'msg':_0x0953('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x0953('0x3')](0x1000),'comment':_0x0953('0xc')},'data2':{'type':Sequelize[_0x0953('0x3')](0x1000),'comment':_0x0953('0xd')},'data3':{'type':Sequelize[_0x0953('0x3')](0x1000),'comment':_0x0953('0xe')},'data4':{'type':Sequelize[_0x0953('0x3')](0x1000)},'data5':{'type':Sequelize[_0x0953('0x3')](0x1000)},'data6':{'type':Sequelize[_0x0953('0x3')]},'data7':{'type':Sequelize[_0x0953('0xf')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 1a82587..026306a 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0b6=['status','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','body','Action','params','catch','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xc6b71d,_0x222052){var _0x5731a6=function(_0x53ce16){while(--_0x53ce16){_0xc6b71d['push'](_0xc6b71d['shift']());}};_0x5731a6(++_0x222052);}(_0xd0b6,0x9c));var _0x6d0b=function(_0x272bb7,_0x455fb9){_0x272bb7=_0x272bb7-0x0;var _0x13bfaf=_0xd0b6[_0x272bb7];return _0x13bfaf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6d0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d0b('0x1'));var jsonpatch=require(_0x6d0b('0x2'));var rp=require(_0x6d0b('0x3'));var moment=require('moment');var BPromise=require(_0x6d0b('0x4'));var Mustache=require(_0x6d0b('0x5'));var util=require(_0x6d0b('0x6'));var path=require('path');var sox=require(_0x6d0b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6d0b('0x8'));var squel=require(_0x6d0b('0x9'));var crypto=require(_0x6d0b('0xa'));var jsforce=require(_0x6d0b('0xb'));var deskjs=require(_0x6d0b('0xc'));var toCsv=require(_0x6d0b('0xd'));var querystring=require(_0x6d0b('0xe'));var Papa=require(_0x6d0b('0xf'));var Redis=require(_0x6d0b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6d0b('0x11'));var as=require(_0x6d0b('0x12'));var hardwareService=require(_0x6d0b('0x13'));var logger=require('../../config/logger')(_0x6d0b('0x14'));var utils=require(_0x6d0b('0x15'));var config=require(_0x6d0b('0x16'));var db=require(_0x6d0b('0x17'))['db'];function respondWithStatusCode(_0x48b9d2,_0x5be837){_0x5be837=_0x5be837||0xcc;return function(_0x1d0bab){if(_0x1d0bab){return _0x48b9d2['sendStatus'](_0x5be837);}return _0x48b9d2['status'](_0x5be837)['end']();};}function respondWithResult(_0x22b861,_0x3aed91){_0x3aed91=_0x3aed91||0xc8;return function(_0x27ea24){if(_0x27ea24){return _0x22b861[_0x6d0b('0x18')](_0x3aed91)[_0x6d0b('0x19')](_0x27ea24);}};}function respondWithFilteredResult(_0x42f059,_0x9f2c69){return function(_0x1d4cf5){if(_0x1d4cf5){var _0x2442df=_0x1d4cf5[_0x6d0b('0x1a')],_0x214a39=_0x9f2c69[_0x6d0b('0x1b')],_0x557365=_0x9f2c69[_0x6d0b('0x1b')]+_0x9f2c69[_0x6d0b('0x1c')],_0x478f74;if(_0x557365>=_0x2442df){_0x557365=_0x2442df;_0x478f74=0xc8;}else{_0x478f74=0xce;}_0x42f059['status'](_0x478f74);return _0x42f059['set'](_0x6d0b('0x1d'),_0x214a39+'-'+_0x557365+'/'+_0x2442df)[_0x6d0b('0x19')](_0x1d4cf5);}return null;};}function patchUpdates(_0x2ff0c4){return function(_0x3bade5){try{jsonpatch[_0x6d0b('0x1e')](_0x3bade5,_0x2ff0c4,!![]);}catch(_0x54d274){return BPromise['reject'](_0x54d274);}return _0x3bade5[_0x6d0b('0x1f')]();};}function saveUpdates(_0x9b2dbd,_0x419b26){return function(_0x783714){if(_0x783714){return _0x783714[_0x6d0b('0x20')](_0x9b2dbd)['then'](function(_0x49ba55){return _0x49ba55;});}return null;};}function removeEntity(_0x51eb8b,_0x47da65){return function(_0x490c05){if(_0x490c05){return _0x490c05[_0x6d0b('0x21')]()[_0x6d0b('0x22')](function(){_0x51eb8b[_0x6d0b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54289c,_0x4716ea){return function(_0xedf58d){if(!_0xedf58d){_0x54289c[_0x6d0b('0x23')](0x194);}return _0xedf58d;};}function handleError(_0x128880,_0x3e65c3){_0x3e65c3=_0x3e65c3||0x1f4;return function(_0x3f5a64){logger[_0x6d0b('0x24')](_0x3f5a64[_0x6d0b('0x25')]);if(_0x3f5a64[_0x6d0b('0x26')]){delete _0x3f5a64[_0x6d0b('0x26')];}_0x128880['status'](_0x3e65c3)[_0x6d0b('0x27')](_0x3f5a64);};}exports[_0x6d0b('0x20')]=function(_0x597c38,_0x199e24){if(_0x597c38['body']['id']){delete _0x597c38[_0x6d0b('0x28')]['id'];}return db[_0x6d0b('0x29')]['find']({'where':{'id':_0x597c38[_0x6d0b('0x2a')]['id']}})['then'](handleEntityNotFound(_0x199e24,null))['then'](saveUpdates(_0x597c38['body'],null))[_0x6d0b('0x22')](respondWithResult(_0x199e24,null))[_0x6d0b('0x2b')](handleError(_0x199e24,null));};exports[_0x6d0b('0x21')]=function(_0xc58a43,_0x3361d4){return db[_0x6d0b('0x29')][_0x6d0b('0x2c')]({'where':{'id':_0xc58a43[_0x6d0b('0x2a')]['id']}})[_0x6d0b('0x22')](handleEntityNotFound(_0x3361d4,null))['then'](removeEntity(_0x3361d4,null))[_0x6d0b('0x2b')](handleError(_0x3361d4,null));}; \ No newline at end of file +var _0xe24c=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','body','Action','find','params','catch','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash'];(function(_0x22ef60,_0x56e9d9){var _0x30b01b=function(_0x49575e){while(--_0x49575e){_0x22ef60['push'](_0x22ef60['shift']());}};_0x30b01b(++_0x56e9d9);}(_0xe24c,0x1ef));var _0xce24=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe24c[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require(_0xce24('0x0'));var emlformat=require(_0xce24('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xce24('0x2'));var rp=require(_0xce24('0x3'));var moment=require(_0xce24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xce24('0x5'));var util=require(_0xce24('0x6'));var path=require(_0xce24('0x7'));var sox=require(_0xce24('0x8'));var csv=require('to-csv');var ejs=require(_0xce24('0x9'));var fs=require('fs');var _=require(_0xce24('0xa'));var squel=require(_0xce24('0xb'));var crypto=require(_0xce24('0xc'));var jsforce=require(_0xce24('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xce24('0xe'));var Papa=require(_0xce24('0xf'));var Redis=require(_0xce24('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xce24('0x11'));var as=require(_0xce24('0x12'));var hardwareService=require(_0xce24('0x13'));var logger=require(_0xce24('0x14'))(_0xce24('0x15'));var utils=require('../../config/utils');var config=require(_0xce24('0x16'));var db=require(_0xce24('0x17'))['db'];function respondWithStatusCode(_0x5157a0,_0x45eb49){_0x45eb49=_0x45eb49||0xcc;return function(_0x159e27){if(_0x159e27){return _0x5157a0[_0xce24('0x18')](_0x45eb49);}return _0x5157a0[_0xce24('0x19')](_0x45eb49)[_0xce24('0x1a')]();};}function respondWithResult(_0x30d8ef,_0x197ba0){_0x197ba0=_0x197ba0||0xc8;return function(_0x25b948){if(_0x25b948){return _0x30d8ef[_0xce24('0x19')](_0x197ba0)['json'](_0x25b948);}};}function respondWithFilteredResult(_0x57a851,_0xb39f6a){return function(_0x55e7b0){if(_0x55e7b0){var _0xb5a0d5=_0x55e7b0[_0xce24('0x1b')],_0x2c2628=_0xb39f6a['offset'],_0x201850=_0xb39f6a[_0xce24('0x1c')]+_0xb39f6a[_0xce24('0x1d')],_0xdea231;if(_0x201850>=_0xb5a0d5){_0x201850=_0xb5a0d5;_0xdea231=0xc8;}else{_0xdea231=0xce;}_0x57a851[_0xce24('0x19')](_0xdea231);return _0x57a851[_0xce24('0x1e')](_0xce24('0x1f'),_0x2c2628+'-'+_0x201850+'/'+_0xb5a0d5)[_0xce24('0x20')](_0x55e7b0);}return null;};}function patchUpdates(_0x1470e1){return function(_0x51c1cd){try{jsonpatch[_0xce24('0x21')](_0x51c1cd,_0x1470e1,!![]);}catch(_0x3a0eaf){return BPromise[_0xce24('0x22')](_0x3a0eaf);}return _0x51c1cd[_0xce24('0x23')]();};}function saveUpdates(_0x30bb29,_0x50d8b0){return function(_0x41bb75){if(_0x41bb75){return _0x41bb75['update'](_0x30bb29)[_0xce24('0x24')](function(_0x1f394c){return _0x1f394c;});}return null;};}function removeEntity(_0x3937db,_0x517ae7){return function(_0x34bea8){if(_0x34bea8){return _0x34bea8[_0xce24('0x25')]()[_0xce24('0x24')](function(){_0x3937db[_0xce24('0x19')](0xcc)[_0xce24('0x1a')]();});}};}function handleEntityNotFound(_0x23da37,_0x3aae8b){return function(_0x97f58d){if(!_0x97f58d){_0x23da37[_0xce24('0x18')](0x194);}return _0x97f58d;};}function handleError(_0x1be8ca,_0x56ea96){_0x56ea96=_0x56ea96||0x1f4;return function(_0x130637){logger['error'](_0x130637[_0xce24('0x26')]);if(_0x130637[_0xce24('0x27')]){delete _0x130637[_0xce24('0x27')];}_0x1be8ca[_0xce24('0x19')](_0x56ea96)[_0xce24('0x28')](_0x130637);};}exports['update']=function(_0x191dfe,_0x55d650){if(_0x191dfe[_0xce24('0x29')]['id']){delete _0x191dfe[_0xce24('0x29')]['id'];}return db[_0xce24('0x2a')][_0xce24('0x2b')]({'where':{'id':_0x191dfe[_0xce24('0x2c')]['id']}})[_0xce24('0x24')](handleEntityNotFound(_0x55d650,null))['then'](saveUpdates(_0x191dfe['body'],null))[_0xce24('0x24')](respondWithResult(_0x55d650,null))[_0xce24('0x2d')](handleError(_0x55d650,null));};exports[_0xce24('0x25')]=function(_0x589706,_0x5849a3){return db[_0xce24('0x2a')][_0xce24('0x2b')]({'where':{'id':_0x589706[_0xce24('0x2c')]['id']}})[_0xce24('0x24')](handleEntityNotFound(_0x5849a3,null))[_0xce24('0x24')](removeEntity(_0x5849a3,null))[_0xce24('0x2d')](handleError(_0x5849a3,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 28df167..f34976d 100644 --- a/server/api/action/action.model.js +++ b/server/api/action/action.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x736c=['../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3ff52c,_0x54a5e9){var _0x1b0c0f=function(_0x251ef6){while(--_0x251ef6){_0x3ff52c['push'](_0x3ff52c['shift']());}};_0x1b0c0f(++_0x54a5e9);}(_0x736c,0x12b));var _0xc736=function(_0x5b2b34,_0xe14d30){_0x5b2b34=_0x5b2b34-0x0;var _0x31db59=_0x736c[_0x5b2b34];return _0x31db59;};'use strict';var _=require(_0xc736('0x0'));var util=require(_0xc736('0x1'));var logger=require(_0xc736('0x2'))(_0xc736('0x3'));var moment=require(_0xc736('0x4'));var BPromise=require(_0xc736('0x5'));var rp=require(_0xc736('0x6'));var fs=require('fs');var path=require(_0xc736('0x7'));var rimraf=require(_0xc736('0x8'));var config=require(_0xc736('0x9'));var attributes=require(_0xc736('0xa'));module[_0xc736('0xb')]=function(_0x558e5f,_0xd78ab){return _0x558e5f[_0xc736('0xc')]('Action',attributes,{'tableName':_0xc736('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe36e=['path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xe36e,0x157));var _0xee36=function(_0x15431a,_0x5b655f){_0x15431a=_0x15431a-0x0;var _0x4f1136=_0xe36e[_0x15431a];return _0x4f1136;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee36('0x0'))(_0xee36('0x1'));var moment=require(_0xee36('0x2'));var BPromise=require(_0xee36('0x3'));var rp=require(_0xee36('0x4'));var fs=require('fs');var path=require(_0xee36('0x5'));var rimraf=require(_0xee36('0x6'));var config=require(_0xee36('0x7'));var attributes=require(_0xee36('0x8'));module[_0xee36('0x9')]=function(_0x485a44,_0x590e89){return _0x485a44[_0xee36('0xa')]('Action',attributes,{'tableName':_0xee36('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 80de44c..d99e30a 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x13beb6,_0x360446){var _0x5d75c1=function(_0x147a54){while(--_0x147a54){_0x13beb6['push'](_0x13beb6['shift']());}};_0x5d75c1(++_0x360446);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xcb91[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x0713=['Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2735a9,_0x45554e){var _0x2182ad=function(_0x4518a4){while(--_0x4518a4){_0x2735a9['push'](_0x2735a9['shift']());}};_0x2182ad(++_0x45554e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index c5bdc2b..a66f176 100644 --- a/server/api/action/index.js +++ b/server/api/action/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc09=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports'];(function(_0x2f47f1,_0x17f6a7){var _0x1e2329=function(_0x8f5900){while(--_0x8f5900){_0x2f47f1['push'](_0x2f47f1['shift']());}};_0x1e2329(++_0x17f6a7);}(_0xfc09,0xf0));var _0x9fc0=function(_0x428de4,_0x4edb4b){_0x428de4=_0x428de4-0x0;var _0x4a21d0=_0xfc09[_0x428de4];return _0x4a21d0;};'use strict';var multer=require(_0x9fc0('0x0'));var util=require(_0x9fc0('0x1'));var path=require(_0x9fc0('0x2'));var timeout=require(_0x9fc0('0x3'));var express=require(_0x9fc0('0x4'));var router=express[_0x9fc0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9fc0('0x6'));var config=require(_0x9fc0('0x7'));var controller=require(_0x9fc0('0x8'));router[_0x9fc0('0x9')](_0x9fc0('0xa'),auth['isAuthenticated'](),controller[_0x9fc0('0xb')]);router[_0x9fc0('0xc')](_0x9fc0('0xa'),auth[_0x9fc0('0xd')](),controller[_0x9fc0('0xe')]);module[_0x9fc0('0xf')]=router; \ No newline at end of file +var _0xd7a7=['isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./action.controller','/:id'];(function(_0x40239d,_0x5981f9){var _0x4b2e96=function(_0x422a4f){while(--_0x422a4f){_0x40239d['push'](_0x40239d['shift']());}};_0x4b2e96(++_0x5981f9);}(_0xd7a7,0x1cd));var _0x7d7a=function(_0xb93a93,_0x10f654){_0xb93a93=_0xb93a93-0x0;var _0x26f62e=_0xd7a7[_0xb93a93];return _0x26f62e;};'use strict';var multer=require(_0x7d7a('0x0'));var util=require(_0x7d7a('0x1'));var path=require('path');var timeout=require(_0x7d7a('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x7d7a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7d7a('0x4'));var controller=require(_0x7d7a('0x5'));router['put'](_0x7d7a('0x6'),auth[_0x7d7a('0x7')](),controller[_0x7d7a('0x8')]);router[_0x7d7a('0x9')]('/:id',auth[_0x7d7a('0x7')](),controller[_0x7d7a('0xa')]);module[_0x7d7a('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 7a703dd..81c1416 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40f6=['sequelize','STRING','TEXT'];(function(_0x273e2b,_0x13d430){var _0x3d891b=function(_0x5d77b7){while(--_0x5d77b7){_0x273e2b['push'](_0x273e2b['shift']());}};_0x3d891b(++_0x13d430);}(_0x40f6,0x72));var _0x640f=function(_0x4cafe8,_0x11bb4a){_0x4cafe8=_0x4cafe8-0x0;var _0xc04520=_0x40f6[_0x4cafe8];return _0xc04520;};'use strict';var Sequelize=require(_0x640f('0x0'));module['exports']={'name':{'type':Sequelize[_0x640f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x640f('0x1')]},'parent':{'type':Sequelize[_0x640f('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x640f('0x2')]},'joins':{'type':Sequelize[_0x640f('0x2')]}}; \ No newline at end of file +var _0x5ba4=['STRING','TEXT','sequelize','exports'];(function(_0x4ad90a,_0x1130ce){var _0x3c1570=function(_0x183b48){while(--_0x183b48){_0x4ad90a['push'](_0x4ad90a['shift']());}};_0x3c1570(++_0x1130ce);}(_0x5ba4,0x1ce));var _0x45ba=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x5ba4[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require(_0x45ba('0x0'));module[_0x45ba('0x1')]={'name':{'type':Sequelize[_0x45ba('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x45ba('0x2')]},'parent':{'type':Sequelize[_0x45ba('0x2')]},'table':{'type':Sequelize[_0x45ba('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x45ba('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 8bd8d61..9231520 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.controller.js +++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x908d=['function','format','groupBy','DESC','joins','parse','includes','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','select','orderBy','alias','Sequelize','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','join','../../components/export/','../../files/reports','savename','COUNT(*)','runReport','HOUR(%s)','IS\x20NOT\x20NULL','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','then','get','CustomReports','UserProfileResource','destroy','end','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','type','VIRTUAL','merge','includeAll','include','catch','show','params','keys','length','options','create','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','MetricId','metric','replace'];(function(_0x91aa06,_0x2d2a2d){var _0x533ff6=function(_0x4cdd8d){while(--_0x4cdd8d){_0x91aa06['push'](_0x91aa06['shift']());}};_0x533ff6(++_0x2d2a2d);}(_0x908d,0x178));var _0xd908=function(_0x17c182,_0x3ae630){_0x17c182=_0x17c182-0x0;var _0x1d5cd9=_0x908d[_0x17c182];return _0x1d5cd9;};'use strict';var pdf=require(_0xd908('0x0'));var emlformat=require(_0xd908('0x1'));var rimraf=require(_0xd908('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd908('0x3'));var moment=require(_0xd908('0x4'));var BPromise=require(_0xd908('0x5'));var Mustache=require(_0xd908('0x6'));var util=require(_0xd908('0x7'));var path=require(_0xd908('0x8'));var sox=require('sox');var csv=require(_0xd908('0x9'));var ejs=require(_0xd908('0xa'));var fs=require('fs');var _=require(_0xd908('0xb'));var squel=require('squel');var crypto=require(_0xd908('0xc'));var jsforce=require(_0xd908('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd908('0x9'));var querystring=require('querystring');var Papa=require(_0xd908('0xe'));var Redis=require(_0xd908('0xf'));var authService=require(_0xd908('0x10'));var qs=require(_0xd908('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd908('0x12'));var logger=require(_0xd908('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd908('0x14'));var db=require(_0xd908('0x15'))['db'];function respondWithStatusCode(_0x2180c1,_0x5c0ff5){_0x5c0ff5=_0x5c0ff5||0xcc;return function(_0x5184e4){if(_0x5184e4){return _0x2180c1[_0xd908('0x16')](_0x5c0ff5);}return _0x2180c1['status'](_0x5c0ff5)['end']();};}function respondWithResult(_0xa96577,_0x47f550){_0x47f550=_0x47f550||0xc8;return function(_0x5a1502){if(_0x5a1502){return _0xa96577[_0xd908('0x17')](_0x47f550)[_0xd908('0x18')](_0x5a1502);}};}function respondWithFilteredResult(_0x464b03,_0x35b1c1){return function(_0x3ed807){if(_0x3ed807){var _0x2df58c=_0x3ed807[_0xd908('0x19')],_0x1e4fdb=_0x35b1c1[_0xd908('0x1a')],_0x2b5d1a=_0x35b1c1[_0xd908('0x1a')]+_0x35b1c1['limit'],_0x49846f;if(_0x2b5d1a>=_0x2df58c){_0x2b5d1a=_0x2df58c;_0x49846f=0xc8;}else{_0x49846f=0xce;}_0x464b03[_0xd908('0x17')](_0x49846f);return _0x464b03['set'](_0xd908('0x1b'),_0x1e4fdb+'-'+_0x2b5d1a+'/'+_0x2df58c)[_0xd908('0x18')](_0x3ed807);}return null;};}function patchUpdates(_0x121b48){return function(_0x138f61){try{jsonpatch[_0xd908('0x1c')](_0x138f61,_0x121b48,!![]);}catch(_0x19cc5d){return BPromise[_0xd908('0x1d')](_0x19cc5d);}return _0x138f61['save']();};}function saveUpdates(_0x3fa19e,_0x129847){return function(_0x531909){if(_0x531909){return _0x531909[_0xd908('0x1e')](_0x3fa19e)[_0xd908('0x1f')](function(_0x436cad){return _0x436cad;});}return null;};}function removeEntity(_0x16272b,_0x107af3){return function(_0x5ac0bb){if(_0x5ac0bb){return _0x5ac0bb['destroy']()[_0xd908('0x1f')](function(){var _0x484361=_0x5ac0bb[_0xd908('0x20')]({'plain':!![]});var _0x572c97=_0xd908('0x21');return db[_0xd908('0x22')][_0xd908('0x23')]({'where':{'type':_0x572c97,'resourceId':_0x484361['id']}})[_0xd908('0x1f')](function(){return _0x5ac0bb;});})[_0xd908('0x1f')](function(){_0x16272b[_0xd908('0x17')](0xcc)[_0xd908('0x24')]();});}};}function handleEntityNotFound(_0x4b1ae9,_0x5c1e15){return function(_0x1dcb51){if(!_0x1dcb51){_0x4b1ae9[_0xd908('0x16')](0x194);}return _0x1dcb51;};}function handleError(_0x352320,_0x174a9e){_0x174a9e=_0x174a9e||0x1f4;return function(_0x187725){logger[_0xd908('0x25')](_0x187725[_0xd908('0x26')]);if(_0x187725[_0xd908('0x27')]){delete _0x187725['name'];}_0x352320[_0xd908('0x17')](_0x174a9e)[_0xd908('0x28')](_0x187725);};}exports[_0xd908('0x29')]=function(_0xf1ef1e,_0x29e036){var _0x24d2e5={},_0x169d6b={},_0x4a96a9={'count':0x0,'rows':[]};var _0x78cbe9=_[_0xd908('0x2a')](db[_0xd908('0x2b')]['rawAttributes'],function(_0x5e5c6a){return{'name':_0x5e5c6a[_0xd908('0x2c')],'type':_0x5e5c6a['type'][_0xd908('0x2d')]};});_0x169d6b[_0xd908('0x2e')]=_[_0xd908('0x2a')](_0x78cbe9,_0xd908('0x27'));_0x169d6b[_0xd908('0x2f')]=_['keys'](_0xf1ef1e[_0xd908('0x2f')]);_0x169d6b[_0xd908('0x30')]=_[_0xd908('0x31')](_0x169d6b[_0xd908('0x2e')],_0x169d6b['query']);_0x24d2e5[_0xd908('0x32')]=_[_0xd908('0x31')](_0x169d6b['model'],qs[_0xd908('0x33')](_0xf1ef1e[_0xd908('0x2f')][_0xd908('0x33')]));_0x24d2e5[_0xd908('0x32')]=_0x24d2e5[_0xd908('0x32')]['length']?_0x24d2e5[_0xd908('0x32')]:_0x169d6b[_0xd908('0x2e')];if(!_0xf1ef1e['query'][_0xd908('0x34')](_0xd908('0x35'))){_0x24d2e5['limit']=qs[_0xd908('0x36')](_0xf1ef1e[_0xd908('0x2f')][_0xd908('0x36')]);_0x24d2e5[_0xd908('0x1a')]=qs['offset'](_0xf1ef1e[_0xd908('0x2f')][_0xd908('0x1a')]);}_0x24d2e5[_0xd908('0x37')]=qs[_0xd908('0x38')](_0xf1ef1e['query'][_0xd908('0x38')]);_0x24d2e5[_0xd908('0x39')]=qs[_0xd908('0x30')](_['pick'](_0xf1ef1e[_0xd908('0x2f')],_0x169d6b[_0xd908('0x30')]));if(_0xf1ef1e[_0xd908('0x2f')][_0xd908('0x3a')]){_0x24d2e5[_0xd908('0x39')]=_['merge'](_0x24d2e5['where'],{'$or':_[_0xd908('0x2a')](_0x78cbe9,function(_0x67d955){if(_0x67d955[_0xd908('0x3b')]!==_0xd908('0x3c')){var _0x3becda={};_0x3becda[_0x67d955[_0xd908('0x27')]]={'$like':'%'+_0xf1ef1e[_0xd908('0x2f')][_0xd908('0x3a')]+'%'};return _0x3becda;}})});}_0x24d2e5=_[_0xd908('0x3d')]({},_0x24d2e5,_0xf1ef1e['options']);var _0x393092={'where':_0x24d2e5['where']};return db[_0xd908('0x2b')]['count'](_0x393092)[_0xd908('0x1f')](function(_0x218b83){_0x4a96a9[_0xd908('0x19')]=_0x218b83;if(_0xf1ef1e[_0xd908('0x2f')][_0xd908('0x3e')]){_0x24d2e5[_0xd908('0x3f')]=[{'all':!![]}];}return db[_0xd908('0x2b')]['findAll'](_0x24d2e5);})['then'](function(_0x17eae7){_0x4a96a9['rows']=_0x17eae7;return _0x4a96a9;})['then'](respondWithFilteredResult(_0x29e036,_0x24d2e5))[_0xd908('0x40')](handleError(_0x29e036,null));};exports[_0xd908('0x41')]=function(_0x2950b6,_0x53ef34){var _0x7b6f48={'raw':![],'where':{'id':_0x2950b6[_0xd908('0x42')]['id']}},_0x434661={};_0x434661[_0xd908('0x2e')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0x434661[_0xd908('0x2f')]=_[_0xd908('0x43')](_0x2950b6[_0xd908('0x2f')]);_0x434661[_0xd908('0x30')]=_[_0xd908('0x31')](_0x434661['model'],_0x434661[_0xd908('0x2f')]);_0x7b6f48[_0xd908('0x32')]=_[_0xd908('0x31')](_0x434661[_0xd908('0x2e')],qs[_0xd908('0x33')](_0x2950b6[_0xd908('0x2f')][_0xd908('0x33')]));_0x7b6f48[_0xd908('0x32')]=_0x7b6f48[_0xd908('0x32')][_0xd908('0x44')]?_0x7b6f48[_0xd908('0x32')]:_0x434661[_0xd908('0x2e')];if(_0x2950b6[_0xd908('0x2f')]['includeAll']){_0x7b6f48['include']=[{'all':!![]}];}_0x7b6f48=_[_0xd908('0x3d')]({},_0x7b6f48,_0x2950b6[_0xd908('0x45')]);return db['AnalyticCustomReport']['find'](_0x7b6f48)[_0xd908('0x1f')](handleEntityNotFound(_0x53ef34,null))[_0xd908('0x1f')](respondWithResult(_0x53ef34,null))[_0xd908('0x40')](handleError(_0x53ef34,null));};exports[_0xd908('0x46')]=function(_0x36e7d5,_0x1c9961){return db[_0xd908('0x2b')]['create'](_0x36e7d5['body'],{})[_0xd908('0x1f')](function(_0x57a67d){var _0x33268f=_0x36e7d5['user']['get']({'plain':!![]});if(!_0x33268f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33268f[_0xd908('0x47')]==='user'){var _0x100d0e=_0x57a67d[_0xd908('0x20')]({'plain':!![]});var _0x213a10='Reports';return db[_0xd908('0x48')][_0xd908('0x49')]({'where':{'name':_0x213a10,'userProfileId':_0x33268f[_0xd908('0x4a')]},'raw':!![]})[_0xd908('0x1f')](function(_0x48f9eb){if(_0x48f9eb&&_0x48f9eb[_0xd908('0x4b')]===0x0){return db[_0xd908('0x22')][_0xd908('0x46')]({'name':_0x100d0e[_0xd908('0x27')],'resourceId':_0x100d0e['id'],'type':_0xd908('0x21'),'sectionId':_0x48f9eb['id']},{})[_0xd908('0x1f')](function(){return _0x57a67d;});}else{return _0x57a67d;}})[_0xd908('0x40')](function(_0xb14c9d){logger['error'](_0xd908('0x4c'),_0xb14c9d);throw _0xb14c9d;});}return _0x57a67d;})[_0xd908('0x1f')](respondWithResult(_0x1c9961,0xc9))[_0xd908('0x40')](handleError(_0x1c9961,null));};exports[_0xd908('0x1e')]=function(_0x303365,_0x2a68dd){if(_0x303365[_0xd908('0x4d')]['id']){delete _0x303365[_0xd908('0x4d')]['id'];}return db[_0xd908('0x2b')][_0xd908('0x49')]({'where':{'id':_0x303365[_0xd908('0x42')]['id']}})[_0xd908('0x1f')](handleEntityNotFound(_0x2a68dd,null))['then'](saveUpdates(_0x303365[_0xd908('0x4d')],null))['then'](respondWithResult(_0x2a68dd,null))[_0xd908('0x40')](handleError(_0x2a68dd,null));};exports['destroy']=function(_0x4e0fc1,_0x5bdb3f){return db['AnalyticCustomReport'][_0xd908('0x49')]({'where':{'id':_0x4e0fc1[_0xd908('0x42')]['id']}})[_0xd908('0x1f')](handleEntityNotFound(_0x5bdb3f,null))[_0xd908('0x1f')](removeEntity(_0x5bdb3f,null))['catch'](handleError(_0x5bdb3f,null));};exports[_0xd908('0x4e')]=function(_0x5b2a21,_0x16d866){var _0x551599=0xa;var _0x239498=['join',_0xd908('0x4f'),'right_join',_0xd908('0x50')];var _0x2c37d3={'SUM':'SUM(%s)','COUNT':_0xd908('0x51'),'COUNT DISTINCT':_0xd908('0x52'),'MAX':_0xd908('0x53'),'MIN':_0xd908('0x54'),'AVG':_0xd908('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd908('0x56')};var _0x8c52fd={'SEC_TO_TIME':_0xd908('0x57'),'DATE':_0xd908('0x58'),'HOUR':'HOUR(%s)','ROUND':_0xd908('0x59'),'UNIX_TIMESTAMP':_0xd908('0x5a')};var _0x306275=function(_0x3080ab){return!_['includes']([_0xd908('0x5b'),'IS\x20NOT\x20NULL',_0xd908('0x5c'),_0xd908('0x5d')],_0x3080ab);};var _0x437375=function(_0x122352){if(!_0x122352||!_0x122352[_0xd908('0x5e')]['length']){return'';}for(var _0x4865ee='(',_0x354100=0x0;_0x354100<_0x122352[_0xd908('0x5e')][_0xd908('0x44')];_0x354100+=0x1){_0x354100>0x0&&(_0x4865ee+='\x20'+_0x122352[_0xd908('0x5f')]+'\x20');_0x4865ee+=_0x122352[_0xd908('0x5e')][_0x354100][_0xd908('0x60')]?_0x437375(_0x122352['rules'][_0x354100][_0xd908('0x60')]):_0x122352[_0xd908('0x5e')][_0x354100][_0xd908('0x61')]+'\x20'+_0x122352[_0xd908('0x5e')][_0x354100]['condition']+(_0x306275(_0x122352['rules'][_0x354100][_0xd908('0x62')])?'\x20'+_0x122352[_0xd908('0x5e')][_0x354100][_0xd908('0x63')]:'');}return _0x4865ee+')';};var _0x3605a3={'where':{'id':_0x5b2a21[_0xd908('0x42')]['id']}},_0x4b846d,_0x5dc2db,_0x3885be,_0xf52082,_0x47bd7f;_0x3605a3=_['merge']({},_0x3605a3,_0x5b2a21[_0xd908('0x45')]);return db[_0xd908('0x2b')][_0xd908('0x49')](_0x3605a3)['then'](function(_0x3d9423){if(_0x3d9423){_0x4b846d=_0x3d9423;return _0x3d9423[_0xd908('0x64')]();}return null;})[_0xd908('0x1f')](function(_0x1ed19a){if(_0x1ed19a){if(!_0x1ed19a[_0xd908('0x44')]){throw new db['Sequelize'][(_0xd908('0x65'))](_0xd908('0x66'),0x193);}_0x5dc2db=_0x1ed19a;return db[_0xd908('0x67')][_0xd908('0x68')]({'raw':!![]});}return null;})[_0xd908('0x1f')](function(_0x7d8d0){if(_0x7d8d0){_0x3885be=_[_0xd908('0x69')](_0x7d8d0,'id');var _0x3afc1d;var _0x14ab1f=squel['select']();_0x14ab1f[_0xd908('0x6a')](_0x4b846d['table']);for(var _0x33709f=0x0;_0x33709f<_0x5dc2db[_0xd908('0x44')];_0x33709f+=0x1){_0x3afc1d=_0x5dc2db[_0x33709f][_0xd908('0x6b')]?_0x3885be[_0x5dc2db[_0x33709f]['MetricId']][_0xd908('0x6c')]:_0x5dc2db[_0x33709f][_0xd908('0x61')];_0x3afc1d=_0x5dc2db[_0x33709f]['function']?_[_0xd908('0x6d')](_0x2c37d3[_0x5dc2db[_0x33709f][_0xd908('0x6e')]],'%s',_0x3afc1d):_0x3afc1d;_0x3afc1d=_0x5dc2db[_0x33709f][_0xd908('0x6f')]?_['replace'](_0x8c52fd[_0x5dc2db[_0x33709f][_0xd908('0x6f')]],'%s',_0x3afc1d):_0x3afc1d;if(_0x5dc2db[_0x33709f][_0xd908('0x70')]){_0x14ab1f[_0xd908('0x60')](_0x3afc1d);}_0x5dc2db[_0x33709f]['orderBy']&&_0x14ab1f[_0xd908('0x37')](_0x3afc1d,_0x5dc2db[_0x33709f]['orderBy']===_0xd908('0x71')?![]:!![]);_0x14ab1f[_0xd908('0x61')](_0x3afc1d,_0x5dc2db[_0x33709f]['alias']||_0x3afc1d);}if(_0x4b846d[_0xd908('0x72')]){_0x4b846d[_0xd908('0x72')]=JSON[_0xd908('0x73')](_0x4b846d[_0xd908('0x72')]);for(var _0x1df691=0x0;_0x1df691<_0x4b846d[_0xd908('0x72')]['length'];_0x1df691+=0x1){if(_0x4b846d[_0xd908('0x72')][_0x1df691]['type']&&_[_0xd908('0x74')](_0x239498,_0x4b846d[_0xd908('0x72')][_0x1df691][_0xd908('0x3b')])&&_0x4b846d[_0xd908('0x72')][_0x1df691][_0xd908('0x75')]&&_0x4b846d[_0xd908('0x72')][_0x1df691]['foreignTable']&&_0x4b846d[_0xd908('0x72')][_0x1df691][_0xd908('0x76')]){_0x14ab1f[_0x4b846d[_0xd908('0x72')][_0x1df691][_0xd908('0x3b')]](_0x4b846d[_0xd908('0x72')][_0x1df691][_0xd908('0x77')],null,util[_0xd908('0x6f')](_0xd908('0x78'),_0x4b846d[_0xd908('0x79')],_0x4b846d[_0xd908('0x72')][_0x1df691][_0xd908('0x75')],_0x4b846d['joins'][_0x1df691][_0xd908('0x77')],_0x4b846d[_0xd908('0x72')][_0x1df691][_0xd908('0x76')]));}}}if(_0x4b846d['conditions']){_0x4b846d['conditions']=JSON[_0xd908('0x73')](_0x4b846d['conditions']);_0x14ab1f[_0xd908('0x39')](_0x437375(_0x4b846d[_0xd908('0x7a')]['group']));}_0x47bd7f=_0x14ab1f[_0xd908('0x7b')]();_0x14ab1f['limit'](_0x551599);_0x14ab1f[_0xd908('0x1a')](0x0);logger[_0xd908('0x7c')](_0xd908('0x7d'),_0x14ab1f[_0xd908('0x7e')]());return db[_0xd908('0x7f')][_0xd908('0x2f')](_0x14ab1f['toString'](),{'type':db[_0xd908('0x7f')][_0xd908('0x80')][_0xd908('0x81')]});}})[_0xd908('0x1f')](respondWithResult(_0x16d866,null))[_0xd908('0x40')](handleError(_0x16d866,null));};function runReport(_0x2bfc66,_0x5009f7,_0x5105d3){var _0x192b3d=_0x5009f7[_0xd908('0x27')];var _0x253c3a=0xa;var _0x4ee9d2=['join',_0xd908('0x4f'),_0xd908('0x82'),_0xd908('0x50')];var _0x4e577d={'SUM':_0xd908('0x83'),'COUNT':_0xd908('0x51'),'COUNT DISTINCT':_0xd908('0x52'),'MAX':_0xd908('0x53'),'MIN':_0xd908('0x54'),'AVG':_0xd908('0x55'),'GROUP_CONCAT':_0xd908('0x84'),'GROUP_CONCAT ASC':_0xd908('0x85'),'GROUP_CONCAT DESC':_0xd908('0x56')};var _0x73eab1={'SEC_TO_TIME':_0xd908('0x57'),'DATE':_0xd908('0x58'),'HOUR':'HOUR(%s)','ROUND':_0xd908('0x59'),'UNIX_TIMESTAMP':_0xd908('0x5a')};var _0x5070b8=function(_0x30e04b){return!_[_0xd908('0x74')]([_0xd908('0x5b'),'IS\x20NOT\x20NULL',_0xd908('0x5c'),_0xd908('0x5d')],_0x30e04b);};var _0x5f3977=function(_0x4fb298){if(!_0x4fb298||!_0x4fb298[_0xd908('0x5e')][_0xd908('0x44')]){return'';}for(var _0x2cebc3='(',_0x5da384=0x0;_0x5da384<_0x4fb298['rules'][_0xd908('0x44')];_0x5da384+=0x1){_0x5da384>0x0&&(_0x2cebc3+='\x20'+_0x4fb298[_0xd908('0x5f')]+'\x20');_0x2cebc3+=_0x4fb298[_0xd908('0x5e')][_0x5da384][_0xd908('0x60')]?_0x5f3977(_0x4fb298['rules'][_0x5da384][_0xd908('0x60')]):_0x4fb298[_0xd908('0x5e')][_0x5da384]['field']+'\x20'+_0x4fb298['rules'][_0x5da384][_0xd908('0x62')]+(_0x5070b8(_0x4fb298[_0xd908('0x5e')][_0x5da384][_0xd908('0x62')])?'\x20'+_0x4fb298['rules'][_0x5da384][_0xd908('0x63')]:'');}return _0x2cebc3+')';};var _0x43122b={'where':{'id':_0x2bfc66['id']}},_0x4621b6,_0x34e6d0,_0x104b2b,_0x964b34,_0x2b128a;_0x43122b=_[_0xd908('0x3d')]({},_0x43122b,_0x5105d3);return db[_0xd908('0x2b')][_0xd908('0x49')](_0x43122b)[_0xd908('0x1f')](function(_0x80f9be){if(_0x80f9be){_0x4621b6=_0x80f9be;return _0x80f9be[_0xd908('0x64')]();}return null;})[_0xd908('0x1f')](function(_0x3a8ff8){if(_0x3a8ff8){if(!_0x3a8ff8[_0xd908('0x44')]){throw new db['Sequelize'][(_0xd908('0x65'))](_0xd908('0x66'),0x193);}_0x34e6d0=_0x3a8ff8;return db[_0xd908('0x67')][_0xd908('0x68')]({'raw':!![]});}return null;})['then'](function(_0x28ae1c){if(_0x28ae1c){_0x104b2b=_['keyBy'](_0x28ae1c,'id');var _0x1b8283;var _0x5b5cb1=squel[_0xd908('0x86')]();_0x5b5cb1[_0xd908('0x6a')](_0x4621b6[_0xd908('0x79')]);for(var _0x1896bf=0x0;_0x1896bf<_0x34e6d0[_0xd908('0x44')];_0x1896bf+=0x1){_0x1b8283=_0x34e6d0[_0x1896bf][_0xd908('0x6b')]?_0x104b2b[_0x34e6d0[_0x1896bf]['MetricId']][_0xd908('0x6c')]:_0x34e6d0[_0x1896bf][_0xd908('0x61')];_0x1b8283=_0x34e6d0[_0x1896bf][_0xd908('0x6e')]?_['replace'](_0x4e577d[_0x34e6d0[_0x1896bf][_0xd908('0x6e')]],'%s',_0x1b8283):_0x1b8283;_0x1b8283=_0x34e6d0[_0x1896bf]['format']?_[_0xd908('0x6d')](_0x73eab1[_0x34e6d0[_0x1896bf][_0xd908('0x6f')]],'%s',_0x1b8283):_0x1b8283;if(_0x34e6d0[_0x1896bf][_0xd908('0x70')]){_0x5b5cb1[_0xd908('0x60')](_0x1b8283);}_0x34e6d0[_0x1896bf][_0xd908('0x87')]&&_0x5b5cb1[_0xd908('0x37')](_0x1b8283,_0x34e6d0[_0x1896bf][_0xd908('0x87')]===_0xd908('0x71')?![]:!![]);_0x5b5cb1[_0xd908('0x61')](_0x1b8283,_0x34e6d0[_0x1896bf][_0xd908('0x88')]||_0x1b8283);}if(_0x4621b6['joins']){_0x4621b6['joins']=JSON[_0xd908('0x73')](_0x4621b6[_0xd908('0x72')]);for(var _0x4ea165=0x0;_0x4ea165<_0x4621b6[_0xd908('0x72')]['length'];_0x4ea165+=0x1){if(_0x4621b6[_0xd908('0x72')][_0x4ea165][_0xd908('0x3b')]&&_[_0xd908('0x74')](_0x4ee9d2,_0x4621b6[_0xd908('0x72')][_0x4ea165][_0xd908('0x3b')])&&_0x4621b6[_0xd908('0x72')][_0x4ea165][_0xd908('0x75')]&&_0x4621b6[_0xd908('0x72')][_0x4ea165][_0xd908('0x77')]&&_0x4621b6['joins'][_0x4ea165]['foreignKey']){_0x5b5cb1[_0x4621b6[_0xd908('0x72')][_0x4ea165][_0xd908('0x3b')]](_0x4621b6[_0xd908('0x72')][_0x4ea165]['foreignTable'],null,util[_0xd908('0x6f')](_0xd908('0x78'),_0x4621b6['table'],_0x4621b6[_0xd908('0x72')][_0x4ea165][_0xd908('0x75')],_0x4621b6[_0xd908('0x72')][_0x4ea165][_0xd908('0x77')],_0x4621b6[_0xd908('0x72')][_0x4ea165]['foreignKey']));}}}if(_0x4621b6['conditions']){_0x4621b6['conditions']=JSON[_0xd908('0x73')](_0x4621b6[_0xd908('0x7a')]);_0x5b5cb1[_0xd908('0x39')](_0x5f3977(_0x4621b6['conditions'][_0xd908('0x60')]));}_0x2b128a=_0x5b5cb1[_0xd908('0x7b')]();_0x5b5cb1[_0xd908('0x36')](_0x253c3a);_0x5b5cb1[_0xd908('0x1a')](0x0);logger[_0xd908('0x7c')](_0xd908('0x7d'),_0x5b5cb1[_0xd908('0x7e')]());return db[_0xd908('0x7f')]['query'](_0x5b5cb1[_0xd908('0x7e')](),{'type':db[_0xd908('0x7f')]['QueryTypes'][_0xd908('0x81')]});}})['then'](function(_0x2d3d7d){if(!_0x2d3d7d['length']){throw new db[(_0xd908('0x89'))][(_0xd908('0x65'))](_0xd908('0x8a'),0xcc);}if(_0x5009f7[_0xd908('0x8b')]===_0xd908('0x8c')){return null;}var _0x445347=_[_0xd908('0x3d')](_0x5009f7,{'name':_0x5009f7[_0xd908('0x8d')]||_0x5009f7[_0xd908('0x27')]||_0x4621b6[_0xd908('0x27')],'basename':_0x192b3d,'savename':util[_0xd908('0x6f')]('%s-%s.%s',_0x5009f7[_0xd908('0x27')]||_0x4621b6[_0xd908('0x27')],require(_0xd908('0x8e'))[_0xd908('0x8f')](0x4),_0x5009f7[_0xd908('0x8b')]||_0xd908('0x90')),'reportId':_0x4621b6['id'],'reportType':_0xd908('0x91')});return db[_0xd908('0x92')][_0xd908('0x46')](_0x445347,{'raw':!![]});})[_0xd908('0x1f')](function(_0x1d7ddc){if(_0x4621b6[_0xd908('0x79')]===_0xd908('0x93')){_0x2b128a[_0xd908('0x39')](_0x4621b6[_0xd908('0x79')]+_0xd908('0x94'),_0x5009f7['startDate'],_0x5009f7['endDate']);}else{_0x2b128a['where'](_0x4621b6['table']+_0xd908('0x95'),_0x5009f7['startDate'],_0x5009f7['endDate']);}if(_0x1d7ddc){logger[_0xd908('0x96')](_0xd908('0x97'),_0x2b128a[_0xd908('0x7e')]());require(_0xd908('0x98'))[_0xd908('0x99')](path[_0xd908('0x9a')](__dirname,_0xd908('0x9b'),_0x1d7ddc[_0xd908('0x8b')]),[_0x1d7ddc['id'],_0x2b128a[_0xd908('0x7e')](),path[_0xd908('0x9a')](__dirname,_0xd908('0x9c'),_0x1d7ddc[_0xd908('0x9d')]),_0x192b3d]);return _0x1d7ddc;}else{var _0x53bb73=squel[_0xd908('0x86')]();_0x53bb73[_0xd908('0x6a')]('('+_0x2b128a[_0xd908('0x7e')]()+')','countTable');_0x53bb73[_0xd908('0x61')](_0xd908('0x9e'),_0xd908('0x19'));_0x2b128a['limit'](_0x5009f7[_0xd908('0x36')]||_0x253c3a);_0x2b128a[_0xd908('0x1a')](_0x5009f7[_0xd908('0x1a')]||0x0);return db[_0xd908('0x7f')][_0xd908('0x2f')](_0x53bb73['toString'](),{'type':db['sequelize']['QueryTypes'][_0xd908('0x81')]})[_0xd908('0x1f')](function(_0x209f10){if(!_0x209f10[_0xd908('0x44')]){_0x964b34=0x0;}else{_0x964b34=_0x209f10[0x0]['count']||0x0;}return db[_0xd908('0x7f')][_0xd908('0x2f')](_0x2b128a[_0xd908('0x7e')](),{'type':db[_0xd908('0x7f')][_0xd908('0x80')][_0xd908('0x81')]});})[_0xd908('0x1f')](function(_0x45c00d){return{'rows':_0x45c00d||[],'count':_0x964b34};});}});}exports['run']=function(_0x45e122,_0x4fe3f6){return runReport(_0x45e122[_0xd908('0x42')],_0x45e122[_0xd908('0x2f')],_0x45e122[_0xd908('0x45')])[_0xd908('0x1f')](respondWithResult(_0x4fe3f6,null))[_0xd908('0x40')](handleError(_0x4fe3f6,null));};exports[_0xd908('0x9f')]=runReport;exports[_0xd908('0x2f')]=function(_0x5e572a,_0x266404){var _0x21da0a=0xa;var _0x33d923=[_0xd908('0x9a'),_0xd908('0x4f'),'right_join','cross_join'];var _0x470410={'SUM':'SUM(%s)','COUNT':_0xd908('0x51'),'COUNT DISTINCT':_0xd908('0x52'),'MAX':_0xd908('0x53'),'MIN':_0xd908('0x54'),'AVG':_0xd908('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd908('0x85'),'GROUP_CONCAT DESC':_0xd908('0x56')};var _0x1bf14e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd908('0x58'),'HOUR':_0xd908('0xa0'),'ROUND':_0xd908('0x59'),'UNIX_TIMESTAMP':_0xd908('0x5a')};var _0x21e759=function(_0xcaa71c){return!_[_0xd908('0x74')]([_0xd908('0x5b'),_0xd908('0xa1'),_0xd908('0x5c'),'IS\x20NOT\x20EMPTY'],_0xcaa71c);};var _0x5771a8=function(_0x5e9102){if(!_0x5e9102||!_0x5e9102['rules']['length']){return'';}for(var _0x4aa820='(',_0x241422=0x0;_0x241422<_0x5e9102[_0xd908('0x5e')][_0xd908('0x44')];_0x241422+=0x1){_0x241422>0x0&&(_0x4aa820+='\x20'+_0x5e9102[_0xd908('0x5f')]+'\x20');_0x4aa820+=_0x5e9102[_0xd908('0x5e')][_0x241422][_0xd908('0x60')]?_0x5771a8(_0x5e9102[_0xd908('0x5e')][_0x241422][_0xd908('0x60')]):_0x5e9102['rules'][_0x241422]['field']+'\x20'+_0x5e9102['rules'][_0x241422][_0xd908('0x62')]+(_0x21e759(_0x5e9102[_0xd908('0x5e')][_0x241422][_0xd908('0x62')])?'\x20'+_0x5e9102[_0xd908('0x5e')][_0x241422]['value']:'');}return _0x4aa820+')';};var _0x3377cc={'where':{'id':_0x5e572a[_0xd908('0x42')]['id']}},_0x3bf20d,_0x4920ec,_0x4ab960,_0x23fe5f,_0x3c380d;_0x3377cc=_[_0xd908('0x3d')]({},_0x3377cc,_0x5e572a[_0xd908('0x45')]);return db[_0xd908('0x2b')][_0xd908('0x49')](_0x3377cc)[_0xd908('0x1f')](function(_0x101c9a){if(_0x101c9a){_0x3bf20d=_0x101c9a;return _0x101c9a['getFields']();}return null;})[_0xd908('0x1f')](function(_0x30f1db){if(_0x30f1db){if(!_0x30f1db[_0xd908('0x44')]){throw new db[(_0xd908('0x89'))][(_0xd908('0x65'))](_0xd908('0x66'),0x193);}_0x4920ec=_0x30f1db;return db[_0xd908('0x67')][_0xd908('0x68')]({'raw':!![]});}return null;})[_0xd908('0x1f')](function(_0x265ba0){if(_0x265ba0){_0x4ab960=_[_0xd908('0x69')](_0x265ba0,'id');var _0x39c107;var _0x31f7a6=squel[_0xd908('0x86')]();_0x31f7a6[_0xd908('0x6a')](_0x3bf20d[_0xd908('0x79')]);for(var _0x342183=0x0;_0x342183<_0x4920ec[_0xd908('0x44')];_0x342183+=0x1){_0x39c107=_0x4920ec[_0x342183][_0xd908('0x6b')]?_0x4ab960[_0x4920ec[_0x342183][_0xd908('0x6b')]][_0xd908('0x6c')]:_0x4920ec[_0x342183][_0xd908('0x61')];_0x39c107=_0x4920ec[_0x342183][_0xd908('0x6e')]?_[_0xd908('0x6d')](_0x470410[_0x4920ec[_0x342183][_0xd908('0x6e')]],'%s',_0x39c107):_0x39c107;_0x39c107=_0x4920ec[_0x342183][_0xd908('0x6f')]?_[_0xd908('0x6d')](_0x1bf14e[_0x4920ec[_0x342183][_0xd908('0x6f')]],'%s',_0x39c107):_0x39c107;if(_0x4920ec[_0x342183][_0xd908('0x70')]){_0x31f7a6[_0xd908('0x60')](_0x39c107);}_0x4920ec[_0x342183]['orderBy']&&_0x31f7a6['order'](_0x39c107,_0x4920ec[_0x342183]['orderBy']===_0xd908('0x71')?![]:!![]);_0x31f7a6[_0xd908('0x61')](_0x39c107,_0x4920ec[_0x342183][_0xd908('0x88')]||_0x39c107);}if(_0x3bf20d[_0xd908('0x72')]){_0x3bf20d[_0xd908('0x72')]=JSON[_0xd908('0x73')](_0x3bf20d[_0xd908('0x72')]);for(var _0x2da8b7=0x0;_0x2da8b7<_0x3bf20d[_0xd908('0x72')][_0xd908('0x44')];_0x2da8b7+=0x1){if(_0x3bf20d[_0xd908('0x72')][_0x2da8b7][_0xd908('0x3b')]&&_[_0xd908('0x74')](_0x33d923,_0x3bf20d[_0xd908('0x72')][_0x2da8b7]['type'])&&_0x3bf20d[_0xd908('0x72')][_0x2da8b7][_0xd908('0x75')]&&_0x3bf20d[_0xd908('0x72')][_0x2da8b7]['foreignTable']&&_0x3bf20d['joins'][_0x2da8b7]['foreignKey']){_0x31f7a6[_0x3bf20d[_0xd908('0x72')][_0x2da8b7]['type']](_0x3bf20d[_0xd908('0x72')][_0x2da8b7][_0xd908('0x77')],null,util['format'](_0xd908('0x78'),_0x3bf20d['table'],_0x3bf20d[_0xd908('0x72')][_0x2da8b7]['parentKey'],_0x3bf20d[_0xd908('0x72')][_0x2da8b7]['foreignTable'],_0x3bf20d['joins'][_0x2da8b7][_0xd908('0x76')]));}}}if(_0x3bf20d[_0xd908('0x7a')]){_0x3bf20d['conditions']=JSON[_0xd908('0x73')](_0x3bf20d[_0xd908('0x7a')]);_0x31f7a6[_0xd908('0x39')](_0x5771a8(_0x3bf20d[_0xd908('0x7a')][_0xd908('0x60')]));}_0x3c380d=_0x31f7a6[_0xd908('0x7b')]();_0x31f7a6['limit'](_0x21da0a);_0x31f7a6[_0xd908('0x1a')](0x0);logger[_0xd908('0x7c')](_0xd908('0x7d'),_0x31f7a6[_0xd908('0x7e')]());return db[_0xd908('0x7f')][_0xd908('0x2f')](_0x31f7a6[_0xd908('0x7e')](),{'type':db['sequelize'][_0xd908('0x80')][_0xd908('0x81')]});}})['then'](function(){return{'sql':_0x3c380d['toString']()};})[_0xd908('0x1f')](respondWithResult(_0x266404,null))[_0xd908('0x40')](handleError(_0x266404,null));}; \ No newline at end of file +var _0x4cad=['field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','groupBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','cross_join','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','value','Please\x20insert\x20at\x20least\x20one\x20field','metric','replace','orderBy','order','DESC','%s.%s\x20=\x20%s.%s','debug','No\x20available\x20data','fullPath','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','sort','where','filter','VIRTUAL','merge','options','AnalyticCustomReport','findAll','catch','show','params','keys','length','includeAll','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group'];(function(_0x31bbf7,_0x292c9a){var _0x1469f3=function(_0x58ca15){while(--_0x58ca15){_0x31bbf7['push'](_0x31bbf7['shift']());}};_0x1469f3(++_0x292c9a);}(_0x4cad,0xe7));var _0xd4ca=function(_0x5cd998,_0x295cd6){_0x5cd998=_0x5cd998-0x0;var _0x115ad2=_0x4cad[_0x5cd998];return _0x115ad2;};'use strict';var pdf=require(_0xd4ca('0x0'));var emlformat=require(_0xd4ca('0x1'));var rimraf=require(_0xd4ca('0x2'));var zipdir=require(_0xd4ca('0x3'));var jsonpatch=require(_0xd4ca('0x4'));var rp=require(_0xd4ca('0x5'));var moment=require(_0xd4ca('0x6'));var BPromise=require(_0xd4ca('0x7'));var Mustache=require(_0xd4ca('0x8'));var util=require(_0xd4ca('0x9'));var path=require(_0xd4ca('0xa'));var sox=require(_0xd4ca('0xb'));var csv=require(_0xd4ca('0xc'));var ejs=require(_0xd4ca('0xd'));var fs=require('fs');var _=require(_0xd4ca('0xe'));var squel=require(_0xd4ca('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd4ca('0x10'));var toCsv=require(_0xd4ca('0xc'));var querystring=require('querystring');var Papa=require(_0xd4ca('0x11'));var Redis=require(_0xd4ca('0x12'));var authService=require(_0xd4ca('0x13'));var qs=require(_0xd4ca('0x14'));var as=require(_0xd4ca('0x15'));var hardwareService=require(_0xd4ca('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xd4ca('0x17'));var config=require(_0xd4ca('0x18'));var db=require(_0xd4ca('0x19'))['db'];function respondWithStatusCode(_0x2e6836,_0x16862e){_0x16862e=_0x16862e||0xcc;return function(_0x3e36b0){if(_0x3e36b0){return _0x2e6836['sendStatus'](_0x16862e);}return _0x2e6836['status'](_0x16862e)[_0xd4ca('0x1a')]();};}function respondWithResult(_0x4ea091,_0x218085){_0x218085=_0x218085||0xc8;return function(_0x1e4838){if(_0x1e4838){return _0x4ea091[_0xd4ca('0x1b')](_0x218085)[_0xd4ca('0x1c')](_0x1e4838);}};}function respondWithFilteredResult(_0x3fd2df,_0x25fe0e){return function(_0xed9aca){if(_0xed9aca){var _0x38e8f3=_0xed9aca[_0xd4ca('0x1d')],_0x5d79c6=_0x25fe0e['offset'],_0x2f16c3=_0x25fe0e['offset']+_0x25fe0e['limit'],_0x25825e;if(_0x2f16c3>=_0x38e8f3){_0x2f16c3=_0x38e8f3;_0x25825e=0xc8;}else{_0x25825e=0xce;}_0x3fd2df[_0xd4ca('0x1b')](_0x25825e);return _0x3fd2df[_0xd4ca('0x1e')](_0xd4ca('0x1f'),_0x5d79c6+'-'+_0x2f16c3+'/'+_0x38e8f3)[_0xd4ca('0x1c')](_0xed9aca);}return null;};}function patchUpdates(_0x2fd3cb){return function(_0x703b7c){try{jsonpatch[_0xd4ca('0x20')](_0x703b7c,_0x2fd3cb,!![]);}catch(_0x4a62aa){return BPromise[_0xd4ca('0x21')](_0x4a62aa);}return _0x703b7c[_0xd4ca('0x22')]();};}function saveUpdates(_0x34ca2d,_0x426115){return function(_0x191bbf){if(_0x191bbf){return _0x191bbf[_0xd4ca('0x23')](_0x34ca2d)[_0xd4ca('0x24')](function(_0x4f55a3){return _0x4f55a3;});}return null;};}function removeEntity(_0x947b7b,_0x1f8626){return function(_0x1a72dc){if(_0x1a72dc){return _0x1a72dc[_0xd4ca('0x25')]()[_0xd4ca('0x24')](function(){var _0x4c2701=_0x1a72dc['get']({'plain':!![]});var _0x1de937=_0xd4ca('0x26');return db[_0xd4ca('0x27')][_0xd4ca('0x25')]({'where':{'type':_0x1de937,'resourceId':_0x4c2701['id']}})[_0xd4ca('0x24')](function(){return _0x1a72dc;});})[_0xd4ca('0x24')](function(){_0x947b7b['status'](0xcc)[_0xd4ca('0x1a')]();});}};}function handleEntityNotFound(_0x1d618c,_0x45e1ee){return function(_0x3f35de){if(!_0x3f35de){_0x1d618c[_0xd4ca('0x28')](0x194);}return _0x3f35de;};}function handleError(_0x21b1d8,_0x5bedb2){_0x5bedb2=_0x5bedb2||0x1f4;return function(_0x192613){logger[_0xd4ca('0x29')](_0x192613[_0xd4ca('0x2a')]);if(_0x192613[_0xd4ca('0x2b')]){delete _0x192613[_0xd4ca('0x2b')];}_0x21b1d8[_0xd4ca('0x1b')](_0x5bedb2)[_0xd4ca('0x2c')](_0x192613);};}exports[_0xd4ca('0x2d')]=function(_0x1a473b,_0x239619){var _0x6d9426={},_0x113ce5={},_0x247fb3={'count':0x0,'rows':[]};var _0x40e26b=_['map'](db['AnalyticCustomReport'][_0xd4ca('0x2e')],function(_0x46fc31){return{'name':_0x46fc31[_0xd4ca('0x2f')],'type':_0x46fc31[_0xd4ca('0x30')][_0xd4ca('0x31')]};});_0x113ce5[_0xd4ca('0x32')]=_[_0xd4ca('0x33')](_0x40e26b,'name');_0x113ce5[_0xd4ca('0x34')]=_['keys'](_0x1a473b[_0xd4ca('0x34')]);_0x113ce5[_0xd4ca('0x35')]=_['intersection'](_0x113ce5[_0xd4ca('0x32')],_0x113ce5['query']);_0x6d9426[_0xd4ca('0x36')]=_[_0xd4ca('0x37')](_0x113ce5[_0xd4ca('0x32')],qs[_0xd4ca('0x38')](_0x1a473b[_0xd4ca('0x34')]['fields']));_0x6d9426[_0xd4ca('0x36')]=_0x6d9426[_0xd4ca('0x36')]['length']?_0x6d9426['attributes']:_0x113ce5['model'];if(!_0x1a473b['query'][_0xd4ca('0x39')](_0xd4ca('0x3a'))){_0x6d9426[_0xd4ca('0x3b')]=qs[_0xd4ca('0x3b')](_0x1a473b[_0xd4ca('0x34')][_0xd4ca('0x3b')]);_0x6d9426[_0xd4ca('0x3c')]=qs[_0xd4ca('0x3c')](_0x1a473b[_0xd4ca('0x34')]['offset']);}_0x6d9426['order']=qs[_0xd4ca('0x3d')](_0x1a473b['query'][_0xd4ca('0x3d')]);_0x6d9426[_0xd4ca('0x3e')]=qs['filters'](_['pick'](_0x1a473b[_0xd4ca('0x34')],_0x113ce5[_0xd4ca('0x35')]));if(_0x1a473b[_0xd4ca('0x34')][_0xd4ca('0x3f')]){_0x6d9426['where']=_['merge'](_0x6d9426[_0xd4ca('0x3e')],{'$or':_[_0xd4ca('0x33')](_0x40e26b,function(_0x2886c8){if(_0x2886c8['type']!==_0xd4ca('0x40')){var _0x49b897={};_0x49b897[_0x2886c8[_0xd4ca('0x2b')]]={'$like':'%'+_0x1a473b[_0xd4ca('0x34')][_0xd4ca('0x3f')]+'%'};return _0x49b897;}})});}_0x6d9426=_[_0xd4ca('0x41')]({},_0x6d9426,_0x1a473b[_0xd4ca('0x42')]);var _0x41e55f={'where':_0x6d9426['where']};return db[_0xd4ca('0x43')][_0xd4ca('0x1d')](_0x41e55f)[_0xd4ca('0x24')](function(_0x5bfad6){_0x247fb3['count']=_0x5bfad6;if(_0x1a473b['query']['includeAll']){_0x6d9426['include']=[{'all':!![]}];}return db[_0xd4ca('0x43')][_0xd4ca('0x44')](_0x6d9426);})[_0xd4ca('0x24')](function(_0x3afd7c){_0x247fb3['rows']=_0x3afd7c;return _0x247fb3;})[_0xd4ca('0x24')](respondWithFilteredResult(_0x239619,_0x6d9426))[_0xd4ca('0x45')](handleError(_0x239619,null));};exports[_0xd4ca('0x46')]=function(_0x2da520,_0x52a7c2){var _0x47bd6c={'raw':![],'where':{'id':_0x2da520[_0xd4ca('0x47')]['id']}},_0xa39f4={};_0xa39f4[_0xd4ca('0x32')]=_[_0xd4ca('0x48')](db[_0xd4ca('0x43')][_0xd4ca('0x2e')]);_0xa39f4[_0xd4ca('0x34')]=_[_0xd4ca('0x48')](_0x2da520[_0xd4ca('0x34')]);_0xa39f4['filters']=_[_0xd4ca('0x37')](_0xa39f4[_0xd4ca('0x32')],_0xa39f4[_0xd4ca('0x34')]);_0x47bd6c[_0xd4ca('0x36')]=_['intersection'](_0xa39f4[_0xd4ca('0x32')],qs[_0xd4ca('0x38')](_0x2da520['query'][_0xd4ca('0x38')]));_0x47bd6c[_0xd4ca('0x36')]=_0x47bd6c[_0xd4ca('0x36')][_0xd4ca('0x49')]?_0x47bd6c[_0xd4ca('0x36')]:_0xa39f4['model'];if(_0x2da520[_0xd4ca('0x34')][_0xd4ca('0x4a')]){_0x47bd6c[_0xd4ca('0x4b')]=[{'all':!![]}];}_0x47bd6c=_[_0xd4ca('0x41')]({},_0x47bd6c,_0x2da520[_0xd4ca('0x42')]);return db[_0xd4ca('0x43')][_0xd4ca('0x4c')](_0x47bd6c)[_0xd4ca('0x24')](handleEntityNotFound(_0x52a7c2,null))[_0xd4ca('0x24')](respondWithResult(_0x52a7c2,null))[_0xd4ca('0x45')](handleError(_0x52a7c2,null));};exports[_0xd4ca('0x4d')]=function(_0xa6c7ad,_0x5732d3){return db[_0xd4ca('0x43')][_0xd4ca('0x4d')](_0xa6c7ad[_0xd4ca('0x4e')],{})[_0xd4ca('0x24')](function(_0x28bebd){var _0x3f924b=_0xa6c7ad['user'][_0xd4ca('0x4f')]({'plain':!![]});if(!_0x3f924b)throw new Error(_0xd4ca('0x50'));if(_0x3f924b['role']===_0xd4ca('0x51')){var _0x1cb608=_0x28bebd[_0xd4ca('0x4f')]({'plain':!![]});var _0x1258e1=_0xd4ca('0x52');return db[_0xd4ca('0x53')][_0xd4ca('0x4c')]({'where':{'name':_0x1258e1,'userProfileId':_0x3f924b[_0xd4ca('0x54')]},'raw':!![]})['then'](function(_0x8d5a8){if(_0x8d5a8&&_0x8d5a8[_0xd4ca('0x55')]===0x0){return db[_0xd4ca('0x27')]['create']({'name':_0x1cb608[_0xd4ca('0x2b')],'resourceId':_0x1cb608['id'],'type':_0xd4ca('0x26'),'sectionId':_0x8d5a8['id']},{})[_0xd4ca('0x24')](function(){return _0x28bebd;});}else{return _0x28bebd;}})[_0xd4ca('0x45')](function(_0x267baa){logger[_0xd4ca('0x29')](_0xd4ca('0x56'),_0x267baa);throw _0x267baa;});}return _0x28bebd;})[_0xd4ca('0x24')](respondWithResult(_0x5732d3,0xc9))['catch'](handleError(_0x5732d3,null));};exports['update']=function(_0x38cf9d,_0x481f2e){if(_0x38cf9d[_0xd4ca('0x4e')]['id']){delete _0x38cf9d[_0xd4ca('0x4e')]['id'];}return db['AnalyticCustomReport'][_0xd4ca('0x4c')]({'where':{'id':_0x38cf9d[_0xd4ca('0x47')]['id']}})['then'](handleEntityNotFound(_0x481f2e,null))[_0xd4ca('0x24')](saveUpdates(_0x38cf9d[_0xd4ca('0x4e')],null))[_0xd4ca('0x24')](respondWithResult(_0x481f2e,null))[_0xd4ca('0x45')](handleError(_0x481f2e,null));};exports[_0xd4ca('0x25')]=function(_0x433f09,_0x13a380){return db['AnalyticCustomReport'][_0xd4ca('0x4c')]({'where':{'id':_0x433f09[_0xd4ca('0x47')]['id']}})[_0xd4ca('0x24')](handleEntityNotFound(_0x13a380,null))[_0xd4ca('0x24')](removeEntity(_0x13a380,null))[_0xd4ca('0x45')](handleError(_0x13a380,null));};exports[_0xd4ca('0x57')]=function(_0x55bf3b,_0x3bd604){var _0x4af239=0xa;var _0x3eeef9=[_0xd4ca('0x58'),'left_join',_0xd4ca('0x59'),'cross_join'];var _0x5cf605={'SUM':_0xd4ca('0x5a'),'COUNT':_0xd4ca('0x5b'),'COUNT DISTINCT':_0xd4ca('0x5c'),'MAX':'MAX(%s)','MIN':_0xd4ca('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd4ca('0x5e'),'GROUP_CONCAT ASC':_0xd4ca('0x5f'),'GROUP_CONCAT DESC':_0xd4ca('0x60')};var _0x4606d9={'SEC_TO_TIME':_0xd4ca('0x61'),'DATE':_0xd4ca('0x62'),'HOUR':_0xd4ca('0x63'),'ROUND':_0xd4ca('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x17cd89=function(_0xcda384){return!_[_0xd4ca('0x65')]([_0xd4ca('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xd4ca('0x67')],_0xcda384);};var _0x34a373=function(_0x551843){if(!_0x551843||!_0x551843[_0xd4ca('0x68')][_0xd4ca('0x49')]){return'';}for(var _0x58fae2='(',_0x42bd42=0x0;_0x42bd42<_0x551843[_0xd4ca('0x68')][_0xd4ca('0x49')];_0x42bd42+=0x1){_0x42bd42>0x0&&(_0x58fae2+='\x20'+_0x551843[_0xd4ca('0x69')]+'\x20');_0x58fae2+=_0x551843[_0xd4ca('0x68')][_0x42bd42]['group']?_0x34a373(_0x551843['rules'][_0x42bd42][_0xd4ca('0x6a')]):_0x551843[_0xd4ca('0x68')][_0x42bd42][_0xd4ca('0x6b')]+'\x20'+_0x551843[_0xd4ca('0x68')][_0x42bd42]['condition']+(_0x17cd89(_0x551843[_0xd4ca('0x68')][_0x42bd42][_0xd4ca('0x6c')])?'\x20'+_0x551843[_0xd4ca('0x68')][_0x42bd42]['value']:'');}return _0x58fae2+')';};var _0x4abb0f={'where':{'id':_0x55bf3b[_0xd4ca('0x47')]['id']}},_0x34c086,_0x350e2e,_0x2f7b9b,_0x9ae30,_0x1975e0;_0x4abb0f=_[_0xd4ca('0x41')]({},_0x4abb0f,_0x55bf3b[_0xd4ca('0x42')]);return db['AnalyticCustomReport'][_0xd4ca('0x4c')](_0x4abb0f)['then'](function(_0x547ade){if(_0x547ade){_0x34c086=_0x547ade;return _0x547ade[_0xd4ca('0x6d')]();}return null;})['then'](function(_0x4a334a){if(_0x4a334a){if(!_0x4a334a['length']){throw new db[(_0xd4ca('0x6e'))][(_0xd4ca('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x350e2e=_0x4a334a;return db[_0xd4ca('0x70')][_0xd4ca('0x44')]({'raw':!![]});}return null;})['then'](function(_0x14e6d5){if(_0x14e6d5){_0x2f7b9b=_[_0xd4ca('0x71')](_0x14e6d5,'id');var _0xc5533a;var _0x32f71d=squel[_0xd4ca('0x72')]();_0x32f71d[_0xd4ca('0x73')](_0x34c086[_0xd4ca('0x74')]);for(var _0x484063=0x0;_0x484063<_0x350e2e[_0xd4ca('0x49')];_0x484063+=0x1){_0xc5533a=_0x350e2e[_0x484063][_0xd4ca('0x75')]?_0x2f7b9b[_0x350e2e[_0x484063][_0xd4ca('0x75')]]['metric']:_0x350e2e[_0x484063][_0xd4ca('0x6b')];_0xc5533a=_0x350e2e[_0x484063][_0xd4ca('0x76')]?_['replace'](_0x5cf605[_0x350e2e[_0x484063]['function']],'%s',_0xc5533a):_0xc5533a;_0xc5533a=_0x350e2e[_0x484063][_0xd4ca('0x77')]?_['replace'](_0x4606d9[_0x350e2e[_0x484063][_0xd4ca('0x77')]],'%s',_0xc5533a):_0xc5533a;if(_0x350e2e[_0x484063][_0xd4ca('0x78')]){_0x32f71d['group'](_0xc5533a);}_0x350e2e[_0x484063]['orderBy']&&_0x32f71d['order'](_0xc5533a,_0x350e2e[_0x484063]['orderBy']==='DESC'?![]:!![]);_0x32f71d[_0xd4ca('0x6b')](_0xc5533a,_0x350e2e[_0x484063][_0xd4ca('0x79')]||_0xc5533a);}if(_0x34c086['joins']){_0x34c086[_0xd4ca('0x7a')]=JSON[_0xd4ca('0x7b')](_0x34c086[_0xd4ca('0x7a')]);for(var _0x4b2c48=0x0;_0x4b2c48<_0x34c086['joins']['length'];_0x4b2c48+=0x1){if(_0x34c086[_0xd4ca('0x7a')][_0x4b2c48]['type']&&_['includes'](_0x3eeef9,_0x34c086['joins'][_0x4b2c48][_0xd4ca('0x30')])&&_0x34c086[_0xd4ca('0x7a')][_0x4b2c48][_0xd4ca('0x7c')]&&_0x34c086[_0xd4ca('0x7a')][_0x4b2c48][_0xd4ca('0x7d')]&&_0x34c086[_0xd4ca('0x7a')][_0x4b2c48][_0xd4ca('0x7e')]){_0x32f71d[_0x34c086[_0xd4ca('0x7a')][_0x4b2c48][_0xd4ca('0x30')]](_0x34c086[_0xd4ca('0x7a')][_0x4b2c48][_0xd4ca('0x7d')],null,util[_0xd4ca('0x77')]('%s.%s\x20=\x20%s.%s',_0x34c086[_0xd4ca('0x74')],_0x34c086['joins'][_0x4b2c48][_0xd4ca('0x7c')],_0x34c086[_0xd4ca('0x7a')][_0x4b2c48][_0xd4ca('0x7d')],_0x34c086['joins'][_0x4b2c48]['foreignKey']));}}}if(_0x34c086[_0xd4ca('0x7f')]){_0x34c086[_0xd4ca('0x7f')]=JSON['parse'](_0x34c086[_0xd4ca('0x7f')]);_0x32f71d[_0xd4ca('0x3e')](_0x34a373(_0x34c086[_0xd4ca('0x7f')][_0xd4ca('0x6a')]));}_0x1975e0=_0x32f71d[_0xd4ca('0x80')]();_0x32f71d[_0xd4ca('0x3b')](_0x4af239);_0x32f71d[_0xd4ca('0x3c')](0x0);logger['debug'](_0xd4ca('0x81'),_0x32f71d[_0xd4ca('0x82')]());return db[_0xd4ca('0x83')]['query'](_0x32f71d['toString'](),{'type':db['sequelize'][_0xd4ca('0x84')][_0xd4ca('0x85')]});}})['then'](respondWithResult(_0x3bd604,null))[_0xd4ca('0x45')](handleError(_0x3bd604,null));};function runReport(_0x2e8c27,_0x40667c,_0x486f08){var _0x365a6a=_0x40667c[_0xd4ca('0x2b')];var _0x377852=0xa;var _0xa50cdc=['join',_0xd4ca('0x86'),_0xd4ca('0x59'),_0xd4ca('0x87')];var _0x990a85={'SUM':'SUM(%s)','COUNT':_0xd4ca('0x5b'),'COUNT DISTINCT':_0xd4ca('0x5c'),'MAX':_0xd4ca('0x88'),'MIN':_0xd4ca('0x5d'),'AVG':_0xd4ca('0x89'),'GROUP_CONCAT':_0xd4ca('0x5e'),'GROUP_CONCAT ASC':_0xd4ca('0x5f'),'GROUP_CONCAT DESC':_0xd4ca('0x60')};var _0x196a75={'SEC_TO_TIME':_0xd4ca('0x61'),'DATE':_0xd4ca('0x62'),'HOUR':_0xd4ca('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd4ca('0x8a')};var _0x21cb01=function(_0xc164ee){return!_[_0xd4ca('0x65')]([_0xd4ca('0x66'),_0xd4ca('0x8b'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xc164ee);};var _0x3cd2cf=function(_0x46b168){if(!_0x46b168||!_0x46b168[_0xd4ca('0x68')][_0xd4ca('0x49')]){return'';}for(var _0x22046b='(',_0x18352c=0x0;_0x18352c<_0x46b168[_0xd4ca('0x68')]['length'];_0x18352c+=0x1){_0x18352c>0x0&&(_0x22046b+='\x20'+_0x46b168[_0xd4ca('0x69')]+'\x20');_0x22046b+=_0x46b168[_0xd4ca('0x68')][_0x18352c][_0xd4ca('0x6a')]?_0x3cd2cf(_0x46b168[_0xd4ca('0x68')][_0x18352c][_0xd4ca('0x6a')]):_0x46b168['rules'][_0x18352c][_0xd4ca('0x6b')]+'\x20'+_0x46b168['rules'][_0x18352c][_0xd4ca('0x6c')]+(_0x21cb01(_0x46b168[_0xd4ca('0x68')][_0x18352c][_0xd4ca('0x6c')])?'\x20'+_0x46b168['rules'][_0x18352c][_0xd4ca('0x8c')]:'');}return _0x22046b+')';};var _0x1f672a={'where':{'id':_0x2e8c27['id']}},_0x400713,_0x3a7b8c,_0xc4f591,_0x3e8794,_0xc9ced6;_0x1f672a=_[_0xd4ca('0x41')]({},_0x1f672a,_0x486f08);return db[_0xd4ca('0x43')][_0xd4ca('0x4c')](_0x1f672a)[_0xd4ca('0x24')](function(_0x9c982e){if(_0x9c982e){_0x400713=_0x9c982e;return _0x9c982e[_0xd4ca('0x6d')]();}return null;})[_0xd4ca('0x24')](function(_0x5b833e){if(_0x5b833e){if(!_0x5b833e[_0xd4ca('0x49')]){throw new db['Sequelize'][(_0xd4ca('0x6f'))](_0xd4ca('0x8d'),0x193);}_0x3a7b8c=_0x5b833e;return db[_0xd4ca('0x70')][_0xd4ca('0x44')]({'raw':!![]});}return null;})['then'](function(_0x2ae11e){if(_0x2ae11e){_0xc4f591=_[_0xd4ca('0x71')](_0x2ae11e,'id');var _0x7e82ac;var _0x3056f9=squel[_0xd4ca('0x72')]();_0x3056f9[_0xd4ca('0x73')](_0x400713[_0xd4ca('0x74')]);for(var _0x1f49e7=0x0;_0x1f49e7<_0x3a7b8c['length'];_0x1f49e7+=0x1){_0x7e82ac=_0x3a7b8c[_0x1f49e7]['MetricId']?_0xc4f591[_0x3a7b8c[_0x1f49e7][_0xd4ca('0x75')]][_0xd4ca('0x8e')]:_0x3a7b8c[_0x1f49e7][_0xd4ca('0x6b')];_0x7e82ac=_0x3a7b8c[_0x1f49e7]['function']?_[_0xd4ca('0x8f')](_0x990a85[_0x3a7b8c[_0x1f49e7][_0xd4ca('0x76')]],'%s',_0x7e82ac):_0x7e82ac;_0x7e82ac=_0x3a7b8c[_0x1f49e7][_0xd4ca('0x77')]?_[_0xd4ca('0x8f')](_0x196a75[_0x3a7b8c[_0x1f49e7][_0xd4ca('0x77')]],'%s',_0x7e82ac):_0x7e82ac;if(_0x3a7b8c[_0x1f49e7][_0xd4ca('0x78')]){_0x3056f9[_0xd4ca('0x6a')](_0x7e82ac);}_0x3a7b8c[_0x1f49e7][_0xd4ca('0x90')]&&_0x3056f9[_0xd4ca('0x91')](_0x7e82ac,_0x3a7b8c[_0x1f49e7][_0xd4ca('0x90')]===_0xd4ca('0x92')?![]:!![]);_0x3056f9[_0xd4ca('0x6b')](_0x7e82ac,_0x3a7b8c[_0x1f49e7][_0xd4ca('0x79')]||_0x7e82ac);}if(_0x400713[_0xd4ca('0x7a')]){_0x400713[_0xd4ca('0x7a')]=JSON[_0xd4ca('0x7b')](_0x400713[_0xd4ca('0x7a')]);for(var _0x1dfa8c=0x0;_0x1dfa8c<_0x400713[_0xd4ca('0x7a')][_0xd4ca('0x49')];_0x1dfa8c+=0x1){if(_0x400713['joins'][_0x1dfa8c][_0xd4ca('0x30')]&&_[_0xd4ca('0x65')](_0xa50cdc,_0x400713[_0xd4ca('0x7a')][_0x1dfa8c][_0xd4ca('0x30')])&&_0x400713[_0xd4ca('0x7a')][_0x1dfa8c][_0xd4ca('0x7c')]&&_0x400713[_0xd4ca('0x7a')][_0x1dfa8c]['foreignTable']&&_0x400713['joins'][_0x1dfa8c][_0xd4ca('0x7e')]){_0x3056f9[_0x400713['joins'][_0x1dfa8c][_0xd4ca('0x30')]](_0x400713[_0xd4ca('0x7a')][_0x1dfa8c][_0xd4ca('0x7d')],null,util[_0xd4ca('0x77')](_0xd4ca('0x93'),_0x400713[_0xd4ca('0x74')],_0x400713[_0xd4ca('0x7a')][_0x1dfa8c]['parentKey'],_0x400713[_0xd4ca('0x7a')][_0x1dfa8c][_0xd4ca('0x7d')],_0x400713[_0xd4ca('0x7a')][_0x1dfa8c][_0xd4ca('0x7e')]));}}}if(_0x400713['conditions']){_0x400713['conditions']=JSON['parse'](_0x400713[_0xd4ca('0x7f')]);_0x3056f9[_0xd4ca('0x3e')](_0x3cd2cf(_0x400713[_0xd4ca('0x7f')][_0xd4ca('0x6a')]));}_0xc9ced6=_0x3056f9[_0xd4ca('0x80')]();_0x3056f9[_0xd4ca('0x3b')](_0x377852);_0x3056f9['offset'](0x0);logger[_0xd4ca('0x94')](_0xd4ca('0x81'),_0x3056f9['toString']());return db['sequelize'][_0xd4ca('0x34')](_0x3056f9['toString'](),{'type':db['sequelize'][_0xd4ca('0x84')][_0xd4ca('0x85')]});}})[_0xd4ca('0x24')](function(_0x3a4d3e){if(!_0x3a4d3e[_0xd4ca('0x49')]){throw new db[(_0xd4ca('0x6e'))][(_0xd4ca('0x6f'))](_0xd4ca('0x95'),0xcc);}if(_0x40667c['output']==='web'){return null;}var _0x516190=_[_0xd4ca('0x41')](_0x40667c,{'name':_0x40667c[_0xd4ca('0x96')]||_0x40667c[_0xd4ca('0x2b')]||_0x400713['name'],'basename':_0x365a6a,'savename':util['format']('%s-%s.%s',_0x40667c[_0xd4ca('0x2b')]||_0x400713['name'],require(_0xd4ca('0x97'))[_0xd4ca('0x98')](0x4),_0x40667c['output']||_0xd4ca('0x99')),'reportId':_0x400713['id'],'reportType':'custom'});return db[_0xd4ca('0x9a')]['create'](_0x516190,{'raw':!![]});})[_0xd4ca('0x24')](function(_0x4ed10a){if(_0x400713[_0xd4ca('0x74')]===_0xd4ca('0x9b')){_0xc9ced6[_0xd4ca('0x3e')](_0x400713[_0xd4ca('0x74')]+_0xd4ca('0x9c'),_0x40667c[_0xd4ca('0x9d')],_0x40667c[_0xd4ca('0x9e')]);}else{_0xc9ced6[_0xd4ca('0x3e')](_0x400713[_0xd4ca('0x74')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x40667c[_0xd4ca('0x9d')],_0x40667c[_0xd4ca('0x9e')]);}if(_0x4ed10a){logger['info'](_0xd4ca('0x9f'),_0xc9ced6[_0xd4ca('0x82')]());require(_0xd4ca('0xa0'))[_0xd4ca('0xa1')](path[_0xd4ca('0x58')](__dirname,_0xd4ca('0xa2'),_0x4ed10a['output']),[_0x4ed10a['id'],_0xc9ced6[_0xd4ca('0x82')](),path[_0xd4ca('0x58')](__dirname,_0xd4ca('0xa3'),_0x4ed10a[_0xd4ca('0xa4')]),_0x365a6a]);return _0x4ed10a;}else{var _0x2e152d=squel[_0xd4ca('0x72')]();_0x2e152d['from']('('+_0xc9ced6[_0xd4ca('0x82')]()+')',_0xd4ca('0xa5'));_0x2e152d[_0xd4ca('0x6b')](_0xd4ca('0xa6'),_0xd4ca('0x1d'));_0xc9ced6[_0xd4ca('0x3b')](_0x40667c['limit']||_0x377852);_0xc9ced6['offset'](_0x40667c[_0xd4ca('0x3c')]||0x0);return db[_0xd4ca('0x83')][_0xd4ca('0x34')](_0x2e152d[_0xd4ca('0x82')](),{'type':db['sequelize']['QueryTypes'][_0xd4ca('0x85')]})[_0xd4ca('0x24')](function(_0xbbe6b2){if(!_0xbbe6b2[_0xd4ca('0x49')]){_0x3e8794=0x0;}else{_0x3e8794=_0xbbe6b2[0x0]['count']||0x0;}return db[_0xd4ca('0x83')][_0xd4ca('0x34')](_0xc9ced6[_0xd4ca('0x82')](),{'type':db[_0xd4ca('0x83')][_0xd4ca('0x84')][_0xd4ca('0x85')]});})[_0xd4ca('0x24')](function(_0x41aa52){return{'rows':_0x41aa52||[],'count':_0x3e8794};});}});}exports[_0xd4ca('0xa7')]=function(_0x38a8c5,_0x352858){return runReport(_0x38a8c5[_0xd4ca('0x47')],_0x38a8c5[_0xd4ca('0x34')],_0x38a8c5[_0xd4ca('0x42')])[_0xd4ca('0x24')](respondWithResult(_0x352858,null))['catch'](handleError(_0x352858,null));};exports[_0xd4ca('0xa8')]=runReport;exports[_0xd4ca('0x34')]=function(_0x405bb3,_0x462862){var _0x2a5ab3=0xa;var _0x1ea053=[_0xd4ca('0x58'),_0xd4ca('0x86'),_0xd4ca('0x59'),_0xd4ca('0x87')];var _0x277b2e={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd4ca('0x5c'),'MAX':_0xd4ca('0x88'),'MIN':'MIN(%s)','AVG':_0xd4ca('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd4ca('0x60')};var _0x10c7c0={'SEC_TO_TIME':_0xd4ca('0x61'),'DATE':_0xd4ca('0x62'),'HOUR':_0xd4ca('0x63'),'ROUND':_0xd4ca('0x64'),'UNIX_TIMESTAMP':_0xd4ca('0x8a')};var _0x4354dc=function(_0x711498){return!_[_0xd4ca('0x65')](['IS\x20NULL',_0xd4ca('0x8b'),'IS\x20EMPTY',_0xd4ca('0x67')],_0x711498);};var _0xe52df2=function(_0xf0ae12){if(!_0xf0ae12||!_0xf0ae12['rules'][_0xd4ca('0x49')]){return'';}for(var _0x2d991e='(',_0x517cc3=0x0;_0x517cc3<_0xf0ae12[_0xd4ca('0x68')][_0xd4ca('0x49')];_0x517cc3+=0x1){_0x517cc3>0x0&&(_0x2d991e+='\x20'+_0xf0ae12[_0xd4ca('0x69')]+'\x20');_0x2d991e+=_0xf0ae12[_0xd4ca('0x68')][_0x517cc3][_0xd4ca('0x6a')]?_0xe52df2(_0xf0ae12[_0xd4ca('0x68')][_0x517cc3]['group']):_0xf0ae12[_0xd4ca('0x68')][_0x517cc3][_0xd4ca('0x6b')]+'\x20'+_0xf0ae12[_0xd4ca('0x68')][_0x517cc3][_0xd4ca('0x6c')]+(_0x4354dc(_0xf0ae12['rules'][_0x517cc3]['condition'])?'\x20'+_0xf0ae12[_0xd4ca('0x68')][_0x517cc3][_0xd4ca('0x8c')]:'');}return _0x2d991e+')';};var _0x748d8d={'where':{'id':_0x405bb3['params']['id']}},_0x5de6d6,_0x2fa321,_0xcda94e,_0x1f7a5e,_0x11a580;_0x748d8d=_[_0xd4ca('0x41')]({},_0x748d8d,_0x405bb3[_0xd4ca('0x42')]);return db['AnalyticCustomReport']['find'](_0x748d8d)[_0xd4ca('0x24')](function(_0x11b481){if(_0x11b481){_0x5de6d6=_0x11b481;return _0x11b481['getFields']();}return null;})['then'](function(_0x50f6f4){if(_0x50f6f4){if(!_0x50f6f4[_0xd4ca('0x49')]){throw new db[(_0xd4ca('0x6e'))]['ValidationErrorItem'](_0xd4ca('0x8d'),0x193);}_0x2fa321=_0x50f6f4;return db[_0xd4ca('0x70')]['findAll']({'raw':!![]});}return null;})[_0xd4ca('0x24')](function(_0x3ce6fe){if(_0x3ce6fe){_0xcda94e=_[_0xd4ca('0x71')](_0x3ce6fe,'id');var _0x5d3c6f;var _0x5ecde9=squel[_0xd4ca('0x72')]();_0x5ecde9['from'](_0x5de6d6[_0xd4ca('0x74')]);for(var _0x8dd89d=0x0;_0x8dd89d<_0x2fa321[_0xd4ca('0x49')];_0x8dd89d+=0x1){_0x5d3c6f=_0x2fa321[_0x8dd89d][_0xd4ca('0x75')]?_0xcda94e[_0x2fa321[_0x8dd89d][_0xd4ca('0x75')]][_0xd4ca('0x8e')]:_0x2fa321[_0x8dd89d][_0xd4ca('0x6b')];_0x5d3c6f=_0x2fa321[_0x8dd89d]['function']?_[_0xd4ca('0x8f')](_0x277b2e[_0x2fa321[_0x8dd89d][_0xd4ca('0x76')]],'%s',_0x5d3c6f):_0x5d3c6f;_0x5d3c6f=_0x2fa321[_0x8dd89d][_0xd4ca('0x77')]?_[_0xd4ca('0x8f')](_0x10c7c0[_0x2fa321[_0x8dd89d][_0xd4ca('0x77')]],'%s',_0x5d3c6f):_0x5d3c6f;if(_0x2fa321[_0x8dd89d][_0xd4ca('0x78')]){_0x5ecde9[_0xd4ca('0x6a')](_0x5d3c6f);}_0x2fa321[_0x8dd89d][_0xd4ca('0x90')]&&_0x5ecde9[_0xd4ca('0x91')](_0x5d3c6f,_0x2fa321[_0x8dd89d][_0xd4ca('0x90')]==='DESC'?![]:!![]);_0x5ecde9[_0xd4ca('0x6b')](_0x5d3c6f,_0x2fa321[_0x8dd89d][_0xd4ca('0x79')]||_0x5d3c6f);}if(_0x5de6d6[_0xd4ca('0x7a')]){_0x5de6d6['joins']=JSON[_0xd4ca('0x7b')](_0x5de6d6[_0xd4ca('0x7a')]);for(var _0x3477ee=0x0;_0x3477ee<_0x5de6d6['joins'][_0xd4ca('0x49')];_0x3477ee+=0x1){if(_0x5de6d6[_0xd4ca('0x7a')][_0x3477ee][_0xd4ca('0x30')]&&_[_0xd4ca('0x65')](_0x1ea053,_0x5de6d6[_0xd4ca('0x7a')][_0x3477ee][_0xd4ca('0x30')])&&_0x5de6d6[_0xd4ca('0x7a')][_0x3477ee][_0xd4ca('0x7c')]&&_0x5de6d6['joins'][_0x3477ee][_0xd4ca('0x7d')]&&_0x5de6d6[_0xd4ca('0x7a')][_0x3477ee][_0xd4ca('0x7e')]){_0x5ecde9[_0x5de6d6['joins'][_0x3477ee][_0xd4ca('0x30')]](_0x5de6d6[_0xd4ca('0x7a')][_0x3477ee]['foreignTable'],null,util[_0xd4ca('0x77')](_0xd4ca('0x93'),_0x5de6d6['table'],_0x5de6d6[_0xd4ca('0x7a')][_0x3477ee][_0xd4ca('0x7c')],_0x5de6d6[_0xd4ca('0x7a')][_0x3477ee][_0xd4ca('0x7d')],_0x5de6d6['joins'][_0x3477ee]['foreignKey']));}}}if(_0x5de6d6['conditions']){_0x5de6d6[_0xd4ca('0x7f')]=JSON[_0xd4ca('0x7b')](_0x5de6d6[_0xd4ca('0x7f')]);_0x5ecde9[_0xd4ca('0x3e')](_0xe52df2(_0x5de6d6[_0xd4ca('0x7f')][_0xd4ca('0x6a')]));}_0x11a580=_0x5ecde9[_0xd4ca('0x80')]();_0x5ecde9['limit'](_0x2a5ab3);_0x5ecde9[_0xd4ca('0x3c')](0x0);logger[_0xd4ca('0x94')](_0xd4ca('0x81'),_0x5ecde9[_0xd4ca('0x82')]());return db[_0xd4ca('0x83')]['query'](_0x5ecde9[_0xd4ca('0x82')](),{'type':db['sequelize'][_0xd4ca('0x84')][_0xd4ca('0x85')]});}})[_0xd4ca('0x24')](function(){return{'sql':_0x11a580[_0xd4ca('0x82')]()};})[_0xd4ca('0x24')](respondWithResult(_0x462862,null))[_0xd4ca('0x45')](handleError(_0x462862,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 21c241b..e324f1d 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.model.js +++ b/server/api/analyticCustomReport/analyticCustomReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008b=['moment','bluebird','path','../../config/environment','./analyticCustomReport.attributes','exports','define','util','api'];(function(_0x20d509,_0x24ccfd){var _0x55766f=function(_0x220a14){while(--_0x220a14){_0x20d509['push'](_0x20d509['shift']());}};_0x55766f(++_0x24ccfd);}(_0x008b,0x130));var _0xb008=function(_0x305d8c,_0x153576){_0x305d8c=_0x305d8c-0x0;var _0x1e6143=_0x008b[_0x305d8c];return _0x1e6143;};'use strict';var _=require('lodash');var util=require(_0xb008('0x0'));var logger=require('../../config/logger')(_0xb008('0x1'));var moment=require(_0xb008('0x2'));var BPromise=require(_0xb008('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb008('0x4'));var rimraf=require('rimraf');var config=require(_0xb008('0x5'));var attributes=require(_0xb008('0x6'));module[_0xb008('0x7')]=function(_0x509148,_0x16a69a){return _0x509148[_0xb008('0x8')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f69=['../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a3290,_0x669a1c){var _0x43dcc1=function(_0x411fcb){while(--_0x411fcb){_0x2a3290['push'](_0x2a3290['shift']());}};_0x43dcc1(++_0x669a1c);}(_0x2f69,0x72));var _0x92f6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2f69[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x92f6('0x0'));var util=require('util');var logger=require(_0x92f6('0x1'))(_0x92f6('0x2'));var moment=require(_0x92f6('0x3'));var BPromise=require(_0x92f6('0x4'));var rp=require(_0x92f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x92f6('0x6'));var attributes=require(_0x92f6('0x7'));module['exports']=function(_0x387a62,_0x72948c){return _0x387a62['define'](_0x92f6('0x8'),attributes,{'tableName':_0x92f6('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 2e652f7..02be7ee 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcc0=['jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1cc433,_0x6c9509){var _0x3163ec=function(_0x91320c){while(--_0x91320c){_0x1cc433['push'](_0x1cc433['shift']());}};_0x3163ec(++_0x6c9509);}(_0xbcc0,0x1b9));var _0x0bcc=function(_0x35cb3a,_0x3d3e35){_0x35cb3a=_0x35cb3a-0x0;var _0x1180ae=_0xbcc0[_0x35cb3a];return _0x1180ae;};'use strict';var _=require(_0x0bcc('0x0'));var util=require('util');var moment=require(_0x0bcc('0x1'));var BPromise=require(_0x0bcc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bcc('0x3'));var db=require(_0x0bcc('0x4'))['db'];var utils=require(_0x0bcc('0x5'));var logger=require(_0x0bcc('0x6'))(_0x0bcc('0x7'));var config=require(_0x0bcc('0x8'));var jayson=require(_0x0bcc('0x9'));var client=jayson[_0x0bcc('0xa')][_0x0bcc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x108e75,_0x21813e,_0x490a77){return new BPromise(function(_0x1f6086,_0x9c4030){return client[_0x0bcc('0xc')](_0x108e75,_0x490a77)[_0x0bcc('0xd')](function(_0x52db0c){logger['info'](_0x0bcc('0xe'),_0x21813e,_0x0bcc('0xf'));logger[_0x0bcc('0x10')](_0x0bcc('0x11'),_0x21813e,_0x0bcc('0xf'),JSON[_0x0bcc('0x12')](_0x52db0c));if(_0x52db0c['error']){if(_0x52db0c['error'][_0x0bcc('0x13')]===0x1f4){logger['error'](_0x0bcc('0xe'),_0x21813e,_0x52db0c[_0x0bcc('0x14')][_0x0bcc('0x15')]);return _0x9c4030(_0x52db0c['error'][_0x0bcc('0x15')]);}logger[_0x0bcc('0x14')](_0x0bcc('0xe'),_0x21813e,_0x52db0c[_0x0bcc('0x14')][_0x0bcc('0x15')]);return _0x1f6086(_0x52db0c[_0x0bcc('0x14')][_0x0bcc('0x15')]);}else{logger[_0x0bcc('0x16')](_0x0bcc('0xe'),_0x21813e,'request\x20sent');_0x1f6086(_0x52db0c[_0x0bcc('0x17')][_0x0bcc('0x15')]);}})[_0x0bcc('0x18')](function(_0x3e9e39){logger[_0x0bcc('0x14')](_0x0bcc('0xe'),_0x21813e,_0x3e9e39);_0x9c4030(_0x3e9e39);});});} \ No newline at end of file +var _0x54b5=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x54b5,0x156));var _0x554b=function(_0x261ff0,_0x470af0){_0x261ff0=_0x261ff0-0x0;var _0x33f33f=_0x54b5[_0x261ff0];return _0x33f33f;};'use strict';var _=require(_0x554b('0x0'));var util=require(_0x554b('0x1'));var moment=require(_0x554b('0x2'));var BPromise=require('bluebird');var rs=require(_0x554b('0x3'));var fs=require('fs');var Redis=require(_0x554b('0x4'));var db=require(_0x554b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x554b('0x6'))(_0x554b('0x7'));var config=require('../../config/environment');var jayson=require(_0x554b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5eacbb,_0x254a00,_0x3b2efc){return new BPromise(function(_0x4bb9a2,_0x1f15e8){return client['request'](_0x5eacbb,_0x3b2efc)[_0x554b('0x9')](function(_0x520c54){logger[_0x554b('0xa')](_0x554b('0xb'),_0x254a00,'request\x20sent');logger['debug'](_0x554b('0xc'),_0x254a00,_0x554b('0xd'),JSON[_0x554b('0xe')](_0x520c54));if(_0x520c54['error']){if(_0x520c54[_0x554b('0xf')]['code']===0x1f4){logger[_0x554b('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x254a00,_0x520c54['error']['message']);return _0x1f15e8(_0x520c54[_0x554b('0xf')][_0x554b('0x10')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x254a00,_0x520c54[_0x554b('0xf')][_0x554b('0x10')]);return _0x4bb9a2(_0x520c54[_0x554b('0xf')]['message']);}else{logger[_0x554b('0xa')](_0x554b('0xb'),_0x254a00,_0x554b('0xd'));_0x4bb9a2(_0x520c54[_0x554b('0x11')][_0x554b('0x10')]);}})['catch'](function(_0x5675b0){logger[_0x554b('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x254a00,_0x5675b0);_0x1f15e8(_0x5675b0);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a7bc480..963b9f1 100644 --- a/server/api/analyticCustomReport/index.js +++ b/server/api/analyticCustomReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e3e=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x7e3e,0x99));var _0xe7e3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x7e3e[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0xe7e3('0x0'));var util=require(_0xe7e3('0x1'));var path=require(_0xe7e3('0x2'));var timeout=require(_0xe7e3('0x3'));var express=require('express');var router=express[_0xe7e3('0x4')]();var auth=require(_0xe7e3('0x5'));var interaction=require(_0xe7e3('0x6'));var config=require(_0xe7e3('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xe7e3('0x8')]('/',auth[_0xe7e3('0x9')](),controller[_0xe7e3('0xa')]);router['get'](_0xe7e3('0xb'),auth[_0xe7e3('0x9')](),controller[_0xe7e3('0xc')]);router[_0xe7e3('0x8')](_0xe7e3('0xd'),auth['isAuthenticated'](),controller[_0xe7e3('0xe')]);router[_0xe7e3('0x8')](_0xe7e3('0xf'),auth[_0xe7e3('0x9')](),controller[_0xe7e3('0x10')]);router['get'](_0xe7e3('0x11'),auth[_0xe7e3('0x9')](),controller['query']);router[_0xe7e3('0x12')]('/',auth['isAuthenticated'](),controller[_0xe7e3('0x13')]);router[_0xe7e3('0x14')](_0xe7e3('0xb'),auth[_0xe7e3('0x9')](),controller['update']);router[_0xe7e3('0x15')](_0xe7e3('0xb'),auth[_0xe7e3('0x9')](),controller['destroy']);module[_0xe7e3('0x16')]=router; \ No newline at end of file +var _0x6857=['query','create','put','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query'];(function(_0x493053,_0x24ce4b){var _0x4ae76d=function(_0x19fbc0){while(--_0x19fbc0){_0x493053['push'](_0x493053['shift']());}};_0x4ae76d(++_0x24ce4b);}(_0x6857,0x176));var _0x7685=function(_0x543d31,_0x5dda46){_0x543d31=_0x543d31-0x0;var _0x413c94=_0x6857[_0x543d31];return _0x413c94;};'use strict';var multer=require(_0x7685('0x0'));var util=require('util');var path=require(_0x7685('0x1'));var timeout=require('connect-timeout');var express=require(_0x7685('0x2'));var router=express[_0x7685('0x3')]();var auth=require(_0x7685('0x4'));var interaction=require(_0x7685('0x5'));var config=require(_0x7685('0x6'));var controller=require(_0x7685('0x7'));router[_0x7685('0x8')]('/',auth[_0x7685('0x9')](),controller[_0x7685('0xa')]);router[_0x7685('0x8')](_0x7685('0xb'),auth[_0x7685('0x9')](),controller[_0x7685('0xc')]);router[_0x7685('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0x7685('0xd')]);router[_0x7685('0x8')](_0x7685('0xe'),auth['isAuthenticated'](),controller[_0x7685('0xf')]);router[_0x7685('0x8')](_0x7685('0x10'),auth[_0x7685('0x9')](),controller[_0x7685('0x11')]);router['post']('/',auth[_0x7685('0x9')](),controller[_0x7685('0x12')]);router[_0x7685('0x13')](_0x7685('0xb'),auth[_0x7685('0x9')](),controller[_0x7685('0x14')]);router[_0x7685('0x15')](_0x7685('0xb'),auth[_0x7685('0x9')](),controller['destroy']);module[_0x7685('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index fbb01e8..046285a 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa783=['sequelize','STRING','TEXT'];(function(_0x8c2752,_0x1ac8c4){var _0x56448c=function(_0xf454a6){while(--_0xf454a6){_0x8c2752['push'](_0x8c2752['shift']());}};_0x56448c(++_0x1ac8c4);}(_0xa783,0x111));var _0x3a78=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xa783[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require(_0x3a78('0x0'));module['exports']={'name':{'type':Sequelize[_0x3a78('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x3a78('0x1')]},'table':{'type':Sequelize[_0x3a78('0x1')]},'conditions':{'type':Sequelize[_0x3a78('0x2')]},'joins':{'type':Sequelize[_0x3a78('0x2')]}}; \ No newline at end of file +var _0xc159=['STRING','TEXT','sequelize','exports'];(function(_0x4855ec,_0x1f04da){var _0x593275=function(_0x19562a){while(--_0x19562a){_0x4855ec['push'](_0x4855ec['shift']());}};_0x593275(++_0x1f04da);}(_0xc159,0x17a));var _0x9c15=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0xc159[_0x49bdc4];return _0x1f7437;};'use strict';var Sequelize=require(_0x9c15('0x0'));module[_0x9c15('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9c15('0x2')]},'parent':{'type':Sequelize[_0x9c15('0x2')]},'table':{'type':Sequelize[_0x9c15('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x9c15('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 564c6a4..cc2b571 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09db=['length','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','AnalyticDefaultReport','count','includeAll','findAll','catch','show','keys','create','user','role','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','toString','sequelize','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','IS\x20NOT\x20NULL','function','alias','clone','QueryTypes','SELECT','No\x20available\x20data','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','countTable','run','cross_join','debug','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','update','then','destroy','get','DefaultReports','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x09db,0x1b1));var _0xb09d=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x09db[_0xd1d19a];return _0x52a79d;};'use strict';var pdf=require(_0xb09d('0x0'));var emlformat=require(_0xb09d('0x1'));var rimraf=require(_0xb09d('0x2'));var zipdir=require(_0xb09d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb09d('0x4'));var moment=require(_0xb09d('0x5'));var BPromise=require(_0xb09d('0x6'));var Mustache=require(_0xb09d('0x7'));var util=require('util');var path=require(_0xb09d('0x8'));var sox=require(_0xb09d('0x9'));var csv=require('to-csv');var ejs=require(_0xb09d('0xa'));var fs=require('fs');var _=require(_0xb09d('0xb'));var squel=require(_0xb09d('0xc'));var crypto=require(_0xb09d('0xd'));var jsforce=require(_0xb09d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb09d('0xf'));var querystring=require('querystring');var Papa=require(_0xb09d('0x10'));var Redis=require('ioredis');var authService=require(_0xb09d('0x11'));var qs=require(_0xb09d('0x12'));var as=require(_0xb09d('0x13'));var hardwareService=require(_0xb09d('0x14'));var logger=require(_0xb09d('0x15'))(_0xb09d('0x16'));var utils=require(_0xb09d('0x17'));var config=require(_0xb09d('0x18'));var db=require(_0xb09d('0x19'))['db'];function respondWithStatusCode(_0x928cfe,_0x4022dd){_0x4022dd=_0x4022dd||0xcc;return function(_0x37cc64){if(_0x37cc64){return _0x928cfe['sendStatus'](_0x4022dd);}return _0x928cfe[_0xb09d('0x1a')](_0x4022dd)[_0xb09d('0x1b')]();};}function respondWithResult(_0x5190f6,_0x39678b){_0x39678b=_0x39678b||0xc8;return function(_0x103c23){if(_0x103c23){return _0x5190f6[_0xb09d('0x1a')](_0x39678b)[_0xb09d('0x1c')](_0x103c23);}};}function respondWithFilteredResult(_0xf17806,_0xecec72){return function(_0x1bb0a1){if(_0x1bb0a1){var _0x39d981=_0x1bb0a1['count'],_0x532f9e=_0xecec72[_0xb09d('0x1d')],_0x493e29=_0xecec72[_0xb09d('0x1d')]+_0xecec72[_0xb09d('0x1e')],_0x3358fb;if(_0x493e29>=_0x39d981){_0x493e29=_0x39d981;_0x3358fb=0xc8;}else{_0x3358fb=0xce;}_0xf17806[_0xb09d('0x1a')](_0x3358fb);return _0xf17806[_0xb09d('0x1f')]('Content-Range',_0x532f9e+'-'+_0x493e29+'/'+_0x39d981)[_0xb09d('0x1c')](_0x1bb0a1);}return null;};}function patchUpdates(_0x1ad8a0){return function(_0x555101){try{jsonpatch[_0xb09d('0x20')](_0x555101,_0x1ad8a0,!![]);}catch(_0x1c80cf){return BPromise[_0xb09d('0x21')](_0x1c80cf);}return _0x555101['save']();};}function saveUpdates(_0x3f76c4,_0x44bb14){return function(_0x5b72a6){if(_0x5b72a6){return _0x5b72a6[_0xb09d('0x22')](_0x3f76c4)[_0xb09d('0x23')](function(_0x46450b){return _0x46450b;});}return null;};}function removeEntity(_0x279c1e,_0x5d84ed){return function(_0x4dd1ff){if(_0x4dd1ff){return _0x4dd1ff[_0xb09d('0x24')]()[_0xb09d('0x23')](function(){var _0x48e901=_0x4dd1ff[_0xb09d('0x25')]({'plain':!![]});var _0x474cec=_0xb09d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x474cec,'resourceId':_0x48e901['id']}})['then'](function(){return _0x4dd1ff;});})[_0xb09d('0x23')](function(){_0x279c1e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x586621,_0x1cece7){return function(_0x12fd35){if(!_0x12fd35){_0x586621[_0xb09d('0x27')](0x194);}return _0x12fd35;};}function handleError(_0x3fb4e6,_0x272e9a){_0x272e9a=_0x272e9a||0x1f4;return function(_0x4a9290){logger[_0xb09d('0x28')](_0x4a9290[_0xb09d('0x29')]);if(_0x4a9290[_0xb09d('0x2a')]){delete _0x4a9290[_0xb09d('0x2a')];}_0x3fb4e6[_0xb09d('0x1a')](_0x272e9a)['send'](_0x4a9290);};}exports[_0xb09d('0x2b')]=function(_0x37df82,_0x1aaec8){var _0x1c40d9={},_0x2724f1={},_0xc35297={'count':0x0,'rows':[]};var _0x4e4756=_[_0xb09d('0x2c')](db['AnalyticDefaultReport'][_0xb09d('0x2d')],function(_0x1c92fd){return{'name':_0x1c92fd[_0xb09d('0x2e')],'type':_0x1c92fd['type']['key']};});_0x2724f1[_0xb09d('0x2f')]=_[_0xb09d('0x2c')](_0x4e4756,_0xb09d('0x2a'));_0x2724f1['query']=_['keys'](_0x37df82[_0xb09d('0x30')]);_0x2724f1[_0xb09d('0x31')]=_['intersection'](_0x2724f1[_0xb09d('0x2f')],_0x2724f1[_0xb09d('0x30')]);_0x1c40d9[_0xb09d('0x32')]=_[_0xb09d('0x33')](_0x2724f1['model'],qs[_0xb09d('0x34')](_0x37df82[_0xb09d('0x30')][_0xb09d('0x34')]));_0x1c40d9[_0xb09d('0x32')]=_0x1c40d9[_0xb09d('0x32')][_0xb09d('0x35')]?_0x1c40d9[_0xb09d('0x32')]:_0x2724f1[_0xb09d('0x2f')];if(!_0x37df82['query']['hasOwnProperty'](_0xb09d('0x36'))){_0x1c40d9[_0xb09d('0x1e')]=qs['limit'](_0x37df82[_0xb09d('0x30')][_0xb09d('0x1e')]);_0x1c40d9['offset']=qs['offset'](_0x37df82[_0xb09d('0x30')]['offset']);}_0x1c40d9[_0xb09d('0x37')]=qs['sort'](_0x37df82[_0xb09d('0x30')]['sort']);_0x1c40d9[_0xb09d('0x38')]=qs[_0xb09d('0x31')](_[_0xb09d('0x39')](_0x37df82[_0xb09d('0x30')],_0x2724f1[_0xb09d('0x31')]));if(_0x37df82[_0xb09d('0x30')][_0xb09d('0x3a')]){_0x1c40d9['where']=_[_0xb09d('0x3b')](_0x1c40d9[_0xb09d('0x38')],{'$or':_[_0xb09d('0x2c')](_0x4e4756,function(_0x36389e){if(_0x36389e[_0xb09d('0x3c')]!==_0xb09d('0x3d')){var _0x1411b1={};_0x1411b1[_0x36389e[_0xb09d('0x2a')]]={'$like':'%'+_0x37df82[_0xb09d('0x30')][_0xb09d('0x3a')]+'%'};return _0x1411b1;}})});}_0x1c40d9=_[_0xb09d('0x3b')]({},_0x1c40d9,_0x37df82[_0xb09d('0x3e')]);var _0x442dc2={'where':_0x1c40d9[_0xb09d('0x38')]};return db[_0xb09d('0x3f')][_0xb09d('0x40')](_0x442dc2)[_0xb09d('0x23')](function(_0x4f061b){_0xc35297[_0xb09d('0x40')]=_0x4f061b;if(_0x37df82[_0xb09d('0x30')][_0xb09d('0x41')]){_0x1c40d9['include']=[{'all':!![]}];}return db[_0xb09d('0x3f')][_0xb09d('0x42')](_0x1c40d9);})[_0xb09d('0x23')](function(_0x125b88){_0xc35297['rows']=_0x125b88;return _0xc35297;})[_0xb09d('0x23')](respondWithFilteredResult(_0x1aaec8,_0x1c40d9))[_0xb09d('0x43')](handleError(_0x1aaec8,null));};exports[_0xb09d('0x44')]=function(_0x4c2851,_0x103e33){var _0x35f34b={'raw':!![],'where':{'id':_0x4c2851['params']['id']}},_0x19f5f4={};_0x19f5f4[_0xb09d('0x2f')]=_['keys'](db[_0xb09d('0x3f')][_0xb09d('0x2d')]);_0x19f5f4[_0xb09d('0x30')]=_[_0xb09d('0x45')](_0x4c2851['query']);_0x19f5f4[_0xb09d('0x31')]=_[_0xb09d('0x33')](_0x19f5f4[_0xb09d('0x2f')],_0x19f5f4[_0xb09d('0x30')]);_0x35f34b[_0xb09d('0x32')]=_[_0xb09d('0x33')](_0x19f5f4['model'],qs['fields'](_0x4c2851[_0xb09d('0x30')][_0xb09d('0x34')]));_0x35f34b[_0xb09d('0x32')]=_0x35f34b[_0xb09d('0x32')][_0xb09d('0x35')]?_0x35f34b['attributes']:_0x19f5f4[_0xb09d('0x2f')];if(_0x4c2851[_0xb09d('0x30')][_0xb09d('0x41')]){_0x35f34b['include']=[{'all':!![]}];}_0x35f34b=_[_0xb09d('0x3b')]({},_0x35f34b,_0x4c2851['options']);return db['AnalyticDefaultReport']['find'](_0x35f34b)['then'](handleEntityNotFound(_0x103e33,null))['then'](respondWithResult(_0x103e33,null))[_0xb09d('0x43')](handleError(_0x103e33,null));};exports[_0xb09d('0x46')]=function(_0x5a9059,_0x5842c3){return db[_0xb09d('0x3f')][_0xb09d('0x46')](_0x5a9059['body'],{})[_0xb09d('0x23')](function(_0x2c5c0a){var _0x46e0d9=_0x5a9059[_0xb09d('0x47')][_0xb09d('0x25')]({'plain':!![]});if(!_0x46e0d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46e0d9[_0xb09d('0x48')]===_0xb09d('0x47')){var _0x1e59b6=_0x2c5c0a[_0xb09d('0x25')]({'plain':!![]});var _0x3a11bd=_0xb09d('0x49');return db[_0xb09d('0x4a')]['find']({'where':{'name':_0x3a11bd,'userProfileId':_0x46e0d9['userProfileId']},'raw':!![]})['then'](function(_0x3efec3){if(_0x3efec3&&_0x3efec3[_0xb09d('0x4b')]===0x0){return db[_0xb09d('0x4c')][_0xb09d('0x46')]({'name':_0x1e59b6[_0xb09d('0x2a')],'resourceId':_0x1e59b6['id'],'type':'DefaultReports','sectionId':_0x3efec3['id']},{})['then'](function(){return _0x2c5c0a;});}else{return _0x2c5c0a;}})[_0xb09d('0x43')](function(_0x52a51d){logger['error'](_0xb09d('0x4d'),_0x52a51d);throw _0x52a51d;});}return _0x2c5c0a;})[_0xb09d('0x23')](respondWithResult(_0x5842c3,0xc9))[_0xb09d('0x43')](handleError(_0x5842c3,null));};exports[_0xb09d('0x22')]=function(_0xf880b0,_0x1ab362){if(_0xf880b0[_0xb09d('0x4e')]['id']){delete _0xf880b0[_0xb09d('0x4e')]['id'];}return db[_0xb09d('0x3f')][_0xb09d('0x4f')]({'where':{'id':_0xf880b0[_0xb09d('0x50')]['id']}})[_0xb09d('0x23')](handleEntityNotFound(_0x1ab362,null))[_0xb09d('0x23')](saveUpdates(_0xf880b0[_0xb09d('0x4e')],null))[_0xb09d('0x23')](respondWithResult(_0x1ab362,null))['catch'](handleError(_0x1ab362,null));};exports[_0xb09d('0x24')]=function(_0x3aa12a,_0x3c7c58){return db['AnalyticDefaultReport'][_0xb09d('0x4f')]({'where':{'id':_0x3aa12a[_0xb09d('0x50')]['id']}})[_0xb09d('0x23')](handleEntityNotFound(_0x3c7c58,null))['then'](removeEntity(_0x3c7c58,null))['catch'](handleError(_0x3c7c58,null));};exports['preview']=function(_0x286991,_0x3d7855){var _0x14681b=0xa;var _0x2f2823=[_0xb09d('0x51'),_0xb09d('0x52'),_0xb09d('0x53'),'cross_join'];var _0x381be5={'SUM':_0xb09d('0x54'),'COUNT':_0xb09d('0x55'),'COUNT DISTINCT':_0xb09d('0x56'),'MAX':_0xb09d('0x57'),'MIN':_0xb09d('0x58'),'AVG':_0xb09d('0x59'),'GROUP_CONCAT':_0xb09d('0x5a'),'GROUP_CONCAT ASC':_0xb09d('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6b4e7e={'SEC_TO_TIME':_0xb09d('0x5c'),'DATE':'DATE(%s)','HOUR':_0xb09d('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb09d('0x5e')};var _0x5cd614=function(_0x2a8eb0){return!_[_0xb09d('0x5f')]([_0xb09d('0x60'),'IS\x20NOT\x20NULL',_0xb09d('0x61'),_0xb09d('0x62')],_0x2a8eb0);};var _0x4c5f04=function(_0x2946bb){if(!_0x2946bb||!_0x2946bb[_0xb09d('0x63')][_0xb09d('0x35')]){return'';}for(var _0x2e76fe='(',_0x13a5fc=0x0;_0x13a5fc<_0x2946bb[_0xb09d('0x63')][_0xb09d('0x35')];_0x13a5fc+=0x1){_0x13a5fc>0x0&&(_0x2e76fe+='\x20'+_0x2946bb[_0xb09d('0x64')]+'\x20');_0x2e76fe+=_0x2946bb[_0xb09d('0x63')][_0x13a5fc][_0xb09d('0x65')]?_0x4c5f04(_0x2946bb['rules'][_0x13a5fc][_0xb09d('0x65')]):_0x2946bb['rules'][_0x13a5fc][_0xb09d('0x66')]+'\x20'+_0x2946bb['rules'][_0x13a5fc][_0xb09d('0x67')]+(_0x5cd614(_0x2946bb[_0xb09d('0x63')][_0x13a5fc][_0xb09d('0x67')])?'\x20'+_0x2946bb[_0xb09d('0x63')][_0x13a5fc][_0xb09d('0x68')]:'');}return _0x2e76fe+')';};var _0x493bdc={'where':{'id':_0x286991['params']['id']}},_0x4f9e65,_0x241ca5,_0x11a869,_0x176e2e,_0x3dd4ac;_0x493bdc=_[_0xb09d('0x3b')]({},_0x493bdc,_0x286991[_0xb09d('0x3e')]);return db[_0xb09d('0x3f')][_0xb09d('0x4f')](_0x493bdc)[_0xb09d('0x23')](function(_0x141094){if(_0x141094){_0x4f9e65=_0x141094;return _0x141094[_0xb09d('0x69')]();}return null;})[_0xb09d('0x23')](function(_0x5a163a){if(_0x5a163a){if(!_0x5a163a['length']){throw new db[(_0xb09d('0x6a'))][(_0xb09d('0x6b'))](_0xb09d('0x6c'),0x193);}_0x241ca5=_0x5a163a;return db[_0xb09d('0x6d')][_0xb09d('0x42')]({'raw':!![]});}return null;})[_0xb09d('0x23')](function(_0x31bf3a){if(_0x31bf3a){_0x11a869=_[_0xb09d('0x6e')](_0x31bf3a,'id');var _0x5562c6;var _0x3ba458=squel[_0xb09d('0x6f')]();_0x3ba458[_0xb09d('0x70')](_0x4f9e65[_0xb09d('0x71')]);for(var _0x6f83a=0x0;_0x6f83a<_0x241ca5[_0xb09d('0x35')];_0x6f83a+=0x1){_0x5562c6=_0x241ca5[_0x6f83a][_0xb09d('0x72')]?_0x11a869[_0x241ca5[_0x6f83a][_0xb09d('0x72')]][_0xb09d('0x73')]:_0x241ca5[_0x6f83a][_0xb09d('0x66')];_0x5562c6=_0x241ca5[_0x6f83a]['function']?_[_0xb09d('0x74')](_0x381be5[_0x241ca5[_0x6f83a]['function']],'%s',_0x5562c6):_0x5562c6;_0x5562c6=_0x241ca5[_0x6f83a][_0xb09d('0x75')]?_[_0xb09d('0x74')](_0x6b4e7e[_0x241ca5[_0x6f83a][_0xb09d('0x75')]],'%s',_0x5562c6):_0x5562c6;if(_0x241ca5[_0x6f83a][_0xb09d('0x76')]){_0x3ba458[_0xb09d('0x65')](_0x5562c6);}_0x241ca5[_0x6f83a][_0xb09d('0x77')]&&_0x3ba458[_0xb09d('0x37')](_0x5562c6,_0x241ca5[_0x6f83a][_0xb09d('0x77')]===_0xb09d('0x78')?![]:!![]);_0x3ba458[_0xb09d('0x66')](_0x5562c6,_0x241ca5[_0x6f83a]['alias']||_0x5562c6);}if(_0x4f9e65[_0xb09d('0x79')]){_0x4f9e65[_0xb09d('0x79')]=JSON['parse'](_0x4f9e65[_0xb09d('0x79')]);for(var _0x28f00e=0x0;_0x28f00e<_0x4f9e65[_0xb09d('0x79')][_0xb09d('0x35')];_0x28f00e+=0x1){if(_0x4f9e65[_0xb09d('0x79')][_0x28f00e][_0xb09d('0x3c')]&&_[_0xb09d('0x5f')](_0x2f2823,_0x4f9e65[_0xb09d('0x79')][_0x28f00e]['type'])&&_0x4f9e65['joins'][_0x28f00e][_0xb09d('0x7a')]&&_0x4f9e65[_0xb09d('0x79')][_0x28f00e][_0xb09d('0x7b')]&&_0x4f9e65[_0xb09d('0x79')][_0x28f00e][_0xb09d('0x7c')]){_0x3ba458[_0x4f9e65['joins'][_0x28f00e][_0xb09d('0x3c')]](_0x4f9e65[_0xb09d('0x79')][_0x28f00e][_0xb09d('0x7b')],null,util[_0xb09d('0x75')](_0xb09d('0x7d'),_0x4f9e65['table'],_0x4f9e65[_0xb09d('0x79')][_0x28f00e][_0xb09d('0x7a')],_0x4f9e65[_0xb09d('0x79')][_0x28f00e][_0xb09d('0x7b')],_0x4f9e65['joins'][_0x28f00e][_0xb09d('0x7c')]));}}}if(_0x4f9e65[_0xb09d('0x7e')]){_0x4f9e65['conditions']=JSON[_0xb09d('0x7f')](_0x4f9e65[_0xb09d('0x7e')]);_0x3ba458[_0xb09d('0x38')](_0x4c5f04(_0x4f9e65[_0xb09d('0x7e')]['group']));}_0x3dd4ac=_0x3ba458['clone']();_0x3ba458[_0xb09d('0x1e')](_0x14681b);_0x3ba458['offset'](0x0);logger['debug'](_0xb09d('0x80'),_0x3ba458[_0xb09d('0x81')]());return db[_0xb09d('0x82')][_0xb09d('0x30')](_0x3ba458[_0xb09d('0x81')](),{'type':db[_0xb09d('0x82')]['QueryTypes']['SELECT']});}})[_0xb09d('0x23')](respondWithResult(_0x3d7855,null))['catch'](handleError(_0x3d7855,null));};function runReport(_0x18c9f7,_0x2bfa5d,_0x4c013d){var _0x55b505=_0x2bfa5d[_0xb09d('0x2a')];var _0x53637c=0xa;var _0x5db4ba=[_0xb09d('0x51'),_0xb09d('0x52'),_0xb09d('0x53'),'cross_join'];var _0xa92cdf={'SUM':_0xb09d('0x54'),'COUNT':_0xb09d('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb09d('0x57'),'MIN':'MIN(%s)','AVG':_0xb09d('0x59'),'GROUP_CONCAT':_0xb09d('0x5a'),'GROUP_CONCAT ASC':_0xb09d('0x5b'),'GROUP_CONCAT DESC':_0xb09d('0x83')};var _0x9768bc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb09d('0x84'),'HOUR':_0xb09d('0x5d'),'ROUND':_0xb09d('0x85'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x32b680=function(_0xbe3d44){return!_[_0xb09d('0x5f')]([_0xb09d('0x60'),_0xb09d('0x86'),_0xb09d('0x61'),_0xb09d('0x62')],_0xbe3d44);};var _0x38f801=function(_0x50a127){if(!_0x50a127||!_0x50a127[_0xb09d('0x63')]['length']){return'';}for(var _0x3c669f='(',_0x16c089=0x0;_0x16c089<_0x50a127[_0xb09d('0x63')][_0xb09d('0x35')];_0x16c089+=0x1){_0x16c089>0x0&&(_0x3c669f+='\x20'+_0x50a127[_0xb09d('0x64')]+'\x20');_0x3c669f+=_0x50a127[_0xb09d('0x63')][_0x16c089][_0xb09d('0x65')]?_0x38f801(_0x50a127[_0xb09d('0x63')][_0x16c089][_0xb09d('0x65')]):_0x50a127[_0xb09d('0x63')][_0x16c089]['field']+'\x20'+_0x50a127['rules'][_0x16c089][_0xb09d('0x67')]+(_0x32b680(_0x50a127[_0xb09d('0x63')][_0x16c089][_0xb09d('0x67')])?'\x20'+_0x50a127['rules'][_0x16c089][_0xb09d('0x68')]:'');}return _0x3c669f+')';};var _0x3bd4fb={'where':{'id':_0x18c9f7['id']}},_0x4af558,_0x426637,_0x48145a,_0x1e6279,_0xdc862c;_0x3bd4fb=_[_0xb09d('0x3b')]({},_0x3bd4fb,_0x4c013d);return db['AnalyticDefaultReport'][_0xb09d('0x4f')](_0x3bd4fb)[_0xb09d('0x23')](function(_0x510824){if(_0x510824){_0x4af558=_0x510824;return _0x510824[_0xb09d('0x69')]();}return null;})['then'](function(_0x23a2f2){if(_0x23a2f2){if(!_0x23a2f2[_0xb09d('0x35')]){throw new db['Sequelize'][(_0xb09d('0x6b'))](_0xb09d('0x6c'),0x193);}_0x426637=_0x23a2f2;return db[_0xb09d('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3c3e7f){if(_0x3c3e7f){_0x48145a=_[_0xb09d('0x6e')](_0x3c3e7f,'id');var _0x38efc6;var _0x598951=squel[_0xb09d('0x6f')]();_0x598951[_0xb09d('0x70')](_0x4af558[_0xb09d('0x71')]);for(var _0x5e464f=0x0;_0x5e464f<_0x426637[_0xb09d('0x35')];_0x5e464f+=0x1){_0x38efc6=_0x426637[_0x5e464f]['MetricId']?_0x48145a[_0x426637[_0x5e464f][_0xb09d('0x72')]][_0xb09d('0x73')]:_0x426637[_0x5e464f]['field'];_0x38efc6=_0x426637[_0x5e464f][_0xb09d('0x87')]?_['replace'](_0xa92cdf[_0x426637[_0x5e464f][_0xb09d('0x87')]],'%s',_0x38efc6):_0x38efc6;_0x38efc6=_0x426637[_0x5e464f]['format']?_[_0xb09d('0x74')](_0x9768bc[_0x426637[_0x5e464f][_0xb09d('0x75')]],'%s',_0x38efc6):_0x38efc6;if(_0x426637[_0x5e464f][_0xb09d('0x76')]){_0x598951[_0xb09d('0x65')](_0x38efc6);}_0x426637[_0x5e464f][_0xb09d('0x77')]&&_0x598951[_0xb09d('0x37')](_0x38efc6,_0x426637[_0x5e464f][_0xb09d('0x77')]==='DESC'?![]:!![]);_0x598951[_0xb09d('0x66')](_0x38efc6,_0x426637[_0x5e464f][_0xb09d('0x88')]||_0x38efc6);}if(_0x4af558[_0xb09d('0x79')]){_0x4af558[_0xb09d('0x79')]=JSON[_0xb09d('0x7f')](_0x4af558[_0xb09d('0x79')]);for(var _0x4a604b=0x0;_0x4a604b<_0x4af558[_0xb09d('0x79')][_0xb09d('0x35')];_0x4a604b+=0x1){if(_0x4af558['joins'][_0x4a604b][_0xb09d('0x3c')]&&_[_0xb09d('0x5f')](_0x5db4ba,_0x4af558['joins'][_0x4a604b][_0xb09d('0x3c')])&&_0x4af558[_0xb09d('0x79')][_0x4a604b][_0xb09d('0x7a')]&&_0x4af558['joins'][_0x4a604b]['foreignTable']&&_0x4af558[_0xb09d('0x79')][_0x4a604b]['foreignKey']){_0x598951[_0x4af558['joins'][_0x4a604b][_0xb09d('0x3c')]](_0x4af558[_0xb09d('0x79')][_0x4a604b][_0xb09d('0x7b')],null,util[_0xb09d('0x75')](_0xb09d('0x7d'),_0x4af558[_0xb09d('0x71')],_0x4af558['joins'][_0x4a604b][_0xb09d('0x7a')],_0x4af558[_0xb09d('0x79')][_0x4a604b]['foreignTable'],_0x4af558[_0xb09d('0x79')][_0x4a604b][_0xb09d('0x7c')]));}}}if(_0x4af558[_0xb09d('0x7e')]){_0x4af558[_0xb09d('0x7e')]=JSON[_0xb09d('0x7f')](_0x4af558['conditions']);_0x598951[_0xb09d('0x38')](_0x38f801(_0x4af558[_0xb09d('0x7e')]['group']));}_0xdc862c=_0x598951[_0xb09d('0x89')]();_0x598951[_0xb09d('0x1e')](_0x53637c);_0x598951[_0xb09d('0x1d')](0x0);logger['debug'](_0xb09d('0x80'),_0x598951[_0xb09d('0x81')]());return db['sequelize'][_0xb09d('0x30')](_0x598951['toString'](),{'type':db[_0xb09d('0x82')][_0xb09d('0x8a')][_0xb09d('0x8b')]});}})[_0xb09d('0x23')](function(_0x36c975){if(!_0x36c975['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xb09d('0x8c'),0xcc);}if(_0x2bfa5d[_0xb09d('0x8d')]===_0xb09d('0x8e')){return null;}var _0x31c429=_['merge'](_0x2bfa5d,{'name':_0x2bfa5d[_0xb09d('0x8f')]||_0x2bfa5d['name']||_0x4af558['name'],'basename':_0x55b505,'savename':util[_0xb09d('0x75')](_0xb09d('0x90'),_0x2bfa5d[_0xb09d('0x2a')]||_0x4af558['name'],require('randomstring')[_0xb09d('0x91')](0x4),_0x2bfa5d[_0xb09d('0x8d')]||_0xb09d('0x92')),'reportId':_0x4af558['id'],'reportType':_0xb09d('0x93')});return db[_0xb09d('0x94')][_0xb09d('0x46')](_0x31c429,{'raw':!![]});})['then'](function(_0x1a27c8){if(_0x4af558[_0xb09d('0x71')]===_0xb09d('0x95')){_0xdc862c[_0xb09d('0x38')](_0x4af558[_0xb09d('0x71')]+_0xb09d('0x96'),_0x2bfa5d['startDate'],_0x2bfa5d['endDate']);}else{_0xdc862c[_0xb09d('0x38')](_0x4af558[_0xb09d('0x71')]+_0xb09d('0x97'),_0x2bfa5d[_0xb09d('0x98')],_0x2bfa5d[_0xb09d('0x99')]);}if(_0x1a27c8){logger[_0xb09d('0x9a')]('Run\x20Query:',_0xdc862c[_0xb09d('0x81')]());require(_0xb09d('0x9b'))[_0xb09d('0x9c')](path[_0xb09d('0x51')](__dirname,_0xb09d('0x9d'),_0x1a27c8[_0xb09d('0x8d')]),[_0x1a27c8['id'],_0xdc862c[_0xb09d('0x81')](),path['join'](__dirname,'../../files/reports',_0x1a27c8['savename']),_0x55b505]);return _0x1a27c8;}else{var _0x553a84=squel['select']();_0x553a84[_0xb09d('0x70')]('('+_0xdc862c[_0xb09d('0x81')]()+')',_0xb09d('0x9e'));_0x553a84[_0xb09d('0x66')]('COUNT(*)',_0xb09d('0x40'));_0xdc862c[_0xb09d('0x1e')](_0x2bfa5d[_0xb09d('0x1e')]||_0x53637c);_0xdc862c[_0xb09d('0x1d')](_0x2bfa5d[_0xb09d('0x1d')]||0x0);return db[_0xb09d('0x82')][_0xb09d('0x30')](_0x553a84['toString'](),{'type':db[_0xb09d('0x82')][_0xb09d('0x8a')][_0xb09d('0x8b')]})['then'](function(_0x48cab7){if(!_0x48cab7[_0xb09d('0x35')]){_0x1e6279=0x0;}else{_0x1e6279=_0x48cab7[0x0]['count']||0x0;}return db[_0xb09d('0x82')]['query'](_0xdc862c[_0xb09d('0x81')](),{'type':db[_0xb09d('0x82')]['QueryTypes'][_0xb09d('0x8b')]});})[_0xb09d('0x23')](function(_0x2a3f04){return{'rows':_0x2a3f04||[],'count':_0x1e6279};});}});}exports[_0xb09d('0x9f')]=function(_0x5b4c,_0x3b814d){return runReport(_0x5b4c[_0xb09d('0x50')],_0x5b4c['query'],_0x5b4c[_0xb09d('0x3e')])[_0xb09d('0x23')](respondWithResult(_0x3b814d,null))[_0xb09d('0x43')](handleError(_0x3b814d,null));};exports['runReport']=runReport;exports[_0xb09d('0x30')]=function(_0x591c91,_0x4ea037){var _0x18cc3c=0xa;var _0x356ace=[_0xb09d('0x51'),_0xb09d('0x52'),_0xb09d('0x53'),_0xb09d('0xa0')];var _0x242ab6={'SUM':'SUM(%s)','COUNT':_0xb09d('0x55'),'COUNT DISTINCT':_0xb09d('0x56'),'MAX':_0xb09d('0x57'),'MIN':_0xb09d('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb09d('0x5a'),'GROUP_CONCAT ASC':_0xb09d('0x5b'),'GROUP_CONCAT DESC':_0xb09d('0x83')};var _0x18e7f8={'SEC_TO_TIME':_0xb09d('0x5c'),'DATE':_0xb09d('0x84'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb09d('0x5e')};var _0x3d8060=function(_0x17faf6){return!_['includes']([_0xb09d('0x60'),'IS\x20NOT\x20NULL',_0xb09d('0x61'),_0xb09d('0x62')],_0x17faf6);};var _0x450c8e=function(_0x28e558){if(!_0x28e558||!_0x28e558[_0xb09d('0x63')]['length']){return'';}for(var _0x3d2761='(',_0x45d6d7=0x0;_0x45d6d7<_0x28e558[_0xb09d('0x63')]['length'];_0x45d6d7+=0x1){_0x45d6d7>0x0&&(_0x3d2761+='\x20'+_0x28e558[_0xb09d('0x64')]+'\x20');_0x3d2761+=_0x28e558[_0xb09d('0x63')][_0x45d6d7]['group']?_0x450c8e(_0x28e558[_0xb09d('0x63')][_0x45d6d7][_0xb09d('0x65')]):_0x28e558[_0xb09d('0x63')][_0x45d6d7][_0xb09d('0x66')]+'\x20'+_0x28e558[_0xb09d('0x63')][_0x45d6d7]['condition']+(_0x3d8060(_0x28e558['rules'][_0x45d6d7]['condition'])?'\x20'+_0x28e558['rules'][_0x45d6d7][_0xb09d('0x68')]:'');}return _0x3d2761+')';};var _0x1bb587={'where':{'id':_0x591c91[_0xb09d('0x50')]['id']}},_0xaae2aa,_0x5ced21,_0x15b813,_0x46e843,_0x864574;_0x1bb587=_[_0xb09d('0x3b')]({},_0x1bb587,_0x591c91[_0xb09d('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x1bb587)[_0xb09d('0x23')](function(_0x23355a){if(_0x23355a){_0xaae2aa=_0x23355a;return _0x23355a['getFields']();}return null;})['then'](function(_0x29ced3){if(_0x29ced3){if(!_0x29ced3['length']){throw new db[(_0xb09d('0x6a'))][(_0xb09d('0x6b'))](_0xb09d('0x6c'),0x193);}_0x5ced21=_0x29ced3;return db[_0xb09d('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xb09d('0x23')](function(_0x1d12e0){if(_0x1d12e0){_0x15b813=_[_0xb09d('0x6e')](_0x1d12e0,'id');var _0x339e8a;var _0x328fac=squel['select']();_0x328fac[_0xb09d('0x70')](_0xaae2aa['table']);for(var _0x364852=0x0;_0x364852<_0x5ced21[_0xb09d('0x35')];_0x364852+=0x1){_0x339e8a=_0x5ced21[_0x364852][_0xb09d('0x72')]?_0x15b813[_0x5ced21[_0x364852]['MetricId']]['metric']:_0x5ced21[_0x364852][_0xb09d('0x66')];_0x339e8a=_0x5ced21[_0x364852]['function']?_[_0xb09d('0x74')](_0x242ab6[_0x5ced21[_0x364852]['function']],'%s',_0x339e8a):_0x339e8a;_0x339e8a=_0x5ced21[_0x364852]['format']?_['replace'](_0x18e7f8[_0x5ced21[_0x364852]['format']],'%s',_0x339e8a):_0x339e8a;if(_0x5ced21[_0x364852][_0xb09d('0x76')]){_0x328fac[_0xb09d('0x65')](_0x339e8a);}_0x5ced21[_0x364852][_0xb09d('0x77')]&&_0x328fac['order'](_0x339e8a,_0x5ced21[_0x364852][_0xb09d('0x77')]===_0xb09d('0x78')?![]:!![]);_0x328fac[_0xb09d('0x66')](_0x339e8a,_0x5ced21[_0x364852][_0xb09d('0x88')]||_0x339e8a);}if(_0xaae2aa[_0xb09d('0x79')]){_0xaae2aa[_0xb09d('0x79')]=JSON[_0xb09d('0x7f')](_0xaae2aa[_0xb09d('0x79')]);for(var _0x7d8cbe=0x0;_0x7d8cbe<_0xaae2aa['joins']['length'];_0x7d8cbe+=0x1){if(_0xaae2aa[_0xb09d('0x79')][_0x7d8cbe][_0xb09d('0x3c')]&&_['includes'](_0x356ace,_0xaae2aa[_0xb09d('0x79')][_0x7d8cbe][_0xb09d('0x3c')])&&_0xaae2aa[_0xb09d('0x79')][_0x7d8cbe][_0xb09d('0x7a')]&&_0xaae2aa[_0xb09d('0x79')][_0x7d8cbe][_0xb09d('0x7b')]&&_0xaae2aa['joins'][_0x7d8cbe][_0xb09d('0x7c')]){_0x328fac[_0xaae2aa['joins'][_0x7d8cbe]['type']](_0xaae2aa[_0xb09d('0x79')][_0x7d8cbe][_0xb09d('0x7b')],null,util[_0xb09d('0x75')](_0xb09d('0x7d'),_0xaae2aa[_0xb09d('0x71')],_0xaae2aa['joins'][_0x7d8cbe][_0xb09d('0x7a')],_0xaae2aa['joins'][_0x7d8cbe][_0xb09d('0x7b')],_0xaae2aa[_0xb09d('0x79')][_0x7d8cbe]['foreignKey']));}}}if(_0xaae2aa['conditions']){_0xaae2aa[_0xb09d('0x7e')]=JSON['parse'](_0xaae2aa[_0xb09d('0x7e')]);_0x328fac[_0xb09d('0x38')](_0x450c8e(_0xaae2aa[_0xb09d('0x7e')][_0xb09d('0x65')]));}_0x864574=_0x328fac[_0xb09d('0x89')]();_0x328fac[_0xb09d('0x1e')](_0x18cc3c);_0x328fac[_0xb09d('0x1d')](0x0);logger[_0xb09d('0xa1')](_0xb09d('0x80'),_0x328fac[_0xb09d('0x81')]());return db[_0xb09d('0x82')][_0xb09d('0x30')](_0x328fac[_0xb09d('0x81')](),{'type':db['sequelize']['QueryTypes'][_0xb09d('0x8b')]});}})['then'](function(){return{'sql':_0x864574[_0xb09d('0x81')]()};})[_0xb09d('0x23')](respondWithResult(_0x4ea037,null))[_0xb09d('0x43')](handleError(_0x4ea037,null));}; \ No newline at end of file +var _0x31af=['groupBy','group','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','Limited\x20Query:','toString','left_join','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','replace','sequelize','QueryTypes','SELECT','No\x20available\x20data','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','../../components/export/','../../files/reports','savename','countTable','runReport','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','metric','function','format'];(function(_0x180e67,_0x1a6ab5){var _0x2b9cd4=function(_0x24107a){while(--_0x24107a){_0x180e67['push'](_0x180e67['shift']());}};_0x2b9cd4(++_0x1a6ab5);}(_0x31af,0x17f));var _0xf31a=function(_0x1f1dd7,_0x3009bd){_0x1f1dd7=_0x1f1dd7-0x0;var _0x47043e=_0x31af[_0x1f1dd7];return _0x47043e;};'use strict';var pdf=require(_0xf31a('0x0'));var emlformat=require(_0xf31a('0x1'));var rimraf=require(_0xf31a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf31a('0x3'));var rp=require(_0xf31a('0x4'));var moment=require(_0xf31a('0x5'));var BPromise=require(_0xf31a('0x6'));var Mustache=require(_0xf31a('0x7'));var util=require(_0xf31a('0x8'));var path=require(_0xf31a('0x9'));var sox=require(_0xf31a('0xa'));var csv=require(_0xf31a('0xb'));var ejs=require(_0xf31a('0xc'));var fs=require('fs');var _=require(_0xf31a('0xd'));var squel=require(_0xf31a('0xe'));var crypto=require(_0xf31a('0xf'));var jsforce=require(_0xf31a('0x10'));var deskjs=require(_0xf31a('0x11'));var toCsv=require(_0xf31a('0xb'));var querystring=require(_0xf31a('0x12'));var Papa=require(_0xf31a('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf31a('0x14'));var as=require(_0xf31a('0x15'));var hardwareService=require(_0xf31a('0x16'));var logger=require(_0xf31a('0x17'))(_0xf31a('0x18'));var utils=require(_0xf31a('0x19'));var config=require(_0xf31a('0x1a'));var db=require(_0xf31a('0x1b'))['db'];function respondWithStatusCode(_0x5a2e81,_0x1add26){_0x1add26=_0x1add26||0xcc;return function(_0x2e4a00){if(_0x2e4a00){return _0x5a2e81[_0xf31a('0x1c')](_0x1add26);}return _0x5a2e81[_0xf31a('0x1d')](_0x1add26)[_0xf31a('0x1e')]();};}function respondWithResult(_0x5a2cf3,_0x1d9703){_0x1d9703=_0x1d9703||0xc8;return function(_0x3be530){if(_0x3be530){return _0x5a2cf3[_0xf31a('0x1d')](_0x1d9703)[_0xf31a('0x1f')](_0x3be530);}};}function respondWithFilteredResult(_0x3f62ef,_0x286b87){return function(_0x5c3c9a){if(_0x5c3c9a){var _0x319f2b=_0x5c3c9a[_0xf31a('0x20')],_0x5478f5=_0x286b87[_0xf31a('0x21')],_0x149a9d=_0x286b87[_0xf31a('0x21')]+_0x286b87[_0xf31a('0x22')],_0x4fff26;if(_0x149a9d>=_0x319f2b){_0x149a9d=_0x319f2b;_0x4fff26=0xc8;}else{_0x4fff26=0xce;}_0x3f62ef[_0xf31a('0x1d')](_0x4fff26);return _0x3f62ef['set'](_0xf31a('0x23'),_0x5478f5+'-'+_0x149a9d+'/'+_0x319f2b)['json'](_0x5c3c9a);}return null;};}function patchUpdates(_0x1e0bdd){return function(_0xbbd955){try{jsonpatch[_0xf31a('0x24')](_0xbbd955,_0x1e0bdd,!![]);}catch(_0x178a05){return BPromise[_0xf31a('0x25')](_0x178a05);}return _0xbbd955[_0xf31a('0x26')]();};}function saveUpdates(_0x360c5d,_0x4be2e2){return function(_0x3c05cd){if(_0x3c05cd){return _0x3c05cd['update'](_0x360c5d)[_0xf31a('0x27')](function(_0x8d5dca){return _0x8d5dca;});}return null;};}function removeEntity(_0x4e312f,_0x2c61a7){return function(_0x144311){if(_0x144311){return _0x144311[_0xf31a('0x28')]()[_0xf31a('0x27')](function(){var _0x3f4e40=_0x144311['get']({'plain':!![]});var _0xc2fc7b='DefaultReports';return db[_0xf31a('0x29')][_0xf31a('0x28')]({'where':{'type':_0xc2fc7b,'resourceId':_0x3f4e40['id']}})[_0xf31a('0x27')](function(){return _0x144311;});})['then'](function(){_0x4e312f['status'](0xcc)[_0xf31a('0x1e')]();});}};}function handleEntityNotFound(_0xd24a2,_0x40ab15){return function(_0x63aa2d){if(!_0x63aa2d){_0xd24a2[_0xf31a('0x1c')](0x194);}return _0x63aa2d;};}function handleError(_0x5aa86e,_0x11c586){_0x11c586=_0x11c586||0x1f4;return function(_0x26c7d5){logger[_0xf31a('0x2a')](_0x26c7d5[_0xf31a('0x2b')]);if(_0x26c7d5['name']){delete _0x26c7d5[_0xf31a('0x2c')];}_0x5aa86e[_0xf31a('0x1d')](_0x11c586)[_0xf31a('0x2d')](_0x26c7d5);};}exports[_0xf31a('0x2e')]=function(_0x166c06,_0x27cd88){var _0x42025b={},_0x5bb3c3={},_0x1b5318={'count':0x0,'rows':[]};var _0x3fe8eb=_[_0xf31a('0x2f')](db[_0xf31a('0x30')][_0xf31a('0x31')],function(_0x790a1){return{'name':_0x790a1['fieldName'],'type':_0x790a1['type'][_0xf31a('0x32')]};});_0x5bb3c3['model']=_[_0xf31a('0x2f')](_0x3fe8eb,'name');_0x5bb3c3[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x166c06[_0xf31a('0x33')]);_0x5bb3c3['filters']=_[_0xf31a('0x35')](_0x5bb3c3[_0xf31a('0x36')],_0x5bb3c3[_0xf31a('0x33')]);_0x42025b[_0xf31a('0x37')]=_['intersection'](_0x5bb3c3[_0xf31a('0x36')],qs['fields'](_0x166c06['query'][_0xf31a('0x38')]));_0x42025b['attributes']=_0x42025b[_0xf31a('0x37')][_0xf31a('0x39')]?_0x42025b[_0xf31a('0x37')]:_0x5bb3c3['model'];if(!_0x166c06[_0xf31a('0x33')]['hasOwnProperty'](_0xf31a('0x3a'))){_0x42025b[_0xf31a('0x22')]=qs[_0xf31a('0x22')](_0x166c06[_0xf31a('0x33')][_0xf31a('0x22')]);_0x42025b[_0xf31a('0x21')]=qs[_0xf31a('0x21')](_0x166c06['query'][_0xf31a('0x21')]);}_0x42025b[_0xf31a('0x3b')]=qs[_0xf31a('0x3c')](_0x166c06[_0xf31a('0x33')][_0xf31a('0x3c')]);_0x42025b[_0xf31a('0x3d')]=qs[_0xf31a('0x3e')](_[_0xf31a('0x3f')](_0x166c06[_0xf31a('0x33')],_0x5bb3c3[_0xf31a('0x3e')]));if(_0x166c06['query'][_0xf31a('0x40')]){_0x42025b[_0xf31a('0x3d')]=_['merge'](_0x42025b[_0xf31a('0x3d')],{'$or':_['map'](_0x3fe8eb,function(_0x3767f1){if(_0x3767f1[_0xf31a('0x41')]!==_0xf31a('0x42')){var _0x245c4b={};_0x245c4b[_0x3767f1['name']]={'$like':'%'+_0x166c06[_0xf31a('0x33')][_0xf31a('0x40')]+'%'};return _0x245c4b;}})});}_0x42025b=_[_0xf31a('0x43')]({},_0x42025b,_0x166c06[_0xf31a('0x44')]);var _0x16cd6f={'where':_0x42025b[_0xf31a('0x3d')]};return db[_0xf31a('0x30')]['count'](_0x16cd6f)['then'](function(_0x28797f){_0x1b5318['count']=_0x28797f;if(_0x166c06[_0xf31a('0x33')][_0xf31a('0x45')]){_0x42025b[_0xf31a('0x46')]=[{'all':!![]}];}return db[_0xf31a('0x30')][_0xf31a('0x47')](_0x42025b);})[_0xf31a('0x27')](function(_0x411196){_0x1b5318[_0xf31a('0x48')]=_0x411196;return _0x1b5318;})[_0xf31a('0x27')](respondWithFilteredResult(_0x27cd88,_0x42025b))[_0xf31a('0x49')](handleError(_0x27cd88,null));};exports[_0xf31a('0x4a')]=function(_0x2a4a46,_0x5cb2ce){var _0x34b3b8={'raw':!![],'where':{'id':_0x2a4a46[_0xf31a('0x4b')]['id']}},_0x2049d1={};_0x2049d1[_0xf31a('0x36')]=_[_0xf31a('0x34')](db['AnalyticDefaultReport'][_0xf31a('0x31')]);_0x2049d1[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x2a4a46['query']);_0x2049d1[_0xf31a('0x3e')]=_[_0xf31a('0x35')](_0x2049d1[_0xf31a('0x36')],_0x2049d1[_0xf31a('0x33')]);_0x34b3b8[_0xf31a('0x37')]=_[_0xf31a('0x35')](_0x2049d1[_0xf31a('0x36')],qs['fields'](_0x2a4a46[_0xf31a('0x33')]['fields']));_0x34b3b8[_0xf31a('0x37')]=_0x34b3b8[_0xf31a('0x37')][_0xf31a('0x39')]?_0x34b3b8[_0xf31a('0x37')]:_0x2049d1[_0xf31a('0x36')];if(_0x2a4a46[_0xf31a('0x33')]['includeAll']){_0x34b3b8[_0xf31a('0x46')]=[{'all':!![]}];}_0x34b3b8=_[_0xf31a('0x43')]({},_0x34b3b8,_0x2a4a46[_0xf31a('0x44')]);return db['AnalyticDefaultReport'][_0xf31a('0x4c')](_0x34b3b8)[_0xf31a('0x27')](handleEntityNotFound(_0x5cb2ce,null))[_0xf31a('0x27')](respondWithResult(_0x5cb2ce,null))[_0xf31a('0x49')](handleError(_0x5cb2ce,null));};exports[_0xf31a('0x4d')]=function(_0x2314d9,_0xe02c02){return db[_0xf31a('0x30')][_0xf31a('0x4d')](_0x2314d9['body'],{})[_0xf31a('0x27')](function(_0x59e8ea){var _0x43007c=_0x2314d9['user'][_0xf31a('0x4e')]({'plain':!![]});if(!_0x43007c)throw new Error(_0xf31a('0x4f'));if(_0x43007c['role']===_0xf31a('0x50')){var _0x386cbe=_0x59e8ea['get']({'plain':!![]});var _0x31e1bc='Reports';return db[_0xf31a('0x51')][_0xf31a('0x4c')]({'where':{'name':_0x31e1bc,'userProfileId':_0x43007c[_0xf31a('0x52')]},'raw':!![]})['then'](function(_0x101ed0){if(_0x101ed0&&_0x101ed0[_0xf31a('0x53')]===0x0){return db[_0xf31a('0x29')][_0xf31a('0x4d')]({'name':_0x386cbe[_0xf31a('0x2c')],'resourceId':_0x386cbe['id'],'type':_0xf31a('0x54'),'sectionId':_0x101ed0['id']},{})[_0xf31a('0x27')](function(){return _0x59e8ea;});}else{return _0x59e8ea;}})['catch'](function(_0x33e926){logger[_0xf31a('0x2a')](_0xf31a('0x55'),_0x33e926);throw _0x33e926;});}return _0x59e8ea;})[_0xf31a('0x27')](respondWithResult(_0xe02c02,0xc9))['catch'](handleError(_0xe02c02,null));};exports[_0xf31a('0x56')]=function(_0x3365ef,_0x2072c4){if(_0x3365ef['body']['id']){delete _0x3365ef[_0xf31a('0x57')]['id'];}return db[_0xf31a('0x30')][_0xf31a('0x4c')]({'where':{'id':_0x3365ef[_0xf31a('0x4b')]['id']}})[_0xf31a('0x27')](handleEntityNotFound(_0x2072c4,null))[_0xf31a('0x27')](saveUpdates(_0x3365ef[_0xf31a('0x57')],null))[_0xf31a('0x27')](respondWithResult(_0x2072c4,null))[_0xf31a('0x49')](handleError(_0x2072c4,null));};exports[_0xf31a('0x28')]=function(_0x2d021f,_0x4bf58f){return db['AnalyticDefaultReport'][_0xf31a('0x4c')]({'where':{'id':_0x2d021f[_0xf31a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4bf58f,null))[_0xf31a('0x27')](removeEntity(_0x4bf58f,null))[_0xf31a('0x49')](handleError(_0x4bf58f,null));};exports[_0xf31a('0x58')]=function(_0x312a5c,_0xa6a65c){var _0x1ae1bd=0xa;var _0x231be4=[_0xf31a('0x59'),'left_join',_0xf31a('0x5a'),_0xf31a('0x5b')];var _0x166058={'SUM':_0xf31a('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf31a('0x5d'),'MAX':_0xf31a('0x5e'),'MIN':_0xf31a('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xf31a('0x60'),'GROUP_CONCAT DESC':_0xf31a('0x61')};var _0x5e6963={'SEC_TO_TIME':_0xf31a('0x62'),'DATE':_0xf31a('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xf31a('0x64'),'UNIX_TIMESTAMP':_0xf31a('0x65')};var _0xb373c9=function(_0xdf1803){return!_[_0xf31a('0x66')]([_0xf31a('0x67'),'IS\x20NOT\x20NULL',_0xf31a('0x68'),_0xf31a('0x69')],_0xdf1803);};var _0x448f69=function(_0x2ab67b){if(!_0x2ab67b||!_0x2ab67b[_0xf31a('0x6a')][_0xf31a('0x39')]){return'';}for(var _0x336d9d='(',_0x722fea=0x0;_0x722fea<_0x2ab67b[_0xf31a('0x6a')][_0xf31a('0x39')];_0x722fea+=0x1){_0x722fea>0x0&&(_0x336d9d+='\x20'+_0x2ab67b[_0xf31a('0x6b')]+'\x20');_0x336d9d+=_0x2ab67b[_0xf31a('0x6a')][_0x722fea]['group']?_0x448f69(_0x2ab67b[_0xf31a('0x6a')][_0x722fea]['group']):_0x2ab67b[_0xf31a('0x6a')][_0x722fea][_0xf31a('0x6c')]+'\x20'+_0x2ab67b[_0xf31a('0x6a')][_0x722fea]['condition']+(_0xb373c9(_0x2ab67b[_0xf31a('0x6a')][_0x722fea][_0xf31a('0x6d')])?'\x20'+_0x2ab67b['rules'][_0x722fea]['value']:'');}return _0x336d9d+')';};var _0x129d4d={'where':{'id':_0x312a5c[_0xf31a('0x4b')]['id']}},_0x411983,_0x45ae8a,_0xbd6883,_0x21925e,_0x38973b;_0x129d4d=_['merge']({},_0x129d4d,_0x312a5c[_0xf31a('0x44')]);return db[_0xf31a('0x30')]['find'](_0x129d4d)['then'](function(_0x132e67){if(_0x132e67){_0x411983=_0x132e67;return _0x132e67[_0xf31a('0x6e')]();}return null;})[_0xf31a('0x27')](function(_0x4044d2){if(_0x4044d2){if(!_0x4044d2[_0xf31a('0x39')]){throw new db[(_0xf31a('0x6f'))][(_0xf31a('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x45ae8a=_0x4044d2;return db[_0xf31a('0x71')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x59796f){if(_0x59796f){_0xbd6883=_[_0xf31a('0x72')](_0x59796f,'id');var _0x5f0ae1;var _0x5c7ba1=squel[_0xf31a('0x73')]();_0x5c7ba1[_0xf31a('0x74')](_0x411983['table']);for(var _0x251928=0x0;_0x251928<_0x45ae8a['length'];_0x251928+=0x1){_0x5f0ae1=_0x45ae8a[_0x251928][_0xf31a('0x75')]?_0xbd6883[_0x45ae8a[_0x251928]['MetricId']][_0xf31a('0x76')]:_0x45ae8a[_0x251928][_0xf31a('0x6c')];_0x5f0ae1=_0x45ae8a[_0x251928][_0xf31a('0x77')]?_['replace'](_0x166058[_0x45ae8a[_0x251928][_0xf31a('0x77')]],'%s',_0x5f0ae1):_0x5f0ae1;_0x5f0ae1=_0x45ae8a[_0x251928]['format']?_['replace'](_0x5e6963[_0x45ae8a[_0x251928][_0xf31a('0x78')]],'%s',_0x5f0ae1):_0x5f0ae1;if(_0x45ae8a[_0x251928][_0xf31a('0x79')]){_0x5c7ba1[_0xf31a('0x7a')](_0x5f0ae1);}_0x45ae8a[_0x251928][_0xf31a('0x7b')]&&_0x5c7ba1['order'](_0x5f0ae1,_0x45ae8a[_0x251928][_0xf31a('0x7b')]===_0xf31a('0x7c')?![]:!![]);_0x5c7ba1[_0xf31a('0x6c')](_0x5f0ae1,_0x45ae8a[_0x251928][_0xf31a('0x7d')]||_0x5f0ae1);}if(_0x411983['joins']){_0x411983[_0xf31a('0x7e')]=JSON['parse'](_0x411983[_0xf31a('0x7e')]);for(var _0x10d19e=0x0;_0x10d19e<_0x411983[_0xf31a('0x7e')][_0xf31a('0x39')];_0x10d19e+=0x1){if(_0x411983[_0xf31a('0x7e')][_0x10d19e][_0xf31a('0x41')]&&_[_0xf31a('0x66')](_0x231be4,_0x411983[_0xf31a('0x7e')][_0x10d19e]['type'])&&_0x411983['joins'][_0x10d19e][_0xf31a('0x7f')]&&_0x411983[_0xf31a('0x7e')][_0x10d19e][_0xf31a('0x80')]&&_0x411983[_0xf31a('0x7e')][_0x10d19e][_0xf31a('0x81')]){_0x5c7ba1[_0x411983['joins'][_0x10d19e]['type']](_0x411983[_0xf31a('0x7e')][_0x10d19e][_0xf31a('0x80')],null,util[_0xf31a('0x78')](_0xf31a('0x82'),_0x411983[_0xf31a('0x83')],_0x411983['joins'][_0x10d19e][_0xf31a('0x7f')],_0x411983[_0xf31a('0x7e')][_0x10d19e][_0xf31a('0x80')],_0x411983[_0xf31a('0x7e')][_0x10d19e][_0xf31a('0x81')]));}}}if(_0x411983[_0xf31a('0x84')]){_0x411983[_0xf31a('0x84')]=JSON[_0xf31a('0x85')](_0x411983['conditions']);_0x5c7ba1[_0xf31a('0x3d')](_0x448f69(_0x411983[_0xf31a('0x84')][_0xf31a('0x7a')]));}_0x38973b=_0x5c7ba1[_0xf31a('0x86')]();_0x5c7ba1[_0xf31a('0x22')](_0x1ae1bd);_0x5c7ba1['offset'](0x0);logger[_0xf31a('0x87')](_0xf31a('0x88'),_0x5c7ba1[_0xf31a('0x89')]());return db['sequelize'][_0xf31a('0x33')](_0x5c7ba1['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0xf31a('0x27')](respondWithResult(_0xa6a65c,null))[_0xf31a('0x49')](handleError(_0xa6a65c,null));};function runReport(_0x3ccc02,_0x59f5c2,_0x1f36a9){var _0x482757=_0x59f5c2[_0xf31a('0x2c')];var _0x3694af=0xa;var _0x4a53e1=[_0xf31a('0x59'),_0xf31a('0x8a'),_0xf31a('0x5a'),_0xf31a('0x5b')];var _0xa84650={'SUM':'SUM(%s)','COUNT':_0xf31a('0x8b'),'COUNT DISTINCT':_0xf31a('0x5d'),'MAX':_0xf31a('0x5e'),'MIN':_0xf31a('0x5f'),'AVG':_0xf31a('0x8c'),'GROUP_CONCAT':_0xf31a('0x8d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf31a('0x61')};var _0x1eadd0={'SEC_TO_TIME':_0xf31a('0x62'),'DATE':_0xf31a('0x63'),'HOUR':_0xf31a('0x8e'),'ROUND':_0xf31a('0x64'),'UNIX_TIMESTAMP':_0xf31a('0x65')};var _0x139d92=function(_0x390660){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xf31a('0x68'),_0xf31a('0x69')],_0x390660);};var _0x25066e=function(_0x23e304){if(!_0x23e304||!_0x23e304[_0xf31a('0x6a')]['length']){return'';}for(var _0x751e17='(',_0x20b56e=0x0;_0x20b56e<_0x23e304['rules']['length'];_0x20b56e+=0x1){_0x20b56e>0x0&&(_0x751e17+='\x20'+_0x23e304['operator']+'\x20');_0x751e17+=_0x23e304[_0xf31a('0x6a')][_0x20b56e][_0xf31a('0x7a')]?_0x25066e(_0x23e304['rules'][_0x20b56e][_0xf31a('0x7a')]):_0x23e304[_0xf31a('0x6a')][_0x20b56e]['field']+'\x20'+_0x23e304['rules'][_0x20b56e]['condition']+(_0x139d92(_0x23e304[_0xf31a('0x6a')][_0x20b56e][_0xf31a('0x6d')])?'\x20'+_0x23e304[_0xf31a('0x6a')][_0x20b56e][_0xf31a('0x8f')]:'');}return _0x751e17+')';};var _0x5228d6={'where':{'id':_0x3ccc02['id']}},_0x518c8c,_0x173227,_0x376342,_0x23349e,_0x1719d5;_0x5228d6=_['merge']({},_0x5228d6,_0x1f36a9);return db['AnalyticDefaultReport']['find'](_0x5228d6)[_0xf31a('0x27')](function(_0x3aa8fe){if(_0x3aa8fe){_0x518c8c=_0x3aa8fe;return _0x3aa8fe[_0xf31a('0x6e')]();}return null;})[_0xf31a('0x27')](function(_0x559ffd){if(_0x559ffd){if(!_0x559ffd['length']){throw new db[(_0xf31a('0x6f'))][(_0xf31a('0x70'))](_0xf31a('0x90'),0x193);}_0x173227=_0x559ffd;return db[_0xf31a('0x71')][_0xf31a('0x47')]({'raw':!![]});}return null;})[_0xf31a('0x27')](function(_0x1184ac){if(_0x1184ac){_0x376342=_[_0xf31a('0x72')](_0x1184ac,'id');var _0x5b3fd1;var _0x17e7f1=squel[_0xf31a('0x73')]();_0x17e7f1[_0xf31a('0x74')](_0x518c8c[_0xf31a('0x83')]);for(var _0x144623=0x0;_0x144623<_0x173227['length'];_0x144623+=0x1){_0x5b3fd1=_0x173227[_0x144623][_0xf31a('0x75')]?_0x376342[_0x173227[_0x144623][_0xf31a('0x75')]][_0xf31a('0x76')]:_0x173227[_0x144623][_0xf31a('0x6c')];_0x5b3fd1=_0x173227[_0x144623]['function']?_[_0xf31a('0x91')](_0xa84650[_0x173227[_0x144623][_0xf31a('0x77')]],'%s',_0x5b3fd1):_0x5b3fd1;_0x5b3fd1=_0x173227[_0x144623]['format']?_[_0xf31a('0x91')](_0x1eadd0[_0x173227[_0x144623][_0xf31a('0x78')]],'%s',_0x5b3fd1):_0x5b3fd1;if(_0x173227[_0x144623][_0xf31a('0x79')]){_0x17e7f1['group'](_0x5b3fd1);}_0x173227[_0x144623]['orderBy']&&_0x17e7f1[_0xf31a('0x3b')](_0x5b3fd1,_0x173227[_0x144623][_0xf31a('0x7b')]===_0xf31a('0x7c')?![]:!![]);_0x17e7f1[_0xf31a('0x6c')](_0x5b3fd1,_0x173227[_0x144623][_0xf31a('0x7d')]||_0x5b3fd1);}if(_0x518c8c['joins']){_0x518c8c[_0xf31a('0x7e')]=JSON[_0xf31a('0x85')](_0x518c8c[_0xf31a('0x7e')]);for(var _0x3e7a19=0x0;_0x3e7a19<_0x518c8c[_0xf31a('0x7e')][_0xf31a('0x39')];_0x3e7a19+=0x1){if(_0x518c8c['joins'][_0x3e7a19][_0xf31a('0x41')]&&_[_0xf31a('0x66')](_0x4a53e1,_0x518c8c[_0xf31a('0x7e')][_0x3e7a19][_0xf31a('0x41')])&&_0x518c8c[_0xf31a('0x7e')][_0x3e7a19]['parentKey']&&_0x518c8c['joins'][_0x3e7a19]['foreignTable']&&_0x518c8c[_0xf31a('0x7e')][_0x3e7a19][_0xf31a('0x81')]){_0x17e7f1[_0x518c8c[_0xf31a('0x7e')][_0x3e7a19][_0xf31a('0x41')]](_0x518c8c[_0xf31a('0x7e')][_0x3e7a19][_0xf31a('0x80')],null,util['format'](_0xf31a('0x82'),_0x518c8c[_0xf31a('0x83')],_0x518c8c[_0xf31a('0x7e')][_0x3e7a19][_0xf31a('0x7f')],_0x518c8c[_0xf31a('0x7e')][_0x3e7a19][_0xf31a('0x80')],_0x518c8c['joins'][_0x3e7a19][_0xf31a('0x81')]));}}}if(_0x518c8c['conditions']){_0x518c8c['conditions']=JSON[_0xf31a('0x85')](_0x518c8c[_0xf31a('0x84')]);_0x17e7f1[_0xf31a('0x3d')](_0x25066e(_0x518c8c[_0xf31a('0x84')][_0xf31a('0x7a')]));}_0x1719d5=_0x17e7f1['clone']();_0x17e7f1[_0xf31a('0x22')](_0x3694af);_0x17e7f1['offset'](0x0);logger[_0xf31a('0x87')](_0xf31a('0x88'),_0x17e7f1['toString']());return db[_0xf31a('0x92')][_0xf31a('0x33')](_0x17e7f1['toString'](),{'type':db[_0xf31a('0x92')][_0xf31a('0x93')][_0xf31a('0x94')]});}})[_0xf31a('0x27')](function(_0x13c53c){if(!_0x13c53c[_0xf31a('0x39')]){throw new db[(_0xf31a('0x6f'))][(_0xf31a('0x70'))](_0xf31a('0x95'),0xcc);}if(_0x59f5c2[_0xf31a('0x96')]==='web'){return null;}var _0x4ed658=_[_0xf31a('0x43')](_0x59f5c2,{'name':_0x59f5c2[_0xf31a('0x97')]||_0x59f5c2['name']||_0x518c8c[_0xf31a('0x2c')],'basename':_0x482757,'savename':util['format'](_0xf31a('0x98'),_0x59f5c2['name']||_0x518c8c['name'],require('randomstring')[_0xf31a('0x99')](0x4),_0x59f5c2[_0xf31a('0x96')]||_0xf31a('0x9a')),'reportId':_0x518c8c['id'],'reportType':_0xf31a('0x9b')});return db[_0xf31a('0x9c')][_0xf31a('0x4d')](_0x4ed658,{'raw':!![]});})['then'](function(_0x5754e9){if(_0x518c8c[_0xf31a('0x83')]===_0xf31a('0x9d')){_0x1719d5[_0xf31a('0x3d')](_0x518c8c[_0xf31a('0x83')]+_0xf31a('0x9e'),_0x59f5c2[_0xf31a('0x9f')],_0x59f5c2[_0xf31a('0xa0')]);}else{_0x1719d5[_0xf31a('0x3d')](_0x518c8c[_0xf31a('0x83')]+_0xf31a('0xa1'),_0x59f5c2['startDate'],_0x59f5c2[_0xf31a('0xa0')]);}if(_0x5754e9){logger[_0xf31a('0xa2')]('Run\x20Query:',_0x1719d5[_0xf31a('0x89')]());require('child_process')['fork'](path[_0xf31a('0x59')](__dirname,_0xf31a('0xa3'),_0x5754e9[_0xf31a('0x96')]),[_0x5754e9['id'],_0x1719d5[_0xf31a('0x89')](),path[_0xf31a('0x59')](__dirname,_0xf31a('0xa4'),_0x5754e9[_0xf31a('0xa5')]),_0x482757]);return _0x5754e9;}else{var _0x216105=squel[_0xf31a('0x73')]();_0x216105['from']('('+_0x1719d5[_0xf31a('0x89')]()+')',_0xf31a('0xa6'));_0x216105['field']('COUNT(*)',_0xf31a('0x20'));_0x1719d5['limit'](_0x59f5c2[_0xf31a('0x22')]||_0x3694af);_0x1719d5[_0xf31a('0x21')](_0x59f5c2[_0xf31a('0x21')]||0x0);return db[_0xf31a('0x92')][_0xf31a('0x33')](_0x216105[_0xf31a('0x89')](),{'type':db[_0xf31a('0x92')][_0xf31a('0x93')]['SELECT']})[_0xf31a('0x27')](function(_0x2d8b48){if(!_0x2d8b48[_0xf31a('0x39')]){_0x23349e=0x0;}else{_0x23349e=_0x2d8b48[0x0][_0xf31a('0x20')]||0x0;}return db[_0xf31a('0x92')][_0xf31a('0x33')](_0x1719d5[_0xf31a('0x89')](),{'type':db[_0xf31a('0x92')][_0xf31a('0x93')]['SELECT']});})['then'](function(_0x48fb3c){return{'rows':_0x48fb3c||[],'count':_0x23349e};});}});}exports['run']=function(_0x7a9be,_0x579e8c){return runReport(_0x7a9be['params'],_0x7a9be[_0xf31a('0x33')],_0x7a9be[_0xf31a('0x44')])[_0xf31a('0x27')](respondWithResult(_0x579e8c,null))[_0xf31a('0x49')](handleError(_0x579e8c,null));};exports[_0xf31a('0xa7')]=runReport;exports[_0xf31a('0x33')]=function(_0x3ebba8,_0x5c32e5){var _0x17c13b=0xa;var _0x2e2421=[_0xf31a('0x59'),_0xf31a('0x8a'),_0xf31a('0x5a'),_0xf31a('0x5b')];var _0x5ef523={'SUM':'SUM(%s)','COUNT':_0xf31a('0x8b'),'COUNT DISTINCT':_0xf31a('0x5d'),'MAX':_0xf31a('0x5e'),'MIN':_0xf31a('0x5f'),'AVG':_0xf31a('0x8c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xf31a('0x60'),'GROUP_CONCAT DESC':_0xf31a('0x61')};var _0x261de8={'SEC_TO_TIME':_0xf31a('0x62'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xf31a('0x64'),'UNIX_TIMESTAMP':_0xf31a('0x65')};var _0x19cbd1=function(_0x44431b){return!_['includes']([_0xf31a('0x67'),'IS\x20NOT\x20NULL',_0xf31a('0x68'),_0xf31a('0x69')],_0x44431b);};var _0x131e85=function(_0x57c926){if(!_0x57c926||!_0x57c926['rules'][_0xf31a('0x39')]){return'';}for(var _0x135449='(',_0x3e41cf=0x0;_0x3e41cf<_0x57c926[_0xf31a('0x6a')]['length'];_0x3e41cf+=0x1){_0x3e41cf>0x0&&(_0x135449+='\x20'+_0x57c926[_0xf31a('0x6b')]+'\x20');_0x135449+=_0x57c926[_0xf31a('0x6a')][_0x3e41cf]['group']?_0x131e85(_0x57c926[_0xf31a('0x6a')][_0x3e41cf][_0xf31a('0x7a')]):_0x57c926[_0xf31a('0x6a')][_0x3e41cf][_0xf31a('0x6c')]+'\x20'+_0x57c926['rules'][_0x3e41cf][_0xf31a('0x6d')]+(_0x19cbd1(_0x57c926[_0xf31a('0x6a')][_0x3e41cf][_0xf31a('0x6d')])?'\x20'+_0x57c926[_0xf31a('0x6a')][_0x3e41cf]['value']:'');}return _0x135449+')';};var _0x45f2d0={'where':{'id':_0x3ebba8[_0xf31a('0x4b')]['id']}},_0x290f63,_0x5b728,_0x1a2a8f,_0x2fb9b4,_0x3ffdd4;_0x45f2d0=_[_0xf31a('0x43')]({},_0x45f2d0,_0x3ebba8['options']);return db[_0xf31a('0x30')]['find'](_0x45f2d0)[_0xf31a('0x27')](function(_0x586476){if(_0x586476){_0x290f63=_0x586476;return _0x586476[_0xf31a('0x6e')]();}return null;})['then'](function(_0xe9cf7c){if(_0xe9cf7c){if(!_0xe9cf7c[_0xf31a('0x39')]){throw new db[(_0xf31a('0x6f'))][(_0xf31a('0x70'))](_0xf31a('0x90'),0x193);}_0x5b728=_0xe9cf7c;return db['AnalyticMetric'][_0xf31a('0x47')]({'raw':!![]});}return null;})['then'](function(_0x1bc9b3){if(_0x1bc9b3){_0x1a2a8f=_[_0xf31a('0x72')](_0x1bc9b3,'id');var _0x4b9c8c;var _0x53bf88=squel[_0xf31a('0x73')]();_0x53bf88['from'](_0x290f63[_0xf31a('0x83')]);for(var _0xfe3ab3=0x0;_0xfe3ab3<_0x5b728['length'];_0xfe3ab3+=0x1){_0x4b9c8c=_0x5b728[_0xfe3ab3]['MetricId']?_0x1a2a8f[_0x5b728[_0xfe3ab3][_0xf31a('0x75')]][_0xf31a('0x76')]:_0x5b728[_0xfe3ab3][_0xf31a('0x6c')];_0x4b9c8c=_0x5b728[_0xfe3ab3][_0xf31a('0x77')]?_['replace'](_0x5ef523[_0x5b728[_0xfe3ab3][_0xf31a('0x77')]],'%s',_0x4b9c8c):_0x4b9c8c;_0x4b9c8c=_0x5b728[_0xfe3ab3][_0xf31a('0x78')]?_[_0xf31a('0x91')](_0x261de8[_0x5b728[_0xfe3ab3][_0xf31a('0x78')]],'%s',_0x4b9c8c):_0x4b9c8c;if(_0x5b728[_0xfe3ab3][_0xf31a('0x79')]){_0x53bf88[_0xf31a('0x7a')](_0x4b9c8c);}_0x5b728[_0xfe3ab3][_0xf31a('0x7b')]&&_0x53bf88[_0xf31a('0x3b')](_0x4b9c8c,_0x5b728[_0xfe3ab3][_0xf31a('0x7b')]===_0xf31a('0x7c')?![]:!![]);_0x53bf88[_0xf31a('0x6c')](_0x4b9c8c,_0x5b728[_0xfe3ab3][_0xf31a('0x7d')]||_0x4b9c8c);}if(_0x290f63[_0xf31a('0x7e')]){_0x290f63[_0xf31a('0x7e')]=JSON[_0xf31a('0x85')](_0x290f63['joins']);for(var _0x1643ad=0x0;_0x1643ad<_0x290f63['joins']['length'];_0x1643ad+=0x1){if(_0x290f63[_0xf31a('0x7e')][_0x1643ad][_0xf31a('0x41')]&&_[_0xf31a('0x66')](_0x2e2421,_0x290f63['joins'][_0x1643ad][_0xf31a('0x41')])&&_0x290f63['joins'][_0x1643ad][_0xf31a('0x7f')]&&_0x290f63[_0xf31a('0x7e')][_0x1643ad][_0xf31a('0x80')]&&_0x290f63[_0xf31a('0x7e')][_0x1643ad][_0xf31a('0x81')]){_0x53bf88[_0x290f63[_0xf31a('0x7e')][_0x1643ad][_0xf31a('0x41')]](_0x290f63[_0xf31a('0x7e')][_0x1643ad][_0xf31a('0x80')],null,util[_0xf31a('0x78')](_0xf31a('0x82'),_0x290f63['table'],_0x290f63[_0xf31a('0x7e')][_0x1643ad][_0xf31a('0x7f')],_0x290f63['joins'][_0x1643ad]['foreignTable'],_0x290f63['joins'][_0x1643ad]['foreignKey']));}}}if(_0x290f63[_0xf31a('0x84')]){_0x290f63[_0xf31a('0x84')]=JSON['parse'](_0x290f63[_0xf31a('0x84')]);_0x53bf88[_0xf31a('0x3d')](_0x131e85(_0x290f63[_0xf31a('0x84')][_0xf31a('0x7a')]));}_0x3ffdd4=_0x53bf88[_0xf31a('0x86')]();_0x53bf88[_0xf31a('0x22')](_0x17c13b);_0x53bf88['offset'](0x0);logger[_0xf31a('0x87')]('Limited\x20Query:',_0x53bf88[_0xf31a('0x89')]());return db[_0xf31a('0x92')][_0xf31a('0x33')](_0x53bf88[_0xf31a('0x89')](),{'type':db['sequelize'][_0xf31a('0x93')][_0xf31a('0x94')]});}})['then'](function(){return{'sql':_0x3ffdd4[_0xf31a('0x89')]()};})['then'](respondWithResult(_0x5c32e5,null))[_0xf31a('0x49')](handleError(_0x5c32e5,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 2cc1caa..8e4b63c 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8323=['define','AnalyticDefaultReport','analytics_default_reports','lodash','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4259e9,_0x3be572){var _0x348e6d=function(_0x3c3370){while(--_0x3c3370){_0x4259e9['push'](_0x4259e9['shift']());}};_0x348e6d(++_0x3be572);}(_0x8323,0x8f));var _0x3832=function(_0x30abac,_0x35dacb){_0x30abac=_0x30abac-0x0;var _0xcd72c0=_0x8323[_0x30abac];return _0xcd72c0;};'use strict';var _=require(_0x3832('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3832('0x1'));var BPromise=require('bluebird');var rp=require(_0x3832('0x2'));var fs=require('fs');var path=require(_0x3832('0x3'));var rimraf=require(_0x3832('0x4'));var config=require(_0x3832('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0x3832('0x6')]=function(_0x28f060,_0x3f3927){return _0x28f060[_0x3832('0x7')](_0x3832('0x8'),attributes,{'tableName':_0x3832('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed98=['AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./analyticDefaultReport.attributes','define'];(function(_0x218c60,_0x320bc3){var _0x4e34a0=function(_0x34cbbb){while(--_0x34cbbb){_0x218c60['push'](_0x218c60['shift']());}};_0x4e34a0(++_0x320bc3);}(_0xed98,0x109));var _0x8ed9=function(_0x2fc7fd,_0x50827d){_0x2fc7fd=_0x2fc7fd-0x0;var _0x1832e4=_0xed98[_0x2fc7fd];return _0x1832e4;};'use strict';var _=require(_0x8ed9('0x0'));var util=require(_0x8ed9('0x1'));var logger=require(_0x8ed9('0x2'))(_0x8ed9('0x3'));var moment=require(_0x8ed9('0x4'));var BPromise=require('bluebird');var rp=require(_0x8ed9('0x5'));var fs=require('fs');var path=require(_0x8ed9('0x6'));var rimraf=require(_0x8ed9('0x7'));var config=require('../../config/environment');var attributes=require(_0x8ed9('0x8'));module['exports']=function(_0x3b31ae,_0x2fed08){return _0x3b31ae[_0x8ed9('0x9')](_0x8ed9('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 218af2c..bf480a7 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35ba=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x424f4b,_0x3bee27){var _0x1f187d=function(_0x4a4d8f){while(--_0x4a4d8f){_0x424f4b['push'](_0x424f4b['shift']());}};_0x1f187d(++_0x3bee27);}(_0x35ba,0x8c));var _0xa35b=function(_0x33c7f0,_0x5c9f1c){_0x33c7f0=_0x33c7f0-0x0;var _0x491bef=_0x35ba[_0x33c7f0];return _0x491bef;};'use strict';var _=require(_0xa35b('0x0'));var util=require(_0xa35b('0x1'));var moment=require(_0xa35b('0x2'));var BPromise=require(_0xa35b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa35b('0x4'));var db=require(_0xa35b('0x5'))['db'];var utils=require(_0xa35b('0x6'));var logger=require(_0xa35b('0x7'))(_0xa35b('0x8'));var config=require(_0xa35b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa35b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7f0063,_0x121c8b,_0x2be599){return new BPromise(function(_0x42da91,_0x3ceb59){return client['request'](_0x7f0063,_0x2be599)[_0xa35b('0xb')](function(_0x24a4cf){logger[_0xa35b('0xc')](_0xa35b('0xd'),_0x121c8b,_0xa35b('0xe'));logger[_0xa35b('0xf')](_0xa35b('0x10'),_0x121c8b,_0xa35b('0xe'),JSON[_0xa35b('0x11')](_0x24a4cf));if(_0x24a4cf['error']){if(_0x24a4cf[_0xa35b('0x12')]['code']===0x1f4){logger[_0xa35b('0x12')](_0xa35b('0xd'),_0x121c8b,_0x24a4cf[_0xa35b('0x12')][_0xa35b('0x13')]);return _0x3ceb59(_0x24a4cf[_0xa35b('0x12')]['message']);}logger[_0xa35b('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x121c8b,_0x24a4cf[_0xa35b('0x12')]['message']);return _0x42da91(_0x24a4cf[_0xa35b('0x12')][_0xa35b('0x13')]);}else{logger['info'](_0xa35b('0xd'),_0x121c8b,_0xa35b('0xe'));_0x42da91(_0x24a4cf[_0xa35b('0x14')][_0xa35b('0x13')]);}})[_0xa35b('0x15')](function(_0x3f1c6f){logger[_0xa35b('0x12')](_0xa35b('0xd'),_0x121c8b,_0x3f1c6f);_0x3ceb59(_0x3f1c6f);});});} \ No newline at end of file +var _0xe600=['rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5adce5,_0x3dc2c0){var _0x3a6105=function(_0x2c1789){while(--_0x2c1789){_0x5adce5['push'](_0x5adce5['shift']());}};_0x3a6105(++_0x3dc2c0);}(_0xe600,0x159));var _0x0e60=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe600[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x0e60('0x0'));var moment=require('moment');var BPromise=require(_0x0e60('0x1'));var rs=require(_0x0e60('0x2'));var fs=require('fs');var Redis=require(_0x0e60('0x3'));var db=require(_0x0e60('0x4'))['db'];var utils=require(_0x0e60('0x5'));var logger=require(_0x0e60('0x6'))(_0x0e60('0x7'));var config=require(_0x0e60('0x8'));var jayson=require(_0x0e60('0x9'));var client=jayson[_0x0e60('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7563,_0x497a61,_0x6727dd){return new BPromise(function(_0x30eaed,_0x5ba123){return client[_0x0e60('0xb')](_0x1d7563,_0x6727dd)[_0x0e60('0xc')](function(_0x238537){logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));logger['debug'](_0x0e60('0x10'),_0x497a61,_0x0e60('0xf'),JSON[_0x0e60('0x11')](_0x238537));if(_0x238537[_0x0e60('0x12')]){if(_0x238537[_0x0e60('0x12')][_0x0e60('0x13')]===0x1f4){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537['error'][_0x0e60('0x14')]);return _0x5ba123(_0x238537[_0x0e60('0x12')][_0x0e60('0x14')]);}logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537[_0x0e60('0x12')]['message']);return _0x30eaed(_0x238537[_0x0e60('0x12')]['message']);}else{logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));_0x30eaed(_0x238537['result'][_0x0e60('0x14')]);}})[_0x0e60('0x15')](function(_0xdb7760){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0xdb7760);_0x5ba123(_0xdb7760);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 1881327..d8913b2 100644 --- a/server/api/analyticDefaultReport/index.js +++ b/server/api/analyticDefaultReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ce1=['./analyticDefaultReport.controller','isAuthenticated','get','show','/:id/run','run','/:id/query','query','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../config/environment'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x7ce1,0xf1));var _0x17ce=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0x7ce1[_0x47408e];return _0x1636bc;};'use strict';var multer=require(_0x17ce('0x0'));var util=require('util');var path=require(_0x17ce('0x1'));var timeout=require(_0x17ce('0x2'));var express=require(_0x17ce('0x3'));var router=express[_0x17ce('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x17ce('0x5'));var controller=require(_0x17ce('0x6'));router['get']('/',auth[_0x17ce('0x7')](),controller['index']);router[_0x17ce('0x8')]('/:id',auth[_0x17ce('0x7')](),controller[_0x17ce('0x9')]);router[_0x17ce('0x8')]('/:id/preview',auth[_0x17ce('0x7')](),controller['preview']);router[_0x17ce('0x8')](_0x17ce('0xa'),auth[_0x17ce('0x7')](),controller[_0x17ce('0xb')]);router[_0x17ce('0x8')](_0x17ce('0xc'),auth[_0x17ce('0x7')](),controller[_0x17ce('0xd')]);router['post']('/',auth[_0x17ce('0x7')](),controller[_0x17ce('0xe')]);router[_0x17ce('0xf')]('/:id',auth[_0x17ce('0x7')](),controller[_0x17ce('0x10')]);router[_0x17ce('0x11')]('/:id',auth[_0x17ce('0x7')](),controller['destroy']);module[_0x17ce('0x12')]=router; \ No newline at end of file +var _0x3ca5=['util','path','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','run','/:id/query','query','post','create','update','delete','destroy','multer'];(function(_0x72e9b3,_0xd2cfde){var _0x5a8c3e=function(_0x553e01){while(--_0x553e01){_0x72e9b3['push'](_0x72e9b3['shift']());}};_0x5a8c3e(++_0xd2cfde);}(_0x3ca5,0x92));var _0x53ca=function(_0x3e3b05,_0x1ebedc){_0x3e3b05=_0x3e3b05-0x0;var _0x45ea10=_0x3ca5[_0x3e3b05];return _0x45ea10;};'use strict';var multer=require(_0x53ca('0x0'));var util=require(_0x53ca('0x1'));var path=require(_0x53ca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x53ca('0x3'));var config=require(_0x53ca('0x4'));var controller=require(_0x53ca('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x53ca('0x6')]);router[_0x53ca('0x7')](_0x53ca('0x8'),auth[_0x53ca('0x9')](),controller[_0x53ca('0xa')]);router[_0x53ca('0x7')](_0x53ca('0xb'),auth['isAuthenticated'](),controller[_0x53ca('0xc')]);router[_0x53ca('0x7')]('/:id/run',auth[_0x53ca('0x9')](),controller[_0x53ca('0xd')]);router[_0x53ca('0x7')](_0x53ca('0xe'),auth[_0x53ca('0x9')](),controller[_0x53ca('0xf')]);router[_0x53ca('0x10')]('/',auth[_0x53ca('0x9')](),controller[_0x53ca('0x11')]);router['put'](_0x53ca('0x8'),auth[_0x53ca('0x9')](),controller[_0x53ca('0x12')]);router[_0x53ca('0x13')](_0x53ca('0x8'),auth[_0x53ca('0x9')](),controller[_0x53ca('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8a72d3f..d1d3cc4 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe85=['ENUM','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0x44d5b2,_0x100934){var _0x5eeb4b=function(_0x22d2f5){while(--_0x22d2f5){_0x44d5b2['push'](_0x44d5b2['shift']());}};_0x5eeb4b(++_0x100934);}(_0xfe85,0x1cd));var _0x5fe8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe85[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5fe8('0x0'));module[_0x5fe8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x5fe8('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x5fe8('0x3'),_0x5fe8('0x4'),_0x5fe8('0x5')),'allowNull':![],'defaultValue':_0x5fe8('0x3')},'savename':{'type':Sequelize[_0x5fe8('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x5fe8('0x6')]},'status':{'type':Sequelize[_0x5fe8('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x5fe8('0x7')](_0x5fe8('0x8'),_0x5fe8('0x9')),'allowNull':![],'defaultValue':_0x5fe8('0x8')},'reportId':{'type':Sequelize[_0x5fe8('0xa')](0xb)[_0x5fe8('0xb')]},'reportType':{'type':Sequelize[_0x5fe8('0x2')]}}; \ No newline at end of file +var _0x9a31=['moment','exports','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','sequelize'];(function(_0x31e7cf,_0x3372cd){var _0x435d45=function(_0x34d440){while(--_0x34d440){_0x31e7cf['push'](_0x31e7cf['shift']());}};_0x435d45(++_0x3372cd);}(_0x9a31,0xc2));var _0x19a3=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0x9a31[_0x3132e8];return _0x43eb8c;};'use strict';var Sequelize=require(_0x19a3('0x0'));var moment=require(_0x19a3('0x1'));module[_0x19a3('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x19a3('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x19a3('0x4'),_0x19a3('0x5'),_0x19a3('0x6')),'allowNull':![],'defaultValue':_0x19a3('0x4')},'savename':{'type':Sequelize[_0x19a3('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x19a3('0x7')]},'endDate':{'type':Sequelize[_0x19a3('0x7')]},'status':{'type':Sequelize[_0x19a3('0x3')],'defaultValue':_0x19a3('0x8')},'type':{'type':Sequelize[_0x19a3('0x9')](_0x19a3('0xa'),_0x19a3('0xb')),'allowNull':![],'defaultValue':_0x19a3('0xa')},'reportId':{'type':Sequelize[_0x19a3('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f644bf4..1ce0bd8 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9910=['limit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x5166eb,_0x5118b7){var _0x2fd2e9=function(_0xf1de4b){while(--_0xf1de4b){_0x5166eb['push'](_0x5166eb['shift']());}};_0x2fd2e9(++_0x5118b7);}(_0x9910,0x1b9));var _0x0991=function(_0x2fa4e9,_0x5f1cef){_0x2fa4e9=_0x2fa4e9-0x0;var _0x538ec4=_0x9910[_0x2fa4e9];return _0x538ec4;};'use strict';var pdf=require(_0x0991('0x0'));var emlformat=require(_0x0991('0x1'));var rimraf=require(_0x0991('0x2'));var zipdir=require(_0x0991('0x3'));var jsonpatch=require(_0x0991('0x4'));var rp=require(_0x0991('0x5'));var moment=require(_0x0991('0x6'));var BPromise=require(_0x0991('0x7'));var Mustache=require(_0x0991('0x8'));var util=require(_0x0991('0x9'));var path=require(_0x0991('0xa'));var sox=require('sox');var csv=require(_0x0991('0xb'));var ejs=require(_0x0991('0xc'));var fs=require('fs');var _=require(_0x0991('0xd'));var squel=require(_0x0991('0xe'));var crypto=require(_0x0991('0xf'));var jsforce=require(_0x0991('0x10'));var deskjs=require(_0x0991('0x11'));var toCsv=require(_0x0991('0xb'));var querystring=require(_0x0991('0x12'));var Papa=require(_0x0991('0x13'));var Redis=require(_0x0991('0x14'));var authService=require(_0x0991('0x15'));var qs=require(_0x0991('0x16'));var as=require(_0x0991('0x17'));var hardwareService=require(_0x0991('0x18'));var logger=require(_0x0991('0x19'))(_0x0991('0x1a'));var utils=require(_0x0991('0x1b'));var config=require(_0x0991('0x1c'));var db=require(_0x0991('0x1d'))['db'];function respondWithStatusCode(_0x3dbfce,_0x553622){_0x553622=_0x553622||0xcc;return function(_0x24ec58){if(_0x24ec58){return _0x3dbfce[_0x0991('0x1e')](_0x553622);}return _0x3dbfce[_0x0991('0x1f')](_0x553622)[_0x0991('0x20')]();};}function respondWithResult(_0x3f7025,_0x251cb2){_0x251cb2=_0x251cb2||0xc8;return function(_0x126d8d){if(_0x126d8d){return _0x3f7025[_0x0991('0x1f')](_0x251cb2)[_0x0991('0x21')](_0x126d8d);}};}function respondWithFilteredResult(_0x259665,_0x34d166){return function(_0x45fb2e){if(_0x45fb2e){var _0x5a6673=_0x45fb2e[_0x0991('0x22')],_0x6c3f7b=_0x34d166['offset'],_0x195fc1=_0x34d166[_0x0991('0x23')]+_0x34d166['limit'],_0x261b83;if(_0x195fc1>=_0x5a6673){_0x195fc1=_0x5a6673;_0x261b83=0xc8;}else{_0x261b83=0xce;}_0x259665['status'](_0x261b83);return _0x259665[_0x0991('0x24')](_0x0991('0x25'),_0x6c3f7b+'-'+_0x195fc1+'/'+_0x5a6673)[_0x0991('0x21')](_0x45fb2e);}return null;};}function patchUpdates(_0x331479){return function(_0x3474e3){try{jsonpatch[_0x0991('0x26')](_0x3474e3,_0x331479,!![]);}catch(_0x56632d){return BPromise[_0x0991('0x27')](_0x56632d);}return _0x3474e3[_0x0991('0x28')]();};}function saveUpdates(_0x5b6641,_0x4c9a6b){return function(_0x127da7){if(_0x127da7){return _0x127da7['update'](_0x5b6641)[_0x0991('0x29')](function(_0x17284a){return _0x17284a;});}return null;};}function removeEntity(_0x1f5d48,_0x216b37){return function(_0x4a1667){if(_0x4a1667){return _0x4a1667[_0x0991('0x2a')]()[_0x0991('0x29')](function(){var _0x1b1e06=_0x4a1667[_0x0991('0x2b')]({'plain':!![]});var _0x414b17=_0x0991('0x2c');return db[_0x0991('0x2d')][_0x0991('0x2a')]({'where':{'type':_0x414b17,'resourceId':_0x1b1e06['id']}})[_0x0991('0x29')](function(){return _0x4a1667;});})[_0x0991('0x29')](function(){_0x1f5d48['status'](0xcc)[_0x0991('0x20')]();});}};}function handleEntityNotFound(_0x3e0d58,_0x170f05){return function(_0x123867){if(!_0x123867){_0x3e0d58[_0x0991('0x1e')](0x194);}return _0x123867;};}function handleError(_0x43f889,_0x4b6431){_0x4b6431=_0x4b6431||0x1f4;return function(_0x241f6a){logger[_0x0991('0x2e')](_0x241f6a['stack']);if(_0x241f6a[_0x0991('0x2f')]){delete _0x241f6a[_0x0991('0x2f')];}_0x43f889['status'](_0x4b6431)[_0x0991('0x30')](_0x241f6a);};}exports[_0x0991('0x31')]=function(_0x5d6207,_0x221a52){var _0x491cf4={},_0x558f77={},_0x3cc609={'count':0x0,'rows':[]};var _0x4f7db4=_[_0x0991('0x32')](db[_0x0991('0x33')][_0x0991('0x34')],function(_0x65ab14){return{'name':_0x65ab14[_0x0991('0x35')],'type':_0x65ab14[_0x0991('0x36')][_0x0991('0x37')]};});_0x558f77[_0x0991('0x38')]=_['map'](_0x4f7db4,_0x0991('0x2f'));_0x558f77[_0x0991('0x39')]=_[_0x0991('0x3a')](_0x5d6207['query']);_0x558f77['filters']=_[_0x0991('0x3b')](_0x558f77[_0x0991('0x38')],_0x558f77[_0x0991('0x39')]);_0x491cf4[_0x0991('0x3c')]=_[_0x0991('0x3b')](_0x558f77['model'],qs[_0x0991('0x3d')](_0x5d6207[_0x0991('0x39')]['fields']));_0x491cf4[_0x0991('0x3c')]=_0x491cf4[_0x0991('0x3c')][_0x0991('0x3e')]?_0x491cf4[_0x0991('0x3c')]:_0x558f77[_0x0991('0x38')];if(!_0x5d6207[_0x0991('0x39')][_0x0991('0x3f')]('nolimit')){_0x491cf4[_0x0991('0x40')]=qs['limit'](_0x5d6207[_0x0991('0x39')][_0x0991('0x40')]);_0x491cf4[_0x0991('0x23')]=qs[_0x0991('0x23')](_0x5d6207[_0x0991('0x39')][_0x0991('0x23')]);}_0x491cf4[_0x0991('0x41')]=qs[_0x0991('0x42')](_0x5d6207['query'][_0x0991('0x42')]);_0x491cf4['where']=qs[_0x0991('0x43')](_['pick'](_0x5d6207[_0x0991('0x39')],_0x558f77[_0x0991('0x43')]));if(_0x5d6207[_0x0991('0x39')][_0x0991('0x44')]){_0x491cf4[_0x0991('0x45')]=_[_0x0991('0x46')](_0x491cf4[_0x0991('0x45')],{'$or':_[_0x0991('0x32')](_0x4f7db4,function(_0x38efd4){if(_0x38efd4[_0x0991('0x36')]!=='VIRTUAL'){var _0x256cef={};_0x256cef[_0x38efd4['name']]={'$like':'%'+_0x5d6207['query']['filter']+'%'};return _0x256cef;}})});}_0x491cf4=_['merge']({},_0x491cf4,_0x5d6207[_0x0991('0x47')]);var _0x567af5={'where':_0x491cf4['where']};return db[_0x0991('0x33')][_0x0991('0x22')](_0x567af5)['then'](function(_0x148b6d){_0x3cc609[_0x0991('0x22')]=_0x148b6d;if(_0x5d6207[_0x0991('0x39')][_0x0991('0x48')]){_0x491cf4[_0x0991('0x49')]=[{'all':!![]}];}return db[_0x0991('0x33')][_0x0991('0x4a')](_0x491cf4);})[_0x0991('0x29')](function(_0x4cb6ab){_0x3cc609['rows']=_0x4cb6ab;return _0x3cc609;})[_0x0991('0x29')](respondWithFilteredResult(_0x221a52,_0x491cf4))[_0x0991('0x4b')](handleError(_0x221a52,null));};exports[_0x0991('0x4c')]=function(_0x3e49a6,_0x296efa){var _0x50aa9f={'raw':!![],'where':{'id':_0x3e49a6['params']['id']}},_0x57201f={};_0x57201f[_0x0991('0x38')]=_[_0x0991('0x3a')](db[_0x0991('0x33')][_0x0991('0x34')]);_0x57201f['query']=_[_0x0991('0x3a')](_0x3e49a6['query']);_0x57201f['filters']=_[_0x0991('0x3b')](_0x57201f[_0x0991('0x38')],_0x57201f[_0x0991('0x39')]);_0x50aa9f[_0x0991('0x3c')]=_[_0x0991('0x3b')](_0x57201f[_0x0991('0x38')],qs[_0x0991('0x3d')](_0x3e49a6[_0x0991('0x39')][_0x0991('0x3d')]));_0x50aa9f[_0x0991('0x3c')]=_0x50aa9f['attributes']['length']?_0x50aa9f[_0x0991('0x3c')]:_0x57201f[_0x0991('0x38')];if(_0x3e49a6['query'][_0x0991('0x48')]){_0x50aa9f[_0x0991('0x49')]=[{'all':!![]}];}_0x50aa9f=_[_0x0991('0x46')]({},_0x50aa9f,_0x3e49a6[_0x0991('0x47')]);return db[_0x0991('0x33')][_0x0991('0x4d')](_0x50aa9f)[_0x0991('0x29')](handleEntityNotFound(_0x296efa,null))[_0x0991('0x29')](respondWithResult(_0x296efa,null))[_0x0991('0x4b')](handleError(_0x296efa,null));};exports[_0x0991('0x4e')]=function(_0x519e09,_0x52cba1){return db['AnalyticExtractedReport'][_0x0991('0x4e')](_0x519e09[_0x0991('0x4f')],{})[_0x0991('0x29')](function(_0x4f6daf){var _0x7dd8b1=_0x519e09[_0x0991('0x50')][_0x0991('0x2b')]({'plain':!![]});if(!_0x7dd8b1)throw new Error(_0x0991('0x51'));if(_0x7dd8b1['role']===_0x0991('0x50')){var _0x118b02=_0x4f6daf[_0x0991('0x2b')]({'plain':!![]});var _0x16240e=_0x0991('0x2c');return db[_0x0991('0x52')][_0x0991('0x4d')]({'where':{'name':_0x16240e,'userProfileId':_0x7dd8b1[_0x0991('0x53')]},'raw':!![]})[_0x0991('0x29')](function(_0x3c598e){if(_0x3c598e&&_0x3c598e[_0x0991('0x54')]===0x0){return db[_0x0991('0x2d')][_0x0991('0x4e')]({'name':_0x118b02[_0x0991('0x2f')],'resourceId':_0x118b02['id'],'type':_0x3c598e['name'],'sectionId':_0x3c598e['id']},{})[_0x0991('0x29')](function(){return _0x4f6daf;});}else{return _0x4f6daf;}})['catch'](function(_0x1f1842){logger[_0x0991('0x2e')](_0x0991('0x55'),_0x1f1842);throw _0x1f1842;});}return _0x4f6daf;})[_0x0991('0x29')](respondWithResult(_0x52cba1,0xc9))[_0x0991('0x4b')](handleError(_0x52cba1,null));};exports['update']=function(_0x3dd981,_0x31e59f){if(_0x3dd981['body']['id']){delete _0x3dd981[_0x0991('0x4f')]['id'];}return db[_0x0991('0x33')][_0x0991('0x4d')]({'where':{'id':_0x3dd981[_0x0991('0x56')]['id']}})[_0x0991('0x29')](handleEntityNotFound(_0x31e59f,null))['then'](saveUpdates(_0x3dd981[_0x0991('0x4f')],null))[_0x0991('0x29')](respondWithResult(_0x31e59f,null))[_0x0991('0x4b')](handleError(_0x31e59f,null));};exports[_0x0991('0x2a')]=function(_0x23b22f,_0x3d82f5){return db[_0x0991('0x33')]['find']({'where':{'id':_0x23b22f['params']['id']}})[_0x0991('0x29')](handleEntityNotFound(_0x3d82f5,null))[_0x0991('0x29')](removeEntity(_0x3d82f5,null))[_0x0991('0x4b')](handleError(_0x3d82f5,null));};exports[_0x0991('0x57')]=function(_0x426fe5,_0x17825f,_0x4147b2){return db['AnalyticExtractedReport'][_0x0991('0x4d')]({'where':{'id':_0x426fe5[_0x0991('0x56')]['id']},'attributes':[_0x0991('0x2f'),_0x0991('0x58'),_0x0991('0x59'),_0x0991('0x5a')],'raw':!![]})[_0x0991('0x29')](handleEntityNotFound(_0x17825f,null))['then'](function(_0xd12af0){if(_0xd12af0){if(!fs[_0x0991('0x5b')](path[_0x0991('0x5c')](config['root'],_0x0991('0x5d'),_0xd12af0[_0x0991('0x59')]))){throw new db[(_0x0991('0x5e'))][(_0x0991('0x5f'))](_0x0991('0x60'));}if(_0x426fe5[_0x0991('0x39')][_0x0991('0x61')]){return _0x17825f[_0x0991('0x1e')](0xc8);}return _0x17825f[_0x0991('0x57')](path[_0x0991('0x5c')](config[_0x0991('0x62')],_0x0991('0x5d'),_0xd12af0[_0x0991('0x59')]),util[_0x0991('0x63')](_0x0991('0x64'),_0xd12af0['basename']||_0xd12af0[_0x0991('0x2f')],_0xd12af0[_0x0991('0x5a')]['toLowerCase']()));}})[_0x0991('0x4b')](handleError(_0x17825f,null));}; \ No newline at end of file +var _0xc91b=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','download','basename','existsSync','join','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','ExtractedReports','destroy','end','error','stack','name','AnalyticExtractedReport','rawAttributes','key','map'];(function(_0x1bcb7f,_0x53e669){var _0x3076f8=function(_0x18320d){while(--_0x18320d){_0x1bcb7f['push'](_0x1bcb7f['shift']());}};_0x3076f8(++_0x53e669);}(_0xc91b,0x148));var _0xbc91=function(_0x262fcf,_0xea9dee){_0x262fcf=_0x262fcf-0x0;var _0x4c34f6=_0xc91b[_0x262fcf];return _0x4c34f6;};'use strict';var pdf=require(_0xbc91('0x0'));var emlformat=require(_0xbc91('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbc91('0x2'));var jsonpatch=require(_0xbc91('0x3'));var rp=require('request-promise');var moment=require(_0xbc91('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc91('0x5'));var util=require(_0xbc91('0x6'));var path=require('path');var sox=require(_0xbc91('0x7'));var csv=require(_0xbc91('0x8'));var ejs=require(_0xbc91('0x9'));var fs=require('fs');var _=require(_0xbc91('0xa'));var squel=require('squel');var crypto=require(_0xbc91('0xb'));var jsforce=require(_0xbc91('0xc'));var deskjs=require(_0xbc91('0xd'));var toCsv=require(_0xbc91('0x8'));var querystring=require(_0xbc91('0xe'));var Papa=require(_0xbc91('0xf'));var Redis=require(_0xbc91('0x10'));var authService=require(_0xbc91('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbc91('0x12'));var hardwareService=require(_0xbc91('0x13'));var logger=require(_0xbc91('0x14'))(_0xbc91('0x15'));var utils=require(_0xbc91('0x16'));var config=require(_0xbc91('0x17'));var db=require(_0xbc91('0x18'))['db'];function respondWithStatusCode(_0x305db6,_0x3ff062){_0x3ff062=_0x3ff062||0xcc;return function(_0x20c99e){if(_0x20c99e){return _0x305db6[_0xbc91('0x19')](_0x3ff062);}return _0x305db6[_0xbc91('0x1a')](_0x3ff062)['end']();};}function respondWithResult(_0x5bf974,_0x21fc2f){_0x21fc2f=_0x21fc2f||0xc8;return function(_0x2dbf5a){if(_0x2dbf5a){return _0x5bf974[_0xbc91('0x1a')](_0x21fc2f)[_0xbc91('0x1b')](_0x2dbf5a);}};}function respondWithFilteredResult(_0xc7a7ad,_0x506b06){return function(_0x1af7b9){if(_0x1af7b9){var _0x476d45=_0x1af7b9[_0xbc91('0x1c')],_0x58eeb4=_0x506b06[_0xbc91('0x1d')],_0xd67775=_0x506b06['offset']+_0x506b06[_0xbc91('0x1e')],_0x34f4c6;if(_0xd67775>=_0x476d45){_0xd67775=_0x476d45;_0x34f4c6=0xc8;}else{_0x34f4c6=0xce;}_0xc7a7ad[_0xbc91('0x1a')](_0x34f4c6);return _0xc7a7ad[_0xbc91('0x1f')](_0xbc91('0x20'),_0x58eeb4+'-'+_0xd67775+'/'+_0x476d45)['json'](_0x1af7b9);}return null;};}function patchUpdates(_0x2da5f8){return function(_0x51a597){try{jsonpatch[_0xbc91('0x21')](_0x51a597,_0x2da5f8,!![]);}catch(_0xa0dc1e){return BPromise[_0xbc91('0x22')](_0xa0dc1e);}return _0x51a597[_0xbc91('0x23')]();};}function saveUpdates(_0x15915b,_0x4d53fa){return function(_0x170405){if(_0x170405){return _0x170405[_0xbc91('0x24')](_0x15915b)[_0xbc91('0x25')](function(_0x189244){return _0x189244;});}return null;};}function removeEntity(_0x5131f8,_0x304229){return function(_0x3a1bbc){if(_0x3a1bbc){return _0x3a1bbc['destroy']()[_0xbc91('0x25')](function(){var _0x96607d=_0x3a1bbc['get']({'plain':!![]});var _0x272bd0=_0xbc91('0x26');return db['UserProfileResource'][_0xbc91('0x27')]({'where':{'type':_0x272bd0,'resourceId':_0x96607d['id']}})[_0xbc91('0x25')](function(){return _0x3a1bbc;});})['then'](function(){_0x5131f8[_0xbc91('0x1a')](0xcc)[_0xbc91('0x28')]();});}};}function handleEntityNotFound(_0x462045,_0x3b426e){return function(_0x4fe3ba){if(!_0x4fe3ba){_0x462045[_0xbc91('0x19')](0x194);}return _0x4fe3ba;};}function handleError(_0x501fc0,_0x2ee50d){_0x2ee50d=_0x2ee50d||0x1f4;return function(_0xeaf1b3){logger[_0xbc91('0x29')](_0xeaf1b3[_0xbc91('0x2a')]);if(_0xeaf1b3[_0xbc91('0x2b')]){delete _0xeaf1b3[_0xbc91('0x2b')];}_0x501fc0['status'](_0x2ee50d)['send'](_0xeaf1b3);};}exports['index']=function(_0x4c6dff,_0xa2a3d7){var _0x20cfe5={},_0x59dfb6={},_0x17bd17={'count':0x0,'rows':[]};var _0x216dd2=_['map'](db[_0xbc91('0x2c')][_0xbc91('0x2d')],function(_0x52590a){return{'name':_0x52590a['fieldName'],'type':_0x52590a['type'][_0xbc91('0x2e')]};});_0x59dfb6['model']=_[_0xbc91('0x2f')](_0x216dd2,_0xbc91('0x2b'));_0x59dfb6[_0xbc91('0x30')]=_[_0xbc91('0x31')](_0x4c6dff[_0xbc91('0x30')]);_0x59dfb6[_0xbc91('0x32')]=_[_0xbc91('0x33')](_0x59dfb6[_0xbc91('0x34')],_0x59dfb6[_0xbc91('0x30')]);_0x20cfe5[_0xbc91('0x35')]=_[_0xbc91('0x33')](_0x59dfb6['model'],qs[_0xbc91('0x36')](_0x4c6dff[_0xbc91('0x30')][_0xbc91('0x36')]));_0x20cfe5[_0xbc91('0x35')]=_0x20cfe5[_0xbc91('0x35')][_0xbc91('0x37')]?_0x20cfe5[_0xbc91('0x35')]:_0x59dfb6[_0xbc91('0x34')];if(!_0x4c6dff[_0xbc91('0x30')][_0xbc91('0x38')](_0xbc91('0x39'))){_0x20cfe5['limit']=qs[_0xbc91('0x1e')](_0x4c6dff[_0xbc91('0x30')][_0xbc91('0x1e')]);_0x20cfe5[_0xbc91('0x1d')]=qs[_0xbc91('0x1d')](_0x4c6dff[_0xbc91('0x30')][_0xbc91('0x1d')]);}_0x20cfe5['order']=qs['sort'](_0x4c6dff[_0xbc91('0x30')][_0xbc91('0x3a')]);_0x20cfe5[_0xbc91('0x3b')]=qs['filters'](_[_0xbc91('0x3c')](_0x4c6dff[_0xbc91('0x30')],_0x59dfb6[_0xbc91('0x32')]));if(_0x4c6dff[_0xbc91('0x30')][_0xbc91('0x3d')]){_0x20cfe5['where']=_[_0xbc91('0x3e')](_0x20cfe5[_0xbc91('0x3b')],{'$or':_['map'](_0x216dd2,function(_0x5a579f){if(_0x5a579f['type']!==_0xbc91('0x3f')){var _0x313c44={};_0x313c44[_0x5a579f[_0xbc91('0x2b')]]={'$like':'%'+_0x4c6dff[_0xbc91('0x30')][_0xbc91('0x3d')]+'%'};return _0x313c44;}})});}_0x20cfe5=_[_0xbc91('0x3e')]({},_0x20cfe5,_0x4c6dff[_0xbc91('0x40')]);var _0x15d7e0={'where':_0x20cfe5[_0xbc91('0x3b')]};return db['AnalyticExtractedReport']['count'](_0x15d7e0)[_0xbc91('0x25')](function(_0x819407){_0x17bd17[_0xbc91('0x1c')]=_0x819407;if(_0x4c6dff['query'][_0xbc91('0x41')]){_0x20cfe5[_0xbc91('0x42')]=[{'all':!![]}];}return db[_0xbc91('0x2c')][_0xbc91('0x43')](_0x20cfe5);})['then'](function(_0x56e379){_0x17bd17[_0xbc91('0x44')]=_0x56e379;return _0x17bd17;})[_0xbc91('0x25')](respondWithFilteredResult(_0xa2a3d7,_0x20cfe5))['catch'](handleError(_0xa2a3d7,null));};exports['show']=function(_0x14c186,_0x3e076a){var _0x172e8c={'raw':!![],'where':{'id':_0x14c186[_0xbc91('0x45')]['id']}},_0x4ece4e={};_0x4ece4e[_0xbc91('0x34')]=_[_0xbc91('0x31')](db[_0xbc91('0x2c')][_0xbc91('0x2d')]);_0x4ece4e[_0xbc91('0x30')]=_[_0xbc91('0x31')](_0x14c186[_0xbc91('0x30')]);_0x4ece4e[_0xbc91('0x32')]=_['intersection'](_0x4ece4e[_0xbc91('0x34')],_0x4ece4e['query']);_0x172e8c[_0xbc91('0x35')]=_[_0xbc91('0x33')](_0x4ece4e[_0xbc91('0x34')],qs['fields'](_0x14c186[_0xbc91('0x30')][_0xbc91('0x36')]));_0x172e8c[_0xbc91('0x35')]=_0x172e8c[_0xbc91('0x35')][_0xbc91('0x37')]?_0x172e8c[_0xbc91('0x35')]:_0x4ece4e[_0xbc91('0x34')];if(_0x14c186['query'][_0xbc91('0x41')]){_0x172e8c['include']=[{'all':!![]}];}_0x172e8c=_[_0xbc91('0x3e')]({},_0x172e8c,_0x14c186[_0xbc91('0x40')]);return db['AnalyticExtractedReport']['find'](_0x172e8c)[_0xbc91('0x25')](handleEntityNotFound(_0x3e076a,null))[_0xbc91('0x25')](respondWithResult(_0x3e076a,null))[_0xbc91('0x46')](handleError(_0x3e076a,null));};exports[_0xbc91('0x47')]=function(_0x19c2de,_0x380624){return db['AnalyticExtractedReport']['create'](_0x19c2de['body'],{})[_0xbc91('0x25')](function(_0x163ca0){var _0x5aa212=_0x19c2de['user'][_0xbc91('0x48')]({'plain':!![]});if(!_0x5aa212)throw new Error(_0xbc91('0x49'));if(_0x5aa212[_0xbc91('0x4a')]===_0xbc91('0x4b')){var _0x21cf6e=_0x163ca0[_0xbc91('0x48')]({'plain':!![]});var _0x3c587e='ExtractedReports';return db[_0xbc91('0x4c')]['find']({'where':{'name':_0x3c587e,'userProfileId':_0x5aa212['userProfileId']},'raw':!![]})['then'](function(_0x188f37){if(_0x188f37&&_0x188f37[_0xbc91('0x4d')]===0x0){return db[_0xbc91('0x4e')][_0xbc91('0x47')]({'name':_0x21cf6e[_0xbc91('0x2b')],'resourceId':_0x21cf6e['id'],'type':_0x188f37[_0xbc91('0x2b')],'sectionId':_0x188f37['id']},{})['then'](function(){return _0x163ca0;});}else{return _0x163ca0;}})[_0xbc91('0x46')](function(_0x5649e6){logger['error'](_0xbc91('0x4f'),_0x5649e6);throw _0x5649e6;});}return _0x163ca0;})[_0xbc91('0x25')](respondWithResult(_0x380624,0xc9))[_0xbc91('0x46')](handleError(_0x380624,null));};exports[_0xbc91('0x24')]=function(_0x3e0596,_0x319326){if(_0x3e0596[_0xbc91('0x50')]['id']){delete _0x3e0596[_0xbc91('0x50')]['id'];}return db[_0xbc91('0x2c')][_0xbc91('0x51')]({'where':{'id':_0x3e0596[_0xbc91('0x45')]['id']}})['then'](handleEntityNotFound(_0x319326,null))[_0xbc91('0x25')](saveUpdates(_0x3e0596[_0xbc91('0x50')],null))[_0xbc91('0x25')](respondWithResult(_0x319326,null))['catch'](handleError(_0x319326,null));};exports['destroy']=function(_0x2fc4f7,_0x18b253){return db[_0xbc91('0x2c')][_0xbc91('0x51')]({'where':{'id':_0x2fc4f7[_0xbc91('0x45')]['id']}})[_0xbc91('0x25')](handleEntityNotFound(_0x18b253,null))['then'](removeEntity(_0x18b253,null))[_0xbc91('0x46')](handleError(_0x18b253,null));};exports[_0xbc91('0x52')]=function(_0x28ad51,_0x51ed90,_0x3c5d0e){return db[_0xbc91('0x2c')]['find']({'where':{'id':_0x28ad51[_0xbc91('0x45')]['id']},'attributes':[_0xbc91('0x2b'),_0xbc91('0x53'),'savename','output'],'raw':!![]})[_0xbc91('0x25')](handleEntityNotFound(_0x51ed90,null))[_0xbc91('0x25')](function(_0x422883){if(_0x422883){if(!fs[_0xbc91('0x54')](path[_0xbc91('0x55')](config['root'],_0xbc91('0x56'),_0x422883[_0xbc91('0x57')]))){throw new db[(_0xbc91('0x58'))]['ValidationError'](_0xbc91('0x59'));}if(_0x28ad51[_0xbc91('0x30')][_0xbc91('0x5a')]){return _0x51ed90[_0xbc91('0x19')](0xc8);}return _0x51ed90['download'](path['join'](config['root'],_0xbc91('0x56'),_0x422883['savename']),util[_0xbc91('0x5b')](_0xbc91('0x5c'),_0x422883['basename']||_0x422883[_0xbc91('0x2b')],_0x422883[_0xbc91('0x5d')]['toLowerCase']()));}})[_0xbc91('0x46')](handleError(_0x51ed90,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index d115f1f..a9d1c49 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x949b=['./analyticExtractedReport.attributes','define','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4e4e83,_0x2f29a7){var _0x4cbeb6=function(_0x6e3854){while(--_0x6e3854){_0x4e4e83['push'](_0x4e4e83['shift']());}};_0x4cbeb6(++_0x2f29a7);}(_0x949b,0x1ce));var _0xb949=function(_0x5c5c0d,_0x1dbe17){_0x5c5c0d=_0x5c5c0d-0x0;var _0x79db1c=_0x949b[_0x5c5c0d];return _0x79db1c;};'use strict';var _=require(_0xb949('0x0'));var util=require(_0xb949('0x1'));var logger=require(_0xb949('0x2'))('api');var moment=require(_0xb949('0x3'));var BPromise=require(_0xb949('0x4'));var rp=require(_0xb949('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb949('0x6'));var config=require(_0xb949('0x7'));var attributes=require(_0xb949('0x8'));module['exports']=function(_0x40eac0,_0x251e70){return _0x40eac0[_0xb949('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ea5=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','lodash','util','../../config/logger','request-promise'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x8ea5,0x68));var _0x58ea=function(_0x10d7bd,_0x26414e){_0x10d7bd=_0x10d7bd-0x0;var _0x397b5e=_0x8ea5[_0x10d7bd];return _0x397b5e;};'use strict';var _=require(_0x58ea('0x0'));var util=require(_0x58ea('0x1'));var logger=require(_0x58ea('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58ea('0x3'));var fs=require('fs');var path=require(_0x58ea('0x4'));var rimraf=require(_0x58ea('0x5'));var config=require(_0x58ea('0x6'));var attributes=require(_0x58ea('0x7'));module[_0x58ea('0x8')]=function(_0x16fe69,_0x3cf959){return _0x16fe69['define']('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index bcc36be..f2dca05 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc818=['moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x48517d,_0x2056b7){var _0x2b6e8c=function(_0x903028){while(--_0x903028){_0x48517d['push'](_0x48517d['shift']());}};_0x2b6e8c(++_0x2056b7);}(_0xc818,0x163));var _0x8c81=function(_0x2b5953,_0x356071){_0x2b5953=_0x2b5953-0x0;var _0x1f3b37=_0xc818[_0x2b5953];return _0x1f3b37;};'use strict';var _=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var moment=require(_0x8c81('0x2'));var BPromise=require(_0x8c81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c81('0x4'));var logger=require(_0x8c81('0x5'))('rpc');var config=require(_0x8c81('0x6'));var jayson=require(_0x8c81('0x7'));var client=jayson[_0x8c81('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50b6a3,_0x414155,_0x369ee8){return new BPromise(function(_0x521562,_0x32635e){return client[_0x8c81('0x9')](_0x50b6a3,_0x369ee8)['then'](function(_0x21e318){logger['info'](_0x8c81('0xa'),_0x414155,_0x8c81('0xb'));logger[_0x8c81('0xc')](_0x8c81('0xd'),_0x414155,_0x8c81('0xb'),JSON[_0x8c81('0xe')](_0x21e318));if(_0x21e318[_0x8c81('0xf')]){if(_0x21e318['error'][_0x8c81('0x10')]===0x1f4){logger['error'](_0x8c81('0xa'),_0x414155,_0x21e318[_0x8c81('0xf')][_0x8c81('0x11')]);return _0x32635e(_0x21e318[_0x8c81('0xf')]['message']);}logger[_0x8c81('0xf')](_0x8c81('0xa'),_0x414155,_0x21e318[_0x8c81('0xf')][_0x8c81('0x11')]);return _0x521562(_0x21e318[_0x8c81('0xf')][_0x8c81('0x11')]);}else{logger[_0x8c81('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x414155,_0x8c81('0xb'));_0x521562(_0x21e318[_0x8c81('0x13')][_0x8c81('0x11')]);}})[_0x8c81('0x14')](function(_0x58f140){logger[_0x8c81('0xf')](_0x8c81('0xa'),_0x414155,_0x58f140);_0x32635e(_0x58f140);});});} \ No newline at end of file +var _0xa32b=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa32b,0x6d));var _0xba32=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xa32b[_0x79b649];return _0x1af9b1;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var moment=require(_0xba32('0x1'));var BPromise=require(_0xba32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba32('0x3'))['db'];var utils=require(_0xba32('0x4'));var logger=require(_0xba32('0x5'))(_0xba32('0x6'));var config=require(_0xba32('0x7'));var jayson=require(_0xba32('0x8'));var client=jayson[_0xba32('0x9')][_0xba32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcfb8b2,_0x556902,_0x1415d9){return new BPromise(function(_0x29bb2f,_0x4b04f6){return client[_0xba32('0xb')](_0xcfb8b2,_0x1415d9)[_0xba32('0xc')](function(_0x48cc84){logger[_0xba32('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x556902,_0xba32('0xe'));logger[_0xba32('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x556902,_0xba32('0xe'),JSON[_0xba32('0x10')](_0x48cc84));if(_0x48cc84[_0xba32('0x11')]){if(_0x48cc84[_0xba32('0x11')][_0xba32('0x12')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x556902,_0x48cc84['error'][_0xba32('0x13')]);return _0x4b04f6(_0x48cc84[_0xba32('0x11')][_0xba32('0x13')]);}logger[_0xba32('0x11')](_0xba32('0x14'),_0x556902,_0x48cc84[_0xba32('0x11')][_0xba32('0x13')]);return _0x29bb2f(_0x48cc84[_0xba32('0x11')]['message']);}else{logger[_0xba32('0xd')](_0xba32('0x14'),_0x556902,_0xba32('0xe'));_0x29bb2f(_0x48cc84[_0xba32('0x15')][_0xba32('0x13')]);}})['catch'](function(_0xb56e1d){logger[_0xba32('0x11')](_0xba32('0x14'),_0x556902,_0xb56e1d);_0x4b04f6(_0xb56e1d);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index bd5be48..783d4b0 100644 --- a/server/api/analyticExtractedReport/index.js +++ b/server/api/analyticExtractedReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51c4=['delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update'];(function(_0x2870ee,_0xb14f25){var _0x13c305=function(_0x4470ce){while(--_0x4470ce){_0x2870ee['push'](_0x2870ee['shift']());}};_0x13c305(++_0xb14f25);}(_0x51c4,0x192));var _0x451c=function(_0x99b8be,_0xa6a24){_0x99b8be=_0x99b8be-0x0;var _0x1a553e=_0x51c4[_0x99b8be];return _0x1a553e;};'use strict';var multer=require('multer');var util=require(_0x451c('0x0'));var path=require(_0x451c('0x1'));var timeout=require(_0x451c('0x2'));var express=require('express');var router=express[_0x451c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x451c('0x4'));var config=require(_0x451c('0x5'));var controller=require(_0x451c('0x6'));router[_0x451c('0x7')]('/',auth[_0x451c('0x8')](),controller[_0x451c('0x9')]);router[_0x451c('0x7')](_0x451c('0xa'),auth['isAuthenticated'](),controller[_0x451c('0xb')]);router[_0x451c('0x7')](_0x451c('0xc'),auth['isAuthenticated'](),controller[_0x451c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x451c('0xe')]);router['put'](_0x451c('0xa'),auth['isAuthenticated'](),controller[_0x451c('0xf')]);router[_0x451c('0x10')](_0x451c('0xa'),auth[_0x451c('0x8')](),controller[_0x451c('0x11')]);module[_0x451c('0x12')]=router; \ No newline at end of file +var _0x5467=['update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','put'];(function(_0x503acd,_0xe4451f){var _0x472c15=function(_0x271f8b){while(--_0x271f8b){_0x503acd['push'](_0x503acd['shift']());}};_0x472c15(++_0xe4451f);}(_0x5467,0x116));var _0x7546=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5467[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7546('0x0'));var util=require(_0x7546('0x1'));var path=require(_0x7546('0x2'));var timeout=require(_0x7546('0x3'));var express=require(_0x7546('0x4'));var router=express[_0x7546('0x5')]();var auth=require(_0x7546('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7546('0x7'));var controller=require(_0x7546('0x8'));router[_0x7546('0x9')]('/',auth[_0x7546('0xa')](),controller[_0x7546('0xb')]);router[_0x7546('0x9')]('/:id',auth[_0x7546('0xa')](),controller[_0x7546('0xc')]);router[_0x7546('0x9')](_0x7546('0xd'),auth[_0x7546('0xa')](),controller[_0x7546('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7546('0xf')]('/:id',auth[_0x7546('0xa')](),controller[_0x7546('0x10')]);router[_0x7546('0x11')](_0x7546('0x12'),auth['isAuthenticated'](),controller[_0x7546('0x13')]);module[_0x7546('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index e3fbaa0..5663725 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js +++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['exports','TEXT','STRING','BOOLEAN'];(function(_0x43129e,_0x3941da){var _0x333b20=function(_0x3a8d38){while(--_0x3a8d38){_0x43129e['push'](_0x43129e['shift']());}};_0x333b20(++_0x3941da);}(_0x1261,0x144));var _0x1126=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x1261[_0x4812e0];return _0x252e0f;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'field':{'type':Sequelize[_0x1126('0x1')]},'alias':{'type':Sequelize[_0x1126('0x2')]},'function':{'type':Sequelize[_0x1126('0x2')]},'format':{'type':Sequelize[_0x1126('0x2')]},'groupBy':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1126('0x2')]},'custom':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x34ff03,_0x531677){var _0x3adfeb=function(_0x10f1c3){while(--_0x10f1c3){_0x34ff03['push'](_0x34ff03['shift']());}};_0x3adfeb(++_0x531677);}(_0x7a54,0x106));var _0x47a5=function(_0x18815e,_0x5dab40){_0x18815e=_0x18815e-0x0;var _0x50af19=_0x7a54[_0x18815e];return _0x50af19;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'field':{'type':Sequelize[_0x47a5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x47a5('0x3')]},'format':{'type':Sequelize[_0x47a5('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x47a5('0x3')]},'custom':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 097f535..be0d07d 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b1b=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','catch','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','sequelize','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','destroy','then'];(function(_0x3d0678,_0x10e9ae){var _0x7f9a43=function(_0x85d80f){while(--_0x85d80f){_0x3d0678['push'](_0x3d0678['shift']());}};_0x7f9a43(++_0x10e9ae);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x6b1b[_0x1b5aea];return _0x15cfc6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb6b1('0x0'));var rimraf=require(_0xb6b1('0x1'));var zipdir=require(_0xb6b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6b1('0x3'));var moment=require(_0xb6b1('0x4'));var BPromise=require(_0xb6b1('0x5'));var Mustache=require(_0xb6b1('0x6'));var util=require(_0xb6b1('0x7'));var path=require(_0xb6b1('0x8'));var sox=require(_0xb6b1('0x9'));var csv=require(_0xb6b1('0xa'));var ejs=require(_0xb6b1('0xb'));var fs=require('fs');var _=require(_0xb6b1('0xc'));var squel=require(_0xb6b1('0xd'));var crypto=require('crypto');var jsforce=require(_0xb6b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb6b1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb6b1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6b1('0x11'))(_0xb6b1('0x12'));var utils=require('../../config/utils');var config=require(_0xb6b1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c5837,_0x406dce){_0x406dce=_0x406dce||0xcc;return function(_0x2e5256){if(_0x2e5256){return _0x5c5837[_0xb6b1('0x14')](_0x406dce);}return _0x5c5837[_0xb6b1('0x15')](_0x406dce)[_0xb6b1('0x16')]();};}function respondWithResult(_0x18f6b5,_0x360fc7){_0x360fc7=_0x360fc7||0xc8;return function(_0x429d0d){if(_0x429d0d){return _0x18f6b5[_0xb6b1('0x15')](_0x360fc7)[_0xb6b1('0x17')](_0x429d0d);}};}function respondWithFilteredResult(_0x2629db,_0x14fef6){return function(_0x4f770a){if(_0x4f770a){var _0x57572a=_0x4f770a[_0xb6b1('0x18')],_0x513207=_0x14fef6[_0xb6b1('0x19')],_0x51f25f=_0x14fef6[_0xb6b1('0x19')]+_0x14fef6[_0xb6b1('0x1a')],_0xee229d;if(_0x51f25f>=_0x57572a){_0x51f25f=_0x57572a;_0xee229d=0xc8;}else{_0xee229d=0xce;}_0x2629db[_0xb6b1('0x15')](_0xee229d);return _0x2629db['set']('Content-Range',_0x513207+'-'+_0x51f25f+'/'+_0x57572a)[_0xb6b1('0x17')](_0x4f770a);}return null;};}function patchUpdates(_0x15456d){return function(_0x16d969){try{jsonpatch[_0xb6b1('0x1b')](_0x16d969,_0x15456d,!![]);}catch(_0x45d9e6){return BPromise[_0xb6b1('0x1c')](_0x45d9e6);}return _0x16d969['save']();};}function saveUpdates(_0x4e132a,_0x43312e){return function(_0x1067ea){if(_0x1067ea){return _0x1067ea['update'](_0x4e132a)['then'](function(_0xfc247a){return _0xfc247a;});}return null;};}function removeEntity(_0x5c8529,_0x509c55){return function(_0x232157){if(_0x232157){return _0x232157[_0xb6b1('0x1d')]()[_0xb6b1('0x1e')](function(){_0x5c8529[_0xb6b1('0x15')](0xcc)[_0xb6b1('0x16')]();});}};}function handleEntityNotFound(_0x3d0864,_0x1eb1b2){return function(_0x3b1ff7){if(!_0x3b1ff7){_0x3d0864[_0xb6b1('0x14')](0x194);}return _0x3b1ff7;};}function handleError(_0x20066f,_0x5069cd){_0x5069cd=_0x5069cd||0x1f4;return function(_0x214cd0){logger['error'](_0x214cd0[_0xb6b1('0x1f')]);if(_0x214cd0['name']){delete _0x214cd0[_0xb6b1('0x20')];}_0x20066f['status'](_0x5069cd)[_0xb6b1('0x21')](_0x214cd0);};}exports[_0xb6b1('0x22')]=function(_0xac4256,_0x178401){var _0x13e841={},_0x188627={},_0x3e0915={'count':0x0,'rows':[]};var _0xd3c6da=_[_0xb6b1('0x23')](db['AnalyticFieldReport'][_0xb6b1('0x24')],function(_0x548f3f){return{'name':_0x548f3f[_0xb6b1('0x25')],'type':_0x548f3f[_0xb6b1('0x26')][_0xb6b1('0x27')]};});_0x188627[_0xb6b1('0x28')]=_[_0xb6b1('0x23')](_0xd3c6da,_0xb6b1('0x20'));_0x188627[_0xb6b1('0x29')]=_['keys'](_0xac4256[_0xb6b1('0x29')]);_0x188627[_0xb6b1('0x2a')]=_[_0xb6b1('0x2b')](_0x188627['model'],_0x188627[_0xb6b1('0x29')]);_0x13e841[_0xb6b1('0x2c')]=_['intersection'](_0x188627[_0xb6b1('0x28')],qs[_0xb6b1('0x2d')](_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x2d')]));_0x13e841[_0xb6b1('0x2c')]=_0x13e841[_0xb6b1('0x2c')]['length']?_0x13e841[_0xb6b1('0x2c')]:_0x188627[_0xb6b1('0x28')];if(!_0xac4256['query'][_0xb6b1('0x2e')]('nolimit')){_0x13e841[_0xb6b1('0x1a')]=qs[_0xb6b1('0x1a')](_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x1a')]);_0x13e841[_0xb6b1('0x19')]=qs[_0xb6b1('0x19')](_0xac4256['query'][_0xb6b1('0x19')]);}_0x13e841[_0xb6b1('0x2f')]=qs[_0xb6b1('0x30')](_0xac4256[_0xb6b1('0x29')]['sort']);_0x13e841['where']=qs['filters'](_[_0xb6b1('0x31')](_0xac4256[_0xb6b1('0x29')],_0x188627[_0xb6b1('0x2a')]));if(_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x32')]){_0x13e841[_0xb6b1('0x33')]=_[_0xb6b1('0x34')](_0x13e841[_0xb6b1('0x33')],{'$or':_[_0xb6b1('0x23')](_0xd3c6da,function(_0x25d6a2){if(_0x25d6a2[_0xb6b1('0x26')]!==_0xb6b1('0x35')){var _0x5b8a57={};_0x5b8a57[_0x25d6a2[_0xb6b1('0x20')]]={'$like':'%'+_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x32')]+'%'};return _0x5b8a57;}})});}_0x13e841=_[_0xb6b1('0x34')]({},_0x13e841,_0xac4256[_0xb6b1('0x36')]);var _0x1dc258={'where':_0x13e841[_0xb6b1('0x33')]};return db[_0xb6b1('0x37')][_0xb6b1('0x18')](_0x1dc258)[_0xb6b1('0x1e')](function(_0x44a61a){_0x3e0915['count']=_0x44a61a;if(_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x38')]){_0x13e841[_0xb6b1('0x39')]=[{'all':!![]}];}return db[_0xb6b1('0x37')][_0xb6b1('0x3a')](_0x13e841);})[_0xb6b1('0x1e')](function(_0x27808b){_0x3e0915[_0xb6b1('0x3b')]=_0x27808b;return _0x3e0915;})['then'](respondWithFilteredResult(_0x178401,_0x13e841))['catch'](handleError(_0x178401,null));};exports[_0xb6b1('0x3c')]=function(_0x19853f,_0x1f43fe){var _0x541eb5={'raw':![],'where':{'id':_0x19853f[_0xb6b1('0x3d')]['id']}},_0x8d1ba8={};_0x8d1ba8[_0xb6b1('0x28')]=_[_0xb6b1('0x3e')](db[_0xb6b1('0x37')][_0xb6b1('0x24')]);_0x8d1ba8[_0xb6b1('0x29')]=_[_0xb6b1('0x3e')](_0x19853f['query']);_0x8d1ba8[_0xb6b1('0x2a')]=_['intersection'](_0x8d1ba8[_0xb6b1('0x28')],_0x8d1ba8[_0xb6b1('0x29')]);_0x541eb5[_0xb6b1('0x2c')]=_[_0xb6b1('0x2b')](_0x8d1ba8[_0xb6b1('0x28')],qs[_0xb6b1('0x2d')](_0x19853f['query'][_0xb6b1('0x2d')]));_0x541eb5[_0xb6b1('0x2c')]=_0x541eb5['attributes'][_0xb6b1('0x3f')]?_0x541eb5['attributes']:_0x8d1ba8[_0xb6b1('0x28')];if(_0x19853f[_0xb6b1('0x29')][_0xb6b1('0x38')]){_0x541eb5[_0xb6b1('0x39')]=[{'all':!![]}];}_0x541eb5=_[_0xb6b1('0x34')]({},_0x541eb5,_0x19853f[_0xb6b1('0x36')]);return db[_0xb6b1('0x37')][_0xb6b1('0x40')](_0x541eb5)[_0xb6b1('0x1e')](handleEntityNotFound(_0x1f43fe,null))['then'](respondWithResult(_0x1f43fe,null))['catch'](handleError(_0x1f43fe,null));};exports[_0xb6b1('0x41')]=function(_0x2c00fb,_0x5959ca){return db[_0xb6b1('0x37')][_0xb6b1('0x41')](_0x2c00fb[_0xb6b1('0x42')],{})[_0xb6b1('0x1e')](respondWithResult(_0x5959ca,0xc9))[_0xb6b1('0x43')](handleError(_0x5959ca,null));};exports['bulkCreate']=function(_0x28f353,_0x1f4881){return db[_0xb6b1('0x37')][_0xb6b1('0x44')](_0x28f353['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1f4881,0xc9))[_0xb6b1('0x43')](handleError(_0x1f4881,null));};exports['update']=function(_0x2be9e7,_0x3f09dc){if(_0x2be9e7['body']['id']){delete _0x2be9e7[_0xb6b1('0x42')]['id'];}return db['AnalyticFieldReport'][_0xb6b1('0x40')]({'where':{'id':_0x2be9e7[_0xb6b1('0x3d')]['id']}})[_0xb6b1('0x1e')](handleEntityNotFound(_0x3f09dc,null))[_0xb6b1('0x1e')](saveUpdates(_0x2be9e7[_0xb6b1('0x42')],null))[_0xb6b1('0x1e')](respondWithResult(_0x3f09dc,null))[_0xb6b1('0x43')](handleError(_0x3f09dc,null));};exports[_0xb6b1('0x1d')]=function(_0x37bbbe,_0x2700ed){return db['AnalyticFieldReport'][_0xb6b1('0x40')]({'where':{'id':_0x37bbbe[_0xb6b1('0x3d')]['id']}})[_0xb6b1('0x1e')](handleEntityNotFound(_0x2700ed,null))[_0xb6b1('0x1e')](removeEntity(_0x2700ed,null))[_0xb6b1('0x43')](handleError(_0x2700ed,null));};exports[_0xb6b1('0x45')]=function(_0x3eca0,_0x1a6b14){return db[_0xb6b1('0x37')]['destroy']({'where':{'id':_0x3eca0[_0xb6b1('0x29')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1a6b14,0xcc))[_0xb6b1('0x43')](handleError(_0x1a6b14,null));};exports[_0xb6b1('0x46')]=function(_0x5be7bf,_0x3b482b,_0x323231){return db[_0xb6b1('0x47')]['findOne']({'where':{'id':_0x5be7bf[_0xb6b1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3b482b,null))['then'](function(_0x239de5){if(_0x239de5){return db[_0xb6b1('0x48')]['transaction'](function(_0x4a86b4){return db['AnalyticFieldReport'][_0xb6b1('0x1d')]({'where':{'CustomReportId':_0x5be7bf['params']['id']},'transaction':_0x4a86b4})['then'](function(_0x47e64e){var _0x37591c=_[_0xb6b1('0x23')](_0x5be7bf[_0xb6b1('0x42')],function(_0x18bfa9){delete _0x18bfa9['id'];_0x18bfa9[_0xb6b1('0x49')]=_0x5be7bf[_0xb6b1('0x3d')]['id'];return _0x18bfa9;});return db['AnalyticFieldReport'][_0xb6b1('0x44')](_0x37591c,{'transaction':_0x4a86b4});});})[_0xb6b1('0x1e')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x5be7bf[_0xb6b1('0x3d')]['id']}});});}})[_0xb6b1('0x1e')](respondWithResult(_0x3b482b,null))['catch'](handleError(_0x3b482b,null));}; \ No newline at end of file +var _0x7278=['keys','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','destroy','end','error','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x388482,_0x2e1179){var _0x379a82=function(_0x275433){while(--_0x275433){_0x388482['push'](_0x388482['shift']());}};_0x379a82(++_0x2e1179);}(_0x7278,0x161));var _0x8727=function(_0x505a49,_0x56f4d1){_0x505a49=_0x505a49-0x0;var _0x14ae63=_0x7278[_0x505a49];return _0x14ae63;};'use strict';var pdf=require(_0x8727('0x0'));var emlformat=require(_0x8727('0x1'));var rimraf=require(_0x8727('0x2'));var zipdir=require(_0x8727('0x3'));var jsonpatch=require(_0x8727('0x4'));var rp=require('request-promise');var moment=require(_0x8727('0x5'));var BPromise=require(_0x8727('0x6'));var Mustache=require(_0x8727('0x7'));var util=require(_0x8727('0x8'));var path=require(_0x8727('0x9'));var sox=require(_0x8727('0xa'));var csv=require(_0x8727('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8727('0xc'));var squel=require(_0x8727('0xd'));var crypto=require(_0x8727('0xe'));var jsforce=require(_0x8727('0xf'));var deskjs=require(_0x8727('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8727('0x11'));var authService=require(_0x8727('0x12'));var qs=require(_0x8727('0x13'));var as=require(_0x8727('0x14'));var hardwareService=require(_0x8727('0x15'));var logger=require(_0x8727('0x16'))(_0x8727('0x17'));var utils=require(_0x8727('0x18'));var config=require('../../config/environment');var db=require(_0x8727('0x19'))['db'];function respondWithStatusCode(_0x2d9d47,_0x176389){_0x176389=_0x176389||0xcc;return function(_0x518e56){if(_0x518e56){return _0x2d9d47[_0x8727('0x1a')](_0x176389);}return _0x2d9d47[_0x8727('0x1b')](_0x176389)['end']();};}function respondWithResult(_0xbcde13,_0x3aa1b){_0x3aa1b=_0x3aa1b||0xc8;return function(_0x47c29d){if(_0x47c29d){return _0xbcde13[_0x8727('0x1b')](_0x3aa1b)[_0x8727('0x1c')](_0x47c29d);}};}function respondWithFilteredResult(_0x3d84db,_0x3865e9){return function(_0x1916f7){if(_0x1916f7){var _0x11c828=_0x1916f7[_0x8727('0x1d')],_0x88857c=_0x3865e9[_0x8727('0x1e')],_0x4842a0=_0x3865e9[_0x8727('0x1e')]+_0x3865e9[_0x8727('0x1f')],_0x17baba;if(_0x4842a0>=_0x11c828){_0x4842a0=_0x11c828;_0x17baba=0xc8;}else{_0x17baba=0xce;}_0x3d84db[_0x8727('0x1b')](_0x17baba);return _0x3d84db['set']('Content-Range',_0x88857c+'-'+_0x4842a0+'/'+_0x11c828)[_0x8727('0x1c')](_0x1916f7);}return null;};}function patchUpdates(_0x4a0a7d){return function(_0x28b10f){try{jsonpatch[_0x8727('0x20')](_0x28b10f,_0x4a0a7d,!![]);}catch(_0x32cabe){return BPromise[_0x8727('0x21')](_0x32cabe);}return _0x28b10f[_0x8727('0x22')]();};}function saveUpdates(_0x537aaf,_0x6e552f){return function(_0x286856){if(_0x286856){return _0x286856[_0x8727('0x23')](_0x537aaf)[_0x8727('0x24')](function(_0x2fe8ba){return _0x2fe8ba;});}return null;};}function removeEntity(_0x3140e8,_0x46d43e){return function(_0x441cc0){if(_0x441cc0){return _0x441cc0[_0x8727('0x25')]()[_0x8727('0x24')](function(){_0x3140e8[_0x8727('0x1b')](0xcc)[_0x8727('0x26')]();});}};}function handleEntityNotFound(_0x4c699b,_0x464a32){return function(_0x3d3592){if(!_0x3d3592){_0x4c699b['sendStatus'](0x194);}return _0x3d3592;};}function handleError(_0x5adefe,_0x3df7f2){_0x3df7f2=_0x3df7f2||0x1f4;return function(_0x318684){logger[_0x8727('0x27')](_0x318684['stack']);if(_0x318684[_0x8727('0x28')]){delete _0x318684[_0x8727('0x28')];}_0x5adefe[_0x8727('0x1b')](_0x3df7f2)[_0x8727('0x29')](_0x318684);};}exports[_0x8727('0x2a')]=function(_0xf33348,_0x262f36){var _0xd92f77={},_0x5d03f2={},_0x243f15={'count':0x0,'rows':[]};var _0x307055=_['map'](db[_0x8727('0x2b')][_0x8727('0x2c')],function(_0x3ecd6a){return{'name':_0x3ecd6a[_0x8727('0x2d')],'type':_0x3ecd6a[_0x8727('0x2e')][_0x8727('0x2f')]};});_0x5d03f2['model']=_[_0x8727('0x30')](_0x307055,'name');_0x5d03f2[_0x8727('0x31')]=_['keys'](_0xf33348[_0x8727('0x31')]);_0x5d03f2[_0x8727('0x32')]=_[_0x8727('0x33')](_0x5d03f2[_0x8727('0x34')],_0x5d03f2[_0x8727('0x31')]);_0xd92f77[_0x8727('0x35')]=_[_0x8727('0x33')](_0x5d03f2['model'],qs[_0x8727('0x36')](_0xf33348[_0x8727('0x31')][_0x8727('0x36')]));_0xd92f77[_0x8727('0x35')]=_0xd92f77[_0x8727('0x35')][_0x8727('0x37')]?_0xd92f77[_0x8727('0x35')]:_0x5d03f2[_0x8727('0x34')];if(!_0xf33348[_0x8727('0x31')][_0x8727('0x38')](_0x8727('0x39'))){_0xd92f77[_0x8727('0x1f')]=qs['limit'](_0xf33348['query'][_0x8727('0x1f')]);_0xd92f77[_0x8727('0x1e')]=qs[_0x8727('0x1e')](_0xf33348[_0x8727('0x31')]['offset']);}_0xd92f77[_0x8727('0x3a')]=qs[_0x8727('0x3b')](_0xf33348[_0x8727('0x31')][_0x8727('0x3b')]);_0xd92f77[_0x8727('0x3c')]=qs['filters'](_[_0x8727('0x3d')](_0xf33348[_0x8727('0x31')],_0x5d03f2[_0x8727('0x32')]));if(_0xf33348[_0x8727('0x31')][_0x8727('0x3e')]){_0xd92f77[_0x8727('0x3c')]=_[_0x8727('0x3f')](_0xd92f77[_0x8727('0x3c')],{'$or':_[_0x8727('0x30')](_0x307055,function(_0x1a607a){if(_0x1a607a[_0x8727('0x2e')]!==_0x8727('0x40')){var _0x5e1ea1={};_0x5e1ea1[_0x1a607a[_0x8727('0x28')]]={'$like':'%'+_0xf33348[_0x8727('0x31')][_0x8727('0x3e')]+'%'};return _0x5e1ea1;}})});}_0xd92f77=_[_0x8727('0x3f')]({},_0xd92f77,_0xf33348[_0x8727('0x41')]);var _0x2c60b0={'where':_0xd92f77[_0x8727('0x3c')]};return db[_0x8727('0x2b')][_0x8727('0x1d')](_0x2c60b0)[_0x8727('0x24')](function(_0xc05477){_0x243f15[_0x8727('0x1d')]=_0xc05477;if(_0xf33348[_0x8727('0x31')][_0x8727('0x42')]){_0xd92f77['include']=[{'all':!![]}];}return db[_0x8727('0x2b')][_0x8727('0x43')](_0xd92f77);})[_0x8727('0x24')](function(_0x4ac9d2){_0x243f15[_0x8727('0x44')]=_0x4ac9d2;return _0x243f15;})[_0x8727('0x24')](respondWithFilteredResult(_0x262f36,_0xd92f77))[_0x8727('0x45')](handleError(_0x262f36,null));};exports[_0x8727('0x46')]=function(_0x57817f,_0x3a2683){var _0x37e87c={'raw':![],'where':{'id':_0x57817f[_0x8727('0x47')]['id']}},_0x1b90e3={};_0x1b90e3[_0x8727('0x34')]=_[_0x8727('0x48')](db[_0x8727('0x2b')][_0x8727('0x2c')]);_0x1b90e3[_0x8727('0x31')]=_[_0x8727('0x48')](_0x57817f['query']);_0x1b90e3[_0x8727('0x32')]=_[_0x8727('0x33')](_0x1b90e3[_0x8727('0x34')],_0x1b90e3[_0x8727('0x31')]);_0x37e87c[_0x8727('0x35')]=_['intersection'](_0x1b90e3[_0x8727('0x34')],qs[_0x8727('0x36')](_0x57817f[_0x8727('0x31')]['fields']));_0x37e87c[_0x8727('0x35')]=_0x37e87c[_0x8727('0x35')][_0x8727('0x37')]?_0x37e87c[_0x8727('0x35')]:_0x1b90e3[_0x8727('0x34')];if(_0x57817f[_0x8727('0x31')]['includeAll']){_0x37e87c[_0x8727('0x49')]=[{'all':!![]}];}_0x37e87c=_[_0x8727('0x3f')]({},_0x37e87c,_0x57817f[_0x8727('0x41')]);return db['AnalyticFieldReport'][_0x8727('0x4a')](_0x37e87c)[_0x8727('0x24')](handleEntityNotFound(_0x3a2683,null))[_0x8727('0x24')](respondWithResult(_0x3a2683,null))[_0x8727('0x45')](handleError(_0x3a2683,null));};exports[_0x8727('0x4b')]=function(_0x11cb79,_0x39e342){return db['AnalyticFieldReport'][_0x8727('0x4b')](_0x11cb79[_0x8727('0x4c')],{})[_0x8727('0x24')](respondWithResult(_0x39e342,0xc9))[_0x8727('0x45')](handleError(_0x39e342,null));};exports[_0x8727('0x4d')]=function(_0x426727,_0x34fe5b){return db['AnalyticFieldReport'][_0x8727('0x4d')](_0x426727[_0x8727('0x4c')],{'raw':![],'individualHooks':!![]})[_0x8727('0x24')](respondWithResult(_0x34fe5b,0xc9))['catch'](handleError(_0x34fe5b,null));};exports[_0x8727('0x23')]=function(_0x22cd31,_0x24fd60){if(_0x22cd31[_0x8727('0x4c')]['id']){delete _0x22cd31[_0x8727('0x4c')]['id'];}return db[_0x8727('0x2b')][_0x8727('0x4a')]({'where':{'id':_0x22cd31['params']['id']}})[_0x8727('0x24')](handleEntityNotFound(_0x24fd60,null))['then'](saveUpdates(_0x22cd31[_0x8727('0x4c')],null))[_0x8727('0x24')](respondWithResult(_0x24fd60,null))['catch'](handleError(_0x24fd60,null));};exports[_0x8727('0x25')]=function(_0x3bb732,_0xd86c46){return db['AnalyticFieldReport']['find']({'where':{'id':_0x3bb732[_0x8727('0x47')]['id']}})[_0x8727('0x24')](handleEntityNotFound(_0xd86c46,null))[_0x8727('0x24')](removeEntity(_0xd86c46,null))['catch'](handleError(_0xd86c46,null));};exports[_0x8727('0x4e')]=function(_0x3945c4,_0x1a4432){return db[_0x8727('0x2b')][_0x8727('0x25')]({'where':{'id':_0x3945c4[_0x8727('0x31')][_0x8727('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x8727('0x24')](respondWithResult(_0x1a4432,0xcc))['catch'](handleError(_0x1a4432,null));};exports[_0x8727('0x50')]=function(_0x40d748,_0x8a8cce,_0x3f99f5){return db['AnalyticCustomReport'][_0x8727('0x51')]({'where':{'id':_0x40d748[_0x8727('0x47')]['id']}})[_0x8727('0x24')](handleEntityNotFound(_0x8a8cce,null))[_0x8727('0x24')](function(_0x37ab97){if(_0x37ab97){return db[_0x8727('0x52')][_0x8727('0x53')](function(_0x38739f){return db['AnalyticFieldReport'][_0x8727('0x25')]({'where':{'CustomReportId':_0x40d748[_0x8727('0x47')]['id']},'transaction':_0x38739f})[_0x8727('0x24')](function(_0x47a9f0){var _0x2b440d=_['map'](_0x40d748[_0x8727('0x4c')],function(_0x589081){delete _0x589081['id'];_0x589081[_0x8727('0x54')]=_0x40d748[_0x8727('0x47')]['id'];return _0x589081;});return db['AnalyticFieldReport'][_0x8727('0x4d')](_0x2b440d,{'transaction':_0x38739f});});})[_0x8727('0x24')](function(){return db[_0x8727('0x2b')]['findAll']({'where':{'CustomReportId':_0x40d748['params']['id']}});});}})['then'](respondWithResult(_0x8a8cce,null))['catch'](handleError(_0x8a8cce,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index a8ffe21..56874ac 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.model.js +++ b/server/api/analyticFieldReport/analyticFieldReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ae0=['../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7ae0,0x165));var _0x07ae=function(_0x105081,_0x348ad5){_0x105081=_0x105081-0x0;var _0xc37399=_0x7ae0[_0x105081];return _0xc37399;};'use strict';var _=require(_0x07ae('0x0'));var util=require(_0x07ae('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x07ae('0x2'));var rp=require(_0x07ae('0x3'));var fs=require('fs');var path=require(_0x07ae('0x4'));var rimraf=require(_0x07ae('0x5'));var config=require(_0x07ae('0x6'));var attributes=require(_0x07ae('0x7'));module['exports']=function(_0x48437b,_0x4aca3a){return _0x48437b[_0x07ae('0x8')](_0x07ae('0x9'),attributes,{'tableName':_0x07ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cd3=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b9598,_0x4e190c){var _0xbaa7dd=function(_0xadcb7b){while(--_0xadcb7b){_0x5b9598['push'](_0x5b9598['shift']());}};_0xbaa7dd(++_0x4e190c);}(_0x5cd3,0x69));var _0x35cd=function(_0x160b08,_0x1e4b9d){_0x160b08=_0x160b08-0x0;var _0x5a96ec=_0x5cd3[_0x160b08];return _0x5a96ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x35cd('0x0'))(_0x35cd('0x1'));var moment=require(_0x35cd('0x2'));var BPromise=require(_0x35cd('0x3'));var rp=require(_0x35cd('0x4'));var fs=require('fs');var path=require(_0x35cd('0x5'));var rimraf=require(_0x35cd('0x6'));var config=require(_0x35cd('0x7'));var attributes=require(_0x35cd('0x8'));module['exports']=function(_0x46c371,_0x49a4ef){return _0x46c371[_0x35cd('0x9')](_0x35cd('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 5a0b7ed..e2db35d 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js +++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc278=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x24f69b,_0x432b8f){var _0x272ad6=function(_0x1b529a){while(--_0x1b529a){_0x24f69b['push'](_0x24f69b['shift']());}};_0x272ad6(++_0x432b8f);}(_0xc278,0x1df));var _0x8c27=function(_0x5b9f76,_0x31e75e){_0x5b9f76=_0x5b9f76-0x0;var _0x46077a=_0xc278[_0x5b9f76];return _0x46077a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c27('0x0'));var BPromise=require(_0x8c27('0x1'));var rs=require(_0x8c27('0x2'));var fs=require('fs');var Redis=require(_0x8c27('0x3'));var db=require(_0x8c27('0x4'))['db'];var utils=require(_0x8c27('0x5'));var logger=require(_0x8c27('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8c27('0x7'));var client=jayson[_0x8c27('0x8')][_0x8c27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47bdce,_0x5b3a4d,_0x1e19b7){return new BPromise(function(_0x267f53,_0x3555d2){return client[_0x8c27('0xa')](_0x47bdce,_0x1e19b7)[_0x8c27('0xb')](function(_0x10e33d){logger['info'](_0x8c27('0xc'),_0x5b3a4d,_0x8c27('0xd'));logger[_0x8c27('0xe')](_0x8c27('0xf'),_0x5b3a4d,'request\x20sent',JSON[_0x8c27('0x10')](_0x10e33d));if(_0x10e33d[_0x8c27('0x11')]){if(_0x10e33d[_0x8c27('0x11')][_0x8c27('0x12')]===0x1f4){logger[_0x8c27('0x11')](_0x8c27('0xc'),_0x5b3a4d,_0x10e33d[_0x8c27('0x11')][_0x8c27('0x13')]);return _0x3555d2(_0x10e33d['error']['message']);}logger[_0x8c27('0x11')](_0x8c27('0xc'),_0x5b3a4d,_0x10e33d[_0x8c27('0x11')][_0x8c27('0x13')]);return _0x267f53(_0x10e33d[_0x8c27('0x11')][_0x8c27('0x13')]);}else{logger[_0x8c27('0x14')](_0x8c27('0xc'),_0x5b3a4d,'request\x20sent');_0x267f53(_0x10e33d['result'][_0x8c27('0x13')]);}})[_0x8c27('0x15')](function(_0x17b9b0){logger[_0x8c27('0x11')](_0x8c27('0xc'),_0x5b3a4d,_0x17b9b0);_0x3555d2(_0x17b9b0);});});} \ No newline at end of file +var _0xf729=['info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xf729,0xec));var _0x9f72=function(_0xe61612,_0x5003e7){_0xe61612=_0xe61612-0x0;var _0x4e1bf7=_0xf729[_0xe61612];return _0x4e1bf7;};'use strict';var _=require('lodash');var util=require(_0x9f72('0x0'));var moment=require(_0x9f72('0x1'));var BPromise=require(_0x9f72('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f72('0x4'));var logger=require('../../config/logger')(_0x9f72('0x5'));var config=require(_0x9f72('0x6'));var jayson=require(_0x9f72('0x7'));var client=jayson[_0x9f72('0x8')][_0x9f72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47463f,_0xce6d73,_0x4fd283){return new BPromise(function(_0x5ada20,_0x2167bf){return client[_0x9f72('0xa')](_0x47463f,_0x4fd283)['then'](function(_0xd7b227){logger[_0x9f72('0xb')](_0x9f72('0xc'),_0xce6d73,'request\x20sent');logger[_0x9f72('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xce6d73,_0x9f72('0xe'),JSON[_0x9f72('0xf')](_0xd7b227));if(_0xd7b227[_0x9f72('0x10')]){if(_0xd7b227['error']['code']===0x1f4){logger[_0x9f72('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0xce6d73,_0xd7b227[_0x9f72('0x10')]['message']);return _0x2167bf(_0xd7b227[_0x9f72('0x10')][_0x9f72('0x11')]);}logger[_0x9f72('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0xce6d73,_0xd7b227['error'][_0x9f72('0x11')]);return _0x5ada20(_0xd7b227[_0x9f72('0x10')][_0x9f72('0x11')]);}else{logger[_0x9f72('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0xce6d73,_0x9f72('0xe'));_0x5ada20(_0xd7b227[_0x9f72('0x12')]['message']);}})['catch'](function(_0x3ff8ed){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0xce6d73,_0x3ff8ed);_0x2167bf(_0x3ff8ed);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 8944e11..0ae484b 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['/:id/create_many','addFields','put','update','delete','bulkDestroy','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','bulkCreate'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x55ca,0x126));var _0xa55c=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x55ca[_0x446208];return _0xe49563;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0xb')]('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xb')]('/create_many',auth['isAuthenticated'](),controller[_0xa55c('0xd')]);router[_0xa55c('0xb')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x10')](_0xa55c('0x9'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/destroy_many',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('0x15')]=router; \ No newline at end of file +var _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x2e9b6d,_0x372b3b){var _0x45129d=function(_0x18a09f){while(--_0x18a09f){_0x2e9b6d['push'](_0x2e9b6d['shift']());}};_0x45129d(++_0x372b3b);}(_0x814b,0x1a2));var _0xb814=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x814b[_0x5ca353];return _0x4f2fe5;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index bd1cd51..a10b69a 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d6e=['exports','STRING','sequelize'];(function(_0x9e518,_0x32fc25){var _0x45f70f=function(_0x29c0d9){while(--_0x29c0d9){_0x9e518['push'](_0x9e518['shift']());}};_0x45f70f(++_0x32fc25);}(_0x4d6e,0x119));var _0xe4d6=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x4d6e[_0x5d7227];return _0x15ac55;};'use strict';var Sequelize=require(_0xe4d6('0x0'));module[_0xe4d6('0x1')]={'name':{'type':Sequelize[_0xe4d6('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xe4d6('0x2')]}}; \ No newline at end of file +var _0xc38e=['STRING','TEXT','sequelize','exports'];(function(_0x377fd7,_0xea5aa5){var _0x4ef852=function(_0x12c6a3){while(--_0x12c6a3){_0x377fd7['push'](_0x377fd7['shift']());}};_0x4ef852(++_0xea5aa5);}(_0xc38e,0x19e));var _0xec38=function(_0x4fab84,_0x2363f4){_0x4fab84=_0x4fab84-0x0;var _0x4c9abb=_0xc38e[_0x4fab84];return _0x4c9abb;};'use strict';var Sequelize=require(_0xec38('0x0'));module[_0xec38('0x1')]={'name':{'type':Sequelize[_0xec38('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xec38('0x2')]},'metric':{'type':Sequelize[_0xec38('0x3')]},'description':{'type':Sequelize[_0xec38('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 99747b3..48ff083 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16d5=['json','count','offset','set','Content-Range','apply','reject','destroy','then','get','UserProfileResource','end','error','stack','name','status','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus'];(function(_0x30fab3,_0xf1a96c){var _0x47254a=function(_0x342503){while(--_0x342503){_0x30fab3['push'](_0x30fab3['shift']());}};_0x47254a(++_0xf1a96c);}(_0x16d5,0xe9));var _0x516d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16d5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x516d('0x0'));var emlformat=require(_0x516d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x516d('0x2'));var jsonpatch=require(_0x516d('0x3'));var rp=require(_0x516d('0x4'));var moment=require(_0x516d('0x5'));var BPromise=require(_0x516d('0x6'));var Mustache=require(_0x516d('0x7'));var util=require(_0x516d('0x8'));var path=require(_0x516d('0x9'));var sox=require('sox');var csv=require(_0x516d('0xa'));var ejs=require(_0x516d('0xb'));var fs=require('fs');var _=require(_0x516d('0xc'));var squel=require('squel');var crypto=require(_0x516d('0xd'));var jsforce=require(_0x516d('0xe'));var deskjs=require(_0x516d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x516d('0x10'));var Papa=require(_0x516d('0x11'));var Redis=require(_0x516d('0x12'));var authService=require(_0x516d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x516d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x516d('0x15'))('api');var utils=require(_0x516d('0x16'));var config=require('../../config/environment');var db=require(_0x516d('0x17'))['db'];function respondWithStatusCode(_0x3ea3a5,_0x4179a0){_0x4179a0=_0x4179a0||0xcc;return function(_0x32b0e9){if(_0x32b0e9){return _0x3ea3a5[_0x516d('0x18')](_0x4179a0);}return _0x3ea3a5['status'](_0x4179a0)['end']();};}function respondWithResult(_0xba2ce4,_0x359334){_0x359334=_0x359334||0xc8;return function(_0x279197){if(_0x279197){return _0xba2ce4['status'](_0x359334)[_0x516d('0x19')](_0x279197);}};}function respondWithFilteredResult(_0x245aab,_0x4d8899){return function(_0xc49d33){if(_0xc49d33){var _0x4cbab5=_0xc49d33[_0x516d('0x1a')],_0x49fc45=_0x4d8899['offset'],_0x23655d=_0x4d8899[_0x516d('0x1b')]+_0x4d8899['limit'],_0x3c8190;if(_0x23655d>=_0x4cbab5){_0x23655d=_0x4cbab5;_0x3c8190=0xc8;}else{_0x3c8190=0xce;}_0x245aab['status'](_0x3c8190);return _0x245aab[_0x516d('0x1c')](_0x516d('0x1d'),_0x49fc45+'-'+_0x23655d+'/'+_0x4cbab5)[_0x516d('0x19')](_0xc49d33);}return null;};}function patchUpdates(_0x38523d){return function(_0x37333d){try{jsonpatch[_0x516d('0x1e')](_0x37333d,_0x38523d,!![]);}catch(_0x129605){return BPromise[_0x516d('0x1f')](_0x129605);}return _0x37333d['save']();};}function saveUpdates(_0xac0c63,_0x580c69){return function(_0x574d94){if(_0x574d94){return _0x574d94['update'](_0xac0c63)['then'](function(_0x92bd21){return _0x92bd21;});}return null;};}function removeEntity(_0x3b52eb,_0x3e104d){return function(_0x3bd235){if(_0x3bd235){return _0x3bd235[_0x516d('0x20')]()[_0x516d('0x21')](function(){var _0x327b53=_0x3bd235[_0x516d('0x22')]({'plain':!![]});var _0x1739ae='Metrics';return db[_0x516d('0x23')][_0x516d('0x20')]({'where':{'type':_0x1739ae,'resourceId':_0x327b53['id']}})[_0x516d('0x21')](function(){return _0x3bd235;});})[_0x516d('0x21')](function(){_0x3b52eb['status'](0xcc)[_0x516d('0x24')]();});}};}function handleEntityNotFound(_0x54247e,_0x402860){return function(_0x10af88){if(!_0x10af88){_0x54247e[_0x516d('0x18')](0x194);}return _0x10af88;};}function handleError(_0x39568c,_0x343f5f){_0x343f5f=_0x343f5f||0x1f4;return function(_0x1d07a0){logger[_0x516d('0x25')](_0x1d07a0[_0x516d('0x26')]);if(_0x1d07a0['name']){delete _0x1d07a0[_0x516d('0x27')];}_0x39568c[_0x516d('0x28')](_0x343f5f)[_0x516d('0x29')](_0x1d07a0);};}exports[_0x516d('0x2a')]=function(_0x435c65,_0x70bc14){var _0x5be873={},_0x2e9a00={},_0x60e1ba={'count':0x0,'rows':[]};var _0x5e3673=_[_0x516d('0x2b')](db[_0x516d('0x2c')][_0x516d('0x2d')],function(_0x4551c5){return{'name':_0x4551c5[_0x516d('0x2e')],'type':_0x4551c5[_0x516d('0x2f')][_0x516d('0x30')]};});_0x2e9a00[_0x516d('0x31')]=_['map'](_0x5e3673,_0x516d('0x27'));_0x2e9a00[_0x516d('0x32')]=_['keys'](_0x435c65[_0x516d('0x32')]);_0x2e9a00[_0x516d('0x33')]=_[_0x516d('0x34')](_0x2e9a00[_0x516d('0x31')],_0x2e9a00[_0x516d('0x32')]);_0x5be873['attributes']=_['intersection'](_0x2e9a00[_0x516d('0x31')],qs[_0x516d('0x35')](_0x435c65[_0x516d('0x32')]['fields']));_0x5be873[_0x516d('0x36')]=_0x5be873[_0x516d('0x36')][_0x516d('0x37')]?_0x5be873[_0x516d('0x36')]:_0x2e9a00[_0x516d('0x31')];if(!_0x435c65[_0x516d('0x32')][_0x516d('0x38')](_0x516d('0x39'))){_0x5be873[_0x516d('0x3a')]=qs[_0x516d('0x3a')](_0x435c65['query'][_0x516d('0x3a')]);_0x5be873[_0x516d('0x1b')]=qs[_0x516d('0x1b')](_0x435c65['query']['offset']);}_0x5be873[_0x516d('0x3b')]=qs[_0x516d('0x3c')](_0x435c65[_0x516d('0x32')][_0x516d('0x3c')]);_0x5be873[_0x516d('0x3d')]=qs['filters'](_[_0x516d('0x3e')](_0x435c65['query'],_0x2e9a00[_0x516d('0x33')]));if(_0x435c65[_0x516d('0x32')][_0x516d('0x3f')]){_0x5be873[_0x516d('0x3d')]=_[_0x516d('0x40')](_0x5be873[_0x516d('0x3d')],{'$or':_['map'](_0x5e3673,function(_0x280a22){if(_0x280a22[_0x516d('0x2f')]!==_0x516d('0x41')){var _0x358ffa={};_0x358ffa[_0x280a22[_0x516d('0x27')]]={'$like':'%'+_0x435c65[_0x516d('0x32')][_0x516d('0x3f')]+'%'};return _0x358ffa;}})});}_0x5be873=_['merge']({},_0x5be873,_0x435c65['options']);var _0x4db95f={'where':_0x5be873[_0x516d('0x3d')]};return db[_0x516d('0x2c')][_0x516d('0x1a')](_0x4db95f)[_0x516d('0x21')](function(_0x42dda7){_0x60e1ba[_0x516d('0x1a')]=_0x42dda7;if(_0x435c65[_0x516d('0x32')]['includeAll']){_0x5be873[_0x516d('0x42')]=[{'all':!![]}];}return db[_0x516d('0x2c')][_0x516d('0x43')](_0x5be873);})[_0x516d('0x21')](function(_0x399a49){_0x60e1ba[_0x516d('0x44')]=_0x399a49;return _0x60e1ba;})[_0x516d('0x21')](respondWithFilteredResult(_0x70bc14,_0x5be873))['catch'](handleError(_0x70bc14,null));};exports[_0x516d('0x45')]=function(_0x5ce317,_0x6ef758){var _0x41cb14={'raw':!![],'where':{'id':_0x5ce317[_0x516d('0x46')]['id']}},_0x4142c5={};_0x4142c5['model']=_[_0x516d('0x47')](db['AnalyticMetric'][_0x516d('0x2d')]);_0x4142c5[_0x516d('0x32')]=_[_0x516d('0x47')](_0x5ce317['query']);_0x4142c5['filters']=_[_0x516d('0x34')](_0x4142c5[_0x516d('0x31')],_0x4142c5[_0x516d('0x32')]);_0x41cb14[_0x516d('0x36')]=_['intersection'](_0x4142c5[_0x516d('0x31')],qs[_0x516d('0x35')](_0x5ce317[_0x516d('0x32')]['fields']));_0x41cb14[_0x516d('0x36')]=_0x41cb14['attributes'][_0x516d('0x37')]?_0x41cb14[_0x516d('0x36')]:_0x4142c5[_0x516d('0x31')];if(_0x5ce317[_0x516d('0x32')]['includeAll']){_0x41cb14['include']=[{'all':!![]}];}_0x41cb14=_['merge']({},_0x41cb14,_0x5ce317[_0x516d('0x48')]);return db[_0x516d('0x2c')][_0x516d('0x49')](_0x41cb14)['then'](handleEntityNotFound(_0x6ef758,null))['then'](respondWithResult(_0x6ef758,null))[_0x516d('0x4a')](handleError(_0x6ef758,null));};exports[_0x516d('0x4b')]=function(_0x257735,_0x2d3faf){return db['AnalyticMetric'][_0x516d('0x4b')](_0x257735[_0x516d('0x4c')],{})[_0x516d('0x21')](function(_0x315adc){var _0x1ffb9b=_0x257735[_0x516d('0x4d')]['get']({'plain':!![]});if(!_0x1ffb9b)throw new Error(_0x516d('0x4e'));if(_0x1ffb9b[_0x516d('0x4f')]===_0x516d('0x4d')){var _0x383353=_0x315adc[_0x516d('0x22')]({'plain':!![]});var _0x1cda10=_0x516d('0x50');return db[_0x516d('0x51')][_0x516d('0x49')]({'where':{'name':_0x1cda10,'userProfileId':_0x1ffb9b[_0x516d('0x52')]},'raw':!![]})[_0x516d('0x21')](function(_0x4536da){if(_0x4536da&&_0x4536da[_0x516d('0x53')]===0x0){return db[_0x516d('0x23')][_0x516d('0x4b')]({'name':_0x383353[_0x516d('0x27')],'resourceId':_0x383353['id'],'type':_0x4536da[_0x516d('0x27')],'sectionId':_0x4536da['id']},{})[_0x516d('0x21')](function(){return _0x315adc;});}else{return _0x315adc;}})[_0x516d('0x4a')](function(_0x333d25){logger[_0x516d('0x25')](_0x516d('0x54'),_0x333d25);throw _0x333d25;});}return _0x315adc;})[_0x516d('0x21')](respondWithResult(_0x2d3faf,0xc9))['catch'](handleError(_0x2d3faf,null));};exports[_0x516d('0x55')]=function(_0x4f3a20,_0x385c27){if(_0x4f3a20['body']['id']){delete _0x4f3a20[_0x516d('0x4c')]['id'];}return db['AnalyticMetric'][_0x516d('0x49')]({'where':{'id':_0x4f3a20[_0x516d('0x46')]['id']}})[_0x516d('0x21')](handleEntityNotFound(_0x385c27,null))[_0x516d('0x21')](saveUpdates(_0x4f3a20['body'],null))['then'](respondWithResult(_0x385c27,null))[_0x516d('0x4a')](handleError(_0x385c27,null));};exports[_0x516d('0x20')]=function(_0x14ca2f,_0x3b900c){return db[_0x516d('0x2c')]['find']({'where':{'id':_0x14ca2f[_0x516d('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b900c,null))[_0x516d('0x21')](removeEntity(_0x3b900c,null))[_0x516d('0x4a')](handleError(_0x3b900c,null));}; \ No newline at end of file +var _0x5e0b=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0x277594,_0x2c317d){var _0x4c3ff8=function(_0x4561cb){while(--_0x4561cb){_0x277594['push'](_0x277594['shift']());}};_0x4c3ff8(++_0x2c317d);}(_0x5e0b,0x1ab));var _0xb5e0=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x5e0b[_0x12a554];return _0x244ba0;};'use strict';var pdf=require(_0xb5e0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb5e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5e0('0x2'));var rp=require(_0xb5e0('0x3'));var moment=require(_0xb5e0('0x4'));var BPromise=require(_0xb5e0('0x5'));var Mustache=require(_0xb5e0('0x6'));var util=require('util');var path=require(_0xb5e0('0x7'));var sox=require(_0xb5e0('0x8'));var csv=require(_0xb5e0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb5e0('0xa'));var squel=require(_0xb5e0('0xb'));var crypto=require('crypto');var jsforce=require(_0xb5e0('0xc'));var deskjs=require(_0xb5e0('0xd'));var toCsv=require(_0xb5e0('0x9'));var querystring=require(_0xb5e0('0xe'));var Papa=require(_0xb5e0('0xf'));var Redis=require(_0xb5e0('0x10'));var authService=require(_0xb5e0('0x11'));var qs=require(_0xb5e0('0x12'));var as=require(_0xb5e0('0x13'));var hardwareService=require(_0xb5e0('0x14'));var logger=require(_0xb5e0('0x15'))(_0xb5e0('0x16'));var utils=require(_0xb5e0('0x17'));var config=require('../../config/environment');var db=require(_0xb5e0('0x18'))['db'];function respondWithStatusCode(_0x31964a,_0x27a839){_0x27a839=_0x27a839||0xcc;return function(_0x4d86c6){if(_0x4d86c6){return _0x31964a[_0xb5e0('0x19')](_0x27a839);}return _0x31964a[_0xb5e0('0x1a')](_0x27a839)[_0xb5e0('0x1b')]();};}function respondWithResult(_0x33a932,_0x242c2d){_0x242c2d=_0x242c2d||0xc8;return function(_0xc3d007){if(_0xc3d007){return _0x33a932[_0xb5e0('0x1a')](_0x242c2d)[_0xb5e0('0x1c')](_0xc3d007);}};}function respondWithFilteredResult(_0x12b362,_0x5f1f6d){return function(_0x244fef){if(_0x244fef){var _0x5a786b=_0x244fef[_0xb5e0('0x1d')],_0x674269=_0x5f1f6d[_0xb5e0('0x1e')],_0x2c3f3a=_0x5f1f6d[_0xb5e0('0x1e')]+_0x5f1f6d['limit'],_0x279770;if(_0x2c3f3a>=_0x5a786b){_0x2c3f3a=_0x5a786b;_0x279770=0xc8;}else{_0x279770=0xce;}_0x12b362[_0xb5e0('0x1a')](_0x279770);return _0x12b362[_0xb5e0('0x1f')](_0xb5e0('0x20'),_0x674269+'-'+_0x2c3f3a+'/'+_0x5a786b)['json'](_0x244fef);}return null;};}function patchUpdates(_0x29e365){return function(_0x2194b8){try{jsonpatch[_0xb5e0('0x21')](_0x2194b8,_0x29e365,!![]);}catch(_0x36d98b){return BPromise['reject'](_0x36d98b);}return _0x2194b8[_0xb5e0('0x22')]();};}function saveUpdates(_0x271d7c,_0x31b4a7){return function(_0x5479da){if(_0x5479da){return _0x5479da[_0xb5e0('0x23')](_0x271d7c)[_0xb5e0('0x24')](function(_0xf3d3f1){return _0xf3d3f1;});}return null;};}function removeEntity(_0x392777,_0x11fac4){return function(_0x44167d){if(_0x44167d){return _0x44167d[_0xb5e0('0x25')]()[_0xb5e0('0x24')](function(){var _0x30034d=_0x44167d[_0xb5e0('0x26')]({'plain':!![]});var _0x199a0f=_0xb5e0('0x27');return db[_0xb5e0('0x28')][_0xb5e0('0x25')]({'where':{'type':_0x199a0f,'resourceId':_0x30034d['id']}})[_0xb5e0('0x24')](function(){return _0x44167d;});})[_0xb5e0('0x24')](function(){_0x392777[_0xb5e0('0x1a')](0xcc)[_0xb5e0('0x1b')]();});}};}function handleEntityNotFound(_0x4fec2e,_0x38d88d){return function(_0x18c82b){if(!_0x18c82b){_0x4fec2e[_0xb5e0('0x19')](0x194);}return _0x18c82b;};}function handleError(_0x3fd511,_0x52f6dd){_0x52f6dd=_0x52f6dd||0x1f4;return function(_0x29c74f){logger[_0xb5e0('0x29')](_0x29c74f[_0xb5e0('0x2a')]);if(_0x29c74f[_0xb5e0('0x2b')]){delete _0x29c74f[_0xb5e0('0x2b')];}_0x3fd511[_0xb5e0('0x1a')](_0x52f6dd)[_0xb5e0('0x2c')](_0x29c74f);};}exports[_0xb5e0('0x2d')]=function(_0x1d069a,_0x3d7488){var _0x42a806={},_0x1a2d66={},_0x416175={'count':0x0,'rows':[]};var _0x19657a=_[_0xb5e0('0x2e')](db[_0xb5e0('0x2f')][_0xb5e0('0x30')],function(_0x1a4695){return{'name':_0x1a4695[_0xb5e0('0x31')],'type':_0x1a4695[_0xb5e0('0x32')][_0xb5e0('0x33')]};});_0x1a2d66[_0xb5e0('0x34')]=_[_0xb5e0('0x2e')](_0x19657a,_0xb5e0('0x2b'));_0x1a2d66['query']=_[_0xb5e0('0x35')](_0x1d069a[_0xb5e0('0x36')]);_0x1a2d66[_0xb5e0('0x37')]=_[_0xb5e0('0x38')](_0x1a2d66[_0xb5e0('0x34')],_0x1a2d66[_0xb5e0('0x36')]);_0x42a806[_0xb5e0('0x39')]=_[_0xb5e0('0x38')](_0x1a2d66[_0xb5e0('0x34')],qs['fields'](_0x1d069a[_0xb5e0('0x36')][_0xb5e0('0x3a')]));_0x42a806[_0xb5e0('0x39')]=_0x42a806[_0xb5e0('0x39')][_0xb5e0('0x3b')]?_0x42a806[_0xb5e0('0x39')]:_0x1a2d66[_0xb5e0('0x34')];if(!_0x1d069a[_0xb5e0('0x36')][_0xb5e0('0x3c')](_0xb5e0('0x3d'))){_0x42a806[_0xb5e0('0x3e')]=qs['limit'](_0x1d069a[_0xb5e0('0x36')][_0xb5e0('0x3e')]);_0x42a806[_0xb5e0('0x1e')]=qs[_0xb5e0('0x1e')](_0x1d069a[_0xb5e0('0x36')]['offset']);}_0x42a806['order']=qs[_0xb5e0('0x3f')](_0x1d069a[_0xb5e0('0x36')][_0xb5e0('0x3f')]);_0x42a806['where']=qs[_0xb5e0('0x37')](_[_0xb5e0('0x40')](_0x1d069a[_0xb5e0('0x36')],_0x1a2d66[_0xb5e0('0x37')]));if(_0x1d069a[_0xb5e0('0x36')][_0xb5e0('0x41')]){_0x42a806[_0xb5e0('0x42')]=_[_0xb5e0('0x43')](_0x42a806[_0xb5e0('0x42')],{'$or':_[_0xb5e0('0x2e')](_0x19657a,function(_0x314513){if(_0x314513['type']!==_0xb5e0('0x44')){var _0x2e83f8={};_0x2e83f8[_0x314513[_0xb5e0('0x2b')]]={'$like':'%'+_0x1d069a['query'][_0xb5e0('0x41')]+'%'};return _0x2e83f8;}})});}_0x42a806=_[_0xb5e0('0x43')]({},_0x42a806,_0x1d069a[_0xb5e0('0x45')]);var _0x25070a={'where':_0x42a806[_0xb5e0('0x42')]};return db['AnalyticMetric'][_0xb5e0('0x1d')](_0x25070a)[_0xb5e0('0x24')](function(_0x3cffad){_0x416175[_0xb5e0('0x1d')]=_0x3cffad;if(_0x1d069a[_0xb5e0('0x36')][_0xb5e0('0x46')]){_0x42a806[_0xb5e0('0x47')]=[{'all':!![]}];}return db['AnalyticMetric'][_0xb5e0('0x48')](_0x42a806);})['then'](function(_0x1dc1b8){_0x416175['rows']=_0x1dc1b8;return _0x416175;})[_0xb5e0('0x24')](respondWithFilteredResult(_0x3d7488,_0x42a806))[_0xb5e0('0x49')](handleError(_0x3d7488,null));};exports[_0xb5e0('0x4a')]=function(_0x3d3f51,_0x21b2c5){var _0x53a4c5={'raw':!![],'where':{'id':_0x3d3f51[_0xb5e0('0x4b')]['id']}},_0x43fbbd={};_0x43fbbd['model']=_['keys'](db[_0xb5e0('0x2f')][_0xb5e0('0x30')]);_0x43fbbd[_0xb5e0('0x36')]=_[_0xb5e0('0x35')](_0x3d3f51['query']);_0x43fbbd[_0xb5e0('0x37')]=_[_0xb5e0('0x38')](_0x43fbbd[_0xb5e0('0x34')],_0x43fbbd[_0xb5e0('0x36')]);_0x53a4c5['attributes']=_['intersection'](_0x43fbbd[_0xb5e0('0x34')],qs[_0xb5e0('0x3a')](_0x3d3f51[_0xb5e0('0x36')][_0xb5e0('0x3a')]));_0x53a4c5[_0xb5e0('0x39')]=_0x53a4c5[_0xb5e0('0x39')][_0xb5e0('0x3b')]?_0x53a4c5[_0xb5e0('0x39')]:_0x43fbbd[_0xb5e0('0x34')];if(_0x3d3f51[_0xb5e0('0x36')][_0xb5e0('0x46')]){_0x53a4c5[_0xb5e0('0x47')]=[{'all':!![]}];}_0x53a4c5=_[_0xb5e0('0x43')]({},_0x53a4c5,_0x3d3f51['options']);return db[_0xb5e0('0x2f')][_0xb5e0('0x4c')](_0x53a4c5)[_0xb5e0('0x24')](handleEntityNotFound(_0x21b2c5,null))[_0xb5e0('0x24')](respondWithResult(_0x21b2c5,null))[_0xb5e0('0x49')](handleError(_0x21b2c5,null));};exports[_0xb5e0('0x4d')]=function(_0x516c69,_0x4f15d5){return db['AnalyticMetric']['create'](_0x516c69[_0xb5e0('0x4e')],{})[_0xb5e0('0x24')](function(_0x229aa4){var _0xc8ee09=_0x516c69[_0xb5e0('0x4f')][_0xb5e0('0x26')]({'plain':!![]});if(!_0xc8ee09)throw new Error(_0xb5e0('0x50'));if(_0xc8ee09['role']===_0xb5e0('0x4f')){var _0x1f0f0d=_0x229aa4[_0xb5e0('0x26')]({'plain':!![]});var _0x18b04b='Metrics';return db[_0xb5e0('0x51')]['find']({'where':{'name':_0x18b04b,'userProfileId':_0xc8ee09[_0xb5e0('0x52')]},'raw':!![]})[_0xb5e0('0x24')](function(_0x3bc621){if(_0x3bc621&&_0x3bc621[_0xb5e0('0x53')]===0x0){return db[_0xb5e0('0x28')][_0xb5e0('0x4d')]({'name':_0x1f0f0d[_0xb5e0('0x2b')],'resourceId':_0x1f0f0d['id'],'type':_0x3bc621[_0xb5e0('0x2b')],'sectionId':_0x3bc621['id']},{})['then'](function(){return _0x229aa4;});}else{return _0x229aa4;}})[_0xb5e0('0x49')](function(_0xb16b28){logger['error'](_0xb5e0('0x54'),_0xb16b28);throw _0xb16b28;});}return _0x229aa4;})[_0xb5e0('0x24')](respondWithResult(_0x4f15d5,0xc9))[_0xb5e0('0x49')](handleError(_0x4f15d5,null));};exports[_0xb5e0('0x23')]=function(_0x39ffc6,_0x57d66e){if(_0x39ffc6[_0xb5e0('0x4e')]['id']){delete _0x39ffc6[_0xb5e0('0x4e')]['id'];}return db[_0xb5e0('0x2f')][_0xb5e0('0x4c')]({'where':{'id':_0x39ffc6[_0xb5e0('0x4b')]['id']}})[_0xb5e0('0x24')](handleEntityNotFound(_0x57d66e,null))[_0xb5e0('0x24')](saveUpdates(_0x39ffc6[_0xb5e0('0x4e')],null))[_0xb5e0('0x24')](respondWithResult(_0x57d66e,null))['catch'](handleError(_0x57d66e,null));};exports['destroy']=function(_0x2380b7,_0x49c326){return db[_0xb5e0('0x2f')][_0xb5e0('0x4c')]({'where':{'id':_0x2380b7['params']['id']}})[_0xb5e0('0x24')](handleEntityNotFound(_0x49c326,null))[_0xb5e0('0x24')](removeEntity(_0x49c326,null))[_0xb5e0('0x49')](handleError(_0x49c326,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d0a2088..d97c282 100644 --- a/server/api/analyticMetric/analyticMetric.model.js +++ b/server/api/analyticMetric/analyticMetric.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51d3=['../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x734dae,_0x150ee3){var _0x3fd1b3=function(_0x5957ef){while(--_0x5957ef){_0x734dae['push'](_0x734dae['shift']());}};_0x3fd1b3(++_0x150ee3);}(_0x51d3,0xdc));var _0x351d=function(_0x196f5f,_0x1a6e7c){_0x196f5f=_0x196f5f-0x0;var _0xcb8660=_0x51d3[_0x196f5f];return _0xcb8660;};'use strict';var _=require('lodash');var util=require(_0x351d('0x0'));var logger=require(_0x351d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x351d('0x2'));var rp=require(_0x351d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x351d('0x4'));var config=require(_0x351d('0x5'));var attributes=require(_0x351d('0x6'));module[_0x351d('0x7')]=function(_0x3febe3,_0x5c4047){return _0x3febe3['define']('AnalyticMetric',attributes,{'tableName':_0x351d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99c6=['moment','bluebird','request-promise','rimraf','../../config/environment','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api'];(function(_0x4fb518,_0x1dbfae){var _0x53e83b=function(_0x32bd61){while(--_0x32bd61){_0x4fb518['push'](_0x4fb518['shift']());}};_0x53e83b(++_0x1dbfae);}(_0x99c6,0x11a));var _0x699c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x99c6[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x699c('0x0'));var util=require(_0x699c('0x1'));var logger=require(_0x699c('0x2'))(_0x699c('0x3'));var moment=require(_0x699c('0x4'));var BPromise=require(_0x699c('0x5'));var rp=require(_0x699c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x699c('0x7'));var config=require(_0x699c('0x8'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x3c954d,_0x422f18){return _0x3c954d['define'](_0x699c('0x9'),attributes,{'tableName':_0x699c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 14eddec..9ea6b8e 100644 --- a/server/api/analyticMetric/analyticMetric.rpc.js +++ b/server/api/analyticMetric/analyticMetric.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdeb9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x58fee0,_0x21bbb2){var _0x445162=function(_0x22f017){while(--_0x22f017){_0x58fee0['push'](_0x58fee0['shift']());}};_0x445162(++_0x21bbb2);}(_0xdeb9,0x15a));var _0x9deb=function(_0x4becd0,_0x3c0a93){_0x4becd0=_0x4becd0-0x0;var _0x515618=_0xdeb9[_0x4becd0];return _0x515618;};'use strict';var _=require(_0x9deb('0x0'));var util=require('util');var moment=require(_0x9deb('0x1'));var BPromise=require(_0x9deb('0x2'));var rs=require(_0x9deb('0x3'));var fs=require('fs');var Redis=require(_0x9deb('0x4'));var db=require(_0x9deb('0x5'))['db'];var utils=require(_0x9deb('0x6'));var logger=require(_0x9deb('0x7'))(_0x9deb('0x8'));var config=require(_0x9deb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9deb('0xa')][_0x9deb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52d8a3,_0x42a4e2,_0x1f998d){return new BPromise(function(_0x58457d,_0x180e05){return client[_0x9deb('0xc')](_0x52d8a3,_0x1f998d)[_0x9deb('0xd')](function(_0x343d32){logger[_0x9deb('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x42a4e2,_0x9deb('0xf'));logger[_0x9deb('0x10')](_0x9deb('0x11'),_0x42a4e2,'request\x20sent',JSON[_0x9deb('0x12')](_0x343d32));if(_0x343d32[_0x9deb('0x13')]){if(_0x343d32[_0x9deb('0x13')][_0x9deb('0x14')]===0x1f4){logger[_0x9deb('0x13')](_0x9deb('0x15'),_0x42a4e2,_0x343d32[_0x9deb('0x13')][_0x9deb('0x16')]);return _0x180e05(_0x343d32['error'][_0x9deb('0x16')]);}logger['error'](_0x9deb('0x15'),_0x42a4e2,_0x343d32['error'][_0x9deb('0x16')]);return _0x58457d(_0x343d32[_0x9deb('0x13')][_0x9deb('0x16')]);}else{logger[_0x9deb('0xe')](_0x9deb('0x15'),_0x42a4e2,_0x9deb('0xf'));_0x58457d(_0x343d32[_0x9deb('0x17')][_0x9deb('0x16')]);}})[_0x9deb('0x18')](function(_0x36e359){logger[_0x9deb('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x42a4e2,_0x36e359);_0x180e05(_0x36e359);});});} \ No newline at end of file +var _0x14d2=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3ada0a,_0x5e94e9){var _0x41ffc0=function(_0xd4dabc){while(--_0xd4dabc){_0x3ada0a['push'](_0x3ada0a['shift']());}};_0x41ffc0(++_0x5e94e9);}(_0x14d2,0xc6));var _0x214d=function(_0x199280,_0x1503b9){_0x199280=_0x199280-0x0;var _0x59f2d4=_0x14d2[_0x199280];return _0x59f2d4;};'use strict';var _=require(_0x214d('0x0'));var util=require(_0x214d('0x1'));var moment=require('moment');var BPromise=require(_0x214d('0x2'));var rs=require(_0x214d('0x3'));var fs=require('fs');var Redis=require(_0x214d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x214d('0x5'));var logger=require('../../config/logger')(_0x214d('0x6'));var config=require('../../config/environment');var jayson=require(_0x214d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x414ed9,_0x3cf663,_0x49f3c4){return new BPromise(function(_0x5337a0,_0xa0fd17){return client['request'](_0x414ed9,_0x49f3c4)[_0x214d('0x8')](function(_0x3306c3){logger[_0x214d('0x9')](_0x214d('0xa'),_0x3cf663,_0x214d('0xb'));logger['debug'](_0x214d('0xc'),_0x3cf663,_0x214d('0xb'),JSON[_0x214d('0xd')](_0x3306c3));if(_0x3306c3['error']){if(_0x3306c3[_0x214d('0xe')][_0x214d('0xf')]===0x1f4){logger[_0x214d('0xe')](_0x214d('0xa'),_0x3cf663,_0x3306c3[_0x214d('0xe')]['message']);return _0xa0fd17(_0x3306c3[_0x214d('0xe')][_0x214d('0x10')]);}logger[_0x214d('0xe')](_0x214d('0xa'),_0x3cf663,_0x3306c3[_0x214d('0xe')][_0x214d('0x10')]);return _0x5337a0(_0x3306c3[_0x214d('0xe')]['message']);}else{logger['info'](_0x214d('0xa'),_0x3cf663,_0x214d('0xb'));_0x5337a0(_0x3306c3[_0x214d('0x11')][_0x214d('0x10')]);}})['catch'](function(_0x17f4e8){logger[_0x214d('0xe')](_0x214d('0xa'),_0x3cf663,_0x17f4e8);_0xa0fd17(_0x17f4e8);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 41df7a1..cd1e06c 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['isAuthenticated','index','/:id','show','post','create','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x43af6f,_0x3af2f3){var _0x263537=function(_0x388f4c){while(--_0x388f4c){_0x43af6f['push'](_0x43af6f['shift']());}};_0x263537(++_0x3af2f3);}(_0x57ca,0x108));var _0xa57c=function(_0x4b6d92,_0x4344c4){_0x4b6d92=_0x4b6d92-0x0;var _0x4f7a8a=_0x57ca[_0x4b6d92];return _0x4f7a8a;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var auth=require(_0xa57c('0x4'));var interaction=require(_0xa57c('0x5'));var config=require(_0xa57c('0x6'));var controller=require('./analyticMetric.controller');router[_0xa57c('0x7')]('/',auth[_0xa57c('0x8')](),controller[_0xa57c('0x9')]);router[_0xa57c('0x7')](_0xa57c('0xa'),auth[_0xa57c('0x8')](),controller[_0xa57c('0xb')]);router[_0xa57c('0xc')]('/',auth['isAuthenticated'](),controller[_0xa57c('0xd')]);router['put'](_0xa57c('0xa'),auth[_0xa57c('0x8')](),controller['update']);router[_0xa57c('0xe')]('/:id',auth[_0xa57c('0x8')](),controller[_0xa57c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x187d=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x41e7e0,_0x42763f){var _0x5a799b=function(_0x33e3db){while(--_0x33e3db){_0x41e7e0['push'](_0x41e7e0['shift']());}};_0x5a799b(++_0x42763f);}(_0x187d,0x93));var _0xd187=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x187d[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0xd')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xe')]);router['put'](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 1caa368..5d17b8a 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe3c=['TEXT','sequelize'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xfe3c,0x1b3));var _0xcfe3=function(_0x49d8c7,_0x4297ff){_0x49d8c7=_0x49d8c7-0x0;var _0x3d905a=_0xfe3c[_0x49d8c7];return _0x3d905a;};'use strict';var Sequelize=require(_0xcfe3('0x0'));module['exports']={'tree':{'type':Sequelize[_0xcfe3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x90a3=['exports','sequelize'];(function(_0x23b3fc,_0x59b1c1){var _0x24e919=function(_0x47e1c2){while(--_0x47e1c2){_0x23b3fc['push'](_0x23b3fc['shift']());}};_0x24e919(++_0x59b1c1);}(_0x90a3,0xb1));var _0x390a=function(_0x26d993,_0x17629f){_0x26d993=_0x26d993-0x0;var _0x2b8852=_0x90a3[_0x26d993];return _0x2b8852;};'use strict';var Sequelize=require(_0x390a('0x0'));module[_0x390a('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index c96dc17..45e9596 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.controller.js +++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['includeAll','options','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','AnalyticTreeReport','include','findAll','rows','params'];(function(_0x24efa6,_0x4d2005){var _0x144b0d=function(_0xf95318){while(--_0xf95318){_0x24efa6['push'](_0x24efa6['shift']());}};_0x144b0d(++_0x4d2005);}(_0xe706,0xa3));var _0x6e70=function(_0x462729,_0x226b5a){_0x462729=_0x462729-0x0;var _0x107767=_0xe706[_0x462729];return _0x107767;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=_[_0x6e70('0x2c')](db['AnalyticTreeReport'][_0x6e70('0x2d')],function(_0x406f29){return{'name':_0x406f29[_0x6e70('0x2e')],'type':_0x406f29[_0x6e70('0x2f')][_0x6e70('0x30')]};});_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x2c')](_0x114344,_0x6e70('0x29'));_0x3af17f[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x4a67ac['query']);_0x3af17f[_0x6e70('0x34')]=_['intersection'](_0x3af17f[_0x6e70('0x31')],_0x3af17f['query']);_0x2c4d37[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x3af17f[_0x6e70('0x31')],qs['fields'](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x37')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x31')];if(!_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x39')](_0x6e70('0x3a'))){_0x2c4d37[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x3b')]=qs[_0x6e70('0x3b')](_0x4a67ac['query'][_0x6e70('0x3b')]);}_0x2c4d37['order']=qs[_0x6e70('0x3c')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3c')]);_0x2c4d37[_0x6e70('0x3d')]=qs[_0x6e70('0x34')](_[_0x6e70('0x3e')](_0x4a67ac[_0x6e70('0x32')],_0x3af17f[_0x6e70('0x34')]));if(_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]){_0x2c4d37[_0x6e70('0x3d')]=_[_0x6e70('0x40')](_0x2c4d37[_0x6e70('0x3d')],{'$or':_['map'](_0x114344,function(_0x5446a2){if(_0x5446a2['type']!==_0x6e70('0x41')){var _0x3841a0={};_0x3841a0[_0x5446a2[_0x6e70('0x29')]]={'$like':'%'+_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]+'%'};return _0x3841a0;}})});}_0x2c4d37=_[_0x6e70('0x40')]({},_0x2c4d37,_0x4a67ac['options']);var _0x3b508c={'where':_0x2c4d37[_0x6e70('0x3d')]};return db[_0x6e70('0x42')][_0x6e70('0x1f')](_0x3b508c)[_0x6e70('0x27')](function(_0x37bf46){_0x83c836[_0x6e70('0x1f')]=_0x37bf46;if(_0x4a67ac[_0x6e70('0x32')]['includeAll']){_0x2c4d37[_0x6e70('0x43')]=[{'all':!![]}];}return db[_0x6e70('0x42')][_0x6e70('0x44')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x201da9){_0x83c836[_0x6e70('0x45')]=_0x201da9;return _0x83c836;})[_0x6e70('0x27')](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))['catch'](handleError(_0x54a5fe,null));};exports['show']=function(_0x5ae898,_0x154e0c){var _0x2b63cc={'raw':!![],'where':{'id':_0x5ae898[_0x6e70('0x46')]['id']}},_0x83847b={};_0x83847b[_0x6e70('0x31')]=_['keys'](db[_0x6e70('0x42')][_0x6e70('0x2d')]);_0x83847b[_0x6e70('0x32')]=_['keys'](_0x5ae898['query']);_0x83847b['filters']=_[_0x6e70('0x36')](_0x83847b['model'],_0x83847b[_0x6e70('0x32')]);_0x2b63cc[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x83847b[_0x6e70('0x31')],qs['fields'](_0x5ae898[_0x6e70('0x32')]['fields']));_0x2b63cc[_0x6e70('0x35')]=_0x2b63cc[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2b63cc[_0x6e70('0x35')]:_0x83847b['model'];if(_0x5ae898[_0x6e70('0x32')][_0x6e70('0x47')]){_0x2b63cc[_0x6e70('0x43')]=[{'all':!![]}];}_0x2b63cc=_[_0x6e70('0x40')]({},_0x2b63cc,_0x5ae898[_0x6e70('0x48')]);return db[_0x6e70('0x42')][_0x6e70('0x49')](_0x2b63cc)['then'](handleEntityNotFound(_0x154e0c,null))[_0x6e70('0x27')](respondWithResult(_0x154e0c,null))[_0x6e70('0x4a')](handleError(_0x154e0c,null));};exports[_0x6e70('0x4b')]=function(_0x2f99cb,_0x3f86cf){return db[_0x6e70('0x42')][_0x6e70('0x4b')](_0x2f99cb['body'],{})[_0x6e70('0x27')](respondWithResult(_0x3f86cf,0xc9))['catch'](handleError(_0x3f86cf,null));};exports[_0x6e70('0x26')]=function(_0x3836e4,_0x4b351e){if(_0x3836e4['body']['id']){delete _0x3836e4[_0x6e70('0x4c')]['id'];}return db[_0x6e70('0x42')][_0x6e70('0x49')]({'where':{'id':_0x3836e4['params']['id']}})['then'](handleEntityNotFound(_0x4b351e,null))[_0x6e70('0x27')](saveUpdates(_0x3836e4[_0x6e70('0x4c')],null))[_0x6e70('0x27')](respondWithResult(_0x4b351e,null))[_0x6e70('0x4a')](handleError(_0x4b351e,null));};exports[_0x6e70('0x4d')]=function(_0x340674,_0x4ad5a9){return db[_0x6e70('0x42')][_0x6e70('0x49')]({'where':{'id':_0x340674[_0x6e70('0x46')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x4ad5a9,null))[_0x6e70('0x27')](removeEntity(_0x4ad5a9,null))['catch'](handleError(_0x4ad5a9,null));}; \ No newline at end of file +var _0xbaf0=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a53e2,_0x465dd7){_0x465dd7=_0x465dd7||0xcc;return function(_0xe4378c){if(_0xe4378c){return _0x5a53e2[_0x0baf('0x1b')](_0x465dd7);}return _0x5a53e2[_0x0baf('0x1c')](_0x465dd7)['end']();};}function respondWithResult(_0x2ab33e,_0x49e44b){_0x49e44b=_0x49e44b||0xc8;return function(_0x1c76a8){if(_0x1c76a8){return _0x2ab33e[_0x0baf('0x1c')](_0x49e44b)[_0x0baf('0x1d')](_0x1c76a8);}};}function respondWithFilteredResult(_0x2bc381,_0xb8339e){return function(_0x469599){if(_0x469599){var _0x4f80a8=_0x469599[_0x0baf('0x1e')],_0x4cd79d=_0xb8339e[_0x0baf('0x1f')],_0x2312c7=_0xb8339e[_0x0baf('0x1f')]+_0xb8339e[_0x0baf('0x20')],_0x38395b;if(_0x2312c7>=_0x4f80a8){_0x2312c7=_0x4f80a8;_0x38395b=0xc8;}else{_0x38395b=0xce;}_0x2bc381['status'](_0x38395b);return _0x2bc381[_0x0baf('0x21')](_0x0baf('0x22'),_0x4cd79d+'-'+_0x2312c7+'/'+_0x4f80a8)[_0x0baf('0x1d')](_0x469599);}return null;};}function patchUpdates(_0x3e9cb4){return function(_0x47070d){try{jsonpatch[_0x0baf('0x23')](_0x47070d,_0x3e9cb4,!![]);}catch(_0x4ff793){return BPromise['reject'](_0x4ff793);}return _0x47070d[_0x0baf('0x24')]();};}function saveUpdates(_0x154f48,_0x32e839){return function(_0x1848e8){if(_0x1848e8){return _0x1848e8[_0x0baf('0x25')](_0x154f48)[_0x0baf('0x26')](function(_0x210cd8){return _0x210cd8;});}return null;};}function removeEntity(_0x636a13,_0x2c42e2){return function(_0x15a2c3){if(_0x15a2c3){return _0x15a2c3['destroy']()[_0x0baf('0x26')](function(){_0x636a13['status'](0xcc)[_0x0baf('0x27')]();});}};}function handleEntityNotFound(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(!_0x2ef0aa){_0x5dbf00['sendStatus'](0x194);}return _0x2ef0aa;};}function handleError(_0x4be1b9,_0x47c4b){_0x47c4b=_0x47c4b||0x1f4;return function(_0x27b59c){logger[_0x0baf('0x28')](_0x27b59c[_0x0baf('0x29')]);if(_0x27b59c[_0x0baf('0x2a')]){delete _0x27b59c['name'];}_0x4be1b9[_0x0baf('0x1c')](_0x47c4b)[_0x0baf('0x2b')](_0x27b59c);};}exports[_0x0baf('0x2c')]=function(_0x366e71,_0x3843b8){var _0x3b9b31={},_0x453525={},_0x549fd0={'count':0x0,'rows':[]};var _0x1590b4=_[_0x0baf('0x2d')](db[_0x0baf('0x2e')][_0x0baf('0x2f')],function(_0x55c715){return{'name':_0x55c715[_0x0baf('0x30')],'type':_0x55c715[_0x0baf('0x31')]['key']};});_0x453525[_0x0baf('0x32')]=_[_0x0baf('0x2d')](_0x1590b4,_0x0baf('0x2a'));_0x453525[_0x0baf('0x33')]=_[_0x0baf('0x34')](_0x366e71[_0x0baf('0x33')]);_0x453525[_0x0baf('0x35')]=_['intersection'](_0x453525[_0x0baf('0x32')],_0x453525[_0x0baf('0x33')]);_0x3b9b31[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x453525[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x38')]));_0x3b9b31[_0x0baf('0x36')]=_0x3b9b31[_0x0baf('0x36')][_0x0baf('0x39')]?_0x3b9b31[_0x0baf('0x36')]:_0x453525[_0x0baf('0x32')];if(!_0x366e71[_0x0baf('0x33')]['hasOwnProperty'](_0x0baf('0x3a'))){_0x3b9b31['limit']=qs[_0x0baf('0x20')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x20')]);_0x3b9b31[_0x0baf('0x1f')]=qs['offset'](_0x366e71[_0x0baf('0x33')][_0x0baf('0x1f')]);}_0x3b9b31['order']=qs[_0x0baf('0x3b')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x3b')]);_0x3b9b31[_0x0baf('0x3c')]=qs[_0x0baf('0x35')](_[_0x0baf('0x3d')](_0x366e71[_0x0baf('0x33')],_0x453525[_0x0baf('0x35')]));if(_0x366e71['query'][_0x0baf('0x3e')]){_0x3b9b31[_0x0baf('0x3c')]=_['merge'](_0x3b9b31[_0x0baf('0x3c')],{'$or':_['map'](_0x1590b4,function(_0x5c545f){if(_0x5c545f[_0x0baf('0x31')]!==_0x0baf('0x3f')){var _0x5d3ad1={};_0x5d3ad1[_0x5c545f['name']]={'$like':'%'+_0x366e71[_0x0baf('0x33')][_0x0baf('0x3e')]+'%'};return _0x5d3ad1;}})});}_0x3b9b31=_[_0x0baf('0x40')]({},_0x3b9b31,_0x366e71[_0x0baf('0x41')]);var _0x15eb5c={'where':_0x3b9b31[_0x0baf('0x3c')]};return db[_0x0baf('0x2e')][_0x0baf('0x1e')](_0x15eb5c)[_0x0baf('0x26')](function(_0x36c6d2){_0x549fd0[_0x0baf('0x1e')]=_0x36c6d2;if(_0x366e71[_0x0baf('0x33')][_0x0baf('0x42')]){_0x3b9b31[_0x0baf('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0baf('0x44')](_0x3b9b31);})[_0x0baf('0x26')](function(_0x4f1de9){_0x549fd0[_0x0baf('0x45')]=_0x4f1de9;return _0x549fd0;})[_0x0baf('0x26')](respondWithFilteredResult(_0x3843b8,_0x3b9b31))[_0x0baf('0x46')](handleError(_0x3843b8,null));};exports[_0x0baf('0x47')]=function(_0x2e20c8,_0x456d0b){var _0x57b581={'raw':!![],'where':{'id':_0x2e20c8[_0x0baf('0x48')]['id']}},_0x23ad34={};_0x23ad34['model']=_[_0x0baf('0x34')](db[_0x0baf('0x2e')][_0x0baf('0x2f')]);_0x23ad34[_0x0baf('0x33')]=_['keys'](_0x2e20c8[_0x0baf('0x33')]);_0x23ad34[_0x0baf('0x35')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],_0x23ad34[_0x0baf('0x33')]);_0x57b581[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x2e20c8[_0x0baf('0x33')]['fields']));_0x57b581[_0x0baf('0x36')]=_0x57b581[_0x0baf('0x36')][_0x0baf('0x39')]?_0x57b581[_0x0baf('0x36')]:_0x23ad34[_0x0baf('0x32')];if(_0x2e20c8['query'][_0x0baf('0x42')]){_0x57b581[_0x0baf('0x43')]=[{'all':!![]}];}_0x57b581=_[_0x0baf('0x40')]({},_0x57b581,_0x2e20c8[_0x0baf('0x41')]);return db[_0x0baf('0x2e')]['find'](_0x57b581)[_0x0baf('0x26')](handleEntityNotFound(_0x456d0b,null))[_0x0baf('0x26')](respondWithResult(_0x456d0b,null))[_0x0baf('0x46')](handleError(_0x456d0b,null));};exports[_0x0baf('0x49')]=function(_0x41599f,_0x22d10f){return db[_0x0baf('0x2e')]['create'](_0x41599f[_0x0baf('0x4a')],{})[_0x0baf('0x26')](respondWithResult(_0x22d10f,0xc9))[_0x0baf('0x46')](handleError(_0x22d10f,null));};exports['update']=function(_0x3c9de3,_0x2222b6){if(_0x3c9de3[_0x0baf('0x4a')]['id']){delete _0x3c9de3[_0x0baf('0x4a')]['id'];}return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0x3c9de3[_0x0baf('0x48')]['id']}})['then'](handleEntityNotFound(_0x2222b6,null))[_0x0baf('0x26')](saveUpdates(_0x3c9de3[_0x0baf('0x4a')],null))[_0x0baf('0x26')](respondWithResult(_0x2222b6,null))[_0x0baf('0x46')](handleError(_0x2222b6,null));};exports[_0x0baf('0x4c')]=function(_0xc427b2,_0x40d4a6){return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0xc427b2[_0x0baf('0x48')]['id']}})[_0x0baf('0x26')](handleEntityNotFound(_0x40d4a6,null))['then'](removeEntity(_0x40d4a6,null))['catch'](handleError(_0x40d4a6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 2b9c3ab..046d6fe 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.model.js +++ b/server/api/analyticTreeReport/analyticTreeReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0447=['moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x9d62c6,_0x3a3652){var _0x2aae45=function(_0x342c58){while(--_0x342c58){_0x9d62c6['push'](_0x9d62c6['shift']());}};_0x2aae45(++_0x3a3652);}(_0x0447,0x8b));var _0x7044=function(_0x386042,_0x1869f1){_0x386042=_0x386042-0x0;var _0x5e766c=_0x0447[_0x386042];return _0x5e766c;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var logger=require(_0x7044('0x2'))(_0x7044('0x3'));var moment=require(_0x7044('0x4'));var BPromise=require('bluebird');var rp=require(_0x7044('0x5'));var fs=require('fs');var path=require(_0x7044('0x6'));var rimraf=require(_0x7044('0x7'));var config=require(_0x7044('0x8'));var attributes=require(_0x7044('0x9'));module[_0x7044('0xa')]=function(_0x148941,_0x20dfb1){return _0x148941[_0x7044('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x7044('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7096=['exports','define','AnalyticTreeReport','analytics_report_trees','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0x7096,0x10c));var _0x6709=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x7096[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 844bb06..67555bf 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67a3=['request\x20sent','stringify','error','code','message','info','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x67a3,0x1aa));var _0x367a=function(_0x181b98,_0xb45686){_0x181b98=_0x181b98-0x0;var _0x319a5d=_0x67a3[_0x181b98];return _0x319a5d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x367a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x367a('0x1'));var db=require(_0x367a('0x2'))['db'];var utils=require(_0x367a('0x3'));var logger=require(_0x367a('0x4'))(_0x367a('0x5'));var config=require(_0x367a('0x6'));var jayson=require(_0x367a('0x7'));var client=jayson['client'][_0x367a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bd592,_0x362bf9,_0x4f4e34){return new BPromise(function(_0x305d12,_0xd6d5e8){return client[_0x367a('0x9')](_0x4bd592,_0x4f4e34)[_0x367a('0xa')](function(_0x565cb){logger['info'](_0x367a('0xb'),_0x362bf9,'request\x20sent');logger[_0x367a('0xc')](_0x367a('0xd'),_0x362bf9,_0x367a('0xe'),JSON[_0x367a('0xf')](_0x565cb));if(_0x565cb['error']){if(_0x565cb[_0x367a('0x10')][_0x367a('0x11')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x362bf9,_0x565cb['error'][_0x367a('0x12')]);return _0xd6d5e8(_0x565cb[_0x367a('0x10')][_0x367a('0x12')]);}logger[_0x367a('0x10')](_0x367a('0xb'),_0x362bf9,_0x565cb[_0x367a('0x10')][_0x367a('0x12')]);return _0x305d12(_0x565cb[_0x367a('0x10')][_0x367a('0x12')]);}else{logger[_0x367a('0x13')](_0x367a('0xb'),_0x362bf9,'request\x20sent');_0x305d12(_0x565cb[_0x367a('0x14')][_0x367a('0x12')]);}})[_0x367a('0x15')](function(_0x45e774){logger['error'](_0x367a('0xb'),_0x362bf9,_0x45e774);_0xd6d5e8(_0x45e774);});});} \ No newline at end of file +var _0x2267=['rpc','../../config/environment','jayson/promise','http','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x28018e,_0x359c7e){var _0x18b82c=function(_0x3ee6ab){while(--_0x3ee6ab){_0x28018e['push'](_0x28018e['shift']());}};_0x18b82c(++_0x359c7e);}(_0x2267,0x11e));var _0x7226=function(_0x1a8eac,_0x5a0570){_0x1a8eac=_0x1a8eac-0x0;var _0x3e1086=_0x2267[_0x1a8eac];return _0x3e1086;};'use strict';var _=require(_0x7226('0x0'));var util=require(_0x7226('0x1'));var moment=require('moment');var BPromise=require(_0x7226('0x2'));var rs=require(_0x7226('0x3'));var fs=require('fs');var Redis=require(_0x7226('0x4'));var db=require(_0x7226('0x5'))['db'];var utils=require(_0x7226('0x6'));var logger=require(_0x7226('0x7'))(_0x7226('0x8'));var config=require(_0x7226('0x9'));var jayson=require(_0x7226('0xa'));var client=jayson['client'][_0x7226('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c061,_0x2e2a21,_0x300c8a){return new BPromise(function(_0x2bdef9,_0x2468a5){return client['request'](_0x44c061,_0x300c8a)[_0x7226('0xc')](function(_0x36ee4d){logger['info'](_0x7226('0xd'),_0x2e2a21,_0x7226('0xe'));logger['debug'](_0x7226('0xf'),_0x2e2a21,'request\x20sent',JSON['stringify'](_0x36ee4d));if(_0x36ee4d[_0x7226('0x10')]){if(_0x36ee4d['error']['code']===0x1f4){logger[_0x7226('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2e2a21,_0x36ee4d[_0x7226('0x10')][_0x7226('0x11')]);return _0x2468a5(_0x36ee4d[_0x7226('0x10')]['message']);}logger[_0x7226('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2e2a21,_0x36ee4d['error'][_0x7226('0x11')]);return _0x2bdef9(_0x36ee4d[_0x7226('0x10')]['message']);}else{logger[_0x7226('0x12')](_0x7226('0xd'),_0x2e2a21,_0x7226('0xe'));_0x2bdef9(_0x36ee4d[_0x7226('0x13')]['message']);}})[_0x7226('0x14')](function(_0x59af55){logger[_0x7226('0x10')](_0x7226('0xd'),_0x2e2a21,_0x59af55);_0x2468a5(_0x59af55);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 89c658b..2c59e48 100644 --- a/server/api/analyticTreeReport/index.js +++ b/server/api/analyticTreeReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3e1=['get','isAuthenticated','/:id','show','post','create','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x278831,_0x494858){var _0x5bb099=function(_0x284eb1){while(--_0x284eb1){_0x278831['push'](_0x278831['shift']());}};_0x5bb099(++_0x494858);}(_0xa3e1,0xaf));var _0x1a3e=function(_0x592ad2,_0x55f950){_0x592ad2=_0x592ad2-0x0;var _0x4e0139=_0xa3e1[_0x592ad2];return _0x4e0139;};'use strict';var multer=require('multer');var util=require(_0x1a3e('0x0'));var path=require(_0x1a3e('0x1'));var timeout=require(_0x1a3e('0x2'));var express=require(_0x1a3e('0x3'));var router=express['Router']();var auth=require(_0x1a3e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1a3e('0x5'));var controller=require(_0x1a3e('0x6'));router[_0x1a3e('0x7')]('/',auth[_0x1a3e('0x8')](),controller['index']);router[_0x1a3e('0x7')](_0x1a3e('0x9'),auth['isAuthenticated'](),controller[_0x1a3e('0xa')]);router[_0x1a3e('0xb')]('/',auth[_0x1a3e('0x8')](),controller[_0x1a3e('0xc')]);router['put'](_0x1a3e('0x9'),auth[_0x1a3e('0x8')](),controller['update']);router['delete'](_0x1a3e('0x9'),auth[_0x1a3e('0x8')](),controller['destroy']);module[_0x1a3e('0xd')]=router; \ No newline at end of file +var _0x3228=['connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','exports','multer','util','path'];(function(_0x470536,_0x17bb94){var _0x5e4904=function(_0x4a9f57){while(--_0x4a9f57){_0x470536['push'](_0x470536['shift']());}};_0x5e4904(++_0x17bb94);}(_0x3228,0x85));var _0x8322=function(_0x48f776,_0x1ba400){_0x48f776=_0x48f776-0x0;var _0x51897d=_0x3228[_0x48f776];return _0x51897d;};'use strict';var multer=require(_0x8322('0x0'));var util=require(_0x8322('0x1'));var path=require(_0x8322('0x2'));var timeout=require(_0x8322('0x3'));var express=require('express');var router=express[_0x8322('0x4')]();var auth=require(_0x8322('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8322('0x6'));var controller=require(_0x8322('0x7'));router[_0x8322('0x8')]('/',auth[_0x8322('0x9')](),controller[_0x8322('0xa')]);router[_0x8322('0x8')](_0x8322('0xb'),auth[_0x8322('0x9')](),controller[_0x8322('0xc')]);router[_0x8322('0xd')]('/',auth[_0x8322('0x9')](),controller[_0x8322('0xe')]);router[_0x8322('0xf')](_0x8322('0xb'),auth[_0x8322('0x9')](),controller['update']);router['delete'](_0x8322('0xb'),auth[_0x8322('0x9')](),controller['destroy']);module[_0x8322('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index bc7c9d7..5d611b2 100644 --- a/server/api/attachment/attachment.attributes.js +++ b/server/api/attachment/attachment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa35=['sequelize','exports'];(function(_0x164736,_0x4c32ac){var _0x3a8431=function(_0x762cec){while(--_0x762cec){_0x164736['push'](_0x164736['shift']());}};_0x3a8431(++_0x4c32ac);}(_0xfa35,0x1ce));var _0x5fa3=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xfa35[_0x54d4a8];return _0x3b321b;};'use strict';var Sequelize=require(_0x5fa3('0x0'));module[_0x5fa3('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x59c0=['STRING','sequelize'];(function(_0x162a95,_0x9dfb1f){var _0x54cd40=function(_0x249ed1){while(--_0x249ed1){_0x162a95['push'](_0x162a95['shift']());}};_0x54cd40(++_0x9dfb1f);}(_0x59c0,0xf5));var _0x059c=function(_0x588a22,_0x1ad0bb){_0x588a22=_0x588a22-0x0;var _0x42be77=_0x59c0[_0x588a22];return _0x42be77;};'use strict';var Sequelize=require(_0x059c('0x0'));module['exports']={'name':{'type':Sequelize[_0x059c('0x1')]},'basename':{'type':Sequelize[_0x059c('0x1')]},'type':{'type':Sequelize[_0x059c('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index e1122b7..ed4f4f1 100644 --- a/server/api/attachment/attachment.controller.js +++ b/server/api/attachment/attachment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2125=['get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','findOne','download','root','server/files/attachments/','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','map','Attachment','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','show','include','find','catch','params','options'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2125,0x11a));var _0x5212=function(_0x38f18f,_0x6d6623){_0x38f18f=_0x38f18f-0x0;var _0x2029f9=_0x2125[_0x38f18f];return _0x2029f9;};'use strict';var pdf=require(_0x5212('0x0'));var emlformat=require(_0x5212('0x1'));var rimraf=require(_0x5212('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5212('0x3'));var rp=require(_0x5212('0x4'));var moment=require(_0x5212('0x5'));var BPromise=require(_0x5212('0x6'));var Mustache=require(_0x5212('0x7'));var util=require('util');var path=require(_0x5212('0x8'));var sox=require(_0x5212('0x9'));var csv=require(_0x5212('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5212('0xb'));var crypto=require(_0x5212('0xc'));var jsforce=require(_0x5212('0xd'));var deskjs=require(_0x5212('0xe'));var toCsv=require(_0x5212('0xa'));var querystring=require('querystring');var Papa=require(_0x5212('0xf'));var Redis=require(_0x5212('0x10'));var authService=require(_0x5212('0x11'));var qs=require(_0x5212('0x12'));var as=require(_0x5212('0x13'));var hardwareService=require(_0x5212('0x14'));var logger=require(_0x5212('0x15'))(_0x5212('0x16'));var utils=require(_0x5212('0x17'));var config=require(_0x5212('0x18'));var db=require(_0x5212('0x19'))['db'];function respondWithStatusCode(_0x45bd5c,_0x23f323){_0x23f323=_0x23f323||0xcc;return function(_0x41c7e5){if(_0x41c7e5){return _0x45bd5c[_0x5212('0x1a')](_0x23f323);}return _0x45bd5c['status'](_0x23f323)['end']();};}function respondWithResult(_0x2460e2,_0x25aabf){_0x25aabf=_0x25aabf||0xc8;return function(_0x26622d){if(_0x26622d){return _0x2460e2[_0x5212('0x1b')](_0x25aabf)[_0x5212('0x1c')](_0x26622d);}};}function respondWithFilteredResult(_0x172982,_0x3025bb){return function(_0x248bd0){if(_0x248bd0){var _0x29b992=_0x248bd0[_0x5212('0x1d')],_0x19be1=_0x3025bb[_0x5212('0x1e')],_0x15842c=_0x3025bb[_0x5212('0x1e')]+_0x3025bb['limit'],_0x10c089;if(_0x15842c>=_0x29b992){_0x15842c=_0x29b992;_0x10c089=0xc8;}else{_0x10c089=0xce;}_0x172982[_0x5212('0x1b')](_0x10c089);return _0x172982[_0x5212('0x1f')](_0x5212('0x20'),_0x19be1+'-'+_0x15842c+'/'+_0x29b992)[_0x5212('0x1c')](_0x248bd0);}return null;};}function patchUpdates(_0x4a44a7){return function(_0x197327){try{jsonpatch['apply'](_0x197327,_0x4a44a7,!![]);}catch(_0x2eb07f){return BPromise[_0x5212('0x21')](_0x2eb07f);}return _0x197327[_0x5212('0x22')]();};}function saveUpdates(_0x211ef0,_0x9e26b8){return function(_0x449821){if(_0x449821){return _0x449821[_0x5212('0x23')](_0x211ef0)['then'](function(_0x236fb2){return _0x236fb2;});}return null;};}function removeEntity(_0x121c8d,_0x41852e){return function(_0x1eb315){if(_0x1eb315){return _0x1eb315[_0x5212('0x24')]()[_0x5212('0x25')](function(){_0x121c8d['status'](0xcc)[_0x5212('0x26')]();});}};}function handleEntityNotFound(_0x2486a4,_0x5b76f0){return function(_0x46540b){if(!_0x46540b){_0x2486a4[_0x5212('0x1a')](0x194);}return _0x46540b;};}function handleError(_0x178dff,_0x1b73c2){_0x1b73c2=_0x1b73c2||0x1f4;return function(_0x125969){logger[_0x5212('0x27')](_0x125969[_0x5212('0x28')]);if(_0x125969[_0x5212('0x29')]){delete _0x125969['name'];}_0x178dff[_0x5212('0x1b')](_0x1b73c2)[_0x5212('0x2a')](_0x125969);};}exports['index']=function(_0x4e1633,_0x5a1024){var _0x3f7a84={},_0x3ad152={},_0x213b15={'count':0x0,'rows':[]};var _0x354bc1=_[_0x5212('0x2b')](db[_0x5212('0x2c')][_0x5212('0x2d')],function(_0x438178){return{'name':_0x438178[_0x5212('0x2e')],'type':_0x438178[_0x5212('0x2f')][_0x5212('0x30')]};});_0x3ad152['model']=_[_0x5212('0x2b')](_0x354bc1,'name');_0x3ad152['query']=_[_0x5212('0x31')](_0x4e1633[_0x5212('0x32')]);_0x3ad152['filters']=_[_0x5212('0x33')](_0x3ad152[_0x5212('0x34')],_0x3ad152[_0x5212('0x32')]);_0x3f7a84[_0x5212('0x35')]=_[_0x5212('0x33')](_0x3ad152['model'],qs[_0x5212('0x36')](_0x4e1633['query'][_0x5212('0x36')]));_0x3f7a84[_0x5212('0x35')]=_0x3f7a84['attributes'][_0x5212('0x37')]?_0x3f7a84[_0x5212('0x35')]:_0x3ad152[_0x5212('0x34')];if(!_0x4e1633['query'][_0x5212('0x38')]('nolimit')){_0x3f7a84[_0x5212('0x39')]=qs[_0x5212('0x39')](_0x4e1633[_0x5212('0x32')][_0x5212('0x39')]);_0x3f7a84[_0x5212('0x1e')]=qs['offset'](_0x4e1633[_0x5212('0x32')][_0x5212('0x1e')]);}_0x3f7a84[_0x5212('0x3a')]=qs[_0x5212('0x3b')](_0x4e1633[_0x5212('0x32')][_0x5212('0x3b')]);_0x3f7a84[_0x5212('0x3c')]=qs[_0x5212('0x3d')](_[_0x5212('0x3e')](_0x4e1633[_0x5212('0x32')],_0x3ad152[_0x5212('0x3d')]));if(_0x4e1633[_0x5212('0x32')][_0x5212('0x3f')]){_0x3f7a84[_0x5212('0x3c')]=_[_0x5212('0x40')](_0x3f7a84[_0x5212('0x3c')],{'$or':_[_0x5212('0x2b')](_0x354bc1,function(_0x4c26aa){if(_0x4c26aa[_0x5212('0x2f')]!=='VIRTUAL'){var _0x3c1e11={};_0x3c1e11[_0x4c26aa['name']]={'$like':'%'+_0x4e1633[_0x5212('0x32')][_0x5212('0x3f')]+'%'};return _0x3c1e11;}})});}_0x3f7a84=_['merge']({},_0x3f7a84,_0x4e1633['options']);var _0x73a2ad={'where':_0x3f7a84[_0x5212('0x3c')]};return db[_0x5212('0x2c')][_0x5212('0x1d')](_0x73a2ad)[_0x5212('0x25')](function(_0x46073c){_0x213b15[_0x5212('0x1d')]=_0x46073c;if(_0x4e1633[_0x5212('0x32')][_0x5212('0x41')]){_0x3f7a84['include']=[{'all':!![]}];}return db['Attachment'][_0x5212('0x42')](_0x3f7a84);})[_0x5212('0x25')](function(_0x269e3e){_0x213b15[_0x5212('0x43')]=_0x269e3e;return _0x213b15;})['then'](respondWithFilteredResult(_0x5a1024,_0x3f7a84))['catch'](handleError(_0x5a1024,null));};exports[_0x5212('0x44')]=function(_0x566d7f,_0x40a7cc){var _0x530044={'raw':!![],'where':{'id':_0x566d7f['params']['id']}},_0x25be92={};_0x25be92['model']=_[_0x5212('0x31')](db[_0x5212('0x2c')][_0x5212('0x2d')]);_0x25be92[_0x5212('0x32')]=_['keys'](_0x566d7f[_0x5212('0x32')]);_0x25be92[_0x5212('0x3d')]=_[_0x5212('0x33')](_0x25be92[_0x5212('0x34')],_0x25be92[_0x5212('0x32')]);_0x530044['attributes']=_[_0x5212('0x33')](_0x25be92['model'],qs[_0x5212('0x36')](_0x566d7f[_0x5212('0x32')][_0x5212('0x36')]));_0x530044[_0x5212('0x35')]=_0x530044[_0x5212('0x35')]['length']?_0x530044[_0x5212('0x35')]:_0x25be92[_0x5212('0x34')];if(_0x566d7f[_0x5212('0x32')][_0x5212('0x41')]){_0x530044[_0x5212('0x45')]=[{'all':!![]}];}_0x530044=_[_0x5212('0x40')]({},_0x530044,_0x566d7f['options']);return db[_0x5212('0x2c')][_0x5212('0x46')](_0x530044)[_0x5212('0x25')](handleEntityNotFound(_0x40a7cc,null))[_0x5212('0x25')](respondWithResult(_0x40a7cc,null))[_0x5212('0x47')](handleError(_0x40a7cc,null));};exports['clone']=function(_0x59ad81,_0x2234eb){var _0x31c6b1={'where':{'id':_0x59ad81[_0x5212('0x48')]['id']}},_0x198e10={};_0x198e10['model']=_[_0x5212('0x31')](db[_0x5212('0x2c')][_0x5212('0x2d')]);_0x31c6b1[_0x5212('0x35')]=_['intersection'](_0x198e10['model'],qs['fields'](_0x59ad81[_0x5212('0x32')][_0x5212('0x36')]));_0x31c6b1[_0x5212('0x35')]=_0x31c6b1['attributes'][_0x5212('0x37')]?_0x31c6b1[_0x5212('0x35')]:_0x198e10[_0x5212('0x34')];if(_0x59ad81[_0x5212('0x32')]['includeAll']){_0x31c6b1[_0x5212('0x45')]=[{'all':!![]}];}_0x31c6b1=_[_0x5212('0x40')]({},_0x31c6b1,_0x59ad81[_0x5212('0x49')]);return db['Attachment']['find'](_0x31c6b1)[_0x5212('0x25')](handleEntityNotFound(_0x2234eb,null))['then'](function(_0x2bee4c){if(_0x2bee4c){var _0x1bfef2=_0x2bee4c[_0x5212('0x4a')]({'plain':!![]});_0x1bfef2=qs[_0x5212('0x4b')](_0x1bfef2,['id',_0x5212('0x4c'),_0x5212('0x4d')]);_0x59ad81[_0x5212('0x4e')]=_[_0x5212('0x4b')](_0x59ad81[_0x5212('0x4e')],['id','createdAt',_0x5212('0x4d')]);return db[_0x5212('0x2c')][_0x5212('0x4f')](_[_0x5212('0x40')](_0x1bfef2,_0x59ad81[_0x5212('0x4e')]),{'include':_0x59ad81[_0x5212('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2234eb,0xc9))[_0x5212('0x47')](handleError(_0x2234eb,null));};exports[_0x5212('0x23')]=function(_0x2cfc7e,_0x4af814){if(_0x2cfc7e[_0x5212('0x4e')]['id']){delete _0x2cfc7e['body']['id'];}return db[_0x5212('0x2c')][_0x5212('0x46')]({'where':{'id':_0x2cfc7e['params']['id']}})[_0x5212('0x25')](handleEntityNotFound(_0x4af814,null))[_0x5212('0x25')](saveUpdates(_0x2cfc7e[_0x5212('0x4e')],null))[_0x5212('0x25')](respondWithResult(_0x4af814,null))[_0x5212('0x47')](handleError(_0x4af814,null));};exports['destroy']=function(_0x2e9d52,_0x515490){return db[_0x5212('0x2c')]['find']({'where':{'id':_0x2e9d52[_0x5212('0x48')]['id']}})[_0x5212('0x25')](handleEntityNotFound(_0x515490,null))[_0x5212('0x25')](removeEntity(_0x515490,null))[_0x5212('0x47')](handleError(_0x515490,null));};exports[_0x5212('0x4f')]=function(_0x28f57f,_0x17e7a3,_0x1c4198){_0x28f57f[_0x5212('0x4e')][_0x5212('0x29')]=_0x28f57f[_0x5212('0x50')][_0x5212('0x51')];_0x28f57f[_0x5212('0x4e')][_0x5212('0x52')]=_0x28f57f[_0x5212('0x50')][_0x5212('0x53')];_0x28f57f[_0x5212('0x4e')]['type']=_0x28f57f[_0x5212('0x50')][_0x5212('0x54')];return db[_0x5212('0x2c')][_0x5212('0x4f')](_0x28f57f[_0x5212('0x4e')])['then'](respondWithResult(_0x17e7a3,0xc9))[_0x5212('0x47')](handleError(_0x17e7a3,null));};exports['download']=function(_0x255c88,_0x3a451d,_0x31aa9e){return db['Attachment'][_0x5212('0x55')]({'where':{'id':_0x255c88[_0x5212('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3a451d,null))[_0x5212('0x25')](function(_0x43da25){if(_0x43da25){return _0x3a451d[_0x5212('0x56')](path['join'](config[_0x5212('0x57')],_0x5212('0x58'),_0x43da25[_0x5212('0x52')]));}})['catch'](handleError(_0x3a451d,null));}; \ No newline at end of file +var _0x053b=['lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','find','clone','createdAt','updatedAt','body','omit','create','file','filename','type','download','findOne','join','server/files/attachments/','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','sox','ejs'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x053b,0x1d1));var _0xb053=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x053b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb053('0x0'));var emlformat=require(_0xb053('0x1'));var rimraf=require(_0xb053('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb053('0x3'));var moment=require(_0xb053('0x4'));var BPromise=require(_0xb053('0x5'));var Mustache=require('mustache');var util=require(_0xb053('0x6'));var path=require('path');var sox=require(_0xb053('0x7'));var csv=require('to-csv');var ejs=require(_0xb053('0x8'));var fs=require('fs');var _=require(_0xb053('0x9'));var squel=require('squel');var crypto=require(_0xb053('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb053('0xb'));var querystring=require(_0xb053('0xc'));var Papa=require(_0xb053('0xd'));var Redis=require(_0xb053('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb053('0xf'));var hardwareService=require(_0xb053('0x10'));var logger=require(_0xb053('0x11'))(_0xb053('0x12'));var utils=require('../../config/utils');var config=require(_0xb053('0x13'));var db=require(_0xb053('0x14'))['db'];function respondWithStatusCode(_0x47be6d,_0x21dffc){_0x21dffc=_0x21dffc||0xcc;return function(_0x21612d){if(_0x21612d){return _0x47be6d[_0xb053('0x15')](_0x21dffc);}return _0x47be6d['status'](_0x21dffc)[_0xb053('0x16')]();};}function respondWithResult(_0x4c5689,_0x1ddde0){_0x1ddde0=_0x1ddde0||0xc8;return function(_0x3c416a){if(_0x3c416a){return _0x4c5689[_0xb053('0x17')](_0x1ddde0)['json'](_0x3c416a);}};}function respondWithFilteredResult(_0x2a7cda,_0x550c68){return function(_0x2b6980){if(_0x2b6980){var _0x2f3beb=_0x2b6980[_0xb053('0x18')],_0x4baa7b=_0x550c68[_0xb053('0x19')],_0x443bb9=_0x550c68[_0xb053('0x19')]+_0x550c68[_0xb053('0x1a')],_0x1bbdf0;if(_0x443bb9>=_0x2f3beb){_0x443bb9=_0x2f3beb;_0x1bbdf0=0xc8;}else{_0x1bbdf0=0xce;}_0x2a7cda[_0xb053('0x17')](_0x1bbdf0);return _0x2a7cda[_0xb053('0x1b')](_0xb053('0x1c'),_0x4baa7b+'-'+_0x443bb9+'/'+_0x2f3beb)[_0xb053('0x1d')](_0x2b6980);}return null;};}function patchUpdates(_0xacabf4){return function(_0x5727d6){try{jsonpatch[_0xb053('0x1e')](_0x5727d6,_0xacabf4,!![]);}catch(_0x32cd08){return BPromise[_0xb053('0x1f')](_0x32cd08);}return _0x5727d6['save']();};}function saveUpdates(_0x216f11,_0x121b92){return function(_0x4c6c26){if(_0x4c6c26){return _0x4c6c26[_0xb053('0x20')](_0x216f11)[_0xb053('0x21')](function(_0x41d8b2){return _0x41d8b2;});}return null;};}function removeEntity(_0x40d12e,_0x4f4a99){return function(_0x568a0d){if(_0x568a0d){return _0x568a0d[_0xb053('0x22')]()[_0xb053('0x21')](function(){_0x40d12e[_0xb053('0x17')](0xcc)[_0xb053('0x16')]();});}};}function handleEntityNotFound(_0x345ac9,_0x27a835){return function(_0x35330f){if(!_0x35330f){_0x345ac9[_0xb053('0x15')](0x194);}return _0x35330f;};}function handleError(_0x568b6b,_0x51a569){_0x51a569=_0x51a569||0x1f4;return function(_0x207b58){logger[_0xb053('0x23')](_0x207b58[_0xb053('0x24')]);if(_0x207b58['name']){delete _0x207b58[_0xb053('0x25')];}_0x568b6b[_0xb053('0x17')](_0x51a569)['send'](_0x207b58);};}exports['index']=function(_0xec5fef,_0x5d3333){var _0x58161d={},_0x426ca5={},_0x458222={'count':0x0,'rows':[]};var _0x1c75c5=_[_0xb053('0x26')](db[_0xb053('0x27')][_0xb053('0x28')],function(_0x43025c){return{'name':_0x43025c[_0xb053('0x29')],'type':_0x43025c['type'][_0xb053('0x2a')]};});_0x426ca5[_0xb053('0x2b')]=_[_0xb053('0x26')](_0x1c75c5,_0xb053('0x25'));_0x426ca5[_0xb053('0x2c')]=_[_0xb053('0x2d')](_0xec5fef[_0xb053('0x2c')]);_0x426ca5[_0xb053('0x2e')]=_[_0xb053('0x2f')](_0x426ca5['model'],_0x426ca5[_0xb053('0x2c')]);_0x58161d[_0xb053('0x30')]=_['intersection'](_0x426ca5['model'],qs[_0xb053('0x31')](_0xec5fef[_0xb053('0x2c')]['fields']));_0x58161d[_0xb053('0x30')]=_0x58161d[_0xb053('0x30')][_0xb053('0x32')]?_0x58161d[_0xb053('0x30')]:_0x426ca5['model'];if(!_0xec5fef[_0xb053('0x2c')][_0xb053('0x33')](_0xb053('0x34'))){_0x58161d[_0xb053('0x1a')]=qs[_0xb053('0x1a')](_0xec5fef['query']['limit']);_0x58161d[_0xb053('0x19')]=qs['offset'](_0xec5fef[_0xb053('0x2c')][_0xb053('0x19')]);}_0x58161d[_0xb053('0x35')]=qs[_0xb053('0x36')](_0xec5fef[_0xb053('0x2c')]['sort']);_0x58161d[_0xb053('0x37')]=qs['filters'](_['pick'](_0xec5fef[_0xb053('0x2c')],_0x426ca5[_0xb053('0x2e')]));if(_0xec5fef[_0xb053('0x2c')][_0xb053('0x38')]){_0x58161d['where']=_[_0xb053('0x39')](_0x58161d[_0xb053('0x37')],{'$or':_[_0xb053('0x26')](_0x1c75c5,function(_0x1dca0f){if(_0x1dca0f['type']!=='VIRTUAL'){var _0x55cebf={};_0x55cebf[_0x1dca0f[_0xb053('0x25')]]={'$like':'%'+_0xec5fef[_0xb053('0x2c')][_0xb053('0x38')]+'%'};return _0x55cebf;}})});}_0x58161d=_['merge']({},_0x58161d,_0xec5fef[_0xb053('0x3a')]);var _0x30914b={'where':_0x58161d[_0xb053('0x37')]};return db[_0xb053('0x27')][_0xb053('0x18')](_0x30914b)[_0xb053('0x21')](function(_0x1cdee4){_0x458222[_0xb053('0x18')]=_0x1cdee4;if(_0xec5fef['query'][_0xb053('0x3b')]){_0x58161d[_0xb053('0x3c')]=[{'all':!![]}];}return db[_0xb053('0x27')][_0xb053('0x3d')](_0x58161d);})[_0xb053('0x21')](function(_0x1259bb){_0x458222['rows']=_0x1259bb;return _0x458222;})[_0xb053('0x21')](respondWithFilteredResult(_0x5d3333,_0x58161d))[_0xb053('0x3e')](handleError(_0x5d3333,null));};exports[_0xb053('0x3f')]=function(_0x4eb920,_0x3b434d){var _0x4bcfe7={'raw':!![],'where':{'id':_0x4eb920[_0xb053('0x40')]['id']}},_0x248053={};_0x248053[_0xb053('0x2b')]=_['keys'](db[_0xb053('0x27')][_0xb053('0x28')]);_0x248053[_0xb053('0x2c')]=_['keys'](_0x4eb920['query']);_0x248053[_0xb053('0x2e')]=_[_0xb053('0x2f')](_0x248053[_0xb053('0x2b')],_0x248053[_0xb053('0x2c')]);_0x4bcfe7[_0xb053('0x30')]=_[_0xb053('0x2f')](_0x248053[_0xb053('0x2b')],qs[_0xb053('0x31')](_0x4eb920[_0xb053('0x2c')][_0xb053('0x31')]));_0x4bcfe7[_0xb053('0x30')]=_0x4bcfe7[_0xb053('0x30')][_0xb053('0x32')]?_0x4bcfe7[_0xb053('0x30')]:_0x248053[_0xb053('0x2b')];if(_0x4eb920['query'][_0xb053('0x3b')]){_0x4bcfe7['include']=[{'all':!![]}];}_0x4bcfe7=_[_0xb053('0x39')]({},_0x4bcfe7,_0x4eb920[_0xb053('0x3a')]);return db[_0xb053('0x27')][_0xb053('0x41')](_0x4bcfe7)['then'](handleEntityNotFound(_0x3b434d,null))[_0xb053('0x21')](respondWithResult(_0x3b434d,null))[_0xb053('0x3e')](handleError(_0x3b434d,null));};exports[_0xb053('0x42')]=function(_0x15882c,_0x185eb7){var _0x4a306c={'where':{'id':_0x15882c[_0xb053('0x40')]['id']}},_0x3848ec={};_0x3848ec[_0xb053('0x2b')]=_[_0xb053('0x2d')](db['Attachment'][_0xb053('0x28')]);_0x4a306c[_0xb053('0x30')]=_['intersection'](_0x3848ec['model'],qs[_0xb053('0x31')](_0x15882c[_0xb053('0x2c')][_0xb053('0x31')]));_0x4a306c[_0xb053('0x30')]=_0x4a306c['attributes']['length']?_0x4a306c[_0xb053('0x30')]:_0x3848ec[_0xb053('0x2b')];if(_0x15882c[_0xb053('0x2c')][_0xb053('0x3b')]){_0x4a306c[_0xb053('0x3c')]=[{'all':!![]}];}_0x4a306c=_[_0xb053('0x39')]({},_0x4a306c,_0x15882c[_0xb053('0x3a')]);return db['Attachment'][_0xb053('0x41')](_0x4a306c)[_0xb053('0x21')](handleEntityNotFound(_0x185eb7,null))[_0xb053('0x21')](function(_0x5f33de){if(_0x5f33de){var _0x2c73c7=_0x5f33de['get']({'plain':!![]});_0x2c73c7=qs['omit'](_0x2c73c7,['id',_0xb053('0x43'),_0xb053('0x44')]);_0x15882c[_0xb053('0x45')]=_[_0xb053('0x46')](_0x15882c['body'],['id',_0xb053('0x43'),_0xb053('0x44')]);return db[_0xb053('0x27')][_0xb053('0x47')](_[_0xb053('0x39')](_0x2c73c7,_0x15882c[_0xb053('0x45')]),{'include':_0x15882c['query'][_0xb053('0x3b')]?[{'all':!![]}]:undefined});}})[_0xb053('0x21')](respondWithResult(_0x185eb7,0xc9))[_0xb053('0x3e')](handleError(_0x185eb7,null));};exports['update']=function(_0x2ad279,_0x23d6ed){if(_0x2ad279['body']['id']){delete _0x2ad279[_0xb053('0x45')]['id'];}return db[_0xb053('0x27')][_0xb053('0x41')]({'where':{'id':_0x2ad279[_0xb053('0x40')]['id']}})[_0xb053('0x21')](handleEntityNotFound(_0x23d6ed,null))[_0xb053('0x21')](saveUpdates(_0x2ad279[_0xb053('0x45')],null))[_0xb053('0x21')](respondWithResult(_0x23d6ed,null))[_0xb053('0x3e')](handleError(_0x23d6ed,null));};exports['destroy']=function(_0x25b814,_0x9a2ee0){return db['Attachment'][_0xb053('0x41')]({'where':{'id':_0x25b814[_0xb053('0x40')]['id']}})['then'](handleEntityNotFound(_0x9a2ee0,null))[_0xb053('0x21')](removeEntity(_0x9a2ee0,null))['catch'](handleError(_0x9a2ee0,null));};exports['create']=function(_0xade7c1,_0x3a757b,_0x515e2b){_0xade7c1['body'][_0xb053('0x25')]=_0xade7c1['file']['originalname'];_0xade7c1['body']['basename']=_0xade7c1[_0xb053('0x48')][_0xb053('0x49')];_0xade7c1['body'][_0xb053('0x4a')]=_0xade7c1[_0xb053('0x48')]['mimetype'];return db[_0xb053('0x27')][_0xb053('0x47')](_0xade7c1['body'])[_0xb053('0x21')](respondWithResult(_0x3a757b,0xc9))[_0xb053('0x3e')](handleError(_0x3a757b,null));};exports[_0xb053('0x4b')]=function(_0xc77a76,_0x8892e5,_0x301b9a){return db[_0xb053('0x27')][_0xb053('0x4c')]({'where':{'id':_0xc77a76[_0xb053('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x8892e5,null))[_0xb053('0x21')](function(_0x4de5da){if(_0x4de5da){return _0x8892e5[_0xb053('0x4b')](path[_0xb053('0x4d')](config['root'],_0xb053('0x4e'),_0x4de5da['basename']));}})[_0xb053('0x3e')](handleError(_0x8892e5,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e53356d..b65c8e6 100644 --- a/server/api/attachment/attachment.model.js +++ b/server/api/attachment/attachment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf682=['path','rimraf','../../config/environment','exports','define','attachments','lodash','util','../../config/logger','api','request-promise'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xf682,0x12f));var _0x2f68=function(_0x1647af,_0x496d46){_0x1647af=_0x1647af-0x0;var _0x2964c2=_0xf682[_0x1647af];return _0x2964c2;};'use strict';var _=require(_0x2f68('0x0'));var util=require(_0x2f68('0x1'));var logger=require(_0x2f68('0x2'))(_0x2f68('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f68('0x4'));var fs=require('fs');var path=require(_0x2f68('0x5'));var rimraf=require(_0x2f68('0x6'));var config=require(_0x2f68('0x7'));var attributes=require('./attachment.attributes');module[_0x2f68('0x8')]=function(_0x46dd32,_0x6f92f6){return _0x46dd32[_0x2f68('0x9')]('Attachment',attributes,{'tableName':_0x2f68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa413=['attachments','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x3e24f1,_0xbd829a){var _0x48f50d=function(_0x23d15d){while(--_0x23d15d){_0x3e24f1['push'](_0x3e24f1['shift']());}};_0x48f50d(++_0xbd829a);}(_0xa413,0x1e5));var _0x3a41=function(_0x1e288c,_0x5027ef){_0x1e288c=_0x1e288c-0x0;var _0x3f5f50=_0xa413[_0x1e288c];return _0x3f5f50;};'use strict';var _=require(_0x3a41('0x0'));var util=require('util');var logger=require(_0x3a41('0x1'))('api');var moment=require(_0x3a41('0x2'));var BPromise=require(_0x3a41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3a41('0x4'));var config=require(_0x3a41('0x5'));var attributes=require(_0x3a41('0x6'));module[_0x3a41('0x7')]=function(_0x25d3e0,_0x1af004){return _0x25d3e0[_0x3a41('0x8')](_0x3a41('0x9'),attributes,{'tableName':_0x3a41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 6cc00c8..b9c8f44 100644 --- a/server/api/attachment/attachment.rpc.js +++ b/server/api/attachment/attachment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb33=['Attachment,\x20%s,\x20%s,\x20%s','code','error','Attachment,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','debug'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xeb33,0x184));var _0x3eb3=function(_0x3187f7,_0x37303c){_0x3187f7=_0x3187f7-0x0;var _0x498502=_0xeb33[_0x3187f7];return _0x498502;};'use strict';var _=require(_0x3eb3('0x0'));var util=require(_0x3eb3('0x1'));var moment=require(_0x3eb3('0x2'));var BPromise=require(_0x3eb3('0x3'));var rs=require(_0x3eb3('0x4'));var fs=require('fs');var Redis=require(_0x3eb3('0x5'));var db=require(_0x3eb3('0x6'))['db'];var utils=require(_0x3eb3('0x7'));var logger=require(_0x3eb3('0x8'))(_0x3eb3('0x9'));var config=require(_0x3eb3('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3eb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c96f0,_0x4f94c5,_0x32bc62){return new BPromise(function(_0x8b7c74,_0x339016){return client[_0x3eb3('0xc')](_0x4c96f0,_0x32bc62)[_0x3eb3('0xd')](function(_0x4898a2){logger['info']('Attachment,\x20%s,\x20%s',_0x4f94c5,'request\x20sent');logger[_0x3eb3('0xe')](_0x3eb3('0xf'),_0x4f94c5,'request\x20sent',JSON['stringify'](_0x4898a2));if(_0x4898a2['error']){if(_0x4898a2['error'][_0x3eb3('0x10')]===0x1f4){logger[_0x3eb3('0x11')](_0x3eb3('0x12'),_0x4f94c5,_0x4898a2[_0x3eb3('0x11')][_0x3eb3('0x13')]);return _0x339016(_0x4898a2[_0x3eb3('0x11')][_0x3eb3('0x13')]);}logger[_0x3eb3('0x11')](_0x3eb3('0x12'),_0x4f94c5,_0x4898a2[_0x3eb3('0x11')][_0x3eb3('0x13')]);return _0x8b7c74(_0x4898a2[_0x3eb3('0x11')][_0x3eb3('0x13')]);}else{logger['info'](_0x3eb3('0x12'),_0x4f94c5,_0x3eb3('0x14'));_0x8b7c74(_0x4898a2[_0x3eb3('0x15')][_0x3eb3('0x13')]);}})[_0x3eb3('0x16')](function(_0x3239da){logger[_0x3eb3('0x11')](_0x3eb3('0x12'),_0x4f94c5,_0x3239da);_0x339016(_0x3239da);});});}exports[_0x3eb3('0x17')]=function(_0x53c41e){var _0xc64ae9=this;return new Promise(function(_0x377729,_0x304c03){return db[_0x3eb3('0x18')][_0x3eb3('0x19')](_0x53c41e[_0x3eb3('0x1a')],{'raw':_0x53c41e[_0x3eb3('0x1b')]?_0x53c41e['options'][_0x3eb3('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xa32082){logger[_0x3eb3('0x1d')]('CreateAttachment',_0x53c41e);logger['debug'](_0x3eb3('0x17'),_0x53c41e,JSON[_0x3eb3('0x1e')](_0xa32082));_0x377729(_0xa32082);})[_0x3eb3('0x16')](function(_0x1b3dab){logger[_0x3eb3('0x11')](_0x3eb3('0x17'),_0x1b3dab[_0x3eb3('0x13')],_0x53c41e);_0x304c03(_0xc64ae9['error'](0x1f4,_0x1b3dab['message']));});});}; \ No newline at end of file +var _0x3a7c=['options','raw','then','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','error','message','catch','CreateAttachment','create','body'];(function(_0x3e9a7e,_0x25155f){var _0x4d2d77=function(_0x566f3b){while(--_0x566f3b){_0x3e9a7e['push'](_0x3e9a7e['shift']());}};_0x4d2d77(++_0x25155f);}(_0x3a7c,0x88));var _0xc3a7=function(_0x58379a,_0x1840de){_0x58379a=_0x58379a-0x0;var _0xf88d78=_0x3a7c[_0x58379a];return _0xf88d78;};'use strict';var _=require(_0xc3a7('0x0'));var util=require(_0xc3a7('0x1'));var moment=require(_0xc3a7('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3a7('0x3'));var fs=require('fs');var Redis=require(_0xc3a7('0x4'));var db=require(_0xc3a7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc3a7('0x6')][_0xc3a7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x248565,_0x2a9c51,_0x664278){return new BPromise(function(_0x7ad798,_0x42914e){return client[_0xc3a7('0x8')](_0x248565,_0x664278)['then'](function(_0x7ef3f1){logger[_0xc3a7('0x9')](_0xc3a7('0xa'),_0x2a9c51,_0xc3a7('0xb'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x2a9c51,_0xc3a7('0xb'),JSON['stringify'](_0x7ef3f1));if(_0x7ef3f1[_0xc3a7('0xc')]){if(_0x7ef3f1[_0xc3a7('0xc')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x2a9c51,_0x7ef3f1[_0xc3a7('0xc')][_0xc3a7('0xd')]);return _0x42914e(_0x7ef3f1['error']['message']);}logger[_0xc3a7('0xc')](_0xc3a7('0xa'),_0x2a9c51,_0x7ef3f1[_0xc3a7('0xc')][_0xc3a7('0xd')]);return _0x7ad798(_0x7ef3f1[_0xc3a7('0xc')][_0xc3a7('0xd')]);}else{logger['info'](_0xc3a7('0xa'),_0x2a9c51,_0xc3a7('0xb'));_0x7ad798(_0x7ef3f1['result'][_0xc3a7('0xd')]);}})[_0xc3a7('0xe')](function(_0x39efdf){logger['error'](_0xc3a7('0xa'),_0x2a9c51,_0x39efdf);_0x42914e(_0x39efdf);});});}exports[_0xc3a7('0xf')]=function(_0x4e02aa){var _0x13ce73=this;return new Promise(function(_0x1a04e1,_0x3c3117){return db['Attachment'][_0xc3a7('0x10')](_0x4e02aa[_0xc3a7('0x11')],{'raw':_0x4e02aa[_0xc3a7('0x12')]?_0x4e02aa[_0xc3a7('0x12')][_0xc3a7('0x13')]===undefined?!![]:![]:!![]})[_0xc3a7('0x14')](function(_0x10f45e){logger[_0xc3a7('0x9')](_0xc3a7('0xf'),_0x4e02aa);logger['debug']('CreateAttachment',_0x4e02aa,JSON[_0xc3a7('0x15')](_0x10f45e));_0x1a04e1(_0x10f45e);})[_0xc3a7('0xe')](function(_0x2c20f3){logger[_0xc3a7('0xc')](_0xc3a7('0xf'),_0x2c20f3[_0xc3a7('0xd')],_0x4e02aa);_0x3c3117(_0x13ce73[_0xc3a7('0xc')](0x1f4,_0x2c20f3[_0xc3a7('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 242391c..5b2ac95 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa282=['%s-%s','now','replace','single','file','create','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','download','post','/:id/clone','clone','diskStorage','join','server/files/attachments/','format'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xa282,0x189));var _0x2a28=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa282[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2a28('0x0'));var util=require(_0x2a28('0x1'));var path=require(_0x2a28('0x2'));var timeout=require(_0x2a28('0x3'));var express=require(_0x2a28('0x4'));var router=express[_0x2a28('0x5')]();var auth=require(_0x2a28('0x6'));var interaction=require(_0x2a28('0x7'));var config=require(_0x2a28('0x8'));var controller=require(_0x2a28('0x9'));router[_0x2a28('0xa')]('/',auth[_0x2a28('0xb')](),controller[_0x2a28('0xc')]);router['get']('/:id',auth[_0x2a28('0xb')](),controller[_0x2a28('0xd')]);router[_0x2a28('0xa')](_0x2a28('0xe'),auth['isAuthenticated'](),controller[_0x2a28('0xf')]);router[_0x2a28('0x10')](_0x2a28('0x11'),auth[_0x2a28('0xb')](),controller[_0x2a28('0x12')]);var upload=multer({'storage':multer[_0x2a28('0x13')]({'destination':function(_0x478842,_0x2cee00,_0x497bc6){_0x497bc6(null,path[_0x2a28('0x14')](config['root'],_0x2a28('0x15')));},'filename':function(_0x1a7ab5,_0x1e7640,_0x15d6a2){_0x15d6a2(null,util[_0x2a28('0x16')](_0x2a28('0x17'),Date[_0x2a28('0x18')](),_0x1e7640['originalname'][_0x2a28('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2a28('0x10')]('/',upload[_0x2a28('0x1a')](_0x2a28('0x1b')),controller[_0x2a28('0x1c')]);router['put'](_0x2a28('0x1d'),auth[_0x2a28('0xb')](),controller['update']);router[_0x2a28('0x1e')](_0x2a28('0x1d'),auth[_0x2a28('0xb')](),controller['destroy']);module[_0x2a28('0x1f')]=router; \ No newline at end of file +var _0x726f=['/:id/download','download','post','/:id/clone','join','root','format','%s-%s','now','originalname','replace','single','put','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2b96d6,_0x163b1b){var _0x5c5b20=function(_0x5d6ab1){while(--_0x5d6ab1){_0x2b96d6['push'](_0x2b96d6['shift']());}};_0x5c5b20(++_0x163b1b);}(_0x726f,0xa2));var _0xf726=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x726f[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xf726('0x0'));var util=require(_0xf726('0x1'));var path=require('path');var timeout=require(_0xf726('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf726('0x3'));var interaction=require(_0xf726('0x4'));var config=require(_0xf726('0x5'));var controller=require(_0xf726('0x6'));router[_0xf726('0x7')]('/',auth[_0xf726('0x8')](),controller[_0xf726('0x9')]);router[_0xf726('0x7')](_0xf726('0xa'),auth[_0xf726('0x8')](),controller[_0xf726('0xb')]);router[_0xf726('0x7')](_0xf726('0xc'),auth[_0xf726('0x8')](),controller[_0xf726('0xd')]);router[_0xf726('0xe')](_0xf726('0xf'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45eb25,_0x4dede6,_0x567bb5){_0x567bb5(null,path[_0xf726('0x10')](config[_0xf726('0x11')],'server/files/attachments/'));},'filename':function(_0x3cda34,_0x2f7a04,_0x1e6ae5){_0x1e6ae5(null,util[_0xf726('0x12')](_0xf726('0x13'),Date[_0xf726('0x14')](),_0x2f7a04[_0xf726('0x15')][_0xf726('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0xf726('0x17')]('file'),controller['create']);router[_0xf726('0x18')](_0xf726('0xa'),auth['isAuthenticated'](),controller[_0xf726('0x19')]);router[_0xf726('0x1a')](_0xf726('0xa'),auth['isAuthenticated'](),controller[_0xf726('0x1b')]);module[_0xf726('0x1c')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 14986fe..5e472be 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3da8=['signToken','login','authenticate','profile','email','google','/login','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','user','agent','disabled','blocked','blockedAt','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','catch','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service'];(function(_0x29efd8,_0x2bba80){var _0x283c58=function(_0x49aa76){while(--_0x49aa76){_0x29efd8['push'](_0x29efd8['shift']());}};_0x283c58(++_0x2bba80);}(_0x3da8,0xcd));var _0x83da=function(_0x2b3e62,_0x1cf54a){_0x2b3e62=_0x2b3e62-0x0;var _0x26ad91=_0x3da8[_0x2b3e62];return _0x26ad91;};'use strict';var _=require('lodash');var passport=require(_0x83da('0x0'));var GoogleStrategy=require(_0x83da('0x1'))[_0x83da('0x2')];var moment=require(_0x83da('0x3'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x83da('0x4'))[_0x83da('0x5')];var utils=require('../../config/utils');exports[_0x83da('0x6')]=passport[_0x83da('0x7')]('google',{'failureRedirect':'/login','scope':[_0x83da('0x8'),_0x83da('0x9')],'session':![]});exports['callback']=passport[_0x83da('0x7')](_0x83da('0xa'),{'failureRedirect':_0x83da('0xb'),'session':![]});passport[_0x83da('0xc')](new GoogleStrategy({'clientID':config[_0x83da('0xa')]?config[_0x83da('0xa')][_0x83da('0xd')]:'id','clientSecret':config[_0x83da('0xa')]?config[_0x83da('0xa')][_0x83da('0xe')]:'secret','callbackURL':config[_0x83da('0xa')]?config[_0x83da('0xa')][_0x83da('0xf')]:''},function(_0x544fe0,_0x5f55c6,_0x49df9f,_0x1af05e){var _0x2101ce,_0x504725;return db[_0x83da('0x10')][_0x83da('0x11')]({'where':{'id':0x1},'attributes':[_0x83da('0x12'),_0x83da('0x13')],'raw':!![]})[_0x83da('0x14')](function(_0x5e6f6f){_0x2101ce=_0x5e6f6f;return db[_0x83da('0x15')][_0x83da('0x16')]({'where':{'email':_[_0x83da('0x17')](_0x49df9f[_0x83da('0x18')],_0x83da('0x19')),'role':{'$or':['admin',_0x83da('0x1a'),_0x83da('0x1b')]}}});})[_0x83da('0x14')](function(_0x2adb5d){_0x504725=_0x2adb5d;if(_0x504725){if(_0x504725[_0x83da('0x1c')]){return _0x1af05e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2101ce[_0x83da('0x13')]>0x0){if(_0x504725[_0x83da('0x1d')]){if(moment(_0x504725[_0x83da('0x1e')])['add'](_0x2101ce[_0x83da('0x13')],_0x83da('0x1f'))>moment()){return _0x1af05e(_0x83da('0x20'));}else{return utils[_0x83da('0x21')](_0x504725,0x0,![],null)['then'](function(){return utils['getLicense'](_0x504725);})['then'](function(){return _0x1af05e(null,_0x504725);});}}else{return utils['getLicense'](_0x504725)[_0x83da('0x14')](function(){return _0x1af05e(null,_0x504725);});}}else{return utils['getLicense'](_0x504725)[_0x83da('0x14')](function(){return _0x1af05e(null,_0x504725);});}}return _0x1af05e(_0x83da('0x20'));})[_0x83da('0x22')](function(_0x547b1a){_0x1af05e(_0x547b1a);});})); \ No newline at end of file +var _0xb171=['blocked','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','authenticate','google','profile','email','callback','/login','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','emails','admin','then','disabled'];(function(_0x5ccb0f,_0x1a4b0f){var _0x284ea1=function(_0x4a1963){while(--_0x4a1963){_0x5ccb0f['push'](_0x5ccb0f['shift']());}};_0x284ea1(++_0x1a4b0f);}(_0xb171,0x13a));var _0x1b17=function(_0x1128fc,_0x537bc1){_0x1128fc=_0x1128fc-0x0;var _0x75e6b5=_0xb171[_0x1128fc];return _0x75e6b5;};'use strict';var _=require(_0x1b17('0x0'));var passport=require(_0x1b17('0x1'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0x1b17('0x2'));var db=require(_0x1b17('0x3'))['db'];var config=require(_0x1b17('0x4'));var signToken=require('../../components/auth/service')[_0x1b17('0x5')];var utils=require(_0x1b17('0x6'));exports[_0x1b17('0x7')]=passport[_0x1b17('0x8')](_0x1b17('0x9'),{'failureRedirect':'/login','scope':[_0x1b17('0xa'),_0x1b17('0xb')],'session':![]});exports[_0x1b17('0xc')]=passport[_0x1b17('0x8')](_0x1b17('0x9'),{'failureRedirect':_0x1b17('0xd'),'session':![]});passport[_0x1b17('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x1b17('0x9')]['clientID']:'id','clientSecret':config[_0x1b17('0x9')]?config['google'][_0x1b17('0xf')]:_0x1b17('0x10'),'callbackURL':config[_0x1b17('0x9')]?config[_0x1b17('0x9')][_0x1b17('0x11')]:''},function(_0x3935bb,_0x5d8e9b,_0xdb1089,_0xbcff58){var _0x3cdc81,_0x2c3484;return db[_0x1b17('0x12')][_0x1b17('0x13')]({'where':{'id':0x1},'attributes':[_0x1b17('0x14'),_0x1b17('0x15')],'raw':!![]})['then'](function(_0x1f5ea5){_0x3cdc81=_0x1f5ea5;return db['User']['find']({'where':{'email':_['map'](_0xdb1089[_0x1b17('0x16')],'value'),'role':{'$or':[_0x1b17('0x17'),'user','agent']}}});})[_0x1b17('0x18')](function(_0x39ffb6){_0x2c3484=_0x39ffb6;if(_0x2c3484){if(_0x2c3484[_0x1b17('0x19')]){return _0xbcff58('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x3cdc81[_0x1b17('0x15')]>0x0){if(_0x2c3484[_0x1b17('0x1a')]){if(moment(_0x2c3484[_0x1b17('0x1b')])[_0x1b17('0x1c')](_0x3cdc81[_0x1b17('0x15')],_0x1b17('0x1d'))>moment()){return _0xbcff58(_0x1b17('0x1e'));}else{return utils[_0x1b17('0x1f')](_0x2c3484,0x0,![],null)[_0x1b17('0x18')](function(){return utils[_0x1b17('0x20')](_0x2c3484);})[_0x1b17('0x18')](function(){return _0xbcff58(null,_0x2c3484);});}}else{return utils[_0x1b17('0x20')](_0x2c3484)[_0x1b17('0x18')](function(){return _0xbcff58(null,_0x2c3484);});}}else{return utils[_0x1b17('0x20')](_0x2c3484)[_0x1b17('0x18')](function(){return _0xbcff58(null,_0x2c3484);});}}return _0xbcff58(_0x1b17('0x1e'));})[_0x1b17('0x21')](function(_0x1cf4e1){_0xbcff58(_0x1cf4e1);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 1e6970d..c05c05a 100644 --- a/server/api/authGoogle/index.js +++ b/server/api/authGoogle/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61a1=['get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0xa71282,_0x297242){var _0x407c22=function(_0x3750ff){while(--_0x3750ff){_0xa71282['push'](_0xa71282['shift']());}};_0x407c22(++_0x297242);}(_0x61a1,0x127));var _0x161a=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0x61a1[_0x4cfa2e];return _0x279b50;};'use strict';var express=require(_0x161a('0x0'));var passport=require(_0x161a('0x1'));var router=express[_0x161a('0x2')]();var controller=require(_0x161a('0x3'));var userController=require(_0x161a('0x4'));var authService=require('../../components/auth/service');router[_0x161a('0x5')]('/',controller[_0x161a('0x6')]);router['get'](_0x161a('0x7'),controller[_0x161a('0x8')],authService[_0x161a('0x9')],userController[_0x161a('0x6')],authService[_0x161a('0xa')]);module[_0x161a('0xb')]=router; \ No newline at end of file +var _0x7834=['./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express'];(function(_0x5a4dcf,_0x1b2006){var _0xa1b977=function(_0x407a3e){while(--_0x407a3e){_0x5a4dcf['push'](_0x5a4dcf['shift']());}};_0xa1b977(++_0x1b2006);}(_0x7834,0x13f));var _0x4783=function(_0x25198d,_0x5e2bce){_0x25198d=_0x25198d-0x0;var _0x273fd2=_0x7834[_0x25198d];return _0x273fd2;};'use strict';var express=require(_0x4783('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x4783('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x4783('0x2'));router[_0x4783('0x3')]('/',controller[_0x4783('0x4')]);router[_0x4783('0x3')](_0x4783('0x5'),controller[_0x4783('0x6')],authService[_0x4783('0x7')],userController['login'],authService[_0x4783('0x8')]);module[_0x4783('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 8790143..a6cbf01 100644 --- a/server/api/authLocal/authLocal.controller.js +++ b/server/api/authLocal/authLocal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c6d=['You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','message','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x422a88,_0x1a8f93){var _0x5e4b44=function(_0x37cceb){while(--_0x37cceb){_0x422a88['push'](_0x422a88['shift']());}};_0x5e4b44(++_0x1a8f93);}(_0x2c6d,0x64));var _0xd2c6=function(_0x4c7688,_0x203c6f){_0x4c7688=_0x4c7688-0x0;var _0x50793b=_0x2c6d[_0x4c7688];return _0x50793b;};'use strict';var util=require(_0xd2c6('0x0'));var passport=require(_0xd2c6('0x1'));var LocalStrategy=require(_0xd2c6('0x2'))[_0xd2c6('0x3')];var jayson=require(_0xd2c6('0x4'));var _=require(_0xd2c6('0x5'));var rs=require(_0xd2c6('0x6'));var moment=require(_0xd2c6('0x7'));var db=require(_0xd2c6('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd2c6('0x9'));var client=jayson[_0xd2c6('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x356557,_0xa3b42c,_0xb9e2a5,_0x23af93){var _0x47ef31,_0x33648b;return db['Setting'][_0xd2c6('0xb')]({'where':{'id':0x1},'attributes':[_0xd2c6('0xc'),_0xd2c6('0xd')],'raw':!![]})[_0xd2c6('0xe')](function(_0x3285f3){_0x47ef31=_0x3285f3;return _0x356557[_0xd2c6('0xb')]({'attributes':['id','name',_0xd2c6('0xf'),_0xd2c6('0x10'),_0xd2c6('0x11'),_0xd2c6('0x12'),_0xd2c6('0x13'),_0xd2c6('0x14'),_0xd2c6('0x15')],'where':{'name':_0xa3b42c,'role':{'$or':[_0xd2c6('0x16'),'user',_0xd2c6('0x17')]}}});})[_0xd2c6('0xe')](function(_0x11cb6b){if(!_0x11cb6b||_0x11cb6b&&_0x11cb6b[_0xd2c6('0x18')]!==_0xa3b42c){throw new Error(_0xd2c6('0x19'));}else{_0x33648b=_0x11cb6b;return _0x33648b;}})['then'](function(){_0x33648b[_0xd2c6('0x1a')](_0xb9e2a5,function(_0x4f9007,_0xeba1e0){var _0x52b690=_0x33648b['loginAttempts']+0x1;if(_0x4f9007){return _0x23af93(_0x4f9007);}else if(!_0xeba1e0){if(_0x33648b[_0xd2c6('0x12')]){return _0x23af93(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x47ef31[_0xd2c6('0xc')]>0x0){if(_0x33648b[_0xd2c6('0x13')]){if(_0x47ef31[_0xd2c6('0xd')]>0x0){if(moment(_0x33648b['blockedAt'])[_0xd2c6('0x1b')](_0x47ef31[_0xd2c6('0xd')],_0xd2c6('0x1c'))>moment()){return _0x23af93(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x33648b,_0x52b690,![],null)['then'](function(){return _0x23af93(null,![],{'message':_0xd2c6('0x19')});});}}else{return _0x23af93(null,![],{'message':_0xd2c6('0x19')});}}else{if(_0x52b690>=_0x47ef31['allowedLoginAttempts']){return utils['clearBlockUser'](_0x33648b,0x0,!![],moment())[_0xd2c6('0xe')](function(){return _0x23af93(null,![],{'message':_0xd2c6('0x19')});});}else{return utils[_0xd2c6('0x1d')](_0x33648b,_0x52b690,![],null)[_0xd2c6('0xe')](function(){return _0x23af93(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x23af93(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x33648b[_0xd2c6('0x12')]){return _0x23af93(null,![],{'message':_0xd2c6('0x19')});}else if(_0x47ef31[_0xd2c6('0xc')]>0x0){if(_0x33648b['blocked']){if(_0x47ef31[_0xd2c6('0xd')]>0x0){if(moment(_0x33648b[_0xd2c6('0x14')])[_0xd2c6('0x1b')](_0x47ef31[_0xd2c6('0xd')],_0xd2c6('0x1c'))>moment()){return _0x23af93(null,![],{'message':_0xd2c6('0x19')});}else{return utils['clearBlockUser'](_0x33648b,0x0,![],null)[_0xd2c6('0xe')](function(){return utils[_0xd2c6('0x1e')](_0x33648b);})['then'](function(){return _0x23af93(null,_0x33648b);});}}else{return _0x23af93(null,![],{'message':_0xd2c6('0x19')});}}else{return utils[_0xd2c6('0x1d')](_0x33648b,0x0,![],null)[_0xd2c6('0xe')](function(){return utils[_0xd2c6('0x1e')](_0x33648b);})['then'](function(){return _0x23af93(null,_0x33648b);})['catch'](function(_0x5bc59c){return _0x23af93(null,![],_0x5bc59c);});}}else{if(_0x33648b['blocked']){return _0x23af93(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xd2c6('0x1e')](_0x33648b)[_0xd2c6('0xe')](function(){return _0x23af93(null,_0x33648b);});}}}});})[_0xd2c6('0x1f')](function(_0x357da5){return _0x23af93(null,![],_0x357da5);});}function sendServiceMail(_0x2e942d){return db['MailAccount'][_0xd2c6('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xd2c6('0x21')],'include':[{'model':db['MailServerOut'],'as':_0xd2c6('0x22')}]})[_0xd2c6('0xe')](function(_0x2e60ca){if(!_0x2e60ca){throw new Error(_0xd2c6('0x23'));}var _0x1db4de={'tls':{'rejectUnauthorized':![]}};if(_0x2e60ca[_0xd2c6('0x22')][_0xd2c6('0x24')]){_0x1db4de[_0xd2c6('0x24')]=_0x2e60ca['Smtp']['service'];}else{_0x1db4de[_0xd2c6('0x25')]=_0x2e60ca[_0xd2c6('0x22')][_0xd2c6('0x25')];_0x1db4de[_0xd2c6('0x26')]=_0x2e60ca['Smtp'][_0xd2c6('0x26')];_0x1db4de[_0xd2c6('0x27')]=_0x2e60ca['Smtp'][_0xd2c6('0x27')];}if(_0x2e60ca[_0xd2c6('0x22')][_0xd2c6('0x28')]){_0x1db4de[_0xd2c6('0x29')]={'user':_0x2e60ca['Smtp'][_0xd2c6('0x2a')],'pass':_0x2e60ca[_0xd2c6('0x22')][_0xd2c6('0x2b')]};}var _0x409507={'account':_0x1db4de,'message':_[_0xd2c6('0x2c')]({'from':util[_0xd2c6('0x2d')]('\x22%s\x22\x20<%s>',_0x2e60ca[_0xd2c6('0x18')],_0x2e60ca['email']||_0x2e60ca['Smtp'][_0xd2c6('0x2a')])},_0x2e942d)};return client[_0xd2c6('0x2e')](_0xd2c6('0x2f'),_0x409507);})[_0xd2c6('0xe')](function(_0x38388e){if(_0x38388e[_0xd2c6('0x30')]){throw new Error(util[_0xd2c6('0x2d')](_0xd2c6('0x31'),_0x38388e[_0xd2c6('0x30')]['message']||JSON[_0xd2c6('0x32')](_0x38388e[_0xd2c6('0x30')])));}return!![];});}function handleError(_0x1d990c,_0x580418,_0x12a045){return _0x1d990c[_0xd2c6('0x33')](_0x580418||0x1f4)['send']({'message':_0x12a045?_0x12a045[_0xd2c6('0x34')]||_0x12a045:''});}function checkPasswordPattern(_0xd06c01,_0x52376a,_0x29430e){if(_0x29430e){var _0x505669=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x505669[_0xd2c6('0x35')](_0x52376a)){return _0xd06c01;}else{throw new Error(_0xd2c6('0x36'));}}else{return _0xd06c01;}}exports[_0xd2c6('0x37')]=function(_0x109d9e,_0x415579,_0x3ff469){passport['authenticate'](_0xd2c6('0x38'),function(_0x572f38,_0xd64406,_0x14c6d8){var _0x940f1d=_0x572f38||_0x14c6d8;if(_0x940f1d){return handleError(_0x415579,0x191,_0x940f1d);}if(!_0xd64406){return handleError(_0x415579,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4d8f15={'payload':{'id':_0xd64406['id'],'role':_0xd64406[_0xd2c6('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xd2c6('0x39')](_0x4d8f15)[_0xd2c6('0xe')](function(_0x35a90f){_0x415579[_0xd2c6('0x3a')]({'id':_0xd64406['id'],'token':_0x35a90f,'statusCall':'','isAlreadyLogged':_0xd64406[_0xd2c6('0x3b')]});});}})(_0x109d9e,_0x415579,_0x3ff469);};exports[_0xd2c6('0x3c')]=function(_0x30ba71,_0x217c9a,_0x250e60){if(!_0x30ba71[_0xd2c6('0x3d')][_0xd2c6('0x21')]){return handleError(_0x217c9a,0x1f4,{'message':_0xd2c6('0x3e')});}var _0x168583=rs[_0xd2c6('0x3f')]();_0x30ba71[_0xd2c6('0x3d')][_0xd2c6('0x21')]=_0x30ba71['body'][_0xd2c6('0x21')][_0xd2c6('0x40')]()[_0xd2c6('0x41')]();var _0x3cb2e6;return db[_0xd2c6('0x42')][_0xd2c6('0xb')]({'where':{'id':0x1},'attributes':[_0xd2c6('0xc'),_0xd2c6('0xd')],'raw':!![]})[_0xd2c6('0xe')](function(_0x21c692){_0x3cb2e6=_0x21c692;return db[_0xd2c6('0x43')][_0xd2c6('0x20')]({'where':{'email':_0x30ba71[_0xd2c6('0x3d')][_0xd2c6('0x21')]}});})[_0xd2c6('0xe')](function(_0xcd6eca){if(!_0xcd6eca){throw new Error(_0xd2c6('0x44'));}if(_0xcd6eca[_0xd2c6('0x12')]){throw new Error(_0xd2c6('0x45'));}if(_0xcd6eca[_0xd2c6('0x13')]){if(moment(_0xcd6eca[_0xd2c6('0x14')])[_0xd2c6('0x1b')](_0x3cb2e6[_0xd2c6('0xd')],_0xd2c6('0x1c'))>moment()){throw new Error(_0xd2c6('0x46'));}else{_0xcd6eca[_0xd2c6('0x13')]=![];_0xcd6eca[_0xd2c6('0x14')]=null;}}_0xcd6eca[_0xd2c6('0x47')]=_0x168583;_0xcd6eca[_0xd2c6('0x48')]=Date[_0xd2c6('0x49')]()+0x36ee80;return _0xcd6eca[_0xd2c6('0x4a')]();})[_0xd2c6('0xe')](function(){return sendServiceMail({'to':_0x30ba71[_0xd2c6('0x3d')][_0xd2c6('0x21')],'subject':_0xd2c6('0x4b'),'text':_0xd2c6('0x4c')+_0xd2c6('0x4d')+_0xd2c6('0x4e')+_0x30ba71[_0xd2c6('0x4f')][_0xd2c6('0x25')]+_0xd2c6('0x50')+_0x168583+'\x0a\x0a'+_0xd2c6('0x51')});})[_0xd2c6('0xe')](function(){_0x217c9a[_0xd2c6('0x33')](0xc8)[_0xd2c6('0x52')]({'message':_0xd2c6('0x53')});})[_0xd2c6('0x1f')](function(_0x3e8bf6){return handleError(_0x217c9a,0x1f4,_0x3e8bf6);});};exports['reset']=function(_0x1ca4ed,_0x3ea53e,_0x5ce796){var _0xb7266b;return db[_0xd2c6('0x43')]['find']({'where':{'resetPasswordToken':_0x1ca4ed[_0xd2c6('0x54')][_0xd2c6('0x55')],'resetPasswordExpires':{'$gt':Date[_0xd2c6('0x49')]()}}})['then'](function(_0x3cffdc){_0xb7266b=_0x3cffdc;if(!_0xb7266b){throw new Error(_0xd2c6('0x56'));}return db['Setting'][_0xd2c6('0xb')]({'attributes':['id','securePassword']});})[_0xd2c6('0xe')](function(_0x4db804){return checkPasswordPattern(_0x4db804,_0x1ca4ed['body']['password'],_0x4db804['securePassword']);})[_0xd2c6('0xe')](function(){_0xb7266b[_0xd2c6('0xf')]=_0x1ca4ed[_0xd2c6('0x3d')]['password'];_0xb7266b[_0xd2c6('0x47')]=null;_0xb7266b[_0xd2c6('0x48')]=null;return _0xb7266b[_0xd2c6('0x4a')]();})[_0xd2c6('0xe')](function(){_0x3ea53e[_0xd2c6('0x33')](0xc8)['send']({'message':_0xd2c6('0x57')});})[_0xd2c6('0x1f')](function(_0x14b232){return handleError(_0x3ea53e,0x1f4,_0x14b232);});};passport['use'](new LocalStrategy({'usernameField':_0xd2c6('0x18'),'passwordField':_0xd2c6('0xf')},function(_0x2f1315,_0x34d833,_0x2950d4){return localAuthenticate(db[_0xd2c6('0x43')],_0x2f1315,_0x34d833,_0x2950d4);})); \ No newline at end of file +var _0x5943=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','resetPasswordToken','Password\x20reset!','util','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','name','role','blocked','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','auth','pass','merge','format','request','SendMail'];(function(_0x193d3f,_0x1e1d2e){var _0x330b35=function(_0x300766){while(--_0x300766){_0x193d3f['push'](_0x193d3f['shift']());}};_0x330b35(++_0x1e1d2e);}(_0x5943,0x168));var _0x3594=function(_0x4885ec,_0x3a01fb){_0x4885ec=_0x4885ec-0x0;var _0x58631f=_0x5943[_0x4885ec];return _0x58631f;};'use strict';var util=require(_0x3594('0x0'));var passport=require(_0x3594('0x1'));var LocalStrategy=require(_0x3594('0x2'))['Strategy'];var jayson=require(_0x3594('0x3'));var _=require('lodash');var rs=require(_0x3594('0x4'));var moment=require(_0x3594('0x5'));var db=require(_0x3594('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x3594('0x7'));var client=jayson[_0x3594('0x8')][_0x3594('0x9')]({'port':0x232b});function localAuthenticate(_0x114190,_0x572ef4,_0x400053,_0x114427){var _0x124f37,_0x3212b6;return db[_0x3594('0xa')][_0x3594('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3594('0xc')],'raw':!![]})['then'](function(_0x389542){_0x124f37=_0x389542;return _0x114190[_0x3594('0xb')]({'attributes':['id',_0x3594('0xd'),'password','salt',_0x3594('0xe'),'disabled',_0x3594('0xf'),'blockedAt',_0x3594('0x10')],'where':{'name':_0x572ef4,'role':{'$or':['admin',_0x3594('0x11'),_0x3594('0x12')]}}});})[_0x3594('0x13')](function(_0x1ca4ae){if(!_0x1ca4ae||_0x1ca4ae&&_0x1ca4ae[_0x3594('0xd')]!==_0x572ef4){throw new Error(_0x3594('0x14'));}else{_0x3212b6=_0x1ca4ae;return _0x3212b6;}})[_0x3594('0x13')](function(){_0x3212b6[_0x3594('0x15')](_0x400053,function(_0x4ccb5c,_0x5647f5){var _0x42fe1d=_0x3212b6['loginAttempts']+0x1;if(_0x4ccb5c){return _0x114427(_0x4ccb5c);}else if(!_0x5647f5){if(_0x3212b6[_0x3594('0x16')]){return _0x114427(null,![],{'message':_0x3594('0x14')});}else if(_0x124f37[_0x3594('0x17')]>0x0){if(_0x3212b6[_0x3594('0xf')]){if(_0x124f37[_0x3594('0xc')]>0x0){if(moment(_0x3212b6[_0x3594('0x18')])[_0x3594('0x19')](_0x124f37[_0x3594('0xc')],_0x3594('0x1a'))>moment()){return _0x114427(null,![],{'message':_0x3594('0x14')});}else{return utils[_0x3594('0x1b')](_0x3212b6,_0x42fe1d,![],null)['then'](function(){return _0x114427(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x114427(null,![],{'message':_0x3594('0x14')});}}else{if(_0x42fe1d>=_0x124f37[_0x3594('0x17')]){return utils['clearBlockUser'](_0x3212b6,0x0,!![],moment())[_0x3594('0x13')](function(){return _0x114427(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x3594('0x1b')](_0x3212b6,_0x42fe1d,![],null)['then'](function(){return _0x114427(null,![],{'message':_0x3594('0x14')});});}}}else{return _0x114427(null,![],{'message':_0x3594('0x14')});}}else{if(_0x3212b6[_0x3594('0x16')]){return _0x114427(null,![],{'message':_0x3594('0x14')});}else if(_0x124f37[_0x3594('0x17')]>0x0){if(_0x3212b6[_0x3594('0xf')]){if(_0x124f37[_0x3594('0xc')]>0x0){if(moment(_0x3212b6[_0x3594('0x18')])[_0x3594('0x19')](_0x124f37[_0x3594('0xc')],_0x3594('0x1a'))>moment()){return _0x114427(null,![],{'message':_0x3594('0x14')});}else{return utils[_0x3594('0x1b')](_0x3212b6,0x0,![],null)[_0x3594('0x13')](function(){return utils[_0x3594('0x1c')](_0x3212b6);})[_0x3594('0x13')](function(){return _0x114427(null,_0x3212b6);});}}else{return _0x114427(null,![],{'message':_0x3594('0x14')});}}else{return utils[_0x3594('0x1b')](_0x3212b6,0x0,![],null)['then'](function(){return utils[_0x3594('0x1c')](_0x3212b6);})[_0x3594('0x13')](function(){return _0x114427(null,_0x3212b6);})['catch'](function(_0x34e9e7){return _0x114427(null,![],_0x34e9e7);});}}else{if(_0x3212b6[_0x3594('0xf')]){return _0x114427(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x3212b6)[_0x3594('0x13')](function(){return _0x114427(null,_0x3212b6);});}}}});})[_0x3594('0x1d')](function(_0xf89434){return _0x114427(null,![],_0xf89434);});}function sendServiceMail(_0x37d687){return db['MailAccount'][_0x3594('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3594('0xd'),_0x3594('0x1f')],'include':[{'model':db[_0x3594('0x20')],'as':'Smtp'}]})['then'](function(_0x544553){if(!_0x544553){throw new Error(_0x3594('0x21'));}var _0x1084a4={'tls':{'rejectUnauthorized':![]}};if(_0x544553['Smtp'][_0x3594('0x22')]){_0x1084a4[_0x3594('0x22')]=_0x544553[_0x3594('0x23')][_0x3594('0x22')];}else{_0x1084a4[_0x3594('0x24')]=_0x544553[_0x3594('0x23')][_0x3594('0x24')];_0x1084a4[_0x3594('0x25')]=_0x544553[_0x3594('0x23')]['port'];_0x1084a4[_0x3594('0x26')]=_0x544553[_0x3594('0x23')]['secure'];}if(_0x544553['Smtp']['authentication']){_0x1084a4[_0x3594('0x27')]={'user':_0x544553[_0x3594('0x23')][_0x3594('0x11')],'pass':_0x544553['Smtp'][_0x3594('0x28')]};}var _0x275d0c={'account':_0x1084a4,'message':_[_0x3594('0x29')]({'from':util[_0x3594('0x2a')]('\x22%s\x22\x20<%s>',_0x544553[_0x3594('0xd')],_0x544553['email']||_0x544553['Smtp'][_0x3594('0x11')])},_0x37d687)};return client[_0x3594('0x2b')](_0x3594('0x2c'),_0x275d0c);})['then'](function(_0x306319){if(_0x306319[_0x3594('0x2d')]){throw new Error(util[_0x3594('0x2a')](_0x3594('0x2e'),_0x306319[_0x3594('0x2d')][_0x3594('0x2f')]||JSON[_0x3594('0x30')](_0x306319[_0x3594('0x2d')])));}return!![];});}function handleError(_0x240cb3,_0x5bce5d,_0x26abac){return _0x240cb3[_0x3594('0x31')](_0x5bce5d||0x1f4)[_0x3594('0x32')]({'message':_0x26abac?_0x26abac[_0x3594('0x2f')]||_0x26abac:''});}function checkPasswordPattern(_0xbdef4,_0x5e4ce4,_0x5056f9){if(_0x5056f9){var _0x41d069=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41d069[_0x3594('0x33')](_0x5e4ce4)){return _0xbdef4;}else{throw new Error(_0x3594('0x34'));}}else{return _0xbdef4;}}exports[_0x3594('0x35')]=function(_0x11a709,_0xe93d48,_0x14db80){passport['authenticate'](_0x3594('0x36'),function(_0x34f573,_0x23ab77,_0x3b537b){var _0x316226=_0x34f573||_0x3b537b;if(_0x316226){return handleError(_0xe93d48,0x191,_0x316226);}if(!_0x23ab77){return handleError(_0xe93d48,0x194,{'message':_0x3594('0x37')});}else{var _0x51f672={'payload':{'id':_0x23ab77['id'],'role':_0x23ab77[_0x3594('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x3594('0x38')](_0x51f672)[_0x3594('0x13')](function(_0x264dd9){_0xe93d48[_0x3594('0x39')]({'id':_0x23ab77['id'],'token':_0x264dd9,'statusCall':'','isAlreadyLogged':_0x23ab77['online']});});}})(_0x11a709,_0xe93d48,_0x14db80);};exports['forgot']=function(_0x34d070,_0x4a0542,_0x3a3270){if(!_0x34d070[_0x3594('0x3a')]['email']){return handleError(_0x4a0542,0x1f4,{'message':_0x3594('0x3b')});}var _0x2dc684=rs['generate']();_0x34d070[_0x3594('0x3a')][_0x3594('0x1f')]=_0x34d070[_0x3594('0x3a')][_0x3594('0x1f')][_0x3594('0x3c')]()['toLowerCase']();var _0x140722;return db[_0x3594('0xa')][_0x3594('0xb')]({'where':{'id':0x1},'attributes':[_0x3594('0x17'),_0x3594('0xc')],'raw':!![]})[_0x3594('0x13')](function(_0x5a7611){_0x140722=_0x5a7611;return db[_0x3594('0x3d')][_0x3594('0x1e')]({'where':{'email':_0x34d070[_0x3594('0x3a')]['email']}});})[_0x3594('0x13')](function(_0x4a4b71){if(!_0x4a4b71){throw new Error(_0x3594('0x3e'));}if(_0x4a4b71['disabled']){throw new Error(_0x3594('0x3f'));}if(_0x4a4b71[_0x3594('0xf')]){if(moment(_0x4a4b71[_0x3594('0x18')])[_0x3594('0x19')](_0x140722['blockDuration'],_0x3594('0x1a'))>moment()){throw new Error(_0x3594('0x40'));}else{_0x4a4b71[_0x3594('0xf')]=![];_0x4a4b71[_0x3594('0x18')]=null;}}_0x4a4b71['resetPasswordToken']=_0x2dc684;_0x4a4b71[_0x3594('0x41')]=Date[_0x3594('0x42')]()+0x36ee80;return _0x4a4b71[_0x3594('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x34d070[_0x3594('0x3a')]['email'],'subject':_0x3594('0x44'),'text':_0x3594('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x3594('0x46')+_0x34d070[_0x3594('0x47')][_0x3594('0x24')]+'/reset/'+_0x2dc684+'\x0a\x0a'+_0x3594('0x48')});})[_0x3594('0x13')](function(){_0x4a0542[_0x3594('0x31')](0xc8)[_0x3594('0x32')]({'message':_0x3594('0x49')});})['catch'](function(_0x387efc){return handleError(_0x4a0542,0x1f4,_0x387efc);});};exports[_0x3594('0x4a')]=function(_0x1d0a1f,_0xe14402,_0x18a460){var _0x46185c;return db[_0x3594('0x3d')][_0x3594('0x1e')]({'where':{'resetPasswordToken':_0x1d0a1f['params'][_0x3594('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x3594('0x42')]()}}})['then'](function(_0x5ba8cf){_0x46185c=_0x5ba8cf;if(!_0x46185c){throw new Error(_0x3594('0x4c'));}return db[_0x3594('0xa')][_0x3594('0xb')]({'attributes':['id',_0x3594('0x4d')]});})[_0x3594('0x13')](function(_0x1774a4){return checkPasswordPattern(_0x1774a4,_0x1d0a1f[_0x3594('0x3a')][_0x3594('0x4e')],_0x1774a4[_0x3594('0x4d')]);})[_0x3594('0x13')](function(){_0x46185c['password']=_0x1d0a1f['body']['password'];_0x46185c[_0x3594('0x4f')]=null;_0x46185c[_0x3594('0x41')]=null;return _0x46185c[_0x3594('0x43')]();})[_0x3594('0x13')](function(){_0xe14402[_0x3594('0x31')](0xc8)[_0x3594('0x32')]({'message':_0x3594('0x50')});})['catch'](function(_0x115884){return handleError(_0xe14402,0x1f4,_0x115884);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x3594('0x4e')},function(_0x1e3c68,_0x4730a6,_0x36412b){return localAuthenticate(db['User'],_0x1e3c68,_0x4730a6,_0x36412b);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index ad06833..015deca 100644 --- a/server/api/authLocal/index.js +++ b/server/api/authLocal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff5f=['/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller','post'];(function(_0xc58e33,_0x1cebff){var _0x4864f8=function(_0x4f0450){while(--_0x4f0450){_0xc58e33['push'](_0xc58e33['shift']());}};_0x4864f8(++_0x1cebff);}(_0xff5f,0xfc));var _0xfff5=function(_0x721f9d,_0x3bb672){_0x721f9d=_0x721f9d-0x0;var _0x4b87c1=_0xff5f[_0x721f9d];return _0x4b87c1;};'use strict';var express=require(_0xfff5('0x0'));var router=express[_0xfff5('0x1')]();var controller=require(_0xfff5('0x2'));router[_0xfff5('0x3')]('/',controller['login']);router[_0xfff5('0x3')](_0xfff5('0x4'),controller[_0xfff5('0x5')]);router[_0xfff5('0x3')](_0xfff5('0x6'),controller[_0xfff5('0x7')]);module['exports']=router; \ No newline at end of file +var _0xa1ef=['exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x9b22b0,_0x321763){var _0x2b64db=function(_0x5f1e4a){while(--_0x5f1e4a){_0x9b22b0['push'](_0x9b22b0['shift']());}};_0x2b64db(++_0x321763);}(_0xa1ef,0xb0));var _0xfa1e=function(_0x4c1f1f,_0x3aa18d){_0x4c1f1f=_0x4c1f1f-0x0;var _0x4f9e3c=_0xa1ef[_0x4c1f1f];return _0x4f9e3c;};'use strict';var express=require(_0xfa1e('0x0'));var router=express[_0xfa1e('0x1')]();var controller=require(_0xfa1e('0x2'));router[_0xfa1e('0x3')]('/',controller[_0xfa1e('0x4')]);router[_0xfa1e('0x3')]('/forgot',controller[_0xfa1e('0x5')]);router['post']('/reset/:token',controller['reset']);module[_0xfa1e('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 1bd5ed9..93ed049 100644 --- a/server/api/automation/automation.attributes.js +++ b/server/api/automation/automation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8127=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x8127,0x198));var _0x7812=function(_0x4ca8f7,_0x3128f8){_0x4ca8f7=_0x4ca8f7-0x0;var _0x22a437=_0x8127[_0x4ca8f7];return _0x22a437;};'use strict';var Sequelize=require('sequelize');module[_0x7812('0x0')]={'name':{'type':Sequelize[_0x7812('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x7812('0x1')]},'description':{'type':Sequelize[_0x7812('0x1')]},'status':{'type':Sequelize[_0x7812('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7812('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xc6f7=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xc6f7,0x190));var _0x7c6f=function(_0x2af347,_0x25b96a){_0x2af347=_0x2af347-0x0;var _0x48ad01=_0xc6f7[_0x2af347];return _0x48ad01;};'use strict';var Sequelize=require(_0x7c6f('0x0'));module[_0x7c6f('0x1')]={'name':{'type':Sequelize[_0x7c6f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7c6f('0x2')]},'description':{'type':Sequelize[_0x7c6f('0x2')]},'status':{'type':Sequelize[_0x7c6f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 2213c5e..11ee162 100644 --- a/server/api/automation/automation.controller.js +++ b/server/api/automation/automation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a8=['mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','set','apply','destroy','then','error','name','send','index','map','Automation','rawAttributes','key','model','keys','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','create','body','update','find','params','addConditions','ids','omit','getConditions','Condition','pick','Action','addActions','getActions','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xcfa233,_0x2768dd){var _0x7a97c6=function(_0x2fab29){while(--_0x2fab29){_0xcfa233['push'](_0xcfa233['shift']());}};_0x7a97c6(++_0x2768dd);}(_0xd4a8,0xe7));var _0x8d4a=function(_0x2b559d,_0x1b3307){_0x2b559d=_0x2b559d-0x0;var _0x25d03a=_0xd4a8[_0x2b559d];return _0x25d03a;};'use strict';var pdf=require(_0x8d4a('0x0'));var emlformat=require(_0x8d4a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8d4a('0x2'));var jsonpatch=require(_0x8d4a('0x3'));var rp=require(_0x8d4a('0x4'));var moment=require(_0x8d4a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8d4a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8d4a('0x7'));var csv=require(_0x8d4a('0x8'));var ejs=require(_0x8d4a('0x9'));var fs=require('fs');var _=require(_0x8d4a('0xa'));var squel=require(_0x8d4a('0xb'));var crypto=require(_0x8d4a('0xc'));var jsforce=require(_0x8d4a('0xd'));var deskjs=require(_0x8d4a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8d4a('0xf'));var Papa=require(_0x8d4a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8d4a('0x11'));var as=require(_0x8d4a('0x12'));var hardwareService=require(_0x8d4a('0x13'));var logger=require(_0x8d4a('0x14'))('api');var utils=require(_0x8d4a('0x15'));var config=require('../../config/environment');var db=require(_0x8d4a('0x16'))['db'];function respondWithStatusCode(_0x4d7bdd,_0x2f6743){_0x2f6743=_0x2f6743||0xcc;return function(_0x30c258){if(_0x30c258){return _0x4d7bdd[_0x8d4a('0x17')](_0x2f6743);}return _0x4d7bdd[_0x8d4a('0x18')](_0x2f6743)[_0x8d4a('0x19')]();};}function respondWithResult(_0x4f3d36,_0x1398e0){_0x1398e0=_0x1398e0||0xc8;return function(_0x50f4d8){if(_0x50f4d8){return _0x4f3d36[_0x8d4a('0x18')](_0x1398e0)['json'](_0x50f4d8);}};}function respondWithFilteredResult(_0x1c3c36,_0x12468e){return function(_0x10854a){if(_0x10854a){var _0x40f5af=_0x10854a[_0x8d4a('0x1a')],_0x23b7a5=_0x12468e['offset'],_0x448b10=_0x12468e[_0x8d4a('0x1b')]+_0x12468e['limit'],_0x47a9a5;if(_0x448b10>=_0x40f5af){_0x448b10=_0x40f5af;_0x47a9a5=0xc8;}else{_0x47a9a5=0xce;}_0x1c3c36[_0x8d4a('0x18')](_0x47a9a5);return _0x1c3c36[_0x8d4a('0x1c')]('Content-Range',_0x23b7a5+'-'+_0x448b10+'/'+_0x40f5af)['json'](_0x10854a);}return null;};}function patchUpdates(_0x3274d1){return function(_0x15a2e6){try{jsonpatch[_0x8d4a('0x1d')](_0x15a2e6,_0x3274d1,!![]);}catch(_0x43a101){return BPromise['reject'](_0x43a101);}return _0x15a2e6['save']();};}function saveUpdates(_0x320044,_0x34862a){return function(_0x5309fc){if(_0x5309fc){return _0x5309fc['update'](_0x320044)['then'](function(_0x5bceb3){return _0x5bceb3;});}return null;};}function removeEntity(_0x11836e,_0x4a40e2){return function(_0x3dd325){if(_0x3dd325){return _0x3dd325[_0x8d4a('0x1e')]()[_0x8d4a('0x1f')](function(){_0x11836e[_0x8d4a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b8464,_0x1a68e6){return function(_0x1329f8){if(!_0x1329f8){_0x1b8464[_0x8d4a('0x17')](0x194);}return _0x1329f8;};}function handleError(_0x2977c0,_0x2c1a53){_0x2c1a53=_0x2c1a53||0x1f4;return function(_0x275f21){logger[_0x8d4a('0x20')](_0x275f21['stack']);if(_0x275f21[_0x8d4a('0x21')]){delete _0x275f21[_0x8d4a('0x21')];}_0x2977c0[_0x8d4a('0x18')](_0x2c1a53)[_0x8d4a('0x22')](_0x275f21);};}exports[_0x8d4a('0x23')]=function(_0x57a454,_0x174530){var _0x1d44e9={},_0x3ab0dd={},_0x26234d={'count':0x0,'rows':[]};var _0x1014db=_[_0x8d4a('0x24')](db[_0x8d4a('0x25')][_0x8d4a('0x26')],function(_0xd196db){return{'name':_0xd196db['fieldName'],'type':_0xd196db['type'][_0x8d4a('0x27')]};});_0x3ab0dd[_0x8d4a('0x28')]=_['map'](_0x1014db,_0x8d4a('0x21'));_0x3ab0dd['query']=_[_0x8d4a('0x29')](_0x57a454['query']);_0x3ab0dd['filters']=_[_0x8d4a('0x2a')](_0x3ab0dd[_0x8d4a('0x28')],_0x3ab0dd['query']);_0x1d44e9['attributes']=_[_0x8d4a('0x2a')](_0x3ab0dd[_0x8d4a('0x28')],qs[_0x8d4a('0x2b')](_0x57a454[_0x8d4a('0x2c')][_0x8d4a('0x2b')]));_0x1d44e9[_0x8d4a('0x2d')]=_0x1d44e9['attributes'][_0x8d4a('0x2e')]?_0x1d44e9[_0x8d4a('0x2d')]:_0x3ab0dd[_0x8d4a('0x28')];if(!_0x57a454[_0x8d4a('0x2c')][_0x8d4a('0x2f')](_0x8d4a('0x30'))){_0x1d44e9[_0x8d4a('0x31')]=qs[_0x8d4a('0x31')](_0x57a454['query'][_0x8d4a('0x31')]);_0x1d44e9[_0x8d4a('0x1b')]=qs[_0x8d4a('0x1b')](_0x57a454[_0x8d4a('0x2c')]['offset']);}_0x1d44e9[_0x8d4a('0x32')]=qs['sort'](_0x57a454[_0x8d4a('0x2c')][_0x8d4a('0x33')]);_0x1d44e9[_0x8d4a('0x34')]=qs[_0x8d4a('0x35')](_['pick'](_0x57a454[_0x8d4a('0x2c')],_0x3ab0dd[_0x8d4a('0x35')]));if(_0x57a454['query']['filter']){_0x1d44e9[_0x8d4a('0x34')]=_[_0x8d4a('0x36')](_0x1d44e9[_0x8d4a('0x34')],{'$or':_[_0x8d4a('0x24')](_0x1014db,function(_0x5aabc2){if(_0x5aabc2[_0x8d4a('0x37')]!==_0x8d4a('0x38')){var _0x15782e={};_0x15782e[_0x5aabc2[_0x8d4a('0x21')]]={'$like':'%'+_0x57a454[_0x8d4a('0x2c')][_0x8d4a('0x39')]+'%'};return _0x15782e;}})});}_0x1d44e9=_[_0x8d4a('0x36')]({},_0x1d44e9,_0x57a454[_0x8d4a('0x3a')]);var _0x2bb9c7={'where':_0x1d44e9[_0x8d4a('0x34')]};return db['Automation'][_0x8d4a('0x1a')](_0x2bb9c7)[_0x8d4a('0x1f')](function(_0x1a7e96){_0x26234d[_0x8d4a('0x1a')]=_0x1a7e96;if(_0x57a454[_0x8d4a('0x2c')][_0x8d4a('0x3b')]){_0x1d44e9[_0x8d4a('0x3c')]=[{'all':!![]}];}return db[_0x8d4a('0x25')]['findAll'](_0x1d44e9);})[_0x8d4a('0x1f')](function(_0x288dbb){_0x26234d[_0x8d4a('0x3d')]=_0x288dbb;return _0x26234d;})[_0x8d4a('0x1f')](respondWithFilteredResult(_0x174530,_0x1d44e9))[_0x8d4a('0x3e')](handleError(_0x174530,null));};exports[_0x8d4a('0x3f')]=function(_0x252127,_0xa82058){var _0x61848a={'raw':![],'where':{'id':_0x252127['params']['id']}},_0x2956b1={};_0x2956b1[_0x8d4a('0x28')]=_[_0x8d4a('0x29')](db[_0x8d4a('0x25')][_0x8d4a('0x26')]);_0x2956b1[_0x8d4a('0x2c')]=_['keys'](_0x252127[_0x8d4a('0x2c')]);_0x2956b1[_0x8d4a('0x35')]=_[_0x8d4a('0x2a')](_0x2956b1['model'],_0x2956b1[_0x8d4a('0x2c')]);_0x61848a['attributes']=_[_0x8d4a('0x2a')](_0x2956b1[_0x8d4a('0x28')],qs['fields'](_0x252127[_0x8d4a('0x2c')][_0x8d4a('0x2b')]));_0x61848a[_0x8d4a('0x2d')]=_0x61848a[_0x8d4a('0x2d')]['length']?_0x61848a['attributes']:_0x2956b1[_0x8d4a('0x28')];if(_0x252127[_0x8d4a('0x2c')][_0x8d4a('0x3b')]){_0x61848a[_0x8d4a('0x3c')]=[{'all':!![]}];}_0x61848a=_[_0x8d4a('0x36')]({},_0x61848a,_0x252127['options']);return db[_0x8d4a('0x25')]['find'](_0x61848a)[_0x8d4a('0x1f')](handleEntityNotFound(_0xa82058,null))[_0x8d4a('0x1f')](respondWithResult(_0xa82058,null))[_0x8d4a('0x3e')](handleError(_0xa82058,null));};exports[_0x8d4a('0x40')]=function(_0x9cc818,_0x174d21){return db[_0x8d4a('0x25')][_0x8d4a('0x40')](_0x9cc818[_0x8d4a('0x41')],{})[_0x8d4a('0x1f')](respondWithResult(_0x174d21,0xc9))['catch'](handleError(_0x174d21,null));};exports[_0x8d4a('0x42')]=function(_0x5cf922,_0x4654d8){if(_0x5cf922[_0x8d4a('0x41')]['id']){delete _0x5cf922[_0x8d4a('0x41')]['id'];}return db[_0x8d4a('0x25')][_0x8d4a('0x43')]({'where':{'id':_0x5cf922['params']['id']}})['then'](handleEntityNotFound(_0x4654d8,null))[_0x8d4a('0x1f')](saveUpdates(_0x5cf922[_0x8d4a('0x41')],null))[_0x8d4a('0x1f')](respondWithResult(_0x4654d8,null))['catch'](handleError(_0x4654d8,null));};exports['destroy']=function(_0x33fc4b,_0x36d7d8){return db['Automation'][_0x8d4a('0x43')]({'where':{'id':_0x33fc4b[_0x8d4a('0x44')]['id']}})[_0x8d4a('0x1f')](handleEntityNotFound(_0x36d7d8,null))['then'](removeEntity(_0x36d7d8,null))['catch'](handleError(_0x36d7d8,null));};exports[_0x8d4a('0x45')]=function(_0x431b82,_0x1c5c17,_0x4925c5){return db['Condition'][_0x8d4a('0x43')]({'where':{'id':_0x431b82[_0x8d4a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c5c17,null))['then'](function(_0x430122){if(_0x430122){return _0x430122[_0x8d4a('0x45')](_0x431b82['body'][_0x8d4a('0x46')],_[_0x8d4a('0x47')](_0x431b82[_0x8d4a('0x41')],[_0x8d4a('0x46'),'id'])||{});}})[_0x8d4a('0x1f')](respondWithResult(_0x1c5c17,null))[_0x8d4a('0x3e')](handleError(_0x1c5c17,null));};exports[_0x8d4a('0x48')]=function(_0x68d14e,_0x5dfc53,_0x3d684d){var _0xa52fd2={};var _0x2824cf={};var _0x2e1aeb;var _0x1facec;return db[_0x8d4a('0x25')]['findOne']({'where':{'id':_0x68d14e[_0x8d4a('0x44')]['id']}})[_0x8d4a('0x1f')](handleEntityNotFound(_0x5dfc53,null))[_0x8d4a('0x1f')](function(_0xec6a0a){if(_0xec6a0a){_0x2e1aeb=_0xec6a0a;_0x2824cf['model']=_[_0x8d4a('0x29')](db[_0x8d4a('0x49')][_0x8d4a('0x26')]);_0x2824cf['query']=_[_0x8d4a('0x29')](_0x68d14e['query']);_0x2824cf[_0x8d4a('0x35')]=_['intersection'](_0x2824cf[_0x8d4a('0x28')],_0x2824cf[_0x8d4a('0x2c')]);_0xa52fd2[_0x8d4a('0x2d')]=_[_0x8d4a('0x2a')](_0x2824cf[_0x8d4a('0x28')],qs[_0x8d4a('0x2b')](_0x68d14e['query']['fields']));_0xa52fd2[_0x8d4a('0x2d')]=_0xa52fd2[_0x8d4a('0x2d')][_0x8d4a('0x2e')]?_0xa52fd2[_0x8d4a('0x2d')]:_0x2824cf['model'];_0xa52fd2['order']=qs[_0x8d4a('0x33')](_0x68d14e[_0x8d4a('0x2c')]['sort']);_0xa52fd2[_0x8d4a('0x34')]=qs['filters'](_[_0x8d4a('0x4a')](_0x68d14e[_0x8d4a('0x2c')],_0x2824cf[_0x8d4a('0x35')]));if(_0x68d14e[_0x8d4a('0x2c')][_0x8d4a('0x39')]){_0xa52fd2[_0x8d4a('0x34')]=_[_0x8d4a('0x36')](_0xa52fd2[_0x8d4a('0x34')],{'$or':_[_0x8d4a('0x24')](_0xa52fd2[_0x8d4a('0x2d')],function(_0xe342ce){var _0x360012={};_0x360012[_0xe342ce]={'$like':'%'+_0x68d14e['query'][_0x8d4a('0x39')]+'%'};return _0x360012;})});}_0xa52fd2=_[_0x8d4a('0x36')]({},_0xa52fd2,_0x68d14e[_0x8d4a('0x3a')]);return _0x2e1aeb[_0x8d4a('0x48')](_0xa52fd2);}})[_0x8d4a('0x1f')](function(_0x2744b4){if(_0x2744b4){_0x1facec=_0x2744b4[_0x8d4a('0x2e')];if(!_0x68d14e[_0x8d4a('0x2c')]['hasOwnProperty'](_0x8d4a('0x30'))){_0xa52fd2[_0x8d4a('0x31')]=qs[_0x8d4a('0x31')](_0x68d14e[_0x8d4a('0x2c')][_0x8d4a('0x31')]);_0xa52fd2[_0x8d4a('0x1b')]=qs[_0x8d4a('0x1b')](_0x68d14e[_0x8d4a('0x2c')][_0x8d4a('0x1b')]);}return _0x2e1aeb[_0x8d4a('0x48')](_0xa52fd2);}})[_0x8d4a('0x1f')](function(_0x434ae7){if(_0x434ae7){return _0x434ae7?{'count':_0x1facec,'rows':_0x434ae7}:null;}})[_0x8d4a('0x1f')](respondWithResult(_0x5dfc53,null))[_0x8d4a('0x3e')](handleError(_0x5dfc53,null));};exports['addActions']=function(_0x37f06c,_0x372fe1,_0x293cfd){return db[_0x8d4a('0x4b')][_0x8d4a('0x43')]({'where':{'id':_0x37f06c[_0x8d4a('0x44')]['id']}})[_0x8d4a('0x1f')](handleEntityNotFound(_0x372fe1,null))['then'](function(_0x5517d4){if(_0x5517d4){return _0x5517d4[_0x8d4a('0x4c')](_0x37f06c['body']['ids'],_[_0x8d4a('0x47')](_0x37f06c[_0x8d4a('0x41')],['ids','id'])||{});}})[_0x8d4a('0x1f')](respondWithResult(_0x372fe1,null))[_0x8d4a('0x3e')](handleError(_0x372fe1,null));};exports[_0x8d4a('0x4d')]=function(_0x515c0a,_0x20c068,_0x5d89a2){var _0x4b4912={};var _0x18e91e={};var _0x237908;var _0x22a744;return db[_0x8d4a('0x25')][_0x8d4a('0x4e')]({'where':{'id':_0x515c0a['params']['id']}})[_0x8d4a('0x1f')](handleEntityNotFound(_0x20c068,null))[_0x8d4a('0x1f')](function(_0x471981){if(_0x471981){_0x237908=_0x471981;_0x18e91e[_0x8d4a('0x28')]=_[_0x8d4a('0x29')](db[_0x8d4a('0x4b')][_0x8d4a('0x26')]);_0x18e91e[_0x8d4a('0x2c')]=_[_0x8d4a('0x29')](_0x515c0a[_0x8d4a('0x2c')]);_0x18e91e[_0x8d4a('0x35')]=_[_0x8d4a('0x2a')](_0x18e91e['model'],_0x18e91e[_0x8d4a('0x2c')]);_0x4b4912[_0x8d4a('0x2d')]=_[_0x8d4a('0x2a')](_0x18e91e[_0x8d4a('0x28')],qs[_0x8d4a('0x2b')](_0x515c0a[_0x8d4a('0x2c')][_0x8d4a('0x2b')]));_0x4b4912[_0x8d4a('0x2d')]=_0x4b4912[_0x8d4a('0x2d')][_0x8d4a('0x2e')]?_0x4b4912[_0x8d4a('0x2d')]:_0x18e91e[_0x8d4a('0x28')];_0x4b4912['order']=qs[_0x8d4a('0x33')](_0x515c0a[_0x8d4a('0x2c')][_0x8d4a('0x33')]);_0x4b4912['where']=qs[_0x8d4a('0x35')](_[_0x8d4a('0x4a')](_0x515c0a[_0x8d4a('0x2c')],_0x18e91e[_0x8d4a('0x35')]));if(_0x515c0a['query']['filter']){_0x4b4912['where']=_['merge'](_0x4b4912[_0x8d4a('0x34')],{'$or':_[_0x8d4a('0x24')](_0x4b4912[_0x8d4a('0x2d')],function(_0x166bae){var _0x4d3873={};_0x4d3873[_0x166bae]={'$like':'%'+_0x515c0a[_0x8d4a('0x2c')][_0x8d4a('0x39')]+'%'};return _0x4d3873;})});}_0x4b4912=_[_0x8d4a('0x36')]({},_0x4b4912,_0x515c0a[_0x8d4a('0x3a')]);return _0x237908[_0x8d4a('0x4d')](_0x4b4912);}})[_0x8d4a('0x1f')](function(_0x108366){if(_0x108366){_0x22a744=_0x108366['length'];if(!_0x515c0a['query'][_0x8d4a('0x2f')](_0x8d4a('0x30'))){_0x4b4912['limit']=qs['limit'](_0x515c0a[_0x8d4a('0x2c')][_0x8d4a('0x31')]);_0x4b4912['offset']=qs[_0x8d4a('0x1b')](_0x515c0a[_0x8d4a('0x2c')]['offset']);}return _0x237908[_0x8d4a('0x4d')](_0x4b4912);}})['then'](function(_0x2154f7){if(_0x2154f7){return _0x2154f7?{'count':_0x22a744,'rows':_0x2154f7}:null;}})[_0x8d4a('0x1f')](respondWithResult(_0x20c068,null))['catch'](handleError(_0x20c068,null));}; \ No newline at end of file +var _0xb036=['name','send','index','map','Automation','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','addConditions','Condition','ids','getConditions','findOne','hasOwnProperty','nolimit','Action','addActions','omit','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','then','destroy','sendStatus','error','stack'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xb036,0x7b));var _0x6b03=function(_0x45411c,_0x2e215c){_0x45411c=_0x45411c-0x0;var _0x4b676e=_0xb036[_0x45411c];return _0x4b676e;};'use strict';var pdf=require(_0x6b03('0x0'));var emlformat=require(_0x6b03('0x1'));var rimraf=require(_0x6b03('0x2'));var zipdir=require(_0x6b03('0x3'));var jsonpatch=require(_0x6b03('0x4'));var rp=require('request-promise');var moment=require(_0x6b03('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6b03('0x6'));var sox=require(_0x6b03('0x7'));var csv=require(_0x6b03('0x8'));var ejs=require(_0x6b03('0x9'));var fs=require('fs');var _=require(_0x6b03('0xa'));var squel=require(_0x6b03('0xb'));var crypto=require('crypto');var jsforce=require(_0x6b03('0xc'));var deskjs=require(_0x6b03('0xd'));var toCsv=require(_0x6b03('0x8'));var querystring=require(_0x6b03('0xe'));var Papa=require(_0x6b03('0xf'));var Redis=require(_0x6b03('0x10'));var authService=require(_0x6b03('0x11'));var qs=require(_0x6b03('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b03('0x13'));var logger=require(_0x6b03('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6b03('0x15'))['db'];function respondWithStatusCode(_0x11c1a5,_0x2f46d2){_0x2f46d2=_0x2f46d2||0xcc;return function(_0x24d272){if(_0x24d272){return _0x11c1a5['sendStatus'](_0x2f46d2);}return _0x11c1a5[_0x6b03('0x16')](_0x2f46d2)[_0x6b03('0x17')]();};}function respondWithResult(_0x49f1f8,_0x3dc8e0){_0x3dc8e0=_0x3dc8e0||0xc8;return function(_0x3e6905){if(_0x3e6905){return _0x49f1f8[_0x6b03('0x16')](_0x3dc8e0)[_0x6b03('0x18')](_0x3e6905);}};}function respondWithFilteredResult(_0x2bbbe1,_0x375db0){return function(_0x55fc31){if(_0x55fc31){var _0x47c7a5=_0x55fc31[_0x6b03('0x19')],_0x103639=_0x375db0[_0x6b03('0x1a')],_0xce4285=_0x375db0[_0x6b03('0x1a')]+_0x375db0['limit'],_0x224f8e;if(_0xce4285>=_0x47c7a5){_0xce4285=_0x47c7a5;_0x224f8e=0xc8;}else{_0x224f8e=0xce;}_0x2bbbe1[_0x6b03('0x16')](_0x224f8e);return _0x2bbbe1[_0x6b03('0x1b')](_0x6b03('0x1c'),_0x103639+'-'+_0xce4285+'/'+_0x47c7a5)['json'](_0x55fc31);}return null;};}function patchUpdates(_0x1c7313){return function(_0x5bac1f){try{jsonpatch['apply'](_0x5bac1f,_0x1c7313,!![]);}catch(_0x2b86b1){return BPromise[_0x6b03('0x1d')](_0x2b86b1);}return _0x5bac1f['save']();};}function saveUpdates(_0xb2de8a,_0x52fd0d){return function(_0x3873bb){if(_0x3873bb){return _0x3873bb['update'](_0xb2de8a)[_0x6b03('0x1e')](function(_0x725544){return _0x725544;});}return null;};}function removeEntity(_0x229d80,_0x5b9c22){return function(_0x151d2c){if(_0x151d2c){return _0x151d2c[_0x6b03('0x1f')]()[_0x6b03('0x1e')](function(){_0x229d80[_0x6b03('0x16')](0xcc)[_0x6b03('0x17')]();});}};}function handleEntityNotFound(_0x5517e8,_0x50d0cd){return function(_0x2570fc){if(!_0x2570fc){_0x5517e8[_0x6b03('0x20')](0x194);}return _0x2570fc;};}function handleError(_0x54317c,_0x5daa7f){_0x5daa7f=_0x5daa7f||0x1f4;return function(_0x3e0d39){logger[_0x6b03('0x21')](_0x3e0d39[_0x6b03('0x22')]);if(_0x3e0d39['name']){delete _0x3e0d39[_0x6b03('0x23')];}_0x54317c[_0x6b03('0x16')](_0x5daa7f)[_0x6b03('0x24')](_0x3e0d39);};}exports[_0x6b03('0x25')]=function(_0x3224c9,_0x414327){var _0x11db14={},_0x5edf37={},_0x5d348a={'count':0x0,'rows':[]};var _0x420706=_[_0x6b03('0x26')](db[_0x6b03('0x27')][_0x6b03('0x28')],function(_0x588abb){return{'name':_0x588abb['fieldName'],'type':_0x588abb[_0x6b03('0x29')]['key']};});_0x5edf37[_0x6b03('0x2a')]=_[_0x6b03('0x26')](_0x420706,'name');_0x5edf37[_0x6b03('0x2b')]=_[_0x6b03('0x2c')](_0x3224c9['query']);_0x5edf37[_0x6b03('0x2d')]=_[_0x6b03('0x2e')](_0x5edf37[_0x6b03('0x2a')],_0x5edf37[_0x6b03('0x2b')]);_0x11db14[_0x6b03('0x2f')]=_[_0x6b03('0x2e')](_0x5edf37['model'],qs['fields'](_0x3224c9[_0x6b03('0x2b')][_0x6b03('0x30')]));_0x11db14['attributes']=_0x11db14[_0x6b03('0x2f')][_0x6b03('0x31')]?_0x11db14[_0x6b03('0x2f')]:_0x5edf37[_0x6b03('0x2a')];if(!_0x3224c9['query']['hasOwnProperty']('nolimit')){_0x11db14[_0x6b03('0x32')]=qs[_0x6b03('0x32')](_0x3224c9['query'][_0x6b03('0x32')]);_0x11db14[_0x6b03('0x1a')]=qs[_0x6b03('0x1a')](_0x3224c9[_0x6b03('0x2b')][_0x6b03('0x1a')]);}_0x11db14[_0x6b03('0x33')]=qs[_0x6b03('0x34')](_0x3224c9[_0x6b03('0x2b')][_0x6b03('0x34')]);_0x11db14['where']=qs[_0x6b03('0x2d')](_[_0x6b03('0x35')](_0x3224c9['query'],_0x5edf37[_0x6b03('0x2d')]));if(_0x3224c9[_0x6b03('0x2b')][_0x6b03('0x36')]){_0x11db14[_0x6b03('0x37')]=_[_0x6b03('0x38')](_0x11db14['where'],{'$or':_['map'](_0x420706,function(_0x2e12c5){if(_0x2e12c5['type']!==_0x6b03('0x39')){var _0x392826={};_0x392826[_0x2e12c5[_0x6b03('0x23')]]={'$like':'%'+_0x3224c9[_0x6b03('0x2b')]['filter']+'%'};return _0x392826;}})});}_0x11db14=_[_0x6b03('0x38')]({},_0x11db14,_0x3224c9[_0x6b03('0x3a')]);var _0xe14b72={'where':_0x11db14[_0x6b03('0x37')]};return db[_0x6b03('0x27')][_0x6b03('0x19')](_0xe14b72)['then'](function(_0xe25550){_0x5d348a[_0x6b03('0x19')]=_0xe25550;if(_0x3224c9['query'][_0x6b03('0x3b')]){_0x11db14[_0x6b03('0x3c')]=[{'all':!![]}];}return db[_0x6b03('0x27')][_0x6b03('0x3d')](_0x11db14);})[_0x6b03('0x1e')](function(_0xc3d72c){_0x5d348a['rows']=_0xc3d72c;return _0x5d348a;})[_0x6b03('0x1e')](respondWithFilteredResult(_0x414327,_0x11db14))[_0x6b03('0x3e')](handleError(_0x414327,null));};exports[_0x6b03('0x3f')]=function(_0x504416,_0x59e1ed){var _0x592d91={'raw':![],'where':{'id':_0x504416[_0x6b03('0x40')]['id']}},_0x24548d={};_0x24548d[_0x6b03('0x2a')]=_[_0x6b03('0x2c')](db[_0x6b03('0x27')][_0x6b03('0x28')]);_0x24548d[_0x6b03('0x2b')]=_['keys'](_0x504416[_0x6b03('0x2b')]);_0x24548d[_0x6b03('0x2d')]=_[_0x6b03('0x2e')](_0x24548d[_0x6b03('0x2a')],_0x24548d[_0x6b03('0x2b')]);_0x592d91[_0x6b03('0x2f')]=_[_0x6b03('0x2e')](_0x24548d[_0x6b03('0x2a')],qs[_0x6b03('0x30')](_0x504416['query'][_0x6b03('0x30')]));_0x592d91['attributes']=_0x592d91[_0x6b03('0x2f')][_0x6b03('0x31')]?_0x592d91[_0x6b03('0x2f')]:_0x24548d['model'];if(_0x504416[_0x6b03('0x2b')][_0x6b03('0x3b')]){_0x592d91[_0x6b03('0x3c')]=[{'all':!![]}];}_0x592d91=_[_0x6b03('0x38')]({},_0x592d91,_0x504416[_0x6b03('0x3a')]);return db[_0x6b03('0x27')][_0x6b03('0x41')](_0x592d91)[_0x6b03('0x1e')](handleEntityNotFound(_0x59e1ed,null))[_0x6b03('0x1e')](respondWithResult(_0x59e1ed,null))[_0x6b03('0x3e')](handleError(_0x59e1ed,null));};exports[_0x6b03('0x42')]=function(_0x6f697a,_0x1d3dbc){return db[_0x6b03('0x27')]['create'](_0x6f697a[_0x6b03('0x43')],{})[_0x6b03('0x1e')](respondWithResult(_0x1d3dbc,0xc9))['catch'](handleError(_0x1d3dbc,null));};exports['update']=function(_0x56172c,_0x22ff60){if(_0x56172c[_0x6b03('0x43')]['id']){delete _0x56172c[_0x6b03('0x43')]['id'];}return db[_0x6b03('0x27')][_0x6b03('0x41')]({'where':{'id':_0x56172c[_0x6b03('0x40')]['id']}})[_0x6b03('0x1e')](handleEntityNotFound(_0x22ff60,null))[_0x6b03('0x1e')](saveUpdates(_0x56172c[_0x6b03('0x43')],null))[_0x6b03('0x1e')](respondWithResult(_0x22ff60,null))[_0x6b03('0x3e')](handleError(_0x22ff60,null));};exports[_0x6b03('0x1f')]=function(_0x30c7b8,_0x1cbda6){return db[_0x6b03('0x27')][_0x6b03('0x41')]({'where':{'id':_0x30c7b8[_0x6b03('0x40')]['id']}})[_0x6b03('0x1e')](handleEntityNotFound(_0x1cbda6,null))[_0x6b03('0x1e')](removeEntity(_0x1cbda6,null))[_0x6b03('0x3e')](handleError(_0x1cbda6,null));};exports[_0x6b03('0x44')]=function(_0x5c0a40,_0x54ad71,_0x31a57a){return db[_0x6b03('0x45')]['find']({'where':{'id':_0x5c0a40[_0x6b03('0x40')]['id']}})['then'](handleEntityNotFound(_0x54ad71,null))[_0x6b03('0x1e')](function(_0x4298d6){if(_0x4298d6){return _0x4298d6[_0x6b03('0x44')](_0x5c0a40[_0x6b03('0x43')][_0x6b03('0x46')],_['omit'](_0x5c0a40[_0x6b03('0x43')],[_0x6b03('0x46'),'id'])||{});}})[_0x6b03('0x1e')](respondWithResult(_0x54ad71,null))[_0x6b03('0x3e')](handleError(_0x54ad71,null));};exports[_0x6b03('0x47')]=function(_0x3aea1a,_0x14b175,_0x273e4a){var _0x21e7d8={};var _0x419020={};var _0x3423e4;var _0x1f4263;return db[_0x6b03('0x27')][_0x6b03('0x48')]({'where':{'id':_0x3aea1a[_0x6b03('0x40')]['id']}})[_0x6b03('0x1e')](handleEntityNotFound(_0x14b175,null))[_0x6b03('0x1e')](function(_0x5e4632){if(_0x5e4632){_0x3423e4=_0x5e4632;_0x419020[_0x6b03('0x2a')]=_[_0x6b03('0x2c')](db[_0x6b03('0x45')]['rawAttributes']);_0x419020['query']=_[_0x6b03('0x2c')](_0x3aea1a[_0x6b03('0x2b')]);_0x419020[_0x6b03('0x2d')]=_['intersection'](_0x419020['model'],_0x419020[_0x6b03('0x2b')]);_0x21e7d8[_0x6b03('0x2f')]=_[_0x6b03('0x2e')](_0x419020[_0x6b03('0x2a')],qs[_0x6b03('0x30')](_0x3aea1a[_0x6b03('0x2b')][_0x6b03('0x30')]));_0x21e7d8[_0x6b03('0x2f')]=_0x21e7d8['attributes'][_0x6b03('0x31')]?_0x21e7d8[_0x6b03('0x2f')]:_0x419020[_0x6b03('0x2a')];_0x21e7d8['order']=qs['sort'](_0x3aea1a[_0x6b03('0x2b')][_0x6b03('0x34')]);_0x21e7d8[_0x6b03('0x37')]=qs[_0x6b03('0x2d')](_['pick'](_0x3aea1a['query'],_0x419020[_0x6b03('0x2d')]));if(_0x3aea1a['query'][_0x6b03('0x36')]){_0x21e7d8[_0x6b03('0x37')]=_['merge'](_0x21e7d8[_0x6b03('0x37')],{'$or':_[_0x6b03('0x26')](_0x21e7d8[_0x6b03('0x2f')],function(_0x26667b){var _0x18fbce={};_0x18fbce[_0x26667b]={'$like':'%'+_0x3aea1a[_0x6b03('0x2b')]['filter']+'%'};return _0x18fbce;})});}_0x21e7d8=_[_0x6b03('0x38')]({},_0x21e7d8,_0x3aea1a[_0x6b03('0x3a')]);return _0x3423e4[_0x6b03('0x47')](_0x21e7d8);}})[_0x6b03('0x1e')](function(_0xdfc55f){if(_0xdfc55f){_0x1f4263=_0xdfc55f[_0x6b03('0x31')];if(!_0x3aea1a['query'][_0x6b03('0x49')](_0x6b03('0x4a'))){_0x21e7d8['limit']=qs['limit'](_0x3aea1a[_0x6b03('0x2b')][_0x6b03('0x32')]);_0x21e7d8[_0x6b03('0x1a')]=qs[_0x6b03('0x1a')](_0x3aea1a[_0x6b03('0x2b')]['offset']);}return _0x3423e4['getConditions'](_0x21e7d8);}})['then'](function(_0x3325e2){if(_0x3325e2){return _0x3325e2?{'count':_0x1f4263,'rows':_0x3325e2}:null;}})[_0x6b03('0x1e')](respondWithResult(_0x14b175,null))[_0x6b03('0x3e')](handleError(_0x14b175,null));};exports['addActions']=function(_0x2af765,_0xf01883,_0x1e1abf){return db[_0x6b03('0x4b')]['find']({'where':{'id':_0x2af765[_0x6b03('0x40')]['id']}})[_0x6b03('0x1e')](handleEntityNotFound(_0xf01883,null))[_0x6b03('0x1e')](function(_0x42a099){if(_0x42a099){return _0x42a099[_0x6b03('0x4c')](_0x2af765[_0x6b03('0x43')]['ids'],_[_0x6b03('0x4d')](_0x2af765[_0x6b03('0x43')],[_0x6b03('0x46'),'id'])||{});}})[_0x6b03('0x1e')](respondWithResult(_0xf01883,null))[_0x6b03('0x3e')](handleError(_0xf01883,null));};exports[_0x6b03('0x4e')]=function(_0x2857d4,_0x5abb43,_0x3f7943){var _0xaef0ce={};var _0x20388a={};var _0x2c6e65;var _0x90036f;return db[_0x6b03('0x27')]['findOne']({'where':{'id':_0x2857d4[_0x6b03('0x40')]['id']}})['then'](handleEntityNotFound(_0x5abb43,null))[_0x6b03('0x1e')](function(_0x1dd487){if(_0x1dd487){_0x2c6e65=_0x1dd487;_0x20388a[_0x6b03('0x2a')]=_[_0x6b03('0x2c')](db[_0x6b03('0x4b')][_0x6b03('0x28')]);_0x20388a[_0x6b03('0x2b')]=_[_0x6b03('0x2c')](_0x2857d4[_0x6b03('0x2b')]);_0x20388a[_0x6b03('0x2d')]=_[_0x6b03('0x2e')](_0x20388a[_0x6b03('0x2a')],_0x20388a[_0x6b03('0x2b')]);_0xaef0ce[_0x6b03('0x2f')]=_[_0x6b03('0x2e')](_0x20388a[_0x6b03('0x2a')],qs[_0x6b03('0x30')](_0x2857d4[_0x6b03('0x2b')][_0x6b03('0x30')]));_0xaef0ce[_0x6b03('0x2f')]=_0xaef0ce[_0x6b03('0x2f')]['length']?_0xaef0ce[_0x6b03('0x2f')]:_0x20388a[_0x6b03('0x2a')];_0xaef0ce[_0x6b03('0x33')]=qs['sort'](_0x2857d4[_0x6b03('0x2b')][_0x6b03('0x34')]);_0xaef0ce[_0x6b03('0x37')]=qs[_0x6b03('0x2d')](_[_0x6b03('0x35')](_0x2857d4['query'],_0x20388a[_0x6b03('0x2d')]));if(_0x2857d4[_0x6b03('0x2b')][_0x6b03('0x36')]){_0xaef0ce[_0x6b03('0x37')]=_[_0x6b03('0x38')](_0xaef0ce['where'],{'$or':_['map'](_0xaef0ce[_0x6b03('0x2f')],function(_0x39bbec){var _0x25a947={};_0x25a947[_0x39bbec]={'$like':'%'+_0x2857d4[_0x6b03('0x2b')]['filter']+'%'};return _0x25a947;})});}_0xaef0ce=_['merge']({},_0xaef0ce,_0x2857d4[_0x6b03('0x3a')]);return _0x2c6e65['getActions'](_0xaef0ce);}})[_0x6b03('0x1e')](function(_0x117fd3){if(_0x117fd3){_0x90036f=_0x117fd3[_0x6b03('0x31')];if(!_0x2857d4[_0x6b03('0x2b')][_0x6b03('0x49')](_0x6b03('0x4a'))){_0xaef0ce[_0x6b03('0x32')]=qs['limit'](_0x2857d4['query'][_0x6b03('0x32')]);_0xaef0ce[_0x6b03('0x1a')]=qs[_0x6b03('0x1a')](_0x2857d4[_0x6b03('0x2b')]['offset']);}return _0x2c6e65['getActions'](_0xaef0ce);}})[_0x6b03('0x1e')](function(_0x4a5456){if(_0x4a5456){return _0x4a5456?{'count':_0x90036f,'rows':_0x4a5456}:null;}})['then'](respondWithResult(_0x5abb43,null))[_0x6b03('0x3e')](handleError(_0x5abb43,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index bdc72e3..e0ea5b7 100644 --- a/server/api/automation/automation.model.js +++ b/server/api/automation/automation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0053=['tools_automations','util','../../config/logger','api','moment','request-promise','rimraf','./automation.attributes','define','Automation'];(function(_0x61b555,_0x3fb31c){var _0x3e70d1=function(_0x3260ad){while(--_0x3260ad){_0x61b555['push'](_0x61b555['shift']());}};_0x3e70d1(++_0x3fb31c);}(_0x0053,0x14b));var _0x3005=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0053[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3005('0x0'));var logger=require(_0x3005('0x1'))(_0x3005('0x2'));var moment=require(_0x3005('0x3'));var BPromise=require('bluebird');var rp=require(_0x3005('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3005('0x5'));var config=require('../../config/environment');var attributes=require(_0x3005('0x6'));module['exports']=function(_0x17c82a,_0x3c6aa2){return _0x17c82a[_0x3005('0x7')](_0x3005('0x8'),attributes,{'tableName':_0x3005('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x091c=['tools_automations','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','define'];(function(_0xf72888,_0x661b9d){var _0x58ed5f=function(_0x390d52){while(--_0x390d52){_0xf72888['push'](_0xf72888['shift']());}};_0x58ed5f(++_0x661b9d);}(_0x091c,0x1af));var _0xc091=function(_0x86b150,_0x56ba66){_0x86b150=_0x86b150-0x0;var _0x8d49a9=_0x091c[_0x86b150];return _0x8d49a9;};'use strict';var _=require('lodash');var util=require(_0xc091('0x0'));var logger=require(_0xc091('0x1'))('api');var moment=require(_0xc091('0x2'));var BPromise=require(_0xc091('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc091('0x4'));var rimraf=require(_0xc091('0x5'));var config=require(_0xc091('0x6'));var attributes=require(_0xc091('0x7'));module['exports']=function(_0x20c448,_0x112283){return _0x20c448[_0xc091('0x8')]('Automation',attributes,{'tableName':_0xc091('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 592c512..c928275 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cd7=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x2884a7,_0x3efe41){var _0x513fd6=function(_0x3bca3e){while(--_0x3bca3e){_0x2884a7['push'](_0x2884a7['shift']());}};_0x513fd6(++_0x3efe41);}(_0x9cd7,0x146));var _0x79cd=function(_0x5210a2,_0x4f5288){_0x5210a2=_0x5210a2-0x0;var _0x597bd9=_0x9cd7[_0x5210a2];return _0x597bd9;};'use strict';var _=require(_0x79cd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x79cd('0x1'));var rs=require(_0x79cd('0x2'));var fs=require('fs');var Redis=require(_0x79cd('0x3'));var db=require(_0x79cd('0x4'))['db'];var utils=require(_0x79cd('0x5'));var logger=require(_0x79cd('0x6'))(_0x79cd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x79cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dc8f8,_0x3e9dc6,_0x1e662e){return new BPromise(function(_0x1469a9,_0x2acc18){return client[_0x79cd('0x9')](_0x4dc8f8,_0x1e662e)[_0x79cd('0xa')](function(_0x469514){logger[_0x79cd('0xb')](_0x79cd('0xc'),_0x3e9dc6,_0x79cd('0xd'));logger[_0x79cd('0xe')](_0x79cd('0xf'),_0x3e9dc6,'request\x20sent',JSON[_0x79cd('0x10')](_0x469514));if(_0x469514[_0x79cd('0x11')]){if(_0x469514[_0x79cd('0x11')][_0x79cd('0x12')]===0x1f4){logger[_0x79cd('0x11')](_0x79cd('0xc'),_0x3e9dc6,_0x469514[_0x79cd('0x11')][_0x79cd('0x13')]);return _0x2acc18(_0x469514[_0x79cd('0x11')][_0x79cd('0x13')]);}logger[_0x79cd('0x11')](_0x79cd('0xc'),_0x3e9dc6,_0x469514['error'][_0x79cd('0x13')]);return _0x1469a9(_0x469514[_0x79cd('0x11')]['message']);}else{logger[_0x79cd('0xb')](_0x79cd('0xc'),_0x3e9dc6,_0x79cd('0xd'));_0x1469a9(_0x469514[_0x79cd('0x14')][_0x79cd('0x13')]);}})[_0x79cd('0x15')](function(_0x59fa44){logger[_0x79cd('0x11')](_0x79cd('0xc'),_0x3e9dc6,_0x59fa44);_0x2acc18(_0x59fa44);});});} \ No newline at end of file +var _0x63e5=['debug','Automation,\x20%s,\x20%s,\x20%s','error','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x46b7e5,_0x420649){var _0x2bf2ac=function(_0x12a073){while(--_0x12a073){_0x46b7e5['push'](_0x46b7e5['shift']());}};_0x2bf2ac(++_0x420649);}(_0x63e5,0x74));var _0x563e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x63e5[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x563e('0x0'));var util=require(_0x563e('0x1'));var moment=require(_0x563e('0x2'));var BPromise=require(_0x563e('0x3'));var rs=require(_0x563e('0x4'));var fs=require('fs');var Redis=require(_0x563e('0x5'));var db=require(_0x563e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x563e('0x7'))(_0x563e('0x8'));var config=require(_0x563e('0x9'));var jayson=require(_0x563e('0xa'));var client=jayson[_0x563e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5971fe,_0x5b1d30,_0x342336){return new BPromise(function(_0x284da1,_0x938ac3){return client[_0x563e('0xc')](_0x5971fe,_0x342336)[_0x563e('0xd')](function(_0x694bd0){logger[_0x563e('0xe')]('Automation,\x20%s,\x20%s',_0x5b1d30,_0x563e('0xf'));logger[_0x563e('0x10')](_0x563e('0x11'),_0x5b1d30,_0x563e('0xf'),JSON['stringify'](_0x694bd0));if(_0x694bd0[_0x563e('0x12')]){if(_0x694bd0[_0x563e('0x12')]['code']===0x1f4){logger[_0x563e('0x12')](_0x563e('0x13'),_0x5b1d30,_0x694bd0[_0x563e('0x12')][_0x563e('0x14')]);return _0x938ac3(_0x694bd0[_0x563e('0x12')][_0x563e('0x14')]);}logger[_0x563e('0x12')](_0x563e('0x13'),_0x5b1d30,_0x694bd0[_0x563e('0x12')][_0x563e('0x14')]);return _0x284da1(_0x694bd0[_0x563e('0x12')][_0x563e('0x14')]);}else{logger[_0x563e('0xe')](_0x563e('0x13'),_0x5b1d30,_0x563e('0xf'));_0x284da1(_0x694bd0['result'][_0x563e('0x14')]);}})[_0x563e('0x15')](function(_0x51bd52){logger[_0x563e('0x12')]('Automation,\x20%s,\x20%s',_0x5b1d30,_0x51bd52);_0x938ac3(_0x51bd52);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5b35a1b..20acd1a 100644 --- a/server/api/automation/index.js +++ b/server/api/automation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdd0=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put'];(function(_0x3bcb52,_0x2312a0){var _0x21add4=function(_0x2d3a1a){while(--_0x2d3a1a){_0x3bcb52['push'](_0x3bcb52['shift']());}};_0x21add4(++_0x2312a0);}(_0xcdd0,0xbd));var _0x0cdd=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xcdd0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require('multer');var util=require(_0x0cdd('0x0'));var path=require(_0x0cdd('0x1'));var timeout=require(_0x0cdd('0x2'));var express=require(_0x0cdd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0cdd('0x4'));var config=require(_0x0cdd('0x5'));var controller=require(_0x0cdd('0x6'));router[_0x0cdd('0x7')]('/',auth[_0x0cdd('0x8')](),controller[_0x0cdd('0x9')]);router[_0x0cdd('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0cdd('0x7')](_0x0cdd('0xa'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xb')]);router[_0x0cdd('0x7')](_0x0cdd('0xc'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xd')]);router[_0x0cdd('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0cdd('0xe')](_0x0cdd('0xa'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xf')]);router[_0x0cdd('0xe')](_0x0cdd('0xc'),auth['isAuthenticated'](),controller[_0x0cdd('0x10')]);router[_0x0cdd('0x11')](_0x0cdd('0x12'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0x13')]);router[_0x0cdd('0x14')](_0x0cdd('0x12'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0x15')]);module[_0x0cdd('0x16')]=router; \ No newline at end of file +var _0xa62c=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','put','update','destroy','exports','multer'];(function(_0x2812ad,_0x32926d){var _0x138992=function(_0x19a519){while(--_0x19a519){_0x2812ad['push'](_0x2812ad['shift']());}};_0x138992(++_0x32926d);}(_0xa62c,0x186));var _0xca62=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0xa62c[_0x1e91eb];return _0x2af75a;};'use strict';var multer=require(_0xca62('0x0'));var util=require('util');var path=require(_0xca62('0x1'));var timeout=require(_0xca62('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xca62('0x3'));var interaction=require(_0xca62('0x4'));var config=require(_0xca62('0x5'));var controller=require(_0xca62('0x6'));router[_0xca62('0x7')]('/',auth[_0xca62('0x8')](),controller[_0xca62('0x9')]);router[_0xca62('0x7')](_0xca62('0xa'),auth[_0xca62('0x8')](),controller[_0xca62('0xb')]);router[_0xca62('0x7')](_0xca62('0xc'),auth[_0xca62('0x8')](),controller[_0xca62('0xd')]);router[_0xca62('0x7')](_0xca62('0xe'),auth['isAuthenticated'](),controller[_0xca62('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xca62('0x10')]);router[_0xca62('0x11')](_0xca62('0xc'),auth[_0xca62('0x8')](),controller['addConditions']);router[_0xca62('0x11')](_0xca62('0xe'),auth['isAuthenticated'](),controller[_0xca62('0x12')]);router[_0xca62('0x13')](_0xca62('0xa'),auth[_0xca62('0x8')](),controller[_0xca62('0x14')]);router['delete'](_0xca62('0xa'),auth[_0xca62('0x8')](),controller[_0xca62('0x15')]);module[_0xca62('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 58f947f..cc4ef0b 100644 --- a/server/api/campaign/campaign.attributes.js +++ b/server/api/campaign/campaign.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00eb=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','STRING','name','ENUM'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x00eb,0x1d9));var _0xb00e=function(_0x12f1b4,_0x5ae82b){_0x12f1b4=_0x12f1b4-0x0;var _0x56832a=_0x00eb[_0x12f1b4];return _0x56832a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb00e('0x0')],'unique':_0xb00e('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb00e('0x2')](_0xb00e('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xb00e('0x0')]},'active':{'type':Sequelize[_0xb00e('0x4')],'defaultValue':0x0,'comment':_0xb00e('0x5')},'limitCalls':{'type':Sequelize[_0xb00e('0x6')](0x4)[_0xb00e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb00e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb00e('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb00e('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xb00e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb00e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb00e('0x6')](0x3)[_0xb00e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb00e('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb00e('0x6')](0x5)[_0xb00e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb00e('0x6')](0x3)[_0xb00e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb00e('0x6')](0x5)[_0xb00e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb00e('0x6')](0x3)[_0xb00e('0x7')],'defaultValue':0x3,'comment':_0xb00e('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb00e('0x6')](0x5)[_0xb00e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb00e('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb00e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb00e('0xd')},'dialTimezone':{'type':Sequelize[_0xb00e('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb00e('0x0')],'defaultValue':_0xb00e('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xb00e('0x2')](_0xb00e('0xf'),_0xb00e('0x10'),'onlyIfOpen'),'defaultValue':_0xb00e('0xf')},'dialAMDActive':{'type':Sequelize[_0xb00e('0x4')],'defaultValue':0x0,'comment':_0xb00e('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xb00e('0x6')](0x9)[_0xb00e('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb00e('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xb00e('0x6')](0x9)[_0xb00e('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb00e('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb00e('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb00e('0x6')](0x9)[_0xb00e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb00e('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xb00e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb00e('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb00e('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb00e('0x6')](0x9)[_0xb00e('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb00e('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb00e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb00e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb00e('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb00e('0x2')](_0xb00e('0x19'),_0xb00e('0x1a')),'defaultValue':_0xb00e('0x19')},'dialPrefix':{'type':Sequelize[_0xb00e('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb00e('0x6')](0x3)[_0xb00e('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xb00e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb00e('0x1b')}}; \ No newline at end of file +var _0xc625=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xc625,0x1d7));var _0x5c62=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0xc625[_0x48999d];return _0x1ad0d1;};'use strict';var Sequelize=require(_0x5c62('0x0'));module[_0x5c62('0x1')]={'name':{'type':Sequelize[_0x5c62('0x2')],'unique':_0x5c62('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x5c62('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x5c62('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5c62('0x5')},'limitCalls':{'type':Sequelize[_0x5c62('0x6')](0x4)[_0x5c62('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5c62('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5c62('0x6')](0x3)[_0x5c62('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5c62('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5c62('0x6')](0x3)[_0x5c62('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5c62('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5c62('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5c62('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5c62('0x6')](0x5)[_0x5c62('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5c62('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5c62('0x7')],'defaultValue':0x3,'comment':_0x5c62('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5c62('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5c62('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x5c62('0xc')](_0x5c62('0xd'),_0x5c62('0xe'),_0x5c62('0xf')),'defaultValue':_0x5c62('0xd')},'dialAMDActive':{'type':Sequelize[_0x5c62('0x10')],'defaultValue':0x0,'comment':_0x5c62('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5c62('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5c62('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x5c62('0x6')](0x9)[_0x5c62('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5c62('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5c62('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5c62('0x6')](0x9)[_0x5c62('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5c62('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x5c62('0x6')](0x9)[_0x5c62('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5c62('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5c62('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5c62('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5c62('0x6')](0x9)[_0x5c62('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5c62('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5c62('0x6')](0x5)[_0x5c62('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5c62('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5c62('0x6')](0x9)[_0x5c62('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5c62('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5c62('0xc')](_0x5c62('0x1a'),_0x5c62('0x1b')),'defaultValue':_0x5c62('0x1a')},'dialPrefix':{'type':Sequelize[_0x5c62('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5c62('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5c62('0x1c')},'dialCutDigit':{'type':Sequelize[_0x5c62('0x6')](0x3)[_0x5c62('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index dc942ed..bc2f451 100644 --- a/server/api/campaign/campaign.controller.js +++ b/server/api/campaign/campaign.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfb6=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','end','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filters','filter','merge','options','rows','catch','show','params','keys','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','clone','includeAll','omit','updatedAt','createdAt','IvrCampaigns','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','CampaignId','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','order','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','into','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js'];(function(_0x1d84d0,_0x5d0318){var _0xee93a0=function(_0x13c6b4){while(--_0x13c6b4){_0x1d84d0['push'](_0x1d84d0['shift']());}};_0xee93a0(++_0x5d0318);}(_0xbfb6,0x77));var _0x6bfb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbfb6[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6bfb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bfb('0x1'));var jsonpatch=require(_0x6bfb('0x2'));var rp=require(_0x6bfb('0x3'));var moment=require(_0x6bfb('0x4'));var BPromise=require(_0x6bfb('0x5'));var Mustache=require(_0x6bfb('0x6'));var util=require('util');var path=require(_0x6bfb('0x7'));var sox=require(_0x6bfb('0x8'));var csv=require('to-csv');var ejs=require(_0x6bfb('0x9'));var fs=require('fs');var _=require(_0x6bfb('0xa'));var squel=require(_0x6bfb('0xb'));var crypto=require('crypto');var jsforce=require(_0x6bfb('0xc'));var deskjs=require(_0x6bfb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6bfb('0xe'));var Papa=require(_0x6bfb('0xf'));var Redis=require(_0x6bfb('0x10'));var authService=require(_0x6bfb('0x11'));var qs=require(_0x6bfb('0x12'));var as=require(_0x6bfb('0x13'));var hardwareService=require(_0x6bfb('0x14'));var logger=require(_0x6bfb('0x15'))('api');var utils=require(_0x6bfb('0x16'));var config=require(_0x6bfb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f9d9,_0x6f7b85){_0x6f7b85=_0x6f7b85||0xcc;return function(_0x535217){if(_0x535217){return _0x38f9d9[_0x6bfb('0x18')](_0x6f7b85);}return _0x38f9d9[_0x6bfb('0x19')](_0x6f7b85)['end']();};}function respondWithResult(_0x5b0edc,_0x10880b){_0x10880b=_0x10880b||0xc8;return function(_0x450462){if(_0x450462){return _0x5b0edc[_0x6bfb('0x19')](_0x10880b)[_0x6bfb('0x1a')](_0x450462);}};}function respondWithFilteredResult(_0x4f73e1,_0x4c8301){return function(_0x1b36e7){if(_0x1b36e7){var _0x5561be=_0x1b36e7[_0x6bfb('0x1b')],_0x26b769=_0x4c8301['offset'],_0x45dc6d=_0x4c8301['offset']+_0x4c8301['limit'],_0x5b8e72;if(_0x45dc6d>=_0x5561be){_0x45dc6d=_0x5561be;_0x5b8e72=0xc8;}else{_0x5b8e72=0xce;}_0x4f73e1[_0x6bfb('0x19')](_0x5b8e72);return _0x4f73e1[_0x6bfb('0x1c')](_0x6bfb('0x1d'),_0x26b769+'-'+_0x45dc6d+'/'+_0x5561be)[_0x6bfb('0x1a')](_0x1b36e7);}return null;};}function patchUpdates(_0x205a55){return function(_0x4cb214){try{jsonpatch[_0x6bfb('0x1e')](_0x4cb214,_0x205a55,!![]);}catch(_0x12eb55){return BPromise[_0x6bfb('0x1f')](_0x12eb55);}return _0x4cb214['save']();};}function saveUpdates(_0x859d53,_0x9bb4d){return function(_0x1154c0){if(_0x1154c0){return _0x1154c0[_0x6bfb('0x20')](_0x859d53)[_0x6bfb('0x21')](function(_0x21b646){return _0x21b646;});}return null;};}function removeEntity(_0x2713b3,_0x12af2e){return function(_0xba4973){if(_0xba4973){return _0xba4973['destroy']()[_0x6bfb('0x21')](function(){var _0x58ee98=_0xba4973[_0x6bfb('0x22')]({'plain':!![]});var _0x191957='IvrCampaigns';return db[_0x6bfb('0x23')][_0x6bfb('0x24')]({'where':{'type':_0x191957,'resourceId':_0x58ee98['id']}})['then'](function(){return _0xba4973;});})[_0x6bfb('0x21')](function(){_0x2713b3[_0x6bfb('0x19')](0xcc)[_0x6bfb('0x25')]();});}};}function handleEntityNotFound(_0x1a2821,_0xd0e643){return function(_0x148b89){if(!_0x148b89){_0x1a2821[_0x6bfb('0x18')](0x194);}return _0x148b89;};}function handleError(_0x542b4f,_0xdbc79f){_0xdbc79f=_0xdbc79f||0x1f4;return function(_0x3de315){logger['error'](_0x3de315[_0x6bfb('0x26')]);if(_0x3de315[_0x6bfb('0x27')]){delete _0x3de315[_0x6bfb('0x27')];}_0x542b4f[_0x6bfb('0x19')](_0xdbc79f)[_0x6bfb('0x28')](_0x3de315);};}exports[_0x6bfb('0x29')]=function(_0x5ac5bf,_0x68bf7d){var _0x1ac97e={},_0x54cecf={},_0x3f2b9f={'count':0x0,'rows':[]};var _0x1f4170=_[_0x6bfb('0x2a')](db[_0x6bfb('0x2b')][_0x6bfb('0x2c')],function(_0x58a79a){return{'name':_0x58a79a[_0x6bfb('0x2d')],'type':_0x58a79a[_0x6bfb('0x2e')][_0x6bfb('0x2f')]};});_0x54cecf[_0x6bfb('0x30')]=_[_0x6bfb('0x2a')](_0x1f4170,_0x6bfb('0x27'));_0x54cecf[_0x6bfb('0x31')]=_['keys'](_0x5ac5bf[_0x6bfb('0x31')]);_0x54cecf['filters']=_['intersection'](_0x54cecf[_0x6bfb('0x30')],_0x54cecf[_0x6bfb('0x31')]);_0x1ac97e[_0x6bfb('0x32')]=_[_0x6bfb('0x33')](_0x54cecf[_0x6bfb('0x30')],qs[_0x6bfb('0x34')](_0x5ac5bf[_0x6bfb('0x31')][_0x6bfb('0x34')]));_0x1ac97e[_0x6bfb('0x32')]=_0x1ac97e[_0x6bfb('0x32')]['length']?_0x1ac97e[_0x6bfb('0x32')]:_0x54cecf[_0x6bfb('0x30')];if(!_0x5ac5bf['query'][_0x6bfb('0x35')](_0x6bfb('0x36'))){_0x1ac97e[_0x6bfb('0x37')]=qs['limit'](_0x5ac5bf[_0x6bfb('0x31')][_0x6bfb('0x37')]);_0x1ac97e[_0x6bfb('0x38')]=qs[_0x6bfb('0x38')](_0x5ac5bf['query'][_0x6bfb('0x38')]);}_0x1ac97e['order']=qs[_0x6bfb('0x39')](_0x5ac5bf['query'][_0x6bfb('0x39')]);_0x1ac97e[_0x6bfb('0x3a')]=qs['filters'](_[_0x6bfb('0x3b')](_0x5ac5bf[_0x6bfb('0x31')],_0x54cecf[_0x6bfb('0x3c')]));if(_0x5ac5bf[_0x6bfb('0x31')][_0x6bfb('0x3d')]){_0x1ac97e[_0x6bfb('0x3a')]=_[_0x6bfb('0x3e')](_0x1ac97e['where'],{'$or':_['map'](_0x1f4170,function(_0x2a564d){if(_0x2a564d[_0x6bfb('0x2e')]!=='VIRTUAL'){var _0x1023a8={};_0x1023a8[_0x2a564d['name']]={'$like':'%'+_0x5ac5bf[_0x6bfb('0x31')][_0x6bfb('0x3d')]+'%'};return _0x1023a8;}})});}_0x1ac97e=_['merge']({},_0x1ac97e,_0x5ac5bf[_0x6bfb('0x3f')]);var _0x1d8049={'where':_0x1ac97e[_0x6bfb('0x3a')]};return db['Campaign'][_0x6bfb('0x1b')](_0x1d8049)[_0x6bfb('0x21')](function(_0x570665){_0x3f2b9f[_0x6bfb('0x1b')]=_0x570665;if(_0x5ac5bf[_0x6bfb('0x31')]['includeAll']){_0x1ac97e['include']=[{'all':!![]}];}return db[_0x6bfb('0x2b')]['findAll'](_0x1ac97e);})[_0x6bfb('0x21')](function(_0x57f324){_0x3f2b9f[_0x6bfb('0x40')]=_0x57f324;return _0x3f2b9f;})[_0x6bfb('0x21')](respondWithFilteredResult(_0x68bf7d,_0x1ac97e))[_0x6bfb('0x41')](handleError(_0x68bf7d,null));};exports[_0x6bfb('0x42')]=function(_0x462602,_0x520bb9){var _0x1138bb={'raw':![],'where':{'id':_0x462602[_0x6bfb('0x43')]['id']}},_0x50410b={};_0x50410b[_0x6bfb('0x30')]=_[_0x6bfb('0x44')](db['Campaign'][_0x6bfb('0x2c')]);_0x50410b[_0x6bfb('0x31')]=_['keys'](_0x462602['query']);_0x50410b[_0x6bfb('0x3c')]=_[_0x6bfb('0x33')](_0x50410b[_0x6bfb('0x30')],_0x50410b[_0x6bfb('0x31')]);_0x1138bb[_0x6bfb('0x32')]=_['intersection'](_0x50410b[_0x6bfb('0x30')],qs[_0x6bfb('0x34')](_0x462602[_0x6bfb('0x31')][_0x6bfb('0x34')]));_0x1138bb['attributes']=_0x1138bb[_0x6bfb('0x32')][_0x6bfb('0x45')]?_0x1138bb[_0x6bfb('0x32')]:_0x50410b[_0x6bfb('0x30')];if(_0x462602[_0x6bfb('0x31')]['includeAll']){_0x1138bb[_0x6bfb('0x46')]=[{'all':!![]}];}_0x1138bb=_[_0x6bfb('0x3e')]({},_0x1138bb,_0x462602[_0x6bfb('0x3f')]);return db[_0x6bfb('0x2b')][_0x6bfb('0x47')](_0x1138bb)[_0x6bfb('0x21')](handleEntityNotFound(_0x520bb9,null))[_0x6bfb('0x21')](respondWithResult(_0x520bb9,null))[_0x6bfb('0x41')](handleError(_0x520bb9,null));};exports[_0x6bfb('0x48')]=function(_0x4949a2,_0xf4e16c){return db[_0x6bfb('0x2b')][_0x6bfb('0x48')](_0x4949a2[_0x6bfb('0x49')],{})[_0x6bfb('0x21')](function(_0x2dcb98){var _0x5a4db8=_0x4949a2[_0x6bfb('0x4a')][_0x6bfb('0x22')]({'plain':!![]});if(!_0x5a4db8)throw new Error(_0x6bfb('0x4b'));if(_0x5a4db8[_0x6bfb('0x4c')]==='user'){var _0x5be0b9=_0x2dcb98[_0x6bfb('0x22')]({'plain':!![]});var _0x28ae94='IvrCampaigns';return db[_0x6bfb('0x4d')][_0x6bfb('0x47')]({'where':{'name':_0x28ae94,'userProfileId':_0x5a4db8[_0x6bfb('0x4e')]},'raw':!![]})[_0x6bfb('0x21')](function(_0x2b0efb){if(_0x2b0efb&&_0x2b0efb['autoAssociation']===0x0){return db[_0x6bfb('0x23')]['create']({'name':_0x5be0b9[_0x6bfb('0x27')],'resourceId':_0x5be0b9['id'],'type':_0x2b0efb[_0x6bfb('0x27')],'sectionId':_0x2b0efb['id']},{})[_0x6bfb('0x21')](function(){return _0x2dcb98;});}else{return _0x2dcb98;}})[_0x6bfb('0x41')](function(_0x317f2d){logger[_0x6bfb('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x317f2d);throw _0x317f2d;});}return _0x2dcb98;})[_0x6bfb('0x21')](respondWithResult(_0xf4e16c,0xc9))[_0x6bfb('0x41')](handleError(_0xf4e16c,null));};exports[_0x6bfb('0x50')]=function(_0x43e515,_0x160cd1){var _0x21b6b0={'where':{'id':_0x43e515['params']['id']}},_0xc3ca6c={};_0xc3ca6c[_0x6bfb('0x30')]=_[_0x6bfb('0x44')](db[_0x6bfb('0x2b')][_0x6bfb('0x2c')]);_0x21b6b0['attributes']=_[_0x6bfb('0x33')](_0xc3ca6c[_0x6bfb('0x30')],qs[_0x6bfb('0x34')](_0x43e515['query']['fields']));_0x21b6b0[_0x6bfb('0x32')]=_0x21b6b0['attributes'][_0x6bfb('0x45')]?_0x21b6b0[_0x6bfb('0x32')]:_0xc3ca6c[_0x6bfb('0x30')];if(_0x43e515['query'][_0x6bfb('0x51')]){_0x21b6b0['include']=[{'all':!![]}];}_0x21b6b0=_[_0x6bfb('0x3e')]({},_0x21b6b0,_0x43e515['options']);return db['Campaign']['find'](_0x21b6b0)[_0x6bfb('0x21')](handleEntityNotFound(_0x160cd1,null))[_0x6bfb('0x21')](function(_0x576cf2){if(_0x576cf2){var _0x4c9816=_0x576cf2[_0x6bfb('0x22')]({'plain':!![]});_0x4c9816=qs[_0x6bfb('0x52')](_0x4c9816,['id','createdAt',_0x6bfb('0x53')]);_0x43e515['body']=_[_0x6bfb('0x52')](_0x43e515[_0x6bfb('0x49')],['id',_0x6bfb('0x54'),'updatedAt']);return db['Campaign'][_0x6bfb('0x48')](_[_0x6bfb('0x3e')](_0x4c9816,_0x43e515['body']),{'include':_0x43e515[_0x6bfb('0x31')][_0x6bfb('0x51')]?[{'all':!![]}]:undefined})[_0x6bfb('0x21')](function(_0x30e1f2){var _0x276143=_0x43e515[_0x6bfb('0x4a')][_0x6bfb('0x22')]({'plain':!![]});if(!_0x276143)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x276143[_0x6bfb('0x4c')]==='user'){var _0x459491=_0x30e1f2[_0x6bfb('0x22')]({'plain':!![]});var _0x1769c5=_0x6bfb('0x55');return db[_0x6bfb('0x4d')][_0x6bfb('0x47')]({'where':{'name':_0x1769c5,'userProfileId':_0x276143[_0x6bfb('0x4e')]},'raw':!![]})[_0x6bfb('0x21')](function(_0x2a7794){if(_0x2a7794&&_0x2a7794['autoAssociation']===0x0){return db['UserProfileResource'][_0x6bfb('0x48')]({'name':_0x459491[_0x6bfb('0x27')],'resourceId':_0x459491['id'],'type':_0x2a7794[_0x6bfb('0x27')],'sectionId':_0x2a7794['id']},{})[_0x6bfb('0x21')](function(){return _0x30e1f2;});}else{return _0x30e1f2;}})[_0x6bfb('0x41')](function(_0x4d0793){logger[_0x6bfb('0x4f')](_0x6bfb('0x56'),_0x4d0793);throw _0x4d0793;});}return _0x30e1f2;});}})[_0x6bfb('0x21')](respondWithResult(_0x160cd1,0xc9))[_0x6bfb('0x41')](handleError(_0x160cd1,null));};exports['update']=function(_0x54c86b,_0x333ef9){if(_0x54c86b[_0x6bfb('0x49')]['id']){delete _0x54c86b[_0x6bfb('0x49')]['id'];}return db[_0x6bfb('0x2b')][_0x6bfb('0x47')]({'where':{'id':_0x54c86b['params']['id']}})['then'](handleEntityNotFound(_0x333ef9,null))[_0x6bfb('0x21')](saveUpdates(_0x54c86b[_0x6bfb('0x49')],null))[_0x6bfb('0x21')](respondWithResult(_0x333ef9,null))['catch'](handleError(_0x333ef9,null));};exports[_0x6bfb('0x24')]=function(_0x3ccb81,_0x3941f1){return db[_0x6bfb('0x2b')][_0x6bfb('0x47')]({'where':{'id':_0x3ccb81[_0x6bfb('0x43')]['id']}})[_0x6bfb('0x21')](handleEntityNotFound(_0x3941f1,null))[_0x6bfb('0x21')](removeEntity(_0x3941f1,null))[_0x6bfb('0x41')](handleError(_0x3941f1,null));};exports['getHoppers']=function(_0x71de79,_0x29f3da,_0x2b9796){var _0x4b8bde={'raw':!![],'where':{}};var _0xc84d41={};var _0x3a440b={'count':0x0,'rows':[]};return db[_0x6bfb('0x2b')][_0x6bfb('0x57')]({'where':{'id':_0x71de79['params']['id']}})['then'](handleEntityNotFound(_0x29f3da,null))[_0x6bfb('0x21')](function(_0x2cf9dd){if(_0x2cf9dd){_0xc84d41[_0x6bfb('0x30')]=_['keys'](db[_0x6bfb('0x58')][_0x6bfb('0x2c')]);_0xc84d41[_0x6bfb('0x31')]=_[_0x6bfb('0x44')](_0x71de79['query']);_0xc84d41[_0x6bfb('0x3c')]=_[_0x6bfb('0x33')](_0xc84d41[_0x6bfb('0x30')],_0xc84d41[_0x6bfb('0x31')]);_0x4b8bde[_0x6bfb('0x32')]=_[_0x6bfb('0x33')](_0xc84d41[_0x6bfb('0x30')],qs['fields'](_0x71de79[_0x6bfb('0x31')]['fields']));_0x4b8bde[_0x6bfb('0x32')]=_0x4b8bde[_0x6bfb('0x32')]['length']?_0x4b8bde['attributes']:_0xc84d41[_0x6bfb('0x30')];if(!_0x71de79[_0x6bfb('0x31')][_0x6bfb('0x35')](_0x6bfb('0x36'))){_0x4b8bde[_0x6bfb('0x37')]=qs[_0x6bfb('0x37')](_0x71de79[_0x6bfb('0x31')][_0x6bfb('0x37')]);_0x4b8bde[_0x6bfb('0x38')]=qs[_0x6bfb('0x38')](_0x71de79['query'][_0x6bfb('0x38')]);}_0x4b8bde['order']=qs[_0x6bfb('0x39')](_0x71de79['query']['sort']);_0x4b8bde[_0x6bfb('0x3a')]=qs[_0x6bfb('0x3c')](_[_0x6bfb('0x3b')](_0x71de79['query'],_0xc84d41[_0x6bfb('0x3c')]));_0x4b8bde['where'][_0x6bfb('0x59')]=_0x2cf9dd['id'];if(_0x71de79[_0x6bfb('0x31')][_0x6bfb('0x3d')]){_0x4b8bde[_0x6bfb('0x3a')]=_['merge'](_0x4b8bde['where'],{'$or':_['map'](_0x4b8bde[_0x6bfb('0x32')],function(_0x658568){var _0x3edc73={};_0x3edc73[_0x658568]={'$like':'%'+_0x71de79[_0x6bfb('0x31')][_0x6bfb('0x3d')]+'%'};return _0x3edc73;})});}_0x4b8bde=_[_0x6bfb('0x3e')]({},_0x4b8bde,_0x71de79[_0x6bfb('0x3f')]);return db[_0x6bfb('0x58')]['count']({'where':_0x4b8bde[_0x6bfb('0x3a')]})[_0x6bfb('0x21')](function(_0x278aaa){_0x3a440b['count']=_0x278aaa;if(_0x71de79[_0x6bfb('0x31')][_0x6bfb('0x51')]){_0x4b8bde['include']=[{'all':!![]}];}return db[_0x6bfb('0x58')][_0x6bfb('0x5a')](_0x4b8bde);})[_0x6bfb('0x21')](function(_0x411ab2){_0x3a440b[_0x6bfb('0x40')]=_0x411ab2;return _0x3a440b;});}})[_0x6bfb('0x21')](respondWithFilteredResult(_0x29f3da,_0x4b8bde))[_0x6bfb('0x41')](handleError(_0x29f3da,null));};exports['getHopperHistories']=function(_0x350c93,_0x2a47e0,_0x121d24){var _0x473c04={'raw':!![],'where':{}};var _0x233271={};var _0x308569={'count':0x0,'rows':[]};return db[_0x6bfb('0x2b')]['findOne']({'where':{'id':_0x350c93[_0x6bfb('0x43')]['id']}})[_0x6bfb('0x21')](handleEntityNotFound(_0x2a47e0,null))['then'](function(_0x434fdc){if(_0x434fdc){_0x233271['model']=_[_0x6bfb('0x44')](db[_0x6bfb('0x5b')][_0x6bfb('0x2c')]);_0x233271[_0x6bfb('0x31')]=_['keys'](_0x350c93[_0x6bfb('0x31')]);_0x233271[_0x6bfb('0x3c')]=_[_0x6bfb('0x33')](_0x233271[_0x6bfb('0x30')],_0x233271[_0x6bfb('0x31')]);_0x473c04['attributes']=_[_0x6bfb('0x33')](_0x233271[_0x6bfb('0x30')],qs['fields'](_0x350c93[_0x6bfb('0x31')][_0x6bfb('0x34')]));_0x473c04[_0x6bfb('0x32')]=_0x473c04[_0x6bfb('0x32')]['length']?_0x473c04[_0x6bfb('0x32')]:_0x233271['model'];if(!_0x350c93[_0x6bfb('0x31')]['hasOwnProperty'](_0x6bfb('0x36'))){_0x473c04[_0x6bfb('0x37')]=qs['limit'](_0x350c93[_0x6bfb('0x31')]['limit']);_0x473c04[_0x6bfb('0x38')]=qs[_0x6bfb('0x38')](_0x350c93[_0x6bfb('0x31')][_0x6bfb('0x38')]);}_0x473c04['order']=qs[_0x6bfb('0x39')](_0x350c93[_0x6bfb('0x31')]['sort']);_0x473c04['where']=qs[_0x6bfb('0x3c')](_[_0x6bfb('0x3b')](_0x350c93[_0x6bfb('0x31')],_0x233271[_0x6bfb('0x3c')]));_0x473c04['where'][_0x6bfb('0x59')]=_0x434fdc['id'];if(_0x350c93['query']['filter']){_0x473c04[_0x6bfb('0x3a')]=_[_0x6bfb('0x3e')](_0x473c04['where'],{'$or':_['map'](_0x473c04[_0x6bfb('0x32')],function(_0x15b808){var _0x2cc85c={};_0x2cc85c[_0x15b808]={'$like':'%'+_0x350c93[_0x6bfb('0x31')][_0x6bfb('0x3d')]+'%'};return _0x2cc85c;})});}_0x473c04=_['merge']({},_0x473c04,_0x350c93[_0x6bfb('0x3f')]);return db[_0x6bfb('0x5b')][_0x6bfb('0x1b')]({'where':_0x473c04[_0x6bfb('0x3a')]})[_0x6bfb('0x21')](function(_0x5b36da){_0x308569[_0x6bfb('0x1b')]=_0x5b36da;if(_0x350c93[_0x6bfb('0x31')][_0x6bfb('0x51')]){_0x473c04[_0x6bfb('0x46')]=[{'all':!![]}];}return db[_0x6bfb('0x5b')][_0x6bfb('0x5a')](_0x473c04);})[_0x6bfb('0x21')](function(_0x70ca8c){_0x308569[_0x6bfb('0x40')]=_0x70ca8c;return _0x308569;});}})[_0x6bfb('0x21')](respondWithFilteredResult(_0x2a47e0,_0x473c04))['catch'](handleError(_0x2a47e0,null));};exports[_0x6bfb('0x5c')]=function(_0x456daa,_0x34984d,_0xa47d86){var _0x30ead1={'raw':!![],'where':{}};var _0xc05269={};var _0x28443b={'count':0x0,'rows':[]};return db[_0x6bfb('0x2b')]['findOne']({'where':{'id':_0x456daa['params']['id']}})[_0x6bfb('0x21')](handleEntityNotFound(_0x34984d,null))[_0x6bfb('0x21')](function(_0x10f952){if(_0x10f952){_0xc05269[_0x6bfb('0x30')]=_[_0x6bfb('0x44')](db[_0x6bfb('0x5d')][_0x6bfb('0x2c')]);_0xc05269[_0x6bfb('0x31')]=_[_0x6bfb('0x44')](_0x456daa['query']);_0xc05269[_0x6bfb('0x3c')]=_[_0x6bfb('0x33')](_0xc05269['model'],_0xc05269[_0x6bfb('0x31')]);_0x30ead1['attributes']=_[_0x6bfb('0x33')](_0xc05269['model'],qs[_0x6bfb('0x34')](_0x456daa[_0x6bfb('0x31')]['fields']));_0x30ead1[_0x6bfb('0x32')]=_0x30ead1['attributes'][_0x6bfb('0x45')]?_0x30ead1[_0x6bfb('0x32')]:_0xc05269['model'];if(!_0x456daa[_0x6bfb('0x31')][_0x6bfb('0x35')](_0x6bfb('0x36'))){_0x30ead1['limit']=qs['limit'](_0x456daa[_0x6bfb('0x31')][_0x6bfb('0x37')]);_0x30ead1[_0x6bfb('0x38')]=qs[_0x6bfb('0x38')](_0x456daa[_0x6bfb('0x31')][_0x6bfb('0x38')]);}_0x30ead1['order']=qs[_0x6bfb('0x39')](_0x456daa[_0x6bfb('0x31')]['sort']);_0x30ead1[_0x6bfb('0x3a')]=qs[_0x6bfb('0x3c')](_[_0x6bfb('0x3b')](_0x456daa[_0x6bfb('0x31')],_0xc05269[_0x6bfb('0x3c')]));_0x30ead1['where']['CampaignId']=_0x10f952['id'];if(_0x456daa[_0x6bfb('0x31')][_0x6bfb('0x3d')]){_0x30ead1['where']=_[_0x6bfb('0x3e')](_0x30ead1[_0x6bfb('0x3a')],{'$or':_[_0x6bfb('0x2a')](_0x30ead1['attributes'],function(_0x3870e9){var _0x5b2509={};_0x5b2509[_0x3870e9]={'$like':'%'+_0x456daa[_0x6bfb('0x31')][_0x6bfb('0x3d')]+'%'};return _0x5b2509;})});}_0x30ead1=_[_0x6bfb('0x3e')]({},_0x30ead1,_0x456daa[_0x6bfb('0x3f')]);return db[_0x6bfb('0x5d')][_0x6bfb('0x1b')]({'where':_0x30ead1['where']})[_0x6bfb('0x21')](function(_0x4997f4){_0x28443b[_0x6bfb('0x1b')]=_0x4997f4;if(_0x456daa[_0x6bfb('0x31')][_0x6bfb('0x51')]){_0x30ead1[_0x6bfb('0x46')]=[{'all':!![]}];}return db[_0x6bfb('0x5d')]['findAll'](_0x30ead1);})[_0x6bfb('0x21')](function(_0x909dee){_0x28443b[_0x6bfb('0x40')]=_0x909dee;return _0x28443b;});}})[_0x6bfb('0x21')](respondWithFilteredResult(_0x34984d,_0x30ead1))[_0x6bfb('0x41')](handleError(_0x34984d,null));};exports[_0x6bfb('0x5e')]=function(_0x32b688,_0x45a441,_0x9d81b1){var _0x234fee={'raw':!![],'where':{}};var _0x5293b1={};var _0x16ab52={'count':0x0,'rows':[]};return db[_0x6bfb('0x2b')][_0x6bfb('0x57')]({'where':{'id':_0x32b688[_0x6bfb('0x43')]['id']}})['then'](handleEntityNotFound(_0x45a441,null))[_0x6bfb('0x21')](function(_0x5531ad){if(_0x5531ad){_0x5293b1['model']=_['keys'](db[_0x6bfb('0x5f')][_0x6bfb('0x2c')]);_0x5293b1[_0x6bfb('0x31')]=_[_0x6bfb('0x44')](_0x32b688[_0x6bfb('0x31')]);_0x5293b1[_0x6bfb('0x3c')]=_['intersection'](_0x5293b1[_0x6bfb('0x30')],_0x5293b1[_0x6bfb('0x31')]);_0x234fee['attributes']=_['intersection'](_0x5293b1['model'],qs[_0x6bfb('0x34')](_0x32b688[_0x6bfb('0x31')][_0x6bfb('0x34')]));_0x234fee[_0x6bfb('0x32')]=_0x234fee['attributes'][_0x6bfb('0x45')]?_0x234fee[_0x6bfb('0x32')]:_0x5293b1[_0x6bfb('0x30')];if(!_0x32b688['query'][_0x6bfb('0x35')](_0x6bfb('0x36'))){_0x234fee[_0x6bfb('0x37')]=qs['limit'](_0x32b688['query'][_0x6bfb('0x37')]);_0x234fee[_0x6bfb('0x38')]=qs[_0x6bfb('0x38')](_0x32b688[_0x6bfb('0x31')][_0x6bfb('0x38')]);}_0x234fee[_0x6bfb('0x60')]=qs[_0x6bfb('0x39')](_0x32b688['query'][_0x6bfb('0x39')]);_0x234fee[_0x6bfb('0x3a')]=qs['filters'](_['pick'](_0x32b688['query'],_0x5293b1[_0x6bfb('0x3c')]));_0x234fee[_0x6bfb('0x3a')][_0x6bfb('0x59')]=_0x5531ad['id'];if(_0x32b688[_0x6bfb('0x31')]['filter']){_0x234fee[_0x6bfb('0x3a')]=_[_0x6bfb('0x3e')](_0x234fee[_0x6bfb('0x3a')],{'$or':_[_0x6bfb('0x2a')](_0x234fee[_0x6bfb('0x32')],function(_0xbc5be1){var _0x2a3cb8={};_0x2a3cb8[_0xbc5be1]={'$like':'%'+_0x32b688['query']['filter']+'%'};return _0x2a3cb8;})});}_0x234fee=_[_0x6bfb('0x3e')]({},_0x234fee,_0x32b688[_0x6bfb('0x3f')]);return db['CmHopperBlack'][_0x6bfb('0x1b')]({'where':_0x234fee[_0x6bfb('0x3a')]})[_0x6bfb('0x21')](function(_0x43b512){_0x16ab52['count']=_0x43b512;if(_0x32b688[_0x6bfb('0x31')][_0x6bfb('0x51')]){_0x234fee[_0x6bfb('0x46')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x6bfb('0x5a')](_0x234fee);})[_0x6bfb('0x21')](function(_0x2c4cf1){_0x16ab52[_0x6bfb('0x40')]=_0x2c4cf1;return _0x16ab52;});}})[_0x6bfb('0x21')](respondWithFilteredResult(_0x45a441,_0x234fee))[_0x6bfb('0x41')](handleError(_0x45a441,null));};exports[_0x6bfb('0x61')]=function(_0x493078,_0xf43843,_0x22f8bf){var _0x31d9d2={};var _0x14ef3c={};var _0x5f2c99;var _0x10fa10;return db[_0x6bfb('0x2b')][_0x6bfb('0x57')]({'where':{'id':_0x493078['params']['id']}})[_0x6bfb('0x21')](handleEntityNotFound(_0xf43843,null))['then'](function(_0x432ce3){if(_0x432ce3){_0x5f2c99=_0x432ce3;_0x14ef3c[_0x6bfb('0x30')]=_[_0x6bfb('0x44')](db[_0x6bfb('0x62')][_0x6bfb('0x2c')]);_0x14ef3c[_0x6bfb('0x31')]=_['keys'](_0x493078[_0x6bfb('0x31')]);_0x14ef3c[_0x6bfb('0x3c')]=_['intersection'](_0x14ef3c['model'],_0x14ef3c[_0x6bfb('0x31')]);_0x31d9d2[_0x6bfb('0x32')]=_['intersection'](_0x14ef3c[_0x6bfb('0x30')],qs[_0x6bfb('0x34')](_0x493078[_0x6bfb('0x31')]['fields']));_0x31d9d2['attributes']=_0x31d9d2[_0x6bfb('0x32')]['length']?_0x31d9d2[_0x6bfb('0x32')]:_0x14ef3c['model'];_0x31d9d2['order']=qs[_0x6bfb('0x39')](_0x493078[_0x6bfb('0x31')]['sort']);_0x31d9d2['where']=qs[_0x6bfb('0x3c')](_[_0x6bfb('0x3b')](_0x493078['query'],_0x14ef3c[_0x6bfb('0x3c')]));if(_0x493078[_0x6bfb('0x31')]['filter']){_0x31d9d2[_0x6bfb('0x3a')]=_[_0x6bfb('0x3e')](_0x31d9d2['where'],{'$or':_['map'](_0x31d9d2['attributes'],function(_0x56ef3b){var _0x775274={};_0x775274[_0x56ef3b]={'$like':'%'+_0x493078[_0x6bfb('0x31')][_0x6bfb('0x3d')]+'%'};return _0x775274;})});}_0x31d9d2=_[_0x6bfb('0x3e')]({},_0x31d9d2,_0x493078['options']);return _0x5f2c99[_0x6bfb('0x61')](_0x31d9d2);}})[_0x6bfb('0x21')](function(_0x402458){if(_0x402458){_0x10fa10=_0x402458[_0x6bfb('0x45')];if(!_0x493078[_0x6bfb('0x31')][_0x6bfb('0x35')]('nolimit')){_0x31d9d2[_0x6bfb('0x37')]=qs[_0x6bfb('0x37')](_0x493078['query'][_0x6bfb('0x37')]);_0x31d9d2[_0x6bfb('0x38')]=qs['offset'](_0x493078[_0x6bfb('0x31')][_0x6bfb('0x38')]);}return _0x5f2c99[_0x6bfb('0x61')](_0x31d9d2);}})[_0x6bfb('0x21')](function(_0x21311f){if(_0x21311f){return _0x21311f?{'count':_0x10fa10,'rows':_0x21311f}:null;}})['then'](respondWithResult(_0xf43843,null))[_0x6bfb('0x41')](handleError(_0xf43843,null));};exports[_0x6bfb('0x63')]=function(_0xaf442a,_0x1380ed,_0x31a989){var _0x3bbac2,_0x571776;return db[_0x6bfb('0x2b')][_0x6bfb('0x47')]({'where':{'id':_0xaf442a[_0x6bfb('0x43')]['id']}})[_0x6bfb('0x21')](handleEntityNotFound(_0x1380ed,null))[_0x6bfb('0x21')](function(_0x366b03){if(_0x366b03){_0x571776=_0x366b03;return _0x366b03[_0x6bfb('0x63')](_0xaf442a[_0x6bfb('0x49')][_0x6bfb('0x64')],_['omit'](_0xaf442a['body'],[_0x6bfb('0x64'),'id'])||{});}return null;})[_0x6bfb('0x65')](function(_0x42110f){var _0x5ec41b;_0x3bbac2=_0x42110f||[];var _0x2fbbf2=[];if(_0x42110f){for(var _0x4e7501=0x0;_0x4e7501<_0x42110f['length'];_0x4e7501+=0x1){var _0x116d72=_0x42110f[_0x4e7501]['get']({'plain':!![]});_0x571776[_0x6bfb('0x66')]=_0xaf442a[_0x6bfb('0x49')][_0x6bfb('0x66')]?_0xaf442a[_0x6bfb('0x49')]['dialCheckDuplicateType']:_0x571776[_0x6bfb('0x66')];switch(_0x571776['dialCheckDuplicateType']){case _0x6bfb('0x67'):_0x5ec41b=squel[_0x6bfb('0x68')]()['into']('cm_hopper')[_0x6bfb('0x69')]([_0x6bfb('0x6a'),_0x6bfb('0x6b'),_0x6bfb('0x6c'),_0x6bfb('0x6d'),_0x6bfb('0x59'),_0x6bfb('0x54'),_0x6bfb('0x53')],squel[_0x6bfb('0x6e')]()[_0x6bfb('0x6f')](_0x6bfb('0x6a'),_0x6bfb('0x6a'))[_0x6bfb('0x6f')](_0x6bfb('0x70'),_0x6bfb('0x6b'))['field']('id','ContactId')[_0x6bfb('0x6f')](_0x116d72[_0x6bfb('0x71')][_0x6bfb('0x72')](),_0x6bfb('0x6d'))[_0x6bfb('0x6f')](_0xaf442a[_0x6bfb('0x43')]['id'][_0x6bfb('0x72')](),_0x6bfb('0x59'))[_0x6bfb('0x6f')]('NOW()',_0x6bfb('0x54'))[_0x6bfb('0x6f')]('NOW()',_0x6bfb('0x53'))[_0x6bfb('0x73')](_0x6bfb('0x74'))[_0x6bfb('0x3a')](_0x6bfb('0x75'))[_0x6bfb('0x3a')](_0x6bfb('0x76'),_0x116d72['CmListId']['toString']())[_0x6bfb('0x3a')](_0x6bfb('0x77'))[_0x6bfb('0x3a')](_0x6bfb('0x78'),squel[_0x6bfb('0x6e')]()[_0x6bfb('0x6f')](_0x6bfb('0x79'))[_0x6bfb('0x73')]('cm_hopper_final')[_0x6bfb('0x3a')](_0x6bfb('0x7a'),_0xaf442a[_0x6bfb('0x43')]['id'][_0x6bfb('0x72')]()))['where'](_0x6bfb('0x78'),squel['select']()[_0x6bfb('0x6f')](_0x6bfb('0x7b'))[_0x6bfb('0x73')](_0x6bfb('0x7c'))['where'](_0x6bfb('0x7a'),_0xaf442a[_0x6bfb('0x43')]['id']['toString']())))[_0x6bfb('0x72')]();break;case'onlyIfOpen':_0x5ec41b=squel[_0x6bfb('0x68')]()[_0x6bfb('0x7d')](_0x6bfb('0x7c'))[_0x6bfb('0x69')]([_0x6bfb('0x6a'),_0x6bfb('0x6b'),_0x6bfb('0x6c'),'ListId',_0x6bfb('0x59'),_0x6bfb('0x54'),'updatedAt'],squel[_0x6bfb('0x6e')]()['field'](_0x6bfb('0x6a'),_0x6bfb('0x6a'))[_0x6bfb('0x6f')](_0x6bfb('0x70'),_0x6bfb('0x6b'))[_0x6bfb('0x6f')]('id',_0x6bfb('0x6c'))[_0x6bfb('0x6f')](_0x116d72['CmListId'][_0x6bfb('0x72')](),_0x6bfb('0x6d'))['field'](_0xaf442a['params']['id'][_0x6bfb('0x72')](),_0x6bfb('0x59'))[_0x6bfb('0x6f')](_0x6bfb('0x70'),_0x6bfb('0x54'))['field'](_0x6bfb('0x70'),_0x6bfb('0x53'))[_0x6bfb('0x73')](_0x6bfb('0x74'))[_0x6bfb('0x3a')](_0x6bfb('0x75'))[_0x6bfb('0x3a')](_0x6bfb('0x76'),_0x116d72[_0x6bfb('0x71')][_0x6bfb('0x72')]())[_0x6bfb('0x3a')](_0x6bfb('0x77'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6bfb('0x6f')](_0x6bfb('0x7b'))[_0x6bfb('0x73')]('cm_hopper')[_0x6bfb('0x3a')](_0x6bfb('0x7a'),_0xaf442a[_0x6bfb('0x43')]['id'][_0x6bfb('0x72')]())))[_0x6bfb('0x72')]();break;default:_0x5ec41b=squel['insert']()[_0x6bfb('0x7d')](_0x6bfb('0x7c'))['fromQuery'](['phone',_0x6bfb('0x6b'),_0x6bfb('0x6c'),_0x6bfb('0x6d'),_0x6bfb('0x59'),_0x6bfb('0x54'),_0x6bfb('0x53')],squel[_0x6bfb('0x6e')]()['field'](_0x6bfb('0x6a'),'phone')[_0x6bfb('0x6f')](_0x6bfb('0x70'),'scheduledAt')['field']('id','ContactId')[_0x6bfb('0x6f')](_0x116d72[_0x6bfb('0x71')][_0x6bfb('0x72')](),_0x6bfb('0x6d'))[_0x6bfb('0x6f')](_0xaf442a[_0x6bfb('0x43')]['id'][_0x6bfb('0x72')](),_0x6bfb('0x59'))[_0x6bfb('0x6f')](_0x6bfb('0x70'),_0x6bfb('0x54'))[_0x6bfb('0x6f')](_0x6bfb('0x70'),_0x6bfb('0x53'))['from'](_0x6bfb('0x74'))[_0x6bfb('0x3a')](_0x6bfb('0x75'))[_0x6bfb('0x3a')](_0x6bfb('0x76'),_0x116d72[_0x6bfb('0x71')]['toString']())[_0x6bfb('0x3a')](_0x6bfb('0x77')))[_0x6bfb('0x72')]();}_0x2fbbf2['push'](db[_0x6bfb('0x7e')]['query'](_0x5ec41b));}return BPromise['all'](_0x2fbbf2);}})[_0x6bfb('0x21')](function(){return _0x3bbac2;})[_0x6bfb('0x21')](respondWithResult(_0x1380ed,null))[_0x6bfb('0x41')](handleError(_0x1380ed,null));};exports[_0x6bfb('0x7f')]=function(_0x276035,_0x35796e,_0x4b521f){return db[_0x6bfb('0x2b')][_0x6bfb('0x47')]({'where':{'id':_0x276035[_0x6bfb('0x43')]['id']}})['then'](handleEntityNotFound(_0x35796e,null))[_0x6bfb('0x21')](function(_0x19b8d3){if(_0x19b8d3){return _0x19b8d3[_0x6bfb('0x7f')](_0x276035[_0x6bfb('0x31')][_0x6bfb('0x64')]);}})[_0x6bfb('0x21')](function(_0x28f121){if(_0x28f121){return db['CmHopper'][_0x6bfb('0x24')]({'where':{'ListId':_0x276035[_0x6bfb('0x31')]['ids'],'CampaignId':_0x276035['params']['id']}})[_0x6bfb('0x21')](function(){return _0x28f121;});}})[_0x6bfb('0x21')](respondWithStatusCode(_0x35796e,null))[_0x6bfb('0x41')](handleError(_0x35796e,null));};exports[_0x6bfb('0x80')]=function(_0x40f690,_0x461750,_0x10866f){var _0x4f3389={'raw':!![],'where':{}};var _0x2e5782={};var _0x2fe61b={'count':0x0,'rows':[]};return db[_0x6bfb('0x2b')][_0x6bfb('0x57')]({'where':{'id':_0x40f690[_0x6bfb('0x43')]['id']}})[_0x6bfb('0x21')](handleEntityNotFound(_0x461750,null))['then'](function(_0x4926f1){if(_0x4926f1){_0x2e5782[_0x6bfb('0x30')]=_[_0x6bfb('0x44')](db['CmList'][_0x6bfb('0x2c')]);_0x2e5782[_0x6bfb('0x31')]=_[_0x6bfb('0x44')](_0x40f690[_0x6bfb('0x31')]);_0x2e5782[_0x6bfb('0x3c')]=_[_0x6bfb('0x33')](_0x2e5782['model'],_0x2e5782[_0x6bfb('0x31')]);_0x4f3389['attributes']=_[_0x6bfb('0x33')](_0x2e5782[_0x6bfb('0x30')],qs[_0x6bfb('0x34')](_0x40f690['query'][_0x6bfb('0x34')]));_0x4f3389[_0x6bfb('0x32')]=_0x4f3389[_0x6bfb('0x32')][_0x6bfb('0x45')]?_0x4f3389['attributes']:_0x2e5782[_0x6bfb('0x30')];if(!_0x40f690[_0x6bfb('0x31')][_0x6bfb('0x35')](_0x6bfb('0x36'))){_0x4f3389['limit']=qs[_0x6bfb('0x37')](_0x40f690[_0x6bfb('0x31')]['limit']);_0x4f3389[_0x6bfb('0x38')]=qs[_0x6bfb('0x38')](_0x40f690[_0x6bfb('0x31')][_0x6bfb('0x38')]);}_0x4f3389[_0x6bfb('0x60')]=qs[_0x6bfb('0x39')](_0x40f690[_0x6bfb('0x31')]['sort']);_0x4f3389[_0x6bfb('0x3a')]=qs[_0x6bfb('0x3c')](_['pick'](_0x40f690[_0x6bfb('0x31')],_0x2e5782[_0x6bfb('0x3c')]));_0x4f3389[_0x6bfb('0x3a')]['CampaignId']=_0x4926f1['id'];if(_0x40f690[_0x6bfb('0x31')][_0x6bfb('0x3d')]){_0x4f3389['where']=_['merge'](_0x4f3389[_0x6bfb('0x3a')],{'$or':_['map'](_0x4f3389[_0x6bfb('0x32')],function(_0x304cc0){var _0x58b439={};_0x58b439[_0x304cc0]={'$like':'%'+_0x40f690[_0x6bfb('0x31')][_0x6bfb('0x3d')]+'%'};return _0x58b439;})});}_0x4f3389=_[_0x6bfb('0x3e')]({},_0x4f3389,_0x40f690[_0x6bfb('0x3f')]);return db[_0x6bfb('0x62')]['count']({'where':_0x4f3389['where']})[_0x6bfb('0x21')](function(_0x57adc7){_0x2fe61b[_0x6bfb('0x1b')]=_0x57adc7;if(_0x40f690[_0x6bfb('0x31')][_0x6bfb('0x51')]){_0x4f3389[_0x6bfb('0x46')]=[{'all':!![]}];}return db['CmList'][_0x6bfb('0x5a')](_0x4f3389);})[_0x6bfb('0x21')](function(_0x1164fc){_0x2fe61b[_0x6bfb('0x40')]=_0x1164fc;return _0x2fe61b;});}})[_0x6bfb('0x21')](respondWithFilteredResult(_0x461750,_0x4f3389))[_0x6bfb('0x41')](handleError(_0x461750,null));};exports[_0x6bfb('0x81')]=function(_0x1d9f47,_0x45a161,_0x4bb9c5){var _0x46b762,_0x5972eb;return db[_0x6bfb('0x2b')][_0x6bfb('0x47')]({'where':{'id':_0x1d9f47['params']['id']}})[_0x6bfb('0x21')](handleEntityNotFound(_0x45a161,null))[_0x6bfb('0x21')](function(_0x473bff){if(_0x473bff){_0x5972eb=_0x473bff;return _0x473bff[_0x6bfb('0x81')](_0x1d9f47[_0x6bfb('0x49')][_0x6bfb('0x64')],_[_0x6bfb('0x52')](_0x1d9f47[_0x6bfb('0x49')],['ids','id'])||{});}return null;})[_0x6bfb('0x65')](function(_0x23543a){var _0x3cfae7;_0x46b762=_0x23543a||[];var _0x29773f=[];if(_0x23543a){for(var _0x5d4b0c=0x0;_0x5d4b0c<_0x23543a[_0x6bfb('0x45')];_0x5d4b0c+=0x1){var _0x6e6aca=_0x23543a[_0x5d4b0c][_0x6bfb('0x22')]({'plain':!![]});_0x3cfae7=squel[_0x6bfb('0x68')]()['into'](_0x6bfb('0x82'))[_0x6bfb('0x69')]([_0x6bfb('0x6a'),_0x6bfb('0x6c'),_0x6bfb('0x6d'),_0x6bfb('0x59'),_0x6bfb('0x54'),_0x6bfb('0x53')],squel[_0x6bfb('0x6e')]()['field'](_0x6bfb('0x6a'),'phone')[_0x6bfb('0x6f')]('id',_0x6bfb('0x6c'))[_0x6bfb('0x6f')](_0x6e6aca[_0x6bfb('0x71')][_0x6bfb('0x72')](),_0x6bfb('0x6d'))['field'](_0x1d9f47[_0x6bfb('0x43')]['id'][_0x6bfb('0x72')](),'CampaignId')[_0x6bfb('0x6f')](_0x6bfb('0x70'),_0x6bfb('0x54'))[_0x6bfb('0x6f')](_0x6bfb('0x70'),'updatedAt')[_0x6bfb('0x73')](_0x6bfb('0x74'))[_0x6bfb('0x3a')]('deletedAt\x20IS\x20NULL')[_0x6bfb('0x3a')]('ListId\x20=\x20?',_0x6e6aca[_0x6bfb('0x71')]['toString']())[_0x6bfb('0x3a')](_0x6bfb('0x77')))[_0x6bfb('0x72')]();_0x29773f['push'](db[_0x6bfb('0x7e')][_0x6bfb('0x31')](_0x3cfae7));}return BPromise[_0x6bfb('0x83')](_0x29773f);}})[_0x6bfb('0x21')](function(){return _0x46b762;})[_0x6bfb('0x21')](respondWithResult(_0x45a161,null))[_0x6bfb('0x41')](handleError(_0x45a161,null));};exports[_0x6bfb('0x84')]=function(_0x204a60,_0x5d21d3,_0x1b8810){return db[_0x6bfb('0x2b')][_0x6bfb('0x47')]({'where':{'id':_0x204a60[_0x6bfb('0x43')]['id']}})[_0x6bfb('0x21')](handleEntityNotFound(_0x5d21d3,null))[_0x6bfb('0x21')](function(_0x1a4656){if(_0x1a4656){return _0x1a4656[_0x6bfb('0x84')](_0x204a60['query'][_0x6bfb('0x64')]);}})[_0x6bfb('0x21')](function(_0x1f8b59){if(_0x1f8b59){return db[_0x6bfb('0x5f')][_0x6bfb('0x24')]({'where':{'ListId':_0x204a60[_0x6bfb('0x31')][_0x6bfb('0x64')],'CampaignId':_0x204a60[_0x6bfb('0x43')]['id']}})[_0x6bfb('0x21')](function(){return _0x1f8b59;});}})[_0x6bfb('0x21')](respondWithStatusCode(_0x5d21d3,null))[_0x6bfb('0x41')](handleError(_0x5d21d3,null));}; \ No newline at end of file +var _0x5949=['spread','sequelize','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','stack','name','send','Campaign','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','omit','createdAt','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','order','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','select','field','CmListId','ListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ContactId','push','all','removeLists','getBlackLists','CmList'];(function(_0x401e55,_0x5578de){var _0x393b67=function(_0x20352e){while(--_0x20352e){_0x401e55['push'](_0x401e55['shift']());}};_0x393b67(++_0x5578de);}(_0x5949,0x88));var _0x9594=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0x5949[_0x1dd532];return _0x3732aa;};'use strict';var pdf=require(_0x9594('0x0'));var emlformat=require(_0x9594('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9594('0x2'));var jsonpatch=require(_0x9594('0x3'));var rp=require(_0x9594('0x4'));var moment=require(_0x9594('0x5'));var BPromise=require(_0x9594('0x6'));var Mustache=require('mustache');var util=require(_0x9594('0x7'));var path=require(_0x9594('0x8'));var sox=require(_0x9594('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9594('0xa'));var squel=require('squel');var crypto=require(_0x9594('0xb'));var jsforce=require(_0x9594('0xc'));var deskjs=require(_0x9594('0xd'));var toCsv=require(_0x9594('0xe'));var querystring=require(_0x9594('0xf'));var Papa=require('papaparse');var Redis=require(_0x9594('0x10'));var authService=require(_0x9594('0x11'));var qs=require(_0x9594('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9594('0x13'));var logger=require(_0x9594('0x14'))(_0x9594('0x15'));var utils=require(_0x9594('0x16'));var config=require(_0x9594('0x17'));var db=require(_0x9594('0x18'))['db'];function respondWithStatusCode(_0x5b54ab,_0x4b84b2){_0x4b84b2=_0x4b84b2||0xcc;return function(_0x58fe61){if(_0x58fe61){return _0x5b54ab[_0x9594('0x19')](_0x4b84b2);}return _0x5b54ab[_0x9594('0x1a')](_0x4b84b2)['end']();};}function respondWithResult(_0x207c18,_0x280561){_0x280561=_0x280561||0xc8;return function(_0x25730b){if(_0x25730b){return _0x207c18[_0x9594('0x1a')](_0x280561)[_0x9594('0x1b')](_0x25730b);}};}function respondWithFilteredResult(_0x3b1a20,_0x4745f8){return function(_0x4d39d4){if(_0x4d39d4){var _0x3806fb=_0x4d39d4[_0x9594('0x1c')],_0x2d1916=_0x4745f8['offset'],_0x13d757=_0x4745f8[_0x9594('0x1d')]+_0x4745f8[_0x9594('0x1e')],_0x435bfb;if(_0x13d757>=_0x3806fb){_0x13d757=_0x3806fb;_0x435bfb=0xc8;}else{_0x435bfb=0xce;}_0x3b1a20['status'](_0x435bfb);return _0x3b1a20[_0x9594('0x1f')](_0x9594('0x20'),_0x2d1916+'-'+_0x13d757+'/'+_0x3806fb)[_0x9594('0x1b')](_0x4d39d4);}return null;};}function patchUpdates(_0x34dcb3){return function(_0x2af62c){try{jsonpatch[_0x9594('0x21')](_0x2af62c,_0x34dcb3,!![]);}catch(_0x473d0b){return BPromise[_0x9594('0x22')](_0x473d0b);}return _0x2af62c[_0x9594('0x23')]();};}function saveUpdates(_0x1c00dd,_0xc73bfc){return function(_0x153fb0){if(_0x153fb0){return _0x153fb0['update'](_0x1c00dd)[_0x9594('0x24')](function(_0x1b50ae){return _0x1b50ae;});}return null;};}function removeEntity(_0x960087,_0x52801d){return function(_0x1dabfb){if(_0x1dabfb){return _0x1dabfb[_0x9594('0x25')]()['then'](function(){var _0x38776d=_0x1dabfb[_0x9594('0x26')]({'plain':!![]});var _0x2c67bd=_0x9594('0x27');return db[_0x9594('0x28')]['destroy']({'where':{'type':_0x2c67bd,'resourceId':_0x38776d['id']}})[_0x9594('0x24')](function(){return _0x1dabfb;});})[_0x9594('0x24')](function(){_0x960087['status'](0xcc)[_0x9594('0x29')]();});}};}function handleEntityNotFound(_0x1a3f1f,_0x4bdb80){return function(_0x57a780){if(!_0x57a780){_0x1a3f1f[_0x9594('0x19')](0x194);}return _0x57a780;};}function handleError(_0x177fd8,_0x4a5af9){_0x4a5af9=_0x4a5af9||0x1f4;return function(_0x243e1d){logger[_0x9594('0x2a')](_0x243e1d[_0x9594('0x2b')]);if(_0x243e1d[_0x9594('0x2c')]){delete _0x243e1d[_0x9594('0x2c')];}_0x177fd8['status'](_0x4a5af9)[_0x9594('0x2d')](_0x243e1d);};}exports['index']=function(_0x56cfe4,_0xe94cab){var _0x1dbaa2={},_0x30e0fd={},_0x3cde77={'count':0x0,'rows':[]};var _0x436864=_['map'](db[_0x9594('0x2e')]['rawAttributes'],function(_0x2edf7f){return{'name':_0x2edf7f['fieldName'],'type':_0x2edf7f['type'][_0x9594('0x2f')]};});_0x30e0fd[_0x9594('0x30')]=_[_0x9594('0x31')](_0x436864,_0x9594('0x2c'));_0x30e0fd[_0x9594('0x32')]=_[_0x9594('0x33')](_0x56cfe4[_0x9594('0x32')]);_0x30e0fd[_0x9594('0x34')]=_['intersection'](_0x30e0fd['model'],_0x30e0fd[_0x9594('0x32')]);_0x1dbaa2['attributes']=_[_0x9594('0x35')](_0x30e0fd[_0x9594('0x30')],qs[_0x9594('0x36')](_0x56cfe4['query']['fields']));_0x1dbaa2[_0x9594('0x37')]=_0x1dbaa2[_0x9594('0x37')][_0x9594('0x38')]?_0x1dbaa2[_0x9594('0x37')]:_0x30e0fd[_0x9594('0x30')];if(!_0x56cfe4[_0x9594('0x32')][_0x9594('0x39')](_0x9594('0x3a'))){_0x1dbaa2[_0x9594('0x1e')]=qs['limit'](_0x56cfe4['query'][_0x9594('0x1e')]);_0x1dbaa2['offset']=qs['offset'](_0x56cfe4[_0x9594('0x32')]['offset']);}_0x1dbaa2['order']=qs[_0x9594('0x3b')](_0x56cfe4[_0x9594('0x32')]['sort']);_0x1dbaa2[_0x9594('0x3c')]=qs['filters'](_[_0x9594('0x3d')](_0x56cfe4[_0x9594('0x32')],_0x30e0fd[_0x9594('0x34')]));if(_0x56cfe4[_0x9594('0x32')]['filter']){_0x1dbaa2[_0x9594('0x3c')]=_[_0x9594('0x3e')](_0x1dbaa2[_0x9594('0x3c')],{'$or':_['map'](_0x436864,function(_0x15e559){if(_0x15e559[_0x9594('0x3f')]!=='VIRTUAL'){var _0x21200f={};_0x21200f[_0x15e559[_0x9594('0x2c')]]={'$like':'%'+_0x56cfe4['query'][_0x9594('0x40')]+'%'};return _0x21200f;}})});}_0x1dbaa2=_[_0x9594('0x3e')]({},_0x1dbaa2,_0x56cfe4['options']);var _0x5b4bf8={'where':_0x1dbaa2[_0x9594('0x3c')]};return db[_0x9594('0x2e')][_0x9594('0x1c')](_0x5b4bf8)[_0x9594('0x24')](function(_0xd6fbd6){_0x3cde77[_0x9594('0x1c')]=_0xd6fbd6;if(_0x56cfe4[_0x9594('0x32')][_0x9594('0x41')]){_0x1dbaa2[_0x9594('0x42')]=[{'all':!![]}];}return db[_0x9594('0x2e')][_0x9594('0x43')](_0x1dbaa2);})[_0x9594('0x24')](function(_0x4fb59e){_0x3cde77[_0x9594('0x44')]=_0x4fb59e;return _0x3cde77;})['then'](respondWithFilteredResult(_0xe94cab,_0x1dbaa2))[_0x9594('0x45')](handleError(_0xe94cab,null));};exports[_0x9594('0x46')]=function(_0x17ad16,_0x331861){var _0x51435d={'raw':![],'where':{'id':_0x17ad16[_0x9594('0x47')]['id']}},_0x374bed={};_0x374bed[_0x9594('0x30')]=_[_0x9594('0x33')](db['Campaign'][_0x9594('0x48')]);_0x374bed[_0x9594('0x32')]=_[_0x9594('0x33')](_0x17ad16[_0x9594('0x32')]);_0x374bed[_0x9594('0x34')]=_['intersection'](_0x374bed[_0x9594('0x30')],_0x374bed[_0x9594('0x32')]);_0x51435d[_0x9594('0x37')]=_['intersection'](_0x374bed[_0x9594('0x30')],qs['fields'](_0x17ad16[_0x9594('0x32')][_0x9594('0x36')]));_0x51435d['attributes']=_0x51435d[_0x9594('0x37')]['length']?_0x51435d[_0x9594('0x37')]:_0x374bed[_0x9594('0x30')];if(_0x17ad16[_0x9594('0x32')]['includeAll']){_0x51435d[_0x9594('0x42')]=[{'all':!![]}];}_0x51435d=_['merge']({},_0x51435d,_0x17ad16[_0x9594('0x49')]);return db['Campaign'][_0x9594('0x4a')](_0x51435d)[_0x9594('0x24')](handleEntityNotFound(_0x331861,null))[_0x9594('0x24')](respondWithResult(_0x331861,null))[_0x9594('0x45')](handleError(_0x331861,null));};exports[_0x9594('0x4b')]=function(_0x157d80,_0x52d498){return db[_0x9594('0x2e')]['create'](_0x157d80[_0x9594('0x4c')],{})['then'](function(_0x40cb2d){var _0x5c47c0=_0x157d80[_0x9594('0x4d')][_0x9594('0x26')]({'plain':!![]});if(!_0x5c47c0)throw new Error(_0x9594('0x4e'));if(_0x5c47c0['role']===_0x9594('0x4d')){var _0x7ef87c=_0x40cb2d[_0x9594('0x26')]({'plain':!![]});var _0x289091=_0x9594('0x27');return db[_0x9594('0x4f')][_0x9594('0x4a')]({'where':{'name':_0x289091,'userProfileId':_0x5c47c0[_0x9594('0x50')]},'raw':!![]})[_0x9594('0x24')](function(_0x5f42c3){if(_0x5f42c3&&_0x5f42c3[_0x9594('0x51')]===0x0){return db[_0x9594('0x28')][_0x9594('0x4b')]({'name':_0x7ef87c[_0x9594('0x2c')],'resourceId':_0x7ef87c['id'],'type':_0x5f42c3[_0x9594('0x2c')],'sectionId':_0x5f42c3['id']},{})[_0x9594('0x24')](function(){return _0x40cb2d;});}else{return _0x40cb2d;}})['catch'](function(_0x52bf8a){logger[_0x9594('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52bf8a);throw _0x52bf8a;});}return _0x40cb2d;})[_0x9594('0x24')](respondWithResult(_0x52d498,0xc9))[_0x9594('0x45')](handleError(_0x52d498,null));};exports['clone']=function(_0xf3f9a6,_0x26212f){var _0x28279a={'where':{'id':_0xf3f9a6[_0x9594('0x47')]['id']}},_0x447cc1={};_0x447cc1[_0x9594('0x30')]=_[_0x9594('0x33')](db['Campaign'][_0x9594('0x48')]);_0x28279a[_0x9594('0x37')]=_['intersection'](_0x447cc1[_0x9594('0x30')],qs[_0x9594('0x36')](_0xf3f9a6[_0x9594('0x32')][_0x9594('0x36')]));_0x28279a[_0x9594('0x37')]=_0x28279a[_0x9594('0x37')][_0x9594('0x38')]?_0x28279a[_0x9594('0x37')]:_0x447cc1[_0x9594('0x30')];if(_0xf3f9a6[_0x9594('0x32')]['includeAll']){_0x28279a[_0x9594('0x42')]=[{'all':!![]}];}_0x28279a=_[_0x9594('0x3e')]({},_0x28279a,_0xf3f9a6[_0x9594('0x49')]);return db['Campaign']['find'](_0x28279a)[_0x9594('0x24')](handleEntityNotFound(_0x26212f,null))[_0x9594('0x24')](function(_0x540658){if(_0x540658){var _0x474006=_0x540658[_0x9594('0x26')]({'plain':!![]});_0x474006=qs[_0x9594('0x52')](_0x474006,['id',_0x9594('0x53'),_0x9594('0x54')]);_0xf3f9a6['body']=_['omit'](_0xf3f9a6[_0x9594('0x4c')],['id','createdAt',_0x9594('0x54')]);return db['Campaign'][_0x9594('0x4b')](_[_0x9594('0x3e')](_0x474006,_0xf3f9a6[_0x9594('0x4c')]),{'include':_0xf3f9a6[_0x9594('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x9594('0x24')](function(_0x31b8db){var _0x48981f=_0xf3f9a6[_0x9594('0x4d')]['get']({'plain':!![]});if(!_0x48981f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48981f[_0x9594('0x55')]===_0x9594('0x4d')){var _0x337bca=_0x31b8db['get']({'plain':!![]});var _0x2363ba=_0x9594('0x27');return db[_0x9594('0x4f')]['find']({'where':{'name':_0x2363ba,'userProfileId':_0x48981f[_0x9594('0x50')]},'raw':!![]})['then'](function(_0x1af6c7){if(_0x1af6c7&&_0x1af6c7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x337bca['name'],'resourceId':_0x337bca['id'],'type':_0x1af6c7['name'],'sectionId':_0x1af6c7['id']},{})['then'](function(){return _0x31b8db;});}else{return _0x31b8db;}})[_0x9594('0x45')](function(_0x3c06f2){logger[_0x9594('0x2a')](_0x9594('0x56'),_0x3c06f2);throw _0x3c06f2;});}return _0x31b8db;});}})[_0x9594('0x24')](respondWithResult(_0x26212f,0xc9))['catch'](handleError(_0x26212f,null));};exports['update']=function(_0x293269,_0x488f6b){if(_0x293269[_0x9594('0x4c')]['id']){delete _0x293269[_0x9594('0x4c')]['id'];}return db[_0x9594('0x2e')][_0x9594('0x4a')]({'where':{'id':_0x293269[_0x9594('0x47')]['id']}})[_0x9594('0x24')](handleEntityNotFound(_0x488f6b,null))[_0x9594('0x24')](saveUpdates(_0x293269['body'],null))[_0x9594('0x24')](respondWithResult(_0x488f6b,null))[_0x9594('0x45')](handleError(_0x488f6b,null));};exports['destroy']=function(_0x4fb66c,_0x43ba57){return db[_0x9594('0x2e')][_0x9594('0x4a')]({'where':{'id':_0x4fb66c[_0x9594('0x47')]['id']}})['then'](handleEntityNotFound(_0x43ba57,null))[_0x9594('0x24')](removeEntity(_0x43ba57,null))['catch'](handleError(_0x43ba57,null));};exports['getHoppers']=function(_0x45a58b,_0x3beb87,_0x1a0bb6){var _0x31380a={'raw':!![],'where':{}};var _0x50cc9b={};var _0x260214={'count':0x0,'rows':[]};return db[_0x9594('0x2e')][_0x9594('0x57')]({'where':{'id':_0x45a58b[_0x9594('0x47')]['id']}})[_0x9594('0x24')](handleEntityNotFound(_0x3beb87,null))['then'](function(_0x48576f){if(_0x48576f){_0x50cc9b[_0x9594('0x30')]=_[_0x9594('0x33')](db[_0x9594('0x58')][_0x9594('0x48')]);_0x50cc9b[_0x9594('0x32')]=_['keys'](_0x45a58b[_0x9594('0x32')]);_0x50cc9b['filters']=_[_0x9594('0x35')](_0x50cc9b[_0x9594('0x30')],_0x50cc9b['query']);_0x31380a[_0x9594('0x37')]=_['intersection'](_0x50cc9b[_0x9594('0x30')],qs[_0x9594('0x36')](_0x45a58b['query'][_0x9594('0x36')]));_0x31380a[_0x9594('0x37')]=_0x31380a[_0x9594('0x37')][_0x9594('0x38')]?_0x31380a['attributes']:_0x50cc9b[_0x9594('0x30')];if(!_0x45a58b[_0x9594('0x32')][_0x9594('0x39')]('nolimit')){_0x31380a[_0x9594('0x1e')]=qs['limit'](_0x45a58b[_0x9594('0x32')][_0x9594('0x1e')]);_0x31380a['offset']=qs[_0x9594('0x1d')](_0x45a58b[_0x9594('0x32')]['offset']);}_0x31380a['order']=qs[_0x9594('0x3b')](_0x45a58b['query'][_0x9594('0x3b')]);_0x31380a[_0x9594('0x3c')]=qs[_0x9594('0x34')](_[_0x9594('0x3d')](_0x45a58b[_0x9594('0x32')],_0x50cc9b[_0x9594('0x34')]));_0x31380a['where']['CampaignId']=_0x48576f['id'];if(_0x45a58b[_0x9594('0x32')][_0x9594('0x40')]){_0x31380a[_0x9594('0x3c')]=_[_0x9594('0x3e')](_0x31380a[_0x9594('0x3c')],{'$or':_[_0x9594('0x31')](_0x31380a['attributes'],function(_0x3b3351){var _0x443050={};_0x443050[_0x3b3351]={'$like':'%'+_0x45a58b['query'][_0x9594('0x40')]+'%'};return _0x443050;})});}_0x31380a=_[_0x9594('0x3e')]({},_0x31380a,_0x45a58b['options']);return db['CmHopper'][_0x9594('0x1c')]({'where':_0x31380a['where']})[_0x9594('0x24')](function(_0x190e0b){_0x260214[_0x9594('0x1c')]=_0x190e0b;if(_0x45a58b[_0x9594('0x32')][_0x9594('0x41')]){_0x31380a[_0x9594('0x42')]=[{'all':!![]}];}return db[_0x9594('0x58')]['findAll'](_0x31380a);})[_0x9594('0x24')](function(_0x25c21f){_0x260214[_0x9594('0x44')]=_0x25c21f;return _0x260214;});}})[_0x9594('0x24')](respondWithFilteredResult(_0x3beb87,_0x31380a))['catch'](handleError(_0x3beb87,null));};exports[_0x9594('0x59')]=function(_0x1585fe,_0x4a83c5,_0x13485f){var _0x5ddfb9={'raw':!![],'where':{}};var _0x4ea5ca={};var _0x36b3ea={'count':0x0,'rows':[]};return db[_0x9594('0x2e')][_0x9594('0x57')]({'where':{'id':_0x1585fe[_0x9594('0x47')]['id']}})[_0x9594('0x24')](handleEntityNotFound(_0x4a83c5,null))[_0x9594('0x24')](function(_0x52f614){if(_0x52f614){_0x4ea5ca[_0x9594('0x30')]=_[_0x9594('0x33')](db['CmHopperHistory'][_0x9594('0x48')]);_0x4ea5ca[_0x9594('0x32')]=_[_0x9594('0x33')](_0x1585fe['query']);_0x4ea5ca[_0x9594('0x34')]=_[_0x9594('0x35')](_0x4ea5ca[_0x9594('0x30')],_0x4ea5ca['query']);_0x5ddfb9['attributes']=_[_0x9594('0x35')](_0x4ea5ca[_0x9594('0x30')],qs['fields'](_0x1585fe['query'][_0x9594('0x36')]));_0x5ddfb9['attributes']=_0x5ddfb9['attributes'][_0x9594('0x38')]?_0x5ddfb9[_0x9594('0x37')]:_0x4ea5ca[_0x9594('0x30')];if(!_0x1585fe['query'][_0x9594('0x39')](_0x9594('0x3a'))){_0x5ddfb9[_0x9594('0x1e')]=qs[_0x9594('0x1e')](_0x1585fe['query'][_0x9594('0x1e')]);_0x5ddfb9['offset']=qs['offset'](_0x1585fe['query']['offset']);}_0x5ddfb9['order']=qs[_0x9594('0x3b')](_0x1585fe[_0x9594('0x32')][_0x9594('0x3b')]);_0x5ddfb9[_0x9594('0x3c')]=qs['filters'](_[_0x9594('0x3d')](_0x1585fe[_0x9594('0x32')],_0x4ea5ca[_0x9594('0x34')]));_0x5ddfb9[_0x9594('0x3c')][_0x9594('0x5a')]=_0x52f614['id'];if(_0x1585fe[_0x9594('0x32')][_0x9594('0x40')]){_0x5ddfb9[_0x9594('0x3c')]=_[_0x9594('0x3e')](_0x5ddfb9[_0x9594('0x3c')],{'$or':_['map'](_0x5ddfb9['attributes'],function(_0x1cd893){var _0x47a6a6={};_0x47a6a6[_0x1cd893]={'$like':'%'+_0x1585fe[_0x9594('0x32')][_0x9594('0x40')]+'%'};return _0x47a6a6;})});}_0x5ddfb9=_[_0x9594('0x3e')]({},_0x5ddfb9,_0x1585fe[_0x9594('0x49')]);return db['CmHopperHistory'][_0x9594('0x1c')]({'where':_0x5ddfb9[_0x9594('0x3c')]})['then'](function(_0x41558f){_0x36b3ea[_0x9594('0x1c')]=_0x41558f;if(_0x1585fe[_0x9594('0x32')][_0x9594('0x41')]){_0x5ddfb9[_0x9594('0x42')]=[{'all':!![]}];}return db[_0x9594('0x5b')][_0x9594('0x43')](_0x5ddfb9);})[_0x9594('0x24')](function(_0xf92e00){_0x36b3ea[_0x9594('0x44')]=_0xf92e00;return _0x36b3ea;});}})[_0x9594('0x24')](respondWithFilteredResult(_0x4a83c5,_0x5ddfb9))[_0x9594('0x45')](handleError(_0x4a83c5,null));};exports[_0x9594('0x5c')]=function(_0x355f0e,_0x243f6e,_0x24c050){var _0x18bdb4={'raw':!![],'where':{}};var _0x5a4846={};var _0x5efd95={'count':0x0,'rows':[]};return db[_0x9594('0x2e')][_0x9594('0x57')]({'where':{'id':_0x355f0e[_0x9594('0x47')]['id']}})['then'](handleEntityNotFound(_0x243f6e,null))[_0x9594('0x24')](function(_0x206663){if(_0x206663){_0x5a4846[_0x9594('0x30')]=_[_0x9594('0x33')](db['CmHopperFinal'][_0x9594('0x48')]);_0x5a4846[_0x9594('0x32')]=_[_0x9594('0x33')](_0x355f0e[_0x9594('0x32')]);_0x5a4846[_0x9594('0x34')]=_[_0x9594('0x35')](_0x5a4846[_0x9594('0x30')],_0x5a4846[_0x9594('0x32')]);_0x18bdb4['attributes']=_[_0x9594('0x35')](_0x5a4846['model'],qs[_0x9594('0x36')](_0x355f0e[_0x9594('0x32')]['fields']));_0x18bdb4['attributes']=_0x18bdb4['attributes']['length']?_0x18bdb4[_0x9594('0x37')]:_0x5a4846[_0x9594('0x30')];if(!_0x355f0e[_0x9594('0x32')][_0x9594('0x39')](_0x9594('0x3a'))){_0x18bdb4[_0x9594('0x1e')]=qs[_0x9594('0x1e')](_0x355f0e[_0x9594('0x32')]['limit']);_0x18bdb4[_0x9594('0x1d')]=qs[_0x9594('0x1d')](_0x355f0e[_0x9594('0x32')][_0x9594('0x1d')]);}_0x18bdb4[_0x9594('0x5d')]=qs[_0x9594('0x3b')](_0x355f0e['query']['sort']);_0x18bdb4[_0x9594('0x3c')]=qs[_0x9594('0x34')](_['pick'](_0x355f0e[_0x9594('0x32')],_0x5a4846[_0x9594('0x34')]));_0x18bdb4[_0x9594('0x3c')][_0x9594('0x5a')]=_0x206663['id'];if(_0x355f0e['query'][_0x9594('0x40')]){_0x18bdb4[_0x9594('0x3c')]=_[_0x9594('0x3e')](_0x18bdb4[_0x9594('0x3c')],{'$or':_[_0x9594('0x31')](_0x18bdb4['attributes'],function(_0xe967b){var _0x46b9fc={};_0x46b9fc[_0xe967b]={'$like':'%'+_0x355f0e['query'][_0x9594('0x40')]+'%'};return _0x46b9fc;})});}_0x18bdb4=_[_0x9594('0x3e')]({},_0x18bdb4,_0x355f0e[_0x9594('0x49')]);return db[_0x9594('0x5e')][_0x9594('0x1c')]({'where':_0x18bdb4[_0x9594('0x3c')]})[_0x9594('0x24')](function(_0x511347){_0x5efd95[_0x9594('0x1c')]=_0x511347;if(_0x355f0e['query'][_0x9594('0x41')]){_0x18bdb4[_0x9594('0x42')]=[{'all':!![]}];}return db[_0x9594('0x5e')]['findAll'](_0x18bdb4);})[_0x9594('0x24')](function(_0x5bb03b){_0x5efd95[_0x9594('0x44')]=_0x5bb03b;return _0x5efd95;});}})[_0x9594('0x24')](respondWithFilteredResult(_0x243f6e,_0x18bdb4))[_0x9594('0x45')](handleError(_0x243f6e,null));};exports[_0x9594('0x5f')]=function(_0x298fa4,_0x13b296,_0x12a934){var _0x10a087={'raw':!![],'where':{}};var _0x3a806b={};var _0x817298={'count':0x0,'rows':[]};return db[_0x9594('0x2e')]['findOne']({'where':{'id':_0x298fa4[_0x9594('0x47')]['id']}})[_0x9594('0x24')](handleEntityNotFound(_0x13b296,null))[_0x9594('0x24')](function(_0x2e7f2d){if(_0x2e7f2d){_0x3a806b[_0x9594('0x30')]=_[_0x9594('0x33')](db[_0x9594('0x60')]['rawAttributes']);_0x3a806b[_0x9594('0x32')]=_[_0x9594('0x33')](_0x298fa4[_0x9594('0x32')]);_0x3a806b['filters']=_[_0x9594('0x35')](_0x3a806b['model'],_0x3a806b[_0x9594('0x32')]);_0x10a087['attributes']=_[_0x9594('0x35')](_0x3a806b[_0x9594('0x30')],qs[_0x9594('0x36')](_0x298fa4[_0x9594('0x32')][_0x9594('0x36')]));_0x10a087[_0x9594('0x37')]=_0x10a087[_0x9594('0x37')]['length']?_0x10a087[_0x9594('0x37')]:_0x3a806b['model'];if(!_0x298fa4['query'][_0x9594('0x39')](_0x9594('0x3a'))){_0x10a087[_0x9594('0x1e')]=qs[_0x9594('0x1e')](_0x298fa4['query'][_0x9594('0x1e')]);_0x10a087['offset']=qs[_0x9594('0x1d')](_0x298fa4[_0x9594('0x32')][_0x9594('0x1d')]);}_0x10a087[_0x9594('0x5d')]=qs[_0x9594('0x3b')](_0x298fa4[_0x9594('0x32')][_0x9594('0x3b')]);_0x10a087[_0x9594('0x3c')]=qs[_0x9594('0x34')](_[_0x9594('0x3d')](_0x298fa4[_0x9594('0x32')],_0x3a806b['filters']));_0x10a087[_0x9594('0x3c')][_0x9594('0x5a')]=_0x2e7f2d['id'];if(_0x298fa4['query']['filter']){_0x10a087[_0x9594('0x3c')]=_[_0x9594('0x3e')](_0x10a087[_0x9594('0x3c')],{'$or':_[_0x9594('0x31')](_0x10a087[_0x9594('0x37')],function(_0x529464){var _0x4dbce5={};_0x4dbce5[_0x529464]={'$like':'%'+_0x298fa4[_0x9594('0x32')]['filter']+'%'};return _0x4dbce5;})});}_0x10a087=_[_0x9594('0x3e')]({},_0x10a087,_0x298fa4[_0x9594('0x49')]);return db['CmHopperBlack']['count']({'where':_0x10a087[_0x9594('0x3c')]})['then'](function(_0x1897be){_0x817298[_0x9594('0x1c')]=_0x1897be;if(_0x298fa4[_0x9594('0x32')][_0x9594('0x41')]){_0x10a087[_0x9594('0x42')]=[{'all':!![]}];}return db[_0x9594('0x60')]['findAll'](_0x10a087);})[_0x9594('0x24')](function(_0xcf4534){_0x817298['rows']=_0xcf4534;return _0x817298;});}})['then'](respondWithFilteredResult(_0x13b296,_0x10a087))[_0x9594('0x45')](handleError(_0x13b296,null));};exports[_0x9594('0x61')]=function(_0x20f1f8,_0x50b065,_0x459236){var _0x5d4102={};var _0x4826a4={};var _0x382917;var _0x20d6f3;return db[_0x9594('0x2e')][_0x9594('0x57')]({'where':{'id':_0x20f1f8[_0x9594('0x47')]['id']}})[_0x9594('0x24')](handleEntityNotFound(_0x50b065,null))['then'](function(_0x462c05){if(_0x462c05){_0x382917=_0x462c05;_0x4826a4['model']=_['keys'](db['CmList'][_0x9594('0x48')]);_0x4826a4['query']=_[_0x9594('0x33')](_0x20f1f8[_0x9594('0x32')]);_0x4826a4[_0x9594('0x34')]=_[_0x9594('0x35')](_0x4826a4[_0x9594('0x30')],_0x4826a4['query']);_0x5d4102[_0x9594('0x37')]=_[_0x9594('0x35')](_0x4826a4[_0x9594('0x30')],qs[_0x9594('0x36')](_0x20f1f8[_0x9594('0x32')][_0x9594('0x36')]));_0x5d4102[_0x9594('0x37')]=_0x5d4102[_0x9594('0x37')][_0x9594('0x38')]?_0x5d4102['attributes']:_0x4826a4[_0x9594('0x30')];_0x5d4102[_0x9594('0x5d')]=qs['sort'](_0x20f1f8['query'][_0x9594('0x3b')]);_0x5d4102[_0x9594('0x3c')]=qs[_0x9594('0x34')](_[_0x9594('0x3d')](_0x20f1f8[_0x9594('0x32')],_0x4826a4['filters']));if(_0x20f1f8[_0x9594('0x32')]['filter']){_0x5d4102[_0x9594('0x3c')]=_[_0x9594('0x3e')](_0x5d4102[_0x9594('0x3c')],{'$or':_['map'](_0x5d4102[_0x9594('0x37')],function(_0x1dbc45){var _0x5ed399={};_0x5ed399[_0x1dbc45]={'$like':'%'+_0x20f1f8['query']['filter']+'%'};return _0x5ed399;})});}_0x5d4102=_[_0x9594('0x3e')]({},_0x5d4102,_0x20f1f8[_0x9594('0x49')]);return _0x382917['getLists'](_0x5d4102);}})[_0x9594('0x24')](function(_0x2cde41){if(_0x2cde41){_0x20d6f3=_0x2cde41[_0x9594('0x38')];if(!_0x20f1f8['query'][_0x9594('0x39')](_0x9594('0x3a'))){_0x5d4102[_0x9594('0x1e')]=qs[_0x9594('0x1e')](_0x20f1f8[_0x9594('0x32')]['limit']);_0x5d4102[_0x9594('0x1d')]=qs[_0x9594('0x1d')](_0x20f1f8[_0x9594('0x32')][_0x9594('0x1d')]);}return _0x382917[_0x9594('0x61')](_0x5d4102);}})['then'](function(_0x29b93e){if(_0x29b93e){return _0x29b93e?{'count':_0x20d6f3,'rows':_0x29b93e}:null;}})[_0x9594('0x24')](respondWithResult(_0x50b065,null))['catch'](handleError(_0x50b065,null));};exports[_0x9594('0x62')]=function(_0x4a9672,_0x438036,_0x5cc6f4){var _0x5c22e2,_0x395338;return db[_0x9594('0x2e')][_0x9594('0x4a')]({'where':{'id':_0x4a9672['params']['id']}})['then'](handleEntityNotFound(_0x438036,null))['then'](function(_0x271eeb){if(_0x271eeb){_0x395338=_0x271eeb;return _0x271eeb['addLists'](_0x4a9672[_0x9594('0x4c')][_0x9594('0x63')],_[_0x9594('0x52')](_0x4a9672[_0x9594('0x4c')],[_0x9594('0x63'),'id'])||{});}return null;})['spread'](function(_0x16a829){var _0x678322;_0x5c22e2=_0x16a829||[];var _0x4177ee=[];if(_0x16a829){for(var _0x28ff17=0x0;_0x28ff17<_0x16a829[_0x9594('0x38')];_0x28ff17+=0x1){var _0x487bd9=_0x16a829[_0x28ff17]['get']({'plain':!![]});_0x395338[_0x9594('0x64')]=_0x4a9672[_0x9594('0x4c')]['dialCheckDuplicateType']?_0x4a9672[_0x9594('0x4c')][_0x9594('0x64')]:_0x395338[_0x9594('0x64')];switch(_0x395338[_0x9594('0x64')]){case _0x9594('0x65'):_0x678322=squel[_0x9594('0x66')]()[_0x9594('0x67')](_0x9594('0x68'))[_0x9594('0x69')]([_0x9594('0x6a'),_0x9594('0x6b'),'ContactId','ListId',_0x9594('0x5a'),_0x9594('0x53'),_0x9594('0x54')],squel[_0x9594('0x6c')]()[_0x9594('0x6d')](_0x9594('0x6a'),_0x9594('0x6a'))[_0x9594('0x6d')]('NOW()',_0x9594('0x6b'))[_0x9594('0x6d')]('id','ContactId')[_0x9594('0x6d')](_0x487bd9[_0x9594('0x6e')]['toString'](),_0x9594('0x6f'))[_0x9594('0x6d')](_0x4a9672[_0x9594('0x47')]['id'][_0x9594('0x70')](),_0x9594('0x5a'))[_0x9594('0x6d')](_0x9594('0x71'),_0x9594('0x53'))[_0x9594('0x6d')](_0x9594('0x71'),_0x9594('0x54'))[_0x9594('0x72')](_0x9594('0x73'))[_0x9594('0x3c')](_0x9594('0x74'))[_0x9594('0x3c')](_0x9594('0x75'),_0x487bd9[_0x9594('0x6e')][_0x9594('0x70')]())[_0x9594('0x3c')](_0x9594('0x76'))['where'](_0x9594('0x77'),squel['select']()[_0x9594('0x6d')]('COALESCE(calleridnum,\x27\x27)')[_0x9594('0x72')](_0x9594('0x78'))[_0x9594('0x3c')](_0x9594('0x79'),_0x4a9672[_0x9594('0x47')]['id']['toString']()))[_0x9594('0x3c')](_0x9594('0x77'),squel[_0x9594('0x6c')]()[_0x9594('0x6d')](_0x9594('0x7a'))[_0x9594('0x72')](_0x9594('0x68'))[_0x9594('0x3c')](_0x9594('0x79'),_0x4a9672[_0x9594('0x47')]['id']['toString']())))['toString']();break;case _0x9594('0x7b'):_0x678322=squel[_0x9594('0x66')]()[_0x9594('0x67')](_0x9594('0x68'))[_0x9594('0x69')]([_0x9594('0x6a'),_0x9594('0x6b'),_0x9594('0x7c'),_0x9594('0x6f'),_0x9594('0x5a'),_0x9594('0x53'),_0x9594('0x54')],squel[_0x9594('0x6c')]()[_0x9594('0x6d')]('phone',_0x9594('0x6a'))[_0x9594('0x6d')]('NOW()',_0x9594('0x6b'))['field']('id',_0x9594('0x7c'))[_0x9594('0x6d')](_0x487bd9[_0x9594('0x6e')][_0x9594('0x70')](),_0x9594('0x6f'))[_0x9594('0x6d')](_0x4a9672[_0x9594('0x47')]['id']['toString'](),_0x9594('0x5a'))[_0x9594('0x6d')](_0x9594('0x71'),'createdAt')[_0x9594('0x6d')](_0x9594('0x71'),'updatedAt')[_0x9594('0x72')]('cm_contacts')[_0x9594('0x3c')](_0x9594('0x74'))[_0x9594('0x3c')](_0x9594('0x75'),_0x487bd9[_0x9594('0x6e')][_0x9594('0x70')]())[_0x9594('0x3c')](_0x9594('0x76'))[_0x9594('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x9594('0x7a'))[_0x9594('0x72')](_0x9594('0x68'))['where'](_0x9594('0x79'),_0x4a9672[_0x9594('0x47')]['id']['toString']())))[_0x9594('0x70')]();break;default:_0x678322=squel[_0x9594('0x66')]()['into']('cm_hopper')['fromQuery']([_0x9594('0x6a'),_0x9594('0x6b'),_0x9594('0x7c'),_0x9594('0x6f'),_0x9594('0x5a'),_0x9594('0x53'),_0x9594('0x54')],squel[_0x9594('0x6c')]()['field'](_0x9594('0x6a'),_0x9594('0x6a'))[_0x9594('0x6d')](_0x9594('0x71'),'scheduledAt')[_0x9594('0x6d')]('id',_0x9594('0x7c'))[_0x9594('0x6d')](_0x487bd9[_0x9594('0x6e')][_0x9594('0x70')](),_0x9594('0x6f'))['field'](_0x4a9672['params']['id'][_0x9594('0x70')](),'CampaignId')[_0x9594('0x6d')]('NOW()','createdAt')[_0x9594('0x6d')](_0x9594('0x71'),_0x9594('0x54'))[_0x9594('0x72')](_0x9594('0x73'))[_0x9594('0x3c')](_0x9594('0x74'))[_0x9594('0x3c')](_0x9594('0x75'),_0x487bd9[_0x9594('0x6e')][_0x9594('0x70')]())[_0x9594('0x3c')](_0x9594('0x76')))[_0x9594('0x70')]();}_0x4177ee[_0x9594('0x7d')](db['sequelize'][_0x9594('0x32')](_0x678322));}return BPromise[_0x9594('0x7e')](_0x4177ee);}})['then'](function(){return _0x5c22e2;})[_0x9594('0x24')](respondWithResult(_0x438036,null))[_0x9594('0x45')](handleError(_0x438036,null));};exports['removeLists']=function(_0x3bb8ce,_0x5b0357,_0x5a3ff1){return db[_0x9594('0x2e')][_0x9594('0x4a')]({'where':{'id':_0x3bb8ce[_0x9594('0x47')]['id']}})[_0x9594('0x24')](handleEntityNotFound(_0x5b0357,null))['then'](function(_0x1eed93){if(_0x1eed93){return _0x1eed93[_0x9594('0x7f')](_0x3bb8ce[_0x9594('0x32')]['ids']);}})[_0x9594('0x24')](function(_0x4b1417){if(_0x4b1417){return db[_0x9594('0x58')][_0x9594('0x25')]({'where':{'ListId':_0x3bb8ce[_0x9594('0x32')]['ids'],'CampaignId':_0x3bb8ce[_0x9594('0x47')]['id']}})[_0x9594('0x24')](function(){return _0x4b1417;});}})[_0x9594('0x24')](respondWithStatusCode(_0x5b0357,null))[_0x9594('0x45')](handleError(_0x5b0357,null));};exports[_0x9594('0x80')]=function(_0x24ac50,_0x278839,_0x3550d4){var _0x2fb0e8={'raw':!![],'where':{}};var _0x469dac={};var _0x37bc52={'count':0x0,'rows':[]};return db[_0x9594('0x2e')]['findOne']({'where':{'id':_0x24ac50['params']['id']}})[_0x9594('0x24')](handleEntityNotFound(_0x278839,null))[_0x9594('0x24')](function(_0x4edbd7){if(_0x4edbd7){_0x469dac[_0x9594('0x30')]=_['keys'](db['CmList'][_0x9594('0x48')]);_0x469dac[_0x9594('0x32')]=_['keys'](_0x24ac50[_0x9594('0x32')]);_0x469dac['filters']=_['intersection'](_0x469dac['model'],_0x469dac[_0x9594('0x32')]);_0x2fb0e8[_0x9594('0x37')]=_[_0x9594('0x35')](_0x469dac[_0x9594('0x30')],qs[_0x9594('0x36')](_0x24ac50[_0x9594('0x32')]['fields']));_0x2fb0e8[_0x9594('0x37')]=_0x2fb0e8['attributes'][_0x9594('0x38')]?_0x2fb0e8['attributes']:_0x469dac[_0x9594('0x30')];if(!_0x24ac50[_0x9594('0x32')][_0x9594('0x39')](_0x9594('0x3a'))){_0x2fb0e8[_0x9594('0x1e')]=qs[_0x9594('0x1e')](_0x24ac50[_0x9594('0x32')][_0x9594('0x1e')]);_0x2fb0e8[_0x9594('0x1d')]=qs['offset'](_0x24ac50[_0x9594('0x32')][_0x9594('0x1d')]);}_0x2fb0e8['order']=qs[_0x9594('0x3b')](_0x24ac50['query'][_0x9594('0x3b')]);_0x2fb0e8['where']=qs[_0x9594('0x34')](_['pick'](_0x24ac50[_0x9594('0x32')],_0x469dac[_0x9594('0x34')]));_0x2fb0e8['where']['CampaignId']=_0x4edbd7['id'];if(_0x24ac50[_0x9594('0x32')]['filter']){_0x2fb0e8[_0x9594('0x3c')]=_['merge'](_0x2fb0e8['where'],{'$or':_[_0x9594('0x31')](_0x2fb0e8[_0x9594('0x37')],function(_0xc24d90){var _0x1e74ea={};_0x1e74ea[_0xc24d90]={'$like':'%'+_0x24ac50['query'][_0x9594('0x40')]+'%'};return _0x1e74ea;})});}_0x2fb0e8=_[_0x9594('0x3e')]({},_0x2fb0e8,_0x24ac50[_0x9594('0x49')]);return db[_0x9594('0x81')][_0x9594('0x1c')]({'where':_0x2fb0e8[_0x9594('0x3c')]})['then'](function(_0x46093d){_0x37bc52[_0x9594('0x1c')]=_0x46093d;if(_0x24ac50[_0x9594('0x32')][_0x9594('0x41')]){_0x2fb0e8[_0x9594('0x42')]=[{'all':!![]}];}return db[_0x9594('0x81')]['findAll'](_0x2fb0e8);})[_0x9594('0x24')](function(_0x401dd6){_0x37bc52[_0x9594('0x44')]=_0x401dd6;return _0x37bc52;});}})[_0x9594('0x24')](respondWithFilteredResult(_0x278839,_0x2fb0e8))[_0x9594('0x45')](handleError(_0x278839,null));};exports['addBlackLists']=function(_0x367470,_0x42b226,_0x4c12af){var _0x560633,_0x30aba4;return db[_0x9594('0x2e')][_0x9594('0x4a')]({'where':{'id':_0x367470['params']['id']}})[_0x9594('0x24')](handleEntityNotFound(_0x42b226,null))['then'](function(_0x456043){if(_0x456043){_0x30aba4=_0x456043;return _0x456043['addBlackLists'](_0x367470['body'][_0x9594('0x63')],_['omit'](_0x367470[_0x9594('0x4c')],[_0x9594('0x63'),'id'])||{});}return null;})[_0x9594('0x82')](function(_0x285f7b){var _0x3bd8b4;_0x560633=_0x285f7b||[];var _0x110858=[];if(_0x285f7b){for(var _0x3d0bef=0x0;_0x3d0bef<_0x285f7b[_0x9594('0x38')];_0x3d0bef+=0x1){var _0xf49cc3=_0x285f7b[_0x3d0bef][_0x9594('0x26')]({'plain':!![]});_0x3bd8b4=squel[_0x9594('0x66')]()['into']('cm_hopper_black')[_0x9594('0x69')](['phone',_0x9594('0x7c'),_0x9594('0x6f'),_0x9594('0x5a'),_0x9594('0x53'),'updatedAt'],squel[_0x9594('0x6c')]()[_0x9594('0x6d')]('phone',_0x9594('0x6a'))[_0x9594('0x6d')]('id',_0x9594('0x7c'))['field'](_0xf49cc3[_0x9594('0x6e')]['toString'](),_0x9594('0x6f'))[_0x9594('0x6d')](_0x367470[_0x9594('0x47')]['id'][_0x9594('0x70')](),'CampaignId')[_0x9594('0x6d')](_0x9594('0x71'),_0x9594('0x53'))[_0x9594('0x6d')]('NOW()',_0x9594('0x54'))[_0x9594('0x72')](_0x9594('0x73'))[_0x9594('0x3c')](_0x9594('0x74'))['where'](_0x9594('0x75'),_0xf49cc3['CmListId']['toString']())[_0x9594('0x3c')](_0x9594('0x76')))[_0x9594('0x70')]();_0x110858[_0x9594('0x7d')](db[_0x9594('0x83')][_0x9594('0x32')](_0x3bd8b4));}return BPromise[_0x9594('0x7e')](_0x110858);}})[_0x9594('0x24')](function(){return _0x560633;})['then'](respondWithResult(_0x42b226,null))[_0x9594('0x45')](handleError(_0x42b226,null));};exports[_0x9594('0x84')]=function(_0x2828ce,_0x7311d5,_0x188e78){return db[_0x9594('0x2e')][_0x9594('0x4a')]({'where':{'id':_0x2828ce[_0x9594('0x47')]['id']}})['then'](handleEntityNotFound(_0x7311d5,null))[_0x9594('0x24')](function(_0x4f077d){if(_0x4f077d){return _0x4f077d[_0x9594('0x84')](_0x2828ce[_0x9594('0x32')][_0x9594('0x63')]);}})['then'](function(_0xe8d58a){if(_0xe8d58a){return db[_0x9594('0x60')][_0x9594('0x25')]({'where':{'ListId':_0x2828ce['query'][_0x9594('0x63')],'CampaignId':_0x2828ce[_0x9594('0x47')]['id']}})[_0x9594('0x24')](function(){return _0xe8d58a;});}})[_0x9594('0x24')](respondWithStatusCode(_0x7311d5,null))['catch'](handleError(_0x7311d5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3b04d28..73ec89a 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09e6=['request-promise','rimraf','../../config/environment','./campaign.attributes','exports','campaigns','api','moment','bluebird'];(function(_0x3c376e,_0x5b981){var _0x2361b7=function(_0x56a8e4){while(--_0x56a8e4){_0x3c376e['push'](_0x3c376e['shift']());}};_0x2361b7(++_0x5b981);}(_0x09e6,0xc3));var _0x609e=function(_0x2a76cf,_0x277e42){_0x2a76cf=_0x2a76cf-0x0;var _0x3f55e8=_0x09e6[_0x2a76cf];return _0x3f55e8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x609e('0x0'));var moment=require(_0x609e('0x1'));var BPromise=require(_0x609e('0x2'));var rp=require(_0x609e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x609e('0x4'));var config=require(_0x609e('0x5'));var attributes=require(_0x609e('0x6'));module[_0x609e('0x7')]=function(_0x475a2c,_0x2bda86){return _0x475a2c['define']('Campaign',attributes,{'tableName':_0x609e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04a0=['../../config/environment','./campaign.attributes','exports','define','Campaign','campaigns','lodash','util','api','bluebird','path'];(function(_0x6bc3f1,_0x1dc684){var _0x2c9633=function(_0x47759a){while(--_0x47759a){_0x6bc3f1['push'](_0x6bc3f1['shift']());}};_0x2c9633(++_0x1dc684);}(_0x04a0,0xa0));var _0x004a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x04a0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x004a('0x0'));var util=require(_0x004a('0x1'));var logger=require('../../config/logger')(_0x004a('0x2'));var moment=require('moment');var BPromise=require(_0x004a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x004a('0x4'));var rimraf=require('rimraf');var config=require(_0x004a('0x5'));var attributes=require(_0x004a('0x6'));module[_0x004a('0x7')]=function(_0x3d020d,_0x5f82e1){return _0x3d020d[_0x004a('0x8')](_0x004a('0x9'),attributes,{'tableName':_0x004a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 6a7d8f2..2c38541 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x563324,_0x6be59){var _0x492dfe=function(_0x54d037){while(--_0x54d037){_0x563324['push'](_0x563324['shift']());}};_0x492dfe(++_0x6be59);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file +var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x11917e,_0x443e53){var _0x3f402b=function(_0x2ec7a2){while(--_0x2ec7a2){_0x11917e['push'](_0x11917e['shift']());}};_0x3f402b(++_0x443e53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 4e76231..bcb4bc2 100644 --- a/server/api/campaign/index.js +++ b/server/api/campaign/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f68=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','delete','destroy','exports','util'];(function(_0x2797c6,_0x37421b){var _0x54809f=function(_0x2d100c){while(--_0x2d100c){_0x2797c6['push'](_0x2797c6['shift']());}};_0x54809f(++_0x37421b);}(_0x2f68,0x12b));var _0x82f6=function(_0x5e5162,_0x1fb92c){_0x5e5162=_0x5e5162-0x0;var _0x2ef68a=_0x2f68[_0x5e5162];return _0x2ef68a;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express[_0x82f6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require(_0x82f6('0x7'));router[_0x82f6('0x8')]('/',auth[_0x82f6('0x9')](),controller['index']);router['get'](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0xb')]);router[_0x82f6('0x8')](_0x82f6('0xc'),auth['isAuthenticated'](),controller[_0x82f6('0xd')]);router[_0x82f6('0x8')](_0x82f6('0xe'),auth[_0x82f6('0x9')](),controller['getHopperHistories']);router[_0x82f6('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x82f6('0xf')]);router['get'](_0x82f6('0x10'),auth[_0x82f6('0x9')](),controller['getHopperBlacks']);router[_0x82f6('0x8')]('/:id/lists',auth[_0x82f6('0x9')](),controller['getLists']);router['get'](_0x82f6('0x11'),auth[_0x82f6('0x9')](),controller[_0x82f6('0x12')]);router[_0x82f6('0x13')]('/',auth[_0x82f6('0x9')](),controller[_0x82f6('0x14')]);router[_0x82f6('0x13')](_0x82f6('0x15'),auth[_0x82f6('0x9')](),controller[_0x82f6('0x16')]);router[_0x82f6('0x13')](_0x82f6('0x17'),auth[_0x82f6('0x9')](),controller[_0x82f6('0x18')]);router[_0x82f6('0x13')](_0x82f6('0x11'),auth['isAuthenticated'](),controller[_0x82f6('0x19')]);router[_0x82f6('0x1a')](_0x82f6('0xa'),auth[_0x82f6('0x9')](),controller['update']);router[_0x82f6('0x1b')](_0x82f6('0xa'),auth[_0x82f6('0x9')](),controller[_0x82f6('0x1c')]);router['delete'](_0x82f6('0x17'),auth[_0x82f6('0x9')](),controller['removeLists']);router[_0x82f6('0x1b')](_0x82f6('0x11'),auth[_0x82f6('0x9')](),controller['removeBlackLists']);module[_0x82f6('0x1d')]=router; \ No newline at end of file +var _0xceef=['../../config/environment','get','isAuthenticated','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','put','update','destroy','delete','removeLists','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xceef,0xf6));var _0xfcee=function(_0x2b6482,_0x95e8a8){_0x2b6482=_0x2b6482-0x0;var _0x53e68f=_0xceef[_0x2b6482];return _0x53e68f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcee('0x0'));var timeout=require(_0xfcee('0x1'));var express=require('express');var router=express[_0xfcee('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xfcee('0x3'));var config=require(_0xfcee('0x4'));var controller=require('./campaign.controller');router[_0xfcee('0x5')]('/',auth[_0xfcee('0x6')](),controller['index']);router['get'](_0xfcee('0x7'),auth[_0xfcee('0x6')](),controller[_0xfcee('0x8')]);router['get']('/:id/hoppers',auth[_0xfcee('0x6')](),controller[_0xfcee('0x9')]);router[_0xfcee('0x5')](_0xfcee('0xa'),auth[_0xfcee('0x6')](),controller[_0xfcee('0xb')]);router[_0xfcee('0x5')]('/:id/hopper_finals',auth[_0xfcee('0x6')](),controller[_0xfcee('0xc')]);router[_0xfcee('0x5')](_0xfcee('0xd'),auth[_0xfcee('0x6')](),controller[_0xfcee('0xe')]);router[_0xfcee('0x5')](_0xfcee('0xf'),auth[_0xfcee('0x6')](),controller['getLists']);router[_0xfcee('0x5')](_0xfcee('0x10'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xfcee('0x11')]('/',auth[_0xfcee('0x6')](),controller[_0xfcee('0x12')]);router[_0xfcee('0x11')](_0xfcee('0x13'),auth[_0xfcee('0x6')](),controller['clone']);router[_0xfcee('0x11')](_0xfcee('0xf'),auth[_0xfcee('0x6')](),controller['addLists']);router[_0xfcee('0x11')](_0xfcee('0x10'),auth[_0xfcee('0x6')](),controller['addBlackLists']);router[_0xfcee('0x14')](_0xfcee('0x7'),auth[_0xfcee('0x6')](),controller[_0xfcee('0x15')]);router['delete']('/:id',auth[_0xfcee('0x6')](),controller[_0xfcee('0x16')]);router[_0xfcee('0x17')](_0xfcee('0xf'),auth[_0xfcee('0x6')](),controller[_0xfcee('0x18')]);router[_0xfcee('0x17')]('/:id/blacklists',auth[_0xfcee('0x6')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 211f2f9..efb1c52 100644 --- a/server/api/cannedAnswer/cannedAnswer.attributes.js +++ b/server/api/cannedAnswer/cannedAnswer.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dbd=['key','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x579c74,_0x70f6fd){var _0x2ee07f=function(_0x10b48d){while(--_0x10b48d){_0x579c74['push'](_0x579c74['shift']());}};_0x2ee07f(++_0x70f6fd);}(_0x7dbd,0xb5));var _0xd7db=function(_0x35e124,_0x1d85e2){_0x35e124=_0x35e124-0x0;var _0x53c482=_0x7dbd[_0x35e124];return _0x53c482;};'use strict';var Sequelize=require('sequelize');module[_0xd7db('0x0')]={'key':{'type':Sequelize[_0xd7db('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xd7db('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7db('0x1')]},'name':{'type':Sequelize[_0xd7db('0x3')],'get':function(){return this[_0xd7db('0x4')](_0xd7db('0x5'));}}}; \ No newline at end of file +var _0xb95c=['sequelize','exports','STRING','key'];(function(_0x201b2e,_0xd3771){var _0x1b6d20=function(_0x25e581){while(--_0x25e581){_0x201b2e['push'](_0x201b2e['shift']());}};_0x1b6d20(++_0xd3771);}(_0xb95c,0x108));var _0xcb95=function(_0x2b3b32,_0x3abc31){_0x2b3b32=_0x2b3b32-0x0;var _0x3cb62a=_0xb95c[_0x2b3b32];return _0x3cb62a;};'use strict';var Sequelize=require(_0xcb95('0x0'));module[_0xcb95('0x1')]={'key':{'type':Sequelize[_0xcb95('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xcb95('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xcb95('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 75ce755..da68a71 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CannedAnswer','count','include','catch','show','params','keys','length','includeAll','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0xde60af,_0x272972){var _0x4e4839=function(_0x1c2ed5){while(--_0x1c2ed5){_0xde60af['push'](_0xde60af['shift']());}};_0x4e4839(++_0x272972);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){var _0x32a09a=_0x460924[_0x7995('0x26')]({'plain':!![]});var _0x204507=_0x7995('0x27');return db[_0x7995('0x28')][_0x7995('0x25')]({'where':{'type':_0x204507,'resourceId':_0x32a09a['id']}})[_0x7995('0x24')](function(){return _0x460924;});})[_0x7995('0x24')](function(){_0x350fd9['status'](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1a')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x29')]);if(_0x47625f[_0x7995('0x2a')]){delete _0x47625f[_0x7995('0x2a')];}_0x2a307e[_0x7995('0x1b')](_0x56691a)[_0x7995('0x2b')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['CannedAnswer'][_0x7995('0x2c')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2d')],'type':_0xe6b0b3[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x3250e0[_0x7995('0x30')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x31')]=_['keys'](_0x9b2a15[_0x7995('0x31')]);_0x3250e0[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],_0x3250e0[_0x7995('0x31')]);_0x456a28['attributes']=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x34')]=_0x456a28[_0x7995('0x34')]['length']?_0x456a28[_0x7995('0x34')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x31')][_0x7995('0x35')](_0x7995('0x36'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x31')]['limit']);_0x456a28['offset']=qs[_0x7995('0x1e')](_0x9b2a15[_0x7995('0x31')]['offset']);}_0x456a28[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x9b2a15[_0x7995('0x31')][_0x7995('0x38')]);_0x456a28[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x9b2a15[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]));if(_0x9b2a15[_0x7995('0x31')]['filter']){_0x456a28[_0x7995('0x39')]=_[_0x7995('0x3b')](_0x456a28[_0x7995('0x39')],{'$or':_[_0x7995('0x3c')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2e')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2a')]]={'$like':'%'+_0x9b2a15[_0x7995('0x31')][_0x7995('0x3d')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3b')]({},_0x456a28,_0x9b2a15[_0x7995('0x3e')]);var _0x14d638={'where':_0x456a28[_0x7995('0x39')]};return db[_0x7995('0x3f')][_0x7995('0x40')](_0x14d638)[_0x7995('0x24')](function(_0x270d52){_0x4253e5[_0x7995('0x40')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x3f')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x42')](handleError(_0x514445,null));};exports[_0x7995('0x43')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':!![],'where':{'id':_0x35c8ff[_0x7995('0x44')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x3f')][_0x7995('0x2c')]);_0x5e85b9[_0x7995('0x31')]=_[_0x7995('0x45')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x33')](_0x5e85b9[_0x7995('0x30')],_0x5e85b9[_0x7995('0x31')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x30')],qs['fields'](_0x35c8ff[_0x7995('0x31')]['fields']));_0x46ac4f[_0x7995('0x34')]=_0x46ac4f['attributes'][_0x7995('0x46')]?_0x46ac4f[_0x7995('0x34')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x31')][_0x7995('0x47')]){_0x46ac4f[_0x7995('0x41')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3b')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x3f')][_0x7995('0x48')](_0x46ac4f)[_0x7995('0x24')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x42')](handleError(_0x576b96,null));};exports[_0x7995('0x49')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x4a')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x42')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3f')]['find']({'where':{'id':_0xddf537[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x4b')]=function(_0x1fe77e,_0x12d4b8){var _0x47d1d8={'key':_0x1fe77e['body']['key']};if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')]){_0x47d1d8['MailAccountId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')];}else if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4d')]){_0x47d1d8[_0x7995('0x4d')]=_0x1fe77e['body'][_0x7995('0x4d')];}else if(_0x1fe77e['body'][_0x7995('0x4e')]){_0x47d1d8[_0x7995('0x4e')]=_0x1fe77e[_0x7995('0x4a')]['OpenchannelAccountId'];}else if(_0x1fe77e['body']['ChatWebsiteId']){_0x47d1d8['ChatWebsiteId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4f')];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':_0x47d1d8})[_0x7995('0x24')](function(_0x357e60){if(_0x357e60){throw new db[(_0x7995('0x50'))][(_0x7995('0x51'))](_0x7995('0x52'));}return db[_0x7995('0x3f')][_0x7995('0x4b')](_0x1fe77e[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x35bea3){var _0x1ea1dc=_0x1fe77e[_0x7995('0x53')][_0x7995('0x26')]({'plain':!![]});if(!_0x1ea1dc)throw new Error(_0x7995('0x54'));if(_0x1ea1dc[_0x7995('0x55')]==='user'){var _0x56a374=_0x35bea3[_0x7995('0x26')]({'plain':!![]});return db[_0x7995('0x56')][_0x7995('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x1ea1dc['userProfileId']},'raw':!![]})[_0x7995('0x24')](function(_0x197b52){if(_0x197b52&&_0x197b52[_0x7995('0x57')]===0x0){return db[_0x7995('0x28')]['create']({'name':_0x56a374[_0x7995('0x2a')],'resourceId':_0x56a374['id'],'type':_0x197b52[_0x7995('0x2a')],'sectionId':_0x197b52['id']},{})[_0x7995('0x24')](function(){return _0x35bea3;});}else{return _0x35bea3;}})[_0x7995('0x42')](function(_0x502d43){logger['error'](_0x7995('0x58'),_0x502d43);throw _0x502d43;});}return _0x35bea3;})[_0x7995('0x24')](respondWithResult(_0x12d4b8,0xc9))[_0x7995('0x42')](handleError(_0x12d4b8,null));}; \ No newline at end of file +var _0x34e8=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','sendStatus','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x4c0196,_0x37d762){var _0x398d3e=function(_0xe32c1a){while(--_0xe32c1a){_0x4c0196['push'](_0x4c0196['shift']());}};_0x398d3e(++_0x37d762);}(_0x34e8,0x12c));var _0x834e=function(_0x4ea662,_0x144a3c){_0x4ea662=_0x4ea662-0x0;var _0xef3605=_0x34e8[_0x4ea662];return _0xef3605;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){var _0x34563b=_0x5c55ca['get']({'plain':!![]});var _0x25ee1d=_0x834e('0x29');return db['UserProfileResource'][_0x834e('0x2a')]({'where':{'type':_0x25ee1d,'resourceId':_0x34563b['id']}})[_0x834e('0x28')](function(){return _0x5c55ca;});})[_0x834e('0x28')](function(){_0x28d687['status'](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x3e310f[_0x834e('0x2b')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x2c')](_0x3f1b0b[_0x834e('0x2d')]);if(_0x3f1b0b[_0x834e('0x2e')]){delete _0x3f1b0b[_0x834e('0x2e')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={},_0x106d6a={},_0x5dacc1={'count':0x0,'rows':[]};var _0xb5bc06=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x4551f5){return{'name':_0x4551f5[_0x834e('0x32')],'type':_0x4551f5[_0x834e('0x33')][_0x834e('0x34')]};});_0x106d6a[_0x834e('0x35')]=_['map'](_0xb5bc06,_0x834e('0x2e'));_0x106d6a['query']=_[_0x834e('0x36')](_0x58c1d7[_0x834e('0x37')]);_0x106d6a[_0x834e('0x38')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],_0x106d6a[_0x834e('0x37')]);_0x567cea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x58c1d7['query'][_0x834e('0x3b')]));_0x567cea[_0x834e('0x3a')]=_0x567cea[_0x834e('0x3a')][_0x834e('0x3c')]?_0x567cea['attributes']:_0x106d6a[_0x834e('0x35')];if(!_0x58c1d7[_0x834e('0x37')]['hasOwnProperty']('nolimit')){_0x567cea['limit']=qs[_0x834e('0x22')](_0x58c1d7[_0x834e('0x37')][_0x834e('0x22')]);_0x567cea[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x58c1d7[_0x834e('0x37')]['offset']);}_0x567cea[_0x834e('0x3d')]=qs['sort'](_0x58c1d7[_0x834e('0x37')][_0x834e('0x3e')]);_0x567cea['where']=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x58c1d7['query'],_0x106d6a['filters']));if(_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]){_0x567cea[_0x834e('0x41')]=_[_0x834e('0x42')](_0x567cea[_0x834e('0x41')],{'$or':_['map'](_0xb5bc06,function(_0x1c5ed6){if(_0x1c5ed6['type']!=='VIRTUAL'){var _0x1b2edf={};_0x1b2edf[_0x1c5ed6['name']]={'$like':'%'+_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x1b2edf;}})});}_0x567cea=_[_0x834e('0x42')]({},_0x567cea,_0x58c1d7[_0x834e('0x43')]);var _0x2b7933={'where':_0x567cea['where']};return db[_0x834e('0x30')][_0x834e('0x20')](_0x2b7933)[_0x834e('0x28')](function(_0x58c5fb){_0x5dacc1[_0x834e('0x20')]=_0x58c5fb;if(_0x58c1d7[_0x834e('0x37')]['includeAll']){_0x567cea[_0x834e('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x834e('0x45')](_0x567cea);})[_0x834e('0x28')](function(_0x4a18bb){_0x5dacc1['rows']=_0x4a18bb;return _0x5dacc1;})[_0x834e('0x28')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x46')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x47')]=function(_0xbc1571,_0x8ad264){var _0x23feea={'raw':!![],'where':{'id':_0xbc1571['params']['id']}},_0x195204={};_0x195204[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x195204[_0x834e('0x37')]=_['keys'](_0xbc1571[_0x834e('0x37')]);_0x195204[_0x834e('0x38')]=_['intersection'](_0x195204[_0x834e('0x35')],_0x195204[_0x834e('0x37')]);_0x23feea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x195204[_0x834e('0x35')],qs[_0x834e('0x3b')](_0xbc1571[_0x834e('0x37')][_0x834e('0x3b')]));_0x23feea[_0x834e('0x3a')]=_0x23feea[_0x834e('0x3a')]['length']?_0x23feea[_0x834e('0x3a')]:_0x195204[_0x834e('0x35')];if(_0xbc1571['query'][_0x834e('0x48')]){_0x23feea[_0x834e('0x44')]=[{'all':!![]}];}_0x23feea=_[_0x834e('0x42')]({},_0x23feea,_0xbc1571[_0x834e('0x43')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x23feea)['then'](handleEntityNotFound(_0x8ad264,null))['then'](respondWithResult(_0x8ad264,null))[_0x834e('0x46')](handleError(_0x8ad264,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4a')]['id']){delete _0x30568e[_0x834e('0x4a')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x30568e[_0x834e('0x4b')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x2a')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1a3855[_0x834e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x46')](handleError(_0x3df078,null));};exports['create']=function(_0x3c00a3,_0x3b0988){var _0x55d491={'key':_0x3c00a3[_0x834e('0x4a')][_0x834e('0x34')]};if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')]){_0x55d491[_0x834e('0x4c')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')];}else if(_0x3c00a3['body'][_0x834e('0x4d')]){_0x55d491[_0x834e('0x4d')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4d')];}else if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4e')]){_0x55d491[_0x834e('0x4e')]=_0x3c00a3[_0x834e('0x4a')]['OpenchannelAccountId'];}else if(_0x3c00a3[_0x834e('0x4a')]['ChatWebsiteId']){_0x55d491[_0x834e('0x4f')]=_0x3c00a3['body'][_0x834e('0x4f')];}return db['CannedAnswer']['find']({'where':_0x55d491})[_0x834e('0x28')](function(_0x3e1bee){if(_0x3e1bee){throw new db['Sequelize']['ValidationError'](_0x834e('0x50'));}return db[_0x834e('0x30')][_0x834e('0x51')](_0x3c00a3[_0x834e('0x4a')]);})[_0x834e('0x28')](function(_0x315858){var _0x3d3f2b=_0x3c00a3[_0x834e('0x52')]['get']({'plain':!![]});if(!_0x3d3f2b)throw new Error(_0x834e('0x53'));if(_0x3d3f2b[_0x834e('0x54')]==='user'){var _0x281342=_0x315858['get']({'plain':!![]});return db[_0x834e('0x55')][_0x834e('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3d3f2b[_0x834e('0x56')]},'raw':!![]})[_0x834e('0x28')](function(_0x2de29a){if(_0x2de29a&&_0x2de29a[_0x834e('0x57')]===0x0){return db['UserProfileResource'][_0x834e('0x51')]({'name':_0x281342[_0x834e('0x2e')],'resourceId':_0x281342['id'],'type':_0x2de29a[_0x834e('0x2e')],'sectionId':_0x2de29a['id']},{})['then'](function(){return _0x315858;});}else{return _0x315858;}})[_0x834e('0x46')](function(_0x1fcae9){logger[_0x834e('0x2c')](_0x834e('0x58'),_0x1fcae9);throw _0x1fcae9;});}return _0x315858;})[_0x834e('0x28')](respondWithResult(_0x3b0988,0xc9))[_0x834e('0x46')](handleError(_0x3b0988,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 5f8d276..d22dc4a 100644 --- a/server/api/cannedAnswer/cannedAnswer.model.js +++ b/server/api/cannedAnswer/cannedAnswer.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cbc=['moment','bluebird','path','rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','util','api'];(function(_0x341106,_0x4b324f){var _0xffc2f1=function(_0x204c2b){while(--_0x204c2b){_0x341106['push'](_0x341106['shift']());}};_0xffc2f1(++_0x4b324f);}(_0x4cbc,0x127));var _0xc4cb=function(_0x2bd10b,_0x4658b3){_0x2bd10b=_0x2bd10b-0x0;var _0x53580b=_0x4cbc[_0x2bd10b];return _0x53580b;};'use strict';var _=require('lodash');var util=require(_0xc4cb('0x0'));var logger=require('../../config/logger')(_0xc4cb('0x1'));var moment=require(_0xc4cb('0x2'));var BPromise=require(_0xc4cb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4cb('0x4'));var rimraf=require(_0xc4cb('0x5'));var config=require(_0xc4cb('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xc4cb('0x7')]=function(_0x5cf49e,_0x25abb7){return _0x5cf49e[_0xc4cb('0x8')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc4cb('0x9'),'collate':_0xc4cb('0xa')});}; \ No newline at end of file +var _0xde9d=['api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0xde9d,0x156));var _0xdde9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde9d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xdde9('0x0'));var util=require(_0xdde9('0x1'));var logger=require(_0xdde9('0x2'))(_0xdde9('0x3'));var moment=require(_0xdde9('0x4'));var BPromise=require('bluebird');var rp=require(_0xdde9('0x5'));var fs=require('fs');var path=require(_0xdde9('0x6'));var rimraf=require(_0xdde9('0x7'));var config=require('../../config/environment');var attributes=require(_0xdde9('0x8'));module[_0xdde9('0x9')]=function(_0x1ea43e,_0x4c10e9){return _0x1ea43e[_0xdde9('0xa')](_0xdde9('0xb'),attributes,{'tableName':_0xdde9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdde9('0xd'),'collate':_0xdde9('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index cdcafa4..55d2fba 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb71=['CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CannedAnswer,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','debug'];(function(_0x482b06,_0x475ea9){var _0x404a0a=function(_0x20c047){while(--_0x20c047){_0x482b06['push'](_0x482b06['shift']());}};_0x404a0a(++_0x475ea9);}(_0xfb71,0x11f));var _0x1fb7=function(_0x568fe4,_0x4ba2c1){_0x568fe4=_0x568fe4-0x0;var _0x15da2a=_0xfb71[_0x568fe4];return _0x15da2a;};'use strict';var _=require(_0x1fb7('0x0'));var util=require(_0x1fb7('0x1'));var moment=require(_0x1fb7('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fb7('0x3'));var fs=require('fs');var Redis=require(_0x1fb7('0x4'));var db=require(_0x1fb7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fb7('0x6'))('rpc');var config=require(_0x1fb7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1fb7('0x8')][_0x1fb7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x518044,_0x10e872,_0x426dd){return new BPromise(function(_0x207300,_0x7c9ac9){return client[_0x1fb7('0xa')](_0x518044,_0x426dd)['then'](function(_0x128ef6){logger[_0x1fb7('0xb')]('CannedAnswer,\x20%s,\x20%s',_0x10e872,'request\x20sent');logger[_0x1fb7('0xc')](_0x1fb7('0xd'),_0x10e872,_0x1fb7('0xe'),JSON[_0x1fb7('0xf')](_0x128ef6));if(_0x128ef6[_0x1fb7('0x10')]){if(_0x128ef6[_0x1fb7('0x10')]['code']===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x10e872,_0x128ef6[_0x1fb7('0x10')]['message']);return _0x7c9ac9(_0x128ef6['error'][_0x1fb7('0x11')]);}logger[_0x1fb7('0x10')](_0x1fb7('0x12'),_0x10e872,_0x128ef6[_0x1fb7('0x10')]['message']);return _0x207300(_0x128ef6[_0x1fb7('0x10')][_0x1fb7('0x11')]);}else{logger[_0x1fb7('0xb')](_0x1fb7('0x12'),_0x10e872,'request\x20sent');_0x207300(_0x128ef6['result'][_0x1fb7('0x11')]);}})[_0x1fb7('0x13')](function(_0x284e90){logger[_0x1fb7('0x10')](_0x1fb7('0x12'),_0x10e872,_0x284e90);_0x7c9ac9(_0x284e90);});});} \ No newline at end of file +var _0x71bf=['util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0x71bf,0x13a));var _0xf71b=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x71bf[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require(_0xf71b('0x0'));var util=require(_0xf71b('0x1'));var moment=require('moment');var BPromise=require(_0xf71b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf71b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf71b('0x4'));var config=require(_0xf71b('0x5'));var jayson=require(_0xf71b('0x6'));var client=jayson[_0xf71b('0x7')][_0xf71b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x288e8d,_0x55125a,_0x1c8a31){return new BPromise(function(_0x1f7052,_0x2140e5){return client[_0xf71b('0x9')](_0x288e8d,_0x1c8a31)[_0xf71b('0xa')](function(_0x1690bd){logger[_0xf71b('0xb')]('CannedAnswer,\x20%s,\x20%s',_0x55125a,_0xf71b('0xc'));logger[_0xf71b('0xd')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x55125a,_0xf71b('0xc'),JSON[_0xf71b('0xe')](_0x1690bd));if(_0x1690bd[_0xf71b('0xf')]){if(_0x1690bd['error'][_0xf71b('0x10')]===0x1f4){logger[_0xf71b('0xf')](_0xf71b('0x11'),_0x55125a,_0x1690bd['error'][_0xf71b('0x12')]);return _0x2140e5(_0x1690bd[_0xf71b('0xf')]['message']);}logger['error']('CannedAnswer,\x20%s,\x20%s',_0x55125a,_0x1690bd[_0xf71b('0xf')][_0xf71b('0x12')]);return _0x1f7052(_0x1690bd[_0xf71b('0xf')][_0xf71b('0x12')]);}else{logger[_0xf71b('0xb')](_0xf71b('0x11'),_0x55125a,'request\x20sent');_0x1f7052(_0x1690bd[_0xf71b('0x13')][_0xf71b('0x12')]);}})[_0xf71b('0x14')](function(_0x7991f5){logger[_0xf71b('0xf')](_0xf71b('0x11'),_0x55125a,_0x7991f5);_0x2140e5(_0x7991f5);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 322a4df..331bf62 100644 --- a/server/api/cannedAnswer/index.js +++ b/server/api/cannedAnswer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2e6=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index','get','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x3a41a8,_0x1e25b9){var _0x19dfeb=function(_0x4f6567){while(--_0x4f6567){_0x3a41a8['push'](_0x3a41a8['shift']());}};_0x19dfeb(++_0x1e25b9);}(_0xc2e6,0xdd));var _0x6c2e=function(_0x17f061,_0x662fff){_0x17f061=_0x17f061-0x0;var _0x5ac77e=_0xc2e6[_0x17f061];return _0x5ac77e;};'use strict';var multer=require(_0x6c2e('0x0'));var util=require(_0x6c2e('0x1'));var path=require(_0x6c2e('0x2'));var timeout=require(_0x6c2e('0x3'));var express=require(_0x6c2e('0x4'));var router=express[_0x6c2e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6c2e('0x6'));var config=require(_0x6c2e('0x7'));var controller=require(_0x6c2e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6c2e('0x9')]);router[_0x6c2e('0xa')](_0x6c2e('0xb'),auth[_0x6c2e('0xc')](),controller[_0x6c2e('0xd')]);router[_0x6c2e('0xe')]('/',auth[_0x6c2e('0xc')](),controller[_0x6c2e('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6c2e('0x10')]);router[_0x6c2e('0x11')](_0x6c2e('0xb'),auth['isAuthenticated'](),controller[_0x6c2e('0x12')]);module[_0x6c2e('0x13')]=router; \ No newline at end of file +var _0x603f=['create','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','/:id','isAuthenticated','show'];(function(_0x24e91d,_0x5d6ffe){var _0x324d8d=function(_0x53a0e0){while(--_0x53a0e0){_0x24e91d['push'](_0x24e91d['shift']());}};_0x324d8d(++_0x5d6ffe);}(_0x603f,0x65));var _0xf603=function(_0x3d138d,_0x4db733){_0x3d138d=_0x3d138d-0x0;var _0x5ea449=_0x603f[_0x3d138d];return _0x5ea449;};'use strict';var multer=require(_0xf603('0x0'));var util=require('util');var path=require(_0xf603('0x1'));var timeout=require(_0xf603('0x2'));var express=require(_0xf603('0x3'));var router=express['Router']();var auth=require(_0xf603('0x4'));var interaction=require(_0xf603('0x5'));var config=require('../../config/environment');var controller=require(_0xf603('0x6'));router[_0xf603('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf603('0x7')](_0xf603('0x8'),auth[_0xf603('0x9')](),controller[_0xf603('0xa')]);router['post']('/',auth[_0xf603('0x9')](),controller[_0xf603('0xb')]);router['put'](_0xf603('0x8'),auth[_0xf603('0x9')](),controller[_0xf603('0xc')]);router[_0xf603('0xd')](_0xf603('0x8'),auth[_0xf603('0x9')](),controller[_0xf603('0xe')]);module[_0xf603('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 72d09cc..a0319f1 100644 --- a/server/api/cdr/cdr.attributes.js +++ b/server/api/cdr/cdr.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba11=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba11,0x103));var _0x1ba1=function(_0x492473,_0x692711){_0x492473=_0x492473-0x0;var _0x17290c=_0xba11[_0x492473];return _0x17290c;};'use strict';var Sequelize=require(_0x1ba1('0x0'));module[_0x1ba1('0x1')]={'calldate':{'type':Sequelize[_0x1ba1('0x2')],'allowNull':![],'defaultValue':_0x1ba1('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x1ba1('0x4')]},'dst':{'type':Sequelize[_0x1ba1('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x1ba1('0x4')]},'lastapp':{'type':Sequelize[_0x1ba1('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x1ba1('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1ba1('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1ba1('0x4')]},'amaflags':{'type':Sequelize[_0x1ba1('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1ba1('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1ba1('0x4')]},'linkedid':{'type':Sequelize[_0x1ba1('0x4')]},'sequence':{'type':Sequelize[_0x1ba1('0x4')]},'peeraccount':{'type':Sequelize[_0x1ba1('0x4')]},'type':{'type':Sequelize[_0x1ba1('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb788=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x2035b5,_0xaa4f77){var _0x5e7902=function(_0x32ba72){while(--_0x32ba72){_0x2035b5['push'](_0x2035b5['shift']());}};_0x5e7902(++_0xaa4f77);}(_0xb788,0xab));var _0x8b78=function(_0xd9c529,_0x19f8cc){_0xd9c529=_0xd9c529-0x0;var _0x146760=_0xb788[_0xd9c529];return _0x146760;};'use strict';var Sequelize=require(_0x8b78('0x0'));module[_0x8b78('0x1')]={'calldate':{'type':Sequelize[_0x8b78('0x2')],'allowNull':![],'defaultValue':_0x8b78('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8b78('0x4')]},'dst':{'type':Sequelize[_0x8b78('0x4')]},'dcontext':{'type':Sequelize[_0x8b78('0x4')]},'channel':{'type':Sequelize[_0x8b78('0x4')]},'dstchannel':{'type':Sequelize[_0x8b78('0x4')]},'lastapp':{'type':Sequelize[_0x8b78('0x4')]},'lastdata':{'type':Sequelize[_0x8b78('0x4')]},'duration':{'type':Sequelize[_0x8b78('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8b78('0x4')]},'amaflags':{'type':Sequelize[_0x8b78('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8b78('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x8b78('0x4')]},'sequence':{'type':Sequelize[_0x8b78('0x4')]},'peeraccount':{'type':Sequelize[_0x8b78('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x8b78('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 087290d..0c2c867 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20ce=['save','update','then','destroy','end','error','name','send','index','map','Cdr','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x30720a,_0x1cd097){var _0x12cdef=function(_0x2668f0){while(--_0x2668f0){_0x30720a['push'](_0x30720a['shift']());}};_0x12cdef(++_0x1cd097);}(_0x20ce,0x10d));var _0xe20c=function(_0x186651,_0x317e7e){_0x186651=_0x186651-0x0;var _0x5e3667=_0x20ce[_0x186651];return _0x5e3667;};'use strict';var pdf=require(_0xe20c('0x0'));var emlformat=require(_0xe20c('0x1'));var rimraf=require(_0xe20c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe20c('0x3'));var rp=require(_0xe20c('0x4'));var moment=require(_0xe20c('0x5'));var BPromise=require(_0xe20c('0x6'));var Mustache=require(_0xe20c('0x7'));var util=require(_0xe20c('0x8'));var path=require(_0xe20c('0x9'));var sox=require(_0xe20c('0xa'));var csv=require(_0xe20c('0xb'));var ejs=require(_0xe20c('0xc'));var fs=require('fs');var _=require(_0xe20c('0xd'));var squel=require(_0xe20c('0xe'));var crypto=require(_0xe20c('0xf'));var jsforce=require(_0xe20c('0x10'));var deskjs=require(_0xe20c('0x11'));var toCsv=require(_0xe20c('0xb'));var querystring=require(_0xe20c('0x12'));var Papa=require(_0xe20c('0x13'));var Redis=require(_0xe20c('0x14'));var authService=require(_0xe20c('0x15'));var qs=require(_0xe20c('0x16'));var as=require(_0xe20c('0x17'));var hardwareService=require(_0xe20c('0x18'));var logger=require(_0xe20c('0x19'))('api');var utils=require(_0xe20c('0x1a'));var config=require(_0xe20c('0x1b'));var db=require(_0xe20c('0x1c'))['db'];function respondWithStatusCode(_0x2e959c,_0x88a5a2){_0x88a5a2=_0x88a5a2||0xcc;return function(_0x5a5c8c){if(_0x5a5c8c){return _0x2e959c[_0xe20c('0x1d')](_0x88a5a2);}return _0x2e959c[_0xe20c('0x1e')](_0x88a5a2)['end']();};}function respondWithResult(_0xf732b3,_0x3f20ae){_0x3f20ae=_0x3f20ae||0xc8;return function(_0x2258c1){if(_0x2258c1){return _0xf732b3['status'](_0x3f20ae)[_0xe20c('0x1f')](_0x2258c1);}};}function respondWithFilteredResult(_0x3f135f,_0x374707){return function(_0x1ea493){if(_0x1ea493){var _0x4cfe26=_0x1ea493[_0xe20c('0x20')],_0x5c6a8a=_0x374707[_0xe20c('0x21')],_0x5a1ed5=_0x374707[_0xe20c('0x21')]+_0x374707[_0xe20c('0x22')],_0x2015ed;if(_0x5a1ed5>=_0x4cfe26){_0x5a1ed5=_0x4cfe26;_0x2015ed=0xc8;}else{_0x2015ed=0xce;}_0x3f135f[_0xe20c('0x1e')](_0x2015ed);return _0x3f135f[_0xe20c('0x23')](_0xe20c('0x24'),_0x5c6a8a+'-'+_0x5a1ed5+'/'+_0x4cfe26)[_0xe20c('0x1f')](_0x1ea493);}return null;};}function patchUpdates(_0x3768b0){return function(_0x506825){try{jsonpatch[_0xe20c('0x25')](_0x506825,_0x3768b0,!![]);}catch(_0x562649){return BPromise[_0xe20c('0x26')](_0x562649);}return _0x506825[_0xe20c('0x27')]();};}function saveUpdates(_0x563352,_0x563070){return function(_0xc91c71){if(_0xc91c71){return _0xc91c71[_0xe20c('0x28')](_0x563352)[_0xe20c('0x29')](function(_0x5d56bd){return _0x5d56bd;});}return null;};}function removeEntity(_0x5c8268,_0x1eabb8){return function(_0x281449){if(_0x281449){return _0x281449[_0xe20c('0x2a')]()[_0xe20c('0x29')](function(){_0x5c8268['status'](0xcc)[_0xe20c('0x2b')]();});}};}function handleEntityNotFound(_0x564605,_0x13bf33){return function(_0x15f9d1){if(!_0x15f9d1){_0x564605[_0xe20c('0x1d')](0x194);}return _0x15f9d1;};}function handleError(_0x33c260,_0x1dcd8c){_0x1dcd8c=_0x1dcd8c||0x1f4;return function(_0x1e725c){logger[_0xe20c('0x2c')](_0x1e725c['stack']);if(_0x1e725c[_0xe20c('0x2d')]){delete _0x1e725c[_0xe20c('0x2d')];}_0x33c260[_0xe20c('0x1e')](_0x1dcd8c)[_0xe20c('0x2e')](_0x1e725c);};}exports[_0xe20c('0x2f')]=function(_0x297279,_0x8d061b){var _0xd39cc6={},_0x562e52={},_0x4f7dda={'count':0x0,'rows':[]};var _0x24f002=_[_0xe20c('0x30')](db[_0xe20c('0x31')]['rawAttributes'],function(_0x34666d){return{'name':_0x34666d['fieldName'],'type':_0x34666d['type'][_0xe20c('0x32')]};});_0x562e52[_0xe20c('0x33')]=_[_0xe20c('0x30')](_0x24f002,'name');_0x562e52[_0xe20c('0x34')]=_[_0xe20c('0x35')](_0x297279[_0xe20c('0x34')]);_0x562e52[_0xe20c('0x36')]=_['intersection'](_0x562e52[_0xe20c('0x33')],_0x562e52[_0xe20c('0x34')]);_0xd39cc6['attributes']=_[_0xe20c('0x37')](_0x562e52[_0xe20c('0x33')],qs[_0xe20c('0x38')](_0x297279[_0xe20c('0x34')][_0xe20c('0x38')]));_0xd39cc6[_0xe20c('0x39')]=_0xd39cc6[_0xe20c('0x39')][_0xe20c('0x3a')]?_0xd39cc6[_0xe20c('0x39')]:_0x562e52[_0xe20c('0x33')];if(!_0x297279['query'][_0xe20c('0x3b')](_0xe20c('0x3c'))){_0xd39cc6[_0xe20c('0x22')]=qs[_0xe20c('0x22')](_0x297279[_0xe20c('0x34')]['limit']);_0xd39cc6[_0xe20c('0x21')]=qs[_0xe20c('0x21')](_0x297279[_0xe20c('0x34')]['offset']);}_0xd39cc6['order']=qs[_0xe20c('0x3d')](_0x297279[_0xe20c('0x34')][_0xe20c('0x3d')]);_0xd39cc6[_0xe20c('0x3e')]=qs[_0xe20c('0x36')](_[_0xe20c('0x3f')](_0x297279[_0xe20c('0x34')],_0x562e52[_0xe20c('0x36')]));if(_0x297279[_0xe20c('0x34')]['filter']){_0xd39cc6['where']=_[_0xe20c('0x40')](_0xd39cc6[_0xe20c('0x3e')],{'$or':_['map'](_0x24f002,function(_0x4137d6){if(_0x4137d6['type']!==_0xe20c('0x41')){var _0xea1ecc={};_0xea1ecc[_0x4137d6[_0xe20c('0x2d')]]={'$like':'%'+_0x297279['query']['filter']+'%'};return _0xea1ecc;}})});}_0xd39cc6=_['merge']({},_0xd39cc6,_0x297279[_0xe20c('0x42')]);var _0x1c9ba9={'where':_0xd39cc6[_0xe20c('0x3e')]};return db['Cdr'][_0xe20c('0x20')](_0x1c9ba9)[_0xe20c('0x29')](function(_0x5604b0){_0x4f7dda['count']=_0x5604b0;if(_0x297279[_0xe20c('0x34')][_0xe20c('0x43')]){_0xd39cc6[_0xe20c('0x44')]=[{'all':!![]}];}return db[_0xe20c('0x31')][_0xe20c('0x45')](_0xd39cc6);})[_0xe20c('0x29')](function(_0x46f0ae){_0x4f7dda['rows']=_0x46f0ae;return _0x4f7dda;})['then'](respondWithFilteredResult(_0x8d061b,_0xd39cc6))[_0xe20c('0x46')](handleError(_0x8d061b,null));};exports[_0xe20c('0x47')]=function(_0x1084b4,_0x40293f){var _0x3c1b9c={'raw':!![],'where':{'id':_0x1084b4['params']['id']}},_0x5c9ef0={};_0x5c9ef0['model']=_['keys'](db[_0xe20c('0x31')][_0xe20c('0x48')]);_0x5c9ef0['query']=_[_0xe20c('0x35')](_0x1084b4[_0xe20c('0x34')]);_0x5c9ef0[_0xe20c('0x36')]=_[_0xe20c('0x37')](_0x5c9ef0['model'],_0x5c9ef0[_0xe20c('0x34')]);_0x3c1b9c['attributes']=_[_0xe20c('0x37')](_0x5c9ef0[_0xe20c('0x33')],qs[_0xe20c('0x38')](_0x1084b4['query']['fields']));_0x3c1b9c['attributes']=_0x3c1b9c[_0xe20c('0x39')]['length']?_0x3c1b9c[_0xe20c('0x39')]:_0x5c9ef0[_0xe20c('0x33')];if(_0x1084b4['query'][_0xe20c('0x43')]){_0x3c1b9c['include']=[{'all':!![]}];}_0x3c1b9c=_['merge']({},_0x3c1b9c,_0x1084b4[_0xe20c('0x42')]);return db['Cdr'][_0xe20c('0x49')](_0x3c1b9c)[_0xe20c('0x29')](handleEntityNotFound(_0x40293f,null))[_0xe20c('0x29')](respondWithResult(_0x40293f,null))[_0xe20c('0x46')](handleError(_0x40293f,null));};exports[_0xe20c('0x4a')]=function(_0x2c50c,_0x1cbb3e){return db[_0xe20c('0x31')][_0xe20c('0x4a')](_0x2c50c[_0xe20c('0x4b')],{})[_0xe20c('0x29')](respondWithResult(_0x1cbb3e,0xc9))[_0xe20c('0x46')](handleError(_0x1cbb3e,null));};exports[_0xe20c('0x28')]=function(_0x19183e,_0xfcb582){if(_0x19183e[_0xe20c('0x4b')]['id']){delete _0x19183e['body']['id'];}return db[_0xe20c('0x31')]['find']({'where':{'id':_0x19183e[_0xe20c('0x4c')]['id']}})['then'](handleEntityNotFound(_0xfcb582,null))[_0xe20c('0x29')](saveUpdates(_0x19183e[_0xe20c('0x4b')],null))[_0xe20c('0x29')](respondWithResult(_0xfcb582,null))[_0xe20c('0x46')](handleError(_0xfcb582,null));};exports['destroy']=function(_0x44424d,_0x2ff082){return db['Cdr']['find']({'where':{'id':_0x44424d[_0xe20c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2ff082,null))[_0xe20c('0x29')](removeEntity(_0x2ff082,null))[_0xe20c('0x46')](handleError(_0x2ff082,null));};exports['describe']=function(_0x373695,_0x29645b){return db[_0xe20c('0x31')]['describe']()[_0xe20c('0x29')](respondWithResult(_0x29645b,null))['catch'](handleError(_0x29645b,null));}; \ No newline at end of file +var _0x4d10=['json','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','findAll','rows','params','options','catch','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x2767fb,_0x18f603){var _0x58592e=function(_0x59b1ef){while(--_0x59b1ef){_0x2767fb['push'](_0x2767fb['shift']());}};_0x58592e(++_0x18f603);}(_0x4d10,0x115));var _0x04d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d10[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x04d1('0x0'));var emlformat=require(_0x04d1('0x1'));var rimraf=require(_0x04d1('0x2'));var zipdir=require(_0x04d1('0x3'));var jsonpatch=require(_0x04d1('0x4'));var rp=require(_0x04d1('0x5'));var moment=require('moment');var BPromise=require(_0x04d1('0x6'));var Mustache=require(_0x04d1('0x7'));var util=require(_0x04d1('0x8'));var path=require(_0x04d1('0x9'));var sox=require(_0x04d1('0xa'));var csv=require(_0x04d1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x04d1('0xc'));var squel=require(_0x04d1('0xd'));var crypto=require(_0x04d1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x04d1('0xb'));var querystring=require(_0x04d1('0xf'));var Papa=require('papaparse');var Redis=require(_0x04d1('0x10'));var authService=require(_0x04d1('0x11'));var qs=require(_0x04d1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04d1('0x13'));var logger=require(_0x04d1('0x14'))(_0x04d1('0x15'));var utils=require(_0x04d1('0x16'));var config=require(_0x04d1('0x17'));var db=require(_0x04d1('0x18'))['db'];function respondWithStatusCode(_0x103f50,_0x129764){_0x129764=_0x129764||0xcc;return function(_0x215dba){if(_0x215dba){return _0x103f50[_0x04d1('0x19')](_0x129764);}return _0x103f50[_0x04d1('0x1a')](_0x129764)['end']();};}function respondWithResult(_0x3617af,_0x5d4aec){_0x5d4aec=_0x5d4aec||0xc8;return function(_0x1bce7e){if(_0x1bce7e){return _0x3617af[_0x04d1('0x1a')](_0x5d4aec)[_0x04d1('0x1b')](_0x1bce7e);}};}function respondWithFilteredResult(_0x344937,_0x16dd22){return function(_0x5939ab){if(_0x5939ab){var _0xfaefe5=_0x5939ab['count'],_0x424b94=_0x16dd22[_0x04d1('0x1c')],_0x4ecb1d=_0x16dd22[_0x04d1('0x1c')]+_0x16dd22['limit'],_0x50da78;if(_0x4ecb1d>=_0xfaefe5){_0x4ecb1d=_0xfaefe5;_0x50da78=0xc8;}else{_0x50da78=0xce;}_0x344937[_0x04d1('0x1a')](_0x50da78);return _0x344937[_0x04d1('0x1d')](_0x04d1('0x1e'),_0x424b94+'-'+_0x4ecb1d+'/'+_0xfaefe5)[_0x04d1('0x1b')](_0x5939ab);}return null;};}function patchUpdates(_0x421c89){return function(_0x1f1f9f){try{jsonpatch[_0x04d1('0x1f')](_0x1f1f9f,_0x421c89,!![]);}catch(_0x4ef4c5){return BPromise[_0x04d1('0x20')](_0x4ef4c5);}return _0x1f1f9f[_0x04d1('0x21')]();};}function saveUpdates(_0xd8a52c,_0xe6c095){return function(_0x191567){if(_0x191567){return _0x191567[_0x04d1('0x22')](_0xd8a52c)[_0x04d1('0x23')](function(_0x1f19b9){return _0x1f19b9;});}return null;};}function removeEntity(_0xfcbc49,_0x3a65d3){return function(_0xab7e1d){if(_0xab7e1d){return _0xab7e1d[_0x04d1('0x24')]()['then'](function(){_0xfcbc49[_0x04d1('0x1a')](0xcc)[_0x04d1('0x25')]();});}};}function handleEntityNotFound(_0x382e23,_0x2b6a1a){return function(_0x2f08f0){if(!_0x2f08f0){_0x382e23[_0x04d1('0x19')](0x194);}return _0x2f08f0;};}function handleError(_0x586e23,_0x5869c6){_0x5869c6=_0x5869c6||0x1f4;return function(_0x34b49d){logger[_0x04d1('0x26')](_0x34b49d[_0x04d1('0x27')]);if(_0x34b49d[_0x04d1('0x28')]){delete _0x34b49d[_0x04d1('0x28')];}_0x586e23['status'](_0x5869c6)[_0x04d1('0x29')](_0x34b49d);};}exports['index']=function(_0x595cf,_0x22a498){var _0xa8d01e={},_0x1b328a={},_0x549de8={'count':0x0,'rows':[]};var _0x1fc956=_[_0x04d1('0x2a')](db[_0x04d1('0x2b')][_0x04d1('0x2c')],function(_0x5aaaeb){return{'name':_0x5aaaeb[_0x04d1('0x2d')],'type':_0x5aaaeb['type'][_0x04d1('0x2e')]};});_0x1b328a[_0x04d1('0x2f')]=_[_0x04d1('0x2a')](_0x1fc956,_0x04d1('0x28'));_0x1b328a[_0x04d1('0x30')]=_[_0x04d1('0x31')](_0x595cf[_0x04d1('0x30')]);_0x1b328a[_0x04d1('0x32')]=_[_0x04d1('0x33')](_0x1b328a[_0x04d1('0x2f')],_0x1b328a['query']);_0xa8d01e[_0x04d1('0x34')]=_[_0x04d1('0x33')](_0x1b328a[_0x04d1('0x2f')],qs[_0x04d1('0x35')](_0x595cf['query'][_0x04d1('0x35')]));_0xa8d01e[_0x04d1('0x34')]=_0xa8d01e[_0x04d1('0x34')][_0x04d1('0x36')]?_0xa8d01e['attributes']:_0x1b328a[_0x04d1('0x2f')];if(!_0x595cf[_0x04d1('0x30')][_0x04d1('0x37')](_0x04d1('0x38'))){_0xa8d01e['limit']=qs[_0x04d1('0x39')](_0x595cf['query']['limit']);_0xa8d01e[_0x04d1('0x1c')]=qs['offset'](_0x595cf[_0x04d1('0x30')][_0x04d1('0x1c')]);}_0xa8d01e[_0x04d1('0x3a')]=qs[_0x04d1('0x3b')](_0x595cf[_0x04d1('0x30')][_0x04d1('0x3b')]);_0xa8d01e[_0x04d1('0x3c')]=qs[_0x04d1('0x32')](_[_0x04d1('0x3d')](_0x595cf[_0x04d1('0x30')],_0x1b328a[_0x04d1('0x32')]));if(_0x595cf['query'][_0x04d1('0x3e')]){_0xa8d01e[_0x04d1('0x3c')]=_[_0x04d1('0x3f')](_0xa8d01e[_0x04d1('0x3c')],{'$or':_[_0x04d1('0x2a')](_0x1fc956,function(_0x52ae3f){if(_0x52ae3f[_0x04d1('0x40')]!==_0x04d1('0x41')){var _0x304ab2={};_0x304ab2[_0x52ae3f[_0x04d1('0x28')]]={'$like':'%'+_0x595cf[_0x04d1('0x30')]['filter']+'%'};return _0x304ab2;}})});}_0xa8d01e=_[_0x04d1('0x3f')]({},_0xa8d01e,_0x595cf['options']);var _0x2d877e={'where':_0xa8d01e[_0x04d1('0x3c')]};return db[_0x04d1('0x2b')][_0x04d1('0x42')](_0x2d877e)[_0x04d1('0x23')](function(_0x10afa6){_0x549de8[_0x04d1('0x42')]=_0x10afa6;if(_0x595cf[_0x04d1('0x30')]['includeAll']){_0xa8d01e['include']=[{'all':!![]}];}return db[_0x04d1('0x2b')][_0x04d1('0x43')](_0xa8d01e);})['then'](function(_0x4c7e9f){_0x549de8[_0x04d1('0x44')]=_0x4c7e9f;return _0x549de8;})[_0x04d1('0x23')](respondWithFilteredResult(_0x22a498,_0xa8d01e))['catch'](handleError(_0x22a498,null));};exports['show']=function(_0x15677a,_0x5b9a5c){var _0x763793={'raw':!![],'where':{'id':_0x15677a[_0x04d1('0x45')]['id']}},_0x5b877e={};_0x5b877e[_0x04d1('0x2f')]=_[_0x04d1('0x31')](db['Cdr'][_0x04d1('0x2c')]);_0x5b877e[_0x04d1('0x30')]=_['keys'](_0x15677a[_0x04d1('0x30')]);_0x5b877e[_0x04d1('0x32')]=_[_0x04d1('0x33')](_0x5b877e[_0x04d1('0x2f')],_0x5b877e['query']);_0x763793['attributes']=_['intersection'](_0x5b877e[_0x04d1('0x2f')],qs['fields'](_0x15677a['query'][_0x04d1('0x35')]));_0x763793[_0x04d1('0x34')]=_0x763793[_0x04d1('0x34')][_0x04d1('0x36')]?_0x763793[_0x04d1('0x34')]:_0x5b877e['model'];if(_0x15677a[_0x04d1('0x30')]['includeAll']){_0x763793['include']=[{'all':!![]}];}_0x763793=_[_0x04d1('0x3f')]({},_0x763793,_0x15677a[_0x04d1('0x46')]);return db['Cdr']['find'](_0x763793)[_0x04d1('0x23')](handleEntityNotFound(_0x5b9a5c,null))[_0x04d1('0x23')](respondWithResult(_0x5b9a5c,null))[_0x04d1('0x47')](handleError(_0x5b9a5c,null));};exports[_0x04d1('0x48')]=function(_0xc52671,_0x39c668){return db[_0x04d1('0x2b')][_0x04d1('0x48')](_0xc52671[_0x04d1('0x49')],{})[_0x04d1('0x23')](respondWithResult(_0x39c668,0xc9))[_0x04d1('0x47')](handleError(_0x39c668,null));};exports[_0x04d1('0x22')]=function(_0x99958f,_0xc9f3ea){if(_0x99958f[_0x04d1('0x49')]['id']){delete _0x99958f[_0x04d1('0x49')]['id'];}return db['Cdr']['find']({'where':{'id':_0x99958f[_0x04d1('0x45')]['id']}})[_0x04d1('0x23')](handleEntityNotFound(_0xc9f3ea,null))[_0x04d1('0x23')](saveUpdates(_0x99958f[_0x04d1('0x49')],null))['then'](respondWithResult(_0xc9f3ea,null))['catch'](handleError(_0xc9f3ea,null));};exports[_0x04d1('0x24')]=function(_0x584553,_0xf519c8){return db[_0x04d1('0x2b')][_0x04d1('0x4a')]({'where':{'id':_0x584553[_0x04d1('0x45')]['id']}})['then'](handleEntityNotFound(_0xf519c8,null))[_0x04d1('0x23')](removeEntity(_0xf519c8,null))[_0x04d1('0x47')](handleError(_0xf519c8,null));};exports[_0x04d1('0x4b')]=function(_0x351291,_0x1eb28){return db[_0x04d1('0x2b')]['describe']()[_0x04d1('0x23')](respondWithResult(_0x1eb28,null))[_0x04d1('0x47')](handleError(_0x1eb28,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index db4e45c..1b97303 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda19=['accountcode','disposition','dst','src','uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0x1425e8,_0x2c195b){var _0x1cd239=function(_0x404246){while(--_0x404246){_0x1425e8['push'](_0x1425e8['shift']());}};_0x1cd239(++_0x2c195b);}(_0xda19,0xd5));var _0x9da1=function(_0x197c4c,_0x36a598){_0x197c4c=_0x197c4c-0x0;var _0x5701ed=_0xda19[_0x197c4c];return _0x5701ed;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['accountcode']},{'name':'calldate','fields':['calldate']},{'name':_0x9da1('0xc'),'fields':['disposition']},{'name':_0x9da1('0xd'),'fields':[_0x9da1('0xd')]},{'name':_0x9da1('0xe'),'fields':[_0x9da1('0xe')]},{'name':_0x9da1('0xf'),'fields':[_0x9da1('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf494=['disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','accountcode','calldate'];(function(_0x3ff405,_0x526b2e){var _0x24c6d6=function(_0x46d88d){while(--_0x46d88d){_0x3ff405['push'](_0x3ff405['shift']());}};_0x24c6d6(++_0x526b2e);}(_0xf494,0x1c6));var _0x4f49=function(_0x407d44,_0x274590){_0x407d44=_0x407d44-0x0;var _0x5567e1=_0xf494[_0x407d44];return _0x5567e1;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]},{'name':_0x4f49('0xf'),'fields':[_0x4f49('0xf')]},{'name':'src','fields':[_0x4f49('0x10')]},{'name':_0x4f49('0x11'),'fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index a657c30..ba390d5 100644 --- a/server/api/cdr/cdr.rpc.js +++ b/server/api/cdr/cdr.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8b6=['jayson/promise','client','http','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/logger'];(function(_0x22cc0e,_0x1fa675){var _0x40b825=function(_0x31d607){while(--_0x31d607){_0x22cc0e['push'](_0x22cc0e['shift']());}};_0x40b825(++_0x1fa675);}(_0xe8b6,0x1e1));var _0x6e8b=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe8b6[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x6e8b('0x0'));var util=require('util');var moment=require(_0x6e8b('0x1'));var BPromise=require(_0x6e8b('0x2'));var rs=require(_0x6e8b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6e8b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6e8b('0x5'));var client=jayson[_0x6e8b('0x6')][_0x6e8b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x60924e,_0x5c989a,_0x3f4503){return new BPromise(function(_0x3531be,_0x3d58e3){return client['request'](_0x60924e,_0x3f4503)['then'](function(_0x1b92e1){logger['info'](_0x6e8b('0x8'),_0x5c989a,_0x6e8b('0x9'));logger['debug'](_0x6e8b('0xa'),_0x5c989a,'request\x20sent',JSON[_0x6e8b('0xb')](_0x1b92e1));if(_0x1b92e1[_0x6e8b('0xc')]){if(_0x1b92e1[_0x6e8b('0xc')][_0x6e8b('0xd')]===0x1f4){logger[_0x6e8b('0xc')](_0x6e8b('0x8'),_0x5c989a,_0x1b92e1['error'][_0x6e8b('0xe')]);return _0x3d58e3(_0x1b92e1[_0x6e8b('0xc')]['message']);}logger[_0x6e8b('0xc')]('Cdr,\x20%s,\x20%s',_0x5c989a,_0x1b92e1[_0x6e8b('0xc')][_0x6e8b('0xe')]);return _0x3531be(_0x1b92e1['error'][_0x6e8b('0xe')]);}else{logger[_0x6e8b('0xf')](_0x6e8b('0x8'),_0x5c989a,_0x6e8b('0x9'));_0x3531be(_0x1b92e1[_0x6e8b('0x10')]['message']);}})[_0x6e8b('0x11')](function(_0x2964f7){logger[_0x6e8b('0xc')]('Cdr,\x20%s,\x20%s',_0x5c989a,_0x2964f7);_0x3d58e3(_0x2964f7);});});} \ No newline at end of file +var _0x3dc4=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2a9fbc,_0x24dcec){var _0x47ab23=function(_0x54296c){while(--_0x54296c){_0x2a9fbc['push'](_0x2a9fbc['shift']());}};_0x47ab23(++_0x24dcec);}(_0x3dc4,0x15b));var _0x43dc=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3dc4[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x43dc('0x0'));var util=require(_0x43dc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43dc('0x2'));var fs=require('fs');var Redis=require(_0x43dc('0x3'));var db=require(_0x43dc('0x4'))['db'];var utils=require(_0x43dc('0x5'));var logger=require(_0x43dc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x43dc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3038,_0x5663cd,_0x1d6f08){return new BPromise(function(_0x4026e8,_0x11e5fa){return client['request'](_0x5f3038,_0x1d6f08)[_0x43dc('0x8')](function(_0x3a64c2){logger[_0x43dc('0x9')](_0x43dc('0xa'),_0x5663cd,_0x43dc('0xb'));logger[_0x43dc('0xc')](_0x43dc('0xd'),_0x5663cd,_0x43dc('0xb'),JSON[_0x43dc('0xe')](_0x3a64c2));if(_0x3a64c2['error']){if(_0x3a64c2[_0x43dc('0xf')][_0x43dc('0x10')]===0x1f4){logger[_0x43dc('0xf')](_0x43dc('0xa'),_0x5663cd,_0x3a64c2[_0x43dc('0xf')]['message']);return _0x11e5fa(_0x3a64c2['error'][_0x43dc('0x11')]);}logger[_0x43dc('0xf')](_0x43dc('0xa'),_0x5663cd,_0x3a64c2['error'][_0x43dc('0x11')]);return _0x4026e8(_0x3a64c2[_0x43dc('0xf')][_0x43dc('0x11')]);}else{logger[_0x43dc('0x9')](_0x43dc('0xa'),_0x5663cd,_0x43dc('0xb'));_0x4026e8(_0x3a64c2[_0x43dc('0x12')][_0x43dc('0x11')]);}})[_0x43dc('0x13')](function(_0xec4f16){logger[_0x43dc('0xf')](_0x43dc('0xa'),_0x5663cd,_0xec4f16);_0x11e5fa(_0xec4f16);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 032858a..e47be32 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36dd=['create','update','delete','destroy','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0xdb663,_0x1cd2f1){var _0x7efd5e=function(_0x292fbe){while(--_0x292fbe){_0xdb663['push'](_0xdb663['shift']());}};_0x7efd5e(++_0x1cd2f1);}(_0x36dd,0x8c));var _0xd36d=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x36dd[_0xf51c06];return _0x1d5420;};'use strict';var multer=require('multer');var util=require(_0xd36d('0x0'));var path=require('path');var timeout=require(_0xd36d('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xd36d('0x2'));var interaction=require(_0xd36d('0x3'));var config=require(_0xd36d('0x4'));var controller=require(_0xd36d('0x5'));router[_0xd36d('0x6')]('/',auth[_0xd36d('0x7')](),controller['index']);router[_0xd36d('0x6')](_0xd36d('0x8'),auth[_0xd36d('0x7')](),controller[_0xd36d('0x9')]);router[_0xd36d('0x6')](_0xd36d('0xa'),auth[_0xd36d('0x7')](),controller[_0xd36d('0xb')]);router[_0xd36d('0xc')]('/',auth[_0xd36d('0x7')](),controller[_0xd36d('0xd')]);router['put']('/:id',auth[_0xd36d('0x7')](),controller[_0xd36d('0xe')]);router[_0xd36d('0xf')](_0xd36d('0xa'),auth[_0xd36d('0x7')](),controller[_0xd36d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0395=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','/:id','isAuthenticated','post','create','update'];(function(_0x107359,_0x4a2a06){var _0x205071=function(_0x4ea133){while(--_0x4ea133){_0x107359['push'](_0x107359['shift']());}};_0x205071(++_0x4a2a06);}(_0x0395,0xde));var _0x5039=function(_0x3b2397,_0x4d52e8){_0x3b2397=_0x3b2397-0x0;var _0x4a81ea=_0x0395[_0x3b2397];return _0x4a81ea;};'use strict';var multer=require(_0x5039('0x0'));var util=require(_0x5039('0x1'));var path=require(_0x5039('0x2'));var timeout=require(_0x5039('0x3'));var express=require(_0x5039('0x4'));var router=express[_0x5039('0x5')]();var auth=require(_0x5039('0x6'));var interaction=require(_0x5039('0x7'));var config=require(_0x5039('0x8'));var controller=require(_0x5039('0x9'));router[_0x5039('0xa')]('/',auth['isAuthenticated'](),controller[_0x5039('0xb')]);router['get'](_0x5039('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x5039('0xa')](_0x5039('0xd'),auth[_0x5039('0xe')](),controller['show']);router[_0x5039('0xf')]('/',auth[_0x5039('0xe')](),controller[_0x5039('0x10')]);router['put'](_0x5039('0xd'),auth['isAuthenticated'](),controller[_0x5039('0x11')]);router['delete'](_0x5039('0xd'),auth[_0x5039('0xe')](),controller[_0x5039('0x12')]);module[_0x5039('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index f1e2e88..0a00502 100644 --- a/server/api/chatApplication/chatApplication.attributes.js +++ b/server/api/chatApplication/chatApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d13=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0x9d13,0x1f1));var _0x39d1=function(_0x23a07a,_0x13edff){_0x23a07a=_0x23a07a-0x0;var _0x1e10d3=_0x9d13[_0x23a07a];return _0x1e10d3;};'use strict';var Sequelize=require(_0x39d1('0x0'));module[_0x39d1('0x1')]={'priority':{'type':Sequelize[_0x39d1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x39d1('0x3')],'allowNull':![],'defaultValue':_0x39d1('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x39d1('0x3')]},'interval':{'type':Sequelize[_0x39d1('0x3')],'defaultValue':_0x39d1('0x5')}}; \ No newline at end of file +var _0x3d70=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x29ec88,_0x3e6651){var _0x4ff5d9=function(_0xc989b){while(--_0xc989b){_0x29ec88['push'](_0x29ec88['shift']());}};_0x4ff5d9(++_0x3e6651);}(_0x3d70,0x112));var _0x03d7=function(_0x38f737,_0x54f685){_0x38f737=_0x38f737-0x0;var _0x7afda3=_0x3d70[_0x38f737];return _0x7afda3;};'use strict';var Sequelize=require(_0x03d7('0x0'));module[_0x03d7('0x1')]={'priority':{'type':Sequelize[_0x03d7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x03d7('0x3')},'appdata':{'type':Sequelize[_0x03d7('0x4')]()},'description':{'type':Sequelize[_0x03d7('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x03d7('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 92f1682..081a2ee 100644 --- a/server/api/chatApplication/chatApplication.controller.js +++ b/server/api/chatApplication/chatApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa053=['intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters'];(function(_0x2a5ac4,_0x106f17){var _0xe2aaed=function(_0x59c3b2){while(--_0x59c3b2){_0x2a5ac4['push'](_0x2a5ac4['shift']());}};_0xe2aaed(++_0x106f17);}(_0xa053,0x7f));var _0x3a05=function(_0x36c743,_0x10e388){_0x36c743=_0x36c743-0x0;var _0x4741af=_0xa053[_0x36c743];return _0x4741af;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3a05('0x0'));var rimraf=require(_0x3a05('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a05('0x2'));var rp=require(_0x3a05('0x3'));var moment=require(_0x3a05('0x4'));var BPromise=require(_0x3a05('0x5'));var Mustache=require(_0x3a05('0x6'));var util=require(_0x3a05('0x7'));var path=require(_0x3a05('0x8'));var sox=require('sox');var csv=require(_0x3a05('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3a05('0xa'));var squel=require(_0x3a05('0xb'));var crypto=require(_0x3a05('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3a05('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3a05('0xe'));var Papa=require(_0x3a05('0xf'));var Redis=require(_0x3a05('0x10'));var authService=require(_0x3a05('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3a05('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a05('0x13'))(_0x3a05('0x14'));var utils=require(_0x3a05('0x15'));var config=require('../../config/environment');var db=require(_0x3a05('0x16'))['db'];function respondWithStatusCode(_0x215371,_0x517d92){_0x517d92=_0x517d92||0xcc;return function(_0x234190){if(_0x234190){return _0x215371[_0x3a05('0x17')](_0x517d92);}return _0x215371[_0x3a05('0x18')](_0x517d92)[_0x3a05('0x19')]();};}function respondWithResult(_0x53f612,_0x5d4359){_0x5d4359=_0x5d4359||0xc8;return function(_0x33d764){if(_0x33d764){return _0x53f612[_0x3a05('0x18')](_0x5d4359)[_0x3a05('0x1a')](_0x33d764);}};}function respondWithFilteredResult(_0x4c7c70,_0x703d5b){return function(_0x10acf4){if(_0x10acf4){var _0x408940=_0x10acf4[_0x3a05('0x1b')],_0x4eb348=_0x703d5b['offset'],_0x1a2119=_0x703d5b[_0x3a05('0x1c')]+_0x703d5b[_0x3a05('0x1d')],_0x19700b;if(_0x1a2119>=_0x408940){_0x1a2119=_0x408940;_0x19700b=0xc8;}else{_0x19700b=0xce;}_0x4c7c70[_0x3a05('0x18')](_0x19700b);return _0x4c7c70[_0x3a05('0x1e')](_0x3a05('0x1f'),_0x4eb348+'-'+_0x1a2119+'/'+_0x408940)[_0x3a05('0x1a')](_0x10acf4);}return null;};}function patchUpdates(_0x4f0a6f){return function(_0x1085be){try{jsonpatch['apply'](_0x1085be,_0x4f0a6f,!![]);}catch(_0x4c6cb5){return BPromise['reject'](_0x4c6cb5);}return _0x1085be[_0x3a05('0x20')]();};}function saveUpdates(_0x2e761f,_0xe81bbb){return function(_0x2fbdd0){if(_0x2fbdd0){return _0x2fbdd0[_0x3a05('0x21')](_0x2e761f)[_0x3a05('0x22')](function(_0x4efd37){return _0x4efd37;});}return null;};}function removeEntity(_0x463a60,_0x783ba){return function(_0x2891c6){if(_0x2891c6){return _0x2891c6['destroy']()['then'](function(){_0x463a60[_0x3a05('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x360844,_0xaeddc1){return function(_0x2ad270){if(!_0x2ad270){_0x360844['sendStatus'](0x194);}return _0x2ad270;};}function handleError(_0x1f9633,_0x157267){_0x157267=_0x157267||0x1f4;return function(_0x21e0df){logger[_0x3a05('0x23')](_0x21e0df[_0x3a05('0x24')]);if(_0x21e0df['name']){delete _0x21e0df[_0x3a05('0x25')];}_0x1f9633[_0x3a05('0x18')](_0x157267)[_0x3a05('0x26')](_0x21e0df);};}exports[_0x3a05('0x27')]=function(_0x1fe1e9,_0x5073d6){var _0x209ca9={'raw':!![],'where':{'id':_0x1fe1e9[_0x3a05('0x28')]['id']}},_0x388499={};_0x388499[_0x3a05('0x29')]=_[_0x3a05('0x2a')](db[_0x3a05('0x2b')][_0x3a05('0x2c')]);_0x388499[_0x3a05('0x2d')]=_[_0x3a05('0x2a')](_0x1fe1e9[_0x3a05('0x2d')]);_0x388499[_0x3a05('0x2e')]=_['intersection'](_0x388499[_0x3a05('0x29')],_0x388499[_0x3a05('0x2d')]);_0x209ca9['attributes']=_[_0x3a05('0x2f')](_0x388499['model'],qs[_0x3a05('0x30')](_0x1fe1e9['query'][_0x3a05('0x30')]));_0x209ca9[_0x3a05('0x31')]=_0x209ca9['attributes'][_0x3a05('0x32')]?_0x209ca9[_0x3a05('0x31')]:_0x388499[_0x3a05('0x29')];if(_0x1fe1e9[_0x3a05('0x2d')][_0x3a05('0x33')]){_0x209ca9[_0x3a05('0x34')]=[{'all':!![]}];}_0x209ca9=_[_0x3a05('0x35')]({},_0x209ca9,_0x1fe1e9[_0x3a05('0x36')]);return db['ChatApplication'][_0x3a05('0x37')](_0x209ca9)[_0x3a05('0x22')](handleEntityNotFound(_0x5073d6,null))[_0x3a05('0x22')](respondWithResult(_0x5073d6,null))[_0x3a05('0x38')](handleError(_0x5073d6,null));};exports[_0x3a05('0x21')]=function(_0x3519af,_0x309b6d){if(_0x3519af[_0x3a05('0x39')]['id']){delete _0x3519af[_0x3a05('0x39')]['id'];}return db[_0x3a05('0x2b')][_0x3a05('0x37')]({'where':{'id':_0x3519af[_0x3a05('0x28')]['id']}})['then'](handleEntityNotFound(_0x309b6d,null))[_0x3a05('0x22')](saveUpdates(_0x3519af['body'],null))[_0x3a05('0x22')](respondWithResult(_0x309b6d,null))['catch'](handleError(_0x309b6d,null));};exports['destroy']=function(_0x2fda09,_0x35041f){return db['ChatApplication'][_0x3a05('0x37')]({'where':{'id':_0x2fda09['params']['id']}})[_0x3a05('0x22')](handleEntityNotFound(_0x35041f,null))[_0x3a05('0x22')](removeEntity(_0x35041f,null))[_0x3a05('0x38')](handleError(_0x35041f,null));}; \ No newline at end of file +var _0xef74=['merge','find','then','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','destroy','end','error','stack','name','show','params','model','ChatApplication','query','keys','filters','intersection','attributes','fields','length','include'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xef74,0x15b));var _0x4ef7=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xef74[_0x3fba9f];return _0x192cf1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4ef7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ef7('0x1'));var jsonpatch=require(_0x4ef7('0x2'));var rp=require(_0x4ef7('0x3'));var moment=require(_0x4ef7('0x4'));var BPromise=require(_0x4ef7('0x5'));var Mustache=require(_0x4ef7('0x6'));var util=require(_0x4ef7('0x7'));var path=require(_0x4ef7('0x8'));var sox=require(_0x4ef7('0x9'));var csv=require(_0x4ef7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4ef7('0xb'));var squel=require(_0x4ef7('0xc'));var crypto=require(_0x4ef7('0xd'));var jsforce=require(_0x4ef7('0xe'));var deskjs=require(_0x4ef7('0xf'));var toCsv=require(_0x4ef7('0xa'));var querystring=require(_0x4ef7('0x10'));var Papa=require(_0x4ef7('0x11'));var Redis=require(_0x4ef7('0x12'));var authService=require(_0x4ef7('0x13'));var qs=require(_0x4ef7('0x14'));var as=require(_0x4ef7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4ef7('0x16'));var utils=require(_0x4ef7('0x17'));var config=require(_0x4ef7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd553e3,_0x4d6f3f){_0x4d6f3f=_0x4d6f3f||0xcc;return function(_0x333799){if(_0x333799){return _0xd553e3[_0x4ef7('0x19')](_0x4d6f3f);}return _0xd553e3[_0x4ef7('0x1a')](_0x4d6f3f)['end']();};}function respondWithResult(_0x113e40,_0x2afef4){_0x2afef4=_0x2afef4||0xc8;return function(_0x25b015){if(_0x25b015){return _0x113e40[_0x4ef7('0x1a')](_0x2afef4)[_0x4ef7('0x1b')](_0x25b015);}};}function respondWithFilteredResult(_0x176e9d,_0x86fdd1){return function(_0x4ec892){if(_0x4ec892){var _0x752aa1=_0x4ec892[_0x4ef7('0x1c')],_0x51177e=_0x86fdd1[_0x4ef7('0x1d')],_0x212ddb=_0x86fdd1['offset']+_0x86fdd1['limit'],_0x970ebd;if(_0x212ddb>=_0x752aa1){_0x212ddb=_0x752aa1;_0x970ebd=0xc8;}else{_0x970ebd=0xce;}_0x176e9d[_0x4ef7('0x1a')](_0x970ebd);return _0x176e9d[_0x4ef7('0x1e')](_0x4ef7('0x1f'),_0x51177e+'-'+_0x212ddb+'/'+_0x752aa1)['json'](_0x4ec892);}return null;};}function patchUpdates(_0x11fb13){return function(_0xb4d617){try{jsonpatch[_0x4ef7('0x20')](_0xb4d617,_0x11fb13,!![]);}catch(_0x434fdf){return BPromise['reject'](_0x434fdf);}return _0xb4d617[_0x4ef7('0x21')]();};}function saveUpdates(_0x16e7eb,_0x249adf){return function(_0x2783de){if(_0x2783de){return _0x2783de[_0x4ef7('0x22')](_0x16e7eb)['then'](function(_0x5534de){return _0x5534de;});}return null;};}function removeEntity(_0x390ad7,_0x5a2558){return function(_0x2b8246){if(_0x2b8246){return _0x2b8246[_0x4ef7('0x23')]()['then'](function(){_0x390ad7[_0x4ef7('0x1a')](0xcc)[_0x4ef7('0x24')]();});}};}function handleEntityNotFound(_0x415d45,_0x1be633){return function(_0x2fbbe6){if(!_0x2fbbe6){_0x415d45[_0x4ef7('0x19')](0x194);}return _0x2fbbe6;};}function handleError(_0x24fcd,_0x45909b){_0x45909b=_0x45909b||0x1f4;return function(_0x4fe76c){logger[_0x4ef7('0x25')](_0x4fe76c[_0x4ef7('0x26')]);if(_0x4fe76c['name']){delete _0x4fe76c[_0x4ef7('0x27')];}_0x24fcd['status'](_0x45909b)['send'](_0x4fe76c);};}exports[_0x4ef7('0x28')]=function(_0x2918db,_0x5cbccc){var _0x27ca59={'raw':!![],'where':{'id':_0x2918db[_0x4ef7('0x29')]['id']}},_0x5092a4={};_0x5092a4[_0x4ef7('0x2a')]=_['keys'](db[_0x4ef7('0x2b')]['rawAttributes']);_0x5092a4[_0x4ef7('0x2c')]=_[_0x4ef7('0x2d')](_0x2918db[_0x4ef7('0x2c')]);_0x5092a4[_0x4ef7('0x2e')]=_[_0x4ef7('0x2f')](_0x5092a4['model'],_0x5092a4[_0x4ef7('0x2c')]);_0x27ca59[_0x4ef7('0x30')]=_[_0x4ef7('0x2f')](_0x5092a4['model'],qs['fields'](_0x2918db[_0x4ef7('0x2c')][_0x4ef7('0x31')]));_0x27ca59[_0x4ef7('0x30')]=_0x27ca59[_0x4ef7('0x30')][_0x4ef7('0x32')]?_0x27ca59[_0x4ef7('0x30')]:_0x5092a4[_0x4ef7('0x2a')];if(_0x2918db[_0x4ef7('0x2c')]['includeAll']){_0x27ca59[_0x4ef7('0x33')]=[{'all':!![]}];}_0x27ca59=_[_0x4ef7('0x34')]({},_0x27ca59,_0x2918db['options']);return db[_0x4ef7('0x2b')][_0x4ef7('0x35')](_0x27ca59)[_0x4ef7('0x36')](handleEntityNotFound(_0x5cbccc,null))['then'](respondWithResult(_0x5cbccc,null))[_0x4ef7('0x37')](handleError(_0x5cbccc,null));};exports[_0x4ef7('0x22')]=function(_0x7678d9,_0x1ebb39){if(_0x7678d9[_0x4ef7('0x38')]['id']){delete _0x7678d9['body']['id'];}return db['ChatApplication'][_0x4ef7('0x35')]({'where':{'id':_0x7678d9['params']['id']}})[_0x4ef7('0x36')](handleEntityNotFound(_0x1ebb39,null))[_0x4ef7('0x36')](saveUpdates(_0x7678d9[_0x4ef7('0x38')],null))[_0x4ef7('0x36')](respondWithResult(_0x1ebb39,null))[_0x4ef7('0x37')](handleError(_0x1ebb39,null));};exports['destroy']=function(_0x4badcd,_0x28fb33){return db[_0x4ef7('0x2b')][_0x4ef7('0x35')]({'where':{'id':_0x4badcd[_0x4ef7('0x29')]['id']}})['then'](handleEntityNotFound(_0x28fb33,null))[_0x4ef7('0x36')](removeEntity(_0x28fb33,null))[_0x4ef7('0x37')](handleError(_0x28fb33,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 97c15f2..75c6685 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b769af4..cfbb20d 100644 --- a/server/api/chatApplication/chatApplication.rpc.js +++ b/server/api/chatApplication/chatApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb574=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4ff113,_0x51713b){var _0x1d449c=function(_0xf3a6a6){while(--_0xf3a6a6){_0x4ff113['push'](_0x4ff113['shift']());}};_0x1d449c(++_0x51713b);}(_0xb574,0x17b));var _0x4b57=function(_0xcba0de,_0x246374){_0xcba0de=_0xcba0de-0x0;var _0x8be4a8=_0xb574[_0xcba0de];return _0x8be4a8;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require(_0x4b57('0x2'));var BPromise=require(_0x4b57('0x3'));var rs=require(_0x4b57('0x4'));var fs=require('fs');var Redis=require(_0x4b57('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4b57('0x6'))('rpc');var config=require(_0x4b57('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4b57('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc0d21b,_0x4bfead,_0x5a6020){return new BPromise(function(_0x3ba540,_0x4ad45b){return client['request'](_0xc0d21b,_0x5a6020)[_0x4b57('0x9')](function(_0x25fb49){logger['info'](_0x4b57('0xa'),_0x4bfead,_0x4b57('0xb'));logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x4bfead,_0x4b57('0xb'),JSON[_0x4b57('0xe')](_0x25fb49));if(_0x25fb49[_0x4b57('0xf')]){if(_0x25fb49['error'][_0x4b57('0x10')]===0x1f4){logger[_0x4b57('0xf')]('ChatApplication,\x20%s,\x20%s',_0x4bfead,_0x25fb49[_0x4b57('0xf')][_0x4b57('0x11')]);return _0x4ad45b(_0x25fb49[_0x4b57('0xf')]['message']);}logger[_0x4b57('0xf')](_0x4b57('0xa'),_0x4bfead,_0x25fb49['error'][_0x4b57('0x11')]);return _0x3ba540(_0x25fb49[_0x4b57('0xf')][_0x4b57('0x11')]);}else{logger[_0x4b57('0x12')](_0x4b57('0xa'),_0x4bfead,_0x4b57('0xb'));_0x3ba540(_0x25fb49[_0x4b57('0x13')]['message']);}})[_0x4b57('0x14')](function(_0x53e7ea){logger[_0x4b57('0xf')](_0x4b57('0xa'),_0x4bfead,_0x53e7ea);_0x4ad45b(_0x53e7ea);});});} \ No newline at end of file +var _0x2905=['moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','lodash','util'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x2905,0xcf));var _0x5290=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2905[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5290('0x0'));var util=require(_0x5290('0x1'));var moment=require(_0x5290('0x2'));var BPromise=require(_0x5290('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5290('0x4'));var db=require(_0x5290('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5290('0x6'));var config=require(_0x5290('0x7'));var jayson=require(_0x5290('0x8'));var client=jayson[_0x5290('0x9')][_0x5290('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e2490,_0x1b76df,_0x40a9b5){return new BPromise(function(_0x21e427,_0x4181da){return client[_0x5290('0xb')](_0x2e2490,_0x40a9b5)['then'](function(_0x551200){logger[_0x5290('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1b76df,_0x5290('0xd'));logger['debug'](_0x5290('0xe'),_0x1b76df,_0x5290('0xd'),JSON['stringify'](_0x551200));if(_0x551200[_0x5290('0xf')]){if(_0x551200['error'][_0x5290('0x10')]===0x1f4){logger[_0x5290('0xf')](_0x5290('0x11'),_0x1b76df,_0x551200[_0x5290('0xf')][_0x5290('0x12')]);return _0x4181da(_0x551200[_0x5290('0xf')][_0x5290('0x12')]);}logger['error'](_0x5290('0x11'),_0x1b76df,_0x551200[_0x5290('0xf')][_0x5290('0x12')]);return _0x21e427(_0x551200[_0x5290('0xf')][_0x5290('0x12')]);}else{logger[_0x5290('0xc')](_0x5290('0x11'),_0x1b76df,_0x5290('0xd'));_0x21e427(_0x551200['result']['message']);}})['catch'](function(_0x13bcd0){logger[_0x5290('0xf')](_0x5290('0x11'),_0x1b76df,_0x13bcd0);_0x4181da(_0x13bcd0);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index b4618be..44b7e35 100644 --- a/server/api/chatApplication/index.js +++ b/server/api/chatApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7394=['/:id','isAuthenticated','show','update','delete','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x3dc2bb,_0x196792){var _0x28c1b3=function(_0x4a3c21){while(--_0x4a3c21){_0x3dc2bb['push'](_0x3dc2bb['shift']());}};_0x28c1b3(++_0x196792);}(_0x7394,0xe2));var _0x4739=function(_0x50ec5c,_0x5b0e6b){_0x50ec5c=_0x50ec5c-0x0;var _0x558d9e=_0x7394[_0x50ec5c];return _0x558d9e;};'use strict';var multer=require(_0x4739('0x0'));var util=require(_0x4739('0x1'));var path=require('path');var timeout=require(_0x4739('0x2'));var express=require(_0x4739('0x3'));var router=express[_0x4739('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4739('0x5'));var config=require(_0x4739('0x6'));var controller=require(_0x4739('0x7'));router['get'](_0x4739('0x8'),auth[_0x4739('0x9')](),controller[_0x4739('0xa')]);router['put'](_0x4739('0x8'),auth['isAuthenticated'](),controller[_0x4739('0xb')]);router[_0x4739('0xc')](_0x4739('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5a0e=['../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','multer','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a0e,0x1ea));var _0xe5a0=function(_0x3799b2,_0x3728da){_0x3799b2=_0x3799b2-0x0;var _0x1d7571=_0x5a0e[_0x3799b2];return _0x1d7571;};'use strict';var multer=require(_0xe5a0('0x0'));var util=require(_0xe5a0('0x1'));var path=require(_0xe5a0('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5a0('0x3'));var router=express[_0xe5a0('0x4')]();var auth=require(_0xe5a0('0x5'));var interaction=require(_0xe5a0('0x6'));var config=require('../../config/environment');var controller=require(_0xe5a0('0x7'));router[_0xe5a0('0x8')](_0xe5a0('0x9'),auth[_0xe5a0('0xa')](),controller[_0xe5a0('0xb')]);router[_0xe5a0('0xc')](_0xe5a0('0x9'),auth['isAuthenticated'](),controller[_0xe5a0('0xd')]);router['delete']('/:id',auth[_0xe5a0('0xa')](),controller[_0xe5a0('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 0888a6b..16ec59d 100644 --- a/server/api/chatGroup/chatGroup.attributes.js +++ b/server/api/chatGroup/chatGroup.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a6e=['STRING'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x1a6e,0x149));var _0xe1a6=function(_0x5169ca,_0x2356e5){_0x5169ca=_0x5169ca-0x0;var _0x13f00d=_0x1a6e[_0x5169ca];return _0x13f00d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe1a6('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe1a6('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x3320=['STRING','BOOLEAN','sequelize','exports'];(function(_0x103f26,_0x1ffa5f){var _0x389006=function(_0x3b078b){while(--_0x3b078b){_0x103f26['push'](_0x103f26['shift']());}};_0x389006(++_0x1ffa5f);}(_0x3320,0x19a));var _0x0332=function(_0x537bcd,_0x13bae1){_0x537bcd=_0x537bcd-0x0;var _0x6cc881=_0x3320[_0x537bcd];return _0x6cc881;};'use strict';var Sequelize=require(_0x0332('0x0'));module[_0x0332('0x1')]={'name':{'type':Sequelize[_0x0332('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0332('0x2')]},'write':{'type':Sequelize[_0x0332('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3cabcc5..90b9b5a 100644 --- a/server/api/chatGroup/chatGroup.controller.js +++ b/server/api/chatGroup/chatGroup.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9c4=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','apply','save','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','type','options','includeAll','findAll','rows','show','params','length','include','merge','find','create','body','destroy','describe','getUnread','user','toInteger','addMembers','omit','ids','User','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3a28e2,_0x58325a){var _0xfd325a=function(_0xf77ee7){while(--_0xf77ee7){_0x3a28e2['push'](_0x3a28e2['shift']());}};_0xfd325a(++_0x58325a);}(_0xa9c4,0x141));var _0x4a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x4a9c('0x0'));var emlformat=require(_0x4a9c('0x1'));var rimraf=require(_0x4a9c('0x2'));var zipdir=require(_0x4a9c('0x3'));var jsonpatch=require(_0x4a9c('0x4'));var rp=require(_0x4a9c('0x5'));var moment=require(_0x4a9c('0x6'));var BPromise=require(_0x4a9c('0x7'));var Mustache=require(_0x4a9c('0x8'));var util=require('util');var path=require(_0x4a9c('0x9'));var sox=require(_0x4a9c('0xa'));var csv=require(_0x4a9c('0xb'));var ejs=require(_0x4a9c('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4a9c('0xd'));var crypto=require(_0x4a9c('0xe'));var jsforce=require(_0x4a9c('0xf'));var deskjs=require(_0x4a9c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4a9c('0x11'));var Papa=require(_0x4a9c('0x12'));var Redis=require('ioredis');var authService=require(_0x4a9c('0x13'));var qs=require(_0x4a9c('0x14'));var as=require(_0x4a9c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a9c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4a9c('0x17'));var db=require(_0x4a9c('0x18'))['db'];config[_0x4a9c('0x19')]=_[_0x4a9c('0x1a')](config['redis'],{'host':_0x4a9c('0x1b'),'port':0x18eb});var socket=require(_0x4a9c('0x1c'))(new Redis(config[_0x4a9c('0x19')]));require('./chatGroup.socket')[_0x4a9c('0x1d')](socket);var jayson=require(_0x4a9c('0x1e'));var client=jayson[_0x4a9c('0x1f')][_0x4a9c('0x20')]({'port':0x232a});function checkPasswordPattern(_0x5792d1,_0x15323a,_0x744eb2){if(_0x744eb2){var _0x338e04=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x338e04[_0x4a9c('0x21')](_0x15323a)){return _0x5792d1;}else{throw new db[(_0x4a9c('0x22'))][(_0x4a9c('0x23'))](_0x4a9c('0x24'));}}else{return _0x5792d1;}}function respondWithRpcPromise(_0x43ecba,_0x5e54dc,_0x414076,_0xd02a68){return new BPromise(function(_0x2ff45b,_0x10f75f){var _0x24e943=_0xd02a68||client;return _0x24e943[_0x4a9c('0x25')](_0x43ecba,_0x414076)[_0x4a9c('0x26')](function(_0x53cdd4){logger[_0x4a9c('0x27')](_0x4a9c('0x28'),_0x5e54dc,_0x4a9c('0x29'));logger[_0x4a9c('0x2a')](_0x4a9c('0x2b'),_0x5e54dc,_0x4a9c('0x29'),JSON[_0x4a9c('0x2c')](_0x53cdd4));if(_0x53cdd4[_0x4a9c('0x2d')]){if(_0x53cdd4[_0x4a9c('0x2d')][_0x4a9c('0x2e')]===0x1f4){logger[_0x4a9c('0x2d')](_0x4a9c('0x28'),_0x5e54dc,_0x53cdd4[_0x4a9c('0x2d')][_0x4a9c('0x2f')]);return _0x10f75f(_0x53cdd4[_0x4a9c('0x2d')][_0x4a9c('0x2f')]);}logger[_0x4a9c('0x2d')](_0x4a9c('0x28'),_0x5e54dc,_0x53cdd4['error'][_0x4a9c('0x2f')]);return _0x2ff45b(_0x53cdd4[_0x4a9c('0x2d')][_0x4a9c('0x2f')]);}else{logger[_0x4a9c('0x27')](_0x4a9c('0x28'),_0x5e54dc,_0x4a9c('0x29'));_0x2ff45b(_0x53cdd4[_0x4a9c('0x30')]['message']);}})[_0x4a9c('0x31')](function(_0x1f3af1){logger[_0x4a9c('0x2d')]('ChatGroup,\x20%s,\x20%s',_0x5e54dc,_0x1f3af1);_0x10f75f(_0x1f3af1);});});}function respondWithStatusCode(_0x52a30a,_0x580ae9){_0x580ae9=_0x580ae9||0xcc;return function(_0x4511b0){if(_0x4511b0){return _0x52a30a[_0x4a9c('0x32')](_0x580ae9);}return _0x52a30a[_0x4a9c('0x33')](_0x580ae9)[_0x4a9c('0x34')]();};}function respondWithResult(_0x42e88b,_0x19e9b5){_0x19e9b5=_0x19e9b5||0xc8;return function(_0x3469f3){if(_0x3469f3){return _0x42e88b[_0x4a9c('0x33')](_0x19e9b5)[_0x4a9c('0x35')](_0x3469f3);}};}function respondWithFilteredResult(_0xe8765,_0x269663){return function(_0x46c278){if(_0x46c278){var _0x5960cb=_0x46c278[_0x4a9c('0x36')],_0x7067bb=_0x269663[_0x4a9c('0x37')],_0x1595bb=_0x269663[_0x4a9c('0x37')]+_0x269663['limit'],_0x3dbb00;if(_0x1595bb>=_0x5960cb){_0x1595bb=_0x5960cb;_0x3dbb00=0xc8;}else{_0x3dbb00=0xce;}_0xe8765[_0x4a9c('0x33')](_0x3dbb00);return _0xe8765['set']('Content-Range',_0x7067bb+'-'+_0x1595bb+'/'+_0x5960cb)[_0x4a9c('0x35')](_0x46c278);}return null;};}function patchUpdates(_0x139bda){return function(_0x482e8e){try{jsonpatch[_0x4a9c('0x38')](_0x482e8e,_0x139bda,!![]);}catch(_0x5a6242){return BPromise['reject'](_0x5a6242);}return _0x482e8e[_0x4a9c('0x39')]();};}function saveUpdates(_0x3d9080,_0x593526){return function(_0x38d440){if(_0x38d440){return _0x38d440['update'](_0x3d9080)[_0x4a9c('0x26')](function(_0x4354ad){return _0x4354ad;});}return null;};}function removeEntity(_0xb17f32,_0x2fd8cb){return function(_0x414e3c){if(_0x414e3c){return _0x414e3c['destroy']()[_0x4a9c('0x26')](function(){_0xb17f32[_0x4a9c('0x33')](0xcc)[_0x4a9c('0x34')]();});}};}function handleEntityNotFound(_0x3e3245,_0x4a7cf5){return function(_0x12176f){if(!_0x12176f){_0x3e3245[_0x4a9c('0x32')](0x194);}return _0x12176f;};}function handleError(_0x54493e,_0x2b3506){_0x2b3506=_0x2b3506||0x1f4;return function(_0x480bce){logger[_0x4a9c('0x2d')](_0x480bce[_0x4a9c('0x3a')]);if(_0x480bce[_0x4a9c('0x3b')]){delete _0x480bce['name'];}_0x54493e['status'](_0x2b3506)[_0x4a9c('0x3c')](_0x480bce);};}exports[_0x4a9c('0x3d')]=function(_0x318e44,_0x4a31a8){var _0x1321d9={},_0x2e6148={},_0xf167d={'count':0x0,'rows':[]};var _0x50124e=_[_0x4a9c('0x3e')](db[_0x4a9c('0x3f')][_0x4a9c('0x40')],function(_0x5ba23b){return{'name':_0x5ba23b[_0x4a9c('0x41')],'type':_0x5ba23b['type'][_0x4a9c('0x42')]};});_0x2e6148[_0x4a9c('0x43')]=_[_0x4a9c('0x3e')](_0x50124e,_0x4a9c('0x3b'));_0x2e6148[_0x4a9c('0x44')]=_[_0x4a9c('0x45')](_0x318e44[_0x4a9c('0x44')]);_0x2e6148[_0x4a9c('0x46')]=_[_0x4a9c('0x47')](_0x2e6148[_0x4a9c('0x43')],_0x2e6148[_0x4a9c('0x44')]);_0x1321d9['attributes']=_[_0x4a9c('0x47')](_0x2e6148[_0x4a9c('0x43')],qs[_0x4a9c('0x48')](_0x318e44[_0x4a9c('0x44')][_0x4a9c('0x48')]));_0x1321d9[_0x4a9c('0x49')]=_0x1321d9[_0x4a9c('0x49')]['length']?_0x1321d9['attributes']:_0x2e6148[_0x4a9c('0x43')];if(!_0x318e44[_0x4a9c('0x44')][_0x4a9c('0x4a')](_0x4a9c('0x4b'))){_0x1321d9[_0x4a9c('0x4c')]=qs['limit'](_0x318e44['query'][_0x4a9c('0x4c')]);_0x1321d9[_0x4a9c('0x37')]=qs[_0x4a9c('0x37')](_0x318e44[_0x4a9c('0x44')][_0x4a9c('0x37')]);}_0x1321d9[_0x4a9c('0x4d')]=qs['sort'](_0x318e44[_0x4a9c('0x44')][_0x4a9c('0x4e')]);_0x1321d9['where']=qs[_0x4a9c('0x46')](_[_0x4a9c('0x4f')](_0x318e44[_0x4a9c('0x44')],_0x2e6148[_0x4a9c('0x46')]));if(_0x318e44[_0x4a9c('0x44')][_0x4a9c('0x50')]){_0x1321d9[_0x4a9c('0x51')]=_['merge'](_0x1321d9['where'],{'$or':_['map'](_0x50124e,function(_0x5c5b9f){if(_0x5c5b9f[_0x4a9c('0x52')]!=='VIRTUAL'){var _0x5c46a7={};_0x5c46a7[_0x5c5b9f['name']]={'$like':'%'+_0x318e44['query'][_0x4a9c('0x50')]+'%'};return _0x5c46a7;}})});}_0x1321d9=_['merge']({},_0x1321d9,_0x318e44[_0x4a9c('0x53')]);var _0x5370ac={'where':_0x1321d9[_0x4a9c('0x51')]};return db['ChatGroup'][_0x4a9c('0x36')](_0x5370ac)['then'](function(_0x13f84d){_0xf167d['count']=_0x13f84d;if(_0x318e44['query'][_0x4a9c('0x54')]){_0x1321d9['include']=[{'all':!![]}];}return db[_0x4a9c('0x3f')][_0x4a9c('0x55')](_0x1321d9);})['then'](function(_0x34764f){_0xf167d[_0x4a9c('0x56')]=_0x34764f;return _0xf167d;})['then'](respondWithFilteredResult(_0x4a31a8,_0x1321d9))['catch'](handleError(_0x4a31a8,null));};exports[_0x4a9c('0x57')]=function(_0x39067e,_0x917169){var _0x4df3ce={'raw':!![],'where':{'id':_0x39067e[_0x4a9c('0x58')]['id']}},_0x34253f={};_0x34253f[_0x4a9c('0x43')]=_[_0x4a9c('0x45')](db[_0x4a9c('0x3f')][_0x4a9c('0x40')]);_0x34253f['query']=_[_0x4a9c('0x45')](_0x39067e[_0x4a9c('0x44')]);_0x34253f[_0x4a9c('0x46')]=_['intersection'](_0x34253f[_0x4a9c('0x43')],_0x34253f[_0x4a9c('0x44')]);_0x4df3ce[_0x4a9c('0x49')]=_[_0x4a9c('0x47')](_0x34253f[_0x4a9c('0x43')],qs['fields'](_0x39067e[_0x4a9c('0x44')][_0x4a9c('0x48')]));_0x4df3ce[_0x4a9c('0x49')]=_0x4df3ce[_0x4a9c('0x49')][_0x4a9c('0x59')]?_0x4df3ce[_0x4a9c('0x49')]:_0x34253f[_0x4a9c('0x43')];if(_0x39067e[_0x4a9c('0x44')][_0x4a9c('0x54')]){_0x4df3ce[_0x4a9c('0x5a')]=[{'all':!![]}];}_0x4df3ce=_[_0x4a9c('0x5b')]({},_0x4df3ce,_0x39067e[_0x4a9c('0x53')]);return db[_0x4a9c('0x3f')][_0x4a9c('0x5c')](_0x4df3ce)[_0x4a9c('0x26')](handleEntityNotFound(_0x917169,null))['then'](respondWithResult(_0x917169,null))[_0x4a9c('0x31')](handleError(_0x917169,null));};exports[_0x4a9c('0x5d')]=function(_0x1dc796,_0x47e95a){return db['ChatGroup'][_0x4a9c('0x5d')](_0x1dc796[_0x4a9c('0x5e')],{})['then'](respondWithResult(_0x47e95a,0xc9))[_0x4a9c('0x31')](handleError(_0x47e95a,null));};exports['update']=function(_0x3cb72a,_0x18e774){if(_0x3cb72a[_0x4a9c('0x5e')]['id']){delete _0x3cb72a['body']['id'];}return db[_0x4a9c('0x3f')][_0x4a9c('0x5c')]({'where':{'id':_0x3cb72a[_0x4a9c('0x58')]['id']}})[_0x4a9c('0x26')](handleEntityNotFound(_0x18e774,null))[_0x4a9c('0x26')](saveUpdates(_0x3cb72a[_0x4a9c('0x5e')],null))[_0x4a9c('0x26')](respondWithResult(_0x18e774,null))[_0x4a9c('0x31')](handleError(_0x18e774,null));};exports[_0x4a9c('0x5f')]=function(_0x23bbd8,_0x3d0356){return db['ChatGroup'][_0x4a9c('0x5c')]({'where':{'id':_0x23bbd8[_0x4a9c('0x58')]['id']}})['then'](handleEntityNotFound(_0x3d0356,null))['then'](removeEntity(_0x3d0356,null))[_0x4a9c('0x31')](handleError(_0x3d0356,null));};exports[_0x4a9c('0x60')]=function(_0x5d6c58,_0x553811){return db[_0x4a9c('0x3f')][_0x4a9c('0x60')]()['then'](respondWithResult(_0x553811,null))[_0x4a9c('0x31')](handleError(_0x553811,null));};exports[_0x4a9c('0x61')]=function(_0x19dbae,_0x54a656,_0x194261){return db['ChatInternalMessage'][_0x4a9c('0x36')]({'where':{'ChatGroupId':_0x19dbae[_0x4a9c('0x58')]['id'],'ToId':_0x19dbae[_0x4a9c('0x62')]['id'],'read':![]}})[_0x4a9c('0x26')](function(_0x19137a){return{'id':_[_0x4a9c('0x63')](_0x19dbae['params']['id']),'count':_0x19137a};})['then'](respondWithResult(_0x54a656,null))[_0x4a9c('0x31')](handleError(_0x54a656,null));};exports[_0x4a9c('0x64')]=function(_0x582938,_0x1d4377,_0x37147a){return db[_0x4a9c('0x3f')][_0x4a9c('0x5c')]({'where':{'id':_0x582938[_0x4a9c('0x58')]['id']}})[_0x4a9c('0x26')](handleEntityNotFound(_0x1d4377,null))[_0x4a9c('0x26')](function(_0x470504){if(_0x470504){return _0x470504[_0x4a9c('0x64')](_0x582938['body']['ids'],_[_0x4a9c('0x65')](_0x582938[_0x4a9c('0x5e')],[_0x4a9c('0x66'),'id'])||{});}})[_0x4a9c('0x26')](respondWithResult(_0x1d4377,null))[_0x4a9c('0x31')](handleError(_0x1d4377,null));};exports['getMembers']=function(_0x287807,_0x12a422,_0xadd1fd){var _0xf7d9e9={};var _0x3bd56e={};var _0xf58b63;var _0x31f3a9;return db['ChatGroup']['findOne']({'where':{'id':_0x287807[_0x4a9c('0x58')]['id']}})[_0x4a9c('0x26')](handleEntityNotFound(_0x12a422,null))[_0x4a9c('0x26')](function(_0x1b65e3){if(_0x1b65e3){_0xf58b63=_0x1b65e3;_0x3bd56e['model']=_[_0x4a9c('0x45')](db[_0x4a9c('0x67')][_0x4a9c('0x40')]);_0x3bd56e[_0x4a9c('0x44')]=_[_0x4a9c('0x45')](_0x287807['query']);_0x3bd56e[_0x4a9c('0x46')]=_['intersection'](_0x3bd56e[_0x4a9c('0x43')],_0x3bd56e['query']);_0xf7d9e9[_0x4a9c('0x49')]=_[_0x4a9c('0x47')](_0x3bd56e[_0x4a9c('0x43')],qs['fields'](_0x287807[_0x4a9c('0x44')][_0x4a9c('0x48')]));_0xf7d9e9[_0x4a9c('0x49')]=_0xf7d9e9[_0x4a9c('0x49')][_0x4a9c('0x59')]?_0xf7d9e9['attributes']:_0x3bd56e[_0x4a9c('0x43')];_0xf7d9e9[_0x4a9c('0x4d')]=qs[_0x4a9c('0x4e')](_0x287807['query'][_0x4a9c('0x4e')]);_0xf7d9e9[_0x4a9c('0x51')]=qs[_0x4a9c('0x46')](_[_0x4a9c('0x4f')](_0x287807[_0x4a9c('0x44')],_0x3bd56e[_0x4a9c('0x46')]));if(_0x287807[_0x4a9c('0x44')][_0x4a9c('0x50')]){_0xf7d9e9[_0x4a9c('0x51')]=_[_0x4a9c('0x5b')](_0xf7d9e9['where'],{'$or':_['map'](_0xf7d9e9['attributes'],function(_0x8e091e){var _0x4af75b={};_0x4af75b[_0x8e091e]={'$like':'%'+_0x287807[_0x4a9c('0x44')][_0x4a9c('0x50')]+'%'};return _0x4af75b;})});}_0xf7d9e9=_[_0x4a9c('0x5b')]({},_0xf7d9e9,_0x287807['options']);return _0xf58b63[_0x4a9c('0x68')](_0xf7d9e9);}})[_0x4a9c('0x26')](function(_0x20f0ca){if(_0x20f0ca){_0x31f3a9=_0x20f0ca['length'];if(!_0x287807[_0x4a9c('0x44')]['hasOwnProperty'](_0x4a9c('0x4b'))){_0xf7d9e9[_0x4a9c('0x4c')]=qs[_0x4a9c('0x4c')](_0x287807[_0x4a9c('0x44')][_0x4a9c('0x4c')]);_0xf7d9e9['offset']=qs['offset'](_0x287807[_0x4a9c('0x44')][_0x4a9c('0x37')]);}return _0xf58b63['getMembers'](_0xf7d9e9);}})[_0x4a9c('0x26')](function(_0x478085){if(_0x478085){return _0x478085?{'count':_0x31f3a9,'rows':_0x478085}:null;}})[_0x4a9c('0x26')](respondWithResult(_0x12a422,null))[_0x4a9c('0x31')](handleError(_0x12a422,null));};exports[_0x4a9c('0x69')]=function(_0x43add2,_0xd26b2c,_0x2347d0){return db['ChatGroup']['find']({'where':{'id':_0x43add2[_0x4a9c('0x58')]['id']}})[_0x4a9c('0x26')](handleEntityNotFound(_0xd26b2c,null))[_0x4a9c('0x26')](function(_0x16d048){if(_0x16d048){return _0x16d048[_0x4a9c('0x69')](_0x43add2['query'][_0x4a9c('0x66')]);}})['then'](respondWithStatusCode(_0xd26b2c,null))[_0x4a9c('0x31')](handleError(_0xd26b2c,null));};exports[_0x4a9c('0x6a')]=function(_0x5e1801,_0x30e948,_0x2ef0a2){if(_0x5e1801[_0x4a9c('0x5e')]['id']){delete _0x5e1801[_0x4a9c('0x5e')]['id'];}return db[_0x4a9c('0x3f')][_0x4a9c('0x5c')]({'where':{'id':_0x5e1801[_0x4a9c('0x58')]['id']}})['then'](handleEntityNotFound(_0x30e948,null))[_0x4a9c('0x26')](function(_0x3b5f64){if(_0x3b5f64){_0x5e1801[_0x4a9c('0x5e')][_0x4a9c('0x6b')]=_0x3b5f64['id'];return db[_0x4a9c('0x6c')][_0x4a9c('0x5d')](_0x5e1801[_0x4a9c('0x5e')]);}})[_0x4a9c('0x26')](respondWithResult(_0x30e948,null))[_0x4a9c('0x31')](handleError(_0x30e948,null));};exports[_0x4a9c('0x6d')]=function(_0x4e0e81,_0x30575d,_0x2879c9){var _0x3b2573={};var _0x149e18={};var _0x3aded0;var _0x7b3280;return db[_0x4a9c('0x3f')]['findOne']({'where':{'id':_0x4e0e81['params']['id']}})[_0x4a9c('0x26')](handleEntityNotFound(_0x30575d,null))[_0x4a9c('0x26')](function(_0x58de06){if(_0x58de06){_0x3aded0=_0x58de06;_0x149e18[_0x4a9c('0x43')]=_['keys'](db[_0x4a9c('0x6c')]['rawAttributes']);_0x149e18['query']=_['keys'](_0x4e0e81['query']);_0x149e18[_0x4a9c('0x46')]=_['intersection'](_0x149e18[_0x4a9c('0x43')],_0x149e18[_0x4a9c('0x44')]);_0x3b2573['attributes']=_[_0x4a9c('0x47')](_0x149e18['model'],qs['fields'](_0x4e0e81[_0x4a9c('0x44')][_0x4a9c('0x48')]));_0x3b2573[_0x4a9c('0x49')]=_0x3b2573['attributes']['length']?_0x3b2573[_0x4a9c('0x49')]:_0x149e18[_0x4a9c('0x43')];_0x3b2573['order']=qs[_0x4a9c('0x4e')](_0x4e0e81[_0x4a9c('0x44')]['sort']);_0x3b2573[_0x4a9c('0x51')]=qs['filters'](_[_0x4a9c('0x4f')](_0x4e0e81[_0x4a9c('0x44')],_0x149e18[_0x4a9c('0x46')]));if(_0x4e0e81[_0x4a9c('0x44')]['filter']){_0x3b2573[_0x4a9c('0x51')]=_[_0x4a9c('0x5b')](_0x3b2573['where'],{'$or':_[_0x4a9c('0x3e')](_0x3b2573[_0x4a9c('0x49')],function(_0x2e3691){var _0x2b89ba={};_0x2b89ba[_0x2e3691]={'$like':'%'+_0x4e0e81[_0x4a9c('0x44')][_0x4a9c('0x50')]+'%'};return _0x2b89ba;})});}if(_0x4e0e81[_0x4a9c('0x44')]['$gte']){var _0x10a37e=_0x4e0e81[_0x4a9c('0x44')][_0x4a9c('0x6e')][_0x4a9c('0x6f')](',');var _0x1c39c0={};_0x1c39c0[_0x10a37e[0x0]]={'$gte':moment(_0x10a37e[0x1])['format'](_0x4a9c('0x70'))};_0x3b2573[_0x4a9c('0x51')]=_[_0x4a9c('0x5b')](_0x3b2573[_0x4a9c('0x51')],_0x1c39c0);}_0x3b2573=_[_0x4a9c('0x5b')]({},_0x3b2573,_0x4e0e81[_0x4a9c('0x53')]);return _0x3aded0['getMessages'](_0x3b2573);}})[_0x4a9c('0x26')](function(_0x589a9e){if(_0x589a9e){_0x7b3280=_0x589a9e[_0x4a9c('0x59')];if(!_0x4e0e81[_0x4a9c('0x44')][_0x4a9c('0x4a')](_0x4a9c('0x4b'))){_0x3b2573['limit']=qs[_0x4a9c('0x4c')](_0x4e0e81[_0x4a9c('0x44')][_0x4a9c('0x4c')]);_0x3b2573[_0x4a9c('0x37')]=qs[_0x4a9c('0x37')](_0x4e0e81['query']['offset']);}return _0x3aded0['getMessages'](_0x3b2573);}})[_0x4a9c('0x26')](function(_0x445b83){if(_0x445b83){return _0x445b83?{'count':_0x7b3280,'rows':_0x445b83}:null;}})[_0x4a9c('0x26')](respondWithResult(_0x30575d,null))[_0x4a9c('0x31')](handleError(_0x30575d,null));}; \ No newline at end of file +var _0xb662=['result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','findOne','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./chatGroup.socket','register','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message'];(function(_0xa46b86,_0x5c1465){var _0x417360=function(_0x4800d1){while(--_0x4800d1){_0xa46b86['push'](_0xa46b86['shift']());}};_0x417360(++_0x5c1465);}(_0xb662,0x173));var _0x2b66=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0xb662[_0x4d21ff];return _0x22b554;};'use strict';var pdf=require(_0x2b66('0x0'));var emlformat=require(_0x2b66('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b66('0x2'));var rp=require(_0x2b66('0x3'));var moment=require('moment');var BPromise=require(_0x2b66('0x4'));var Mustache=require(_0x2b66('0x5'));var util=require('util');var path=require(_0x2b66('0x6'));var sox=require(_0x2b66('0x7'));var csv=require('to-csv');var ejs=require(_0x2b66('0x8'));var fs=require('fs');var _=require(_0x2b66('0x9'));var squel=require(_0x2b66('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2b66('0xb'));var toCsv=require(_0x2b66('0xc'));var querystring=require(_0x2b66('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2b66('0xe'));var qs=require(_0x2b66('0xf'));var as=require(_0x2b66('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b66('0x11'))(_0x2b66('0x12'));var utils=require('../../config/utils');var config=require(_0x2b66('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x2b66('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x2b66('0x15'))(new Redis(config[_0x2b66('0x14')]));require(_0x2b66('0x16'))[_0x2b66('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2b66('0x18')][_0x2b66('0x19')]({'port':0x232a});function checkPasswordPattern(_0x376f03,_0x188121,_0x40db77){if(_0x40db77){var _0x1d4846=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d4846[_0x2b66('0x1a')](_0x188121)){return _0x376f03;}else{throw new db[(_0x2b66('0x1b'))]['ValidationError'](_0x2b66('0x1c'));}}else{return _0x376f03;}}function respondWithRpcPromise(_0x55a015,_0x50bb3f,_0x2ff1b7,_0x367124){return new BPromise(function(_0xe7b612,_0x42b1db){var _0x45917d=_0x367124||client;return _0x45917d['request'](_0x55a015,_0x2ff1b7)[_0x2b66('0x1d')](function(_0x38cbe7){logger[_0x2b66('0x1e')]('ChatGroup,\x20%s,\x20%s',_0x50bb3f,_0x2b66('0x1f'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x50bb3f,'request\x20sent',JSON[_0x2b66('0x20')](_0x38cbe7));if(_0x38cbe7[_0x2b66('0x21')]){if(_0x38cbe7[_0x2b66('0x21')][_0x2b66('0x22')]===0x1f4){logger[_0x2b66('0x21')](_0x2b66('0x23'),_0x50bb3f,_0x38cbe7[_0x2b66('0x21')]['message']);return _0x42b1db(_0x38cbe7['error'][_0x2b66('0x24')]);}logger[_0x2b66('0x21')](_0x2b66('0x23'),_0x50bb3f,_0x38cbe7[_0x2b66('0x21')]['message']);return _0xe7b612(_0x38cbe7[_0x2b66('0x21')][_0x2b66('0x24')]);}else{logger[_0x2b66('0x1e')](_0x2b66('0x23'),_0x50bb3f,'request\x20sent');_0xe7b612(_0x38cbe7[_0x2b66('0x25')][_0x2b66('0x24')]);}})[_0x2b66('0x26')](function(_0x50a11f){logger[_0x2b66('0x21')](_0x2b66('0x23'),_0x50bb3f,_0x50a11f);_0x42b1db(_0x50a11f);});});}function respondWithStatusCode(_0x145b8a,_0x2cecee){_0x2cecee=_0x2cecee||0xcc;return function(_0x1a7305){if(_0x1a7305){return _0x145b8a[_0x2b66('0x27')](_0x2cecee);}return _0x145b8a[_0x2b66('0x28')](_0x2cecee)[_0x2b66('0x29')]();};}function respondWithResult(_0x2be704,_0xfc8b59){_0xfc8b59=_0xfc8b59||0xc8;return function(_0x54520e){if(_0x54520e){return _0x2be704[_0x2b66('0x28')](_0xfc8b59)['json'](_0x54520e);}};}function respondWithFilteredResult(_0x48223b,_0x4db96c){return function(_0x41ae56){if(_0x41ae56){var _0x1f1f63=_0x41ae56[_0x2b66('0x2a')],_0x25ee4a=_0x4db96c[_0x2b66('0x2b')],_0x5e3513=_0x4db96c[_0x2b66('0x2b')]+_0x4db96c[_0x2b66('0x2c')],_0x41bab2;if(_0x5e3513>=_0x1f1f63){_0x5e3513=_0x1f1f63;_0x41bab2=0xc8;}else{_0x41bab2=0xce;}_0x48223b[_0x2b66('0x28')](_0x41bab2);return _0x48223b[_0x2b66('0x2d')](_0x2b66('0x2e'),_0x25ee4a+'-'+_0x5e3513+'/'+_0x1f1f63)[_0x2b66('0x2f')](_0x41ae56);}return null;};}function patchUpdates(_0x5229d8){return function(_0x552e46){try{jsonpatch[_0x2b66('0x30')](_0x552e46,_0x5229d8,!![]);}catch(_0x3b47c7){return BPromise[_0x2b66('0x31')](_0x3b47c7);}return _0x552e46[_0x2b66('0x32')]();};}function saveUpdates(_0x35732d,_0x36864d){return function(_0x59d9df){if(_0x59d9df){return _0x59d9df[_0x2b66('0x33')](_0x35732d)[_0x2b66('0x1d')](function(_0x3e9bdd){return _0x3e9bdd;});}return null;};}function removeEntity(_0x4396db,_0x7d6640){return function(_0x5a06bf){if(_0x5a06bf){return _0x5a06bf[_0x2b66('0x34')]()[_0x2b66('0x1d')](function(){_0x4396db[_0x2b66('0x28')](0xcc)[_0x2b66('0x29')]();});}};}function handleEntityNotFound(_0x5da5f7,_0x5a4a80){return function(_0x2b2b02){if(!_0x2b2b02){_0x5da5f7[_0x2b66('0x27')](0x194);}return _0x2b2b02;};}function handleError(_0x36a1b0,_0x4eae86){_0x4eae86=_0x4eae86||0x1f4;return function(_0x1b2435){logger[_0x2b66('0x21')](_0x1b2435['stack']);if(_0x1b2435[_0x2b66('0x35')]){delete _0x1b2435[_0x2b66('0x35')];}_0x36a1b0['status'](_0x4eae86)['send'](_0x1b2435);};}exports[_0x2b66('0x36')]=function(_0x3b7b80,_0x5a6ec3){var _0x19e6f3={},_0x5e9e28={},_0x1cb630={'count':0x0,'rows':[]};var _0x43c4b8=_[_0x2b66('0x37')](db[_0x2b66('0x38')][_0x2b66('0x39')],function(_0x30f0c4){return{'name':_0x30f0c4[_0x2b66('0x3a')],'type':_0x30f0c4[_0x2b66('0x3b')]['key']};});_0x5e9e28[_0x2b66('0x3c')]=_['map'](_0x43c4b8,_0x2b66('0x35'));_0x5e9e28[_0x2b66('0x3d')]=_[_0x2b66('0x3e')](_0x3b7b80[_0x2b66('0x3d')]);_0x5e9e28[_0x2b66('0x3f')]=_[_0x2b66('0x40')](_0x5e9e28['model'],_0x5e9e28[_0x2b66('0x3d')]);_0x19e6f3[_0x2b66('0x41')]=_['intersection'](_0x5e9e28['model'],qs[_0x2b66('0x42')](_0x3b7b80[_0x2b66('0x3d')]['fields']));_0x19e6f3[_0x2b66('0x41')]=_0x19e6f3[_0x2b66('0x41')][_0x2b66('0x43')]?_0x19e6f3[_0x2b66('0x41')]:_0x5e9e28[_0x2b66('0x3c')];if(!_0x3b7b80[_0x2b66('0x3d')][_0x2b66('0x44')](_0x2b66('0x45'))){_0x19e6f3['limit']=qs[_0x2b66('0x2c')](_0x3b7b80[_0x2b66('0x3d')][_0x2b66('0x2c')]);_0x19e6f3[_0x2b66('0x2b')]=qs[_0x2b66('0x2b')](_0x3b7b80[_0x2b66('0x3d')][_0x2b66('0x2b')]);}_0x19e6f3['order']=qs[_0x2b66('0x46')](_0x3b7b80[_0x2b66('0x3d')][_0x2b66('0x46')]);_0x19e6f3[_0x2b66('0x47')]=qs['filters'](_['pick'](_0x3b7b80[_0x2b66('0x3d')],_0x5e9e28['filters']));if(_0x3b7b80[_0x2b66('0x3d')][_0x2b66('0x48')]){_0x19e6f3[_0x2b66('0x47')]=_[_0x2b66('0x49')](_0x19e6f3[_0x2b66('0x47')],{'$or':_['map'](_0x43c4b8,function(_0x5375e7){if(_0x5375e7[_0x2b66('0x3b')]!==_0x2b66('0x4a')){var _0x1d07ea={};_0x1d07ea[_0x5375e7[_0x2b66('0x35')]]={'$like':'%'+_0x3b7b80[_0x2b66('0x3d')][_0x2b66('0x48')]+'%'};return _0x1d07ea;}})});}_0x19e6f3=_['merge']({},_0x19e6f3,_0x3b7b80[_0x2b66('0x4b')]);var _0x5ce5d3={'where':_0x19e6f3[_0x2b66('0x47')]};return db[_0x2b66('0x38')][_0x2b66('0x2a')](_0x5ce5d3)[_0x2b66('0x1d')](function(_0x38c59e){_0x1cb630[_0x2b66('0x2a')]=_0x38c59e;if(_0x3b7b80[_0x2b66('0x3d')][_0x2b66('0x4c')]){_0x19e6f3[_0x2b66('0x4d')]=[{'all':!![]}];}return db[_0x2b66('0x38')][_0x2b66('0x4e')](_0x19e6f3);})[_0x2b66('0x1d')](function(_0x1dcd28){_0x1cb630[_0x2b66('0x4f')]=_0x1dcd28;return _0x1cb630;})['then'](respondWithFilteredResult(_0x5a6ec3,_0x19e6f3))[_0x2b66('0x26')](handleError(_0x5a6ec3,null));};exports[_0x2b66('0x50')]=function(_0x59afda,_0x3c43f9){var _0x52f220={'raw':!![],'where':{'id':_0x59afda[_0x2b66('0x51')]['id']}},_0x18dcab={};_0x18dcab[_0x2b66('0x3c')]=_['keys'](db[_0x2b66('0x38')][_0x2b66('0x39')]);_0x18dcab['query']=_[_0x2b66('0x3e')](_0x59afda[_0x2b66('0x3d')]);_0x18dcab[_0x2b66('0x3f')]=_[_0x2b66('0x40')](_0x18dcab[_0x2b66('0x3c')],_0x18dcab['query']);_0x52f220[_0x2b66('0x41')]=_[_0x2b66('0x40')](_0x18dcab[_0x2b66('0x3c')],qs[_0x2b66('0x42')](_0x59afda[_0x2b66('0x3d')]['fields']));_0x52f220['attributes']=_0x52f220['attributes'][_0x2b66('0x43')]?_0x52f220['attributes']:_0x18dcab[_0x2b66('0x3c')];if(_0x59afda[_0x2b66('0x3d')][_0x2b66('0x4c')]){_0x52f220[_0x2b66('0x4d')]=[{'all':!![]}];}_0x52f220=_['merge']({},_0x52f220,_0x59afda[_0x2b66('0x4b')]);return db['ChatGroup']['find'](_0x52f220)[_0x2b66('0x1d')](handleEntityNotFound(_0x3c43f9,null))['then'](respondWithResult(_0x3c43f9,null))[_0x2b66('0x26')](handleError(_0x3c43f9,null));};exports[_0x2b66('0x52')]=function(_0x58cfcc,_0x139d13){return db[_0x2b66('0x38')][_0x2b66('0x52')](_0x58cfcc['body'],{})[_0x2b66('0x1d')](respondWithResult(_0x139d13,0xc9))[_0x2b66('0x26')](handleError(_0x139d13,null));};exports['update']=function(_0x311fa1,_0x582812){if(_0x311fa1['body']['id']){delete _0x311fa1['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x311fa1[_0x2b66('0x51')]['id']}})[_0x2b66('0x1d')](handleEntityNotFound(_0x582812,null))[_0x2b66('0x1d')](saveUpdates(_0x311fa1[_0x2b66('0x53')],null))[_0x2b66('0x1d')](respondWithResult(_0x582812,null))['catch'](handleError(_0x582812,null));};exports[_0x2b66('0x34')]=function(_0x4c30e2,_0x32d9){return db['ChatGroup'][_0x2b66('0x54')]({'where':{'id':_0x4c30e2[_0x2b66('0x51')]['id']}})['then'](handleEntityNotFound(_0x32d9,null))[_0x2b66('0x1d')](removeEntity(_0x32d9,null))[_0x2b66('0x26')](handleError(_0x32d9,null));};exports[_0x2b66('0x55')]=function(_0x234b41,_0x1bee7b){return db[_0x2b66('0x38')][_0x2b66('0x55')]()[_0x2b66('0x1d')](respondWithResult(_0x1bee7b,null))[_0x2b66('0x26')](handleError(_0x1bee7b,null));};exports[_0x2b66('0x56')]=function(_0x3b0bc2,_0xa021d6,_0x237004){return db[_0x2b66('0x57')][_0x2b66('0x2a')]({'where':{'ChatGroupId':_0x3b0bc2[_0x2b66('0x51')]['id'],'ToId':_0x3b0bc2['user']['id'],'read':![]}})[_0x2b66('0x1d')](function(_0x4df8db){return{'id':_['toInteger'](_0x3b0bc2['params']['id']),'count':_0x4df8db};})[_0x2b66('0x1d')](respondWithResult(_0xa021d6,null))[_0x2b66('0x26')](handleError(_0xa021d6,null));};exports[_0x2b66('0x58')]=function(_0x49cf2c,_0x2dabb9,_0x258e7c){return db[_0x2b66('0x38')][_0x2b66('0x54')]({'where':{'id':_0x49cf2c['params']['id']}})[_0x2b66('0x1d')](handleEntityNotFound(_0x2dabb9,null))[_0x2b66('0x1d')](function(_0x5013d3){if(_0x5013d3){return _0x5013d3[_0x2b66('0x58')](_0x49cf2c['body'][_0x2b66('0x59')],_[_0x2b66('0x5a')](_0x49cf2c[_0x2b66('0x53')],[_0x2b66('0x59'),'id'])||{});}})[_0x2b66('0x1d')](respondWithResult(_0x2dabb9,null))[_0x2b66('0x26')](handleError(_0x2dabb9,null));};exports['getMembers']=function(_0x1137f2,_0x275574,_0x57f9c7){var _0x1ef7cc={};var _0x5eec60={};var _0x25bb9b;var _0x4d366e;return db[_0x2b66('0x38')][_0x2b66('0x5b')]({'where':{'id':_0x1137f2[_0x2b66('0x51')]['id']}})[_0x2b66('0x1d')](handleEntityNotFound(_0x275574,null))[_0x2b66('0x1d')](function(_0x15e562){if(_0x15e562){_0x25bb9b=_0x15e562;_0x5eec60[_0x2b66('0x3c')]=_[_0x2b66('0x3e')](db['User'][_0x2b66('0x39')]);_0x5eec60[_0x2b66('0x3d')]=_[_0x2b66('0x3e')](_0x1137f2[_0x2b66('0x3d')]);_0x5eec60[_0x2b66('0x3f')]=_['intersection'](_0x5eec60[_0x2b66('0x3c')],_0x5eec60[_0x2b66('0x3d')]);_0x1ef7cc[_0x2b66('0x41')]=_[_0x2b66('0x40')](_0x5eec60[_0x2b66('0x3c')],qs[_0x2b66('0x42')](_0x1137f2['query'][_0x2b66('0x42')]));_0x1ef7cc[_0x2b66('0x41')]=_0x1ef7cc[_0x2b66('0x41')][_0x2b66('0x43')]?_0x1ef7cc['attributes']:_0x5eec60[_0x2b66('0x3c')];_0x1ef7cc[_0x2b66('0x5c')]=qs['sort'](_0x1137f2[_0x2b66('0x3d')][_0x2b66('0x46')]);_0x1ef7cc[_0x2b66('0x47')]=qs['filters'](_['pick'](_0x1137f2[_0x2b66('0x3d')],_0x5eec60['filters']));if(_0x1137f2['query'][_0x2b66('0x48')]){_0x1ef7cc[_0x2b66('0x47')]=_[_0x2b66('0x49')](_0x1ef7cc['where'],{'$or':_[_0x2b66('0x37')](_0x1ef7cc[_0x2b66('0x41')],function(_0x42b14b){var _0x3dbc06={};_0x3dbc06[_0x42b14b]={'$like':'%'+_0x1137f2['query']['filter']+'%'};return _0x3dbc06;})});}_0x1ef7cc=_['merge']({},_0x1ef7cc,_0x1137f2[_0x2b66('0x4b')]);return _0x25bb9b[_0x2b66('0x5d')](_0x1ef7cc);}})[_0x2b66('0x1d')](function(_0x10f01a){if(_0x10f01a){_0x4d366e=_0x10f01a['length'];if(!_0x1137f2[_0x2b66('0x3d')][_0x2b66('0x44')](_0x2b66('0x45'))){_0x1ef7cc[_0x2b66('0x2c')]=qs['limit'](_0x1137f2[_0x2b66('0x3d')][_0x2b66('0x2c')]);_0x1ef7cc[_0x2b66('0x2b')]=qs[_0x2b66('0x2b')](_0x1137f2['query'][_0x2b66('0x2b')]);}return _0x25bb9b[_0x2b66('0x5d')](_0x1ef7cc);}})[_0x2b66('0x1d')](function(_0x50b76c){if(_0x50b76c){return _0x50b76c?{'count':_0x4d366e,'rows':_0x50b76c}:null;}})['then'](respondWithResult(_0x275574,null))[_0x2b66('0x26')](handleError(_0x275574,null));};exports[_0x2b66('0x5e')]=function(_0x409106,_0x2baa05,_0x3061ff){return db['ChatGroup'][_0x2b66('0x54')]({'where':{'id':_0x409106['params']['id']}})[_0x2b66('0x1d')](handleEntityNotFound(_0x2baa05,null))[_0x2b66('0x1d')](function(_0x3435b0){if(_0x3435b0){return _0x3435b0[_0x2b66('0x5e')](_0x409106[_0x2b66('0x3d')][_0x2b66('0x59')]);}})[_0x2b66('0x1d')](respondWithStatusCode(_0x2baa05,null))[_0x2b66('0x26')](handleError(_0x2baa05,null));};exports[_0x2b66('0x5f')]=function(_0xc0b1f8,_0x4a9ce8,_0x540912){if(_0xc0b1f8[_0x2b66('0x53')]['id']){delete _0xc0b1f8[_0x2b66('0x53')]['id'];}return db[_0x2b66('0x38')][_0x2b66('0x54')]({'where':{'id':_0xc0b1f8[_0x2b66('0x51')]['id']}})[_0x2b66('0x1d')](handleEntityNotFound(_0x4a9ce8,null))[_0x2b66('0x1d')](function(_0x1e0466){if(_0x1e0466){_0xc0b1f8[_0x2b66('0x53')][_0x2b66('0x60')]=_0x1e0466['id'];return db[_0x2b66('0x57')][_0x2b66('0x52')](_0xc0b1f8[_0x2b66('0x53')]);}})[_0x2b66('0x1d')](respondWithResult(_0x4a9ce8,null))[_0x2b66('0x26')](handleError(_0x4a9ce8,null));};exports[_0x2b66('0x61')]=function(_0x118cc2,_0x3cf815,_0x59438e){var _0x4c5b7a={};var _0xc95d3={};var _0x1bc59c;var _0x199aec;return db['ChatGroup'][_0x2b66('0x5b')]({'where':{'id':_0x118cc2[_0x2b66('0x51')]['id']}})['then'](handleEntityNotFound(_0x3cf815,null))['then'](function(_0x142aeb){if(_0x142aeb){_0x1bc59c=_0x142aeb;_0xc95d3[_0x2b66('0x3c')]=_[_0x2b66('0x3e')](db['ChatInternalMessage']['rawAttributes']);_0xc95d3[_0x2b66('0x3d')]=_['keys'](_0x118cc2[_0x2b66('0x3d')]);_0xc95d3[_0x2b66('0x3f')]=_[_0x2b66('0x40')](_0xc95d3[_0x2b66('0x3c')],_0xc95d3[_0x2b66('0x3d')]);_0x4c5b7a[_0x2b66('0x41')]=_[_0x2b66('0x40')](_0xc95d3[_0x2b66('0x3c')],qs[_0x2b66('0x42')](_0x118cc2[_0x2b66('0x3d')]['fields']));_0x4c5b7a[_0x2b66('0x41')]=_0x4c5b7a['attributes'][_0x2b66('0x43')]?_0x4c5b7a[_0x2b66('0x41')]:_0xc95d3[_0x2b66('0x3c')];_0x4c5b7a[_0x2b66('0x5c')]=qs[_0x2b66('0x46')](_0x118cc2['query']['sort']);_0x4c5b7a[_0x2b66('0x47')]=qs[_0x2b66('0x3f')](_[_0x2b66('0x62')](_0x118cc2[_0x2b66('0x3d')],_0xc95d3['filters']));if(_0x118cc2[_0x2b66('0x3d')][_0x2b66('0x48')]){_0x4c5b7a['where']=_['merge'](_0x4c5b7a[_0x2b66('0x47')],{'$or':_[_0x2b66('0x37')](_0x4c5b7a['attributes'],function(_0x22f240){var _0x5adf04={};_0x5adf04[_0x22f240]={'$like':'%'+_0x118cc2[_0x2b66('0x3d')]['filter']+'%'};return _0x5adf04;})});}if(_0x118cc2[_0x2b66('0x3d')][_0x2b66('0x63')]){var _0x23bd63=_0x118cc2[_0x2b66('0x3d')]['$gte']['split'](',');var _0xeba400={};_0xeba400[_0x23bd63[0x0]]={'$gte':moment(_0x23bd63[0x1])[_0x2b66('0x64')](_0x2b66('0x65'))};_0x4c5b7a[_0x2b66('0x47')]=_[_0x2b66('0x49')](_0x4c5b7a[_0x2b66('0x47')],_0xeba400);}_0x4c5b7a=_[_0x2b66('0x49')]({},_0x4c5b7a,_0x118cc2[_0x2b66('0x4b')]);return _0x1bc59c['getMessages'](_0x4c5b7a);}})[_0x2b66('0x1d')](function(_0x1c446e){if(_0x1c446e){_0x199aec=_0x1c446e[_0x2b66('0x43')];if(!_0x118cc2['query'][_0x2b66('0x44')]('nolimit')){_0x4c5b7a[_0x2b66('0x2c')]=qs[_0x2b66('0x2c')](_0x118cc2['query']['limit']);_0x4c5b7a[_0x2b66('0x2b')]=qs[_0x2b66('0x2b')](_0x118cc2['query'][_0x2b66('0x2b')]);}return _0x1bc59c['getMessages'](_0x4c5b7a);}})[_0x2b66('0x1d')](function(_0x221468){if(_0x221468){return _0x221468?{'count':_0x199aec,'rows':_0x221468}:null;}})['then'](respondWithResult(_0x3cf815,null))[_0x2b66('0x26')](handleError(_0x3cf815,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 5e42d33..e3d355c 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['ChatGroup','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1524fe,_0x1eb46d){var _0x277f5a=function(_0x1be649){while(--_0x1be649){_0x1524fe['push'](_0x1524fe['shift']());}};_0x277f5a(++_0x1eb46d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x0b0e[_0x11ce46];return _0x368a1e;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatGroupEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatGroupEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatGroup[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0xadb5,0xad));var _0x5adb=function(_0x2c034a,_0x267b00){_0x2c034a=_0x2c034a-0x0;var _0x4e1466=_0xadb5[_0x2c034a];return _0x4e1466;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index deefc7d..9af2704 100644 --- a/server/api/chatGroup/chatGroup.model.js +++ b/server/api/chatGroup/chatGroup.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28aa=['chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x4e3d3a,_0x534610){var _0x1f95a7=function(_0x4d8e02){while(--_0x4d8e02){_0x4e3d3a['push'](_0x4e3d3a['shift']());}};_0x1f95a7(++_0x534610);}(_0x28aa,0xf8));var _0xa28a=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x28aa[_0x521929];return _0x632436;};'use strict';var _=require('lodash');var util=require(_0xa28a('0x0'));var logger=require(_0xa28a('0x1'))(_0xa28a('0x2'));var moment=require(_0xa28a('0x3'));var BPromise=require(_0xa28a('0x4'));var rp=require(_0xa28a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa28a('0x6'));var config=require(_0xa28a('0x7'));var attributes=require(_0xa28a('0x8'));module[_0xa28a('0x9')]=function(_0x526dec,_0x1fbde2){return _0x526dec[_0xa28a('0xa')](_0xa28a('0xb'),attributes,{'tableName':_0xa28a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb8=['ChatGroup','chat_groups','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define'];(function(_0x2118ea,_0x4b527c){var _0x21f157=function(_0x158c76){while(--_0x158c76){_0x2118ea['push'](_0x2118ea['shift']());}};_0x21f157(++_0x4b527c);}(_0xadb8,0x1d0));var _0x8adb=function(_0x328ac9,_0x2f7225){_0x328ac9=_0x328ac9-0x0;var _0x2b3a0a=_0xadb8[_0x328ac9];return _0x2b3a0a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8adb('0x0'))('api');var moment=require(_0x8adb('0x1'));var BPromise=require(_0x8adb('0x2'));var rp=require(_0x8adb('0x3'));var fs=require('fs');var path=require(_0x8adb('0x4'));var rimraf=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var attributes=require(_0x8adb('0x7'));module['exports']=function(_0x15bc63,_0x1a5f36){return _0x15bc63[_0x8adb('0x8')](_0x8adb('0x9'),attributes,{'tableName':_0x8adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index a291271..94788ef 100644 --- a/server/api/chatGroup/chatGroup.rpc.js +++ b/server/api/chatGroup/chatGroup.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bab=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bab,0x10f));var _0xb1ba=function(_0x4712a7,_0x413c0c){_0x4712a7=_0x4712a7-0x0;var _0x7e6860=_0x1bab[_0x4712a7];return _0x7e6860;};'use strict';var _=require(_0xb1ba('0x0'));var util=require(_0xb1ba('0x1'));var moment=require(_0xb1ba('0x2'));var BPromise=require(_0xb1ba('0x3'));var rs=require(_0xb1ba('0x4'));var fs=require('fs');var Redis=require(_0xb1ba('0x5'));var db=require(_0xb1ba('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1ba('0x7'))(_0xb1ba('0x8'));var config=require(_0xb1ba('0x9'));var jayson=require(_0xb1ba('0xa'));var client=jayson[_0xb1ba('0xb')][_0xb1ba('0xc')]({'port':0x232a});config[_0xb1ba('0xd')]=_[_0xb1ba('0xe')](config[_0xb1ba('0xd')],{'host':_0xb1ba('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1ba('0xd')]));require(_0xb1ba('0x10'))[_0xb1ba('0x11')](socket);function respondWithRpcPromise(_0x586697,_0x5751ed,_0xfba80e){return new BPromise(function(_0x277172,_0x283245){return client[_0xb1ba('0x12')](_0x586697,_0xfba80e)[_0xb1ba('0x13')](function(_0x1c6bc4){logger[_0xb1ba('0x14')](_0xb1ba('0x15'),_0x5751ed,_0xb1ba('0x16'));logger[_0xb1ba('0x17')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5751ed,_0xb1ba('0x16'),JSON[_0xb1ba('0x18')](_0x1c6bc4));if(_0x1c6bc4[_0xb1ba('0x19')]){if(_0x1c6bc4[_0xb1ba('0x19')][_0xb1ba('0x1a')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5751ed,_0x1c6bc4[_0xb1ba('0x19')]['message']);return _0x283245(_0x1c6bc4[_0xb1ba('0x19')][_0xb1ba('0x1b')]);}logger['error'](_0xb1ba('0x15'),_0x5751ed,_0x1c6bc4[_0xb1ba('0x19')]['message']);return _0x277172(_0x1c6bc4[_0xb1ba('0x19')][_0xb1ba('0x1b')]);}else{logger[_0xb1ba('0x14')]('ChatGroup,\x20%s,\x20%s',_0x5751ed,_0xb1ba('0x16'));_0x277172(_0x1c6bc4['result'][_0xb1ba('0x1b')]);}})[_0xb1ba('0x1c')](function(_0x36c726){logger['error'](_0xb1ba('0x15'),_0x5751ed,_0x36c726);_0x283245(_0x36c726);});});} \ No newline at end of file +var _0x623a=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x8a0448,_0x154bde){var _0x1b9c6a=function(_0x5454aa){while(--_0x5454aa){_0x8a0448['push'](_0x8a0448['shift']());}};_0x1b9c6a(++_0x154bde);}(_0x623a,0x18e));var _0xa623=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x623a[_0x543084];return _0x306a57;};'use strict';var _=require(_0xa623('0x0'));var util=require(_0xa623('0x1'));var moment=require(_0xa623('0x2'));var BPromise=require(_0xa623('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa623('0x4'))['db'];var utils=require(_0xa623('0x5'));var logger=require(_0xa623('0x6'))(_0xa623('0x7'));var config=require(_0xa623('0x8'));var jayson=require(_0xa623('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xa623('0xa')]=_[_0xa623('0xb')](config[_0xa623('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa623('0xc'))(new Redis(config[_0xa623('0xa')]));require(_0xa623('0xd'))[_0xa623('0xe')](socket);function respondWithRpcPromise(_0xe5c37e,_0x886d2e,_0x19c653){return new BPromise(function(_0x3f9f0f,_0x33d53e){return client[_0xa623('0xf')](_0xe5c37e,_0x19c653)[_0xa623('0x10')](function(_0x562d86){logger[_0xa623('0x11')]('ChatGroup,\x20%s,\x20%s',_0x886d2e,'request\x20sent');logger[_0xa623('0x12')](_0xa623('0x13'),_0x886d2e,_0xa623('0x14'),JSON['stringify'](_0x562d86));if(_0x562d86[_0xa623('0x15')]){if(_0x562d86['error']['code']===0x1f4){logger['error'](_0xa623('0x16'),_0x886d2e,_0x562d86[_0xa623('0x15')][_0xa623('0x17')]);return _0x33d53e(_0x562d86[_0xa623('0x15')]['message']);}logger[_0xa623('0x15')]('ChatGroup,\x20%s,\x20%s',_0x886d2e,_0x562d86[_0xa623('0x15')][_0xa623('0x17')]);return _0x3f9f0f(_0x562d86[_0xa623('0x15')][_0xa623('0x17')]);}else{logger[_0xa623('0x11')](_0xa623('0x16'),_0x886d2e,_0xa623('0x14'));_0x3f9f0f(_0x562d86['result'][_0xa623('0x17')]);}})[_0xa623('0x18')](function(_0x3dc774){logger[_0xa623('0x15')]('ChatGroup,\x20%s,\x20%s',_0x886d2e,_0x3dc774);_0x33d53e(_0x3dc774);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index adaaab7..e68dd0c 100644 --- a/server/api/chatGroup/chatGroup.socket.js +++ b/server/api/chatGroup/chatGroup.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b15=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x340f93,_0x91d091){var _0xec0617=function(_0x27a83c){while(--_0x27a83c){_0x340f93['push'](_0x340f93['shift']());}};_0xec0617(++_0x91d091);}(_0x6b15,0x1af));var _0x56b1=function(_0x4b4387,_0x22523b){_0x4b4387=_0x4b4387-0x0;var _0x313bee=_0x6b15[_0x4b4387];return _0x313bee;};'use strict';var ChatGroupEvents=require(_0x56b1('0x0'));var events=[_0x56b1('0x1'),_0x56b1('0x2'),'update'];function createListener(_0x112e82,_0x8c27f1){return function(_0x138c7a){_0x8c27f1['emit'](_0x112e82,_0x138c7a);};}function removeListener(_0x484b4a,_0x165ab3){return function(){ChatGroupEvents[_0x56b1('0x3')](_0x484b4a,_0x165ab3);};}exports[_0x56b1('0x4')]=function(_0x29212f){for(var _0x1d7d87=0x0,_0x424a85=events[_0x56b1('0x5')];_0x1d7d87<_0x424a85;_0x1d7d87++){var _0x29e484=events[_0x1d7d87];var _0x28d00c=createListener(_0x56b1('0x6')+_0x29e484,_0x29212f);ChatGroupEvents['on'](_0x29e484,_0x28d00c);}}; \ No newline at end of file +var _0xcc9f=['./chatGroup.events','save','remove','update','register','length','chatGroup:'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcc9f,0x188));var _0xfcc9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc9f[_0x14add3];return _0x4a174f;};'use strict';var ChatGroupEvents=require(_0xfcc9('0x0'));var events=[_0xfcc9('0x1'),_0xfcc9('0x2'),_0xfcc9('0x3')];function createListener(_0x510264,_0x26bc08){return function(_0x41bcc1){_0x26bc08['emit'](_0x510264,_0x41bcc1);};}function removeListener(_0x28316b,_0x9bdd3d){return function(){ChatGroupEvents['removeListener'](_0x28316b,_0x9bdd3d);};}exports[_0xfcc9('0x4')]=function(_0x2ee489){for(var _0x534717=0x0,_0x56f434=events[_0xfcc9('0x5')];_0x534717<_0x56f434;_0x534717++){var _0x5a965f=events[_0x534717];var _0x319086=createListener(_0xfcc9('0x6')+_0x5a965f,_0x2ee489);ChatGroupEvents['on'](_0x5a965f,_0x319086);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index d80cd6b..188641f 100644 --- a/server/api/chatGroup/index.js +++ b/server/api/chatGroup/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf70d=['getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','/describe','isAuthenticated','/:id','get','/:id/unread','getUnread','/:id/members'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xf70d,0x16b));var _0xdf70=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xf70d[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require(_0xdf70('0x0'));var util=require(_0xdf70('0x1'));var path=require('path');var timeout=require(_0xdf70('0x2'));var express=require(_0xdf70('0x3'));var router=express[_0xdf70('0x4')]();var auth=require(_0xdf70('0x5'));var interaction=require(_0xdf70('0x6'));var config=require('../../config/environment');var controller=require(_0xdf70('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdf70('0x8'),auth[_0xdf70('0x9')](),controller['describe']);router['get'](_0xdf70('0xa'),auth[_0xdf70('0x9')](),controller['show']);router[_0xdf70('0xb')](_0xdf70('0xc'),auth['isAuthenticated'](),controller[_0xdf70('0xd')]);router[_0xdf70('0xb')](_0xdf70('0xe'),auth[_0xdf70('0x9')](),controller[_0xdf70('0xf')]);router[_0xdf70('0xb')](_0xdf70('0x10'),auth[_0xdf70('0x9')](),controller[_0xdf70('0x11')]);router[_0xdf70('0x12')]('/',auth['isAuthenticated'](),controller[_0xdf70('0x13')]);router[_0xdf70('0x12')](_0xdf70('0xe'),auth[_0xdf70('0x9')](),controller[_0xdf70('0x14')]);router[_0xdf70('0x12')](_0xdf70('0x10'),auth[_0xdf70('0x9')](),controller[_0xdf70('0x15')]);router['put']('/:id',auth[_0xdf70('0x9')](),controller[_0xdf70('0x16')]);router[_0xdf70('0x17')](_0xdf70('0xa'),auth[_0xdf70('0x9')](),controller[_0xdf70('0x18')]);router[_0xdf70('0x17')](_0xdf70('0xe'),auth[_0xdf70('0x9')](),controller[_0xdf70('0x19')]);module[_0xdf70('0x1a')]=router; \ No newline at end of file +var _0x1091=['post','create','addMembers','/:id/messages','addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1091,0x1ae));var _0x1109=function(_0x10320c,_0x49e576){_0x10320c=_0x10320c-0x0;var _0x1963c1=_0x1091[_0x10320c];return _0x1963c1;};'use strict';var multer=require(_0x1109('0x0'));var util=require(_0x1109('0x1'));var path=require(_0x1109('0x2'));var timeout=require(_0x1109('0x3'));var express=require(_0x1109('0x4'));var router=express[_0x1109('0x5')]();var auth=require(_0x1109('0x6'));var interaction=require(_0x1109('0x7'));var config=require(_0x1109('0x8'));var controller=require('./chatGroup.controller');router[_0x1109('0x9')]('/',auth['isAuthenticated'](),controller[_0x1109('0xa')]);router[_0x1109('0x9')](_0x1109('0xb'),auth[_0x1109('0xc')](),controller[_0x1109('0xd')]);router[_0x1109('0x9')](_0x1109('0xe'),auth[_0x1109('0xc')](),controller[_0x1109('0xf')]);router['get'](_0x1109('0x10'),auth[_0x1109('0xc')](),controller[_0x1109('0x11')]);router[_0x1109('0x9')](_0x1109('0x12'),auth['isAuthenticated'](),controller[_0x1109('0x13')]);router[_0x1109('0x9')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x1109('0x14')]('/',auth[_0x1109('0xc')](),controller[_0x1109('0x15')]);router['post'](_0x1109('0x12'),auth[_0x1109('0xc')](),controller[_0x1109('0x16')]);router[_0x1109('0x14')](_0x1109('0x17'),auth[_0x1109('0xc')](),controller[_0x1109('0x18')]);router[_0x1109('0x19')]('/:id',auth[_0x1109('0xc')](),controller[_0x1109('0x1a')]);router[_0x1109('0x1b')](_0x1109('0xe'),auth[_0x1109('0xc')](),controller[_0x1109('0x1c')]);router[_0x1109('0x1b')](_0x1109('0x12'),auth[_0x1109('0xc')](),controller[_0x1109('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index cae606b..29e18ce 100644 --- a/server/api/chatInteraction/chatInteraction.attributes.js +++ b/server/api/chatInteraction/chatInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1712=['sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','DATE','STRING'];(function(_0xf20f83,_0x1e5f2f){var _0x2409df=function(_0x5ed28b){while(--_0x5ed28b){_0xf20f83['push'](_0xf20f83['shift']());}};_0x2409df(++_0x1e5f2f);}(_0x1712,0xb4));var _0x2171=function(_0x4232d8,_0x13fd09){_0x4232d8=_0x4232d8-0x0;var _0x324de2=_0x1712[_0x4232d8];return _0x324de2;};'use strict';var Sequelize=require(_0x2171('0x0'));module[_0x2171('0x1')]={'closed':{'type':Sequelize[_0x2171('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2171('0x3')]},'ratingType':{'type':Sequelize[_0x2171('0x4')]('star',_0x2171('0x5')),'defaultValue':_0x2171('0x6')},'ratingMessage':{'type':Sequelize[_0x2171('0x7')]},'pathTranscript':{'type':Sequelize[_0x2171('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2171('0x8')]},'disposition':{'type':Sequelize[_0x2171('0x9')]},'note':{'type':Sequelize[_0x2171('0x9')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x2171('0x9')]},'osName':{'type':Sequelize[_0x2171('0x9')]},'osVersion':{'type':Sequelize[_0x2171('0x9')]},'deviceModel':{'type':Sequelize[_0x2171('0x9')]},'deviceVendor':{'type':Sequelize[_0x2171('0x9')]},'deviceType':{'type':Sequelize[_0x2171('0x9')]},'referer':{'type':Sequelize[_0x2171('0x7')]},'customerIp':{'type':Sequelize[_0x2171('0x9')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x2171('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x2171('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2171('0x9')]},'customerPort':{'type':Sequelize[_0x2171('0x9')]}}; \ No newline at end of file +var _0x5ce5=['TEXT','long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','STRING'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0x5ce5,0xa0));var _0x55ce=function(_0x17189c,_0x21ad4d){_0x17189c=_0x17189c-0x0;var _0x48cca1=_0x5ce5[_0x17189c];return _0x48cca1;};'use strict';var Sequelize=require(_0x55ce('0x0'));module[_0x55ce('0x1')]={'closed':{'type':Sequelize[_0x55ce('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x55ce('0x3')]},'ratingType':{'type':Sequelize[_0x55ce('0x4')](_0x55ce('0x5'),_0x55ce('0x6')),'defaultValue':_0x55ce('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x55ce('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x55ce('0x7')]},'note':{'type':Sequelize[_0x55ce('0x7')]},'browserName':{'type':Sequelize[_0x55ce('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x55ce('0x7')]},'osVersion':{'type':Sequelize[_0x55ce('0x7')]},'deviceModel':{'type':Sequelize[_0x55ce('0x7')]},'deviceVendor':{'type':Sequelize[_0x55ce('0x7')]},'deviceType':{'type':Sequelize[_0x55ce('0x7')]},'referer':{'type':Sequelize[_0x55ce('0x8')]},'customerIp':{'type':Sequelize[_0x55ce('0x7')]},'formData':{'type':Sequelize[_0x55ce('0x8')](_0x55ce('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x55ce('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x55ce('0x4')]('in',_0x55ce('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x55ce('0x7')]},'customerPort':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 7fb2d3a..0815d7a 100644 --- a/server/api/chatInteraction/chatInteraction.controller.js +++ b/server/api/chatInteraction/chatInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46d9=['$gte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','unreadMessages','DESC','t.id\x20IN\x20?','resolve','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','ui.ChatInteractionId\x20IN\x20?','groupBy','push','all','rows','params','include','merge','options','create','describe','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','join','close','server/files/chat/upload/','format','now','Messages','ChatWebsite','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','user','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','addMessage','ChatMessage','ids','omit','getMessages','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','nolimit','includeAgent','includeAll','setTags','color','emit','removeTags','download','unix','root','server','files','tmp','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','mkdirSync','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','toFile','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','test','ValidationError','request','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','stack','name','map','Tags','TagIds','split','forEach','catch','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','select','field','from','tools_tags','u.id','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','value','`\x20=\x200','having','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','text','keys','some','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse'];(function(_0xfabd06,_0x3aecd1){var _0x438e37=function(_0x59d9be){while(--_0x59d9be){_0xfabd06['push'](_0xfabd06['shift']());}};_0x438e37(++_0x3aecd1);}(_0x46d9,0xa3));var _0x946d=function(_0x2d7ec7,_0x469e0b){_0x2d7ec7=_0x2d7ec7-0x0;var _0x520668=_0x46d9[_0x2d7ec7];return _0x520668;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x946d('0x0'));var rimraf=require(_0x946d('0x1'));var zipdir=require(_0x946d('0x2'));var jsonpatch=require(_0x946d('0x3'));var rp=require(_0x946d('0x4'));var moment=require(_0x946d('0x5'));var BPromise=require(_0x946d('0x6'));var Mustache=require(_0x946d('0x7'));var util=require(_0x946d('0x8'));var path=require(_0x946d('0x9'));var sox=require(_0x946d('0xa'));var csv=require(_0x946d('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x946d('0xc'));var squel=require(_0x946d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x946d('0xe'));var toCsv=require(_0x946d('0xb'));var querystring=require(_0x946d('0xf'));var Papa=require(_0x946d('0x10'));var Redis=require(_0x946d('0x11'));var authService=require(_0x946d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x946d('0x13'))(_0x946d('0x14'));var utils=require(_0x946d('0x15'));var config=require(_0x946d('0x16'));var db=require(_0x946d('0x17'))['db'];config[_0x946d('0x18')]=_[_0x946d('0x19')](config[_0x946d('0x18')],{'host':_0x946d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0x946d('0x1b')](socket);var jayson=require(_0x946d('0x1c'));var client=jayson[_0x946d('0x1d')][_0x946d('0x1e')]({'port':0x232b});var client9004=jayson[_0x946d('0x1d')][_0x946d('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x17e764,_0x2c19c6,_0x31f3ca){if(_0x31f3ca){var _0x702cd8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x702cd8[_0x946d('0x1f')](_0x2c19c6)){return _0x17e764;}else{throw new db['Sequelize'][(_0x946d('0x20'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x17e764;}}function respondWithRpcPromise(_0x43419f,_0x57c9ec,_0x1bc169,_0x24451a){return new BPromise(function(_0xcafc29,_0x5df578){var _0x170a89=_0x24451a||client;return _0x170a89[_0x946d('0x21')](_0x43419f,_0x1bc169)['then'](function(_0x14e8d2){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x57c9ec,_0x946d('0x22'));logger['debug'](_0x946d('0x23'),_0x57c9ec,_0x946d('0x22'),JSON[_0x946d('0x24')](_0x14e8d2));if(_0x14e8d2[_0x946d('0x25')]){if(_0x14e8d2[_0x946d('0x25')][_0x946d('0x26')]===0x1f4){logger[_0x946d('0x25')](_0x946d('0x27'),_0x57c9ec,_0x14e8d2[_0x946d('0x25')][_0x946d('0x28')]);return _0x5df578(_0x14e8d2[_0x946d('0x25')][_0x946d('0x28')]);}logger[_0x946d('0x25')](_0x946d('0x27'),_0x57c9ec,_0x14e8d2[_0x946d('0x25')][_0x946d('0x28')]);return _0xcafc29(_0x14e8d2[_0x946d('0x25')]['message']);}else{logger[_0x946d('0x29')](_0x946d('0x27'),_0x57c9ec,_0x946d('0x22'));_0xcafc29(_0x14e8d2[_0x946d('0x2a')][_0x946d('0x28')]);}})['catch'](function(_0x207342){logger[_0x946d('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x57c9ec,_0x207342);_0x5df578(_0x207342);});});}function respondWithStatusCode(_0x2948c4,_0x91d711){_0x91d711=_0x91d711||0xcc;return function(_0x3865df){if(_0x3865df){return _0x2948c4[_0x946d('0x2b')](_0x91d711);}return _0x2948c4['status'](_0x91d711)[_0x946d('0x2c')]();};}function respondWithResult(_0x17d294,_0x39c383){_0x39c383=_0x39c383||0xc8;return function(_0x553fb4){if(_0x553fb4){return _0x17d294[_0x946d('0x2d')](_0x39c383)['json'](_0x553fb4);}};}function respondWithFilteredResult(_0x51a2b3,_0x4da8e5){return function(_0x761fab){if(_0x761fab){var _0x4b976d=_0x761fab[_0x946d('0x2e')],_0x221672=_0x4da8e5['offset'],_0x14c183=_0x4da8e5[_0x946d('0x2f')]+_0x4da8e5[_0x946d('0x30')],_0x8e1e3f;if(_0x14c183>=_0x4b976d){_0x14c183=_0x4b976d;_0x8e1e3f=0xc8;}else{_0x8e1e3f=0xce;}_0x51a2b3[_0x946d('0x2d')](_0x8e1e3f);return _0x51a2b3[_0x946d('0x31')](_0x946d('0x32'),_0x221672+'-'+_0x14c183+'/'+_0x4b976d)[_0x946d('0x33')](_0x761fab);}return null;};}function patchUpdates(_0x2296b0){return function(_0x595ebc){try{jsonpatch[_0x946d('0x34')](_0x595ebc,_0x2296b0,!![]);}catch(_0x18a4ee){return BPromise[_0x946d('0x35')](_0x18a4ee);}return _0x595ebc[_0x946d('0x36')]();};}function saveUpdates(_0x2b1809,_0x41a07a){return function(_0x225b00){if(_0x225b00){return _0x225b00[_0x946d('0x37')](_0x2b1809)['then'](function(_0x2d1e25){return _0x2d1e25;});}return null;};}function removeEntity(_0x3b3319,_0x5b0da0){return function(_0x5dd81d){if(_0x5dd81d){return _0x5dd81d['destroy']()[_0x946d('0x38')](function(){_0x3b3319[_0x946d('0x2d')](0xcc)[_0x946d('0x2c')]();});}};}function handleEntityNotFound(_0x5ecac6,_0x981168){return function(_0x1e0357){if(!_0x1e0357){_0x5ecac6[_0x946d('0x2b')](0x194);}return _0x1e0357;};}function handleError(_0x2b2d23,_0x1b52dd){_0x1b52dd=_0x1b52dd||0x1f4;return function(_0x237173){logger[_0x946d('0x25')](_0x237173[_0x946d('0x39')]);if(_0x237173[_0x946d('0x3a')]){delete _0x237173[_0x946d('0x3a')];}_0x2b2d23[_0x946d('0x2d')](_0x1b52dd)['send'](_0x237173);};}function getInteractionUsers(_0x2a0e63,_0x3575e5){return new BPromise(function(_0x4e9847,_0x5ddc24){try{if(_0x3575e5[_0x2a0e63['id']]){_0x2a0e63['Users']=_[_0x946d('0x3b')](_0x3575e5[_0x2a0e63['id']],function(_0x3e44dd){return{'id':_0x3e44dd['id']};});}}catch(_0x237ee4){_0x5ddc24(_0x237ee4);}_0x4e9847(_0x2a0e63);});}function getInteractionTags(_0x305018,_0x3c7014){return new BPromise(function(_0x5909ae,_0x1c51e8){try{if(_0x305018['TagIds']){_0x305018[_0x946d('0x3c')]=[];_0x305018[_0x946d('0x3d')][_0x946d('0x3e')](',')[_0x946d('0x3f')](function(_0x2fa50b){_0x305018['Tags']['push'](_0x3c7014[_0x2fa50b]);});}delete _0x305018[_0x946d('0x3d')];}catch(_0xcf13e1){_0x1c51e8(_0xcf13e1);}_0x5909ae(_0x305018);});}function updateChatInteraction(_0x55f208,_0x3e63e6,_0x49c45f){return new BPromise(function(_0x2ce5d4,_0x318772){return getInteractionUsers(_0x55f208,_0x49c45f)[_0x946d('0x38')](function(_0x8ccd68){return getInteractionTags(_0x8ccd68,_0x3e63e6);})[_0x946d('0x38')](function(_0x57f30f){_0x2ce5d4(_0x57f30f);})[_0x946d('0x40')](function(_0x23eb53){_0x318772(_0x23eb53);});});}exports['index']=function(_0xf4955,_0x4eac8b){var _0x23c3ea={},_0x9bb880={},_0x5bc68={'count':0x0,'rows':[]};var _0x544292=_[_0x946d('0x3b')](db[_0x946d('0x41')][_0x946d('0x42')],function(_0x2ed47a){return{'name':_0x2ed47a[_0x946d('0x43')],'type':_0x2ed47a[_0x946d('0x44')][_0x946d('0x45')]};});_0x9bb880[_0x946d('0x46')]=_[_0x946d('0x3b')](_0x544292,_0x946d('0x3a'));_0x9bb880[_0x946d('0x47')]=_['keys'](_0xf4955[_0x946d('0x47')]);_0x9bb880[_0x946d('0x48')]=_[_0x946d('0x49')](_0x9bb880[_0x946d('0x46')],_0x9bb880[_0x946d('0x47')]);_0x23c3ea[_0x946d('0x4a')]=_[_0x946d('0x49')](_0x9bb880['model'],qs[_0x946d('0x4b')](_0xf4955[_0x946d('0x47')]['fields']));_0x23c3ea[_0x946d('0x4a')]=_0x23c3ea['attributes']['length']?_0x23c3ea[_0x946d('0x4a')]:_0x9bb880[_0x946d('0x46')];if(!_0xf4955[_0x946d('0x47')][_0x946d('0x4c')]('nolimit')){_0x23c3ea[_0x946d('0x30')]=qs[_0x946d('0x30')](_0xf4955[_0x946d('0x47')]['limit']);_0x23c3ea[_0x946d('0x2f')]=qs[_0x946d('0x2f')](_0xf4955[_0x946d('0x47')][_0x946d('0x2f')]);}_0x23c3ea[_0x946d('0x4d')]=qs[_0x946d('0x4e')](_0xf4955[_0x946d('0x47')]['sort']);_0x23c3ea['where']=qs[_0x946d('0x48')](_['pick'](_0xf4955['query'],_0x9bb880['filters']));var _0x56568b=[];var _0x3f6e88=squel[_0x946d('0x4f')]()[_0x946d('0x50')]('id')[_0x946d('0x50')](_0x946d('0x3a'))[_0x946d('0x50')]('color')[_0x946d('0x51')](_0x946d('0x52'));var _0x8742bc=squel['select']()['field'](_0x946d('0x53'))[_0x946d('0x50')]('ui.ChatInteractionId')[_0x946d('0x51')](_0x946d('0x54'),'ui')[_0x946d('0x55')](_0x946d('0x56'),'u',_0x946d('0x57'));var _0x162d60=squel[_0x946d('0x4f')]()[_0x946d('0x51')](_0x946d('0x58'),'i')[_0x946d('0x55')](_0x946d('0x59'),'c',_0x946d('0x5a'))[_0x946d('0x55')]('users','o',_0x946d('0x5b'))[_0x946d('0x55')](_0x946d('0x5c'),'a',_0x946d('0x5d'))[_0x946d('0x55')](_0x946d('0x5e'),'me',_0x946d('0x5f'))[_0x946d('0x55')](_0x946d('0x60'),'it',_0x946d('0x61'))['left_join'](_0x946d('0x52'),'t',_0x946d('0x62'));var _0x53a583=squel[_0x946d('0x63')]();var _0x45a6af=[];var _0x9113ae=squel[_0x946d('0x63')]();var _0x5b99fd;if(_0xf4955[_0x946d('0x47')][_0x946d('0x64')]){_0x5b99fd=as[_0x946d('0x65')](_0xf4955['query'][_0x946d('0x64')]);var _0x1d3371=_0x5b99fd['sqlOperator'];for(var _0x2eaee7=0x0;_0x2eaee7<_0x5b99fd[_0x946d('0x66')][_0x946d('0x67')];_0x2eaee7++){var _0x1207e9=_0x5b99fd[_0x946d('0x66')][_0x2eaee7];var _0x3d2c30='i';var _0x5d67e3=_[_0x946d('0x68')](_0x544292,['name',_0x1207e9[_0x946d('0x50')]]);if(!_0x5d67e3){switch(_0x1207e9['field']){case'unreadMessages':if(_0x1207e9[_0x946d('0x69')]==0x1){_0x162d60['having']('`'+_0x1207e9[_0x946d('0x50')]+_0x946d('0x6a'));}else{_0x162d60[_0x946d('0x6b')]('`'+_0x1207e9[_0x946d('0x50')]+'`\x20>\x200');}break;case'Contact':if(_0x1207e9[_0x946d('0x6c')]===_0x946d('0x6d')){if(_0x1207e9[_0x946d('0x69')][_0x946d('0x3e')]('\x20')['length']>0x1){_0x53a583[_0x1d3371](_0x946d('0x6e'),qs[_0x946d('0x6f')](_0x1207e9[_0x946d('0x69')]),null);}else{var _0x3cee38='%'+_0x1207e9[_0x946d('0x69')]+'%';_0x53a583[_0x1d3371]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3cee38,_0x3cee38,_0x3cee38);}}else{_0x5d67e3=_[_0x946d('0x68')](_0x544292,[_0x946d('0x3a'),_0x946d('0x70')]);_0x1207e9['field']=_0x946d('0x70');_0x2cf57b=as[_0x946d('0x71')](_0x3d2c30,_0x5d67e3[_0x946d('0x44')],_0x1207e9);_0x53a583[_0x1d3371](_0x2cf57b['text'],_0x2cf57b['value'][_0x946d('0x72')],_0x2cf57b[_0x946d('0x69')]['end']);}break;case _0x946d('0x73'):var _0x541326=_0x1207e9[_0x946d('0x69')]['split'](',')[_0x946d('0x3b')](function(_0xb9bf05){return Number(_0xb9bf05);});_0x541326[_0x946d('0x3f')](function(_0x347d6e){_0x9113ae['or'](_0x946d('0x74'),'%,'+_0x347d6e+',%');});_0x45a6af=_[_0x946d('0x75')](_0x45a6af,_0x541326);break;case _0x946d('0x76'):if(_0x1207e9[_0x946d('0x6c')]==='$substring'){_0x53a583[_0x1d3371](_0x946d('0x77'),'%'+_0x1207e9[_0x946d('0x69')]+'%',null);}else{_0x5d67e3=_[_0x946d('0x68')](_0x544292,[_0x946d('0x3a'),'UserId']);_0x1207e9['field']=_0x946d('0x78');_0x2cf57b=as[_0x946d('0x71')](_0x3d2c30,_0x5d67e3[_0x946d('0x44')],_0x1207e9);_0x53a583[_0x1d3371](_0x2cf57b['text'],_0x2cf57b[_0x946d('0x69')]['start'],_0x2cf57b[_0x946d('0x69')][_0x946d('0x2c')]);}break;case _0x946d('0x79'):_0x2cf57b=as[_0x946d('0x71')]('me',null,_0x1207e9);_0x53a583[_0x1d3371](_0x2cf57b[_0x946d('0x7a')],_0x2cf57b[_0x946d('0x69')][_0x946d('0x72')],_0x2cf57b['value']['end']);break;}}else{var _0x2cf57b=as['buildExpression'](_0x3d2c30,_0x5d67e3[_0x946d('0x44')],_0x1207e9);_0x53a583[_0x1d3371](_0x2cf57b[_0x946d('0x7a')],_0x2cf57b[_0x946d('0x69')][_0x946d('0x72')],_0x2cf57b[_0x946d('0x69')][_0x946d('0x2c')]);}}}else{var _0x5513a0=_(_0xf4955[_0x946d('0x47')])[_0x946d('0x7b')]()[_0x946d('0x3b')](function(_0x164b53){return _[_0x946d('0x7c')](_0x544292,[_0x946d('0x3a'),_0x164b53])?_0x164b53:undefined;})[_0x946d('0x7d')]()[_0x946d('0x69')]();if(!_[_0x946d('0x7e')](_0x5513a0)){_0x5513a0['forEach'](function(_0x4cee95){if(_0x4cee95===_0x946d('0x7f')){_0x162d60[_0x946d('0x80')](_0x946d('0x81'),[]['concat'](_0xf4955[_0x946d('0x47')][_0x4cee95]));}else if(_0x4cee95===_0x946d('0x82')){var _0x3bab24=JSON[_0x946d('0x83')](_0xf4955[_0x946d('0x47')][_0x4cee95])[_0x946d('0x84')];var _0x2df6ef=JSON['parse'](_0xf4955[_0x946d('0x47')][_0x4cee95])['$lte'];_0x162d60[_0x946d('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3bab24,_0x2df6ef);}else{if(_0xf4955[_0x946d('0x47')][_0x4cee95]==='null'){_0x162d60[_0x946d('0x80')]('i.'+_0x4cee95+_0x946d('0x85'));}else{_0x162d60['where']('i.'+_0x4cee95+'\x20=\x20?',_0xf4955[_0x946d('0x47')][_0x4cee95]);}}});}if(_0xf4955[_0x946d('0x47')][_0x946d('0x86')]){if(_0xf4955[_0x946d('0x47')][_0x946d('0x86')]==0x1){_0x162d60[_0x946d('0x6b')](_0x946d('0x87'));}else{_0x162d60['having'](_0x946d('0x88'));}}if(_0xf4955[_0x946d('0x47')][_0x946d('0x89')]){_0x45a6af=_[_0x946d('0x8a')](_0xf4955[_0x946d('0x47')][_0x946d('0x89')])?_0xf4955['query'][_0x946d('0x89')]:new Array(_0xf4955['query'][_0x946d('0x89')]);_0x45a6af[_0x946d('0x3f')](function(_0x26baca){_0x9113ae['or'](_0x946d('0x74'),'%,'+_0x26baca+',%');});}if(_0xf4955[_0x946d('0x47')]['filter']){var _0x57a866=_0xf4955[_0x946d('0x47')][_0x946d('0x8b')][_0x946d('0x8c')]('\x5c','\x5c\x5c')[_0x946d('0x8c')]('\x27\x27',_0x946d('0x8d'));if(qs[_0x946d('0x8e')](_0x57a866)){_0x53a583['or'](_0x946d('0x8f'),_0x57a866+'%');}else{_0x53a583['or'](_0x946d('0x90'),qs[_0x946d('0x6f')](_0x57a866))['or'](_0x946d('0x91'),_0x57a866+'%');}}}_0x162d60['where'](_0x53a583);_0x162d60[_0x946d('0x92')](_0x946d('0x93'));var _0x217f2b={'type':db[_0x946d('0x94')]['QueryTypes'][_0x946d('0x95')],'raw':!![]};var _0x40e70c=_0x162d60[_0x946d('0x96')]();_0x40e70c[_0x946d('0x50')](_0x946d('0x93'));_0x40e70c[_0x946d('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x946d('0x97'));if(_0x23c3ea['order']){_0x23c3ea[_0x946d('0x4d')][_0x946d('0x3f')](function(_0xbcb6ad){_0x162d60['order']('i.'+_0xbcb6ad[0x0],_0xbcb6ad[0x1]===_0x946d('0x98')?![]:!![]);});}if(!_[_0x946d('0x7e')](_0x45a6af)){_0x162d60[_0x946d('0x6b')](_0x9113ae);_0x40e70c[_0x946d('0x80')](_0x946d('0x99'),_0x45a6af);}BPromise[_0x946d('0x9a')]()[_0x946d('0x38')](function(){if(!_0x5b99fd&&_0xf4955[_0x946d('0x47')][_0x946d('0x7f')])return;return _0xf4955['user'][_0x946d('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x301c3f){if(_[_0x946d('0x7e')](_0x301c3f)){_0x40e70c[_0x946d('0x80')](_0x946d('0x9c'));_0x162d60[_0x946d('0x80')](_0x946d('0x9c'));}else{_0x40e70c[_0x946d('0x80')](_0x946d('0x81'),_[_0x946d('0x3b')](_0x301c3f,'id'));_0x162d60[_0x946d('0x80')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x301c3f,'id'));}});})[_0x946d('0x38')](function(){db[_0x946d('0x9d')][_0x946d('0x47')](_0x40e70c['toString'](),_0x217f2b)[_0x946d('0x38')](function(_0x1159bb){_0x5bc68[_0x946d('0x2e')]=_0x1159bb[_0x946d('0x67')];if(_0x5bc68['count']===0x0)return[];return db[_0x946d('0x9d')][_0x946d('0x47')](_0x3f6e88[_0x946d('0x9e')](),_0x217f2b)[_0x946d('0x38')](function(_0x1faedb){_0x56568b=_[_0x946d('0x9f')](_0x1faedb,'id');_0x217f2b=_['merge'](_0x217f2b,{'model':db[_0x946d('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf4955[_0x946d('0x47')][_0x946d('0x4b')]){_0x23c3ea['attributes']['forEach'](function(_0x105414){_0x162d60[_0x946d('0x50')]('i.'+_0x105414);});}else{_0x162d60[_0x946d('0x50')](_0x946d('0xa0'),_0x946d('0x97'));_0x162d60[_0x946d('0x50')]('a.key',_0x946d('0xa1'));_0x162d60[_0x946d('0x50')]('a.mandatoryDisposition',_0x946d('0xa2'));_0x162d60[_0x946d('0x50')](_0x946d('0xa3'));_0x162d60['field'](_0x946d('0xa4'),_0x946d('0xa5'));_0x162d60[_0x946d('0x50')](_0x946d('0xa6'),_0x946d('0xa7'));_0x162d60[_0x946d('0x50')](_0x946d('0xa8'),_0x946d('0xa9'));_0x162d60[_0x946d('0x50')](_0x946d('0xaa'),_0x946d('0xab'));_0x162d60[_0x946d('0x50')]('c.mobile',_0x946d('0xac'));_0x162d60[_0x946d('0x50')]('c.fax',_0x946d('0xad'));_0x162d60['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x946d('0x3d'));}_0x162d60['limit'](_0x23c3ea['limit']);_0x162d60['offset'](_0x23c3ea[_0x946d('0x2f')]);return db[_0x946d('0x9d')][_0x946d('0x47')](_0x162d60[_0x946d('0x9e')](),_0x217f2b);})[_0x946d('0x38')](function(_0x6720c4){_0x8742bc[_0x946d('0x80')](_0x946d('0xae'),_[_0x946d('0x3b')](_0x6720c4,'id'));return db['sequelize'][_0x946d('0x47')](_0x8742bc[_0x946d('0x9e')](),_0x217f2b)[_0x946d('0x38')](function(_0x51d094){var _0x1129a8=_[_0x946d('0xaf')](_0x51d094,'ChatInteractionId');var _0x1858d7=[];_0x6720c4[_0x946d('0x3f')](function(_0x47d6ec){_0x1858d7[_0x946d('0xb0')](updateChatInteraction(_0x47d6ec,_0x56568b,_0x1129a8));});return BPromise[_0x946d('0xb1')](_0x1858d7);});});})[_0x946d('0x38')](function(_0x358c22){_0x5bc68[_0x946d('0xb2')]=_0x358c22;return _0x5bc68;})[_0x946d('0x38')](respondWithFilteredResult(_0x4eac8b,_0x23c3ea));})['catch'](handleError(_0x4eac8b,null));};exports['show']=function(_0x3e53a8,_0x19bf47){var _0x553dcc={'raw':![],'where':{'id':_0x3e53a8[_0x946d('0xb3')]['id']}},_0x17b8a8={};_0x17b8a8[_0x946d('0x46')]=_[_0x946d('0x7b')](db[_0x946d('0x41')]['rawAttributes']);_0x17b8a8[_0x946d('0x47')]=_[_0x946d('0x7b')](_0x3e53a8[_0x946d('0x47')]);_0x17b8a8[_0x946d('0x48')]=_[_0x946d('0x49')](_0x17b8a8[_0x946d('0x46')],_0x17b8a8[_0x946d('0x47')]);_0x553dcc[_0x946d('0x4a')]=_['intersection'](_0x17b8a8[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x3e53a8['query']['fields']));_0x553dcc[_0x946d('0x4a')]=_0x553dcc[_0x946d('0x4a')][_0x946d('0x67')]?_0x553dcc['attributes']:_0x17b8a8[_0x946d('0x46')];if(_0x3e53a8[_0x946d('0x47')]['includeAll']){_0x553dcc[_0x946d('0xb4')]=[{'all':!![]}];}_0x553dcc=_[_0x946d('0xb5')]({},_0x553dcc,_0x3e53a8[_0x946d('0xb6')]);return db[_0x946d('0x41')][_0x946d('0x68')](_0x553dcc)[_0x946d('0x38')](handleEntityNotFound(_0x19bf47,null))[_0x946d('0x38')](respondWithResult(_0x19bf47,null))['catch'](handleError(_0x19bf47,null));};exports[_0x946d('0xb7')]=function(_0x1d06fe,_0x773b44){return db[_0x946d('0x41')][_0x946d('0xb7')](_0x1d06fe['body'],{})[_0x946d('0x38')](respondWithResult(_0x773b44,0xc9))[_0x946d('0x40')](handleError(_0x773b44,null));};exports[_0x946d('0x37')]=function(_0x47132c,_0x36a79f){if(_0x47132c['body']['id']){delete _0x47132c[_0x946d('0x79')]['id'];}return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x47132c['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x36a79f,null))[_0x946d('0x38')](saveUpdates(_0x47132c[_0x946d('0x79')],null))[_0x946d('0x38')](respondWithResult(_0x36a79f,null))['catch'](handleError(_0x36a79f,null));};exports['destroy']=function(_0xc67cf,_0x509653){return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0xc67cf['params']['id']}})['then'](handleEntityNotFound(_0x509653,null))[_0x946d('0x38')](removeEntity(_0x509653,null))[_0x946d('0x40')](handleError(_0x509653,null));};exports['describe']=function(_0xeebd75,_0x5e8c5c){return db[_0x946d('0x41')][_0x946d('0xb8')]()['then'](respondWithResult(_0x5e8c5c,null))['catch'](handleError(_0x5e8c5c,null));};exports[_0x946d('0xb9')]=function(_0x5914e8,_0x46254f){if(_0x5914e8[_0x946d('0x79')]['id']){delete _0x5914e8[_0x946d('0x79')]['id'];}return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x5914e8[_0x946d('0xb3')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x46254f,null))[_0x946d('0x38')](saveUpdates(_0x5914e8['body'],null))[_0x946d('0x38')](respondWithResult(_0x46254f,null))[_0x946d('0x40')](handleError(_0x46254f,null));};exports['abandon']=function(_0x1ed5be,_0x38a092,_0x2e7d06){if(_0x1ed5be['body']['id']){delete _0x1ed5be[_0x946d('0x79')]['id'];}return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x1ed5be[_0x946d('0xb3')]['id']}})[_0x946d('0x38')](function(_0x19d293){if(!_0x19d293){logger[_0x946d('0x25')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x946d('0xba'),0x194,_0x946d('0xbb'));_0x38a092[_0x946d('0x2b')](0x194);}else{if(_0x19d293[_0x946d('0x78')]){throw new db[(_0x946d('0x94'))][(_0x946d('0x20'))](_0x946d('0xbc'));}}return _0x19d293;})[_0x946d('0x38')](function(_0x35fc8d){if(_0x35fc8d){return _0x35fc8d[_0x946d('0x37')]({'closed':_0x1ed5be[_0x946d('0x79')][_0x946d('0xbd')],'disposition':_0x1ed5be['body']['disposition']})[_0x946d('0x38')](function(_0x3c5a19){return _0x3c5a19;});}})[_0x946d('0x38')](function(_0x2c6648){return respondWithRpcPromise(_0x946d('0xbe'),_0x946d('0xba'),_0x1ed5be['body'],client9004);})[_0x946d('0x38')](respondWithResult(_0x38a092,null))[_0x946d('0x40')](handleError(_0x38a092,null));};exports[_0x946d('0xbf')]=function(_0x34ce26,_0x5d1701,_0x1d7ef4){_0x34ce26['body'][_0x946d('0x3a')]=_0x34ce26['file'][_0x946d('0xc0')];_0x34ce26[_0x946d('0x79')][_0x946d('0xc1')]=_0x34ce26[_0x946d('0xc2')][_0x946d('0xc3')];_0x34ce26[_0x946d('0x79')][_0x946d('0x44')]=_0x34ce26[_0x946d('0xc2')][_0x946d('0xc4')];return db[_0x946d('0xc5')]['create'](_0x34ce26[_0x946d('0x79')])[_0x946d('0x38')](respondWithResult(_0x5d1701,0xc9))[_0x946d('0x40')](handleError(_0x5d1701,null));};exports[_0x946d('0xc6')]=function(_0xeeed21,_0x1f0bee,_0x1085de){return db[_0x946d('0x41')][_0x946d('0xc7')]({'where':{'id':_0xeeed21['params']['id']},'raw':!![]})[_0x946d('0x38')](handleEntityNotFound(_0x1f0bee,null))[_0x946d('0x38')](function(_0x5a9386){if(_0x5a9386){if(_0x5a9386[_0x946d('0xbd')]){return _0x1f0bee[_0x946d('0x2d')](0x193)['json']({'status':0x193,'message':_0x946d('0xc8')});}return db[_0x946d('0xc5')][_0x946d('0xc7')]({'where':{'id':_0xeeed21['query']['attachId']},'raw':!![]})[_0x946d('0x38')](handleEntityNotFound(_0x1f0bee,null));}})[_0x946d('0x38')](function(_0x3c3516){if(_0x3c3516){return _0x1f0bee['download'](path[_0x946d('0xc9')](config['root'],'server/files/attachments/',_0x3c3516[_0x946d('0xc1')]));}})[_0x946d('0x40')](handleError(_0x1f0bee,null));};exports[_0x946d('0xca')]=function(_0x462700,_0x4d3702){var _0x4a6ff7=null;var _0x2c09bf=null;var _0x3e2301=null;var _0x5a16a2=null;if(_0x462700[_0x946d('0x79')]['id']){delete _0x462700[_0x946d('0x79')]['id'];}if(_0x462700[_0x946d('0x79')]['mailTranscript']){_0x5a16a2=path[_0x946d('0xc9')](config['root'],_0x946d('0xcb'),util[_0x946d('0xcc')]('transcript-%s.txt',Date[_0x946d('0xcd')]()));_0x462700['body']['pathTranscript']=_0x5a16a2;}return db[_0x946d('0x41')]['find']({'where':{'id':_0x462700[_0x946d('0xb3')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x946d('0xce'),'include':[{'model':db[_0x946d('0x76')],'as':_0x946d('0x76')}]}]})[_0x946d('0x38')](handleEntityNotFound(_0x4d3702,null))[_0x946d('0x38')](saveUpdates(_0x462700[_0x946d('0x79')],null))[_0x946d('0x38')](function(_0x16f583){if(_0x16f583){_0x4a6ff7=_0x16f583;return db[_0x946d('0xcf')][_0x946d('0x68')]({'where':{'id':_0x4a6ff7[_0x946d('0x7f')]}});}})[_0x946d('0x38')](function(_0x5b11fe){if(_0x5b11fe){_0x3e2301=_0x5b11fe;return db[_0x946d('0xd0')][_0x946d('0x68')]({'where':{'id':_0x4a6ff7['ContactId']}});}})[_0x946d('0x38')](function(_0x4ea41f){if(_0x4ea41f){_0x2c09bf=_0x4ea41f;if(_0x5a16a2){var _0x53089b=null;for(var _0x4b3f75=0x1;_0x4b3f75<_0x4a6ff7[_0x946d('0xce')][_0x946d('0x67')];++_0x4b3f75){_0x53089b=_0x4a6ff7[_0x946d('0xce')][_0x4b3f75];var _0x4f7a86=_0x53089b[_0x946d('0x78')]?util[_0x946d('0xcc')](_0x946d('0xd1'),_0x3e2301[_0x946d('0xd2')],_0x53089b[_0x946d('0x78')]):_0x946d('0xd3');var _0x5bc0b0=_0x462700['body'][_0x946d('0xd4')]||util[_0x946d('0xcc')](_0x946d('0xd1'),_0x946d('0xd5'),_0x53089b['ContactId']);switch(_0x3e2301[_0x946d('0xd6')]){case'website_alias':_0x4f7a86=_0x53089b[_0x946d('0x78')]?util['format'](_0x946d('0xd1'),_0x3e2301['agentAlias'],_0x53089b['UserId']):_0x946d('0xd3');break;case _0x946d('0xd7'):_0x4f7a86=_0x53089b[_0x946d('0x78')]?_0x53089b[_0x946d('0x76')]['alias']||_0x53089b[_0x946d('0x76')][_0x946d('0xd8')]:'System';break;case _0x946d('0xd9'):_0x4f7a86=_0x53089b[_0x946d('0x78')]?_0x53089b['User']['fullname']:'System';break;default:_0x4f7a86=_0x53089b[_0x946d('0x78')]?util[_0x946d('0xcc')](_0x946d('0xd1'),_0x3e2301['agentAlias'],_0x53089b['UserId']):_0x946d('0xd3');}var _0x544750=util[_0x946d('0xcc')](_0x946d('0xda'),moment(_0x53089b[_0x946d('0x82')])['format'](_0x946d('0xdb')),_0x53089b[_0x946d('0xdc')]==='in'?_0x5bc0b0:_0x4f7a86,_0x53089b[_0x946d('0x79')]);if(!_0x53089b[_0x946d('0xdd')]){fs['appendFileSync'](_0x5a16a2,_0x544750);}}return db[_0x946d('0xde')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x946d('0xdf')],'as':_0x946d('0xe0'),'raw':!![]}]});}}})[_0x946d('0x38')](function(_0x4ee376){if(_0x4ee376&&_0x4ee376[_0x946d('0xe0')]&&_0x462700[_0x946d('0x79')]){var _0x10bfd0={'tls':{'rejectUnauthorized':![]}};if(_0x4ee376[_0x946d('0xe0')]['service']){_0x10bfd0[_0x946d('0xe1')]=_0x4ee376[_0x946d('0xe0')][_0x946d('0xe1')];}else{_0x10bfd0['host']=_0x4ee376[_0x946d('0xe0')][_0x946d('0xe2')];_0x10bfd0['port']=_0x4ee376[_0x946d('0xe0')][_0x946d('0xe3')];_0x10bfd0[_0x946d('0xe4')]=_0x4ee376['Smtp']['secure'];}if(_0x4ee376[_0x946d('0xe0')][_0x946d('0xe5')]){_0x10bfd0['auth']={'user':_0x4ee376['Smtp'][_0x946d('0xe6')],'pass':_0x4ee376['Smtp']['pass']};}return respondWithRpcPromise(_0x946d('0xe7'),_0x946d('0xe8'),{'account':_0x10bfd0,'message':{'from':util[_0x946d('0xcc')](_0x946d('0xe9'),_0x4ee376[_0x946d('0x3a')],_0x4ee376[_0x946d('0xea')]||_0x4ee376['Smtp'][_0x946d('0xe6')]),'to':_0x462700['body'][_0x946d('0xeb')],'subject':_0x946d('0xec'),'text':util[_0x946d('0xcc')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x462700['body'][_0x946d('0xeb')]),'attachments':[{'path':_0x5a16a2}]}})[_0x946d('0x38')](function(){return _0x4a6ff7;})['catch'](function(_0x5f26da){console['error'](_0x5f26da);});}else{return _0x4a6ff7;}})['then'](respondWithStatusCode(_0x4d3702,0xc8))[_0x946d('0x40')](handleError(_0x4d3702,null));};exports[_0x946d('0xed')]=function(_0x25ec8b,_0x3a04af,_0x1b776d){return db[_0x946d('0xee')][_0x946d('0x68')]({'where':{'id':_0x25ec8b['params']['id']}})['then'](handleEntityNotFound(_0x3a04af,null))[_0x946d('0x38')](function(_0x1f2335){if(_0x1f2335){return _0x1f2335[_0x946d('0xed')](_0x25ec8b[_0x946d('0x79')][_0x946d('0xef')],_[_0x946d('0xf0')](_0x25ec8b[_0x946d('0x79')],[_0x946d('0xef'),'id'])||{});}})['then'](respondWithResult(_0x3a04af,null))[_0x946d('0x40')](handleError(_0x3a04af,null));};exports[_0x946d('0xf1')]=function(_0x281d95,_0x4864a9,_0x463aac){var _0x29afc5={'raw':![],'where':{}};var _0x5ce238={};var _0x281ac2={'count':0x0,'rows':[]};return db[_0x946d('0x41')]['findOne']({'where':{'id':_0x281d95[_0x946d('0xb3')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x4864a9,null))[_0x946d('0x38')](function(_0x53d073){if(_0x53d073){_0x5ce238['model']=_[_0x946d('0x7b')](db['ChatMessage']['rawAttributes']);_0x5ce238[_0x946d('0x47')]=_['keys'](_0x281d95[_0x946d('0x47')]);_0x5ce238[_0x946d('0x48')]=_[_0x946d('0x49')](_0x5ce238[_0x946d('0x46')],_0x5ce238[_0x946d('0x47')]);_0x29afc5[_0x946d('0x4a')]=_[_0x946d('0x49')](_0x5ce238[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x281d95['query'][_0x946d('0x4b')]));_0x29afc5[_0x946d('0x4a')]=_0x29afc5['attributes'][_0x946d('0x67')]?_0x29afc5[_0x946d('0x4a')]:_0x5ce238['model'];if(!_0x281d95[_0x946d('0x47')][_0x946d('0x4c')]('nolimit')){_0x29afc5[_0x946d('0x30')]=qs['limit'](_0x281d95[_0x946d('0x47')]['limit']);_0x29afc5[_0x946d('0x2f')]=qs[_0x946d('0x2f')](_0x281d95[_0x946d('0x47')]['offset']);}_0x29afc5[_0x946d('0x4d')]=qs['sort'](_0x281d95[_0x946d('0x47')][_0x946d('0x4e')]);_0x29afc5[_0x946d('0x80')]=qs[_0x946d('0x48')](_[_0x946d('0xf2')](_0x281d95[_0x946d('0x47')],_0x5ce238['filters']));_0x29afc5[_0x946d('0x80')][_0x946d('0xf3')]=_0x53d073['id'];if(_0x281d95[_0x946d('0x47')][_0x946d('0x8b')]){_0x29afc5['where']=_['merge'](_0x29afc5['where'],{'$or':_[_0x946d('0x3b')](_0x29afc5['attributes'],function(_0x2e3380){var _0x5cf88d={};_0x5cf88d[_0x2e3380]={'$like':'%'+_0x281d95[_0x946d('0x47')][_0x946d('0x8b')]+'%'};return _0x5cf88d;})});}if(_0x281d95[_0x946d('0x47')][_0x946d('0x84')]){var _0x348099=_0x281d95['query'][_0x946d('0x84')][_0x946d('0x3e')](',');var _0x141a82={};_0x141a82[_0x348099[0x0]]={'$gte':moment(_0x348099[0x1])['format'](_0x946d('0xf4'))};_0x29afc5[_0x946d('0x80')]=_[_0x946d('0xb5')](_0x29afc5[_0x946d('0x80')],_0x141a82);}_0x29afc5=_[_0x946d('0xb5')]({},_0x29afc5,_0x281d95[_0x946d('0xb6')]);return db['ChatMessage']['count']({'where':_0x29afc5[_0x946d('0x80')]})['then'](function(_0x407dd5){_0x281ac2['count']=_0x407dd5;if(_0x281d95['query']['includeAll']){_0x29afc5[_0x946d('0xb4')]=[{'all':!![]}];}return db[_0x946d('0xee')][_0x946d('0xf5')](_0x29afc5);})['then'](function(_0x4758f2){_0x281ac2[_0x946d('0xb2')]=_0x4758f2;return _0x281ac2;});}})[_0x946d('0x38')](respondWithFilteredResult(_0x4864a9,_0x29afc5))['catch'](handleError(_0x4864a9,null));};exports[_0x946d('0xf6')]=function(_0x36d7b8,_0x5deab1,_0x29ef7b){var _0x56b9b9={'where':{}},_0x3582b0={},_0x319f18={'count':0x0,'rows':[]};return db[_0x946d('0x41')][_0x946d('0xc7')]({'where':{'id':_0x36d7b8[_0x946d('0xb3')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x5deab1,null))[_0x946d('0x38')](function(_0xf23408){if(_0xf23408){_0x3582b0[_0x946d('0x46')]=_['keys'](db[_0x946d('0xee')]['rawAttributes']);_0x3582b0['query']=_['keys'](_0x36d7b8[_0x946d('0x47')]);_0x3582b0[_0x946d('0x48')]=_[_0x946d('0x49')](_0x3582b0['model'],_0x3582b0[_0x946d('0x47')]);_0x56b9b9['attributes']=_[_0x946d('0x49')](_0x3582b0['model'],qs[_0x946d('0x4b')](_0x36d7b8[_0x946d('0x47')][_0x946d('0x4b')]));_0x56b9b9['attributes']=_0x56b9b9['attributes'][_0x946d('0x67')]?_0x56b9b9[_0x946d('0x4a')]:_0x3582b0[_0x946d('0x46')];if(!_0x36d7b8[_0x946d('0x47')]['hasOwnProperty'](_0x946d('0xf7'))){_0x56b9b9[_0x946d('0x30')]=qs[_0x946d('0x30')](_0x36d7b8[_0x946d('0x47')][_0x946d('0x30')]);_0x56b9b9['offset']=qs[_0x946d('0x2f')](_0x36d7b8[_0x946d('0x47')][_0x946d('0x2f')]);}_0x56b9b9[_0x946d('0x4d')]=qs[_0x946d('0x4e')](_0x36d7b8[_0x946d('0x47')][_0x946d('0x4e')]);_0x56b9b9[_0x946d('0x80')]=qs['filters'](_[_0x946d('0xf2')](_0x36d7b8['query'],_0x3582b0[_0x946d('0x48')]));_0x56b9b9[_0x946d('0x80')][_0x946d('0xf3')]=_0xf23408['id'];if(_0x36d7b8[_0x946d('0x47')][_0x946d('0x8b')]){_0x56b9b9[_0x946d('0x80')]=_[_0x946d('0xb5')](_0x56b9b9[_0x946d('0x80')],{'$or':_[_0x946d('0x3b')](_0x56b9b9['attributes'],function(_0x45e74f){var _0x5d3463={};_0x5d3463[_0x45e74f]={'$like':'%'+_0x36d7b8['query'][_0x946d('0x8b')]+'%'};return _0x5d3463;})});}_0x56b9b9[_0x946d('0x80')][_0x946d('0xdd')]=![];if(_0x36d7b8[_0x946d('0x47')]['id']){_0x56b9b9[_0x946d('0x80')]['id']={'$gt':_0x36d7b8[_0x946d('0x47')]['id']};}_0x56b9b9=_[_0x946d('0xb5')]({},_0x56b9b9,_0x36d7b8[_0x946d('0xb6')]);return db[_0x946d('0xee')][_0x946d('0x2e')]({'where':_0x56b9b9['where']})[_0x946d('0x38')](function(_0x28306e){_0x319f18['count']=_0x28306e;_0x56b9b9[_0x946d('0xb4')]=[];if(_0x36d7b8[_0x946d('0x47')][_0x946d('0xf8')]){_0x56b9b9['include'][_0x946d('0xb0')]({'model':db[_0x946d('0x76')],'as':_0x946d('0x76'),'attributes':['id',_0x946d('0xd8'),'alias']});}if(_0x36d7b8[_0x946d('0x47')][_0x946d('0xf9')]){_0x56b9b9['include']=[{'all':!![]}];}return db['ChatMessage'][_0x946d('0xf5')](_0x56b9b9);})[_0x946d('0x38')](function(_0xb66008){_0x319f18['rows']=_0xb66008;return _0x319f18;});}})[_0x946d('0x38')](respondWithFilteredResult(_0x5deab1,_0x56b9b9))[_0x946d('0x40')](handleError(_0x5deab1,null));};exports['addTags']=function(_0x5144c3,_0x340c96,_0x5e8074){return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x5144c3['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x340c96,null))[_0x946d('0x38')](function(_0x3bbaf3){if(_0x3bbaf3){return _0x3bbaf3[_0x946d('0xfa')](_0x5144c3[_0x946d('0x79')][_0x946d('0xef')],_[_0x946d('0xf0')](_0x5144c3[_0x946d('0x79')],[_0x946d('0xef'),'id'])||{})['spread'](function(){return db[_0x946d('0x73')][_0x946d('0xf5')]({'attributes':['id',_0x946d('0x3a'),_0x946d('0xfb')],'where':{'id':_0x5144c3[_0x946d('0x79')][_0x946d('0xef')]}});})[_0x946d('0x38')](function(_0x4868a1){socket[_0x946d('0xfc')]('chatInteractionTags:save',{'id':Number(_0x5144c3['params']['id']),'tags':_0x4868a1||[]});return{'id':Number(_0x5144c3['params']['id']),'tags':_0x4868a1||[]};});}})[_0x946d('0x38')](respondWithResult(_0x340c96,null))[_0x946d('0x40')](handleError(_0x340c96,null));};exports[_0x946d('0xfd')]=function(_0x410b37,_0x423571,_0x1d7f4c){return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x410b37['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x423571,null))[_0x946d('0x38')](function(_0x31b7df){if(_0x31b7df){return _0x31b7df[_0x946d('0xfd')](_0x410b37[_0x946d('0x47')][_0x946d('0xef')]);}})[_0x946d('0x38')](respondWithStatusCode(_0x423571,null))[_0x946d('0x40')](handleError(_0x423571,null));};exports[_0x946d('0xfe')]=function(_0x85f7ae,_0x4d741f){var _0x53f9d3=moment()[_0x946d('0xff')]()[_0x946d('0x9e')]();var _0x12e9a=path[_0x946d('0xc9')](config[_0x946d('0x100')],_0x946d('0x101'),_0x946d('0x102'),_0x946d('0x103'));var _0x478431=path['join'](config[_0x946d('0x100')],'server','files','attachments');var _0x37b472=path[_0x946d('0xc9')](_0x12e9a,_0x53f9d3);var _0x9a63af=util[_0x946d('0xcc')](_0x946d('0x104'),_0x85f7ae[_0x946d('0xb3')]['id'],_0x53f9d3);var _0x2fa160=path[_0x946d('0xc9')](_0x12e9a,_0x9a63af);var _0x39d2c8=![];return db[_0x946d('0x41')]['find']({'where':{'id':_0x85f7ae[_0x946d('0xb3')]['id']},'include':[{'model':db[_0x946d('0xee')],'as':_0x946d('0xce'),'attributes':['id',_0x946d('0x79'),'createdAt',_0x946d('0xdc'),_0x946d('0xdd'),'read'],'include':[{'model':db[_0x946d('0x76')],'as':_0x946d('0x76'),'attributes':['id',_0x946d('0xd8')],'raw':!![]},{'model':db['CmContact'],'as':_0x946d('0x105'),'attributes':['id',_0x946d('0x106'),_0x946d('0x107')],'raw':!![]},{'model':db[_0x946d('0xc5')],'as':'Attachment','raw':!![]}]},{'model':db[_0x946d('0xcf')],'as':_0x946d('0x108'),'attributes':['id','name']},{'model':db[_0x946d('0x76')],'as':_0x946d('0x109'),'attributes':['id',_0x946d('0xd8')]}]})[_0x946d('0x38')](handleEntityNotFound(_0x4d741f,null))[_0x946d('0x38')](function(_0x1a6020){if(_0x1a6020){var _0x4507ef=_0x1a6020[_0x946d('0x10a')]({'plain':!![]});_0x39d2c8=!![];var _0x4b312f={'format':'A4','border':_0x946d('0x10b'),'header':{'height':_0x946d('0x10c'),'contents':{'first':_0x946d('0x10d')}},'footer':{'height':_0x946d('0x10e'),'contents':{'default':util[_0x946d('0xcc')](_0x946d('0x10f'),util[_0x946d('0xcc')](_0x946d('0x110'),'Chat',_0x4507ef['id']),moment()[_0x946d('0xcc')](_0x946d('0x111'))[_0x946d('0x9e')]())}}};fs[_0x946d('0x112')](_0x37b472);var _0x136526={'channel':'Chat','account':_0x4507ef[_0x946d('0x108')][_0x946d('0x3a')],'agent':_0x4507ef[_0x946d('0x109')]?_0x4507ef[_0x946d('0x109')][_0x946d('0xd8')]:_0x946d('0x113'),'createdAt':moment(_0x4507ef['createdAt'])['format'](_0x946d('0xf4'))[_0x946d('0x9e')](),'closedAt':_0x4507ef[_0x946d('0xbd')]?moment(_0x4507ef[_0x946d('0x114')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x946d('0x9e')]():'','disposition':_0x4507ef[_0x946d('0x115')],'chatInfo':{'browser':_0x4507ef[_0x946d('0x116')],'os':_0x4507ef[_0x946d('0x117')],'referer':_0x4507ef[_0x946d('0x118')],'customerIp':_0x4507ef[_0x946d('0x119')],'customerPort':_0x4507ef[_0x946d('0x11a')]?_0x4507ef[_0x946d('0x11a')]:_0x946d('0x113')},'messages':_(_0x4507ef[_0x946d('0xce')])[_0x946d('0x11b')]()['filter']({'secret':![]})[_0x946d('0x3b')](function(_0x5e738a){if(_0x5e738a['Attachment']){var _0x513af4=path[_0x946d('0xc9')](_0x478431,_0x5e738a[_0x946d('0xc5')][_0x946d('0xc1')]);if(fs[_0x946d('0x11c')](_0x513af4)){fs[_0x946d('0x11d')](_0x513af4)[_0x946d('0x11e')](fs[_0x946d('0x11f')](path['join'](_0x37b472,_0x5e738a[_0x946d('0xc5')]['basename'])));}}return{'date':moment(_0x5e738a[_0x946d('0x82')])[_0x946d('0xcc')](_0x946d('0xf4'))[_0x946d('0x9e')](),'sender':_0x5e738a['direction']===_0x946d('0x120')?_0x5e738a[_0x946d('0x76')]?_0x5e738a['User']['fullname']:_0x946d('0xd3'):_0x5e738a[_0x946d('0x105')][_0x946d('0x106')]+(_0x5e738a[_0x946d('0x105')]['lastName']?'\x20'+_0x5e738a[_0x946d('0x105')]['lastName']:''),'body':_0x5e738a[_0x946d('0xc5')]?_0x5e738a['Attachment']['basename']:_0x5e738a['body'],'direction':_0x5e738a[_0x946d('0xdc')]===_0x946d('0x120')?'A':'C','secret':_0x5e738a[_0x946d('0xdd')],'read':_0x5e738a[_0x946d('0x86')],'attachment':_0x5e738a['Attachment']};})[_0x946d('0x69')]()};return ejs[_0x946d('0x121')](path[_0x946d('0xc9')](config['root'],_0x946d('0x101'),'views','downloadInteraction.html'),{'interaction':_0x136526})['then'](function(_0x5db0f6){return new BPromise(function(_0x412f0c,_0x4a3ec7){pdf[_0x946d('0xb7')](_0x5db0f6,_0x4b312f)[_0x946d('0x122')](path[_0x946d('0xc9')](_0x37b472,'transcript-'+_0x4507ef['id']+'-'+_0x53f9d3+_0x946d('0x123')),function(_0x11a871,_0xc4ae9b){if(_0x11a871)return _0x4a3ec7(_0x11a871);_0x412f0c(_0xc4ae9b);});});});}})[_0x946d('0x38')](function(){if(_0x39d2c8){return new BPromise(function(_0x5d8cda,_0x1b1db7){zipdir(_0x37b472,{'saveTo':_0x2fa160},function(_0x24eda8,_0x529848){if(_0x24eda8)return _0x1b1db7(_0x24eda8);return _0x5d8cda(_0x529848);});})[_0x946d('0x38')](function(){return new BPromise(function(_0x6ddc1d,_0x20e814){rimraf(_0x37b472,function(_0x57872e){if(_0x57872e)_0x20e814(_0x57872e);return _0x6ddc1d();});});})['then'](function(){return _0x4d741f[_0x946d('0xfe')](_0x2fa160,_0x9a63af,function(_0x4007d0){if(_0x4007d0){console[_0x946d('0x124')](_0x946d('0x125'),_0x4007d0);}else{fs[_0x946d('0x126')](_0x2fa160);}});});}else{return _0x4d741f[_0x946d('0x2b')](0xc8);}})[_0x946d('0x40')](handleError(_0x4d741f,null));}; \ No newline at end of file +var _0x8dbf=['find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','start','body','some','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','count','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','rows','show','params','includeAll','include','merge','options','create','destroy','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','findOne','Unauthorized','attachId','download','join','root','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','User','ChatWebsite','CmContact','Messages','System','%s%d','Visitor','agentAlias','agent_alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','sort','getMyMessages','includeAgent','push','alias','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','fullname','firstName','Account','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','referer','customerPort','tail','existsSync','createReadStream','out','lastName','renderFile','views','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','Content-Range','apply','reject','update','then','stack','name','send','Users','map','TagIds','Tags','split','forEach','index','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions'];(function(_0xb4e517,_0x54ddb8){var _0x28ba2e=function(_0x280a76){while(--_0x280a76){_0xb4e517['push'](_0xb4e517['shift']());}};_0x28ba2e(++_0x54ddb8);}(_0x8dbf,0xbb));var _0xf8db=function(_0x3dc29e,_0x6a5478){_0x3dc29e=_0x3dc29e-0x0;var _0x2ca6a9=_0x8dbf[_0x3dc29e];return _0x2ca6a9;};'use strict';var pdf=require(_0xf8db('0x0'));var emlformat=require(_0xf8db('0x1'));var rimraf=require(_0xf8db('0x2'));var zipdir=require(_0xf8db('0x3'));var jsonpatch=require(_0xf8db('0x4'));var rp=require(_0xf8db('0x5'));var moment=require(_0xf8db('0x6'));var BPromise=require(_0xf8db('0x7'));var Mustache=require(_0xf8db('0x8'));var util=require(_0xf8db('0x9'));var path=require(_0xf8db('0xa'));var sox=require(_0xf8db('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf8db('0xc'));var squel=require(_0xf8db('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf8db('0xe'));var toCsv=require(_0xf8db('0xf'));var querystring=require(_0xf8db('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8db('0x11'));var logger=require(_0xf8db('0x12'))(_0xf8db('0x13'));var utils=require(_0xf8db('0x14'));var config=require(_0xf8db('0x15'));var db=require(_0xf8db('0x16'))['db'];config[_0xf8db('0x17')]=_[_0xf8db('0x18')](config[_0xf8db('0x17')],{'host':_0xf8db('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8db('0x17')]));require(_0xf8db('0x1a'))[_0xf8db('0x1b')](socket);var jayson=require(_0xf8db('0x1c'));var client=jayson[_0xf8db('0x1d')][_0xf8db('0x1e')]({'port':0x232b});var client9004=jayson[_0xf8db('0x1d')][_0xf8db('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x2d8c96,_0x372664,_0x439ad0){if(_0x439ad0){var _0xd7f584=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd7f584[_0xf8db('0x1f')](_0x372664)){return _0x2d8c96;}else{throw new db[(_0xf8db('0x20'))][(_0xf8db('0x21'))](_0xf8db('0x22'));}}else{return _0x2d8c96;}}function respondWithRpcPromise(_0x42a3e7,_0x44adc0,_0x1ba85e,_0x5a54c4){return new BPromise(function(_0xa96f17,_0x5764e5){var _0x14c2f5=_0x5a54c4||client;return _0x14c2f5[_0xf8db('0x23')](_0x42a3e7,_0x1ba85e)['then'](function(_0x5cbebb){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x44adc0,'request\x20sent');logger[_0xf8db('0x24')](_0xf8db('0x25'),_0x44adc0,_0xf8db('0x26'),JSON['stringify'](_0x5cbebb));if(_0x5cbebb['error']){if(_0x5cbebb['error'][_0xf8db('0x27')]===0x1f4){logger[_0xf8db('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x44adc0,_0x5cbebb[_0xf8db('0x28')][_0xf8db('0x29')]);return _0x5764e5(_0x5cbebb[_0xf8db('0x28')][_0xf8db('0x29')]);}logger[_0xf8db('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x44adc0,_0x5cbebb[_0xf8db('0x28')][_0xf8db('0x29')]);return _0xa96f17(_0x5cbebb['error'][_0xf8db('0x29')]);}else{logger[_0xf8db('0x2a')](_0xf8db('0x2b'),_0x44adc0,'request\x20sent');_0xa96f17(_0x5cbebb[_0xf8db('0x2c')]['message']);}})[_0xf8db('0x2d')](function(_0x1206d6){logger[_0xf8db('0x28')](_0xf8db('0x2b'),_0x44adc0,_0x1206d6);_0x5764e5(_0x1206d6);});});}function respondWithStatusCode(_0x25020a,_0xf5fb7){_0xf5fb7=_0xf5fb7||0xcc;return function(_0x795f7e){if(_0x795f7e){return _0x25020a[_0xf8db('0x2e')](_0xf5fb7);}return _0x25020a['status'](_0xf5fb7)[_0xf8db('0x2f')]();};}function respondWithResult(_0x24cc50,_0x4eb246){_0x4eb246=_0x4eb246||0xc8;return function(_0x5cc702){if(_0x5cc702){return _0x24cc50[_0xf8db('0x30')](_0x4eb246)[_0xf8db('0x31')](_0x5cc702);}};}function respondWithFilteredResult(_0x48f7d4,_0x503155){return function(_0x1cb244){if(_0x1cb244){var _0x546e3d=_0x1cb244['count'],_0x4b50b1=_0x503155[_0xf8db('0x32')],_0x398675=_0x503155['offset']+_0x503155['limit'],_0x468434;if(_0x398675>=_0x546e3d){_0x398675=_0x546e3d;_0x468434=0xc8;}else{_0x468434=0xce;}_0x48f7d4['status'](_0x468434);return _0x48f7d4['set'](_0xf8db('0x33'),_0x4b50b1+'-'+_0x398675+'/'+_0x546e3d)[_0xf8db('0x31')](_0x1cb244);}return null;};}function patchUpdates(_0x488b6c){return function(_0x4eb3ea){try{jsonpatch[_0xf8db('0x34')](_0x4eb3ea,_0x488b6c,!![]);}catch(_0x4b424c){return BPromise[_0xf8db('0x35')](_0x4b424c);}return _0x4eb3ea['save']();};}function saveUpdates(_0x11f3ad,_0x57e453){return function(_0x38fb45){if(_0x38fb45){return _0x38fb45[_0xf8db('0x36')](_0x11f3ad)['then'](function(_0xeccb95){return _0xeccb95;});}return null;};}function removeEntity(_0x5c3877,_0x13c30f){return function(_0x1e4142){if(_0x1e4142){return _0x1e4142['destroy']()[_0xf8db('0x37')](function(){_0x5c3877[_0xf8db('0x30')](0xcc)[_0xf8db('0x2f')]();});}};}function handleEntityNotFound(_0x122e34,_0x13ed1f){return function(_0x5c36e4){if(!_0x5c36e4){_0x122e34['sendStatus'](0x194);}return _0x5c36e4;};}function handleError(_0x402c91,_0x492398){_0x492398=_0x492398||0x1f4;return function(_0x403743){logger[_0xf8db('0x28')](_0x403743[_0xf8db('0x38')]);if(_0x403743[_0xf8db('0x39')]){delete _0x403743['name'];}_0x402c91[_0xf8db('0x30')](_0x492398)[_0xf8db('0x3a')](_0x403743);};}function getInteractionUsers(_0x18b35d,_0x774d4e){return new BPromise(function(_0x37b889,_0x871ece){try{if(_0x774d4e[_0x18b35d['id']]){_0x18b35d[_0xf8db('0x3b')]=_[_0xf8db('0x3c')](_0x774d4e[_0x18b35d['id']],function(_0x15ea63){return{'id':_0x15ea63['id']};});}}catch(_0x30f9e4){_0x871ece(_0x30f9e4);}_0x37b889(_0x18b35d);});}function getInteractionTags(_0x592119,_0x1aa1f9){return new BPromise(function(_0x188e26,_0x10dc97){try{if(_0x592119[_0xf8db('0x3d')]){_0x592119[_0xf8db('0x3e')]=[];_0x592119[_0xf8db('0x3d')][_0xf8db('0x3f')](',')[_0xf8db('0x40')](function(_0x1f4ae0){_0x592119['Tags']['push'](_0x1aa1f9[_0x1f4ae0]);});}delete _0x592119['TagIds'];}catch(_0x2bb395){_0x10dc97(_0x2bb395);}_0x188e26(_0x592119);});}function updateChatInteraction(_0x2621fa,_0x5cb7aa,_0xe89ac2){return new BPromise(function(_0x464d19,_0x43732b){return getInteractionUsers(_0x2621fa,_0xe89ac2)['then'](function(_0x123a7e){return getInteractionTags(_0x123a7e,_0x5cb7aa);})[_0xf8db('0x37')](function(_0x3b2f10){_0x464d19(_0x3b2f10);})['catch'](function(_0x30ce4f){_0x43732b(_0x30ce4f);});});}exports[_0xf8db('0x41')]=function(_0x4770c8,_0x36347d){var _0xa434e3={},_0x5419e6={},_0x510119={'count':0x0,'rows':[]};var _0x1a25a3=_[_0xf8db('0x3c')](db['ChatInteraction'][_0xf8db('0x42')],function(_0x31334c){return{'name':_0x31334c[_0xf8db('0x43')],'type':_0x31334c[_0xf8db('0x44')][_0xf8db('0x45')]};});_0x5419e6['model']=_[_0xf8db('0x3c')](_0x1a25a3,_0xf8db('0x39'));_0x5419e6[_0xf8db('0x46')]=_[_0xf8db('0x47')](_0x4770c8[_0xf8db('0x46')]);_0x5419e6[_0xf8db('0x48')]=_[_0xf8db('0x49')](_0x5419e6[_0xf8db('0x4a')],_0x5419e6[_0xf8db('0x46')]);_0xa434e3[_0xf8db('0x4b')]=_['intersection'](_0x5419e6[_0xf8db('0x4a')],qs[_0xf8db('0x4c')](_0x4770c8[_0xf8db('0x46')][_0xf8db('0x4c')]));_0xa434e3['attributes']=_0xa434e3[_0xf8db('0x4b')][_0xf8db('0x4d')]?_0xa434e3[_0xf8db('0x4b')]:_0x5419e6[_0xf8db('0x4a')];if(!_0x4770c8[_0xf8db('0x46')][_0xf8db('0x4e')](_0xf8db('0x4f'))){_0xa434e3[_0xf8db('0x50')]=qs[_0xf8db('0x50')](_0x4770c8[_0xf8db('0x46')][_0xf8db('0x50')]);_0xa434e3[_0xf8db('0x32')]=qs[_0xf8db('0x32')](_0x4770c8['query']['offset']);}_0xa434e3[_0xf8db('0x51')]=qs['sort'](_0x4770c8['query']['sort']);_0xa434e3[_0xf8db('0x52')]=qs['filters'](_[_0xf8db('0x53')](_0x4770c8[_0xf8db('0x46')],_0x5419e6[_0xf8db('0x48')]));var _0x25bcd4=[];var _0x517b37=squel[_0xf8db('0x54')]()['field']('id')['field'](_0xf8db('0x39'))[_0xf8db('0x55')](_0xf8db('0x56'))[_0xf8db('0x57')](_0xf8db('0x58'));var _0x558532=squel[_0xf8db('0x54')]()[_0xf8db('0x55')](_0xf8db('0x59'))[_0xf8db('0x55')](_0xf8db('0x5a'))[_0xf8db('0x57')](_0xf8db('0x5b'),'ui')[_0xf8db('0x5c')](_0xf8db('0x5d'),'u',_0xf8db('0x5e'));var _0x2a103e=squel[_0xf8db('0x54')]()[_0xf8db('0x57')](_0xf8db('0x5f'),'i')[_0xf8db('0x5c')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf8db('0x5c')](_0xf8db('0x5d'),'o',_0xf8db('0x60'))['left_join'](_0xf8db('0x61'),'a',_0xf8db('0x62'))['left_join'](_0xf8db('0x63'),'me',_0xf8db('0x64'))[_0xf8db('0x5c')](_0xf8db('0x65'),'it',_0xf8db('0x66'))[_0xf8db('0x5c')](_0xf8db('0x58'),'t','t.id\x20=\x20it.TagId');var _0x5dbbcc=squel['expr']();var _0x5b1459=[];var _0x1ffd58=squel[_0xf8db('0x67')]();var _0x4a38f6;if(_0x4770c8[_0xf8db('0x46')][_0xf8db('0x68')]){_0x4a38f6=as[_0xf8db('0x69')](_0x4770c8[_0xf8db('0x46')][_0xf8db('0x68')]);var _0x3fc018=_0x4a38f6[_0xf8db('0x6a')];for(var _0x3098d6=0x0;_0x3098d6<_0x4a38f6[_0xf8db('0x6b')]['length'];_0x3098d6++){var _0x244328=_0x4a38f6[_0xf8db('0x6b')][_0x3098d6];var _0x3b8b3e='i';var _0x1a9ca0=_[_0xf8db('0x6c')](_0x1a25a3,[_0xf8db('0x39'),_0x244328[_0xf8db('0x55')]]);if(!_0x1a9ca0){switch(_0x244328[_0xf8db('0x55')]){case _0xf8db('0x6d'):if(_0x244328[_0xf8db('0x6e')]==0x1){_0x2a103e[_0xf8db('0x6f')]('`'+_0x244328[_0xf8db('0x55')]+'`\x20=\x200');}else{_0x2a103e[_0xf8db('0x6f')]('`'+_0x244328['field']+_0xf8db('0x70'));}break;case _0xf8db('0x71'):if(_0x244328[_0xf8db('0x72')]==='$substring'){if(_0x244328['value'][_0xf8db('0x3f')]('\x20')[_0xf8db('0x4d')]>0x1){_0x5dbbcc[_0x3fc018](_0xf8db('0x73'),qs['getFullTextValue'](_0x244328['value']),null);}else{var _0x5e689e='%'+_0x244328[_0xf8db('0x6e')]+'%';_0x5dbbcc[_0x3fc018](_0xf8db('0x74'),_0x5e689e,_0x5e689e,_0x5e689e);}}else{_0x1a9ca0=_[_0xf8db('0x6c')](_0x1a25a3,[_0xf8db('0x39'),'ContactId']);_0x244328['field']=_0xf8db('0x75');_0x358ace=as[_0xf8db('0x76')](_0x3b8b3e,_0x1a9ca0['type'],_0x244328);_0x5dbbcc[_0x3fc018](_0x358ace['text'],_0x358ace[_0xf8db('0x6e')]['start'],_0x358ace[_0xf8db('0x6e')][_0xf8db('0x2f')]);}break;case _0xf8db('0x77'):var _0x1fb1e5=_0x244328['value'][_0xf8db('0x3f')](',')[_0xf8db('0x3c')](function(_0x303442){return Number(_0x303442);});_0x1fb1e5[_0xf8db('0x40')](function(_0x593d92){_0x1ffd58['or'](_0xf8db('0x78'),'%,'+_0x593d92+',%');});_0x5b1459=_[_0xf8db('0x79')](_0x5b1459,_0x1fb1e5);break;case'User':if(_0x244328[_0xf8db('0x72')]==='$substring'){_0x5dbbcc[_0x3fc018](_0xf8db('0x7a'),'%'+_0x244328[_0xf8db('0x6e')]+'%',null);}else{_0x1a9ca0=_['find'](_0x1a25a3,[_0xf8db('0x39'),_0xf8db('0x7b')]);_0x244328[_0xf8db('0x55')]=_0xf8db('0x7b');_0x358ace=as['buildExpression'](_0x3b8b3e,_0x1a9ca0[_0xf8db('0x44')],_0x244328);_0x5dbbcc[_0x3fc018](_0x358ace[_0xf8db('0x7c')],_0x358ace[_0xf8db('0x6e')][_0xf8db('0x7d')],_0x358ace[_0xf8db('0x6e')]['end']);}break;case _0xf8db('0x7e'):_0x358ace=as[_0xf8db('0x76')]('me',null,_0x244328);_0x5dbbcc[_0x3fc018](_0x358ace[_0xf8db('0x7c')],_0x358ace[_0xf8db('0x6e')][_0xf8db('0x7d')],_0x358ace[_0xf8db('0x6e')][_0xf8db('0x2f')]);break;}}else{var _0x358ace=as[_0xf8db('0x76')](_0x3b8b3e,_0x1a9ca0[_0xf8db('0x44')],_0x244328);_0x5dbbcc[_0x3fc018](_0x358ace[_0xf8db('0x7c')],_0x358ace[_0xf8db('0x6e')][_0xf8db('0x7d')],_0x358ace[_0xf8db('0x6e')]['end']);}}}else{var _0x5c5638=_(_0x4770c8[_0xf8db('0x46')])[_0xf8db('0x47')]()['map'](function(_0x557e4d){return _[_0xf8db('0x7f')](_0x1a25a3,[_0xf8db('0x39'),_0x557e4d])?_0x557e4d:undefined;})['compact']()[_0xf8db('0x6e')]();if(!_[_0xf8db('0x80')](_0x5c5638)){_0x5c5638[_0xf8db('0x40')](function(_0x8a4b62){if(_0x8a4b62===_0xf8db('0x81')){_0x2a103e[_0xf8db('0x52')]('i.ChatWebsiteId\x20IN\x20?',[][_0xf8db('0x82')](_0x4770c8[_0xf8db('0x46')][_0x8a4b62]));}else if(_0x8a4b62===_0xf8db('0x83')){var _0xf871bc=JSON[_0xf8db('0x84')](_0x4770c8[_0xf8db('0x46')][_0x8a4b62])[_0xf8db('0x85')];var _0x2da63c=JSON[_0xf8db('0x84')](_0x4770c8[_0xf8db('0x46')][_0x8a4b62])[_0xf8db('0x86')];_0x2a103e['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xf871bc,_0x2da63c);}else{if(_0x4770c8[_0xf8db('0x46')][_0x8a4b62]===_0xf8db('0x87')){_0x2a103e[_0xf8db('0x52')]('i.'+_0x8a4b62+_0xf8db('0x88'));}else{_0x2a103e['where']('i.'+_0x8a4b62+_0xf8db('0x89'),_0x4770c8['query'][_0x8a4b62]);}}});}if(_0x4770c8[_0xf8db('0x46')]['read']){if(_0x4770c8['query'][_0xf8db('0x8a')]==0x1){_0x2a103e['having']('`unreadMessages`\x20=\x200');}else{_0x2a103e['having'](_0xf8db('0x8b'));}}if(_0x4770c8[_0xf8db('0x46')][_0xf8db('0x8c')]){_0x5b1459=_[_0xf8db('0x8d')](_0x4770c8[_0xf8db('0x46')]['tag'])?_0x4770c8['query'][_0xf8db('0x8c')]:new Array(_0x4770c8[_0xf8db('0x46')][_0xf8db('0x8c')]);_0x5b1459[_0xf8db('0x40')](function(_0x4976d2){_0x1ffd58['or'](_0xf8db('0x78'),'%,'+_0x4976d2+',%');});}if(_0x4770c8[_0xf8db('0x46')][_0xf8db('0x8e')]){var _0x1ec9c4=_0x4770c8[_0xf8db('0x46')][_0xf8db('0x8e')][_0xf8db('0x8f')]('\x5c','\x5c\x5c')[_0xf8db('0x8f')]('\x27\x27',_0xf8db('0x90'));if(qs[_0xf8db('0x91')](_0x1ec9c4)){_0x5dbbcc['or'](_0xf8db('0x92'),_0x1ec9c4+'%');}else{_0x5dbbcc['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf8db('0x93')](_0x1ec9c4))['or'](_0xf8db('0x94'),_0x1ec9c4+'%');}}}_0x2a103e['where'](_0x5dbbcc);_0x2a103e[_0xf8db('0x95')](_0xf8db('0x96'));var _0x3a37c8={'type':db[_0xf8db('0x20')][_0xf8db('0x97')]['SELECT'],'raw':!![]};var _0x41ace4=_0x2a103e[_0xf8db('0x98')]();_0x41ace4[_0xf8db('0x55')](_0xf8db('0x96'));_0x41ace4[_0xf8db('0x55')](_0xf8db('0x99'),'unreadMessages');if(_0xa434e3['order']){_0xa434e3['order'][_0xf8db('0x40')](function(_0x5c8716){_0x2a103e[_0xf8db('0x51')]('i.'+_0x5c8716[0x0],_0x5c8716[0x1]===_0xf8db('0x9a')?![]:!![]);});}if(!_['isEmpty'](_0x5b1459)){_0x2a103e[_0xf8db('0x6f')](_0x1ffd58);_0x41ace4['where'](_0xf8db('0x9b'),_0x5b1459);}BPromise['resolve']()[_0xf8db('0x37')](function(){if(!_0x4a38f6&&_0x4770c8[_0xf8db('0x46')][_0xf8db('0x81')])return;return _0x4770c8['user'][_0xf8db('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9c0c26){if(_[_0xf8db('0x80')](_0x9c0c26)){_0x41ace4[_0xf8db('0x52')](_0xf8db('0x9d'));_0x2a103e[_0xf8db('0x52')](_0xf8db('0x9d'));}else{_0x41ace4['where'](_0xf8db('0x9e'),_[_0xf8db('0x3c')](_0x9c0c26,'id'));_0x2a103e['where']('i.ChatWebsiteId\x20IN\x20?',_[_0xf8db('0x3c')](_0x9c0c26,'id'));}});})[_0xf8db('0x37')](function(){db[_0xf8db('0x9f')][_0xf8db('0x46')](_0x41ace4[_0xf8db('0xa0')](),_0x3a37c8)[_0xf8db('0x37')](function(_0x25f03d){_0x510119['count']=_0x25f03d['length'];if(_0x510119[_0xf8db('0xa1')]===0x0)return[];return db[_0xf8db('0x9f')]['query'](_0x517b37['toString'](),_0x3a37c8)['then'](function(_0x3214b3){_0x25bcd4=_['keyBy'](_0x3214b3,'id');_0x3a37c8=_['merge'](_0x3a37c8,{'model':db[_0xf8db('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4770c8[_0xf8db('0x46')][_0xf8db('0x4c')]){_0xa434e3[_0xf8db('0x4b')]['forEach'](function(_0x1ee14f){_0x2a103e[_0xf8db('0x55')]('i.'+_0x1ee14f);});}else{_0x2a103e[_0xf8db('0x55')](_0xf8db('0x99'),_0xf8db('0x6d'));_0x2a103e['field'](_0xf8db('0xa3'),_0xf8db('0xa4'));_0x2a103e[_0xf8db('0x55')](_0xf8db('0xa5'),_0xf8db('0xa6'));_0x2a103e[_0xf8db('0x55')]('i.*');_0x2a103e[_0xf8db('0x55')](_0xf8db('0xa7'),'Contact.firstName');_0x2a103e['field'](_0xf8db('0xa8'),_0xf8db('0xa9'));_0x2a103e[_0xf8db('0x55')](_0xf8db('0xaa'),_0xf8db('0xab'));_0x2a103e[_0xf8db('0x55')](_0xf8db('0xac'),_0xf8db('0xad'));_0x2a103e[_0xf8db('0x55')](_0xf8db('0xae'),_0xf8db('0xaf'));_0x2a103e[_0xf8db('0x55')](_0xf8db('0xb0'),'Contact.fax');_0x2a103e[_0xf8db('0x55')](_0xf8db('0xb1'),_0xf8db('0x3d'));}_0x2a103e[_0xf8db('0x50')](_0xa434e3[_0xf8db('0x50')]);_0x2a103e[_0xf8db('0x32')](_0xa434e3[_0xf8db('0x32')]);return db[_0xf8db('0x9f')][_0xf8db('0x46')](_0x2a103e[_0xf8db('0xa0')](),_0x3a37c8);})[_0xf8db('0x37')](function(_0x31e1e7){_0x558532[_0xf8db('0x52')](_0xf8db('0xb2'),_[_0xf8db('0x3c')](_0x31e1e7,'id'));return db[_0xf8db('0x9f')][_0xf8db('0x46')](_0x558532[_0xf8db('0xa0')](),_0x3a37c8)['then'](function(_0x56adf7){var _0x47caa0=_['groupBy'](_0x56adf7,_0xf8db('0xb3'));var _0x11585a=[];_0x31e1e7[_0xf8db('0x40')](function(_0x4729e3){_0x11585a['push'](updateChatInteraction(_0x4729e3,_0x25bcd4,_0x47caa0));});return BPromise['all'](_0x11585a);});});})['then'](function(_0x5cabe8){_0x510119[_0xf8db('0xb4')]=_0x5cabe8;return _0x510119;})[_0xf8db('0x37')](respondWithFilteredResult(_0x36347d,_0xa434e3));})[_0xf8db('0x2d')](handleError(_0x36347d,null));};exports[_0xf8db('0xb5')]=function(_0x309dbe,_0x53c5b0){var _0x17ed84={'raw':![],'where':{'id':_0x309dbe[_0xf8db('0xb6')]['id']}},_0x17129e={};_0x17129e[_0xf8db('0x4a')]=_[_0xf8db('0x47')](db['ChatInteraction'][_0xf8db('0x42')]);_0x17129e[_0xf8db('0x46')]=_[_0xf8db('0x47')](_0x309dbe[_0xf8db('0x46')]);_0x17129e['filters']=_[_0xf8db('0x49')](_0x17129e[_0xf8db('0x4a')],_0x17129e[_0xf8db('0x46')]);_0x17ed84[_0xf8db('0x4b')]=_[_0xf8db('0x49')](_0x17129e[_0xf8db('0x4a')],qs[_0xf8db('0x4c')](_0x309dbe[_0xf8db('0x46')]['fields']));_0x17ed84[_0xf8db('0x4b')]=_0x17ed84[_0xf8db('0x4b')]['length']?_0x17ed84[_0xf8db('0x4b')]:_0x17129e['model'];if(_0x309dbe[_0xf8db('0x46')][_0xf8db('0xb7')]){_0x17ed84[_0xf8db('0xb8')]=[{'all':!![]}];}_0x17ed84=_[_0xf8db('0xb9')]({},_0x17ed84,_0x309dbe[_0xf8db('0xba')]);return db['ChatInteraction'][_0xf8db('0x6c')](_0x17ed84)[_0xf8db('0x37')](handleEntityNotFound(_0x53c5b0,null))[_0xf8db('0x37')](respondWithResult(_0x53c5b0,null))[_0xf8db('0x2d')](handleError(_0x53c5b0,null));};exports[_0xf8db('0xbb')]=function(_0xa4ca6d,_0x1a8045){return db[_0xf8db('0xa2')][_0xf8db('0xbb')](_0xa4ca6d[_0xf8db('0x7e')],{})[_0xf8db('0x37')](respondWithResult(_0x1a8045,0xc9))[_0xf8db('0x2d')](handleError(_0x1a8045,null));};exports[_0xf8db('0x36')]=function(_0x1f218d,_0x1592cc){if(_0x1f218d[_0xf8db('0x7e')]['id']){delete _0x1f218d['body']['id'];}return db[_0xf8db('0xa2')][_0xf8db('0x6c')]({'where':{'id':_0x1f218d[_0xf8db('0xb6')]['id']}})[_0xf8db('0x37')](handleEntityNotFound(_0x1592cc,null))['then'](saveUpdates(_0x1f218d[_0xf8db('0x7e')],null))[_0xf8db('0x37')](respondWithResult(_0x1592cc,null))[_0xf8db('0x2d')](handleError(_0x1592cc,null));};exports[_0xf8db('0xbc')]=function(_0x59ef27,_0x1f8bc9){return db[_0xf8db('0xa2')][_0xf8db('0x6c')]({'where':{'id':_0x59ef27[_0xf8db('0xb6')]['id']}})['then'](handleEntityNotFound(_0x1f8bc9,null))[_0xf8db('0x37')](removeEntity(_0x1f8bc9,null))['catch'](handleError(_0x1f8bc9,null));};exports[_0xf8db('0xbd')]=function(_0x54cd12,_0x4d5f7f){return db[_0xf8db('0xa2')][_0xf8db('0xbd')]()[_0xf8db('0x37')](respondWithResult(_0x4d5f7f,null))['catch'](handleError(_0x4d5f7f,null));};exports[_0xf8db('0xbe')]=function(_0xa9be08,_0x1f1dd5){if(_0xa9be08[_0xf8db('0x7e')]['id']){delete _0xa9be08[_0xf8db('0x7e')]['id'];}return db[_0xf8db('0xa2')][_0xf8db('0x6c')]({'where':{'id':_0xa9be08[_0xf8db('0xb6')]['id']}})[_0xf8db('0x37')](handleEntityNotFound(_0x1f1dd5,null))[_0xf8db('0x37')](saveUpdates(_0xa9be08['body'],null))[_0xf8db('0x37')](respondWithResult(_0x1f1dd5,null))[_0xf8db('0x2d')](handleError(_0x1f1dd5,null));};exports[_0xf8db('0xbf')]=function(_0xe0164d,_0x55ff61,_0xf66176){if(_0xe0164d[_0xf8db('0x7e')]['id']){delete _0xe0164d[_0xf8db('0x7e')]['id'];}return db['ChatInteraction'][_0xf8db('0x6c')]({'where':{'id':_0xe0164d['params']['id']}})[_0xf8db('0x37')](function(_0x5e3b34){if(!_0x5e3b34){logger['error'](_0xf8db('0xc0'),_0xf8db('0xbf'),0x194,_0xf8db('0xc1'));_0x55ff61['sendStatus'](0x194);}else{if(_0x5e3b34[_0xf8db('0x7b')]){throw new db[(_0xf8db('0x20'))][(_0xf8db('0x21'))]('Interaction\x20already\x20assigned');}}return _0x5e3b34;})[_0xf8db('0x37')](function(_0x333afb){if(_0x333afb){return _0x333afb['update']({'closed':_0xe0164d[_0xf8db('0x7e')][_0xf8db('0xc2')],'disposition':_0xe0164d['body']['disposition']})[_0xf8db('0x37')](function(_0x5246da){return _0x5246da;});}})[_0xf8db('0x37')](function(_0x8fa041){return respondWithRpcPromise(_0xf8db('0xc3'),_0xf8db('0xbf'),_0xe0164d['body'],client9004);})[_0xf8db('0x37')](respondWithResult(_0x55ff61,null))[_0xf8db('0x2d')](handleError(_0x55ff61,null));};exports[_0xf8db('0xc4')]=function(_0x52784d,_0x8bd44e,_0x168ef7){_0x52784d[_0xf8db('0x7e')][_0xf8db('0x39')]=_0x52784d[_0xf8db('0xc5')][_0xf8db('0xc6')];_0x52784d[_0xf8db('0x7e')][_0xf8db('0xc7')]=_0x52784d['file']['filename'];_0x52784d[_0xf8db('0x7e')]['type']=_0x52784d[_0xf8db('0xc5')][_0xf8db('0xc8')];return db[_0xf8db('0xc9')][_0xf8db('0xbb')](_0x52784d[_0xf8db('0x7e')])['then'](respondWithResult(_0x8bd44e,0xc9))['catch'](handleError(_0x8bd44e,null));};exports['attachmentDownload']=function(_0x3675ce,_0x3f39cd,_0x1888f4){return db[_0xf8db('0xa2')][_0xf8db('0xca')]({'where':{'id':_0x3675ce[_0xf8db('0xb6')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3f39cd,null))[_0xf8db('0x37')](function(_0xa00f75){if(_0xa00f75){if(_0xa00f75[_0xf8db('0xc2')]){return _0x3f39cd[_0xf8db('0x30')](0x193)[_0xf8db('0x31')]({'status':0x193,'message':_0xf8db('0xcb')});}return db['Attachment']['findOne']({'where':{'id':_0x3675ce[_0xf8db('0x46')][_0xf8db('0xcc')]},'raw':!![]})[_0xf8db('0x37')](handleEntityNotFound(_0x3f39cd,null));}})[_0xf8db('0x37')](function(_0x3e195d){if(_0x3e195d){return _0x3f39cd[_0xf8db('0xcd')](path[_0xf8db('0xce')](config[_0xf8db('0xcf')],'server/files/attachments/',_0x3e195d[_0xf8db('0xc7')]));}})[_0xf8db('0x2d')](handleError(_0x3f39cd,null));};exports[_0xf8db('0xd0')]=function(_0x623b04,_0xa43747){var _0xef9376=null;var _0xed240e=null;var _0x4fc9bc=null;var _0x257d28=null;if(_0x623b04[_0xf8db('0x7e')]['id']){delete _0x623b04['body']['id'];}if(_0x623b04[_0xf8db('0x7e')][_0xf8db('0xd1')]){_0x257d28=path[_0xf8db('0xce')](config[_0xf8db('0xcf')],_0xf8db('0xd2'),util[_0xf8db('0xd3')](_0xf8db('0xd4'),Date[_0xf8db('0xd5')]()));_0x623b04[_0xf8db('0x7e')][_0xf8db('0xd6')]=_0x257d28;}return db[_0xf8db('0xa2')][_0xf8db('0x6c')]({'where':{'id':_0x623b04[_0xf8db('0xb6')]['id']},'include':[{'model':db[_0xf8db('0xd7')],'as':'Messages','include':[{'model':db[_0xf8db('0xd8')],'as':'User'}]}]})[_0xf8db('0x37')](handleEntityNotFound(_0xa43747,null))[_0xf8db('0x37')](saveUpdates(_0x623b04[_0xf8db('0x7e')],null))[_0xf8db('0x37')](function(_0x5b4933){if(_0x5b4933){_0xef9376=_0x5b4933;return db[_0xf8db('0xd9')]['find']({'where':{'id':_0xef9376[_0xf8db('0x81')]}});}})['then'](function(_0x34ee5a){if(_0x34ee5a){_0x4fc9bc=_0x34ee5a;return db[_0xf8db('0xda')][_0xf8db('0x6c')]({'where':{'id':_0xef9376[_0xf8db('0x75')]}});}})[_0xf8db('0x37')](function(_0xfe3101){if(_0xfe3101){_0xed240e=_0xfe3101;if(_0x257d28){var _0x34f77d=null;for(var _0x5d5610=0x1;_0x5d5610<_0xef9376[_0xf8db('0xdb')][_0xf8db('0x4d')];++_0x5d5610){_0x34f77d=_0xef9376[_0xf8db('0xdb')][_0x5d5610];var _0x154ebb=_0x34f77d[_0xf8db('0x7b')]?util[_0xf8db('0xd3')]('%s%d',_0x4fc9bc['agentAlias'],_0x34f77d[_0xf8db('0x7b')]):_0xf8db('0xdc');var _0x4bc89d=_0x623b04[_0xf8db('0x7e')]['customer']||util[_0xf8db('0xd3')](_0xf8db('0xdd'),_0xf8db('0xde'),_0x34f77d[_0xf8db('0x75')]);switch(_0x4fc9bc['agentIdentifier']){case'website_alias':_0x154ebb=_0x34f77d['UserId']?util[_0xf8db('0xd3')]('%s%d',_0x4fc9bc[_0xf8db('0xdf')],_0x34f77d[_0xf8db('0x7b')]):_0xf8db('0xdc');break;case _0xf8db('0xe0'):_0x154ebb=_0x34f77d[_0xf8db('0x7b')]?_0x34f77d[_0xf8db('0xd8')]['alias']||_0x34f77d[_0xf8db('0xd8')]['fullname']:'System';break;case'agent_fullname':_0x154ebb=_0x34f77d[_0xf8db('0x7b')]?_0x34f77d[_0xf8db('0xd8')]['fullname']:'System';break;default:_0x154ebb=_0x34f77d[_0xf8db('0x7b')]?util[_0xf8db('0xd3')](_0xf8db('0xdd'),_0x4fc9bc[_0xf8db('0xdf')],_0x34f77d['UserId']):_0xf8db('0xdc');}var _0x1c6409=util[_0xf8db('0xd3')](_0xf8db('0xe1'),moment(_0x34f77d[_0xf8db('0x83')])[_0xf8db('0xd3')](_0xf8db('0xe2')),_0x34f77d[_0xf8db('0xe3')]==='in'?_0x4bc89d:_0x154ebb,_0x34f77d[_0xf8db('0x7e')]);if(!_0x34f77d[_0xf8db('0xe4')]){fs['appendFileSync'](_0x257d28,_0x1c6409);}}return db[_0xf8db('0xe5')][_0xf8db('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0xf8db('0xe6')],'as':_0xf8db('0xe7'),'raw':!![]}]});}}})[_0xf8db('0x37')](function(_0x3e7c39){if(_0x3e7c39&&_0x3e7c39[_0xf8db('0xe7')]&&_0x623b04[_0xf8db('0x7e')]){var _0x21b352={'tls':{'rejectUnauthorized':![]}};if(_0x3e7c39[_0xf8db('0xe7')]['service']){_0x21b352[_0xf8db('0xe8')]=_0x3e7c39[_0xf8db('0xe7')][_0xf8db('0xe8')];}else{_0x21b352['host']=_0x3e7c39[_0xf8db('0xe7')][_0xf8db('0xe9')];_0x21b352[_0xf8db('0xea')]=_0x3e7c39[_0xf8db('0xe7')][_0xf8db('0xea')];_0x21b352[_0xf8db('0xeb')]=_0x3e7c39[_0xf8db('0xe7')][_0xf8db('0xeb')];}if(_0x3e7c39[_0xf8db('0xe7')]['authentication']){_0x21b352[_0xf8db('0xec')]={'user':_0x3e7c39[_0xf8db('0xe7')][_0xf8db('0xed')],'pass':_0x3e7c39[_0xf8db('0xe7')][_0xf8db('0xee')]};}return respondWithRpcPromise(_0xf8db('0xef'),_0xf8db('0xf0'),{'account':_0x21b352,'message':{'from':util[_0xf8db('0xd3')](_0xf8db('0xf1'),_0x3e7c39[_0xf8db('0x39')],_0x3e7c39[_0xf8db('0xf2')]||_0x3e7c39['Smtp'][_0xf8db('0xed')]),'to':_0x623b04[_0xf8db('0x7e')][_0xf8db('0xd1')],'subject':_0xf8db('0xf3'),'text':util[_0xf8db('0xd3')](_0xf8db('0xf4'),_0x623b04[_0xf8db('0x7e')][_0xf8db('0xd1')]),'attachments':[{'path':_0x257d28}]}})[_0xf8db('0x37')](function(){return _0xef9376;})['catch'](function(_0x50aa4a){console['error'](_0x50aa4a);});}else{return _0xef9376;}})[_0xf8db('0x37')](respondWithStatusCode(_0xa43747,0xc8))[_0xf8db('0x2d')](handleError(_0xa43747,null));};exports[_0xf8db('0xf5')]=function(_0x42d967,_0x5868bc,_0x344914){return db['ChatMessage'][_0xf8db('0x6c')]({'where':{'id':_0x42d967['params']['id']}})[_0xf8db('0x37')](handleEntityNotFound(_0x5868bc,null))[_0xf8db('0x37')](function(_0x4ef7d8){if(_0x4ef7d8){return _0x4ef7d8[_0xf8db('0xf5')](_0x42d967[_0xf8db('0x7e')]['ids'],_[_0xf8db('0xf6')](_0x42d967[_0xf8db('0x7e')],[_0xf8db('0xf7'),'id'])||{});}})['then'](respondWithResult(_0x5868bc,null))[_0xf8db('0x2d')](handleError(_0x5868bc,null));};exports[_0xf8db('0xf8')]=function(_0x354396,_0x1ae8fc,_0x1869c3){var _0x57c74e={'raw':![],'where':{}};var _0x5878e8={};var _0x4d1678={'count':0x0,'rows':[]};return db[_0xf8db('0xa2')][_0xf8db('0xca')]({'where':{'id':_0x354396[_0xf8db('0xb6')]['id']}})[_0xf8db('0x37')](handleEntityNotFound(_0x1ae8fc,null))[_0xf8db('0x37')](function(_0x570ad0){if(_0x570ad0){_0x5878e8['model']=_[_0xf8db('0x47')](db[_0xf8db('0xd7')]['rawAttributes']);_0x5878e8[_0xf8db('0x46')]=_[_0xf8db('0x47')](_0x354396[_0xf8db('0x46')]);_0x5878e8[_0xf8db('0x48')]=_['intersection'](_0x5878e8[_0xf8db('0x4a')],_0x5878e8[_0xf8db('0x46')]);_0x57c74e[_0xf8db('0x4b')]=_['intersection'](_0x5878e8['model'],qs['fields'](_0x354396['query']['fields']));_0x57c74e['attributes']=_0x57c74e[_0xf8db('0x4b')][_0xf8db('0x4d')]?_0x57c74e[_0xf8db('0x4b')]:_0x5878e8[_0xf8db('0x4a')];if(!_0x354396[_0xf8db('0x46')][_0xf8db('0x4e')](_0xf8db('0x4f'))){_0x57c74e[_0xf8db('0x50')]=qs[_0xf8db('0x50')](_0x354396[_0xf8db('0x46')][_0xf8db('0x50')]);_0x57c74e[_0xf8db('0x32')]=qs['offset'](_0x354396[_0xf8db('0x46')][_0xf8db('0x32')]);}_0x57c74e[_0xf8db('0x51')]=qs['sort'](_0x354396['query'][_0xf8db('0xf9')]);_0x57c74e['where']=qs[_0xf8db('0x48')](_[_0xf8db('0x53')](_0x354396[_0xf8db('0x46')],_0x5878e8[_0xf8db('0x48')]));_0x57c74e[_0xf8db('0x52')][_0xf8db('0xb3')]=_0x570ad0['id'];if(_0x354396[_0xf8db('0x46')]['filter']){_0x57c74e[_0xf8db('0x52')]=_[_0xf8db('0xb9')](_0x57c74e[_0xf8db('0x52')],{'$or':_['map'](_0x57c74e['attributes'],function(_0x4fe34d){var _0x1ab85e={};_0x1ab85e[_0x4fe34d]={'$like':'%'+_0x354396[_0xf8db('0x46')][_0xf8db('0x8e')]+'%'};return _0x1ab85e;})});}if(_0x354396[_0xf8db('0x46')][_0xf8db('0x85')]){var _0x3588df=_0x354396[_0xf8db('0x46')]['$gte'][_0xf8db('0x3f')](',');var _0x4e4ba2={};_0x4e4ba2[_0x3588df[0x0]]={'$gte':moment(_0x3588df[0x1])[_0xf8db('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x57c74e[_0xf8db('0x52')]=_[_0xf8db('0xb9')](_0x57c74e[_0xf8db('0x52')],_0x4e4ba2);}_0x57c74e=_[_0xf8db('0xb9')]({},_0x57c74e,_0x354396[_0xf8db('0xba')]);return db[_0xf8db('0xd7')][_0xf8db('0xa1')]({'where':_0x57c74e[_0xf8db('0x52')]})[_0xf8db('0x37')](function(_0x5efeed){_0x4d1678[_0xf8db('0xa1')]=_0x5efeed;if(_0x354396[_0xf8db('0x46')]['includeAll']){_0x57c74e[_0xf8db('0xb8')]=[{'all':!![]}];}return db[_0xf8db('0xd7')]['findAll'](_0x57c74e);})['then'](function(_0x15b11f){_0x4d1678[_0xf8db('0xb4')]=_0x15b11f;return _0x4d1678;});}})['then'](respondWithFilteredResult(_0x1ae8fc,_0x57c74e))[_0xf8db('0x2d')](handleError(_0x1ae8fc,null));};exports[_0xf8db('0xfa')]=function(_0x584881,_0x5cbd48,_0x2d33ea){var _0x3ba885={'where':{}},_0xf571da={},_0x1ec5f6={'count':0x0,'rows':[]};return db[_0xf8db('0xa2')][_0xf8db('0xca')]({'where':{'id':_0x584881[_0xf8db('0xb6')]['id']}})[_0xf8db('0x37')](handleEntityNotFound(_0x5cbd48,null))[_0xf8db('0x37')](function(_0x4b35df){if(_0x4b35df){_0xf571da['model']=_['keys'](db[_0xf8db('0xd7')][_0xf8db('0x42')]);_0xf571da[_0xf8db('0x46')]=_['keys'](_0x584881[_0xf8db('0x46')]);_0xf571da[_0xf8db('0x48')]=_[_0xf8db('0x49')](_0xf571da[_0xf8db('0x4a')],_0xf571da[_0xf8db('0x46')]);_0x3ba885[_0xf8db('0x4b')]=_[_0xf8db('0x49')](_0xf571da['model'],qs[_0xf8db('0x4c')](_0x584881[_0xf8db('0x46')]['fields']));_0x3ba885[_0xf8db('0x4b')]=_0x3ba885[_0xf8db('0x4b')][_0xf8db('0x4d')]?_0x3ba885[_0xf8db('0x4b')]:_0xf571da[_0xf8db('0x4a')];if(!_0x584881['query'][_0xf8db('0x4e')](_0xf8db('0x4f'))){_0x3ba885[_0xf8db('0x50')]=qs[_0xf8db('0x50')](_0x584881[_0xf8db('0x46')][_0xf8db('0x50')]);_0x3ba885[_0xf8db('0x32')]=qs[_0xf8db('0x32')](_0x584881[_0xf8db('0x46')][_0xf8db('0x32')]);}_0x3ba885[_0xf8db('0x51')]=qs['sort'](_0x584881[_0xf8db('0x46')]['sort']);_0x3ba885['where']=qs[_0xf8db('0x48')](_['pick'](_0x584881[_0xf8db('0x46')],_0xf571da[_0xf8db('0x48')]));_0x3ba885['where'][_0xf8db('0xb3')]=_0x4b35df['id'];if(_0x584881[_0xf8db('0x46')][_0xf8db('0x8e')]){_0x3ba885[_0xf8db('0x52')]=_[_0xf8db('0xb9')](_0x3ba885[_0xf8db('0x52')],{'$or':_[_0xf8db('0x3c')](_0x3ba885[_0xf8db('0x4b')],function(_0x4b5ac4){var _0x1a6949={};_0x1a6949[_0x4b5ac4]={'$like':'%'+_0x584881[_0xf8db('0x46')][_0xf8db('0x8e')]+'%'};return _0x1a6949;})});}_0x3ba885[_0xf8db('0x52')][_0xf8db('0xe4')]=![];if(_0x584881[_0xf8db('0x46')]['id']){_0x3ba885[_0xf8db('0x52')]['id']={'$gt':_0x584881['query']['id']};}_0x3ba885=_[_0xf8db('0xb9')]({},_0x3ba885,_0x584881[_0xf8db('0xba')]);return db[_0xf8db('0xd7')][_0xf8db('0xa1')]({'where':_0x3ba885[_0xf8db('0x52')]})['then'](function(_0x194876){_0x1ec5f6['count']=_0x194876;_0x3ba885[_0xf8db('0xb8')]=[];if(_0x584881[_0xf8db('0x46')][_0xf8db('0xfb')]){_0x3ba885['include'][_0xf8db('0xfc')]({'model':db[_0xf8db('0xd8')],'as':_0xf8db('0xd8'),'attributes':['id','fullname',_0xf8db('0xfd')]});}if(_0x584881[_0xf8db('0x46')][_0xf8db('0xb7')]){_0x3ba885[_0xf8db('0xb8')]=[{'all':!![]}];}return db[_0xf8db('0xd7')]['findAll'](_0x3ba885);})[_0xf8db('0x37')](function(_0x53035c){_0x1ec5f6['rows']=_0x53035c;return _0x1ec5f6;});}})[_0xf8db('0x37')](respondWithFilteredResult(_0x5cbd48,_0x3ba885))['catch'](handleError(_0x5cbd48,null));};exports[_0xf8db('0xfe')]=function(_0x3e3f45,_0x17174f,_0x463d9d){return db['ChatInteraction'][_0xf8db('0x6c')]({'where':{'id':_0x3e3f45[_0xf8db('0xb6')]['id']}})[_0xf8db('0x37')](handleEntityNotFound(_0x17174f,null))[_0xf8db('0x37')](function(_0x14c949){if(_0x14c949){return _0x14c949[_0xf8db('0xff')](_0x3e3f45[_0xf8db('0x7e')]['ids'],_[_0xf8db('0xf6')](_0x3e3f45[_0xf8db('0x7e')],[_0xf8db('0xf7'),'id'])||{})['spread'](function(){return db[_0xf8db('0x77')]['findAll']({'attributes':['id',_0xf8db('0x39'),_0xf8db('0x56')],'where':{'id':_0x3e3f45[_0xf8db('0x7e')]['ids']}});})[_0xf8db('0x37')](function(_0x3e7a3a){socket[_0xf8db('0x100')](_0xf8db('0x101'),{'id':Number(_0x3e3f45['params']['id']),'tags':_0x3e7a3a||[]});return{'id':Number(_0x3e3f45[_0xf8db('0xb6')]['id']),'tags':_0x3e7a3a||[]};});}})[_0xf8db('0x37')](respondWithResult(_0x17174f,null))[_0xf8db('0x2d')](handleError(_0x17174f,null));};exports[_0xf8db('0x102')]=function(_0x4d51e6,_0x593545,_0x1831fe){return db['ChatInteraction'][_0xf8db('0x6c')]({'where':{'id':_0x4d51e6[_0xf8db('0xb6')]['id']}})[_0xf8db('0x37')](handleEntityNotFound(_0x593545,null))[_0xf8db('0x37')](function(_0x4a8ec2){if(_0x4a8ec2){return _0x4a8ec2['removeTags'](_0x4d51e6[_0xf8db('0x46')][_0xf8db('0xf7')]);}})[_0xf8db('0x37')](respondWithStatusCode(_0x593545,null))[_0xf8db('0x2d')](handleError(_0x593545,null));};exports[_0xf8db('0xcd')]=function(_0x3ea5d3,_0x3b0fbc){var _0x226d86=moment()[_0xf8db('0x103')]()[_0xf8db('0xa0')]();var _0xed330d=path[_0xf8db('0xce')](config[_0xf8db('0xcf')],_0xf8db('0x104'),'files',_0xf8db('0x105'));var _0x42bceb=path[_0xf8db('0xce')](config['root'],_0xf8db('0x104'),_0xf8db('0x106'),_0xf8db('0x107'));var _0x26f01a=path['join'](_0xed330d,_0x226d86);var _0x2d7144=util[_0xf8db('0xd3')]('transcript-%d-%s.zip',_0x3ea5d3['params']['id'],_0x226d86);var _0x47c891=path[_0xf8db('0xce')](_0xed330d,_0x2d7144);var _0xd5b54b=![];return db[_0xf8db('0xa2')][_0xf8db('0x6c')]({'where':{'id':_0x3ea5d3[_0xf8db('0xb6')]['id']},'include':[{'model':db[_0xf8db('0xd7')],'as':_0xf8db('0xdb'),'attributes':['id',_0xf8db('0x7e'),_0xf8db('0x83'),_0xf8db('0xe3'),_0xf8db('0xe4'),_0xf8db('0x8a')],'include':[{'model':db[_0xf8db('0xd8')],'as':'User','attributes':['id',_0xf8db('0x108')],'raw':!![]},{'model':db['CmContact'],'as':_0xf8db('0x71'),'attributes':['id',_0xf8db('0x109'),'lastName'],'raw':!![]},{'model':db[_0xf8db('0xc9')],'as':'Attachment','raw':!![]}]},{'model':db[_0xf8db('0xd9')],'as':_0xf8db('0x10a'),'attributes':['id',_0xf8db('0x39')]},{'model':db[_0xf8db('0xd8')],'as':'Owner','attributes':['id',_0xf8db('0x108')]}]})[_0xf8db('0x37')](handleEntityNotFound(_0x3b0fbc,null))['then'](function(_0x1e6274){if(_0x1e6274){var _0x4e3ee3=_0x1e6274['get']({'plain':!![]});_0xd5b54b=!![];var _0x3c190d={'format':'A4','border':_0xf8db('0x10b'),'header':{'height':_0xf8db('0x10c'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0xf8db('0x10d'),'contents':{'default':util[_0xf8db('0xd3')](_0xf8db('0x10e'),util['format'](_0xf8db('0x10f'),_0xf8db('0x110'),_0x4e3ee3['id']),moment()[_0xf8db('0xd3')](_0xf8db('0x111'))[_0xf8db('0xa0')]())}}};fs[_0xf8db('0x112')](_0x26f01a);var _0x20360a={'channel':_0xf8db('0x110'),'account':_0x4e3ee3[_0xf8db('0x10a')][_0xf8db('0x39')],'agent':_0x4e3ee3[_0xf8db('0x113')]?_0x4e3ee3[_0xf8db('0x113')][_0xf8db('0x108')]:_0xf8db('0x114'),'createdAt':moment(_0x4e3ee3[_0xf8db('0x83')])[_0xf8db('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf8db('0xa0')](),'closedAt':_0x4e3ee3[_0xf8db('0xc2')]?moment(_0x4e3ee3[_0xf8db('0x115')])[_0xf8db('0xd3')](_0xf8db('0x116'))['toString']():'','disposition':_0x4e3ee3[_0xf8db('0x117')],'chatInfo':{'browser':_0x4e3ee3[_0xf8db('0x118')],'os':_0x4e3ee3['osName'],'referer':_0x4e3ee3[_0xf8db('0x119')],'customerIp':_0x4e3ee3['customerIp'],'customerPort':_0x4e3ee3[_0xf8db('0x11a')]?_0x4e3ee3[_0xf8db('0x11a')]:_0xf8db('0x114')},'messages':_(_0x4e3ee3['Messages'])[_0xf8db('0x11b')]()[_0xf8db('0x8e')]({'secret':![]})[_0xf8db('0x3c')](function(_0x4dd038){if(_0x4dd038[_0xf8db('0xc9')]){var _0x282222=path['join'](_0x42bceb,_0x4dd038[_0xf8db('0xc9')][_0xf8db('0xc7')]);if(fs[_0xf8db('0x11c')](_0x282222)){fs[_0xf8db('0x11d')](_0x282222)['pipe'](fs['createWriteStream'](path['join'](_0x26f01a,_0x4dd038[_0xf8db('0xc9')][_0xf8db('0xc7')])));}}return{'date':moment(_0x4dd038['createdAt'])[_0xf8db('0xd3')](_0xf8db('0x116'))[_0xf8db('0xa0')](),'sender':_0x4dd038[_0xf8db('0xe3')]===_0xf8db('0x11e')?_0x4dd038[_0xf8db('0xd8')]?_0x4dd038[_0xf8db('0xd8')][_0xf8db('0x108')]:'System':_0x4dd038['Contact'][_0xf8db('0x109')]+(_0x4dd038['Contact'][_0xf8db('0x11f')]?'\x20'+_0x4dd038['Contact'][_0xf8db('0x11f')]:''),'body':_0x4dd038[_0xf8db('0xc9')]?_0x4dd038[_0xf8db('0xc9')]['basename']:_0x4dd038[_0xf8db('0x7e')],'direction':_0x4dd038[_0xf8db('0xe3')]===_0xf8db('0x11e')?'A':'C','secret':_0x4dd038[_0xf8db('0xe4')],'read':_0x4dd038[_0xf8db('0x8a')],'attachment':_0x4dd038['Attachment']};})[_0xf8db('0x6e')]()};return ejs[_0xf8db('0x120')](path['join'](config[_0xf8db('0xcf')],'server',_0xf8db('0x121'),'downloadInteraction.html'),{'interaction':_0x20360a})[_0xf8db('0x37')](function(_0x1128df){return new BPromise(function(_0x2bcadf,_0x928547){pdf['create'](_0x1128df,_0x3c190d)['toFile'](path[_0xf8db('0xce')](_0x26f01a,_0xf8db('0x122')+_0x4e3ee3['id']+'-'+_0x226d86+_0xf8db('0x123')),function(_0x59a749,_0x96b7f1){if(_0x59a749)return _0x928547(_0x59a749);_0x2bcadf(_0x96b7f1);});});});}})[_0xf8db('0x37')](function(){if(_0xd5b54b){return new BPromise(function(_0x5c3519,_0x28af0c){zipdir(_0x26f01a,{'saveTo':_0x47c891},function(_0x1e0fa2,_0x4c627b){if(_0x1e0fa2)return _0x28af0c(_0x1e0fa2);return _0x5c3519(_0x4c627b);});})['then'](function(){return new BPromise(function(_0x3feca2,_0x3d8743){rimraf(_0x26f01a,function(_0x316400){if(_0x316400)_0x3d8743(_0x316400);return _0x3feca2();});});})[_0xf8db('0x37')](function(){return _0x3b0fbc[_0xf8db('0xcd')](_0x47c891,_0x2d7144,function(_0x496236){if(_0x496236){console[_0xf8db('0x124')](_0xf8db('0x125'),_0x496236);}else{fs[_0xf8db('0x126')](_0x47c891);}});});}else{return _0x3b0fbc['sendStatus'](0xc8);}})['catch'](handleError(_0x3b0fbc,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index cf579d3..79eaf72 100644 --- a/server/api/chatInteraction/chatInteraction.events.js +++ b/server/api/chatInteraction/chatInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0765=['hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','getUsers','Users','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x5e2402,_0x404843){var _0x585d45=function(_0xce932a){while(--_0xce932a){_0x5e2402['push'](_0x5e2402['shift']());}};_0x585d45(++_0x404843);}(_0x0765,0x11a));var _0x5076=function(_0x19cf95,_0xed2b58){_0x19cf95=_0x19cf95-0x0;var _0x38c2e0=_0x0765[_0x19cf95];return _0x38c2e0;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x5076('0x0'))['db'][_0x5076('0x1')];var ChatMessage=require(_0x5076('0x0'))['db'][_0x5076('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5076('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5dd098){return function(_0x5b3af9,_0x450777,_0x4527af){_0x5b3af9[_0x5076('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e97f3){_0x5b3af9['setDataValue'](_0x5076('0x5'),_0x3e97f3['map'](function(_0x4e678e){return{'id':_0x4e678e['id']};}));return ChatMessage[_0x5076('0x6')]({'where':{'ChatInteractionId':_0x5b3af9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4cd4a3){_0x5b3af9[_0x5076('0x7')](_0x5076('0x8'),_0x4cd4a3[_0x5076('0x9')]);ChatInteractionEvents[_0x5076('0xa')](_0x5dd098+':'+_0x5b3af9['id'],_0x5b3af9);ChatInteractionEvents[_0x5076('0xa')](_0x5dd098,_0x5b3af9);_0x4527af(null);})[_0x5076('0xb')](_0x4527af(null));};}for(var e in events){if(events[_0x5076('0xc')](e)){var event=events[e];ChatInteraction[_0x5076('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x7903=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x39eb38,_0x1e356b){var _0x57fd27=function(_0x494e5f){while(--_0x494e5f){_0x39eb38['push'](_0x39eb38['shift']());}};_0x57fd27(++_0x1e356b);}(_0x7903,0x84));var _0x3790=function(_0x287434,_0x3281a1){_0x287434=_0x287434-0x0;var _0xed7f90=_0x7903[_0x287434];return _0xed7f90;};'use strict';var EventEmitter=require(_0x3790('0x0'));var ChatInteraction=require(_0x3790('0x1'))['db'][_0x3790('0x2')];var ChatMessage=require(_0x3790('0x1'))['db'][_0x3790('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3790('0x4')](0x0);var events={'afterCreate':_0x3790('0x5'),'afterUpdate':_0x3790('0x6'),'afterDestroy':_0x3790('0x7')};function emitEvent(_0x2c307a){return function(_0x2d1623,_0x5b1660,_0x254150){_0x2d1623['getUsers']({'attributes':['id'],'raw':!![]})[_0x3790('0x8')](function(_0x404f7a){_0x2d1623[_0x3790('0x9')](_0x3790('0xa'),_0x404f7a[_0x3790('0xb')](function(_0x5dbba7){return{'id':_0x5dbba7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2d1623['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3790('0x8')](function(_0x13c73e){_0x2d1623[_0x3790('0x9')](_0x3790('0xc'),_0x13c73e[_0x3790('0xd')]);ChatInteractionEvents[_0x3790('0xe')](_0x2c307a+':'+_0x2d1623['id'],_0x2d1623);ChatInteractionEvents[_0x3790('0xe')](_0x2c307a,_0x2d1623);_0x254150(null);})[_0x3790('0xf')](_0x254150(null));};}for(var e in events){if(events[_0x3790('0x10')](e)){var event=events[e];ChatInteraction[_0x3790('0x11')](e,emitEvent(event));}}module[_0x3790('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 60c0216..3dd9414 100644 --- a/server/api/chatInteraction/chatInteraction.model.js +++ b/server/api/chatInteraction/chatInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5e0=['../../config/environment','define','ChatInteraction','chat_interactions','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3dd991,_0x4bef12){var _0x251609=function(_0x371481){while(--_0x371481){_0x3dd991['push'](_0x3dd991['shift']());}};_0x251609(++_0x4bef12);}(_0xb5e0,0xb3));var _0x0b5e=function(_0x3d90be,_0x14ee9d){_0x3d90be=_0x3d90be-0x0;var _0x179bc4=_0xb5e0[_0x3d90be];return _0x179bc4;};'use strict';var _=require(_0x0b5e('0x0'));var util=require(_0x0b5e('0x1'));var logger=require(_0x0b5e('0x2'))(_0x0b5e('0x3'));var moment=require(_0x0b5e('0x4'));var BPromise=require(_0x0b5e('0x5'));var rp=require(_0x0b5e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b5e('0x7'));var config=require(_0x0b5e('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x106743,_0x2df4a8){return _0x106743[_0x0b5e('0x9')](_0x0b5e('0xa'),attributes,{'tableName':_0x0b5e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30f267,_0x428513,_0xce40b0){if(_0x30f267[_0x0b5e('0xc')]('closed')){_0x30f267[_0x0b5e('0xd')]=moment()[_0x0b5e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0xce40b0(null,_0x30f267);}},'charset':_0x0b5e('0xf'),'collate':_0x0b5e('0x10')});}; \ No newline at end of file +var _0x6f04=['chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','api','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x523ae7,_0x5ddd9e){var _0x2f4399=function(_0x5815c5){while(--_0x5815c5){_0x523ae7['push'](_0x523ae7['shift']());}};_0x2f4399(++_0x5ddd9e);}(_0x6f04,0x106));var _0x46f0=function(_0x29c691,_0x245aee){_0x29c691=_0x29c691-0x0;var _0x335157=_0x6f04[_0x29c691];return _0x335157;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x46f0('0x0'));var moment=require('moment');var BPromise=require(_0x46f0('0x1'));var rp=require(_0x46f0('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46f0('0x3'));var config=require(_0x46f0('0x4'));var attributes=require(_0x46f0('0x5'));module[_0x46f0('0x6')]=function(_0x1d2bf8,_0x15cf3a){return _0x1d2bf8[_0x46f0('0x7')]('ChatInteraction',attributes,{'tableName':_0x46f0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28b16e,_0x368a51,_0x4003be){if(_0x28b16e[_0x46f0('0x9')](_0x46f0('0xa'))){_0x28b16e[_0x46f0('0xb')]=moment()[_0x46f0('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4003be(null,_0x28b16e);}},'charset':_0x46f0('0xd'),'collate':_0x46f0('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 926c5cf..d09cf34 100644 --- a/server/api/chatInteraction/chatInteraction.rpc.js +++ b/server/api/chatInteraction/chatInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc87=['socket.io-emitter','./chatInteraction.socket','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','info','AddTagsToChatInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x31d637,_0x55a9a7){var _0x493ae5=function(_0x441403){while(--_0x441403){_0x31d637['push'](_0x31d637['shift']());}};_0x493ae5(++_0x55a9a7);}(_0xcc87,0x12a));var _0x7cc8=function(_0x46ea69,_0x1c248f){_0x46ea69=_0x46ea69-0x0;var _0x10168a=_0xcc87[_0x46ea69];return _0x10168a;};'use strict';var _=require(_0x7cc8('0x0'));var util=require(_0x7cc8('0x1'));var moment=require(_0x7cc8('0x2'));var BPromise=require(_0x7cc8('0x3'));var rs=require(_0x7cc8('0x4'));var fs=require('fs');var Redis=require(_0x7cc8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cc8('0x6'));var logger=require(_0x7cc8('0x7'))(_0x7cc8('0x8'));var config=require(_0x7cc8('0x9'));var jayson=require(_0x7cc8('0xa'));var client=jayson[_0x7cc8('0xb')]['http']({'port':0x232a});config[_0x7cc8('0xc')]=_['defaults'](config[_0x7cc8('0xc')],{'host':_0x7cc8('0xd'),'port':0x18eb});var socket=require(_0x7cc8('0xe'))(new Redis(config['redis']));require(_0x7cc8('0xf'))['register'](socket);function respondWithRpcPromise(_0x20aa57,_0x2a7eb2,_0x4b3309){return new BPromise(function(_0x40cf15,_0xc46791){return client[_0x7cc8('0x10')](_0x20aa57,_0x4b3309)[_0x7cc8('0x11')](function(_0x45a4f2){logger['info'](_0x7cc8('0x12'),_0x2a7eb2,_0x7cc8('0x13'));logger[_0x7cc8('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2a7eb2,_0x7cc8('0x13'),JSON[_0x7cc8('0x15')](_0x45a4f2));if(_0x45a4f2[_0x7cc8('0x16')]){if(_0x45a4f2[_0x7cc8('0x16')]['code']===0x1f4){logger['error'](_0x7cc8('0x12'),_0x2a7eb2,_0x45a4f2[_0x7cc8('0x16')][_0x7cc8('0x17')]);return _0xc46791(_0x45a4f2[_0x7cc8('0x16')][_0x7cc8('0x17')]);}logger[_0x7cc8('0x16')](_0x7cc8('0x12'),_0x2a7eb2,_0x45a4f2['error'][_0x7cc8('0x17')]);return _0x40cf15(_0x45a4f2['error']['message']);}else{logger['info'](_0x7cc8('0x12'),_0x2a7eb2,_0x7cc8('0x13'));_0x40cf15(_0x45a4f2['result'][_0x7cc8('0x17')]);}})[_0x7cc8('0x18')](function(_0x4c6780){logger[_0x7cc8('0x16')](_0x7cc8('0x12'),_0x2a7eb2,_0x4c6780);_0xc46791(_0x4c6780);});});}exports[_0x7cc8('0x19')]=function(_0x51f4c1){var _0x871c7a=this;return new Promise(function(_0x4eaf75,_0x33bf3d){return db[_0x7cc8('0x1a')][_0x7cc8('0x1b')](_0x51f4c1[_0x7cc8('0x1c')],{'raw':_0x51f4c1['options']?_0x51f4c1[_0x7cc8('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51f4c1[_0x7cc8('0x1d')]?_0x51f4c1[_0x7cc8('0x1d')][_0x7cc8('0x1e')]||null:null,'attributes':_0x51f4c1[_0x7cc8('0x1d')]?_0x51f4c1['options'][_0x7cc8('0x1f')]||null:null,'limit':_0x51f4c1[_0x7cc8('0x1d')]?_0x51f4c1[_0x7cc8('0x1d')][_0x7cc8('0x20')]||null:null})[_0x7cc8('0x11')](function(_0x39ccf3){logger[_0x7cc8('0x21')](_0x7cc8('0x19'),_0x51f4c1);logger[_0x7cc8('0x14')](_0x7cc8('0x19'),_0x51f4c1,JSON[_0x7cc8('0x15')](_0x39ccf3));_0x4eaf75(_0x39ccf3);})[_0x7cc8('0x18')](function(_0x1c4e1e){logger[_0x7cc8('0x16')](_0x7cc8('0x19'),_0x1c4e1e['message'],_0x51f4c1);_0x33bf3d(_0x871c7a[_0x7cc8('0x16')](0x1f4,_0x1c4e1e['message']));});});};exports[_0x7cc8('0x22')]=function(_0xd73070){return new Promise(function(_0x69d546,_0x2cad8a){return db[_0x7cc8('0x1a')]['find']({'where':_0xd73070[_0x7cc8('0x1d')]?_0xd73070['options'][_0x7cc8('0x1e')]||null:null})['then'](function(_0x21306c){if(_0x21306c){return _0x21306c[_0x7cc8('0x23')](_0xd73070[_0x7cc8('0x1c')][_0x7cc8('0x24')],_['omit'](_0xd73070[_0x7cc8('0x1c')],[_0x7cc8('0x24'),'id'])||{});}})[_0x7cc8('0x25')](function(_0x4d7fb5){logger[_0x7cc8('0x21')](_0x7cc8('0x26'),_0xd73070);logger[_0x7cc8('0x14')](_0x7cc8('0x26'),_0xd73070,JSON['stringify'](_0x4d7fb5));_0x69d546(_0x4d7fb5);})['catch'](function(_0x10f069){logger[_0x7cc8('0x16')](_0x7cc8('0x26'),_0x10f069[_0x7cc8('0x17')],_0xd73070);_0x2cad8a(_this[_0x7cc8('0x16')](0x1f4,_0x10f069[_0x7cc8('0x17')]));});});}; \ No newline at end of file +var _0xaa61=['find','addTags','ids','omit','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit'];(function(_0x13c34e,_0x27d305){var _0x199370=function(_0x2bc091){while(--_0x2bc091){_0x13c34e['push'](_0x13c34e['shift']());}};_0x199370(++_0x27d305);}(_0xaa61,0x1b2));var _0x1aa6=function(_0x14a2de,_0xb6f4fa){_0x14a2de=_0x14a2de-0x0;var _0x5f2d6c=_0xaa61[_0x14a2de];return _0x5f2d6c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1aa6('0x0'));var BPromise=require(_0x1aa6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1aa6('0x2'));var db=require(_0x1aa6('0x3'))['db'];var utils=require(_0x1aa6('0x4'));var logger=require(_0x1aa6('0x5'))('rpc');var config=require(_0x1aa6('0x6'));var jayson=require(_0x1aa6('0x7'));var client=jayson[_0x1aa6('0x8')][_0x1aa6('0x9')]({'port':0x232a});config[_0x1aa6('0xa')]=_[_0x1aa6('0xb')](config[_0x1aa6('0xa')],{'host':_0x1aa6('0xc'),'port':0x18eb});var socket=require(_0x1aa6('0xd'))(new Redis(config[_0x1aa6('0xa')]));require(_0x1aa6('0xe'))[_0x1aa6('0xf')](socket);function respondWithRpcPromise(_0x1bc1a3,_0x4d6669,_0x2adadf){return new BPromise(function(_0x44173e,_0x4cdeef){return client['request'](_0x1bc1a3,_0x2adadf)[_0x1aa6('0x10')](function(_0x555b49){logger[_0x1aa6('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x4d6669,_0x1aa6('0x12'));logger[_0x1aa6('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4d6669,'request\x20sent',JSON[_0x1aa6('0x14')](_0x555b49));if(_0x555b49[_0x1aa6('0x15')]){if(_0x555b49['error'][_0x1aa6('0x16')]===0x1f4){logger[_0x1aa6('0x15')](_0x1aa6('0x17'),_0x4d6669,_0x555b49[_0x1aa6('0x15')][_0x1aa6('0x18')]);return _0x4cdeef(_0x555b49[_0x1aa6('0x15')]['message']);}logger['error'](_0x1aa6('0x17'),_0x4d6669,_0x555b49[_0x1aa6('0x15')]['message']);return _0x44173e(_0x555b49[_0x1aa6('0x15')]['message']);}else{logger[_0x1aa6('0x11')](_0x1aa6('0x17'),_0x4d6669,_0x1aa6('0x12'));_0x44173e(_0x555b49['result'][_0x1aa6('0x18')]);}})[_0x1aa6('0x19')](function(_0x535f3b){logger['error'](_0x1aa6('0x17'),_0x4d6669,_0x535f3b);_0x4cdeef(_0x535f3b);});});}exports[_0x1aa6('0x1a')]=function(_0x3bc2b0){var _0x5cc87b=this;return new Promise(function(_0x56616f,_0x3919f2){return db[_0x1aa6('0x1b')]['update'](_0x3bc2b0[_0x1aa6('0x1c')],{'raw':_0x3bc2b0[_0x1aa6('0x1d')]?_0x3bc2b0[_0x1aa6('0x1d')][_0x1aa6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bc2b0['options']?_0x3bc2b0[_0x1aa6('0x1d')][_0x1aa6('0x1f')]||null:null,'attributes':_0x3bc2b0[_0x1aa6('0x1d')]?_0x3bc2b0[_0x1aa6('0x1d')][_0x1aa6('0x20')]||null:null,'limit':_0x3bc2b0[_0x1aa6('0x1d')]?_0x3bc2b0[_0x1aa6('0x1d')][_0x1aa6('0x21')]||null:null})[_0x1aa6('0x10')](function(_0x490cd4){logger[_0x1aa6('0x11')](_0x1aa6('0x1a'),_0x3bc2b0);logger[_0x1aa6('0x13')](_0x1aa6('0x1a'),_0x3bc2b0,JSON[_0x1aa6('0x14')](_0x490cd4));_0x56616f(_0x490cd4);})[_0x1aa6('0x19')](function(_0x130735){logger[_0x1aa6('0x15')](_0x1aa6('0x1a'),_0x130735['message'],_0x3bc2b0);_0x3919f2(_0x5cc87b[_0x1aa6('0x15')](0x1f4,_0x130735[_0x1aa6('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x200e72){return new Promise(function(_0x270ed7,_0x362b70){return db[_0x1aa6('0x1b')][_0x1aa6('0x22')]({'where':_0x200e72[_0x1aa6('0x1d')]?_0x200e72[_0x1aa6('0x1d')][_0x1aa6('0x1f')]||null:null})[_0x1aa6('0x10')](function(_0x29b139){if(_0x29b139){return _0x29b139[_0x1aa6('0x23')](_0x200e72[_0x1aa6('0x1c')][_0x1aa6('0x24')],_[_0x1aa6('0x25')](_0x200e72[_0x1aa6('0x1c')],[_0x1aa6('0x24'),'id'])||{});}})['spread'](function(_0x3484fb){logger[_0x1aa6('0x11')](_0x1aa6('0x26'),_0x200e72);logger['debug'](_0x1aa6('0x26'),_0x200e72,JSON[_0x1aa6('0x14')](_0x3484fb));_0x270ed7(_0x3484fb);})[_0x1aa6('0x19')](function(_0x245bd6){logger['error'](_0x1aa6('0x26'),_0x245bd6[_0x1aa6('0x18')],_0x200e72);_0x362b70(_this[_0x1aa6('0x15')](0x1f4,_0x245bd6[_0x1aa6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 5ef454a..44613c9 100644 --- a/server/api/chatInteraction/chatInteraction.socket.js +++ b/server/api/chatInteraction/chatInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eb0=['length','./chatInteraction.events','save','remove','update','register'];(function(_0x44f9c0,_0x391085){var _0x241aa7=function(_0x369f23){while(--_0x369f23){_0x44f9c0['push'](_0x44f9c0['shift']());}};_0x241aa7(++_0x391085);}(_0x4eb0,0x1cf));var _0x04eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eb0[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x04eb('0x0'));var events=[_0x04eb('0x1'),_0x04eb('0x2'),_0x04eb('0x3')];function createListener(_0x3c259c,_0x4c00cf){return function(_0x15aa92){_0x4c00cf['emit'](_0x3c259c,_0x15aa92);};}function removeListener(_0xd042d2,_0x5423da){return function(){ChatInteractionEvents['removeListener'](_0xd042d2,_0x5423da);};}exports[_0x04eb('0x4')]=function(_0x435ebb){for(var _0x5163ea=0x0,_0x426e4f=events[_0x04eb('0x5')];_0x5163ea<_0x426e4f;_0x5163ea++){var _0x5beb9d=events[_0x5163ea];var _0x278213=createListener('chatInteraction:'+_0x5beb9d,_0x435ebb);ChatInteractionEvents['on'](_0x5beb9d,_0x278213);}}; \ No newline at end of file +var _0xf4d6=['register','chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener'];(function(_0x14dd26,_0x3cc881){var _0x4a7ab0=function(_0x15b151){while(--_0x15b151){_0x14dd26['push'](_0x14dd26['shift']());}};_0x4a7ab0(++_0x3cc881);}(_0xf4d6,0x1e5));var _0x6f4d=function(_0x416c08,_0x1a849a){_0x416c08=_0x416c08-0x0;var _0x32698f=_0xf4d6[_0x416c08];return _0x32698f;};'use strict';var ChatInteractionEvents=require(_0x6f4d('0x0'));var events=['save',_0x6f4d('0x1'),_0x6f4d('0x2')];function createListener(_0x4ab5e9,_0x278971){return function(_0x15b943){_0x278971[_0x6f4d('0x3')](_0x4ab5e9,_0x15b943);};}function removeListener(_0x4f7ace,_0x3e2055){return function(){ChatInteractionEvents[_0x6f4d('0x4')](_0x4f7ace,_0x3e2055);};}exports[_0x6f4d('0x5')]=function(_0x40c491){for(var _0x314974=0x0,_0x1ec908=events['length'];_0x314974<_0x1ec908;_0x314974++){var _0x54b064=events[_0x314974];var _0x27097e=createListener(_0x6f4d('0x6')+_0x54b064,_0x40c491);ChatInteractionEvents['on'](_0x54b064,_0x27097e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index b00107f..a6d9ec3 100644 --- a/server/api/chatInteraction/index.js +++ b/server/api/chatInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7689=['update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','diskStorage','join','format','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','tracked','chat','chatinteraction:addtags','put','chatinteraction:update'];(function(_0x144e98,_0x5233c0){var _0x1a9714=function(_0x1fd207){while(--_0x1fd207){_0x144e98['push'](_0x144e98['shift']());}};_0x1a9714(++_0x5233c0);}(_0x7689,0xf0));var _0x9768=function(_0x1f0dcb,_0x1bdb6e){_0x1f0dcb=_0x1f0dcb-0x0;var _0x576649=_0x7689[_0x1f0dcb];return _0x576649;};'use strict';var multer=require(_0x9768('0x0'));var util=require(_0x9768('0x1'));var path=require('path');var timeout=require(_0x9768('0x2'));var express=require(_0x9768('0x3'));var router=express[_0x9768('0x4')]();var auth=require(_0x9768('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9768('0x6'));var controller=require(_0x9768('0x7'));router[_0x9768('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x9768('0x9')](),controller['describe']);router[_0x9768('0x8')](_0x9768('0xa'),auth[_0x9768('0xb')](),controller[_0x9768('0xc')]);router[_0x9768('0x8')](_0x9768('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x9768('0xe')]);router['get']('/:id/messages',auth[_0x9768('0x9')](),controller[_0x9768('0xf')]);router['get'](_0x9768('0x10'),auth[_0x9768('0xb')](),controller[_0x9768('0x11')]);router['get'](_0x9768('0x12'),auth[_0x9768('0x9')](),controller[_0x9768('0x13')]);router[_0x9768('0x14')]('/',auth[_0x9768('0x9')](),controller['create']);var upload=multer({'storage':multer[_0x9768('0x15')]({'destination':function(_0x3f7dd9,_0x342f75,_0x2b84f6){_0x2b84f6(null,path[_0x9768('0x16')](config['root'],'server/files/attachments/'));},'filename':function(_0x263c31,_0x49a0f6,_0x45f2d1){_0x45f2d1(null,util[_0x9768('0x17')]('%s-%s',Date[_0x9768('0x18')](),_0x49a0f6[_0x9768('0x19')][_0x9768('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9768('0x14')](_0x9768('0x1b'),upload[_0x9768('0x1c')]('file'),controller[_0x9768('0x1d')]);router['post'](_0x9768('0x1e'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x9768('0x14')]('/:id/tags',auth[_0x9768('0x9')](),interaction[_0x9768('0x1f')](_0x9768('0x20'),_0x9768('0x21')),controller['addTags']);router[_0x9768('0x22')](_0x9768('0xa'),auth[_0x9768('0x9')](),interaction[_0x9768('0x1f')]('chat',_0x9768('0x23')),controller[_0x9768('0x24')]);router[_0x9768('0x22')]('/:id/custom_update',controller[_0x9768('0x25')]);router[_0x9768('0x22')](_0x9768('0x26'),auth[_0x9768('0xb')](),controller[_0x9768('0x27')]);router['put'](_0x9768('0x28'),controller[_0x9768('0x29')]);router['delete'](_0x9768('0xa'),auth[_0x9768('0x9')](),interaction['tracked']('chat',_0x9768('0x2a')),controller['destroy']);router[_0x9768('0x2b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x9768('0x2c')]);module[_0x9768('0x2d')]=router; \ No newline at end of file +var _0x9f59=['/:id/attachment_upload','single','file','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','delete','removeTags','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/attachment_download','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname'];(function(_0x1f0dc4,_0x40381b){var _0x1e8b3b=function(_0x302381){while(--_0x302381){_0x1f0dc4['push'](_0x1f0dc4['shift']());}};_0x1e8b3b(++_0x40381b);}(_0x9f59,0x77));var _0x99f5=function(_0x161414,_0x4d71eb){_0x161414=_0x161414-0x0;var _0x38be03=_0x9f59[_0x161414];return _0x38be03;};'use strict';var multer=require(_0x99f5('0x0'));var util=require(_0x99f5('0x1'));var path=require('path');var timeout=require(_0x99f5('0x2'));var express=require('express');var router=express[_0x99f5('0x3')]();var auth=require(_0x99f5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x99f5('0x5'));var controller=require(_0x99f5('0x6'));router[_0x99f5('0x7')]('/',auth[_0x99f5('0x8')](),controller[_0x99f5('0x9')]);router['get'](_0x99f5('0xa'),auth[_0x99f5('0x8')](),controller['describe']);router[_0x99f5('0x7')](_0x99f5('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x99f5('0xc')]);router['get'](_0x99f5('0xd'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x99f5('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x99f5('0xe')]);router['get'](_0x99f5('0xf'),auth[_0x99f5('0x10')](),controller[_0x99f5('0x11')]);router[_0x99f5('0x7')](_0x99f5('0x12'),auth['isAuthenticated'](),controller[_0x99f5('0x13')]);router[_0x99f5('0x14')]('/',auth[_0x99f5('0x8')](),controller['create']);var upload=multer({'storage':multer[_0x99f5('0x15')]({'destination':function(_0x113d3b,_0x294d84,_0x409217){_0x409217(null,path[_0x99f5('0x16')](config[_0x99f5('0x17')],_0x99f5('0x18')));},'filename':function(_0x34a30b,_0x1a04ba,_0x10b202){_0x10b202(null,util['format'](_0x99f5('0x19'),Date[_0x99f5('0x1a')](),_0x1a04ba[_0x99f5('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x99f5('0x14')](_0x99f5('0x1c'),upload[_0x99f5('0x1d')](_0x99f5('0x1e')),controller['attachmentUpload']);router['post'](_0x99f5('0x1f'),auth[_0x99f5('0x10')](),controller[_0x99f5('0x20')]);router[_0x99f5('0x14')](_0x99f5('0x21'),auth[_0x99f5('0x8')](),interaction[_0x99f5('0x22')](_0x99f5('0x23'),_0x99f5('0x24')),controller[_0x99f5('0x25')]);router[_0x99f5('0x26')](_0x99f5('0xb'),auth[_0x99f5('0x8')](),interaction[_0x99f5('0x22')](_0x99f5('0x23'),_0x99f5('0x27')),controller['update']);router['put'](_0x99f5('0x28'),controller[_0x99f5('0x29')]);router[_0x99f5('0x26')](_0x99f5('0x2a'),auth[_0x99f5('0x10')](),controller[_0x99f5('0x2b')]);router[_0x99f5('0x26')](_0x99f5('0x2c'),controller['close']);router['delete'](_0x99f5('0xb'),auth['isAuthenticated'](),interaction[_0x99f5('0x22')](_0x99f5('0x23'),_0x99f5('0x2d')),controller['destroy']);router[_0x99f5('0x2e')](_0x99f5('0x21'),auth[_0x99f5('0x8')](),controller[_0x99f5('0x2f')]);module[_0x99f5('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d56f981..441eef0 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x14961c,_0x19bf30){var _0x1716ef=function(_0x175d85){while(--_0x175d85){_0x14961c['push'](_0x14961c['shift']());}};_0x1716ef(++_0x19bf30);}(_0xda2d,0x102));var _0xdda2=function(_0x435107,_0x16e102){_0x435107=_0x435107-0x0;var _0x2bd587=_0xda2d[_0x435107];return _0x2bd587;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdda2('0x4')]}}; \ No newline at end of file +var _0xda2d=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x522647,_0x4d813c){var _0x1830c6=function(_0x287a10){while(--_0x287a10){_0x522647['push'](_0x522647['shift']());}};_0x1830c6(++_0x4d813c);}(_0xda2d,0x102));var _0xdda2=function(_0x55862b,_0x15d785){_0x55862b=_0x55862b-0x0;var _0x1e6fa3=_0xda2d[_0x55862b];return _0x1e6fa3;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdda2('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index c6d3c58..cba63d0 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.controller.js +++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4c8=['querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','error','stack','name','send','map','ChatInternalMessage','rawAttributes','type','model','intersection','query','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','keys','find','create','body','params','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','findAll','isEmpty','agent','push','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc4c8,0x198));var _0x8c4c=function(_0x305000,_0x14b995){_0x305000=_0x305000-0x0;var _0x2884b5=_0xc4c8[_0x305000];return _0x2884b5;};'use strict';var pdf=require(_0x8c4c('0x0'));var emlformat=require(_0x8c4c('0x1'));var rimraf=require(_0x8c4c('0x2'));var zipdir=require(_0x8c4c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c4c('0x4'));var moment=require('moment');var BPromise=require(_0x8c4c('0x5'));var Mustache=require('mustache');var util=require(_0x8c4c('0x6'));var path=require(_0x8c4c('0x7'));var sox=require(_0x8c4c('0x8'));var csv=require(_0x8c4c('0x9'));var ejs=require(_0x8c4c('0xa'));var fs=require('fs');var _=require(_0x8c4c('0xb'));var squel=require(_0x8c4c('0xc'));var crypto=require(_0x8c4c('0xd'));var jsforce=require(_0x8c4c('0xe'));var deskjs=require(_0x8c4c('0xf'));var toCsv=require(_0x8c4c('0x9'));var querystring=require(_0x8c4c('0x10'));var Papa=require(_0x8c4c('0x11'));var Redis=require(_0x8c4c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c4c('0x13'));var logger=require(_0x8c4c('0x14'))('api');var utils=require(_0x8c4c('0x15'));var config=require(_0x8c4c('0x16'));var db=require(_0x8c4c('0x17'))['db'];config[_0x8c4c('0x18')]=_[_0x8c4c('0x19')](config[_0x8c4c('0x18')],{'host':_0x8c4c('0x1a'),'port':0x18eb});var socket=require(_0x8c4c('0x1b'))(new Redis(config[_0x8c4c('0x18')]));require('./chatInternalMessage.socket')[_0x8c4c('0x1c')](socket);function respondWithStatusCode(_0x4b970b,_0x52039c){_0x52039c=_0x52039c||0xcc;return function(_0x2ae8d4){if(_0x2ae8d4){return _0x4b970b[_0x8c4c('0x1d')](_0x52039c);}return _0x4b970b[_0x8c4c('0x1e')](_0x52039c)[_0x8c4c('0x1f')]();};}function respondWithResult(_0x2e56fd,_0x4b750d){_0x4b750d=_0x4b750d||0xc8;return function(_0x2af9a7){if(_0x2af9a7){return _0x2e56fd[_0x8c4c('0x1e')](_0x4b750d)[_0x8c4c('0x20')](_0x2af9a7);}};}function respondWithFilteredResult(_0x31670c,_0x28beb9){return function(_0x339f4e){if(_0x339f4e){var _0x19c378=_0x339f4e[_0x8c4c('0x21')],_0x2f9f0c=_0x28beb9[_0x8c4c('0x22')],_0x621a8a=_0x28beb9[_0x8c4c('0x22')]+_0x28beb9[_0x8c4c('0x23')],_0x5cd5fa;if(_0x621a8a>=_0x19c378){_0x621a8a=_0x19c378;_0x5cd5fa=0xc8;}else{_0x5cd5fa=0xce;}_0x31670c[_0x8c4c('0x1e')](_0x5cd5fa);return _0x31670c[_0x8c4c('0x24')]('Content-Range',_0x2f9f0c+'-'+_0x621a8a+'/'+_0x19c378)[_0x8c4c('0x20')](_0x339f4e);}return null;};}function patchUpdates(_0x23a49a){return function(_0x51842a){try{jsonpatch[_0x8c4c('0x25')](_0x51842a,_0x23a49a,!![]);}catch(_0x2702b9){return BPromise[_0x8c4c('0x26')](_0x2702b9);}return _0x51842a[_0x8c4c('0x27')]();};}function saveUpdates(_0x41680f,_0x9abe01){return function(_0x3dd94b){if(_0x3dd94b){return _0x3dd94b[_0x8c4c('0x28')](_0x41680f)['then'](function(_0x1576da){return _0x1576da;});}return null;};}function removeEntity(_0x1ee62,_0x3add83){return function(_0x13c9d5){if(_0x13c9d5){return _0x13c9d5[_0x8c4c('0x29')]()['then'](function(){_0x1ee62[_0x8c4c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32171f,_0x1a87a8){return function(_0x36182d){if(!_0x36182d){_0x32171f[_0x8c4c('0x1d')](0x194);}return _0x36182d;};}function handleError(_0x6a0eae,_0x1cbc53){_0x1cbc53=_0x1cbc53||0x1f4;return function(_0x45b438){logger[_0x8c4c('0x2a')](_0x45b438[_0x8c4c('0x2b')]);if(_0x45b438[_0x8c4c('0x2c')]){delete _0x45b438[_0x8c4c('0x2c')];}_0x6a0eae[_0x8c4c('0x1e')](_0x1cbc53)[_0x8c4c('0x2d')](_0x45b438);};}exports['index']=function(_0x449b3a,_0x1bb6c6){var _0x53ceaf={},_0x5398dd={},_0x22d4d3={'count':0x0,'rows':[]};var _0x2fbc46=_[_0x8c4c('0x2e')](db[_0x8c4c('0x2f')][_0x8c4c('0x30')],function(_0xdcd9fd){return{'name':_0xdcd9fd['fieldName'],'type':_0xdcd9fd[_0x8c4c('0x31')]['key']};});_0x5398dd[_0x8c4c('0x32')]=_['map'](_0x2fbc46,_0x8c4c('0x2c'));_0x5398dd['query']=_['keys'](_0x449b3a['query']);_0x5398dd['filters']=_[_0x8c4c('0x33')](_0x5398dd['model'],_0x5398dd[_0x8c4c('0x34')]);_0x53ceaf[_0x8c4c('0x35')]=_[_0x8c4c('0x33')](_0x5398dd[_0x8c4c('0x32')],qs['fields'](_0x449b3a[_0x8c4c('0x34')][_0x8c4c('0x36')]));_0x53ceaf[_0x8c4c('0x35')]=_0x53ceaf[_0x8c4c('0x35')][_0x8c4c('0x37')]?_0x53ceaf[_0x8c4c('0x35')]:_0x5398dd['model'];if(!_0x449b3a[_0x8c4c('0x34')]['hasOwnProperty'](_0x8c4c('0x38'))){_0x53ceaf[_0x8c4c('0x23')]=qs[_0x8c4c('0x23')](_0x449b3a[_0x8c4c('0x34')]['limit']);_0x53ceaf[_0x8c4c('0x22')]=qs['offset'](_0x449b3a[_0x8c4c('0x34')][_0x8c4c('0x22')]);}_0x53ceaf['order']=qs[_0x8c4c('0x39')](_0x449b3a[_0x8c4c('0x34')][_0x8c4c('0x39')]);_0x53ceaf[_0x8c4c('0x3a')]=qs[_0x8c4c('0x3b')](_[_0x8c4c('0x3c')](_0x449b3a[_0x8c4c('0x34')],_0x5398dd[_0x8c4c('0x3b')]));if(_0x449b3a['query'][_0x8c4c('0x3d')]){_0x53ceaf['where']=_[_0x8c4c('0x3e')](_0x53ceaf[_0x8c4c('0x3a')],{'$or':_[_0x8c4c('0x2e')](_0x2fbc46,function(_0x5f1c35){if(_0x5f1c35['type']!==_0x8c4c('0x3f')){var _0x41a6b9={};_0x41a6b9[_0x5f1c35['name']]={'$like':'%'+_0x449b3a[_0x8c4c('0x34')][_0x8c4c('0x3d')]+'%'};return _0x41a6b9;}})});}_0x53ceaf=_[_0x8c4c('0x3e')]({},_0x53ceaf,_0x449b3a[_0x8c4c('0x40')]);var _0x30970f={'where':_0x53ceaf[_0x8c4c('0x3a')]};return db[_0x8c4c('0x2f')][_0x8c4c('0x21')](_0x30970f)[_0x8c4c('0x41')](function(_0x159723){_0x22d4d3[_0x8c4c('0x21')]=_0x159723;if(_0x449b3a[_0x8c4c('0x34')][_0x8c4c('0x42')]){_0x53ceaf[_0x8c4c('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x53ceaf);})[_0x8c4c('0x41')](function(_0x57ecec){_0x22d4d3[_0x8c4c('0x44')]=_0x57ecec;return _0x22d4d3;})[_0x8c4c('0x41')](respondWithFilteredResult(_0x1bb6c6,_0x53ceaf))[_0x8c4c('0x45')](handleError(_0x1bb6c6,null));};exports['show']=function(_0x1c7c2d,_0x111be0){var _0x319894={'raw':!![],'where':{'id':_0x1c7c2d['params']['id']}},_0x1519f0={};_0x1519f0[_0x8c4c('0x32')]=_['keys'](db[_0x8c4c('0x2f')][_0x8c4c('0x30')]);_0x1519f0[_0x8c4c('0x34')]=_[_0x8c4c('0x46')](_0x1c7c2d[_0x8c4c('0x34')]);_0x1519f0[_0x8c4c('0x3b')]=_['intersection'](_0x1519f0['model'],_0x1519f0['query']);_0x319894[_0x8c4c('0x35')]=_[_0x8c4c('0x33')](_0x1519f0['model'],qs[_0x8c4c('0x36')](_0x1c7c2d[_0x8c4c('0x34')][_0x8c4c('0x36')]));_0x319894['attributes']=_0x319894[_0x8c4c('0x35')]['length']?_0x319894[_0x8c4c('0x35')]:_0x1519f0[_0x8c4c('0x32')];if(_0x1c7c2d[_0x8c4c('0x34')][_0x8c4c('0x42')]){_0x319894[_0x8c4c('0x43')]=[{'all':!![]}];}_0x319894=_[_0x8c4c('0x3e')]({},_0x319894,_0x1c7c2d['options']);return db[_0x8c4c('0x2f')][_0x8c4c('0x47')](_0x319894)[_0x8c4c('0x41')](handleEntityNotFound(_0x111be0,null))[_0x8c4c('0x41')](respondWithResult(_0x111be0,null))[_0x8c4c('0x45')](handleError(_0x111be0,null));};exports[_0x8c4c('0x48')]=function(_0x46f2e1,_0x28c13e){return db[_0x8c4c('0x2f')]['create'](_0x46f2e1[_0x8c4c('0x49')],{})[_0x8c4c('0x41')](respondWithResult(_0x28c13e,0xc9))[_0x8c4c('0x45')](handleError(_0x28c13e,null));};exports[_0x8c4c('0x28')]=function(_0x4dfa81,_0x61b13d){if(_0x4dfa81[_0x8c4c('0x49')]['id']){delete _0x4dfa81[_0x8c4c('0x49')]['id'];}return db[_0x8c4c('0x2f')][_0x8c4c('0x47')]({'where':{'id':_0x4dfa81['params']['id']}})[_0x8c4c('0x41')](handleEntityNotFound(_0x61b13d,null))[_0x8c4c('0x41')](saveUpdates(_0x4dfa81['body'],null))[_0x8c4c('0x41')](respondWithResult(_0x61b13d,null))[_0x8c4c('0x45')](handleError(_0x61b13d,null));};exports['destroy']=function(_0x125c1b,_0x2e5d2c){return db['ChatInternalMessage'][_0x8c4c('0x47')]({'where':{'id':_0x125c1b[_0x8c4c('0x4a')]['id']}})[_0x8c4c('0x41')](handleEntityNotFound(_0x2e5d2c,null))[_0x8c4c('0x41')](removeEntity(_0x2e5d2c,null))[_0x8c4c('0x45')](handleError(_0x2e5d2c,null));};exports[_0x8c4c('0x4b')]=function(_0x3afb4b,_0x2da6b9){return db[_0x8c4c('0x2f')]['describe']()[_0x8c4c('0x41')](respondWithResult(_0x2da6b9,null))['catch'](handleError(_0x2da6b9,null));};function wrapUser(_0x57eba){return function(_0xb1baf1){var _0x4e80e9=_0x57eba[_0x8c4c('0x4c')]({'plain':!![]});_0x4e80e9['messages']=[];if(_0xb1baf1){_0x4e80e9[_0x8c4c('0x4d')]=_0xb1baf1[_0x8c4c('0x4e')];_0x4e80e9['lastMessage']=_0xb1baf1;}else{_0x4e80e9[_0x8c4c('0x4d')]=moment(0x0)[_0x8c4c('0x4f')](_0x8c4c('0x50'));_0x4e80e9[_0x8c4c('0x51')]={};}return _0x4e80e9;};}exports[_0x8c4c('0x52')]=function(_0x18a1ed,_0x13bf7e,_0x275841){var _0x8cf7a5=[];return db[_0x8c4c('0x53')]['findAll']({'where':{'role':['agent',_0x8c4c('0x54'),_0x8c4c('0x55')]},'attributes':['id',_0x8c4c('0x56'),_0x8c4c('0x2c'),_0x8c4c('0x57'),_0x8c4c('0x58'),_0x8c4c('0x59'),_0x8c4c('0x5a'),_0x8c4c('0x5b'),_0x8c4c('0x5c'),'showWebBar'],'order':qs[_0x8c4c('0x39')]('-online'),'include':[{'model':db[_0x8c4c('0x5d')],'as':_0x8c4c('0x5e'),'attributes':['id',_0x8c4c('0x2c'),_0x8c4c('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x2776e6){if(_0x2776e6){var _0x38e76d=_0x18a1ed[_0x8c4c('0x55')][_0x8c4c('0x4c')]({'plain':!![]});if(!_0x38e76d)throw new Error(_0x8c4c('0x5f'));if(_0x38e76d[_0x8c4c('0x57')]===_0x8c4c('0x55')){return db[_0x8c4c('0x60')]['find']({'where':{'name':'Agents','userProfileId':_0x38e76d[_0x8c4c('0x61')]},'raw':!![]})[_0x8c4c('0x41')](function(_0x1b0f10){if(_0x1b0f10){if(_0x1b0f10['autoAssociation']===0x0){return db['UserProfileResource'][_0x8c4c('0x62')]({'where':{'sectionId':_0x1b0f10['id']},'raw':!![]})[_0x8c4c('0x41')](function(_0x3ec3c9){var _0x46a487=[];if(_[_0x8c4c('0x63')](_0x3ec3c9)){_0x46a487=_[_0x8c4c('0x3d')](_0x2776e6,function(_0x5cb310){if(_0x5cb310[_0x8c4c('0x57')]!==_0x8c4c('0x64')){return _0x5cb310;}});return _0x46a487;}else{for(var _0x4528da=0x0;_0x4528da<_0x2776e6[_0x8c4c('0x37')];_0x4528da++){var _0x588241=_0x2776e6[_0x4528da];if(_0x588241['role']==='agent'){var _0x458050=_['find'](_0x3ec3c9,function(_0x2ed1ee){return _0x2ed1ee['resourceId']===_0x588241['id'];});if(_0x458050)_0x46a487[_0x8c4c('0x65')](_0x588241);}else{_0x46a487['push'](_0x588241);}}return _0x46a487;}});}else{return _0x2776e6;}}else{var _0x43cc16=_['filter'](_0x2776e6,function(_0x7cf710){if(_0x7cf710[_0x8c4c('0x57')]!=='agent'){return _0x7cf710;}});return _0x43cc16;}});}else{return _0x2776e6;}}})[_0x8c4c('0x41')](function(_0xd56183){var _0x40784f=[];if(_0xd56183){_0x8cf7a5=_0xd56183;for(var _0x2a65dd=0x0;_0x2a65dd<_0xd56183[_0x8c4c('0x37')];_0x2a65dd+=0x1){_0x8cf7a5[_0x2a65dd]['messages']=[];_0x40784f[_0x8c4c('0x65')](db[_0x8c4c('0x2f')]['find']({'where':{'FromId':[_0x18a1ed[_0x8c4c('0x55')]['id'],_0xd56183[_0x2a65dd]['id']],'ToId':[_0x18a1ed[_0x8c4c('0x55')]['id'],_0xd56183[_0x2a65dd]['id']],'ChatGroupId':null},'attributes':['id',_0x8c4c('0x4e'),'FromId',_0x8c4c('0x66'),_0x8c4c('0x67'),_0x8c4c('0x49')],'order':qs[_0x8c4c('0x39')](_0x8c4c('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8c4c('0x41')](wrapUser(_0xd56183[_0x2a65dd])));}return BPromise[_0x8c4c('0x69')](_0x40784f);}return[];})['then'](function(_0x26d8d5){return{'rows':_0x26d8d5,'count':_0x26d8d5[_0x8c4c('0x37')]};})[_0x8c4c('0x41')](respondWithResult(_0x13bf7e,null))['catch'](handleError(_0x13bf7e,null));}; \ No newline at end of file +var _0xf098=['to-csv','ejs','lodash','squel','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x576844,_0x3a1560){var _0x53755a=function(_0x221679){while(--_0x221679){_0x576844['push'](_0x576844['shift']());}};_0x53755a(++_0x3a1560);}(_0xf098,0xcd));var _0x8f09=function(_0x374981,_0x266b95){_0x374981=_0x374981-0x0;var _0x2416d9=_0xf098[_0x374981];return _0x2416d9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8f09('0x0'));var rimraf=require(_0x8f09('0x1'));var zipdir=require(_0x8f09('0x2'));var jsonpatch=require(_0x8f09('0x3'));var rp=require(_0x8f09('0x4'));var moment=require(_0x8f09('0x5'));var BPromise=require(_0x8f09('0x6'));var Mustache=require(_0x8f09('0x7'));var util=require(_0x8f09('0x8'));var path=require(_0x8f09('0x9'));var sox=require(_0x8f09('0xa'));var csv=require(_0x8f09('0xb'));var ejs=require(_0x8f09('0xc'));var fs=require('fs');var _=require(_0x8f09('0xd'));var squel=require(_0x8f09('0xe'));var crypto=require('crypto');var jsforce=require(_0x8f09('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8f09('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8f09('0x11'));var as=require(_0x8f09('0x12'));var hardwareService=require(_0x8f09('0x13'));var logger=require(_0x8f09('0x14'))(_0x8f09('0x15'));var utils=require(_0x8f09('0x16'));var config=require(_0x8f09('0x17'));var db=require(_0x8f09('0x18'))['db'];config[_0x8f09('0x19')]=_[_0x8f09('0x1a')](config[_0x8f09('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8f09('0x1b'))(new Redis(config[_0x8f09('0x19')]));require('./chatInternalMessage.socket')[_0x8f09('0x1c')](socket);function respondWithStatusCode(_0x6ed9ba,_0x93dadd){_0x93dadd=_0x93dadd||0xcc;return function(_0x16c956){if(_0x16c956){return _0x6ed9ba[_0x8f09('0x1d')](_0x93dadd);}return _0x6ed9ba['status'](_0x93dadd)[_0x8f09('0x1e')]();};}function respondWithResult(_0x3cb347,_0x33e548){_0x33e548=_0x33e548||0xc8;return function(_0x3980d9){if(_0x3980d9){return _0x3cb347[_0x8f09('0x1f')](_0x33e548)[_0x8f09('0x20')](_0x3980d9);}};}function respondWithFilteredResult(_0x16378c,_0x28d16c){return function(_0x245197){if(_0x245197){var _0x5427dd=_0x245197[_0x8f09('0x21')],_0x4ca5c3=_0x28d16c[_0x8f09('0x22')],_0x24d911=_0x28d16c[_0x8f09('0x22')]+_0x28d16c[_0x8f09('0x23')],_0x13ed1c;if(_0x24d911>=_0x5427dd){_0x24d911=_0x5427dd;_0x13ed1c=0xc8;}else{_0x13ed1c=0xce;}_0x16378c[_0x8f09('0x1f')](_0x13ed1c);return _0x16378c[_0x8f09('0x24')]('Content-Range',_0x4ca5c3+'-'+_0x24d911+'/'+_0x5427dd)[_0x8f09('0x20')](_0x245197);}return null;};}function patchUpdates(_0x3fe711){return function(_0x1f5469){try{jsonpatch[_0x8f09('0x25')](_0x1f5469,_0x3fe711,!![]);}catch(_0x5844fc){return BPromise[_0x8f09('0x26')](_0x5844fc);}return _0x1f5469[_0x8f09('0x27')]();};}function saveUpdates(_0x480f4f,_0x30f20f){return function(_0xd5d996){if(_0xd5d996){return _0xd5d996['update'](_0x480f4f)[_0x8f09('0x28')](function(_0x48d660){return _0x48d660;});}return null;};}function removeEntity(_0xff7366,_0x17eda7){return function(_0x3b99fb){if(_0x3b99fb){return _0x3b99fb[_0x8f09('0x29')]()[_0x8f09('0x28')](function(){_0xff7366[_0x8f09('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x662b2a,_0x17dc80){return function(_0x4178e9){if(!_0x4178e9){_0x662b2a[_0x8f09('0x1d')](0x194);}return _0x4178e9;};}function handleError(_0x2e284e,_0x11824a){_0x11824a=_0x11824a||0x1f4;return function(_0x34e95e){logger[_0x8f09('0x2a')](_0x34e95e[_0x8f09('0x2b')]);if(_0x34e95e['name']){delete _0x34e95e[_0x8f09('0x2c')];}_0x2e284e[_0x8f09('0x1f')](_0x11824a)[_0x8f09('0x2d')](_0x34e95e);};}exports[_0x8f09('0x2e')]=function(_0x5a3f3c,_0x233944){var _0x1b626d={},_0x2db2a7={},_0x170397={'count':0x0,'rows':[]};var _0x3f2d2c=_[_0x8f09('0x2f')](db['ChatInternalMessage'][_0x8f09('0x30')],function(_0x125d5b){return{'name':_0x125d5b['fieldName'],'type':_0x125d5b[_0x8f09('0x31')][_0x8f09('0x32')]};});_0x2db2a7[_0x8f09('0x33')]=_[_0x8f09('0x2f')](_0x3f2d2c,'name');_0x2db2a7[_0x8f09('0x34')]=_['keys'](_0x5a3f3c[_0x8f09('0x34')]);_0x2db2a7[_0x8f09('0x35')]=_['intersection'](_0x2db2a7['model'],_0x2db2a7[_0x8f09('0x34')]);_0x1b626d[_0x8f09('0x36')]=_[_0x8f09('0x37')](_0x2db2a7[_0x8f09('0x33')],qs[_0x8f09('0x38')](_0x5a3f3c[_0x8f09('0x34')]['fields']));_0x1b626d[_0x8f09('0x36')]=_0x1b626d[_0x8f09('0x36')][_0x8f09('0x39')]?_0x1b626d[_0x8f09('0x36')]:_0x2db2a7[_0x8f09('0x33')];if(!_0x5a3f3c[_0x8f09('0x34')][_0x8f09('0x3a')]('nolimit')){_0x1b626d[_0x8f09('0x23')]=qs[_0x8f09('0x23')](_0x5a3f3c[_0x8f09('0x34')][_0x8f09('0x23')]);_0x1b626d[_0x8f09('0x22')]=qs[_0x8f09('0x22')](_0x5a3f3c[_0x8f09('0x34')][_0x8f09('0x22')]);}_0x1b626d[_0x8f09('0x3b')]=qs[_0x8f09('0x3c')](_0x5a3f3c['query'][_0x8f09('0x3c')]);_0x1b626d[_0x8f09('0x3d')]=qs[_0x8f09('0x35')](_[_0x8f09('0x3e')](_0x5a3f3c[_0x8f09('0x34')],_0x2db2a7[_0x8f09('0x35')]));if(_0x5a3f3c[_0x8f09('0x34')][_0x8f09('0x3f')]){_0x1b626d[_0x8f09('0x3d')]=_[_0x8f09('0x40')](_0x1b626d[_0x8f09('0x3d')],{'$or':_['map'](_0x3f2d2c,function(_0x40e67c){if(_0x40e67c[_0x8f09('0x31')]!==_0x8f09('0x41')){var _0x1302df={};_0x1302df[_0x40e67c[_0x8f09('0x2c')]]={'$like':'%'+_0x5a3f3c[_0x8f09('0x34')]['filter']+'%'};return _0x1302df;}})});}_0x1b626d=_[_0x8f09('0x40')]({},_0x1b626d,_0x5a3f3c[_0x8f09('0x42')]);var _0xf91535={'where':_0x1b626d[_0x8f09('0x3d')]};return db[_0x8f09('0x43')][_0x8f09('0x21')](_0xf91535)[_0x8f09('0x28')](function(_0x55e83d){_0x170397[_0x8f09('0x21')]=_0x55e83d;if(_0x5a3f3c['query'][_0x8f09('0x44')]){_0x1b626d[_0x8f09('0x45')]=[{'all':!![]}];}return db[_0x8f09('0x43')][_0x8f09('0x46')](_0x1b626d);})[_0x8f09('0x28')](function(_0x32ef2d){_0x170397[_0x8f09('0x47')]=_0x32ef2d;return _0x170397;})[_0x8f09('0x28')](respondWithFilteredResult(_0x233944,_0x1b626d))[_0x8f09('0x48')](handleError(_0x233944,null));};exports['show']=function(_0xf00480,_0xb5694f){var _0x1b9ecd={'raw':!![],'where':{'id':_0xf00480['params']['id']}},_0x2e2423={};_0x2e2423[_0x8f09('0x33')]=_[_0x8f09('0x49')](db[_0x8f09('0x43')][_0x8f09('0x30')]);_0x2e2423['query']=_['keys'](_0xf00480[_0x8f09('0x34')]);_0x2e2423[_0x8f09('0x35')]=_[_0x8f09('0x37')](_0x2e2423[_0x8f09('0x33')],_0x2e2423[_0x8f09('0x34')]);_0x1b9ecd[_0x8f09('0x36')]=_['intersection'](_0x2e2423[_0x8f09('0x33')],qs[_0x8f09('0x38')](_0xf00480[_0x8f09('0x34')]['fields']));_0x1b9ecd[_0x8f09('0x36')]=_0x1b9ecd[_0x8f09('0x36')][_0x8f09('0x39')]?_0x1b9ecd[_0x8f09('0x36')]:_0x2e2423[_0x8f09('0x33')];if(_0xf00480[_0x8f09('0x34')][_0x8f09('0x44')]){_0x1b9ecd[_0x8f09('0x45')]=[{'all':!![]}];}_0x1b9ecd=_[_0x8f09('0x40')]({},_0x1b9ecd,_0xf00480['options']);return db[_0x8f09('0x43')][_0x8f09('0x4a')](_0x1b9ecd)['then'](handleEntityNotFound(_0xb5694f,null))[_0x8f09('0x28')](respondWithResult(_0xb5694f,null))[_0x8f09('0x48')](handleError(_0xb5694f,null));};exports[_0x8f09('0x4b')]=function(_0x41e4ff,_0x1e4fa0){return db[_0x8f09('0x43')]['create'](_0x41e4ff['body'],{})[_0x8f09('0x28')](respondWithResult(_0x1e4fa0,0xc9))[_0x8f09('0x48')](handleError(_0x1e4fa0,null));};exports['update']=function(_0x6d45b,_0x159a7e){if(_0x6d45b['body']['id']){delete _0x6d45b[_0x8f09('0x4c')]['id'];}return db[_0x8f09('0x43')][_0x8f09('0x4a')]({'where':{'id':_0x6d45b[_0x8f09('0x4d')]['id']}})[_0x8f09('0x28')](handleEntityNotFound(_0x159a7e,null))[_0x8f09('0x28')](saveUpdates(_0x6d45b[_0x8f09('0x4c')],null))[_0x8f09('0x28')](respondWithResult(_0x159a7e,null))[_0x8f09('0x48')](handleError(_0x159a7e,null));};exports['destroy']=function(_0x203bf8,_0x4bbc2b){return db['ChatInternalMessage'][_0x8f09('0x4a')]({'where':{'id':_0x203bf8[_0x8f09('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4bbc2b,null))[_0x8f09('0x28')](removeEntity(_0x4bbc2b,null))['catch'](handleError(_0x4bbc2b,null));};exports[_0x8f09('0x4e')]=function(_0xbf4b65,_0x476ac3){return db[_0x8f09('0x43')][_0x8f09('0x4e')]()[_0x8f09('0x28')](respondWithResult(_0x476ac3,null))[_0x8f09('0x48')](handleError(_0x476ac3,null));};function wrapUser(_0x483a67){return function(_0x4d3c01){var _0x2935ec=_0x483a67['get']({'plain':!![]});_0x2935ec[_0x8f09('0x4f')]=[];if(_0x4d3c01){_0x2935ec[_0x8f09('0x50')]=_0x4d3c01[_0x8f09('0x51')];_0x2935ec['lastMessage']=_0x4d3c01;}else{_0x2935ec[_0x8f09('0x50')]=moment(0x0)['format'](_0x8f09('0x52'));_0x2935ec[_0x8f09('0x53')]={};}return _0x2935ec;};}exports[_0x8f09('0x54')]=function(_0x19909d,_0x39ccfd,_0xc088fc){var _0xc07303=[];return db[_0x8f09('0x55')][_0x8f09('0x46')]({'where':{'role':[_0x8f09('0x56'),'admin','user']},'attributes':['id',_0x8f09('0x57'),_0x8f09('0x2c'),_0x8f09('0x58'),'userpic',_0x8f09('0x59'),_0x8f09('0x5a'),_0x8f09('0x5b'),_0x8f09('0x5c'),_0x8f09('0x5d')],'order':qs[_0x8f09('0x3c')](_0x8f09('0x5e')),'include':[{'model':db[_0x8f09('0x5f')],'as':_0x8f09('0x60'),'attributes':['id','name',_0x8f09('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x490ba0){if(_0x490ba0){var _0x13e33c=_0x19909d[_0x8f09('0x61')]['get']({'plain':!![]});if(!_0x13e33c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13e33c[_0x8f09('0x58')]===_0x8f09('0x61')){return db[_0x8f09('0x62')][_0x8f09('0x4a')]({'where':{'name':_0x8f09('0x63'),'userProfileId':_0x13e33c['userProfileId']},'raw':!![]})[_0x8f09('0x28')](function(_0x1512e0){if(_0x1512e0){if(_0x1512e0[_0x8f09('0x64')]===0x0){return db[_0x8f09('0x65')]['findAll']({'where':{'sectionId':_0x1512e0['id']},'raw':!![]})[_0x8f09('0x28')](function(_0x5b78c7){var _0x1f874c=[];if(_[_0x8f09('0x66')](_0x5b78c7)){_0x1f874c=_[_0x8f09('0x3f')](_0x490ba0,function(_0x17d124){if(_0x17d124[_0x8f09('0x58')]!==_0x8f09('0x56')){return _0x17d124;}});return _0x1f874c;}else{for(var _0x13f3bc=0x0;_0x13f3bc<_0x490ba0[_0x8f09('0x39')];_0x13f3bc++){var _0x253dd2=_0x490ba0[_0x13f3bc];if(_0x253dd2['role']===_0x8f09('0x56')){var _0x5d6918=_[_0x8f09('0x4a')](_0x5b78c7,function(_0x88516d){return _0x88516d['resourceId']===_0x253dd2['id'];});if(_0x5d6918)_0x1f874c[_0x8f09('0x67')](_0x253dd2);}else{_0x1f874c['push'](_0x253dd2);}}return _0x1f874c;}});}else{return _0x490ba0;}}else{var _0xf9bca0=_[_0x8f09('0x3f')](_0x490ba0,function(_0x2b3fdc){if(_0x2b3fdc[_0x8f09('0x58')]!=='agent'){return _0x2b3fdc;}});return _0xf9bca0;}});}else{return _0x490ba0;}}})[_0x8f09('0x28')](function(_0x59b755){var _0x293f70=[];if(_0x59b755){_0xc07303=_0x59b755;for(var _0x1aeac0=0x0;_0x1aeac0<_0x59b755[_0x8f09('0x39')];_0x1aeac0+=0x1){_0xc07303[_0x1aeac0][_0x8f09('0x4f')]=[];_0x293f70[_0x8f09('0x67')](db[_0x8f09('0x43')][_0x8f09('0x4a')]({'where':{'FromId':[_0x19909d[_0x8f09('0x61')]['id'],_0x59b755[_0x1aeac0]['id']],'ToId':[_0x19909d['user']['id'],_0x59b755[_0x1aeac0]['id']],'ChatGroupId':null},'attributes':['id',_0x8f09('0x51'),_0x8f09('0x68'),_0x8f09('0x69'),_0x8f09('0x6a'),'body'],'order':qs[_0x8f09('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8f09('0x28')](wrapUser(_0x59b755[_0x1aeac0])));}return BPromise[_0x8f09('0x6b')](_0x293f70);}return[];})[_0x8f09('0x28')](function(_0x243948){return{'rows':_0x243948,'count':_0x243948['length']};})[_0x8f09('0x28')](respondWithResult(_0x39ccfd,null))[_0x8f09('0x48')](handleError(_0x39ccfd,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index eceb882..bb5c533 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.events.js +++ b/server/api/chatInternalMessage/chatInternalMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc694=['ChatInternalMessage','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xc694,0x11e));var _0x4c69=function(_0x389aff,_0x16144e){_0x389aff=_0x389aff-0x0;var _0x33d2fc=_0xc694[_0x389aff];return _0x33d2fc;};'use strict';var EventEmitter=require(_0x4c69('0x0'));var ChatInternalMessage=require(_0x4c69('0x1'))['db'][_0x4c69('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4c69('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1f26a1){return function(_0x32ea21,_0x479bf8,_0x18ab56){ChatInternalMessageEvents[_0x4c69('0x4')](_0x1f26a1+':'+_0x32ea21['id'],_0x32ea21);ChatInternalMessageEvents[_0x4c69('0x4')](_0x1f26a1,_0x32ea21);_0x18ab56(null);};}for(var e in events){if(events[_0x4c69('0x5')](e)){var event=events[e];ChatInternalMessage[_0x4c69('0x6')](e,emitEvent(event));}}module[_0x4c69('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x3677=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','emit','exports','events'];(function(_0x4d1549,_0x7b504){var _0x502287=function(_0x5a0581){while(--_0x5a0581){_0x4d1549['push'](_0x4d1549['shift']());}};_0x502287(++_0x7b504);}(_0x3677,0x1e9));var _0x7367=function(_0x22c7ce,_0x2a13e8){_0x22c7ce=_0x22c7ce-0x0;var _0x5dcfda=_0x3677[_0x22c7ce];return _0x5dcfda;};'use strict';var EventEmitter=require(_0x7367('0x0'));var ChatInternalMessage=require(_0x7367('0x1'))['db'][_0x7367('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7367('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7367('0x4'),'afterDestroy':'remove'};function emitEvent(_0xdc2571){return function(_0x38c8fa,_0xf08958,_0x7aea2c){ChatInternalMessageEvents[_0x7367('0x5')](_0xdc2571+':'+_0x38c8fa['id'],_0x38c8fa);ChatInternalMessageEvents['emit'](_0xdc2571,_0x38c8fa);_0x7aea2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x7367('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index d2d3f3e..c50414a 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x54fbed,_0x3c77a7){_0x54fbed=_0x54fbed-0x0;var _0x333bbc=_0xbdb7[_0x54fbed];return _0x333bbc;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bdb('0xb'),'collate':_0x7bdb('0xc')});}; \ No newline at end of file +var _0x757a=['./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x1032cf,_0x6bb2bc){var _0x1efbe4=function(_0xb2f06c){while(--_0xb2f06c){_0x1032cf['push'](_0x1032cf['shift']());}};_0x1efbe4(++_0x6bb2bc);}(_0x757a,0xde));var _0xa757=function(_0x355a08,_0x279725){_0x355a08=_0x355a08-0x0;var _0x223297=_0x757a[_0x355a08];return _0x223297;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatInternalMessage',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa757('0xa'),'collate':_0xa757('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a09e73b..84ed533 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js +++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1a6=['code','ChatInternalMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','register','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x2ae5f2,_0x1a737f){var _0xf44fef=function(_0x3754c6){while(--_0x3754c6){_0x2ae5f2['push'](_0x2ae5f2['shift']());}};_0xf44fef(++_0x1a737f);}(_0xa1a6,0x90));var _0x6a1a=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xa1a6[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require(_0x6a1a('0x0'));var util=require('util');var moment=require(_0x6a1a('0x1'));var BPromise=require(_0x6a1a('0x2'));var rs=require(_0x6a1a('0x3'));var fs=require('fs');var Redis=require(_0x6a1a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6a1a('0x5'))(_0x6a1a('0x6'));var config=require(_0x6a1a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6a1a('0x8')]({'port':0x232a});config[_0x6a1a('0x9')]=_['defaults'](config['redis'],{'host':_0x6a1a('0xa'),'port':0x18eb});var socket=require(_0x6a1a('0xb'))(new Redis(config[_0x6a1a('0x9')]));require('./chatInternalMessage.socket')[_0x6a1a('0xc')](socket);function respondWithRpcPromise(_0x43fa2b,_0x3ec194,_0x47b3d4){return new BPromise(function(_0x5818c8,_0x289e36){return client['request'](_0x43fa2b,_0x47b3d4)['then'](function(_0x2724c0){logger[_0x6a1a('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0x3ec194,'request\x20sent');logger[_0x6a1a('0xe')](_0x6a1a('0xf'),_0x3ec194,'request\x20sent',JSON['stringify'](_0x2724c0));if(_0x2724c0[_0x6a1a('0x10')]){if(_0x2724c0[_0x6a1a('0x10')][_0x6a1a('0x11')]===0x1f4){logger[_0x6a1a('0x10')](_0x6a1a('0x12'),_0x3ec194,_0x2724c0[_0x6a1a('0x10')][_0x6a1a('0x13')]);return _0x289e36(_0x2724c0['error']['message']);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x3ec194,_0x2724c0[_0x6a1a('0x10')][_0x6a1a('0x13')]);return _0x5818c8(_0x2724c0[_0x6a1a('0x10')][_0x6a1a('0x13')]);}else{logger[_0x6a1a('0xd')](_0x6a1a('0x12'),_0x3ec194,_0x6a1a('0x14'));_0x5818c8(_0x2724c0[_0x6a1a('0x15')][_0x6a1a('0x13')]);}})[_0x6a1a('0x16')](function(_0x61c346){logger[_0x6a1a('0x10')](_0x6a1a('0x12'),_0x3ec194,_0x61c346);_0x289e36(_0x61c346);});});} \ No newline at end of file +var _0xe0f3=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x356dcc,_0x51f8f7){var _0xe6c019=function(_0xc0710d){while(--_0xc0710d){_0x356dcc['push'](_0x356dcc['shift']());}};_0xe6c019(++_0x51f8f7);}(_0xe0f3,0x186));var _0x3e0f=function(_0x1cc9dd,_0x39ab88){_0x1cc9dd=_0x1cc9dd-0x0;var _0x1ea4af=_0xe0f3[_0x1cc9dd];return _0x1ea4af;};'use strict';var _=require('lodash');var util=require(_0x3e0f('0x0'));var moment=require(_0x3e0f('0x1'));var BPromise=require(_0x3e0f('0x2'));var rs=require(_0x3e0f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3e0f('0x4'));var logger=require(_0x3e0f('0x5'))(_0x3e0f('0x6'));var config=require(_0x3e0f('0x7'));var jayson=require(_0x3e0f('0x8'));var client=jayson[_0x3e0f('0x9')][_0x3e0f('0xa')]({'port':0x232a});config[_0x3e0f('0xb')]=_[_0x3e0f('0xc')](config[_0x3e0f('0xb')],{'host':_0x3e0f('0xd'),'port':0x18eb});var socket=require(_0x3e0f('0xe'))(new Redis(config[_0x3e0f('0xb')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x282763,_0x5ad540,_0x23be42){return new BPromise(function(_0x52cf8f,_0x551ccb){return client[_0x3e0f('0xf')](_0x282763,_0x23be42)['then'](function(_0xe4934d){logger[_0x3e0f('0x10')](_0x3e0f('0x11'),_0x5ad540,_0x3e0f('0x12'));logger['debug'](_0x3e0f('0x13'),_0x5ad540,_0x3e0f('0x12'),JSON[_0x3e0f('0x14')](_0xe4934d));if(_0xe4934d[_0x3e0f('0x15')]){if(_0xe4934d[_0x3e0f('0x15')][_0x3e0f('0x16')]===0x1f4){logger[_0x3e0f('0x15')](_0x3e0f('0x11'),_0x5ad540,_0xe4934d[_0x3e0f('0x15')]['message']);return _0x551ccb(_0xe4934d['error']['message']);}logger['error'](_0x3e0f('0x11'),_0x5ad540,_0xe4934d['error'][_0x3e0f('0x17')]);return _0x52cf8f(_0xe4934d[_0x3e0f('0x15')]['message']);}else{logger[_0x3e0f('0x10')](_0x3e0f('0x11'),_0x5ad540,_0x3e0f('0x12'));_0x52cf8f(_0xe4934d[_0x3e0f('0x18')]['message']);}})[_0x3e0f('0x19')](function(_0x72df8d){logger[_0x3e0f('0x15')](_0x3e0f('0x11'),_0x5ad540,_0x72df8d);_0x551ccb(_0x72df8d);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index c3577e6..8f6dc20 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.socket.js +++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6d1=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','removeListener','register','length'];(function(_0x19208a,_0x346a44){var _0x1981e8=function(_0x42fca){while(--_0x42fca){_0x19208a['push'](_0x19208a['shift']());}};_0x1981e8(++_0x346a44);}(_0xf6d1,0x99));var _0x1f6d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf6d1[_0x1facfa];return _0x9ec701;};'use strict';var ChatInternalMessageEvents=require(_0x1f6d('0x0'));var events=[_0x1f6d('0x1'),_0x1f6d('0x2'),_0x1f6d('0x3')];function createListener(_0x2133a6,_0x44d691){return function(_0xd760e6){_0x44d691['emit'](_0x2133a6,_0xd760e6);};}function removeListener(_0x1b8190,_0x59e1ab){return function(){ChatInternalMessageEvents[_0x1f6d('0x4')](_0x1b8190,_0x59e1ab);};}exports[_0x1f6d('0x5')]=function(_0x1278cf){for(var _0x927c3c=0x0,_0x1b90fb=events[_0x1f6d('0x6')];_0x927c3c<_0x1b90fb;_0x927c3c++){var _0xf4dd78=events[_0x927c3c];var _0x234155=createListener(_0x1f6d('0x7')+_0xf4dd78,_0x1278cf);ChatInternalMessageEvents['on'](_0xf4dd78,_0x234155);}}; \ No newline at end of file +var _0x3eec=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x4de67c,_0x2d3640){var _0x191c8b=function(_0x142c4d){while(--_0x142c4d){_0x4de67c['push'](_0x4de67c['shift']());}};_0x191c8b(++_0x2d3640);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x472a76,_0xbfd5e3){_0x472a76=_0x472a76-0x0;var _0x3876dc=_0x3eec[_0x472a76];return _0x3876dc;};'use strict';var ChatInternalMessageEvents=require(_0xc3ee('0x0'));var events=[_0xc3ee('0x1'),_0xc3ee('0x2'),_0xc3ee('0x3')];function createListener(_0x484ade,_0x223d08){return function(_0x280209){_0x223d08[_0xc3ee('0x4')](_0x484ade,_0x280209);};}function removeListener(_0x35b2fb,_0x25074b){return function(){ChatInternalMessageEvents[_0xc3ee('0x5')](_0x35b2fb,_0x25074b);};}exports['register']=function(_0x471de7){for(var _0xbd5b6=0x0,_0xea4318=events[_0xc3ee('0x6')];_0xbd5b6<_0xea4318;_0xbd5b6++){var _0x356374=events[_0xbd5b6];var _0x3d74c0=createListener(_0xc3ee('0x7')+_0x356374,_0x471de7);ChatInternalMessageEvents['on'](_0x356374,_0x3d74c0);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 00b84b4..5e8e091 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x3f5ac7,_0x1be657){var _0x4fc948=function(_0x3dbf99){while(--_0x3dbf99){_0x3f5ac7['push'](_0x3f5ac7['shift']());}};_0x4fc948(++_0x1be657);}(_0xb7e7,0x121));var _0x7b7e=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xb7e7[_0x24259d];return _0x5a701;};'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 auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x5315cb,_0x51d218){var _0x2bec5d=function(_0x57e1ce){while(--_0x57e1ce){_0x5315cb['push'](_0x5315cb['shift']());}};_0x2bec5d(++_0x51d218);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth[_0x3071('0x8')](),controller['create']);router[_0x3071('0x11')](_0x3071('0xe'),controller[_0x3071('0x12')]);router[_0x3071('0x13')](_0x3071('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 4e92fc3..28de95f 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf46e=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xf46e,0xf5));var _0xef46=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf46e[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0xef46('0x0'));module[_0xef46('0x1')]={'body':{'type':Sequelize[_0xef46('0x2')](_0xef46('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xef46('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xef46('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xef46('0x5')]('in','out'),'defaultValue':_0xef46('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xfc97=['exports','medium','BOOLEAN','out','DATE'];(function(_0xe8451d,_0x390246){var _0x58cd05=function(_0x224ac3){while(--_0x224ac3){_0xe8451d['push'](_0xe8451d['shift']());}};_0x58cd05(++_0x390246);}(_0xfc97,0x1a9));var _0x7fc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc97[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x7fc9('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7fc9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7fc9('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7fc9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7fc9('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7fc9('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index dbc8eed..c2d806f 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56d4=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','jayson/promise','http','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','reject','save','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','rows','keys','include','find','create','body','params','describe','chat-interactions','accept','chat','readAt','UserId','user','CmContact','Contact','get','ChatInteraction','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','event','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x56d4,0x70));var _0x456d=function(_0x13b0ae,_0x860e0d){_0x13b0ae=_0x13b0ae-0x0;var _0x1a2662=_0x56d4[_0x13b0ae];return _0x1a2662;};'use strict';var pdf=require(_0x456d('0x0'));var emlformat=require(_0x456d('0x1'));var rimraf=require(_0x456d('0x2'));var zipdir=require(_0x456d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x456d('0x4'));var BPromise=require(_0x456d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x456d('0x6'));var sox=require(_0x456d('0x7'));var csv=require(_0x456d('0x8'));var ejs=require(_0x456d('0x9'));var fs=require('fs');var _=require(_0x456d('0xa'));var squel=require(_0x456d('0xb'));var crypto=require(_0x456d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x456d('0x8'));var querystring=require(_0x456d('0xd'));var Papa=require(_0x456d('0xe'));var Redis=require(_0x456d('0xf'));var authService=require(_0x456d('0x10'));var qs=require(_0x456d('0x11'));var as=require(_0x456d('0x12'));var hardwareService=require(_0x456d('0x13'));var logger=require(_0x456d('0x14'))(_0x456d('0x15'));var utils=require(_0x456d('0x16'));var config=require(_0x456d('0x17'));var db=require(_0x456d('0x18'))['db'];config['redis']=_[_0x456d('0x19')](config['redis'],{'host':_0x456d('0x1a'),'port':0x18eb});var socket=require(_0x456d('0x1b'))(new Redis(config[_0x456d('0x1c')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x456d('0x1d'));var client=jayson['client'][_0x456d('0x1e')]({'port':0x232c});var client9002=jayson[_0x456d('0x1f')][_0x456d('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3f1f6a,_0xcc3ab1,_0x305542){if(_0x305542){var _0x20a8b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20a8b2[_0x456d('0x20')](_0xcc3ab1)){return _0x3f1f6a;}else{throw new db['Sequelize'][(_0x456d('0x21'))](_0x456d('0x22'));}}else{return _0x3f1f6a;}}function respondWithRpcPromise(_0x2ae5f2,_0x4414ba,_0x3bb1e7,_0x3f2406){return new BPromise(function(_0x377878,_0x7fad87){var _0x31b686=_0x3f2406||client;return _0x31b686[_0x456d('0x23')](_0x2ae5f2,_0x3bb1e7)[_0x456d('0x24')](function(_0x5b11a9){logger[_0x456d('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4414ba,_0x456d('0x26'));logger[_0x456d('0x27')](_0x456d('0x28'),_0x4414ba,_0x456d('0x26'),JSON[_0x456d('0x29')](_0x5b11a9));if(_0x5b11a9[_0x456d('0x2a')]){if(_0x5b11a9[_0x456d('0x2a')][_0x456d('0x2b')]===0x1f4){logger[_0x456d('0x2a')](_0x456d('0x2c'),_0x4414ba,_0x5b11a9[_0x456d('0x2a')][_0x456d('0x2d')]);return _0x7fad87(_0x5b11a9['error'][_0x456d('0x2d')]);}logger[_0x456d('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x4414ba,_0x5b11a9[_0x456d('0x2a')]['message']);return _0x377878(_0x5b11a9[_0x456d('0x2a')][_0x456d('0x2d')]);}else{logger[_0x456d('0x25')](_0x456d('0x2c'),_0x4414ba,'request\x20sent');_0x377878(_0x5b11a9[_0x456d('0x2e')][_0x456d('0x2d')]);}})[_0x456d('0x2f')](function(_0x2e8494){logger[_0x456d('0x2a')](_0x456d('0x2c'),_0x4414ba,_0x2e8494);_0x7fad87(_0x2e8494);});});}function respondWithStatusCode(_0xe764db,_0x5bdf40){_0x5bdf40=_0x5bdf40||0xcc;return function(_0x112586){if(_0x112586){return _0xe764db[_0x456d('0x30')](_0x5bdf40);}return _0xe764db['status'](_0x5bdf40)['end']();};}function respondWithResult(_0x418ab5,_0x227c98){_0x227c98=_0x227c98||0xc8;return function(_0x34f37c){if(_0x34f37c){return _0x418ab5[_0x456d('0x31')](_0x227c98)['json'](_0x34f37c);}};}function respondWithFilteredResult(_0x83fa13,_0x220db9){return function(_0x45a953){if(_0x45a953){var _0x4cb261=_0x45a953[_0x456d('0x32')],_0x4ceda3=_0x220db9[_0x456d('0x33')],_0x570ab1=_0x220db9[_0x456d('0x33')]+_0x220db9[_0x456d('0x34')],_0xc1c5f8;if(_0x570ab1>=_0x4cb261){_0x570ab1=_0x4cb261;_0xc1c5f8=0xc8;}else{_0xc1c5f8=0xce;}_0x83fa13[_0x456d('0x31')](_0xc1c5f8);return _0x83fa13[_0x456d('0x35')](_0x456d('0x36'),_0x4ceda3+'-'+_0x570ab1+'/'+_0x4cb261)['json'](_0x45a953);}return null;};}function patchUpdates(_0x15a600){return function(_0x2d3dae){try{jsonpatch['apply'](_0x2d3dae,_0x15a600,!![]);}catch(_0x547e34){return BPromise[_0x456d('0x37')](_0x547e34);}return _0x2d3dae[_0x456d('0x38')]();};}function saveUpdates(_0x3d8abc,_0x5b590e){return function(_0xc67588){if(_0xc67588){return _0xc67588['update'](_0x3d8abc)['then'](function(_0x6248ea){return _0x6248ea;});}return null;};}function removeEntity(_0x28af0b,_0xb2e9bc){return function(_0x5be464){if(_0x5be464){return _0x5be464[_0x456d('0x39')]()[_0x456d('0x24')](function(){_0x28af0b[_0x456d('0x31')](0xcc)[_0x456d('0x3a')]();});}};}function handleEntityNotFound(_0x31e3e9,_0xb38f9a){return function(_0x566046){if(!_0x566046){_0x31e3e9['sendStatus'](0x194);}return _0x566046;};}function handleError(_0x5aeb8d,_0x222142){_0x222142=_0x222142||0x1f4;return function(_0x8b147f){logger[_0x456d('0x2a')](_0x8b147f[_0x456d('0x3b')]);if(_0x8b147f['name']){delete _0x8b147f[_0x456d('0x3c')];}_0x5aeb8d[_0x456d('0x31')](_0x222142)[_0x456d('0x3d')](_0x8b147f);};}exports[_0x456d('0x3e')]=function(_0x10bd18,_0x587704){var _0x44948d={},_0x4c2ffc={},_0x5edbae={'count':0x0,'rows':[]};var _0x4ef72e=_[_0x456d('0x3f')](db[_0x456d('0x40')][_0x456d('0x41')],function(_0x16ca6a){return{'name':_0x16ca6a[_0x456d('0x42')],'type':_0x16ca6a[_0x456d('0x43')][_0x456d('0x44')]};});_0x4c2ffc[_0x456d('0x45')]=_[_0x456d('0x3f')](_0x4ef72e,_0x456d('0x3c'));_0x4c2ffc['query']=_['keys'](_0x10bd18['query']);_0x4c2ffc[_0x456d('0x46')]=_[_0x456d('0x47')](_0x4c2ffc[_0x456d('0x45')],_0x4c2ffc[_0x456d('0x48')]);_0x44948d[_0x456d('0x49')]=_['intersection'](_0x4c2ffc[_0x456d('0x45')],qs[_0x456d('0x4a')](_0x10bd18[_0x456d('0x48')][_0x456d('0x4a')]));_0x44948d['attributes']=_0x44948d[_0x456d('0x49')][_0x456d('0x4b')]?_0x44948d[_0x456d('0x49')]:_0x4c2ffc['model'];if(!_0x10bd18[_0x456d('0x48')][_0x456d('0x4c')](_0x456d('0x4d'))){_0x44948d[_0x456d('0x34')]=qs['limit'](_0x10bd18['query'][_0x456d('0x34')]);_0x44948d[_0x456d('0x33')]=qs[_0x456d('0x33')](_0x10bd18[_0x456d('0x48')]['offset']);}_0x44948d[_0x456d('0x4e')]=qs['sort'](_0x10bd18['query'][_0x456d('0x4f')]);_0x44948d[_0x456d('0x50')]=qs[_0x456d('0x46')](_[_0x456d('0x51')](_0x10bd18[_0x456d('0x48')],_0x4c2ffc['filters']));if(_0x10bd18[_0x456d('0x48')]['filter']){_0x44948d[_0x456d('0x50')]=_['merge'](_0x44948d[_0x456d('0x50')],{'$or':_['map'](_0x4ef72e,function(_0x2e3912){if(_0x2e3912[_0x456d('0x43')]!==_0x456d('0x52')){var _0x4d0b11={};_0x4d0b11[_0x2e3912[_0x456d('0x3c')]]={'$like':'%'+_0x10bd18[_0x456d('0x48')][_0x456d('0x53')]+'%'};return _0x4d0b11;}})});}_0x44948d=_[_0x456d('0x54')]({},_0x44948d,_0x10bd18[_0x456d('0x55')]);var _0x3e7f06={'where':_0x44948d[_0x456d('0x50')]};return db[_0x456d('0x40')][_0x456d('0x32')](_0x3e7f06)[_0x456d('0x24')](function(_0x4141c1){_0x5edbae['count']=_0x4141c1;if(_0x10bd18['query'][_0x456d('0x56')]){_0x44948d['include']=[{'all':!![]}];}return db[_0x456d('0x40')]['findAll'](_0x44948d);})['then'](function(_0xdff48b){_0x5edbae[_0x456d('0x57')]=_0xdff48b;return _0x5edbae;})[_0x456d('0x24')](respondWithFilteredResult(_0x587704,_0x44948d))[_0x456d('0x2f')](handleError(_0x587704,null));};exports['show']=function(_0x1ad983,_0x2691ee){var _0xb948a2={'raw':!![],'where':{'id':_0x1ad983['params']['id']}},_0x5caef7={};_0x5caef7[_0x456d('0x45')]=_[_0x456d('0x58')](db['ChatMessage'][_0x456d('0x41')]);_0x5caef7['query']=_[_0x456d('0x58')](_0x1ad983[_0x456d('0x48')]);_0x5caef7[_0x456d('0x46')]=_['intersection'](_0x5caef7[_0x456d('0x45')],_0x5caef7[_0x456d('0x48')]);_0xb948a2[_0x456d('0x49')]=_['intersection'](_0x5caef7[_0x456d('0x45')],qs[_0x456d('0x4a')](_0x1ad983['query'][_0x456d('0x4a')]));_0xb948a2['attributes']=_0xb948a2[_0x456d('0x49')]['length']?_0xb948a2['attributes']:_0x5caef7['model'];if(_0x1ad983[_0x456d('0x48')][_0x456d('0x56')]){_0xb948a2[_0x456d('0x59')]=[{'all':!![]}];}_0xb948a2=_[_0x456d('0x54')]({},_0xb948a2,_0x1ad983[_0x456d('0x55')]);return db['ChatMessage'][_0x456d('0x5a')](_0xb948a2)[_0x456d('0x24')](handleEntityNotFound(_0x2691ee,null))[_0x456d('0x24')](respondWithResult(_0x2691ee,null))[_0x456d('0x2f')](handleError(_0x2691ee,null));};exports[_0x456d('0x5b')]=function(_0x12ba67,_0x58c58b){return db[_0x456d('0x40')][_0x456d('0x5b')](_0x12ba67['body'],{})['then'](respondWithResult(_0x58c58b,0xc9))[_0x456d('0x2f')](handleError(_0x58c58b,null));};exports['update']=function(_0x5c4eff,_0x1b4ce5){if(_0x5c4eff['body']['id']){delete _0x5c4eff[_0x456d('0x5c')]['id'];}return db[_0x456d('0x40')][_0x456d('0x5a')]({'where':{'id':_0x5c4eff['params']['id']}})[_0x456d('0x24')](handleEntityNotFound(_0x1b4ce5,null))[_0x456d('0x24')](saveUpdates(_0x5c4eff['body'],null))[_0x456d('0x24')](respondWithResult(_0x1b4ce5,null))[_0x456d('0x2f')](handleError(_0x1b4ce5,null));};exports['destroy']=function(_0x20e7d5,_0x3d3db7){return db[_0x456d('0x40')][_0x456d('0x5a')]({'where':{'id':_0x20e7d5[_0x456d('0x5d')]['id']}})[_0x456d('0x24')](handleEntityNotFound(_0x3d3db7,null))['then'](removeEntity(_0x3d3db7,null))[_0x456d('0x2f')](handleError(_0x3d3db7,null));};exports[_0x456d('0x5e')]=function(_0x3b8065,_0x395796){return db[_0x456d('0x40')]['describe']()[_0x456d('0x24')](respondWithResult(_0x395796,null))[_0x456d('0x2f')](handleError(_0x395796,null));};var interaction_log=require(_0x456d('0x14'))(_0x456d('0x5f'));exports[_0x456d('0x60')]=function(_0x1884ab,_0x180ed8,_0xfaa238){var _0x2c524b={'channel':_0x456d('0x61')};if(_0x1884ab[_0x456d('0x5c')]['id']){delete _0x1884ab[_0x456d('0x5c')]['id'];}_0x1884ab[_0x456d('0x5c')]['read']=!![];_0x1884ab['body'][_0x456d('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1884ab[_0x456d('0x5c')]['UserId']=_0x1884ab['body'][_0x456d('0x63')]||_0x1884ab[_0x456d('0x64')]['id'];return db[_0x456d('0x40')]['find']({'where':{'id':_0x1884ab[_0x456d('0x5d')]['id'],'UserId':null},'include':[{'model':db[_0x456d('0x65')],'as':_0x456d('0x66')}]})[_0x456d('0x24')](handleEntityNotFound(_0x180ed8,null))[_0x456d('0x24')](saveUpdates(_0x1884ab[_0x456d('0x5c')],null))['then'](function(_0x596b33){if(_0x596b33){_0x2c524b['message']=_0x596b33[_0x456d('0x67')]({'plain':!![]});return db[_0x456d('0x68')][_0x456d('0x5a')]({'where':{'id':_0x596b33['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x180ed8,null))[_0x456d('0x24')](function(_0xf210a){if(_0xf210a){return _0xf210a[_0x456d('0x69')]({'UserId':_0x1884ab[_0x456d('0x5c')][_0x456d('0x63')],'read1stAt':_['isNil'](_0xf210a['read1stAt'])?moment()[_0x456d('0x6a')](_0x456d('0x6b')):undefined});}return null;})[_0x456d('0x24')](function(_0x5ebe5d){if(_0x5ebe5d){_0x2c524b[_0x456d('0x6c')]=_0x5ebe5d[_0x456d('0x67')]({'plain':!![]});interaction_log[_0x456d('0x25')](_0x456d('0x6d'),_0x1884ab[_0x456d('0x64')]['id'],_0x1884ab['user']['name'],_0x1884ab['user'][_0x456d('0x6e')],_0x2c524b[_0x456d('0x6c')]['id'],_0x1884ab[_0x456d('0x5c')]?JSON[_0x456d('0x29')](_0x1884ab[_0x456d('0x5c')]):_0x456d('0x6f'));return respondWithRpcPromise(_0x456d('0x70'),_0x456d('0x71'),_0x2c524b);}return null;})[_0x456d('0x24')](function(_0x223a22){if(_0x223a22){if(_0x1884ab[_0x456d('0x5c')][_0x456d('0x72')]){_0x2c524b[_0x456d('0x2d')][_0x456d('0x73')]=util[_0x456d('0x6a')](_0x456d('0x74'),_0x1884ab[_0x456d('0x64')][_0x456d('0x3c')]);_0x2c524b[_0x456d('0x2d')][_0x456d('0x75')]=_0x2c524b['channel'];_0x2c524b[_0x456d('0x2d')]['event']=_0x456d('0x60');return respondWithRpcPromise('EventManager',_0x456d('0x76'),{'event':_0x456d('0x77'),'message':_['merge'](_0x2c524b['message'],JSON[_0x456d('0x78')](_0x2c524b['interaction'][_0x456d('0x79')]))},client9002)['then'](function(){return _0x2c524b;});}return _0x2c524b;}return null;})[_0x456d('0x24')](respondWithResult(_0x180ed8,null))[_0x456d('0x2f')](handleError(_0x180ed8,null));};var interaction_log=require(_0x456d('0x14'))('chat-interactions');exports[_0x456d('0x37')]=function(_0x2fd68f,_0x5a3dfb,_0x3c19d9){var _0x39289f={'agent':{},'channel':_0x456d('0x61')};if(_0x2fd68f[_0x456d('0x5c')]['id']){delete _0x2fd68f['body']['id'];}_0x2fd68f[_0x456d('0x5c')]['UserId']=_0x2fd68f[_0x456d('0x5c')][_0x456d('0x63')]||_0x2fd68f[_0x456d('0x64')]['id'];_0x39289f[_0x456d('0x7a')]['id']=_0x2fd68f['body'][_0x456d('0x63')];return db[_0x456d('0x40')][_0x456d('0x5a')]({'where':{'id':_0x2fd68f[_0x456d('0x5d')]['id'],'UserId':null}})[_0x456d('0x24')](handleEntityNotFound(_0x5a3dfb,null))[_0x456d('0x24')](function(_0x57ed99){if(_0x57ed99){_0x39289f[_0x456d('0x2d')]=_0x57ed99[_0x456d('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x456d('0x5a')]({'where':{'id':_0x57ed99['ChatInteractionId']}});}return null;})[_0x456d('0x24')](handleEntityNotFound(_0x5a3dfb,null))[_0x456d('0x24')](function(_0x3730bd){if(_0x3730bd){_0x39289f[_0x456d('0x6c')]=_0x3730bd[_0x456d('0x67')]({'plain':!![]});interaction_log[_0x456d('0x25')](_0x456d('0x7b'),_0x2fd68f[_0x456d('0x64')]['id'],_0x2fd68f['user'][_0x456d('0x3c')],_0x2fd68f[_0x456d('0x64')][_0x456d('0x6e')],_0x39289f['interaction']['id'],_0x2fd68f['body']?JSON[_0x456d('0x29')](_0x2fd68f[_0x456d('0x5c')]):_0x456d('0x6f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x39289f);}return null;})[_0x456d('0x24')](function(_0x34be03){if(_0x34be03){_0x34be03[_0x456d('0x2d')]['interface']=util[_0x456d('0x6a')](_0x456d('0x74'),_0x2fd68f[_0x456d('0x64')][_0x456d('0x3c')]);_0x34be03[_0x456d('0x2d')]['channel']=_0x39289f[_0x456d('0x75')];_0x34be03['message'][_0x456d('0x7c')]=_0x456d('0x37');respondWithRpcPromise(_0x456d('0x76'),_0x456d('0x76'),{'event':'rejectmessage','message':_0x34be03[_0x456d('0x2d')]},client9002);return _0x39289f;}return null;})[_0x456d('0x24')](respondWithResult(_0x5a3dfb,null))[_0x456d('0x2f')](handleError(_0x5a3dfb,null));}; \ No newline at end of file +var _0xf7f6=['send','index','ChatMessage','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','show','params','rawAttributes','options','find','create','body','describe','accept','chat','read','readAt','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','manual','interface','SIP/%s','channel','event','EventManager','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatMessage.socket','register','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name'];(function(_0x2db3ac,_0x539958){var _0x1d1273=function(_0x1ee490){while(--_0x1ee490){_0x2db3ac['push'](_0x2db3ac['shift']());}};_0x1d1273(++_0x539958);}(_0xf7f6,0xb7));var _0x6f7f=function(_0x16e45e,_0x1b8bf9){_0x16e45e=_0x16e45e-0x0;var _0x2133ed=_0xf7f6[_0x16e45e];return _0x2133ed;};'use strict';var pdf=require(_0x6f7f('0x0'));var emlformat=require(_0x6f7f('0x1'));var rimraf=require(_0x6f7f('0x2'));var zipdir=require(_0x6f7f('0x3'));var jsonpatch=require(_0x6f7f('0x4'));var rp=require(_0x6f7f('0x5'));var moment=require(_0x6f7f('0x6'));var BPromise=require(_0x6f7f('0x7'));var Mustache=require(_0x6f7f('0x8'));var util=require(_0x6f7f('0x9'));var path=require('path');var sox=require(_0x6f7f('0xa'));var csv=require('to-csv');var ejs=require(_0x6f7f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6f7f('0xc'));var crypto=require(_0x6f7f('0xd'));var jsforce=require(_0x6f7f('0xe'));var deskjs=require(_0x6f7f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6f7f('0x10'));var Papa=require(_0x6f7f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6f7f('0x12'));var hardwareService=require(_0x6f7f('0x13'));var logger=require(_0x6f7f('0x14'))(_0x6f7f('0x15'));var utils=require('../../config/utils');var config=require(_0x6f7f('0x16'));var db=require('../../mysqldb')['db'];config[_0x6f7f('0x17')]=_['defaults'](config['redis'],{'host':_0x6f7f('0x18'),'port':0x18eb});var socket=require(_0x6f7f('0x19'))(new Redis(config[_0x6f7f('0x17')]));require(_0x6f7f('0x1a'))[_0x6f7f('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6f7f('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x6f7f('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x3861cf,_0x1c93d2,_0x1e6a3f){if(_0x1e6a3f){var _0x42e735=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42e735['test'](_0x1c93d2)){return _0x3861cf;}else{throw new db[(_0x6f7f('0x1d'))][(_0x6f7f('0x1e'))](_0x6f7f('0x1f'));}}else{return _0x3861cf;}}function respondWithRpcPromise(_0x428ce2,_0x3a88ea,_0x172b81,_0x1cf8d5){return new BPromise(function(_0x1aea7b,_0x5a5347){var _0x36febd=_0x1cf8d5||client;return _0x36febd[_0x6f7f('0x20')](_0x428ce2,_0x172b81)[_0x6f7f('0x21')](function(_0x424767){logger[_0x6f7f('0x22')](_0x6f7f('0x23'),_0x3a88ea,_0x6f7f('0x24'));logger['debug'](_0x6f7f('0x25'),_0x3a88ea,'request\x20sent',JSON[_0x6f7f('0x26')](_0x424767));if(_0x424767[_0x6f7f('0x27')]){if(_0x424767[_0x6f7f('0x27')]['code']===0x1f4){logger[_0x6f7f('0x27')](_0x6f7f('0x23'),_0x3a88ea,_0x424767['error'][_0x6f7f('0x28')]);return _0x5a5347(_0x424767[_0x6f7f('0x27')][_0x6f7f('0x28')]);}logger[_0x6f7f('0x27')](_0x6f7f('0x23'),_0x3a88ea,_0x424767[_0x6f7f('0x27')]['message']);return _0x1aea7b(_0x424767[_0x6f7f('0x27')]['message']);}else{logger['info'](_0x6f7f('0x23'),_0x3a88ea,_0x6f7f('0x24'));_0x1aea7b(_0x424767[_0x6f7f('0x29')][_0x6f7f('0x28')]);}})[_0x6f7f('0x2a')](function(_0x5cc8c4){logger[_0x6f7f('0x27')]('ChatMessage,\x20%s,\x20%s',_0x3a88ea,_0x5cc8c4);_0x5a5347(_0x5cc8c4);});});}function respondWithStatusCode(_0x10c55b,_0x4eb15e){_0x4eb15e=_0x4eb15e||0xcc;return function(_0x136bd6){if(_0x136bd6){return _0x10c55b[_0x6f7f('0x2b')](_0x4eb15e);}return _0x10c55b['status'](_0x4eb15e)['end']();};}function respondWithResult(_0x5e41a1,_0x14dfae){_0x14dfae=_0x14dfae||0xc8;return function(_0x90e11){if(_0x90e11){return _0x5e41a1[_0x6f7f('0x2c')](_0x14dfae)[_0x6f7f('0x2d')](_0x90e11);}};}function respondWithFilteredResult(_0x3e71ed,_0x7cd2f){return function(_0x343d11){if(_0x343d11){var _0x4e414d=_0x343d11['count'],_0x40bfae=_0x7cd2f[_0x6f7f('0x2e')],_0x18aea4=_0x7cd2f[_0x6f7f('0x2e')]+_0x7cd2f[_0x6f7f('0x2f')],_0xc430e2;if(_0x18aea4>=_0x4e414d){_0x18aea4=_0x4e414d;_0xc430e2=0xc8;}else{_0xc430e2=0xce;}_0x3e71ed[_0x6f7f('0x2c')](_0xc430e2);return _0x3e71ed[_0x6f7f('0x30')](_0x6f7f('0x31'),_0x40bfae+'-'+_0x18aea4+'/'+_0x4e414d)[_0x6f7f('0x2d')](_0x343d11);}return null;};}function patchUpdates(_0x212207){return function(_0x4488f8){try{jsonpatch['apply'](_0x4488f8,_0x212207,!![]);}catch(_0x599069){return BPromise[_0x6f7f('0x32')](_0x599069);}return _0x4488f8[_0x6f7f('0x33')]();};}function saveUpdates(_0x51aa78,_0xec284b){return function(_0x132fa7){if(_0x132fa7){return _0x132fa7[_0x6f7f('0x34')](_0x51aa78)[_0x6f7f('0x21')](function(_0x357745){return _0x357745;});}return null;};}function removeEntity(_0xab5a8,_0x106389){return function(_0x14405f){if(_0x14405f){return _0x14405f[_0x6f7f('0x35')]()[_0x6f7f('0x21')](function(){_0xab5a8[_0x6f7f('0x2c')](0xcc)[_0x6f7f('0x36')]();});}};}function handleEntityNotFound(_0x1587d9,_0x581b14){return function(_0x276546){if(!_0x276546){_0x1587d9[_0x6f7f('0x2b')](0x194);}return _0x276546;};}function handleError(_0x1a7533,_0x45bc05){_0x45bc05=_0x45bc05||0x1f4;return function(_0x254fc3){logger[_0x6f7f('0x27')](_0x254fc3[_0x6f7f('0x37')]);if(_0x254fc3[_0x6f7f('0x38')]){delete _0x254fc3[_0x6f7f('0x38')];}_0x1a7533['status'](_0x45bc05)[_0x6f7f('0x39')](_0x254fc3);};}exports[_0x6f7f('0x3a')]=function(_0x5912b6,_0x5b3317){var _0x41de5e={},_0x5e284b={},_0x2539a8={'count':0x0,'rows':[]};var _0x34095a=_['map'](db[_0x6f7f('0x3b')]['rawAttributes'],function(_0x4c10e9){return{'name':_0x4c10e9['fieldName'],'type':_0x4c10e9[_0x6f7f('0x3c')][_0x6f7f('0x3d')]};});_0x5e284b[_0x6f7f('0x3e')]=_[_0x6f7f('0x3f')](_0x34095a,_0x6f7f('0x38'));_0x5e284b[_0x6f7f('0x40')]=_[_0x6f7f('0x41')](_0x5912b6[_0x6f7f('0x40')]);_0x5e284b[_0x6f7f('0x42')]=_['intersection'](_0x5e284b[_0x6f7f('0x3e')],_0x5e284b[_0x6f7f('0x40')]);_0x41de5e[_0x6f7f('0x43')]=_[_0x6f7f('0x44')](_0x5e284b[_0x6f7f('0x3e')],qs[_0x6f7f('0x45')](_0x5912b6[_0x6f7f('0x40')][_0x6f7f('0x45')]));_0x41de5e[_0x6f7f('0x43')]=_0x41de5e[_0x6f7f('0x43')][_0x6f7f('0x46')]?_0x41de5e[_0x6f7f('0x43')]:_0x5e284b[_0x6f7f('0x3e')];if(!_0x5912b6[_0x6f7f('0x40')][_0x6f7f('0x47')](_0x6f7f('0x48'))){_0x41de5e[_0x6f7f('0x2f')]=qs[_0x6f7f('0x2f')](_0x5912b6[_0x6f7f('0x40')][_0x6f7f('0x2f')]);_0x41de5e[_0x6f7f('0x2e')]=qs['offset'](_0x5912b6[_0x6f7f('0x40')]['offset']);}_0x41de5e[_0x6f7f('0x49')]=qs['sort'](_0x5912b6[_0x6f7f('0x40')]['sort']);_0x41de5e['where']=qs['filters'](_[_0x6f7f('0x4a')](_0x5912b6[_0x6f7f('0x40')],_0x5e284b[_0x6f7f('0x42')]));if(_0x5912b6['query']['filter']){_0x41de5e[_0x6f7f('0x4b')]=_[_0x6f7f('0x4c')](_0x41de5e[_0x6f7f('0x4b')],{'$or':_[_0x6f7f('0x3f')](_0x34095a,function(_0x2a0cf6){if(_0x2a0cf6[_0x6f7f('0x3c')]!==_0x6f7f('0x4d')){var _0x4655a4={};_0x4655a4[_0x2a0cf6[_0x6f7f('0x38')]]={'$like':'%'+_0x5912b6[_0x6f7f('0x40')][_0x6f7f('0x4e')]+'%'};return _0x4655a4;}})});}_0x41de5e=_['merge']({},_0x41de5e,_0x5912b6['options']);var _0x25550a={'where':_0x41de5e[_0x6f7f('0x4b')]};return db['ChatMessage']['count'](_0x25550a)[_0x6f7f('0x21')](function(_0x275edf){_0x2539a8['count']=_0x275edf;if(_0x5912b6[_0x6f7f('0x40')][_0x6f7f('0x4f')]){_0x41de5e[_0x6f7f('0x50')]=[{'all':!![]}];}return db[_0x6f7f('0x3b')]['findAll'](_0x41de5e);})[_0x6f7f('0x21')](function(_0x5a2bac){_0x2539a8[_0x6f7f('0x51')]=_0x5a2bac;return _0x2539a8;})[_0x6f7f('0x21')](respondWithFilteredResult(_0x5b3317,_0x41de5e))['catch'](handleError(_0x5b3317,null));};exports[_0x6f7f('0x52')]=function(_0x4cfb2a,_0x58c18e){var _0x4b50d8={'raw':!![],'where':{'id':_0x4cfb2a[_0x6f7f('0x53')]['id']}},_0x589642={};_0x589642[_0x6f7f('0x3e')]=_['keys'](db[_0x6f7f('0x3b')][_0x6f7f('0x54')]);_0x589642['query']=_['keys'](_0x4cfb2a[_0x6f7f('0x40')]);_0x589642[_0x6f7f('0x42')]=_[_0x6f7f('0x44')](_0x589642[_0x6f7f('0x3e')],_0x589642[_0x6f7f('0x40')]);_0x4b50d8['attributes']=_['intersection'](_0x589642['model'],qs[_0x6f7f('0x45')](_0x4cfb2a['query'][_0x6f7f('0x45')]));_0x4b50d8[_0x6f7f('0x43')]=_0x4b50d8[_0x6f7f('0x43')]['length']?_0x4b50d8[_0x6f7f('0x43')]:_0x589642[_0x6f7f('0x3e')];if(_0x4cfb2a['query'][_0x6f7f('0x4f')]){_0x4b50d8[_0x6f7f('0x50')]=[{'all':!![]}];}_0x4b50d8=_[_0x6f7f('0x4c')]({},_0x4b50d8,_0x4cfb2a[_0x6f7f('0x55')]);return db[_0x6f7f('0x3b')][_0x6f7f('0x56')](_0x4b50d8)['then'](handleEntityNotFound(_0x58c18e,null))['then'](respondWithResult(_0x58c18e,null))[_0x6f7f('0x2a')](handleError(_0x58c18e,null));};exports[_0x6f7f('0x57')]=function(_0x30ef9d,_0x54ed34){return db['ChatMessage']['create'](_0x30ef9d['body'],{})['then'](respondWithResult(_0x54ed34,0xc9))[_0x6f7f('0x2a')](handleError(_0x54ed34,null));};exports['update']=function(_0x212482,_0x4b11db){if(_0x212482[_0x6f7f('0x58')]['id']){delete _0x212482[_0x6f7f('0x58')]['id'];}return db['ChatMessage'][_0x6f7f('0x56')]({'where':{'id':_0x212482['params']['id']}})[_0x6f7f('0x21')](handleEntityNotFound(_0x4b11db,null))['then'](saveUpdates(_0x212482[_0x6f7f('0x58')],null))['then'](respondWithResult(_0x4b11db,null))[_0x6f7f('0x2a')](handleError(_0x4b11db,null));};exports['destroy']=function(_0x2acf06,_0x25ac51){return db[_0x6f7f('0x3b')][_0x6f7f('0x56')]({'where':{'id':_0x2acf06[_0x6f7f('0x53')]['id']}})['then'](handleEntityNotFound(_0x25ac51,null))[_0x6f7f('0x21')](removeEntity(_0x25ac51,null))[_0x6f7f('0x2a')](handleError(_0x25ac51,null));};exports['describe']=function(_0x66c074,_0x4b6371){return db['ChatMessage'][_0x6f7f('0x59')]()[_0x6f7f('0x21')](respondWithResult(_0x4b6371,null))[_0x6f7f('0x2a')](handleError(_0x4b6371,null));};var interaction_log=require(_0x6f7f('0x14'))('chat-interactions');exports[_0x6f7f('0x5a')]=function(_0x3d9315,_0x11434b,_0x399aa3){var _0x317c5d={'channel':_0x6f7f('0x5b')};if(_0x3d9315[_0x6f7f('0x58')]['id']){delete _0x3d9315[_0x6f7f('0x58')]['id'];}_0x3d9315[_0x6f7f('0x58')][_0x6f7f('0x5c')]=!![];_0x3d9315[_0x6f7f('0x58')][_0x6f7f('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d9315[_0x6f7f('0x58')][_0x6f7f('0x5e')]=_0x3d9315[_0x6f7f('0x58')][_0x6f7f('0x5e')]||_0x3d9315[_0x6f7f('0x5f')]['id'];return db[_0x6f7f('0x3b')][_0x6f7f('0x56')]({'where':{'id':_0x3d9315[_0x6f7f('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x6f7f('0x60')],'as':_0x6f7f('0x61')}]})[_0x6f7f('0x21')](handleEntityNotFound(_0x11434b,null))['then'](saveUpdates(_0x3d9315['body'],null))[_0x6f7f('0x21')](function(_0xead478){if(_0xead478){_0x317c5d[_0x6f7f('0x28')]=_0xead478[_0x6f7f('0x62')]({'plain':!![]});return db[_0x6f7f('0x63')]['find']({'where':{'id':_0xead478[_0x6f7f('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x11434b,null))['then'](function(_0x1fd59e){if(_0x1fd59e){return _0x1fd59e[_0x6f7f('0x34')]({'UserId':_0x3d9315[_0x6f7f('0x58')][_0x6f7f('0x5e')],'read1stAt':_[_0x6f7f('0x65')](_0x1fd59e['read1stAt'])?moment()[_0x6f7f('0x66')](_0x6f7f('0x67')):undefined});}return null;})['then'](function(_0x215f0f){if(_0x215f0f){_0x317c5d[_0x6f7f('0x68')]=_0x215f0f[_0x6f7f('0x62')]({'plain':!![]});interaction_log[_0x6f7f('0x22')](_0x6f7f('0x69'),_0x3d9315[_0x6f7f('0x5f')]['id'],_0x3d9315['user'][_0x6f7f('0x38')],_0x3d9315[_0x6f7f('0x5f')]['role'],_0x317c5d[_0x6f7f('0x68')]['id'],_0x3d9315[_0x6f7f('0x58')]?JSON[_0x6f7f('0x26')](_0x3d9315[_0x6f7f('0x58')]):_0x6f7f('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x317c5d);}return null;})['then'](function(_0x56bcb5){if(_0x56bcb5){if(_0x3d9315[_0x6f7f('0x58')][_0x6f7f('0x6b')]){_0x317c5d[_0x6f7f('0x28')][_0x6f7f('0x6c')]=util[_0x6f7f('0x66')](_0x6f7f('0x6d'),_0x3d9315[_0x6f7f('0x5f')]['name']);_0x317c5d[_0x6f7f('0x28')][_0x6f7f('0x6e')]=_0x317c5d['channel'];_0x317c5d[_0x6f7f('0x28')][_0x6f7f('0x6f')]=_0x6f7f('0x5a');return respondWithRpcPromise(_0x6f7f('0x70'),_0x6f7f('0x70'),{'event':'acceptmessage','message':_[_0x6f7f('0x4c')](_0x317c5d[_0x6f7f('0x28')],JSON[_0x6f7f('0x71')](_0x317c5d[_0x6f7f('0x68')][_0x6f7f('0x72')]))},client9002)[_0x6f7f('0x21')](function(){return _0x317c5d;});}return _0x317c5d;}return null;})[_0x6f7f('0x21')](respondWithResult(_0x11434b,null))[_0x6f7f('0x2a')](handleError(_0x11434b,null));};var interaction_log=require(_0x6f7f('0x14'))('chat-interactions');exports[_0x6f7f('0x32')]=function(_0x3e01a6,_0x28ece9,_0x19f7b2){var _0x2a87f9={'agent':{},'channel':_0x6f7f('0x5b')};if(_0x3e01a6[_0x6f7f('0x58')]['id']){delete _0x3e01a6['body']['id'];}_0x3e01a6[_0x6f7f('0x58')][_0x6f7f('0x5e')]=_0x3e01a6[_0x6f7f('0x58')][_0x6f7f('0x5e')]||_0x3e01a6[_0x6f7f('0x5f')]['id'];_0x2a87f9[_0x6f7f('0x73')]['id']=_0x3e01a6[_0x6f7f('0x58')][_0x6f7f('0x5e')];return db[_0x6f7f('0x3b')][_0x6f7f('0x56')]({'where':{'id':_0x3e01a6['params']['id'],'UserId':null}})[_0x6f7f('0x21')](handleEntityNotFound(_0x28ece9,null))['then'](function(_0x500ee5){if(_0x500ee5){_0x2a87f9[_0x6f7f('0x28')]=_0x500ee5[_0x6f7f('0x62')]({'plain':!![]});return db[_0x6f7f('0x63')][_0x6f7f('0x56')]({'where':{'id':_0x500ee5['ChatInteractionId']}});}return null;})[_0x6f7f('0x21')](handleEntityNotFound(_0x28ece9,null))[_0x6f7f('0x21')](function(_0x51edd0){if(_0x51edd0){_0x2a87f9[_0x6f7f('0x68')]=_0x51edd0['get']({'plain':!![]});interaction_log[_0x6f7f('0x22')](_0x6f7f('0x74'),_0x3e01a6[_0x6f7f('0x5f')]['id'],_0x3e01a6['user'][_0x6f7f('0x38')],_0x3e01a6[_0x6f7f('0x5f')]['role'],_0x2a87f9[_0x6f7f('0x68')]['id'],_0x3e01a6[_0x6f7f('0x58')]?JSON[_0x6f7f('0x26')](_0x3e01a6[_0x6f7f('0x58')]):_0x6f7f('0x6a'));return respondWithRpcPromise(_0x6f7f('0x75'),_0x6f7f('0x76'),_0x2a87f9);}return null;})[_0x6f7f('0x21')](function(_0x21a817){if(_0x21a817){_0x21a817['message'][_0x6f7f('0x6c')]=util[_0x6f7f('0x66')](_0x6f7f('0x6d'),_0x3e01a6[_0x6f7f('0x5f')][_0x6f7f('0x38')]);_0x21a817[_0x6f7f('0x28')][_0x6f7f('0x6e')]=_0x2a87f9[_0x6f7f('0x6e')];_0x21a817[_0x6f7f('0x28')][_0x6f7f('0x6f')]=_0x6f7f('0x32');respondWithRpcPromise(_0x6f7f('0x70'),_0x6f7f('0x70'),{'event':_0x6f7f('0x77'),'message':_0x21a817[_0x6f7f('0x28')]},client9002);return _0x2a87f9;}return null;})[_0x6f7f('0x21')](respondWithResult(_0x28ece9,null))['catch'](handleError(_0x28ece9,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 2ccb11e..8605b8c 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ecc=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x2bed5d,_0x5d2b32){var _0x510dff=function(_0x228f8b){while(--_0x228f8b){_0x2bed5d['push'](_0x2bed5d['shift']());}};_0x510dff(++_0x5d2b32);}(_0x7ecc,0xcd));var _0xc7ec=function(_0x4ccba9,_0x5b091e){_0x4ccba9=_0x4ccba9-0x0;var _0x4da7e3=_0x7ecc[_0x4ccba9];return _0x4da7e3;};'use strict';var EventEmitter=require(_0xc7ec('0x0'));var ChatMessage=require(_0xc7ec('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc7ec('0x2')](0x0);var events={'afterCreate':_0xc7ec('0x3'),'afterUpdate':_0xc7ec('0x4'),'afterDestroy':_0xc7ec('0x5')};function emitEvent(_0x2d28d4){return function(_0x3f2e1d,_0x390c32,_0x35d599){ChatMessageEvents[_0xc7ec('0x6')](_0x2d28d4+':'+_0x3f2e1d['id'],_0x3f2e1d);ChatMessageEvents[_0xc7ec('0x6')](_0x2d28d4,_0x3f2e1d);_0x35d599(null);};}for(var e in events){if(events[_0xc7ec('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x3515=['exports','events','../../mysqldb','ChatMessage','remove','emit','hasOwnProperty'];(function(_0x2380f3,_0x52bbf1){var _0x44c546=function(_0x1dc23b){while(--_0x1dc23b){_0x2380f3['push'](_0x2380f3['shift']());}};_0x44c546(++_0x52bbf1);}(_0x3515,0x78));var _0x5351=function(_0x2242d9,_0x12fd91){_0x2242d9=_0x2242d9-0x0;var _0x251043=_0x3515[_0x2242d9];return _0x251043;};'use strict';var EventEmitter=require(_0x5351('0x0'));var ChatMessage=require(_0x5351('0x1'))['db'][_0x5351('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5351('0x3')};function emitEvent(_0x3f618f){return function(_0x2668b6,_0x16c029,_0xc5ebda){ChatMessageEvents[_0x5351('0x4')](_0x3f618f+':'+_0x2668b6['id'],_0x2668b6);ChatMessageEvents[_0x5351('0x4')](_0x3f618f,_0x2668b6);_0xc5ebda(null);};}for(var e in events){if(events[_0x5351('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5351('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index d0301e3..e8c1268 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57fc=['util','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1522db,_0x7efece){var _0x165585=function(_0x1c8f19){while(--_0x1c8f19){_0x1522db['push'](_0x1522db['shift']());}};_0x165585(++_0x7efece);}(_0x57fc,0xe7));var _0xc57f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57fc[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc57f('0x0'));var util=require(_0xc57f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc57f('0x2'));var BPromise=require(_0xc57f('0x3'));var rp=require(_0xc57f('0x4'));var fs=require('fs');var path=require(_0xc57f('0x5'));var rimraf=require('rimraf');var config=require(_0xc57f('0x6'));var attributes=require(_0xc57f('0x7'));module['exports']=function(_0x5533e4,_0xd112d1){return _0x5533e4[_0xc57f('0x8')](_0xc57f('0x9'),attributes,{'tableName':_0xc57f('0xa'),'paranoid':![],'indexes':[{'name':_0xc57f('0xb'),'fields':[_0xc57f('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x509c8c,_0x1242d4,_0x5cb3ba){var _0xa6ddc4=_0x5533e4[_0xc57f('0xd')];var _0x28456b=_0x509c8c[_0xc57f('0xe')]({'plain':!![]});if(_0x28456b['direction'][_0xc57f('0xf')]()==='in'||_0x28456b[_0xc57f('0x10')][_0xc57f('0xf')]()==='out'&&!_0x28456b[_0xc57f('0x11')]&&!_[_0xc57f('0x12')](_0x28456b[_0xc57f('0x13')])){_0xa6ddc4[_0xc57f('0x14')][_0xc57f('0x15')]({'where':{'id':_0x28456b[_0xc57f('0x16')]}})[_0xc57f('0x17')](function(_0x4279d9){if(_0x4279d9){_0x4279d9['update']({'lastMsgAt':_0x28456b[_0xc57f('0x18')],'lastMsgDirection':_0x28456b[_0xc57f('0x10')]['toLowerCase']()});}})[_0xc57f('0x19')](function(_0x87033a){console[_0xc57f('0x1a')](_0x87033a);});}_0x5cb3ba();}},'charset':_0xc57f('0x1b'),'collate':_0xc57f('0x1c')});}; \ No newline at end of file +var _0x53bd=['ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','toLowerCase','direction','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x5407f6,_0x50cbcc){var _0x3e1905=function(_0x142af6){while(--_0x142af6){_0x5407f6['push'](_0x5407f6['shift']());}};_0x3e1905(++_0x50cbcc);}(_0x53bd,0x190));var _0xd53b=function(_0x220719,_0x1cabf9){_0x220719=_0x220719-0x0;var _0x28b05e=_0x53bd[_0x220719];return _0x28b05e;};'use strict';var _=require(_0xd53b('0x0'));var util=require(_0xd53b('0x1'));var logger=require('../../config/logger')(_0xd53b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd53b('0x3'));var rimraf=require(_0xd53b('0x4'));var config=require(_0xd53b('0x5'));var attributes=require(_0xd53b('0x6'));module['exports']=function(_0x1d1267,_0x1fc54a){return _0x1d1267[_0xd53b('0x7')](_0xd53b('0x8'),attributes,{'tableName':_0xd53b('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xd53b('0xa')],'type':_0xd53b('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e93dd,_0x4eedb9,_0x3b1fbf){var _0x220b3f=_0x1d1267[_0xd53b('0xc')];var _0x20c7a6=_0x3e93dd['get']({'plain':!![]});if(_0x20c7a6['direction'][_0xd53b('0xd')]()==='in'||_0x20c7a6[_0xd53b('0xe')][_0xd53b('0xd')]()==='out'&&!_0x20c7a6[_0xd53b('0xf')]&&!_[_0xd53b('0x10')](_0x20c7a6[_0xd53b('0x11')])){_0x220b3f[_0xd53b('0x12')][_0xd53b('0x13')]({'where':{'id':_0x20c7a6[_0xd53b('0x14')]}})[_0xd53b('0x15')](function(_0x5abb39){if(_0x5abb39){_0x5abb39[_0xd53b('0x16')]({'lastMsgAt':_0x20c7a6[_0xd53b('0x17')],'lastMsgDirection':_0x20c7a6[_0xd53b('0xe')][_0xd53b('0xd')]()});}})[_0xd53b('0x18')](function(_0x195950){console[_0xd53b('0x19')](_0x195950);});}_0x3b1fbf();}},'charset':_0xd53b('0x1a'),'collate':_0xd53b('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 85f6d0e..91e721a 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x243d=['CreateChatMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','create','body','options','raw'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x243d,0x155));var _0xd243=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x243d[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require(_0xd243('0x0'));var moment=require(_0xd243('0x1'));var BPromise=require(_0xd243('0x2'));var rs=require(_0xd243('0x3'));var fs=require('fs');var Redis=require(_0xd243('0x4'));var db=require(_0xd243('0x5'))['db'];var utils=require(_0xd243('0x6'));var logger=require(_0xd243('0x7'))(_0xd243('0x8'));var config=require(_0xd243('0x9'));var jayson=require(_0xd243('0xa'));var client=jayson[_0xd243('0xb')][_0xd243('0xc')]({'port':0x232a});config[_0xd243('0xd')]=_['defaults'](config[_0xd243('0xd')],{'host':_0xd243('0xe'),'port':0x18eb});var socket=require(_0xd243('0xf'))(new Redis(config['redis']));require(_0xd243('0x10'))[_0xd243('0x11')](socket);function respondWithRpcPromise(_0x39d666,_0x437c48,_0x5741d1){return new BPromise(function(_0x59eb2a,_0x1ebfb5){return client[_0xd243('0x12')](_0x39d666,_0x5741d1)[_0xd243('0x13')](function(_0x3a1564){logger['info'](_0xd243('0x14'),_0x437c48,'request\x20sent');logger[_0xd243('0x15')](_0xd243('0x16'),_0x437c48,_0xd243('0x17'),JSON[_0xd243('0x18')](_0x3a1564));if(_0x3a1564[_0xd243('0x19')]){if(_0x3a1564[_0xd243('0x19')]['code']===0x1f4){logger[_0xd243('0x19')](_0xd243('0x14'),_0x437c48,_0x3a1564[_0xd243('0x19')][_0xd243('0x1a')]);return _0x1ebfb5(_0x3a1564[_0xd243('0x19')][_0xd243('0x1a')]);}logger[_0xd243('0x19')]('ChatMessage,\x20%s,\x20%s',_0x437c48,_0x3a1564[_0xd243('0x19')]['message']);return _0x59eb2a(_0x3a1564[_0xd243('0x19')][_0xd243('0x1a')]);}else{logger[_0xd243('0x1b')]('ChatMessage,\x20%s,\x20%s',_0x437c48,'request\x20sent');_0x59eb2a(_0x3a1564['result'][_0xd243('0x1a')]);}})[_0xd243('0x1c')](function(_0x68c7f8){logger[_0xd243('0x19')](_0xd243('0x14'),_0x437c48,_0x68c7f8);_0x1ebfb5(_0x68c7f8);});});}exports['CreateChatMessage']=function(_0x4e887f){var _0xade739=this;return new Promise(function(_0xd1c3e9,_0x368c0f){return db['ChatMessage'][_0xd243('0x1d')](_0x4e887f[_0xd243('0x1e')],{'raw':_0x4e887f[_0xd243('0x1f')]?_0x4e887f[_0xd243('0x1f')][_0xd243('0x20')]===undefined?!![]:![]:!![]})[_0xd243('0x13')](function(_0x54f00f){logger[_0xd243('0x1b')](_0xd243('0x21'),_0x4e887f);logger[_0xd243('0x15')]('CreateChatMessage',_0x4e887f,JSON[_0xd243('0x18')](_0x54f00f));_0xd1c3e9(_0x54f00f);})[_0xd243('0x1c')](function(_0xfb165f){logger[_0xd243('0x19')](_0xd243('0x21'),_0xfb165f[_0xd243('0x1a')],_0x4e887f);_0x368c0f(_0xade739[_0xd243('0x19')](0x1f4,_0xfb165f['message']));});});}; \ No newline at end of file +var _0xe02f=['body','options','raw','CreateChatMessage','debug','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatMessage','create'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0xe02f,0xd1));var _0xfe02=function(_0x581d90,_0x40fa2a){_0x581d90=_0x581d90-0x0;var _0x39247f=_0xe02f[_0x581d90];return _0x39247f;};'use strict';var _=require(_0xfe02('0x0'));var util=require(_0xfe02('0x1'));var moment=require(_0xfe02('0x2'));var BPromise=require('bluebird');var rs=require(_0xfe02('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfe02('0x4'));var logger=require(_0xfe02('0x5'))(_0xfe02('0x6'));var config=require('../../config/environment');var jayson=require(_0xfe02('0x7'));var client=jayson[_0xfe02('0x8')][_0xfe02('0x9')]({'port':0x232a});config[_0xfe02('0xa')]=_[_0xfe02('0xb')](config[_0xfe02('0xa')],{'host':_0xfe02('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe02('0xa')]));require(_0xfe02('0xd'))[_0xfe02('0xe')](socket);function respondWithRpcPromise(_0x20c61a,_0x57fcdb,_0x5e1508){return new BPromise(function(_0x334995,_0x47266b){return client[_0xfe02('0xf')](_0x20c61a,_0x5e1508)[_0xfe02('0x10')](function(_0x4332dc){logger['info'](_0xfe02('0x11'),_0x57fcdb,_0xfe02('0x12'));logger['debug'](_0xfe02('0x13'),_0x57fcdb,'request\x20sent',JSON[_0xfe02('0x14')](_0x4332dc));if(_0x4332dc[_0xfe02('0x15')]){if(_0x4332dc[_0xfe02('0x15')][_0xfe02('0x16')]===0x1f4){logger[_0xfe02('0x15')](_0xfe02('0x11'),_0x57fcdb,_0x4332dc['error'][_0xfe02('0x17')]);return _0x47266b(_0x4332dc[_0xfe02('0x15')][_0xfe02('0x17')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x57fcdb,_0x4332dc[_0xfe02('0x15')][_0xfe02('0x17')]);return _0x334995(_0x4332dc['error'][_0xfe02('0x17')]);}else{logger[_0xfe02('0x18')](_0xfe02('0x11'),_0x57fcdb,'request\x20sent');_0x334995(_0x4332dc[_0xfe02('0x19')][_0xfe02('0x17')]);}})[_0xfe02('0x1a')](function(_0x20a11b){logger['error']('ChatMessage,\x20%s,\x20%s',_0x57fcdb,_0x20a11b);_0x47266b(_0x20a11b);});});}exports['CreateChatMessage']=function(_0x2f825f){var _0xad6d27=this;return new Promise(function(_0x12e995,_0x2bd53e){return db[_0xfe02('0x1b')][_0xfe02('0x1c')](_0x2f825f[_0xfe02('0x1d')],{'raw':_0x2f825f[_0xfe02('0x1e')]?_0x2f825f['options'][_0xfe02('0x1f')]===undefined?!![]:![]:!![]})[_0xfe02('0x10')](function(_0x210f6d){logger[_0xfe02('0x18')](_0xfe02('0x20'),_0x2f825f);logger[_0xfe02('0x21')](_0xfe02('0x20'),_0x2f825f,JSON[_0xfe02('0x14')](_0x210f6d));_0x12e995(_0x210f6d);})[_0xfe02('0x1a')](function(_0x1d71a6){logger['error']('CreateChatMessage',_0x1d71a6[_0xfe02('0x17')],_0x2f825f);_0x2bd53e(_0xad6d27[_0xfe02('0x15')](0x1f4,_0x1d71a6[_0xfe02('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 828dac1..605df3f 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1623=['removeListener','length','chatMessage:','./chatMessage.events','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0xd32b5a,_0x55795e){_0xd32b5a=_0xd32b5a-0x0;var _0x4c891d=_0x1623[_0xd32b5a];return _0x4c891d;};'use strict';var ChatMessageEvents=require(_0x3162('0x0'));var events=['save','remove',_0x3162('0x1')];function createListener(_0x27ee21,_0x36ccc3){return function(_0x2cc4d7){_0x36ccc3[_0x3162('0x2')](_0x27ee21,_0x2cc4d7);};}function removeListener(_0x4ce2bd,_0x5d49d0){return function(){ChatMessageEvents[_0x3162('0x3')](_0x4ce2bd,_0x5d49d0);};}exports['register']=function(_0x1b55f2){for(var _0x428de6=0x0,_0x53260d=events[_0x3162('0x4')];_0x428de6<_0x53260d;_0x428de6++){var _0x2dc07e=events[_0x428de6];var _0x26ee32=createListener(_0x3162('0x5')+_0x2dc07e,_0x1b55f2);ChatMessageEvents['on'](_0x2dc07e,_0x26ee32);}}; \ No newline at end of file +var _0x66fa=['emit','length','chatMessage:','./chatMessage.events','save','update'];(function(_0x26d4d1,_0x582277){var _0x45d5b7=function(_0xaf988d){while(--_0xaf988d){_0x26d4d1['push'](_0x26d4d1['shift']());}};_0x45d5b7(++_0x582277);}(_0x66fa,0x117));var _0xa66f=function(_0x76cb50,_0x4d69a6){_0x76cb50=_0x76cb50-0x0;var _0x98df16=_0x66fa[_0x76cb50];return _0x98df16;};'use strict';var ChatMessageEvents=require(_0xa66f('0x0'));var events=[_0xa66f('0x1'),'remove',_0xa66f('0x2')];function createListener(_0x2dcf24,_0x234f2d){return function(_0x12a38f){_0x234f2d[_0xa66f('0x3')](_0x2dcf24,_0x12a38f);};}function removeListener(_0x2a2abf,_0x3f4904){return function(){ChatMessageEvents['removeListener'](_0x2a2abf,_0x3f4904);};}exports['register']=function(_0x2239d3){for(var _0x20a150=0x0,_0x2f0b78=events[_0xa66f('0x4')];_0x20a150<_0x2f0b78;_0x20a150++){var _0x38b58b=events[_0x20a150];var _0x5096bf=createListener(_0xa66f('0x5')+_0x38b58b,_0x2239d3);ChatMessageEvents['on'](_0x38b58b,_0x5096bf);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a16fdf9..44d9f78 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1034=['post','tracked','chat','put','update','/:id/accept','accept','reject','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1034,0x8d));var _0x4103=function(_0x32a47d,_0x32e261){_0x32a47d=_0x32a47d-0x0;var _0x1a4559=_0x1034[_0x32a47d];return _0x1a4559;};'use strict';var multer=require(_0x4103('0x0'));var util=require(_0x4103('0x1'));var path=require(_0x4103('0x2'));var timeout=require('connect-timeout');var express=require(_0x4103('0x3'));var router=express[_0x4103('0x4')]();var auth=require(_0x4103('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4103('0x6'));var controller=require(_0x4103('0x7'));router[_0x4103('0x8')]('/',auth[_0x4103('0x9')](),controller['index']);router[_0x4103('0x8')](_0x4103('0xa'),auth[_0x4103('0x9')](),controller[_0x4103('0xb')]);router[_0x4103('0x8')](_0x4103('0xc'),auth[_0x4103('0x9')](),controller['show']);router[_0x4103('0xd')]('/',auth[_0x4103('0x9')](),interaction[_0x4103('0xe')](_0x4103('0xf'),'chatmessage:create'),controller['create']);router[_0x4103('0x10')](_0x4103('0xc'),controller[_0x4103('0x11')]);router[_0x4103('0x10')](_0x4103('0x12'),auth['isAuthenticated'](),controller[_0x4103('0x13')]);router[_0x4103('0x10')]('/:id/reject',auth[_0x4103('0x9')](),controller[_0x4103('0x14')]);router['delete'](_0x4103('0xc'),auth[_0x4103('0x9')](),controller['destroy']);module[_0x4103('0x15')]=router; \ No newline at end of file +var _0x74c8=['/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x74c8,0x149));var _0x874c=function(_0xf17de9,_0x2e8074){_0xf17de9=_0xf17de9-0x0;var _0x373917=_0x74c8[_0xf17de9];return _0x373917;};'use strict';var multer=require(_0x874c('0x0'));var util=require('util');var path=require(_0x874c('0x1'));var timeout=require(_0x874c('0x2'));var express=require('express');var router=express[_0x874c('0x3')]();var auth=require(_0x874c('0x4'));var interaction=require(_0x874c('0x5'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x874c('0x6')]('/',auth[_0x874c('0x7')](),controller[_0x874c('0x8')]);router[_0x874c('0x6')](_0x874c('0x9'),auth[_0x874c('0x7')](),controller[_0x874c('0xa')]);router[_0x874c('0x6')](_0x874c('0xb'),auth[_0x874c('0x7')](),controller[_0x874c('0xc')]);router[_0x874c('0xd')]('/',auth[_0x874c('0x7')](),interaction[_0x874c('0xe')](_0x874c('0xf'),_0x874c('0x10')),controller[_0x874c('0x11')]);router[_0x874c('0x12')]('/:id',controller[_0x874c('0x13')]);router[_0x874c('0x12')](_0x874c('0x14'),auth['isAuthenticated'](),controller[_0x874c('0x15')]);router[_0x874c('0x12')](_0x874c('0x16'),auth[_0x874c('0x7')](),controller['reject']);router[_0x874c('0x17')](_0x874c('0xb'),auth[_0x874c('0x7')](),controller[_0x874c('0x18')]);module[_0x874c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b80abc5..925c24e 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e16=['TEXT','sequelize','exports'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x8e16,0xc7));var _0x68e1=function(_0x35e7f1,_0x32b705){_0x35e7f1=_0x35e7f1-0x0;var _0x3ec0a5=_0x8e16[_0x35e7f1];return _0x3ec0a5;};'use strict';var Sequelize=require(_0x68e1('0x0'));module[_0x68e1('0x1')]={'body':{'type':Sequelize[_0x68e1('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x4702=['medium','exports','TEXT'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x4702,0xf4));var _0x2470=function(_0x47d3cc,_0x159ba2){_0x47d3cc=_0x47d3cc-0x0;var _0x2132c5=_0x4702[_0x47d3cc];return _0x2132c5;};'use strict';var Sequelize=require('sequelize');module[_0x2470('0x0')]={'body':{'type':Sequelize[_0x2470('0x1')](_0x2470('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index dfed9dd..de0be10 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cba=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','index','map','ChatOfflineMessage','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch','params','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5cba,0x15f));var _0xa5cb=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5cba[_0x4b055c];return _0x4b62bb;};'use strict';var pdf=require(_0xa5cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa5cb('0x1'));var zipdir=require(_0xa5cb('0x2'));var jsonpatch=require(_0xa5cb('0x3'));var rp=require(_0xa5cb('0x4'));var moment=require(_0xa5cb('0x5'));var BPromise=require(_0xa5cb('0x6'));var Mustache=require(_0xa5cb('0x7'));var util=require(_0xa5cb('0x8'));var path=require(_0xa5cb('0x9'));var sox=require(_0xa5cb('0xa'));var csv=require(_0xa5cb('0xb'));var ejs=require(_0xa5cb('0xc'));var fs=require('fs');var _=require(_0xa5cb('0xd'));var squel=require(_0xa5cb('0xe'));var crypto=require(_0xa5cb('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa5cb('0x10'));var toCsv=require(_0xa5cb('0xb'));var querystring=require(_0xa5cb('0x11'));var Papa=require(_0xa5cb('0x12'));var Redis=require(_0xa5cb('0x13'));var authService=require(_0xa5cb('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5cb('0x15'));var logger=require(_0xa5cb('0x16'))(_0xa5cb('0x17'));var utils=require(_0xa5cb('0x18'));var config=require(_0xa5cb('0x19'));var db=require(_0xa5cb('0x1a'))['db'];function respondWithStatusCode(_0x3be980,_0x59ac6a){_0x59ac6a=_0x59ac6a||0xcc;return function(_0x4b2da9){if(_0x4b2da9){return _0x3be980[_0xa5cb('0x1b')](_0x59ac6a);}return _0x3be980[_0xa5cb('0x1c')](_0x59ac6a)[_0xa5cb('0x1d')]();};}function respondWithResult(_0x580e54,_0x27d0a5){_0x27d0a5=_0x27d0a5||0xc8;return function(_0x33910f){if(_0x33910f){return _0x580e54[_0xa5cb('0x1c')](_0x27d0a5)[_0xa5cb('0x1e')](_0x33910f);}};}function respondWithFilteredResult(_0x476767,_0x1af0fa){return function(_0x341dc4){if(_0x341dc4){var _0x13c491=_0x341dc4['count'],_0x13dd23=_0x1af0fa[_0xa5cb('0x1f')],_0x5bdb39=_0x1af0fa['offset']+_0x1af0fa[_0xa5cb('0x20')],_0x663ba2;if(_0x5bdb39>=_0x13c491){_0x5bdb39=_0x13c491;_0x663ba2=0xc8;}else{_0x663ba2=0xce;}_0x476767[_0xa5cb('0x1c')](_0x663ba2);return _0x476767['set'](_0xa5cb('0x21'),_0x13dd23+'-'+_0x5bdb39+'/'+_0x13c491)['json'](_0x341dc4);}return null;};}function patchUpdates(_0x84da0d){return function(_0x5b1ba4){try{jsonpatch[_0xa5cb('0x22')](_0x5b1ba4,_0x84da0d,!![]);}catch(_0x54afa7){return BPromise[_0xa5cb('0x23')](_0x54afa7);}return _0x5b1ba4['save']();};}function saveUpdates(_0x45aa1b,_0x367294){return function(_0x243bea){if(_0x243bea){return _0x243bea[_0xa5cb('0x24')](_0x45aa1b)[_0xa5cb('0x25')](function(_0x3a1140){return _0x3a1140;});}return null;};}function removeEntity(_0x4c662d,_0x1c8c32){return function(_0x479df8){if(_0x479df8){return _0x479df8['destroy']()[_0xa5cb('0x25')](function(){_0x4c662d[_0xa5cb('0x1c')](0xcc)[_0xa5cb('0x1d')]();});}};}function handleEntityNotFound(_0xf8124f,_0x1b78c0){return function(_0x11f77b){if(!_0x11f77b){_0xf8124f[_0xa5cb('0x1b')](0x194);}return _0x11f77b;};}function handleError(_0x1ad587,_0x25e13b){_0x25e13b=_0x25e13b||0x1f4;return function(_0x50346b){logger[_0xa5cb('0x26')](_0x50346b[_0xa5cb('0x27')]);if(_0x50346b[_0xa5cb('0x28')]){delete _0x50346b[_0xa5cb('0x28')];}_0x1ad587[_0xa5cb('0x1c')](_0x25e13b)['send'](_0x50346b);};}exports[_0xa5cb('0x29')]=function(_0x2a2ea0,_0x227b84){var _0x49ec47={},_0x27bdc3={},_0x93227e={'count':0x0,'rows':[]};var _0x14edbd=_[_0xa5cb('0x2a')](db[_0xa5cb('0x2b')]['rawAttributes'],function(_0x2ff456){return{'name':_0x2ff456[_0xa5cb('0x2c')],'type':_0x2ff456[_0xa5cb('0x2d')][_0xa5cb('0x2e')]};});_0x27bdc3['model']=_[_0xa5cb('0x2a')](_0x14edbd,_0xa5cb('0x28'));_0x27bdc3[_0xa5cb('0x2f')]=_[_0xa5cb('0x30')](_0x2a2ea0[_0xa5cb('0x2f')]);_0x27bdc3[_0xa5cb('0x31')]=_[_0xa5cb('0x32')](_0x27bdc3['model'],_0x27bdc3['query']);_0x49ec47[_0xa5cb('0x33')]=_[_0xa5cb('0x32')](_0x27bdc3[_0xa5cb('0x34')],qs[_0xa5cb('0x35')](_0x2a2ea0[_0xa5cb('0x2f')][_0xa5cb('0x35')]));_0x49ec47[_0xa5cb('0x33')]=_0x49ec47[_0xa5cb('0x33')][_0xa5cb('0x36')]?_0x49ec47[_0xa5cb('0x33')]:_0x27bdc3['model'];if(!_0x2a2ea0[_0xa5cb('0x2f')]['hasOwnProperty'](_0xa5cb('0x37'))){_0x49ec47['limit']=qs[_0xa5cb('0x20')](_0x2a2ea0['query'][_0xa5cb('0x20')]);_0x49ec47[_0xa5cb('0x1f')]=qs['offset'](_0x2a2ea0['query'][_0xa5cb('0x1f')]);}_0x49ec47[_0xa5cb('0x38')]=qs['sort'](_0x2a2ea0[_0xa5cb('0x2f')][_0xa5cb('0x39')]);_0x49ec47[_0xa5cb('0x3a')]=qs[_0xa5cb('0x31')](_[_0xa5cb('0x3b')](_0x2a2ea0[_0xa5cb('0x2f')],_0x27bdc3['filters']));if(_0x2a2ea0['query'][_0xa5cb('0x3c')]){_0x49ec47[_0xa5cb('0x3a')]=_[_0xa5cb('0x3d')](_0x49ec47[_0xa5cb('0x3a')],{'$or':_[_0xa5cb('0x2a')](_0x14edbd,function(_0x55fb2d){if(_0x55fb2d[_0xa5cb('0x2d')]!=='VIRTUAL'){var _0x3bd502={};_0x3bd502[_0x55fb2d[_0xa5cb('0x28')]]={'$like':'%'+_0x2a2ea0[_0xa5cb('0x2f')][_0xa5cb('0x3c')]+'%'};return _0x3bd502;}})});}_0x49ec47=_[_0xa5cb('0x3d')]({},_0x49ec47,_0x2a2ea0[_0xa5cb('0x3e')]);var _0x37a5ce={'where':_0x49ec47['where']};return db['ChatOfflineMessage'][_0xa5cb('0x3f')](_0x37a5ce)[_0xa5cb('0x25')](function(_0x14d769){_0x93227e[_0xa5cb('0x3f')]=_0x14d769;if(_0x2a2ea0[_0xa5cb('0x2f')][_0xa5cb('0x40')]){_0x49ec47[_0xa5cb('0x41')]=[{'all':!![]}];}return db['ChatOfflineMessage']['findAll'](_0x49ec47);})[_0xa5cb('0x25')](function(_0x92cea0){_0x93227e[_0xa5cb('0x42')]=_0x92cea0;return _0x93227e;})['then'](respondWithFilteredResult(_0x227b84,_0x49ec47))[_0xa5cb('0x43')](handleError(_0x227b84,null));};exports['show']=function(_0x39afcb,_0x30bbb7){var _0x14883c={'raw':!![],'where':{'id':_0x39afcb[_0xa5cb('0x44')]['id']}},_0x4963ef={};_0x4963ef[_0xa5cb('0x34')]=_[_0xa5cb('0x30')](db[_0xa5cb('0x2b')]['rawAttributes']);_0x4963ef[_0xa5cb('0x2f')]=_[_0xa5cb('0x30')](_0x39afcb['query']);_0x4963ef[_0xa5cb('0x31')]=_[_0xa5cb('0x32')](_0x4963ef[_0xa5cb('0x34')],_0x4963ef[_0xa5cb('0x2f')]);_0x14883c[_0xa5cb('0x33')]=_[_0xa5cb('0x32')](_0x4963ef[_0xa5cb('0x34')],qs[_0xa5cb('0x35')](_0x39afcb[_0xa5cb('0x2f')][_0xa5cb('0x35')]));_0x14883c[_0xa5cb('0x33')]=_0x14883c['attributes']['length']?_0x14883c['attributes']:_0x4963ef[_0xa5cb('0x34')];if(_0x39afcb[_0xa5cb('0x2f')][_0xa5cb('0x40')]){_0x14883c['include']=[{'all':!![]}];}_0x14883c=_[_0xa5cb('0x3d')]({},_0x14883c,_0x39afcb[_0xa5cb('0x3e')]);return db[_0xa5cb('0x2b')][_0xa5cb('0x45')](_0x14883c)['then'](handleEntityNotFound(_0x30bbb7,null))[_0xa5cb('0x25')](respondWithResult(_0x30bbb7,null))[_0xa5cb('0x43')](handleError(_0x30bbb7,null));};exports['create']=function(_0x39937f,_0x4885ec){return db[_0xa5cb('0x2b')][_0xa5cb('0x46')](_0x39937f[_0xa5cb('0x47')],{})['then'](respondWithResult(_0x4885ec,0xc9))[_0xa5cb('0x43')](handleError(_0x4885ec,null));};exports[_0xa5cb('0x24')]=function(_0x563162,_0x58626f){if(_0x563162[_0xa5cb('0x47')]['id']){delete _0x563162[_0xa5cb('0x47')]['id'];}return db['ChatOfflineMessage'][_0xa5cb('0x45')]({'where':{'id':_0x563162[_0xa5cb('0x44')]['id']}})[_0xa5cb('0x25')](handleEntityNotFound(_0x58626f,null))[_0xa5cb('0x25')](saveUpdates(_0x563162[_0xa5cb('0x47')],null))[_0xa5cb('0x25')](respondWithResult(_0x58626f,null))[_0xa5cb('0x43')](handleError(_0x58626f,null));};exports[_0xa5cb('0x48')]=function(_0x4da7f2,_0x43583c){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4da7f2[_0xa5cb('0x44')]['id']}})[_0xa5cb('0x25')](handleEntityNotFound(_0x43583c,null))['then'](removeEntity(_0x43583c,null))['catch'](handleError(_0x43583c,null));};exports[_0xa5cb('0x49')]=function(_0x2e0932,_0x2f5e5f){return db[_0xa5cb('0x2b')][_0xa5cb('0x49')]()[_0xa5cb('0x25')](respondWithResult(_0x2f5e5f,null))[_0xa5cb('0x43')](handleError(_0x2f5e5f,null));}; \ No newline at end of file +var _0x3a2c=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatOfflineMessage','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','querystring'];(function(_0x2e8b66,_0x4eeac5){var _0x3c91d3=function(_0x36a96b){while(--_0x36a96b){_0x2e8b66['push'](_0x2e8b66['shift']());}};_0x3c91d3(++_0x4eeac5);}(_0x3a2c,0xd6));var _0xc3a2=function(_0x32ad42,_0x58d961){_0x32ad42=_0x32ad42-0x0;var _0x1827e2=_0x3a2c[_0x32ad42];return _0x1827e2;};'use strict';var pdf=require(_0xc3a2('0x0'));var emlformat=require(_0xc3a2('0x1'));var rimraf=require(_0xc3a2('0x2'));var zipdir=require(_0xc3a2('0x3'));var jsonpatch=require(_0xc3a2('0x4'));var rp=require(_0xc3a2('0x5'));var moment=require(_0xc3a2('0x6'));var BPromise=require(_0xc3a2('0x7'));var Mustache=require(_0xc3a2('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3a2('0x9'));var ejs=require(_0xc3a2('0xa'));var fs=require('fs');var _=require(_0xc3a2('0xb'));var squel=require(_0xc3a2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc3a2('0xd'));var Papa=require(_0xc3a2('0xe'));var Redis=require('ioredis');var authService=require(_0xc3a2('0xf'));var qs=require(_0xc3a2('0x10'));var as=require(_0xc3a2('0x11'));var hardwareService=require(_0xc3a2('0x12'));var logger=require(_0xc3a2('0x13'))(_0xc3a2('0x14'));var utils=require(_0xc3a2('0x15'));var config=require(_0xc3a2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39ee10,_0x49b06f){_0x49b06f=_0x49b06f||0xcc;return function(_0x5a90b8){if(_0x5a90b8){return _0x39ee10[_0xc3a2('0x17')](_0x49b06f);}return _0x39ee10[_0xc3a2('0x18')](_0x49b06f)['end']();};}function respondWithResult(_0x23c7b1,_0x23a552){_0x23a552=_0x23a552||0xc8;return function(_0x39318e){if(_0x39318e){return _0x23c7b1['status'](_0x23a552)[_0xc3a2('0x19')](_0x39318e);}};}function respondWithFilteredResult(_0x8cf740,_0x3c85d8){return function(_0x4c6676){if(_0x4c6676){var _0x31ebb5=_0x4c6676[_0xc3a2('0x1a')],_0xcab1d1=_0x3c85d8['offset'],_0x5219eb=_0x3c85d8[_0xc3a2('0x1b')]+_0x3c85d8[_0xc3a2('0x1c')],_0x3b33c1;if(_0x5219eb>=_0x31ebb5){_0x5219eb=_0x31ebb5;_0x3b33c1=0xc8;}else{_0x3b33c1=0xce;}_0x8cf740[_0xc3a2('0x18')](_0x3b33c1);return _0x8cf740[_0xc3a2('0x1d')](_0xc3a2('0x1e'),_0xcab1d1+'-'+_0x5219eb+'/'+_0x31ebb5)[_0xc3a2('0x19')](_0x4c6676);}return null;};}function patchUpdates(_0x2332bd){return function(_0x7e0a00){try{jsonpatch[_0xc3a2('0x1f')](_0x7e0a00,_0x2332bd,!![]);}catch(_0xae10f0){return BPromise['reject'](_0xae10f0);}return _0x7e0a00[_0xc3a2('0x20')]();};}function saveUpdates(_0x1b00b8,_0x12feda){return function(_0x4317c2){if(_0x4317c2){return _0x4317c2[_0xc3a2('0x21')](_0x1b00b8)[_0xc3a2('0x22')](function(_0x20aa11){return _0x20aa11;});}return null;};}function removeEntity(_0x17759a,_0x2acf24){return function(_0x5652ab){if(_0x5652ab){return _0x5652ab[_0xc3a2('0x23')]()['then'](function(){_0x17759a[_0xc3a2('0x18')](0xcc)[_0xc3a2('0x24')]();});}};}function handleEntityNotFound(_0x58c9ad,_0x16c59c){return function(_0x57a76c){if(!_0x57a76c){_0x58c9ad[_0xc3a2('0x17')](0x194);}return _0x57a76c;};}function handleError(_0x189f26,_0x115dff){_0x115dff=_0x115dff||0x1f4;return function(_0x1b40bf){logger[_0xc3a2('0x25')](_0x1b40bf[_0xc3a2('0x26')]);if(_0x1b40bf[_0xc3a2('0x27')]){delete _0x1b40bf[_0xc3a2('0x27')];}_0x189f26['status'](_0x115dff)[_0xc3a2('0x28')](_0x1b40bf);};}exports[_0xc3a2('0x29')]=function(_0x389480,_0x54625b){var _0x2408de={},_0x297ca5={},_0x50e64c={'count':0x0,'rows':[]};var _0x113640=_['map'](db['ChatOfflineMessage'][_0xc3a2('0x2a')],function(_0x536ee7){return{'name':_0x536ee7[_0xc3a2('0x2b')],'type':_0x536ee7[_0xc3a2('0x2c')][_0xc3a2('0x2d')]};});_0x297ca5[_0xc3a2('0x2e')]=_[_0xc3a2('0x2f')](_0x113640,'name');_0x297ca5['query']=_[_0xc3a2('0x30')](_0x389480[_0xc3a2('0x31')]);_0x297ca5[_0xc3a2('0x32')]=_[_0xc3a2('0x33')](_0x297ca5[_0xc3a2('0x2e')],_0x297ca5[_0xc3a2('0x31')]);_0x2408de[_0xc3a2('0x34')]=_[_0xc3a2('0x33')](_0x297ca5[_0xc3a2('0x2e')],qs[_0xc3a2('0x35')](_0x389480['query']['fields']));_0x2408de[_0xc3a2('0x34')]=_0x2408de[_0xc3a2('0x34')][_0xc3a2('0x36')]?_0x2408de[_0xc3a2('0x34')]:_0x297ca5['model'];if(!_0x389480[_0xc3a2('0x31')][_0xc3a2('0x37')](_0xc3a2('0x38'))){_0x2408de[_0xc3a2('0x1c')]=qs[_0xc3a2('0x1c')](_0x389480[_0xc3a2('0x31')]['limit']);_0x2408de[_0xc3a2('0x1b')]=qs[_0xc3a2('0x1b')](_0x389480[_0xc3a2('0x31')]['offset']);}_0x2408de[_0xc3a2('0x39')]=qs[_0xc3a2('0x3a')](_0x389480[_0xc3a2('0x31')][_0xc3a2('0x3a')]);_0x2408de[_0xc3a2('0x3b')]=qs[_0xc3a2('0x32')](_[_0xc3a2('0x3c')](_0x389480[_0xc3a2('0x31')],_0x297ca5[_0xc3a2('0x32')]));if(_0x389480[_0xc3a2('0x31')][_0xc3a2('0x3d')]){_0x2408de[_0xc3a2('0x3b')]=_['merge'](_0x2408de['where'],{'$or':_['map'](_0x113640,function(_0x32c2e0){if(_0x32c2e0[_0xc3a2('0x2c')]!=='VIRTUAL'){var _0x39eec8={};_0x39eec8[_0x32c2e0[_0xc3a2('0x27')]]={'$like':'%'+_0x389480['query']['filter']+'%'};return _0x39eec8;}})});}_0x2408de=_[_0xc3a2('0x3e')]({},_0x2408de,_0x389480[_0xc3a2('0x3f')]);var _0x51660f={'where':_0x2408de['where']};return db[_0xc3a2('0x40')][_0xc3a2('0x1a')](_0x51660f)[_0xc3a2('0x22')](function(_0x5011a0){_0x50e64c[_0xc3a2('0x1a')]=_0x5011a0;if(_0x389480[_0xc3a2('0x31')][_0xc3a2('0x41')]){_0x2408de[_0xc3a2('0x42')]=[{'all':!![]}];}return db[_0xc3a2('0x40')][_0xc3a2('0x43')](_0x2408de);})[_0xc3a2('0x22')](function(_0x1e4105){_0x50e64c[_0xc3a2('0x44')]=_0x1e4105;return _0x50e64c;})[_0xc3a2('0x22')](respondWithFilteredResult(_0x54625b,_0x2408de))[_0xc3a2('0x45')](handleError(_0x54625b,null));};exports[_0xc3a2('0x46')]=function(_0x370177,_0x1fc752){var _0x4baff1={'raw':!![],'where':{'id':_0x370177[_0xc3a2('0x47')]['id']}},_0x723d6c={};_0x723d6c[_0xc3a2('0x2e')]=_[_0xc3a2('0x30')](db[_0xc3a2('0x40')]['rawAttributes']);_0x723d6c[_0xc3a2('0x31')]=_['keys'](_0x370177[_0xc3a2('0x31')]);_0x723d6c[_0xc3a2('0x32')]=_[_0xc3a2('0x33')](_0x723d6c[_0xc3a2('0x2e')],_0x723d6c[_0xc3a2('0x31')]);_0x4baff1[_0xc3a2('0x34')]=_['intersection'](_0x723d6c[_0xc3a2('0x2e')],qs[_0xc3a2('0x35')](_0x370177[_0xc3a2('0x31')]['fields']));_0x4baff1['attributes']=_0x4baff1[_0xc3a2('0x34')][_0xc3a2('0x36')]?_0x4baff1[_0xc3a2('0x34')]:_0x723d6c[_0xc3a2('0x2e')];if(_0x370177[_0xc3a2('0x31')][_0xc3a2('0x41')]){_0x4baff1[_0xc3a2('0x42')]=[{'all':!![]}];}_0x4baff1=_[_0xc3a2('0x3e')]({},_0x4baff1,_0x370177['options']);return db[_0xc3a2('0x40')]['find'](_0x4baff1)[_0xc3a2('0x22')](handleEntityNotFound(_0x1fc752,null))[_0xc3a2('0x22')](respondWithResult(_0x1fc752,null))[_0xc3a2('0x45')](handleError(_0x1fc752,null));};exports['create']=function(_0xe8b710,_0x3e777f){return db[_0xc3a2('0x40')][_0xc3a2('0x48')](_0xe8b710['body'],{})[_0xc3a2('0x22')](respondWithResult(_0x3e777f,0xc9))['catch'](handleError(_0x3e777f,null));};exports[_0xc3a2('0x21')]=function(_0x227a17,_0x271ee3){if(_0x227a17['body']['id']){delete _0x227a17[_0xc3a2('0x49')]['id'];}return db['ChatOfflineMessage'][_0xc3a2('0x4a')]({'where':{'id':_0x227a17[_0xc3a2('0x47')]['id']}})['then'](handleEntityNotFound(_0x271ee3,null))[_0xc3a2('0x22')](saveUpdates(_0x227a17['body'],null))[_0xc3a2('0x22')](respondWithResult(_0x271ee3,null))['catch'](handleError(_0x271ee3,null));};exports[_0xc3a2('0x23')]=function(_0x436783,_0xf085c4){return db[_0xc3a2('0x40')][_0xc3a2('0x4a')]({'where':{'id':_0x436783[_0xc3a2('0x47')]['id']}})[_0xc3a2('0x22')](handleEntityNotFound(_0xf085c4,null))[_0xc3a2('0x22')](removeEntity(_0xf085c4,null))[_0xc3a2('0x45')](handleError(_0xf085c4,null));};exports[_0xc3a2('0x4b')]=function(_0x3de2ee,_0x5887b1){return db[_0xc3a2('0x40')][_0xc3a2('0x4b')]()[_0xc3a2('0x22')](respondWithResult(_0x5887b1,null))[_0xc3a2('0x45')](handleError(_0x5887b1,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index a4cf049..13aec30 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['chat_offline_messages','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x29c1a7,_0x36546b){var _0x476e35=function(_0x44ec6e){while(--_0x44ec6e){_0x29c1a7['push'](_0x29c1a7['shift']());}};_0x476e35(++_0x36546b);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x49c4('0xa')});}; \ No newline at end of file +var _0xf72b=['bluebird','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x4fb614,_0x3f1326){var _0x14222b=function(_0x5e3873){while(--_0x5e3873){_0x4fb614['push'](_0x4fb614['shift']());}};_0x14222b(++_0x3f1326);}(_0xf72b,0x1d9));var _0xbf72=function(_0x48cef5,_0x541d90){_0x48cef5=_0x48cef5-0x0;var _0x739094=_0xf72b[_0x48cef5];return _0x739094;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var logger=require(_0xbf72('0x1'))('api');var moment=require(_0xbf72('0x2'));var BPromise=require(_0xbf72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf72('0x4'));var rimraf=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var attributes=require(_0xbf72('0x7'));module[_0xbf72('0x8')]=function(_0x2b8440,_0x5ee060){return _0x2b8440[_0xbf72('0x9')](_0xbf72('0xa'),attributes,{'tableName':_0xbf72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf72('0xc'),'collate':_0xbf72('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index a567d65..58283d1 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c95=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x5d41a3,_0x3ff175){var _0x4cc541=function(_0x1f494c){while(--_0x1f494c){_0x5d41a3['push'](_0x5d41a3['shift']());}};_0x4cc541(++_0x3ff175);}(_0x3c95,0x160));var _0x53c9=function(_0x2ec2f1,_0xcfc2ba){_0x2ec2f1=_0x2ec2f1-0x0;var _0x2b39c6=_0x3c95[_0x2ec2f1];return _0x2b39c6;};'use strict';var _=require('lodash');var util=require(_0x53c9('0x0'));var moment=require(_0x53c9('0x1'));var BPromise=require(_0x53c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53c9('0x3'));var db=require(_0x53c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x53c9('0x5'))('rpc');var config=require(_0x53c9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x53c9('0x7')][_0x53c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x492c0b,_0x7e5011,_0x347875){return new BPromise(function(_0x3f1f1d,_0xdce2b){return client['request'](_0x492c0b,_0x347875)[_0x53c9('0x9')](function(_0x3669a4){logger[_0x53c9('0xa')](_0x53c9('0xb'),_0x7e5011,_0x53c9('0xc'));logger['debug'](_0x53c9('0xd'),_0x7e5011,_0x53c9('0xc'),JSON[_0x53c9('0xe')](_0x3669a4));if(_0x3669a4[_0x53c9('0xf')]){if(_0x3669a4[_0x53c9('0xf')][_0x53c9('0x10')]===0x1f4){logger[_0x53c9('0xf')](_0x53c9('0xb'),_0x7e5011,_0x3669a4['error'][_0x53c9('0x11')]);return _0xdce2b(_0x3669a4[_0x53c9('0xf')][_0x53c9('0x11')]);}logger[_0x53c9('0xf')](_0x53c9('0xb'),_0x7e5011,_0x3669a4['error'][_0x53c9('0x11')]);return _0x3f1f1d(_0x3669a4[_0x53c9('0xf')][_0x53c9('0x11')]);}else{logger[_0x53c9('0xa')](_0x53c9('0xb'),_0x7e5011,'request\x20sent');_0x3f1f1d(_0x3669a4['result'][_0x53c9('0x11')]);}})[_0x53c9('0x12')](function(_0x181e1c){logger['error'](_0x53c9('0xb'),_0x7e5011,_0x181e1c);_0xdce2b(_0x181e1c);});});} \ No newline at end of file +var _0x5162=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x451735,_0x391a76){var _0x41d1e2=function(_0x3566d7){while(--_0x3566d7){_0x451735['push'](_0x451735['shift']());}};_0x41d1e2(++_0x391a76);}(_0x5162,0x17d));var _0x2516=function(_0x86bed5,_0xa2634d){_0x86bed5=_0x86bed5-0x0;var _0x252d3a=_0x5162[_0x86bed5];return _0x252d3a;};'use strict';var _=require(_0x2516('0x0'));var util=require(_0x2516('0x1'));var moment=require(_0x2516('0x2'));var BPromise=require(_0x2516('0x3'));var rs=require(_0x2516('0x4'));var fs=require('fs');var Redis=require(_0x2516('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2516('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2516('0x7'));var client=jayson['client'][_0x2516('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f60cb,_0x69efdb,_0x4d2ce0){return new BPromise(function(_0x5bc3c5,_0x46378b){return client['request'](_0x4f60cb,_0x4d2ce0)['then'](function(_0x1698e5){logger[_0x2516('0x9')](_0x2516('0xa'),_0x69efdb,'request\x20sent');logger[_0x2516('0xb')](_0x2516('0xc'),_0x69efdb,'request\x20sent',JSON[_0x2516('0xd')](_0x1698e5));if(_0x1698e5[_0x2516('0xe')]){if(_0x1698e5[_0x2516('0xe')][_0x2516('0xf')]===0x1f4){logger[_0x2516('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x69efdb,_0x1698e5[_0x2516('0xe')][_0x2516('0x10')]);return _0x46378b(_0x1698e5[_0x2516('0xe')]['message']);}logger[_0x2516('0xe')](_0x2516('0xa'),_0x69efdb,_0x1698e5[_0x2516('0xe')]['message']);return _0x5bc3c5(_0x1698e5[_0x2516('0xe')][_0x2516('0x10')]);}else{logger[_0x2516('0x9')](_0x2516('0xa'),_0x69efdb,'request\x20sent');_0x5bc3c5(_0x1698e5[_0x2516('0x11')]['message']);}})[_0x2516('0x12')](function(_0x25fce9){logger[_0x2516('0xe')](_0x2516('0xa'),_0x69efdb,_0x25fce9);_0x46378b(_0x25fce9);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 2a247da..0515d29 100644 --- a/server/api/chatOfflineMessage/index.js +++ b/server/api/chatOfflineMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x890a=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update'];(function(_0x3da28c,_0x896376){var _0x33b072=function(_0x564f91){while(--_0x564f91){_0x3da28c['push'](_0x3da28c['shift']());}};_0x33b072(++_0x896376);}(_0x890a,0x146));var _0xa890=function(_0x2a334b,_0x10e5b2){_0x2a334b=_0x2a334b-0x0;var _0xb7ac2b=_0x890a[_0x2a334b];return _0xb7ac2b;};'use strict';var multer=require(_0xa890('0x0'));var util=require('util');var path=require(_0xa890('0x1'));var timeout=require(_0xa890('0x2'));var express=require(_0xa890('0x3'));var router=express['Router']();var auth=require(_0xa890('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa890('0x5'));var controller=require(_0xa890('0x6'));router[_0xa890('0x7')]('/',auth[_0xa890('0x8')](),controller[_0xa890('0x9')]);router[_0xa890('0x7')](_0xa890('0xa'),auth[_0xa890('0x8')](),controller['describe']);router[_0xa890('0x7')](_0xa890('0xb'),auth[_0xa890('0x8')](),controller[_0xa890('0xc')]);router[_0xa890('0xd')]('/',auth[_0xa890('0x8')](),controller[_0xa890('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa890('0xf')]);router[_0xa890('0x10')](_0xa890('0xb'),auth['isAuthenticated'](),controller[_0xa890('0x11')]);module[_0xa890('0x12')]=router; \ No newline at end of file +var _0x9704=['exports','multer','util','express','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','post','create','update','delete','destroy'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9704,0x1dd));var _0x4970=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9704[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4970('0x0'));var util=require(_0x4970('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4970('0x2'));var router=express['Router']();var auth=require(_0x4970('0x3'));var interaction=require(_0x4970('0x4'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x4970('0x5')]('/',auth['isAuthenticated'](),controller[_0x4970('0x6')]);router['get'](_0x4970('0x7'),auth[_0x4970('0x8')](),controller[_0x4970('0x9')]);router[_0x4970('0x5')](_0x4970('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4970('0xb')]('/',auth[_0x4970('0x8')](),controller[_0x4970('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4970('0xd')]);router[_0x4970('0xe')](_0x4970('0xa'),auth['isAuthenticated'](),controller[_0x4970('0xf')]);module[_0x4970('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index ccbaedf..3e1cccb 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js +++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9773=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x2ad834,_0x2b5fee){var _0x75663=function(_0x286e03){while(--_0x286e03){_0x2ad834['push'](_0x2ad834['shift']());}};_0x75663(++_0x2b5fee);}(_0x9773,0x198));var _0x3977=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9773[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3977('0x0'));module[_0x3977('0x1')]={'name':{'type':Sequelize[_0x3977('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3977('0x3')](_0x3977('0x4'),_0x3977('0x5')),'defaultValue':_0x3977('0x4')},'selector':{'type':Sequelize[_0x3977('0x2')]},'timeout':{'type':Sequelize[_0x3977('0x6')]}}; \ No newline at end of file +var _0xe701=['STRING','ENUM','mouseOver','timeout','INTEGER','exports'];(function(_0x12bc8e,_0x4af768){var _0x48c79f=function(_0xed8ecd){while(--_0xed8ecd){_0x12bc8e['push'](_0x12bc8e['shift']());}};_0x48c79f(++_0x4af768);}(_0xe701,0x179));var _0x1e70=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe701[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module[_0x1e70('0x0')]={'name':{'type':Sequelize[_0x1e70('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1e70('0x2')](_0x1e70('0x3'),_0x1e70('0x4')),'defaultValue':_0x1e70('0x3')},'selector':{'type':Sequelize[_0x1e70('0x1')]},'timeout':{'type':Sequelize[_0x1e70('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 75f6c14..1929650 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','ChatProactiveAction','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x16ab46,_0x53d215){var _0x1c6ec4=function(_0x1d6568){while(--_0x1d6568){_0x16ab46['push'](_0x16ab46['shift']());}};_0x1c6ec4(++_0x53d215);}(_0xe706,0xa3));var _0x6e70=function(_0x2517ae,_0x2f5c62){_0x2517ae=_0x2517ae-0x0;var _0x152f2b=_0xe706[_0x2517ae];return _0x152f2b;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={'raw':!![],'where':{'id':_0x4a67ac[_0x6e70('0x2c')]['id']}},_0x3af17f={};_0x3af17f[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](db['ChatProactiveAction'][_0x6e70('0x2f')]);_0x3af17f[_0x6e70('0x30')]=_[_0x6e70('0x2e')](_0x4a67ac[_0x6e70('0x30')]);_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x32')](_0x3af17f[_0x6e70('0x2d')],_0x3af17f[_0x6e70('0x30')]);_0x2c4d37[_0x6e70('0x33')]=_[_0x6e70('0x32')](_0x3af17f['model'],qs[_0x6e70('0x34')](_0x4a67ac['query'][_0x6e70('0x34')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x33')][_0x6e70('0x35')]?_0x2c4d37[_0x6e70('0x33')]:_0x3af17f['model'];if(_0x4a67ac[_0x6e70('0x30')][_0x6e70('0x36')]){_0x2c4d37['include']=[{'all':!![]}];}_0x2c4d37=_[_0x6e70('0x37')]({},_0x2c4d37,_0x4a67ac[_0x6e70('0x38')]);return db['ChatProactiveAction'][_0x6e70('0x39')](_0x2c4d37)[_0x6e70('0x27')](handleEntityNotFound(_0x54a5fe,null))[_0x6e70('0x27')](respondWithResult(_0x54a5fe,null))[_0x6e70('0x3a')](handleError(_0x54a5fe,null));};exports[_0x6e70('0x3b')]=function(_0x1e3e76,_0x44b19d){return db[_0x6e70('0x3c')][_0x6e70('0x3b')](_0x1e3e76[_0x6e70('0x3d')],{})['then'](respondWithResult(_0x44b19d,0xc9))[_0x6e70('0x3a')](handleError(_0x44b19d,null));};exports['update']=function(_0x23cd1a,_0x3222a2){if(_0x23cd1a[_0x6e70('0x3d')]['id']){delete _0x23cd1a[_0x6e70('0x3d')]['id'];}return db[_0x6e70('0x3c')][_0x6e70('0x39')]({'where':{'id':_0x23cd1a[_0x6e70('0x2c')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x3222a2,null))[_0x6e70('0x27')](saveUpdates(_0x23cd1a[_0x6e70('0x3d')],null))[_0x6e70('0x27')](respondWithResult(_0x3222a2,null))[_0x6e70('0x3a')](handleError(_0x3222a2,null));};exports[_0x6e70('0x3e')]=function(_0x501b53,_0x5446a2){return db['ChatProactiveAction'][_0x6e70('0x39')]({'where':{'id':_0x501b53[_0x6e70('0x2c')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x5446a2,null))[_0x6e70('0x27')](removeEntity(_0x5446a2,null))[_0x6e70('0x3a')](handleError(_0x5446a2,null));}; \ No newline at end of file +var _0x70e0=['mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x1e7efa,_0x5eb595){var _0x153ccb=function(_0xdb0fec){while(--_0xdb0fec){_0x1e7efa['push'](_0x1e7efa['shift']());}};_0x153ccb(++_0x5eb595);}(_0x70e0,0x17b));var _0x070e=function(_0xd4fa2a,_0x5885d9){_0xd4fa2a=_0xd4fa2a-0x0;var _0x43ee41=_0x70e0[_0xd4fa2a];return _0x43ee41;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={'raw':!![],'where':{'id':_0x1743cc[_0x070e('0x26')]['id']}},_0x374c54={};_0x374c54[_0x070e('0x27')]=_[_0x070e('0x28')](db[_0x070e('0x29')][_0x070e('0x2a')]);_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x28')](_0x1743cc['query']);_0x374c54[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],_0x374c54['query']);_0x497f58['attributes']=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],qs[_0x070e('0x2e')](_0x1743cc['query'][_0x070e('0x2e')]));_0x497f58[_0x070e('0x2f')]=_0x497f58[_0x070e('0x2f')][_0x070e('0x30')]?_0x497f58['attributes']:_0x374c54['model'];if(_0x1743cc['query']['includeAll']){_0x497f58[_0x070e('0x31')]=[{'all':!![]}];}_0x497f58=_['merge']({},_0x497f58,_0x1743cc[_0x070e('0x32')]);return db[_0x070e('0x29')]['find'](_0x497f58)['then'](handleEntityNotFound(_0x4763c6,null))[_0x070e('0x20')](respondWithResult(_0x4763c6,null))[_0x070e('0x33')](handleError(_0x4763c6,null));};exports['create']=function(_0x546a16,_0x41ade4){return db[_0x070e('0x29')][_0x070e('0x34')](_0x546a16[_0x070e('0x35')],{})[_0x070e('0x20')](respondWithResult(_0x41ade4,0xc9))['catch'](handleError(_0x41ade4,null));};exports['update']=function(_0x24d17d,_0x3011c4){if(_0x24d17d[_0x070e('0x35')]['id']){delete _0x24d17d[_0x070e('0x35')]['id'];}return db[_0x070e('0x29')]['find']({'where':{'id':_0x24d17d[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3011c4,null))['then'](saveUpdates(_0x24d17d[_0x070e('0x35')],null))[_0x070e('0x20')](respondWithResult(_0x3011c4,null))['catch'](handleError(_0x3011c4,null));};exports['destroy']=function(_0x5ddbe9,_0x363bff){return db[_0x070e('0x29')][_0x070e('0x36')]({'where':{'id':_0x5ddbe9[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x363bff,null))['then'](removeEntity(_0x363bff,null))[_0x070e('0x33')](handleError(_0x363bff,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 0c5112d..1a9155b 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.model.js +++ b/server/api/chatProactiveAction/chatProactiveAction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3d4=['chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x370786,_0x298705){var _0x50dbe2=function(_0x21a180){while(--_0x21a180){_0x370786['push'](_0x370786['shift']());}};_0x50dbe2(++_0x298705);}(_0xb3d4,0x17a));var _0x4b3d=function(_0x2718c3,_0x59fa99){_0x2718c3=_0x2718c3-0x0;var _0x1313f8=_0xb3d4[_0x2718c3];return _0x1313f8;};'use strict';var _=require(_0x4b3d('0x0'));var util=require('util');var logger=require(_0x4b3d('0x1'))(_0x4b3d('0x2'));var moment=require(_0x4b3d('0x3'));var BPromise=require(_0x4b3d('0x4'));var rp=require(_0x4b3d('0x5'));var fs=require('fs');var path=require(_0x4b3d('0x6'));var rimraf=require(_0x4b3d('0x7'));var config=require(_0x4b3d('0x8'));var attributes=require(_0x4b3d('0x9'));module[_0x4b3d('0xa')]=function(_0xf8e531,_0xcfa2cd){return _0xf8e531[_0x4b3d('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x4b3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fb8=['request-promise','rimraf','../../config/environment','exports','define','chat_proactive_actions','util','../../config/logger','moment','bluebird'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x0fb8,0x16e));var _0x80fb=function(_0x4269ba,_0x648fa9){_0x4269ba=_0x4269ba-0x0;var _0xae6f6=_0x0fb8[_0x4269ba];return _0xae6f6;};'use strict';var _=require('lodash');var util=require(_0x80fb('0x0'));var logger=require(_0x80fb('0x1'))('api');var moment=require(_0x80fb('0x2'));var BPromise=require(_0x80fb('0x3'));var rp=require(_0x80fb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80fb('0x5'));var config=require(_0x80fb('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x80fb('0x7')]=function(_0x44f51d,_0x43e91a){return _0x44f51d[_0x80fb('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x80fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 7ca869c..d06d2bd 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdf0=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xbdf0,0x92));var _0x0bdf=function(_0x1fcbb7,_0x21ff69){_0x1fcbb7=_0x1fcbb7-0x0;var _0x1a5046=_0xbdf0[_0x1fcbb7];return _0x1a5046;};'use strict';var _=require('lodash');var util=require(_0x0bdf('0x0'));var moment=require(_0x0bdf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bdf('0x2'))['db'];var utils=require(_0x0bdf('0x3'));var logger=require(_0x0bdf('0x4'))(_0x0bdf('0x5'));var config=require(_0x0bdf('0x6'));var jayson=require(_0x0bdf('0x7'));var client=jayson[_0x0bdf('0x8')][_0x0bdf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55a556,_0xc9dc65,_0x47fac7){return new BPromise(function(_0x48680b,_0x26aaa1){return client[_0x0bdf('0xa')](_0x55a556,_0x47fac7)[_0x0bdf('0xb')](function(_0x4cb159){logger[_0x0bdf('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0xc9dc65,_0x0bdf('0xd'));logger[_0x0bdf('0xe')](_0x0bdf('0xf'),_0xc9dc65,'request\x20sent',JSON[_0x0bdf('0x10')](_0x4cb159));if(_0x4cb159[_0x0bdf('0x11')]){if(_0x4cb159['error'][_0x0bdf('0x12')]===0x1f4){logger['error'](_0x0bdf('0x13'),_0xc9dc65,_0x4cb159[_0x0bdf('0x11')]['message']);return _0x26aaa1(_0x4cb159[_0x0bdf('0x11')][_0x0bdf('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0xc9dc65,_0x4cb159[_0x0bdf('0x11')][_0x0bdf('0x14')]);return _0x48680b(_0x4cb159[_0x0bdf('0x11')]['message']);}else{logger[_0x0bdf('0xc')](_0x0bdf('0x13'),_0xc9dc65,'request\x20sent');_0x48680b(_0x4cb159[_0x0bdf('0x15')]['message']);}})[_0x0bdf('0x16')](function(_0x56df62){logger[_0x0bdf('0x11')](_0x0bdf('0x13'),_0xc9dc65,_0x56df62);_0x26aaa1(_0x56df62);});});} \ No newline at end of file +var _0x6963=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','info','catch','lodash'];(function(_0x5a9cf3,_0xb8c6d8){var _0x51885a=function(_0x1b1aa7){while(--_0x1b1aa7){_0x5a9cf3['push'](_0x5a9cf3['shift']());}};_0x51885a(++_0xb8c6d8);}(_0x6963,0xe9));var _0x3696=function(_0x511ef6,_0x57e0b9){_0x511ef6=_0x511ef6-0x0;var _0x5efd44=_0x6963[_0x511ef6];return _0x5efd44;};'use strict';var _=require(_0x3696('0x0'));var util=require('util');var moment=require(_0x3696('0x1'));var BPromise=require(_0x3696('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3696('0x3'));var db=require(_0x3696('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3696('0x5'))(_0x3696('0x6'));var config=require(_0x3696('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3696('0x8')][_0x3696('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x423d41,_0x40c18c,_0x4b0ace){return new BPromise(function(_0x2beb98,_0x4c9a2f){return client['request'](_0x423d41,_0x4b0ace)['then'](function(_0x4a5213){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x40c18c,_0x3696('0xa'));logger[_0x3696('0xb')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x40c18c,_0x3696('0xa'),JSON[_0x3696('0xc')](_0x4a5213));if(_0x4a5213[_0x3696('0xd')]){if(_0x4a5213[_0x3696('0xd')]['code']===0x1f4){logger[_0x3696('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x40c18c,_0x4a5213[_0x3696('0xd')][_0x3696('0xe')]);return _0x4c9a2f(_0x4a5213[_0x3696('0xd')][_0x3696('0xe')]);}logger['error'](_0x3696('0xf'),_0x40c18c,_0x4a5213[_0x3696('0xd')]['message']);return _0x2beb98(_0x4a5213['error'][_0x3696('0xe')]);}else{logger[_0x3696('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x40c18c,_0x3696('0xa'));_0x2beb98(_0x4a5213['result'][_0x3696('0xe')]);}})[_0x3696('0x11')](function(_0x3bf748){logger['error'](_0x3696('0xf'),_0x40c18c,_0x3bf748);_0x4c9a2f(_0x3bf748);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 417923f..99cc980 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc923=['post','create','update','delete','exports','multer','util','path','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x5bb3a6,_0xc89ee3){var _0x279273=function(_0x232bdf){while(--_0x232bdf){_0x5bb3a6['push'](_0x5bb3a6['shift']());}};_0x279273(++_0xc89ee3);}(_0xc923,0x1ef));var _0x3c92=function(_0x508501,_0x221214){_0x508501=_0x508501-0x0;var _0x3f64f3=_0xc923[_0x508501];return _0x3f64f3;};'use strict';var multer=require(_0x3c92('0x0'));var util=require(_0x3c92('0x1'));var path=require(_0x3c92('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3c92('0x3'));var controller=require(_0x3c92('0x4'));router[_0x3c92('0x5')](_0x3c92('0x6'),auth[_0x3c92('0x7')](),controller[_0x3c92('0x8')]);router[_0x3c92('0x9')]('/',auth[_0x3c92('0x7')](),controller[_0x3c92('0xa')]);router['put'](_0x3c92('0x6'),auth[_0x3c92('0x7')](),controller[_0x3c92('0xb')]);router[_0x3c92('0xc')]('/:id',auth[_0x3c92('0x7')](),controller['destroy']);module[_0x3c92('0xd')]=router; \ No newline at end of file +var _0x0f50=['get','/:id','show','post','isAuthenticated','create','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x157a95,_0x3b70d5){var _0x1e4bde=function(_0x321641){while(--_0x321641){_0x157a95['push'](_0x157a95['shift']());}};_0x1e4bde(++_0x3b70d5);}(_0x0f50,0x6f));var _0x00f5=function(_0x95920c,_0x1e8820){_0x95920c=_0x95920c-0x0;var _0x10a581=_0x0f50[_0x95920c];return _0x10a581;};'use strict';var multer=require('multer');var util=require(_0x00f5('0x0'));var path=require(_0x00f5('0x1'));var timeout=require(_0x00f5('0x2'));var express=require(_0x00f5('0x3'));var router=express[_0x00f5('0x4')]();var auth=require(_0x00f5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x00f5('0x6'));var controller=require(_0x00f5('0x7'));router[_0x00f5('0x8')](_0x00f5('0x9'),auth['isAuthenticated'](),controller[_0x00f5('0xa')]);router[_0x00f5('0xb')]('/',auth[_0x00f5('0xc')](),controller[_0x00f5('0xd')]);router[_0x00f5('0xe')](_0x00f5('0x9'),auth[_0x00f5('0xc')](),controller['update']);router[_0x00f5('0xf')](_0x00f5('0x9'),auth[_0x00f5('0xc')](),controller[_0x00f5('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 2f436f8..e02ecbf 100644 --- a/server/api/chatQueue/chatQueue.attributes.js +++ b/server/api/chatQueue/chatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78a4=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x2c5b59,_0x4901d7){var _0x5f2dc6=function(_0x43a6e0){while(--_0x43a6e0){_0x2c5b59['push'](_0x2c5b59['shift']());}};_0x5f2dc6(++_0x4901d7);}(_0x78a4,0x17a));var _0x478a=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0x78a4[_0x3f4dd9];return _0x31c54a;};'use strict';var Sequelize=require(_0x478a('0x0'));module[_0x478a('0x1')]={'name':{'type':Sequelize[_0x478a('0x2')],'unique':_0x478a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x478a('0x2')]},'timeout':{'type':Sequelize[_0x478a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x478a('0x5')](_0x478a('0x6'),_0x478a('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xa6c1=['STRING','name','INTEGER','rrmemory','roundrobin','exports'];(function(_0x5a34b6,_0x350368){var _0x3d5e46=function(_0x4745e6){while(--_0x4745e6){_0x5a34b6['push'](_0x5a34b6['shift']());}};_0x3d5e46(++_0x350368);}(_0xa6c1,0x65));var _0x1a6c=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xa6c1[_0x3a7a9c];return _0x59156e;};'use strict';var Sequelize=require('sequelize');module[_0x1a6c('0x0')]={'name':{'type':Sequelize[_0x1a6c('0x1')],'unique':_0x1a6c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1a6c('0x1')]},'timeout':{'type':Sequelize[_0x1a6c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1a6c('0x4'),'beepall',_0x1a6c('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index bd26d09..2e38f8d 100644 --- a/server/api/chatQueue/chatQueue.controller.js +++ b/server/api/chatQueue/chatQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x430c=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','user','get','role','ChatQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','order','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','includes','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0xf005e6,_0x2d3d52){var _0x2c947f=function(_0x3e8142){while(--_0x3e8142){_0xf005e6['push'](_0xf005e6['shift']());}};_0x2c947f(++_0x2d3d52);}(_0x430c,0x1a1));var _0xc430=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x430c[_0x204eb7];return _0x37e444;};'use strict';var pdf=require(_0xc430('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc430('0x1'));var jsonpatch=require(_0xc430('0x2'));var rp=require(_0xc430('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc430('0x4'));var sox=require(_0xc430('0x5'));var csv=require('to-csv');var ejs=require(_0xc430('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0xb'));var querystring=require(_0xc430('0xc'));var Papa=require(_0xc430('0xd'));var Redis=require(_0xc430('0xe'));var authService=require(_0xc430('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0x10'));var hardwareService=require(_0xc430('0x11'));var logger=require('../../config/logger')(_0xc430('0x12'));var utils=require('../../config/utils');var config=require(_0xc430('0x13'));var db=require('../../mysqldb')['db'];config[_0xc430('0x14')]=_[_0xc430('0x15')](config[_0xc430('0x14')],{'host':_0xc430('0x16'),'port':0x18eb});var socket=require(_0xc430('0x17'))(new Redis(config[_0xc430('0x14')]));require(_0xc430('0x18'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc430('0x19')][_0xc430('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x17d5c8,_0x2ef538,_0x31d3b7){if(_0x31d3b7){var _0x55cc6c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55cc6c[_0xc430('0x1b')](_0x2ef538)){return _0x17d5c8;}else{throw new db['Sequelize']['ValidationError'](_0xc430('0x1c'));}}else{return _0x17d5c8;}}function respondWithRpcPromise(_0x3d02df,_0x2327c5,_0x5830b0,_0x5d3acc){return new BPromise(function(_0x36d112,_0x4c1937){var _0x2bcb21=_0x5d3acc||client;return _0x2bcb21['request'](_0x3d02df,_0x5830b0)['then'](function(_0x2f3203){logger['info'](_0xc430('0x1d'),_0x2327c5,_0xc430('0x1e'));logger[_0xc430('0x1f')](_0xc430('0x20'),_0x2327c5,_0xc430('0x1e'),JSON['stringify'](_0x2f3203));if(_0x2f3203[_0xc430('0x21')]){if(_0x2f3203['error']['code']===0x1f4){logger[_0xc430('0x21')](_0xc430('0x1d'),_0x2327c5,_0x2f3203[_0xc430('0x21')]['message']);return _0x4c1937(_0x2f3203[_0xc430('0x21')]['message']);}logger[_0xc430('0x21')](_0xc430('0x1d'),_0x2327c5,_0x2f3203['error'][_0xc430('0x22')]);return _0x36d112(_0x2f3203[_0xc430('0x21')]['message']);}else{logger[_0xc430('0x23')]('ChatQueue,\x20%s,\x20%s',_0x2327c5,_0xc430('0x1e'));_0x36d112(_0x2f3203['result'][_0xc430('0x22')]);}})[_0xc430('0x24')](function(_0x50110b){logger[_0xc430('0x21')](_0xc430('0x1d'),_0x2327c5,_0x50110b);_0x4c1937(_0x50110b);});});}function respondWithStatusCode(_0x2c0422,_0x44833e){_0x44833e=_0x44833e||0xcc;return function(_0x285407){if(_0x285407){return _0x2c0422['sendStatus'](_0x44833e);}return _0x2c0422[_0xc430('0x25')](_0x44833e)[_0xc430('0x26')]();};}function respondWithResult(_0x1c1da9,_0x1591e3){_0x1591e3=_0x1591e3||0xc8;return function(_0x542cba){if(_0x542cba){return _0x1c1da9[_0xc430('0x25')](_0x1591e3)['json'](_0x542cba);}};}function respondWithFilteredResult(_0x1d65ee,_0x4ad29e){return function(_0x6b263b){if(_0x6b263b){var _0x1045c0=_0x6b263b[_0xc430('0x27')],_0xfc8767=_0x4ad29e[_0xc430('0x28')],_0x3d7ccf=_0x4ad29e[_0xc430('0x28')]+_0x4ad29e[_0xc430('0x29')],_0x49977b;if(_0x3d7ccf>=_0x1045c0){_0x3d7ccf=_0x1045c0;_0x49977b=0xc8;}else{_0x49977b=0xce;}_0x1d65ee['status'](_0x49977b);return _0x1d65ee[_0xc430('0x2a')](_0xc430('0x2b'),_0xfc8767+'-'+_0x3d7ccf+'/'+_0x1045c0)['json'](_0x6b263b);}return null;};}function patchUpdates(_0x8b71f){return function(_0x4ded17){try{jsonpatch['apply'](_0x4ded17,_0x8b71f,!![]);}catch(_0x37d360){return BPromise[_0xc430('0x2c')](_0x37d360);}return _0x4ded17[_0xc430('0x2d')]();};}function saveUpdates(_0x476c12,_0x2f44bb){return function(_0x63878e){if(_0x63878e){return _0x63878e[_0xc430('0x2e')](_0x476c12)[_0xc430('0x2f')](function(_0x47da0d){return _0x47da0d;});}return null;};}function removeEntity(_0x442d20,_0x4c7fc8){return function(_0x119bee){if(_0x119bee){return _0x119bee[_0xc430('0x30')]()[_0xc430('0x2f')](function(){var _0x44ca3e=_0x119bee['get']({'plain':!![]});var _0x2848ae='ChatQueues';return db['UserProfileResource'][_0xc430('0x30')]({'where':{'type':_0x2848ae,'resourceId':_0x44ca3e['id']}})[_0xc430('0x2f')](function(){return _0x119bee;});})['then'](function(){_0x442d20[_0xc430('0x25')](0xcc)[_0xc430('0x26')]();});}};}function handleEntityNotFound(_0x104cfa,_0x20bcdd){return function(_0x2310d3){if(!_0x2310d3){_0x104cfa[_0xc430('0x31')](0x194);}return _0x2310d3;};}function handleError(_0x3b13b8,_0x30fc42){_0x30fc42=_0x30fc42||0x1f4;return function(_0x242844){logger[_0xc430('0x21')](_0x242844[_0xc430('0x32')]);if(_0x242844[_0xc430('0x33')]){delete _0x242844[_0xc430('0x33')];}_0x3b13b8[_0xc430('0x25')](_0x30fc42)[_0xc430('0x34')](_0x242844);};}exports['index']=function(_0x253fc0,_0x2e91e9){var _0x24363b={},_0x8c163e={},_0x5a05d8={'count':0x0,'rows':[]};var _0x30f9b7=_[_0xc430('0x35')](db[_0xc430('0x36')][_0xc430('0x37')],function(_0x9d695){return{'name':_0x9d695[_0xc430('0x38')],'type':_0x9d695['type'][_0xc430('0x39')]};});_0x8c163e[_0xc430('0x3a')]=_[_0xc430('0x35')](_0x30f9b7,_0xc430('0x33'));_0x8c163e[_0xc430('0x3b')]=_[_0xc430('0x3c')](_0x253fc0[_0xc430('0x3b')]);_0x8c163e[_0xc430('0x3d')]=_[_0xc430('0x3e')](_0x8c163e[_0xc430('0x3a')],_0x8c163e[_0xc430('0x3b')]);_0x24363b[_0xc430('0x3f')]=_[_0xc430('0x3e')](_0x8c163e[_0xc430('0x3a')],qs['fields'](_0x253fc0['query']['fields']));_0x24363b[_0xc430('0x3f')]=_0x24363b[_0xc430('0x3f')][_0xc430('0x40')]?_0x24363b[_0xc430('0x3f')]:_0x8c163e[_0xc430('0x3a')];if(!_0x253fc0[_0xc430('0x3b')][_0xc430('0x41')](_0xc430('0x42'))){_0x24363b[_0xc430('0x29')]=qs[_0xc430('0x29')](_0x253fc0[_0xc430('0x3b')][_0xc430('0x29')]);_0x24363b[_0xc430('0x28')]=qs[_0xc430('0x28')](_0x253fc0[_0xc430('0x3b')][_0xc430('0x28')]);}_0x24363b['order']=qs[_0xc430('0x43')](_0x253fc0[_0xc430('0x3b')][_0xc430('0x43')]);_0x24363b[_0xc430('0x44')]=qs[_0xc430('0x3d')](_[_0xc430('0x45')](_0x253fc0[_0xc430('0x3b')],_0x8c163e[_0xc430('0x3d')]));if(_0x253fc0['query'][_0xc430('0x46')]){_0x24363b['where']=_[_0xc430('0x47')](_0x24363b[_0xc430('0x44')],{'$or':_['map'](_0x30f9b7,function(_0x5ce31b){if(_0x5ce31b[_0xc430('0x48')]!=='VIRTUAL'){var _0x542ea3={};_0x542ea3[_0x5ce31b[_0xc430('0x33')]]={'$like':'%'+_0x253fc0['query'][_0xc430('0x46')]+'%'};return _0x542ea3;}})});}_0x24363b=_[_0xc430('0x47')]({},_0x24363b,_0x253fc0[_0xc430('0x49')]);var _0x4e759a={'where':_0x24363b[_0xc430('0x44')]};return db[_0xc430('0x36')][_0xc430('0x27')](_0x4e759a)['then'](function(_0x34fd8c){_0x5a05d8[_0xc430('0x27')]=_0x34fd8c;if(_0x253fc0[_0xc430('0x3b')][_0xc430('0x4a')]){_0x24363b[_0xc430('0x4b')]=[{'all':!![]}];}return db[_0xc430('0x36')][_0xc430('0x4c')](_0x24363b);})['then'](function(_0x115441){_0x5a05d8[_0xc430('0x4d')]=_0x115441;return _0x5a05d8;})[_0xc430('0x2f')](respondWithFilteredResult(_0x2e91e9,_0x24363b))['catch'](handleError(_0x2e91e9,null));};exports[_0xc430('0x4e')]=function(_0x4178d7,_0x2d064b){var _0x36de10={'raw':!![],'where':{'id':_0x4178d7[_0xc430('0x4f')]['id']}},_0x5b93e1={};_0x5b93e1['model']=_[_0xc430('0x3c')](db[_0xc430('0x36')][_0xc430('0x37')]);_0x5b93e1[_0xc430('0x3b')]=_[_0xc430('0x3c')](_0x4178d7[_0xc430('0x3b')]);_0x5b93e1['filters']=_[_0xc430('0x3e')](_0x5b93e1[_0xc430('0x3a')],_0x5b93e1['query']);_0x36de10[_0xc430('0x3f')]=_[_0xc430('0x3e')](_0x5b93e1[_0xc430('0x3a')],qs[_0xc430('0x50')](_0x4178d7['query'][_0xc430('0x50')]));_0x36de10['attributes']=_0x36de10[_0xc430('0x3f')][_0xc430('0x40')]?_0x36de10[_0xc430('0x3f')]:_0x5b93e1[_0xc430('0x3a')];if(_0x4178d7['query'][_0xc430('0x4a')]){_0x36de10[_0xc430('0x4b')]=[{'all':!![]}];}_0x36de10=_['merge']({},_0x36de10,_0x4178d7['options']);return db[_0xc430('0x36')][_0xc430('0x51')](_0x36de10)[_0xc430('0x2f')](handleEntityNotFound(_0x2d064b,null))[_0xc430('0x2f')](respondWithResult(_0x2d064b,null))[_0xc430('0x24')](handleError(_0x2d064b,null));};exports[_0xc430('0x52')]=function(_0x2065d0,_0x4db6dc){return db[_0xc430('0x36')]['create'](_0x2065d0[_0xc430('0x53')],{})[_0xc430('0x2f')](function(_0x24bc57){var _0x4184cc=_0x2065d0[_0xc430('0x54')][_0xc430('0x55')]({'plain':!![]});if(!_0x4184cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4184cc[_0xc430('0x56')]===_0xc430('0x54')){var _0xd91525=_0x24bc57[_0xc430('0x55')]({'plain':!![]});var _0x10c7a4=_0xc430('0x57');return db[_0xc430('0x58')]['find']({'where':{'name':_0x10c7a4,'userProfileId':_0x4184cc[_0xc430('0x59')]},'raw':!![]})['then'](function(_0x2a4ad3){if(_0x2a4ad3&&_0x2a4ad3['autoAssociation']===0x0){return db[_0xc430('0x5a')][_0xc430('0x52')]({'name':_0xd91525[_0xc430('0x33')],'resourceId':_0xd91525['id'],'type':_0x2a4ad3[_0xc430('0x33')],'sectionId':_0x2a4ad3['id']},{})[_0xc430('0x2f')](function(){return _0x24bc57;});}else{return _0x24bc57;}})[_0xc430('0x24')](function(_0x5d3393){logger[_0xc430('0x21')](_0xc430('0x5b'),_0x5d3393);throw _0x5d3393;});}return _0x24bc57;})['then'](respondWithResult(_0x4db6dc,0xc9))['catch'](handleError(_0x4db6dc,null));};exports[_0xc430('0x2e')]=function(_0x35c7c2,_0x219dc0){if(_0x35c7c2[_0xc430('0x53')]['id']){delete _0x35c7c2[_0xc430('0x53')]['id'];}return db[_0xc430('0x36')][_0xc430('0x51')]({'where':{'id':_0x35c7c2[_0xc430('0x4f')]['id']}})[_0xc430('0x2f')](handleEntityNotFound(_0x219dc0,null))[_0xc430('0x2f')](saveUpdates(_0x35c7c2[_0xc430('0x53')],null))[_0xc430('0x2f')](respondWithResult(_0x219dc0,null))['catch'](handleError(_0x219dc0,null));};exports['destroy']=function(_0x4547e7,_0x56c6a8){return db[_0xc430('0x36')][_0xc430('0x51')]({'where':{'id':_0x4547e7['params']['id']}})[_0xc430('0x2f')](handleEntityNotFound(_0x56c6a8,null))['then'](removeEntity(_0x56c6a8,null))['catch'](handleError(_0x56c6a8,null));};exports[_0xc430('0x5c')]=function(_0x43d62f,_0x52f398){return db[_0xc430('0x36')]['describe']()['then'](respondWithResult(_0x52f398,null))[_0xc430('0x24')](handleError(_0x52f398,null));};exports[_0xc430('0x5d')]=function(_0xd4aae7,_0x2c1620,_0x4eda14){var _0x155df9={'raw':!![],'where':{}},_0x2672dd={},_0x35c752;return db[_0xc430('0x36')]['findOne']({'where':{'id':_0xd4aae7[_0xc430('0x4f')]['id']}})[_0xc430('0x2f')](handleEntityNotFound(_0x2c1620,null))[_0xc430('0x2f')](function(_0x304d1a){if(_0x304d1a){_0x35c752=_0x304d1a[_0xc430('0x55')]({'plain':!![]});_0x2672dd[_0xc430('0x3a')]=_[_0xc430('0x3c')](db[_0xc430('0x5e')][_0xc430('0x37')]);_0x2672dd[_0xc430('0x3b')]=_[_0xc430('0x3c')](_0xd4aae7['query']);_0x2672dd['filters']=_['intersection'](_0x2672dd[_0xc430('0x3a')],_0x2672dd[_0xc430('0x3b')]);_0x155df9[_0xc430('0x3f')]=_['intersection'](_0x2672dd['model'],qs[_0xc430('0x50')](_0xd4aae7[_0xc430('0x3b')][_0xc430('0x50')]));_0x155df9[_0xc430('0x3f')]=_0x155df9[_0xc430('0x3f')][_0xc430('0x40')]?_0x155df9[_0xc430('0x3f')]:_0x2672dd[_0xc430('0x3a')];if(!_0xd4aae7[_0xc430('0x3b')][_0xc430('0x41')]('nolimit')){_0x155df9[_0xc430('0x29')]=qs[_0xc430('0x29')](_0xd4aae7[_0xc430('0x3b')]['limit']);_0x155df9['offset']=qs['offset'](_0xd4aae7[_0xc430('0x3b')][_0xc430('0x28')]);}_0x155df9[_0xc430('0x5f')]=qs[_0xc430('0x43')](_0xd4aae7['query'][_0xc430('0x43')]);_0x155df9[_0xc430('0x44')]=qs[_0xc430('0x3d')](_['pick'](_0xd4aae7[_0xc430('0x3b')],_0x2672dd['filters']));_0x155df9[_0xc430('0x44')][_0xc430('0x60')]=_0x304d1a['id'];if(_0xd4aae7[_0xc430('0x3b')][_0xc430('0x46')]){_0x155df9[_0xc430('0x44')]=_['merge'](_0x155df9[_0xc430('0x44')],{'$or':_[_0xc430('0x35')](_0x155df9[_0xc430('0x3f')],function(_0x29c132){var _0x4db586={};_0x4db586[_0x29c132]={'$like':'%'+_0xd4aae7['query'][_0xc430('0x46')]+'%'};return _0x4db586;})});}_0x155df9=_['merge']({},_0x155df9,_0xd4aae7['options']);return db[_0xc430('0x5e')][_0xc430('0x4c')](_0x155df9);}})['then'](function(_0xf5bca){if(_0xf5bca){return db[_0xc430('0x61')][_0xc430('0x62')]({'where':{'id':_[_0xc430('0x35')](_0xf5bca,_0xc430('0x63')),'role':_0xc430('0x64')},'attributes':['id','name',_0xc430('0x65'),_0xc430('0x66'),_0xc430('0x67')]});}})[_0xc430('0x2f')](function(_0x5a3f23){if(_0x5a3f23){return{'count':_0x5a3f23[_0xc430('0x27')],'rows':_[_0xc430('0x35')](_0x5a3f23[_0xc430('0x4d')],function(_0x520e7e){return{'membername':_0x520e7e[_0xc430('0x33')],'UserId':_0x520e7e['id'],'queue_name':_0x35c752['name'],'ChatQueueId':_0x35c752['id'],'interface':util['format'](_0xc430('0x68'),'SIP',_0x520e7e[_0xc430('0x33')]),'penalty':0x0,'paused':_0x520e7e['chatPause'],'createdAt':_0x520e7e[_0xc430('0x67')],'updatedAt':_0x520e7e[_0xc430('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2c1620,_0x155df9))[_0xc430('0x24')](handleError(_0x2c1620,null));};exports[_0xc430('0x69')]=function(_0x5c90a1,_0x3778e7,_0x3e053e){var _0x4e3aed={};var _0xaaa87d={};var _0x7aa69e;var _0x4f381d;return db[_0xc430('0x36')][_0xc430('0x6a')]({'where':{'id':_0x5c90a1[_0xc430('0x4f')]['id']}})[_0xc430('0x2f')](handleEntityNotFound(_0x3778e7,null))[_0xc430('0x2f')](function(_0x40bfcf){if(_0x40bfcf){_0x7aa69e=_0x40bfcf;_0xaaa87d[_0xc430('0x3a')]=_[_0xc430('0x3c')](db[_0xc430('0x6b')][_0xc430('0x37')]);_0xaaa87d[_0xc430('0x3b')]=_['keys'](_0x5c90a1[_0xc430('0x3b')]);_0xaaa87d[_0xc430('0x3d')]=_[_0xc430('0x3e')](_0xaaa87d['model'],_0xaaa87d['query']);_0x4e3aed[_0xc430('0x3f')]=_['intersection'](_0xaaa87d[_0xc430('0x3a')],qs[_0xc430('0x50')](_0x5c90a1['query']['fields']));_0x4e3aed[_0xc430('0x3f')]=_0x4e3aed[_0xc430('0x3f')][_0xc430('0x40')]?_0x4e3aed['attributes']:_0xaaa87d[_0xc430('0x3a')];_0x4e3aed['order']=qs['sort'](_0x5c90a1[_0xc430('0x3b')][_0xc430('0x43')]);_0x4e3aed[_0xc430('0x44')]=qs['filters'](_[_0xc430('0x45')](_0x5c90a1[_0xc430('0x3b')],_0xaaa87d[_0xc430('0x3d')]));if(_0x5c90a1[_0xc430('0x3b')][_0xc430('0x46')]){_0x4e3aed['where']=_['merge'](_0x4e3aed[_0xc430('0x44')],{'$or':_[_0xc430('0x35')](_0x4e3aed[_0xc430('0x3f')],function(_0x2daabd){var _0x3265e6={};_0x3265e6[_0x2daabd]={'$like':'%'+_0x5c90a1[_0xc430('0x3b')][_0xc430('0x46')]+'%'};return _0x3265e6;})});}_0x4e3aed=_[_0xc430('0x47')]({},_0x4e3aed,_0x5c90a1[_0xc430('0x49')]);return _0x7aa69e[_0xc430('0x69')](_0x4e3aed);}})[_0xc430('0x2f')](function(_0x57bec4){if(_0x57bec4){_0x4f381d=_0x57bec4[_0xc430('0x40')];if(!_0x5c90a1[_0xc430('0x3b')][_0xc430('0x41')](_0xc430('0x42'))){_0x4e3aed['limit']=qs['limit'](_0x5c90a1[_0xc430('0x3b')]['limit']);_0x4e3aed[_0xc430('0x28')]=qs[_0xc430('0x28')](_0x5c90a1[_0xc430('0x3b')][_0xc430('0x28')]);}return _0x7aa69e[_0xc430('0x69')](_0x4e3aed);}})['then'](function(_0x5c58df){if(_0x5c58df){return _0x5c58df?{'count':_0x4f381d,'rows':_0x5c58df}:null;}})['then'](respondWithResult(_0x3778e7,null))['catch'](handleError(_0x3778e7,null));};exports[_0xc430('0x6c')]=function(_0x552031,_0x49584a,_0x251a36){var _0x1b87ba=_0x552031[_0xc430('0x53')][_0xc430('0x6d')];return db[_0xc430('0x6b')][_0xc430('0x4c')]({'where':{'id':_0x1b87ba},'attributes':['id'],'include':[{'model':db[_0xc430('0x61')],'as':_0xc430('0x6e'),'attributes':['id',_0xc430('0x33'),_0xc430('0x6f'),_0xc430('0x70'),_0xc430('0x71')],'raw':!![]}]})[_0xc430('0x2f')](function(_0x5dcda1){if(_0x5dcda1){var _0x57f1a9=_[_0xc430('0x72')](_0x5dcda1,function(_0x2bbf78){var _0x1cecea=_0x2bbf78[_0xc430('0x55')]({'plain':!![]});return _0x1cecea[_0xc430('0x6e')];});return db[_0xc430('0x36')][_0xc430('0x51')]({'where':{'id':_0x552031['params']['id']}})[_0xc430('0x2f')](function(_0x6e48a3){return db['sequelize'][_0xc430('0x73')](function(_0x1a17ae){return _0x6e48a3[_0xc430('0x6c')](_0x1b87ba,{'transaction':_0x1a17ae})[_0xc430('0x2f')](function(){return BPromise['each'](_0x57f1a9,function(_0x264663){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x264663['id'],'ChatQueueId':_0x552031[_0xc430('0x4f')]['id']},'transaction':_0x1a17ae});});})[_0xc430('0x2f')](function(){_0x57f1a9[_0xc430('0x74')](function(_0x207067){socket[_0xc430('0x75')](_0xc430('0x76'),{'UserId':_0x207067['id'],'ChatQueueId':_0x6e48a3['id']});});});});});}})['then'](respondWithStatusCode(_0x49584a,null))[_0xc430('0x24')](handleError(_0x49584a,null));};exports[_0xc430('0x77')]=function(_0xdfa7b8,_0x3add69,_0x46418e){return db[_0xc430('0x6b')][_0xc430('0x4c')]({'where':{'id':_0xdfa7b8[_0xc430('0x3b')][_0xc430('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xc430('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc430('0x2f')](handleEntityNotFound(_0x3add69,null))[_0xc430('0x2f')](function(_0x506802){var _0x5659ff=_[_0xc430('0x35')](_0x506802,'id');var _0x369514=[];var _0x2ecfe0=[];var _0x203b82=squel[_0xc430('0x78')]();_0x203b82['field'](_0xc430('0x79'))[_0xc430('0x7a')](_0xc430('0x7b'),'tq')[_0xc430('0x7c')]('user_has_teams','ut',_0xc430('0x7d'))['where']('ChatQueueId\x20=\x20?',_0xdfa7b8[_0xc430('0x4f')]['id']);for(var _0x2d696d=0x0;_0x2d696d<_0x506802[_0xc430('0x40')];_0x2d696d+=0x1){let _0x861927=_0x506802[_0x2d696d];for(var _0x5b310e=0x0;_0x5b310e<_0x861927[_0xc430('0x6e')][_0xc430('0x40')];_0x5b310e+=0x1){let _0x49462f=_0x861927['Agents'][_0x5b310e];var _0x2fed71=_0x203b82[_0xc430('0x7e')]();_0x2fed71['where'](_0xc430('0x7f'),_0x49462f['id']);_0x2ecfe0[_0xc430('0x80')](db[_0xc430('0x81')][_0xc430('0x3b')](_0x2fed71[_0xc430('0x82')](),{'type':db[_0xc430('0x81')][_0xc430('0x83')]['SELECT']})[_0xc430('0x2f')](function(_0x192e2a){if(_0x192e2a[_0xc430('0x40')]===0x1){return _0x49462f['id'];}else{var _0x4c328b=_[_0xc430('0x84')](_[_0xc430('0x35')](_0x192e2a,'TeamId'),function(_0x5be657){return _[_0xc430('0x85')](_0x5659ff,_0x5be657);});if(_0x4c328b){return _0x49462f['id'];}}}));}}return BPromise['all'](_0x2ecfe0)[_0xc430('0x2f')](function(_0x13dd61){_0x369514=_(_0x369514)[_0xc430('0x86')](_0x13dd61)[_0xc430('0x87')]()['value']();return db[_0xc430('0x36')][_0xc430('0x51')]({'where':{'id':_0xdfa7b8[_0xc430('0x4f')]['id']}})[_0xc430('0x2f')](function(_0x41e743){return db[_0xc430('0x81')][_0xc430('0x73')](function(_0x5a69b8){return _0x41e743[_0xc430('0x77')](_0xdfa7b8[_0xc430('0x3b')]['ids'],{'transaction':_0x5a69b8})[_0xc430('0x2f')](function(){if(!_[_0xc430('0x88')](_0x369514)){return _0x41e743[_0xc430('0x89')](_0x369514,{'transaction':_0x5a69b8});}})['then'](function(){_0x369514[_0xc430('0x74')](function(_0x2df0ca){socket[_0xc430('0x75')](_0xc430('0x8a'),{'UserId':_0x2df0ca,'ChatQueueId':_0x41e743['id']});});});});});});})['then'](respondWithStatusCode(_0x3add69,null))[_0xc430('0x24')](handleError(_0x3add69,null));};exports[_0xc430('0x8b')]=function(_0x41ddfd,_0x30a14f,_0x2fd1f1){return db[_0xc430('0x36')][_0xc430('0x51')]({'where':{'id':_0x41ddfd[_0xc430('0x4f')]['id']}})[_0xc430('0x2f')](handleEntityNotFound(_0x30a14f,null))[_0xc430('0x2f')](function(_0x56a79a){if(_0x56a79a){return _0x56a79a[_0xc430('0x8b')](_0x41ddfd[_0xc430('0x53')][_0xc430('0x6d')],_[_0xc430('0x8c')](_0x41ddfd[_0xc430('0x53')],['ids','id'])||{})[_0xc430('0x8d')](function(_0x5deb37){for(var _0x353a52=0x0;_0x353a52<_0x41ddfd['body']['ids'][_0xc430('0x40')];_0x353a52+=0x1){socket['emit'](_0xc430('0x76'),{'UserId':_0x41ddfd[_0xc430('0x53')][_0xc430('0x6d')][_0x353a52],'ChatQueueId':_0x41ddfd[_0xc430('0x4f')]['id']});}return _0x5deb37;});}})[_0xc430('0x2f')](respondWithResult(_0x30a14f,null))[_0xc430('0x24')](handleError(_0x30a14f,null));};exports[_0xc430('0x89')]=function(_0x2a053f,_0x142b21,_0x47d802){return db['ChatQueue'][_0xc430('0x51')]({'where':{'id':_0x2a053f['params']['id']}})[_0xc430('0x2f')](handleEntityNotFound(_0x142b21,null))[_0xc430('0x2f')](function(_0x4a9ac3){if(_0x4a9ac3){return _0x4a9ac3[_0xc430('0x89')](_0x2a053f[_0xc430('0x3b')][_0xc430('0x6d')])[_0xc430('0x2f')](function(){if(_[_0xc430('0x8e')](_0x2a053f[_0xc430('0x3b')][_0xc430('0x6d')])){for(var _0x34df0d=0x0;_0x34df0d<_0x2a053f['query'][_0xc430('0x6d')][_0xc430('0x40')];_0x34df0d+=0x1){socket['emit'](_0xc430('0x8a'),{'UserId':Number(_0x2a053f[_0xc430('0x3b')][_0xc430('0x6d')][_0x34df0d]),'ChatQueueId':Number(_0x2a053f[_0xc430('0x4f')]['id'])});}}else{socket[_0xc430('0x75')](_0xc430('0x8a'),{'UserId':Number(_0x2a053f[_0xc430('0x3b')][_0xc430('0x6d')]),'ChatQueueId':Number(_0x2a053f[_0xc430('0x4f')]['id'])});}});}})[_0xc430('0x2f')](respondWithStatusCode(_0x142b21,null))[_0xc430('0x24')](handleError(_0x142b21,null));};exports['getAgents']=function(_0x37003d,_0x1ad10f,_0x27e2a6){var _0x32b6ed={};var _0x41d958={};var _0x311c07;var _0x408b26;return db[_0xc430('0x36')][_0xc430('0x6a')]({'where':{'id':_0x37003d[_0xc430('0x4f')]['id']}})[_0xc430('0x2f')](handleEntityNotFound(_0x1ad10f,null))[_0xc430('0x2f')](function(_0x24265b){if(_0x24265b){_0x311c07=_0x24265b;_0x41d958[_0xc430('0x3a')]=_[_0xc430('0x3c')](db[_0xc430('0x61')][_0xc430('0x37')]);_0x41d958[_0xc430('0x3b')]=_[_0xc430('0x3c')](_0x37003d[_0xc430('0x3b')]);_0x41d958[_0xc430('0x3d')]=_[_0xc430('0x3e')](_0x41d958[_0xc430('0x3a')],_0x41d958[_0xc430('0x3b')]);_0x32b6ed['attributes']=_[_0xc430('0x3e')](_0x41d958[_0xc430('0x3a')],qs[_0xc430('0x50')](_0x37003d[_0xc430('0x3b')][_0xc430('0x50')]));_0x32b6ed[_0xc430('0x3f')]=_0x32b6ed['attributes']['length']?_0x32b6ed[_0xc430('0x3f')]:_0x41d958['model'];_0x32b6ed[_0xc430('0x5f')]=qs[_0xc430('0x43')](_0x37003d['query'][_0xc430('0x43')]);_0x32b6ed[_0xc430('0x44')]=qs[_0xc430('0x3d')](_[_0xc430('0x45')](_0x37003d['query'],_0x41d958[_0xc430('0x3d')]));if(_0x37003d['query'][_0xc430('0x46')]){_0x32b6ed[_0xc430('0x44')]=_[_0xc430('0x47')](_0x32b6ed[_0xc430('0x44')],{'$or':_[_0xc430('0x35')](_0x32b6ed[_0xc430('0x3f')],function(_0x294ef8){var _0x12b3eb={};_0x12b3eb[_0x294ef8]={'$like':'%'+_0x37003d['query']['filter']+'%'};return _0x12b3eb;})});}_0x32b6ed=_['merge']({},_0x32b6ed,_0x37003d[_0xc430('0x49')]);return _0x311c07[_0xc430('0x8f')](_0x32b6ed);}})[_0xc430('0x2f')](function(_0x5f35ea){if(_0x5f35ea){_0x408b26=_0x5f35ea[_0xc430('0x40')];if(!_0x37003d['query'][_0xc430('0x41')](_0xc430('0x42'))){_0x32b6ed[_0xc430('0x29')]=qs[_0xc430('0x29')](_0x37003d['query'][_0xc430('0x29')]);_0x32b6ed[_0xc430('0x28')]=qs[_0xc430('0x28')](_0x37003d[_0xc430('0x3b')][_0xc430('0x28')]);}return _0x311c07[_0xc430('0x8f')](_0x32b6ed);}})[_0xc430('0x2f')](function(_0x4138b1){if(_0x4138b1){return _0x4138b1?{'count':_0x408b26,'rows':_0x4138b1}:null;}})['then'](respondWithResult(_0x1ad10f,null))[_0xc430('0x24')](handleError(_0x1ad10f,null));}; \ No newline at end of file +var _0xca6e=['ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatQueue.socket','register','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','merge','options','count','includeAll','findAll','rows','show','params','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','length','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','nolimit','getTeams','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:remove','getAgents','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv'];(function(_0x1666af,_0x3d5121){var _0x247b79=function(_0xec9044){while(--_0xec9044){_0x1666af['push'](_0x1666af['shift']());}};_0x247b79(++_0x3d5121);}(_0xca6e,0x1c1));var _0xeca6=function(_0x483987,_0x368124){_0x483987=_0x483987-0x0;var _0x1c44e3=_0xca6e[_0x483987];return _0x1c44e3;};'use strict';var pdf=require(_0xeca6('0x0'));var emlformat=require(_0xeca6('0x1'));var rimraf=require(_0xeca6('0x2'));var zipdir=require(_0xeca6('0x3'));var jsonpatch=require(_0xeca6('0x4'));var rp=require('request-promise');var moment=require(_0xeca6('0x5'));var BPromise=require(_0xeca6('0x6'));var Mustache=require('mustache');var util=require(_0xeca6('0x7'));var path=require('path');var sox=require(_0xeca6('0x8'));var csv=require(_0xeca6('0x9'));var ejs=require(_0xeca6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xeca6('0xb'));var crypto=require('crypto');var jsforce=require(_0xeca6('0xc'));var deskjs=require(_0xeca6('0xd'));var toCsv=require(_0xeca6('0x9'));var querystring=require(_0xeca6('0xe'));var Papa=require(_0xeca6('0xf'));var Redis=require('ioredis');var authService=require(_0xeca6('0x10'));var qs=require(_0xeca6('0x11'));var as=require(_0xeca6('0x12'));var hardwareService=require(_0xeca6('0x13'));var logger=require(_0xeca6('0x14'))('api');var utils=require(_0xeca6('0x15'));var config=require(_0xeca6('0x16'));var db=require(_0xeca6('0x17'))['db'];config[_0xeca6('0x18')]=_[_0xeca6('0x19')](config[_0xeca6('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeca6('0x18')]));require(_0xeca6('0x1a'))[_0xeca6('0x1b')](socket);var jayson=require(_0xeca6('0x1c'));var client=jayson['client'][_0xeca6('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x506744,_0x240498,_0x304300){if(_0x304300){var _0x19a4d1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19a4d1[_0xeca6('0x1e')](_0x240498)){return _0x506744;}else{throw new db[(_0xeca6('0x1f'))]['ValidationError'](_0xeca6('0x20'));}}else{return _0x506744;}}function respondWithRpcPromise(_0x5b78e0,_0x35dfba,_0x4f5a2f,_0x848ac4){return new BPromise(function(_0x1ea9e2,_0x1076c9){var _0x4b2b5e=_0x848ac4||client;return _0x4b2b5e['request'](_0x5b78e0,_0x4f5a2f)[_0xeca6('0x21')](function(_0x42518d){logger[_0xeca6('0x22')]('ChatQueue,\x20%s,\x20%s',_0x35dfba,_0xeca6('0x23'));logger[_0xeca6('0x24')](_0xeca6('0x25'),_0x35dfba,_0xeca6('0x23'),JSON[_0xeca6('0x26')](_0x42518d));if(_0x42518d[_0xeca6('0x27')]){if(_0x42518d[_0xeca6('0x27')][_0xeca6('0x28')]===0x1f4){logger[_0xeca6('0x27')](_0xeca6('0x29'),_0x35dfba,_0x42518d[_0xeca6('0x27')][_0xeca6('0x2a')]);return _0x1076c9(_0x42518d[_0xeca6('0x27')][_0xeca6('0x2a')]);}logger[_0xeca6('0x27')](_0xeca6('0x29'),_0x35dfba,_0x42518d[_0xeca6('0x27')][_0xeca6('0x2a')]);return _0x1ea9e2(_0x42518d[_0xeca6('0x27')][_0xeca6('0x2a')]);}else{logger[_0xeca6('0x22')]('ChatQueue,\x20%s,\x20%s',_0x35dfba,'request\x20sent');_0x1ea9e2(_0x42518d['result']['message']);}})[_0xeca6('0x2b')](function(_0x1b7d23){logger[_0xeca6('0x27')]('ChatQueue,\x20%s,\x20%s',_0x35dfba,_0x1b7d23);_0x1076c9(_0x1b7d23);});});}function respondWithStatusCode(_0x280db1,_0x1fbedd){_0x1fbedd=_0x1fbedd||0xcc;return function(_0x2292fe){if(_0x2292fe){return _0x280db1[_0xeca6('0x2c')](_0x1fbedd);}return _0x280db1[_0xeca6('0x2d')](_0x1fbedd)[_0xeca6('0x2e')]();};}function respondWithResult(_0x5e3833,_0x21c388){_0x21c388=_0x21c388||0xc8;return function(_0x561c4e){if(_0x561c4e){return _0x5e3833['status'](_0x21c388)[_0xeca6('0x2f')](_0x561c4e);}};}function respondWithFilteredResult(_0x37b5f3,_0x3d4f72){return function(_0x3a7f8a){if(_0x3a7f8a){var _0x25fb20=_0x3a7f8a['count'],_0x51ba53=_0x3d4f72[_0xeca6('0x30')],_0x43b04a=_0x3d4f72[_0xeca6('0x30')]+_0x3d4f72[_0xeca6('0x31')],_0xd0a5ad;if(_0x43b04a>=_0x25fb20){_0x43b04a=_0x25fb20;_0xd0a5ad=0xc8;}else{_0xd0a5ad=0xce;}_0x37b5f3['status'](_0xd0a5ad);return _0x37b5f3[_0xeca6('0x32')](_0xeca6('0x33'),_0x51ba53+'-'+_0x43b04a+'/'+_0x25fb20)[_0xeca6('0x2f')](_0x3a7f8a);}return null;};}function patchUpdates(_0x247c17){return function(_0x350fbb){try{jsonpatch[_0xeca6('0x34')](_0x350fbb,_0x247c17,!![]);}catch(_0x591876){return BPromise[_0xeca6('0x35')](_0x591876);}return _0x350fbb[_0xeca6('0x36')]();};}function saveUpdates(_0x469da8,_0x38fc8f){return function(_0x175d30){if(_0x175d30){return _0x175d30[_0xeca6('0x37')](_0x469da8)[_0xeca6('0x21')](function(_0x1003f7){return _0x1003f7;});}return null;};}function removeEntity(_0x1f645b,_0xe4c2e6){return function(_0x2d1169){if(_0x2d1169){return _0x2d1169[_0xeca6('0x38')]()[_0xeca6('0x21')](function(){var _0x4c78b3=_0x2d1169[_0xeca6('0x39')]({'plain':!![]});var _0x1dbadc=_0xeca6('0x3a');return db['UserProfileResource'][_0xeca6('0x38')]({'where':{'type':_0x1dbadc,'resourceId':_0x4c78b3['id']}})[_0xeca6('0x21')](function(){return _0x2d1169;});})[_0xeca6('0x21')](function(){_0x1f645b[_0xeca6('0x2d')](0xcc)[_0xeca6('0x2e')]();});}};}function handleEntityNotFound(_0x27a29a,_0x294e34){return function(_0x571614){if(!_0x571614){_0x27a29a[_0xeca6('0x2c')](0x194);}return _0x571614;};}function handleError(_0x19555f,_0x3d602c){_0x3d602c=_0x3d602c||0x1f4;return function(_0x43d699){logger[_0xeca6('0x27')](_0x43d699['stack']);if(_0x43d699['name']){delete _0x43d699[_0xeca6('0x3b')];}_0x19555f[_0xeca6('0x2d')](_0x3d602c)[_0xeca6('0x3c')](_0x43d699);};}exports['index']=function(_0x40078,_0x5be97f){var _0x5182ee={},_0x28bcc4={},_0x1015a1={'count':0x0,'rows':[]};var _0x15022c=_[_0xeca6('0x3d')](db[_0xeca6('0x3e')][_0xeca6('0x3f')],function(_0x285012){return{'name':_0x285012[_0xeca6('0x40')],'type':_0x285012[_0xeca6('0x41')][_0xeca6('0x42')]};});_0x28bcc4[_0xeca6('0x43')]=_[_0xeca6('0x3d')](_0x15022c,'name');_0x28bcc4[_0xeca6('0x44')]=_[_0xeca6('0x45')](_0x40078[_0xeca6('0x44')]);_0x28bcc4['filters']=_[_0xeca6('0x46')](_0x28bcc4[_0xeca6('0x43')],_0x28bcc4['query']);_0x5182ee[_0xeca6('0x47')]=_[_0xeca6('0x46')](_0x28bcc4[_0xeca6('0x43')],qs[_0xeca6('0x48')](_0x40078['query'][_0xeca6('0x48')]));_0x5182ee['attributes']=_0x5182ee[_0xeca6('0x47')]['length']?_0x5182ee['attributes']:_0x28bcc4['model'];if(!_0x40078[_0xeca6('0x44')][_0xeca6('0x49')]('nolimit')){_0x5182ee[_0xeca6('0x31')]=qs[_0xeca6('0x31')](_0x40078[_0xeca6('0x44')]['limit']);_0x5182ee[_0xeca6('0x30')]=qs[_0xeca6('0x30')](_0x40078[_0xeca6('0x44')][_0xeca6('0x30')]);}_0x5182ee[_0xeca6('0x4a')]=qs[_0xeca6('0x4b')](_0x40078['query'][_0xeca6('0x4b')]);_0x5182ee['where']=qs[_0xeca6('0x4c')](_['pick'](_0x40078[_0xeca6('0x44')],_0x28bcc4[_0xeca6('0x4c')]));if(_0x40078[_0xeca6('0x44')][_0xeca6('0x4d')]){_0x5182ee[_0xeca6('0x4e')]=_[_0xeca6('0x4f')](_0x5182ee[_0xeca6('0x4e')],{'$or':_[_0xeca6('0x3d')](_0x15022c,function(_0x308763){if(_0x308763[_0xeca6('0x41')]!=='VIRTUAL'){var _0x5cc8ea={};_0x5cc8ea[_0x308763[_0xeca6('0x3b')]]={'$like':'%'+_0x40078[_0xeca6('0x44')][_0xeca6('0x4d')]+'%'};return _0x5cc8ea;}})});}_0x5182ee=_[_0xeca6('0x4f')]({},_0x5182ee,_0x40078[_0xeca6('0x50')]);var _0x58a62a={'where':_0x5182ee[_0xeca6('0x4e')]};return db[_0xeca6('0x3e')][_0xeca6('0x51')](_0x58a62a)[_0xeca6('0x21')](function(_0x449c15){_0x1015a1[_0xeca6('0x51')]=_0x449c15;if(_0x40078[_0xeca6('0x44')][_0xeca6('0x52')]){_0x5182ee['include']=[{'all':!![]}];}return db[_0xeca6('0x3e')][_0xeca6('0x53')](_0x5182ee);})[_0xeca6('0x21')](function(_0x40a397){_0x1015a1[_0xeca6('0x54')]=_0x40a397;return _0x1015a1;})[_0xeca6('0x21')](respondWithFilteredResult(_0x5be97f,_0x5182ee))[_0xeca6('0x2b')](handleError(_0x5be97f,null));};exports[_0xeca6('0x55')]=function(_0xd732c,_0x525b80){var _0x563a38={'raw':!![],'where':{'id':_0xd732c[_0xeca6('0x56')]['id']}},_0x4cde44={};_0x4cde44[_0xeca6('0x43')]=_[_0xeca6('0x45')](db[_0xeca6('0x3e')][_0xeca6('0x3f')]);_0x4cde44[_0xeca6('0x44')]=_[_0xeca6('0x45')](_0xd732c['query']);_0x4cde44[_0xeca6('0x4c')]=_['intersection'](_0x4cde44[_0xeca6('0x43')],_0x4cde44['query']);_0x563a38[_0xeca6('0x47')]=_[_0xeca6('0x46')](_0x4cde44[_0xeca6('0x43')],qs[_0xeca6('0x48')](_0xd732c[_0xeca6('0x44')][_0xeca6('0x48')]));_0x563a38[_0xeca6('0x47')]=_0x563a38[_0xeca6('0x47')]['length']?_0x563a38[_0xeca6('0x47')]:_0x4cde44[_0xeca6('0x43')];if(_0xd732c[_0xeca6('0x44')][_0xeca6('0x52')]){_0x563a38[_0xeca6('0x57')]=[{'all':!![]}];}_0x563a38=_[_0xeca6('0x4f')]({},_0x563a38,_0xd732c[_0xeca6('0x50')]);return db[_0xeca6('0x3e')][_0xeca6('0x58')](_0x563a38)[_0xeca6('0x21')](handleEntityNotFound(_0x525b80,null))[_0xeca6('0x21')](respondWithResult(_0x525b80,null))[_0xeca6('0x2b')](handleError(_0x525b80,null));};exports['create']=function(_0x5a564e,_0x28043f){return db[_0xeca6('0x3e')][_0xeca6('0x59')](_0x5a564e[_0xeca6('0x5a')],{})[_0xeca6('0x21')](function(_0x3babc6){var _0x5d6542=_0x5a564e[_0xeca6('0x5b')][_0xeca6('0x39')]({'plain':!![]});if(!_0x5d6542)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d6542[_0xeca6('0x5c')]===_0xeca6('0x5b')){var _0x1de98f=_0x3babc6[_0xeca6('0x39')]({'plain':!![]});var _0x4f1620=_0xeca6('0x3a');return db['UserProfileSection'][_0xeca6('0x58')]({'where':{'name':_0x4f1620,'userProfileId':_0x5d6542[_0xeca6('0x5d')]},'raw':!![]})[_0xeca6('0x21')](function(_0x23581c){if(_0x23581c&&_0x23581c[_0xeca6('0x5e')]===0x0){return db['UserProfileResource'][_0xeca6('0x59')]({'name':_0x1de98f[_0xeca6('0x3b')],'resourceId':_0x1de98f['id'],'type':_0x23581c[_0xeca6('0x3b')],'sectionId':_0x23581c['id']},{})[_0xeca6('0x21')](function(){return _0x3babc6;});}else{return _0x3babc6;}})[_0xeca6('0x2b')](function(_0x14d110){logger[_0xeca6('0x27')](_0xeca6('0x5f'),_0x14d110);throw _0x14d110;});}return _0x3babc6;})[_0xeca6('0x21')](respondWithResult(_0x28043f,0xc9))[_0xeca6('0x2b')](handleError(_0x28043f,null));};exports[_0xeca6('0x37')]=function(_0x3dba3c,_0x377ef3){if(_0x3dba3c[_0xeca6('0x5a')]['id']){delete _0x3dba3c[_0xeca6('0x5a')]['id'];}return db[_0xeca6('0x3e')][_0xeca6('0x58')]({'where':{'id':_0x3dba3c[_0xeca6('0x56')]['id']}})['then'](handleEntityNotFound(_0x377ef3,null))['then'](saveUpdates(_0x3dba3c[_0xeca6('0x5a')],null))['then'](respondWithResult(_0x377ef3,null))[_0xeca6('0x2b')](handleError(_0x377ef3,null));};exports[_0xeca6('0x38')]=function(_0x55e993,_0x95ef87){return db[_0xeca6('0x3e')][_0xeca6('0x58')]({'where':{'id':_0x55e993['params']['id']}})[_0xeca6('0x21')](handleEntityNotFound(_0x95ef87,null))[_0xeca6('0x21')](removeEntity(_0x95ef87,null))[_0xeca6('0x2b')](handleError(_0x95ef87,null));};exports[_0xeca6('0x60')]=function(_0x1f35cd,_0x2b34c0){return db['ChatQueue']['describe']()[_0xeca6('0x21')](respondWithResult(_0x2b34c0,null))['catch'](handleError(_0x2b34c0,null));};exports[_0xeca6('0x61')]=function(_0x348a34,_0x594b4a,_0x15ef17){var _0x471cce={'raw':!![],'where':{}},_0x88ce76={},_0x992698;return db[_0xeca6('0x3e')][_0xeca6('0x62')]({'where':{'id':_0x348a34[_0xeca6('0x56')]['id']}})['then'](handleEntityNotFound(_0x594b4a,null))[_0xeca6('0x21')](function(_0xa29dac){if(_0xa29dac){_0x992698=_0xa29dac[_0xeca6('0x39')]({'plain':!![]});_0x88ce76[_0xeca6('0x43')]=_[_0xeca6('0x45')](db[_0xeca6('0x63')]['rawAttributes']);_0x88ce76['query']=_[_0xeca6('0x45')](_0x348a34[_0xeca6('0x44')]);_0x88ce76['filters']=_['intersection'](_0x88ce76['model'],_0x88ce76['query']);_0x471cce[_0xeca6('0x47')]=_[_0xeca6('0x46')](_0x88ce76[_0xeca6('0x43')],qs[_0xeca6('0x48')](_0x348a34[_0xeca6('0x44')]['fields']));_0x471cce[_0xeca6('0x47')]=_0x471cce[_0xeca6('0x47')][_0xeca6('0x64')]?_0x471cce['attributes']:_0x88ce76[_0xeca6('0x43')];if(!_0x348a34['query']['hasOwnProperty']('nolimit')){_0x471cce[_0xeca6('0x31')]=qs['limit'](_0x348a34[_0xeca6('0x44')][_0xeca6('0x31')]);_0x471cce[_0xeca6('0x30')]=qs[_0xeca6('0x30')](_0x348a34[_0xeca6('0x44')][_0xeca6('0x30')]);}_0x471cce[_0xeca6('0x4a')]=qs[_0xeca6('0x4b')](_0x348a34[_0xeca6('0x44')][_0xeca6('0x4b')]);_0x471cce[_0xeca6('0x4e')]=qs[_0xeca6('0x4c')](_['pick'](_0x348a34[_0xeca6('0x44')],_0x88ce76[_0xeca6('0x4c')]));_0x471cce['where'][_0xeca6('0x65')]=_0xa29dac['id'];if(_0x348a34[_0xeca6('0x44')][_0xeca6('0x4d')]){_0x471cce[_0xeca6('0x4e')]=_['merge'](_0x471cce[_0xeca6('0x4e')],{'$or':_[_0xeca6('0x3d')](_0x471cce[_0xeca6('0x47')],function(_0x551796){var _0xd35d9e={};_0xd35d9e[_0x551796]={'$like':'%'+_0x348a34[_0xeca6('0x44')][_0xeca6('0x4d')]+'%'};return _0xd35d9e;})});}_0x471cce=_[_0xeca6('0x4f')]({},_0x471cce,_0x348a34[_0xeca6('0x50')]);return db[_0xeca6('0x63')]['findAll'](_0x471cce);}})['then'](function(_0x5196e7){if(_0x5196e7){return db['User'][_0xeca6('0x66')]({'where':{'id':_[_0xeca6('0x3d')](_0x5196e7,_0xeca6('0x67')),'role':_0xeca6('0x68')},'attributes':['id','name',_0xeca6('0x69'),_0xeca6('0x6a'),_0xeca6('0x6b')]});}})[_0xeca6('0x21')](function(_0x5ca573){if(_0x5ca573){return{'count':_0x5ca573['count'],'rows':_[_0xeca6('0x3d')](_0x5ca573['rows'],function(_0x512ac2){return{'membername':_0x512ac2[_0xeca6('0x3b')],'UserId':_0x512ac2['id'],'queue_name':_0x992698[_0xeca6('0x3b')],'ChatQueueId':_0x992698['id'],'interface':util[_0xeca6('0x6c')](_0xeca6('0x6d'),_0xeca6('0x6e'),_0x512ac2[_0xeca6('0x3b')]),'penalty':0x0,'paused':_0x512ac2[_0xeca6('0x69')],'createdAt':_0x512ac2[_0xeca6('0x6b')],'updatedAt':_0x512ac2[_0xeca6('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeca6('0x21')](respondWithFilteredResult(_0x594b4a,_0x471cce))['catch'](handleError(_0x594b4a,null));};exports['getTeams']=function(_0x42915b,_0x32554b,_0xfae120){var _0x447397={};var _0x4e8986={};var _0xdce963;var _0x16d289;return db[_0xeca6('0x3e')][_0xeca6('0x62')]({'where':{'id':_0x42915b[_0xeca6('0x56')]['id']}})[_0xeca6('0x21')](handleEntityNotFound(_0x32554b,null))['then'](function(_0x30886d){if(_0x30886d){_0xdce963=_0x30886d;_0x4e8986['model']=_[_0xeca6('0x45')](db[_0xeca6('0x6f')][_0xeca6('0x3f')]);_0x4e8986[_0xeca6('0x44')]=_[_0xeca6('0x45')](_0x42915b[_0xeca6('0x44')]);_0x4e8986['filters']=_['intersection'](_0x4e8986[_0xeca6('0x43')],_0x4e8986[_0xeca6('0x44')]);_0x447397[_0xeca6('0x47')]=_['intersection'](_0x4e8986[_0xeca6('0x43')],qs[_0xeca6('0x48')](_0x42915b[_0xeca6('0x44')]['fields']));_0x447397[_0xeca6('0x47')]=_0x447397[_0xeca6('0x47')][_0xeca6('0x64')]?_0x447397[_0xeca6('0x47')]:_0x4e8986[_0xeca6('0x43')];_0x447397['order']=qs[_0xeca6('0x4b')](_0x42915b[_0xeca6('0x44')]['sort']);_0x447397[_0xeca6('0x4e')]=qs[_0xeca6('0x4c')](_['pick'](_0x42915b['query'],_0x4e8986['filters']));if(_0x42915b['query'][_0xeca6('0x4d')]){_0x447397['where']=_[_0xeca6('0x4f')](_0x447397[_0xeca6('0x4e')],{'$or':_['map'](_0x447397[_0xeca6('0x47')],function(_0x597b7a){var _0x369525={};_0x369525[_0x597b7a]={'$like':'%'+_0x42915b['query'][_0xeca6('0x4d')]+'%'};return _0x369525;})});}_0x447397=_['merge']({},_0x447397,_0x42915b[_0xeca6('0x50')]);return _0xdce963['getTeams'](_0x447397);}})['then'](function(_0xe45c3b){if(_0xe45c3b){_0x16d289=_0xe45c3b[_0xeca6('0x64')];if(!_0x42915b['query'][_0xeca6('0x49')](_0xeca6('0x70'))){_0x447397[_0xeca6('0x31')]=qs[_0xeca6('0x31')](_0x42915b[_0xeca6('0x44')]['limit']);_0x447397[_0xeca6('0x30')]=qs['offset'](_0x42915b[_0xeca6('0x44')][_0xeca6('0x30')]);}return _0xdce963[_0xeca6('0x71')](_0x447397);}})[_0xeca6('0x21')](function(_0x109efe){if(_0x109efe){return _0x109efe?{'count':_0x16d289,'rows':_0x109efe}:null;}})[_0xeca6('0x21')](respondWithResult(_0x32554b,null))[_0xeca6('0x2b')](handleError(_0x32554b,null));};exports[_0xeca6('0x72')]=function(_0x5b7bc9,_0x5b62b1,_0x385926){var _0x3dec35=_0x5b7bc9[_0xeca6('0x5a')][_0xeca6('0x73')];return db[_0xeca6('0x6f')][_0xeca6('0x53')]({'where':{'id':_0x3dec35},'attributes':['id'],'include':[{'model':db[_0xeca6('0x74')],'as':_0xeca6('0x75'),'attributes':['id','name',_0xeca6('0x76'),'voicePause',_0xeca6('0x77')],'raw':!![]}]})[_0xeca6('0x21')](function(_0x26c2c5){if(_0x26c2c5){var _0x2a1bcf=_[_0xeca6('0x78')](_0x26c2c5,function(_0x1229de){var _0x2a711f=_0x1229de['get']({'plain':!![]});return _0x2a711f[_0xeca6('0x75')];});return db[_0xeca6('0x3e')]['find']({'where':{'id':_0x5b7bc9[_0xeca6('0x56')]['id']}})[_0xeca6('0x21')](function(_0xe00fae){return db[_0xeca6('0x79')][_0xeca6('0x7a')](function(_0x58e518){return _0xe00fae[_0xeca6('0x72')](_0x3dec35,{'transaction':_0x58e518})['then'](function(){return BPromise[_0xeca6('0x7b')](_0x2a1bcf,function(_0x48b7cd){return db[_0xeca6('0x63')][_0xeca6('0x7c')]({'where':{'UserId':_0x48b7cd['id'],'ChatQueueId':_0x5b7bc9[_0xeca6('0x56')]['id']},'transaction':_0x58e518});});})[_0xeca6('0x21')](function(){_0x2a1bcf[_0xeca6('0x7d')](function(_0x2171ba){socket[_0xeca6('0x7e')](_0xeca6('0x7f'),{'UserId':_0x2171ba['id'],'ChatQueueId':_0xe00fae['id']});});});});});}})[_0xeca6('0x21')](respondWithStatusCode(_0x5b62b1,null))['catch'](handleError(_0x5b62b1,null));};exports['removeTeams']=function(_0x130cc4,_0x58a45c,_0x3d8a2b){return db[_0xeca6('0x6f')]['findAll']({'where':{'id':_0x130cc4[_0xeca6('0x44')]['ids']},'attributes':['id'],'include':[{'model':db[_0xeca6('0x74')],'as':_0xeca6('0x75'),'attributes':['id'],'raw':!![]}]})[_0xeca6('0x21')](handleEntityNotFound(_0x58a45c,null))['then'](function(_0x3a1416){var _0x2937dc=_[_0xeca6('0x3d')](_0x3a1416,'id');var _0x301c25=[];var _0x2bf10d=[];var _0x4f3474=squel['select']();_0x4f3474[_0xeca6('0x80')]('tq.TeamId')[_0xeca6('0x81')](_0xeca6('0x82'),'tq')['join'](_0xeca6('0x83'),'ut',_0xeca6('0x84'))[_0xeca6('0x4e')](_0xeca6('0x85'),_0x130cc4[_0xeca6('0x56')]['id']);for(var _0x5c52be=0x0;_0x5c52be<_0x3a1416[_0xeca6('0x64')];_0x5c52be+=0x1){let _0x5a4f9e=_0x3a1416[_0x5c52be];for(var _0x5750ed=0x0;_0x5750ed<_0x5a4f9e[_0xeca6('0x75')]['length'];_0x5750ed+=0x1){let _0x4532bd=_0x5a4f9e[_0xeca6('0x75')][_0x5750ed];var _0x5b5874=_0x4f3474[_0xeca6('0x86')]();_0x5b5874['where'](_0xeca6('0x87'),_0x4532bd['id']);_0x2bf10d[_0xeca6('0x88')](db[_0xeca6('0x79')][_0xeca6('0x44')](_0x5b5874['toString'](),{'type':db[_0xeca6('0x79')][_0xeca6('0x89')][_0xeca6('0x8a')]})['then'](function(_0x55847e){if(_0x55847e[_0xeca6('0x64')]===0x1){return _0x4532bd['id'];}else{var _0x234bf3=_[_0xeca6('0x8b')](_['map'](_0x55847e,'TeamId'),function(_0xcec13f){return _[_0xeca6('0x8c')](_0x2937dc,_0xcec13f);});if(_0x234bf3){return _0x4532bd['id'];}}}));}}return BPromise[_0xeca6('0x8d')](_0x2bf10d)['then'](function(_0x204549){_0x301c25=_(_0x301c25)['union'](_0x204549)[_0xeca6('0x8e')]()[_0xeca6('0x8f')]();return db['ChatQueue']['find']({'where':{'id':_0x130cc4[_0xeca6('0x56')]['id']}})[_0xeca6('0x21')](function(_0x1275c0){return db[_0xeca6('0x79')][_0xeca6('0x7a')](function(_0x412c83){return _0x1275c0[_0xeca6('0x90')](_0x130cc4[_0xeca6('0x44')][_0xeca6('0x73')],{'transaction':_0x412c83})[_0xeca6('0x21')](function(){if(!_[_0xeca6('0x91')](_0x301c25)){return _0x1275c0[_0xeca6('0x92')](_0x301c25,{'transaction':_0x412c83});}})['then'](function(){_0x301c25[_0xeca6('0x7d')](function(_0x364cbd){socket['emit']('userChatQueue:remove',{'UserId':_0x364cbd,'ChatQueueId':_0x1275c0['id']});});});});});});})[_0xeca6('0x21')](respondWithStatusCode(_0x58a45c,null))[_0xeca6('0x2b')](handleError(_0x58a45c,null));};exports[_0xeca6('0x93')]=function(_0x2c2017,_0x377ee5,_0x5b124b){return db['ChatQueue'][_0xeca6('0x58')]({'where':{'id':_0x2c2017['params']['id']}})['then'](handleEntityNotFound(_0x377ee5,null))[_0xeca6('0x21')](function(_0x4f5ac8){if(_0x4f5ac8){return _0x4f5ac8['addAgents'](_0x2c2017[_0xeca6('0x5a')]['ids'],_[_0xeca6('0x94')](_0x2c2017[_0xeca6('0x5a')],[_0xeca6('0x73'),'id'])||{})[_0xeca6('0x95')](function(_0x2fb226){for(var _0x3e064b=0x0;_0x3e064b<_0x2c2017['body'][_0xeca6('0x73')][_0xeca6('0x64')];_0x3e064b+=0x1){socket[_0xeca6('0x7e')](_0xeca6('0x7f'),{'UserId':_0x2c2017[_0xeca6('0x5a')][_0xeca6('0x73')][_0x3e064b],'ChatQueueId':_0x2c2017[_0xeca6('0x56')]['id']});}return _0x2fb226;});}})[_0xeca6('0x21')](respondWithResult(_0x377ee5,null))[_0xeca6('0x2b')](handleError(_0x377ee5,null));};exports['removeAgents']=function(_0xed134c,_0x290ffa,_0x38d12b){return db[_0xeca6('0x3e')][_0xeca6('0x58')]({'where':{'id':_0xed134c[_0xeca6('0x56')]['id']}})['then'](handleEntityNotFound(_0x290ffa,null))['then'](function(_0x1ddc15){if(_0x1ddc15){return _0x1ddc15[_0xeca6('0x92')](_0xed134c[_0xeca6('0x44')][_0xeca6('0x73')])['then'](function(){if(_['isArray'](_0xed134c['query'][_0xeca6('0x73')])){for(var _0x27ccfc=0x0;_0x27ccfc<_0xed134c[_0xeca6('0x44')]['ids']['length'];_0x27ccfc+=0x1){socket['emit'](_0xeca6('0x96'),{'UserId':Number(_0xed134c[_0xeca6('0x44')][_0xeca6('0x73')][_0x27ccfc]),'ChatQueueId':Number(_0xed134c[_0xeca6('0x56')]['id'])});}}else{socket[_0xeca6('0x7e')]('userChatQueue:remove',{'UserId':Number(_0xed134c[_0xeca6('0x44')][_0xeca6('0x73')]),'ChatQueueId':Number(_0xed134c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x290ffa,null))[_0xeca6('0x2b')](handleError(_0x290ffa,null));};exports[_0xeca6('0x97')]=function(_0x5a0554,_0x57f6fd,_0x45b5c7){var _0xd03065={};var _0x5cde0f={};var _0x207269;var _0x220700;return db['ChatQueue'][_0xeca6('0x62')]({'where':{'id':_0x5a0554['params']['id']}})[_0xeca6('0x21')](handleEntityNotFound(_0x57f6fd,null))[_0xeca6('0x21')](function(_0x1dd057){if(_0x1dd057){_0x207269=_0x1dd057;_0x5cde0f[_0xeca6('0x43')]=_[_0xeca6('0x45')](db[_0xeca6('0x74')]['rawAttributes']);_0x5cde0f['query']=_['keys'](_0x5a0554[_0xeca6('0x44')]);_0x5cde0f[_0xeca6('0x4c')]=_[_0xeca6('0x46')](_0x5cde0f[_0xeca6('0x43')],_0x5cde0f['query']);_0xd03065[_0xeca6('0x47')]=_['intersection'](_0x5cde0f[_0xeca6('0x43')],qs[_0xeca6('0x48')](_0x5a0554[_0xeca6('0x44')]['fields']));_0xd03065[_0xeca6('0x47')]=_0xd03065[_0xeca6('0x47')][_0xeca6('0x64')]?_0xd03065['attributes']:_0x5cde0f[_0xeca6('0x43')];_0xd03065[_0xeca6('0x4a')]=qs[_0xeca6('0x4b')](_0x5a0554[_0xeca6('0x44')][_0xeca6('0x4b')]);_0xd03065['where']=qs[_0xeca6('0x4c')](_[_0xeca6('0x98')](_0x5a0554[_0xeca6('0x44')],_0x5cde0f[_0xeca6('0x4c')]));if(_0x5a0554[_0xeca6('0x44')][_0xeca6('0x4d')]){_0xd03065[_0xeca6('0x4e')]=_[_0xeca6('0x4f')](_0xd03065[_0xeca6('0x4e')],{'$or':_[_0xeca6('0x3d')](_0xd03065[_0xeca6('0x47')],function(_0x19297e){var _0x1d889a={};_0x1d889a[_0x19297e]={'$like':'%'+_0x5a0554[_0xeca6('0x44')][_0xeca6('0x4d')]+'%'};return _0x1d889a;})});}_0xd03065=_[_0xeca6('0x4f')]({},_0xd03065,_0x5a0554['options']);return _0x207269[_0xeca6('0x97')](_0xd03065);}})['then'](function(_0x367da6){if(_0x367da6){_0x220700=_0x367da6[_0xeca6('0x64')];if(!_0x5a0554[_0xeca6('0x44')][_0xeca6('0x49')]('nolimit')){_0xd03065[_0xeca6('0x31')]=qs[_0xeca6('0x31')](_0x5a0554['query'][_0xeca6('0x31')]);_0xd03065[_0xeca6('0x30')]=qs[_0xeca6('0x30')](_0x5a0554[_0xeca6('0x44')][_0xeca6('0x30')]);}return _0x207269[_0xeca6('0x97')](_0xd03065);}})[_0xeca6('0x21')](function(_0x2ebbb9){if(_0x2ebbb9){return _0x2ebbb9?{'count':_0x220700,'rows':_0x2ebbb9}:null;}})[_0xeca6('0x21')](respondWithResult(_0x57f6fd,null))[_0xeca6('0x2b')](handleError(_0x57f6fd,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index b06dda0..444dae9 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0xdcdf4d,_0xe260d4){var _0x100211=function(_0x4a5a1f){while(--_0x4a5a1f){_0xdcdf4d['push'](_0xdcdf4d['shift']());}};_0x100211(++_0xe260d4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b8783,_0x34c662){_0x3b8783=_0x3b8783-0x0;var _0x93d64a=_0x5f2f[_0x3b8783];return _0x93d64a;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x2da75c,_0x39b28e){var _0xa83850=function(_0x25986){while(--_0x25986){_0x2da75c['push'](_0x2da75c['shift']());}};_0xa83850(++_0x39b28e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b7e20,_0x17cfec){_0x5b7e20=_0x5b7e20-0x0;var _0x57eddf=_0xb10b[_0x5b7e20];return _0x57eddf;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index dff5ad0..f4b00a3 100644 --- a/server/api/chatQueue/chatQueue.model.js +++ b/server/api/chatQueue/chatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe551=['moment','bluebird','rimraf','./chatQueue.attributes','exports','ChatQueue','lodash','../../config/logger','api'];(function(_0x1bf7c8,_0x2be49f){var _0xc04a1b=function(_0x3948f8){while(--_0x3948f8){_0x1bf7c8['push'](_0x1bf7c8['shift']());}};_0xc04a1b(++_0x2be49f);}(_0xe551,0x1d1));var _0x1e55=function(_0x5e2c27,_0x17ed5a){_0x5e2c27=_0x5e2c27-0x0;var _0x4fd467=_0xe551[_0x5e2c27];return _0x4fd467;};'use strict';var _=require(_0x1e55('0x0'));var util=require('util');var logger=require(_0x1e55('0x1'))(_0x1e55('0x2'));var moment=require(_0x1e55('0x3'));var BPromise=require(_0x1e55('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1e55('0x5'));var config=require('../../config/environment');var attributes=require(_0x1e55('0x6'));module[_0x1e55('0x7')]=function(_0x3d03d9,_0xd9c1a7){return _0x3d03d9['define'](_0x1e55('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fa0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0xd89d1,_0x422073){var _0x193b62=function(_0x28f6cb){while(--_0x28f6cb){_0xd89d1['push'](_0xd89d1['shift']());}};_0x193b62(++_0x422073);}(_0x0fa0,0xeb));var _0x00fa=function(_0x5310b3,_0x31bd3e){_0x5310b3=_0x5310b3-0x0;var _0xa83006=_0x0fa0[_0x5310b3];return _0xa83006;};'use strict';var _=require(_0x00fa('0x0'));var util=require(_0x00fa('0x1'));var logger=require(_0x00fa('0x2'))(_0x00fa('0x3'));var moment=require(_0x00fa('0x4'));var BPromise=require(_0x00fa('0x5'));var rp=require(_0x00fa('0x6'));var fs=require('fs');var path=require(_0x00fa('0x7'));var rimraf=require(_0x00fa('0x8'));var config=require(_0x00fa('0x9'));var attributes=require('./chatQueue.attributes');module[_0x00fa('0xa')]=function(_0x605f76,_0x90f3f1){return _0x605f76[_0x00fa('0xb')](_0x00fa('0xc'),attributes,{'tableName':_0x00fa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index e64f03d..4d5ed84 100644 --- a/server/api/chatQueue/chatQueue.rpc.js +++ b/server/api/chatQueue/chatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f97=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','options','where','limit','include','map','model','attributes','find','raw','ShowChatQueue','catch','lodash','util','moment','bluebird'];(function(_0x352dbb,_0x343ceb){var _0x26a434=function(_0x562436){while(--_0x562436){_0x352dbb['push'](_0x352dbb['shift']());}};_0x26a434(++_0x343ceb);}(_0x0f97,0x196));var _0x70f9=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x0f97[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var moment=require(_0x70f9('0x2'));var BPromise=require(_0x70f9('0x3'));var rs=require(_0x70f9('0x4'));var fs=require('fs');var Redis=require(_0x70f9('0x5'));var db=require(_0x70f9('0x6'))['db'];var utils=require(_0x70f9('0x7'));var logger=require(_0x70f9('0x8'))(_0x70f9('0x9'));var config=require(_0x70f9('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x70f9('0xb')]({'port':0x232a});config[_0x70f9('0xc')]=_[_0x70f9('0xd')](config[_0x70f9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70f9('0xc')]));require(_0x70f9('0xe'))[_0x70f9('0xf')](socket);function respondWithRpcPromise(_0xa97b2,_0x481fc2,_0x4c8cb4){return new BPromise(function(_0x5de133,_0x50f052){return client[_0x70f9('0x10')](_0xa97b2,_0x4c8cb4)[_0x70f9('0x11')](function(_0x5951be){logger[_0x70f9('0x12')]('ChatQueue,\x20%s,\x20%s',_0x481fc2,_0x70f9('0x13'));logger[_0x70f9('0x14')](_0x70f9('0x15'),_0x481fc2,_0x70f9('0x13'),JSON[_0x70f9('0x16')](_0x5951be));if(_0x5951be['error']){if(_0x5951be[_0x70f9('0x17')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x481fc2,_0x5951be['error'][_0x70f9('0x18')]);return _0x50f052(_0x5951be['error'][_0x70f9('0x18')]);}logger[_0x70f9('0x17')](_0x70f9('0x19'),_0x481fc2,_0x5951be[_0x70f9('0x17')][_0x70f9('0x18')]);return _0x5de133(_0x5951be[_0x70f9('0x17')][_0x70f9('0x18')]);}else{logger[_0x70f9('0x12')](_0x70f9('0x19'),_0x481fc2,'request\x20sent');_0x5de133(_0x5951be[_0x70f9('0x1a')][_0x70f9('0x18')]);}})['catch'](function(_0x35ba0b){logger[_0x70f9('0x17')](_0x70f9('0x19'),_0x481fc2,_0x35ba0b);_0x50f052(_0x35ba0b);});});}exports[_0x70f9('0x1b')]=function(_0x4e7cce){var _0x57caca=this;return new Promise(function(_0x14de5c,_0x24a7f1){return db[_0x70f9('0x1c')][_0x70f9('0x1d')]({'raw':_0x4e7cce['options']?_0x4e7cce[_0x70f9('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x1f')]||null:null,'attributes':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')]['attributes']||null:null,'limit':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x20')]||null:null,'include':_0x4e7cce['options']?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x21')],function(_0x49337a){return{'model':db[_0x49337a[_0x70f9('0x23')]],'as':_0x49337a['as'],'attributes':_0x49337a[_0x70f9('0x24')],'include':_0x49337a[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x49337a[_0x70f9('0x21')],function(_0xfe324e){return{'model':db[_0xfe324e['model']],'as':_0xfe324e['as'],'attributes':_0xfe324e[_0x70f9('0x24')],'include':_0xfe324e[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0xfe324e[_0x70f9('0x21')],function(_0x35d452){return{'model':db[_0x35d452[_0x70f9('0x23')]],'as':_0x35d452['as'],'attributes':_0x35d452[_0x70f9('0x24')]};}):[]};}):[]};}):[]:[]})[_0x70f9('0x11')](function(_0x562b72){logger['info'](_0x70f9('0x1b'),_0x4e7cce);logger[_0x70f9('0x14')](_0x70f9('0x1b'),_0x4e7cce,JSON['stringify'](_0x562b72));_0x14de5c(_0x562b72);})['catch'](function(_0x40496a){logger[_0x70f9('0x17')]('GetChatQueue',_0x40496a['message'],_0x4e7cce);_0x24a7f1(_0x57caca[_0x70f9('0x17')](0x1f4,_0x40496a[_0x70f9('0x18')]));});});};exports['ShowChatQueue']=function(_0x2a8cc9){var _0x227845=this;return new Promise(function(_0x47a7d7,_0x8bc855){return db[_0x70f9('0x1c')][_0x70f9('0x25')]({'raw':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x26')]===undefined?!![]:![]:!![],'where':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x1f')]||null:null,'attributes':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x24')]||null:null,'include':_0x2a8cc9[_0x70f9('0x1e')]?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x2a8cc9[_0x70f9('0x1e')]['include'],function(_0x3a7e9e){return{'model':db[_0x3a7e9e[_0x70f9('0x23')]],'as':_0x3a7e9e['as'],'attributes':_0x3a7e9e[_0x70f9('0x24')],'include':_0x3a7e9e[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x3a7e9e[_0x70f9('0x21')],function(_0x5adf6e){return{'model':db[_0x5adf6e[_0x70f9('0x23')]],'as':_0x5adf6e['as'],'attributes':_0x5adf6e[_0x70f9('0x24')],'include':_0x5adf6e['include']?_[_0x70f9('0x22')](_0x5adf6e['include'],function(_0x375d84){return{'model':db[_0x375d84['model']],'as':_0x375d84['as'],'attributes':_0x375d84[_0x70f9('0x24')]};}):[]};}):[]};}):[]:[]})[_0x70f9('0x11')](function(_0x38e305){logger[_0x70f9('0x12')](_0x70f9('0x27'),_0x2a8cc9);logger[_0x70f9('0x14')](_0x70f9('0x27'),_0x2a8cc9,JSON[_0x70f9('0x16')](_0x38e305));_0x47a7d7(_0x38e305);})[_0x70f9('0x28')](function(_0x16c40c){logger['error'](_0x70f9('0x27'),_0x16c40c[_0x70f9('0x18')],_0x2a8cc9);_0x8bc855(_0x227845[_0x70f9('0x17')](0x1f4,_0x16c40c[_0x70f9('0x18')]));});});}; \ No newline at end of file +var _0xd01d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetChatQueue','findAll','options','raw','where','attributes','include','map','model','debug','ShowChatQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0xd01d,0xbe));var _0xdd01=function(_0x1200ff,_0x2060f1){_0x1200ff=_0x1200ff-0x0;var _0x262e3d=_0xd01d[_0x1200ff];return _0x262e3d;};'use strict';var _=require('lodash');var util=require(_0xdd01('0x0'));var moment=require('moment');var BPromise=require(_0xdd01('0x1'));var rs=require(_0xdd01('0x2'));var fs=require('fs');var Redis=require(_0xdd01('0x3'));var db=require(_0xdd01('0x4'))['db'];var utils=require(_0xdd01('0x5'));var logger=require(_0xdd01('0x6'))(_0xdd01('0x7'));var config=require(_0xdd01('0x8'));var jayson=require(_0xdd01('0x9'));var client=jayson[_0xdd01('0xa')]['http']({'port':0x232a});config['redis']=_[_0xdd01('0xb')](config[_0xdd01('0xc')],{'host':_0xdd01('0xd'),'port':0x18eb});var socket=require(_0xdd01('0xe'))(new Redis(config[_0xdd01('0xc')]));require('./chatQueue.socket')[_0xdd01('0xf')](socket);function respondWithRpcPromise(_0x17b14a,_0x51b31d,_0x5c256f){return new BPromise(function(_0x1fc7e8,_0x35c9c2){return client[_0xdd01('0x10')](_0x17b14a,_0x5c256f)[_0xdd01('0x11')](function(_0x1fca3c){logger['info'](_0xdd01('0x12'),_0x51b31d,'request\x20sent');logger['debug'](_0xdd01('0x13'),_0x51b31d,_0xdd01('0x14'),JSON[_0xdd01('0x15')](_0x1fca3c));if(_0x1fca3c[_0xdd01('0x16')]){if(_0x1fca3c[_0xdd01('0x16')]['code']===0x1f4){logger[_0xdd01('0x16')]('ChatQueue,\x20%s,\x20%s',_0x51b31d,_0x1fca3c[_0xdd01('0x16')][_0xdd01('0x17')]);return _0x35c9c2(_0x1fca3c['error'][_0xdd01('0x17')]);}logger['error'](_0xdd01('0x12'),_0x51b31d,_0x1fca3c[_0xdd01('0x16')][_0xdd01('0x17')]);return _0x1fc7e8(_0x1fca3c['error'][_0xdd01('0x17')]);}else{logger[_0xdd01('0x18')](_0xdd01('0x12'),_0x51b31d,'request\x20sent');_0x1fc7e8(_0x1fca3c[_0xdd01('0x19')][_0xdd01('0x17')]);}})[_0xdd01('0x1a')](function(_0x23375a){logger[_0xdd01('0x16')](_0xdd01('0x12'),_0x51b31d,_0x23375a);_0x35c9c2(_0x23375a);});});}exports[_0xdd01('0x1b')]=function(_0x351331){var _0x90d731=this;return new Promise(function(_0x4bf924,_0x297198){return db['ChatQueue'][_0xdd01('0x1c')]({'raw':_0x351331[_0xdd01('0x1d')]?_0x351331[_0xdd01('0x1d')][_0xdd01('0x1e')]===undefined?!![]:![]:!![],'where':_0x351331[_0xdd01('0x1d')]?_0x351331[_0xdd01('0x1d')][_0xdd01('0x1f')]||null:null,'attributes':_0x351331[_0xdd01('0x1d')]?_0x351331['options'][_0xdd01('0x20')]||null:null,'limit':_0x351331[_0xdd01('0x1d')]?_0x351331[_0xdd01('0x1d')]['limit']||null:null,'include':_0x351331[_0xdd01('0x1d')]?_0x351331[_0xdd01('0x1d')][_0xdd01('0x21')]?_[_0xdd01('0x22')](_0x351331[_0xdd01('0x1d')][_0xdd01('0x21')],function(_0xda81fa){return{'model':db[_0xda81fa['model']],'as':_0xda81fa['as'],'attributes':_0xda81fa[_0xdd01('0x20')],'include':_0xda81fa['include']?_[_0xdd01('0x22')](_0xda81fa[_0xdd01('0x21')],function(_0x470514){return{'model':db[_0x470514[_0xdd01('0x23')]],'as':_0x470514['as'],'attributes':_0x470514[_0xdd01('0x20')],'include':_0x470514['include']?_[_0xdd01('0x22')](_0x470514['include'],function(_0x26efba){return{'model':db[_0x26efba[_0xdd01('0x23')]],'as':_0x26efba['as'],'attributes':_0x26efba[_0xdd01('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdd01('0x11')](function(_0x13d1c2){logger[_0xdd01('0x18')](_0xdd01('0x1b'),_0x351331);logger[_0xdd01('0x24')](_0xdd01('0x1b'),_0x351331,JSON[_0xdd01('0x15')](_0x13d1c2));_0x4bf924(_0x13d1c2);})[_0xdd01('0x1a')](function(_0x4b53fe){logger[_0xdd01('0x16')]('GetChatQueue',_0x4b53fe[_0xdd01('0x17')],_0x351331);_0x297198(_0x90d731[_0xdd01('0x16')](0x1f4,_0x4b53fe[_0xdd01('0x17')]));});});};exports[_0xdd01('0x25')]=function(_0x25d56d){var _0x1288bd=this;return new Promise(function(_0x160918,_0x3e5452){return db['ChatQueue'][_0xdd01('0x26')]({'raw':_0x25d56d[_0xdd01('0x1d')]?_0x25d56d[_0xdd01('0x1d')][_0xdd01('0x1e')]===undefined?!![]:![]:!![],'where':_0x25d56d['options']?_0x25d56d[_0xdd01('0x1d')][_0xdd01('0x1f')]||null:null,'attributes':_0x25d56d[_0xdd01('0x1d')]?_0x25d56d[_0xdd01('0x1d')][_0xdd01('0x20')]||null:null,'include':_0x25d56d[_0xdd01('0x1d')]?_0x25d56d[_0xdd01('0x1d')]['include']?_[_0xdd01('0x22')](_0x25d56d[_0xdd01('0x1d')]['include'],function(_0xd81c4b){return{'model':db[_0xd81c4b[_0xdd01('0x23')]],'as':_0xd81c4b['as'],'attributes':_0xd81c4b[_0xdd01('0x20')],'include':_0xd81c4b[_0xdd01('0x21')]?_[_0xdd01('0x22')](_0xd81c4b[_0xdd01('0x21')],function(_0x2cf113){return{'model':db[_0x2cf113['model']],'as':_0x2cf113['as'],'attributes':_0x2cf113[_0xdd01('0x20')],'include':_0x2cf113[_0xdd01('0x21')]?_[_0xdd01('0x22')](_0x2cf113[_0xdd01('0x21')],function(_0x2e3373){return{'model':db[_0x2e3373[_0xdd01('0x23')]],'as':_0x2e3373['as'],'attributes':_0x2e3373['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x358b27){logger[_0xdd01('0x18')](_0xdd01('0x25'),_0x25d56d);logger['debug'](_0xdd01('0x25'),_0x25d56d,JSON['stringify'](_0x358b27));_0x160918(_0x358b27);})['catch'](function(_0x3b11e4){logger[_0xdd01('0x16')](_0xdd01('0x25'),_0x3b11e4[_0xdd01('0x17')],_0x25d56d);_0x3e5452(_0x1288bd[_0xdd01('0x16')](0x1f4,_0x3b11e4[_0xdd01('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 3cfc553..1a4cdbe 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x5480e5,_0x52e354){var _0x20b7cc=function(_0x21627d){while(--_0x21627d){_0x5480e5['push'](_0x5480e5['shift']());}};_0x20b7cc(++_0x52e354);}(_0xb10b,0x12a));var _0xbb10=function(_0x312962,_0x282d40){_0x312962=_0x312962-0x0;var _0x3e85d0=_0xb10b[_0x312962];return _0x3e85d0;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0xbaf0=['removeListener','register','length','chatQueue:','save','remove','update'];(function(_0x44374a,_0x3e8b5d){var _0x4f07e5=function(_0x4552eb){while(--_0x4552eb){_0x44374a['push'](_0x44374a['shift']());}};_0x4f07e5(++_0x3e8b5d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){ChatQueueEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);ChatQueueEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index baabc6b..6b04ec5 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb33=['/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','/:id','/:id/members','getTeams'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdb33,0x1ce));var _0x3db3=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0xdb33[_0x51beba];return _0x167ee0;};'use strict';var multer=require(_0x3db3('0x0'));var util=require(_0x3db3('0x1'));var path=require(_0x3db3('0x2'));var timeout=require(_0x3db3('0x3'));var express=require(_0x3db3('0x4'));var router=express[_0x3db3('0x5')]();var auth=require(_0x3db3('0x6'));var interaction=require(_0x3db3('0x7'));var config=require('../../config/environment');var controller=require(_0x3db3('0x8'));router[_0x3db3('0x9')]('/',auth[_0x3db3('0xa')](),controller['index']);router['get']('/describe',auth[_0x3db3('0xa')](),controller['describe']);router[_0x3db3('0x9')](_0x3db3('0xb'),auth[_0x3db3('0xa')](),controller['show']);router[_0x3db3('0x9')](_0x3db3('0xc'),auth[_0x3db3('0xa')](),controller['getMembers']);router[_0x3db3('0x9')]('/:id/teams',auth[_0x3db3('0xa')](),controller[_0x3db3('0xd')]);router[_0x3db3('0x9')](_0x3db3('0xe'),auth[_0x3db3('0xa')](),controller[_0x3db3('0xf')]);router[_0x3db3('0x10')]('/',auth[_0x3db3('0xa')](),controller[_0x3db3('0x11')]);router[_0x3db3('0x10')](_0x3db3('0x12'),auth[_0x3db3('0xa')](),controller[_0x3db3('0x13')]);router[_0x3db3('0x10')](_0x3db3('0xe'),auth[_0x3db3('0xa')](),controller[_0x3db3('0x14')]);router[_0x3db3('0x15')](_0x3db3('0xb'),auth['isAuthenticated'](),controller[_0x3db3('0x16')]);router[_0x3db3('0x17')](_0x3db3('0xb'),auth[_0x3db3('0xa')](),controller[_0x3db3('0x18')]);router[_0x3db3('0x17')](_0x3db3('0x12'),auth[_0x3db3('0xa')](),controller[_0x3db3('0x19')]);router[_0x3db3('0x17')](_0x3db3('0xe'),auth['isAuthenticated'](),controller[_0x3db3('0x1a')]);module[_0x3db3('0x1b')]=router; \ No newline at end of file +var _0x2d0c=['update','delete','destroy','/:id/teams','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getTeams','/:id/users','post','addTeams','addAgents','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2d0c,0x19e));var _0xc2d0=function(_0x3227c2,_0x22390f){_0x3227c2=_0x3227c2-0x0;var _0x1dc977=_0x2d0c[_0x3227c2];return _0x1dc977;};'use strict';var multer=require(_0xc2d0('0x0'));var util=require(_0xc2d0('0x1'));var path=require(_0xc2d0('0x2'));var timeout=require(_0xc2d0('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc2d0('0x4'));var interaction=require(_0xc2d0('0x5'));var config=require(_0xc2d0('0x6'));var controller=require('./chatQueue.controller');router[_0xc2d0('0x7')]('/',auth['isAuthenticated'](),controller[_0xc2d0('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc2d0('0x7')](_0xc2d0('0x9'),auth[_0xc2d0('0xa')](),controller[_0xc2d0('0xb')]);router['get']('/:id/members',auth[_0xc2d0('0xa')](),controller['getMembers']);router[_0xc2d0('0x7')]('/:id/teams',auth[_0xc2d0('0xa')](),controller[_0xc2d0('0xc')]);router[_0xc2d0('0x7')](_0xc2d0('0xd'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xc2d0('0xa')](),controller['create']);router[_0xc2d0('0xe')]('/:id/teams',auth[_0xc2d0('0xa')](),controller[_0xc2d0('0xf')]);router[_0xc2d0('0xe')](_0xc2d0('0xd'),auth[_0xc2d0('0xa')](),controller[_0xc2d0('0x10')]);router[_0xc2d0('0x11')](_0xc2d0('0x9'),auth[_0xc2d0('0xa')](),controller[_0xc2d0('0x12')]);router[_0xc2d0('0x13')](_0xc2d0('0x9'),auth['isAuthenticated'](),controller[_0xc2d0('0x14')]);router[_0xc2d0('0x13')](_0xc2d0('0x15'),auth[_0xc2d0('0xa')](),controller['removeTeams']);router[_0xc2d0('0x13')](_0xc2d0('0xd'),auth[_0xc2d0('0xa')](),controller[_0xc2d0('0x16')]);module[_0xc2d0('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 34f7e6c..0f64fb4 100644 --- a/server/api/chatQueueReport/chatQueueReport.attributes.js +++ b/server/api/chatQueueReport/chatQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cc7=['DATE','moment','sequelize','exports','STRING'];(function(_0x46191e,_0x3b9b5a){var _0x11ba8f=function(_0x34277f){while(--_0x34277f){_0x46191e['push'](_0x46191e['shift']());}};_0x11ba8f(++_0x3b9b5a);}(_0x9cc7,0x15f));var _0x79cc=function(_0x441eab,_0x583ba5){_0x441eab=_0x441eab-0x0;var _0xe6ff41=_0x9cc7[_0x441eab];return _0xe6ff41;};'use strict';var moment=require(_0x79cc('0x0'));var Sequelize=require(_0x79cc('0x1'));module[_0x79cc('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x79cc('0x3')]},'joinAt':{'type':Sequelize[_0x79cc('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x79cc('0x4')]},'exitAt':{'type':Sequelize[_0x79cc('0x4')]},'reason':{'type':Sequelize[_0x79cc('0x3')]}}; \ No newline at end of file +var _0xa40c=['STRING','moment','exports'];(function(_0x5e6555,_0x354c46){var _0x17cabc=function(_0x2e47fd){while(--_0x2e47fd){_0x5e6555['push'](_0x5e6555['shift']());}};_0x17cabc(++_0x354c46);}(_0xa40c,0x9d));var _0xca40=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xa40c[_0x20a558];return _0x53d3f7;};'use strict';var moment=require(_0xca40('0x0'));var Sequelize=require('sequelize');module[_0xca40('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xca40('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xca40('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index f773f43..a61c2f6 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x755b=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','findAll','rows','catch','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x54a09d,_0x5b14fb){var _0x1bd962=function(_0x48f426){while(--_0x48f426){_0x54a09d['push'](_0x54a09d['shift']());}};_0x1bd962(++_0x5b14fb);}(_0x755b,0x11c));var _0xb755=function(_0x2e5733,_0x4a0d7a){_0x2e5733=_0x2e5733-0x0;var _0xafec34=_0x755b[_0x2e5733];return _0xafec34;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb755('0x0'));var zipdir=require(_0xb755('0x1'));var jsonpatch=require(_0xb755('0x2'));var rp=require(_0xb755('0x3'));var moment=require(_0xb755('0x4'));var BPromise=require(_0xb755('0x5'));var Mustache=require(_0xb755('0x6'));var util=require(_0xb755('0x7'));var path=require(_0xb755('0x8'));var sox=require(_0xb755('0x9'));var csv=require(_0xb755('0xa'));var ejs=require(_0xb755('0xb'));var fs=require('fs');var _=require(_0xb755('0xc'));var squel=require('squel');var crypto=require(_0xb755('0xd'));var jsforce=require(_0xb755('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb755('0xa'));var querystring=require(_0xb755('0xf'));var Papa=require(_0xb755('0x10'));var Redis=require(_0xb755('0x11'));var authService=require(_0xb755('0x12'));var qs=require(_0xb755('0x13'));var as=require(_0xb755('0x14'));var hardwareService=require(_0xb755('0x15'));var logger=require(_0xb755('0x16'))(_0xb755('0x17'));var utils=require(_0xb755('0x18'));var config=require('../../config/environment');var db=require(_0xb755('0x19'))['db'];function respondWithStatusCode(_0x41bca8,_0x2a334d){_0x2a334d=_0x2a334d||0xcc;return function(_0x4757e9){if(_0x4757e9){return _0x41bca8[_0xb755('0x1a')](_0x2a334d);}return _0x41bca8[_0xb755('0x1b')](_0x2a334d)[_0xb755('0x1c')]();};}function respondWithResult(_0x51cd1b,_0x21b4e3){_0x21b4e3=_0x21b4e3||0xc8;return function(_0x4f96ea){if(_0x4f96ea){return _0x51cd1b[_0xb755('0x1b')](_0x21b4e3)['json'](_0x4f96ea);}};}function respondWithFilteredResult(_0x4b597c,_0x1a02a3){return function(_0x571e12){if(_0x571e12){var _0x50c784=_0x571e12[_0xb755('0x1d')],_0x2fe8e3=_0x1a02a3[_0xb755('0x1e')],_0x5b3e03=_0x1a02a3[_0xb755('0x1e')]+_0x1a02a3[_0xb755('0x1f')],_0x2dfd0e;if(_0x5b3e03>=_0x50c784){_0x5b3e03=_0x50c784;_0x2dfd0e=0xc8;}else{_0x2dfd0e=0xce;}_0x4b597c[_0xb755('0x1b')](_0x2dfd0e);return _0x4b597c[_0xb755('0x20')](_0xb755('0x21'),_0x2fe8e3+'-'+_0x5b3e03+'/'+_0x50c784)[_0xb755('0x22')](_0x571e12);}return null;};}function patchUpdates(_0x3d66c8){return function(_0xfa7c2b){try{jsonpatch['apply'](_0xfa7c2b,_0x3d66c8,!![]);}catch(_0x294108){return BPromise[_0xb755('0x23')](_0x294108);}return _0xfa7c2b[_0xb755('0x24')]();};}function saveUpdates(_0xac95ba,_0x3ab454){return function(_0x104ee2){if(_0x104ee2){return _0x104ee2[_0xb755('0x25')](_0xac95ba)[_0xb755('0x26')](function(_0x56e5d0){return _0x56e5d0;});}return null;};}function removeEntity(_0x2d0278,_0x8108d2){return function(_0x561609){if(_0x561609){return _0x561609[_0xb755('0x27')]()[_0xb755('0x26')](function(){_0x2d0278[_0xb755('0x1b')](0xcc)[_0xb755('0x1c')]();});}};}function handleEntityNotFound(_0x1f6e03,_0x148eba){return function(_0x149d91){if(!_0x149d91){_0x1f6e03[_0xb755('0x1a')](0x194);}return _0x149d91;};}function handleError(_0x3eddcb,_0x18886e){_0x18886e=_0x18886e||0x1f4;return function(_0x336fd1){logger['error'](_0x336fd1[_0xb755('0x28')]);if(_0x336fd1[_0xb755('0x29')]){delete _0x336fd1[_0xb755('0x29')];}_0x3eddcb[_0xb755('0x1b')](_0x18886e)[_0xb755('0x2a')](_0x336fd1);};}exports[_0xb755('0x2b')]=function(_0x1d97ab,_0x45aa7b){var _0x43847d={},_0x43f3a9={},_0x48ba97={'count':0x0,'rows':[]};var _0x3809ee=_[_0xb755('0x2c')](db[_0xb755('0x2d')][_0xb755('0x2e')],function(_0x4ba772){return{'name':_0x4ba772[_0xb755('0x2f')],'type':_0x4ba772['type']['key']};});_0x43f3a9['model']=_['map'](_0x3809ee,'name');_0x43f3a9['query']=_[_0xb755('0x30')](_0x1d97ab[_0xb755('0x31')]);_0x43f3a9[_0xb755('0x32')]=_['intersection'](_0x43f3a9[_0xb755('0x33')],_0x43f3a9[_0xb755('0x31')]);_0x43847d['attributes']=_[_0xb755('0x34')](_0x43f3a9['model'],qs[_0xb755('0x35')](_0x1d97ab[_0xb755('0x31')][_0xb755('0x35')]));_0x43847d[_0xb755('0x36')]=_0x43847d[_0xb755('0x36')][_0xb755('0x37')]?_0x43847d[_0xb755('0x36')]:_0x43f3a9['model'];if(!_0x1d97ab[_0xb755('0x31')][_0xb755('0x38')](_0xb755('0x39'))){_0x43847d[_0xb755('0x1f')]=qs[_0xb755('0x1f')](_0x1d97ab[_0xb755('0x31')][_0xb755('0x1f')]);_0x43847d[_0xb755('0x1e')]=qs['offset'](_0x1d97ab[_0xb755('0x31')][_0xb755('0x1e')]);}_0x43847d['order']=qs['sort'](_0x1d97ab[_0xb755('0x31')][_0xb755('0x3a')]);_0x43847d['where']=qs[_0xb755('0x32')](_[_0xb755('0x3b')](_0x1d97ab[_0xb755('0x31')],_0x43f3a9[_0xb755('0x32')]));if(_0x1d97ab[_0xb755('0x31')]['filter']){_0x43847d[_0xb755('0x3c')]=_[_0xb755('0x3d')](_0x43847d[_0xb755('0x3c')],{'$or':_[_0xb755('0x2c')](_0x3809ee,function(_0x355731){if(_0x355731[_0xb755('0x3e')]!==_0xb755('0x3f')){var _0xb9088d={};_0xb9088d[_0x355731[_0xb755('0x29')]]={'$like':'%'+_0x1d97ab[_0xb755('0x31')][_0xb755('0x40')]+'%'};return _0xb9088d;}})});}_0x43847d=_['merge']({},_0x43847d,_0x1d97ab[_0xb755('0x41')]);var _0xca469a={'where':_0x43847d[_0xb755('0x3c')]};return db['ChatQueueReport'][_0xb755('0x1d')](_0xca469a)[_0xb755('0x26')](function(_0x2c0fa2){_0x48ba97[_0xb755('0x1d')]=_0x2c0fa2;if(_0x1d97ab['query']['includeAll']){_0x43847d['include']=[{'all':!![]}];}return db[_0xb755('0x2d')][_0xb755('0x42')](_0x43847d);})[_0xb755('0x26')](function(_0x435cbd){_0x48ba97[_0xb755('0x43')]=_0x435cbd;return _0x48ba97;})['then'](respondWithFilteredResult(_0x45aa7b,_0x43847d))[_0xb755('0x44')](handleError(_0x45aa7b,null));};exports['show']=function(_0x50dfdc,_0x1e2dde){var _0x2b16b7={'raw':!![],'where':{'id':_0x50dfdc['params']['id']}},_0x32cc9a={};_0x32cc9a[_0xb755('0x33')]=_[_0xb755('0x30')](db['ChatQueueReport'][_0xb755('0x2e')]);_0x32cc9a[_0xb755('0x31')]=_['keys'](_0x50dfdc[_0xb755('0x31')]);_0x32cc9a[_0xb755('0x32')]=_['intersection'](_0x32cc9a[_0xb755('0x33')],_0x32cc9a[_0xb755('0x31')]);_0x2b16b7['attributes']=_[_0xb755('0x34')](_0x32cc9a[_0xb755('0x33')],qs[_0xb755('0x35')](_0x50dfdc[_0xb755('0x31')][_0xb755('0x35')]));_0x2b16b7['attributes']=_0x2b16b7[_0xb755('0x36')][_0xb755('0x37')]?_0x2b16b7[_0xb755('0x36')]:_0x32cc9a[_0xb755('0x33')];if(_0x50dfdc[_0xb755('0x31')]['includeAll']){_0x2b16b7[_0xb755('0x45')]=[{'all':!![]}];}_0x2b16b7=_[_0xb755('0x3d')]({},_0x2b16b7,_0x50dfdc[_0xb755('0x41')]);return db[_0xb755('0x2d')][_0xb755('0x46')](_0x2b16b7)[_0xb755('0x26')](handleEntityNotFound(_0x1e2dde,null))[_0xb755('0x26')](respondWithResult(_0x1e2dde,null))['catch'](handleError(_0x1e2dde,null));};exports[_0xb755('0x47')]=function(_0x1482b9,_0x1d341d){return db[_0xb755('0x2d')]['create'](_0x1482b9[_0xb755('0x48')],{})['then'](respondWithResult(_0x1d341d,0xc9))[_0xb755('0x44')](handleError(_0x1d341d,null));};exports[_0xb755('0x25')]=function(_0x2ab810,_0x3d259c){if(_0x2ab810[_0xb755('0x48')]['id']){delete _0x2ab810['body']['id'];}return db[_0xb755('0x2d')][_0xb755('0x46')]({'where':{'id':_0x2ab810[_0xb755('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d259c,null))['then'](saveUpdates(_0x2ab810[_0xb755('0x48')],null))[_0xb755('0x26')](respondWithResult(_0x3d259c,null))[_0xb755('0x44')](handleError(_0x3d259c,null));};exports[_0xb755('0x27')]=function(_0x2928c3,_0x233d11){return db[_0xb755('0x2d')][_0xb755('0x46')]({'where':{'id':_0x2928c3[_0xb755('0x49')]['id']}})['then'](handleEntityNotFound(_0x233d11,null))[_0xb755('0x26')](removeEntity(_0x233d11,null))['catch'](handleError(_0x233d11,null));};exports['describe']=function(_0x4a058d,_0x1e00bd){return db[_0xb755('0x2d')][_0xb755('0x4a')]()['then'](respondWithResult(_0x1e00bd,null))['catch'](handleError(_0x1e00bd,null));}; \ No newline at end of file +var _0xffd1=['key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','map','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffd1,0x18a));var _0x1ffd=function(_0x2660b8,_0x5e1d6d){_0x2660b8=_0x2660b8-0x0;var _0x5c5d8b=_0xffd1[_0x2660b8];return _0x5c5d8b;};'use strict';var pdf=require(_0x1ffd('0x0'));var emlformat=require(_0x1ffd('0x1'));var rimraf=require(_0x1ffd('0x2'));var zipdir=require(_0x1ffd('0x3'));var jsonpatch=require(_0x1ffd('0x4'));var rp=require(_0x1ffd('0x5'));var moment=require(_0x1ffd('0x6'));var BPromise=require(_0x1ffd('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1ffd('0x8'));var squel=require(_0x1ffd('0x9'));var crypto=require(_0x1ffd('0xa'));var jsforce=require(_0x1ffd('0xb'));var deskjs=require(_0x1ffd('0xc'));var toCsv=require(_0x1ffd('0xd'));var querystring=require(_0x1ffd('0xe'));var Papa=require(_0x1ffd('0xf'));var Redis=require(_0x1ffd('0x10'));var authService=require(_0x1ffd('0x11'));var qs=require(_0x1ffd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ffd('0x13'))(_0x1ffd('0x14'));var utils=require(_0x1ffd('0x15'));var config=require('../../config/environment');var db=require(_0x1ffd('0x16'))['db'];function respondWithStatusCode(_0x192b3b,_0x830d6){_0x830d6=_0x830d6||0xcc;return function(_0x1c2cd0){if(_0x1c2cd0){return _0x192b3b[_0x1ffd('0x17')](_0x830d6);}return _0x192b3b[_0x1ffd('0x18')](_0x830d6)[_0x1ffd('0x19')]();};}function respondWithResult(_0x29b9d7,_0x503fe7){_0x503fe7=_0x503fe7||0xc8;return function(_0x4eafb7){if(_0x4eafb7){return _0x29b9d7[_0x1ffd('0x18')](_0x503fe7)[_0x1ffd('0x1a')](_0x4eafb7);}};}function respondWithFilteredResult(_0x5e53bd,_0x112115){return function(_0x593f0d){if(_0x593f0d){var _0x30a725=_0x593f0d[_0x1ffd('0x1b')],_0x406da9=_0x112115['offset'],_0x41fe48=_0x112115[_0x1ffd('0x1c')]+_0x112115['limit'],_0x2026b0;if(_0x41fe48>=_0x30a725){_0x41fe48=_0x30a725;_0x2026b0=0xc8;}else{_0x2026b0=0xce;}_0x5e53bd[_0x1ffd('0x18')](_0x2026b0);return _0x5e53bd[_0x1ffd('0x1d')](_0x1ffd('0x1e'),_0x406da9+'-'+_0x41fe48+'/'+_0x30a725)[_0x1ffd('0x1a')](_0x593f0d);}return null;};}function patchUpdates(_0x3404fd){return function(_0x4f25eb){try{jsonpatch[_0x1ffd('0x1f')](_0x4f25eb,_0x3404fd,!![]);}catch(_0x4623d0){return BPromise[_0x1ffd('0x20')](_0x4623d0);}return _0x4f25eb[_0x1ffd('0x21')]();};}function saveUpdates(_0x4869aa,_0x35c59d){return function(_0x95fc0){if(_0x95fc0){return _0x95fc0[_0x1ffd('0x22')](_0x4869aa)[_0x1ffd('0x23')](function(_0x54a805){return _0x54a805;});}return null;};}function removeEntity(_0xe7a826,_0x41405e){return function(_0x5ea8e9){if(_0x5ea8e9){return _0x5ea8e9[_0x1ffd('0x24')]()[_0x1ffd('0x23')](function(){_0xe7a826[_0x1ffd('0x18')](0xcc)[_0x1ffd('0x19')]();});}};}function handleEntityNotFound(_0x3f1483,_0x20c8c7){return function(_0x3c996e){if(!_0x3c996e){_0x3f1483['sendStatus'](0x194);}return _0x3c996e;};}function handleError(_0x341bf0,_0x225f31){_0x225f31=_0x225f31||0x1f4;return function(_0x4cd7c3){logger['error'](_0x4cd7c3[_0x1ffd('0x25')]);if(_0x4cd7c3['name']){delete _0x4cd7c3['name'];}_0x341bf0['status'](_0x225f31)[_0x1ffd('0x26')](_0x4cd7c3);};}exports['index']=function(_0x2048f9,_0x33d41e){var _0xecc2f6={},_0x371494={},_0x1396cc={'count':0x0,'rows':[]};var _0x364385=_[_0x1ffd('0x27')](db[_0x1ffd('0x28')][_0x1ffd('0x29')],function(_0x101c59){return{'name':_0x101c59[_0x1ffd('0x2a')],'type':_0x101c59[_0x1ffd('0x2b')][_0x1ffd('0x2c')]};});_0x371494[_0x1ffd('0x2d')]=_['map'](_0x364385,_0x1ffd('0x2e'));_0x371494[_0x1ffd('0x2f')]=_[_0x1ffd('0x30')](_0x2048f9[_0x1ffd('0x2f')]);_0x371494['filters']=_[_0x1ffd('0x31')](_0x371494[_0x1ffd('0x2d')],_0x371494[_0x1ffd('0x2f')]);_0xecc2f6[_0x1ffd('0x32')]=_[_0x1ffd('0x31')](_0x371494['model'],qs[_0x1ffd('0x33')](_0x2048f9[_0x1ffd('0x2f')][_0x1ffd('0x33')]));_0xecc2f6[_0x1ffd('0x32')]=_0xecc2f6[_0x1ffd('0x32')]['length']?_0xecc2f6[_0x1ffd('0x32')]:_0x371494[_0x1ffd('0x2d')];if(!_0x2048f9['query'][_0x1ffd('0x34')](_0x1ffd('0x35'))){_0xecc2f6[_0x1ffd('0x36')]=qs[_0x1ffd('0x36')](_0x2048f9['query'][_0x1ffd('0x36')]);_0xecc2f6[_0x1ffd('0x1c')]=qs[_0x1ffd('0x1c')](_0x2048f9[_0x1ffd('0x2f')][_0x1ffd('0x1c')]);}_0xecc2f6[_0x1ffd('0x37')]=qs[_0x1ffd('0x38')](_0x2048f9[_0x1ffd('0x2f')][_0x1ffd('0x38')]);_0xecc2f6[_0x1ffd('0x39')]=qs[_0x1ffd('0x3a')](_[_0x1ffd('0x3b')](_0x2048f9[_0x1ffd('0x2f')],_0x371494[_0x1ffd('0x3a')]));if(_0x2048f9[_0x1ffd('0x2f')][_0x1ffd('0x3c')]){_0xecc2f6[_0x1ffd('0x39')]=_[_0x1ffd('0x3d')](_0xecc2f6['where'],{'$or':_[_0x1ffd('0x27')](_0x364385,function(_0x361b73){if(_0x361b73['type']!==_0x1ffd('0x3e')){var _0x35649f={};_0x35649f[_0x361b73[_0x1ffd('0x2e')]]={'$like':'%'+_0x2048f9[_0x1ffd('0x2f')][_0x1ffd('0x3c')]+'%'};return _0x35649f;}})});}_0xecc2f6=_[_0x1ffd('0x3d')]({},_0xecc2f6,_0x2048f9[_0x1ffd('0x3f')]);var _0x39879f={'where':_0xecc2f6[_0x1ffd('0x39')]};return db[_0x1ffd('0x28')]['count'](_0x39879f)[_0x1ffd('0x23')](function(_0x5cf16c){_0x1396cc[_0x1ffd('0x1b')]=_0x5cf16c;if(_0x2048f9['query'][_0x1ffd('0x40')]){_0xecc2f6['include']=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0xecc2f6);})['then'](function(_0x49bb80){_0x1396cc[_0x1ffd('0x41')]=_0x49bb80;return _0x1396cc;})[_0x1ffd('0x23')](respondWithFilteredResult(_0x33d41e,_0xecc2f6))[_0x1ffd('0x42')](handleError(_0x33d41e,null));};exports[_0x1ffd('0x43')]=function(_0x238063,_0x4839da){var _0x4c1e38={'raw':!![],'where':{'id':_0x238063[_0x1ffd('0x44')]['id']}},_0x2f9179={};_0x2f9179[_0x1ffd('0x2d')]=_[_0x1ffd('0x30')](db['ChatQueueReport'][_0x1ffd('0x29')]);_0x2f9179[_0x1ffd('0x2f')]=_[_0x1ffd('0x30')](_0x238063[_0x1ffd('0x2f')]);_0x2f9179[_0x1ffd('0x3a')]=_[_0x1ffd('0x31')](_0x2f9179[_0x1ffd('0x2d')],_0x2f9179[_0x1ffd('0x2f')]);_0x4c1e38['attributes']=_['intersection'](_0x2f9179[_0x1ffd('0x2d')],qs[_0x1ffd('0x33')](_0x238063[_0x1ffd('0x2f')][_0x1ffd('0x33')]));_0x4c1e38['attributes']=_0x4c1e38['attributes']['length']?_0x4c1e38[_0x1ffd('0x32')]:_0x2f9179['model'];if(_0x238063[_0x1ffd('0x2f')][_0x1ffd('0x40')]){_0x4c1e38[_0x1ffd('0x45')]=[{'all':!![]}];}_0x4c1e38=_['merge']({},_0x4c1e38,_0x238063[_0x1ffd('0x3f')]);return db[_0x1ffd('0x28')]['find'](_0x4c1e38)[_0x1ffd('0x23')](handleEntityNotFound(_0x4839da,null))[_0x1ffd('0x23')](respondWithResult(_0x4839da,null))[_0x1ffd('0x42')](handleError(_0x4839da,null));};exports[_0x1ffd('0x46')]=function(_0x32ab7b,_0xbb1a74){return db[_0x1ffd('0x28')]['create'](_0x32ab7b['body'],{})[_0x1ffd('0x23')](respondWithResult(_0xbb1a74,0xc9))[_0x1ffd('0x42')](handleError(_0xbb1a74,null));};exports[_0x1ffd('0x22')]=function(_0x18722d,_0x33bc17){if(_0x18722d['body']['id']){delete _0x18722d[_0x1ffd('0x47')]['id'];}return db[_0x1ffd('0x28')]['find']({'where':{'id':_0x18722d[_0x1ffd('0x44')]['id']}})[_0x1ffd('0x23')](handleEntityNotFound(_0x33bc17,null))['then'](saveUpdates(_0x18722d['body'],null))[_0x1ffd('0x23')](respondWithResult(_0x33bc17,null))['catch'](handleError(_0x33bc17,null));};exports['destroy']=function(_0x258d43,_0x1c5e5f){return db['ChatQueueReport'][_0x1ffd('0x48')]({'where':{'id':_0x258d43[_0x1ffd('0x44')]['id']}})[_0x1ffd('0x23')](handleEntityNotFound(_0x1c5e5f,null))['then'](removeEntity(_0x1c5e5f,null))['catch'](handleError(_0x1c5e5f,null));};exports['describe']=function(_0x1e0024,_0x10e3b4){return db[_0x1ffd('0x28')]['describe']()[_0x1ffd('0x23')](respondWithResult(_0x10e3b4,null))['catch'](handleError(_0x10e3b4,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 8ca7ac0..fe1bdc5 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3c4=['../../config/environment','./chatQueueReport.attributes','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xb3c4,0x155));var _0x4b3c=function(_0x9ad6d2,_0x183d43){_0x9ad6d2=_0x9ad6d2-0x0;var _0x5087e6=_0xb3c4[_0x9ad6d2];return _0x5087e6;};'use strict';var _=require(_0x4b3c('0x0'));var util=require(_0x4b3c('0x1'));var logger=require(_0x4b3c('0x2'))(_0x4b3c('0x3'));var moment=require(_0x4b3c('0x4'));var BPromise=require(_0x4b3c('0x5'));var rp=require(_0x4b3c('0x6'));var fs=require('fs');var path=require(_0x4b3c('0x7'));var rimraf=require(_0x4b3c('0x8'));var config=require(_0x4b3c('0x9'));var attributes=require(_0x4b3c('0xa'));module['exports']=function(_0x380d6c,_0x3a9be0){return _0x380d6c['define'](_0x4b3c('0xb'),attributes,{'tableName':_0x4b3c('0xc'),'paranoid':![],'indexes':[{'name':_0x4b3c('0xd'),'fields':[_0x4b3c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6023=['moment','bluebird','request-promise','path','rimraf','./chatQueueReport.attributes','define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api'];(function(_0x1e73fc,_0x533750){var _0xeceac4=function(_0x2c6dda){while(--_0x2c6dda){_0x1e73fc['push'](_0x1e73fc['shift']());}};_0xeceac4(++_0x533750);}(_0x6023,0x7f));var _0x3602=function(_0x24c6c3,_0x498553){_0x24c6c3=_0x24c6c3-0x0;var _0x28a701=_0x6023[_0x24c6c3];return _0x28a701;};'use strict';var _=require('lodash');var util=require(_0x3602('0x0'));var logger=require(_0x3602('0x1'))(_0x3602('0x2'));var moment=require(_0x3602('0x3'));var BPromise=require(_0x3602('0x4'));var rp=require(_0x3602('0x5'));var fs=require('fs');var path=require(_0x3602('0x6'));var rimraf=require(_0x3602('0x7'));var config=require('../../config/environment');var attributes=require(_0x3602('0x8'));module['exports']=function(_0x370e20,_0x5dad87){return _0x370e20[_0x3602('0x9')](_0x3602('0xa'),attributes,{'tableName':_0x3602('0xb'),'paranoid':![],'indexes':[{'name':_0x3602('0xc'),'fields':[_0x3602('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 7bed8b7..9c06d06 100644 --- a/server/api/chatQueueReport/chatQueueReport.rpc.js +++ b/server/api/chatQueueReport/chatQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea3d=['http','then','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','update','where','attributes','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b49f9,_0x1b6e9e){var _0x45d6cd=function(_0xf9cddd){while(--_0xf9cddd){_0x4b49f9['push'](_0x4b49f9['shift']());}};_0x45d6cd(++_0x1b6e9e);}(_0xea3d,0x1d5));var _0xdea3=function(_0x2af80f,_0x3e80ef){_0x2af80f=_0x2af80f-0x0;var _0x12906b=_0xea3d[_0x2af80f];return _0x12906b;};'use strict';var _=require(_0xdea3('0x0'));var util=require(_0xdea3('0x1'));var moment=require(_0xdea3('0x2'));var BPromise=require(_0xdea3('0x3'));var rs=require(_0xdea3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdea3('0x5'))['db'];var utils=require(_0xdea3('0x6'));var logger=require(_0xdea3('0x7'))(_0xdea3('0x8'));var config=require(_0xdea3('0x9'));var jayson=require(_0xdea3('0xa'));var client=jayson['client'][_0xdea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56fc6a,_0x3a45a3,_0x307782){return new BPromise(function(_0x2b3eca,_0x5c4898){return client['request'](_0x56fc6a,_0x307782)[_0xdea3('0xc')](function(_0x1277c4){logger['info'](_0xdea3('0xd'),_0x3a45a3,'request\x20sent');logger[_0xdea3('0xe')](_0xdea3('0xf'),_0x3a45a3,_0xdea3('0x10'),JSON[_0xdea3('0x11')](_0x1277c4));if(_0x1277c4[_0xdea3('0x12')]){if(_0x1277c4[_0xdea3('0x12')]['code']===0x1f4){logger[_0xdea3('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3a45a3,_0x1277c4[_0xdea3('0x12')][_0xdea3('0x13')]);return _0x5c4898(_0x1277c4['error']['message']);}logger[_0xdea3('0x12')](_0xdea3('0xd'),_0x3a45a3,_0x1277c4[_0xdea3('0x12')][_0xdea3('0x13')]);return _0x2b3eca(_0x1277c4[_0xdea3('0x12')]['message']);}else{logger[_0xdea3('0x14')](_0xdea3('0xd'),_0x3a45a3,_0xdea3('0x10'));_0x2b3eca(_0x1277c4[_0xdea3('0x15')][_0xdea3('0x13')]);}})[_0xdea3('0x16')](function(_0x510777){logger['error'](_0xdea3('0xd'),_0x3a45a3,_0x510777);_0x5c4898(_0x510777);});});}exports[_0xdea3('0x17')]=function(_0x387694){var _0x263495=this;return new Promise(function(_0x9e5680,_0x58367a){return db[_0xdea3('0x18')]['create'](_0x387694[_0xdea3('0x19')],{'raw':_0x387694[_0xdea3('0x1a')]?_0x387694[_0xdea3('0x1a')][_0xdea3('0x1b')]===undefined?!![]:![]:!![]})[_0xdea3('0xc')](function(_0x5ed63d){logger[_0xdea3('0x14')](_0xdea3('0x17'),_0x387694);logger['debug']('CreateChatQueueReport',_0x387694,JSON[_0xdea3('0x11')](_0x5ed63d));_0x9e5680(_0x5ed63d);})[_0xdea3('0x16')](function(_0x3ae7a5){logger['error'](_0xdea3('0x17'),_0x3ae7a5[_0xdea3('0x13')],_0x387694);_0x58367a(_0x263495[_0xdea3('0x12')](0x1f4,_0x3ae7a5[_0xdea3('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x5aa71e){var _0x53169f=this;return new Promise(function(_0x4f06ed,_0x391a97){return db[_0xdea3('0x18')][_0xdea3('0x1c')](_0x5aa71e[_0xdea3('0x19')],{'raw':_0x5aa71e[_0xdea3('0x1a')]?_0x5aa71e['options'][_0xdea3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aa71e[_0xdea3('0x1a')]?_0x5aa71e[_0xdea3('0x1a')][_0xdea3('0x1d')]||null:null,'attributes':_0x5aa71e[_0xdea3('0x1a')]?_0x5aa71e['options'][_0xdea3('0x1e')]||null:null,'limit':_0x5aa71e['options']?_0x5aa71e[_0xdea3('0x1a')]['limit']||null:null})[_0xdea3('0xc')](function(_0x5de809){logger[_0xdea3('0x14')](_0xdea3('0x1f'),_0x5aa71e);logger[_0xdea3('0xe')]('UpdateChatQueueReport',_0x5aa71e,JSON[_0xdea3('0x11')](_0x5de809));_0x4f06ed(_0x5de809);})[_0xdea3('0x16')](function(_0xe9b9ff){logger[_0xdea3('0x12')](_0xdea3('0x1f'),_0xe9b9ff[_0xdea3('0x13')],_0x5aa71e);_0x391a97(_0x53169f[_0xdea3('0x12')](0x1f4,_0xe9b9ff[_0xdea3('0x13')]));});});}; \ No newline at end of file +var _0x1b7e=['catch','UpdateChatQueueReport','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw'];(function(_0x1ec27e,_0x2ed729){var _0x534c80=function(_0x400e80){while(--_0x400e80){_0x1ec27e['push'](_0x1ec27e['shift']());}};_0x534c80(++_0x2ed729);}(_0x1b7e,0xa9));var _0xe1b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b7e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe1b7('0x0'));var util=require(_0xe1b7('0x1'));var moment=require('moment');var BPromise=require(_0xe1b7('0x2'));var rs=require(_0xe1b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1b7('0x4'))['db'];var utils=require(_0xe1b7('0x5'));var logger=require(_0xe1b7('0x6'))(_0xe1b7('0x7'));var config=require(_0xe1b7('0x8'));var jayson=require(_0xe1b7('0x9'));var client=jayson[_0xe1b7('0xa')][_0xe1b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e4771,_0x153465,_0x2082e8){return new BPromise(function(_0x4f85d3,_0x8bb8ed){return client[_0xe1b7('0xc')](_0x2e4771,_0x2082e8)[_0xe1b7('0xd')](function(_0x10d5f8){logger[_0xe1b7('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x153465,'request\x20sent');logger[_0xe1b7('0xf')](_0xe1b7('0x10'),_0x153465,_0xe1b7('0x11'),JSON[_0xe1b7('0x12')](_0x10d5f8));if(_0x10d5f8[_0xe1b7('0x13')]){if(_0x10d5f8[_0xe1b7('0x13')][_0xe1b7('0x14')]===0x1f4){logger[_0xe1b7('0x13')](_0xe1b7('0x15'),_0x153465,_0x10d5f8[_0xe1b7('0x13')][_0xe1b7('0x16')]);return _0x8bb8ed(_0x10d5f8['error'][_0xe1b7('0x16')]);}logger[_0xe1b7('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x153465,_0x10d5f8[_0xe1b7('0x13')][_0xe1b7('0x16')]);return _0x4f85d3(_0x10d5f8[_0xe1b7('0x13')][_0xe1b7('0x16')]);}else{logger[_0xe1b7('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x153465,_0xe1b7('0x11'));_0x4f85d3(_0x10d5f8['result'][_0xe1b7('0x16')]);}})['catch'](function(_0x3edbb9){logger[_0xe1b7('0x13')](_0xe1b7('0x15'),_0x153465,_0x3edbb9);_0x8bb8ed(_0x3edbb9);});});}exports[_0xe1b7('0x17')]=function(_0x366dbe){var _0x235483=this;return new Promise(function(_0x383c2d,_0x4f3d53){return db[_0xe1b7('0x18')][_0xe1b7('0x19')](_0x366dbe[_0xe1b7('0x1a')],{'raw':_0x366dbe[_0xe1b7('0x1b')]?_0x366dbe[_0xe1b7('0x1b')][_0xe1b7('0x1c')]===undefined?!![]:![]:!![]})[_0xe1b7('0xd')](function(_0x29ba74){logger[_0xe1b7('0xe')](_0xe1b7('0x17'),_0x366dbe);logger['debug']('CreateChatQueueReport',_0x366dbe,JSON[_0xe1b7('0x12')](_0x29ba74));_0x383c2d(_0x29ba74);})[_0xe1b7('0x1d')](function(_0x494f46){logger[_0xe1b7('0x13')](_0xe1b7('0x17'),_0x494f46[_0xe1b7('0x16')],_0x366dbe);_0x4f3d53(_0x235483[_0xe1b7('0x13')](0x1f4,_0x494f46[_0xe1b7('0x16')]));});});};exports[_0xe1b7('0x1e')]=function(_0x2fef5a){var _0x38c17f=this;return new Promise(function(_0x2a8638,_0x187cc8){return db[_0xe1b7('0x18')]['update'](_0x2fef5a['body'],{'raw':_0x2fef5a[_0xe1b7('0x1b')]?_0x2fef5a[_0xe1b7('0x1b')][_0xe1b7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fef5a[_0xe1b7('0x1b')]?_0x2fef5a[_0xe1b7('0x1b')]['where']||null:null,'attributes':_0x2fef5a[_0xe1b7('0x1b')]?_0x2fef5a[_0xe1b7('0x1b')][_0xe1b7('0x1f')]||null:null,'limit':_0x2fef5a[_0xe1b7('0x1b')]?_0x2fef5a['options'][_0xe1b7('0x20')]||null:null})['then'](function(_0x2f06a3){logger['info']('UpdateChatQueueReport',_0x2fef5a);logger[_0xe1b7('0xf')](_0xe1b7('0x1e'),_0x2fef5a,JSON[_0xe1b7('0x12')](_0x2f06a3));_0x2a8638(_0x2f06a3);})[_0xe1b7('0x1d')](function(_0x6028c8){logger[_0xe1b7('0x13')]('UpdateChatQueueReport',_0x6028c8[_0xe1b7('0x16')],_0x2fef5a);_0x187cc8(_0x38c17f[_0xe1b7('0x13')](0x1f4,_0x6028c8['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index b0c68ec..e4bd175 100644 --- a/server/api/chatQueueReport/index.js +++ b/server/api/chatQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3e7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','express','Router'];(function(_0x63461d,_0x3e77bd){var _0x4dd8d1=function(_0x284885){while(--_0x284885){_0x63461d['push'](_0x63461d['shift']());}};_0x4dd8d1(++_0x3e77bd);}(_0xe3e7,0x72));var _0x7e3e=function(_0x3b4870,_0x1d19b4){_0x3b4870=_0x3b4870-0x0;var _0xabbe41=_0xe3e7[_0x3b4870];return _0xabbe41;};'use strict';var multer=require(_0x7e3e('0x0'));var util=require(_0x7e3e('0x1'));var path=require(_0x7e3e('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e3e('0x3'));var router=express[_0x7e3e('0x4')]();var auth=require(_0x7e3e('0x5'));var interaction=require(_0x7e3e('0x6'));var config=require(_0x7e3e('0x7'));var controller=require(_0x7e3e('0x8'));router[_0x7e3e('0x9')]('/',auth['isAuthenticated'](),controller[_0x7e3e('0xa')]);router[_0x7e3e('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7e3e('0x9')]('/:id',auth[_0x7e3e('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7e3e('0xc')]);router[_0x7e3e('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x7e3e('0xe'),auth['isAuthenticated'](),controller[_0x7e3e('0xf')]);module[_0x7e3e('0x10')]=router; \ No newline at end of file +var _0xb00f=['/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x565ced,_0xbcddc7){var _0x25e2db=function(_0x3f2fde){while(--_0x3f2fde){_0x565ced['push'](_0x565ced['shift']());}};_0x25e2db(++_0xbcddc7);}(_0xb00f,0x171));var _0xfb00=function(_0x4ff8ad,_0x30692e){_0x4ff8ad=_0x4ff8ad-0x0;var _0x2bc55b=_0xb00f[_0x4ff8ad];return _0x2bc55b;};'use strict';var multer=require(_0xfb00('0x0'));var util=require(_0xfb00('0x1'));var path=require(_0xfb00('0x2'));var timeout=require(_0xfb00('0x3'));var express=require(_0xfb00('0x4'));var router=express[_0xfb00('0x5')]();var auth=require(_0xfb00('0x6'));var interaction=require(_0xfb00('0x7'));var config=require(_0xfb00('0x8'));var controller=require('./chatQueueReport.controller');router[_0xfb00('0x9')]('/',auth['isAuthenticated'](),controller[_0xfb00('0xa')]);router[_0xfb00('0x9')](_0xfb00('0xb'),auth[_0xfb00('0xc')](),controller[_0xfb00('0xd')]);router[_0xfb00('0x9')](_0xfb00('0xe'),auth[_0xfb00('0xc')](),controller[_0xfb00('0xf')]);router[_0xfb00('0x10')]('/',auth[_0xfb00('0xc')](),controller[_0xfb00('0x11')]);router[_0xfb00('0x12')](_0xfb00('0xe'),auth[_0xfb00('0xc')](),controller['update']);router[_0xfb00('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 04be282..c83e0c7 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34c6=['NOW','moment','exports','STRING','ENUM','account','agent','queue'];(function(_0x3a946b,_0x2e436f){var _0x156b7e=function(_0x4c683b){while(--_0x4c683b){_0x3a946b['push'](_0x3a946b['shift']());}};_0x156b7e(++_0x2e436f);}(_0x34c6,0xa9));var _0x634c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x34c6[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x634c('0x0'));var Sequelize=require('sequelize');module[_0x634c('0x1')]={'uniqueid':{'type':Sequelize[_0x634c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x634c('0x3')](_0x634c('0x4'),_0x634c('0x5'),_0x634c('0x6')),'allowNull':![],'defaultValue':_0x634c('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x634c('0x7')]}}; \ No newline at end of file +var _0xe565=['STRING','ENUM','DATE','NOW','moment','sequelize','exports'];(function(_0x52a1ff,_0x3b6847){var _0x12c7a7=function(_0x3371c0){while(--_0x3371c0){_0x52a1ff['push'](_0x52a1ff['shift']());}};_0x12c7a7(++_0x3b6847);}(_0xe565,0x170));var _0x5e56=function(_0x3c606f,_0x7af022){_0x3c606f=_0x3c606f-0x0;var _0x1fdf62=_0xe565[_0x3c606f];return _0x1fdf62;};'use strict';var moment=require(_0x5e56('0x0'));var Sequelize=require(_0x5e56('0x1'));module[_0x5e56('0x2')]={'uniqueid':{'type':Sequelize[_0x5e56('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5e56('0x4')]('account','agent','queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x5e56('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x5e56('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 5bee80c..b16e689 100644 --- a/server/api/chatTransferReport/chatTransferReport.controller.js +++ b/server/api/chatTransferReport/chatTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa73a=['name','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','pick','filter','where','merge','VIRTUAL','include','rows','catch','show','params','keys','fields','includeAll','options','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','save','then','destroy','stack','ChatTransferReport','rawAttributes','type','key','model','map'];(function(_0x3a33b8,_0x1f16d1){var _0x254925=function(_0x2dd070){while(--_0x2dd070){_0x3a33b8['push'](_0x3a33b8['shift']());}};_0x254925(++_0x1f16d1);}(_0xa73a,0x1c7));var _0xaa73=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0xa73a[_0x356e8d];return _0x39e65a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaa73('0x0'));var rimraf=require(_0xaa73('0x1'));var zipdir=require(_0xaa73('0x2'));var jsonpatch=require(_0xaa73('0x3'));var rp=require('request-promise');var moment=require(_0xaa73('0x4'));var BPromise=require(_0xaa73('0x5'));var Mustache=require(_0xaa73('0x6'));var util=require(_0xaa73('0x7'));var path=require(_0xaa73('0x8'));var sox=require(_0xaa73('0x9'));var csv=require(_0xaa73('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa73('0xb'));var squel=require(_0xaa73('0xc'));var crypto=require(_0xaa73('0xd'));var jsforce=require(_0xaa73('0xe'));var deskjs=require(_0xaa73('0xf'));var toCsv=require(_0xaa73('0xa'));var querystring=require(_0xaa73('0x10'));var Papa=require(_0xaa73('0x11'));var Redis=require('ioredis');var authService=require(_0xaa73('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa73('0x13'));var logger=require(_0xaa73('0x14'))(_0xaa73('0x15'));var utils=require(_0xaa73('0x16'));var config=require(_0xaa73('0x17'));var db=require(_0xaa73('0x18'))['db'];function respondWithStatusCode(_0x145531,_0xa558d0){_0xa558d0=_0xa558d0||0xcc;return function(_0x5d4eda){if(_0x5d4eda){return _0x145531[_0xaa73('0x19')](_0xa558d0);}return _0x145531['status'](_0xa558d0)[_0xaa73('0x1a')]();};}function respondWithResult(_0x935407,_0x3cc6f3){_0x3cc6f3=_0x3cc6f3||0xc8;return function(_0xc9bcb2){if(_0xc9bcb2){return _0x935407[_0xaa73('0x1b')](_0x3cc6f3)[_0xaa73('0x1c')](_0xc9bcb2);}};}function respondWithFilteredResult(_0x517f25,_0x5d9a02){return function(_0x5672fb){if(_0x5672fb){var _0x4ecf64=_0x5672fb[_0xaa73('0x1d')],_0x1e4508=_0x5d9a02[_0xaa73('0x1e')],_0x44656f=_0x5d9a02[_0xaa73('0x1e')]+_0x5d9a02['limit'],_0x194a1e;if(_0x44656f>=_0x4ecf64){_0x44656f=_0x4ecf64;_0x194a1e=0xc8;}else{_0x194a1e=0xce;}_0x517f25[_0xaa73('0x1b')](_0x194a1e);return _0x517f25[_0xaa73('0x1f')]('Content-Range',_0x1e4508+'-'+_0x44656f+'/'+_0x4ecf64)[_0xaa73('0x1c')](_0x5672fb);}return null;};}function patchUpdates(_0x1ff956){return function(_0x2d5ca4){try{jsonpatch['apply'](_0x2d5ca4,_0x1ff956,!![]);}catch(_0x3bd9dc){return BPromise['reject'](_0x3bd9dc);}return _0x2d5ca4[_0xaa73('0x20')]();};}function saveUpdates(_0x5e988e,_0x46ae44){return function(_0x29d69b){if(_0x29d69b){return _0x29d69b['update'](_0x5e988e)[_0xaa73('0x21')](function(_0x255a10){return _0x255a10;});}return null;};}function removeEntity(_0x4ee925,_0xadd0a7){return function(_0x5e1f8c){if(_0x5e1f8c){return _0x5e1f8c[_0xaa73('0x22')]()[_0xaa73('0x21')](function(){_0x4ee925[_0xaa73('0x1b')](0xcc)[_0xaa73('0x1a')]();});}};}function handleEntityNotFound(_0x3eddbf,_0x5c2798){return function(_0x32f7be){if(!_0x32f7be){_0x3eddbf[_0xaa73('0x19')](0x194);}return _0x32f7be;};}function handleError(_0x5bdbdb,_0xc71c94){_0xc71c94=_0xc71c94||0x1f4;return function(_0x2a6a70){logger['error'](_0x2a6a70[_0xaa73('0x23')]);if(_0x2a6a70['name']){delete _0x2a6a70['name'];}_0x5bdbdb[_0xaa73('0x1b')](_0xc71c94)['send'](_0x2a6a70);};}exports['index']=function(_0x45577f,_0x2a5124){var _0x2a0502={},_0x5d71ce={},_0x23017a={'count':0x0,'rows':[]};var _0x57d16e=_['map'](db[_0xaa73('0x24')][_0xaa73('0x25')],function(_0x4aae75){return{'name':_0x4aae75['fieldName'],'type':_0x4aae75[_0xaa73('0x26')][_0xaa73('0x27')]};});_0x5d71ce[_0xaa73('0x28')]=_[_0xaa73('0x29')](_0x57d16e,_0xaa73('0x2a'));_0x5d71ce[_0xaa73('0x2b')]=_['keys'](_0x45577f[_0xaa73('0x2b')]);_0x5d71ce[_0xaa73('0x2c')]=_[_0xaa73('0x2d')](_0x5d71ce['model'],_0x5d71ce[_0xaa73('0x2b')]);_0x2a0502['attributes']=_[_0xaa73('0x2d')](_0x5d71ce[_0xaa73('0x28')],qs['fields'](_0x45577f['query']['fields']));_0x2a0502[_0xaa73('0x2e')]=_0x2a0502[_0xaa73('0x2e')][_0xaa73('0x2f')]?_0x2a0502[_0xaa73('0x2e')]:_0x5d71ce[_0xaa73('0x28')];if(!_0x45577f[_0xaa73('0x2b')][_0xaa73('0x30')](_0xaa73('0x31'))){_0x2a0502['limit']=qs[_0xaa73('0x32')](_0x45577f[_0xaa73('0x2b')][_0xaa73('0x32')]);_0x2a0502['offset']=qs['offset'](_0x45577f[_0xaa73('0x2b')][_0xaa73('0x1e')]);}_0x2a0502[_0xaa73('0x33')]=qs['sort'](_0x45577f[_0xaa73('0x2b')]['sort']);_0x2a0502['where']=qs[_0xaa73('0x2c')](_[_0xaa73('0x34')](_0x45577f['query'],_0x5d71ce['filters']));if(_0x45577f[_0xaa73('0x2b')][_0xaa73('0x35')]){_0x2a0502[_0xaa73('0x36')]=_[_0xaa73('0x37')](_0x2a0502[_0xaa73('0x36')],{'$or':_[_0xaa73('0x29')](_0x57d16e,function(_0x38d6e4){if(_0x38d6e4[_0xaa73('0x26')]!==_0xaa73('0x38')){var _0x560fe8={};_0x560fe8[_0x38d6e4[_0xaa73('0x2a')]]={'$like':'%'+_0x45577f[_0xaa73('0x2b')][_0xaa73('0x35')]+'%'};return _0x560fe8;}})});}_0x2a0502=_[_0xaa73('0x37')]({},_0x2a0502,_0x45577f['options']);var _0x353013={'where':_0x2a0502[_0xaa73('0x36')]};return db['ChatTransferReport'][_0xaa73('0x1d')](_0x353013)[_0xaa73('0x21')](function(_0x498006){_0x23017a[_0xaa73('0x1d')]=_0x498006;if(_0x45577f[_0xaa73('0x2b')]['includeAll']){_0x2a0502[_0xaa73('0x39')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2a0502);})[_0xaa73('0x21')](function(_0x4f6835){_0x23017a[_0xaa73('0x3a')]=_0x4f6835;return _0x23017a;})[_0xaa73('0x21')](respondWithFilteredResult(_0x2a5124,_0x2a0502))[_0xaa73('0x3b')](handleError(_0x2a5124,null));};exports[_0xaa73('0x3c')]=function(_0x355f5b,_0x4cea1d){var _0x18e91b={'raw':!![],'where':{'id':_0x355f5b[_0xaa73('0x3d')]['id']}},_0x23177f={};_0x23177f['model']=_[_0xaa73('0x3e')](db['ChatTransferReport'][_0xaa73('0x25')]);_0x23177f['query']=_[_0xaa73('0x3e')](_0x355f5b[_0xaa73('0x2b')]);_0x23177f[_0xaa73('0x2c')]=_['intersection'](_0x23177f['model'],_0x23177f[_0xaa73('0x2b')]);_0x18e91b[_0xaa73('0x2e')]=_[_0xaa73('0x2d')](_0x23177f[_0xaa73('0x28')],qs[_0xaa73('0x3f')](_0x355f5b[_0xaa73('0x2b')]['fields']));_0x18e91b[_0xaa73('0x2e')]=_0x18e91b['attributes']['length']?_0x18e91b[_0xaa73('0x2e')]:_0x23177f[_0xaa73('0x28')];if(_0x355f5b[_0xaa73('0x2b')][_0xaa73('0x40')]){_0x18e91b[_0xaa73('0x39')]=[{'all':!![]}];}_0x18e91b=_['merge']({},_0x18e91b,_0x355f5b[_0xaa73('0x41')]);return db[_0xaa73('0x24')]['find'](_0x18e91b)[_0xaa73('0x21')](handleEntityNotFound(_0x4cea1d,null))[_0xaa73('0x21')](respondWithResult(_0x4cea1d,null))['catch'](handleError(_0x4cea1d,null));};exports[_0xaa73('0x42')]=function(_0x369e31,_0x40b8f1){return db['ChatTransferReport'][_0xaa73('0x42')](_0x369e31['body'],{})['then'](respondWithResult(_0x40b8f1,0xc9))[_0xaa73('0x3b')](handleError(_0x40b8f1,null));};exports[_0xaa73('0x43')]=function(_0x53913a,_0x23cd87){if(_0x53913a[_0xaa73('0x44')]['id']){delete _0x53913a[_0xaa73('0x44')]['id'];}return db['ChatTransferReport'][_0xaa73('0x45')]({'where':{'id':_0x53913a[_0xaa73('0x3d')]['id']}})['then'](handleEntityNotFound(_0x23cd87,null))[_0xaa73('0x21')](saveUpdates(_0x53913a[_0xaa73('0x44')],null))[_0xaa73('0x21')](respondWithResult(_0x23cd87,null))[_0xaa73('0x3b')](handleError(_0x23cd87,null));};exports[_0xaa73('0x22')]=function(_0x401738,_0xbd7c2e){return db[_0xaa73('0x24')][_0xaa73('0x45')]({'where':{'id':_0x401738[_0xaa73('0x3d')]['id']}})['then'](handleEntityNotFound(_0xbd7c2e,null))[_0xaa73('0x21')](removeEntity(_0xbd7c2e,null))[_0xaa73('0x3b')](handleError(_0xbd7c2e,null));};exports[_0xaa73('0x46')]=function(_0x1617f9,_0x577377){return db[_0xaa73('0x24')][_0xaa73('0x46')]()[_0xaa73('0x21')](respondWithResult(_0x577377,null))[_0xaa73('0x3b')](handleError(_0x577377,null));}; \ No newline at end of file +var _0x2dc2=['limit','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','ChatTransferReport','findAll','rows','catch','show','params','rawAttributes','options','find','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x2dc2,0x138));var _0x22dc=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x2dc2[_0x31cb5f];return _0x586042;};'use strict';var pdf=require(_0x22dc('0x0'));var emlformat=require(_0x22dc('0x1'));var rimraf=require(_0x22dc('0x2'));var zipdir=require(_0x22dc('0x3'));var jsonpatch=require(_0x22dc('0x4'));var rp=require('request-promise');var moment=require(_0x22dc('0x5'));var BPromise=require(_0x22dc('0x6'));var Mustache=require('mustache');var util=require(_0x22dc('0x7'));var path=require(_0x22dc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x22dc('0x9'));var squel=require(_0x22dc('0xa'));var crypto=require(_0x22dc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x22dc('0xc'));var querystring=require(_0x22dc('0xd'));var Papa=require('papaparse');var Redis=require(_0x22dc('0xe'));var authService=require(_0x22dc('0xf'));var qs=require(_0x22dc('0x10'));var as=require(_0x22dc('0x11'));var hardwareService=require(_0x22dc('0x12'));var logger=require(_0x22dc('0x13'))('api');var utils=require(_0x22dc('0x14'));var config=require('../../config/environment');var db=require(_0x22dc('0x15'))['db'];function respondWithStatusCode(_0x5a0a1a,_0x38e890){_0x38e890=_0x38e890||0xcc;return function(_0x1844cf){if(_0x1844cf){return _0x5a0a1a['sendStatus'](_0x38e890);}return _0x5a0a1a[_0x22dc('0x16')](_0x38e890)[_0x22dc('0x17')]();};}function respondWithResult(_0xc65f13,_0x47c0a4){_0x47c0a4=_0x47c0a4||0xc8;return function(_0x4157c7){if(_0x4157c7){return _0xc65f13['status'](_0x47c0a4)[_0x22dc('0x18')](_0x4157c7);}};}function respondWithFilteredResult(_0x40f836,_0x49cf84){return function(_0x5b39c5){if(_0x5b39c5){var _0x8516fd=_0x5b39c5[_0x22dc('0x19')],_0x34ef7f=_0x49cf84[_0x22dc('0x1a')],_0x2abbb2=_0x49cf84[_0x22dc('0x1a')]+_0x49cf84['limit'],_0x8303ce;if(_0x2abbb2>=_0x8516fd){_0x2abbb2=_0x8516fd;_0x8303ce=0xc8;}else{_0x8303ce=0xce;}_0x40f836['status'](_0x8303ce);return _0x40f836['set'](_0x22dc('0x1b'),_0x34ef7f+'-'+_0x2abbb2+'/'+_0x8516fd)['json'](_0x5b39c5);}return null;};}function patchUpdates(_0x454e7f){return function(_0x588c12){try{jsonpatch['apply'](_0x588c12,_0x454e7f,!![]);}catch(_0x3bb8c6){return BPromise[_0x22dc('0x1c')](_0x3bb8c6);}return _0x588c12[_0x22dc('0x1d')]();};}function saveUpdates(_0x609a74,_0x56e23c){return function(_0x87fc70){if(_0x87fc70){return _0x87fc70['update'](_0x609a74)[_0x22dc('0x1e')](function(_0x175676){return _0x175676;});}return null;};}function removeEntity(_0x596729,_0x41d85){return function(_0x22ae51){if(_0x22ae51){return _0x22ae51[_0x22dc('0x1f')]()[_0x22dc('0x1e')](function(){_0x596729[_0x22dc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f825b,_0x194258){return function(_0x181eb5){if(!_0x181eb5){_0x4f825b['sendStatus'](0x194);}return _0x181eb5;};}function handleError(_0x433916,_0x1412c6){_0x1412c6=_0x1412c6||0x1f4;return function(_0x14de78){logger[_0x22dc('0x20')](_0x14de78['stack']);if(_0x14de78[_0x22dc('0x21')]){delete _0x14de78[_0x22dc('0x21')];}_0x433916[_0x22dc('0x16')](_0x1412c6)[_0x22dc('0x22')](_0x14de78);};}exports[_0x22dc('0x23')]=function(_0x435c4f,_0x5de7ba){var _0x2a25b5={},_0x31bd3b={},_0x1b51ce={'count':0x0,'rows':[]};var _0x29e780=_['map'](db['ChatTransferReport']['rawAttributes'],function(_0x51dfc2){return{'name':_0x51dfc2[_0x22dc('0x24')],'type':_0x51dfc2[_0x22dc('0x25')][_0x22dc('0x26')]};});_0x31bd3b[_0x22dc('0x27')]=_['map'](_0x29e780,_0x22dc('0x21'));_0x31bd3b['query']=_[_0x22dc('0x28')](_0x435c4f[_0x22dc('0x29')]);_0x31bd3b[_0x22dc('0x2a')]=_[_0x22dc('0x2b')](_0x31bd3b[_0x22dc('0x27')],_0x31bd3b['query']);_0x2a25b5[_0x22dc('0x2c')]=_[_0x22dc('0x2b')](_0x31bd3b['model'],qs[_0x22dc('0x2d')](_0x435c4f[_0x22dc('0x29')][_0x22dc('0x2d')]));_0x2a25b5[_0x22dc('0x2c')]=_0x2a25b5['attributes'][_0x22dc('0x2e')]?_0x2a25b5[_0x22dc('0x2c')]:_0x31bd3b[_0x22dc('0x27')];if(!_0x435c4f['query'][_0x22dc('0x2f')]('nolimit')){_0x2a25b5[_0x22dc('0x30')]=qs[_0x22dc('0x30')](_0x435c4f[_0x22dc('0x29')][_0x22dc('0x30')]);_0x2a25b5[_0x22dc('0x1a')]=qs[_0x22dc('0x1a')](_0x435c4f[_0x22dc('0x29')][_0x22dc('0x1a')]);}_0x2a25b5[_0x22dc('0x31')]=qs[_0x22dc('0x32')](_0x435c4f[_0x22dc('0x29')][_0x22dc('0x32')]);_0x2a25b5[_0x22dc('0x33')]=qs[_0x22dc('0x2a')](_[_0x22dc('0x34')](_0x435c4f[_0x22dc('0x29')],_0x31bd3b['filters']));if(_0x435c4f['query']['filter']){_0x2a25b5[_0x22dc('0x33')]=_[_0x22dc('0x35')](_0x2a25b5[_0x22dc('0x33')],{'$or':_[_0x22dc('0x36')](_0x29e780,function(_0x15d8d0){if(_0x15d8d0['type']!==_0x22dc('0x37')){var _0x8f8c5e={};_0x8f8c5e[_0x15d8d0[_0x22dc('0x21')]]={'$like':'%'+_0x435c4f[_0x22dc('0x29')][_0x22dc('0x38')]+'%'};return _0x8f8c5e;}})});}_0x2a25b5=_['merge']({},_0x2a25b5,_0x435c4f['options']);var _0x399c66={'where':_0x2a25b5[_0x22dc('0x33')]};return db['ChatTransferReport'][_0x22dc('0x19')](_0x399c66)['then'](function(_0x482d57){_0x1b51ce['count']=_0x482d57;if(_0x435c4f[_0x22dc('0x29')][_0x22dc('0x39')]){_0x2a25b5[_0x22dc('0x3a')]=[{'all':!![]}];}return db[_0x22dc('0x3b')][_0x22dc('0x3c')](_0x2a25b5);})[_0x22dc('0x1e')](function(_0x741bd1){_0x1b51ce[_0x22dc('0x3d')]=_0x741bd1;return _0x1b51ce;})[_0x22dc('0x1e')](respondWithFilteredResult(_0x5de7ba,_0x2a25b5))[_0x22dc('0x3e')](handleError(_0x5de7ba,null));};exports[_0x22dc('0x3f')]=function(_0xacec03,_0x580014){var _0x4c796c={'raw':!![],'where':{'id':_0xacec03[_0x22dc('0x40')]['id']}},_0x5c813a={};_0x5c813a[_0x22dc('0x27')]=_[_0x22dc('0x28')](db[_0x22dc('0x3b')][_0x22dc('0x41')]);_0x5c813a[_0x22dc('0x29')]=_['keys'](_0xacec03['query']);_0x5c813a[_0x22dc('0x2a')]=_['intersection'](_0x5c813a['model'],_0x5c813a[_0x22dc('0x29')]);_0x4c796c['attributes']=_['intersection'](_0x5c813a[_0x22dc('0x27')],qs[_0x22dc('0x2d')](_0xacec03['query'][_0x22dc('0x2d')]));_0x4c796c[_0x22dc('0x2c')]=_0x4c796c[_0x22dc('0x2c')]['length']?_0x4c796c[_0x22dc('0x2c')]:_0x5c813a[_0x22dc('0x27')];if(_0xacec03['query']['includeAll']){_0x4c796c[_0x22dc('0x3a')]=[{'all':!![]}];}_0x4c796c=_['merge']({},_0x4c796c,_0xacec03[_0x22dc('0x42')]);return db[_0x22dc('0x3b')][_0x22dc('0x43')](_0x4c796c)[_0x22dc('0x1e')](handleEntityNotFound(_0x580014,null))['then'](respondWithResult(_0x580014,null))['catch'](handleError(_0x580014,null));};exports[_0x22dc('0x44')]=function(_0xcf977c,_0x344c3d){return db[_0x22dc('0x3b')][_0x22dc('0x44')](_0xcf977c['body'],{})['then'](respondWithResult(_0x344c3d,0xc9))[_0x22dc('0x3e')](handleError(_0x344c3d,null));};exports[_0x22dc('0x45')]=function(_0x13cbe4,_0x3fa251){if(_0x13cbe4[_0x22dc('0x46')]['id']){delete _0x13cbe4['body']['id'];}return db[_0x22dc('0x3b')]['find']({'where':{'id':_0x13cbe4[_0x22dc('0x40')]['id']}})['then'](handleEntityNotFound(_0x3fa251,null))[_0x22dc('0x1e')](saveUpdates(_0x13cbe4[_0x22dc('0x46')],null))[_0x22dc('0x1e')](respondWithResult(_0x3fa251,null))[_0x22dc('0x3e')](handleError(_0x3fa251,null));};exports[_0x22dc('0x1f')]=function(_0x15fafd,_0x1dba89){return db[_0x22dc('0x3b')][_0x22dc('0x43')]({'where':{'id':_0x15fafd[_0x22dc('0x40')]['id']}})['then'](handleEntityNotFound(_0x1dba89,null))[_0x22dc('0x1e')](removeEntity(_0x1dba89,null))[_0x22dc('0x3e')](handleError(_0x1dba89,null));};exports[_0x22dc('0x47')]=function(_0x30b4f6,_0x139e60){return db[_0x22dc('0x3b')][_0x22dc('0x47')]()[_0x22dc('0x1e')](respondWithResult(_0x139e60,null))[_0x22dc('0x3e')](handleError(_0x139e60,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 598b4b9..4844326 100644 --- a/server/api/chatTransferReport/chatTransferReport.model.js +++ b/server/api/chatTransferReport/chatTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc935=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports'];(function(_0x59b464,_0x5f44bf){var _0x1d1170=function(_0x4d5549){while(--_0x4d5549){_0x59b464['push'](_0x59b464['shift']());}};_0x1d1170(++_0x5f44bf);}(_0xc935,0xac));var _0x5c93=function(_0x13a4e6,_0xa8c7a0){_0x13a4e6=_0x13a4e6-0x0;var _0x1ba2c5=_0xc935[_0x13a4e6];return _0x1ba2c5;};'use strict';var _=require(_0x5c93('0x0'));var util=require(_0x5c93('0x1'));var logger=require(_0x5c93('0x2'))(_0x5c93('0x3'));var moment=require(_0x5c93('0x4'));var BPromise=require(_0x5c93('0x5'));var rp=require(_0x5c93('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x5c93('0x7')]=function(_0x3733d3,_0x359208){return _0x3733d3[_0x5c93('0x8')](_0x5c93('0x9'),attributes,{'tableName':_0x5c93('0xa'),'paranoid':![],'indexes':[{'name':_0x5c93('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5db8=['request-promise','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5a90ea,_0x42c981){var _0x3f405d=function(_0x1aa597){while(--_0x1aa597){_0x5a90ea['push'](_0x5a90ea['shift']());}};_0x3f405d(++_0x42c981);}(_0x5db8,0xbb));var _0x85db=function(_0x469ae2,_0x24cd30){_0x469ae2=_0x469ae2-0x0;var _0x5e33e4=_0x5db8[_0x469ae2];return _0x5e33e4;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var logger=require(_0x85db('0x2'))('api');var moment=require(_0x85db('0x3'));var BPromise=require(_0x85db('0x4'));var rp=require(_0x85db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85db('0x6'));var attributes=require(_0x85db('0x7'));module[_0x85db('0x8')]=function(_0x34d71f,_0x48bf16){return _0x34d71f['define'](_0x85db('0x9'),attributes,{'tableName':_0x85db('0xa'),'paranoid':![],'indexes':[{'name':_0x85db('0xb'),'fields':[_0x85db('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 2b1b47a..b2f64de 100644 --- a/server/api/chatTransferReport/chatTransferReport.rpc.js +++ b/server/api/chatTransferReport/chatTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffa5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x81a9b6,_0x3bf064){var _0x1f130f=function(_0x54d47a){while(--_0x54d47a){_0x81a9b6['push'](_0x81a9b6['shift']());}};_0x1f130f(++_0x3bf064);}(_0xffa5,0x13f));var _0x5ffa=function(_0xbedd4c,_0x686c7f){_0xbedd4c=_0xbedd4c-0x0;var _0x4ba6b1=_0xffa5[_0xbedd4c];return _0x4ba6b1;};'use strict';var _=require(_0x5ffa('0x0'));var util=require(_0x5ffa('0x1'));var moment=require(_0x5ffa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ffa('0x3'));var db=require(_0x5ffa('0x4'))['db'];var utils=require(_0x5ffa('0x5'));var logger=require(_0x5ffa('0x6'))(_0x5ffa('0x7'));var config=require('../../config/environment');var jayson=require(_0x5ffa('0x8'));var client=jayson[_0x5ffa('0x9')][_0x5ffa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f588c,_0x376ee4,_0x176738){return new BPromise(function(_0x25014a,_0x4a5c58){return client[_0x5ffa('0xb')](_0x2f588c,_0x176738)[_0x5ffa('0xc')](function(_0x232d6c){logger[_0x5ffa('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x376ee4,'request\x20sent');logger[_0x5ffa('0xe')](_0x5ffa('0xf'),_0x376ee4,'request\x20sent',JSON['stringify'](_0x232d6c));if(_0x232d6c[_0x5ffa('0x10')]){if(_0x232d6c[_0x5ffa('0x10')][_0x5ffa('0x11')]===0x1f4){logger['error'](_0x5ffa('0x12'),_0x376ee4,_0x232d6c[_0x5ffa('0x10')]['message']);return _0x4a5c58(_0x232d6c['error'][_0x5ffa('0x13')]);}logger[_0x5ffa('0x10')](_0x5ffa('0x12'),_0x376ee4,_0x232d6c[_0x5ffa('0x10')][_0x5ffa('0x13')]);return _0x25014a(_0x232d6c[_0x5ffa('0x10')][_0x5ffa('0x13')]);}else{logger[_0x5ffa('0xd')](_0x5ffa('0x12'),_0x376ee4,_0x5ffa('0x14'));_0x25014a(_0x232d6c[_0x5ffa('0x15')][_0x5ffa('0x13')]);}})[_0x5ffa('0x16')](function(_0x127a46){logger[_0x5ffa('0x10')](_0x5ffa('0x12'),_0x376ee4,_0x127a46);_0x4a5c58(_0x127a46);});});} \ No newline at end of file +var _0x0346=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x19655c,_0x1fe07b){var _0xd9f904=function(_0x121923){while(--_0x121923){_0x19655c['push'](_0x19655c['shift']());}};_0xd9f904(++_0x1fe07b);}(_0x0346,0xe3));var _0x6034=function(_0x227027,_0x1beab5){_0x227027=_0x227027-0x0;var _0x2a644=_0x0346[_0x227027];return _0x2a644;};'use strict';var _=require(_0x6034('0x0'));var util=require(_0x6034('0x1'));var moment=require(_0x6034('0x2'));var BPromise=require(_0x6034('0x3'));var rs=require(_0x6034('0x4'));var fs=require('fs');var Redis=require(_0x6034('0x5'));var db=require(_0x6034('0x6'))['db'];var utils=require(_0x6034('0x7'));var logger=require(_0x6034('0x8'))(_0x6034('0x9'));var config=require(_0x6034('0xa'));var jayson=require(_0x6034('0xb'));var client=jayson[_0x6034('0xc')][_0x6034('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d4785,_0x115fa7,_0x207507){return new BPromise(function(_0x61fc96,_0x5679bf){return client[_0x6034('0xe')](_0x1d4785,_0x207507)[_0x6034('0xf')](function(_0x2337d9){logger['info'](_0x6034('0x10'),_0x115fa7,_0x6034('0x11'));logger[_0x6034('0x12')](_0x6034('0x13'),_0x115fa7,_0x6034('0x11'),JSON[_0x6034('0x14')](_0x2337d9));if(_0x2337d9[_0x6034('0x15')]){if(_0x2337d9[_0x6034('0x15')][_0x6034('0x16')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x115fa7,_0x2337d9[_0x6034('0x15')][_0x6034('0x17')]);return _0x5679bf(_0x2337d9[_0x6034('0x15')][_0x6034('0x17')]);}logger[_0x6034('0x15')](_0x6034('0x10'),_0x115fa7,_0x2337d9[_0x6034('0x15')][_0x6034('0x17')]);return _0x61fc96(_0x2337d9[_0x6034('0x15')][_0x6034('0x17')]);}else{logger[_0x6034('0x18')](_0x6034('0x10'),_0x115fa7,_0x6034('0x11'));_0x61fc96(_0x2337d9[_0x6034('0x19')][_0x6034('0x17')]);}})[_0x6034('0x1a')](function(_0x2cdfd4){logger[_0x6034('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x115fa7,_0x2cdfd4);_0x5679bf(_0x2cdfd4);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 16581c7..82b3e20 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','exports'];(function(_0x3f1705,_0x170cfe){var _0x1cf570=function(_0x2d13dd){while(--_0x2d13dd){_0x3f1705['push'](_0x3f1705['shift']());}};_0x1cf570(++_0x170cfe);}(_0x0b0e,0x187));var _0xe0b0=function(_0xa522f,_0x5debbc){_0xa522f=_0xa522f-0x0;var _0x2083b0=_0x0b0e[_0xa522f];return _0x2083b0;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file +var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x4e1e1a,_0x3b4fff){var _0x525f9f=function(_0xe391ef){while(--_0xe391ef){_0x4e1e1a['push'](_0x4e1e1a['shift']());}};_0x525f9f(++_0x3b4fff);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1e4d42,_0x39d0ea){_0x1e4d42=_0x1e4d42-0x0;var _0xe894c8=_0x5f2f[_0x1e4d42];return _0xe894c8;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 6e287b3..8409e35 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6eb3=['name','getDataValue','onlineForm','parse','setDataValue','textarea','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','mandatoryDispositionPauseId','sequelize','randomstring','STRING','address','email','#9f946a','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Send','Skip','thumb','star','stringify','input'];(function(_0x4c7d8b,_0x572388){var _0x187158=function(_0x5e956d){while(--_0x5e956d){_0x4c7d8b['push'](_0x4c7d8b['shift']());}};_0x187158(++_0x572388);}(_0x6eb3,0x169));var _0x36eb=function(_0x44a77b,_0x22f9be){_0x44a77b=_0x44a77b-0x0;var _0x51dcb4=_0x6eb3[_0x44a77b];return _0x51dcb4;};'use strict';var Sequelize=require(_0x36eb('0x0'));var rs=require(_0x36eb('0x1'));module['exports']={'name':{'type':Sequelize[_0x36eb('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x36eb('0x2')],'allowNull':![],'unique':_0x36eb('0x3')},'description':{'type':Sequelize[_0x36eb('0x2')]},'mapKey':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x36eb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x36eb('0x2')],'allowNull':![],'defaultValue':_0x36eb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x36eb('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x36eb('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x36eb('0x2')]},'animation':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x36eb('0x8')](_0x36eb('0x9'),_0x36eb('0xa')),'defaultValue':_0x36eb('0x9')},'header_online':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0xb')},'start_chat_button':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0xc')},'offline_chat_button':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0xd')},'download_transcript':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x36eb('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x36eb('0xf')]},'closingQuestion':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x12')},'noteTitle':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x14')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x36eb('0x15')},'conditionAgreement':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x36eb('0x8')]('star',_0x36eb('0x16')),'defaultValue':_0x36eb('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x36eb('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x36eb('0xf')],'defaultValue':function(){return JSON[_0x36eb('0x18')]({'items':[{'type':_0x36eb('0x19'),'variable':null,'config':{'placeholder':_0x36eb('0x1a'),'type':'text','required':!![]},'props':{'title':_0x36eb('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x36eb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x36eb('0x4'),'type':_0x36eb('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x36eb('0x1b')](_0x36eb('0x1c'))?JSON[_0x36eb('0x1d')](this[_0x36eb('0x1b')](_0x36eb('0x1c'))):{};},'set':function(_0x503aa0){return this[_0x36eb('0x1e')]('onlineForm',JSON[_0x36eb('0x18')](_0x503aa0));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x36eb('0x18')]({'items':[{'type':_0x36eb('0x19'),'props':{'title':_0x36eb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x36eb('0x4')},'variable':null},{'type':_0x36eb('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x36eb('0x20'))?JSON['parse'](this['getDataValue']('offlineForm')):{};},'set':function(_0x5e0bc4){return this[_0x36eb('0x1e')]('offlineForm',JSON[_0x36eb('0x18')](_0x5e0bc4));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x36eb('0x21')]();}},'autoclose':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x36eb('0x2')]},'forwardOffline':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x22')},'waitingMessage':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x23')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x36eb('0x24')},'offlineMessageBody':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x36eb('0xf')],'defaultValue':function(){return _0x36eb('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x27')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':_0x36eb('0x28')},'verticalAlignment':{'type':Sequelize[_0x36eb('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x36eb('0x2')]},'customerAvatar':{'type':Sequelize[_0x36eb('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x36eb('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x36eb('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x36eb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x36eb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x36eb('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x36eb('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x11badb){if(!_0x11badb)this[_0x36eb('0x1e')](_0x36eb('0x2a'),null);this['setDataValue']('mandatoryDisposition',_0x11badb);}}}; \ No newline at end of file +var _0xd28c=['sequelize','exports','STRING','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xd28c,0x150));var _0xcd28=function(_0x4c2469,_0x65130e){_0x4c2469=_0x4c2469-0x0;var _0x5b7a16=_0xd28c[_0x4c2469];return _0x5b7a16;};'use strict';var Sequelize=require(_0xcd28('0x0'));var rs=require('randomstring');module[_0xcd28('0x1')]={'name':{'type':Sequelize[_0xcd28('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xcd28('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x3')},'key':{'type':Sequelize[_0xcd28('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x4')},'customerAlias':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xcd28('0x2')],'allowNull':![],'defaultValue':_0xcd28('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xcd28('0x2')],'allowNull':![],'defaultValue':_0xcd28('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xcd28('0x2')],'allowNull':![],'defaultValue':_0xcd28('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xcd28('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xcd28('0x2')]},'animation':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xcd28('0x9')]('rounded',_0xcd28('0xa')),'defaultValue':_0xcd28('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xcd28('0xc')},'start_chat_button':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0xd')},'header_offline':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xcd28('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xcd28('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x12')},'noteTitle':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xcd28('0x13')},'closingMessage':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xcd28('0xd')},'skipMessageButton':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x15')},'conditionAgreement':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0xcd28('0x17'),_0xcd28('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xcd28('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xcd28('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xcd28('0x19'),'type':_0xcd28('0x1a'),'required':!![]},'props':{'title':_0xcd28('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xcd28('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xcd28('0x3'),'type':_0xcd28('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xcd28('0x1b')](_0xcd28('0x1c'))?JSON[_0xcd28('0x1d')](this[_0xcd28('0x1b')](_0xcd28('0x1c'))):{};},'set':function(_0x265d42){return this[_0xcd28('0x1e')](_0xcd28('0x1c'),JSON[_0xcd28('0x1f')](_0x265d42));}},'offlineForm':{'type':Sequelize[_0xcd28('0xf')],'defaultValue':function(){return JSON[_0xcd28('0x1f')]({'items':[{'type':_0xcd28('0x20'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xcd28('0x3'),'type':_0xcd28('0x3')},'variable':null},{'type':_0xcd28('0x21'),'config':{'placeholder':_0xcd28('0x22')},'props':{'title':_0xcd28('0x22'),'helpText':_0xcd28('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xcd28('0x1b')](_0xcd28('0x24'))?JSON['parse'](this['getDataValue'](_0xcd28('0x24'))):{};},'set':function(_0x4b9049){return this[_0xcd28('0x1e')]('offlineForm',JSON[_0xcd28('0x1f')](_0x4b9049));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xcd28('0x25')]();}},'autoclose':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xcd28('0x2')]},'forwardOffline':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xcd28('0x2')]},'waitingTitle':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xcd28('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xcd28('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xcd28('0x2')]},'notificationTemplate':{'type':Sequelize[_0xcd28('0xf')],'defaultValue':function(){return _0xcd28('0x28');}},'notificationSound':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xcd28('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xcd28('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x2a')},'defaultTitle':{'type':Sequelize[_0xcd28('0x2')]},'customerAvatar':{'type':Sequelize[_0xcd28('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcd28('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcd28('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xcd28('0x2')],'defaultValue':_0xcd28('0x2c')},'systemAvatar':{'type':Sequelize[_0xcd28('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcd28('0x8')],'defaultValue':![],'comment':_0xcd28('0x2d'),'set':function(_0x14cff9){if(!_0x14cff9)this[_0xcd28('0x1e')](_0xcd28('0x2e'),null);this[_0xcd28('0x1e')](_0xcd28('0x2f'),_0x14cff9);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index a824903..37024f6 100644 --- a/server/api/chatWebsite/chatWebsite.controller.js +++ b/server/api/chatWebsite/chatWebsite.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4f4=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','CmContact','DESC','ChatApplication','Applications','applications','list','orderBy','priority','account','Contacts','defaults','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','version','%s\x20%s','browser','unknown','format','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','addInteraction','getInteractions','options','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','server/files/chat/iframe.js','utf8','remote','x-real-ip','connection','remoteAddress','replace','render','verticalAlignment','addApplications','sequelize','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','Sequelize','ValidationError','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','ChatWebsite,\x20%s,\x20%s','error','message','result','status','end','json','count','offset','apply','reject','then','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','ChatWebsite','includeAll','include','findAll','show','params','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','findOne','order','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x28de4b,_0x4c3525){var _0x721860=function(_0x1b85b8){while(--_0x1b85b8){_0x28de4b['push'](_0x28de4b['shift']());}};_0x721860(++_0x4c3525);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x4f3937,_0x423671){_0x4f3937=_0x4f3937-0x0;var _0x3b633b=_0xd4f4[_0x4f3937];return _0x3b633b;};'use strict';var pdf=require(_0x4d4f('0x0'));var emlformat=require(_0x4d4f('0x1'));var rimraf=require(_0x4d4f('0x2'));var zipdir=require(_0x4d4f('0x3'));var jsonpatch=require(_0x4d4f('0x4'));var rp=require(_0x4d4f('0x5'));var moment=require(_0x4d4f('0x6'));var BPromise=require(_0x4d4f('0x7'));var Mustache=require(_0x4d4f('0x8'));var util=require(_0x4d4f('0x9'));var path=require(_0x4d4f('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var db=require(_0x4d4f('0x1c'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x4d4f('0x1d'),'port':0x18eb});var socket=require(_0x4d4f('0x1e'))(new Redis(config['redis']));require(_0x4d4f('0x1f'))[_0x4d4f('0x20')](socket);var jayson=require(_0x4d4f('0x21'));var client=jayson['client'][_0x4d4f('0x22')]({'port':0x232c});var client9002=jayson[_0x4d4f('0x23')][_0x4d4f('0x22')]({'port':0x232a});var client9003=jayson['client'][_0x4d4f('0x22')]({'port':0x232b});function checkPasswordPattern(_0x5e4ff5,_0x18a528,_0x16f8e7){if(_0x16f8e7){var _0x4170ca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4170ca['test'](_0x18a528)){return _0x5e4ff5;}else{throw new db[(_0x4d4f('0x24'))][(_0x4d4f('0x25'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5e4ff5;}}function respondWithRpcPromise(_0x5dbbeb,_0x519501,_0x5a58af,_0x5eebec){return new BPromise(function(_0x34429e,_0x15100a){var _0x433222=_0x5eebec||client;return _0x433222[_0x4d4f('0x26')](_0x5dbbeb,_0x5a58af)['then'](function(_0x5b2863){logger[_0x4d4f('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x519501,_0x4d4f('0x28'));logger[_0x4d4f('0x29')](_0x4d4f('0x2a'),_0x519501,_0x4d4f('0x28'),JSON[_0x4d4f('0x2b')](_0x5b2863));if(_0x5b2863['error']){if(_0x5b2863['error'][_0x4d4f('0x2c')]===0x1f4){logger['error'](_0x4d4f('0x2d'),_0x519501,_0x5b2863[_0x4d4f('0x2e')][_0x4d4f('0x2f')]);return _0x15100a(_0x5b2863[_0x4d4f('0x2e')][_0x4d4f('0x2f')]);}logger['error'](_0x4d4f('0x2d'),_0x519501,_0x5b2863[_0x4d4f('0x2e')][_0x4d4f('0x2f')]);return _0x34429e(_0x5b2863[_0x4d4f('0x2e')]['message']);}else{logger['info'](_0x4d4f('0x2d'),_0x519501,_0x4d4f('0x28'));_0x34429e(_0x5b2863[_0x4d4f('0x30')][_0x4d4f('0x2f')]);}})['catch'](function(_0x671c87){logger[_0x4d4f('0x2e')](_0x4d4f('0x2d'),_0x519501,_0x671c87);_0x15100a(_0x671c87);});});}function respondWithStatusCode(_0x2e91b2,_0x4effb1){_0x4effb1=_0x4effb1||0xcc;return function(_0x338ba2){if(_0x338ba2){return _0x2e91b2['sendStatus'](_0x4effb1);}return _0x2e91b2[_0x4d4f('0x31')](_0x4effb1)[_0x4d4f('0x32')]();};}function respondWithResult(_0x550040,_0x2768f1){_0x2768f1=_0x2768f1||0xc8;return function(_0x123383){if(_0x123383){return _0x550040[_0x4d4f('0x31')](_0x2768f1)[_0x4d4f('0x33')](_0x123383);}};}function respondWithFilteredResult(_0x19a502,_0x43a704){return function(_0x4c69cb){if(_0x4c69cb){var _0x36eede=_0x4c69cb[_0x4d4f('0x34')],_0x4578b6=_0x43a704['offset'],_0x3894db=_0x43a704[_0x4d4f('0x35')]+_0x43a704['limit'],_0x43c37b;if(_0x3894db>=_0x36eede){_0x3894db=_0x36eede;_0x43c37b=0xc8;}else{_0x43c37b=0xce;}_0x19a502[_0x4d4f('0x31')](_0x43c37b);return _0x19a502['set']('Content-Range',_0x4578b6+'-'+_0x3894db+'/'+_0x36eede)['json'](_0x4c69cb);}return null;};}function patchUpdates(_0x9abc01){return function(_0x57fc2b){try{jsonpatch[_0x4d4f('0x36')](_0x57fc2b,_0x9abc01,!![]);}catch(_0x151132){return BPromise[_0x4d4f('0x37')](_0x151132);}return _0x57fc2b['save']();};}function saveUpdates(_0x8d18dc,_0x1ab7c4){return function(_0x6baae8){if(_0x6baae8){return _0x6baae8['update'](_0x8d18dc)[_0x4d4f('0x38')](function(_0x49e2db){return _0x49e2db;});}return null;};}function removeEntity(_0x3f9618,_0x2f18df){return function(_0x1a7cb3){if(_0x1a7cb3){return _0x1a7cb3[_0x4d4f('0x39')]()[_0x4d4f('0x38')](function(){var _0x13f341=_0x1a7cb3[_0x4d4f('0x3a')]({'plain':!![]});var _0x461900='ChatWebsites';return db['UserProfileResource'][_0x4d4f('0x39')]({'where':{'type':_0x461900,'resourceId':_0x13f341['id']}})['then'](function(){return _0x1a7cb3;});})['then'](function(){_0x3f9618[_0x4d4f('0x31')](0xcc)[_0x4d4f('0x32')]();});}};}function handleEntityNotFound(_0x2be655,_0x18ef52){return function(_0x129103){if(!_0x129103){_0x2be655['sendStatus'](0x194);}return _0x129103;};}function handleError(_0x12c512,_0x27466f){_0x27466f=_0x27466f||0x1f4;return function(_0x5cc3e7){logger[_0x4d4f('0x2e')](_0x5cc3e7[_0x4d4f('0x3b')]);if(_0x5cc3e7[_0x4d4f('0x3c')]){delete _0x5cc3e7[_0x4d4f('0x3c')];}_0x12c512[_0x4d4f('0x31')](_0x27466f)[_0x4d4f('0x3d')](_0x5cc3e7);};}exports[_0x4d4f('0x3e')]=function(_0x2e7140,_0x157ccd){var _0x4e54aa={'include':[{'model':db[_0x4d4f('0x3f')],'as':_0x4d4f('0x40')}]},_0x55a151={},_0x1cb919={'count':0x0,'rows':[]};var _0x131282=_['map'](db['ChatWebsite'][_0x4d4f('0x41')],function(_0x3c34bd){return{'name':_0x3c34bd['fieldName'],'type':_0x3c34bd['type'][_0x4d4f('0x42')]};});_0x55a151[_0x4d4f('0x43')]=_['map'](_0x131282,_0x4d4f('0x3c'));_0x55a151[_0x4d4f('0x44')]=_[_0x4d4f('0x45')](_0x2e7140[_0x4d4f('0x44')]);_0x55a151[_0x4d4f('0x46')]=_['intersection'](_0x55a151[_0x4d4f('0x43')],_0x55a151['query']);_0x4e54aa[_0x4d4f('0x47')]=_[_0x4d4f('0x48')](_0x55a151['model'],qs[_0x4d4f('0x49')](_0x2e7140[_0x4d4f('0x44')][_0x4d4f('0x49')]));_0x4e54aa['attributes']=_0x4e54aa[_0x4d4f('0x47')]['length']?_0x4e54aa[_0x4d4f('0x47')]:_0x55a151['model'];if(!_0x2e7140[_0x4d4f('0x44')][_0x4d4f('0x4a')](_0x4d4f('0x4b'))){_0x4e54aa[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4c')](_0x2e7140['query']['limit']);_0x4e54aa[_0x4d4f('0x35')]=qs[_0x4d4f('0x35')](_0x2e7140[_0x4d4f('0x44')][_0x4d4f('0x35')]);}_0x4e54aa['order']=qs['sort'](_0x2e7140['query'][_0x4d4f('0x4d')]);_0x4e54aa[_0x4d4f('0x4e')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x4f')](_0x2e7140[_0x4d4f('0x44')],_0x55a151[_0x4d4f('0x46')]));if(_0x2e7140[_0x4d4f('0x44')][_0x4d4f('0x50')]){_0x4e54aa[_0x4d4f('0x4e')]=_[_0x4d4f('0x51')](_0x4e54aa[_0x4d4f('0x4e')],{'$or':_[_0x4d4f('0x52')](_0x131282,function(_0x5c7a41){if(_0x5c7a41[_0x4d4f('0x53')]!==_0x4d4f('0x54')){var _0x5066e6={};_0x5066e6[_0x5c7a41[_0x4d4f('0x3c')]]={'$like':'%'+_0x2e7140['query'][_0x4d4f('0x50')]+'%'};return _0x5066e6;}})});}_0x4e54aa=_[_0x4d4f('0x51')]({},_0x4e54aa,_0x2e7140['options']);var _0x67fc4b={'where':_0x4e54aa[_0x4d4f('0x4e')]};return db[_0x4d4f('0x55')][_0x4d4f('0x34')](_0x67fc4b)[_0x4d4f('0x38')](function(_0x3eae74){_0x1cb919[_0x4d4f('0x34')]=_0x3eae74;if(_0x2e7140[_0x4d4f('0x44')][_0x4d4f('0x56')]){_0x4e54aa[_0x4d4f('0x57')]=[{'all':!![]}];}return db[_0x4d4f('0x55')][_0x4d4f('0x58')](_0x4e54aa);})['then'](function(_0x309ec2){_0x1cb919['rows']=_0x309ec2;return _0x1cb919;})['then'](respondWithFilteredResult(_0x157ccd,_0x4e54aa))['catch'](handleError(_0x157ccd,null));};exports[_0x4d4f('0x59')]=function(_0x168742,_0x487212){var _0x5f3252={'raw':![],'where':{'id':_0x168742[_0x4d4f('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x4d4f('0x40')}]},_0x2a3bc4={};_0x2a3bc4['model']=_[_0x4d4f('0x45')](db[_0x4d4f('0x55')][_0x4d4f('0x41')]);_0x2a3bc4[_0x4d4f('0x44')]=_['keys'](_0x168742[_0x4d4f('0x44')]);_0x2a3bc4[_0x4d4f('0x46')]=_[_0x4d4f('0x48')](_0x2a3bc4[_0x4d4f('0x43')],_0x2a3bc4[_0x4d4f('0x44')]);_0x5f3252['attributes']=_[_0x4d4f('0x48')](_0x2a3bc4['model'],qs[_0x4d4f('0x49')](_0x168742['query'][_0x4d4f('0x49')]));_0x5f3252[_0x4d4f('0x47')]=_0x5f3252['attributes'][_0x4d4f('0x5b')]?_0x5f3252[_0x4d4f('0x47')]:_0x2a3bc4['model'];if(_0x168742[_0x4d4f('0x44')]['includeAll']){_0x5f3252[_0x4d4f('0x57')]=[{'all':!![]}];}_0x5f3252=_['merge']({},_0x5f3252,_0x168742['options']);return db[_0x4d4f('0x55')][_0x4d4f('0x5c')](_0x5f3252)[_0x4d4f('0x38')](handleEntityNotFound(_0x487212,null))[_0x4d4f('0x38')](respondWithResult(_0x487212,null))[_0x4d4f('0x5d')](handleError(_0x487212,null));};exports['create']=function(_0x4aff5e,_0xeaccdd){return db['ChatWebsite'][_0x4d4f('0x5e')](_0x4aff5e[_0x4d4f('0x5f')],{})[_0x4d4f('0x38')](function(_0x4585b5){var _0x31aba3=_0x4aff5e[_0x4d4f('0x60')]['get']({'plain':!![]});if(!_0x31aba3)throw new Error(_0x4d4f('0x61'));if(_0x31aba3[_0x4d4f('0x62')]===_0x4d4f('0x60')){var _0x4bb7ac=_0x4585b5[_0x4d4f('0x3a')]({'plain':!![]});var _0x14aba5=_0x4d4f('0x63');return db['UserProfileSection'][_0x4d4f('0x5c')]({'where':{'name':_0x14aba5,'userProfileId':_0x31aba3['userProfileId']},'raw':!![]})[_0x4d4f('0x38')](function(_0x2145ca){if(_0x2145ca&&_0x2145ca[_0x4d4f('0x64')]===0x0){return db[_0x4d4f('0x65')][_0x4d4f('0x5e')]({'name':_0x4bb7ac[_0x4d4f('0x3c')],'resourceId':_0x4bb7ac['id'],'type':_0x2145ca[_0x4d4f('0x3c')],'sectionId':_0x2145ca['id']},{})[_0x4d4f('0x38')](function(){return _0x4585b5;});}else{return _0x4585b5;}})[_0x4d4f('0x5d')](function(_0x537ab7){logger[_0x4d4f('0x2e')](_0x4d4f('0x66'),_0x537ab7);throw _0x537ab7;});}return _0x4585b5;})['then'](respondWithResult(_0xeaccdd,0xc9))[_0x4d4f('0x5d')](handleError(_0xeaccdd,null));};exports[_0x4d4f('0x67')]=function(_0x3b3690,_0xae8fe){if(_0x3b3690['body']['id']){delete _0x3b3690[_0x4d4f('0x5f')]['id'];}return db[_0x4d4f('0x55')]['find']({'where':{'id':_0x3b3690['params']['id']},'include':[{'model':db[_0x4d4f('0x3f')],'as':_0x4d4f('0x40')}]})['then'](handleEntityNotFound(_0xae8fe,null))['then'](saveUpdates(_0x3b3690['body'],null))[_0x4d4f('0x38')](respondWithResult(_0xae8fe,null))[_0x4d4f('0x5d')](handleError(_0xae8fe,null));};exports['destroy']=function(_0x347bb1,_0xc596ea){return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x347bb1[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0xc596ea,null))[_0x4d4f('0x38')](removeEntity(_0xc596ea,null))[_0x4d4f('0x5d')](handleError(_0xc596ea,null));};exports['describe']=function(_0x3dfd59,_0x4e4196){return db[_0x4d4f('0x55')][_0x4d4f('0x68')]()[_0x4d4f('0x38')](respondWithResult(_0x4e4196,null))['catch'](handleError(_0x4e4196,null));};exports[_0x4d4f('0x69')]=function(_0x475027,_0x2ddd8e,_0x14675c){if(_0x475027['body']['id']){delete _0x475027[_0x4d4f('0x5f')]['id'];}return db['ChatWebsite'][_0x4d4f('0x5c')]({'where':{'id':_0x475027['params']['id']}})['then'](handleEntityNotFound(_0x2ddd8e,null))[_0x4d4f('0x38')](function(_0x2d99e4){if(_0x2d99e4){_0x475027['body'][_0x4d4f('0x6a')]=_0x2d99e4['id'];return db['Disposition'][_0x4d4f('0x5e')](_0x475027[_0x4d4f('0x5f')]);}})[_0x4d4f('0x38')](respondWithResult(_0x2ddd8e,null))[_0x4d4f('0x5d')](handleError(_0x2ddd8e,null));};exports['getDispositions']=function(_0x4952f0,_0x354a94,_0x30d7a0){var _0x4a7714={'raw':![],'where':{}};var _0x781877={};var _0x140cfd={'count':0x0,'rows':[]};return db[_0x4d4f('0x55')][_0x4d4f('0x6b')]({'where':{'id':_0x4952f0[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x354a94,null))['then'](function(_0x4acf9f){if(_0x4acf9f){_0x781877[_0x4d4f('0x43')]=_[_0x4d4f('0x45')](db['Disposition'][_0x4d4f('0x41')]);_0x781877[_0x4d4f('0x44')]=_[_0x4d4f('0x45')](_0x4952f0[_0x4d4f('0x44')]);_0x781877[_0x4d4f('0x46')]=_[_0x4d4f('0x48')](_0x781877[_0x4d4f('0x43')],_0x781877[_0x4d4f('0x44')]);_0x4a7714[_0x4d4f('0x47')]=_[_0x4d4f('0x48')](_0x781877[_0x4d4f('0x43')],qs[_0x4d4f('0x49')](_0x4952f0[_0x4d4f('0x44')][_0x4d4f('0x49')]));_0x4a7714[_0x4d4f('0x47')]=_0x4a7714['attributes'][_0x4d4f('0x5b')]?_0x4a7714[_0x4d4f('0x47')]:_0x781877[_0x4d4f('0x43')];if(!_0x4952f0[_0x4d4f('0x44')]['hasOwnProperty']('nolimit')){_0x4a7714[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4c')](_0x4952f0[_0x4d4f('0x44')][_0x4d4f('0x4c')]);_0x4a7714[_0x4d4f('0x35')]=qs[_0x4d4f('0x35')](_0x4952f0[_0x4d4f('0x44')][_0x4d4f('0x35')]);}_0x4a7714[_0x4d4f('0x6c')]=qs[_0x4d4f('0x4d')](_0x4952f0['query'][_0x4d4f('0x4d')]);_0x4a7714[_0x4d4f('0x4e')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x4f')](_0x4952f0['query'],_0x781877['filters']));_0x4a7714['where'][_0x4d4f('0x6a')]=_0x4acf9f['id'];if(_0x4952f0['query'][_0x4d4f('0x50')]){_0x4a7714[_0x4d4f('0x4e')]=_[_0x4d4f('0x51')](_0x4a7714[_0x4d4f('0x4e')],{'$or':_[_0x4d4f('0x52')](_0x4a7714[_0x4d4f('0x47')],function(_0x1990d6){var _0x13247a={};_0x13247a[_0x1990d6]={'$like':'%'+_0x4952f0['query']['filter']+'%'};return _0x13247a;})});}_0x4a7714=_[_0x4d4f('0x51')]({},_0x4a7714,_0x4952f0['options']);return db[_0x4d4f('0x6d')][_0x4d4f('0x34')]({'where':_0x4a7714[_0x4d4f('0x4e')]})['then'](function(_0x535407){_0x140cfd['count']=_0x535407;if(_0x4952f0[_0x4d4f('0x44')]['includeAll']){_0x4a7714[_0x4d4f('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x4d4f('0x58')](_0x4a7714);})[_0x4d4f('0x38')](function(_0x1e8b6f){_0x140cfd[_0x4d4f('0x6e')]=_0x1e8b6f;return _0x140cfd;});}})[_0x4d4f('0x38')](respondWithFilteredResult(_0x354a94,_0x4a7714))[_0x4d4f('0x5d')](handleError(_0x354a94,null));};exports['removeDispositions']=function(_0x18274e,_0x3beacf,_0x4691b7){return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x18274e['params']['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x3beacf,null))['then'](function(_0x4715d0){if(_0x4715d0){return _0x4715d0[_0x4d4f('0x6f')](_0x18274e[_0x4d4f('0x44')][_0x4d4f('0x70')]);}})[_0x4d4f('0x38')](respondWithStatusCode(_0x3beacf,null))[_0x4d4f('0x5d')](handleError(_0x3beacf,null));};exports[_0x4d4f('0x71')]=function(_0x5a0e5d,_0x29c49f,_0x2eb14a){if(_0x5a0e5d[_0x4d4f('0x5f')]['id']){delete _0x5a0e5d['body']['id'];}return db[_0x4d4f('0x55')]['find']({'where':{'id':_0x5a0e5d[_0x4d4f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x29c49f,null))[_0x4d4f('0x38')](function(_0x20e632){if(_0x20e632){_0x5a0e5d[_0x4d4f('0x5f')]['ChatWebsiteId']=_0x20e632['id'];return db[_0x4d4f('0x72')][_0x4d4f('0x5e')](_0x5a0e5d[_0x4d4f('0x5f')]);}})[_0x4d4f('0x38')](respondWithResult(_0x29c49f,null))['catch'](handleError(_0x29c49f,null));};exports[_0x4d4f('0x73')]=function(_0x40e725,_0x5ab22a,_0x17c921){var _0x2a5aca={'raw':![],'where':{}};var _0x4004c4={};var _0x2e0cd7={'count':0x0,'rows':[]};return db[_0x4d4f('0x55')][_0x4d4f('0x6b')]({'where':{'id':_0x40e725['params']['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x5ab22a,null))[_0x4d4f('0x38')](function(_0x53906c){if(_0x53906c){_0x4004c4[_0x4d4f('0x43')]=_[_0x4d4f('0x45')](db[_0x4d4f('0x72')][_0x4d4f('0x41')]);_0x4004c4[_0x4d4f('0x44')]=_[_0x4d4f('0x45')](_0x40e725[_0x4d4f('0x44')]);_0x4004c4[_0x4d4f('0x46')]=_['intersection'](_0x4004c4[_0x4d4f('0x43')],_0x4004c4[_0x4d4f('0x44')]);_0x2a5aca['attributes']=_[_0x4d4f('0x48')](_0x4004c4['model'],qs[_0x4d4f('0x49')](_0x40e725['query'][_0x4d4f('0x49')]));_0x2a5aca[_0x4d4f('0x47')]=_0x2a5aca[_0x4d4f('0x47')][_0x4d4f('0x5b')]?_0x2a5aca[_0x4d4f('0x47')]:_0x4004c4[_0x4d4f('0x43')];if(!_0x40e725[_0x4d4f('0x44')][_0x4d4f('0x4a')](_0x4d4f('0x4b'))){_0x2a5aca[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4c')](_0x40e725[_0x4d4f('0x44')]['limit']);_0x2a5aca['offset']=qs[_0x4d4f('0x35')](_0x40e725['query'][_0x4d4f('0x35')]);}_0x2a5aca[_0x4d4f('0x6c')]=qs['sort'](_0x40e725['query'][_0x4d4f('0x4d')]);_0x2a5aca[_0x4d4f('0x4e')]=qs[_0x4d4f('0x46')](_['pick'](_0x40e725['query'],_0x4004c4[_0x4d4f('0x46')]));_0x2a5aca[_0x4d4f('0x4e')][_0x4d4f('0x6a')]=_0x53906c['id'];if(_0x40e725[_0x4d4f('0x44')]['filter']){_0x2a5aca[_0x4d4f('0x4e')]=_[_0x4d4f('0x51')](_0x2a5aca[_0x4d4f('0x4e')],{'$or':_['map'](_0x2a5aca['attributes'],function(_0xead454){var _0x1055d3={};_0x1055d3[_0xead454]={'$like':'%'+_0x40e725[_0x4d4f('0x44')][_0x4d4f('0x50')]+'%'};return _0x1055d3;})});}_0x2a5aca=_[_0x4d4f('0x51')]({},_0x2a5aca,_0x40e725['options']);return db[_0x4d4f('0x72')][_0x4d4f('0x34')]({'where':_0x2a5aca[_0x4d4f('0x4e')]})['then'](function(_0x39cdc4){_0x2e0cd7['count']=_0x39cdc4;if(_0x40e725[_0x4d4f('0x44')][_0x4d4f('0x56')]){_0x2a5aca[_0x4d4f('0x57')]=[{'all':!![]}];}return db[_0x4d4f('0x72')][_0x4d4f('0x58')](_0x2a5aca);})['then'](function(_0x45f38c){_0x2e0cd7[_0x4d4f('0x6e')]=_0x45f38c;return _0x2e0cd7;});}})[_0x4d4f('0x38')](respondWithFilteredResult(_0x5ab22a,_0x2a5aca))[_0x4d4f('0x5d')](handleError(_0x5ab22a,null));};exports['removeAnswers']=function(_0x138849,_0x539ac9,_0x5cc301){return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x138849['params']['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x539ac9,null))['then'](function(_0x1177a3){if(_0x1177a3){return _0x1177a3[_0x4d4f('0x74')](_0x138849[_0x4d4f('0x44')][_0x4d4f('0x70')]);}})[_0x4d4f('0x38')](respondWithStatusCode(_0x539ac9,null))[_0x4d4f('0x5d')](handleError(_0x539ac9,null));};exports[_0x4d4f('0x75')]=function(_0x3fe348,_0x4caacc,_0x45452e){_0x3fe348[_0x4d4f('0x5f')]['sitepic']=_0x3fe348[_0x4d4f('0x76')]['filename'];return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x3fe348[_0x4d4f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4caacc,null))['then'](saveUpdates(_0x3fe348['body'],null))[_0x4d4f('0x38')](respondWithResult(_0x4caacc,null))['catch'](handleError(_0x4caacc,null));};exports[_0x4d4f('0x77')]=function(_0x29b55f,_0x134bf,_0x5421d5){_0x29b55f['body'][_0x4d4f('0x78')]=_0x29b55f[_0x4d4f('0x76')][_0x4d4f('0x79')];return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x29b55f[_0x4d4f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x134bf,null))[_0x4d4f('0x38')](saveUpdates(_0x29b55f[_0x4d4f('0x5f')],null))[_0x4d4f('0x38')](respondWithResult(_0x134bf,null))[_0x4d4f('0x5d')](handleError(_0x134bf,null));};exports[_0x4d4f('0x7a')]=function(_0x1b8083,_0x3e399b,_0x85b007){_0x1b8083[_0x4d4f('0x5f')][_0x4d4f('0x7b')]=_0x1b8083[_0x4d4f('0x76')][_0x4d4f('0x79')];return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x1b8083['params']['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x3e399b,null))[_0x4d4f('0x38')](saveUpdates(_0x1b8083[_0x4d4f('0x5f')],null))[_0x4d4f('0x38')](respondWithResult(_0x3e399b,null))[_0x4d4f('0x5d')](handleError(_0x3e399b,null));};exports[_0x4d4f('0x7c')]=function(_0x13787,_0x472938,_0x13c574){_0x13787['body'][_0x4d4f('0x7d')]=_0x13787[_0x4d4f('0x76')][_0x4d4f('0x79')];return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x13787[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x472938,null))[_0x4d4f('0x38')](saveUpdates(_0x13787[_0x4d4f('0x5f')],null))[_0x4d4f('0x38')](respondWithResult(_0x472938,null))['catch'](handleError(_0x472938,null));};exports['getLogo']=function(_0xfa0e9f,_0x8850a4,_0x4b723d){var _0x54fca9=path[_0x4d4f('0x7e')](config[_0x4d4f('0x7f')],_0x4d4f('0x80'));var _0x15028c={'where':{'id':_0xfa0e9f[_0x4d4f('0x5a')]['id']},'attributes':['id',_0x4d4f('0x81')],'raw':!![]};var _0x444323=![];return require(_0x4d4f('0x82'))[_0x4d4f('0x83')]()[_0x4d4f('0x38')](function(_0x63c3c9){if(_0x63c3c9){_0x444323=_0x63c3c9[_0x4d4f('0x84')];}})[_0x4d4f('0x38')](function(){return db['ChatWebsite'][_0x4d4f('0x5c')](_0x15028c);})['then'](handleEntityNotFound(_0x8850a4,null))[_0x4d4f('0x38')](function(_0x3fd499){if(_0x3fd499){if(!_[_0x4d4f('0x85')](_0x3fd499[_0x4d4f('0x81')])){if(fs['existsSync'](path[_0x4d4f('0x7e')](config[_0x4d4f('0x7f')],_0x4d4f('0x86'),_0x3fd499[_0x4d4f('0x81')]))&&_0x444323){_0x54fca9=path[_0x4d4f('0x7e')](config[_0x4d4f('0x7f')],_0x4d4f('0x86'),_0x3fd499['sitepic']);}}return _0x8850a4[_0x4d4f('0x87')](_0x54fca9);}})[_0x4d4f('0x5d')](handleError(_0x8850a4,null));};exports[_0x4d4f('0x88')]=function(_0x172990,_0x4501b5,_0x12eda1){var _0x5d9c94=path['join'](config[_0x4d4f('0x7f')],'server/files/images/avatars/default_avatar.png');var _0x2ea6b4={'where':{'id':_0x172990[_0x4d4f('0x5a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x4d4f('0x55')][_0x4d4f('0x5c')](_0x2ea6b4)[_0x4d4f('0x38')](handleEntityNotFound(_0x4501b5,null))[_0x4d4f('0x38')](function(_0x2532cf){if(_0x2532cf){if(!_[_0x4d4f('0x85')](_0x2532cf[_0x4d4f('0x78')])){if(fs['existsSync'](path[_0x4d4f('0x7e')](config['root'],_0x4d4f('0x89'),_0x2532cf[_0x4d4f('0x78')]))){_0x5d9c94=path['join'](config['root'],_0x4d4f('0x89'),_0x2532cf[_0x4d4f('0x78')]);}}return _0x4501b5[_0x4d4f('0x87')](_0x5d9c94);}})['catch'](handleError(_0x4501b5,null));};exports[_0x4d4f('0x8a')]=function(_0x118642,_0x7c1b06,_0x3f21e7){var _0x42d04a=path[_0x4d4f('0x7e')](config[_0x4d4f('0x7f')],_0x4d4f('0x8b'));var _0x27fd1e={'where':{'id':_0x118642['params']['id']},'attributes':['id',_0x4d4f('0x7b'),_0x4d4f('0x8c')],'raw':!![]};return db[_0x4d4f('0x55')][_0x4d4f('0x5c')](_0x27fd1e)['then'](handleEntityNotFound(_0x7c1b06,null))[_0x4d4f('0x38')](function(_0x5da3cc){if(_0x5da3cc){if(!_['isNil'](_0x5da3cc[_0x4d4f('0x7b')])){if(fs[_0x4d4f('0x8d')](path[_0x4d4f('0x7e')](config[_0x4d4f('0x7f')],_0x4d4f('0x89'),_0x5da3cc[_0x4d4f('0x7b')]))&&_0x5da3cc[_0x4d4f('0x8c')]){_0x42d04a=path[_0x4d4f('0x7e')](config[_0x4d4f('0x7f')],'server/files/images/avatars/',_0x5da3cc[_0x4d4f('0x7b')]);}}return _0x7c1b06['download'](_0x42d04a);}})[_0x4d4f('0x5d')](handleError(_0x7c1b06,null));};exports[_0x4d4f('0x8e')]=function(_0x159e3a,_0x477da1,_0x52a644){var _0xa51bfd=path[_0x4d4f('0x7e')](config[_0x4d4f('0x7f')],_0x4d4f('0x8f'));var _0xa03913={'where':{'id':_0x159e3a[_0x4d4f('0x5a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x4d4f('0x55')][_0x4d4f('0x5c')](_0xa03913)['then'](handleEntityNotFound(_0x477da1,null))[_0x4d4f('0x38')](function(_0x432fcb){if(_0x432fcb){if(!_[_0x4d4f('0x85')](_0x432fcb[_0x4d4f('0x7d')])){if(fs[_0x4d4f('0x8d')](path[_0x4d4f('0x7e')](config['root'],_0x4d4f('0x89'),_0x432fcb[_0x4d4f('0x7d')]))){_0xa51bfd=path[_0x4d4f('0x7e')](config['root'],_0x4d4f('0x89'),_0x432fcb[_0x4d4f('0x7d')]);}}return _0x477da1['download'](_0xa51bfd);}})['catch'](handleError(_0x477da1,null));};exports[_0x4d4f('0x90')]=function(_0x564230,_0x1c39d3,_0x56d05d){var _0x474f45=require(_0x4d4f('0x91'));var _0x361da6=new _0x474f45();var _0x1c5605=_0x361da6[_0x4d4f('0x92')](_0x564230['headers'][_0x4d4f('0x93')])['getResult']();var _0x1a7faa={'body':_0x564230[_0x4d4f('0x5f')],'channel':'chat'};var _0x4c6a83=[];var _0x44758b=[];var _0x4bab19={};var _0x5b2f5a=![];return db['CmContact'][_0x4d4f('0x68')]()[_0x4d4f('0x38')](function(_0x49c7a4){if(!_0x49c7a4){throw new db['Sequelize'][(_0x4d4f('0x25'))](_0x4d4f('0x94'));}_0x4c6a83=_[_0x4d4f('0x95')](_[_0x4d4f('0x45')](_0x49c7a4),[_0x4d4f('0x96'),_0x4d4f('0x97')]);_0x44758b=_[_0x4d4f('0x95')](_[_0x4d4f('0x45')](_0x49c7a4),[_0x4d4f('0x96'),_0x4d4f('0x97'),_0x4d4f('0x98'),_0x4d4f('0x99')]);if(_0x564230['body']['id']){delete _0x564230[_0x4d4f('0x5f')]['id'];}if(_[_0x4d4f('0x85')](_0x564230[_0x4d4f('0x5f')][_0x4d4f('0x9a')])){throw new db[(_0x4d4f('0x24'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x564230[_0x4d4f('0x5f')]['body'])||_0x564230[_0x4d4f('0x5f')][_0x4d4f('0x5f')]===''){throw new db[(_0x4d4f('0x24'))][(_0x4d4f('0x25'))](_0x4d4f('0x9b'));}if(_[_0x4d4f('0x85')](_0x564230['body'][_0x4d4f('0x9c')])){throw new db[(_0x4d4f('0x24'))][(_0x4d4f('0x25'))](_0x4d4f('0x9d')+_0x44758b);}if(!_[_0x4d4f('0x9e')](_0x44758b,_0x564230[_0x4d4f('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0x4d4f('0x25'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44758b);}_0x4bab19[_0x564230[_0x4d4f('0x5f')][_0x4d4f('0x9c')]]=_0x564230[_0x4d4f('0x5f')][_0x4d4f('0x9a')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x564230[_0x4d4f('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x4d4f('0x9f'),'include':[{'model':db[_0x4d4f('0xa0')],'as':'Contacts','where':_0x4bab19,'limit':0x1,'order':[['updatedAt',_0x4d4f('0xa1')]]}]},{'model':db[_0x4d4f('0xa2')],'as':_0x4d4f('0xa3')}]});})[_0x4d4f('0x38')](handleEntityNotFound(_0x1c39d3,null))['then'](function(_0x43f540){if(_0x43f540&&_0x43f540[_0x4d4f('0x9f')]){_0x1a7faa['account']=_0x43f540;_0x1a7faa[_0x4d4f('0xa4')]=_0x43f540[_0x4d4f('0xa3')];_0x1a7faa[_0x4d4f('0xa5')]=_0x43f540[_0x4d4f('0x9f')];_0x1a7faa[_0x4d4f('0xa4')]=_[_0x4d4f('0xa6')](_0x1a7faa[_0x4d4f('0xa4')],[_0x4d4f('0xa7')],['asc']);if(_0x1a7faa['account'][_0x4d4f('0xa3')]){delete _0x1a7faa[_0x4d4f('0xa8')][_0x4d4f('0xa3')];}if(_0x1a7faa[_0x4d4f('0xa8')][_0x4d4f('0x9f')]&&_0x1a7faa[_0x4d4f('0xa8')][_0x4d4f('0x9f')][_0x4d4f('0xa9')][_0x4d4f('0x5b')]){return _0x1a7faa[_0x4d4f('0xa8')][_0x4d4f('0x9f')][_0x4d4f('0xa9')][0x0];}var _0x5cab5f=_[_0x4d4f('0xaa')](_0x564230['body'],{'firstName':_0x564230[_0x4d4f('0x5f')][_0x4d4f('0x9a')],'ListId':_0x43f540[_0x4d4f('0x99')]});_0x5cab5f[_0x564230[_0x4d4f('0x5f')]['mapKey']]=_0x564230[_0x4d4f('0x5f')][_0x4d4f('0x9a')];return db['CmContact'][_0x4d4f('0x5e')](_0x5cab5f,{'fields':_0x4c6a83,'raw':!![]});}})['then'](handleEntityNotFound(_0x1c39d3,null))[_0x4d4f('0x38')](function(_0x3e9e82){_0x1a7faa['contact']=_0x3e9e82;var _0x16482b=_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xab')];if(_0x564230[_0x4d4f('0xac')][_0x4d4f('0xad')]){_0x16482b=_0x564230['headers'][_0x4d4f('0xad')];}else if(_0x564230['headers'][_0x4d4f('0xae')]){_0x16482b=_[_0x4d4f('0xaf')](_0x564230[_0x4d4f('0xac')][_0x4d4f('0xae')][_0x4d4f('0xb0')](','));}if(_0x3e9e82){var _0x37e2ce={'ContactId':_0x3e9e82['id'],'ChatWebsiteId':_0x564230['params']['id'],'from':(_0x3e9e82[_0x4d4f('0xb1')]||'')+'\x20'+(_0x3e9e82['lastName']||''),'customerIp':_0x16482b,'customerPort':_0x564230['headers']['x-real-port']?_0x564230[_0x4d4f('0xac')][_0x4d4f('0xb2')]:null,'referer':_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xb3')],'browserName':_0x1c5605['browser']['name']&&_0x1c5605['browser'][_0x4d4f('0xb4')]?util['format'](_0x4d4f('0xb5'),_0x1c5605[_0x4d4f('0xb6')][_0x4d4f('0x3c')],_0x1c5605['browser']['version']):_0x4d4f('0xb7'),'browserVersion':_0x1c5605[_0x4d4f('0xb6')][_0x4d4f('0xb4')]||'unknown','osName':util[_0x4d4f('0xb8')](_0x4d4f('0xb5'),_0x1c5605['os'][_0x4d4f('0x3c')],_0x1c5605['os'][_0x4d4f('0xb4')]),'osVersion':_0x1c5605['os'][_0x4d4f('0xb4')],'deviceModel':_0x1c5605[_0x4d4f('0xb9')]['model']&&_0x1c5605[_0x4d4f('0xb9')]['vendor']?util['format']('%s\x20%s\x20%s',_0x1c5605[_0x4d4f('0xb9')][_0x4d4f('0x43')],_0x1c5605['device'][_0x4d4f('0xba')],_0x1c5605[_0x4d4f('0xb9')][_0x4d4f('0x53')]):null,'deviceVendor':_0x1c5605[_0x4d4f('0xb9')][_0x4d4f('0xba')],'deviceType':_0x1c5605[_0x4d4f('0xb9')][_0x4d4f('0x53')],'formData':JSON['stringify'](_0x564230[_0x4d4f('0x5f')])};var _0x44161b={'ChatWebsiteId':_0x564230['params']['id'],'closed':![]};if(_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xbb')]){_0x44161b[_0x4d4f('0xbb')]=_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xbb')];return db[_0x4d4f('0xbc')][_0x4d4f('0x5c')]({'where':_0x44161b})[_0x4d4f('0x38')](function(_0x5d90f5){if(_0x5d90f5){return[_0x5d90f5,![]];}_0x37e2ce[_0x4d4f('0xbb')]=_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xbb')];_0x37e2ce[_0x4d4f('0xbd')]=_0x564230['body'][_0x4d4f('0xbd')];return db[_0x4d4f('0xbc')][_0x4d4f('0x5e')](_0x37e2ce)[_0x4d4f('0x38')](function(_0x32becb){return[_0x32becb,!![]];});});}_0x44161b[_0x4d4f('0xbe')]=_0x3e9e82['id'];if(_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xbf')]&&_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xbf')]['id']){_0x44161b['id']=_0x564230[_0x4d4f('0x5f')]['interaction']['id'];return db[_0x4d4f('0xbc')][_0x4d4f('0x5c')]({'where':_0x44161b})[_0x4d4f('0x38')](function(_0x3c84ac){if(_0x3c84ac){return[_0x3c84ac,![]];}return db[_0x4d4f('0xbc')][_0x4d4f('0x5e')](_0x37e2ce)[_0x4d4f('0x38')](function(_0x137fbc){return[_0x137fbc,!![]];});});}return db[_0x4d4f('0xbc')][_0x4d4f('0x5e')](_0x37e2ce)[_0x4d4f('0x38')](function(_0x54b8c5){return[_0x54b8c5,!![]];});}})[_0x4d4f('0xc0')](function(_0x2cb12e,_0x3a0d74){if(_0x2cb12e){_0x5b2f5a=_0x3a0d74;if(!_0x3a0d74){var _0xd14b57={'from':(_0x1a7faa[_0x4d4f('0xc1')][_0x4d4f('0xb1')]||'')+'\x20'+(_0x1a7faa[_0x4d4f('0xc1')][_0x4d4f('0xc2')]||'')};if(_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xbb')]&&_0x564230['body'][_0x4d4f('0xc3')]&&_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xbb')]!=_0x564230[_0x4d4f('0x5f')][_0x4d4f('0xc3')]){_0xd14b57[_0x4d4f('0xbb')]=_0x564230['body'][_0x4d4f('0xc3')];}return _0x2cb12e[_0x4d4f('0x67')](_0xd14b57);}else{return _0x2cb12e;}}})[_0x4d4f('0x38')](function(_0x3109fe){_0x1a7faa[_0x4d4f('0xbf')]=_0x3109fe['get']({'plain':!![]});_0x1a7faa[_0x4d4f('0xbf')][_0x4d4f('0xc4')]=_0x5b2f5a;if(_0x1a7faa[_0x4d4f('0xbf')][_0x4d4f('0xc4')]){if(_0x1a7faa[_0x4d4f('0xa8')][_0x4d4f('0xc5')]){_0x1a7faa[_0x4d4f('0xa4')]['push']({'id':0x0,'priority':_0x1a7faa[_0x4d4f('0xa4')][_0x4d4f('0x5b')]+0x1,'app':_0x4d4f('0xc6'),'appdata':_0x4d4f('0xc7'),'interval':_0x4d4f('0xc8')});}}return db[_0x4d4f('0xc9')][_0x4d4f('0x5e')]({'body':_0x564230['body'][_0x4d4f('0x5f')],'ChatWebsiteId':_0x564230['params']['id'],'ChatInteractionId':_0x3109fe['id'],'direction':'in','ContactId':_0x1a7faa[_0x4d4f('0xc1')]['id'],'AttachmentId':_0x564230['body'][_0x4d4f('0xca')]});})[_0x4d4f('0x38')](function(_0x353fdb){_0x1a7faa[_0x4d4f('0x2f')]=_0x353fdb;if(_0x1a7faa[_0x4d4f('0xbf')]['UserId']){return db['User'][_0x4d4f('0x5c')]({'attributes':['id',_0x4d4f('0x3c')],'where':{'id':_0x1a7faa[_0x4d4f('0xbf')][_0x4d4f('0xcb')]}})[_0x4d4f('0x38')](function(_0x35ca63){if(_0x35ca63){_0x1a7faa[_0x4d4f('0xa4')][_0x4d4f('0xcc')]({'id':0x0,'priority':0x0,'app':_0x4d4f('0xcd'),'appdata':_0x35ca63[_0x4d4f('0x3c')]+','+(_0x1a7faa[_0x4d4f('0xa8')][_0x4d4f('0xce')]||0xa),'interval':_0x4d4f('0xc8')});_0x1a7faa[_0x4d4f('0xcf')]=!![];}return respondWithRpcPromise('Start',_0x4d4f('0xd0'),_0x1a7faa);});}return respondWithRpcPromise(_0x4d4f('0xd1'),_0x4d4f('0xd0'),_0x1a7faa);})[_0x4d4f('0x38')](function(_0x245429){respondWithRpcPromise('EventManager',_0x4d4f('0xd2'),{'event':'notify','message':_0x245429},client9002);return _0x245429;})['then'](respondWithResult(_0x1c39d3,null))[_0x4d4f('0x5d')](handleError(_0x1c39d3,null));};exports[_0x4d4f('0xd3')]=function(_0x342b34,_0x55690b,_0x5a4cad){var _0x172717,_0x3894e0,_0x1250d6;var _0x225979=[];var _0x410b3c=[];var _0x18080b={};return db[_0x4d4f('0xa0')][_0x4d4f('0x68')]()[_0x4d4f('0x38')](function(_0x3960e7){if(!_0x3960e7){throw new db[(_0x4d4f('0x24'))]['ValidationError'](_0x4d4f('0x94'));}_0x410b3c=_[_0x4d4f('0x95')](_[_0x4d4f('0x45')](_0x3960e7),[_0x4d4f('0x96'),_0x4d4f('0x97')]);_0x225979=_[_0x4d4f('0x95')](_[_0x4d4f('0x45')](_0x3960e7),[_0x4d4f('0x96'),_0x4d4f('0x97'),_0x4d4f('0x98'),_0x4d4f('0x99')]);if(_0x342b34[_0x4d4f('0x5f')]['id']){delete _0x342b34[_0x4d4f('0x5f')]['id'];}if(_['isNil'](_0x342b34['body'][_0x4d4f('0x9a')])){throw _0x55690b[_0x4d4f('0x31')](0x1f4)[_0x4d4f('0x3d')](new db['Sequelize'][(_0x4d4f('0x25'))](_0x4d4f('0xd4')));}if(_[_0x4d4f('0x85')](_0x342b34[_0x4d4f('0x5f')][_0x4d4f('0x5f')])||_0x342b34[_0x4d4f('0x5f')]['body']===''){throw _0x55690b[_0x4d4f('0x31')](0x1f4)[_0x4d4f('0x3d')](new db[(_0x4d4f('0x24'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4d4f('0x85')](_0x342b34[_0x4d4f('0x5f')]['mapKeyOffline'])){throw _0x55690b['status'](0x1f4)[_0x4d4f('0x3d')](new db[(_0x4d4f('0x24'))][(_0x4d4f('0x25'))](_0x4d4f('0xd5')+_0x225979));}if(!_[_0x4d4f('0x9e')](_0x225979,_0x342b34['body'][_0x4d4f('0xd6')])){throw _0x55690b['status'](0x1f4)[_0x4d4f('0x3d')](new db['Sequelize']['ValidationError'](_0x4d4f('0xd7')+_0x225979));}_0x18080b[_0x342b34['body'][_0x4d4f('0xd6')]]=_0x342b34[_0x4d4f('0x5f')][_0x4d4f('0x9a')];})[_0x4d4f('0x38')](function(){return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x342b34[_0x4d4f('0x5a')]['id']},'include':[{'model':db[_0x4d4f('0xd8')],'as':'List'}]});})[_0x4d4f('0x38')](handleEntityNotFound(_0x55690b,null))['then'](function(_0x1dad8e){if(_0x1dad8e&&_0x1dad8e[_0x4d4f('0x9f')]){_0x3894e0=_0x1dad8e;var _0x315eac=_[_0x4d4f('0xaa')](_0x342b34[_0x4d4f('0x5f')],{'firstName':_0x342b34[_0x4d4f('0x5f')]['from'],'phone':_0x342b34['body'][_0x4d4f('0x9a')],'ListId':_0x1dad8e[_0x4d4f('0x99')]});_0x315eac[_0x342b34[_0x4d4f('0x5f')][_0x4d4f('0xd6')]]=_0x342b34['body'][_0x4d4f('0x9a')];return db[_0x4d4f('0xa0')][_0x4d4f('0xd9')]({'where':_0x18080b,'defaults':_0x315eac});}})['spread'](function(_0x551a46){if(_0x551a46){_0x1250d6=_0x551a46;var _0x24aff0=fs[_0x4d4f('0xda')](path[_0x4d4f('0x7e')](config[_0x4d4f('0x7f')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x33c8b6=ejs['render'](_0x24aff0,{'body':_[_0x4d4f('0xdb')](_0x342b34[_0x4d4f('0x5f')][_0x4d4f('0x5f')]),'bodyTitle':_0x3894e0[_0x4d4f('0xdc')]});return db[_0x4d4f('0xdd')][_0x4d4f('0x5e')]({'body':_0x33c8b6,'ContactId':_0x551a46['id'],'ChatWebsiteId':_0x3894e0['id']});}})['then'](function(_0x2c9cb3){if(_0x2c9cb3){_0x172717=_0x2c9cb3;return db[_0x4d4f('0xde')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4d4f('0xdf')],'as':_0x4d4f('0xe0'),'raw':!![]}]});}})['then'](function(_0x3aa9ca){if(_0x3aa9ca&&_0x3aa9ca['Smtp']&&_0x3894e0[_0x4d4f('0xe1')]){var _0x1b6539={'tls':{'rejectUnauthorized':![]}};if(_0x3aa9ca['Smtp'][_0x4d4f('0xe2')]){_0x1b6539['service']=_0x3aa9ca[_0x4d4f('0xe0')][_0x4d4f('0xe2')];}else{_0x1b6539['host']=_0x3aa9ca[_0x4d4f('0xe0')][_0x4d4f('0xe3')];_0x1b6539['port']=_0x3aa9ca['Smtp'][_0x4d4f('0xe4')];_0x1b6539[_0x4d4f('0xe5')]=_0x3aa9ca[_0x4d4f('0xe0')]['secure'];}if(_0x3aa9ca[_0x4d4f('0xe0')][_0x4d4f('0xe6')]){_0x1b6539[_0x4d4f('0xe7')]={'user':_0x3aa9ca[_0x4d4f('0xe0')]['user'],'pass':_0x3aa9ca[_0x4d4f('0xe0')][_0x4d4f('0xe8')]};}return respondWithRpcPromise(_0x4d4f('0xe9'),_0x4d4f('0xea'),{'account':_0x1b6539,'message':{'from':util[_0x4d4f('0xb8')](_0x4d4f('0xeb'),_0x3aa9ca[_0x4d4f('0x3c')],_0x3aa9ca[_0x4d4f('0xec')]||_0x3aa9ca['Smtp'][_0x4d4f('0x60')]),'to':_0x3894e0['forwardOfflineAddress'],'subject':_0x3894e0['offlineMessageSubject'],'text':_0x172717['body']}},client9003)[_0x4d4f('0x38')](function(){return _0x172717;})[_0x4d4f('0x5d')](function(_0x22dd6f){console['error'](_0x22dd6f);});}})['then'](function(){if(_0x172717){return _0x172717;}})[_0x4d4f('0x38')](respondWithResult(_0x55690b,null))[_0x4d4f('0x5d')](handleError(_0x55690b,null));};exports[_0x4d4f('0xed')]=function(_0x56db21,_0x519d9a,_0x52dd6f){return db[_0x4d4f('0xbc')]['find']({'where':{'id':_0x56db21[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x519d9a,null))[_0x4d4f('0x38')](function(_0x36a16a){if(_0x36a16a){return _0x36a16a[_0x4d4f('0xed')](_0x56db21['body'][_0x4d4f('0x70')],_['omit'](_0x56db21[_0x4d4f('0x5f')],[_0x4d4f('0x70'),'id'])||{});}})[_0x4d4f('0x38')](respondWithResult(_0x519d9a,null))[_0x4d4f('0x5d')](handleError(_0x519d9a,null));};exports[_0x4d4f('0xee')]=function(_0x13a4d8,_0x4c49cc,_0x336a2b){var _0x272fe4={'raw':![],'where':{}};var _0x1ec939={};var _0x18c1a9={'count':0x0,'rows':[]};return db[_0x4d4f('0x55')][_0x4d4f('0x6b')]({'where':{'id':_0x13a4d8[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x4c49cc,null))['then'](function(_0x3f9700){if(_0x3f9700){_0x1ec939[_0x4d4f('0x43')]=_[_0x4d4f('0x45')](db['ChatInteraction']['rawAttributes']);_0x1ec939[_0x4d4f('0x44')]=_[_0x4d4f('0x45')](_0x13a4d8['query']);_0x1ec939[_0x4d4f('0x46')]=_[_0x4d4f('0x48')](_0x1ec939['model'],_0x1ec939[_0x4d4f('0x44')]);_0x272fe4[_0x4d4f('0x47')]=_[_0x4d4f('0x48')](_0x1ec939[_0x4d4f('0x43')],qs[_0x4d4f('0x49')](_0x13a4d8[_0x4d4f('0x44')][_0x4d4f('0x49')]));_0x272fe4[_0x4d4f('0x47')]=_0x272fe4[_0x4d4f('0x47')][_0x4d4f('0x5b')]?_0x272fe4[_0x4d4f('0x47')]:_0x1ec939[_0x4d4f('0x43')];if(!_0x13a4d8['query']['hasOwnProperty'](_0x4d4f('0x4b'))){_0x272fe4[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4c')](_0x13a4d8['query']['limit']);_0x272fe4[_0x4d4f('0x35')]=qs[_0x4d4f('0x35')](_0x13a4d8['query'][_0x4d4f('0x35')]);}_0x272fe4['order']=qs[_0x4d4f('0x4d')](_0x13a4d8['query']['sort']);_0x272fe4[_0x4d4f('0x4e')]=qs[_0x4d4f('0x46')](_['pick'](_0x13a4d8[_0x4d4f('0x44')],_0x1ec939['filters']));_0x272fe4['where'][_0x4d4f('0x6a')]=_0x3f9700['id'];if(_0x13a4d8['query'][_0x4d4f('0x50')]){_0x272fe4[_0x4d4f('0x4e')]=_[_0x4d4f('0x51')](_0x272fe4[_0x4d4f('0x4e')],{'$or':_[_0x4d4f('0x52')](_0x272fe4[_0x4d4f('0x47')],function(_0x489209){var _0x4b4dd8={};_0x4b4dd8[_0x489209]={'$like':'%'+_0x13a4d8[_0x4d4f('0x44')]['filter']+'%'};return _0x4b4dd8;})});}_0x272fe4=_['merge']({},_0x272fe4,_0x13a4d8[_0x4d4f('0xef')]);return db[_0x4d4f('0xbc')][_0x4d4f('0x34')]({'where':_0x272fe4[_0x4d4f('0x4e')]})['then'](function(_0x4974f2){_0x18c1a9[_0x4d4f('0x34')]=_0x4974f2;if(_0x13a4d8[_0x4d4f('0x44')][_0x4d4f('0x56')]){_0x272fe4['include']=[{'model':db[_0x4d4f('0xa0')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x4d4f('0xf0'),'attributes':[_0x4d4f('0x3c'),_0x4d4f('0xf1'),_0x4d4f('0xf2')],'required':![]},{'model':db['Tag'],'as':_0x4d4f('0xf3'),'attributes':['id',_0x4d4f('0x3c'),_0x4d4f('0xf4')],'where':_0x13a4d8[_0x4d4f('0x44')]['tag']?{'id':_0x13a4d8[_0x4d4f('0x44')][_0x4d4f('0xf5')]}:undefined,'required':_0x13a4d8[_0x4d4f('0x44')][_0x4d4f('0xf5')]?!![]:![]}];}return db[_0x4d4f('0xbc')]['findAll'](_0x272fe4);})['then'](function(_0xaeaafc){_0x18c1a9[_0x4d4f('0x6e')]=_0xaeaafc;return _0x18c1a9;});}})[_0x4d4f('0x38')](respondWithFilteredResult(_0x4c49cc,_0x272fe4))[_0x4d4f('0x5d')](handleError(_0x4c49cc,null));};function iftimePromise(_0x5d3d66,_0x461cad){return respondWithRpcPromise(_0x4d4f('0xf6'),'getSnippet',{'command':_0x461cad[_0x4d4f('0xf7')]?util['format'](_0x4d4f('0xf8'),_0x5d3d66[_0x4d4f('0xf9')],_0x461cad[_0x4d4f('0xf7')]):util[_0x4d4f('0xb8')]('iftime\x20%s',_0x5d3d66['interval'])},client9002)['then'](function(_0x172e40){var _0x505697=_0x172e40&&_0x172e40[_0x4d4f('0xfa')]('true')>=0x0?!![]:![];logger[_0x4d4f('0x27')](_0x4d4f('0xfb'),_0x461cad['id'],_0x5d3d66['id'],_0x5d3d66[_0x4d4f('0xf9')],_0x505697?_0x4d4f('0xfc'):_0x4d4f('0xfd'),_0x461cad['timezone']?_0x461cad[_0x4d4f('0xf7')]:_0x4d4f('0xfe'));return _0x505697;})[_0x4d4f('0x5d')](function(_0x5273de){logger[_0x4d4f('0x2e')](_0x4d4f('0xfb'),_0x461cad['id'],_0x5d3d66['id'],_0x5d3d66[_0x4d4f('0xf9')],util[_0x4d4f('0xff')](_0x5273de,{'showHidden':![],'depth':null}),_0x461cad[_0x4d4f('0xf7')]?_0x461cad[_0x4d4f('0xf7')]:_0x4d4f('0xfe'));return![];});}exports[_0x4d4f('0x100')]=function(_0x1bfec4,_0x4be852,_0x445aed){var _0x4f6bc7=0x0;var _0x40cb48=0x0;var _0x5d7a08=![];var _0x589b3b;var _0x3af444;return db[_0x4d4f('0x55')]['find']({'where':{'id':_0x1bfec4['params']['id']},'include':[{'model':db['Interval'],'as':_0x4d4f('0x101'),'include':[{'model':db[_0x4d4f('0x101')],'as':_0x4d4f('0x102'),'attributes':['id',_0x4d4f('0xf9')],'raw':!![]}]}]})[_0x4d4f('0x38')](handleEntityNotFound(_0x4be852,null))[_0x4d4f('0x38')](function(_0xc0f629){if(_0xc0f629){_0x589b3b=_0xc0f629;return _0xc0f629[_0x4d4f('0x103')]({'raw':!![]});}})['then'](function(_0x5bfde2){if(_0x589b3b){if(_0x5bfde2){_0x3af444=_0x5bfde2;}}return require(_0x4d4f('0x82'))[_0x4d4f('0x83')]();})[_0x4d4f('0x38')](function(_0x14e6ab){if(_0x14e6ab){_0x40cb48=_0x14e6ab[_0x4d4f('0x104')];_0x5d7a08=_0x14e6ab[_0x4d4f('0x84')];}})['then'](function(){return db[_0x4d4f('0xbc')]['count']({'where':{'closed':![]}});})[_0x4d4f('0x38')](function(_0x54fc61){_0x4f6bc7=_0x54fc61;if(_0x40cb48&&_0x54fc61>_0x40cb48){return db[_0x4d4f('0x105')][_0x4d4f('0x6b')]({'where':{'id':0x1}})[_0x4d4f('0x38')](function(_0x510875){if(_0x510875){_0x510875[_0x4d4f('0x106')](_0x4d4f('0x107'));}});}})['then'](function(){if(_0x589b3b[_0x4d4f('0x101')]&&_0x589b3b[_0x4d4f('0x101')][_0x4d4f('0x102')]){var _0x9436ae=[];for(var _0x56a90b=0x0;_0x56a90b<_0x589b3b['Interval']['Intervals']['length'];_0x56a90b++){var _0x41e7b9=_0x589b3b['Interval'][_0x4d4f('0x102')][_0x56a90b][_0x4d4f('0x3a')]({'plain':!![]});_0x9436ae[_0x4d4f('0x108')](iftimePromise(_0x41e7b9,_0x589b3b));}return BPromise[_0x4d4f('0x109')](_0x9436ae)[_0x4d4f('0x38')](function(_0x1b2c5f){return _['some'](_0x1b2c5f);});}else{return!![];}})[_0x4d4f('0x38')](function(_0x288209){var _0x364a2c=fs[_0x4d4f('0xda')](path['join'](config[_0x4d4f('0x7f')],_0x4d4f('0x10a')),_0x4d4f('0x10b'));var _0x229684={'remote':_0x589b3b[_0x4d4f('0x10c')],'query':querystring[_0x4d4f('0x2b')](_['merge'](_0x589b3b[_0x4d4f('0x3a')]({'plain':!![]}),{'customerIp':_0x1bfec4[_0x4d4f('0xac')][_0x4d4f('0xae')]||_0x1bfec4[_0x4d4f('0xac')][_0x4d4f('0x10d')]||_0x1bfec4[_0x4d4f('0x10e')][_0x4d4f('0x10f')]||_0x1bfec4['ip'],'referer':_0x1bfec4[_0x4d4f('0xac')][_0x4d4f('0xb3')],'openedInteractions':_0x4f6bc7,'maxInteractions':_0x40cb48,'virtual':_0x5d7a08[_0x4d4f('0x104')],'online':_0x288209,'custom':_0x5d7a08}))[_0x4d4f('0x110')](/'/g,'\x5c\x27')};_0x4be852[_0x4d4f('0x3d')](ejs[_0x4d4f('0x111')](Mustache[_0x4d4f('0x111')](_0x364a2c,_0x229684),{'proactiveActions':_0x3af444,'alignment':_0x589b3b['alignment'],'verticalAlignment':_0x589b3b[_0x4d4f('0x112')]}));})[_0x4d4f('0x5d')](handleError(_0x4be852,null));};exports[_0x4d4f('0x113')]=function(_0x83ee02,_0x3d80d7,_0x212c07){return db[_0x4d4f('0x55')][_0x4d4f('0x6b')]({'where':{'id':_0x83ee02[_0x4d4f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3d80d7,null))[_0x4d4f('0x38')](function(_0x570a9f){if(_0x570a9f){return db[_0x4d4f('0x114')]['transaction'](function(_0x3d90ca){return db['ChatApplication'][_0x4d4f('0x39')]({'where':{'ChatWebsiteId':_0x83ee02[_0x4d4f('0x5a')]['id']},'transaction':_0x3d90ca})[_0x4d4f('0x38')](function(_0x22066e){var _0xe34da6=_[_0x4d4f('0x52')](_0x83ee02['body'],function(_0x2fae9d){_0x2fae9d['ChatWebsiteId']=_0x83ee02[_0x4d4f('0x5a')]['id'];return _0x2fae9d;});return db['ChatApplication']['bulkCreate'](_0xe34da6,{'transaction':_0x3d90ca});});})[_0x4d4f('0x38')](function(){return db[_0x4d4f('0xa2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x83ee02[_0x4d4f('0x5a')]['id']},'order':_0x4d4f('0xa7')});});}})[_0x4d4f('0x38')](respondWithResult(_0x3d80d7,null))[_0x4d4f('0x5d')](handleError(_0x3d80d7,null));};exports[_0x4d4f('0x115')]=function(_0x57cce8,_0x48ca48,_0x9397e2){var _0x151d58={};var _0x25dc20={};var _0x5a08c7;var _0x1a16eb;return db[_0x4d4f('0x55')][_0x4d4f('0x6b')]({'where':{'id':_0x57cce8[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x48ca48,null))[_0x4d4f('0x38')](function(_0x19e037){if(_0x19e037){_0x5a08c7=_0x19e037;_0x25dc20[_0x4d4f('0x43')]=_[_0x4d4f('0x45')](db['ChatApplication'][_0x4d4f('0x41')]);_0x25dc20[_0x4d4f('0x44')]=_['keys'](_0x57cce8['query']);_0x25dc20[_0x4d4f('0x46')]=_[_0x4d4f('0x48')](_0x25dc20[_0x4d4f('0x43')],_0x25dc20[_0x4d4f('0x44')]);_0x151d58[_0x4d4f('0x47')]=_[_0x4d4f('0x48')](_0x25dc20['model'],qs[_0x4d4f('0x49')](_0x57cce8[_0x4d4f('0x44')][_0x4d4f('0x49')]));_0x151d58['attributes']=_0x151d58[_0x4d4f('0x47')][_0x4d4f('0x5b')]?_0x151d58['attributes']:_0x25dc20[_0x4d4f('0x43')];_0x151d58['order']=qs['sort'](_0x57cce8['query']['sort']);_0x151d58[_0x4d4f('0x4e')]=qs['filters'](_['pick'](_0x57cce8[_0x4d4f('0x44')],_0x25dc20[_0x4d4f('0x46')]));if(_0x57cce8['query']['filter']){_0x151d58[_0x4d4f('0x4e')]=_[_0x4d4f('0x51')](_0x151d58[_0x4d4f('0x4e')],{'$or':_[_0x4d4f('0x52')](_0x151d58[_0x4d4f('0x47')],function(_0x30ecfa){var _0x5ee54b={};_0x5ee54b[_0x30ecfa]={'$like':'%'+_0x57cce8[_0x4d4f('0x44')][_0x4d4f('0x50')]+'%'};return _0x5ee54b;})});}_0x151d58=_[_0x4d4f('0x51')]({},_0x151d58,_0x57cce8['options']);return _0x5a08c7['getApplications'](_0x151d58);}})['then'](function(_0x121f5c){if(_0x121f5c){_0x1a16eb=_0x121f5c[_0x4d4f('0x5b')];if(!_0x57cce8['query']['hasOwnProperty']('nolimit')){_0x151d58[_0x4d4f('0x4c')]=qs['limit'](_0x57cce8['query'][_0x4d4f('0x4c')]);_0x151d58[_0x4d4f('0x35')]=qs['offset'](_0x57cce8['query'][_0x4d4f('0x35')]);}return _0x5a08c7['getApplications'](_0x151d58);}})['then'](function(_0x2ff340){if(_0x2ff340){return _0x2ff340?{'count':_0x1a16eb,'rows':_0x2ff340}:null;}})['then'](respondWithResult(_0x48ca48,null))[_0x4d4f('0x5d')](handleError(_0x48ca48,null));};exports['addProactiveActions']=function(_0x18f2bc,_0x4d7909,_0x3f3f86){return db[_0x4d4f('0x116')][_0x4d4f('0x5c')]({'where':{'id':_0x18f2bc[_0x4d4f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d7909,null))['then'](function(_0x2bddd5){if(_0x2bddd5){return _0x2bddd5[_0x4d4f('0x117')](_0x18f2bc[_0x4d4f('0x5f')][_0x4d4f('0x70')],_[_0x4d4f('0x118')](_0x18f2bc[_0x4d4f('0x5f')],[_0x4d4f('0x70'),'id'])||{});}})['then'](respondWithResult(_0x4d7909,null))[_0x4d4f('0x5d')](handleError(_0x4d7909,null));};exports[_0x4d4f('0x103')]=function(_0x1f43f5,_0x27d341,_0x432880){var _0x20ac33={};var _0x4f79a6={};var _0x3b7ffc;var _0x225415;return db[_0x4d4f('0x55')][_0x4d4f('0x6b')]({'where':{'id':_0x1f43f5[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x27d341,null))[_0x4d4f('0x38')](function(_0x2ae6b7){if(_0x2ae6b7){_0x3b7ffc=_0x2ae6b7;_0x4f79a6['model']=_['keys'](db[_0x4d4f('0x119')][_0x4d4f('0x41')]);_0x4f79a6[_0x4d4f('0x44')]=_[_0x4d4f('0x45')](_0x1f43f5[_0x4d4f('0x44')]);_0x4f79a6[_0x4d4f('0x46')]=_['intersection'](_0x4f79a6[_0x4d4f('0x43')],_0x4f79a6['query']);_0x20ac33[_0x4d4f('0x47')]=_[_0x4d4f('0x48')](_0x4f79a6[_0x4d4f('0x43')],qs['fields'](_0x1f43f5[_0x4d4f('0x44')][_0x4d4f('0x49')]));_0x20ac33['attributes']=_0x20ac33[_0x4d4f('0x47')][_0x4d4f('0x5b')]?_0x20ac33[_0x4d4f('0x47')]:_0x4f79a6[_0x4d4f('0x43')];_0x20ac33[_0x4d4f('0x6c')]=qs[_0x4d4f('0x4d')](_0x1f43f5[_0x4d4f('0x44')][_0x4d4f('0x4d')]);_0x20ac33[_0x4d4f('0x4e')]=qs['filters'](_[_0x4d4f('0x4f')](_0x1f43f5[_0x4d4f('0x44')],_0x4f79a6[_0x4d4f('0x46')]));if(_0x1f43f5[_0x4d4f('0x44')][_0x4d4f('0x50')]){_0x20ac33[_0x4d4f('0x4e')]=_[_0x4d4f('0x51')](_0x20ac33[_0x4d4f('0x4e')],{'$or':_['map'](_0x20ac33[_0x4d4f('0x47')],function(_0x1542c2){var _0x2ff7d3={};_0x2ff7d3[_0x1542c2]={'$like':'%'+_0x1f43f5['query'][_0x4d4f('0x50')]+'%'};return _0x2ff7d3;})});}_0x20ac33=_[_0x4d4f('0x51')]({},_0x20ac33,_0x1f43f5[_0x4d4f('0xef')]);return _0x3b7ffc[_0x4d4f('0x103')](_0x20ac33);}})[_0x4d4f('0x38')](function(_0x188b9b){if(_0x188b9b){_0x225415=_0x188b9b[_0x4d4f('0x5b')];if(!_0x1f43f5[_0x4d4f('0x44')][_0x4d4f('0x4a')]('nolimit')){_0x20ac33[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4c')](_0x1f43f5[_0x4d4f('0x44')]['limit']);_0x20ac33[_0x4d4f('0x35')]=qs[_0x4d4f('0x35')](_0x1f43f5[_0x4d4f('0x44')][_0x4d4f('0x35')]);}return _0x3b7ffc[_0x4d4f('0x103')](_0x20ac33);}})[_0x4d4f('0x38')](function(_0x263529){if(_0x263529){return _0x263529?{'count':_0x225415,'rows':_0x263529}:null;}})[_0x4d4f('0x38')](respondWithResult(_0x27d341,null))[_0x4d4f('0x5d')](handleError(_0x27d341,null));};exports[_0x4d4f('0x11a')]=function(_0x55f460,_0x177951,_0x2e3d51){var _0x4695f7=_0x55f460['query'][_0x4d4f('0x11b')]===_0x4d4f('0x11c')?'offlineForm':'onlineForm';return db[_0x4d4f('0x55')]['find']({'attributes':['id',_0x4695f7],'where':{'id':_0x55f460[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x177951,null))[_0x4d4f('0x38')](function(_0x5d7644){if(_0x5d7644){var _0x31b6dd=_0x5d7644[_0x4695f7];var _0x2f14f9=_0x31b6dd&&_0x31b6dd[_0x4d4f('0x11d')]?_0x31b6dd[_0x4d4f('0x11d')]:[];_0x177951[_0x4d4f('0x3d')]({'fromKey':_[_0x4d4f('0x85')](_0x31b6dd[_0x4d4f('0x11e')])?undefined:_0x31b6dd['fromKey'],'count':_0x2f14f9['length'],'rows':_0x2f14f9});}})[_0x4d4f('0x5d')](handleError(_0x177951,null));};exports[_0x4d4f('0x11f')]=function(_0x324890,_0x5b6989,_0xe7e7ac){var _0x38ceaf={'raw':!![],'where':{}};var _0x1b4a3b={};var _0x40b15b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4d4f('0x6b')]({'where':{'id':_0x324890[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x5b6989,null))[_0x4d4f('0x38')](function(_0x49c78e){if(_0x49c78e){_0x1b4a3b[_0x4d4f('0x43')]=_[_0x4d4f('0x45')](db[_0x4d4f('0xdd')][_0x4d4f('0x41')]);_0x1b4a3b[_0x4d4f('0x44')]=_['keys'](_0x324890[_0x4d4f('0x44')]);_0x1b4a3b[_0x4d4f('0x46')]=_[_0x4d4f('0x48')](_0x1b4a3b[_0x4d4f('0x43')],_0x1b4a3b[_0x4d4f('0x44')]);_0x38ceaf[_0x4d4f('0x47')]=_['intersection'](_0x1b4a3b[_0x4d4f('0x43')],qs['fields'](_0x324890[_0x4d4f('0x44')][_0x4d4f('0x49')]));_0x38ceaf['attributes']=_0x38ceaf[_0x4d4f('0x47')][_0x4d4f('0x5b')]?_0x38ceaf[_0x4d4f('0x47')]:_0x1b4a3b['model'];if(!_0x324890[_0x4d4f('0x44')]['hasOwnProperty'](_0x4d4f('0x4b'))){_0x38ceaf[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4c')](_0x324890[_0x4d4f('0x44')]['limit']);_0x38ceaf['offset']=qs['offset'](_0x324890[_0x4d4f('0x44')][_0x4d4f('0x35')]);}_0x38ceaf['order']=qs[_0x4d4f('0x4d')](_0x324890['query']['sort']);_0x38ceaf[_0x4d4f('0x4e')]=qs[_0x4d4f('0x46')](_['pick'](_0x324890[_0x4d4f('0x44')],_0x1b4a3b[_0x4d4f('0x46')]));_0x38ceaf[_0x4d4f('0x4e')][_0x4d4f('0x6a')]=_0x49c78e['id'];if(_0x324890[_0x4d4f('0x44')][_0x4d4f('0x50')]){_0x38ceaf[_0x4d4f('0x4e')]=_[_0x4d4f('0x51')](_0x38ceaf[_0x4d4f('0x4e')],{'$or':_[_0x4d4f('0x52')](_0x38ceaf[_0x4d4f('0x47')],function(_0x27221d){var _0xfc86db={};_0xfc86db[_0x27221d]={'$like':'%'+_0x324890[_0x4d4f('0x44')][_0x4d4f('0x50')]+'%'};return _0xfc86db;})});}_0x38ceaf=_[_0x4d4f('0x51')]({},_0x38ceaf,_0x324890[_0x4d4f('0xef')]);return db[_0x4d4f('0xdd')]['count']({'where':_0x38ceaf[_0x4d4f('0x4e')]})['then'](function(_0x43c81b){_0x40b15b[_0x4d4f('0x34')]=_0x43c81b;if(_0x324890[_0x4d4f('0x44')][_0x4d4f('0x56')]){_0x38ceaf[_0x4d4f('0x57')]=[{'all':!![]}];}return db[_0x4d4f('0xdd')][_0x4d4f('0x58')](_0x38ceaf);})['then'](function(_0x378c24){_0x40b15b[_0x4d4f('0x6e')]=_0x378c24;return _0x40b15b;});}})[_0x4d4f('0x38')](respondWithFilteredResult(_0x5b6989,_0x38ceaf))[_0x4d4f('0x5d')](handleError(_0x5b6989,null));};exports[_0x4d4f('0x120')]=function(_0xf6d0c1,_0x13393d,_0x6ed6e2){return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0xf6d0c1[_0x4d4f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x13393d,null))[_0x4d4f('0x38')](function(_0xacb318){if(_0xacb318){return _0xacb318[_0x4d4f('0x120')](_0xf6d0c1[_0x4d4f('0x5f')][_0x4d4f('0x70')],_[_0x4d4f('0x118')](_0xf6d0c1[_0x4d4f('0x5f')],[_0x4d4f('0x70'),'id'])||{})[_0x4d4f('0xc0')](function(_0x53c0d7){for(var _0x335c26=0x0;_0x335c26<_0xf6d0c1['body'][_0x4d4f('0x70')][_0x4d4f('0x5b')];_0x335c26+=0x1){socket[_0x4d4f('0x121')](_0x4d4f('0x122'),{'UserId':_0xf6d0c1[_0x4d4f('0x5f')][_0x4d4f('0x70')][_0x335c26],'ChatWebsiteId':_0xf6d0c1[_0x4d4f('0x5a')]['id']});}return _0x53c0d7;});}})['then'](respondWithResult(_0x13393d,null))[_0x4d4f('0x5d')](handleError(_0x13393d,null));};exports[_0x4d4f('0x123')]=function(_0x5cd66a,_0x16d24a,_0x2368ca){return db[_0x4d4f('0x55')][_0x4d4f('0x5c')]({'where':{'id':_0x5cd66a[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x16d24a,null))[_0x4d4f('0x38')](function(_0x34aa9e){if(_0x34aa9e){return _0x34aa9e[_0x4d4f('0x123')](_0x5cd66a[_0x4d4f('0x44')][_0x4d4f('0x70')])[_0x4d4f('0x38')](function(){if(_[_0x4d4f('0x124')](_0x5cd66a[_0x4d4f('0x44')][_0x4d4f('0x70')])){for(var _0x2bba1e=0x0;_0x2bba1e<_0x5cd66a[_0x4d4f('0x44')][_0x4d4f('0x70')]['length'];_0x2bba1e+=0x1){socket[_0x4d4f('0x121')](_0x4d4f('0x125'),{'UserId':Number(_0x5cd66a[_0x4d4f('0x44')][_0x4d4f('0x70')][_0x2bba1e]),'ChatWebsiteId':Number(_0x5cd66a[_0x4d4f('0x5a')]['id'])});}}else{socket[_0x4d4f('0x121')](_0x4d4f('0x125'),{'UserId':Number(_0x5cd66a[_0x4d4f('0x44')][_0x4d4f('0x70')]),'ChatWebsiteId':Number(_0x5cd66a[_0x4d4f('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x16d24a,null))['catch'](handleError(_0x16d24a,null));};exports[_0x4d4f('0x126')]=function(_0x52fd08,_0x4d8395,_0x327939){var _0x23565d={};var _0x596dff={};var _0x4c8eec;var _0xe03316;return db[_0x4d4f('0x55')][_0x4d4f('0x6b')]({'where':{'id':_0x52fd08[_0x4d4f('0x5a')]['id']}})[_0x4d4f('0x38')](handleEntityNotFound(_0x4d8395,null))['then'](function(_0x1aa828){if(_0x1aa828){_0x4c8eec=_0x1aa828;_0x596dff['model']=_[_0x4d4f('0x45')](db[_0x4d4f('0x127')][_0x4d4f('0x41')]);_0x596dff['query']=_[_0x4d4f('0x45')](_0x52fd08[_0x4d4f('0x44')]);_0x596dff[_0x4d4f('0x46')]=_[_0x4d4f('0x48')](_0x596dff[_0x4d4f('0x43')],_0x596dff['query']);_0x23565d[_0x4d4f('0x47')]=_[_0x4d4f('0x48')](_0x596dff[_0x4d4f('0x43')],qs[_0x4d4f('0x49')](_0x52fd08[_0x4d4f('0x44')][_0x4d4f('0x49')]));_0x23565d['attributes']=_0x23565d[_0x4d4f('0x47')][_0x4d4f('0x5b')]?_0x23565d[_0x4d4f('0x47')]:_0x596dff[_0x4d4f('0x43')];_0x23565d[_0x4d4f('0x6c')]=qs[_0x4d4f('0x4d')](_0x52fd08['query'][_0x4d4f('0x4d')]);_0x23565d[_0x4d4f('0x4e')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x4f')](_0x52fd08[_0x4d4f('0x44')],_0x596dff['filters']));if(_0x52fd08[_0x4d4f('0x44')]['filter']){_0x23565d[_0x4d4f('0x4e')]=_['merge'](_0x23565d[_0x4d4f('0x4e')],{'$or':_[_0x4d4f('0x52')](_0x23565d['attributes'],function(_0x48163f){var _0x43b4b3={};_0x43b4b3[_0x48163f]={'$like':'%'+_0x52fd08[_0x4d4f('0x44')][_0x4d4f('0x50')]+'%'};return _0x43b4b3;})});}_0x23565d=_[_0x4d4f('0x51')]({},_0x23565d,_0x52fd08[_0x4d4f('0xef')]);return _0x4c8eec['getAgents'](_0x23565d);}})[_0x4d4f('0x38')](function(_0x2af54c){if(_0x2af54c){_0xe03316=_0x2af54c[_0x4d4f('0x5b')];if(!_0x52fd08[_0x4d4f('0x44')][_0x4d4f('0x4a')](_0x4d4f('0x4b'))){_0x23565d['limit']=qs[_0x4d4f('0x4c')](_0x52fd08['query'][_0x4d4f('0x4c')]);_0x23565d[_0x4d4f('0x35')]=qs[_0x4d4f('0x35')](_0x52fd08['query']['offset']);}return _0x4c8eec[_0x4d4f('0x126')](_0x23565d);}})[_0x4d4f('0x38')](function(_0xa8d08){if(_0xa8d08){return _0xa8d08?{'count':_0xe03316,'rows':_0xa8d08}:null;}})[_0x4d4f('0x38')](respondWithResult(_0x4d8395,null))['catch'](handleError(_0x4d8395,null));}; \ No newline at end of file +var _0xe3d4=['findAll','rows','catch','show','params','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatWebsites','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','contact','customerIp','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','format','\x22%s\x22\x20<%s>','offlineMessageSubject','addInteraction','Contact','fullname','Tag','color','tag','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','timezone','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.js','x-forwarded-for','x-real-ip','remoteAddress','replace','render','alignment','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','test','ValidationError','request','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','end','status','json','count','offset','set','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0xe3d4[_0x540133];return _0x26b6e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4e3d('0x0'));var rimraf=require(_0x4e3d('0x1'));var zipdir=require(_0x4e3d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e3d('0x3'));var moment=require(_0x4e3d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4e3d('0x5'));var util=require('util');var path=require(_0x4e3d('0x6'));var sox=require(_0x4e3d('0x7'));var csv=require('to-csv');var ejs=require(_0x4e3d('0x8'));var fs=require('fs');var _=require(_0x4e3d('0x9'));var squel=require('squel');var crypto=require(_0x4e3d('0xa'));var jsforce=require(_0x4e3d('0xb'));var deskjs=require(_0x4e3d('0xc'));var toCsv=require(_0x4e3d('0xd'));var querystring=require(_0x4e3d('0xe'));var Papa=require(_0x4e3d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e3d('0x10'));var as=require(_0x4e3d('0x11'));var hardwareService=require(_0x4e3d('0x12'));var logger=require(_0x4e3d('0x13'))(_0x4e3d('0x14'));var utils=require(_0x4e3d('0x15'));var config=require('../../config/environment');var db=require(_0x4e3d('0x16'))['db'];config[_0x4e3d('0x17')]=_[_0x4e3d('0x18')](config[_0x4e3d('0x17')],{'host':_0x4e3d('0x19'),'port':0x18eb});var socket=require(_0x4e3d('0x1a'))(new Redis(config[_0x4e3d('0x17')]));require(_0x4e3d('0x1b'))['register'](socket);var jayson=require(_0x4e3d('0x1c'));var client=jayson[_0x4e3d('0x1d')][_0x4e3d('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x4e3d('0x1e')]({'port':0x232a});var client9003=jayson[_0x4e3d('0x1d')][_0x4e3d('0x1e')]({'port':0x232b});function checkPasswordPattern(_0xc20768,_0x1b829e,_0x364798){if(_0x364798){var _0x28979d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28979d[_0x4e3d('0x1f')](_0x1b829e)){return _0xc20768;}else{throw new db['Sequelize'][(_0x4e3d('0x20'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xc20768;}}function respondWithRpcPromise(_0x4b74cb,_0x19010b,_0x493949,_0x5a2389){return new BPromise(function(_0x46b227,_0x2e37ad){var _0x30d938=_0x5a2389||client;return _0x30d938[_0x4e3d('0x21')](_0x4b74cb,_0x493949)['then'](function(_0x35d75c){logger['info'](_0x4e3d('0x22'),_0x19010b,'request\x20sent');logger[_0x4e3d('0x23')](_0x4e3d('0x24'),_0x19010b,_0x4e3d('0x25'),JSON[_0x4e3d('0x26')](_0x35d75c));if(_0x35d75c[_0x4e3d('0x27')]){if(_0x35d75c[_0x4e3d('0x27')]['code']===0x1f4){logger['error'](_0x4e3d('0x22'),_0x19010b,_0x35d75c[_0x4e3d('0x27')][_0x4e3d('0x28')]);return _0x2e37ad(_0x35d75c[_0x4e3d('0x27')][_0x4e3d('0x28')]);}logger['error'](_0x4e3d('0x22'),_0x19010b,_0x35d75c[_0x4e3d('0x27')][_0x4e3d('0x28')]);return _0x46b227(_0x35d75c['error'][_0x4e3d('0x28')]);}else{logger[_0x4e3d('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x19010b,_0x4e3d('0x25'));_0x46b227(_0x35d75c[_0x4e3d('0x2a')][_0x4e3d('0x28')]);}})['catch'](function(_0x727783){logger['error'](_0x4e3d('0x22'),_0x19010b,_0x727783);_0x2e37ad(_0x727783);});});}function respondWithStatusCode(_0x5271a1,_0x2edb44){_0x2edb44=_0x2edb44||0xcc;return function(_0x2d1991){if(_0x2d1991){return _0x5271a1[_0x4e3d('0x2b')](_0x2edb44);}return _0x5271a1['status'](_0x2edb44)[_0x4e3d('0x2c')]();};}function respondWithResult(_0x9133f9,_0x492788){_0x492788=_0x492788||0xc8;return function(_0x57816d){if(_0x57816d){return _0x9133f9[_0x4e3d('0x2d')](_0x492788)[_0x4e3d('0x2e')](_0x57816d);}};}function respondWithFilteredResult(_0x36621d,_0x49ba5b){return function(_0x4157e5){if(_0x4157e5){var _0x1be6aa=_0x4157e5[_0x4e3d('0x2f')],_0x5e0c3d=_0x49ba5b['offset'],_0x5108a7=_0x49ba5b[_0x4e3d('0x30')]+_0x49ba5b['limit'],_0x2b87b5;if(_0x5108a7>=_0x1be6aa){_0x5108a7=_0x1be6aa;_0x2b87b5=0xc8;}else{_0x2b87b5=0xce;}_0x36621d[_0x4e3d('0x2d')](_0x2b87b5);return _0x36621d[_0x4e3d('0x31')]('Content-Range',_0x5e0c3d+'-'+_0x5108a7+'/'+_0x1be6aa)[_0x4e3d('0x2e')](_0x4157e5);}return null;};}function patchUpdates(_0x22e2a7){return function(_0x199070){try{jsonpatch['apply'](_0x199070,_0x22e2a7,!![]);}catch(_0x1d83fe){return BPromise[_0x4e3d('0x32')](_0x1d83fe);}return _0x199070['save']();};}function saveUpdates(_0x8e1eed,_0x92a8aa){return function(_0x4b3ac7){if(_0x4b3ac7){return _0x4b3ac7[_0x4e3d('0x33')](_0x8e1eed)[_0x4e3d('0x34')](function(_0x2034bb){return _0x2034bb;});}return null;};}function removeEntity(_0x294b3d,_0x1a4d94){return function(_0x24830d){if(_0x24830d){return _0x24830d[_0x4e3d('0x35')]()[_0x4e3d('0x34')](function(){var _0x255b1d=_0x24830d[_0x4e3d('0x36')]({'plain':!![]});var _0x352672='ChatWebsites';return db[_0x4e3d('0x37')][_0x4e3d('0x35')]({'where':{'type':_0x352672,'resourceId':_0x255b1d['id']}})[_0x4e3d('0x34')](function(){return _0x24830d;});})[_0x4e3d('0x34')](function(){_0x294b3d[_0x4e3d('0x2d')](0xcc)[_0x4e3d('0x2c')]();});}};}function handleEntityNotFound(_0x4dc1f4,_0x24232c){return function(_0x28ff5f){if(!_0x28ff5f){_0x4dc1f4[_0x4e3d('0x2b')](0x194);}return _0x28ff5f;};}function handleError(_0x161f24,_0x36f4eb){_0x36f4eb=_0x36f4eb||0x1f4;return function(_0x27f97b){logger[_0x4e3d('0x27')](_0x27f97b[_0x4e3d('0x38')]);if(_0x27f97b[_0x4e3d('0x39')]){delete _0x27f97b[_0x4e3d('0x39')];}_0x161f24[_0x4e3d('0x2d')](_0x36f4eb)[_0x4e3d('0x3a')](_0x27f97b);};}exports[_0x4e3d('0x3b')]=function(_0x107788,_0x2f2778){var _0x5a7f82={'include':[{'model':db[_0x4e3d('0x3c')],'as':_0x4e3d('0x3d')}]},_0x44b8da={},_0x4e8745={'count':0x0,'rows':[]};var _0x1d8928=_[_0x4e3d('0x3e')](db[_0x4e3d('0x3f')][_0x4e3d('0x40')],function(_0x501d59){return{'name':_0x501d59[_0x4e3d('0x41')],'type':_0x501d59[_0x4e3d('0x42')][_0x4e3d('0x43')]};});_0x44b8da[_0x4e3d('0x44')]=_[_0x4e3d('0x3e')](_0x1d8928,'name');_0x44b8da['query']=_[_0x4e3d('0x45')](_0x107788[_0x4e3d('0x46')]);_0x44b8da[_0x4e3d('0x47')]=_['intersection'](_0x44b8da[_0x4e3d('0x44')],_0x44b8da[_0x4e3d('0x46')]);_0x5a7f82['attributes']=_[_0x4e3d('0x48')](_0x44b8da['model'],qs[_0x4e3d('0x49')](_0x107788[_0x4e3d('0x46')][_0x4e3d('0x49')]));_0x5a7f82['attributes']=_0x5a7f82[_0x4e3d('0x4a')]['length']?_0x5a7f82[_0x4e3d('0x4a')]:_0x44b8da[_0x4e3d('0x44')];if(!_0x107788[_0x4e3d('0x46')]['hasOwnProperty'](_0x4e3d('0x4b'))){_0x5a7f82[_0x4e3d('0x4c')]=qs[_0x4e3d('0x4c')](_0x107788[_0x4e3d('0x46')][_0x4e3d('0x4c')]);_0x5a7f82[_0x4e3d('0x30')]=qs[_0x4e3d('0x30')](_0x107788[_0x4e3d('0x46')][_0x4e3d('0x30')]);}_0x5a7f82[_0x4e3d('0x4d')]=qs['sort'](_0x107788[_0x4e3d('0x46')][_0x4e3d('0x4e')]);_0x5a7f82[_0x4e3d('0x4f')]=qs[_0x4e3d('0x47')](_[_0x4e3d('0x50')](_0x107788[_0x4e3d('0x46')],_0x44b8da[_0x4e3d('0x47')]));if(_0x107788[_0x4e3d('0x46')][_0x4e3d('0x51')]){_0x5a7f82[_0x4e3d('0x4f')]=_[_0x4e3d('0x52')](_0x5a7f82[_0x4e3d('0x4f')],{'$or':_['map'](_0x1d8928,function(_0x543cff){if(_0x543cff[_0x4e3d('0x42')]!=='VIRTUAL'){var _0xb400b7={};_0xb400b7[_0x543cff[_0x4e3d('0x39')]]={'$like':'%'+_0x107788[_0x4e3d('0x46')][_0x4e3d('0x51')]+'%'};return _0xb400b7;}})});}_0x5a7f82=_[_0x4e3d('0x52')]({},_0x5a7f82,_0x107788['options']);var _0x2266a1={'where':_0x5a7f82[_0x4e3d('0x4f')]};return db['ChatWebsite']['count'](_0x2266a1)['then'](function(_0x5e1f2e){_0x4e8745[_0x4e3d('0x2f')]=_0x5e1f2e;if(_0x107788[_0x4e3d('0x46')][_0x4e3d('0x53')]){_0x5a7f82[_0x4e3d('0x54')]=[{'all':!![]}];}return db[_0x4e3d('0x3f')][_0x4e3d('0x55')](_0x5a7f82);})[_0x4e3d('0x34')](function(_0x5c9bb5){_0x4e8745[_0x4e3d('0x56')]=_0x5c9bb5;return _0x4e8745;})[_0x4e3d('0x34')](respondWithFilteredResult(_0x2f2778,_0x5a7f82))[_0x4e3d('0x57')](handleError(_0x2f2778,null));};exports[_0x4e3d('0x58')]=function(_0x4bf687,_0x2c14cb){var _0x30cdf0={'raw':![],'where':{'id':_0x4bf687[_0x4e3d('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x4e3d('0x3d')}]},_0x433c70={};_0x433c70[_0x4e3d('0x44')]=_[_0x4e3d('0x45')](db['ChatWebsite'][_0x4e3d('0x40')]);_0x433c70[_0x4e3d('0x46')]=_['keys'](_0x4bf687['query']);_0x433c70[_0x4e3d('0x47')]=_[_0x4e3d('0x48')](_0x433c70[_0x4e3d('0x44')],_0x433c70[_0x4e3d('0x46')]);_0x30cdf0[_0x4e3d('0x4a')]=_['intersection'](_0x433c70['model'],qs[_0x4e3d('0x49')](_0x4bf687['query'][_0x4e3d('0x49')]));_0x30cdf0[_0x4e3d('0x4a')]=_0x30cdf0['attributes'][_0x4e3d('0x5a')]?_0x30cdf0[_0x4e3d('0x4a')]:_0x433c70['model'];if(_0x4bf687[_0x4e3d('0x46')]['includeAll']){_0x30cdf0[_0x4e3d('0x54')]=[{'all':!![]}];}_0x30cdf0=_[_0x4e3d('0x52')]({},_0x30cdf0,_0x4bf687[_0x4e3d('0x5b')]);return db['ChatWebsite'][_0x4e3d('0x5c')](_0x30cdf0)['then'](handleEntityNotFound(_0x2c14cb,null))['then'](respondWithResult(_0x2c14cb,null))[_0x4e3d('0x57')](handleError(_0x2c14cb,null));};exports[_0x4e3d('0x5d')]=function(_0x726f33,_0x30cbb0){return db[_0x4e3d('0x3f')]['create'](_0x726f33[_0x4e3d('0x5e')],{})['then'](function(_0x55c001){var _0x515c9b=_0x726f33['user'][_0x4e3d('0x36')]({'plain':!![]});if(!_0x515c9b)throw new Error(_0x4e3d('0x5f'));if(_0x515c9b[_0x4e3d('0x60')]===_0x4e3d('0x61')){var _0x1b843a=_0x55c001[_0x4e3d('0x36')]({'plain':!![]});var _0x64fbeb=_0x4e3d('0x62');return db[_0x4e3d('0x63')]['find']({'where':{'name':_0x64fbeb,'userProfileId':_0x515c9b[_0x4e3d('0x64')]},'raw':!![]})[_0x4e3d('0x34')](function(_0x1e983a){if(_0x1e983a&&_0x1e983a['autoAssociation']===0x0){return db['UserProfileResource'][_0x4e3d('0x5d')]({'name':_0x1b843a[_0x4e3d('0x39')],'resourceId':_0x1b843a['id'],'type':_0x1e983a[_0x4e3d('0x39')],'sectionId':_0x1e983a['id']},{})[_0x4e3d('0x34')](function(){return _0x55c001;});}else{return _0x55c001;}})[_0x4e3d('0x57')](function(_0x13803f){logger[_0x4e3d('0x27')](_0x4e3d('0x65'),_0x13803f);throw _0x13803f;});}return _0x55c001;})[_0x4e3d('0x34')](respondWithResult(_0x30cbb0,0xc9))[_0x4e3d('0x57')](handleError(_0x30cbb0,null));};exports[_0x4e3d('0x33')]=function(_0x5eaba7,_0x1bb8cf){if(_0x5eaba7[_0x4e3d('0x5e')]['id']){delete _0x5eaba7[_0x4e3d('0x5e')]['id'];}return db['ChatWebsite'][_0x4e3d('0x5c')]({'where':{'id':_0x5eaba7[_0x4e3d('0x59')]['id']},'include':[{'model':db[_0x4e3d('0x3c')],'as':_0x4e3d('0x3d')}]})[_0x4e3d('0x34')](handleEntityNotFound(_0x1bb8cf,null))[_0x4e3d('0x34')](saveUpdates(_0x5eaba7['body'],null))[_0x4e3d('0x34')](respondWithResult(_0x1bb8cf,null))[_0x4e3d('0x57')](handleError(_0x1bb8cf,null));};exports['destroy']=function(_0xc2acc4,_0x3839e0){return db['ChatWebsite']['find']({'where':{'id':_0xc2acc4[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x3839e0,null))[_0x4e3d('0x34')](removeEntity(_0x3839e0,null))['catch'](handleError(_0x3839e0,null));};exports[_0x4e3d('0x66')]=function(_0x500cbe,_0x562796){return db[_0x4e3d('0x3f')][_0x4e3d('0x66')]()['then'](respondWithResult(_0x562796,null))['catch'](handleError(_0x562796,null));};exports[_0x4e3d('0x67')]=function(_0x252a46,_0x1cda7e,_0x273f9b){if(_0x252a46[_0x4e3d('0x5e')]['id']){delete _0x252a46[_0x4e3d('0x5e')]['id'];}return db[_0x4e3d('0x3f')]['find']({'where':{'id':_0x252a46[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x1cda7e,null))[_0x4e3d('0x34')](function(_0x92e147){if(_0x92e147){_0x252a46['body']['ChatWebsiteId']=_0x92e147['id'];return db[_0x4e3d('0x68')][_0x4e3d('0x5d')](_0x252a46[_0x4e3d('0x5e')]);}})[_0x4e3d('0x34')](respondWithResult(_0x1cda7e,null))[_0x4e3d('0x57')](handleError(_0x1cda7e,null));};exports[_0x4e3d('0x69')]=function(_0x2fb993,_0x59cdd6,_0x3472f7){var _0x8bc195={'raw':![],'where':{}};var _0x29c290={};var _0x2b1ac7={'count':0x0,'rows':[]};return db[_0x4e3d('0x3f')][_0x4e3d('0x6a')]({'where':{'id':_0x2fb993[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x59cdd6,null))[_0x4e3d('0x34')](function(_0x592ee3){if(_0x592ee3){_0x29c290[_0x4e3d('0x44')]=_[_0x4e3d('0x45')](db[_0x4e3d('0x68')][_0x4e3d('0x40')]);_0x29c290['query']=_[_0x4e3d('0x45')](_0x2fb993[_0x4e3d('0x46')]);_0x29c290[_0x4e3d('0x47')]=_['intersection'](_0x29c290[_0x4e3d('0x44')],_0x29c290[_0x4e3d('0x46')]);_0x8bc195[_0x4e3d('0x4a')]=_[_0x4e3d('0x48')](_0x29c290[_0x4e3d('0x44')],qs[_0x4e3d('0x49')](_0x2fb993[_0x4e3d('0x46')][_0x4e3d('0x49')]));_0x8bc195[_0x4e3d('0x4a')]=_0x8bc195['attributes'][_0x4e3d('0x5a')]?_0x8bc195[_0x4e3d('0x4a')]:_0x29c290[_0x4e3d('0x44')];if(!_0x2fb993[_0x4e3d('0x46')]['hasOwnProperty']('nolimit')){_0x8bc195[_0x4e3d('0x4c')]=qs[_0x4e3d('0x4c')](_0x2fb993[_0x4e3d('0x46')]['limit']);_0x8bc195[_0x4e3d('0x30')]=qs[_0x4e3d('0x30')](_0x2fb993['query'][_0x4e3d('0x30')]);}_0x8bc195[_0x4e3d('0x4d')]=qs[_0x4e3d('0x4e')](_0x2fb993[_0x4e3d('0x46')]['sort']);_0x8bc195['where']=qs['filters'](_[_0x4e3d('0x50')](_0x2fb993['query'],_0x29c290['filters']));_0x8bc195['where'][_0x4e3d('0x6b')]=_0x592ee3['id'];if(_0x2fb993[_0x4e3d('0x46')][_0x4e3d('0x51')]){_0x8bc195[_0x4e3d('0x4f')]=_[_0x4e3d('0x52')](_0x8bc195[_0x4e3d('0x4f')],{'$or':_[_0x4e3d('0x3e')](_0x8bc195[_0x4e3d('0x4a')],function(_0x3ece3e){var _0x2317ca={};_0x2317ca[_0x3ece3e]={'$like':'%'+_0x2fb993['query'][_0x4e3d('0x51')]+'%'};return _0x2317ca;})});}_0x8bc195=_[_0x4e3d('0x52')]({},_0x8bc195,_0x2fb993[_0x4e3d('0x5b')]);return db[_0x4e3d('0x68')][_0x4e3d('0x2f')]({'where':_0x8bc195[_0x4e3d('0x4f')]})[_0x4e3d('0x34')](function(_0x1c493a){_0x2b1ac7['count']=_0x1c493a;if(_0x2fb993[_0x4e3d('0x46')][_0x4e3d('0x53')]){_0x8bc195[_0x4e3d('0x54')]=[{'all':!![]}];}return db[_0x4e3d('0x68')]['findAll'](_0x8bc195);})[_0x4e3d('0x34')](function(_0x4caddb){_0x2b1ac7[_0x4e3d('0x56')]=_0x4caddb;return _0x2b1ac7;});}})[_0x4e3d('0x34')](respondWithFilteredResult(_0x59cdd6,_0x8bc195))[_0x4e3d('0x57')](handleError(_0x59cdd6,null));};exports[_0x4e3d('0x6c')]=function(_0xb3f80e,_0x202805,_0x42a7b0){return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')]({'where':{'id':_0xb3f80e[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x202805,null))[_0x4e3d('0x34')](function(_0x2c7ee7){if(_0x2c7ee7){return _0x2c7ee7[_0x4e3d('0x6c')](_0xb3f80e[_0x4e3d('0x46')][_0x4e3d('0x6d')]);}})[_0x4e3d('0x34')](respondWithStatusCode(_0x202805,null))[_0x4e3d('0x57')](handleError(_0x202805,null));};exports[_0x4e3d('0x6e')]=function(_0x38f5a1,_0x21f4b1,_0x1455cb){if(_0x38f5a1[_0x4e3d('0x5e')]['id']){delete _0x38f5a1[_0x4e3d('0x5e')]['id'];}return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')]({'where':{'id':_0x38f5a1[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x21f4b1,null))['then'](function(_0x54af5b){if(_0x54af5b){_0x38f5a1[_0x4e3d('0x5e')][_0x4e3d('0x6b')]=_0x54af5b['id'];return db[_0x4e3d('0x6f')][_0x4e3d('0x5d')](_0x38f5a1[_0x4e3d('0x5e')]);}})[_0x4e3d('0x34')](respondWithResult(_0x21f4b1,null))[_0x4e3d('0x57')](handleError(_0x21f4b1,null));};exports[_0x4e3d('0x70')]=function(_0x3cad3a,_0x22c90f,_0x30e260){var _0x1129ca={'raw':![],'where':{}};var _0x3a1ccb={};var _0x5b8c49={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3cad3a[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x22c90f,null))['then'](function(_0x5b61ea){if(_0x5b61ea){_0x3a1ccb[_0x4e3d('0x44')]=_[_0x4e3d('0x45')](db[_0x4e3d('0x6f')][_0x4e3d('0x40')]);_0x3a1ccb['query']=_['keys'](_0x3cad3a['query']);_0x3a1ccb[_0x4e3d('0x47')]=_[_0x4e3d('0x48')](_0x3a1ccb[_0x4e3d('0x44')],_0x3a1ccb[_0x4e3d('0x46')]);_0x1129ca['attributes']=_['intersection'](_0x3a1ccb[_0x4e3d('0x44')],qs['fields'](_0x3cad3a[_0x4e3d('0x46')]['fields']));_0x1129ca['attributes']=_0x1129ca[_0x4e3d('0x4a')]['length']?_0x1129ca[_0x4e3d('0x4a')]:_0x3a1ccb[_0x4e3d('0x44')];if(!_0x3cad3a[_0x4e3d('0x46')][_0x4e3d('0x71')](_0x4e3d('0x4b'))){_0x1129ca[_0x4e3d('0x4c')]=qs[_0x4e3d('0x4c')](_0x3cad3a[_0x4e3d('0x46')]['limit']);_0x1129ca[_0x4e3d('0x30')]=qs['offset'](_0x3cad3a['query'][_0x4e3d('0x30')]);}_0x1129ca[_0x4e3d('0x4d')]=qs[_0x4e3d('0x4e')](_0x3cad3a[_0x4e3d('0x46')][_0x4e3d('0x4e')]);_0x1129ca['where']=qs[_0x4e3d('0x47')](_[_0x4e3d('0x50')](_0x3cad3a[_0x4e3d('0x46')],_0x3a1ccb[_0x4e3d('0x47')]));_0x1129ca['where']['ChatWebsiteId']=_0x5b61ea['id'];if(_0x3cad3a[_0x4e3d('0x46')][_0x4e3d('0x51')]){_0x1129ca[_0x4e3d('0x4f')]=_[_0x4e3d('0x52')](_0x1129ca[_0x4e3d('0x4f')],{'$or':_[_0x4e3d('0x3e')](_0x1129ca['attributes'],function(_0x294bd4){var _0x251893={};_0x251893[_0x294bd4]={'$like':'%'+_0x3cad3a[_0x4e3d('0x46')][_0x4e3d('0x51')]+'%'};return _0x251893;})});}_0x1129ca=_[_0x4e3d('0x52')]({},_0x1129ca,_0x3cad3a[_0x4e3d('0x5b')]);return db[_0x4e3d('0x6f')][_0x4e3d('0x2f')]({'where':_0x1129ca[_0x4e3d('0x4f')]})[_0x4e3d('0x34')](function(_0x416f0b){_0x5b8c49['count']=_0x416f0b;if(_0x3cad3a['query'][_0x4e3d('0x53')]){_0x1129ca[_0x4e3d('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4e3d('0x55')](_0x1129ca);})['then'](function(_0x5ce174){_0x5b8c49[_0x4e3d('0x56')]=_0x5ce174;return _0x5b8c49;});}})[_0x4e3d('0x34')](respondWithFilteredResult(_0x22c90f,_0x1129ca))[_0x4e3d('0x57')](handleError(_0x22c90f,null));};exports['removeAnswers']=function(_0x270fa7,_0x45ea50,_0x4612b8){return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')]({'where':{'id':_0x270fa7[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x45ea50,null))[_0x4e3d('0x34')](function(_0x48638b){if(_0x48638b){return _0x48638b[_0x4e3d('0x72')](_0x270fa7[_0x4e3d('0x46')][_0x4e3d('0x6d')]);}})[_0x4e3d('0x34')](respondWithStatusCode(_0x45ea50,null))[_0x4e3d('0x57')](handleError(_0x45ea50,null));};exports[_0x4e3d('0x73')]=function(_0x5570cd,_0x3be0b3,_0x51b545){_0x5570cd[_0x4e3d('0x5e')][_0x4e3d('0x74')]=_0x5570cd[_0x4e3d('0x75')]['filename'];return db[_0x4e3d('0x3f')]['find']({'where':{'id':_0x5570cd[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x3be0b3,null))[_0x4e3d('0x34')](saveUpdates(_0x5570cd['body'],null))[_0x4e3d('0x34')](respondWithResult(_0x3be0b3,null))['catch'](handleError(_0x3be0b3,null));};exports[_0x4e3d('0x76')]=function(_0x397ce5,_0x248e8c,_0x5037b1){_0x397ce5[_0x4e3d('0x5e')][_0x4e3d('0x77')]=_0x397ce5[_0x4e3d('0x75')][_0x4e3d('0x78')];return db['ChatWebsite'][_0x4e3d('0x5c')]({'where':{'id':_0x397ce5['params']['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x248e8c,null))[_0x4e3d('0x34')](saveUpdates(_0x397ce5[_0x4e3d('0x5e')],null))[_0x4e3d('0x34')](respondWithResult(_0x248e8c,null))[_0x4e3d('0x57')](handleError(_0x248e8c,null));};exports[_0x4e3d('0x79')]=function(_0x5654d4,_0x150bc1,_0x24efeb){_0x5654d4[_0x4e3d('0x5e')][_0x4e3d('0x7a')]=_0x5654d4[_0x4e3d('0x75')][_0x4e3d('0x78')];return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')]({'where':{'id':_0x5654d4[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x150bc1,null))[_0x4e3d('0x34')](saveUpdates(_0x5654d4[_0x4e3d('0x5e')],null))[_0x4e3d('0x34')](respondWithResult(_0x150bc1,null))[_0x4e3d('0x57')](handleError(_0x150bc1,null));};exports[_0x4e3d('0x7b')]=function(_0x50c589,_0x3bf56e,_0x2aee71){_0x50c589['body']['systemAvatar']=_0x50c589[_0x4e3d('0x75')][_0x4e3d('0x78')];return db[_0x4e3d('0x3f')]['find']({'where':{'id':_0x50c589[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x3bf56e,null))[_0x4e3d('0x34')](saveUpdates(_0x50c589[_0x4e3d('0x5e')],null))[_0x4e3d('0x34')](respondWithResult(_0x3bf56e,null))[_0x4e3d('0x57')](handleError(_0x3bf56e,null));};exports['getLogo']=function(_0x25da7b,_0x34784b,_0x570f3f){var _0x1dd627=path[_0x4e3d('0x7c')](config[_0x4e3d('0x7d')],'server/files/images/logos/default_logo.png');var _0x325d33={'where':{'id':_0x25da7b['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x91e566=![];return require('../../config/license/util')[_0x4e3d('0x7e')]()[_0x4e3d('0x34')](function(_0x58c4a6){if(_0x58c4a6){_0x91e566=_0x58c4a6['custom'];}})[_0x4e3d('0x34')](function(){return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')](_0x325d33);})['then'](handleEntityNotFound(_0x34784b,null))[_0x4e3d('0x34')](function(_0x421fcf){if(_0x421fcf){if(!_[_0x4e3d('0x7f')](_0x421fcf['sitepic'])){if(fs[_0x4e3d('0x80')](path['join'](config[_0x4e3d('0x7d')],_0x4e3d('0x81'),_0x421fcf[_0x4e3d('0x74')]))&&_0x91e566){_0x1dd627=path[_0x4e3d('0x7c')](config[_0x4e3d('0x7d')],_0x4e3d('0x81'),_0x421fcf[_0x4e3d('0x74')]);}}return _0x34784b[_0x4e3d('0x82')](_0x1dd627);}})[_0x4e3d('0x57')](handleError(_0x34784b,null));};exports[_0x4e3d('0x83')]=function(_0x8e778f,_0x41aa20,_0x277a8d){var _0x17bd98=path['join'](config[_0x4e3d('0x7d')],_0x4e3d('0x84'));var _0x4a8ce8={'where':{'id':_0x8e778f[_0x4e3d('0x59')]['id']},'attributes':['id',_0x4e3d('0x77')],'raw':!![]};return db[_0x4e3d('0x3f')]['find'](_0x4a8ce8)[_0x4e3d('0x34')](handleEntityNotFound(_0x41aa20,null))[_0x4e3d('0x34')](function(_0x155710){if(_0x155710){if(!_[_0x4e3d('0x7f')](_0x155710[_0x4e3d('0x77')])){if(fs[_0x4e3d('0x80')](path[_0x4e3d('0x7c')](config[_0x4e3d('0x7d')],_0x4e3d('0x85'),_0x155710[_0x4e3d('0x77')]))){_0x17bd98=path['join'](config[_0x4e3d('0x7d')],_0x4e3d('0x85'),_0x155710[_0x4e3d('0x77')]);}}return _0x41aa20[_0x4e3d('0x82')](_0x17bd98);}})[_0x4e3d('0x57')](handleError(_0x41aa20,null));};exports['getCustomerAvatar']=function(_0xf3317f,_0x5de6ac,_0x59660d){var _0x489070=path[_0x4e3d('0x7c')](config[_0x4e3d('0x7d')],_0x4e3d('0x86'));var _0x8ee723={'where':{'id':_0xf3317f[_0x4e3d('0x59')]['id']},'attributes':['id',_0x4e3d('0x7a'),'showCustomerAvatar'],'raw':!![]};return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')](_0x8ee723)['then'](handleEntityNotFound(_0x5de6ac,null))['then'](function(_0x5ea4f9){if(_0x5ea4f9){if(!_[_0x4e3d('0x7f')](_0x5ea4f9['customerAvatar'])){if(fs[_0x4e3d('0x80')](path['join'](config[_0x4e3d('0x7d')],_0x4e3d('0x85'),_0x5ea4f9[_0x4e3d('0x7a')]))&&_0x5ea4f9[_0x4e3d('0x87')]){_0x489070=path[_0x4e3d('0x7c')](config[_0x4e3d('0x7d')],_0x4e3d('0x85'),_0x5ea4f9[_0x4e3d('0x7a')]);}}return _0x5de6ac['download'](_0x489070);}})[_0x4e3d('0x57')](handleError(_0x5de6ac,null));};exports['getSystemAvatar']=function(_0x198ee7,_0x53c438,_0x550b9a){var _0x3c5adc=path[_0x4e3d('0x7c')](config[_0x4e3d('0x7d')],_0x4e3d('0x88'));var _0x27c5e2={'where':{'id':_0x198ee7[_0x4e3d('0x59')]['id']},'attributes':['id',_0x4e3d('0x89')],'raw':!![]};return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')](_0x27c5e2)[_0x4e3d('0x34')](handleEntityNotFound(_0x53c438,null))[_0x4e3d('0x34')](function(_0x59bd90){if(_0x59bd90){if(!_[_0x4e3d('0x7f')](_0x59bd90[_0x4e3d('0x89')])){if(fs['existsSync'](path['join'](config[_0x4e3d('0x7d')],_0x4e3d('0x85'),_0x59bd90[_0x4e3d('0x89')]))){_0x3c5adc=path[_0x4e3d('0x7c')](config['root'],_0x4e3d('0x85'),_0x59bd90[_0x4e3d('0x89')]);}}return _0x53c438[_0x4e3d('0x82')](_0x3c5adc);}})[_0x4e3d('0x57')](handleError(_0x53c438,null));};exports['notify']=function(_0x4ec0a8,_0x46aa98,_0x15e32c){var _0x262b3b=require(_0x4e3d('0x8a'));var _0x4dde6e=new _0x262b3b();var _0x258461=_0x4dde6e[_0x4e3d('0x8b')](_0x4ec0a8[_0x4e3d('0x8c')]['user-agent'])[_0x4e3d('0x8d')]();var _0x449321={'body':_0x4ec0a8['body'],'channel':'chat'};var _0x2a87db=[];var _0x9d05d=[];var _0x4d3a26={};var _0x38a21b=![];return db[_0x4e3d('0x8e')][_0x4e3d('0x66')]()[_0x4e3d('0x34')](function(_0x326ac2){if(!_0x326ac2){throw new db[(_0x4e3d('0x8f'))][(_0x4e3d('0x20'))](_0x4e3d('0x90'));}_0x2a87db=_[_0x4e3d('0x91')](_['keys'](_0x326ac2),[_0x4e3d('0x92'),_0x4e3d('0x93')]);_0x9d05d=_[_0x4e3d('0x91')](_[_0x4e3d('0x45')](_0x326ac2),[_0x4e3d('0x92'),'updatedAt','CompanyId',_0x4e3d('0x94')]);if(_0x4ec0a8[_0x4e3d('0x5e')]['id']){delete _0x4ec0a8[_0x4e3d('0x5e')]['id'];}if(_[_0x4e3d('0x7f')](_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0x95')])){throw new db[(_0x4e3d('0x8f'))][(_0x4e3d('0x20'))](_0x4e3d('0x96'));}if(_[_0x4e3d('0x7f')](_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0x5e')])||_0x4ec0a8['body'][_0x4e3d('0x5e')]===''){throw new db[(_0x4e3d('0x8f'))]['ValidationError'](_0x4e3d('0x97'));}if(_[_0x4e3d('0x7f')](_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0x98')])){throw new db[(_0x4e3d('0x8f'))][(_0x4e3d('0x20'))](_0x4e3d('0x99')+_0x9d05d);}if(!_[_0x4e3d('0x9a')](_0x9d05d,_0x4ec0a8['body'][_0x4e3d('0x98')])){throw new db[(_0x4e3d('0x8f'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9d05d);}_0x4d3a26[_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0x98')]]=_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0x95')];})[_0x4e3d('0x34')](function(){return db[_0x4e3d('0x3f')]['find']({'where':{'id':_0x4ec0a8[_0x4e3d('0x59')]['id']},'include':[{'model':db[_0x4e3d('0x9b')],'as':_0x4e3d('0x9c'),'include':[{'model':db['CmContact'],'as':_0x4e3d('0x9d'),'where':_0x4d3a26,'limit':0x1,'order':[['updatedAt',_0x4e3d('0x9e')]]}]},{'model':db['ChatApplication'],'as':_0x4e3d('0x9f')}]});})['then'](handleEntityNotFound(_0x46aa98,null))[_0x4e3d('0x34')](function(_0x50bf3c){if(_0x50bf3c&&_0x50bf3c[_0x4e3d('0x9c')]){_0x449321[_0x4e3d('0xa0')]=_0x50bf3c;_0x449321[_0x4e3d('0xa1')]=_0x50bf3c[_0x4e3d('0x9f')];_0x449321[_0x4e3d('0xa2')]=_0x50bf3c[_0x4e3d('0x9c')];_0x449321[_0x4e3d('0xa1')]=_[_0x4e3d('0xa3')](_0x449321[_0x4e3d('0xa1')],['priority'],['asc']);if(_0x449321['account'][_0x4e3d('0x9f')]){delete _0x449321['account'][_0x4e3d('0x9f')];}if(_0x449321[_0x4e3d('0xa0')][_0x4e3d('0x9c')]&&_0x449321[_0x4e3d('0xa0')][_0x4e3d('0x9c')][_0x4e3d('0x9d')][_0x4e3d('0x5a')]){return _0x449321[_0x4e3d('0xa0')][_0x4e3d('0x9c')][_0x4e3d('0x9d')][0x0];}var _0x3590e0=_[_0x4e3d('0x18')](_0x4ec0a8[_0x4e3d('0x5e')],{'firstName':_0x4ec0a8[_0x4e3d('0x5e')]['from'],'ListId':_0x50bf3c['ListId']});_0x3590e0[_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0x98')]]=_0x4ec0a8[_0x4e3d('0x5e')]['from'];return db[_0x4e3d('0x8e')][_0x4e3d('0x5d')](_0x3590e0,{'fields':_0x2a87db,'raw':!![]});}})[_0x4e3d('0x34')](handleEntityNotFound(_0x46aa98,null))[_0x4e3d('0x34')](function(_0x31f77e){_0x449321[_0x4e3d('0xa4')]=_0x31f77e;var _0x470489=_0x4ec0a8['body'][_0x4e3d('0xa5')];if(_0x4ec0a8[_0x4e3d('0x8c')]['cf-connecting-ip']){_0x470489=_0x4ec0a8[_0x4e3d('0x8c')]['cf-connecting-ip'];}else if(_0x4ec0a8['headers']['x-forwarded-for']){_0x470489=_[_0x4e3d('0xa6')](_0x4ec0a8[_0x4e3d('0x8c')]['x-forwarded-for'][_0x4e3d('0xa7')](','));}if(_0x31f77e){var _0x2e1788={'ContactId':_0x31f77e['id'],'ChatWebsiteId':_0x4ec0a8[_0x4e3d('0x59')]['id'],'from':(_0x31f77e[_0x4e3d('0xa8')]||'')+'\x20'+(_0x31f77e[_0x4e3d('0xa9')]||''),'customerIp':_0x470489,'customerPort':_0x4ec0a8[_0x4e3d('0x8c')][_0x4e3d('0xaa')]?_0x4ec0a8[_0x4e3d('0x8c')][_0x4e3d('0xaa')]:null,'referer':_0x4ec0a8['body'][_0x4e3d('0xab')],'browserName':_0x258461[_0x4e3d('0xac')][_0x4e3d('0x39')]&&_0x258461[_0x4e3d('0xac')][_0x4e3d('0xad')]?util['format'](_0x4e3d('0xae'),_0x258461[_0x4e3d('0xac')][_0x4e3d('0x39')],_0x258461[_0x4e3d('0xac')][_0x4e3d('0xad')]):'unknown','browserVersion':_0x258461[_0x4e3d('0xac')][_0x4e3d('0xad')]||_0x4e3d('0xaf'),'osName':util['format']('%s\x20%s',_0x258461['os'][_0x4e3d('0x39')],_0x258461['os'][_0x4e3d('0xad')]),'osVersion':_0x258461['os'][_0x4e3d('0xad')],'deviceModel':_0x258461['device'][_0x4e3d('0x44')]&&_0x258461[_0x4e3d('0xb0')][_0x4e3d('0xb1')]?util['format']('%s\x20%s\x20%s',_0x258461['device'][_0x4e3d('0x44')],_0x258461[_0x4e3d('0xb0')][_0x4e3d('0xb1')],_0x258461[_0x4e3d('0xb0')][_0x4e3d('0x42')]):null,'deviceVendor':_0x258461[_0x4e3d('0xb0')][_0x4e3d('0xb1')],'deviceType':_0x258461[_0x4e3d('0xb0')][_0x4e3d('0x42')],'formData':JSON['stringify'](_0x4ec0a8['body'])};var _0x4fb601={'ChatWebsiteId':_0x4ec0a8[_0x4e3d('0x59')]['id'],'closed':![]};if(_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0xb2')]){_0x4fb601[_0x4e3d('0xb2')]=_0x4ec0a8['body'][_0x4e3d('0xb2')];return db['ChatInteraction']['find']({'where':_0x4fb601})[_0x4e3d('0x34')](function(_0x4e463b){if(_0x4e463b){return[_0x4e463b,![]];}_0x2e1788[_0x4e3d('0xb2')]=_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0xb2')];_0x2e1788[_0x4e3d('0xb3')]=_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0xb3')];return db[_0x4e3d('0xb4')][_0x4e3d('0x5d')](_0x2e1788)[_0x4e3d('0x34')](function(_0x48718f){return[_0x48718f,!![]];});});}_0x4fb601[_0x4e3d('0xb5')]=_0x31f77e['id'];if(_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0xb6')]&&_0x4ec0a8['body'][_0x4e3d('0xb6')]['id']){_0x4fb601['id']=_0x4ec0a8[_0x4e3d('0x5e')]['interaction']['id'];return db['ChatInteraction'][_0x4e3d('0x5c')]({'where':_0x4fb601})['then'](function(_0x2661bb){if(_0x2661bb){return[_0x2661bb,![]];}return db[_0x4e3d('0xb4')][_0x4e3d('0x5d')](_0x2e1788)[_0x4e3d('0x34')](function(_0x6f9aaa){return[_0x6f9aaa,!![]];});});}return db['ChatInteraction'][_0x4e3d('0x5d')](_0x2e1788)[_0x4e3d('0x34')](function(_0x49a563){return[_0x49a563,!![]];});}})[_0x4e3d('0xb7')](function(_0x1cfec5,_0x34ef6f){if(_0x1cfec5){_0x38a21b=_0x34ef6f;if(!_0x34ef6f){var _0xfb7771={'from':(_0x449321[_0x4e3d('0xa4')]['firstName']||'')+'\x20'+(_0x449321['contact']['lastName']||'')};if(_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0xb2')]&&_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0xb8')]&&_0x4ec0a8['body'][_0x4e3d('0xb2')]!=_0x4ec0a8['body']['messageId']){_0xfb7771[_0x4e3d('0xb2')]=_0x4ec0a8[_0x4e3d('0x5e')][_0x4e3d('0xb8')];}return _0x1cfec5[_0x4e3d('0x33')](_0xfb7771);}else{return _0x1cfec5;}}})[_0x4e3d('0x34')](function(_0x2aeaa2){_0x449321[_0x4e3d('0xb6')]=_0x2aeaa2['get']({'plain':!![]});_0x449321[_0x4e3d('0xb6')]['created']=_0x38a21b;if(_0x449321[_0x4e3d('0xb6')]['created']){if(_0x449321['account'][_0x4e3d('0xb9')]){_0x449321[_0x4e3d('0xa1')]['push']({'id':0x0,'priority':_0x449321[_0x4e3d('0xa1')][_0x4e3d('0x5a')]+0x1,'app':_0x4e3d('0xba'),'appdata':_0x4e3d('0xbb'),'interval':_0x4e3d('0xbc')});}}return db[_0x4e3d('0xbd')]['create']({'body':_0x4ec0a8['body'][_0x4e3d('0x5e')],'ChatWebsiteId':_0x4ec0a8['params']['id'],'ChatInteractionId':_0x2aeaa2['id'],'direction':'in','ContactId':_0x449321[_0x4e3d('0xa4')]['id'],'AttachmentId':_0x4ec0a8[_0x4e3d('0x5e')]['AttachmentId']});})['then'](function(_0x171ce8){_0x449321[_0x4e3d('0x28')]=_0x171ce8;if(_0x449321['interaction'][_0x4e3d('0xbe')]){return db[_0x4e3d('0xbf')]['find']({'attributes':['id',_0x4e3d('0x39')],'where':{'id':_0x449321[_0x4e3d('0xb6')][_0x4e3d('0xbe')]}})['then'](function(_0x309d25){if(_0x309d25){_0x449321[_0x4e3d('0xa1')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4e3d('0xc0'),'appdata':_0x309d25['name']+','+(_0x449321[_0x4e3d('0xa0')][_0x4e3d('0xc1')]||0xa),'interval':_0x4e3d('0xbc')});_0x449321[_0x4e3d('0xc2')]=!![];}return respondWithRpcPromise(_0x4e3d('0xc3'),_0x4e3d('0xc4'),_0x449321);});}return respondWithRpcPromise('Start',_0x4e3d('0xc4'),_0x449321);})[_0x4e3d('0x34')](function(_0x4f28a1){respondWithRpcPromise(_0x4e3d('0xc5'),_0x4e3d('0xc5'),{'event':_0x4e3d('0xc6'),'message':_0x4f28a1},client9002);return _0x4f28a1;})[_0x4e3d('0x34')](respondWithResult(_0x46aa98,null))[_0x4e3d('0x57')](handleError(_0x46aa98,null));};exports[_0x4e3d('0xc7')]=function(_0x4ada6b,_0x31a948,_0x1059fc){var _0xc2e440,_0x46f622,_0x4f3e61;var _0x4ed77d=[];var _0x409347=[];var _0x5a86d8={};return db['CmContact']['describe']()[_0x4e3d('0x34')](function(_0x365e2f){if(!_0x365e2f){throw new db[(_0x4e3d('0x8f'))][(_0x4e3d('0x20'))]('no\x20available\x20attributes');}_0x409347=_[_0x4e3d('0x91')](_[_0x4e3d('0x45')](_0x365e2f),[_0x4e3d('0x92'),_0x4e3d('0x93')]);_0x4ed77d=_['difference'](_[_0x4e3d('0x45')](_0x365e2f),['createdAt',_0x4e3d('0x93'),_0x4e3d('0xc8'),_0x4e3d('0x94')]);if(_0x4ada6b[_0x4e3d('0x5e')]['id']){delete _0x4ada6b[_0x4e3d('0x5e')]['id'];}if(_[_0x4e3d('0x7f')](_0x4ada6b['body'][_0x4e3d('0x95')])){throw _0x31a948[_0x4e3d('0x2d')](0x1f4)[_0x4e3d('0x3a')](new db[(_0x4e3d('0x8f'))][(_0x4e3d('0x20'))](_0x4e3d('0x96')));}if(_[_0x4e3d('0x7f')](_0x4ada6b[_0x4e3d('0x5e')][_0x4e3d('0x5e')])||_0x4ada6b[_0x4e3d('0x5e')]['body']===''){throw _0x31a948['status'](0x1f4)[_0x4e3d('0x3a')](new db[(_0x4e3d('0x8f'))]['ValidationError'](_0x4e3d('0x97')));}if(_['isNil'](_0x4ada6b[_0x4e3d('0x5e')][_0x4e3d('0xc9')])){throw _0x31a948['status'](0x1f4)[_0x4e3d('0x3a')](new db[(_0x4e3d('0x8f'))][(_0x4e3d('0x20'))](_0x4e3d('0xca')+_0x4ed77d));}if(!_[_0x4e3d('0x9a')](_0x4ed77d,_0x4ada6b[_0x4e3d('0x5e')][_0x4e3d('0xc9')])){throw _0x31a948['status'](0x1f4)['send'](new db[(_0x4e3d('0x8f'))]['ValidationError'](_0x4e3d('0xcb')+_0x4ed77d));}_0x5a86d8[_0x4ada6b[_0x4e3d('0x5e')]['mapKeyOffline']]=_0x4ada6b[_0x4e3d('0x5e')][_0x4e3d('0x95')];})[_0x4e3d('0x34')](function(){return db['ChatWebsite'][_0x4e3d('0x5c')]({'where':{'id':_0x4ada6b[_0x4e3d('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x4e3d('0x9c')}]});})['then'](handleEntityNotFound(_0x31a948,null))['then'](function(_0xc4643f){if(_0xc4643f&&_0xc4643f['List']){_0x46f622=_0xc4643f;var _0x4a81af=_[_0x4e3d('0x18')](_0x4ada6b[_0x4e3d('0x5e')],{'firstName':_0x4ada6b[_0x4e3d('0x5e')]['from'],'phone':_0x4ada6b[_0x4e3d('0x5e')]['from'],'ListId':_0xc4643f['ListId']});_0x4a81af[_0x4ada6b['body']['mapKeyOffline']]=_0x4ada6b[_0x4e3d('0x5e')][_0x4e3d('0x95')];return db['CmContact']['findOrCreate']({'where':_0x5a86d8,'defaults':_0x4a81af});}})[_0x4e3d('0xb7')](function(_0x2a6a63){if(_0x2a6a63){_0x4f3e61=_0x2a6a63;var _0x40ec56=fs[_0x4e3d('0xcc')](path[_0x4e3d('0x7c')](config[_0x4e3d('0x7d')],_0x4e3d('0xcd')),_0x4e3d('0xce'));var _0xbbe865=ejs['render'](_0x40ec56,{'body':_[_0x4e3d('0xcf')](_0x4ada6b[_0x4e3d('0x5e')][_0x4e3d('0x5e')]),'bodyTitle':_0x46f622[_0x4e3d('0xd0')]});return db[_0x4e3d('0xd1')][_0x4e3d('0x5d')]({'body':_0xbbe865,'ContactId':_0x2a6a63['id'],'ChatWebsiteId':_0x46f622['id']});}})['then'](function(_0xcb9350){if(_0xcb9350){_0xc2e440=_0xcb9350;return db[_0x4e3d('0xd2')][_0x4e3d('0x6a')]({'where':{'service':!![]},'include':[{'model':db[_0x4e3d('0xd3')],'as':_0x4e3d('0xd4'),'raw':!![]}]});}})[_0x4e3d('0x34')](function(_0x1d17b2){if(_0x1d17b2&&_0x1d17b2[_0x4e3d('0xd4')]&&_0x46f622[_0x4e3d('0xd5')]){var _0x54ca43={'tls':{'rejectUnauthorized':![]}};if(_0x1d17b2[_0x4e3d('0xd4')][_0x4e3d('0xd6')]){_0x54ca43[_0x4e3d('0xd6')]=_0x1d17b2[_0x4e3d('0xd4')][_0x4e3d('0xd6')];}else{_0x54ca43[_0x4e3d('0xd7')]=_0x1d17b2['Smtp'][_0x4e3d('0xd7')];_0x54ca43[_0x4e3d('0xd8')]=_0x1d17b2['Smtp'][_0x4e3d('0xd8')];_0x54ca43[_0x4e3d('0xd9')]=_0x1d17b2[_0x4e3d('0xd4')][_0x4e3d('0xd9')];}if(_0x1d17b2[_0x4e3d('0xd4')]['authentication']){_0x54ca43[_0x4e3d('0xda')]={'user':_0x1d17b2[_0x4e3d('0xd4')]['user'],'pass':_0x1d17b2[_0x4e3d('0xd4')][_0x4e3d('0xdb')]};}return respondWithRpcPromise(_0x4e3d('0xdc'),_0x4e3d('0xdd'),{'account':_0x54ca43,'message':{'from':util[_0x4e3d('0xde')](_0x4e3d('0xdf'),_0x1d17b2[_0x4e3d('0x39')],_0x1d17b2['email']||_0x1d17b2[_0x4e3d('0xd4')][_0x4e3d('0x61')]),'to':_0x46f622['forwardOfflineAddress'],'subject':_0x46f622[_0x4e3d('0xe0')],'text':_0xc2e440['body']}},client9003)[_0x4e3d('0x34')](function(){return _0xc2e440;})[_0x4e3d('0x57')](function(_0x2ec9dc){console[_0x4e3d('0x27')](_0x2ec9dc);});}})[_0x4e3d('0x34')](function(){if(_0xc2e440){return _0xc2e440;}})[_0x4e3d('0x34')](respondWithResult(_0x31a948,null))[_0x4e3d('0x57')](handleError(_0x31a948,null));};exports[_0x4e3d('0xe1')]=function(_0xc91478,_0xee8572,_0x4f9e00){return db[_0x4e3d('0xb4')][_0x4e3d('0x5c')]({'where':{'id':_0xc91478[_0x4e3d('0x59')]['id']}})['then'](handleEntityNotFound(_0xee8572,null))[_0x4e3d('0x34')](function(_0x4ad5e9){if(_0x4ad5e9){return _0x4ad5e9['addInteraction'](_0xc91478['body']['ids'],_['omit'](_0xc91478['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xee8572,null))[_0x4e3d('0x57')](handleError(_0xee8572,null));};exports['getInteractions']=function(_0x472adb,_0x1d6cee,_0x2c6894){var _0x1a72b6={'raw':![],'where':{}};var _0x147859={};var _0x375757={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4e3d('0x6a')]({'where':{'id':_0x472adb[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x1d6cee,null))['then'](function(_0x5407a8){if(_0x5407a8){_0x147859[_0x4e3d('0x44')]=_[_0x4e3d('0x45')](db[_0x4e3d('0xb4')][_0x4e3d('0x40')]);_0x147859[_0x4e3d('0x46')]=_[_0x4e3d('0x45')](_0x472adb['query']);_0x147859['filters']=_['intersection'](_0x147859[_0x4e3d('0x44')],_0x147859['query']);_0x1a72b6[_0x4e3d('0x4a')]=_[_0x4e3d('0x48')](_0x147859[_0x4e3d('0x44')],qs[_0x4e3d('0x49')](_0x472adb[_0x4e3d('0x46')][_0x4e3d('0x49')]));_0x1a72b6[_0x4e3d('0x4a')]=_0x1a72b6['attributes'][_0x4e3d('0x5a')]?_0x1a72b6[_0x4e3d('0x4a')]:_0x147859[_0x4e3d('0x44')];if(!_0x472adb[_0x4e3d('0x46')][_0x4e3d('0x71')](_0x4e3d('0x4b'))){_0x1a72b6[_0x4e3d('0x4c')]=qs[_0x4e3d('0x4c')](_0x472adb[_0x4e3d('0x46')][_0x4e3d('0x4c')]);_0x1a72b6[_0x4e3d('0x30')]=qs[_0x4e3d('0x30')](_0x472adb['query'][_0x4e3d('0x30')]);}_0x1a72b6[_0x4e3d('0x4d')]=qs[_0x4e3d('0x4e')](_0x472adb['query']['sort']);_0x1a72b6[_0x4e3d('0x4f')]=qs['filters'](_[_0x4e3d('0x50')](_0x472adb[_0x4e3d('0x46')],_0x147859[_0x4e3d('0x47')]));_0x1a72b6['where'][_0x4e3d('0x6b')]=_0x5407a8['id'];if(_0x472adb['query'][_0x4e3d('0x51')]){_0x1a72b6[_0x4e3d('0x4f')]=_[_0x4e3d('0x52')](_0x1a72b6[_0x4e3d('0x4f')],{'$or':_[_0x4e3d('0x3e')](_0x1a72b6['attributes'],function(_0x4d2c38){var _0x208cb3={};_0x208cb3[_0x4d2c38]={'$like':'%'+_0x472adb['query'][_0x4e3d('0x51')]+'%'};return _0x208cb3;})});}_0x1a72b6=_[_0x4e3d('0x52')]({},_0x1a72b6,_0x472adb['options']);return db[_0x4e3d('0xb4')]['count']({'where':_0x1a72b6[_0x4e3d('0x4f')]})['then'](function(_0x1d7af2){_0x375757[_0x4e3d('0x2f')]=_0x1d7af2;if(_0x472adb[_0x4e3d('0x46')][_0x4e3d('0x53')]){_0x1a72b6[_0x4e3d('0x54')]=[{'model':db[_0x4e3d('0x8e')],'as':_0x4e3d('0xe2'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x4e3d('0x39'),_0x4e3d('0xe3'),'internal'],'required':![]},{'model':db[_0x4e3d('0xe4')],'as':'Tags','attributes':['id',_0x4e3d('0x39'),_0x4e3d('0xe5')],'where':_0x472adb[_0x4e3d('0x46')]['tag']?{'id':_0x472adb['query'][_0x4e3d('0xe6')]}:undefined,'required':_0x472adb[_0x4e3d('0x46')]['tag']?!![]:![]}];}return db[_0x4e3d('0xb4')][_0x4e3d('0x55')](_0x1a72b6);})[_0x4e3d('0x34')](function(_0x2e0ffc){_0x375757['rows']=_0x2e0ffc;return _0x375757;});}})[_0x4e3d('0x34')](respondWithFilteredResult(_0x1d6cee,_0x1a72b6))['catch'](handleError(_0x1d6cee,null));};function iftimePromise(_0x309b68,_0x232345){return respondWithRpcPromise('Command','getSnippet',{'command':_0x232345['timezone']?util[_0x4e3d('0xde')]('iftime\x20%s,%s',_0x309b68[_0x4e3d('0xe7')],_0x232345['timezone']):util[_0x4e3d('0xde')](_0x4e3d('0xe8'),_0x309b68[_0x4e3d('0xe7')])},client9002)[_0x4e3d('0x34')](function(_0x173246){var _0x19a4bc=_0x173246&&_0x173246[_0x4e3d('0xe9')](_0x4e3d('0xea'))>=0x0?!![]:![];logger['info'](_0x4e3d('0xeb'),_0x232345['id'],_0x309b68['id'],_0x309b68[_0x4e3d('0xe7')],_0x19a4bc?_0x4e3d('0xec'):'OFFLINE',_0x232345[_0x4e3d('0xed')]?_0x232345[_0x4e3d('0xed')]:_0x4e3d('0xee'));return _0x19a4bc;})[_0x4e3d('0x57')](function(_0x106067){logger[_0x4e3d('0x27')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x232345['id'],_0x309b68['id'],_0x309b68[_0x4e3d('0xe7')],util[_0x4e3d('0xef')](_0x106067,{'showHidden':![],'depth':null}),_0x232345[_0x4e3d('0xed')]?_0x232345[_0x4e3d('0xed')]:'No\x20timezone');return![];});}exports[_0x4e3d('0xf0')]=function(_0x2229fb,_0x29fe9e,_0x1003d1){var _0x2ebf00=0x0;var _0xc47d99=0x0;var _0x4af330=![];var _0x4b96ac;var _0x19e27a;return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')]({'where':{'id':_0x2229fb['params']['id']},'include':[{'model':db[_0x4e3d('0xf1')],'as':'Interval','include':[{'model':db[_0x4e3d('0xf1')],'as':_0x4e3d('0xf2'),'attributes':['id',_0x4e3d('0xe7')],'raw':!![]}]}]})[_0x4e3d('0x34')](handleEntityNotFound(_0x29fe9e,null))[_0x4e3d('0x34')](function(_0x4c731b){if(_0x4c731b){_0x4b96ac=_0x4c731b;return _0x4c731b[_0x4e3d('0xf3')]({'raw':!![]});}})['then'](function(_0x162d57){if(_0x4b96ac){if(_0x162d57){_0x19e27a=_0x162d57;}}return require(_0x4e3d('0xf4'))[_0x4e3d('0x7e')]();})[_0x4e3d('0x34')](function(_0x5ccabb){if(_0x5ccabb){_0xc47d99=_0x5ccabb[_0x4e3d('0xf5')];_0x4af330=_0x5ccabb['custom'];}})[_0x4e3d('0x34')](function(){return db['ChatInteraction'][_0x4e3d('0x2f')]({'where':{'closed':![]}});})[_0x4e3d('0x34')](function(_0x318a77){_0x2ebf00=_0x318a77;if(_0xc47d99&&_0x318a77>_0xc47d99){return db['License'][_0x4e3d('0x6a')]({'where':{'id':0x1}})[_0x4e3d('0x34')](function(_0x25f2ea){if(_0x25f2ea){_0x25f2ea[_0x4e3d('0xf6')](_0x4e3d('0xf7'));}});}})[_0x4e3d('0x34')](function(){if(_0x4b96ac[_0x4e3d('0xf1')]&&_0x4b96ac[_0x4e3d('0xf1')][_0x4e3d('0xf2')]){var _0x5f431e=[];for(var _0x457811=0x0;_0x457811<_0x4b96ac[_0x4e3d('0xf1')][_0x4e3d('0xf2')][_0x4e3d('0x5a')];_0x457811++){var _0x338ad1=_0x4b96ac['Interval'][_0x4e3d('0xf2')][_0x457811]['get']({'plain':!![]});_0x5f431e[_0x4e3d('0xf8')](iftimePromise(_0x338ad1,_0x4b96ac));}return BPromise[_0x4e3d('0xf9')](_0x5f431e)[_0x4e3d('0x34')](function(_0x469017){return _[_0x4e3d('0xfa')](_0x469017);});}else{return!![];}})[_0x4e3d('0x34')](function(_0xa5a3ac){var _0x18322c=fs[_0x4e3d('0xcc')](path['join'](config[_0x4e3d('0x7d')],_0x4e3d('0xfb')),'utf8');var _0x220d90={'remote':_0x4b96ac['remote'],'query':querystring['stringify'](_['merge'](_0x4b96ac[_0x4e3d('0x36')]({'plain':!![]}),{'customerIp':_0x2229fb[_0x4e3d('0x8c')][_0x4e3d('0xfc')]||_0x2229fb[_0x4e3d('0x8c')][_0x4e3d('0xfd')]||_0x2229fb['connection'][_0x4e3d('0xfe')]||_0x2229fb['ip'],'referer':_0x2229fb[_0x4e3d('0x8c')][_0x4e3d('0xab')],'openedInteractions':_0x2ebf00,'maxInteractions':_0xc47d99,'virtual':_0x4af330[_0x4e3d('0xf5')],'online':_0xa5a3ac,'custom':_0x4af330}))[_0x4e3d('0xff')](/'/g,'\x5c\x27')};_0x29fe9e[_0x4e3d('0x3a')](ejs[_0x4e3d('0x100')](Mustache[_0x4e3d('0x100')](_0x18322c,_0x220d90),{'proactiveActions':_0x19e27a,'alignment':_0x4b96ac[_0x4e3d('0x101')],'verticalAlignment':_0x4b96ac[_0x4e3d('0x102')]}));})[_0x4e3d('0x57')](handleError(_0x29fe9e,null));};exports[_0x4e3d('0x103')]=function(_0x534d56,_0x1dd795,_0x5010a1){return db['ChatWebsite'][_0x4e3d('0x6a')]({'where':{'id':_0x534d56[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x1dd795,null))[_0x4e3d('0x34')](function(_0x8c7795){if(_0x8c7795){return db[_0x4e3d('0x104')][_0x4e3d('0x105')](function(_0x5cd07c){return db[_0x4e3d('0x106')]['destroy']({'where':{'ChatWebsiteId':_0x534d56['params']['id']},'transaction':_0x5cd07c})[_0x4e3d('0x34')](function(_0x30c467){var _0x4f30ae=_[_0x4e3d('0x3e')](_0x534d56[_0x4e3d('0x5e')],function(_0x12fde1){_0x12fde1['ChatWebsiteId']=_0x534d56['params']['id'];return _0x12fde1;});return db[_0x4e3d('0x106')][_0x4e3d('0x107')](_0x4f30ae,{'transaction':_0x5cd07c});});})[_0x4e3d('0x34')](function(){return db[_0x4e3d('0x106')][_0x4e3d('0x108')]({'where':{'ChatWebsiteId':_0x534d56[_0x4e3d('0x59')]['id']},'order':_0x4e3d('0x109')});});}})[_0x4e3d('0x34')](respondWithResult(_0x1dd795,null))[_0x4e3d('0x57')](handleError(_0x1dd795,null));};exports[_0x4e3d('0x10a')]=function(_0xe4607f,_0x375178,_0x3be9e8){var _0x5eca7c={};var _0x46eeeb={};var _0x409d40;var _0x4ebf64;return db['ChatWebsite']['findOne']({'where':{'id':_0xe4607f['params']['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x375178,null))[_0x4e3d('0x34')](function(_0x5aee6f){if(_0x5aee6f){_0x409d40=_0x5aee6f;_0x46eeeb[_0x4e3d('0x44')]=_[_0x4e3d('0x45')](db[_0x4e3d('0x106')]['rawAttributes']);_0x46eeeb['query']=_['keys'](_0xe4607f[_0x4e3d('0x46')]);_0x46eeeb[_0x4e3d('0x47')]=_[_0x4e3d('0x48')](_0x46eeeb[_0x4e3d('0x44')],_0x46eeeb[_0x4e3d('0x46')]);_0x5eca7c[_0x4e3d('0x4a')]=_['intersection'](_0x46eeeb[_0x4e3d('0x44')],qs[_0x4e3d('0x49')](_0xe4607f['query'][_0x4e3d('0x49')]));_0x5eca7c['attributes']=_0x5eca7c[_0x4e3d('0x4a')]['length']?_0x5eca7c['attributes']:_0x46eeeb[_0x4e3d('0x44')];_0x5eca7c[_0x4e3d('0x4d')]=qs[_0x4e3d('0x4e')](_0xe4607f['query'][_0x4e3d('0x4e')]);_0x5eca7c[_0x4e3d('0x4f')]=qs[_0x4e3d('0x47')](_['pick'](_0xe4607f['query'],_0x46eeeb['filters']));if(_0xe4607f[_0x4e3d('0x46')][_0x4e3d('0x51')]){_0x5eca7c['where']=_[_0x4e3d('0x52')](_0x5eca7c[_0x4e3d('0x4f')],{'$or':_[_0x4e3d('0x3e')](_0x5eca7c[_0x4e3d('0x4a')],function(_0x2d31d3){var _0x1aeb60={};_0x1aeb60[_0x2d31d3]={'$like':'%'+_0xe4607f[_0x4e3d('0x46')][_0x4e3d('0x51')]+'%'};return _0x1aeb60;})});}_0x5eca7c=_[_0x4e3d('0x52')]({},_0x5eca7c,_0xe4607f[_0x4e3d('0x5b')]);return _0x409d40[_0x4e3d('0x10a')](_0x5eca7c);}})[_0x4e3d('0x34')](function(_0x17091a){if(_0x17091a){_0x4ebf64=_0x17091a[_0x4e3d('0x5a')];if(!_0xe4607f[_0x4e3d('0x46')][_0x4e3d('0x71')](_0x4e3d('0x4b'))){_0x5eca7c['limit']=qs[_0x4e3d('0x4c')](_0xe4607f[_0x4e3d('0x46')][_0x4e3d('0x4c')]);_0x5eca7c[_0x4e3d('0x30')]=qs['offset'](_0xe4607f[_0x4e3d('0x46')][_0x4e3d('0x30')]);}return _0x409d40[_0x4e3d('0x10a')](_0x5eca7c);}})['then'](function(_0x12cf3b){if(_0x12cf3b){return _0x12cf3b?{'count':_0x4ebf64,'rows':_0x12cf3b}:null;}})[_0x4e3d('0x34')](respondWithResult(_0x375178,null))[_0x4e3d('0x57')](handleError(_0x375178,null));};exports[_0x4e3d('0x10b')]=function(_0x474eac,_0x19cf96,_0x1e2ed1){return db[_0x4e3d('0x10c')]['find']({'where':{'id':_0x474eac[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x19cf96,null))[_0x4e3d('0x34')](function(_0x4e3931){if(_0x4e3931){return _0x4e3931[_0x4e3d('0x10b')](_0x474eac[_0x4e3d('0x5e')][_0x4e3d('0x6d')],_[_0x4e3d('0x10d')](_0x474eac[_0x4e3d('0x5e')],[_0x4e3d('0x6d'),'id'])||{});}})[_0x4e3d('0x34')](respondWithResult(_0x19cf96,null))[_0x4e3d('0x57')](handleError(_0x19cf96,null));};exports[_0x4e3d('0xf3')]=function(_0x25d5f1,_0x316e82,_0x868901){var _0x25052b={};var _0x4066c5={};var _0x51960b;var _0x237d96;return db[_0x4e3d('0x3f')]['findOne']({'where':{'id':_0x25d5f1[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x316e82,null))[_0x4e3d('0x34')](function(_0x14eafe){if(_0x14eafe){_0x51960b=_0x14eafe;_0x4066c5[_0x4e3d('0x44')]=_[_0x4e3d('0x45')](db[_0x4e3d('0x10e')][_0x4e3d('0x40')]);_0x4066c5['query']=_[_0x4e3d('0x45')](_0x25d5f1[_0x4e3d('0x46')]);_0x4066c5[_0x4e3d('0x47')]=_[_0x4e3d('0x48')](_0x4066c5['model'],_0x4066c5[_0x4e3d('0x46')]);_0x25052b[_0x4e3d('0x4a')]=_[_0x4e3d('0x48')](_0x4066c5[_0x4e3d('0x44')],qs['fields'](_0x25d5f1[_0x4e3d('0x46')][_0x4e3d('0x49')]));_0x25052b['attributes']=_0x25052b[_0x4e3d('0x4a')][_0x4e3d('0x5a')]?_0x25052b[_0x4e3d('0x4a')]:_0x4066c5[_0x4e3d('0x44')];_0x25052b[_0x4e3d('0x4d')]=qs[_0x4e3d('0x4e')](_0x25d5f1[_0x4e3d('0x46')][_0x4e3d('0x4e')]);_0x25052b[_0x4e3d('0x4f')]=qs[_0x4e3d('0x47')](_['pick'](_0x25d5f1[_0x4e3d('0x46')],_0x4066c5[_0x4e3d('0x47')]));if(_0x25d5f1[_0x4e3d('0x46')][_0x4e3d('0x51')]){_0x25052b[_0x4e3d('0x4f')]=_[_0x4e3d('0x52')](_0x25052b[_0x4e3d('0x4f')],{'$or':_[_0x4e3d('0x3e')](_0x25052b['attributes'],function(_0x14f1b3){var _0x5b5156={};_0x5b5156[_0x14f1b3]={'$like':'%'+_0x25d5f1['query']['filter']+'%'};return _0x5b5156;})});}_0x25052b=_[_0x4e3d('0x52')]({},_0x25052b,_0x25d5f1['options']);return _0x51960b[_0x4e3d('0xf3')](_0x25052b);}})[_0x4e3d('0x34')](function(_0x4417ce){if(_0x4417ce){_0x237d96=_0x4417ce[_0x4e3d('0x5a')];if(!_0x25d5f1[_0x4e3d('0x46')][_0x4e3d('0x71')](_0x4e3d('0x4b'))){_0x25052b[_0x4e3d('0x4c')]=qs[_0x4e3d('0x4c')](_0x25d5f1['query'][_0x4e3d('0x4c')]);_0x25052b[_0x4e3d('0x30')]=qs[_0x4e3d('0x30')](_0x25d5f1[_0x4e3d('0x46')][_0x4e3d('0x30')]);}return _0x51960b[_0x4e3d('0xf3')](_0x25052b);}})[_0x4e3d('0x34')](function(_0x21d4d8){if(_0x21d4d8){return _0x21d4d8?{'count':_0x237d96,'rows':_0x21d4d8}:null;}})[_0x4e3d('0x34')](respondWithResult(_0x316e82,null))[_0x4e3d('0x57')](handleError(_0x316e82,null));};exports[_0x4e3d('0x10f')]=function(_0x472da8,_0x20cfe2,_0x5a8132){var _0x552074=_0x472da8[_0x4e3d('0x46')][_0x4e3d('0x110')]===_0x4e3d('0x111')?_0x4e3d('0x112'):_0x4e3d('0x113');return db['ChatWebsite'][_0x4e3d('0x5c')]({'attributes':['id',_0x552074],'where':{'id':_0x472da8[_0x4e3d('0x59')]['id']}})['then'](handleEntityNotFound(_0x20cfe2,null))[_0x4e3d('0x34')](function(_0x3cb95b){if(_0x3cb95b){var _0x226ccc=_0x3cb95b[_0x552074];var _0x19f42f=_0x226ccc&&_0x226ccc['items']?_0x226ccc['items']:[];_0x20cfe2[_0x4e3d('0x3a')]({'fromKey':_['isNil'](_0x226ccc['fromKey'])?undefined:_0x226ccc['fromKey'],'count':_0x19f42f[_0x4e3d('0x5a')],'rows':_0x19f42f});}})[_0x4e3d('0x57')](handleError(_0x20cfe2,null));};exports[_0x4e3d('0x114')]=function(_0x5dbe6d,_0x11c342,_0x487bbc){var _0x41e1a1={'raw':!![],'where':{}};var _0x420f6b={};var _0x22ef1a={'count':0x0,'rows':[]};return db[_0x4e3d('0x3f')][_0x4e3d('0x6a')]({'where':{'id':_0x5dbe6d[_0x4e3d('0x59')]['id']}})['then'](handleEntityNotFound(_0x11c342,null))[_0x4e3d('0x34')](function(_0x43a582){if(_0x43a582){_0x420f6b['model']=_['keys'](db['ChatOfflineMessage'][_0x4e3d('0x40')]);_0x420f6b['query']=_[_0x4e3d('0x45')](_0x5dbe6d[_0x4e3d('0x46')]);_0x420f6b[_0x4e3d('0x47')]=_[_0x4e3d('0x48')](_0x420f6b[_0x4e3d('0x44')],_0x420f6b['query']);_0x41e1a1[_0x4e3d('0x4a')]=_[_0x4e3d('0x48')](_0x420f6b[_0x4e3d('0x44')],qs[_0x4e3d('0x49')](_0x5dbe6d['query'][_0x4e3d('0x49')]));_0x41e1a1['attributes']=_0x41e1a1['attributes'][_0x4e3d('0x5a')]?_0x41e1a1['attributes']:_0x420f6b[_0x4e3d('0x44')];if(!_0x5dbe6d[_0x4e3d('0x46')][_0x4e3d('0x71')](_0x4e3d('0x4b'))){_0x41e1a1[_0x4e3d('0x4c')]=qs[_0x4e3d('0x4c')](_0x5dbe6d[_0x4e3d('0x46')][_0x4e3d('0x4c')]);_0x41e1a1[_0x4e3d('0x30')]=qs[_0x4e3d('0x30')](_0x5dbe6d[_0x4e3d('0x46')][_0x4e3d('0x30')]);}_0x41e1a1['order']=qs[_0x4e3d('0x4e')](_0x5dbe6d['query'][_0x4e3d('0x4e')]);_0x41e1a1[_0x4e3d('0x4f')]=qs['filters'](_[_0x4e3d('0x50')](_0x5dbe6d[_0x4e3d('0x46')],_0x420f6b[_0x4e3d('0x47')]));_0x41e1a1[_0x4e3d('0x4f')][_0x4e3d('0x6b')]=_0x43a582['id'];if(_0x5dbe6d['query'][_0x4e3d('0x51')]){_0x41e1a1[_0x4e3d('0x4f')]=_['merge'](_0x41e1a1[_0x4e3d('0x4f')],{'$or':_[_0x4e3d('0x3e')](_0x41e1a1[_0x4e3d('0x4a')],function(_0x55dad8){var _0x16c60f={};_0x16c60f[_0x55dad8]={'$like':'%'+_0x5dbe6d[_0x4e3d('0x46')][_0x4e3d('0x51')]+'%'};return _0x16c60f;})});}_0x41e1a1=_[_0x4e3d('0x52')]({},_0x41e1a1,_0x5dbe6d[_0x4e3d('0x5b')]);return db['ChatOfflineMessage'][_0x4e3d('0x2f')]({'where':_0x41e1a1[_0x4e3d('0x4f')]})[_0x4e3d('0x34')](function(_0x173383){_0x22ef1a[_0x4e3d('0x2f')]=_0x173383;if(_0x5dbe6d[_0x4e3d('0x46')]['includeAll']){_0x41e1a1['include']=[{'all':!![]}];}return db[_0x4e3d('0xd1')][_0x4e3d('0x55')](_0x41e1a1);})[_0x4e3d('0x34')](function(_0x1c7398){_0x22ef1a[_0x4e3d('0x56')]=_0x1c7398;return _0x22ef1a;});}})[_0x4e3d('0x34')](respondWithFilteredResult(_0x11c342,_0x41e1a1))[_0x4e3d('0x57')](handleError(_0x11c342,null));};exports[_0x4e3d('0x115')]=function(_0x3062dc,_0x1d648c,_0x43d354){return db[_0x4e3d('0x3f')][_0x4e3d('0x5c')]({'where':{'id':_0x3062dc['params']['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x1d648c,null))[_0x4e3d('0x34')](function(_0x5ce443){if(_0x5ce443){return _0x5ce443['addAgents'](_0x3062dc['body']['ids'],_[_0x4e3d('0x10d')](_0x3062dc[_0x4e3d('0x5e')],['ids','id'])||{})[_0x4e3d('0xb7')](function(_0x217bcc){for(var _0x2c378e=0x0;_0x2c378e<_0x3062dc[_0x4e3d('0x5e')]['ids'][_0x4e3d('0x5a')];_0x2c378e+=0x1){socket[_0x4e3d('0x116')](_0x4e3d('0x117'),{'UserId':_0x3062dc[_0x4e3d('0x5e')][_0x4e3d('0x6d')][_0x2c378e],'ChatWebsiteId':_0x3062dc[_0x4e3d('0x59')]['id']});}return _0x217bcc;});}})[_0x4e3d('0x34')](respondWithResult(_0x1d648c,null))[_0x4e3d('0x57')](handleError(_0x1d648c,null));};exports[_0x4e3d('0x118')]=function(_0x2a0cfc,_0x707e78,_0x2527e6){return db['ChatWebsite'][_0x4e3d('0x5c')]({'where':{'id':_0x2a0cfc['params']['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x707e78,null))[_0x4e3d('0x34')](function(_0x257300){if(_0x257300){return _0x257300['removeAgents'](_0x2a0cfc[_0x4e3d('0x46')]['ids'])[_0x4e3d('0x34')](function(){if(_[_0x4e3d('0x119')](_0x2a0cfc[_0x4e3d('0x46')][_0x4e3d('0x6d')])){for(var _0x24d10c=0x0;_0x24d10c<_0x2a0cfc['query'][_0x4e3d('0x6d')][_0x4e3d('0x5a')];_0x24d10c+=0x1){socket[_0x4e3d('0x116')]('userChatWebsite:remove',{'UserId':Number(_0x2a0cfc['query'][_0x4e3d('0x6d')][_0x24d10c]),'ChatWebsiteId':Number(_0x2a0cfc[_0x4e3d('0x59')]['id'])});}}else{socket[_0x4e3d('0x116')]('userChatWebsite:remove',{'UserId':Number(_0x2a0cfc[_0x4e3d('0x46')]['ids']),'ChatWebsiteId':Number(_0x2a0cfc[_0x4e3d('0x59')]['id'])});}});}})[_0x4e3d('0x34')](respondWithStatusCode(_0x707e78,null))['catch'](handleError(_0x707e78,null));};exports[_0x4e3d('0x11a')]=function(_0x3bffd1,_0x3a682e,_0x39b4f5){var _0x44506e={};var _0x5a7bf2={};var _0xf9267f;var _0x24826d;return db[_0x4e3d('0x3f')]['findOne']({'where':{'id':_0x3bffd1[_0x4e3d('0x59')]['id']}})[_0x4e3d('0x34')](handleEntityNotFound(_0x3a682e,null))['then'](function(_0x3e210e){if(_0x3e210e){_0xf9267f=_0x3e210e;_0x5a7bf2['model']=_[_0x4e3d('0x45')](db[_0x4e3d('0xbf')][_0x4e3d('0x40')]);_0x5a7bf2[_0x4e3d('0x46')]=_[_0x4e3d('0x45')](_0x3bffd1['query']);_0x5a7bf2[_0x4e3d('0x47')]=_[_0x4e3d('0x48')](_0x5a7bf2['model'],_0x5a7bf2['query']);_0x44506e[_0x4e3d('0x4a')]=_[_0x4e3d('0x48')](_0x5a7bf2[_0x4e3d('0x44')],qs[_0x4e3d('0x49')](_0x3bffd1[_0x4e3d('0x46')]['fields']));_0x44506e['attributes']=_0x44506e['attributes']['length']?_0x44506e[_0x4e3d('0x4a')]:_0x5a7bf2[_0x4e3d('0x44')];_0x44506e[_0x4e3d('0x4d')]=qs[_0x4e3d('0x4e')](_0x3bffd1[_0x4e3d('0x46')]['sort']);_0x44506e[_0x4e3d('0x4f')]=qs[_0x4e3d('0x47')](_[_0x4e3d('0x50')](_0x3bffd1['query'],_0x5a7bf2[_0x4e3d('0x47')]));if(_0x3bffd1[_0x4e3d('0x46')]['filter']){_0x44506e[_0x4e3d('0x4f')]=_['merge'](_0x44506e[_0x4e3d('0x4f')],{'$or':_[_0x4e3d('0x3e')](_0x44506e[_0x4e3d('0x4a')],function(_0x4a83e5){var _0x274e96={};_0x274e96[_0x4a83e5]={'$like':'%'+_0x3bffd1[_0x4e3d('0x46')]['filter']+'%'};return _0x274e96;})});}_0x44506e=_[_0x4e3d('0x52')]({},_0x44506e,_0x3bffd1[_0x4e3d('0x5b')]);return _0xf9267f[_0x4e3d('0x11a')](_0x44506e);}})['then'](function(_0x10b3f8){if(_0x10b3f8){_0x24826d=_0x10b3f8[_0x4e3d('0x5a')];if(!_0x3bffd1[_0x4e3d('0x46')][_0x4e3d('0x71')](_0x4e3d('0x4b'))){_0x44506e['limit']=qs[_0x4e3d('0x4c')](_0x3bffd1[_0x4e3d('0x46')][_0x4e3d('0x4c')]);_0x44506e[_0x4e3d('0x30')]=qs[_0x4e3d('0x30')](_0x3bffd1['query'][_0x4e3d('0x30')]);}return _0xf9267f['getAgents'](_0x44506e);}})['then'](function(_0x534884){if(_0x534884){return _0x534884?{'count':_0x24826d,'rows':_0x534884}:null;}})[_0x4e3d('0x34')](respondWithResult(_0x3a682e,null))['catch'](handleError(_0x3a682e,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index d3cd92d..bc37750 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7ed=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1b049a,_0x4e8530){var _0x31928e=function(_0x24f74a){while(--_0x24f74a){_0x1b049a['push'](_0x1b049a['shift']());}};_0x31928e(++_0x4e8530);}(_0xd7ed,0x1a8));var _0xdd7e=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0xd7ed[_0x391c55];return _0xa434e0;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xdd7e('0x0'))['db'][_0xdd7e('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdd7e('0x2')](0x0);var events={'afterCreate':_0xdd7e('0x3'),'afterUpdate':_0xdd7e('0x4'),'afterDestroy':_0xdd7e('0x5')};function emitEvent(_0x5bf333){return function(_0x35da71,_0x1c29a3,_0x2f3029){ChatWebsiteEvents[_0xdd7e('0x6')](_0x5bf333+':'+_0x35da71['id'],_0x35da71);ChatWebsiteEvents[_0xdd7e('0x6')](_0x5bf333,_0x35da71);_0x2f3029(null);};}for(var e in events){if(events[_0xdd7e('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xdd7e('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x22d3=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','save'];(function(_0x2759a4,_0x59d57f){var _0x4604c1=function(_0x52acc3){while(--_0x52acc3){_0x2759a4['push'](_0x2759a4['shift']());}};_0x4604c1(++_0x59d57f);}(_0x22d3,0x66));var _0x322d=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x22d3[_0x57add2];return _0x4e3670;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x322d('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x322d('0x1'),'afterUpdate':_0x322d('0x2'),'afterDestroy':_0x322d('0x3')};function emitEvent(_0x968e70){return function(_0x3b88aa,_0x59f26f,_0x4595df){ChatWebsiteEvents[_0x322d('0x4')](_0x968e70+':'+_0x3b88aa['id'],_0x3b88aa);ChatWebsiteEvents['emit'](_0x968e70,_0x3b88aa);_0x4595df(null);};}for(var e in events){if(events[_0x322d('0x5')](e)){var event=events[e];ChatWebsite[_0x322d('0x6')](e,emitEvent(event));}}module[_0x322d('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index a0c82a9..6c0a062 100644 --- a/server/api/chatWebsite/chatWebsite.model.js +++ b/server/api/chatWebsite/chatWebsite.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97c1=['define','ChatWebsite','chat_websites','lodash','util','api','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x4c16e2,_0x27d968){var _0x21d899=function(_0x4b8939){while(--_0x4b8939){_0x4c16e2['push'](_0x4c16e2['shift']());}};_0x21d899(++_0x27d968);}(_0x97c1,0xdf));var _0x197c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x97c1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var logger=require('../../config/logger')(_0x197c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x197c('0x3'));var fs=require('fs');var path=require(_0x197c('0x4'));var rimraf=require(_0x197c('0x5'));var config=require(_0x197c('0x6'));var attributes=require(_0x197c('0x7'));module['exports']=function(_0x5cbff6,_0x1cb6e1){return _0x5cbff6[_0x197c('0x8')](_0x197c('0x9'),attributes,{'tableName':_0x197c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbee3=['define','ChatWebsite','chat_websites','util','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xbee3,0xd5));var _0x3bee=function(_0x125ca8,_0x2b9dc7){_0x125ca8=_0x125ca8-0x0;var _0x8c6d50=_0xbee3[_0x125ca8];return _0x8c6d50;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3bee('0x1'));var BPromise=require(_0x3bee('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bee('0x3'));var rimraf=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var attributes=require('./chatWebsite.attributes');module[_0x3bee('0x6')]=function(_0x3baf77,_0x4c5ef5){return _0x3baf77[_0x3bee('0x7')](_0x3bee('0x8'),attributes,{'tableName':_0x3bee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index e4595e2..0f26a10 100644 --- a/server/api/chatWebsite/chatWebsite.rpc.js +++ b/server/api/chatWebsite/chatWebsite.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x524e,0x15e));var _0xe524=function(_0x267e9e,_0x573974){_0x267e9e=_0x267e9e-0x0;var _0x374138=_0x524e[_0x267e9e];return _0x374138;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});config[_0xe524('0xb')]=_[_0xe524('0xc')](config['redis'],{'host':_0xe524('0xd'),'port':0x18eb});var socket=require(_0xe524('0xe'))(new Redis(config[_0xe524('0xb')]));require(_0xe524('0xf'))[_0xe524('0x10')](socket);function respondWithRpcPromise(_0x4082b1,_0x1a08e2,_0xb3eb9f){return new BPromise(function(_0x1b75bd,_0x1641ec){return client[_0xe524('0x11')](_0x4082b1,_0xb3eb9f)[_0xe524('0x12')](function(_0x1184df){logger[_0xe524('0x13')](_0xe524('0x14'),_0x1a08e2,_0xe524('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a08e2,_0xe524('0x15'),JSON[_0xe524('0x16')](_0x1184df));if(_0x1184df[_0xe524('0x17')]){if(_0x1184df[_0xe524('0x17')][_0xe524('0x18')]===0x1f4){logger['error'](_0xe524('0x14'),_0x1a08e2,_0x1184df['error'][_0xe524('0x19')]);return _0x1641ec(_0x1184df[_0xe524('0x17')]['message']);}logger[_0xe524('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0x1184df[_0xe524('0x17')]['message']);return _0x1b75bd(_0x1184df[_0xe524('0x17')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0xe524('0x15'));_0x1b75bd(_0x1184df['result'][_0xe524('0x19')]);}})[_0xe524('0x1a')](function(_0x278de9){logger[_0xe524('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0x278de9);_0x1641ec(_0x278de9);});});} \ No newline at end of file +var _0x1a37=['rpc','jayson/promise','http','redis','defaults','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3fca82,_0x3336c9){var _0x4f82c4=function(_0x579b40){while(--_0x579b40){_0x3fca82['push'](_0x3fca82['shift']());}};_0x4f82c4(++_0x3336c9);}(_0x1a37,0xb4));var _0x71a3=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x1a37[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});config[_0x71a3('0xc')]=_[_0x71a3('0xd')](config[_0x71a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x71a3('0xe')](socket);function respondWithRpcPromise(_0x18320a,_0x3709bc,_0x3aeb48){return new BPromise(function(_0x3a7fc1,_0x2215f2){return client[_0x71a3('0xf')](_0x18320a,_0x3aeb48)[_0x71a3('0x10')](function(_0x5c464c){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3709bc,_0x71a3('0x11'));logger[_0x71a3('0x12')](_0x71a3('0x13'),_0x3709bc,_0x71a3('0x11'),JSON[_0x71a3('0x14')](_0x5c464c));if(_0x5c464c[_0x71a3('0x15')]){if(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x16')]===0x1f4){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5c464c[_0x71a3('0x15')]['message']);return _0x2215f2(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3709bc,_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);return _0x3a7fc1(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}else{logger[_0x71a3('0x19')](_0x71a3('0x17'),_0x3709bc,'request\x20sent');_0x3a7fc1(_0x5c464c[_0x71a3('0x1a')][_0x71a3('0x18')]);}})['catch'](function(_0x5f4562){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5f4562);_0x2215f2(_0x5f4562);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 09e91c0..b35ee70 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x5f2098,_0x47308b){var _0x18af32=function(_0xa53c8e){while(--_0xa53c8e){_0x5f2098['push'](_0x5f2098['shift']());}};_0x18af32(++_0x47308b);}(_0xb10b,0x12a));var _0xbb10=function(_0xf7058b,_0x22c9b7){_0xf7058b=_0xf7058b-0x0;var _0x24cbf0=_0xb10b[_0xf7058b];return _0x24cbf0;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x490413,_0xb5dd06){var _0x4dba2e=function(_0x3dbc21){while(--_0x3dbc21){_0x490413['push'](_0x490413['shift']());}};_0x4dba2e(++_0xb5dd06);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18ce11,_0x135cc0){_0x18ce11=_0x18ce11-0x0;var _0x3bea1d=_0x5f2f[_0x18ce11];return _0x3bea1d;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 990abd2..37558d2 100644 --- a/server/api/chatWebsite/index.js +++ b/server/api/chatWebsite/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e75=['file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','diskStorage','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','create','post','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','format','now','originalname','single'];(function(_0x1868f4,_0x150266){var _0x273bf8=function(_0x596165){while(--_0x596165){_0x1868f4['push'](_0x1868f4['shift']());}};_0x273bf8(++_0x150266);}(_0x6e75,0x98));var _0x56e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e75[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x56e7('0x0'));var util=require(_0x56e7('0x1'));var path=require(_0x56e7('0x2'));var timeout=require(_0x56e7('0x3'));var express=require(_0x56e7('0x4'));var router=express[_0x56e7('0x5')]();var auth=require(_0x56e7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x56e7('0x7'));var controller=require(_0x56e7('0x8'));router[_0x56e7('0x9')]('/',auth[_0x56e7('0xa')](),controller['index']);router[_0x56e7('0x9')](_0x56e7('0xb'),auth['isAuthenticated'](),controller[_0x56e7('0xc')]);router[_0x56e7('0x9')](_0x56e7('0xd'),auth[_0x56e7('0xa')](),controller[_0x56e7('0xe')]);router[_0x56e7('0x9')]('/:id/dispositions',auth[_0x56e7('0xa')](),controller[_0x56e7('0xf')]);router[_0x56e7('0x9')](_0x56e7('0x10'),auth[_0x56e7('0xa')](),controller['getAnswers']);router[_0x56e7('0x9')](_0x56e7('0x11'),controller['getLogo']);router[_0x56e7('0x9')](_0x56e7('0x12'),controller[_0x56e7('0x13')]);router[_0x56e7('0x9')](_0x56e7('0x14'),controller[_0x56e7('0x15')]);router[_0x56e7('0x9')]('/:id/system_avatar',controller[_0x56e7('0x16')]);router[_0x56e7('0x9')](_0x56e7('0x17'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x18')]);router[_0x56e7('0x9')](_0x56e7('0x19'),controller['getSnippet']);router[_0x56e7('0x9')](_0x56e7('0x1a'),auth[_0x56e7('0xa')](),controller['getApplications']);router[_0x56e7('0x9')](_0x56e7('0x1b'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x1c')]);router['get'](_0x56e7('0x1d'),controller[_0x56e7('0x1e')]);router[_0x56e7('0x9')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x56e7('0x1f')]);router[_0x56e7('0x9')](_0x56e7('0x20'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x21')]);router['post']('/',auth[_0x56e7('0xa')](),controller[_0x56e7('0x22')]);router[_0x56e7('0x23')](_0x56e7('0x24'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x25')]);router[_0x56e7('0x23')](_0x56e7('0x10'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x429022,_0x5b0e07,_0x3a9e15){_0x3a9e15(null,path[_0x56e7('0x27')](config[_0x56e7('0x28')],_0x56e7('0x29')));},'filename':function(_0x3fa620,_0x4c4022,_0x21a37){_0x21a37(null,util[_0x56e7('0x2a')]('%s-%s',Date[_0x56e7('0x2b')](),_0x4c4022[_0x56e7('0x2c')]));}})});router['post'](_0x56e7('0x11'),upload[_0x56e7('0x2d')](_0x56e7('0x2e')),controller[_0x56e7('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x87f60d,_0x2f5a71,_0x53dff3){_0x53dff3(null,path['join'](config['root'],_0x56e7('0x30')));},'filename':function(_0x30c0ad,_0x56fd09,_0x6910dc){_0x6910dc(null,util['format'](_0x56e7('0x31'),Date[_0x56e7('0x2b')](),_0x56fd09['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0x56e7('0x2e')),controller[_0x56e7('0x32')]);var upload=multer({'storage':multer[_0x56e7('0x33')]({'destination':function(_0x40b5c7,_0x342379,_0x5970cc){_0x5970cc(null,path[_0x56e7('0x27')](config[_0x56e7('0x28')],_0x56e7('0x30')));},'filename':function(_0x12a8fb,_0x408c81,_0xc406b2){_0xc406b2(null,util['format'](_0x56e7('0x31'),Date[_0x56e7('0x2b')](),_0x408c81['originalname']));}})});router[_0x56e7('0x23')](_0x56e7('0x14'),upload[_0x56e7('0x2d')](_0x56e7('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x56e7('0x33')]({'destination':function(_0x49fcfe,_0x4aef7f,_0x2dd639){_0x2dd639(null,path[_0x56e7('0x27')](config[_0x56e7('0x28')],'server/files/images/avatars/'));},'filename':function(_0x18104b,_0x171690,_0x1bcf31){_0x1bcf31(null,util[_0x56e7('0x2a')](_0x56e7('0x31'),Date[_0x56e7('0x2b')](),_0x171690['originalname']));}})});router[_0x56e7('0x23')](_0x56e7('0x34'),upload[_0x56e7('0x2d')]('file'),controller[_0x56e7('0x35')]);router[_0x56e7('0x23')](_0x56e7('0x36'),controller[_0x56e7('0x37')]);router['post'](_0x56e7('0x38'),controller['offline']);router[_0x56e7('0x23')]('/:id/interactions',auth[_0x56e7('0xa')](),controller['addInteraction']);router[_0x56e7('0x23')](_0x56e7('0x1a'),auth['isAuthenticated'](),controller[_0x56e7('0x39')]);router[_0x56e7('0x23')](_0x56e7('0x1b'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x3a')]);router[_0x56e7('0x23')](_0x56e7('0x20'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x3b')]);router[_0x56e7('0x3c')](_0x56e7('0xd'),auth[_0x56e7('0xa')](),controller['update']);router[_0x56e7('0x3d')]('/:id',auth[_0x56e7('0xa')](),controller[_0x56e7('0x3e')]);router['delete'](_0x56e7('0x24'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x3f')]);router['delete'](_0x56e7('0x10'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x40')]);router['delete'](_0x56e7('0x20'),auth[_0x56e7('0xa')](),controller[_0x56e7('0x41')]);module['exports']=router; \ No newline at end of file +var _0xfa6d=['show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','root','addAvatar','server/files/images/avatars/','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','describe'];(function(_0x2b0f3f,_0x4a91eb){var _0xa29f2e=function(_0x4111ef){while(--_0x4111ef){_0x2b0f3f['push'](_0x2b0f3f['shift']());}};_0xa29f2e(++_0x4a91eb);}(_0xfa6d,0x105));var _0xdfa6=function(_0x4ecd86,_0x5a30d8){_0x4ecd86=_0x4ecd86-0x0;var _0x52792a=_0xfa6d[_0x4ecd86];return _0x52792a;};'use strict';var multer=require(_0xdfa6('0x0'));var util=require(_0xdfa6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdfa6('0x2')]();var auth=require(_0xdfa6('0x3'));var interaction=require(_0xdfa6('0x4'));var config=require(_0xdfa6('0x5'));var controller=require(_0xdfa6('0x6'));router[_0xdfa6('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdfa6('0x7')](_0xdfa6('0x8'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0xa')]);router[_0xdfa6('0x7')]('/:id',auth[_0xdfa6('0x9')](),controller[_0xdfa6('0xb')]);router['get']('/:id/dispositions',auth[_0xdfa6('0x9')](),controller[_0xdfa6('0xc')]);router['get'](_0xdfa6('0xd'),auth['isAuthenticated'](),controller[_0xdfa6('0xe')]);router[_0xdfa6('0x7')](_0xdfa6('0xf'),controller[_0xdfa6('0x10')]);router[_0xdfa6('0x7')](_0xdfa6('0x11'),controller[_0xdfa6('0x12')]);router[_0xdfa6('0x7')](_0xdfa6('0x13'),controller[_0xdfa6('0x14')]);router[_0xdfa6('0x7')](_0xdfa6('0x15'),controller['getSystemAvatar']);router[_0xdfa6('0x7')](_0xdfa6('0x16'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x17')]);router[_0xdfa6('0x7')](_0xdfa6('0x18'),controller[_0xdfa6('0x19')]);router[_0xdfa6('0x7')](_0xdfa6('0x1a'),auth[_0xdfa6('0x9')](),controller['getApplications']);router[_0xdfa6('0x7')](_0xdfa6('0x1b'),auth['isAuthenticated'](),controller[_0xdfa6('0x1c')]);router[_0xdfa6('0x7')]('/:id/fields',controller[_0xdfa6('0x1d')]);router[_0xdfa6('0x7')](_0xdfa6('0x1e'),auth['isAuthenticated'](),controller['getOfflineMessages']);router['get'](_0xdfa6('0x1f'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x20')]);router[_0xdfa6('0x21')]('/',auth['isAuthenticated'](),controller[_0xdfa6('0x22')]);router[_0xdfa6('0x21')](_0xdfa6('0x23'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x24')]);router[_0xdfa6('0x21')]('/:id/canned_answers',auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x25')]);var upload=multer({'storage':multer[_0xdfa6('0x26')]({'destination':function(_0x757762,_0x4f479c,_0x505731){_0x505731(null,path[_0xdfa6('0x27')](config['root'],_0xdfa6('0x28')));},'filename':function(_0xbb464f,_0x326624,_0x139c0a){_0x139c0a(null,util[_0xdfa6('0x29')](_0xdfa6('0x2a'),Date[_0xdfa6('0x2b')](),_0x326624[_0xdfa6('0x2c')]));}})});router['post'](_0xdfa6('0xf'),upload[_0xdfa6('0x2d')]('file'),controller[_0xdfa6('0x2e')]);var upload=multer({'storage':multer[_0xdfa6('0x26')]({'destination':function(_0x28f029,_0x4508ca,_0x5b0914){_0x5b0914(null,path[_0xdfa6('0x27')](config[_0xdfa6('0x2f')],'server/files/images/avatars/'));},'filename':function(_0x529279,_0x180e8b,_0x3f04c2){_0x3f04c2(null,util[_0xdfa6('0x29')](_0xdfa6('0x2a'),Date[_0xdfa6('0x2b')](),_0x180e8b[_0xdfa6('0x2c')]));}})});router[_0xdfa6('0x21')](_0xdfa6('0x11'),upload[_0xdfa6('0x2d')]('file'),controller[_0xdfa6('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a4311,_0x5a3ecb,_0x1cfa4c){_0x1cfa4c(null,path[_0xdfa6('0x27')](config[_0xdfa6('0x2f')],_0xdfa6('0x31')));},'filename':function(_0x5a89a2,_0x221a2d,_0x52c9ba){_0x52c9ba(null,util['format'](_0xdfa6('0x2a'),Date[_0xdfa6('0x2b')](),_0x221a2d['originalname']));}})});router['post'](_0xdfa6('0x13'),upload[_0xdfa6('0x2d')](_0xdfa6('0x32')),controller[_0xdfa6('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56be4c,_0x87cb8b,_0x4984c0){_0x4984c0(null,path[_0xdfa6('0x27')](config[_0xdfa6('0x2f')],'server/files/images/avatars/'));},'filename':function(_0x584cfa,_0x134b92,_0x2d3a19){_0x2d3a19(null,util['format']('%s-%s',Date[_0xdfa6('0x2b')](),_0x134b92['originalname']));}})});router[_0xdfa6('0x21')](_0xdfa6('0x15'),upload['single']('file'),controller[_0xdfa6('0x34')]);router[_0xdfa6('0x21')](_0xdfa6('0x35'),controller[_0xdfa6('0x36')]);router[_0xdfa6('0x21')]('/:id/offline',controller[_0xdfa6('0x37')]);router[_0xdfa6('0x21')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0xdfa6('0x21')]('/:id/applications',auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x38')]);router[_0xdfa6('0x21')](_0xdfa6('0x1b'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x39')]);router[_0xdfa6('0x21')](_0xdfa6('0x1f'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x3a')]);router[_0xdfa6('0x3b')](_0xdfa6('0x3c'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x3d')]);router[_0xdfa6('0x3e')](_0xdfa6('0x3c'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x3f')]);router[_0xdfa6('0x3e')](_0xdfa6('0x23'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x40')]);router[_0xdfa6('0x3e')](_0xdfa6('0xd'),auth['isAuthenticated'](),controller[_0xdfa6('0x41')]);router[_0xdfa6('0x3e')](_0xdfa6('0x1f'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x42')]);module[_0xdfa6('0x43')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index f36faf6..f455c73 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88fa=['sequelize','exports','name','STRING'];(function(_0x55b65a,_0x38fdcc){var _0x5f552a=function(_0xf1a61a){while(--_0xf1a61a){_0x55b65a['push'](_0x55b65a['shift']());}};_0x5f552a(++_0x38fdcc);}(_0x88fa,0x10c));var _0xa88f=function(_0x4fb334,_0x4ca8c9){_0x4fb334=_0x4fb334-0x0;var _0x56dc84=_0x88fa[_0x4fb334];return _0x56dc84;};'use strict';var Sequelize=require(_0xa88f('0x0'));module[_0xa88f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa88f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa88f('0x3')]},'companyId':{'type':Sequelize[_0xa88f('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa88f('0x3')]},'fax':{'type':Sequelize[_0xa88f('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa88f('0x3')]},'postalCode':{'type':Sequelize[_0xa88f('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa88f('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa88f('0x3')]},'sStreet':{'type':Sequelize[_0xa88f('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa88f('0x3')]},'sCountry':{'type':Sequelize[_0xa88f('0x3')]},'description':{'type':Sequelize[_0xa88f('0x3')]}}; \ No newline at end of file +var _0x3751=['STRING','sequelize','exports','name'];(function(_0x803933,_0xef7f31){var _0x4baca7=function(_0x2d64a9){while(--_0x2d64a9){_0x803933['push'](_0x803933['shift']());}};_0x4baca7(++_0xef7f31);}(_0x3751,0x195));var _0x1375=function(_0x21d532,_0x4552a4){_0x21d532=_0x21d532-0x0;var _0x37bda1=_0x3751[_0x21d532];return _0x37bda1;};'use strict';var Sequelize=require(_0x1375('0x0'));module[_0x1375('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1375('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x1375('0x3')]},'website':{'type':Sequelize[_0x1375('0x3')]},'phone':{'type':Sequelize[_0x1375('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1375('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1375('0x3')]},'city':{'type':Sequelize[_0x1375('0x3')]},'country':{'type':Sequelize[_0x1375('0x3')]},'email':{'type':Sequelize[_0x1375('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1375('0x3')]},'sStreet':{'type':Sequelize[_0x1375('0x3')]},'sPostalCode':{'type':Sequelize[_0x1375('0x3')]},'sCity':{'type':Sequelize[_0x1375('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1375('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index f282473..9c24ac5 100644 --- a/server/api/cmCompany/cmCompany.controller.js +++ b/server/api/cmCompany/cmCompany.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x748b=['bluebird','util','path','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','role','user','get','Companies','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','findOne','html-pdf','eml-format','rimraf','zip-dir','moment'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x748b,0xa5));var _0xb748=function(_0x5abde0,_0x41f3fc){_0x5abde0=_0x5abde0-0x0;var _0xe9a276=_0x748b[_0x5abde0];return _0xe9a276;};'use strict';var pdf=require(_0xb748('0x0'));var emlformat=require(_0xb748('0x1'));var rimraf=require(_0xb748('0x2'));var zipdir=require(_0xb748('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb748('0x4'));var BPromise=require(_0xb748('0x5'));var Mustache=require('mustache');var util=require(_0xb748('0x6'));var path=require(_0xb748('0x7'));var sox=require('sox');var csv=require(_0xb748('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb748('0x9'));var squel=require('squel');var crypto=require(_0xb748('0xa'));var jsforce=require(_0xb748('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb748('0x8'));var querystring=require(_0xb748('0xc'));var Papa=require(_0xb748('0xd'));var Redis=require(_0xb748('0xe'));var authService=require(_0xb748('0xf'));var qs=require(_0xb748('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb748('0x11'));var logger=require('../../config/logger')(_0xb748('0x12'));var utils=require(_0xb748('0x13'));var config=require(_0xb748('0x14'));var db=require(_0xb748('0x15'))['db'];function respondWithStatusCode(_0xa42a93,_0x1cf498){_0x1cf498=_0x1cf498||0xcc;return function(_0xb0a2ee){if(_0xb0a2ee){return _0xa42a93[_0xb748('0x16')](_0x1cf498);}return _0xa42a93[_0xb748('0x17')](_0x1cf498)[_0xb748('0x18')]();};}function respondWithResult(_0x28eb2,_0x57e1b9){_0x57e1b9=_0x57e1b9||0xc8;return function(_0xa96c6b){if(_0xa96c6b){return _0x28eb2[_0xb748('0x17')](_0x57e1b9)[_0xb748('0x19')](_0xa96c6b);}};}function respondWithFilteredResult(_0x2e4e10,_0x4b2818){return function(_0x4bda25){if(_0x4bda25){var _0x333ad0=_0x4bda25[_0xb748('0x1a')],_0x11c828=_0x4b2818[_0xb748('0x1b')],_0x22df9d=_0x4b2818[_0xb748('0x1b')]+_0x4b2818['limit'],_0x1c99ec;if(_0x22df9d>=_0x333ad0){_0x22df9d=_0x333ad0;_0x1c99ec=0xc8;}else{_0x1c99ec=0xce;}_0x2e4e10['status'](_0x1c99ec);return _0x2e4e10['set']('Content-Range',_0x11c828+'-'+_0x22df9d+'/'+_0x333ad0)['json'](_0x4bda25);}return null;};}function patchUpdates(_0x41c5ff){return function(_0x5a3382){try{jsonpatch[_0xb748('0x1c')](_0x5a3382,_0x41c5ff,!![]);}catch(_0x295869){return BPromise[_0xb748('0x1d')](_0x295869);}return _0x5a3382[_0xb748('0x1e')]();};}function saveUpdates(_0x34d437,_0x2a5cd2){return function(_0x415671){if(_0x415671){return _0x415671[_0xb748('0x1f')](_0x34d437)[_0xb748('0x20')](function(_0x321918){return _0x321918;});}return null;};}function removeEntity(_0x5975d6,_0x17aca8){return function(_0x5ebfa9){if(_0x5ebfa9){return _0x5ebfa9[_0xb748('0x21')]()['then'](function(){var _0x4faac7=_0x5ebfa9['get']({'plain':!![]});var _0x3f1c48='Companies';return db[_0xb748('0x22')]['destroy']({'where':{'type':_0x3f1c48,'resourceId':_0x4faac7['id']}})['then'](function(){return _0x5ebfa9;});})[_0xb748('0x20')](function(){_0x5975d6[_0xb748('0x17')](0xcc)[_0xb748('0x18')]();});}};}function handleEntityNotFound(_0x39ed2a,_0x5f1e50){return function(_0x82e8c3){if(!_0x82e8c3){_0x39ed2a[_0xb748('0x16')](0x194);}return _0x82e8c3;};}function handleError(_0x4f7aa6,_0x72c435){_0x72c435=_0x72c435||0x1f4;return function(_0x545a7f){logger[_0xb748('0x23')](_0x545a7f[_0xb748('0x24')]);if(_0x545a7f['name']){delete _0x545a7f[_0xb748('0x25')];}_0x4f7aa6[_0xb748('0x17')](_0x72c435)[_0xb748('0x26')](_0x545a7f);};}exports[_0xb748('0x27')]=function(_0x52e8f8,_0x3e68fc){var _0x3f963d={},_0x107957={},_0xea2dfa={'count':0x0,'rows':[]};return db[_0xb748('0x28')][_0xb748('0x29')]()[_0xb748('0x20')](function(_0x2d6910){_0x107957[_0xb748('0x2a')]=_[_0xb748('0x2b')](_0x2d6910);_0x107957[_0xb748('0x2c')]=_[_0xb748('0x2b')](_0x52e8f8[_0xb748('0x2c')]);_0x107957[_0xb748('0x2d')]=_[_0xb748('0x2e')](_0x107957[_0xb748('0x2a')],_0x107957['query']);_0x3f963d[_0xb748('0x2f')]=_[_0xb748('0x2e')](_0x107957[_0xb748('0x2a')],qs['fields'](_0x52e8f8[_0xb748('0x2c')][_0xb748('0x30')]));_0x3f963d[_0xb748('0x2f')]=_0x3f963d[_0xb748('0x2f')][_0xb748('0x31')]?_0x3f963d[_0xb748('0x2f')]:_0x107957[_0xb748('0x2a')];if(!_0x52e8f8[_0xb748('0x2c')][_0xb748('0x32')](_0xb748('0x33'))){_0x3f963d[_0xb748('0x34')]=qs[_0xb748('0x34')](_0x52e8f8[_0xb748('0x2c')]['limit']);_0x3f963d[_0xb748('0x1b')]=qs['offset'](_0x52e8f8[_0xb748('0x2c')]['offset']);}_0x3f963d[_0xb748('0x35')]=qs[_0xb748('0x36')](_0x52e8f8['query'][_0xb748('0x36')]);_0x3f963d[_0xb748('0x37')]=qs['filters'](_[_0xb748('0x38')](_0x52e8f8[_0xb748('0x2c')],_0x107957[_0xb748('0x2d')]));if(_0x52e8f8[_0xb748('0x2c')]['filter']){_0x3f963d[_0xb748('0x37')]=_['merge'](_0x3f963d[_0xb748('0x37')],{'$or':_[_0xb748('0x39')](_0x3f963d['attributes'],function(_0x2d7bc5){var _0x15ee2a={};_0x15ee2a[_0x2d7bc5]={'$like':'%'+_0x52e8f8[_0xb748('0x2c')][_0xb748('0x3a')]+'%'};return _0x15ee2a;})});}_0x3f963d=_[_0xb748('0x3b')]({},_0x3f963d,_0x52e8f8[_0xb748('0x3c')]);var _0x460805={'where':_0x3f963d[_0xb748('0x37')]};return db[_0xb748('0x28')]['count'](_0x460805)[_0xb748('0x20')](function(_0x56d481){_0xea2dfa[_0xb748('0x1a')]=_0x56d481;if(_0x52e8f8[_0xb748('0x2c')][_0xb748('0x3d')]){_0x3f963d[_0xb748('0x3e')]=[{'all':!![]}];}return db[_0xb748('0x28')][_0xb748('0x3f')](_0x3f963d);})['then'](function(_0x364d08){_0xea2dfa[_0xb748('0x40')]=_0x364d08;return _0xea2dfa;})['then'](respondWithFilteredResult(_0x3e68fc,_0x3f963d))[_0xb748('0x41')](handleError(_0x3e68fc,null));})[_0xb748('0x41')](handleError(_0x3e68fc,null));};exports[_0xb748('0x42')]=function(_0x9c7ee0,_0x590097){var _0x2dd316={'raw':![],'where':{'id':_0x9c7ee0[_0xb748('0x43')]['id']}},_0x4393e9={};_0x4393e9[_0xb748('0x2a')]=_['keys'](db['CmCompany'][_0xb748('0x44')]);_0x4393e9[_0xb748('0x2c')]=_[_0xb748('0x2b')](_0x9c7ee0['query']);_0x4393e9[_0xb748('0x2d')]=_[_0xb748('0x2e')](_0x4393e9['model'],_0x4393e9[_0xb748('0x2c')]);_0x2dd316[_0xb748('0x2f')]=_[_0xb748('0x2e')](_0x4393e9[_0xb748('0x2a')],qs[_0xb748('0x30')](_0x9c7ee0[_0xb748('0x2c')][_0xb748('0x30')]));_0x2dd316[_0xb748('0x2f')]=_0x2dd316[_0xb748('0x2f')][_0xb748('0x31')]?_0x2dd316[_0xb748('0x2f')]:_0x4393e9[_0xb748('0x2a')];if(_0x9c7ee0[_0xb748('0x2c')]['includeAll']){_0x2dd316[_0xb748('0x3e')]=[{'all':!![]}];}_0x2dd316=_['merge']({},_0x2dd316,_0x9c7ee0['options']);return db['CmCompany'][_0xb748('0x45')](_0x2dd316)[_0xb748('0x20')](handleEntityNotFound(_0x590097,null))[_0xb748('0x20')](respondWithResult(_0x590097,null))[_0xb748('0x41')](handleError(_0x590097,null));};exports[_0xb748('0x46')]=function(_0x10b809,_0x28d256){return db[_0xb748('0x28')][_0xb748('0x46')](_0x10b809['body'],{})[_0xb748('0x20')](function(_0xd83d25){var _0x48e77a=_0x10b809['user']['get']({'plain':!![]});if(!_0x48e77a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48e77a[_0xb748('0x47')]===_0xb748('0x48')){var _0x1141c1=_0xd83d25[_0xb748('0x49')]({'plain':!![]});var _0x1882ca=_0xb748('0x4a');return db['UserProfileSection'][_0xb748('0x45')]({'where':{'name':_0x1882ca,'userProfileId':_0x48e77a[_0xb748('0x4b')]},'raw':!![]})['then'](function(_0x1658f3){if(_0x1658f3&&_0x1658f3[_0xb748('0x4c')]===0x0){return db[_0xb748('0x22')][_0xb748('0x46')]({'name':_0x1141c1[_0xb748('0x25')],'resourceId':_0x1141c1['id'],'type':_0x1658f3[_0xb748('0x25')],'sectionId':_0x1658f3['id']},{})[_0xb748('0x20')](function(){return _0xd83d25;});}else{return _0xd83d25;}})['catch'](function(_0x19ca24){logger[_0xb748('0x23')](_0xb748('0x4d'),_0x19ca24);throw _0x19ca24;});}return _0xd83d25;})['then'](respondWithResult(_0x28d256,0xc9))[_0xb748('0x41')](handleError(_0x28d256,null));};exports[_0xb748('0x1f')]=function(_0x8b2b34,_0x424614){if(_0x8b2b34[_0xb748('0x4e')]['id']){delete _0x8b2b34['body']['id'];}return db[_0xb748('0x28')]['find']({'where':{'id':_0x8b2b34[_0xb748('0x43')]['id']}})[_0xb748('0x20')](handleEntityNotFound(_0x424614,null))[_0xb748('0x20')](saveUpdates(_0x8b2b34['body'],null))['then'](respondWithResult(_0x424614,null))[_0xb748('0x41')](handleError(_0x424614,null));};exports['destroy']=function(_0x4f1b53,_0xb8815c){return db[_0xb748('0x28')]['find']({'where':{'id':_0x4f1b53[_0xb748('0x43')]['id']}})[_0xb748('0x20')](handleEntityNotFound(_0xb8815c,null))['then'](removeEntity(_0xb8815c,null))[_0xb748('0x41')](handleError(_0xb8815c,null));};exports['describe']=function(_0x347c4a,_0x4e98e2){return db['CmCompany']['describe']()[_0xb748('0x20')](respondWithResult(_0x4e98e2,null))[_0xb748('0x41')](handleError(_0x4e98e2,null));};exports[_0xb748('0x4f')]=function(_0x425d4e,_0x113e8f,_0x5be565){return db[_0xb748('0x50')][_0xb748('0x45')]({'where':{'id':_0x425d4e[_0xb748('0x43')]['id']}})[_0xb748('0x20')](handleEntityNotFound(_0x113e8f,null))[_0xb748('0x20')](function(_0x4f5038){if(_0x4f5038){return _0x4f5038[_0xb748('0x4f')](_0x425d4e['body'][_0xb748('0x51')],_[_0xb748('0x52')](_0x425d4e[_0xb748('0x4e')],[_0xb748('0x51'),'id'])||{});}})[_0xb748('0x20')](respondWithResult(_0x113e8f,null))[_0xb748('0x41')](handleError(_0x113e8f,null));};exports[_0xb748('0x53')]=function(_0x1e6ec1,_0x5b68d6,_0x29a436){var _0x130913={};var _0x5f9605={};var _0x4b9cc0;var _0x399b79;return db['CmCompany'][_0xb748('0x54')]({'where':{'id':_0x1e6ec1[_0xb748('0x43')]['id']}})[_0xb748('0x20')](handleEntityNotFound(_0x5b68d6,null))[_0xb748('0x20')](function(_0x3b1b57){if(_0x3b1b57){_0x4b9cc0=_0x3b1b57;_0x5f9605['model']=_[_0xb748('0x2b')](db['CmContact'][_0xb748('0x44')]);_0x5f9605['query']=_[_0xb748('0x2b')](_0x1e6ec1['query']);_0x5f9605[_0xb748('0x2d')]=_[_0xb748('0x2e')](_0x5f9605[_0xb748('0x2a')],_0x5f9605[_0xb748('0x2c')]);_0x130913['attributes']=_[_0xb748('0x2e')](_0x5f9605[_0xb748('0x2a')],qs['fields'](_0x1e6ec1[_0xb748('0x2c')][_0xb748('0x30')]));_0x130913['attributes']=_0x130913[_0xb748('0x2f')][_0xb748('0x31')]?_0x130913[_0xb748('0x2f')]:_0x5f9605[_0xb748('0x2a')];_0x130913[_0xb748('0x35')]=qs[_0xb748('0x36')](_0x1e6ec1['query'][_0xb748('0x36')]);_0x130913['where']=qs[_0xb748('0x2d')](_[_0xb748('0x38')](_0x1e6ec1[_0xb748('0x2c')],_0x5f9605[_0xb748('0x2d')]));if(_0x1e6ec1[_0xb748('0x2c')][_0xb748('0x3a')]){_0x130913['where']=_[_0xb748('0x3b')](_0x130913[_0xb748('0x37')],{'$or':_[_0xb748('0x39')](_0x130913['attributes'],function(_0x11cfad){var _0x57aebd={};_0x57aebd[_0x11cfad]={'$like':'%'+_0x1e6ec1[_0xb748('0x2c')][_0xb748('0x3a')]+'%'};return _0x57aebd;})});}_0x130913=_[_0xb748('0x3b')]({},_0x130913,_0x1e6ec1[_0xb748('0x3c')]);return _0x4b9cc0[_0xb748('0x53')](_0x130913);}})[_0xb748('0x20')](function(_0x4ff88b){if(_0x4ff88b){_0x399b79=_0x4ff88b[_0xb748('0x31')];if(!_0x1e6ec1[_0xb748('0x2c')]['hasOwnProperty'](_0xb748('0x33'))){_0x130913[_0xb748('0x34')]=qs['limit'](_0x1e6ec1[_0xb748('0x2c')][_0xb748('0x34')]);_0x130913['offset']=qs[_0xb748('0x1b')](_0x1e6ec1[_0xb748('0x2c')][_0xb748('0x1b')]);}return _0x4b9cc0[_0xb748('0x53')](_0x130913);}})[_0xb748('0x20')](function(_0x31e20d){if(_0x31e20d){return _0x31e20d?{'count':_0x399b79,'rows':_0x31e20d}:null;}})['then'](respondWithResult(_0x5b68d6,null))[_0xb748('0x41')](handleError(_0x5b68d6,null));}; \ No newline at end of file +var _0x7089=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Companies','UserProfileSection','userProfileId','autoAssociation','body','addContacts','CmContact','ids','omit','getContacts','findOne','filters','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x5e7b28,_0x351c63){var _0x364de0=function(_0x5372dc){while(--_0x5372dc){_0x5e7b28['push'](_0x5e7b28['shift']());}};_0x364de0(++_0x351c63);}(_0x7089,0x1f2));var _0x9708=function(_0x37b1f9,_0x342907){_0x37b1f9=_0x37b1f9-0x0;var _0x5f32c8=_0x7089[_0x37b1f9];return _0x5f32c8;};'use strict';var pdf=require(_0x9708('0x0'));var emlformat=require(_0x9708('0x1'));var rimraf=require(_0x9708('0x2'));var zipdir=require(_0x9708('0x3'));var jsonpatch=require(_0x9708('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9708('0x5'));var util=require(_0x9708('0x6'));var path=require(_0x9708('0x7'));var sox=require(_0x9708('0x8'));var csv=require('to-csv');var ejs=require(_0x9708('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9708('0xa'));var crypto=require(_0x9708('0xb'));var jsforce=require(_0x9708('0xc'));var deskjs=require(_0x9708('0xd'));var toCsv=require(_0x9708('0xe'));var querystring=require(_0x9708('0xf'));var Papa=require(_0x9708('0x10'));var Redis=require(_0x9708('0x11'));var authService=require(_0x9708('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9708('0x13'));var hardwareService=require(_0x9708('0x14'));var logger=require(_0x9708('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9708('0x16'));var db=require(_0x9708('0x17'))['db'];function respondWithStatusCode(_0x14a287,_0x5566bd){_0x5566bd=_0x5566bd||0xcc;return function(_0x13f93f){if(_0x13f93f){return _0x14a287[_0x9708('0x18')](_0x5566bd);}return _0x14a287[_0x9708('0x19')](_0x5566bd)[_0x9708('0x1a')]();};}function respondWithResult(_0x41fa17,_0x56cb88){_0x56cb88=_0x56cb88||0xc8;return function(_0x570c33){if(_0x570c33){return _0x41fa17[_0x9708('0x19')](_0x56cb88)[_0x9708('0x1b')](_0x570c33);}};}function respondWithFilteredResult(_0x5bb4cc,_0x581486){return function(_0x3b9500){if(_0x3b9500){var _0x4a6316=_0x3b9500[_0x9708('0x1c')],_0x3f4cc3=_0x581486['offset'],_0x49661f=_0x581486[_0x9708('0x1d')]+_0x581486['limit'],_0x52cd3d;if(_0x49661f>=_0x4a6316){_0x49661f=_0x4a6316;_0x52cd3d=0xc8;}else{_0x52cd3d=0xce;}_0x5bb4cc['status'](_0x52cd3d);return _0x5bb4cc['set'](_0x9708('0x1e'),_0x3f4cc3+'-'+_0x49661f+'/'+_0x4a6316)[_0x9708('0x1b')](_0x3b9500);}return null;};}function patchUpdates(_0x116493){return function(_0x82cd1){try{jsonpatch['apply'](_0x82cd1,_0x116493,!![]);}catch(_0x3f7579){return BPromise[_0x9708('0x1f')](_0x3f7579);}return _0x82cd1[_0x9708('0x20')]();};}function saveUpdates(_0x43e5c6,_0x19e2ee){return function(_0x4ae494){if(_0x4ae494){return _0x4ae494[_0x9708('0x21')](_0x43e5c6)['then'](function(_0x472925){return _0x472925;});}return null;};}function removeEntity(_0x302990,_0x4a1237){return function(_0x2244fe){if(_0x2244fe){return _0x2244fe[_0x9708('0x22')]()[_0x9708('0x23')](function(){var _0x4952d9=_0x2244fe['get']({'plain':!![]});var _0x1e4b35='Companies';return db[_0x9708('0x24')]['destroy']({'where':{'type':_0x1e4b35,'resourceId':_0x4952d9['id']}})[_0x9708('0x23')](function(){return _0x2244fe;});})[_0x9708('0x23')](function(){_0x302990['status'](0xcc)[_0x9708('0x1a')]();});}};}function handleEntityNotFound(_0x4d6487,_0x3445f7){return function(_0x59f78f){if(!_0x59f78f){_0x4d6487[_0x9708('0x18')](0x194);}return _0x59f78f;};}function handleError(_0x55640c,_0x403f98){_0x403f98=_0x403f98||0x1f4;return function(_0x2b0637){logger[_0x9708('0x25')](_0x2b0637[_0x9708('0x26')]);if(_0x2b0637['name']){delete _0x2b0637[_0x9708('0x27')];}_0x55640c[_0x9708('0x19')](_0x403f98)[_0x9708('0x28')](_0x2b0637);};}exports[_0x9708('0x29')]=function(_0x4175d8,_0x432ba6){var _0x42ffcc={},_0x3d841f={},_0xa51320={'count':0x0,'rows':[]};return db[_0x9708('0x2a')][_0x9708('0x2b')]()[_0x9708('0x23')](function(_0x123257){_0x3d841f[_0x9708('0x2c')]=_[_0x9708('0x2d')](_0x123257);_0x3d841f[_0x9708('0x2e')]=_[_0x9708('0x2d')](_0x4175d8[_0x9708('0x2e')]);_0x3d841f['filters']=_['intersection'](_0x3d841f[_0x9708('0x2c')],_0x3d841f[_0x9708('0x2e')]);_0x42ffcc[_0x9708('0x2f')]=_[_0x9708('0x30')](_0x3d841f[_0x9708('0x2c')],qs[_0x9708('0x31')](_0x4175d8[_0x9708('0x2e')][_0x9708('0x31')]));_0x42ffcc[_0x9708('0x2f')]=_0x42ffcc[_0x9708('0x2f')][_0x9708('0x32')]?_0x42ffcc['attributes']:_0x3d841f[_0x9708('0x2c')];if(!_0x4175d8[_0x9708('0x2e')][_0x9708('0x33')]('nolimit')){_0x42ffcc[_0x9708('0x34')]=qs[_0x9708('0x34')](_0x4175d8[_0x9708('0x2e')][_0x9708('0x34')]);_0x42ffcc[_0x9708('0x1d')]=qs[_0x9708('0x1d')](_0x4175d8[_0x9708('0x2e')][_0x9708('0x1d')]);}_0x42ffcc[_0x9708('0x35')]=qs['sort'](_0x4175d8[_0x9708('0x2e')][_0x9708('0x36')]);_0x42ffcc[_0x9708('0x37')]=qs['filters'](_[_0x9708('0x38')](_0x4175d8[_0x9708('0x2e')],_0x3d841f['filters']));if(_0x4175d8[_0x9708('0x2e')]['filter']){_0x42ffcc['where']=_[_0x9708('0x39')](_0x42ffcc[_0x9708('0x37')],{'$or':_[_0x9708('0x3a')](_0x42ffcc['attributes'],function(_0x44153a){var _0x2b9f80={};_0x2b9f80[_0x44153a]={'$like':'%'+_0x4175d8[_0x9708('0x2e')][_0x9708('0x3b')]+'%'};return _0x2b9f80;})});}_0x42ffcc=_['merge']({},_0x42ffcc,_0x4175d8[_0x9708('0x3c')]);var _0x3c9b4c={'where':_0x42ffcc['where']};return db[_0x9708('0x2a')]['count'](_0x3c9b4c)[_0x9708('0x23')](function(_0x5dfb15){_0xa51320[_0x9708('0x1c')]=_0x5dfb15;if(_0x4175d8['query'][_0x9708('0x3d')]){_0x42ffcc[_0x9708('0x3e')]=[{'all':!![]}];}return db[_0x9708('0x2a')][_0x9708('0x3f')](_0x42ffcc);})[_0x9708('0x23')](function(_0x17ab2d){_0xa51320['rows']=_0x17ab2d;return _0xa51320;})['then'](respondWithFilteredResult(_0x432ba6,_0x42ffcc))[_0x9708('0x40')](handleError(_0x432ba6,null));})['catch'](handleError(_0x432ba6,null));};exports[_0x9708('0x41')]=function(_0x16bc2b,_0x5ead90){var _0x501152={'raw':![],'where':{'id':_0x16bc2b[_0x9708('0x42')]['id']}},_0x235efa={};_0x235efa[_0x9708('0x2c')]=_['keys'](db['CmCompany'][_0x9708('0x43')]);_0x235efa['query']=_['keys'](_0x16bc2b[_0x9708('0x2e')]);_0x235efa['filters']=_[_0x9708('0x30')](_0x235efa[_0x9708('0x2c')],_0x235efa[_0x9708('0x2e')]);_0x501152[_0x9708('0x2f')]=_[_0x9708('0x30')](_0x235efa['model'],qs['fields'](_0x16bc2b['query']['fields']));_0x501152[_0x9708('0x2f')]=_0x501152[_0x9708('0x2f')][_0x9708('0x32')]?_0x501152[_0x9708('0x2f')]:_0x235efa['model'];if(_0x16bc2b['query'][_0x9708('0x3d')]){_0x501152[_0x9708('0x3e')]=[{'all':!![]}];}_0x501152=_[_0x9708('0x39')]({},_0x501152,_0x16bc2b[_0x9708('0x3c')]);return db[_0x9708('0x2a')][_0x9708('0x44')](_0x501152)[_0x9708('0x23')](handleEntityNotFound(_0x5ead90,null))[_0x9708('0x23')](respondWithResult(_0x5ead90,null))['catch'](handleError(_0x5ead90,null));};exports['create']=function(_0x463545,_0x3c7177){return db[_0x9708('0x2a')][_0x9708('0x45')](_0x463545['body'],{})['then'](function(_0x28c9dd){var _0x2d4cda=_0x463545[_0x9708('0x46')]['get']({'plain':!![]});if(!_0x2d4cda)throw new Error(_0x9708('0x47'));if(_0x2d4cda['role']==='user'){var _0x19ee95=_0x28c9dd[_0x9708('0x48')]({'plain':!![]});var _0x48ce0e=_0x9708('0x49');return db[_0x9708('0x4a')][_0x9708('0x44')]({'where':{'name':_0x48ce0e,'userProfileId':_0x2d4cda[_0x9708('0x4b')]},'raw':!![]})['then'](function(_0x5b5c67){if(_0x5b5c67&&_0x5b5c67[_0x9708('0x4c')]===0x0){return db[_0x9708('0x24')][_0x9708('0x45')]({'name':_0x19ee95[_0x9708('0x27')],'resourceId':_0x19ee95['id'],'type':_0x5b5c67['name'],'sectionId':_0x5b5c67['id']},{})[_0x9708('0x23')](function(){return _0x28c9dd;});}else{return _0x28c9dd;}})[_0x9708('0x40')](function(_0x1d0e22){logger[_0x9708('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d0e22);throw _0x1d0e22;});}return _0x28c9dd;})[_0x9708('0x23')](respondWithResult(_0x3c7177,0xc9))[_0x9708('0x40')](handleError(_0x3c7177,null));};exports[_0x9708('0x21')]=function(_0x1c9e3d,_0x3a51da){if(_0x1c9e3d[_0x9708('0x4d')]['id']){delete _0x1c9e3d['body']['id'];}return db[_0x9708('0x2a')][_0x9708('0x44')]({'where':{'id':_0x1c9e3d['params']['id']}})[_0x9708('0x23')](handleEntityNotFound(_0x3a51da,null))[_0x9708('0x23')](saveUpdates(_0x1c9e3d[_0x9708('0x4d')],null))[_0x9708('0x23')](respondWithResult(_0x3a51da,null))[_0x9708('0x40')](handleError(_0x3a51da,null));};exports[_0x9708('0x22')]=function(_0x5c7711,_0x301f20){return db[_0x9708('0x2a')]['find']({'where':{'id':_0x5c7711[_0x9708('0x42')]['id']}})[_0x9708('0x23')](handleEntityNotFound(_0x301f20,null))[_0x9708('0x23')](removeEntity(_0x301f20,null))[_0x9708('0x40')](handleError(_0x301f20,null));};exports[_0x9708('0x2b')]=function(_0x1a42c3,_0x41f7ad){return db['CmCompany'][_0x9708('0x2b')]()[_0x9708('0x23')](respondWithResult(_0x41f7ad,null))[_0x9708('0x40')](handleError(_0x41f7ad,null));};exports[_0x9708('0x4e')]=function(_0x5b0ab1,_0x9b96f5,_0x3714db){return db[_0x9708('0x4f')][_0x9708('0x44')]({'where':{'id':_0x5b0ab1[_0x9708('0x42')]['id']}})[_0x9708('0x23')](handleEntityNotFound(_0x9b96f5,null))['then'](function(_0x319b14){if(_0x319b14){return _0x319b14[_0x9708('0x4e')](_0x5b0ab1[_0x9708('0x4d')][_0x9708('0x50')],_[_0x9708('0x51')](_0x5b0ab1[_0x9708('0x4d')],[_0x9708('0x50'),'id'])||{});}})['then'](respondWithResult(_0x9b96f5,null))[_0x9708('0x40')](handleError(_0x9b96f5,null));};exports[_0x9708('0x52')]=function(_0x2df37e,_0x90ea97,_0x2aa341){var _0x226767={};var _0x53b7dd={};var _0x590040;var _0x8f65c2;return db[_0x9708('0x2a')][_0x9708('0x53')]({'where':{'id':_0x2df37e[_0x9708('0x42')]['id']}})['then'](handleEntityNotFound(_0x90ea97,null))['then'](function(_0x424e72){if(_0x424e72){_0x590040=_0x424e72;_0x53b7dd[_0x9708('0x2c')]=_['keys'](db['CmContact'][_0x9708('0x43')]);_0x53b7dd[_0x9708('0x2e')]=_[_0x9708('0x2d')](_0x2df37e[_0x9708('0x2e')]);_0x53b7dd[_0x9708('0x54')]=_[_0x9708('0x30')](_0x53b7dd[_0x9708('0x2c')],_0x53b7dd[_0x9708('0x2e')]);_0x226767[_0x9708('0x2f')]=_[_0x9708('0x30')](_0x53b7dd[_0x9708('0x2c')],qs['fields'](_0x2df37e[_0x9708('0x2e')][_0x9708('0x31')]));_0x226767['attributes']=_0x226767[_0x9708('0x2f')][_0x9708('0x32')]?_0x226767[_0x9708('0x2f')]:_0x53b7dd[_0x9708('0x2c')];_0x226767[_0x9708('0x35')]=qs['sort'](_0x2df37e[_0x9708('0x2e')]['sort']);_0x226767[_0x9708('0x37')]=qs[_0x9708('0x54')](_[_0x9708('0x38')](_0x2df37e[_0x9708('0x2e')],_0x53b7dd[_0x9708('0x54')]));if(_0x2df37e['query']['filter']){_0x226767['where']=_[_0x9708('0x39')](_0x226767[_0x9708('0x37')],{'$or':_[_0x9708('0x3a')](_0x226767[_0x9708('0x2f')],function(_0x3f9123){var _0x54c97a={};_0x54c97a[_0x3f9123]={'$like':'%'+_0x2df37e[_0x9708('0x2e')][_0x9708('0x3b')]+'%'};return _0x54c97a;})});}_0x226767=_[_0x9708('0x39')]({},_0x226767,_0x2df37e[_0x9708('0x3c')]);return _0x590040[_0x9708('0x52')](_0x226767);}})[_0x9708('0x23')](function(_0x3bd3a9){if(_0x3bd3a9){_0x8f65c2=_0x3bd3a9[_0x9708('0x32')];if(!_0x2df37e[_0x9708('0x2e')]['hasOwnProperty'](_0x9708('0x55'))){_0x226767[_0x9708('0x34')]=qs[_0x9708('0x34')](_0x2df37e[_0x9708('0x2e')][_0x9708('0x34')]);_0x226767[_0x9708('0x1d')]=qs[_0x9708('0x1d')](_0x2df37e[_0x9708('0x2e')][_0x9708('0x1d')]);}return _0x590040[_0x9708('0x52')](_0x226767);}})[_0x9708('0x23')](function(_0x348455){if(_0x348455){return _0x348455?{'count':_0x8f65c2,'rows':_0x348455}:null;}})[_0x9708('0x23')](respondWithResult(_0x90ea97,null))['catch'](handleError(_0x90ea97,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index a7b81f8..a32a19f 100644 --- a/server/api/cmCompany/cmCompany.model.js +++ b/server/api/cmCompany/cmCompany.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7de=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7de,0x165));var _0xee7d=function(_0x4cc279,_0x59dee7){_0x4cc279=_0x4cc279-0x0;var _0x243db1=_0xe7de[_0x4cc279];return _0x243db1;};'use strict';var _=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var logger=require(_0xee7d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xee7d('0x3'));var rp=require(_0xee7d('0x4'));var fs=require('fs');var path=require(_0xee7d('0x5'));var rimraf=require(_0xee7d('0x6'));var config=require(_0xee7d('0x7'));var attributes=require(_0xee7d('0x8'));module[_0xee7d('0x9')]=function(_0x215ba4,_0x401cd0){return _0x215ba4[_0xee7d('0xa')](_0xee7d('0xb'),attributes,{'tableName':_0xee7d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7579=['define','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x3b959,_0x13b14e){var _0x3c6b1c=function(_0x37ef08){while(--_0x37ef08){_0x3b959['push'](_0x3b959['shift']());}};_0x3c6b1c(++_0x13b14e);}(_0x7579,0x1e2));var _0x9757=function(_0xe3584a,_0x53180e){_0xe3584a=_0xe3584a-0x0;var _0x537449=_0x7579[_0xe3584a];return _0x537449;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('CmCompany',attributes,{'tableName':_0x9757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 60c0179..cfc7659 100644 --- a/server/api/cmCompany/cmCompany.rpc.js +++ b/server/api/cmCompany/cmCompany.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f9a=['debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmCompany,\x20%s,\x20%s'];(function(_0x531814,_0x36b58e){var _0x1f352a=function(_0x30aacd){while(--_0x30aacd){_0x531814['push'](_0x531814['shift']());}};_0x1f352a(++_0x36b58e);}(_0x3f9a,0x7d));var _0xa3f9=function(_0x2472a6,_0x5f2d82){_0x2472a6=_0x2472a6-0x0;var _0x5c04b9=_0x3f9a[_0x2472a6];return _0x5c04b9;};'use strict';var _=require('lodash');var util=require(_0xa3f9('0x0'));var moment=require(_0xa3f9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3f9('0x3'));var logger=require(_0xa3f9('0x4'))('rpc');var config=require(_0xa3f9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa3f9('0x6')][_0xa3f9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a7809,_0x5c89f4,_0xe52374){return new BPromise(function(_0x37d433,_0x48eed9){return client[_0xa3f9('0x8')](_0x2a7809,_0xe52374)['then'](function(_0x1fbedd){logger[_0xa3f9('0x9')](_0xa3f9('0xa'),_0x5c89f4,'request\x20sent');logger[_0xa3f9('0xb')](_0xa3f9('0xc'),_0x5c89f4,_0xa3f9('0xd'),JSON['stringify'](_0x1fbedd));if(_0x1fbedd[_0xa3f9('0xe')]){if(_0x1fbedd[_0xa3f9('0xe')]['code']===0x1f4){logger[_0xa3f9('0xe')](_0xa3f9('0xa'),_0x5c89f4,_0x1fbedd[_0xa3f9('0xe')]['message']);return _0x48eed9(_0x1fbedd[_0xa3f9('0xe')][_0xa3f9('0xf')]);}logger[_0xa3f9('0xe')]('CmCompany,\x20%s,\x20%s',_0x5c89f4,_0x1fbedd[_0xa3f9('0xe')][_0xa3f9('0xf')]);return _0x37d433(_0x1fbedd[_0xa3f9('0xe')][_0xa3f9('0xf')]);}else{logger[_0xa3f9('0x9')](_0xa3f9('0xa'),_0x5c89f4,'request\x20sent');_0x37d433(_0x1fbedd[_0xa3f9('0x10')][_0xa3f9('0xf')]);}})['catch'](function(_0x77baf2){logger['error'](_0xa3f9('0xa'),_0x5c89f4,_0x77baf2);_0x48eed9(_0x77baf2);});});} \ No newline at end of file +var _0x0800=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x568b1e,_0x31a051){var _0x58b9e8=function(_0x473796){while(--_0x473796){_0x568b1e['push'](_0x568b1e['shift']());}};_0x58b9e8(++_0x31a051);}(_0x0800,0x1be));var _0x0080=function(_0x133077,_0x3be326){_0x133077=_0x133077-0x0;var _0x334692=_0x0800[_0x133077];return _0x334692;};'use strict';var _=require(_0x0080('0x0'));var util=require(_0x0080('0x1'));var moment=require(_0x0080('0x2'));var BPromise=require(_0x0080('0x3'));var rs=require(_0x0080('0x4'));var fs=require('fs');var Redis=require(_0x0080('0x5'));var db=require(_0x0080('0x6'))['db'];var utils=require(_0x0080('0x7'));var logger=require(_0x0080('0x8'))(_0x0080('0x9'));var config=require(_0x0080('0xa'));var jayson=require(_0x0080('0xb'));var client=jayson[_0x0080('0xc')][_0x0080('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x21d981,_0x368e80,_0x172798){return new BPromise(function(_0x2a04d9,_0x1fbd7a){return client[_0x0080('0xe')](_0x21d981,_0x172798)[_0x0080('0xf')](function(_0xcb5abc){logger[_0x0080('0x10')](_0x0080('0x11'),_0x368e80,_0x0080('0x12'));logger[_0x0080('0x13')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x368e80,'request\x20sent',JSON['stringify'](_0xcb5abc));if(_0xcb5abc[_0x0080('0x14')]){if(_0xcb5abc['error'][_0x0080('0x15')]===0x1f4){logger[_0x0080('0x14')](_0x0080('0x11'),_0x368e80,_0xcb5abc[_0x0080('0x14')][_0x0080('0x16')]);return _0x1fbd7a(_0xcb5abc[_0x0080('0x14')][_0x0080('0x16')]);}logger['error'](_0x0080('0x11'),_0x368e80,_0xcb5abc[_0x0080('0x14')]['message']);return _0x2a04d9(_0xcb5abc['error'][_0x0080('0x16')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x368e80,'request\x20sent');_0x2a04d9(_0xcb5abc[_0x0080('0x17')][_0x0080('0x16')]);}})[_0x0080('0x18')](function(_0x310299){logger[_0x0080('0x14')]('CmCompany,\x20%s,\x20%s',_0x368e80,_0x310299);_0x1fbd7a(_0x310299);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d6499f4..5aed4d2 100644 --- a/server/api/cmCompany/index.js +++ b/server/api/cmCompany/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa456=['update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x194cf8,_0x536123){var _0x17444f=function(_0x20be73){while(--_0x20be73){_0x194cf8['push'](_0x194cf8['shift']());}};_0x17444f(++_0x536123);}(_0xa456,0x142));var _0x6a45=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xa456[_0x19b3f9];return _0x18c3f6;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var auth=require(_0x6a45('0x5'));var interaction=require(_0x6a45('0x6'));var config=require('../../config/environment');var controller=require(_0x6a45('0x7'));router[_0x6a45('0x8')]('/',auth[_0x6a45('0x9')](),controller[_0x6a45('0xa')]);router['get'](_0x6a45('0xb'),auth[_0x6a45('0x9')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x8')](_0x6a45('0xd'),auth['isAuthenticated'](),controller[_0x6a45('0xe')]);router['get'](_0x6a45('0xf'),auth[_0x6a45('0x9')](),controller[_0x6a45('0x10')]);router[_0x6a45('0x11')]('/',auth[_0x6a45('0x9')](),controller['create']);router['post'](_0x6a45('0xf'),auth[_0x6a45('0x9')](),controller['addContacts']);router['put']('/:id',auth[_0x6a45('0x9')](),controller[_0x6a45('0x12')]);router[_0x6a45('0x13')](_0x6a45('0xd'),auth[_0x6a45('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x160f=['describe','show','/:id/contacts','isAuthenticated','create','post','addContacts','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index'];(function(_0x48bc2f,_0x149e3a){var _0x2336a0=function(_0x59acc3){while(--_0x59acc3){_0x48bc2f['push'](_0x48bc2f['shift']());}};_0x2336a0(++_0x149e3a);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var path=require(_0xf160('0x2'));var timeout=require(_0xf160('0x3'));var express=require('express');var router=express[_0xf160('0x4')]();var auth=require(_0xf160('0x5'));var interaction=require(_0xf160('0x6'));var config=require(_0xf160('0x7'));var controller=require(_0xf160('0x8'));router[_0xf160('0x9')]('/',auth['isAuthenticated'](),controller[_0xf160('0xa')]);router[_0xf160('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xf160('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf160('0xc')]);router[_0xf160('0x9')](_0xf160('0xd'),auth[_0xf160('0xe')](),controller['getContacts']);router['post']('/',auth[_0xf160('0xe')](),controller[_0xf160('0xf')]);router[_0xf160('0x10')]('/:id/contacts',auth[_0xf160('0xe')](),controller[_0xf160('0x11')]);router[_0xf160('0x12')](_0xf160('0x13'),auth[_0xf160('0xe')](),controller['update']);router[_0xf160('0x14')]('/:id',auth[_0xf160('0xe')](),controller[_0xf160('0x15')]);module[_0xf160('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 6234750..e16046d 100644 --- a/server/api/cmContact/cmContact.attributes.js +++ b/server/api/cmContact/cmContact.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x383d=['STRING','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports'];(function(_0x27edba,_0x3b8b4f){var _0x4d2d31=function(_0x30d5ca){while(--_0x30d5ca){_0x27edba['push'](_0x27edba['shift']());}};_0x4d2d31(++_0x3b8b4f);}(_0x383d,0x139));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var Sequelize=require(_0xd383('0x0'));module[_0xd383('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xd383('0x2')]},'street':{'type':Sequelize[_0xd383('0x2')]},'postalCode':{'type':Sequelize[_0xd383('0x2')]},'city':{'type':Sequelize[_0xd383('0x2')]},'country':{'type':Sequelize[_0xd383('0x2')]},'dateOfBirth':{'type':Sequelize[_0xd383('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xd383('0x2')]},'mobile':{'type':Sequelize[_0xd383('0x2')]},'fax':{'type':Sequelize[_0xd383('0x2')]},'email':{'type':Sequelize[_0xd383('0x2')]},'url':{'type':Sequelize[_0xd383('0x2')]},'facebook':{'type':Sequelize[_0xd383('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xd383('0x2')]},'skype':{'type':Sequelize[_0xd383('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xd383('0x2')]},'wechat':{'type':Sequelize[_0xd383('0x2')]},'telegram':{'type':Sequelize[_0xd383('0x2')]},'UserId':{'type':Sequelize[_0xd383('0x3')]},'priority':{'type':Sequelize[_0xd383('0x3')](0x2)[_0xd383('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd383('0x5')],'defaultValue':Sequelize[_0xd383('0x6')]}}; \ No newline at end of file +var _0xbd87=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x133758,_0x2332db){var _0x777ab7=function(_0x38ee1a){while(--_0x38ee1a){_0x133758['push'](_0x133758['shift']());}};_0x777ab7(++_0x2332db);}(_0xbd87,0x144));var _0x7bd8=function(_0x350e36,_0x13fd52){_0x350e36=_0x350e36-0x0;var _0x258465=_0xbd87[_0x350e36];return _0x258465;};'use strict';var _=require(_0x7bd8('0x0'));var Sequelize=require(_0x7bd8('0x1'));module[_0x7bd8('0x2')]={'firstName':{'type':Sequelize[_0x7bd8('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7bd8('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7bd8('0x3')]},'city':{'type':Sequelize[_0x7bd8('0x3')]},'country':{'type':Sequelize[_0x7bd8('0x3')]},'dateOfBirth':{'type':Sequelize[_0x7bd8('0x3')]},'description':{'type':Sequelize[_0x7bd8('0x4')]},'phone':{'type':Sequelize[_0x7bd8('0x3')]},'mobile':{'type':Sequelize[_0x7bd8('0x3')]},'fax':{'type':Sequelize[_0x7bd8('0x3')]},'email':{'type':Sequelize[_0x7bd8('0x3')]},'url':{'type':Sequelize[_0x7bd8('0x3')]},'facebook':{'type':Sequelize[_0x7bd8('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7bd8('0x3')]},'skype':{'type':Sequelize[_0x7bd8('0x3')]},'teams':{'type':Sequelize[_0x7bd8('0x3')]},'viber':{'type':Sequelize[_0x7bd8('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x7bd8('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x7bd8('0x5')](0x2)[_0x7bd8('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7bd8('0x7')],'defaultValue':Sequelize[_0x7bd8('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4ce8ed4..32088cb 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3f7=['send','index','keys','length','startsWith','cf_','push','findOne','trimStart','all','fieldType','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','select','field','color','from','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','value','split','map','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','buildExpression','text','start','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','DESC','having','t.id\x20IN\x20?','resolve','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.phone','c.fax','c.email','c.ListId','c.deletedAt','TagIds','Tags','rows','catch','destroy','params','describe','tags','columnName','displayName','findAll','alias','custom','values','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','join','bulkCreate','each','duplicates','spread','show','$and','omit','format','cf_%d','find','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','Tag','options','setTags','ids','rawAttributes','ContactId','include','includeAll','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','agent','No\x20ListId\x20specified','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name'];(function(_0x2f8358,_0x4b9700){var _0x222968=function(_0x215e6c){while(--_0x215e6c){_0x2f8358['push'](_0x2f8358['shift']());}};_0x222968(++_0x4b9700);}(_0xb3f7,0xc9));var _0x7b3f=function(_0x2f72b8,_0x586ae2){_0x2f72b8=_0x2f72b8-0x0;var _0x1479ea=_0xb3f7[_0x2f72b8];return _0x1479ea;};'use strict';var pdf=require(_0x7b3f('0x0'));var emlformat=require(_0x7b3f('0x1'));var rimraf=require(_0x7b3f('0x2'));var zipdir=require(_0x7b3f('0x3'));var jsonpatch=require(_0x7b3f('0x4'));var rp=require('request-promise');var moment=require(_0x7b3f('0x5'));var BPromise=require(_0x7b3f('0x6'));var Mustache=require(_0x7b3f('0x7'));var util=require(_0x7b3f('0x8'));var path=require(_0x7b3f('0x9'));var sox=require(_0x7b3f('0xa'));var csv=require(_0x7b3f('0xb'));var ejs=require(_0x7b3f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7b3f('0xd'));var crypto=require(_0x7b3f('0xe'));var jsforce=require(_0x7b3f('0xf'));var deskjs=require(_0x7b3f('0x10'));var toCsv=require(_0x7b3f('0xb'));var querystring=require(_0x7b3f('0x11'));var Papa=require(_0x7b3f('0x12'));var Redis=require(_0x7b3f('0x13'));var authService=require(_0x7b3f('0x14'));var qs=require(_0x7b3f('0x15'));var as=require(_0x7b3f('0x16'));var hardwareService=require(_0x7b3f('0x17'));var logger=require(_0x7b3f('0x18'))(_0x7b3f('0x19'));var utils=require('../../config/utils');var config=require(_0x7b3f('0x1a'));var db=require(_0x7b3f('0x1b'))['db'];config['redis']=_[_0x7b3f('0x1c')](config[_0x7b3f('0x1d')],{'host':_0x7b3f('0x1e'),'port':0x18eb});var socket=require(_0x7b3f('0x1f'))(new Redis(config['redis']));require(_0x7b3f('0x20'))[_0x7b3f('0x21')](socket);function respondWithStatusCode(_0xe860c5,_0x3496cb){_0x3496cb=_0x3496cb||0xcc;return function(_0x2c0f49){if(_0x2c0f49){return _0xe860c5['sendStatus'](_0x3496cb);}return _0xe860c5[_0x7b3f('0x22')](_0x3496cb)[_0x7b3f('0x23')]();};}function respondWithResult(_0x2a1753,_0x403bbf){_0x403bbf=_0x403bbf||0xc8;return function(_0x5dc458){if(_0x5dc458){return _0x2a1753[_0x7b3f('0x22')](_0x403bbf)[_0x7b3f('0x24')](_0x5dc458);}};}function respondWithFilteredResult(_0x436459,_0x4b03ff){return function(_0x5bf75d){if(_0x5bf75d){var _0x2a4e6d=_0x5bf75d[_0x7b3f('0x25')],_0x1c4ed1=_0x4b03ff[_0x7b3f('0x26')],_0x350c0d=_0x4b03ff[_0x7b3f('0x26')]+_0x4b03ff[_0x7b3f('0x27')],_0x852ad8;if(_0x350c0d>=_0x2a4e6d){_0x350c0d=_0x2a4e6d;_0x852ad8=0xc8;}else{_0x852ad8=0xce;}_0x436459['status'](_0x852ad8);return _0x436459[_0x7b3f('0x28')](_0x7b3f('0x29'),_0x1c4ed1+'-'+_0x350c0d+'/'+_0x2a4e6d)[_0x7b3f('0x24')](_0x5bf75d);}return null;};}function patchUpdates(_0x4708b9){return function(_0x47b9b8){try{jsonpatch['apply'](_0x47b9b8,_0x4708b9,!![]);}catch(_0x2b9152){return BPromise[_0x7b3f('0x2a')](_0x2b9152);}return _0x47b9b8[_0x7b3f('0x2b')]();};}function saveUpdates(_0xbe56ed,_0x201d74){return function(_0x55b4a8){if(_0x55b4a8){return _0x55b4a8[_0x7b3f('0x2c')](_0xbe56ed)[_0x7b3f('0x2d')](function(_0x3704a5){return _0x3704a5;});}return null;};}function removeEntity(_0xb53691,_0x12bc9f){return function(_0x110837){if(_0x110837){return _0x110837['destroy']()['then'](function(){_0xb53691[_0x7b3f('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9279,_0x462365){return function(_0x144372){if(!_0x144372){_0x2f9279[_0x7b3f('0x2e')](0x194);}return _0x144372;};}function handleError(_0x378056,_0xc6c521){_0xc6c521=_0xc6c521||0x1f4;return function(_0x501639){logger[_0x7b3f('0x2f')](_0x501639[_0x7b3f('0x30')]);if(_0x501639[_0x7b3f('0x31')]){delete _0x501639[_0x7b3f('0x31')];}_0x378056[_0x7b3f('0x22')](_0xc6c521)[_0x7b3f('0x32')](_0x501639);};}exports[_0x7b3f('0x33')]=function(_0x539109,_0x2fe623){var _0x3b16ff={},_0x5f4397={},_0x5073d0={'count':0x0,'rows':[]};return db['CmContact']['describe']()['then'](function(_0x4c96c0){var _0x3f6f2f=[];for(var _0xf54dfb=0x0;_0xf54dfb0x1){_0x471382['or'](_0x7b3f('0x72'),qs[_0x7b3f('0x73')](_0x49d51b),null);}else{if(qs[_0x7b3f('0x74')](_0x49d51b)){_0x471382['or'](_0x7b3f('0x75'),_0x49d51b+'%');_0x471382['or'](_0x7b3f('0x76'),_0x49d51b+'%');_0x471382['or'](_0x7b3f('0x77'),_0x49d51b+'%');_0x471382['or'](_0x7b3f('0x78'),_0x49d51b+'%');}else if(qs[_0x7b3f('0x79')](_0x49d51b)){_0x471382['or']('c.email\x20LIKE\x20?',_0x49d51b+'%');}else{_0x471382['or'](_0x7b3f('0x7a'),'%'+_0x49d51b+'%');_0x471382['or']('c.lastName\x20LIKE\x20?','%'+_0x49d51b+'%');_0x471382['or'](_0x7b3f('0x7b'),'%'+_0x49d51b+'%');}}}}_0x5c1aac['where'](_0x471382);_0x5c1aac[_0x7b3f('0x7c')](_0x7b3f('0x7d'));var _0x9b5209={'type':db[_0x7b3f('0x7e')][_0x7b3f('0x7f')]['SELECT'],'raw':!![]};var _0x329160=_0x5c1aac[_0x7b3f('0x80')]()[_0x7b3f('0x4b')]('c.id');if(_0x3b16ff['order']){_0x3b16ff[_0x7b3f('0x45')][_0x7b3f('0x67')](function(_0x2b5a62){_0x5c1aac[_0x7b3f('0x45')]('c.'+_0x2b5a62[0x0],_0x2b5a62[0x1]===_0x7b3f('0x81')?![]:!![]);});}if(!_[_0x7b3f('0x66')](_0xa51de)){_0x5c1aac[_0x7b3f('0x82')](_0x481d9b);_0x329160[_0x7b3f('0x47')](_0x7b3f('0x83'),_0xa51de);}BPromise[_0x7b3f('0x84')]()['then'](function(){if(_0x3a37a0&&!_['some'](_0x3a37a0[_0x7b3f('0x57')],[_0x7b3f('0x4b'),_0x7b3f('0x5c')])){return _0x539109[_0x7b3f('0x85')][_0x7b3f('0x86')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2d988c){if(_[_0x7b3f('0x66')](_0x2d988c)){_0x329160[_0x7b3f('0x47')]('c.ListId\x20IS\x20NULL');_0x5c1aac[_0x7b3f('0x47')](_0x7b3f('0x87'));}else{_0x329160['where'](_0x7b3f('0x69'),_[_0x7b3f('0x5a')](_0x2d988c,'id'));_0x5c1aac[_0x7b3f('0x47')](_0x7b3f('0x69'),_[_0x7b3f('0x5a')](_0x2d988c,'id'));}});}else{return;}})[_0x7b3f('0x2d')](function(){db[_0x7b3f('0x88')][_0x7b3f('0x3f')](_0x329160[_0x7b3f('0x89')](),_0x9b5209)[_0x7b3f('0x2d')](function(_0x2ea2fe){_0x5073d0['count']=_0x2ea2fe[_0x7b3f('0x35')];if(_0x5073d0[_0x7b3f('0x25')]===0x0)return[];return db[_0x7b3f('0x88')][_0x7b3f('0x3f')](_0x515199[_0x7b3f('0x89')](),_0x9b5209);})[_0x7b3f('0x2d')](function(_0x562cc1){_0x40e399=_[_0x7b3f('0x8a')](_0x562cc1,'id');_0x9b5209=_[_0x7b3f('0x8b')](_0x9b5209,{'model':db[_0x7b3f('0x8c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x539109[_0x7b3f('0x3f')]['fields']){_0x3b16ff[_0x7b3f('0x41')][_0x7b3f('0x67')](function(_0x44e2dc){_0x5c1aac[_0x7b3f('0x4b')]('c.'+_0x44e2dc);});}else{_0x5c1aac['field'](_0x7b3f('0x7d'));_0x5c1aac[_0x7b3f('0x4b')](_0x7b3f('0x8d'));_0x5c1aac[_0x7b3f('0x4b')]('c.lastName');_0x5c1aac[_0x7b3f('0x4b')](_0x7b3f('0x8e'));_0x5c1aac[_0x7b3f('0x4b')]('c.mobile');_0x5c1aac[_0x7b3f('0x4b')](_0x7b3f('0x8f'));_0x5c1aac[_0x7b3f('0x4b')](_0x7b3f('0x90'));_0x5c1aac[_0x7b3f('0x4b')](_0x7b3f('0x91'));_0x5c1aac[_0x7b3f('0x4b')](_0x7b3f('0x92'));_0x5c1aac[_0x7b3f('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7b3f('0x93'));}if(_0x3b16ff[_0x7b3f('0x27')])_0x5c1aac[_0x7b3f('0x27')](_0x3b16ff['limit']);if(_0x3b16ff['offset'])_0x5c1aac[_0x7b3f('0x26')](_0x3b16ff[_0x7b3f('0x26')]);return db[_0x7b3f('0x88')]['query'](_0x5c1aac['toString'](),_0x9b5209);})[_0x7b3f('0x2d')](function(_0x2c5250){_0x2c5250[_0x7b3f('0x67')](function(_0xf95a8a){if(_0xf95a8a[_0x7b3f('0x93')]){_0xf95a8a[_0x7b3f('0x94')]=[];_0xf95a8a['TagIds'][_0x7b3f('0x59')](',')[_0x7b3f('0x67')](function(_0x4f2b54){_0xf95a8a[_0x7b3f('0x94')][_0x7b3f('0x38')](_0x40e399[_0x4f2b54]);});}delete _0xf95a8a[_0x7b3f('0x93')];});_0x5073d0[_0x7b3f('0x95')]=_0x2c5250;return _0x5073d0;})['then'](respondWithFilteredResult(_0x2fe623,_0x3b16ff));});})[_0x7b3f('0x96')](handleError(_0x2fe623,null));};exports[_0x7b3f('0x97')]=function(_0x4e6ca8,_0x53bc89){return db[_0x7b3f('0x8c')]['find']({'where':{'id':_0x4e6ca8[_0x7b3f('0x98')]['id']}})[_0x7b3f('0x2d')](handleEntityNotFound(_0x53bc89,null))['then'](removeEntity(_0x53bc89,null))[_0x7b3f('0x96')](handleError(_0x53bc89,null));};exports[_0x7b3f('0x99')]=function(_0x5297be,_0x3fc317){return db[_0x7b3f('0x8c')][_0x7b3f('0x99')]()[_0x7b3f('0x2d')](function(_0x4bc7ed){delete _0x4bc7ed[_0x7b3f('0x9a')];for(var _0x380512=0x0;_0x380512=_0x5ca29b){_0x49161d=_0x5ca29b;_0x94d6e2=0xc8;}else{_0x94d6e2=0xce;}_0x52f065['status'](_0x94d6e2);return _0x52f065[_0x57db('0x24')]('Content-Range',_0x1c17eb+'-'+_0x49161d+'/'+_0x5ca29b)[_0x57db('0x20')](_0x57f45d);}return null;};}function patchUpdates(_0x1ef00e){return function(_0x10e4a2){try{jsonpatch[_0x57db('0x25')](_0x10e4a2,_0x1ef00e,!![]);}catch(_0x4100de){return BPromise[_0x57db('0x26')](_0x4100de);}return _0x10e4a2[_0x57db('0x27')]();};}function saveUpdates(_0x2b7245,_0x58bac2){return function(_0x3139b6){if(_0x3139b6){return _0x3139b6[_0x57db('0x28')](_0x2b7245)[_0x57db('0x29')](function(_0x37500b){return _0x37500b;});}return null;};}function removeEntity(_0x44f655,_0x5eae31){return function(_0x2fca5f){if(_0x2fca5f){return _0x2fca5f[_0x57db('0x2a')]()[_0x57db('0x29')](function(){_0x44f655[_0x57db('0x1e')](0xcc)[_0x57db('0x1f')]();});}};}function handleEntityNotFound(_0x268e11,_0x341d47){return function(_0x4e2c0d){if(!_0x4e2c0d){_0x268e11['sendStatus'](0x194);}return _0x4e2c0d;};}function handleError(_0x394863,_0x351794){_0x351794=_0x351794||0x1f4;return function(_0x265498){logger[_0x57db('0x2b')](_0x265498[_0x57db('0x2c')]);if(_0x265498[_0x57db('0x2d')]){delete _0x265498['name'];}_0x394863[_0x57db('0x1e')](_0x351794)['send'](_0x265498);};}exports[_0x57db('0x2e')]=function(_0x4baaae,_0x805b74){var _0x3cdd52={},_0x485e7d={},_0xb8ad19={'count':0x0,'rows':[]};return db[_0x57db('0x2f')][_0x57db('0x30')]()['then'](function(_0x17dae2){var _0x19a48b=[];for(var _0x2d3a99=0x0;_0x2d3a990x1){_0x2029da['or'](_0x57db('0x6d'),qs['getFullTextValue'](_0x26d5b3),null);}else{if(qs['isNumeric'](_0x26d5b3)){_0x2029da['or'](_0x57db('0x6e'),_0x26d5b3+'%');_0x2029da['or'](_0x57db('0x6f'),_0x26d5b3+'%');_0x2029da['or'](_0x57db('0x70'),_0x26d5b3+'%');_0x2029da['or']('c.fax\x20LIKE\x20?',_0x26d5b3+'%');}else if(qs[_0x57db('0x71')](_0x26d5b3)){_0x2029da['or'](_0x57db('0x72'),_0x26d5b3+'%');}else{_0x2029da['or'](_0x57db('0x73'),'%'+_0x26d5b3+'%');_0x2029da['or']('c.lastName\x20LIKE\x20?','%'+_0x26d5b3+'%');_0x2029da['or'](_0x57db('0x72'),'%'+_0x26d5b3+'%');}}}}_0x1a4259[_0x57db('0x43')](_0x2029da);_0x1a4259['group'](_0x57db('0x74'));var _0x43640a={'type':db[_0x57db('0x75')][_0x57db('0x76')]['SELECT'],'raw':!![]};var _0x3d21b0=_0x1a4259[_0x57db('0x77')]()[_0x57db('0x45')](_0x57db('0x74'));if(_0x3cdd52[_0x57db('0x78')]){_0x3cdd52[_0x57db('0x78')][_0x57db('0x59')](function(_0x13d65e){_0x1a4259['order']('c.'+_0x13d65e[0x0],_0x13d65e[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x5128e8)){_0x1a4259['having'](_0x1e5f47);_0x3d21b0['where']('t.id\x20IN\x20?',_0x5128e8);}BPromise['resolve']()[_0x57db('0x29')](function(){if(_0x40a893&&!_[_0x57db('0x79')](_0x40a893[_0x57db('0x54')],[_0x57db('0x45'),_0x57db('0x7a')])){return _0x4baaae[_0x57db('0x7b')][_0x57db('0x7c')]({'attributes':['id'],'raw':!![]})[_0x57db('0x29')](function(_0x445d34){if(_[_0x57db('0x66')](_0x445d34)){_0x3d21b0[_0x57db('0x43')](_0x57db('0x7d'));_0x1a4259[_0x57db('0x43')]('c.ListId\x20IS\x20NULL');}else{_0x3d21b0[_0x57db('0x43')](_0x57db('0x67'),_[_0x57db('0x62')](_0x445d34,'id'));_0x1a4259[_0x57db('0x43')](_0x57db('0x67'),_['map'](_0x445d34,'id'));}});}else{return;}})[_0x57db('0x29')](function(){db[_0x57db('0x7e')][_0x57db('0x3b')](_0x3d21b0[_0x57db('0x7f')](),_0x43640a)['then'](function(_0x1f1601){_0xb8ad19[_0x57db('0x21')]=_0x1f1601['length'];if(_0xb8ad19['count']===0x0)return[];return db[_0x57db('0x7e')][_0x57db('0x3b')](_0x3193ae[_0x57db('0x7f')](),_0x43640a);})[_0x57db('0x29')](function(_0x586462){_0x38f731=_['keyBy'](_0x586462,'id');_0x43640a=_['merge'](_0x43640a,{'model':db[_0x57db('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4baaae[_0x57db('0x3b')][_0x57db('0x3f')]){_0x3cdd52[_0x57db('0x3d')][_0x57db('0x59')](function(_0x4db4f3){_0x1a4259[_0x57db('0x45')]('c.'+_0x4db4f3);});}else{_0x1a4259[_0x57db('0x45')](_0x57db('0x74'));_0x1a4259['field'](_0x57db('0x80'));_0x1a4259[_0x57db('0x45')]('c.lastName');_0x1a4259[_0x57db('0x45')](_0x57db('0x81'));_0x1a4259['field'](_0x57db('0x82'));_0x1a4259[_0x57db('0x45')](_0x57db('0x83'));_0x1a4259[_0x57db('0x45')](_0x57db('0x84'));_0x1a4259['field']('c.ListId');_0x1a4259[_0x57db('0x45')]('c.deletedAt');_0x1a4259[_0x57db('0x45')](_0x57db('0x85'),_0x57db('0x86'));}if(_0x3cdd52[_0x57db('0x23')])_0x1a4259[_0x57db('0x23')](_0x3cdd52[_0x57db('0x23')]);if(_0x3cdd52[_0x57db('0x22')])_0x1a4259[_0x57db('0x22')](_0x3cdd52[_0x57db('0x22')]);return db[_0x57db('0x7e')][_0x57db('0x3b')](_0x1a4259[_0x57db('0x7f')](),_0x43640a);})[_0x57db('0x29')](function(_0x134acb){_0x134acb[_0x57db('0x59')](function(_0x58d594){if(_0x58d594[_0x57db('0x86')]){_0x58d594[_0x57db('0x87')]=[];_0x58d594['TagIds'][_0x57db('0x58')](',')[_0x57db('0x59')](function(_0x434b6c){_0x58d594[_0x57db('0x87')][_0x57db('0x33')](_0x38f731[_0x434b6c]);});}delete _0x58d594['TagIds'];});_0xb8ad19['rows']=_0x134acb;return _0xb8ad19;})[_0x57db('0x29')](respondWithFilteredResult(_0x805b74,_0x3cdd52));});})[_0x57db('0x88')](handleError(_0x805b74,null));};exports[_0x57db('0x2a')]=function(_0x13f47c,_0x3bae4a){return db[_0x57db('0x2f')][_0x57db('0x55')]({'where':{'id':_0x13f47c[_0x57db('0x89')]['id']}})[_0x57db('0x29')](handleEntityNotFound(_0x3bae4a,null))[_0x57db('0x29')](removeEntity(_0x3bae4a,null))[_0x57db('0x88')](handleError(_0x3bae4a,null));};exports[_0x57db('0x30')]=function(_0x4cdb78,_0x14c5bd){return db[_0x57db('0x2f')][_0x57db('0x30')]()['then'](function(_0x1432fa){delete _0x1432fa[_0x57db('0x8a')];for(var _0x474e3c=0x0;_0x474e3c{}\s\\|]/g,'-');_0x517313(null,util['format']('%s-%s%s',path[_0x22eb('0x1d')](_0x36be50[_0x22eb('0x1b')],path[_0x22eb('0x1e')](_0x36be50[_0x22eb('0x1b')])),Date[_0x22eb('0x1f')](),path[_0x22eb('0x1e')](_0x36be50[_0x22eb('0x1b')])));}})});router['post'](_0x22eb('0x20'),upload[_0x22eb('0x21')](_0x22eb('0x22')),controller[_0x22eb('0x23')]);var upload=multer({'storage':multer[_0x22eb('0x17')]({'destination':function(_0x4da252,_0x12c133,_0x6f8ff3){_0x6f8ff3(null,path[_0x22eb('0x18')](config['root'],_0x22eb('0x1a')));},'filename':function(_0x259847,_0x4b409a,_0x32a4b6){_0x4b409a[_0x22eb('0x1b')]=_0x4b409a[_0x22eb('0x1b')][_0x22eb('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x32a4b6(null,util[_0x22eb('0x24')]('%s-%s%s',path['basename'](_0x4b409a[_0x22eb('0x1b')],path[_0x22eb('0x1e')](_0x4b409a[_0x22eb('0x1b')])),Date[_0x22eb('0x1f')](),path[_0x22eb('0x1e')](_0x4b409a[_0x22eb('0x1b')])));}})});router[_0x22eb('0x13')](_0x22eb('0x25'),upload[_0x22eb('0x21')](_0x22eb('0x22')),controller[_0x22eb('0x26')]);router[_0x22eb('0x13')]('/upload/:id',auth[_0x22eb('0x7')](),controller['import']);router[_0x22eb('0x27')](_0x22eb('0xc'),auth[_0x22eb('0x7')](),controller[_0x22eb('0x28')]);router[_0x22eb('0x29')](_0x22eb('0xc'),auth[_0x22eb('0x7')](),controller[_0x22eb('0x2a')]);module[_0x22eb('0x2b')]=router; \ No newline at end of file +var _0x7dfd=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','/create_many','bulkCreate','/:id/tags','setTags','diskStorage','join','root','originalname','replace','format','basename','extname','now','/csv','uploadCsv','server/files/tmp','%s-%s%s','single','file','/upload/:id','import','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getHoppers'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var auth=require(_0xd7df('0x6'));var interaction=require(_0xd7df('0x7'));var config=require(_0xd7df('0x8'));var controller=require(_0xd7df('0x9'));router[_0xd7df('0xa')]('/',auth[_0xd7df('0xb')](),controller[_0xd7df('0xc')]);router[_0xd7df('0xa')](_0xd7df('0xd'),auth[_0xd7df('0xb')](),controller[_0xd7df('0xe')]);router['get'](_0xd7df('0xf'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x10')]);router[_0xd7df('0xa')]('/:id/tags',auth[_0xd7df('0xb')](),controller['getTags']);router[_0xd7df('0xa')]('/:id/hoppers',auth[_0xd7df('0xb')](),controller[_0xd7df('0x11')]);router[_0xd7df('0xa')](_0xd7df('0x12'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x13')]);router[_0xd7df('0xa')](_0xd7df('0x14'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x15')]);router[_0xd7df('0xa')](_0xd7df('0x16'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x17')]);router[_0xd7df('0x18')](_0xd7df('0x19'),auth[_0xd7df('0xb')](),controller['merge']);router[_0xd7df('0x18')]('/',auth[_0xd7df('0xb')](),controller['create']);router[_0xd7df('0x18')](_0xd7df('0x1a'),auth['isAuthenticated'](),controller[_0xd7df('0x1b')]);router[_0xd7df('0x18')](_0xd7df('0x1c'),auth['isAuthenticated'](),controller[_0xd7df('0x1d')]);var upload=multer({'storage':multer[_0xd7df('0x1e')]({'destination':function(_0x3cea3,_0x5ba653,_0x96d86e){_0x96d86e(null,path[_0xd7df('0x1f')](config[_0xd7df('0x20')],'server/files/tmp'));},'filename':function(_0x4188af,_0x5aecbb,_0x225e33){_0x5aecbb['originalname']=_0x5aecbb[_0xd7df('0x21')][_0xd7df('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x225e33(null,util[_0xd7df('0x23')]('%s-%s%s',path[_0xd7df('0x24')](_0x5aecbb['originalname'],path[_0xd7df('0x25')](_0x5aecbb[_0xd7df('0x21')])),Date[_0xd7df('0x26')](),path[_0xd7df('0x25')](_0x5aecbb[_0xd7df('0x21')])));}})});router[_0xd7df('0x18')](_0xd7df('0x27'),upload['single']('file'),controller[_0xd7df('0x28')]);var upload=multer({'storage':multer[_0xd7df('0x1e')]({'destination':function(_0x26047f,_0x459f11,_0x13f190){_0x13f190(null,path[_0xd7df('0x1f')](config[_0xd7df('0x20')],_0xd7df('0x29')));},'filename':function(_0x163904,_0x5c4d17,_0xe53f53){_0x5c4d17[_0xd7df('0x21')]=_0x5c4d17[_0xd7df('0x21')][_0xd7df('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe53f53(null,util[_0xd7df('0x23')](_0xd7df('0x2a'),path[_0xd7df('0x24')](_0x5c4d17[_0xd7df('0x21')],path['extname'](_0x5c4d17['originalname'])),Date['now'](),path['extname'](_0x5c4d17['originalname'])));}})});router[_0xd7df('0x18')]('/upload',upload[_0xd7df('0x2b')](_0xd7df('0x2c')),controller['upload']);router[_0xd7df('0x18')](_0xd7df('0x2d'),auth['isAuthenticated'](),controller[_0xd7df('0x2e')]);router[_0xd7df('0x2f')](_0xd7df('0xf'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x30')]);router[_0xd7df('0x31')]('/:id',auth[_0xd7df('0xb')](),controller[_0xd7df('0x32')]);module[_0xd7df('0x33')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 9a23f17..0e08cec 100644 --- a/server/api/cmCustomField/cmCustomField.attributes.js +++ b/server/api/cmCustomField/cmCustomField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x004f=['BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','select','parse','values','isArray'];(function(_0x4452d6,_0x2d301e){var _0x165645=function(_0x174624){while(--_0x174624){_0x4452d6['push'](_0x4452d6['shift']());}};_0x165645(++_0x2d301e);}(_0x004f,0x181));var _0xf004=function(_0x13bae6,_0x10681f){_0x13bae6=_0x13bae6-0x0;var _0x44c2c2=_0x004f[_0x13bae6];return _0x44c2c2;};'use strict';var Sequelize=require(_0xf004('0x0'));var _=require(_0xf004('0x1'));module[_0xf004('0x2')]={'name':{'type':Sequelize[_0xf004('0x3')],'get':function(_0xa1404f){return this[_0xf004('0x4')](_0xf004('0x5'));}},'alias':{'type':Sequelize[_0xf004('0x6')],'allowNull':![],'set':function(_0x39187f){this[_0xf004('0x7')](_0xf004('0x5'),_0x39187f?_0x39187f:this[_0xf004('0x4')](_0xf004('0x8')));}},'type':{'type':Sequelize[_0xf004('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xf004('0x9')](_0xf004('0xa')),'get':function(){if(this['getDataValue']('type')===_0xf004('0xb')){return JSON[_0xf004('0xc')](this[_0xf004('0x4')]('values'));}else{return this[_0xf004('0x4')](_0xf004('0xd'));}},'set':function(_0x818a5f){if(Array[_0xf004('0xe')](_0x818a5f)){this[_0xf004('0x7')](_0xf004('0xd'),JSON['stringify'](_0x818a5f));}else{this[_0xf004('0x7')](_0xf004('0xd'),_0x818a5f);}}},'required':{'type':Sequelize[_0xf004('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x3413=['stringify','BOOLEAN','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','type','select','parse','values','isArray'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3413,0xb6));var _0x3341=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3413[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3341('0x0'));var _=require(_0x3341('0x1'));module['exports']={'name':{'type':Sequelize[_0x3341('0x2')],'get':function(_0x1c3dea){return this[_0x3341('0x3')](_0x3341('0x4'));}},'alias':{'type':Sequelize[_0x3341('0x5')],'allowNull':![],'set':function(_0x423a99){this[_0x3341('0x6')]('alias',_0x423a99?_0x423a99:this[_0x3341('0x3')]('name'));}},'type':{'type':Sequelize[_0x3341('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x3341('0x7')]('long'),'get':function(){if(this[_0x3341('0x3')](_0x3341('0x8'))===_0x3341('0x9')){return JSON[_0x3341('0xa')](this[_0x3341('0x3')](_0x3341('0xb')));}else{return this[_0x3341('0x3')](_0x3341('0xb'));}},'set':function(_0x1dd91b){if(Array[_0x3341('0xc')](_0x1dd91b)){this[_0x3341('0x6')]('values',JSON[_0x3341('0xd')](_0x1dd91b));}else{this[_0x3341('0x6')](_0x3341('0xb'),_0x1dd91b);}}},'required':{'type':Sequelize[_0x3341('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 70d2352..465d84f 100644 --- a/server/api/cmCustomField/cmCustomField.controller.js +++ b/server/api/cmCustomField/cmCustomField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb276=['name','index','CmCustomField','rawAttributes','type','key','model','differenceBy','map','query','keys','filters','fields','attributes','length','nolimit','limit','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','merge','find','body','destroy','create','transaction','TEXT','Sequelize','number','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','error','stack'];(function(_0x4f85d2,_0x35b0c0){var _0x182d76=function(_0x51d948){while(--_0x51d948){_0x4f85d2['push'](_0x4f85d2['shift']());}};_0x182d76(++_0x35b0c0);}(_0xb276,0x17f));var _0x6b27=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xb276[_0x4eec9b];return _0x2e3849;};'use strict';var pdf=require(_0x6b27('0x0'));var emlformat=require(_0x6b27('0x1'));var rimraf=require(_0x6b27('0x2'));var zipdir=require(_0x6b27('0x3'));var jsonpatch=require(_0x6b27('0x4'));var rp=require(_0x6b27('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6b27('0x6'));var util=require(_0x6b27('0x7'));var path=require(_0x6b27('0x8'));var sox=require(_0x6b27('0x9'));var csv=require('to-csv');var ejs=require(_0x6b27('0xa'));var fs=require('fs');var _=require(_0x6b27('0xb'));var squel=require(_0x6b27('0xc'));var crypto=require(_0x6b27('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b27('0xe'));var querystring=require(_0x6b27('0xf'));var Papa=require('papaparse');var Redis=require(_0x6b27('0x10'));var authService=require(_0x6b27('0x11'));var qs=require(_0x6b27('0x12'));var as=require(_0x6b27('0x13'));var hardwareService=require(_0x6b27('0x14'));var logger=require(_0x6b27('0x15'))('api');var utils=require(_0x6b27('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eb015,_0x382c39){_0x382c39=_0x382c39||0xcc;return function(_0x51d254){if(_0x51d254){return _0x1eb015[_0x6b27('0x17')](_0x382c39);}return _0x1eb015[_0x6b27('0x18')](_0x382c39)[_0x6b27('0x19')]();};}function respondWithResult(_0x5752c3,_0x34658f){_0x34658f=_0x34658f||0xc8;return function(_0x1a2784){if(_0x1a2784){return _0x5752c3[_0x6b27('0x18')](_0x34658f)[_0x6b27('0x1a')](_0x1a2784);}};}function respondWithFilteredResult(_0x2b5402,_0x27b5cd){return function(_0x52fd5b){if(_0x52fd5b){var _0xbd16f=_0x52fd5b[_0x6b27('0x1b')],_0x49c542=_0x27b5cd[_0x6b27('0x1c')],_0x2a1e15=_0x27b5cd[_0x6b27('0x1c')]+_0x27b5cd['limit'],_0xf91b43;if(_0x2a1e15>=_0xbd16f){_0x2a1e15=_0xbd16f;_0xf91b43=0xc8;}else{_0xf91b43=0xce;}_0x2b5402[_0x6b27('0x18')](_0xf91b43);return _0x2b5402[_0x6b27('0x1d')](_0x6b27('0x1e'),_0x49c542+'-'+_0x2a1e15+'/'+_0xbd16f)[_0x6b27('0x1a')](_0x52fd5b);}return null;};}function patchUpdates(_0x5ea868){return function(_0x204e56){try{jsonpatch['apply'](_0x204e56,_0x5ea868,!![]);}catch(_0x290b4c){return BPromise[_0x6b27('0x1f')](_0x290b4c);}return _0x204e56[_0x6b27('0x20')]();};}function saveUpdates(_0x4681bc,_0x331b67){return function(_0xf3e96c){if(_0xf3e96c){return _0xf3e96c[_0x6b27('0x21')](_0x4681bc)[_0x6b27('0x22')](function(_0xbae1fc){return _0xbae1fc;});}return null;};}function removeEntity(_0x5bdb6b,_0x8438fe){return function(_0x1a60d2){if(_0x1a60d2){return _0x1a60d2['destroy']()[_0x6b27('0x22')](function(){_0x5bdb6b['status'](0xcc)[_0x6b27('0x19')]();});}};}function handleEntityNotFound(_0x2560cd,_0x2aaedb){return function(_0x124582){if(!_0x124582){_0x2560cd[_0x6b27('0x17')](0x194);}return _0x124582;};}function handleError(_0x15e5b6,_0x1c1dad){_0x1c1dad=_0x1c1dad||0x1f4;return function(_0x4d5dee){logger[_0x6b27('0x23')](_0x4d5dee[_0x6b27('0x24')]);if(_0x4d5dee[_0x6b27('0x25')]){delete _0x4d5dee['name'];}_0x15e5b6[_0x6b27('0x18')](_0x1c1dad)['send'](_0x4d5dee);};}exports[_0x6b27('0x26')]=function(_0x55e7c9,_0x493f24){var _0x45d3df={},_0x403cda={},_0x336f0f={'count':0x0,'rows':[]};var _0x112885=_['map'](db[_0x6b27('0x27')][_0x6b27('0x28')],function(_0x15d241){return{'name':_0x15d241['fieldName'],'type':_0x15d241[_0x6b27('0x29')][_0x6b27('0x2a')]};});_0x403cda[_0x6b27('0x2b')]=_[_0x6b27('0x2c')](_[_0x6b27('0x2d')](_0x112885,_0x6b27('0x25')),[_0x6b27('0x25')]);_0x403cda[_0x6b27('0x2e')]=_[_0x6b27('0x2f')](_0x55e7c9[_0x6b27('0x2e')]);_0x403cda[_0x6b27('0x30')]=_['intersection'](_0x403cda[_0x6b27('0x2b')],_0x403cda[_0x6b27('0x2e')]);_0x45d3df['attributes']=_['intersection'](_0x403cda[_0x6b27('0x2b')],qs[_0x6b27('0x31')](_0x55e7c9['query'][_0x6b27('0x31')]));_0x45d3df[_0x6b27('0x32')]=_0x45d3df[_0x6b27('0x32')][_0x6b27('0x33')]?_0x45d3df[_0x6b27('0x32')]:_0x403cda[_0x6b27('0x2b')];if(!_0x55e7c9[_0x6b27('0x2e')]['hasOwnProperty'](_0x6b27('0x34'))){_0x45d3df['limit']=qs[_0x6b27('0x35')](_0x55e7c9[_0x6b27('0x2e')][_0x6b27('0x35')]);_0x45d3df[_0x6b27('0x1c')]=qs[_0x6b27('0x1c')](_0x55e7c9[_0x6b27('0x2e')][_0x6b27('0x1c')]);}_0x45d3df['order']=qs[_0x6b27('0x36')](_0x55e7c9[_0x6b27('0x2e')]['sort']);_0x45d3df['where']=qs['filters'](_[_0x6b27('0x37')](_0x55e7c9[_0x6b27('0x2e')],_0x403cda[_0x6b27('0x30')]));if(_0x55e7c9[_0x6b27('0x2e')][_0x6b27('0x38')]){_0x45d3df[_0x6b27('0x39')]=_['merge'](_0x45d3df['where'],{'$or':_[_0x6b27('0x2d')](_0x112885,function(_0x453d24){if(_0x453d24['type']!==_0x6b27('0x3a')){var _0x24d16d={};_0x24d16d[_0x453d24['name']]={'$like':'%'+_0x55e7c9['query']['filter']+'%'};return _0x24d16d;}})});}_0x45d3df=_['merge']({},_0x45d3df,_0x55e7c9[_0x6b27('0x3b')]);var _0x3652a5={'where':_0x45d3df[_0x6b27('0x39')]};return db[_0x6b27('0x27')][_0x6b27('0x1b')](_0x3652a5)['then'](function(_0x24b844){_0x336f0f['count']=_0x24b844;if(_0x55e7c9[_0x6b27('0x2e')][_0x6b27('0x3c')]){_0x45d3df[_0x6b27('0x3d')]=[{'all':!![]}];}return db[_0x6b27('0x27')][_0x6b27('0x3e')](_0x45d3df);})[_0x6b27('0x22')](function(_0x59b4ba){_0x336f0f[_0x6b27('0x3f')]=_0x59b4ba;return _0x336f0f;})[_0x6b27('0x22')](respondWithFilteredResult(_0x493f24,_0x45d3df))[_0x6b27('0x40')](handleError(_0x493f24,null));};exports[_0x6b27('0x41')]=function(_0x5c702b,_0xc33abb){var _0x48fecc={'raw':!![],'where':{'id':_0x5c702b[_0x6b27('0x42')]['id']}},_0xfa6984={};_0xfa6984[_0x6b27('0x2b')]=_[_0x6b27('0x2f')](db[_0x6b27('0x27')][_0x6b27('0x28')]);_0xfa6984[_0x6b27('0x2e')]=_[_0x6b27('0x2f')](_0x5c702b[_0x6b27('0x2e')]);_0xfa6984[_0x6b27('0x30')]=_[_0x6b27('0x43')](_0xfa6984[_0x6b27('0x2b')],_0xfa6984['query']);_0x48fecc[_0x6b27('0x32')]=_[_0x6b27('0x43')](_0xfa6984[_0x6b27('0x2b')],qs[_0x6b27('0x31')](_0x5c702b[_0x6b27('0x2e')][_0x6b27('0x31')]));_0x48fecc['attributes']=_0x48fecc[_0x6b27('0x32')][_0x6b27('0x33')]?_0x48fecc[_0x6b27('0x32')]:_0xfa6984['model'];if(_0x5c702b[_0x6b27('0x2e')][_0x6b27('0x3c')]){_0x48fecc[_0x6b27('0x3d')]=[{'all':!![]}];}_0x48fecc=_[_0x6b27('0x44')]({},_0x48fecc,_0x5c702b[_0x6b27('0x3b')]);return db[_0x6b27('0x27')][_0x6b27('0x45')](_0x48fecc)[_0x6b27('0x22')](handleEntityNotFound(_0xc33abb,null))[_0x6b27('0x22')](respondWithResult(_0xc33abb,null))[_0x6b27('0x40')](handleError(_0xc33abb,null));};exports[_0x6b27('0x21')]=function(_0x310d26,_0x1ed7b2){if(_0x310d26[_0x6b27('0x46')]['id']){delete _0x310d26['body']['id'];}return db['CmCustomField'][_0x6b27('0x45')]({'where':{'id':_0x310d26['params']['id']}})['then'](handleEntityNotFound(_0x1ed7b2,null))[_0x6b27('0x22')](saveUpdates(_0x310d26[_0x6b27('0x46')],null))[_0x6b27('0x22')](respondWithResult(_0x1ed7b2,null))[_0x6b27('0x40')](handleError(_0x1ed7b2,null));};exports[_0x6b27('0x47')]=function(_0x44d8d9,_0x5b2b8c){return db['CmCustomField'][_0x6b27('0x45')]({'where':{'id':_0x44d8d9[_0x6b27('0x42')]['id']}})[_0x6b27('0x22')](handleEntityNotFound(_0x5b2b8c,null))[_0x6b27('0x22')](removeEntity(_0x5b2b8c,null))[_0x6b27('0x40')](handleError(_0x5b2b8c,null));};exports[_0x6b27('0x48')]=function(_0x420cf9,_0x44a279){var _0x10d852;return db['sequelize'][_0x6b27('0x49')](function(_0x2fe44d){return db['CmCustomField'][_0x6b27('0x48')](_0x420cf9[_0x6b27('0x46')],{'transaction':_0x2fe44d})['then'](function(_0x40d184){_0x10d852=_0x40d184;var _0x34afc4={'type':db['Sequelize'][_0x6b27('0x4a')],'transaction':_0x2fe44d};switch(_0x420cf9[_0x6b27('0x46')][_0x6b27('0x29')]){case'text':_0x34afc4['type']=db[_0x6b27('0x4b')][_0x6b27('0x4a')];break;case _0x6b27('0x4c'):_0x34afc4['type']=db[_0x6b27('0x4b')][_0x6b27('0x4d')];break;case'switch':_0x34afc4[_0x6b27('0x29')]=db[_0x6b27('0x4b')][_0x6b27('0x4e')];_0x34afc4[_0x6b27('0x4f')]=![];break;default:}return db['sequelize']['queryInterface'][_0x6b27('0x50')](_0x6b27('0x51'),util[_0x6b27('0x52')](_0x6b27('0x53'),_0x10d852['id']),_0x34afc4);})[_0x6b27('0x22')](function(){return _0x10d852;});})[_0x6b27('0x22')](respondWithResult(_0x44a279,0xc9))['catch'](handleError(_0x44a279,null));}; \ No newline at end of file +var _0xaca9=['index','CmCustomField','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','body','create','sequelize','transaction','TEXT','text','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','rimraf','fast-json-patch','request-promise','moment','util','path','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send'];(function(_0x4f06c5,_0x294b19){var _0x2cc047=function(_0x39abd6){while(--_0x39abd6){_0x4f06c5['push'](_0x4f06c5['shift']());}};_0x2cc047(++_0x294b19);}(_0xaca9,0x195));var _0x9aca=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xaca9[_0x599f41];return _0x2e4d58;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9aca('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9aca('0x1'));var rp=require(_0x9aca('0x2'));var moment=require(_0x9aca('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9aca('0x4'));var path=require(_0x9aca('0x5'));var sox=require(_0x9aca('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9aca('0x7'));var crypto=require('crypto');var jsforce=require(_0x9aca('0x8'));var deskjs=require(_0x9aca('0x9'));var toCsv=require(_0x9aca('0xa'));var querystring=require(_0x9aca('0xb'));var Papa=require(_0x9aca('0xc'));var Redis=require(_0x9aca('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9aca('0xe'));var as=require(_0x9aca('0xf'));var hardwareService=require(_0x9aca('0x10'));var logger=require(_0x9aca('0x11'))(_0x9aca('0x12'));var utils=require(_0x9aca('0x13'));var config=require(_0x9aca('0x14'));var db=require(_0x9aca('0x15'))['db'];function respondWithStatusCode(_0x3ab278,_0x3495cd){_0x3495cd=_0x3495cd||0xcc;return function(_0x956061){if(_0x956061){return _0x3ab278[_0x9aca('0x16')](_0x3495cd);}return _0x3ab278[_0x9aca('0x17')](_0x3495cd)[_0x9aca('0x18')]();};}function respondWithResult(_0x35dd7c,_0x50683d){_0x50683d=_0x50683d||0xc8;return function(_0x120bb3){if(_0x120bb3){return _0x35dd7c[_0x9aca('0x17')](_0x50683d)[_0x9aca('0x19')](_0x120bb3);}};}function respondWithFilteredResult(_0x13e745,_0x211e96){return function(_0x43e693){if(_0x43e693){var _0x1a04e5=_0x43e693[_0x9aca('0x1a')],_0x548288=_0x211e96[_0x9aca('0x1b')],_0x50ce8d=_0x211e96[_0x9aca('0x1b')]+_0x211e96[_0x9aca('0x1c')],_0x260e40;if(_0x50ce8d>=_0x1a04e5){_0x50ce8d=_0x1a04e5;_0x260e40=0xc8;}else{_0x260e40=0xce;}_0x13e745['status'](_0x260e40);return _0x13e745[_0x9aca('0x1d')](_0x9aca('0x1e'),_0x548288+'-'+_0x50ce8d+'/'+_0x1a04e5)[_0x9aca('0x19')](_0x43e693);}return null;};}function patchUpdates(_0x4043cf){return function(_0x4b440b){try{jsonpatch[_0x9aca('0x1f')](_0x4b440b,_0x4043cf,!![]);}catch(_0x1f12e4){return BPromise[_0x9aca('0x20')](_0x1f12e4);}return _0x4b440b[_0x9aca('0x21')]();};}function saveUpdates(_0x16fd12,_0x3b6abe){return function(_0xab76e0){if(_0xab76e0){return _0xab76e0[_0x9aca('0x22')](_0x16fd12)[_0x9aca('0x23')](function(_0x1d5e55){return _0x1d5e55;});}return null;};}function removeEntity(_0x3adf6b,_0x2812fe){return function(_0x409b9e){if(_0x409b9e){return _0x409b9e[_0x9aca('0x24')]()[_0x9aca('0x23')](function(){_0x3adf6b[_0x9aca('0x17')](0xcc)[_0x9aca('0x18')]();});}};}function handleEntityNotFound(_0x128af6,_0x2e4502){return function(_0x2f7e5a){if(!_0x2f7e5a){_0x128af6[_0x9aca('0x16')](0x194);}return _0x2f7e5a;};}function handleError(_0x27eb5c,_0x1cd8ab){_0x1cd8ab=_0x1cd8ab||0x1f4;return function(_0x417a42){logger[_0x9aca('0x25')](_0x417a42['stack']);if(_0x417a42[_0x9aca('0x26')]){delete _0x417a42[_0x9aca('0x26')];}_0x27eb5c['status'](_0x1cd8ab)[_0x9aca('0x27')](_0x417a42);};}exports[_0x9aca('0x28')]=function(_0x4f2d96,_0x11b8e5){var _0xd64d94={},_0x168c30={},_0x36622d={'count':0x0,'rows':[]};var _0x58f88d=_['map'](db[_0x9aca('0x29')]['rawAttributes'],function(_0x1e3601){return{'name':_0x1e3601[_0x9aca('0x2a')],'type':_0x1e3601[_0x9aca('0x2b')][_0x9aca('0x2c')]};});_0x168c30[_0x9aca('0x2d')]=_[_0x9aca('0x2e')](_['map'](_0x58f88d,_0x9aca('0x26')),[_0x9aca('0x26')]);_0x168c30[_0x9aca('0x2f')]=_[_0x9aca('0x30')](_0x4f2d96[_0x9aca('0x2f')]);_0x168c30['filters']=_[_0x9aca('0x31')](_0x168c30['model'],_0x168c30[_0x9aca('0x2f')]);_0xd64d94[_0x9aca('0x32')]=_[_0x9aca('0x31')](_0x168c30[_0x9aca('0x2d')],qs[_0x9aca('0x33')](_0x4f2d96[_0x9aca('0x2f')][_0x9aca('0x33')]));_0xd64d94['attributes']=_0xd64d94[_0x9aca('0x32')][_0x9aca('0x34')]?_0xd64d94['attributes']:_0x168c30[_0x9aca('0x2d')];if(!_0x4f2d96['query'][_0x9aca('0x35')](_0x9aca('0x36'))){_0xd64d94[_0x9aca('0x1c')]=qs[_0x9aca('0x1c')](_0x4f2d96[_0x9aca('0x2f')][_0x9aca('0x1c')]);_0xd64d94[_0x9aca('0x1b')]=qs['offset'](_0x4f2d96[_0x9aca('0x2f')][_0x9aca('0x1b')]);}_0xd64d94[_0x9aca('0x37')]=qs[_0x9aca('0x38')](_0x4f2d96[_0x9aca('0x2f')][_0x9aca('0x38')]);_0xd64d94['where']=qs[_0x9aca('0x39')](_[_0x9aca('0x3a')](_0x4f2d96[_0x9aca('0x2f')],_0x168c30['filters']));if(_0x4f2d96['query']['filter']){_0xd64d94[_0x9aca('0x3b')]=_['merge'](_0xd64d94[_0x9aca('0x3b')],{'$or':_[_0x9aca('0x3c')](_0x58f88d,function(_0x346dc4){if(_0x346dc4['type']!==_0x9aca('0x3d')){var _0x20e03e={};_0x20e03e[_0x346dc4[_0x9aca('0x26')]]={'$like':'%'+_0x4f2d96[_0x9aca('0x2f')][_0x9aca('0x3e')]+'%'};return _0x20e03e;}})});}_0xd64d94=_[_0x9aca('0x3f')]({},_0xd64d94,_0x4f2d96[_0x9aca('0x40')]);var _0x31e83b={'where':_0xd64d94[_0x9aca('0x3b')]};return db[_0x9aca('0x29')][_0x9aca('0x1a')](_0x31e83b)['then'](function(_0x3a8f25){_0x36622d[_0x9aca('0x1a')]=_0x3a8f25;if(_0x4f2d96[_0x9aca('0x2f')][_0x9aca('0x41')]){_0xd64d94[_0x9aca('0x42')]=[{'all':!![]}];}return db['CmCustomField'][_0x9aca('0x43')](_0xd64d94);})[_0x9aca('0x23')](function(_0x3fac8a){_0x36622d['rows']=_0x3fac8a;return _0x36622d;})[_0x9aca('0x23')](respondWithFilteredResult(_0x11b8e5,_0xd64d94))[_0x9aca('0x44')](handleError(_0x11b8e5,null));};exports[_0x9aca('0x45')]=function(_0x1eef12,_0x2b35cb){var _0x350390={'raw':!![],'where':{'id':_0x1eef12[_0x9aca('0x46')]['id']}},_0x18b6b1={};_0x18b6b1[_0x9aca('0x2d')]=_[_0x9aca('0x30')](db[_0x9aca('0x29')][_0x9aca('0x47')]);_0x18b6b1[_0x9aca('0x2f')]=_[_0x9aca('0x30')](_0x1eef12[_0x9aca('0x2f')]);_0x18b6b1[_0x9aca('0x39')]=_[_0x9aca('0x31')](_0x18b6b1['model'],_0x18b6b1[_0x9aca('0x2f')]);_0x350390[_0x9aca('0x32')]=_[_0x9aca('0x31')](_0x18b6b1[_0x9aca('0x2d')],qs['fields'](_0x1eef12[_0x9aca('0x2f')][_0x9aca('0x33')]));_0x350390['attributes']=_0x350390[_0x9aca('0x32')][_0x9aca('0x34')]?_0x350390[_0x9aca('0x32')]:_0x18b6b1[_0x9aca('0x2d')];if(_0x1eef12[_0x9aca('0x2f')][_0x9aca('0x41')]){_0x350390[_0x9aca('0x42')]=[{'all':!![]}];}_0x350390=_[_0x9aca('0x3f')]({},_0x350390,_0x1eef12[_0x9aca('0x40')]);return db[_0x9aca('0x29')][_0x9aca('0x48')](_0x350390)[_0x9aca('0x23')](handleEntityNotFound(_0x2b35cb,null))[_0x9aca('0x23')](respondWithResult(_0x2b35cb,null))[_0x9aca('0x44')](handleError(_0x2b35cb,null));};exports[_0x9aca('0x22')]=function(_0x388999,_0x159d0d){if(_0x388999['body']['id']){delete _0x388999[_0x9aca('0x49')]['id'];}return db[_0x9aca('0x29')]['find']({'where':{'id':_0x388999[_0x9aca('0x46')]['id']}})['then'](handleEntityNotFound(_0x159d0d,null))[_0x9aca('0x23')](saveUpdates(_0x388999[_0x9aca('0x49')],null))[_0x9aca('0x23')](respondWithResult(_0x159d0d,null))['catch'](handleError(_0x159d0d,null));};exports[_0x9aca('0x24')]=function(_0x48402a,_0x3f36c){return db[_0x9aca('0x29')][_0x9aca('0x48')]({'where':{'id':_0x48402a[_0x9aca('0x46')]['id']}})[_0x9aca('0x23')](handleEntityNotFound(_0x3f36c,null))['then'](removeEntity(_0x3f36c,null))['catch'](handleError(_0x3f36c,null));};exports[_0x9aca('0x4a')]=function(_0x345f48,_0x42f94c){var _0x21fe94;return db[_0x9aca('0x4b')][_0x9aca('0x4c')](function(_0x5d4108){return db['CmCustomField'][_0x9aca('0x4a')](_0x345f48[_0x9aca('0x49')],{'transaction':_0x5d4108})[_0x9aca('0x23')](function(_0x5b01ee){_0x21fe94=_0x5b01ee;var _0xe1aaa9={'type':db['Sequelize'][_0x9aca('0x4d')],'transaction':_0x5d4108};switch(_0x345f48[_0x9aca('0x49')][_0x9aca('0x2b')]){case _0x9aca('0x4e'):_0xe1aaa9[_0x9aca('0x2b')]=db['Sequelize']['TEXT'];break;case _0x9aca('0x4f'):_0xe1aaa9['type']=db[_0x9aca('0x50')][_0x9aca('0x51')];break;case _0x9aca('0x52'):_0xe1aaa9[_0x9aca('0x2b')]=db[_0x9aca('0x50')][_0x9aca('0x53')];_0xe1aaa9[_0x9aca('0x54')]=![];break;default:}return db['sequelize'][_0x9aca('0x55')][_0x9aca('0x56')](_0x9aca('0x57'),util['format'](_0x9aca('0x58'),_0x21fe94['id']),_0xe1aaa9);})[_0x9aca('0x23')](function(){return _0x21fe94;});})[_0x9aca('0x23')](respondWithResult(_0x42f94c,0xc9))['catch'](handleError(_0x42f94c,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 08b10cf..132833f 100644 --- a/server/api/cmCustomField/cmCustomField.model.js +++ b/server/api/cmCustomField/cmCustomField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5611=['./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x5611,0xcc));var _0x1561=function(_0x4f6316,_0x25039e){_0x4f6316=_0x4f6316-0x0;var _0x32322f=_0x5611[_0x4f6316];return _0x32322f;};'use strict';var _=require(_0x1561('0x0'));var util=require('util');var logger=require(_0x1561('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1561('0x2'));var rp=require(_0x1561('0x3'));var fs=require('fs');var path=require(_0x1561('0x4'));var rimraf=require(_0x1561('0x5'));var config=require('../../config/environment');var attributes=require(_0x1561('0x6'));module[_0x1561('0x7')]=function(_0x305dde,_0xe7b561){return _0x305dde[_0x1561('0x8')]('CmCustomField',attributes,{'tableName':_0x1561('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93e8=['api','moment','bluebird','request-promise','path','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x35933a,_0x3d4b25){var _0x45264b=function(_0x5ef155){while(--_0x5ef155){_0x35933a['push'](_0x35933a['shift']());}};_0x45264b(++_0x3d4b25);}(_0x93e8,0x176));var _0x893e=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x93e8[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0x893e('0x0'));var util=require(_0x893e('0x1'));var logger=require(_0x893e('0x2'))(_0x893e('0x3'));var moment=require(_0x893e('0x4'));var BPromise=require(_0x893e('0x5'));var rp=require(_0x893e('0x6'));var fs=require('fs');var path=require(_0x893e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x893e('0x8'));module[_0x893e('0x9')]=function(_0x49721d,_0x1a51c2){return _0x49721d[_0x893e('0xa')](_0x893e('0xb'),attributes,{'tableName':_0x893e('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index a7de697..cea3a98 100644 --- a/server/api/cmCustomField/cmCustomField.rpc.js +++ b/server/api/cmCustomField/cmCustomField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ad3=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x2392c5,_0x342602){var _0x11be86=function(_0x186014){while(--_0x186014){_0x2392c5['push'](_0x2392c5['shift']());}};_0x11be86(++_0x342602);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x5c13d5,_0x38a129){_0x5c13d5=_0x5c13d5-0x0;var _0x361eb9=_0x5ad3[_0x5c13d5];return _0x361eb9;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var moment=require(_0x35ad('0x2'));var BPromise=require(_0x35ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ad('0x4'));var db=require(_0x35ad('0x5'))['db'];var utils=require(_0x35ad('0x6'));var logger=require(_0x35ad('0x7'))(_0x35ad('0x8'));var config=require(_0x35ad('0x9'));var jayson=require(_0x35ad('0xa'));var client=jayson[_0x35ad('0xb')][_0x35ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31cc6a,_0x4edc59,_0x292521){return new BPromise(function(_0x3cec3e,_0x3f1f55){return client['request'](_0x31cc6a,_0x292521)[_0x35ad('0xd')](function(_0x487107){logger['info'](_0x35ad('0xe'),_0x4edc59,_0x35ad('0xf'));logger['debug'](_0x35ad('0x10'),_0x4edc59,_0x35ad('0xf'),JSON['stringify'](_0x487107));if(_0x487107['error']){if(_0x487107[_0x35ad('0x11')][_0x35ad('0x12')]===0x1f4){logger['error'](_0x35ad('0xe'),_0x4edc59,_0x487107[_0x35ad('0x11')]['message']);return _0x3f1f55(_0x487107['error'][_0x35ad('0x13')]);}logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x487107['error'][_0x35ad('0x13')]);return _0x3cec3e(_0x487107[_0x35ad('0x11')]['message']);}else{logger[_0x35ad('0x14')]('CmCustomField,\x20%s,\x20%s',_0x4edc59,'request\x20sent');_0x3cec3e(_0x487107[_0x35ad('0x15')][_0x35ad('0x13')]);}})[_0x35ad('0x16')](function(_0x56cb8e){logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x56cb8e);_0x3f1f55(_0x56cb8e);});});} \ No newline at end of file +var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','CmCustomField,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x533cde,_0xfc3bc3){var _0x48a14a=function(_0x257e60){while(--_0x257e60){_0x533cde['push'](_0x533cde['shift']());}};_0x48a14a(++_0xfc3bc3);}(_0x3e74,0x175));var _0x43e7=function(_0xba6caf,_0x5f1c4c){_0xba6caf=_0xba6caf-0x0;var _0x17d8bb=_0x3e74[_0xba6caf];return _0x17d8bb;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('CmCustomField,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('CmCustomField,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 4174a53..ef44cd5 100644 --- a/server/api/cmCustomField/index.js +++ b/server/api/cmCustomField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb30=['delete','/:id','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','put','update'];(function(_0x59e951,_0x44a9e1){var _0x288f61=function(_0x2bba64){while(--_0x2bba64){_0x59e951['push'](_0x59e951['shift']());}};_0x288f61(++_0x44a9e1);}(_0xcb30,0x7c));var _0x0cb3=function(_0x28255b,_0x250671){_0x28255b=_0x28255b-0x0;var _0x18f74b=_0xcb30[_0x28255b];return _0x18f74b;};'use strict';var multer=require(_0x0cb3('0x0'));var util=require(_0x0cb3('0x1'));var path=require(_0x0cb3('0x2'));var timeout=require('connect-timeout');var express=require(_0x0cb3('0x3'));var router=express['Router']();var auth=require(_0x0cb3('0x4'));var interaction=require(_0x0cb3('0x5'));var config=require('../../config/environment');var controller=require(_0x0cb3('0x6'));router[_0x0cb3('0x7')]('/',auth[_0x0cb3('0x8')](),controller['index']);router[_0x0cb3('0x7')]('/:id',auth[_0x0cb3('0x8')](),controller['show']);router['post']('/',auth[_0x0cb3('0x8')](),controller['create']);router[_0x0cb3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0cb3('0xa')]);router[_0x0cb3('0xb')](_0x0cb3('0xc'),auth[_0x0cb3('0x8')](),controller[_0x0cb3('0xd')]);module[_0x0cb3('0xe')]=router; \ No newline at end of file +var _0xedc8=['./cmCustomField.controller','index','get','/:id','isAuthenticated','show','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x461a37,_0x56b40e){var _0x2d740b=function(_0x3fd4d9){while(--_0x3fd4d9){_0x461a37['push'](_0x461a37['shift']());}};_0x2d740b(++_0x56b40e);}(_0xedc8,0x99));var _0x8edc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xedc8[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x8edc('0x0'));var util=require(_0x8edc('0x1'));var path=require(_0x8edc('0x2'));var timeout=require(_0x8edc('0x3'));var express=require(_0x8edc('0x4'));var router=express[_0x8edc('0x5')]();var auth=require(_0x8edc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8edc('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8edc('0x8')]);router[_0x8edc('0x9')](_0x8edc('0xa'),auth[_0x8edc('0xb')](),controller[_0x8edc('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8edc('0xa'),auth[_0x8edc('0xb')](),controller['update']);router[_0x8edc('0xd')](_0x8edc('0xa'),auth['isAuthenticated'](),controller[_0x8edc('0xe')]);module[_0x8edc('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b354e87..79625ee 100644 --- a/server/api/cmHopper/cmHopper.attributes.js +++ b/server/api/cmHopper/cmHopper.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x291c=['INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x425dbb,_0x44a271){var _0x59bea1=function(_0x4cf769){while(--_0x4cf769){_0x425dbb['push'](_0x425dbb['shift']());}};_0x59bea1(++_0x44a271);}(_0x291c,0x137));var _0xc291=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x291c[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0xc291('0x0'));var Sequelize=require(_0xc291('0x1'));module[_0xc291('0x2')]={'phone':{'type':Sequelize[_0xc291('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xc291('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc291('0x5')],'defaultValue':moment()[_0xc291('0x6')](_0xc291('0x7'))},'countbusyretry':{'type':Sequelize[_0xc291('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc291('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc291('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc291('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc291('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc291('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc291('0x8')],'unique':_0xc291('0xa')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc291('0xa')},'UserId':{'type':Sequelize[_0xc291('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xc291('0x8')],'unique':_0xc291('0xa')},'CampaignId':{'type':Sequelize[_0xc291('0x8')]}}; \ No newline at end of file +var _0x1f77=['DATE','format','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x3060bf,_0x3fbde4){var _0x398966=function(_0x3aafd5){while(--_0x3aafd5){_0x3060bf['push'](_0x3060bf['shift']());}};_0x398966(++_0x3fbde4);}(_0x1f77,0x131));var _0x71f7=function(_0x129560,_0x405e04){_0x129560=_0x129560-0x0;var _0x18808d=_0x1f77[_0x129560];return _0x18808d;};'use strict';var moment=require(_0x71f7('0x0'));var Sequelize=require(_0x71f7('0x1'));module[_0x71f7('0x2')]={'phone':{'type':Sequelize[_0x71f7('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x71f7('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x71f7('0x5')],'defaultValue':moment()[_0x71f7('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x71f7('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x71f7('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x71f7('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x71f7('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x71f7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x71f7('0x5')]},'priority':{'type':Sequelize[_0x71f7('0x7')](0x2)[_0x71f7('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x71f7('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x71f7('0x7')],'unique':_0x71f7('0x9')},'ListId':{'type':Sequelize[_0x71f7('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x71f7('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x71f7('0x9')},'CampaignId':{'type':Sequelize[_0x71f7('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index dd09c15..d218fb5 100644 --- a/server/api/cmHopper/cmHopper.controller.js +++ b/server/api/cmHopper/cmHopper.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbde5=['model','query','keys','filters','intersection','concat','$or','$gt','$gte','$eq','$not','$notBetween','$in','$notLike','$iLike','$notILike','$contains','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','findAll','show','params','includeAll','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','length','transaction','direction','prev','isEmpty','hopperIds','scheduledAt','ASC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','CmCompany','CmList','List','VoiceQueue','dialActive','getOpenContacts','outbound','YYYY-MM-DD\x20HH:mm:ss','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','end','error','name','index','map','CmHopper','rawAttributes','fieldName','key'];(function(_0x3f176a,_0x57ab66){var _0x168314=function(_0x143255){while(--_0x143255){_0x3f176a['push'](_0x3f176a['shift']());}};_0x168314(++_0x57ab66);}(_0xbde5,0xf0));var _0x5bde=function(_0x488c05,_0x2a6f69){_0x488c05=_0x488c05-0x0;var _0x3931c0=_0xbde5[_0x488c05];return _0x3931c0;};'use strict';var pdf=require(_0x5bde('0x0'));var emlformat=require(_0x5bde('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bde('0x2'));var jsonpatch=require(_0x5bde('0x3'));var rp=require(_0x5bde('0x4'));var moment=require(_0x5bde('0x5'));var BPromise=require(_0x5bde('0x6'));var Mustache=require(_0x5bde('0x7'));var util=require(_0x5bde('0x8'));var path=require(_0x5bde('0x9'));var sox=require(_0x5bde('0xa'));var csv=require(_0x5bde('0xb'));var ejs=require(_0x5bde('0xc'));var fs=require('fs');var _=require(_0x5bde('0xd'));var squel=require(_0x5bde('0xe'));var crypto=require(_0x5bde('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5bde('0x10'));var toCsv=require(_0x5bde('0xb'));var querystring=require(_0x5bde('0x11'));var Papa=require('papaparse');var Redis=require(_0x5bde('0x12'));var authService=require(_0x5bde('0x13'));var qs=require(_0x5bde('0x14'));var as=require(_0x5bde('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bde('0x16'))('api');var utils=require(_0x5bde('0x17'));var config=require(_0x5bde('0x18'));var db=require(_0x5bde('0x19'))['db'];function respondWithStatusCode(_0x139178,_0x35d862){_0x35d862=_0x35d862||0xcc;return function(_0x297cf0){if(_0x297cf0){return _0x139178[_0x5bde('0x1a')](_0x35d862);}return _0x139178[_0x5bde('0x1b')](_0x35d862)['end']();};}function respondWithResult(_0x5339a4,_0x230266){_0x230266=_0x230266||0xc8;return function(_0x45bce1){if(_0x45bce1){return _0x5339a4[_0x5bde('0x1b')](_0x230266)[_0x5bde('0x1c')](_0x45bce1);}};}function respondWithFilteredResult(_0x3280a1,_0x1f27d8){return function(_0x1a8345){if(_0x1a8345){var _0x2c4fe5=_0x1a8345['count'],_0x575a1f=_0x1f27d8[_0x5bde('0x1d')],_0x443814=_0x1f27d8[_0x5bde('0x1d')]+_0x1f27d8[_0x5bde('0x1e')],_0x2e5d9f;if(_0x443814>=_0x2c4fe5){_0x443814=_0x2c4fe5;_0x2e5d9f=0xc8;}else{_0x2e5d9f=0xce;}_0x3280a1['status'](_0x2e5d9f);return _0x3280a1[_0x5bde('0x1f')]('Content-Range',_0x575a1f+'-'+_0x443814+'/'+_0x2c4fe5)['json'](_0x1a8345);}return null;};}function patchUpdates(_0x26bd68){return function(_0x5b9797){try{jsonpatch[_0x5bde('0x20')](_0x5b9797,_0x26bd68,!![]);}catch(_0x427914){return BPromise[_0x5bde('0x21')](_0x427914);}return _0x5b9797[_0x5bde('0x22')]();};}function saveUpdates(_0x302fed,_0x18823c){return function(_0x2c9814){if(_0x2c9814){return _0x2c9814[_0x5bde('0x23')](_0x302fed)['then'](function(_0xa1f054){return _0xa1f054;});}return null;};}function removeEntity(_0x25105e,_0x5cbfa9){return function(_0x4b6270){if(_0x4b6270){return _0x4b6270['destroy']()[_0x5bde('0x24')](function(){_0x25105e['status'](0xcc)[_0x5bde('0x25')]();});}};}function handleEntityNotFound(_0x303dc9,_0x915766){return function(_0x84117d){if(!_0x84117d){_0x303dc9[_0x5bde('0x1a')](0x194);}return _0x84117d;};}function handleError(_0x65f0d2,_0x1d05fd){_0x1d05fd=_0x1d05fd||0x1f4;return function(_0x321e65){logger[_0x5bde('0x26')](_0x321e65['stack']);if(_0x321e65[_0x5bde('0x27')]){delete _0x321e65['name'];}_0x65f0d2[_0x5bde('0x1b')](_0x1d05fd)['send'](_0x321e65);};}exports[_0x5bde('0x28')]=function(_0x4b1d1b,_0x26507a){var _0x537955={},_0x25fe01={},_0x43d3c3={'count':0x0,'rows':[]};var _0x3c668d=_[_0x5bde('0x29')](db[_0x5bde('0x2a')][_0x5bde('0x2b')],function(_0x3c33f2){return{'name':_0x3c33f2[_0x5bde('0x2c')],'type':_0x3c33f2['type'][_0x5bde('0x2d')]};});_0x25fe01[_0x5bde('0x2e')]=_[_0x5bde('0x29')](_0x3c668d,_0x5bde('0x27'));_0x25fe01[_0x5bde('0x2f')]=_[_0x5bde('0x30')](_0x4b1d1b[_0x5bde('0x2f')]);_0x25fe01[_0x5bde('0x31')]=_[_0x5bde('0x32')](_0x25fe01[_0x5bde('0x2e')],_0x25fe01[_0x5bde('0x2f')]);_0x25fe01[_0x5bde('0x31')]=_[_0x5bde('0x33')](_0x25fe01['filters'],['$and',_0x5bde('0x34'),_0x5bde('0x35'),_0x5bde('0x36'),'$lt','$lte','$ne',_0x5bde('0x37'),_0x5bde('0x38'),'$between',_0x5bde('0x39'),_0x5bde('0x3a'),'$notIn','$like',_0x5bde('0x3b'),_0x5bde('0x3c'),_0x5bde('0x3d'),'$like','$overlap',_0x5bde('0x3e'),'$contained',_0x5bde('0x3f')]);_0x537955[_0x5bde('0x40')]=_['intersection'](_0x25fe01[_0x5bde('0x2e')],qs[_0x5bde('0x41')](_0x4b1d1b[_0x5bde('0x2f')][_0x5bde('0x41')]));_0x537955['attributes']=_0x537955['attributes']['length']?_0x537955[_0x5bde('0x40')]:_0x25fe01['model'];if(!_0x4b1d1b['query'][_0x5bde('0x42')](_0x5bde('0x43'))){_0x537955[_0x5bde('0x1e')]=qs[_0x5bde('0x1e')](_0x4b1d1b[_0x5bde('0x2f')]['limit']);_0x537955[_0x5bde('0x1d')]=qs['offset'](_0x4b1d1b[_0x5bde('0x2f')][_0x5bde('0x1d')]);}_0x537955[_0x5bde('0x44')]=qs[_0x5bde('0x45')](_0x4b1d1b[_0x5bde('0x2f')][_0x5bde('0x45')]);_0x537955[_0x5bde('0x46')]=qs[_0x5bde('0x31')](_[_0x5bde('0x47')](_0x4b1d1b[_0x5bde('0x2f')],_0x25fe01[_0x5bde('0x31')]));if(_0x4b1d1b[_0x5bde('0x2f')][_0x5bde('0x48')]){_0x537955[_0x5bde('0x46')]=_[_0x5bde('0x49')](_0x537955[_0x5bde('0x46')],{'$or':_[_0x5bde('0x29')](_0x3c668d,function(_0x2730ab){if(_0x2730ab[_0x5bde('0x4a')]!==_0x5bde('0x4b')){var _0x442d3f={};_0x442d3f[_0x2730ab[_0x5bde('0x27')]]={'$like':'%'+_0x4b1d1b[_0x5bde('0x2f')][_0x5bde('0x48')]+'%'};return _0x442d3f;}})});}_0x537955=_[_0x5bde('0x49')]({},_0x537955,_0x4b1d1b['options']);var _0x2bfd8a={'where':_0x537955[_0x5bde('0x46')]};return db[_0x5bde('0x2a')][_0x5bde('0x4c')](_0x2bfd8a)['then'](function(_0x20fe55){_0x43d3c3['count']=_0x20fe55;if(_0x4b1d1b[_0x5bde('0x2f')]['includeAll']){_0x537955['include']=[{'all':!![]}];}return db['CmHopper'][_0x5bde('0x4d')](_0x537955);})[_0x5bde('0x24')](function(_0x5bb85c){_0x43d3c3['rows']=_0x5bb85c;return _0x43d3c3;})[_0x5bde('0x24')](respondWithFilteredResult(_0x26507a,_0x537955))['catch'](handleError(_0x26507a,null));};exports[_0x5bde('0x4e')]=function(_0x5d1a8e,_0x2c627f){var _0x13d810={'raw':!![],'where':{'id':_0x5d1a8e[_0x5bde('0x4f')]['id']}},_0x4c5049={};_0x4c5049[_0x5bde('0x2e')]=_[_0x5bde('0x30')](db[_0x5bde('0x2a')][_0x5bde('0x2b')]);_0x4c5049[_0x5bde('0x2f')]=_[_0x5bde('0x30')](_0x5d1a8e[_0x5bde('0x2f')]);_0x4c5049[_0x5bde('0x31')]=_['intersection'](_0x4c5049[_0x5bde('0x2e')],_0x4c5049[_0x5bde('0x2f')]);_0x13d810[_0x5bde('0x40')]=_['intersection'](_0x4c5049[_0x5bde('0x2e')],qs[_0x5bde('0x41')](_0x5d1a8e[_0x5bde('0x2f')]['fields']));_0x13d810[_0x5bde('0x40')]=_0x13d810[_0x5bde('0x40')]['length']?_0x13d810['attributes']:_0x4c5049[_0x5bde('0x2e')];if(_0x5d1a8e['query'][_0x5bde('0x50')]){_0x13d810['include']=[{'all':!![]}];}_0x13d810=_[_0x5bde('0x49')]({},_0x13d810,_0x5d1a8e['options']);return db[_0x5bde('0x2a')][_0x5bde('0x51')](_0x13d810)[_0x5bde('0x24')](handleEntityNotFound(_0x2c627f,null))[_0x5bde('0x24')](respondWithResult(_0x2c627f,null))[_0x5bde('0x52')](handleError(_0x2c627f,null));};exports[_0x5bde('0x53')]=function(_0x25fa59,_0x2316ef){return db[_0x5bde('0x2a')]['create'](_0x25fa59[_0x5bde('0x54')],{})[_0x5bde('0x24')](respondWithResult(_0x2316ef,0xc9))[_0x5bde('0x52')](handleError(_0x2316ef,null));};exports[_0x5bde('0x23')]=function(_0x4f2f94,_0x47510b){if(_0x4f2f94[_0x5bde('0x54')]['id']){delete _0x4f2f94[_0x5bde('0x54')]['id'];}return db[_0x5bde('0x2a')][_0x5bde('0x51')]({'where':{'id':_0x4f2f94[_0x5bde('0x4f')]['id']}})[_0x5bde('0x24')](handleEntityNotFound(_0x47510b,null))[_0x5bde('0x24')](saveUpdates(_0x4f2f94[_0x5bde('0x54')],null))[_0x5bde('0x24')](respondWithResult(_0x47510b,null))[_0x5bde('0x52')](handleError(_0x47510b,null));};exports[_0x5bde('0x55')]=function(_0x30bcba,_0x1249d3){return db[_0x5bde('0x2a')][_0x5bde('0x55')]()['then'](respondWithResult(_0x1249d3,null))[_0x5bde('0x52')](handleError(_0x1249d3,null));};exports[_0x5bde('0x56')]=function(_0x536cde,_0x6e8353){var _0x18df99;return db[_0x5bde('0x2a')][_0x5bde('0x51')]({'where':{'id':_0x536cde[_0x5bde('0x4f')]['id']}})[_0x5bde('0x24')](handleEntityNotFound(_0x6e8353,null))[_0x5bde('0x24')](function(_0x1077e1){if(_0x1077e1){return _0x1077e1['destroy']()['then'](function(_0x22cd0d){return _0x22cd0d;});}})[_0x5bde('0x24')](function(_0x2e6d35){_0x18df99=_0x2e6d35;if(_0x2e6d35){if(_0x2e6d35[_0x5bde('0x57')]||_0x2e6d35[_0x5bde('0x58')]){return db[_0x2e6d35[_0x5bde('0x57')]?'VoiceQueue':_0x5bde('0x59')][_0x5bde('0x51')]({'where':{'id':_0x2e6d35['VoiceQueueId']?_0x2e6d35[_0x5bde('0x57')]:_0x2e6d35[_0x5bde('0x58')]},'attributes':['id',_0x5bde('0x27')],'raw':!![]});}}})['then'](function(_0x44f947){var _0x4eb68d={};if(_0x44f947){_['merge'](_0x4eb68d,_[_0x5bde('0x5a')](_0x18df99['dataValues'],['createdAt','updatedAt','id']));_0x4eb68d[_0x5bde('0x5b')]=0x15;_0x4eb68d[_0x5bde('0x5c')]=_0x5bde('0x5d');_0x4eb68d[_0x5bde('0x5e')]=_0x44f947[_0x5bde('0x27')];_0x4eb68d[_0x5bde('0x5f')]=_0x536cde[_0x5bde('0x60')][_0x5bde('0x27')];_0x4eb68d[_0x5bde('0x61')]=_0x536cde['user']['id'];_0x4eb68d['deleted']=!![];_0x4eb68d[_0x5bde('0x62')]=moment()[_0x5bde('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x4eb68d[_0x5bde('0x64')]=_0x18df99[_0x5bde('0x65')];_0x4eb68d['campaigntype']=_0x18df99['VoiceQueueId']?_0x5bde('0x66'):_0x5bde('0x67');return db[_0x5bde('0x68')]['find']({'where':{'id':_0x4eb68d[_0x5bde('0x69')]},'attributes':[_0x5bde('0x6a'),'lastName']})['then'](function(_0xf68705){if(!_['isNil'](_0x6e8353)&&!_[_0x5bde('0x6b')](_0xf68705['firstName'])){_0x4eb68d[_0x5bde('0x6c')]=_0xf68705[_0x5bde('0x6a')];if(!_[_0x5bde('0x6b')](_0xf68705[_0x5bde('0x6d')])){_0x4eb68d[_0x5bde('0x6c')]+='\x20'+_0xf68705['lastName'];}}})[_0x5bde('0x6e')](function(){return db[_0x5bde('0x6f')][_0x5bde('0x53')](_0x4eb68d);});}})[_0x5bde('0x24')](function(){return _0x6e8353[_0x5bde('0x1b')](0xcc)[_0x5bde('0x25')]();})['catch'](handleError(_0x6e8353,null));};exports[_0x5bde('0x70')]=function(_0x1743a5,_0x3339b9,_0x5d082a){var _0x565c52=[];return db[_0x5bde('0x68')][_0x5bde('0x55')]()[_0x5bde('0x24')](function(_0x3126f4){_0x565c52=_['keys'](_0x3126f4);return _0x1743a5[_0x5bde('0x60')][_0x5bde('0x71')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x5bde('0x72')},'attributes':['id',_0x5bde('0x73')],'raw':!![]});})[_0x5bde('0x24')](function(_0x39d364){if(_0x39d364&&_0x39d364[_0x5bde('0x74')]){return db['sequelize'][_0x5bde('0x75')](function(_0x21cd28){var _0xb91d33={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5bde('0x29')](_0x39d364,'id')},'$or':[{'UserId':null},{'UserId':_0x1743a5['user']['id']}]};var _0x146f80=[];if(_0x1743a5['body'][_0x5bde('0x76')]&&_0x1743a5[_0x5bde('0x54')]['direction']===_0x5bde('0x77')){if(!_[_0x5bde('0x78')](_0x1743a5[_0x5bde('0x54')][_0x5bde('0x79')])){_0xb91d33['id']={'$in':_0x1743a5[_0x5bde('0x54')][_0x5bde('0x79')]};}_0x146f80=[['priority','ASC'],[_0x5bde('0x7a'),_0x39d364[0x0][_0x5bde('0x73')]===_0x5bde('0x7b')?'DESC':_0x5bde('0x7b')],db[_0x5bde('0x7c')]['literal'](_0x5bde('0x7d')),['id',_0x5bde('0x7e')]];}else{if(!_[_0x5bde('0x78')](_0x1743a5['body'][_0x5bde('0x79')])){_0xb91d33['id']={'$notIn':_0x1743a5['body'][_0x5bde('0x79')]};}_0x146f80=[[_0x5bde('0x7f'),'DESC'],['scheduledAt',_0x39d364[0x0]['dialOrderByScheduledAt']],db[_0x5bde('0x7c')][_0x5bde('0x80')](_0x5bde('0x81')),['id',_0x5bde('0x7b')]];}return db[_0x5bde('0x2a')]['findOne']({'attributes':['id',_0x5bde('0x82')],'where':_0xb91d33,'order':_0x146f80,'transaction':_0x21cd28,'lock':_0x21cd28[_0x5bde('0x83')][_0x5bde('0x84')],'include':[{'model':db[_0x5bde('0x68')],'as':'Contact','attributes':_0x565c52,'include':[{'model':db[_0x5bde('0x85')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x5bde('0x86')],'as':_0x5bde('0x87'),'attributes':['id','name']},{'model':db[_0x5bde('0x88')],'as':'Queue','attributes':['id',_0x5bde('0x27'),_0x5bde('0x89')]}]})[_0x5bde('0x24')](function(_0x29822b){if(_0x29822b){return _0x29822b[_0x5bde('0x23')]({'UserId':_0x1743a5[_0x5bde('0x60')]['id']},{'transaction':_0x21cd28});}});});}})['then'](handleEntityNotFound(_0x3339b9,null))[_0x5bde('0x24')](respondWithResult(_0x3339b9,null))[_0x5bde('0x52')](handleError(_0x3339b9,null));};exports[_0x5bde('0x8a')]=function(_0x3f8929,_0x46a91b,_0x1c6352){return _0x3f8929['user']['getVoiceQueues']({'where':{'type':_0x5bde('0x8b'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x5bde('0x24')](function(_0x174059){if(_0x174059&&_0x174059[_0x5bde('0x74')]){return db[_0x5bde('0x2a')][_0x5bde('0x4c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5bde('0x63')](_0x5bde('0x8c'))},'VoiceQueueId':{'$in':_[_0x5bde('0x29')](_0x174059,'id')},'$or':[{'UserId':null},{'UserId':_0x3f8929[_0x5bde('0x60')]['id']}]}});}return 0x0;})['then'](function(_0x27f682){if(!_[_0x5bde('0x6b')](_0x27f682)&&_[_0x5bde('0x8d')](_0x27f682)){return _0x46a91b[_0x5bde('0x1b')](0xc8)[_0x5bde('0x1c')]({'contacts':_0x27f682});}else{logger[_0x5bde('0x26')](_0x5bde('0x8e'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x46a91b[_0x5bde('0x1a')](0x194);}})['catch'](handleError(_0x46a91b,null));}; \ No newline at end of file +var _0xda2e=['concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$notIn','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','CampaignId','VoiceQueue','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','ContactId','lastName','isNil','calleridname','firstName','finally','CmContact','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','model','map','keys','intersection','query'];(function(_0x5933fb,_0x9115ad){var _0x44d988=function(_0x295228){while(--_0x295228){_0x5933fb['push'](_0x5933fb['shift']());}};_0x44d988(++_0x9115ad);}(_0xda2e,0x18a));var _0xeda2=function(_0x150599,_0x3bdfb0){_0x150599=_0x150599-0x0;var _0x12c65f=_0xda2e[_0x150599];return _0x12c65f;};'use strict';var pdf=require(_0xeda2('0x0'));var emlformat=require(_0xeda2('0x1'));var rimraf=require(_0xeda2('0x2'));var zipdir=require(_0xeda2('0x3'));var jsonpatch=require(_0xeda2('0x4'));var rp=require('request-promise');var moment=require(_0xeda2('0x5'));var BPromise=require(_0xeda2('0x6'));var Mustache=require(_0xeda2('0x7'));var util=require(_0xeda2('0x8'));var path=require(_0xeda2('0x9'));var sox=require('sox');var csv=require(_0xeda2('0xa'));var ejs=require(_0xeda2('0xb'));var fs=require('fs');var _=require(_0xeda2('0xc'));var squel=require(_0xeda2('0xd'));var crypto=require(_0xeda2('0xe'));var jsforce=require(_0xeda2('0xf'));var deskjs=require(_0xeda2('0x10'));var toCsv=require(_0xeda2('0xa'));var querystring=require('querystring');var Papa=require(_0xeda2('0x11'));var Redis=require(_0xeda2('0x12'));var authService=require(_0xeda2('0x13'));var qs=require(_0xeda2('0x14'));var as=require(_0xeda2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeda2('0x16'))('api');var utils=require(_0xeda2('0x17'));var config=require(_0xeda2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9508cd,_0x3fdc0a){_0x3fdc0a=_0x3fdc0a||0xcc;return function(_0x486bf2){if(_0x486bf2){return _0x9508cd[_0xeda2('0x19')](_0x3fdc0a);}return _0x9508cd[_0xeda2('0x1a')](_0x3fdc0a)[_0xeda2('0x1b')]();};}function respondWithResult(_0x32b83a,_0x54ebfb){_0x54ebfb=_0x54ebfb||0xc8;return function(_0x26473c){if(_0x26473c){return _0x32b83a[_0xeda2('0x1a')](_0x54ebfb)[_0xeda2('0x1c')](_0x26473c);}};}function respondWithFilteredResult(_0x4bccf7,_0x16c9b0){return function(_0x55afc2){if(_0x55afc2){var _0x44c480=_0x55afc2[_0xeda2('0x1d')],_0x1784d4=_0x16c9b0[_0xeda2('0x1e')],_0x438e7f=_0x16c9b0['offset']+_0x16c9b0['limit'],_0x1d4e5e;if(_0x438e7f>=_0x44c480){_0x438e7f=_0x44c480;_0x1d4e5e=0xc8;}else{_0x1d4e5e=0xce;}_0x4bccf7[_0xeda2('0x1a')](_0x1d4e5e);return _0x4bccf7[_0xeda2('0x1f')](_0xeda2('0x20'),_0x1784d4+'-'+_0x438e7f+'/'+_0x44c480)[_0xeda2('0x1c')](_0x55afc2);}return null;};}function patchUpdates(_0x371605){return function(_0x4084bf){try{jsonpatch['apply'](_0x4084bf,_0x371605,!![]);}catch(_0x410965){return BPromise['reject'](_0x410965);}return _0x4084bf['save']();};}function saveUpdates(_0x26cdac,_0x55b0a4){return function(_0x1905e9){if(_0x1905e9){return _0x1905e9[_0xeda2('0x21')](_0x26cdac)[_0xeda2('0x22')](function(_0x48d545){return _0x48d545;});}return null;};}function removeEntity(_0x5e75a4,_0x156841){return function(_0x1da012){if(_0x1da012){return _0x1da012[_0xeda2('0x23')]()[_0xeda2('0x22')](function(){_0x5e75a4[_0xeda2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2868ff,_0x425326){return function(_0x49c890){if(!_0x49c890){_0x2868ff[_0xeda2('0x19')](0x194);}return _0x49c890;};}function handleError(_0xdf3d90,_0x1c615c){_0x1c615c=_0x1c615c||0x1f4;return function(_0x48868c){logger[_0xeda2('0x24')](_0x48868c[_0xeda2('0x25')]);if(_0x48868c[_0xeda2('0x26')]){delete _0x48868c[_0xeda2('0x26')];}_0xdf3d90[_0xeda2('0x1a')](_0x1c615c)[_0xeda2('0x27')](_0x48868c);};}exports[_0xeda2('0x28')]=function(_0x42bbfe,_0x43605d){var _0x23aadc={},_0x5c92dd={},_0x4e12b0={'count':0x0,'rows':[]};var _0x469acd=_['map'](db[_0xeda2('0x29')][_0xeda2('0x2a')],function(_0x1a11fe){return{'name':_0x1a11fe[_0xeda2('0x2b')],'type':_0x1a11fe[_0xeda2('0x2c')]['key']};});_0x5c92dd[_0xeda2('0x2d')]=_[_0xeda2('0x2e')](_0x469acd,'name');_0x5c92dd['query']=_[_0xeda2('0x2f')](_0x42bbfe['query']);_0x5c92dd['filters']=_[_0xeda2('0x30')](_0x5c92dd[_0xeda2('0x2d')],_0x5c92dd[_0xeda2('0x31')]);_0x5c92dd['filters']=_[_0xeda2('0x32')](_0x5c92dd['filters'],[_0xeda2('0x33'),_0xeda2('0x34'),_0xeda2('0x35'),_0xeda2('0x36'),_0xeda2('0x37'),_0xeda2('0x38'),_0xeda2('0x39'),_0xeda2('0x3a'),'$not',_0xeda2('0x3b'),_0xeda2('0x3c'),'$in',_0xeda2('0x3d'),'$like',_0xeda2('0x3e'),_0xeda2('0x3f'),_0xeda2('0x40'),'$like',_0xeda2('0x41'),_0xeda2('0x42'),'$contained',_0xeda2('0x43')]);_0x23aadc[_0xeda2('0x44')]=_[_0xeda2('0x30')](_0x5c92dd[_0xeda2('0x2d')],qs['fields'](_0x42bbfe[_0xeda2('0x31')][_0xeda2('0x45')]));_0x23aadc['attributes']=_0x23aadc[_0xeda2('0x44')][_0xeda2('0x46')]?_0x23aadc['attributes']:_0x5c92dd[_0xeda2('0x2d')];if(!_0x42bbfe[_0xeda2('0x31')][_0xeda2('0x47')](_0xeda2('0x48'))){_0x23aadc[_0xeda2('0x49')]=qs[_0xeda2('0x49')](_0x42bbfe['query'][_0xeda2('0x49')]);_0x23aadc[_0xeda2('0x1e')]=qs[_0xeda2('0x1e')](_0x42bbfe['query']['offset']);}_0x23aadc[_0xeda2('0x4a')]=qs[_0xeda2('0x4b')](_0x42bbfe[_0xeda2('0x31')][_0xeda2('0x4b')]);_0x23aadc[_0xeda2('0x4c')]=qs['filters'](_[_0xeda2('0x4d')](_0x42bbfe[_0xeda2('0x31')],_0x5c92dd[_0xeda2('0x4e')]));if(_0x42bbfe['query'][_0xeda2('0x4f')]){_0x23aadc[_0xeda2('0x4c')]=_[_0xeda2('0x50')](_0x23aadc[_0xeda2('0x4c')],{'$or':_[_0xeda2('0x2e')](_0x469acd,function(_0x27c2c1){if(_0x27c2c1['type']!=='VIRTUAL'){var _0x47011f={};_0x47011f[_0x27c2c1['name']]={'$like':'%'+_0x42bbfe[_0xeda2('0x31')][_0xeda2('0x4f')]+'%'};return _0x47011f;}})});}_0x23aadc=_[_0xeda2('0x50')]({},_0x23aadc,_0x42bbfe[_0xeda2('0x51')]);var _0x43579d={'where':_0x23aadc[_0xeda2('0x4c')]};return db[_0xeda2('0x29')]['count'](_0x43579d)['then'](function(_0x2ae844){_0x4e12b0[_0xeda2('0x1d')]=_0x2ae844;if(_0x42bbfe[_0xeda2('0x31')][_0xeda2('0x52')]){_0x23aadc[_0xeda2('0x53')]=[{'all':!![]}];}return db[_0xeda2('0x29')][_0xeda2('0x54')](_0x23aadc);})[_0xeda2('0x22')](function(_0x588c4e){_0x4e12b0[_0xeda2('0x55')]=_0x588c4e;return _0x4e12b0;})['then'](respondWithFilteredResult(_0x43605d,_0x23aadc))[_0xeda2('0x56')](handleError(_0x43605d,null));};exports[_0xeda2('0x57')]=function(_0x1b79aa,_0xd7be5e){var _0x4fd6f3={'raw':!![],'where':{'id':_0x1b79aa[_0xeda2('0x58')]['id']}},_0x5482e5={};_0x5482e5[_0xeda2('0x2d')]=_[_0xeda2('0x2f')](db[_0xeda2('0x29')][_0xeda2('0x2a')]);_0x5482e5['query']=_[_0xeda2('0x2f')](_0x1b79aa[_0xeda2('0x31')]);_0x5482e5[_0xeda2('0x4e')]=_['intersection'](_0x5482e5[_0xeda2('0x2d')],_0x5482e5['query']);_0x4fd6f3[_0xeda2('0x44')]=_['intersection'](_0x5482e5[_0xeda2('0x2d')],qs['fields'](_0x1b79aa[_0xeda2('0x31')][_0xeda2('0x45')]));_0x4fd6f3[_0xeda2('0x44')]=_0x4fd6f3['attributes'][_0xeda2('0x46')]?_0x4fd6f3[_0xeda2('0x44')]:_0x5482e5[_0xeda2('0x2d')];if(_0x1b79aa[_0xeda2('0x31')][_0xeda2('0x52')]){_0x4fd6f3[_0xeda2('0x53')]=[{'all':!![]}];}_0x4fd6f3=_[_0xeda2('0x50')]({},_0x4fd6f3,_0x1b79aa[_0xeda2('0x51')]);return db[_0xeda2('0x29')][_0xeda2('0x59')](_0x4fd6f3)[_0xeda2('0x22')](handleEntityNotFound(_0xd7be5e,null))[_0xeda2('0x22')](respondWithResult(_0xd7be5e,null))['catch'](handleError(_0xd7be5e,null));};exports[_0xeda2('0x5a')]=function(_0xaf89e5,_0x15bc1a){return db[_0xeda2('0x29')]['create'](_0xaf89e5[_0xeda2('0x5b')],{})[_0xeda2('0x22')](respondWithResult(_0x15bc1a,0xc9))['catch'](handleError(_0x15bc1a,null));};exports[_0xeda2('0x21')]=function(_0xe8d9a8,_0x582844){if(_0xe8d9a8[_0xeda2('0x5b')]['id']){delete _0xe8d9a8['body']['id'];}return db[_0xeda2('0x29')][_0xeda2('0x59')]({'where':{'id':_0xe8d9a8[_0xeda2('0x58')]['id']}})['then'](handleEntityNotFound(_0x582844,null))[_0xeda2('0x22')](saveUpdates(_0xe8d9a8[_0xeda2('0x5b')],null))[_0xeda2('0x22')](respondWithResult(_0x582844,null))['catch'](handleError(_0x582844,null));};exports[_0xeda2('0x5c')]=function(_0x45c47,_0x14e1a1){return db[_0xeda2('0x29')][_0xeda2('0x5c')]()[_0xeda2('0x22')](respondWithResult(_0x14e1a1,null))[_0xeda2('0x56')](handleError(_0x14e1a1,null));};exports[_0xeda2('0x23')]=function(_0x3493f3,_0x2629ce){var _0x17a66b;return db[_0xeda2('0x29')][_0xeda2('0x59')]({'where':{'id':_0x3493f3[_0xeda2('0x58')]['id']}})[_0xeda2('0x22')](handleEntityNotFound(_0x2629ce,null))[_0xeda2('0x22')](function(_0x57e873){if(_0x57e873){return _0x57e873['destroy']()[_0xeda2('0x22')](function(_0x11745f){return _0x11745f;});}})['then'](function(_0x93be25){_0x17a66b=_0x93be25;if(_0x93be25){if(_0x93be25['VoiceQueueId']||_0x93be25[_0xeda2('0x5d')]){return db[_0x93be25['VoiceQueueId']?_0xeda2('0x5e'):'Campaign'][_0xeda2('0x59')]({'where':{'id':_0x93be25['VoiceQueueId']?_0x93be25[_0xeda2('0x5f')]:_0x93be25[_0xeda2('0x5d')]},'attributes':['id','name'],'raw':!![]});}}})[_0xeda2('0x22')](function(_0xa25edd){var _0x8df57b={};if(_0xa25edd){_[_0xeda2('0x50')](_0x8df57b,_[_0xeda2('0x60')](_0x17a66b[_0xeda2('0x61')],[_0xeda2('0x62'),_0xeda2('0x63'),'id']));_0x8df57b[_0xeda2('0x64')]=0x15;_0x8df57b[_0xeda2('0x65')]=_0xeda2('0x66');_0x8df57b[_0xeda2('0x67')]=_0xa25edd[_0xeda2('0x26')];_0x8df57b['membername']=_0x3493f3[_0xeda2('0x68')][_0xeda2('0x26')];_0x8df57b[_0xeda2('0x69')]=_0x3493f3[_0xeda2('0x68')]['id'];_0x8df57b[_0xeda2('0x66')]=!![];_0x8df57b[_0xeda2('0x6a')]=moment()[_0xeda2('0x6b')](_0xeda2('0x6c'));_0x8df57b[_0xeda2('0x6d')]=_0x17a66b['phone'];_0x8df57b[_0xeda2('0x6e')]=_0x17a66b[_0xeda2('0x5f')]?_0xeda2('0x6f'):_0xeda2('0x70');return db['CmContact'][_0xeda2('0x59')]({'where':{'id':_0x8df57b[_0xeda2('0x71')]},'attributes':['firstName',_0xeda2('0x72')]})[_0xeda2('0x22')](function(_0x39dd3f){if(!_[_0xeda2('0x73')](_0x2629ce)&&!_[_0xeda2('0x73')](_0x39dd3f['firstName'])){_0x8df57b[_0xeda2('0x74')]=_0x39dd3f[_0xeda2('0x75')];if(!_[_0xeda2('0x73')](_0x39dd3f['lastName'])){_0x8df57b['calleridname']+='\x20'+_0x39dd3f[_0xeda2('0x72')];}}})[_0xeda2('0x76')](function(){return db['CmHopperFinal'][_0xeda2('0x5a')](_0x8df57b);});}})[_0xeda2('0x22')](function(){return _0x2629ce[_0xeda2('0x1a')](0xcc)['end']();})['catch'](handleError(_0x2629ce,null));};exports['getPreview']=function(_0x19f76c,_0x4ef9fb,_0x12115f){var _0x4dec82=[];return db[_0xeda2('0x77')][_0xeda2('0x5c')]()['then'](function(_0x219b89){_0x4dec82=_['keys'](_0x219b89);return _0x19f76c['user'][_0xeda2('0x78')]({'where':{'type':_0xeda2('0x79'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xeda2('0x7a')],'raw':!![]});})['then'](function(_0x270f32){if(_0x270f32&&_0x270f32['length']){return db[_0xeda2('0x7b')]['transaction'](function(_0x4d7d32){var _0x176374={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xeda2('0x6b')](_0xeda2('0x6c'))},'VoiceQueueId':{'$in':_[_0xeda2('0x2e')](_0x270f32,'id')},'$or':[{'UserId':null},{'UserId':_0x19f76c[_0xeda2('0x68')]['id']}]};var _0x84da9a=[];if(_0x19f76c['body']['direction']&&_0x19f76c[_0xeda2('0x5b')][_0xeda2('0x7c')]===_0xeda2('0x7d')){if(!_['isEmpty'](_0x19f76c[_0xeda2('0x5b')][_0xeda2('0x7e')])){_0x176374['id']={'$in':_0x19f76c['body']['hopperIds']};}_0x84da9a=[[_0xeda2('0x7f'),_0xeda2('0x80')],[_0xeda2('0x81'),_0x270f32[0x0][_0xeda2('0x7a')]===_0xeda2('0x80')?_0xeda2('0x82'):_0xeda2('0x80')],db[_0xeda2('0x7b')][_0xeda2('0x83')](_0xeda2('0x84')),['id','DESC']];}else{if(!_['isEmpty'](_0x19f76c[_0xeda2('0x5b')][_0xeda2('0x7e')])){_0x176374['id']={'$notIn':_0x19f76c[_0xeda2('0x5b')][_0xeda2('0x7e')]};}_0x84da9a=[[_0xeda2('0x7f'),_0xeda2('0x82')],[_0xeda2('0x81'),_0x270f32[0x0][_0xeda2('0x7a')]],db[_0xeda2('0x7b')]['literal'](_0xeda2('0x85')),['id','ASC']];}return db['CmHopper']['findOne']({'attributes':['id',_0xeda2('0x86')],'where':_0x176374,'order':_0x84da9a,'transaction':_0x4d7d32,'lock':_0x4d7d32[_0xeda2('0x87')][_0xeda2('0x88')],'include':[{'model':db[_0xeda2('0x77')],'as':_0xeda2('0x89'),'attributes':_0x4dec82,'include':[{'model':db[_0xeda2('0x8a')],'as':_0xeda2('0x8b'),'attributes':['id',_0xeda2('0x26')]}]},{'model':db[_0xeda2('0x8c')],'as':_0xeda2('0x8d'),'attributes':['id',_0xeda2('0x26')]},{'model':db[_0xeda2('0x5e')],'as':'Queue','attributes':['id',_0xeda2('0x26'),_0xeda2('0x8e')]}]})[_0xeda2('0x22')](function(_0x1253ff){if(_0x1253ff){return _0x1253ff[_0xeda2('0x21')]({'UserId':_0x19f76c[_0xeda2('0x68')]['id']},{'transaction':_0x4d7d32});}});});}})['then'](handleEntityNotFound(_0x4ef9fb,null))[_0xeda2('0x22')](respondWithResult(_0x4ef9fb,null))[_0xeda2('0x56')](handleError(_0x4ef9fb,null));};exports[_0xeda2('0x8f')]=function(_0xf8adf,_0x564db8,_0x26b450){return _0xf8adf['user'][_0xeda2('0x78')]({'where':{'type':_0xeda2('0x79'),'dialActive':!![],'dialMethod':_0xeda2('0x90')},'attributes':['id'],'raw':!![]})[_0xeda2('0x22')](function(_0x3a68d6){if(_0x3a68d6&&_0x3a68d6[_0xeda2('0x46')]){return db[_0xeda2('0x29')][_0xeda2('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xeda2('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x3a68d6,'id')},'$or':[{'UserId':null},{'UserId':_0xf8adf[_0xeda2('0x68')]['id']}]}});}return 0x0;})[_0xeda2('0x22')](function(_0xb61b0b){if(!_[_0xeda2('0x73')](_0xb61b0b)&&_[_0xeda2('0x91')](_0xb61b0b)){return _0x564db8[_0xeda2('0x1a')](0xc8)['json']({'contacts':_0xb61b0b});}else{logger[_0xeda2('0x24')](_0xeda2('0x92'),_0xeda2('0x8f'),0x194,_0xeda2('0x93'));_0x564db8[_0xeda2('0x19')](0x194);}})[_0xeda2('0x56')](handleError(_0x564db8,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index fa97c59..ac18bc3 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e55=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1e55,0xba));var _0x51e5=function(_0x54d22c,_0x1af1af){_0x54d22c=_0x54d22c-0x0;var _0x18ecc1=_0x1e55[_0x54d22c];return _0x18ecc1;};'use strict';var _=require(_0x51e5('0x0'));var util=require(_0x51e5('0x1'));var logger=require('../../config/logger')(_0x51e5('0x2'));var moment=require(_0x51e5('0x3'));var BPromise=require(_0x51e5('0x4'));var rp=require(_0x51e5('0x5'));var fs=require('fs');var path=require(_0x51e5('0x6'));var rimraf=require(_0x51e5('0x7'));var config=require('../../config/environment');var attributes=require(_0x51e5('0x8'));module['exports']=function(_0x4b866a,_0x426a9d){return _0x4b866a[_0x51e5('0x9')](_0x51e5('0xa'),attributes,{'tableName':_0x51e5('0xb'),'paranoid':![],'indexes':[{'name':_0x51e5('0xc'),'fields':[_0x51e5('0xc')]},{'name':_0x51e5('0xd'),'fields':[_0x51e5('0xd')]},{'name':_0x51e5('0xe'),'fields':[_0x51e5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf8e4=['define','CmHopper','scheduledat','phone','priority','lodash','api','moment','bluebird','path','../../config/environment'];(function(_0x4dd072,_0x515c74){var _0x45ee58=function(_0x2bf321){while(--_0x2bf321){_0x4dd072['push'](_0x4dd072['shift']());}};_0x45ee58(++_0x515c74);}(_0xf8e4,0x73));var _0x4f8e=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xf8e4[_0x32b993];return _0x482780;};'use strict';var _=require(_0x4f8e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f8e('0x1'));var moment=require(_0x4f8e('0x2'));var BPromise=require(_0x4f8e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f8e('0x4'));var rimraf=require('rimraf');var config=require(_0x4f8e('0x5'));var attributes=require('./cmHopper.attributes');module['exports']=function(_0x2ecf78,_0x847d4e){return _0x2ecf78[_0x4f8e('0x6')](_0x4f8e('0x7'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x4f8e('0x8'),'fields':[_0x4f8e('0x8')]},{'name':_0x4f8e('0x9'),'fields':[_0x4f8e('0x9')]},{'name':_0x4f8e('0xa'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index e949664..7e2b4c5 100644 --- a/server/api/cmHopper/cmHopper.rpc.js +++ b/server/api/cmHopper/cmHopper.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8f0=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopper','CmHopper','options','limit','map','model','attributes','include','ShowCmHopper','find','raw','where','CreateCmHopper','create','UpdateCmHopper','body','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','findAll','order','UPDATE','CmContact','Contact','keys','update','CmHopperFinal','MoveContactManagedDialer','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','UserId','push','lodash','moment','bluebird'];(function(_0x31fdb7,_0x162f15){var _0x2d54ce=function(_0x331d70){while(--_0x331d70){_0x31fdb7['push'](_0x31fdb7['shift']());}};_0x2d54ce(++_0x162f15);}(_0xb8f0,0x1b6));var _0x0b8f=function(_0x1f4428,_0x5d1475){_0x1f4428=_0x1f4428-0x0;var _0x2c4859=_0xb8f0[_0x1f4428];return _0x2c4859;};'use strict';var _=require(_0x0b8f('0x0'));var util=require('util');var moment=require(_0x0b8f('0x1'));var BPromise=require(_0x0b8f('0x2'));var rs=require(_0x0b8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b8f('0x4'))['db'];var utils=require(_0x0b8f('0x5'));var logger=require('../../config/logger')(_0x0b8f('0x6'));var config=require(_0x0b8f('0x7'));var jayson=require(_0x0b8f('0x8'));var client=jayson[_0x0b8f('0x9')][_0x0b8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x70540f,_0x49cf33,_0x84f8cb){return new BPromise(function(_0x266a13,_0x16e18c){return client[_0x0b8f('0xb')](_0x70540f,_0x84f8cb)[_0x0b8f('0xc')](function(_0x443ca3){logger[_0x0b8f('0xd')](_0x0b8f('0xe'),_0x49cf33,'request\x20sent');logger[_0x0b8f('0xf')](_0x0b8f('0x10'),_0x49cf33,_0x0b8f('0x11'),JSON[_0x0b8f('0x12')](_0x443ca3));if(_0x443ca3['error']){if(_0x443ca3[_0x0b8f('0x13')][_0x0b8f('0x14')]===0x1f4){logger[_0x0b8f('0x13')](_0x0b8f('0xe'),_0x49cf33,_0x443ca3['error'][_0x0b8f('0x15')]);return _0x16e18c(_0x443ca3[_0x0b8f('0x13')]['message']);}logger['error'](_0x0b8f('0xe'),_0x49cf33,_0x443ca3[_0x0b8f('0x13')][_0x0b8f('0x15')]);return _0x266a13(_0x443ca3[_0x0b8f('0x13')][_0x0b8f('0x15')]);}else{logger[_0x0b8f('0xd')](_0x0b8f('0xe'),_0x49cf33,_0x0b8f('0x11'));_0x266a13(_0x443ca3['result'][_0x0b8f('0x15')]);}})[_0x0b8f('0x16')](function(_0x5d4070){logger[_0x0b8f('0x13')](_0x0b8f('0xe'),_0x49cf33,_0x5d4070);_0x16e18c(_0x5d4070);});});}exports[_0x0b8f('0x17')]=function(_0x4d1838){var _0x5f302b=this;return new Promise(function(_0x37d82c,_0x45e0fe){return db[_0x0b8f('0x18')]['findAll']({'raw':_0x4d1838[_0x0b8f('0x19')]?_0x4d1838[_0x0b8f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4d1838[_0x0b8f('0x19')]?_0x4d1838[_0x0b8f('0x19')]['where']||null:null,'attributes':_0x4d1838[_0x0b8f('0x19')]?_0x4d1838[_0x0b8f('0x19')]['attributes']||null:null,'limit':_0x4d1838[_0x0b8f('0x19')]?_0x4d1838['options'][_0x0b8f('0x1a')]||null:null,'include':_0x4d1838[_0x0b8f('0x19')]?_0x4d1838[_0x0b8f('0x19')]['include']?_[_0x0b8f('0x1b')](_0x4d1838[_0x0b8f('0x19')]['include'],function(_0x9c71f2){return{'model':db[_0x9c71f2[_0x0b8f('0x1c')]],'as':_0x9c71f2['as'],'attributes':_0x9c71f2[_0x0b8f('0x1d')],'include':_0x9c71f2[_0x0b8f('0x1e')]?_[_0x0b8f('0x1b')](_0x9c71f2[_0x0b8f('0x1e')],function(_0x4729dc){return{'model':db[_0x4729dc[_0x0b8f('0x1c')]],'as':_0x4729dc['as'],'attributes':_0x4729dc[_0x0b8f('0x1d')],'include':_0x4729dc[_0x0b8f('0x1e')]?_[_0x0b8f('0x1b')](_0x4729dc['include'],function(_0x39457c){return{'model':db[_0x39457c[_0x0b8f('0x1c')]],'as':_0x39457c['as'],'attributes':_0x39457c[_0x0b8f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0b8f('0xc')](function(_0x71fd98){logger[_0x0b8f('0xd')](_0x0b8f('0x17'),_0x4d1838);logger[_0x0b8f('0xf')](_0x0b8f('0x17'),_0x4d1838,JSON[_0x0b8f('0x12')](_0x71fd98));_0x37d82c(_0x71fd98);})[_0x0b8f('0x16')](function(_0x35096e){logger[_0x0b8f('0x13')]('GetCmHopper',_0x35096e[_0x0b8f('0x15')],_0x4d1838);_0x45e0fe(_0x5f302b[_0x0b8f('0x13')](0x1f4,_0x35096e[_0x0b8f('0x15')]));});});};exports[_0x0b8f('0x1f')]=function(_0x37f5bd){var _0x279a97=this;return new Promise(function(_0x376c3f,_0x50afc7){return db['CmHopper'][_0x0b8f('0x20')]({'raw':_0x37f5bd[_0x0b8f('0x19')]?_0x37f5bd[_0x0b8f('0x19')][_0x0b8f('0x21')]===undefined?!![]:![]:!![],'where':_0x37f5bd[_0x0b8f('0x19')]?_0x37f5bd['options'][_0x0b8f('0x22')]||null:null,'attributes':_0x37f5bd['options']?_0x37f5bd['options'][_0x0b8f('0x1d')]||null:null,'include':_0x37f5bd[_0x0b8f('0x19')]?_0x37f5bd[_0x0b8f('0x19')]['include']?_[_0x0b8f('0x1b')](_0x37f5bd['options'][_0x0b8f('0x1e')],function(_0x560aa5){return{'model':db[_0x560aa5[_0x0b8f('0x1c')]],'as':_0x560aa5['as'],'attributes':_0x560aa5[_0x0b8f('0x1d')],'include':_0x560aa5[_0x0b8f('0x1e')]?_[_0x0b8f('0x1b')](_0x560aa5['include'],function(_0x2f27b3){return{'model':db[_0x2f27b3[_0x0b8f('0x1c')]],'as':_0x2f27b3['as'],'attributes':_0x2f27b3[_0x0b8f('0x1d')],'include':_0x2f27b3[_0x0b8f('0x1e')]?_[_0x0b8f('0x1b')](_0x2f27b3[_0x0b8f('0x1e')],function(_0x1231db){return{'model':db[_0x1231db['model']],'as':_0x1231db['as'],'attributes':_0x1231db[_0x0b8f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0b8f('0xc')](function(_0x25a73c){logger[_0x0b8f('0xd')](_0x0b8f('0x1f'),_0x37f5bd);logger[_0x0b8f('0xf')]('ShowCmHopper',_0x37f5bd,JSON[_0x0b8f('0x12')](_0x25a73c));_0x376c3f(_0x25a73c);})[_0x0b8f('0x16')](function(_0x4df41d){logger['error']('ShowCmHopper',_0x4df41d[_0x0b8f('0x15')],_0x37f5bd);_0x50afc7(_0x279a97[_0x0b8f('0x13')](0x1f4,_0x4df41d['message']));});});};exports[_0x0b8f('0x23')]=function(_0x5e442f){var _0x4ec2e3=this;return new Promise(function(_0x35c00a,_0x3ae612){return db[_0x0b8f('0x18')][_0x0b8f('0x24')](_0x5e442f['body'],{'raw':_0x5e442f[_0x0b8f('0x19')]?_0x5e442f[_0x0b8f('0x19')][_0x0b8f('0x21')]===undefined?!![]:![]:!![]})[_0x0b8f('0xc')](function(_0x8dd542){logger[_0x0b8f('0xd')]('CreateCmHopper',_0x5e442f);logger[_0x0b8f('0xf')](_0x0b8f('0x23'),_0x5e442f,JSON[_0x0b8f('0x12')](_0x8dd542));_0x35c00a(_0x8dd542);})['catch'](function(_0x46691c){logger[_0x0b8f('0x13')](_0x0b8f('0x23'),_0x46691c[_0x0b8f('0x15')],_0x5e442f);_0x3ae612(_0x4ec2e3[_0x0b8f('0x13')](0x1f4,_0x46691c[_0x0b8f('0x15')]));});});};exports[_0x0b8f('0x25')]=function(_0x36f6d8){var _0x282d17=this;return new Promise(function(_0x8ab316,_0x5ab13c){return db[_0x0b8f('0x18')]['update'](_0x36f6d8[_0x0b8f('0x26')],{'raw':_0x36f6d8[_0x0b8f('0x19')]?_0x36f6d8['options'][_0x0b8f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36f6d8['options']?_0x36f6d8[_0x0b8f('0x19')][_0x0b8f('0x22')]||null:null,'attributes':_0x36f6d8[_0x0b8f('0x19')]?_0x36f6d8[_0x0b8f('0x19')][_0x0b8f('0x1d')]||null:null,'limit':_0x36f6d8[_0x0b8f('0x19')]?_0x36f6d8['options']['limit']||null:null})[_0x0b8f('0xc')](function(_0x200996){logger[_0x0b8f('0xd')](_0x0b8f('0x25'),_0x36f6d8);logger[_0x0b8f('0xf')](_0x0b8f('0x25'),_0x36f6d8,JSON[_0x0b8f('0x12')](_0x200996));_0x8ab316(_0x200996);})['catch'](function(_0x40af1f){logger[_0x0b8f('0x13')]('UpdateCmHopper',_0x40af1f[_0x0b8f('0x15')],_0x36f6d8);_0x5ab13c(_0x282d17[_0x0b8f('0x13')](0x1f4,_0x40af1f[_0x0b8f('0x15')]));});});};exports[_0x0b8f('0x27')]=function(_0x4977b3){var _0x44d036=this;return new Promise(function(_0x22193d,_0x46940f){return db[_0x0b8f('0x18')][_0x0b8f('0x28')]({'where':_0x4977b3[_0x0b8f('0x19')]?_0x4977b3[_0x0b8f('0x19')]['where']||null:null})[_0x0b8f('0xc')](function(_0x2ad90d){logger[_0x0b8f('0xd')](_0x0b8f('0x27'),_0x4977b3);logger[_0x0b8f('0xf')](_0x0b8f('0x27'),_0x4977b3,JSON[_0x0b8f('0x12')](_0x2ad90d));_0x22193d(_0x2ad90d);})[_0x0b8f('0x16')](function(_0xaa37b3){logger[_0x0b8f('0x13')]('DestroyCmHopper',_0xaa37b3['message'],_0x4977b3);_0x46940f(_0x44d036[_0x0b8f('0x13')](0x1f4,_0xaa37b3[_0x0b8f('0x15')]));});});};exports[_0x0b8f('0x29')]=function(_0x3c7d9c){var _0x516958=this;return new Promise(function(_0x4dd201,_0x15ff94){return db['CmContact'][_0x0b8f('0x2a')]()['then'](function(_0xb3f50e){return db[_0x0b8f('0x2b')][_0x0b8f('0x2c')](function(_0x37b13b){return db[_0x0b8f('0x18')][_0x0b8f('0x2d')]({'where':_0x3c7d9c[_0x0b8f('0x19')]?_0x3c7d9c[_0x0b8f('0x19')][_0x0b8f('0x22')]||null:null,'attributes':_0x3c7d9c[_0x0b8f('0x19')]?_0x3c7d9c[_0x0b8f('0x19')][_0x0b8f('0x1d')]||null:null,'limit':_0x3c7d9c[_0x0b8f('0x19')]?_0x3c7d9c['options']['limit']||null:null,'order':_0x3c7d9c[_0x0b8f('0x19')]?_0x3c7d9c[_0x0b8f('0x19')][_0x0b8f('0x2e')]||null:null,'transaction':_0x37b13b,'lock':_0x37b13b['LOCK'][_0x0b8f('0x2f')],'include':[{'model':db[_0x0b8f('0x30')],'as':_0x0b8f('0x31'),'attributes':_[_0x0b8f('0x32')](_0xb3f50e)}]})[_0x0b8f('0xc')](function(_0x54d2c3){var _0x2ea97c=[];for(var _0x58aaa0=0x0;_0x58aaa0<_0x54d2c3['length'];_0x58aaa0+=0x1){_0x2ea97c['push'](_0x54d2c3[_0x58aaa0][_0x0b8f('0x33')](_0x3c7d9c['body'],{'transaction':_0x37b13b}));}return BPromise['all'](_0x2ea97c);});})['then'](function(_0x16a367){logger[_0x0b8f('0xd')](_0x0b8f('0x29'),_0x3c7d9c);logger['debug'](_0x0b8f('0x29'),_0x3c7d9c,JSON[_0x0b8f('0x12')](_0x16a367));_0x4dd201(_0x16a367);})['catch'](function(_0x113dc7){logger[_0x0b8f('0x13')]('GetContactDialer',_0x113dc7[_0x0b8f('0x15')],_0x3c7d9c);_0x15ff94(_0x516958[_0x0b8f('0x13')](0x1f4,_0x113dc7['message']));});});});};exports['MoveContactManagedDialer']=function(_0xdb2ae4){var _0x5ca4b9=this;return new Promise(function(_0x368ada,_0x4c042a){return db[_0x0b8f('0x2b')][_0x0b8f('0x2c')](function(_0x2d4580){return db[_0x0b8f('0x34')][_0x0b8f('0x24')](_0xdb2ae4[_0x0b8f('0x26')],{'raw':_0xdb2ae4[_0x0b8f('0x19')]?_0xdb2ae4['options'][_0x0b8f('0x21')]===undefined?!![]:![]:!![],'transaction':_0x2d4580})[_0x0b8f('0xc')](function(){return db[_0x0b8f('0x18')]['destroy']({'where':_0xdb2ae4['options']?_0xdb2ae4[_0x0b8f('0x19')]['where']||null:null,'transaction':_0x2d4580});});})[_0x0b8f('0xc')](function(_0x5f13dd){logger['info'](_0x0b8f('0x35'),_0xdb2ae4);logger[_0x0b8f('0xf')]('MoveContactManagedDialer',_0xdb2ae4,JSON[_0x0b8f('0x12')](_0x5f13dd));_0x368ada(_0x5f13dd);})[_0x0b8f('0x16')](function(_0x128b94){logger['error'](_0x0b8f('0x35'),_0x128b94['message'],_0xdb2ae4);_0x4c042a(_0x5ca4b9['error'](0x1f4,_0x128b94[_0x0b8f('0x15')]));});});};exports['CountReScheduled']=function(_0x392388){var _0x53ece2=this;return new Promise(function(_0x476deb,_0x48e072){return db[_0x0b8f('0x18')][_0x0b8f('0x2d')]({'raw':_0x392388[_0x0b8f('0x19')]?_0x392388[_0x0b8f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x392388[_0x0b8f('0x19')]?_0x392388[_0x0b8f('0x19')][_0x0b8f('0x22')]||null:null,'attributes':[[db[_0x0b8f('0x2b')]['fn'](_0x0b8f('0x36'),db['sequelize']['fn']('IF',db[_0x0b8f('0x2b')]['literal'](_0x0b8f('0x37')+util[_0x0b8f('0x38')](_0x0b8f('0x39'),moment()[_0x0b8f('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x0b8f('0x3a')))),'contactsRescheduled']]})[_0x0b8f('0xc')](function(_0x179baf){logger[_0x0b8f('0xd')](_0x0b8f('0x3b'),_0x392388);logger[_0x0b8f('0xf')]('CountReScheduled',_0x392388,JSON[_0x0b8f('0x12')](_0x179baf));_0x476deb(_0x179baf);})['catch'](function(_0x2f2938){logger[_0x0b8f('0x13')](_0x0b8f('0x3b'),_0x2f2938['message'],_0x392388);_0x48e072(_0x53ece2[_0x0b8f('0x13')](0x1f4,_0x2f2938[_0x0b8f('0x15')]));});});};exports[_0x0b8f('0x3c')]=function(_0x5ade82){var _0x2f06c1=this;return new Promise(function(_0x286aea,_0x5cf689){return db['CmContact'][_0x0b8f('0x2a')]()[_0x0b8f('0xc')](function(_0x5b1cfb){return db[_0x0b8f('0x2b')][_0x0b8f('0x2c')](function(_0x1c2256){return db[_0x0b8f('0x18')][_0x0b8f('0x2d')]({'where':_0x5ade82[_0x0b8f('0x19')]?_0x5ade82[_0x0b8f('0x19')][_0x0b8f('0x22')]||null:null,'attributes':_0x5ade82['options']?_0x5ade82['options'][_0x0b8f('0x1d')]||null:null,'limit':0x1,'order':_0x5ade82['options']?_0x5ade82[_0x0b8f('0x19')][_0x0b8f('0x2e')]||null:null,'group':db[_0x0b8f('0x18')][_0x0b8f('0x3d')],'transaction':_0x1c2256,'lock':_0x1c2256['LOCK'][_0x0b8f('0x2f')],'include':_0x5ade82[_0x0b8f('0x19')]?_0x5ade82[_0x0b8f('0x19')]['include']?_[_0x0b8f('0x1b')](_0x5ade82[_0x0b8f('0x19')][_0x0b8f('0x1e')],function(_0x26a947){return{'model':db[_0x26a947['model']],'as':_0x26a947['as'],'attributes':_0x26a947['attributes'],'include':_0x26a947['include']?_[_0x0b8f('0x1b')](_0x26a947[_0x0b8f('0x1e')],function(_0x5721ef){return{'model':db[_0x5721ef[_0x0b8f('0x1c')]],'as':_0x5721ef['as'],'attributes':_0x5721ef['attributes'],'include':_0x5721ef[_0x0b8f('0x1e')]?_[_0x0b8f('0x1b')](_0x5721ef[_0x0b8f('0x1e')],function(_0x354fe5){return{'model':db[_0x354fe5[_0x0b8f('0x1c')]],'as':_0x354fe5['as'],'attributes':_0x354fe5[_0x0b8f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0b8f('0xc')](function(_0x478f9c){var _0x17d23d=[];for(var _0x157b2f=0x0;_0x157b2f<_0x478f9c['length'];_0x157b2f+=0x1){_0x17d23d[_0x0b8f('0x3e')](_0x478f9c[_0x157b2f][_0x0b8f('0x33')](_0x5ade82['body'],{'transaction':_0x1c2256}));}return BPromise['all'](_0x17d23d);});})[_0x0b8f('0xc')](function(_0x206bf5){logger[_0x0b8f('0xd')](_0x0b8f('0x3c'),_0x5ade82);logger[_0x0b8f('0xf')](_0x0b8f('0x3c'),_0x5ade82,JSON[_0x0b8f('0x12')](_0x206bf5));_0x286aea(_0x206bf5);})[_0x0b8f('0x16')](function(_0x2b329a){logger[_0x0b8f('0x13')]('GetContactRecallMe',_0x2b329a[_0x0b8f('0x15')],_0x5ade82);_0x5cf689(_0x2f06c1[_0x0b8f('0x13')](0x1f4,_0x2b329a['message']));});});});}; \ No newline at end of file +var _0xad87=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','catch','CmHopper','findAll','options','raw','attributes','limit','include','map','model','GetCmHopper','find','where','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','LOCK','Contact','keys','length','body','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','order','UserId','UPDATE','push','all','GetContactRecallMe'];(function(_0x15353c,_0x55039f){var _0x3c3554=function(_0x292416){while(--_0x292416){_0x15353c['push'](_0x15353c['shift']());}};_0x3c3554(++_0x55039f);}(_0xad87,0xc6));var _0x7ad8=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xad87[_0x12d033];return _0x3b4e80;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7ad8('0x0'));var fs=require('fs');var Redis=require(_0x7ad8('0x1'));var db=require(_0x7ad8('0x2'))['db'];var utils=require(_0x7ad8('0x3'));var logger=require(_0x7ad8('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7ad8('0x5'));var client=jayson[_0x7ad8('0x6')][_0x7ad8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ee47e,_0x7aba89,_0x2a007f){return new BPromise(function(_0x4ee2f2,_0x16a100){return client[_0x7ad8('0x8')](_0x5ee47e,_0x2a007f)[_0x7ad8('0x9')](function(_0x1c0c63){logger[_0x7ad8('0xa')]('CmHopper,\x20%s,\x20%s',_0x7aba89,_0x7ad8('0xb'));logger[_0x7ad8('0xc')](_0x7ad8('0xd'),_0x7aba89,_0x7ad8('0xb'),JSON[_0x7ad8('0xe')](_0x1c0c63));if(_0x1c0c63[_0x7ad8('0xf')]){if(_0x1c0c63[_0x7ad8('0xf')][_0x7ad8('0x10')]===0x1f4){logger[_0x7ad8('0xf')](_0x7ad8('0x11'),_0x7aba89,_0x1c0c63['error'][_0x7ad8('0x12')]);return _0x16a100(_0x1c0c63[_0x7ad8('0xf')][_0x7ad8('0x12')]);}logger['error'](_0x7ad8('0x11'),_0x7aba89,_0x1c0c63[_0x7ad8('0xf')][_0x7ad8('0x12')]);return _0x4ee2f2(_0x1c0c63[_0x7ad8('0xf')][_0x7ad8('0x12')]);}else{logger['info'](_0x7ad8('0x11'),_0x7aba89,'request\x20sent');_0x4ee2f2(_0x1c0c63['result'][_0x7ad8('0x12')]);}})[_0x7ad8('0x13')](function(_0x1e4bc0){logger[_0x7ad8('0xf')](_0x7ad8('0x11'),_0x7aba89,_0x1e4bc0);_0x16a100(_0x1e4bc0);});});}exports['GetCmHopper']=function(_0x39d0c2){var _0x1ecefd=this;return new Promise(function(_0x4d6fb5,_0x17056f){return db[_0x7ad8('0x14')][_0x7ad8('0x15')]({'raw':_0x39d0c2[_0x7ad8('0x16')]?_0x39d0c2[_0x7ad8('0x16')][_0x7ad8('0x17')]===undefined?!![]:![]:!![],'where':_0x39d0c2[_0x7ad8('0x16')]?_0x39d0c2[_0x7ad8('0x16')]['where']||null:null,'attributes':_0x39d0c2[_0x7ad8('0x16')]?_0x39d0c2[_0x7ad8('0x16')][_0x7ad8('0x18')]||null:null,'limit':_0x39d0c2[_0x7ad8('0x16')]?_0x39d0c2['options'][_0x7ad8('0x19')]||null:null,'include':_0x39d0c2[_0x7ad8('0x16')]?_0x39d0c2[_0x7ad8('0x16')][_0x7ad8('0x1a')]?_[_0x7ad8('0x1b')](_0x39d0c2['options'][_0x7ad8('0x1a')],function(_0xddd0cc){return{'model':db[_0xddd0cc['model']],'as':_0xddd0cc['as'],'attributes':_0xddd0cc[_0x7ad8('0x18')],'include':_0xddd0cc['include']?_[_0x7ad8('0x1b')](_0xddd0cc[_0x7ad8('0x1a')],function(_0x310ce2){return{'model':db[_0x310ce2[_0x7ad8('0x1c')]],'as':_0x310ce2['as'],'attributes':_0x310ce2[_0x7ad8('0x18')],'include':_0x310ce2[_0x7ad8('0x1a')]?_['map'](_0x310ce2['include'],function(_0x32a4b7){return{'model':db[_0x32a4b7[_0x7ad8('0x1c')]],'as':_0x32a4b7['as'],'attributes':_0x32a4b7[_0x7ad8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7ad8('0x9')](function(_0x4b14db){logger[_0x7ad8('0xa')](_0x7ad8('0x1d'),_0x39d0c2);logger[_0x7ad8('0xc')](_0x7ad8('0x1d'),_0x39d0c2,JSON[_0x7ad8('0xe')](_0x4b14db));_0x4d6fb5(_0x4b14db);})[_0x7ad8('0x13')](function(_0x57fd7e){logger[_0x7ad8('0xf')](_0x7ad8('0x1d'),_0x57fd7e['message'],_0x39d0c2);_0x17056f(_0x1ecefd[_0x7ad8('0xf')](0x1f4,_0x57fd7e[_0x7ad8('0x12')]));});});};exports['ShowCmHopper']=function(_0x3e35d8){var _0x2f60f8=this;return new Promise(function(_0x1be6cf,_0xf1cd2d){return db['CmHopper'][_0x7ad8('0x1e')]({'raw':_0x3e35d8['options']?_0x3e35d8[_0x7ad8('0x16')][_0x7ad8('0x17')]===undefined?!![]:![]:!![],'where':_0x3e35d8[_0x7ad8('0x16')]?_0x3e35d8['options'][_0x7ad8('0x1f')]||null:null,'attributes':_0x3e35d8[_0x7ad8('0x16')]?_0x3e35d8[_0x7ad8('0x16')][_0x7ad8('0x18')]||null:null,'include':_0x3e35d8[_0x7ad8('0x16')]?_0x3e35d8[_0x7ad8('0x16')][_0x7ad8('0x1a')]?_['map'](_0x3e35d8[_0x7ad8('0x16')][_0x7ad8('0x1a')],function(_0x3871f1){return{'model':db[_0x3871f1[_0x7ad8('0x1c')]],'as':_0x3871f1['as'],'attributes':_0x3871f1[_0x7ad8('0x18')],'include':_0x3871f1[_0x7ad8('0x1a')]?_[_0x7ad8('0x1b')](_0x3871f1[_0x7ad8('0x1a')],function(_0x29716d){return{'model':db[_0x29716d[_0x7ad8('0x1c')]],'as':_0x29716d['as'],'attributes':_0x29716d[_0x7ad8('0x18')],'include':_0x29716d[_0x7ad8('0x1a')]?_[_0x7ad8('0x1b')](_0x29716d['include'],function(_0x139087){return{'model':db[_0x139087['model']],'as':_0x139087['as'],'attributes':_0x139087[_0x7ad8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7ad8('0x9')](function(_0x44c97c){logger[_0x7ad8('0xa')](_0x7ad8('0x20'),_0x3e35d8);logger[_0x7ad8('0xc')](_0x7ad8('0x20'),_0x3e35d8,JSON[_0x7ad8('0xe')](_0x44c97c));_0x1be6cf(_0x44c97c);})[_0x7ad8('0x13')](function(_0x5856e1){logger['error']('ShowCmHopper',_0x5856e1['message'],_0x3e35d8);_0xf1cd2d(_0x2f60f8['error'](0x1f4,_0x5856e1[_0x7ad8('0x12')]));});});};exports[_0x7ad8('0x21')]=function(_0x42a23f){var _0x36cd0e=this;return new Promise(function(_0x298c6b,_0x8403c){return db[_0x7ad8('0x14')][_0x7ad8('0x22')](_0x42a23f['body'],{'raw':_0x42a23f[_0x7ad8('0x16')]?_0x42a23f[_0x7ad8('0x16')][_0x7ad8('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x477455){logger[_0x7ad8('0xa')]('CreateCmHopper',_0x42a23f);logger[_0x7ad8('0xc')](_0x7ad8('0x21'),_0x42a23f,JSON[_0x7ad8('0xe')](_0x477455));_0x298c6b(_0x477455);})[_0x7ad8('0x13')](function(_0x26a7bf){logger[_0x7ad8('0xf')](_0x7ad8('0x21'),_0x26a7bf[_0x7ad8('0x12')],_0x42a23f);_0x8403c(_0x36cd0e[_0x7ad8('0xf')](0x1f4,_0x26a7bf[_0x7ad8('0x12')]));});});};exports[_0x7ad8('0x23')]=function(_0xe0a192){var _0x2a05b4=this;return new Promise(function(_0x145e13,_0x17ded0){return db[_0x7ad8('0x14')][_0x7ad8('0x24')](_0xe0a192['body'],{'raw':_0xe0a192[_0x7ad8('0x16')]?_0xe0a192[_0x7ad8('0x16')][_0x7ad8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe0a192[_0x7ad8('0x16')]?_0xe0a192['options'][_0x7ad8('0x1f')]||null:null,'attributes':_0xe0a192[_0x7ad8('0x16')]?_0xe0a192[_0x7ad8('0x16')][_0x7ad8('0x18')]||null:null,'limit':_0xe0a192[_0x7ad8('0x16')]?_0xe0a192[_0x7ad8('0x16')][_0x7ad8('0x19')]||null:null})['then'](function(_0x387542){logger[_0x7ad8('0xa')]('UpdateCmHopper',_0xe0a192);logger[_0x7ad8('0xc')](_0x7ad8('0x23'),_0xe0a192,JSON[_0x7ad8('0xe')](_0x387542));_0x145e13(_0x387542);})['catch'](function(_0x458d47){logger[_0x7ad8('0xf')](_0x7ad8('0x23'),_0x458d47[_0x7ad8('0x12')],_0xe0a192);_0x17ded0(_0x2a05b4[_0x7ad8('0xf')](0x1f4,_0x458d47['message']));});});};exports[_0x7ad8('0x25')]=function(_0x2e2615){var _0x52763b=this;return new Promise(function(_0x17ba26,_0x540e98){return db['CmHopper'][_0x7ad8('0x26')]({'where':_0x2e2615['options']?_0x2e2615[_0x7ad8('0x16')]['where']||null:null})[_0x7ad8('0x9')](function(_0x10f87c){logger[_0x7ad8('0xa')](_0x7ad8('0x25'),_0x2e2615);logger['debug'](_0x7ad8('0x25'),_0x2e2615,JSON[_0x7ad8('0xe')](_0x10f87c));_0x17ba26(_0x10f87c);})[_0x7ad8('0x13')](function(_0xb08bc7){logger[_0x7ad8('0xf')]('DestroyCmHopper',_0xb08bc7[_0x7ad8('0x12')],_0x2e2615);_0x540e98(_0x52763b['error'](0x1f4,_0xb08bc7[_0x7ad8('0x12')]));});});};exports['GetContactDialer']=function(_0x2f4287){var _0x54717f=this;return new Promise(function(_0x19fb8f,_0x2b8076){return db[_0x7ad8('0x27')][_0x7ad8('0x28')]()[_0x7ad8('0x9')](function(_0x56064b){return db[_0x7ad8('0x29')][_0x7ad8('0x2a')](function(_0xc52cca){return db[_0x7ad8('0x14')][_0x7ad8('0x15')]({'where':_0x2f4287['options']?_0x2f4287[_0x7ad8('0x16')][_0x7ad8('0x1f')]||null:null,'attributes':_0x2f4287[_0x7ad8('0x16')]?_0x2f4287['options'][_0x7ad8('0x18')]||null:null,'limit':_0x2f4287[_0x7ad8('0x16')]?_0x2f4287['options'][_0x7ad8('0x19')]||null:null,'order':_0x2f4287[_0x7ad8('0x16')]?_0x2f4287[_0x7ad8('0x16')]['order']||null:null,'transaction':_0xc52cca,'lock':_0xc52cca[_0x7ad8('0x2b')]['UPDATE'],'include':[{'model':db[_0x7ad8('0x27')],'as':_0x7ad8('0x2c'),'attributes':_[_0x7ad8('0x2d')](_0x56064b)}]})['then'](function(_0x2fda0b){var _0x30a5a2=[];for(var _0x34674e=0x0;_0x34674e<_0x2fda0b[_0x7ad8('0x2e')];_0x34674e+=0x1){_0x30a5a2['push'](_0x2fda0b[_0x34674e][_0x7ad8('0x24')](_0x2f4287[_0x7ad8('0x2f')],{'transaction':_0xc52cca}));}return BPromise['all'](_0x30a5a2);});})[_0x7ad8('0x9')](function(_0x4ce4ec){logger['info'](_0x7ad8('0x30'),_0x2f4287);logger[_0x7ad8('0xc')](_0x7ad8('0x30'),_0x2f4287,JSON[_0x7ad8('0xe')](_0x4ce4ec));_0x19fb8f(_0x4ce4ec);})['catch'](function(_0x5b61a2){logger[_0x7ad8('0xf')](_0x7ad8('0x30'),_0x5b61a2[_0x7ad8('0x12')],_0x2f4287);_0x2b8076(_0x54717f[_0x7ad8('0xf')](0x1f4,_0x5b61a2[_0x7ad8('0x12')]));});});});};exports[_0x7ad8('0x31')]=function(_0x21847b){var _0x43f8ce=this;return new Promise(function(_0x2ff5b3,_0x22c371){return db['sequelize'][_0x7ad8('0x2a')](function(_0x459bb4){return db[_0x7ad8('0x32')][_0x7ad8('0x22')](_0x21847b['body'],{'raw':_0x21847b[_0x7ad8('0x16')]?_0x21847b[_0x7ad8('0x16')][_0x7ad8('0x17')]===undefined?!![]:![]:!![],'transaction':_0x459bb4})[_0x7ad8('0x9')](function(){return db[_0x7ad8('0x14')][_0x7ad8('0x26')]({'where':_0x21847b[_0x7ad8('0x16')]?_0x21847b[_0x7ad8('0x16')]['where']||null:null,'transaction':_0x459bb4});});})[_0x7ad8('0x9')](function(_0x577303){logger['info']('MoveContactManagedDialer',_0x21847b);logger[_0x7ad8('0xc')]('MoveContactManagedDialer',_0x21847b,JSON['stringify'](_0x577303));_0x2ff5b3(_0x577303);})[_0x7ad8('0x13')](function(_0x3c0897){logger[_0x7ad8('0xf')](_0x7ad8('0x31'),_0x3c0897[_0x7ad8('0x12')],_0x21847b);_0x22c371(_0x43f8ce[_0x7ad8('0xf')](0x1f4,_0x3c0897[_0x7ad8('0x12')]));});});};exports[_0x7ad8('0x33')]=function(_0x3b1ebe){var _0x295068=this;return new Promise(function(_0x28384b,_0x3ecb32){return db[_0x7ad8('0x14')]['findAll']({'raw':_0x3b1ebe[_0x7ad8('0x16')]?_0x3b1ebe[_0x7ad8('0x16')][_0x7ad8('0x17')]===undefined?!![]:![]:!![],'where':_0x3b1ebe[_0x7ad8('0x16')]?_0x3b1ebe[_0x7ad8('0x16')]['where']||null:null,'attributes':[[db[_0x7ad8('0x29')]['fn'](_0x7ad8('0x34'),db['sequelize']['fn']('IF',db[_0x7ad8('0x29')][_0x7ad8('0x35')](_0x7ad8('0x36')+util[_0x7ad8('0x37')](_0x7ad8('0x38'),moment()[_0x7ad8('0x37')](_0x7ad8('0x39')))+_0x7ad8('0x3a')))),_0x7ad8('0x3b')]]})[_0x7ad8('0x9')](function(_0xf43bc5){logger[_0x7ad8('0xa')](_0x7ad8('0x33'),_0x3b1ebe);logger[_0x7ad8('0xc')](_0x7ad8('0x33'),_0x3b1ebe,JSON[_0x7ad8('0xe')](_0xf43bc5));_0x28384b(_0xf43bc5);})['catch'](function(_0x58b527){logger['error'](_0x7ad8('0x33'),_0x58b527[_0x7ad8('0x12')],_0x3b1ebe);_0x3ecb32(_0x295068['error'](0x1f4,_0x58b527['message']));});});};exports['GetContactRecallMe']=function(_0x321a79){var _0x494ddc=this;return new Promise(function(_0x6e5f4c,_0x5616f4){return db[_0x7ad8('0x27')][_0x7ad8('0x28')]()[_0x7ad8('0x9')](function(_0x4bcabd){return db[_0x7ad8('0x29')][_0x7ad8('0x2a')](function(_0x58fb13){return db[_0x7ad8('0x14')][_0x7ad8('0x15')]({'where':_0x321a79['options']?_0x321a79[_0x7ad8('0x16')][_0x7ad8('0x1f')]||null:null,'attributes':_0x321a79[_0x7ad8('0x16')]?_0x321a79[_0x7ad8('0x16')][_0x7ad8('0x18')]||null:null,'limit':0x1,'order':_0x321a79[_0x7ad8('0x16')]?_0x321a79['options'][_0x7ad8('0x3c')]||null:null,'group':db[_0x7ad8('0x14')][_0x7ad8('0x3d')],'transaction':_0x58fb13,'lock':_0x58fb13[_0x7ad8('0x2b')][_0x7ad8('0x3e')],'include':_0x321a79[_0x7ad8('0x16')]?_0x321a79['options'][_0x7ad8('0x1a')]?_[_0x7ad8('0x1b')](_0x321a79['options']['include'],function(_0x4eb3e0){return{'model':db[_0x4eb3e0['model']],'as':_0x4eb3e0['as'],'attributes':_0x4eb3e0[_0x7ad8('0x18')],'include':_0x4eb3e0[_0x7ad8('0x1a')]?_[_0x7ad8('0x1b')](_0x4eb3e0[_0x7ad8('0x1a')],function(_0x1d62f1){return{'model':db[_0x1d62f1[_0x7ad8('0x1c')]],'as':_0x1d62f1['as'],'attributes':_0x1d62f1[_0x7ad8('0x18')],'include':_0x1d62f1[_0x7ad8('0x1a')]?_[_0x7ad8('0x1b')](_0x1d62f1['include'],function(_0x1931ab){return{'model':db[_0x1931ab[_0x7ad8('0x1c')]],'as':_0x1931ab['as'],'attributes':_0x1931ab[_0x7ad8('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a4a58){var _0x627bca=[];for(var _0x4b7cc3=0x0;_0x4b7cc3<_0x5a4a58['length'];_0x4b7cc3+=0x1){_0x627bca[_0x7ad8('0x3f')](_0x5a4a58[_0x4b7cc3][_0x7ad8('0x24')](_0x321a79[_0x7ad8('0x2f')],{'transaction':_0x58fb13}));}return BPromise[_0x7ad8('0x40')](_0x627bca);});})[_0x7ad8('0x9')](function(_0x283b8e){logger[_0x7ad8('0xa')](_0x7ad8('0x41'),_0x321a79);logger['debug'](_0x7ad8('0x41'),_0x321a79,JSON['stringify'](_0x283b8e));_0x6e5f4c(_0x283b8e);})[_0x7ad8('0x13')](function(_0x480d3e){logger['error']('GetContactRecallMe',_0x480d3e[_0x7ad8('0x12')],_0x321a79);_0x5616f4(_0x494ddc[_0x7ad8('0xf')](0x1f4,_0x480d3e[_0x7ad8('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 4b05bfe..43f524f 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bb0=['/opencontacts','getOpenContacts','/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index'];(function(_0xead098,_0x35a36e){var _0xdd2c38=function(_0x1a0148){while(--_0x1a0148){_0xead098['push'](_0xead098['shift']());}};_0xdd2c38(++_0x35a36e);}(_0x2bb0,0x95));var _0x02bb=function(_0x439adc,_0x1b7297){_0x439adc=_0x439adc-0x0;var _0x51c487=_0x2bb0[_0x439adc];return _0x51c487;};'use strict';var multer=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var path=require(_0x02bb('0x2'));var timeout=require(_0x02bb('0x3'));var express=require(_0x02bb('0x4'));var router=express[_0x02bb('0x5')]();var auth=require(_0x02bb('0x6'));var interaction=require(_0x02bb('0x7'));var config=require('../../config/environment');var controller=require(_0x02bb('0x8'));router[_0x02bb('0x9')]('/',auth[_0x02bb('0xa')](),controller[_0x02bb('0xb')]);router[_0x02bb('0x9')]('/describe',auth[_0x02bb('0xa')](),controller['describe']);router['get'](_0x02bb('0xc'),auth[_0x02bb('0xa')](),controller[_0x02bb('0xd')]);router[_0x02bb('0x9')](_0x02bb('0xe'),auth[_0x02bb('0xa')](),controller[_0x02bb('0xf')]);router[_0x02bb('0x10')]('/',auth[_0x02bb('0xa')](),controller['create']);router['post'](_0x02bb('0x11'),auth[_0x02bb('0xa')](),controller[_0x02bb('0x12')]);router[_0x02bb('0x13')](_0x02bb('0xe'),auth['isAuthenticated'](),controller[_0x02bb('0x14')]);router[_0x02bb('0x15')](_0x02bb('0xe'),auth[_0x02bb('0xa')](),controller['destroy']);module[_0x02bb('0x16')]=router; \ No newline at end of file +var _0x614b=['create','/preview','getPreview','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','index','describe','get','/opencontacts','isAuthenticated','getOpenContacts','/:id','show','post'];(function(_0x3f40c5,_0x53da93){var _0x4e5ecf=function(_0x8f436a){while(--_0x8f436a){_0x3f40c5['push'](_0x3f40c5['shift']());}};_0x4e5ecf(++_0x53da93);}(_0x614b,0xf9));var _0xb614=function(_0x1fa356,_0x3edf8b){_0x1fa356=_0x1fa356-0x0;var _0x156e8d=_0x614b[_0x1fa356];return _0x156e8d;};'use strict';var multer=require('multer');var util=require(_0xb614('0x0'));var path=require(_0xb614('0x1'));var timeout=require(_0xb614('0x2'));var express=require('express');var router=express[_0xb614('0x3')]();var auth=require(_0xb614('0x4'));var interaction=require(_0xb614('0x5'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb614('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xb614('0x7')]);router[_0xb614('0x8')](_0xb614('0x9'),auth[_0xb614('0xa')](),controller[_0xb614('0xb')]);router[_0xb614('0x8')](_0xb614('0xc'),auth[_0xb614('0xa')](),controller[_0xb614('0xd')]);router[_0xb614('0xe')]('/',auth['isAuthenticated'](),controller[_0xb614('0xf')]);router[_0xb614('0xe')](_0xb614('0x10'),auth[_0xb614('0xa')](),controller[_0xb614('0x11')]);router[_0xb614('0x12')](_0xb614('0xc'),auth['isAuthenticated'](),controller[_0xb614('0x13')]);router['delete'](_0xb614('0xc'),auth[_0xb614('0xa')](),controller[_0xb614('0x14')]);module[_0xb614('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index ba078ef..76d2f1e 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js +++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d1c=['exports','STRING','contactListQueue','INTEGER','moment'];(function(_0x11076c,_0x2854be){var _0x2e53cb=function(_0x2d4bca){while(--_0x2d4bca){_0x11076c['push'](_0x11076c['shift']());}};_0x2e53cb(++_0x2854be);}(_0x3d1c,0x1d5));var _0xc3d1=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x3d1c[_0x2962d5];return _0x273406;};'use strict';var moment=require(_0xc3d1('0x0'));var Sequelize=require('sequelize');module[_0xc3d1('0x1')]={'phone':{'type':Sequelize[_0xc3d1('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xc3d1('0x3')},'ListId':{'type':Sequelize[_0xc3d1('0x4')],'unique':_0xc3d1('0x3')},'VoiceQueueId':{'type':Sequelize[_0xc3d1('0x4')],'unique':_0xc3d1('0x3')}}; \ No newline at end of file +var _0xd790=['STRING','INTEGER','contactListQueue','moment','exports'];(function(_0x12577a,_0x134b75){var _0x57be26=function(_0x417dd1){while(--_0x417dd1){_0x12577a['push'](_0x12577a['shift']());}};_0x57be26(++_0x134b75);}(_0xd790,0x148));var _0x0d79=function(_0x572618,_0x287468){_0x572618=_0x572618-0x0;var _0x113a44=_0xd790[_0x572618];return _0x113a44;};'use strict';var moment=require(_0x0d79('0x0'));var Sequelize=require('sequelize');module[_0x0d79('0x1')]={'phone':{'type':Sequelize[_0x0d79('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0d79('0x3')],'unique':_0x0d79('0x4')},'ListId':{'type':Sequelize[_0x0d79('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x0d79('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 0a320f2..3fb62d6 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.controller.js +++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fc9=['count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show','params','length','include','find','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x2fc9,0xc2));var _0x92fc=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0x2fc9[_0x1d2bc8];return _0x1857e1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x92fc('0x0'));var rimraf=require(_0x92fc('0x1'));var zipdir=require(_0x92fc('0x2'));var jsonpatch=require(_0x92fc('0x3'));var rp=require(_0x92fc('0x4'));var moment=require(_0x92fc('0x5'));var BPromise=require(_0x92fc('0x6'));var Mustache=require(_0x92fc('0x7'));var util=require(_0x92fc('0x8'));var path=require(_0x92fc('0x9'));var sox=require(_0x92fc('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x92fc('0xb'));var crypto=require(_0x92fc('0xc'));var jsforce=require(_0x92fc('0xd'));var deskjs=require(_0x92fc('0xe'));var toCsv=require(_0x92fc('0xf'));var querystring=require(_0x92fc('0x10'));var Papa=require(_0x92fc('0x11'));var Redis=require('ioredis');var authService=require(_0x92fc('0x12'));var qs=require(_0x92fc('0x13'));var as=require(_0x92fc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92fc('0x15'))(_0x92fc('0x16'));var utils=require(_0x92fc('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x113ad1,_0x2aff0d){_0x2aff0d=_0x2aff0d||0xcc;return function(_0x5d5d23){if(_0x5d5d23){return _0x113ad1[_0x92fc('0x18')](_0x2aff0d);}return _0x113ad1[_0x92fc('0x19')](_0x2aff0d)[_0x92fc('0x1a')]();};}function respondWithResult(_0x1f5275,_0xf88abf){_0xf88abf=_0xf88abf||0xc8;return function(_0x5a2ecc){if(_0x5a2ecc){return _0x1f5275[_0x92fc('0x19')](_0xf88abf)[_0x92fc('0x1b')](_0x5a2ecc);}};}function respondWithFilteredResult(_0x208b7e,_0x23a9ad){return function(_0x5b3fba){if(_0x5b3fba){var _0x4c45f3=_0x5b3fba[_0x92fc('0x1c')],_0x111f42=_0x23a9ad[_0x92fc('0x1d')],_0x6de681=_0x23a9ad[_0x92fc('0x1d')]+_0x23a9ad['limit'],_0x510e12;if(_0x6de681>=_0x4c45f3){_0x6de681=_0x4c45f3;_0x510e12=0xc8;}else{_0x510e12=0xce;}_0x208b7e[_0x92fc('0x19')](_0x510e12);return _0x208b7e[_0x92fc('0x1e')](_0x92fc('0x1f'),_0x111f42+'-'+_0x6de681+'/'+_0x4c45f3)[_0x92fc('0x1b')](_0x5b3fba);}return null;};}function patchUpdates(_0x22d671){return function(_0x377cae){try{jsonpatch[_0x92fc('0x20')](_0x377cae,_0x22d671,!![]);}catch(_0x9b5d12){return BPromise['reject'](_0x9b5d12);}return _0x377cae[_0x92fc('0x21')]();};}function saveUpdates(_0x4eaeff,_0x1e3bb1){return function(_0x2cc51d){if(_0x2cc51d){return _0x2cc51d[_0x92fc('0x22')](_0x4eaeff)[_0x92fc('0x23')](function(_0x35d40e){return _0x35d40e;});}return null;};}function removeEntity(_0x4584c8,_0x2848f0){return function(_0x5d5c29){if(_0x5d5c29){return _0x5d5c29[_0x92fc('0x24')]()[_0x92fc('0x23')](function(){_0x4584c8[_0x92fc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e986,_0x442576){return function(_0x3d06d5){if(!_0x3d06d5){_0x29e986['sendStatus'](0x194);}return _0x3d06d5;};}function handleError(_0x3161e9,_0x23a6ed){_0x23a6ed=_0x23a6ed||0x1f4;return function(_0x360a83){logger[_0x92fc('0x25')](_0x360a83[_0x92fc('0x26')]);if(_0x360a83[_0x92fc('0x27')]){delete _0x360a83[_0x92fc('0x27')];}_0x3161e9[_0x92fc('0x19')](_0x23a6ed)[_0x92fc('0x28')](_0x360a83);};}exports[_0x92fc('0x29')]=function(_0xea17d,_0x1c0269){var _0x215e98={},_0x4ef103={},_0x373851={'count':0x0,'rows':[]};var _0x15e7c3=_[_0x92fc('0x2a')](db[_0x92fc('0x2b')][_0x92fc('0x2c')],function(_0x32a54b){return{'name':_0x32a54b[_0x92fc('0x2d')],'type':_0x32a54b['type'][_0x92fc('0x2e')]};});_0x4ef103[_0x92fc('0x2f')]=_[_0x92fc('0x2a')](_0x15e7c3,'name');_0x4ef103[_0x92fc('0x30')]=_[_0x92fc('0x31')](_0xea17d[_0x92fc('0x30')]);_0x4ef103[_0x92fc('0x32')]=_[_0x92fc('0x33')](_0x4ef103['model'],_0x4ef103[_0x92fc('0x30')]);_0x215e98[_0x92fc('0x34')]=_[_0x92fc('0x33')](_0x4ef103['model'],qs[_0x92fc('0x35')](_0xea17d[_0x92fc('0x30')][_0x92fc('0x35')]));_0x215e98[_0x92fc('0x34')]=_0x215e98[_0x92fc('0x34')]['length']?_0x215e98[_0x92fc('0x34')]:_0x4ef103[_0x92fc('0x2f')];if(!_0xea17d[_0x92fc('0x30')][_0x92fc('0x36')]('nolimit')){_0x215e98[_0x92fc('0x37')]=qs['limit'](_0xea17d['query'][_0x92fc('0x37')]);_0x215e98[_0x92fc('0x1d')]=qs[_0x92fc('0x1d')](_0xea17d[_0x92fc('0x30')][_0x92fc('0x1d')]);}_0x215e98['order']=qs[_0x92fc('0x38')](_0xea17d[_0x92fc('0x30')][_0x92fc('0x38')]);_0x215e98[_0x92fc('0x39')]=qs['filters'](_[_0x92fc('0x3a')](_0xea17d[_0x92fc('0x30')],_0x4ef103[_0x92fc('0x32')]));if(_0xea17d[_0x92fc('0x30')][_0x92fc('0x3b')]){_0x215e98[_0x92fc('0x39')]=_[_0x92fc('0x3c')](_0x215e98['where'],{'$or':_['map'](_0x15e7c3,function(_0x4b0b65){if(_0x4b0b65[_0x92fc('0x3d')]!==_0x92fc('0x3e')){var _0x2e3230={};_0x2e3230[_0x4b0b65['name']]={'$like':'%'+_0xea17d[_0x92fc('0x30')][_0x92fc('0x3b')]+'%'};return _0x2e3230;}})});}_0x215e98=_[_0x92fc('0x3c')]({},_0x215e98,_0xea17d[_0x92fc('0x3f')]);var _0x543242={'where':_0x215e98[_0x92fc('0x39')]};return db[_0x92fc('0x2b')]['count'](_0x543242)['then'](function(_0x536698){_0x373851[_0x92fc('0x1c')]=_0x536698;if(_0xea17d[_0x92fc('0x30')][_0x92fc('0x40')]){_0x215e98['include']=[{'all':!![]}];}return db[_0x92fc('0x2b')]['findAll'](_0x215e98);})[_0x92fc('0x23')](function(_0x776adf){_0x373851[_0x92fc('0x41')]=_0x776adf;return _0x373851;})[_0x92fc('0x23')](respondWithFilteredResult(_0x1c0269,_0x215e98))['catch'](handleError(_0x1c0269,null));};exports[_0x92fc('0x42')]=function(_0x174fd5,_0x1a0544){var _0x34df09={'raw':!![],'where':{'id':_0x174fd5[_0x92fc('0x43')]['id']}},_0x5831f4={};_0x5831f4['model']=_[_0x92fc('0x31')](db[_0x92fc('0x2b')]['rawAttributes']);_0x5831f4[_0x92fc('0x30')]=_[_0x92fc('0x31')](_0x174fd5[_0x92fc('0x30')]);_0x5831f4[_0x92fc('0x32')]=_[_0x92fc('0x33')](_0x5831f4[_0x92fc('0x2f')],_0x5831f4[_0x92fc('0x30')]);_0x34df09[_0x92fc('0x34')]=_['intersection'](_0x5831f4[_0x92fc('0x2f')],qs[_0x92fc('0x35')](_0x174fd5['query'][_0x92fc('0x35')]));_0x34df09[_0x92fc('0x34')]=_0x34df09[_0x92fc('0x34')][_0x92fc('0x44')]?_0x34df09[_0x92fc('0x34')]:_0x5831f4[_0x92fc('0x2f')];if(_0x174fd5['query']['includeAll']){_0x34df09[_0x92fc('0x45')]=[{'all':!![]}];}_0x34df09=_[_0x92fc('0x3c')]({},_0x34df09,_0x174fd5[_0x92fc('0x3f')]);return db[_0x92fc('0x2b')][_0x92fc('0x46')](_0x34df09)[_0x92fc('0x23')](handleEntityNotFound(_0x1a0544,null))[_0x92fc('0x23')](respondWithResult(_0x1a0544,null))['catch'](handleError(_0x1a0544,null));};exports[_0x92fc('0x22')]=function(_0xa575d9,_0x7d80b8){if(_0xa575d9[_0x92fc('0x47')]['id']){delete _0xa575d9['body']['id'];}return db[_0x92fc('0x2b')][_0x92fc('0x46')]({'where':{'id':_0xa575d9[_0x92fc('0x43')]['id']}})[_0x92fc('0x23')](handleEntityNotFound(_0x7d80b8,null))['then'](saveUpdates(_0xa575d9['body'],null))[_0x92fc('0x23')](respondWithResult(_0x7d80b8,null))['catch'](handleError(_0x7d80b8,null));};exports[_0x92fc('0x24')]=function(_0x16466b,_0x15993c){return db[_0x92fc('0x2b')][_0x92fc('0x46')]({'where':{'id':_0x16466b[_0x92fc('0x43')]['id']}})[_0x92fc('0x23')](handleEntityNotFound(_0x15993c,null))['then'](removeEntity(_0x15993c,null))[_0x92fc('0x48')](handleError(_0x15993c,null));};exports[_0x92fc('0x49')]=function(_0x538565,_0x28ad1c){return db['CmHopperBlack'][_0x92fc('0x49')]()[_0x92fc('0x23')](respondWithResult(_0x28ad1c,null))['catch'](handleError(_0x28ad1c,null));}; \ No newline at end of file +var _0x186d=['update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','CmHopperBlack','include','rows','catch','show','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply'];(function(_0x1d8bec,_0x5910b6){var _0x3c7ae3=function(_0x2731ad){while(--_0x2731ad){_0x1d8bec['push'](_0x1d8bec['shift']());}};_0x3c7ae3(++_0x5910b6);}(_0x186d,0x1ca));var _0xd186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x186d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd186('0x0'));var rimraf=require(_0xd186('0x1'));var zipdir=require(_0xd186('0x2'));var jsonpatch=require(_0xd186('0x3'));var rp=require(_0xd186('0x4'));var moment=require(_0xd186('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd186('0x6'));var util=require(_0xd186('0x7'));var path=require(_0xd186('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd186('0x9'));var fs=require('fs');var _=require(_0xd186('0xa'));var squel=require(_0xd186('0xb'));var crypto=require('crypto');var jsforce=require(_0xd186('0xc'));var deskjs=require(_0xd186('0xd'));var toCsv=require(_0xd186('0xe'));var querystring=require('querystring');var Papa=require(_0xd186('0xf'));var Redis=require(_0xd186('0x10'));var authService=require(_0xd186('0x11'));var qs=require(_0xd186('0x12'));var as=require(_0xd186('0x13'));var hardwareService=require(_0xd186('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd186('0x15'));var config=require('../../config/environment');var db=require(_0xd186('0x16'))['db'];function respondWithStatusCode(_0x383f06,_0x2cefe9){_0x2cefe9=_0x2cefe9||0xcc;return function(_0x5cfef6){if(_0x5cfef6){return _0x383f06[_0xd186('0x17')](_0x2cefe9);}return _0x383f06['status'](_0x2cefe9)[_0xd186('0x18')]();};}function respondWithResult(_0x4653a2,_0x17368e){_0x17368e=_0x17368e||0xc8;return function(_0x4618ab){if(_0x4618ab){return _0x4653a2[_0xd186('0x19')](_0x17368e)[_0xd186('0x1a')](_0x4618ab);}};}function respondWithFilteredResult(_0x3e0bda,_0x152ede){return function(_0xc23af7){if(_0xc23af7){var _0xfb67a0=_0xc23af7[_0xd186('0x1b')],_0x207d6a=_0x152ede[_0xd186('0x1c')],_0x4ad92c=_0x152ede[_0xd186('0x1c')]+_0x152ede[_0xd186('0x1d')],_0x3b4656;if(_0x4ad92c>=_0xfb67a0){_0x4ad92c=_0xfb67a0;_0x3b4656=0xc8;}else{_0x3b4656=0xce;}_0x3e0bda[_0xd186('0x19')](_0x3b4656);return _0x3e0bda[_0xd186('0x1e')]('Content-Range',_0x207d6a+'-'+_0x4ad92c+'/'+_0xfb67a0)[_0xd186('0x1a')](_0xc23af7);}return null;};}function patchUpdates(_0x3287a7){return function(_0x5471ff){try{jsonpatch[_0xd186('0x1f')](_0x5471ff,_0x3287a7,!![]);}catch(_0x2276f1){return BPromise['reject'](_0x2276f1);}return _0x5471ff['save']();};}function saveUpdates(_0x4111a8,_0x374e72){return function(_0x46e238){if(_0x46e238){return _0x46e238[_0xd186('0x20')](_0x4111a8)[_0xd186('0x21')](function(_0x59d7fe){return _0x59d7fe;});}return null;};}function removeEntity(_0xe1e14d,_0x745706){return function(_0x1cc315){if(_0x1cc315){return _0x1cc315['destroy']()['then'](function(){_0xe1e14d[_0xd186('0x19')](0xcc)[_0xd186('0x18')]();});}};}function handleEntityNotFound(_0x223bc7,_0x5a5ff0){return function(_0x5c4dc5){if(!_0x5c4dc5){_0x223bc7[_0xd186('0x17')](0x194);}return _0x5c4dc5;};}function handleError(_0x26e54e,_0x529496){_0x529496=_0x529496||0x1f4;return function(_0x537374){logger[_0xd186('0x22')](_0x537374[_0xd186('0x23')]);if(_0x537374[_0xd186('0x24')]){delete _0x537374[_0xd186('0x24')];}_0x26e54e[_0xd186('0x19')](_0x529496)[_0xd186('0x25')](_0x537374);};}exports[_0xd186('0x26')]=function(_0x5f47ed,_0x5a40b8){var _0x110509={},_0x1e2cce={},_0x3d3827={'count':0x0,'rows':[]};var _0x24cf30=_[_0xd186('0x27')](db['CmHopperBlack'][_0xd186('0x28')],function(_0x8563a2){return{'name':_0x8563a2[_0xd186('0x29')],'type':_0x8563a2[_0xd186('0x2a')][_0xd186('0x2b')]};});_0x1e2cce[_0xd186('0x2c')]=_[_0xd186('0x27')](_0x24cf30,_0xd186('0x24'));_0x1e2cce[_0xd186('0x2d')]=_[_0xd186('0x2e')](_0x5f47ed[_0xd186('0x2d')]);_0x1e2cce[_0xd186('0x2f')]=_[_0xd186('0x30')](_0x1e2cce[_0xd186('0x2c')],_0x1e2cce[_0xd186('0x2d')]);_0x110509[_0xd186('0x31')]=_[_0xd186('0x30')](_0x1e2cce[_0xd186('0x2c')],qs[_0xd186('0x32')](_0x5f47ed[_0xd186('0x2d')][_0xd186('0x32')]));_0x110509[_0xd186('0x31')]=_0x110509[_0xd186('0x31')][_0xd186('0x33')]?_0x110509[_0xd186('0x31')]:_0x1e2cce[_0xd186('0x2c')];if(!_0x5f47ed[_0xd186('0x2d')][_0xd186('0x34')](_0xd186('0x35'))){_0x110509[_0xd186('0x1d')]=qs[_0xd186('0x1d')](_0x5f47ed[_0xd186('0x2d')]['limit']);_0x110509[_0xd186('0x1c')]=qs[_0xd186('0x1c')](_0x5f47ed[_0xd186('0x2d')][_0xd186('0x1c')]);}_0x110509[_0xd186('0x36')]=qs[_0xd186('0x37')](_0x5f47ed[_0xd186('0x2d')][_0xd186('0x37')]);_0x110509['where']=qs[_0xd186('0x2f')](_[_0xd186('0x38')](_0x5f47ed[_0xd186('0x2d')],_0x1e2cce[_0xd186('0x2f')]));if(_0x5f47ed[_0xd186('0x2d')][_0xd186('0x39')]){_0x110509[_0xd186('0x3a')]=_[_0xd186('0x3b')](_0x110509[_0xd186('0x3a')],{'$or':_[_0xd186('0x27')](_0x24cf30,function(_0x3aac84){if(_0x3aac84[_0xd186('0x2a')]!=='VIRTUAL'){var _0x1e677b={};_0x1e677b[_0x3aac84[_0xd186('0x24')]]={'$like':'%'+_0x5f47ed['query'][_0xd186('0x39')]+'%'};return _0x1e677b;}})});}_0x110509=_[_0xd186('0x3b')]({},_0x110509,_0x5f47ed[_0xd186('0x3c')]);var _0x319bd5={'where':_0x110509['where']};return db[_0xd186('0x3d')]['count'](_0x319bd5)[_0xd186('0x21')](function(_0x2a1544){_0x3d3827[_0xd186('0x1b')]=_0x2a1544;if(_0x5f47ed['query']['includeAll']){_0x110509[_0xd186('0x3e')]=[{'all':!![]}];}return db[_0xd186('0x3d')]['findAll'](_0x110509);})['then'](function(_0x447cb5){_0x3d3827[_0xd186('0x3f')]=_0x447cb5;return _0x3d3827;})['then'](respondWithFilteredResult(_0x5a40b8,_0x110509))[_0xd186('0x40')](handleError(_0x5a40b8,null));};exports[_0xd186('0x41')]=function(_0x104c10,_0x13895f){var _0x4a0be7={'raw':!![],'where':{'id':_0x104c10['params']['id']}},_0x3a7bec={};_0x3a7bec[_0xd186('0x2c')]=_['keys'](db[_0xd186('0x3d')][_0xd186('0x28')]);_0x3a7bec[_0xd186('0x2d')]=_['keys'](_0x104c10[_0xd186('0x2d')]);_0x3a7bec[_0xd186('0x2f')]=_['intersection'](_0x3a7bec[_0xd186('0x2c')],_0x3a7bec[_0xd186('0x2d')]);_0x4a0be7['attributes']=_['intersection'](_0x3a7bec[_0xd186('0x2c')],qs['fields'](_0x104c10[_0xd186('0x2d')]['fields']));_0x4a0be7['attributes']=_0x4a0be7[_0xd186('0x31')][_0xd186('0x33')]?_0x4a0be7['attributes']:_0x3a7bec[_0xd186('0x2c')];if(_0x104c10[_0xd186('0x2d')]['includeAll']){_0x4a0be7['include']=[{'all':!![]}];}_0x4a0be7=_[_0xd186('0x3b')]({},_0x4a0be7,_0x104c10[_0xd186('0x3c')]);return db[_0xd186('0x3d')][_0xd186('0x42')](_0x4a0be7)[_0xd186('0x21')](handleEntityNotFound(_0x13895f,null))[_0xd186('0x21')](respondWithResult(_0x13895f,null))[_0xd186('0x40')](handleError(_0x13895f,null));};exports['update']=function(_0x606558,_0x5b08cc){if(_0x606558[_0xd186('0x43')]['id']){delete _0x606558[_0xd186('0x43')]['id'];}return db[_0xd186('0x3d')][_0xd186('0x42')]({'where':{'id':_0x606558[_0xd186('0x44')]['id']}})[_0xd186('0x21')](handleEntityNotFound(_0x5b08cc,null))['then'](saveUpdates(_0x606558[_0xd186('0x43')],null))[_0xd186('0x21')](respondWithResult(_0x5b08cc,null))[_0xd186('0x40')](handleError(_0x5b08cc,null));};exports[_0xd186('0x45')]=function(_0x1ef2ad,_0x56369c){return db['CmHopperBlack'][_0xd186('0x42')]({'where':{'id':_0x1ef2ad[_0xd186('0x44')]['id']}})['then'](handleEntityNotFound(_0x56369c,null))[_0xd186('0x21')](removeEntity(_0x56369c,null))[_0xd186('0x40')](handleError(_0x56369c,null));};exports['describe']=function(_0x141e87,_0x4a39e4){return db[_0xd186('0x3d')]['describe']()[_0xd186('0x21')](respondWithResult(_0x4a39e4,null))[_0xd186('0x40')](handleError(_0x4a39e4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index a61f2d9..74d50e0 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.model.js +++ b/server/api/cmHopperBlack/cmHopperBlack.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ae=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','lodash','util','../../config/logger','api','moment'];(function(_0x5560c0,_0x1d3c42){var _0x14d32c=function(_0x42d303){while(--_0x42d303){_0x5560c0['push'](_0x5560c0['shift']());}};_0x14d32c(++_0x1d3c42);}(_0x55ae,0xff));var _0xe55a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55ae[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe55a('0x0'));var util=require(_0xe55a('0x1'));var logger=require(_0xe55a('0x2'))(_0xe55a('0x3'));var moment=require(_0xe55a('0x4'));var BPromise=require(_0xe55a('0x5'));var rp=require(_0xe55a('0x6'));var fs=require('fs');var path=require(_0xe55a('0x7'));var rimraf=require(_0xe55a('0x8'));var config=require(_0xe55a('0x9'));var attributes=require(_0xe55a('0xa'));module['exports']=function(_0x2e1459,_0x49ad5d){return _0x2e1459[_0xe55a('0xb')](_0xe55a('0xc'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37ab=['api','rimraf','../../config/environment','CmHopperBlack','cm_hopper_black','lodash','util'];(function(_0x1db527,_0x233e94){var _0x68739d=function(_0x206ff4){while(--_0x206ff4){_0x1db527['push'](_0x1db527['shift']());}};_0x68739d(++_0x233e94);}(_0x37ab,0x1a9));var _0xb37a=function(_0x439790,_0x2f4e02){_0x439790=_0x439790-0x0;var _0x1275ab=_0x37ab[_0x439790];return _0x1275ab;};'use strict';var _=require(_0xb37a('0x0'));var util=require(_0xb37a('0x1'));var logger=require('../../config/logger')(_0xb37a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb37a('0x3'));var config=require(_0xb37a('0x4'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x6eb25a,_0x8e8280){return _0x6eb25a['define'](_0xb37a('0x5'),attributes,{'tableName':_0xb37a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index b2ea4c8..ca4b93c 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js +++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf696=['map','include','debug','stringify','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','model'];(function(_0x1a5a22,_0x3a55d3){var _0x1f660e=function(_0x300090){while(--_0x300090){_0x1a5a22['push'](_0x1a5a22['shift']());}};_0x1f660e(++_0x3a55d3);}(_0xf696,0x170));var _0x6f69=function(_0x40056f,_0x42affd){_0x40056f=_0x40056f-0x0;var _0x3c6fbb=_0xf696[_0x40056f];return _0x3c6fbb;};'use strict';var _=require(_0x6f69('0x0'));var util=require(_0x6f69('0x1'));var moment=require('moment');var BPromise=require(_0x6f69('0x2'));var rs=require(_0x6f69('0x3'));var fs=require('fs');var Redis=require(_0x6f69('0x4'));var db=require(_0x6f69('0x5'))['db'];var utils=require(_0x6f69('0x6'));var logger=require(_0x6f69('0x7'))(_0x6f69('0x8'));var config=require(_0x6f69('0x9'));var jayson=require(_0x6f69('0xa'));var client=jayson[_0x6f69('0xb')][_0x6f69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28ee1d,_0x4e2d41,_0x1cf404){return new BPromise(function(_0x3cf400,_0x3e0627){return client[_0x6f69('0xd')](_0x28ee1d,_0x1cf404)[_0x6f69('0xe')](function(_0x4fb881){logger[_0x6f69('0xf')](_0x6f69('0x10'),_0x4e2d41,_0x6f69('0x11'));logger['debug'](_0x6f69('0x12'),_0x4e2d41,'request\x20sent',JSON['stringify'](_0x4fb881));if(_0x4fb881['error']){if(_0x4fb881[_0x6f69('0x13')]['code']===0x1f4){logger[_0x6f69('0x13')](_0x6f69('0x10'),_0x4e2d41,_0x4fb881[_0x6f69('0x13')]['message']);return _0x3e0627(_0x4fb881[_0x6f69('0x13')][_0x6f69('0x14')]);}logger[_0x6f69('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x4e2d41,_0x4fb881[_0x6f69('0x13')][_0x6f69('0x14')]);return _0x3cf400(_0x4fb881[_0x6f69('0x13')]['message']);}else{logger[_0x6f69('0xf')](_0x6f69('0x10'),_0x4e2d41,_0x6f69('0x11'));_0x3cf400(_0x4fb881[_0x6f69('0x15')][_0x6f69('0x14')]);}})[_0x6f69('0x16')](function(_0x25f775){logger[_0x6f69('0x13')](_0x6f69('0x10'),_0x4e2d41,_0x25f775);_0x3e0627(_0x25f775);});});}exports[_0x6f69('0x17')]=function(_0x29c3a4){var _0x2ca8bd=this;return new Promise(function(_0x181577,_0x445f10){return db[_0x6f69('0x18')][_0x6f69('0x19')]({'raw':_0x29c3a4['options']?_0x29c3a4[_0x6f69('0x1a')][_0x6f69('0x1b')]===undefined?!![]:![]:!![],'where':_0x29c3a4[_0x6f69('0x1a')]?_0x29c3a4['options'][_0x6f69('0x1c')]||null:null,'attributes':_0x29c3a4[_0x6f69('0x1a')]?_0x29c3a4[_0x6f69('0x1a')][_0x6f69('0x1d')]||null:null,'limit':_0x29c3a4[_0x6f69('0x1a')]?_0x29c3a4[_0x6f69('0x1a')][_0x6f69('0x1e')]||null:null,'include':_0x29c3a4[_0x6f69('0x1a')]?_0x29c3a4[_0x6f69('0x1a')]['include']?_['map'](_0x29c3a4['options']['include'],function(_0x5a9f96){return{'model':db[_0x5a9f96[_0x6f69('0x1f')]],'as':_0x5a9f96['as'],'attributes':_0x5a9f96[_0x6f69('0x1d')],'include':_0x5a9f96['include']?_[_0x6f69('0x20')](_0x5a9f96[_0x6f69('0x21')],function(_0x437849){return{'model':db[_0x437849[_0x6f69('0x1f')]],'as':_0x437849['as'],'attributes':_0x437849[_0x6f69('0x1d')],'include':_0x437849['include']?_[_0x6f69('0x20')](_0x437849[_0x6f69('0x21')],function(_0x316ea4){return{'model':db[_0x316ea4[_0x6f69('0x1f')]],'as':_0x316ea4['as'],'attributes':_0x316ea4[_0x6f69('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6f69('0xe')](function(_0x395c46){logger[_0x6f69('0xf')](_0x6f69('0x17'),_0x29c3a4);logger[_0x6f69('0x22')]('GetCmHopperBlack',_0x29c3a4,JSON[_0x6f69('0x23')](_0x395c46));_0x181577(_0x395c46);})[_0x6f69('0x16')](function(_0x50ddf7){logger[_0x6f69('0x13')](_0x6f69('0x17'),_0x50ddf7[_0x6f69('0x14')],_0x29c3a4);_0x445f10(_0x2ca8bd[_0x6f69('0x13')](0x1f4,_0x50ddf7[_0x6f69('0x14')]));});});};exports[_0x6f69('0x24')]=function(_0x3efd34){var _0x53d17f=this;return new Promise(function(_0x4971cf,_0x12ed1f){return db[_0x6f69('0x18')][_0x6f69('0x25')](_0x3efd34[_0x6f69('0x26')],{'raw':_0x3efd34[_0x6f69('0x1a')]?_0x3efd34[_0x6f69('0x1a')][_0x6f69('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3efd34['options']?_0x3efd34[_0x6f69('0x1a')][_0x6f69('0x1c')]||null:null,'attributes':_0x3efd34[_0x6f69('0x1a')]?_0x3efd34[_0x6f69('0x1a')]['attributes']||null:null,'limit':_0x3efd34[_0x6f69('0x1a')]?_0x3efd34[_0x6f69('0x1a')]['limit']||null:null})[_0x6f69('0xe')](function(_0x357cc5){logger[_0x6f69('0xf')]('UpdateCmHopperBlack',_0x3efd34);logger[_0x6f69('0x22')](_0x6f69('0x24'),_0x3efd34,JSON['stringify'](_0x357cc5));_0x4971cf(_0x357cc5);})[_0x6f69('0x16')](function(_0x24029c){logger['error']('UpdateCmHopperBlack',_0x24029c['message'],_0x3efd34);_0x12ed1f(_0x53d17f[_0x6f69('0x13')](0x1f4,_0x24029c[_0x6f69('0x14')]));});});};exports[_0x6f69('0x27')]=function(_0x22f44a){var _0x5bb470=this;return new Promise(function(_0x5740f3,_0x33a00e){return db[_0x6f69('0x18')]['destroy']({'where':_0x22f44a[_0x6f69('0x1a')]?_0x22f44a['options'][_0x6f69('0x1c')]||null:null})[_0x6f69('0xe')](function(_0x4f0f24){logger[_0x6f69('0xf')](_0x6f69('0x27'),_0x22f44a);logger[_0x6f69('0x22')](_0x6f69('0x27'),_0x22f44a,JSON['stringify'](_0x4f0f24));_0x5740f3(_0x4f0f24);})[_0x6f69('0x16')](function(_0x11d3d3){logger['error'](_0x6f69('0x27'),_0x11d3d3[_0x6f69('0x14')],_0x22f44a);_0x33a00e(_0x5bb470[_0x6f69('0x13')](0x1f4,_0x11d3d3[_0x6f69('0x14')]));});});}; \ No newline at end of file +var _0x78b9=['model','map','then','UpdateCmHopperBlack','update','body','stringify','destroy','DestroyCmHopperBlack','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include'];(function(_0x516b79,_0x3e55e2){var _0x4998ad=function(_0x33f019){while(--_0x33f019){_0x516b79['push'](_0x516b79['shift']());}};_0x4998ad(++_0x3e55e2);}(_0x78b9,0x82));var _0x978b=function(_0x2d494b,_0xe9dcf7){_0x2d494b=_0x2d494b-0x0;var _0xa2f244=_0x78b9[_0x2d494b];return _0xa2f244;};'use strict';var _=require(_0x978b('0x0'));var util=require(_0x978b('0x1'));var moment=require(_0x978b('0x2'));var BPromise=require(_0x978b('0x3'));var rs=require(_0x978b('0x4'));var fs=require('fs');var Redis=require(_0x978b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x978b('0x6'));var logger=require(_0x978b('0x7'))('rpc');var config=require(_0x978b('0x8'));var jayson=require(_0x978b('0x9'));var client=jayson['client'][_0x978b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x675bbe,_0x1192c8,_0x37c8ca){return new BPromise(function(_0x40e662,_0x4a9da0){return client[_0x978b('0xb')](_0x675bbe,_0x37c8ca)['then'](function(_0x287e67){logger[_0x978b('0xc')](_0x978b('0xd'),_0x1192c8,_0x978b('0xe'));logger['debug'](_0x978b('0xf'),_0x1192c8,'request\x20sent',JSON['stringify'](_0x287e67));if(_0x287e67[_0x978b('0x10')]){if(_0x287e67[_0x978b('0x10')][_0x978b('0x11')]===0x1f4){logger[_0x978b('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x1192c8,_0x287e67[_0x978b('0x10')][_0x978b('0x12')]);return _0x4a9da0(_0x287e67[_0x978b('0x10')][_0x978b('0x12')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x1192c8,_0x287e67[_0x978b('0x10')]['message']);return _0x40e662(_0x287e67[_0x978b('0x10')][_0x978b('0x12')]);}else{logger['info'](_0x978b('0xd'),_0x1192c8,'request\x20sent');_0x40e662(_0x287e67[_0x978b('0x13')][_0x978b('0x12')]);}})[_0x978b('0x14')](function(_0x524ab7){logger[_0x978b('0x10')](_0x978b('0xd'),_0x1192c8,_0x524ab7);_0x4a9da0(_0x524ab7);});});}exports[_0x978b('0x15')]=function(_0x28a2ab){var _0x52b9cd=this;return new Promise(function(_0x386cfc,_0x49c0e2){return db[_0x978b('0x16')][_0x978b('0x17')]({'raw':_0x28a2ab[_0x978b('0x18')]?_0x28a2ab['options'][_0x978b('0x19')]===undefined?!![]:![]:!![],'where':_0x28a2ab[_0x978b('0x18')]?_0x28a2ab[_0x978b('0x18')][_0x978b('0x1a')]||null:null,'attributes':_0x28a2ab['options']?_0x28a2ab[_0x978b('0x18')][_0x978b('0x1b')]||null:null,'limit':_0x28a2ab[_0x978b('0x18')]?_0x28a2ab['options'][_0x978b('0x1c')]||null:null,'include':_0x28a2ab[_0x978b('0x18')]?_0x28a2ab['options'][_0x978b('0x1d')]?_['map'](_0x28a2ab[_0x978b('0x18')][_0x978b('0x1d')],function(_0x36d67d){return{'model':db[_0x36d67d[_0x978b('0x1e')]],'as':_0x36d67d['as'],'attributes':_0x36d67d[_0x978b('0x1b')],'include':_0x36d67d[_0x978b('0x1d')]?_[_0x978b('0x1f')](_0x36d67d[_0x978b('0x1d')],function(_0x1d5409){return{'model':db[_0x1d5409[_0x978b('0x1e')]],'as':_0x1d5409['as'],'attributes':_0x1d5409[_0x978b('0x1b')],'include':_0x1d5409['include']?_[_0x978b('0x1f')](_0x1d5409[_0x978b('0x1d')],function(_0x4f3409){return{'model':db[_0x4f3409[_0x978b('0x1e')]],'as':_0x4f3409['as'],'attributes':_0x4f3409[_0x978b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x978b('0x20')](function(_0x22442a){logger[_0x978b('0xc')](_0x978b('0x15'),_0x28a2ab);logger['debug']('GetCmHopperBlack',_0x28a2ab,JSON['stringify'](_0x22442a));_0x386cfc(_0x22442a);})[_0x978b('0x14')](function(_0x18c2f1){logger[_0x978b('0x10')](_0x978b('0x15'),_0x18c2f1[_0x978b('0x12')],_0x28a2ab);_0x49c0e2(_0x52b9cd[_0x978b('0x10')](0x1f4,_0x18c2f1[_0x978b('0x12')]));});});};exports[_0x978b('0x21')]=function(_0x2266b8){var _0x2ba9c3=this;return new Promise(function(_0x2b0d2c,_0x31fe37){return db[_0x978b('0x16')][_0x978b('0x22')](_0x2266b8[_0x978b('0x23')],{'raw':_0x2266b8[_0x978b('0x18')]?_0x2266b8[_0x978b('0x18')][_0x978b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2266b8[_0x978b('0x18')]?_0x2266b8[_0x978b('0x18')][_0x978b('0x1a')]||null:null,'attributes':_0x2266b8[_0x978b('0x18')]?_0x2266b8['options']['attributes']||null:null,'limit':_0x2266b8['options']?_0x2266b8['options'][_0x978b('0x1c')]||null:null})[_0x978b('0x20')](function(_0x5b04d4){logger['info']('UpdateCmHopperBlack',_0x2266b8);logger['debug'](_0x978b('0x21'),_0x2266b8,JSON[_0x978b('0x24')](_0x5b04d4));_0x2b0d2c(_0x5b04d4);})[_0x978b('0x14')](function(_0x4014b2){logger['error'](_0x978b('0x21'),_0x4014b2['message'],_0x2266b8);_0x31fe37(_0x2ba9c3[_0x978b('0x10')](0x1f4,_0x4014b2[_0x978b('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x4a32f1){var _0xc934de=this;return new Promise(function(_0x273dc7,_0x54af8b){return db[_0x978b('0x16')][_0x978b('0x25')]({'where':_0x4a32f1['options']?_0x4a32f1[_0x978b('0x18')][_0x978b('0x1a')]||null:null})['then'](function(_0x5254e2){logger[_0x978b('0xc')](_0x978b('0x26'),_0x4a32f1);logger[_0x978b('0x27')]('DestroyCmHopperBlack',_0x4a32f1,JSON[_0x978b('0x24')](_0x5254e2));_0x273dc7(_0x5254e2);})[_0x978b('0x14')](function(_0x28bca5){logger['error']('DestroyCmHopperBlack',_0x28bca5[_0x978b('0x12')],_0x4a32f1);_0x54af8b(_0xc934de[_0x978b('0x10')](0x1f4,_0x28bca5[_0x978b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b794021..189d3e3 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81bd=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','show','put','/:id'];(function(_0x4971ca,_0x2ae39a){var _0x10c18e=function(_0x469242){while(--_0x469242){_0x4971ca['push'](_0x4971ca['shift']());}};_0x10c18e(++_0x2ae39a);}(_0x81bd,0x7c));var _0xd81b=function(_0x5f4585,_0x287c9f){_0x5f4585=_0x5f4585-0x0;var _0x32b347=_0x81bd[_0x5f4585];return _0x32b347;};'use strict';var multer=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var timeout=require(_0xd81b('0x3'));var express=require(_0xd81b('0x4'));var router=express[_0xd81b('0x5')]();var auth=require(_0xd81b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd81b('0x7'));var controller=require(_0xd81b('0x8'));router[_0xd81b('0x9')]('/',auth['isAuthenticated'](),controller[_0xd81b('0xa')]);router[_0xd81b('0x9')](_0xd81b('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xd81b('0x9')]('/:id',auth[_0xd81b('0xc')](),controller[_0xd81b('0xd')]);router[_0xd81b('0xe')](_0xd81b('0xf'),auth[_0xd81b('0xc')](),controller[_0xd81b('0x10')]);router[_0xd81b('0x11')](_0xd81b('0xf'),auth[_0xd81b('0xc')](),controller[_0xd81b('0x12')]);module[_0xd81b('0x13')]=router; \ No newline at end of file +var _0x34e8=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x575e6d,_0x1e19ac){var _0x5d4dfd=function(_0x553717){while(--_0x553717){_0x575e6d['push'](_0x575e6d['shift']());}};_0x5d4dfd(++_0x1e19ac);}(_0x34e8,0x12c));var _0x834e=function(_0x541c9d,_0x367771){_0x541c9d=_0x541c9d-0x0;var _0x12b915=_0x34e8[_0x541c9d];return _0x12b915;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x10')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);module[_0x834e('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 134f723..d9cd70c 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js +++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ee8=['getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x3ee8,0x188));var _0x83ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ee8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x83ee('0x0')]={'state':{'type':Sequelize[_0x83ee('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x83ee('0x2')]},'scheduledat':{'type':Sequelize[_0x83ee('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x83ee('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x83ee('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x83ee('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x83ee('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x83ee('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x83ee('0x2')]},'calleridname':{'type':Sequelize[_0x83ee('0x2')]},'starttime':{'type':Sequelize[_0x83ee('0x3')]},'responsetime':{'type':Sequelize[_0x83ee('0x3')]},'answertime':{'type':Sequelize[_0x83ee('0x3')]},'droptime':{'type':Sequelize[_0x83ee('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x83ee('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x83ee('0x2')]},'campaign':{'type':Sequelize[_0x83ee('0x2')]},'campaigntype':{'type':Sequelize[_0x83ee('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x83ee('0x2')]},'disposition':{'type':Sequelize[_0x83ee('0x2')]},'dispositionat':{'type':Sequelize[_0x83ee('0x3')],'set':function(_0x2b5891){var _0x50f862=this[_0x83ee('0x4')](_0x83ee('0x5'));if(_0x50f862&&_0x2b5891){this[_0x83ee('0x6')](_0x83ee('0x7'),moment(_0x2b5891)[_0x83ee('0x8')](moment(_0x50f862),_0x83ee('0x9')));}return this[_0x83ee('0x6')](_0x83ee('0xa'),_0x2b5891);}},'amd':{'type':Sequelize[_0x83ee('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x83ee('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x83ee('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x83ee('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x83ee('0x3')]},'callback':{'type':Sequelize[_0x83ee('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x83ee('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x83ee('0x3')]},'recallme':{'type':Sequelize[_0x83ee('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x83ee('0x3')]}}; \ No newline at end of file +var _0xda2d=['exports','STRING','INTEGER','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','moment'];(function(_0x2f3570,_0x174587){var _0x1d8de2=function(_0x261b98){while(--_0x261b98){_0x2f3570['push'](_0x2f3570['shift']());}};_0x1d8de2(++_0x174587);}(_0xda2d,0xb3));var _0xdda2=function(_0x54d5a2,_0x5814c1){_0x54d5a2=_0x54d5a2-0x0;var _0x4dda86=_0xda2d[_0x54d5a2];return _0x4dda86;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdda2('0x0'));module[_0xdda2('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xdda2('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdda2('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xdda2('0x2')]},'originatecalleridname':{'type':Sequelize[_0xdda2('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdda2('0x2')]},'starttime':{'type':Sequelize[_0xdda2('0x4')]},'responsetime':{'type':Sequelize[_0xdda2('0x4')]},'answertime':{'type':Sequelize[_0xdda2('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdda2('0x2')]},'campaign':{'type':Sequelize[_0xdda2('0x2')]},'campaigntype':{'type':Sequelize[_0xdda2('0x2')]},'membername':{'type':Sequelize[_0xdda2('0x2')]},'reason':{'type':Sequelize[_0xdda2('0x2')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xdda2('0x4')],'set':function(_0x3925de){var _0x5c7d85=this[_0xdda2('0x5')](_0xdda2('0x6'));if(_0x5c7d85&&_0x3925de){this[_0xdda2('0x7')](_0xdda2('0x8'),moment(_0x3925de)[_0xdda2('0x9')](moment(_0x5c7d85),_0xdda2('0xa')));}return this[_0xdda2('0x7')]('dispositionat',_0x3925de);}},'amd':{'type':Sequelize[_0xdda2('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdda2('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xdda2('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xdda2('0x4')]},'callback':{'type':Sequelize[_0xdda2('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdda2('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdda2('0x4')]},'deleted':{'type':Sequelize[_0xdda2('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xdda2('0x4')]},'recallme':{'type':Sequelize[_0xdda2('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index f3c6fc4..2db5ccb 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc5d=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','describe','body','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','CmHopper','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x37c7ae,_0x580034){var _0x499040=function(_0x2a6bf8){while(--_0x2a6bf8){_0x37c7ae['push'](_0x37c7ae['shift']());}};_0x499040(++_0x580034);}(_0xfc5d,0x13c));var _0xdfc5=function(_0x23b7dc,_0x5c59a3){_0x23b7dc=_0x23b7dc-0x0;var _0x227063=_0xfc5d[_0x23b7dc];return _0x227063;};'use strict';var pdf=require(_0xdfc5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdfc5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfc5('0x2'));var rp=require('request-promise');var moment=require(_0xdfc5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdfc5('0x4'));var util=require(_0xdfc5('0x5'));var path=require(_0xdfc5('0x6'));var sox=require('sox');var csv=require(_0xdfc5('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdfc5('0x8'));var toCsv=require(_0xdfc5('0x7'));var querystring=require(_0xdfc5('0x9'));var Papa=require('papaparse');var Redis=require(_0xdfc5('0xa'));var authService=require(_0xdfc5('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xdfc5('0xc'));var hardwareService=require(_0xdfc5('0xd'));var logger=require(_0xdfc5('0xe'))('api');var utils=require(_0xdfc5('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x178f3a,_0x3b1566){_0x3b1566=_0x3b1566||0xcc;return function(_0x4e96b9){if(_0x4e96b9){return _0x178f3a['sendStatus'](_0x3b1566);}return _0x178f3a[_0xdfc5('0x10')](_0x3b1566)[_0xdfc5('0x11')]();};}function respondWithResult(_0x4ccb1d,_0x481ad8){_0x481ad8=_0x481ad8||0xc8;return function(_0x50ba4c){if(_0x50ba4c){return _0x4ccb1d[_0xdfc5('0x10')](_0x481ad8)[_0xdfc5('0x12')](_0x50ba4c);}};}function respondWithFilteredResult(_0x259577,_0x33c86f){return function(_0x249dbc){if(_0x249dbc){var _0x20f68e=_0x249dbc[_0xdfc5('0x13')],_0xd9b41d=_0x33c86f[_0xdfc5('0x14')],_0xd7e8a8=_0x33c86f[_0xdfc5('0x14')]+_0x33c86f[_0xdfc5('0x15')],_0x458280;if(_0xd7e8a8>=_0x20f68e){_0xd7e8a8=_0x20f68e;_0x458280=0xc8;}else{_0x458280=0xce;}_0x259577[_0xdfc5('0x10')](_0x458280);return _0x259577[_0xdfc5('0x16')](_0xdfc5('0x17'),_0xd9b41d+'-'+_0xd7e8a8+'/'+_0x20f68e)['json'](_0x249dbc);}return null;};}function patchUpdates(_0x40563b){return function(_0x34c21b){try{jsonpatch[_0xdfc5('0x18')](_0x34c21b,_0x40563b,!![]);}catch(_0x5d8d3f){return BPromise[_0xdfc5('0x19')](_0x5d8d3f);}return _0x34c21b[_0xdfc5('0x1a')]();};}function saveUpdates(_0x5ee422,_0x267327){return function(_0x281209){if(_0x281209){return _0x281209[_0xdfc5('0x1b')](_0x5ee422)['then'](function(_0x4538ed){return _0x4538ed;});}return null;};}function removeEntity(_0x54011e,_0x5b5f37){return function(_0x2eb6c1){if(_0x2eb6c1){return _0x2eb6c1[_0xdfc5('0x1c')]()[_0xdfc5('0x1d')](function(){_0x54011e[_0xdfc5('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0xabeeb4,_0xcf83fa){return function(_0x257fb3){if(!_0x257fb3){_0xabeeb4[_0xdfc5('0x1e')](0x194);}return _0x257fb3;};}function handleError(_0x115bef,_0x35e934){_0x35e934=_0x35e934||0x1f4;return function(_0x10a778){logger['error'](_0x10a778[_0xdfc5('0x1f')]);if(_0x10a778['name']){delete _0x10a778[_0xdfc5('0x20')];}_0x115bef[_0xdfc5('0x10')](_0x35e934)[_0xdfc5('0x21')](_0x10a778);};}exports[_0xdfc5('0x22')]=function(_0x5ab60a,_0x5ac852){var _0x1df8e7={},_0x4f18e0={},_0x4c0d18={'count':0x0,'rows':[]};var _0x57fb4e=_[_0xdfc5('0x23')](db[_0xdfc5('0x24')][_0xdfc5('0x25')],function(_0x4423d4){return{'name':_0x4423d4[_0xdfc5('0x26')],'type':_0x4423d4[_0xdfc5('0x27')][_0xdfc5('0x28')]};});_0x4f18e0[_0xdfc5('0x29')]=_['map'](_0x57fb4e,_0xdfc5('0x20'));_0x4f18e0[_0xdfc5('0x2a')]=_['keys'](_0x5ab60a[_0xdfc5('0x2a')]);_0x4f18e0[_0xdfc5('0x2b')]=_[_0xdfc5('0x2c')](_0x4f18e0[_0xdfc5('0x29')],_0x4f18e0[_0xdfc5('0x2a')]);_0x1df8e7[_0xdfc5('0x2d')]=_[_0xdfc5('0x2c')](_0x4f18e0[_0xdfc5('0x29')],qs[_0xdfc5('0x2e')](_0x5ab60a['query'][_0xdfc5('0x2e')]));_0x1df8e7[_0xdfc5('0x2d')]=_0x1df8e7[_0xdfc5('0x2d')]['length']?_0x1df8e7[_0xdfc5('0x2d')]:_0x4f18e0[_0xdfc5('0x29')];if(!_0x5ab60a[_0xdfc5('0x2a')]['hasOwnProperty']('nolimit')){_0x1df8e7[_0xdfc5('0x15')]=qs[_0xdfc5('0x15')](_0x5ab60a[_0xdfc5('0x2a')]['limit']);_0x1df8e7[_0xdfc5('0x14')]=qs[_0xdfc5('0x14')](_0x5ab60a[_0xdfc5('0x2a')]['offset']);}_0x1df8e7[_0xdfc5('0x2f')]=qs[_0xdfc5('0x30')](_0x5ab60a[_0xdfc5('0x2a')][_0xdfc5('0x30')]);_0x1df8e7[_0xdfc5('0x31')]=qs['filters'](_[_0xdfc5('0x32')](_0x5ab60a[_0xdfc5('0x2a')],_0x4f18e0[_0xdfc5('0x2b')]));if(_0x5ab60a[_0xdfc5('0x2a')][_0xdfc5('0x33')]){_0x1df8e7[_0xdfc5('0x31')]=_[_0xdfc5('0x34')](_0x1df8e7[_0xdfc5('0x31')],{'$or':_[_0xdfc5('0x23')](_0x57fb4e,function(_0x8eb3d8){if(_0x8eb3d8['type']!==_0xdfc5('0x35')){var _0xa1f0ef={};_0xa1f0ef[_0x8eb3d8[_0xdfc5('0x20')]]={'$like':'%'+_0x5ab60a[_0xdfc5('0x2a')][_0xdfc5('0x33')]+'%'};return _0xa1f0ef;}})});}_0x1df8e7=_[_0xdfc5('0x34')]({},_0x1df8e7,_0x5ab60a[_0xdfc5('0x36')]);var _0x5c1bea={'where':_0x1df8e7[_0xdfc5('0x31')]};return db[_0xdfc5('0x24')][_0xdfc5('0x13')](_0x5c1bea)[_0xdfc5('0x1d')](function(_0x46b74c){_0x4c0d18[_0xdfc5('0x13')]=_0x46b74c;if(_0x5ab60a[_0xdfc5('0x2a')][_0xdfc5('0x37')]){_0x1df8e7[_0xdfc5('0x38')]=[{'all':!![]}];}return db[_0xdfc5('0x24')]['findAll'](_0x1df8e7);})[_0xdfc5('0x1d')](function(_0x121986){_0x4c0d18[_0xdfc5('0x39')]=_0x121986;return _0x4c0d18;})[_0xdfc5('0x1d')](respondWithFilteredResult(_0x5ac852,_0x1df8e7))[_0xdfc5('0x3a')](handleError(_0x5ac852,null));};exports[_0xdfc5('0x3b')]=function(_0x239c7c,_0x1a522e){var _0x3f43da={'raw':!![],'where':{'id':_0x239c7c[_0xdfc5('0x3c')]['id']}},_0x42811a={};_0x42811a[_0xdfc5('0x29')]=_['keys'](db['CmHopperFinal'][_0xdfc5('0x25')]);_0x42811a[_0xdfc5('0x2a')]=_['keys'](_0x239c7c[_0xdfc5('0x2a')]);_0x42811a[_0xdfc5('0x2b')]=_[_0xdfc5('0x2c')](_0x42811a[_0xdfc5('0x29')],_0x42811a[_0xdfc5('0x2a')]);_0x3f43da['attributes']=_[_0xdfc5('0x2c')](_0x42811a[_0xdfc5('0x29')],qs[_0xdfc5('0x2e')](_0x239c7c[_0xdfc5('0x2a')][_0xdfc5('0x2e')]));_0x3f43da[_0xdfc5('0x2d')]=_0x3f43da[_0xdfc5('0x2d')][_0xdfc5('0x3d')]?_0x3f43da[_0xdfc5('0x2d')]:_0x42811a[_0xdfc5('0x29')];if(_0x239c7c[_0xdfc5('0x2a')][_0xdfc5('0x37')]){_0x3f43da[_0xdfc5('0x38')]=[{'all':!![]}];}_0x3f43da=_['merge']({},_0x3f43da,_0x239c7c[_0xdfc5('0x36')]);return db[_0xdfc5('0x24')][_0xdfc5('0x3e')](_0x3f43da)[_0xdfc5('0x1d')](handleEntityNotFound(_0x1a522e,null))['then'](respondWithResult(_0x1a522e,null))[_0xdfc5('0x3a')](handleError(_0x1a522e,null));};exports[_0xdfc5('0x3f')]=function(_0x39ca44,_0x3a3d71){return db[_0xdfc5('0x24')][_0xdfc5('0x3f')]()['then'](respondWithResult(_0x3a3d71,null))['catch'](handleError(_0x3a3d71,null));};exports[_0xdfc5('0x1b')]=function(_0x2ba897,_0x56b37d){if(_0x2ba897[_0xdfc5('0x40')]['uniqueid']){delete _0x2ba897['body']['uniqueid'];}return db[_0xdfc5('0x24')][_0xdfc5('0x3e')]({'where':{'uniqueid':_0x2ba897[_0xdfc5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x56b37d,null))[_0xdfc5('0x1d')](saveUpdates(_0x2ba897[_0xdfc5('0x40')],null))['then'](respondWithResult(_0x56b37d,null))['catch'](handleError(_0x56b37d,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xf81c47,_0x290db4,_0x18dc86){return db[_0xdfc5('0x24')][_0xdfc5('0x41')]({'raw':![],'where':{'VoiceQueueId':_0xf81c47[_0xdfc5('0x3c')]['id']},'attributes':[[db[_0xdfc5('0x42')]['fn'](_0xdfc5('0x43'),db[_0xdfc5('0x42')]['fn']('IF',db['sequelize'][_0xdfc5('0x44')](_0xdfc5('0x45')))),_0xdfc5('0x46')],[db[_0xdfc5('0x42')]['fn'](_0xdfc5('0x43'),db['sequelize']['fn']('IF',db[_0xdfc5('0x42')][_0xdfc5('0x44')](_0xdfc5('0x47')))),_0xdfc5('0x48')],[db[_0xdfc5('0x42')]['fn'](_0xdfc5('0x43'),db[_0xdfc5('0x42')]['fn']('IF',db['sequelize'][_0xdfc5('0x44')](_0xdfc5('0x49')))),_0xdfc5('0x4a')],[db[_0xdfc5('0x42')]['fn'](_0xdfc5('0x43'),db[_0xdfc5('0x42')]['fn']('IF',db[_0xdfc5('0x42')]['literal'](_0xdfc5('0x4b')))),'congestionContacts'],[db[_0xdfc5('0x42')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfc5('0x42')][_0xdfc5('0x44')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xdfc5('0x4c')],[db[_0xdfc5('0x42')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xdfc5('0x44')](_0xdfc5('0x4d')))),_0xdfc5('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xdfc5('0x42')]['fn']('IF',db[_0xdfc5('0x42')][_0xdfc5('0x44')]('`state`\x20=\x2022,\x201,\x20null'))),_0xdfc5('0x4f')],[db[_0xdfc5('0x42')]['fn'](_0xdfc5('0x43'),db[_0xdfc5('0x42')]['fn']('IF',db[_0xdfc5('0x42')][_0xdfc5('0x44')](_0xdfc5('0x50')))),_0xdfc5('0x51')]]})['then'](handleEntityNotFound(_0x290db4,null))[_0xdfc5('0x1d')](respondWithResult(_0x290db4,null))[_0xdfc5('0x3a')](handleError(_0x290db4,null));};exports[_0xdfc5('0x52')]=function(_0x3f6786,_0x38cfc2,_0x18b55b){return db[_0xdfc5('0x24')]['findAll']({'raw':![],'where':{'CampaignId':_0x3f6786[_0xdfc5('0x3c')]['id']},'attributes':[[db[_0xdfc5('0x42')]['fn']('COUNT',db[_0xdfc5('0x42')]['fn']('IF',db[_0xdfc5('0x42')][_0xdfc5('0x44')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xdfc5('0x42')]['fn']('COUNT',db[_0xdfc5('0x42')]['fn']('IF',db[_0xdfc5('0x42')]['literal'](_0xdfc5('0x47')))),_0xdfc5('0x48')],[db['sequelize']['fn'](_0xdfc5('0x43'),db[_0xdfc5('0x42')]['fn']('IF',db['sequelize'][_0xdfc5('0x44')](_0xdfc5('0x49')))),_0xdfc5('0x4a')],[db[_0xdfc5('0x42')]['fn']('COUNT',db[_0xdfc5('0x42')]['fn']('IF',db[_0xdfc5('0x42')][_0xdfc5('0x44')](_0xdfc5('0x4b')))),_0xdfc5('0x53')],[db[_0xdfc5('0x42')]['fn']('COUNT',db[_0xdfc5('0x42')]['fn']('IF',db['sequelize'][_0xdfc5('0x44')](_0xdfc5('0x54')))),_0xdfc5('0x4c')],[db[_0xdfc5('0x42')]['fn'](_0xdfc5('0x43'),db[_0xdfc5('0x42')]['fn']('IF',db[_0xdfc5('0x42')][_0xdfc5('0x44')](_0xdfc5('0x4d')))),_0xdfc5('0x4e')],[db[_0xdfc5('0x42')]['fn'](_0xdfc5('0x43'),db[_0xdfc5('0x42')]['fn']('IF',db['sequelize'][_0xdfc5('0x44')]('`state`\x20=\x2022,\x201,\x20null'))),_0xdfc5('0x4f')],[db[_0xdfc5('0x42')]['fn'](_0xdfc5('0x43'),db['sequelize']['fn']('IF',db[_0xdfc5('0x42')][_0xdfc5('0x44')](_0xdfc5('0x50')))),_0xdfc5('0x51')]]})[_0xdfc5('0x1d')](handleEntityNotFound(_0x38cfc2,null))[_0xdfc5('0x1d')](respondWithResult(_0x38cfc2,null))[_0xdfc5('0x3a')](handleError(_0x38cfc2,null));};exports[_0xdfc5('0x55')]=function(_0x38d1b3,_0x1fead7,_0x4fd983){return db['VoiceQueue']['find']({'where':{'id':_0x38d1b3[_0xdfc5('0x3c')]['id']}})[_0xdfc5('0x1d')](handleEntityNotFound(_0x1fead7,null))['then'](function(_0x21cf7b){var _0x401fea;if(_0x21cf7b){_0x401fea=squel[_0xdfc5('0x56')]()[_0xdfc5('0x57')](_0xdfc5('0x58'))[_0xdfc5('0x59')]([_0xdfc5('0x5a'),_0xdfc5('0x5b'),_0xdfc5('0x5c'),_0xdfc5('0x5d'),_0xdfc5('0x5e'),_0xdfc5('0x5f'),_0xdfc5('0x60')],squel[_0xdfc5('0x61')]()[_0xdfc5('0x62')]('ANY_VALUE(calleridnum)',_0xdfc5('0x5a'))[_0xdfc5('0x62')](_0xdfc5('0x63'),_0xdfc5('0x5b'))[_0xdfc5('0x62')]('ANY_VALUE(ContactId)',_0xdfc5('0x5c'))['field'](_0xdfc5('0x64'),_0xdfc5('0x5d'))[_0xdfc5('0x62')](_0xdfc5('0x65'),'VoiceQueueId')[_0xdfc5('0x62')](_0xdfc5('0x63'),_0xdfc5('0x5f'))[_0xdfc5('0x62')](_0xdfc5('0x63'),_0xdfc5('0x60'))[_0xdfc5('0x66')](_0xdfc5('0x67'))[_0xdfc5('0x31')](_0xdfc5('0x68'),_0x38d1b3['params']['id'][_0xdfc5('0x69')]())[_0xdfc5('0x31')]('state\x20=\x20?',_0x38d1b3[_0xdfc5('0x40')][_0xdfc5('0x6a')][_0xdfc5('0x69')]())[_0xdfc5('0x31')](_0xdfc5('0x6b'))[_0xdfc5('0x31')](_0xdfc5('0x6c'),squel['select']()[_0xdfc5('0x62')]('phone')['from']('cm_hopper')['where'](_0xdfc5('0x68'),_0x38d1b3['params']['id'][_0xdfc5('0x69')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xdfc5('0x62')](_0xdfc5('0x6d'))[_0xdfc5('0x66')](_0xdfc5('0x67'))['where'](_0xdfc5('0x68'),_0x38d1b3[_0xdfc5('0x3c')]['id'][_0xdfc5('0x69')]())[_0xdfc5('0x31')](_0xdfc5('0x6e')))[_0xdfc5('0x6f')]('ContactId'))[_0xdfc5('0x69')]();return db[_0xdfc5('0x42')][_0xdfc5('0x2a')](_0x401fea);}return[];})[_0xdfc5('0x1d')](respondWithResult(_0x1fead7,null))['catch'](handleError(_0x1fead7,null));};exports[_0xdfc5('0x70')]=function(_0x5adc59,_0x30c110,_0x194e4d){return db[_0xdfc5('0x71')][_0xdfc5('0x3e')]({'where':{'id':_0x5adc59[_0xdfc5('0x3c')]['id']}})[_0xdfc5('0x1d')](handleEntityNotFound(_0x30c110,null))[_0xdfc5('0x1d')](function(_0x3a4b0d){var _0x5137bc;if(_0x3a4b0d){_0x5137bc=squel[_0xdfc5('0x56')]()[_0xdfc5('0x57')](_0xdfc5('0x58'))[_0xdfc5('0x59')]([_0xdfc5('0x5a'),_0xdfc5('0x5b'),'ContactId','ListId',_0xdfc5('0x72'),_0xdfc5('0x5f'),_0xdfc5('0x60')],squel[_0xdfc5('0x61')]()[_0xdfc5('0x62')](_0xdfc5('0x73'),'phone')['field'](_0xdfc5('0x63'),_0xdfc5('0x5b'))[_0xdfc5('0x62')](_0xdfc5('0x74'),'ContactId')[_0xdfc5('0x62')](_0xdfc5('0x64'),_0xdfc5('0x5d'))[_0xdfc5('0x62')](_0xdfc5('0x75'),_0xdfc5('0x72'))[_0xdfc5('0x62')](_0xdfc5('0x63'),_0xdfc5('0x5f'))['field']('NOW()',_0xdfc5('0x60'))['from'](_0xdfc5('0x67'))[_0xdfc5('0x31')](_0xdfc5('0x76'),_0x5adc59[_0xdfc5('0x3c')]['id'][_0xdfc5('0x69')]())['where'](_0xdfc5('0x77'),_0x5adc59[_0xdfc5('0x40')][_0xdfc5('0x6a')][_0xdfc5('0x69')]())['where'](_0xdfc5('0x6b'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xdfc5('0x62')]('phone')[_0xdfc5('0x66')](_0xdfc5('0x58'))[_0xdfc5('0x31')](_0xdfc5('0x76'),_0x5adc59[_0xdfc5('0x3c')]['id'][_0xdfc5('0x69')]()))['where'](_0xdfc5('0x6c'),squel[_0xdfc5('0x61')]()['field'](_0xdfc5('0x6d'))['from']('cm_hopper_final')[_0xdfc5('0x31')](_0xdfc5('0x76'),_0x5adc59['params']['id']['toString']())['where'](_0xdfc5('0x6e')))['group'](_0xdfc5('0x5c')))[_0xdfc5('0x69')]();return db['sequelize'][_0xdfc5('0x2a')](_0x5137bc);}return[];})[_0xdfc5('0x1d')](respondWithResult(_0x30c110,null))['catch'](handleError(_0x30c110,null));};exports['checkContactHopper']=function(_0x5382c4,_0x1ad5c1,_0x352a40){return db[_0xdfc5('0x78')]['findOne']({'where':{'VoiceQueueId':_0x5382c4['body']['VoiceQueueId'],'CampaignId':_0x5382c4[_0xdfc5('0x40')][_0xdfc5('0x72')],'ContactId':_0x5382c4[_0xdfc5('0x40')][_0xdfc5('0x5c')]}})[_0xdfc5('0x1d')](handleEntityNotFound(_0x1ad5c1,null))['then'](function(_0x361f42){if(_0x361f42){return _0x361f42;}return null;})[_0xdfc5('0x1d')](respondWithResult(_0x1ad5c1,null))['catch'](handleError(_0x1ad5c1,null));}; \ No newline at end of file +var _0xa24e=['api','../../config/utils','end','status','json','count','offset','limit','Content-Range','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','type','merge','options','CmHopperFinal','includeAll','include','findAll','catch','params','length','describe','body','uniqueid','find','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','answeringMachine','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','fast-json-patch','moment','mustache','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0xa24e,0x14b));var _0xea24=function(_0x50837b,_0x413961){_0x50837b=_0x50837b-0x0;var _0x2b1257=_0xa24e[_0x50837b];return _0x2b1257;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea24('0x0'));var rp=require('request-promise');var moment=require(_0xea24('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xea24('0x2'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xea24('0x3'));var ejs=require(_0xea24('0x4'));var fs=require('fs');var _=require(_0xea24('0x5'));var squel=require('squel');var crypto=require(_0xea24('0x6'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea24('0x7'));var Papa=require(_0xea24('0x8'));var Redis=require(_0xea24('0x9'));var authService=require(_0xea24('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0xea24('0xb'));var hardwareService=require(_0xea24('0xc'));var logger=require(_0xea24('0xd'))(_0xea24('0xe'));var utils=require(_0xea24('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39be83,_0x3a30e3){_0x3a30e3=_0x3a30e3||0xcc;return function(_0x1e648d){if(_0x1e648d){return _0x39be83['sendStatus'](_0x3a30e3);}return _0x39be83['status'](_0x3a30e3)[_0xea24('0x10')]();};}function respondWithResult(_0x132f68,_0x579728){_0x579728=_0x579728||0xc8;return function(_0x26e2b5){if(_0x26e2b5){return _0x132f68[_0xea24('0x11')](_0x579728)[_0xea24('0x12')](_0x26e2b5);}};}function respondWithFilteredResult(_0x4af949,_0x55fbb7){return function(_0x1035c6){if(_0x1035c6){var _0x196c73=_0x1035c6[_0xea24('0x13')],_0x205da3=_0x55fbb7['offset'],_0x36e203=_0x55fbb7[_0xea24('0x14')]+_0x55fbb7[_0xea24('0x15')],_0x38007d;if(_0x36e203>=_0x196c73){_0x36e203=_0x196c73;_0x38007d=0xc8;}else{_0x38007d=0xce;}_0x4af949[_0xea24('0x11')](_0x38007d);return _0x4af949['set'](_0xea24('0x16'),_0x205da3+'-'+_0x36e203+'/'+_0x196c73)[_0xea24('0x12')](_0x1035c6);}return null;};}function patchUpdates(_0x3db58a){return function(_0x4a9057){try{jsonpatch['apply'](_0x4a9057,_0x3db58a,!![]);}catch(_0x12ba7b){return BPromise['reject'](_0x12ba7b);}return _0x4a9057['save']();};}function saveUpdates(_0xe9b1f9,_0x2e2041){return function(_0x24e747){if(_0x24e747){return _0x24e747[_0xea24('0x17')](_0xe9b1f9)['then'](function(_0x386415){return _0x386415;});}return null;};}function removeEntity(_0x4e3c1f,_0x79b870){return function(_0xbce9ef){if(_0xbce9ef){return _0xbce9ef[_0xea24('0x18')]()[_0xea24('0x19')](function(){_0x4e3c1f[_0xea24('0x11')](0xcc)[_0xea24('0x10')]();});}};}function handleEntityNotFound(_0x10e50c,_0x84b88f){return function(_0x295d36){if(!_0x295d36){_0x10e50c[_0xea24('0x1a')](0x194);}return _0x295d36;};}function handleError(_0xfa7c08,_0x36a9cc){_0x36a9cc=_0x36a9cc||0x1f4;return function(_0x4a92b0){logger['error'](_0x4a92b0[_0xea24('0x1b')]);if(_0x4a92b0[_0xea24('0x1c')]){delete _0x4a92b0[_0xea24('0x1c')];}_0xfa7c08[_0xea24('0x11')](_0x36a9cc)[_0xea24('0x1d')](_0x4a92b0);};}exports[_0xea24('0x1e')]=function(_0x3a5a27,_0x5bbd14){var _0x5610e5={},_0x1add78={},_0x567862={'count':0x0,'rows':[]};var _0x39d00a=_[_0xea24('0x1f')](db['CmHopperFinal'][_0xea24('0x20')],function(_0x2da794){return{'name':_0x2da794[_0xea24('0x21')],'type':_0x2da794['type']['key']};});_0x1add78[_0xea24('0x22')]=_[_0xea24('0x1f')](_0x39d00a,_0xea24('0x1c'));_0x1add78[_0xea24('0x23')]=_[_0xea24('0x24')](_0x3a5a27[_0xea24('0x23')]);_0x1add78[_0xea24('0x25')]=_['intersection'](_0x1add78[_0xea24('0x22')],_0x1add78['query']);_0x5610e5[_0xea24('0x26')]=_[_0xea24('0x27')](_0x1add78[_0xea24('0x22')],qs[_0xea24('0x28')](_0x3a5a27[_0xea24('0x23')]['fields']));_0x5610e5[_0xea24('0x26')]=_0x5610e5[_0xea24('0x26')]['length']?_0x5610e5[_0xea24('0x26')]:_0x1add78['model'];if(!_0x3a5a27[_0xea24('0x23')]['hasOwnProperty'](_0xea24('0x29'))){_0x5610e5[_0xea24('0x15')]=qs[_0xea24('0x15')](_0x3a5a27['query'][_0xea24('0x15')]);_0x5610e5['offset']=qs[_0xea24('0x14')](_0x3a5a27[_0xea24('0x23')][_0xea24('0x14')]);}_0x5610e5['order']=qs[_0xea24('0x2a')](_0x3a5a27['query'][_0xea24('0x2a')]);_0x5610e5[_0xea24('0x2b')]=qs[_0xea24('0x25')](_[_0xea24('0x2c')](_0x3a5a27[_0xea24('0x23')],_0x1add78['filters']));if(_0x3a5a27[_0xea24('0x23')][_0xea24('0x2d')]){_0x5610e5[_0xea24('0x2b')]=_['merge'](_0x5610e5[_0xea24('0x2b')],{'$or':_[_0xea24('0x1f')](_0x39d00a,function(_0x58297b){if(_0x58297b[_0xea24('0x2e')]!=='VIRTUAL'){var _0x31dab5={};_0x31dab5[_0x58297b[_0xea24('0x1c')]]={'$like':'%'+_0x3a5a27[_0xea24('0x23')][_0xea24('0x2d')]+'%'};return _0x31dab5;}})});}_0x5610e5=_[_0xea24('0x2f')]({},_0x5610e5,_0x3a5a27[_0xea24('0x30')]);var _0x3efc16={'where':_0x5610e5['where']};return db[_0xea24('0x31')]['count'](_0x3efc16)[_0xea24('0x19')](function(_0xc970e5){_0x567862[_0xea24('0x13')]=_0xc970e5;if(_0x3a5a27[_0xea24('0x23')][_0xea24('0x32')]){_0x5610e5[_0xea24('0x33')]=[{'all':!![]}];}return db[_0xea24('0x31')][_0xea24('0x34')](_0x5610e5);})[_0xea24('0x19')](function(_0xbd09e8){_0x567862['rows']=_0xbd09e8;return _0x567862;})['then'](respondWithFilteredResult(_0x5bbd14,_0x5610e5))[_0xea24('0x35')](handleError(_0x5bbd14,null));};exports['show']=function(_0x5772d1,_0xf1fb79){var _0x2825c1={'raw':!![],'where':{'id':_0x5772d1[_0xea24('0x36')]['id']}},_0x1fdf8a={};_0x1fdf8a[_0xea24('0x22')]=_[_0xea24('0x24')](db['CmHopperFinal'][_0xea24('0x20')]);_0x1fdf8a[_0xea24('0x23')]=_[_0xea24('0x24')](_0x5772d1[_0xea24('0x23')]);_0x1fdf8a[_0xea24('0x25')]=_[_0xea24('0x27')](_0x1fdf8a[_0xea24('0x22')],_0x1fdf8a[_0xea24('0x23')]);_0x2825c1[_0xea24('0x26')]=_[_0xea24('0x27')](_0x1fdf8a[_0xea24('0x22')],qs['fields'](_0x5772d1[_0xea24('0x23')][_0xea24('0x28')]));_0x2825c1['attributes']=_0x2825c1[_0xea24('0x26')][_0xea24('0x37')]?_0x2825c1[_0xea24('0x26')]:_0x1fdf8a['model'];if(_0x5772d1[_0xea24('0x23')][_0xea24('0x32')]){_0x2825c1[_0xea24('0x33')]=[{'all':!![]}];}_0x2825c1=_[_0xea24('0x2f')]({},_0x2825c1,_0x5772d1[_0xea24('0x30')]);return db[_0xea24('0x31')]['find'](_0x2825c1)[_0xea24('0x19')](handleEntityNotFound(_0xf1fb79,null))[_0xea24('0x19')](respondWithResult(_0xf1fb79,null))[_0xea24('0x35')](handleError(_0xf1fb79,null));};exports[_0xea24('0x38')]=function(_0x1cfcd1,_0x22017b){return db['CmHopperFinal'][_0xea24('0x38')]()[_0xea24('0x19')](respondWithResult(_0x22017b,null))['catch'](handleError(_0x22017b,null));};exports[_0xea24('0x17')]=function(_0x571c0a,_0x40b694){if(_0x571c0a[_0xea24('0x39')][_0xea24('0x3a')]){delete _0x571c0a['body'][_0xea24('0x3a')];}return db['CmHopperFinal'][_0xea24('0x3b')]({'where':{'uniqueid':_0x571c0a[_0xea24('0x36')]['id']}})['then'](handleEntityNotFound(_0x40b694,null))[_0xea24('0x19')](saveUpdates(_0x571c0a[_0xea24('0x39')],null))[_0xea24('0x19')](respondWithResult(_0x40b694,null))[_0xea24('0x35')](handleError(_0x40b694,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4580fb,_0x2ae3e1,_0x4a121a){return db[_0xea24('0x31')][_0xea24('0x34')]({'raw':![],'where':{'VoiceQueueId':_0x4580fb[_0xea24('0x36')]['id']},'attributes':[[db[_0xea24('0x3c')]['fn'](_0xea24('0x3d'),db[_0xea24('0x3c')]['fn']('IF',db['sequelize'][_0xea24('0x3e')](_0xea24('0x3f')))),_0xea24('0x40')],[db[_0xea24('0x3c')]['fn'](_0xea24('0x3d'),db[_0xea24('0x3c')]['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')](_0xea24('0x41')))),'noAnswerContacts'],[db[_0xea24('0x3c')]['fn'](_0xea24('0x3d'),db[_0xea24('0x3c')]['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')]('`state`\x20=\x205,\x201,\x20null'))),_0xea24('0x42')],[db[_0xea24('0x3c')]['fn'](_0xea24('0x3d'),db['sequelize']['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')](_0xea24('0x43')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xea24('0x3c')]['fn']('IF',db['sequelize'][_0xea24('0x3e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xea24('0x44')],[db['sequelize']['fn'](_0xea24('0x3d'),db[_0xea24('0x3c')]['fn']('IF',db[_0xea24('0x3c')]['literal'](_0xea24('0x45')))),'abandonedContacts'],[db['sequelize']['fn'](_0xea24('0x3d'),db[_0xea24('0x3c')]['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')](_0xea24('0x46')))),_0xea24('0x47')],[db[_0xea24('0x3c')]['fn'](_0xea24('0x3d'),db['sequelize']['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')](_0xea24('0x48')))),'answeringMachine']]})[_0xea24('0x19')](handleEntityNotFound(_0x2ae3e1,null))[_0xea24('0x19')](respondWithResult(_0x2ae3e1,null))['catch'](handleError(_0x2ae3e1,null));};exports[_0xea24('0x49')]=function(_0x2de4b1,_0x41da80,_0x125dd8){return db['CmHopperFinal'][_0xea24('0x34')]({'raw':![],'where':{'CampaignId':_0x2de4b1[_0xea24('0x36')]['id']},'attributes':[[db[_0xea24('0x3c')]['fn'](_0xea24('0x3d'),db['sequelize']['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')]('`state`\x20=\x200,\x201,\x20null'))),_0xea24('0x40')],[db[_0xea24('0x3c')]['fn'](_0xea24('0x3d'),db['sequelize']['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')]('`state`\x20=\x203,\x201,\x20null'))),_0xea24('0x4a')],[db[_0xea24('0x3c')]['fn'](_0xea24('0x3d'),db[_0xea24('0x3c')]['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')](_0xea24('0x4b')))),_0xea24('0x42')],[db['sequelize']['fn'](_0xea24('0x3d'),db['sequelize']['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')](_0xea24('0x43')))),_0xea24('0x4c')],[db['sequelize']['fn'](_0xea24('0x3d'),db[_0xea24('0x3c')]['fn']('IF',db['sequelize'][_0xea24('0x3e')](_0xea24('0x4d')))),_0xea24('0x44')],[db['sequelize']['fn'](_0xea24('0x3d'),db[_0xea24('0x3c')]['fn']('IF',db['sequelize'][_0xea24('0x3e')](_0xea24('0x45')))),_0xea24('0x4e')],[db[_0xea24('0x3c')]['fn']('COUNT',db[_0xea24('0x3c')]['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')](_0xea24('0x46')))),_0xea24('0x47')],[db[_0xea24('0x3c')]['fn']('COUNT',db[_0xea24('0x3c')]['fn']('IF',db[_0xea24('0x3c')][_0xea24('0x3e')](_0xea24('0x48')))),_0xea24('0x4f')]]})[_0xea24('0x19')](handleEntityNotFound(_0x41da80,null))[_0xea24('0x19')](respondWithResult(_0x41da80,null))[_0xea24('0x35')](handleError(_0x41da80,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x1bdf8e,_0x13a316,_0x413230){return db['VoiceQueue'][_0xea24('0x3b')]({'where':{'id':_0x1bdf8e[_0xea24('0x36')]['id']}})['then'](handleEntityNotFound(_0x13a316,null))[_0xea24('0x19')](function(_0x22d46b){var _0x3b5ef6;if(_0x22d46b){_0x3b5ef6=squel['insert']()['into'](_0xea24('0x50'))[_0xea24('0x51')](['phone',_0xea24('0x52'),_0xea24('0x53'),_0xea24('0x54'),_0xea24('0x55'),_0xea24('0x56'),_0xea24('0x57')],squel['select']()[_0xea24('0x58')](_0xea24('0x59'),_0xea24('0x5a'))[_0xea24('0x58')](_0xea24('0x5b'),_0xea24('0x52'))[_0xea24('0x58')]('ANY_VALUE(ContactId)',_0xea24('0x53'))['field'](_0xea24('0x5c'),_0xea24('0x54'))[_0xea24('0x58')](_0xea24('0x5d'),'VoiceQueueId')[_0xea24('0x58')](_0xea24('0x5b'),_0xea24('0x56'))['field'](_0xea24('0x5b'),_0xea24('0x57'))[_0xea24('0x5e')](_0xea24('0x5f'))[_0xea24('0x2b')](_0xea24('0x60'),_0x1bdf8e[_0xea24('0x36')]['id']['toString']())['where'](_0xea24('0x61'),_0x1bdf8e[_0xea24('0x39')]['state'][_0xea24('0x62')]())[_0xea24('0x2b')](_0xea24('0x63'))[_0xea24('0x2b')](_0xea24('0x64'),squel[_0xea24('0x65')]()['field']('phone')[_0xea24('0x5e')](_0xea24('0x50'))[_0xea24('0x2b')](_0xea24('0x60'),_0x1bdf8e[_0xea24('0x36')]['id'][_0xea24('0x62')]()))[_0xea24('0x2b')](_0xea24('0x64'),squel[_0xea24('0x65')]()[_0xea24('0x58')](_0xea24('0x66'))[_0xea24('0x5e')]('cm_hopper_final')[_0xea24('0x2b')](_0xea24('0x60'),_0x1bdf8e[_0xea24('0x36')]['id']['toString']())[_0xea24('0x2b')](_0xea24('0x67')))['group'](_0xea24('0x53')))[_0xea24('0x62')]();return db['sequelize'][_0xea24('0x23')](_0x3b5ef6);}return[];})[_0xea24('0x19')](respondWithResult(_0x13a316,null))['catch'](handleError(_0x13a316,null));};exports[_0xea24('0x68')]=function(_0x4c5445,_0x2176da,_0x4a2a83){return db[_0xea24('0x69')][_0xea24('0x3b')]({'where':{'id':_0x4c5445['params']['id']}})[_0xea24('0x19')](handleEntityNotFound(_0x2176da,null))[_0xea24('0x19')](function(_0x12108f){var _0x8a52db;if(_0x12108f){_0x8a52db=squel['insert']()[_0xea24('0x6a')]('cm_hopper')[_0xea24('0x51')]([_0xea24('0x5a'),'scheduledAt',_0xea24('0x53'),'ListId','CampaignId','createdAt',_0xea24('0x57')],squel[_0xea24('0x65')]()['field'](_0xea24('0x59'),_0xea24('0x5a'))['field']('NOW()',_0xea24('0x52'))[_0xea24('0x58')](_0xea24('0x6b'),_0xea24('0x53'))[_0xea24('0x58')](_0xea24('0x5c'),_0xea24('0x54'))[_0xea24('0x58')](_0xea24('0x6c'),_0xea24('0x6d'))[_0xea24('0x58')](_0xea24('0x5b'),'createdAt')[_0xea24('0x58')](_0xea24('0x5b'),'updatedAt')[_0xea24('0x5e')](_0xea24('0x5f'))['where'](_0xea24('0x6e'),_0x4c5445['params']['id'][_0xea24('0x62')]())[_0xea24('0x2b')](_0xea24('0x61'),_0x4c5445[_0xea24('0x39')]['state']['toString']())[_0xea24('0x2b')](_0xea24('0x63'))[_0xea24('0x2b')](_0xea24('0x64'),squel[_0xea24('0x65')]()[_0xea24('0x58')](_0xea24('0x5a'))[_0xea24('0x5e')](_0xea24('0x50'))[_0xea24('0x2b')](_0xea24('0x6e'),_0x4c5445[_0xea24('0x36')]['id'][_0xea24('0x62')]()))[_0xea24('0x2b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xea24('0x65')]()[_0xea24('0x58')]('calleridnum')[_0xea24('0x5e')](_0xea24('0x5f'))[_0xea24('0x2b')](_0xea24('0x6e'),_0x4c5445['params']['id'][_0xea24('0x62')]())[_0xea24('0x2b')](_0xea24('0x67')))[_0xea24('0x6f')]('ContactId'))[_0xea24('0x62')]();return db[_0xea24('0x3c')]['query'](_0x8a52db);}return[];})['then'](respondWithResult(_0x2176da,null))['catch'](handleError(_0x2176da,null));};exports[_0xea24('0x70')]=function(_0x4556d6,_0x374c6b,_0x46d550){return db[_0xea24('0x71')][_0xea24('0x72')]({'where':{'VoiceQueueId':_0x4556d6[_0xea24('0x39')]['VoiceQueueId'],'CampaignId':_0x4556d6[_0xea24('0x39')][_0xea24('0x6d')],'ContactId':_0x4556d6[_0xea24('0x39')][_0xea24('0x53')]}})['then'](handleEntityNotFound(_0x374c6b,null))[_0xea24('0x19')](function(_0x1a82a1){if(_0x1a82a1){return _0x1a82a1;}return null;})[_0xea24('0x19')](respondWithResult(_0x374c6b,null))[_0xea24('0x35')](handleError(_0x374c6b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index fe2650e..2f3cdb7 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.model.js +++ b/server/api/cmHopperFinal/cmHopperFinal.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1961=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0x1961,0x1e0));var _0x1196=function(_0x389b66,_0x3db21f){_0x389b66=_0x389b66-0x0;var _0x5b2265=_0x1961[_0x389b66];return _0x5b2265;};'use strict';var _=require(_0x1196('0x0'));var util=require(_0x1196('0x1'));var logger=require(_0x1196('0x2'))(_0x1196('0x3'));var moment=require(_0x1196('0x4'));var BPromise=require(_0x1196('0x5'));var rp=require(_0x1196('0x6'));var fs=require('fs');var path=require(_0x1196('0x7'));var rimraf=require('rimraf');var config=require(_0x1196('0x8'));var attributes=require(_0x1196('0x9'));module[_0x1196('0xa')]=function(_0x2bcdf9,_0x3dab06){return _0x2bcdf9['define'](_0x1196('0xb'),attributes,{'tableName':_0x1196('0xc'),'paranoid':![],'indexes':[{'name':_0x1196('0xd'),'fields':[_0x1196('0xd')]},{'name':_0x1196('0xe'),'fields':[_0x1196('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e1e=['cm_hopper_final','calleridnum','uniqueid','../../config/logger','api','rimraf','../../config/environment','exports','define'];(function(_0x11cd30,_0x100450){var _0x425ae7=function(_0xe84730){while(--_0xe84730){_0x11cd30['push'](_0x11cd30['shift']());}};_0x425ae7(++_0x100450);}(_0x7e1e,0x17d));var _0xe7e1=function(_0x38b7fb,_0x52b9de){_0x38b7fb=_0x38b7fb-0x0;var _0x40e529=_0x7e1e[_0x38b7fb];return _0x40e529;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7e1('0x0'))(_0xe7e1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe7e1('0x2'));var config=require(_0xe7e1('0x3'));var attributes=require('./cmHopperFinal.attributes');module[_0xe7e1('0x4')]=function(_0x2e6a90,_0x35b0e1){return _0x2e6a90[_0xe7e1('0x5')]('CmHopperFinal',attributes,{'tableName':_0xe7e1('0x6'),'paranoid':![],'indexes':[{'name':_0xe7e1('0x7'),'fields':[_0xe7e1('0x7')]},{'name':_0xe7e1('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index dc19a67..ca3c1bb 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6171=['result','catch','CreateCmHopperFinal','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','CmHopperFinal,\x20%s,\x20%s'];(function(_0x311fd4,_0x2fc056){var _0x2a7835=function(_0x4945e7){while(--_0x4945e7){_0x311fd4['push'](_0x311fd4['shift']());}};_0x2a7835(++_0x2fc056);}(_0x6171,0x10e));var _0x1617=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x6171[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0x1617('0x0'));var util=require(_0x1617('0x1'));var moment=require('moment');var BPromise=require(_0x1617('0x2'));var rs=require(_0x1617('0x3'));var fs=require('fs');var Redis=require(_0x1617('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1617('0x5'));var logger=require(_0x1617('0x6'))('rpc');var config=require(_0x1617('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1617('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x225191,_0x11dcd4,_0x3b5d71){return new BPromise(function(_0x21bae4,_0x330b6c){return client[_0x1617('0x9')](_0x225191,_0x3b5d71)['then'](function(_0x37b9fd){logger[_0x1617('0xa')]('CmHopperFinal,\x20%s,\x20%s',_0x11dcd4,_0x1617('0xb'));logger[_0x1617('0xc')](_0x1617('0xd'),_0x11dcd4,_0x1617('0xb'),JSON[_0x1617('0xe')](_0x37b9fd));if(_0x37b9fd['error']){if(_0x37b9fd[_0x1617('0xf')]['code']===0x1f4){logger[_0x1617('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x11dcd4,_0x37b9fd['error'][_0x1617('0x10')]);return _0x330b6c(_0x37b9fd[_0x1617('0xf')][_0x1617('0x10')]);}logger[_0x1617('0xf')](_0x1617('0x11'),_0x11dcd4,_0x37b9fd[_0x1617('0xf')][_0x1617('0x10')]);return _0x21bae4(_0x37b9fd[_0x1617('0xf')][_0x1617('0x10')]);}else{logger['info']('CmHopperFinal,\x20%s,\x20%s',_0x11dcd4,_0x1617('0xb'));_0x21bae4(_0x37b9fd[_0x1617('0x12')][_0x1617('0x10')]);}})[_0x1617('0x13')](function(_0x5e9372){logger[_0x1617('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x11dcd4,_0x5e9372);_0x330b6c(_0x5e9372);});});}exports[_0x1617('0x14')]=function(_0x18a434){var _0x2c8d7f=this;return new Promise(function(_0x4ee6c2,_0x365603){return db['CmHopperFinal']['create'](_0x18a434[_0x1617('0x15')],{'raw':_0x18a434[_0x1617('0x16')]?_0x18a434['options'][_0x1617('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xca224a){logger[_0x1617('0xa')](_0x1617('0x14'),_0x18a434);logger['debug'](_0x1617('0x14'),_0x18a434,JSON['stringify'](_0xca224a));_0x4ee6c2(_0xca224a);})[_0x1617('0x13')](function(_0x5584a8){logger[_0x1617('0xf')](_0x1617('0x14'),_0x5584a8[_0x1617('0x10')],_0x18a434);_0x365603(_0x2c8d7f[_0x1617('0xf')](0x1f4,_0x5584a8[_0x1617('0x10')]));});});}; \ No newline at end of file +var _0xf413=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','debug','CreateCmHopperFinal'];(function(_0x34b5dd,_0x273ee4){var _0x21ab2e=function(_0x2ab3dd){while(--_0x2ab3dd){_0x34b5dd['push'](_0x34b5dd['shift']());}};_0x21ab2e(++_0x273ee4);}(_0xf413,0xd9));var _0x3f41=function(_0x4342b0,_0x144df9){_0x4342b0=_0x4342b0-0x0;var _0x19fbdd=_0xf413[_0x4342b0];return _0x19fbdd;};'use strict';var _=require(_0x3f41('0x0'));var util=require(_0x3f41('0x1'));var moment=require(_0x3f41('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f41('0x3'));var fs=require('fs');var Redis=require(_0x3f41('0x4'));var db=require(_0x3f41('0x5'))['db'];var utils=require(_0x3f41('0x6'));var logger=require(_0x3f41('0x7'))('rpc');var config=require(_0x3f41('0x8'));var jayson=require(_0x3f41('0x9'));var client=jayson[_0x3f41('0xa')][_0x3f41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35dd6a,_0x44b964,_0x58fa45){return new BPromise(function(_0x1723bd,_0x381db6){return client[_0x3f41('0xc')](_0x35dd6a,_0x58fa45)[_0x3f41('0xd')](function(_0x554c30){logger['info'](_0x3f41('0xe'),_0x44b964,'request\x20sent');logger['debug'](_0x3f41('0xf'),_0x44b964,'request\x20sent',JSON[_0x3f41('0x10')](_0x554c30));if(_0x554c30['error']){if(_0x554c30['error'][_0x3f41('0x11')]===0x1f4){logger[_0x3f41('0x12')](_0x3f41('0xe'),_0x44b964,_0x554c30[_0x3f41('0x12')][_0x3f41('0x13')]);return _0x381db6(_0x554c30[_0x3f41('0x12')]['message']);}logger[_0x3f41('0x12')](_0x3f41('0xe'),_0x44b964,_0x554c30[_0x3f41('0x12')]['message']);return _0x1723bd(_0x554c30[_0x3f41('0x12')][_0x3f41('0x13')]);}else{logger[_0x3f41('0x14')](_0x3f41('0xe'),_0x44b964,_0x3f41('0x15'));_0x1723bd(_0x554c30[_0x3f41('0x16')][_0x3f41('0x13')]);}})[_0x3f41('0x17')](function(_0x47fb20){logger[_0x3f41('0x12')]('CmHopperFinal,\x20%s,\x20%s',_0x44b964,_0x47fb20);_0x381db6(_0x47fb20);});});}exports['CreateCmHopperFinal']=function(_0x415631){var _0x335676=this;return new Promise(function(_0x56bc07,_0x38ed05){return db[_0x3f41('0x18')][_0x3f41('0x19')](_0x415631[_0x3f41('0x1a')],{'raw':_0x415631[_0x3f41('0x1b')]?_0x415631[_0x3f41('0x1b')][_0x3f41('0x1c')]===undefined?!![]:![]:!![]})[_0x3f41('0xd')](function(_0xf2866e){logger['info']('CreateCmHopperFinal',_0x415631);logger[_0x3f41('0x1d')](_0x3f41('0x1e'),_0x415631,JSON['stringify'](_0xf2866e));_0x56bc07(_0xf2866e);})[_0x3f41('0x17')](function(_0x5ef75a){logger['error'](_0x3f41('0x1e'),_0x5ef75a[_0x3f41('0x13')],_0x415631);_0x38ed05(_0x335676[_0x3f41('0x12')](0x1f4,_0x5ef75a['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 0813006..f459e0f 100644 --- a/server/api/cmHopperFinal/index.js +++ b/server/api/cmHopperFinal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb010=['moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal'];(function(_0x63f7dd,_0x52cf76){var _0x492e36=function(_0x19885d){while(--_0x19885d){_0x63f7dd['push'](_0x63f7dd['shift']());}};_0x492e36(++_0x52cf76);}(_0xb010,0x92));var _0x0b01=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb010[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x0b01('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0b01('0x1'));var express=require(_0x0b01('0x2'));var router=express[_0x0b01('0x3')]();var auth=require(_0x0b01('0x4'));var interaction=require(_0x0b01('0x5'));var config=require(_0x0b01('0x6'));var controller=require(_0x0b01('0x7'));router[_0x0b01('0x8')]('/',auth[_0x0b01('0x9')](),controller['index']);router['get']('/describe',auth[_0x0b01('0x9')](),controller[_0x0b01('0xa')]);router[_0x0b01('0x8')](_0x0b01('0xb'),auth[_0x0b01('0x9')](),controller[_0x0b01('0xc')]);router[_0x0b01('0x8')]('/voice/queue/countAttributes/:id',auth[_0x0b01('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x0b01('0x8')](_0x0b01('0xd'),auth[_0x0b01('0x9')](),controller[_0x0b01('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x0b01('0x9')](),controller[_0x0b01('0xf')]);router[_0x0b01('0x10')](_0x0b01('0x11'),auth[_0x0b01('0x9')](),controller[_0x0b01('0x12')]);router[_0x0b01('0x10')](_0x0b01('0x13'),auth['isAuthenticated'](),controller[_0x0b01('0x14')]);router[_0x0b01('0x15')](_0x0b01('0xb'),auth[_0x0b01('0x9')](),controller[_0x0b01('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8a8a=['get','isAuthenticated','/describe','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller'];(function(_0x155200,_0x228087){var _0x354c3a=function(_0xb986be){while(--_0xb986be){_0x155200['push'](_0x155200['shift']());}};_0x354c3a(++_0x228087);}(_0x8a8a,0x1c4));var _0xa8a8=function(_0x1aee95,_0x57b0fa){_0x1aee95=_0x1aee95-0x0;var _0x586bcf=_0x8a8a[_0x1aee95];return _0x586bcf;};'use strict';var multer=require('multer');var util=require(_0xa8a8('0x0'));var path=require(_0xa8a8('0x1'));var timeout=require(_0xa8a8('0x2'));var express=require('express');var router=express[_0xa8a8('0x3')]();var auth=require(_0xa8a8('0x4'));var interaction=require(_0xa8a8('0x5'));var config=require(_0xa8a8('0x6'));var controller=require(_0xa8a8('0x7'));router[_0xa8a8('0x8')]('/',auth[_0xa8a8('0x9')](),controller['index']);router[_0xa8a8('0x8')](_0xa8a8('0xa'),auth[_0xa8a8('0x9')](),controller[_0xa8a8('0xb')]);router[_0xa8a8('0x8')](_0xa8a8('0xc'),auth[_0xa8a8('0x9')](),controller['show']);router[_0xa8a8('0x8')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0xa8a8('0xd')]);router[_0xa8a8('0x8')](_0xa8a8('0xe'),auth[_0xa8a8('0x9')](),controller[_0xa8a8('0xf')]);router[_0xa8a8('0x10')](_0xa8a8('0x11'),auth[_0xa8a8('0x9')](),controller[_0xa8a8('0x12')]);router[_0xa8a8('0x10')]('/voice/campaign/moveContacts/:id',auth[_0xa8a8('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0xa8a8('0x13'),auth[_0xa8a8('0x9')](),controller[_0xa8a8('0x14')]);router['put'](_0xa8a8('0xc'),auth[_0xa8a8('0x9')](),controller[_0xa8a8('0x15')]);module[_0xa8a8('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 1695ea1..575ba5e 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js +++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d40=['INTEGER','DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x4e6e8c,_0x422ee4){var _0x2bb286=function(_0x2d8a6c){while(--_0x2d8a6c){_0x4e6e8c['push'](_0x4e6e8c['shift']());}};_0x2bb286(++_0x422ee4);}(_0x7d40,0xf9));var _0x07d4=function(_0x10bae6,_0x41d85f){_0x10bae6=_0x10bae6-0x0;var _0x251123=_0x7d40[_0x10bae6];return _0x251123;};'use strict';var Sequelize=require(_0x07d4('0x0'));module[_0x07d4('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x07d4('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x07d4('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x07d4('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x07d4('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x07d4('0x4')]},'answertime':{'type':Sequelize[_0x07d4('0x4')]},'droptime':{'type':Sequelize[_0x07d4('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x07d4('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x07d4('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x07d4('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x07d4('0x2')]},'campaigntype':{'type':Sequelize[_0x07d4('0x2')]},'membername':{'type':Sequelize[_0x07d4('0x2')]},'reason':{'type':Sequelize[_0x07d4('0x2')]},'amd':{'type':Sequelize[_0x07d4('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x07d4('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x07d4('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x07d4('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x07d4('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xee5c=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x35c92b,_0x36ea2c){var _0x572928=function(_0x1329ab){while(--_0x1329ab){_0x35c92b['push'](_0x35c92b['shift']());}};_0x572928(++_0x36ea2c);}(_0xee5c,0x130));var _0xcee5=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0xee5c[_0x2307fa];return _0x496486;};'use strict';var Sequelize=require(_0xcee5('0x0'));module[_0xcee5('0x1')]={'state':{'type':Sequelize[_0xcee5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xcee5('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xcee5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcee5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xcee5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xcee5('0x3')]},'calleridnum':{'type':Sequelize[_0xcee5('0x3')]},'calleridname':{'type':Sequelize[_0xcee5('0x3')]},'starttime':{'type':Sequelize[_0xcee5('0x4')]},'responsetime':{'type':Sequelize[_0xcee5('0x4')]},'answertime':{'type':Sequelize[_0xcee5('0x4')]},'droptime':{'type':Sequelize[_0xcee5('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xcee5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xcee5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xcee5('0x3')]},'campaign':{'type':Sequelize[_0xcee5('0x3')]},'campaigntype':{'type':Sequelize[_0xcee5('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xcee5('0x3')]},'amd':{'type':Sequelize[_0xcee5('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xcee5('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcee5('0x4')]},'recallme':{'type':Sequelize[_0xcee5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xcee5('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 1922aca..c9de9a4 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06cf=['update','then','sendStatus','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','uniqueid','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','jsforce','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','reject','save'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x06cf,0x18e));var _0xf06c=function(_0x71641b,_0x45e2c8){_0x71641b=_0x71641b-0x0;var _0x28fda1=_0x06cf[_0x71641b];return _0x28fda1;};'use strict';var pdf=require(_0xf06c('0x0'));var emlformat=require(_0xf06c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf06c('0x2'));var rp=require(_0xf06c('0x3'));var moment=require(_0xf06c('0x4'));var BPromise=require(_0xf06c('0x5'));var Mustache=require(_0xf06c('0x6'));var util=require(_0xf06c('0x7'));var path=require(_0xf06c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf06c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf06c('0xa'));var crypto=require('crypto');var jsforce=require(_0xf06c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf06c('0xc'));var querystring=require(_0xf06c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf06c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf06c('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xf06c('0x10'));var config=require(_0xf06c('0x11'));var db=require(_0xf06c('0x12'))['db'];function respondWithStatusCode(_0x216b63,_0x5511c7){_0x5511c7=_0x5511c7||0xcc;return function(_0x4a5bf2){if(_0x4a5bf2){return _0x216b63['sendStatus'](_0x5511c7);}return _0x216b63[_0xf06c('0x13')](_0x5511c7)[_0xf06c('0x14')]();};}function respondWithResult(_0x1535a5,_0x41a1e6){_0x41a1e6=_0x41a1e6||0xc8;return function(_0x11c0cc){if(_0x11c0cc){return _0x1535a5[_0xf06c('0x13')](_0x41a1e6)['json'](_0x11c0cc);}};}function respondWithFilteredResult(_0x19db57,_0x3719d1){return function(_0x4c18a3){if(_0x4c18a3){var _0x24a088=_0x4c18a3[_0xf06c('0x15')],_0x44e87c=_0x3719d1[_0xf06c('0x16')],_0x8a7d4e=_0x3719d1[_0xf06c('0x16')]+_0x3719d1[_0xf06c('0x17')],_0x2870ca;if(_0x8a7d4e>=_0x24a088){_0x8a7d4e=_0x24a088;_0x2870ca=0xc8;}else{_0x2870ca=0xce;}_0x19db57[_0xf06c('0x13')](_0x2870ca);return _0x19db57[_0xf06c('0x18')](_0xf06c('0x19'),_0x44e87c+'-'+_0x8a7d4e+'/'+_0x24a088)['json'](_0x4c18a3);}return null;};}function patchUpdates(_0x3b7bb5){return function(_0x3944e4){try{jsonpatch['apply'](_0x3944e4,_0x3b7bb5,!![]);}catch(_0x34b9b0){return BPromise[_0xf06c('0x1a')](_0x34b9b0);}return _0x3944e4[_0xf06c('0x1b')]();};}function saveUpdates(_0x3f60e7,_0x123709){return function(_0x3e2a81){if(_0x3e2a81){return _0x3e2a81[_0xf06c('0x1c')](_0x3f60e7)[_0xf06c('0x1d')](function(_0x3e626e){return _0x3e626e;});}return null;};}function removeEntity(_0x4aadea,_0x4e6e81){return function(_0x494e0f){if(_0x494e0f){return _0x494e0f['destroy']()[_0xf06c('0x1d')](function(){_0x4aadea[_0xf06c('0x13')](0xcc)[_0xf06c('0x14')]();});}};}function handleEntityNotFound(_0x2d5bb4,_0x165530){return function(_0x5be94f){if(!_0x5be94f){_0x2d5bb4[_0xf06c('0x1e')](0x194);}return _0x5be94f;};}function handleError(_0x432798,_0x12ab76){_0x12ab76=_0x12ab76||0x1f4;return function(_0x4f3a30){logger['error'](_0x4f3a30[_0xf06c('0x1f')]);if(_0x4f3a30[_0xf06c('0x20')]){delete _0x4f3a30[_0xf06c('0x20')];}_0x432798['status'](_0x12ab76)[_0xf06c('0x21')](_0x4f3a30);};}exports[_0xf06c('0x22')]=function(_0x15dac7,_0x81ef8f){var _0x21fed3={},_0x5812bd={},_0x26701b={'count':0x0,'rows':[]};var _0x455c1f=_['map'](db[_0xf06c('0x23')][_0xf06c('0x24')],function(_0x445a66){return{'name':_0x445a66[_0xf06c('0x25')],'type':_0x445a66[_0xf06c('0x26')][_0xf06c('0x27')]};});_0x5812bd[_0xf06c('0x28')]=_[_0xf06c('0x29')](_0x455c1f,_0xf06c('0x20'));_0x5812bd[_0xf06c('0x2a')]=_[_0xf06c('0x2b')](_0x15dac7[_0xf06c('0x2a')]);_0x5812bd[_0xf06c('0x2c')]=_[_0xf06c('0x2d')](_0x5812bd[_0xf06c('0x28')],_0x5812bd['query']);_0x21fed3[_0xf06c('0x2e')]=_[_0xf06c('0x2d')](_0x5812bd[_0xf06c('0x28')],qs[_0xf06c('0x2f')](_0x15dac7[_0xf06c('0x2a')][_0xf06c('0x2f')]));_0x21fed3['attributes']=_0x21fed3[_0xf06c('0x2e')][_0xf06c('0x30')]?_0x21fed3['attributes']:_0x5812bd[_0xf06c('0x28')];if(!_0x15dac7[_0xf06c('0x2a')][_0xf06c('0x31')](_0xf06c('0x32'))){_0x21fed3[_0xf06c('0x17')]=qs['limit'](_0x15dac7[_0xf06c('0x2a')][_0xf06c('0x17')]);_0x21fed3[_0xf06c('0x16')]=qs[_0xf06c('0x16')](_0x15dac7[_0xf06c('0x2a')][_0xf06c('0x16')]);}_0x21fed3[_0xf06c('0x33')]=qs[_0xf06c('0x34')](_0x15dac7[_0xf06c('0x2a')]['sort']);_0x21fed3['where']=qs[_0xf06c('0x2c')](_[_0xf06c('0x35')](_0x15dac7[_0xf06c('0x2a')],_0x5812bd[_0xf06c('0x2c')]));if(_0x15dac7[_0xf06c('0x2a')][_0xf06c('0x36')]){_0x21fed3['where']=_[_0xf06c('0x37')](_0x21fed3[_0xf06c('0x38')],{'$or':_['map'](_0x455c1f,function(_0x2a43d0){if(_0x2a43d0[_0xf06c('0x26')]!==_0xf06c('0x39')){var _0x15ebc5={};_0x15ebc5[_0x2a43d0[_0xf06c('0x20')]]={'$like':'%'+_0x15dac7[_0xf06c('0x2a')]['filter']+'%'};return _0x15ebc5;}})});}_0x21fed3=_[_0xf06c('0x37')]({},_0x21fed3,_0x15dac7[_0xf06c('0x3a')]);var _0x548f0d={'where':_0x21fed3[_0xf06c('0x38')]};return db[_0xf06c('0x23')][_0xf06c('0x15')](_0x548f0d)[_0xf06c('0x1d')](function(_0x46b3a1){_0x26701b[_0xf06c('0x15')]=_0x46b3a1;if(_0x15dac7[_0xf06c('0x2a')][_0xf06c('0x3b')]){_0x21fed3[_0xf06c('0x3c')]=[{'all':!![]}];}return db[_0xf06c('0x23')][_0xf06c('0x3d')](_0x21fed3);})[_0xf06c('0x1d')](function(_0x40eee7){_0x26701b[_0xf06c('0x3e')]=_0x40eee7;return _0x26701b;})['then'](respondWithFilteredResult(_0x81ef8f,_0x21fed3))[_0xf06c('0x3f')](handleError(_0x81ef8f,null));};exports[_0xf06c('0x40')]=function(_0x53ac85,_0x48fae7){var _0x205fc3={'raw':!![],'where':{'id':_0x53ac85[_0xf06c('0x41')]['id']}},_0x45c373={};_0x45c373['model']=_[_0xf06c('0x2b')](db[_0xf06c('0x23')][_0xf06c('0x24')]);_0x45c373['query']=_[_0xf06c('0x2b')](_0x53ac85['query']);_0x45c373[_0xf06c('0x2c')]=_[_0xf06c('0x2d')](_0x45c373[_0xf06c('0x28')],_0x45c373['query']);_0x205fc3[_0xf06c('0x2e')]=_[_0xf06c('0x2d')](_0x45c373['model'],qs[_0xf06c('0x2f')](_0x53ac85[_0xf06c('0x2a')][_0xf06c('0x2f')]));_0x205fc3['attributes']=_0x205fc3[_0xf06c('0x2e')][_0xf06c('0x30')]?_0x205fc3[_0xf06c('0x2e')]:_0x45c373[_0xf06c('0x28')];if(_0x53ac85[_0xf06c('0x2a')][_0xf06c('0x3b')]){_0x205fc3['include']=[{'all':!![]}];}_0x205fc3=_[_0xf06c('0x37')]({},_0x205fc3,_0x53ac85[_0xf06c('0x3a')]);return db['CmHopperHistory'][_0xf06c('0x42')](_0x205fc3)['then'](handleEntityNotFound(_0x48fae7,null))['then'](respondWithResult(_0x48fae7,null))[_0xf06c('0x3f')](handleError(_0x48fae7,null));};exports[_0xf06c('0x43')]=function(_0x5ef71b,_0x19f794){return db['CmHopperHistory'][_0xf06c('0x43')](_0x5ef71b[_0xf06c('0x44')],{})[_0xf06c('0x1d')](respondWithResult(_0x19f794,0xc9))[_0xf06c('0x3f')](handleError(_0x19f794,null));};exports[_0xf06c('0x45')]=function(_0x216369,_0x48b32b){return db['CmHopperHistory'][_0xf06c('0x45')]()[_0xf06c('0x1d')](respondWithResult(_0x48b32b,null))['catch'](handleError(_0x48b32b,null));};exports[_0xf06c('0x1c')]=function(_0x3d82dd,_0x455b1a){if(_0x3d82dd['body']['uniqueid']){delete _0x3d82dd[_0xf06c('0x44')][_0xf06c('0x46')];}return db['CmHopperHistory'][_0xf06c('0x42')]({'where':{'uniqueid':_0x3d82dd[_0xf06c('0x41')]['id']}})[_0xf06c('0x1d')](handleEntityNotFound(_0x455b1a,null))[_0xf06c('0x1d')](saveUpdates(_0x3d82dd[_0xf06c('0x44')],null))[_0xf06c('0x1d')](respondWithResult(_0x455b1a,null))[_0xf06c('0x3f')](handleError(_0x455b1a,null));}; \ No newline at end of file +var _0xfa1f=['type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','options','CmHopperHistory','count','includeAll','include','catch','show','params','find','create','body','describe','update','uniqueid','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','rawAttributes'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xfa1f,0x136));var _0xffa1=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xfa1f[_0xd0b415];return _0x2bdf2c;};'use strict';var pdf=require(_0xffa1('0x0'));var emlformat=require(_0xffa1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xffa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffa1('0x3'));var moment=require('moment');var BPromise=require(_0xffa1('0x4'));var Mustache=require(_0xffa1('0x5'));var util=require('util');var path=require(_0xffa1('0x6'));var sox=require('sox');var csv=require(_0xffa1('0x7'));var ejs=require(_0xffa1('0x8'));var fs=require('fs');var _=require(_0xffa1('0x9'));var squel=require(_0xffa1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xffa1('0xb'));var toCsv=require(_0xffa1('0x7'));var querystring=require(_0xffa1('0xc'));var Papa=require(_0xffa1('0xd'));var Redis=require(_0xffa1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xffa1('0xf'));var as=require(_0xffa1('0x10'));var hardwareService=require(_0xffa1('0x11'));var logger=require(_0xffa1('0x12'))('api');var utils=require(_0xffa1('0x13'));var config=require(_0xffa1('0x14'));var db=require(_0xffa1('0x15'))['db'];function respondWithStatusCode(_0x41d8df,_0x100ff1){_0x100ff1=_0x100ff1||0xcc;return function(_0x105f53){if(_0x105f53){return _0x41d8df[_0xffa1('0x16')](_0x100ff1);}return _0x41d8df[_0xffa1('0x17')](_0x100ff1)[_0xffa1('0x18')]();};}function respondWithResult(_0x348cbf,_0x394d99){_0x394d99=_0x394d99||0xc8;return function(_0x167959){if(_0x167959){return _0x348cbf[_0xffa1('0x17')](_0x394d99)[_0xffa1('0x19')](_0x167959);}};}function respondWithFilteredResult(_0x23f652,_0x1e5aff){return function(_0x33691f){if(_0x33691f){var _0x1cc376=_0x33691f['count'],_0x54601d=_0x1e5aff['offset'],_0x23810a=_0x1e5aff[_0xffa1('0x1a')]+_0x1e5aff[_0xffa1('0x1b')],_0x53a91f;if(_0x23810a>=_0x1cc376){_0x23810a=_0x1cc376;_0x53a91f=0xc8;}else{_0x53a91f=0xce;}_0x23f652[_0xffa1('0x17')](_0x53a91f);return _0x23f652[_0xffa1('0x1c')](_0xffa1('0x1d'),_0x54601d+'-'+_0x23810a+'/'+_0x1cc376)[_0xffa1('0x19')](_0x33691f);}return null;};}function patchUpdates(_0x106122){return function(_0x3bb2c5){try{jsonpatch[_0xffa1('0x1e')](_0x3bb2c5,_0x106122,!![]);}catch(_0x49066c){return BPromise[_0xffa1('0x1f')](_0x49066c);}return _0x3bb2c5[_0xffa1('0x20')]();};}function saveUpdates(_0x57d1d3,_0x55b3e1){return function(_0x44a633){if(_0x44a633){return _0x44a633['update'](_0x57d1d3)[_0xffa1('0x21')](function(_0x135e07){return _0x135e07;});}return null;};}function removeEntity(_0x52f0b4,_0x49df37){return function(_0x5e1185){if(_0x5e1185){return _0x5e1185['destroy']()[_0xffa1('0x21')](function(){_0x52f0b4[_0xffa1('0x17')](0xcc)[_0xffa1('0x18')]();});}};}function handleEntityNotFound(_0x3c1827,_0x43c86c){return function(_0x2d8910){if(!_0x2d8910){_0x3c1827[_0xffa1('0x16')](0x194);}return _0x2d8910;};}function handleError(_0x55cbed,_0x4deca1){_0x4deca1=_0x4deca1||0x1f4;return function(_0x43a675){logger[_0xffa1('0x22')](_0x43a675[_0xffa1('0x23')]);if(_0x43a675[_0xffa1('0x24')]){delete _0x43a675[_0xffa1('0x24')];}_0x55cbed['status'](_0x4deca1)[_0xffa1('0x25')](_0x43a675);};}exports[_0xffa1('0x26')]=function(_0x9221ad,_0x564e95){var _0x5686fc={},_0x45f0e3={},_0x192c2d={'count':0x0,'rows':[]};var _0x58e2f3=_['map'](db['CmHopperHistory'][_0xffa1('0x27')],function(_0x15a822){return{'name':_0x15a822['fieldName'],'type':_0x15a822[_0xffa1('0x28')][_0xffa1('0x29')]};});_0x45f0e3[_0xffa1('0x2a')]=_[_0xffa1('0x2b')](_0x58e2f3,_0xffa1('0x24'));_0x45f0e3[_0xffa1('0x2c')]=_[_0xffa1('0x2d')](_0x9221ad['query']);_0x45f0e3[_0xffa1('0x2e')]=_[_0xffa1('0x2f')](_0x45f0e3[_0xffa1('0x2a')],_0x45f0e3[_0xffa1('0x2c')]);_0x5686fc[_0xffa1('0x30')]=_[_0xffa1('0x2f')](_0x45f0e3[_0xffa1('0x2a')],qs[_0xffa1('0x31')](_0x9221ad[_0xffa1('0x2c')][_0xffa1('0x31')]));_0x5686fc[_0xffa1('0x30')]=_0x5686fc[_0xffa1('0x30')][_0xffa1('0x32')]?_0x5686fc['attributes']:_0x45f0e3['model'];if(!_0x9221ad['query']['hasOwnProperty'](_0xffa1('0x33'))){_0x5686fc[_0xffa1('0x1b')]=qs[_0xffa1('0x1b')](_0x9221ad['query']['limit']);_0x5686fc[_0xffa1('0x1a')]=qs['offset'](_0x9221ad[_0xffa1('0x2c')]['offset']);}_0x5686fc['order']=qs[_0xffa1('0x34')](_0x9221ad['query'][_0xffa1('0x34')]);_0x5686fc[_0xffa1('0x35')]=qs[_0xffa1('0x2e')](_[_0xffa1('0x36')](_0x9221ad[_0xffa1('0x2c')],_0x45f0e3[_0xffa1('0x2e')]));if(_0x9221ad[_0xffa1('0x2c')]['filter']){_0x5686fc[_0xffa1('0x35')]=_[_0xffa1('0x37')](_0x5686fc[_0xffa1('0x35')],{'$or':_['map'](_0x58e2f3,function(_0x56ada0){if(_0x56ada0['type']!=='VIRTUAL'){var _0x2ec02c={};_0x2ec02c[_0x56ada0[_0xffa1('0x24')]]={'$like':'%'+_0x9221ad[_0xffa1('0x2c')]['filter']+'%'};return _0x2ec02c;}})});}_0x5686fc=_[_0xffa1('0x37')]({},_0x5686fc,_0x9221ad[_0xffa1('0x38')]);var _0x2d0951={'where':_0x5686fc['where']};return db[_0xffa1('0x39')]['count'](_0x2d0951)[_0xffa1('0x21')](function(_0xf3cfdd){_0x192c2d[_0xffa1('0x3a')]=_0xf3cfdd;if(_0x9221ad[_0xffa1('0x2c')][_0xffa1('0x3b')]){_0x5686fc[_0xffa1('0x3c')]=[{'all':!![]}];}return db[_0xffa1('0x39')]['findAll'](_0x5686fc);})[_0xffa1('0x21')](function(_0x153eac){_0x192c2d['rows']=_0x153eac;return _0x192c2d;})[_0xffa1('0x21')](respondWithFilteredResult(_0x564e95,_0x5686fc))[_0xffa1('0x3d')](handleError(_0x564e95,null));};exports[_0xffa1('0x3e')]=function(_0x12c33f,_0x58b9e0){var _0x3d4598={'raw':!![],'where':{'id':_0x12c33f[_0xffa1('0x3f')]['id']}},_0x40fdf1={};_0x40fdf1[_0xffa1('0x2a')]=_['keys'](db[_0xffa1('0x39')][_0xffa1('0x27')]);_0x40fdf1['query']=_[_0xffa1('0x2d')](_0x12c33f[_0xffa1('0x2c')]);_0x40fdf1[_0xffa1('0x2e')]=_[_0xffa1('0x2f')](_0x40fdf1[_0xffa1('0x2a')],_0x40fdf1[_0xffa1('0x2c')]);_0x3d4598[_0xffa1('0x30')]=_[_0xffa1('0x2f')](_0x40fdf1[_0xffa1('0x2a')],qs[_0xffa1('0x31')](_0x12c33f[_0xffa1('0x2c')]['fields']));_0x3d4598[_0xffa1('0x30')]=_0x3d4598[_0xffa1('0x30')][_0xffa1('0x32')]?_0x3d4598[_0xffa1('0x30')]:_0x40fdf1['model'];if(_0x12c33f[_0xffa1('0x2c')][_0xffa1('0x3b')]){_0x3d4598[_0xffa1('0x3c')]=[{'all':!![]}];}_0x3d4598=_[_0xffa1('0x37')]({},_0x3d4598,_0x12c33f[_0xffa1('0x38')]);return db[_0xffa1('0x39')][_0xffa1('0x40')](_0x3d4598)['then'](handleEntityNotFound(_0x58b9e0,null))[_0xffa1('0x21')](respondWithResult(_0x58b9e0,null))[_0xffa1('0x3d')](handleError(_0x58b9e0,null));};exports['create']=function(_0x4cbbf5,_0xdbcef7){return db[_0xffa1('0x39')][_0xffa1('0x41')](_0x4cbbf5[_0xffa1('0x42')],{})[_0xffa1('0x21')](respondWithResult(_0xdbcef7,0xc9))[_0xffa1('0x3d')](handleError(_0xdbcef7,null));};exports['describe']=function(_0x558d49,_0x13a94a){return db[_0xffa1('0x39')][_0xffa1('0x43')]()[_0xffa1('0x21')](respondWithResult(_0x13a94a,null))[_0xffa1('0x3d')](handleError(_0x13a94a,null));};exports[_0xffa1('0x44')]=function(_0x52bf00,_0x7d7849){if(_0x52bf00['body'][_0xffa1('0x45')]){delete _0x52bf00[_0xffa1('0x42')][_0xffa1('0x45')];}return db[_0xffa1('0x39')][_0xffa1('0x40')]({'where':{'uniqueid':_0x52bf00[_0xffa1('0x3f')]['id']}})[_0xffa1('0x21')](handleEntityNotFound(_0x7d7849,null))[_0xffa1('0x21')](saveUpdates(_0x52bf00['body'],null))['then'](respondWithResult(_0x7d7849,null))[_0xffa1('0x3d')](handleError(_0x7d7849,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index ecd316f..399b833 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca3d=['rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x49fc2f,_0x2f9a56){var _0x2db0d9=function(_0x1b66fb){while(--_0x1b66fb){_0x49fc2f['push'](_0x49fc2f['shift']());}};_0x2db0d9(++_0x2f9a56);}(_0xca3d,0x19d));var _0xdca3=function(_0x67d81c,_0x3cd587){_0x67d81c=_0x67d81c-0x0;var _0x3a7dc5=_0xca3d[_0x67d81c];return _0x3a7dc5;};'use strict';var _=require(_0xdca3('0x0'));var util=require(_0xdca3('0x1'));var logger=require(_0xdca3('0x2'))(_0xdca3('0x3'));var moment=require('moment');var BPromise=require(_0xdca3('0x4'));var rp=require(_0xdca3('0x5'));var fs=require('fs');var path=require(_0xdca3('0x6'));var rimraf=require(_0xdca3('0x7'));var config=require(_0xdca3('0x8'));var attributes=require(_0xdca3('0x9'));module[_0xdca3('0xa')]=function(_0x4eff1b,_0x5c76e7){return _0x4eff1b[_0xdca3('0xb')](_0xdca3('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xdca3('0xd'),'fields':['endtime']},{'name':_0xdca3('0xe'),'fields':[_0xdca3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8334=['bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api'];(function(_0x54b9f7,_0xc7014f){var _0x5a5cda=function(_0x44f579){while(--_0x44f579){_0x54b9f7['push'](_0x54b9f7['shift']());}};_0x5a5cda(++_0xc7014f);}(_0x8334,0x1ae));var _0x4833=function(_0xacd1fd,_0x24f8ea){_0xacd1fd=_0xacd1fd-0x0;var _0x3d370b=_0x8334[_0xacd1fd];return _0x3d370b;};'use strict';var _=require(_0x4833('0x0'));var util=require(_0x4833('0x1'));var logger=require(_0x4833('0x2'))(_0x4833('0x3'));var moment=require('moment');var BPromise=require(_0x4833('0x4'));var rp=require(_0x4833('0x5'));var fs=require('fs');var path=require(_0x4833('0x6'));var rimraf=require('rimraf');var config=require(_0x4833('0x7'));var attributes=require(_0x4833('0x8'));module[_0x4833('0x9')]=function(_0x32761f,_0x1042d0){return _0x32761f[_0x4833('0xa')]('CmHopperHistory',attributes,{'tableName':_0x4833('0xb'),'paranoid':![],'indexes':[{'name':_0x4833('0xc'),'fields':[_0x4833('0xc')]},{'name':_0x4833('0xd'),'fields':[_0x4833('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index aec2985..f42b593 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','name','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','raw','AvgHandleTime','findAll','options','sequelize'];(function(_0x3bb947,_0x34b6f3){var _0x122b67=function(_0x49cf0a){while(--_0x49cf0a){_0x3bb947['push'](_0x3bb947['shift']());}};_0x122b67(++_0x34b6f3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x386ca7,_0x16276a){_0x386ca7=_0x386ca7-0x0;var _0x36f5e2=_0xf4eb[_0x386ca7];return _0x36f5e2;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}exports[_0xbf4e('0x13')]=function(_0x577c27){var _0x5db03f=this;return new Promise(function(_0x566ec3,_0x4f8762){return db[_0xbf4e('0x14')][_0xbf4e('0x15')](_0x577c27[_0xbf4e('0x16')],{'raw':_0x577c27['options']?_0x577c27['options'][_0xbf4e('0x17')]===undefined?!![]:![]:!![]})[_0xbf4e('0x9')](function(_0x3be138){logger[_0xbf4e('0xa')](_0xbf4e('0x13'),_0x577c27);logger[_0xbf4e('0xd')](_0xbf4e('0x13'),_0x577c27,JSON[_0xbf4e('0xe')](_0x3be138));_0x566ec3(_0x3be138);})[_0xbf4e('0x12')](function(_0x376832){logger[_0xbf4e('0xf')]('CreateCmHopperHistory',_0x376832[_0xbf4e('0x11')],_0x577c27);_0x4f8762(_0x5db03f[_0xbf4e('0xf')](0x1f4,_0x376832['message']));});});};exports[_0xbf4e('0x18')]=function(_0x30994d){var _0x114412=this;return new Promise(function(_0x1bda8b,_0x3a5d72){return db['CmHopperHistory'][_0xbf4e('0x19')]({'raw':_0x30994d[_0xbf4e('0x1a')]?_0x30994d[_0xbf4e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x30994d[_0xbf4e('0x1a')]?_0x30994d['options']['where']||null:null,'attributes':[[db[_0xbf4e('0x1b')]['fn']('COUNT',db[_0xbf4e('0x1b')][_0xbf4e('0x1c')]('id')),_0xbf4e('0x1d')],[db[_0xbf4e('0x1b')]['fn']('COUNT',db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0xbf4e('0x1f')],[db['sequelize']['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x21')))),_0xbf4e('0x22')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x23')))),_0xbf4e('0x24')],[db['sequelize']['fn'](_0xbf4e('0x25'),db[_0xbf4e('0x1b')]['fn']('IF',db['sequelize'][_0xbf4e('0x1e')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xbf4e('0x26')],[db['sequelize']['fn'](_0xbf4e('0x25'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x27')))),_0xbf4e('0x28')]]})[_0xbf4e('0x9')](function(_0x29d6aa){logger[_0xbf4e('0xa')](_0xbf4e('0x18'),_0x30994d);logger['debug'](_0xbf4e('0x18'),_0x30994d,JSON[_0xbf4e('0xe')](_0x29d6aa));_0x1bda8b(_0x29d6aa);})[_0xbf4e('0x12')](function(_0x3bba55){logger[_0xbf4e('0xf')]('AvgHandleTime',_0x3bba55['message'],_0x30994d);_0x3a5d72(_0x114412['error'](0x1f4,_0x3bba55['message']));});});};exports[_0xbf4e('0x29')]=function(_0x17a1a1){var _0x91b52f=this;return new Promise(function(_0x2693ba,_0x22ddde){return db[_0xbf4e('0x14')][_0xbf4e('0x19')]({'raw':_0x17a1a1[_0xbf4e('0x1a')]?_0x17a1a1[_0xbf4e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x17a1a1['options']?_0x17a1a1[_0xbf4e('0x1a')][_0xbf4e('0x2a')]||null:null,'attributes':[[_0xbf4e('0x2b'),'name'],[db[_0xbf4e('0x1b')]['fn']('COUNT',db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x2c')))),'outboundNoSuchCallsDay'],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x2d')))),_0xbf4e('0x2e')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0xbf4e('0x2f')],[db[_0xbf4e('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x30')))),'outboundCongestionCallsDay'],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xbf4e('0x31')],[db['sequelize']['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db['sequelize']['literal'](_0xbf4e('0x32')))),_0xbf4e('0x33')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db['sequelize'][_0xbf4e('0x1e')](_0xbf4e('0x34')))),_0xbf4e('0x35')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x2013,\x201,\x20null'))),_0xbf4e('0x36')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x37')))),_0xbf4e('0x38')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x39')))),_0xbf4e('0x3a')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db['sequelize']['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x3b')))),'outboundAnswerAgiCallsDay'],[db[_0xbf4e('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x2020,\x201,\x20null'))),_0xbf4e('0x3a')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x3c')))),_0xbf4e('0x3d')]],'group':[_0xbf4e('0x2b')]})[_0xbf4e('0x9')](function(_0x271ad2){logger['info']('GetVoiceQueueHopperHistory',_0x17a1a1);logger[_0xbf4e('0xd')](_0xbf4e('0x29'),_0x17a1a1,JSON[_0xbf4e('0xe')](_0x271ad2));_0x2693ba(_0x271ad2);})['catch'](function(_0x339ce6){logger[_0xbf4e('0xf')]('GetVoiceQueueHopperHistory',_0x339ce6['message'],_0x17a1a1);_0x22ddde(_0x91b52f[_0xbf4e('0xf')](0x1f4,_0x339ce6['message']));});});};exports['GetCampaignHopperHistory']=function(_0x424f41){var _0x3dd51a=this;return new Promise(function(_0x73ca86,_0x43cfd7){return db[_0xbf4e('0x14')]['findAll']({'raw':_0x424f41[_0xbf4e('0x1a')]?_0x424f41['options'][_0xbf4e('0x17')]===undefined?!![]:![]:!![],'where':_0x424f41['options']?_0x424f41[_0xbf4e('0x1a')]['where']||null:null,'attributes':[[_0xbf4e('0x2b'),_0xbf4e('0x3e')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['col']('id')),'ivrTotalCallsDays'],[db['sequelize']['fn']('COUNT',db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x3f')))),_0xbf4e('0x40')]],'group':[_0xbf4e('0x2b')]})[_0xbf4e('0x9')](function(_0x17c2e1){logger[_0xbf4e('0xa')](_0xbf4e('0x41'),_0x424f41);logger['debug'](_0xbf4e('0x41'),_0x424f41,JSON[_0xbf4e('0xe')](_0x17c2e1));_0x73ca86(_0x17c2e1);})[_0xbf4e('0x12')](function(_0x5e548a){logger['error'](_0xbf4e('0x41'),_0x5e548a[_0xbf4e('0x11')],_0x424f41);_0x43cfd7(_0x3dd51a[_0xbf4e('0xf')](0x1f4,_0x5e548a['message']));});});}; \ No newline at end of file +var _0x4fc2=['request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s'];(function(_0x232122,_0x125102){var _0x9388a9=function(_0xfbf24){while(--_0xfbf24){_0x232122['push'](_0x232122['shift']());}};_0x9388a9(++_0x125102);}(_0x4fc2,0x111));var _0x24fc=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x4fc2[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['CreateCmHopperHistory']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['CmHopperHistory'][_0x24fc('0x17')](_0x23873c[_0x24fc('0x18')],{'raw':_0x23873c[_0x24fc('0x19')]?_0x23873c['options'][_0x24fc('0x1a')]===undefined?!![]:![]:!![]})[_0x24fc('0xc')](function(_0xbf1d6b){logger[_0x24fc('0xd')]('CreateCmHopperHistory',_0x23873c);logger[_0x24fc('0x10')]('CreateCmHopperHistory',_0x23873c,JSON[_0x24fc('0x12')](_0xbf1d6b));_0x6cfa0a(_0xbf1d6b);})['catch'](function(_0x3ed464){logger[_0x24fc('0x13')](_0x24fc('0x1b'),_0x3ed464['message'],_0x23873c);_0x8ac114(_0x1cb3d0[_0x24fc('0x13')](0x1f4,_0x3ed464['message']));});});};exports[_0x24fc('0x1c')]=function(_0x2bb93a){var _0x36a9b4=this;return new Promise(function(_0x34b5b2,_0x3296fc){return db[_0x24fc('0x1d')][_0x24fc('0x1e')]({'raw':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bb93a['options']?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x1f')]||null:null,'attributes':[[db[_0x24fc('0x20')]['fn']('COUNT',db[_0x24fc('0x20')][_0x24fc('0x21')]('id')),_0x24fc('0x22')],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db['sequelize'][_0x24fc('0x24')](_0x24fc('0x25')))),_0x24fc('0x26')],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x24fc('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')]['literal'](_0x24fc('0x28')))),_0x24fc('0x29')],[db['sequelize']['fn'](_0x24fc('0x2a'),db[_0x24fc('0x20')]['fn']('IF',db['sequelize']['literal'](_0x24fc('0x2b')))),'predictiveIntervalAvgHoldtime'],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x2a'),db['sequelize']['fn']('IF',db[_0x24fc('0x20')][_0x24fc('0x24')](_0x24fc('0x2c')))),_0x24fc('0x2d')]]})[_0x24fc('0xc')](function(_0x1e205d){logger[_0x24fc('0xd')](_0x24fc('0x1c'),_0x2bb93a);logger[_0x24fc('0x10')]('AvgHandleTime',_0x2bb93a,JSON[_0x24fc('0x12')](_0x1e205d));_0x34b5b2(_0x1e205d);})[_0x24fc('0x16')](function(_0x2fbe30){logger[_0x24fc('0x13')](_0x24fc('0x1c'),_0x2fbe30['message'],_0x2bb93a);_0x3296fc(_0x36a9b4['error'](0x1f4,_0x2fbe30[_0x24fc('0x15')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x22ef18){var _0x38798d=this;return new Promise(function(_0x10399f,_0x41b408){return db['CmHopperHistory'][_0x24fc('0x1e')]({'raw':_0x22ef18['options']?_0x22ef18[_0x24fc('0x19')][_0x24fc('0x1a')]===undefined?!![]:![]:!![],'where':_0x22ef18[_0x24fc('0x19')]?_0x22ef18[_0x24fc('0x19')][_0x24fc('0x1f')]||null:null,'attributes':[['campaign',_0x24fc('0x2e')],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db['sequelize'][_0x24fc('0x24')](_0x24fc('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x24fc('0x20')]['fn']('COUNT',db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')][_0x24fc('0x24')](_0x24fc('0x30')))),_0x24fc('0x31')],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db['sequelize'][_0x24fc('0x24')](_0x24fc('0x25')))),_0x24fc('0x32')],[db['sequelize']['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db['sequelize'][_0x24fc('0x24')](_0x24fc('0x33')))),_0x24fc('0x34')],[db['sequelize']['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db['sequelize'][_0x24fc('0x24')](_0x24fc('0x35')))),_0x24fc('0x36')],[db[_0x24fc('0x20')]['fn']('COUNT',db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')][_0x24fc('0x24')](_0x24fc('0x37')))),_0x24fc('0x38')],[db['sequelize']['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')][_0x24fc('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x24fc('0x39')],[db[_0x24fc('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x24fc('0x20')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x24fc('0x3a')],[db['sequelize']['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')]['literal'](_0x24fc('0x3b')))),_0x24fc('0x3c')],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')][_0x24fc('0x24')](_0x24fc('0x3d')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x24fc('0x3e')],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')][_0x24fc('0x24')](_0x24fc('0x3f')))),_0x24fc('0x40')],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db[_0x24fc('0x20')]['literal'](_0x24fc('0x41')))),_0x24fc('0x3e')],[db[_0x24fc('0x20')]['fn'](_0x24fc('0x23'),db[_0x24fc('0x20')]['fn']('IF',db['sequelize'][_0x24fc('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x24fc('0x42')]],'group':[_0x24fc('0x43')]})[_0x24fc('0xc')](function(_0x41ddfb){logger[_0x24fc('0xd')](_0x24fc('0x44'),_0x22ef18);logger['debug'](_0x24fc('0x44'),_0x22ef18,JSON[_0x24fc('0x12')](_0x41ddfb));_0x10399f(_0x41ddfb);})[_0x24fc('0x16')](function(_0x31a2ef){logger[_0x24fc('0x13')](_0x24fc('0x44'),_0x31a2ef['message'],_0x22ef18);_0x41b408(_0x38798d[_0x24fc('0x13')](0x1f4,_0x31a2ef[_0x24fc('0x15')]));});});};exports[_0x24fc('0x45')]=function(_0x1b69ad){var _0x3e739d=this;return new Promise(function(_0x385968,_0x1ffd5b){return db['CmHopperHistory'][_0x24fc('0x1e')]({'raw':_0x1b69ad[_0x24fc('0x19')]?_0x1b69ad['options'][_0x24fc('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b69ad[_0x24fc('0x19')]?_0x1b69ad[_0x24fc('0x19')][_0x24fc('0x1f')]||null:null,'attributes':[[_0x24fc('0x43'),_0x24fc('0x2e')],[db['sequelize']['fn'](_0x24fc('0x23'),db['sequelize'][_0x24fc('0x21')]('id')),_0x24fc('0x46')],[db['sequelize']['fn'](_0x24fc('0x23'),db['sequelize']['fn']('IF',db[_0x24fc('0x20')]['literal'](_0x24fc('0x25')))),_0x24fc('0x47')]],'group':['campaign']})[_0x24fc('0xc')](function(_0x5d6539){logger[_0x24fc('0xd')](_0x24fc('0x45'),_0x1b69ad);logger['debug'](_0x24fc('0x45'),_0x1b69ad,JSON[_0x24fc('0x12')](_0x5d6539));_0x385968(_0x5d6539);})[_0x24fc('0x16')](function(_0x47179d){logger[_0x24fc('0x13')]('GetCampaignHopperHistory',_0x47179d[_0x24fc('0x15')],_0x1b69ad);_0x1ffd5b(_0x3e739d[_0x24fc('0x13')](0x1f4,_0x47179d[_0x24fc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 5d13478..ff0e413 100644 --- a/server/api/cmHopperHistory/index.js +++ b/server/api/cmHopperHistory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17bb=['create','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x17bb,0xc1));var _0xb17b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x17bb[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xb17b('0x0'));var util=require('util');var path=require(_0xb17b('0x1'));var timeout=require(_0xb17b('0x2'));var express=require(_0xb17b('0x3'));var router=express[_0xb17b('0x4')]();var auth=require(_0xb17b('0x5'));var interaction=require(_0xb17b('0x6'));var config=require(_0xb17b('0x7'));var controller=require(_0xb17b('0x8'));router[_0xb17b('0x9')]('/',auth['isAuthenticated'](),controller[_0xb17b('0xa')]);router[_0xb17b('0x9')](_0xb17b('0xb'),auth[_0xb17b('0xc')](),controller[_0xb17b('0xd')]);router[_0xb17b('0x9')](_0xb17b('0xe'),auth[_0xb17b('0xc')](),controller[_0xb17b('0xf')]);router[_0xb17b('0x10')]('/',auth[_0xb17b('0xc')](),controller[_0xb17b('0x11')]);router[_0xb17b('0x12')](_0xb17b('0xe'),auth[_0xb17b('0xc')](),controller[_0xb17b('0x13')]);module[_0xb17b('0x14')]=router; \ No newline at end of file +var _0x39c9=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','exports','path'];(function(_0x167038,_0xb0cf4c){var _0x3b8fb1=function(_0x175349){while(--_0x175349){_0x167038['push'](_0x167038['shift']());}};_0x3b8fb1(++_0xb0cf4c);}(_0x39c9,0xba));var _0x939c=function(_0x4597a7,_0x5da925){_0x4597a7=_0x4597a7-0x0;var _0x52cd16=_0x39c9[_0x4597a7];return _0x52cd16;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x939c('0x0'));var timeout=require(_0x939c('0x1'));var express=require('express');var router=express[_0x939c('0x2')]();var auth=require(_0x939c('0x3'));var interaction=require(_0x939c('0x4'));var config=require('../../config/environment');var controller=require(_0x939c('0x5'));router[_0x939c('0x6')]('/',auth[_0x939c('0x7')](),controller[_0x939c('0x8')]);router['get'](_0x939c('0x9'),auth['isAuthenticated'](),controller[_0x939c('0xa')]);router[_0x939c('0x6')](_0x939c('0xb'),auth[_0x939c('0x7')](),controller[_0x939c('0xc')]);router['post']('/',auth[_0x939c('0x7')](),controller[_0x939c('0xd')]);router[_0x939c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x939c('0xf')]);module[_0x939c('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 29d996a..678c213 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4e4=['exports','STRING'];(function(_0x540949,_0x1dfd05){var _0x4d5b3c=function(_0x3e9380){while(--_0x3e9380){_0x540949['push'](_0x540949['shift']());}};_0x4d5b3c(++_0x1dfd05);}(_0xe4e4,0x18e));var _0x4e4e=function(_0x4d121d,_0x7c2e24){_0x4d121d=_0x4d121d-0x0;var _0x255d8d=_0xe4e4[_0x4d121d];return _0x255d8d;};'use strict';var Sequelize=require('sequelize');module[_0x4e4e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4e4e('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x02df=['sequelize','exports','STRING'];(function(_0x138f12,_0x4b87ec){var _0x29eeae=function(_0x3c7c46){while(--_0x3c7c46){_0x138f12['push'](_0x138f12['shift']());}};_0x29eeae(++_0x4b87ec);}(_0x02df,0x174));var _0xf02d=function(_0x31da1e,_0x3b7e7e){_0x31da1e=_0x31da1e-0x0;var _0x1f2969=_0x02df[_0x31da1e];return _0x1f2969;};'use strict';var Sequelize=require(_0xf02d('0x0'));module[_0xf02d('0x1')]={'name':{'type':Sequelize[_0xf02d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf02d('0x2')]},'dialPrefix':{'type':Sequelize[_0xf02d('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index db81a90..7a4156a 100644 --- a/server/api/cmList/cmList.controller.js +++ b/server/api/cmList/cmList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b8f=['catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Lists','UserProfileSection','autoAssociation','UserProfileResource','find','destroy','params','describe','addDisposition','ListId','getDispositions','findOne','Disposition','hasOwnProperty','order','filter','CmContact','tags','join','isArray','push','each','omit','ids','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./cmList.socket','status','end','json','count','offset','limit','set','apply','save','update','then','get','sendStatus','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0x9b8f,0x1f2));var _0xf9b8=function(_0x511128,_0x4d454c){_0x511128=_0x511128-0x0;var _0xccbe1d=_0x9b8f[_0x511128];return _0xccbe1d;};'use strict';var pdf=require(_0xf9b8('0x0'));var emlformat=require(_0xf9b8('0x1'));var rimraf=require(_0xf9b8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf9b8('0x3'));var rp=require(_0xf9b8('0x4'));var moment=require('moment');var BPromise=require(_0xf9b8('0x5'));var Mustache=require(_0xf9b8('0x6'));var util=require(_0xf9b8('0x7'));var path=require('path');var sox=require(_0xf9b8('0x8'));var csv=require(_0xf9b8('0x9'));var ejs=require(_0xf9b8('0xa'));var fs=require('fs');var _=require(_0xf9b8('0xb'));var squel=require(_0xf9b8('0xc'));var crypto=require(_0xf9b8('0xd'));var jsforce=require(_0xf9b8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf9b8('0xf'));var Papa=require(_0xf9b8('0x10'));var Redis=require(_0xf9b8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf9b8('0x12'));var hardwareService=require(_0xf9b8('0x13'));var logger=require(_0xf9b8('0x14'))(_0xf9b8('0x15'));var utils=require(_0xf9b8('0x16'));var config=require(_0xf9b8('0x17'));var db=require('../../mysqldb')['db'];config[_0xf9b8('0x18')]=_[_0xf9b8('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf9b8('0x1a'))['register'](socket);function respondWithStatusCode(_0xfeedf7,_0x366173){_0x366173=_0x366173||0xcc;return function(_0x3e95c5){if(_0x3e95c5){return _0xfeedf7['sendStatus'](_0x366173);}return _0xfeedf7[_0xf9b8('0x1b')](_0x366173)[_0xf9b8('0x1c')]();};}function respondWithResult(_0x2881b2,_0x58098c){_0x58098c=_0x58098c||0xc8;return function(_0x4d3b95){if(_0x4d3b95){return _0x2881b2[_0xf9b8('0x1b')](_0x58098c)[_0xf9b8('0x1d')](_0x4d3b95);}};}function respondWithFilteredResult(_0xe1ec82,_0x10b44b){return function(_0x1a1072){if(_0x1a1072){var _0x5e3125=_0x1a1072[_0xf9b8('0x1e')],_0x115f1e=_0x10b44b[_0xf9b8('0x1f')],_0x202172=_0x10b44b[_0xf9b8('0x1f')]+_0x10b44b[_0xf9b8('0x20')],_0x3eebd7;if(_0x202172>=_0x5e3125){_0x202172=_0x5e3125;_0x3eebd7=0xc8;}else{_0x3eebd7=0xce;}_0xe1ec82[_0xf9b8('0x1b')](_0x3eebd7);return _0xe1ec82[_0xf9b8('0x21')]('Content-Range',_0x115f1e+'-'+_0x202172+'/'+_0x5e3125)[_0xf9b8('0x1d')](_0x1a1072);}return null;};}function patchUpdates(_0xcc751d){return function(_0x1933de){try{jsonpatch[_0xf9b8('0x22')](_0x1933de,_0xcc751d,!![]);}catch(_0x22b60a){return BPromise['reject'](_0x22b60a);}return _0x1933de[_0xf9b8('0x23')]();};}function saveUpdates(_0x407ec1,_0x203924){return function(_0x24666b){if(_0x24666b){return _0x24666b[_0xf9b8('0x24')](_0x407ec1)[_0xf9b8('0x25')](function(_0x3ecda2){return _0x3ecda2;});}return null;};}function removeEntity(_0x11ab2f,_0x488fce){return function(_0xd354f4){if(_0xd354f4){return _0xd354f4['destroy']()[_0xf9b8('0x25')](function(){var _0x4a80d1=_0xd354f4[_0xf9b8('0x26')]({'plain':!![]});var _0x228913='Lists';return db['UserProfileResource']['destroy']({'where':{'type':_0x228913,'resourceId':_0x4a80d1['id']}})[_0xf9b8('0x25')](function(){return _0xd354f4;});})[_0xf9b8('0x25')](function(){_0x11ab2f[_0xf9b8('0x1b')](0xcc)[_0xf9b8('0x1c')]();});}};}function handleEntityNotFound(_0x19f743,_0x48eb46){return function(_0x28c3e7){if(!_0x28c3e7){_0x19f743[_0xf9b8('0x27')](0x194);}return _0x28c3e7;};}function handleError(_0x3ada0b,_0x18b32d){_0x18b32d=_0x18b32d||0x1f4;return function(_0x15e1fb){logger[_0xf9b8('0x28')](_0x15e1fb[_0xf9b8('0x29')]);if(_0x15e1fb[_0xf9b8('0x2a')]){delete _0x15e1fb[_0xf9b8('0x2a')];}_0x3ada0b[_0xf9b8('0x1b')](_0x18b32d)[_0xf9b8('0x2b')](_0x15e1fb);};}exports[_0xf9b8('0x2c')]=function(_0x4b43a8,_0x488325){var _0xb5007c={},_0x2569ca={},_0x49855f={'count':0x0,'rows':[]};var _0x58ce3e=_[_0xf9b8('0x2d')](db[_0xf9b8('0x2e')][_0xf9b8('0x2f')],function(_0x1318c8){return{'name':_0x1318c8[_0xf9b8('0x30')],'type':_0x1318c8[_0xf9b8('0x31')][_0xf9b8('0x32')]};});_0x2569ca[_0xf9b8('0x33')]=_['map'](_0x58ce3e,_0xf9b8('0x2a'));_0x2569ca[_0xf9b8('0x34')]=_[_0xf9b8('0x35')](_0x4b43a8[_0xf9b8('0x34')]);_0x2569ca[_0xf9b8('0x36')]=_[_0xf9b8('0x37')](_0x2569ca['model'],_0x2569ca[_0xf9b8('0x34')]);_0xb5007c[_0xf9b8('0x38')]=_[_0xf9b8('0x37')](_0x2569ca[_0xf9b8('0x33')],qs[_0xf9b8('0x39')](_0x4b43a8[_0xf9b8('0x34')][_0xf9b8('0x39')]));_0xb5007c[_0xf9b8('0x38')]=_0xb5007c[_0xf9b8('0x38')][_0xf9b8('0x3a')]?_0xb5007c[_0xf9b8('0x38')]:_0x2569ca[_0xf9b8('0x33')];if(!_0x4b43a8['query']['hasOwnProperty'](_0xf9b8('0x3b'))){_0xb5007c['limit']=qs[_0xf9b8('0x20')](_0x4b43a8[_0xf9b8('0x34')][_0xf9b8('0x20')]);_0xb5007c[_0xf9b8('0x1f')]=qs['offset'](_0x4b43a8[_0xf9b8('0x34')][_0xf9b8('0x1f')]);}_0xb5007c['order']=qs['sort'](_0x4b43a8[_0xf9b8('0x34')][_0xf9b8('0x3c')]);_0xb5007c[_0xf9b8('0x3d')]=qs[_0xf9b8('0x36')](_[_0xf9b8('0x3e')](_0x4b43a8[_0xf9b8('0x34')],_0x2569ca[_0xf9b8('0x36')]));if(_0x4b43a8['query']['filter']){_0xb5007c[_0xf9b8('0x3d')]=_[_0xf9b8('0x3f')](_0xb5007c['where'],{'$or':_['map'](_0x58ce3e,function(_0x290b65){if(_0x290b65[_0xf9b8('0x31')]!==_0xf9b8('0x40')){var _0x472d4a={};_0x472d4a[_0x290b65[_0xf9b8('0x2a')]]={'$like':'%'+_0x4b43a8[_0xf9b8('0x34')]['filter']+'%'};return _0x472d4a;}})});}_0xb5007c=_[_0xf9b8('0x3f')]({},_0xb5007c,_0x4b43a8[_0xf9b8('0x41')]);var _0x28a95e={'where':_0xb5007c[_0xf9b8('0x3d')]};return db['CmList']['count'](_0x28a95e)[_0xf9b8('0x25')](function(_0x53fc4f){_0x49855f[_0xf9b8('0x1e')]=_0x53fc4f;if(_0x4b43a8['query'][_0xf9b8('0x42')]){_0xb5007c[_0xf9b8('0x43')]=[{'all':!![]}];}return db[_0xf9b8('0x2e')][_0xf9b8('0x44')](_0xb5007c);})[_0xf9b8('0x25')](function(_0x661b13){_0x49855f[_0xf9b8('0x45')]=_0x661b13;return _0x49855f;})['then'](respondWithFilteredResult(_0x488325,_0xb5007c))[_0xf9b8('0x46')](handleError(_0x488325,null));};exports[_0xf9b8('0x47')]=function(_0x407eab,_0x43ce65){var _0x183bf9={'raw':![],'where':{'id':_0x407eab['params']['id']}},_0x27a577={};_0x27a577[_0xf9b8('0x33')]=_[_0xf9b8('0x35')](db['CmList']['rawAttributes']);_0x27a577['query']=_[_0xf9b8('0x35')](_0x407eab[_0xf9b8('0x34')]);_0x27a577['filters']=_['intersection'](_0x27a577['model'],_0x27a577[_0xf9b8('0x34')]);_0x183bf9['attributes']=_['intersection'](_0x27a577[_0xf9b8('0x33')],qs[_0xf9b8('0x39')](_0x407eab['query'][_0xf9b8('0x39')]));_0x183bf9[_0xf9b8('0x38')]=_0x183bf9['attributes'][_0xf9b8('0x3a')]?_0x183bf9[_0xf9b8('0x38')]:_0x27a577[_0xf9b8('0x33')];if(_0x407eab[_0xf9b8('0x34')][_0xf9b8('0x42')]){_0x183bf9[_0xf9b8('0x43')]=[{'all':!![]}];}_0x183bf9=_['merge']({},_0x183bf9,_0x407eab[_0xf9b8('0x41')]);return db[_0xf9b8('0x2e')]['find'](_0x183bf9)[_0xf9b8('0x25')](handleEntityNotFound(_0x43ce65,null))[_0xf9b8('0x25')](respondWithResult(_0x43ce65,null))[_0xf9b8('0x46')](handleError(_0x43ce65,null));};exports[_0xf9b8('0x48')]=function(_0x337164,_0x5b605d){return db[_0xf9b8('0x2e')][_0xf9b8('0x48')](_0x337164[_0xf9b8('0x49')],{})[_0xf9b8('0x25')](function(_0x234283){var _0x10ac64=_0x337164['user']['get']({'plain':!![]});if(!_0x10ac64)throw new Error(_0xf9b8('0x4a'));if(_0x10ac64[_0xf9b8('0x4b')]===_0xf9b8('0x4c')){var _0x97f139=_0x234283[_0xf9b8('0x26')]({'plain':!![]});var _0x4af5bf=_0xf9b8('0x4d');return db[_0xf9b8('0x4e')]['find']({'where':{'name':_0x4af5bf,'userProfileId':_0x10ac64['userProfileId']},'raw':!![]})[_0xf9b8('0x25')](function(_0x36a911){if(_0x36a911&&_0x36a911[_0xf9b8('0x4f')]===0x0){return db[_0xf9b8('0x50')][_0xf9b8('0x48')]({'name':_0x97f139[_0xf9b8('0x2a')],'resourceId':_0x97f139['id'],'type':_0x36a911[_0xf9b8('0x2a')],'sectionId':_0x36a911['id']},{})[_0xf9b8('0x25')](function(){return _0x234283;});}else{return _0x234283;}})[_0xf9b8('0x46')](function(_0x4e808d){logger[_0xf9b8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e808d);throw _0x4e808d;});}return _0x234283;})[_0xf9b8('0x25')](respondWithResult(_0x5b605d,0xc9))[_0xf9b8('0x46')](handleError(_0x5b605d,null));};exports[_0xf9b8('0x24')]=function(_0xedecc9,_0x5bec05){if(_0xedecc9[_0xf9b8('0x49')]['id']){delete _0xedecc9['body']['id'];}return db['CmList'][_0xf9b8('0x51')]({'where':{'id':_0xedecc9['params']['id']}})[_0xf9b8('0x25')](handleEntityNotFound(_0x5bec05,null))[_0xf9b8('0x25')](saveUpdates(_0xedecc9[_0xf9b8('0x49')],null))[_0xf9b8('0x25')](respondWithResult(_0x5bec05,null))[_0xf9b8('0x46')](handleError(_0x5bec05,null));};exports[_0xf9b8('0x52')]=function(_0xbba94a,_0x17e4c1){return db[_0xf9b8('0x2e')][_0xf9b8('0x51')]({'where':{'id':_0xbba94a[_0xf9b8('0x53')]['id']}})[_0xf9b8('0x25')](handleEntityNotFound(_0x17e4c1,null))[_0xf9b8('0x25')](removeEntity(_0x17e4c1,null))[_0xf9b8('0x46')](handleError(_0x17e4c1,null));};exports['describe']=function(_0x2df758,_0x10111a){return db[_0xf9b8('0x2e')][_0xf9b8('0x54')]()[_0xf9b8('0x25')](respondWithResult(_0x10111a,null))[_0xf9b8('0x46')](handleError(_0x10111a,null));};exports[_0xf9b8('0x55')]=function(_0x50641c,_0x4ce1d0,_0x3042ae){if(_0x50641c[_0xf9b8('0x49')]['id']){delete _0x50641c[_0xf9b8('0x49')]['id'];}return db[_0xf9b8('0x2e')][_0xf9b8('0x51')]({'where':{'id':_0x50641c['params']['id']}})['then'](handleEntityNotFound(_0x4ce1d0,null))[_0xf9b8('0x25')](function(_0x2f5621){if(_0x2f5621){_0x50641c[_0xf9b8('0x49')][_0xf9b8('0x56')]=_0x2f5621['id'];return db['Disposition'][_0xf9b8('0x48')](_0x50641c[_0xf9b8('0x49')]);}})[_0xf9b8('0x25')](respondWithResult(_0x4ce1d0,null))[_0xf9b8('0x46')](handleError(_0x4ce1d0,null));};exports[_0xf9b8('0x57')]=function(_0x3757cc,_0x32c02a,_0x22e2f0){var _0x5760c1={'raw':![],'where':{}};var _0x2b9386={};var _0x147ce7={'count':0x0,'rows':[]};return db[_0xf9b8('0x2e')][_0xf9b8('0x58')]({'where':{'id':_0x3757cc[_0xf9b8('0x53')]['id']}})[_0xf9b8('0x25')](handleEntityNotFound(_0x32c02a,null))['then'](function(_0x387eb3){if(_0x387eb3){_0x2b9386[_0xf9b8('0x33')]=_['keys'](db[_0xf9b8('0x59')][_0xf9b8('0x2f')]);_0x2b9386[_0xf9b8('0x34')]=_[_0xf9b8('0x35')](_0x3757cc[_0xf9b8('0x34')]);_0x2b9386[_0xf9b8('0x36')]=_[_0xf9b8('0x37')](_0x2b9386[_0xf9b8('0x33')],_0x2b9386[_0xf9b8('0x34')]);_0x5760c1[_0xf9b8('0x38')]=_[_0xf9b8('0x37')](_0x2b9386[_0xf9b8('0x33')],qs[_0xf9b8('0x39')](_0x3757cc[_0xf9b8('0x34')][_0xf9b8('0x39')]));_0x5760c1['attributes']=_0x5760c1['attributes'][_0xf9b8('0x3a')]?_0x5760c1[_0xf9b8('0x38')]:_0x2b9386[_0xf9b8('0x33')];if(!_0x3757cc[_0xf9b8('0x34')][_0xf9b8('0x5a')](_0xf9b8('0x3b'))){_0x5760c1['limit']=qs[_0xf9b8('0x20')](_0x3757cc[_0xf9b8('0x34')][_0xf9b8('0x20')]);_0x5760c1[_0xf9b8('0x1f')]=qs[_0xf9b8('0x1f')](_0x3757cc['query']['offset']);}_0x5760c1[_0xf9b8('0x5b')]=qs[_0xf9b8('0x3c')](_0x3757cc[_0xf9b8('0x34')][_0xf9b8('0x3c')]);_0x5760c1[_0xf9b8('0x3d')]=qs['filters'](_[_0xf9b8('0x3e')](_0x3757cc['query'],_0x2b9386[_0xf9b8('0x36')]));_0x5760c1['where'][_0xf9b8('0x56')]=_0x387eb3['id'];if(_0x3757cc[_0xf9b8('0x34')][_0xf9b8('0x5c')]){_0x5760c1['where']=_['merge'](_0x5760c1['where'],{'$or':_[_0xf9b8('0x2d')](_0x5760c1[_0xf9b8('0x38')],function(_0x233d15){var _0x5cca53={};_0x5cca53[_0x233d15]={'$like':'%'+_0x3757cc[_0xf9b8('0x34')][_0xf9b8('0x5c')]+'%'};return _0x5cca53;})});}_0x5760c1=_[_0xf9b8('0x3f')]({},_0x5760c1,_0x3757cc[_0xf9b8('0x41')]);return db[_0xf9b8('0x59')][_0xf9b8('0x1e')]({'where':_0x5760c1[_0xf9b8('0x3d')]})['then'](function(_0x2c88a2){_0x147ce7['count']=_0x2c88a2;if(_0x3757cc[_0xf9b8('0x34')]['includeAll']){_0x5760c1[_0xf9b8('0x43')]=[{'all':!![]}];}return db[_0xf9b8('0x59')][_0xf9b8('0x44')](_0x5760c1);})['then'](function(_0x16d894){_0x147ce7[_0xf9b8('0x45')]=_0x16d894;return _0x147ce7;});}})[_0xf9b8('0x25')](respondWithFilteredResult(_0x32c02a,_0x5760c1))[_0xf9b8('0x46')](handleError(_0x32c02a,null));};exports['removeDispositions']=function(_0x498599,_0x3ba9b0,_0x4a1318){return db[_0xf9b8('0x2e')][_0xf9b8('0x51')]({'where':{'id':_0x498599['params']['id']}})['then'](handleEntityNotFound(_0x3ba9b0,null))['then'](function(_0x4765d2){if(_0x4765d2){return _0x4765d2['removeDispositions'](_0x498599[_0xf9b8('0x34')]['ids']);}})[_0xf9b8('0x25')](respondWithStatusCode(_0x3ba9b0,null))[_0xf9b8('0x46')](handleError(_0x3ba9b0,null));};exports['addContacts']=function(_0x51a676,_0x36700a,_0x3b40cc){return db[_0xf9b8('0x2e')][_0xf9b8('0x51')]({'where':{'id':_0x51a676[_0xf9b8('0x53')]['id']}})[_0xf9b8('0x25')](handleEntityNotFound(_0x36700a,null))[_0xf9b8('0x25')](function(_0x1c9197){if(_0x1c9197){var _0x862104=[];var _0x57c74a={'success':[],'errors':[]};return db[_0xf9b8('0x5d')]['describe']()['then'](function(_0x2b9c8b){if(_0x51a676[_0xf9b8('0x49')][_0xf9b8('0x5e')]&&_['isArray'](_0x51a676['body'][_0xf9b8('0x5e')])){if(_0x51a676['body'][_0xf9b8('0x5e')]['length']){_0x51a676[_0xf9b8('0x49')]['tags']=_0x51a676[_0xf9b8('0x49')][_0xf9b8('0x5e')][_0xf9b8('0x5f')](';')+';';}else{_0x51a676['body'][_0xf9b8('0x5e')]=null;}}else{_0x51a676[_0xf9b8('0x49')]['tags']=null;}if(_0x51a676[_0xf9b8('0x49')]&&_[_0xf9b8('0x60')](_0x51a676[_0xf9b8('0x49')])){for(var _0x36f4fa=0x0;_0x36f4fa<_0x51a676[_0xf9b8('0x49')][_0xf9b8('0x3a')];_0x36f4fa+=0x1){_0x51a676[_0xf9b8('0x49')][_0x36f4fa][_0xf9b8('0x56')]=_0x51a676[_0xf9b8('0x53')]['id'];_0x862104[_0xf9b8('0x61')](_0x51a676[_0xf9b8('0x49')][_0x36f4fa]);}return BPromise[_0xf9b8('0x62')](_0x862104,function(_0x2e8a12){return db[_0xf9b8('0x5d')][_0xf9b8('0x48')](_[_0xf9b8('0x63')](_0x2e8a12,[_0xf9b8('0x64'),'id'])||{},{'fields':_[_0xf9b8('0x35')](_0x2b9c8b),'raw':!![]})[_0xf9b8('0x25')](function(_0x44ec60){_0x57c74a['success']['push'](_0x44ec60['dataValues']);})['catch'](function(_0x4ffe60){_0x57c74a[_0xf9b8('0x65')][_0xf9b8('0x61')]({'data':_0x2e8a12,'error':_0x4ffe60[_0xf9b8('0x66')]});});})[_0xf9b8('0x25')](function(_0x16a5a9){return _0x57c74a;})[_0xf9b8('0x46')](function(_0x54c557){return _0x54c557;});}else{_0x36700a['status'](0x190)[_0xf9b8('0x1d')]({'message':_0xf9b8('0x67')});}});}})[_0xf9b8('0x25')](respondWithResult(_0x36700a,null))[_0xf9b8('0x46')](handleError(_0x36700a,null));};exports[_0xf9b8('0x68')]=function(_0x4c1f43,_0x25555f,_0x5aa427){var _0x5436a0;return db['CmList'][_0xf9b8('0x51')]({'where':{'id':_0x4c1f43[_0xf9b8('0x53')]['id']},'include':[{'model':db[_0xf9b8('0x69')],'as':'CustomFields'}]})[_0xf9b8('0x25')](handleEntityNotFound(_0x25555f,null))['then'](function(_0x51d87d){if(_0x51d87d){_0x5436a0=_0x51d87d;return db[_0xf9b8('0x5d')][_0xf9b8('0x2f')];}})[_0xf9b8('0x25')](function(_0x776cd8){if(_0x776cd8){var _0x4371b2={};var _0x40768f={};_0x40768f['model']=_[_0xf9b8('0x6a')](_[_0xf9b8('0x35')](_0x776cd8),_[_0xf9b8('0x2d')](_0x5436a0[_0xf9b8('0x6b')],function(_0x3c7a2c){return util[_0xf9b8('0x6c')]('cf_%d',_0x3c7a2c['id']);}));_0x40768f[_0xf9b8('0x34')]=_[_0xf9b8('0x35')](_0x4c1f43[_0xf9b8('0x34')]);_0x40768f[_0xf9b8('0x36')]=_[_0xf9b8('0x37')](_0x40768f[_0xf9b8('0x33')],_0x40768f['query']);_0x4371b2[_0xf9b8('0x38')]=_[_0xf9b8('0x37')](_0x40768f[_0xf9b8('0x33')],qs[_0xf9b8('0x39')](_0x4c1f43[_0xf9b8('0x34')][_0xf9b8('0x39')]));_0x4371b2[_0xf9b8('0x38')]=_0x4371b2[_0xf9b8('0x38')]['length']?_0x4371b2['attributes']:_0x40768f['model'];if(!_0x4c1f43['query']['hasOwnProperty'](_0xf9b8('0x3b'))){_0x4371b2['limit']=qs['limit'](_0x4c1f43['query'][_0xf9b8('0x20')]);_0x4371b2[_0xf9b8('0x1f')]=qs[_0xf9b8('0x1f')](_0x4c1f43[_0xf9b8('0x34')]['offset']);}_0x4371b2[_0xf9b8('0x5b')]=qs[_0xf9b8('0x3c')](_0x4c1f43[_0xf9b8('0x34')]['sort']);_0x4371b2['where']=qs[_0xf9b8('0x36')](_[_0xf9b8('0x3e')](_0x4c1f43['query'],_0x40768f[_0xf9b8('0x36')]));_0x4371b2['raw']=!![];if(_0x4c1f43['query'][_0xf9b8('0x5c')]){_0x4371b2['where']=_[_0xf9b8('0x3f')](_0x4371b2['where'],{'$or':_[_0xf9b8('0x2d')](_0x4371b2[_0xf9b8('0x38')],function(_0x40ef8f){var _0x56e3e6={};_0x56e3e6[_0x40ef8f]={'$like':'%'+_0x4c1f43[_0xf9b8('0x34')]['filter']+'%'};return _0x56e3e6;})});}_0x4371b2=_[_0xf9b8('0x3f')]({},_0x4371b2,_0x4c1f43[_0xf9b8('0x41')]);return _0x5436a0[_0xf9b8('0x68')](_0x4371b2);}})[_0xf9b8('0x25')](respondWithResult(_0x25555f,null))[_0xf9b8('0x46')](handleError(_0x25555f,null));};exports['getContactsCsv']=function(_0x2e57c3,_0x35a8d8,_0x26e7de){var _0x15831e;return db['CmList'][_0xf9b8('0x51')]({'where':{'id':_0x2e57c3[_0xf9b8('0x53')]['id']},'include':[{'model':db[_0xf9b8('0x69')],'as':_0xf9b8('0x6b')}]})[_0xf9b8('0x25')](handleEntityNotFound(_0x35a8d8,null))[_0xf9b8('0x25')](function(_0x36a6f4){if(_0x36a6f4){_0x15831e=_0x36a6f4;return db['CmContact'][_0xf9b8('0x2f')];}})['then'](function(_0x4fc8db){if(_0x4fc8db){var _0x33fece={};var _0x2fb79d={};_0x2fb79d[_0xf9b8('0x33')]=_[_0xf9b8('0x6a')](_['keys'](_0x4fc8db),_[_0xf9b8('0x2d')](_0x15831e[_0xf9b8('0x6b')],function(_0x7041a5){return util[_0xf9b8('0x6c')](_0xf9b8('0x6d'),_0x7041a5['id']);}));_0x2fb79d['query']=_[_0xf9b8('0x35')](_0x2e57c3[_0xf9b8('0x34')]);_0x2fb79d[_0xf9b8('0x36')]=_[_0xf9b8('0x37')](_0x2fb79d[_0xf9b8('0x33')],_0x2fb79d['query']);_0x33fece[_0xf9b8('0x38')]=_[_0xf9b8('0x37')](_0x2fb79d['model'],qs[_0xf9b8('0x39')](_0x2e57c3[_0xf9b8('0x34')][_0xf9b8('0x39')]));_0x33fece[_0xf9b8('0x38')]=_0x33fece[_0xf9b8('0x38')][_0xf9b8('0x3a')]?_0x33fece[_0xf9b8('0x38')]:_0x2fb79d[_0xf9b8('0x33')];if(!_0x2e57c3['query']['hasOwnProperty']('nolimit')){_0x33fece['limit']=qs[_0xf9b8('0x20')](_0x2e57c3['query']['limit']);_0x33fece['offset']=qs['offset'](_0x2e57c3['query'][_0xf9b8('0x1f')]);}_0x33fece[_0xf9b8('0x5b')]=qs[_0xf9b8('0x3c')](_0x2e57c3['query'][_0xf9b8('0x3c')]);_0x33fece[_0xf9b8('0x3d')]=qs['filters'](_[_0xf9b8('0x3e')](_0x2e57c3[_0xf9b8('0x34')],_0x2fb79d[_0xf9b8('0x36')]));_0x33fece[_0xf9b8('0x6e')]=!![];if(_0x2e57c3[_0xf9b8('0x34')][_0xf9b8('0x5c')]){_0x33fece['where']=_[_0xf9b8('0x3f')](_0x33fece[_0xf9b8('0x3d')],{'$or':_[_0xf9b8('0x2d')](_0x33fece['attributes'],function(_0xe8fa4c){var _0x444803={};_0x444803[_0xe8fa4c]={'$like':'%'+_0x2e57c3[_0xf9b8('0x34')][_0xf9b8('0x5c')]+'%'};return _0x444803;})});}_0x33fece=_[_0xf9b8('0x3f')]({},_0x33fece,_0x2e57c3['options']);return _0x15831e['getContacts'](_0x33fece);}})[_0xf9b8('0x25')](function(_0x111212){if(!_[_0xf9b8('0x6f')](_0x111212)){var _0x1d26a3=toCsv(_0x111212);var _0x355605=Date['now']();fs[_0xf9b8('0x70')](util[_0xf9b8('0x6c')]('/tmp/list_%d_%s.csv',_0x15831e['id'],_0x355605),_0x1d26a3);_0x35a8d8[_0xf9b8('0x71')](_0xf9b8('0x72'),_0xf9b8('0x73')+util[_0xf9b8('0x6c')](_0xf9b8('0x74'),_0x15831e['id'],_0x355605));_0x35a8d8['setHeader'](_0xf9b8('0x75'),'text/csv');return _0x35a8d8[_0xf9b8('0x76')](util[_0xf9b8('0x6c')]('/tmp/list_%d_%s.csv',_0x15831e['id'],_0x355605));}else{return _0x35a8d8[_0xf9b8('0x27')](0xcc);}})[_0xf9b8('0x46')](handleError(_0x35a8d8,null));};exports[_0xf9b8('0x77')]=function(_0x24066c,_0x240498,_0x2154b5){var _0x52c8a8;delete _0x24066c['body']['id'];return db[_0xf9b8('0x2e')][_0xf9b8('0x58')]({'where':{'id':_0x24066c[_0xf9b8('0x53')]['id']}})[_0xf9b8('0x25')](handleEntityNotFound(_0x240498,null))[_0xf9b8('0x25')](function(_0x5e82f8){if(_0x5e82f8){return db[_0xf9b8('0x78')][_0xf9b8('0x79')](function(_0x28bff8){return db['CmCustomField'][_0xf9b8('0x48')](_0x24066c['body'],{'transaction':_0x28bff8})[_0xf9b8('0x25')](function(_0x4f2608){_0x52c8a8=_0x4f2608;return _0x5e82f8[_0xf9b8('0x7a')](_0x4f2608,{'transaction':_0x28bff8});})[_0xf9b8('0x25')](function(){var _0xfd5c38={'type':db[_0xf9b8('0x7b')][_0xf9b8('0x7c')],'transaction':_0x28bff8};switch(_0x24066c[_0xf9b8('0x49')][_0xf9b8('0x31')]){case'text':_0xfd5c38[_0xf9b8('0x31')]=db[_0xf9b8('0x7b')][_0xf9b8('0x7c')];break;case'number':_0xfd5c38[_0xf9b8('0x31')]=db[_0xf9b8('0x7b')][_0xf9b8('0x7d')];break;case _0xf9b8('0x7e'):_0xfd5c38['type']=db[_0xf9b8('0x7b')]['BOOLEAN'];_0xfd5c38[_0xf9b8('0x7f')]=![];break;default:}return db[_0xf9b8('0x78')][_0xf9b8('0x80')][_0xf9b8('0x81')](_0xf9b8('0x82'),util['format'](_0xf9b8('0x83'),_0x52c8a8['id']),_0xfd5c38);})['then'](function(){return _0x52c8a8;});});}})[_0xf9b8('0x25')](respondWithResult(_0x240498,null))[_0xf9b8('0x46')](handleError(_0x240498,null));};exports[_0xf9b8('0x84')]=function(_0x2e8239,_0x54ee0c,_0x362954){var _0x1c4e51={};var _0x3ead84={};var _0x11472c;var _0xd1b989;return db[_0xf9b8('0x2e')][_0xf9b8('0x58')]({'where':{'id':_0x2e8239['params']['id']}})[_0xf9b8('0x25')](handleEntityNotFound(_0x54ee0c,null))[_0xf9b8('0x25')](function(_0x35e129){if(_0x35e129){_0x11472c=_0x35e129;_0x3ead84[_0xf9b8('0x33')]=_['keys'](db[_0xf9b8('0x69')][_0xf9b8('0x2f')]);_0x3ead84[_0xf9b8('0x34')]=_[_0xf9b8('0x35')](_0x2e8239[_0xf9b8('0x34')]);_0x3ead84[_0xf9b8('0x36')]=_['intersection'](_0x3ead84[_0xf9b8('0x33')],_0x3ead84[_0xf9b8('0x34')]);_0x1c4e51[_0xf9b8('0x38')]=_['intersection'](_0x3ead84[_0xf9b8('0x33')],qs[_0xf9b8('0x39')](_0x2e8239[_0xf9b8('0x34')][_0xf9b8('0x39')]));_0x1c4e51[_0xf9b8('0x38')]=_0x1c4e51[_0xf9b8('0x38')][_0xf9b8('0x3a')]?_0x1c4e51[_0xf9b8('0x38')]:_0x3ead84[_0xf9b8('0x33')];_0x1c4e51[_0xf9b8('0x5b')]=qs['sort'](_0x2e8239[_0xf9b8('0x34')][_0xf9b8('0x3c')]);_0x1c4e51[_0xf9b8('0x3d')]=qs[_0xf9b8('0x36')](_[_0xf9b8('0x3e')](_0x2e8239[_0xf9b8('0x34')],_0x3ead84[_0xf9b8('0x36')]));_0x1c4e51[_0xf9b8('0x3d')]=_['merge'](_0x1c4e51[_0xf9b8('0x3d')],{'$or':[{'ListId':_0x35e129['id']},{'ListId':null}]});if(_0x2e8239[_0xf9b8('0x34')][_0xf9b8('0x5c')]){_0x1c4e51[_0xf9b8('0x3d')]=_[_0xf9b8('0x3f')](_0x1c4e51['where'],{'$or':_[_0xf9b8('0x2d')](_0x1c4e51['attributes'],function(_0xcd86b0){var _0x4be966={};_0x4be966[_0xcd86b0]={'$like':'%'+_0x2e8239[_0xf9b8('0x34')][_0xf9b8('0x5c')]+'%'};return _0x4be966;})});}_0x1c4e51=_['merge']({},_0x1c4e51,_0x2e8239[_0xf9b8('0x41')]);return db[_0xf9b8('0x69')][_0xf9b8('0x85')](_0x1c4e51);}})[_0xf9b8('0x25')](respondWithResult(_0x54ee0c,null))[_0xf9b8('0x46')](handleError(_0x54ee0c,null));};exports[_0xf9b8('0x86')]=function(_0x36e207,_0x3efce8,_0x266fc2){return db['CmList'][_0xf9b8('0x51')]({'where':{'id':_0x36e207['params']['id']}})[_0xf9b8('0x25')](handleEntityNotFound(_0x3efce8,null))[_0xf9b8('0x25')](function(_0x4734c2){if(_0x4734c2){return _0x4734c2['addAgents'](_0x36e207[_0xf9b8('0x49')][_0xf9b8('0x64')],_['omit'](_0x36e207['body'],[_0xf9b8('0x64'),'id'])||{})[_0xf9b8('0x87')](function(_0x20be76){for(var _0x35b1c9=0x0;_0x35b1c9<_0x36e207[_0xf9b8('0x49')][_0xf9b8('0x64')][_0xf9b8('0x3a')];_0x35b1c9+=0x1){socket[_0xf9b8('0x88')](_0xf9b8('0x89'),{'UserId':_0x36e207['body'][_0xf9b8('0x64')][_0x35b1c9],'CmListId':_0x36e207[_0xf9b8('0x53')]['id']});}return _0x20be76;});}})[_0xf9b8('0x25')](respondWithResult(_0x3efce8,null))[_0xf9b8('0x46')](handleError(_0x3efce8,null));};exports[_0xf9b8('0x8a')]=function(_0x4883fd,_0x397daa,_0x3bb8a6){return db['CmList'][_0xf9b8('0x51')]({'where':{'id':_0x4883fd[_0xf9b8('0x53')]['id']}})['then'](handleEntityNotFound(_0x397daa,null))[_0xf9b8('0x25')](function(_0x4896f5){if(_0x4896f5){return _0x4896f5[_0xf9b8('0x8a')](_0x4883fd[_0xf9b8('0x34')][_0xf9b8('0x64')])['then'](function(){if(_[_0xf9b8('0x60')](_0x4883fd[_0xf9b8('0x34')]['ids'])){for(var _0x196a63=0x0;_0x196a63<_0x4883fd[_0xf9b8('0x34')][_0xf9b8('0x64')]['length'];_0x196a63+=0x1){socket[_0xf9b8('0x88')](_0xf9b8('0x8b'),{'UserId':Number(_0x4883fd[_0xf9b8('0x34')][_0xf9b8('0x64')][_0x196a63]),'CmListId':Number(_0x4883fd[_0xf9b8('0x53')]['id'])});}}else{socket[_0xf9b8('0x88')]('userCmList:remove',{'UserId':Number(_0x4883fd[_0xf9b8('0x34')]['ids']),'CmListId':Number(_0x4883fd[_0xf9b8('0x53')]['id'])});}});}})[_0xf9b8('0x25')](respondWithStatusCode(_0x397daa,null))[_0xf9b8('0x46')](handleError(_0x397daa,null));};exports['getAgents']=function(_0x94bb8f,_0x327e3a,_0x410f1f){var _0x3272c9={};var _0x3d078b={};var _0x48254c;var _0x3a0b8e;return db['CmList'][_0xf9b8('0x58')]({'where':{'id':_0x94bb8f['params']['id']}})['then'](handleEntityNotFound(_0x327e3a,null))[_0xf9b8('0x25')](function(_0x5d2bf7){if(_0x5d2bf7){_0x48254c=_0x5d2bf7;_0x3d078b[_0xf9b8('0x33')]=_[_0xf9b8('0x35')](db[_0xf9b8('0x8c')][_0xf9b8('0x2f')]);_0x3d078b[_0xf9b8('0x34')]=_[_0xf9b8('0x35')](_0x94bb8f[_0xf9b8('0x34')]);_0x3d078b[_0xf9b8('0x36')]=_[_0xf9b8('0x37')](_0x3d078b[_0xf9b8('0x33')],_0x3d078b[_0xf9b8('0x34')]);_0x3272c9[_0xf9b8('0x38')]=_['intersection'](_0x3d078b[_0xf9b8('0x33')],qs[_0xf9b8('0x39')](_0x94bb8f[_0xf9b8('0x34')][_0xf9b8('0x39')]));_0x3272c9['attributes']=_0x3272c9[_0xf9b8('0x38')][_0xf9b8('0x3a')]?_0x3272c9[_0xf9b8('0x38')]:_0x3d078b[_0xf9b8('0x33')];_0x3272c9[_0xf9b8('0x5b')]=qs['sort'](_0x94bb8f[_0xf9b8('0x34')][_0xf9b8('0x3c')]);_0x3272c9[_0xf9b8('0x3d')]=qs[_0xf9b8('0x36')](_[_0xf9b8('0x3e')](_0x94bb8f[_0xf9b8('0x34')],_0x3d078b[_0xf9b8('0x36')]));if(_0x94bb8f[_0xf9b8('0x34')][_0xf9b8('0x5c')]){_0x3272c9[_0xf9b8('0x3d')]=_[_0xf9b8('0x3f')](_0x3272c9['where'],{'$or':_[_0xf9b8('0x2d')](_0x3272c9['attributes'],function(_0x2ffc11){var _0x49b323={};_0x49b323[_0x2ffc11]={'$like':'%'+_0x94bb8f[_0xf9b8('0x34')]['filter']+'%'};return _0x49b323;})});}_0x3272c9=_['merge']({},_0x3272c9,_0x94bb8f[_0xf9b8('0x41')]);return _0x48254c[_0xf9b8('0x8d')](_0x3272c9);}})[_0xf9b8('0x25')](function(_0x292d02){if(_0x292d02){_0x3a0b8e=_0x292d02['length'];if(!_0x94bb8f[_0xf9b8('0x34')][_0xf9b8('0x5a')](_0xf9b8('0x3b'))){_0x3272c9[_0xf9b8('0x20')]=qs[_0xf9b8('0x20')](_0x94bb8f[_0xf9b8('0x34')][_0xf9b8('0x20')]);_0x3272c9[_0xf9b8('0x1f')]=qs['offset'](_0x94bb8f[_0xf9b8('0x34')]['offset']);}return _0x48254c[_0xf9b8('0x8d')](_0x3272c9);}})[_0xf9b8('0x25')](function(_0x27d859){if(_0x27d859){return _0x27d859?{'count':_0x3a0b8e,'rows':_0x27d859}:null;}})[_0xf9b8('0x25')](respondWithResult(_0x327e3a,null))[_0xf9b8('0x46')](handleError(_0x327e3a,null));}; \ No newline at end of file +var _0xd165=['transaction','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','html-pdf','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','getDispositions','rawAttributes','length','include','removeDispositions','ids','CmContact','isArray','tags','join','push','each','omit','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','raw','getContactsCsv','format','now','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','findOne','sequelize'];(function(_0x4f0273,_0x458dfc){var _0x2185ed=function(_0x462ef7){while(--_0x462ef7){_0x4f0273['push'](_0x4f0273['shift']());}};_0x2185ed(++_0x458dfc);}(_0xd165,0x1ba));var _0x5d16=function(_0x447f83,_0x4805eb){_0x447f83=_0x447f83-0x0;var _0xf6a8f0=_0xd165[_0x447f83];return _0xf6a8f0;};'use strict';var pdf=require(_0x5d16('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5d16('0x1'));var moment=require('moment');var BPromise=require(_0x5d16('0x2'));var Mustache=require(_0x5d16('0x3'));var util=require('util');var path=require(_0x5d16('0x4'));var sox=require(_0x5d16('0x5'));var csv=require('to-csv');var ejs=require(_0x5d16('0x6'));var fs=require('fs');var _=require(_0x5d16('0x7'));var squel=require(_0x5d16('0x8'));var crypto=require('crypto');var jsforce=require(_0x5d16('0x9'));var deskjs=require(_0x5d16('0xa'));var toCsv=require(_0x5d16('0xb'));var querystring=require(_0x5d16('0xc'));var Papa=require(_0x5d16('0xd'));var Redis=require(_0x5d16('0xe'));var authService=require(_0x5d16('0xf'));var qs=require(_0x5d16('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d16('0x11'));var logger=require(_0x5d16('0x12'))(_0x5d16('0x13'));var utils=require('../../config/utils');var config=require(_0x5d16('0x14'));var db=require(_0x5d16('0x15'))['db'];config[_0x5d16('0x16')]=_[_0x5d16('0x17')](config[_0x5d16('0x16')],{'host':_0x5d16('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d16('0x16')]));require(_0x5d16('0x19'))[_0x5d16('0x1a')](socket);function respondWithStatusCode(_0x3fbecf,_0x43b405){_0x43b405=_0x43b405||0xcc;return function(_0x187d3b){if(_0x187d3b){return _0x3fbecf[_0x5d16('0x1b')](_0x43b405);}return _0x3fbecf[_0x5d16('0x1c')](_0x43b405)[_0x5d16('0x1d')]();};}function respondWithResult(_0x257eac,_0x49c0ab){_0x49c0ab=_0x49c0ab||0xc8;return function(_0xbf4d28){if(_0xbf4d28){return _0x257eac[_0x5d16('0x1c')](_0x49c0ab)[_0x5d16('0x1e')](_0xbf4d28);}};}function respondWithFilteredResult(_0x31e497,_0x44a8fd){return function(_0x3d4bf5){if(_0x3d4bf5){var _0x39a893=_0x3d4bf5[_0x5d16('0x1f')],_0x471e06=_0x44a8fd[_0x5d16('0x20')],_0x5b1a02=_0x44a8fd[_0x5d16('0x20')]+_0x44a8fd[_0x5d16('0x21')],_0xaf0b93;if(_0x5b1a02>=_0x39a893){_0x5b1a02=_0x39a893;_0xaf0b93=0xc8;}else{_0xaf0b93=0xce;}_0x31e497[_0x5d16('0x1c')](_0xaf0b93);return _0x31e497[_0x5d16('0x22')]('Content-Range',_0x471e06+'-'+_0x5b1a02+'/'+_0x39a893)['json'](_0x3d4bf5);}return null;};}function patchUpdates(_0x768b77){return function(_0x4b6281){try{jsonpatch[_0x5d16('0x23')](_0x4b6281,_0x768b77,!![]);}catch(_0x2dc1c1){return BPromise['reject'](_0x2dc1c1);}return _0x4b6281[_0x5d16('0x24')]();};}function saveUpdates(_0x2a3446,_0x5b0b3c){return function(_0x4d15ae){if(_0x4d15ae){return _0x4d15ae['update'](_0x2a3446)[_0x5d16('0x25')](function(_0x4a514b){return _0x4a514b;});}return null;};}function removeEntity(_0x4b7df9,_0x241ad6){return function(_0x4ca0f7){if(_0x4ca0f7){return _0x4ca0f7[_0x5d16('0x26')]()[_0x5d16('0x25')](function(){var _0x7c6815=_0x4ca0f7[_0x5d16('0x27')]({'plain':!![]});var _0x400556=_0x5d16('0x28');return db[_0x5d16('0x29')]['destroy']({'where':{'type':_0x400556,'resourceId':_0x7c6815['id']}})[_0x5d16('0x25')](function(){return _0x4ca0f7;});})[_0x5d16('0x25')](function(){_0x4b7df9[_0x5d16('0x1c')](0xcc)[_0x5d16('0x1d')]();});}};}function handleEntityNotFound(_0xe9da3b,_0x2702dc){return function(_0x2a36e9){if(!_0x2a36e9){_0xe9da3b['sendStatus'](0x194);}return _0x2a36e9;};}function handleError(_0x2f81ec,_0x4d5929){_0x4d5929=_0x4d5929||0x1f4;return function(_0x47bdae){logger[_0x5d16('0x2a')](_0x47bdae[_0x5d16('0x2b')]);if(_0x47bdae[_0x5d16('0x2c')]){delete _0x47bdae['name'];}_0x2f81ec['status'](_0x4d5929)[_0x5d16('0x2d')](_0x47bdae);};}exports[_0x5d16('0x2e')]=function(_0x48786a,_0x3c4a47){var _0x38bbbe={},_0x1c628d={},_0x1cb69c={'count':0x0,'rows':[]};var _0x4afe8f=_[_0x5d16('0x2f')](db[_0x5d16('0x30')]['rawAttributes'],function(_0x2274d1){return{'name':_0x2274d1[_0x5d16('0x31')],'type':_0x2274d1[_0x5d16('0x32')][_0x5d16('0x33')]};});_0x1c628d[_0x5d16('0x34')]=_[_0x5d16('0x2f')](_0x4afe8f,'name');_0x1c628d[_0x5d16('0x35')]=_[_0x5d16('0x36')](_0x48786a['query']);_0x1c628d[_0x5d16('0x37')]=_['intersection'](_0x1c628d[_0x5d16('0x34')],_0x1c628d[_0x5d16('0x35')]);_0x38bbbe[_0x5d16('0x38')]=_[_0x5d16('0x39')](_0x1c628d[_0x5d16('0x34')],qs[_0x5d16('0x3a')](_0x48786a[_0x5d16('0x35')]['fields']));_0x38bbbe['attributes']=_0x38bbbe[_0x5d16('0x38')]['length']?_0x38bbbe[_0x5d16('0x38')]:_0x1c628d[_0x5d16('0x34')];if(!_0x48786a[_0x5d16('0x35')][_0x5d16('0x3b')](_0x5d16('0x3c'))){_0x38bbbe[_0x5d16('0x21')]=qs['limit'](_0x48786a[_0x5d16('0x35')][_0x5d16('0x21')]);_0x38bbbe[_0x5d16('0x20')]=qs['offset'](_0x48786a[_0x5d16('0x35')][_0x5d16('0x20')]);}_0x38bbbe[_0x5d16('0x3d')]=qs[_0x5d16('0x3e')](_0x48786a[_0x5d16('0x35')][_0x5d16('0x3e')]);_0x38bbbe[_0x5d16('0x3f')]=qs['filters'](_[_0x5d16('0x40')](_0x48786a[_0x5d16('0x35')],_0x1c628d[_0x5d16('0x37')]));if(_0x48786a['query'][_0x5d16('0x41')]){_0x38bbbe[_0x5d16('0x3f')]=_[_0x5d16('0x42')](_0x38bbbe[_0x5d16('0x3f')],{'$or':_[_0x5d16('0x2f')](_0x4afe8f,function(_0x3c7ff5){if(_0x3c7ff5[_0x5d16('0x32')]!==_0x5d16('0x43')){var _0x5069a3={};_0x5069a3[_0x3c7ff5[_0x5d16('0x2c')]]={'$like':'%'+_0x48786a[_0x5d16('0x35')]['filter']+'%'};return _0x5069a3;}})});}_0x38bbbe=_[_0x5d16('0x42')]({},_0x38bbbe,_0x48786a[_0x5d16('0x44')]);var _0x4bd519={'where':_0x38bbbe[_0x5d16('0x3f')]};return db['CmList'][_0x5d16('0x1f')](_0x4bd519)[_0x5d16('0x25')](function(_0x5a4e58){_0x1cb69c[_0x5d16('0x1f')]=_0x5a4e58;if(_0x48786a[_0x5d16('0x35')][_0x5d16('0x45')]){_0x38bbbe['include']=[{'all':!![]}];}return db['CmList'][_0x5d16('0x46')](_0x38bbbe);})[_0x5d16('0x25')](function(_0x597862){_0x1cb69c[_0x5d16('0x47')]=_0x597862;return _0x1cb69c;})[_0x5d16('0x25')](respondWithFilteredResult(_0x3c4a47,_0x38bbbe))['catch'](handleError(_0x3c4a47,null));};exports['show']=function(_0x3ca4e8,_0x1e1407){var _0x32625b={'raw':![],'where':{'id':_0x3ca4e8[_0x5d16('0x48')]['id']}},_0x41cf55={};_0x41cf55[_0x5d16('0x34')]=_[_0x5d16('0x36')](db[_0x5d16('0x30')]['rawAttributes']);_0x41cf55[_0x5d16('0x35')]=_[_0x5d16('0x36')](_0x3ca4e8[_0x5d16('0x35')]);_0x41cf55[_0x5d16('0x37')]=_[_0x5d16('0x39')](_0x41cf55[_0x5d16('0x34')],_0x41cf55[_0x5d16('0x35')]);_0x32625b[_0x5d16('0x38')]=_[_0x5d16('0x39')](_0x41cf55[_0x5d16('0x34')],qs[_0x5d16('0x3a')](_0x3ca4e8['query'][_0x5d16('0x3a')]));_0x32625b[_0x5d16('0x38')]=_0x32625b[_0x5d16('0x38')]['length']?_0x32625b[_0x5d16('0x38')]:_0x41cf55[_0x5d16('0x34')];if(_0x3ca4e8[_0x5d16('0x35')][_0x5d16('0x45')]){_0x32625b['include']=[{'all':!![]}];}_0x32625b=_[_0x5d16('0x42')]({},_0x32625b,_0x3ca4e8['options']);return db['CmList'][_0x5d16('0x49')](_0x32625b)[_0x5d16('0x25')](handleEntityNotFound(_0x1e1407,null))[_0x5d16('0x25')](respondWithResult(_0x1e1407,null))[_0x5d16('0x4a')](handleError(_0x1e1407,null));};exports[_0x5d16('0x4b')]=function(_0x733854,_0x5826da){return db[_0x5d16('0x30')]['create'](_0x733854[_0x5d16('0x4c')],{})[_0x5d16('0x25')](function(_0x3d7396){var _0x370596=_0x733854[_0x5d16('0x4d')]['get']({'plain':!![]});if(!_0x370596)throw new Error(_0x5d16('0x4e'));if(_0x370596[_0x5d16('0x4f')]===_0x5d16('0x4d')){var _0x757553=_0x3d7396[_0x5d16('0x27')]({'plain':!![]});var _0x48a9a6=_0x5d16('0x28');return db[_0x5d16('0x50')][_0x5d16('0x49')]({'where':{'name':_0x48a9a6,'userProfileId':_0x370596['userProfileId']},'raw':!![]})['then'](function(_0x287002){if(_0x287002&&_0x287002[_0x5d16('0x51')]===0x0){return db[_0x5d16('0x29')][_0x5d16('0x4b')]({'name':_0x757553[_0x5d16('0x2c')],'resourceId':_0x757553['id'],'type':_0x287002['name'],'sectionId':_0x287002['id']},{})['then'](function(){return _0x3d7396;});}else{return _0x3d7396;}})['catch'](function(_0x1e6c6a){logger[_0x5d16('0x2a')](_0x5d16('0x52'),_0x1e6c6a);throw _0x1e6c6a;});}return _0x3d7396;})[_0x5d16('0x25')](respondWithResult(_0x5826da,0xc9))[_0x5d16('0x4a')](handleError(_0x5826da,null));};exports[_0x5d16('0x53')]=function(_0x47d74f,_0x186d60){if(_0x47d74f[_0x5d16('0x4c')]['id']){delete _0x47d74f[_0x5d16('0x4c')]['id'];}return db[_0x5d16('0x30')][_0x5d16('0x49')]({'where':{'id':_0x47d74f['params']['id']}})['then'](handleEntityNotFound(_0x186d60,null))[_0x5d16('0x25')](saveUpdates(_0x47d74f[_0x5d16('0x4c')],null))[_0x5d16('0x25')](respondWithResult(_0x186d60,null))['catch'](handleError(_0x186d60,null));};exports[_0x5d16('0x26')]=function(_0x32053c,_0xcae3f9){return db[_0x5d16('0x30')][_0x5d16('0x49')]({'where':{'id':_0x32053c[_0x5d16('0x48')]['id']}})['then'](handleEntityNotFound(_0xcae3f9,null))[_0x5d16('0x25')](removeEntity(_0xcae3f9,null))[_0x5d16('0x4a')](handleError(_0xcae3f9,null));};exports[_0x5d16('0x54')]=function(_0xf77dce,_0x5db526){return db[_0x5d16('0x30')]['describe']()[_0x5d16('0x25')](respondWithResult(_0x5db526,null))[_0x5d16('0x4a')](handleError(_0x5db526,null));};exports[_0x5d16('0x55')]=function(_0x39fe1f,_0x2b8e4a,_0xfdc896){if(_0x39fe1f[_0x5d16('0x4c')]['id']){delete _0x39fe1f[_0x5d16('0x4c')]['id'];}return db[_0x5d16('0x30')][_0x5d16('0x49')]({'where':{'id':_0x39fe1f['params']['id']}})[_0x5d16('0x25')](handleEntityNotFound(_0x2b8e4a,null))[_0x5d16('0x25')](function(_0x20966a){if(_0x20966a){_0x39fe1f[_0x5d16('0x4c')][_0x5d16('0x56')]=_0x20966a['id'];return db[_0x5d16('0x57')][_0x5d16('0x4b')](_0x39fe1f[_0x5d16('0x4c')]);}})[_0x5d16('0x25')](respondWithResult(_0x2b8e4a,null))[_0x5d16('0x4a')](handleError(_0x2b8e4a,null));};exports[_0x5d16('0x58')]=function(_0x5063a8,_0x5f4b80,_0x4a7232){var _0xa05389={'raw':![],'where':{}};var _0x56a92f={};var _0xb5d532={'count':0x0,'rows':[]};return db[_0x5d16('0x30')]['findOne']({'where':{'id':_0x5063a8['params']['id']}})[_0x5d16('0x25')](handleEntityNotFound(_0x5f4b80,null))[_0x5d16('0x25')](function(_0x20c3fa){if(_0x20c3fa){_0x56a92f[_0x5d16('0x34')]=_[_0x5d16('0x36')](db[_0x5d16('0x57')][_0x5d16('0x59')]);_0x56a92f['query']=_[_0x5d16('0x36')](_0x5063a8['query']);_0x56a92f['filters']=_[_0x5d16('0x39')](_0x56a92f[_0x5d16('0x34')],_0x56a92f[_0x5d16('0x35')]);_0xa05389[_0x5d16('0x38')]=_[_0x5d16('0x39')](_0x56a92f['model'],qs[_0x5d16('0x3a')](_0x5063a8[_0x5d16('0x35')]['fields']));_0xa05389[_0x5d16('0x38')]=_0xa05389[_0x5d16('0x38')][_0x5d16('0x5a')]?_0xa05389[_0x5d16('0x38')]:_0x56a92f[_0x5d16('0x34')];if(!_0x5063a8[_0x5d16('0x35')][_0x5d16('0x3b')](_0x5d16('0x3c'))){_0xa05389[_0x5d16('0x21')]=qs[_0x5d16('0x21')](_0x5063a8[_0x5d16('0x35')][_0x5d16('0x21')]);_0xa05389['offset']=qs[_0x5d16('0x20')](_0x5063a8['query'][_0x5d16('0x20')]);}_0xa05389[_0x5d16('0x3d')]=qs[_0x5d16('0x3e')](_0x5063a8['query']['sort']);_0xa05389['where']=qs[_0x5d16('0x37')](_[_0x5d16('0x40')](_0x5063a8[_0x5d16('0x35')],_0x56a92f[_0x5d16('0x37')]));_0xa05389['where'][_0x5d16('0x56')]=_0x20c3fa['id'];if(_0x5063a8['query'][_0x5d16('0x41')]){_0xa05389['where']=_[_0x5d16('0x42')](_0xa05389[_0x5d16('0x3f')],{'$or':_[_0x5d16('0x2f')](_0xa05389['attributes'],function(_0xa497b2){var _0x295b80={};_0x295b80[_0xa497b2]={'$like':'%'+_0x5063a8[_0x5d16('0x35')][_0x5d16('0x41')]+'%'};return _0x295b80;})});}_0xa05389=_[_0x5d16('0x42')]({},_0xa05389,_0x5063a8[_0x5d16('0x44')]);return db['Disposition'][_0x5d16('0x1f')]({'where':_0xa05389['where']})['then'](function(_0x226d5c){_0xb5d532['count']=_0x226d5c;if(_0x5063a8['query'][_0x5d16('0x45')]){_0xa05389[_0x5d16('0x5b')]=[{'all':!![]}];}return db[_0x5d16('0x57')]['findAll'](_0xa05389);})[_0x5d16('0x25')](function(_0xb88e82){_0xb5d532[_0x5d16('0x47')]=_0xb88e82;return _0xb5d532;});}})['then'](respondWithFilteredResult(_0x5f4b80,_0xa05389))[_0x5d16('0x4a')](handleError(_0x5f4b80,null));};exports['removeDispositions']=function(_0x2efbd9,_0x357b8b,_0x3d259e){return db['CmList'][_0x5d16('0x49')]({'where':{'id':_0x2efbd9[_0x5d16('0x48')]['id']}})['then'](handleEntityNotFound(_0x357b8b,null))['then'](function(_0x4dcc84){if(_0x4dcc84){return _0x4dcc84[_0x5d16('0x5c')](_0x2efbd9[_0x5d16('0x35')][_0x5d16('0x5d')]);}})[_0x5d16('0x25')](respondWithStatusCode(_0x357b8b,null))[_0x5d16('0x4a')](handleError(_0x357b8b,null));};exports['addContacts']=function(_0x1ad972,_0x565f7a,_0x5b77e6){return db[_0x5d16('0x30')]['find']({'where':{'id':_0x1ad972[_0x5d16('0x48')]['id']}})[_0x5d16('0x25')](handleEntityNotFound(_0x565f7a,null))['then'](function(_0x2bd0f2){if(_0x2bd0f2){var _0x5b560d=[];var _0xadd67f={'success':[],'errors':[]};return db[_0x5d16('0x5e')][_0x5d16('0x54')]()['then'](function(_0xad8ad9){if(_0x1ad972[_0x5d16('0x4c')]['tags']&&_[_0x5d16('0x5f')](_0x1ad972[_0x5d16('0x4c')][_0x5d16('0x60')])){if(_0x1ad972[_0x5d16('0x4c')]['tags'][_0x5d16('0x5a')]){_0x1ad972[_0x5d16('0x4c')][_0x5d16('0x60')]=_0x1ad972[_0x5d16('0x4c')][_0x5d16('0x60')][_0x5d16('0x61')](';')+';';}else{_0x1ad972[_0x5d16('0x4c')][_0x5d16('0x60')]=null;}}else{_0x1ad972['body'][_0x5d16('0x60')]=null;}if(_0x1ad972[_0x5d16('0x4c')]&&_['isArray'](_0x1ad972['body'])){for(var _0x604d8=0x0;_0x604d8<_0x1ad972[_0x5d16('0x4c')]['length'];_0x604d8+=0x1){_0x1ad972[_0x5d16('0x4c')][_0x604d8][_0x5d16('0x56')]=_0x1ad972[_0x5d16('0x48')]['id'];_0x5b560d[_0x5d16('0x62')](_0x1ad972[_0x5d16('0x4c')][_0x604d8]);}return BPromise[_0x5d16('0x63')](_0x5b560d,function(_0x4f8d82){return db[_0x5d16('0x5e')]['create'](_[_0x5d16('0x64')](_0x4f8d82,[_0x5d16('0x5d'),'id'])||{},{'fields':_[_0x5d16('0x36')](_0xad8ad9),'raw':!![]})[_0x5d16('0x25')](function(_0x5cff5a){_0xadd67f['success'][_0x5d16('0x62')](_0x5cff5a['dataValues']);})['catch'](function(_0x506f7a){_0xadd67f[_0x5d16('0x65')][_0x5d16('0x62')]({'data':_0x4f8d82,'error':_0x506f7a[_0x5d16('0x66')]});});})[_0x5d16('0x25')](function(_0x2b2d36){return _0xadd67f;})[_0x5d16('0x4a')](function(_0x4e7770){return _0x4e7770;});}else{_0x565f7a[_0x5d16('0x1c')](0x190)['json']({'message':_0x5d16('0x67')});}});}})['then'](respondWithResult(_0x565f7a,null))['catch'](handleError(_0x565f7a,null));};exports[_0x5d16('0x68')]=function(_0x5dbde5,_0x2102cc,_0x5a0d27){var _0x5497e0;return db[_0x5d16('0x30')][_0x5d16('0x49')]({'where':{'id':_0x5dbde5[_0x5d16('0x48')]['id']},'include':[{'model':db[_0x5d16('0x69')],'as':_0x5d16('0x6a')}]})['then'](handleEntityNotFound(_0x2102cc,null))[_0x5d16('0x25')](function(_0x17b92b){if(_0x17b92b){_0x5497e0=_0x17b92b;return db[_0x5d16('0x5e')][_0x5d16('0x59')];}})[_0x5d16('0x25')](function(_0x2e49ba){if(_0x2e49ba){var _0x4f6d45={};var _0x281385={};_0x281385[_0x5d16('0x34')]=_[_0x5d16('0x6b')](_[_0x5d16('0x36')](_0x2e49ba),_[_0x5d16('0x2f')](_0x5497e0['CustomFields'],function(_0x3ddf27){return util['format']('cf_%d',_0x3ddf27['id']);}));_0x281385[_0x5d16('0x35')]=_[_0x5d16('0x36')](_0x5dbde5[_0x5d16('0x35')]);_0x281385['filters']=_[_0x5d16('0x39')](_0x281385[_0x5d16('0x34')],_0x281385[_0x5d16('0x35')]);_0x4f6d45[_0x5d16('0x38')]=_[_0x5d16('0x39')](_0x281385['model'],qs[_0x5d16('0x3a')](_0x5dbde5[_0x5d16('0x35')][_0x5d16('0x3a')]));_0x4f6d45[_0x5d16('0x38')]=_0x4f6d45['attributes'][_0x5d16('0x5a')]?_0x4f6d45[_0x5d16('0x38')]:_0x281385[_0x5d16('0x34')];if(!_0x5dbde5[_0x5d16('0x35')][_0x5d16('0x3b')](_0x5d16('0x3c'))){_0x4f6d45[_0x5d16('0x21')]=qs[_0x5d16('0x21')](_0x5dbde5[_0x5d16('0x35')][_0x5d16('0x21')]);_0x4f6d45['offset']=qs[_0x5d16('0x20')](_0x5dbde5[_0x5d16('0x35')][_0x5d16('0x20')]);}_0x4f6d45[_0x5d16('0x3d')]=qs[_0x5d16('0x3e')](_0x5dbde5['query'][_0x5d16('0x3e')]);_0x4f6d45['where']=qs[_0x5d16('0x37')](_[_0x5d16('0x40')](_0x5dbde5['query'],_0x281385[_0x5d16('0x37')]));_0x4f6d45[_0x5d16('0x6c')]=!![];if(_0x5dbde5[_0x5d16('0x35')][_0x5d16('0x41')]){_0x4f6d45['where']=_['merge'](_0x4f6d45['where'],{'$or':_[_0x5d16('0x2f')](_0x4f6d45[_0x5d16('0x38')],function(_0x12ae7f){var _0x41b08e={};_0x41b08e[_0x12ae7f]={'$like':'%'+_0x5dbde5['query']['filter']+'%'};return _0x41b08e;})});}_0x4f6d45=_['merge']({},_0x4f6d45,_0x5dbde5[_0x5d16('0x44')]);return _0x5497e0[_0x5d16('0x68')](_0x4f6d45);}})[_0x5d16('0x25')](respondWithResult(_0x2102cc,null))[_0x5d16('0x4a')](handleError(_0x2102cc,null));};exports[_0x5d16('0x6d')]=function(_0x5ea85f,_0x3bbd5d,_0x3f5fbb){var _0x23af1b;return db[_0x5d16('0x30')][_0x5d16('0x49')]({'where':{'id':_0x5ea85f[_0x5d16('0x48')]['id']},'include':[{'model':db[_0x5d16('0x69')],'as':_0x5d16('0x6a')}]})[_0x5d16('0x25')](handleEntityNotFound(_0x3bbd5d,null))['then'](function(_0x41ffc1){if(_0x41ffc1){_0x23af1b=_0x41ffc1;return db[_0x5d16('0x5e')][_0x5d16('0x59')];}})[_0x5d16('0x25')](function(_0x41ea1e){if(_0x41ea1e){var _0x3722c2={};var _0x5e980b={};_0x5e980b[_0x5d16('0x34')]=_[_0x5d16('0x6b')](_[_0x5d16('0x36')](_0x41ea1e),_[_0x5d16('0x2f')](_0x23af1b[_0x5d16('0x6a')],function(_0x3d7264){return util[_0x5d16('0x6e')]('cf_%d',_0x3d7264['id']);}));_0x5e980b['query']=_[_0x5d16('0x36')](_0x5ea85f[_0x5d16('0x35')]);_0x5e980b[_0x5d16('0x37')]=_[_0x5d16('0x39')](_0x5e980b['model'],_0x5e980b['query']);_0x3722c2[_0x5d16('0x38')]=_[_0x5d16('0x39')](_0x5e980b[_0x5d16('0x34')],qs[_0x5d16('0x3a')](_0x5ea85f[_0x5d16('0x35')][_0x5d16('0x3a')]));_0x3722c2[_0x5d16('0x38')]=_0x3722c2[_0x5d16('0x38')][_0x5d16('0x5a')]?_0x3722c2[_0x5d16('0x38')]:_0x5e980b[_0x5d16('0x34')];if(!_0x5ea85f[_0x5d16('0x35')][_0x5d16('0x3b')](_0x5d16('0x3c'))){_0x3722c2[_0x5d16('0x21')]=qs[_0x5d16('0x21')](_0x5ea85f[_0x5d16('0x35')][_0x5d16('0x21')]);_0x3722c2[_0x5d16('0x20')]=qs[_0x5d16('0x20')](_0x5ea85f['query'][_0x5d16('0x20')]);}_0x3722c2['order']=qs['sort'](_0x5ea85f['query'][_0x5d16('0x3e')]);_0x3722c2[_0x5d16('0x3f')]=qs['filters'](_[_0x5d16('0x40')](_0x5ea85f['query'],_0x5e980b[_0x5d16('0x37')]));_0x3722c2['raw']=!![];if(_0x5ea85f['query'][_0x5d16('0x41')]){_0x3722c2[_0x5d16('0x3f')]=_[_0x5d16('0x42')](_0x3722c2['where'],{'$or':_[_0x5d16('0x2f')](_0x3722c2[_0x5d16('0x38')],function(_0x1359ca){var _0x377c84={};_0x377c84[_0x1359ca]={'$like':'%'+_0x5ea85f['query']['filter']+'%'};return _0x377c84;})});}_0x3722c2=_[_0x5d16('0x42')]({},_0x3722c2,_0x5ea85f['options']);return _0x23af1b[_0x5d16('0x68')](_0x3722c2);}})[_0x5d16('0x25')](function(_0x7aef66){if(!_['isEmpty'](_0x7aef66)){var _0x9805a2=toCsv(_0x7aef66);var _0x476f86=Date[_0x5d16('0x6f')]();fs['writeFileSync'](util[_0x5d16('0x6e')]('/tmp/list_%d_%s.csv',_0x23af1b['id'],_0x476f86),_0x9805a2);_0x3bbd5d[_0x5d16('0x70')](_0x5d16('0x71'),_0x5d16('0x72')+util[_0x5d16('0x6e')](_0x5d16('0x73'),_0x23af1b['id'],_0x476f86));_0x3bbd5d[_0x5d16('0x70')](_0x5d16('0x74'),'text/csv');return _0x3bbd5d[_0x5d16('0x75')](util[_0x5d16('0x6e')](_0x5d16('0x76'),_0x23af1b['id'],_0x476f86));}else{return _0x3bbd5d[_0x5d16('0x1b')](0xcc);}})[_0x5d16('0x4a')](handleError(_0x3bbd5d,null));};exports[_0x5d16('0x77')]=function(_0x1a960,_0x441447,_0x298b9d){var _0x4d9a5b;delete _0x1a960[_0x5d16('0x4c')]['id'];return db[_0x5d16('0x30')][_0x5d16('0x78')]({'where':{'id':_0x1a960[_0x5d16('0x48')]['id']}})[_0x5d16('0x25')](handleEntityNotFound(_0x441447,null))[_0x5d16('0x25')](function(_0x59f7f9){if(_0x59f7f9){return db[_0x5d16('0x79')][_0x5d16('0x7a')](function(_0x5254bc){return db[_0x5d16('0x69')][_0x5d16('0x4b')](_0x1a960['body'],{'transaction':_0x5254bc})[_0x5d16('0x25')](function(_0x994368){_0x4d9a5b=_0x994368;return _0x59f7f9[_0x5d16('0x7b')](_0x994368,{'transaction':_0x5254bc});})[_0x5d16('0x25')](function(){var _0x5dc515={'type':db['Sequelize'][_0x5d16('0x7c')],'transaction':_0x5254bc};switch(_0x1a960[_0x5d16('0x4c')]['type']){case _0x5d16('0x7d'):_0x5dc515[_0x5d16('0x32')]=db[_0x5d16('0x7e')][_0x5d16('0x7c')];break;case'number':_0x5dc515[_0x5d16('0x32')]=db['Sequelize'][_0x5d16('0x7f')];break;case _0x5d16('0x80'):_0x5dc515[_0x5d16('0x32')]=db[_0x5d16('0x7e')][_0x5d16('0x81')];_0x5dc515[_0x5d16('0x82')]=![];break;default:}return db[_0x5d16('0x79')][_0x5d16('0x83')]['addColumn'](_0x5d16('0x84'),util[_0x5d16('0x6e')](_0x5d16('0x85'),_0x4d9a5b['id']),_0x5dc515);})[_0x5d16('0x25')](function(){return _0x4d9a5b;});});}})[_0x5d16('0x25')](respondWithResult(_0x441447,null))[_0x5d16('0x4a')](handleError(_0x441447,null));};exports['getCustomFields']=function(_0x36f030,_0x34aa0b,_0x58e7a3){var _0x9ec48f={};var _0x42d788={};var _0x1d23ad;var _0x1234fd;return db[_0x5d16('0x30')]['findOne']({'where':{'id':_0x36f030[_0x5d16('0x48')]['id']}})[_0x5d16('0x25')](handleEntityNotFound(_0x34aa0b,null))[_0x5d16('0x25')](function(_0x2aefaa){if(_0x2aefaa){_0x1d23ad=_0x2aefaa;_0x42d788[_0x5d16('0x34')]=_[_0x5d16('0x36')](db[_0x5d16('0x69')][_0x5d16('0x59')]);_0x42d788[_0x5d16('0x35')]=_['keys'](_0x36f030[_0x5d16('0x35')]);_0x42d788[_0x5d16('0x37')]=_[_0x5d16('0x39')](_0x42d788[_0x5d16('0x34')],_0x42d788[_0x5d16('0x35')]);_0x9ec48f['attributes']=_[_0x5d16('0x39')](_0x42d788[_0x5d16('0x34')],qs[_0x5d16('0x3a')](_0x36f030[_0x5d16('0x35')][_0x5d16('0x3a')]));_0x9ec48f[_0x5d16('0x38')]=_0x9ec48f[_0x5d16('0x38')][_0x5d16('0x5a')]?_0x9ec48f[_0x5d16('0x38')]:_0x42d788['model'];_0x9ec48f['order']=qs[_0x5d16('0x3e')](_0x36f030[_0x5d16('0x35')]['sort']);_0x9ec48f['where']=qs[_0x5d16('0x37')](_['pick'](_0x36f030['query'],_0x42d788[_0x5d16('0x37')]));_0x9ec48f[_0x5d16('0x3f')]=_[_0x5d16('0x42')](_0x9ec48f['where'],{'$or':[{'ListId':_0x2aefaa['id']},{'ListId':null}]});if(_0x36f030['query'][_0x5d16('0x41')]){_0x9ec48f[_0x5d16('0x3f')]=_[_0x5d16('0x42')](_0x9ec48f[_0x5d16('0x3f')],{'$or':_[_0x5d16('0x2f')](_0x9ec48f[_0x5d16('0x38')],function(_0x1ecb02){var _0x1ee219={};_0x1ee219[_0x1ecb02]={'$like':'%'+_0x36f030[_0x5d16('0x35')][_0x5d16('0x41')]+'%'};return _0x1ee219;})});}_0x9ec48f=_[_0x5d16('0x42')]({},_0x9ec48f,_0x36f030[_0x5d16('0x44')]);return db[_0x5d16('0x69')][_0x5d16('0x86')](_0x9ec48f);}})['then'](respondWithResult(_0x34aa0b,null))['catch'](handleError(_0x34aa0b,null));};exports[_0x5d16('0x87')]=function(_0x45c66d,_0x1b76ed,_0x3db1a2){return db[_0x5d16('0x30')][_0x5d16('0x49')]({'where':{'id':_0x45c66d['params']['id']}})[_0x5d16('0x25')](handleEntityNotFound(_0x1b76ed,null))[_0x5d16('0x25')](function(_0x2f5370){if(_0x2f5370){return _0x2f5370[_0x5d16('0x87')](_0x45c66d[_0x5d16('0x4c')][_0x5d16('0x5d')],_[_0x5d16('0x64')](_0x45c66d[_0x5d16('0x4c')],[_0x5d16('0x5d'),'id'])||{})[_0x5d16('0x88')](function(_0x5747a7){for(var _0x3863f6=0x0;_0x3863f6<_0x45c66d['body'][_0x5d16('0x5d')][_0x5d16('0x5a')];_0x3863f6+=0x1){socket[_0x5d16('0x89')]('userCmList:save',{'UserId':_0x45c66d[_0x5d16('0x4c')][_0x5d16('0x5d')][_0x3863f6],'CmListId':_0x45c66d[_0x5d16('0x48')]['id']});}return _0x5747a7;});}})[_0x5d16('0x25')](respondWithResult(_0x1b76ed,null))[_0x5d16('0x4a')](handleError(_0x1b76ed,null));};exports[_0x5d16('0x8a')]=function(_0x5bf59c,_0x4d3272,_0x4f5225){return db[_0x5d16('0x30')][_0x5d16('0x49')]({'where':{'id':_0x5bf59c[_0x5d16('0x48')]['id']}})[_0x5d16('0x25')](handleEntityNotFound(_0x4d3272,null))[_0x5d16('0x25')](function(_0x387b98){if(_0x387b98){return _0x387b98[_0x5d16('0x8a')](_0x5bf59c['query'][_0x5d16('0x5d')])[_0x5d16('0x25')](function(){if(_[_0x5d16('0x5f')](_0x5bf59c[_0x5d16('0x35')][_0x5d16('0x5d')])){for(var _0x36edb9=0x0;_0x36edb9<_0x5bf59c[_0x5d16('0x35')][_0x5d16('0x5d')]['length'];_0x36edb9+=0x1){socket[_0x5d16('0x89')](_0x5d16('0x8b'),{'UserId':Number(_0x5bf59c[_0x5d16('0x35')]['ids'][_0x36edb9]),'CmListId':Number(_0x5bf59c[_0x5d16('0x48')]['id'])});}}else{socket[_0x5d16('0x89')](_0x5d16('0x8b'),{'UserId':Number(_0x5bf59c[_0x5d16('0x35')]['ids']),'CmListId':Number(_0x5bf59c['params']['id'])});}});}})[_0x5d16('0x25')](respondWithStatusCode(_0x4d3272,null))[_0x5d16('0x4a')](handleError(_0x4d3272,null));};exports[_0x5d16('0x8c')]=function(_0x139b82,_0x3458d8,_0x141285){var _0x4a78c2={};var _0x16c0db={};var _0x1a342c;var _0x2d0a80;return db[_0x5d16('0x30')][_0x5d16('0x78')]({'where':{'id':_0x139b82[_0x5d16('0x48')]['id']}})[_0x5d16('0x25')](handleEntityNotFound(_0x3458d8,null))[_0x5d16('0x25')](function(_0x4515af){if(_0x4515af){_0x1a342c=_0x4515af;_0x16c0db[_0x5d16('0x34')]=_['keys'](db['User'][_0x5d16('0x59')]);_0x16c0db[_0x5d16('0x35')]=_['keys'](_0x139b82['query']);_0x16c0db[_0x5d16('0x37')]=_['intersection'](_0x16c0db[_0x5d16('0x34')],_0x16c0db[_0x5d16('0x35')]);_0x4a78c2['attributes']=_['intersection'](_0x16c0db[_0x5d16('0x34')],qs['fields'](_0x139b82[_0x5d16('0x35')][_0x5d16('0x3a')]));_0x4a78c2[_0x5d16('0x38')]=_0x4a78c2[_0x5d16('0x38')][_0x5d16('0x5a')]?_0x4a78c2['attributes']:_0x16c0db['model'];_0x4a78c2[_0x5d16('0x3d')]=qs[_0x5d16('0x3e')](_0x139b82['query']['sort']);_0x4a78c2[_0x5d16('0x3f')]=qs['filters'](_[_0x5d16('0x40')](_0x139b82[_0x5d16('0x35')],_0x16c0db['filters']));if(_0x139b82[_0x5d16('0x35')]['filter']){_0x4a78c2['where']=_[_0x5d16('0x42')](_0x4a78c2[_0x5d16('0x3f')],{'$or':_['map'](_0x4a78c2[_0x5d16('0x38')],function(_0x30a5ba){var _0x33050e={};_0x33050e[_0x30a5ba]={'$like':'%'+_0x139b82[_0x5d16('0x35')][_0x5d16('0x41')]+'%'};return _0x33050e;})});}_0x4a78c2=_[_0x5d16('0x42')]({},_0x4a78c2,_0x139b82['options']);return _0x1a342c['getAgents'](_0x4a78c2);}})['then'](function(_0x5465e8){if(_0x5465e8){_0x2d0a80=_0x5465e8[_0x5d16('0x5a')];if(!_0x139b82['query'][_0x5d16('0x3b')](_0x5d16('0x3c'))){_0x4a78c2['limit']=qs[_0x5d16('0x21')](_0x139b82[_0x5d16('0x35')][_0x5d16('0x21')]);_0x4a78c2['offset']=qs['offset'](_0x139b82[_0x5d16('0x35')]['offset']);}return _0x1a342c[_0x5d16('0x8c')](_0x4a78c2);}})[_0x5d16('0x25')](function(_0x5a77ea){if(_0x5a77ea){return _0x5a77ea?{'count':_0x2d0a80,'rows':_0x5a77ea}:null;}})[_0x5d16('0x25')](respondWithResult(_0x3458d8,null))['catch'](handleError(_0x3458d8,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5f1e324..7e97a04 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2873=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x23c659,_0x3feee2){var _0x2124db=function(_0x1203f7){while(--_0x1203f7){_0x23c659['push'](_0x23c659['shift']());}};_0x2124db(++_0x3feee2);}(_0x2873,0x168));var _0x3287=function(_0x25424e,_0x335ffe){_0x25424e=_0x25424e-0x0;var _0x3b9363=_0x2873[_0x25424e];return _0x3b9363;};'use strict';var EventEmitter=require(_0x3287('0x0'));var CmList=require(_0x3287('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3287('0x2'),'afterDestroy':_0x3287('0x3')};function emitEvent(_0x1d083c){return function(_0x5c311e,_0x2222c3,_0x38e92e){CmListEvents[_0x3287('0x4')](_0x1d083c+':'+_0x5c311e['id'],_0x5c311e);CmListEvents[_0x3287('0x4')](_0x1d083c,_0x5c311e);_0x38e92e(null);};}for(var e in events){if(events[_0x3287('0x5')](e)){var event=events[e];CmList[_0x3287('0x6')](e,emitEvent(event));}}module[_0x3287('0x7')]=CmListEvents; \ No newline at end of file +var _0xbe6c=['update','remove','emit','hasOwnProperty','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0xbe6c,0x124));var _0xcbe6=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xbe6c[_0x55e08b];return _0xd1a7ff;};'use strict';var EventEmitter=require(_0xcbe6('0x0'));var CmList=require(_0xcbe6('0x1'))['db'][_0xcbe6('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xcbe6('0x3')](0x0);var events={'afterCreate':_0xcbe6('0x4'),'afterUpdate':_0xcbe6('0x5'),'afterDestroy':_0xcbe6('0x6')};function emitEvent(_0x32d760){return function(_0x367f3a,_0x603922,_0x4850cf){CmListEvents[_0xcbe6('0x7')](_0x32d760+':'+_0x367f3a['id'],_0x367f3a);CmListEvents[_0xcbe6('0x7')](_0x32d760,_0x367f3a);_0x4850cf(null);};}for(var e in events){if(events[_0xcbe6('0x8')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 159a4f5..e9411d6 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb32a=['lodash','util','api','bluebird','path','../../config/environment','./cmList.attributes','define','CmList'];(function(_0x1e2b44,_0x48eedd){var _0x57d4ac=function(_0x4a0353){while(--_0x4a0353){_0x1e2b44['push'](_0x1e2b44['shift']());}};_0x57d4ac(++_0x48eedd);}(_0xb32a,0x132));var _0xab32=function(_0x45e6c7,_0x47fc8b){_0x45e6c7=_0x45e6c7-0x0;var _0xae2d26=_0xb32a[_0x45e6c7];return _0xae2d26;};'use strict';var _=require(_0xab32('0x0'));var util=require(_0xab32('0x1'));var logger=require('../../config/logger')(_0xab32('0x2'));var moment=require('moment');var BPromise=require(_0xab32('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab32('0x4'));var rimraf=require('rimraf');var config=require(_0xab32('0x5'));var attributes=require(_0xab32('0x6'));module['exports']=function(_0x100e86,_0x385c91){return _0x100e86[_0xab32('0x7')](_0xab32('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c36=['request-promise','./cmList.attributes','cm_lists','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3ddf26,_0x15c898){var _0x32a6c3=function(_0x32e45f){while(--_0x32e45f){_0x3ddf26['push'](_0x3ddf26['shift']());}};_0x32a6c3(++_0x15c898);}(_0x4c36,0xdb));var _0x64c3=function(_0x4bade6,_0x18c53e){_0x4bade6=_0x4bade6-0x0;var _0x2f6743=_0x4c36[_0x4bade6];return _0x2f6743;};'use strict';var _=require(_0x64c3('0x0'));var util=require(_0x64c3('0x1'));var logger=require(_0x64c3('0x2'))(_0x64c3('0x3'));var moment=require(_0x64c3('0x4'));var BPromise=require(_0x64c3('0x5'));var rp=require(_0x64c3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x64c3('0x7'));module['exports']=function(_0x5a52a8,_0x2c9d51){return _0x5a52a8['define']('CmList',attributes,{'tableName':_0x64c3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index d9e89a6..a1f6df6 100644 --- a/server/api/cmList/cmList.rpc.js +++ b/server/api/cmList/cmList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce30=['error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x1428ad,_0x5e3a66){var _0x3b19d6=function(_0x3a3da6){while(--_0x3a3da6){_0x1428ad['push'](_0x1428ad['shift']());}};_0x3b19d6(++_0x5e3a66);}(_0xce30,0xdb));var _0x0ce3=function(_0x4591ee,_0x3a1daf){_0x4591ee=_0x4591ee-0x0;var _0x4cdb81=_0xce30[_0x4591ee];return _0x4cdb81;};'use strict';var _=require(_0x0ce3('0x0'));var util=require(_0x0ce3('0x1'));var moment=require(_0x0ce3('0x2'));var BPromise=require(_0x0ce3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ce3('0x4'));var db=require(_0x0ce3('0x5'))['db'];var utils=require(_0x0ce3('0x6'));var logger=require(_0x0ce3('0x7'))(_0x0ce3('0x8'));var config=require(_0x0ce3('0x9'));var jayson=require(_0x0ce3('0xa'));var client=jayson[_0x0ce3('0xb')][_0x0ce3('0xc')]({'port':0x232a});config[_0x0ce3('0xd')]=_[_0x0ce3('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ce3('0xd')]));require('./cmList.socket')[_0x0ce3('0xf')](socket);function respondWithRpcPromise(_0x15c2bb,_0x2bec25,_0x352cf4){return new BPromise(function(_0x51e72f,_0x19e984){return client['request'](_0x15c2bb,_0x352cf4)['then'](function(_0xd8985b){logger[_0x0ce3('0x10')](_0x0ce3('0x11'),_0x2bec25,_0x0ce3('0x12'));logger[_0x0ce3('0x13')](_0x0ce3('0x14'),_0x2bec25,_0x0ce3('0x12'),JSON['stringify'](_0xd8985b));if(_0xd8985b[_0x0ce3('0x15')]){if(_0xd8985b[_0x0ce3('0x15')][_0x0ce3('0x16')]===0x1f4){logger['error'](_0x0ce3('0x11'),_0x2bec25,_0xd8985b[_0x0ce3('0x15')][_0x0ce3('0x17')]);return _0x19e984(_0xd8985b[_0x0ce3('0x15')]['message']);}logger[_0x0ce3('0x15')]('CmList,\x20%s,\x20%s',_0x2bec25,_0xd8985b[_0x0ce3('0x15')]['message']);return _0x51e72f(_0xd8985b['error'][_0x0ce3('0x17')]);}else{logger[_0x0ce3('0x10')](_0x0ce3('0x11'),_0x2bec25,_0x0ce3('0x12'));_0x51e72f(_0xd8985b['result']['message']);}})['catch'](function(_0x15d082){logger[_0x0ce3('0x15')]('CmList,\x20%s,\x20%s',_0x2bec25,_0x15d082);_0x19e984(_0x15d082);});});} \ No newline at end of file +var _0x93ba=['CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then'];(function(_0x3aa321,_0x5bcde5){var _0x2bc5a5=function(_0xabb066){while(--_0xabb066){_0x3aa321['push'](_0x3aa321['shift']());}};_0x2bc5a5(++_0x5bcde5);}(_0x93ba,0xb8));var _0xa93b=function(_0x2aa0c2,_0x27b21d){_0x2aa0c2=_0x2aa0c2-0x0;var _0x1caaff=_0x93ba[_0x2aa0c2];return _0x1caaff;};'use strict';var _=require(_0xa93b('0x0'));var util=require(_0xa93b('0x1'));var moment=require(_0xa93b('0x2'));var BPromise=require(_0xa93b('0x3'));var rs=require(_0xa93b('0x4'));var fs=require('fs');var Redis=require(_0xa93b('0x5'));var db=require(_0xa93b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa93b('0x7'))(_0xa93b('0x8'));var config=require(_0xa93b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa93b('0xa')][_0xa93b('0xb')]({'port':0x232a});config[_0xa93b('0xc')]=_[_0xa93b('0xd')](config[_0xa93b('0xc')],{'host':_0xa93b('0xe'),'port':0x18eb});var socket=require(_0xa93b('0xf'))(new Redis(config[_0xa93b('0xc')]));require(_0xa93b('0x10'))[_0xa93b('0x11')](socket);function respondWithRpcPromise(_0x581ab4,_0x3f7ccc,_0x5e287e){return new BPromise(function(_0xb8c436,_0x30aa17){return client['request'](_0x581ab4,_0x5e287e)[_0xa93b('0x12')](function(_0x35f023){logger['info'](_0xa93b('0x13'),_0x3f7ccc,_0xa93b('0x14'));logger['debug'](_0xa93b('0x15'),_0x3f7ccc,'request\x20sent',JSON[_0xa93b('0x16')](_0x35f023));if(_0x35f023[_0xa93b('0x17')]){if(_0x35f023[_0xa93b('0x17')][_0xa93b('0x18')]===0x1f4){logger[_0xa93b('0x17')](_0xa93b('0x13'),_0x3f7ccc,_0x35f023[_0xa93b('0x17')][_0xa93b('0x19')]);return _0x30aa17(_0x35f023['error'][_0xa93b('0x19')]);}logger[_0xa93b('0x17')](_0xa93b('0x13'),_0x3f7ccc,_0x35f023[_0xa93b('0x17')]['message']);return _0xb8c436(_0x35f023['error'][_0xa93b('0x19')]);}else{logger[_0xa93b('0x1a')](_0xa93b('0x13'),_0x3f7ccc,_0xa93b('0x14'));_0xb8c436(_0x35f023[_0xa93b('0x1b')][_0xa93b('0x19')]);}})[_0xa93b('0x1c')](function(_0x554af6){logger[_0xa93b('0x17')](_0xa93b('0x13'),_0x3f7ccc,_0x554af6);_0x30aa17(_0x554af6);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index bd9503f..a73f907 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b4e=['removeListener','register','length','cmList:','save','emit'];(function(_0x46bfdd,_0x342b59){var _0x5e42c5=function(_0x4fe725){while(--_0x4fe725){_0x46bfdd['push'](_0x46bfdd['shift']());}};_0x5e42c5(++_0x342b59);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x2f1eb1,_0x3bf522){_0x2f1eb1=_0x2f1eb1-0x0;var _0x5905c0=_0x6b4e[_0x2f1eb1];return _0x5905c0;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xe6b4('0x0'),'remove','update'];function createListener(_0x5c3328,_0x54da12){return function(_0x4566e9){_0x54da12[_0xe6b4('0x1')](_0x5c3328,_0x4566e9);};}function removeListener(_0x1aedc5,_0x344db1){return function(){CmListEvents[_0xe6b4('0x2')](_0x1aedc5,_0x344db1);};}exports[_0xe6b4('0x3')]=function(_0x598f8c){for(var _0x29c81b=0x0,_0x3458d8=events[_0xe6b4('0x4')];_0x29c81b<_0x3458d8;_0x29c81b++){var _0x1d062b=events[_0x29c81b];var _0x15cf31=createListener(_0xe6b4('0x5')+_0x1d062b,_0x598f8c);CmListEvents['on'](_0x1d062b,_0x15cf31);}}; \ No newline at end of file +var _0x81d4=['remove','removeListener','register','length','cmList:','save'];(function(_0x3d9ba4,_0x2bd45a){var _0x37404e=function(_0x4d8eae){while(--_0x4d8eae){_0x3d9ba4['push'](_0x3d9ba4['shift']());}};_0x37404e(++_0x2bd45a);}(_0x81d4,0x197));var _0x481d=function(_0x25385e,_0x3db8bf){_0x25385e=_0x25385e-0x0;var _0x4f7beb=_0x81d4[_0x25385e];return _0x4f7beb;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x481d('0x0'),_0x481d('0x1'),'update'];function createListener(_0xf5135,_0x369cf6){return function(_0x266766){_0x369cf6['emit'](_0xf5135,_0x266766);};}function removeListener(_0x5af777,_0x37813e){return function(){CmListEvents[_0x481d('0x2')](_0x5af777,_0x37813e);};}exports[_0x481d('0x3')]=function(_0x5c0761){for(var _0x1ef8ca=0x0,_0x17d32a=events[_0x481d('0x4')];_0x1ef8ca<_0x17d32a;_0x1ef8ca++){var _0x271b33=events[_0x1ef8ca];var _0x1d9263=createListener(_0x481d('0x5')+_0x271b33,_0x5c0761);CmListEvents['on'](_0x271b33,_0x1d9263);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 8d3d654..d354dd4 100644 --- a/server/api/cmList/index.js +++ b/server/api/cmList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec5b=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','/:id/dispositions','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','destroy'];(function(_0x39b7d8,_0xa44989){var _0x42d6dd=function(_0x2922ab){while(--_0x2922ab){_0x39b7d8['push'](_0x39b7d8['shift']());}};_0x42d6dd(++_0xa44989);}(_0xec5b,0x1d0));var _0xbec5=function(_0x3a4dd9,_0x4630f5){_0x3a4dd9=_0x3a4dd9-0x0;var _0x53f1ef=_0xec5b[_0x3a4dd9];return _0x53f1ef;};'use strict';var multer=require(_0xbec5('0x0'));var util=require(_0xbec5('0x1'));var path=require(_0xbec5('0x2'));var timeout=require(_0xbec5('0x3'));var express=require(_0xbec5('0x4'));var router=express[_0xbec5('0x5')]();var auth=require(_0xbec5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbec5('0x7'));var controller=require('./cmList.controller');router[_0xbec5('0x8')]('/',auth[_0xbec5('0x9')](),controller[_0xbec5('0xa')]);router['get']('/describe',auth[_0xbec5('0x9')](),controller[_0xbec5('0xb')]);router[_0xbec5('0x8')](_0xbec5('0xc'),auth[_0xbec5('0x9')](),controller['show']);router[_0xbec5('0x8')]('/:id/dispositions',auth[_0xbec5('0x9')](),controller['getDispositions']);router['get'](_0xbec5('0xd'),auth[_0xbec5('0x9')](),controller[_0xbec5('0xe')]);router[_0xbec5('0x8')](_0xbec5('0xf'),auth['isAuthenticated'](),controller[_0xbec5('0x10')]);router['get'](_0xbec5('0x11'),auth[_0xbec5('0x9')](),controller[_0xbec5('0x12')]);router[_0xbec5('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xbec5('0x13')]);router[_0xbec5('0x14')]('/',auth[_0xbec5('0x9')](),controller[_0xbec5('0x15')]);router[_0xbec5('0x14')](_0xbec5('0x16'),auth[_0xbec5('0x9')](),controller['addDisposition']);router['post'](_0xbec5('0xd'),auth[_0xbec5('0x9')](),controller[_0xbec5('0x17')]);router[_0xbec5('0x14')](_0xbec5('0x11'),auth['isAuthenticated'](),controller[_0xbec5('0x18')]);router[_0xbec5('0x14')](_0xbec5('0x19'),auth['isAuthenticated'](),controller[_0xbec5('0x1a')]);router[_0xbec5('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xbec5('0x1c')]);router[_0xbec5('0x1d')](_0xbec5('0xc'),auth[_0xbec5('0x9')](),controller[_0xbec5('0x1e')]);router['delete'](_0xbec5('0x16'),auth[_0xbec5('0x9')](),controller['removeDispositions']);router['delete']('/:id/users',auth[_0xbec5('0x9')](),controller[_0xbec5('0x1f')]);module[_0xbec5('0x20')]=router; \ No newline at end of file +var _0xfccd=['express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','removeAgents','exports','multer','path'];(function(_0x53f158,_0x4a8413){var _0x54cec7=function(_0x1df4c4){while(--_0x1df4c4){_0x53f158['push'](_0x53f158['shift']());}};_0x54cec7(++_0x4a8413);}(_0xfccd,0x1cc));var _0xdfcc=function(_0x8666ec,_0x34fb14){_0x8666ec=_0x8666ec-0x0;var _0x496fe8=_0xfccd[_0x8666ec];return _0x496fe8;};'use strict';var multer=require(_0xdfcc('0x0'));var util=require('util');var path=require(_0xdfcc('0x1'));var timeout=require('connect-timeout');var express=require(_0xdfcc('0x2'));var router=express[_0xdfcc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdfcc('0x4'));var config=require(_0xdfcc('0x5'));var controller=require(_0xdfcc('0x6'));router[_0xdfcc('0x7')]('/',auth[_0xdfcc('0x8')](),controller['index']);router[_0xdfcc('0x7')](_0xdfcc('0x9'),auth['isAuthenticated'](),controller[_0xdfcc('0xa')]);router['get'](_0xdfcc('0xb'),auth['isAuthenticated'](),controller[_0xdfcc('0xc')]);router[_0xdfcc('0x7')]('/:id/dispositions',auth[_0xdfcc('0x8')](),controller[_0xdfcc('0xd')]);router[_0xdfcc('0x7')](_0xdfcc('0xe'),auth[_0xdfcc('0x8')](),controller[_0xdfcc('0xf')]);router[_0xdfcc('0x7')](_0xdfcc('0x10'),auth['isAuthenticated'](),controller[_0xdfcc('0x11')]);router['get'](_0xdfcc('0x12'),auth[_0xdfcc('0x8')](),controller[_0xdfcc('0x13')]);router[_0xdfcc('0x7')](_0xdfcc('0x14'),auth[_0xdfcc('0x8')](),controller['getAgents']);router[_0xdfcc('0x15')]('/',auth[_0xdfcc('0x8')](),controller[_0xdfcc('0x16')]);router[_0xdfcc('0x15')](_0xdfcc('0x17'),auth[_0xdfcc('0x8')](),controller[_0xdfcc('0x18')]);router[_0xdfcc('0x15')](_0xdfcc('0xe'),auth[_0xdfcc('0x8')](),controller[_0xdfcc('0x19')]);router[_0xdfcc('0x15')](_0xdfcc('0x12'),auth[_0xdfcc('0x8')](),controller[_0xdfcc('0x1a')]);router['post']('/:id/users',auth[_0xdfcc('0x8')](),controller[_0xdfcc('0x1b')]);router[_0xdfcc('0x1c')](_0xdfcc('0xb'),auth[_0xdfcc('0x8')](),controller[_0xdfcc('0x1d')]);router[_0xdfcc('0x1e')](_0xdfcc('0xb'),auth[_0xdfcc('0x8')](),controller['destroy']);router[_0xdfcc('0x1e')](_0xdfcc('0x17'),auth[_0xdfcc('0x8')](),controller['removeDispositions']);router[_0xdfcc('0x1e')](_0xdfcc('0x14'),auth[_0xdfcc('0x8')](),controller[_0xdfcc('0x1f')]);module[_0xdfcc('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 441bd8e..e60ba13 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x3caa7d,_0x40f745){var _0x2e9698=function(_0x4ad54c){while(--_0x4ad54c){_0x3caa7d['push'](_0x3caa7d['shift']());}};_0x2e9698(++_0x40f745);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x54123f,_0x2de9ee){var _0x1981b5=function(_0x3e74f0){while(--_0x3e74f0){_0x54123f['push'](_0x54123f['shift']());}};_0x1981b5(++_0x2de9ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 7287bab..b4be693 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23a3=['bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','limit','status','set','Content-Range','save','update','then','destroy','stack','name','send','body','Condition','params','catch','find','zip-dir','request-promise','moment'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x23a3,0x131));var _0x323a=function(_0x14d3a1,_0x6d1bfc){_0x14d3a1=_0x14d3a1-0x0;var _0x1afceb=_0x23a3[_0x14d3a1];return _0x1afceb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x323a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x323a('0x1'));var moment=require(_0x323a('0x2'));var BPromise=require(_0x323a('0x3'));var Mustache=require(_0x323a('0x4'));var util=require(_0x323a('0x5'));var path=require(_0x323a('0x6'));var sox=require(_0x323a('0x7'));var csv=require(_0x323a('0x8'));var ejs=require(_0x323a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x323a('0xa'));var crypto=require(_0x323a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x323a('0xc'));var toCsv=require(_0x323a('0x8'));var querystring=require(_0x323a('0xd'));var Papa=require('papaparse');var Redis=require(_0x323a('0xe'));var authService=require(_0x323a('0xf'));var qs=require(_0x323a('0x10'));var as=require(_0x323a('0x11'));var hardwareService=require(_0x323a('0x12'));var logger=require(_0x323a('0x13'))(_0x323a('0x14'));var utils=require(_0x323a('0x15'));var config=require(_0x323a('0x16'));var db=require(_0x323a('0x17'))['db'];function respondWithStatusCode(_0x42b854,_0x33d226){_0x33d226=_0x33d226||0xcc;return function(_0x460fd8){if(_0x460fd8){return _0x42b854[_0x323a('0x18')](_0x33d226);}return _0x42b854['status'](_0x33d226)[_0x323a('0x19')]();};}function respondWithResult(_0x4831bc,_0x16b92e){_0x16b92e=_0x16b92e||0xc8;return function(_0x4ccd19){if(_0x4ccd19){return _0x4831bc['status'](_0x16b92e)[_0x323a('0x1a')](_0x4ccd19);}};}function respondWithFilteredResult(_0x57617f,_0x46c247){return function(_0x582631){if(_0x582631){var _0x1cc64d=_0x582631[_0x323a('0x1b')],_0x64003=_0x46c247['offset'],_0x54cda9=_0x46c247['offset']+_0x46c247[_0x323a('0x1c')],_0x271b85;if(_0x54cda9>=_0x1cc64d){_0x54cda9=_0x1cc64d;_0x271b85=0xc8;}else{_0x271b85=0xce;}_0x57617f[_0x323a('0x1d')](_0x271b85);return _0x57617f[_0x323a('0x1e')](_0x323a('0x1f'),_0x64003+'-'+_0x54cda9+'/'+_0x1cc64d)[_0x323a('0x1a')](_0x582631);}return null;};}function patchUpdates(_0x2cad9b){return function(_0x4eb2de){try{jsonpatch['apply'](_0x4eb2de,_0x2cad9b,!![]);}catch(_0x47f84e){return BPromise['reject'](_0x47f84e);}return _0x4eb2de[_0x323a('0x20')]();};}function saveUpdates(_0x549801,_0xc0f3e4){return function(_0x38bc95){if(_0x38bc95){return _0x38bc95[_0x323a('0x21')](_0x549801)[_0x323a('0x22')](function(_0x4ee861){return _0x4ee861;});}return null;};}function removeEntity(_0x5af312,_0x549e64){return function(_0x12c8d7){if(_0x12c8d7){return _0x12c8d7[_0x323a('0x23')]()[_0x323a('0x22')](function(){_0x5af312['status'](0xcc)[_0x323a('0x19')]();});}};}function handleEntityNotFound(_0x358bcb,_0x36d4d9){return function(_0x2960e0){if(!_0x2960e0){_0x358bcb[_0x323a('0x18')](0x194);}return _0x2960e0;};}function handleError(_0x204f76,_0x5ba015){_0x5ba015=_0x5ba015||0x1f4;return function(_0x3a51bb){logger['error'](_0x3a51bb[_0x323a('0x24')]);if(_0x3a51bb[_0x323a('0x25')]){delete _0x3a51bb[_0x323a('0x25')];}_0x204f76[_0x323a('0x1d')](_0x5ba015)[_0x323a('0x26')](_0x3a51bb);};}exports['update']=function(_0x3d866a,_0x384c93){if(_0x3d866a[_0x323a('0x27')]['id']){delete _0x3d866a[_0x323a('0x27')]['id'];}return db[_0x323a('0x28')]['find']({'where':{'id':_0x3d866a[_0x323a('0x29')]['id']}})['then'](handleEntityNotFound(_0x384c93,null))[_0x323a('0x22')](saveUpdates(_0x3d866a[_0x323a('0x27')],null))[_0x323a('0x22')](respondWithResult(_0x384c93,null))[_0x323a('0x2a')](handleError(_0x384c93,null));};exports[_0x323a('0x23')]=function(_0x3b4216,_0x5bdea1){return db[_0x323a('0x28')][_0x323a('0x2b')]({'where':{'id':_0x3b4216['params']['id']}})[_0x323a('0x22')](handleEntityNotFound(_0x5bdea1,null))['then'](removeEntity(_0x5bdea1,null))['catch'](handleError(_0x5bdea1,null));}; \ No newline at end of file +var _0x226b=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','status','sendStatus','error','send','body','find','params','catch','destroy','Condition','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0x226b,0x161));var _0xb226=function(_0x2c6a81,_0x25fa83){_0x2c6a81=_0x2c6a81-0x0;var _0x2aec91=_0x226b[_0x2c6a81];return _0x2aec91;};'use strict';var pdf=require(_0xb226('0x0'));var emlformat=require(_0xb226('0x1'));var rimraf=require(_0xb226('0x2'));var zipdir=require(_0xb226('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb226('0x4'));var moment=require(_0xb226('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb226('0x6'));var util=require(_0xb226('0x7'));var path=require(_0xb226('0x8'));var sox=require(_0xb226('0x9'));var csv=require(_0xb226('0xa'));var ejs=require(_0xb226('0xb'));var fs=require('fs');var _=require(_0xb226('0xc'));var squel=require(_0xb226('0xd'));var crypto=require(_0xb226('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb226('0xf'));var toCsv=require(_0xb226('0xa'));var querystring=require(_0xb226('0x10'));var Papa=require('papaparse');var Redis=require(_0xb226('0x11'));var authService=require(_0xb226('0x12'));var qs=require(_0xb226('0x13'));var as=require(_0xb226('0x14'));var hardwareService=require(_0xb226('0x15'));var logger=require(_0xb226('0x16'))(_0xb226('0x17'));var utils=require('../../config/utils');var config=require(_0xb226('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26fa30,_0x5498ec){_0x5498ec=_0x5498ec||0xcc;return function(_0x4a1acd){if(_0x4a1acd){return _0x26fa30['sendStatus'](_0x5498ec);}return _0x26fa30['status'](_0x5498ec)[_0xb226('0x19')]();};}function respondWithResult(_0x363708,_0x5f1d24){_0x5f1d24=_0x5f1d24||0xc8;return function(_0x129492){if(_0x129492){return _0x363708['status'](_0x5f1d24)[_0xb226('0x1a')](_0x129492);}};}function respondWithFilteredResult(_0x1cc827,_0x5d2a4d){return function(_0x21682f){if(_0x21682f){var _0x59a0bf=_0x21682f[_0xb226('0x1b')],_0xfda54f=_0x5d2a4d[_0xb226('0x1c')],_0x3036da=_0x5d2a4d[_0xb226('0x1c')]+_0x5d2a4d[_0xb226('0x1d')],_0x2088e0;if(_0x3036da>=_0x59a0bf){_0x3036da=_0x59a0bf;_0x2088e0=0xc8;}else{_0x2088e0=0xce;}_0x1cc827['status'](_0x2088e0);return _0x1cc827[_0xb226('0x1e')](_0xb226('0x1f'),_0xfda54f+'-'+_0x3036da+'/'+_0x59a0bf)[_0xb226('0x1a')](_0x21682f);}return null;};}function patchUpdates(_0xa40d89){return function(_0xbe54ec){try{jsonpatch['apply'](_0xbe54ec,_0xa40d89,!![]);}catch(_0x204270){return BPromise[_0xb226('0x20')](_0x204270);}return _0xbe54ec[_0xb226('0x21')]();};}function saveUpdates(_0x84c2be,_0x1c3f21){return function(_0x7a11e0){if(_0x7a11e0){return _0x7a11e0[_0xb226('0x22')](_0x84c2be)[_0xb226('0x23')](function(_0x1cd9aa){return _0x1cd9aa;});}return null;};}function removeEntity(_0x3667af,_0x16b9b6){return function(_0x5ed1f5){if(_0x5ed1f5){return _0x5ed1f5['destroy']()[_0xb226('0x23')](function(){_0x3667af[_0xb226('0x24')](0xcc)[_0xb226('0x19')]();});}};}function handleEntityNotFound(_0x222693,_0x946099){return function(_0x355af5){if(!_0x355af5){_0x222693[_0xb226('0x25')](0x194);}return _0x355af5;};}function handleError(_0x54d0be,_0x437948){_0x437948=_0x437948||0x1f4;return function(_0x2c0af8){logger[_0xb226('0x26')](_0x2c0af8['stack']);if(_0x2c0af8['name']){delete _0x2c0af8['name'];}_0x54d0be['status'](_0x437948)[_0xb226('0x27')](_0x2c0af8);};}exports[_0xb226('0x22')]=function(_0xba6476,_0x542eee){if(_0xba6476[_0xb226('0x28')]['id']){delete _0xba6476[_0xb226('0x28')]['id'];}return db['Condition'][_0xb226('0x29')]({'where':{'id':_0xba6476[_0xb226('0x2a')]['id']}})[_0xb226('0x23')](handleEntityNotFound(_0x542eee,null))[_0xb226('0x23')](saveUpdates(_0xba6476[_0xb226('0x28')],null))[_0xb226('0x23')](respondWithResult(_0x542eee,null))[_0xb226('0x2b')](handleError(_0x542eee,null));};exports[_0xb226('0x2c')]=function(_0x2a4aa4,_0x2b190d){return db[_0xb226('0x2d')][_0xb226('0x29')]({'where':{'id':_0x2a4aa4[_0xb226('0x2a')]['id']}})[_0xb226('0x23')](handleEntityNotFound(_0x2b190d,null))[_0xb226('0x23')](removeEntity(_0x2b190d,null))[_0xb226('0x2b')](handleError(_0x2b190d,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index ae74862..38a2bb4 100644 --- a/server/api/condition/condition.model.js +++ b/server/api/condition/condition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1453=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','tools_conditions','util','../../config/logger','api','moment'];(function(_0x4a18e5,_0x2b96ca){var _0x4d1483=function(_0x5ed2b3){while(--_0x5ed2b3){_0x4a18e5['push'](_0x4a18e5['shift']());}};_0x4d1483(++_0x2b96ca);}(_0x1453,0x98));var _0x3145=function(_0xcf07d2,_0x34d380){_0xcf07d2=_0xcf07d2-0x0;var _0x2c141b=_0x1453[_0xcf07d2];return _0x2c141b;};'use strict';var _=require('lodash');var util=require(_0x3145('0x0'));var logger=require(_0x3145('0x1'))(_0x3145('0x2'));var moment=require(_0x3145('0x3'));var BPromise=require(_0x3145('0x4'));var rp=require(_0x3145('0x5'));var fs=require('fs');var path=require(_0x3145('0x6'));var rimraf=require(_0x3145('0x7'));var config=require(_0x3145('0x8'));var attributes=require(_0x3145('0x9'));module[_0x3145('0xa')]=function(_0x45ff7c,_0x11f993){return _0x45ff7c[_0x3145('0xb')]('Condition',attributes,{'tableName':_0x3145('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa829=['../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a2217,_0x9c653a){var _0x24cb1c=function(_0x35155e){while(--_0x35155e){_0x4a2217['push'](_0x4a2217['shift']());}};_0x24cb1c(++_0x9c653a);}(_0xa829,0x110));var _0x9a82=function(_0x2171d3,_0x23a920){_0x2171d3=_0x2171d3-0x0;var _0x40d018=_0xa829[_0x2171d3];return _0x40d018;};'use strict';var _=require('lodash');var util=require(_0x9a82('0x0'));var logger=require(_0x9a82('0x1'))(_0x9a82('0x2'));var moment=require(_0x9a82('0x3'));var BPromise=require(_0x9a82('0x4'));var rp=require(_0x9a82('0x5'));var fs=require('fs');var path=require(_0x9a82('0x6'));var rimraf=require(_0x9a82('0x7'));var config=require(_0x9a82('0x8'));var attributes=require(_0x9a82('0x9'));module[_0x9a82('0xa')]=function(_0x285a0d,_0x52e223){return _0x285a0d[_0x9a82('0xb')](_0x9a82('0xc'),attributes,{'tableName':_0x9a82('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index f7bc1a3..fe87988 100644 --- a/server/api/condition/condition.rpc.js +++ b/server/api/condition/condition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90e8=['request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Condition,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x84cd27,_0x3cc6e6){var _0x519f14=function(_0x5f3273){while(--_0x5f3273){_0x84cd27['push'](_0x84cd27['shift']());}};_0x519f14(++_0x3cc6e6);}(_0x90e8,0xe8));var _0x890e=function(_0x1aa46a,_0x138e8a){_0x1aa46a=_0x1aa46a-0x0;var _0x48fa7b=_0x90e8[_0x1aa46a];return _0x48fa7b;};'use strict';var _=require(_0x890e('0x0'));var util=require(_0x890e('0x1'));var moment=require(_0x890e('0x2'));var BPromise=require('bluebird');var rs=require(_0x890e('0x3'));var fs=require('fs');var Redis=require(_0x890e('0x4'));var db=require(_0x890e('0x5'))['db'];var utils=require(_0x890e('0x6'));var logger=require('../../config/logger')(_0x890e('0x7'));var config=require(_0x890e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x890e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30cb34,_0xf12322,_0x339c6f){return new BPromise(function(_0xcef350,_0x3e190a){return client[_0x890e('0xa')](_0x30cb34,_0x339c6f)[_0x890e('0xb')](function(_0x181332){logger[_0x890e('0xc')]('Condition,\x20%s,\x20%s',_0xf12322,_0x890e('0xd'));logger[_0x890e('0xe')](_0x890e('0xf'),_0xf12322,_0x890e('0xd'),JSON[_0x890e('0x10')](_0x181332));if(_0x181332['error']){if(_0x181332[_0x890e('0x11')]['code']===0x1f4){logger[_0x890e('0x11')]('Condition,\x20%s,\x20%s',_0xf12322,_0x181332['error'][_0x890e('0x12')]);return _0x3e190a(_0x181332[_0x890e('0x11')][_0x890e('0x12')]);}logger[_0x890e('0x11')]('Condition,\x20%s,\x20%s',_0xf12322,_0x181332[_0x890e('0x11')][_0x890e('0x12')]);return _0xcef350(_0x181332[_0x890e('0x11')]['message']);}else{logger[_0x890e('0xc')]('Condition,\x20%s,\x20%s',_0xf12322,_0x890e('0xd'));_0xcef350(_0x181332[_0x890e('0x13')][_0x890e('0x12')]);}})[_0x890e('0x14')](function(_0xe309ba){logger[_0x890e('0x11')](_0x890e('0x15'),_0xf12322,_0xe309ba);_0x3e190a(_0xe309ba);});});} \ No newline at end of file +var _0xa002=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x13b7a7,_0x17e53a){var _0x322b05=function(_0x39b931){while(--_0x39b931){_0x13b7a7['push'](_0x13b7a7['shift']());}};_0x322b05(++_0x17e53a);}(_0xa002,0x147));var _0x2a00=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa002[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2a00('0x0'));var util=require(_0x2a00('0x1'));var moment=require(_0x2a00('0x2'));var BPromise=require(_0x2a00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a00('0x4'));var db=require(_0x2a00('0x5'))['db'];var utils=require(_0x2a00('0x6'));var logger=require(_0x2a00('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2a00('0x8')][_0x2a00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27184c,_0x2fd5c6,_0x14627e){return new BPromise(function(_0x54fa44,_0x208ba0){return client['request'](_0x27184c,_0x14627e)[_0x2a00('0xa')](function(_0x155917){logger[_0x2a00('0xb')](_0x2a00('0xc'),_0x2fd5c6,_0x2a00('0xd'));logger[_0x2a00('0xe')](_0x2a00('0xf'),_0x2fd5c6,'request\x20sent',JSON[_0x2a00('0x10')](_0x155917));if(_0x155917[_0x2a00('0x11')]){if(_0x155917[_0x2a00('0x11')][_0x2a00('0x12')]===0x1f4){logger['error'](_0x2a00('0xc'),_0x2fd5c6,_0x155917['error']['message']);return _0x208ba0(_0x155917[_0x2a00('0x11')]['message']);}logger[_0x2a00('0x11')](_0x2a00('0xc'),_0x2fd5c6,_0x155917[_0x2a00('0x11')][_0x2a00('0x13')]);return _0x54fa44(_0x155917['error'][_0x2a00('0x13')]);}else{logger[_0x2a00('0xb')]('Condition,\x20%s,\x20%s',_0x2fd5c6,_0x2a00('0xd'));_0x54fa44(_0x155917[_0x2a00('0x14')][_0x2a00('0x13')]);}})[_0x2a00('0x15')](function(_0x1e5ba0){logger[_0x2a00('0x11')](_0x2a00('0xc'),_0x2fd5c6,_0x1e5ba0);_0x208ba0(_0x1e5ba0);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 0a59252..e5a2c91 100644 --- a/server/api/condition/index.js +++ b/server/api/condition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0a1=['put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xa055f0,_0x5c80e4){var _0x18ad51=function(_0x107de2){while(--_0x107de2){_0xa055f0['push'](_0xa055f0['shift']());}};_0x18ad51(++_0x5c80e4);}(_0xb0a1,0x181));var _0x1b0a=function(_0x12009f,_0x70d95){_0x12009f=_0x12009f-0x0;var _0xc6ea8=_0xb0a1[_0x12009f];return _0xc6ea8;};'use strict';var multer=require(_0x1b0a('0x0'));var util=require(_0x1b0a('0x1'));var path=require(_0x1b0a('0x2'));var timeout=require(_0x1b0a('0x3'));var express=require(_0x1b0a('0x4'));var router=express[_0x1b0a('0x5')]();var auth=require(_0x1b0a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./condition.controller');router[_0x1b0a('0x7')](_0x1b0a('0x8'),auth[_0x1b0a('0x9')](),controller[_0x1b0a('0xa')]);router[_0x1b0a('0xb')](_0x1b0a('0x8'),auth[_0x1b0a('0x9')](),controller[_0x1b0a('0xc')]);module[_0x1b0a('0xd')]=router; \ No newline at end of file +var _0xcdb5=['/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./condition.controller','isAuthenticated','update','delete'];(function(_0x3bdc06,_0x55e87e){var _0x57082b=function(_0x37bc63){while(--_0x37bc63){_0x3bdc06['push'](_0x3bdc06['shift']());}};_0x57082b(++_0x55e87e);}(_0xcdb5,0x16f));var _0x5cdb=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0xcdb5[_0x4f4d19];return _0x27a258;};'use strict';var multer=require(_0x5cdb('0x0'));var util=require(_0x5cdb('0x1'));var path=require(_0x5cdb('0x2'));var timeout=require(_0x5cdb('0x3'));var express=require('express');var router=express[_0x5cdb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5cdb('0x5'));var config=require(_0x5cdb('0x6'));var controller=require(_0x5cdb('0x7'));router['put']('/:id',auth[_0x5cdb('0x8')](),controller[_0x5cdb('0x9')]);router[_0x5cdb('0xa')](_0x5cdb('0xb'),auth[_0x5cdb('0x8')](),controller[_0x5cdb('0xc')]);module[_0x5cdb('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 490f1c6..cc97994 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae30=['exports','STRING','sequelize'];(function(_0x13b860,_0xce4b66){var _0x2f1905=function(_0x4a7647){while(--_0x4a7647){_0x13b860['push'](_0x13b860['shift']());}};_0x2f1905(++_0xce4b66);}(_0xae30,0x10a));var _0x0ae3=function(_0x2b38f7,_0x3897af){_0x2b38f7=_0x2b38f7-0x0;var _0x4f8e27=_0xae30[_0x2b38f7];return _0x4f8e27;};'use strict';var Sequelize=require(_0x0ae3('0x0'));module[_0x0ae3('0x1')]={'name':{'type':Sequelize[_0x0ae3('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x0ae3('0x2')]}}; \ No newline at end of file +var _0x731d=['exports','name','STRING','sequelize'];(function(_0x401348,_0x201478){var _0x75e0b6=function(_0x1e2e57){while(--_0x1e2e57){_0x401348['push'](_0x401348['shift']());}};_0x75e0b6(++_0x201478);}(_0x731d,0x123));var _0xd731=function(_0x150821,_0x23b718){_0x150821=_0x150821-0x0;var _0x2162c1=_0x731d[_0x150821];return _0x2162c1;};'use strict';var Sequelize=require(_0xd731('0x0'));module[_0xd731('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd731('0x2')},'description':{'type':Sequelize[_0xd731('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 8319fba..4e26d2e 100644 --- a/server/api/dashboard/dashboard.controller.js +++ b/server/api/dashboard/dashboard.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x342b=['map','Dashboard','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','type','options','includeAll','include','rows','catch','show','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','error','attrUrl','attrs','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','findOne','DashboardItem','order','pick','html-pdf','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./dashboard.socket','register','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','update','then','get','CustomDashboards','UserProfileResource','name','send'];(function(_0x86f354,_0x4a07dc){var _0x1be304=function(_0xa71b52){while(--_0xa71b52){_0x86f354['push'](_0x86f354['shift']());}};_0x1be304(++_0x4a07dc);}(_0x342b,0xbc));var _0xb342=function(_0x5ee639,_0x42a655){_0x5ee639=_0x5ee639-0x0;var _0xddcbcf=_0x342b[_0x5ee639];return _0xddcbcf;};'use strict';var pdf=require(_0xb342('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb342('0x1'));var zipdir=require(_0xb342('0x2'));var jsonpatch=require(_0xb342('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb342('0x4'));var path=require(_0xb342('0x5'));var sox=require(_0xb342('0x6'));var csv=require(_0xb342('0x7'));var ejs=require(_0xb342('0x8'));var fs=require('fs');var _=require(_0xb342('0x9'));var squel=require(_0xb342('0xa'));var crypto=require(_0xb342('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb342('0x7'));var querystring=require(_0xb342('0xc'));var Papa=require('papaparse');var Redis=require(_0xb342('0xd'));var authService=require(_0xb342('0xe'));var qs=require(_0xb342('0xf'));var as=require(_0xb342('0x10'));var hardwareService=require(_0xb342('0x11'));var logger=require(_0xb342('0x12'))(_0xb342('0x13'));var utils=require(_0xb342('0x14'));var config=require(_0xb342('0x15'));var db=require(_0xb342('0x16'))['db'];config[_0xb342('0x17')]=_['defaults'](config[_0xb342('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb342('0x18'))[_0xb342('0x19')](socket);function respondWithStatusCode(_0x249257,_0x10f9bb){_0x10f9bb=_0x10f9bb||0xcc;return function(_0xfe5456){if(_0xfe5456){return _0x249257[_0xb342('0x1a')](_0x10f9bb);}return _0x249257[_0xb342('0x1b')](_0x10f9bb)[_0xb342('0x1c')]();};}function respondWithResult(_0x49a7e6,_0x435b8c){_0x435b8c=_0x435b8c||0xc8;return function(_0x1057f9){if(_0x1057f9){return _0x49a7e6['status'](_0x435b8c)['json'](_0x1057f9);}};}function respondWithFilteredResult(_0x589ade,_0x464268){return function(_0x1fdb22){if(_0x1fdb22){var _0x52b3b6=_0x1fdb22[_0xb342('0x1d')],_0x26583c=_0x464268[_0xb342('0x1e')],_0x2fa7cd=_0x464268['offset']+_0x464268['limit'],_0x1694c7;if(_0x2fa7cd>=_0x52b3b6){_0x2fa7cd=_0x52b3b6;_0x1694c7=0xc8;}else{_0x1694c7=0xce;}_0x589ade[_0xb342('0x1b')](_0x1694c7);return _0x589ade['set'](_0xb342('0x1f'),_0x26583c+'-'+_0x2fa7cd+'/'+_0x52b3b6)[_0xb342('0x20')](_0x1fdb22);}return null;};}function patchUpdates(_0x41f499){return function(_0xca6906){try{jsonpatch[_0xb342('0x21')](_0xca6906,_0x41f499,!![]);}catch(_0x553fd3){return BPromise[_0xb342('0x22')](_0x553fd3);}return _0xca6906['save']();};}function saveUpdates(_0x99593d,_0x59d63a){return function(_0x39d4d4){if(_0x39d4d4){return _0x39d4d4[_0xb342('0x23')](_0x99593d)[_0xb342('0x24')](function(_0x3198b5){return _0x3198b5;});}return null;};}function removeEntity(_0x4eda3a,_0x388fed){return function(_0x4b9eb9){if(_0x4b9eb9){return _0x4b9eb9['destroy']()[_0xb342('0x24')](function(){var _0x5cc8d7=_0x4b9eb9[_0xb342('0x25')]({'plain':!![]});var _0xbe4fd9=_0xb342('0x26');return db[_0xb342('0x27')]['destroy']({'where':{'type':_0xbe4fd9,'resourceId':_0x5cc8d7['id']}})[_0xb342('0x24')](function(){return _0x4b9eb9;});})[_0xb342('0x24')](function(){_0x4eda3a[_0xb342('0x1b')](0xcc)[_0xb342('0x1c')]();});}};}function handleEntityNotFound(_0x4696ac,_0x27005b){return function(_0x127dbc){if(!_0x127dbc){_0x4696ac['sendStatus'](0x194);}return _0x127dbc;};}function handleError(_0xda954f,_0x168d1b){_0x168d1b=_0x168d1b||0x1f4;return function(_0x210e3c){logger['error'](_0x210e3c['stack']);if(_0x210e3c['name']){delete _0x210e3c[_0xb342('0x28')];}_0xda954f['status'](_0x168d1b)[_0xb342('0x29')](_0x210e3c);};}exports['index']=function(_0x37d262,_0x12d5fe){var _0x14b649={},_0x2d18ed={},_0x1c8620={'count':0x0,'rows':[]};var _0x4a92ce=_[_0xb342('0x2a')](db[_0xb342('0x2b')][_0xb342('0x2c')],function(_0x5c646d){return{'name':_0x5c646d[_0xb342('0x2d')],'type':_0x5c646d['type'][_0xb342('0x2e')]};});_0x2d18ed[_0xb342('0x2f')]=_[_0xb342('0x2a')](_0x4a92ce,_0xb342('0x28'));_0x2d18ed[_0xb342('0x30')]=_[_0xb342('0x31')](_0x37d262[_0xb342('0x30')]);_0x2d18ed['filters']=_['intersection'](_0x2d18ed['model'],_0x2d18ed[_0xb342('0x30')]);_0x14b649[_0xb342('0x32')]=_['intersection'](_0x2d18ed['model'],qs[_0xb342('0x33')](_0x37d262[_0xb342('0x30')][_0xb342('0x33')]));_0x14b649[_0xb342('0x32')]=_0x14b649[_0xb342('0x32')][_0xb342('0x34')]?_0x14b649[_0xb342('0x32')]:_0x2d18ed['model'];if(!_0x37d262[_0xb342('0x30')][_0xb342('0x35')](_0xb342('0x36'))){_0x14b649[_0xb342('0x37')]=qs[_0xb342('0x37')](_0x37d262[_0xb342('0x30')]['limit']);_0x14b649[_0xb342('0x1e')]=qs[_0xb342('0x1e')](_0x37d262[_0xb342('0x30')][_0xb342('0x1e')]);}_0x14b649['order']=qs['sort'](_0x37d262['query'][_0xb342('0x38')]);_0x14b649[_0xb342('0x39')]=qs[_0xb342('0x3a')](_['pick'](_0x37d262[_0xb342('0x30')],_0x2d18ed[_0xb342('0x3a')]));if(_0x37d262['query'][_0xb342('0x3b')]){_0x14b649[_0xb342('0x39')]=_[_0xb342('0x3c')](_0x14b649[_0xb342('0x39')],{'$or':_[_0xb342('0x2a')](_0x4a92ce,function(_0x127f08){if(_0x127f08[_0xb342('0x3d')]!=='VIRTUAL'){var _0x56d2d9={};_0x56d2d9[_0x127f08[_0xb342('0x28')]]={'$like':'%'+_0x37d262[_0xb342('0x30')][_0xb342('0x3b')]+'%'};return _0x56d2d9;}})});}_0x14b649=_[_0xb342('0x3c')]({},_0x14b649,_0x37d262[_0xb342('0x3e')]);var _0x81c909={'where':_0x14b649[_0xb342('0x39')]};return db[_0xb342('0x2b')][_0xb342('0x1d')](_0x81c909)[_0xb342('0x24')](function(_0x263633){_0x1c8620[_0xb342('0x1d')]=_0x263633;if(_0x37d262[_0xb342('0x30')][_0xb342('0x3f')]){_0x14b649[_0xb342('0x40')]=[{'all':!![]}];}return db[_0xb342('0x2b')]['findAll'](_0x14b649);})['then'](function(_0x58daad){_0x1c8620[_0xb342('0x41')]=_0x58daad;return _0x1c8620;})[_0xb342('0x24')](respondWithFilteredResult(_0x12d5fe,_0x14b649))[_0xb342('0x42')](handleError(_0x12d5fe,null));};exports[_0xb342('0x43')]=function(_0x1723b2,_0x507e83){var _0x4cc0fb={'raw':![],'where':{'id':_0x1723b2['params']['id']}},_0x1cfcf0={};_0x1cfcf0[_0xb342('0x2f')]=_[_0xb342('0x31')](db[_0xb342('0x2b')][_0xb342('0x2c')]);_0x1cfcf0[_0xb342('0x30')]=_[_0xb342('0x31')](_0x1723b2['query']);_0x1cfcf0[_0xb342('0x3a')]=_[_0xb342('0x44')](_0x1cfcf0[_0xb342('0x2f')],_0x1cfcf0['query']);_0x4cc0fb[_0xb342('0x32')]=_[_0xb342('0x44')](_0x1cfcf0['model'],qs[_0xb342('0x33')](_0x1723b2['query'][_0xb342('0x33')]));_0x4cc0fb['attributes']=_0x4cc0fb[_0xb342('0x32')]['length']?_0x4cc0fb['attributes']:_0x1cfcf0[_0xb342('0x2f')];if(_0x1723b2[_0xb342('0x30')][_0xb342('0x3f')]){_0x4cc0fb[_0xb342('0x40')]=[{'all':!![]}];}_0x4cc0fb=_['merge']({},_0x4cc0fb,_0x1723b2[_0xb342('0x3e')]);return db[_0xb342('0x2b')][_0xb342('0x45')](_0x4cc0fb)[_0xb342('0x24')](handleEntityNotFound(_0x507e83,null))[_0xb342('0x24')](respondWithResult(_0x507e83,null))[_0xb342('0x42')](handleError(_0x507e83,null));};exports['create']=function(_0x448ce1,_0x3bb8d0){return db['Dashboard'][_0xb342('0x46')](_0x448ce1[_0xb342('0x47')],{})['then'](function(_0x8f915c){var _0x3a3b61=_0x448ce1[_0xb342('0x48')][_0xb342('0x25')]({'plain':!![]});if(!_0x3a3b61)throw new Error(_0xb342('0x49'));if(_0x3a3b61[_0xb342('0x4a')]===_0xb342('0x48')){var _0x8736b5=_0x8f915c[_0xb342('0x25')]({'plain':!![]});var _0x204fde=_0xb342('0x26');return db[_0xb342('0x4b')]['find']({'where':{'name':_0x204fde,'userProfileId':_0x3a3b61[_0xb342('0x4c')]},'raw':!![]})[_0xb342('0x24')](function(_0x60eda4){if(_0x60eda4&&_0x60eda4[_0xb342('0x4d')]===0x0){return db[_0xb342('0x27')]['create']({'name':_0x8736b5[_0xb342('0x28')],'resourceId':_0x8736b5['id'],'type':_0x60eda4[_0xb342('0x28')],'sectionId':_0x60eda4['id']},{})[_0xb342('0x24')](function(){return _0x8f915c;});}else{return _0x8f915c;}})[_0xb342('0x42')](function(_0x5e3f4b){logger['error'](_0xb342('0x4e'),_0x5e3f4b);throw _0x5e3f4b;});}return _0x8f915c;})['then'](respondWithResult(_0x3bb8d0,0xc9))[_0xb342('0x42')](handleError(_0x3bb8d0,null));};exports[_0xb342('0x4f')]=function(_0x47005b,_0x13da1d){var _0x2ddfa0={'where':{'id':_0x47005b[_0xb342('0x50')]['id']}},_0x8f94e4={};_0x8f94e4[_0xb342('0x2f')]=_[_0xb342('0x31')](db[_0xb342('0x2b')][_0xb342('0x2c')]);_0x2ddfa0[_0xb342('0x32')]=_[_0xb342('0x44')](_0x8f94e4[_0xb342('0x2f')],qs[_0xb342('0x33')](_0x47005b[_0xb342('0x30')][_0xb342('0x33')]));_0x2ddfa0[_0xb342('0x32')]=_0x2ddfa0[_0xb342('0x32')]['length']?_0x2ddfa0['attributes']:_0x8f94e4[_0xb342('0x2f')];if(_0x47005b[_0xb342('0x30')][_0xb342('0x3f')]){_0x2ddfa0['include']=[{'all':!![]}];}_0x2ddfa0=_[_0xb342('0x3c')]({},_0x2ddfa0,_0x47005b['options']);return db['Dashboard'][_0xb342('0x45')](_0x2ddfa0)[_0xb342('0x24')](handleEntityNotFound(_0x13da1d,null))[_0xb342('0x24')](function(_0x27b0bf){if(_0x27b0bf){var _0xf12e4d=_0x27b0bf[_0xb342('0x25')]({'plain':!![]});_0xf12e4d=qs[_0xb342('0x51')](_0xf12e4d,['id',_0xb342('0x52'),_0xb342('0x53')]);_0x47005b[_0xb342('0x47')]=_['omit'](_0x47005b[_0xb342('0x47')],['id','createdAt',_0xb342('0x53')]);return db[_0xb342('0x2b')][_0xb342('0x46')](_[_0xb342('0x3c')](_0xf12e4d,_0x47005b[_0xb342('0x47')]),{'include':_0x47005b[_0xb342('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0xb342('0x24')](function(_0x5dbd82){var _0x5613ea=_0x47005b[_0xb342('0x48')][_0xb342('0x25')]({'plain':!![]});if(!_0x5613ea)throw new Error(_0xb342('0x49'));if(_0x5613ea[_0xb342('0x4a')]===_0xb342('0x48')){var _0x5897f9=_0x5dbd82[_0xb342('0x25')]({'plain':!![]});var _0x9c75c0=_0xb342('0x26');return db[_0xb342('0x4b')][_0xb342('0x45')]({'where':{'name':_0x9c75c0,'userProfileId':_0x5613ea[_0xb342('0x4c')]},'raw':!![]})[_0xb342('0x24')](function(_0x4932da){if(_0x4932da&&_0x4932da[_0xb342('0x4d')]===0x0){return db[_0xb342('0x27')][_0xb342('0x46')]({'name':_0x5897f9[_0xb342('0x28')],'resourceId':_0x5897f9['id'],'type':_0x4932da[_0xb342('0x28')],'sectionId':_0x4932da['id']},{})[_0xb342('0x24')](function(){return _0x5dbd82;});}else{return _0x5dbd82;}})[_0xb342('0x42')](function(_0x37e636){logger[_0xb342('0x54')](_0xb342('0x4e'),_0x37e636);throw _0x37e636;});}return _0x5dbd82;});}})[_0xb342('0x24')](respondWithResult(_0x13da1d,0xc9))['catch'](handleError(_0x13da1d,null));};exports['update']=function(_0xdc7a91,_0x283435){if(_0xdc7a91['body']['id']){delete _0xdc7a91[_0xb342('0x47')]['id'];}return db[_0xb342('0x2b')][_0xb342('0x45')]({'where':{'id':_0xdc7a91[_0xb342('0x50')]['id']}})[_0xb342('0x24')](handleEntityNotFound(_0x283435,null))[_0xb342('0x24')](saveUpdates(_0xdc7a91[_0xb342('0x47')],null))['then'](respondWithResult(_0x283435,null))['catch'](handleError(_0x283435,null));};exports['destroy']=function(_0x25d860,_0x5e1900){return db['Dashboard']['find']({'where':{'id':_0x25d860[_0xb342('0x50')]['id']}})['then'](handleEntityNotFound(_0x5e1900,null))['then'](removeEntity(_0x5e1900,null))[_0xb342('0x42')](handleError(_0x5e1900,null));};function widgetAttributes(_0x2feca6){try{switch(_0x2feca6[_0xb342('0x3d')]){case'iframe':return[{'name':_0xb342('0x55'),'value':_0x2feca6[_0xb342('0x55')]||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x0]?_0x2feca6['attrs'][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':_0xb342('0x57'),'value':_0x2feca6[_0xb342('0x57')]||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x0]?_0x2feca6[_0xb342('0x56')][0x0][_0xb342('0x58')]:undefined)||''}];case _0xb342('0x59'):return[{'name':_0xb342('0x5a'),'value':_0x2feca6['attrHourFormat']||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x0]?_0x2feca6['attrs'][0x0][_0xb342('0x58')]:undefined)||_0xb342('0x5b')},{'name':_0xb342('0x5c'),'value':_0x2feca6[_0xb342('0x5c')]||(_0x2feca6['attrs']&&_0x2feca6['attrs'][0x1]?_0x2feca6['attrs'][0x1]['value']:undefined)||_0xb342('0x5d')},{'name':'attrFontSize','value':_0x2feca6[_0xb342('0x5e')]||(_0x2feca6['attrs']&&_0x2feca6[_0xb342('0x56')][0x2]?_0x2feca6['attrs'][0x2][_0xb342('0x58')]:undefined)||0xc}];case _0xb342('0x5f'):return[{'name':_0xb342('0x60'),'value':_0x2feca6['attrMetric']||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x0]?_0x2feca6[_0xb342('0x56')][0x0][_0xb342('0x58')]:undefined)||_0xb342('0x61')},{'name':_0xb342('0x62'),'value':_0x2feca6[_0xb342('0x62')]||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x1]?_0x2feca6[_0xb342('0x56')][0x1]['value']:undefined)||[]},{'name':_0xb342('0x5e'),'value':_0x2feca6[_0xb342('0x5e')]||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6['attrs'][0x2]?_0x2feca6['attrs'][0x2][_0xb342('0x58')]:undefined)||0x14}];case _0xb342('0x63'):case _0xb342('0x64'):return[{'name':_0xb342('0x65'),'value':_0x2feca6[_0xb342('0x65')]||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x0]?_0x2feca6['attrs'][0x0][_0xb342('0x58')]:undefined)||_0xb342('0x61')},{'name':_0xb342('0x66'),'value':_0x2feca6[_0xb342('0x66')]||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x1]?_0x2feca6[_0xb342('0x56')][0x1][_0xb342('0x58')]:undefined)||null},{'name':_0xb342('0x67'),'value':_0x2feca6[_0xb342('0x67')]||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x2]?_0x2feca6[_0xb342('0x56')][0x2]['value']:undefined)||null},{'name':_0xb342('0x62'),'value':_0x2feca6['attrVoiceQueues']||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x3]?_0x2feca6['attrs'][0x3][_0xb342('0x58')]:undefined)||[]}];case _0xb342('0x68'):return[{'name':_0xb342('0x69'),'type':_0x2feca6['reportType']||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x0]?_0x2feca6[_0xb342('0x56')][0x0]['type']:undefined)||null,'value':_0x2feca6['attrReport']||(_0x2feca6['attrs']&&_0x2feca6[_0xb342('0x56')][0x0]?_0x2feca6[_0xb342('0x56')][0x0][_0xb342('0x58')]:undefined)||null},{'name':_0xb342('0x6a'),'value':_0x2feca6[_0xb342('0x6a')]||(_0x2feca6[_0xb342('0x56')]&&_0x2feca6[_0xb342('0x56')][0x1]?_0x2feca6[_0xb342('0x56')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1c2a30){logger['error'](_0xb342('0x6b'),JSON[_0xb342('0x6c')](_0x1c2a30));return[];}}exports[_0xb342('0x6d')]=function(_0x3e9e23,_0x3cd5ca,_0x512ce0){if(_0x3e9e23['body']['id']){delete _0x3e9e23[_0xb342('0x47')]['id'];}return db[_0xb342('0x2b')][_0xb342('0x45')]({'where':{'id':_0x3e9e23[_0xb342('0x50')]['id']}})[_0xb342('0x24')](handleEntityNotFound(_0x3cd5ca,null))['then'](function(_0x453b8f){if(_0x453b8f){_0x3e9e23[_0xb342('0x47')]['DashboardId']=_0x453b8f['id'];_0x3e9e23[_0xb342('0x47')][_0xb342('0x56')]=widgetAttributes(_0x3e9e23['body']);return db['DashboardItem'][_0xb342('0x46')](_0x3e9e23[_0xb342('0x47')]);}})['then'](respondWithResult(_0x3cd5ca,null))[_0xb342('0x42')](handleError(_0x3cd5ca,null));};exports[_0xb342('0x6e')]=function(_0x59e826,_0x4b5e92,_0x256340){var _0x261ef0={};var _0x331f77={};var _0x5c9cf8;var _0x2eccf9;return db['Dashboard'][_0xb342('0x6f')]({'where':{'id':_0x59e826[_0xb342('0x50')]['id']}})['then'](handleEntityNotFound(_0x4b5e92,null))[_0xb342('0x24')](function(_0x829b82){if(_0x829b82){_0x5c9cf8=_0x829b82;_0x331f77[_0xb342('0x2f')]=_['keys'](db[_0xb342('0x70')]['rawAttributes']);_0x331f77[_0xb342('0x30')]=_[_0xb342('0x31')](_0x59e826[_0xb342('0x30')]);_0x331f77[_0xb342('0x3a')]=_[_0xb342('0x44')](_0x331f77['model'],_0x331f77['query']);_0x261ef0[_0xb342('0x32')]=_['intersection'](_0x331f77[_0xb342('0x2f')],qs[_0xb342('0x33')](_0x59e826['query'][_0xb342('0x33')]));_0x261ef0['attributes']=_0x261ef0[_0xb342('0x32')][_0xb342('0x34')]?_0x261ef0[_0xb342('0x32')]:_0x331f77[_0xb342('0x2f')];_0x261ef0[_0xb342('0x71')]=qs['sort'](_0x59e826[_0xb342('0x30')]['sort']);_0x261ef0[_0xb342('0x39')]=qs[_0xb342('0x3a')](_[_0xb342('0x72')](_0x59e826[_0xb342('0x30')],_0x331f77['filters']));if(_0x59e826[_0xb342('0x30')]['filter']){_0x261ef0['where']=_[_0xb342('0x3c')](_0x261ef0[_0xb342('0x39')],{'$or':_[_0xb342('0x2a')](_0x261ef0[_0xb342('0x32')],function(_0x55b879){var _0xde844d={};_0xde844d[_0x55b879]={'$like':'%'+_0x59e826[_0xb342('0x30')][_0xb342('0x3b')]+'%'};return _0xde844d;})});}_0x261ef0=_['merge']({},_0x261ef0,_0x59e826[_0xb342('0x3e')]);return _0x5c9cf8['getItems'](_0x261ef0);}})[_0xb342('0x24')](function(_0x26d68e){if(_0x26d68e){_0x2eccf9=_0x26d68e[_0xb342('0x34')];if(!_0x59e826[_0xb342('0x30')]['hasOwnProperty'](_0xb342('0x36'))){_0x261ef0[_0xb342('0x37')]=qs[_0xb342('0x37')](_0x59e826[_0xb342('0x30')][_0xb342('0x37')]);_0x261ef0[_0xb342('0x1e')]=qs[_0xb342('0x1e')](_0x59e826[_0xb342('0x30')][_0xb342('0x1e')]);}return _0x5c9cf8['getItems'](_0x261ef0);}})[_0xb342('0x24')](function(_0x4e2a29){if(_0x4e2a29){return _0x4e2a29?{'count':_0x2eccf9,'rows':_0x4e2a29}:null;}})[_0xb342('0x24')](respondWithResult(_0x4b5e92,null))['catch'](handleError(_0x4b5e92,null));}; \ No newline at end of file +var _0xb634=['json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CustomDashboards','destroy','error','name','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','Dashboard','count','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','getItems','DashboardItem','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status'];(function(_0x208b7a,_0x2e3baa){var _0x37b7ec=function(_0x3a163d){while(--_0x3a163d){_0x208b7a['push'](_0x208b7a['shift']());}};_0x37b7ec(++_0x2e3baa);}(_0xb634,0x1c0));var _0x4b63=function(_0x3464b8,_0x2276a4){_0x3464b8=_0x3464b8-0x0;var _0x4e712b=_0xb634[_0x3464b8];return _0x4e712b;};'use strict';var pdf=require(_0x4b63('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4b63('0x1'));var zipdir=require(_0x4b63('0x2'));var jsonpatch=require(_0x4b63('0x3'));var rp=require('request-promise');var moment=require(_0x4b63('0x4'));var BPromise=require(_0x4b63('0x5'));var Mustache=require(_0x4b63('0x6'));var util=require(_0x4b63('0x7'));var path=require(_0x4b63('0x8'));var sox=require(_0x4b63('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4b63('0xa'));var squel=require('squel');var crypto=require(_0x4b63('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4b63('0xc'));var toCsv=require(_0x4b63('0xd'));var querystring=require('querystring');var Papa=require(_0x4b63('0xe'));var Redis=require(_0x4b63('0xf'));var authService=require(_0x4b63('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4b63('0x11'));var hardwareService=require(_0x4b63('0x12'));var logger=require(_0x4b63('0x13'))(_0x4b63('0x14'));var utils=require(_0x4b63('0x15'));var config=require(_0x4b63('0x16'));var db=require(_0x4b63('0x17'))['db'];config[_0x4b63('0x18')]=_[_0x4b63('0x19')](config[_0x4b63('0x18')],{'host':_0x4b63('0x1a'),'port':0x18eb});var socket=require(_0x4b63('0x1b'))(new Redis(config['redis']));require(_0x4b63('0x1c'))[_0x4b63('0x1d')](socket);function respondWithStatusCode(_0x35a5fb,_0x1d0374){_0x1d0374=_0x1d0374||0xcc;return function(_0x2a1ac4){if(_0x2a1ac4){return _0x35a5fb[_0x4b63('0x1e')](_0x1d0374);}return _0x35a5fb[_0x4b63('0x1f')](_0x1d0374)['end']();};}function respondWithResult(_0x975c4b,_0x49709e){_0x49709e=_0x49709e||0xc8;return function(_0xc64de5){if(_0xc64de5){return _0x975c4b[_0x4b63('0x1f')](_0x49709e)[_0x4b63('0x20')](_0xc64de5);}};}function respondWithFilteredResult(_0x33caeb,_0x197498){return function(_0x225a14){if(_0x225a14){var _0x1e488c=_0x225a14['count'],_0x499224=_0x197498[_0x4b63('0x21')],_0x523863=_0x197498[_0x4b63('0x21')]+_0x197498[_0x4b63('0x22')],_0x710564;if(_0x523863>=_0x1e488c){_0x523863=_0x1e488c;_0x710564=0xc8;}else{_0x710564=0xce;}_0x33caeb['status'](_0x710564);return _0x33caeb[_0x4b63('0x23')](_0x4b63('0x24'),_0x499224+'-'+_0x523863+'/'+_0x1e488c)['json'](_0x225a14);}return null;};}function patchUpdates(_0x59a3d2){return function(_0x1765b5){try{jsonpatch[_0x4b63('0x25')](_0x1765b5,_0x59a3d2,!![]);}catch(_0xc7c856){return BPromise[_0x4b63('0x26')](_0xc7c856);}return _0x1765b5[_0x4b63('0x27')]();};}function saveUpdates(_0x167337,_0x2350dc){return function(_0x22dd9a){if(_0x22dd9a){return _0x22dd9a[_0x4b63('0x28')](_0x167337)[_0x4b63('0x29')](function(_0xacb37a){return _0xacb37a;});}return null;};}function removeEntity(_0x269faf,_0x8940d6){return function(_0x3d7d75){if(_0x3d7d75){return _0x3d7d75['destroy']()[_0x4b63('0x29')](function(){var _0x32f976=_0x3d7d75[_0x4b63('0x2a')]({'plain':!![]});var _0x26b6f9=_0x4b63('0x2b');return db['UserProfileResource'][_0x4b63('0x2c')]({'where':{'type':_0x26b6f9,'resourceId':_0x32f976['id']}})['then'](function(){return _0x3d7d75;});})[_0x4b63('0x29')](function(){_0x269faf[_0x4b63('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c710,_0x2e5eb7){return function(_0x3724c0){if(!_0x3724c0){_0x51c710[_0x4b63('0x1e')](0x194);}return _0x3724c0;};}function handleError(_0x46aa17,_0x8852f1){_0x8852f1=_0x8852f1||0x1f4;return function(_0x208af0){logger[_0x4b63('0x2d')](_0x208af0['stack']);if(_0x208af0[_0x4b63('0x2e')]){delete _0x208af0['name'];}_0x46aa17['status'](_0x8852f1)['send'](_0x208af0);};}exports['index']=function(_0x5a28b7,_0x5741c4){var _0x2ff162={},_0x3dad17={},_0x362935={'count':0x0,'rows':[]};var _0x807447=_[_0x4b63('0x2f')](db['Dashboard'][_0x4b63('0x30')],function(_0x4e081a){return{'name':_0x4e081a[_0x4b63('0x31')],'type':_0x4e081a[_0x4b63('0x32')][_0x4b63('0x33')]};});_0x3dad17[_0x4b63('0x34')]=_[_0x4b63('0x2f')](_0x807447,_0x4b63('0x2e'));_0x3dad17['query']=_[_0x4b63('0x35')](_0x5a28b7['query']);_0x3dad17['filters']=_[_0x4b63('0x36')](_0x3dad17[_0x4b63('0x34')],_0x3dad17[_0x4b63('0x37')]);_0x2ff162['attributes']=_[_0x4b63('0x36')](_0x3dad17['model'],qs[_0x4b63('0x38')](_0x5a28b7[_0x4b63('0x37')]['fields']));_0x2ff162[_0x4b63('0x39')]=_0x2ff162['attributes'][_0x4b63('0x3a')]?_0x2ff162['attributes']:_0x3dad17[_0x4b63('0x34')];if(!_0x5a28b7[_0x4b63('0x37')][_0x4b63('0x3b')]('nolimit')){_0x2ff162['limit']=qs[_0x4b63('0x22')](_0x5a28b7['query']['limit']);_0x2ff162[_0x4b63('0x21')]=qs['offset'](_0x5a28b7[_0x4b63('0x37')][_0x4b63('0x21')]);}_0x2ff162[_0x4b63('0x3c')]=qs[_0x4b63('0x3d')](_0x5a28b7[_0x4b63('0x37')]['sort']);_0x2ff162[_0x4b63('0x3e')]=qs['filters'](_[_0x4b63('0x3f')](_0x5a28b7[_0x4b63('0x37')],_0x3dad17[_0x4b63('0x40')]));if(_0x5a28b7[_0x4b63('0x37')][_0x4b63('0x41')]){_0x2ff162[_0x4b63('0x3e')]=_[_0x4b63('0x42')](_0x2ff162[_0x4b63('0x3e')],{'$or':_[_0x4b63('0x2f')](_0x807447,function(_0x3c0930){if(_0x3c0930[_0x4b63('0x32')]!==_0x4b63('0x43')){var _0xdfd43e={};_0xdfd43e[_0x3c0930[_0x4b63('0x2e')]]={'$like':'%'+_0x5a28b7[_0x4b63('0x37')]['filter']+'%'};return _0xdfd43e;}})});}_0x2ff162=_['merge']({},_0x2ff162,_0x5a28b7[_0x4b63('0x44')]);var _0x3c5d12={'where':_0x2ff162['where']};return db[_0x4b63('0x45')][_0x4b63('0x46')](_0x3c5d12)[_0x4b63('0x29')](function(_0xbc542e){_0x362935[_0x4b63('0x46')]=_0xbc542e;if(_0x5a28b7[_0x4b63('0x37')][_0x4b63('0x47')]){_0x2ff162[_0x4b63('0x48')]=[{'all':!![]}];}return db[_0x4b63('0x45')]['findAll'](_0x2ff162);})[_0x4b63('0x29')](function(_0x522b1c){_0x362935[_0x4b63('0x49')]=_0x522b1c;return _0x362935;})['then'](respondWithFilteredResult(_0x5741c4,_0x2ff162))[_0x4b63('0x4a')](handleError(_0x5741c4,null));};exports[_0x4b63('0x4b')]=function(_0xfc33d2,_0x3bb882){var _0x3f3ca8={'raw':![],'where':{'id':_0xfc33d2[_0x4b63('0x4c')]['id']}},_0x1071e0={};_0x1071e0[_0x4b63('0x34')]=_['keys'](db[_0x4b63('0x45')][_0x4b63('0x30')]);_0x1071e0[_0x4b63('0x37')]=_[_0x4b63('0x35')](_0xfc33d2[_0x4b63('0x37')]);_0x1071e0[_0x4b63('0x40')]=_[_0x4b63('0x36')](_0x1071e0[_0x4b63('0x34')],_0x1071e0[_0x4b63('0x37')]);_0x3f3ca8[_0x4b63('0x39')]=_[_0x4b63('0x36')](_0x1071e0[_0x4b63('0x34')],qs[_0x4b63('0x38')](_0xfc33d2['query'][_0x4b63('0x38')]));_0x3f3ca8[_0x4b63('0x39')]=_0x3f3ca8['attributes'][_0x4b63('0x3a')]?_0x3f3ca8['attributes']:_0x1071e0[_0x4b63('0x34')];if(_0xfc33d2[_0x4b63('0x37')][_0x4b63('0x47')]){_0x3f3ca8[_0x4b63('0x48')]=[{'all':!![]}];}_0x3f3ca8=_[_0x4b63('0x42')]({},_0x3f3ca8,_0xfc33d2[_0x4b63('0x44')]);return db[_0x4b63('0x45')][_0x4b63('0x4d')](_0x3f3ca8)[_0x4b63('0x29')](handleEntityNotFound(_0x3bb882,null))[_0x4b63('0x29')](respondWithResult(_0x3bb882,null))[_0x4b63('0x4a')](handleError(_0x3bb882,null));};exports[_0x4b63('0x4e')]=function(_0x35f4cf,_0x503afe){return db['Dashboard'][_0x4b63('0x4e')](_0x35f4cf['body'],{})[_0x4b63('0x29')](function(_0xe76e15){var _0x42fdb9=_0x35f4cf[_0x4b63('0x4f')]['get']({'plain':!![]});if(!_0x42fdb9)throw new Error(_0x4b63('0x50'));if(_0x42fdb9[_0x4b63('0x51')]===_0x4b63('0x4f')){var _0xf07322=_0xe76e15['get']({'plain':!![]});var _0xc4b8cb=_0x4b63('0x2b');return db[_0x4b63('0x52')]['find']({'where':{'name':_0xc4b8cb,'userProfileId':_0x42fdb9[_0x4b63('0x53')]},'raw':!![]})[_0x4b63('0x29')](function(_0x58b70e){if(_0x58b70e&&_0x58b70e['autoAssociation']===0x0){return db[_0x4b63('0x54')][_0x4b63('0x4e')]({'name':_0xf07322[_0x4b63('0x2e')],'resourceId':_0xf07322['id'],'type':_0x58b70e[_0x4b63('0x2e')],'sectionId':_0x58b70e['id']},{})[_0x4b63('0x29')](function(){return _0xe76e15;});}else{return _0xe76e15;}})['catch'](function(_0x13f290){logger[_0x4b63('0x2d')](_0x4b63('0x55'),_0x13f290);throw _0x13f290;});}return _0xe76e15;})['then'](respondWithResult(_0x503afe,0xc9))[_0x4b63('0x4a')](handleError(_0x503afe,null));};exports[_0x4b63('0x56')]=function(_0x1dfacb,_0x4b4891){var _0x351406={'where':{'id':_0x1dfacb['params']['id']}},_0x549fd8={};_0x549fd8[_0x4b63('0x34')]=_[_0x4b63('0x35')](db[_0x4b63('0x45')][_0x4b63('0x30')]);_0x351406[_0x4b63('0x39')]=_[_0x4b63('0x36')](_0x549fd8[_0x4b63('0x34')],qs[_0x4b63('0x38')](_0x1dfacb[_0x4b63('0x37')]['fields']));_0x351406['attributes']=_0x351406['attributes'][_0x4b63('0x3a')]?_0x351406[_0x4b63('0x39')]:_0x549fd8['model'];if(_0x1dfacb[_0x4b63('0x37')][_0x4b63('0x47')]){_0x351406[_0x4b63('0x48')]=[{'all':!![]}];}_0x351406=_['merge']({},_0x351406,_0x1dfacb[_0x4b63('0x44')]);return db[_0x4b63('0x45')]['find'](_0x351406)[_0x4b63('0x29')](handleEntityNotFound(_0x4b4891,null))[_0x4b63('0x29')](function(_0x574063){if(_0x574063){var _0x57936d=_0x574063[_0x4b63('0x2a')]({'plain':!![]});_0x57936d=qs['omit'](_0x57936d,['id',_0x4b63('0x57'),_0x4b63('0x58')]);_0x1dfacb[_0x4b63('0x59')]=_[_0x4b63('0x5a')](_0x1dfacb[_0x4b63('0x59')],['id',_0x4b63('0x57'),_0x4b63('0x58')]);return db['Dashboard'][_0x4b63('0x4e')](_['merge'](_0x57936d,_0x1dfacb[_0x4b63('0x59')]),{'include':_0x1dfacb[_0x4b63('0x37')][_0x4b63('0x47')]?[{'all':!![]}]:undefined})[_0x4b63('0x29')](function(_0x570f72){var _0x19b26e=_0x1dfacb[_0x4b63('0x4f')][_0x4b63('0x2a')]({'plain':!![]});if(!_0x19b26e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19b26e['role']===_0x4b63('0x4f')){var _0x343004=_0x570f72[_0x4b63('0x2a')]({'plain':!![]});var _0x45b550='CustomDashboards';return db[_0x4b63('0x52')][_0x4b63('0x4d')]({'where':{'name':_0x45b550,'userProfileId':_0x19b26e[_0x4b63('0x53')]},'raw':!![]})[_0x4b63('0x29')](function(_0x3d0c2f){if(_0x3d0c2f&&_0x3d0c2f[_0x4b63('0x5b')]===0x0){return db[_0x4b63('0x54')][_0x4b63('0x4e')]({'name':_0x343004['name'],'resourceId':_0x343004['id'],'type':_0x3d0c2f[_0x4b63('0x2e')],'sectionId':_0x3d0c2f['id']},{})[_0x4b63('0x29')](function(){return _0x570f72;});}else{return _0x570f72;}})[_0x4b63('0x4a')](function(_0x273f41){logger[_0x4b63('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x273f41);throw _0x273f41;});}return _0x570f72;});}})[_0x4b63('0x29')](respondWithResult(_0x4b4891,0xc9))[_0x4b63('0x4a')](handleError(_0x4b4891,null));};exports[_0x4b63('0x28')]=function(_0x5eadf2,_0x10163c){if(_0x5eadf2['body']['id']){delete _0x5eadf2[_0x4b63('0x59')]['id'];}return db['Dashboard'][_0x4b63('0x4d')]({'where':{'id':_0x5eadf2[_0x4b63('0x4c')]['id']}})[_0x4b63('0x29')](handleEntityNotFound(_0x10163c,null))['then'](saveUpdates(_0x5eadf2[_0x4b63('0x59')],null))['then'](respondWithResult(_0x10163c,null))['catch'](handleError(_0x10163c,null));};exports[_0x4b63('0x2c')]=function(_0x2703f5,_0x2f564c){return db[_0x4b63('0x45')]['find']({'where':{'id':_0x2703f5[_0x4b63('0x4c')]['id']}})[_0x4b63('0x29')](handleEntityNotFound(_0x2f564c,null))['then'](removeEntity(_0x2f564c,null))[_0x4b63('0x4a')](handleError(_0x2f564c,null));};function widgetAttributes(_0x1a2c4b){try{switch(_0x1a2c4b[_0x4b63('0x32')]){case _0x4b63('0x5c'):return[{'name':_0x4b63('0x5d'),'value':_0x1a2c4b['attrUrl']||(_0x1a2c4b['attrs']&&_0x1a2c4b[_0x4b63('0x5e')][0x0]?_0x1a2c4b['attrs'][0x0][_0x4b63('0x5f')]:undefined)||_0x4b63('0x60')}];case _0x4b63('0x61'):return[{'name':_0x4b63('0x62'),'value':_0x1a2c4b['attrPath']||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x0]?_0x1a2c4b[_0x4b63('0x5e')][0x0][_0x4b63('0x5f')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x1a2c4b[_0x4b63('0x63')]||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x0]?_0x1a2c4b[_0x4b63('0x5e')][0x0][_0x4b63('0x5f')]:undefined)||_0x4b63('0x64')},{'name':'attrTimezone','value':_0x1a2c4b[_0x4b63('0x65')]||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x1]?_0x1a2c4b[_0x4b63('0x5e')][0x1]['value']:undefined)||_0x4b63('0x66')},{'name':_0x4b63('0x67'),'value':_0x1a2c4b[_0x4b63('0x67')]||(_0x1a2c4b['attrs']&&_0x1a2c4b[_0x4b63('0x5e')][0x2]?_0x1a2c4b[_0x4b63('0x5e')][0x2][_0x4b63('0x5f')]:undefined)||0xc}];case _0x4b63('0x68'):return[{'name':_0x4b63('0x69'),'value':_0x1a2c4b['attrMetric']||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x0]?_0x1a2c4b[_0x4b63('0x5e')][0x0][_0x4b63('0x5f')]:undefined)||_0x4b63('0x6a')},{'name':_0x4b63('0x6b'),'value':_0x1a2c4b[_0x4b63('0x6b')]||(_0x1a2c4b['attrs']&&_0x1a2c4b['attrs'][0x1]?_0x1a2c4b[_0x4b63('0x5e')][0x1]['value']:undefined)||[]},{'name':_0x4b63('0x67'),'value':_0x1a2c4b[_0x4b63('0x67')]||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x2]?_0x1a2c4b[_0x4b63('0x5e')][0x2][_0x4b63('0x5f')]:undefined)||0x14}];case _0x4b63('0x6c'):case _0x4b63('0x6d'):return[{'name':_0x4b63('0x6e'),'value':_0x1a2c4b[_0x4b63('0x6e')]||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b['attrs'][0x0]?_0x1a2c4b['attrs'][0x0]['value']:undefined)||_0x4b63('0x6a')},{'name':_0x4b63('0x6f'),'value':_0x1a2c4b['attrSerie2']||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x1]?_0x1a2c4b[_0x4b63('0x5e')][0x1]['value']:undefined)||null},{'name':_0x4b63('0x70'),'value':_0x1a2c4b['attrSerie3']||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x2]?_0x1a2c4b['attrs'][0x2]['value']:undefined)||null},{'name':_0x4b63('0x6b'),'value':_0x1a2c4b[_0x4b63('0x6b')]||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x3]?_0x1a2c4b[_0x4b63('0x5e')][0x3][_0x4b63('0x5f')]:undefined)||[]}];case'web-report':return[{'name':_0x4b63('0x71'),'type':_0x1a2c4b[_0x4b63('0x72')]||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x0]?_0x1a2c4b['attrs'][0x0][_0x4b63('0x32')]:undefined)||null,'value':_0x1a2c4b[_0x4b63('0x71')]||(_0x1a2c4b[_0x4b63('0x5e')]&&_0x1a2c4b[_0x4b63('0x5e')][0x0]?_0x1a2c4b['attrs'][0x0][_0x4b63('0x5f')]:undefined)||null},{'name':_0x4b63('0x73'),'value':_0x1a2c4b['attrRefresh']||(_0x1a2c4b['attrs']&&_0x1a2c4b['attrs'][0x1]?_0x1a2c4b[_0x4b63('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xa27876){logger[_0x4b63('0x2d')](_0x4b63('0x74'),JSON[_0x4b63('0x75')](_0xa27876));return[];}}exports['addItem']=function(_0x5ecbad,_0x4845fd,_0x482959){if(_0x5ecbad['body']['id']){delete _0x5ecbad['body']['id'];}return db['Dashboard'][_0x4b63('0x4d')]({'where':{'id':_0x5ecbad[_0x4b63('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4845fd,null))[_0x4b63('0x29')](function(_0x5ccb6b){if(_0x5ccb6b){_0x5ecbad['body']['DashboardId']=_0x5ccb6b['id'];_0x5ecbad[_0x4b63('0x59')]['attrs']=widgetAttributes(_0x5ecbad[_0x4b63('0x59')]);return db['DashboardItem'][_0x4b63('0x4e')](_0x5ecbad[_0x4b63('0x59')]);}})[_0x4b63('0x29')](respondWithResult(_0x4845fd,null))[_0x4b63('0x4a')](handleError(_0x4845fd,null));};exports[_0x4b63('0x76')]=function(_0x74a87f,_0x27624a,_0xcc723c){var _0x52e9c8={};var _0x120ab6={};var _0x5a33e9;var _0x53cead;return db[_0x4b63('0x45')]['findOne']({'where':{'id':_0x74a87f[_0x4b63('0x4c')]['id']}})[_0x4b63('0x29')](handleEntityNotFound(_0x27624a,null))['then'](function(_0x2f1189){if(_0x2f1189){_0x5a33e9=_0x2f1189;_0x120ab6[_0x4b63('0x34')]=_[_0x4b63('0x35')](db[_0x4b63('0x77')][_0x4b63('0x30')]);_0x120ab6[_0x4b63('0x37')]=_[_0x4b63('0x35')](_0x74a87f[_0x4b63('0x37')]);_0x120ab6[_0x4b63('0x40')]=_[_0x4b63('0x36')](_0x120ab6[_0x4b63('0x34')],_0x120ab6[_0x4b63('0x37')]);_0x52e9c8[_0x4b63('0x39')]=_[_0x4b63('0x36')](_0x120ab6[_0x4b63('0x34')],qs['fields'](_0x74a87f['query'][_0x4b63('0x38')]));_0x52e9c8[_0x4b63('0x39')]=_0x52e9c8[_0x4b63('0x39')][_0x4b63('0x3a')]?_0x52e9c8['attributes']:_0x120ab6[_0x4b63('0x34')];_0x52e9c8[_0x4b63('0x3c')]=qs[_0x4b63('0x3d')](_0x74a87f['query'][_0x4b63('0x3d')]);_0x52e9c8[_0x4b63('0x3e')]=qs[_0x4b63('0x40')](_[_0x4b63('0x3f')](_0x74a87f[_0x4b63('0x37')],_0x120ab6[_0x4b63('0x40')]));if(_0x74a87f[_0x4b63('0x37')][_0x4b63('0x41')]){_0x52e9c8['where']=_[_0x4b63('0x42')](_0x52e9c8[_0x4b63('0x3e')],{'$or':_[_0x4b63('0x2f')](_0x52e9c8[_0x4b63('0x39')],function(_0x34ee0c){var _0x324219={};_0x324219[_0x34ee0c]={'$like':'%'+_0x74a87f[_0x4b63('0x37')][_0x4b63('0x41')]+'%'};return _0x324219;})});}_0x52e9c8=_[_0x4b63('0x42')]({},_0x52e9c8,_0x74a87f[_0x4b63('0x44')]);return _0x5a33e9[_0x4b63('0x76')](_0x52e9c8);}})[_0x4b63('0x29')](function(_0x22627a){if(_0x22627a){_0x53cead=_0x22627a['length'];if(!_0x74a87f['query']['hasOwnProperty']('nolimit')){_0x52e9c8['limit']=qs['limit'](_0x74a87f[_0x4b63('0x37')][_0x4b63('0x22')]);_0x52e9c8['offset']=qs[_0x4b63('0x21')](_0x74a87f['query'][_0x4b63('0x21')]);}return _0x5a33e9['getItems'](_0x52e9c8);}})[_0x4b63('0x29')](function(_0xf65c38){if(_0xf65c38){return _0xf65c38?{'count':_0x53cead,'rows':_0xf65c38}:null;}})[_0x4b63('0x29')](respondWithResult(_0x27624a,null))[_0x4b63('0x4a')](handleError(_0x27624a,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 6737e95..038df8c 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b10=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x39dcbd,_0x13e264){var _0x2f823e=function(_0x9fa98f){while(--_0x9fa98f){_0x39dcbd['push'](_0x39dcbd['shift']());}};_0x2f823e(++_0x13e264);}(_0x7b10,0x88));var _0x07b1=function(_0x4b6e64,_0x16c750){_0x4b6e64=_0x4b6e64-0x0;var _0x1fdb35=_0x7b10[_0x4b6e64];return _0x1fdb35;};'use strict';var EventEmitter=require(_0x07b1('0x0'));var Dashboard=require(_0x07b1('0x1'))['db'][_0x07b1('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x07b1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x07b1('0x4'),'afterDestroy':_0x07b1('0x5')};function emitEvent(_0x388823){return function(_0x316aad,_0x1d2b1d,_0x18b8cc){DashboardEvents[_0x07b1('0x6')](_0x388823+':'+_0x316aad['id'],_0x316aad);DashboardEvents['emit'](_0x388823,_0x316aad);_0x18b8cc(null);};}for(var e in events){if(events[_0x07b1('0x7')](e)){var event=events[e];Dashboard[_0x07b1('0x8')](e,emitEvent(event));}}module[_0x07b1('0x9')]=DashboardEvents; \ No newline at end of file +var _0xc5c2=['../../mysqldb','Dashboard','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x4cc8f0,_0xa5073c){var _0x3b91b1=function(_0x3cf6c5){while(--_0x3cf6c5){_0x4cc8f0['push'](_0x4cc8f0['shift']());}};_0x3b91b1(++_0xa5073c);}(_0xc5c2,0xe0));var _0x2c5c=function(_0x146927,_0x209e79){_0x146927=_0x146927-0x0;var _0x3f6d26=_0xc5c2[_0x146927];return _0x3f6d26;};'use strict';var EventEmitter=require(_0x2c5c('0x0'));var Dashboard=require(_0x2c5c('0x1'))['db'][_0x2c5c('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x2c5c('0x3')](0x0);var events={'afterCreate':_0x2c5c('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4262c9){return function(_0x2bd386,_0x2b18dc,_0x54e0c6){DashboardEvents['emit'](_0x4262c9+':'+_0x2bd386['id'],_0x2bd386);DashboardEvents[_0x2c5c('0x5')](_0x4262c9,_0x2bd386);_0x54e0c6(null);};}for(var e in events){if(events[_0x2c5c('0x6')](e)){var event=events[e];Dashboard[_0x2c5c('0x7')](e,emitEvent(event));}}module[_0x2c5c('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 511cebd..2c3bea5 100644 --- a/server/api/dashboard/dashboard.model.js +++ b/server/api/dashboard/dashboard.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74be=['rimraf','../../config/environment','./dashboard.attributes','exports','dashboards','lodash','api','moment','bluebird','request-promise','path'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x74be,0x191));var _0xe74b=function(_0xfd2ef9,_0x3d3daf){_0xfd2ef9=_0xfd2ef9-0x0;var _0x15898c=_0x74be[_0xfd2ef9];return _0x15898c;};'use strict';var _=require(_0xe74b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe74b('0x1'));var moment=require(_0xe74b('0x2'));var BPromise=require(_0xe74b('0x3'));var rp=require(_0xe74b('0x4'));var fs=require('fs');var path=require(_0xe74b('0x5'));var rimraf=require(_0xe74b('0x6'));var config=require(_0xe74b('0x7'));var attributes=require(_0xe74b('0x8'));module[_0xe74b('0x9')]=function(_0x1584bd,_0x4e3260){return _0x1584bd['define']('Dashboard',attributes,{'tableName':_0xe74b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac1a=['dashboards','lodash','util','../../config/logger','api','path','./dashboard.attributes','Dashboard'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xac1a,0xa9));var _0xaac1=function(_0x32e4de,_0x7da1c5){_0x32e4de=_0x32e4de-0x0;var _0x51ba2a=_0xac1a[_0x32e4de];return _0x51ba2a;};'use strict';var _=require(_0xaac1('0x0'));var util=require(_0xaac1('0x1'));var logger=require(_0xaac1('0x2'))(_0xaac1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaac1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaac1('0x5'));module['exports']=function(_0x253dd6,_0x161660){return _0x253dd6['define'](_0xaac1('0x6'),attributes,{'tableName':_0xaac1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index eb4cee3..66ed381 100644 --- a/server/api/dashboard/dashboard.rpc.js +++ b/server/api/dashboard/dashboard.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb172=['localhost','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x21c344,_0x11ce0d){var _0x3c0c59=function(_0x4a572f){while(--_0x4a572f){_0x21c344['push'](_0x21c344['shift']());}};_0x3c0c59(++_0x11ce0d);}(_0xb172,0x75));var _0x2b17=function(_0x1d92ce,_0x84f51e){_0x1d92ce=_0x1d92ce-0x0;var _0x4dd1cc=_0xb172[_0x1d92ce];return _0x4dd1cc;};'use strict';var _=require(_0x2b17('0x0'));var util=require(_0x2b17('0x1'));var moment=require(_0x2b17('0x2'));var BPromise=require('bluebird');var rs=require(_0x2b17('0x3'));var fs=require('fs');var Redis=require(_0x2b17('0x4'));var db=require(_0x2b17('0x5'))['db'];var utils=require(_0x2b17('0x6'));var logger=require(_0x2b17('0x7'))('rpc');var config=require(_0x2b17('0x8'));var jayson=require(_0x2b17('0x9'));var client=jayson[_0x2b17('0xa')][_0x2b17('0xb')]({'port':0x232a});config[_0x2b17('0xc')]=_['defaults'](config[_0x2b17('0xc')],{'host':_0x2b17('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b17('0xc')]));require(_0x2b17('0xe'))[_0x2b17('0xf')](socket);function respondWithRpcPromise(_0x4b5ce2,_0x282c6c,_0x1db730){return new BPromise(function(_0x5ce38e,_0x28c3c6){return client['request'](_0x4b5ce2,_0x1db730)[_0x2b17('0x10')](function(_0xfd1424){logger[_0x2b17('0x11')](_0x2b17('0x12'),_0x282c6c,_0x2b17('0x13'));logger['debug'](_0x2b17('0x14'),_0x282c6c,'request\x20sent',JSON[_0x2b17('0x15')](_0xfd1424));if(_0xfd1424['error']){if(_0xfd1424[_0x2b17('0x16')][_0x2b17('0x17')]===0x1f4){logger[_0x2b17('0x16')](_0x2b17('0x12'),_0x282c6c,_0xfd1424['error'][_0x2b17('0x18')]);return _0x28c3c6(_0xfd1424['error'][_0x2b17('0x18')]);}logger[_0x2b17('0x16')](_0x2b17('0x12'),_0x282c6c,_0xfd1424[_0x2b17('0x16')][_0x2b17('0x18')]);return _0x5ce38e(_0xfd1424[_0x2b17('0x16')][_0x2b17('0x18')]);}else{logger[_0x2b17('0x11')](_0x2b17('0x12'),_0x282c6c,_0x2b17('0x13'));_0x5ce38e(_0xfd1424[_0x2b17('0x19')]['message']);}})['catch'](function(_0x1051cd){logger['error'](_0x2b17('0x12'),_0x282c6c,_0x1051cd);_0x28c3c6(_0x1051cd);});});} \ No newline at end of file +var _0xd658=['defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x334ad2,_0xcd1829){var _0x1560eb=function(_0x99e5a3){while(--_0x99e5a3){_0x334ad2['push'](_0x334ad2['shift']());}};_0x1560eb(++_0xcd1829);}(_0xd658,0xe8));var _0x8d65=function(_0x2bef33,_0x10fad0){_0x2bef33=_0x2bef33-0x0;var _0x384346=_0xd658[_0x2bef33];return _0x384346;};'use strict';var _=require('lodash');var util=require(_0x8d65('0x0'));var moment=require(_0x8d65('0x1'));var BPromise=require(_0x8d65('0x2'));var rs=require(_0x8d65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d65('0x4'));var logger=require(_0x8d65('0x5'))(_0x8d65('0x6'));var config=require(_0x8d65('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8d65('0x8')][_0x8d65('0x9')]({'port':0x232a});config[_0x8d65('0xa')]=_[_0x8d65('0xb')](config[_0x8d65('0xa')],{'host':_0x8d65('0xc'),'port':0x18eb});var socket=require(_0x8d65('0xd'))(new Redis(config[_0x8d65('0xa')]));require(_0x8d65('0xe'))[_0x8d65('0xf')](socket);function respondWithRpcPromise(_0x471f09,_0x2304ec,_0x50ff95){return new BPromise(function(_0x3a42ca,_0x48469f){return client['request'](_0x471f09,_0x50ff95)[_0x8d65('0x10')](function(_0x4b8bc1){logger[_0x8d65('0x11')](_0x8d65('0x12'),_0x2304ec,'request\x20sent');logger[_0x8d65('0x13')](_0x8d65('0x14'),_0x2304ec,'request\x20sent',JSON[_0x8d65('0x15')](_0x4b8bc1));if(_0x4b8bc1[_0x8d65('0x16')]){if(_0x4b8bc1['error'][_0x8d65('0x17')]===0x1f4){logger[_0x8d65('0x16')](_0x8d65('0x12'),_0x2304ec,_0x4b8bc1[_0x8d65('0x16')][_0x8d65('0x18')]);return _0x48469f(_0x4b8bc1['error']['message']);}logger[_0x8d65('0x16')](_0x8d65('0x12'),_0x2304ec,_0x4b8bc1[_0x8d65('0x16')][_0x8d65('0x18')]);return _0x3a42ca(_0x4b8bc1[_0x8d65('0x16')][_0x8d65('0x18')]);}else{logger[_0x8d65('0x11')](_0x8d65('0x12'),_0x2304ec,_0x8d65('0x19'));_0x3a42ca(_0x4b8bc1['result'][_0x8d65('0x18')]);}})[_0x8d65('0x1a')](function(_0x1b0cf0){logger[_0x8d65('0x16')](_0x8d65('0x12'),_0x2304ec,_0x1b0cf0);_0x48469f(_0x1b0cf0);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 50be651..cea2268 100644 --- a/server/api/dashboard/dashboard.socket.js +++ b/server/api/dashboard/dashboard.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10f3=['register','dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x449d5e,_0x16a219){var _0x23ea11=function(_0x1b1495){while(--_0x1b1495){_0x449d5e['push'](_0x449d5e['shift']());}};_0x23ea11(++_0x16a219);}(_0x10f3,0x13a));var _0x310f=function(_0x1916db,_0x35c653){_0x1916db=_0x1916db-0x0;var _0x58e94a=_0x10f3[_0x1916db];return _0x58e94a;};'use strict';var DashboardEvents=require(_0x310f('0x0'));var events=[_0x310f('0x1'),_0x310f('0x2'),_0x310f('0x3')];function createListener(_0x22141a,_0x4e422d){return function(_0x36efc2){_0x4e422d[_0x310f('0x4')](_0x22141a,_0x36efc2);};}function removeListener(_0x2b5475,_0x1e9bc1){return function(){DashboardEvents[_0x310f('0x5')](_0x2b5475,_0x1e9bc1);};}exports[_0x310f('0x6')]=function(_0xa616e6){for(var _0x114ebd=0x0,_0x3ccb25=events['length'];_0x114ebd<_0x3ccb25;_0x114ebd++){var _0x1f332e=events[_0x114ebd];var _0x3d75b5=createListener(_0x310f('0x7')+_0x1f332e,_0xa616e6);DashboardEvents['on'](_0x1f332e,_0x3d75b5);}}; \ No newline at end of file +var _0xcd4d=['save','remove','emit','dashboard:'];(function(_0x159480,_0x2c913d){var _0x4a9332=function(_0x35a490){while(--_0x35a490){_0x159480['push'](_0x159480['shift']());}};_0x4a9332(++_0x2c913d);}(_0xcd4d,0x1e8));var _0xdcd4=function(_0x29d306,_0x5d97a8){_0x29d306=_0x29d306-0x0;var _0x925e20=_0xcd4d[_0x29d306];return _0x925e20;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xdcd4('0x0'),_0xdcd4('0x1'),'update'];function createListener(_0x388c00,_0x1de07a){return function(_0x1e72bc){_0x1de07a[_0xdcd4('0x2')](_0x388c00,_0x1e72bc);};}function removeListener(_0x34c529,_0x3496b7){return function(){DashboardEvents['removeListener'](_0x34c529,_0x3496b7);};}exports['register']=function(_0x1c918b){for(var _0x2cd87c=0x0,_0x49b96f=events['length'];_0x2cd87c<_0x49b96f;_0x2cd87c++){var _0x36c0b1=events[_0x2cd87c];var _0x9ca3c2=createListener(_0xdcd4('0x3')+_0x36c0b1,_0x1c918b);DashboardEvents['on'](_0x36c0b1,_0x9ca3c2);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index d6a4799..615c2fe 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['isAuthenticated','/:id','show','create','post','/:id/clone','/:id/items','addItem','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x3bca2d,_0x1af8f4){var _0x144a7c=function(_0x2a46ce){while(--_0x2a46ce){_0x3bca2d['push'](_0x3bca2d['shift']());}};_0x144a7c(++_0x1af8f4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0xcb91[_0x1f7201];return _0x289fd2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./dashboard.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/items',auth[_0x1cb9('0x7')](),controller['getItems']);router['post']('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xa')]);router[_0x1cb9('0xb')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),controller['clone']);router[_0x1cb9('0xb')](_0x1cb9('0xd'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x10')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['/:id','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x303dd,_0x5cd18f){var _0x1f0224=function(_0x51658f){while(--_0x51658f){_0x303dd['push'](_0x303dd['shift']());}};_0x1f0224(++_0x5cd18f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xb')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller['clone']);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);module[_0x0a9e('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 18d2e24..2be5d1e 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29f6=['sequelize','squel','lodash','STRING','TEXT','long','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#ffffff'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0x29f6,0x68));var _0x629f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x629f('0x0'));var squel=require(_0x629f('0x1'));var _=require(_0x629f('0x2'));module['exports']={'title':{'type':Sequelize[_0x629f('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x629f('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x629f('0x4')](_0x629f('0x5')),'get':function(){try{return JSON[_0x629f('0x6')](this[_0x629f('0x7')]('attrs'));}catch(_0x47e63d){return[];}},'set':function(_0x4fa3ae){try{this[_0x629f('0x8')](_0x629f('0x9'),JSON[_0x629f('0xa')](_0x4fa3ae));}catch(_0x8c271b){this[_0x629f('0x8')](_0x629f('0x9'),JSON[_0x629f('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x629f('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x629f('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x629f('0xb')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x629f('0x3')],'allowNull':![],'defaultValue':_0x629f('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x629f('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x629f('0x3')]}}; \ No newline at end of file +var _0x34c2=['setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','lodash','STRING','long','parse','getDataValue','attrs'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x34c2,0x190));var _0x234c=function(_0x4279da,_0x215c4e){_0x4279da=_0x4279da-0x0;var _0x5e7680=_0x34c2[_0x4279da];return _0x5e7680;};'use strict';var Sequelize=require(_0x234c('0x0'));var squel=require(_0x234c('0x1'));var _=require(_0x234c('0x2'));module['exports']={'title':{'type':Sequelize[_0x234c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x234c('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x234c('0x4')),'get':function(){try{return JSON[_0x234c('0x5')](this[_0x234c('0x6')](_0x234c('0x7')));}catch(_0x34164d){return[];}},'set':function(_0x525365){try{this[_0x234c('0x8')]('attrs',JSON['stringify'](_0x525365));}catch(_0x52665c){this[_0x234c('0x8')](_0x234c('0x7'),JSON[_0x234c('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x234c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x234c('0xa')]},'col':{'type':Sequelize[_0x234c('0xa')]},'background':{'type':Sequelize[_0x234c('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x234c('0x3')],'allowNull':![],'defaultValue':_0x234c('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 5b071bb..dd0a552 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fce=['stringify','body','create','params','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','status','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s'];(function(_0x1e317e,_0x4415b0){var _0x8f2a5a=function(_0x2b7123){while(--_0x2b7123){_0x1e317e['push'](_0x1e317e['shift']());}};_0x8f2a5a(++_0x4415b0);}(_0x1fce,0x112));var _0xe1fc=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x1fce[_0x5f309e];return _0x487b5e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe1fc('0x0'));var jsonpatch=require(_0xe1fc('0x1'));var rp=require(_0xe1fc('0x2'));var moment=require(_0xe1fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe1fc('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe1fc('0x5'));var csv=require(_0xe1fc('0x6'));var ejs=require(_0xe1fc('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe1fc('0x8'));var crypto=require(_0xe1fc('0x9'));var jsforce=require(_0xe1fc('0xa'));var deskjs=require(_0xe1fc('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe1fc('0xc'));var Papa=require(_0xe1fc('0xd'));var Redis=require(_0xe1fc('0xe'));var authService=require(_0xe1fc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe1fc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1fc('0x11'))(_0xe1fc('0x12'));var utils=require(_0xe1fc('0x13'));var config=require(_0xe1fc('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe1fc('0x15')](config[_0xe1fc('0x16')],{'host':_0xe1fc('0x17'),'port':0x18eb});var socket=require(_0xe1fc('0x18'))(new Redis(config[_0xe1fc('0x16')]));require(_0xe1fc('0x19'))[_0xe1fc('0x1a')](socket);function respondWithStatusCode(_0x4bedcc,_0x36cec7){_0x36cec7=_0x36cec7||0xcc;return function(_0x3b99a3){if(_0x3b99a3){return _0x4bedcc['sendStatus'](_0x36cec7);}return _0x4bedcc[_0xe1fc('0x1b')](_0x36cec7)['end']();};}function respondWithResult(_0x7543de,_0x4cea3a){_0x4cea3a=_0x4cea3a||0xc8;return function(_0x19c38f){if(_0x19c38f){return _0x7543de[_0xe1fc('0x1b')](_0x4cea3a)['json'](_0x19c38f);}};}function respondWithFilteredResult(_0x4024b5,_0x2967da){return function(_0x393fe6){if(_0x393fe6){var _0x4fa633=_0x393fe6[_0xe1fc('0x1c')],_0x2e542d=_0x2967da[_0xe1fc('0x1d')],_0x2f668d=_0x2967da[_0xe1fc('0x1d')]+_0x2967da[_0xe1fc('0x1e')],_0x452eb5;if(_0x2f668d>=_0x4fa633){_0x2f668d=_0x4fa633;_0x452eb5=0xc8;}else{_0x452eb5=0xce;}_0x4024b5[_0xe1fc('0x1b')](_0x452eb5);return _0x4024b5['set'](_0xe1fc('0x1f'),_0x2e542d+'-'+_0x2f668d+'/'+_0x4fa633)[_0xe1fc('0x20')](_0x393fe6);}return null;};}function patchUpdates(_0x578d35){return function(_0x21a020){try{jsonpatch[_0xe1fc('0x21')](_0x21a020,_0x578d35,!![]);}catch(_0x18574d){return BPromise['reject'](_0x18574d);}return _0x21a020[_0xe1fc('0x22')]();};}function saveUpdates(_0x321bcf,_0x40fe31){return function(_0x5a1877){if(_0x5a1877){return _0x5a1877[_0xe1fc('0x23')](_0x321bcf)[_0xe1fc('0x24')](function(_0x2e553e){return _0x2e553e;});}return null;};}function removeEntity(_0x366cf8,_0x2cb766){return function(_0x4cf27c){if(_0x4cf27c){return _0x4cf27c[_0xe1fc('0x25')]()['then'](function(){_0x366cf8[_0xe1fc('0x1b')](0xcc)[_0xe1fc('0x26')]();});}};}function handleEntityNotFound(_0xea07c2,_0x3a4eea){return function(_0x598b2d){if(!_0x598b2d){_0xea07c2[_0xe1fc('0x27')](0x194);}return _0x598b2d;};}function handleError(_0x36ece0,_0x583ca4){_0x583ca4=_0x583ca4||0x1f4;return function(_0x334085){logger[_0xe1fc('0x28')](_0x334085[_0xe1fc('0x29')]);if(_0x334085[_0xe1fc('0x2a')]){delete _0x334085[_0xe1fc('0x2a')];}_0x36ece0[_0xe1fc('0x1b')](_0x583ca4)[_0xe1fc('0x2b')](_0x334085);};}exports[_0xe1fc('0x2c')]=function(_0x26a988,_0x26cc22){var _0x43c644={'raw':![],'where':{'id':_0x26a988['params']['id']}},_0x340789={};_0x340789[_0xe1fc('0x2d')]=_[_0xe1fc('0x2e')](db[_0xe1fc('0x2f')][_0xe1fc('0x30')]);_0x340789[_0xe1fc('0x31')]=_[_0xe1fc('0x2e')](_0x26a988[_0xe1fc('0x31')]);_0x340789[_0xe1fc('0x32')]=_[_0xe1fc('0x33')](_0x340789[_0xe1fc('0x2d')],_0x340789[_0xe1fc('0x31')]);_0x43c644['attributes']=_[_0xe1fc('0x33')](_0x340789[_0xe1fc('0x2d')],qs['fields'](_0x26a988[_0xe1fc('0x31')][_0xe1fc('0x34')]));_0x43c644[_0xe1fc('0x35')]=_0x43c644['attributes'][_0xe1fc('0x36')]?_0x43c644[_0xe1fc('0x35')]:_0x340789[_0xe1fc('0x2d')];if(_0x26a988[_0xe1fc('0x31')][_0xe1fc('0x37')]){_0x43c644[_0xe1fc('0x38')]=[{'all':!![]}];}_0x43c644=_[_0xe1fc('0x39')]({},_0x43c644,_0x26a988[_0xe1fc('0x3a')]);return db['DashboardItem'][_0xe1fc('0x3b')](_0x43c644)[_0xe1fc('0x24')](handleEntityNotFound(_0x26cc22,null))['then'](respondWithResult(_0x26cc22,null))[_0xe1fc('0x3c')](handleError(_0x26cc22,null));};exports[_0xe1fc('0x25')]=function(_0x28a449,_0x37324a){return db['DashboardItem'][_0xe1fc('0x3b')]({'where':{'id':_0x28a449['params']['id']}})[_0xe1fc('0x24')](handleEntityNotFound(_0x37324a,null))[_0xe1fc('0x24')](removeEntity(_0x37324a,null))[_0xe1fc('0x3c')](handleError(_0x37324a,null));};function widgetAttributes(_0x1072d7){try{switch(_0x1072d7[_0xe1fc('0x3d')]){case _0xe1fc('0x3e'):return[{'name':'attrUrl','value':_0x1072d7[_0xe1fc('0x3f')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x0]?_0x1072d7[_0xe1fc('0x40')][0x0]['value']:undefined)||_0xe1fc('0x41')}];case _0xe1fc('0x42'):return[{'name':'attrPath','value':_0x1072d7[_0xe1fc('0x43')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x0]?_0x1072d7[_0xe1fc('0x40')][0x0][_0xe1fc('0x44')]:undefined)||''}];case'clock':return[{'name':_0xe1fc('0x45'),'value':_0x1072d7[_0xe1fc('0x45')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x0]?_0x1072d7[_0xe1fc('0x40')][0x0]['value']:undefined)||_0xe1fc('0x46')},{'name':_0xe1fc('0x47'),'value':_0x1072d7['attrTimezone']||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x1]?_0x1072d7['attrs'][0x1][_0xe1fc('0x44')]:undefined)||_0xe1fc('0x48')},{'name':'attrFontSize','value':_0x1072d7['attrFontSize']||(_0x1072d7['attrs']&&_0x1072d7[_0xe1fc('0x40')][0x2]?_0x1072d7[_0xe1fc('0x40')][0x2][_0xe1fc('0x44')]:undefined)||0xc}];case _0xe1fc('0x49'):return[{'name':_0xe1fc('0x4a'),'value':_0x1072d7[_0xe1fc('0x4a')]||(_0x1072d7['attrs']&&_0x1072d7[_0xe1fc('0x40')][0x0]?_0x1072d7[_0xe1fc('0x40')][0x0][_0xe1fc('0x44')]:undefined)||_0xe1fc('0x4b')},{'name':_0xe1fc('0x4c'),'value':_0x1072d7['attrVoiceQueues']||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x1]?_0x1072d7[_0xe1fc('0x40')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x1072d7[_0xe1fc('0x4d')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x2]?_0x1072d7[_0xe1fc('0x40')][0x2][_0xe1fc('0x44')]:undefined)||0x14}];case'multibar-chart':case _0xe1fc('0x4e'):return[{'name':'attrSerie1','value':_0x1072d7[_0xe1fc('0x4f')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x0]?_0x1072d7[_0xe1fc('0x40')][0x0]['value']:undefined)||_0xe1fc('0x4b')},{'name':_0xe1fc('0x50'),'value':_0x1072d7[_0xe1fc('0x50')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x1]?_0x1072d7['attrs'][0x1][_0xe1fc('0x44')]:undefined)||null},{'name':_0xe1fc('0x51'),'value':_0x1072d7[_0xe1fc('0x51')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7['attrs'][0x2]?_0x1072d7[_0xe1fc('0x40')][0x2][_0xe1fc('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1072d7[_0xe1fc('0x4c')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x3]?_0x1072d7[_0xe1fc('0x40')][0x3][_0xe1fc('0x44')]:undefined)||[]}];case _0xe1fc('0x52'):return[{'name':'attrReport','type':_0x1072d7[_0xe1fc('0x53')]||(_0x1072d7[_0xe1fc('0x40')]&&_0x1072d7[_0xe1fc('0x40')][0x0]?_0x1072d7[_0xe1fc('0x40')][0x0][_0xe1fc('0x3d')]:undefined)||null,'value':_0x1072d7['attrReport']||(_0x1072d7['attrs']&&_0x1072d7['attrs'][0x0]?_0x1072d7[_0xe1fc('0x40')][0x0][_0xe1fc('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x1072d7[_0xe1fc('0x54')]||(_0x1072d7['attrs']&&_0x1072d7[_0xe1fc('0x40')][0x1]?_0x1072d7[_0xe1fc('0x40')][0x1][_0xe1fc('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x3cc516){logger['error'](_0xe1fc('0x55'),JSON[_0xe1fc('0x56')](_0x3cc516));return[];}}exports['create']=function(_0x283149,_0x1f4c75){if(_0x283149[_0xe1fc('0x57')]){_0x283149[_0xe1fc('0x57')][_0xe1fc('0x40')]=widgetAttributes(_0x283149['body']);}return db[_0xe1fc('0x2f')][_0xe1fc('0x58')](_0x283149[_0xe1fc('0x57')],{})[_0xe1fc('0x24')](respondWithResult(_0x1f4c75,0xc9))[_0xe1fc('0x3c')](handleError(_0x1f4c75,null));};exports['update']=function(_0x5cc559,_0x1b7f1e){if(_0x5cc559[_0xe1fc('0x57')]['id']){delete _0x5cc559['body']['id'];}_0x5cc559[_0xe1fc('0x57')][_0xe1fc('0x40')]=widgetAttributes(_0x5cc559[_0xe1fc('0x57')]);return db[_0xe1fc('0x2f')][_0xe1fc('0x3b')]({'where':{'id':_0x5cc559[_0xe1fc('0x59')]['id']}})[_0xe1fc('0x24')](handleEntityNotFound(_0x1b7f1e,null))[_0xe1fc('0x24')](saveUpdates(_0x5cc559[_0xe1fc('0x57')],null))['then'](respondWithResult(_0x1b7f1e,null))[_0xe1fc('0x3c')](handleError(_0x1b7f1e,null));}; \ No newline at end of file +var _0xc962=['attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','DashboardItem','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','destroy','then','error','stack','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','catch','find','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total'];(function(_0x29f014,_0x508522){var _0x316be5=function(_0x1753a5){while(--_0x1753a5){_0x29f014['push'](_0x29f014['shift']());}};_0x316be5(++_0x508522);}(_0xc962,0x64));var _0x2c96=function(_0x361a7e,_0x400af3){_0x361a7e=_0x361a7e-0x0;var _0x48a2bd=_0xc962[_0x361a7e];return _0x48a2bd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2c96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c96('0x1'));var jsonpatch=require(_0x2c96('0x2'));var rp=require(_0x2c96('0x3'));var moment=require('moment');var BPromise=require(_0x2c96('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2c96('0x5'));var ejs=require(_0x2c96('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c96('0x7'));var jsforce=require(_0x2c96('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2c96('0x9'));var Papa=require(_0x2c96('0xa'));var Redis=require(_0x2c96('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x2c96('0xc'));var as=require(_0x2c96('0xd'));var hardwareService=require(_0x2c96('0xe'));var logger=require(_0x2c96('0xf'))(_0x2c96('0x10'));var utils=require('../../config/utils');var config=require(_0x2c96('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2c96('0x12')](config['redis'],{'host':_0x2c96('0x13'),'port':0x18eb});var socket=require(_0x2c96('0x14'))(new Redis(config[_0x2c96('0x15')]));require('./dashboardItem.socket')[_0x2c96('0x16')](socket);function respondWithStatusCode(_0x5e8cbd,_0x3b9340){_0x3b9340=_0x3b9340||0xcc;return function(_0x4e8e71){if(_0x4e8e71){return _0x5e8cbd[_0x2c96('0x17')](_0x3b9340);}return _0x5e8cbd['status'](_0x3b9340)[_0x2c96('0x18')]();};}function respondWithResult(_0x3d9fdc,_0x2a2083){_0x2a2083=_0x2a2083||0xc8;return function(_0x48e4dc){if(_0x48e4dc){return _0x3d9fdc[_0x2c96('0x19')](_0x2a2083)[_0x2c96('0x1a')](_0x48e4dc);}};}function respondWithFilteredResult(_0x227a89,_0x2a72a9){return function(_0x273a2e){if(_0x273a2e){var _0x54e5c5=_0x273a2e[_0x2c96('0x1b')],_0x9004d8=_0x2a72a9[_0x2c96('0x1c')],_0x676efe=_0x2a72a9[_0x2c96('0x1c')]+_0x2a72a9[_0x2c96('0x1d')],_0x1e773d;if(_0x676efe>=_0x54e5c5){_0x676efe=_0x54e5c5;_0x1e773d=0xc8;}else{_0x1e773d=0xce;}_0x227a89['status'](_0x1e773d);return _0x227a89[_0x2c96('0x1e')](_0x2c96('0x1f'),_0x9004d8+'-'+_0x676efe+'/'+_0x54e5c5)[_0x2c96('0x1a')](_0x273a2e);}return null;};}function patchUpdates(_0x3167a0){return function(_0x4864ab){try{jsonpatch['apply'](_0x4864ab,_0x3167a0,!![]);}catch(_0x3875c2){return BPromise['reject'](_0x3875c2);}return _0x4864ab[_0x2c96('0x20')]();};}function saveUpdates(_0x1aa014,_0x541df6){return function(_0x70d8d0){if(_0x70d8d0){return _0x70d8d0[_0x2c96('0x21')](_0x1aa014)['then'](function(_0x267d4b){return _0x267d4b;});}return null;};}function removeEntity(_0x1fc53a,_0x52ba3d){return function(_0x2f3816){if(_0x2f3816){return _0x2f3816[_0x2c96('0x22')]()[_0x2c96('0x23')](function(){_0x1fc53a[_0x2c96('0x19')](0xcc)[_0x2c96('0x18')]();});}};}function handleEntityNotFound(_0x30c5c6,_0x4e8321){return function(_0x26aded){if(!_0x26aded){_0x30c5c6[_0x2c96('0x17')](0x194);}return _0x26aded;};}function handleError(_0x28750b,_0x12f0e4){_0x12f0e4=_0x12f0e4||0x1f4;return function(_0x33e8af){logger[_0x2c96('0x24')](_0x33e8af[_0x2c96('0x25')]);if(_0x33e8af['name']){delete _0x33e8af['name'];}_0x28750b[_0x2c96('0x19')](_0x12f0e4)[_0x2c96('0x26')](_0x33e8af);};}exports[_0x2c96('0x27')]=function(_0x939db3,_0x5686a8){var _0x129a3e={'raw':![],'where':{'id':_0x939db3[_0x2c96('0x28')]['id']}},_0x50f6c={};_0x50f6c[_0x2c96('0x29')]=_[_0x2c96('0x2a')](db['DashboardItem'][_0x2c96('0x2b')]);_0x50f6c[_0x2c96('0x2c')]=_[_0x2c96('0x2a')](_0x939db3[_0x2c96('0x2c')]);_0x50f6c[_0x2c96('0x2d')]=_[_0x2c96('0x2e')](_0x50f6c[_0x2c96('0x29')],_0x50f6c[_0x2c96('0x2c')]);_0x129a3e['attributes']=_[_0x2c96('0x2e')](_0x50f6c[_0x2c96('0x29')],qs['fields'](_0x939db3[_0x2c96('0x2c')][_0x2c96('0x2f')]));_0x129a3e[_0x2c96('0x30')]=_0x129a3e[_0x2c96('0x30')][_0x2c96('0x31')]?_0x129a3e[_0x2c96('0x30')]:_0x50f6c[_0x2c96('0x29')];if(_0x939db3[_0x2c96('0x2c')][_0x2c96('0x32')]){_0x129a3e[_0x2c96('0x33')]=[{'all':!![]}];}_0x129a3e=_['merge']({},_0x129a3e,_0x939db3[_0x2c96('0x34')]);return db['DashboardItem']['find'](_0x129a3e)['then'](handleEntityNotFound(_0x5686a8,null))[_0x2c96('0x23')](respondWithResult(_0x5686a8,null))[_0x2c96('0x35')](handleError(_0x5686a8,null));};exports[_0x2c96('0x22')]=function(_0x574e81,_0x42d819){return db['DashboardItem'][_0x2c96('0x36')]({'where':{'id':_0x574e81['params']['id']}})[_0x2c96('0x23')](handleEntityNotFound(_0x42d819,null))[_0x2c96('0x23')](removeEntity(_0x42d819,null))['catch'](handleError(_0x42d819,null));};function widgetAttributes(_0x37abeb){try{switch(_0x37abeb[_0x2c96('0x37')]){case _0x2c96('0x38'):return[{'name':_0x2c96('0x39'),'value':_0x37abeb[_0x2c96('0x39')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb['attrs'][0x0]?_0x37abeb[_0x2c96('0x3a')][0x0][_0x2c96('0x3b')]:undefined)||_0x2c96('0x3c')}];case _0x2c96('0x3d'):return[{'name':_0x2c96('0x3e'),'value':_0x37abeb['attrPath']||(_0x37abeb['attrs']&&_0x37abeb[_0x2c96('0x3a')][0x0]?_0x37abeb[_0x2c96('0x3a')][0x0][_0x2c96('0x3b')]:undefined)||''}];case _0x2c96('0x3f'):return[{'name':_0x2c96('0x40'),'value':_0x37abeb[_0x2c96('0x40')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb[_0x2c96('0x3a')][0x0]?_0x37abeb['attrs'][0x0][_0x2c96('0x3b')]:undefined)||_0x2c96('0x41')},{'name':'attrTimezone','value':_0x37abeb[_0x2c96('0x42')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb[_0x2c96('0x3a')][0x1]?_0x37abeb[_0x2c96('0x3a')][0x1][_0x2c96('0x3b')]:undefined)||_0x2c96('0x43')},{'name':_0x2c96('0x44'),'value':_0x37abeb[_0x2c96('0x44')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb['attrs'][0x2]?_0x37abeb[_0x2c96('0x3a')][0x2][_0x2c96('0x3b')]:undefined)||0xc}];case _0x2c96('0x45'):return[{'name':_0x2c96('0x46'),'value':_0x37abeb[_0x2c96('0x46')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb[_0x2c96('0x3a')][0x0]?_0x37abeb[_0x2c96('0x3a')][0x0][_0x2c96('0x3b')]:undefined)||_0x2c96('0x47')},{'name':_0x2c96('0x48'),'value':_0x37abeb[_0x2c96('0x48')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb[_0x2c96('0x3a')][0x1]?_0x37abeb[_0x2c96('0x3a')][0x1][_0x2c96('0x3b')]:undefined)||[]},{'name':'attrFontSize','value':_0x37abeb[_0x2c96('0x44')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb[_0x2c96('0x3a')][0x2]?_0x37abeb['attrs'][0x2][_0x2c96('0x3b')]:undefined)||0x14}];case'multibar-chart':case _0x2c96('0x49'):return[{'name':'attrSerie1','value':_0x37abeb[_0x2c96('0x4a')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb['attrs'][0x0]?_0x37abeb['attrs'][0x0][_0x2c96('0x3b')]:undefined)||_0x2c96('0x47')},{'name':_0x2c96('0x4b'),'value':_0x37abeb[_0x2c96('0x4b')]||(_0x37abeb['attrs']&&_0x37abeb[_0x2c96('0x3a')][0x1]?_0x37abeb[_0x2c96('0x3a')][0x1][_0x2c96('0x3b')]:undefined)||null},{'name':_0x2c96('0x4c'),'value':_0x37abeb['attrSerie3']||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb['attrs'][0x2]?_0x37abeb[_0x2c96('0x3a')][0x2][_0x2c96('0x3b')]:undefined)||null},{'name':_0x2c96('0x48'),'value':_0x37abeb[_0x2c96('0x48')]||(_0x37abeb['attrs']&&_0x37abeb[_0x2c96('0x3a')][0x3]?_0x37abeb[_0x2c96('0x3a')][0x3][_0x2c96('0x3b')]:undefined)||[]}];case _0x2c96('0x4d'):return[{'name':_0x2c96('0x4e'),'type':_0x37abeb[_0x2c96('0x4f')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb[_0x2c96('0x3a')][0x0]?_0x37abeb[_0x2c96('0x3a')][0x0][_0x2c96('0x37')]:undefined)||null,'value':_0x37abeb[_0x2c96('0x4e')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb[_0x2c96('0x3a')][0x0]?_0x37abeb[_0x2c96('0x3a')][0x0][_0x2c96('0x3b')]:undefined)||null},{'name':_0x2c96('0x50'),'value':_0x37abeb[_0x2c96('0x50')]||(_0x37abeb[_0x2c96('0x3a')]&&_0x37abeb['attrs'][0x1]?_0x37abeb[_0x2c96('0x3a')][0x1][_0x2c96('0x3b')]:undefined)||0x0}];default:return[];}}catch(_0x1e994c){logger[_0x2c96('0x24')](_0x2c96('0x51'),JSON[_0x2c96('0x52')](_0x1e994c));return[];}}exports['create']=function(_0x524f46,_0x2c7b1b){if(_0x524f46[_0x2c96('0x53')]){_0x524f46[_0x2c96('0x53')][_0x2c96('0x3a')]=widgetAttributes(_0x524f46[_0x2c96('0x53')]);}return db['DashboardItem'][_0x2c96('0x54')](_0x524f46['body'],{})[_0x2c96('0x23')](respondWithResult(_0x2c7b1b,0xc9))['catch'](handleError(_0x2c7b1b,null));};exports['update']=function(_0x34c001,_0x3e8f6f){if(_0x34c001[_0x2c96('0x53')]['id']){delete _0x34c001[_0x2c96('0x53')]['id'];}_0x34c001[_0x2c96('0x53')][_0x2c96('0x3a')]=widgetAttributes(_0x34c001[_0x2c96('0x53')]);return db[_0x2c96('0x55')]['find']({'where':{'id':_0x34c001[_0x2c96('0x28')]['id']}})[_0x2c96('0x23')](handleEntityNotFound(_0x3e8f6f,null))[_0x2c96('0x23')](saveUpdates(_0x34c001[_0x2c96('0x53')],null))[_0x2c96('0x23')](respondWithResult(_0x3e8f6f,null))[_0x2c96('0x35')](handleError(_0x3e8f6f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 5f7cf40..3b049fc 100644 --- a/server/api/dashboardItem/dashboardItem.events.js +++ b/server/api/dashboardItem/dashboardItem.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d55=['../../mysqldb','DashboardItem','save','update','remove','emit','exports'];(function(_0x481d34,_0xe24463){var _0x45d43d=function(_0xbcb9a3){while(--_0xbcb9a3){_0x481d34['push'](_0x481d34['shift']());}};_0x45d43d(++_0xe24463);}(_0x4d55,0x150));var _0x54d5=function(_0x29e842,_0x11814e){_0x29e842=_0x29e842-0x0;var _0x400e48=_0x4d55[_0x29e842];return _0x400e48;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x54d5('0x0'))['db'][_0x54d5('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54d5('0x2'),'afterUpdate':_0x54d5('0x3'),'afterDestroy':_0x54d5('0x4')};function emitEvent(_0x4857ad){return function(_0x42bac9,_0x108722,_0x201e82){DashboardItemEvents['emit'](_0x4857ad+':'+_0x42bac9['id'],_0x42bac9);DashboardItemEvents[_0x54d5('0x5')](_0x4857ad,_0x42bac9);_0x201e82(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x54d5('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x49d2=['save','update','emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x188bd4,_0x3efb6d){var _0x12af64=function(_0x43ea32){while(--_0x43ea32){_0x188bd4['push'](_0x188bd4['shift']());}};_0x12af64(++_0x3efb6d);}(_0x49d2,0xa7));var _0x249d=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x49d2[_0x45783c];return _0x1161da;};'use strict';var EventEmitter=require(_0x249d('0x0'));var DashboardItem=require(_0x249d('0x1'))['db'][_0x249d('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x249d('0x3')](0x0);var events={'afterCreate':_0x249d('0x4'),'afterUpdate':_0x249d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x51c64f){return function(_0x5d5668,_0x207849,_0x200729){DashboardItemEvents[_0x249d('0x6')](_0x51c64f+':'+_0x5d5668['id'],_0x5d5668);DashboardItemEvents['emit'](_0x51c64f,_0x5d5668);_0x200729(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x249d('0x7')](e,emitEvent(event));}}module[_0x249d('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 328c0b0..7efb530 100644 --- a/server/api/dashboardItem/dashboardItem.model.js +++ b/server/api/dashboardItem/dashboardItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7d5=['lodash','api','path','rimraf','../../config/environment','exports','define'];(function(_0x2e7baf,_0x56169e){var _0x2072c7=function(_0x1b32e9){while(--_0x1b32e9){_0x2e7baf['push'](_0x2e7baf['shift']());}};_0x2072c7(++_0x56169e);}(_0xa7d5,0x149));var _0x5a7d=function(_0xeb993b,_0x251434){_0xeb993b=_0xeb993b-0x0;var _0xf4af7=_0xa7d5[_0xeb993b];return _0xf4af7;};'use strict';var _=require(_0x5a7d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5a7d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a7d('0x2'));var rimraf=require(_0x5a7d('0x3'));var config=require(_0x5a7d('0x4'));var attributes=require('./dashboardItem.attributes');module[_0x5a7d('0x5')]=function(_0x23047d,_0x31d801){return _0x23047d[_0x5a7d('0x6')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x052e=['request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x052e,0x81));var _0xe052=function(_0x5a23e5,_0x235f58){_0x5a23e5=_0x5a23e5-0x0;var _0x4f4e67=_0x052e[_0x5a23e5];return _0x4f4e67;};'use strict';var _=require(_0xe052('0x0'));var util=require(_0xe052('0x1'));var logger=require(_0xe052('0x2'))(_0xe052('0x3'));var moment=require(_0xe052('0x4'));var BPromise=require(_0xe052('0x5'));var rp=require(_0xe052('0x6'));var fs=require('fs');var path=require(_0xe052('0x7'));var rimraf=require(_0xe052('0x8'));var config=require(_0xe052('0x9'));var attributes=require(_0xe052('0xa'));module[_0xe052('0xb')]=function(_0x31eecc,_0x32caeb){return _0x31eecc[_0xe052('0xc')](_0xe052('0xd'),attributes,{'tableName':_0xe052('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 9145a7f..fe5f664 100644 --- a/server/api/dashboardItem/dashboardItem.rpc.js +++ b/server/api/dashboardItem/dashboardItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb239=['then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis'];(function(_0x31f94d,_0x97563){var _0xca77c0=function(_0x1e9e04){while(--_0x1e9e04){_0x31f94d['push'](_0x31f94d['shift']());}};_0xca77c0(++_0x97563);}(_0xb239,0xeb));var _0x9b23=function(_0x38266b,_0x52e26b){_0x38266b=_0x38266b-0x0;var _0x1c1b43=_0xb239[_0x38266b];return _0x1c1b43;};'use strict';var _=require('lodash');var util=require(_0x9b23('0x0'));var moment=require(_0x9b23('0x1'));var BPromise=require(_0x9b23('0x2'));var rs=require(_0x9b23('0x3'));var fs=require('fs');var Redis=require(_0x9b23('0x4'));var db=require(_0x9b23('0x5'))['db'];var utils=require(_0x9b23('0x6'));var logger=require(_0x9b23('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9b23('0x8'));var client=jayson[_0x9b23('0x9')][_0x9b23('0xa')]({'port':0x232a});config['redis']=_[_0x9b23('0xb')](config['redis'],{'host':_0x9b23('0xc'),'port':0x18eb});var socket=require(_0x9b23('0xd'))(new Redis(config[_0x9b23('0xe')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x4c3b80,_0x135a3b,_0x195f23){return new BPromise(function(_0x388239,_0x14bce1){return client['request'](_0x4c3b80,_0x195f23)[_0x9b23('0xf')](function(_0x5a6f2a){logger[_0x9b23('0x10')](_0x9b23('0x11'),_0x135a3b,'request\x20sent');logger['debug'](_0x9b23('0x12'),_0x135a3b,_0x9b23('0x13'),JSON[_0x9b23('0x14')](_0x5a6f2a));if(_0x5a6f2a[_0x9b23('0x15')]){if(_0x5a6f2a['error']['code']===0x1f4){logger[_0x9b23('0x15')](_0x9b23('0x11'),_0x135a3b,_0x5a6f2a[_0x9b23('0x15')][_0x9b23('0x16')]);return _0x14bce1(_0x5a6f2a['error']['message']);}logger[_0x9b23('0x15')](_0x9b23('0x11'),_0x135a3b,_0x5a6f2a['error'][_0x9b23('0x16')]);return _0x388239(_0x5a6f2a['error'][_0x9b23('0x16')]);}else{logger[_0x9b23('0x10')]('DashboardItem,\x20%s,\x20%s',_0x135a3b,_0x9b23('0x13'));_0x388239(_0x5a6f2a[_0x9b23('0x17')][_0x9b23('0x16')]);}})[_0x9b23('0x18')](function(_0x19cde0){logger[_0x9b23('0x15')](_0x9b23('0x11'),_0x135a3b,_0x19cde0);_0x14bce1(_0x19cde0);});});} \ No newline at end of file +var _0xec27=['info','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','result','util','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x3fddf3,_0x36ce44){var _0x15650d=function(_0x315a11){while(--_0x315a11){_0x3fddf3['push'](_0x3fddf3['shift']());}};_0x15650d(++_0x36ce44);}(_0xec27,0x1a1));var _0x7ec2=function(_0xbf4fd8,_0x276b23){_0xbf4fd8=_0xbf4fd8-0x0;var _0x512333=_0xec27[_0xbf4fd8];return _0x512333;};'use strict';var _=require('lodash');var util=require(_0x7ec2('0x0'));var moment=require('moment');var BPromise=require(_0x7ec2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ec2('0x2'));var db=require(_0x7ec2('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7ec2('0x4'));var jayson=require(_0x7ec2('0x5'));var client=jayson[_0x7ec2('0x6')][_0x7ec2('0x7')]({'port':0x232a});config[_0x7ec2('0x8')]=_['defaults'](config[_0x7ec2('0x8')],{'host':_0x7ec2('0x9'),'port':0x18eb});var socket=require(_0x7ec2('0xa'))(new Redis(config[_0x7ec2('0x8')]));require(_0x7ec2('0xb'))[_0x7ec2('0xc')](socket);function respondWithRpcPromise(_0x3880e3,_0x333bc2,_0x4e1394){return new BPromise(function(_0x521996,_0x3b9455){return client[_0x7ec2('0xd')](_0x3880e3,_0x4e1394)[_0x7ec2('0xe')](function(_0x39c1f6){logger[_0x7ec2('0xf')]('DashboardItem,\x20%s,\x20%s',_0x333bc2,_0x7ec2('0x10'));logger['debug'](_0x7ec2('0x11'),_0x333bc2,_0x7ec2('0x10'),JSON[_0x7ec2('0x12')](_0x39c1f6));if(_0x39c1f6[_0x7ec2('0x13')]){if(_0x39c1f6[_0x7ec2('0x13')][_0x7ec2('0x14')]===0x1f4){logger[_0x7ec2('0x13')]('DashboardItem,\x20%s,\x20%s',_0x333bc2,_0x39c1f6[_0x7ec2('0x13')][_0x7ec2('0x15')]);return _0x3b9455(_0x39c1f6[_0x7ec2('0x13')]['message']);}logger['error'](_0x7ec2('0x16'),_0x333bc2,_0x39c1f6['error']['message']);return _0x521996(_0x39c1f6[_0x7ec2('0x13')][_0x7ec2('0x15')]);}else{logger[_0x7ec2('0xf')](_0x7ec2('0x16'),_0x333bc2,_0x7ec2('0x10'));_0x521996(_0x39c1f6[_0x7ec2('0x17')][_0x7ec2('0x15')]);}})['catch'](function(_0x27fa00){logger[_0x7ec2('0x13')](_0x7ec2('0x16'),_0x333bc2,_0x27fa00);_0x3b9455(_0x27fa00);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 1173f6e..31c8ac7 100644 --- a/server/api/dashboardItem/dashboardItem.socket.js +++ b/server/api/dashboardItem/dashboardItem.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb53=['remove','update','emit','register','length','./dashboardItem.events','save'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xbb53,0x15c));var _0x3bb5=function(_0x38e669,_0x5cb484){_0x38e669=_0x38e669-0x0;var _0x2c725c=_0xbb53[_0x38e669];return _0x2c725c;};'use strict';var DashboardItemEvents=require(_0x3bb5('0x0'));var events=[_0x3bb5('0x1'),_0x3bb5('0x2'),_0x3bb5('0x3')];function createListener(_0x462401,_0x378d6c){return function(_0xeb50d3){_0x378d6c[_0x3bb5('0x4')](_0x462401,_0xeb50d3);};}function removeListener(_0x1604ec,_0x34440b){return function(){DashboardItemEvents['removeListener'](_0x1604ec,_0x34440b);};}exports[_0x3bb5('0x5')]=function(_0x349682){for(var _0x5775a8=0x0,_0x561a50=events[_0x3bb5('0x6')];_0x5775a8<_0x561a50;_0x5775a8++){var _0x2ae069=events[_0x5775a8];var _0xcf0e46=createListener('dashboardItem:'+_0x2ae069,_0x349682);DashboardItemEvents['on'](_0x2ae069,_0xcf0e46);}}; \ No newline at end of file +var _0xb805=['dashboardItem:','./dashboardItem.events','update','emit','removeListener','register','length'];(function(_0x93a57f,_0x40bc5f){var _0x1c8ec5=function(_0x21fc8c){while(--_0x21fc8c){_0x93a57f['push'](_0x93a57f['shift']());}};_0x1c8ec5(++_0x40bc5f);}(_0xb805,0x1c1));var _0x5b80=function(_0x416c14,_0x8f64df){_0x416c14=_0x416c14-0x0;var _0x13a057=_0xb805[_0x416c14];return _0x13a057;};'use strict';var DashboardItemEvents=require(_0x5b80('0x0'));var events=['save','remove',_0x5b80('0x1')];function createListener(_0x12aac0,_0x67ada1){return function(_0x5b44f6){_0x67ada1[_0x5b80('0x2')](_0x12aac0,_0x5b44f6);};}function removeListener(_0x2c999c,_0x5d7dec){return function(){DashboardItemEvents[_0x5b80('0x3')](_0x2c999c,_0x5d7dec);};}exports[_0x5b80('0x4')]=function(_0x4fbe3b){for(var _0x5d6bc3=0x0,_0x579462=events[_0x5b80('0x5')];_0x5d6bc3<_0x579462;_0x5d6bc3++){var _0x17e1ed=events[_0x5d6bc3];var _0x120e73=createListener(_0x5b80('0x6')+_0x17e1ed,_0x4fbe3b);DashboardItemEvents['on'](_0x17e1ed,_0x120e73);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index bc82e3b..cafbb5b 100644 --- a/server/api/dashboardItem/index.js +++ b/server/api/dashboardItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['/:id','post','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboardItem.controller','get'];(function(_0x209801,_0x548dbc){var _0x193dfa=function(_0x2486f2){while(--_0x2486f2){_0x209801['push'](_0x209801['shift']());}};_0x193dfa(++_0x548dbc);}(_0x8ef6,0xf2));var _0x68ef=function(_0x58c43a,_0x52fcee){_0x58c43a=_0x58c43a-0x0;var _0x31034f=_0x8ef6[_0x58c43a];return _0x31034f;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')](_0x68ef('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x68ef('0xb')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0xd')]);router['put'](_0x68ef('0xa'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')](_0x68ef('0xa'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);module[_0x68ef('0x11')]=router; \ No newline at end of file +var _0xc4aa=['connect-timeout','express','Router','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x4e0275,_0x270664){var _0x6c538e=function(_0x2f3365){while(--_0x2f3365){_0x4e0275['push'](_0x4e0275['shift']());}};_0x6c538e(++_0x270664);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')](_0xac4a('0x8'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0xb')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xc')]);router['put']('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router[_0xac4a('0xe')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);module[_0xac4a('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index edd5ef4..0bac4f3 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65f3=['STRING','sequelize'];(function(_0x249224,_0x58d6cf){var _0x36c493=function(_0x3f773b){while(--_0x3f773b){_0x249224['push'](_0x249224['shift']());}};_0x36c493(++_0x58d6cf);}(_0x65f3,0xbb));var _0x365f=function(_0xaad4b6,_0xaba90c){_0xaad4b6=_0xaad4b6-0x0;var _0x541a14=_0x65f3[_0xaad4b6];return _0x541a14;};'use strict';var Sequelize=require(_0x365f('0x0'));module['exports']={'name':{'type':Sequelize[_0x365f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x24a0=['STRING','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x24a0,0x1ab));var _0x024a=function(_0x37f754,_0x44c525){_0x37f754=_0x37f754-0x0;var _0x3ab29c=_0x24a0[_0x37f754];return _0x3ab29c;};'use strict';var Sequelize=require('sequelize');module[_0x024a('0x0')]={'name':{'type':Sequelize[_0x024a('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 7a76eec..b653d49 100644 --- a/server/api/disposition/disposition.controller.js +++ b/server/api/disposition/disposition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bde=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','status','end','json','count','offset','Content-Range','reject','save','update','destroy','get','Dispositions','UserProfileResource','then','sendStatus','error','stack','name','send','map','Disposition','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','limit','order','sort','pick','where','merge','VIRTUAL','options','include','findAll','show','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','zip-dir','fast-json-patch'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe0bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0bd('0x1'));var jsonpatch=require(_0xe0bd('0x2'));var rp=require(_0xe0bd('0x3'));var moment=require(_0xe0bd('0x4'));var BPromise=require(_0xe0bd('0x5'));var Mustache=require('mustache');var util=require(_0xe0bd('0x6'));var path=require(_0xe0bd('0x7'));var sox=require(_0xe0bd('0x8'));var csv=require(_0xe0bd('0x9'));var ejs=require(_0xe0bd('0xa'));var fs=require('fs');var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x9'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var Redis=require(_0xe0bd('0x11'));var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe0bd('0x15'))['db'];function respondWithStatusCode(_0x415093,_0x54d40e){_0x54d40e=_0x54d40e||0xcc;return function(_0xc492b4){if(_0xc492b4){return _0x415093['sendStatus'](_0x54d40e);}return _0x415093[_0xe0bd('0x16')](_0x54d40e)[_0xe0bd('0x17')]();};}function respondWithResult(_0x3b2fb1,_0x20ab47){_0x20ab47=_0x20ab47||0xc8;return function(_0x47664e){if(_0x47664e){return _0x3b2fb1[_0xe0bd('0x16')](_0x20ab47)[_0xe0bd('0x18')](_0x47664e);}};}function respondWithFilteredResult(_0x210f20,_0x4f63fa){return function(_0x50891d){if(_0x50891d){var _0x4fb006=_0x50891d[_0xe0bd('0x19')],_0x2ff887=_0x4f63fa[_0xe0bd('0x1a')],_0x8179fb=_0x4f63fa['offset']+_0x4f63fa['limit'],_0x2cd832;if(_0x8179fb>=_0x4fb006){_0x8179fb=_0x4fb006;_0x2cd832=0xc8;}else{_0x2cd832=0xce;}_0x210f20[_0xe0bd('0x16')](_0x2cd832);return _0x210f20['set'](_0xe0bd('0x1b'),_0x2ff887+'-'+_0x8179fb+'/'+_0x4fb006)[_0xe0bd('0x18')](_0x50891d);}return null;};}function patchUpdates(_0xec158d){return function(_0x20157b){try{jsonpatch['apply'](_0x20157b,_0xec158d,!![]);}catch(_0x1311b1){return BPromise[_0xe0bd('0x1c')](_0x1311b1);}return _0x20157b[_0xe0bd('0x1d')]();};}function saveUpdates(_0x47ceb8,_0x1bf742){return function(_0x25f595){if(_0x25f595){return _0x25f595[_0xe0bd('0x1e')](_0x47ceb8)['then'](function(_0x2d40d0){return _0x2d40d0;});}return null;};}function removeEntity(_0xdd7d30,_0x2b4f7d){return function(_0x5378d2){if(_0x5378d2){return _0x5378d2[_0xe0bd('0x1f')]()['then'](function(){var _0x12e236=_0x5378d2[_0xe0bd('0x20')]({'plain':!![]});var _0x4bcd48=_0xe0bd('0x21');return db[_0xe0bd('0x22')][_0xe0bd('0x1f')]({'where':{'type':_0x4bcd48,'resourceId':_0x12e236['id']}})[_0xe0bd('0x23')](function(){return _0x5378d2;});})[_0xe0bd('0x23')](function(){_0xdd7d30[_0xe0bd('0x16')](0xcc)[_0xe0bd('0x17')]();});}};}function handleEntityNotFound(_0x162356,_0x537708){return function(_0x54e38d){if(!_0x54e38d){_0x162356[_0xe0bd('0x24')](0x194);}return _0x54e38d;};}function handleError(_0x39c98e,_0x47d171){_0x47d171=_0x47d171||0x1f4;return function(_0x4e8f11){logger[_0xe0bd('0x25')](_0x4e8f11[_0xe0bd('0x26')]);if(_0x4e8f11[_0xe0bd('0x27')]){delete _0x4e8f11[_0xe0bd('0x27')];}_0x39c98e['status'](_0x47d171)[_0xe0bd('0x28')](_0x4e8f11);};}exports['index']=function(_0x9146fe,_0x170874){var _0x42bea7={},_0x1b857c={},_0x1e2020={'count':0x0,'rows':[]};var _0x43f122=_[_0xe0bd('0x29')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')],function(_0x36e0f7){return{'name':_0x36e0f7[_0xe0bd('0x2c')],'type':_0x36e0f7[_0xe0bd('0x2d')][_0xe0bd('0x2e')]};});_0x1b857c['model']=_[_0xe0bd('0x29')](_0x43f122,_0xe0bd('0x27'));_0x1b857c[_0xe0bd('0x2f')]=_[_0xe0bd('0x30')](_0x9146fe[_0xe0bd('0x2f')]);_0x1b857c[_0xe0bd('0x31')]=_['intersection'](_0x1b857c['model'],_0x1b857c[_0xe0bd('0x2f')]);_0x42bea7[_0xe0bd('0x32')]=_[_0xe0bd('0x33')](_0x1b857c[_0xe0bd('0x34')],qs[_0xe0bd('0x35')](_0x9146fe[_0xe0bd('0x2f')][_0xe0bd('0x35')]));_0x42bea7['attributes']=_0x42bea7[_0xe0bd('0x32')][_0xe0bd('0x36')]?_0x42bea7[_0xe0bd('0x32')]:_0x1b857c[_0xe0bd('0x34')];if(!_0x9146fe[_0xe0bd('0x2f')][_0xe0bd('0x37')]('nolimit')){_0x42bea7[_0xe0bd('0x38')]=qs[_0xe0bd('0x38')](_0x9146fe[_0xe0bd('0x2f')][_0xe0bd('0x38')]);_0x42bea7[_0xe0bd('0x1a')]=qs['offset'](_0x9146fe['query'][_0xe0bd('0x1a')]);}_0x42bea7[_0xe0bd('0x39')]=qs[_0xe0bd('0x3a')](_0x9146fe['query'][_0xe0bd('0x3a')]);_0x42bea7['where']=qs['filters'](_[_0xe0bd('0x3b')](_0x9146fe[_0xe0bd('0x2f')],_0x1b857c['filters']));if(_0x9146fe['query']['filter']){_0x42bea7[_0xe0bd('0x3c')]=_[_0xe0bd('0x3d')](_0x42bea7[_0xe0bd('0x3c')],{'$or':_['map'](_0x43f122,function(_0x20827d){if(_0x20827d[_0xe0bd('0x2d')]!==_0xe0bd('0x3e')){var _0x47feb4={};_0x47feb4[_0x20827d['name']]={'$like':'%'+_0x9146fe[_0xe0bd('0x2f')]['filter']+'%'};return _0x47feb4;}})});}_0x42bea7=_[_0xe0bd('0x3d')]({},_0x42bea7,_0x9146fe[_0xe0bd('0x3f')]);var _0x5aee49={'where':_0x42bea7[_0xe0bd('0x3c')]};return db[_0xe0bd('0x2a')][_0xe0bd('0x19')](_0x5aee49)[_0xe0bd('0x23')](function(_0x2a7782){_0x1e2020[_0xe0bd('0x19')]=_0x2a7782;if(_0x9146fe[_0xe0bd('0x2f')]['includeAll']){_0x42bea7[_0xe0bd('0x40')]=[{'all':!![]}];}return db[_0xe0bd('0x2a')][_0xe0bd('0x41')](_0x42bea7);})[_0xe0bd('0x23')](function(_0x243641){_0x1e2020['rows']=_0x243641;return _0x1e2020;})['then'](respondWithFilteredResult(_0x170874,_0x42bea7))['catch'](handleError(_0x170874,null));};exports[_0xe0bd('0x42')]=function(_0x1a121f,_0x15de49){var _0x32ed4f={'raw':!![],'where':{'id':_0x1a121f['params']['id']}},_0x5d64df={};_0x5d64df[_0xe0bd('0x34')]=_[_0xe0bd('0x30')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')]);_0x5d64df[_0xe0bd('0x2f')]=_[_0xe0bd('0x30')](_0x1a121f[_0xe0bd('0x2f')]);_0x5d64df['filters']=_[_0xe0bd('0x33')](_0x5d64df['model'],_0x5d64df[_0xe0bd('0x2f')]);_0x32ed4f[_0xe0bd('0x32')]=_['intersection'](_0x5d64df['model'],qs[_0xe0bd('0x35')](_0x1a121f[_0xe0bd('0x2f')][_0xe0bd('0x35')]));_0x32ed4f[_0xe0bd('0x32')]=_0x32ed4f[_0xe0bd('0x32')][_0xe0bd('0x36')]?_0x32ed4f[_0xe0bd('0x32')]:_0x5d64df[_0xe0bd('0x34')];if(_0x1a121f[_0xe0bd('0x2f')]['includeAll']){_0x32ed4f[_0xe0bd('0x40')]=[{'all':!![]}];}_0x32ed4f=_[_0xe0bd('0x3d')]({},_0x32ed4f,_0x1a121f[_0xe0bd('0x3f')]);return db['Disposition'][_0xe0bd('0x43')](_0x32ed4f)[_0xe0bd('0x23')](handleEntityNotFound(_0x15de49,null))['then'](respondWithResult(_0x15de49,null))[_0xe0bd('0x44')](handleError(_0x15de49,null));};exports[_0xe0bd('0x45')]=function(_0x578792,_0xd14c1d){return db[_0xe0bd('0x2a')][_0xe0bd('0x45')](_0x578792['body'],{})[_0xe0bd('0x23')](function(_0x1ad752){var _0x147438=_0x578792[_0xe0bd('0x46')][_0xe0bd('0x20')]({'plain':!![]});if(!_0x147438)throw new Error(_0xe0bd('0x47'));if(_0x147438[_0xe0bd('0x48')]===_0xe0bd('0x46')){var _0x37a067=_0x1ad752['get']({'plain':!![]});var _0x5efdf8='Dispositions';return db[_0xe0bd('0x49')][_0xe0bd('0x43')]({'where':{'name':_0x5efdf8,'userProfileId':_0x147438['userProfileId']},'raw':!![]})[_0xe0bd('0x23')](function(_0x284ea3){if(_0x284ea3&&_0x284ea3[_0xe0bd('0x4a')]===0x0){return db[_0xe0bd('0x22')][_0xe0bd('0x45')]({'name':_0x37a067[_0xe0bd('0x27')],'resourceId':_0x37a067['id'],'type':_0x284ea3[_0xe0bd('0x27')],'sectionId':_0x284ea3['id']},{})[_0xe0bd('0x23')](function(){return _0x1ad752;});}else{return _0x1ad752;}})[_0xe0bd('0x44')](function(_0x2631f5){logger['error'](_0xe0bd('0x4b'),_0x2631f5);throw _0x2631f5;});}return _0x1ad752;})[_0xe0bd('0x23')](respondWithResult(_0xd14c1d,0xc9))[_0xe0bd('0x44')](handleError(_0xd14c1d,null));};exports['update']=function(_0x16dda5,_0x37e3ba){if(_0x16dda5[_0xe0bd('0x4c')]['id']){delete _0x16dda5[_0xe0bd('0x4c')]['id'];}return db[_0xe0bd('0x2a')][_0xe0bd('0x43')]({'where':{'id':_0x16dda5[_0xe0bd('0x4d')]['id']}})[_0xe0bd('0x23')](handleEntityNotFound(_0x37e3ba,null))[_0xe0bd('0x23')](saveUpdates(_0x16dda5['body'],null))[_0xe0bd('0x23')](respondWithResult(_0x37e3ba,null))[_0xe0bd('0x44')](handleError(_0x37e3ba,null));};exports[_0xe0bd('0x1f')]=function(_0x24cdb8,_0x508a33){return db[_0xe0bd('0x2a')][_0xe0bd('0x43')]({'where':{'id':_0x24cdb8[_0xe0bd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x508a33,null))['then'](removeEntity(_0x508a33,null))[_0xe0bd('0x44')](handleError(_0x508a33,null));}; \ No newline at end of file +var _0x98a8=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','json','offset','limit','set','apply','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','count','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Dispositions','UserProfileSection','find','userProfileId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring'];(function(_0xea5631,_0x531a11){var _0x1b3c74=function(_0x7443f8){while(--_0x7443f8){_0xea5631['push'](_0xea5631['shift']());}};_0x1b3c74(++_0x531a11);}(_0x98a8,0x12c));var _0x898a=function(_0x2d0d0a,_0x1aeb4f){_0x2d0d0a=_0x2d0d0a-0x0;var _0x1c8c1a=_0x98a8[_0x2d0d0a];return _0x1c8c1a;};'use strict';var pdf=require(_0x898a('0x0'));var emlformat=require(_0x898a('0x1'));var rimraf=require(_0x898a('0x2'));var zipdir=require(_0x898a('0x3'));var jsonpatch=require(_0x898a('0x4'));var rp=require(_0x898a('0x5'));var moment=require(_0x898a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x898a('0x7'));var util=require(_0x898a('0x8'));var path=require(_0x898a('0x9'));var sox=require(_0x898a('0xa'));var csv=require(_0x898a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xb'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d7f2,_0x2c76b7){_0x2c76b7=_0x2c76b7||0xcc;return function(_0x364a23){if(_0x364a23){return _0x25d7f2['sendStatus'](_0x2c76b7);}return _0x25d7f2['status'](_0x2c76b7)['end']();};}function respondWithResult(_0x373d53,_0x1f5be4){_0x1f5be4=_0x1f5be4||0xc8;return function(_0xb24335){if(_0xb24335){return _0x373d53[_0x898a('0x18')](_0x1f5be4)[_0x898a('0x19')](_0xb24335);}};}function respondWithFilteredResult(_0x15177d,_0x506023){return function(_0x47033c){if(_0x47033c){var _0x53a4b8=_0x47033c['count'],_0x3fec7a=_0x506023[_0x898a('0x1a')],_0x5c96a6=_0x506023['offset']+_0x506023[_0x898a('0x1b')],_0x303321;if(_0x5c96a6>=_0x53a4b8){_0x5c96a6=_0x53a4b8;_0x303321=0xc8;}else{_0x303321=0xce;}_0x15177d[_0x898a('0x18')](_0x303321);return _0x15177d[_0x898a('0x1c')]('Content-Range',_0x3fec7a+'-'+_0x5c96a6+'/'+_0x53a4b8)[_0x898a('0x19')](_0x47033c);}return null;};}function patchUpdates(_0x5960e0){return function(_0x54c8f3){try{jsonpatch[_0x898a('0x1d')](_0x54c8f3,_0x5960e0,!![]);}catch(_0x1455ab){return BPromise['reject'](_0x1455ab);}return _0x54c8f3['save']();};}function saveUpdates(_0x12bc0f,_0x26449a){return function(_0x38a8f0){if(_0x38a8f0){return _0x38a8f0[_0x898a('0x1e')](_0x12bc0f)[_0x898a('0x1f')](function(_0x3570e8){return _0x3570e8;});}return null;};}function removeEntity(_0x259541,_0x483212){return function(_0x247cfc){if(_0x247cfc){return _0x247cfc[_0x898a('0x20')]()[_0x898a('0x1f')](function(){var _0x3cfd9c=_0x247cfc[_0x898a('0x21')]({'plain':!![]});var _0x310bfa='Dispositions';return db[_0x898a('0x22')][_0x898a('0x20')]({'where':{'type':_0x310bfa,'resourceId':_0x3cfd9c['id']}})[_0x898a('0x1f')](function(){return _0x247cfc;});})[_0x898a('0x1f')](function(){_0x259541[_0x898a('0x18')](0xcc)[_0x898a('0x23')]();});}};}function handleEntityNotFound(_0x5b7719,_0x20bde0){return function(_0x51d501){if(!_0x51d501){_0x5b7719['sendStatus'](0x194);}return _0x51d501;};}function handleError(_0x53ddb2,_0x3678be){_0x3678be=_0x3678be||0x1f4;return function(_0x1f4d86){logger[_0x898a('0x24')](_0x1f4d86[_0x898a('0x25')]);if(_0x1f4d86[_0x898a('0x26')]){delete _0x1f4d86[_0x898a('0x26')];}_0x53ddb2[_0x898a('0x18')](_0x3678be)[_0x898a('0x27')](_0x1f4d86);};}exports[_0x898a('0x28')]=function(_0x58149d,_0x4b3e68){var _0x47f1ed={},_0xe9c33d={},_0x62fe93={'count':0x0,'rows':[]};var _0x3b7704=_[_0x898a('0x29')](db[_0x898a('0x2a')][_0x898a('0x2b')],function(_0xe3c983){return{'name':_0xe3c983[_0x898a('0x2c')],'type':_0xe3c983[_0x898a('0x2d')][_0x898a('0x2e')]};});_0xe9c33d[_0x898a('0x2f')]=_[_0x898a('0x29')](_0x3b7704,'name');_0xe9c33d[_0x898a('0x30')]=_[_0x898a('0x31')](_0x58149d[_0x898a('0x30')]);_0xe9c33d[_0x898a('0x32')]=_[_0x898a('0x33')](_0xe9c33d['model'],_0xe9c33d['query']);_0x47f1ed[_0x898a('0x34')]=_[_0x898a('0x33')](_0xe9c33d[_0x898a('0x2f')],qs['fields'](_0x58149d[_0x898a('0x30')][_0x898a('0x35')]));_0x47f1ed[_0x898a('0x34')]=_0x47f1ed[_0x898a('0x34')][_0x898a('0x36')]?_0x47f1ed[_0x898a('0x34')]:_0xe9c33d[_0x898a('0x2f')];if(!_0x58149d[_0x898a('0x30')]['hasOwnProperty'](_0x898a('0x37'))){_0x47f1ed['limit']=qs['limit'](_0x58149d[_0x898a('0x30')]['limit']);_0x47f1ed[_0x898a('0x1a')]=qs['offset'](_0x58149d[_0x898a('0x30')]['offset']);}_0x47f1ed[_0x898a('0x38')]=qs[_0x898a('0x39')](_0x58149d[_0x898a('0x30')]['sort']);_0x47f1ed['where']=qs['filters'](_[_0x898a('0x3a')](_0x58149d[_0x898a('0x30')],_0xe9c33d['filters']));if(_0x58149d[_0x898a('0x30')][_0x898a('0x3b')]){_0x47f1ed[_0x898a('0x3c')]=_[_0x898a('0x3d')](_0x47f1ed['where'],{'$or':_['map'](_0x3b7704,function(_0x3aed01){if(_0x3aed01[_0x898a('0x2d')]!=='VIRTUAL'){var _0x59ac47={};_0x59ac47[_0x3aed01[_0x898a('0x26')]]={'$like':'%'+_0x58149d[_0x898a('0x30')][_0x898a('0x3b')]+'%'};return _0x59ac47;}})});}_0x47f1ed=_[_0x898a('0x3d')]({},_0x47f1ed,_0x58149d['options']);var _0x67114b={'where':_0x47f1ed[_0x898a('0x3c')]};return db['Disposition']['count'](_0x67114b)['then'](function(_0x2a69b9){_0x62fe93[_0x898a('0x3e')]=_0x2a69b9;if(_0x58149d[_0x898a('0x30')][_0x898a('0x3f')]){_0x47f1ed[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2a')][_0x898a('0x41')](_0x47f1ed);})[_0x898a('0x1f')](function(_0x3292c2){_0x62fe93[_0x898a('0x42')]=_0x3292c2;return _0x62fe93;})[_0x898a('0x1f')](respondWithFilteredResult(_0x4b3e68,_0x47f1ed))[_0x898a('0x43')](handleError(_0x4b3e68,null));};exports[_0x898a('0x44')]=function(_0x40f037,_0x21f307){var _0x4c8628={'raw':!![],'where':{'id':_0x40f037[_0x898a('0x45')]['id']}},_0x26ad34={};_0x26ad34[_0x898a('0x2f')]=_['keys'](db[_0x898a('0x2a')][_0x898a('0x2b')]);_0x26ad34[_0x898a('0x30')]=_[_0x898a('0x31')](_0x40f037[_0x898a('0x30')]);_0x26ad34[_0x898a('0x32')]=_[_0x898a('0x33')](_0x26ad34[_0x898a('0x2f')],_0x26ad34['query']);_0x4c8628[_0x898a('0x34')]=_[_0x898a('0x33')](_0x26ad34[_0x898a('0x2f')],qs[_0x898a('0x35')](_0x40f037['query'][_0x898a('0x35')]));_0x4c8628[_0x898a('0x34')]=_0x4c8628['attributes'][_0x898a('0x36')]?_0x4c8628['attributes']:_0x26ad34[_0x898a('0x2f')];if(_0x40f037['query']['includeAll']){_0x4c8628[_0x898a('0x40')]=[{'all':!![]}];}_0x4c8628=_['merge']({},_0x4c8628,_0x40f037[_0x898a('0x46')]);return db[_0x898a('0x2a')]['find'](_0x4c8628)[_0x898a('0x1f')](handleEntityNotFound(_0x21f307,null))[_0x898a('0x1f')](respondWithResult(_0x21f307,null))['catch'](handleError(_0x21f307,null));};exports[_0x898a('0x47')]=function(_0x199437,_0x11a0a3){return db[_0x898a('0x2a')]['create'](_0x199437[_0x898a('0x48')],{})[_0x898a('0x1f')](function(_0x5674e5){var _0x25adcc=_0x199437[_0x898a('0x49')]['get']({'plain':!![]});if(!_0x25adcc)throw new Error(_0x898a('0x4a'));if(_0x25adcc['role']===_0x898a('0x49')){var _0x41f291=_0x5674e5[_0x898a('0x21')]({'plain':!![]});var _0x50f9e3=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x4d')]({'where':{'name':_0x50f9e3,'userProfileId':_0x25adcc[_0x898a('0x4e')]},'raw':!![]})['then'](function(_0x2a21ad){if(_0x2a21ad&&_0x2a21ad['autoAssociation']===0x0){return db[_0x898a('0x22')][_0x898a('0x47')]({'name':_0x41f291[_0x898a('0x26')],'resourceId':_0x41f291['id'],'type':_0x2a21ad['name'],'sectionId':_0x2a21ad['id']},{})[_0x898a('0x1f')](function(){return _0x5674e5;});}else{return _0x5674e5;}})[_0x898a('0x43')](function(_0x195ac2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x195ac2);throw _0x195ac2;});}return _0x5674e5;})[_0x898a('0x1f')](respondWithResult(_0x11a0a3,0xc9))[_0x898a('0x43')](handleError(_0x11a0a3,null));};exports[_0x898a('0x1e')]=function(_0x295f1e,_0x28b8c9){if(_0x295f1e[_0x898a('0x48')]['id']){delete _0x295f1e[_0x898a('0x48')]['id'];}return db[_0x898a('0x2a')][_0x898a('0x4d')]({'where':{'id':_0x295f1e[_0x898a('0x45')]['id']}})[_0x898a('0x1f')](handleEntityNotFound(_0x28b8c9,null))['then'](saveUpdates(_0x295f1e[_0x898a('0x48')],null))[_0x898a('0x1f')](respondWithResult(_0x28b8c9,null))['catch'](handleError(_0x28b8c9,null));};exports[_0x898a('0x20')]=function(_0x575a6e,_0x54c44b){return db[_0x898a('0x2a')][_0x898a('0x4d')]({'where':{'id':_0x575a6e[_0x898a('0x45')]['id']}})['then'](handleEntityNotFound(_0x54c44b,null))['then'](removeEntity(_0x54c44b,null))[_0x898a('0x43')](handleError(_0x54c44b,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 143509f..f6fb9a9 100644 --- a/server/api/disposition/disposition.model.js +++ b/server/api/disposition/disposition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1f1=['FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_fax'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0xa1f1,0x14d));var _0x1a1f=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0xa1f1[_0x295a3d];return _0x23a732;};'use strict';var _=require(_0x1a1f('0x0'));var util=require(_0x1a1f('0x1'));var logger=require(_0x1a1f('0x2'))(_0x1a1f('0x3'));var moment=require(_0x1a1f('0x4'));var BPromise=require('bluebird');var rp=require(_0x1a1f('0x5'));var fs=require('fs');var path=require(_0x1a1f('0x6'));var rimraf=require(_0x1a1f('0x7'));var config=require(_0x1a1f('0x8'));var attributes=require(_0x1a1f('0x9'));module[_0x1a1f('0xa')]=function(_0x515add,_0x23010e){return _0x515add[_0x1a1f('0xb')](_0x1a1f('0xc'),attributes,{'tableName':_0x1a1f('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1a1f('0xe'),'fields':[_0x1a1f('0xf'),_0x1a1f('0x10')]},{'unique':!![],'name':'name_chat','fields':[_0x1a1f('0xf'),_0x1a1f('0x11')]},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x1a1f('0xf'),'SmsAccountId']},{'unique':!![],'name':_0x1a1f('0x12'),'fields':[_0x1a1f('0xf'),_0x1a1f('0x13')]},{'unique':!![],'name':_0x1a1f('0x14'),'fields':[_0x1a1f('0xf'),_0x1a1f('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbce0=['api','bluebird','path','rimraf','../../config/environment','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','lodash','util','../../config/logger'];(function(_0xe417e4,_0x58a674){var _0x3e60ca=function(_0x23256c){while(--_0x23256c){_0xe417e4['push'](_0xe417e4['shift']());}};_0x3e60ca(++_0x58a674);}(_0xbce0,0x1a1));var _0x0bce=function(_0x221b6c,_0x5ae5e6){_0x221b6c=_0x221b6c-0x0;var _0x474b0f=_0xbce0[_0x221b6c];return _0x474b0f;};'use strict';var _=require(_0x0bce('0x0'));var util=require(_0x0bce('0x1'));var logger=require(_0x0bce('0x2'))(_0x0bce('0x3'));var moment=require('moment');var BPromise=require(_0x0bce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bce('0x5'));var rimraf=require(_0x0bce('0x6'));var config=require(_0x0bce('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0x28f641,_0x2939c5){return _0x28f641['define'](_0x0bce('0x8'),attributes,{'tableName':_0x0bce('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0bce('0xa'),'fields':['name',_0x0bce('0xb')]},{'unique':!![],'name':_0x0bce('0xc'),'fields':[_0x0bce('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x0bce('0xe'),'fields':[_0x0bce('0xd'),_0x0bce('0xf')]},{'unique':!![],'name':_0x0bce('0x10'),'fields':['name',_0x0bce('0x11')]},{'unique':!![],'name':'name_fax','fields':['name',_0x0bce('0x12')]},{'unique':!![],'name':_0x0bce('0x13'),'fields':[_0x0bce('0xd'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 834a173..89d0a35 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2aa0=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','Disposition,\x20%s,\x20%s','message','result','catch','util'];(function(_0x4e5b52,_0x3db43d){var _0x1c0a03=function(_0x239059){while(--_0x239059){_0x4e5b52['push'](_0x4e5b52['shift']());}};_0x1c0a03(++_0x3db43d);}(_0x2aa0,0x1b4));var _0x02aa=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2aa0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x02aa('0x0'));var moment=require(_0x02aa('0x1'));var BPromise=require(_0x02aa('0x2'));var rs=require(_0x02aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02aa('0x4'))['db'];var utils=require(_0x02aa('0x5'));var logger=require('../../config/logger')(_0x02aa('0x6'));var config=require(_0x02aa('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x573b7e,_0x19a4b1,_0x2d0faf){return new BPromise(function(_0x29651b,_0x4106eb){return client[_0x02aa('0x8')](_0x573b7e,_0x2d0faf)[_0x02aa('0x9')](function(_0x2e2620){logger['info']('Disposition,\x20%s,\x20%s',_0x19a4b1,_0x02aa('0xa'));logger[_0x02aa('0xb')](_0x02aa('0xc'),_0x19a4b1,_0x02aa('0xa'),JSON['stringify'](_0x2e2620));if(_0x2e2620[_0x02aa('0xd')]){if(_0x2e2620['error'][_0x02aa('0xe')]===0x1f4){logger[_0x02aa('0xd')](_0x02aa('0xf'),_0x19a4b1,_0x2e2620['error']['message']);return _0x4106eb(_0x2e2620['error'][_0x02aa('0x10')]);}logger[_0x02aa('0xd')](_0x02aa('0xf'),_0x19a4b1,_0x2e2620[_0x02aa('0xd')][_0x02aa('0x10')]);return _0x29651b(_0x2e2620[_0x02aa('0xd')][_0x02aa('0x10')]);}else{logger['info']('Disposition,\x20%s,\x20%s',_0x19a4b1,'request\x20sent');_0x29651b(_0x2e2620[_0x02aa('0x11')][_0x02aa('0x10')]);}})[_0x02aa('0x12')](function(_0x49a223){logger[_0x02aa('0xd')](_0x02aa('0xf'),_0x19a4b1,_0x49a223);_0x4106eb(_0x49a223);});});} \ No newline at end of file +var _0xc7db=['info','Disposition,\x20%s,\x20%s','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc7db,0x111));var _0xbc7d=function(_0x1c3907,_0x41e1a7){_0x1c3907=_0x1c3907-0x0;var _0x27fcd6=_0xc7db[_0x1c3907];return _0x27fcd6;};'use strict';var _=require(_0xbc7d('0x0'));var util=require(_0xbc7d('0x1'));var moment=require(_0xbc7d('0x2'));var BPromise=require(_0xbc7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc7d('0x5'));var logger=require(_0xbc7d('0x6'))(_0xbc7d('0x7'));var config=require(_0xbc7d('0x8'));var jayson=require(_0xbc7d('0x9'));var client=jayson['client'][_0xbc7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea46,_0x1a0529,_0x38d30a){return new BPromise(function(_0xa1b84b,_0x1e66af){return client[_0xbc7d('0xb')](_0x13ea46,_0x38d30a)[_0xbc7d('0xc')](function(_0x41c2c0){logger[_0xbc7d('0xd')](_0xbc7d('0xe'),_0x1a0529,'request\x20sent');logger['debug'](_0xbc7d('0xf'),_0x1a0529,_0xbc7d('0x10'),JSON[_0xbc7d('0x11')](_0x41c2c0));if(_0x41c2c0[_0xbc7d('0x12')]){if(_0x41c2c0[_0xbc7d('0x12')][_0xbc7d('0x13')]===0x1f4){logger[_0xbc7d('0x12')](_0xbc7d('0xe'),_0x1a0529,_0x41c2c0[_0xbc7d('0x12')][_0xbc7d('0x14')]);return _0x1e66af(_0x41c2c0[_0xbc7d('0x12')][_0xbc7d('0x14')]);}logger['error'](_0xbc7d('0xe'),_0x1a0529,_0x41c2c0['error'][_0xbc7d('0x14')]);return _0xa1b84b(_0x41c2c0[_0xbc7d('0x12')][_0xbc7d('0x14')]);}else{logger[_0xbc7d('0xd')](_0xbc7d('0xe'),_0x1a0529,'request\x20sent');_0xa1b84b(_0x41c2c0[_0xbc7d('0x15')][_0xbc7d('0x14')]);}})['catch'](function(_0x5d4ae4){logger[_0xbc7d('0x12')](_0xbc7d('0xe'),_0x1a0529,_0x5d4ae4);_0x1e66af(_0x5d4ae4);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 603c965..36b152c 100644 --- a/server/api/disposition/index.js +++ b/server/api/disposition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c9a=['path','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x2bb60e,_0x4b6683){var _0x44818c=function(_0x18901e){while(--_0x18901e){_0x2bb60e['push'](_0x2bb60e['shift']());}};_0x44818c(++_0x4b6683);}(_0x1c9a,0x98));var _0xa1c9=function(_0x3dc120,_0x5196ad){_0x3dc120=_0x3dc120-0x0;var _0x5a59f=_0x1c9a[_0x3dc120];return _0x5a59f;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require('util');var path=require(_0xa1c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xa1c9('0x2'));var router=express[_0xa1c9('0x3')]();var auth=require(_0xa1c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa1c9('0x5'));var controller=require(_0xa1c9('0x6'));router[_0xa1c9('0x7')]('/',auth[_0xa1c9('0x8')](),controller['index']);router[_0xa1c9('0x7')]('/:id',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x9')]);router[_0xa1c9('0xa')]('/',auth['isAuthenticated'](),controller[_0xa1c9('0xb')]);router[_0xa1c9('0xc')](_0xa1c9('0xd'),auth[_0xa1c9('0x8')](),controller['update']);router[_0xa1c9('0xe')](_0xa1c9('0xd'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xf')]);module[_0xa1c9('0x10')]=router; \ No newline at end of file +var _0xe458=['../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','/:id','isAuthenticated','show','post','create','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x405dc0,_0x5f2898){var _0x1ed46d=function(_0x5efad7){while(--_0x5efad7){_0x405dc0['push'](_0x405dc0['shift']());}};_0x1ed46d(++_0x5f2898);}(_0xe458,0x160));var _0x8e45=function(_0x5cc9b4,_0x1cc649){_0x5cc9b4=_0x5cc9b4-0x0;var _0x2cd1df=_0xe458[_0x5cc9b4];return _0x2cd1df;};'use strict';var multer=require(_0x8e45('0x0'));var util=require(_0x8e45('0x1'));var path=require('path');var timeout=require(_0x8e45('0x2'));var express=require(_0x8e45('0x3'));var router=express[_0x8e45('0x4')]();var auth=require(_0x8e45('0x5'));var interaction=require(_0x8e45('0x6'));var config=require(_0x8e45('0x7'));var controller=require(_0x8e45('0x8'));router[_0x8e45('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8e45('0x9')](_0x8e45('0xa'),auth[_0x8e45('0xb')](),controller[_0x8e45('0xc')]);router[_0x8e45('0xd')]('/',auth[_0x8e45('0xb')](),controller[_0x8e45('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8e45('0xf')](_0x8e45('0xa'),auth[_0x8e45('0xb')](),controller['destroy']);module[_0x8e45('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 1fbd39c..56a057a 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32bf=['xCALLY\x20Motion\x20Fax','localstationid','7200','9600','12000','4800','2400','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes'];(function(_0x27091c,_0x309348){var _0x3ad65a=function(_0x2be2ba){while(--_0x2be2ba){_0x27091c['push'](_0x27091c['shift']());}};_0x3ad65a(++_0x309348);}(_0x32bf,0xd3));var _0xf32b=function(_0x4f6572,_0x512d88){_0x4f6572=_0x4f6572-0x0;var _0xd28caa=_0x32bf[_0x4f6572];return _0xd28caa;};'use strict';var Sequelize=require(_0xf32b('0x0'));module[_0xf32b('0x1')]={'name':{'type':Sequelize[_0xf32b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf32b('0x2')]},'ecm':{'type':Sequelize[_0xf32b('0x3')](_0xf32b('0x4'),'no'),'defaultValue':_0xf32b('0x4')},'headerinfo':{'type':Sequelize[_0xf32b('0x2')],'defaultValue':_0xf32b('0x5')},'localstationid':{'type':Sequelize[_0xf32b('0x2')],'unique':_0xf32b('0x6')},'minrate':{'type':Sequelize[_0xf32b('0x3')]('2400','4800',_0xf32b('0x7'),_0xf32b('0x8'),_0xf32b('0x9'),'14400'),'defaultValue':_0xf32b('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0xf32b('0xb'),'4800',_0xf32b('0x7'),_0xf32b('0x8'),_0xf32b('0x9'),_0xf32b('0xc')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xf32b('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf32b('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf32b('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xf32b('0xf'),_0xf32b('0x10'),'DADHI',_0xf32b('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xf32b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf32b('0x12')],'defaultValue':function(){return _0xf32b('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf32b('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf32b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf32b('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf32b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf32b('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf32b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf32b('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf32b('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3995fc){if(!_0x3995fc)this[_0xf32b('0x15')](_0xf32b('0x16'),null);this[_0xf32b('0x15')](_0xf32b('0x17'),_0x3995fc);}}}; \ No newline at end of file +var _0x61f0=['TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','9600','2400','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP'];(function(_0x22dd56,_0x2ed5ee){var _0x5d0f2e=function(_0x41e8c3){while(--_0x41e8c3){_0x22dd56['push'](_0x22dd56['shift']());}};_0x5d0f2e(++_0x2ed5ee);}(_0x61f0,0xe1));var _0x061f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x61f0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x061f('0x0'));module[_0x061f('0x1')]={'name':{'type':Sequelize[_0x061f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x061f('0x2')]},'ecm':{'type':Sequelize[_0x061f('0x3')]('yes','no'),'defaultValue':_0x061f('0x4')},'headerinfo':{'type':Sequelize[_0x061f('0x2')],'defaultValue':_0x061f('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x061f('0x6')},'minrate':{'type':Sequelize[_0x061f('0x3')]('2400',_0x061f('0x7'),'7200',_0x061f('0x8'),'12000','14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x061f('0x3')](_0x061f('0x9'),_0x061f('0x7'),'7200',_0x061f('0x8'),_0x061f('0xa'),_0x061f('0xb')),'defaultValue':_0x061f('0xb')},'modem':{'type':Sequelize[_0x061f('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x061f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x061f('0x3')](_0x061f('0xd'),_0x061f('0xe'),_0x061f('0xf'),_0x061f('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x061f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x061f('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x061f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x061f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x061f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x061f('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x061f('0x13'),'set':function(_0x4782a0){if(!_0x4782a0)this[_0x061f('0x14')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x061f('0x15'),_0x4782a0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 47004c7..684d4f4 100644 --- a/server/api/faxAccount/faxAccount.controller.js +++ b/server/api/faxAccount/faxAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','FaxAccount,\x20%s,\x20%s','message','info','catch','status','json','count','offset','limit','set','Content-Range','save','then','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','map','FaxAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','where','pick','filter','merge','includeAll','include','findAll','show','params','Pause','mandatoryDispositionPause','rawAttributes','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','sort','rows','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','internal','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','ecm','gateway','faxdetect','headerinfo','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','updateAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','ListId','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x49036e,_0x1eed49){var _0xb21daf=function(_0x17b545){while(--_0x17b545){_0x49036e['push'](_0x49036e['shift']());}};_0xb21daf(++_0x1eed49);}(_0x1967,0x173));var _0x7196=function(_0x379fe0,_0x12174){_0x379fe0=_0x379fe0-0x0;var _0x59700e=_0x1967[_0x379fe0];return _0x59700e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);var jayson=require(_0x7196('0x20'));var client=jayson[_0x7196('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x7196('0x21')]['http']({'port':0x232a});function checkPasswordPattern(_0xe32933,_0x2590a6,_0xf7e97){if(_0xf7e97){var _0x3ed1ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ed1ad[_0x7196('0x22')](_0x2590a6)){return _0xe32933;}else{throw new db[(_0x7196('0x23'))][(_0x7196('0x24'))](_0x7196('0x25'));}}else{return _0xe32933;}}function respondWithRpcPromise(_0x3e4e69,_0x32fe2b,_0x385f2d,_0x5b716a){return new BPromise(function(_0x4c4f91,_0x448f13){var _0x26b447=_0x5b716a||client;return _0x26b447[_0x7196('0x26')](_0x3e4e69,_0x385f2d)['then'](function(_0x39b944){logger['info']('FaxAccount,\x20%s,\x20%s',_0x32fe2b,_0x7196('0x27'));logger[_0x7196('0x28')](_0x7196('0x29'),_0x32fe2b,'request\x20sent',JSON['stringify'](_0x39b944));if(_0x39b944[_0x7196('0x2a')]){if(_0x39b944[_0x7196('0x2a')]['code']===0x1f4){logger[_0x7196('0x2a')](_0x7196('0x2b'),_0x32fe2b,_0x39b944[_0x7196('0x2a')][_0x7196('0x2c')]);return _0x448f13(_0x39b944[_0x7196('0x2a')]['message']);}logger[_0x7196('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x32fe2b,_0x39b944[_0x7196('0x2a')][_0x7196('0x2c')]);return _0x4c4f91(_0x39b944[_0x7196('0x2a')][_0x7196('0x2c')]);}else{logger[_0x7196('0x2d')](_0x7196('0x2b'),_0x32fe2b,'request\x20sent');_0x4c4f91(_0x39b944['result'][_0x7196('0x2c')]);}})[_0x7196('0x2e')](function(_0x184c09){logger['error']('FaxAccount,\x20%s,\x20%s',_0x32fe2b,_0x184c09);_0x448f13(_0x184c09);});});}function respondWithStatusCode(_0x41cfd2,_0x162cfc){_0x162cfc=_0x162cfc||0xcc;return function(_0x675e64){if(_0x675e64){return _0x41cfd2['sendStatus'](_0x162cfc);}return _0x41cfd2[_0x7196('0x2f')](_0x162cfc)['end']();};}function respondWithResult(_0x4fd339,_0x59d79d){_0x59d79d=_0x59d79d||0xc8;return function(_0x30151f){if(_0x30151f){return _0x4fd339[_0x7196('0x2f')](_0x59d79d)[_0x7196('0x30')](_0x30151f);}};}function respondWithFilteredResult(_0x4f02b1,_0x35116f){return function(_0x45d567){if(_0x45d567){var _0x2f9583=_0x45d567[_0x7196('0x31')],_0xf999e9=_0x35116f[_0x7196('0x32')],_0x50c386=_0x35116f[_0x7196('0x32')]+_0x35116f[_0x7196('0x33')],_0x39710d;if(_0x50c386>=_0x2f9583){_0x50c386=_0x2f9583;_0x39710d=0xc8;}else{_0x39710d=0xce;}_0x4f02b1[_0x7196('0x2f')](_0x39710d);return _0x4f02b1[_0x7196('0x34')](_0x7196('0x35'),_0xf999e9+'-'+_0x50c386+'/'+_0x2f9583)[_0x7196('0x30')](_0x45d567);}return null;};}function patchUpdates(_0xf33b59){return function(_0x1ff4b4){try{jsonpatch['apply'](_0x1ff4b4,_0xf33b59,!![]);}catch(_0xdf8aa){return BPromise['reject'](_0xdf8aa);}return _0x1ff4b4[_0x7196('0x36')]();};}function saveUpdates(_0x4c3365,_0x372ddc){return function(_0x25fa11){if(_0x25fa11){return _0x25fa11['update'](_0x4c3365)[_0x7196('0x37')](function(_0x2bcadd){return _0x2bcadd;});}return null;};}function removeEntity(_0x4531d7,_0x3a56b4){return function(_0x7547cf){if(_0x7547cf){return _0x7547cf['destroy']()[_0x7196('0x37')](function(){var _0x2f68e2=_0x7547cf[_0x7196('0x38')]({'plain':!![]});var _0xf2b652=_0x7196('0x39');return db[_0x7196('0x3a')]['destroy']({'where':{'type':_0xf2b652,'resourceId':_0x2f68e2['id']}})[_0x7196('0x37')](function(){return _0x7547cf;});})[_0x7196('0x37')](function(){_0x4531d7[_0x7196('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33831a,_0x75530e){return function(_0xd72bd9){if(!_0xd72bd9){_0x33831a[_0x7196('0x3b')](0x194);}return _0xd72bd9;};}function handleError(_0x11d4ec,_0x31fca7){_0x31fca7=_0x31fca7||0x1f4;return function(_0x938e49){logger[_0x7196('0x2a')](_0x938e49[_0x7196('0x3c')]);if(_0x938e49[_0x7196('0x3d')]){delete _0x938e49['name'];}_0x11d4ec[_0x7196('0x2f')](_0x31fca7)[_0x7196('0x3e')](_0x938e49);};}exports['index']=function(_0x186efe,_0x54767f){var _0x5bd701={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x301c42={},_0x1a14c6={'count':0x0,'rows':[]};var _0x1bad95=_[_0x7196('0x3f')](db[_0x7196('0x40')]['rawAttributes'],function(_0x36a990){return{'name':_0x36a990[_0x7196('0x41')],'type':_0x36a990[_0x7196('0x42')][_0x7196('0x43')]};});_0x301c42[_0x7196('0x44')]=_[_0x7196('0x3f')](_0x1bad95,_0x7196('0x3d'));_0x301c42[_0x7196('0x45')]=_['keys'](_0x186efe[_0x7196('0x45')]);_0x301c42[_0x7196('0x46')]=_['intersection'](_0x301c42[_0x7196('0x44')],_0x301c42[_0x7196('0x45')]);_0x5bd701['attributes']=_[_0x7196('0x47')](_0x301c42[_0x7196('0x44')],qs[_0x7196('0x48')](_0x186efe['query'][_0x7196('0x48')]));_0x5bd701[_0x7196('0x49')]=_0x5bd701['attributes'][_0x7196('0x4a')]?_0x5bd701[_0x7196('0x49')]:_0x301c42['model'];if(!_0x186efe[_0x7196('0x45')]['hasOwnProperty']('nolimit')){_0x5bd701['limit']=qs['limit'](_0x186efe['query'][_0x7196('0x33')]);_0x5bd701['offset']=qs[_0x7196('0x32')](_0x186efe[_0x7196('0x45')][_0x7196('0x32')]);}_0x5bd701[_0x7196('0x4b')]=qs['sort'](_0x186efe[_0x7196('0x45')]['sort']);_0x5bd701[_0x7196('0x4c')]=qs[_0x7196('0x46')](_[_0x7196('0x4d')](_0x186efe['query'],_0x301c42[_0x7196('0x46')]));if(_0x186efe[_0x7196('0x45')][_0x7196('0x4e')]){_0x5bd701['where']=_['merge'](_0x5bd701[_0x7196('0x4c')],{'$or':_['map'](_0x1bad95,function(_0x29c7e8){if(_0x29c7e8['type']!=='VIRTUAL'){var _0x14b489={};_0x14b489[_0x29c7e8['name']]={'$like':'%'+_0x186efe['query']['filter']+'%'};return _0x14b489;}})});}_0x5bd701=_[_0x7196('0x4f')]({},_0x5bd701,_0x186efe['options']);var _0x48e3b5={'where':_0x5bd701[_0x7196('0x4c')]};return db[_0x7196('0x40')][_0x7196('0x31')](_0x48e3b5)[_0x7196('0x37')](function(_0x55de40){_0x1a14c6[_0x7196('0x31')]=_0x55de40;if(_0x186efe['query'][_0x7196('0x50')]){_0x5bd701[_0x7196('0x51')]=[{'all':!![]}];}return db['FaxAccount'][_0x7196('0x52')](_0x5bd701);})[_0x7196('0x37')](function(_0x3fe092){_0x1a14c6['rows']=_0x3fe092;return _0x1a14c6;})[_0x7196('0x37')](respondWithFilteredResult(_0x54767f,_0x5bd701))['catch'](handleError(_0x54767f,null));};exports[_0x7196('0x53')]=function(_0x9fa0d3,_0x179815){var _0x1fd83f={'raw':![],'where':{'id':_0x9fa0d3[_0x7196('0x54')]['id']},'include':[{'model':db[_0x7196('0x55')],'as':_0x7196('0x56')}]},_0x41a9aa={};_0x41a9aa['model']=_['keys'](db[_0x7196('0x40')][_0x7196('0x57')]);_0x41a9aa[_0x7196('0x45')]=_[_0x7196('0x58')](_0x9fa0d3['query']);_0x41a9aa[_0x7196('0x46')]=_[_0x7196('0x47')](_0x41a9aa[_0x7196('0x44')],_0x41a9aa[_0x7196('0x45')]);_0x1fd83f[_0x7196('0x49')]=_[_0x7196('0x47')](_0x41a9aa[_0x7196('0x44')],qs[_0x7196('0x48')](_0x9fa0d3[_0x7196('0x45')][_0x7196('0x48')]));_0x1fd83f[_0x7196('0x49')]=_0x1fd83f['attributes'][_0x7196('0x4a')]?_0x1fd83f[_0x7196('0x49')]:_0x41a9aa[_0x7196('0x44')];if(_0x9fa0d3['query'][_0x7196('0x50')]){_0x1fd83f['include']=[{'all':!![]}];}_0x1fd83f=_[_0x7196('0x4f')]({},_0x1fd83f,_0x9fa0d3[_0x7196('0x59')]);return db[_0x7196('0x40')][_0x7196('0x5a')](_0x1fd83f)[_0x7196('0x37')](handleEntityNotFound(_0x179815,null))['then'](respondWithResult(_0x179815,null))[_0x7196('0x2e')](handleError(_0x179815,null));};exports['create']=function(_0x4be36d,_0x5b9824){return db[_0x7196('0x40')][_0x7196('0x5b')](_0x4be36d[_0x7196('0x5c')],{})[_0x7196('0x37')](function(_0x105a3f){var _0x41fa94=_0x4be36d[_0x7196('0x5d')]['get']({'plain':!![]});if(!_0x41fa94)throw new Error(_0x7196('0x5e'));if(_0x41fa94[_0x7196('0x5f')]===_0x7196('0x5d')){var _0x2e5c9c=_0x105a3f[_0x7196('0x38')]({'plain':!![]});var _0x5ef1eb='FaxAccounts';return db[_0x7196('0x60')][_0x7196('0x5a')]({'where':{'name':_0x5ef1eb,'userProfileId':_0x41fa94[_0x7196('0x61')]},'raw':!![]})[_0x7196('0x37')](function(_0x14cb38){if(_0x14cb38&&_0x14cb38[_0x7196('0x62')]===0x0){return db[_0x7196('0x3a')][_0x7196('0x5b')]({'name':_0x2e5c9c[_0x7196('0x3d')],'resourceId':_0x2e5c9c['id'],'type':_0x14cb38[_0x7196('0x3d')],'sectionId':_0x14cb38['id']},{})[_0x7196('0x37')](function(){return _0x105a3f;});}else{return _0x105a3f;}})['catch'](function(_0x33dee7){logger[_0x7196('0x2a')](_0x7196('0x63'),_0x33dee7);throw _0x33dee7;});}return _0x105a3f;})[_0x7196('0x37')](respondWithResult(_0x5b9824,0xc9))['catch'](handleError(_0x5b9824,null));};exports[_0x7196('0x64')]=function(_0x204c3a,_0x1f3acc){if(_0x204c3a[_0x7196('0x5c')]['id']){delete _0x204c3a[_0x7196('0x5c')]['id'];}return db[_0x7196('0x40')][_0x7196('0x5a')]({'where':{'id':_0x204c3a['params']['id']},'include':[{'model':db[_0x7196('0x55')],'as':_0x7196('0x56')}]})[_0x7196('0x37')](handleEntityNotFound(_0x1f3acc,null))[_0x7196('0x37')](saveUpdates(_0x204c3a['body'],null))[_0x7196('0x37')](respondWithResult(_0x1f3acc,null))[_0x7196('0x2e')](handleError(_0x1f3acc,null));};exports[_0x7196('0x65')]=function(_0xff7793,_0x4673e9){return db[_0x7196('0x40')][_0x7196('0x5a')]({'where':{'id':_0xff7793['params']['id']}})['then'](handleEntityNotFound(_0x4673e9,null))['then'](removeEntity(_0x4673e9,null))[_0x7196('0x2e')](handleError(_0x4673e9,null));};exports['describe']=function(_0xd94bd1,_0x432a38){return db[_0x7196('0x40')][_0x7196('0x66')]()[_0x7196('0x37')](respondWithResult(_0x432a38,null))[_0x7196('0x2e')](handleError(_0x432a38,null));};exports[_0x7196('0x67')]=function(_0x71dc04,_0x3881a5,_0x52ab69){if(_0x71dc04['body']['id']){delete _0x71dc04[_0x7196('0x5c')]['id'];}return db[_0x7196('0x40')][_0x7196('0x5a')]({'where':{'id':_0x71dc04[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x3881a5,null))[_0x7196('0x37')](function(_0xa55f4b){if(_0xa55f4b){_0x71dc04[_0x7196('0x5c')]['FaxAccountId']=_0xa55f4b['id'];return db['Disposition'][_0x7196('0x5b')](_0x71dc04['body']);}})[_0x7196('0x37')](respondWithResult(_0x3881a5,null))['catch'](handleError(_0x3881a5,null));};exports[_0x7196('0x68')]=function(_0x2ffe1f,_0x74fa58,_0x267903){var _0x5ab6ae={'raw':![],'where':{}};var _0x5a786a={};var _0x33d301={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7196('0x69')]({'where':{'id':_0x2ffe1f[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x74fa58,null))[_0x7196('0x37')](function(_0xd4c784){if(_0xd4c784){_0x5a786a[_0x7196('0x44')]=_['keys'](db[_0x7196('0x6a')][_0x7196('0x57')]);_0x5a786a[_0x7196('0x45')]=_[_0x7196('0x58')](_0x2ffe1f[_0x7196('0x45')]);_0x5a786a[_0x7196('0x46')]=_[_0x7196('0x47')](_0x5a786a[_0x7196('0x44')],_0x5a786a[_0x7196('0x45')]);_0x5ab6ae[_0x7196('0x49')]=_[_0x7196('0x47')](_0x5a786a[_0x7196('0x44')],qs['fields'](_0x2ffe1f[_0x7196('0x45')][_0x7196('0x48')]));_0x5ab6ae['attributes']=_0x5ab6ae['attributes'][_0x7196('0x4a')]?_0x5ab6ae[_0x7196('0x49')]:_0x5a786a[_0x7196('0x44')];if(!_0x2ffe1f['query'][_0x7196('0x6b')]('nolimit')){_0x5ab6ae[_0x7196('0x33')]=qs[_0x7196('0x33')](_0x2ffe1f['query'][_0x7196('0x33')]);_0x5ab6ae['offset']=qs['offset'](_0x2ffe1f[_0x7196('0x45')][_0x7196('0x32')]);}_0x5ab6ae[_0x7196('0x4b')]=qs['sort'](_0x2ffe1f[_0x7196('0x45')]['sort']);_0x5ab6ae[_0x7196('0x4c')]=qs[_0x7196('0x46')](_[_0x7196('0x4d')](_0x2ffe1f[_0x7196('0x45')],_0x5a786a[_0x7196('0x46')]));_0x5ab6ae['where'][_0x7196('0x6c')]=_0xd4c784['id'];if(_0x2ffe1f[_0x7196('0x45')][_0x7196('0x4e')]){_0x5ab6ae[_0x7196('0x4c')]=_[_0x7196('0x4f')](_0x5ab6ae[_0x7196('0x4c')],{'$or':_[_0x7196('0x3f')](_0x5ab6ae[_0x7196('0x49')],function(_0x544630){var _0x2be199={};_0x2be199[_0x544630]={'$like':'%'+_0x2ffe1f[_0x7196('0x45')][_0x7196('0x4e')]+'%'};return _0x2be199;})});}_0x5ab6ae=_[_0x7196('0x4f')]({},_0x5ab6ae,_0x2ffe1f['options']);return db[_0x7196('0x6a')][_0x7196('0x31')]({'where':_0x5ab6ae['where']})[_0x7196('0x37')](function(_0x53d470){_0x33d301[_0x7196('0x31')]=_0x53d470;if(_0x2ffe1f['query'][_0x7196('0x50')]){_0x5ab6ae[_0x7196('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x7196('0x52')](_0x5ab6ae);})[_0x7196('0x37')](function(_0x2c2c53){_0x33d301['rows']=_0x2c2c53;return _0x33d301;});}})['then'](respondWithFilteredResult(_0x74fa58,_0x5ab6ae))[_0x7196('0x2e')](handleError(_0x74fa58,null));};exports['removeDispositions']=function(_0x4d3a21,_0x3d29b6,_0x72c765){return db[_0x7196('0x40')]['find']({'where':{'id':_0x4d3a21[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x3d29b6,null))[_0x7196('0x37')](function(_0x175dd8){if(_0x175dd8){return _0x175dd8[_0x7196('0x6d')](_0x4d3a21[_0x7196('0x45')][_0x7196('0x6e')]);}})[_0x7196('0x37')](respondWithStatusCode(_0x3d29b6,null))[_0x7196('0x2e')](handleError(_0x3d29b6,null));};exports[_0x7196('0x6f')]=function(_0x173fe5,_0x5eb2b5,_0x5acff1){if(_0x173fe5[_0x7196('0x5c')]['id']){delete _0x173fe5['body']['id'];}return db['FaxAccount'][_0x7196('0x5a')]({'where':{'id':_0x173fe5[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x5eb2b5,null))[_0x7196('0x37')](function(_0x4c9a66){if(_0x4c9a66){_0x173fe5['body'][_0x7196('0x6c')]=_0x4c9a66['id'];return db[_0x7196('0x70')][_0x7196('0x5b')](_0x173fe5[_0x7196('0x5c')]);}})['then'](respondWithResult(_0x5eb2b5,null))[_0x7196('0x2e')](handleError(_0x5eb2b5,null));};exports['getAnswers']=function(_0x4e8ba8,_0x2820ef,_0x884d80){var _0x1e14da={'raw':![],'where':{}};var _0x494418={};var _0x400aa5={'count':0x0,'rows':[]};return db[_0x7196('0x40')][_0x7196('0x69')]({'where':{'id':_0x4e8ba8[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x2820ef,null))[_0x7196('0x37')](function(_0x214ec2){if(_0x214ec2){_0x494418[_0x7196('0x44')]=_['keys'](db[_0x7196('0x70')][_0x7196('0x57')]);_0x494418[_0x7196('0x45')]=_[_0x7196('0x58')](_0x4e8ba8[_0x7196('0x45')]);_0x494418['filters']=_[_0x7196('0x47')](_0x494418[_0x7196('0x44')],_0x494418[_0x7196('0x45')]);_0x1e14da['attributes']=_[_0x7196('0x47')](_0x494418['model'],qs['fields'](_0x4e8ba8[_0x7196('0x45')][_0x7196('0x48')]));_0x1e14da['attributes']=_0x1e14da[_0x7196('0x49')][_0x7196('0x4a')]?_0x1e14da['attributes']:_0x494418[_0x7196('0x44')];if(!_0x4e8ba8[_0x7196('0x45')][_0x7196('0x6b')](_0x7196('0x71'))){_0x1e14da[_0x7196('0x33')]=qs[_0x7196('0x33')](_0x4e8ba8['query'][_0x7196('0x33')]);_0x1e14da[_0x7196('0x32')]=qs[_0x7196('0x32')](_0x4e8ba8['query']['offset']);}_0x1e14da['order']=qs[_0x7196('0x72')](_0x4e8ba8[_0x7196('0x45')][_0x7196('0x72')]);_0x1e14da['where']=qs[_0x7196('0x46')](_['pick'](_0x4e8ba8[_0x7196('0x45')],_0x494418['filters']));_0x1e14da[_0x7196('0x4c')][_0x7196('0x6c')]=_0x214ec2['id'];if(_0x4e8ba8[_0x7196('0x45')][_0x7196('0x4e')]){_0x1e14da[_0x7196('0x4c')]=_[_0x7196('0x4f')](_0x1e14da[_0x7196('0x4c')],{'$or':_['map'](_0x1e14da[_0x7196('0x49')],function(_0x4a3cd1){var _0x58fd39={};_0x58fd39[_0x4a3cd1]={'$like':'%'+_0x4e8ba8['query']['filter']+'%'};return _0x58fd39;})});}_0x1e14da=_['merge']({},_0x1e14da,_0x4e8ba8[_0x7196('0x59')]);return db[_0x7196('0x70')][_0x7196('0x31')]({'where':_0x1e14da['where']})[_0x7196('0x37')](function(_0x49bf7e){_0x400aa5['count']=_0x49bf7e;if(_0x4e8ba8['query'][_0x7196('0x50')]){_0x1e14da['include']=[{'all':!![]}];}return db[_0x7196('0x70')][_0x7196('0x52')](_0x1e14da);})[_0x7196('0x37')](function(_0x1b6665){_0x400aa5[_0x7196('0x73')]=_0x1b6665;return _0x400aa5;});}})[_0x7196('0x37')](respondWithFilteredResult(_0x2820ef,_0x1e14da))[_0x7196('0x2e')](handleError(_0x2820ef,null));};exports[_0x7196('0x74')]=function(_0x49d494,_0x377a27,_0x5fac0){return db[_0x7196('0x40')]['find']({'where':{'id':_0x49d494[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x377a27,null))[_0x7196('0x37')](function(_0x4fa1b5){if(_0x4fa1b5){return _0x4fa1b5[_0x7196('0x74')](_0x49d494[_0x7196('0x45')][_0x7196('0x6e')]);}})['then'](respondWithStatusCode(_0x377a27,null))[_0x7196('0x2e')](handleError(_0x377a27,null));};exports[_0x7196('0x75')]=function(_0x4d4f1b,_0xfb40ad,_0x5db5f1){return db[_0x7196('0x76')][_0x7196('0x5a')]({'where':{'id':_0x4d4f1b['params']['id']}})[_0x7196('0x37')](handleEntityNotFound(_0xfb40ad,null))['then'](function(_0x5d24ff){if(_0x5d24ff){return _0x5d24ff[_0x7196('0x75')](_0x4d4f1b[_0x7196('0x5c')]['ids'],_[_0x7196('0x77')](_0x4d4f1b[_0x7196('0x5c')],[_0x7196('0x6e'),'id'])||{});}})[_0x7196('0x37')](respondWithResult(_0xfb40ad,null))['catch'](handleError(_0xfb40ad,null));};exports[_0x7196('0x78')]=function(_0x1af290,_0x10217b,_0x58e03a){var _0x526efb={'raw':![],'where':{}};var _0x2e0885={};var _0x1873b5={'count':0x0,'rows':[]};return db[_0x7196('0x40')][_0x7196('0x69')]({'where':{'id':_0x1af290['params']['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x10217b,null))['then'](function(_0x120360){if(_0x120360){_0x2e0885['model']=_[_0x7196('0x58')](db[_0x7196('0x76')][_0x7196('0x57')]);_0x2e0885[_0x7196('0x45')]=_[_0x7196('0x58')](_0x1af290[_0x7196('0x45')]);_0x2e0885[_0x7196('0x46')]=_['intersection'](_0x2e0885[_0x7196('0x44')],_0x2e0885[_0x7196('0x45')]);_0x526efb[_0x7196('0x49')]=_[_0x7196('0x47')](_0x2e0885[_0x7196('0x44')],qs[_0x7196('0x48')](_0x1af290[_0x7196('0x45')][_0x7196('0x48')]));_0x526efb['attributes']=_0x526efb[_0x7196('0x49')][_0x7196('0x4a')]?_0x526efb['attributes']:_0x2e0885[_0x7196('0x44')];if(!_0x1af290[_0x7196('0x45')]['hasOwnProperty'](_0x7196('0x71'))){_0x526efb[_0x7196('0x33')]=qs[_0x7196('0x33')](_0x1af290[_0x7196('0x45')]['limit']);_0x526efb['offset']=qs[_0x7196('0x32')](_0x1af290['query'][_0x7196('0x32')]);}_0x526efb[_0x7196('0x4b')]=qs[_0x7196('0x72')](_0x1af290[_0x7196('0x45')][_0x7196('0x72')]);_0x526efb['where']=qs[_0x7196('0x46')](_[_0x7196('0x4d')](_0x1af290[_0x7196('0x45')],_0x2e0885[_0x7196('0x46')]));_0x526efb[_0x7196('0x4c')][_0x7196('0x6c')]=_0x120360['id'];if(_0x1af290[_0x7196('0x45')][_0x7196('0x4e')]){_0x526efb[_0x7196('0x4c')]=_['merge'](_0x526efb['where'],{'$or':_['map'](_0x526efb[_0x7196('0x49')],function(_0x85e771){var _0x92179b={};_0x92179b[_0x85e771]={'$like':'%'+_0x1af290[_0x7196('0x45')][_0x7196('0x4e')]+'%'};return _0x92179b;})});}_0x526efb=_[_0x7196('0x4f')]({},_0x526efb,_0x1af290[_0x7196('0x59')]);return db[_0x7196('0x76')]['count']({'where':_0x526efb['where']})['then'](function(_0x5ee12a){_0x1873b5[_0x7196('0x31')]=_0x5ee12a;if(_0x1af290[_0x7196('0x45')][_0x7196('0x50')]){_0x526efb[_0x7196('0x51')]=[{'model':db[_0x7196('0x79')],'as':_0x7196('0x7a'),'required':![]},{'model':db['User'],'as':_0x7196('0x7b'),'attributes':['name','fullname',_0x7196('0x7c')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x7196('0x3d'),'color'],'where':_0x1af290[_0x7196('0x45')][_0x7196('0x7d')]?{'id':_0x1af290[_0x7196('0x45')][_0x7196('0x7d')]}:undefined,'required':_0x1af290[_0x7196('0x45')][_0x7196('0x7d')]?!![]:![]}];}return db['FaxInteraction'][_0x7196('0x52')](_0x526efb);})[_0x7196('0x37')](function(_0x30e700){_0x1873b5['rows']=_0x30e700;return _0x1873b5;});}})[_0x7196('0x37')](respondWithFilteredResult(_0x10217b,_0x526efb))[_0x7196('0x2e')](handleError(_0x10217b,null));};exports[_0x7196('0x7e')]=function(_0x48262c,_0x571fa5,_0x2d1e7e){return db[_0x7196('0x40')][_0x7196('0x69')]({'where':{'id':_0x48262c[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x571fa5,null))[_0x7196('0x37')](function(_0x1a8a5a){if(_0x1a8a5a){return db[_0x7196('0x7f')][_0x7196('0x80')](function(_0xbd94ef){return db['FaxApplication'][_0x7196('0x65')]({'where':{'FaxAccountId':_0x48262c[_0x7196('0x54')]['id']},'transaction':_0xbd94ef})['then'](function(_0x33265b){var _0x42025c=_['map'](_0x48262c[_0x7196('0x5c')],function(_0x386259){_0x386259[_0x7196('0x6c')]=_0x48262c[_0x7196('0x54')]['id'];return _0x386259;});return db[_0x7196('0x81')][_0x7196('0x82')](_0x42025c,{'transaction':_0xbd94ef});});})['then'](function(){return db['FaxApplication'][_0x7196('0x83')]({'where':{'FaxAccountId':_0x48262c['params']['id']},'order':_0x7196('0x84')});});}})[_0x7196('0x37')](respondWithResult(_0x571fa5,null))[_0x7196('0x2e')](handleError(_0x571fa5,null));};exports['getApplications']=function(_0x4729e1,_0x66e1e6,_0x237e70){var _0x148607={};var _0x10d504={};var _0x1e2105;var _0x285c8e;return db[_0x7196('0x40')][_0x7196('0x69')]({'where':{'id':_0x4729e1['params']['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x66e1e6,null))[_0x7196('0x37')](function(_0x928d2c){if(_0x928d2c){_0x1e2105=_0x928d2c;_0x10d504[_0x7196('0x44')]=_[_0x7196('0x58')](db[_0x7196('0x81')]['rawAttributes']);_0x10d504[_0x7196('0x45')]=_['keys'](_0x4729e1[_0x7196('0x45')]);_0x10d504[_0x7196('0x46')]=_[_0x7196('0x47')](_0x10d504['model'],_0x10d504['query']);_0x148607[_0x7196('0x49')]=_[_0x7196('0x47')](_0x10d504[_0x7196('0x44')],qs[_0x7196('0x48')](_0x4729e1[_0x7196('0x45')][_0x7196('0x48')]));_0x148607[_0x7196('0x49')]=_0x148607[_0x7196('0x49')]['length']?_0x148607[_0x7196('0x49')]:_0x10d504[_0x7196('0x44')];_0x148607['order']=qs[_0x7196('0x72')](_0x4729e1[_0x7196('0x45')][_0x7196('0x72')]);_0x148607['where']=qs[_0x7196('0x46')](_[_0x7196('0x4d')](_0x4729e1[_0x7196('0x45')],_0x10d504[_0x7196('0x46')]));if(_0x4729e1[_0x7196('0x45')]['filter']){_0x148607['where']=_[_0x7196('0x4f')](_0x148607[_0x7196('0x4c')],{'$or':_[_0x7196('0x3f')](_0x148607[_0x7196('0x49')],function(_0x94976a){var _0x460dca={};_0x460dca[_0x94976a]={'$like':'%'+_0x4729e1['query'][_0x7196('0x4e')]+'%'};return _0x460dca;})});}_0x148607=_[_0x7196('0x4f')]({},_0x148607,_0x4729e1[_0x7196('0x59')]);return _0x1e2105[_0x7196('0x85')](_0x148607);}})['then'](function(_0xfc8d67){if(_0xfc8d67){_0x285c8e=_0xfc8d67[_0x7196('0x4a')];if(!_0x4729e1[_0x7196('0x45')][_0x7196('0x6b')](_0x7196('0x71'))){_0x148607[_0x7196('0x33')]=qs[_0x7196('0x33')](_0x4729e1[_0x7196('0x45')][_0x7196('0x33')]);_0x148607[_0x7196('0x32')]=qs[_0x7196('0x32')](_0x4729e1[_0x7196('0x45')]['offset']);}return _0x1e2105[_0x7196('0x85')](_0x148607);}})['then'](function(_0x2d0b65){if(_0x2d0b65){return _0x2d0b65?{'count':_0x285c8e,'rows':_0x2d0b65}:null;}})['then'](respondWithResult(_0x66e1e6,null))[_0x7196('0x2e')](handleError(_0x66e1e6,null));};function Extension(_0x498fa5,_0x974f7e,_0x3bf481,_0x2b8a37){this[_0x7196('0x86')]='from-voip-provider';this[_0x7196('0x87')]=_0x498fa5[_0x7196('0x88')];this[_0x7196('0x89')]=_0x2b8a37;this['type']=_0x7196('0x8a');this[_0x7196('0x8b')]=_0x7196('0x8c');this['FaxAccountId']=_0x498fa5['id'];this[_0x7196('0x84')]=_0x974f7e;this[_0x7196('0x8d')]=_0x3bf481;}function createExtensionsReciveFax(_0x31efd9){var _0x58a0d4=0x1;var _0x16e9f6=[];_0x16e9f6[_0x7196('0x8e')](new Extension(_0x31efd9,_0x58a0d4,'',_0x7196('0x8f')));_0x58a0d4+=0x1;_0x16e9f6['push'](new Extension(_0x31efd9,_0x58a0d4,'CDR(type)=inbound-fax','Set'));_0x58a0d4+=0x1;for(var _0x542f8e in _0x31efd9){if(_0x31efd9[_0x7196('0x6b')](_0x542f8e)&&(_0x542f8e===_0x7196('0x90')||_0x542f8e==='localstationid'||_0x542f8e===_0x7196('0x91')||_0x542f8e===_0x7196('0x92')||_0x542f8e===_0x7196('0x93')||_0x542f8e==='maxrate'||_0x542f8e==='minrate'||_0x542f8e===_0x7196('0x94')||_0x542f8e===_0x7196('0x95'))){_0x16e9f6[_0x7196('0x8e')](new Extension(_0x31efd9,_0x58a0d4,_0x7196('0x96')+_0x542f8e+')='+_0x31efd9[_0x542f8e],_0x7196('0x97')));_0x58a0d4+=0x1;}}_0x16e9f6['push'](new Extension(_0x31efd9,_0x58a0d4,'6',_0x7196('0x98')));_0x58a0d4+=0x1;_0x16e9f6[_0x7196('0x8e')](new Extension(_0x31efd9,_0x58a0d4,_0x7196('0x99'),_0x7196('0x9a')));_0x58a0d4=0x0;return _0x16e9f6;}exports['addAccountApplications']=function(_0x50f66f,_0x1b088e,_0x166e99){var _0x163053;return db[_0x7196('0x7f')][_0x7196('0x80')](function(_0x1a3625){return db['FaxAccount']['create'](_0x50f66f[_0x7196('0x5c')],{'transaction':_0x1a3625})[_0x7196('0x37')](function(_0x1da124){_0x163053=_0x1da124['get']({'plain':!![]});return db['VoiceExtension'][_0x7196('0x82')](createExtensionsReciveFax(_0x163053),{'transaction':_0x1a3625});});})['then'](function(){return _0x163053;})[_0x7196('0x37')](respondWithResult(_0x1b088e,null))[_0x7196('0x2e')](handleError(_0x1b088e,null));};exports[_0x7196('0x9b')]=function(_0xca181d,_0x194df8,_0x3676e8){var _0x2ed123;return db[_0x7196('0x7f')][_0x7196('0x80')](function(_0x2d4fc8){return db['FaxAccount'][_0x7196('0x64')](_0xca181d['body'],{'where':{'id':_0xca181d[_0x7196('0x5c')]['id']},'transaction':_0x2d4fc8})[_0x7196('0x37')](function(_0xc45ad6){return db[_0x7196('0x9c')]['destroy']({'where':{'FaxAccountId':_0xca181d['body']['id']},'transaction':_0x2d4fc8})[_0x7196('0x37')](function(_0x44ba4b){return db[_0x7196('0x9c')][_0x7196('0x82')](createExtensionsReciveFax(_['omit'](_0xca181d['body'],[_0x7196('0x9d'),_0x7196('0x43'),'createdAt',_0x7196('0x9e'),_0x7196('0x9f'),'ListId'])),{'transaction':_0x2d4fc8});});});})[_0x7196('0x37')](function(){return db[_0x7196('0x40')][_0x7196('0xa0')](_0xca181d[_0x7196('0x5c')]['id']);})[_0x7196('0x37')](respondWithResult(_0x194df8,null))[_0x7196('0x2e')](handleError(_0x194df8,null));};exports[_0x7196('0xa1')]=function(_0x5cbd30,_0x3832a3,_0x375d8b){var _0x49cb31={'raw':!![],'where':{}};var _0x4f8c74={};var _0x371ea6={'count':0x0,'rows':[]};return db[_0x7196('0x40')][_0x7196('0x69')]({'where':{'id':_0x5cbd30[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x3832a3,null))[_0x7196('0x37')](function(_0xeba650){if(_0xeba650){_0x4f8c74[_0x7196('0x44')]=_[_0x7196('0x58')](db[_0x7196('0xa2')][_0x7196('0x57')]);_0x4f8c74[_0x7196('0x45')]=_[_0x7196('0x58')](_0x5cbd30[_0x7196('0x45')]);_0x4f8c74[_0x7196('0x46')]=_['intersection'](_0x4f8c74[_0x7196('0x44')],_0x4f8c74[_0x7196('0x45')]);_0x49cb31['attributes']=_[_0x7196('0x47')](_0x4f8c74[_0x7196('0x44')],qs[_0x7196('0x48')](_0x5cbd30[_0x7196('0x45')][_0x7196('0x48')]));_0x49cb31[_0x7196('0x49')]=_0x49cb31[_0x7196('0x49')][_0x7196('0x4a')]?_0x49cb31[_0x7196('0x49')]:_0x4f8c74['model'];if(!_0x5cbd30[_0x7196('0x45')][_0x7196('0x6b')](_0x7196('0x71'))){_0x49cb31['limit']=qs[_0x7196('0x33')](_0x5cbd30[_0x7196('0x45')][_0x7196('0x33')]);_0x49cb31[_0x7196('0x32')]=qs[_0x7196('0x32')](_0x5cbd30['query'][_0x7196('0x32')]);}_0x49cb31['order']=qs[_0x7196('0x72')](_0x5cbd30['query'][_0x7196('0x72')]);_0x49cb31[_0x7196('0x4c')]=qs[_0x7196('0x46')](_[_0x7196('0x4d')](_0x5cbd30[_0x7196('0x45')],_0x4f8c74[_0x7196('0x46')]));_0x49cb31[_0x7196('0x4c')][_0x7196('0x6c')]=_0xeba650['id'];if(_0x5cbd30['query'][_0x7196('0x4e')]){_0x49cb31[_0x7196('0x4c')]=_[_0x7196('0x4f')](_0x49cb31['where'],{'$or':_['map'](_0x49cb31['attributes'],function(_0x5d95d5){var _0x46c508={};_0x46c508[_0x5d95d5]={'$like':'%'+_0x5cbd30['query'][_0x7196('0x4e')]+'%'};return _0x46c508;})});}if(_0x5cbd30[_0x7196('0x45')][_0x7196('0xa3')]){var _0x1acccb=_0x5cbd30[_0x7196('0x45')][_0x7196('0xa3')][_0x7196('0xa4')](',');var _0x1d7a0a={};_0x1d7a0a[_0x1acccb[0x0]]={'$gte':moment(_0x1acccb[0x1])[_0x7196('0xa5')](_0x7196('0xa6'))};_0x49cb31['where']=_[_0x7196('0x4f')](_0x49cb31[_0x7196('0x4c')],_0x1d7a0a);}_0x49cb31=_['merge']({},_0x49cb31,_0x5cbd30[_0x7196('0x59')]);return db['FaxMessage'][_0x7196('0x31')]({'where':_0x49cb31[_0x7196('0x4c')]})[_0x7196('0x37')](function(_0x5498bb){_0x371ea6['count']=_0x5498bb;if(_0x5cbd30[_0x7196('0x45')][_0x7196('0x50')]){_0x49cb31['include']=[{'all':!![]}];}return db[_0x7196('0xa2')][_0x7196('0x52')](_0x49cb31);})['then'](function(_0xfa0a49){_0x371ea6[_0x7196('0x73')]=_0xfa0a49;return _0x371ea6;});}})['then'](respondWithFilteredResult(_0x3832a3,_0x49cb31))['catch'](handleError(_0x3832a3,null));};exports['send']=function(_0xc9251,_0x3f98bc,_0x1f31a1){var _0x4da714,_0x21ceb3={},_0xa2ad5a;if(_0xc9251[_0x7196('0x5c')]['to']){_0xa2ad5a=_0xc9251[_0x7196('0x5c')]['to'][0x0];}return db[_0x7196('0x40')][_0x7196('0x5a')]({'where':{'id':_0xc9251[_0x7196('0x54')]['id']},'include':[{'model':db[_0x7196('0xa7')],'as':_0x7196('0xa8'),'include':[{'model':db[_0x7196('0x79')],'as':_0x7196('0xa9'),'where':{'fax':_0xa2ad5a},'limit':0x1,'order':[[_0x7196('0x9e'),_0x7196('0xaa')]]}]}]})[_0x7196('0x37')](handleEntityNotFound(_0x3f98bc,null))['then'](function(_0x28a843){_0x4da714=_0x28a843;if(_0xc9251['body'][_0x7196('0xab')]&&_0xc9251[_0x7196('0x5c')]['attachments'][_0x7196('0x4a')]){for(var _0x5c606d=0x0;_0x5c606d<_0xc9251[_0x7196('0x5c')]['attachments']['length'];_0x5c606d+=0x1){_0xc9251[_0x7196('0x5c')]['attachments'][_0x5c606d]={'filename':_0xc9251['body']['attachments'][_0x5c606d]['name'],'id':_0xc9251[_0x7196('0x5c')][_0x7196('0xab')][_0x5c606d]['id'],'path':path[_0x7196('0xac')](config[_0x7196('0xad')],_0x7196('0xae'),_0xc9251['body'][_0x7196('0xab')][_0x5c606d]['basename'])};}}return respondWithRpcPromise(_0x7196('0xaf'),'CheckAfterSend',{'FaxAccountId':_[_0x7196('0xb0')](_0xc9251[_0x7196('0x54')]['id'])?undefined:_0xc9251['params']['id'],'path':_[_0x7196('0xb0')](_0xc9251['body'][_0x7196('0xab')][0x0]['path'])?undefined:_0xc9251[_0x7196('0x5c')][_0x7196('0xab')][0x0]['path'],'fax':_['isNil'](_0xc9251['body']['to'][0x0])?undefined:_0xc9251[_0x7196('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x4da714){if(_[_0x7196('0xb0')](_0xc9251[_0x7196('0x5c')][_0x7196('0xb1')])){_0xc9251[_0x7196('0x5c')][_0x7196('0xb1')]=util[_0x7196('0xa5')](_0x7196('0xb2'),_0x4da714['name'],_0x4da714['fax']);}if(_0x4da714[_0x7196('0xa8')]){if(_0x4da714['List'][_0x7196('0xa9')][_0x7196('0x4a')]){return _0x4da714[_0x7196('0xa8')][_0x7196('0xa9')][0x0];}else{return db['CmContact'][_0x7196('0x5b')](_[_0x7196('0x1b')](_0xc9251[_0x7196('0x5c')],{'firstName':_0xc9251[_0x7196('0x5c')]['to'][0x0],'phone':_0xc9251[_0x7196('0x5c')]['to'][0x0],'fax':_0xc9251[_0x7196('0x5c')]['to'][0x0],'ListId':_0x4da714[_0x7196('0xb3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x7196('0xb4'));}})[_0x7196('0x37')](function(_0xc1860a){if(_0xc1860a){return db[_0x7196('0x76')][_0x7196('0x5a')]({'where':{'ContactId':_0xc1860a['id'],'closed':![],'FaxAccountId':_0x4da714['id']}})[_0x7196('0x37')](function(_0x49cd29){if(_0x49cd29){return[_0x49cd29,![]];}return db[_0x7196('0x76')][_0x7196('0x5b')]({'UserId':_0xc9251[_0x7196('0x5d')]['id'],'ContactId':_0xc1860a['id'],'FaxAccountId':_0x4da714['id'],'fax':_0xc9251[_0x7196('0x5c')]['to'][0x0],'firstMsgDirection':_0x7196('0xb5'),'Messages':[_[_0x7196('0x4f')](_0xc9251[_0x7196('0x5c')],{'read':![],'body':_0xc9251[_0x7196('0x5c')][_0x7196('0xab')][0x0][_0x7196('0xb6')],'FaxAccountId':_0x4da714['id'],'UserId':_0xc9251['user']['id'],'ContactId':_0xc1860a['id'],'AttachmentId':_0xc9251[_0x7196('0x5c')][_0x7196('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x7196('0xa2')],'as':_0x7196('0xb7')}]})[_0x7196('0x37')](function(_0x1fd2ac){return[_0x1fd2ac,!![]];});});}else{throw new Error(_0x7196('0xb8'));}})[_0x7196('0xb9')](function(_0x493b4a,_0x543fe1){if(_0x543fe1){return _0x493b4a;}return db[_0x7196('0xa2')][_0x7196('0x5b')]({'direction':'out','read':![],'body':_0xc9251[_0x7196('0x5c')][_0x7196('0xab')][0x0][_0x7196('0xb6')],'FaxAccountId':_0x4da714['id'],'FaxInteractionId':_0x493b4a['id'],'UserId':_0xc9251[_0x7196('0x5d')]['id'],'ContactId':_0x493b4a[_0x7196('0xba')],'AttachmentId':_0xc9251[_0x7196('0x5c')][_0x7196('0xab')][0x0]['id']})[_0x7196('0x37')](function(_0x3a9a36){_0x493b4a[_0x7196('0xbb')]['Messages']=[];_0x493b4a[_0x7196('0xbb')]['Messages'][_0x7196('0x8e')](_0x3a9a36['dataValues']);return _0x493b4a;});})[_0x7196('0x37')](function(_0x8d054e){respondWithRpcPromise(_0x7196('0xbc'),_0x7196('0xbc'),{'FaxAccountId':_['isNil'](_0xc9251[_0x7196('0x54')]['id'])?undefined:_0xc9251[_0x7196('0x54')]['id'],'path':_[_0x7196('0xb0')](_0xc9251['body']['attachments'][0x0][_0x7196('0x9')])?undefined:_0xc9251['body'][_0x7196('0xab')][0x0]['path'],'fax':_['isNil'](_0xc9251[_0x7196('0x5c')]['to'][0x0])?undefined:_0xc9251[_0x7196('0x5c')]['to'][0x0],'AttachmentId':_0xc9251[_0x7196('0x5c')][_0x7196('0xab')][0x0]['id']},client9002)[_0x7196('0x37')](function(_0x266b55){logger[_0x7196('0x2d')](_0x7196('0xbd'),_0x266b55);})['catch'](function(_0x2cfd7f){logger[_0x7196('0x2d')](_0x7196('0xbd'),_0x2cfd7f);});return _0x8d054e;})[_0x7196('0x37')](respondWithResult(_0x3f98bc,null))[_0x7196('0x2e')](handleError(_0x3f98bc,null));};exports['addAgents']=function(_0x516233,_0x1a1a58,_0x18fc9c){return db[_0x7196('0x40')]['find']({'where':{'id':_0x516233['params']['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x1a1a58,null))[_0x7196('0x37')](function(_0xa5ba1){if(_0xa5ba1){return _0xa5ba1[_0x7196('0xbe')](_0x516233[_0x7196('0x5c')][_0x7196('0x6e')],_['omit'](_0x516233['body'],[_0x7196('0x6e'),'id'])||{})[_0x7196('0xb9')](function(_0x339baf){for(var _0x4dcd0c=0x0;_0x4dcd0c<_0x516233[_0x7196('0x5c')][_0x7196('0x6e')][_0x7196('0x4a')];_0x4dcd0c+=0x1){socket['emit'](_0x7196('0xbf'),{'UserId':_0x516233[_0x7196('0x5c')][_0x7196('0x6e')][_0x4dcd0c],'FaxAccountId':_0x516233['params']['id']});}return _0x339baf;});}})[_0x7196('0x37')](respondWithResult(_0x1a1a58,null))[_0x7196('0x2e')](handleError(_0x1a1a58,null));};exports['removeAgents']=function(_0x3e5887,_0x3f724f,_0x1a271f){return db[_0x7196('0x40')]['find']({'where':{'id':_0x3e5887['params']['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x3f724f,null))['then'](function(_0x479aa4){if(_0x479aa4){return _0x479aa4[_0x7196('0xc0')](_0x3e5887['query'][_0x7196('0x6e')])[_0x7196('0x37')](function(){if(_[_0x7196('0xc1')](_0x3e5887[_0x7196('0x45')][_0x7196('0x6e')])){for(var _0x1b3d7e=0x0;_0x1b3d7e<_0x3e5887[_0x7196('0x45')][_0x7196('0x6e')][_0x7196('0x4a')];_0x1b3d7e+=0x1){socket[_0x7196('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x3e5887[_0x7196('0x45')]['ids'][_0x1b3d7e]),'FaxAccountId':Number(_0x3e5887[_0x7196('0x54')]['id'])});}}else{socket[_0x7196('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x3e5887[_0x7196('0x45')][_0x7196('0x6e')]),'FaxAccountId':Number(_0x3e5887[_0x7196('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3f724f,null))[_0x7196('0x2e')](handleError(_0x3f724f,null));};exports[_0x7196('0xc3')]=function(_0x302608,_0x1ff320,_0x317e2f){var _0x3f96d7={};var _0x258def={};var _0x4b025f;var _0x5765f1;return db[_0x7196('0x40')][_0x7196('0x69')]({'where':{'id':_0x302608[_0x7196('0x54')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x1ff320,null))[_0x7196('0x37')](function(_0x57cfe8){if(_0x57cfe8){_0x4b025f=_0x57cfe8;_0x258def[_0x7196('0x44')]=_['keys'](db['User']['rawAttributes']);_0x258def[_0x7196('0x45')]=_['keys'](_0x302608[_0x7196('0x45')]);_0x258def[_0x7196('0x46')]=_[_0x7196('0x47')](_0x258def[_0x7196('0x44')],_0x258def['query']);_0x3f96d7['attributes']=_['intersection'](_0x258def[_0x7196('0x44')],qs[_0x7196('0x48')](_0x302608[_0x7196('0x45')][_0x7196('0x48')]));_0x3f96d7[_0x7196('0x49')]=_0x3f96d7[_0x7196('0x49')][_0x7196('0x4a')]?_0x3f96d7[_0x7196('0x49')]:_0x258def[_0x7196('0x44')];_0x3f96d7[_0x7196('0x4b')]=qs[_0x7196('0x72')](_0x302608[_0x7196('0x45')][_0x7196('0x72')]);_0x3f96d7[_0x7196('0x4c')]=qs[_0x7196('0x46')](_[_0x7196('0x4d')](_0x302608[_0x7196('0x45')],_0x258def[_0x7196('0x46')]));if(_0x302608['query'][_0x7196('0x4e')]){_0x3f96d7['where']=_[_0x7196('0x4f')](_0x3f96d7[_0x7196('0x4c')],{'$or':_['map'](_0x3f96d7[_0x7196('0x49')],function(_0x509aca){var _0x52973c={};_0x52973c[_0x509aca]={'$like':'%'+_0x302608[_0x7196('0x45')][_0x7196('0x4e')]+'%'};return _0x52973c;})});}_0x3f96d7=_[_0x7196('0x4f')]({},_0x3f96d7,_0x302608[_0x7196('0x59')]);return _0x4b025f[_0x7196('0xc3')](_0x3f96d7);}})['then'](function(_0x2fd673){if(_0x2fd673){_0x5765f1=_0x2fd673['length'];if(!_0x302608['query'][_0x7196('0x6b')](_0x7196('0x71'))){_0x3f96d7[_0x7196('0x33')]=qs['limit'](_0x302608[_0x7196('0x45')][_0x7196('0x33')]);_0x3f96d7[_0x7196('0x32')]=qs[_0x7196('0x32')](_0x302608[_0x7196('0x45')][_0x7196('0x32')]);}return _0x4b025f[_0x7196('0xc3')](_0x3f96d7);}})[_0x7196('0x37')](function(_0x5cea01){if(_0x5cea01){return _0x5cea01?{'count':_0x5765f1,'rows':_0x5cea01}:null;}})[_0x7196('0x37')](respondWithResult(_0x1ff320,null))['catch'](handleError(_0x1ff320,null));}; \ No newline at end of file +var _0x57ca=['Owner','internal','Tag','Tags','tag','sequelize','transaction','FaxApplication','bulkCreate','context','exten','localstationid','app','system','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','send','CmList','List','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','User','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','test','ValidationError','request','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','save','update','destroy','then','get','FaxAccounts','end','name','Pause','map','fieldName','key','model','query','keys','filters','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','FaxAccount','count','includeAll','findAll','rows','mandatoryDispositionPause','intersection','include','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','findOne','rawAttributes','removeDispositions','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','ids','FaxAccountId','CmContact','Contact'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x57ca,0x108));var _0xa57c=function(_0x3e3f61,_0x4afacf){_0x3e3f61=_0x3e3f61-0x0;var _0x2e7056=_0x57ca[_0x3e3f61];return _0x2e7056;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa57c('0x0'));var rimraf=require(_0xa57c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57c('0x2'));var rp=require(_0xa57c('0x3'));var moment=require(_0xa57c('0x4'));var BPromise=require(_0xa57c('0x5'));var Mustache=require(_0xa57c('0x6'));var util=require('util');var path=require(_0xa57c('0x7'));var sox=require(_0xa57c('0x8'));var csv=require(_0xa57c('0x9'));var ejs=require(_0xa57c('0xa'));var fs=require('fs');var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x9'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var db=require(_0xa57c('0x15'))['db'];config[_0xa57c('0x16')]=_[_0xa57c('0x17')](config[_0xa57c('0x16')],{'host':_0xa57c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa57c('0x16')]));require('./faxAccount.socket')[_0xa57c('0x19')](socket);var jayson=require(_0xa57c('0x1a'));var client=jayson[_0xa57c('0x1b')][_0xa57c('0x1c')]({'port':0x232c});var client9002=jayson[_0xa57c('0x1b')][_0xa57c('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3f900a,_0x4b4bdb,_0x26607a){if(_0x26607a){var _0xdf7ff6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xdf7ff6[_0xa57c('0x1d')](_0x4b4bdb)){return _0x3f900a;}else{throw new db['Sequelize'][(_0xa57c('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3f900a;}}function respondWithRpcPromise(_0x3e7afa,_0x3d781d,_0x93462c,_0xe3d505){return new BPromise(function(_0x1fd0d8,_0x4728f9){var _0x6f3f89=_0xe3d505||client;return _0x6f3f89[_0xa57c('0x1f')](_0x3e7afa,_0x93462c)['then'](function(_0x8a8856){logger['info']('FaxAccount,\x20%s,\x20%s',_0x3d781d,_0xa57c('0x20'));logger[_0xa57c('0x21')](_0xa57c('0x22'),_0x3d781d,_0xa57c('0x20'),JSON['stringify'](_0x8a8856));if(_0x8a8856[_0xa57c('0x23')]){if(_0x8a8856[_0xa57c('0x23')][_0xa57c('0x24')]===0x1f4){logger[_0xa57c('0x23')](_0xa57c('0x25'),_0x3d781d,_0x8a8856[_0xa57c('0x23')][_0xa57c('0x26')]);return _0x4728f9(_0x8a8856[_0xa57c('0x23')][_0xa57c('0x26')]);}logger[_0xa57c('0x23')](_0xa57c('0x25'),_0x3d781d,_0x8a8856[_0xa57c('0x23')][_0xa57c('0x26')]);return _0x1fd0d8(_0x8a8856[_0xa57c('0x23')][_0xa57c('0x26')]);}else{logger['info'](_0xa57c('0x25'),_0x3d781d,_0xa57c('0x20'));_0x1fd0d8(_0x8a8856[_0xa57c('0x27')][_0xa57c('0x26')]);}})[_0xa57c('0x28')](function(_0x1e8e45){logger[_0xa57c('0x23')](_0xa57c('0x25'),_0x3d781d,_0x1e8e45);_0x4728f9(_0x1e8e45);});});}function respondWithStatusCode(_0x337f97,_0x1d59c2){_0x1d59c2=_0x1d59c2||0xcc;return function(_0x57ebe0){if(_0x57ebe0){return _0x337f97[_0xa57c('0x29')](_0x1d59c2);}return _0x337f97['status'](_0x1d59c2)['end']();};}function respondWithResult(_0x257661,_0x7d10ec){_0x7d10ec=_0x7d10ec||0xc8;return function(_0x5a3e03){if(_0x5a3e03){return _0x257661[_0xa57c('0x2a')](_0x7d10ec)[_0xa57c('0x2b')](_0x5a3e03);}};}function respondWithFilteredResult(_0x3eb9e9,_0x57565b){return function(_0xd779f1){if(_0xd779f1){var _0x58d46f=_0xd779f1['count'],_0xf5f70c=_0x57565b[_0xa57c('0x2c')],_0x5464f2=_0x57565b['offset']+_0x57565b[_0xa57c('0x2d')],_0x2a3bbe;if(_0x5464f2>=_0x58d46f){_0x5464f2=_0x58d46f;_0x2a3bbe=0xc8;}else{_0x2a3bbe=0xce;}_0x3eb9e9[_0xa57c('0x2a')](_0x2a3bbe);return _0x3eb9e9[_0xa57c('0x2e')](_0xa57c('0x2f'),_0xf5f70c+'-'+_0x5464f2+'/'+_0x58d46f)[_0xa57c('0x2b')](_0xd779f1);}return null;};}function patchUpdates(_0x4016dd){return function(_0x4f45c7){try{jsonpatch['apply'](_0x4f45c7,_0x4016dd,!![]);}catch(_0x10cc39){return BPromise['reject'](_0x10cc39);}return _0x4f45c7[_0xa57c('0x30')]();};}function saveUpdates(_0x315787,_0x27ada0){return function(_0x587ce1){if(_0x587ce1){return _0x587ce1[_0xa57c('0x31')](_0x315787)['then'](function(_0x24a087){return _0x24a087;});}return null;};}function removeEntity(_0x501a4c,_0x2e33f5){return function(_0x494b8a){if(_0x494b8a){return _0x494b8a[_0xa57c('0x32')]()[_0xa57c('0x33')](function(){var _0x4903ae=_0x494b8a[_0xa57c('0x34')]({'plain':!![]});var _0x47b65c=_0xa57c('0x35');return db['UserProfileResource'][_0xa57c('0x32')]({'where':{'type':_0x47b65c,'resourceId':_0x4903ae['id']}})[_0xa57c('0x33')](function(){return _0x494b8a;});})[_0xa57c('0x33')](function(){_0x501a4c[_0xa57c('0x2a')](0xcc)[_0xa57c('0x36')]();});}};}function handleEntityNotFound(_0x44350f,_0x59b8af){return function(_0x53eead){if(!_0x53eead){_0x44350f[_0xa57c('0x29')](0x194);}return _0x53eead;};}function handleError(_0x13e390,_0x2c70d6){_0x2c70d6=_0x2c70d6||0x1f4;return function(_0x570f6c){logger[_0xa57c('0x23')](_0x570f6c['stack']);if(_0x570f6c[_0xa57c('0x37')]){delete _0x570f6c[_0xa57c('0x37')];}_0x13e390['status'](_0x2c70d6)['send'](_0x570f6c);};}exports['index']=function(_0x3be888,_0x5d410b){var _0x269a19={'include':[{'model':db[_0xa57c('0x38')],'as':'mandatoryDispositionPause'}]},_0x21e4df={},_0x10c7ab={'count':0x0,'rows':[]};var _0x44b2a8=_[_0xa57c('0x39')](db['FaxAccount']['rawAttributes'],function(_0x5e10b){return{'name':_0x5e10b[_0xa57c('0x3a')],'type':_0x5e10b['type'][_0xa57c('0x3b')]};});_0x21e4df[_0xa57c('0x3c')]=_[_0xa57c('0x39')](_0x44b2a8,_0xa57c('0x37'));_0x21e4df[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x3be888['query']);_0x21e4df[_0xa57c('0x3f')]=_['intersection'](_0x21e4df['model'],_0x21e4df['query']);_0x269a19['attributes']=_['intersection'](_0x21e4df[_0xa57c('0x3c')],qs[_0xa57c('0x40')](_0x3be888[_0xa57c('0x3d')]['fields']));_0x269a19['attributes']=_0x269a19['attributes'][_0xa57c('0x41')]?_0x269a19[_0xa57c('0x42')]:_0x21e4df[_0xa57c('0x3c')];if(!_0x3be888[_0xa57c('0x3d')][_0xa57c('0x43')](_0xa57c('0x44'))){_0x269a19['limit']=qs[_0xa57c('0x2d')](_0x3be888[_0xa57c('0x3d')][_0xa57c('0x2d')]);_0x269a19[_0xa57c('0x2c')]=qs[_0xa57c('0x2c')](_0x3be888[_0xa57c('0x3d')]['offset']);}_0x269a19[_0xa57c('0x45')]=qs[_0xa57c('0x46')](_0x3be888[_0xa57c('0x3d')][_0xa57c('0x46')]);_0x269a19[_0xa57c('0x47')]=qs['filters'](_[_0xa57c('0x48')](_0x3be888[_0xa57c('0x3d')],_0x21e4df[_0xa57c('0x3f')]));if(_0x3be888[_0xa57c('0x3d')][_0xa57c('0x49')]){_0x269a19[_0xa57c('0x47')]=_['merge'](_0x269a19[_0xa57c('0x47')],{'$or':_[_0xa57c('0x39')](_0x44b2a8,function(_0x247906){if(_0x247906[_0xa57c('0x4a')]!==_0xa57c('0x4b')){var _0x4705e1={};_0x4705e1[_0x247906['name']]={'$like':'%'+_0x3be888['query']['filter']+'%'};return _0x4705e1;}})});}_0x269a19=_['merge']({},_0x269a19,_0x3be888[_0xa57c('0x4c')]);var _0x49492f={'where':_0x269a19[_0xa57c('0x47')]};return db[_0xa57c('0x4d')]['count'](_0x49492f)[_0xa57c('0x33')](function(_0x320a5c){_0x10c7ab[_0xa57c('0x4e')]=_0x320a5c;if(_0x3be888[_0xa57c('0x3d')][_0xa57c('0x4f')]){_0x269a19['include']=[{'all':!![]}];}return db[_0xa57c('0x4d')][_0xa57c('0x50')](_0x269a19);})[_0xa57c('0x33')](function(_0xd57bac){_0x10c7ab[_0xa57c('0x51')]=_0xd57bac;return _0x10c7ab;})['then'](respondWithFilteredResult(_0x5d410b,_0x269a19))[_0xa57c('0x28')](handleError(_0x5d410b,null));};exports['show']=function(_0x5be160,_0x464233){var _0x2c706f={'raw':![],'where':{'id':_0x5be160['params']['id']},'include':[{'model':db['Pause'],'as':_0xa57c('0x52')}]},_0x5ded49={};_0x5ded49[_0xa57c('0x3c')]=_[_0xa57c('0x3e')](db[_0xa57c('0x4d')]['rawAttributes']);_0x5ded49[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x5be160[_0xa57c('0x3d')]);_0x5ded49['filters']=_['intersection'](_0x5ded49[_0xa57c('0x3c')],_0x5ded49[_0xa57c('0x3d')]);_0x2c706f['attributes']=_[_0xa57c('0x53')](_0x5ded49[_0xa57c('0x3c')],qs[_0xa57c('0x40')](_0x5be160[_0xa57c('0x3d')][_0xa57c('0x40')]));_0x2c706f[_0xa57c('0x42')]=_0x2c706f[_0xa57c('0x42')]['length']?_0x2c706f['attributes']:_0x5ded49[_0xa57c('0x3c')];if(_0x5be160[_0xa57c('0x3d')][_0xa57c('0x4f')]){_0x2c706f[_0xa57c('0x54')]=[{'all':!![]}];}_0x2c706f=_[_0xa57c('0x55')]({},_0x2c706f,_0x5be160[_0xa57c('0x4c')]);return db[_0xa57c('0x4d')][_0xa57c('0x56')](_0x2c706f)['then'](handleEntityNotFound(_0x464233,null))['then'](respondWithResult(_0x464233,null))[_0xa57c('0x28')](handleError(_0x464233,null));};exports['create']=function(_0x1880e6,_0x1da3ef){return db[_0xa57c('0x4d')]['create'](_0x1880e6[_0xa57c('0x57')],{})['then'](function(_0x21b00a){var _0x4b3416=_0x1880e6[_0xa57c('0x58')][_0xa57c('0x34')]({'plain':!![]});if(!_0x4b3416)throw new Error(_0xa57c('0x59'));if(_0x4b3416[_0xa57c('0x5a')]==='user'){var _0x3abb69=_0x21b00a[_0xa57c('0x34')]({'plain':!![]});var _0x3bd25a=_0xa57c('0x35');return db[_0xa57c('0x5b')]['find']({'where':{'name':_0x3bd25a,'userProfileId':_0x4b3416[_0xa57c('0x5c')]},'raw':!![]})[_0xa57c('0x33')](function(_0x1899ad){if(_0x1899ad&&_0x1899ad[_0xa57c('0x5d')]===0x0){return db[_0xa57c('0x5e')][_0xa57c('0x5f')]({'name':_0x3abb69[_0xa57c('0x37')],'resourceId':_0x3abb69['id'],'type':_0x1899ad[_0xa57c('0x37')],'sectionId':_0x1899ad['id']},{})[_0xa57c('0x33')](function(){return _0x21b00a;});}else{return _0x21b00a;}})[_0xa57c('0x28')](function(_0x5a046e){logger[_0xa57c('0x23')](_0xa57c('0x60'),_0x5a046e);throw _0x5a046e;});}return _0x21b00a;})[_0xa57c('0x33')](respondWithResult(_0x1da3ef,0xc9))[_0xa57c('0x28')](handleError(_0x1da3ef,null));};exports[_0xa57c('0x31')]=function(_0x3b286d,_0x5440c2){if(_0x3b286d[_0xa57c('0x57')]['id']){delete _0x3b286d[_0xa57c('0x57')]['id'];}return db['FaxAccount'][_0xa57c('0x56')]({'where':{'id':_0x3b286d[_0xa57c('0x61')]['id']},'include':[{'model':db[_0xa57c('0x38')],'as':_0xa57c('0x52')}]})[_0xa57c('0x33')](handleEntityNotFound(_0x5440c2,null))[_0xa57c('0x33')](saveUpdates(_0x3b286d[_0xa57c('0x57')],null))['then'](respondWithResult(_0x5440c2,null))[_0xa57c('0x28')](handleError(_0x5440c2,null));};exports['destroy']=function(_0x13a5de,_0x56ac7e){return db[_0xa57c('0x4d')]['find']({'where':{'id':_0x13a5de[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x56ac7e,null))['then'](removeEntity(_0x56ac7e,null))[_0xa57c('0x28')](handleError(_0x56ac7e,null));};exports[_0xa57c('0x62')]=function(_0x2dbd17,_0x144a5d){return db['FaxAccount'][_0xa57c('0x62')]()[_0xa57c('0x33')](respondWithResult(_0x144a5d,null))[_0xa57c('0x28')](handleError(_0x144a5d,null));};exports[_0xa57c('0x63')]=function(_0x3fdaac,_0x3d766a,_0x308ce5){if(_0x3fdaac[_0xa57c('0x57')]['id']){delete _0x3fdaac[_0xa57c('0x57')]['id'];}return db[_0xa57c('0x4d')][_0xa57c('0x56')]({'where':{'id':_0x3fdaac[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x3d766a,null))[_0xa57c('0x33')](function(_0x23552a){if(_0x23552a){_0x3fdaac[_0xa57c('0x57')]['FaxAccountId']=_0x23552a['id'];return db[_0xa57c('0x64')]['create'](_0x3fdaac[_0xa57c('0x57')]);}})[_0xa57c('0x33')](respondWithResult(_0x3d766a,null))[_0xa57c('0x28')](handleError(_0x3d766a,null));};exports['getDispositions']=function(_0x4176b3,_0x2ccc4d,_0x1be631){var _0x47e3d5={'raw':![],'where':{}};var _0x571e10={};var _0x20ff5f={'count':0x0,'rows':[]};return db[_0xa57c('0x4d')][_0xa57c('0x65')]({'where':{'id':_0x4176b3[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x2ccc4d,null))[_0xa57c('0x33')](function(_0x2a7aab){if(_0x2a7aab){_0x571e10[_0xa57c('0x3c')]=_[_0xa57c('0x3e')](db['Disposition'][_0xa57c('0x66')]);_0x571e10[_0xa57c('0x3d')]=_['keys'](_0x4176b3[_0xa57c('0x3d')]);_0x571e10[_0xa57c('0x3f')]=_[_0xa57c('0x53')](_0x571e10[_0xa57c('0x3c')],_0x571e10[_0xa57c('0x3d')]);_0x47e3d5[_0xa57c('0x42')]=_[_0xa57c('0x53')](_0x571e10[_0xa57c('0x3c')],qs['fields'](_0x4176b3[_0xa57c('0x3d')][_0xa57c('0x40')]));_0x47e3d5['attributes']=_0x47e3d5[_0xa57c('0x42')][_0xa57c('0x41')]?_0x47e3d5['attributes']:_0x571e10['model'];if(!_0x4176b3[_0xa57c('0x3d')][_0xa57c('0x43')](_0xa57c('0x44'))){_0x47e3d5[_0xa57c('0x2d')]=qs[_0xa57c('0x2d')](_0x4176b3['query'][_0xa57c('0x2d')]);_0x47e3d5[_0xa57c('0x2c')]=qs[_0xa57c('0x2c')](_0x4176b3['query'][_0xa57c('0x2c')]);}_0x47e3d5['order']=qs[_0xa57c('0x46')](_0x4176b3[_0xa57c('0x3d')][_0xa57c('0x46')]);_0x47e3d5[_0xa57c('0x47')]=qs['filters'](_[_0xa57c('0x48')](_0x4176b3[_0xa57c('0x3d')],_0x571e10[_0xa57c('0x3f')]));_0x47e3d5[_0xa57c('0x47')]['FaxAccountId']=_0x2a7aab['id'];if(_0x4176b3[_0xa57c('0x3d')][_0xa57c('0x49')]){_0x47e3d5[_0xa57c('0x47')]=_['merge'](_0x47e3d5[_0xa57c('0x47')],{'$or':_[_0xa57c('0x39')](_0x47e3d5[_0xa57c('0x42')],function(_0x5f267d){var _0x3ea950={};_0x3ea950[_0x5f267d]={'$like':'%'+_0x4176b3[_0xa57c('0x3d')][_0xa57c('0x49')]+'%'};return _0x3ea950;})});}_0x47e3d5=_[_0xa57c('0x55')]({},_0x47e3d5,_0x4176b3['options']);return db[_0xa57c('0x64')][_0xa57c('0x4e')]({'where':_0x47e3d5['where']})[_0xa57c('0x33')](function(_0x1157ea){_0x20ff5f['count']=_0x1157ea;if(_0x4176b3[_0xa57c('0x3d')]['includeAll']){_0x47e3d5[_0xa57c('0x54')]=[{'all':!![]}];}return db[_0xa57c('0x64')][_0xa57c('0x50')](_0x47e3d5);})[_0xa57c('0x33')](function(_0x599408){_0x20ff5f[_0xa57c('0x51')]=_0x599408;return _0x20ff5f;});}})[_0xa57c('0x33')](respondWithFilteredResult(_0x2ccc4d,_0x47e3d5))[_0xa57c('0x28')](handleError(_0x2ccc4d,null));};exports[_0xa57c('0x67')]=function(_0xef15c7,_0x18e6ac,_0x18b36e){return db[_0xa57c('0x4d')][_0xa57c('0x56')]({'where':{'id':_0xef15c7[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x18e6ac,null))['then'](function(_0x488c35){if(_0x488c35){return _0x488c35['removeDispositions'](_0xef15c7[_0xa57c('0x3d')]['ids']);}})[_0xa57c('0x33')](respondWithStatusCode(_0x18e6ac,null))[_0xa57c('0x28')](handleError(_0x18e6ac,null));};exports[_0xa57c('0x68')]=function(_0x4c543a,_0x21c428,_0x3e7946){if(_0x4c543a[_0xa57c('0x57')]['id']){delete _0x4c543a[_0xa57c('0x57')]['id'];}return db[_0xa57c('0x4d')][_0xa57c('0x56')]({'where':{'id':_0x4c543a[_0xa57c('0x61')]['id']}})['then'](handleEntityNotFound(_0x21c428,null))[_0xa57c('0x33')](function(_0x257c98){if(_0x257c98){_0x4c543a['body']['FaxAccountId']=_0x257c98['id'];return db[_0xa57c('0x69')][_0xa57c('0x5f')](_0x4c543a['body']);}})['then'](respondWithResult(_0x21c428,null))[_0xa57c('0x28')](handleError(_0x21c428,null));};exports['getAnswers']=function(_0x3726ee,_0x12f5dd,_0x4962c9){var _0x1cda66={'raw':![],'where':{}};var _0x1706f1={};var _0x44558f={'count':0x0,'rows':[]};return db[_0xa57c('0x4d')][_0xa57c('0x65')]({'where':{'id':_0x3726ee['params']['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x12f5dd,null))['then'](function(_0x30838d){if(_0x30838d){_0x1706f1[_0xa57c('0x3c')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1706f1[_0xa57c('0x3d')]=_['keys'](_0x3726ee['query']);_0x1706f1[_0xa57c('0x3f')]=_[_0xa57c('0x53')](_0x1706f1[_0xa57c('0x3c')],_0x1706f1['query']);_0x1cda66[_0xa57c('0x42')]=_[_0xa57c('0x53')](_0x1706f1[_0xa57c('0x3c')],qs['fields'](_0x3726ee['query'][_0xa57c('0x40')]));_0x1cda66['attributes']=_0x1cda66[_0xa57c('0x42')][_0xa57c('0x41')]?_0x1cda66['attributes']:_0x1706f1[_0xa57c('0x3c')];if(!_0x3726ee['query']['hasOwnProperty']('nolimit')){_0x1cda66[_0xa57c('0x2d')]=qs['limit'](_0x3726ee['query']['limit']);_0x1cda66[_0xa57c('0x2c')]=qs[_0xa57c('0x2c')](_0x3726ee['query'][_0xa57c('0x2c')]);}_0x1cda66[_0xa57c('0x45')]=qs[_0xa57c('0x46')](_0x3726ee['query'][_0xa57c('0x46')]);_0x1cda66[_0xa57c('0x47')]=qs[_0xa57c('0x3f')](_[_0xa57c('0x48')](_0x3726ee['query'],_0x1706f1['filters']));_0x1cda66[_0xa57c('0x47')]['FaxAccountId']=_0x30838d['id'];if(_0x3726ee[_0xa57c('0x3d')][_0xa57c('0x49')]){_0x1cda66[_0xa57c('0x47')]=_['merge'](_0x1cda66[_0xa57c('0x47')],{'$or':_['map'](_0x1cda66['attributes'],function(_0x193e63){var _0x58b935={};_0x58b935[_0x193e63]={'$like':'%'+_0x3726ee[_0xa57c('0x3d')][_0xa57c('0x49')]+'%'};return _0x58b935;})});}_0x1cda66=_['merge']({},_0x1cda66,_0x3726ee['options']);return db[_0xa57c('0x69')][_0xa57c('0x4e')]({'where':_0x1cda66['where']})['then'](function(_0x2550bc){_0x44558f[_0xa57c('0x4e')]=_0x2550bc;if(_0x3726ee[_0xa57c('0x3d')]['includeAll']){_0x1cda66[_0xa57c('0x54')]=[{'all':!![]}];}return db[_0xa57c('0x69')][_0xa57c('0x50')](_0x1cda66);})[_0xa57c('0x33')](function(_0x3aada4){_0x44558f[_0xa57c('0x51')]=_0x3aada4;return _0x44558f;});}})[_0xa57c('0x33')](respondWithFilteredResult(_0x12f5dd,_0x1cda66))[_0xa57c('0x28')](handleError(_0x12f5dd,null));};exports[_0xa57c('0x6a')]=function(_0x75888e,_0x46b223,_0x2fa5fe){return db[_0xa57c('0x4d')]['find']({'where':{'id':_0x75888e[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x46b223,null))[_0xa57c('0x33')](function(_0x107ebd){if(_0x107ebd){return _0x107ebd[_0xa57c('0x6a')](_0x75888e[_0xa57c('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x46b223,null))[_0xa57c('0x28')](handleError(_0x46b223,null));};exports['addInteraction']=function(_0x5e6ac5,_0x68c843,_0x138edd){return db[_0xa57c('0x6b')]['find']({'where':{'id':_0x5e6ac5[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x68c843,null))[_0xa57c('0x33')](function(_0x2c0db4){if(_0x2c0db4){return _0x2c0db4[_0xa57c('0x6c')](_0x5e6ac5['body']['ids'],_[_0xa57c('0x6d')](_0x5e6ac5[_0xa57c('0x57')],[_0xa57c('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x68c843,null))[_0xa57c('0x28')](handleError(_0x68c843,null));};exports['getInteractions']=function(_0x10add5,_0x24e6d3,_0x244e4b){var _0x28134b={'raw':![],'where':{}};var _0x1dc04c={};var _0x80dfcb={'count':0x0,'rows':[]};return db[_0xa57c('0x4d')]['findOne']({'where':{'id':_0x10add5['params']['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x24e6d3,null))[_0xa57c('0x33')](function(_0xe5e57f){if(_0xe5e57f){_0x1dc04c['model']=_['keys'](db[_0xa57c('0x6b')][_0xa57c('0x66')]);_0x1dc04c[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x10add5[_0xa57c('0x3d')]);_0x1dc04c['filters']=_[_0xa57c('0x53')](_0x1dc04c[_0xa57c('0x3c')],_0x1dc04c[_0xa57c('0x3d')]);_0x28134b['attributes']=_[_0xa57c('0x53')](_0x1dc04c[_0xa57c('0x3c')],qs['fields'](_0x10add5[_0xa57c('0x3d')][_0xa57c('0x40')]));_0x28134b[_0xa57c('0x42')]=_0x28134b[_0xa57c('0x42')][_0xa57c('0x41')]?_0x28134b[_0xa57c('0x42')]:_0x1dc04c[_0xa57c('0x3c')];if(!_0x10add5[_0xa57c('0x3d')][_0xa57c('0x43')]('nolimit')){_0x28134b[_0xa57c('0x2d')]=qs[_0xa57c('0x2d')](_0x10add5[_0xa57c('0x3d')][_0xa57c('0x2d')]);_0x28134b['offset']=qs['offset'](_0x10add5[_0xa57c('0x3d')]['offset']);}_0x28134b[_0xa57c('0x45')]=qs['sort'](_0x10add5[_0xa57c('0x3d')]['sort']);_0x28134b['where']=qs[_0xa57c('0x3f')](_['pick'](_0x10add5[_0xa57c('0x3d')],_0x1dc04c['filters']));_0x28134b[_0xa57c('0x47')][_0xa57c('0x6f')]=_0xe5e57f['id'];if(_0x10add5[_0xa57c('0x3d')][_0xa57c('0x49')]){_0x28134b['where']=_['merge'](_0x28134b[_0xa57c('0x47')],{'$or':_[_0xa57c('0x39')](_0x28134b['attributes'],function(_0x2b7e02){var _0xeb14ed={};_0xeb14ed[_0x2b7e02]={'$like':'%'+_0x10add5[_0xa57c('0x3d')][_0xa57c('0x49')]+'%'};return _0xeb14ed;})});}_0x28134b=_[_0xa57c('0x55')]({},_0x28134b,_0x10add5[_0xa57c('0x4c')]);return db[_0xa57c('0x6b')][_0xa57c('0x4e')]({'where':_0x28134b[_0xa57c('0x47')]})[_0xa57c('0x33')](function(_0x57eb30){_0x80dfcb['count']=_0x57eb30;if(_0x10add5[_0xa57c('0x3d')]['includeAll']){_0x28134b[_0xa57c('0x54')]=[{'model':db[_0xa57c('0x70')],'as':_0xa57c('0x71'),'required':![]},{'model':db['User'],'as':_0xa57c('0x72'),'attributes':['name','fullname',_0xa57c('0x73')],'required':![]},{'model':db[_0xa57c('0x74')],'as':_0xa57c('0x75'),'attributes':['id',_0xa57c('0x37'),'color'],'where':_0x10add5[_0xa57c('0x3d')]['tag']?{'id':_0x10add5['query']['tag']}:undefined,'required':_0x10add5[_0xa57c('0x3d')][_0xa57c('0x76')]?!![]:![]}];}return db[_0xa57c('0x6b')][_0xa57c('0x50')](_0x28134b);})['then'](function(_0x192252){_0x80dfcb['rows']=_0x192252;return _0x80dfcb;});}})[_0xa57c('0x33')](respondWithFilteredResult(_0x24e6d3,_0x28134b))[_0xa57c('0x28')](handleError(_0x24e6d3,null));};exports['addApplications']=function(_0x2ca1af,_0x287b5c,_0x216300){return db[_0xa57c('0x4d')][_0xa57c('0x65')]({'where':{'id':_0x2ca1af['params']['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x287b5c,null))['then'](function(_0x185ee5){if(_0x185ee5){return db[_0xa57c('0x77')][_0xa57c('0x78')](function(_0x1dad7d){return db[_0xa57c('0x79')][_0xa57c('0x32')]({'where':{'FaxAccountId':_0x2ca1af[_0xa57c('0x61')]['id']},'transaction':_0x1dad7d})[_0xa57c('0x33')](function(_0x1a7a6d){var _0xba0def=_['map'](_0x2ca1af[_0xa57c('0x57')],function(_0x360ce5){_0x360ce5['FaxAccountId']=_0x2ca1af['params']['id'];return _0x360ce5;});return db['FaxApplication'][_0xa57c('0x7a')](_0xba0def,{'transaction':_0x1dad7d});});})[_0xa57c('0x33')](function(){return db[_0xa57c('0x79')]['findAndCountAll']({'where':{'FaxAccountId':_0x2ca1af[_0xa57c('0x61')]['id']},'order':'priority'});});}})[_0xa57c('0x33')](respondWithResult(_0x287b5c,null))[_0xa57c('0x28')](handleError(_0x287b5c,null));};exports['getApplications']=function(_0xb0f328,_0x22cde4,_0xe91256){var _0x1a5847={};var _0x3e2296={};var _0x2eda02;var _0x502378;return db[_0xa57c('0x4d')][_0xa57c('0x65')]({'where':{'id':_0xb0f328[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x22cde4,null))[_0xa57c('0x33')](function(_0x44a93f){if(_0x44a93f){_0x2eda02=_0x44a93f;_0x3e2296['model']=_[_0xa57c('0x3e')](db[_0xa57c('0x79')][_0xa57c('0x66')]);_0x3e2296['query']=_[_0xa57c('0x3e')](_0xb0f328['query']);_0x3e2296['filters']=_[_0xa57c('0x53')](_0x3e2296[_0xa57c('0x3c')],_0x3e2296[_0xa57c('0x3d')]);_0x1a5847[_0xa57c('0x42')]=_['intersection'](_0x3e2296[_0xa57c('0x3c')],qs['fields'](_0xb0f328[_0xa57c('0x3d')]['fields']));_0x1a5847['attributes']=_0x1a5847[_0xa57c('0x42')][_0xa57c('0x41')]?_0x1a5847[_0xa57c('0x42')]:_0x3e2296[_0xa57c('0x3c')];_0x1a5847['order']=qs[_0xa57c('0x46')](_0xb0f328[_0xa57c('0x3d')][_0xa57c('0x46')]);_0x1a5847[_0xa57c('0x47')]=qs['filters'](_[_0xa57c('0x48')](_0xb0f328[_0xa57c('0x3d')],_0x3e2296[_0xa57c('0x3f')]));if(_0xb0f328[_0xa57c('0x3d')][_0xa57c('0x49')]){_0x1a5847[_0xa57c('0x47')]=_['merge'](_0x1a5847['where'],{'$or':_['map'](_0x1a5847[_0xa57c('0x42')],function(_0x9a4df){var _0x137c08={};_0x137c08[_0x9a4df]={'$like':'%'+_0xb0f328['query']['filter']+'%'};return _0x137c08;})});}_0x1a5847=_[_0xa57c('0x55')]({},_0x1a5847,_0xb0f328[_0xa57c('0x4c')]);return _0x2eda02['getApplications'](_0x1a5847);}})[_0xa57c('0x33')](function(_0x336651){if(_0x336651){_0x502378=_0x336651[_0xa57c('0x41')];if(!_0xb0f328['query'][_0xa57c('0x43')](_0xa57c('0x44'))){_0x1a5847[_0xa57c('0x2d')]=qs[_0xa57c('0x2d')](_0xb0f328[_0xa57c('0x3d')]['limit']);_0x1a5847[_0xa57c('0x2c')]=qs[_0xa57c('0x2c')](_0xb0f328['query'][_0xa57c('0x2c')]);}return _0x2eda02['getApplications'](_0x1a5847);}})[_0xa57c('0x33')](function(_0x398a2e){if(_0x398a2e){return _0x398a2e?{'count':_0x502378,'rows':_0x398a2e}:null;}})['then'](respondWithResult(_0x22cde4,null))[_0xa57c('0x28')](handleError(_0x22cde4,null));};function Extension(_0x3a93c0,_0x498f56,_0x4cdc92,_0x3a281a){this[_0xa57c('0x7b')]='from-voip-provider';this[_0xa57c('0x7c')]=_0x3a93c0[_0xa57c('0x7d')];this[_0xa57c('0x7e')]=_0x3a281a;this[_0xa57c('0x4a')]=_0xa57c('0x7f');this[_0xa57c('0x80')]='Fax\x20Extension';this['FaxAccountId']=_0x3a93c0['id'];this[_0xa57c('0x81')]=_0x498f56;this[_0xa57c('0x82')]=_0x4cdc92;}function createExtensionsReciveFax(_0x491ae7){var _0x29fc87=0x1;var _0x285759=[];_0x285759[_0xa57c('0x83')](new Extension(_0x491ae7,_0x29fc87,'',_0xa57c('0x84')));_0x29fc87+=0x1;_0x285759[_0xa57c('0x83')](new Extension(_0x491ae7,_0x29fc87,_0xa57c('0x85'),_0xa57c('0x86')));_0x29fc87+=0x1;for(var _0x556dc0 in _0x491ae7){if(_0x491ae7[_0xa57c('0x43')](_0x556dc0)&&(_0x556dc0==='ecm'||_0x556dc0===_0xa57c('0x7d')||_0x556dc0===_0xa57c('0x87')||_0x556dc0===_0xa57c('0x88')||_0x556dc0===_0xa57c('0x89')||_0x556dc0===_0xa57c('0x8a')||_0x556dc0===_0xa57c('0x8b')||_0x556dc0===_0xa57c('0x8c')||_0x556dc0===_0xa57c('0x8d'))){_0x285759[_0xa57c('0x83')](new Extension(_0x491ae7,_0x29fc87,'FAXOPT('+_0x556dc0+')='+_0x491ae7[_0x556dc0],_0xa57c('0x86')));_0x29fc87+=0x1;}}_0x285759[_0xa57c('0x83')](new Extension(_0x491ae7,_0x29fc87,'6',_0xa57c('0x8e')));_0x29fc87+=0x1;_0x285759[_0xa57c('0x83')](new Extension(_0x491ae7,_0x29fc87,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax'));_0x29fc87=0x0;return _0x285759;}exports[_0xa57c('0x8f')]=function(_0x3caf4b,_0x2512f9,_0xc07c90){var _0x492eae;return db[_0xa57c('0x77')]['transaction'](function(_0xb777c5){return db['FaxAccount'][_0xa57c('0x5f')](_0x3caf4b[_0xa57c('0x57')],{'transaction':_0xb777c5})['then'](function(_0x551f80){_0x492eae=_0x551f80[_0xa57c('0x34')]({'plain':!![]});return db['VoiceExtension'][_0xa57c('0x7a')](createExtensionsReciveFax(_0x492eae),{'transaction':_0xb777c5});});})[_0xa57c('0x33')](function(){return _0x492eae;})[_0xa57c('0x33')](respondWithResult(_0x2512f9,null))[_0xa57c('0x28')](handleError(_0x2512f9,null));};exports['updateAccountApplications']=function(_0xf1d82d,_0x4f04d4,_0x33fb23){var _0x1cb54d;return db[_0xa57c('0x77')][_0xa57c('0x78')](function(_0x131438){return db[_0xa57c('0x4d')][_0xa57c('0x31')](_0xf1d82d[_0xa57c('0x57')],{'where':{'id':_0xf1d82d[_0xa57c('0x57')]['id']},'transaction':_0x131438})[_0xa57c('0x33')](function(_0xf062c8){return db[_0xa57c('0x90')][_0xa57c('0x32')]({'where':{'FaxAccountId':_0xf1d82d['body']['id']},'transaction':_0x131438})[_0xa57c('0x33')](function(_0x46d0ee){return db[_0xa57c('0x90')][_0xa57c('0x7a')](createExtensionsReciveFax(_[_0xa57c('0x6d')](_0xf1d82d[_0xa57c('0x57')],[_0xa57c('0x91'),_0xa57c('0x3b'),_0xa57c('0x92'),_0xa57c('0x93'),_0xa57c('0x94'),_0xa57c('0x95')])),{'transaction':_0x131438});});});})['then'](function(){return db[_0xa57c('0x4d')][_0xa57c('0x96')](_0xf1d82d[_0xa57c('0x57')]['id']);})['then'](respondWithResult(_0x4f04d4,null))['catch'](handleError(_0x4f04d4,null));};exports[_0xa57c('0x97')]=function(_0x966f7b,_0x4bbb83,_0x5b591b){var _0x102276={'raw':!![],'where':{}};var _0x2d56c3={};var _0xc03dd={'count':0x0,'rows':[]};return db[_0xa57c('0x4d')][_0xa57c('0x65')]({'where':{'id':_0x966f7b[_0xa57c('0x61')]['id']}})['then'](handleEntityNotFound(_0x4bbb83,null))['then'](function(_0x5734bb){if(_0x5734bb){_0x2d56c3['model']=_[_0xa57c('0x3e')](db['FaxMessage'][_0xa57c('0x66')]);_0x2d56c3[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x966f7b[_0xa57c('0x3d')]);_0x2d56c3['filters']=_['intersection'](_0x2d56c3[_0xa57c('0x3c')],_0x2d56c3['query']);_0x102276[_0xa57c('0x42')]=_[_0xa57c('0x53')](_0x2d56c3[_0xa57c('0x3c')],qs[_0xa57c('0x40')](_0x966f7b[_0xa57c('0x3d')]['fields']));_0x102276[_0xa57c('0x42')]=_0x102276['attributes'][_0xa57c('0x41')]?_0x102276[_0xa57c('0x42')]:_0x2d56c3[_0xa57c('0x3c')];if(!_0x966f7b[_0xa57c('0x3d')][_0xa57c('0x43')](_0xa57c('0x44'))){_0x102276[_0xa57c('0x2d')]=qs[_0xa57c('0x2d')](_0x966f7b['query'][_0xa57c('0x2d')]);_0x102276[_0xa57c('0x2c')]=qs[_0xa57c('0x2c')](_0x966f7b[_0xa57c('0x3d')][_0xa57c('0x2c')]);}_0x102276[_0xa57c('0x45')]=qs['sort'](_0x966f7b[_0xa57c('0x3d')][_0xa57c('0x46')]);_0x102276['where']=qs[_0xa57c('0x3f')](_[_0xa57c('0x48')](_0x966f7b['query'],_0x2d56c3['filters']));_0x102276[_0xa57c('0x47')][_0xa57c('0x6f')]=_0x5734bb['id'];if(_0x966f7b[_0xa57c('0x3d')][_0xa57c('0x49')]){_0x102276[_0xa57c('0x47')]=_['merge'](_0x102276[_0xa57c('0x47')],{'$or':_[_0xa57c('0x39')](_0x102276[_0xa57c('0x42')],function(_0x5019a2){var _0x5b7bab={};_0x5b7bab[_0x5019a2]={'$like':'%'+_0x966f7b['query'][_0xa57c('0x49')]+'%'};return _0x5b7bab;})});}if(_0x966f7b['query'][_0xa57c('0x98')]){var _0x1cb01a=_0x966f7b[_0xa57c('0x3d')][_0xa57c('0x98')][_0xa57c('0x99')](',');var _0xa40999={};_0xa40999[_0x1cb01a[0x0]]={'$gte':moment(_0x1cb01a[0x1])[_0xa57c('0x9a')](_0xa57c('0x9b'))};_0x102276['where']=_[_0xa57c('0x55')](_0x102276[_0xa57c('0x47')],_0xa40999);}_0x102276=_[_0xa57c('0x55')]({},_0x102276,_0x966f7b[_0xa57c('0x4c')]);return db[_0xa57c('0x9c')][_0xa57c('0x4e')]({'where':_0x102276[_0xa57c('0x47')]})['then'](function(_0x1123c0){_0xc03dd[_0xa57c('0x4e')]=_0x1123c0;if(_0x966f7b[_0xa57c('0x3d')][_0xa57c('0x4f')]){_0x102276['include']=[{'all':!![]}];}return db[_0xa57c('0x9c')]['findAll'](_0x102276);})[_0xa57c('0x33')](function(_0x28ced1){_0xc03dd[_0xa57c('0x51')]=_0x28ced1;return _0xc03dd;});}})[_0xa57c('0x33')](respondWithFilteredResult(_0x4bbb83,_0x102276))['catch'](handleError(_0x4bbb83,null));};exports[_0xa57c('0x9d')]=function(_0x3b3bf9,_0xc0065e,_0x541c50){var _0x2add08,_0x3b0499={},_0x289509;if(_0x3b3bf9[_0xa57c('0x57')]['to']){_0x289509=_0x3b3bf9[_0xa57c('0x57')]['to'][0x0];}return db[_0xa57c('0x4d')][_0xa57c('0x56')]({'where':{'id':_0x3b3bf9[_0xa57c('0x61')]['id']},'include':[{'model':db[_0xa57c('0x9e')],'as':_0xa57c('0x9f'),'include':[{'model':db[_0xa57c('0x70')],'as':'Contacts','where':{'fax':_0x289509},'limit':0x1,'order':[[_0xa57c('0x93'),_0xa57c('0xa0')]]}]}]})[_0xa57c('0x33')](handleEntityNotFound(_0xc0065e,null))[_0xa57c('0x33')](function(_0x339999){_0x2add08=_0x339999;if(_0x3b3bf9[_0xa57c('0x57')][_0xa57c('0xa1')]&&_0x3b3bf9['body']['attachments'][_0xa57c('0x41')]){for(var _0x2aabb4=0x0;_0x2aabb4<_0x3b3bf9[_0xa57c('0x57')][_0xa57c('0xa1')][_0xa57c('0x41')];_0x2aabb4+=0x1){_0x3b3bf9['body'][_0xa57c('0xa1')][_0x2aabb4]={'filename':_0x3b3bf9['body'][_0xa57c('0xa1')][_0x2aabb4]['name'],'id':_0x3b3bf9[_0xa57c('0x57')][_0xa57c('0xa1')][_0x2aabb4]['id'],'path':path[_0xa57c('0xa2')](config[_0xa57c('0xa3')],_0xa57c('0xa4'),_0x3b3bf9[_0xa57c('0x57')][_0xa57c('0xa1')][_0x2aabb4][_0xa57c('0xa5')])};}}return respondWithRpcPromise(_0xa57c('0xa6'),'CheckAfterSend',{'FaxAccountId':_[_0xa57c('0xa7')](_0x3b3bf9[_0xa57c('0x61')]['id'])?undefined:_0x3b3bf9[_0xa57c('0x61')]['id'],'path':_[_0xa57c('0xa7')](_0x3b3bf9[_0xa57c('0x57')][_0xa57c('0xa1')][0x0][_0xa57c('0x7')])?undefined:_0x3b3bf9['body'][_0xa57c('0xa1')][0x0][_0xa57c('0x7')],'fax':_['isNil'](_0x3b3bf9['body']['to'][0x0])?undefined:_0x3b3bf9[_0xa57c('0x57')]['to'][0x0]},client9002);})[_0xa57c('0x33')](function(){if(_0x2add08){if(_[_0xa57c('0xa7')](_0x3b3bf9[_0xa57c('0x57')]['from'])){_0x3b3bf9['body']['from']=util[_0xa57c('0x9a')](_0xa57c('0xa8'),_0x2add08[_0xa57c('0x37')],_0x2add08['fax']);}if(_0x2add08[_0xa57c('0x9f')]){if(_0x2add08[_0xa57c('0x9f')][_0xa57c('0xa9')][_0xa57c('0x41')]){return _0x2add08[_0xa57c('0x9f')]['Contacts'][0x0];}else{return db['CmContact'][_0xa57c('0x5f')](_['defaults'](_0x3b3bf9['body'],{'firstName':_0x3b3bf9[_0xa57c('0x57')]['to'][0x0],'phone':_0x3b3bf9[_0xa57c('0x57')]['to'][0x0],'fax':_0x3b3bf9[_0xa57c('0x57')]['to'][0x0],'ListId':_0x2add08[_0xa57c('0x95')]}));}}else{throw new Error(_0xa57c('0xaa'));}}else{throw new Error(_0xa57c('0xab'));}})[_0xa57c('0x33')](function(_0x4a3a73){if(_0x4a3a73){return db[_0xa57c('0x6b')]['find']({'where':{'ContactId':_0x4a3a73['id'],'closed':![],'FaxAccountId':_0x2add08['id']}})['then'](function(_0x36a751){if(_0x36a751){return[_0x36a751,![]];}return db[_0xa57c('0x6b')][_0xa57c('0x5f')]({'UserId':_0x3b3bf9['user']['id'],'ContactId':_0x4a3a73['id'],'FaxAccountId':_0x2add08['id'],'fax':_0x3b3bf9[_0xa57c('0x57')]['to'][0x0],'firstMsgDirection':_0xa57c('0xac'),'Messages':[_[_0xa57c('0x55')](_0x3b3bf9[_0xa57c('0x57')],{'read':![],'body':_0x3b3bf9[_0xa57c('0x57')][_0xa57c('0xa1')][0x0]['filename'],'FaxAccountId':_0x2add08['id'],'UserId':_0x3b3bf9['user']['id'],'ContactId':_0x4a3a73['id'],'AttachmentId':_0x3b3bf9[_0xa57c('0x57')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xa57c('0x9c')],'as':_0xa57c('0xad')}]})[_0xa57c('0x33')](function(_0x403942){return[_0x403942,!![]];});});}else{throw new Error(_0xa57c('0xae'));}})[_0xa57c('0xaf')](function(_0x202b0a,_0x4c43ff){if(_0x4c43ff){return _0x202b0a;}return db[_0xa57c('0x9c')]['create']({'direction':_0xa57c('0xac'),'read':![],'body':_0x3b3bf9[_0xa57c('0x57')][_0xa57c('0xa1')][0x0][_0xa57c('0xb0')],'FaxAccountId':_0x2add08['id'],'FaxInteractionId':_0x202b0a['id'],'UserId':_0x3b3bf9['user']['id'],'ContactId':_0x202b0a[_0xa57c('0xb1')],'AttachmentId':_0x3b3bf9['body'][_0xa57c('0xa1')][0x0]['id']})[_0xa57c('0x33')](function(_0x3c692d){_0x202b0a[_0xa57c('0xb2')][_0xa57c('0xad')]=[];_0x202b0a[_0xa57c('0xb2')][_0xa57c('0xad')][_0xa57c('0x83')](_0x3c692d[_0xa57c('0xb2')]);return _0x202b0a;});})[_0xa57c('0x33')](function(_0x2bdd63){respondWithRpcPromise(_0xa57c('0xb3'),'SendFax',{'FaxAccountId':_[_0xa57c('0xa7')](_0x3b3bf9[_0xa57c('0x61')]['id'])?undefined:_0x3b3bf9['params']['id'],'path':_[_0xa57c('0xa7')](_0x3b3bf9[_0xa57c('0x57')]['attachments'][0x0][_0xa57c('0x7')])?undefined:_0x3b3bf9[_0xa57c('0x57')][_0xa57c('0xa1')][0x0][_0xa57c('0x7')],'fax':_[_0xa57c('0xa7')](_0x3b3bf9[_0xa57c('0x57')]['to'][0x0])?undefined:_0x3b3bf9[_0xa57c('0x57')]['to'][0x0],'AttachmentId':_0x3b3bf9['body']['attachments'][0x0]['id']},client9002)[_0xa57c('0x33')](function(_0x49e127){logger[_0xa57c('0xb4')]('SendFaxRpc,\x20%s',_0x49e127);})[_0xa57c('0x28')](function(_0x5d2816){logger[_0xa57c('0xb4')](_0xa57c('0xb5'),_0x5d2816);});return _0x2bdd63;})[_0xa57c('0x33')](respondWithResult(_0xc0065e,null))[_0xa57c('0x28')](handleError(_0xc0065e,null));};exports[_0xa57c('0xb6')]=function(_0x24ed4a,_0x55c1a5,_0x2ae992){return db[_0xa57c('0x4d')]['find']({'where':{'id':_0x24ed4a[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x55c1a5,null))[_0xa57c('0x33')](function(_0x282d34){if(_0x282d34){return _0x282d34['addAgents'](_0x24ed4a['body'][_0xa57c('0x6e')],_[_0xa57c('0x6d')](_0x24ed4a[_0xa57c('0x57')],['ids','id'])||{})['spread'](function(_0x2777aa){for(var _0x543884=0x0;_0x543884<_0x24ed4a[_0xa57c('0x57')][_0xa57c('0x6e')]['length'];_0x543884+=0x1){socket['emit']('userFaxAccount:save',{'UserId':_0x24ed4a[_0xa57c('0x57')][_0xa57c('0x6e')][_0x543884],'FaxAccountId':_0x24ed4a[_0xa57c('0x61')]['id']});}return _0x2777aa;});}})[_0xa57c('0x33')](respondWithResult(_0x55c1a5,null))['catch'](handleError(_0x55c1a5,null));};exports[_0xa57c('0xb7')]=function(_0x35e42c,_0xff1451,_0x1fad20){return db[_0xa57c('0x4d')][_0xa57c('0x56')]({'where':{'id':_0x35e42c[_0xa57c('0x61')]['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0xff1451,null))['then'](function(_0x4bd2b4){if(_0x4bd2b4){return _0x4bd2b4['removeAgents'](_0x35e42c[_0xa57c('0x3d')][_0xa57c('0x6e')])[_0xa57c('0x33')](function(){if(_[_0xa57c('0xb8')](_0x35e42c[_0xa57c('0x3d')][_0xa57c('0x6e')])){for(var _0x16dee3=0x0;_0x16dee3<_0x35e42c[_0xa57c('0x3d')][_0xa57c('0x6e')][_0xa57c('0x41')];_0x16dee3+=0x1){socket[_0xa57c('0xb9')](_0xa57c('0xba'),{'UserId':Number(_0x35e42c[_0xa57c('0x3d')][_0xa57c('0x6e')][_0x16dee3]),'FaxAccountId':Number(_0x35e42c['params']['id'])});}}else{socket[_0xa57c('0xb9')](_0xa57c('0xba'),{'UserId':Number(_0x35e42c[_0xa57c('0x3d')][_0xa57c('0x6e')]),'FaxAccountId':Number(_0x35e42c[_0xa57c('0x61')]['id'])});}});}})[_0xa57c('0x33')](respondWithStatusCode(_0xff1451,null))[_0xa57c('0x28')](handleError(_0xff1451,null));};exports['getAgents']=function(_0x11e592,_0x4c6f79,_0x44d882){var _0x18ef8d={};var _0x5de143={};var _0x49b966;var _0x23562a;return db[_0xa57c('0x4d')]['findOne']({'where':{'id':_0x11e592['params']['id']}})[_0xa57c('0x33')](handleEntityNotFound(_0x4c6f79,null))[_0xa57c('0x33')](function(_0x5d3112){if(_0x5d3112){_0x49b966=_0x5d3112;_0x5de143[_0xa57c('0x3c')]=_['keys'](db[_0xa57c('0xbb')][_0xa57c('0x66')]);_0x5de143[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x11e592[_0xa57c('0x3d')]);_0x5de143[_0xa57c('0x3f')]=_[_0xa57c('0x53')](_0x5de143['model'],_0x5de143[_0xa57c('0x3d')]);_0x18ef8d[_0xa57c('0x42')]=_['intersection'](_0x5de143[_0xa57c('0x3c')],qs['fields'](_0x11e592[_0xa57c('0x3d')]['fields']));_0x18ef8d[_0xa57c('0x42')]=_0x18ef8d[_0xa57c('0x42')][_0xa57c('0x41')]?_0x18ef8d[_0xa57c('0x42')]:_0x5de143['model'];_0x18ef8d[_0xa57c('0x45')]=qs['sort'](_0x11e592[_0xa57c('0x3d')]['sort']);_0x18ef8d['where']=qs[_0xa57c('0x3f')](_[_0xa57c('0x48')](_0x11e592[_0xa57c('0x3d')],_0x5de143[_0xa57c('0x3f')]));if(_0x11e592[_0xa57c('0x3d')][_0xa57c('0x49')]){_0x18ef8d[_0xa57c('0x47')]=_[_0xa57c('0x55')](_0x18ef8d['where'],{'$or':_['map'](_0x18ef8d['attributes'],function(_0x4bf736){var _0x2596ed={};_0x2596ed[_0x4bf736]={'$like':'%'+_0x11e592[_0xa57c('0x3d')][_0xa57c('0x49')]+'%'};return _0x2596ed;})});}_0x18ef8d=_[_0xa57c('0x55')]({},_0x18ef8d,_0x11e592[_0xa57c('0x4c')]);return _0x49b966['getAgents'](_0x18ef8d);}})[_0xa57c('0x33')](function(_0x5f2f97){if(_0x5f2f97){_0x23562a=_0x5f2f97[_0xa57c('0x41')];if(!_0x11e592[_0xa57c('0x3d')][_0xa57c('0x43')](_0xa57c('0x44'))){_0x18ef8d[_0xa57c('0x2d')]=qs[_0xa57c('0x2d')](_0x11e592[_0xa57c('0x3d')]['limit']);_0x18ef8d[_0xa57c('0x2c')]=qs['offset'](_0x11e592[_0xa57c('0x3d')]['offset']);}return _0x49b966[_0xa57c('0xbc')](_0x18ef8d);}})[_0xa57c('0x33')](function(_0x584a81){if(_0x584a81){return _0x584a81?{'count':_0x23562a,'rows':_0x584a81}:null;}})['then'](respondWithResult(_0x4c6f79,null))['catch'](handleError(_0x4c6f79,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index c0e5381..66fddd3 100644 --- a/server/api/faxAccount/faxAccount.events.js +++ b/server/api/faxAccount/faxAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb80=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','FaxAccount'];(function(_0xd0bda2,_0x366192){var _0x27fe6c=function(_0x130cf8){while(--_0x130cf8){_0xd0bda2['push'](_0xd0bda2['shift']());}};_0x27fe6c(++_0x366192);}(_0xeb80,0xdf));var _0x0eb8=function(_0x46cf50,_0x4c99fe){_0x46cf50=_0x46cf50-0x0;var _0x21f731=_0xeb80[_0x46cf50];return _0x21f731;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x0eb8('0x0'))['db'][_0x0eb8('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0eb8('0x2')](0x0);var events={'afterCreate':_0x0eb8('0x3'),'afterUpdate':_0x0eb8('0x4'),'afterDestroy':_0x0eb8('0x5')};function emitEvent(_0x3a2ad3){return function(_0x5a7142,_0x54a906,_0x323347){FaxAccountEvents[_0x0eb8('0x6')](_0x3a2ad3+':'+_0x5a7142['id'],_0x5a7142);FaxAccountEvents[_0x0eb8('0x6')](_0x3a2ad3,_0x5a7142);_0x323347(null);};}for(var e in events){if(events[_0x0eb8('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x0eb8('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xf491=['FaxAccount','update','emit','hook','events','../../mysqldb'];(function(_0x199dba,_0x5e02a3){var _0x5699e3=function(_0x4135f3){while(--_0x4135f3){_0x199dba['push'](_0x199dba['shift']());}};_0x5699e3(++_0x5e02a3);}(_0xf491,0x178));var _0x1f49=function(_0x2b4dda,_0x57da3b){_0x2b4dda=_0x2b4dda-0x0;var _0x2ea63d=_0xf491[_0x2b4dda];return _0x2ea63d;};'use strict';var EventEmitter=require(_0x1f49('0x0'));var FaxAccount=require(_0x1f49('0x1'))['db'][_0x1f49('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f49('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13cc7f){return function(_0x4863db,_0x19162f,_0x394224){FaxAccountEvents[_0x1f49('0x4')](_0x13cc7f+':'+_0x4863db['id'],_0x4863db);FaxAccountEvents['emit'](_0x13cc7f,_0x4863db);_0x394224(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x1f49('0x5')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 312dc5d..d9e6861 100644 --- a/server/api/faxAccount/faxAccount.model.js +++ b/server/api/faxAccount/faxAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x722d=['moment','bluebird','request-promise','./faxAccount.attributes','exports','FaxAccount','fax_accounts','util','../../config/logger','api'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x722d,0x1a1));var _0xd722=function(_0x5169ca,_0x2356e5){_0x5169ca=_0x5169ca-0x0;var _0x13f00d=_0x722d[_0x5169ca];return _0x13f00d;};'use strict';var _=require('lodash');var util=require(_0xd722('0x0'));var logger=require(_0xd722('0x1'))(_0xd722('0x2'));var moment=require(_0xd722('0x3'));var BPromise=require(_0xd722('0x4'));var rp=require(_0xd722('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd722('0x6'));module[_0xd722('0x7')]=function(_0x5b1ded,_0x538aa3){return _0x5b1ded['define'](_0xd722('0x8'),attributes,{'tableName':_0xd722('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf38b=['FaxAccount','fax_accounts','lodash','../../config/logger','bluebird','../../config/environment','exports','define'];(function(_0x4e082e,_0x51c1bb){var _0xbc99e1=function(_0x3a601a){while(--_0x3a601a){_0x4e082e['push'](_0x4e082e['shift']());}};_0xbc99e1(++_0x51c1bb);}(_0xf38b,0x1d2));var _0xbf38=function(_0x1b3140,_0x35deef){_0x1b3140=_0x1b3140-0x0;var _0x4067ad=_0xf38b[_0x1b3140];return _0x4067ad;};'use strict';var _=require(_0xbf38('0x0'));var util=require('util');var logger=require(_0xbf38('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbf38('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf38('0x3'));var attributes=require('./faxAccount.attributes');module[_0xbf38('0x4')]=function(_0x454522,_0x54183e){return _0x454522[_0xbf38('0x5')](_0xbf38('0x6'),attributes,{'tableName':_0xbf38('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index de191e3..d428f17 100644 --- a/server/api/faxAccount/faxAccount.rpc.js +++ b/server/api/faxAccount/faxAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5b3=['keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','priority','asc','length','contact','create','spread','push','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference'];(function(_0xff1e97,_0x52f168){var _0x5c4e08=function(_0x16f752){while(--_0x16f752){_0xff1e97['push'](_0xff1e97['shift']());}};_0x5c4e08(++_0x52f168);}(_0xb5b3,0x143));var _0x3b5b=function(_0x5ee57a,_0x18ef68){_0x5ee57a=_0x5ee57a-0x0;var _0x3c06ab=_0xb5b3[_0x5ee57a];return _0x3c06ab;};'use strict';var _=require(_0x3b5b('0x0'));var util=require(_0x3b5b('0x1'));var moment=require(_0x3b5b('0x2'));var BPromise=require(_0x3b5b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b5b('0x4'));var db=require(_0x3b5b('0x5'))['db'];var utils=require(_0x3b5b('0x6'));var logger=require(_0x3b5b('0x7'))(_0x3b5b('0x8'));var config=require('../../config/environment');var jayson=require(_0x3b5b('0x9'));var client=jayson[_0x3b5b('0xa')][_0x3b5b('0xb')]({'port':0x232c});config[_0x3b5b('0xc')]=_[_0x3b5b('0xd')](config[_0x3b5b('0xc')],{'host':_0x3b5b('0xe'),'port':0x18eb});var socket=require(_0x3b5b('0xf'))(new Redis(config[_0x3b5b('0xc')]));require(_0x3b5b('0x10'))[_0x3b5b('0x11')](socket);function respondWithRpcPromise(_0x14e854,_0x33d2a3,_0x12b535){return new BPromise(function(_0x36f5ba,_0x56e45e){return client[_0x3b5b('0x12')](_0x14e854,_0x12b535)[_0x3b5b('0x13')](function(_0x225532){logger[_0x3b5b('0x14')](_0x3b5b('0x15'),_0x33d2a3,_0x3b5b('0x16'));logger[_0x3b5b('0x17')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x33d2a3,_0x3b5b('0x16'),JSON[_0x3b5b('0x18')](_0x225532));if(_0x225532[_0x3b5b('0x19')]){if(_0x225532[_0x3b5b('0x19')][_0x3b5b('0x1a')]===0x1f4){logger['error'](_0x3b5b('0x15'),_0x33d2a3,_0x225532[_0x3b5b('0x19')][_0x3b5b('0x1b')]);return _0x56e45e(_0x225532[_0x3b5b('0x19')][_0x3b5b('0x1b')]);}logger[_0x3b5b('0x19')](_0x3b5b('0x15'),_0x33d2a3,_0x225532['error'][_0x3b5b('0x1b')]);return _0x36f5ba(_0x225532[_0x3b5b('0x19')][_0x3b5b('0x1b')]);}else{logger[_0x3b5b('0x14')](_0x3b5b('0x15'),_0x33d2a3,_0x3b5b('0x16'));_0x36f5ba(_0x225532[_0x3b5b('0x1c')]['message']);}})['catch'](function(_0x35d9ab){logger[_0x3b5b('0x19')](_0x3b5b('0x15'),_0x33d2a3,_0x35d9ab);_0x56e45e(_0x35d9ab);});});}exports[_0x3b5b('0x1d')]=function(_0x24897c){var _0x1768e0=this;return new Promise(function(_0x27d22e,_0x119d98){return db[_0x3b5b('0x1e')][_0x3b5b('0x1f')]({'raw':_0x24897c[_0x3b5b('0x20')]?_0x24897c['options'][_0x3b5b('0x21')]===undefined?!![]:![]:!![],'where':_0x24897c[_0x3b5b('0x20')]?_0x24897c[_0x3b5b('0x20')][_0x3b5b('0x22')]||null:null,'attributes':_0x24897c[_0x3b5b('0x20')]?_0x24897c['options'][_0x3b5b('0x23')]||null:null,'limit':_0x24897c[_0x3b5b('0x20')]?_0x24897c['options'][_0x3b5b('0x24')]||null:null,'include':_0x24897c[_0x3b5b('0x20')]?_0x24897c[_0x3b5b('0x20')][_0x3b5b('0x25')]?_[_0x3b5b('0x26')](_0x24897c[_0x3b5b('0x20')][_0x3b5b('0x25')],function(_0x24eae7){return{'model':db[_0x24eae7[_0x3b5b('0x27')]],'as':_0x24eae7['as'],'attributes':_0x24eae7[_0x3b5b('0x23')],'include':_0x24eae7[_0x3b5b('0x25')]?_[_0x3b5b('0x26')](_0x24eae7['include'],function(_0x44b238){return{'model':db[_0x44b238[_0x3b5b('0x27')]],'as':_0x44b238['as'],'attributes':_0x44b238['attributes'],'include':_0x44b238[_0x3b5b('0x25')]?_[_0x3b5b('0x26')](_0x44b238[_0x3b5b('0x25')],function(_0x5428cc){return{'model':db[_0x5428cc['model']],'as':_0x5428cc['as'],'attributes':_0x5428cc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30cdb1){logger[_0x3b5b('0x14')]('GetFaxAccount',_0x24897c);logger[_0x3b5b('0x17')](_0x3b5b('0x1d'),_0x24897c,JSON[_0x3b5b('0x18')](_0x30cdb1));_0x27d22e(_0x30cdb1);})[_0x3b5b('0x28')](function(_0x125655){logger[_0x3b5b('0x19')]('GetFaxAccount',_0x125655[_0x3b5b('0x1b')],_0x24897c);_0x119d98(_0x1768e0[_0x3b5b('0x19')](0x1f4,_0x125655['message']));});});};exports[_0x3b5b('0x29')]=function(_0x3db7c5,_0x279b0b,_0x3b831f){var _0x3e8536=this;return new Promise(function(_0x342e85,_0x28af6b){var _0x2afe96={'body':_0x3db7c5[_0x3b5b('0x2a')],'channel':'fax'};var _0x157aa5=[];var _0x436ba2=[];var _0x2312c9={};return db[_0x3b5b('0x2b')][_0x3b5b('0x2c')]()[_0x3b5b('0x13')](function(_0x129805){if(!_0x129805){throw new db[(_0x3b5b('0x2d'))][(_0x3b5b('0x2e'))](_0x3b5b('0x2f'));}_0x157aa5=_[_0x3b5b('0x30')](_[_0x3b5b('0x31')](_0x129805),[_0x3b5b('0x32'),'updatedAt']);_0x436ba2=_[_0x3b5b('0x30')](_[_0x3b5b('0x31')](_0x129805),[_0x3b5b('0x32'),_0x3b5b('0x33'),_0x3b5b('0x34'),_0x3b5b('0x35')]);if(_0x3db7c5[_0x3b5b('0x2a')]['id']){delete _0x3db7c5['body']['id'];}if(_[_0x3b5b('0x36')](_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x37')])){throw new db[(_0x3b5b('0x2d'))]['ValidationError'](_0x3b5b('0x38'));}if(_[_0x3b5b('0x36')](_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x2a')])||_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x2a')]===''){throw new db[(_0x3b5b('0x2d'))][(_0x3b5b('0x2e'))](_0x3b5b('0x39'));}if(_[_0x3b5b('0x36')](_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x3a')])){throw new db['Sequelize'][(_0x3b5b('0x2e'))](_0x3b5b('0x3b')+_0x436ba2);}if(!_[_0x3b5b('0x3c')](_0x436ba2,_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x3a')])){throw new db['Sequelize'][(_0x3b5b('0x2e'))](_0x3b5b('0x3d')+_0x436ba2);}_0x2312c9[_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x3a')]]=_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x37')];})['then'](function(){return db[_0x3b5b('0x1e')][_0x3b5b('0x3e')]({'where':{'id':_0x3db7c5[_0x3b5b('0x3f')]['id']},'include':[{'model':db['CmList'],'as':_0x3b5b('0x40'),'include':[{'model':db['CmContact'],'as':_0x3b5b('0x41'),'where':_0x2312c9,'limit':0x1,'order':[['updatedAt',_0x3b5b('0x42')]]}]},{'model':db[_0x3b5b('0x43')],'as':_0x3b5b('0x44')}]});})[_0x3b5b('0x13')](function(_0x385c00){if(_0x385c00&&_0x385c00[_0x3b5b('0x40')]){var _0x53f086=_0x385c00[_0x3b5b('0x45')]({'plain':!![]});_0x2afe96[_0x3b5b('0x3f')]=_0x53f086;_0x2afe96['applications']=_0x53f086[_0x3b5b('0x44')];_0x2afe96[_0x3b5b('0x46')]=_0x53f086[_0x3b5b('0x40')];_0x2afe96[_0x3b5b('0x47')]=_['orderBy'](_0x2afe96[_0x3b5b('0x47')],[_0x3b5b('0x48')],[_0x3b5b('0x49')]);if(_0x2afe96['account'][_0x3b5b('0x44')]){delete _0x2afe96[_0x3b5b('0x3f')][_0x3b5b('0x44')];}if(_0x2afe96[_0x3b5b('0x3f')][_0x3b5b('0x40')]&&_0x2afe96[_0x3b5b('0x3f')][_0x3b5b('0x40')][_0x3b5b('0x41')][_0x3b5b('0x4a')]){return _0x2afe96[_0x3b5b('0x3f')]['List'][_0x3b5b('0x41')][0x0];}var _0x1022e6=_[_0x3b5b('0xd')](_0x3db7c5[_0x3b5b('0x2a')],{'firstName':_0x3db7c5['body'][_0x3b5b('0x37')],'ListId':_0x53f086[_0x3b5b('0x35')]});_0x1022e6[_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x3a')]]=_0x3db7c5[_0x3b5b('0x2a')]['from'];return db[_0x3b5b('0x2b')]['create'](_0x1022e6,{'fields':_0x157aa5,'raw':!![]});}})['then'](function(_0x44710f){_0x2afe96[_0x3b5b('0x4b')]=_0x44710f;if(_0x44710f){var _0x624042={'ContactId':_0x44710f['id'],'FaxAccountId':_0x3db7c5[_0x3b5b('0x3f')]['id'],'fax':_0x44710f['fax']};return db['FaxInteraction'][_0x3b5b('0x3e')]({'where':{'ContactId':_0x44710f['id'],'closed':![],'FaxAccountId':_0x3db7c5[_0x3b5b('0x3f')]['id']}})[_0x3b5b('0x13')](function(_0x8067f0){if(_0x8067f0){return[_0x8067f0,![]];}return db['FaxInteraction'][_0x3b5b('0x4c')](_0x624042)['then'](function(_0x449b28){return[_0x449b28,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3b5b('0x4d')](function(_0x375931,_0x2189c4){var _0x67b0d6=_0x375931['get']({'plain':!![]});if(_0x2189c4){if(_0x2afe96[_0x3b5b('0x3f')]['autoclose']){_0x2afe96[_0x3b5b('0x47')][_0x3b5b('0x4e')]({'id':0x0,'priority':_0x2afe96['applications']['length']+0x1,'app':'close','appdata':_0x3b5b('0x4f'),'interval':_0x3b5b('0x50')});}_0x67b0d6['created']=!![];}else{_0x67b0d6[_0x3b5b('0x51')]=![];}_0x2afe96['interaction']=_0x67b0d6;return db[_0x3b5b('0x52')]['create']({'body':_0x3db7c5[_0x3b5b('0x2a')]['body'],'FaxAccountId':_0x3db7c5['account']['id'],'FaxInteractionId':_0x375931['id'],'direction':'in','ContactId':_0x375931[_0x3b5b('0x53')],'AttachmentId':_0x3db7c5[_0x3b5b('0x2a')][_0x3b5b('0x54')]});})[_0x3b5b('0x13')](function(_0x37bf04){_0x2afe96[_0x3b5b('0x1b')]=_0x37bf04;if(_0x2afe96[_0x3b5b('0x55')]['UserId']){return db['User'][_0x3b5b('0x3e')]({'attributes':['id',_0x3b5b('0x56')],'where':{'id':_0x2afe96[_0x3b5b('0x55')][_0x3b5b('0x57')]}})[_0x3b5b('0x13')](function(_0x585ab5){if(_0x585ab5){_0x2afe96[_0x3b5b('0x47')][_0x3b5b('0x58')]({'id':0x0,'priority':0x0,'app':_0x3b5b('0x59'),'appdata':_0x585ab5[_0x3b5b('0x56')]+','+(_0x2afe96[_0x3b5b('0x3f')][_0x3b5b('0x5a')]||0xa),'interval':_0x3b5b('0x50')});}return respondWithRpcPromise(_0x3b5b('0x5b'),_0x3b5b('0x5c'),_0x2afe96);});}return respondWithRpcPromise(_0x3b5b('0x5b'),_0x3b5b('0x5c'),_0x2afe96);})[_0x3b5b('0x13')](function(_0x4f46c7){_0x342e85(_0x4f46c7);})['catch'](function(_0x34577b){_0x28af6b(_0x3e8536[_0x3b5b('0x19')](0x1f4,_0x34577b[_0x3b5b('0x1b')]));});});}; \ No newline at end of file +var _0xa623=['redis','defaults','socket.io-emitter','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetFaxAccount','debug','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','get','account','applications','list','orderBy','priority','asc','length','ListId','contact','FaxInteraction','find','create','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','created','interaction','FaxMessage','ContactId','name','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x534fc7,_0x4974a5){var _0x520dcb=function(_0x5c02e8){while(--_0x5c02e8){_0x534fc7['push'](_0x534fc7['shift']());}};_0x520dcb(++_0x4974a5);}(_0xa623,0x1b1));var _0x3a62=function(_0xcbac96,_0x40955d){_0xcbac96=_0xcbac96-0x0;var _0x556828=_0xa623[_0xcbac96];return _0x556828;};'use strict';var _=require('lodash');var util=require(_0x3a62('0x0'));var moment=require(_0x3a62('0x1'));var BPromise=require(_0x3a62('0x2'));var rs=require(_0x3a62('0x3'));var fs=require('fs');var Redis=require(_0x3a62('0x4'));var db=require(_0x3a62('0x5'))['db'];var utils=require(_0x3a62('0x6'));var logger=require(_0x3a62('0x7'))(_0x3a62('0x8'));var config=require(_0x3a62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3a62('0xa')][_0x3a62('0xb')]({'port':0x232c});config[_0x3a62('0xc')]=_[_0x3a62('0xd')](config[_0x3a62('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3a62('0xe'))(new Redis(config[_0x3a62('0xc')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x22ae01,_0x3900fd,_0x5bfa15){return new BPromise(function(_0x2244b9,_0x4e0643){return client[_0x3a62('0xf')](_0x22ae01,_0x5bfa15)[_0x3a62('0x10')](function(_0x42f5d3){logger[_0x3a62('0x11')](_0x3a62('0x12'),_0x3900fd,_0x3a62('0x13'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3900fd,_0x3a62('0x13'),JSON[_0x3a62('0x14')](_0x42f5d3));if(_0x42f5d3[_0x3a62('0x15')]){if(_0x42f5d3[_0x3a62('0x15')][_0x3a62('0x16')]===0x1f4){logger[_0x3a62('0x15')]('FaxAccount,\x20%s,\x20%s',_0x3900fd,_0x42f5d3[_0x3a62('0x15')][_0x3a62('0x17')]);return _0x4e0643(_0x42f5d3['error']['message']);}logger[_0x3a62('0x15')](_0x3a62('0x12'),_0x3900fd,_0x42f5d3[_0x3a62('0x15')][_0x3a62('0x17')]);return _0x2244b9(_0x42f5d3[_0x3a62('0x15')]['message']);}else{logger[_0x3a62('0x11')](_0x3a62('0x12'),_0x3900fd,'request\x20sent');_0x2244b9(_0x42f5d3[_0x3a62('0x18')]['message']);}})[_0x3a62('0x19')](function(_0x3641f6){logger[_0x3a62('0x15')]('FaxAccount,\x20%s,\x20%s',_0x3900fd,_0x3641f6);_0x4e0643(_0x3641f6);});});}exports['GetFaxAccount']=function(_0x2a15b4){var _0x51c864=this;return new Promise(function(_0x5565ae,_0x251901){return db[_0x3a62('0x1a')][_0x3a62('0x1b')]({'raw':_0x2a15b4[_0x3a62('0x1c')]?_0x2a15b4[_0x3a62('0x1c')][_0x3a62('0x1d')]===undefined?!![]:![]:!![],'where':_0x2a15b4[_0x3a62('0x1c')]?_0x2a15b4['options'][_0x3a62('0x1e')]||null:null,'attributes':_0x2a15b4['options']?_0x2a15b4['options'][_0x3a62('0x1f')]||null:null,'limit':_0x2a15b4['options']?_0x2a15b4['options'][_0x3a62('0x20')]||null:null,'include':_0x2a15b4[_0x3a62('0x1c')]?_0x2a15b4['options']['include']?_['map'](_0x2a15b4[_0x3a62('0x1c')]['include'],function(_0x1a1979){return{'model':db[_0x1a1979['model']],'as':_0x1a1979['as'],'attributes':_0x1a1979[_0x3a62('0x1f')],'include':_0x1a1979['include']?_[_0x3a62('0x21')](_0x1a1979[_0x3a62('0x22')],function(_0x1e9cac){return{'model':db[_0x1e9cac[_0x3a62('0x23')]],'as':_0x1e9cac['as'],'attributes':_0x1e9cac[_0x3a62('0x1f')],'include':_0x1e9cac[_0x3a62('0x22')]?_['map'](_0x1e9cac[_0x3a62('0x22')],function(_0x556b96){return{'model':db[_0x556b96[_0x3a62('0x23')]],'as':_0x556b96['as'],'attributes':_0x556b96[_0x3a62('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3a62('0x10')](function(_0x2c56ea){logger[_0x3a62('0x11')](_0x3a62('0x24'),_0x2a15b4);logger[_0x3a62('0x25')](_0x3a62('0x24'),_0x2a15b4,JSON[_0x3a62('0x14')](_0x2c56ea));_0x5565ae(_0x2c56ea);})['catch'](function(_0x37a901){logger[_0x3a62('0x15')](_0x3a62('0x24'),_0x37a901['message'],_0x2a15b4);_0x251901(_0x51c864[_0x3a62('0x15')](0x1f4,_0x37a901[_0x3a62('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x415b7b,_0x2ddf78,_0x804e13){var _0x635b30=this;return new Promise(function(_0x1c520b,_0x5e1d51){var _0x561c73={'body':_0x415b7b[_0x3a62('0x26')],'channel':_0x3a62('0x27')};var _0x21e7ce=[];var _0x1b711a=[];var _0x12cef4={};return db[_0x3a62('0x28')]['describe']()[_0x3a62('0x10')](function(_0x257d58){if(!_0x257d58){throw new db[(_0x3a62('0x29'))][(_0x3a62('0x2a'))](_0x3a62('0x2b'));}_0x21e7ce=_['difference'](_[_0x3a62('0x2c')](_0x257d58),[_0x3a62('0x2d'),_0x3a62('0x2e')]);_0x1b711a=_[_0x3a62('0x2f')](_['keys'](_0x257d58),['createdAt','updatedAt',_0x3a62('0x30'),'ListId']);if(_0x415b7b[_0x3a62('0x26')]['id']){delete _0x415b7b[_0x3a62('0x26')]['id'];}if(_['isNil'](_0x415b7b[_0x3a62('0x26')][_0x3a62('0x31')])){throw new db['Sequelize']['ValidationError'](_0x3a62('0x32'));}if(_[_0x3a62('0x33')](_0x415b7b[_0x3a62('0x26')][_0x3a62('0x26')])||_0x415b7b[_0x3a62('0x26')][_0x3a62('0x26')]===''){throw new db[(_0x3a62('0x29'))][(_0x3a62('0x2a'))](_0x3a62('0x34'));}if(_[_0x3a62('0x33')](_0x415b7b[_0x3a62('0x26')][_0x3a62('0x35')])){throw new db[(_0x3a62('0x29'))]['ValidationError'](_0x3a62('0x36')+_0x1b711a);}if(!_['includes'](_0x1b711a,_0x415b7b[_0x3a62('0x26')][_0x3a62('0x35')])){throw new db['Sequelize'][(_0x3a62('0x2a'))](_0x3a62('0x37')+_0x1b711a);}_0x12cef4[_0x415b7b[_0x3a62('0x26')][_0x3a62('0x35')]]=_0x415b7b[_0x3a62('0x26')][_0x3a62('0x31')];})[_0x3a62('0x10')](function(){return db['FaxAccount']['find']({'where':{'id':_0x415b7b['account']['id']},'include':[{'model':db['CmList'],'as':_0x3a62('0x38'),'include':[{'model':db['CmContact'],'as':_0x3a62('0x39'),'where':_0x12cef4,'limit':0x1,'order':[['updatedAt',_0x3a62('0x3a')]]}]},{'model':db['FaxApplication'],'as':_0x3a62('0x3b')}]});})[_0x3a62('0x10')](function(_0x2f66a0){if(_0x2f66a0&&_0x2f66a0[_0x3a62('0x38')]){var _0x4ffc10=_0x2f66a0[_0x3a62('0x3c')]({'plain':!![]});_0x561c73[_0x3a62('0x3d')]=_0x4ffc10;_0x561c73[_0x3a62('0x3e')]=_0x4ffc10[_0x3a62('0x3b')];_0x561c73[_0x3a62('0x3f')]=_0x4ffc10[_0x3a62('0x38')];_0x561c73[_0x3a62('0x3e')]=_[_0x3a62('0x40')](_0x561c73[_0x3a62('0x3e')],[_0x3a62('0x41')],[_0x3a62('0x42')]);if(_0x561c73[_0x3a62('0x3d')][_0x3a62('0x3b')]){delete _0x561c73['account'][_0x3a62('0x3b')];}if(_0x561c73[_0x3a62('0x3d')][_0x3a62('0x38')]&&_0x561c73[_0x3a62('0x3d')][_0x3a62('0x38')][_0x3a62('0x39')][_0x3a62('0x43')]){return _0x561c73[_0x3a62('0x3d')][_0x3a62('0x38')][_0x3a62('0x39')][0x0];}var _0xe690f5=_[_0x3a62('0xd')](_0x415b7b[_0x3a62('0x26')],{'firstName':_0x415b7b[_0x3a62('0x26')]['from'],'ListId':_0x4ffc10[_0x3a62('0x44')]});_0xe690f5[_0x415b7b[_0x3a62('0x26')]['mapKey']]=_0x415b7b[_0x3a62('0x26')][_0x3a62('0x31')];return db[_0x3a62('0x28')]['create'](_0xe690f5,{'fields':_0x21e7ce,'raw':!![]});}})[_0x3a62('0x10')](function(_0x5dc35d){_0x561c73[_0x3a62('0x45')]=_0x5dc35d;if(_0x5dc35d){var _0x1a531b={'ContactId':_0x5dc35d['id'],'FaxAccountId':_0x415b7b['account']['id'],'fax':_0x5dc35d['fax']};return db[_0x3a62('0x46')][_0x3a62('0x47')]({'where':{'ContactId':_0x5dc35d['id'],'closed':![],'FaxAccountId':_0x415b7b[_0x3a62('0x3d')]['id']}})[_0x3a62('0x10')](function(_0x8499d){if(_0x8499d){return[_0x8499d,![]];}return db[_0x3a62('0x46')][_0x3a62('0x48')](_0x1a531b)[_0x3a62('0x10')](function(_0x7c4520){return[_0x7c4520,!![]];});});}else{throw new Error(_0x3a62('0x49'));}})[_0x3a62('0x4a')](function(_0x4edddb,_0x1448d8){var _0x4a1453=_0x4edddb[_0x3a62('0x3c')]({'plain':!![]});if(_0x1448d8){if(_0x561c73[_0x3a62('0x3d')][_0x3a62('0x4b')]){_0x561c73['applications'][_0x3a62('0x4c')]({'id':0x0,'priority':_0x561c73['applications'][_0x3a62('0x43')]+0x1,'app':_0x3a62('0x4d'),'appdata':_0x3a62('0x4e'),'interval':'*,*,*,*'});}_0x4a1453['created']=!![];}else{_0x4a1453[_0x3a62('0x4f')]=![];}_0x561c73[_0x3a62('0x50')]=_0x4a1453;return db[_0x3a62('0x51')]['create']({'body':_0x415b7b['body']['body'],'FaxAccountId':_0x415b7b[_0x3a62('0x3d')]['id'],'FaxInteractionId':_0x4edddb['id'],'direction':'in','ContactId':_0x4edddb[_0x3a62('0x52')],'AttachmentId':_0x415b7b[_0x3a62('0x26')]['AttachmentId']});})[_0x3a62('0x10')](function(_0x2deaec){_0x561c73['message']=_0x2deaec;if(_0x561c73[_0x3a62('0x50')]['UserId']){return db['User']['find']({'attributes':['id',_0x3a62('0x53')],'where':{'id':_0x561c73[_0x3a62('0x50')]['UserId']}})[_0x3a62('0x10')](function(_0xe09a5b){if(_0xe09a5b){_0x561c73['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x3a62('0x54'),'appdata':_0xe09a5b[_0x3a62('0x53')]+','+(_0x561c73['account'][_0x3a62('0x55')]||0xa),'interval':_0x3a62('0x56')});}return respondWithRpcPromise(_0x3a62('0x57'),_0x3a62('0x58'),_0x561c73);});}return respondWithRpcPromise(_0x3a62('0x57'),_0x3a62('0x58'),_0x561c73);})[_0x3a62('0x10')](function(_0x501428){_0x1c520b(_0x501428);})['catch'](function(_0x147874){_0x5e1d51(_0x635b30[_0x3a62('0x15')](0x1f4,_0x147874[_0x3a62('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e128232..a02b524 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x627e=['./faxAccount.events','save','remove','update','emit','length'];(function(_0x144ebe,_0x453db2){var _0x4203b5=function(_0x4e436c){while(--_0x4e436c){_0x144ebe['push'](_0x144ebe['shift']());}};_0x4203b5(++_0x453db2);}(_0x627e,0x14a));var _0xe627=function(_0x5d8c84,_0x3d03f){_0x5d8c84=_0x5d8c84-0x0;var _0x26c9df=_0x627e[_0x5d8c84];return _0x26c9df;};'use strict';var FaxAccountEvents=require(_0xe627('0x0'));var events=[_0xe627('0x1'),_0xe627('0x2'),_0xe627('0x3')];function createListener(_0x3afa80,_0x48b97a){return function(_0x2b7158){_0x48b97a[_0xe627('0x4')](_0x3afa80,_0x2b7158);};}function removeListener(_0x2abdc7,_0x59a2c8){return function(){FaxAccountEvents['removeListener'](_0x2abdc7,_0x59a2c8);};}exports['register']=function(_0x1a1a3d){for(var _0x3f2791=0x0,_0x45e49a=events[_0xe627('0x5')];_0x3f2791<_0x45e49a;_0x3f2791++){var _0xd5016e=events[_0x3f2791];var _0xe065b=createListener('faxAccount:'+_0xd5016e,_0x1a1a3d);FaxAccountEvents['on'](_0xd5016e,_0xe065b);}}; \ No newline at end of file +var _0xef0f=['removeListener','register','length','./faxAccount.events','remove','update','emit'];(function(_0xe4b697,_0xbd4196){var _0x3ac619=function(_0x556f9c){while(--_0x556f9c){_0xe4b697['push'](_0xe4b697['shift']());}};_0x3ac619(++_0xbd4196);}(_0xef0f,0x168));var _0xfef0=function(_0x1c38ce,_0x100176){_0x1c38ce=_0x1c38ce-0x0;var _0x125efc=_0xef0f[_0x1c38ce];return _0x125efc;};'use strict';var FaxAccountEvents=require(_0xfef0('0x0'));var events=['save',_0xfef0('0x1'),_0xfef0('0x2')];function createListener(_0x19f865,_0x4d29e5){return function(_0x3fc3a1){_0x4d29e5[_0xfef0('0x3')](_0x19f865,_0x3fc3a1);};}function removeListener(_0x4618fb,_0x4e1af6){return function(){FaxAccountEvents[_0xfef0('0x4')](_0x4618fb,_0x4e1af6);};}exports[_0xfef0('0x5')]=function(_0x2697df){for(var _0x315a8c=0x0,_0xad43e=events[_0xfef0('0x6')];_0x315a8c<_0xad43e;_0x315a8c++){var _0x5130bd=events[_0x315a8c];var _0x41ec94=createListener('faxAccount:'+_0x5130bd,_0x2697df);FaxAccountEvents['on'](_0x5130bd,_0x41ec94);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1013516..5810089 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0595=['addAgents','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','create','post','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id/users'];(function(_0x54757f,_0x58c807){var _0x173a27=function(_0x521dfb){while(--_0x521dfb){_0x54757f['push'](_0x54757f['shift']());}};_0x173a27(++_0x58c807);}(_0x0595,0x125));var _0x5059=function(_0x28c673,_0x4428f8){_0x28c673=_0x28c673-0x0;var _0x16a276=_0x0595[_0x28c673];return _0x16a276;};'use strict';var multer=require(_0x5059('0x0'));var util=require(_0x5059('0x1'));var path=require(_0x5059('0x2'));var timeout=require(_0x5059('0x3'));var express=require(_0x5059('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5059('0x5'));var config=require(_0x5059('0x6'));var controller=require(_0x5059('0x7'));router[_0x5059('0x8')]('/',auth[_0x5059('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5059('0xa')]);router[_0x5059('0x8')](_0x5059('0xb'),auth[_0x5059('0x9')](),controller[_0x5059('0xc')]);router[_0x5059('0x8')](_0x5059('0xd'),auth[_0x5059('0x9')](),controller[_0x5059('0xe')]);router[_0x5059('0x8')](_0x5059('0xf'),auth[_0x5059('0x9')](),controller[_0x5059('0x10')]);router[_0x5059('0x8')](_0x5059('0x11'),auth[_0x5059('0x9')](),controller[_0x5059('0x12')]);router['get'](_0x5059('0x13'),auth[_0x5059('0x9')](),controller[_0x5059('0x14')]);router[_0x5059('0x8')](_0x5059('0x15'),auth[_0x5059('0x9')](),controller[_0x5059('0x16')]);router[_0x5059('0x8')]('/:id/users',auth[_0x5059('0x9')](),controller[_0x5059('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5059('0x18')]);router[_0x5059('0x19')](_0x5059('0xd'),auth[_0x5059('0x9')](),controller['addDisposition']);router[_0x5059('0x19')](_0x5059('0xf'),auth[_0x5059('0x9')](),controller[_0x5059('0x1a')]);router[_0x5059('0x19')](_0x5059('0x11'),auth[_0x5059('0x9')](),controller[_0x5059('0x1b')]);router['post'](_0x5059('0x13'),auth[_0x5059('0x9')](),controller[_0x5059('0x1c')]);router[_0x5059('0x19')]('/addaccountapplications',auth[_0x5059('0x9')](),controller[_0x5059('0x1d')]);router[_0x5059('0x19')](_0x5059('0x1e'),auth[_0x5059('0x9')](),controller[_0x5059('0x1f')]);router['post'](_0x5059('0x20'),auth[_0x5059('0x9')](),controller[_0x5059('0x21')]);router[_0x5059('0x19')](_0x5059('0x22'),auth[_0x5059('0x9')](),controller[_0x5059('0x23')]);router['put']('/:id',auth[_0x5059('0x9')](),controller['update']);router['delete']('/:id',auth[_0x5059('0x9')](),controller['destroy']);router[_0x5059('0x24')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5059('0x25')]);router[_0x5059('0x24')](_0x5059('0xf'),auth[_0x5059('0x9')](),controller[_0x5059('0x26')]);router[_0x5059('0x24')]('/:id/users',auth['isAuthenticated'](),controller[_0x5059('0x27')]);module[_0x5059('0x28')]=router; \ No newline at end of file +var _0x4040=['removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','/:id/canned_answers','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','delete'];(function(_0x6e9538,_0x3f67){var _0x1312dd=function(_0x5085ed){while(--_0x5085ed){_0x6e9538['push'](_0x6e9538['shift']());}};_0x1312dd(++_0x3f67);}(_0x4040,0x158));var _0x0404=function(_0x5c029b,_0x1ab0e9){_0x5c029b=_0x5c029b-0x0;var _0x3fba09=_0x4040[_0x5c029b];return _0x3fba09;};'use strict';var multer=require(_0x0404('0x0'));var util=require(_0x0404('0x1'));var path=require('path');var timeout=require(_0x0404('0x2'));var express=require(_0x0404('0x3'));var router=express[_0x0404('0x4')]();var auth=require(_0x0404('0x5'));var interaction=require(_0x0404('0x6'));var config=require(_0x0404('0x7'));var controller=require(_0x0404('0x8'));router[_0x0404('0x9')]('/',auth['isAuthenticated'](),controller[_0x0404('0xa')]);router[_0x0404('0x9')](_0x0404('0xb'),auth[_0x0404('0xc')](),controller['describe']);router[_0x0404('0x9')](_0x0404('0xd'),auth[_0x0404('0xc')](),controller[_0x0404('0xe')]);router[_0x0404('0x9')](_0x0404('0xf'),auth['isAuthenticated'](),controller[_0x0404('0x10')]);router[_0x0404('0x9')]('/:id/canned_answers',auth[_0x0404('0xc')](),controller['getAnswers']);router['get']('/:id/interactions',auth[_0x0404('0xc')](),controller['getInteractions']);router['get'](_0x0404('0x11'),auth[_0x0404('0xc')](),controller[_0x0404('0x12')]);router[_0x0404('0x9')](_0x0404('0x13'),auth[_0x0404('0xc')](),controller[_0x0404('0x14')]);router['get'](_0x0404('0x15'),auth[_0x0404('0xc')](),controller[_0x0404('0x16')]);router[_0x0404('0x17')]('/',auth[_0x0404('0xc')](),controller['create']);router[_0x0404('0x17')]('/:id/dispositions',auth[_0x0404('0xc')](),controller['addDisposition']);router[_0x0404('0x17')](_0x0404('0x18'),auth[_0x0404('0xc')](),controller[_0x0404('0x19')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x0404('0x1a')]);router[_0x0404('0x17')](_0x0404('0x11'),auth[_0x0404('0xc')](),controller[_0x0404('0x1b')]);router['post'](_0x0404('0x1c'),auth[_0x0404('0xc')](),controller[_0x0404('0x1d')]);router[_0x0404('0x17')](_0x0404('0x1e'),auth[_0x0404('0xc')](),controller[_0x0404('0x1f')]);router['post'](_0x0404('0x20'),auth[_0x0404('0xc')](),controller[_0x0404('0x21')]);router[_0x0404('0x17')](_0x0404('0x15'),auth['isAuthenticated'](),controller[_0x0404('0x22')]);router['put']('/:id',auth[_0x0404('0xc')](),controller['update']);router[_0x0404('0x23')](_0x0404('0xd'),auth[_0x0404('0xc')](),controller['destroy']);router[_0x0404('0x23')]('/:id/dispositions',auth[_0x0404('0xc')](),controller['removeDispositions']);router[_0x0404('0x23')](_0x0404('0x18'),auth[_0x0404('0xc')](),controller[_0x0404('0x24')]);router[_0x0404('0x23')](_0x0404('0x15'),auth['isAuthenticated'](),controller[_0x0404('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index fdeea5a..9e9daab 100644 --- a/server/api/faxApplication/faxApplication.attributes.js +++ b/server/api/faxApplication/faxApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf06c=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x593664,_0x267188){var _0x1d7bce=function(_0x4245e3){while(--_0x4245e3){_0x593664['push'](_0x593664['shift']());}};_0x1d7bce(++_0x267188);}(_0xf06c,0xc7));var _0xcf06=function(_0x1c2d51,_0x2a9230){_0x1c2d51=_0x1c2d51-0x0;var _0x478d03=_0xf06c[_0x1c2d51];return _0x478d03;};'use strict';var Sequelize=require(_0xcf06('0x0'));module[_0xcf06('0x1')]={'priority':{'type':Sequelize[_0xcf06('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcf06('0x3')],'allowNull':![],'defaultValue':_0xcf06('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcf06('0x3')]},'interval':{'type':Sequelize[_0xcf06('0x3')],'defaultValue':_0xcf06('0x5')}}; \ No newline at end of file +var _0x79a3=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x79a3,0x113));var _0x379a=function(_0x5106bf,_0x41dd67){_0x5106bf=_0x5106bf-0x0;var _0x2e7af2=_0x79a3[_0x5106bf];return _0x2e7af2;};'use strict';var Sequelize=require(_0x379a('0x0'));module[_0x379a('0x1')]={'priority':{'type':Sequelize[_0x379a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x379a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x379a('0x4')]},'interval':{'type':Sequelize[_0x379a('0x4')],'defaultValue':_0x379a('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 716809a..edf3039 100644 --- a/server/api/faxApplication/faxApplication.controller.js +++ b/server/api/faxApplication/faxApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbd0=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','count','includeAll','include','FaxApplication','rows','show','params','catch','create','body','update','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xdbd0,0x88));var _0x0dbd=function(_0x23bdaa,_0x1fda32){_0x23bdaa=_0x23bdaa-0x0;var _0x5b4092=_0xdbd0[_0x23bdaa];return _0x5b4092;};'use strict';var pdf=require(_0x0dbd('0x0'));var emlformat=require(_0x0dbd('0x1'));var rimraf=require(_0x0dbd('0x2'));var zipdir=require(_0x0dbd('0x3'));var jsonpatch=require(_0x0dbd('0x4'));var rp=require('request-promise');var moment=require(_0x0dbd('0x5'));var BPromise=require(_0x0dbd('0x6'));var Mustache=require(_0x0dbd('0x7'));var util=require('util');var path=require(_0x0dbd('0x8'));var sox=require(_0x0dbd('0x9'));var csv=require(_0x0dbd('0xa'));var ejs=require(_0x0dbd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0dbd('0xc'));var jsforce=require(_0x0dbd('0xd'));var deskjs=require(_0x0dbd('0xe'));var toCsv=require(_0x0dbd('0xa'));var querystring=require(_0x0dbd('0xf'));var Papa=require(_0x0dbd('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0dbd('0x11'));var as=require(_0x0dbd('0x12'));var hardwareService=require(_0x0dbd('0x13'));var logger=require(_0x0dbd('0x14'))(_0x0dbd('0x15'));var utils=require(_0x0dbd('0x16'));var config=require(_0x0dbd('0x17'));var db=require(_0x0dbd('0x18'))['db'];function respondWithStatusCode(_0x4d6073,_0x1c12f3){_0x1c12f3=_0x1c12f3||0xcc;return function(_0x6b2b5){if(_0x6b2b5){return _0x4d6073[_0x0dbd('0x19')](_0x1c12f3);}return _0x4d6073['status'](_0x1c12f3)[_0x0dbd('0x1a')]();};}function respondWithResult(_0x156830,_0x1a45d0){_0x1a45d0=_0x1a45d0||0xc8;return function(_0x903a5){if(_0x903a5){return _0x156830[_0x0dbd('0x1b')](_0x1a45d0)[_0x0dbd('0x1c')](_0x903a5);}};}function respondWithFilteredResult(_0x1016da,_0xce4a93){return function(_0x1b9134){if(_0x1b9134){var _0x513a76=_0x1b9134['count'],_0x5714f8=_0xce4a93[_0x0dbd('0x1d')],_0x844503=_0xce4a93[_0x0dbd('0x1d')]+_0xce4a93['limit'],_0xe8ca22;if(_0x844503>=_0x513a76){_0x844503=_0x513a76;_0xe8ca22=0xc8;}else{_0xe8ca22=0xce;}_0x1016da['status'](_0xe8ca22);return _0x1016da[_0x0dbd('0x1e')](_0x0dbd('0x1f'),_0x5714f8+'-'+_0x844503+'/'+_0x513a76)[_0x0dbd('0x1c')](_0x1b9134);}return null;};}function patchUpdates(_0x5087d3){return function(_0x134055){try{jsonpatch[_0x0dbd('0x20')](_0x134055,_0x5087d3,!![]);}catch(_0x55a4e4){return BPromise['reject'](_0x55a4e4);}return _0x134055[_0x0dbd('0x21')]();};}function saveUpdates(_0x6c7d3,_0x3b9fc6){return function(_0x50866a){if(_0x50866a){return _0x50866a['update'](_0x6c7d3)[_0x0dbd('0x22')](function(_0x2eb28e){return _0x2eb28e;});}return null;};}function removeEntity(_0x4e5f3e,_0x5bea28){return function(_0x3d821a){if(_0x3d821a){return _0x3d821a[_0x0dbd('0x23')]()['then'](function(){_0x4e5f3e[_0x0dbd('0x1b')](0xcc)[_0x0dbd('0x1a')]();});}};}function handleEntityNotFound(_0x18edd1,_0x524a84){return function(_0x16a21c){if(!_0x16a21c){_0x18edd1[_0x0dbd('0x19')](0x194);}return _0x16a21c;};}function handleError(_0x49d8f0,_0x328eba){_0x328eba=_0x328eba||0x1f4;return function(_0x380ff0){logger[_0x0dbd('0x24')](_0x380ff0[_0x0dbd('0x25')]);if(_0x380ff0[_0x0dbd('0x26')]){delete _0x380ff0['name'];}_0x49d8f0[_0x0dbd('0x1b')](_0x328eba)[_0x0dbd('0x27')](_0x380ff0);};}exports[_0x0dbd('0x28')]=function(_0x1e528f,_0x445601){var _0x464d99={},_0x4938d9={},_0x5dd8cd={'count':0x0,'rows':[]};var _0x47dce1=_[_0x0dbd('0x29')](db['FaxApplication'][_0x0dbd('0x2a')],function(_0x518cff){return{'name':_0x518cff['fieldName'],'type':_0x518cff[_0x0dbd('0x2b')][_0x0dbd('0x2c')]};});_0x4938d9[_0x0dbd('0x2d')]=_[_0x0dbd('0x29')](_0x47dce1,'name');_0x4938d9[_0x0dbd('0x2e')]=_[_0x0dbd('0x2f')](_0x1e528f[_0x0dbd('0x2e')]);_0x4938d9['filters']=_[_0x0dbd('0x30')](_0x4938d9[_0x0dbd('0x2d')],_0x4938d9[_0x0dbd('0x2e')]);_0x464d99[_0x0dbd('0x31')]=_['intersection'](_0x4938d9[_0x0dbd('0x2d')],qs[_0x0dbd('0x32')](_0x1e528f[_0x0dbd('0x2e')][_0x0dbd('0x32')]));_0x464d99['attributes']=_0x464d99[_0x0dbd('0x31')][_0x0dbd('0x33')]?_0x464d99[_0x0dbd('0x31')]:_0x4938d9['model'];if(!_0x1e528f[_0x0dbd('0x2e')][_0x0dbd('0x34')](_0x0dbd('0x35'))){_0x464d99['limit']=qs[_0x0dbd('0x36')](_0x1e528f['query'][_0x0dbd('0x36')]);_0x464d99['offset']=qs['offset'](_0x1e528f['query']['offset']);}_0x464d99[_0x0dbd('0x37')]=qs[_0x0dbd('0x38')](_0x1e528f['query'][_0x0dbd('0x38')]);_0x464d99[_0x0dbd('0x39')]=qs['filters'](_[_0x0dbd('0x3a')](_0x1e528f[_0x0dbd('0x2e')],_0x4938d9[_0x0dbd('0x3b')]));if(_0x1e528f['query']['filter']){_0x464d99['where']=_[_0x0dbd('0x3c')](_0x464d99['where'],{'$or':_['map'](_0x47dce1,function(_0x21c248){if(_0x21c248['type']!==_0x0dbd('0x3d')){var _0x2f92e5={};_0x2f92e5[_0x21c248[_0x0dbd('0x26')]]={'$like':'%'+_0x1e528f[_0x0dbd('0x2e')][_0x0dbd('0x3e')]+'%'};return _0x2f92e5;}})});}_0x464d99=_[_0x0dbd('0x3c')]({},_0x464d99,_0x1e528f[_0x0dbd('0x3f')]);var _0xba4309={'where':_0x464d99[_0x0dbd('0x39')]};return db['FaxApplication'][_0x0dbd('0x40')](_0xba4309)[_0x0dbd('0x22')](function(_0x1a6cda){_0x5dd8cd[_0x0dbd('0x40')]=_0x1a6cda;if(_0x1e528f[_0x0dbd('0x2e')][_0x0dbd('0x41')]){_0x464d99[_0x0dbd('0x42')]=[{'all':!![]}];}return db[_0x0dbd('0x43')]['findAll'](_0x464d99);})[_0x0dbd('0x22')](function(_0x53b57f){_0x5dd8cd[_0x0dbd('0x44')]=_0x53b57f;return _0x5dd8cd;})[_0x0dbd('0x22')](respondWithFilteredResult(_0x445601,_0x464d99))['catch'](handleError(_0x445601,null));};exports[_0x0dbd('0x45')]=function(_0x3b9082,_0xd0a56e){var _0x13f6fa={'raw':!![],'where':{'id':_0x3b9082[_0x0dbd('0x46')]['id']}},_0x5197ee={};_0x5197ee['model']=_[_0x0dbd('0x2f')](db[_0x0dbd('0x43')][_0x0dbd('0x2a')]);_0x5197ee[_0x0dbd('0x2e')]=_[_0x0dbd('0x2f')](_0x3b9082['query']);_0x5197ee[_0x0dbd('0x3b')]=_[_0x0dbd('0x30')](_0x5197ee[_0x0dbd('0x2d')],_0x5197ee[_0x0dbd('0x2e')]);_0x13f6fa[_0x0dbd('0x31')]=_[_0x0dbd('0x30')](_0x5197ee[_0x0dbd('0x2d')],qs['fields'](_0x3b9082['query'][_0x0dbd('0x32')]));_0x13f6fa[_0x0dbd('0x31')]=_0x13f6fa[_0x0dbd('0x31')][_0x0dbd('0x33')]?_0x13f6fa['attributes']:_0x5197ee[_0x0dbd('0x2d')];if(_0x3b9082['query'][_0x0dbd('0x41')]){_0x13f6fa[_0x0dbd('0x42')]=[{'all':!![]}];}_0x13f6fa=_['merge']({},_0x13f6fa,_0x3b9082['options']);return db[_0x0dbd('0x43')]['find'](_0x13f6fa)[_0x0dbd('0x22')](handleEntityNotFound(_0xd0a56e,null))['then'](respondWithResult(_0xd0a56e,null))[_0x0dbd('0x47')](handleError(_0xd0a56e,null));};exports[_0x0dbd('0x48')]=function(_0x1ee46d,_0x16f6b8){return db['FaxApplication'][_0x0dbd('0x48')](_0x1ee46d[_0x0dbd('0x49')],{})['then'](respondWithResult(_0x16f6b8,0xc9))[_0x0dbd('0x47')](handleError(_0x16f6b8,null));};exports[_0x0dbd('0x4a')]=function(_0x156049,_0x11cfc1){if(_0x156049['body']['id']){delete _0x156049[_0x0dbd('0x49')]['id'];}return db[_0x0dbd('0x43')][_0x0dbd('0x4b')]({'where':{'id':_0x156049[_0x0dbd('0x46')]['id']}})['then'](handleEntityNotFound(_0x11cfc1,null))['then'](saveUpdates(_0x156049[_0x0dbd('0x49')],null))[_0x0dbd('0x22')](respondWithResult(_0x11cfc1,null))['catch'](handleError(_0x11cfc1,null));};exports[_0x0dbd('0x23')]=function(_0x560083,_0x1bfb2a){return db[_0x0dbd('0x43')][_0x0dbd('0x4b')]({'where':{'id':_0x560083[_0x0dbd('0x46')]['id']}})[_0x0dbd('0x22')](handleEntityNotFound(_0x1bfb2a,null))[_0x0dbd('0x22')](removeEntity(_0x1bfb2a,null))['catch'](handleError(_0x1bfb2a,null));}; \ No newline at end of file +var _0x4b47=['Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','rawAttributes','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','map','options','FaxApplication','includeAll','include','rows','catch','show','params','keys','find','create','update','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','limit','set'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x4b47,0x1b4));var _0x74b4=function(_0x4f1b36,_0x46c41a){_0x4f1b36=_0x4f1b36-0x0;var _0x2b0391=_0x4b47[_0x4f1b36];return _0x2b0391;};'use strict';var pdf=require(_0x74b4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x74b4('0x1'));var zipdir=require(_0x74b4('0x2'));var jsonpatch=require(_0x74b4('0x3'));var rp=require(_0x74b4('0x4'));var moment=require(_0x74b4('0x5'));var BPromise=require(_0x74b4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x74b4('0x7'));var sox=require(_0x74b4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x74b4('0x9'));var crypto=require(_0x74b4('0xa'));var jsforce=require(_0x74b4('0xb'));var deskjs=require(_0x74b4('0xc'));var toCsv=require(_0x74b4('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74b4('0xe'));var authService=require(_0x74b4('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b4('0x10'))(_0x74b4('0x11'));var utils=require(_0x74b4('0x12'));var config=require(_0x74b4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30c59f,_0x5467da){_0x5467da=_0x5467da||0xcc;return function(_0x2b9511){if(_0x2b9511){return _0x30c59f['sendStatus'](_0x5467da);}return _0x30c59f[_0x74b4('0x14')](_0x5467da)[_0x74b4('0x15')]();};}function respondWithResult(_0x46f195,_0x16405f){_0x16405f=_0x16405f||0xc8;return function(_0x5f18d9){if(_0x5f18d9){return _0x46f195[_0x74b4('0x14')](_0x16405f)[_0x74b4('0x16')](_0x5f18d9);}};}function respondWithFilteredResult(_0x549679,_0x2b3c3b){return function(_0x3b30cc){if(_0x3b30cc){var _0x3ce56f=_0x3b30cc[_0x74b4('0x17')],_0x29c91f=_0x2b3c3b['offset'],_0x59abe7=_0x2b3c3b['offset']+_0x2b3c3b[_0x74b4('0x18')],_0x1cde9a;if(_0x59abe7>=_0x3ce56f){_0x59abe7=_0x3ce56f;_0x1cde9a=0xc8;}else{_0x1cde9a=0xce;}_0x549679[_0x74b4('0x14')](_0x1cde9a);return _0x549679[_0x74b4('0x19')](_0x74b4('0x1a'),_0x29c91f+'-'+_0x59abe7+'/'+_0x3ce56f)[_0x74b4('0x16')](_0x3b30cc);}return null;};}function patchUpdates(_0x315a51){return function(_0x2928a8){try{jsonpatch[_0x74b4('0x1b')](_0x2928a8,_0x315a51,!![]);}catch(_0xf1a841){return BPromise[_0x74b4('0x1c')](_0xf1a841);}return _0x2928a8['save']();};}function saveUpdates(_0x4d9619,_0x3d74d4){return function(_0x4e2de4){if(_0x4e2de4){return _0x4e2de4['update'](_0x4d9619)[_0x74b4('0x1d')](function(_0x599a93){return _0x599a93;});}return null;};}function removeEntity(_0x4e93e3,_0x36815a){return function(_0x437f79){if(_0x437f79){return _0x437f79[_0x74b4('0x1e')]()[_0x74b4('0x1d')](function(){_0x4e93e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb429b0,_0x3cc297){return function(_0x4f316a){if(!_0x4f316a){_0xb429b0[_0x74b4('0x1f')](0x194);}return _0x4f316a;};}function handleError(_0x22d68f,_0x160356){_0x160356=_0x160356||0x1f4;return function(_0x5c2b50){logger['error'](_0x5c2b50[_0x74b4('0x20')]);if(_0x5c2b50[_0x74b4('0x21')]){delete _0x5c2b50['name'];}_0x22d68f[_0x74b4('0x14')](_0x160356)[_0x74b4('0x22')](_0x5c2b50);};}exports[_0x74b4('0x23')]=function(_0x1a710a,_0xfbb9e3){var _0x4ea739={},_0x4fd6e5={},_0x246fc1={'count':0x0,'rows':[]};var _0x39d864=_['map'](db['FaxApplication'][_0x74b4('0x24')],function(_0x223238){return{'name':_0x223238['fieldName'],'type':_0x223238['type']['key']};});_0x4fd6e5['model']=_['map'](_0x39d864,_0x74b4('0x21'));_0x4fd6e5[_0x74b4('0x25')]=_['keys'](_0x1a710a[_0x74b4('0x25')]);_0x4fd6e5[_0x74b4('0x26')]=_[_0x74b4('0x27')](_0x4fd6e5[_0x74b4('0x28')],_0x4fd6e5[_0x74b4('0x25')]);_0x4ea739['attributes']=_[_0x74b4('0x27')](_0x4fd6e5[_0x74b4('0x28')],qs['fields'](_0x1a710a[_0x74b4('0x25')][_0x74b4('0x29')]));_0x4ea739[_0x74b4('0x2a')]=_0x4ea739[_0x74b4('0x2a')][_0x74b4('0x2b')]?_0x4ea739[_0x74b4('0x2a')]:_0x4fd6e5[_0x74b4('0x28')];if(!_0x1a710a['query'][_0x74b4('0x2c')](_0x74b4('0x2d'))){_0x4ea739[_0x74b4('0x18')]=qs['limit'](_0x1a710a[_0x74b4('0x25')][_0x74b4('0x18')]);_0x4ea739[_0x74b4('0x2e')]=qs[_0x74b4('0x2e')](_0x1a710a[_0x74b4('0x25')][_0x74b4('0x2e')]);}_0x4ea739['order']=qs['sort'](_0x1a710a[_0x74b4('0x25')][_0x74b4('0x2f')]);_0x4ea739[_0x74b4('0x30')]=qs[_0x74b4('0x26')](_[_0x74b4('0x31')](_0x1a710a[_0x74b4('0x25')],_0x4fd6e5['filters']));if(_0x1a710a[_0x74b4('0x25')][_0x74b4('0x32')]){_0x4ea739['where']=_[_0x74b4('0x33')](_0x4ea739[_0x74b4('0x30')],{'$or':_[_0x74b4('0x34')](_0x39d864,function(_0x5a11b3){if(_0x5a11b3['type']!=='VIRTUAL'){var _0x5bbfc1={};_0x5bbfc1[_0x5a11b3[_0x74b4('0x21')]]={'$like':'%'+_0x1a710a['query'][_0x74b4('0x32')]+'%'};return _0x5bbfc1;}})});}_0x4ea739=_[_0x74b4('0x33')]({},_0x4ea739,_0x1a710a[_0x74b4('0x35')]);var _0x3edd05={'where':_0x4ea739['where']};return db[_0x74b4('0x36')][_0x74b4('0x17')](_0x3edd05)[_0x74b4('0x1d')](function(_0x20e588){_0x246fc1[_0x74b4('0x17')]=_0x20e588;if(_0x1a710a[_0x74b4('0x25')][_0x74b4('0x37')]){_0x4ea739[_0x74b4('0x38')]=[{'all':!![]}];}return db[_0x74b4('0x36')]['findAll'](_0x4ea739);})['then'](function(_0x1baf60){_0x246fc1[_0x74b4('0x39')]=_0x1baf60;return _0x246fc1;})[_0x74b4('0x1d')](respondWithFilteredResult(_0xfbb9e3,_0x4ea739))[_0x74b4('0x3a')](handleError(_0xfbb9e3,null));};exports[_0x74b4('0x3b')]=function(_0x21ae79,_0x5d6171){var _0x166270={'raw':!![],'where':{'id':_0x21ae79[_0x74b4('0x3c')]['id']}},_0x23268e={};_0x23268e[_0x74b4('0x28')]=_[_0x74b4('0x3d')](db[_0x74b4('0x36')][_0x74b4('0x24')]);_0x23268e['query']=_[_0x74b4('0x3d')](_0x21ae79[_0x74b4('0x25')]);_0x23268e[_0x74b4('0x26')]=_['intersection'](_0x23268e['model'],_0x23268e[_0x74b4('0x25')]);_0x166270[_0x74b4('0x2a')]=_[_0x74b4('0x27')](_0x23268e['model'],qs[_0x74b4('0x29')](_0x21ae79[_0x74b4('0x25')][_0x74b4('0x29')]));_0x166270[_0x74b4('0x2a')]=_0x166270[_0x74b4('0x2a')][_0x74b4('0x2b')]?_0x166270[_0x74b4('0x2a')]:_0x23268e[_0x74b4('0x28')];if(_0x21ae79[_0x74b4('0x25')][_0x74b4('0x37')]){_0x166270[_0x74b4('0x38')]=[{'all':!![]}];}_0x166270=_['merge']({},_0x166270,_0x21ae79[_0x74b4('0x35')]);return db[_0x74b4('0x36')][_0x74b4('0x3e')](_0x166270)[_0x74b4('0x1d')](handleEntityNotFound(_0x5d6171,null))[_0x74b4('0x1d')](respondWithResult(_0x5d6171,null))[_0x74b4('0x3a')](handleError(_0x5d6171,null));};exports[_0x74b4('0x3f')]=function(_0x18632b,_0x216180){return db[_0x74b4('0x36')]['create'](_0x18632b['body'],{})['then'](respondWithResult(_0x216180,0xc9))[_0x74b4('0x3a')](handleError(_0x216180,null));};exports[_0x74b4('0x40')]=function(_0x481fa3,_0x209230){if(_0x481fa3[_0x74b4('0x41')]['id']){delete _0x481fa3[_0x74b4('0x41')]['id'];}return db[_0x74b4('0x36')]['find']({'where':{'id':_0x481fa3[_0x74b4('0x3c')]['id']}})[_0x74b4('0x1d')](handleEntityNotFound(_0x209230,null))[_0x74b4('0x1d')](saveUpdates(_0x481fa3[_0x74b4('0x41')],null))[_0x74b4('0x1d')](respondWithResult(_0x209230,null))['catch'](handleError(_0x209230,null));};exports[_0x74b4('0x1e')]=function(_0x57af55,_0x19f677){return db[_0x74b4('0x36')][_0x74b4('0x3e')]({'where':{'id':_0x57af55[_0x74b4('0x3c')]['id']}})[_0x74b4('0x1d')](handleEntityNotFound(_0x19f677,null))[_0x74b4('0x1d')](removeEntity(_0x19f677,null))[_0x74b4('0x3a')](handleError(_0x19f677,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index fd0912c..0971852 100644 --- a/server/api/faxApplication/faxApplication.model.js +++ b/server/api/faxApplication/faxApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa612=['moment','bluebird','request-promise','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1d1746,_0x2ab0ad){var _0x167cba=function(_0x4bac48){while(--_0x4bac48){_0x1d1746['push'](_0x1d1746['shift']());}};_0x167cba(++_0x2ab0ad);}(_0xa612,0x176));var _0x2a61=function(_0x1df657,_0x9203fa){_0x1df657=_0x1df657-0x0;var _0x8f3bde=_0xa612[_0x1df657];return _0x8f3bde;};'use strict';var _=require(_0x2a61('0x0'));var util=require(_0x2a61('0x1'));var logger=require('../../config/logger')(_0x2a61('0x2'));var moment=require(_0x2a61('0x3'));var BPromise=require(_0x2a61('0x4'));var rp=require(_0x2a61('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a61('0x6'));var attributes=require(_0x2a61('0x7'));module[_0x2a61('0x8')]=function(_0x29731c,_0x1a835e){return _0x29731c[_0x2a61('0x9')]('FaxApplication',attributes,{'tableName':_0x2a61('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2a61('0xb'),'collate':_0x2a61('0xc')});}; \ No newline at end of file +var _0xf4b0=['utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','exports','define','FaxApplication','fax_applications'];(function(_0xfc4cd8,_0x25007c){var _0x110fc0=function(_0x4a33ec){while(--_0x4a33ec){_0xfc4cd8['push'](_0xfc4cd8['shift']());}};_0x110fc0(++_0x25007c);}(_0xf4b0,0x106));var _0x0f4b=function(_0x25822f,_0x428db7){_0x25822f=_0x25822f-0x0;var _0x321532=_0xf4b0[_0x25822f];return _0x321532;};'use strict';var _=require(_0x0f4b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0f4b('0x1'));var moment=require(_0x0f4b('0x2'));var BPromise=require(_0x0f4b('0x3'));var rp=require(_0x0f4b('0x4'));var fs=require('fs');var path=require(_0x0f4b('0x5'));var rimraf=require(_0x0f4b('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x0f4b('0x7')]=function(_0xcc50dc,_0x1dce0f){return _0xcc50dc[_0x0f4b('0x8')](_0x0f4b('0x9'),attributes,{'tableName':_0x0f4b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0f4b('0xb'),'collate':_0x0f4b('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 4276f55..4b3ab43 100644 --- a/server/api/faxApplication/faxApplication.rpc.js +++ b/server/api/faxApplication/faxApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee3c=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','limit','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x644560,_0x1783aa){var _0x41b76b=function(_0xff8c89){while(--_0xff8c89){_0x644560['push'](_0x644560['shift']());}};_0x41b76b(++_0x1783aa);}(_0xee3c,0x191));var _0xcee3=function(_0x1f872a,_0x312592){_0x1f872a=_0x1f872a-0x0;var _0x5d891b=_0xee3c[_0x1f872a];return _0x5d891b;};'use strict';var _=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var moment=require(_0xcee3('0x2'));var BPromise=require(_0xcee3('0x3'));var rs=require(_0xcee3('0x4'));var fs=require('fs');var Redis=require(_0xcee3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcee3('0x6'))(_0xcee3('0x7'));var config=require(_0xcee3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcee3('0x9')][_0xcee3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x780a29,_0x4251fe,_0x40b45b){return new BPromise(function(_0x419318,_0x334910){return client[_0xcee3('0xb')](_0x780a29,_0x40b45b)['then'](function(_0x5560da){logger[_0xcee3('0xc')](_0xcee3('0xd'),_0x4251fe,_0xcee3('0xe'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x4251fe,'request\x20sent',JSON[_0xcee3('0xf')](_0x5560da));if(_0x5560da[_0xcee3('0x10')]){if(_0x5560da[_0xcee3('0x10')][_0xcee3('0x11')]===0x1f4){logger['error'](_0xcee3('0xd'),_0x4251fe,_0x5560da[_0xcee3('0x10')][_0xcee3('0x12')]);return _0x334910(_0x5560da[_0xcee3('0x10')]['message']);}logger[_0xcee3('0x10')](_0xcee3('0xd'),_0x4251fe,_0x5560da['error'][_0xcee3('0x12')]);return _0x419318(_0x5560da[_0xcee3('0x10')][_0xcee3('0x12')]);}else{logger[_0xcee3('0xc')]('FaxApplication,\x20%s,\x20%s',_0x4251fe,'request\x20sent');_0x419318(_0x5560da[_0xcee3('0x13')]['message']);}})[_0xcee3('0x14')](function(_0x48eaeb){logger[_0xcee3('0x10')](_0xcee3('0xd'),_0x4251fe,_0x48eaeb);_0x334910(_0x48eaeb);});});}exports[_0xcee3('0x15')]=function(_0x4109d0){var _0x2d19a5=this;return new Promise(function(_0xce6ed1,_0x419b45){return db['FaxApplication'][_0xcee3('0x16')](_0x4109d0[_0xcee3('0x17')],{'raw':_0x4109d0[_0xcee3('0x18')]?_0x4109d0[_0xcee3('0x18')][_0xcee3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4109d0[_0xcee3('0x18')]?_0x4109d0['options'][_0xcee3('0x1a')]||null:null,'attributes':_0x4109d0[_0xcee3('0x18')]?_0x4109d0['options']['attributes']||null:null,'limit':_0x4109d0[_0xcee3('0x18')]?_0x4109d0[_0xcee3('0x18')][_0xcee3('0x1b')]||null:null})['then'](function(_0xf8d1e){logger['info']('UpdateFaxApplication',_0x4109d0);logger[_0xcee3('0x1c')](_0xcee3('0x15'),_0x4109d0,JSON[_0xcee3('0xf')](_0xf8d1e));_0xce6ed1(_0xf8d1e);})[_0xcee3('0x14')](function(_0x48e606){logger[_0xcee3('0x10')](_0xcee3('0x15'),_0x48e606[_0xcee3('0x12')],_0x4109d0);_0x419b45(_0x2d19a5[_0xcee3('0x10')](0x1f4,_0x48e606[_0xcee3('0x12')]));});});}; \ No newline at end of file +var _0x5a78=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x921bfb,_0x429a9f){var _0x34ccea=function(_0x39d9d6){while(--_0x39d9d6){_0x921bfb['push'](_0x921bfb['shift']());}};_0x34ccea(++_0x429a9f);}(_0x5a78,0xaf));var _0x85a7=function(_0x5c08ee,_0x5177b1){_0x5c08ee=_0x5c08ee-0x0;var _0x156382=_0x5a78[_0x5c08ee];return _0x156382;};'use strict';var _=require(_0x85a7('0x0'));var util=require(_0x85a7('0x1'));var moment=require(_0x85a7('0x2'));var BPromise=require(_0x85a7('0x3'));var rs=require(_0x85a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85a7('0x5'))['db'];var utils=require(_0x85a7('0x6'));var logger=require(_0x85a7('0x7'))(_0x85a7('0x8'));var config=require(_0x85a7('0x9'));var jayson=require(_0x85a7('0xa'));var client=jayson[_0x85a7('0xb')][_0x85a7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56b4f6,_0xa50085,_0x50b47b){return new BPromise(function(_0xf8eae7,_0x4da35f){return client[_0x85a7('0xd')](_0x56b4f6,_0x50b47b)[_0x85a7('0xe')](function(_0x380f7b){logger['info']('FaxApplication,\x20%s,\x20%s',_0xa50085,_0x85a7('0xf'));logger[_0x85a7('0x10')](_0x85a7('0x11'),_0xa50085,_0x85a7('0xf'),JSON[_0x85a7('0x12')](_0x380f7b));if(_0x380f7b[_0x85a7('0x13')]){if(_0x380f7b[_0x85a7('0x13')]['code']===0x1f4){logger[_0x85a7('0x13')](_0x85a7('0x14'),_0xa50085,_0x380f7b['error'][_0x85a7('0x15')]);return _0x4da35f(_0x380f7b['error'][_0x85a7('0x15')]);}logger[_0x85a7('0x13')]('FaxApplication,\x20%s,\x20%s',_0xa50085,_0x380f7b['error'][_0x85a7('0x15')]);return _0xf8eae7(_0x380f7b[_0x85a7('0x13')][_0x85a7('0x15')]);}else{logger['info'](_0x85a7('0x14'),_0xa50085,_0x85a7('0xf'));_0xf8eae7(_0x380f7b['result'][_0x85a7('0x15')]);}})[_0x85a7('0x16')](function(_0x530e72){logger['error'](_0x85a7('0x14'),_0xa50085,_0x530e72);_0x4da35f(_0x530e72);});});}exports[_0x85a7('0x17')]=function(_0x2521ef){var _0x44d489=this;return new Promise(function(_0x3a3163,_0x57bcd1){return db[_0x85a7('0x18')][_0x85a7('0x19')](_0x2521ef[_0x85a7('0x1a')],{'raw':_0x2521ef[_0x85a7('0x1b')]?_0x2521ef[_0x85a7('0x1b')][_0x85a7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2521ef[_0x85a7('0x1b')]?_0x2521ef[_0x85a7('0x1b')]['where']||null:null,'attributes':_0x2521ef[_0x85a7('0x1b')]?_0x2521ef[_0x85a7('0x1b')][_0x85a7('0x1d')]||null:null,'limit':_0x2521ef['options']?_0x2521ef[_0x85a7('0x1b')][_0x85a7('0x1e')]||null:null})[_0x85a7('0xe')](function(_0x3e14bc){logger[_0x85a7('0x1f')](_0x85a7('0x17'),_0x2521ef);logger[_0x85a7('0x10')](_0x85a7('0x17'),_0x2521ef,JSON[_0x85a7('0x12')](_0x3e14bc));_0x3a3163(_0x3e14bc);})['catch'](function(_0x52d261){logger[_0x85a7('0x13')](_0x85a7('0x17'),_0x52d261[_0x85a7('0x15')],_0x2521ef);_0x57bcd1(_0x44d489[_0x85a7('0x13')](0x1f4,_0x52d261[_0x85a7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 335ad50..d7994f6 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7da7=['util','path','Router','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7da7,0x10d));var _0x77da=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x7da7[_0x37ffea];return _0x2e2615;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var auth=require(_0x77da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77da('0x5'));var controller=require(_0x77da('0x6'));router['get']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x8')]);router['get'](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0xb')]('/',auth[_0x77da('0x7')](),controller[_0x77da('0xc')]);router[_0x77da('0xd')]('/:id',auth[_0x77da('0x7')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id',auth[_0x77da('0x7')](),controller[_0x77da('0x10')]);module[_0x77da('0x11')]=router; \ No newline at end of file +var _0xe14b=['show','put','update','destroy','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x167589,_0xe9c4e0){var _0x2bf578=function(_0x203031){while(--_0x203031){_0x167589['push'](_0x167589['shift']());}};_0x2bf578(++_0xe9c4e0);}(_0xe14b,0x93));var _0xbe14=function(_0x2cd187,_0x2df9df){_0x2cd187=_0x2cd187-0x0;var _0x159090=_0xe14b[_0x2cd187];return _0x159090;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./faxApplication.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xb')]);router['delete']('/:id',auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9fc0f2f..731f2e4 100644 --- a/server/api/faxInteraction/faxInteraction.attributes.js +++ b/server/api/faxInteraction/faxInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7470=['sequelize','exports','DATE','STRING','ENUM','out'];(function(_0x30cee,_0x57b5f4){var _0x308a7f=function(_0x2342f1){while(--_0x2342f1){_0x30cee['push'](_0x30cee['shift']());}};_0x308a7f(++_0x57b5f4);}(_0x7470,0x17a));var _0x0747=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x7470[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0x0747('0x0'));module[_0x0747('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0747('0x2')]},'disposition':{'type':Sequelize[_0x0747('0x3')]},'note':{'type':Sequelize[_0x0747('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x0747('0x4')]('in',_0x0747('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0747('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0747('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x996a=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x3ccb09,_0x5b8d39){var _0x164102=function(_0x3ae7b0){while(--_0x3ae7b0){_0x3ccb09['push'](_0x3ccb09['shift']());}};_0x164102(++_0x5b8d39);}(_0x996a,0x178));var _0xa996=function(_0x320a3c,_0x49703b){_0x320a3c=_0x320a3c-0x0;var _0x1913ea=_0x996a[_0x320a3c];return _0x1913ea;};'use strict';var Sequelize=require(_0xa996('0x0'));module[_0xa996('0x1')]={'closed':{'type':Sequelize[_0xa996('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa996('0x3')]},'note':{'type':Sequelize[_0xa996('0x3')]},'read1stAt':{'type':Sequelize[_0xa996('0x4')]},'fax':{'type':Sequelize[_0xa996('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa996('0x5')]('in',_0xa996('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa996('0x5')]('in',_0xa996('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index f8ec61f..b3dd37f 100644 --- a/server/api/faxInteraction/faxInteraction.controller.js +++ b/server/api/faxInteraction/faxInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3750=['merge','options','create','describe','addMessage','ids','FaxMessage','map','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','emit','faxInteractionTags:save','removeTags','unix','join','root','files','attachments','server','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','createReadStream','createWriteStream','err','unlinkSync','sendStatus','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','redis','localhost','./faxInteraction.socket','status','end','json','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','Users','TagIds','Tags','split','push','index','FaxInteraction','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','select','field','color','from','tools_tags','u.id','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','search','parseSearch','sqlOperator','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','isEmpty','forEach','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','isArray','filter','\x27\x27\x27\x27','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','user','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.mobile','Contact.fax','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','catch','params','includeAll','include'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3750,0xdb));var _0x0375=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x3750[_0x10dc60];return _0x47dec5;};'use strict';var pdf=require(_0x0375('0x0'));var emlformat=require(_0x0375('0x1'));var rimraf=require(_0x0375('0x2'));var zipdir=require(_0x0375('0x3'));var jsonpatch=require(_0x0375('0x4'));var rp=require(_0x0375('0x5'));var moment=require('moment');var BPromise=require(_0x0375('0x6'));var Mustache=require(_0x0375('0x7'));var util=require('util');var path=require(_0x0375('0x8'));var sox=require(_0x0375('0x9'));var csv=require(_0x0375('0xa'));var ejs=require(_0x0375('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0375('0xc'));var crypto=require(_0x0375('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0375('0xa'));var querystring=require(_0x0375('0xe'));var Papa=require(_0x0375('0xf'));var Redis=require('ioredis');var authService=require(_0x0375('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0375('0x11'));var hardwareService=require(_0x0375('0x12'));var logger=require('../../config/logger')(_0x0375('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0375('0x14')]=_['defaults'](config[_0x0375('0x14')],{'host':_0x0375('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0375('0x14')]));require(_0x0375('0x16'))['register'](socket);function respondWithStatusCode(_0x410d9e,_0x221781){_0x221781=_0x221781||0xcc;return function(_0x2023c8){if(_0x2023c8){return _0x410d9e['sendStatus'](_0x221781);}return _0x410d9e[_0x0375('0x17')](_0x221781)[_0x0375('0x18')]();};}function respondWithResult(_0x28d44f,_0x500e84){_0x500e84=_0x500e84||0xc8;return function(_0x56cbfd){if(_0x56cbfd){return _0x28d44f[_0x0375('0x17')](_0x500e84)[_0x0375('0x19')](_0x56cbfd);}};}function respondWithFilteredResult(_0x35e59a,_0x15c6d6){return function(_0x3bb188){if(_0x3bb188){var _0x2afa7b=_0x3bb188[_0x0375('0x1a')],_0x180e20=_0x15c6d6[_0x0375('0x1b')],_0x265afc=_0x15c6d6['offset']+_0x15c6d6['limit'],_0x2318c1;if(_0x265afc>=_0x2afa7b){_0x265afc=_0x2afa7b;_0x2318c1=0xc8;}else{_0x2318c1=0xce;}_0x35e59a[_0x0375('0x17')](_0x2318c1);return _0x35e59a[_0x0375('0x1c')](_0x0375('0x1d'),_0x180e20+'-'+_0x265afc+'/'+_0x2afa7b)['json'](_0x3bb188);}return null;};}function patchUpdates(_0xde1af2){return function(_0x5307b8){try{jsonpatch['apply'](_0x5307b8,_0xde1af2,!![]);}catch(_0x265dec){return BPromise['reject'](_0x265dec);}return _0x5307b8[_0x0375('0x1e')]();};}function saveUpdates(_0x1e4dd4,_0x467d60){return function(_0x5e00e2){if(_0x5e00e2){return _0x5e00e2[_0x0375('0x1f')](_0x1e4dd4)[_0x0375('0x20')](function(_0x28f591){return _0x28f591;});}return null;};}function removeEntity(_0xde5c31,_0x264973){return function(_0x3c8787){if(_0x3c8787){return _0x3c8787[_0x0375('0x21')]()['then'](function(){_0xde5c31['status'](0xcc)[_0x0375('0x18')]();});}};}function handleEntityNotFound(_0x2403d3,_0x29d55c){return function(_0x199c11){if(!_0x199c11){_0x2403d3['sendStatus'](0x194);}return _0x199c11;};}function handleError(_0xd9a864,_0x4019d5){_0x4019d5=_0x4019d5||0x1f4;return function(_0x29692e){logger[_0x0375('0x22')](_0x29692e[_0x0375('0x23')]);if(_0x29692e[_0x0375('0x24')]){delete _0x29692e[_0x0375('0x24')];}_0xd9a864[_0x0375('0x17')](_0x4019d5)['send'](_0x29692e);};}function getInteractionUsers(_0x5173aa,_0x466737){return new BPromise(function(_0x20a5e9,_0x467358){try{if(_0x466737[_0x5173aa['id']]){_0x5173aa[_0x0375('0x25')]=_['map'](_0x466737[_0x5173aa['id']],function(_0x2587c9){return{'id':_0x2587c9['id']};});}}catch(_0x3b0b04){_0x467358(_0x3b0b04);}_0x20a5e9(_0x5173aa);});}function getInteractionTags(_0x1c652e,_0x305383){return new BPromise(function(_0x24e721,_0x480c3f){try{if(_0x1c652e[_0x0375('0x26')]){_0x1c652e[_0x0375('0x27')]=[];_0x1c652e[_0x0375('0x26')][_0x0375('0x28')](',')['forEach'](function(_0x3a458b){_0x1c652e[_0x0375('0x27')][_0x0375('0x29')](_0x305383[_0x3a458b]);});}delete _0x1c652e[_0x0375('0x26')];}catch(_0x4b1c0b){_0x480c3f(_0x4b1c0b);}_0x24e721(_0x1c652e);});}function updateFaxInteraction(_0x2903e0,_0x4851d8,_0x4e16b8){return new BPromise(function(_0x423928,_0x34bb61){return getInteractionUsers(_0x2903e0,_0x4e16b8)[_0x0375('0x20')](function(_0x4fdcd0){return getInteractionTags(_0x4fdcd0,_0x4851d8);})[_0x0375('0x20')](function(_0x8ece89){_0x423928(_0x8ece89);})['catch'](function(_0xd71c2b){_0x34bb61(_0xd71c2b);});});}exports[_0x0375('0x2a')]=function(_0xa946b8,_0x8b9305){var _0x258468={},_0x1ff664={},_0x54c4be={'count':0x0,'rows':[]};var _0x10f595=_['map'](db[_0x0375('0x2b')][_0x0375('0x2c')],function(_0xf9ffaf){return{'name':_0xf9ffaf['fieldName'],'type':_0xf9ffaf['type'][_0x0375('0x2d')]};});_0x1ff664[_0x0375('0x2e')]=_['map'](_0x10f595,_0x0375('0x24'));_0x1ff664[_0x0375('0x2f')]=_[_0x0375('0x30')](_0xa946b8[_0x0375('0x2f')]);_0x1ff664['filters']=_[_0x0375('0x31')](_0x1ff664[_0x0375('0x2e')],_0x1ff664[_0x0375('0x2f')]);_0x258468[_0x0375('0x32')]=_['intersection'](_0x1ff664['model'],qs[_0x0375('0x33')](_0xa946b8['query'][_0x0375('0x33')]));_0x258468[_0x0375('0x32')]=_0x258468[_0x0375('0x32')][_0x0375('0x34')]?_0x258468[_0x0375('0x32')]:_0x1ff664['model'];if(!_0xa946b8[_0x0375('0x2f')][_0x0375('0x35')](_0x0375('0x36'))){_0x258468['limit']=qs[_0x0375('0x37')](_0xa946b8['query'][_0x0375('0x37')]);_0x258468[_0x0375('0x1b')]=qs[_0x0375('0x1b')](_0xa946b8[_0x0375('0x2f')][_0x0375('0x1b')]);}_0x258468[_0x0375('0x38')]=qs[_0x0375('0x39')](_0xa946b8[_0x0375('0x2f')]['sort']);_0x258468['where']=qs['filters'](_[_0x0375('0x3a')](_0xa946b8['query'],_0x1ff664[_0x0375('0x3b')]));var _0xe3a163=[];var _0x681f2d=squel[_0x0375('0x3c')]()[_0x0375('0x3d')]('id')['field']('name')['field'](_0x0375('0x3e'))[_0x0375('0x3f')](_0x0375('0x40'));var _0x323d85=squel[_0x0375('0x3c')]()['field'](_0x0375('0x41'))[_0x0375('0x3d')]('ui.FaxInteractionId')[_0x0375('0x3f')](_0x0375('0x42'),'ui')[_0x0375('0x43')](_0x0375('0x44'),'u',_0x0375('0x45'));var _0x43da9c=squel[_0x0375('0x3c')]()[_0x0375('0x3f')](_0x0375('0x46'),'i')[_0x0375('0x43')]('cm_contacts','c',_0x0375('0x47'))['left_join'](_0x0375('0x44'),'o',_0x0375('0x48'))[_0x0375('0x43')](_0x0375('0x49'),'a',_0x0375('0x4a'))[_0x0375('0x43')](_0x0375('0x4b'),'me',_0x0375('0x4c'))[_0x0375('0x43')](_0x0375('0x4d'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x0375('0x43')](_0x0375('0x40'),'t','t.id\x20=\x20it.TagId');var _0x127d5a=squel['expr']();var _0xc57ba6=[];var _0x52aca4=squel['expr']();var _0x3d027d;if(_0xa946b8['query'][_0x0375('0x4e')]){_0x3d027d=as[_0x0375('0x4f')](_0xa946b8['query'][_0x0375('0x4e')]);var _0x25d409=_0x3d027d[_0x0375('0x50')];for(var _0x38a09c=0x0;_0x38a09c<_0x3d027d['conditions'][_0x0375('0x34')];_0x38a09c++){var _0x175e48=_0x3d027d['conditions'][_0x38a09c];var _0x55807b='i';var _0x4ffa75=_[_0x0375('0x51')](_0x10f595,[_0x0375('0x24'),_0x175e48[_0x0375('0x3d')]]);if(!_0x4ffa75){switch(_0x175e48[_0x0375('0x3d')]){case _0x0375('0x52'):if(_0x175e48[_0x0375('0x53')]==0x1){_0x43da9c['having']('`'+_0x175e48[_0x0375('0x3d')]+_0x0375('0x54'));}else{_0x43da9c['having']('`'+_0x175e48[_0x0375('0x3d')]+_0x0375('0x55'));}break;case _0x0375('0x56'):if(_0x175e48[_0x0375('0x57')]==='$substring'){if(_0x175e48['value'][_0x0375('0x28')]('\x20')[_0x0375('0x34')]>0x1){_0x127d5a[_0x25d409](_0x0375('0x58'),qs[_0x0375('0x59')](_0x175e48[_0x0375('0x53')]),null);}else{var _0x4739ee='%'+_0x175e48[_0x0375('0x53')]+'%';_0x127d5a[_0x25d409](_0x0375('0x5a'),_0x4739ee,_0x4739ee,_0x4739ee);}}else{_0x4ffa75=_[_0x0375('0x51')](_0x10f595,[_0x0375('0x24'),_0x0375('0x5b')]);_0x175e48[_0x0375('0x3d')]='ContactId';_0x5352d5=as[_0x0375('0x5c')](_0x55807b,_0x4ffa75[_0x0375('0x5d')],_0x175e48);_0x127d5a[_0x25d409](_0x5352d5[_0x0375('0x5e')],_0x5352d5[_0x0375('0x53')][_0x0375('0x5f')],_0x5352d5[_0x0375('0x53')][_0x0375('0x18')]);}break;case _0x0375('0x60'):var _0x26a517=_0x175e48[_0x0375('0x53')][_0x0375('0x28')](',')['map'](function(_0x1f53dc){return Number(_0x1f53dc);});_0x26a517['forEach'](function(_0x21d9ad){_0x52aca4['or'](_0x0375('0x61'),'%,'+_0x21d9ad+',%');});_0xc57ba6=_[_0x0375('0x62')](_0xc57ba6,_0x26a517);break;case _0x0375('0x63'):if(_0x175e48[_0x0375('0x57')]===_0x0375('0x64')){_0x127d5a[_0x25d409](_0x0375('0x65'),'%'+_0x175e48[_0x0375('0x53')]+'%',null);}else{_0x4ffa75=_[_0x0375('0x51')](_0x10f595,['name',_0x0375('0x66')]);_0x175e48[_0x0375('0x3d')]=_0x0375('0x66');_0x5352d5=as[_0x0375('0x5c')](_0x55807b,_0x4ffa75[_0x0375('0x5d')],_0x175e48);_0x127d5a[_0x25d409](_0x5352d5['text'],_0x5352d5['value'][_0x0375('0x5f')],_0x5352d5[_0x0375('0x53')][_0x0375('0x18')]);}break;case _0x0375('0x67'):_0x5352d5=as['buildExpression']('me',null,_0x175e48);_0x127d5a[_0x25d409](_0x5352d5[_0x0375('0x5e')],_0x5352d5[_0x0375('0x53')][_0x0375('0x5f')],_0x5352d5[_0x0375('0x53')][_0x0375('0x18')]);break;}}else{var _0x5352d5=as[_0x0375('0x5c')](_0x55807b,_0x4ffa75[_0x0375('0x5d')],_0x175e48);_0x127d5a[_0x25d409](_0x5352d5[_0x0375('0x5e')],_0x5352d5[_0x0375('0x53')][_0x0375('0x5f')],_0x5352d5[_0x0375('0x53')]['end']);}}}else{var _0x149a66=_(_0xa946b8[_0x0375('0x2f')])[_0x0375('0x30')]()['map'](function(_0x2740f2){return _['some'](_0x10f595,[_0x0375('0x24'),_0x2740f2])?_0x2740f2:undefined;})['compact']()[_0x0375('0x53')]();if(!_[_0x0375('0x68')](_0x149a66)){_0x149a66[_0x0375('0x69')](function(_0x5533f1){if(_0x5533f1===_0x0375('0x6a')){_0x43da9c[_0x0375('0x6b')](_0x0375('0x6c'),[][_0x0375('0x6d')](_0xa946b8[_0x0375('0x2f')][_0x5533f1]));}else if(_0x5533f1===_0x0375('0x6e')){var _0x2357d0=JSON[_0x0375('0x6f')](_0xa946b8[_0x0375('0x2f')][_0x5533f1])[_0x0375('0x70')];var _0x506e42=JSON[_0x0375('0x6f')](_0xa946b8['query'][_0x5533f1])[_0x0375('0x71')];_0x43da9c[_0x0375('0x6b')](_0x0375('0x72'),_0x2357d0,_0x506e42);}else{if(_0xa946b8[_0x0375('0x2f')][_0x5533f1]===_0x0375('0x73')){_0x43da9c[_0x0375('0x6b')]('i.'+_0x5533f1+'\x20IS\x20NULL');}else{_0x43da9c[_0x0375('0x6b')]('i.'+_0x5533f1+_0x0375('0x74'),_0xa946b8['query'][_0x5533f1]);}}});}if(_0xa946b8[_0x0375('0x2f')]['read']){if(_0xa946b8[_0x0375('0x2f')][_0x0375('0x75')]==0x1){_0x43da9c['having'](_0x0375('0x76'));}else{_0x43da9c[_0x0375('0x77')](_0x0375('0x78'));}}if(_0xa946b8['query'][_0x0375('0x79')]){_0xc57ba6=_[_0x0375('0x7a')](_0xa946b8[_0x0375('0x2f')][_0x0375('0x79')])?_0xa946b8[_0x0375('0x2f')][_0x0375('0x79')]:new Array(_0xa946b8[_0x0375('0x2f')]['tag']);_0xc57ba6['forEach'](function(_0x1f7184){_0x52aca4['or'](_0x0375('0x61'),'%,'+_0x1f7184+',%');});}if(_0xa946b8[_0x0375('0x2f')]['filter']){var _0x14f9ea=_0xa946b8[_0x0375('0x2f')][_0x0375('0x7b')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0375('0x7c'));if(qs['isNumeric'](_0x14f9ea)){_0x127d5a['or']('i.id\x20LIKE\x20?',_0x14f9ea+'%')['or']('i.fax\x20LIKE\x20?',_0x14f9ea+'%');}_0x127d5a['or'](_0x0375('0x7d'),_0x14f9ea+'%');}}_0x43da9c['where'](_0x127d5a);_0x43da9c[_0x0375('0x7e')](_0x0375('0x7f'));var _0x553fde={'type':db['Sequelize']['QueryTypes'][_0x0375('0x80')],'raw':!![]};var _0x4a6c87=_0x43da9c[_0x0375('0x81')]();_0x4a6c87[_0x0375('0x3d')](_0x0375('0x7f'));_0x4a6c87[_0x0375('0x3d')](_0x0375('0x82'),_0x0375('0x52'));if(_0x258468['order']){_0x258468[_0x0375('0x38')][_0x0375('0x69')](function(_0x4b55be){_0x43da9c[_0x0375('0x38')]('i.'+_0x4b55be[0x0],_0x4b55be[0x1]===_0x0375('0x83')?![]:!![]);});}if(!_[_0x0375('0x68')](_0xc57ba6)){_0x43da9c[_0x0375('0x77')](_0x52aca4);_0x4a6c87['where'](_0x0375('0x84'),_0xc57ba6);}BPromise['resolve']()[_0x0375('0x20')](function(){if(!_0x3d027d&&_0xa946b8[_0x0375('0x2f')][_0x0375('0x6a')])return;return _0xa946b8[_0x0375('0x85')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x0375('0x20')](function(_0x2b5a6b){if(_['isEmpty'](_0x2b5a6b)){_0x4a6c87[_0x0375('0x6b')](_0x0375('0x86'));_0x43da9c[_0x0375('0x6b')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x4a6c87[_0x0375('0x6b')](_0x0375('0x6c'),_['map'](_0x2b5a6b,'id'));_0x43da9c['where'](_0x0375('0x6c'),_['map'](_0x2b5a6b,'id'));}});})[_0x0375('0x20')](function(){db['sequelize'][_0x0375('0x2f')](_0x4a6c87[_0x0375('0x87')](),_0x553fde)[_0x0375('0x20')](function(_0x2b2532){_0x54c4be[_0x0375('0x1a')]=_0x2b2532[_0x0375('0x34')];if(_0x54c4be[_0x0375('0x1a')]===0x0)return[];return db[_0x0375('0x88')][_0x0375('0x2f')](_0x681f2d['toString'](),_0x553fde)[_0x0375('0x20')](function(_0x34e82e){_0xe3a163=_['keyBy'](_0x34e82e,'id');_0x553fde=_['merge'](_0x553fde,{'model':db[_0x0375('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xa946b8['query'][_0x0375('0x33')]){_0x258468[_0x0375('0x32')][_0x0375('0x69')](function(_0x7843ca){_0x43da9c[_0x0375('0x3d')]('i.'+_0x7843ca);});}else{_0x43da9c[_0x0375('0x3d')](_0x0375('0x82'),'unreadMessages');_0x43da9c[_0x0375('0x3d')](_0x0375('0x89'),_0x0375('0x8a'));_0x43da9c[_0x0375('0x3d')]('a.mandatoryDisposition',_0x0375('0x8b'));_0x43da9c['field'](_0x0375('0x8c'));_0x43da9c[_0x0375('0x3d')]('c.firstName',_0x0375('0x8d'));_0x43da9c['field'](_0x0375('0x8e'),_0x0375('0x8f'));_0x43da9c[_0x0375('0x3d')](_0x0375('0x90'),'Contact.email');_0x43da9c['field'](_0x0375('0x91'),'Contact.phone');_0x43da9c[_0x0375('0x3d')]('c.mobile',_0x0375('0x92'));_0x43da9c[_0x0375('0x3d')]('c.fax',_0x0375('0x93'));_0x43da9c[_0x0375('0x3d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0375('0x26'));}_0x43da9c['limit'](_0x258468[_0x0375('0x37')]);_0x43da9c[_0x0375('0x1b')](_0x258468[_0x0375('0x1b')]);return db['sequelize'][_0x0375('0x2f')](_0x43da9c['toString'](),_0x553fde);})[_0x0375('0x20')](function(_0x3ac55f){_0x323d85[_0x0375('0x6b')](_0x0375('0x94'),_['map'](_0x3ac55f,'id'));return db[_0x0375('0x88')][_0x0375('0x2f')](_0x323d85[_0x0375('0x87')](),_0x553fde)[_0x0375('0x20')](function(_0x436c71){var _0x255ce4=_[_0x0375('0x95')](_0x436c71,_0x0375('0x96'));var _0x442edd=[];_0x3ac55f['forEach'](function(_0x38756a){_0x442edd[_0x0375('0x29')](updateFaxInteraction(_0x38756a,_0xe3a163,_0x255ce4));});return BPromise[_0x0375('0x97')](_0x442edd);});});})[_0x0375('0x20')](function(_0x8224d6){_0x54c4be[_0x0375('0x98')]=_0x8224d6;return _0x54c4be;})[_0x0375('0x20')](respondWithFilteredResult(_0x8b9305,_0x258468));})[_0x0375('0x99')](handleError(_0x8b9305,null));};exports['show']=function(_0x39d848,_0x501498){var _0x31aba9={'raw':![],'where':{'id':_0x39d848[_0x0375('0x9a')]['id']}},_0x40368b={};_0x40368b[_0x0375('0x2e')]=_['keys'](db[_0x0375('0x2b')][_0x0375('0x2c')]);_0x40368b[_0x0375('0x2f')]=_[_0x0375('0x30')](_0x39d848[_0x0375('0x2f')]);_0x40368b[_0x0375('0x3b')]=_['intersection'](_0x40368b[_0x0375('0x2e')],_0x40368b[_0x0375('0x2f')]);_0x31aba9[_0x0375('0x32')]=_['intersection'](_0x40368b[_0x0375('0x2e')],qs['fields'](_0x39d848[_0x0375('0x2f')][_0x0375('0x33')]));_0x31aba9[_0x0375('0x32')]=_0x31aba9['attributes'][_0x0375('0x34')]?_0x31aba9[_0x0375('0x32')]:_0x40368b[_0x0375('0x2e')];if(_0x39d848[_0x0375('0x2f')][_0x0375('0x9b')]){_0x31aba9[_0x0375('0x9c')]=[{'all':!![]}];}_0x31aba9=_[_0x0375('0x9d')]({},_0x31aba9,_0x39d848[_0x0375('0x9e')]);return db[_0x0375('0x2b')][_0x0375('0x51')](_0x31aba9)[_0x0375('0x20')](handleEntityNotFound(_0x501498,null))[_0x0375('0x20')](respondWithResult(_0x501498,null))[_0x0375('0x99')](handleError(_0x501498,null));};exports[_0x0375('0x9f')]=function(_0x4a1dcf,_0x4b257f){return db['FaxInteraction'][_0x0375('0x9f')](_0x4a1dcf[_0x0375('0x67')],{})['then'](respondWithResult(_0x4b257f,0xc9))['catch'](handleError(_0x4b257f,null));};exports['update']=function(_0x425df4,_0x25deb2){if(_0x425df4[_0x0375('0x67')]['id']){delete _0x425df4[_0x0375('0x67')]['id'];}return db[_0x0375('0x2b')][_0x0375('0x51')]({'where':{'id':_0x425df4[_0x0375('0x9a')]['id']}})['then'](handleEntityNotFound(_0x25deb2,null))['then'](saveUpdates(_0x425df4[_0x0375('0x67')],null))['then'](respondWithResult(_0x25deb2,null))['catch'](handleError(_0x25deb2,null));};exports[_0x0375('0x21')]=function(_0x204638,_0x100f76){return db['FaxInteraction'][_0x0375('0x51')]({'where':{'id':_0x204638[_0x0375('0x9a')]['id']}})[_0x0375('0x20')](handleEntityNotFound(_0x100f76,null))[_0x0375('0x20')](removeEntity(_0x100f76,null))[_0x0375('0x99')](handleError(_0x100f76,null));};exports['describe']=function(_0x1e986a,_0x439d80){return db[_0x0375('0x2b')][_0x0375('0xa0')]()[_0x0375('0x20')](respondWithResult(_0x439d80,null))[_0x0375('0x99')](handleError(_0x439d80,null));};exports['addMessage']=function(_0x1bce7a,_0x503ed7,_0x41716f){return db['FaxMessage']['find']({'where':{'id':_0x1bce7a[_0x0375('0x9a')]['id']}})['then'](handleEntityNotFound(_0x503ed7,null))[_0x0375('0x20')](function(_0x55ed42){if(_0x55ed42){return _0x55ed42[_0x0375('0xa1')](_0x1bce7a[_0x0375('0x67')][_0x0375('0xa2')],_['omit'](_0x1bce7a[_0x0375('0x67')],[_0x0375('0xa2'),'id'])||{});}})['then'](respondWithResult(_0x503ed7,null))[_0x0375('0x99')](handleError(_0x503ed7,null));};exports['getMessages']=function(_0x58f5dd,_0x5624cb,_0x5f3b0b){var _0x46a952={'raw':![],'where':{}};var _0xaa8363={};var _0x9e1321={'count':0x0,'rows':[]};return db[_0x0375('0x2b')]['findOne']({'where':{'id':_0x58f5dd[_0x0375('0x9a')]['id']}})[_0x0375('0x20')](handleEntityNotFound(_0x5624cb,null))['then'](function(_0x48f900){if(_0x48f900){_0xaa8363['model']=_[_0x0375('0x30')](db[_0x0375('0xa3')]['rawAttributes']);_0xaa8363[_0x0375('0x2f')]=_['keys'](_0x58f5dd[_0x0375('0x2f')]);_0xaa8363['filters']=_['intersection'](_0xaa8363[_0x0375('0x2e')],_0xaa8363[_0x0375('0x2f')]);_0x46a952[_0x0375('0x32')]=_[_0x0375('0x31')](_0xaa8363[_0x0375('0x2e')],qs['fields'](_0x58f5dd[_0x0375('0x2f')]['fields']));_0x46a952['attributes']=_0x46a952['attributes']['length']?_0x46a952['attributes']:_0xaa8363[_0x0375('0x2e')];if(!_0x58f5dd[_0x0375('0x2f')][_0x0375('0x35')](_0x0375('0x36'))){_0x46a952[_0x0375('0x37')]=qs[_0x0375('0x37')](_0x58f5dd[_0x0375('0x2f')][_0x0375('0x37')]);_0x46a952[_0x0375('0x1b')]=qs['offset'](_0x58f5dd[_0x0375('0x2f')][_0x0375('0x1b')]);}_0x46a952[_0x0375('0x38')]=qs['sort'](_0x58f5dd[_0x0375('0x2f')][_0x0375('0x39')]);_0x46a952[_0x0375('0x6b')]=qs[_0x0375('0x3b')](_[_0x0375('0x3a')](_0x58f5dd[_0x0375('0x2f')],_0xaa8363[_0x0375('0x3b')]));_0x46a952[_0x0375('0x6b')]['FaxInteractionId']=_0x48f900['id'];if(_0x58f5dd[_0x0375('0x2f')]['filter']){_0x46a952['where']=_[_0x0375('0x9d')](_0x46a952[_0x0375('0x6b')],{'$or':_[_0x0375('0xa4')](_0x46a952['attributes'],function(_0x342bfe){var _0x12be65={};_0x12be65[_0x342bfe]={'$like':'%'+_0x58f5dd[_0x0375('0x2f')][_0x0375('0x7b')]+'%'};return _0x12be65;})});}if(_0x58f5dd['query']['$gte']){var _0x1adddf=_0x58f5dd[_0x0375('0x2f')][_0x0375('0x70')][_0x0375('0x28')](',');var _0x766596={};_0x766596[_0x1adddf[0x0]]={'$gte':moment(_0x1adddf[0x1])[_0x0375('0xa5')](_0x0375('0xa6'))};_0x46a952[_0x0375('0x6b')]=_[_0x0375('0x9d')](_0x46a952[_0x0375('0x6b')],_0x766596);}_0x46a952=_['merge']({},_0x46a952,_0x58f5dd['options']);return db[_0x0375('0xa3')][_0x0375('0x1a')]({'where':_0x46a952[_0x0375('0x6b')]})[_0x0375('0x20')](function(_0x203bf0){_0x9e1321[_0x0375('0x1a')]=_0x203bf0;if(_0x58f5dd[_0x0375('0x2f')]['includeAll']){_0x46a952[_0x0375('0x9c')]=[{'all':!![]}];}return db[_0x0375('0xa3')][_0x0375('0xa7')](_0x46a952);})[_0x0375('0x20')](function(_0x12d406){_0x9e1321[_0x0375('0x98')]=_0x12d406;return _0x9e1321;});}})[_0x0375('0x20')](respondWithFilteredResult(_0x5624cb,_0x46a952))[_0x0375('0x99')](handleError(_0x5624cb,null));};exports['addTags']=function(_0x4b7c9c,_0x6f7a8a,_0x4f2f38){return db[_0x0375('0x2b')][_0x0375('0x51')]({'where':{'id':_0x4b7c9c[_0x0375('0x9a')]['id']}})[_0x0375('0x20')](handleEntityNotFound(_0x6f7a8a,null))[_0x0375('0x20')](function(_0x55e2a2){if(_0x55e2a2){return _0x55e2a2['setTags'](_0x4b7c9c[_0x0375('0x67')]['ids'],_['omit'](_0x4b7c9c[_0x0375('0x67')],[_0x0375('0xa2'),'id'])||{})[_0x0375('0xa8')](function(){return db[_0x0375('0x60')][_0x0375('0xa7')]({'attributes':['id','name','color'],'where':{'id':_0x4b7c9c['body']['ids']}});})['then'](function(_0x5f1f28){socket[_0x0375('0xa9')](_0x0375('0xaa'),{'id':Number(_0x4b7c9c[_0x0375('0x9a')]['id']),'tags':_0x5f1f28||[]});return{'id':Number(_0x4b7c9c[_0x0375('0x9a')]['id']),'tags':_0x5f1f28||[]};});}})[_0x0375('0x20')](respondWithResult(_0x6f7a8a,null))[_0x0375('0x99')](handleError(_0x6f7a8a,null));};exports[_0x0375('0xab')]=function(_0x223bd8,_0x58507e,_0x33b0e3){return db[_0x0375('0x2b')][_0x0375('0x51')]({'where':{'id':_0x223bd8[_0x0375('0x9a')]['id']}})[_0x0375('0x20')](handleEntityNotFound(_0x58507e,null))[_0x0375('0x20')](function(_0x51ad6f){if(_0x51ad6f){return _0x51ad6f['removeTags'](_0x223bd8['query']['ids']);}})[_0x0375('0x20')](respondWithStatusCode(_0x58507e,null))[_0x0375('0x99')](handleError(_0x58507e,null));};exports['download']=function(_0x593a9e,_0x58fa1c){var _0x380eeb=moment()[_0x0375('0xac')]()[_0x0375('0x87')]();var _0x4d22dc=path[_0x0375('0xad')](config[_0x0375('0xae')],'server',_0x0375('0xaf'),_0x0375('0xb0'));var _0x5d7fb3=path['join'](config[_0x0375('0xae')],_0x0375('0xb1'),'files',_0x0375('0xb2'));var _0x3d4d33=path[_0x0375('0xad')](_0x5d7fb3,_0x380eeb);var _0x1225f0=util[_0x0375('0xa5')](_0x0375('0xb3'),_0x380eeb);var _0x5d33a9=path[_0x0375('0xad')](_0x5d7fb3,_0x1225f0);var _0x583c47=![];return db['FaxInteraction'][_0x0375('0x51')]({'where':{'id':_0x593a9e[_0x0375('0x9a')]['id']}})[_0x0375('0x20')](handleEntityNotFound(_0x58fa1c,null))['then'](function(_0x4c0d20){if(_0x4c0d20){return _0x4c0d20['getMessages']({'attributes':['id',_0x0375('0x67'),_0x0375('0x6e')],'include':[{'model':db[_0x0375('0xb4')],'as':_0x0375('0xb4')}]});}return[];})[_0x0375('0x20')](function(_0xfc98b0){_0x583c47=_0xfc98b0[_0x0375('0x34')];if(_0xfc98b0[_0x0375('0x34')]){fs[_0x0375('0xb5')](_0x3d4d33);for(var _0x30c2b4=0x0;_0x30c2b4<_0xfc98b0[_0x0375('0x34')];_0x30c2b4++){var _0x17249f=_0xfc98b0[_0x30c2b4];var _0x5bc0eb=_0x17249f['Attachment'];if(_0x5bc0eb){var _0x1f33c4=path[_0x0375('0xad')](_0x4d22dc,_0x5bc0eb[_0x0375('0xb6')]);if(fs['existsSync'](_0x1f33c4)){fs[_0x0375('0xb7')](_0x1f33c4)['pipe'](fs[_0x0375('0xb8')](path[_0x0375('0xad')](_0x3d4d33,_0x5bc0eb[_0x0375('0xb6')])));}}}}})['then'](function(){if(_0x583c47){return new BPromise(function(_0x3b5e61,_0x206fd6){zipdir(_0x3d4d33,{'saveTo':_0x5d33a9},function(_0x24f685,_0x40925){if(_0x24f685)return _0x206fd6(_0x24f685);return _0x3b5e61(_0x40925);});});}})[_0x0375('0x20')](function(){if(_0x583c47){return new BPromise(function(_0x332166,_0x404cb0){rimraf(_0x3d4d33,function(_0x4826f8){if(_0x4826f8)_0x404cb0(_0x4826f8);return _0x332166();});});}})[_0x0375('0x20')](function(){if(_0x583c47){return _0x58fa1c['download'](_0x5d33a9,_0x1225f0,function(_0x2e8088){if(_0x2e8088){console['log'](_0x0375('0xb9'),_0x2e8088);}else{fs[_0x0375('0xba')](_0x5d33a9);}});}else{return _0x58fa1c[_0x0375('0xbb')](0xc8);}})[_0x0375('0x99')](handleError(_0x58fa1c,null));}; \ No newline at end of file +var _0x257b=['a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','FaxInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','show','params','includeAll','include','options','create','body','describe','addMessage','ids','getMessages','findOne','FaxMessage','$gte','format','findAll','setTags','emit','faxInteractionTags:save','removeTags','unix','join','root','server','attachments','files','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','download','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','Users','Tags','TagIds','split','forEach','push','catch','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','pick','select','field','color','from','tools_tags','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts'];(function(_0x4d2737,_0x41f18e){var _0x12f52e=function(_0x37767f){while(--_0x37767f){_0x4d2737['push'](_0x4d2737['shift']());}};_0x12f52e(++_0x41f18e);}(_0x257b,0x76));var _0xb257=function(_0x273262,_0x197727){_0x273262=_0x273262-0x0;var _0x41ba6e=_0x257b[_0x273262];return _0x41ba6e;};'use strict';var pdf=require(_0xb257('0x0'));var emlformat=require(_0xb257('0x1'));var rimraf=require(_0xb257('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb257('0x3'));var rp=require(_0xb257('0x4'));var moment=require(_0xb257('0x5'));var BPromise=require(_0xb257('0x6'));var Mustache=require(_0xb257('0x7'));var util=require(_0xb257('0x8'));var path=require('path');var sox=require(_0xb257('0x9'));var csv=require(_0xb257('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb257('0xb'));var squel=require(_0xb257('0xc'));var crypto=require(_0xb257('0xd'));var jsforce=require(_0xb257('0xe'));var deskjs=require(_0xb257('0xf'));var toCsv=require(_0xb257('0xa'));var querystring=require(_0xb257('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb257('0x11'));var as=require(_0xb257('0x12'));var hardwareService=require(_0xb257('0x13'));var logger=require('../../config/logger')(_0xb257('0x14'));var utils=require(_0xb257('0x15'));var config=require(_0xb257('0x16'));var db=require(_0xb257('0x17'))['db'];config[_0xb257('0x18')]=_['defaults'](config[_0xb257('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb257('0x19'))(new Redis(config['redis']));require(_0xb257('0x1a'))[_0xb257('0x1b')](socket);function respondWithStatusCode(_0x414c07,_0x234a2d){_0x234a2d=_0x234a2d||0xcc;return function(_0x1f41df){if(_0x1f41df){return _0x414c07[_0xb257('0x1c')](_0x234a2d);}return _0x414c07[_0xb257('0x1d')](_0x234a2d)[_0xb257('0x1e')]();};}function respondWithResult(_0x357356,_0x1b9b14){_0x1b9b14=_0x1b9b14||0xc8;return function(_0x3bb0e8){if(_0x3bb0e8){return _0x357356[_0xb257('0x1d')](_0x1b9b14)[_0xb257('0x1f')](_0x3bb0e8);}};}function respondWithFilteredResult(_0x369389,_0x5e7913){return function(_0x3be9bc){if(_0x3be9bc){var _0x2c033a=_0x3be9bc[_0xb257('0x20')],_0x5ee722=_0x5e7913[_0xb257('0x21')],_0x195a96=_0x5e7913[_0xb257('0x21')]+_0x5e7913[_0xb257('0x22')],_0x5c402a;if(_0x195a96>=_0x2c033a){_0x195a96=_0x2c033a;_0x5c402a=0xc8;}else{_0x5c402a=0xce;}_0x369389[_0xb257('0x1d')](_0x5c402a);return _0x369389['set'](_0xb257('0x23'),_0x5ee722+'-'+_0x195a96+'/'+_0x2c033a)[_0xb257('0x1f')](_0x3be9bc);}return null;};}function patchUpdates(_0xe5d54c){return function(_0x5edd47){try{jsonpatch[_0xb257('0x24')](_0x5edd47,_0xe5d54c,!![]);}catch(_0x27542a){return BPromise[_0xb257('0x25')](_0x27542a);}return _0x5edd47[_0xb257('0x26')]();};}function saveUpdates(_0x2ba4cb,_0x55160d){return function(_0x4c0517){if(_0x4c0517){return _0x4c0517['update'](_0x2ba4cb)['then'](function(_0x1ad1ab){return _0x1ad1ab;});}return null;};}function removeEntity(_0x36e0d2,_0x5b96db){return function(_0x58c824){if(_0x58c824){return _0x58c824[_0xb257('0x27')]()[_0xb257('0x28')](function(){_0x36e0d2[_0xb257('0x1d')](0xcc)[_0xb257('0x1e')]();});}};}function handleEntityNotFound(_0x50b81a,_0x26d1ae){return function(_0x3aa4d0){if(!_0x3aa4d0){_0x50b81a[_0xb257('0x1c')](0x194);}return _0x3aa4d0;};}function handleError(_0x10b989,_0x1e746a){_0x1e746a=_0x1e746a||0x1f4;return function(_0x4bdcad){logger[_0xb257('0x29')](_0x4bdcad[_0xb257('0x2a')]);if(_0x4bdcad[_0xb257('0x2b')]){delete _0x4bdcad[_0xb257('0x2b')];}_0x10b989[_0xb257('0x1d')](_0x1e746a)[_0xb257('0x2c')](_0x4bdcad);};}function getInteractionUsers(_0x2e407c,_0x5378b3){return new BPromise(function(_0x382450,_0x12fa75){try{if(_0x5378b3[_0x2e407c['id']]){_0x2e407c[_0xb257('0x2d')]=_['map'](_0x5378b3[_0x2e407c['id']],function(_0x3d6aec){return{'id':_0x3d6aec['id']};});}}catch(_0x3f4cc1){_0x12fa75(_0x3f4cc1);}_0x382450(_0x2e407c);});}function getInteractionTags(_0x1b7964,_0x442514){return new BPromise(function(_0x19fbc8,_0x47ffac){try{if(_0x1b7964['TagIds']){_0x1b7964[_0xb257('0x2e')]=[];_0x1b7964[_0xb257('0x2f')][_0xb257('0x30')](',')[_0xb257('0x31')](function(_0x4a59f4){_0x1b7964[_0xb257('0x2e')][_0xb257('0x32')](_0x442514[_0x4a59f4]);});}delete _0x1b7964[_0xb257('0x2f')];}catch(_0x95550d){_0x47ffac(_0x95550d);}_0x19fbc8(_0x1b7964);});}function updateFaxInteraction(_0x33fd21,_0x8781c5,_0x1728c9){return new BPromise(function(_0x747d18,_0x24fd1d){return getInteractionUsers(_0x33fd21,_0x1728c9)[_0xb257('0x28')](function(_0x4e6b6f){return getInteractionTags(_0x4e6b6f,_0x8781c5);})[_0xb257('0x28')](function(_0x688194){_0x747d18(_0x688194);})[_0xb257('0x33')](function(_0x57cdb6){_0x24fd1d(_0x57cdb6);});});}exports[_0xb257('0x34')]=function(_0x4f662a,_0x2524a9){var _0x554c09={},_0x2ed59a={},_0x787de4={'count':0x0,'rows':[]};var _0x34a26a=_[_0xb257('0x35')](db['FaxInteraction'][_0xb257('0x36')],function(_0x251d00){return{'name':_0x251d00[_0xb257('0x37')],'type':_0x251d00[_0xb257('0x38')][_0xb257('0x39')]};});_0x2ed59a[_0xb257('0x3a')]=_[_0xb257('0x35')](_0x34a26a,_0xb257('0x2b'));_0x2ed59a[_0xb257('0x3b')]=_['keys'](_0x4f662a[_0xb257('0x3b')]);_0x2ed59a[_0xb257('0x3c')]=_['intersection'](_0x2ed59a[_0xb257('0x3a')],_0x2ed59a['query']);_0x554c09[_0xb257('0x3d')]=_[_0xb257('0x3e')](_0x2ed59a[_0xb257('0x3a')],qs[_0xb257('0x3f')](_0x4f662a['query'][_0xb257('0x3f')]));_0x554c09[_0xb257('0x3d')]=_0x554c09[_0xb257('0x3d')][_0xb257('0x40')]?_0x554c09['attributes']:_0x2ed59a[_0xb257('0x3a')];if(!_0x4f662a[_0xb257('0x3b')]['hasOwnProperty']('nolimit')){_0x554c09[_0xb257('0x22')]=qs['limit'](_0x4f662a['query']['limit']);_0x554c09['offset']=qs['offset'](_0x4f662a[_0xb257('0x3b')]['offset']);}_0x554c09[_0xb257('0x41')]=qs[_0xb257('0x42')](_0x4f662a[_0xb257('0x3b')][_0xb257('0x42')]);_0x554c09[_0xb257('0x43')]=qs['filters'](_[_0xb257('0x44')](_0x4f662a[_0xb257('0x3b')],_0x2ed59a[_0xb257('0x3c')]));var _0x514eec=[];var _0x2e7bae=squel[_0xb257('0x45')]()[_0xb257('0x46')]('id')['field'](_0xb257('0x2b'))[_0xb257('0x46')](_0xb257('0x47'))[_0xb257('0x48')](_0xb257('0x49'));var _0x1e380b=squel[_0xb257('0x45')]()[_0xb257('0x46')]('u.id')[_0xb257('0x46')](_0xb257('0x4a'))['from'](_0xb257('0x4b'),'ui')[_0xb257('0x4c')](_0xb257('0x4d'),'u',_0xb257('0x4e'));var _0x3af40f=squel[_0xb257('0x45')]()[_0xb257('0x48')](_0xb257('0x4f'),'i')['left_join'](_0xb257('0x50'),'c',_0xb257('0x51'))[_0xb257('0x4c')](_0xb257('0x4d'),'o',_0xb257('0x52'))['left_join'](_0xb257('0x53'),'a',_0xb257('0x54'))[_0xb257('0x4c')]('fax_messages','me',_0xb257('0x55'))[_0xb257('0x4c')](_0xb257('0x56'),'it',_0xb257('0x57'))[_0xb257('0x4c')](_0xb257('0x49'),'t','t.id\x20=\x20it.TagId');var _0x21a3e3=squel[_0xb257('0x58')]();var _0xbed23c=[];var _0x1b6bb4=squel['expr']();var _0x5cb14e;if(_0x4f662a[_0xb257('0x3b')][_0xb257('0x59')]){_0x5cb14e=as[_0xb257('0x5a')](_0x4f662a['query'][_0xb257('0x59')]);var _0x34da9c=_0x5cb14e['sqlOperator'];for(var _0x51143e=0x0;_0x51143e<_0x5cb14e['conditions'][_0xb257('0x40')];_0x51143e++){var _0x1c90df=_0x5cb14e['conditions'][_0x51143e];var _0x31ac0a='i';var _0x35f485=_[_0xb257('0x5b')](_0x34a26a,['name',_0x1c90df[_0xb257('0x46')]]);if(!_0x35f485){switch(_0x1c90df[_0xb257('0x46')]){case _0xb257('0x5c'):if(_0x1c90df[_0xb257('0x5d')]==0x1){_0x3af40f[_0xb257('0x5e')]('`'+_0x1c90df['field']+_0xb257('0x5f'));}else{_0x3af40f['having']('`'+_0x1c90df[_0xb257('0x46')]+'`\x20>\x200');}break;case _0xb257('0x60'):if(_0x1c90df['operator']===_0xb257('0x61')){if(_0x1c90df[_0xb257('0x5d')][_0xb257('0x30')]('\x20')['length']>0x1){_0x21a3e3[_0x34da9c](_0xb257('0x62'),qs[_0xb257('0x63')](_0x1c90df['value']),null);}else{var _0x4bf7bf='%'+_0x1c90df[_0xb257('0x5d')]+'%';_0x21a3e3[_0x34da9c](_0xb257('0x64'),_0x4bf7bf,_0x4bf7bf,_0x4bf7bf);}}else{_0x35f485=_[_0xb257('0x5b')](_0x34a26a,[_0xb257('0x2b'),_0xb257('0x65')]);_0x1c90df[_0xb257('0x46')]=_0xb257('0x65');_0x3892f4=as[_0xb257('0x66')](_0x31ac0a,_0x35f485[_0xb257('0x38')],_0x1c90df);_0x21a3e3[_0x34da9c](_0x3892f4[_0xb257('0x67')],_0x3892f4[_0xb257('0x5d')][_0xb257('0x68')],_0x3892f4[_0xb257('0x5d')][_0xb257('0x1e')]);}break;case _0xb257('0x69'):var _0x22ac8b=_0x1c90df[_0xb257('0x5d')][_0xb257('0x30')](',')[_0xb257('0x35')](function(_0x27e692){return Number(_0x27e692);});_0x22ac8b[_0xb257('0x31')](function(_0x112054){_0x1b6bb4['or'](_0xb257('0x6a'),'%,'+_0x112054+',%');});_0xbed23c=_['union'](_0xbed23c,_0x22ac8b);break;case'User':if(_0x1c90df[_0xb257('0x6b')]===_0xb257('0x61')){_0x21a3e3[_0x34da9c](_0xb257('0x6c'),'%'+_0x1c90df['value']+'%',null);}else{_0x35f485=_[_0xb257('0x5b')](_0x34a26a,[_0xb257('0x2b'),_0xb257('0x6d')]);_0x1c90df[_0xb257('0x46')]=_0xb257('0x6d');_0x3892f4=as[_0xb257('0x66')](_0x31ac0a,_0x35f485['type'],_0x1c90df);_0x21a3e3[_0x34da9c](_0x3892f4[_0xb257('0x67')],_0x3892f4['value']['start'],_0x3892f4[_0xb257('0x5d')][_0xb257('0x1e')]);}break;case'body':_0x3892f4=as['buildExpression']('me',null,_0x1c90df);_0x21a3e3[_0x34da9c](_0x3892f4['text'],_0x3892f4['value'][_0xb257('0x68')],_0x3892f4[_0xb257('0x5d')]['end']);break;}}else{var _0x3892f4=as[_0xb257('0x66')](_0x31ac0a,_0x35f485[_0xb257('0x38')],_0x1c90df);_0x21a3e3[_0x34da9c](_0x3892f4[_0xb257('0x67')],_0x3892f4[_0xb257('0x5d')][_0xb257('0x68')],_0x3892f4[_0xb257('0x5d')][_0xb257('0x1e')]);}}}else{var _0xdd54bd=_(_0x4f662a[_0xb257('0x3b')])[_0xb257('0x6e')]()[_0xb257('0x35')](function(_0x42579e){return _[_0xb257('0x6f')](_0x34a26a,['name',_0x42579e])?_0x42579e:undefined;})[_0xb257('0x70')]()[_0xb257('0x5d')]();if(!_[_0xb257('0x71')](_0xdd54bd)){_0xdd54bd[_0xb257('0x31')](function(_0x1107c6){if(_0x1107c6==='FaxAccountId'){_0x3af40f[_0xb257('0x43')](_0xb257('0x72'),[][_0xb257('0x73')](_0x4f662a[_0xb257('0x3b')][_0x1107c6]));}else if(_0x1107c6===_0xb257('0x74')){var _0x17e0d4=JSON[_0xb257('0x75')](_0x4f662a[_0xb257('0x3b')][_0x1107c6])['$gte'];var _0x20e608=JSON[_0xb257('0x75')](_0x4f662a[_0xb257('0x3b')][_0x1107c6])[_0xb257('0x76')];_0x3af40f['where'](_0xb257('0x77'),_0x17e0d4,_0x20e608);}else{if(_0x4f662a[_0xb257('0x3b')][_0x1107c6]==='null'){_0x3af40f[_0xb257('0x43')]('i.'+_0x1107c6+_0xb257('0x78'));}else{_0x3af40f[_0xb257('0x43')]('i.'+_0x1107c6+_0xb257('0x79'),_0x4f662a[_0xb257('0x3b')][_0x1107c6]);}}});}if(_0x4f662a['query']['read']){if(_0x4f662a[_0xb257('0x3b')][_0xb257('0x7a')]==0x1){_0x3af40f[_0xb257('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x3af40f[_0xb257('0x5e')](_0xb257('0x7b'));}}if(_0x4f662a['query'][_0xb257('0x7c')]){_0xbed23c=_['isArray'](_0x4f662a[_0xb257('0x3b')][_0xb257('0x7c')])?_0x4f662a[_0xb257('0x3b')]['tag']:new Array(_0x4f662a[_0xb257('0x3b')]['tag']);_0xbed23c['forEach'](function(_0x2f04f2){_0x1b6bb4['or'](_0xb257('0x6a'),'%,'+_0x2f04f2+',%');});}if(_0x4f662a[_0xb257('0x3b')][_0xb257('0x7d')]){var _0x5eeab3=_0x4f662a[_0xb257('0x3b')][_0xb257('0x7d')][_0xb257('0x7e')]('\x5c','\x5c\x5c')[_0xb257('0x7e')]('\x27\x27',_0xb257('0x7f'));if(qs['isNumeric'](_0x5eeab3)){_0x21a3e3['or']('i.id\x20LIKE\x20?',_0x5eeab3+'%')['or'](_0xb257('0x80'),_0x5eeab3+'%');}_0x21a3e3['or'](_0xb257('0x81'),_0x5eeab3+'%');}}_0x3af40f['where'](_0x21a3e3);_0x3af40f[_0xb257('0x82')](_0xb257('0x83'));var _0x3f46aa={'type':db[_0xb257('0x84')][_0xb257('0x85')][_0xb257('0x86')],'raw':!![]};var _0x5a6fd1=_0x3af40f[_0xb257('0x87')]();_0x5a6fd1[_0xb257('0x46')](_0xb257('0x83'));_0x5a6fd1['field'](_0xb257('0x88'),_0xb257('0x5c'));if(_0x554c09['order']){_0x554c09[_0xb257('0x41')][_0xb257('0x31')](function(_0x3b230b){_0x3af40f[_0xb257('0x41')]('i.'+_0x3b230b[0x0],_0x3b230b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb257('0x71')](_0xbed23c)){_0x3af40f['having'](_0x1b6bb4);_0x5a6fd1[_0xb257('0x43')]('t.id\x20IN\x20?',_0xbed23c);}BPromise[_0xb257('0x89')]()[_0xb257('0x28')](function(){if(!_0x5cb14e&&_0x4f662a['query'][_0xb257('0x8a')])return;return _0x4f662a['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x4beb02){if(_[_0xb257('0x71')](_0x4beb02)){_0x5a6fd1['where'](_0xb257('0x8b'));_0x3af40f[_0xb257('0x43')](_0xb257('0x8b'));}else{_0x5a6fd1[_0xb257('0x43')](_0xb257('0x72'),_[_0xb257('0x35')](_0x4beb02,'id'));_0x3af40f[_0xb257('0x43')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x4beb02,'id'));}});})[_0xb257('0x28')](function(){db[_0xb257('0x8c')][_0xb257('0x3b')](_0x5a6fd1[_0xb257('0x8d')](),_0x3f46aa)[_0xb257('0x28')](function(_0x3a03f2){_0x787de4[_0xb257('0x20')]=_0x3a03f2[_0xb257('0x40')];if(_0x787de4[_0xb257('0x20')]===0x0)return[];return db[_0xb257('0x8c')]['query'](_0x2e7bae[_0xb257('0x8d')](),_0x3f46aa)['then'](function(_0x17bfd4){_0x514eec=_[_0xb257('0x8e')](_0x17bfd4,'id');_0x3f46aa=_[_0xb257('0x8f')](_0x3f46aa,{'model':db[_0xb257('0x90')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f662a[_0xb257('0x3b')][_0xb257('0x3f')]){_0x554c09[_0xb257('0x3d')][_0xb257('0x31')](function(_0x3ef251){_0x3af40f[_0xb257('0x46')]('i.'+_0x3ef251);});}else{_0x3af40f[_0xb257('0x46')](_0xb257('0x88'),'unreadMessages');_0x3af40f['field'](_0xb257('0x91'),_0xb257('0x92'));_0x3af40f['field'](_0xb257('0x93'),_0xb257('0x94'));_0x3af40f[_0xb257('0x46')](_0xb257('0x95'));_0x3af40f['field']('c.firstName',_0xb257('0x96'));_0x3af40f[_0xb257('0x46')](_0xb257('0x97'),_0xb257('0x98'));_0x3af40f[_0xb257('0x46')](_0xb257('0x99'),_0xb257('0x9a'));_0x3af40f[_0xb257('0x46')](_0xb257('0x9b'),_0xb257('0x9c'));_0x3af40f[_0xb257('0x46')](_0xb257('0x9d'),_0xb257('0x9e'));_0x3af40f['field'](_0xb257('0x9f'),'Contact.fax');_0x3af40f[_0xb257('0x46')](_0xb257('0xa0'),_0xb257('0x2f'));}_0x3af40f['limit'](_0x554c09[_0xb257('0x22')]);_0x3af40f['offset'](_0x554c09[_0xb257('0x21')]);return db['sequelize']['query'](_0x3af40f[_0xb257('0x8d')](),_0x3f46aa);})[_0xb257('0x28')](function(_0x3ea22a){_0x1e380b[_0xb257('0x43')](_0xb257('0xa1'),_[_0xb257('0x35')](_0x3ea22a,'id'));return db[_0xb257('0x8c')][_0xb257('0x3b')](_0x1e380b[_0xb257('0x8d')](),_0x3f46aa)[_0xb257('0x28')](function(_0x2764e7){var _0x315074=_[_0xb257('0xa2')](_0x2764e7,_0xb257('0xa3'));var _0x2c6f2c=[];_0x3ea22a[_0xb257('0x31')](function(_0x5772b3){_0x2c6f2c[_0xb257('0x32')](updateFaxInteraction(_0x5772b3,_0x514eec,_0x315074));});return BPromise['all'](_0x2c6f2c);});});})[_0xb257('0x28')](function(_0x38bd59){_0x787de4[_0xb257('0xa4')]=_0x38bd59;return _0x787de4;})[_0xb257('0x28')](respondWithFilteredResult(_0x2524a9,_0x554c09));})[_0xb257('0x33')](handleError(_0x2524a9,null));};exports[_0xb257('0xa5')]=function(_0x14391c,_0x3938d0){var _0x3e8928={'raw':![],'where':{'id':_0x14391c[_0xb257('0xa6')]['id']}},_0x24cf7c={};_0x24cf7c[_0xb257('0x3a')]=_[_0xb257('0x6e')](db['FaxInteraction'][_0xb257('0x36')]);_0x24cf7c[_0xb257('0x3b')]=_[_0xb257('0x6e')](_0x14391c[_0xb257('0x3b')]);_0x24cf7c['filters']=_[_0xb257('0x3e')](_0x24cf7c[_0xb257('0x3a')],_0x24cf7c[_0xb257('0x3b')]);_0x3e8928[_0xb257('0x3d')]=_[_0xb257('0x3e')](_0x24cf7c['model'],qs[_0xb257('0x3f')](_0x14391c[_0xb257('0x3b')][_0xb257('0x3f')]));_0x3e8928['attributes']=_0x3e8928[_0xb257('0x3d')][_0xb257('0x40')]?_0x3e8928[_0xb257('0x3d')]:_0x24cf7c[_0xb257('0x3a')];if(_0x14391c['query'][_0xb257('0xa7')]){_0x3e8928[_0xb257('0xa8')]=[{'all':!![]}];}_0x3e8928=_[_0xb257('0x8f')]({},_0x3e8928,_0x14391c[_0xb257('0xa9')]);return db[_0xb257('0x90')]['find'](_0x3e8928)['then'](handleEntityNotFound(_0x3938d0,null))[_0xb257('0x28')](respondWithResult(_0x3938d0,null))[_0xb257('0x33')](handleError(_0x3938d0,null));};exports[_0xb257('0xaa')]=function(_0x4c483c,_0x228eca){return db[_0xb257('0x90')][_0xb257('0xaa')](_0x4c483c[_0xb257('0xab')],{})[_0xb257('0x28')](respondWithResult(_0x228eca,0xc9))[_0xb257('0x33')](handleError(_0x228eca,null));};exports['update']=function(_0x4b396f,_0x1bc76e){if(_0x4b396f[_0xb257('0xab')]['id']){delete _0x4b396f[_0xb257('0xab')]['id'];}return db[_0xb257('0x90')]['find']({'where':{'id':_0x4b396f[_0xb257('0xa6')]['id']}})[_0xb257('0x28')](handleEntityNotFound(_0x1bc76e,null))[_0xb257('0x28')](saveUpdates(_0x4b396f['body'],null))[_0xb257('0x28')](respondWithResult(_0x1bc76e,null))[_0xb257('0x33')](handleError(_0x1bc76e,null));};exports[_0xb257('0x27')]=function(_0x10d148,_0x1e15ea){return db['FaxInteraction']['find']({'where':{'id':_0x10d148[_0xb257('0xa6')]['id']}})[_0xb257('0x28')](handleEntityNotFound(_0x1e15ea,null))['then'](removeEntity(_0x1e15ea,null))[_0xb257('0x33')](handleError(_0x1e15ea,null));};exports[_0xb257('0xac')]=function(_0x447fe3,_0x2ee35d){return db[_0xb257('0x90')][_0xb257('0xac')]()[_0xb257('0x28')](respondWithResult(_0x2ee35d,null))['catch'](handleError(_0x2ee35d,null));};exports['addMessage']=function(_0x57b659,_0x4dde33,_0x33312e){return db['FaxMessage'][_0xb257('0x5b')]({'where':{'id':_0x57b659[_0xb257('0xa6')]['id']}})['then'](handleEntityNotFound(_0x4dde33,null))['then'](function(_0x2f9d41){if(_0x2f9d41){return _0x2f9d41[_0xb257('0xad')](_0x57b659[_0xb257('0xab')][_0xb257('0xae')],_['omit'](_0x57b659[_0xb257('0xab')],[_0xb257('0xae'),'id'])||{});}})['then'](respondWithResult(_0x4dde33,null))[_0xb257('0x33')](handleError(_0x4dde33,null));};exports[_0xb257('0xaf')]=function(_0x490da9,_0x352262,_0x39aeab){var _0x42c85c={'raw':![],'where':{}};var _0x4de6d5={};var _0x5d0506={'count':0x0,'rows':[]};return db[_0xb257('0x90')][_0xb257('0xb0')]({'where':{'id':_0x490da9[_0xb257('0xa6')]['id']}})[_0xb257('0x28')](handleEntityNotFound(_0x352262,null))[_0xb257('0x28')](function(_0x51cdaf){if(_0x51cdaf){_0x4de6d5['model']=_[_0xb257('0x6e')](db[_0xb257('0xb1')][_0xb257('0x36')]);_0x4de6d5[_0xb257('0x3b')]=_[_0xb257('0x6e')](_0x490da9[_0xb257('0x3b')]);_0x4de6d5[_0xb257('0x3c')]=_['intersection'](_0x4de6d5[_0xb257('0x3a')],_0x4de6d5[_0xb257('0x3b')]);_0x42c85c['attributes']=_[_0xb257('0x3e')](_0x4de6d5[_0xb257('0x3a')],qs[_0xb257('0x3f')](_0x490da9[_0xb257('0x3b')][_0xb257('0x3f')]));_0x42c85c['attributes']=_0x42c85c[_0xb257('0x3d')][_0xb257('0x40')]?_0x42c85c[_0xb257('0x3d')]:_0x4de6d5['model'];if(!_0x490da9['query']['hasOwnProperty']('nolimit')){_0x42c85c['limit']=qs[_0xb257('0x22')](_0x490da9['query'][_0xb257('0x22')]);_0x42c85c[_0xb257('0x21')]=qs['offset'](_0x490da9[_0xb257('0x3b')][_0xb257('0x21')]);}_0x42c85c[_0xb257('0x41')]=qs[_0xb257('0x42')](_0x490da9['query'][_0xb257('0x42')]);_0x42c85c[_0xb257('0x43')]=qs[_0xb257('0x3c')](_[_0xb257('0x44')](_0x490da9['query'],_0x4de6d5[_0xb257('0x3c')]));_0x42c85c[_0xb257('0x43')][_0xb257('0xa3')]=_0x51cdaf['id'];if(_0x490da9['query'][_0xb257('0x7d')]){_0x42c85c[_0xb257('0x43')]=_[_0xb257('0x8f')](_0x42c85c['where'],{'$or':_[_0xb257('0x35')](_0x42c85c[_0xb257('0x3d')],function(_0x133588){var _0x2b588c={};_0x2b588c[_0x133588]={'$like':'%'+_0x490da9['query']['filter']+'%'};return _0x2b588c;})});}if(_0x490da9[_0xb257('0x3b')][_0xb257('0xb2')]){var _0x35af78=_0x490da9['query'][_0xb257('0xb2')][_0xb257('0x30')](',');var _0x24ac6a={};_0x24ac6a[_0x35af78[0x0]]={'$gte':moment(_0x35af78[0x1])[_0xb257('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x42c85c[_0xb257('0x43')]=_['merge'](_0x42c85c[_0xb257('0x43')],_0x24ac6a);}_0x42c85c=_['merge']({},_0x42c85c,_0x490da9[_0xb257('0xa9')]);return db[_0xb257('0xb1')][_0xb257('0x20')]({'where':_0x42c85c['where']})['then'](function(_0x5ec560){_0x5d0506['count']=_0x5ec560;if(_0x490da9['query'][_0xb257('0xa7')]){_0x42c85c['include']=[{'all':!![]}];}return db['FaxMessage'][_0xb257('0xb4')](_0x42c85c);})[_0xb257('0x28')](function(_0x5e2b06){_0x5d0506[_0xb257('0xa4')]=_0x5e2b06;return _0x5d0506;});}})[_0xb257('0x28')](respondWithFilteredResult(_0x352262,_0x42c85c))[_0xb257('0x33')](handleError(_0x352262,null));};exports['addTags']=function(_0x4c313b,_0x10813e,_0x2d03f4){return db['FaxInteraction'][_0xb257('0x5b')]({'where':{'id':_0x4c313b[_0xb257('0xa6')]['id']}})[_0xb257('0x28')](handleEntityNotFound(_0x10813e,null))[_0xb257('0x28')](function(_0xb63cb7){if(_0xb63cb7){return _0xb63cb7[_0xb257('0xb5')](_0x4c313b[_0xb257('0xab')]['ids'],_['omit'](_0x4c313b[_0xb257('0xab')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0xb257('0xb4')]({'attributes':['id',_0xb257('0x2b'),'color'],'where':{'id':_0x4c313b[_0xb257('0xab')][_0xb257('0xae')]}});})[_0xb257('0x28')](function(_0x23f261){socket[_0xb257('0xb6')](_0xb257('0xb7'),{'id':Number(_0x4c313b[_0xb257('0xa6')]['id']),'tags':_0x23f261||[]});return{'id':Number(_0x4c313b[_0xb257('0xa6')]['id']),'tags':_0x23f261||[]};});}})[_0xb257('0x28')](respondWithResult(_0x10813e,null))[_0xb257('0x33')](handleError(_0x10813e,null));};exports[_0xb257('0xb8')]=function(_0x6f605b,_0x58e67f,_0x2fb789){return db[_0xb257('0x90')][_0xb257('0x5b')]({'where':{'id':_0x6f605b[_0xb257('0xa6')]['id']}})['then'](handleEntityNotFound(_0x58e67f,null))[_0xb257('0x28')](function(_0x1ad732){if(_0x1ad732){return _0x1ad732[_0xb257('0xb8')](_0x6f605b[_0xb257('0x3b')][_0xb257('0xae')]);}})[_0xb257('0x28')](respondWithStatusCode(_0x58e67f,null))['catch'](handleError(_0x58e67f,null));};exports['download']=function(_0x2950e9,_0x3e01b1){var _0x5c8c23=moment()[_0xb257('0xb9')]()[_0xb257('0x8d')]();var _0x522bfc=path[_0xb257('0xba')](config[_0xb257('0xbb')],_0xb257('0xbc'),'files',_0xb257('0xbd'));var _0x2b2df1=path['join'](config[_0xb257('0xbb')],'server',_0xb257('0xbe'),_0xb257('0xbf'));var _0x27701f=path[_0xb257('0xba')](_0x2b2df1,_0x5c8c23);var _0xcec720=util[_0xb257('0xb3')](_0xb257('0xc0'),_0x5c8c23);var _0x416cc1=path[_0xb257('0xba')](_0x2b2df1,_0xcec720);var _0x22d35c=![];return db[_0xb257('0x90')]['find']({'where':{'id':_0x2950e9['params']['id']}})['then'](handleEntityNotFound(_0x3e01b1,null))['then'](function(_0x1c95ec){if(_0x1c95ec){return _0x1c95ec[_0xb257('0xaf')]({'attributes':['id',_0xb257('0xab'),_0xb257('0x74')],'include':[{'model':db[_0xb257('0xc1')],'as':'Attachment'}]});}return[];})[_0xb257('0x28')](function(_0x4461cc){_0x22d35c=_0x4461cc[_0xb257('0x40')];if(_0x4461cc['length']){fs[_0xb257('0xc2')](_0x27701f);for(var _0x534ad1=0x0;_0x534ad1<_0x4461cc['length'];_0x534ad1++){var _0x59919d=_0x4461cc[_0x534ad1];var _0x3d3042=_0x59919d[_0xb257('0xc1')];if(_0x3d3042){var _0x45a275=path[_0xb257('0xba')](_0x522bfc,_0x3d3042[_0xb257('0xc3')]);if(fs[_0xb257('0xc4')](_0x45a275)){fs[_0xb257('0xc5')](_0x45a275)[_0xb257('0xc6')](fs[_0xb257('0xc7')](path[_0xb257('0xba')](_0x27701f,_0x3d3042[_0xb257('0xc3')])));}}}}})[_0xb257('0x28')](function(){if(_0x22d35c){return new BPromise(function(_0x2245c3,_0x52c189){zipdir(_0x27701f,{'saveTo':_0x416cc1},function(_0x2f2412,_0x33d969){if(_0x2f2412)return _0x52c189(_0x2f2412);return _0x2245c3(_0x33d969);});});}})[_0xb257('0x28')](function(){if(_0x22d35c){return new BPromise(function(_0x493faf,_0x276bad){rimraf(_0x27701f,function(_0x19e133){if(_0x19e133)_0x276bad(_0x19e133);return _0x493faf();});});}})[_0xb257('0x28')](function(){if(_0x22d35c){return _0x3e01b1[_0xb257('0xc8')](_0x416cc1,_0xcec720,function(_0x3c84a8){if(_0x3c84a8){console['log'](_0xb257('0xc9'),_0x3c84a8);}else{fs['unlinkSync'](_0x416cc1);}});}else{return _0x3e01b1['sendStatus'](0xc8);}})[_0xb257('0x33')](handleError(_0x3e01b1,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 9def96e..95cddf6 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x4e8639,_0x4ee101){var _0x483a37=function(_0x1a1e80){while(--_0x1a1e80){_0x4e8639['push'](_0x4e8639['shift']());}};_0x483a37(++_0x4ee101);}(_0x326f,0xd1));var _0xf326=function(_0x198a8f,_0x433743){_0x198a8f=_0x198a8f-0x0;var _0xb32918=_0x326f[_0x198a8f];return _0xb32918;};'use strict';var EventEmitter=require(_0xf326('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xf326('0x1'))['db'][_0xf326('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf326('0x3')](0x0);var events={'afterCreate':_0xf326('0x4'),'afterUpdate':_0xf326('0x5'),'afterDestroy':_0xf326('0x6')};function emitEvent(_0x9445c6){return function(_0xf1c243,_0x1b5a56,_0x3ace29){_0xf1c243['getUsers']({'attributes':['id'],'raw':!![]})[_0xf326('0x7')](function(_0x3851eb){_0xf1c243[_0xf326('0x8')](_0xf326('0x9'),_0x3851eb['map'](function(_0x4c206c){return{'id':_0x4c206c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xf1c243['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf326('0x7')](function(_0x1fc80e){_0xf1c243[_0xf326('0x8')](_0xf326('0xa'),_0x1fc80e[_0xf326('0xb')]);FaxInteractionEvents['emit'](_0x9445c6+':'+_0xf1c243['id'],_0xf1c243);FaxInteractionEvents[_0xf326('0xc')](_0x9445c6,_0xf1c243);_0x3ace29(null);})['catch'](_0x3ace29(null));};}for(var e in events){if(events[_0xf326('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf326('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x361565,_0x3ddb91){var _0x5a8138=function(_0x14c366){while(--_0x14c366){_0x361565['push'](_0x361565['shift']());}};_0x5a8138(++_0x3ddb91);}(_0xadb5,0xad));var _0x5adb=function(_0x209f5a,_0xfff985){_0x209f5a=_0x209f5a-0x0;var _0x59b985=_0xadb5[_0x209f5a];return _0x59b985;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x5adb('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return FaxMessage[_0x5adb('0xa')]({'where':{'FaxInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);FaxInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);FaxInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 87462f2..1f696ca 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5b8=['bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment'];(function(_0x1d791b,_0x5797b4){var _0x44c2a2=function(_0x16c9b2){while(--_0x16c9b2){_0x1d791b['push'](_0x1d791b['shift']());}};_0x44c2a2(++_0x5797b4);}(_0xf5b8,0x191));var _0x8f5b=function(_0x540827,_0x431b4a){_0x540827=_0x540827-0x0;var _0x4d9cf4=_0xf5b8[_0x540827];return _0x4d9cf4;};'use strict';var _=require(_0x8f5b('0x0'));var util=require('util');var logger=require(_0x8f5b('0x1'))(_0x8f5b('0x2'));var moment=require(_0x8f5b('0x3'));var BPromise=require(_0x8f5b('0x4'));var rp=require(_0x8f5b('0x5'));var fs=require('fs');var path=require(_0x8f5b('0x6'));var rimraf=require(_0x8f5b('0x7'));var config=require(_0x8f5b('0x8'));var attributes=require(_0x8f5b('0x9'));module[_0x8f5b('0xa')]=function(_0x54ecf1,_0x53f48d){return _0x54ecf1['define'](_0x8f5b('0xb'),attributes,{'tableName':_0x8f5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38e150,_0x15bfb2,_0x2e6c70){if(_0x38e150['changed'](_0x8f5b('0xd'))){_0x38e150['closedAt']=moment()['format'](_0x8f5b('0xe'));}_0x2e6c70(null,_0x38e150);}}});}; \ No newline at end of file +var _0xa0ce=['../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa0ce,0xe8));var _0xea0c=function(_0x42d270,_0x1f0313){_0x42d270=_0x42d270-0x0;var _0x4cf5e5=_0xa0ce[_0x42d270];return _0x4cf5e5;};'use strict';var _=require(_0xea0c('0x0'));var util=require('util');var logger=require(_0xea0c('0x1'))(_0xea0c('0x2'));var moment=require(_0xea0c('0x3'));var BPromise=require(_0xea0c('0x4'));var rp=require(_0xea0c('0x5'));var fs=require('fs');var path=require(_0xea0c('0x6'));var rimraf=require(_0xea0c('0x7'));var config=require(_0xea0c('0x8'));var attributes=require(_0xea0c('0x9'));module['exports']=function(_0x9bf670,_0x377620){return _0x9bf670[_0xea0c('0xa')](_0xea0c('0xb'),attributes,{'tableName':_0xea0c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30ac4a,_0x542498,_0x5aa8cc){if(_0x30ac4a['changed']('closed')){_0x30ac4a[_0xea0c('0xd')]=moment()[_0xea0c('0xe')](_0xea0c('0xf'));}_0x5aa8cc(null,_0x30ac4a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 73914fd..502cf0d 100644 --- a/server/api/faxInteraction/faxInteraction.rpc.js +++ b/server/api/faxInteraction/faxInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter'];(function(_0x4adb84,_0x3b31ba){var _0x1a1dc4=function(_0x5c5320){while(--_0x5c5320){_0x4adb84['push'](_0x4adb84['shift']());}};_0x1a1dc4(++_0x3b31ba);}(_0xe511,0x111));var _0x1e51=function(_0x105f31,_0x3b2c63){_0x105f31=_0x105f31-0x0;var _0x4cf8ba=_0xe511[_0x105f31];return _0x4cf8ba;};'use strict';var _=require('lodash');var util=require(_0x1e51('0x0'));var moment=require(_0x1e51('0x1'));var BPromise=require('bluebird');var rs=require(_0x1e51('0x2'));var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require(_0x1e51('0x5'));var logger=require(_0x1e51('0x6'))(_0x1e51('0x7'));var config=require(_0x1e51('0x8'));var jayson=require(_0x1e51('0x9'));var client=jayson[_0x1e51('0xa')]['http']({'port':0x232a});config[_0x1e51('0xb')]=_['defaults'](config[_0x1e51('0xb')],{'host':_0x1e51('0xc'),'port':0x18eb});var socket=require(_0x1e51('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x6e8128,_0x5ccf11,_0x29d910){return new BPromise(function(_0x46d338,_0x15b99c){return client[_0x1e51('0xe')](_0x6e8128,_0x29d910)[_0x1e51('0xf')](function(_0x1b552a){logger[_0x1e51('0x10')](_0x1e51('0x11'),_0x5ccf11,_0x1e51('0x12'));logger[_0x1e51('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x5ccf11,_0x1e51('0x12'),JSON[_0x1e51('0x14')](_0x1b552a));if(_0x1b552a[_0x1e51('0x15')]){if(_0x1b552a['error']['code']===0x1f4){logger[_0x1e51('0x15')](_0x1e51('0x11'),_0x5ccf11,_0x1b552a[_0x1e51('0x15')][_0x1e51('0x16')]);return _0x15b99c(_0x1b552a['error']['message']);}logger[_0x1e51('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x5ccf11,_0x1b552a['error']['message']);return _0x46d338(_0x1b552a[_0x1e51('0x15')][_0x1e51('0x16')]);}else{logger[_0x1e51('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x5ccf11,_0x1e51('0x12'));_0x46d338(_0x1b552a[_0x1e51('0x17')][_0x1e51('0x16')]);}})[_0x1e51('0x18')](function(_0x5e6ba1){logger[_0x1e51('0x15')](_0x1e51('0x11'),_0x5ccf11,_0x5e6ba1);_0x15b99c(_0x5e6ba1);});});}exports[_0x1e51('0x19')]=function(_0x4fd0ff){var _0x26a9c5=this;return new Promise(function(_0x2534d9,_0x316535){return db[_0x1e51('0x1a')][_0x1e51('0x1b')](_0x4fd0ff[_0x1e51('0x1c')],{'raw':_0x4fd0ff[_0x1e51('0x1d')]?_0x4fd0ff[_0x1e51('0x1d')][_0x1e51('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fd0ff['options']?_0x4fd0ff['options'][_0x1e51('0x1f')]||null:null,'attributes':_0x4fd0ff['options']?_0x4fd0ff['options'][_0x1e51('0x20')]||null:null,'limit':_0x4fd0ff[_0x1e51('0x1d')]?_0x4fd0ff[_0x1e51('0x1d')][_0x1e51('0x21')]||null:null})[_0x1e51('0xf')](function(_0x57b9fb){logger['info'](_0x1e51('0x19'),_0x4fd0ff);logger[_0x1e51('0x13')](_0x1e51('0x19'),_0x4fd0ff,JSON[_0x1e51('0x14')](_0x57b9fb));_0x2534d9(_0x57b9fb);})[_0x1e51('0x18')](function(_0x5e2ed9){logger['error']('UpdateFaxInteraction',_0x5e2ed9[_0x1e51('0x16')],_0x4fd0ff);_0x316535(_0x26a9c5[_0x1e51('0x15')](0x1f4,_0x5e2ed9[_0x1e51('0x16')]));});});};exports[_0x1e51('0x22')]=function(_0x174e62){return new Promise(function(_0x4d2ecb,_0x299209){return db['FaxInteraction'][_0x1e51('0x23')]({'where':_0x174e62[_0x1e51('0x1d')]?_0x174e62[_0x1e51('0x1d')][_0x1e51('0x1f')]||null:null})[_0x1e51('0xf')](function(_0x1f9877){if(_0x1f9877){return _0x1f9877[_0x1e51('0x24')](_0x174e62[_0x1e51('0x1c')][_0x1e51('0x25')],_[_0x1e51('0x26')](_0x174e62[_0x1e51('0x1c')],[_0x1e51('0x25'),'id'])||{});}})[_0x1e51('0x27')](function(_0x83285){logger[_0x1e51('0x10')](_0x1e51('0x28'),_0x174e62);logger[_0x1e51('0x13')](_0x1e51('0x28'),_0x174e62,JSON[_0x1e51('0x14')](_0x83285));_0x4d2ecb(_0x83285);})[_0x1e51('0x18')](function(_0x27910c){logger[_0x1e51('0x15')](_0x1e51('0x28'),_0x27910c[_0x1e51('0x16')],_0x174e62);_0x299209(_this['error'](0x1f4,_0x27910c[_0x1e51('0x16')]));});});}; \ No newline at end of file +var _0x7818=['FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','options','attributes','limit','debug','find','where','then','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x208abc,_0x3cae8d){var _0xc1853d=function(_0x59ebf9){while(--_0x59ebf9){_0x208abc['push'](_0x208abc['shift']());}};_0xc1853d(++_0x3cae8d);}(_0x7818,0x119));var _0x8781=function(_0x3f5bdb,_0x52f7b){_0x3f5bdb=_0x3f5bdb-0x0;var _0x2b3dd6=_0x7818[_0x3f5bdb];return _0x2b3dd6;};'use strict';var _=require(_0x8781('0x0'));var util=require(_0x8781('0x1'));var moment=require(_0x8781('0x2'));var BPromise=require(_0x8781('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8781('0x4'))['db'];var utils=require(_0x8781('0x5'));var logger=require(_0x8781('0x6'))(_0x8781('0x7'));var config=require('../../config/environment');var jayson=require(_0x8781('0x8'));var client=jayson[_0x8781('0x9')][_0x8781('0xa')]({'port':0x232a});config['redis']=_[_0x8781('0xb')](config[_0x8781('0xc')],{'host':_0x8781('0xd'),'port':0x18eb});var socket=require(_0x8781('0xe'))(new Redis(config[_0x8781('0xc')]));require(_0x8781('0xf'))[_0x8781('0x10')](socket);function respondWithRpcPromise(_0x172d0c,_0x2638f5,_0x195eba){return new BPromise(function(_0x245878,_0x37b17f){return client[_0x8781('0x11')](_0x172d0c,_0x195eba)['then'](function(_0x280db2){logger['info'](_0x8781('0x12'),_0x2638f5,_0x8781('0x13'));logger['debug'](_0x8781('0x14'),_0x2638f5,_0x8781('0x13'),JSON[_0x8781('0x15')](_0x280db2));if(_0x280db2[_0x8781('0x16')]){if(_0x280db2['error'][_0x8781('0x17')]===0x1f4){logger[_0x8781('0x16')](_0x8781('0x12'),_0x2638f5,_0x280db2['error'][_0x8781('0x18')]);return _0x37b17f(_0x280db2['error'][_0x8781('0x18')]);}logger[_0x8781('0x16')](_0x8781('0x12'),_0x2638f5,_0x280db2['error'][_0x8781('0x18')]);return _0x245878(_0x280db2[_0x8781('0x16')][_0x8781('0x18')]);}else{logger[_0x8781('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x2638f5,_0x8781('0x13'));_0x245878(_0x280db2[_0x8781('0x1a')][_0x8781('0x18')]);}})[_0x8781('0x1b')](function(_0x41b879){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x2638f5,_0x41b879);_0x37b17f(_0x41b879);});});}exports[_0x8781('0x1c')]=function(_0x335663){var _0x1832c6=this;return new Promise(function(_0x4d6c79,_0x4fed97){return db[_0x8781('0x1d')]['update'](_0x335663['body'],{'raw':_0x335663['options']?_0x335663[_0x8781('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x335663[_0x8781('0x1e')]?_0x335663['options']['where']||null:null,'attributes':_0x335663['options']?_0x335663['options'][_0x8781('0x1f')]||null:null,'limit':_0x335663[_0x8781('0x1e')]?_0x335663['options'][_0x8781('0x20')]||null:null})['then'](function(_0x558507){logger[_0x8781('0x19')](_0x8781('0x1c'),_0x335663);logger[_0x8781('0x21')](_0x8781('0x1c'),_0x335663,JSON[_0x8781('0x15')](_0x558507));_0x4d6c79(_0x558507);})[_0x8781('0x1b')](function(_0x18e025){logger[_0x8781('0x16')](_0x8781('0x1c'),_0x18e025[_0x8781('0x18')],_0x335663);_0x4fed97(_0x1832c6[_0x8781('0x16')](0x1f4,_0x18e025[_0x8781('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4b9685){return new Promise(function(_0x59200a,_0x48798b){return db['FaxInteraction'][_0x8781('0x22')]({'where':_0x4b9685[_0x8781('0x1e')]?_0x4b9685[_0x8781('0x1e')][_0x8781('0x23')]||null:null})[_0x8781('0x24')](function(_0x4d7991){if(_0x4d7991){return _0x4d7991[_0x8781('0x25')](_0x4b9685[_0x8781('0x26')][_0x8781('0x27')],_[_0x8781('0x28')](_0x4b9685[_0x8781('0x26')],[_0x8781('0x27'),'id'])||{});}})[_0x8781('0x29')](function(_0x138b88){logger[_0x8781('0x19')](_0x8781('0x2a'),_0x4b9685);logger[_0x8781('0x21')](_0x8781('0x2a'),_0x4b9685,JSON[_0x8781('0x15')](_0x138b88));_0x59200a(_0x138b88);})[_0x8781('0x1b')](function(_0x1a27bd){logger['error']('AddTags',_0x1a27bd[_0x8781('0x18')],_0x4b9685);_0x48798b(_this[_0x8781('0x16')](0x1f4,_0x1a27bd[_0x8781('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 86859fd..fcb7a6e 100644 --- a/server/api/faxInteraction/faxInteraction.socket.js +++ b/server/api/faxInteraction/faxInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8dd=['length','./faxInteraction.events','save','update','emit','removeListener','register'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xd8dd,0x104));var _0xdd8d=function(_0x317ab4,_0xf73b6b){_0x317ab4=_0x317ab4-0x0;var _0x3b44d3=_0xd8dd[_0x317ab4];return _0x3b44d3;};'use strict';var FaxInteractionEvents=require(_0xdd8d('0x0'));var events=[_0xdd8d('0x1'),'remove',_0xdd8d('0x2')];function createListener(_0x1fd956,_0x1f75ca){return function(_0x58773e){_0x1f75ca[_0xdd8d('0x3')](_0x1fd956,_0x58773e);};}function removeListener(_0x2e3585,_0x41ac2d){return function(){FaxInteractionEvents[_0xdd8d('0x4')](_0x2e3585,_0x41ac2d);};}exports[_0xdd8d('0x5')]=function(_0x4b4057){for(var _0x332196=0x0,_0x148ee4=events[_0xdd8d('0x6')];_0x332196<_0x148ee4;_0x332196++){var _0x41e120=events[_0x332196];var _0x367a37=createListener('faxInteraction:'+_0x41e120,_0x4b4057);FaxInteractionEvents['on'](_0x41e120,_0x367a37);}}; \ No newline at end of file +var _0x8861=['faxInteraction:','./faxInteraction.events','save','remove','update','register','length'];(function(_0x2d77f6,_0xfdd1ee){var _0x54779a=function(_0x1e5e9f){while(--_0x1e5e9f){_0x2d77f6['push'](_0x2d77f6['shift']());}};_0x54779a(++_0xfdd1ee);}(_0x8861,0x1eb));var _0x1886=function(_0x4442e9,_0x5ed667){_0x4442e9=_0x4442e9-0x0;var _0x26d4d3=_0x8861[_0x4442e9];return _0x26d4d3;};'use strict';var FaxInteractionEvents=require(_0x1886('0x0'));var events=[_0x1886('0x1'),_0x1886('0x2'),_0x1886('0x3')];function createListener(_0x556c17,_0x20ed0d){return function(_0x2781c9){_0x20ed0d['emit'](_0x556c17,_0x2781c9);};}function removeListener(_0x31f44e,_0xface6a){return function(){FaxInteractionEvents['removeListener'](_0x31f44e,_0xface6a);};}exports[_0x1886('0x4')]=function(_0x54490f){for(var _0x5e14da=0x0,_0x281107=events[_0x1886('0x5')];_0x5e14da<_0x281107;_0x5e14da++){var _0x416310=events[_0x5e14da];var _0xed9a=createListener(_0x1886('0x6')+_0x416310,_0x54490f);FaxInteractionEvents['on'](_0x416310,_0xed9a);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e047d8d..d15f4a9 100644 --- a/server/api/faxInteraction/index.js +++ b/server/api/faxInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9dc4=['./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','put','/:id','fax','delete','removeTags','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9dc4,0x6c));var _0x49dc=function(_0x1ab4c5,_0x2de08e){_0x1ab4c5=_0x1ab4c5-0x0;var _0x42ddcb=_0x9dc4[_0x1ab4c5];return _0x42ddcb;};'use strict';var multer=require(_0x49dc('0x0'));var util=require(_0x49dc('0x1'));var path=require(_0x49dc('0x2'));var timeout=require(_0x49dc('0x3'));var express=require(_0x49dc('0x4'));var router=express['Router']();var auth=require(_0x49dc('0x5'));var interaction=require(_0x49dc('0x6'));var config=require(_0x49dc('0x7'));var controller=require(_0x49dc('0x8'));router[_0x49dc('0x9')]('/',auth[_0x49dc('0xa')](),controller[_0x49dc('0xb')]);router['get'](_0x49dc('0xc'),auth[_0x49dc('0xa')](),controller[_0x49dc('0xd')]);router[_0x49dc('0x9')]('/:id',auth[_0x49dc('0xa')](),controller['show']);router[_0x49dc('0x9')](_0x49dc('0xe'),auth['isAuthenticated'](),controller[_0x49dc('0xf')]);router[_0x49dc('0x9')](_0x49dc('0x10'),auth[_0x49dc('0xa')](),controller[_0x49dc('0x11')]);router[_0x49dc('0x12')]('/',auth[_0x49dc('0xa')](),controller[_0x49dc('0x13')]);router[_0x49dc('0x12')](_0x49dc('0xe'),auth[_0x49dc('0xa')](),controller[_0x49dc('0x14')]);router[_0x49dc('0x12')](_0x49dc('0x15'),auth['isAuthenticated'](),interaction[_0x49dc('0x16')]('fax',_0x49dc('0x17')),controller['addTags']);router[_0x49dc('0x18')](_0x49dc('0x19'),auth[_0x49dc('0xa')](),interaction[_0x49dc('0x16')](_0x49dc('0x1a'),'faxinteraction:update'),controller['update']);router[_0x49dc('0x1b')](_0x49dc('0x19'),auth[_0x49dc('0xa')](),interaction[_0x49dc('0x16')](_0x49dc('0x1a'),'faxinteraction:destroy'),controller['destroy']);router[_0x49dc('0x1b')](_0x49dc('0x15'),auth[_0x49dc('0xa')](),controller[_0x49dc('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x0a35=['/:id/messages','getMessages','/:id/download','post','addMessage','tracked','fax','faxinteraction:addtags','addTags','update','delete','faxinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a35,0xe1));var _0x50a3=function(_0x27a1e0,_0x3ff2cb){_0x27a1e0=_0x27a1e0-0x0;var _0x1ca624=_0x0a35[_0x27a1e0];return _0x1ca624;};'use strict';var multer=require(_0x50a3('0x0'));var util=require(_0x50a3('0x1'));var path=require(_0x50a3('0x2'));var timeout=require(_0x50a3('0x3'));var express=require(_0x50a3('0x4'));var router=express[_0x50a3('0x5')]();var auth=require(_0x50a3('0x6'));var interaction=require(_0x50a3('0x7'));var config=require(_0x50a3('0x8'));var controller=require('./faxInteraction.controller');router[_0x50a3('0x9')]('/',auth[_0x50a3('0xa')](),controller[_0x50a3('0xb')]);router[_0x50a3('0x9')]('/describe',auth[_0x50a3('0xa')](),controller[_0x50a3('0xc')]);router['get'](_0x50a3('0xd'),auth[_0x50a3('0xa')](),controller[_0x50a3('0xe')]);router[_0x50a3('0x9')](_0x50a3('0xf'),auth['isAuthenticated'](),controller[_0x50a3('0x10')]);router[_0x50a3('0x9')](_0x50a3('0x11'),auth[_0x50a3('0xa')](),controller['download']);router['post']('/',auth[_0x50a3('0xa')](),controller['create']);router[_0x50a3('0x12')](_0x50a3('0xf'),auth[_0x50a3('0xa')](),controller[_0x50a3('0x13')]);router['post']('/:id/tags',auth[_0x50a3('0xa')](),interaction[_0x50a3('0x14')](_0x50a3('0x15'),_0x50a3('0x16')),controller[_0x50a3('0x17')]);router['put'](_0x50a3('0xd'),auth[_0x50a3('0xa')](),interaction['tracked'](_0x50a3('0x15'),'faxinteraction:update'),controller[_0x50a3('0x18')]);router[_0x50a3('0x19')](_0x50a3('0xd'),auth[_0x50a3('0xa')](),interaction[_0x50a3('0x14')](_0x50a3('0x15'),_0x50a3('0x1a')),controller[_0x50a3('0x1b')]);router[_0x50a3('0x19')](_0x50a3('0x1c'),auth[_0x50a3('0xa')](),controller['removeTags']);module[_0x50a3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 736b78e..cf7bb5a 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebb6=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x21d601,_0x25751f){var _0x5b8129=function(_0x4a9487){while(--_0x4a9487){_0x21d601['push'](_0x21d601['shift']());}};_0x5b8129(++_0x25751f);}(_0xebb6,0xb3));var _0x6ebb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xebb6[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x6ebb('0x0'));module[_0x6ebb('0x1')]={'body':{'type':Sequelize[_0x6ebb('0x2')](_0x6ebb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6ebb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6ebb('0x5')]('in',_0x6ebb('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x6ebb('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6ebb('0x7')]}}; \ No newline at end of file +var _0xbdb7=['exports','TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xbdb7,0xfb));var _0x7bdb=function(_0x4a232c,_0x4db76b){_0x4a232c=_0x4a232c-0x0;var _0xb5807f=_0xbdb7[_0x4a232c];return _0xb5807f;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'body':{'type':Sequelize[_0x7bdb('0x2')](_0x7bdb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7bdb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7bdb('0x5')),'defaultValue':_0x7bdb('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x7bdb('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7bdb('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5e8a90d..4197a2b 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file +var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index bf1a30e..d69895b 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x235e2b,_0x232235){var _0x4e9f0a=function(_0x2f5bf2){while(--_0x2f5bf2){_0x235e2b['push'](_0x235e2b['shift']());}};_0x4e9f0a(++_0x232235);}(_0x7217,0x19e));var _0x7721=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7217[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0x7721('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7721('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){FaxMessageEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);FaxMessageEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];FaxMessage[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0xebfa7e,_0x47295d){var _0x33c55f=function(_0x2747c2){while(--_0x2747c2){_0xebfa7e['push'](_0xebfa7e['shift']());}};_0x33c55f(++_0x47295d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x7995('0x0'));var FaxMessage=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){FaxMessageEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);FaxMessageEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];FaxMessage[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 914ce5e..89f5d84 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb362=['UserId','FaxInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxMessage','fti_fax_messages','body','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x3233cb,_0x4ba76e){var _0x30a7d6=function(_0x5ae9ed){while(--_0x5ae9ed){_0x3233cb['push'](_0x3233cb['shift']());}};_0x30a7d6(++_0x4ba76e);}(_0xb362,0x105));var _0x2b36=function(_0x16e705,_0x3c1245){_0x16e705=_0x16e705-0x0;var _0x1008fd=_0xb362[_0x16e705];return _0x1008fd;};'use strict';var _=require('lodash');var util=require(_0x2b36('0x0'));var logger=require('../../config/logger')(_0x2b36('0x1'));var moment=require('moment');var BPromise=require(_0x2b36('0x2'));var rp=require(_0x2b36('0x3'));var fs=require('fs');var path=require(_0x2b36('0x4'));var rimraf=require(_0x2b36('0x5'));var config=require(_0x2b36('0x6'));var attributes=require('./faxMessage.attributes');module[_0x2b36('0x7')]=function(_0x2870ae,_0x91bdef){return _0x2870ae[_0x2b36('0x8')](_0x2b36('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x2b36('0xa'),'fields':[_0x2b36('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4138fb,_0x3ce39c,_0x3bf2d1){var _0x1be19e=_0x2870ae[_0x2b36('0xc')];var _0x217ca8=_0x4138fb[_0x2b36('0xd')]({'plain':!![]});if(_0x217ca8[_0x2b36('0xe')][_0x2b36('0xf')]()==='in'||_0x217ca8['direction'][_0x2b36('0xf')]()===_0x2b36('0x10')&&!_0x217ca8[_0x2b36('0x11')]&&!_[_0x2b36('0x12')](_0x217ca8[_0x2b36('0x13')])){_0x1be19e[_0x2b36('0x14')][_0x2b36('0x15')]({'where':{'id':_0x217ca8['FaxInteractionId']}})[_0x2b36('0x16')](function(_0x1ecc8d){if(_0x1ecc8d){_0x1ecc8d[_0x2b36('0x17')]({'lastMsgAt':_0x217ca8['createdAt'],'lastMsgDirection':_0x217ca8[_0x2b36('0xe')][_0x2b36('0xf')]()});}})[_0x2b36('0x18')](function(_0x10fb26){console[_0x2b36('0x19')](_0x10fb26);});}_0x3bf2d1();}},'charset':_0x2b36('0x1a'),'collate':_0x2b36('0x1b')});}; \ No newline at end of file +var _0x37bd=['then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','findOne'];(function(_0x53caac,_0x161a9d){var _0x398fbe=function(_0x178d36){while(--_0x178d36){_0x53caac['push'](_0x53caac['shift']());}};_0x398fbe(++_0x161a9d);}(_0x37bd,0x146));var _0xd37b=function(_0x59ab6c,_0x441c57){_0x59ab6c=_0x59ab6c-0x0;var _0x226458=_0x37bd[_0x59ab6c];return _0x226458;};'use strict';var _=require(_0xd37b('0x0'));var util=require(_0xd37b('0x1'));var logger=require(_0xd37b('0x2'))(_0xd37b('0x3'));var moment=require(_0xd37b('0x4'));var BPromise=require('bluebird');var rp=require(_0xd37b('0x5'));var fs=require('fs');var path=require(_0xd37b('0x6'));var rimraf=require(_0xd37b('0x7'));var config=require(_0xd37b('0x8'));var attributes=require(_0xd37b('0x9'));module[_0xd37b('0xa')]=function(_0x632450,_0x2003c2){return _0x632450[_0xd37b('0xb')](_0xd37b('0xc'),attributes,{'tableName':_0xd37b('0xd'),'paranoid':![],'indexes':[{'name':_0xd37b('0xe'),'fields':['body'],'type':_0xd37b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30e5db,_0xcc850b,_0x56cb35){var _0x276856=_0x632450[_0xd37b('0x10')];var _0x501264=_0x30e5db[_0xd37b('0x11')]({'plain':!![]});if(_0x501264[_0xd37b('0x12')][_0xd37b('0x13')]()==='in'||_0x501264['direction']['toLowerCase']()===_0xd37b('0x14')&&!_0x501264['secret']&&!_['isNil'](_0x501264['UserId'])){_0x276856['FaxInteraction'][_0xd37b('0x15')]({'where':{'id':_0x501264['FaxInteractionId']}})[_0xd37b('0x16')](function(_0x5aeafd){if(_0x5aeafd){_0x5aeafd[_0xd37b('0x17')]({'lastMsgAt':_0x501264[_0xd37b('0x18')],'lastMsgDirection':_0x501264[_0xd37b('0x12')][_0xd37b('0x13')]()});}})[_0xd37b('0x19')](function(_0x5bec13){console[_0xd37b('0x1a')](_0x5bec13);});}_0x56cb35();}},'charset':_0xd37b('0x1b'),'collate':_0xd37b('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index e7a94cc..d0f83b2 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7818=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','lodash'];(function(_0x3324e1,_0x416af2){var _0x2b891b=function(_0x595855){while(--_0x595855){_0x3324e1['push'](_0x3324e1['shift']());}};_0x2b891b(++_0x416af2);}(_0x7818,0x1db));var _0x8781=function(_0x37134a,_0x44a74f){_0x37134a=_0x37134a-0x0;var _0x2035c8=_0x7818[_0x37134a];return _0x2035c8;};'use strict';var _=require(_0x8781('0x0'));var util=require(_0x8781('0x1'));var moment=require(_0x8781('0x2'));var BPromise=require(_0x8781('0x3'));var rs=require(_0x8781('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8781('0x5'))['db'];var utils=require(_0x8781('0x6'));var logger=require(_0x8781('0x7'))('rpc');var config=require(_0x8781('0x8'));var jayson=require(_0x8781('0x9'));var client=jayson[_0x8781('0xa')][_0x8781('0xb')]({'port':0x232a});config[_0x8781('0xc')]=_['defaults'](config[_0x8781('0xc')],{'host':_0x8781('0xd'),'port':0x18eb});var socket=require(_0x8781('0xe'))(new Redis(config[_0x8781('0xc')]));require(_0x8781('0xf'))['register'](socket);function respondWithRpcPromise(_0x131ed5,_0x4436c4,_0x401804){return new BPromise(function(_0x37c301,_0x3ab17e){return client['request'](_0x131ed5,_0x401804)[_0x8781('0x10')](function(_0x290597){logger['info']('FaxMessage,\x20%s,\x20%s',_0x4436c4,_0x8781('0x11'));logger[_0x8781('0x12')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4436c4,_0x8781('0x11'),JSON[_0x8781('0x13')](_0x290597));if(_0x290597[_0x8781('0x14')]){if(_0x290597[_0x8781('0x14')][_0x8781('0x15')]===0x1f4){logger[_0x8781('0x14')](_0x8781('0x16'),_0x4436c4,_0x290597[_0x8781('0x14')]['message']);return _0x3ab17e(_0x290597['error'][_0x8781('0x17')]);}logger[_0x8781('0x14')](_0x8781('0x16'),_0x4436c4,_0x290597['error'][_0x8781('0x17')]);return _0x37c301(_0x290597['error'][_0x8781('0x17')]);}else{logger['info'](_0x8781('0x16'),_0x4436c4,_0x8781('0x11'));_0x37c301(_0x290597[_0x8781('0x18')][_0x8781('0x17')]);}})[_0x8781('0x19')](function(_0xb22eec){logger[_0x8781('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4436c4,_0xb22eec);_0x3ab17e(_0xb22eec);});});}exports[_0x8781('0x1a')]=function(_0x57e35b){var _0x37eded=this;return new Promise(function(_0x3c05f7,_0x13ffae){return db[_0x8781('0x1b')]['create'](_0x57e35b[_0x8781('0x1c')],{'raw':_0x57e35b[_0x8781('0x1d')]?_0x57e35b[_0x8781('0x1d')][_0x8781('0x1e')]===undefined?!![]:![]:!![]})[_0x8781('0x10')](function(_0x564470){logger['info']('CreateFaxMessage',_0x57e35b);logger[_0x8781('0x12')](_0x8781('0x1a'),_0x57e35b,JSON[_0x8781('0x13')](_0x564470));_0x3c05f7(_0x564470);})[_0x8781('0x19')](function(_0x340135){logger[_0x8781('0x14')]('CreateFaxMessage',_0x340135[_0x8781('0x17')],_0x57e35b);_0x13ffae(_0x37eded[_0x8781('0x14')](0x1f4,_0x340135['message']));});});};exports[_0x8781('0x1f')]=function(_0x2686bf){var _0x2c16db=this;return new Promise(function(_0x1ab0d0,_0x149a57){return db[_0x8781('0x1b')][_0x8781('0x20')](_0x2686bf[_0x8781('0x1c')],{'raw':_0x2686bf[_0x8781('0x1d')]?_0x2686bf['options'][_0x8781('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2686bf[_0x8781('0x1d')]?_0x2686bf[_0x8781('0x1d')]['where']||null:null,'attributes':_0x2686bf['options']?_0x2686bf[_0x8781('0x1d')][_0x8781('0x21')]||null:null,'limit':_0x2686bf[_0x8781('0x1d')]?_0x2686bf['options']['limit']||null:null})[_0x8781('0x10')](function(_0x13b2eb){logger['info'](_0x8781('0x1f'),_0x2686bf);logger[_0x8781('0x12')](_0x8781('0x1f'),_0x2686bf,JSON['stringify'](_0x13b2eb));_0x1ab0d0(_0x13b2eb);})[_0x8781('0x19')](function(_0x41dfb5){logger['error']('UpdateFaxMessage',_0x41dfb5[_0x8781('0x17')],_0x2686bf);_0x149a57(_0x2c16db[_0x8781('0x14')](0x1f4,_0x41dfb5[_0x8781('0x17')]));});});}; \ No newline at end of file +var _0xfc68=['limit','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','UpdateFaxMessage','update','options','attributes'];(function(_0x435d3f,_0x54e991){var _0x1c6526=function(_0x4347c9){while(--_0x4347c9){_0x435d3f['push'](_0x435d3f['shift']());}};_0x1c6526(++_0x54e991);}(_0xfc68,0xb6));var _0x8fc6=function(_0x372400,_0xdaeb10){_0x372400=_0x372400-0x0;var _0x4cd28c=_0xfc68[_0x372400];return _0x4cd28c;};'use strict';var _=require(_0x8fc6('0x0'));var util=require(_0x8fc6('0x1'));var moment=require(_0x8fc6('0x2'));var BPromise=require(_0x8fc6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8fc6('0x4'));var db=require(_0x8fc6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fc6('0x6'))(_0x8fc6('0x7'));var config=require(_0x8fc6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8fc6('0x9')][_0x8fc6('0xa')]({'port':0x232a});config[_0x8fc6('0xb')]=_[_0x8fc6('0xc')](config[_0x8fc6('0xb')],{'host':_0x8fc6('0xd'),'port':0x18eb});var socket=require(_0x8fc6('0xe'))(new Redis(config[_0x8fc6('0xb')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x54049c,_0xa706c1,_0x2b7923){return new BPromise(function(_0x572d09,_0x55ad32){return client[_0x8fc6('0xf')](_0x54049c,_0x2b7923)[_0x8fc6('0x10')](function(_0x4bd435){logger[_0x8fc6('0x11')]('FaxMessage,\x20%s,\x20%s',_0xa706c1,_0x8fc6('0x12'));logger[_0x8fc6('0x13')](_0x8fc6('0x14'),_0xa706c1,_0x8fc6('0x12'),JSON[_0x8fc6('0x15')](_0x4bd435));if(_0x4bd435['error']){if(_0x4bd435[_0x8fc6('0x16')]['code']===0x1f4){logger[_0x8fc6('0x16')](_0x8fc6('0x17'),_0xa706c1,_0x4bd435['error'][_0x8fc6('0x18')]);return _0x55ad32(_0x4bd435['error'][_0x8fc6('0x18')]);}logger[_0x8fc6('0x16')](_0x8fc6('0x17'),_0xa706c1,_0x4bd435[_0x8fc6('0x16')][_0x8fc6('0x18')]);return _0x572d09(_0x4bd435[_0x8fc6('0x16')][_0x8fc6('0x18')]);}else{logger['info'](_0x8fc6('0x17'),_0xa706c1,_0x8fc6('0x12'));_0x572d09(_0x4bd435[_0x8fc6('0x19')]['message']);}})['catch'](function(_0xcd3fee){logger[_0x8fc6('0x16')](_0x8fc6('0x17'),_0xa706c1,_0xcd3fee);_0x55ad32(_0xcd3fee);});});}exports[_0x8fc6('0x1a')]=function(_0x1a308d){var _0x5ea73e=this;return new Promise(function(_0x1dd1d3,_0x9f6422){return db[_0x8fc6('0x1b')]['create'](_0x1a308d[_0x8fc6('0x1c')],{'raw':_0x1a308d['options']?_0x1a308d['options'][_0x8fc6('0x1d')]===undefined?!![]:![]:!![]})[_0x8fc6('0x10')](function(_0xf62dec){logger[_0x8fc6('0x11')](_0x8fc6('0x1a'),_0x1a308d);logger[_0x8fc6('0x13')](_0x8fc6('0x1a'),_0x1a308d,JSON[_0x8fc6('0x15')](_0xf62dec));_0x1dd1d3(_0xf62dec);})['catch'](function(_0x30715e){logger['error'](_0x8fc6('0x1a'),_0x30715e['message'],_0x1a308d);_0x9f6422(_0x5ea73e[_0x8fc6('0x16')](0x1f4,_0x30715e[_0x8fc6('0x18')]));});});};exports[_0x8fc6('0x1e')]=function(_0x495066){var _0x1cfcd2=this;return new Promise(function(_0x552643,_0x242371){return db[_0x8fc6('0x1b')][_0x8fc6('0x1f')](_0x495066['body'],{'raw':_0x495066[_0x8fc6('0x20')]?_0x495066[_0x8fc6('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495066['options']?_0x495066[_0x8fc6('0x20')]['where']||null:null,'attributes':_0x495066[_0x8fc6('0x20')]?_0x495066[_0x8fc6('0x20')][_0x8fc6('0x21')]||null:null,'limit':_0x495066['options']?_0x495066['options'][_0x8fc6('0x22')]||null:null})[_0x8fc6('0x10')](function(_0x456c15){logger[_0x8fc6('0x11')]('UpdateFaxMessage',_0x495066);logger[_0x8fc6('0x13')](_0x8fc6('0x1e'),_0x495066,JSON[_0x8fc6('0x15')](_0x456c15));_0x552643(_0x456c15);})[_0x8fc6('0x23')](function(_0x48f13f){logger[_0x8fc6('0x16')]('UpdateFaxMessage',_0x48f13f[_0x8fc6('0x18')],_0x495066);_0x242371(_0x1cfcd2[_0x8fc6('0x16')](0x1f4,_0x48f13f[_0x8fc6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 80cf9d8..b09b4db 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index eb31598..a5ac371 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf579=['./faxMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','post','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x383f5f,_0x4b89e9){var _0x487341=function(_0x45deb3){while(--_0x45deb3){_0x383f5f['push'](_0x383f5f['shift']());}};_0x487341(++_0x4b89e9);}(_0xf579,0x1bc));var _0x9f57=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xf579[_0x45d3f0];return _0x314b79;};'use strict';var multer=require('multer');var util=require(_0x9f57('0x0'));var path=require(_0x9f57('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f57('0x2'));var router=express[_0x9f57('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9f57('0x4'));var config=require(_0x9f57('0x5'));var controller=require(_0x9f57('0x6'));router[_0x9f57('0x7')]('/',auth['isAuthenticated'](),controller[_0x9f57('0x8')]);router['get'](_0x9f57('0x9'),auth[_0x9f57('0xa')](),controller[_0x9f57('0xb')]);router[_0x9f57('0x7')](_0x9f57('0xc'),auth[_0x9f57('0xa')](),controller[_0x9f57('0xd')]);router[_0x9f57('0x7')](_0x9f57('0xe'),auth[_0x9f57('0xa')](),controller['download']);router[_0x9f57('0xf')]('/',auth[_0x9f57('0xa')](),interaction['tracked']('fax',_0x9f57('0x10')),controller[_0x9f57('0x11')]);router[_0x9f57('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9f57('0x13')]);router[_0x9f57('0x12')](_0x9f57('0x14'),auth['isAuthenticated'](),controller[_0x9f57('0x15')]);router[_0x9f57('0x12')](_0x9f57('0x16'),auth[_0x9f57('0xa')](),controller['reject']);router['delete'](_0x9f57('0xc'),auth[_0x9f57('0xa')](),controller[_0x9f57('0x17')]);module[_0x9f57('0x18')]=router; \ No newline at end of file +var _0xf8f8=['create','put','update','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8f8,0x174));var _0x8f8f=function(_0x451e6,_0x2d2905){_0x451e6=_0x451e6-0x0;var _0x19b3fb=_0xf8f8[_0x451e6];return _0x19b3fb;};'use strict';var multer=require(_0x8f8f('0x0'));var util=require(_0x8f8f('0x1'));var path=require(_0x8f8f('0x2'));var timeout=require(_0x8f8f('0x3'));var express=require('express');var router=express[_0x8f8f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8f8f('0x5'));var controller=require(_0x8f8f('0x6'));router[_0x8f8f('0x7')]('/',auth[_0x8f8f('0x8')](),controller[_0x8f8f('0x9')]);router[_0x8f8f('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8f8f('0x7')](_0x8f8f('0xa'),auth[_0x8f8f('0x8')](),controller[_0x8f8f('0xb')]);router['get'](_0x8f8f('0xc'),auth[_0x8f8f('0x8')](),controller[_0x8f8f('0xd')]);router[_0x8f8f('0xe')]('/',auth[_0x8f8f('0x8')](),interaction[_0x8f8f('0xf')](_0x8f8f('0x10'),_0x8f8f('0x11')),controller[_0x8f8f('0x12')]);router[_0x8f8f('0x13')](_0x8f8f('0xa'),auth[_0x8f8f('0x8')](),controller[_0x8f8f('0x14')]);router[_0x8f8f('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0x8f8f('0x15')]);router[_0x8f8f('0x13')](_0x8f8f('0x16'),auth[_0x8f8f('0x8')](),controller[_0x8f8f('0x17')]);router['delete']('/:id',auth[_0x8f8f('0x8')](),controller[_0x8f8f('0x18')]);module[_0x8f8f('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 41e7e3d..4a3b02e 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44c8=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x4df85c,_0x248dfb){var _0x4e2a61=function(_0x4e2c8e){while(--_0x4e2c8e){_0x4df85c['push'](_0x4df85c['shift']());}};_0x4e2a61(++_0x248dfb);}(_0x44c8,0xaa));var _0x844c=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x44c8[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0x844c('0x0')]={'name':{'type':Sequelize[_0x844c('0x1')],'unique':_0x844c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x844c('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x844c('0x4')]('rrmemory',_0x844c('0x5'),_0x844c('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x844c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8726=['exports','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x17fc20,_0x7d3f2f){var _0x29d108=function(_0x286588){while(--_0x286588){_0x17fc20['push'](_0x17fc20['shift']());}};_0x29d108(++_0x7d3f2f);}(_0x8726,0x13a));var _0x6872=function(_0x153a5b,_0x54b883){_0x153a5b=_0x153a5b-0x0;var _0x386512=_0x8726[_0x153a5b];return _0x386512;};'use strict';var Sequelize=require(_0x6872('0x0'));module[_0x6872('0x1')]={'name':{'type':Sequelize[_0x6872('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6872('0x2')]},'timeout':{'type':Sequelize[_0x6872('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6872('0x4')]('rrmemory',_0x6872('0x5'),_0x6872('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 9d9d841..cd6e4ee 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0570=['../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','map','FaxQueue','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','catch','show','rawAttributes','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','body','params','describe','getMembers','findOne','UserFaxQueue','options','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','getTeams','nolimit','addTeams','Agents','interface','sequelize','transaction','forEach','userFaxQueue:save','Team','ids','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x1fcb07,_0x391b02){var _0x3db9bf=function(_0x26f64c){while(--_0x26f64c){_0x1fcb07['push'](_0x1fcb07['shift']());}};_0x3db9bf(++_0x391b02);}(_0x0570,0x172));var _0x0057=function(_0x51d81e,_0x238dfb){_0x51d81e=_0x51d81e-0x0;var _0x23fe54=_0x0570[_0x51d81e];return _0x23fe54;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0057('0x0'));var rimraf=require(_0x0057('0x1'));var zipdir=require(_0x0057('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0057('0x3'));var moment=require('moment');var BPromise=require(_0x0057('0x4'));var Mustache=require('mustache');var util=require(_0x0057('0x5'));var path=require(_0x0057('0x6'));var sox=require(_0x0057('0x7'));var csv=require(_0x0057('0x8'));var ejs=require(_0x0057('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0057('0xa'));var crypto=require('crypto');var jsforce=require(_0x0057('0xb'));var deskjs=require(_0x0057('0xc'));var toCsv=require(_0x0057('0x8'));var querystring=require(_0x0057('0xd'));var Papa=require(_0x0057('0xe'));var Redis=require('ioredis');var authService=require(_0x0057('0xf'));var qs=require(_0x0057('0x10'));var as=require(_0x0057('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0057('0x12'))(_0x0057('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0057('0x14'))['db'];config[_0x0057('0x15')]=_[_0x0057('0x16')](config['redis'],{'host':_0x0057('0x17'),'port':0x18eb});var socket=require(_0x0057('0x18'))(new Redis(config[_0x0057('0x15')]));require(_0x0057('0x19'))['register'](socket);function respondWithStatusCode(_0x1feb22,_0x23c4e4){_0x23c4e4=_0x23c4e4||0xcc;return function(_0x5860f8){if(_0x5860f8){return _0x1feb22[_0x0057('0x1a')](_0x23c4e4);}return _0x1feb22[_0x0057('0x1b')](_0x23c4e4)['end']();};}function respondWithResult(_0x17549f,_0x59a3e7){_0x59a3e7=_0x59a3e7||0xc8;return function(_0x399018){if(_0x399018){return _0x17549f['status'](_0x59a3e7)[_0x0057('0x1c')](_0x399018);}};}function respondWithFilteredResult(_0x403997,_0x507ba9){return function(_0x518f40){if(_0x518f40){var _0x3644fa=_0x518f40['count'],_0x3f64ec=_0x507ba9[_0x0057('0x1d')],_0x5f3919=_0x507ba9[_0x0057('0x1d')]+_0x507ba9[_0x0057('0x1e')],_0x1b7886;if(_0x5f3919>=_0x3644fa){_0x5f3919=_0x3644fa;_0x1b7886=0xc8;}else{_0x1b7886=0xce;}_0x403997[_0x0057('0x1b')](_0x1b7886);return _0x403997[_0x0057('0x1f')](_0x0057('0x20'),_0x3f64ec+'-'+_0x5f3919+'/'+_0x3644fa)[_0x0057('0x1c')](_0x518f40);}return null;};}function patchUpdates(_0x320c62){return function(_0x12fbe3){try{jsonpatch[_0x0057('0x21')](_0x12fbe3,_0x320c62,!![]);}catch(_0x5e6499){return BPromise[_0x0057('0x22')](_0x5e6499);}return _0x12fbe3[_0x0057('0x23')]();};}function saveUpdates(_0x43454a,_0x72fd){return function(_0x483554){if(_0x483554){return _0x483554[_0x0057('0x24')](_0x43454a)[_0x0057('0x25')](function(_0x5b7c01){return _0x5b7c01;});}return null;};}function removeEntity(_0x620fcc,_0xa8d716){return function(_0x53635e){if(_0x53635e){return _0x53635e[_0x0057('0x26')]()[_0x0057('0x25')](function(){var _0x426304=_0x53635e['get']({'plain':!![]});var _0x50b2f7=_0x0057('0x27');return db[_0x0057('0x28')][_0x0057('0x26')]({'where':{'type':_0x50b2f7,'resourceId':_0x426304['id']}})[_0x0057('0x25')](function(){return _0x53635e;});})[_0x0057('0x25')](function(){_0x620fcc[_0x0057('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f3818,_0x5cc3e0){return function(_0x32e92b){if(!_0x32e92b){_0x5f3818[_0x0057('0x1a')](0x194);}return _0x32e92b;};}function handleError(_0x41b628,_0x5dfc14){_0x5dfc14=_0x5dfc14||0x1f4;return function(_0x390fc5){logger[_0x0057('0x29')](_0x390fc5[_0x0057('0x2a')]);if(_0x390fc5[_0x0057('0x2b')]){delete _0x390fc5['name'];}_0x41b628['status'](_0x5dfc14)[_0x0057('0x2c')](_0x390fc5);};}exports['index']=function(_0x1587c9,_0x2acb91){var _0x3475a5={},_0x28ca74={},_0x3914dd={'count':0x0,'rows':[]};var _0x24e42e=_[_0x0057('0x2d')](db[_0x0057('0x2e')]['rawAttributes'],function(_0x1e4bb2){return{'name':_0x1e4bb2['fieldName'],'type':_0x1e4bb2[_0x0057('0x2f')]['key']};});_0x28ca74['model']=_[_0x0057('0x2d')](_0x24e42e,_0x0057('0x2b'));_0x28ca74[_0x0057('0x30')]=_[_0x0057('0x31')](_0x1587c9['query']);_0x28ca74[_0x0057('0x32')]=_[_0x0057('0x33')](_0x28ca74[_0x0057('0x34')],_0x28ca74[_0x0057('0x30')]);_0x3475a5[_0x0057('0x35')]=_[_0x0057('0x33')](_0x28ca74['model'],qs[_0x0057('0x36')](_0x1587c9['query'][_0x0057('0x36')]));_0x3475a5[_0x0057('0x35')]=_0x3475a5[_0x0057('0x35')]['length']?_0x3475a5[_0x0057('0x35')]:_0x28ca74['model'];if(!_0x1587c9['query'][_0x0057('0x37')]('nolimit')){_0x3475a5[_0x0057('0x1e')]=qs[_0x0057('0x1e')](_0x1587c9['query'][_0x0057('0x1e')]);_0x3475a5['offset']=qs[_0x0057('0x1d')](_0x1587c9[_0x0057('0x30')][_0x0057('0x1d')]);}_0x3475a5[_0x0057('0x38')]=qs[_0x0057('0x39')](_0x1587c9['query'][_0x0057('0x39')]);_0x3475a5[_0x0057('0x3a')]=qs[_0x0057('0x32')](_[_0x0057('0x3b')](_0x1587c9[_0x0057('0x30')],_0x28ca74['filters']));if(_0x1587c9[_0x0057('0x30')][_0x0057('0x3c')]){_0x3475a5['where']=_['merge'](_0x3475a5['where'],{'$or':_[_0x0057('0x2d')](_0x24e42e,function(_0x26b13a){if(_0x26b13a[_0x0057('0x2f')]!==_0x0057('0x3d')){var _0x21a720={};_0x21a720[_0x26b13a['name']]={'$like':'%'+_0x1587c9[_0x0057('0x30')]['filter']+'%'};return _0x21a720;}})});}_0x3475a5=_[_0x0057('0x3e')]({},_0x3475a5,_0x1587c9['options']);var _0x36d830={'where':_0x3475a5[_0x0057('0x3a')]};return db[_0x0057('0x2e')]['count'](_0x36d830)[_0x0057('0x25')](function(_0x419f26){_0x3914dd[_0x0057('0x3f')]=_0x419f26;if(_0x1587c9[_0x0057('0x30')][_0x0057('0x40')]){_0x3475a5[_0x0057('0x41')]=[{'all':!![]}];}return db[_0x0057('0x2e')][_0x0057('0x42')](_0x3475a5);})[_0x0057('0x25')](function(_0x133bf1){_0x3914dd['rows']=_0x133bf1;return _0x3914dd;})['then'](respondWithFilteredResult(_0x2acb91,_0x3475a5))[_0x0057('0x43')](handleError(_0x2acb91,null));};exports[_0x0057('0x44')]=function(_0x4aff18,_0x747af4){var _0x465950={'raw':!![],'where':{'id':_0x4aff18['params']['id']}},_0x10bfd5={};_0x10bfd5[_0x0057('0x34')]=_[_0x0057('0x31')](db['FaxQueue'][_0x0057('0x45')]);_0x10bfd5[_0x0057('0x30')]=_['keys'](_0x4aff18[_0x0057('0x30')]);_0x10bfd5[_0x0057('0x32')]=_[_0x0057('0x33')](_0x10bfd5['model'],_0x10bfd5[_0x0057('0x30')]);_0x465950['attributes']=_[_0x0057('0x33')](_0x10bfd5[_0x0057('0x34')],qs['fields'](_0x4aff18[_0x0057('0x30')][_0x0057('0x36')]));_0x465950[_0x0057('0x35')]=_0x465950['attributes'][_0x0057('0x46')]?_0x465950['attributes']:_0x10bfd5[_0x0057('0x34')];if(_0x4aff18[_0x0057('0x30')][_0x0057('0x40')]){_0x465950[_0x0057('0x41')]=[{'all':!![]}];}_0x465950=_[_0x0057('0x3e')]({},_0x465950,_0x4aff18['options']);return db[_0x0057('0x2e')][_0x0057('0x47')](_0x465950)[_0x0057('0x25')](handleEntityNotFound(_0x747af4,null))['then'](respondWithResult(_0x747af4,null))[_0x0057('0x43')](handleError(_0x747af4,null));};exports[_0x0057('0x48')]=function(_0x58abca,_0x3b5625){return db[_0x0057('0x2e')][_0x0057('0x48')](_0x58abca['body'],{})[_0x0057('0x25')](function(_0x98e77e){var _0x5cfce3=_0x58abca[_0x0057('0x49')]['get']({'plain':!![]});if(!_0x5cfce3)throw new Error(_0x0057('0x4a'));if(_0x5cfce3['role']===_0x0057('0x49')){var _0x21e5f3=_0x98e77e[_0x0057('0x4b')]({'plain':!![]});var _0x5d7c7a=_0x0057('0x27');return db[_0x0057('0x4c')][_0x0057('0x47')]({'where':{'name':_0x5d7c7a,'userProfileId':_0x5cfce3[_0x0057('0x4d')]},'raw':!![]})['then'](function(_0x3ceebc){if(_0x3ceebc&&_0x3ceebc['autoAssociation']===0x0){return db[_0x0057('0x28')][_0x0057('0x48')]({'name':_0x21e5f3[_0x0057('0x2b')],'resourceId':_0x21e5f3['id'],'type':_0x3ceebc[_0x0057('0x2b')],'sectionId':_0x3ceebc['id']},{})[_0x0057('0x25')](function(){return _0x98e77e;});}else{return _0x98e77e;}})['catch'](function(_0x151fe7){logger[_0x0057('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x151fe7);throw _0x151fe7;});}return _0x98e77e;})[_0x0057('0x25')](respondWithResult(_0x3b5625,0xc9))['catch'](handleError(_0x3b5625,null));};exports[_0x0057('0x24')]=function(_0xd2198e,_0x1c83c4){if(_0xd2198e[_0x0057('0x4e')]['id']){delete _0xd2198e['body']['id'];}return db[_0x0057('0x2e')]['find']({'where':{'id':_0xd2198e[_0x0057('0x4f')]['id']}})[_0x0057('0x25')](handleEntityNotFound(_0x1c83c4,null))['then'](saveUpdates(_0xd2198e['body'],null))[_0x0057('0x25')](respondWithResult(_0x1c83c4,null))[_0x0057('0x43')](handleError(_0x1c83c4,null));};exports[_0x0057('0x26')]=function(_0x2d3707,_0x158876){return db[_0x0057('0x2e')][_0x0057('0x47')]({'where':{'id':_0x2d3707[_0x0057('0x4f')]['id']}})[_0x0057('0x25')](handleEntityNotFound(_0x158876,null))['then'](removeEntity(_0x158876,null))['catch'](handleError(_0x158876,null));};exports[_0x0057('0x50')]=function(_0x2549b0,_0x1d589d){return db[_0x0057('0x2e')][_0x0057('0x50')]()[_0x0057('0x25')](respondWithResult(_0x1d589d,null))[_0x0057('0x43')](handleError(_0x1d589d,null));};exports[_0x0057('0x51')]=function(_0x11b725,_0x24115b,_0x3118e2){var _0x588fa4={'raw':!![],'where':{}},_0x525f99={},_0x1ccdb4;return db[_0x0057('0x2e')][_0x0057('0x52')]({'where':{'id':_0x11b725['params']['id']}})['then'](handleEntityNotFound(_0x24115b,null))[_0x0057('0x25')](function(_0x5ea515){if(_0x5ea515){_0x1ccdb4=_0x5ea515[_0x0057('0x4b')]({'plain':!![]});_0x525f99[_0x0057('0x34')]=_[_0x0057('0x31')](db[_0x0057('0x53')]['rawAttributes']);_0x525f99[_0x0057('0x30')]=_['keys'](_0x11b725[_0x0057('0x30')]);_0x525f99[_0x0057('0x32')]=_[_0x0057('0x33')](_0x525f99[_0x0057('0x34')],_0x525f99[_0x0057('0x30')]);_0x588fa4[_0x0057('0x35')]=_[_0x0057('0x33')](_0x525f99['model'],qs[_0x0057('0x36')](_0x11b725[_0x0057('0x30')]['fields']));_0x588fa4[_0x0057('0x35')]=_0x588fa4['attributes']['length']?_0x588fa4[_0x0057('0x35')]:_0x525f99[_0x0057('0x34')];if(!_0x11b725[_0x0057('0x30')][_0x0057('0x37')]('nolimit')){_0x588fa4[_0x0057('0x1e')]=qs[_0x0057('0x1e')](_0x11b725[_0x0057('0x30')][_0x0057('0x1e')]);_0x588fa4[_0x0057('0x1d')]=qs[_0x0057('0x1d')](_0x11b725['query'][_0x0057('0x1d')]);}_0x588fa4['order']=qs['sort'](_0x11b725[_0x0057('0x30')]['sort']);_0x588fa4['where']=qs[_0x0057('0x32')](_[_0x0057('0x3b')](_0x11b725[_0x0057('0x30')],_0x525f99[_0x0057('0x32')]));_0x588fa4[_0x0057('0x3a')]['FaxQueueId']=_0x5ea515['id'];if(_0x11b725[_0x0057('0x30')]['filter']){_0x588fa4[_0x0057('0x3a')]=_['merge'](_0x588fa4[_0x0057('0x3a')],{'$or':_[_0x0057('0x2d')](_0x588fa4[_0x0057('0x35')],function(_0x3c0991){var _0x3c02e8={};_0x3c02e8[_0x3c0991]={'$like':'%'+_0x11b725[_0x0057('0x30')]['filter']+'%'};return _0x3c02e8;})});}_0x588fa4=_[_0x0057('0x3e')]({},_0x588fa4,_0x11b725[_0x0057('0x54')]);return db[_0x0057('0x53')][_0x0057('0x42')](_0x588fa4);}})[_0x0057('0x25')](function(_0x266ca6){if(_0x266ca6){return db[_0x0057('0x55')][_0x0057('0x56')]({'where':{'id':_[_0x0057('0x2d')](_0x266ca6,_0x0057('0x57')),'role':'agent'},'attributes':['id',_0x0057('0x2b'),'faxPause',_0x0057('0x58'),_0x0057('0x59')]});}})['then'](function(_0x3779a2){if(_0x3779a2){return{'count':_0x3779a2[_0x0057('0x3f')],'rows':_[_0x0057('0x2d')](_0x3779a2['rows'],function(_0x2a18d1){return{'membername':_0x2a18d1[_0x0057('0x2b')],'UserId':_0x2a18d1['id'],'queue_name':_0x1ccdb4[_0x0057('0x2b')],'FaxQueueId':_0x1ccdb4['id'],'interface':util[_0x0057('0x5a')](_0x0057('0x5b'),_0x0057('0x5c'),_0x2a18d1[_0x0057('0x2b')]),'penalty':0x0,'paused':_0x2a18d1['faxPause'],'createdAt':_0x2a18d1[_0x0057('0x59')],'updatedAt':_0x2a18d1[_0x0057('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0057('0x25')](respondWithFilteredResult(_0x24115b,_0x588fa4))[_0x0057('0x43')](handleError(_0x24115b,null));};exports['getTeams']=function(_0x3970e8,_0x511e0b,_0x24aa26){var _0x595882={};var _0x1f74da={};var _0x4b7a9e;var _0x35d584;return db[_0x0057('0x2e')][_0x0057('0x52')]({'where':{'id':_0x3970e8[_0x0057('0x4f')]['id']}})[_0x0057('0x25')](handleEntityNotFound(_0x511e0b,null))[_0x0057('0x25')](function(_0x5987e0){if(_0x5987e0){_0x4b7a9e=_0x5987e0;_0x1f74da[_0x0057('0x34')]=_[_0x0057('0x31')](db['Team']['rawAttributes']);_0x1f74da[_0x0057('0x30')]=_[_0x0057('0x31')](_0x3970e8['query']);_0x1f74da[_0x0057('0x32')]=_[_0x0057('0x33')](_0x1f74da['model'],_0x1f74da['query']);_0x595882[_0x0057('0x35')]=_['intersection'](_0x1f74da[_0x0057('0x34')],qs['fields'](_0x3970e8[_0x0057('0x30')]['fields']));_0x595882[_0x0057('0x35')]=_0x595882[_0x0057('0x35')]['length']?_0x595882['attributes']:_0x1f74da['model'];_0x595882['order']=qs[_0x0057('0x39')](_0x3970e8[_0x0057('0x30')][_0x0057('0x39')]);_0x595882[_0x0057('0x3a')]=qs[_0x0057('0x32')](_[_0x0057('0x3b')](_0x3970e8[_0x0057('0x30')],_0x1f74da['filters']));if(_0x3970e8[_0x0057('0x30')]['filter']){_0x595882[_0x0057('0x3a')]=_[_0x0057('0x3e')](_0x595882['where'],{'$or':_[_0x0057('0x2d')](_0x595882[_0x0057('0x35')],function(_0x2b5f6e){var _0x1cfa99={};_0x1cfa99[_0x2b5f6e]={'$like':'%'+_0x3970e8['query'][_0x0057('0x3c')]+'%'};return _0x1cfa99;})});}_0x595882=_[_0x0057('0x3e')]({},_0x595882,_0x3970e8[_0x0057('0x54')]);return _0x4b7a9e[_0x0057('0x5d')](_0x595882);}})[_0x0057('0x25')](function(_0x6d9950){if(_0x6d9950){_0x35d584=_0x6d9950[_0x0057('0x46')];if(!_0x3970e8[_0x0057('0x30')]['hasOwnProperty'](_0x0057('0x5e'))){_0x595882[_0x0057('0x1e')]=qs[_0x0057('0x1e')](_0x3970e8[_0x0057('0x30')][_0x0057('0x1e')]);_0x595882[_0x0057('0x1d')]=qs[_0x0057('0x1d')](_0x3970e8[_0x0057('0x30')][_0x0057('0x1d')]);}return _0x4b7a9e['getTeams'](_0x595882);}})[_0x0057('0x25')](function(_0x4b3c88){if(_0x4b3c88){return _0x4b3c88?{'count':_0x35d584,'rows':_0x4b3c88}:null;}})[_0x0057('0x25')](respondWithResult(_0x511e0b,null))[_0x0057('0x43')](handleError(_0x511e0b,null));};exports[_0x0057('0x5f')]=function(_0x1e88fc,_0x53c70c,_0x6b1693){var _0x322eb2=_0x1e88fc[_0x0057('0x4e')]['ids'];return db['Team'][_0x0057('0x42')]({'where':{'id':_0x322eb2},'attributes':['id'],'include':[{'model':db[_0x0057('0x55')],'as':_0x0057('0x60'),'attributes':['id',_0x0057('0x2b'),'online','voicePause',_0x0057('0x61')],'raw':!![]}]})[_0x0057('0x25')](function(_0x3869d1){if(_0x3869d1){var _0x473dd4=_['flatMap'](_0x3869d1,function(_0x6dcb00){var _0x55ccb2=_0x6dcb00[_0x0057('0x4b')]({'plain':!![]});return _0x55ccb2['Agents'];});return db['FaxQueue']['find']({'where':{'id':_0x1e88fc[_0x0057('0x4f')]['id']}})['then'](function(_0x44bb44){return db[_0x0057('0x62')][_0x0057('0x63')](function(_0x373be3){return _0x44bb44[_0x0057('0x5f')](_0x322eb2,{'transaction':_0x373be3})[_0x0057('0x25')](function(){return BPromise['each'](_0x473dd4,function(_0x296988){return db[_0x0057('0x53')]['findOrCreate']({'where':{'UserId':_0x296988['id'],'FaxQueueId':_0x1e88fc[_0x0057('0x4f')]['id']},'transaction':_0x373be3});});})[_0x0057('0x25')](function(){_0x473dd4[_0x0057('0x64')](function(_0x4ccf7d){socket['emit'](_0x0057('0x65'),{'UserId':_0x4ccf7d['id'],'FaxQueueId':_0x44bb44['id']});});});});});}})[_0x0057('0x25')](respondWithStatusCode(_0x53c70c,null))[_0x0057('0x43')](handleError(_0x53c70c,null));};exports['removeTeams']=function(_0x44a1cb,_0x4bbd34,_0x28d9ff){return db[_0x0057('0x66')][_0x0057('0x42')]({'where':{'id':_0x44a1cb['query'][_0x0057('0x67')]},'attributes':['id'],'include':[{'model':db[_0x0057('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0057('0x25')](handleEntityNotFound(_0x4bbd34,null))[_0x0057('0x25')](function(_0x2d142c){var _0x3278b3=_['map'](_0x2d142c,'id');var _0x2cd32b=[];var _0xbe93a6=[];var _0x5300df=squel['select']();_0x5300df[_0x0057('0x68')](_0x0057('0x69'))[_0x0057('0x6a')](_0x0057('0x6b'),'tq')['join'](_0x0057('0x6c'),'ut',_0x0057('0x6d'))['where'](_0x0057('0x6e'),_0x44a1cb['params']['id']);for(var _0x15e8e2=0x0;_0x15e8e2<_0x2d142c[_0x0057('0x46')];_0x15e8e2+=0x1){let _0x457130=_0x2d142c[_0x15e8e2];for(var _0x243f68=0x0;_0x243f68<_0x457130['Agents'][_0x0057('0x46')];_0x243f68+=0x1){let _0x281979=_0x457130[_0x0057('0x60')][_0x243f68];var _0x276332=_0x5300df[_0x0057('0x6f')]();_0x276332[_0x0057('0x3a')]('ut.UserId\x20=\x20?',_0x281979['id']);_0xbe93a6[_0x0057('0x70')](db['sequelize'][_0x0057('0x30')](_0x276332[_0x0057('0x71')](),{'type':db[_0x0057('0x62')][_0x0057('0x72')][_0x0057('0x73')]})['then'](function(_0x5de02b){if(_0x5de02b[_0x0057('0x46')]===0x1){return _0x281979['id'];}else{var _0x130691=_['every'](_['map'](_0x5de02b,'TeamId'),function(_0x2d87ae){return _[_0x0057('0x74')](_0x3278b3,_0x2d87ae);});if(_0x130691){return _0x281979['id'];}}}));}}return BPromise[_0x0057('0x75')](_0xbe93a6)['then'](function(_0x35fe2f){_0x2cd32b=_(_0x2cd32b)[_0x0057('0x76')](_0x35fe2f)[_0x0057('0x77')]()[_0x0057('0x78')]();return db[_0x0057('0x2e')][_0x0057('0x47')]({'where':{'id':_0x44a1cb['params']['id']}})['then'](function(_0x1e8060){return db[_0x0057('0x62')][_0x0057('0x63')](function(_0x16281c){return _0x1e8060['removeTeams'](_0x44a1cb[_0x0057('0x30')]['ids'],{'transaction':_0x16281c})[_0x0057('0x25')](function(){if(!_['isEmpty'](_0x2cd32b)){return _0x1e8060[_0x0057('0x79')](_0x2cd32b,{'transaction':_0x16281c});}})[_0x0057('0x25')](function(){_0x2cd32b[_0x0057('0x64')](function(_0x541e31){socket[_0x0057('0x7a')](_0x0057('0x7b'),{'UserId':_0x541e31,'FaxQueueId':_0x1e8060['id']});});});});});});})['then'](respondWithStatusCode(_0x4bbd34,null))[_0x0057('0x43')](handleError(_0x4bbd34,null));};exports[_0x0057('0x7c')]=function(_0x230623,_0x5b3115,_0x5a118f){return db['FaxQueue']['find']({'where':{'id':_0x230623[_0x0057('0x4f')]['id']}})[_0x0057('0x25')](handleEntityNotFound(_0x5b3115,null))[_0x0057('0x25')](function(_0x3fc5eb){if(_0x3fc5eb){return _0x3fc5eb[_0x0057('0x7c')](_0x230623['body'][_0x0057('0x67')],_[_0x0057('0x7d')](_0x230623[_0x0057('0x4e')],['ids','id'])||{})[_0x0057('0x7e')](function(_0x16b8af){for(var _0x152826=0x0;_0x152826<_0x230623[_0x0057('0x4e')]['ids']['length'];_0x152826+=0x1){socket[_0x0057('0x7a')]('userFaxQueue:save',{'UserId':_0x230623[_0x0057('0x4e')][_0x0057('0x67')][_0x152826],'FaxQueueId':_0x230623[_0x0057('0x4f')]['id']});}return _0x16b8af;});}})[_0x0057('0x25')](respondWithResult(_0x5b3115,null))[_0x0057('0x43')](handleError(_0x5b3115,null));};exports[_0x0057('0x79')]=function(_0x1357c0,_0x1ec353,_0x381a36){return db[_0x0057('0x2e')][_0x0057('0x47')]({'where':{'id':_0x1357c0[_0x0057('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1ec353,null))[_0x0057('0x25')](function(_0x179214){if(_0x179214){return _0x179214[_0x0057('0x79')](_0x1357c0[_0x0057('0x30')][_0x0057('0x67')])[_0x0057('0x25')](function(){if(_[_0x0057('0x7f')](_0x1357c0[_0x0057('0x30')][_0x0057('0x67')])){for(var _0x45d5c4=0x0;_0x45d5c4<_0x1357c0['query'][_0x0057('0x67')][_0x0057('0x46')];_0x45d5c4+=0x1){socket[_0x0057('0x7a')](_0x0057('0x7b'),{'UserId':Number(_0x1357c0[_0x0057('0x30')][_0x0057('0x67')][_0x45d5c4]),'FaxQueueId':Number(_0x1357c0[_0x0057('0x4f')]['id'])});}}else{socket[_0x0057('0x7a')](_0x0057('0x7b'),{'UserId':Number(_0x1357c0[_0x0057('0x30')][_0x0057('0x67')]),'FaxQueueId':Number(_0x1357c0[_0x0057('0x4f')]['id'])});}});}})[_0x0057('0x25')](respondWithStatusCode(_0x1ec353,null))[_0x0057('0x43')](handleError(_0x1ec353,null));};exports[_0x0057('0x80')]=function(_0x21a3df,_0xa4fdf6,_0x435fc3){var _0x281b91={};var _0x715246={};var _0x5d6ac6;var _0xf77fe6;return db[_0x0057('0x2e')][_0x0057('0x52')]({'where':{'id':_0x21a3df[_0x0057('0x4f')]['id']}})[_0x0057('0x25')](handleEntityNotFound(_0xa4fdf6,null))['then'](function(_0x60744f){if(_0x60744f){_0x5d6ac6=_0x60744f;_0x715246['model']=_[_0x0057('0x31')](db[_0x0057('0x55')][_0x0057('0x45')]);_0x715246[_0x0057('0x30')]=_[_0x0057('0x31')](_0x21a3df['query']);_0x715246[_0x0057('0x32')]=_['intersection'](_0x715246[_0x0057('0x34')],_0x715246[_0x0057('0x30')]);_0x281b91[_0x0057('0x35')]=_[_0x0057('0x33')](_0x715246[_0x0057('0x34')],qs['fields'](_0x21a3df['query'][_0x0057('0x36')]));_0x281b91[_0x0057('0x35')]=_0x281b91[_0x0057('0x35')][_0x0057('0x46')]?_0x281b91[_0x0057('0x35')]:_0x715246[_0x0057('0x34')];_0x281b91['order']=qs['sort'](_0x21a3df[_0x0057('0x30')][_0x0057('0x39')]);_0x281b91[_0x0057('0x3a')]=qs[_0x0057('0x32')](_[_0x0057('0x3b')](_0x21a3df[_0x0057('0x30')],_0x715246[_0x0057('0x32')]));if(_0x21a3df[_0x0057('0x30')][_0x0057('0x3c')]){_0x281b91[_0x0057('0x3a')]=_[_0x0057('0x3e')](_0x281b91[_0x0057('0x3a')],{'$or':_['map'](_0x281b91[_0x0057('0x35')],function(_0x3325f5){var _0x2d23a0={};_0x2d23a0[_0x3325f5]={'$like':'%'+_0x21a3df['query'][_0x0057('0x3c')]+'%'};return _0x2d23a0;})});}_0x281b91=_[_0x0057('0x3e')]({},_0x281b91,_0x21a3df[_0x0057('0x54')]);return _0x5d6ac6['getAgents'](_0x281b91);}})[_0x0057('0x25')](function(_0x459650){if(_0x459650){_0xf77fe6=_0x459650[_0x0057('0x46')];if(!_0x21a3df['query'][_0x0057('0x37')](_0x0057('0x5e'))){_0x281b91[_0x0057('0x1e')]=qs[_0x0057('0x1e')](_0x21a3df['query']['limit']);_0x281b91['offset']=qs['offset'](_0x21a3df['query']['offset']);}return _0x5d6ac6[_0x0057('0x80')](_0x281b91);}})['then'](function(_0x131172){if(_0x131172){return _0x131172?{'count':_0xf77fe6,'rows':_0x131172}:null;}})[_0x0057('0x25')](respondWithResult(_0xa4fdf6,null))['catch'](handleError(_0xa4fdf6,null));}; \ No newline at end of file +var _0x9ffd=['interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','status','count','offset','limit','set','update','then','get','FaxQueues','destroy','sendStatus','error','stack','name','send','index','FaxQueue','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','catch','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','nolimit','pick','options','User','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','ids','Team','Agents','voicePause'];(function(_0x1b791d,_0x4ac2df){var _0x45432d=function(_0x267d00){while(--_0x267d00){_0x1b791d['push'](_0x1b791d['shift']());}};_0x45432d(++_0x4ac2df);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5c36c7,_0x287242){_0x5c36c7=_0x5c36c7-0x0;var _0x4aad86=_0x9ffd[_0x5c36c7];return _0x4aad86;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x11'));var hardwareService=require(_0xd9ff('0x12'));var logger=require(_0xd9ff('0x13'))(_0xd9ff('0x14'));var utils=require(_0xd9ff('0x15'));var config=require(_0xd9ff('0x16'));var db=require(_0xd9ff('0x17'))['db'];config[_0xd9ff('0x18')]=_['defaults'](config['redis'],{'host':_0xd9ff('0x19'),'port':0x18eb});var socket=require(_0xd9ff('0x1a'))(new Redis(config[_0xd9ff('0x18')]));require(_0xd9ff('0x1b'))[_0xd9ff('0x1c')](socket);function respondWithStatusCode(_0x556aa4,_0x2f78c1){_0x2f78c1=_0x2f78c1||0xcc;return function(_0x3c9ace){if(_0x3c9ace){return _0x556aa4['sendStatus'](_0x2f78c1);}return _0x556aa4[_0xd9ff('0x1d')](_0x2f78c1)['end']();};}function respondWithResult(_0x4ffe54,_0x547e28){_0x547e28=_0x547e28||0xc8;return function(_0x4c5718){if(_0x4c5718){return _0x4ffe54[_0xd9ff('0x1d')](_0x547e28)['json'](_0x4c5718);}};}function respondWithFilteredResult(_0x35679e,_0xa30fd2){return function(_0x39c6ce){if(_0x39c6ce){var _0x3afd19=_0x39c6ce[_0xd9ff('0x1e')],_0x5f45c4=_0xa30fd2[_0xd9ff('0x1f')],_0x2d4df1=_0xa30fd2[_0xd9ff('0x1f')]+_0xa30fd2[_0xd9ff('0x20')],_0x3ccf15;if(_0x2d4df1>=_0x3afd19){_0x2d4df1=_0x3afd19;_0x3ccf15=0xc8;}else{_0x3ccf15=0xce;}_0x35679e[_0xd9ff('0x1d')](_0x3ccf15);return _0x35679e[_0xd9ff('0x21')]('Content-Range',_0x5f45c4+'-'+_0x2d4df1+'/'+_0x3afd19)['json'](_0x39c6ce);}return null;};}function patchUpdates(_0x264a3d){return function(_0x3eed13){try{jsonpatch['apply'](_0x3eed13,_0x264a3d,!![]);}catch(_0x588151){return BPromise['reject'](_0x588151);}return _0x3eed13['save']();};}function saveUpdates(_0x1f4d9e,_0x58eb5f){return function(_0x4c486a){if(_0x4c486a){return _0x4c486a[_0xd9ff('0x22')](_0x1f4d9e)[_0xd9ff('0x23')](function(_0x9f074e){return _0x9f074e;});}return null;};}function removeEntity(_0x278b66,_0x42a828){return function(_0x4b058a){if(_0x4b058a){return _0x4b058a['destroy']()[_0xd9ff('0x23')](function(){var _0x599fec=_0x4b058a[_0xd9ff('0x24')]({'plain':!![]});var _0x4d86fe=_0xd9ff('0x25');return db['UserProfileResource'][_0xd9ff('0x26')]({'where':{'type':_0x4d86fe,'resourceId':_0x599fec['id']}})[_0xd9ff('0x23')](function(){return _0x4b058a;});})[_0xd9ff('0x23')](function(){_0x278b66[_0xd9ff('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11a17b,_0xe11f88){return function(_0x1c78c4){if(!_0x1c78c4){_0x11a17b[_0xd9ff('0x27')](0x194);}return _0x1c78c4;};}function handleError(_0x5c1c1f,_0x1d3684){_0x1d3684=_0x1d3684||0x1f4;return function(_0x3792d9){logger[_0xd9ff('0x28')](_0x3792d9[_0xd9ff('0x29')]);if(_0x3792d9[_0xd9ff('0x2a')]){delete _0x3792d9[_0xd9ff('0x2a')];}_0x5c1c1f[_0xd9ff('0x1d')](_0x1d3684)[_0xd9ff('0x2b')](_0x3792d9);};}exports[_0xd9ff('0x2c')]=function(_0x5706cf,_0xcea5db){var _0x4ba2be={},_0x1d55fd={},_0x29c532={'count':0x0,'rows':[]};var _0xbdd352=_['map'](db[_0xd9ff('0x2d')][_0xd9ff('0x2e')],function(_0x56e5be){return{'name':_0x56e5be[_0xd9ff('0x2f')],'type':_0x56e5be['type'][_0xd9ff('0x30')]};});_0x1d55fd['model']=_[_0xd9ff('0x31')](_0xbdd352,_0xd9ff('0x2a'));_0x1d55fd[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x5706cf[_0xd9ff('0x32')]);_0x1d55fd[_0xd9ff('0x34')]=_[_0xd9ff('0x35')](_0x1d55fd[_0xd9ff('0x36')],_0x1d55fd[_0xd9ff('0x32')]);_0x4ba2be[_0xd9ff('0x37')]=_[_0xd9ff('0x35')](_0x1d55fd[_0xd9ff('0x36')],qs[_0xd9ff('0x38')](_0x5706cf[_0xd9ff('0x32')]['fields']));_0x4ba2be[_0xd9ff('0x37')]=_0x4ba2be[_0xd9ff('0x37')][_0xd9ff('0x39')]?_0x4ba2be['attributes']:_0x1d55fd[_0xd9ff('0x36')];if(!_0x5706cf['query'][_0xd9ff('0x3a')]('nolimit')){_0x4ba2be[_0xd9ff('0x20')]=qs['limit'](_0x5706cf[_0xd9ff('0x32')][_0xd9ff('0x20')]);_0x4ba2be[_0xd9ff('0x1f')]=qs['offset'](_0x5706cf['query']['offset']);}_0x4ba2be[_0xd9ff('0x3b')]=qs[_0xd9ff('0x3c')](_0x5706cf[_0xd9ff('0x32')][_0xd9ff('0x3c')]);_0x4ba2be[_0xd9ff('0x3d')]=qs[_0xd9ff('0x34')](_['pick'](_0x5706cf['query'],_0x1d55fd['filters']));if(_0x5706cf[_0xd9ff('0x32')][_0xd9ff('0x3e')]){_0x4ba2be[_0xd9ff('0x3d')]=_[_0xd9ff('0x3f')](_0x4ba2be['where'],{'$or':_[_0xd9ff('0x31')](_0xbdd352,function(_0x5b8e17){if(_0x5b8e17[_0xd9ff('0x40')]!==_0xd9ff('0x41')){var _0x1bedaf={};_0x1bedaf[_0x5b8e17[_0xd9ff('0x2a')]]={'$like':'%'+_0x5706cf['query'][_0xd9ff('0x3e')]+'%'};return _0x1bedaf;}})});}_0x4ba2be=_[_0xd9ff('0x3f')]({},_0x4ba2be,_0x5706cf['options']);var _0x459215={'where':_0x4ba2be[_0xd9ff('0x3d')]};return db[_0xd9ff('0x2d')][_0xd9ff('0x1e')](_0x459215)[_0xd9ff('0x23')](function(_0x1cc848){_0x29c532['count']=_0x1cc848;if(_0x5706cf[_0xd9ff('0x32')][_0xd9ff('0x42')]){_0x4ba2be[_0xd9ff('0x43')]=[{'all':!![]}];}return db[_0xd9ff('0x2d')][_0xd9ff('0x44')](_0x4ba2be);})['then'](function(_0x3178cd){_0x29c532[_0xd9ff('0x45')]=_0x3178cd;return _0x29c532;})[_0xd9ff('0x23')](respondWithFilteredResult(_0xcea5db,_0x4ba2be))['catch'](handleError(_0xcea5db,null));};exports['show']=function(_0x36843b,_0x7eb1a){var _0x18d1c4={'raw':!![],'where':{'id':_0x36843b[_0xd9ff('0x46')]['id']}},_0x2dfb8f={};_0x2dfb8f[_0xd9ff('0x36')]=_['keys'](db[_0xd9ff('0x2d')][_0xd9ff('0x2e')]);_0x2dfb8f['query']=_[_0xd9ff('0x33')](_0x36843b[_0xd9ff('0x32')]);_0x2dfb8f[_0xd9ff('0x34')]=_[_0xd9ff('0x35')](_0x2dfb8f[_0xd9ff('0x36')],_0x2dfb8f['query']);_0x18d1c4['attributes']=_['intersection'](_0x2dfb8f[_0xd9ff('0x36')],qs['fields'](_0x36843b[_0xd9ff('0x32')][_0xd9ff('0x38')]));_0x18d1c4[_0xd9ff('0x37')]=_0x18d1c4['attributes'][_0xd9ff('0x39')]?_0x18d1c4[_0xd9ff('0x37')]:_0x2dfb8f['model'];if(_0x36843b[_0xd9ff('0x32')][_0xd9ff('0x42')]){_0x18d1c4[_0xd9ff('0x43')]=[{'all':!![]}];}_0x18d1c4=_[_0xd9ff('0x3f')]({},_0x18d1c4,_0x36843b['options']);return db[_0xd9ff('0x2d')]['find'](_0x18d1c4)[_0xd9ff('0x23')](handleEntityNotFound(_0x7eb1a,null))['then'](respondWithResult(_0x7eb1a,null))[_0xd9ff('0x47')](handleError(_0x7eb1a,null));};exports[_0xd9ff('0x48')]=function(_0x2bf37a,_0x1760c3){return db[_0xd9ff('0x2d')]['create'](_0x2bf37a[_0xd9ff('0x49')],{})[_0xd9ff('0x23')](function(_0x2fbe53){var _0xa3f86d=_0x2bf37a['user']['get']({'plain':!![]});if(!_0xa3f86d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa3f86d[_0xd9ff('0x4a')]===_0xd9ff('0x4b')){var _0x29c6bd=_0x2fbe53['get']({'plain':!![]});var _0x136bac=_0xd9ff('0x25');return db[_0xd9ff('0x4c')][_0xd9ff('0x4d')]({'where':{'name':_0x136bac,'userProfileId':_0xa3f86d[_0xd9ff('0x4e')]},'raw':!![]})[_0xd9ff('0x23')](function(_0x43a8ae){if(_0x43a8ae&&_0x43a8ae[_0xd9ff('0x4f')]===0x0){return db[_0xd9ff('0x50')][_0xd9ff('0x48')]({'name':_0x29c6bd[_0xd9ff('0x2a')],'resourceId':_0x29c6bd['id'],'type':_0x43a8ae[_0xd9ff('0x2a')],'sectionId':_0x43a8ae['id']},{})[_0xd9ff('0x23')](function(){return _0x2fbe53;});}else{return _0x2fbe53;}})['catch'](function(_0x3ed112){logger['error'](_0xd9ff('0x51'),_0x3ed112);throw _0x3ed112;});}return _0x2fbe53;})['then'](respondWithResult(_0x1760c3,0xc9))[_0xd9ff('0x47')](handleError(_0x1760c3,null));};exports['update']=function(_0xc82610,_0x5624a0){if(_0xc82610[_0xd9ff('0x49')]['id']){delete _0xc82610['body']['id'];}return db[_0xd9ff('0x2d')]['find']({'where':{'id':_0xc82610[_0xd9ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x5624a0,null))[_0xd9ff('0x23')](saveUpdates(_0xc82610[_0xd9ff('0x49')],null))[_0xd9ff('0x23')](respondWithResult(_0x5624a0,null))[_0xd9ff('0x47')](handleError(_0x5624a0,null));};exports['destroy']=function(_0x8c136b,_0x180e79){return db[_0xd9ff('0x2d')]['find']({'where':{'id':_0x8c136b[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x23')](handleEntityNotFound(_0x180e79,null))[_0xd9ff('0x23')](removeEntity(_0x180e79,null))[_0xd9ff('0x47')](handleError(_0x180e79,null));};exports[_0xd9ff('0x52')]=function(_0x56e8e8,_0x27cc9e){return db[_0xd9ff('0x2d')][_0xd9ff('0x52')]()[_0xd9ff('0x23')](respondWithResult(_0x27cc9e,null))[_0xd9ff('0x47')](handleError(_0x27cc9e,null));};exports[_0xd9ff('0x53')]=function(_0x458fd4,_0x5bac6f,_0x3be850){var _0x11251f={'raw':!![],'where':{}},_0x561a9b={},_0x1c885f;return db[_0xd9ff('0x2d')]['findOne']({'where':{'id':_0x458fd4[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x23')](handleEntityNotFound(_0x5bac6f,null))[_0xd9ff('0x23')](function(_0x54ea27){if(_0x54ea27){_0x1c885f=_0x54ea27['get']({'plain':!![]});_0x561a9b[_0xd9ff('0x36')]=_['keys'](db[_0xd9ff('0x54')][_0xd9ff('0x2e')]);_0x561a9b[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x458fd4['query']);_0x561a9b['filters']=_['intersection'](_0x561a9b[_0xd9ff('0x36')],_0x561a9b[_0xd9ff('0x32')]);_0x11251f[_0xd9ff('0x37')]=_[_0xd9ff('0x35')](_0x561a9b[_0xd9ff('0x36')],qs['fields'](_0x458fd4[_0xd9ff('0x32')]['fields']));_0x11251f[_0xd9ff('0x37')]=_0x11251f[_0xd9ff('0x37')][_0xd9ff('0x39')]?_0x11251f[_0xd9ff('0x37')]:_0x561a9b[_0xd9ff('0x36')];if(!_0x458fd4[_0xd9ff('0x32')][_0xd9ff('0x3a')](_0xd9ff('0x55'))){_0x11251f['limit']=qs[_0xd9ff('0x20')](_0x458fd4[_0xd9ff('0x32')]['limit']);_0x11251f['offset']=qs[_0xd9ff('0x1f')](_0x458fd4['query'][_0xd9ff('0x1f')]);}_0x11251f[_0xd9ff('0x3b')]=qs['sort'](_0x458fd4[_0xd9ff('0x32')][_0xd9ff('0x3c')]);_0x11251f[_0xd9ff('0x3d')]=qs[_0xd9ff('0x34')](_[_0xd9ff('0x56')](_0x458fd4['query'],_0x561a9b[_0xd9ff('0x34')]));_0x11251f['where']['FaxQueueId']=_0x54ea27['id'];if(_0x458fd4[_0xd9ff('0x32')][_0xd9ff('0x3e')]){_0x11251f[_0xd9ff('0x3d')]=_[_0xd9ff('0x3f')](_0x11251f['where'],{'$or':_[_0xd9ff('0x31')](_0x11251f[_0xd9ff('0x37')],function(_0x358ccd){var _0x3b58bb={};_0x3b58bb[_0x358ccd]={'$like':'%'+_0x458fd4[_0xd9ff('0x32')][_0xd9ff('0x3e')]+'%'};return _0x3b58bb;})});}_0x11251f=_[_0xd9ff('0x3f')]({},_0x11251f,_0x458fd4[_0xd9ff('0x57')]);return db['UserFaxQueue']['findAll'](_0x11251f);}})['then'](function(_0x275fb9){if(_0x275fb9){return db[_0xd9ff('0x58')]['findAndCountAll']({'where':{'id':_[_0xd9ff('0x31')](_0x275fb9,_0xd9ff('0x59')),'role':_0xd9ff('0x5a')},'attributes':['id',_0xd9ff('0x2a'),_0xd9ff('0x5b'),_0xd9ff('0x5c'),_0xd9ff('0x5d')]});}})[_0xd9ff('0x23')](function(_0x5e5460){if(_0x5e5460){return{'count':_0x5e5460[_0xd9ff('0x1e')],'rows':_[_0xd9ff('0x31')](_0x5e5460[_0xd9ff('0x45')],function(_0x533050){return{'membername':_0x533050[_0xd9ff('0x2a')],'UserId':_0x533050['id'],'queue_name':_0x1c885f['name'],'FaxQueueId':_0x1c885f['id'],'interface':util[_0xd9ff('0x5e')](_0xd9ff('0x5f'),_0xd9ff('0x60'),_0x533050['name']),'penalty':0x0,'paused':_0x533050[_0xd9ff('0x5b')],'createdAt':_0x533050[_0xd9ff('0x5d')],'updatedAt':_0x533050[_0xd9ff('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd9ff('0x23')](respondWithFilteredResult(_0x5bac6f,_0x11251f))['catch'](handleError(_0x5bac6f,null));};exports[_0xd9ff('0x61')]=function(_0x285159,_0x1de5c9,_0x53fca5){var _0x29a562={};var _0x212f86={};var _0x2619c9;var _0x5c6bf3;return db[_0xd9ff('0x2d')][_0xd9ff('0x62')]({'where':{'id':_0x285159[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x23')](handleEntityNotFound(_0x1de5c9,null))[_0xd9ff('0x23')](function(_0x5a84f9){if(_0x5a84f9){_0x2619c9=_0x5a84f9;_0x212f86[_0xd9ff('0x36')]=_[_0xd9ff('0x33')](db['Team'][_0xd9ff('0x2e')]);_0x212f86[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x285159['query']);_0x212f86[_0xd9ff('0x34')]=_['intersection'](_0x212f86[_0xd9ff('0x36')],_0x212f86['query']);_0x29a562[_0xd9ff('0x37')]=_[_0xd9ff('0x35')](_0x212f86[_0xd9ff('0x36')],qs[_0xd9ff('0x38')](_0x285159[_0xd9ff('0x32')][_0xd9ff('0x38')]));_0x29a562[_0xd9ff('0x37')]=_0x29a562[_0xd9ff('0x37')][_0xd9ff('0x39')]?_0x29a562[_0xd9ff('0x37')]:_0x212f86['model'];_0x29a562[_0xd9ff('0x3b')]=qs[_0xd9ff('0x3c')](_0x285159[_0xd9ff('0x32')][_0xd9ff('0x3c')]);_0x29a562[_0xd9ff('0x3d')]=qs[_0xd9ff('0x34')](_['pick'](_0x285159['query'],_0x212f86[_0xd9ff('0x34')]));if(_0x285159[_0xd9ff('0x32')][_0xd9ff('0x3e')]){_0x29a562[_0xd9ff('0x3d')]=_[_0xd9ff('0x3f')](_0x29a562[_0xd9ff('0x3d')],{'$or':_['map'](_0x29a562[_0xd9ff('0x37')],function(_0xcddb67){var _0x3c87a3={};_0x3c87a3[_0xcddb67]={'$like':'%'+_0x285159[_0xd9ff('0x32')][_0xd9ff('0x3e')]+'%'};return _0x3c87a3;})});}_0x29a562=_[_0xd9ff('0x3f')]({},_0x29a562,_0x285159['options']);return _0x2619c9[_0xd9ff('0x61')](_0x29a562);}})[_0xd9ff('0x23')](function(_0x15e879){if(_0x15e879){_0x5c6bf3=_0x15e879[_0xd9ff('0x39')];if(!_0x285159[_0xd9ff('0x32')][_0xd9ff('0x3a')](_0xd9ff('0x55'))){_0x29a562[_0xd9ff('0x20')]=qs['limit'](_0x285159[_0xd9ff('0x32')]['limit']);_0x29a562[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x285159[_0xd9ff('0x32')][_0xd9ff('0x1f')]);}return _0x2619c9[_0xd9ff('0x61')](_0x29a562);}})[_0xd9ff('0x23')](function(_0x6be48f){if(_0x6be48f){return _0x6be48f?{'count':_0x5c6bf3,'rows':_0x6be48f}:null;}})[_0xd9ff('0x23')](respondWithResult(_0x1de5c9,null))[_0xd9ff('0x47')](handleError(_0x1de5c9,null));};exports[_0xd9ff('0x63')]=function(_0x44b20b,_0x1ee203,_0xa908a3){var _0x5d29b9=_0x44b20b[_0xd9ff('0x49')][_0xd9ff('0x64')];return db[_0xd9ff('0x65')][_0xd9ff('0x44')]({'where':{'id':_0x5d29b9},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd9ff('0x66'),'attributes':['id',_0xd9ff('0x2a'),'online',_0xd9ff('0x67'),_0xd9ff('0x68')],'raw':!![]}]})[_0xd9ff('0x23')](function(_0x99ad09){if(_0x99ad09){var _0x15f805=_[_0xd9ff('0x69')](_0x99ad09,function(_0x372747){var _0x47e5fc=_0x372747[_0xd9ff('0x24')]({'plain':!![]});return _0x47e5fc['Agents'];});return db[_0xd9ff('0x2d')][_0xd9ff('0x4d')]({'where':{'id':_0x44b20b[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x23')](function(_0x320adb){return db[_0xd9ff('0x6a')][_0xd9ff('0x6b')](function(_0xdf783d){return _0x320adb[_0xd9ff('0x63')](_0x5d29b9,{'transaction':_0xdf783d})[_0xd9ff('0x23')](function(){return BPromise[_0xd9ff('0x6c')](_0x15f805,function(_0x4c8000){return db[_0xd9ff('0x54')][_0xd9ff('0x6d')]({'where':{'UserId':_0x4c8000['id'],'FaxQueueId':_0x44b20b['params']['id']},'transaction':_0xdf783d});});})[_0xd9ff('0x23')](function(){_0x15f805[_0xd9ff('0x6e')](function(_0x3b3511){socket[_0xd9ff('0x6f')](_0xd9ff('0x70'),{'UserId':_0x3b3511['id'],'FaxQueueId':_0x320adb['id']});});});});});}})[_0xd9ff('0x23')](respondWithStatusCode(_0x1ee203,null))['catch'](handleError(_0x1ee203,null));};exports['removeTeams']=function(_0x195882,_0x54d673,_0x58da81){return db['Team']['findAll']({'where':{'id':_0x195882[_0xd9ff('0x32')][_0xd9ff('0x64')]},'attributes':['id'],'include':[{'model':db[_0xd9ff('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54d673,null))[_0xd9ff('0x23')](function(_0x5e7f52){var _0x109a47=_['map'](_0x5e7f52,'id');var _0x338235=[];var _0x3ec460=[];var _0xdf0ca=squel[_0xd9ff('0x71')]();_0xdf0ca[_0xd9ff('0x72')]('tq.TeamId')['from'](_0xd9ff('0x73'),'tq')[_0xd9ff('0x74')](_0xd9ff('0x75'),'ut',_0xd9ff('0x76'))[_0xd9ff('0x3d')]('FaxQueueId\x20=\x20?',_0x195882[_0xd9ff('0x46')]['id']);for(var _0x19403d=0x0;_0x19403d<_0x5e7f52[_0xd9ff('0x39')];_0x19403d+=0x1){let _0x7fdc57=_0x5e7f52[_0x19403d];for(var _0x42018e=0x0;_0x42018e<_0x7fdc57[_0xd9ff('0x66')][_0xd9ff('0x39')];_0x42018e+=0x1){let _0x19f659=_0x7fdc57[_0xd9ff('0x66')][_0x42018e];var _0x41b7e3=_0xdf0ca[_0xd9ff('0x77')]();_0x41b7e3[_0xd9ff('0x3d')](_0xd9ff('0x78'),_0x19f659['id']);_0x3ec460['push'](db[_0xd9ff('0x6a')][_0xd9ff('0x32')](_0x41b7e3['toString'](),{'type':db['sequelize'][_0xd9ff('0x79')][_0xd9ff('0x7a')]})['then'](function(_0x3a0425){if(_0x3a0425[_0xd9ff('0x39')]===0x1){return _0x19f659['id'];}else{var _0x178b5c=_[_0xd9ff('0x7b')](_[_0xd9ff('0x31')](_0x3a0425,_0xd9ff('0x7c')),function(_0x120391){return _[_0xd9ff('0x7d')](_0x109a47,_0x120391);});if(_0x178b5c){return _0x19f659['id'];}}}));}}return BPromise['all'](_0x3ec460)['then'](function(_0x5512aa){_0x338235=_(_0x338235)[_0xd9ff('0x7e')](_0x5512aa)[_0xd9ff('0x7f')]()[_0xd9ff('0x80')]();return db['FaxQueue'][_0xd9ff('0x4d')]({'where':{'id':_0x195882[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x23')](function(_0x2eec0d){return db[_0xd9ff('0x6a')][_0xd9ff('0x6b')](function(_0x4a80c4){return _0x2eec0d[_0xd9ff('0x81')](_0x195882['query'][_0xd9ff('0x64')],{'transaction':_0x4a80c4})[_0xd9ff('0x23')](function(){if(!_[_0xd9ff('0x82')](_0x338235)){return _0x2eec0d[_0xd9ff('0x83')](_0x338235,{'transaction':_0x4a80c4});}})['then'](function(){_0x338235[_0xd9ff('0x6e')](function(_0x2616fe){socket['emit']('userFaxQueue:remove',{'UserId':_0x2616fe,'FaxQueueId':_0x2eec0d['id']});});});});});});})['then'](respondWithStatusCode(_0x54d673,null))[_0xd9ff('0x47')](handleError(_0x54d673,null));};exports[_0xd9ff('0x84')]=function(_0x57c726,_0x2871ec,_0x149791){return db[_0xd9ff('0x2d')]['find']({'where':{'id':_0x57c726['params']['id']}})['then'](handleEntityNotFound(_0x2871ec,null))[_0xd9ff('0x23')](function(_0x500fe4){if(_0x500fe4){return _0x500fe4[_0xd9ff('0x84')](_0x57c726[_0xd9ff('0x49')]['ids'],_[_0xd9ff('0x85')](_0x57c726[_0xd9ff('0x49')],[_0xd9ff('0x64'),'id'])||{})[_0xd9ff('0x86')](function(_0x2ca1f4){for(var _0x539a76=0x0;_0x539a76<_0x57c726[_0xd9ff('0x49')]['ids']['length'];_0x539a76+=0x1){socket['emit'](_0xd9ff('0x70'),{'UserId':_0x57c726[_0xd9ff('0x49')][_0xd9ff('0x64')][_0x539a76],'FaxQueueId':_0x57c726[_0xd9ff('0x46')]['id']});}return _0x2ca1f4;});}})['then'](respondWithResult(_0x2871ec,null))['catch'](handleError(_0x2871ec,null));};exports[_0xd9ff('0x83')]=function(_0xe2921c,_0x132003,_0x443e0a){return db[_0xd9ff('0x2d')]['find']({'where':{'id':_0xe2921c['params']['id']}})[_0xd9ff('0x23')](handleEntityNotFound(_0x132003,null))[_0xd9ff('0x23')](function(_0x43b620){if(_0x43b620){return _0x43b620[_0xd9ff('0x83')](_0xe2921c[_0xd9ff('0x32')][_0xd9ff('0x64')])['then'](function(){if(_[_0xd9ff('0x87')](_0xe2921c['query']['ids'])){for(var _0x16c6fd=0x0;_0x16c6fd<_0xe2921c[_0xd9ff('0x32')][_0xd9ff('0x64')][_0xd9ff('0x39')];_0x16c6fd+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0xe2921c[_0xd9ff('0x32')]['ids'][_0x16c6fd]),'FaxQueueId':Number(_0xe2921c['params']['id'])});}}else{socket[_0xd9ff('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0xe2921c[_0xd9ff('0x32')]['ids']),'FaxQueueId':Number(_0xe2921c[_0xd9ff('0x46')]['id'])});}});}})[_0xd9ff('0x23')](respondWithStatusCode(_0x132003,null))[_0xd9ff('0x47')](handleError(_0x132003,null));};exports[_0xd9ff('0x88')]=function(_0x42d7e7,_0x46765b,_0x2a4aea){var _0x4cf14b={};var _0x30967e={};var _0x5da105;var _0x591d44;return db[_0xd9ff('0x2d')][_0xd9ff('0x62')]({'where':{'id':_0x42d7e7['params']['id']}})[_0xd9ff('0x23')](handleEntityNotFound(_0x46765b,null))['then'](function(_0x551c43){if(_0x551c43){_0x5da105=_0x551c43;_0x30967e[_0xd9ff('0x36')]=_[_0xd9ff('0x33')](db[_0xd9ff('0x58')][_0xd9ff('0x2e')]);_0x30967e[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x42d7e7[_0xd9ff('0x32')]);_0x30967e[_0xd9ff('0x34')]=_[_0xd9ff('0x35')](_0x30967e[_0xd9ff('0x36')],_0x30967e[_0xd9ff('0x32')]);_0x4cf14b[_0xd9ff('0x37')]=_[_0xd9ff('0x35')](_0x30967e['model'],qs['fields'](_0x42d7e7['query'][_0xd9ff('0x38')]));_0x4cf14b['attributes']=_0x4cf14b[_0xd9ff('0x37')][_0xd9ff('0x39')]?_0x4cf14b[_0xd9ff('0x37')]:_0x30967e[_0xd9ff('0x36')];_0x4cf14b['order']=qs[_0xd9ff('0x3c')](_0x42d7e7['query'][_0xd9ff('0x3c')]);_0x4cf14b['where']=qs['filters'](_['pick'](_0x42d7e7[_0xd9ff('0x32')],_0x30967e['filters']));if(_0x42d7e7[_0xd9ff('0x32')]['filter']){_0x4cf14b[_0xd9ff('0x3d')]=_[_0xd9ff('0x3f')](_0x4cf14b[_0xd9ff('0x3d')],{'$or':_[_0xd9ff('0x31')](_0x4cf14b[_0xd9ff('0x37')],function(_0x266644){var _0x542737={};_0x542737[_0x266644]={'$like':'%'+_0x42d7e7['query'][_0xd9ff('0x3e')]+'%'};return _0x542737;})});}_0x4cf14b=_[_0xd9ff('0x3f')]({},_0x4cf14b,_0x42d7e7[_0xd9ff('0x57')]);return _0x5da105[_0xd9ff('0x88')](_0x4cf14b);}})[_0xd9ff('0x23')](function(_0x4d2f56){if(_0x4d2f56){_0x591d44=_0x4d2f56[_0xd9ff('0x39')];if(!_0x42d7e7[_0xd9ff('0x32')][_0xd9ff('0x3a')](_0xd9ff('0x55'))){_0x4cf14b[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x42d7e7['query'][_0xd9ff('0x20')]);_0x4cf14b[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x42d7e7[_0xd9ff('0x32')][_0xd9ff('0x1f')]);}return _0x5da105[_0xd9ff('0x88')](_0x4cf14b);}})[_0xd9ff('0x23')](function(_0x1ae8b5){if(_0x1ae8b5){return _0x1ae8b5?{'count':_0x591d44,'rows':_0x1ae8b5}:null;}})[_0xd9ff('0x23')](respondWithResult(_0x46765b,null))[_0xd9ff('0x47')](handleError(_0x46765b,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 23d3a88..42b587f 100644 --- a/server/api/faxQueue/faxQueue.events.js +++ b/server/api/faxQueue/faxQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bc8=['FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bc8,0x1b8));var _0x83bc=function(_0x43e11f,_0x196da0){_0x43e11f=_0x43e11f-0x0;var _0x3c9208=_0x3bc8[_0x43e11f];return _0x3c9208;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x83bc('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x83bc('0x1')](0x0);var events={'afterCreate':_0x83bc('0x2'),'afterUpdate':_0x83bc('0x3'),'afterDestroy':_0x83bc('0x4')};function emitEvent(_0x3f7f6e){return function(_0x45588e,_0x1ddd4f,_0x3ba744){FaxQueueEvents[_0x83bc('0x5')](_0x3f7f6e+':'+_0x45588e['id'],_0x45588e);FaxQueueEvents[_0x83bc('0x5')](_0x3f7f6e,_0x45588e);_0x3ba744(null);};}for(var e in events){if(events[_0x83bc('0x6')](e)){var event=events[e];FaxQueue[_0x83bc('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xa394=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','events'];(function(_0x5e5b72,_0x486a42){var _0x2247d1=function(_0x505fb5){while(--_0x505fb5){_0x5e5b72['push'](_0x5e5b72['shift']());}};_0x2247d1(++_0x486a42);}(_0xa394,0x1a3));var _0x4a39=function(_0x2b7238,_0x22e973){_0x2b7238=_0x2b7238-0x0;var _0x413e1b=_0xa394[_0x2b7238];return _0x413e1b;};'use strict';var EventEmitter=require(_0x4a39('0x0'));var FaxQueue=require(_0x4a39('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x4a39('0x2')](0x0);var events={'afterCreate':_0x4a39('0x3'),'afterUpdate':'update','afterDestroy':_0x4a39('0x4')};function emitEvent(_0x23743d){return function(_0x134a17,_0x4ebc25,_0xc1c5cc){FaxQueueEvents[_0x4a39('0x5')](_0x23743d+':'+_0x134a17['id'],_0x134a17);FaxQueueEvents[_0x4a39('0x5')](_0x23743d,_0x134a17);_0xc1c5cc(null);};}for(var e in events){if(events[_0x4a39('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 48f30a1..4e44364 100644 --- a/server/api/faxQueue/faxQueue.model.js +++ b/server/api/faxQueue/faxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f63=['path','rimraf','../../config/environment','exports','define','FaxQueue','fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5240b7,_0x5dfcd2){var _0x3a7797=function(_0x182255){while(--_0x182255){_0x5240b7['push'](_0x5240b7['shift']());}};_0x3a7797(++_0x5dfcd2);}(_0x8f63,0x173));var _0x38f6=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x8f63[_0x2f32c4];return _0x95b5dc;};'use strict';var _=require(_0x38f6('0x0'));var util=require('util');var logger=require(_0x38f6('0x1'))(_0x38f6('0x2'));var moment=require(_0x38f6('0x3'));var BPromise=require(_0x38f6('0x4'));var rp=require(_0x38f6('0x5'));var fs=require('fs');var path=require(_0x38f6('0x6'));var rimraf=require(_0x38f6('0x7'));var config=require(_0x38f6('0x8'));var attributes=require('./faxQueue.attributes');module[_0x38f6('0x9')]=function(_0x2ba807,_0x251fbd){return _0x2ba807[_0x38f6('0xa')](_0x38f6('0xb'),attributes,{'tableName':_0x38f6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d8e=['rimraf','./faxQueue.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x33d4ce,_0x2de226){var _0x586415=function(_0x554159){while(--_0x554159){_0x33d4ce['push'](_0x33d4ce['shift']());}};_0x586415(++_0x2de226);}(_0x0d8e,0x130));var _0xe0d8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0d8e[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xe0d8('0x0'));var util=require('util');var logger=require(_0xe0d8('0x1'))(_0xe0d8('0x2'));var moment=require(_0xe0d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0d8('0x4'));var fs=require('fs');var path=require(_0xe0d8('0x5'));var rimraf=require(_0xe0d8('0x6'));var config=require('../../config/environment');var attributes=require(_0xe0d8('0x7'));module[_0xe0d8('0x8')]=function(_0x1ebef3,_0x50c86e){return _0x1ebef3[_0xe0d8('0x9')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index decac25..400c472 100644 --- a/server/api/faxQueue/faxQueue.rpc.js +++ b/server/api/faxQueue/faxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4377=['stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','map','include','model','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./faxQueue.socket','request','then','info','request\x20sent','debug'];(function(_0xd58823,_0x15c483){var _0x249c0a=function(_0x4b8b67){while(--_0x4b8b67){_0xd58823['push'](_0xd58823['shift']());}};_0x249c0a(++_0x15c483);}(_0x4377,0xcb));var _0x7437=function(_0xcec9b7,_0x58ca25){_0xcec9b7=_0xcec9b7-0x0;var _0x2feca8=_0x4377[_0xcec9b7];return _0x2feca8;};'use strict';var _=require(_0x7437('0x0'));var util=require(_0x7437('0x1'));var moment=require(_0x7437('0x2'));var BPromise=require(_0x7437('0x3'));var rs=require(_0x7437('0x4'));var fs=require('fs');var Redis=require(_0x7437('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7437('0x6'));var logger=require(_0x7437('0x7'))('rpc');var config=require(_0x7437('0x8'));var jayson=require(_0x7437('0x9'));var client=jayson[_0x7437('0xa')][_0x7437('0xb')]({'port':0x232a});config[_0x7437('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7437('0xc')]));require(_0x7437('0xd'))['register'](socket);function respondWithRpcPromise(_0x8e5d78,_0x2603a6,_0x51c414){return new BPromise(function(_0x2b1bef,_0x3b49eb){return client[_0x7437('0xe')](_0x8e5d78,_0x51c414)[_0x7437('0xf')](function(_0x276e4d){logger[_0x7437('0x10')]('FaxQueue,\x20%s,\x20%s',_0x2603a6,_0x7437('0x11'));logger[_0x7437('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x2603a6,_0x7437('0x11'),JSON[_0x7437('0x13')](_0x276e4d));if(_0x276e4d[_0x7437('0x14')]){if(_0x276e4d[_0x7437('0x14')][_0x7437('0x15')]===0x1f4){logger[_0x7437('0x14')](_0x7437('0x16'),_0x2603a6,_0x276e4d[_0x7437('0x14')][_0x7437('0x17')]);return _0x3b49eb(_0x276e4d['error'][_0x7437('0x17')]);}logger[_0x7437('0x14')](_0x7437('0x16'),_0x2603a6,_0x276e4d[_0x7437('0x14')][_0x7437('0x17')]);return _0x2b1bef(_0x276e4d[_0x7437('0x14')][_0x7437('0x17')]);}else{logger[_0x7437('0x10')](_0x7437('0x16'),_0x2603a6,_0x7437('0x11'));_0x2b1bef(_0x276e4d['result'][_0x7437('0x17')]);}})[_0x7437('0x18')](function(_0x5cc572){logger[_0x7437('0x14')](_0x7437('0x16'),_0x2603a6,_0x5cc572);_0x3b49eb(_0x5cc572);});});}exports[_0x7437('0x19')]=function(_0x20beaf){var _0x16a403=this;return new Promise(function(_0x3330da,_0x3703b7){return db[_0x7437('0x1a')][_0x7437('0x1b')]({'raw':_0x20beaf[_0x7437('0x1c')]?_0x20beaf['options'][_0x7437('0x1d')]===undefined?!![]:![]:!![],'where':_0x20beaf['options']?_0x20beaf[_0x7437('0x1c')]['where']||null:null,'attributes':_0x20beaf['options']?_0x20beaf['options'][_0x7437('0x1e')]||null:null,'limit':_0x20beaf[_0x7437('0x1c')]?_0x20beaf[_0x7437('0x1c')][_0x7437('0x1f')]||null:null,'include':_0x20beaf[_0x7437('0x1c')]?_0x20beaf['options']['include']?_[_0x7437('0x20')](_0x20beaf[_0x7437('0x1c')][_0x7437('0x21')],function(_0x959703){return{'model':db[_0x959703[_0x7437('0x22')]],'as':_0x959703['as'],'attributes':_0x959703['attributes'],'include':_0x959703['include']?_[_0x7437('0x20')](_0x959703[_0x7437('0x21')],function(_0x510ed6){return{'model':db[_0x510ed6['model']],'as':_0x510ed6['as'],'attributes':_0x510ed6['attributes'],'include':_0x510ed6['include']?_[_0x7437('0x20')](_0x510ed6[_0x7437('0x21')],function(_0x4ece10){return{'model':db[_0x4ece10[_0x7437('0x22')]],'as':_0x4ece10['as'],'attributes':_0x4ece10['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c1619){logger[_0x7437('0x10')](_0x7437('0x19'),_0x20beaf);logger['debug']('GetFaxQueue',_0x20beaf,JSON[_0x7437('0x13')](_0x4c1619));_0x3330da(_0x4c1619);})['catch'](function(_0x6582c1){logger[_0x7437('0x14')](_0x7437('0x19'),_0x6582c1[_0x7437('0x17')],_0x20beaf);_0x3703b7(_0x16a403[_0x7437('0x14')](0x1f4,_0x6582c1[_0x7437('0x17')]));});});};exports[_0x7437('0x23')]=function(_0x3590de){var _0x7804d1=this;return new Promise(function(_0x3edc32,_0x5ccab7){return db[_0x7437('0x1a')][_0x7437('0x24')]({'raw':_0x3590de[_0x7437('0x1c')]?_0x3590de[_0x7437('0x1c')][_0x7437('0x1d')]===undefined?!![]:![]:!![],'where':_0x3590de[_0x7437('0x1c')]?_0x3590de['options']['where']||null:null,'attributes':_0x3590de[_0x7437('0x1c')]?_0x3590de[_0x7437('0x1c')]['attributes']||null:null,'include':_0x3590de[_0x7437('0x1c')]?_0x3590de[_0x7437('0x1c')][_0x7437('0x21')]?_['map'](_0x3590de[_0x7437('0x1c')]['include'],function(_0x521f94){return{'model':db[_0x521f94[_0x7437('0x22')]],'as':_0x521f94['as'],'attributes':_0x521f94[_0x7437('0x1e')],'include':_0x521f94['include']?_[_0x7437('0x20')](_0x521f94[_0x7437('0x21')],function(_0x46428c){return{'model':db[_0x46428c[_0x7437('0x22')]],'as':_0x46428c['as'],'attributes':_0x46428c[_0x7437('0x1e')],'include':_0x46428c[_0x7437('0x21')]?_[_0x7437('0x20')](_0x46428c[_0x7437('0x21')],function(_0x25771c){return{'model':db[_0x25771c[_0x7437('0x22')]],'as':_0x25771c['as'],'attributes':_0x25771c[_0x7437('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7437('0xf')](function(_0x1fdfd0){logger['info'](_0x7437('0x23'),_0x3590de);logger[_0x7437('0x12')](_0x7437('0x23'),_0x3590de,JSON[_0x7437('0x13')](_0x1fdfd0));_0x3edc32(_0x1fdfd0);})['catch'](function(_0x82c288){logger[_0x7437('0x14')]('ShowFaxQueue',_0x82c288[_0x7437('0x17')],_0x3590de);_0x5ccab7(_0x7804d1['error'](0x1f4,_0x82c288['message']));});});}; \ No newline at end of file +var _0x82d2=['moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFaxQueue','findAll','raw','options','where','attributes','limit','include','model','map','catch','ShowFaxQueue','FaxQueue','find','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82d2,0x1b6));var _0x282d=function(_0x4f88f2,_0x16c2a2){_0x4f88f2=_0x4f88f2-0x0;var _0x591d5e=_0x82d2[_0x4f88f2];return _0x591d5e;};'use strict';var _=require(_0x282d('0x0'));var util=require(_0x282d('0x1'));var moment=require(_0x282d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x282d('0x3'));var db=require(_0x282d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x282d('0x5'));var config=require(_0x282d('0x6'));var jayson=require(_0x282d('0x7'));var client=jayson[_0x282d('0x8')]['http']({'port':0x232a});config['redis']=_[_0x282d('0x9')](config[_0x282d('0xa')],{'host':_0x282d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x282d('0xa')]));require(_0x282d('0xc'))[_0x282d('0xd')](socket);function respondWithRpcPromise(_0x252cff,_0x257f3f,_0x25166d){return new BPromise(function(_0x39d0f2,_0x52c239){return client[_0x282d('0xe')](_0x252cff,_0x25166d)[_0x282d('0xf')](function(_0x4ea33a){logger['info'](_0x282d('0x10'),_0x257f3f,_0x282d('0x11'));logger[_0x282d('0x12')](_0x282d('0x13'),_0x257f3f,_0x282d('0x11'),JSON[_0x282d('0x14')](_0x4ea33a));if(_0x4ea33a[_0x282d('0x15')]){if(_0x4ea33a[_0x282d('0x15')][_0x282d('0x16')]===0x1f4){logger['error'](_0x282d('0x10'),_0x257f3f,_0x4ea33a['error'][_0x282d('0x17')]);return _0x52c239(_0x4ea33a['error'][_0x282d('0x17')]);}logger[_0x282d('0x15')](_0x282d('0x10'),_0x257f3f,_0x4ea33a[_0x282d('0x15')][_0x282d('0x17')]);return _0x39d0f2(_0x4ea33a[_0x282d('0x15')]['message']);}else{logger[_0x282d('0x18')](_0x282d('0x10'),_0x257f3f,'request\x20sent');_0x39d0f2(_0x4ea33a[_0x282d('0x19')]['message']);}})['catch'](function(_0x316fc6){logger['error'](_0x282d('0x10'),_0x257f3f,_0x316fc6);_0x52c239(_0x316fc6);});});}exports[_0x282d('0x1a')]=function(_0x1fb564){var _0x4a5818=this;return new Promise(function(_0x4a7652,_0x168a7c){return db['FaxQueue'][_0x282d('0x1b')]({'raw':_0x1fb564['options']?_0x1fb564['options'][_0x282d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fb564[_0x282d('0x1d')]?_0x1fb564[_0x282d('0x1d')][_0x282d('0x1e')]||null:null,'attributes':_0x1fb564[_0x282d('0x1d')]?_0x1fb564[_0x282d('0x1d')][_0x282d('0x1f')]||null:null,'limit':_0x1fb564['options']?_0x1fb564[_0x282d('0x1d')][_0x282d('0x20')]||null:null,'include':_0x1fb564[_0x282d('0x1d')]?_0x1fb564[_0x282d('0x1d')][_0x282d('0x21')]?_['map'](_0x1fb564[_0x282d('0x1d')][_0x282d('0x21')],function(_0xf1a8a0){return{'model':db[_0xf1a8a0[_0x282d('0x22')]],'as':_0xf1a8a0['as'],'attributes':_0xf1a8a0[_0x282d('0x1f')],'include':_0xf1a8a0['include']?_[_0x282d('0x23')](_0xf1a8a0[_0x282d('0x21')],function(_0x5575f1){return{'model':db[_0x5575f1[_0x282d('0x22')]],'as':_0x5575f1['as'],'attributes':_0x5575f1[_0x282d('0x1f')],'include':_0x5575f1['include']?_['map'](_0x5575f1[_0x282d('0x21')],function(_0x23544c){return{'model':db[_0x23544c['model']],'as':_0x23544c['as'],'attributes':_0x23544c['attributes']};}):[]};}):[]};}):[]:[]})[_0x282d('0xf')](function(_0x192092){logger[_0x282d('0x18')](_0x282d('0x1a'),_0x1fb564);logger[_0x282d('0x12')]('GetFaxQueue',_0x1fb564,JSON[_0x282d('0x14')](_0x192092));_0x4a7652(_0x192092);})[_0x282d('0x24')](function(_0x1db7b2){logger['error'](_0x282d('0x1a'),_0x1db7b2[_0x282d('0x17')],_0x1fb564);_0x168a7c(_0x4a5818[_0x282d('0x15')](0x1f4,_0x1db7b2['message']));});});};exports[_0x282d('0x25')]=function(_0xffe6bf){var _0x5a3076=this;return new Promise(function(_0x4c8bd5,_0x5d0793){return db[_0x282d('0x26')][_0x282d('0x27')]({'raw':_0xffe6bf[_0x282d('0x1d')]?_0xffe6bf[_0x282d('0x1d')][_0x282d('0x1c')]===undefined?!![]:![]:!![],'where':_0xffe6bf[_0x282d('0x1d')]?_0xffe6bf[_0x282d('0x1d')]['where']||null:null,'attributes':_0xffe6bf[_0x282d('0x1d')]?_0xffe6bf[_0x282d('0x1d')][_0x282d('0x1f')]||null:null,'include':_0xffe6bf[_0x282d('0x1d')]?_0xffe6bf[_0x282d('0x1d')]['include']?_[_0x282d('0x23')](_0xffe6bf[_0x282d('0x1d')][_0x282d('0x21')],function(_0x39a2ee){return{'model':db[_0x39a2ee['model']],'as':_0x39a2ee['as'],'attributes':_0x39a2ee[_0x282d('0x1f')],'include':_0x39a2ee[_0x282d('0x21')]?_[_0x282d('0x23')](_0x39a2ee[_0x282d('0x21')],function(_0x9823c3){return{'model':db[_0x9823c3[_0x282d('0x22')]],'as':_0x9823c3['as'],'attributes':_0x9823c3[_0x282d('0x1f')],'include':_0x9823c3[_0x282d('0x21')]?_[_0x282d('0x23')](_0x9823c3[_0x282d('0x21')],function(_0x4bf66b){return{'model':db[_0x4bf66b[_0x282d('0x22')]],'as':_0x4bf66b['as'],'attributes':_0x4bf66b['attributes']};}):[]};}):[]};}):[]:[]})[_0x282d('0xf')](function(_0x38bf62){logger[_0x282d('0x18')](_0x282d('0x25'),_0xffe6bf);logger[_0x282d('0x12')]('ShowFaxQueue',_0xffe6bf,JSON['stringify'](_0x38bf62));_0x4c8bd5(_0x38bf62);})[_0x282d('0x24')](function(_0x57da73){logger[_0x282d('0x15')](_0x282d('0x25'),_0x57da73[_0x282d('0x17')],_0xffe6bf);_0x5d0793(_0x5a3076[_0x282d('0x15')](0x1f4,_0x57da73[_0x282d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index f88d7a4..c4e34e7 100644 --- a/server/api/faxQueue/faxQueue.socket.js +++ b/server/api/faxQueue/faxQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe02e=['length','./faxQueue.events','save','remove','update','emit','register'];(function(_0x302c7e,_0x5bd436){var _0x10009a=function(_0x9e95b0){while(--_0x9e95b0){_0x302c7e['push'](_0x302c7e['shift']());}};_0x10009a(++_0x5bd436);}(_0xe02e,0xbe));var _0xee02=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xe02e[_0x1ac595];return _0x455fff;};'use strict';var FaxQueueEvents=require(_0xee02('0x0'));var events=[_0xee02('0x1'),_0xee02('0x2'),_0xee02('0x3')];function createListener(_0x3181d9,_0x3b9cdb){return function(_0x514798){_0x3b9cdb[_0xee02('0x4')](_0x3181d9,_0x514798);};}function removeListener(_0x30e487,_0x41401e){return function(){FaxQueueEvents['removeListener'](_0x30e487,_0x41401e);};}exports[_0xee02('0x5')]=function(_0x3f3a93){for(var _0x1bd605=0x0,_0x3c8cb8=events[_0xee02('0x6')];_0x1bd605<_0x3c8cb8;_0x1bd605++){var _0x4400e2=events[_0x1bd605];var _0x2cd0d3=createListener('faxQueue:'+_0x4400e2,_0x3f3a93);FaxQueueEvents['on'](_0x4400e2,_0x2cd0d3);}}; \ No newline at end of file +var _0x72b8=['update','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x72b8,0x67));var _0x872b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x72b8[_0x4b055c];return _0x4b62bb;};'use strict';var FaxQueueEvents=require(_0x872b('0x0'));var events=[_0x872b('0x1'),'remove',_0x872b('0x2')];function createListener(_0x469058,_0x45efd2){return function(_0x413bd4){_0x45efd2['emit'](_0x469058,_0x413bd4);};}function removeListener(_0x45dec4,_0x3e3574){return function(){FaxQueueEvents[_0x872b('0x3')](_0x45dec4,_0x3e3574);};}exports[_0x872b('0x4')]=function(_0x2b5970){for(var _0x3cd09f=0x0,_0x207dce=events[_0x872b('0x5')];_0x3cd09f<_0x207dce;_0x3cd09f++){var _0x4ad2bf=events[_0x3cd09f];var _0x2c13e8=createListener(_0x872b('0x6')+_0x4ad2bf,_0x2b5970);FaxQueueEvents['on'](_0x4ad2bf,_0x2c13e8);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 28917f1..e97cf87 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','get','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer'];(function(_0x53d5e4,_0x4f1f6f){var _0x34c4f5=function(_0x17f6aa){while(--_0x17f6aa){_0x53d5e4['push'](_0x53d5e4['shift']());}};_0x34c4f5(++_0x4f1f6f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['get'](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);router[_0x0d8b('0x13')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0x17'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x18')]);router[_0x0d8b('0x19')](_0x0d8b('0x17'),auth['isAuthenticated'](),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x19')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x1b')]);router[_0x0d8b('0x19')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller['removeAgents']);module[_0x0d8b('0x1c')]=router; \ No newline at end of file +var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xb10b,0x12a));var _0xbb10=function(_0x5f1c59,_0x3fff4c){_0x5f1c59=_0x5f1c59-0x0;var _0xbfb242=_0xb10b[_0x5f1c59];return _0xbfb242;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index f8cd0f1..349291f 100644 --- a/server/api/faxQueueReport/faxQueueReport.attributes.js +++ b/server/api/faxQueueReport/faxQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b8f=['STRING','DATE','moment'];(function(_0x3c5cc8,_0x336027){var _0x44675c=function(_0xf9543e){while(--_0xf9543e){_0x3c5cc8['push'](_0x3c5cc8['shift']());}};_0x44675c(++_0x336027);}(_0x4b8f,0x68));var _0xf4b8=function(_0x4e49b4,_0x59615f){_0x4e49b4=_0x4e49b4-0x0;var _0x229b74=_0x4b8f[_0x4e49b4];return _0x229b74;};'use strict';var moment=require(_0xf4b8('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf4b8('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xf4b8('0x1')]},'joinAt':{'type':Sequelize[_0xf4b8('0x2')]},'leaveAt':{'type':Sequelize[_0xf4b8('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf601=['STRING','moment','sequelize','exports','DATE'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xf601,0xe2));var _0x1f60=function(_0x4bf439,_0x174112){_0x4bf439=_0x4bf439-0x0;var _0xcd63ca=_0xf601[_0x4bf439];return _0xcd63ca;};'use strict';var moment=require(_0x1f60('0x0'));var Sequelize=require(_0x1f60('0x1'));module[_0x1f60('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1f60('0x3')]},'leaveAt':{'type':Sequelize[_0x1f60('0x3')]},'acceptAt':{'type':Sequelize[_0x1f60('0x3')]},'exitAt':{'type':Sequelize[_0x1f60('0x3')]},'reason':{'type':Sequelize[_0x1f60('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 9904d89..21cbb42 100644 --- a/server/api/faxQueueReport/faxQueueReport.controller.js +++ b/server/api/faxQueueReport/faxQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc13=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','FaxQueueReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse'];(function(_0x5888d1,_0x3ca67f){var _0x21520f=function(_0x5323eb){while(--_0x5323eb){_0x5888d1['push'](_0x5888d1['shift']());}};_0x21520f(++_0x3ca67f);}(_0xdc13,0x1a0));var _0x3dc1=function(_0xeccf6a,_0x1a6006){_0xeccf6a=_0xeccf6a-0x0;var _0x5119e7=_0xdc13[_0xeccf6a];return _0x5119e7;};'use strict';var pdf=require(_0x3dc1('0x0'));var emlformat=require(_0x3dc1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3dc1('0x2'));var jsonpatch=require(_0x3dc1('0x3'));var rp=require(_0x3dc1('0x4'));var moment=require('moment');var BPromise=require(_0x3dc1('0x5'));var Mustache=require('mustache');var util=require(_0x3dc1('0x6'));var path=require(_0x3dc1('0x7'));var sox=require(_0x3dc1('0x8'));var csv=require('to-csv');var ejs=require(_0x3dc1('0x9'));var fs=require('fs');var _=require(_0x3dc1('0xa'));var squel=require('squel');var crypto=require(_0x3dc1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3dc1('0xc'));var toCsv=require(_0x3dc1('0xd'));var querystring=require(_0x3dc1('0xe'));var Papa=require(_0x3dc1('0xf'));var Redis=require(_0x3dc1('0x10'));var authService=require(_0x3dc1('0x11'));var qs=require(_0x3dc1('0x12'));var as=require(_0x3dc1('0x13'));var hardwareService=require(_0x3dc1('0x14'));var logger=require('../../config/logger')(_0x3dc1('0x15'));var utils=require(_0x3dc1('0x16'));var config=require(_0x3dc1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55b805,_0x47ad44){_0x47ad44=_0x47ad44||0xcc;return function(_0x5cda1b){if(_0x5cda1b){return _0x55b805[_0x3dc1('0x18')](_0x47ad44);}return _0x55b805[_0x3dc1('0x19')](_0x47ad44)['end']();};}function respondWithResult(_0x4e17eb,_0x1ed248){_0x1ed248=_0x1ed248||0xc8;return function(_0x52107e){if(_0x52107e){return _0x4e17eb[_0x3dc1('0x19')](_0x1ed248)[_0x3dc1('0x1a')](_0x52107e);}};}function respondWithFilteredResult(_0x127bfc,_0x137bb5){return function(_0x3b7eb6){if(_0x3b7eb6){var _0x3437df=_0x3b7eb6[_0x3dc1('0x1b')],_0x26b812=_0x137bb5[_0x3dc1('0x1c')],_0x46ebd1=_0x137bb5['offset']+_0x137bb5[_0x3dc1('0x1d')],_0x16b840;if(_0x46ebd1>=_0x3437df){_0x46ebd1=_0x3437df;_0x16b840=0xc8;}else{_0x16b840=0xce;}_0x127bfc[_0x3dc1('0x19')](_0x16b840);return _0x127bfc['set'](_0x3dc1('0x1e'),_0x26b812+'-'+_0x46ebd1+'/'+_0x3437df)[_0x3dc1('0x1a')](_0x3b7eb6);}return null;};}function patchUpdates(_0x1d6ea1){return function(_0x3e8f52){try{jsonpatch[_0x3dc1('0x1f')](_0x3e8f52,_0x1d6ea1,!![]);}catch(_0x3b5c56){return BPromise[_0x3dc1('0x20')](_0x3b5c56);}return _0x3e8f52[_0x3dc1('0x21')]();};}function saveUpdates(_0x3c4d0e,_0x362ca4){return function(_0x1c050f){if(_0x1c050f){return _0x1c050f[_0x3dc1('0x22')](_0x3c4d0e)[_0x3dc1('0x23')](function(_0x17f18a){return _0x17f18a;});}return null;};}function removeEntity(_0x16e766,_0x436137){return function(_0x5ec7b0){if(_0x5ec7b0){return _0x5ec7b0[_0x3dc1('0x24')]()['then'](function(){_0x16e766['status'](0xcc)[_0x3dc1('0x25')]();});}};}function handleEntityNotFound(_0x39931d,_0x587116){return function(_0x17566b){if(!_0x17566b){_0x39931d[_0x3dc1('0x18')](0x194);}return _0x17566b;};}function handleError(_0xd7bff6,_0x1abc8c){_0x1abc8c=_0x1abc8c||0x1f4;return function(_0x21334a){logger[_0x3dc1('0x26')](_0x21334a['stack']);if(_0x21334a[_0x3dc1('0x27')]){delete _0x21334a[_0x3dc1('0x27')];}_0xd7bff6[_0x3dc1('0x19')](_0x1abc8c)[_0x3dc1('0x28')](_0x21334a);};}exports[_0x3dc1('0x29')]=function(_0xe38fd1,_0x569b29){var _0x3ea579={},_0x1d23fd={},_0x2000b9={'count':0x0,'rows':[]};var _0x104393=_['map'](db[_0x3dc1('0x2a')]['rawAttributes'],function(_0x57f4f9){return{'name':_0x57f4f9[_0x3dc1('0x2b')],'type':_0x57f4f9[_0x3dc1('0x2c')]['key']};});_0x1d23fd[_0x3dc1('0x2d')]=_['map'](_0x104393,_0x3dc1('0x27'));_0x1d23fd[_0x3dc1('0x2e')]=_[_0x3dc1('0x2f')](_0xe38fd1[_0x3dc1('0x2e')]);_0x1d23fd['filters']=_[_0x3dc1('0x30')](_0x1d23fd['model'],_0x1d23fd[_0x3dc1('0x2e')]);_0x3ea579[_0x3dc1('0x31')]=_[_0x3dc1('0x30')](_0x1d23fd[_0x3dc1('0x2d')],qs[_0x3dc1('0x32')](_0xe38fd1['query'][_0x3dc1('0x32')]));_0x3ea579['attributes']=_0x3ea579['attributes'][_0x3dc1('0x33')]?_0x3ea579[_0x3dc1('0x31')]:_0x1d23fd[_0x3dc1('0x2d')];if(!_0xe38fd1['query']['hasOwnProperty'](_0x3dc1('0x34'))){_0x3ea579['limit']=qs[_0x3dc1('0x1d')](_0xe38fd1[_0x3dc1('0x2e')][_0x3dc1('0x1d')]);_0x3ea579['offset']=qs['offset'](_0xe38fd1[_0x3dc1('0x2e')]['offset']);}_0x3ea579['order']=qs[_0x3dc1('0x35')](_0xe38fd1['query'][_0x3dc1('0x35')]);_0x3ea579['where']=qs[_0x3dc1('0x36')](_[_0x3dc1('0x37')](_0xe38fd1[_0x3dc1('0x2e')],_0x1d23fd[_0x3dc1('0x36')]));if(_0xe38fd1['query'][_0x3dc1('0x38')]){_0x3ea579['where']=_[_0x3dc1('0x39')](_0x3ea579[_0x3dc1('0x3a')],{'$or':_['map'](_0x104393,function(_0x5cdaae){if(_0x5cdaae[_0x3dc1('0x2c')]!==_0x3dc1('0x3b')){var _0x5da199={};_0x5da199[_0x5cdaae[_0x3dc1('0x27')]]={'$like':'%'+_0xe38fd1['query'][_0x3dc1('0x38')]+'%'};return _0x5da199;}})});}_0x3ea579=_['merge']({},_0x3ea579,_0xe38fd1[_0x3dc1('0x3c')]);var _0x1ef753={'where':_0x3ea579[_0x3dc1('0x3a')]};return db[_0x3dc1('0x2a')][_0x3dc1('0x1b')](_0x1ef753)['then'](function(_0x268cd2){_0x2000b9[_0x3dc1('0x1b')]=_0x268cd2;if(_0xe38fd1[_0x3dc1('0x2e')][_0x3dc1('0x3d')]){_0x3ea579[_0x3dc1('0x3e')]=[{'all':!![]}];}return db[_0x3dc1('0x2a')]['findAll'](_0x3ea579);})['then'](function(_0x2e409a){_0x2000b9[_0x3dc1('0x3f')]=_0x2e409a;return _0x2000b9;})[_0x3dc1('0x23')](respondWithFilteredResult(_0x569b29,_0x3ea579))['catch'](handleError(_0x569b29,null));};exports[_0x3dc1('0x40')]=function(_0x2e46bb,_0x17e1d9){var _0x297c26={'raw':!![],'where':{'id':_0x2e46bb[_0x3dc1('0x41')]['id']}},_0x34fbe3={};_0x34fbe3['model']=_['keys'](db[_0x3dc1('0x2a')][_0x3dc1('0x42')]);_0x34fbe3['query']=_[_0x3dc1('0x2f')](_0x2e46bb[_0x3dc1('0x2e')]);_0x34fbe3[_0x3dc1('0x36')]=_[_0x3dc1('0x30')](_0x34fbe3[_0x3dc1('0x2d')],_0x34fbe3[_0x3dc1('0x2e')]);_0x297c26[_0x3dc1('0x31')]=_[_0x3dc1('0x30')](_0x34fbe3['model'],qs[_0x3dc1('0x32')](_0x2e46bb['query']['fields']));_0x297c26[_0x3dc1('0x31')]=_0x297c26[_0x3dc1('0x31')][_0x3dc1('0x33')]?_0x297c26[_0x3dc1('0x31')]:_0x34fbe3[_0x3dc1('0x2d')];if(_0x2e46bb[_0x3dc1('0x2e')][_0x3dc1('0x3d')]){_0x297c26[_0x3dc1('0x3e')]=[{'all':!![]}];}_0x297c26=_[_0x3dc1('0x39')]({},_0x297c26,_0x2e46bb['options']);return db[_0x3dc1('0x2a')][_0x3dc1('0x43')](_0x297c26)[_0x3dc1('0x23')](handleEntityNotFound(_0x17e1d9,null))['then'](respondWithResult(_0x17e1d9,null))[_0x3dc1('0x44')](handleError(_0x17e1d9,null));};exports[_0x3dc1('0x45')]=function(_0x513a74,_0x55f844){return db[_0x3dc1('0x2a')][_0x3dc1('0x45')](_0x513a74[_0x3dc1('0x46')],{})[_0x3dc1('0x23')](respondWithResult(_0x55f844,0xc9))[_0x3dc1('0x44')](handleError(_0x55f844,null));};exports[_0x3dc1('0x22')]=function(_0x5bab7d,_0x36ada0){if(_0x5bab7d[_0x3dc1('0x46')]['id']){delete _0x5bab7d[_0x3dc1('0x46')]['id'];}return db[_0x3dc1('0x2a')]['find']({'where':{'id':_0x5bab7d[_0x3dc1('0x41')]['id']}})[_0x3dc1('0x23')](handleEntityNotFound(_0x36ada0,null))[_0x3dc1('0x23')](saveUpdates(_0x5bab7d[_0x3dc1('0x46')],null))[_0x3dc1('0x23')](respondWithResult(_0x36ada0,null))[_0x3dc1('0x44')](handleError(_0x36ada0,null));};exports[_0x3dc1('0x24')]=function(_0xc9b8af,_0xbfb928){return db[_0x3dc1('0x2a')]['find']({'where':{'id':_0xc9b8af[_0x3dc1('0x41')]['id']}})[_0x3dc1('0x23')](handleEntityNotFound(_0xbfb928,null))[_0x3dc1('0x23')](removeEntity(_0xbfb928,null))[_0x3dc1('0x44')](handleError(_0xbfb928,null));};exports[_0x3dc1('0x47')]=function(_0x45b2cc,_0x4df80a){return db[_0x3dc1('0x2a')]['describe']()[_0x3dc1('0x23')](respondWithResult(_0x4df80a,null))[_0x3dc1('0x44')](handleError(_0x4df80a,null));}; \ No newline at end of file +var _0x8cc6=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','stack','name','send','index','FaxQueueReport','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x5eca5c,_0x3e5f6c){var _0x47ff2c=function(_0x32a63f){while(--_0x32a63f){_0x5eca5c['push'](_0x5eca5c['shift']());}};_0x47ff2c(++_0x3e5f6c);}(_0x8cc6,0x118));var _0x68cc=function(_0x520cdf,_0xfaf925){_0x520cdf=_0x520cdf-0x0;var _0x2130eb=_0x8cc6[_0x520cdf];return _0x2130eb;};'use strict';var pdf=require(_0x68cc('0x0'));var emlformat=require(_0x68cc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x68cc('0x2'));var jsonpatch=require(_0x68cc('0x3'));var rp=require(_0x68cc('0x4'));var moment=require(_0x68cc('0x5'));var BPromise=require(_0x68cc('0x6'));var Mustache=require(_0x68cc('0x7'));var util=require(_0x68cc('0x8'));var path=require(_0x68cc('0x9'));var sox=require(_0x68cc('0xa'));var csv=require(_0x68cc('0xb'));var ejs=require(_0x68cc('0xc'));var fs=require('fs');var _=require(_0x68cc('0xd'));var squel=require(_0x68cc('0xe'));var crypto=require(_0x68cc('0xf'));var jsforce=require(_0x68cc('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x68cc('0xb'));var querystring=require(_0x68cc('0x11'));var Papa=require(_0x68cc('0x12'));var Redis=require('ioredis');var authService=require(_0x68cc('0x13'));var qs=require(_0x68cc('0x14'));var as=require(_0x68cc('0x15'));var hardwareService=require(_0x68cc('0x16'));var logger=require(_0x68cc('0x17'))('api');var utils=require(_0x68cc('0x18'));var config=require('../../config/environment');var db=require(_0x68cc('0x19'))['db'];function respondWithStatusCode(_0x53f70c,_0x1de42b){_0x1de42b=_0x1de42b||0xcc;return function(_0x103ff0){if(_0x103ff0){return _0x53f70c[_0x68cc('0x1a')](_0x1de42b);}return _0x53f70c[_0x68cc('0x1b')](_0x1de42b)[_0x68cc('0x1c')]();};}function respondWithResult(_0x5c0145,_0x278581){_0x278581=_0x278581||0xc8;return function(_0x4469b1){if(_0x4469b1){return _0x5c0145[_0x68cc('0x1b')](_0x278581)[_0x68cc('0x1d')](_0x4469b1);}};}function respondWithFilteredResult(_0x7f7bb6,_0xa8d5ee){return function(_0x284bb9){if(_0x284bb9){var _0x5189b4=_0x284bb9[_0x68cc('0x1e')],_0x39722e=_0xa8d5ee[_0x68cc('0x1f')],_0x350541=_0xa8d5ee[_0x68cc('0x1f')]+_0xa8d5ee[_0x68cc('0x20')],_0x224bfb;if(_0x350541>=_0x5189b4){_0x350541=_0x5189b4;_0x224bfb=0xc8;}else{_0x224bfb=0xce;}_0x7f7bb6[_0x68cc('0x1b')](_0x224bfb);return _0x7f7bb6[_0x68cc('0x21')]('Content-Range',_0x39722e+'-'+_0x350541+'/'+_0x5189b4)['json'](_0x284bb9);}return null;};}function patchUpdates(_0x46f6d3){return function(_0x10b2bc){try{jsonpatch[_0x68cc('0x22')](_0x10b2bc,_0x46f6d3,!![]);}catch(_0x3a10e4){return BPromise[_0x68cc('0x23')](_0x3a10e4);}return _0x10b2bc['save']();};}function saveUpdates(_0xae1d3a,_0xa8f3b9){return function(_0xf05e8d){if(_0xf05e8d){return _0xf05e8d[_0x68cc('0x24')](_0xae1d3a)[_0x68cc('0x25')](function(_0x5cdb49){return _0x5cdb49;});}return null;};}function removeEntity(_0x56e2bf,_0x6da41e){return function(_0x33fa7b){if(_0x33fa7b){return _0x33fa7b[_0x68cc('0x26')]()[_0x68cc('0x25')](function(){_0x56e2bf[_0x68cc('0x1b')](0xcc)[_0x68cc('0x1c')]();});}};}function handleEntityNotFound(_0x5f0b14,_0x4260f6){return function(_0xef244){if(!_0xef244){_0x5f0b14[_0x68cc('0x1a')](0x194);}return _0xef244;};}function handleError(_0x387242,_0x479ae3){_0x479ae3=_0x479ae3||0x1f4;return function(_0x3f6471){logger['error'](_0x3f6471[_0x68cc('0x27')]);if(_0x3f6471['name']){delete _0x3f6471[_0x68cc('0x28')];}_0x387242[_0x68cc('0x1b')](_0x479ae3)[_0x68cc('0x29')](_0x3f6471);};}exports[_0x68cc('0x2a')]=function(_0x119dfc,_0x37a710){var _0x5f11f7={},_0x15cd4d={},_0x30cce3={'count':0x0,'rows':[]};var _0x5081a7=_['map'](db[_0x68cc('0x2b')]['rawAttributes'],function(_0x1b4898){return{'name':_0x1b4898[_0x68cc('0x2c')],'type':_0x1b4898['type'][_0x68cc('0x2d')]};});_0x15cd4d[_0x68cc('0x2e')]=_[_0x68cc('0x2f')](_0x5081a7,_0x68cc('0x28'));_0x15cd4d[_0x68cc('0x30')]=_['keys'](_0x119dfc[_0x68cc('0x30')]);_0x15cd4d[_0x68cc('0x31')]=_[_0x68cc('0x32')](_0x15cd4d[_0x68cc('0x2e')],_0x15cd4d['query']);_0x5f11f7['attributes']=_[_0x68cc('0x32')](_0x15cd4d[_0x68cc('0x2e')],qs[_0x68cc('0x33')](_0x119dfc[_0x68cc('0x30')]['fields']));_0x5f11f7[_0x68cc('0x34')]=_0x5f11f7[_0x68cc('0x34')][_0x68cc('0x35')]?_0x5f11f7[_0x68cc('0x34')]:_0x15cd4d[_0x68cc('0x2e')];if(!_0x119dfc[_0x68cc('0x30')]['hasOwnProperty']('nolimit')){_0x5f11f7[_0x68cc('0x20')]=qs['limit'](_0x119dfc[_0x68cc('0x30')][_0x68cc('0x20')]);_0x5f11f7['offset']=qs[_0x68cc('0x1f')](_0x119dfc[_0x68cc('0x30')][_0x68cc('0x1f')]);}_0x5f11f7[_0x68cc('0x36')]=qs['sort'](_0x119dfc[_0x68cc('0x30')]['sort']);_0x5f11f7[_0x68cc('0x37')]=qs['filters'](_['pick'](_0x119dfc['query'],_0x15cd4d[_0x68cc('0x31')]));if(_0x119dfc['query'][_0x68cc('0x38')]){_0x5f11f7[_0x68cc('0x37')]=_[_0x68cc('0x39')](_0x5f11f7['where'],{'$or':_[_0x68cc('0x2f')](_0x5081a7,function(_0x3c8695){if(_0x3c8695[_0x68cc('0x3a')]!==_0x68cc('0x3b')){var _0x1ceac4={};_0x1ceac4[_0x3c8695[_0x68cc('0x28')]]={'$like':'%'+_0x119dfc['query'][_0x68cc('0x38')]+'%'};return _0x1ceac4;}})});}_0x5f11f7=_['merge']({},_0x5f11f7,_0x119dfc[_0x68cc('0x3c')]);var _0x36d927={'where':_0x5f11f7[_0x68cc('0x37')]};return db[_0x68cc('0x2b')][_0x68cc('0x1e')](_0x36d927)[_0x68cc('0x25')](function(_0x26acce){_0x30cce3[_0x68cc('0x1e')]=_0x26acce;if(_0x119dfc[_0x68cc('0x30')][_0x68cc('0x3d')]){_0x5f11f7[_0x68cc('0x3e')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x68cc('0x3f')](_0x5f11f7);})[_0x68cc('0x25')](function(_0xb6e431){_0x30cce3[_0x68cc('0x40')]=_0xb6e431;return _0x30cce3;})[_0x68cc('0x25')](respondWithFilteredResult(_0x37a710,_0x5f11f7))[_0x68cc('0x41')](handleError(_0x37a710,null));};exports[_0x68cc('0x42')]=function(_0x1c78d8,_0x69a9c7){var _0x3c234c={'raw':!![],'where':{'id':_0x1c78d8[_0x68cc('0x43')]['id']}},_0x1b0a7f={};_0x1b0a7f[_0x68cc('0x2e')]=_[_0x68cc('0x44')](db['FaxQueueReport'][_0x68cc('0x45')]);_0x1b0a7f['query']=_[_0x68cc('0x44')](_0x1c78d8['query']);_0x1b0a7f[_0x68cc('0x31')]=_[_0x68cc('0x32')](_0x1b0a7f[_0x68cc('0x2e')],_0x1b0a7f[_0x68cc('0x30')]);_0x3c234c[_0x68cc('0x34')]=_[_0x68cc('0x32')](_0x1b0a7f[_0x68cc('0x2e')],qs['fields'](_0x1c78d8[_0x68cc('0x30')]['fields']));_0x3c234c['attributes']=_0x3c234c[_0x68cc('0x34')][_0x68cc('0x35')]?_0x3c234c[_0x68cc('0x34')]:_0x1b0a7f[_0x68cc('0x2e')];if(_0x1c78d8[_0x68cc('0x30')]['includeAll']){_0x3c234c[_0x68cc('0x3e')]=[{'all':!![]}];}_0x3c234c=_[_0x68cc('0x39')]({},_0x3c234c,_0x1c78d8[_0x68cc('0x3c')]);return db[_0x68cc('0x2b')][_0x68cc('0x46')](_0x3c234c)['then'](handleEntityNotFound(_0x69a9c7,null))['then'](respondWithResult(_0x69a9c7,null))[_0x68cc('0x41')](handleError(_0x69a9c7,null));};exports[_0x68cc('0x47')]=function(_0x4e77fd,_0x45ac0b){return db[_0x68cc('0x2b')][_0x68cc('0x47')](_0x4e77fd['body'],{})['then'](respondWithResult(_0x45ac0b,0xc9))[_0x68cc('0x41')](handleError(_0x45ac0b,null));};exports['update']=function(_0x3b46f2,_0xb1a88){if(_0x3b46f2[_0x68cc('0x48')]['id']){delete _0x3b46f2['body']['id'];}return db[_0x68cc('0x2b')][_0x68cc('0x46')]({'where':{'id':_0x3b46f2[_0x68cc('0x43')]['id']}})[_0x68cc('0x25')](handleEntityNotFound(_0xb1a88,null))[_0x68cc('0x25')](saveUpdates(_0x3b46f2[_0x68cc('0x48')],null))[_0x68cc('0x25')](respondWithResult(_0xb1a88,null))['catch'](handleError(_0xb1a88,null));};exports[_0x68cc('0x26')]=function(_0x18f98f,_0x5edbb9){return db[_0x68cc('0x2b')][_0x68cc('0x46')]({'where':{'id':_0x18f98f[_0x68cc('0x43')]['id']}})[_0x68cc('0x25')](handleEntityNotFound(_0x5edbb9,null))[_0x68cc('0x25')](removeEntity(_0x5edbb9,null))['catch'](handleError(_0x5edbb9,null));};exports[_0x68cc('0x49')]=function(_0x4119e1,_0x31603a){return db['FaxQueueReport'][_0x68cc('0x49')]()[_0x68cc('0x25')](respondWithResult(_0x31603a,null))[_0x68cc('0x41')](handleError(_0x31603a,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index d758ca1..26b43c6 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79fd=['../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1efd8b,_0xe3907c){var _0x3ec010=function(_0x36c8b6){while(--_0x36c8b6){_0x1efd8b['push'](_0x1efd8b['shift']());}};_0x3ec010(++_0xe3907c);}(_0x79fd,0x71));var _0xd79f=function(_0x2790ab,_0x2b5721){_0x2790ab=_0x2790ab-0x0;var _0x1f1c74=_0x79fd[_0x2790ab];return _0x1f1c74;};'use strict';var _=require(_0xd79f('0x0'));var util=require('util');var logger=require(_0xd79f('0x1'))(_0xd79f('0x2'));var moment=require(_0xd79f('0x3'));var BPromise=require(_0xd79f('0x4'));var rp=require(_0xd79f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd79f('0x6'));var config=require(_0xd79f('0x7'));var attributes=require(_0xd79f('0x8'));module['exports']=function(_0x4a3d06,_0x2ed317){return _0x4a3d06[_0xd79f('0x9')]('FaxQueueReport',attributes,{'tableName':_0xd79f('0xa'),'paranoid':![],'indexes':[{'name':_0xd79f('0xb'),'fields':[_0xd79f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d2a=['exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxQueueReport.attributes'];(function(_0x545d0c,_0x958499){var _0x380fdf=function(_0x297589){while(--_0x297589){_0x545d0c['push'](_0x545d0c['shift']());}};_0x380fdf(++_0x958499);}(_0x4d2a,0xa1));var _0xa4d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa4d2('0x0'));var util=require('util');var logger=require(_0xa4d2('0x1'))(_0xa4d2('0x2'));var moment=require(_0xa4d2('0x3'));var BPromise=require(_0xa4d2('0x4'));var rp=require(_0xa4d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4d2('0x6'));var config=require('../../config/environment');var attributes=require(_0xa4d2('0x7'));module[_0xa4d2('0x8')]=function(_0xeeff98,_0x584006){return _0xeeff98[_0xa4d2('0x9')](_0xa4d2('0xa'),attributes,{'tableName':_0xa4d2('0xb'),'paranoid':![],'indexes':[{'name':_0xa4d2('0xc'),'fields':[_0xa4d2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index c9b69d8..d6cdd46 100644 --- a/server/api/faxQueueReport/faxQueueReport.rpc.js +++ b/server/api/faxQueueReport/faxQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfae2=['result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport','where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4098cc,_0x2a34f1){var _0x27e2d8=function(_0x47a4dc){while(--_0x47a4dc){_0x4098cc['push'](_0x4098cc['shift']());}};_0x27e2d8(++_0x2a34f1);}(_0xfae2,0x6a));var _0x2fae=function(_0x4e1280,_0x3b8e04){_0x4e1280=_0x4e1280-0x0;var _0x59c5f=_0xfae2[_0x4e1280];return _0x59c5f;};'use strict';var _=require(_0x2fae('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2fae('0x1'));var rs=require(_0x2fae('0x2'));var fs=require('fs');var Redis=require(_0x2fae('0x3'));var db=require(_0x2fae('0x4'))['db'];var utils=require(_0x2fae('0x5'));var logger=require(_0x2fae('0x6'))(_0x2fae('0x7'));var config=require(_0x2fae('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2fae('0x9')][_0x2fae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8749ca,_0x33b6f2,_0x1bc26d){return new BPromise(function(_0x3e35b9,_0x3efb58){return client[_0x2fae('0xb')](_0x8749ca,_0x1bc26d)[_0x2fae('0xc')](function(_0x352cfd){logger['info'](_0x2fae('0xd'),_0x33b6f2,_0x2fae('0xe'));logger[_0x2fae('0xf')](_0x2fae('0x10'),_0x33b6f2,_0x2fae('0xe'),JSON[_0x2fae('0x11')](_0x352cfd));if(_0x352cfd[_0x2fae('0x12')]){if(_0x352cfd['error'][_0x2fae('0x13')]===0x1f4){logger[_0x2fae('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x33b6f2,_0x352cfd[_0x2fae('0x12')][_0x2fae('0x14')]);return _0x3efb58(_0x352cfd[_0x2fae('0x12')][_0x2fae('0x14')]);}logger[_0x2fae('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x33b6f2,_0x352cfd[_0x2fae('0x12')]['message']);return _0x3e35b9(_0x352cfd[_0x2fae('0x12')][_0x2fae('0x14')]);}else{logger[_0x2fae('0x15')](_0x2fae('0xd'),_0x33b6f2,_0x2fae('0xe'));_0x3e35b9(_0x352cfd[_0x2fae('0x16')][_0x2fae('0x14')]);}})[_0x2fae('0x17')](function(_0x243a91){logger[_0x2fae('0x12')](_0x2fae('0xd'),_0x33b6f2,_0x243a91);_0x3efb58(_0x243a91);});});}exports[_0x2fae('0x18')]=function(_0x3977ae){var _0x391b70=this;return new Promise(function(_0x127b7d,_0x5d62df){return db[_0x2fae('0x19')]['create'](_0x3977ae[_0x2fae('0x1a')],{'raw':_0x3977ae[_0x2fae('0x1b')]?_0x3977ae[_0x2fae('0x1b')][_0x2fae('0x1c')]===undefined?!![]:![]:!![]})[_0x2fae('0xc')](function(_0x16fee7){logger['info'](_0x2fae('0x18'),_0x3977ae);logger['debug'](_0x2fae('0x18'),_0x3977ae,JSON['stringify'](_0x16fee7));_0x127b7d(_0x16fee7);})['catch'](function(_0x4e2f35){logger[_0x2fae('0x12')]('CreateFaxQueueReport',_0x4e2f35['message'],_0x3977ae);_0x5d62df(_0x391b70[_0x2fae('0x12')](0x1f4,_0x4e2f35[_0x2fae('0x14')]));});});};exports[_0x2fae('0x1d')]=function(_0x1d8a40){var _0x13fbea=this;return new Promise(function(_0x5d3c6c,_0x310e29){return db[_0x2fae('0x19')]['update'](_0x1d8a40['body'],{'raw':_0x1d8a40['options']?_0x1d8a40['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d8a40[_0x2fae('0x1b')]?_0x1d8a40[_0x2fae('0x1b')][_0x2fae('0x1e')]||null:null,'attributes':_0x1d8a40[_0x2fae('0x1b')]?_0x1d8a40['options']['attributes']||null:null,'limit':_0x1d8a40[_0x2fae('0x1b')]?_0x1d8a40[_0x2fae('0x1b')][_0x2fae('0x1f')]||null:null})['then'](function(_0x1080cc){logger['info'](_0x2fae('0x1d'),_0x1d8a40);logger[_0x2fae('0xf')](_0x2fae('0x1d'),_0x1d8a40,JSON[_0x2fae('0x11')](_0x1080cc));_0x5d3c6c(_0x1080cc);})[_0x2fae('0x17')](function(_0x573813){logger[_0x2fae('0x12')](_0x2fae('0x1d'),_0x573813['message'],_0x1d8a40);_0x310e29(_0x13fbea[_0x2fae('0x12')](0x1f4,_0x573813['message']));});});}; \ No newline at end of file +var _0x4075=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1d5e28,_0x468009){var _0x1f221b=function(_0xf4e52d){while(--_0xf4e52d){_0x1d5e28['push'](_0x1d5e28['shift']());}};_0x1f221b(++_0x468009);}(_0x4075,0x15b));var _0x5407=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x4075[_0x588011];return _0x3b3773;};'use strict';var _=require(_0x5407('0x0'));var util=require('util');var moment=require(_0x5407('0x1'));var BPromise=require(_0x5407('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5407('0x3'));var db=require(_0x5407('0x4'))['db'];var utils=require(_0x5407('0x5'));var logger=require('../../config/logger')(_0x5407('0x6'));var config=require(_0x5407('0x7'));var jayson=require(_0x5407('0x8'));var client=jayson[_0x5407('0x9')][_0x5407('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29840f,_0x5307f2,_0x3d785d){return new BPromise(function(_0x40b15b,_0x4f8149){return client['request'](_0x29840f,_0x3d785d)['then'](function(_0x2e65ea){logger[_0x5407('0xb')](_0x5407('0xc'),_0x5307f2,_0x5407('0xd'));logger[_0x5407('0xe')](_0x5407('0xf'),_0x5307f2,_0x5407('0xd'),JSON[_0x5407('0x10')](_0x2e65ea));if(_0x2e65ea[_0x5407('0x11')]){if(_0x2e65ea[_0x5407('0x11')]['code']===0x1f4){logger[_0x5407('0x11')](_0x5407('0xc'),_0x5307f2,_0x2e65ea[_0x5407('0x11')][_0x5407('0x12')]);return _0x4f8149(_0x2e65ea[_0x5407('0x11')]['message']);}logger[_0x5407('0x11')](_0x5407('0xc'),_0x5307f2,_0x2e65ea['error']['message']);return _0x40b15b(_0x2e65ea['error'][_0x5407('0x12')]);}else{logger[_0x5407('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x5307f2,_0x5407('0xd'));_0x40b15b(_0x2e65ea[_0x5407('0x13')]['message']);}})[_0x5407('0x14')](function(_0x25ab41){logger[_0x5407('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x5307f2,_0x25ab41);_0x4f8149(_0x25ab41);});});}exports[_0x5407('0x15')]=function(_0xed6a27){var _0x1a7d62=this;return new Promise(function(_0x3fe02d,_0x53141e){return db[_0x5407('0x16')][_0x5407('0x17')](_0xed6a27[_0x5407('0x18')],{'raw':_0xed6a27[_0x5407('0x19')]?_0xed6a27[_0x5407('0x19')][_0x5407('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x58ab23){logger[_0x5407('0xb')](_0x5407('0x15'),_0xed6a27);logger['debug'](_0x5407('0x15'),_0xed6a27,JSON['stringify'](_0x58ab23));_0x3fe02d(_0x58ab23);})[_0x5407('0x14')](function(_0x2419b0){logger[_0x5407('0x11')]('CreateFaxQueueReport',_0x2419b0[_0x5407('0x12')],_0xed6a27);_0x53141e(_0x1a7d62[_0x5407('0x11')](0x1f4,_0x2419b0[_0x5407('0x12')]));});});};exports[_0x5407('0x1b')]=function(_0x5cb522){var _0x5f4598=this;return new Promise(function(_0x570fd2,_0x506170){return db[_0x5407('0x16')][_0x5407('0x1c')](_0x5cb522[_0x5407('0x18')],{'raw':_0x5cb522['options']?_0x5cb522[_0x5407('0x19')][_0x5407('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cb522[_0x5407('0x19')]?_0x5cb522[_0x5407('0x19')][_0x5407('0x1d')]||null:null,'attributes':_0x5cb522[_0x5407('0x19')]?_0x5cb522[_0x5407('0x19')][_0x5407('0x1e')]||null:null,'limit':_0x5cb522['options']?_0x5cb522[_0x5407('0x19')][_0x5407('0x1f')]||null:null})['then'](function(_0x511763){logger['info']('UpdateFaxQueueReport',_0x5cb522);logger[_0x5407('0xe')](_0x5407('0x1b'),_0x5cb522,JSON['stringify'](_0x511763));_0x570fd2(_0x511763);})[_0x5407('0x14')](function(_0x129ade){logger[_0x5407('0x11')](_0x5407('0x1b'),_0x129ade[_0x5407('0x12')],_0x5cb522);_0x506170(_0x5f4598[_0x5407('0x11')](0x1f4,_0x129ade[_0x5407('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 872220a..2fd5d60 100644 --- a/server/api/faxQueueReport/index.js +++ b/server/api/faxQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc702=['update','delete','/:id','destroy','exports','util','path','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','create','put'];(function(_0xb45663,_0x290a30){var _0x4c826d=function(_0x49699c){while(--_0x49699c){_0xb45663['push'](_0xb45663['shift']());}};_0x4c826d(++_0x290a30);}(_0xc702,0x1d5));var _0x2c70=function(_0x29edd8,_0x587b45){_0x29edd8=_0x29edd8-0x0;var _0x483d66=_0xc702[_0x29edd8];return _0x483d66;};'use strict';var multer=require('multer');var util=require(_0x2c70('0x0'));var path=require(_0x2c70('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2c70('0x2'));var config=require(_0x2c70('0x3'));var controller=require(_0x2c70('0x4'));router[_0x2c70('0x5')]('/',auth[_0x2c70('0x6')](),controller[_0x2c70('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x2c70('0x8')]);router['get']('/:id',auth[_0x2c70('0x6')](),controller['show']);router['post']('/',auth[_0x2c70('0x6')](),controller[_0x2c70('0x9')]);router[_0x2c70('0xa')]('/:id',auth[_0x2c70('0x6')](),controller[_0x2c70('0xb')]);router[_0x2c70('0xc')](_0x2c70('0xd'),auth[_0x2c70('0x6')](),controller[_0x2c70('0xe')]);module[_0x2c70('0xf')]=router; \ No newline at end of file +var _0x7002=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','post','create'];(function(_0x1933e5,_0x46fbdd){var _0x4d9ab6=function(_0x1c2c8d){while(--_0x1c2c8d){_0x1933e5['push'](_0x1933e5['shift']());}};_0x4d9ab6(++_0x46fbdd);}(_0x7002,0x1b4));var _0x2700=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x7002[_0x432fca];return _0x3adba4;};'use strict';var multer=require(_0x2700('0x0'));var util=require(_0x2700('0x1'));var path=require('path');var timeout=require(_0x2700('0x2'));var express=require(_0x2700('0x3'));var router=express[_0x2700('0x4')]();var auth=require(_0x2700('0x5'));var interaction=require(_0x2700('0x6'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x2700('0x7')]('/',auth[_0x2700('0x8')](),controller['index']);router[_0x2700('0x7')](_0x2700('0x9'),auth[_0x2700('0x8')](),controller[_0x2700('0xa')]);router[_0x2700('0x7')](_0x2700('0xb'),auth[_0x2700('0x8')](),controller['show']);router[_0x2700('0xc')]('/',auth['isAuthenticated'](),controller[_0x2700('0xd')]);router['put'](_0x2700('0xb'),auth[_0x2700('0x8')](),controller[_0x2700('0xe')]);router[_0x2700('0xf')](_0x2700('0xb'),auth[_0x2700('0x8')](),controller[_0x2700('0x10')]);module[_0x2700('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index a803f8c..4a0c6e3 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9439=['queue','DATE','NOW','sequelize','exports','STRING','account','agent'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x9439,0x9b));var _0x9943=function(_0x13a259,_0x2e65ad){_0x13a259=_0x13a259-0x0;var _0x5807b1=_0x9439[_0x13a259];return _0x5807b1;};'use strict';var moment=require('moment');var Sequelize=require(_0x9943('0x0'));module[_0x9943('0x1')]={'uniqueid':{'type':Sequelize[_0x9943('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9943('0x3'),_0x9943('0x4'),_0x9943('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x9943('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x9943('0x7')]}}; \ No newline at end of file +var _0x456c=['moment','sequelize','exports','ENUM','account','agent','queue','DATE','NOW'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x456c,0x75));var _0xc456=function(_0x1cc0b8,_0x3bdfe7){_0x1cc0b8=_0x1cc0b8-0x0;var _0x4b1daf=_0x456c[_0x1cc0b8];return _0x4b1daf;};'use strict';var moment=require(_0xc456('0x0'));var Sequelize=require(_0xc456('0x1'));module[_0xc456('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc456('0x3')](_0xc456('0x4'),_0xc456('0x5'),_0xc456('0x6')),'allowNull':![],'defaultValue':_0xc456('0x6')},'transferredAt':{'type':Sequelize[_0xc456('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc456('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 317ff9a..cf1fc46 100644 --- a/server/api/faxTransferReport/faxTransferReport.controller.js +++ b/server/api/faxTransferReport/faxTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3af5=['model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','catch','create','update','body','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','FaxTransferReport','fieldName','key'];(function(_0x2f07c6,_0x5c6b20){var _0x29db6b=function(_0x55bac7){while(--_0x55bac7){_0x2f07c6['push'](_0x2f07c6['shift']());}};_0x29db6b(++_0x5c6b20);}(_0x3af5,0x102));var _0x53af=function(_0x11fb16,_0x29a381){_0x11fb16=_0x11fb16-0x0;var _0x343de1=_0x3af5[_0x11fb16];return _0x343de1;};'use strict';var pdf=require(_0x53af('0x0'));var emlformat=require(_0x53af('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x53af('0x2'));var rp=require(_0x53af('0x3'));var moment=require('moment');var BPromise=require(_0x53af('0x4'));var Mustache=require(_0x53af('0x5'));var util=require(_0x53af('0x6'));var path=require(_0x53af('0x7'));var sox=require(_0x53af('0x8'));var csv=require(_0x53af('0x9'));var ejs=require(_0x53af('0xa'));var fs=require('fs');var _=require(_0x53af('0xb'));var squel=require(_0x53af('0xc'));var crypto=require('crypto');var jsforce=require(_0x53af('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x53af('0x9'));var querystring=require(_0x53af('0xe'));var Papa=require(_0x53af('0xf'));var Redis=require(_0x53af('0x10'));var authService=require(_0x53af('0x11'));var qs=require(_0x53af('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x53af('0x13'))(_0x53af('0x14'));var utils=require('../../config/utils');var config=require(_0x53af('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cb47,_0x4925be){_0x4925be=_0x4925be||0xcc;return function(_0x53374c){if(_0x53374c){return _0x2cb47[_0x53af('0x16')](_0x4925be);}return _0x2cb47[_0x53af('0x17')](_0x4925be)[_0x53af('0x18')]();};}function respondWithResult(_0xa3fb79,_0x366aae){_0x366aae=_0x366aae||0xc8;return function(_0x1f81cd){if(_0x1f81cd){return _0xa3fb79[_0x53af('0x17')](_0x366aae)[_0x53af('0x19')](_0x1f81cd);}};}function respondWithFilteredResult(_0x405838,_0x13bae0){return function(_0x1eab80){if(_0x1eab80){var _0x87c32b=_0x1eab80[_0x53af('0x1a')],_0x157c84=_0x13bae0[_0x53af('0x1b')],_0x221814=_0x13bae0[_0x53af('0x1b')]+_0x13bae0[_0x53af('0x1c')],_0x1abcfc;if(_0x221814>=_0x87c32b){_0x221814=_0x87c32b;_0x1abcfc=0xc8;}else{_0x1abcfc=0xce;}_0x405838[_0x53af('0x17')](_0x1abcfc);return _0x405838[_0x53af('0x1d')](_0x53af('0x1e'),_0x157c84+'-'+_0x221814+'/'+_0x87c32b)['json'](_0x1eab80);}return null;};}function patchUpdates(_0x49402c){return function(_0x23ca51){try{jsonpatch[_0x53af('0x1f')](_0x23ca51,_0x49402c,!![]);}catch(_0x1111d7){return BPromise[_0x53af('0x20')](_0x1111d7);}return _0x23ca51['save']();};}function saveUpdates(_0x1d0b6f,_0x4a5677){return function(_0x5cd239){if(_0x5cd239){return _0x5cd239['update'](_0x1d0b6f)[_0x53af('0x21')](function(_0x4f6226){return _0x4f6226;});}return null;};}function removeEntity(_0xb8187,_0x1af177){return function(_0x2f5b85){if(_0x2f5b85){return _0x2f5b85[_0x53af('0x22')]()['then'](function(){_0xb8187[_0x53af('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d8c4,_0x370ca2){return function(_0x5ad38f){if(!_0x5ad38f){_0x21d8c4[_0x53af('0x16')](0x194);}return _0x5ad38f;};}function handleError(_0xec4d6c,_0x28f7f5){_0x28f7f5=_0x28f7f5||0x1f4;return function(_0x410ad9){logger['error'](_0x410ad9[_0x53af('0x23')]);if(_0x410ad9[_0x53af('0x24')]){delete _0x410ad9['name'];}_0xec4d6c['status'](_0x28f7f5)[_0x53af('0x25')](_0x410ad9);};}exports[_0x53af('0x26')]=function(_0x219919,_0x222f9a){var _0x5c2f9b={},_0x39c525={},_0x4b64ab={'count':0x0,'rows':[]};var _0x5c0825=_['map'](db[_0x53af('0x27')]['rawAttributes'],function(_0x43d46b){return{'name':_0x43d46b[_0x53af('0x28')],'type':_0x43d46b['type'][_0x53af('0x29')]};});_0x39c525[_0x53af('0x2a')]=_[_0x53af('0x2b')](_0x5c0825,'name');_0x39c525[_0x53af('0x2c')]=_[_0x53af('0x2d')](_0x219919['query']);_0x39c525[_0x53af('0x2e')]=_[_0x53af('0x2f')](_0x39c525['model'],_0x39c525[_0x53af('0x2c')]);_0x5c2f9b['attributes']=_[_0x53af('0x2f')](_0x39c525[_0x53af('0x2a')],qs[_0x53af('0x30')](_0x219919[_0x53af('0x2c')]['fields']));_0x5c2f9b[_0x53af('0x31')]=_0x5c2f9b['attributes']['length']?_0x5c2f9b[_0x53af('0x31')]:_0x39c525[_0x53af('0x2a')];if(!_0x219919['query'][_0x53af('0x32')](_0x53af('0x33'))){_0x5c2f9b[_0x53af('0x1c')]=qs[_0x53af('0x1c')](_0x219919[_0x53af('0x2c')][_0x53af('0x1c')]);_0x5c2f9b[_0x53af('0x1b')]=qs[_0x53af('0x1b')](_0x219919['query'][_0x53af('0x1b')]);}_0x5c2f9b[_0x53af('0x34')]=qs[_0x53af('0x35')](_0x219919[_0x53af('0x2c')][_0x53af('0x35')]);_0x5c2f9b[_0x53af('0x36')]=qs[_0x53af('0x2e')](_[_0x53af('0x37')](_0x219919[_0x53af('0x2c')],_0x39c525[_0x53af('0x2e')]));if(_0x219919[_0x53af('0x2c')][_0x53af('0x38')]){_0x5c2f9b[_0x53af('0x36')]=_[_0x53af('0x39')](_0x5c2f9b['where'],{'$or':_['map'](_0x5c0825,function(_0x3c28ac){if(_0x3c28ac[_0x53af('0x3a')]!==_0x53af('0x3b')){var _0x844000={};_0x844000[_0x3c28ac[_0x53af('0x24')]]={'$like':'%'+_0x219919[_0x53af('0x2c')][_0x53af('0x38')]+'%'};return _0x844000;}})});}_0x5c2f9b=_[_0x53af('0x39')]({},_0x5c2f9b,_0x219919[_0x53af('0x3c')]);var _0x599aa3={'where':_0x5c2f9b[_0x53af('0x36')]};return db[_0x53af('0x27')][_0x53af('0x1a')](_0x599aa3)[_0x53af('0x21')](function(_0x134dc9){_0x4b64ab[_0x53af('0x1a')]=_0x134dc9;if(_0x219919[_0x53af('0x2c')]['includeAll']){_0x5c2f9b[_0x53af('0x3d')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x53af('0x3e')](_0x5c2f9b);})['then'](function(_0x40f024){_0x4b64ab[_0x53af('0x3f')]=_0x40f024;return _0x4b64ab;})[_0x53af('0x21')](respondWithFilteredResult(_0x222f9a,_0x5c2f9b))['catch'](handleError(_0x222f9a,null));};exports[_0x53af('0x40')]=function(_0x60b548,_0x2516df){var _0x21350e={'raw':!![],'where':{'id':_0x60b548[_0x53af('0x41')]['id']}},_0xd31241={};_0xd31241[_0x53af('0x2a')]=_[_0x53af('0x2d')](db[_0x53af('0x27')][_0x53af('0x42')]);_0xd31241[_0x53af('0x2c')]=_['keys'](_0x60b548[_0x53af('0x2c')]);_0xd31241['filters']=_[_0x53af('0x2f')](_0xd31241[_0x53af('0x2a')],_0xd31241[_0x53af('0x2c')]);_0x21350e['attributes']=_['intersection'](_0xd31241['model'],qs[_0x53af('0x30')](_0x60b548['query'][_0x53af('0x30')]));_0x21350e['attributes']=_0x21350e['attributes'][_0x53af('0x43')]?_0x21350e[_0x53af('0x31')]:_0xd31241['model'];if(_0x60b548[_0x53af('0x2c')][_0x53af('0x44')]){_0x21350e[_0x53af('0x3d')]=[{'all':!![]}];}_0x21350e=_['merge']({},_0x21350e,_0x60b548[_0x53af('0x3c')]);return db[_0x53af('0x27')][_0x53af('0x45')](_0x21350e)[_0x53af('0x21')](handleEntityNotFound(_0x2516df,null))[_0x53af('0x21')](respondWithResult(_0x2516df,null))[_0x53af('0x46')](handleError(_0x2516df,null));};exports[_0x53af('0x47')]=function(_0x2aafb3,_0x11eb37){return db[_0x53af('0x27')][_0x53af('0x47')](_0x2aafb3['body'],{})[_0x53af('0x21')](respondWithResult(_0x11eb37,0xc9))[_0x53af('0x46')](handleError(_0x11eb37,null));};exports[_0x53af('0x48')]=function(_0x570458,_0x3597ae){if(_0x570458[_0x53af('0x49')]['id']){delete _0x570458[_0x53af('0x49')]['id'];}return db[_0x53af('0x27')][_0x53af('0x45')]({'where':{'id':_0x570458[_0x53af('0x41')]['id']}})['then'](handleEntityNotFound(_0x3597ae,null))[_0x53af('0x21')](saveUpdates(_0x570458['body'],null))[_0x53af('0x21')](respondWithResult(_0x3597ae,null))[_0x53af('0x46')](handleError(_0x3597ae,null));};exports['destroy']=function(_0x271819,_0x3d74c8){return db[_0x53af('0x27')][_0x53af('0x45')]({'where':{'id':_0x271819['params']['id']}})['then'](handleEntityNotFound(_0x3d74c8,null))['then'](removeEntity(_0x3d74c8,null))[_0x53af('0x46')](handleError(_0x3d74c8,null));};exports[_0x53af('0x4a')]=function(_0x16db6b,_0x40bb14){return db['FaxTransferReport'][_0x53af('0x4a')]()[_0x53af('0x21')](respondWithResult(_0x40bb14,null))[_0x53af('0x46')](handleError(_0x40bb14,null));}; \ No newline at end of file +var _0xe781=['lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','merge','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xe781,0xd6));var _0x1e78=function(_0x44b604,_0x21c079){_0x44b604=_0x44b604-0x0;var _0x3968ac=_0xe781[_0x44b604];return _0x3968ac;};'use strict';var pdf=require(_0x1e78('0x0'));var emlformat=require(_0x1e78('0x1'));var rimraf=require(_0x1e78('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e78('0x3'));var rp=require(_0x1e78('0x4'));var moment=require(_0x1e78('0x5'));var BPromise=require(_0x1e78('0x6'));var Mustache=require(_0x1e78('0x7'));var util=require(_0x1e78('0x8'));var path=require(_0x1e78('0x9'));var sox=require(_0x1e78('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1e78('0xb'));var squel=require('squel');var crypto=require(_0x1e78('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1e78('0xd'));var toCsv=require(_0x1e78('0xe'));var querystring=require(_0x1e78('0xf'));var Papa=require('papaparse');var Redis=require(_0x1e78('0x10'));var authService=require(_0x1e78('0x11'));var qs=require(_0x1e78('0x12'));var as=require(_0x1e78('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e78('0x14'))(_0x1e78('0x15'));var utils=require(_0x1e78('0x16'));var config=require(_0x1e78('0x17'));var db=require(_0x1e78('0x18'))['db'];function respondWithStatusCode(_0x26d1e9,_0x5e9e5c){_0x5e9e5c=_0x5e9e5c||0xcc;return function(_0x40a219){if(_0x40a219){return _0x26d1e9[_0x1e78('0x19')](_0x5e9e5c);}return _0x26d1e9[_0x1e78('0x1a')](_0x5e9e5c)[_0x1e78('0x1b')]();};}function respondWithResult(_0x2bca54,_0xfa5825){_0xfa5825=_0xfa5825||0xc8;return function(_0x3d86bb){if(_0x3d86bb){return _0x2bca54[_0x1e78('0x1a')](_0xfa5825)[_0x1e78('0x1c')](_0x3d86bb);}};}function respondWithFilteredResult(_0x3fbbd5,_0x372b27){return function(_0x1fc060){if(_0x1fc060){var _0x7e91ab=_0x1fc060[_0x1e78('0x1d')],_0x225312=_0x372b27[_0x1e78('0x1e')],_0x51732f=_0x372b27[_0x1e78('0x1e')]+_0x372b27[_0x1e78('0x1f')],_0x5bdc47;if(_0x51732f>=_0x7e91ab){_0x51732f=_0x7e91ab;_0x5bdc47=0xc8;}else{_0x5bdc47=0xce;}_0x3fbbd5[_0x1e78('0x1a')](_0x5bdc47);return _0x3fbbd5[_0x1e78('0x20')]('Content-Range',_0x225312+'-'+_0x51732f+'/'+_0x7e91ab)[_0x1e78('0x1c')](_0x1fc060);}return null;};}function patchUpdates(_0x5da3f9){return function(_0xb80abf){try{jsonpatch[_0x1e78('0x21')](_0xb80abf,_0x5da3f9,!![]);}catch(_0x13f194){return BPromise[_0x1e78('0x22')](_0x13f194);}return _0xb80abf[_0x1e78('0x23')]();};}function saveUpdates(_0x3032fc,_0x321e5c){return function(_0x34bd90){if(_0x34bd90){return _0x34bd90[_0x1e78('0x24')](_0x3032fc)['then'](function(_0x29aab3){return _0x29aab3;});}return null;};}function removeEntity(_0x2a0d1e,_0x554774){return function(_0x387998){if(_0x387998){return _0x387998[_0x1e78('0x25')]()[_0x1e78('0x26')](function(){_0x2a0d1e[_0x1e78('0x1a')](0xcc)[_0x1e78('0x1b')]();});}};}function handleEntityNotFound(_0x409802,_0x1a1612){return function(_0x575cc2){if(!_0x575cc2){_0x409802[_0x1e78('0x19')](0x194);}return _0x575cc2;};}function handleError(_0x440268,_0x3a8da7){_0x3a8da7=_0x3a8da7||0x1f4;return function(_0x59e112){logger[_0x1e78('0x27')](_0x59e112[_0x1e78('0x28')]);if(_0x59e112[_0x1e78('0x29')]){delete _0x59e112[_0x1e78('0x29')];}_0x440268['status'](_0x3a8da7)['send'](_0x59e112);};}exports[_0x1e78('0x2a')]=function(_0x36daf1,_0x76ad19){var _0x53942c={},_0x122fc0={},_0xe28a64={'count':0x0,'rows':[]};var _0x18eb97=_[_0x1e78('0x2b')](db[_0x1e78('0x2c')][_0x1e78('0x2d')],function(_0x5d6b2b){return{'name':_0x5d6b2b[_0x1e78('0x2e')],'type':_0x5d6b2b['type'][_0x1e78('0x2f')]};});_0x122fc0[_0x1e78('0x30')]=_['map'](_0x18eb97,_0x1e78('0x29'));_0x122fc0[_0x1e78('0x31')]=_[_0x1e78('0x32')](_0x36daf1['query']);_0x122fc0[_0x1e78('0x33')]=_[_0x1e78('0x34')](_0x122fc0[_0x1e78('0x30')],_0x122fc0[_0x1e78('0x31')]);_0x53942c[_0x1e78('0x35')]=_[_0x1e78('0x34')](_0x122fc0[_0x1e78('0x30')],qs[_0x1e78('0x36')](_0x36daf1[_0x1e78('0x31')][_0x1e78('0x36')]));_0x53942c[_0x1e78('0x35')]=_0x53942c[_0x1e78('0x35')][_0x1e78('0x37')]?_0x53942c[_0x1e78('0x35')]:_0x122fc0['model'];if(!_0x36daf1[_0x1e78('0x31')][_0x1e78('0x38')](_0x1e78('0x39'))){_0x53942c[_0x1e78('0x1f')]=qs[_0x1e78('0x1f')](_0x36daf1[_0x1e78('0x31')]['limit']);_0x53942c[_0x1e78('0x1e')]=qs[_0x1e78('0x1e')](_0x36daf1[_0x1e78('0x31')][_0x1e78('0x1e')]);}_0x53942c['order']=qs[_0x1e78('0x3a')](_0x36daf1[_0x1e78('0x31')][_0x1e78('0x3a')]);_0x53942c['where']=qs[_0x1e78('0x33')](_['pick'](_0x36daf1[_0x1e78('0x31')],_0x122fc0['filters']));if(_0x36daf1[_0x1e78('0x31')]['filter']){_0x53942c[_0x1e78('0x3b')]=_['merge'](_0x53942c[_0x1e78('0x3b')],{'$or':_['map'](_0x18eb97,function(_0x3e4256){if(_0x3e4256[_0x1e78('0x3c')]!==_0x1e78('0x3d')){var _0x301ae7={};_0x301ae7[_0x3e4256[_0x1e78('0x29')]]={'$like':'%'+_0x36daf1[_0x1e78('0x31')][_0x1e78('0x3e')]+'%'};return _0x301ae7;}})});}_0x53942c=_['merge']({},_0x53942c,_0x36daf1[_0x1e78('0x3f')]);var _0x4dd4fe={'where':_0x53942c[_0x1e78('0x3b')]};return db['FaxTransferReport'][_0x1e78('0x1d')](_0x4dd4fe)[_0x1e78('0x26')](function(_0x5d1f16){_0xe28a64[_0x1e78('0x1d')]=_0x5d1f16;if(_0x36daf1[_0x1e78('0x31')][_0x1e78('0x40')]){_0x53942c['include']=[{'all':!![]}];}return db[_0x1e78('0x2c')][_0x1e78('0x41')](_0x53942c);})[_0x1e78('0x26')](function(_0x4b3eb8){_0xe28a64[_0x1e78('0x42')]=_0x4b3eb8;return _0xe28a64;})[_0x1e78('0x26')](respondWithFilteredResult(_0x76ad19,_0x53942c))[_0x1e78('0x43')](handleError(_0x76ad19,null));};exports[_0x1e78('0x44')]=function(_0x56cc80,_0x4fa1db){var _0x1a8087={'raw':!![],'where':{'id':_0x56cc80[_0x1e78('0x45')]['id']}},_0x31da7b={};_0x31da7b[_0x1e78('0x30')]=_[_0x1e78('0x32')](db[_0x1e78('0x2c')][_0x1e78('0x2d')]);_0x31da7b[_0x1e78('0x31')]=_[_0x1e78('0x32')](_0x56cc80[_0x1e78('0x31')]);_0x31da7b['filters']=_['intersection'](_0x31da7b[_0x1e78('0x30')],_0x31da7b['query']);_0x1a8087[_0x1e78('0x35')]=_['intersection'](_0x31da7b[_0x1e78('0x30')],qs[_0x1e78('0x36')](_0x56cc80['query']['fields']));_0x1a8087[_0x1e78('0x35')]=_0x1a8087[_0x1e78('0x35')][_0x1e78('0x37')]?_0x1a8087['attributes']:_0x31da7b[_0x1e78('0x30')];if(_0x56cc80[_0x1e78('0x31')][_0x1e78('0x40')]){_0x1a8087['include']=[{'all':!![]}];}_0x1a8087=_[_0x1e78('0x46')]({},_0x1a8087,_0x56cc80[_0x1e78('0x3f')]);return db['FaxTransferReport'][_0x1e78('0x47')](_0x1a8087)['then'](handleEntityNotFound(_0x4fa1db,null))['then'](respondWithResult(_0x4fa1db,null))[_0x1e78('0x43')](handleError(_0x4fa1db,null));};exports[_0x1e78('0x48')]=function(_0x41a241,_0x40a88f){return db['FaxTransferReport'][_0x1e78('0x48')](_0x41a241['body'],{})[_0x1e78('0x26')](respondWithResult(_0x40a88f,0xc9))['catch'](handleError(_0x40a88f,null));};exports[_0x1e78('0x24')]=function(_0x427af2,_0x4efaeb){if(_0x427af2[_0x1e78('0x49')]['id']){delete _0x427af2[_0x1e78('0x49')]['id'];}return db[_0x1e78('0x2c')][_0x1e78('0x47')]({'where':{'id':_0x427af2[_0x1e78('0x45')]['id']}})[_0x1e78('0x26')](handleEntityNotFound(_0x4efaeb,null))['then'](saveUpdates(_0x427af2[_0x1e78('0x49')],null))[_0x1e78('0x26')](respondWithResult(_0x4efaeb,null))[_0x1e78('0x43')](handleError(_0x4efaeb,null));};exports[_0x1e78('0x25')]=function(_0x51c1a8,_0x23034a){return db[_0x1e78('0x2c')][_0x1e78('0x47')]({'where':{'id':_0x51c1a8[_0x1e78('0x45')]['id']}})[_0x1e78('0x26')](handleEntityNotFound(_0x23034a,null))[_0x1e78('0x26')](removeEntity(_0x23034a,null))['catch'](handleError(_0x23034a,null));};exports[_0x1e78('0x4a')]=function(_0x5380f9,_0x34caf4){return db['FaxTransferReport'][_0x1e78('0x4a')]()[_0x1e78('0x26')](respondWithResult(_0x34caf4,null))['catch'](handleError(_0x34caf4,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 2392ad0..2356327 100644 --- a/server/api/faxTransferReport/faxTransferReport.model.js +++ b/server/api/faxTransferReport/faxTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e5=['bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7e5,0x105));var _0x5b7e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb7e5[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5b7e('0x0'))(_0x5b7e('0x1'));var moment=require(_0x5b7e('0x2'));var BPromise=require(_0x5b7e('0x3'));var rp=require(_0x5b7e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b7e('0x5'));var config=require(_0x5b7e('0x6'));var attributes=require(_0x5b7e('0x7'));module[_0x5b7e('0x8')]=function(_0x425cb2,_0x289b7f){return _0x425cb2[_0x5b7e('0x9')]('FaxTransferReport',attributes,{'tableName':_0x5b7e('0xa'),'paranoid':![],'indexes':[{'name':_0x5b7e('0xb'),'fields':[_0x5b7e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f8c=['rimraf','../../config/environment','./faxTransferReport.attributes','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1a697e,_0x130466){var _0x40e871=function(_0x552667){while(--_0x552667){_0x1a697e['push'](_0x1a697e['shift']());}};_0x40e871(++_0x130466);}(_0x2f8c,0x102));var _0xc2f8=function(_0x9caf02,_0xac6fe6){_0x9caf02=_0x9caf02-0x0;var _0x54f556=_0x2f8c[_0x9caf02];return _0x54f556;};'use strict';var _=require(_0xc2f8('0x0'));var util=require(_0xc2f8('0x1'));var logger=require(_0xc2f8('0x2'))(_0xc2f8('0x3'));var moment=require(_0xc2f8('0x4'));var BPromise=require(_0xc2f8('0x5'));var rp=require(_0xc2f8('0x6'));var fs=require('fs');var path=require(_0xc2f8('0x7'));var rimraf=require(_0xc2f8('0x8'));var config=require(_0xc2f8('0x9'));var attributes=require(_0xc2f8('0xa'));module['exports']=function(_0x141fba,_0x6ff0ed){return _0x141fba['define'](_0xc2f8('0xb'),attributes,{'tableName':_0xc2f8('0xc'),'paranoid':![],'indexes':[{'name':_0xc2f8('0xd'),'fields':[_0xc2f8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index dac5ef4..06255ae 100644 --- a/server/api/faxTransferReport/faxTransferReport.rpc.js +++ b/server/api/faxTransferReport/faxTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6251=['result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x541224,_0x512e8a){var _0x395585=function(_0x1140d0){while(--_0x1140d0){_0x541224['push'](_0x541224['shift']());}};_0x395585(++_0x512e8a);}(_0x6251,0x145));var _0x1625=function(_0x2238b1,_0x2cf83b){_0x2238b1=_0x2238b1-0x0;var _0x3bffa6=_0x6251[_0x2238b1];return _0x3bffa6;};'use strict';var _=require('lodash');var util=require(_0x1625('0x0'));var moment=require(_0x1625('0x1'));var BPromise=require(_0x1625('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1625('0x3'))['db'];var utils=require(_0x1625('0x4'));var logger=require('../../config/logger')(_0x1625('0x5'));var config=require(_0x1625('0x6'));var jayson=require(_0x1625('0x7'));var client=jayson['client'][_0x1625('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x563220,_0x2e0f6e,_0x58995d){return new BPromise(function(_0x54e8b7,_0x5a1140){return client['request'](_0x563220,_0x58995d)[_0x1625('0x9')](function(_0x264d45){logger[_0x1625('0xa')](_0x1625('0xb'),_0x2e0f6e,'request\x20sent');logger[_0x1625('0xc')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2e0f6e,_0x1625('0xd'),JSON['stringify'](_0x264d45));if(_0x264d45['error']){if(_0x264d45[_0x1625('0xe')][_0x1625('0xf')]===0x1f4){logger[_0x1625('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x2e0f6e,_0x264d45[_0x1625('0xe')][_0x1625('0x10')]);return _0x5a1140(_0x264d45[_0x1625('0xe')][_0x1625('0x10')]);}logger[_0x1625('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x2e0f6e,_0x264d45[_0x1625('0xe')][_0x1625('0x10')]);return _0x54e8b7(_0x264d45['error'][_0x1625('0x10')]);}else{logger['info'](_0x1625('0xb'),_0x2e0f6e,_0x1625('0xd'));_0x54e8b7(_0x264d45[_0x1625('0x11')][_0x1625('0x10')]);}})[_0x1625('0x12')](function(_0x1523ad){logger[_0x1625('0xe')](_0x1625('0xb'),_0x2e0f6e,_0x1523ad);_0x5a1140(_0x1523ad);});});} \ No newline at end of file +var _0x5d63=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5d63,0x14f));var _0x35d6=function(_0x4dce99,_0x4a360f){_0x4dce99=_0x4dce99-0x0;var _0x53a3e6=_0x5d63[_0x4dce99];return _0x53a3e6;};'use strict';var _=require(_0x35d6('0x0'));var util=require(_0x35d6('0x1'));var moment=require('moment');var BPromise=require(_0x35d6('0x2'));var rs=require(_0x35d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35d6('0x4'))['db'];var utils=require(_0x35d6('0x5'));var logger=require('../../config/logger')(_0x35d6('0x6'));var config=require(_0x35d6('0x7'));var jayson=require(_0x35d6('0x8'));var client=jayson[_0x35d6('0x9')][_0x35d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb3380d,_0x294580,_0x3b7759){return new BPromise(function(_0x19acbc,_0x103ed0){return client[_0x35d6('0xb')](_0xb3380d,_0x3b7759)[_0x35d6('0xc')](function(_0x3e64d4){logger['info'](_0x35d6('0xd'),_0x294580,_0x35d6('0xe'));logger[_0x35d6('0xf')](_0x35d6('0x10'),_0x294580,_0x35d6('0xe'),JSON[_0x35d6('0x11')](_0x3e64d4));if(_0x3e64d4[_0x35d6('0x12')]){if(_0x3e64d4['error'][_0x35d6('0x13')]===0x1f4){logger[_0x35d6('0x12')](_0x35d6('0xd'),_0x294580,_0x3e64d4['error'][_0x35d6('0x14')]);return _0x103ed0(_0x3e64d4[_0x35d6('0x12')][_0x35d6('0x14')]);}logger[_0x35d6('0x12')](_0x35d6('0xd'),_0x294580,_0x3e64d4['error'][_0x35d6('0x14')]);return _0x19acbc(_0x3e64d4[_0x35d6('0x12')]['message']);}else{logger[_0x35d6('0x15')](_0x35d6('0xd'),_0x294580,'request\x20sent');_0x19acbc(_0x3e64d4[_0x35d6('0x16')]['message']);}})[_0x35d6('0x17')](function(_0x451394){logger[_0x35d6('0x12')](_0x35d6('0xd'),_0x294580,_0x451394);_0x103ed0(_0x451394);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0deb762..394acab 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x939d=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x28e06e,_0x3eef51){var _0x4ad55c=function(_0x54ba53){while(--_0x54ba53){_0x28e06e['push'](_0x28e06e['shift']());}};_0x4ad55c(++_0x3eef51);}(_0x939d,0x15f));var _0xd939=function(_0x419b27,_0x21d9f6){_0x419b27=_0x419b27-0x0;var _0x5600a8=_0x939d[_0x419b27];return _0x5600a8;};'use strict';var multer=require(_0xd939('0x0'));var util=require(_0xd939('0x1'));var path=require(_0xd939('0x2'));var timeout=require(_0xd939('0x3'));var express=require(_0xd939('0x4'));var router=express['Router']();var auth=require(_0xd939('0x5'));var interaction=require(_0xd939('0x6'));var config=require(_0xd939('0x7'));var controller=require(_0xd939('0x8'));router[_0xd939('0x9')]('/',auth[_0xd939('0xa')](),controller[_0xd939('0xb')]);router['get'](_0xd939('0xc'),auth[_0xd939('0xa')](),controller[_0xd939('0xd')]);router['get'](_0xd939('0xe'),auth['isAuthenticated'](),controller[_0xd939('0xf')]);router[_0xd939('0x10')]('/',auth[_0xd939('0xa')](),controller[_0xd939('0x11')]);router[_0xd939('0x12')](_0xd939('0xe'),auth[_0xd939('0xa')](),controller[_0xd939('0x13')]);router[_0xd939('0x14')]('/:id',auth[_0xd939('0xa')](),controller[_0xd939('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf47a=['/:id','isAuthenticated','show','post','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','/describe','describe'];(function(_0x40105f,_0x5dddb3){var _0x4c94d6=function(_0x5ce857){while(--_0x5ce857){_0x40105f['push'](_0x40105f['shift']());}};_0x4c94d6(++_0x5dddb3);}(_0xf47a,0x13a));var _0xaf47=function(_0x106f94,_0x4d9e21){_0x106f94=_0x106f94-0x0;var _0x5444be=_0xf47a[_0x106f94];return _0x5444be;};'use strict';var multer=require(_0xaf47('0x0'));var util=require('util');var path=require(_0xaf47('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf47('0x2'));var router=express['Router']();var auth=require(_0xaf47('0x3'));var interaction=require(_0xaf47('0x4'));var config=require(_0xaf47('0x5'));var controller=require(_0xaf47('0x6'));router[_0xaf47('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaf47('0x7')](_0xaf47('0x8'),auth['isAuthenticated'](),controller[_0xaf47('0x9')]);router[_0xaf47('0x7')](_0xaf47('0xa'),auth[_0xaf47('0xb')](),controller[_0xaf47('0xc')]);router[_0xaf47('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xaf47('0xa'),auth[_0xaf47('0xb')](),controller[_0xaf47('0xe')]);router[_0xaf47('0xf')](_0xaf47('0xa'),auth[_0xaf47('0xb')](),controller[_0xaf47('0x10')]);module[_0xaf47('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 108f92b..0829652 100644 --- a/server/api/intDeskAccount/index.js +++ b/server/api/intDeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda19=['put','update','delete','destroy','util','path','express','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getFields','post','create','/:id/configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x23e84c,_0x4059cf){_0x23e84c=_0x23e84c-0x0;var _0xfa43f3=_0xda19[_0x23e84c];return _0xfa43f3;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var auth=require(_0x9da1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9da1('0x4'));var controller=require(_0x9da1('0x5'));router[_0x9da1('0x6')]('/',auth[_0x9da1('0x7')](),controller[_0x9da1('0x8')]);router[_0x9da1('0x6')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xa')]);router[_0x9da1('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x9da1('0x6')]('/:id/fields',auth[_0x9da1('0x7')](),controller[_0x9da1('0xb')]);router[_0x9da1('0xc')]('/',auth[_0x9da1('0x7')](),controller[_0x9da1('0xd')]);router[_0x9da1('0xc')](_0x9da1('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9da1('0xf')]('/:id',auth[_0x9da1('0x7')](),controller[_0x9da1('0x10')]);router[_0x9da1('0x11')](_0x9da1('0x9'),auth['isAuthenticated'](),controller[_0x9da1('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3937=['/:id','show','getConfigurations','/:id/fields','getFields','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index'];(function(_0x1efa83,_0x50fa0e){var _0xa47497=function(_0x10706e){while(--_0x10706e){_0x1efa83['push'](_0x1efa83['shift']());}};_0xa47497(++_0x50fa0e);}(_0x3937,0xbf));var _0x7393=function(_0xefe152,_0xde8149){_0xefe152=_0xefe152-0x0;var _0x1cb780=_0x3937[_0xefe152];return _0x1cb780;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7393('0x4'));var config=require('../../config/environment');var controller=require(_0x7393('0x5'));router[_0x7393('0x6')]('/',auth[_0x7393('0x7')](),controller[_0x7393('0x8')]);router[_0x7393('0x6')](_0x7393('0x9'),auth[_0x7393('0x7')](),controller[_0x7393('0xa')]);router[_0x7393('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7393('0xb')]);router[_0x7393('0x6')](_0x7393('0xc'),auth['isAuthenticated'](),controller[_0x7393('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7393('0xe'),auth[_0x7393('0x7')](),controller[_0x7393('0xf')]);router['put'](_0x7393('0x9'),auth[_0x7393('0x7')](),controller[_0x7393('0x10')]);router[_0x7393('0x11')](_0x7393('0x9'),auth[_0x7393('0x7')](),controller[_0x7393('0x12')]);module[_0x7393('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 7209be7..17f04c9 100644 --- a/server/api/intDeskAccount/intDeskAccount.attributes.js +++ b/server/api/intDeskAccount/intDeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1cf=['basic','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb1cf,0x97));var _0xfb1c=function(_0x401c88,_0x5c9ef9){_0x401c88=_0x401c88-0x0;var _0x3126a0=_0xb1cf[_0x401c88];return _0x3126a0;};'use strict';var Sequelize=require(_0xfb1c('0x0'));module[_0xfb1c('0x1')]={'name':{'type':Sequelize[_0xfb1c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfb1c('0x2')]},'remoteUri':{'type':Sequelize[_0xfb1c('0x2')]},'authType':{'type':Sequelize['ENUM'](_0xfb1c('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xfb1c('0x2')]},'consumerKey':{'type':Sequelize[_0xfb1c('0x2')]},'consumerSecret':{'type':Sequelize[_0xfb1c('0x2')]},'token':{'type':Sequelize[_0xfb1c('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xfb1c('0x2')]},'type':{'type':Sequelize[_0xfb1c('0x4')](_0xfb1c('0x5'),_0xfb1c('0x6')),'defaultValue':_0xfb1c('0x5')}}; \ No newline at end of file +var _0xe8c0=['newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0xc3df6d,_0x3631a1){var _0x107cee=function(_0x2cf234){while(--_0x2cf234){_0xc3df6d['push'](_0xc3df6d['shift']());}};_0x107cee(++_0x3631a1);}(_0xe8c0,0x1e7));var _0x0e8c=function(_0x1a919c,_0x3f3919){_0x1a919c=_0x1a919c-0x0;var _0x2b1c00=_0xe8c0[_0x1a919c];return _0x2b1c00;};'use strict';var Sequelize=require(_0x0e8c('0x0'));module[_0x0e8c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0e8c('0x2')]},'remoteUri':{'type':Sequelize[_0x0e8c('0x2')]},'authType':{'type':Sequelize[_0x0e8c('0x3')](_0x0e8c('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x0e8c('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x0e8c('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x0e8c('0x2')]},'serverUrl':{'type':Sequelize[_0x0e8c('0x2')]},'type':{'type':Sequelize[_0x0e8c('0x3')]('integrationTab',_0x0e8c('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 4bb8426..d489fc1 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2541=['fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filters','where','merge','filter','options','includeAll','include','show','params','rawAttributes','find','create','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','password','toString','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','json','count','offset','set','apply','reject','save','update','destroy','name','send','index','map','DeskAccount','fieldName','type','model','query','keys','intersection'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2541,0xbe));var _0x1254=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2541[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x1254('0x0'));var emlformat=require(_0x1254('0x1'));var rimraf=require(_0x1254('0x2'));var zipdir=require(_0x1254('0x3'));var jsonpatch=require(_0x1254('0x4'));var rp=require(_0x1254('0x5'));var moment=require(_0x1254('0x6'));var BPromise=require(_0x1254('0x7'));var Mustache=require(_0x1254('0x8'));var util=require(_0x1254('0x9'));var path=require(_0x1254('0xa'));var sox=require('sox');var csv=require(_0x1254('0xb'));var ejs=require(_0x1254('0xc'));var fs=require('fs');var _=require(_0x1254('0xd'));var squel=require('squel');var crypto=require(_0x1254('0xe'));var jsforce=require(_0x1254('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1254('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1254('0x11'));var hardwareService=require(_0x1254('0x12'));var logger=require(_0x1254('0x13'))(_0x1254('0x14'));var utils=require('../../config/utils');var config=require(_0x1254('0x15'));var db=require(_0x1254('0x16'))['db'];var integrations=require(_0x1254('0x17'));var jayson=require(_0x1254('0x18'));var client=jayson['client'][_0x1254('0x19')]({'port':0x232a});function checkPasswordPattern(_0x232676,_0x229717,_0x3a7337){if(_0x3a7337){var _0x2c97f6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c97f6['test'](_0x229717)){return _0x232676;}else{throw new db[(_0x1254('0x1a'))][(_0x1254('0x1b'))](_0x1254('0x1c'));}}else{return _0x232676;}}function respondWithRpcPromise(_0x43d8ac,_0x2b94ab,_0x43654b,_0x22b7d7){return new BPromise(function(_0x3e75b1,_0x340c93){var _0x3f90f9=_0x22b7d7||client;return _0x3f90f9[_0x1254('0x1d')](_0x43d8ac,_0x43654b)[_0x1254('0x1e')](function(_0x14e4e7){logger['info'](_0x1254('0x1f'),_0x2b94ab,'request\x20sent');logger['debug'](_0x1254('0x20'),_0x2b94ab,_0x1254('0x21'),JSON['stringify'](_0x14e4e7));if(_0x14e4e7['error']){if(_0x14e4e7[_0x1254('0x22')][_0x1254('0x23')]===0x1f4){logger[_0x1254('0x22')](_0x1254('0x1f'),_0x2b94ab,_0x14e4e7[_0x1254('0x22')][_0x1254('0x24')]);return _0x340c93(_0x14e4e7[_0x1254('0x22')][_0x1254('0x24')]);}logger[_0x1254('0x22')](_0x1254('0x1f'),_0x2b94ab,_0x14e4e7[_0x1254('0x22')][_0x1254('0x24')]);return _0x3e75b1(_0x14e4e7[_0x1254('0x22')][_0x1254('0x24')]);}else{logger[_0x1254('0x25')]('DeskAccount,\x20%s,\x20%s',_0x2b94ab,_0x1254('0x21'));_0x3e75b1(_0x14e4e7[_0x1254('0x26')][_0x1254('0x24')]);}})[_0x1254('0x27')](function(_0xbbdd0b){logger['error'](_0x1254('0x1f'),_0x2b94ab,_0xbbdd0b);_0x340c93(_0xbbdd0b);});});}function respondWithStatusCode(_0x515542,_0x264fa7){_0x264fa7=_0x264fa7||0xcc;return function(_0x5e7df3){if(_0x5e7df3){return _0x515542[_0x1254('0x28')](_0x264fa7);}return _0x515542[_0x1254('0x29')](_0x264fa7)['end']();};}function respondWithResult(_0x11fbbc,_0x43e7c8){_0x43e7c8=_0x43e7c8||0xc8;return function(_0x5bd06d){if(_0x5bd06d){return _0x11fbbc[_0x1254('0x29')](_0x43e7c8)[_0x1254('0x2a')](_0x5bd06d);}};}function respondWithFilteredResult(_0x74d5ab,_0x19d3ea){return function(_0xc94527){if(_0xc94527){var _0x1499de=_0xc94527[_0x1254('0x2b')],_0xd3c4c3=_0x19d3ea[_0x1254('0x2c')],_0x5f22ca=_0x19d3ea[_0x1254('0x2c')]+_0x19d3ea['limit'],_0x17122f;if(_0x5f22ca>=_0x1499de){_0x5f22ca=_0x1499de;_0x17122f=0xc8;}else{_0x17122f=0xce;}_0x74d5ab['status'](_0x17122f);return _0x74d5ab[_0x1254('0x2d')]('Content-Range',_0xd3c4c3+'-'+_0x5f22ca+'/'+_0x1499de)[_0x1254('0x2a')](_0xc94527);}return null;};}function patchUpdates(_0x1b0971){return function(_0x1202df){try{jsonpatch[_0x1254('0x2e')](_0x1202df,_0x1b0971,!![]);}catch(_0x499fc6){return BPromise[_0x1254('0x2f')](_0x499fc6);}return _0x1202df[_0x1254('0x30')]();};}function saveUpdates(_0x3cf4d4,_0x2eb2d0){return function(_0x502aa2){if(_0x502aa2){return _0x502aa2[_0x1254('0x31')](_0x3cf4d4)['then'](function(_0x15eca8){return _0x15eca8;});}return null;};}function removeEntity(_0xdcbc45,_0x3ef963){return function(_0x429d89){if(_0x429d89){return _0x429d89[_0x1254('0x32')]()['then'](function(){_0xdcbc45[_0x1254('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5a1a,_0xc4abd1){return function(_0x12b75c){if(!_0x12b75c){_0x2d5a1a[_0x1254('0x28')](0x194);}return _0x12b75c;};}function handleError(_0x114037,_0x4fded2){_0x4fded2=_0x4fded2||0x1f4;return function(_0x172a96){logger[_0x1254('0x22')](_0x172a96['stack']);if(_0x172a96['name']){delete _0x172a96[_0x1254('0x33')];}_0x114037[_0x1254('0x29')](_0x4fded2)[_0x1254('0x34')](_0x172a96);};}exports[_0x1254('0x35')]=function(_0x38b560,_0x3acc4f){var _0x4b9da9={},_0x1d1fd8={},_0xcefc02={'count':0x0,'rows':[]};var _0x5f2a78=_[_0x1254('0x36')](db[_0x1254('0x37')]['rawAttributes'],function(_0x117ff9){return{'name':_0x117ff9[_0x1254('0x38')],'type':_0x117ff9[_0x1254('0x39')]['key']};});_0x1d1fd8[_0x1254('0x3a')]=_['map'](_0x5f2a78,_0x1254('0x33'));_0x1d1fd8[_0x1254('0x3b')]=_[_0x1254('0x3c')](_0x38b560['query']);_0x1d1fd8['filters']=_[_0x1254('0x3d')](_0x1d1fd8[_0x1254('0x3a')],_0x1d1fd8[_0x1254('0x3b')]);_0x4b9da9['attributes']=_[_0x1254('0x3d')](_0x1d1fd8[_0x1254('0x3a')],qs[_0x1254('0x3e')](_0x38b560[_0x1254('0x3b')]['fields']));_0x4b9da9['attributes']=_0x4b9da9[_0x1254('0x3f')][_0x1254('0x40')]?_0x4b9da9[_0x1254('0x3f')]:_0x1d1fd8[_0x1254('0x3a')];if(!_0x38b560['query'][_0x1254('0x41')](_0x1254('0x42'))){_0x4b9da9[_0x1254('0x43')]=qs[_0x1254('0x43')](_0x38b560[_0x1254('0x3b')][_0x1254('0x43')]);_0x4b9da9['offset']=qs[_0x1254('0x2c')](_0x38b560[_0x1254('0x3b')][_0x1254('0x2c')]);}_0x4b9da9['order']=qs[_0x1254('0x44')](_0x38b560[_0x1254('0x3b')]['sort']);_0x4b9da9['where']=qs['filters'](_[_0x1254('0x45')](_0x38b560[_0x1254('0x3b')],_0x1d1fd8[_0x1254('0x46')]));if(_0x38b560[_0x1254('0x3b')]['filter']){_0x4b9da9[_0x1254('0x47')]=_[_0x1254('0x48')](_0x4b9da9[_0x1254('0x47')],{'$or':_[_0x1254('0x36')](_0x5f2a78,function(_0x585052){if(_0x585052[_0x1254('0x39')]!=='VIRTUAL'){var _0x292141={};_0x292141[_0x585052[_0x1254('0x33')]]={'$like':'%'+_0x38b560[_0x1254('0x3b')][_0x1254('0x49')]+'%'};return _0x292141;}})});}_0x4b9da9=_[_0x1254('0x48')]({},_0x4b9da9,_0x38b560[_0x1254('0x4a')]);var _0x1c59a9={'where':_0x4b9da9[_0x1254('0x47')]};return db[_0x1254('0x37')][_0x1254('0x2b')](_0x1c59a9)[_0x1254('0x1e')](function(_0x1b1368){_0xcefc02[_0x1254('0x2b')]=_0x1b1368;if(_0x38b560['query'][_0x1254('0x4b')]){_0x4b9da9[_0x1254('0x4c')]=[{'all':!![]}];}return db[_0x1254('0x37')]['findAll'](_0x4b9da9);})[_0x1254('0x1e')](function(_0x48a2a2){_0xcefc02['rows']=_0x48a2a2;return _0xcefc02;})[_0x1254('0x1e')](respondWithFilteredResult(_0x3acc4f,_0x4b9da9))[_0x1254('0x27')](handleError(_0x3acc4f,null));};exports[_0x1254('0x4d')]=function(_0x533980,_0x53e3a2){var _0x1daca6={'raw':![],'where':{'id':_0x533980[_0x1254('0x4e')]['id']}},_0x4cfbb4={};_0x4cfbb4[_0x1254('0x3a')]=_[_0x1254('0x3c')](db[_0x1254('0x37')][_0x1254('0x4f')]);_0x4cfbb4[_0x1254('0x3b')]=_['keys'](_0x533980['query']);_0x4cfbb4[_0x1254('0x46')]=_[_0x1254('0x3d')](_0x4cfbb4[_0x1254('0x3a')],_0x4cfbb4[_0x1254('0x3b')]);_0x1daca6[_0x1254('0x3f')]=_[_0x1254('0x3d')](_0x4cfbb4[_0x1254('0x3a')],qs[_0x1254('0x3e')](_0x533980[_0x1254('0x3b')][_0x1254('0x3e')]));_0x1daca6[_0x1254('0x3f')]=_0x1daca6[_0x1254('0x3f')][_0x1254('0x40')]?_0x1daca6[_0x1254('0x3f')]:_0x4cfbb4[_0x1254('0x3a')];if(_0x533980['query']['includeAll']){_0x1daca6[_0x1254('0x4c')]=[{'all':!![]}];}_0x1daca6=_[_0x1254('0x48')]({},_0x1daca6,_0x533980[_0x1254('0x4a')]);return db[_0x1254('0x37')][_0x1254('0x50')](_0x1daca6)[_0x1254('0x1e')](handleEntityNotFound(_0x53e3a2,null))[_0x1254('0x1e')](respondWithResult(_0x53e3a2,null))[_0x1254('0x27')](handleError(_0x53e3a2,null));};exports[_0x1254('0x51')]=function(_0x277e46,_0x3b3452){return db[_0x1254('0x37')][_0x1254('0x51')](_0x277e46[_0x1254('0x52')],{})['then'](respondWithResult(_0x3b3452,0xc9))['catch'](handleError(_0x3b3452,null));};exports[_0x1254('0x31')]=function(_0x29a350,_0xc2fddf){if(_0x29a350[_0x1254('0x52')]['id']){delete _0x29a350[_0x1254('0x52')]['id'];}return db[_0x1254('0x37')][_0x1254('0x50')]({'where':{'id':_0x29a350[_0x1254('0x4e')]['id']}})[_0x1254('0x1e')](handleEntityNotFound(_0xc2fddf,null))[_0x1254('0x1e')](saveUpdates(_0x29a350[_0x1254('0x52')],null))[_0x1254('0x1e')](respondWithResult(_0xc2fddf,null))[_0x1254('0x27')](handleError(_0xc2fddf,null));};exports[_0x1254('0x32')]=function(_0x32e2b4,_0x1b8f27){return db[_0x1254('0x37')][_0x1254('0x50')]({'where':{'id':_0x32e2b4[_0x1254('0x4e')]['id']}})[_0x1254('0x1e')](handleEntityNotFound(_0x1b8f27,null))['then'](removeEntity(_0x1b8f27,null))[_0x1254('0x27')](handleError(_0x1b8f27,null));};exports['getConfigurations']=function(_0xaa9771,_0x48b902,_0x13c77d){var _0xdbd710={};var _0x18246f={};var _0x5158a0;var _0x4d1745;return db[_0x1254('0x37')][_0x1254('0x53')]({'where':{'id':_0xaa9771[_0x1254('0x4e')]['id']}})[_0x1254('0x1e')](handleEntityNotFound(_0x48b902,null))[_0x1254('0x1e')](function(_0x199331){if(_0x199331){_0x5158a0=_0x199331;_0x18246f['model']=_[_0x1254('0x3c')](db[_0x1254('0x54')]['rawAttributes']);_0x18246f['query']=_['keys'](_0xaa9771['query']);_0x18246f[_0x1254('0x46')]=_['intersection'](_0x18246f[_0x1254('0x3a')],_0x18246f[_0x1254('0x3b')]);_0xdbd710[_0x1254('0x3f')]=_[_0x1254('0x3d')](_0x18246f[_0x1254('0x3a')],qs[_0x1254('0x3e')](_0xaa9771[_0x1254('0x3b')]['fields']));_0xdbd710['attributes']=_0xdbd710[_0x1254('0x3f')][_0x1254('0x40')]?_0xdbd710['attributes']:_0x18246f[_0x1254('0x3a')];_0xdbd710['order']=qs['sort'](_0xaa9771[_0x1254('0x3b')][_0x1254('0x44')]);_0xdbd710[_0x1254('0x47')]=qs[_0x1254('0x46')](_[_0x1254('0x45')](_0xaa9771[_0x1254('0x3b')],_0x18246f[_0x1254('0x46')]));if(_0xaa9771[_0x1254('0x3b')][_0x1254('0x49')]){_0xdbd710[_0x1254('0x47')]=_[_0x1254('0x48')](_0xdbd710[_0x1254('0x47')],{'$or':_[_0x1254('0x36')](_0xdbd710['attributes'],function(_0x52ba18){var _0x909276={};_0x909276[_0x52ba18]={'$like':'%'+_0xaa9771[_0x1254('0x3b')][_0x1254('0x49')]+'%'};return _0x909276;})});}_0xdbd710=_[_0x1254('0x48')]({},_0xdbd710,_0xaa9771[_0x1254('0x4a')]);return _0x5158a0['getConfigurations'](_0xdbd710);}})['then'](function(_0x5c8853){if(_0x5c8853){_0x4d1745=_0x5c8853['length'];if(!_0xaa9771[_0x1254('0x3b')]['hasOwnProperty']('nolimit')){_0xdbd710[_0x1254('0x43')]=qs[_0x1254('0x43')](_0xaa9771[_0x1254('0x3b')]['limit']);_0xdbd710['offset']=qs['offset'](_0xaa9771[_0x1254('0x3b')][_0x1254('0x2c')]);}return _0x5158a0[_0x1254('0x55')](_0xdbd710);}})[_0x1254('0x1e')](function(_0x319080){if(_0x319080){return _0x319080?{'count':_0x4d1745,'rows':_0x319080}:null;}})['then'](respondWithResult(_0x48b902,null))[_0x1254('0x27')](handleError(_0x48b902,null));};exports[_0x1254('0x56')]=function(_0x4c6c7c,_0x7f087f,_0x14bd27){if(_0x4c6c7c[_0x1254('0x52')]['id']){delete _0x4c6c7c['body']['id'];}return db[_0x1254('0x37')]['findOne']({'where':{'id':_0x4c6c7c[_0x1254('0x4e')]['id']}})['then'](handleEntityNotFound(_0x7f087f,null))[_0x1254('0x1e')](function(_0x1e47d1){if(_0x1e47d1){_0x4c6c7c['body'][_0x1254('0x57')]=_0x1e47d1['id'];_0x4c6c7c[_0x1254('0x52')][_0x1254('0x58')]=integrations[_0x1254('0x59')](_0x4c6c7c['body'][_0x1254('0x5a')],_0x4c6c7c[_0x1254('0x52')][_0x1254('0x39')]);_0x4c6c7c['body'][_0x1254('0x5b')]=integrations[_0x1254('0x5c')](_0x4c6c7c['body']['channel'],_0x4c6c7c[_0x1254('0x52')][_0x1254('0x39')]);return db[_0x1254('0x54')][_0x1254('0x51')](_0x4c6c7c[_0x1254('0x52')],{'include':[{'model':db[_0x1254('0x5d')],'as':_0x1254('0x58')},{'model':db['DeskField'],'as':_0x1254('0x5b')}]});}return null;})[_0x1254('0x1e')](respondWithResult(_0x7f087f,null))[_0x1254('0x27')](handleError(_0x7f087f,null));};exports[_0x1254('0x5e')]=function(_0x1443bd,_0x525a65,_0x3ae232){var _0x4d3f97=[{'name':_0x1254('0x5f'),'label':_0x1254('0x5f'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x253691='';return db[_0x1254('0x37')][_0x1254('0x53')]({'where':{'id':_0x1443bd[_0x1254('0x4e')]['id']},'attributes':['id',_0x1254('0x60'),_0x1254('0x61'),_0x1254('0x62'),'password',_0x1254('0x63'),'consumerSecret',_0x1254('0x64'),_0x1254('0x65')]})[_0x1254('0x1e')](handleEntityNotFound(_0x525a65,null))['then'](function(_0x10f9d9){if(_0x10f9d9){_0x253691=_0x10f9d9['remoteUri'];var _0x5d0f8e=_0x253691[_0x1254('0x66')](-0x1);if(_0x5d0f8e==='/'){_0x253691=_0x253691[_0x1254('0x67')](0x0,_0x253691[_0x1254('0x68')](_0x5d0f8e));}var _0x55e63c={'method':_0x1254('0x69'),'uri':util[_0x1254('0x6a')](_0x1254('0x6b'),_0x253691),'headers':{'Content-Type':_0x1254('0x6c'),'Accept':_0x1254('0x6c')},'json':!![]};if(_0x10f9d9['authType']===_0x1254('0x6d')){_0x55e63c[_0x1254('0x6e')][_0x1254('0x6f')]=util[_0x1254('0x6a')](_0x1254('0x70'),new Buffer(util['format'](_0x1254('0x71'),_0x10f9d9[_0x1254('0x62')],_0x10f9d9[_0x1254('0x72')]))[_0x1254('0x73')]('base64'));}return rp(_0x55e63c)[_0x1254('0x1e')](function(_0x15afe7){return _0x4d3f97[_0x1254('0x74')](_[_0x1254('0x36')](_0x15afe7[_0x1254('0x75')][_0x1254('0x76')],function(_0x3d0801){return{'id':_0x3d0801[_0x1254('0x33')],'name':_0x3d0801[_0x1254('0x33')],'type':_0x3d0801[_0x1254('0x39')],'active':_0x3d0801[_0x1254('0x77')],'label':_0x3d0801[_0x1254('0x78')],'custom':!![]};}));});}})[_0x1254('0x1e')](function(_0x2e6bf2){return{'count':_0x2e6bf2[_0x1254('0x40')],'rows':_0x2e6bf2};})[_0x1254('0x1e')](respondWithResult(_0x525a65,null))[_0x1254('0x27')](function(_0x341719){var _0x4bfa57=_0x1443bd[_0x1254('0x3b')][_0x1254('0x79')]?0x1f4:_0x341719['statusCode']||0x1f4;logger[_0x1254('0x22')](_0x1254('0x7a'),'getFields',_0x4bfa57,JSON[_0x1254('0x7b')](_0x341719));delete _0x341719[_0x1254('0x33')];if(_0x4bfa57===0x191){_0x4bfa57=0x190;}_0x525a65[_0x1254('0x29')](_0x4bfa57)[_0x1254('0x34')](_0x1443bd['query'][_0x1254('0x79')]?{'message':_0x1254('0x7c'),'statusCode':_0x341719[_0x1254('0x7d')]}:_0x341719);});}; \ No newline at end of file +var _0x22ed=['pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','find','body','params','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','tokenSecret','slice','substring','lastIndexOf','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','password','concat','_embedded','entries','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','status','json','offset','limit','set','Content-Range','save','update','then','destroy','stack','name','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters'];(function(_0x30073c,_0x46cf01){var _0x432d80=function(_0x44fc46){while(--_0x44fc46){_0x30073c['push'](_0x30073c['shift']());}};_0x432d80(++_0x46cf01);}(_0x22ed,0x1a9));var _0xd22e=function(_0x3e4a65,_0x12e6b0){_0x3e4a65=_0x3e4a65-0x0;var _0x19950d=_0x22ed[_0x3e4a65];return _0x19950d;};'use strict';var pdf=require(_0xd22e('0x0'));var emlformat=require(_0xd22e('0x1'));var rimraf=require(_0xd22e('0x2'));var zipdir=require(_0xd22e('0x3'));var jsonpatch=require(_0xd22e('0x4'));var rp=require(_0xd22e('0x5'));var moment=require(_0xd22e('0x6'));var BPromise=require(_0xd22e('0x7'));var Mustache=require(_0xd22e('0x8'));var util=require(_0xd22e('0x9'));var path=require(_0xd22e('0xa'));var sox=require(_0xd22e('0xb'));var csv=require('to-csv');var ejs=require(_0xd22e('0xc'));var fs=require('fs');var _=require(_0xd22e('0xd'));var squel=require('squel');var crypto=require(_0xd22e('0xe'));var jsforce=require(_0xd22e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd22e('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd22e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd22e('0x12'));var logger=require(_0xd22e('0x13'))(_0xd22e('0x14'));var utils=require(_0xd22e('0x15'));var config=require('../../config/environment');var db=require(_0xd22e('0x16'))['db'];var integrations=require(_0xd22e('0x17'));var jayson=require(_0xd22e('0x18'));var client=jayson[_0xd22e('0x19')][_0xd22e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x12c5f2,_0x5d36cb,_0x1ad142){if(_0x1ad142){var _0x441502=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x441502[_0xd22e('0x1b')](_0x5d36cb)){return _0x12c5f2;}else{throw new db['Sequelize'][(_0xd22e('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x12c5f2;}}function respondWithRpcPromise(_0x3525b5,_0x3610b1,_0x3aceba,_0xe4ad1b){return new BPromise(function(_0x724e3,_0x441ed7){var _0x3cbd14=_0xe4ad1b||client;return _0x3cbd14[_0xd22e('0x1d')](_0x3525b5,_0x3aceba)['then'](function(_0x106570){logger[_0xd22e('0x1e')](_0xd22e('0x1f'),_0x3610b1,_0xd22e('0x20'));logger[_0xd22e('0x21')](_0xd22e('0x22'),_0x3610b1,'request\x20sent',JSON[_0xd22e('0x23')](_0x106570));if(_0x106570['error']){if(_0x106570[_0xd22e('0x24')]['code']===0x1f4){logger['error'](_0xd22e('0x1f'),_0x3610b1,_0x106570['error']['message']);return _0x441ed7(_0x106570[_0xd22e('0x24')][_0xd22e('0x25')]);}logger[_0xd22e('0x24')](_0xd22e('0x1f'),_0x3610b1,_0x106570['error'][_0xd22e('0x25')]);return _0x724e3(_0x106570[_0xd22e('0x24')][_0xd22e('0x25')]);}else{logger['info'](_0xd22e('0x1f'),_0x3610b1,_0xd22e('0x20'));_0x724e3(_0x106570[_0xd22e('0x26')][_0xd22e('0x25')]);}})['catch'](function(_0x54058a){logger[_0xd22e('0x24')](_0xd22e('0x1f'),_0x3610b1,_0x54058a);_0x441ed7(_0x54058a);});});}function respondWithStatusCode(_0x5ba269,_0xddb0d1){_0xddb0d1=_0xddb0d1||0xcc;return function(_0x3e5e38){if(_0x3e5e38){return _0x5ba269[_0xd22e('0x27')](_0xddb0d1);}return _0x5ba269['status'](_0xddb0d1)[_0xd22e('0x28')]();};}function respondWithResult(_0x1346d2,_0x6f382){_0x6f382=_0x6f382||0xc8;return function(_0x24a2a4){if(_0x24a2a4){return _0x1346d2[_0xd22e('0x29')](_0x6f382)[_0xd22e('0x2a')](_0x24a2a4);}};}function respondWithFilteredResult(_0x1ea198,_0x4b9424){return function(_0x59bc61){if(_0x59bc61){var _0x389f00=_0x59bc61['count'],_0x318b28=_0x4b9424['offset'],_0x3be9cc=_0x4b9424[_0xd22e('0x2b')]+_0x4b9424[_0xd22e('0x2c')],_0x4532af;if(_0x3be9cc>=_0x389f00){_0x3be9cc=_0x389f00;_0x4532af=0xc8;}else{_0x4532af=0xce;}_0x1ea198[_0xd22e('0x29')](_0x4532af);return _0x1ea198[_0xd22e('0x2d')](_0xd22e('0x2e'),_0x318b28+'-'+_0x3be9cc+'/'+_0x389f00)[_0xd22e('0x2a')](_0x59bc61);}return null;};}function patchUpdates(_0x4b6fea){return function(_0x44b45b){try{jsonpatch['apply'](_0x44b45b,_0x4b6fea,!![]);}catch(_0x4f75ec){return BPromise['reject'](_0x4f75ec);}return _0x44b45b[_0xd22e('0x2f')]();};}function saveUpdates(_0xa1058e,_0x3c87fd){return function(_0x267c6f){if(_0x267c6f){return _0x267c6f[_0xd22e('0x30')](_0xa1058e)[_0xd22e('0x31')](function(_0x5ec02f){return _0x5ec02f;});}return null;};}function removeEntity(_0x5274c3,_0x1e6aa4){return function(_0x394215){if(_0x394215){return _0x394215[_0xd22e('0x32')]()[_0xd22e('0x31')](function(){_0x5274c3[_0xd22e('0x29')](0xcc)[_0xd22e('0x28')]();});}};}function handleEntityNotFound(_0xba0d6f,_0x258ede){return function(_0x588927){if(!_0x588927){_0xba0d6f[_0xd22e('0x27')](0x194);}return _0x588927;};}function handleError(_0x5de5d7,_0x24c07a){_0x24c07a=_0x24c07a||0x1f4;return function(_0x126382){logger[_0xd22e('0x24')](_0x126382[_0xd22e('0x33')]);if(_0x126382[_0xd22e('0x34')]){delete _0x126382[_0xd22e('0x34')];}_0x5de5d7[_0xd22e('0x29')](_0x24c07a)['send'](_0x126382);};}exports['index']=function(_0x3a5f19,_0x20c36c){var _0x27a11a={},_0x13057d={},_0x3c6cb9={'count':0x0,'rows':[]};var _0x3160a1=_[_0xd22e('0x35')](db[_0xd22e('0x36')][_0xd22e('0x37')],function(_0xb6889f){return{'name':_0xb6889f[_0xd22e('0x38')],'type':_0xb6889f[_0xd22e('0x39')][_0xd22e('0x3a')]};});_0x13057d[_0xd22e('0x3b')]=_[_0xd22e('0x35')](_0x3160a1,_0xd22e('0x34'));_0x13057d[_0xd22e('0x3c')]=_[_0xd22e('0x3d')](_0x3a5f19[_0xd22e('0x3c')]);_0x13057d['filters']=_[_0xd22e('0x3e')](_0x13057d[_0xd22e('0x3b')],_0x13057d['query']);_0x27a11a[_0xd22e('0x3f')]=_[_0xd22e('0x3e')](_0x13057d[_0xd22e('0x3b')],qs['fields'](_0x3a5f19[_0xd22e('0x3c')][_0xd22e('0x40')]));_0x27a11a[_0xd22e('0x3f')]=_0x27a11a[_0xd22e('0x3f')][_0xd22e('0x41')]?_0x27a11a[_0xd22e('0x3f')]:_0x13057d[_0xd22e('0x3b')];if(!_0x3a5f19[_0xd22e('0x3c')]['hasOwnProperty'](_0xd22e('0x42'))){_0x27a11a[_0xd22e('0x2c')]=qs[_0xd22e('0x2c')](_0x3a5f19[_0xd22e('0x3c')][_0xd22e('0x2c')]);_0x27a11a[_0xd22e('0x2b')]=qs[_0xd22e('0x2b')](_0x3a5f19[_0xd22e('0x3c')][_0xd22e('0x2b')]);}_0x27a11a[_0xd22e('0x43')]=qs[_0xd22e('0x44')](_0x3a5f19[_0xd22e('0x3c')][_0xd22e('0x44')]);_0x27a11a[_0xd22e('0x45')]=qs[_0xd22e('0x46')](_[_0xd22e('0x47')](_0x3a5f19[_0xd22e('0x3c')],_0x13057d[_0xd22e('0x46')]));if(_0x3a5f19[_0xd22e('0x3c')][_0xd22e('0x48')]){_0x27a11a[_0xd22e('0x45')]=_[_0xd22e('0x49')](_0x27a11a[_0xd22e('0x45')],{'$or':_['map'](_0x3160a1,function(_0x4efd42){if(_0x4efd42[_0xd22e('0x39')]!==_0xd22e('0x4a')){var _0x2bfc9b={};_0x2bfc9b[_0x4efd42[_0xd22e('0x34')]]={'$like':'%'+_0x3a5f19['query'][_0xd22e('0x48')]+'%'};return _0x2bfc9b;}})});}_0x27a11a=_[_0xd22e('0x49')]({},_0x27a11a,_0x3a5f19[_0xd22e('0x4b')]);var _0x35ef1a={'where':_0x27a11a[_0xd22e('0x45')]};return db[_0xd22e('0x36')]['count'](_0x35ef1a)[_0xd22e('0x31')](function(_0x1ad2c2){_0x3c6cb9[_0xd22e('0x4c')]=_0x1ad2c2;if(_0x3a5f19[_0xd22e('0x3c')][_0xd22e('0x4d')]){_0x27a11a[_0xd22e('0x4e')]=[{'all':!![]}];}return db[_0xd22e('0x36')]['findAll'](_0x27a11a);})[_0xd22e('0x31')](function(_0x5b9659){_0x3c6cb9[_0xd22e('0x4f')]=_0x5b9659;return _0x3c6cb9;})[_0xd22e('0x31')](respondWithFilteredResult(_0x20c36c,_0x27a11a))[_0xd22e('0x50')](handleError(_0x20c36c,null));};exports[_0xd22e('0x51')]=function(_0x541416,_0x3d6f08){var _0x4b4c24={'raw':![],'where':{'id':_0x541416['params']['id']}},_0x10bdcb={};_0x10bdcb['model']=_[_0xd22e('0x3d')](db[_0xd22e('0x36')][_0xd22e('0x37')]);_0x10bdcb[_0xd22e('0x3c')]=_['keys'](_0x541416[_0xd22e('0x3c')]);_0x10bdcb[_0xd22e('0x46')]=_[_0xd22e('0x3e')](_0x10bdcb[_0xd22e('0x3b')],_0x10bdcb['query']);_0x4b4c24[_0xd22e('0x3f')]=_[_0xd22e('0x3e')](_0x10bdcb[_0xd22e('0x3b')],qs[_0xd22e('0x40')](_0x541416[_0xd22e('0x3c')][_0xd22e('0x40')]));_0x4b4c24[_0xd22e('0x3f')]=_0x4b4c24[_0xd22e('0x3f')][_0xd22e('0x41')]?_0x4b4c24[_0xd22e('0x3f')]:_0x10bdcb[_0xd22e('0x3b')];if(_0x541416[_0xd22e('0x3c')][_0xd22e('0x4d')]){_0x4b4c24[_0xd22e('0x4e')]=[{'all':!![]}];}_0x4b4c24=_[_0xd22e('0x49')]({},_0x4b4c24,_0x541416['options']);return db[_0xd22e('0x36')][_0xd22e('0x52')](_0x4b4c24)[_0xd22e('0x31')](handleEntityNotFound(_0x3d6f08,null))['then'](respondWithResult(_0x3d6f08,null))[_0xd22e('0x50')](handleError(_0x3d6f08,null));};exports['create']=function(_0xac9d13,_0x5785ae){return db[_0xd22e('0x36')]['create'](_0xac9d13[_0xd22e('0x53')],{})[_0xd22e('0x31')](respondWithResult(_0x5785ae,0xc9))['catch'](handleError(_0x5785ae,null));};exports['update']=function(_0xa31087,_0x3c11cb){if(_0xa31087['body']['id']){delete _0xa31087[_0xd22e('0x53')]['id'];}return db[_0xd22e('0x36')]['find']({'where':{'id':_0xa31087[_0xd22e('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c11cb,null))[_0xd22e('0x31')](saveUpdates(_0xa31087[_0xd22e('0x53')],null))[_0xd22e('0x31')](respondWithResult(_0x3c11cb,null))[_0xd22e('0x50')](handleError(_0x3c11cb,null));};exports[_0xd22e('0x32')]=function(_0x30358a,_0x5d494b){return db[_0xd22e('0x36')][_0xd22e('0x52')]({'where':{'id':_0x30358a[_0xd22e('0x54')]['id']}})[_0xd22e('0x31')](handleEntityNotFound(_0x5d494b,null))[_0xd22e('0x31')](removeEntity(_0x5d494b,null))[_0xd22e('0x50')](handleError(_0x5d494b,null));};exports[_0xd22e('0x55')]=function(_0x347aa3,_0x4b4e0b,_0x5e6a84){var _0x275d03={};var _0x6e700d={};var _0x4b8846;var _0x1adb5f;return db[_0xd22e('0x36')][_0xd22e('0x56')]({'where':{'id':_0x347aa3['params']['id']}})[_0xd22e('0x31')](handleEntityNotFound(_0x4b4e0b,null))['then'](function(_0x342178){if(_0x342178){_0x4b8846=_0x342178;_0x6e700d[_0xd22e('0x3b')]=_[_0xd22e('0x3d')](db['DeskConfiguration'][_0xd22e('0x37')]);_0x6e700d[_0xd22e('0x3c')]=_['keys'](_0x347aa3['query']);_0x6e700d[_0xd22e('0x46')]=_[_0xd22e('0x3e')](_0x6e700d[_0xd22e('0x3b')],_0x6e700d[_0xd22e('0x3c')]);_0x275d03['attributes']=_[_0xd22e('0x3e')](_0x6e700d[_0xd22e('0x3b')],qs[_0xd22e('0x40')](_0x347aa3[_0xd22e('0x3c')][_0xd22e('0x40')]));_0x275d03['attributes']=_0x275d03[_0xd22e('0x3f')][_0xd22e('0x41')]?_0x275d03[_0xd22e('0x3f')]:_0x6e700d[_0xd22e('0x3b')];_0x275d03[_0xd22e('0x43')]=qs['sort'](_0x347aa3[_0xd22e('0x3c')][_0xd22e('0x44')]);_0x275d03[_0xd22e('0x45')]=qs['filters'](_[_0xd22e('0x47')](_0x347aa3[_0xd22e('0x3c')],_0x6e700d[_0xd22e('0x46')]));if(_0x347aa3[_0xd22e('0x3c')][_0xd22e('0x48')]){_0x275d03['where']=_[_0xd22e('0x49')](_0x275d03[_0xd22e('0x45')],{'$or':_[_0xd22e('0x35')](_0x275d03[_0xd22e('0x3f')],function(_0x1c8f36){var _0x1421e2={};_0x1421e2[_0x1c8f36]={'$like':'%'+_0x347aa3[_0xd22e('0x3c')]['filter']+'%'};return _0x1421e2;})});}_0x275d03=_[_0xd22e('0x49')]({},_0x275d03,_0x347aa3[_0xd22e('0x4b')]);return _0x4b8846['getConfigurations'](_0x275d03);}})['then'](function(_0x4956b5){if(_0x4956b5){_0x1adb5f=_0x4956b5[_0xd22e('0x41')];if(!_0x347aa3[_0xd22e('0x3c')][_0xd22e('0x57')]('nolimit')){_0x275d03[_0xd22e('0x2c')]=qs[_0xd22e('0x2c')](_0x347aa3[_0xd22e('0x3c')][_0xd22e('0x2c')]);_0x275d03['offset']=qs[_0xd22e('0x2b')](_0x347aa3['query']['offset']);}return _0x4b8846['getConfigurations'](_0x275d03);}})[_0xd22e('0x31')](function(_0x3e2843){if(_0x3e2843){return _0x3e2843?{'count':_0x1adb5f,'rows':_0x3e2843}:null;}})[_0xd22e('0x31')](respondWithResult(_0x4b4e0b,null))[_0xd22e('0x50')](handleError(_0x4b4e0b,null));};exports[_0xd22e('0x58')]=function(_0x110f84,_0x265a9b,_0x3b471f){if(_0x110f84[_0xd22e('0x53')]['id']){delete _0x110f84[_0xd22e('0x53')]['id'];}return db[_0xd22e('0x36')][_0xd22e('0x56')]({'where':{'id':_0x110f84['params']['id']}})[_0xd22e('0x31')](handleEntityNotFound(_0x265a9b,null))['then'](function(_0x44e724){if(_0x44e724){_0x110f84[_0xd22e('0x53')][_0xd22e('0x59')]=_0x44e724['id'];_0x110f84[_0xd22e('0x53')][_0xd22e('0x5a')]=integrations[_0xd22e('0x5b')](_0x110f84[_0xd22e('0x53')]['channel'],_0x110f84[_0xd22e('0x53')]['type']);_0x110f84[_0xd22e('0x53')][_0xd22e('0x5c')]=integrations[_0xd22e('0x5d')](_0x110f84[_0xd22e('0x53')][_0xd22e('0x5e')],_0x110f84['body'][_0xd22e('0x39')]);return db[_0xd22e('0x5f')]['create'](_0x110f84[_0xd22e('0x53')],{'include':[{'model':db[_0xd22e('0x60')],'as':_0xd22e('0x5a')},{'model':db[_0xd22e('0x60')],'as':'Descriptions'}]});}return null;})[_0xd22e('0x31')](respondWithResult(_0x265a9b,null))[_0xd22e('0x50')](handleError(_0x265a9b,null));};exports[_0xd22e('0x61')]=function(_0x94cbb9,_0xdf0e18,_0x2c8c1b){var _0x2ca502=[{'name':'priority','label':_0xd22e('0x62'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x559794='';return db[_0xd22e('0x36')]['findOne']({'where':{'id':_0x94cbb9['params']['id']},'attributes':['id',_0xd22e('0x63'),_0xd22e('0x64'),_0xd22e('0x65'),'password',_0xd22e('0x66'),'consumerSecret','token',_0xd22e('0x67')]})[_0xd22e('0x31')](handleEntityNotFound(_0xdf0e18,null))[_0xd22e('0x31')](function(_0x5d437c){if(_0x5d437c){_0x559794=_0x5d437c[_0xd22e('0x63')];var _0xdd53c9=_0x559794[_0xd22e('0x68')](-0x1);if(_0xdd53c9==='/'){_0x559794=_0x559794[_0xd22e('0x69')](0x0,_0x559794[_0xd22e('0x6a')](_0xdd53c9));}var _0xc5f5d4={'method':'GET','uri':util['format'](_0xd22e('0x6b'),_0x559794),'headers':{'Content-Type':_0xd22e('0x6c'),'Accept':'application/json'},'json':!![]};if(_0x5d437c['authType']===_0xd22e('0x6d')){_0xc5f5d4[_0xd22e('0x6e')][_0xd22e('0x6f')]=util[_0xd22e('0x70')](_0xd22e('0x71'),new Buffer(util[_0xd22e('0x70')](_0xd22e('0x72'),_0x5d437c[_0xd22e('0x65')],_0x5d437c[_0xd22e('0x73')]))['toString']('base64'));}return rp(_0xc5f5d4)['then'](function(_0x42c343){return _0x2ca502[_0xd22e('0x74')](_[_0xd22e('0x35')](_0x42c343[_0xd22e('0x75')][_0xd22e('0x76')],function(_0x5d9da9){return{'id':_0x5d9da9[_0xd22e('0x34')],'name':_0x5d9da9[_0xd22e('0x34')],'type':_0x5d9da9[_0xd22e('0x39')],'active':_0x5d9da9[_0xd22e('0x77')],'label':_0x5d9da9['label'],'custom':!![]};}));});}})['then'](function(_0x124bd3){return{'count':_0x124bd3['length'],'rows':_0x124bd3};})[_0xd22e('0x31')](respondWithResult(_0xdf0e18,null))['catch'](function(_0x454733){var _0x15630b=_0x94cbb9[_0xd22e('0x3c')][_0xd22e('0x1b')]?0x1f4:_0x454733[_0xd22e('0x78')]||0x1f4;logger[_0xd22e('0x24')](_0xd22e('0x79'),_0xd22e('0x61'),_0x15630b,JSON[_0xd22e('0x23')](_0x454733));delete _0x454733['name'];if(_0x15630b===0x191){_0x15630b=0x190;}_0xdf0e18[_0xd22e('0x29')](_0x15630b)[_0xd22e('0x7a')](_0x94cbb9[_0xd22e('0x3c')][_0xd22e('0x1b')]?{'message':_0xd22e('0x7b'),'statusCode':_0x454733[_0xd22e('0x78')]}:_0x454733);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index b07eb8b..fb6ee1b 100644 --- a/server/api/intDeskAccount/intDeskAccount.model.js +++ b/server/api/intDeskAccount/intDeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2dd=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','request-promise','path','rimraf'];(function(_0x3e3c7a,_0x381151){var _0x25436a=function(_0x44f95c){while(--_0x44f95c){_0x3e3c7a['push'](_0x3e3c7a['shift']());}};_0x25436a(++_0x381151);}(_0xc2dd,0x1a8));var _0xdc2d=function(_0x574367,_0xefe2f0){_0x574367=_0x574367-0x0;var _0x2a0ac7=_0xc2dd[_0x574367];return _0x2a0ac7;};'use strict';var _=require(_0xdc2d('0x0'));var util=require(_0xdc2d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdc2d('0x2'));var fs=require('fs');var path=require(_0xdc2d('0x3'));var rimraf=require(_0xdc2d('0x4'));var config=require('../../config/environment');var attributes=require(_0xdc2d('0x5'));var integrations=require(_0xdc2d('0x6'));module[_0xdc2d('0x7')]=function(_0x346822,_0x1219f4){return _0x346822[_0xdc2d('0x8')](_0xdc2d('0x9'),attributes,{'tableName':_0xdc2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16a4=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x26a4ea,_0xa72fb8){var _0x1b669e=function(_0x4e8bba){while(--_0x4e8bba){_0x26a4ea['push'](_0x26a4ea['shift']());}};_0x1b669e(++_0xa72fb8);}(_0x16a4,0xd2));var _0x416a=function(_0x533b31,_0x2786d7){_0x533b31=_0x533b31-0x0;var _0x2c4dc9=_0x16a4[_0x533b31];return _0x2c4dc9;};'use strict';var _=require(_0x416a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x416a('0x1'));var moment=require(_0x416a('0x2'));var BPromise=require(_0x416a('0x3'));var rp=require(_0x416a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x416a('0x5'));var attributes=require(_0x416a('0x6'));var integrations=require(_0x416a('0x7'));module[_0x416a('0x8')]=function(_0x5241dd,_0x513115){return _0x5241dd[_0x416a('0x9')](_0x416a('0xa'),attributes,{'tableName':_0x416a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index f973549..789c139 100644 --- a/server/api/intDeskAccount/intDeskAccount.rpc.js +++ b/server/api/intDeskAccount/intDeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94d5=['map','model','debug','ShowDeskAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include'];(function(_0x2b790a,_0x5458a3){var _0x25bda7=function(_0x4204cf){while(--_0x4204cf){_0x2b790a['push'](_0x2b790a['shift']());}};_0x25bda7(++_0x5458a3);}(_0x94d5,0xf3));var _0x594d=function(_0x44b199,_0x6544b){_0x44b199=_0x44b199-0x0;var _0x277e0f=_0x94d5[_0x44b199];return _0x277e0f;};'use strict';var _=require(_0x594d('0x0'));var util=require(_0x594d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x594d('0x2'));var fs=require('fs');var Redis=require(_0x594d('0x3'));var db=require(_0x594d('0x4'))['db'];var utils=require(_0x594d('0x5'));var logger=require('../../config/logger')(_0x594d('0x6'));var config=require(_0x594d('0x7'));var jayson=require(_0x594d('0x8'));var client=jayson['client'][_0x594d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44c137,_0x5d896b,_0x322ed3){return new BPromise(function(_0x485bcd,_0x30c77d){return client['request'](_0x44c137,_0x322ed3)[_0x594d('0xa')](function(_0x2c8091){logger[_0x594d('0xb')](_0x594d('0xc'),_0x5d896b,'request\x20sent');logger['debug'](_0x594d('0xd'),_0x5d896b,_0x594d('0xe'),JSON[_0x594d('0xf')](_0x2c8091));if(_0x2c8091[_0x594d('0x10')]){if(_0x2c8091[_0x594d('0x10')][_0x594d('0x11')]===0x1f4){logger[_0x594d('0x10')](_0x594d('0xc'),_0x5d896b,_0x2c8091['error'][_0x594d('0x12')]);return _0x30c77d(_0x2c8091['error']['message']);}logger['error'](_0x594d('0xc'),_0x5d896b,_0x2c8091[_0x594d('0x10')][_0x594d('0x12')]);return _0x485bcd(_0x2c8091[_0x594d('0x10')]['message']);}else{logger['info'](_0x594d('0xc'),_0x5d896b,_0x594d('0xe'));_0x485bcd(_0x2c8091[_0x594d('0x13')][_0x594d('0x12')]);}})[_0x594d('0x14')](function(_0x10784c){logger[_0x594d('0x10')](_0x594d('0xc'),_0x5d896b,_0x10784c);_0x30c77d(_0x10784c);});});}exports[_0x594d('0x15')]=function(_0x25c503){var _0x26e61e=this;return new Promise(function(_0xd8d014,_0x2683c4){return db[_0x594d('0x16')][_0x594d('0x17')]({'raw':_0x25c503[_0x594d('0x18')]?_0x25c503[_0x594d('0x18')][_0x594d('0x19')]===undefined?!![]:![]:!![],'where':_0x25c503[_0x594d('0x18')]?_0x25c503[_0x594d('0x18')][_0x594d('0x1a')]||null:null,'attributes':_0x25c503['options']?_0x25c503[_0x594d('0x18')][_0x594d('0x1b')]||null:null,'limit':_0x25c503[_0x594d('0x18')]?_0x25c503[_0x594d('0x18')]['limit']||null:null,'include':_0x25c503[_0x594d('0x18')]?_0x25c503['options'][_0x594d('0x1c')]?_[_0x594d('0x1d')](_0x25c503[_0x594d('0x18')][_0x594d('0x1c')],function(_0x107492){return{'model':db[_0x107492[_0x594d('0x1e')]],'as':_0x107492['as'],'attributes':_0x107492['attributes'],'include':_0x107492[_0x594d('0x1c')]?_['map'](_0x107492['include'],function(_0x2249ff){return{'model':db[_0x2249ff[_0x594d('0x1e')]],'as':_0x2249ff['as'],'attributes':_0x2249ff['attributes'],'include':_0x2249ff[_0x594d('0x1c')]?_[_0x594d('0x1d')](_0x2249ff[_0x594d('0x1c')],function(_0x3000ad){return{'model':db[_0x3000ad['model']],'as':_0x3000ad['as'],'attributes':_0x3000ad[_0x594d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x594d('0xa')](function(_0xb2cc15){logger[_0x594d('0xb')]('GetDeskAccount',_0x25c503);logger[_0x594d('0x1f')](_0x594d('0x15'),_0x25c503,JSON[_0x594d('0xf')](_0xb2cc15));_0xd8d014(_0xb2cc15);})['catch'](function(_0x18ace9){logger[_0x594d('0x10')](_0x594d('0x15'),_0x18ace9[_0x594d('0x12')],_0x25c503);_0x2683c4(_0x26e61e[_0x594d('0x10')](0x1f4,_0x18ace9[_0x594d('0x12')]));});});};exports[_0x594d('0x20')]=function(_0x263d86){var _0x434bb5=this;return new Promise(function(_0x230fe0,_0x128b3b){return db[_0x594d('0x16')][_0x594d('0x21')]({'raw':_0x263d86[_0x594d('0x18')]?_0x263d86[_0x594d('0x18')][_0x594d('0x19')]===undefined?!![]:![]:!![],'where':_0x263d86['options']?_0x263d86[_0x594d('0x18')][_0x594d('0x1a')]||null:null,'attributes':_0x263d86[_0x594d('0x18')]?_0x263d86[_0x594d('0x18')]['attributes']||null:null,'include':_0x263d86[_0x594d('0x18')]?_0x263d86[_0x594d('0x18')][_0x594d('0x1c')]?_[_0x594d('0x1d')](_0x263d86[_0x594d('0x18')][_0x594d('0x1c')],function(_0x26b0d1){return{'model':db[_0x26b0d1[_0x594d('0x1e')]],'as':_0x26b0d1['as'],'attributes':_0x26b0d1[_0x594d('0x1b')],'include':_0x26b0d1[_0x594d('0x1c')]?_[_0x594d('0x1d')](_0x26b0d1[_0x594d('0x1c')],function(_0x4eb97b){return{'model':db[_0x4eb97b[_0x594d('0x1e')]],'as':_0x4eb97b['as'],'attributes':_0x4eb97b[_0x594d('0x1b')],'include':_0x4eb97b[_0x594d('0x1c')]?_[_0x594d('0x1d')](_0x4eb97b[_0x594d('0x1c')],function(_0x692fc4){return{'model':db[_0x692fc4[_0x594d('0x1e')]],'as':_0x692fc4['as'],'attributes':_0x692fc4[_0x594d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x594d('0xa')](function(_0x54ba85){logger[_0x594d('0xb')](_0x594d('0x20'),_0x263d86);logger[_0x594d('0x1f')](_0x594d('0x20'),_0x263d86,JSON[_0x594d('0xf')](_0x54ba85));_0x230fe0(_0x54ba85);})[_0x594d('0x14')](function(_0x25b6e7){logger['error'](_0x594d('0x20'),_0x25b6e7[_0x594d('0x12')],_0x263d86);_0x128b3b(_0x434bb5[_0x594d('0x10')](0x1f4,_0x25b6e7[_0x594d('0x12')]));});});}; \ No newline at end of file +var _0xbcd1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','map','model','catch','ShowDeskAccount','find','lodash','moment'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xbcd1,0x19e));var _0x1bcd=function(_0x2b67ab,_0x2d9aff){_0x2b67ab=_0x2b67ab-0x0;var _0x5e05cb=_0xbcd1[_0x2b67ab];return _0x5e05cb;};'use strict';var _=require(_0x1bcd('0x0'));var util=require('util');var moment=require(_0x1bcd('0x1'));var BPromise=require(_0x1bcd('0x2'));var rs=require(_0x1bcd('0x3'));var fs=require('fs');var Redis=require(_0x1bcd('0x4'));var db=require(_0x1bcd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1bcd('0x6'))(_0x1bcd('0x7'));var config=require('../../config/environment');var jayson=require(_0x1bcd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17d930,_0xc22545,_0x303f45){return new BPromise(function(_0x4e31ff,_0x18d3e7){return client[_0x1bcd('0x9')](_0x17d930,_0x303f45)[_0x1bcd('0xa')](function(_0x3c07b7){logger[_0x1bcd('0xb')]('DeskAccount,\x20%s,\x20%s',_0xc22545,_0x1bcd('0xc'));logger[_0x1bcd('0xd')](_0x1bcd('0xe'),_0xc22545,_0x1bcd('0xc'),JSON[_0x1bcd('0xf')](_0x3c07b7));if(_0x3c07b7[_0x1bcd('0x10')]){if(_0x3c07b7[_0x1bcd('0x10')]['code']===0x1f4){logger[_0x1bcd('0x10')](_0x1bcd('0x11'),_0xc22545,_0x3c07b7[_0x1bcd('0x10')][_0x1bcd('0x12')]);return _0x18d3e7(_0x3c07b7[_0x1bcd('0x10')][_0x1bcd('0x12')]);}logger[_0x1bcd('0x10')]('DeskAccount,\x20%s,\x20%s',_0xc22545,_0x3c07b7[_0x1bcd('0x10')][_0x1bcd('0x12')]);return _0x4e31ff(_0x3c07b7['error'][_0x1bcd('0x12')]);}else{logger[_0x1bcd('0xb')](_0x1bcd('0x11'),_0xc22545,'request\x20sent');_0x4e31ff(_0x3c07b7['result']['message']);}})['catch'](function(_0x95ae81){logger[_0x1bcd('0x10')](_0x1bcd('0x11'),_0xc22545,_0x95ae81);_0x18d3e7(_0x95ae81);});});}exports[_0x1bcd('0x13')]=function(_0x1ea5ac){var _0x365a9f=this;return new Promise(function(_0x5ce5c9,_0x584f6f){return db[_0x1bcd('0x14')]['findAll']({'raw':_0x1ea5ac[_0x1bcd('0x15')]?_0x1ea5ac[_0x1bcd('0x15')][_0x1bcd('0x16')]===undefined?!![]:![]:!![],'where':_0x1ea5ac['options']?_0x1ea5ac['options'][_0x1bcd('0x17')]||null:null,'attributes':_0x1ea5ac['options']?_0x1ea5ac[_0x1bcd('0x15')][_0x1bcd('0x18')]||null:null,'limit':_0x1ea5ac[_0x1bcd('0x15')]?_0x1ea5ac[_0x1bcd('0x15')][_0x1bcd('0x19')]||null:null,'include':_0x1ea5ac['options']?_0x1ea5ac['options'][_0x1bcd('0x1a')]?_[_0x1bcd('0x1b')](_0x1ea5ac[_0x1bcd('0x15')][_0x1bcd('0x1a')],function(_0x7b640c){return{'model':db[_0x7b640c[_0x1bcd('0x1c')]],'as':_0x7b640c['as'],'attributes':_0x7b640c['attributes'],'include':_0x7b640c['include']?_[_0x1bcd('0x1b')](_0x7b640c[_0x1bcd('0x1a')],function(_0x342692){return{'model':db[_0x342692[_0x1bcd('0x1c')]],'as':_0x342692['as'],'attributes':_0x342692[_0x1bcd('0x18')],'include':_0x342692['include']?_[_0x1bcd('0x1b')](_0x342692[_0x1bcd('0x1a')],function(_0x72a007){return{'model':db[_0x72a007[_0x1bcd('0x1c')]],'as':_0x72a007['as'],'attributes':_0x72a007[_0x1bcd('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1bcd('0xa')](function(_0x21a308){logger[_0x1bcd('0xb')]('GetDeskAccount',_0x1ea5ac);logger[_0x1bcd('0xd')]('GetDeskAccount',_0x1ea5ac,JSON[_0x1bcd('0xf')](_0x21a308));_0x5ce5c9(_0x21a308);})[_0x1bcd('0x1d')](function(_0x22945d){logger['error'](_0x1bcd('0x13'),_0x22945d[_0x1bcd('0x12')],_0x1ea5ac);_0x584f6f(_0x365a9f[_0x1bcd('0x10')](0x1f4,_0x22945d[_0x1bcd('0x12')]));});});};exports[_0x1bcd('0x1e')]=function(_0x317068){var _0x56f556=this;return new Promise(function(_0x239613,_0x346e2c){return db['DeskAccount'][_0x1bcd('0x1f')]({'raw':_0x317068['options']?_0x317068[_0x1bcd('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x317068[_0x1bcd('0x15')]?_0x317068[_0x1bcd('0x15')][_0x1bcd('0x17')]||null:null,'attributes':_0x317068[_0x1bcd('0x15')]?_0x317068[_0x1bcd('0x15')]['attributes']||null:null,'include':_0x317068['options']?_0x317068[_0x1bcd('0x15')][_0x1bcd('0x1a')]?_[_0x1bcd('0x1b')](_0x317068[_0x1bcd('0x15')][_0x1bcd('0x1a')],function(_0x582b86){return{'model':db[_0x582b86[_0x1bcd('0x1c')]],'as':_0x582b86['as'],'attributes':_0x582b86['attributes'],'include':_0x582b86[_0x1bcd('0x1a')]?_['map'](_0x582b86[_0x1bcd('0x1a')],function(_0x149f92){return{'model':db[_0x149f92['model']],'as':_0x149f92['as'],'attributes':_0x149f92[_0x1bcd('0x18')],'include':_0x149f92[_0x1bcd('0x1a')]?_[_0x1bcd('0x1b')](_0x149f92['include'],function(_0x40d6e6){return{'model':db[_0x40d6e6['model']],'as':_0x40d6e6['as'],'attributes':_0x40d6e6[_0x1bcd('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a473f){logger['info'](_0x1bcd('0x1e'),_0x317068);logger[_0x1bcd('0xd')]('ShowDeskAccount',_0x317068,JSON[_0x1bcd('0xf')](_0x3a473f));_0x239613(_0x3a473f);})[_0x1bcd('0x1d')](function(_0x1dd0a9){logger[_0x1bcd('0x10')]('ShowDeskAccount',_0x1dd0a9['message'],_0x317068);_0x346e2c(_0x56f556[_0x1bcd('0x10')](0x1f4,_0x1dd0a9[_0x1bcd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5af03f4..e8d8e40 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac6a=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','setTags'];(function(_0x54fda0,_0x15a3a7){var _0x1367da=function(_0x56e6d0){while(--_0x56e6d0){_0x54fda0['push'](_0x54fda0['shift']());}};_0x1367da(++_0x15a3a7);}(_0xac6a,0xc2));var _0xaac6=function(_0x4cd189,_0x2985cd){_0x4cd189=_0x4cd189-0x0;var _0x3c5c95=_0xac6a[_0x4cd189];return _0x3c5c95;};'use strict';var multer=require(_0xaac6('0x0'));var util=require(_0xaac6('0x1'));var path=require(_0xaac6('0x2'));var timeout=require(_0xaac6('0x3'));var express=require(_0xaac6('0x4'));var router=express['Router']();var auth=require(_0xaac6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaac6('0x6'));var controller=require(_0xaac6('0x7'));router[_0xaac6('0x8')]('/',auth[_0xaac6('0x9')](),controller[_0xaac6('0xa')]);router[_0xaac6('0x8')](_0xaac6('0xb'),auth[_0xaac6('0x9')](),controller[_0xaac6('0xc')]);router[_0xaac6('0x8')](_0xaac6('0xd'),auth[_0xaac6('0x9')](),controller['getFields']);router[_0xaac6('0x8')](_0xaac6('0xe'),auth[_0xaac6('0x9')](),controller[_0xaac6('0xf')]);router[_0xaac6('0x8')](_0xaac6('0x10'),auth['isAuthenticated'](),controller[_0xaac6('0x11')]);router[_0xaac6('0x8')](_0xaac6('0x12'),auth[_0xaac6('0x9')](),controller[_0xaac6('0x13')]);router['post']('/',auth[_0xaac6('0x9')](),controller[_0xaac6('0x14')]);router['post']('/:id/tags',auth[_0xaac6('0x9')](),controller[_0xaac6('0x15')]);router[_0xaac6('0x16')](_0xaac6('0xb'),auth[_0xaac6('0x9')](),controller[_0xaac6('0x17')]);router[_0xaac6('0x18')](_0xaac6('0xb'),auth[_0xaac6('0x9')](),controller[_0xaac6('0x19')]);module[_0xaac6('0x1a')]=router; \ No newline at end of file +var _0x5800=['/:id','update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','index','get','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags'];(function(_0x456017,_0x20b663){var _0x4c0934=function(_0x3c7aad){while(--_0x3c7aad){_0x456017['push'](_0x456017['shift']());}};_0x4c0934(++_0x20b663);}(_0x5800,0x1b9));var _0x0580=function(_0x247c12,_0x35a093){_0x247c12=_0x247c12-0x0;var _0x24692b=_0x5800[_0x247c12];return _0x24692b;};'use strict';var multer=require('multer');var util=require(_0x0580('0x0'));var path=require(_0x0580('0x1'));var timeout=require(_0x0580('0x2'));var express=require(_0x0580('0x3'));var router=express['Router']();var auth=require(_0x0580('0x4'));var interaction=require(_0x0580('0x5'));var config=require('../../config/environment');var controller=require(_0x0580('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0580('0x7')]);router[_0x0580('0x8')]('/:id',auth[_0x0580('0x9')](),controller['show']);router[_0x0580('0x8')]('/:id/fields',auth[_0x0580('0x9')](),controller[_0x0580('0xa')]);router[_0x0580('0x8')](_0x0580('0xb'),auth[_0x0580('0x9')](),controller[_0x0580('0xc')]);router[_0x0580('0x8')](_0x0580('0xd'),auth['isAuthenticated'](),controller[_0x0580('0xe')]);router[_0x0580('0x8')](_0x0580('0xf'),auth['isAuthenticated'](),controller['getTags']);router[_0x0580('0x10')]('/',auth[_0x0580('0x9')](),controller[_0x0580('0x11')]);router['post'](_0x0580('0xf'),auth[_0x0580('0x9')](),controller[_0x0580('0x12')]);router['put'](_0x0580('0x13'),auth[_0x0580('0x9')](),controller[_0x0580('0x14')]);router[_0x0580('0x15')](_0x0580('0x13'),auth[_0x0580('0x9')](),controller[_0x0580('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 6d864f2..739f891 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e21=['exports','STRING','sequelize'];(function(_0x54d0c5,_0x47b8c6){var _0x1b307a=function(_0x21f953){while(--_0x21f953){_0x54d0c5['push'](_0x54d0c5['shift']());}};_0x1b307a(++_0x47b8c6);}(_0x7e21,0x131));var _0x17e2=function(_0x4aefa0,_0x242eaa){_0x4aefa0=_0x4aefa0-0x0;var _0x17086c=_0x7e21[_0x4aefa0];return _0x17086c;};'use strict';var Sequelize=require(_0x17e2('0x0'));module[_0x17e2('0x1')]={'name':{'type':Sequelize[_0x17e2('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbe5d=['STRING','sequelize','exports'];(function(_0x1c2fb6,_0x1b941a){var _0x1f6680=function(_0x3f6339){while(--_0x3f6339){_0x1c2fb6['push'](_0x1c2fb6['shift']());}};_0x1f6680(++_0x1b941a);}(_0xbe5d,0x187));var _0xdbe5=function(_0x34891f,_0x55bf8f){_0x34891f=_0x34891f-0x0;var _0x22bf83=_0xbe5d[_0x34891f];return _0x22bf83;};'use strict';var Sequelize=require(_0xdbe5('0x0'));module[_0xdbe5('0x1')]={'name':{'type':Sequelize[_0xdbe5('0x2')]},'description':{'type':Sequelize[_0xdbe5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3382fb4..7387149 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2bd=['show','params','keys','find','create','body','getFields','findOne','DeskField','sort','getSubjects','getDescriptions','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','test','ValidationError','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','merge','filter','options','DeskConfiguration','includeAll','include','rows'];(function(_0x550473,_0x294bd5){var _0x5c7ade=function(_0x4669e7){while(--_0x4669e7){_0x550473['push'](_0x550473['shift']());}};_0x5c7ade(++_0x294bd5);}(_0xa2bd,0xc5));var _0xda2b=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa2bd[_0x173d7e];return _0x2220d6;};'use strict';var pdf=require(_0xda2b('0x0'));var emlformat=require(_0xda2b('0x1'));var rimraf=require(_0xda2b('0x2'));var zipdir=require(_0xda2b('0x3'));var jsonpatch=require(_0xda2b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xda2b('0x5'));var util=require(_0xda2b('0x6'));var path=require('path');var sox=require(_0xda2b('0x7'));var csv=require(_0xda2b('0x8'));var ejs=require(_0xda2b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xda2b('0xa'));var crypto=require(_0xda2b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xda2b('0xc'));var toCsv=require(_0xda2b('0x8'));var querystring=require('querystring');var Papa=require(_0xda2b('0xd'));var Redis=require('ioredis');var authService=require(_0xda2b('0xe'));var qs=require(_0xda2b('0xf'));var as=require(_0xda2b('0x10'));var hardwareService=require(_0xda2b('0x11'));var logger=require(_0xda2b('0x12'))('api');var utils=require(_0xda2b('0x13'));var config=require(_0xda2b('0x14'));var db=require(_0xda2b('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x38d8b7,_0x3e7707,_0x19a622){if(_0x19a622){var _0x199dba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x199dba[_0xda2b('0x16')](_0x3e7707)){return _0x38d8b7;}else{throw new db['Sequelize'][(_0xda2b('0x17'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x38d8b7;}}function respondWithRpcPromise(_0x10f3b,_0x430347,_0x55b2d3,_0x5874d7){return new BPromise(function(_0x4bf7ce,_0x134ecf){var _0x5cd21d=_0x5874d7||client;return _0x5cd21d[_0xda2b('0x18')](_0x10f3b,_0x55b2d3)[_0xda2b('0x19')](function(_0x18a9a0){logger[_0xda2b('0x1a')](_0xda2b('0x1b'),_0x430347,'request\x20sent');logger[_0xda2b('0x1c')](_0xda2b('0x1d'),_0x430347,_0xda2b('0x1e'),JSON['stringify'](_0x18a9a0));if(_0x18a9a0[_0xda2b('0x1f')]){if(_0x18a9a0[_0xda2b('0x1f')][_0xda2b('0x20')]===0x1f4){logger[_0xda2b('0x1f')](_0xda2b('0x1b'),_0x430347,_0x18a9a0[_0xda2b('0x1f')][_0xda2b('0x21')]);return _0x134ecf(_0x18a9a0[_0xda2b('0x1f')][_0xda2b('0x21')]);}logger[_0xda2b('0x1f')](_0xda2b('0x1b'),_0x430347,_0x18a9a0['error'][_0xda2b('0x21')]);return _0x4bf7ce(_0x18a9a0[_0xda2b('0x1f')][_0xda2b('0x21')]);}else{logger[_0xda2b('0x1a')]('DeskConfiguration,\x20%s,\x20%s',_0x430347,'request\x20sent');_0x4bf7ce(_0x18a9a0['result'][_0xda2b('0x21')]);}})[_0xda2b('0x22')](function(_0x2f892e){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x430347,_0x2f892e);_0x134ecf(_0x2f892e);});});}function respondWithStatusCode(_0x2754d4,_0x1189a0){_0x1189a0=_0x1189a0||0xcc;return function(_0x3cc49d){if(_0x3cc49d){return _0x2754d4[_0xda2b('0x23')](_0x1189a0);}return _0x2754d4[_0xda2b('0x24')](_0x1189a0)['end']();};}function respondWithResult(_0x3175bd,_0x289de1){_0x289de1=_0x289de1||0xc8;return function(_0xf9f61a){if(_0xf9f61a){return _0x3175bd[_0xda2b('0x24')](_0x289de1)[_0xda2b('0x25')](_0xf9f61a);}};}function respondWithFilteredResult(_0x4445a8,_0xa92fe2){return function(_0x329647){if(_0x329647){var _0x215734=_0x329647[_0xda2b('0x26')],_0x344a7c=_0xa92fe2[_0xda2b('0x27')],_0x468d9b=_0xa92fe2[_0xda2b('0x27')]+_0xa92fe2[_0xda2b('0x28')],_0x226fe2;if(_0x468d9b>=_0x215734){_0x468d9b=_0x215734;_0x226fe2=0xc8;}else{_0x226fe2=0xce;}_0x4445a8['status'](_0x226fe2);return _0x4445a8[_0xda2b('0x29')](_0xda2b('0x2a'),_0x344a7c+'-'+_0x468d9b+'/'+_0x215734)[_0xda2b('0x25')](_0x329647);}return null;};}function patchUpdates(_0x201b2b){return function(_0x31bfe1){try{jsonpatch[_0xda2b('0x2b')](_0x31bfe1,_0x201b2b,!![]);}catch(_0x5bdece){return BPromise[_0xda2b('0x2c')](_0x5bdece);}return _0x31bfe1[_0xda2b('0x2d')]();};}function saveUpdates(_0x540509,_0x372050){return function(_0x5e4c09){if(_0x5e4c09){return _0x5e4c09[_0xda2b('0x2e')](_0x540509)['then'](function(_0x2be923){return _0x2be923;});}return null;};}function removeEntity(_0x2a7c66,_0x29e96c){return function(_0x415647){if(_0x415647){return _0x415647[_0xda2b('0x2f')]()[_0xda2b('0x19')](function(){_0x2a7c66[_0xda2b('0x24')](0xcc)[_0xda2b('0x30')]();});}};}function handleEntityNotFound(_0x4ae813,_0x199567){return function(_0x326076){if(!_0x326076){_0x4ae813[_0xda2b('0x23')](0x194);}return _0x326076;};}function handleError(_0x2e9ac1,_0x5a4414){_0x5a4414=_0x5a4414||0x1f4;return function(_0x31c65e){logger[_0xda2b('0x1f')](_0x31c65e['stack']);if(_0x31c65e[_0xda2b('0x31')]){delete _0x31c65e[_0xda2b('0x31')];}_0x2e9ac1['status'](_0x5a4414)[_0xda2b('0x32')](_0x31c65e);};}exports[_0xda2b('0x33')]=function(_0x1eb825,_0x33c293){var _0x48196c={},_0x4ddb51={},_0x757b19={'count':0x0,'rows':[]};var _0x5039f2=_[_0xda2b('0x34')](db['DeskConfiguration'][_0xda2b('0x35')],function(_0x5c4945){return{'name':_0x5c4945[_0xda2b('0x36')],'type':_0x5c4945[_0xda2b('0x37')][_0xda2b('0x38')]};});_0x4ddb51[_0xda2b('0x39')]=_[_0xda2b('0x34')](_0x5039f2,_0xda2b('0x31'));_0x4ddb51[_0xda2b('0x3a')]=_['keys'](_0x1eb825[_0xda2b('0x3a')]);_0x4ddb51['filters']=_[_0xda2b('0x3b')](_0x4ddb51[_0xda2b('0x39')],_0x4ddb51[_0xda2b('0x3a')]);_0x48196c[_0xda2b('0x3c')]=_[_0xda2b('0x3b')](_0x4ddb51[_0xda2b('0x39')],qs[_0xda2b('0x3d')](_0x1eb825['query'][_0xda2b('0x3d')]));_0x48196c[_0xda2b('0x3c')]=_0x48196c[_0xda2b('0x3c')][_0xda2b('0x3e')]?_0x48196c['attributes']:_0x4ddb51[_0xda2b('0x39')];if(!_0x1eb825[_0xda2b('0x3a')][_0xda2b('0x3f')](_0xda2b('0x40'))){_0x48196c['limit']=qs[_0xda2b('0x28')](_0x1eb825[_0xda2b('0x3a')][_0xda2b('0x28')]);_0x48196c[_0xda2b('0x27')]=qs[_0xda2b('0x27')](_0x1eb825[_0xda2b('0x3a')][_0xda2b('0x27')]);}_0x48196c[_0xda2b('0x41')]=qs['sort'](_0x1eb825[_0xda2b('0x3a')]['sort']);_0x48196c[_0xda2b('0x42')]=qs['filters'](_[_0xda2b('0x43')](_0x1eb825[_0xda2b('0x3a')],_0x4ddb51[_0xda2b('0x44')]));if(_0x1eb825[_0xda2b('0x3a')]['filter']){_0x48196c[_0xda2b('0x42')]=_[_0xda2b('0x45')](_0x48196c['where'],{'$or':_[_0xda2b('0x34')](_0x5039f2,function(_0x1d0959){if(_0x1d0959[_0xda2b('0x37')]!=='VIRTUAL'){var _0x136efe={};_0x136efe[_0x1d0959[_0xda2b('0x31')]]={'$like':'%'+_0x1eb825[_0xda2b('0x3a')][_0xda2b('0x46')]+'%'};return _0x136efe;}})});}_0x48196c=_[_0xda2b('0x45')]({},_0x48196c,_0x1eb825[_0xda2b('0x47')]);var _0xd0608={'where':_0x48196c[_0xda2b('0x42')]};return db[_0xda2b('0x48')][_0xda2b('0x26')](_0xd0608)[_0xda2b('0x19')](function(_0x35bd37){_0x757b19[_0xda2b('0x26')]=_0x35bd37;if(_0x1eb825[_0xda2b('0x3a')][_0xda2b('0x49')]){_0x48196c[_0xda2b('0x4a')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x48196c);})[_0xda2b('0x19')](function(_0x1ec575){_0x757b19[_0xda2b('0x4b')]=_0x1ec575;return _0x757b19;})[_0xda2b('0x19')](respondWithFilteredResult(_0x33c293,_0x48196c))[_0xda2b('0x22')](handleError(_0x33c293,null));};exports[_0xda2b('0x4c')]=function(_0x336a25,_0x4b3481){var _0x16630e={'raw':![],'where':{'id':_0x336a25[_0xda2b('0x4d')]['id']}},_0x54585b={};_0x54585b[_0xda2b('0x39')]=_['keys'](db[_0xda2b('0x48')]['rawAttributes']);_0x54585b[_0xda2b('0x3a')]=_[_0xda2b('0x4e')](_0x336a25[_0xda2b('0x3a')]);_0x54585b['filters']=_[_0xda2b('0x3b')](_0x54585b[_0xda2b('0x39')],_0x54585b[_0xda2b('0x3a')]);_0x16630e['attributes']=_[_0xda2b('0x3b')](_0x54585b[_0xda2b('0x39')],qs[_0xda2b('0x3d')](_0x336a25[_0xda2b('0x3a')]['fields']));_0x16630e[_0xda2b('0x3c')]=_0x16630e['attributes'][_0xda2b('0x3e')]?_0x16630e[_0xda2b('0x3c')]:_0x54585b[_0xda2b('0x39')];if(_0x336a25[_0xda2b('0x3a')][_0xda2b('0x49')]){_0x16630e[_0xda2b('0x4a')]=[{'all':!![]}];}_0x16630e=_[_0xda2b('0x45')]({},_0x16630e,_0x336a25[_0xda2b('0x47')]);return db[_0xda2b('0x48')][_0xda2b('0x4f')](_0x16630e)[_0xda2b('0x19')](handleEntityNotFound(_0x4b3481,null))[_0xda2b('0x19')](respondWithResult(_0x4b3481,null))[_0xda2b('0x22')](handleError(_0x4b3481,null));};exports[_0xda2b('0x50')]=function(_0x52f8cf,_0x5da7ff){return db[_0xda2b('0x48')][_0xda2b('0x50')](_0x52f8cf['body'],{})[_0xda2b('0x19')](respondWithResult(_0x5da7ff,0xc9))[_0xda2b('0x22')](handleError(_0x5da7ff,null));};exports['update']=function(_0x666d7a,_0x4df8bc){if(_0x666d7a[_0xda2b('0x51')]['id']){delete _0x666d7a[_0xda2b('0x51')]['id'];}return db['DeskConfiguration'][_0xda2b('0x4f')]({'where':{'id':_0x666d7a[_0xda2b('0x4d')]['id']}})[_0xda2b('0x19')](handleEntityNotFound(_0x4df8bc,null))[_0xda2b('0x19')](saveUpdates(_0x666d7a['body'],null))[_0xda2b('0x19')](respondWithResult(_0x4df8bc,null))[_0xda2b('0x22')](handleError(_0x4df8bc,null));};exports[_0xda2b('0x2f')]=function(_0x48077c,_0x51f014){return db[_0xda2b('0x48')]['find']({'where':{'id':_0x48077c[_0xda2b('0x4d')]['id']}})[_0xda2b('0x19')](handleEntityNotFound(_0x51f014,null))['then'](removeEntity(_0x51f014,null))[_0xda2b('0x22')](handleError(_0x51f014,null));};exports[_0xda2b('0x52')]=function(_0x290175,_0x32cd3d,_0x410a82){var _0x3989ed={};var _0x56d889={};var _0x4d0ccd;var _0x44b651;return db[_0xda2b('0x48')][_0xda2b('0x53')]({'where':{'id':_0x290175['params']['id']}})[_0xda2b('0x19')](handleEntityNotFound(_0x32cd3d,null))[_0xda2b('0x19')](function(_0x1d512f){if(_0x1d512f){_0x4d0ccd=_0x1d512f;_0x56d889[_0xda2b('0x39')]=_[_0xda2b('0x4e')](db[_0xda2b('0x54')][_0xda2b('0x35')]);_0x56d889[_0xda2b('0x3a')]=_[_0xda2b('0x4e')](_0x290175[_0xda2b('0x3a')]);_0x56d889['filters']=_[_0xda2b('0x3b')](_0x56d889[_0xda2b('0x39')],_0x56d889[_0xda2b('0x3a')]);_0x3989ed[_0xda2b('0x3c')]=_['intersection'](_0x56d889['model'],qs[_0xda2b('0x3d')](_0x290175[_0xda2b('0x3a')]['fields']));_0x3989ed[_0xda2b('0x3c')]=_0x3989ed['attributes'][_0xda2b('0x3e')]?_0x3989ed[_0xda2b('0x3c')]:_0x56d889[_0xda2b('0x39')];_0x3989ed[_0xda2b('0x41')]=qs[_0xda2b('0x55')](_0x290175[_0xda2b('0x3a')][_0xda2b('0x55')]);_0x3989ed[_0xda2b('0x42')]=qs[_0xda2b('0x44')](_[_0xda2b('0x43')](_0x290175[_0xda2b('0x3a')],_0x56d889[_0xda2b('0x44')]));if(_0x290175['query']['filter']){_0x3989ed[_0xda2b('0x42')]=_[_0xda2b('0x45')](_0x3989ed[_0xda2b('0x42')],{'$or':_['map'](_0x3989ed[_0xda2b('0x3c')],function(_0x6cef10){var _0x439b40={};_0x439b40[_0x6cef10]={'$like':'%'+_0x290175[_0xda2b('0x3a')][_0xda2b('0x46')]+'%'};return _0x439b40;})});}_0x3989ed=_['merge']({},_0x3989ed,_0x290175[_0xda2b('0x47')]);return _0x4d0ccd['getFields'](_0x3989ed);}})[_0xda2b('0x19')](function(_0xa06129){if(_0xa06129){_0x44b651=_0xa06129[_0xda2b('0x3e')];if(!_0x290175['query'][_0xda2b('0x3f')](_0xda2b('0x40'))){_0x3989ed[_0xda2b('0x28')]=qs[_0xda2b('0x28')](_0x290175[_0xda2b('0x3a')][_0xda2b('0x28')]);_0x3989ed[_0xda2b('0x27')]=qs[_0xda2b('0x27')](_0x290175[_0xda2b('0x3a')][_0xda2b('0x27')]);}return _0x4d0ccd['getFields'](_0x3989ed);}})[_0xda2b('0x19')](function(_0x29a87a){if(_0x29a87a){return _0x29a87a?{'count':_0x44b651,'rows':_0x29a87a}:null;}})['then'](respondWithResult(_0x32cd3d,null))[_0xda2b('0x22')](handleError(_0x32cd3d,null));};exports['getSubjects']=function(_0x490cdb,_0x43b93b,_0x5a5571){var _0x4d59a2={};var _0x569b21={};var _0x4429ee;var _0x36e4cd;return db[_0xda2b('0x48')]['findOne']({'where':{'id':_0x490cdb[_0xda2b('0x4d')]['id']}})[_0xda2b('0x19')](handleEntityNotFound(_0x43b93b,null))[_0xda2b('0x19')](function(_0x429bd0){if(_0x429bd0){_0x4429ee=_0x429bd0;_0x569b21[_0xda2b('0x39')]=_[_0xda2b('0x4e')](db[_0xda2b('0x54')][_0xda2b('0x35')]);_0x569b21[_0xda2b('0x3a')]=_[_0xda2b('0x4e')](_0x490cdb[_0xda2b('0x3a')]);_0x569b21[_0xda2b('0x44')]=_[_0xda2b('0x3b')](_0x569b21[_0xda2b('0x39')],_0x569b21[_0xda2b('0x3a')]);_0x4d59a2[_0xda2b('0x3c')]=_['intersection'](_0x569b21['model'],qs[_0xda2b('0x3d')](_0x490cdb[_0xda2b('0x3a')][_0xda2b('0x3d')]));_0x4d59a2['attributes']=_0x4d59a2[_0xda2b('0x3c')][_0xda2b('0x3e')]?_0x4d59a2[_0xda2b('0x3c')]:_0x569b21[_0xda2b('0x39')];_0x4d59a2[_0xda2b('0x41')]=qs[_0xda2b('0x55')](_0x490cdb['query']['sort']);_0x4d59a2[_0xda2b('0x42')]=qs[_0xda2b('0x44')](_[_0xda2b('0x43')](_0x490cdb['query'],_0x569b21['filters']));if(_0x490cdb[_0xda2b('0x3a')][_0xda2b('0x46')]){_0x4d59a2[_0xda2b('0x42')]=_[_0xda2b('0x45')](_0x4d59a2[_0xda2b('0x42')],{'$or':_['map'](_0x4d59a2[_0xda2b('0x3c')],function(_0x44ef16){var _0x2a2abe={};_0x2a2abe[_0x44ef16]={'$like':'%'+_0x490cdb['query']['filter']+'%'};return _0x2a2abe;})});}_0x4d59a2=_[_0xda2b('0x45')]({},_0x4d59a2,_0x490cdb[_0xda2b('0x47')]);return _0x4429ee[_0xda2b('0x56')](_0x4d59a2);}})[_0xda2b('0x19')](function(_0x3a51c){if(_0x3a51c){_0x36e4cd=_0x3a51c[_0xda2b('0x3e')];if(!_0x490cdb[_0xda2b('0x3a')][_0xda2b('0x3f')](_0xda2b('0x40'))){_0x4d59a2[_0xda2b('0x28')]=qs['limit'](_0x490cdb['query'][_0xda2b('0x28')]);_0x4d59a2[_0xda2b('0x27')]=qs[_0xda2b('0x27')](_0x490cdb[_0xda2b('0x3a')]['offset']);}return _0x4429ee['getSubjects'](_0x4d59a2);}})[_0xda2b('0x19')](function(_0xc02b0d){if(_0xc02b0d){return _0xc02b0d?{'count':_0x36e4cd,'rows':_0xc02b0d}:null;}})[_0xda2b('0x19')](respondWithResult(_0x43b93b,null))[_0xda2b('0x22')](handleError(_0x43b93b,null));};exports[_0xda2b('0x57')]=function(_0x5699c2,_0x39357c,_0x55e190){var _0x1dab1d={};var _0x49b595={};var _0x31b4ba;var _0xf595d7;return db[_0xda2b('0x48')][_0xda2b('0x53')]({'where':{'id':_0x5699c2[_0xda2b('0x4d')]['id']}})[_0xda2b('0x19')](handleEntityNotFound(_0x39357c,null))[_0xda2b('0x19')](function(_0x3c4109){if(_0x3c4109){_0x31b4ba=_0x3c4109;_0x49b595['model']=_[_0xda2b('0x4e')](db[_0xda2b('0x54')][_0xda2b('0x35')]);_0x49b595[_0xda2b('0x3a')]=_['keys'](_0x5699c2[_0xda2b('0x3a')]);_0x49b595[_0xda2b('0x44')]=_[_0xda2b('0x3b')](_0x49b595[_0xda2b('0x39')],_0x49b595[_0xda2b('0x3a')]);_0x1dab1d['attributes']=_[_0xda2b('0x3b')](_0x49b595[_0xda2b('0x39')],qs['fields'](_0x5699c2[_0xda2b('0x3a')]['fields']));_0x1dab1d[_0xda2b('0x3c')]=_0x1dab1d[_0xda2b('0x3c')][_0xda2b('0x3e')]?_0x1dab1d['attributes']:_0x49b595['model'];_0x1dab1d[_0xda2b('0x41')]=qs[_0xda2b('0x55')](_0x5699c2[_0xda2b('0x3a')][_0xda2b('0x55')]);_0x1dab1d[_0xda2b('0x42')]=qs[_0xda2b('0x44')](_[_0xda2b('0x43')](_0x5699c2[_0xda2b('0x3a')],_0x49b595['filters']));if(_0x5699c2[_0xda2b('0x3a')][_0xda2b('0x46')]){_0x1dab1d[_0xda2b('0x42')]=_[_0xda2b('0x45')](_0x1dab1d[_0xda2b('0x42')],{'$or':_['map'](_0x1dab1d['attributes'],function(_0x16008a){var _0x462430={};_0x462430[_0x16008a]={'$like':'%'+_0x5699c2[_0xda2b('0x3a')][_0xda2b('0x46')]+'%'};return _0x462430;})});}_0x1dab1d=_[_0xda2b('0x45')]({},_0x1dab1d,_0x5699c2[_0xda2b('0x47')]);return _0x31b4ba[_0xda2b('0x57')](_0x1dab1d);}})['then'](function(_0x54317a){if(_0x54317a){_0xf595d7=_0x54317a['length'];if(!_0x5699c2['query']['hasOwnProperty'](_0xda2b('0x40'))){_0x1dab1d['limit']=qs[_0xda2b('0x28')](_0x5699c2[_0xda2b('0x3a')][_0xda2b('0x28')]);_0x1dab1d['offset']=qs[_0xda2b('0x27')](_0x5699c2[_0xda2b('0x3a')]['offset']);}return _0x31b4ba[_0xda2b('0x57')](_0x1dab1d);}})[_0xda2b('0x19')](function(_0x2f8458){if(_0x2f8458){return _0x2f8458?{'count':_0xf595d7,'rows':_0x2f8458}:null;}})['then'](respondWithResult(_0x39357c,null))[_0xda2b('0x22')](handleError(_0x39357c,null));};exports['getTags']=function(_0x3618e3,_0x96e3fb,_0x4b6d14){var _0x1b7071={};var _0x19701f={};var _0x1423dd;var _0x45d6b4;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3618e3['params']['id']}})[_0xda2b('0x19')](handleEntityNotFound(_0x96e3fb,null))[_0xda2b('0x19')](function(_0x337f62){if(_0x337f62){_0x1423dd=_0x337f62;_0x19701f['model']=_['keys'](db[_0xda2b('0x58')][_0xda2b('0x35')]);_0x19701f[_0xda2b('0x3a')]=_[_0xda2b('0x4e')](_0x3618e3['query']);_0x19701f[_0xda2b('0x44')]=_[_0xda2b('0x3b')](_0x19701f[_0xda2b('0x39')],_0x19701f[_0xda2b('0x3a')]);_0x1b7071[_0xda2b('0x3c')]=_[_0xda2b('0x3b')](_0x19701f['model'],qs[_0xda2b('0x3d')](_0x3618e3['query'][_0xda2b('0x3d')]));_0x1b7071[_0xda2b('0x3c')]=_0x1b7071['attributes'][_0xda2b('0x3e')]?_0x1b7071[_0xda2b('0x3c')]:_0x19701f[_0xda2b('0x39')];_0x1b7071[_0xda2b('0x41')]=qs[_0xda2b('0x55')](_0x3618e3[_0xda2b('0x3a')]['sort']);_0x1b7071[_0xda2b('0x42')]=qs[_0xda2b('0x44')](_[_0xda2b('0x43')](_0x3618e3[_0xda2b('0x3a')],_0x19701f[_0xda2b('0x44')]));if(_0x3618e3[_0xda2b('0x3a')]['filter']){_0x1b7071[_0xda2b('0x42')]=_['merge'](_0x1b7071[_0xda2b('0x42')],{'$or':_[_0xda2b('0x34')](_0x1b7071[_0xda2b('0x3c')],function(_0x3c873e){var _0x1b809d={};_0x1b809d[_0x3c873e]={'$like':'%'+_0x3618e3[_0xda2b('0x3a')][_0xda2b('0x46')]+'%'};return _0x1b809d;})});}_0x1b7071=_[_0xda2b('0x45')]({},_0x1b7071,_0x3618e3[_0xda2b('0x47')]);return _0x1423dd['getTags'](_0x1b7071);}})[_0xda2b('0x19')](function(_0x3ae17d){if(_0x3ae17d){_0x45d6b4=_0x3ae17d[_0xda2b('0x3e')];if(!_0x3618e3[_0xda2b('0x3a')]['hasOwnProperty'](_0xda2b('0x40'))){_0x1b7071[_0xda2b('0x28')]=qs['limit'](_0x3618e3[_0xda2b('0x3a')]['limit']);_0x1b7071[_0xda2b('0x27')]=qs[_0xda2b('0x27')](_0x3618e3[_0xda2b('0x3a')][_0xda2b('0x27')]);}return _0x1423dd['getTags'](_0x1b7071);}})[_0xda2b('0x19')](function(_0x3d9c9a){if(_0x3d9c9a){return _0x3d9c9a?{'count':_0x45d6b4,'rows':_0x3d9c9a}:null;}})[_0xda2b('0x19')](respondWithResult(_0x96e3fb,null))[_0xda2b('0x22')](handleError(_0x96e3fb,null));};exports[_0xda2b('0x59')]=function(_0x2511bf,_0x5b10e7,_0x2749ad){if(_0x2511bf[_0xda2b('0x51')]['id']){delete _0x2511bf[_0xda2b('0x51')]['id'];}return db[_0xda2b('0x48')][_0xda2b('0x53')]({'where':{'id':_0x2511bf[_0xda2b('0x4d')]['id']}})[_0xda2b('0x19')](handleEntityNotFound(_0x5b10e7,null))[_0xda2b('0x19')](function(_0x3b6c4e){if(_0x3b6c4e){return _0x3b6c4e[_0xda2b('0x59')](_0x2511bf[_0xda2b('0x51')][_0xda2b('0x5a')]||[]);}return null;})[_0xda2b('0x19')](respondWithResult(_0x5b10e7,null))[_0xda2b('0x22')](handleError(_0x5b10e7,null));}; \ No newline at end of file +var _0x36b4=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','stringify','error','code','message','info','DeskConfiguration,\x20%s,\x20%s','result','catch','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','save','update','destroy','stack','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','rows','show','params','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1664cf,_0x228dfa){var _0xc7e6e0=function(_0xeca16d){while(--_0xeca16d){_0x1664cf['push'](_0x1664cf['shift']());}};_0xc7e6e0(++_0x228dfa);}(_0x36b4,0xaa));var _0x436b=function(_0x146887,_0x42583a){_0x146887=_0x146887-0x0;var _0x141bf6=_0x36b4[_0x146887];return _0x141bf6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x436b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x436b('0x1'));var jsonpatch=require(_0x436b('0x2'));var rp=require(_0x436b('0x3'));var moment=require(_0x436b('0x4'));var BPromise=require(_0x436b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x436b('0x6'));var csv=require(_0x436b('0x7'));var ejs=require(_0x436b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x436b('0x9'));var jsforce=require(_0x436b('0xa'));var deskjs=require(_0x436b('0xb'));var toCsv=require(_0x436b('0x7'));var querystring=require(_0x436b('0xc'));var Papa=require(_0x436b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x436b('0xe'));var as=require(_0x436b('0xf'));var hardwareService=require(_0x436b('0x10'));var logger=require(_0x436b('0x11'))(_0x436b('0x12'));var utils=require(_0x436b('0x13'));var config=require(_0x436b('0x14'));var db=require(_0x436b('0x15'))['db'];var jayson=require(_0x436b('0x16'));var client=jayson['client'][_0x436b('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4d63f5,_0x3b1ea9,_0x2239db){if(_0x2239db){var _0x555bd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x555bd[_0x436b('0x18')](_0x3b1ea9)){return _0x4d63f5;}else{throw new db[(_0x436b('0x19'))][(_0x436b('0x1a'))](_0x436b('0x1b'));}}else{return _0x4d63f5;}}function respondWithRpcPromise(_0x281bbd,_0x22764e,_0x3e6839,_0x6fa075){return new BPromise(function(_0x1001d5,_0x512912){var _0x42581e=_0x6fa075||client;return _0x42581e[_0x436b('0x1c')](_0x281bbd,_0x3e6839)[_0x436b('0x1d')](function(_0x22e4ae){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x22764e,_0x436b('0x1e'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x22764e,_0x436b('0x1e'),JSON[_0x436b('0x1f')](_0x22e4ae));if(_0x22e4ae[_0x436b('0x20')]){if(_0x22e4ae[_0x436b('0x20')][_0x436b('0x21')]===0x1f4){logger[_0x436b('0x20')]('DeskConfiguration,\x20%s,\x20%s',_0x22764e,_0x22e4ae[_0x436b('0x20')][_0x436b('0x22')]);return _0x512912(_0x22e4ae[_0x436b('0x20')][_0x436b('0x22')]);}logger[_0x436b('0x20')]('DeskConfiguration,\x20%s,\x20%s',_0x22764e,_0x22e4ae[_0x436b('0x20')][_0x436b('0x22')]);return _0x1001d5(_0x22e4ae[_0x436b('0x20')][_0x436b('0x22')]);}else{logger[_0x436b('0x23')](_0x436b('0x24'),_0x22764e,'request\x20sent');_0x1001d5(_0x22e4ae[_0x436b('0x25')]['message']);}})[_0x436b('0x26')](function(_0x4da1dc){logger[_0x436b('0x20')](_0x436b('0x24'),_0x22764e,_0x4da1dc);_0x512912(_0x4da1dc);});});}function respondWithStatusCode(_0x3abfac,_0x4fb0fc){_0x4fb0fc=_0x4fb0fc||0xcc;return function(_0x31ebd8){if(_0x31ebd8){return _0x3abfac[_0x436b('0x27')](_0x4fb0fc);}return _0x3abfac['status'](_0x4fb0fc)[_0x436b('0x28')]();};}function respondWithResult(_0x47ffb2,_0x3e9c50){_0x3e9c50=_0x3e9c50||0xc8;return function(_0x56280a){if(_0x56280a){return _0x47ffb2['status'](_0x3e9c50)['json'](_0x56280a);}};}function respondWithFilteredResult(_0x3a36a9,_0x14731d){return function(_0x14e4b0){if(_0x14e4b0){var _0x2793fb=_0x14e4b0[_0x436b('0x29')],_0x120454=_0x14731d[_0x436b('0x2a')],_0x394413=_0x14731d[_0x436b('0x2a')]+_0x14731d[_0x436b('0x2b')],_0x5858f2;if(_0x394413>=_0x2793fb){_0x394413=_0x2793fb;_0x5858f2=0xc8;}else{_0x5858f2=0xce;}_0x3a36a9[_0x436b('0x2c')](_0x5858f2);return _0x3a36a9['set'](_0x436b('0x2d'),_0x120454+'-'+_0x394413+'/'+_0x2793fb)[_0x436b('0x2e')](_0x14e4b0);}return null;};}function patchUpdates(_0x182685){return function(_0x21fb49){try{jsonpatch[_0x436b('0x2f')](_0x21fb49,_0x182685,!![]);}catch(_0x4f2307){return BPromise[_0x436b('0x30')](_0x4f2307);}return _0x21fb49[_0x436b('0x31')]();};}function saveUpdates(_0x28a02e,_0x18a743){return function(_0x42f035){if(_0x42f035){return _0x42f035[_0x436b('0x32')](_0x28a02e)[_0x436b('0x1d')](function(_0xdfed12){return _0xdfed12;});}return null;};}function removeEntity(_0x52ca84,_0x5e9768){return function(_0x414431){if(_0x414431){return _0x414431[_0x436b('0x33')]()[_0x436b('0x1d')](function(){_0x52ca84[_0x436b('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x229c18,_0x237382){return function(_0x2aa0f3){if(!_0x2aa0f3){_0x229c18[_0x436b('0x27')](0x194);}return _0x2aa0f3;};}function handleError(_0x56aabc,_0x296279){_0x296279=_0x296279||0x1f4;return function(_0x284100){logger['error'](_0x284100[_0x436b('0x34')]);if(_0x284100['name']){delete _0x284100[_0x436b('0x35')];}_0x56aabc['status'](_0x296279)['send'](_0x284100);};}exports['index']=function(_0x17c117,_0x550a84){var _0x2e65e5={},_0x496b5e={},_0x1180d7={'count':0x0,'rows':[]};var _0x2005c3=_[_0x436b('0x36')](db['DeskConfiguration'][_0x436b('0x37')],function(_0xd6e7f3){return{'name':_0xd6e7f3['fieldName'],'type':_0xd6e7f3[_0x436b('0x38')][_0x436b('0x39')]};});_0x496b5e[_0x436b('0x3a')]=_[_0x436b('0x36')](_0x2005c3,_0x436b('0x35'));_0x496b5e[_0x436b('0x3b')]=_[_0x436b('0x3c')](_0x17c117['query']);_0x496b5e[_0x436b('0x3d')]=_[_0x436b('0x3e')](_0x496b5e['model'],_0x496b5e[_0x436b('0x3b')]);_0x2e65e5[_0x436b('0x3f')]=_[_0x436b('0x3e')](_0x496b5e['model'],qs[_0x436b('0x40')](_0x17c117[_0x436b('0x3b')]['fields']));_0x2e65e5[_0x436b('0x3f')]=_0x2e65e5[_0x436b('0x3f')][_0x436b('0x41')]?_0x2e65e5[_0x436b('0x3f')]:_0x496b5e[_0x436b('0x3a')];if(!_0x17c117['query'][_0x436b('0x42')](_0x436b('0x43'))){_0x2e65e5[_0x436b('0x2b')]=qs['limit'](_0x17c117[_0x436b('0x3b')][_0x436b('0x2b')]);_0x2e65e5[_0x436b('0x2a')]=qs[_0x436b('0x2a')](_0x17c117[_0x436b('0x3b')][_0x436b('0x2a')]);}_0x2e65e5[_0x436b('0x44')]=qs[_0x436b('0x45')](_0x17c117[_0x436b('0x3b')]['sort']);_0x2e65e5[_0x436b('0x46')]=qs['filters'](_[_0x436b('0x47')](_0x17c117[_0x436b('0x3b')],_0x496b5e['filters']));if(_0x17c117[_0x436b('0x3b')][_0x436b('0x48')]){_0x2e65e5[_0x436b('0x46')]=_[_0x436b('0x49')](_0x2e65e5['where'],{'$or':_[_0x436b('0x36')](_0x2005c3,function(_0x4a68e5){if(_0x4a68e5['type']!==_0x436b('0x4a')){var _0x473ccb={};_0x473ccb[_0x4a68e5[_0x436b('0x35')]]={'$like':'%'+_0x17c117['query'][_0x436b('0x48')]+'%'};return _0x473ccb;}})});}_0x2e65e5=_[_0x436b('0x49')]({},_0x2e65e5,_0x17c117[_0x436b('0x4b')]);var _0x27e48e={'where':_0x2e65e5[_0x436b('0x46')]};return db[_0x436b('0x4c')][_0x436b('0x29')](_0x27e48e)[_0x436b('0x1d')](function(_0x30022e){_0x1180d7['count']=_0x30022e;if(_0x17c117[_0x436b('0x3b')][_0x436b('0x4d')]){_0x2e65e5[_0x436b('0x4e')]=[{'all':!![]}];}return db[_0x436b('0x4c')]['findAll'](_0x2e65e5);})[_0x436b('0x1d')](function(_0x282f04){_0x1180d7[_0x436b('0x4f')]=_0x282f04;return _0x1180d7;})[_0x436b('0x1d')](respondWithFilteredResult(_0x550a84,_0x2e65e5))[_0x436b('0x26')](handleError(_0x550a84,null));};exports[_0x436b('0x50')]=function(_0x24bf8b,_0x58c8df){var _0x343848={'raw':![],'where':{'id':_0x24bf8b[_0x436b('0x51')]['id']}},_0x3fa667={};_0x3fa667[_0x436b('0x3a')]=_[_0x436b('0x3c')](db[_0x436b('0x4c')][_0x436b('0x37')]);_0x3fa667[_0x436b('0x3b')]=_[_0x436b('0x3c')](_0x24bf8b[_0x436b('0x3b')]);_0x3fa667[_0x436b('0x3d')]=_['intersection'](_0x3fa667[_0x436b('0x3a')],_0x3fa667[_0x436b('0x3b')]);_0x343848['attributes']=_[_0x436b('0x3e')](_0x3fa667[_0x436b('0x3a')],qs[_0x436b('0x40')](_0x24bf8b[_0x436b('0x3b')][_0x436b('0x40')]));_0x343848[_0x436b('0x3f')]=_0x343848[_0x436b('0x3f')][_0x436b('0x41')]?_0x343848[_0x436b('0x3f')]:_0x3fa667['model'];if(_0x24bf8b[_0x436b('0x3b')][_0x436b('0x4d')]){_0x343848[_0x436b('0x4e')]=[{'all':!![]}];}_0x343848=_['merge']({},_0x343848,_0x24bf8b[_0x436b('0x4b')]);return db[_0x436b('0x4c')][_0x436b('0x52')](_0x343848)['then'](handleEntityNotFound(_0x58c8df,null))['then'](respondWithResult(_0x58c8df,null))[_0x436b('0x26')](handleError(_0x58c8df,null));};exports[_0x436b('0x53')]=function(_0x3a8f89,_0x228435){return db[_0x436b('0x4c')][_0x436b('0x53')](_0x3a8f89[_0x436b('0x54')],{})[_0x436b('0x1d')](respondWithResult(_0x228435,0xc9))[_0x436b('0x26')](handleError(_0x228435,null));};exports['update']=function(_0x3c5e9e,_0x3d8869){if(_0x3c5e9e[_0x436b('0x54')]['id']){delete _0x3c5e9e[_0x436b('0x54')]['id'];}return db[_0x436b('0x4c')][_0x436b('0x52')]({'where':{'id':_0x3c5e9e[_0x436b('0x51')]['id']}})[_0x436b('0x1d')](handleEntityNotFound(_0x3d8869,null))[_0x436b('0x1d')](saveUpdates(_0x3c5e9e[_0x436b('0x54')],null))[_0x436b('0x1d')](respondWithResult(_0x3d8869,null))[_0x436b('0x26')](handleError(_0x3d8869,null));};exports[_0x436b('0x33')]=function(_0x515b17,_0x16fe3c){return db[_0x436b('0x4c')][_0x436b('0x52')]({'where':{'id':_0x515b17[_0x436b('0x51')]['id']}})[_0x436b('0x1d')](handleEntityNotFound(_0x16fe3c,null))[_0x436b('0x1d')](removeEntity(_0x16fe3c,null))[_0x436b('0x26')](handleError(_0x16fe3c,null));};exports[_0x436b('0x55')]=function(_0x23bbbb,_0x40341b,_0x3d93ec){var _0x1a2fb2={};var _0x3e169b={};var _0x204492;var _0x37d74c;return db[_0x436b('0x4c')][_0x436b('0x56')]({'where':{'id':_0x23bbbb[_0x436b('0x51')]['id']}})[_0x436b('0x1d')](handleEntityNotFound(_0x40341b,null))[_0x436b('0x1d')](function(_0x3e82dd){if(_0x3e82dd){_0x204492=_0x3e82dd;_0x3e169b['model']=_[_0x436b('0x3c')](db[_0x436b('0x57')][_0x436b('0x37')]);_0x3e169b[_0x436b('0x3b')]=_[_0x436b('0x3c')](_0x23bbbb[_0x436b('0x3b')]);_0x3e169b['filters']=_[_0x436b('0x3e')](_0x3e169b[_0x436b('0x3a')],_0x3e169b[_0x436b('0x3b')]);_0x1a2fb2['attributes']=_['intersection'](_0x3e169b[_0x436b('0x3a')],qs[_0x436b('0x40')](_0x23bbbb[_0x436b('0x3b')]['fields']));_0x1a2fb2[_0x436b('0x3f')]=_0x1a2fb2[_0x436b('0x3f')][_0x436b('0x41')]?_0x1a2fb2[_0x436b('0x3f')]:_0x3e169b[_0x436b('0x3a')];_0x1a2fb2['order']=qs['sort'](_0x23bbbb['query']['sort']);_0x1a2fb2['where']=qs['filters'](_[_0x436b('0x47')](_0x23bbbb[_0x436b('0x3b')],_0x3e169b['filters']));if(_0x23bbbb[_0x436b('0x3b')]['filter']){_0x1a2fb2['where']=_[_0x436b('0x49')](_0x1a2fb2[_0x436b('0x46')],{'$or':_[_0x436b('0x36')](_0x1a2fb2[_0x436b('0x3f')],function(_0xf084fa){var _0x8ddb9b={};_0x8ddb9b[_0xf084fa]={'$like':'%'+_0x23bbbb[_0x436b('0x3b')]['filter']+'%'};return _0x8ddb9b;})});}_0x1a2fb2=_['merge']({},_0x1a2fb2,_0x23bbbb[_0x436b('0x4b')]);return _0x204492[_0x436b('0x55')](_0x1a2fb2);}})[_0x436b('0x1d')](function(_0x313a44){if(_0x313a44){_0x37d74c=_0x313a44[_0x436b('0x41')];if(!_0x23bbbb[_0x436b('0x3b')][_0x436b('0x42')](_0x436b('0x43'))){_0x1a2fb2['limit']=qs[_0x436b('0x2b')](_0x23bbbb[_0x436b('0x3b')][_0x436b('0x2b')]);_0x1a2fb2[_0x436b('0x2a')]=qs[_0x436b('0x2a')](_0x23bbbb[_0x436b('0x3b')][_0x436b('0x2a')]);}return _0x204492[_0x436b('0x55')](_0x1a2fb2);}})[_0x436b('0x1d')](function(_0x540feb){if(_0x540feb){return _0x540feb?{'count':_0x37d74c,'rows':_0x540feb}:null;}})[_0x436b('0x1d')](respondWithResult(_0x40341b,null))['catch'](handleError(_0x40341b,null));};exports[_0x436b('0x58')]=function(_0x4e3e0f,_0x6ea799,_0x3a243c){var _0x20272f={};var _0x53a6f0={};var _0x1da27f;var _0x29c289;return db['DeskConfiguration'][_0x436b('0x56')]({'where':{'id':_0x4e3e0f[_0x436b('0x51')]['id']}})[_0x436b('0x1d')](handleEntityNotFound(_0x6ea799,null))[_0x436b('0x1d')](function(_0x1f8e3a){if(_0x1f8e3a){_0x1da27f=_0x1f8e3a;_0x53a6f0[_0x436b('0x3a')]=_[_0x436b('0x3c')](db[_0x436b('0x57')][_0x436b('0x37')]);_0x53a6f0[_0x436b('0x3b')]=_[_0x436b('0x3c')](_0x4e3e0f['query']);_0x53a6f0['filters']=_[_0x436b('0x3e')](_0x53a6f0[_0x436b('0x3a')],_0x53a6f0[_0x436b('0x3b')]);_0x20272f['attributes']=_[_0x436b('0x3e')](_0x53a6f0[_0x436b('0x3a')],qs['fields'](_0x4e3e0f[_0x436b('0x3b')][_0x436b('0x40')]));_0x20272f[_0x436b('0x3f')]=_0x20272f[_0x436b('0x3f')][_0x436b('0x41')]?_0x20272f['attributes']:_0x53a6f0[_0x436b('0x3a')];_0x20272f[_0x436b('0x44')]=qs[_0x436b('0x45')](_0x4e3e0f[_0x436b('0x3b')][_0x436b('0x45')]);_0x20272f[_0x436b('0x46')]=qs[_0x436b('0x3d')](_[_0x436b('0x47')](_0x4e3e0f[_0x436b('0x3b')],_0x53a6f0[_0x436b('0x3d')]));if(_0x4e3e0f[_0x436b('0x3b')][_0x436b('0x48')]){_0x20272f[_0x436b('0x46')]=_['merge'](_0x20272f[_0x436b('0x46')],{'$or':_[_0x436b('0x36')](_0x20272f['attributes'],function(_0x2c5e8f){var _0x4a4095={};_0x4a4095[_0x2c5e8f]={'$like':'%'+_0x4e3e0f[_0x436b('0x3b')][_0x436b('0x48')]+'%'};return _0x4a4095;})});}_0x20272f=_[_0x436b('0x49')]({},_0x20272f,_0x4e3e0f['options']);return _0x1da27f[_0x436b('0x58')](_0x20272f);}})[_0x436b('0x1d')](function(_0x13e10c){if(_0x13e10c){_0x29c289=_0x13e10c[_0x436b('0x41')];if(!_0x4e3e0f['query']['hasOwnProperty'](_0x436b('0x43'))){_0x20272f[_0x436b('0x2b')]=qs['limit'](_0x4e3e0f[_0x436b('0x3b')][_0x436b('0x2b')]);_0x20272f[_0x436b('0x2a')]=qs[_0x436b('0x2a')](_0x4e3e0f['query'][_0x436b('0x2a')]);}return _0x1da27f[_0x436b('0x58')](_0x20272f);}})[_0x436b('0x1d')](function(_0x285870){if(_0x285870){return _0x285870?{'count':_0x29c289,'rows':_0x285870}:null;}})[_0x436b('0x1d')](respondWithResult(_0x6ea799,null))[_0x436b('0x26')](handleError(_0x6ea799,null));};exports[_0x436b('0x59')]=function(_0x1ea724,_0x1a22c7,_0x4ed2b2){var _0xc09a7d={};var _0x1d3a38={};var _0x11eef3;var _0x4e6ad2;return db[_0x436b('0x4c')][_0x436b('0x56')]({'where':{'id':_0x1ea724['params']['id']}})[_0x436b('0x1d')](handleEntityNotFound(_0x1a22c7,null))[_0x436b('0x1d')](function(_0x1a193f){if(_0x1a193f){_0x11eef3=_0x1a193f;_0x1d3a38[_0x436b('0x3a')]=_['keys'](db[_0x436b('0x57')][_0x436b('0x37')]);_0x1d3a38[_0x436b('0x3b')]=_[_0x436b('0x3c')](_0x1ea724[_0x436b('0x3b')]);_0x1d3a38[_0x436b('0x3d')]=_[_0x436b('0x3e')](_0x1d3a38[_0x436b('0x3a')],_0x1d3a38[_0x436b('0x3b')]);_0xc09a7d[_0x436b('0x3f')]=_[_0x436b('0x3e')](_0x1d3a38[_0x436b('0x3a')],qs[_0x436b('0x40')](_0x1ea724[_0x436b('0x3b')][_0x436b('0x40')]));_0xc09a7d[_0x436b('0x3f')]=_0xc09a7d[_0x436b('0x3f')][_0x436b('0x41')]?_0xc09a7d['attributes']:_0x1d3a38['model'];_0xc09a7d[_0x436b('0x44')]=qs[_0x436b('0x45')](_0x1ea724['query'][_0x436b('0x45')]);_0xc09a7d[_0x436b('0x46')]=qs[_0x436b('0x3d')](_[_0x436b('0x47')](_0x1ea724[_0x436b('0x3b')],_0x1d3a38[_0x436b('0x3d')]));if(_0x1ea724['query']['filter']){_0xc09a7d['where']=_['merge'](_0xc09a7d[_0x436b('0x46')],{'$or':_[_0x436b('0x36')](_0xc09a7d['attributes'],function(_0x474756){var _0x2ce9df={};_0x2ce9df[_0x474756]={'$like':'%'+_0x1ea724[_0x436b('0x3b')]['filter']+'%'};return _0x2ce9df;})});}_0xc09a7d=_['merge']({},_0xc09a7d,_0x1ea724[_0x436b('0x4b')]);return _0x11eef3[_0x436b('0x59')](_0xc09a7d);}})[_0x436b('0x1d')](function(_0x85dc39){if(_0x85dc39){_0x4e6ad2=_0x85dc39[_0x436b('0x41')];if(!_0x1ea724[_0x436b('0x3b')][_0x436b('0x42')](_0x436b('0x43'))){_0xc09a7d[_0x436b('0x2b')]=qs[_0x436b('0x2b')](_0x1ea724[_0x436b('0x3b')]['limit']);_0xc09a7d[_0x436b('0x2a')]=qs['offset'](_0x1ea724[_0x436b('0x3b')][_0x436b('0x2a')]);}return _0x11eef3[_0x436b('0x59')](_0xc09a7d);}})[_0x436b('0x1d')](function(_0xf2234c){if(_0xf2234c){return _0xf2234c?{'count':_0x4e6ad2,'rows':_0xf2234c}:null;}})['then'](respondWithResult(_0x1a22c7,null))[_0x436b('0x26')](handleError(_0x1a22c7,null));};exports[_0x436b('0x5a')]=function(_0x1f99f9,_0x3e934d,_0x5ac3d1){var _0x39e130={};var _0x165e4f={};var _0x5e1c3d;var _0x207d90;return db[_0x436b('0x4c')][_0x436b('0x56')]({'where':{'id':_0x1f99f9[_0x436b('0x51')]['id']}})[_0x436b('0x1d')](handleEntityNotFound(_0x3e934d,null))['then'](function(_0x48311f){if(_0x48311f){_0x5e1c3d=_0x48311f;_0x165e4f[_0x436b('0x3a')]=_['keys'](db[_0x436b('0x5b')][_0x436b('0x37')]);_0x165e4f[_0x436b('0x3b')]=_[_0x436b('0x3c')](_0x1f99f9['query']);_0x165e4f[_0x436b('0x3d')]=_[_0x436b('0x3e')](_0x165e4f[_0x436b('0x3a')],_0x165e4f['query']);_0x39e130[_0x436b('0x3f')]=_[_0x436b('0x3e')](_0x165e4f[_0x436b('0x3a')],qs[_0x436b('0x40')](_0x1f99f9[_0x436b('0x3b')][_0x436b('0x40')]));_0x39e130[_0x436b('0x3f')]=_0x39e130[_0x436b('0x3f')][_0x436b('0x41')]?_0x39e130[_0x436b('0x3f')]:_0x165e4f[_0x436b('0x3a')];_0x39e130[_0x436b('0x44')]=qs[_0x436b('0x45')](_0x1f99f9['query'][_0x436b('0x45')]);_0x39e130['where']=qs['filters'](_[_0x436b('0x47')](_0x1f99f9['query'],_0x165e4f['filters']));if(_0x1f99f9[_0x436b('0x3b')][_0x436b('0x48')]){_0x39e130['where']=_[_0x436b('0x49')](_0x39e130[_0x436b('0x46')],{'$or':_[_0x436b('0x36')](_0x39e130['attributes'],function(_0x641bbd){var _0x3a08f9={};_0x3a08f9[_0x641bbd]={'$like':'%'+_0x1f99f9['query']['filter']+'%'};return _0x3a08f9;})});}_0x39e130=_['merge']({},_0x39e130,_0x1f99f9[_0x436b('0x4b')]);return _0x5e1c3d[_0x436b('0x5a')](_0x39e130);}})[_0x436b('0x1d')](function(_0x3b4361){if(_0x3b4361){_0x207d90=_0x3b4361[_0x436b('0x41')];if(!_0x1f99f9[_0x436b('0x3b')][_0x436b('0x42')]('nolimit')){_0x39e130[_0x436b('0x2b')]=qs['limit'](_0x1f99f9['query'][_0x436b('0x2b')]);_0x39e130[_0x436b('0x2a')]=qs[_0x436b('0x2a')](_0x1f99f9[_0x436b('0x3b')][_0x436b('0x2a')]);}return _0x5e1c3d[_0x436b('0x5a')](_0x39e130);}})[_0x436b('0x1d')](function(_0x371d43){if(_0x371d43){return _0x371d43?{'count':_0x207d90,'rows':_0x371d43}:null;}})[_0x436b('0x1d')](respondWithResult(_0x3e934d,null))[_0x436b('0x26')](handleError(_0x3e934d,null));};exports['setTags']=function(_0x5cf783,_0xa940a4,_0x591afd){if(_0x5cf783[_0x436b('0x54')]['id']){delete _0x5cf783[_0x436b('0x54')]['id'];}return db[_0x436b('0x4c')]['findOne']({'where':{'id':_0x5cf783['params']['id']}})['then'](handleEntityNotFound(_0xa940a4,null))[_0x436b('0x1d')](function(_0x3769b3){if(_0x3769b3){return _0x3769b3[_0x436b('0x5c')](_0x5cf783[_0x436b('0x54')]['ids']||[]);}return null;})[_0x436b('0x1d')](respondWithResult(_0xa940a4,null))[_0x436b('0x26')](handleError(_0xa940a4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index dd83ed8..51deeec 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9823=['define','DeskConfiguration','int_desk_configurations','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x9823,0x1a5));var _0x3982=function(_0x13cbb5,_0x344699){_0x13cbb5=_0x13cbb5-0x0;var _0x226191=_0x9823[_0x13cbb5];return _0x226191;};'use strict';var _=require('lodash');var util=require(_0x3982('0x0'));var logger=require(_0x3982('0x1'))('api');var moment=require(_0x3982('0x2'));var BPromise=require('bluebird');var rp=require(_0x3982('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3982('0x4'));var config=require(_0x3982('0x5'));var attributes=require(_0x3982('0x6'));module[_0x3982('0x7')]=function(_0x588604,_0x35c387){return _0x588604[_0x3982('0x8')](_0x3982('0x9'),attributes,{'tableName':_0x3982('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8258=['path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','util','../../config/logger','moment','bluebird'];(function(_0x53b133,_0x176261){var _0x5647e0=function(_0x4c62b0){while(--_0x4c62b0){_0x53b133['push'](_0x53b133['shift']());}};_0x5647e0(++_0x176261);}(_0x8258,0x1a0));var _0x8825=function(_0x2d5537,_0x2bdf8e){_0x2d5537=_0x2d5537-0x0;var _0x1a1dbd=_0x8258[_0x2d5537];return _0x1a1dbd;};'use strict';var _=require('lodash');var util=require(_0x8825('0x0'));var logger=require(_0x8825('0x1'))('api');var moment=require(_0x8825('0x2'));var BPromise=require(_0x8825('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8825('0x4'));var rimraf=require(_0x8825('0x5'));var config=require(_0x8825('0x6'));var attributes=require(_0x8825('0x7'));module[_0x8825('0x8')]=function(_0x30c47d,_0x4a5db0){return _0x30c47d['define'](_0x8825('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 3a3b2f9..6ff6181 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bdf=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x113e94,_0xdc341b){var _0x33e6de=function(_0x31712e){while(--_0x31712e){_0x113e94['push'](_0x113e94['shift']());}};_0x33e6de(++_0xdc341b);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8bdf[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xf8bd('0x0'));var util=require(_0xf8bd('0x1'));var moment=require(_0xf8bd('0x2'));var BPromise=require(_0xf8bd('0x3'));var rs=require(_0xf8bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8bd('0x5'))['db'];var utils=require(_0xf8bd('0x6'));var logger=require(_0xf8bd('0x7'))(_0xf8bd('0x8'));var config=require(_0xf8bd('0x9'));var jayson=require(_0xf8bd('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x504c82,_0x3ee99e,_0x22a277){return new BPromise(function(_0x3e1db1,_0x424831){return client['request'](_0x504c82,_0x22a277)[_0xf8bd('0xb')](function(_0x3d10d3){logger['info'](_0xf8bd('0xc'),_0x3ee99e,_0xf8bd('0xd'));logger['debug'](_0xf8bd('0xe'),_0x3ee99e,_0xf8bd('0xd'),JSON[_0xf8bd('0xf')](_0x3d10d3));if(_0x3d10d3[_0xf8bd('0x10')]){if(_0x3d10d3['error'][_0xf8bd('0x11')]===0x1f4){logger[_0xf8bd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3ee99e,_0x3d10d3[_0xf8bd('0x10')]['message']);return _0x424831(_0x3d10d3[_0xf8bd('0x10')][_0xf8bd('0x12')]);}logger[_0xf8bd('0x10')](_0xf8bd('0xc'),_0x3ee99e,_0x3d10d3[_0xf8bd('0x10')][_0xf8bd('0x12')]);return _0x3e1db1(_0x3d10d3['error']['message']);}else{logger['info'](_0xf8bd('0xc'),_0x3ee99e,_0xf8bd('0xd'));_0x3e1db1(_0x3d10d3['result'][_0xf8bd('0x12')]);}})[_0xf8bd('0x13')](function(_0x1bd8c6){logger[_0xf8bd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3ee99e,_0x1bd8c6);_0x424831(_0x1bd8c6);});});} \ No newline at end of file +var _0xdf0c=['http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x191b1a,_0x48e0e6){var _0x283089=function(_0x4f6574){while(--_0x4f6574){_0x191b1a['push'](_0x191b1a['shift']());}};_0x283089(++_0x48e0e6);}(_0xdf0c,0x1ab));var _0xcdf0=function(_0x49e444,_0x1afd8f){_0x49e444=_0x49e444-0x0;var _0x3d578e=_0xdf0c[_0x49e444];return _0x3d578e;};'use strict';var _=require(_0xcdf0('0x0'));var util=require('util');var moment=require(_0xcdf0('0x1'));var BPromise=require(_0xcdf0('0x2'));var rs=require(_0xcdf0('0x3'));var fs=require('fs');var Redis=require(_0xcdf0('0x4'));var db=require(_0xcdf0('0x5'))['db'];var utils=require(_0xcdf0('0x6'));var logger=require(_0xcdf0('0x7'))('rpc');var config=require(_0xcdf0('0x8'));var jayson=require(_0xcdf0('0x9'));var client=jayson['client'][_0xcdf0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe282be,_0x23b3a0,_0x5b39b8){return new BPromise(function(_0x62e18,_0x1ac036){return client[_0xcdf0('0xb')](_0xe282be,_0x5b39b8)[_0xcdf0('0xc')](function(_0x4aec53){logger[_0xcdf0('0xd')](_0xcdf0('0xe'),_0x23b3a0,_0xcdf0('0xf'));logger[_0xcdf0('0x10')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x23b3a0,_0xcdf0('0xf'),JSON[_0xcdf0('0x11')](_0x4aec53));if(_0x4aec53[_0xcdf0('0x12')]){if(_0x4aec53[_0xcdf0('0x12')][_0xcdf0('0x13')]===0x1f4){logger['error'](_0xcdf0('0xe'),_0x23b3a0,_0x4aec53[_0xcdf0('0x12')][_0xcdf0('0x14')]);return _0x1ac036(_0x4aec53['error'][_0xcdf0('0x14')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x23b3a0,_0x4aec53[_0xcdf0('0x12')][_0xcdf0('0x14')]);return _0x62e18(_0x4aec53['error'][_0xcdf0('0x14')]);}else{logger[_0xcdf0('0xd')](_0xcdf0('0xe'),_0x23b3a0,_0xcdf0('0xf'));_0x62e18(_0x4aec53[_0xcdf0('0x15')][_0xcdf0('0x14')]);}})[_0xcdf0('0x16')](function(_0x2d6627){logger[_0xcdf0('0x12')](_0xcdf0('0xe'),_0x23b3a0,_0x2d6627);_0x1ac036(_0x2d6627);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 3657fe4..e453981 100644 --- a/server/api/intDeskField/index.js +++ b/server/api/intDeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9dd5=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x9dd5,0x18b));var _0x59dd=function(_0x3712b2,_0x2504ea){_0x3712b2=_0x3712b2-0x0;var _0x4fd777=_0x9dd5[_0x3712b2];return _0x4fd777;};'use strict';var multer=require(_0x59dd('0x0'));var util=require(_0x59dd('0x1'));var path=require(_0x59dd('0x2'));var timeout=require(_0x59dd('0x3'));var express=require(_0x59dd('0x4'));var router=express[_0x59dd('0x5')]();var auth=require(_0x59dd('0x6'));var interaction=require(_0x59dd('0x7'));var config=require(_0x59dd('0x8'));var controller=require('./intDeskField.controller');router[_0x59dd('0x9')]('/',auth[_0x59dd('0xa')](),controller['index']);router[_0x59dd('0x9')](_0x59dd('0xb'),auth[_0x59dd('0xa')](),controller[_0x59dd('0xc')]);router[_0x59dd('0xd')]('/',auth[_0x59dd('0xa')](),controller[_0x59dd('0xe')]);router[_0x59dd('0xf')](_0x59dd('0xb'),auth[_0x59dd('0xa')](),controller[_0x59dd('0x10')]);router['delete'](_0x59dd('0xb'),auth['isAuthenticated'](),controller[_0x59dd('0x11')]);module[_0x59dd('0x12')]=router; \ No newline at end of file +var _0xd4d6=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete'];(function(_0xd9c47c,_0x127945){var _0x22add5=function(_0xeb6a15){while(--_0xeb6a15){_0xd9c47c['push'](_0xd9c47c['shift']());}};_0x22add5(++_0x127945);}(_0xd4d6,0xd2));var _0x6d4d=function(_0x3278ed,_0x34ff3d){_0x3278ed=_0x3278ed-0x0;var _0x5a8e2e=_0xd4d6[_0x3278ed];return _0x5a8e2e;};'use strict';var multer=require(_0x6d4d('0x0'));var util=require(_0x6d4d('0x1'));var path=require(_0x6d4d('0x2'));var timeout=require(_0x6d4d('0x3'));var express=require(_0x6d4d('0x4'));var router=express[_0x6d4d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6d4d('0x6'));var config=require(_0x6d4d('0x7'));var controller=require(_0x6d4d('0x8'));router['get']('/',auth[_0x6d4d('0x9')](),controller[_0x6d4d('0xa')]);router[_0x6d4d('0xb')]('/:id',auth[_0x6d4d('0x9')](),controller['show']);router[_0x6d4d('0xc')]('/',auth[_0x6d4d('0x9')](),controller[_0x6d4d('0xd')]);router[_0x6d4d('0xe')](_0x6d4d('0xf'),auth[_0x6d4d('0x9')](),controller[_0x6d4d('0x10')]);router[_0x6d4d('0x11')](_0x6d4d('0xf'),auth[_0x6d4d('0x9')](),controller['destroy']);module[_0x6d4d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 6a1831d..c172772 100644 --- a/server/api/intDeskField/intDeskField.attributes.js +++ b/server/api/intDeskField/intDeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2ad=['STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x1dcebc,_0x512af9){var _0x1de025=function(_0x1da73d){while(--_0x1da73d){_0x1dcebc['push'](_0x1dcebc['shift']());}};_0x1de025(++_0x512af9);}(_0xf2ad,0x112));var _0xdf2a=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0xf2ad[_0x35ef6b];return _0x3ad145;};'use strict';var Sequelize=require(_0xdf2a('0x0'));module[_0xdf2a('0x1')]={'type':{'type':Sequelize['ENUM'](_0xdf2a('0x2'),_0xdf2a('0x3'),_0xdf2a('0x4'),_0xdf2a('0x5')),'defaultValue':_0xdf2a('0x2')},'content':{'type':Sequelize[_0xdf2a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xdf2a('0x2'),_0xdf2a('0x3'),_0xdf2a('0x4'))},'keyContent':{'type':Sequelize[_0xdf2a('0x6')]},'idField':{'type':Sequelize[_0xdf2a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdf2a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdf2a('0x6')]}}; \ No newline at end of file +var _0x1c94=['customVariable','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x2bf0bb,_0x56c4e9){var _0x2304e2=function(_0x27e5a2){while(--_0x27e5a2){_0x2bf0bb['push'](_0x2bf0bb['shift']());}};_0x2304e2(++_0x56c4e9);}(_0x1c94,0x164));var _0x41c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c94[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x41c9('0x0'));module[_0x41c9('0x1')]={'type':{'type':Sequelize[_0x41c9('0x2')]('string',_0x41c9('0x3'),_0x41c9('0x4'),'keyValue'),'defaultValue':_0x41c9('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x41c9('0x2')](_0x41c9('0x5'),_0x41c9('0x3'),_0x41c9('0x4'))},'keyContent':{'type':Sequelize[_0x41c9('0x6')]},'idField':{'type':Sequelize[_0x41c9('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x41c9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index a019f01..7c54184 100644 --- a/server/api/intDeskField/intDeskField.controller.js +++ b/server/api/intDeskField/intDeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3561=['html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','params','keys','options','find','create','body'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0x3561,0x94));var _0x1356=function(_0x5256e7,_0x4d2302){_0x5256e7=_0x5256e7-0x0;var _0x2cc404=_0x3561[_0x5256e7];return _0x2cc404;};'use strict';var pdf=require(_0x1356('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1356('0x1'));var zipdir=require(_0x1356('0x2'));var jsonpatch=require(_0x1356('0x3'));var rp=require(_0x1356('0x4'));var moment=require(_0x1356('0x5'));var BPromise=require(_0x1356('0x6'));var Mustache=require(_0x1356('0x7'));var util=require(_0x1356('0x8'));var path=require(_0x1356('0x9'));var sox=require(_0x1356('0xa'));var csv=require(_0x1356('0xb'));var ejs=require(_0x1356('0xc'));var fs=require('fs');var _=require(_0x1356('0xd'));var squel=require('squel');var crypto=require(_0x1356('0xe'));var jsforce=require(_0x1356('0xf'));var deskjs=require(_0x1356('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1356('0x11'));var Redis=require(_0x1356('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1356('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1356('0x14'));var logger=require(_0x1356('0x15'))('api');var utils=require(_0x1356('0x16'));var config=require(_0x1356('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x405e5c,_0x457d18){_0x457d18=_0x457d18||0xcc;return function(_0x466604){if(_0x466604){return _0x405e5c[_0x1356('0x18')](_0x457d18);}return _0x405e5c[_0x1356('0x19')](_0x457d18)[_0x1356('0x1a')]();};}function respondWithResult(_0x70c471,_0x3c8b32){_0x3c8b32=_0x3c8b32||0xc8;return function(_0x365fb0){if(_0x365fb0){return _0x70c471[_0x1356('0x19')](_0x3c8b32)[_0x1356('0x1b')](_0x365fb0);}};}function respondWithFilteredResult(_0xdeeff2,_0x58975b){return function(_0x47a952){if(_0x47a952){var _0x593f6d=_0x47a952['count'],_0x61991a=_0x58975b[_0x1356('0x1c')],_0x3c2adc=_0x58975b[_0x1356('0x1c')]+_0x58975b[_0x1356('0x1d')],_0x11fdf2;if(_0x3c2adc>=_0x593f6d){_0x3c2adc=_0x593f6d;_0x11fdf2=0xc8;}else{_0x11fdf2=0xce;}_0xdeeff2[_0x1356('0x19')](_0x11fdf2);return _0xdeeff2[_0x1356('0x1e')](_0x1356('0x1f'),_0x61991a+'-'+_0x3c2adc+'/'+_0x593f6d)[_0x1356('0x1b')](_0x47a952);}return null;};}function patchUpdates(_0x210b85){return function(_0x345b24){try{jsonpatch[_0x1356('0x20')](_0x345b24,_0x210b85,!![]);}catch(_0x8ff03f){return BPromise[_0x1356('0x21')](_0x8ff03f);}return _0x345b24[_0x1356('0x22')]();};}function saveUpdates(_0x54c1a6,_0x368fea){return function(_0x5b958c){if(_0x5b958c){return _0x5b958c[_0x1356('0x23')](_0x54c1a6)['then'](function(_0x420dd6){return _0x420dd6;});}return null;};}function removeEntity(_0x36adc3,_0x2f1581){return function(_0x377fe7){if(_0x377fe7){return _0x377fe7[_0x1356('0x24')]()[_0x1356('0x25')](function(){_0x36adc3['status'](0xcc)[_0x1356('0x1a')]();});}};}function handleEntityNotFound(_0x2c26be,_0x53eca1){return function(_0xf0a5e9){if(!_0xf0a5e9){_0x2c26be[_0x1356('0x18')](0x194);}return _0xf0a5e9;};}function handleError(_0x3ed9bb,_0x56c0de){_0x56c0de=_0x56c0de||0x1f4;return function(_0xc153ed){logger[_0x1356('0x26')](_0xc153ed[_0x1356('0x27')]);if(_0xc153ed[_0x1356('0x28')]){delete _0xc153ed['name'];}_0x3ed9bb['status'](_0x56c0de)[_0x1356('0x29')](_0xc153ed);};}exports['index']=function(_0x9961c3,_0x3967f9){var _0x210f88={},_0x3035eb={},_0x39796b={'count':0x0,'rows':[]};var _0x5867d8=_[_0x1356('0x2a')](db[_0x1356('0x2b')][_0x1356('0x2c')],function(_0x261710){return{'name':_0x261710[_0x1356('0x2d')],'type':_0x261710[_0x1356('0x2e')]['key']};});_0x3035eb[_0x1356('0x2f')]=_['map'](_0x5867d8,_0x1356('0x28'));_0x3035eb['query']=_['keys'](_0x9961c3[_0x1356('0x30')]);_0x3035eb[_0x1356('0x31')]=_['intersection'](_0x3035eb[_0x1356('0x2f')],_0x3035eb[_0x1356('0x30')]);_0x210f88[_0x1356('0x32')]=_[_0x1356('0x33')](_0x3035eb[_0x1356('0x2f')],qs[_0x1356('0x34')](_0x9961c3[_0x1356('0x30')]['fields']));_0x210f88[_0x1356('0x32')]=_0x210f88[_0x1356('0x32')][_0x1356('0x35')]?_0x210f88[_0x1356('0x32')]:_0x3035eb['model'];if(!_0x9961c3[_0x1356('0x30')][_0x1356('0x36')](_0x1356('0x37'))){_0x210f88[_0x1356('0x1d')]=qs[_0x1356('0x1d')](_0x9961c3['query'][_0x1356('0x1d')]);_0x210f88['offset']=qs[_0x1356('0x1c')](_0x9961c3[_0x1356('0x30')][_0x1356('0x1c')]);}_0x210f88[_0x1356('0x38')]=qs[_0x1356('0x39')](_0x9961c3[_0x1356('0x30')][_0x1356('0x39')]);_0x210f88['where']=qs[_0x1356('0x31')](_[_0x1356('0x3a')](_0x9961c3[_0x1356('0x30')],_0x3035eb[_0x1356('0x31')]));if(_0x9961c3['query'][_0x1356('0x3b')]){_0x210f88['where']=_[_0x1356('0x3c')](_0x210f88['where'],{'$or':_[_0x1356('0x2a')](_0x5867d8,function(_0x37925c){if(_0x37925c['type']!==_0x1356('0x3d')){var _0x58cce3={};_0x58cce3[_0x37925c[_0x1356('0x28')]]={'$like':'%'+_0x9961c3[_0x1356('0x30')][_0x1356('0x3b')]+'%'};return _0x58cce3;}})});}_0x210f88=_[_0x1356('0x3c')]({},_0x210f88,_0x9961c3['options']);var _0x333a5b={'where':_0x210f88['where']};return db[_0x1356('0x2b')][_0x1356('0x3e')](_0x333a5b)[_0x1356('0x25')](function(_0x400820){_0x39796b[_0x1356('0x3e')]=_0x400820;if(_0x9961c3[_0x1356('0x30')][_0x1356('0x3f')]){_0x210f88[_0x1356('0x40')]=[{'all':!![]}];}return db[_0x1356('0x2b')][_0x1356('0x41')](_0x210f88);})[_0x1356('0x25')](function(_0x3459e2){_0x39796b[_0x1356('0x42')]=_0x3459e2;return _0x39796b;})[_0x1356('0x25')](respondWithFilteredResult(_0x3967f9,_0x210f88))['catch'](handleError(_0x3967f9,null));};exports[_0x1356('0x43')]=function(_0x27f193,_0xa65ce2){var _0x36ee6a={'raw':!![],'where':{'id':_0x27f193[_0x1356('0x44')]['id']}},_0x21559e={};_0x21559e[_0x1356('0x2f')]=_[_0x1356('0x45')](db['DeskField']['rawAttributes']);_0x21559e[_0x1356('0x30')]=_[_0x1356('0x45')](_0x27f193['query']);_0x21559e[_0x1356('0x31')]=_[_0x1356('0x33')](_0x21559e[_0x1356('0x2f')],_0x21559e[_0x1356('0x30')]);_0x36ee6a[_0x1356('0x32')]=_[_0x1356('0x33')](_0x21559e[_0x1356('0x2f')],qs[_0x1356('0x34')](_0x27f193['query'][_0x1356('0x34')]));_0x36ee6a['attributes']=_0x36ee6a[_0x1356('0x32')][_0x1356('0x35')]?_0x36ee6a[_0x1356('0x32')]:_0x21559e[_0x1356('0x2f')];if(_0x27f193[_0x1356('0x30')]['includeAll']){_0x36ee6a['include']=[{'all':!![]}];}_0x36ee6a=_[_0x1356('0x3c')]({},_0x36ee6a,_0x27f193[_0x1356('0x46')]);return db[_0x1356('0x2b')][_0x1356('0x47')](_0x36ee6a)[_0x1356('0x25')](handleEntityNotFound(_0xa65ce2,null))[_0x1356('0x25')](respondWithResult(_0xa65ce2,null))['catch'](handleError(_0xa65ce2,null));};exports[_0x1356('0x48')]=function(_0x570603,_0x4d7353){return db[_0x1356('0x2b')][_0x1356('0x48')](_0x570603[_0x1356('0x49')],{})[_0x1356('0x25')](respondWithResult(_0x4d7353,0xc9))['catch'](handleError(_0x4d7353,null));};exports[_0x1356('0x23')]=function(_0xe8714d,_0x197272){if(_0xe8714d[_0x1356('0x49')]['id']){delete _0xe8714d['body']['id'];}return db['DeskField'][_0x1356('0x47')]({'where':{'id':_0xe8714d[_0x1356('0x44')]['id']}})[_0x1356('0x25')](handleEntityNotFound(_0x197272,null))[_0x1356('0x25')](saveUpdates(_0xe8714d[_0x1356('0x49')],null))[_0x1356('0x25')](respondWithResult(_0x197272,null))['catch'](handleError(_0x197272,null));};exports[_0x1356('0x24')]=function(_0x183425,_0x532205){return db[_0x1356('0x2b')][_0x1356('0x47')]({'where':{'id':_0x183425[_0x1356('0x44')]['id']}})[_0x1356('0x25')](handleEntityNotFound(_0x532205,null))['then'](removeEntity(_0x532205,null))['catch'](handleError(_0x532205,null));}; \ No newline at end of file +var _0x0a9a=['rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','map','DeskField'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x0a9a,0x183));var _0xa0a9=function(_0x5a3eeb,_0x35a385){_0x5a3eeb=_0x5a3eeb-0x0;var _0x499c4c=_0x0a9a[_0x5a3eeb];return _0x499c4c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa0a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa0a9('0x1'));var jsonpatch=require(_0xa0a9('0x2'));var rp=require(_0xa0a9('0x3'));var moment=require(_0xa0a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa0a9('0x5'));var util=require(_0xa0a9('0x6'));var path=require('path');var sox=require(_0xa0a9('0x7'));var csv=require(_0xa0a9('0x8'));var ejs=require(_0xa0a9('0x9'));var fs=require('fs');var _=require(_0xa0a9('0xa'));var squel=require('squel');var crypto=require(_0xa0a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa0a9('0xc'));var toCsv=require(_0xa0a9('0x8'));var querystring=require(_0xa0a9('0xd'));var Papa=require(_0xa0a9('0xe'));var Redis=require('ioredis');var authService=require(_0xa0a9('0xf'));var qs=require(_0xa0a9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0a9('0x11'))(_0xa0a9('0x12'));var utils=require('../../config/utils');var config=require(_0xa0a9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c39ff,_0x4b7913){_0x4b7913=_0x4b7913||0xcc;return function(_0xb87a94){if(_0xb87a94){return _0x1c39ff[_0xa0a9('0x14')](_0x4b7913);}return _0x1c39ff[_0xa0a9('0x15')](_0x4b7913)[_0xa0a9('0x16')]();};}function respondWithResult(_0x13833c,_0x4fac40){_0x4fac40=_0x4fac40||0xc8;return function(_0x1f3f23){if(_0x1f3f23){return _0x13833c[_0xa0a9('0x15')](_0x4fac40)[_0xa0a9('0x17')](_0x1f3f23);}};}function respondWithFilteredResult(_0x25ac6d,_0x2f8b3c){return function(_0x1a7b8a){if(_0x1a7b8a){var _0x5a6693=_0x1a7b8a[_0xa0a9('0x18')],_0x176faa=_0x2f8b3c[_0xa0a9('0x19')],_0x48c315=_0x2f8b3c[_0xa0a9('0x19')]+_0x2f8b3c[_0xa0a9('0x1a')],_0x4a57dd;if(_0x48c315>=_0x5a6693){_0x48c315=_0x5a6693;_0x4a57dd=0xc8;}else{_0x4a57dd=0xce;}_0x25ac6d['status'](_0x4a57dd);return _0x25ac6d[_0xa0a9('0x1b')](_0xa0a9('0x1c'),_0x176faa+'-'+_0x48c315+'/'+_0x5a6693)[_0xa0a9('0x17')](_0x1a7b8a);}return null;};}function patchUpdates(_0x27f8d4){return function(_0x292240){try{jsonpatch[_0xa0a9('0x1d')](_0x292240,_0x27f8d4,!![]);}catch(_0x5c82ed){return BPromise[_0xa0a9('0x1e')](_0x5c82ed);}return _0x292240[_0xa0a9('0x1f')]();};}function saveUpdates(_0x4a8e80,_0x53b99d){return function(_0x465d60){if(_0x465d60){return _0x465d60[_0xa0a9('0x20')](_0x4a8e80)[_0xa0a9('0x21')](function(_0x54a9a9){return _0x54a9a9;});}return null;};}function removeEntity(_0x307d7e,_0x4e6f4c){return function(_0x1fb36b){if(_0x1fb36b){return _0x1fb36b['destroy']()[_0xa0a9('0x21')](function(){_0x307d7e[_0xa0a9('0x15')](0xcc)[_0xa0a9('0x16')]();});}};}function handleEntityNotFound(_0x305747,_0x4938da){return function(_0x423d3a){if(!_0x423d3a){_0x305747['sendStatus'](0x194);}return _0x423d3a;};}function handleError(_0x20b318,_0x1f78e1){_0x1f78e1=_0x1f78e1||0x1f4;return function(_0x1f5fd8){logger[_0xa0a9('0x22')](_0x1f5fd8['stack']);if(_0x1f5fd8[_0xa0a9('0x23')]){delete _0x1f5fd8[_0xa0a9('0x23')];}_0x20b318[_0xa0a9('0x15')](_0x1f78e1)[_0xa0a9('0x24')](_0x1f5fd8);};}exports['index']=function(_0x35a915,_0x38e454){var _0x2eae30={},_0x5c446e={},_0x54125d={'count':0x0,'rows':[]};var _0x2b3cbb=_[_0xa0a9('0x25')](db[_0xa0a9('0x26')][_0xa0a9('0x27')],function(_0x4685c5){return{'name':_0x4685c5[_0xa0a9('0x28')],'type':_0x4685c5[_0xa0a9('0x29')][_0xa0a9('0x2a')]};});_0x5c446e[_0xa0a9('0x2b')]=_[_0xa0a9('0x25')](_0x2b3cbb,_0xa0a9('0x23'));_0x5c446e['query']=_[_0xa0a9('0x2c')](_0x35a915[_0xa0a9('0x2d')]);_0x5c446e['filters']=_[_0xa0a9('0x2e')](_0x5c446e[_0xa0a9('0x2b')],_0x5c446e['query']);_0x2eae30['attributes']=_[_0xa0a9('0x2e')](_0x5c446e['model'],qs['fields'](_0x35a915[_0xa0a9('0x2d')][_0xa0a9('0x2f')]));_0x2eae30[_0xa0a9('0x30')]=_0x2eae30[_0xa0a9('0x30')][_0xa0a9('0x31')]?_0x2eae30[_0xa0a9('0x30')]:_0x5c446e[_0xa0a9('0x2b')];if(!_0x35a915['query'][_0xa0a9('0x32')](_0xa0a9('0x33'))){_0x2eae30['limit']=qs[_0xa0a9('0x1a')](_0x35a915[_0xa0a9('0x2d')][_0xa0a9('0x1a')]);_0x2eae30['offset']=qs['offset'](_0x35a915[_0xa0a9('0x2d')][_0xa0a9('0x19')]);}_0x2eae30[_0xa0a9('0x34')]=qs[_0xa0a9('0x35')](_0x35a915['query'][_0xa0a9('0x35')]);_0x2eae30[_0xa0a9('0x36')]=qs[_0xa0a9('0x37')](_['pick'](_0x35a915[_0xa0a9('0x2d')],_0x5c446e[_0xa0a9('0x37')]));if(_0x35a915[_0xa0a9('0x2d')]['filter']){_0x2eae30[_0xa0a9('0x36')]=_[_0xa0a9('0x38')](_0x2eae30[_0xa0a9('0x36')],{'$or':_[_0xa0a9('0x25')](_0x2b3cbb,function(_0x2e11dc){if(_0x2e11dc[_0xa0a9('0x29')]!==_0xa0a9('0x39')){var _0xcf2461={};_0xcf2461[_0x2e11dc[_0xa0a9('0x23')]]={'$like':'%'+_0x35a915[_0xa0a9('0x2d')][_0xa0a9('0x3a')]+'%'};return _0xcf2461;}})});}_0x2eae30=_[_0xa0a9('0x38')]({},_0x2eae30,_0x35a915[_0xa0a9('0x3b')]);var _0x1574cd={'where':_0x2eae30[_0xa0a9('0x36')]};return db[_0xa0a9('0x26')][_0xa0a9('0x18')](_0x1574cd)['then'](function(_0x3f1e4f){_0x54125d[_0xa0a9('0x18')]=_0x3f1e4f;if(_0x35a915[_0xa0a9('0x2d')]['includeAll']){_0x2eae30[_0xa0a9('0x3c')]=[{'all':!![]}];}return db[_0xa0a9('0x26')][_0xa0a9('0x3d')](_0x2eae30);})[_0xa0a9('0x21')](function(_0x48993c){_0x54125d[_0xa0a9('0x3e')]=_0x48993c;return _0x54125d;})[_0xa0a9('0x21')](respondWithFilteredResult(_0x38e454,_0x2eae30))[_0xa0a9('0x3f')](handleError(_0x38e454,null));};exports[_0xa0a9('0x40')]=function(_0x38be3f,_0x5b6dca){var _0x373b95={'raw':!![],'where':{'id':_0x38be3f[_0xa0a9('0x41')]['id']}},_0x20d689={};_0x20d689[_0xa0a9('0x2b')]=_[_0xa0a9('0x2c')](db['DeskField'][_0xa0a9('0x27')]);_0x20d689[_0xa0a9('0x2d')]=_[_0xa0a9('0x2c')](_0x38be3f[_0xa0a9('0x2d')]);_0x20d689[_0xa0a9('0x37')]=_['intersection'](_0x20d689[_0xa0a9('0x2b')],_0x20d689[_0xa0a9('0x2d')]);_0x373b95['attributes']=_['intersection'](_0x20d689[_0xa0a9('0x2b')],qs[_0xa0a9('0x2f')](_0x38be3f[_0xa0a9('0x2d')][_0xa0a9('0x2f')]));_0x373b95['attributes']=_0x373b95[_0xa0a9('0x30')][_0xa0a9('0x31')]?_0x373b95[_0xa0a9('0x30')]:_0x20d689[_0xa0a9('0x2b')];if(_0x38be3f[_0xa0a9('0x2d')][_0xa0a9('0x42')]){_0x373b95[_0xa0a9('0x3c')]=[{'all':!![]}];}_0x373b95=_[_0xa0a9('0x38')]({},_0x373b95,_0x38be3f[_0xa0a9('0x3b')]);return db[_0xa0a9('0x26')][_0xa0a9('0x43')](_0x373b95)[_0xa0a9('0x21')](handleEntityNotFound(_0x5b6dca,null))[_0xa0a9('0x21')](respondWithResult(_0x5b6dca,null))[_0xa0a9('0x3f')](handleError(_0x5b6dca,null));};exports[_0xa0a9('0x44')]=function(_0x1f1178,_0x1bd660){return db['DeskField'][_0xa0a9('0x44')](_0x1f1178['body'],{})[_0xa0a9('0x21')](respondWithResult(_0x1bd660,0xc9))[_0xa0a9('0x3f')](handleError(_0x1bd660,null));};exports[_0xa0a9('0x20')]=function(_0x132eca,_0x221466){if(_0x132eca[_0xa0a9('0x45')]['id']){delete _0x132eca[_0xa0a9('0x45')]['id'];}return db[_0xa0a9('0x26')][_0xa0a9('0x43')]({'where':{'id':_0x132eca['params']['id']}})[_0xa0a9('0x21')](handleEntityNotFound(_0x221466,null))[_0xa0a9('0x21')](saveUpdates(_0x132eca[_0xa0a9('0x45')],null))['then'](respondWithResult(_0x221466,null))[_0xa0a9('0x3f')](handleError(_0x221466,null));};exports[_0xa0a9('0x46')]=function(_0x2c9c29,_0x4a35dd){return db[_0xa0a9('0x26')][_0xa0a9('0x43')]({'where':{'id':_0x2c9c29[_0xa0a9('0x41')]['id']}})[_0xa0a9('0x21')](handleEntityNotFound(_0x4a35dd,null))['then'](removeEntity(_0x4a35dd,null))[_0xa0a9('0x3f')](handleError(_0x4a35dd,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index e0854fc..260a06a 100644 --- a/server/api/intDeskField/intDeskField.model.js +++ b/server/api/intDeskField/intDeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0fc=['desk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','int_desk_fields'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0xe0fc,0x122));var _0xce0f=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0xe0fc[_0x2891d1];return _0x486948;};'use strict';var _=require(_0xce0f('0x0'));var util=require(_0xce0f('0x1'));var logger=require(_0xce0f('0x2'))('api');var moment=require(_0xce0f('0x3'));var BPromise=require(_0xce0f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce0f('0x5'));var rimraf=require(_0xce0f('0x6'));var config=require(_0xce0f('0x7'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x268d08,_0x5a0e98){return _0x268d08[_0xce0f('0x8')]('DeskField',attributes,{'tableName':_0xce0f('0x9'),'paranoid':![],'indexes':[{'name':_0xce0f('0xa'),'fields':['idField',_0xce0f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1a1=['request-promise','../../config/environment','./intDeskField.attributes','exports','define','desk_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xf1a1,0x1ab));var _0x1f1a=function(_0x3f3480,_0x2ddb9f){_0x3f3480=_0x3f3480-0x0;var _0x29e2cc=_0xf1a1[_0x3f3480];return _0x29e2cc;};'use strict';var _=require(_0x1f1a('0x0'));var util=require(_0x1f1a('0x1'));var logger=require(_0x1f1a('0x2'))(_0x1f1a('0x3'));var moment=require('moment');var BPromise=require(_0x1f1a('0x4'));var rp=require(_0x1f1a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1f1a('0x6'));var attributes=require(_0x1f1a('0x7'));module[_0x1f1a('0x8')]=function(_0x352dcc,_0x311bcf){return _0x352dcc[_0x1f1a('0x9')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x1f1a('0xa'),'fields':['idField',_0x1f1a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 9815cfc..e3b9693 100644 --- a/server/api/intDeskField/intDeskField.rpc.js +++ b/server/api/intDeskField/intDeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd35=['request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','DeskField,\x20%s,\x20%s','debug'];(function(_0x4a1df4,_0xeb5665){var _0x7d17a0=function(_0x19d76c){while(--_0x19d76c){_0x4a1df4['push'](_0x4a1df4['shift']());}};_0x7d17a0(++_0xeb5665);}(_0xcd35,0x127));var _0x5cd3=function(_0x263367,_0x5e04a4){_0x263367=_0x263367-0x0;var _0x8a3727=_0xcd35[_0x263367];return _0x8a3727;};'use strict';var _=require(_0x5cd3('0x0'));var util=require(_0x5cd3('0x1'));var moment=require(_0x5cd3('0x2'));var BPromise=require(_0x5cd3('0x3'));var rs=require(_0x5cd3('0x4'));var fs=require('fs');var Redis=require(_0x5cd3('0x5'));var db=require(_0x5cd3('0x6'))['db'];var utils=require(_0x5cd3('0x7'));var logger=require(_0x5cd3('0x8'))(_0x5cd3('0x9'));var config=require(_0x5cd3('0xa'));var jayson=require(_0x5cd3('0xb'));var client=jayson['client'][_0x5cd3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b749e,_0x3ba9e4,_0x373d56){return new BPromise(function(_0x541135,_0x43c132){return client[_0x5cd3('0xd')](_0x1b749e,_0x373d56)[_0x5cd3('0xe')](function(_0x24c484){logger['info'](_0x5cd3('0xf'),_0x3ba9e4,'request\x20sent');logger[_0x5cd3('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x3ba9e4,_0x5cd3('0x11'),JSON[_0x5cd3('0x12')](_0x24c484));if(_0x24c484[_0x5cd3('0x13')]){if(_0x24c484[_0x5cd3('0x13')][_0x5cd3('0x14')]===0x1f4){logger[_0x5cd3('0x13')]('DeskField,\x20%s,\x20%s',_0x3ba9e4,_0x24c484[_0x5cd3('0x13')]['message']);return _0x43c132(_0x24c484[_0x5cd3('0x13')][_0x5cd3('0x15')]);}logger[_0x5cd3('0x13')](_0x5cd3('0xf'),_0x3ba9e4,_0x24c484[_0x5cd3('0x13')]['message']);return _0x541135(_0x24c484[_0x5cd3('0x13')][_0x5cd3('0x15')]);}else{logger[_0x5cd3('0x16')](_0x5cd3('0xf'),_0x3ba9e4,_0x5cd3('0x11'));_0x541135(_0x24c484[_0x5cd3('0x17')]['message']);}})['catch'](function(_0x30ba96){logger[_0x5cd3('0x13')](_0x5cd3('0xf'),_0x3ba9e4,_0x30ba96);_0x43c132(_0x30ba96);});});} \ No newline at end of file +var _0x9aee=['result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','info'];(function(_0x4805ee,_0x432663){var _0x41e5c7=function(_0xd9cd21){while(--_0xd9cd21){_0x4805ee['push'](_0x4805ee['shift']());}};_0x41e5c7(++_0x432663);}(_0x9aee,0x1cf));var _0xe9ae=function(_0x3cbd7d,_0x4b1bbb){_0x3cbd7d=_0x3cbd7d-0x0;var _0x26d335=_0x9aee[_0x3cbd7d];return _0x26d335;};'use strict';var _=require('lodash');var util=require(_0xe9ae('0x0'));var moment=require('moment');var BPromise=require(_0xe9ae('0x1'));var rs=require(_0xe9ae('0x2'));var fs=require('fs');var Redis=require(_0xe9ae('0x3'));var db=require(_0xe9ae('0x4'))['db'];var utils=require(_0xe9ae('0x5'));var logger=require(_0xe9ae('0x6'))(_0xe9ae('0x7'));var config=require('../../config/environment');var jayson=require(_0xe9ae('0x8'));var client=jayson[_0xe9ae('0x9')][_0xe9ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x519a45,_0x20f669,_0x5431b6){return new BPromise(function(_0x4e68af,_0x5d42ba){return client[_0xe9ae('0xb')](_0x519a45,_0x5431b6)['then'](function(_0x5b00d7){logger['info']('DeskField,\x20%s,\x20%s',_0x20f669,'request\x20sent');logger[_0xe9ae('0xc')](_0xe9ae('0xd'),_0x20f669,'request\x20sent',JSON[_0xe9ae('0xe')](_0x5b00d7));if(_0x5b00d7[_0xe9ae('0xf')]){if(_0x5b00d7['error'][_0xe9ae('0x10')]===0x1f4){logger[_0xe9ae('0xf')]('DeskField,\x20%s,\x20%s',_0x20f669,_0x5b00d7[_0xe9ae('0xf')]['message']);return _0x5d42ba(_0x5b00d7[_0xe9ae('0xf')]['message']);}logger[_0xe9ae('0xf')](_0xe9ae('0x11'),_0x20f669,_0x5b00d7['error'][_0xe9ae('0x12')]);return _0x4e68af(_0x5b00d7['error'][_0xe9ae('0x12')]);}else{logger[_0xe9ae('0x13')](_0xe9ae('0x11'),_0x20f669,'request\x20sent');_0x4e68af(_0x5b00d7[_0xe9ae('0x14')][_0xe9ae('0x12')]);}})['catch'](function(_0x1dca72){logger[_0xe9ae('0xf')]('DeskField,\x20%s,\x20%s',_0x20f669,_0x1dca72);_0x5d42ba(_0x1dca72);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 37a9530..108f9cb 100644 --- a/server/api/intDynamics365Account/index.js +++ b/server/api/intDynamics365Account/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3f1=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','get','/:id','show','/:id/configurations','getFields','post','addConfiguration','put','update','delete','exports'];(function(_0x122cac,_0x473824){var _0xe35004=function(_0x2f7953){while(--_0x2f7953){_0x122cac['push'](_0x122cac['shift']());}};_0xe35004(++_0x473824);}(_0xc3f1,0xdc));var _0x1c3f=function(_0x2c504b,_0x5660e4){_0x2c504b=_0x2c504b-0x0;var _0x343cb4=_0xc3f1[_0x2c504b];return _0x343cb4;};'use strict';var multer=require(_0x1c3f('0x0'));var util=require(_0x1c3f('0x1'));var path=require(_0x1c3f('0x2'));var timeout=require(_0x1c3f('0x3'));var express=require(_0x1c3f('0x4'));var router=express[_0x1c3f('0x5')]();var auth=require(_0x1c3f('0x6'));var interaction=require(_0x1c3f('0x7'));var config=require(_0x1c3f('0x8'));var controller=require(_0x1c3f('0x9'));router['get']('/',auth[_0x1c3f('0xa')](),controller['index']);router[_0x1c3f('0xb')](_0x1c3f('0xc'),auth[_0x1c3f('0xa')](),controller[_0x1c3f('0xd')]);router['get'](_0x1c3f('0xe'),auth[_0x1c3f('0xa')](),controller['getConfigurations']);router[_0x1c3f('0xb')]('/:id/fields',auth[_0x1c3f('0xa')](),controller[_0x1c3f('0xf')]);router[_0x1c3f('0x10')]('/',auth[_0x1c3f('0xa')](),controller['create']);router[_0x1c3f('0x10')]('/:id/configurations',auth[_0x1c3f('0xa')](),controller[_0x1c3f('0x11')]);router[_0x1c3f('0x12')](_0x1c3f('0xc'),auth[_0x1c3f('0xa')](),controller[_0x1c3f('0x13')]);router[_0x1c3f('0x14')](_0x1c3f('0xc'),auth[_0x1c3f('0xa')](),controller['destroy']);module[_0x1c3f('0x15')]=router; \ No newline at end of file +var _0x3f16=['index','/:id','show','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','delete','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3f16,0x14f));var _0x63f1=function(_0x22baaa,_0x64526b){_0x22baaa=_0x22baaa-0x0;var _0x4a40bc=_0x3f16[_0x22baaa];return _0x4a40bc;};'use strict';var multer=require('multer');var util=require(_0x63f1('0x0'));var path=require('path');var timeout=require(_0x63f1('0x1'));var express=require('express');var router=express[_0x63f1('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x63f1('0x3'));var config=require(_0x63f1('0x4'));var controller=require('./intDynamics365Account.controller');router[_0x63f1('0x5')]('/',auth[_0x63f1('0x6')](),controller[_0x63f1('0x7')]);router[_0x63f1('0x5')](_0x63f1('0x8'),auth['isAuthenticated'](),controller[_0x63f1('0x9')]);router[_0x63f1('0x5')]('/:id/configurations',auth[_0x63f1('0x6')](),controller['getConfigurations']);router['get'](_0x63f1('0xa'),auth[_0x63f1('0x6')](),controller[_0x63f1('0xb')]);router[_0x63f1('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x63f1('0xc')](_0x63f1('0xd'),auth[_0x63f1('0x6')](),controller[_0x63f1('0xe')]);router[_0x63f1('0xf')](_0x63f1('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x63f1('0x10')](_0x63f1('0x8'),auth[_0x63f1('0x6')](),controller['destroy']);module[_0x63f1('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e0014ef..ab9f0da 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js +++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0633=['exports','STRING'];(function(_0x692b9c,_0x42329c){var _0x40ac0b=function(_0x3a8c41){while(--_0x3a8c41){_0x692b9c['push'](_0x692b9c['shift']());}};_0x40ac0b(++_0x42329c);}(_0x0633,0x12e));var _0x3063=function(_0x4faf17,_0x1fb0a6){_0x4faf17=_0x4faf17-0x0;var _0x3fa633=_0x0633[_0x4faf17];return _0x3fa633;};'use strict';var Sequelize=require('sequelize');module[_0x3063('0x0')]={'name':{'type':Sequelize[_0x3063('0x1')]},'username':{'type':Sequelize[_0x3063('0x1')]},'password':{'type':Sequelize[_0x3063('0x1')]},'remoteUri':{'type':Sequelize[_0x3063('0x1')]},'tenantId':{'type':Sequelize[_0x3063('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x3063('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x38b2=['STRING'];(function(_0x120a3a,_0x3d76d2){var _0x3d79b8=function(_0x52ef75){while(--_0x52ef75){_0x120a3a['push'](_0x120a3a['shift']());}};_0x3d79b8(++_0x3d76d2);}(_0x38b2,0x13c));var _0x238b=function(_0x17f32c,_0x501de3){_0x17f32c=_0x17f32c-0x0;var _0x57fe81=_0x38b2[_0x17f32c];return _0x57fe81;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x238b('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x238b('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x238b('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x238b('0x0')]},'serverUrl':{'type':Sequelize[_0x238b('0x0')]},'description':{'type':Sequelize[_0x238b('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 1397825..32ccda3 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8cd=['Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','substring','@odata.type','PicklistAttributeMetadata','push','forEach','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName','true','FalseOption',')/Microsoft.Dynamics.CRM.','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','destroy','stack','name','send','map','Dynamics365Account','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','options','include','findAll','show','rawAttributes','includeAll','find','create','body','update','params','getConfigurations','findOne','Dynamics365Configuration','pick','merge','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientSecret','remoteUri','slice','lastIndexOf','format','POST','/oauth2/token','clientId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf8cd,0xf7));var _0xdf8c=function(_0x4a6df7,_0x59449f){_0x4a6df7=_0x4a6df7-0x0;var _0x6bfb0=_0xf8cd[_0x4a6df7];return _0x6bfb0;};'use strict';var pdf=require(_0xdf8c('0x0'));var emlformat=require(_0xdf8c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdf8c('0x2'));var jsonpatch=require(_0xdf8c('0x3'));var rp=require(_0xdf8c('0x4'));var moment=require(_0xdf8c('0x5'));var BPromise=require(_0xdf8c('0x6'));var Mustache=require(_0xdf8c('0x7'));var util=require(_0xdf8c('0x8'));var path=require(_0xdf8c('0x9'));var sox=require(_0xdf8c('0xa'));var csv=require(_0xdf8c('0xb'));var ejs=require(_0xdf8c('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdf8c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdf8c('0xb'));var querystring=require(_0xdf8c('0xe'));var Papa=require(_0xdf8c('0xf'));var Redis=require('ioredis');var authService=require(_0xdf8c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf8c('0x11'));var logger=require(_0xdf8c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xdf8c('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xdf8c('0x14'));var client=jayson[_0xdf8c('0x15')][_0xdf8c('0x16')]({'port':0x232a});function checkPasswordPattern(_0x36d8df,_0x1bc27f,_0x4fd06f){if(_0x4fd06f){var _0x212799=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x212799[_0xdf8c('0x17')](_0x1bc27f)){return _0x36d8df;}else{throw new db[(_0xdf8c('0x18'))][(_0xdf8c('0x19'))](_0xdf8c('0x1a'));}}else{return _0x36d8df;}}function respondWithRpcPromise(_0x159daf,_0x38b89d,_0x35664c,_0x3ea73b){return new BPromise(function(_0x2307fe,_0x3616af){var _0x50614e=_0x3ea73b||client;return _0x50614e[_0xdf8c('0x1b')](_0x159daf,_0x35664c)[_0xdf8c('0x1c')](function(_0x2c751e){logger[_0xdf8c('0x1d')](_0xdf8c('0x1e'),_0x38b89d,_0xdf8c('0x1f'));logger['debug'](_0xdf8c('0x20'),_0x38b89d,'request\x20sent',JSON[_0xdf8c('0x21')](_0x2c751e));if(_0x2c751e[_0xdf8c('0x22')]){if(_0x2c751e[_0xdf8c('0x22')][_0xdf8c('0x23')]===0x1f4){logger[_0xdf8c('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x38b89d,_0x2c751e[_0xdf8c('0x22')][_0xdf8c('0x24')]);return _0x3616af(_0x2c751e[_0xdf8c('0x22')][_0xdf8c('0x24')]);}logger[_0xdf8c('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x38b89d,_0x2c751e['error']['message']);return _0x2307fe(_0x2c751e[_0xdf8c('0x22')][_0xdf8c('0x24')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x38b89d,'request\x20sent');_0x2307fe(_0x2c751e['result'][_0xdf8c('0x24')]);}})[_0xdf8c('0x25')](function(_0x4f8890){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x38b89d,_0x4f8890);_0x3616af(_0x4f8890);});});}function respondWithStatusCode(_0x4f8ff0,_0x314004){_0x314004=_0x314004||0xcc;return function(_0x53f25e){if(_0x53f25e){return _0x4f8ff0[_0xdf8c('0x26')](_0x314004);}return _0x4f8ff0[_0xdf8c('0x27')](_0x314004)[_0xdf8c('0x28')]();};}function respondWithResult(_0x3bcbd5,_0x186d7e){_0x186d7e=_0x186d7e||0xc8;return function(_0x4ba611){if(_0x4ba611){return _0x3bcbd5['status'](_0x186d7e)[_0xdf8c('0x29')](_0x4ba611);}};}function respondWithFilteredResult(_0x2c9e92,_0x4f2e37){return function(_0x33c843){if(_0x33c843){var _0x56e50f=_0x33c843[_0xdf8c('0x2a')],_0x19d11a=_0x4f2e37[_0xdf8c('0x2b')],_0x24918b=_0x4f2e37[_0xdf8c('0x2b')]+_0x4f2e37['limit'],_0x2fd874;if(_0x24918b>=_0x56e50f){_0x24918b=_0x56e50f;_0x2fd874=0xc8;}else{_0x2fd874=0xce;}_0x2c9e92[_0xdf8c('0x27')](_0x2fd874);return _0x2c9e92[_0xdf8c('0x2c')]('Content-Range',_0x19d11a+'-'+_0x24918b+'/'+_0x56e50f)[_0xdf8c('0x29')](_0x33c843);}return null;};}function patchUpdates(_0x2c2f00){return function(_0x473c48){try{jsonpatch[_0xdf8c('0x2d')](_0x473c48,_0x2c2f00,!![]);}catch(_0x3f67ea){return BPromise[_0xdf8c('0x2e')](_0x3f67ea);}return _0x473c48[_0xdf8c('0x2f')]();};}function saveUpdates(_0x4c4936,_0x486120){return function(_0x2487a9){if(_0x2487a9){return _0x2487a9['update'](_0x4c4936)[_0xdf8c('0x1c')](function(_0x4688f1){return _0x4688f1;});}return null;};}function removeEntity(_0x309877,_0x433267){return function(_0x183e2b){if(_0x183e2b){return _0x183e2b[_0xdf8c('0x30')]()[_0xdf8c('0x1c')](function(){_0x309877[_0xdf8c('0x27')](0xcc)[_0xdf8c('0x28')]();});}};}function handleEntityNotFound(_0x59663f,_0x5ac3d8){return function(_0x10c315){if(!_0x10c315){_0x59663f[_0xdf8c('0x26')](0x194);}return _0x10c315;};}function handleError(_0x879319,_0x261e7a){_0x261e7a=_0x261e7a||0x1f4;return function(_0x4697d9){logger[_0xdf8c('0x22')](_0x4697d9[_0xdf8c('0x31')]);if(_0x4697d9[_0xdf8c('0x32')]){delete _0x4697d9[_0xdf8c('0x32')];}_0x879319[_0xdf8c('0x27')](_0x261e7a)[_0xdf8c('0x33')](_0x4697d9);};}exports['index']=function(_0x49b6ea,_0x5d21eb){var _0x35a35e={},_0xbd9cfe={},_0x23bc47={'count':0x0,'rows':[]};var _0x4f0751=_[_0xdf8c('0x34')](db[_0xdf8c('0x35')]['rawAttributes'],function(_0x37d5e7){return{'name':_0x37d5e7['fieldName'],'type':_0x37d5e7[_0xdf8c('0x36')]['key']};});_0xbd9cfe[_0xdf8c('0x37')]=_[_0xdf8c('0x34')](_0x4f0751,_0xdf8c('0x32'));_0xbd9cfe[_0xdf8c('0x38')]=_[_0xdf8c('0x39')](_0x49b6ea[_0xdf8c('0x38')]);_0xbd9cfe[_0xdf8c('0x3a')]=_[_0xdf8c('0x3b')](_0xbd9cfe[_0xdf8c('0x37')],_0xbd9cfe['query']);_0x35a35e[_0xdf8c('0x3c')]=_[_0xdf8c('0x3b')](_0xbd9cfe[_0xdf8c('0x37')],qs[_0xdf8c('0x3d')](_0x49b6ea[_0xdf8c('0x38')][_0xdf8c('0x3d')]));_0x35a35e[_0xdf8c('0x3c')]=_0x35a35e[_0xdf8c('0x3c')][_0xdf8c('0x3e')]?_0x35a35e['attributes']:_0xbd9cfe['model'];if(!_0x49b6ea[_0xdf8c('0x38')][_0xdf8c('0x3f')](_0xdf8c('0x40'))){_0x35a35e[_0xdf8c('0x41')]=qs[_0xdf8c('0x41')](_0x49b6ea[_0xdf8c('0x38')][_0xdf8c('0x41')]);_0x35a35e[_0xdf8c('0x2b')]=qs[_0xdf8c('0x2b')](_0x49b6ea[_0xdf8c('0x38')][_0xdf8c('0x2b')]);}_0x35a35e[_0xdf8c('0x42')]=qs[_0xdf8c('0x43')](_0x49b6ea[_0xdf8c('0x38')][_0xdf8c('0x43')]);_0x35a35e[_0xdf8c('0x44')]=qs[_0xdf8c('0x3a')](_['pick'](_0x49b6ea[_0xdf8c('0x38')],_0xbd9cfe[_0xdf8c('0x3a')]));if(_0x49b6ea[_0xdf8c('0x38')]['filter']){_0x35a35e[_0xdf8c('0x44')]=_['merge'](_0x35a35e[_0xdf8c('0x44')],{'$or':_['map'](_0x4f0751,function(_0x264853){if(_0x264853['type']!=='VIRTUAL'){var _0x4f766a={};_0x4f766a[_0x264853[_0xdf8c('0x32')]]={'$like':'%'+_0x49b6ea[_0xdf8c('0x38')][_0xdf8c('0x45')]+'%'};return _0x4f766a;}})});}_0x35a35e=_['merge']({},_0x35a35e,_0x49b6ea[_0xdf8c('0x46')]);var _0x2b1f73={'where':_0x35a35e[_0xdf8c('0x44')]};return db[_0xdf8c('0x35')][_0xdf8c('0x2a')](_0x2b1f73)[_0xdf8c('0x1c')](function(_0x584124){_0x23bc47[_0xdf8c('0x2a')]=_0x584124;if(_0x49b6ea['query']['includeAll']){_0x35a35e[_0xdf8c('0x47')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xdf8c('0x48')](_0x35a35e);})[_0xdf8c('0x1c')](function(_0x3c4af1){_0x23bc47['rows']=_0x3c4af1;return _0x23bc47;})[_0xdf8c('0x1c')](respondWithFilteredResult(_0x5d21eb,_0x35a35e))[_0xdf8c('0x25')](handleError(_0x5d21eb,null));};exports[_0xdf8c('0x49')]=function(_0x4b09fa,_0x471df2){var _0x910a72={'raw':![],'where':{'id':_0x4b09fa['params']['id']}},_0x58ae0f={};_0x58ae0f[_0xdf8c('0x37')]=_[_0xdf8c('0x39')](db[_0xdf8c('0x35')][_0xdf8c('0x4a')]);_0x58ae0f['query']=_[_0xdf8c('0x39')](_0x4b09fa[_0xdf8c('0x38')]);_0x58ae0f[_0xdf8c('0x3a')]=_[_0xdf8c('0x3b')](_0x58ae0f['model'],_0x58ae0f['query']);_0x910a72[_0xdf8c('0x3c')]=_[_0xdf8c('0x3b')](_0x58ae0f[_0xdf8c('0x37')],qs[_0xdf8c('0x3d')](_0x4b09fa[_0xdf8c('0x38')][_0xdf8c('0x3d')]));_0x910a72[_0xdf8c('0x3c')]=_0x910a72['attributes'][_0xdf8c('0x3e')]?_0x910a72[_0xdf8c('0x3c')]:_0x58ae0f[_0xdf8c('0x37')];if(_0x4b09fa['query'][_0xdf8c('0x4b')]){_0x910a72[_0xdf8c('0x47')]=[{'all':!![]}];}_0x910a72=_['merge']({},_0x910a72,_0x4b09fa[_0xdf8c('0x46')]);return db['Dynamics365Account'][_0xdf8c('0x4c')](_0x910a72)['then'](handleEntityNotFound(_0x471df2,null))[_0xdf8c('0x1c')](respondWithResult(_0x471df2,null))[_0xdf8c('0x25')](handleError(_0x471df2,null));};exports[_0xdf8c('0x4d')]=function(_0x482693,_0x17e51f){return db['Dynamics365Account']['create'](_0x482693[_0xdf8c('0x4e')],{})[_0xdf8c('0x1c')](respondWithResult(_0x17e51f,0xc9))['catch'](handleError(_0x17e51f,null));};exports[_0xdf8c('0x4f')]=function(_0x756bb9,_0x114762){if(_0x756bb9[_0xdf8c('0x4e')]['id']){delete _0x756bb9[_0xdf8c('0x4e')]['id'];}return db['Dynamics365Account'][_0xdf8c('0x4c')]({'where':{'id':_0x756bb9[_0xdf8c('0x50')]['id']}})[_0xdf8c('0x1c')](handleEntityNotFound(_0x114762,null))['then'](saveUpdates(_0x756bb9[_0xdf8c('0x4e')],null))['then'](respondWithResult(_0x114762,null))[_0xdf8c('0x25')](handleError(_0x114762,null));};exports[_0xdf8c('0x30')]=function(_0x32bdfe,_0x5b0fdb){return db[_0xdf8c('0x35')][_0xdf8c('0x4c')]({'where':{'id':_0x32bdfe['params']['id']}})[_0xdf8c('0x1c')](handleEntityNotFound(_0x5b0fdb,null))['then'](removeEntity(_0x5b0fdb,null))[_0xdf8c('0x25')](handleError(_0x5b0fdb,null));};exports[_0xdf8c('0x51')]=function(_0x1b66cf,_0x573aa1,_0x3542b9){var _0xb22a40={};var _0x11eee4={};var _0x1e8c73;var _0x57ae3d;return db[_0xdf8c('0x35')][_0xdf8c('0x52')]({'where':{'id':_0x1b66cf[_0xdf8c('0x50')]['id']}})[_0xdf8c('0x1c')](handleEntityNotFound(_0x573aa1,null))[_0xdf8c('0x1c')](function(_0x569e28){if(_0x569e28){_0x1e8c73=_0x569e28;_0x11eee4['model']=_[_0xdf8c('0x39')](db[_0xdf8c('0x53')][_0xdf8c('0x4a')]);_0x11eee4['query']=_[_0xdf8c('0x39')](_0x1b66cf[_0xdf8c('0x38')]);_0x11eee4[_0xdf8c('0x3a')]=_[_0xdf8c('0x3b')](_0x11eee4[_0xdf8c('0x37')],_0x11eee4[_0xdf8c('0x38')]);_0xb22a40[_0xdf8c('0x3c')]=_[_0xdf8c('0x3b')](_0x11eee4[_0xdf8c('0x37')],qs[_0xdf8c('0x3d')](_0x1b66cf[_0xdf8c('0x38')][_0xdf8c('0x3d')]));_0xb22a40[_0xdf8c('0x3c')]=_0xb22a40[_0xdf8c('0x3c')]['length']?_0xb22a40[_0xdf8c('0x3c')]:_0x11eee4[_0xdf8c('0x37')];_0xb22a40[_0xdf8c('0x42')]=qs[_0xdf8c('0x43')](_0x1b66cf['query'][_0xdf8c('0x43')]);_0xb22a40[_0xdf8c('0x44')]=qs[_0xdf8c('0x3a')](_[_0xdf8c('0x54')](_0x1b66cf['query'],_0x11eee4[_0xdf8c('0x3a')]));if(_0x1b66cf['query'][_0xdf8c('0x45')]){_0xb22a40['where']=_['merge'](_0xb22a40[_0xdf8c('0x44')],{'$or':_[_0xdf8c('0x34')](_0xb22a40[_0xdf8c('0x3c')],function(_0x5c4445){var _0x1193fe={};_0x1193fe[_0x5c4445]={'$like':'%'+_0x1b66cf[_0xdf8c('0x38')][_0xdf8c('0x45')]+'%'};return _0x1193fe;})});}_0xb22a40=_[_0xdf8c('0x55')]({},_0xb22a40,_0x1b66cf[_0xdf8c('0x46')]);return _0x1e8c73['getConfigurations'](_0xb22a40);}})[_0xdf8c('0x1c')](function(_0x46d4fd){if(_0x46d4fd){_0x57ae3d=_0x46d4fd['length'];if(!_0x1b66cf['query'][_0xdf8c('0x3f')]('nolimit')){_0xb22a40[_0xdf8c('0x41')]=qs[_0xdf8c('0x41')](_0x1b66cf[_0xdf8c('0x38')][_0xdf8c('0x41')]);_0xb22a40[_0xdf8c('0x2b')]=qs['offset'](_0x1b66cf[_0xdf8c('0x38')][_0xdf8c('0x2b')]);}return _0x1e8c73['getConfigurations'](_0xb22a40);}})[_0xdf8c('0x1c')](function(_0x236f10){if(_0x236f10){return _0x236f10?{'count':_0x57ae3d,'rows':_0x236f10}:null;}})[_0xdf8c('0x1c')](respondWithResult(_0x573aa1,null))[_0xdf8c('0x25')](handleError(_0x573aa1,null));};exports[_0xdf8c('0x56')]=function(_0x47354b,_0x2c5db7,_0xa73cf7){if(_0x47354b['body']['id']){delete _0x47354b[_0xdf8c('0x4e')]['id'];}return db[_0xdf8c('0x35')][_0xdf8c('0x52')]({'where':{'id':_0x47354b[_0xdf8c('0x50')]['id']}})[_0xdf8c('0x1c')](handleEntityNotFound(_0x2c5db7,null))[_0xdf8c('0x1c')](function(_0x4b2a0d){if(_0x4b2a0d){_0x47354b[_0xdf8c('0x4e')][_0xdf8c('0x57')]=_0x4b2a0d['id'];_0x47354b[_0xdf8c('0x4e')][_0xdf8c('0x58')]=integrations[_0xdf8c('0x59')](_0x47354b['body'][_0xdf8c('0x5a')],_0x47354b[_0xdf8c('0x4e')][_0xdf8c('0x36')]);_0x47354b['body'][_0xdf8c('0x5b')]=integrations[_0xdf8c('0x5c')](_0x47354b[_0xdf8c('0x4e')][_0xdf8c('0x5a')],_0x47354b[_0xdf8c('0x4e')]['type']);return db[_0xdf8c('0x53')][_0xdf8c('0x4d')](_0x47354b[_0xdf8c('0x4e')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0xdf8c('0x5d')],'as':'Descriptions'}]});}return null;})[_0xdf8c('0x1c')](respondWithResult(_0x2c5db7,null))['catch'](handleError(_0x2c5db7,null));};exports[_0xdf8c('0x5e')]=function(_0x3868f9,_0x46e820,_0x3a83b5){var _0xed376c=_0x3868f9[_0xdf8c('0x38')]['ticketType'];var _0x1b7f95=_0xed376c==='incident'?'Incident':_0xdf8c('0x5f');var _0x399ee7='';var _0x5d5ddd='';var _0x415c23='';var _0x29170e='';var _0x5b5b2b='';var _0x450824='';var _0x197894='';var _0x22f934='';var _0x27e1dd=[_0xdf8c('0x60'),_0xdf8c('0x61'),'customerid',_0xdf8c('0x62'),_0xdf8c('0x63'),_0xdf8c('0x64'),_0xdf8c('0x65'),_0xdf8c('0x66'),_0xdf8c('0x67'),_0xdf8c('0x68')];var _0x327242=['accountidname',_0xdf8c('0x69'),_0xdf8c('0x6a'),'billedserviceunits',_0xdf8c('0x6b'),_0xdf8c('0x6c'),'contractdetailidname',_0xdf8c('0x6d'),_0xdf8c('0x6e'),'createdbyexternalpartyyominame','createdbyname',_0xdf8c('0x6f'),_0xdf8c('0x70'),_0xdf8c('0x71'),_0xdf8c('0x72'),_0xdf8c('0x73'),_0xdf8c('0x74'),_0xdf8c('0x75'),_0xdf8c('0x76'),_0xdf8c('0x77'),_0xdf8c('0x78'),_0xdf8c('0x79'),_0xdf8c('0x7a'),_0xdf8c('0x7b'),_0xdf8c('0x7c'),'followupby',_0xdf8c('0x7d'),_0xdf8c('0x7e'),_0xdf8c('0x7f'),'lastonholdtime',_0xdf8c('0x80'),'modifiedbyexternalpartyname',_0xdf8c('0x81'),'modifiedbyname','modifiedbyyominame',_0xdf8c('0x82'),_0xdf8c('0x83'),'modifiedonbehalfbyyominame',_0xdf8c('0x84'),_0xdf8c('0x85'),_0xdf8c('0x86'),_0xdf8c('0x87'),_0xdf8c('0x88'),'owneridname',_0xdf8c('0x89'),_0xdf8c('0x8a'),_0xdf8c('0x8b'),_0xdf8c('0x8c'),_0xdf8c('0x8d'),_0xdf8c('0x8e'),'productidname',_0xdf8c('0x8f'),'resolveby',_0xdf8c('0x90'),_0xdf8c('0x91'),_0xdf8c('0x92'),_0xdf8c('0x93'),'sentimentvalue',_0xdf8c('0x94'),_0xdf8c('0x95'),_0xdf8c('0x96'),_0xdf8c('0x97'),_0xdf8c('0x98'),_0xdf8c('0x99'),_0xdf8c('0x9a'),_0xdf8c('0x9b'),'transactioncurrencyidname','traversedpath',_0xdf8c('0x9c'),_0xdf8c('0x9d')];var _0x5072f2=_0x27e1dd[_0xdf8c('0x9e')](_0x327242);return db[_0xdf8c('0x35')][_0xdf8c('0x52')]({'where':{'id':_0x3868f9[_0xdf8c('0x50')]['id']},'attributes':['id',_0xdf8c('0x9f'),_0xdf8c('0xa0'),'remoteUri',_0xdf8c('0xa1'),'clientId',_0xdf8c('0xa2')]})[_0xdf8c('0x1c')](handleEntityNotFound(_0x46e820,null))[_0xdf8c('0x1c')](function(_0x4ca1b6){if(_0x4ca1b6){_0x22f934=_0x4ca1b6[_0xdf8c('0xa3')];var _0x13de88=_0x22f934[_0xdf8c('0xa4')](-0x1);if(_0x13de88==='/'){_0x22f934=_0x22f934['substring'](0x0,_0x22f934[_0xdf8c('0xa5')](_0x13de88));}_0x197894=util[_0xdf8c('0xa6')]('%s/api/data/v9.0/',_0x22f934);var _0x5c56e6={'method':_0xdf8c('0xa7'),'uri':'https://login.microsoftonline.com/'+_0x4ca1b6['tenantId']+_0xdf8c('0xa8'),'form':{'client_id':_0x4ca1b6[_0xdf8c('0xa9')],'resource':_0x22f934,'username':_0x4ca1b6[_0xdf8c('0x9f')],'password':_0x4ca1b6[_0xdf8c('0xa0')],'grant_type':'password','client_secret':_0x4ca1b6['clientSecret']},'json':!![]};return rp(_0x5c56e6);}})[_0xdf8c('0x1c')](function(_0x21342f){_0x450824=_0x21342f[_0xdf8c('0xaa')];var _0x47b5d8={'method':_0xdf8c('0xab'),'uri':encodeURI(_0x197894+_0xdf8c('0xac')+_0x1b7f95+'\x27'),'headers':{'Authorization':_0xdf8c('0xad')+_0x450824,'If-None-Match':null,'OData-Version':_0xdf8c('0xae')},'json':!![]};return rp(_0x47b5d8);})[_0xdf8c('0x1c')](function(_0xfef8dc){var _0x5320e0=_0xfef8dc['value'][0x0];var _0x5cfc72=_0x5320e0[_0xdf8c('0xaf')];var _0x4cace5={'method':'GET','uri':_0x197894+_0xdf8c('0xb0')+_0x5cfc72+_0xdf8c('0xb1'),'headers':{'Authorization':_0xdf8c('0xad')+_0x450824,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4cace5);})[_0xdf8c('0x1c')](function(_0x3ed82e){_0x399ee7=_0x3ed82e;_0x5d5ddd=_0x399ee7[_0xdf8c('0xb2')];_0x5d5ddd=_[_0xdf8c('0xb3')](_0x5d5ddd,function(_0x1013c2){return!_0x5072f2['includes'](_0x1013c2[_0xdf8c('0xb4')]);});var _0x1e0bc9=[];var _0xd62606=[];_0x5d5ddd['forEach'](function(_0x5a3a7b){if(_0x5a3a7b['@odata.type']){var _0x313290=_0x5a3a7b['@odata.type'][_0xdf8c('0xb5')](_0x5a3a7b[_0xdf8c('0xb6')]['lastIndexOf']('.')+0x1);if(_0x313290===_0xdf8c('0xb7')){_0x1e0bc9[_0xdf8c('0xb8')](getSelectList(_0x197894,_0xed376c,_0xd62606,_0x399ee7[_0xdf8c('0xaf')],_0x5a3a7b[_0xdf8c('0xaf')],_0x450824));}}});return Promise['all'](_0x1e0bc9);})[_0xdf8c('0x1c')](function(_0x567d51){_0x415c23=_0x567d51[0x0];var _0x119560=[];var _0xf3dce4=[];_0x5d5ddd[_0xdf8c('0xb9')](function(_0x17da79){if(!_[_0xdf8c('0xba')](_0x17da79[_0xdf8c('0xb6')])){var _0x24f128=_0x17da79[_0xdf8c('0xb6')][_0xdf8c('0xb5')](_0x17da79[_0xdf8c('0xb6')][_0xdf8c('0xa5')]('.')+0x1);if(_0x24f128===_0xdf8c('0xbb')){_0x119560[_0xdf8c('0xb8')](getBooleanList(_0x197894,_0xed376c,_0xf3dce4,_0x399ee7[_0xdf8c('0xaf')],_0x17da79[_0xdf8c('0xaf')],_0x450824));}}});return Promise[_0xdf8c('0xbc')](_0x119560);})[_0xdf8c('0x1c')](function(_0x47a91a){_0x29170e=_0x47a91a[0x0];var _0x172920=[];var _0xde7d16=[];_0x5d5ddd[_0xdf8c('0xb9')](function(_0x3b13d7){if(_0x3b13d7[_0xdf8c('0xb6')]){var _0x244f4f=_0x3b13d7['@odata.type']['substring'](_0x3b13d7['@odata.type']['lastIndexOf']('.')+0x1);if(_0x244f4f===_0xdf8c('0xbd')||_0x244f4f===_0xdf8c('0xbe')||_0x244f4f===_0xdf8c('0xbf')||_0x244f4f==='IntegerAttributeMetadata'||_0x244f4f===_0xdf8c('0xc0')||_0x244f4f==='DateTimeAttributeMetadata'||_0x244f4f===_0xdf8c('0xc1')||_0x244f4f==='EntityNameAttributeMetadata'||_0x244f4f===_0xdf8c('0xc2')||_0x244f4f===_0xdf8c('0xc3')){_0x172920[_0xdf8c('0xb8')](getInputList(_0x197894,_0xed376c,_0x244f4f,_0xde7d16,_0x399ee7['MetadataId'],_0x3b13d7[_0xdf8c('0xaf')],_0x450824));}}});return Promise[_0xdf8c('0xbc')](_0x172920);})[_0xdf8c('0x1c')](function(_0x4ff622){_0x5b5b2b=_0x4ff622[0x0];var _0x4d4804=_0x415c23[_0xdf8c('0x9e')](_0x29170e)['concat'](_0x5b5b2b);var _0x248fb3={'count':_0x4d4804['length'],'rows':_0x4d4804};return _0x248fb3;})['then'](respondWithResult(_0x46e820,null))[_0xdf8c('0x25')](function(_0x2efd7a){var _0xa6a5a5=_0x3868f9['query'][_0xdf8c('0x17')]?0x1f4:_0x2efd7a[_0xdf8c('0xc4')]||0x1f4;logger[_0xdf8c('0x22')](_0x2efd7a[_0xdf8c('0x31')]);delete _0x2efd7a[_0xdf8c('0x32')];if(_0xa6a5a5===0x191){_0xa6a5a5=0x190;}_0x46e820[_0xdf8c('0x27')](_0xa6a5a5)[_0xdf8c('0x33')](_0x3868f9['query'][_0xdf8c('0x17')]?{'message':_0xdf8c('0xc5'),'statusCode':_0x2efd7a['statusCode']}:_0x2efd7a);});};function getSelectList(_0x35678c,_0x269053,_0x27bbd4,_0x13549c,_0x266b23,_0x43971c){var _0x1070ef={'method':_0xdf8c('0xab'),'uri':_0x35678c+_0xdf8c('0xb0')+_0x13549c+_0xdf8c('0xc6')+_0x266b23+_0xdf8c('0xc7')+_0xdf8c('0xc8'),'headers':{'Authorization':_0xdf8c('0xad')+_0x43971c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1070ef)[_0xdf8c('0x1c')](function(_0x5a6c06){var _0x1dd6f3=[];var _0xc110d6=_0x5a6c06[_0xdf8c('0xc9')][_0xdf8c('0xca')];_0xc110d6[_0xdf8c('0xb9')](function(_0x4fb780){_0x1dd6f3[_0xdf8c('0xb8')]({'name':_0x4fb780['Label'][_0xdf8c('0xcb')][_0xdf8c('0xcc')],'value':String(_0x4fb780[_0xdf8c('0xcd')])});});var _0x473214={'id':_0x269053+'_'+_0x5a6c06[_0xdf8c('0xb4')],'name':_0x5a6c06[_0xdf8c('0xce')]['UserLocalizedLabel'][_0xdf8c('0xcc')],'custom':![],'options':_0x1dd6f3};_0x27bbd4[_0xdf8c('0xb8')](_0x473214);return _0x27bbd4;});}function getBooleanList(_0x26fa5,_0x5f17d8,_0x178a97,_0x31a409,_0x455615,_0xac715c){var _0x1b25e8={'method':_0xdf8c('0xab'),'uri':_0x26fa5+_0xdf8c('0xb0')+_0x31a409+_0xdf8c('0xc6')+_0x455615+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xdf8c('0xad')+_0xac715c,'If-None-Match':null,'OData-Version':_0xdf8c('0xae')},'json':!![]};return rp(_0x1b25e8)['then'](function(_0x59e8d3){var _0x4f4503=[];_0x4f4503[_0xdf8c('0xb8')]({'name':_0x59e8d3['OptionSet']['TrueOption'][_0xdf8c('0xcc')][_0xdf8c('0xcb')]['Label'],'value':_0xdf8c('0xcf')},{'name':_0x59e8d3[_0xdf8c('0xc9')][_0xdf8c('0xd0')][_0xdf8c('0xcc')]['UserLocalizedLabel'][_0xdf8c('0xcc')],'value':'false'});var _0x316de2={'id':_0x5f17d8+'_'+_0x59e8d3['LogicalName'],'name':_0x59e8d3['DisplayName'][_0xdf8c('0xcb')][_0xdf8c('0xcc')],'custom':![],'options':_0x4f4503};_0x178a97['push'](_0x316de2);return _0x178a97;});}function getInputList(_0x17ca35,_0x29f1eb,_0x513612,_0x2bced6,_0x35578f,_0x405727,_0xe3ecc0){var _0x3254ce={'method':_0xdf8c('0xab'),'uri':_0x17ca35+_0xdf8c('0xb0')+_0x35578f+_0xdf8c('0xc6')+_0x405727+_0xdf8c('0xd1')+_0x513612+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xdf8c('0xad')+_0xe3ecc0,'If-None-Match':null,'OData-Version':_0xdf8c('0xae')},'json':!![]};return rp(_0x3254ce)[_0xdf8c('0x1c')](function(_0x4eb62f){var _0x103baa={'id':_0x29f1eb+'_'+_0x4eb62f[_0xdf8c('0xb4')],'name':_0x4eb62f[_0xdf8c('0xce')][_0xdf8c('0xcb')]?_0x4eb62f[_0xdf8c('0xce')][_0xdf8c('0xcb')][_0xdf8c('0xcc')]:_0x4eb62f[_0xdf8c('0xb4')],'custom':![],'options':[]};_0x2bced6[_0xdf8c('0xb8')](_0x103baa);return _0x2bced6;});} \ No newline at end of file +var _0x56fc=['entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','slice','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','clientId','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','forEach','@odata.type','substring','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials','GET',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','UserLocalizedLabel','Label','Value','LogicalName','OptionSet','TrueOption','true','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Dynamics365Account','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','count','includeAll','include','rows','show','params','keys','rawAttributes','length','options','find','create','body','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','Incident','title','customerid','ownerid','caseorigincode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress'];(function(_0x42941a,_0x3bf3df){var _0x1e742a=function(_0x1caf0d){while(--_0x1caf0d){_0x42941a['push'](_0x42941a['shift']());}};_0x1e742a(++_0x3bf3df);}(_0x56fc,0x13e));var _0xc56f=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x56fc[_0x56482c];return _0x5aae7a;};'use strict';var pdf=require(_0xc56f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc56f('0x1'));var zipdir=require(_0xc56f('0x2'));var jsonpatch=require(_0xc56f('0x3'));var rp=require(_0xc56f('0x4'));var moment=require(_0xc56f('0x5'));var BPromise=require(_0xc56f('0x6'));var Mustache=require('mustache');var util=require(_0xc56f('0x7'));var path=require(_0xc56f('0x8'));var sox=require(_0xc56f('0x9'));var csv=require(_0xc56f('0xa'));var ejs=require(_0xc56f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc56f('0xc'));var crypto=require(_0xc56f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc56f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc56f('0xf'));var Papa=require(_0xc56f('0x10'));var Redis=require(_0xc56f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc56f('0x12'));var as=require(_0xc56f('0x13'));var hardwareService=require(_0xc56f('0x14'));var logger=require(_0xc56f('0x15'))(_0xc56f('0x16'));var utils=require(_0xc56f('0x17'));var config=require(_0xc56f('0x18'));var db=require(_0xc56f('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xc56f('0x1a'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x378364,_0x4b4ad6,_0xc81c56){if(_0xc81c56){var _0x23027d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23027d[_0xc56f('0x1b')](_0x4b4ad6)){return _0x378364;}else{throw new db[(_0xc56f('0x1c'))][(_0xc56f('0x1d'))](_0xc56f('0x1e'));}}else{return _0x378364;}}function respondWithRpcPromise(_0x46c95b,_0x33e791,_0x5b9843,_0xb1ddf3){return new BPromise(function(_0x357404,_0x2ee061){var _0x150f5f=_0xb1ddf3||client;return _0x150f5f[_0xc56f('0x1f')](_0x46c95b,_0x5b9843)[_0xc56f('0x20')](function(_0x1f3c41){logger[_0xc56f('0x21')](_0xc56f('0x22'),_0x33e791,_0xc56f('0x23'));logger[_0xc56f('0x24')](_0xc56f('0x25'),_0x33e791,_0xc56f('0x23'),JSON[_0xc56f('0x26')](_0x1f3c41));if(_0x1f3c41[_0xc56f('0x27')]){if(_0x1f3c41[_0xc56f('0x27')][_0xc56f('0x28')]===0x1f4){logger[_0xc56f('0x27')]('Dynamics365Account,\x20%s,\x20%s',_0x33e791,_0x1f3c41['error'][_0xc56f('0x29')]);return _0x2ee061(_0x1f3c41[_0xc56f('0x27')][_0xc56f('0x29')]);}logger['error'](_0xc56f('0x22'),_0x33e791,_0x1f3c41[_0xc56f('0x27')][_0xc56f('0x29')]);return _0x357404(_0x1f3c41[_0xc56f('0x27')][_0xc56f('0x29')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x33e791,'request\x20sent');_0x357404(_0x1f3c41['result'][_0xc56f('0x29')]);}})[_0xc56f('0x2a')](function(_0x35cce6){logger[_0xc56f('0x27')](_0xc56f('0x22'),_0x33e791,_0x35cce6);_0x2ee061(_0x35cce6);});});}function respondWithStatusCode(_0x286275,_0x23feb8){_0x23feb8=_0x23feb8||0xcc;return function(_0x5bc6a3){if(_0x5bc6a3){return _0x286275[_0xc56f('0x2b')](_0x23feb8);}return _0x286275[_0xc56f('0x2c')](_0x23feb8)[_0xc56f('0x2d')]();};}function respondWithResult(_0x952e3e,_0x35e1dd){_0x35e1dd=_0x35e1dd||0xc8;return function(_0x1852a7){if(_0x1852a7){return _0x952e3e[_0xc56f('0x2c')](_0x35e1dd)[_0xc56f('0x2e')](_0x1852a7);}};}function respondWithFilteredResult(_0xf682e3,_0x5bcc87){return function(_0x550f13){if(_0x550f13){var _0x3a2624=_0x550f13['count'],_0x40f676=_0x5bcc87[_0xc56f('0x2f')],_0x19a614=_0x5bcc87[_0xc56f('0x2f')]+_0x5bcc87['limit'],_0x54d67d;if(_0x19a614>=_0x3a2624){_0x19a614=_0x3a2624;_0x54d67d=0xc8;}else{_0x54d67d=0xce;}_0xf682e3[_0xc56f('0x2c')](_0x54d67d);return _0xf682e3['set'](_0xc56f('0x30'),_0x40f676+'-'+_0x19a614+'/'+_0x3a2624)[_0xc56f('0x2e')](_0x550f13);}return null;};}function patchUpdates(_0x38ca1d){return function(_0x1c4e28){try{jsonpatch[_0xc56f('0x31')](_0x1c4e28,_0x38ca1d,!![]);}catch(_0x53c053){return BPromise[_0xc56f('0x32')](_0x53c053);}return _0x1c4e28[_0xc56f('0x33')]();};}function saveUpdates(_0x2d4ae6,_0x2de6a6){return function(_0xa24640){if(_0xa24640){return _0xa24640[_0xc56f('0x34')](_0x2d4ae6)[_0xc56f('0x20')](function(_0x104848){return _0x104848;});}return null;};}function removeEntity(_0x499c86,_0x3c0ea6){return function(_0x52d158){if(_0x52d158){return _0x52d158[_0xc56f('0x35')]()[_0xc56f('0x20')](function(){_0x499c86[_0xc56f('0x2c')](0xcc)[_0xc56f('0x2d')]();});}};}function handleEntityNotFound(_0x2b86a2,_0x4a3752){return function(_0x41ca94){if(!_0x41ca94){_0x2b86a2[_0xc56f('0x2b')](0x194);}return _0x41ca94;};}function handleError(_0x41d59d,_0x2d17cd){_0x2d17cd=_0x2d17cd||0x1f4;return function(_0x382407){logger[_0xc56f('0x27')](_0x382407[_0xc56f('0x36')]);if(_0x382407[_0xc56f('0x37')]){delete _0x382407[_0xc56f('0x37')];}_0x41d59d['status'](_0x2d17cd)[_0xc56f('0x38')](_0x382407);};}exports[_0xc56f('0x39')]=function(_0x4cb0c2,_0x3f324e){var _0x5df692={},_0x73672a={},_0x35684a={'count':0x0,'rows':[]};var _0x15dd0c=_['map'](db[_0xc56f('0x3a')]['rawAttributes'],function(_0x42d706){return{'name':_0x42d706[_0xc56f('0x3b')],'type':_0x42d706[_0xc56f('0x3c')][_0xc56f('0x3d')]};});_0x73672a[_0xc56f('0x3e')]=_['map'](_0x15dd0c,_0xc56f('0x37'));_0x73672a[_0xc56f('0x3f')]=_['keys'](_0x4cb0c2['query']);_0x73672a[_0xc56f('0x40')]=_[_0xc56f('0x41')](_0x73672a[_0xc56f('0x3e')],_0x73672a[_0xc56f('0x3f')]);_0x5df692[_0xc56f('0x42')]=_[_0xc56f('0x41')](_0x73672a[_0xc56f('0x3e')],qs[_0xc56f('0x43')](_0x4cb0c2[_0xc56f('0x3f')][_0xc56f('0x43')]));_0x5df692['attributes']=_0x5df692[_0xc56f('0x42')]['length']?_0x5df692[_0xc56f('0x42')]:_0x73672a['model'];if(!_0x4cb0c2['query'][_0xc56f('0x44')](_0xc56f('0x45'))){_0x5df692[_0xc56f('0x46')]=qs[_0xc56f('0x46')](_0x4cb0c2[_0xc56f('0x3f')][_0xc56f('0x46')]);_0x5df692[_0xc56f('0x2f')]=qs[_0xc56f('0x2f')](_0x4cb0c2[_0xc56f('0x3f')][_0xc56f('0x2f')]);}_0x5df692[_0xc56f('0x47')]=qs[_0xc56f('0x48')](_0x4cb0c2['query'][_0xc56f('0x48')]);_0x5df692[_0xc56f('0x49')]=qs[_0xc56f('0x40')](_[_0xc56f('0x4a')](_0x4cb0c2[_0xc56f('0x3f')],_0x73672a['filters']));if(_0x4cb0c2[_0xc56f('0x3f')][_0xc56f('0x4b')]){_0x5df692[_0xc56f('0x49')]=_[_0xc56f('0x4c')](_0x5df692[_0xc56f('0x49')],{'$or':_[_0xc56f('0x4d')](_0x15dd0c,function(_0x2110c9){if(_0x2110c9['type']!=='VIRTUAL'){var _0x5607f6={};_0x5607f6[_0x2110c9['name']]={'$like':'%'+_0x4cb0c2[_0xc56f('0x3f')][_0xc56f('0x4b')]+'%'};return _0x5607f6;}})});}_0x5df692=_[_0xc56f('0x4c')]({},_0x5df692,_0x4cb0c2['options']);var _0x33bfb7={'where':_0x5df692[_0xc56f('0x49')]};return db[_0xc56f('0x3a')]['count'](_0x33bfb7)[_0xc56f('0x20')](function(_0x1a6aa6){_0x35684a[_0xc56f('0x4e')]=_0x1a6aa6;if(_0x4cb0c2['query'][_0xc56f('0x4f')]){_0x5df692[_0xc56f('0x50')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x5df692);})[_0xc56f('0x20')](function(_0x5459db){_0x35684a[_0xc56f('0x51')]=_0x5459db;return _0x35684a;})[_0xc56f('0x20')](respondWithFilteredResult(_0x3f324e,_0x5df692))[_0xc56f('0x2a')](handleError(_0x3f324e,null));};exports[_0xc56f('0x52')]=function(_0x3e96ee,_0xfb65d){var _0x1bea3b={'raw':![],'where':{'id':_0x3e96ee[_0xc56f('0x53')]['id']}},_0x3eb92d={};_0x3eb92d[_0xc56f('0x3e')]=_[_0xc56f('0x54')](db[_0xc56f('0x3a')][_0xc56f('0x55')]);_0x3eb92d[_0xc56f('0x3f')]=_[_0xc56f('0x54')](_0x3e96ee[_0xc56f('0x3f')]);_0x3eb92d['filters']=_[_0xc56f('0x41')](_0x3eb92d[_0xc56f('0x3e')],_0x3eb92d[_0xc56f('0x3f')]);_0x1bea3b[_0xc56f('0x42')]=_[_0xc56f('0x41')](_0x3eb92d['model'],qs['fields'](_0x3e96ee[_0xc56f('0x3f')][_0xc56f('0x43')]));_0x1bea3b[_0xc56f('0x42')]=_0x1bea3b[_0xc56f('0x42')][_0xc56f('0x56')]?_0x1bea3b['attributes']:_0x3eb92d[_0xc56f('0x3e')];if(_0x3e96ee[_0xc56f('0x3f')][_0xc56f('0x4f')]){_0x1bea3b[_0xc56f('0x50')]=[{'all':!![]}];}_0x1bea3b=_[_0xc56f('0x4c')]({},_0x1bea3b,_0x3e96ee[_0xc56f('0x57')]);return db['Dynamics365Account'][_0xc56f('0x58')](_0x1bea3b)[_0xc56f('0x20')](handleEntityNotFound(_0xfb65d,null))['then'](respondWithResult(_0xfb65d,null))[_0xc56f('0x2a')](handleError(_0xfb65d,null));};exports[_0xc56f('0x59')]=function(_0x4dac9c,_0x5775a1){return db[_0xc56f('0x3a')][_0xc56f('0x59')](_0x4dac9c['body'],{})[_0xc56f('0x20')](respondWithResult(_0x5775a1,0xc9))[_0xc56f('0x2a')](handleError(_0x5775a1,null));};exports[_0xc56f('0x34')]=function(_0x7b5f9e,_0x14cecb){if(_0x7b5f9e[_0xc56f('0x5a')]['id']){delete _0x7b5f9e[_0xc56f('0x5a')]['id'];}return db[_0xc56f('0x3a')][_0xc56f('0x58')]({'where':{'id':_0x7b5f9e[_0xc56f('0x53')]['id']}})[_0xc56f('0x20')](handleEntityNotFound(_0x14cecb,null))[_0xc56f('0x20')](saveUpdates(_0x7b5f9e[_0xc56f('0x5a')],null))[_0xc56f('0x20')](respondWithResult(_0x14cecb,null))[_0xc56f('0x2a')](handleError(_0x14cecb,null));};exports[_0xc56f('0x35')]=function(_0x46a2e7,_0x7b0d4){return db['Dynamics365Account'][_0xc56f('0x58')]({'where':{'id':_0x46a2e7[_0xc56f('0x53')]['id']}})[_0xc56f('0x20')](handleEntityNotFound(_0x7b0d4,null))[_0xc56f('0x20')](removeEntity(_0x7b0d4,null))[_0xc56f('0x2a')](handleError(_0x7b0d4,null));};exports[_0xc56f('0x5b')]=function(_0x2a7a70,_0x497fa4,_0x3890d){var _0x121b86={};var _0x5492fb={};var _0x195cf7;var _0x495a0d;return db[_0xc56f('0x3a')][_0xc56f('0x5c')]({'where':{'id':_0x2a7a70['params']['id']}})[_0xc56f('0x20')](handleEntityNotFound(_0x497fa4,null))[_0xc56f('0x20')](function(_0x3bfc63){if(_0x3bfc63){_0x195cf7=_0x3bfc63;_0x5492fb['model']=_[_0xc56f('0x54')](db['Dynamics365Configuration'][_0xc56f('0x55')]);_0x5492fb['query']=_[_0xc56f('0x54')](_0x2a7a70[_0xc56f('0x3f')]);_0x5492fb[_0xc56f('0x40')]=_[_0xc56f('0x41')](_0x5492fb['model'],_0x5492fb['query']);_0x121b86[_0xc56f('0x42')]=_[_0xc56f('0x41')](_0x5492fb['model'],qs[_0xc56f('0x43')](_0x2a7a70[_0xc56f('0x3f')]['fields']));_0x121b86[_0xc56f('0x42')]=_0x121b86[_0xc56f('0x42')]['length']?_0x121b86[_0xc56f('0x42')]:_0x5492fb['model'];_0x121b86[_0xc56f('0x47')]=qs[_0xc56f('0x48')](_0x2a7a70[_0xc56f('0x3f')][_0xc56f('0x48')]);_0x121b86[_0xc56f('0x49')]=qs['filters'](_[_0xc56f('0x4a')](_0x2a7a70[_0xc56f('0x3f')],_0x5492fb[_0xc56f('0x40')]));if(_0x2a7a70[_0xc56f('0x3f')]['filter']){_0x121b86[_0xc56f('0x49')]=_[_0xc56f('0x4c')](_0x121b86[_0xc56f('0x49')],{'$or':_['map'](_0x121b86[_0xc56f('0x42')],function(_0x395118){var _0x27a4ea={};_0x27a4ea[_0x395118]={'$like':'%'+_0x2a7a70['query'][_0xc56f('0x4b')]+'%'};return _0x27a4ea;})});}_0x121b86=_[_0xc56f('0x4c')]({},_0x121b86,_0x2a7a70['options']);return _0x195cf7[_0xc56f('0x5b')](_0x121b86);}})[_0xc56f('0x20')](function(_0x250932){if(_0x250932){_0x495a0d=_0x250932[_0xc56f('0x56')];if(!_0x2a7a70[_0xc56f('0x3f')]['hasOwnProperty'](_0xc56f('0x45'))){_0x121b86[_0xc56f('0x46')]=qs['limit'](_0x2a7a70[_0xc56f('0x3f')]['limit']);_0x121b86[_0xc56f('0x2f')]=qs[_0xc56f('0x2f')](_0x2a7a70[_0xc56f('0x3f')][_0xc56f('0x2f')]);}return _0x195cf7['getConfigurations'](_0x121b86);}})[_0xc56f('0x20')](function(_0x47ca3d){if(_0x47ca3d){return _0x47ca3d?{'count':_0x495a0d,'rows':_0x47ca3d}:null;}})[_0xc56f('0x20')](respondWithResult(_0x497fa4,null))[_0xc56f('0x2a')](handleError(_0x497fa4,null));};exports['addConfiguration']=function(_0x7a2347,_0x252fa6,_0x2d9b06){if(_0x7a2347[_0xc56f('0x5a')]['id']){delete _0x7a2347['body']['id'];}return db['Dynamics365Account'][_0xc56f('0x5c')]({'where':{'id':_0x7a2347['params']['id']}})[_0xc56f('0x20')](handleEntityNotFound(_0x252fa6,null))[_0xc56f('0x20')](function(_0x408839){if(_0x408839){_0x7a2347[_0xc56f('0x5a')][_0xc56f('0x5d')]=_0x408839['id'];_0x7a2347['body'][_0xc56f('0x5e')]=integrations[_0xc56f('0x5f')](_0x7a2347[_0xc56f('0x5a')][_0xc56f('0x60')],_0x7a2347[_0xc56f('0x5a')][_0xc56f('0x3c')]);_0x7a2347[_0xc56f('0x5a')][_0xc56f('0x61')]=integrations[_0xc56f('0x62')](_0x7a2347[_0xc56f('0x5a')][_0xc56f('0x60')],_0x7a2347[_0xc56f('0x5a')][_0xc56f('0x3c')]);return db[_0xc56f('0x63')][_0xc56f('0x59')](_0x7a2347[_0xc56f('0x5a')],{'include':[{'model':db[_0xc56f('0x64')],'as':_0xc56f('0x5e')},{'model':db['Dynamics365Field'],'as':_0xc56f('0x61')}]});}return null;})[_0xc56f('0x20')](respondWithResult(_0x252fa6,null))[_0xc56f('0x2a')](handleError(_0x252fa6,null));};exports[_0xc56f('0x65')]=function(_0xbe5775,_0x56b6f8,_0x49b282){var _0x5490b5=_0xbe5775[_0xc56f('0x3f')]['ticketType'];var _0x5a763f=_0x5490b5==='incident'?_0xc56f('0x66'):'PhoneCall';var _0x2344cc='';var _0x2262b6='';var _0x5d4fa6='';var _0x267f00='';var _0x548e06='';var _0x2bb6d6='';var _0x20b1cb='';var _0x3af476='';var _0x2652ed=[_0xc56f('0x67'),'description',_0xc56f('0x68'),_0xc56f('0x69'),_0xc56f('0x6a'),'subject','phonenumber','regardingobjectid','directioncode',_0xc56f('0x6b')];var _0x4d0af6=[_0xc56f('0x6c'),_0xc56f('0x6d'),_0xc56f('0x6e'),_0xc56f('0x6f'),_0xc56f('0x70'),_0xc56f('0x71'),_0xc56f('0x72'),'contractidname',_0xc56f('0x73'),_0xc56f('0x74'),'createdbyname',_0xc56f('0x75'),'createdon',_0xc56f('0x76'),_0xc56f('0x77'),_0xc56f('0x78'),_0xc56f('0x79'),_0xc56f('0x7a'),_0xc56f('0x7b'),_0xc56f('0x7c'),_0xc56f('0x7d'),_0xc56f('0x7e'),_0xc56f('0x7f'),_0xc56f('0x80'),_0xc56f('0x81'),_0xc56f('0x82'),'importsequencenumber',_0xc56f('0x83'),_0xc56f('0x84'),_0xc56f('0x85'),_0xc56f('0x86'),_0xc56f('0x87'),_0xc56f('0x88'),_0xc56f('0x89'),_0xc56f('0x8a'),_0xc56f('0x8b'),_0xc56f('0x8c'),'modifiedonbehalfbyyominame',_0xc56f('0x8d'),'msdyn_iotalertname',_0xc56f('0x8e'),_0xc56f('0x8f'),_0xc56f('0x90'),_0xc56f('0x91'),'owneridtype','owneridyominame','parentcaseidname',_0xc56f('0x92'),_0xc56f('0x93'),_0xc56f('0x94'),_0xc56f('0x95'),_0xc56f('0x96'),_0xc56f('0x97'),_0xc56f('0x98'),'responseby',_0xc56f('0x99'),_0xc56f('0x9a'),'sentimentvalue',_0xc56f('0x9b'),_0xc56f('0x9c'),'socialprofileidname',_0xc56f('0x9d'),'statuscode',_0xc56f('0x9e'),_0xc56f('0x9f'),_0xc56f('0xa0'),_0xc56f('0xa1'),_0xc56f('0xa2'),_0xc56f('0xa3'),_0xc56f('0xa4')];var _0x2fb14c=_0x2652ed[_0xc56f('0xa5')](_0x4d0af6);return db[_0xc56f('0x3a')]['findOne']({'where':{'id':_0xbe5775[_0xc56f('0x53')]['id']},'attributes':['id',_0xc56f('0xa6'),_0xc56f('0xa7'),_0xc56f('0xa8'),_0xc56f('0xa9'),'clientId',_0xc56f('0xaa')]})['then'](handleEntityNotFound(_0x56b6f8,null))[_0xc56f('0x20')](function(_0x3ead6c){if(_0x3ead6c){_0x3af476=_0x3ead6c[_0xc56f('0xa8')];var _0x1110f5=_0x3af476[_0xc56f('0xab')](-0x1);if(_0x1110f5==='/'){_0x3af476=_0x3af476['substring'](0x0,_0x3af476[_0xc56f('0xac')](_0x1110f5));}_0x20b1cb=util['format'](_0xc56f('0xad'),_0x3af476);var _0x193068={'method':_0xc56f('0xae'),'uri':_0xc56f('0xaf')+_0x3ead6c[_0xc56f('0xa9')]+'/oauth2/token','form':{'client_id':_0x3ead6c[_0xc56f('0xb0')],'resource':_0x3af476,'username':_0x3ead6c[_0xc56f('0xa6')],'password':_0x3ead6c['password'],'grant_type':_0xc56f('0xa7'),'client_secret':_0x3ead6c[_0xc56f('0xaa')]},'json':!![]};return rp(_0x193068);}})[_0xc56f('0x20')](function(_0x3da460){_0x2bb6d6=_0x3da460[_0xc56f('0xb1')];var _0x3fc5a6={'method':'GET','uri':encodeURI(_0x20b1cb+_0xc56f('0xb2')+_0x5a763f+'\x27'),'headers':{'Authorization':_0xc56f('0xb3')+_0x2bb6d6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3fc5a6);})[_0xc56f('0x20')](function(_0x137589){var _0x3f87e2=_0x137589[_0xc56f('0xb4')][0x0];var _0x1d40b8=_0x3f87e2[_0xc56f('0xb5')];var _0x1bc7f7={'method':'GET','uri':_0x20b1cb+_0xc56f('0xb6')+_0x1d40b8+_0xc56f('0xb7'),'headers':{'Authorization':_0xc56f('0xb3')+_0x2bb6d6,'If-None-Match':null,'OData-Version':_0xc56f('0xb8')},'json':!![]};return rp(_0x1bc7f7);})[_0xc56f('0x20')](function(_0x4e469d){_0x2344cc=_0x4e469d;_0x2262b6=_0x2344cc[_0xc56f('0xb9')];_0x2262b6=_[_0xc56f('0xba')](_0x2262b6,function(_0x112009){return!_0x2fb14c[_0xc56f('0xbb')](_0x112009['LogicalName']);});var _0x143f0b=[];var _0x150964=[];_0x2262b6[_0xc56f('0xbc')](function(_0xf0dd0){if(_0xf0dd0['@odata.type']){var _0x2e6354=_0xf0dd0[_0xc56f('0xbd')][_0xc56f('0xbe')](_0xf0dd0[_0xc56f('0xbd')][_0xc56f('0xac')]('.')+0x1);if(_0x2e6354==='PicklistAttributeMetadata'){_0x143f0b[_0xc56f('0xbf')](getSelectList(_0x20b1cb,_0x5490b5,_0x150964,_0x2344cc[_0xc56f('0xb5')],_0xf0dd0['MetadataId'],_0x2bb6d6));}}});return Promise[_0xc56f('0xc0')](_0x143f0b);})[_0xc56f('0x20')](function(_0x56a906){_0x5d4fa6=_0x56a906[0x0];var _0x2f84e1=[];var _0x2db4d1=[];_0x2262b6[_0xc56f('0xbc')](function(_0x57478d){if(!_[_0xc56f('0xc1')](_0x57478d[_0xc56f('0xbd')])){var _0x29e402=_0x57478d[_0xc56f('0xbd')]['substring'](_0x57478d[_0xc56f('0xbd')][_0xc56f('0xac')]('.')+0x1);if(_0x29e402===_0xc56f('0xc2')){_0x2f84e1[_0xc56f('0xbf')](getBooleanList(_0x20b1cb,_0x5490b5,_0x2db4d1,_0x2344cc[_0xc56f('0xb5')],_0x57478d[_0xc56f('0xb5')],_0x2bb6d6));}}});return Promise[_0xc56f('0xc0')](_0x2f84e1);})[_0xc56f('0x20')](function(_0x499e23){_0x267f00=_0x499e23[0x0];var _0x31a2bd=[];var _0x2e0f69=[];_0x2262b6[_0xc56f('0xbc')](function(_0xd5e68b){if(_0xd5e68b['@odata.type']){var _0x4abb84=_0xd5e68b[_0xc56f('0xbd')]['substring'](_0xd5e68b[_0xc56f('0xbd')][_0xc56f('0xac')]('.')+0x1);if(_0x4abb84===_0xc56f('0xc3')||_0x4abb84===_0xc56f('0xc4')||_0x4abb84===_0xc56f('0xc5')||_0x4abb84===_0xc56f('0xc6')||_0x4abb84===_0xc56f('0xc7')||_0x4abb84===_0xc56f('0xc8')||_0x4abb84===_0xc56f('0xc9')||_0x4abb84===_0xc56f('0xca')||_0x4abb84===_0xc56f('0xcb')||_0x4abb84===_0xc56f('0xcc')){_0x31a2bd[_0xc56f('0xbf')](getInputList(_0x20b1cb,_0x5490b5,_0x4abb84,_0x2e0f69,_0x2344cc['MetadataId'],_0xd5e68b['MetadataId'],_0x2bb6d6));}}});return Promise[_0xc56f('0xc0')](_0x31a2bd);})[_0xc56f('0x20')](function(_0x4d8baa){_0x548e06=_0x4d8baa[0x0];var _0x5472c8=_0x5d4fa6[_0xc56f('0xa5')](_0x267f00)['concat'](_0x548e06);var _0x3045d0={'count':_0x5472c8[_0xc56f('0x56')],'rows':_0x5472c8};return _0x3045d0;})[_0xc56f('0x20')](respondWithResult(_0x56b6f8,null))[_0xc56f('0x2a')](function(_0x449fa1){var _0x7194d2=_0xbe5775['query'][_0xc56f('0x1b')]?0x1f4:_0x449fa1[_0xc56f('0xcd')]||0x1f4;logger[_0xc56f('0x27')](_0x449fa1['stack']);delete _0x449fa1[_0xc56f('0x37')];if(_0x7194d2===0x191){_0x7194d2=0x190;}_0x56b6f8['status'](_0x7194d2)[_0xc56f('0x38')](_0xbe5775[_0xc56f('0x3f')][_0xc56f('0x1b')]?{'message':_0xc56f('0xce'),'statusCode':_0x449fa1[_0xc56f('0xcd')]}:_0x449fa1);});};function getSelectList(_0x13507d,_0x4a181d,_0x107c95,_0x3d9bb6,_0x1d93bf,_0x409cfb){var _0x3636ff={'method':_0xc56f('0xcf'),'uri':_0x13507d+'EntityDefinitions('+_0x3d9bb6+')/Attributes('+_0x1d93bf+_0xc56f('0xd0')+_0xc56f('0xd1'),'headers':{'Authorization':_0xc56f('0xb3')+_0x409cfb,'If-None-Match':null,'OData-Version':_0xc56f('0xb8')},'json':!![]};return rp(_0x3636ff)[_0xc56f('0x20')](function(_0x5ee849){var _0x1673f6=[];var _0x485bbb=_0x5ee849['OptionSet']['Options'];_0x485bbb['forEach'](function(_0x3bd193){_0x1673f6[_0xc56f('0xbf')]({'name':_0x3bd193['Label'][_0xc56f('0xd2')][_0xc56f('0xd3')],'value':String(_0x3bd193[_0xc56f('0xd4')])});});var _0x5c90de={'id':_0x4a181d+'_'+_0x5ee849[_0xc56f('0xd5')],'name':_0x5ee849['DisplayName'][_0xc56f('0xd2')]['Label'],'custom':![],'options':_0x1673f6};_0x107c95[_0xc56f('0xbf')](_0x5c90de);return _0x107c95;});}function getBooleanList(_0x4e36d2,_0x36ca6d,_0x1253f0,_0x4eeefa,_0x32db49,_0x5dda5f){var _0x4158bc={'method':_0xc56f('0xcf'),'uri':_0x4e36d2+_0xc56f('0xb6')+_0x4eeefa+')/Attributes('+_0x32db49+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xc56f('0xb3')+_0x5dda5f,'If-None-Match':null,'OData-Version':_0xc56f('0xb8')},'json':!![]};return rp(_0x4158bc)[_0xc56f('0x20')](function(_0x2f02ad){var _0xe42f0c=[];_0xe42f0c['push']({'name':_0x2f02ad[_0xc56f('0xd6')][_0xc56f('0xd7')]['Label']['UserLocalizedLabel'][_0xc56f('0xd3')],'value':_0xc56f('0xd8')},{'name':_0x2f02ad[_0xc56f('0xd6')]['FalseOption'][_0xc56f('0xd3')][_0xc56f('0xd2')]['Label'],'value':'false'});var _0x1a6d08={'id':_0x36ca6d+'_'+_0x2f02ad[_0xc56f('0xd5')],'name':_0x2f02ad[_0xc56f('0xd9')][_0xc56f('0xd2')][_0xc56f('0xd3')],'custom':![],'options':_0xe42f0c};_0x1253f0[_0xc56f('0xbf')](_0x1a6d08);return _0x1253f0;});}function getInputList(_0x37d77f,_0x4ec32c,_0x464eae,_0x2d5dab,_0xf35a01,_0x1e2ffd,_0x43c2b4){var _0xe6609c={'method':_0xc56f('0xcf'),'uri':_0x37d77f+_0xc56f('0xb6')+_0xf35a01+_0xc56f('0xda')+_0x1e2ffd+_0xc56f('0xdb')+_0x464eae+_0xc56f('0xdc'),'headers':{'Authorization':_0xc56f('0xb3')+_0x43c2b4,'If-None-Match':null,'OData-Version':_0xc56f('0xb8')},'json':!![]};return rp(_0xe6609c)[_0xc56f('0x20')](function(_0xcff9e3){var _0x1e8c42={'id':_0x4ec32c+'_'+_0xcff9e3[_0xc56f('0xd5')],'name':_0xcff9e3['DisplayName'][_0xc56f('0xd2')]?_0xcff9e3['DisplayName'][_0xc56f('0xd2')][_0xc56f('0xd3')]:_0xcff9e3['LogicalName'],'custom':![],'options':[]};_0x2d5dab[_0xc56f('0xbf')](_0x1e8c42);return _0x2d5dab;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 7b40087..fa1b1b0 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0cac=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Account','lodash','util','../../config/logger'];(function(_0x316304,_0x603f){var _0x1d0fc7=function(_0x576de9){while(--_0x576de9){_0x316304['push'](_0x316304['shift']());}};_0x1d0fc7(++_0x603f);}(_0x0cac,0x81));var _0xc0ca=function(_0x279645,_0x2ed6c5){_0x279645=_0x279645-0x0;var _0x1b6272=_0x0cac[_0x279645];return _0x1b6272;};'use strict';var _=require(_0xc0ca('0x0'));var util=require(_0xc0ca('0x1'));var logger=require(_0xc0ca('0x2'))(_0xc0ca('0x3'));var moment=require('moment');var BPromise=require(_0xc0ca('0x4'));var rp=require(_0xc0ca('0x5'));var fs=require('fs');var path=require(_0xc0ca('0x6'));var rimraf=require(_0xc0ca('0x7'));var config=require(_0xc0ca('0x8'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0xc0ca('0x9')]=function(_0x31bb59,_0x4318d8){return _0x31bb59[_0xc0ca('0xa')](_0xc0ca('0xb'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bcd=['define','Dynamics365Account','int_dynamics365_accounts','lodash','../../config/logger','api','bluebird','request-promise','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2bcd,0xcb));var _0xd2bc=function(_0x5b59ff,_0x36c9f7){_0x5b59ff=_0x5b59ff-0x0;var _0x1d95af=_0x2bcd[_0x5b59ff];return _0x1d95af;};'use strict';var _=require(_0xd2bc('0x0'));var util=require('util');var logger=require(_0xd2bc('0x1'))(_0xd2bc('0x2'));var moment=require('moment');var BPromise=require(_0xd2bc('0x3'));var rp=require(_0xd2bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd2bc('0x5'));var integrations=require(_0xd2bc('0x6'));module['exports']=function(_0x570129,_0xf70895){return _0x570129[_0xd2bc('0x7')](_0xd2bc('0x8'),attributes,{'tableName':_0xd2bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index c0cb349..55f9c26 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js +++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3024=['where','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','include','map','model','ShowDynamics365Account','find'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x3024,0x64));var _0x4302=function(_0x4cd458,_0xb5eee0){_0x4cd458=_0x4cd458-0x0;var _0x1717fc=_0x3024[_0x4cd458];return _0x1717fc;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var moment=require('moment');var BPromise=require(_0x4302('0x2'));var rs=require(_0x4302('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4302('0x4'));var logger=require('../../config/logger')(_0x4302('0x5'));var config=require(_0x4302('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4302('0x7')][_0x4302('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c3983,_0xced9fc,_0x2aecd7){return new BPromise(function(_0x3c007b,_0x285613){return client[_0x4302('0x9')](_0x4c3983,_0x2aecd7)[_0x4302('0xa')](function(_0x41580c){logger['info'](_0x4302('0xb'),_0xced9fc,_0x4302('0xc'));logger[_0x4302('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0xced9fc,_0x4302('0xc'),JSON[_0x4302('0xe')](_0x41580c));if(_0x41580c['error']){if(_0x41580c[_0x4302('0xf')][_0x4302('0x10')]===0x1f4){logger[_0x4302('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0xced9fc,_0x41580c[_0x4302('0xf')][_0x4302('0x11')]);return _0x285613(_0x41580c['error'][_0x4302('0x11')]);}logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x41580c['error'][_0x4302('0x11')]);return _0x3c007b(_0x41580c[_0x4302('0xf')]['message']);}else{logger[_0x4302('0x12')](_0x4302('0xb'),_0xced9fc,'request\x20sent');_0x3c007b(_0x41580c[_0x4302('0x13')][_0x4302('0x11')]);}})[_0x4302('0x14')](function(_0x32178f){logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x32178f);_0x285613(_0x32178f);});});}exports[_0x4302('0x15')]=function(_0x23aa0e){var _0x10639b=this;return new Promise(function(_0x41de23,_0x325b85){return db[_0x4302('0x16')][_0x4302('0x17')]({'raw':_0x23aa0e[_0x4302('0x18')]?_0x23aa0e['options'][_0x4302('0x19')]===undefined?!![]:![]:!![],'where':_0x23aa0e['options']?_0x23aa0e[_0x4302('0x18')]['where']||null:null,'attributes':_0x23aa0e['options']?_0x23aa0e[_0x4302('0x18')][_0x4302('0x1a')]||null:null,'limit':_0x23aa0e[_0x4302('0x18')]?_0x23aa0e[_0x4302('0x18')]['limit']||null:null,'include':_0x23aa0e['options']?_0x23aa0e[_0x4302('0x18')][_0x4302('0x1b')]?_[_0x4302('0x1c')](_0x23aa0e['options'][_0x4302('0x1b')],function(_0x156072){return{'model':db[_0x156072[_0x4302('0x1d')]],'as':_0x156072['as'],'attributes':_0x156072[_0x4302('0x1a')],'include':_0x156072['include']?_['map'](_0x156072['include'],function(_0x5a2952){return{'model':db[_0x5a2952[_0x4302('0x1d')]],'as':_0x5a2952['as'],'attributes':_0x5a2952[_0x4302('0x1a')],'include':_0x5a2952['include']?_[_0x4302('0x1c')](_0x5a2952[_0x4302('0x1b')],function(_0x20fe19){return{'model':db[_0x20fe19['model']],'as':_0x20fe19['as'],'attributes':_0x20fe19[_0x4302('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x481d44){logger['info'](_0x4302('0x15'),_0x23aa0e);logger['debug'](_0x4302('0x15'),_0x23aa0e,JSON[_0x4302('0xe')](_0x481d44));_0x41de23(_0x481d44);})['catch'](function(_0x1b057f){logger['error'](_0x4302('0x15'),_0x1b057f[_0x4302('0x11')],_0x23aa0e);_0x325b85(_0x10639b[_0x4302('0xf')](0x1f4,_0x1b057f[_0x4302('0x11')]));});});};exports[_0x4302('0x1e')]=function(_0x45474f){var _0x5d766=this;return new Promise(function(_0x34f9db,_0x3cd7a2){return db['Dynamics365Account'][_0x4302('0x1f')]({'raw':_0x45474f[_0x4302('0x18')]?_0x45474f[_0x4302('0x18')][_0x4302('0x19')]===undefined?!![]:![]:!![],'where':_0x45474f['options']?_0x45474f[_0x4302('0x18')][_0x4302('0x20')]||null:null,'attributes':_0x45474f[_0x4302('0x18')]?_0x45474f[_0x4302('0x18')][_0x4302('0x1a')]||null:null,'include':_0x45474f['options']?_0x45474f[_0x4302('0x18')][_0x4302('0x1b')]?_[_0x4302('0x1c')](_0x45474f[_0x4302('0x18')][_0x4302('0x1b')],function(_0x1d5b73){return{'model':db[_0x1d5b73[_0x4302('0x1d')]],'as':_0x1d5b73['as'],'attributes':_0x1d5b73[_0x4302('0x1a')],'include':_0x1d5b73[_0x4302('0x1b')]?_['map'](_0x1d5b73[_0x4302('0x1b')],function(_0x5dd57b){return{'model':db[_0x5dd57b[_0x4302('0x1d')]],'as':_0x5dd57b['as'],'attributes':_0x5dd57b['attributes'],'include':_0x5dd57b['include']?_[_0x4302('0x1c')](_0x5dd57b[_0x4302('0x1b')],function(_0x1684f2){return{'model':db[_0x1684f2['model']],'as':_0x1684f2['as'],'attributes':_0x1684f2[_0x4302('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4302('0xa')](function(_0x8166ed){logger[_0x4302('0x12')]('ShowDynamics365Account',_0x45474f);logger[_0x4302('0xd')]('ShowDynamics365Account',_0x45474f,JSON[_0x4302('0xe')](_0x8166ed));_0x34f9db(_0x8166ed);})[_0x4302('0x14')](function(_0x64f250){logger[_0x4302('0xf')](_0x4302('0x1e'),_0x64f250['message'],_0x45474f);_0x3cd7a2(_0x5d766[_0x4302('0xf')](0x1f4,_0x64f250['message']));});});}; \ No newline at end of file +var _0x5a9e=['request','then','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','GetDynamics365Account','options','raw','where','attributes','limit','map','model','include','info','stringify','ShowDynamics365Account','Dynamics365Account','debug','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0x5a9e[_0x87506e];return _0x5496a4;};'use strict';var _=require('lodash');var util=require(_0xe5a9('0x0'));var moment=require(_0xe5a9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5a9('0x2'));var db=require(_0xe5a9('0x3'))['db'];var utils=require(_0xe5a9('0x4'));var logger=require(_0xe5a9('0x5'))(_0xe5a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xe5a9('0x7'));var client=jayson['client'][_0xe5a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16c74e,_0x561aca,_0x4acfa6){return new BPromise(function(_0x2ed1d0,_0x13bb4f){return client[_0xe5a9('0x9')](_0x16c74e,_0x4acfa6)[_0xe5a9('0xa')](function(_0x1336ca){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x561aca,_0xe5a9('0xb'));logger['debug'](_0xe5a9('0xc'),_0x561aca,'request\x20sent',JSON['stringify'](_0x1336ca));if(_0x1336ca[_0xe5a9('0xd')]){if(_0x1336ca[_0xe5a9('0xd')][_0xe5a9('0xe')]===0x1f4){logger[_0xe5a9('0xd')](_0xe5a9('0xf'),_0x561aca,_0x1336ca[_0xe5a9('0xd')][_0xe5a9('0x10')]);return _0x13bb4f(_0x1336ca['error'][_0xe5a9('0x10')]);}logger[_0xe5a9('0xd')](_0xe5a9('0xf'),_0x561aca,_0x1336ca[_0xe5a9('0xd')][_0xe5a9('0x10')]);return _0x2ed1d0(_0x1336ca[_0xe5a9('0xd')][_0xe5a9('0x10')]);}else{logger['info'](_0xe5a9('0xf'),_0x561aca,_0xe5a9('0xb'));_0x2ed1d0(_0x1336ca[_0xe5a9('0x11')]['message']);}})['catch'](function(_0x1c46ba){logger[_0xe5a9('0xd')](_0xe5a9('0xf'),_0x561aca,_0x1c46ba);_0x13bb4f(_0x1c46ba);});});}exports[_0xe5a9('0x12')]=function(_0xd5f697){var _0x3c2e2c=this;return new Promise(function(_0x509cdc,_0x2ca0f3){return db['Dynamics365Account']['findAll']({'raw':_0xd5f697[_0xe5a9('0x13')]?_0xd5f697[_0xe5a9('0x13')][_0xe5a9('0x14')]===undefined?!![]:![]:!![],'where':_0xd5f697[_0xe5a9('0x13')]?_0xd5f697[_0xe5a9('0x13')][_0xe5a9('0x15')]||null:null,'attributes':_0xd5f697['options']?_0xd5f697['options'][_0xe5a9('0x16')]||null:null,'limit':_0xd5f697[_0xe5a9('0x13')]?_0xd5f697[_0xe5a9('0x13')][_0xe5a9('0x17')]||null:null,'include':_0xd5f697[_0xe5a9('0x13')]?_0xd5f697[_0xe5a9('0x13')]['include']?_[_0xe5a9('0x18')](_0xd5f697[_0xe5a9('0x13')]['include'],function(_0x1c15d3){return{'model':db[_0x1c15d3[_0xe5a9('0x19')]],'as':_0x1c15d3['as'],'attributes':_0x1c15d3['attributes'],'include':_0x1c15d3[_0xe5a9('0x1a')]?_['map'](_0x1c15d3[_0xe5a9('0x1a')],function(_0x1b1fff){return{'model':db[_0x1b1fff[_0xe5a9('0x19')]],'as':_0x1b1fff['as'],'attributes':_0x1b1fff[_0xe5a9('0x16')],'include':_0x1b1fff['include']?_[_0xe5a9('0x18')](_0x1b1fff[_0xe5a9('0x1a')],function(_0x20e1a1){return{'model':db[_0x20e1a1[_0xe5a9('0x19')]],'as':_0x20e1a1['as'],'attributes':_0x20e1a1[_0xe5a9('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe5a9('0xa')](function(_0x25355f){logger[_0xe5a9('0x1b')](_0xe5a9('0x12'),_0xd5f697);logger['debug'](_0xe5a9('0x12'),_0xd5f697,JSON[_0xe5a9('0x1c')](_0x25355f));_0x509cdc(_0x25355f);})['catch'](function(_0x9b9837){logger['error'](_0xe5a9('0x12'),_0x9b9837[_0xe5a9('0x10')],_0xd5f697);_0x2ca0f3(_0x3c2e2c[_0xe5a9('0xd')](0x1f4,_0x9b9837[_0xe5a9('0x10')]));});});};exports[_0xe5a9('0x1d')]=function(_0x25f522){var _0x34b288=this;return new Promise(function(_0x291595,_0x314d61){return db[_0xe5a9('0x1e')]['find']({'raw':_0x25f522[_0xe5a9('0x13')]?_0x25f522[_0xe5a9('0x13')][_0xe5a9('0x14')]===undefined?!![]:![]:!![],'where':_0x25f522[_0xe5a9('0x13')]?_0x25f522[_0xe5a9('0x13')][_0xe5a9('0x15')]||null:null,'attributes':_0x25f522['options']?_0x25f522[_0xe5a9('0x13')]['attributes']||null:null,'include':_0x25f522[_0xe5a9('0x13')]?_0x25f522[_0xe5a9('0x13')][_0xe5a9('0x1a')]?_[_0xe5a9('0x18')](_0x25f522[_0xe5a9('0x13')][_0xe5a9('0x1a')],function(_0xb7f384){return{'model':db[_0xb7f384['model']],'as':_0xb7f384['as'],'attributes':_0xb7f384[_0xe5a9('0x16')],'include':_0xb7f384[_0xe5a9('0x1a')]?_[_0xe5a9('0x18')](_0xb7f384[_0xe5a9('0x1a')],function(_0x155946){return{'model':db[_0x155946[_0xe5a9('0x19')]],'as':_0x155946['as'],'attributes':_0x155946['attributes'],'include':_0x155946[_0xe5a9('0x1a')]?_[_0xe5a9('0x18')](_0x155946[_0xe5a9('0x1a')],function(_0x4d940e){return{'model':db[_0x4d940e[_0xe5a9('0x19')]],'as':_0x4d940e['as'],'attributes':_0x4d940e[_0xe5a9('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe5a9('0xa')](function(_0x2154fb){logger[_0xe5a9('0x1b')](_0xe5a9('0x1d'),_0x25f522);logger[_0xe5a9('0x1f')](_0xe5a9('0x1d'),_0x25f522,JSON[_0xe5a9('0x1c')](_0x2154fb));_0x291595(_0x2154fb);})[_0xe5a9('0x20')](function(_0x3f9b6a){logger[_0xe5a9('0xd')](_0xe5a9('0x1d'),_0x3f9b6a['message'],_0x25f522);_0x314d61(_0x34b288['error'](0x1f4,_0x3f9b6a[_0xe5a9('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 6c062a3..a3a0341 100644 --- a/server/api/intDynamics365Configuration/index.js +++ b/server/api/intDynamics365Configuration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x771b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4b23e5,_0xc8afac){var _0x29a15d=function(_0x46034d){while(--_0x46034d){_0x4b23e5['push'](_0x4b23e5['shift']());}};_0x29a15d(++_0xc8afac);}(_0x771b,0x191));var _0xb771=function(_0x3ab623,_0x4d3c0e){_0x3ab623=_0x3ab623-0x0;var _0x2f2dc4=_0x771b[_0x3ab623];return _0x2f2dc4;};'use strict';var multer=require(_0xb771('0x0'));var util=require(_0xb771('0x1'));var path=require(_0xb771('0x2'));var timeout=require(_0xb771('0x3'));var express=require(_0xb771('0x4'));var router=express[_0xb771('0x5')]();var auth=require(_0xb771('0x6'));var interaction=require(_0xb771('0x7'));var config=require(_0xb771('0x8'));var controller=require(_0xb771('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb771('0xa')]);router[_0xb771('0xb')](_0xb771('0xc'),auth[_0xb771('0xd')](),controller[_0xb771('0xe')]);router[_0xb771('0xb')](_0xb771('0xf'),auth[_0xb771('0xd')](),controller[_0xb771('0x10')]);router[_0xb771('0xb')](_0xb771('0x11'),auth[_0xb771('0xd')](),controller[_0xb771('0x12')]);router[_0xb771('0xb')]('/:id/descriptions',auth[_0xb771('0xd')](),controller[_0xb771('0x13')]);router[_0xb771('0x14')]('/',auth[_0xb771('0xd')](),controller[_0xb771('0x15')]);router[_0xb771('0x16')](_0xb771('0xc'),auth[_0xb771('0xd')](),controller[_0xb771('0x17')]);router[_0xb771('0x18')](_0xb771('0xc'),auth[_0xb771('0xd')](),controller[_0xb771('0x19')]);module[_0xb771('0x1a')]=router; \ No newline at end of file +var _0x469e=['get','/:id','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index'];(function(_0xe8a48e,_0x5d766a){var _0x253ba3=function(_0x31461b){while(--_0x31461b){_0xe8a48e['push'](_0xe8a48e['shift']());}};_0x253ba3(++_0x5d766a);}(_0x469e,0x1d9));var _0xe469=function(_0x5e34a4,_0x2e63ed){_0x5e34a4=_0x5e34a4-0x0;var _0x8d41d7=_0x469e[_0x5e34a4];return _0x8d41d7;};'use strict';var multer=require(_0xe469('0x0'));var util=require(_0xe469('0x1'));var path=require('path');var timeout=require(_0xe469('0x2'));var express=require(_0xe469('0x3'));var router=express[_0xe469('0x4')]();var auth=require(_0xe469('0x5'));var interaction=require(_0xe469('0x6'));var config=require(_0xe469('0x7'));var controller=require(_0xe469('0x8'));router['get']('/',auth[_0xe469('0x9')](),controller[_0xe469('0xa')]);router[_0xe469('0xb')](_0xe469('0xc'),auth[_0xe469('0x9')](),controller['show']);router[_0xe469('0xb')](_0xe469('0xd'),auth[_0xe469('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xe469('0x9')](),controller[_0xe469('0xe')]);router['get'](_0xe469('0xf'),auth[_0xe469('0x9')](),controller[_0xe469('0x10')]);router[_0xe469('0x11')]('/',auth[_0xe469('0x9')](),controller[_0xe469('0x12')]);router[_0xe469('0x13')](_0xe469('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe469('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe469('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 89075c0..aa45a2d 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cd3=['STRING','ENUM','incident','phonecall','exports'];(function(_0x24d3a5,_0x2145e2){var _0x5e2c3f=function(_0xa8aa9){while(--_0xa8aa9){_0x24d3a5['push'](_0x24d3a5['shift']());}};_0x5e2c3f(++_0x2145e2);}(_0x4cd3,0x12b));var _0x34cd=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x4cd3[_0x45ee03];return _0x13d535;};'use strict';var Sequelize=require('sequelize');module[_0x34cd('0x0')]={'name':{'type':Sequelize[_0x34cd('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x34cd('0x2')](_0x34cd('0x3'),_0x34cd('0x4')),'defaultValue':_0x34cd('0x3')}}; \ No newline at end of file +var _0x77c8=['STRING','sequelize','exports'];(function(_0x4fce24,_0xa929c1){var _0x55a990=function(_0xde190c){while(--_0xde190c){_0x4fce24['push'](_0x4fce24['shift']());}};_0x55a990(++_0xa929c1);}(_0x77c8,0xa9));var _0x877c=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x77c8[_0x2706da];return _0x3ba87e;};'use strict';var Sequelize=require(_0x877c('0x0'));module[_0x877c('0x1')]={'name':{'type':Sequelize[_0x877c('0x2')]},'description':{'type':Sequelize[_0x877c('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident','phonecall'),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 4736900..fec5e32 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1531=['type','VIRTUAL','name','filter','options','Dynamics365Configuration','count','includeAll','include','findAll','rows','show','params','find','update','body','getFields','Dynamics365Field','getSubjects','findOne','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','save','destroy','stack','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x26d097,_0x1267e1){var _0x235d60=function(_0x2452b4){while(--_0x2452b4){_0x26d097['push'](_0x26d097['shift']());}};_0x235d60(++_0x1267e1);}(_0x1531,0x74));var _0x1153=function(_0x388108,_0x458ec5){_0x388108=_0x388108-0x0;var _0x192a49=_0x1531[_0x388108];return _0x192a49;};'use strict';var pdf=require(_0x1153('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1153('0x1'));var zipdir=require(_0x1153('0x2'));var jsonpatch=require(_0x1153('0x3'));var rp=require(_0x1153('0x4'));var moment=require(_0x1153('0x5'));var BPromise=require(_0x1153('0x6'));var Mustache=require('mustache');var util=require(_0x1153('0x7'));var path=require('path');var sox=require(_0x1153('0x8'));var csv=require(_0x1153('0x9'));var ejs=require(_0x1153('0xa'));var fs=require('fs');var _=require(_0x1153('0xb'));var squel=require(_0x1153('0xc'));var crypto=require(_0x1153('0xd'));var jsforce=require(_0x1153('0xe'));var deskjs=require(_0x1153('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1153('0x10'));var Papa=require(_0x1153('0x11'));var Redis=require(_0x1153('0x12'));var authService=require(_0x1153('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1153('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1153('0x15'))(_0x1153('0x16'));var utils=require(_0x1153('0x17'));var config=require(_0x1153('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x1153('0x19')][_0x1153('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2ab89c,_0x125b92,_0x38d143){if(_0x38d143){var _0x955cca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x955cca[_0x1153('0x1b')](_0x125b92)){return _0x2ab89c;}else{throw new db[(_0x1153('0x1c'))][(_0x1153('0x1d'))](_0x1153('0x1e'));}}else{return _0x2ab89c;}}function respondWithRpcPromise(_0x41f04e,_0x5e092e,_0x451832,_0x1441b3){return new BPromise(function(_0x132f73,_0x3b8373){var _0x384423=_0x1441b3||client;return _0x384423[_0x1153('0x1f')](_0x41f04e,_0x451832)[_0x1153('0x20')](function(_0xaad16e){logger['info'](_0x1153('0x21'),_0x5e092e,_0x1153('0x22'));logger[_0x1153('0x23')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5e092e,_0x1153('0x22'),JSON[_0x1153('0x24')](_0xaad16e));if(_0xaad16e[_0x1153('0x25')]){if(_0xaad16e[_0x1153('0x25')][_0x1153('0x26')]===0x1f4){logger['error'](_0x1153('0x21'),_0x5e092e,_0xaad16e[_0x1153('0x25')][_0x1153('0x27')]);return _0x3b8373(_0xaad16e[_0x1153('0x25')][_0x1153('0x27')]);}logger[_0x1153('0x25')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5e092e,_0xaad16e[_0x1153('0x25')]['message']);return _0x132f73(_0xaad16e['error'][_0x1153('0x27')]);}else{logger[_0x1153('0x28')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5e092e,'request\x20sent');_0x132f73(_0xaad16e[_0x1153('0x29')][_0x1153('0x27')]);}})[_0x1153('0x2a')](function(_0x218d3f){logger['error'](_0x1153('0x21'),_0x5e092e,_0x218d3f);_0x3b8373(_0x218d3f);});});}function respondWithStatusCode(_0x2d40c3,_0x4e3fd0){_0x4e3fd0=_0x4e3fd0||0xcc;return function(_0x142675){if(_0x142675){return _0x2d40c3[_0x1153('0x2b')](_0x4e3fd0);}return _0x2d40c3['status'](_0x4e3fd0)[_0x1153('0x2c')]();};}function respondWithResult(_0x22509d,_0x42dc02){_0x42dc02=_0x42dc02||0xc8;return function(_0x226932){if(_0x226932){return _0x22509d[_0x1153('0x2d')](_0x42dc02)[_0x1153('0x2e')](_0x226932);}};}function respondWithFilteredResult(_0x39ab22,_0x493e44){return function(_0x26da59){if(_0x26da59){var _0x3384da=_0x26da59['count'],_0x360d88=_0x493e44[_0x1153('0x2f')],_0x5e4a94=_0x493e44['offset']+_0x493e44[_0x1153('0x30')],_0x1caa62;if(_0x5e4a94>=_0x3384da){_0x5e4a94=_0x3384da;_0x1caa62=0xc8;}else{_0x1caa62=0xce;}_0x39ab22[_0x1153('0x2d')](_0x1caa62);return _0x39ab22[_0x1153('0x31')](_0x1153('0x32'),_0x360d88+'-'+_0x5e4a94+'/'+_0x3384da)[_0x1153('0x2e')](_0x26da59);}return null;};}function patchUpdates(_0x564f6a){return function(_0xaa600c){try{jsonpatch['apply'](_0xaa600c,_0x564f6a,!![]);}catch(_0x14ed96){return BPromise['reject'](_0x14ed96);}return _0xaa600c[_0x1153('0x33')]();};}function saveUpdates(_0x3c5b87,_0x3f96db){return function(_0x52412b){if(_0x52412b){return _0x52412b['update'](_0x3c5b87)['then'](function(_0x3badf7){return _0x3badf7;});}return null;};}function removeEntity(_0x3504e9,_0x4c53df){return function(_0x693e68){if(_0x693e68){return _0x693e68[_0x1153('0x34')]()['then'](function(){_0x3504e9[_0x1153('0x2d')](0xcc)[_0x1153('0x2c')]();});}};}function handleEntityNotFound(_0x32e8b9,_0x588b42){return function(_0x126648){if(!_0x126648){_0x32e8b9[_0x1153('0x2b')](0x194);}return _0x126648;};}function handleError(_0x30e9c4,_0x1fcf36){_0x1fcf36=_0x1fcf36||0x1f4;return function(_0x5614c2){logger['error'](_0x5614c2[_0x1153('0x35')]);if(_0x5614c2['name']){delete _0x5614c2['name'];}_0x30e9c4[_0x1153('0x2d')](_0x1fcf36)[_0x1153('0x36')](_0x5614c2);};}exports['index']=function(_0x2d1daa,_0x5460d9){var _0x53857b={},_0x40bf76={},_0x4e05fc={'count':0x0,'rows':[]};var _0x5a19cd=_[_0x1153('0x37')](db['Dynamics365Configuration'][_0x1153('0x38')],function(_0x5e0202){return{'name':_0x5e0202[_0x1153('0x39')],'type':_0x5e0202['type'][_0x1153('0x3a')]};});_0x40bf76[_0x1153('0x3b')]=_[_0x1153('0x37')](_0x5a19cd,'name');_0x40bf76[_0x1153('0x3c')]=_[_0x1153('0x3d')](_0x2d1daa['query']);_0x40bf76[_0x1153('0x3e')]=_[_0x1153('0x3f')](_0x40bf76[_0x1153('0x3b')],_0x40bf76[_0x1153('0x3c')]);_0x53857b[_0x1153('0x40')]=_[_0x1153('0x3f')](_0x40bf76[_0x1153('0x3b')],qs[_0x1153('0x41')](_0x2d1daa['query']['fields']));_0x53857b['attributes']=_0x53857b['attributes'][_0x1153('0x42')]?_0x53857b['attributes']:_0x40bf76[_0x1153('0x3b')];if(!_0x2d1daa[_0x1153('0x3c')][_0x1153('0x43')](_0x1153('0x44'))){_0x53857b[_0x1153('0x30')]=qs['limit'](_0x2d1daa['query'][_0x1153('0x30')]);_0x53857b[_0x1153('0x2f')]=qs[_0x1153('0x2f')](_0x2d1daa[_0x1153('0x3c')]['offset']);}_0x53857b[_0x1153('0x45')]=qs[_0x1153('0x46')](_0x2d1daa[_0x1153('0x3c')][_0x1153('0x46')]);_0x53857b[_0x1153('0x47')]=qs[_0x1153('0x3e')](_[_0x1153('0x48')](_0x2d1daa['query'],_0x40bf76[_0x1153('0x3e')]));if(_0x2d1daa[_0x1153('0x3c')]['filter']){_0x53857b[_0x1153('0x47')]=_[_0x1153('0x49')](_0x53857b[_0x1153('0x47')],{'$or':_[_0x1153('0x37')](_0x5a19cd,function(_0xb766dd){if(_0xb766dd[_0x1153('0x4a')]!==_0x1153('0x4b')){var _0x123d15={};_0x123d15[_0xb766dd[_0x1153('0x4c')]]={'$like':'%'+_0x2d1daa[_0x1153('0x3c')][_0x1153('0x4d')]+'%'};return _0x123d15;}})});}_0x53857b=_['merge']({},_0x53857b,_0x2d1daa[_0x1153('0x4e')]);var _0x1c3afc={'where':_0x53857b['where']};return db[_0x1153('0x4f')]['count'](_0x1c3afc)[_0x1153('0x20')](function(_0xa0a79d){_0x4e05fc[_0x1153('0x50')]=_0xa0a79d;if(_0x2d1daa[_0x1153('0x3c')][_0x1153('0x51')]){_0x53857b[_0x1153('0x52')]=[{'all':!![]}];}return db[_0x1153('0x4f')][_0x1153('0x53')](_0x53857b);})[_0x1153('0x20')](function(_0x3d71c4){_0x4e05fc[_0x1153('0x54')]=_0x3d71c4;return _0x4e05fc;})['then'](respondWithFilteredResult(_0x5460d9,_0x53857b))[_0x1153('0x2a')](handleError(_0x5460d9,null));};exports[_0x1153('0x55')]=function(_0x15389b,_0x34cf14){var _0x2dc235={'raw':![],'where':{'id':_0x15389b[_0x1153('0x56')]['id']}},_0x2fd49f={};_0x2fd49f[_0x1153('0x3b')]=_[_0x1153('0x3d')](db[_0x1153('0x4f')]['rawAttributes']);_0x2fd49f[_0x1153('0x3c')]=_[_0x1153('0x3d')](_0x15389b[_0x1153('0x3c')]);_0x2fd49f['filters']=_[_0x1153('0x3f')](_0x2fd49f[_0x1153('0x3b')],_0x2fd49f[_0x1153('0x3c')]);_0x2dc235[_0x1153('0x40')]=_[_0x1153('0x3f')](_0x2fd49f[_0x1153('0x3b')],qs[_0x1153('0x41')](_0x15389b[_0x1153('0x3c')][_0x1153('0x41')]));_0x2dc235[_0x1153('0x40')]=_0x2dc235[_0x1153('0x40')]['length']?_0x2dc235['attributes']:_0x2fd49f[_0x1153('0x3b')];if(_0x15389b[_0x1153('0x3c')][_0x1153('0x51')]){_0x2dc235['include']=[{'all':!![]}];}_0x2dc235=_['merge']({},_0x2dc235,_0x15389b[_0x1153('0x4e')]);return db[_0x1153('0x4f')][_0x1153('0x57')](_0x2dc235)[_0x1153('0x20')](handleEntityNotFound(_0x34cf14,null))['then'](respondWithResult(_0x34cf14,null))['catch'](handleError(_0x34cf14,null));};exports['create']=function(_0x20a351,_0x5ee7de){return db[_0x1153('0x4f')]['create'](_0x20a351['body'],{})[_0x1153('0x20')](respondWithResult(_0x5ee7de,0xc9))[_0x1153('0x2a')](handleError(_0x5ee7de,null));};exports[_0x1153('0x58')]=function(_0x20c0f0,_0x470097){if(_0x20c0f0['body']['id']){delete _0x20c0f0[_0x1153('0x59')]['id'];}return db[_0x1153('0x4f')][_0x1153('0x57')]({'where':{'id':_0x20c0f0[_0x1153('0x56')]['id']}})['then'](handleEntityNotFound(_0x470097,null))[_0x1153('0x20')](saveUpdates(_0x20c0f0[_0x1153('0x59')],null))[_0x1153('0x20')](respondWithResult(_0x470097,null))['catch'](handleError(_0x470097,null));};exports['destroy']=function(_0x30c193,_0x160506){return db['Dynamics365Configuration'][_0x1153('0x57')]({'where':{'id':_0x30c193[_0x1153('0x56')]['id']}})[_0x1153('0x20')](handleEntityNotFound(_0x160506,null))[_0x1153('0x20')](removeEntity(_0x160506,null))[_0x1153('0x2a')](handleError(_0x160506,null));};exports[_0x1153('0x5a')]=function(_0x4227ef,_0x59a42d,_0x489e4e){var _0x447e2a={};var _0x2ec07c={};var _0x2cf665;var _0x1b5a99;return db[_0x1153('0x4f')]['findOne']({'where':{'id':_0x4227ef['params']['id']}})[_0x1153('0x20')](handleEntityNotFound(_0x59a42d,null))[_0x1153('0x20')](function(_0x29d600){if(_0x29d600){_0x2cf665=_0x29d600;_0x2ec07c[_0x1153('0x3b')]=_[_0x1153('0x3d')](db[_0x1153('0x5b')][_0x1153('0x38')]);_0x2ec07c[_0x1153('0x3c')]=_[_0x1153('0x3d')](_0x4227ef[_0x1153('0x3c')]);_0x2ec07c[_0x1153('0x3e')]=_[_0x1153('0x3f')](_0x2ec07c[_0x1153('0x3b')],_0x2ec07c['query']);_0x447e2a[_0x1153('0x40')]=_[_0x1153('0x3f')](_0x2ec07c[_0x1153('0x3b')],qs['fields'](_0x4227ef[_0x1153('0x3c')][_0x1153('0x41')]));_0x447e2a[_0x1153('0x40')]=_0x447e2a[_0x1153('0x40')][_0x1153('0x42')]?_0x447e2a[_0x1153('0x40')]:_0x2ec07c['model'];_0x447e2a[_0x1153('0x45')]=qs['sort'](_0x4227ef[_0x1153('0x3c')][_0x1153('0x46')]);_0x447e2a['where']=qs[_0x1153('0x3e')](_[_0x1153('0x48')](_0x4227ef['query'],_0x2ec07c[_0x1153('0x3e')]));if(_0x4227ef[_0x1153('0x3c')]['filter']){_0x447e2a[_0x1153('0x47')]=_['merge'](_0x447e2a['where'],{'$or':_[_0x1153('0x37')](_0x447e2a[_0x1153('0x40')],function(_0x3ff706){var _0x299e15={};_0x299e15[_0x3ff706]={'$like':'%'+_0x4227ef[_0x1153('0x3c')]['filter']+'%'};return _0x299e15;})});}_0x447e2a=_['merge']({},_0x447e2a,_0x4227ef[_0x1153('0x4e')]);return _0x2cf665[_0x1153('0x5a')](_0x447e2a);}})[_0x1153('0x20')](function(_0x485c7a){if(_0x485c7a){_0x1b5a99=_0x485c7a[_0x1153('0x42')];if(!_0x4227ef[_0x1153('0x3c')][_0x1153('0x43')](_0x1153('0x44'))){_0x447e2a[_0x1153('0x30')]=qs['limit'](_0x4227ef[_0x1153('0x3c')]['limit']);_0x447e2a[_0x1153('0x2f')]=qs[_0x1153('0x2f')](_0x4227ef['query'][_0x1153('0x2f')]);}return _0x2cf665[_0x1153('0x5a')](_0x447e2a);}})[_0x1153('0x20')](function(_0x3f9754){if(_0x3f9754){return _0x3f9754?{'count':_0x1b5a99,'rows':_0x3f9754}:null;}})['then'](respondWithResult(_0x59a42d,null))[_0x1153('0x2a')](handleError(_0x59a42d,null));};exports[_0x1153('0x5c')]=function(_0x1eaef2,_0x356870,_0x4be178){var _0x190018={};var _0x45efaa={};var _0x5926b2;var _0x4a7b47;return db['Dynamics365Configuration'][_0x1153('0x5d')]({'where':{'id':_0x1eaef2['params']['id']}})[_0x1153('0x20')](handleEntityNotFound(_0x356870,null))[_0x1153('0x20')](function(_0x515a3e){if(_0x515a3e){_0x5926b2=_0x515a3e;_0x45efaa[_0x1153('0x3b')]=_[_0x1153('0x3d')](db[_0x1153('0x5b')][_0x1153('0x38')]);_0x45efaa[_0x1153('0x3c')]=_[_0x1153('0x3d')](_0x1eaef2['query']);_0x45efaa[_0x1153('0x3e')]=_[_0x1153('0x3f')](_0x45efaa[_0x1153('0x3b')],_0x45efaa['query']);_0x190018[_0x1153('0x40')]=_[_0x1153('0x3f')](_0x45efaa[_0x1153('0x3b')],qs[_0x1153('0x41')](_0x1eaef2[_0x1153('0x3c')][_0x1153('0x41')]));_0x190018[_0x1153('0x40')]=_0x190018['attributes']['length']?_0x190018['attributes']:_0x45efaa[_0x1153('0x3b')];_0x190018[_0x1153('0x45')]=qs[_0x1153('0x46')](_0x1eaef2[_0x1153('0x3c')][_0x1153('0x46')]);_0x190018['where']=qs[_0x1153('0x3e')](_[_0x1153('0x48')](_0x1eaef2['query'],_0x45efaa[_0x1153('0x3e')]));if(_0x1eaef2[_0x1153('0x3c')]['filter']){_0x190018['where']=_[_0x1153('0x49')](_0x190018[_0x1153('0x47')],{'$or':_['map'](_0x190018[_0x1153('0x40')],function(_0x1f9eed){var _0x50730e={};_0x50730e[_0x1f9eed]={'$like':'%'+_0x1eaef2[_0x1153('0x3c')][_0x1153('0x4d')]+'%'};return _0x50730e;})});}_0x190018=_[_0x1153('0x49')]({},_0x190018,_0x1eaef2[_0x1153('0x4e')]);return _0x5926b2[_0x1153('0x5c')](_0x190018);}})[_0x1153('0x20')](function(_0x304910){if(_0x304910){_0x4a7b47=_0x304910[_0x1153('0x42')];if(!_0x1eaef2['query'][_0x1153('0x43')]('nolimit')){_0x190018['limit']=qs[_0x1153('0x30')](_0x1eaef2[_0x1153('0x3c')]['limit']);_0x190018[_0x1153('0x2f')]=qs['offset'](_0x1eaef2['query'][_0x1153('0x2f')]);}return _0x5926b2[_0x1153('0x5c')](_0x190018);}})['then'](function(_0xae3865){if(_0xae3865){return _0xae3865?{'count':_0x4a7b47,'rows':_0xae3865}:null;}})[_0x1153('0x20')](respondWithResult(_0x356870,null))['catch'](handleError(_0x356870,null));};exports[_0x1153('0x5e')]=function(_0x22688d,_0x54236e,_0x442f30){var _0x4490a8={};var _0x24ca3d={};var _0x2a7ee2;var _0x32e30e;return db[_0x1153('0x4f')]['findOne']({'where':{'id':_0x22688d[_0x1153('0x56')]['id']}})[_0x1153('0x20')](handleEntityNotFound(_0x54236e,null))['then'](function(_0x28d032){if(_0x28d032){_0x2a7ee2=_0x28d032;_0x24ca3d[_0x1153('0x3b')]=_[_0x1153('0x3d')](db[_0x1153('0x5b')][_0x1153('0x38')]);_0x24ca3d[_0x1153('0x3c')]=_[_0x1153('0x3d')](_0x22688d[_0x1153('0x3c')]);_0x24ca3d['filters']=_[_0x1153('0x3f')](_0x24ca3d[_0x1153('0x3b')],_0x24ca3d[_0x1153('0x3c')]);_0x4490a8[_0x1153('0x40')]=_[_0x1153('0x3f')](_0x24ca3d[_0x1153('0x3b')],qs[_0x1153('0x41')](_0x22688d[_0x1153('0x3c')][_0x1153('0x41')]));_0x4490a8['attributes']=_0x4490a8[_0x1153('0x40')]['length']?_0x4490a8['attributes']:_0x24ca3d[_0x1153('0x3b')];_0x4490a8[_0x1153('0x45')]=qs['sort'](_0x22688d[_0x1153('0x3c')][_0x1153('0x46')]);_0x4490a8['where']=qs[_0x1153('0x3e')](_[_0x1153('0x48')](_0x22688d['query'],_0x24ca3d[_0x1153('0x3e')]));if(_0x22688d['query'][_0x1153('0x4d')]){_0x4490a8[_0x1153('0x47')]=_[_0x1153('0x49')](_0x4490a8[_0x1153('0x47')],{'$or':_[_0x1153('0x37')](_0x4490a8[_0x1153('0x40')],function(_0x31d1d4){var _0xc2b29e={};_0xc2b29e[_0x31d1d4]={'$like':'%'+_0x22688d[_0x1153('0x3c')]['filter']+'%'};return _0xc2b29e;})});}_0x4490a8=_[_0x1153('0x49')]({},_0x4490a8,_0x22688d[_0x1153('0x4e')]);return _0x2a7ee2[_0x1153('0x5e')](_0x4490a8);}})[_0x1153('0x20')](function(_0x5827bb){if(_0x5827bb){_0x32e30e=_0x5827bb[_0x1153('0x42')];if(!_0x22688d[_0x1153('0x3c')][_0x1153('0x43')](_0x1153('0x44'))){_0x4490a8[_0x1153('0x30')]=qs[_0x1153('0x30')](_0x22688d[_0x1153('0x3c')][_0x1153('0x30')]);_0x4490a8['offset']=qs['offset'](_0x22688d[_0x1153('0x3c')]['offset']);}return _0x2a7ee2[_0x1153('0x5e')](_0x4490a8);}})[_0x1153('0x20')](function(_0x13df1d){if(_0x13df1d){return _0x13df1d?{'count':_0x32e30e,'rows':_0x13df1d}:null;}})[_0x1153('0x20')](respondWithResult(_0x54236e,null))[_0x1153('0x2a')](handleError(_0x54236e,null));}; \ No newline at end of file +var _0xdb1d=['api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','Dynamics365Configuration','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','Dynamics365Field','length','order','map','nolimit','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x22d0eb,_0x53d7c6){var _0x3648c0=function(_0x5b28c4){while(--_0x5b28c4){_0x22d0eb['push'](_0x22d0eb['shift']());}};_0x3648c0(++_0x53d7c6);}(_0xdb1d,0x1c2));var _0xddb1=function(_0x173993,_0x10d812){_0x173993=_0x173993-0x0;var _0x42d165=_0xdb1d[_0x173993];return _0x42d165;};'use strict';var pdf=require(_0xddb1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xddb1('0x1'));var zipdir=require(_0xddb1('0x2'));var jsonpatch=require(_0xddb1('0x3'));var rp=require('request-promise');var moment=require(_0xddb1('0x4'));var BPromise=require(_0xddb1('0x5'));var Mustache=require(_0xddb1('0x6'));var util=require(_0xddb1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xddb1('0x8'));var ejs=require(_0xddb1('0x9'));var fs=require('fs');var _=require(_0xddb1('0xa'));var squel=require('squel');var crypto=require(_0xddb1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xddb1('0xc'));var toCsv=require(_0xddb1('0x8'));var querystring=require(_0xddb1('0xd'));var Papa=require(_0xddb1('0xe'));var Redis=require(_0xddb1('0xf'));var authService=require(_0xddb1('0x10'));var qs=require(_0xddb1('0x11'));var as=require(_0xddb1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xddb1('0x13'))(_0xddb1('0x14'));var utils=require(_0xddb1('0x15'));var config=require(_0xddb1('0x16'));var db=require(_0xddb1('0x17'))['db'];var jayson=require(_0xddb1('0x18'));var client=jayson[_0xddb1('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x4e5074,_0x123c07,_0x46789a){if(_0x46789a){var _0x56739a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56739a[_0xddb1('0x1a')](_0x123c07)){return _0x4e5074;}else{throw new db[(_0xddb1('0x1b'))][(_0xddb1('0x1c'))](_0xddb1('0x1d'));}}else{return _0x4e5074;}}function respondWithRpcPromise(_0x3e53d6,_0x2170dc,_0x29ab5a,_0x46b034){return new BPromise(function(_0x38bf11,_0x3a65dc){var _0x44a59a=_0x46b034||client;return _0x44a59a[_0xddb1('0x1e')](_0x3e53d6,_0x29ab5a)['then'](function(_0x79cc6f){logger[_0xddb1('0x1f')](_0xddb1('0x20'),_0x2170dc,_0xddb1('0x21'));logger['debug'](_0xddb1('0x22'),_0x2170dc,'request\x20sent',JSON[_0xddb1('0x23')](_0x79cc6f));if(_0x79cc6f[_0xddb1('0x24')]){if(_0x79cc6f[_0xddb1('0x24')]['code']===0x1f4){logger[_0xddb1('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2170dc,_0x79cc6f[_0xddb1('0x24')][_0xddb1('0x25')]);return _0x3a65dc(_0x79cc6f[_0xddb1('0x24')][_0xddb1('0x25')]);}logger[_0xddb1('0x24')](_0xddb1('0x20'),_0x2170dc,_0x79cc6f[_0xddb1('0x24')][_0xddb1('0x25')]);return _0x38bf11(_0x79cc6f[_0xddb1('0x24')][_0xddb1('0x25')]);}else{logger[_0xddb1('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2170dc,'request\x20sent');_0x38bf11(_0x79cc6f[_0xddb1('0x26')]['message']);}})[_0xddb1('0x27')](function(_0x5794fc){logger[_0xddb1('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2170dc,_0x5794fc);_0x3a65dc(_0x5794fc);});});}function respondWithStatusCode(_0x477361,_0x474475){_0x474475=_0x474475||0xcc;return function(_0x49437d){if(_0x49437d){return _0x477361[_0xddb1('0x28')](_0x474475);}return _0x477361[_0xddb1('0x29')](_0x474475)[_0xddb1('0x2a')]();};}function respondWithResult(_0x595986,_0x4f8281){_0x4f8281=_0x4f8281||0xc8;return function(_0xf4686d){if(_0xf4686d){return _0x595986['status'](_0x4f8281)[_0xddb1('0x2b')](_0xf4686d);}};}function respondWithFilteredResult(_0x76eb6c,_0x48b0a6){return function(_0x18d8f1){if(_0x18d8f1){var _0x2ee281=_0x18d8f1['count'],_0x820843=_0x48b0a6[_0xddb1('0x2c')],_0x35ceb7=_0x48b0a6[_0xddb1('0x2c')]+_0x48b0a6[_0xddb1('0x2d')],_0x55bfea;if(_0x35ceb7>=_0x2ee281){_0x35ceb7=_0x2ee281;_0x55bfea=0xc8;}else{_0x55bfea=0xce;}_0x76eb6c['status'](_0x55bfea);return _0x76eb6c[_0xddb1('0x2e')](_0xddb1('0x2f'),_0x820843+'-'+_0x35ceb7+'/'+_0x2ee281)[_0xddb1('0x2b')](_0x18d8f1);}return null;};}function patchUpdates(_0x2e42c5){return function(_0x35b4b5){try{jsonpatch[_0xddb1('0x30')](_0x35b4b5,_0x2e42c5,!![]);}catch(_0x2870d2){return BPromise[_0xddb1('0x31')](_0x2870d2);}return _0x35b4b5[_0xddb1('0x32')]();};}function saveUpdates(_0x100e8e,_0x1b001c){return function(_0x5f0fa9){if(_0x5f0fa9){return _0x5f0fa9[_0xddb1('0x33')](_0x100e8e)['then'](function(_0x4190be){return _0x4190be;});}return null;};}function removeEntity(_0x4aa6ca,_0x31ea5c){return function(_0x121132){if(_0x121132){return _0x121132[_0xddb1('0x34')]()[_0xddb1('0x35')](function(){_0x4aa6ca[_0xddb1('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a5fc7,_0xf2bf56){return function(_0xb10bea){if(!_0xb10bea){_0x1a5fc7['sendStatus'](0x194);}return _0xb10bea;};}function handleError(_0x42b5e3,_0xbb064d){_0xbb064d=_0xbb064d||0x1f4;return function(_0x25b053){logger['error'](_0x25b053[_0xddb1('0x36')]);if(_0x25b053[_0xddb1('0x37')]){delete _0x25b053[_0xddb1('0x37')];}_0x42b5e3[_0xddb1('0x29')](_0xbb064d)[_0xddb1('0x38')](_0x25b053);};}exports[_0xddb1('0x39')]=function(_0x3f8ce1,_0x1e9372){var _0x3d149f={},_0x287cbe={},_0x2c7546={'count':0x0,'rows':[]};var _0x373fc3=_['map'](db[_0xddb1('0x3a')]['rawAttributes'],function(_0xa50bdf){return{'name':_0xa50bdf['fieldName'],'type':_0xa50bdf['type']['key']};});_0x287cbe[_0xddb1('0x3b')]=_['map'](_0x373fc3,_0xddb1('0x37'));_0x287cbe[_0xddb1('0x3c')]=_[_0xddb1('0x3d')](_0x3f8ce1[_0xddb1('0x3c')]);_0x287cbe[_0xddb1('0x3e')]=_[_0xddb1('0x3f')](_0x287cbe['model'],_0x287cbe['query']);_0x3d149f[_0xddb1('0x40')]=_[_0xddb1('0x3f')](_0x287cbe[_0xddb1('0x3b')],qs[_0xddb1('0x41')](_0x3f8ce1['query']['fields']));_0x3d149f['attributes']=_0x3d149f[_0xddb1('0x40')]['length']?_0x3d149f[_0xddb1('0x40')]:_0x287cbe['model'];if(!_0x3f8ce1['query'][_0xddb1('0x42')]('nolimit')){_0x3d149f[_0xddb1('0x2d')]=qs[_0xddb1('0x2d')](_0x3f8ce1[_0xddb1('0x3c')][_0xddb1('0x2d')]);_0x3d149f[_0xddb1('0x2c')]=qs[_0xddb1('0x2c')](_0x3f8ce1[_0xddb1('0x3c')][_0xddb1('0x2c')]);}_0x3d149f['order']=qs[_0xddb1('0x43')](_0x3f8ce1[_0xddb1('0x3c')][_0xddb1('0x43')]);_0x3d149f[_0xddb1('0x44')]=qs[_0xddb1('0x3e')](_[_0xddb1('0x45')](_0x3f8ce1['query'],_0x287cbe[_0xddb1('0x3e')]));if(_0x3f8ce1[_0xddb1('0x3c')][_0xddb1('0x46')]){_0x3d149f[_0xddb1('0x44')]=_[_0xddb1('0x47')](_0x3d149f[_0xddb1('0x44')],{'$or':_['map'](_0x373fc3,function(_0x1bab14){if(_0x1bab14[_0xddb1('0x48')]!==_0xddb1('0x49')){var _0x2e9463={};_0x2e9463[_0x1bab14[_0xddb1('0x37')]]={'$like':'%'+_0x3f8ce1[_0xddb1('0x3c')][_0xddb1('0x46')]+'%'};return _0x2e9463;}})});}_0x3d149f=_[_0xddb1('0x47')]({},_0x3d149f,_0x3f8ce1[_0xddb1('0x4a')]);var _0x35aacb={'where':_0x3d149f['where']};return db[_0xddb1('0x3a')]['count'](_0x35aacb)[_0xddb1('0x35')](function(_0x11caf7){_0x2c7546[_0xddb1('0x4b')]=_0x11caf7;if(_0x3f8ce1[_0xddb1('0x3c')]['includeAll']){_0x3d149f[_0xddb1('0x4c')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xddb1('0x4d')](_0x3d149f);})[_0xddb1('0x35')](function(_0x5f3433){_0x2c7546['rows']=_0x5f3433;return _0x2c7546;})[_0xddb1('0x35')](respondWithFilteredResult(_0x1e9372,_0x3d149f))[_0xddb1('0x27')](handleError(_0x1e9372,null));};exports[_0xddb1('0x4e')]=function(_0x1cdb9e,_0x21773e){var _0x1dd2d0={'raw':![],'where':{'id':_0x1cdb9e[_0xddb1('0x4f')]['id']}},_0x5e9765={};_0x5e9765[_0xddb1('0x3b')]=_[_0xddb1('0x3d')](db[_0xddb1('0x3a')][_0xddb1('0x50')]);_0x5e9765['query']=_[_0xddb1('0x3d')](_0x1cdb9e['query']);_0x5e9765[_0xddb1('0x3e')]=_['intersection'](_0x5e9765[_0xddb1('0x3b')],_0x5e9765[_0xddb1('0x3c')]);_0x1dd2d0[_0xddb1('0x40')]=_[_0xddb1('0x3f')](_0x5e9765[_0xddb1('0x3b')],qs[_0xddb1('0x41')](_0x1cdb9e[_0xddb1('0x3c')][_0xddb1('0x41')]));_0x1dd2d0[_0xddb1('0x40')]=_0x1dd2d0[_0xddb1('0x40')]['length']?_0x1dd2d0[_0xddb1('0x40')]:_0x5e9765[_0xddb1('0x3b')];if(_0x1cdb9e[_0xddb1('0x3c')][_0xddb1('0x51')]){_0x1dd2d0[_0xddb1('0x4c')]=[{'all':!![]}];}_0x1dd2d0=_[_0xddb1('0x47')]({},_0x1dd2d0,_0x1cdb9e[_0xddb1('0x4a')]);return db['Dynamics365Configuration'][_0xddb1('0x52')](_0x1dd2d0)[_0xddb1('0x35')](handleEntityNotFound(_0x21773e,null))[_0xddb1('0x35')](respondWithResult(_0x21773e,null))[_0xddb1('0x27')](handleError(_0x21773e,null));};exports[_0xddb1('0x53')]=function(_0x18891a,_0x233f89){return db[_0xddb1('0x3a')][_0xddb1('0x53')](_0x18891a['body'],{})[_0xddb1('0x35')](respondWithResult(_0x233f89,0xc9))[_0xddb1('0x27')](handleError(_0x233f89,null));};exports['update']=function(_0x4feda7,_0x5849c3){if(_0x4feda7[_0xddb1('0x54')]['id']){delete _0x4feda7[_0xddb1('0x54')]['id'];}return db['Dynamics365Configuration'][_0xddb1('0x52')]({'where':{'id':_0x4feda7[_0xddb1('0x4f')]['id']}})[_0xddb1('0x35')](handleEntityNotFound(_0x5849c3,null))[_0xddb1('0x35')](saveUpdates(_0x4feda7[_0xddb1('0x54')],null))[_0xddb1('0x35')](respondWithResult(_0x5849c3,null))[_0xddb1('0x27')](handleError(_0x5849c3,null));};exports['destroy']=function(_0x2233bc,_0x13bf62){return db[_0xddb1('0x3a')][_0xddb1('0x52')]({'where':{'id':_0x2233bc['params']['id']}})['then'](handleEntityNotFound(_0x13bf62,null))[_0xddb1('0x35')](removeEntity(_0x13bf62,null))[_0xddb1('0x27')](handleError(_0x13bf62,null));};exports[_0xddb1('0x55')]=function(_0x2cd095,_0x508f01,_0x1c0712){var _0x3e48f1={};var _0x12033a={};var _0x25bcbf;var _0x2bdd81;return db[_0xddb1('0x3a')][_0xddb1('0x56')]({'where':{'id':_0x2cd095[_0xddb1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x508f01,null))[_0xddb1('0x35')](function(_0xdb3736){if(_0xdb3736){_0x25bcbf=_0xdb3736;_0x12033a[_0xddb1('0x3b')]=_[_0xddb1('0x3d')](db[_0xddb1('0x57')][_0xddb1('0x50')]);_0x12033a[_0xddb1('0x3c')]=_['keys'](_0x2cd095['query']);_0x12033a[_0xddb1('0x3e')]=_['intersection'](_0x12033a[_0xddb1('0x3b')],_0x12033a[_0xddb1('0x3c')]);_0x3e48f1['attributes']=_[_0xddb1('0x3f')](_0x12033a[_0xddb1('0x3b')],qs[_0xddb1('0x41')](_0x2cd095[_0xddb1('0x3c')][_0xddb1('0x41')]));_0x3e48f1[_0xddb1('0x40')]=_0x3e48f1['attributes'][_0xddb1('0x58')]?_0x3e48f1['attributes']:_0x12033a[_0xddb1('0x3b')];_0x3e48f1[_0xddb1('0x59')]=qs[_0xddb1('0x43')](_0x2cd095[_0xddb1('0x3c')][_0xddb1('0x43')]);_0x3e48f1['where']=qs[_0xddb1('0x3e')](_[_0xddb1('0x45')](_0x2cd095[_0xddb1('0x3c')],_0x12033a['filters']));if(_0x2cd095[_0xddb1('0x3c')][_0xddb1('0x46')]){_0x3e48f1['where']=_[_0xddb1('0x47')](_0x3e48f1[_0xddb1('0x44')],{'$or':_[_0xddb1('0x5a')](_0x3e48f1[_0xddb1('0x40')],function(_0x5b52f8){var _0x41c7a6={};_0x41c7a6[_0x5b52f8]={'$like':'%'+_0x2cd095[_0xddb1('0x3c')]['filter']+'%'};return _0x41c7a6;})});}_0x3e48f1=_[_0xddb1('0x47')]({},_0x3e48f1,_0x2cd095['options']);return _0x25bcbf[_0xddb1('0x55')](_0x3e48f1);}})[_0xddb1('0x35')](function(_0x173ebf){if(_0x173ebf){_0x2bdd81=_0x173ebf[_0xddb1('0x58')];if(!_0x2cd095[_0xddb1('0x3c')][_0xddb1('0x42')](_0xddb1('0x5b'))){_0x3e48f1[_0xddb1('0x2d')]=qs[_0xddb1('0x2d')](_0x2cd095[_0xddb1('0x3c')][_0xddb1('0x2d')]);_0x3e48f1[_0xddb1('0x2c')]=qs[_0xddb1('0x2c')](_0x2cd095[_0xddb1('0x3c')][_0xddb1('0x2c')]);}return _0x25bcbf[_0xddb1('0x55')](_0x3e48f1);}})[_0xddb1('0x35')](function(_0x16aac1){if(_0x16aac1){return _0x16aac1?{'count':_0x2bdd81,'rows':_0x16aac1}:null;}})[_0xddb1('0x35')](respondWithResult(_0x508f01,null))[_0xddb1('0x27')](handleError(_0x508f01,null));};exports[_0xddb1('0x5c')]=function(_0x1ff91b,_0x2a3405,_0xe1228c){var _0x1fe0e1={};var _0x2efd13={};var _0x106bc1;var _0x564306;return db[_0xddb1('0x3a')][_0xddb1('0x56')]({'where':{'id':_0x1ff91b[_0xddb1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2a3405,null))['then'](function(_0xa79813){if(_0xa79813){_0x106bc1=_0xa79813;_0x2efd13[_0xddb1('0x3b')]=_[_0xddb1('0x3d')](db[_0xddb1('0x57')]['rawAttributes']);_0x2efd13[_0xddb1('0x3c')]=_['keys'](_0x1ff91b[_0xddb1('0x3c')]);_0x2efd13['filters']=_[_0xddb1('0x3f')](_0x2efd13[_0xddb1('0x3b')],_0x2efd13[_0xddb1('0x3c')]);_0x1fe0e1[_0xddb1('0x40')]=_[_0xddb1('0x3f')](_0x2efd13[_0xddb1('0x3b')],qs[_0xddb1('0x41')](_0x1ff91b[_0xddb1('0x3c')]['fields']));_0x1fe0e1['attributes']=_0x1fe0e1[_0xddb1('0x40')][_0xddb1('0x58')]?_0x1fe0e1[_0xddb1('0x40')]:_0x2efd13[_0xddb1('0x3b')];_0x1fe0e1[_0xddb1('0x59')]=qs['sort'](_0x1ff91b[_0xddb1('0x3c')][_0xddb1('0x43')]);_0x1fe0e1['where']=qs[_0xddb1('0x3e')](_[_0xddb1('0x45')](_0x1ff91b[_0xddb1('0x3c')],_0x2efd13[_0xddb1('0x3e')]));if(_0x1ff91b['query'][_0xddb1('0x46')]){_0x1fe0e1[_0xddb1('0x44')]=_['merge'](_0x1fe0e1[_0xddb1('0x44')],{'$or':_[_0xddb1('0x5a')](_0x1fe0e1[_0xddb1('0x40')],function(_0x1634c5){var _0x28fb5f={};_0x28fb5f[_0x1634c5]={'$like':'%'+_0x1ff91b[_0xddb1('0x3c')][_0xddb1('0x46')]+'%'};return _0x28fb5f;})});}_0x1fe0e1=_[_0xddb1('0x47')]({},_0x1fe0e1,_0x1ff91b['options']);return _0x106bc1[_0xddb1('0x5c')](_0x1fe0e1);}})['then'](function(_0x24bdcc){if(_0x24bdcc){_0x564306=_0x24bdcc[_0xddb1('0x58')];if(!_0x1ff91b[_0xddb1('0x3c')][_0xddb1('0x42')](_0xddb1('0x5b'))){_0x1fe0e1[_0xddb1('0x2d')]=qs[_0xddb1('0x2d')](_0x1ff91b[_0xddb1('0x3c')]['limit']);_0x1fe0e1['offset']=qs[_0xddb1('0x2c')](_0x1ff91b[_0xddb1('0x3c')]['offset']);}return _0x106bc1['getSubjects'](_0x1fe0e1);}})[_0xddb1('0x35')](function(_0x1b8051){if(_0x1b8051){return _0x1b8051?{'count':_0x564306,'rows':_0x1b8051}:null;}})[_0xddb1('0x35')](respondWithResult(_0x2a3405,null))[_0xddb1('0x27')](handleError(_0x2a3405,null));};exports[_0xddb1('0x5d')]=function(_0x5732cf,_0x4f2bd5,_0x2982c8){var _0xd14acc={};var _0x51728e={};var _0x2274ad;var _0x2b732c;return db[_0xddb1('0x3a')][_0xddb1('0x56')]({'where':{'id':_0x5732cf[_0xddb1('0x4f')]['id']}})[_0xddb1('0x35')](handleEntityNotFound(_0x4f2bd5,null))['then'](function(_0x1a0e37){if(_0x1a0e37){_0x2274ad=_0x1a0e37;_0x51728e[_0xddb1('0x3b')]=_['keys'](db[_0xddb1('0x57')]['rawAttributes']);_0x51728e[_0xddb1('0x3c')]=_[_0xddb1('0x3d')](_0x5732cf[_0xddb1('0x3c')]);_0x51728e[_0xddb1('0x3e')]=_[_0xddb1('0x3f')](_0x51728e[_0xddb1('0x3b')],_0x51728e['query']);_0xd14acc[_0xddb1('0x40')]=_[_0xddb1('0x3f')](_0x51728e[_0xddb1('0x3b')],qs[_0xddb1('0x41')](_0x5732cf[_0xddb1('0x3c')][_0xddb1('0x41')]));_0xd14acc[_0xddb1('0x40')]=_0xd14acc[_0xddb1('0x40')][_0xddb1('0x58')]?_0xd14acc[_0xddb1('0x40')]:_0x51728e[_0xddb1('0x3b')];_0xd14acc[_0xddb1('0x59')]=qs[_0xddb1('0x43')](_0x5732cf[_0xddb1('0x3c')][_0xddb1('0x43')]);_0xd14acc['where']=qs[_0xddb1('0x3e')](_[_0xddb1('0x45')](_0x5732cf[_0xddb1('0x3c')],_0x51728e[_0xddb1('0x3e')]));if(_0x5732cf[_0xddb1('0x3c')][_0xddb1('0x46')]){_0xd14acc[_0xddb1('0x44')]=_[_0xddb1('0x47')](_0xd14acc[_0xddb1('0x44')],{'$or':_['map'](_0xd14acc[_0xddb1('0x40')],function(_0x238d7f){var _0x1ecae6={};_0x1ecae6[_0x238d7f]={'$like':'%'+_0x5732cf['query'][_0xddb1('0x46')]+'%'};return _0x1ecae6;})});}_0xd14acc=_[_0xddb1('0x47')]({},_0xd14acc,_0x5732cf[_0xddb1('0x4a')]);return _0x2274ad[_0xddb1('0x5d')](_0xd14acc);}})[_0xddb1('0x35')](function(_0x496186){if(_0x496186){_0x2b732c=_0x496186[_0xddb1('0x58')];if(!_0x5732cf['query'][_0xddb1('0x42')]('nolimit')){_0xd14acc[_0xddb1('0x2d')]=qs[_0xddb1('0x2d')](_0x5732cf['query']['limit']);_0xd14acc[_0xddb1('0x2c')]=qs['offset'](_0x5732cf[_0xddb1('0x3c')][_0xddb1('0x2c')]);}return _0x2274ad[_0xddb1('0x5d')](_0xd14acc);}})[_0xddb1('0x35')](function(_0x5c8391){if(_0x5c8391){return _0x5c8391?{'count':_0x2b732c,'rows':_0x5c8391}:null;}})[_0xddb1('0x35')](respondWithResult(_0x4f2bd5,null))['catch'](handleError(_0x4f2bd5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ffc2991..0aebf2b 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f3a=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x6f3a,0x1e3));var _0xa6f3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6f3a[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xa6f3('0x0'));var util=require(_0xa6f3('0x1'));var logger=require(_0xa6f3('0x2'))(_0xa6f3('0x3'));var moment=require(_0xa6f3('0x4'));var BPromise=require(_0xa6f3('0x5'));var rp=require(_0xa6f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6f3('0x7'));var config=require(_0xa6f3('0x8'));var attributes=require(_0xa6f3('0x9'));module[_0xa6f3('0xa')]=function(_0x4eb29e,_0x524171){return _0x4eb29e[_0xa6f3('0xb')](_0xa6f3('0xc'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6211=['bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','api','moment'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x6211,0xc2));var _0x1621=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6211[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x1621('0x0'));var logger=require(_0x1621('0x1'))(_0x1621('0x2'));var moment=require(_0x1621('0x3'));var BPromise=require(_0x1621('0x4'));var rp=require(_0x1621('0x5'));var fs=require('fs');var path=require(_0x1621('0x6'));var rimraf=require(_0x1621('0x7'));var config=require('../../config/environment');var attributes=require(_0x1621('0x8'));module['exports']=function(_0x4944a5,_0x556162){return _0x4944a5['define'](_0x1621('0x9'),attributes,{'tableName':_0x1621('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 01181b6..0446e5b 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1e8=['info','result','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1e8,0x1e2));var _0x8c1e=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0xc1e8[_0x56e32e];return _0x2a757b;};'use strict';var _=require(_0x8c1e('0x0'));var util=require(_0x8c1e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c1e('0x2'));var db=require(_0x8c1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c1e('0x4'))(_0x8c1e('0x5'));var config=require(_0x8c1e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8c1e('0x7')][_0x8c1e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cca08,_0x4fb17c,_0x42c8d0){return new BPromise(function(_0x41ab5a,_0x387289){return client[_0x8c1e('0x9')](_0x1cca08,_0x42c8d0)[_0x8c1e('0xa')](function(_0x4a97e6){logger['info'](_0x8c1e('0xb'),_0x4fb17c,_0x8c1e('0xc'));logger['debug'](_0x8c1e('0xd'),_0x4fb17c,'request\x20sent',JSON[_0x8c1e('0xe')](_0x4a97e6));if(_0x4a97e6[_0x8c1e('0xf')]){if(_0x4a97e6[_0x8c1e('0xf')][_0x8c1e('0x10')]===0x1f4){logger[_0x8c1e('0xf')](_0x8c1e('0xb'),_0x4fb17c,_0x4a97e6[_0x8c1e('0xf')]['message']);return _0x387289(_0x4a97e6[_0x8c1e('0xf')][_0x8c1e('0x11')]);}logger[_0x8c1e('0xf')](_0x8c1e('0xb'),_0x4fb17c,_0x4a97e6[_0x8c1e('0xf')]['message']);return _0x41ab5a(_0x4a97e6['error'][_0x8c1e('0x11')]);}else{logger[_0x8c1e('0x12')](_0x8c1e('0xb'),_0x4fb17c,'request\x20sent');_0x41ab5a(_0x4a97e6[_0x8c1e('0x13')][_0x8c1e('0x11')]);}})['catch'](function(_0x2414c4){logger[_0x8c1e('0xf')](_0x8c1e('0xb'),_0x4fb17c,_0x2414c4);_0x387289(_0x2414c4);});});} \ No newline at end of file +var _0x8f75=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0xb6c75c,_0x47da1a){var _0x32fbff=function(_0x140bab){while(--_0x140bab){_0xb6c75c['push'](_0xb6c75c['shift']());}};_0x32fbff(++_0x47da1a);}(_0x8f75,0x1c5));var _0x58f7=function(_0x296881,_0x1a1e6e){_0x296881=_0x296881-0x0;var _0x3e22f7=_0x8f75[_0x296881];return _0x3e22f7;};'use strict';var _=require(_0x58f7('0x0'));var util=require('util');var moment=require(_0x58f7('0x1'));var BPromise=require('bluebird');var rs=require(_0x58f7('0x2'));var fs=require('fs');var Redis=require(_0x58f7('0x3'));var db=require(_0x58f7('0x4'))['db'];var utils=require(_0x58f7('0x5'));var logger=require(_0x58f7('0x6'))(_0x58f7('0x7'));var config=require(_0x58f7('0x8'));var jayson=require(_0x58f7('0x9'));var client=jayson[_0x58f7('0xa')][_0x58f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4747e3,_0x3aee40,_0x15860e){return new BPromise(function(_0x57eba2,_0x32cea6){return client['request'](_0x4747e3,_0x15860e)[_0x58f7('0xc')](function(_0x374bcb){logger[_0x58f7('0xd')](_0x58f7('0xe'),_0x3aee40,_0x58f7('0xf'));logger[_0x58f7('0x10')](_0x58f7('0x11'),_0x3aee40,_0x58f7('0xf'),JSON[_0x58f7('0x12')](_0x374bcb));if(_0x374bcb[_0x58f7('0x13')]){if(_0x374bcb[_0x58f7('0x13')][_0x58f7('0x14')]===0x1f4){logger['error'](_0x58f7('0xe'),_0x3aee40,_0x374bcb[_0x58f7('0x13')][_0x58f7('0x15')]);return _0x32cea6(_0x374bcb[_0x58f7('0x13')]['message']);}logger[_0x58f7('0x13')](_0x58f7('0xe'),_0x3aee40,_0x374bcb['error'][_0x58f7('0x15')]);return _0x57eba2(_0x374bcb[_0x58f7('0x13')]['message']);}else{logger[_0x58f7('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3aee40,_0x58f7('0xf'));_0x57eba2(_0x374bcb[_0x58f7('0x16')][_0x58f7('0x15')]);}})[_0x58f7('0x17')](function(_0xbc65f2){logger[_0x58f7('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3aee40,_0xbc65f2);_0x32cea6(_0xbc65f2);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 99331a3..dc40955 100644 --- a/server/api/intDynamics365Field/index.js +++ b/server/api/intDynamics365Field/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ce3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x170495,_0x17a65b){var _0x2a473e=function(_0x6ee30e){while(--_0x6ee30e){_0x170495['push'](_0x170495['shift']());}};_0x2a473e(++_0x17a65b);}(_0x8ce3,0xc3));var _0x38ce=function(_0x1cdf19,_0x2c4b46){_0x1cdf19=_0x1cdf19-0x0;var _0x340a02=_0x8ce3[_0x1cdf19];return _0x340a02;};'use strict';var multer=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var path=require('path');var timeout=require(_0x38ce('0x2'));var express=require(_0x38ce('0x3'));var router=express[_0x38ce('0x4')]();var auth=require(_0x38ce('0x5'));var interaction=require(_0x38ce('0x6'));var config=require(_0x38ce('0x7'));var controller=require(_0x38ce('0x8'));router[_0x38ce('0x9')]('/',auth['isAuthenticated'](),controller[_0x38ce('0xa')]);router[_0x38ce('0x9')]('/:id',auth[_0x38ce('0xb')](),controller[_0x38ce('0xc')]);router[_0x38ce('0xd')]('/',auth['isAuthenticated'](),controller[_0x38ce('0xe')]);router['put'](_0x38ce('0xf'),auth['isAuthenticated'](),controller[_0x38ce('0x10')]);router[_0x38ce('0x11')](_0x38ce('0xf'),auth[_0x38ce('0xb')](),controller[_0x38ce('0x12')]);module[_0x38ce('0x13')]=router; \ No newline at end of file +var _0xe13a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe13a,0x178));var _0xae13=function(_0x50e0df,_0x2f4a38){_0x50e0df=_0x50e0df-0x0;var _0x35fb7a=_0xe13a[_0x50e0df];return _0x35fb7a;};'use strict';var multer=require('multer');var util=require(_0xae13('0x0'));var path=require(_0xae13('0x1'));var timeout=require(_0xae13('0x2'));var express=require(_0xae13('0x3'));var router=express['Router']();var auth=require(_0xae13('0x4'));var interaction=require(_0xae13('0x5'));var config=require(_0xae13('0x6'));var controller=require(_0xae13('0x7'));router[_0xae13('0x8')]('/',auth[_0xae13('0x9')](),controller[_0xae13('0xa')]);router[_0xae13('0x8')](_0xae13('0xb'),auth['isAuthenticated'](),controller[_0xae13('0xc')]);router[_0xae13('0xd')]('/',auth[_0xae13('0x9')](),controller[_0xae13('0xe')]);router[_0xae13('0xf')](_0xae13('0xb'),auth[_0xae13('0x9')](),controller[_0xae13('0x10')]);router[_0xae13('0x11')]('/:id',auth[_0xae13('0x9')](),controller[_0xae13('0x12')]);module[_0xae13('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 8c184d0..068ab27 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js +++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a9a=['customVariable','keyValue','string','STRING','BOOLEAN','exports','ENUM','variable'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x5a9a,0x85));var _0xa5a9=function(_0x1d67e6,_0x22033d){_0x1d67e6=_0x1d67e6-0x0;var _0x1e4b95=_0x5a9a[_0x1d67e6];return _0x1e4b95;};'use strict';var Sequelize=require('sequelize');module[_0xa5a9('0x0')]={'type':{'type':Sequelize[_0xa5a9('0x1')]('string',_0xa5a9('0x2'),_0xa5a9('0x3'),_0xa5a9('0x4')),'defaultValue':_0xa5a9('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa5a9('0x6')]},'keyType':{'type':Sequelize[_0xa5a9('0x1')](_0xa5a9('0x5'),'variable',_0xa5a9('0x3'))},'keyContent':{'type':Sequelize[_0xa5a9('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa5a9('0x6')]},'customField':{'type':Sequelize[_0xa5a9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa5a9('0x6')]}}; \ No newline at end of file +var _0xb44b=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb44b,0x118));var _0xbb44=function(_0xf18977,_0x87ecc4){_0xf18977=_0xf18977-0x0;var _0x360bb8=_0xb44b[_0xf18977];return _0x360bb8;};'use strict';var Sequelize=require(_0xbb44('0x0'));module[_0xbb44('0x1')]={'type':{'type':Sequelize['ENUM'](_0xbb44('0x2'),_0xbb44('0x3'),_0xbb44('0x4'),_0xbb44('0x5')),'defaultValue':_0xbb44('0x2')},'content':{'type':Sequelize[_0xbb44('0x6')]},'key':{'type':Sequelize[_0xbb44('0x6')]},'keyType':{'type':Sequelize[_0xbb44('0x7')](_0xbb44('0x2'),'variable',_0xbb44('0x4'))},'keyContent':{'type':Sequelize[_0xbb44('0x6')]},'idField':{'type':Sequelize[_0xbb44('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbb44('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb44('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index ed7edbc..5e476a0 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.controller.js +++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb04=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','rawAttributes','find','catch','create','body','params'];(function(_0x2af31a,_0x104b3c){var _0x2dfe28=function(_0x1dd43b){while(--_0x1dd43b){_0x2af31a['push'](_0x2af31a['shift']());}};_0x2dfe28(++_0x104b3c);}(_0xcb04,0x9a));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x4cb0('0x0'));var emlformat=require(_0x4cb0('0x1'));var rimraf=require(_0x4cb0('0x2'));var zipdir=require(_0x4cb0('0x3'));var jsonpatch=require(_0x4cb0('0x4'));var rp=require(_0x4cb0('0x5'));var moment=require(_0x4cb0('0x6'));var BPromise=require(_0x4cb0('0x7'));var Mustache=require(_0x4cb0('0x8'));var util=require(_0x4cb0('0x9'));var path=require('path');var sox=require(_0x4cb0('0xa'));var csv=require(_0x4cb0('0xb'));var ejs=require(_0x4cb0('0xc'));var fs=require('fs');var _=require(_0x4cb0('0xd'));var squel=require(_0x4cb0('0xe'));var crypto=require(_0x4cb0('0xf'));var jsforce=require(_0x4cb0('0x10'));var deskjs=require(_0x4cb0('0x11'));var toCsv=require(_0x4cb0('0xb'));var querystring=require(_0x4cb0('0x12'));var Papa=require(_0x4cb0('0x13'));var Redis=require(_0x4cb0('0x14'));var authService=require(_0x4cb0('0x15'));var qs=require(_0x4cb0('0x16'));var as=require(_0x4cb0('0x17'));var hardwareService=require(_0x4cb0('0x18'));var logger=require(_0x4cb0('0x19'))(_0x4cb0('0x1a'));var utils=require('../../config/utils');var config=require(_0x4cb0('0x1b'));var db=require(_0x4cb0('0x1c'))['db'];function respondWithStatusCode(_0x33a1e6,_0x15fab9){_0x15fab9=_0x15fab9||0xcc;return function(_0x5cad20){if(_0x5cad20){return _0x33a1e6[_0x4cb0('0x1d')](_0x15fab9);}return _0x33a1e6[_0x4cb0('0x1e')](_0x15fab9)[_0x4cb0('0x1f')]();};}function respondWithResult(_0x2ad076,_0x3cb5b1){_0x3cb5b1=_0x3cb5b1||0xc8;return function(_0x2d9f4f){if(_0x2d9f4f){return _0x2ad076[_0x4cb0('0x1e')](_0x3cb5b1)[_0x4cb0('0x20')](_0x2d9f4f);}};}function respondWithFilteredResult(_0x246605,_0x52e8f2){return function(_0x2b8969){if(_0x2b8969){var _0x150d4f=_0x2b8969['count'],_0x1317e9=_0x52e8f2[_0x4cb0('0x21')],_0x3bbe1a=_0x52e8f2[_0x4cb0('0x21')]+_0x52e8f2[_0x4cb0('0x22')],_0x53838b;if(_0x3bbe1a>=_0x150d4f){_0x3bbe1a=_0x150d4f;_0x53838b=0xc8;}else{_0x53838b=0xce;}_0x246605[_0x4cb0('0x1e')](_0x53838b);return _0x246605[_0x4cb0('0x23')](_0x4cb0('0x24'),_0x1317e9+'-'+_0x3bbe1a+'/'+_0x150d4f)[_0x4cb0('0x20')](_0x2b8969);}return null;};}function patchUpdates(_0x4cd6b5){return function(_0x5dabb4){try{jsonpatch[_0x4cb0('0x25')](_0x5dabb4,_0x4cd6b5,!![]);}catch(_0x4f4614){return BPromise['reject'](_0x4f4614);}return _0x5dabb4[_0x4cb0('0x26')]();};}function saveUpdates(_0x3b2f0c,_0x4981a8){return function(_0x398659){if(_0x398659){return _0x398659[_0x4cb0('0x27')](_0x3b2f0c)[_0x4cb0('0x28')](function(_0x48e56d){return _0x48e56d;});}return null;};}function removeEntity(_0x2bb0f9,_0x4ba67d){return function(_0xfeb873){if(_0xfeb873){return _0xfeb873[_0x4cb0('0x29')]()[_0x4cb0('0x28')](function(){_0x2bb0f9[_0x4cb0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e4190,_0xa1fd65){return function(_0x53fdd3){if(!_0x53fdd3){_0x1e4190['sendStatus'](0x194);}return _0x53fdd3;};}function handleError(_0x3456ef,_0x342ac6){_0x342ac6=_0x342ac6||0x1f4;return function(_0x319aee){logger[_0x4cb0('0x2a')](_0x319aee[_0x4cb0('0x2b')]);if(_0x319aee[_0x4cb0('0x2c')]){delete _0x319aee[_0x4cb0('0x2c')];}_0x3456ef[_0x4cb0('0x1e')](_0x342ac6)[_0x4cb0('0x2d')](_0x319aee);};}exports[_0x4cb0('0x2e')]=function(_0x331f3c,_0xde2bd9){var _0x50f9eb={},_0x2f3b9f={},_0x8191fd={'count':0x0,'rows':[]};var _0x4417df=_[_0x4cb0('0x2f')](db[_0x4cb0('0x30')]['rawAttributes'],function(_0x3f1bf2){return{'name':_0x3f1bf2['fieldName'],'type':_0x3f1bf2[_0x4cb0('0x31')][_0x4cb0('0x32')]};});_0x2f3b9f[_0x4cb0('0x33')]=_['map'](_0x4417df,_0x4cb0('0x2c'));_0x2f3b9f[_0x4cb0('0x34')]=_[_0x4cb0('0x35')](_0x331f3c[_0x4cb0('0x34')]);_0x2f3b9f['filters']=_[_0x4cb0('0x36')](_0x2f3b9f['model'],_0x2f3b9f['query']);_0x50f9eb[_0x4cb0('0x37')]=_[_0x4cb0('0x36')](_0x2f3b9f['model'],qs[_0x4cb0('0x38')](_0x331f3c['query'][_0x4cb0('0x38')]));_0x50f9eb[_0x4cb0('0x37')]=_0x50f9eb[_0x4cb0('0x37')][_0x4cb0('0x39')]?_0x50f9eb['attributes']:_0x2f3b9f[_0x4cb0('0x33')];if(!_0x331f3c[_0x4cb0('0x34')][_0x4cb0('0x3a')](_0x4cb0('0x3b'))){_0x50f9eb[_0x4cb0('0x22')]=qs[_0x4cb0('0x22')](_0x331f3c[_0x4cb0('0x34')]['limit']);_0x50f9eb[_0x4cb0('0x21')]=qs[_0x4cb0('0x21')](_0x331f3c[_0x4cb0('0x34')][_0x4cb0('0x21')]);}_0x50f9eb['order']=qs['sort'](_0x331f3c[_0x4cb0('0x34')]['sort']);_0x50f9eb[_0x4cb0('0x3c')]=qs[_0x4cb0('0x3d')](_['pick'](_0x331f3c[_0x4cb0('0x34')],_0x2f3b9f['filters']));if(_0x331f3c[_0x4cb0('0x34')][_0x4cb0('0x3e')]){_0x50f9eb[_0x4cb0('0x3c')]=_[_0x4cb0('0x3f')](_0x50f9eb['where'],{'$or':_[_0x4cb0('0x2f')](_0x4417df,function(_0x47771c){if(_0x47771c[_0x4cb0('0x31')]!==_0x4cb0('0x40')){var _0x2ebad0={};_0x2ebad0[_0x47771c[_0x4cb0('0x2c')]]={'$like':'%'+_0x331f3c[_0x4cb0('0x34')][_0x4cb0('0x3e')]+'%'};return _0x2ebad0;}})});}_0x50f9eb=_[_0x4cb0('0x3f')]({},_0x50f9eb,_0x331f3c[_0x4cb0('0x41')]);var _0x5ce21b={'where':_0x50f9eb['where']};return db[_0x4cb0('0x30')]['count'](_0x5ce21b)[_0x4cb0('0x28')](function(_0x3ddf2c){_0x8191fd[_0x4cb0('0x42')]=_0x3ddf2c;if(_0x331f3c['query'][_0x4cb0('0x43')]){_0x50f9eb[_0x4cb0('0x44')]=[{'all':!![]}];}return db[_0x4cb0('0x30')]['findAll'](_0x50f9eb);})[_0x4cb0('0x28')](function(_0x40e1de){_0x8191fd[_0x4cb0('0x45')]=_0x40e1de;return _0x8191fd;})[_0x4cb0('0x28')](respondWithFilteredResult(_0xde2bd9,_0x50f9eb))['catch'](handleError(_0xde2bd9,null));};exports[_0x4cb0('0x46')]=function(_0x400b2b,_0xcabcc4){var _0x350be0={'raw':!![],'where':{'id':_0x400b2b['params']['id']}},_0x15e610={};_0x15e610['model']=_[_0x4cb0('0x35')](db[_0x4cb0('0x30')][_0x4cb0('0x47')]);_0x15e610['query']=_['keys'](_0x400b2b[_0x4cb0('0x34')]);_0x15e610[_0x4cb0('0x3d')]=_[_0x4cb0('0x36')](_0x15e610[_0x4cb0('0x33')],_0x15e610['query']);_0x350be0[_0x4cb0('0x37')]=_[_0x4cb0('0x36')](_0x15e610[_0x4cb0('0x33')],qs[_0x4cb0('0x38')](_0x400b2b[_0x4cb0('0x34')][_0x4cb0('0x38')]));_0x350be0[_0x4cb0('0x37')]=_0x350be0['attributes']['length']?_0x350be0[_0x4cb0('0x37')]:_0x15e610[_0x4cb0('0x33')];if(_0x400b2b[_0x4cb0('0x34')]['includeAll']){_0x350be0[_0x4cb0('0x44')]=[{'all':!![]}];}_0x350be0=_['merge']({},_0x350be0,_0x400b2b['options']);return db['Dynamics365Field'][_0x4cb0('0x48')](_0x350be0)[_0x4cb0('0x28')](handleEntityNotFound(_0xcabcc4,null))[_0x4cb0('0x28')](respondWithResult(_0xcabcc4,null))[_0x4cb0('0x49')](handleError(_0xcabcc4,null));};exports[_0x4cb0('0x4a')]=function(_0x296d72,_0x534f0b){return db[_0x4cb0('0x30')][_0x4cb0('0x4a')](_0x296d72[_0x4cb0('0x4b')],{})['then'](respondWithResult(_0x534f0b,0xc9))[_0x4cb0('0x49')](handleError(_0x534f0b,null));};exports['update']=function(_0x35ba36,_0x2ab4b9){if(_0x35ba36['body']['id']){delete _0x35ba36[_0x4cb0('0x4b')]['id'];}return db[_0x4cb0('0x30')][_0x4cb0('0x48')]({'where':{'id':_0x35ba36[_0x4cb0('0x4c')]['id']}})[_0x4cb0('0x28')](handleEntityNotFound(_0x2ab4b9,null))[_0x4cb0('0x28')](saveUpdates(_0x35ba36['body'],null))[_0x4cb0('0x28')](respondWithResult(_0x2ab4b9,null))[_0x4cb0('0x49')](handleError(_0x2ab4b9,null));};exports['destroy']=function(_0xa99e58,_0x2052ea){return db[_0x4cb0('0x30')][_0x4cb0('0x48')]({'where':{'id':_0xa99e58['params']['id']}})['then'](handleEntityNotFound(_0x2052ea,null))[_0x4cb0('0x28')](removeEntity(_0x2052ea,null))['catch'](handleError(_0x2052ea,null));}; \ No newline at end of file +var _0xda81=['type','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','destroy','end','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','keys','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','merge'];(function(_0x9787ac,_0x5dcc02){var _0x884edd=function(_0x5dacad){while(--_0x5dacad){_0x9787ac['push'](_0x9787ac['shift']());}};_0x884edd(++_0x5dcc02);}(_0xda81,0x1c3));var _0x1da8=function(_0x3ff2ca,_0x173bd9){_0x3ff2ca=_0x3ff2ca-0x0;var _0x945e76=_0xda81[_0x3ff2ca];return _0x945e76;};'use strict';var pdf=require(_0x1da8('0x0'));var emlformat=require(_0x1da8('0x1'));var rimraf=require(_0x1da8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1da8('0x3'));var rp=require(_0x1da8('0x4'));var moment=require(_0x1da8('0x5'));var BPromise=require(_0x1da8('0x6'));var Mustache=require('mustache');var util=require(_0x1da8('0x7'));var path=require(_0x1da8('0x8'));var sox=require('sox');var csv=require(_0x1da8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1da8('0xa'));var squel=require(_0x1da8('0xb'));var crypto=require(_0x1da8('0xc'));var jsforce=require(_0x1da8('0xd'));var deskjs=require(_0x1da8('0xe'));var toCsv=require(_0x1da8('0x9'));var querystring=require(_0x1da8('0xf'));var Papa=require(_0x1da8('0x10'));var Redis=require(_0x1da8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1da8('0x12'));var as=require(_0x1da8('0x13'));var hardwareService=require(_0x1da8('0x14'));var logger=require(_0x1da8('0x15'))(_0x1da8('0x16'));var utils=require('../../config/utils');var config=require(_0x1da8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120d54,_0x4127c8){_0x4127c8=_0x4127c8||0xcc;return function(_0x2717e6){if(_0x2717e6){return _0x120d54[_0x1da8('0x18')](_0x4127c8);}return _0x120d54[_0x1da8('0x19')](_0x4127c8)['end']();};}function respondWithResult(_0x9d4cd3,_0x491a3f){_0x491a3f=_0x491a3f||0xc8;return function(_0x335935){if(_0x335935){return _0x9d4cd3[_0x1da8('0x19')](_0x491a3f)[_0x1da8('0x1a')](_0x335935);}};}function respondWithFilteredResult(_0x4a3025,_0x23b7e7){return function(_0x1e25ff){if(_0x1e25ff){var _0x5f40c0=_0x1e25ff[_0x1da8('0x1b')],_0x155829=_0x23b7e7[_0x1da8('0x1c')],_0x1bd1e9=_0x23b7e7[_0x1da8('0x1c')]+_0x23b7e7[_0x1da8('0x1d')],_0x3bea6f;if(_0x1bd1e9>=_0x5f40c0){_0x1bd1e9=_0x5f40c0;_0x3bea6f=0xc8;}else{_0x3bea6f=0xce;}_0x4a3025[_0x1da8('0x19')](_0x3bea6f);return _0x4a3025[_0x1da8('0x1e')]('Content-Range',_0x155829+'-'+_0x1bd1e9+'/'+_0x5f40c0)[_0x1da8('0x1a')](_0x1e25ff);}return null;};}function patchUpdates(_0x17a2b4){return function(_0x313172){try{jsonpatch[_0x1da8('0x1f')](_0x313172,_0x17a2b4,!![]);}catch(_0x1fa6a7){return BPromise[_0x1da8('0x20')](_0x1fa6a7);}return _0x313172['save']();};}function saveUpdates(_0x346662,_0x36f234){return function(_0x3afeb3){if(_0x3afeb3){return _0x3afeb3[_0x1da8('0x21')](_0x346662)[_0x1da8('0x22')](function(_0x307663){return _0x307663;});}return null;};}function removeEntity(_0x54fcd1,_0x283ff8){return function(_0x503adb){if(_0x503adb){return _0x503adb[_0x1da8('0x23')]()[_0x1da8('0x22')](function(){_0x54fcd1[_0x1da8('0x19')](0xcc)[_0x1da8('0x24')]();});}};}function handleEntityNotFound(_0x2a9002,_0x2ea607){return function(_0x2839e2){if(!_0x2839e2){_0x2a9002['sendStatus'](0x194);}return _0x2839e2;};}function handleError(_0x4a703d,_0xac4b2a){_0xac4b2a=_0xac4b2a||0x1f4;return function(_0x1b3ba3){logger['error'](_0x1b3ba3[_0x1da8('0x25')]);if(_0x1b3ba3[_0x1da8('0x26')]){delete _0x1b3ba3[_0x1da8('0x26')];}_0x4a703d[_0x1da8('0x19')](_0xac4b2a)[_0x1da8('0x27')](_0x1b3ba3);};}exports[_0x1da8('0x28')]=function(_0x5c3960,_0x1da598){var _0x40730d={},_0x2d81cd={},_0x1c5863={'count':0x0,'rows':[]};var _0x21d5cf=_[_0x1da8('0x29')](db[_0x1da8('0x2a')][_0x1da8('0x2b')],function(_0x442043){return{'name':_0x442043[_0x1da8('0x2c')],'type':_0x442043['type'][_0x1da8('0x2d')]};});_0x2d81cd['model']=_['map'](_0x21d5cf,'name');_0x2d81cd['query']=_[_0x1da8('0x2e')](_0x5c3960[_0x1da8('0x2f')]);_0x2d81cd['filters']=_[_0x1da8('0x30')](_0x2d81cd['model'],_0x2d81cd[_0x1da8('0x2f')]);_0x40730d[_0x1da8('0x31')]=_[_0x1da8('0x30')](_0x2d81cd['model'],qs[_0x1da8('0x32')](_0x5c3960[_0x1da8('0x2f')][_0x1da8('0x32')]));_0x40730d[_0x1da8('0x31')]=_0x40730d['attributes'][_0x1da8('0x33')]?_0x40730d[_0x1da8('0x31')]:_0x2d81cd[_0x1da8('0x34')];if(!_0x5c3960[_0x1da8('0x2f')][_0x1da8('0x35')](_0x1da8('0x36'))){_0x40730d['limit']=qs[_0x1da8('0x1d')](_0x5c3960[_0x1da8('0x2f')][_0x1da8('0x1d')]);_0x40730d['offset']=qs[_0x1da8('0x1c')](_0x5c3960[_0x1da8('0x2f')][_0x1da8('0x1c')]);}_0x40730d[_0x1da8('0x37')]=qs[_0x1da8('0x38')](_0x5c3960['query'][_0x1da8('0x38')]);_0x40730d[_0x1da8('0x39')]=qs[_0x1da8('0x3a')](_['pick'](_0x5c3960['query'],_0x2d81cd[_0x1da8('0x3a')]));if(_0x5c3960['query']['filter']){_0x40730d['where']=_[_0x1da8('0x3b')](_0x40730d[_0x1da8('0x39')],{'$or':_[_0x1da8('0x29')](_0x21d5cf,function(_0x4a177c){if(_0x4a177c[_0x1da8('0x3c')]!=='VIRTUAL'){var _0x7606ff={};_0x7606ff[_0x4a177c[_0x1da8('0x26')]]={'$like':'%'+_0x5c3960[_0x1da8('0x2f')][_0x1da8('0x3d')]+'%'};return _0x7606ff;}})});}_0x40730d=_[_0x1da8('0x3b')]({},_0x40730d,_0x5c3960[_0x1da8('0x3e')]);var _0x14c32c={'where':_0x40730d[_0x1da8('0x39')]};return db[_0x1da8('0x2a')][_0x1da8('0x1b')](_0x14c32c)[_0x1da8('0x22')](function(_0x40421e){_0x1c5863['count']=_0x40421e;if(_0x5c3960[_0x1da8('0x2f')][_0x1da8('0x3f')]){_0x40730d['include']=[{'all':!![]}];}return db[_0x1da8('0x2a')][_0x1da8('0x40')](_0x40730d);})[_0x1da8('0x22')](function(_0x5be265){_0x1c5863[_0x1da8('0x41')]=_0x5be265;return _0x1c5863;})[_0x1da8('0x22')](respondWithFilteredResult(_0x1da598,_0x40730d))[_0x1da8('0x42')](handleError(_0x1da598,null));};exports[_0x1da8('0x43')]=function(_0x417507,_0x4a792e){var _0x3655c0={'raw':!![],'where':{'id':_0x417507[_0x1da8('0x44')]['id']}},_0x1321c7={};_0x1321c7['model']=_[_0x1da8('0x2e')](db['Dynamics365Field'][_0x1da8('0x2b')]);_0x1321c7[_0x1da8('0x2f')]=_[_0x1da8('0x2e')](_0x417507[_0x1da8('0x2f')]);_0x1321c7[_0x1da8('0x3a')]=_[_0x1da8('0x30')](_0x1321c7[_0x1da8('0x34')],_0x1321c7[_0x1da8('0x2f')]);_0x3655c0[_0x1da8('0x31')]=_[_0x1da8('0x30')](_0x1321c7['model'],qs[_0x1da8('0x32')](_0x417507[_0x1da8('0x2f')][_0x1da8('0x32')]));_0x3655c0[_0x1da8('0x31')]=_0x3655c0[_0x1da8('0x31')]['length']?_0x3655c0[_0x1da8('0x31')]:_0x1321c7[_0x1da8('0x34')];if(_0x417507[_0x1da8('0x2f')][_0x1da8('0x3f')]){_0x3655c0[_0x1da8('0x45')]=[{'all':!![]}];}_0x3655c0=_[_0x1da8('0x3b')]({},_0x3655c0,_0x417507[_0x1da8('0x3e')]);return db[_0x1da8('0x2a')][_0x1da8('0x46')](_0x3655c0)[_0x1da8('0x22')](handleEntityNotFound(_0x4a792e,null))[_0x1da8('0x22')](respondWithResult(_0x4a792e,null))[_0x1da8('0x42')](handleError(_0x4a792e,null));};exports[_0x1da8('0x47')]=function(_0x2a08bd,_0x4e515f){return db['Dynamics365Field'][_0x1da8('0x47')](_0x2a08bd[_0x1da8('0x48')],{})[_0x1da8('0x22')](respondWithResult(_0x4e515f,0xc9))[_0x1da8('0x42')](handleError(_0x4e515f,null));};exports[_0x1da8('0x21')]=function(_0x1ed191,_0x502c19){if(_0x1ed191[_0x1da8('0x48')]['id']){delete _0x1ed191['body']['id'];}return db[_0x1da8('0x2a')][_0x1da8('0x46')]({'where':{'id':_0x1ed191[_0x1da8('0x44')]['id']}})['then'](handleEntityNotFound(_0x502c19,null))[_0x1da8('0x22')](saveUpdates(_0x1ed191[_0x1da8('0x48')],null))[_0x1da8('0x22')](respondWithResult(_0x502c19,null))[_0x1da8('0x42')](handleError(_0x502c19,null));};exports[_0x1da8('0x23')]=function(_0x40a2c4,_0x54311d){return db[_0x1da8('0x2a')]['find']({'where':{'id':_0x40a2c4[_0x1da8('0x44')]['id']}})['then'](handleEntityNotFound(_0x54311d,null))[_0x1da8('0x22')](removeEntity(_0x54311d,null))['catch'](handleError(_0x54311d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index b54a479..a60e639 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.model.js +++ b/server/api/intDynamics365Field/intDynamics365Field.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb07=['FieldId','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','dynamics365_unique_index','idField'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcb07,0x90));var _0x7cb0=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xcb07[_0x374ccf];return _0x443cde;};'use strict';var _=require(_0x7cb0('0x0'));var util=require(_0x7cb0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7cb0('0x2'));var BPromise=require('bluebird');var rp=require(_0x7cb0('0x3'));var fs=require('fs');var path=require(_0x7cb0('0x4'));var rimraf=require(_0x7cb0('0x5'));var config=require(_0x7cb0('0x6'));var attributes=require(_0x7cb0('0x7'));module[_0x7cb0('0x8')]=function(_0x5b5dd8,_0x442081){return _0x5b5dd8[_0x7cb0('0x9')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x7cb0('0xa'),'fields':[_0x7cb0('0xb'),_0x7cb0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe20c=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe20c,0x132));var _0xce20=function(_0x22035b,_0x2dda2b){_0x22035b=_0x22035b-0x0;var _0xa51288=_0xe20c[_0x22035b];return _0xa51288;};'use strict';var _=require(_0xce20('0x0'));var util=require(_0xce20('0x1'));var logger=require(_0xce20('0x2'))(_0xce20('0x3'));var moment=require('moment');var BPromise=require(_0xce20('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce20('0x5'));var rimraf=require(_0xce20('0x6'));var config=require(_0xce20('0x7'));var attributes=require(_0xce20('0x8'));module[_0xce20('0x9')]=function(_0x52dc50,_0x138c52){return _0x52dc50[_0xce20('0xa')](_0xce20('0xb'),attributes,{'tableName':_0xce20('0xc'),'paranoid':![],'indexes':[{'name':_0xce20('0xd'),'fields':['idField',_0xce20('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 38eaeb8..3344cbc 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js +++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3fe=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Field,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x2867ba,_0x19134c){var _0x2d12a4=function(_0x3460df){while(--_0x3460df){_0x2867ba['push'](_0x2867ba['shift']());}};_0x2d12a4(++_0x19134c);}(_0xa3fe,0xd8));var _0xea3f=function(_0x151a09,_0x61dac3){_0x151a09=_0x151a09-0x0;var _0x4d8975=_0xa3fe[_0x151a09];return _0x4d8975;};'use strict';var _=require(_0xea3f('0x0'));var util=require('util');var moment=require(_0xea3f('0x1'));var BPromise=require(_0xea3f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea3f('0x3'));var db=require(_0xea3f('0x4'))['db'];var utils=require(_0xea3f('0x5'));var logger=require('../../config/logger')(_0xea3f('0x6'));var config=require('../../config/environment');var jayson=require(_0xea3f('0x7'));var client=jayson[_0xea3f('0x8')][_0xea3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49e494,_0x56abd6,_0x187ce0){return new BPromise(function(_0x35ba50,_0x3c4807){return client['request'](_0x49e494,_0x187ce0)['then'](function(_0x464ad4){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x56abd6,_0xea3f('0xa'));logger[_0xea3f('0xb')](_0xea3f('0xc'),_0x56abd6,'request\x20sent',JSON['stringify'](_0x464ad4));if(_0x464ad4['error']){if(_0x464ad4[_0xea3f('0xd')][_0xea3f('0xe')]===0x1f4){logger[_0xea3f('0xd')](_0xea3f('0xf'),_0x56abd6,_0x464ad4['error']['message']);return _0x3c4807(_0x464ad4['error'][_0xea3f('0x10')]);}logger[_0xea3f('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x56abd6,_0x464ad4[_0xea3f('0xd')][_0xea3f('0x10')]);return _0x35ba50(_0x464ad4['error'][_0xea3f('0x10')]);}else{logger[_0xea3f('0x11')](_0xea3f('0xf'),_0x56abd6,_0xea3f('0xa'));_0x35ba50(_0x464ad4[_0xea3f('0x12')][_0xea3f('0x10')]);}})[_0xea3f('0x13')](function(_0x2585f1){logger[_0xea3f('0xd')](_0xea3f('0xf'),_0x56abd6,_0x2585f1);_0x3c4807(_0x2585f1);});});} \ No newline at end of file +var _0xe451=['rpc','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1077cd,_0x162585){var _0x5b3717=function(_0x153981){while(--_0x153981){_0x1077cd['push'](_0x1077cd['shift']());}};_0x5b3717(++_0x162585);}(_0xe451,0xec));var _0x1e45=function(_0x2a2633,_0x467b95){_0x2a2633=_0x2a2633-0x0;var _0x4becbd=_0xe451[_0x2a2633];return _0x4becbd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e45('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e45('0x1'))['db'];var utils=require(_0x1e45('0x2'));var logger=require(_0x1e45('0x3'))(_0x1e45('0x4'));var config=require('../../config/environment');var jayson=require(_0x1e45('0x5'));var client=jayson[_0x1e45('0x6')][_0x1e45('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x563405,_0xc62c6f,_0x31c118){return new BPromise(function(_0x4dd77f,_0x544710){return client[_0x1e45('0x8')](_0x563405,_0x31c118)[_0x1e45('0x9')](function(_0xde48d9){logger['info'](_0x1e45('0xa'),_0xc62c6f,_0x1e45('0xb'));logger[_0x1e45('0xc')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0xc62c6f,'request\x20sent',JSON[_0x1e45('0xd')](_0xde48d9));if(_0xde48d9[_0x1e45('0xe')]){if(_0xde48d9[_0x1e45('0xe')][_0x1e45('0xf')]===0x1f4){logger['error'](_0x1e45('0xa'),_0xc62c6f,_0xde48d9[_0x1e45('0xe')][_0x1e45('0x10')]);return _0x544710(_0xde48d9['error'][_0x1e45('0x10')]);}logger[_0x1e45('0xe')](_0x1e45('0xa'),_0xc62c6f,_0xde48d9[_0x1e45('0xe')]['message']);return _0x4dd77f(_0xde48d9[_0x1e45('0xe')]['message']);}else{logger[_0x1e45('0x11')](_0x1e45('0xa'),_0xc62c6f,'request\x20sent');_0x4dd77f(_0xde48d9[_0x1e45('0x12')][_0x1e45('0x10')]);}})[_0x1e45('0x13')](function(_0x1e5b73){logger[_0x1e45('0xe')](_0x1e45('0xa'),_0xc62c6f,_0x1e5b73);_0x544710(_0x1e5b73);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index fa5cc06..d181c98 100644 --- a/server/api/intFreshdeskAccount/index.js +++ b/server/api/intFreshdeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1740=['isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1740,0xa9));var _0x0174=function(_0x2a7b0a,_0x1b2396){_0x2a7b0a=_0x2a7b0a-0x0;var _0x1365c0=_0x1740[_0x2a7b0a];return _0x1365c0;};'use strict';var multer=require(_0x0174('0x0'));var util=require(_0x0174('0x1'));var path=require(_0x0174('0x2'));var timeout=require(_0x0174('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0174('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0174('0x5'));var controller=require(_0x0174('0x6'));router['get']('/',auth[_0x0174('0x7')](),controller[_0x0174('0x8')]);router[_0x0174('0x9')](_0x0174('0xa'),auth[_0x0174('0x7')](),controller[_0x0174('0xb')]);router[_0x0174('0x9')](_0x0174('0xc'),auth[_0x0174('0x7')](),controller[_0x0174('0xd')]);router[_0x0174('0x9')](_0x0174('0xe'),auth[_0x0174('0x7')](),controller[_0x0174('0xf')]);router[_0x0174('0x10')]('/',auth[_0x0174('0x7')](),controller[_0x0174('0x11')]);router[_0x0174('0x10')](_0x0174('0xc'),auth[_0x0174('0x7')](),controller[_0x0174('0x12')]);router['put'](_0x0174('0xa'),auth['isAuthenticated'](),controller[_0x0174('0x13')]);router[_0x0174('0x14')]('/:id',auth[_0x0174('0x7')](),controller[_0x0174('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe94f=['update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','index','get','/:id','show','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put'];(function(_0x237c0c,_0x7c5302){var _0x35157f=function(_0x2bd2cb){while(--_0x2bd2cb){_0x237c0c['push'](_0x237c0c['shift']());}};_0x35157f(++_0x7c5302);}(_0xe94f,0x1b9));var _0xfe94=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0xe94f[_0x5f12fd];return _0x58bd80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfe94('0x0'));var timeout=require('connect-timeout');var express=require(_0xfe94('0x1'));var router=express[_0xfe94('0x2')]();var auth=require(_0xfe94('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfe94('0x4'));var controller=require(_0xfe94('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfe94('0x6')]);router[_0xfe94('0x7')](_0xfe94('0x8'),auth['isAuthenticated'](),controller[_0xfe94('0x9')]);router['get']('/:id/configurations',auth[_0xfe94('0xa')](),controller[_0xfe94('0xb')]);router['get'](_0xfe94('0xc'),auth[_0xfe94('0xa')](),controller[_0xfe94('0xd')]);router[_0xfe94('0xe')]('/',auth[_0xfe94('0xa')](),controller[_0xfe94('0xf')]);router[_0xfe94('0xe')](_0xfe94('0x10'),auth[_0xfe94('0xa')](),controller[_0xfe94('0x11')]);router[_0xfe94('0x12')]('/:id',auth[_0xfe94('0xa')](),controller[_0xfe94('0x13')]);router[_0xfe94('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xfe94('0x15')]);module[_0xfe94('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 48fc8f0..0ce2103 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c8d=['username','exports','STRING'];(function(_0x32293c,_0x5aabcb){var _0xaab288=function(_0x15d01d){while(--_0x15d01d){_0x32293c['push'](_0x32293c['shift']());}};_0xaab288(++_0x5aabcb);}(_0x0c8d,0x79));var _0xd0c8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0c8d[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require('sequelize');module[_0xd0c8('0x0')]={'name':{'type':Sequelize[_0xd0c8('0x1')]},'description':{'type':Sequelize[_0xd0c8('0x1')]},'username':{'type':Sequelize[_0xd0c8('0x1')],'unique':_0xd0c8('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4201=['STRING','username','remoteUri','sequelize','exports'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x4201,0x71));var _0x1420=function(_0x1075b8,_0xd606e2){_0x1075b8=_0x1075b8-0x0;var _0x5d047f=_0x4201[_0x1075b8];return _0x5d047f;};'use strict';var Sequelize=require(_0x1420('0x0'));module[_0x1420('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1420('0x2')]},'username':{'type':Sequelize[_0x1420('0x2')],'unique':_0x1420('0x3')},'apiKey':{'type':Sequelize[_0x1420('0x2')]},'remoteUri':{'type':Sequelize[_0x1420('0x2')],'unique':_0x1420('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index c62abc0..c8c6146 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf9=['update','then','stack','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','findAll','rows','show','params','includeAll','options','find','create','body','destroy','getConfigurations','findOne','order','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskConfiguration','FreshdeskField','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','base64','requester','subject','source','group','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','request-promise','bluebird','mustache','util','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save'];(function(_0x2b1b19,_0x2eac02){var _0x511f69=function(_0x5ee8c4){while(--_0x5ee8c4){_0x2b1b19['push'](_0x2b1b19['shift']());}};_0x511f69(++_0x2eac02);}(_0x4cf9,0x1bb));var _0x94cf=function(_0xd35a13,_0x3e8ae6){_0xd35a13=_0xd35a13-0x0;var _0x35a6f3=_0x4cf9[_0xd35a13];return _0x35a6f3;};'use strict';var pdf=require(_0x94cf('0x0'));var emlformat=require(_0x94cf('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x94cf('0x2'));var moment=require('moment');var BPromise=require(_0x94cf('0x3'));var Mustache=require(_0x94cf('0x4'));var util=require(_0x94cf('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x94cf('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x94cf('0x7'));var jsforce=require(_0x94cf('0x8'));var deskjs=require(_0x94cf('0x9'));var toCsv=require(_0x94cf('0x6'));var querystring=require(_0x94cf('0xa'));var Papa=require(_0x94cf('0xb'));var Redis=require(_0x94cf('0xc'));var authService=require(_0x94cf('0xd'));var qs=require(_0x94cf('0xe'));var as=require(_0x94cf('0xf'));var hardwareService=require(_0x94cf('0x10'));var logger=require(_0x94cf('0x11'))(_0x94cf('0x12'));var utils=require(_0x94cf('0x13'));var config=require('../../config/environment');var db=require(_0x94cf('0x14'))['db'];var integrations=require(_0x94cf('0x15'));var jayson=require(_0x94cf('0x16'));var client=jayson['client'][_0x94cf('0x17')]({'port':0x232a});function checkPasswordPattern(_0x624c47,_0x50da13,_0x4a220c){if(_0x4a220c){var _0x2c2435=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c2435['test'](_0x50da13)){return _0x624c47;}else{throw new db[(_0x94cf('0x18'))]['ValidationError'](_0x94cf('0x19'));}}else{return _0x624c47;}}function respondWithRpcPromise(_0x3421bc,_0x13eba5,_0x2f5f50,_0x5b0ba3){return new BPromise(function(_0x1f7cb4,_0x44f34a){var _0x1428fc=_0x5b0ba3||client;return _0x1428fc[_0x94cf('0x1a')](_0x3421bc,_0x2f5f50)['then'](function(_0x2e041f){logger[_0x94cf('0x1b')](_0x94cf('0x1c'),_0x13eba5,_0x94cf('0x1d'));logger[_0x94cf('0x1e')](_0x94cf('0x1f'),_0x13eba5,_0x94cf('0x1d'),JSON[_0x94cf('0x20')](_0x2e041f));if(_0x2e041f[_0x94cf('0x21')]){if(_0x2e041f[_0x94cf('0x21')][_0x94cf('0x22')]===0x1f4){logger[_0x94cf('0x21')](_0x94cf('0x1c'),_0x13eba5,_0x2e041f['error'][_0x94cf('0x23')]);return _0x44f34a(_0x2e041f['error'][_0x94cf('0x23')]);}logger[_0x94cf('0x21')](_0x94cf('0x1c'),_0x13eba5,_0x2e041f[_0x94cf('0x21')][_0x94cf('0x23')]);return _0x1f7cb4(_0x2e041f['error']['message']);}else{logger[_0x94cf('0x1b')]('FreshdeskAccount,\x20%s,\x20%s',_0x13eba5,'request\x20sent');_0x1f7cb4(_0x2e041f[_0x94cf('0x24')][_0x94cf('0x23')]);}})[_0x94cf('0x25')](function(_0x46278e){logger[_0x94cf('0x21')](_0x94cf('0x1c'),_0x13eba5,_0x46278e);_0x44f34a(_0x46278e);});});}function respondWithStatusCode(_0xfc1eaf,_0x2e21d5){_0x2e21d5=_0x2e21d5||0xcc;return function(_0x42482e){if(_0x42482e){return _0xfc1eaf[_0x94cf('0x26')](_0x2e21d5);}return _0xfc1eaf[_0x94cf('0x27')](_0x2e21d5)[_0x94cf('0x28')]();};}function respondWithResult(_0x3abdd5,_0x4b33fc){_0x4b33fc=_0x4b33fc||0xc8;return function(_0x4e4169){if(_0x4e4169){return _0x3abdd5['status'](_0x4b33fc)['json'](_0x4e4169);}};}function respondWithFilteredResult(_0x239e11,_0x501732){return function(_0x5db6d5){if(_0x5db6d5){var _0x4477bd=_0x5db6d5[_0x94cf('0x29')],_0x490ebe=_0x501732[_0x94cf('0x2a')],_0x2c2f4f=_0x501732['offset']+_0x501732[_0x94cf('0x2b')],_0x132aee;if(_0x2c2f4f>=_0x4477bd){_0x2c2f4f=_0x4477bd;_0x132aee=0xc8;}else{_0x132aee=0xce;}_0x239e11[_0x94cf('0x27')](_0x132aee);return _0x239e11[_0x94cf('0x2c')](_0x94cf('0x2d'),_0x490ebe+'-'+_0x2c2f4f+'/'+_0x4477bd)[_0x94cf('0x2e')](_0x5db6d5);}return null;};}function patchUpdates(_0x1ffbc7){return function(_0x25fb05){try{jsonpatch[_0x94cf('0x2f')](_0x25fb05,_0x1ffbc7,!![]);}catch(_0xd9cc3e){return BPromise['reject'](_0xd9cc3e);}return _0x25fb05[_0x94cf('0x30')]();};}function saveUpdates(_0x4c6098,_0x314698){return function(_0x3f3d61){if(_0x3f3d61){return _0x3f3d61[_0x94cf('0x31')](_0x4c6098)[_0x94cf('0x32')](function(_0x1fb824){return _0x1fb824;});}return null;};}function removeEntity(_0x5b6f1c,_0x45d8cc){return function(_0x37e7eb){if(_0x37e7eb){return _0x37e7eb['destroy']()[_0x94cf('0x32')](function(){_0x5b6f1c['status'](0xcc)[_0x94cf('0x28')]();});}};}function handleEntityNotFound(_0x583d14,_0x2a39df){return function(_0xb50e18){if(!_0xb50e18){_0x583d14[_0x94cf('0x26')](0x194);}return _0xb50e18;};}function handleError(_0x2d48ee,_0x23cee5){_0x23cee5=_0x23cee5||0x1f4;return function(_0x2dc6c4){logger['error'](_0x2dc6c4[_0x94cf('0x33')]);if(_0x2dc6c4['name']){delete _0x2dc6c4['name'];}_0x2d48ee['status'](_0x23cee5)[_0x94cf('0x34')](_0x2dc6c4);};}exports[_0x94cf('0x35')]=function(_0x3df9db,_0xd9f453){var _0x47e91a={},_0x569fcc={},_0x576219={'count':0x0,'rows':[]};var _0x888dd3=_[_0x94cf('0x36')](db[_0x94cf('0x37')][_0x94cf('0x38')],function(_0x5b6646){return{'name':_0x5b6646[_0x94cf('0x39')],'type':_0x5b6646[_0x94cf('0x3a')][_0x94cf('0x3b')]};});_0x569fcc[_0x94cf('0x3c')]=_[_0x94cf('0x36')](_0x888dd3,_0x94cf('0x3d'));_0x569fcc[_0x94cf('0x3e')]=_[_0x94cf('0x3f')](_0x3df9db['query']);_0x569fcc[_0x94cf('0x40')]=_[_0x94cf('0x41')](_0x569fcc[_0x94cf('0x3c')],_0x569fcc[_0x94cf('0x3e')]);_0x47e91a[_0x94cf('0x42')]=_[_0x94cf('0x41')](_0x569fcc[_0x94cf('0x3c')],qs['fields'](_0x3df9db[_0x94cf('0x3e')][_0x94cf('0x43')]));_0x47e91a['attributes']=_0x47e91a[_0x94cf('0x42')][_0x94cf('0x44')]?_0x47e91a[_0x94cf('0x42')]:_0x569fcc['model'];if(!_0x3df9db[_0x94cf('0x3e')][_0x94cf('0x45')]('nolimit')){_0x47e91a[_0x94cf('0x2b')]=qs[_0x94cf('0x2b')](_0x3df9db[_0x94cf('0x3e')]['limit']);_0x47e91a['offset']=qs[_0x94cf('0x2a')](_0x3df9db[_0x94cf('0x3e')]['offset']);}_0x47e91a['order']=qs[_0x94cf('0x46')](_0x3df9db[_0x94cf('0x3e')][_0x94cf('0x46')]);_0x47e91a['where']=qs[_0x94cf('0x40')](_[_0x94cf('0x47')](_0x3df9db[_0x94cf('0x3e')],_0x569fcc[_0x94cf('0x40')]));if(_0x3df9db['query'][_0x94cf('0x48')]){_0x47e91a['where']=_['merge'](_0x47e91a[_0x94cf('0x49')],{'$or':_['map'](_0x888dd3,function(_0x10c6f7){if(_0x10c6f7['type']!==_0x94cf('0x4a')){var _0x796219={};_0x796219[_0x10c6f7['name']]={'$like':'%'+_0x3df9db[_0x94cf('0x3e')]['filter']+'%'};return _0x796219;}})});}_0x47e91a=_[_0x94cf('0x4b')]({},_0x47e91a,_0x3df9db['options']);var _0x2e0805={'where':_0x47e91a[_0x94cf('0x49')]};return db[_0x94cf('0x37')][_0x94cf('0x29')](_0x2e0805)[_0x94cf('0x32')](function(_0x2c362f){_0x576219[_0x94cf('0x29')]=_0x2c362f;if(_0x3df9db[_0x94cf('0x3e')]['includeAll']){_0x47e91a['include']=[{'all':!![]}];}return db[_0x94cf('0x37')][_0x94cf('0x4c')](_0x47e91a);})[_0x94cf('0x32')](function(_0x29da31){_0x576219[_0x94cf('0x4d')]=_0x29da31;return _0x576219;})[_0x94cf('0x32')](respondWithFilteredResult(_0xd9f453,_0x47e91a))[_0x94cf('0x25')](handleError(_0xd9f453,null));};exports[_0x94cf('0x4e')]=function(_0x5268ce,_0x1d7d55){var _0x54832d={'raw':![],'where':{'id':_0x5268ce[_0x94cf('0x4f')]['id']}},_0x32de74={};_0x32de74[_0x94cf('0x3c')]=_[_0x94cf('0x3f')](db['FreshdeskAccount'][_0x94cf('0x38')]);_0x32de74[_0x94cf('0x3e')]=_[_0x94cf('0x3f')](_0x5268ce[_0x94cf('0x3e')]);_0x32de74['filters']=_[_0x94cf('0x41')](_0x32de74[_0x94cf('0x3c')],_0x32de74['query']);_0x54832d[_0x94cf('0x42')]=_[_0x94cf('0x41')](_0x32de74[_0x94cf('0x3c')],qs['fields'](_0x5268ce[_0x94cf('0x3e')][_0x94cf('0x43')]));_0x54832d[_0x94cf('0x42')]=_0x54832d[_0x94cf('0x42')][_0x94cf('0x44')]?_0x54832d[_0x94cf('0x42')]:_0x32de74[_0x94cf('0x3c')];if(_0x5268ce['query'][_0x94cf('0x50')]){_0x54832d['include']=[{'all':!![]}];}_0x54832d=_['merge']({},_0x54832d,_0x5268ce[_0x94cf('0x51')]);return db[_0x94cf('0x37')][_0x94cf('0x52')](_0x54832d)['then'](handleEntityNotFound(_0x1d7d55,null))[_0x94cf('0x32')](respondWithResult(_0x1d7d55,null))[_0x94cf('0x25')](handleError(_0x1d7d55,null));};exports[_0x94cf('0x53')]=function(_0x5139ae,_0x3590ce){return db[_0x94cf('0x37')][_0x94cf('0x53')](_0x5139ae[_0x94cf('0x54')],{})['then'](respondWithResult(_0x3590ce,0xc9))[_0x94cf('0x25')](handleError(_0x3590ce,null));};exports['update']=function(_0x3ab7ea,_0x39e747){if(_0x3ab7ea[_0x94cf('0x54')]['id']){delete _0x3ab7ea['body']['id'];}return db[_0x94cf('0x37')][_0x94cf('0x52')]({'where':{'id':_0x3ab7ea[_0x94cf('0x4f')]['id']}})[_0x94cf('0x32')](handleEntityNotFound(_0x39e747,null))['then'](saveUpdates(_0x3ab7ea[_0x94cf('0x54')],null))[_0x94cf('0x32')](respondWithResult(_0x39e747,null))[_0x94cf('0x25')](handleError(_0x39e747,null));};exports[_0x94cf('0x55')]=function(_0x1db3f0,_0x4a5fc8){return db[_0x94cf('0x37')][_0x94cf('0x52')]({'where':{'id':_0x1db3f0[_0x94cf('0x4f')]['id']}})[_0x94cf('0x32')](handleEntityNotFound(_0x4a5fc8,null))['then'](removeEntity(_0x4a5fc8,null))[_0x94cf('0x25')](handleError(_0x4a5fc8,null));};exports[_0x94cf('0x56')]=function(_0x5d3f67,_0x57d93c,_0x17ffc8){var _0x178ee0={};var _0x3a24b4={};var _0x5dc954;var _0xce03e2;return db['FreshdeskAccount'][_0x94cf('0x57')]({'where':{'id':_0x5d3f67[_0x94cf('0x4f')]['id']}})[_0x94cf('0x32')](handleEntityNotFound(_0x57d93c,null))['then'](function(_0x19b4ee){if(_0x19b4ee){_0x5dc954=_0x19b4ee;_0x3a24b4['model']=_[_0x94cf('0x3f')](db['FreshdeskConfiguration'][_0x94cf('0x38')]);_0x3a24b4['query']=_['keys'](_0x5d3f67[_0x94cf('0x3e')]);_0x3a24b4[_0x94cf('0x40')]=_['intersection'](_0x3a24b4[_0x94cf('0x3c')],_0x3a24b4['query']);_0x178ee0[_0x94cf('0x42')]=_[_0x94cf('0x41')](_0x3a24b4[_0x94cf('0x3c')],qs['fields'](_0x5d3f67[_0x94cf('0x3e')][_0x94cf('0x43')]));_0x178ee0['attributes']=_0x178ee0[_0x94cf('0x42')][_0x94cf('0x44')]?_0x178ee0[_0x94cf('0x42')]:_0x3a24b4[_0x94cf('0x3c')];_0x178ee0[_0x94cf('0x58')]=qs[_0x94cf('0x46')](_0x5d3f67['query'][_0x94cf('0x46')]);_0x178ee0[_0x94cf('0x49')]=qs[_0x94cf('0x40')](_[_0x94cf('0x47')](_0x5d3f67[_0x94cf('0x3e')],_0x3a24b4[_0x94cf('0x40')]));if(_0x5d3f67['query'][_0x94cf('0x48')]){_0x178ee0['where']=_[_0x94cf('0x4b')](_0x178ee0['where'],{'$or':_['map'](_0x178ee0['attributes'],function(_0x398b32){var _0x556c16={};_0x556c16[_0x398b32]={'$like':'%'+_0x5d3f67[_0x94cf('0x3e')][_0x94cf('0x48')]+'%'};return _0x556c16;})});}_0x178ee0=_['merge']({},_0x178ee0,_0x5d3f67['options']);return _0x5dc954[_0x94cf('0x56')](_0x178ee0);}})['then'](function(_0x1a73b6){if(_0x1a73b6){_0xce03e2=_0x1a73b6['length'];if(!_0x5d3f67['query']['hasOwnProperty']('nolimit')){_0x178ee0[_0x94cf('0x2b')]=qs[_0x94cf('0x2b')](_0x5d3f67[_0x94cf('0x3e')][_0x94cf('0x2b')]);_0x178ee0[_0x94cf('0x2a')]=qs['offset'](_0x5d3f67[_0x94cf('0x3e')][_0x94cf('0x2a')]);}return _0x5dc954[_0x94cf('0x56')](_0x178ee0);}})[_0x94cf('0x32')](function(_0x3dcbe0){if(_0x3dcbe0){return _0x3dcbe0?{'count':_0xce03e2,'rows':_0x3dcbe0}:null;}})[_0x94cf('0x32')](respondWithResult(_0x57d93c,null))['catch'](handleError(_0x57d93c,null));};exports['addConfiguration']=function(_0x14b7e5,_0x1df3d0,_0x5aeb87){if(_0x14b7e5[_0x94cf('0x54')]['id']){delete _0x14b7e5[_0x94cf('0x54')]['id'];}return db['FreshdeskAccount'][_0x94cf('0x57')]({'where':{'id':_0x14b7e5['params']['id']}})[_0x94cf('0x32')](handleEntityNotFound(_0x1df3d0,null))[_0x94cf('0x32')](function(_0x403a73){if(_0x403a73){_0x14b7e5[_0x94cf('0x54')][_0x94cf('0x59')]=_0x403a73['id'];_0x14b7e5[_0x94cf('0x54')][_0x94cf('0x5a')]=integrations[_0x94cf('0x5b')](_0x14b7e5['body'][_0x94cf('0x5c')],_0x14b7e5['body'][_0x94cf('0x3a')]);_0x14b7e5['body']['Descriptions']=integrations[_0x94cf('0x5d')](_0x14b7e5[_0x94cf('0x54')][_0x94cf('0x5c')],_0x14b7e5[_0x94cf('0x54')][_0x94cf('0x3a')]);return db[_0x94cf('0x5e')][_0x94cf('0x53')](_0x14b7e5['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x94cf('0x5a')},{'model':db[_0x94cf('0x5f')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1df3d0,null))[_0x94cf('0x25')](handleError(_0x1df3d0,null));};exports['getFields']=function(_0x2db367,_0x1f82f9,_0x1cde8f){var _0x37feff='';return db[_0x94cf('0x37')][_0x94cf('0x57')]({'where':{'id':_0x2db367[_0x94cf('0x4f')]['id']},'attributes':['id',_0x94cf('0x60'),_0x94cf('0x61')]})['then'](handleEntityNotFound(_0x1f82f9,null))[_0x94cf('0x32')](function(_0x5eb9da){if(_0x5eb9da){_0x37feff=_0x5eb9da[_0x94cf('0x60')];var _0x326b7a=_0x37feff[_0x94cf('0x62')](-0x1);if(_0x326b7a==='/'){_0x37feff=_0x37feff['substring'](0x0,_0x37feff[_0x94cf('0x63')](_0x326b7a));}return rp({'method':_0x94cf('0x64'),'uri':util[_0x94cf('0x65')](_0x94cf('0x66'),_0x37feff,_0x94cf('0x67')),'headers':{'Authorization':util[_0x94cf('0x65')](_0x94cf('0x68'),new Buffer(util[_0x94cf('0x65')]('%s:X',_0x5eb9da['apiKey']))['toString'](_0x94cf('0x69')))},'json':!![]});}})[_0x94cf('0x32')](function(_0x209ae8){if(_0x209ae8){var _0x3ce0c=[_0x94cf('0x6a'),_0x94cf('0x6b'),'agent','description',_0x94cf('0x27'),'priority','group',_0x94cf('0x6c'),'ticket_type',_0x94cf('0x6d'),_0x94cf('0x6e')];_['remove'](_0x209ae8,function(_0x3dcb5d){return _0x3ce0c[_0x94cf('0x6f')](_0x3dcb5d[_0x94cf('0x3d')])||!_0x3dcb5d[_0x94cf('0x70')]&&_0x3dcb5d[_0x94cf('0x3a')]!==_0x94cf('0x71')&&_0x3dcb5d[_0x94cf('0x3a')]!==_0x94cf('0x72');});return{'count':_0x209ae8[_0x94cf('0x44')],'rows':_['map'](_0x209ae8,function(_0x55fb5d){return{'id':_0x55fb5d[_0x94cf('0x3d')],'name':_0x55fb5d[_0x94cf('0x73')],'custom':!_0x55fb5d['default'],'options':_0x55fb5d[_0x94cf('0x74')]?_[_0x94cf('0x36')](_0x55fb5d[_0x94cf('0x74')],function(_0x19ec42){return{'name':_[_0x94cf('0x75')](_0x19ec42),'value':_0x19ec42};}):[]};})};}})['then'](respondWithResult(_0x1f82f9,null))[_0x94cf('0x25')](function(_0xaa6fd1){var _0x5c1e1e=_0x2db367[_0x94cf('0x3e')][_0x94cf('0x76')]?0x1f4:_0xaa6fd1[_0x94cf('0x77')]||0x1f4;logger[_0x94cf('0x21')](_0x94cf('0x78'),_0x94cf('0x79'),_0x5c1e1e,JSON[_0x94cf('0x20')](_0xaa6fd1));delete _0xaa6fd1[_0x94cf('0x3d')];if(_0x5c1e1e===0x191){_0x5c1e1e=0x190;}_0x1f82f9[_0x94cf('0x27')](_0x5c1e1e)[_0x94cf('0x34')](_0x2db367['query'][_0x94cf('0x76')]?{'message':_0x94cf('0x7a'),'statusCode':_0xaa6fd1[_0x94cf('0x77')]}:_0xaa6fd1);});}; \ No newline at end of file +var _0x0974=['getConfigurations','findOne','params','FreshdeskConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','%s:X','toString','requester','subject','agent','description','priority','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','include','create','body','find'];(function(_0x51d803,_0xa6f10f){var _0x35cada=function(_0xdfeefd){while(--_0xdfeefd){_0x51d803['push'](_0x51d803['shift']());}};_0x35cada(++_0xa6f10f);}(_0x0974,0x12c));var _0x4097=function(_0x1e59ff,_0x1aaa85){_0x1e59ff=_0x1e59ff-0x0;var _0x491fed=_0x0974[_0x1e59ff];return _0x491fed;};'use strict';var pdf=require(_0x4097('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4097('0x1'));var zipdir=require(_0x4097('0x2'));var jsonpatch=require(_0x4097('0x3'));var rp=require(_0x4097('0x4'));var moment=require(_0x4097('0x5'));var BPromise=require(_0x4097('0x6'));var Mustache=require('mustache');var util=require(_0x4097('0x7'));var path=require(_0x4097('0x8'));var sox=require(_0x4097('0x9'));var csv=require(_0x4097('0xa'));var ejs=require(_0x4097('0xb'));var fs=require('fs');var _=require(_0x4097('0xc'));var squel=require(_0x4097('0xd'));var crypto=require(_0x4097('0xe'));var jsforce=require(_0x4097('0xf'));var deskjs=require(_0x4097('0x10'));var toCsv=require(_0x4097('0xa'));var querystring=require(_0x4097('0x11'));var Papa=require(_0x4097('0x12'));var Redis=require(_0x4097('0x13'));var authService=require(_0x4097('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4097('0x15'));var hardwareService=require(_0x4097('0x16'));var logger=require(_0x4097('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4097('0x18'))['db'];var integrations=require(_0x4097('0x19'));var jayson=require(_0x4097('0x1a'));var client=jayson[_0x4097('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x599894,_0x2530bc,_0x402495){if(_0x402495){var _0x187377=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x187377[_0x4097('0x1c')](_0x2530bc)){return _0x599894;}else{throw new db[(_0x4097('0x1d'))][(_0x4097('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x599894;}}function respondWithRpcPromise(_0x15e763,_0x3a4a7b,_0x530b57,_0x466a08){return new BPromise(function(_0x192650,_0x5c6c7c){var _0x3c2a53=_0x466a08||client;return _0x3c2a53[_0x4097('0x1f')](_0x15e763,_0x530b57)[_0x4097('0x20')](function(_0x3dddb7){logger[_0x4097('0x21')](_0x4097('0x22'),_0x3a4a7b,'request\x20sent');logger[_0x4097('0x23')](_0x4097('0x24'),_0x3a4a7b,_0x4097('0x25'),JSON['stringify'](_0x3dddb7));if(_0x3dddb7[_0x4097('0x26')]){if(_0x3dddb7[_0x4097('0x26')][_0x4097('0x27')]===0x1f4){logger[_0x4097('0x26')](_0x4097('0x22'),_0x3a4a7b,_0x3dddb7['error'][_0x4097('0x28')]);return _0x5c6c7c(_0x3dddb7['error']['message']);}logger[_0x4097('0x26')](_0x4097('0x22'),_0x3a4a7b,_0x3dddb7['error'][_0x4097('0x28')]);return _0x192650(_0x3dddb7[_0x4097('0x26')][_0x4097('0x28')]);}else{logger[_0x4097('0x21')](_0x4097('0x22'),_0x3a4a7b,_0x4097('0x25'));_0x192650(_0x3dddb7[_0x4097('0x29')]['message']);}})[_0x4097('0x2a')](function(_0x3a3f40){logger[_0x4097('0x26')]('FreshdeskAccount,\x20%s,\x20%s',_0x3a4a7b,_0x3a3f40);_0x5c6c7c(_0x3a3f40);});});}function respondWithStatusCode(_0x551644,_0x5479f1){_0x5479f1=_0x5479f1||0xcc;return function(_0x3516bf){if(_0x3516bf){return _0x551644[_0x4097('0x2b')](_0x5479f1);}return _0x551644[_0x4097('0x2c')](_0x5479f1)[_0x4097('0x2d')]();};}function respondWithResult(_0x44467e,_0x238c7c){_0x238c7c=_0x238c7c||0xc8;return function(_0x60c4a){if(_0x60c4a){return _0x44467e[_0x4097('0x2c')](_0x238c7c)[_0x4097('0x2e')](_0x60c4a);}};}function respondWithFilteredResult(_0x3c3031,_0x2af4c5){return function(_0x285170){if(_0x285170){var _0x1f300f=_0x285170[_0x4097('0x2f')],_0x788490=_0x2af4c5['offset'],_0x3cbedd=_0x2af4c5[_0x4097('0x30')]+_0x2af4c5[_0x4097('0x31')],_0x1b3a0e;if(_0x3cbedd>=_0x1f300f){_0x3cbedd=_0x1f300f;_0x1b3a0e=0xc8;}else{_0x1b3a0e=0xce;}_0x3c3031[_0x4097('0x2c')](_0x1b3a0e);return _0x3c3031['set'](_0x4097('0x32'),_0x788490+'-'+_0x3cbedd+'/'+_0x1f300f)[_0x4097('0x2e')](_0x285170);}return null;};}function patchUpdates(_0x1de9b6){return function(_0x4e2849){try{jsonpatch[_0x4097('0x33')](_0x4e2849,_0x1de9b6,!![]);}catch(_0x348442){return BPromise[_0x4097('0x34')](_0x348442);}return _0x4e2849[_0x4097('0x35')]();};}function saveUpdates(_0x143e57,_0x1718fb){return function(_0x15fe8e){if(_0x15fe8e){return _0x15fe8e[_0x4097('0x36')](_0x143e57)[_0x4097('0x20')](function(_0x277e27){return _0x277e27;});}return null;};}function removeEntity(_0xccb2b9,_0xff283e){return function(_0x413084){if(_0x413084){return _0x413084[_0x4097('0x37')]()['then'](function(){_0xccb2b9[_0x4097('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cad4c,_0x2db914){return function(_0x29b86f){if(!_0x29b86f){_0x4cad4c[_0x4097('0x2b')](0x194);}return _0x29b86f;};}function handleError(_0x38cd0f,_0x16879){_0x16879=_0x16879||0x1f4;return function(_0x6d86ba){logger['error'](_0x6d86ba[_0x4097('0x38')]);if(_0x6d86ba[_0x4097('0x39')]){delete _0x6d86ba[_0x4097('0x39')];}_0x38cd0f['status'](_0x16879)['send'](_0x6d86ba);};}exports[_0x4097('0x3a')]=function(_0x3abffe,_0x2d791a){var _0xa49e1b={},_0x1c73fd={},_0x23923b={'count':0x0,'rows':[]};var _0xc6ae07=_['map'](db[_0x4097('0x3b')][_0x4097('0x3c')],function(_0x14c3d4){return{'name':_0x14c3d4[_0x4097('0x3d')],'type':_0x14c3d4[_0x4097('0x3e')][_0x4097('0x3f')]};});_0x1c73fd[_0x4097('0x40')]=_[_0x4097('0x41')](_0xc6ae07,_0x4097('0x39'));_0x1c73fd[_0x4097('0x42')]=_[_0x4097('0x43')](_0x3abffe[_0x4097('0x42')]);_0x1c73fd[_0x4097('0x44')]=_[_0x4097('0x45')](_0x1c73fd['model'],_0x1c73fd[_0x4097('0x42')]);_0xa49e1b['attributes']=_[_0x4097('0x45')](_0x1c73fd[_0x4097('0x40')],qs[_0x4097('0x46')](_0x3abffe[_0x4097('0x42')][_0x4097('0x46')]));_0xa49e1b['attributes']=_0xa49e1b[_0x4097('0x47')][_0x4097('0x48')]?_0xa49e1b[_0x4097('0x47')]:_0x1c73fd[_0x4097('0x40')];if(!_0x3abffe[_0x4097('0x42')][_0x4097('0x49')](_0x4097('0x4a'))){_0xa49e1b[_0x4097('0x31')]=qs[_0x4097('0x31')](_0x3abffe[_0x4097('0x42')][_0x4097('0x31')]);_0xa49e1b[_0x4097('0x30')]=qs[_0x4097('0x30')](_0x3abffe['query'][_0x4097('0x30')]);}_0xa49e1b[_0x4097('0x4b')]=qs[_0x4097('0x4c')](_0x3abffe[_0x4097('0x42')][_0x4097('0x4c')]);_0xa49e1b[_0x4097('0x4d')]=qs[_0x4097('0x44')](_[_0x4097('0x4e')](_0x3abffe[_0x4097('0x42')],_0x1c73fd[_0x4097('0x44')]));if(_0x3abffe[_0x4097('0x42')]['filter']){_0xa49e1b[_0x4097('0x4d')]=_[_0x4097('0x4f')](_0xa49e1b[_0x4097('0x4d')],{'$or':_[_0x4097('0x41')](_0xc6ae07,function(_0x952634){if(_0x952634['type']!=='VIRTUAL'){var _0x3950cf={};_0x3950cf[_0x952634[_0x4097('0x39')]]={'$like':'%'+_0x3abffe['query'][_0x4097('0x50')]+'%'};return _0x3950cf;}})});}_0xa49e1b=_[_0x4097('0x4f')]({},_0xa49e1b,_0x3abffe[_0x4097('0x51')]);var _0x2892d3={'where':_0xa49e1b[_0x4097('0x4d')]};return db['FreshdeskAccount'][_0x4097('0x2f')](_0x2892d3)[_0x4097('0x20')](function(_0x1b3f65){_0x23923b[_0x4097('0x2f')]=_0x1b3f65;if(_0x3abffe['query'][_0x4097('0x52')]){_0xa49e1b['include']=[{'all':!![]}];}return db[_0x4097('0x3b')][_0x4097('0x53')](_0xa49e1b);})[_0x4097('0x20')](function(_0x42a6c9){_0x23923b[_0x4097('0x54')]=_0x42a6c9;return _0x23923b;})[_0x4097('0x20')](respondWithFilteredResult(_0x2d791a,_0xa49e1b))[_0x4097('0x2a')](handleError(_0x2d791a,null));};exports[_0x4097('0x55')]=function(_0x177a56,_0xd25bf0){var _0x39511d={'raw':![],'where':{'id':_0x177a56['params']['id']}},_0x376c8b={};_0x376c8b[_0x4097('0x40')]=_[_0x4097('0x43')](db[_0x4097('0x3b')][_0x4097('0x3c')]);_0x376c8b['query']=_[_0x4097('0x43')](_0x177a56[_0x4097('0x42')]);_0x376c8b[_0x4097('0x44')]=_[_0x4097('0x45')](_0x376c8b['model'],_0x376c8b[_0x4097('0x42')]);_0x39511d['attributes']=_['intersection'](_0x376c8b[_0x4097('0x40')],qs[_0x4097('0x46')](_0x177a56[_0x4097('0x42')][_0x4097('0x46')]));_0x39511d[_0x4097('0x47')]=_0x39511d[_0x4097('0x47')][_0x4097('0x48')]?_0x39511d[_0x4097('0x47')]:_0x376c8b[_0x4097('0x40')];if(_0x177a56[_0x4097('0x42')][_0x4097('0x52')]){_0x39511d[_0x4097('0x56')]=[{'all':!![]}];}_0x39511d=_[_0x4097('0x4f')]({},_0x39511d,_0x177a56[_0x4097('0x51')]);return db[_0x4097('0x3b')]['find'](_0x39511d)['then'](handleEntityNotFound(_0xd25bf0,null))[_0x4097('0x20')](respondWithResult(_0xd25bf0,null))['catch'](handleError(_0xd25bf0,null));};exports[_0x4097('0x57')]=function(_0x7d5824,_0x5b4a0c){return db['FreshdeskAccount'][_0x4097('0x57')](_0x7d5824[_0x4097('0x58')],{})[_0x4097('0x20')](respondWithResult(_0x5b4a0c,0xc9))[_0x4097('0x2a')](handleError(_0x5b4a0c,null));};exports[_0x4097('0x36')]=function(_0x42361a,_0x53ceb6){if(_0x42361a[_0x4097('0x58')]['id']){delete _0x42361a['body']['id'];}return db[_0x4097('0x3b')]['find']({'where':{'id':_0x42361a['params']['id']}})[_0x4097('0x20')](handleEntityNotFound(_0x53ceb6,null))[_0x4097('0x20')](saveUpdates(_0x42361a[_0x4097('0x58')],null))['then'](respondWithResult(_0x53ceb6,null))[_0x4097('0x2a')](handleError(_0x53ceb6,null));};exports[_0x4097('0x37')]=function(_0x223f9b,_0x4650b3){return db[_0x4097('0x3b')][_0x4097('0x59')]({'where':{'id':_0x223f9b['params']['id']}})[_0x4097('0x20')](handleEntityNotFound(_0x4650b3,null))[_0x4097('0x20')](removeEntity(_0x4650b3,null))['catch'](handleError(_0x4650b3,null));};exports[_0x4097('0x5a')]=function(_0x31a91e,_0x1e2619,_0x3b365d){var _0x2c1571={};var _0x5d4e32={};var _0x5001b5;var _0x958a32;return db[_0x4097('0x3b')][_0x4097('0x5b')]({'where':{'id':_0x31a91e[_0x4097('0x5c')]['id']}})[_0x4097('0x20')](handleEntityNotFound(_0x1e2619,null))[_0x4097('0x20')](function(_0x536d8b){if(_0x536d8b){_0x5001b5=_0x536d8b;_0x5d4e32['model']=_[_0x4097('0x43')](db[_0x4097('0x5d')][_0x4097('0x3c')]);_0x5d4e32[_0x4097('0x42')]=_[_0x4097('0x43')](_0x31a91e['query']);_0x5d4e32[_0x4097('0x44')]=_[_0x4097('0x45')](_0x5d4e32[_0x4097('0x40')],_0x5d4e32['query']);_0x2c1571[_0x4097('0x47')]=_['intersection'](_0x5d4e32['model'],qs[_0x4097('0x46')](_0x31a91e[_0x4097('0x42')][_0x4097('0x46')]));_0x2c1571[_0x4097('0x47')]=_0x2c1571['attributes'][_0x4097('0x48')]?_0x2c1571[_0x4097('0x47')]:_0x5d4e32[_0x4097('0x40')];_0x2c1571['order']=qs[_0x4097('0x4c')](_0x31a91e[_0x4097('0x42')]['sort']);_0x2c1571['where']=qs[_0x4097('0x44')](_['pick'](_0x31a91e['query'],_0x5d4e32['filters']));if(_0x31a91e[_0x4097('0x42')][_0x4097('0x50')]){_0x2c1571['where']=_[_0x4097('0x4f')](_0x2c1571['where'],{'$or':_[_0x4097('0x41')](_0x2c1571[_0x4097('0x47')],function(_0x2a9f1c){var _0x45c0ef={};_0x45c0ef[_0x2a9f1c]={'$like':'%'+_0x31a91e[_0x4097('0x42')][_0x4097('0x50')]+'%'};return _0x45c0ef;})});}_0x2c1571=_[_0x4097('0x4f')]({},_0x2c1571,_0x31a91e[_0x4097('0x51')]);return _0x5001b5['getConfigurations'](_0x2c1571);}})['then'](function(_0x47529b){if(_0x47529b){_0x958a32=_0x47529b['length'];if(!_0x31a91e[_0x4097('0x42')]['hasOwnProperty'](_0x4097('0x4a'))){_0x2c1571[_0x4097('0x31')]=qs[_0x4097('0x31')](_0x31a91e[_0x4097('0x42')]['limit']);_0x2c1571[_0x4097('0x30')]=qs['offset'](_0x31a91e[_0x4097('0x42')][_0x4097('0x30')]);}return _0x5001b5[_0x4097('0x5a')](_0x2c1571);}})['then'](function(_0x43646a){if(_0x43646a){return _0x43646a?{'count':_0x958a32,'rows':_0x43646a}:null;}})['then'](respondWithResult(_0x1e2619,null))['catch'](handleError(_0x1e2619,null));};exports['addConfiguration']=function(_0x33aed2,_0x899a4b,_0xf6760c){if(_0x33aed2[_0x4097('0x58')]['id']){delete _0x33aed2[_0x4097('0x58')]['id'];}return db[_0x4097('0x3b')][_0x4097('0x5b')]({'where':{'id':_0x33aed2[_0x4097('0x5c')]['id']}})[_0x4097('0x20')](handleEntityNotFound(_0x899a4b,null))[_0x4097('0x20')](function(_0x258a21){if(_0x258a21){_0x33aed2[_0x4097('0x58')][_0x4097('0x5e')]=_0x258a21['id'];_0x33aed2[_0x4097('0x58')][_0x4097('0x5f')]=integrations['getSubjects'](_0x33aed2[_0x4097('0x58')]['channel'],_0x33aed2['body'][_0x4097('0x3e')]);_0x33aed2[_0x4097('0x58')][_0x4097('0x60')]=integrations[_0x4097('0x61')](_0x33aed2[_0x4097('0x58')][_0x4097('0x62')],_0x33aed2[_0x4097('0x58')]['type']);return db['FreshdeskConfiguration'][_0x4097('0x57')](_0x33aed2[_0x4097('0x58')],{'include':[{'model':db[_0x4097('0x63')],'as':_0x4097('0x5f')},{'model':db[_0x4097('0x63')],'as':_0x4097('0x60')}]});}return null;})[_0x4097('0x20')](respondWithResult(_0x899a4b,null))[_0x4097('0x2a')](handleError(_0x899a4b,null));};exports['getFields']=function(_0x4d66ce,_0x42c299,_0x2ebce4){var _0x3e0ef8='';return db[_0x4097('0x3b')]['findOne']({'where':{'id':_0x4d66ce[_0x4097('0x5c')]['id']},'attributes':['id',_0x4097('0x64'),_0x4097('0x65')]})[_0x4097('0x20')](handleEntityNotFound(_0x42c299,null))[_0x4097('0x20')](function(_0x44f8d1){if(_0x44f8d1){_0x3e0ef8=_0x44f8d1[_0x4097('0x64')];var _0x2db716=_0x3e0ef8[_0x4097('0x66')](-0x1);if(_0x2db716==='/'){_0x3e0ef8=_0x3e0ef8[_0x4097('0x67')](0x0,_0x3e0ef8[_0x4097('0x68')](_0x2db716));}return rp({'method':'GET','uri':util[_0x4097('0x69')](_0x4097('0x6a'),_0x3e0ef8,'api/v2/ticket_fields'),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4097('0x69')](_0x4097('0x6b'),_0x44f8d1[_0x4097('0x65')]))[_0x4097('0x6c')]('base64'))},'json':!![]});}})[_0x4097('0x20')](function(_0x19e41e){if(_0x19e41e){var _0x42db51=[_0x4097('0x6d'),_0x4097('0x6e'),_0x4097('0x6f'),_0x4097('0x70'),_0x4097('0x2c'),_0x4097('0x71'),'group',_0x4097('0x72'),_0x4097('0x73'),'group','company'];_[_0x4097('0x74')](_0x19e41e,function(_0x6df30a){return _0x42db51[_0x4097('0x75')](_0x6df30a['name'])||!_0x6df30a[_0x4097('0x76')]&&_0x6df30a['type']!==_0x4097('0x77')&&_0x6df30a[_0x4097('0x3e')]!==_0x4097('0x78');});return{'count':_0x19e41e[_0x4097('0x48')],'rows':_['map'](_0x19e41e,function(_0x37e18b){return{'id':_0x37e18b['name'],'name':_0x37e18b[_0x4097('0x79')],'custom':!_0x37e18b[_0x4097('0x76')],'options':_0x37e18b['choices']?_[_0x4097('0x41')](_0x37e18b[_0x4097('0x7a')],function(_0x57ac3a){return{'name':_[_0x4097('0x7b')](_0x57ac3a),'value':_0x57ac3a};}):[]};})};}})[_0x4097('0x20')](respondWithResult(_0x42c299,null))['catch'](function(_0x4f9fc9){var _0xb4311e=_0x4d66ce[_0x4097('0x42')][_0x4097('0x1c')]?0x1f4:_0x4f9fc9[_0x4097('0x7c')]||0x1f4;logger[_0x4097('0x26')](_0x4097('0x7d'),_0x4097('0x7e'),_0xb4311e,JSON[_0x4097('0x7f')](_0x4f9fc9));delete _0x4f9fc9[_0x4097('0x39')];if(_0xb4311e===0x191){_0xb4311e=0x190;}_0x42c299[_0x4097('0x2c')](_0xb4311e)[_0x4097('0x80')](_0x4d66ce['query'][_0x4097('0x1c')]?{'message':_0x4097('0x81'),'statusCode':_0x4f9fc9[_0x4097('0x7c')]}:_0x4f9fc9);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5d97b1c..50f5c7e 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8472=['request-promise','path','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','bluebird'];(function(_0x1eaf82,_0x3ce6d9){var _0x47030b=function(_0x5166c0){while(--_0x5166c0){_0x1eaf82['push'](_0x1eaf82['shift']());}};_0x47030b(++_0x3ce6d9);}(_0x8472,0x1eb));var _0x2847=function(_0x1380d5,_0x55aec1){_0x1380d5=_0x1380d5-0x0;var _0x3fa1a5=_0x8472[_0x1380d5];return _0x3fa1a5;};'use strict';var _=require(_0x2847('0x0'));var util=require(_0x2847('0x1'));var logger=require('../../config/logger')(_0x2847('0x2'));var moment=require('moment');var BPromise=require(_0x2847('0x3'));var rp=require(_0x2847('0x4'));var fs=require('fs');var path=require(_0x2847('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x2847('0x6'));module[_0x2847('0x7')]=function(_0x5f4dc4,_0x4eff86){return _0x5f4dc4[_0x2847('0x8')](_0x2847('0x9'),attributes,{'tableName':_0x2847('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20c8=['moment','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api'];(function(_0x48aac1,_0x15fdf4){var _0x2bb936=function(_0x5757e2){while(--_0x5757e2){_0x48aac1['push'](_0x48aac1['shift']());}};_0x2bb936(++_0x15fdf4);}(_0x20c8,0xfa));var _0x820c=function(_0x16c695,_0x3cc950){_0x16c695=_0x16c695-0x0;var _0x2af787=_0x20c8[_0x16c695];return _0x2af787;};'use strict';var _=require(_0x820c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x820c('0x1'));var moment=require(_0x820c('0x2'));var BPromise=require('bluebird');var rp=require(_0x820c('0x3'));var fs=require('fs');var path=require(_0x820c('0x4'));var rimraf=require('rimraf');var config=require(_0x820c('0x5'));var attributes=require(_0x820c('0x6'));var integrations=require(_0x820c('0x7'));module[_0x820c('0x8')]=function(_0x2ad2cc,_0x531c63){return _0x2ad2cc[_0x820c('0x9')](_0x820c('0xa'),attributes,{'tableName':_0x820c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 516598e..9b0f7b4 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cb8=['../../config/logger','rpc','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','include','map','model','info','debug','catch','ShowFreshdeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5033b6,_0xf6f3c){var _0x4aea21=function(_0x680b92){while(--_0x680b92){_0x5033b6['push'](_0x5033b6['shift']());}};_0x4aea21(++_0xf6f3c);}(_0x3cb8,0x119));var _0x83cb=function(_0x2e32da,_0x678239){_0x2e32da=_0x2e32da-0x0;var _0x26c212=_0x3cb8[_0x2e32da];return _0x26c212;};'use strict';var _=require(_0x83cb('0x0'));var util=require(_0x83cb('0x1'));var moment=require(_0x83cb('0x2'));var BPromise=require('bluebird');var rs=require(_0x83cb('0x3'));var fs=require('fs');var Redis=require(_0x83cb('0x4'));var db=require(_0x83cb('0x5'))['db'];var utils=require(_0x83cb('0x6'));var logger=require(_0x83cb('0x7'))(_0x83cb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10ca5b,_0x6d023b,_0x444e92){return new BPromise(function(_0xbe2ee6,_0x2eb5c1){return client[_0x83cb('0x9')](_0x10ca5b,_0x444e92)[_0x83cb('0xa')](function(_0x21ad37){logger['info'](_0x83cb('0xb'),_0x6d023b,_0x83cb('0xc'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x6d023b,_0x83cb('0xc'),JSON[_0x83cb('0xd')](_0x21ad37));if(_0x21ad37[_0x83cb('0xe')]){if(_0x21ad37[_0x83cb('0xe')][_0x83cb('0xf')]===0x1f4){logger[_0x83cb('0xe')](_0x83cb('0xb'),_0x6d023b,_0x21ad37[_0x83cb('0xe')][_0x83cb('0x10')]);return _0x2eb5c1(_0x21ad37[_0x83cb('0xe')][_0x83cb('0x10')]);}logger['error'](_0x83cb('0xb'),_0x6d023b,_0x21ad37[_0x83cb('0xe')][_0x83cb('0x10')]);return _0xbe2ee6(_0x21ad37['error']['message']);}else{logger['info'](_0x83cb('0xb'),_0x6d023b,_0x83cb('0xc'));_0xbe2ee6(_0x21ad37[_0x83cb('0x11')][_0x83cb('0x10')]);}})['catch'](function(_0x4a1e91){logger[_0x83cb('0xe')](_0x83cb('0xb'),_0x6d023b,_0x4a1e91);_0x2eb5c1(_0x4a1e91);});});}exports[_0x83cb('0x12')]=function(_0x18224c){var _0x2902e4=this;return new Promise(function(_0x17a5a8,_0x67267){return db[_0x83cb('0x13')][_0x83cb('0x14')]({'raw':_0x18224c['options']?_0x18224c[_0x83cb('0x15')][_0x83cb('0x16')]===undefined?!![]:![]:!![],'where':_0x18224c[_0x83cb('0x15')]?_0x18224c[_0x83cb('0x15')]['where']||null:null,'attributes':_0x18224c[_0x83cb('0x15')]?_0x18224c[_0x83cb('0x15')][_0x83cb('0x17')]||null:null,'limit':_0x18224c[_0x83cb('0x15')]?_0x18224c['options']['limit']||null:null,'include':_0x18224c[_0x83cb('0x15')]?_0x18224c[_0x83cb('0x15')][_0x83cb('0x18')]?_[_0x83cb('0x19')](_0x18224c['options'][_0x83cb('0x18')],function(_0x5e502a){return{'model':db[_0x5e502a[_0x83cb('0x1a')]],'as':_0x5e502a['as'],'attributes':_0x5e502a[_0x83cb('0x17')],'include':_0x5e502a[_0x83cb('0x18')]?_[_0x83cb('0x19')](_0x5e502a[_0x83cb('0x18')],function(_0x113aeb){return{'model':db[_0x113aeb['model']],'as':_0x113aeb['as'],'attributes':_0x113aeb['attributes'],'include':_0x113aeb[_0x83cb('0x18')]?_[_0x83cb('0x19')](_0x113aeb[_0x83cb('0x18')],function(_0x2a885a){return{'model':db[_0x2a885a['model']],'as':_0x2a885a['as'],'attributes':_0x2a885a[_0x83cb('0x17')]};}):[]};}):[]};}):[]:[]})[_0x83cb('0xa')](function(_0x1a7c01){logger[_0x83cb('0x1b')]('GetFreshdeskAccount',_0x18224c);logger[_0x83cb('0x1c')](_0x83cb('0x12'),_0x18224c,JSON['stringify'](_0x1a7c01));_0x17a5a8(_0x1a7c01);})[_0x83cb('0x1d')](function(_0x297995){logger[_0x83cb('0xe')](_0x83cb('0x12'),_0x297995['message'],_0x18224c);_0x67267(_0x2902e4[_0x83cb('0xe')](0x1f4,_0x297995[_0x83cb('0x10')]));});});};exports[_0x83cb('0x1e')]=function(_0xe5d821){var _0x412f69=this;return new Promise(function(_0x10aa73,_0x321721){return db[_0x83cb('0x13')][_0x83cb('0x1f')]({'raw':_0xe5d821[_0x83cb('0x15')]?_0xe5d821['options'][_0x83cb('0x16')]===undefined?!![]:![]:!![],'where':_0xe5d821['options']?_0xe5d821[_0x83cb('0x15')]['where']||null:null,'attributes':_0xe5d821[_0x83cb('0x15')]?_0xe5d821[_0x83cb('0x15')][_0x83cb('0x17')]||null:null,'include':_0xe5d821[_0x83cb('0x15')]?_0xe5d821[_0x83cb('0x15')][_0x83cb('0x18')]?_['map'](_0xe5d821[_0x83cb('0x15')][_0x83cb('0x18')],function(_0x520e63){return{'model':db[_0x520e63['model']],'as':_0x520e63['as'],'attributes':_0x520e63['attributes'],'include':_0x520e63[_0x83cb('0x18')]?_[_0x83cb('0x19')](_0x520e63['include'],function(_0x22e777){return{'model':db[_0x22e777[_0x83cb('0x1a')]],'as':_0x22e777['as'],'attributes':_0x22e777[_0x83cb('0x17')],'include':_0x22e777[_0x83cb('0x18')]?_['map'](_0x22e777[_0x83cb('0x18')],function(_0x23c181){return{'model':db[_0x23c181[_0x83cb('0x1a')]],'as':_0x23c181['as'],'attributes':_0x23c181[_0x83cb('0x17')]};}):[]};}):[]};}):[]:[]})[_0x83cb('0xa')](function(_0xa7b88c){logger[_0x83cb('0x1b')]('ShowFreshdeskAccount',_0xe5d821);logger['debug']('ShowFreshdeskAccount',_0xe5d821,JSON[_0x83cb('0xd')](_0xa7b88c));_0x10aa73(_0xa7b88c);})[_0x83cb('0x1d')](function(_0x38175f){logger[_0x83cb('0xe')](_0x83cb('0x1e'),_0x38175f[_0x83cb('0x10')],_0xe5d821);_0x321721(_0x412f69['error'](0x1f4,_0x38175f['message']));});});}; \ No newline at end of file +var _0xf826=['model','then','catch','ShowFreshdeskAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFreshdeskAccount','options','raw','where','attributes','limit','include','map'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0xf826,0x1bf));var _0x6f82=function(_0x2589ee,_0x2381bc){_0x2589ee=_0x2589ee-0x0;var _0x162995=_0xf826[_0x2589ee];return _0x162995;};'use strict';var _=require('lodash');var util=require(_0x6f82('0x0'));var moment=require(_0x6f82('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f82('0x2'));var fs=require('fs');var Redis=require(_0x6f82('0x3'));var db=require(_0x6f82('0x4'))['db'];var utils=require(_0x6f82('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6f82('0x6'));var jayson=require(_0x6f82('0x7'));var client=jayson[_0x6f82('0x8')][_0x6f82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x368276,_0x2d8fbc,_0x3ee4f2){return new BPromise(function(_0x1252ea,_0x2a8382){return client[_0x6f82('0xa')](_0x368276,_0x3ee4f2)['then'](function(_0x5e8dcc){logger['info'](_0x6f82('0xb'),_0x2d8fbc,_0x6f82('0xc'));logger[_0x6f82('0xd')](_0x6f82('0xe'),_0x2d8fbc,'request\x20sent',JSON[_0x6f82('0xf')](_0x5e8dcc));if(_0x5e8dcc[_0x6f82('0x10')]){if(_0x5e8dcc[_0x6f82('0x10')][_0x6f82('0x11')]===0x1f4){logger[_0x6f82('0x10')](_0x6f82('0xb'),_0x2d8fbc,_0x5e8dcc[_0x6f82('0x10')][_0x6f82('0x12')]);return _0x2a8382(_0x5e8dcc['error'][_0x6f82('0x12')]);}logger[_0x6f82('0x10')](_0x6f82('0xb'),_0x2d8fbc,_0x5e8dcc[_0x6f82('0x10')][_0x6f82('0x12')]);return _0x1252ea(_0x5e8dcc[_0x6f82('0x10')][_0x6f82('0x12')]);}else{logger[_0x6f82('0x13')](_0x6f82('0xb'),_0x2d8fbc,_0x6f82('0xc'));_0x1252ea(_0x5e8dcc[_0x6f82('0x14')]['message']);}})['catch'](function(_0x475b42){logger[_0x6f82('0x10')](_0x6f82('0xb'),_0x2d8fbc,_0x475b42);_0x2a8382(_0x475b42);});});}exports[_0x6f82('0x15')]=function(_0x517b94){var _0x241c94=this;return new Promise(function(_0x437377,_0xc5969c){return db['FreshdeskAccount']['findAll']({'raw':_0x517b94['options']?_0x517b94[_0x6f82('0x16')][_0x6f82('0x17')]===undefined?!![]:![]:!![],'where':_0x517b94[_0x6f82('0x16')]?_0x517b94[_0x6f82('0x16')][_0x6f82('0x18')]||null:null,'attributes':_0x517b94['options']?_0x517b94[_0x6f82('0x16')][_0x6f82('0x19')]||null:null,'limit':_0x517b94['options']?_0x517b94[_0x6f82('0x16')][_0x6f82('0x1a')]||null:null,'include':_0x517b94['options']?_0x517b94[_0x6f82('0x16')][_0x6f82('0x1b')]?_[_0x6f82('0x1c')](_0x517b94[_0x6f82('0x16')]['include'],function(_0x535b70){return{'model':db[_0x535b70['model']],'as':_0x535b70['as'],'attributes':_0x535b70[_0x6f82('0x19')],'include':_0x535b70[_0x6f82('0x1b')]?_[_0x6f82('0x1c')](_0x535b70[_0x6f82('0x1b')],function(_0xd13623){return{'model':db[_0xd13623[_0x6f82('0x1d')]],'as':_0xd13623['as'],'attributes':_0xd13623[_0x6f82('0x19')],'include':_0xd13623[_0x6f82('0x1b')]?_[_0x6f82('0x1c')](_0xd13623['include'],function(_0x503df0){return{'model':db[_0x503df0[_0x6f82('0x1d')]],'as':_0x503df0['as'],'attributes':_0x503df0[_0x6f82('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6f82('0x1e')](function(_0x49f7ad){logger[_0x6f82('0x13')](_0x6f82('0x15'),_0x517b94);logger[_0x6f82('0xd')](_0x6f82('0x15'),_0x517b94,JSON[_0x6f82('0xf')](_0x49f7ad));_0x437377(_0x49f7ad);})[_0x6f82('0x1f')](function(_0x575979){logger['error']('GetFreshdeskAccount',_0x575979[_0x6f82('0x12')],_0x517b94);_0xc5969c(_0x241c94[_0x6f82('0x10')](0x1f4,_0x575979[_0x6f82('0x12')]));});});};exports[_0x6f82('0x20')]=function(_0x2c131f){var _0x2996bd=this;return new Promise(function(_0x36cd99,_0x5f3317){return db['FreshdeskAccount'][_0x6f82('0x21')]({'raw':_0x2c131f[_0x6f82('0x16')]?_0x2c131f[_0x6f82('0x16')][_0x6f82('0x17')]===undefined?!![]:![]:!![],'where':_0x2c131f['options']?_0x2c131f['options']['where']||null:null,'attributes':_0x2c131f[_0x6f82('0x16')]?_0x2c131f[_0x6f82('0x16')][_0x6f82('0x19')]||null:null,'include':_0x2c131f['options']?_0x2c131f['options']['include']?_[_0x6f82('0x1c')](_0x2c131f[_0x6f82('0x16')][_0x6f82('0x1b')],function(_0x46d481){return{'model':db[_0x46d481[_0x6f82('0x1d')]],'as':_0x46d481['as'],'attributes':_0x46d481[_0x6f82('0x19')],'include':_0x46d481[_0x6f82('0x1b')]?_['map'](_0x46d481[_0x6f82('0x1b')],function(_0x32ba16){return{'model':db[_0x32ba16[_0x6f82('0x1d')]],'as':_0x32ba16['as'],'attributes':_0x32ba16[_0x6f82('0x19')],'include':_0x32ba16[_0x6f82('0x1b')]?_['map'](_0x32ba16['include'],function(_0x33d574){return{'model':db[_0x33d574[_0x6f82('0x1d')]],'as':_0x33d574['as'],'attributes':_0x33d574[_0x6f82('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6f82('0x1e')](function(_0xe5fa91){logger[_0x6f82('0x13')](_0x6f82('0x20'),_0x2c131f);logger[_0x6f82('0xd')](_0x6f82('0x20'),_0x2c131f,JSON[_0x6f82('0xf')](_0xe5fa91));_0x36cd99(_0xe5fa91);})[_0x6f82('0x1f')](function(_0x51d322){logger[_0x6f82('0x10')]('ShowFreshdeskAccount',_0x51d322[_0x6f82('0x12')],_0x2c131f);_0x5f3317(_0x2996bd['error'](0x1f4,_0x51d322[_0x6f82('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 99563bb..fc01ee3 100644 --- a/server/api/intFreshdeskConfiguration/index.js +++ b/server/api/intFreshdeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9e0=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields'];(function(_0x3e2bcf,_0x2524d7){var _0x50a246=function(_0x52a353){while(--_0x52a353){_0x3e2bcf['push'](_0x3e2bcf['shift']());}};_0x50a246(++_0x2524d7);}(_0xb9e0,0x1d7));var _0x0b9e=function(_0x5b8875,_0x14b543){_0x5b8875=_0x5b8875-0x0;var _0x45bc19=_0xb9e0[_0x5b8875];return _0x45bc19;};'use strict';var multer=require('multer');var util=require(_0x0b9e('0x0'));var path=require('path');var timeout=require(_0x0b9e('0x1'));var express=require(_0x0b9e('0x2'));var router=express['Router']();var auth=require(_0x0b9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0b9e('0x4'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x0b9e('0x5')](),controller[_0x0b9e('0x6')]);router[_0x0b9e('0x7')](_0x0b9e('0x8'),auth[_0x0b9e('0x5')](),controller[_0x0b9e('0x9')]);router['get'](_0x0b9e('0xa'),auth[_0x0b9e('0x5')](),controller[_0x0b9e('0xb')]);router[_0x0b9e('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x0b9e('0xc')]);router[_0x0b9e('0x7')](_0x0b9e('0xd'),auth['isAuthenticated'](),controller[_0x0b9e('0xe')]);router[_0x0b9e('0x7')](_0x0b9e('0xf'),auth[_0x0b9e('0x5')](),controller['getTags']);router[_0x0b9e('0x10')]('/',auth[_0x0b9e('0x5')](),controller[_0x0b9e('0x11')]);router[_0x0b9e('0x10')](_0x0b9e('0xf'),auth[_0x0b9e('0x5')](),controller[_0x0b9e('0x12')]);router[_0x0b9e('0x13')](_0x0b9e('0x8'),auth[_0x0b9e('0x5')](),controller[_0x0b9e('0x14')]);router['delete'](_0x0b9e('0x8'),auth[_0x0b9e('0x5')](),controller[_0x0b9e('0x15')]);module[_0x0b9e('0x16')]=router; \ No newline at end of file +var _0x7918=['exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','/:id','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update'];(function(_0x933c80,_0x239c89){var _0x4163ed=function(_0x33ef67){while(--_0x33ef67){_0x933c80['push'](_0x933c80['shift']());}};_0x4163ed(++_0x239c89);}(_0x7918,0x109));var _0x8791=function(_0x5d7d8c,_0x7b0e77){_0x5d7d8c=_0x5d7d8c-0x0;var _0x487191=_0x7918[_0x5d7d8c];return _0x487191;};'use strict';var multer=require('multer');var util=require(_0x8791('0x0'));var path=require(_0x8791('0x1'));var timeout=require(_0x8791('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8791('0x3'));var config=require(_0x8791('0x4'));var controller=require(_0x8791('0x5'));router['get']('/',auth[_0x8791('0x6')](),controller['index']);router['get'](_0x8791('0x7'),auth[_0x8791('0x6')](),controller['show']);router[_0x8791('0x8')](_0x8791('0x9'),auth['isAuthenticated'](),controller[_0x8791('0xa')]);router[_0x8791('0x8')](_0x8791('0xb'),auth['isAuthenticated'](),controller[_0x8791('0xc')]);router[_0x8791('0x8')](_0x8791('0xd'),auth[_0x8791('0x6')](),controller[_0x8791('0xe')]);router[_0x8791('0x8')](_0x8791('0xf'),auth[_0x8791('0x6')](),controller[_0x8791('0x10')]);router[_0x8791('0x11')]('/',auth[_0x8791('0x6')](),controller['create']);router['post']('/:id/tags',auth[_0x8791('0x6')](),controller[_0x8791('0x12')]);router[_0x8791('0x13')](_0x8791('0x7'),auth[_0x8791('0x6')](),controller[_0x8791('0x14')]);router['delete'](_0x8791('0x7'),auth[_0x8791('0x6')](),controller['destroy']);module[_0x8791('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0a35b91..63324fa 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64ff=['sequelize','STRING'];(function(_0x56b718,_0x1043a5){var _0x5403af=function(_0x12329a){while(--_0x12329a){_0x56b718['push'](_0x56b718['shift']());}};_0x5403af(++_0x1043a5);}(_0x64ff,0x1ee));var _0xf64f=function(_0x3512d6,_0x1302f1){_0x3512d6=_0x3512d6-0x0;var _0x2fa026=_0x64ff[_0x3512d6];return _0x2fa026;};'use strict';var Sequelize=require(_0xf64f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf64f('0x1')]},'description':{'type':Sequelize[_0xf64f('0x1')]}}; \ No newline at end of file +var _0x9a91=['STRING','sequelize','exports'];(function(_0xa8369a,_0x3d2319){var _0x4b74b7=function(_0x11d138){while(--_0x11d138){_0xa8369a['push'](_0xa8369a['shift']());}};_0x4b74b7(++_0x3d2319);}(_0x9a91,0x115));var _0x19a9=function(_0x394437,_0x39a041){_0x394437=_0x394437-0x0;var _0x28cefb=_0x9a91[_0x394437];return _0x28cefb;};'use strict';var Sequelize=require(_0x19a9('0x0'));module[_0x19a9('0x1')]={'name':{'type':Sequelize[_0x19a9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 04916c5..e2e733d 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cad=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','index','map','FreshdeskConfiguration','fieldName','type','key','query','keys','filters','model'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x4cad,0x1a9));var _0xd4ca=function(_0x20493f,_0x604cf1){_0x20493f=_0x20493f-0x0;var _0x17ba48=_0x4cad[_0x20493f];return _0x17ba48;};'use strict';var pdf=require(_0xd4ca('0x0'));var emlformat=require(_0xd4ca('0x1'));var rimraf=require(_0xd4ca('0x2'));var zipdir=require(_0xd4ca('0x3'));var jsonpatch=require(_0xd4ca('0x4'));var rp=require(_0xd4ca('0x5'));var moment=require(_0xd4ca('0x6'));var BPromise=require(_0xd4ca('0x7'));var Mustache=require(_0xd4ca('0x8'));var util=require(_0xd4ca('0x9'));var path=require(_0xd4ca('0xa'));var sox=require(_0xd4ca('0xb'));var csv=require(_0xd4ca('0xc'));var ejs=require(_0xd4ca('0xd'));var fs=require('fs');var _=require(_0xd4ca('0xe'));var squel=require(_0xd4ca('0xf'));var crypto=require(_0xd4ca('0x10'));var jsforce=require(_0xd4ca('0x11'));var deskjs=require(_0xd4ca('0x12'));var toCsv=require('to-csv');var querystring=require(_0xd4ca('0x13'));var Papa=require(_0xd4ca('0x14'));var Redis=require(_0xd4ca('0x15'));var authService=require(_0xd4ca('0x16'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4ca('0x17'));var logger=require('../../config/logger')(_0xd4ca('0x18'));var utils=require(_0xd4ca('0x19'));var config=require(_0xd4ca('0x1a'));var db=require(_0xd4ca('0x1b'))['db'];var jayson=require(_0xd4ca('0x1c'));var client=jayson[_0xd4ca('0x1d')][_0xd4ca('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x51987e,_0x421746,_0x3b4ec8){if(_0x3b4ec8){var _0x1711b7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1711b7[_0xd4ca('0x1f')](_0x421746)){return _0x51987e;}else{throw new db[(_0xd4ca('0x20'))][(_0xd4ca('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x51987e;}}function respondWithRpcPromise(_0x293a0f,_0x18b9aa,_0x5b308f,_0x41fe2a){return new BPromise(function(_0x1d25e3,_0x2833da){var _0x51798d=_0x41fe2a||client;return _0x51798d[_0xd4ca('0x22')](_0x293a0f,_0x5b308f)['then'](function(_0x1ad0b0){logger[_0xd4ca('0x23')](_0xd4ca('0x24'),_0x18b9aa,'request\x20sent');logger['debug'](_0xd4ca('0x25'),_0x18b9aa,_0xd4ca('0x26'),JSON[_0xd4ca('0x27')](_0x1ad0b0));if(_0x1ad0b0['error']){if(_0x1ad0b0['error']['code']===0x1f4){logger[_0xd4ca('0x28')](_0xd4ca('0x24'),_0x18b9aa,_0x1ad0b0[_0xd4ca('0x28')]['message']);return _0x2833da(_0x1ad0b0[_0xd4ca('0x28')][_0xd4ca('0x29')]);}logger[_0xd4ca('0x28')](_0xd4ca('0x24'),_0x18b9aa,_0x1ad0b0['error'][_0xd4ca('0x29')]);return _0x1d25e3(_0x1ad0b0[_0xd4ca('0x28')][_0xd4ca('0x29')]);}else{logger[_0xd4ca('0x23')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x18b9aa,_0xd4ca('0x26'));_0x1d25e3(_0x1ad0b0['result'][_0xd4ca('0x29')]);}})[_0xd4ca('0x2a')](function(_0x51aeed){logger[_0xd4ca('0x28')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x18b9aa,_0x51aeed);_0x2833da(_0x51aeed);});});}function respondWithStatusCode(_0x12e1b5,_0x80daf5){_0x80daf5=_0x80daf5||0xcc;return function(_0x5d9eee){if(_0x5d9eee){return _0x12e1b5[_0xd4ca('0x2b')](_0x80daf5);}return _0x12e1b5[_0xd4ca('0x2c')](_0x80daf5)['end']();};}function respondWithResult(_0x5e5ae4,_0x1e8228){_0x1e8228=_0x1e8228||0xc8;return function(_0x5ec6ed){if(_0x5ec6ed){return _0x5e5ae4[_0xd4ca('0x2c')](_0x1e8228)['json'](_0x5ec6ed);}};}function respondWithFilteredResult(_0x4d5aa9,_0x2d3033){return function(_0x3b6767){if(_0x3b6767){var _0x4ec4f7=_0x3b6767['count'],_0x39ffb0=_0x2d3033[_0xd4ca('0x2d')],_0x10fa83=_0x2d3033['offset']+_0x2d3033[_0xd4ca('0x2e')],_0x257fdd;if(_0x10fa83>=_0x4ec4f7){_0x10fa83=_0x4ec4f7;_0x257fdd=0xc8;}else{_0x257fdd=0xce;}_0x4d5aa9[_0xd4ca('0x2c')](_0x257fdd);return _0x4d5aa9[_0xd4ca('0x2f')](_0xd4ca('0x30'),_0x39ffb0+'-'+_0x10fa83+'/'+_0x4ec4f7)['json'](_0x3b6767);}return null;};}function patchUpdates(_0x4b2460){return function(_0x51de54){try{jsonpatch[_0xd4ca('0x31')](_0x51de54,_0x4b2460,!![]);}catch(_0x2c9f18){return BPromise['reject'](_0x2c9f18);}return _0x51de54['save']();};}function saveUpdates(_0x589fb0,_0x193d55){return function(_0x12b7d6){if(_0x12b7d6){return _0x12b7d6[_0xd4ca('0x32')](_0x589fb0)[_0xd4ca('0x33')](function(_0x39e27c){return _0x39e27c;});}return null;};}function removeEntity(_0x25dae9,_0x119c0c){return function(_0x47de63){if(_0x47de63){return _0x47de63[_0xd4ca('0x34')]()[_0xd4ca('0x33')](function(){_0x25dae9[_0xd4ca('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e335,_0x427a86){return function(_0x11768d){if(!_0x11768d){_0x28e335[_0xd4ca('0x2b')](0x194);}return _0x11768d;};}function handleError(_0x347c6b,_0x4d911d){_0x4d911d=_0x4d911d||0x1f4;return function(_0xf88a8e){logger['error'](_0xf88a8e[_0xd4ca('0x35')]);if(_0xf88a8e['name']){delete _0xf88a8e[_0xd4ca('0x36')];}_0x347c6b[_0xd4ca('0x2c')](_0x4d911d)['send'](_0xf88a8e);};}exports[_0xd4ca('0x37')]=function(_0x340a09,_0x567b9f){var _0x22125b={},_0x702663={},_0x40163b={'count':0x0,'rows':[]};var _0xf64475=_[_0xd4ca('0x38')](db[_0xd4ca('0x39')]['rawAttributes'],function(_0x219e9b){return{'name':_0x219e9b[_0xd4ca('0x3a')],'type':_0x219e9b[_0xd4ca('0x3b')][_0xd4ca('0x3c')]};});_0x702663['model']=_[_0xd4ca('0x38')](_0xf64475,'name');_0x702663[_0xd4ca('0x3d')]=_[_0xd4ca('0x3e')](_0x340a09[_0xd4ca('0x3d')]);_0x702663[_0xd4ca('0x3f')]=_['intersection'](_0x702663[_0xd4ca('0x40')],_0x702663[_0xd4ca('0x3d')]);_0x22125b['attributes']=_[_0xd4ca('0x41')](_0x702663[_0xd4ca('0x40')],qs[_0xd4ca('0x42')](_0x340a09['query'][_0xd4ca('0x42')]));_0x22125b['attributes']=_0x22125b[_0xd4ca('0x43')][_0xd4ca('0x44')]?_0x22125b['attributes']:_0x702663[_0xd4ca('0x40')];if(!_0x340a09['query'][_0xd4ca('0x45')](_0xd4ca('0x46'))){_0x22125b[_0xd4ca('0x2e')]=qs[_0xd4ca('0x2e')](_0x340a09[_0xd4ca('0x3d')]['limit']);_0x22125b[_0xd4ca('0x2d')]=qs[_0xd4ca('0x2d')](_0x340a09[_0xd4ca('0x3d')][_0xd4ca('0x2d')]);}_0x22125b[_0xd4ca('0x47')]=qs[_0xd4ca('0x48')](_0x340a09[_0xd4ca('0x3d')]['sort']);_0x22125b[_0xd4ca('0x49')]=qs[_0xd4ca('0x3f')](_[_0xd4ca('0x4a')](_0x340a09[_0xd4ca('0x3d')],_0x702663[_0xd4ca('0x3f')]));if(_0x340a09[_0xd4ca('0x3d')][_0xd4ca('0x4b')]){_0x22125b[_0xd4ca('0x49')]=_[_0xd4ca('0x4c')](_0x22125b['where'],{'$or':_['map'](_0xf64475,function(_0xba72bb){if(_0xba72bb[_0xd4ca('0x3b')]!==_0xd4ca('0x4d')){var _0x347900={};_0x347900[_0xba72bb['name']]={'$like':'%'+_0x340a09['query'][_0xd4ca('0x4b')]+'%'};return _0x347900;}})});}_0x22125b=_['merge']({},_0x22125b,_0x340a09[_0xd4ca('0x4e')]);var _0x375f60={'where':_0x22125b['where']};return db[_0xd4ca('0x39')]['count'](_0x375f60)[_0xd4ca('0x33')](function(_0x290b60){_0x40163b[_0xd4ca('0x4f')]=_0x290b60;if(_0x340a09['query'][_0xd4ca('0x50')]){_0x22125b[_0xd4ca('0x51')]=[{'all':!![]}];}return db[_0xd4ca('0x39')][_0xd4ca('0x52')](_0x22125b);})[_0xd4ca('0x33')](function(_0x3c9afb){_0x40163b[_0xd4ca('0x53')]=_0x3c9afb;return _0x40163b;})['then'](respondWithFilteredResult(_0x567b9f,_0x22125b))['catch'](handleError(_0x567b9f,null));};exports[_0xd4ca('0x54')]=function(_0x5a3eff,_0x21b07f){var _0x3089b0={'raw':![],'where':{'id':_0x5a3eff['params']['id']}},_0x43464c={};_0x43464c[_0xd4ca('0x40')]=_['keys'](db[_0xd4ca('0x39')][_0xd4ca('0x55')]);_0x43464c['query']=_[_0xd4ca('0x3e')](_0x5a3eff[_0xd4ca('0x3d')]);_0x43464c[_0xd4ca('0x3f')]=_['intersection'](_0x43464c[_0xd4ca('0x40')],_0x43464c[_0xd4ca('0x3d')]);_0x3089b0[_0xd4ca('0x43')]=_['intersection'](_0x43464c['model'],qs['fields'](_0x5a3eff[_0xd4ca('0x3d')][_0xd4ca('0x42')]));_0x3089b0[_0xd4ca('0x43')]=_0x3089b0['attributes'][_0xd4ca('0x44')]?_0x3089b0['attributes']:_0x43464c['model'];if(_0x5a3eff[_0xd4ca('0x3d')][_0xd4ca('0x50')]){_0x3089b0[_0xd4ca('0x51')]=[{'all':!![]}];}_0x3089b0=_[_0xd4ca('0x4c')]({},_0x3089b0,_0x5a3eff[_0xd4ca('0x4e')]);return db[_0xd4ca('0x39')][_0xd4ca('0x56')](_0x3089b0)[_0xd4ca('0x33')](handleEntityNotFound(_0x21b07f,null))[_0xd4ca('0x33')](respondWithResult(_0x21b07f,null))['catch'](handleError(_0x21b07f,null));};exports[_0xd4ca('0x57')]=function(_0x3250d3,_0x5ba559){return db[_0xd4ca('0x39')][_0xd4ca('0x57')](_0x3250d3[_0xd4ca('0x58')],{})[_0xd4ca('0x33')](respondWithResult(_0x5ba559,0xc9))[_0xd4ca('0x2a')](handleError(_0x5ba559,null));};exports['update']=function(_0x20861d,_0x441943){if(_0x20861d[_0xd4ca('0x58')]['id']){delete _0x20861d[_0xd4ca('0x58')]['id'];}return db[_0xd4ca('0x39')][_0xd4ca('0x56')]({'where':{'id':_0x20861d['params']['id']}})['then'](handleEntityNotFound(_0x441943,null))[_0xd4ca('0x33')](saveUpdates(_0x20861d[_0xd4ca('0x58')],null))[_0xd4ca('0x33')](respondWithResult(_0x441943,null))['catch'](handleError(_0x441943,null));};exports[_0xd4ca('0x34')]=function(_0x3326fb,_0xfc3e4b){return db[_0xd4ca('0x39')][_0xd4ca('0x56')]({'where':{'id':_0x3326fb[_0xd4ca('0x59')]['id']}})[_0xd4ca('0x33')](handleEntityNotFound(_0xfc3e4b,null))['then'](removeEntity(_0xfc3e4b,null))['catch'](handleError(_0xfc3e4b,null));};exports[_0xd4ca('0x5a')]=function(_0x3f2238,_0xffb8d1,_0x174e81){var _0x720c35={};var _0x1cb86a={};var _0x512dec;var _0x2c626e;return db['FreshdeskConfiguration'][_0xd4ca('0x5b')]({'where':{'id':_0x3f2238['params']['id']}})[_0xd4ca('0x33')](handleEntityNotFound(_0xffb8d1,null))[_0xd4ca('0x33')](function(_0x1c1604){if(_0x1c1604){_0x512dec=_0x1c1604;_0x1cb86a[_0xd4ca('0x40')]=_[_0xd4ca('0x3e')](db[_0xd4ca('0x5c')][_0xd4ca('0x55')]);_0x1cb86a[_0xd4ca('0x3d')]=_[_0xd4ca('0x3e')](_0x3f2238['query']);_0x1cb86a[_0xd4ca('0x3f')]=_[_0xd4ca('0x41')](_0x1cb86a['model'],_0x1cb86a['query']);_0x720c35['attributes']=_[_0xd4ca('0x41')](_0x1cb86a[_0xd4ca('0x40')],qs[_0xd4ca('0x42')](_0x3f2238['query'][_0xd4ca('0x42')]));_0x720c35[_0xd4ca('0x43')]=_0x720c35['attributes'][_0xd4ca('0x44')]?_0x720c35['attributes']:_0x1cb86a[_0xd4ca('0x40')];_0x720c35[_0xd4ca('0x47')]=qs[_0xd4ca('0x48')](_0x3f2238[_0xd4ca('0x3d')][_0xd4ca('0x48')]);_0x720c35[_0xd4ca('0x49')]=qs[_0xd4ca('0x3f')](_[_0xd4ca('0x4a')](_0x3f2238[_0xd4ca('0x3d')],_0x1cb86a['filters']));if(_0x3f2238[_0xd4ca('0x3d')][_0xd4ca('0x4b')]){_0x720c35[_0xd4ca('0x49')]=_['merge'](_0x720c35[_0xd4ca('0x49')],{'$or':_[_0xd4ca('0x38')](_0x720c35[_0xd4ca('0x43')],function(_0x2cb2d9){var _0x13bb65={};_0x13bb65[_0x2cb2d9]={'$like':'%'+_0x3f2238[_0xd4ca('0x3d')][_0xd4ca('0x4b')]+'%'};return _0x13bb65;})});}_0x720c35=_['merge']({},_0x720c35,_0x3f2238[_0xd4ca('0x4e')]);return _0x512dec[_0xd4ca('0x5a')](_0x720c35);}})['then'](function(_0x380447){if(_0x380447){_0x2c626e=_0x380447[_0xd4ca('0x44')];if(!_0x3f2238[_0xd4ca('0x3d')][_0xd4ca('0x45')](_0xd4ca('0x46'))){_0x720c35['limit']=qs['limit'](_0x3f2238['query'][_0xd4ca('0x2e')]);_0x720c35['offset']=qs[_0xd4ca('0x2d')](_0x3f2238[_0xd4ca('0x3d')][_0xd4ca('0x2d')]);}return _0x512dec['getFields'](_0x720c35);}})[_0xd4ca('0x33')](function(_0x5d71ca){if(_0x5d71ca){return _0x5d71ca?{'count':_0x2c626e,'rows':_0x5d71ca}:null;}})[_0xd4ca('0x33')](respondWithResult(_0xffb8d1,null))[_0xd4ca('0x2a')](handleError(_0xffb8d1,null));};exports['getSubjects']=function(_0x2090ca,_0xd3b213,_0x540f01){var _0x31d8ed={};var _0x46f08b={};var _0x3c4590;var _0x42ca0c;return db[_0xd4ca('0x39')]['findOne']({'where':{'id':_0x2090ca['params']['id']}})[_0xd4ca('0x33')](handleEntityNotFound(_0xd3b213,null))[_0xd4ca('0x33')](function(_0xff71bd){if(_0xff71bd){_0x3c4590=_0xff71bd;_0x46f08b[_0xd4ca('0x40')]=_[_0xd4ca('0x3e')](db[_0xd4ca('0x5c')][_0xd4ca('0x55')]);_0x46f08b[_0xd4ca('0x3d')]=_[_0xd4ca('0x3e')](_0x2090ca['query']);_0x46f08b[_0xd4ca('0x3f')]=_[_0xd4ca('0x41')](_0x46f08b[_0xd4ca('0x40')],_0x46f08b[_0xd4ca('0x3d')]);_0x31d8ed[_0xd4ca('0x43')]=_[_0xd4ca('0x41')](_0x46f08b[_0xd4ca('0x40')],qs['fields'](_0x2090ca[_0xd4ca('0x3d')][_0xd4ca('0x42')]));_0x31d8ed['attributes']=_0x31d8ed['attributes']['length']?_0x31d8ed[_0xd4ca('0x43')]:_0x46f08b[_0xd4ca('0x40')];_0x31d8ed[_0xd4ca('0x47')]=qs['sort'](_0x2090ca['query'][_0xd4ca('0x48')]);_0x31d8ed['where']=qs[_0xd4ca('0x3f')](_[_0xd4ca('0x4a')](_0x2090ca[_0xd4ca('0x3d')],_0x46f08b[_0xd4ca('0x3f')]));if(_0x2090ca['query'][_0xd4ca('0x4b')]){_0x31d8ed['where']=_[_0xd4ca('0x4c')](_0x31d8ed[_0xd4ca('0x49')],{'$or':_['map'](_0x31d8ed['attributes'],function(_0x356cf5){var _0xa9e23b={};_0xa9e23b[_0x356cf5]={'$like':'%'+_0x2090ca['query']['filter']+'%'};return _0xa9e23b;})});}_0x31d8ed=_[_0xd4ca('0x4c')]({},_0x31d8ed,_0x2090ca['options']);return _0x3c4590[_0xd4ca('0x5d')](_0x31d8ed);}})[_0xd4ca('0x33')](function(_0x2e4802){if(_0x2e4802){_0x42ca0c=_0x2e4802[_0xd4ca('0x44')];if(!_0x2090ca['query'][_0xd4ca('0x45')]('nolimit')){_0x31d8ed['limit']=qs[_0xd4ca('0x2e')](_0x2090ca['query'][_0xd4ca('0x2e')]);_0x31d8ed[_0xd4ca('0x2d')]=qs[_0xd4ca('0x2d')](_0x2090ca[_0xd4ca('0x3d')][_0xd4ca('0x2d')]);}return _0x3c4590[_0xd4ca('0x5d')](_0x31d8ed);}})[_0xd4ca('0x33')](function(_0x24ad5d){if(_0x24ad5d){return _0x24ad5d?{'count':_0x42ca0c,'rows':_0x24ad5d}:null;}})[_0xd4ca('0x33')](respondWithResult(_0xd3b213,null))[_0xd4ca('0x2a')](handleError(_0xd3b213,null));};exports[_0xd4ca('0x5e')]=function(_0xa0bf17,_0x245ca2,_0x65b72b){var _0x3ecf5a={};var _0x1a6f28={};var _0x5ab766;var _0x1d20a6;return db[_0xd4ca('0x39')][_0xd4ca('0x5b')]({'where':{'id':_0xa0bf17[_0xd4ca('0x59')]['id']}})[_0xd4ca('0x33')](handleEntityNotFound(_0x245ca2,null))[_0xd4ca('0x33')](function(_0x16f720){if(_0x16f720){_0x5ab766=_0x16f720;_0x1a6f28[_0xd4ca('0x40')]=_[_0xd4ca('0x3e')](db[_0xd4ca('0x5c')]['rawAttributes']);_0x1a6f28[_0xd4ca('0x3d')]=_[_0xd4ca('0x3e')](_0xa0bf17['query']);_0x1a6f28['filters']=_[_0xd4ca('0x41')](_0x1a6f28['model'],_0x1a6f28[_0xd4ca('0x3d')]);_0x3ecf5a[_0xd4ca('0x43')]=_['intersection'](_0x1a6f28['model'],qs[_0xd4ca('0x42')](_0xa0bf17['query']['fields']));_0x3ecf5a[_0xd4ca('0x43')]=_0x3ecf5a[_0xd4ca('0x43')][_0xd4ca('0x44')]?_0x3ecf5a[_0xd4ca('0x43')]:_0x1a6f28[_0xd4ca('0x40')];_0x3ecf5a[_0xd4ca('0x47')]=qs[_0xd4ca('0x48')](_0xa0bf17[_0xd4ca('0x3d')][_0xd4ca('0x48')]);_0x3ecf5a['where']=qs[_0xd4ca('0x3f')](_[_0xd4ca('0x4a')](_0xa0bf17['query'],_0x1a6f28['filters']));if(_0xa0bf17[_0xd4ca('0x3d')][_0xd4ca('0x4b')]){_0x3ecf5a[_0xd4ca('0x49')]=_[_0xd4ca('0x4c')](_0x3ecf5a[_0xd4ca('0x49')],{'$or':_[_0xd4ca('0x38')](_0x3ecf5a[_0xd4ca('0x43')],function(_0x5ea3df){var _0x202764={};_0x202764[_0x5ea3df]={'$like':'%'+_0xa0bf17[_0xd4ca('0x3d')][_0xd4ca('0x4b')]+'%'};return _0x202764;})});}_0x3ecf5a=_[_0xd4ca('0x4c')]({},_0x3ecf5a,_0xa0bf17['options']);return _0x5ab766[_0xd4ca('0x5e')](_0x3ecf5a);}})[_0xd4ca('0x33')](function(_0xaceff1){if(_0xaceff1){_0x1d20a6=_0xaceff1['length'];if(!_0xa0bf17[_0xd4ca('0x3d')][_0xd4ca('0x45')]('nolimit')){_0x3ecf5a['limit']=qs[_0xd4ca('0x2e')](_0xa0bf17['query'][_0xd4ca('0x2e')]);_0x3ecf5a[_0xd4ca('0x2d')]=qs[_0xd4ca('0x2d')](_0xa0bf17[_0xd4ca('0x3d')][_0xd4ca('0x2d')]);}return _0x5ab766[_0xd4ca('0x5e')](_0x3ecf5a);}})['then'](function(_0x1258ce){if(_0x1258ce){return _0x1258ce?{'count':_0x1d20a6,'rows':_0x1258ce}:null;}})[_0xd4ca('0x33')](respondWithResult(_0x245ca2,null))[_0xd4ca('0x2a')](handleError(_0x245ca2,null));};exports[_0xd4ca('0x5f')]=function(_0x59896c,_0x438013,_0x49acbf){var _0x14f6e2={};var _0x4cda5c={};var _0x3d9840;var _0x2fbef4;return db[_0xd4ca('0x39')][_0xd4ca('0x5b')]({'where':{'id':_0x59896c[_0xd4ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x438013,null))[_0xd4ca('0x33')](function(_0x496ce6){if(_0x496ce6){_0x3d9840=_0x496ce6;_0x4cda5c[_0xd4ca('0x40')]=_[_0xd4ca('0x3e')](db['Tag'][_0xd4ca('0x55')]);_0x4cda5c[_0xd4ca('0x3d')]=_['keys'](_0x59896c[_0xd4ca('0x3d')]);_0x4cda5c['filters']=_[_0xd4ca('0x41')](_0x4cda5c[_0xd4ca('0x40')],_0x4cda5c[_0xd4ca('0x3d')]);_0x14f6e2[_0xd4ca('0x43')]=_['intersection'](_0x4cda5c['model'],qs[_0xd4ca('0x42')](_0x59896c[_0xd4ca('0x3d')]['fields']));_0x14f6e2[_0xd4ca('0x43')]=_0x14f6e2[_0xd4ca('0x43')]['length']?_0x14f6e2[_0xd4ca('0x43')]:_0x4cda5c[_0xd4ca('0x40')];_0x14f6e2['order']=qs[_0xd4ca('0x48')](_0x59896c[_0xd4ca('0x3d')][_0xd4ca('0x48')]);_0x14f6e2[_0xd4ca('0x49')]=qs[_0xd4ca('0x3f')](_['pick'](_0x59896c['query'],_0x4cda5c[_0xd4ca('0x3f')]));if(_0x59896c[_0xd4ca('0x3d')][_0xd4ca('0x4b')]){_0x14f6e2[_0xd4ca('0x49')]=_[_0xd4ca('0x4c')](_0x14f6e2[_0xd4ca('0x49')],{'$or':_['map'](_0x14f6e2[_0xd4ca('0x43')],function(_0xe763ff){var _0x231d56={};_0x231d56[_0xe763ff]={'$like':'%'+_0x59896c[_0xd4ca('0x3d')]['filter']+'%'};return _0x231d56;})});}_0x14f6e2=_['merge']({},_0x14f6e2,_0x59896c[_0xd4ca('0x4e')]);return _0x3d9840[_0xd4ca('0x5f')](_0x14f6e2);}})[_0xd4ca('0x33')](function(_0x48aef5){if(_0x48aef5){_0x2fbef4=_0x48aef5[_0xd4ca('0x44')];if(!_0x59896c[_0xd4ca('0x3d')][_0xd4ca('0x45')](_0xd4ca('0x46'))){_0x14f6e2[_0xd4ca('0x2e')]=qs[_0xd4ca('0x2e')](_0x59896c['query'][_0xd4ca('0x2e')]);_0x14f6e2[_0xd4ca('0x2d')]=qs[_0xd4ca('0x2d')](_0x59896c[_0xd4ca('0x3d')][_0xd4ca('0x2d')]);}return _0x3d9840[_0xd4ca('0x5f')](_0x14f6e2);}})['then'](function(_0x105e4b){if(_0x105e4b){return _0x105e4b?{'count':_0x2fbef4,'rows':_0x105e4b}:null;}})[_0xd4ca('0x33')](respondWithResult(_0x438013,null))[_0xd4ca('0x2a')](handleError(_0x438013,null));};exports[_0xd4ca('0x60')]=function(_0x4c4c3a,_0x283bd4,_0x13813f){if(_0x4c4c3a[_0xd4ca('0x58')]['id']){delete _0x4c4c3a[_0xd4ca('0x58')]['id'];}return db['FreshdeskConfiguration'][_0xd4ca('0x5b')]({'where':{'id':_0x4c4c3a[_0xd4ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x283bd4,null))['then'](function(_0x5bd810){if(_0x5bd810){return _0x5bd810['setTags'](_0x4c4c3a[_0xd4ca('0x58')][_0xd4ca('0x61')]||[]);}return null;})[_0xd4ca('0x33')](respondWithResult(_0x283bd4,null))['catch'](handleError(_0x283bd4,null));}; \ No newline at end of file +var _0x3d55=['offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','FreshdeskConfiguration','rawAttributes','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','type','filter','merge','options','includeAll','include','findAll','rows','show','find','create','body','params','findOne','pick','getFields','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x3d55,0x141));var _0x53d5=function(_0x38dfae,_0x3cb1de){_0x38dfae=_0x38dfae-0x0;var _0x58ca4e=_0x3d55[_0x38dfae];return _0x58ca4e;};'use strict';var pdf=require(_0x53d5('0x0'));var emlformat=require(_0x53d5('0x1'));var rimraf=require(_0x53d5('0x2'));var zipdir=require(_0x53d5('0x3'));var jsonpatch=require(_0x53d5('0x4'));var rp=require(_0x53d5('0x5'));var moment=require('moment');var BPromise=require(_0x53d5('0x6'));var Mustache=require(_0x53d5('0x7'));var util=require(_0x53d5('0x8'));var path=require('path');var sox=require(_0x53d5('0x9'));var csv=require(_0x53d5('0xa'));var ejs=require(_0x53d5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x53d5('0xc'));var jsforce=require(_0x53d5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x53d5('0xa'));var querystring=require(_0x53d5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x53d5('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x53d5('0x10'))(_0x53d5('0x11'));var utils=require(_0x53d5('0x12'));var config=require(_0x53d5('0x13'));var db=require(_0x53d5('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x53d5('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x3f4c83,_0x12a659,_0x106e0a){if(_0x106e0a){var _0x80e44e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x80e44e[_0x53d5('0x16')](_0x12a659)){return _0x3f4c83;}else{throw new db[(_0x53d5('0x17'))][(_0x53d5('0x18'))](_0x53d5('0x19'));}}else{return _0x3f4c83;}}function respondWithRpcPromise(_0x4edce9,_0x32e98d,_0x15da88,_0x5ecb80){return new BPromise(function(_0x117c2f,_0x5eba93){var _0x547c81=_0x5ecb80||client;return _0x547c81['request'](_0x4edce9,_0x15da88)[_0x53d5('0x1a')](function(_0x3f9a66){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x32e98d,_0x53d5('0x1b'));logger[_0x53d5('0x1c')](_0x53d5('0x1d'),_0x32e98d,_0x53d5('0x1b'),JSON[_0x53d5('0x1e')](_0x3f9a66));if(_0x3f9a66[_0x53d5('0x1f')]){if(_0x3f9a66[_0x53d5('0x1f')][_0x53d5('0x20')]===0x1f4){logger['error'](_0x53d5('0x21'),_0x32e98d,_0x3f9a66[_0x53d5('0x1f')]['message']);return _0x5eba93(_0x3f9a66[_0x53d5('0x1f')]['message']);}logger[_0x53d5('0x1f')](_0x53d5('0x21'),_0x32e98d,_0x3f9a66['error'][_0x53d5('0x22')]);return _0x117c2f(_0x3f9a66[_0x53d5('0x1f')][_0x53d5('0x22')]);}else{logger[_0x53d5('0x23')](_0x53d5('0x21'),_0x32e98d,_0x53d5('0x1b'));_0x117c2f(_0x3f9a66[_0x53d5('0x24')][_0x53d5('0x22')]);}})[_0x53d5('0x25')](function(_0x38b2f1){logger[_0x53d5('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x32e98d,_0x38b2f1);_0x5eba93(_0x38b2f1);});});}function respondWithStatusCode(_0x44a91e,_0x5dfb26){_0x5dfb26=_0x5dfb26||0xcc;return function(_0x22b0ca){if(_0x22b0ca){return _0x44a91e[_0x53d5('0x26')](_0x5dfb26);}return _0x44a91e[_0x53d5('0x27')](_0x5dfb26)[_0x53d5('0x28')]();};}function respondWithResult(_0x2c0421,_0x3b30d3){_0x3b30d3=_0x3b30d3||0xc8;return function(_0x23539a){if(_0x23539a){return _0x2c0421[_0x53d5('0x27')](_0x3b30d3)[_0x53d5('0x29')](_0x23539a);}};}function respondWithFilteredResult(_0x33c74e,_0x3532d6){return function(_0xe93ab7){if(_0xe93ab7){var _0x598985=_0xe93ab7[_0x53d5('0x2a')],_0xc15d51=_0x3532d6[_0x53d5('0x2b')],_0x131eb9=_0x3532d6[_0x53d5('0x2b')]+_0x3532d6[_0x53d5('0x2c')],_0x3a7c92;if(_0x131eb9>=_0x598985){_0x131eb9=_0x598985;_0x3a7c92=0xc8;}else{_0x3a7c92=0xce;}_0x33c74e[_0x53d5('0x27')](_0x3a7c92);return _0x33c74e[_0x53d5('0x2d')](_0x53d5('0x2e'),_0xc15d51+'-'+_0x131eb9+'/'+_0x598985)[_0x53d5('0x29')](_0xe93ab7);}return null;};}function patchUpdates(_0x348f18){return function(_0x1b956b){try{jsonpatch[_0x53d5('0x2f')](_0x1b956b,_0x348f18,!![]);}catch(_0x278a15){return BPromise['reject'](_0x278a15);}return _0x1b956b['save']();};}function saveUpdates(_0x1279ad,_0x25d00d){return function(_0x4809c5){if(_0x4809c5){return _0x4809c5[_0x53d5('0x30')](_0x1279ad)[_0x53d5('0x1a')](function(_0x3d8c65){return _0x3d8c65;});}return null;};}function removeEntity(_0x977eb1,_0x4b56f5){return function(_0x2c29b1){if(_0x2c29b1){return _0x2c29b1[_0x53d5('0x31')]()[_0x53d5('0x1a')](function(){_0x977eb1[_0x53d5('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a25f,_0x11c913){return function(_0x49fe39){if(!_0x49fe39){_0x15a25f[_0x53d5('0x26')](0x194);}return _0x49fe39;};}function handleError(_0x12da1f,_0x68e22e){_0x68e22e=_0x68e22e||0x1f4;return function(_0x279ff0){logger[_0x53d5('0x1f')](_0x279ff0[_0x53d5('0x32')]);if(_0x279ff0[_0x53d5('0x33')]){delete _0x279ff0[_0x53d5('0x33')];}_0x12da1f[_0x53d5('0x27')](_0x68e22e)[_0x53d5('0x34')](_0x279ff0);};}exports['index']=function(_0x349a08,_0x3cab62){var _0x37ea0b={},_0x46b0e0={},_0x400cea={'count':0x0,'rows':[]};var _0x299995=_['map'](db[_0x53d5('0x35')][_0x53d5('0x36')],function(_0x2745c4){return{'name':_0x2745c4['fieldName'],'type':_0x2745c4['type']['key']};});_0x46b0e0[_0x53d5('0x37')]=_[_0x53d5('0x38')](_0x299995,_0x53d5('0x33'));_0x46b0e0[_0x53d5('0x39')]=_[_0x53d5('0x3a')](_0x349a08[_0x53d5('0x39')]);_0x46b0e0[_0x53d5('0x3b')]=_['intersection'](_0x46b0e0['model'],_0x46b0e0[_0x53d5('0x39')]);_0x37ea0b['attributes']=_[_0x53d5('0x3c')](_0x46b0e0[_0x53d5('0x37')],qs[_0x53d5('0x3d')](_0x349a08[_0x53d5('0x39')]['fields']));_0x37ea0b[_0x53d5('0x3e')]=_0x37ea0b['attributes'][_0x53d5('0x3f')]?_0x37ea0b[_0x53d5('0x3e')]:_0x46b0e0[_0x53d5('0x37')];if(!_0x349a08[_0x53d5('0x39')][_0x53d5('0x40')](_0x53d5('0x41'))){_0x37ea0b[_0x53d5('0x2c')]=qs[_0x53d5('0x2c')](_0x349a08['query'][_0x53d5('0x2c')]);_0x37ea0b['offset']=qs[_0x53d5('0x2b')](_0x349a08[_0x53d5('0x39')][_0x53d5('0x2b')]);}_0x37ea0b[_0x53d5('0x42')]=qs[_0x53d5('0x43')](_0x349a08[_0x53d5('0x39')][_0x53d5('0x43')]);_0x37ea0b['where']=qs['filters'](_['pick'](_0x349a08[_0x53d5('0x39')],_0x46b0e0[_0x53d5('0x3b')]));if(_0x349a08['query']['filter']){_0x37ea0b[_0x53d5('0x44')]=_['merge'](_0x37ea0b['where'],{'$or':_[_0x53d5('0x38')](_0x299995,function(_0x2c88bf){if(_0x2c88bf[_0x53d5('0x45')]!=='VIRTUAL'){var _0x3ce925={};_0x3ce925[_0x2c88bf[_0x53d5('0x33')]]={'$like':'%'+_0x349a08['query'][_0x53d5('0x46')]+'%'};return _0x3ce925;}})});}_0x37ea0b=_[_0x53d5('0x47')]({},_0x37ea0b,_0x349a08[_0x53d5('0x48')]);var _0x164a20={'where':_0x37ea0b[_0x53d5('0x44')]};return db[_0x53d5('0x35')][_0x53d5('0x2a')](_0x164a20)['then'](function(_0x70785b){_0x400cea[_0x53d5('0x2a')]=_0x70785b;if(_0x349a08[_0x53d5('0x39')][_0x53d5('0x49')]){_0x37ea0b[_0x53d5('0x4a')]=[{'all':!![]}];}return db[_0x53d5('0x35')][_0x53d5('0x4b')](_0x37ea0b);})['then'](function(_0x3a4869){_0x400cea[_0x53d5('0x4c')]=_0x3a4869;return _0x400cea;})[_0x53d5('0x1a')](respondWithFilteredResult(_0x3cab62,_0x37ea0b))[_0x53d5('0x25')](handleError(_0x3cab62,null));};exports[_0x53d5('0x4d')]=function(_0x2e52e9,_0x11a339){var _0x4e5b00={'raw':![],'where':{'id':_0x2e52e9['params']['id']}},_0x38dddb={};_0x38dddb['model']=_['keys'](db['FreshdeskConfiguration'][_0x53d5('0x36')]);_0x38dddb[_0x53d5('0x39')]=_[_0x53d5('0x3a')](_0x2e52e9['query']);_0x38dddb[_0x53d5('0x3b')]=_[_0x53d5('0x3c')](_0x38dddb[_0x53d5('0x37')],_0x38dddb[_0x53d5('0x39')]);_0x4e5b00[_0x53d5('0x3e')]=_['intersection'](_0x38dddb['model'],qs[_0x53d5('0x3d')](_0x2e52e9[_0x53d5('0x39')][_0x53d5('0x3d')]));_0x4e5b00[_0x53d5('0x3e')]=_0x4e5b00[_0x53d5('0x3e')]['length']?_0x4e5b00[_0x53d5('0x3e')]:_0x38dddb[_0x53d5('0x37')];if(_0x2e52e9['query']['includeAll']){_0x4e5b00[_0x53d5('0x4a')]=[{'all':!![]}];}_0x4e5b00=_[_0x53d5('0x47')]({},_0x4e5b00,_0x2e52e9[_0x53d5('0x48')]);return db[_0x53d5('0x35')][_0x53d5('0x4e')](_0x4e5b00)[_0x53d5('0x1a')](handleEntityNotFound(_0x11a339,null))[_0x53d5('0x1a')](respondWithResult(_0x11a339,null))[_0x53d5('0x25')](handleError(_0x11a339,null));};exports[_0x53d5('0x4f')]=function(_0x28b00a,_0x5e7b26){return db['FreshdeskConfiguration'][_0x53d5('0x4f')](_0x28b00a[_0x53d5('0x50')],{})[_0x53d5('0x1a')](respondWithResult(_0x5e7b26,0xc9))[_0x53d5('0x25')](handleError(_0x5e7b26,null));};exports[_0x53d5('0x30')]=function(_0x16e020,_0xd2f961){if(_0x16e020[_0x53d5('0x50')]['id']){delete _0x16e020[_0x53d5('0x50')]['id'];}return db['FreshdeskConfiguration'][_0x53d5('0x4e')]({'where':{'id':_0x16e020[_0x53d5('0x51')]['id']}})[_0x53d5('0x1a')](handleEntityNotFound(_0xd2f961,null))[_0x53d5('0x1a')](saveUpdates(_0x16e020[_0x53d5('0x50')],null))['then'](respondWithResult(_0xd2f961,null))[_0x53d5('0x25')](handleError(_0xd2f961,null));};exports[_0x53d5('0x31')]=function(_0x53e378,_0x3140a6){return db[_0x53d5('0x35')][_0x53d5('0x4e')]({'where':{'id':_0x53e378[_0x53d5('0x51')]['id']}})[_0x53d5('0x1a')](handleEntityNotFound(_0x3140a6,null))[_0x53d5('0x1a')](removeEntity(_0x3140a6,null))['catch'](handleError(_0x3140a6,null));};exports['getFields']=function(_0x4452af,_0x44fc02,_0x3ce819){var _0x1b0f28={};var _0x277418={};var _0x411bcc;var _0x309b66;return db[_0x53d5('0x35')][_0x53d5('0x52')]({'where':{'id':_0x4452af['params']['id']}})['then'](handleEntityNotFound(_0x44fc02,null))[_0x53d5('0x1a')](function(_0x3f0bdd){if(_0x3f0bdd){_0x411bcc=_0x3f0bdd;_0x277418[_0x53d5('0x37')]=_[_0x53d5('0x3a')](db['FreshdeskField']['rawAttributes']);_0x277418[_0x53d5('0x39')]=_['keys'](_0x4452af[_0x53d5('0x39')]);_0x277418[_0x53d5('0x3b')]=_['intersection'](_0x277418['model'],_0x277418[_0x53d5('0x39')]);_0x1b0f28['attributes']=_[_0x53d5('0x3c')](_0x277418[_0x53d5('0x37')],qs[_0x53d5('0x3d')](_0x4452af['query'][_0x53d5('0x3d')]));_0x1b0f28['attributes']=_0x1b0f28[_0x53d5('0x3e')][_0x53d5('0x3f')]?_0x1b0f28['attributes']:_0x277418[_0x53d5('0x37')];_0x1b0f28[_0x53d5('0x42')]=qs['sort'](_0x4452af['query'][_0x53d5('0x43')]);_0x1b0f28[_0x53d5('0x44')]=qs[_0x53d5('0x3b')](_[_0x53d5('0x53')](_0x4452af[_0x53d5('0x39')],_0x277418['filters']));if(_0x4452af['query'][_0x53d5('0x46')]){_0x1b0f28[_0x53d5('0x44')]=_[_0x53d5('0x47')](_0x1b0f28['where'],{'$or':_[_0x53d5('0x38')](_0x1b0f28[_0x53d5('0x3e')],function(_0x35ab60){var _0x8fb52d={};_0x8fb52d[_0x35ab60]={'$like':'%'+_0x4452af[_0x53d5('0x39')]['filter']+'%'};return _0x8fb52d;})});}_0x1b0f28=_['merge']({},_0x1b0f28,_0x4452af[_0x53d5('0x48')]);return _0x411bcc[_0x53d5('0x54')](_0x1b0f28);}})[_0x53d5('0x1a')](function(_0x1d18a2){if(_0x1d18a2){_0x309b66=_0x1d18a2[_0x53d5('0x3f')];if(!_0x4452af[_0x53d5('0x39')]['hasOwnProperty'](_0x53d5('0x41'))){_0x1b0f28[_0x53d5('0x2c')]=qs[_0x53d5('0x2c')](_0x4452af[_0x53d5('0x39')][_0x53d5('0x2c')]);_0x1b0f28[_0x53d5('0x2b')]=qs['offset'](_0x4452af['query'][_0x53d5('0x2b')]);}return _0x411bcc[_0x53d5('0x54')](_0x1b0f28);}})[_0x53d5('0x1a')](function(_0x2c4a03){if(_0x2c4a03){return _0x2c4a03?{'count':_0x309b66,'rows':_0x2c4a03}:null;}})['then'](respondWithResult(_0x44fc02,null))[_0x53d5('0x25')](handleError(_0x44fc02,null));};exports[_0x53d5('0x55')]=function(_0x4650e9,_0x3b8801,_0x1b481d){var _0x1772d1={};var _0x5527ce={};var _0x4a3324;var _0x228976;return db['FreshdeskConfiguration'][_0x53d5('0x52')]({'where':{'id':_0x4650e9[_0x53d5('0x51')]['id']}})[_0x53d5('0x1a')](handleEntityNotFound(_0x3b8801,null))['then'](function(_0x4024b1){if(_0x4024b1){_0x4a3324=_0x4024b1;_0x5527ce[_0x53d5('0x37')]=_[_0x53d5('0x3a')](db['FreshdeskField'][_0x53d5('0x36')]);_0x5527ce[_0x53d5('0x39')]=_['keys'](_0x4650e9[_0x53d5('0x39')]);_0x5527ce[_0x53d5('0x3b')]=_[_0x53d5('0x3c')](_0x5527ce[_0x53d5('0x37')],_0x5527ce[_0x53d5('0x39')]);_0x1772d1[_0x53d5('0x3e')]=_[_0x53d5('0x3c')](_0x5527ce[_0x53d5('0x37')],qs[_0x53d5('0x3d')](_0x4650e9[_0x53d5('0x39')][_0x53d5('0x3d')]));_0x1772d1['attributes']=_0x1772d1[_0x53d5('0x3e')][_0x53d5('0x3f')]?_0x1772d1[_0x53d5('0x3e')]:_0x5527ce[_0x53d5('0x37')];_0x1772d1[_0x53d5('0x42')]=qs[_0x53d5('0x43')](_0x4650e9[_0x53d5('0x39')][_0x53d5('0x43')]);_0x1772d1['where']=qs[_0x53d5('0x3b')](_[_0x53d5('0x53')](_0x4650e9[_0x53d5('0x39')],_0x5527ce[_0x53d5('0x3b')]));if(_0x4650e9[_0x53d5('0x39')][_0x53d5('0x46')]){_0x1772d1[_0x53d5('0x44')]=_[_0x53d5('0x47')](_0x1772d1[_0x53d5('0x44')],{'$or':_[_0x53d5('0x38')](_0x1772d1[_0x53d5('0x3e')],function(_0x35ef13){var _0x465f91={};_0x465f91[_0x35ef13]={'$like':'%'+_0x4650e9[_0x53d5('0x39')]['filter']+'%'};return _0x465f91;})});}_0x1772d1=_['merge']({},_0x1772d1,_0x4650e9[_0x53d5('0x48')]);return _0x4a3324[_0x53d5('0x55')](_0x1772d1);}})[_0x53d5('0x1a')](function(_0x120bc4){if(_0x120bc4){_0x228976=_0x120bc4['length'];if(!_0x4650e9[_0x53d5('0x39')][_0x53d5('0x40')](_0x53d5('0x41'))){_0x1772d1['limit']=qs[_0x53d5('0x2c')](_0x4650e9[_0x53d5('0x39')]['limit']);_0x1772d1[_0x53d5('0x2b')]=qs[_0x53d5('0x2b')](_0x4650e9['query'][_0x53d5('0x2b')]);}return _0x4a3324['getSubjects'](_0x1772d1);}})[_0x53d5('0x1a')](function(_0x2afdb8){if(_0x2afdb8){return _0x2afdb8?{'count':_0x228976,'rows':_0x2afdb8}:null;}})[_0x53d5('0x1a')](respondWithResult(_0x3b8801,null))[_0x53d5('0x25')](handleError(_0x3b8801,null));};exports['getDescriptions']=function(_0x2ad1e9,_0x4e2148,_0x352351){var _0x270a4d={};var _0x15073e={};var _0x3114e5;var _0x26e27f;return db[_0x53d5('0x35')]['findOne']({'where':{'id':_0x2ad1e9[_0x53d5('0x51')]['id']}})[_0x53d5('0x1a')](handleEntityNotFound(_0x4e2148,null))[_0x53d5('0x1a')](function(_0x33694d){if(_0x33694d){_0x3114e5=_0x33694d;_0x15073e[_0x53d5('0x37')]=_[_0x53d5('0x3a')](db[_0x53d5('0x56')][_0x53d5('0x36')]);_0x15073e[_0x53d5('0x39')]=_[_0x53d5('0x3a')](_0x2ad1e9[_0x53d5('0x39')]);_0x15073e[_0x53d5('0x3b')]=_['intersection'](_0x15073e[_0x53d5('0x37')],_0x15073e[_0x53d5('0x39')]);_0x270a4d[_0x53d5('0x3e')]=_[_0x53d5('0x3c')](_0x15073e[_0x53d5('0x37')],qs[_0x53d5('0x3d')](_0x2ad1e9[_0x53d5('0x39')][_0x53d5('0x3d')]));_0x270a4d[_0x53d5('0x3e')]=_0x270a4d[_0x53d5('0x3e')]['length']?_0x270a4d[_0x53d5('0x3e')]:_0x15073e[_0x53d5('0x37')];_0x270a4d[_0x53d5('0x42')]=qs['sort'](_0x2ad1e9['query'][_0x53d5('0x43')]);_0x270a4d[_0x53d5('0x44')]=qs[_0x53d5('0x3b')](_[_0x53d5('0x53')](_0x2ad1e9[_0x53d5('0x39')],_0x15073e[_0x53d5('0x3b')]));if(_0x2ad1e9[_0x53d5('0x39')]['filter']){_0x270a4d[_0x53d5('0x44')]=_[_0x53d5('0x47')](_0x270a4d[_0x53d5('0x44')],{'$or':_[_0x53d5('0x38')](_0x270a4d['attributes'],function(_0x310436){var _0x28d564={};_0x28d564[_0x310436]={'$like':'%'+_0x2ad1e9[_0x53d5('0x39')][_0x53d5('0x46')]+'%'};return _0x28d564;})});}_0x270a4d=_[_0x53d5('0x47')]({},_0x270a4d,_0x2ad1e9[_0x53d5('0x48')]);return _0x3114e5[_0x53d5('0x57')](_0x270a4d);}})[_0x53d5('0x1a')](function(_0x2d8daa){if(_0x2d8daa){_0x26e27f=_0x2d8daa['length'];if(!_0x2ad1e9[_0x53d5('0x39')][_0x53d5('0x40')](_0x53d5('0x41'))){_0x270a4d['limit']=qs['limit'](_0x2ad1e9[_0x53d5('0x39')][_0x53d5('0x2c')]);_0x270a4d[_0x53d5('0x2b')]=qs[_0x53d5('0x2b')](_0x2ad1e9[_0x53d5('0x39')][_0x53d5('0x2b')]);}return _0x3114e5['getDescriptions'](_0x270a4d);}})[_0x53d5('0x1a')](function(_0x116794){if(_0x116794){return _0x116794?{'count':_0x26e27f,'rows':_0x116794}:null;}})[_0x53d5('0x1a')](respondWithResult(_0x4e2148,null))[_0x53d5('0x25')](handleError(_0x4e2148,null));};exports[_0x53d5('0x58')]=function(_0x388011,_0x3a616f,_0xbca18){var _0x2d6d3f={};var _0x4e6006={};var _0x459df9;var _0x267f0a;return db['FreshdeskConfiguration'][_0x53d5('0x52')]({'where':{'id':_0x388011[_0x53d5('0x51')]['id']}})[_0x53d5('0x1a')](handleEntityNotFound(_0x3a616f,null))[_0x53d5('0x1a')](function(_0x56bc1c){if(_0x56bc1c){_0x459df9=_0x56bc1c;_0x4e6006[_0x53d5('0x37')]=_['keys'](db['Tag'][_0x53d5('0x36')]);_0x4e6006[_0x53d5('0x39')]=_[_0x53d5('0x3a')](_0x388011[_0x53d5('0x39')]);_0x4e6006[_0x53d5('0x3b')]=_[_0x53d5('0x3c')](_0x4e6006[_0x53d5('0x37')],_0x4e6006[_0x53d5('0x39')]);_0x2d6d3f[_0x53d5('0x3e')]=_[_0x53d5('0x3c')](_0x4e6006[_0x53d5('0x37')],qs[_0x53d5('0x3d')](_0x388011[_0x53d5('0x39')][_0x53d5('0x3d')]));_0x2d6d3f[_0x53d5('0x3e')]=_0x2d6d3f[_0x53d5('0x3e')]['length']?_0x2d6d3f[_0x53d5('0x3e')]:_0x4e6006[_0x53d5('0x37')];_0x2d6d3f[_0x53d5('0x42')]=qs[_0x53d5('0x43')](_0x388011[_0x53d5('0x39')][_0x53d5('0x43')]);_0x2d6d3f[_0x53d5('0x44')]=qs[_0x53d5('0x3b')](_[_0x53d5('0x53')](_0x388011[_0x53d5('0x39')],_0x4e6006[_0x53d5('0x3b')]));if(_0x388011[_0x53d5('0x39')][_0x53d5('0x46')]){_0x2d6d3f[_0x53d5('0x44')]=_[_0x53d5('0x47')](_0x2d6d3f[_0x53d5('0x44')],{'$or':_[_0x53d5('0x38')](_0x2d6d3f[_0x53d5('0x3e')],function(_0x1fd308){var _0x229508={};_0x229508[_0x1fd308]={'$like':'%'+_0x388011[_0x53d5('0x39')][_0x53d5('0x46')]+'%'};return _0x229508;})});}_0x2d6d3f=_[_0x53d5('0x47')]({},_0x2d6d3f,_0x388011[_0x53d5('0x48')]);return _0x459df9['getTags'](_0x2d6d3f);}})[_0x53d5('0x1a')](function(_0x2ef5b1){if(_0x2ef5b1){_0x267f0a=_0x2ef5b1['length'];if(!_0x388011[_0x53d5('0x39')][_0x53d5('0x40')]('nolimit')){_0x2d6d3f[_0x53d5('0x2c')]=qs['limit'](_0x388011['query'][_0x53d5('0x2c')]);_0x2d6d3f['offset']=qs[_0x53d5('0x2b')](_0x388011[_0x53d5('0x39')][_0x53d5('0x2b')]);}return _0x459df9[_0x53d5('0x58')](_0x2d6d3f);}})[_0x53d5('0x1a')](function(_0x4ec82c){if(_0x4ec82c){return _0x4ec82c?{'count':_0x267f0a,'rows':_0x4ec82c}:null;}})['then'](respondWithResult(_0x3a616f,null))[_0x53d5('0x25')](handleError(_0x3a616f,null));};exports[_0x53d5('0x59')]=function(_0x28457e,_0x5e8020,_0x36853d){if(_0x28457e['body']['id']){delete _0x28457e['body']['id'];}return db[_0x53d5('0x35')]['findOne']({'where':{'id':_0x28457e[_0x53d5('0x51')]['id']}})[_0x53d5('0x1a')](handleEntityNotFound(_0x5e8020,null))[_0x53d5('0x1a')](function(_0x3645fa){if(_0x3645fa){return _0x3645fa[_0x53d5('0x59')](_0x28457e[_0x53d5('0x50')][_0x53d5('0x5a')]||[]);}return null;})[_0x53d5('0x1a')](respondWithResult(_0x5e8020,null))[_0x53d5('0x25')](handleError(_0x5e8020,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a459281..edebd3b 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe117=['define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x13179f,_0x21f5dd){var _0x51b9e3=function(_0x20701f){while(--_0x20701f){_0x13179f['push'](_0x13179f['shift']());}};_0x51b9e3(++_0x21f5dd);}(_0xe117,0x1a7));var _0x7e11=function(_0x586d7e,_0x2af76d){_0x586d7e=_0x586d7e-0x0;var _0x30c989=_0xe117[_0x586d7e];return _0x30c989;};'use strict';var _=require('lodash');var util=require(_0x7e11('0x0'));var logger=require(_0x7e11('0x1'))('api');var moment=require(_0x7e11('0x2'));var BPromise=require(_0x7e11('0x3'));var rp=require(_0x7e11('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e11('0x5'));var config=require('../../config/environment');var attributes=require(_0x7e11('0x6'));module['exports']=function(_0x3a217b,_0x46600d){return _0x3a217b[_0x7e11('0x7')](_0x7e11('0x8'),attributes,{'tableName':_0x7e11('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ecb=['util','../../config/logger','api','moment','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x1cbbe7,_0x90e7a8){var _0x4d57bb=function(_0x41e2da){while(--_0x41e2da){_0x1cbbe7['push'](_0x1cbbe7['shift']());}};_0x4d57bb(++_0x90e7a8);}(_0x9ecb,0x11e));var _0xb9ec=function(_0x3f9a61,_0x2451ec){_0x3f9a61=_0x3f9a61-0x0;var _0x103707=_0x9ecb[_0x3f9a61];return _0x103707;};'use strict';var _=require('lodash');var util=require(_0xb9ec('0x0'));var logger=require(_0xb9ec('0x1'))(_0xb9ec('0x2'));var moment=require(_0xb9ec('0x3'));var BPromise=require('bluebird');var rp=require(_0xb9ec('0x4'));var fs=require('fs');var path=require(_0xb9ec('0x5'));var rimraf=require(_0xb9ec('0x6'));var config=require('../../config/environment');var attributes=require(_0xb9ec('0x7'));module[_0xb9ec('0x8')]=function(_0x88a13e,_0x117ce6){return _0x88a13e[_0xb9ec('0x9')](_0xb9ec('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 0de7505..04a70cc 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x934d=['../../config/environment','jayson/promise','client','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x934d,0x104));var _0xd934=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x934d[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0xd934('0x0'));var moment=require(_0xd934('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd934('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd934('0x3'));var logger=require(_0xd934('0x4'))(_0xd934('0x5'));var config=require(_0xd934('0x6'));var jayson=require(_0xd934('0x7'));var client=jayson[_0xd934('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54b382,_0x45bec9,_0x9e6cef){return new BPromise(function(_0x54d3e6,_0x5c1732){return client[_0xd934('0x9')](_0x54b382,_0x9e6cef)[_0xd934('0xa')](function(_0x298318){logger['info'](_0xd934('0xb'),_0x45bec9,_0xd934('0xc'));logger[_0xd934('0xd')](_0xd934('0xe'),_0x45bec9,_0xd934('0xc'),JSON['stringify'](_0x298318));if(_0x298318[_0xd934('0xf')]){if(_0x298318[_0xd934('0xf')]['code']===0x1f4){logger[_0xd934('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x45bec9,_0x298318[_0xd934('0xf')]['message']);return _0x5c1732(_0x298318[_0xd934('0xf')][_0xd934('0x10')]);}logger[_0xd934('0xf')](_0xd934('0xb'),_0x45bec9,_0x298318[_0xd934('0xf')]['message']);return _0x54d3e6(_0x298318[_0xd934('0xf')][_0xd934('0x10')]);}else{logger['info'](_0xd934('0xb'),_0x45bec9,'request\x20sent');_0x54d3e6(_0x298318[_0xd934('0x11')][_0xd934('0x10')]);}})[_0xd934('0x12')](function(_0x1dc1cc){logger[_0xd934('0xf')](_0xd934('0xb'),_0x45bec9,_0x1dc1cc);_0x5c1732(_0x1dc1cc);});});} \ No newline at end of file +var _0x6b01=['http','request','then','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x4ab2b4,_0x15de5f){var _0x1f8db8=function(_0x24ec3d){while(--_0x24ec3d){_0x4ab2b4['push'](_0x4ab2b4['shift']());}};_0x1f8db8(++_0x15de5f);}(_0x6b01,0x18e));var _0x16b0=function(_0x16c9f3,_0x4fe03f){_0x16c9f3=_0x16c9f3-0x0;var _0x47709f=_0x6b01[_0x16c9f3];return _0x47709f;};'use strict';var _=require(_0x16b0('0x0'));var util=require('util');var moment=require(_0x16b0('0x1'));var BPromise=require('bluebird');var rs=require(_0x16b0('0x2'));var fs=require('fs');var Redis=require(_0x16b0('0x3'));var db=require(_0x16b0('0x4'))['db'];var utils=require(_0x16b0('0x5'));var logger=require(_0x16b0('0x6'))(_0x16b0('0x7'));var config=require(_0x16b0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x16b0('0x9')][_0x16b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48dedb,_0x3d3aea,_0x135750){return new BPromise(function(_0x4510ce,_0x1820e9){return client[_0x16b0('0xb')](_0x48dedb,_0x135750)[_0x16b0('0xc')](function(_0x27b0e5){logger[_0x16b0('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d3aea,'request\x20sent');logger[_0x16b0('0xe')](_0x16b0('0xf'),_0x3d3aea,_0x16b0('0x10'),JSON[_0x16b0('0x11')](_0x27b0e5));if(_0x27b0e5[_0x16b0('0x12')]){if(_0x27b0e5[_0x16b0('0x12')][_0x16b0('0x13')]===0x1f4){logger[_0x16b0('0x12')](_0x16b0('0x14'),_0x3d3aea,_0x27b0e5['error'][_0x16b0('0x15')]);return _0x1820e9(_0x27b0e5[_0x16b0('0x12')]['message']);}logger[_0x16b0('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d3aea,_0x27b0e5[_0x16b0('0x12')][_0x16b0('0x15')]);return _0x4510ce(_0x27b0e5[_0x16b0('0x12')]['message']);}else{logger[_0x16b0('0xd')](_0x16b0('0x14'),_0x3d3aea,_0x16b0('0x10'));_0x4510ce(_0x27b0e5[_0x16b0('0x16')][_0x16b0('0x15')]);}})[_0x16b0('0x17')](function(_0x170f89){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d3aea,_0x170f89);_0x1820e9(_0x170f89);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index df2498d..93f0a6c 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0x34e8,0x12c));var _0x834e=function(_0x4f7c00,_0x4f6c4a){_0x4f7c00=_0x4f7c00-0x0;var _0x488d8a=_0x34e8[_0x4f7c00];return _0x488d8a;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','delete','/:id','destroy','exports'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0xedd9,0xfc));var _0x9edd=function(_0x3491ab,_0x13b16d){_0x3491ab=_0x3491ab-0x0;var _0x5ab8d2=_0xedd9[_0x3491ab];return _0x5ab8d2;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0xb')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router[_0x9edd('0xd')]('/:id',auth[_0x9edd('0x9')](),controller['update']);router[_0x9edd('0xe')](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);module[_0x9edd('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 8a17d0e..a529902 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js +++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f42=['customVariable','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x7f42,0x1dd));var _0x27f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f42[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x27f4('0x0'));module['exports']={'type':{'type':Sequelize[_0x27f4('0x1')](_0x27f4('0x2'),'variable',_0x27f4('0x3'),'keyValue'),'defaultValue':_0x27f4('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x27f4('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x27f4('0x2'),'variable',_0x27f4('0x3'))},'keyContent':{'type':Sequelize[_0x27f4('0x4')]},'idField':{'type':Sequelize[_0x27f4('0x4')]},'nameField':{'type':Sequelize[_0x27f4('0x4')]},'customField':{'type':Sequelize[_0x27f4('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x27f4('0x4')]}}; \ No newline at end of file +var _0x8d19=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','string','STRING'];(function(_0x1985bb,_0x21f79d){var _0x43641f=function(_0x58df76){while(--_0x58df76){_0x1985bb['push'](_0x1985bb['shift']());}};_0x43641f(++_0x21f79d);}(_0x8d19,0xd1));var _0x98d1=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x8d19[_0x715d76];return _0x48fe88;};'use strict';var Sequelize=require(_0x98d1('0x0'));module[_0x98d1('0x1')]={'type':{'type':Sequelize[_0x98d1('0x2')]('string',_0x98d1('0x3'),_0x98d1('0x4'),'keyValue'),'defaultValue':_0x98d1('0x5')},'content':{'type':Sequelize[_0x98d1('0x6')]},'key':{'type':Sequelize[_0x98d1('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x98d1('0x3'),_0x98d1('0x4'))},'keyContent':{'type':Sequelize[_0x98d1('0x6')]},'idField':{'type':Sequelize[_0x98d1('0x6')]},'nameField':{'type':Sequelize[_0x98d1('0x6')]},'customField':{'type':Sequelize[_0x98d1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x98d1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 916dccd..cae2df0 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0c1=['includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','merge','VIRTUAL','filter','options'];(function(_0x5e0162,_0x5a8f0a){var _0x147f4f=function(_0x34e01b){while(--_0x34e01b){_0x5e0162['push'](_0x5e0162['shift']());}};_0x147f4f(++_0x5a8f0a);}(_0xf0c1,0xe0));var _0x1f0c=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0xf0c1[_0x4521e3];return _0x46a272;};'use strict';var pdf=require(_0x1f0c('0x0'));var emlformat=require(_0x1f0c('0x1'));var rimraf=require(_0x1f0c('0x2'));var zipdir=require(_0x1f0c('0x3'));var jsonpatch=require(_0x1f0c('0x4'));var rp=require(_0x1f0c('0x5'));var moment=require('moment');var BPromise=require(_0x1f0c('0x6'));var Mustache=require(_0x1f0c('0x7'));var util=require(_0x1f0c('0x8'));var path=require(_0x1f0c('0x9'));var sox=require(_0x1f0c('0xa'));var csv=require('to-csv');var ejs=require(_0x1f0c('0xb'));var fs=require('fs');var _=require(_0x1f0c('0xc'));var squel=require('squel');var crypto=require(_0x1f0c('0xd'));var jsforce=require(_0x1f0c('0xe'));var deskjs=require(_0x1f0c('0xf'));var toCsv=require(_0x1f0c('0x10'));var querystring=require(_0x1f0c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f0c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f0c('0x13'));var logger=require('../../config/logger')(_0x1f0c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1f0c('0x15'))['db'];function respondWithStatusCode(_0x29c585,_0x5c6c65){_0x5c6c65=_0x5c6c65||0xcc;return function(_0xc83f24){if(_0xc83f24){return _0x29c585[_0x1f0c('0x16')](_0x5c6c65);}return _0x29c585[_0x1f0c('0x17')](_0x5c6c65)[_0x1f0c('0x18')]();};}function respondWithResult(_0x8246fe,_0x4bee90){_0x4bee90=_0x4bee90||0xc8;return function(_0x4425ad){if(_0x4425ad){return _0x8246fe['status'](_0x4bee90)[_0x1f0c('0x19')](_0x4425ad);}};}function respondWithFilteredResult(_0x248c2c,_0x197848){return function(_0x2ff8ac){if(_0x2ff8ac){var _0x2e29b2=_0x2ff8ac[_0x1f0c('0x1a')],_0x235cfb=_0x197848[_0x1f0c('0x1b')],_0x4a4134=_0x197848[_0x1f0c('0x1b')]+_0x197848['limit'],_0x487b3b;if(_0x4a4134>=_0x2e29b2){_0x4a4134=_0x2e29b2;_0x487b3b=0xc8;}else{_0x487b3b=0xce;}_0x248c2c['status'](_0x487b3b);return _0x248c2c[_0x1f0c('0x1c')](_0x1f0c('0x1d'),_0x235cfb+'-'+_0x4a4134+'/'+_0x2e29b2)[_0x1f0c('0x19')](_0x2ff8ac);}return null;};}function patchUpdates(_0x49168b){return function(_0x4ba88b){try{jsonpatch[_0x1f0c('0x1e')](_0x4ba88b,_0x49168b,!![]);}catch(_0x53e736){return BPromise['reject'](_0x53e736);}return _0x4ba88b['save']();};}function saveUpdates(_0x365fc5,_0xc0e27c){return function(_0xe0324a){if(_0xe0324a){return _0xe0324a[_0x1f0c('0x1f')](_0x365fc5)[_0x1f0c('0x20')](function(_0x47dbb6){return _0x47dbb6;});}return null;};}function removeEntity(_0x56e9f8,_0x55f74f){return function(_0x3c1ab){if(_0x3c1ab){return _0x3c1ab[_0x1f0c('0x21')]()[_0x1f0c('0x20')](function(){_0x56e9f8[_0x1f0c('0x17')](0xcc)[_0x1f0c('0x18')]();});}};}function handleEntityNotFound(_0x399790,_0xca68ef){return function(_0x333c42){if(!_0x333c42){_0x399790[_0x1f0c('0x16')](0x194);}return _0x333c42;};}function handleError(_0x40fdd6,_0x33088d){_0x33088d=_0x33088d||0x1f4;return function(_0x19a60c){logger[_0x1f0c('0x22')](_0x19a60c[_0x1f0c('0x23')]);if(_0x19a60c[_0x1f0c('0x24')]){delete _0x19a60c[_0x1f0c('0x24')];}_0x40fdd6['status'](_0x33088d)['send'](_0x19a60c);};}exports[_0x1f0c('0x25')]=function(_0x2296e2,_0x55031a){var _0x139b59={},_0x2a1a3d={},_0x2b8a1e={'count':0x0,'rows':[]};var _0x18eea8=_[_0x1f0c('0x26')](db[_0x1f0c('0x27')][_0x1f0c('0x28')],function(_0x244be8){return{'name':_0x244be8[_0x1f0c('0x29')],'type':_0x244be8[_0x1f0c('0x2a')][_0x1f0c('0x2b')]};});_0x2a1a3d[_0x1f0c('0x2c')]=_['map'](_0x18eea8,_0x1f0c('0x24'));_0x2a1a3d[_0x1f0c('0x2d')]=_['keys'](_0x2296e2['query']);_0x2a1a3d[_0x1f0c('0x2e')]=_[_0x1f0c('0x2f')](_0x2a1a3d[_0x1f0c('0x2c')],_0x2a1a3d['query']);_0x139b59[_0x1f0c('0x30')]=_[_0x1f0c('0x2f')](_0x2a1a3d[_0x1f0c('0x2c')],qs[_0x1f0c('0x31')](_0x2296e2['query']['fields']));_0x139b59[_0x1f0c('0x30')]=_0x139b59[_0x1f0c('0x30')][_0x1f0c('0x32')]?_0x139b59[_0x1f0c('0x30')]:_0x2a1a3d[_0x1f0c('0x2c')];if(!_0x2296e2[_0x1f0c('0x2d')][_0x1f0c('0x33')]('nolimit')){_0x139b59['limit']=qs['limit'](_0x2296e2[_0x1f0c('0x2d')][_0x1f0c('0x34')]);_0x139b59[_0x1f0c('0x1b')]=qs[_0x1f0c('0x1b')](_0x2296e2['query'][_0x1f0c('0x1b')]);}_0x139b59[_0x1f0c('0x35')]=qs['sort'](_0x2296e2[_0x1f0c('0x2d')]['sort']);_0x139b59[_0x1f0c('0x36')]=qs[_0x1f0c('0x2e')](_[_0x1f0c('0x37')](_0x2296e2[_0x1f0c('0x2d')],_0x2a1a3d[_0x1f0c('0x2e')]));if(_0x2296e2[_0x1f0c('0x2d')]['filter']){_0x139b59[_0x1f0c('0x36')]=_[_0x1f0c('0x38')](_0x139b59[_0x1f0c('0x36')],{'$or':_['map'](_0x18eea8,function(_0x5c8c48){if(_0x5c8c48[_0x1f0c('0x2a')]!==_0x1f0c('0x39')){var _0x49c9c9={};_0x49c9c9[_0x5c8c48[_0x1f0c('0x24')]]={'$like':'%'+_0x2296e2[_0x1f0c('0x2d')][_0x1f0c('0x3a')]+'%'};return _0x49c9c9;}})});}_0x139b59=_[_0x1f0c('0x38')]({},_0x139b59,_0x2296e2[_0x1f0c('0x3b')]);var _0x399d03={'where':_0x139b59[_0x1f0c('0x36')]};return db[_0x1f0c('0x27')][_0x1f0c('0x1a')](_0x399d03)[_0x1f0c('0x20')](function(_0x284d12){_0x2b8a1e[_0x1f0c('0x1a')]=_0x284d12;if(_0x2296e2[_0x1f0c('0x2d')][_0x1f0c('0x3c')]){_0x139b59[_0x1f0c('0x3d')]=[{'all':!![]}];}return db[_0x1f0c('0x27')][_0x1f0c('0x3e')](_0x139b59);})[_0x1f0c('0x20')](function(_0x22644e){_0x2b8a1e[_0x1f0c('0x3f')]=_0x22644e;return _0x2b8a1e;})[_0x1f0c('0x20')](respondWithFilteredResult(_0x55031a,_0x139b59))[_0x1f0c('0x40')](handleError(_0x55031a,null));};exports[_0x1f0c('0x41')]=function(_0x4fbf9d,_0x3ace6a){var _0xe8209={'raw':!![],'where':{'id':_0x4fbf9d[_0x1f0c('0x42')]['id']}},_0x1a22ce={};_0x1a22ce[_0x1f0c('0x2c')]=_[_0x1f0c('0x43')](db[_0x1f0c('0x27')]['rawAttributes']);_0x1a22ce[_0x1f0c('0x2d')]=_['keys'](_0x4fbf9d[_0x1f0c('0x2d')]);_0x1a22ce[_0x1f0c('0x2e')]=_[_0x1f0c('0x2f')](_0x1a22ce['model'],_0x1a22ce[_0x1f0c('0x2d')]);_0xe8209[_0x1f0c('0x30')]=_[_0x1f0c('0x2f')](_0x1a22ce[_0x1f0c('0x2c')],qs['fields'](_0x4fbf9d[_0x1f0c('0x2d')][_0x1f0c('0x31')]));_0xe8209[_0x1f0c('0x30')]=_0xe8209[_0x1f0c('0x30')]['length']?_0xe8209[_0x1f0c('0x30')]:_0x1a22ce['model'];if(_0x4fbf9d[_0x1f0c('0x2d')]['includeAll']){_0xe8209['include']=[{'all':!![]}];}_0xe8209=_[_0x1f0c('0x38')]({},_0xe8209,_0x4fbf9d['options']);return db[_0x1f0c('0x27')][_0x1f0c('0x44')](_0xe8209)[_0x1f0c('0x20')](handleEntityNotFound(_0x3ace6a,null))[_0x1f0c('0x20')](respondWithResult(_0x3ace6a,null))['catch'](handleError(_0x3ace6a,null));};exports[_0x1f0c('0x45')]=function(_0xb3d97,_0x8bd6e1){return db[_0x1f0c('0x27')][_0x1f0c('0x45')](_0xb3d97[_0x1f0c('0x46')],{})[_0x1f0c('0x20')](respondWithResult(_0x8bd6e1,0xc9))[_0x1f0c('0x40')](handleError(_0x8bd6e1,null));};exports[_0x1f0c('0x1f')]=function(_0x4e6242,_0x407f31){if(_0x4e6242[_0x1f0c('0x46')]['id']){delete _0x4e6242[_0x1f0c('0x46')]['id'];}return db[_0x1f0c('0x27')]['find']({'where':{'id':_0x4e6242['params']['id']}})[_0x1f0c('0x20')](handleEntityNotFound(_0x407f31,null))[_0x1f0c('0x20')](saveUpdates(_0x4e6242[_0x1f0c('0x46')],null))['then'](respondWithResult(_0x407f31,null))[_0x1f0c('0x40')](handleError(_0x407f31,null));};exports[_0x1f0c('0x21')]=function(_0x4de65d,_0x4e507f){return db[_0x1f0c('0x27')][_0x1f0c('0x44')]({'where':{'id':_0x4de65d['params']['id']}})[_0x1f0c('0x20')](handleEntityNotFound(_0x4e507f,null))[_0x1f0c('0x20')](removeEntity(_0x4e507f,null))[_0x1f0c('0x40')](handleError(_0x4e507f,null));}; \ No newline at end of file +var _0xe1a0=['bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','FreshdeskField','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x476895,_0x3d4b9f){var _0x2bd941=function(_0x19e919){while(--_0x19e919){_0x476895['push'](_0x476895['shift']());}};_0x2bd941(++_0x3d4b9f);}(_0xe1a0,0x131));var _0x0e1a=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0xe1a0[_0x4de9e8];return _0x4db0de;};'use strict';var pdf=require(_0x0e1a('0x0'));var emlformat=require(_0x0e1a('0x1'));var rimraf=require(_0x0e1a('0x2'));var zipdir=require(_0x0e1a('0x3'));var jsonpatch=require(_0x0e1a('0x4'));var rp=require(_0x0e1a('0x5'));var moment=require(_0x0e1a('0x6'));var BPromise=require(_0x0e1a('0x7'));var Mustache=require(_0x0e1a('0x8'));var util=require(_0x0e1a('0x9'));var path=require(_0x0e1a('0xa'));var sox=require('sox');var csv=require(_0x0e1a('0xb'));var ejs=require(_0x0e1a('0xc'));var fs=require('fs');var _=require(_0x0e1a('0xd'));var squel=require(_0x0e1a('0xe'));var crypto=require(_0x0e1a('0xf'));var jsforce=require(_0x0e1a('0x10'));var deskjs=require(_0x0e1a('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0e1a('0x12'));var Papa=require(_0x0e1a('0x13'));var Redis=require(_0x0e1a('0x14'));var authService=require(_0x0e1a('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x0e1a('0x16'));var hardwareService=require(_0x0e1a('0x17'));var logger=require(_0x0e1a('0x18'))(_0x0e1a('0x19'));var utils=require(_0x0e1a('0x1a'));var config=require(_0x0e1a('0x1b'));var db=require(_0x0e1a('0x1c'))['db'];function respondWithStatusCode(_0x126882,_0x5b06c9){_0x5b06c9=_0x5b06c9||0xcc;return function(_0x33e9bc){if(_0x33e9bc){return _0x126882['sendStatus'](_0x5b06c9);}return _0x126882[_0x0e1a('0x1d')](_0x5b06c9)[_0x0e1a('0x1e')]();};}function respondWithResult(_0x565e85,_0x3bc004){_0x3bc004=_0x3bc004||0xc8;return function(_0x409589){if(_0x409589){return _0x565e85['status'](_0x3bc004)['json'](_0x409589);}};}function respondWithFilteredResult(_0x4e6d11,_0x56b9e2){return function(_0x15402a){if(_0x15402a){var _0x3a0a69=_0x15402a[_0x0e1a('0x1f')],_0xa28454=_0x56b9e2['offset'],_0x553d4d=_0x56b9e2[_0x0e1a('0x20')]+_0x56b9e2[_0x0e1a('0x21')],_0x54f778;if(_0x553d4d>=_0x3a0a69){_0x553d4d=_0x3a0a69;_0x54f778=0xc8;}else{_0x54f778=0xce;}_0x4e6d11[_0x0e1a('0x1d')](_0x54f778);return _0x4e6d11[_0x0e1a('0x22')](_0x0e1a('0x23'),_0xa28454+'-'+_0x553d4d+'/'+_0x3a0a69)['json'](_0x15402a);}return null;};}function patchUpdates(_0x1eb286){return function(_0x6865a1){try{jsonpatch[_0x0e1a('0x24')](_0x6865a1,_0x1eb286,!![]);}catch(_0x52c74a){return BPromise['reject'](_0x52c74a);}return _0x6865a1[_0x0e1a('0x25')]();};}function saveUpdates(_0x58a256,_0x3843b0){return function(_0x5e3d1b){if(_0x5e3d1b){return _0x5e3d1b[_0x0e1a('0x26')](_0x58a256)[_0x0e1a('0x27')](function(_0x14e425){return _0x14e425;});}return null;};}function removeEntity(_0x4ca0e3,_0x4a796a){return function(_0x1e7d60){if(_0x1e7d60){return _0x1e7d60[_0x0e1a('0x28')]()[_0x0e1a('0x27')](function(){_0x4ca0e3[_0x0e1a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52d91f,_0x582983){return function(_0x3a39c7){if(!_0x3a39c7){_0x52d91f[_0x0e1a('0x29')](0x194);}return _0x3a39c7;};}function handleError(_0x6fe22e,_0x5e789e){_0x5e789e=_0x5e789e||0x1f4;return function(_0x2c008d){logger[_0x0e1a('0x2a')](_0x2c008d[_0x0e1a('0x2b')]);if(_0x2c008d[_0x0e1a('0x2c')]){delete _0x2c008d['name'];}_0x6fe22e[_0x0e1a('0x1d')](_0x5e789e)[_0x0e1a('0x2d')](_0x2c008d);};}exports['index']=function(_0x42f4bb,_0x7594d5){var _0x2cb0d4={},_0x5bb487={},_0x50e763={'count':0x0,'rows':[]};var _0x94e20c=_[_0x0e1a('0x2e')](db[_0x0e1a('0x2f')][_0x0e1a('0x30')],function(_0x542153){return{'name':_0x542153['fieldName'],'type':_0x542153[_0x0e1a('0x31')][_0x0e1a('0x32')]};});_0x5bb487[_0x0e1a('0x33')]=_[_0x0e1a('0x2e')](_0x94e20c,_0x0e1a('0x2c'));_0x5bb487[_0x0e1a('0x34')]=_[_0x0e1a('0x35')](_0x42f4bb[_0x0e1a('0x34')]);_0x5bb487[_0x0e1a('0x36')]=_['intersection'](_0x5bb487[_0x0e1a('0x33')],_0x5bb487[_0x0e1a('0x34')]);_0x2cb0d4[_0x0e1a('0x37')]=_[_0x0e1a('0x38')](_0x5bb487[_0x0e1a('0x33')],qs['fields'](_0x42f4bb[_0x0e1a('0x34')][_0x0e1a('0x39')]));_0x2cb0d4[_0x0e1a('0x37')]=_0x2cb0d4['attributes'][_0x0e1a('0x3a')]?_0x2cb0d4['attributes']:_0x5bb487['model'];if(!_0x42f4bb[_0x0e1a('0x34')][_0x0e1a('0x3b')]('nolimit')){_0x2cb0d4[_0x0e1a('0x21')]=qs[_0x0e1a('0x21')](_0x42f4bb[_0x0e1a('0x34')]['limit']);_0x2cb0d4[_0x0e1a('0x20')]=qs['offset'](_0x42f4bb[_0x0e1a('0x34')]['offset']);}_0x2cb0d4[_0x0e1a('0x3c')]=qs[_0x0e1a('0x3d')](_0x42f4bb[_0x0e1a('0x34')][_0x0e1a('0x3d')]);_0x2cb0d4[_0x0e1a('0x3e')]=qs[_0x0e1a('0x36')](_[_0x0e1a('0x3f')](_0x42f4bb['query'],_0x5bb487[_0x0e1a('0x36')]));if(_0x42f4bb[_0x0e1a('0x34')][_0x0e1a('0x40')]){_0x2cb0d4[_0x0e1a('0x3e')]=_[_0x0e1a('0x41')](_0x2cb0d4['where'],{'$or':_[_0x0e1a('0x2e')](_0x94e20c,function(_0x5d6cc7){if(_0x5d6cc7['type']!==_0x0e1a('0x42')){var _0x4c57c8={};_0x4c57c8[_0x5d6cc7[_0x0e1a('0x2c')]]={'$like':'%'+_0x42f4bb[_0x0e1a('0x34')]['filter']+'%'};return _0x4c57c8;}})});}_0x2cb0d4=_[_0x0e1a('0x41')]({},_0x2cb0d4,_0x42f4bb['options']);var _0x52e497={'where':_0x2cb0d4[_0x0e1a('0x3e')]};return db[_0x0e1a('0x2f')][_0x0e1a('0x1f')](_0x52e497)[_0x0e1a('0x27')](function(_0x1948f6){_0x50e763[_0x0e1a('0x1f')]=_0x1948f6;if(_0x42f4bb[_0x0e1a('0x34')][_0x0e1a('0x43')]){_0x2cb0d4['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x0e1a('0x44')](_0x2cb0d4);})[_0x0e1a('0x27')](function(_0x96b42e){_0x50e763[_0x0e1a('0x45')]=_0x96b42e;return _0x50e763;})['then'](respondWithFilteredResult(_0x7594d5,_0x2cb0d4))[_0x0e1a('0x46')](handleError(_0x7594d5,null));};exports[_0x0e1a('0x47')]=function(_0x14c645,_0x280e70){var _0xf820ab={'raw':!![],'where':{'id':_0x14c645[_0x0e1a('0x48')]['id']}},_0x49b91c={};_0x49b91c[_0x0e1a('0x33')]=_[_0x0e1a('0x35')](db[_0x0e1a('0x2f')][_0x0e1a('0x30')]);_0x49b91c[_0x0e1a('0x34')]=_['keys'](_0x14c645[_0x0e1a('0x34')]);_0x49b91c[_0x0e1a('0x36')]=_[_0x0e1a('0x38')](_0x49b91c[_0x0e1a('0x33')],_0x49b91c['query']);_0xf820ab[_0x0e1a('0x37')]=_[_0x0e1a('0x38')](_0x49b91c[_0x0e1a('0x33')],qs['fields'](_0x14c645[_0x0e1a('0x34')]['fields']));_0xf820ab[_0x0e1a('0x37')]=_0xf820ab['attributes']['length']?_0xf820ab[_0x0e1a('0x37')]:_0x49b91c['model'];if(_0x14c645[_0x0e1a('0x34')][_0x0e1a('0x43')]){_0xf820ab[_0x0e1a('0x49')]=[{'all':!![]}];}_0xf820ab=_['merge']({},_0xf820ab,_0x14c645[_0x0e1a('0x4a')]);return db['FreshdeskField']['find'](_0xf820ab)['then'](handleEntityNotFound(_0x280e70,null))[_0x0e1a('0x27')](respondWithResult(_0x280e70,null))[_0x0e1a('0x46')](handleError(_0x280e70,null));};exports[_0x0e1a('0x4b')]=function(_0x22cd82,_0x2fc0bf){return db[_0x0e1a('0x2f')][_0x0e1a('0x4b')](_0x22cd82[_0x0e1a('0x4c')],{})['then'](respondWithResult(_0x2fc0bf,0xc9))[_0x0e1a('0x46')](handleError(_0x2fc0bf,null));};exports[_0x0e1a('0x26')]=function(_0x1b164c,_0x18b054){if(_0x1b164c['body']['id']){delete _0x1b164c['body']['id'];}return db[_0x0e1a('0x2f')][_0x0e1a('0x4d')]({'where':{'id':_0x1b164c[_0x0e1a('0x48')]['id']}})['then'](handleEntityNotFound(_0x18b054,null))[_0x0e1a('0x27')](saveUpdates(_0x1b164c[_0x0e1a('0x4c')],null))['then'](respondWithResult(_0x18b054,null))[_0x0e1a('0x46')](handleError(_0x18b054,null));};exports[_0x0e1a('0x28')]=function(_0x5babb2,_0x344452){return db[_0x0e1a('0x2f')][_0x0e1a('0x4d')]({'where':{'id':_0x5babb2['params']['id']}})[_0x0e1a('0x27')](handleEntityNotFound(_0x344452,null))[_0x0e1a('0x27')](removeEntity(_0x344452,null))[_0x0e1a('0x46')](handleError(_0x344452,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index e7183f5..f390b65 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.model.js +++ b/server/api/intFreshdeskField/intFreshdeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec70=['define','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','../../config/logger','api','bluebird','request-promise','path','./intFreshdeskField.attributes','exports'];(function(_0x3d6693,_0x306de0){var _0xf914c0=function(_0x241fb7){while(--_0x241fb7){_0x3d6693['push'](_0x3d6693['shift']());}};_0xf914c0(++_0x306de0);}(_0xec70,0xac));var _0x0ec7=function(_0x59831f,_0x5154ca){_0x59831f=_0x59831f-0x0;var _0x11f70c=_0xec70[_0x59831f];return _0x11f70c;};'use strict';var _=require(_0x0ec7('0x0'));var util=require('util');var logger=require(_0x0ec7('0x1'))(_0x0ec7('0x2'));var moment=require('moment');var BPromise=require(_0x0ec7('0x3'));var rp=require(_0x0ec7('0x4'));var fs=require('fs');var path=require(_0x0ec7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0ec7('0x6'));module[_0x0ec7('0x7')]=function(_0x473572,_0x18cfaf){return _0x473572[_0x0ec7('0x8')]('FreshdeskField',attributes,{'tableName':_0x0ec7('0x9'),'paranoid':![],'indexes':[{'name':_0x0ec7('0xa'),'fields':[_0x0ec7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbd7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xfbd7,0x12f));var _0x7fbd=function(_0x30c3c2,_0x330cca){_0x30c3c2=_0x30c3c2-0x0;var _0x738110=_0xfbd7[_0x30c3c2];return _0x738110;};'use strict';var _=require(_0x7fbd('0x0'));var util=require(_0x7fbd('0x1'));var logger=require(_0x7fbd('0x2'))(_0x7fbd('0x3'));var moment=require(_0x7fbd('0x4'));var BPromise=require(_0x7fbd('0x5'));var rp=require(_0x7fbd('0x6'));var fs=require('fs');var path=require(_0x7fbd('0x7'));var rimraf=require(_0x7fbd('0x8'));var config=require(_0x7fbd('0x9'));var attributes=require(_0x7fbd('0xa'));module[_0x7fbd('0xb')]=function(_0x59f10a,_0x5def28){return _0x59f10a[_0x7fbd('0xc')](_0x7fbd('0xd'),attributes,{'tableName':_0x7fbd('0xe'),'paranoid':![],'indexes':[{'name':_0x7fbd('0xf'),'fields':[_0x7fbd('0x10'),_0x7fbd('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 09679be..2d2ab2c 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x236540,_0x1d01ef){_0x236540=_0x236540-0x0;var _0x3daf12=_0x7a54[_0x236540];return _0x3daf12;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x36bb89,_0x93f0f1){_0x36bb89=_0x36bb89-0x0;var _0x3f6ede=_0x7a54[_0x36bb89];return _0x3f6ede;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 8f08bc8..2fc7bb2 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fa4=['addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post'];(function(_0x2550c0,_0x48fb19){var _0x2e8666=function(_0x7ec751){while(--_0x7ec751){_0x2550c0['push'](_0x2550c0['shift']());}};_0x2e8666(++_0x48fb19);}(_0x9fa4,0x69));var _0x49fa=function(_0x4e129f,_0x3f4fa5){_0x4e129f=_0x4e129f-0x0;var _0x51feb6=_0x9fa4[_0x4e129f];return _0x51feb6;};'use strict';var multer=require(_0x49fa('0x0'));var util=require(_0x49fa('0x1'));var path=require('path');var timeout=require(_0x49fa('0x2'));var express=require(_0x49fa('0x3'));var router=express['Router']();var auth=require(_0x49fa('0x4'));var interaction=require(_0x49fa('0x5'));var config=require(_0x49fa('0x6'));var controller=require(_0x49fa('0x7'));router[_0x49fa('0x8')]('/',auth[_0x49fa('0x9')](),controller['index']);router[_0x49fa('0x8')](_0x49fa('0xa'),auth[_0x49fa('0x9')](),controller['show']);router[_0x49fa('0x8')](_0x49fa('0xb'),auth[_0x49fa('0x9')](),controller[_0x49fa('0xc')]);router[_0x49fa('0x8')]('/:id/fields',auth[_0x49fa('0x9')](),controller[_0x49fa('0xd')]);router[_0x49fa('0xe')]('/',auth[_0x49fa('0x9')](),controller['create']);router['post'](_0x49fa('0xb'),auth[_0x49fa('0x9')](),controller[_0x49fa('0xf')]);router[_0x49fa('0x10')](_0x49fa('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x49fa('0x11')](_0x49fa('0xa'),auth['isAuthenticated'](),controller[_0x49fa('0x12')]);module[_0x49fa('0x13')]=router; \ No newline at end of file +var _0x55b1=['show','/:id/configurations','/:id/fields','getFields','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x55b1,0xd1));var _0x155b=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x55b1[_0x1bc0ae];return _0x501104;};'use strict';var multer=require(_0x155b('0x0'));var util=require(_0x155b('0x1'));var path=require('path');var timeout=require(_0x155b('0x2'));var express=require(_0x155b('0x3'));var router=express[_0x155b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x155b('0x5'));var config=require(_0x155b('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x155b('0x7')]('/',auth['isAuthenticated'](),controller[_0x155b('0x8')]);router[_0x155b('0x7')](_0x155b('0x9'),auth[_0x155b('0xa')](),controller[_0x155b('0xb')]);router['get'](_0x155b('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x155b('0x7')](_0x155b('0xd'),auth[_0x155b('0xa')](),controller[_0x155b('0xe')]);router[_0x155b('0xf')]('/',auth['isAuthenticated'](),controller[_0x155b('0x10')]);router[_0x155b('0xf')](_0x155b('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x155b('0x9'),auth['isAuthenticated'](),controller[_0x155b('0x11')]);router['delete'](_0x155b('0x9'),auth['isAuthenticated'](),controller[_0x155b('0x12')]);module[_0x155b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index c8bc3da..7615594 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee87=['remoteUri','exports','STRING','username'];(function(_0x56bccb,_0x4ea5dc){var _0x20ef68=function(_0xb8d8ba){while(--_0xb8d8ba){_0x56bccb['push'](_0x56bccb['shift']());}};_0x20ef68(++_0x4ea5dc);}(_0xee87,0x10d));var _0x7ee8=function(_0x31f552,_0x18b692){_0x31f552=_0x31f552-0x0;var _0x5451e8=_0xee87[_0x31f552];return _0x5451e8;};'use strict';var Sequelize=require('sequelize');module[_0x7ee8('0x0')]={'name':{'type':Sequelize[_0x7ee8('0x1')]},'description':{'type':Sequelize[_0x7ee8('0x1')]},'username':{'type':Sequelize[_0x7ee8('0x1')],'unique':_0x7ee8('0x2')},'apiKey':{'type':Sequelize[_0x7ee8('0x1')]},'remoteUri':{'type':Sequelize[_0x7ee8('0x1')],'unique':_0x7ee8('0x3')},'serverUrl':{'type':Sequelize[_0x7ee8('0x1')]}}; \ No newline at end of file +var _0x9e63=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1906a6,_0x3a4d3a){var _0x573d97=function(_0x2ec203){while(--_0x2ec203){_0x1906a6['push'](_0x1906a6['shift']());}};_0x573d97(++_0x3a4d3a);}(_0x9e63,0x65));var _0x39e6=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x9e63[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x39e6('0x0'));module[_0x39e6('0x1')]={'name':{'type':Sequelize[_0x39e6('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x39e6('0x2')],'unique':_0x39e6('0x3')},'apiKey':{'type':Sequelize[_0x39e6('0x2')]},'remoteUri':{'type':Sequelize[_0x39e6('0x2')],'unique':_0x39e6('0x4')},'serverUrl':{'type':Sequelize[_0x39e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index a47ba61..b5e445f 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8530=['substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','count','offset','limit','set','apply','reject','destroy','stack','name','map','FreshsalesAccount','fieldName','type','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','update','getConfigurations','options','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','FreshsalesConfiguration','FreshsalesField','Descriptions','getFields','username','remoteUri','slice'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x8530,0xf7));var _0x0853=function(_0x2207d5,_0x69b287){_0x2207d5=_0x2207d5-0x0;var _0x17db2a=_0x8530[_0x2207d5];return _0x17db2a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0853('0x0'));var rimraf=require(_0x0853('0x1'));var zipdir=require(_0x0853('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0853('0x3'));var moment=require(_0x0853('0x4'));var BPromise=require(_0x0853('0x5'));var Mustache=require(_0x0853('0x6'));var util=require(_0x0853('0x7'));var path=require(_0x0853('0x8'));var sox=require(_0x0853('0x9'));var csv=require(_0x0853('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0853('0xb'));var squel=require(_0x0853('0xc'));var crypto=require(_0x0853('0xd'));var jsforce=require(_0x0853('0xe'));var deskjs=require(_0x0853('0xf'));var toCsv=require(_0x0853('0xa'));var querystring=require(_0x0853('0x10'));var Papa=require('papaparse');var Redis=require(_0x0853('0x11'));var authService=require(_0x0853('0x12'));var qs=require(_0x0853('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0853('0x14'));var logger=require(_0x0853('0x15'))(_0x0853('0x16'));var utils=require('../../config/utils');var config=require(_0x0853('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0853('0x18'));var jayson=require(_0x0853('0x19'));var client=jayson[_0x0853('0x1a')][_0x0853('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4ffe99,_0x40de25,_0x5218fc){if(_0x5218fc){var _0x2f1c7a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f1c7a[_0x0853('0x1c')](_0x40de25)){return _0x4ffe99;}else{throw new db[(_0x0853('0x1d'))][(_0x0853('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4ffe99;}}function respondWithRpcPromise(_0x3f4852,_0x29d6f1,_0x59774c,_0x4fc49f){return new BPromise(function(_0x45e7cd,_0x761c7f){var _0x305762=_0x4fc49f||client;return _0x305762[_0x0853('0x1f')](_0x3f4852,_0x59774c)[_0x0853('0x20')](function(_0x34e9f2){logger[_0x0853('0x21')]('FreshsalesAccount,\x20%s,\x20%s',_0x29d6f1,_0x0853('0x22'));logger[_0x0853('0x23')](_0x0853('0x24'),_0x29d6f1,'request\x20sent',JSON[_0x0853('0x25')](_0x34e9f2));if(_0x34e9f2[_0x0853('0x26')]){if(_0x34e9f2['error'][_0x0853('0x27')]===0x1f4){logger['error'](_0x0853('0x28'),_0x29d6f1,_0x34e9f2[_0x0853('0x26')][_0x0853('0x29')]);return _0x761c7f(_0x34e9f2[_0x0853('0x26')][_0x0853('0x29')]);}logger[_0x0853('0x26')](_0x0853('0x28'),_0x29d6f1,_0x34e9f2[_0x0853('0x26')][_0x0853('0x29')]);return _0x45e7cd(_0x34e9f2['error'][_0x0853('0x29')]);}else{logger[_0x0853('0x21')](_0x0853('0x28'),_0x29d6f1,_0x0853('0x22'));_0x45e7cd(_0x34e9f2[_0x0853('0x2a')]['message']);}})['catch'](function(_0x39072b){logger['error'](_0x0853('0x28'),_0x29d6f1,_0x39072b);_0x761c7f(_0x39072b);});});}function respondWithStatusCode(_0x53466f,_0x5aec8b){_0x5aec8b=_0x5aec8b||0xcc;return function(_0x588774){if(_0x588774){return _0x53466f[_0x0853('0x2b')](_0x5aec8b);}return _0x53466f['status'](_0x5aec8b)[_0x0853('0x2c')]();};}function respondWithResult(_0x2e9ef1,_0x35fac1){_0x35fac1=_0x35fac1||0xc8;return function(_0x420a77){if(_0x420a77){return _0x2e9ef1[_0x0853('0x2d')](_0x35fac1)[_0x0853('0x2e')](_0x420a77);}};}function respondWithFilteredResult(_0x5c7e6f,_0x385dd3){return function(_0x2e951e){if(_0x2e951e){var _0x18fb0e=_0x2e951e[_0x0853('0x2f')],_0x1d59de=_0x385dd3[_0x0853('0x30')],_0xacb6cc=_0x385dd3['offset']+_0x385dd3[_0x0853('0x31')],_0x3337e7;if(_0xacb6cc>=_0x18fb0e){_0xacb6cc=_0x18fb0e;_0x3337e7=0xc8;}else{_0x3337e7=0xce;}_0x5c7e6f[_0x0853('0x2d')](_0x3337e7);return _0x5c7e6f[_0x0853('0x32')]('Content-Range',_0x1d59de+'-'+_0xacb6cc+'/'+_0x18fb0e)['json'](_0x2e951e);}return null;};}function patchUpdates(_0x5a0f72){return function(_0x2f57f2){try{jsonpatch[_0x0853('0x33')](_0x2f57f2,_0x5a0f72,!![]);}catch(_0x112c99){return BPromise[_0x0853('0x34')](_0x112c99);}return _0x2f57f2['save']();};}function saveUpdates(_0x4e352b,_0x5997e1){return function(_0x75cc48){if(_0x75cc48){return _0x75cc48['update'](_0x4e352b)[_0x0853('0x20')](function(_0x23aa61){return _0x23aa61;});}return null;};}function removeEntity(_0x558d02,_0x297eb4){return function(_0x5b85fe){if(_0x5b85fe){return _0x5b85fe[_0x0853('0x35')]()['then'](function(){_0x558d02[_0x0853('0x2d')](0xcc)[_0x0853('0x2c')]();});}};}function handleEntityNotFound(_0x1bdf50,_0x26e2f9){return function(_0x4ae080){if(!_0x4ae080){_0x1bdf50[_0x0853('0x2b')](0x194);}return _0x4ae080;};}function handleError(_0x384180,_0x5e9292){_0x5e9292=_0x5e9292||0x1f4;return function(_0x3e3852){logger['error'](_0x3e3852[_0x0853('0x36')]);if(_0x3e3852[_0x0853('0x37')]){delete _0x3e3852[_0x0853('0x37')];}_0x384180['status'](_0x5e9292)['send'](_0x3e3852);};}exports['index']=function(_0x4cdbf6,_0x50d5c7){var _0x20ef50={},_0x587794={},_0x4a913e={'count':0x0,'rows':[]};var _0x40e36a=_[_0x0853('0x38')](db[_0x0853('0x39')]['rawAttributes'],function(_0x449395){return{'name':_0x449395[_0x0853('0x3a')],'type':_0x449395[_0x0853('0x3b')]['key']};});_0x587794['model']=_[_0x0853('0x38')](_0x40e36a,_0x0853('0x37'));_0x587794[_0x0853('0x3c')]=_['keys'](_0x4cdbf6['query']);_0x587794[_0x0853('0x3d')]=_['intersection'](_0x587794['model'],_0x587794['query']);_0x20ef50['attributes']=_[_0x0853('0x3e')](_0x587794[_0x0853('0x3f')],qs[_0x0853('0x40')](_0x4cdbf6[_0x0853('0x3c')][_0x0853('0x40')]));_0x20ef50['attributes']=_0x20ef50[_0x0853('0x41')][_0x0853('0x42')]?_0x20ef50[_0x0853('0x41')]:_0x587794[_0x0853('0x3f')];if(!_0x4cdbf6[_0x0853('0x3c')]['hasOwnProperty'](_0x0853('0x43'))){_0x20ef50[_0x0853('0x31')]=qs['limit'](_0x4cdbf6[_0x0853('0x3c')][_0x0853('0x31')]);_0x20ef50['offset']=qs[_0x0853('0x30')](_0x4cdbf6[_0x0853('0x3c')][_0x0853('0x30')]);}_0x20ef50[_0x0853('0x44')]=qs['sort'](_0x4cdbf6['query'][_0x0853('0x45')]);_0x20ef50[_0x0853('0x46')]=qs[_0x0853('0x3d')](_[_0x0853('0x47')](_0x4cdbf6[_0x0853('0x3c')],_0x587794[_0x0853('0x3d')]));if(_0x4cdbf6[_0x0853('0x3c')][_0x0853('0x48')]){_0x20ef50[_0x0853('0x46')]=_[_0x0853('0x49')](_0x20ef50[_0x0853('0x46')],{'$or':_[_0x0853('0x38')](_0x40e36a,function(_0x1b6525){if(_0x1b6525[_0x0853('0x3b')]!==_0x0853('0x4a')){var _0xef4894={};_0xef4894[_0x1b6525[_0x0853('0x37')]]={'$like':'%'+_0x4cdbf6[_0x0853('0x3c')][_0x0853('0x48')]+'%'};return _0xef4894;}})});}_0x20ef50=_[_0x0853('0x49')]({},_0x20ef50,_0x4cdbf6['options']);var _0x57ff74={'where':_0x20ef50[_0x0853('0x46')]};return db[_0x0853('0x39')][_0x0853('0x2f')](_0x57ff74)[_0x0853('0x20')](function(_0x41510f){_0x4a913e[_0x0853('0x2f')]=_0x41510f;if(_0x4cdbf6['query'][_0x0853('0x4b')]){_0x20ef50[_0x0853('0x4c')]=[{'all':!![]}];}return db[_0x0853('0x39')][_0x0853('0x4d')](_0x20ef50);})[_0x0853('0x20')](function(_0x316daa){_0x4a913e[_0x0853('0x4e')]=_0x316daa;return _0x4a913e;})[_0x0853('0x20')](respondWithFilteredResult(_0x50d5c7,_0x20ef50))[_0x0853('0x4f')](handleError(_0x50d5c7,null));};exports[_0x0853('0x50')]=function(_0x39e2b5,_0x24b5bd){var _0x2e8bb7={'raw':![],'where':{'id':_0x39e2b5[_0x0853('0x51')]['id']}},_0x4cc4bc={};_0x4cc4bc[_0x0853('0x3f')]=_['keys'](db[_0x0853('0x39')][_0x0853('0x52')]);_0x4cc4bc[_0x0853('0x3c')]=_[_0x0853('0x53')](_0x39e2b5[_0x0853('0x3c')]);_0x4cc4bc[_0x0853('0x3d')]=_[_0x0853('0x3e')](_0x4cc4bc[_0x0853('0x3f')],_0x4cc4bc[_0x0853('0x3c')]);_0x2e8bb7[_0x0853('0x41')]=_[_0x0853('0x3e')](_0x4cc4bc[_0x0853('0x3f')],qs[_0x0853('0x40')](_0x39e2b5[_0x0853('0x3c')][_0x0853('0x40')]));_0x2e8bb7[_0x0853('0x41')]=_0x2e8bb7[_0x0853('0x41')][_0x0853('0x42')]?_0x2e8bb7[_0x0853('0x41')]:_0x4cc4bc[_0x0853('0x3f')];if(_0x39e2b5[_0x0853('0x3c')][_0x0853('0x4b')]){_0x2e8bb7[_0x0853('0x4c')]=[{'all':!![]}];}_0x2e8bb7=_[_0x0853('0x49')]({},_0x2e8bb7,_0x39e2b5['options']);return db[_0x0853('0x39')][_0x0853('0x54')](_0x2e8bb7)[_0x0853('0x20')](handleEntityNotFound(_0x24b5bd,null))[_0x0853('0x20')](respondWithResult(_0x24b5bd,null))[_0x0853('0x4f')](handleError(_0x24b5bd,null));};exports[_0x0853('0x55')]=function(_0x97928f,_0x1a5a7d){return db[_0x0853('0x39')][_0x0853('0x55')](_0x97928f[_0x0853('0x56')],{})[_0x0853('0x20')](respondWithResult(_0x1a5a7d,0xc9))[_0x0853('0x4f')](handleError(_0x1a5a7d,null));};exports[_0x0853('0x57')]=function(_0x1b9d78,_0x418988){if(_0x1b9d78['body']['id']){delete _0x1b9d78['body']['id'];}return db[_0x0853('0x39')][_0x0853('0x54')]({'where':{'id':_0x1b9d78[_0x0853('0x51')]['id']}})[_0x0853('0x20')](handleEntityNotFound(_0x418988,null))[_0x0853('0x20')](saveUpdates(_0x1b9d78[_0x0853('0x56')],null))[_0x0853('0x20')](respondWithResult(_0x418988,null))['catch'](handleError(_0x418988,null));};exports[_0x0853('0x35')]=function(_0x591a86,_0x509533){return db[_0x0853('0x39')]['find']({'where':{'id':_0x591a86[_0x0853('0x51')]['id']}})[_0x0853('0x20')](handleEntityNotFound(_0x509533,null))[_0x0853('0x20')](removeEntity(_0x509533,null))['catch'](handleError(_0x509533,null));};exports[_0x0853('0x58')]=function(_0x2b335e,_0x3e137c,_0x80d6ee){var _0x4a75c6={};var _0x24bbc6={};var _0x5d946e;var _0x290c28;return db[_0x0853('0x39')]['findOne']({'where':{'id':_0x2b335e['params']['id']}})[_0x0853('0x20')](handleEntityNotFound(_0x3e137c,null))['then'](function(_0x347845){if(_0x347845){_0x5d946e=_0x347845;_0x24bbc6[_0x0853('0x3f')]=_[_0x0853('0x53')](db['FreshsalesConfiguration'][_0x0853('0x52')]);_0x24bbc6[_0x0853('0x3c')]=_[_0x0853('0x53')](_0x2b335e[_0x0853('0x3c')]);_0x24bbc6['filters']=_[_0x0853('0x3e')](_0x24bbc6[_0x0853('0x3f')],_0x24bbc6[_0x0853('0x3c')]);_0x4a75c6['attributes']=_[_0x0853('0x3e')](_0x24bbc6['model'],qs[_0x0853('0x40')](_0x2b335e[_0x0853('0x3c')][_0x0853('0x40')]));_0x4a75c6[_0x0853('0x41')]=_0x4a75c6[_0x0853('0x41')][_0x0853('0x42')]?_0x4a75c6[_0x0853('0x41')]:_0x24bbc6[_0x0853('0x3f')];_0x4a75c6[_0x0853('0x44')]=qs[_0x0853('0x45')](_0x2b335e[_0x0853('0x3c')][_0x0853('0x45')]);_0x4a75c6[_0x0853('0x46')]=qs[_0x0853('0x3d')](_[_0x0853('0x47')](_0x2b335e[_0x0853('0x3c')],_0x24bbc6[_0x0853('0x3d')]));if(_0x2b335e[_0x0853('0x3c')][_0x0853('0x48')]){_0x4a75c6[_0x0853('0x46')]=_[_0x0853('0x49')](_0x4a75c6[_0x0853('0x46')],{'$or':_[_0x0853('0x38')](_0x4a75c6[_0x0853('0x41')],function(_0x3e3681){var _0x246ac0={};_0x246ac0[_0x3e3681]={'$like':'%'+_0x2b335e[_0x0853('0x3c')][_0x0853('0x48')]+'%'};return _0x246ac0;})});}_0x4a75c6=_[_0x0853('0x49')]({},_0x4a75c6,_0x2b335e[_0x0853('0x59')]);return _0x5d946e[_0x0853('0x58')](_0x4a75c6);}})['then'](function(_0x120f61){if(_0x120f61){_0x290c28=_0x120f61[_0x0853('0x42')];if(!_0x2b335e['query'][_0x0853('0x5a')]('nolimit')){_0x4a75c6[_0x0853('0x31')]=qs['limit'](_0x2b335e['query'][_0x0853('0x31')]);_0x4a75c6[_0x0853('0x30')]=qs[_0x0853('0x30')](_0x2b335e[_0x0853('0x3c')][_0x0853('0x30')]);}return _0x5d946e[_0x0853('0x58')](_0x4a75c6);}})[_0x0853('0x20')](function(_0x37614a){if(_0x37614a){return _0x37614a?{'count':_0x290c28,'rows':_0x37614a}:null;}})['then'](respondWithResult(_0x3e137c,null))[_0x0853('0x4f')](handleError(_0x3e137c,null));};exports[_0x0853('0x5b')]=function(_0x3c8f60,_0xf989af,_0x273626){if(_0x3c8f60[_0x0853('0x56')]['id']){delete _0x3c8f60[_0x0853('0x56')]['id'];}return db['FreshsalesAccount'][_0x0853('0x5c')]({'where':{'id':_0x3c8f60[_0x0853('0x51')]['id']}})['then'](handleEntityNotFound(_0xf989af,null))[_0x0853('0x20')](function(_0x4f4e74){if(_0x4f4e74){_0x3c8f60['body'][_0x0853('0x5d')]=_0x4f4e74['id'];_0x3c8f60['body'][_0x0853('0x5e')]=integrations['getSubjects'](_0x3c8f60[_0x0853('0x56')][_0x0853('0x5f')],_0x3c8f60['body'][_0x0853('0x3b')]);_0x3c8f60[_0x0853('0x56')]['Descriptions']=integrations[_0x0853('0x60')](_0x3c8f60[_0x0853('0x56')][_0x0853('0x5f')],_0x3c8f60[_0x0853('0x56')][_0x0853('0x3b')]);return db[_0x0853('0x61')][_0x0853('0x55')](_0x3c8f60[_0x0853('0x56')],{'include':[{'model':db[_0x0853('0x62')],'as':_0x0853('0x5e')},{'model':db[_0x0853('0x62')],'as':_0x0853('0x63')}]});}return null;})[_0x0853('0x20')](respondWithResult(_0xf989af,null))[_0x0853('0x4f')](handleError(_0xf989af,null));};exports[_0x0853('0x64')]=function(_0x3440a4,_0x134f1d,_0x2b917a){var _0x513532='';var _0x46c74e='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x3440a4[_0x0853('0x51')]['id']},'attributes':['id',_0x0853('0x65'),_0x0853('0x66'),'apiKey']})['then'](handleEntityNotFound(_0x134f1d,null))[_0x0853('0x20')](function(_0x22885e){if(_0x22885e){_0x46c74e=_0x22885e[_0x0853('0x65')];_0x513532=_0x22885e['remoteUri'];var _0x2fdd14=_0x22885e['remoteUri'][_0x0853('0x67')](-0x1);if(_0x2fdd14==='/'){_0x513532=_0x513532[_0x0853('0x68')](0x0,_0x513532[_0x0853('0x69')](_0x2fdd14));}return rp({'method':_0x0853('0x6a'),'uri':util[_0x0853('0x6b')](_0x0853('0x6c'),_0x513532,_0x0853('0x6d')),'headers':{'Authorization':_0x0853('0x6e')+_0x22885e['apiKey']},'json':!![]});}})['then'](function(_0x46592c){if(_0x46592c){var _0x202626=_0x46592c[_0x0853('0x6f')];var _0x1bf215=![];var _0x16978f=null;for(_0x16978f=0x0;_0x16978f<_0x202626[_0x0853('0x42')];_0x16978f++){if(_0x202626[_0x16978f][_0x0853('0x70')]===_0x46c74e){_0x1bf215=!![];}}if(_0x1bf215){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x0853('0x71')});}}})[_0x0853('0x20')](respondWithResult(_0x134f1d,null))[_0x0853('0x4f')](function(_0x3dbc0e){var _0x3d10f4=_0x3440a4[_0x0853('0x3c')][_0x0853('0x1c')]?0x1f4:_0x3dbc0e[_0x0853('0x72')]||0x1f4;logger[_0x0853('0x26')](_0x0853('0x73'),'getFields',_0x3d10f4,JSON['stringify'](_0x3dbc0e));delete _0x3dbc0e[_0x0853('0x37')];if(_0x3d10f4===0x191){_0x3d10f4=0x190;}_0x134f1d[_0x0853('0x2d')](_0x3d10f4)[_0x0853('0x74')](_0x3440a4[_0x0853('0x3c')][_0x0853('0x1c')]?{'message':'Wrong\x20credentials','statusCode':_0x3dbc0e[_0x0853('0x72')]}:_0x3dbc0e);});}; \ No newline at end of file +var _0x30a9=['count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','AccountId','channel','Descriptions','FreshsalesField','getFields','username','remoteUri','apiKey','substring','GET','/api/selector/owners','Token\x20token=','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','end','status','json','offset','limit','apply','save','update','destroy','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x30a9,0x169));var _0x930a=function(_0x319126,_0x5a96d8){_0x319126=_0x319126-0x0;var _0x19d19d=_0x30a9[_0x319126];return _0x19d19d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x930a('0x0'));var rimraf=require(_0x930a('0x1'));var zipdir=require(_0x930a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x930a('0x3'));var moment=require(_0x930a('0x4'));var BPromise=require(_0x930a('0x5'));var Mustache=require(_0x930a('0x6'));var util=require('util');var path=require(_0x930a('0x7'));var sox=require(_0x930a('0x8'));var csv=require(_0x930a('0x9'));var ejs=require(_0x930a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x930a('0xb'));var crypto=require(_0x930a('0xc'));var jsforce=require(_0x930a('0xd'));var deskjs=require(_0x930a('0xe'));var toCsv=require(_0x930a('0x9'));var querystring=require(_0x930a('0xf'));var Papa=require(_0x930a('0x10'));var Redis=require(_0x930a('0x11'));var authService=require(_0x930a('0x12'));var qs=require(_0x930a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x930a('0x14'))(_0x930a('0x15'));var utils=require(_0x930a('0x16'));var config=require(_0x930a('0x17'));var db=require(_0x930a('0x18'))['db'];var integrations=require(_0x930a('0x19'));var jayson=require(_0x930a('0x1a'));var client=jayson[_0x930a('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x426034,_0x518a1a,_0x23dc95){if(_0x23dc95){var _0x347f00=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x347f00[_0x930a('0x1c')](_0x518a1a)){return _0x426034;}else{throw new db[(_0x930a('0x1d'))][(_0x930a('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x426034;}}function respondWithRpcPromise(_0x186add,_0x428990,_0x5857fe,_0x4fc5c3){return new BPromise(function(_0x4d0a38,_0x515da8){var _0x4d16b2=_0x4fc5c3||client;return _0x4d16b2[_0x930a('0x1f')](_0x186add,_0x5857fe)[_0x930a('0x20')](function(_0x358186){logger['info'](_0x930a('0x21'),_0x428990,_0x930a('0x22'));logger[_0x930a('0x23')](_0x930a('0x24'),_0x428990,'request\x20sent',JSON['stringify'](_0x358186));if(_0x358186['error']){if(_0x358186[_0x930a('0x25')][_0x930a('0x26')]===0x1f4){logger['error'](_0x930a('0x21'),_0x428990,_0x358186[_0x930a('0x25')]['message']);return _0x515da8(_0x358186[_0x930a('0x25')][_0x930a('0x27')]);}logger[_0x930a('0x25')](_0x930a('0x21'),_0x428990,_0x358186[_0x930a('0x25')][_0x930a('0x27')]);return _0x4d0a38(_0x358186[_0x930a('0x25')]['message']);}else{logger[_0x930a('0x28')](_0x930a('0x21'),_0x428990,'request\x20sent');_0x4d0a38(_0x358186['result'][_0x930a('0x27')]);}})['catch'](function(_0x477875){logger[_0x930a('0x25')]('FreshsalesAccount,\x20%s,\x20%s',_0x428990,_0x477875);_0x515da8(_0x477875);});});}function respondWithStatusCode(_0x2c5cc6,_0x486252){_0x486252=_0x486252||0xcc;return function(_0x1a2fcd){if(_0x1a2fcd){return _0x2c5cc6[_0x930a('0x29')](_0x486252);}return _0x2c5cc6['status'](_0x486252)[_0x930a('0x2a')]();};}function respondWithResult(_0x388a8a,_0x3de309){_0x3de309=_0x3de309||0xc8;return function(_0x230d0e){if(_0x230d0e){return _0x388a8a[_0x930a('0x2b')](_0x3de309)[_0x930a('0x2c')](_0x230d0e);}};}function respondWithFilteredResult(_0x6f25aa,_0xbe983a){return function(_0x19ed27){if(_0x19ed27){var _0x342afc=_0x19ed27['count'],_0x482391=_0xbe983a[_0x930a('0x2d')],_0x447e65=_0xbe983a['offset']+_0xbe983a[_0x930a('0x2e')],_0x2a0932;if(_0x447e65>=_0x342afc){_0x447e65=_0x342afc;_0x2a0932=0xc8;}else{_0x2a0932=0xce;}_0x6f25aa[_0x930a('0x2b')](_0x2a0932);return _0x6f25aa['set']('Content-Range',_0x482391+'-'+_0x447e65+'/'+_0x342afc)[_0x930a('0x2c')](_0x19ed27);}return null;};}function patchUpdates(_0x5141cd){return function(_0xa2b3d5){try{jsonpatch[_0x930a('0x2f')](_0xa2b3d5,_0x5141cd,!![]);}catch(_0x384b27){return BPromise['reject'](_0x384b27);}return _0xa2b3d5[_0x930a('0x30')]();};}function saveUpdates(_0x1c5a09,_0x1471f5){return function(_0x1f09b1){if(_0x1f09b1){return _0x1f09b1[_0x930a('0x31')](_0x1c5a09)[_0x930a('0x20')](function(_0x4f8012){return _0x4f8012;});}return null;};}function removeEntity(_0x2bc806,_0x4cb920){return function(_0x467ecd){if(_0x467ecd){return _0x467ecd[_0x930a('0x32')]()[_0x930a('0x20')](function(){_0x2bc806[_0x930a('0x2b')](0xcc)[_0x930a('0x2a')]();});}};}function handleEntityNotFound(_0x47b8c8,_0x146e8c){return function(_0x5ad586){if(!_0x5ad586){_0x47b8c8[_0x930a('0x29')](0x194);}return _0x5ad586;};}function handleError(_0x2c6c92,_0x5f3664){_0x5f3664=_0x5f3664||0x1f4;return function(_0x3fff32){logger['error'](_0x3fff32[_0x930a('0x33')]);if(_0x3fff32[_0x930a('0x34')]){delete _0x3fff32[_0x930a('0x34')];}_0x2c6c92['status'](_0x5f3664)[_0x930a('0x35')](_0x3fff32);};}exports['index']=function(_0x290e3c,_0x41613a){var _0x43fd03={},_0x9a07e4={},_0x223459={'count':0x0,'rows':[]};var _0x2a4605=_[_0x930a('0x36')](db[_0x930a('0x37')][_0x930a('0x38')],function(_0x3c5300){return{'name':_0x3c5300[_0x930a('0x39')],'type':_0x3c5300[_0x930a('0x3a')]['key']};});_0x9a07e4[_0x930a('0x3b')]=_[_0x930a('0x36')](_0x2a4605,_0x930a('0x34'));_0x9a07e4[_0x930a('0x3c')]=_[_0x930a('0x3d')](_0x290e3c[_0x930a('0x3c')]);_0x9a07e4[_0x930a('0x3e')]=_[_0x930a('0x3f')](_0x9a07e4['model'],_0x9a07e4[_0x930a('0x3c')]);_0x43fd03[_0x930a('0x40')]=_[_0x930a('0x3f')](_0x9a07e4[_0x930a('0x3b')],qs[_0x930a('0x41')](_0x290e3c[_0x930a('0x3c')]['fields']));_0x43fd03[_0x930a('0x40')]=_0x43fd03[_0x930a('0x40')]['length']?_0x43fd03[_0x930a('0x40')]:_0x9a07e4[_0x930a('0x3b')];if(!_0x290e3c[_0x930a('0x3c')][_0x930a('0x42')]('nolimit')){_0x43fd03[_0x930a('0x2e')]=qs[_0x930a('0x2e')](_0x290e3c['query'][_0x930a('0x2e')]);_0x43fd03[_0x930a('0x2d')]=qs[_0x930a('0x2d')](_0x290e3c[_0x930a('0x3c')][_0x930a('0x2d')]);}_0x43fd03[_0x930a('0x43')]=qs['sort'](_0x290e3c[_0x930a('0x3c')][_0x930a('0x44')]);_0x43fd03['where']=qs[_0x930a('0x3e')](_[_0x930a('0x45')](_0x290e3c[_0x930a('0x3c')],_0x9a07e4['filters']));if(_0x290e3c[_0x930a('0x3c')][_0x930a('0x46')]){_0x43fd03[_0x930a('0x47')]=_[_0x930a('0x48')](_0x43fd03[_0x930a('0x47')],{'$or':_[_0x930a('0x36')](_0x2a4605,function(_0x2122e1){if(_0x2122e1[_0x930a('0x3a')]!==_0x930a('0x49')){var _0x4ae203={};_0x4ae203[_0x2122e1[_0x930a('0x34')]]={'$like':'%'+_0x290e3c[_0x930a('0x3c')][_0x930a('0x46')]+'%'};return _0x4ae203;}})});}_0x43fd03=_[_0x930a('0x48')]({},_0x43fd03,_0x290e3c[_0x930a('0x4a')]);var _0x56914c={'where':_0x43fd03[_0x930a('0x47')]};return db['FreshsalesAccount'][_0x930a('0x4b')](_0x56914c)['then'](function(_0x19cb4f){_0x223459['count']=_0x19cb4f;if(_0x290e3c[_0x930a('0x3c')][_0x930a('0x4c')]){_0x43fd03[_0x930a('0x4d')]=[{'all':!![]}];}return db[_0x930a('0x37')][_0x930a('0x4e')](_0x43fd03);})[_0x930a('0x20')](function(_0x41b3a3){_0x223459[_0x930a('0x4f')]=_0x41b3a3;return _0x223459;})[_0x930a('0x20')](respondWithFilteredResult(_0x41613a,_0x43fd03))['catch'](handleError(_0x41613a,null));};exports[_0x930a('0x50')]=function(_0x5ce0de,_0x29b340){var _0x237fab={'raw':![],'where':{'id':_0x5ce0de[_0x930a('0x51')]['id']}},_0x39f56f={};_0x39f56f[_0x930a('0x3b')]=_[_0x930a('0x3d')](db[_0x930a('0x37')][_0x930a('0x38')]);_0x39f56f[_0x930a('0x3c')]=_['keys'](_0x5ce0de[_0x930a('0x3c')]);_0x39f56f[_0x930a('0x3e')]=_[_0x930a('0x3f')](_0x39f56f[_0x930a('0x3b')],_0x39f56f[_0x930a('0x3c')]);_0x237fab[_0x930a('0x40')]=_['intersection'](_0x39f56f[_0x930a('0x3b')],qs[_0x930a('0x41')](_0x5ce0de['query'][_0x930a('0x41')]));_0x237fab[_0x930a('0x40')]=_0x237fab[_0x930a('0x40')][_0x930a('0x52')]?_0x237fab[_0x930a('0x40')]:_0x39f56f['model'];if(_0x5ce0de[_0x930a('0x3c')]['includeAll']){_0x237fab[_0x930a('0x4d')]=[{'all':!![]}];}_0x237fab=_[_0x930a('0x48')]({},_0x237fab,_0x5ce0de['options']);return db[_0x930a('0x37')][_0x930a('0x53')](_0x237fab)[_0x930a('0x20')](handleEntityNotFound(_0x29b340,null))['then'](respondWithResult(_0x29b340,null))[_0x930a('0x54')](handleError(_0x29b340,null));};exports[_0x930a('0x55')]=function(_0x2bdec4,_0x232163){return db['FreshsalesAccount'][_0x930a('0x55')](_0x2bdec4[_0x930a('0x56')],{})[_0x930a('0x20')](respondWithResult(_0x232163,0xc9))[_0x930a('0x54')](handleError(_0x232163,null));};exports[_0x930a('0x31')]=function(_0x10e03b,_0x3abc0c){if(_0x10e03b[_0x930a('0x56')]['id']){delete _0x10e03b[_0x930a('0x56')]['id'];}return db[_0x930a('0x37')][_0x930a('0x53')]({'where':{'id':_0x10e03b[_0x930a('0x51')]['id']}})[_0x930a('0x20')](handleEntityNotFound(_0x3abc0c,null))[_0x930a('0x20')](saveUpdates(_0x10e03b[_0x930a('0x56')],null))[_0x930a('0x20')](respondWithResult(_0x3abc0c,null))[_0x930a('0x54')](handleError(_0x3abc0c,null));};exports[_0x930a('0x32')]=function(_0x344077,_0x2f5c27){return db['FreshsalesAccount']['find']({'where':{'id':_0x344077[_0x930a('0x51')]['id']}})[_0x930a('0x20')](handleEntityNotFound(_0x2f5c27,null))[_0x930a('0x20')](removeEntity(_0x2f5c27,null))[_0x930a('0x54')](handleError(_0x2f5c27,null));};exports[_0x930a('0x57')]=function(_0x1e903b,_0x47a440,_0x287d1b){var _0x3e4371={};var _0x3904af={};var _0x5de82b;var _0x575c2b;return db[_0x930a('0x37')][_0x930a('0x58')]({'where':{'id':_0x1e903b[_0x930a('0x51')]['id']}})[_0x930a('0x20')](handleEntityNotFound(_0x47a440,null))[_0x930a('0x20')](function(_0x57ed47){if(_0x57ed47){_0x5de82b=_0x57ed47;_0x3904af['model']=_[_0x930a('0x3d')](db[_0x930a('0x59')][_0x930a('0x38')]);_0x3904af['query']=_['keys'](_0x1e903b[_0x930a('0x3c')]);_0x3904af[_0x930a('0x3e')]=_['intersection'](_0x3904af['model'],_0x3904af['query']);_0x3e4371[_0x930a('0x40')]=_[_0x930a('0x3f')](_0x3904af[_0x930a('0x3b')],qs['fields'](_0x1e903b[_0x930a('0x3c')]['fields']));_0x3e4371['attributes']=_0x3e4371[_0x930a('0x40')]['length']?_0x3e4371[_0x930a('0x40')]:_0x3904af[_0x930a('0x3b')];_0x3e4371['order']=qs[_0x930a('0x44')](_0x1e903b[_0x930a('0x3c')][_0x930a('0x44')]);_0x3e4371[_0x930a('0x47')]=qs[_0x930a('0x3e')](_[_0x930a('0x45')](_0x1e903b[_0x930a('0x3c')],_0x3904af['filters']));if(_0x1e903b[_0x930a('0x3c')][_0x930a('0x46')]){_0x3e4371[_0x930a('0x47')]=_[_0x930a('0x48')](_0x3e4371[_0x930a('0x47')],{'$or':_[_0x930a('0x36')](_0x3e4371[_0x930a('0x40')],function(_0x3f3e8f){var _0x553a7e={};_0x553a7e[_0x3f3e8f]={'$like':'%'+_0x1e903b[_0x930a('0x3c')]['filter']+'%'};return _0x553a7e;})});}_0x3e4371=_[_0x930a('0x48')]({},_0x3e4371,_0x1e903b[_0x930a('0x4a')]);return _0x5de82b[_0x930a('0x57')](_0x3e4371);}})[_0x930a('0x20')](function(_0x40481b){if(_0x40481b){_0x575c2b=_0x40481b[_0x930a('0x52')];if(!_0x1e903b[_0x930a('0x3c')]['hasOwnProperty'](_0x930a('0x5a'))){_0x3e4371[_0x930a('0x2e')]=qs[_0x930a('0x2e')](_0x1e903b[_0x930a('0x3c')][_0x930a('0x2e')]);_0x3e4371[_0x930a('0x2d')]=qs['offset'](_0x1e903b['query'][_0x930a('0x2d')]);}return _0x5de82b[_0x930a('0x57')](_0x3e4371);}})[_0x930a('0x20')](function(_0x2fd659){if(_0x2fd659){return _0x2fd659?{'count':_0x575c2b,'rows':_0x2fd659}:null;}})[_0x930a('0x20')](respondWithResult(_0x47a440,null))[_0x930a('0x54')](handleError(_0x47a440,null));};exports['addConfiguration']=function(_0xbe1e5,_0x4cb412,_0x39d02f){if(_0xbe1e5['body']['id']){delete _0xbe1e5[_0x930a('0x56')]['id'];}return db[_0x930a('0x37')][_0x930a('0x58')]({'where':{'id':_0xbe1e5[_0x930a('0x51')]['id']}})['then'](handleEntityNotFound(_0x4cb412,null))[_0x930a('0x20')](function(_0x144c01){if(_0x144c01){_0xbe1e5[_0x930a('0x56')][_0x930a('0x5b')]=_0x144c01['id'];_0xbe1e5[_0x930a('0x56')]['Subjects']=integrations['getSubjects'](_0xbe1e5[_0x930a('0x56')][_0x930a('0x5c')],_0xbe1e5[_0x930a('0x56')]['type']);_0xbe1e5[_0x930a('0x56')][_0x930a('0x5d')]=integrations['getDescriptions'](_0xbe1e5['body'][_0x930a('0x5c')],_0xbe1e5[_0x930a('0x56')][_0x930a('0x3a')]);return db[_0x930a('0x59')][_0x930a('0x55')](_0xbe1e5['body'],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x930a('0x5e')],'as':_0x930a('0x5d')}]});}return null;})['then'](respondWithResult(_0x4cb412,null))[_0x930a('0x54')](handleError(_0x4cb412,null));};exports[_0x930a('0x5f')]=function(_0x4531f7,_0x49f011,_0xc44b41){var _0x5b1d0b='';var _0x1d125d='';return db[_0x930a('0x37')][_0x930a('0x58')]({'where':{'id':_0x4531f7[_0x930a('0x51')]['id']},'attributes':['id',_0x930a('0x60'),_0x930a('0x61'),_0x930a('0x62')]})[_0x930a('0x20')](handleEntityNotFound(_0x49f011,null))[_0x930a('0x20')](function(_0x3a56f8){if(_0x3a56f8){_0x1d125d=_0x3a56f8[_0x930a('0x60')];_0x5b1d0b=_0x3a56f8[_0x930a('0x61')];var _0xb55cea=_0x3a56f8[_0x930a('0x61')]['slice'](-0x1);if(_0xb55cea==='/'){_0x5b1d0b=_0x5b1d0b[_0x930a('0x63')](0x0,_0x5b1d0b['lastIndexOf'](_0xb55cea));}return rp({'method':_0x930a('0x64'),'uri':util['format']('%s%s',_0x5b1d0b,_0x930a('0x65')),'headers':{'Authorization':_0x930a('0x66')+_0x3a56f8['apiKey']},'json':!![]});}})[_0x930a('0x20')](function(_0x18a5a2){if(_0x18a5a2){var _0x2746c6=_0x18a5a2[_0x930a('0x67')];var _0x1dfbab=![];var _0x3c1ffc=null;for(_0x3c1ffc=0x0;_0x3c1ffc<_0x2746c6[_0x930a('0x52')];_0x3c1ffc++){if(_0x2746c6[_0x3c1ffc][_0x930a('0x68')]===_0x1d125d){_0x1dfbab=!![];}}if(_0x1dfbab){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x49f011,null))[_0x930a('0x54')](function(_0x2979cf){var _0x517072=_0x4531f7[_0x930a('0x3c')][_0x930a('0x1c')]?0x1f4:_0x2979cf[_0x930a('0x69')]||0x1f4;logger[_0x930a('0x25')](_0x930a('0x6a'),_0x930a('0x5f'),_0x517072,JSON[_0x930a('0x6b')](_0x2979cf));delete _0x2979cf[_0x930a('0x34')];if(_0x517072===0x191){_0x517072=0x190;}_0x49f011[_0x930a('0x2b')](_0x517072)[_0x930a('0x35')](_0x4531f7[_0x930a('0x3c')][_0x930a('0x1c')]?{'message':_0x930a('0x6c'),'statusCode':_0x2979cf[_0x930a('0x69')]}:_0x2979cf);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 2aabeeb..71827ca 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7da6=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','int_freshsales_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x383562,_0x51b686){var _0x19348d=function(_0x5ec686){while(--_0x5ec686){_0x383562['push'](_0x383562['shift']());}};_0x19348d(++_0x51b686);}(_0x7da6,0x124));var _0x67da=function(_0x23a299,_0x30e49c){_0x23a299=_0x23a299-0x0;var _0x560bb3=_0x7da6[_0x23a299];return _0x560bb3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x67da('0x0'))(_0x67da('0x1'));var moment=require(_0x67da('0x2'));var BPromise=require(_0x67da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67da('0x4'));var rimraf=require(_0x67da('0x5'));var config=require(_0x67da('0x6'));var attributes=require(_0x67da('0x7'));var integrations=require(_0x67da('0x8'));module[_0x67da('0x9')]=function(_0x59af9a,_0xb7f52){return _0x59af9a['define']('FreshsalesAccount',attributes,{'tableName':_0x67da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63d6=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x1aa7aa,_0x3c3ac5){var _0x27317c=function(_0x1050ec){while(--_0x1050ec){_0x1aa7aa['push'](_0x1aa7aa['shift']());}};_0x27317c(++_0x3c3ac5);}(_0x63d6,0xae));var _0x663d=function(_0x42a7ca,_0x59e162){_0x42a7ca=_0x42a7ca-0x0;var _0x2f8123=_0x63d6[_0x42a7ca];return _0x2f8123;};'use strict';var _=require(_0x663d('0x0'));var util=require(_0x663d('0x1'));var logger=require(_0x663d('0x2'))(_0x663d('0x3'));var moment=require(_0x663d('0x4'));var BPromise=require('bluebird');var rp=require(_0x663d('0x5'));var fs=require('fs');var path=require(_0x663d('0x6'));var rimraf=require('rimraf');var config=require(_0x663d('0x7'));var attributes=require(_0x663d('0x8'));var integrations=require(_0x663d('0x9'));module[_0x663d('0xa')]=function(_0x3da357,_0xc89946){return _0x3da357[_0x663d('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x663d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index e7e7bcc..f5756ff 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18b2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','raw','options','where','attributes','map','include','model','then','ShowFreshsalesAccount','stringify','util','moment','bluebird'];(function(_0x42063f,_0x28f2de){var _0x4d367f=function(_0x2575e2){while(--_0x2575e2){_0x42063f['push'](_0x42063f['shift']());}};_0x4d367f(++_0x28f2de);}(_0x18b2,0x85));var _0x218b=function(_0x132f56,_0x1f4764){_0x132f56=_0x132f56-0x0;var _0x1e030a=_0x18b2[_0x132f56];return _0x1e030a;};'use strict';var _=require('lodash');var util=require(_0x218b('0x0'));var moment=require(_0x218b('0x1'));var BPromise=require(_0x218b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x218b('0x3'));var db=require(_0x218b('0x4'))['db'];var utils=require(_0x218b('0x5'));var logger=require(_0x218b('0x6'))(_0x218b('0x7'));var config=require(_0x218b('0x8'));var jayson=require(_0x218b('0x9'));var client=jayson[_0x218b('0xa')][_0x218b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6bf41c,_0x24ce61,_0x14449e){return new BPromise(function(_0x71e08d,_0xb67e06){return client[_0x218b('0xc')](_0x6bf41c,_0x14449e)['then'](function(_0x216f3d){logger[_0x218b('0xd')](_0x218b('0xe'),_0x24ce61,_0x218b('0xf'));logger[_0x218b('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x24ce61,_0x218b('0xf'),JSON['stringify'](_0x216f3d));if(_0x216f3d[_0x218b('0x11')]){if(_0x216f3d[_0x218b('0x11')][_0x218b('0x12')]===0x1f4){logger['error'](_0x218b('0xe'),_0x24ce61,_0x216f3d[_0x218b('0x11')]['message']);return _0xb67e06(_0x216f3d[_0x218b('0x11')][_0x218b('0x13')]);}logger['error'](_0x218b('0xe'),_0x24ce61,_0x216f3d[_0x218b('0x11')][_0x218b('0x13')]);return _0x71e08d(_0x216f3d[_0x218b('0x11')][_0x218b('0x13')]);}else{logger[_0x218b('0xd')](_0x218b('0xe'),_0x24ce61,_0x218b('0xf'));_0x71e08d(_0x216f3d[_0x218b('0x14')][_0x218b('0x13')]);}})[_0x218b('0x15')](function(_0x430ecf){logger[_0x218b('0x11')](_0x218b('0xe'),_0x24ce61,_0x430ecf);_0xb67e06(_0x430ecf);});});}exports[_0x218b('0x16')]=function(_0x477f32){var _0x512176=this;return new Promise(function(_0x2a1c5c,_0x2a285d){return db[_0x218b('0x17')]['findAll']({'raw':_0x477f32['options']?_0x477f32['options'][_0x218b('0x18')]===undefined?!![]:![]:!![],'where':_0x477f32[_0x218b('0x19')]?_0x477f32[_0x218b('0x19')][_0x218b('0x1a')]||null:null,'attributes':_0x477f32[_0x218b('0x19')]?_0x477f32[_0x218b('0x19')][_0x218b('0x1b')]||null:null,'limit':_0x477f32[_0x218b('0x19')]?_0x477f32['options']['limit']||null:null,'include':_0x477f32[_0x218b('0x19')]?_0x477f32[_0x218b('0x19')]['include']?_[_0x218b('0x1c')](_0x477f32[_0x218b('0x19')][_0x218b('0x1d')],function(_0x571909){return{'model':db[_0x571909['model']],'as':_0x571909['as'],'attributes':_0x571909[_0x218b('0x1b')],'include':_0x571909[_0x218b('0x1d')]?_['map'](_0x571909[_0x218b('0x1d')],function(_0x1d70a8){return{'model':db[_0x1d70a8[_0x218b('0x1e')]],'as':_0x1d70a8['as'],'attributes':_0x1d70a8[_0x218b('0x1b')],'include':_0x1d70a8[_0x218b('0x1d')]?_['map'](_0x1d70a8[_0x218b('0x1d')],function(_0x239f75){return{'model':db[_0x239f75[_0x218b('0x1e')]],'as':_0x239f75['as'],'attributes':_0x239f75['attributes']};}):[]};}):[]};}):[]:[]})[_0x218b('0x1f')](function(_0x5acc87){logger['info'](_0x218b('0x16'),_0x477f32);logger[_0x218b('0x10')]('GetFreshsalesAccount',_0x477f32,JSON['stringify'](_0x5acc87));_0x2a1c5c(_0x5acc87);})['catch'](function(_0x4aca90){logger['error']('GetFreshsalesAccount',_0x4aca90['message'],_0x477f32);_0x2a285d(_0x512176['error'](0x1f4,_0x4aca90[_0x218b('0x13')]));});});};exports[_0x218b('0x20')]=function(_0x2b971e){var _0x614bec=this;return new Promise(function(_0x3f5cfa,_0x5878d2){return db[_0x218b('0x17')]['find']({'raw':_0x2b971e[_0x218b('0x19')]?_0x2b971e['options'][_0x218b('0x18')]===undefined?!![]:![]:!![],'where':_0x2b971e['options']?_0x2b971e['options']['where']||null:null,'attributes':_0x2b971e['options']?_0x2b971e[_0x218b('0x19')][_0x218b('0x1b')]||null:null,'include':_0x2b971e['options']?_0x2b971e[_0x218b('0x19')][_0x218b('0x1d')]?_[_0x218b('0x1c')](_0x2b971e[_0x218b('0x19')]['include'],function(_0x4013c2){return{'model':db[_0x4013c2[_0x218b('0x1e')]],'as':_0x4013c2['as'],'attributes':_0x4013c2[_0x218b('0x1b')],'include':_0x4013c2[_0x218b('0x1d')]?_[_0x218b('0x1c')](_0x4013c2[_0x218b('0x1d')],function(_0x2d7710){return{'model':db[_0x2d7710[_0x218b('0x1e')]],'as':_0x2d7710['as'],'attributes':_0x2d7710['attributes'],'include':_0x2d7710['include']?_[_0x218b('0x1c')](_0x2d7710[_0x218b('0x1d')],function(_0x29f1b0){return{'model':db[_0x29f1b0[_0x218b('0x1e')]],'as':_0x29f1b0['as'],'attributes':_0x29f1b0[_0x218b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x218b('0x1f')](function(_0x5c1f00){logger[_0x218b('0xd')]('ShowFreshsalesAccount',_0x2b971e);logger['debug'](_0x218b('0x20'),_0x2b971e,JSON[_0x218b('0x21')](_0x5c1f00));_0x3f5cfa(_0x5c1f00);})['catch'](function(_0x16cf43){logger[_0x218b('0x11')]('ShowFreshsalesAccount',_0x16cf43['message'],_0x2b971e);_0x5878d2(_0x614bec[_0x218b('0x11')](0x1f4,_0x16cf43[_0x218b('0x13')]));});});}; \ No newline at end of file +var _0xb366=['GetFreshsalesAccount','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','findAll','options','where','attributes','limit','include','model','map'];(function(_0x1ff687,_0x9cf9c1){var _0x515f71=function(_0x4a69f0){while(--_0x4a69f0){_0x1ff687['push'](_0x1ff687['shift']());}};_0x515f71(++_0x9cf9c1);}(_0xb366,0xa4));var _0x6b36=function(_0x25df55,_0x57ea51){_0x25df55=_0x25df55-0x0;var _0x4863e7=_0xb366[_0x25df55];return _0x4863e7;};'use strict';var _=require(_0x6b36('0x0'));var util=require('util');var moment=require(_0x6b36('0x1'));var BPromise=require(_0x6b36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b36('0x3'));var db=require(_0x6b36('0x4'))['db'];var utils=require(_0x6b36('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6b36('0x6'));var client=jayson[_0x6b36('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3997c0,_0x4fe38c,_0x4c6f4c){return new BPromise(function(_0x301a30,_0xee898a){return client[_0x6b36('0x8')](_0x3997c0,_0x4c6f4c)[_0x6b36('0x9')](function(_0x49c125){logger[_0x6b36('0xa')](_0x6b36('0xb'),_0x4fe38c,'request\x20sent');logger[_0x6b36('0xc')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x4fe38c,_0x6b36('0xd'),JSON[_0x6b36('0xe')](_0x49c125));if(_0x49c125[_0x6b36('0xf')]){if(_0x49c125[_0x6b36('0xf')][_0x6b36('0x10')]===0x1f4){logger[_0x6b36('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x4fe38c,_0x49c125[_0x6b36('0xf')][_0x6b36('0x11')]);return _0xee898a(_0x49c125['error'][_0x6b36('0x11')]);}logger['error'](_0x6b36('0xb'),_0x4fe38c,_0x49c125['error']['message']);return _0x301a30(_0x49c125['error'][_0x6b36('0x11')]);}else{logger[_0x6b36('0xa')](_0x6b36('0xb'),_0x4fe38c,'request\x20sent');_0x301a30(_0x49c125[_0x6b36('0x12')]['message']);}})[_0x6b36('0x13')](function(_0xf7b45a){logger[_0x6b36('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x4fe38c,_0xf7b45a);_0xee898a(_0xf7b45a);});});}exports['GetFreshsalesAccount']=function(_0x17c969){var _0x51e103=this;return new Promise(function(_0x41334a,_0x2864bb){return db['FreshsalesAccount'][_0x6b36('0x14')]({'raw':_0x17c969['options']?_0x17c969[_0x6b36('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x17c969[_0x6b36('0x15')]?_0x17c969[_0x6b36('0x15')][_0x6b36('0x16')]||null:null,'attributes':_0x17c969[_0x6b36('0x15')]?_0x17c969[_0x6b36('0x15')][_0x6b36('0x17')]||null:null,'limit':_0x17c969[_0x6b36('0x15')]?_0x17c969[_0x6b36('0x15')][_0x6b36('0x18')]||null:null,'include':_0x17c969[_0x6b36('0x15')]?_0x17c969[_0x6b36('0x15')][_0x6b36('0x19')]?_['map'](_0x17c969[_0x6b36('0x15')][_0x6b36('0x19')],function(_0x514c0d){return{'model':db[_0x514c0d[_0x6b36('0x1a')]],'as':_0x514c0d['as'],'attributes':_0x514c0d['attributes'],'include':_0x514c0d[_0x6b36('0x19')]?_['map'](_0x514c0d['include'],function(_0x5b00d1){return{'model':db[_0x5b00d1[_0x6b36('0x1a')]],'as':_0x5b00d1['as'],'attributes':_0x5b00d1[_0x6b36('0x17')],'include':_0x5b00d1[_0x6b36('0x19')]?_[_0x6b36('0x1b')](_0x5b00d1[_0x6b36('0x19')],function(_0x33d343){return{'model':db[_0x33d343[_0x6b36('0x1a')]],'as':_0x33d343['as'],'attributes':_0x33d343[_0x6b36('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xaa79dc){logger[_0x6b36('0xa')]('GetFreshsalesAccount',_0x17c969);logger[_0x6b36('0xc')](_0x6b36('0x1c'),_0x17c969,JSON['stringify'](_0xaa79dc));_0x41334a(_0xaa79dc);})[_0x6b36('0x13')](function(_0x111655){logger[_0x6b36('0xf')](_0x6b36('0x1c'),_0x111655[_0x6b36('0x11')],_0x17c969);_0x2864bb(_0x51e103[_0x6b36('0xf')](0x1f4,_0x111655[_0x6b36('0x11')]));});});};exports[_0x6b36('0x1d')]=function(_0x2ec52a){var _0x4470f4=this;return new Promise(function(_0x4bac74,_0x2ef2ae){return db[_0x6b36('0x1e')][_0x6b36('0x1f')]({'raw':_0x2ec52a[_0x6b36('0x15')]?_0x2ec52a['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ec52a[_0x6b36('0x15')]?_0x2ec52a['options'][_0x6b36('0x16')]||null:null,'attributes':_0x2ec52a[_0x6b36('0x15')]?_0x2ec52a[_0x6b36('0x15')][_0x6b36('0x17')]||null:null,'include':_0x2ec52a[_0x6b36('0x15')]?_0x2ec52a[_0x6b36('0x15')][_0x6b36('0x19')]?_[_0x6b36('0x1b')](_0x2ec52a[_0x6b36('0x15')][_0x6b36('0x19')],function(_0xe4c6b5){return{'model':db[_0xe4c6b5['model']],'as':_0xe4c6b5['as'],'attributes':_0xe4c6b5['attributes'],'include':_0xe4c6b5[_0x6b36('0x19')]?_[_0x6b36('0x1b')](_0xe4c6b5[_0x6b36('0x19')],function(_0x1f87cf){return{'model':db[_0x1f87cf[_0x6b36('0x1a')]],'as':_0x1f87cf['as'],'attributes':_0x1f87cf['attributes'],'include':_0x1f87cf['include']?_[_0x6b36('0x1b')](_0x1f87cf[_0x6b36('0x19')],function(_0x198ce0){return{'model':db[_0x198ce0['model']],'as':_0x198ce0['as'],'attributes':_0x198ce0[_0x6b36('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6b36('0x9')](function(_0x5258e0){logger[_0x6b36('0xa')](_0x6b36('0x1d'),_0x2ec52a);logger['debug'](_0x6b36('0x1d'),_0x2ec52a,JSON[_0x6b36('0xe')](_0x5258e0));_0x4bac74(_0x5258e0);})[_0x6b36('0x13')](function(_0x203d63){logger['error'](_0x6b36('0x1d'),_0x203d63[_0x6b36('0x11')],_0x2ec52a);_0x2ef2ae(_0x4470f4[_0x6b36('0xf')](0x1f4,_0x203d63[_0x6b36('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 236fba6..49f8e08 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2b5=['../../components/interaction/service','./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','put','update','delete','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3ef844,_0x5a3e25){var _0x5858d4=function(_0x32ce84){while(--_0x32ce84){_0x3ef844['push'](_0x3ef844['shift']());}};_0x5858d4(++_0x5a3e25);}(_0xd2b5,0x113));var _0x5d2b=function(_0x404f27,_0x4a238a){_0x404f27=_0x404f27-0x0;var _0x18b958=_0xd2b5[_0x404f27];return _0x18b958;};'use strict';var multer=require(_0x5d2b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5d2b('0x1'));var express=require(_0x5d2b('0x2'));var router=express[_0x5d2b('0x3')]();var auth=require(_0x5d2b('0x4'));var interaction=require(_0x5d2b('0x5'));var config=require('../../config/environment');var controller=require(_0x5d2b('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5d2b('0x7')](_0x5d2b('0x8'),auth[_0x5d2b('0x9')](),controller['show']);router[_0x5d2b('0x7')](_0x5d2b('0xa'),auth[_0x5d2b('0x9')](),controller[_0x5d2b('0xb')]);router['get'](_0x5d2b('0xc'),auth[_0x5d2b('0x9')](),controller[_0x5d2b('0xd')]);router['get'](_0x5d2b('0xe'),auth[_0x5d2b('0x9')](),controller[_0x5d2b('0xf')]);router[_0x5d2b('0x10')]('/',auth[_0x5d2b('0x9')](),controller['create']);router[_0x5d2b('0x11')](_0x5d2b('0x8'),auth[_0x5d2b('0x9')](),controller[_0x5d2b('0x12')]);router[_0x5d2b('0x13')](_0x5d2b('0x8'),auth[_0x5d2b('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x636c=['post','create','put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields'];(function(_0x19e5de,_0xf04760){var _0x286131=function(_0x222c31){while(--_0x222c31){_0x19e5de['push'](_0x19e5de['shift']());}};_0x286131(++_0xf04760);}(_0x636c,0xa7));var _0xc636=function(_0xc55228,_0x40a676){_0xc55228=_0xc55228-0x0;var _0x177787=_0x636c[_0xc55228];return _0x177787;};'use strict';var multer=require(_0xc636('0x0'));var util=require('util');var path=require(_0xc636('0x1'));var timeout=require(_0xc636('0x2'));var express=require(_0xc636('0x3'));var router=express['Router']();var auth=require(_0xc636('0x4'));var interaction=require(_0xc636('0x5'));var config=require(_0xc636('0x6'));var controller=require(_0xc636('0x7'));router[_0xc636('0x8')]('/',auth[_0xc636('0x9')](),controller[_0xc636('0xa')]);router['get'](_0xc636('0xb'),auth[_0xc636('0x9')](),controller['show']);router[_0xc636('0x8')](_0xc636('0xc'),auth[_0xc636('0x9')](),controller[_0xc636('0xd')]);router[_0xc636('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xc636('0xe')]);router[_0xc636('0x8')](_0xc636('0xf'),auth[_0xc636('0x9')](),controller[_0xc636('0x10')]);router[_0xc636('0x11')]('/',auth[_0xc636('0x9')](),controller[_0xc636('0x12')]);router[_0xc636('0x13')](_0xc636('0xb'),auth[_0xc636('0x9')](),controller[_0xc636('0x14')]);router[_0xc636('0x15')](_0xc636('0xb'),auth[_0xc636('0x9')](),controller['destroy']);module[_0xc636('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index e5b1b1a..7cb9ea4 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69bf=['sequelize','STRING'];(function(_0x2a4057,_0xfc49a1){var _0x57819c=function(_0x168ddc){while(--_0x168ddc){_0x2a4057['push'](_0x2a4057['shift']());}};_0x57819c(++_0xfc49a1);}(_0x69bf,0x13c));var _0xf69b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x69bf[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf69b('0x0'));module['exports']={'name':{'type':Sequelize[_0xf69b('0x1')]},'description':{'type':Sequelize[_0xf69b('0x1')]}}; \ No newline at end of file +var _0x6934=['exports','STRING','sequelize'];(function(_0x20fa3e,_0x49f886){var _0x2dcafe=function(_0x1e5758){while(--_0x1e5758){_0x20fa3e['push'](_0x20fa3e['shift']());}};_0x2dcafe(++_0x49f886);}(_0x6934,0xf8));var _0x4693=function(_0x14b142,_0x167c20){_0x14b142=_0x14b142-0x0;var _0x195b6e=_0x6934[_0x14b142];return _0x195b6e;};'use strict';var Sequelize=require(_0x4693('0x0'));module[_0x4693('0x1')]={'name':{'type':Sequelize[_0x4693('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 0c591c3..8467174 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4006=['findAll','rows','params','rawAttributes','intersection','find','create','body','getSubjects','findOne','FreshsalesField','keys','pick','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','destroy','end','name','send','index','map','FreshsalesConfiguration','fieldName','type','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x4006,0x1c7));var _0x6400=function(_0x44056e,_0x527ebe){_0x44056e=_0x44056e-0x0;var _0x4e88c7=_0x4006[_0x44056e];return _0x4e88c7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6400('0x0'));var rimraf=require(_0x6400('0x1'));var zipdir=require(_0x6400('0x2'));var jsonpatch=require(_0x6400('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6400('0x4'));var Mustache=require('mustache');var util=require(_0x6400('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6400('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6400('0x7'));var squel=require(_0x6400('0x8'));var crypto=require(_0x6400('0x9'));var jsforce=require(_0x6400('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6400('0x6'));var querystring=require(_0x6400('0xb'));var Papa=require(_0x6400('0xc'));var Redis=require(_0x6400('0xd'));var authService=require(_0x6400('0xe'));var qs=require(_0x6400('0xf'));var as=require(_0x6400('0x10'));var hardwareService=require(_0x6400('0x11'));var logger=require(_0x6400('0x12'))(_0x6400('0x13'));var utils=require(_0x6400('0x14'));var config=require('../../config/environment');var db=require(_0x6400('0x15'))['db'];var jayson=require(_0x6400('0x16'));var client=jayson[_0x6400('0x17')][_0x6400('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5a6d31,_0x291c56,_0x2acc34){if(_0x2acc34){var _0x4ed062=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ed062['test'](_0x291c56)){return _0x5a6d31;}else{throw new db['Sequelize'][(_0x6400('0x19'))](_0x6400('0x1a'));}}else{return _0x5a6d31;}}function respondWithRpcPromise(_0x5b0492,_0x191696,_0x4ae3ea,_0x28eb67){return new BPromise(function(_0x5a0c1c,_0x13d595){var _0x430cb4=_0x28eb67||client;return _0x430cb4[_0x6400('0x1b')](_0x5b0492,_0x4ae3ea)[_0x6400('0x1c')](function(_0x49d412){logger[_0x6400('0x1d')](_0x6400('0x1e'),_0x191696,_0x6400('0x1f'));logger['debug'](_0x6400('0x20'),_0x191696,_0x6400('0x1f'),JSON['stringify'](_0x49d412));if(_0x49d412[_0x6400('0x21')]){if(_0x49d412[_0x6400('0x21')][_0x6400('0x22')]===0x1f4){logger['error'](_0x6400('0x1e'),_0x191696,_0x49d412[_0x6400('0x21')][_0x6400('0x23')]);return _0x13d595(_0x49d412[_0x6400('0x21')][_0x6400('0x23')]);}logger[_0x6400('0x21')](_0x6400('0x1e'),_0x191696,_0x49d412[_0x6400('0x21')][_0x6400('0x23')]);return _0x5a0c1c(_0x49d412[_0x6400('0x21')]['message']);}else{logger[_0x6400('0x1d')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x191696,'request\x20sent');_0x5a0c1c(_0x49d412[_0x6400('0x24')][_0x6400('0x23')]);}})[_0x6400('0x25')](function(_0x43fab2){logger['error'](_0x6400('0x1e'),_0x191696,_0x43fab2);_0x13d595(_0x43fab2);});});}function respondWithStatusCode(_0x56d9e6,_0x1acff2){_0x1acff2=_0x1acff2||0xcc;return function(_0x506732){if(_0x506732){return _0x56d9e6[_0x6400('0x26')](_0x1acff2);}return _0x56d9e6[_0x6400('0x27')](_0x1acff2)['end']();};}function respondWithResult(_0x434550,_0x3fa552){_0x3fa552=_0x3fa552||0xc8;return function(_0x3c58b8){if(_0x3c58b8){return _0x434550['status'](_0x3fa552)[_0x6400('0x28')](_0x3c58b8);}};}function respondWithFilteredResult(_0x5116ea,_0x5f06ae){return function(_0x1de080){if(_0x1de080){var _0x4bb214=_0x1de080[_0x6400('0x29')],_0x234670=_0x5f06ae['offset'],_0x197b9d=_0x5f06ae['offset']+_0x5f06ae[_0x6400('0x2a')],_0x50f5e9;if(_0x197b9d>=_0x4bb214){_0x197b9d=_0x4bb214;_0x50f5e9=0xc8;}else{_0x50f5e9=0xce;}_0x5116ea[_0x6400('0x27')](_0x50f5e9);return _0x5116ea[_0x6400('0x2b')](_0x6400('0x2c'),_0x234670+'-'+_0x197b9d+'/'+_0x4bb214)[_0x6400('0x28')](_0x1de080);}return null;};}function patchUpdates(_0x54cf9f){return function(_0x3bed65){try{jsonpatch[_0x6400('0x2d')](_0x3bed65,_0x54cf9f,!![]);}catch(_0x454a2f){return BPromise[_0x6400('0x2e')](_0x454a2f);}return _0x3bed65['save']();};}function saveUpdates(_0x437624,_0x356f4d){return function(_0x115aec){if(_0x115aec){return _0x115aec['update'](_0x437624)[_0x6400('0x1c')](function(_0x301eb6){return _0x301eb6;});}return null;};}function removeEntity(_0x2eea52,_0x3564ac){return function(_0x503515){if(_0x503515){return _0x503515[_0x6400('0x2f')]()[_0x6400('0x1c')](function(){_0x2eea52['status'](0xcc)[_0x6400('0x30')]();});}};}function handleEntityNotFound(_0x37ab9a,_0x50ba26){return function(_0x4d7c7e){if(!_0x4d7c7e){_0x37ab9a[_0x6400('0x26')](0x194);}return _0x4d7c7e;};}function handleError(_0x23b15b,_0x13632e){_0x13632e=_0x13632e||0x1f4;return function(_0x5286a0){logger['error'](_0x5286a0['stack']);if(_0x5286a0[_0x6400('0x31')]){delete _0x5286a0[_0x6400('0x31')];}_0x23b15b[_0x6400('0x27')](_0x13632e)[_0x6400('0x32')](_0x5286a0);};}exports[_0x6400('0x33')]=function(_0x59995c,_0xc3c46){var _0x36f2a5={},_0x5eccda={},_0x51425c={'count':0x0,'rows':[]};var _0xff98f6=_[_0x6400('0x34')](db[_0x6400('0x35')]['rawAttributes'],function(_0x2693a5){return{'name':_0x2693a5[_0x6400('0x36')],'type':_0x2693a5[_0x6400('0x37')]['key']};});_0x5eccda[_0x6400('0x38')]=_[_0x6400('0x34')](_0xff98f6,_0x6400('0x31'));_0x5eccda['query']=_['keys'](_0x59995c['query']);_0x5eccda[_0x6400('0x39')]=_['intersection'](_0x5eccda['model'],_0x5eccda[_0x6400('0x3a')]);_0x36f2a5[_0x6400('0x3b')]=_['intersection'](_0x5eccda[_0x6400('0x38')],qs[_0x6400('0x3c')](_0x59995c[_0x6400('0x3a')]['fields']));_0x36f2a5[_0x6400('0x3b')]=_0x36f2a5[_0x6400('0x3b')][_0x6400('0x3d')]?_0x36f2a5[_0x6400('0x3b')]:_0x5eccda['model'];if(!_0x59995c['query'][_0x6400('0x3e')](_0x6400('0x3f'))){_0x36f2a5[_0x6400('0x2a')]=qs['limit'](_0x59995c[_0x6400('0x3a')][_0x6400('0x2a')]);_0x36f2a5[_0x6400('0x40')]=qs[_0x6400('0x40')](_0x59995c[_0x6400('0x3a')]['offset']);}_0x36f2a5[_0x6400('0x41')]=qs['sort'](_0x59995c[_0x6400('0x3a')][_0x6400('0x42')]);_0x36f2a5[_0x6400('0x43')]=qs[_0x6400('0x39')](_['pick'](_0x59995c[_0x6400('0x3a')],_0x5eccda[_0x6400('0x39')]));if(_0x59995c[_0x6400('0x3a')][_0x6400('0x44')]){_0x36f2a5['where']=_[_0x6400('0x45')](_0x36f2a5['where'],{'$or':_[_0x6400('0x34')](_0xff98f6,function(_0x52cc77){if(_0x52cc77[_0x6400('0x37')]!==_0x6400('0x46')){var _0x3084e8={};_0x3084e8[_0x52cc77['name']]={'$like':'%'+_0x59995c[_0x6400('0x3a')]['filter']+'%'};return _0x3084e8;}})});}_0x36f2a5=_[_0x6400('0x45')]({},_0x36f2a5,_0x59995c[_0x6400('0x47')]);var _0x3f444d={'where':_0x36f2a5[_0x6400('0x43')]};return db[_0x6400('0x35')][_0x6400('0x29')](_0x3f444d)[_0x6400('0x1c')](function(_0x3fb21a){_0x51425c[_0x6400('0x29')]=_0x3fb21a;if(_0x59995c[_0x6400('0x3a')][_0x6400('0x48')]){_0x36f2a5['include']=[{'all':!![]}];}return db[_0x6400('0x35')][_0x6400('0x49')](_0x36f2a5);})[_0x6400('0x1c')](function(_0x50df2e){_0x51425c[_0x6400('0x4a')]=_0x50df2e;return _0x51425c;})[_0x6400('0x1c')](respondWithFilteredResult(_0xc3c46,_0x36f2a5))[_0x6400('0x25')](handleError(_0xc3c46,null));};exports['show']=function(_0x412b48,_0x54cbfb){var _0x518ee4={'raw':![],'where':{'id':_0x412b48[_0x6400('0x4b')]['id']}},_0x539a5f={};_0x539a5f[_0x6400('0x38')]=_['keys'](db[_0x6400('0x35')][_0x6400('0x4c')]);_0x539a5f['query']=_['keys'](_0x412b48[_0x6400('0x3a')]);_0x539a5f[_0x6400('0x39')]=_['intersection'](_0x539a5f[_0x6400('0x38')],_0x539a5f[_0x6400('0x3a')]);_0x518ee4[_0x6400('0x3b')]=_[_0x6400('0x4d')](_0x539a5f[_0x6400('0x38')],qs[_0x6400('0x3c')](_0x412b48[_0x6400('0x3a')]['fields']));_0x518ee4[_0x6400('0x3b')]=_0x518ee4[_0x6400('0x3b')][_0x6400('0x3d')]?_0x518ee4[_0x6400('0x3b')]:_0x539a5f[_0x6400('0x38')];if(_0x412b48[_0x6400('0x3a')][_0x6400('0x48')]){_0x518ee4['include']=[{'all':!![]}];}_0x518ee4=_[_0x6400('0x45')]({},_0x518ee4,_0x412b48['options']);return db['FreshsalesConfiguration'][_0x6400('0x4e')](_0x518ee4)[_0x6400('0x1c')](handleEntityNotFound(_0x54cbfb,null))[_0x6400('0x1c')](respondWithResult(_0x54cbfb,null))['catch'](handleError(_0x54cbfb,null));};exports[_0x6400('0x4f')]=function(_0x324cf2,_0x2c50ca){return db[_0x6400('0x35')][_0x6400('0x4f')](_0x324cf2['body'],{})[_0x6400('0x1c')](respondWithResult(_0x2c50ca,0xc9))[_0x6400('0x25')](handleError(_0x2c50ca,null));};exports['update']=function(_0x3a6557,_0x3d4686){if(_0x3a6557[_0x6400('0x50')]['id']){delete _0x3a6557['body']['id'];}return db[_0x6400('0x35')]['find']({'where':{'id':_0x3a6557[_0x6400('0x4b')]['id']}})[_0x6400('0x1c')](handleEntityNotFound(_0x3d4686,null))[_0x6400('0x1c')](saveUpdates(_0x3a6557[_0x6400('0x50')],null))[_0x6400('0x1c')](respondWithResult(_0x3d4686,null))[_0x6400('0x25')](handleError(_0x3d4686,null));};exports['destroy']=function(_0x1ce65e,_0x1c7458){return db['FreshsalesConfiguration'][_0x6400('0x4e')]({'where':{'id':_0x1ce65e[_0x6400('0x4b')]['id']}})[_0x6400('0x1c')](handleEntityNotFound(_0x1c7458,null))[_0x6400('0x1c')](removeEntity(_0x1c7458,null))['catch'](handleError(_0x1c7458,null));};exports[_0x6400('0x51')]=function(_0x338d28,_0x2cd4a5,_0x3d68d9){var _0x38abb3={};var _0x184e4c={};var _0x3a70fa;var _0x31a726;return db[_0x6400('0x35')][_0x6400('0x52')]({'where':{'id':_0x338d28[_0x6400('0x4b')]['id']}})[_0x6400('0x1c')](handleEntityNotFound(_0x2cd4a5,null))['then'](function(_0x348670){if(_0x348670){_0x3a70fa=_0x348670;_0x184e4c[_0x6400('0x38')]=_['keys'](db[_0x6400('0x53')]['rawAttributes']);_0x184e4c[_0x6400('0x3a')]=_[_0x6400('0x54')](_0x338d28['query']);_0x184e4c[_0x6400('0x39')]=_['intersection'](_0x184e4c[_0x6400('0x38')],_0x184e4c['query']);_0x38abb3[_0x6400('0x3b')]=_[_0x6400('0x4d')](_0x184e4c[_0x6400('0x38')],qs[_0x6400('0x3c')](_0x338d28[_0x6400('0x3a')][_0x6400('0x3c')]));_0x38abb3['attributes']=_0x38abb3['attributes'][_0x6400('0x3d')]?_0x38abb3[_0x6400('0x3b')]:_0x184e4c['model'];_0x38abb3[_0x6400('0x41')]=qs['sort'](_0x338d28['query'][_0x6400('0x42')]);_0x38abb3[_0x6400('0x43')]=qs[_0x6400('0x39')](_[_0x6400('0x55')](_0x338d28[_0x6400('0x3a')],_0x184e4c[_0x6400('0x39')]));if(_0x338d28[_0x6400('0x3a')]['filter']){_0x38abb3[_0x6400('0x43')]=_[_0x6400('0x45')](_0x38abb3[_0x6400('0x43')],{'$or':_['map'](_0x38abb3['attributes'],function(_0x18a43d){var _0x2055d2={};_0x2055d2[_0x18a43d]={'$like':'%'+_0x338d28[_0x6400('0x3a')]['filter']+'%'};return _0x2055d2;})});}_0x38abb3=_[_0x6400('0x45')]({},_0x38abb3,_0x338d28['options']);return _0x3a70fa[_0x6400('0x51')](_0x38abb3);}})[_0x6400('0x1c')](function(_0x4d2260){if(_0x4d2260){_0x31a726=_0x4d2260[_0x6400('0x3d')];if(!_0x338d28[_0x6400('0x3a')][_0x6400('0x3e')](_0x6400('0x3f'))){_0x38abb3[_0x6400('0x2a')]=qs[_0x6400('0x2a')](_0x338d28[_0x6400('0x3a')]['limit']);_0x38abb3[_0x6400('0x40')]=qs[_0x6400('0x40')](_0x338d28[_0x6400('0x3a')][_0x6400('0x40')]);}return _0x3a70fa[_0x6400('0x51')](_0x38abb3);}})[_0x6400('0x1c')](function(_0x496b8d){if(_0x496b8d){return _0x496b8d?{'count':_0x31a726,'rows':_0x496b8d}:null;}})[_0x6400('0x1c')](respondWithResult(_0x2cd4a5,null))[_0x6400('0x25')](handleError(_0x2cd4a5,null));};exports['getDescriptions']=function(_0x5a6f0f,_0x5871e7,_0x4d6e93){var _0x34a7f5={};var _0x3774cb={};var _0x1e3cdf;var _0x4128e2;return db['FreshsalesConfiguration'][_0x6400('0x52')]({'where':{'id':_0x5a6f0f[_0x6400('0x4b')]['id']}})[_0x6400('0x1c')](handleEntityNotFound(_0x5871e7,null))[_0x6400('0x1c')](function(_0x12c877){if(_0x12c877){_0x1e3cdf=_0x12c877;_0x3774cb[_0x6400('0x38')]=_['keys'](db[_0x6400('0x53')][_0x6400('0x4c')]);_0x3774cb[_0x6400('0x3a')]=_[_0x6400('0x54')](_0x5a6f0f[_0x6400('0x3a')]);_0x3774cb[_0x6400('0x39')]=_[_0x6400('0x4d')](_0x3774cb['model'],_0x3774cb[_0x6400('0x3a')]);_0x34a7f5[_0x6400('0x3b')]=_[_0x6400('0x4d')](_0x3774cb[_0x6400('0x38')],qs[_0x6400('0x3c')](_0x5a6f0f[_0x6400('0x3a')][_0x6400('0x3c')]));_0x34a7f5[_0x6400('0x3b')]=_0x34a7f5[_0x6400('0x3b')][_0x6400('0x3d')]?_0x34a7f5[_0x6400('0x3b')]:_0x3774cb['model'];_0x34a7f5['order']=qs[_0x6400('0x42')](_0x5a6f0f['query']['sort']);_0x34a7f5[_0x6400('0x43')]=qs[_0x6400('0x39')](_[_0x6400('0x55')](_0x5a6f0f[_0x6400('0x3a')],_0x3774cb['filters']));if(_0x5a6f0f[_0x6400('0x3a')]['filter']){_0x34a7f5[_0x6400('0x43')]=_[_0x6400('0x45')](_0x34a7f5[_0x6400('0x43')],{'$or':_['map'](_0x34a7f5[_0x6400('0x3b')],function(_0x7de61b){var _0x3ea832={};_0x3ea832[_0x7de61b]={'$like':'%'+_0x5a6f0f['query'][_0x6400('0x44')]+'%'};return _0x3ea832;})});}_0x34a7f5=_[_0x6400('0x45')]({},_0x34a7f5,_0x5a6f0f['options']);return _0x1e3cdf[_0x6400('0x56')](_0x34a7f5);}})[_0x6400('0x1c')](function(_0xb3274f){if(_0xb3274f){_0x4128e2=_0xb3274f[_0x6400('0x3d')];if(!_0x5a6f0f['query']['hasOwnProperty']('nolimit')){_0x34a7f5[_0x6400('0x2a')]=qs[_0x6400('0x2a')](_0x5a6f0f[_0x6400('0x3a')][_0x6400('0x2a')]);_0x34a7f5['offset']=qs[_0x6400('0x40')](_0x5a6f0f[_0x6400('0x3a')][_0x6400('0x40')]);}return _0x1e3cdf[_0x6400('0x56')](_0x34a7f5);}})[_0x6400('0x1c')](function(_0x59d472){if(_0x59d472){return _0x59d472?{'count':_0x4128e2,'rows':_0x59d472}:null;}})['then'](respondWithResult(_0x5871e7,null))[_0x6400('0x25')](handleError(_0x5871e7,null));};exports['getFields']=function(_0x466264,_0x3f2460,_0x36a773){var _0x5d98d3={};var _0x43225c={};var _0x30a379;var _0x32da65;return db[_0x6400('0x35')][_0x6400('0x52')]({'where':{'id':_0x466264[_0x6400('0x4b')]['id']}})[_0x6400('0x1c')](handleEntityNotFound(_0x3f2460,null))[_0x6400('0x1c')](function(_0xfd3b7b){if(_0xfd3b7b){_0x30a379=_0xfd3b7b;_0x43225c[_0x6400('0x38')]=_['keys'](db[_0x6400('0x53')]['rawAttributes']);_0x43225c[_0x6400('0x3a')]=_[_0x6400('0x54')](_0x466264[_0x6400('0x3a')]);_0x43225c[_0x6400('0x39')]=_[_0x6400('0x4d')](_0x43225c[_0x6400('0x38')],_0x43225c[_0x6400('0x3a')]);_0x5d98d3[_0x6400('0x3b')]=_[_0x6400('0x4d')](_0x43225c['model'],qs[_0x6400('0x3c')](_0x466264[_0x6400('0x3a')][_0x6400('0x3c')]));_0x5d98d3[_0x6400('0x3b')]=_0x5d98d3[_0x6400('0x3b')][_0x6400('0x3d')]?_0x5d98d3['attributes']:_0x43225c[_0x6400('0x38')];_0x5d98d3['order']=qs['sort'](_0x466264[_0x6400('0x3a')][_0x6400('0x42')]);_0x5d98d3[_0x6400('0x43')]=qs[_0x6400('0x39')](_['pick'](_0x466264['query'],_0x43225c[_0x6400('0x39')]));if(_0x466264['query'][_0x6400('0x44')]){_0x5d98d3['where']=_['merge'](_0x5d98d3[_0x6400('0x43')],{'$or':_[_0x6400('0x34')](_0x5d98d3[_0x6400('0x3b')],function(_0x7a5e36){var _0x173c20={};_0x173c20[_0x7a5e36]={'$like':'%'+_0x466264[_0x6400('0x3a')]['filter']+'%'};return _0x173c20;})});}_0x5d98d3=_['merge']({},_0x5d98d3,_0x466264[_0x6400('0x47')]);return _0x30a379[_0x6400('0x57')](_0x5d98d3);}})['then'](function(_0x1fb06b){if(_0x1fb06b){_0x32da65=_0x1fb06b['length'];if(!_0x466264[_0x6400('0x3a')][_0x6400('0x3e')](_0x6400('0x3f'))){_0x5d98d3[_0x6400('0x2a')]=qs[_0x6400('0x2a')](_0x466264[_0x6400('0x3a')][_0x6400('0x2a')]);_0x5d98d3['offset']=qs[_0x6400('0x40')](_0x466264['query']['offset']);}return _0x30a379[_0x6400('0x57')](_0x5d98d3);}})[_0x6400('0x1c')](function(_0x59ba50){if(_0x59ba50){return _0x59ba50?{'count':_0x32da65,'rows':_0x59ba50}:null;}})[_0x6400('0x1c')](respondWithResult(_0x3f2460,null))[_0x6400('0x25')](handleError(_0x3f2460,null));}; \ No newline at end of file +var _0x0ec6=['limit','order','sort','where','filter','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','getSubjects','FreshsalesField','pick','nolimit','getDescriptions','getFields','findOne','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','attributes','fields','hasOwnProperty'];(function(_0x594373,_0xecf1b7){var _0x28cd4c=function(_0x4e1f11){while(--_0x4e1f11){_0x594373['push'](_0x594373['shift']());}};_0x28cd4c(++_0xecf1b7);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x44d173,_0x5a7320){_0x44d173=_0x44d173-0x0;var _0x39e3d2=_0x0ec6[_0x44d173];return _0x39e3d2;};'use strict';var pdf=require(_0x60ec('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x60ec('0x1'));var jsonpatch=require(_0x60ec('0x2'));var rp=require(_0x60ec('0x3'));var moment=require(_0x60ec('0x4'));var BPromise=require(_0x60ec('0x5'));var Mustache=require(_0x60ec('0x6'));var util=require(_0x60ec('0x7'));var path=require('path');var sox=require(_0x60ec('0x8'));var csv=require(_0x60ec('0x9'));var ejs=require(_0x60ec('0xa'));var fs=require('fs');var _=require(_0x60ec('0xb'));var squel=require('squel');var crypto=require(_0x60ec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x60ec('0xd'));var toCsv=require(_0x60ec('0x9'));var querystring=require(_0x60ec('0xe'));var Papa=require(_0x60ec('0xf'));var Redis=require(_0x60ec('0x10'));var authService=require(_0x60ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60ec('0x12'));var logger=require(_0x60ec('0x13'))(_0x60ec('0x14'));var utils=require(_0x60ec('0x15'));var config=require(_0x60ec('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x60ec('0x17')][_0x60ec('0x18')]({'port':0x232a});function checkPasswordPattern(_0x103a72,_0x378d60,_0x34c615){if(_0x34c615){var _0x5e280a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e280a[_0x60ec('0x19')](_0x378d60)){return _0x103a72;}else{throw new db[(_0x60ec('0x1a'))][(_0x60ec('0x1b'))](_0x60ec('0x1c'));}}else{return _0x103a72;}}function respondWithRpcPromise(_0x31dbc3,_0x23298f,_0x1f7c76,_0x19dd55){return new BPromise(function(_0x448553,_0x5372e9){var _0x2b3c12=_0x19dd55||client;return _0x2b3c12[_0x60ec('0x1d')](_0x31dbc3,_0x1f7c76)[_0x60ec('0x1e')](function(_0x155bdc){logger[_0x60ec('0x1f')](_0x60ec('0x20'),_0x23298f,_0x60ec('0x21'));logger[_0x60ec('0x22')](_0x60ec('0x23'),_0x23298f,_0x60ec('0x21'),JSON[_0x60ec('0x24')](_0x155bdc));if(_0x155bdc[_0x60ec('0x25')]){if(_0x155bdc['error'][_0x60ec('0x26')]===0x1f4){logger[_0x60ec('0x25')](_0x60ec('0x20'),_0x23298f,_0x155bdc[_0x60ec('0x25')]['message']);return _0x5372e9(_0x155bdc[_0x60ec('0x25')][_0x60ec('0x27')]);}logger[_0x60ec('0x25')](_0x60ec('0x20'),_0x23298f,_0x155bdc[_0x60ec('0x25')][_0x60ec('0x27')]);return _0x448553(_0x155bdc['error']['message']);}else{logger['info'](_0x60ec('0x20'),_0x23298f,_0x60ec('0x21'));_0x448553(_0x155bdc[_0x60ec('0x28')][_0x60ec('0x27')]);}})['catch'](function(_0x51e4ef){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x23298f,_0x51e4ef);_0x5372e9(_0x51e4ef);});});}function respondWithStatusCode(_0x317b9a,_0x474374){_0x474374=_0x474374||0xcc;return function(_0x42d1c2){if(_0x42d1c2){return _0x317b9a[_0x60ec('0x29')](_0x474374);}return _0x317b9a[_0x60ec('0x2a')](_0x474374)[_0x60ec('0x2b')]();};}function respondWithResult(_0x155c82,_0x22e66c){_0x22e66c=_0x22e66c||0xc8;return function(_0x1da3bb){if(_0x1da3bb){return _0x155c82['status'](_0x22e66c)[_0x60ec('0x2c')](_0x1da3bb);}};}function respondWithFilteredResult(_0x449439,_0x55449b){return function(_0x31c3b9){if(_0x31c3b9){var _0xf3817d=_0x31c3b9[_0x60ec('0x2d')],_0x3423fb=_0x55449b[_0x60ec('0x2e')],_0x1b912c=_0x55449b['offset']+_0x55449b['limit'],_0x4440c7;if(_0x1b912c>=_0xf3817d){_0x1b912c=_0xf3817d;_0x4440c7=0xc8;}else{_0x4440c7=0xce;}_0x449439[_0x60ec('0x2a')](_0x4440c7);return _0x449439[_0x60ec('0x2f')]('Content-Range',_0x3423fb+'-'+_0x1b912c+'/'+_0xf3817d)['json'](_0x31c3b9);}return null;};}function patchUpdates(_0x1cb821){return function(_0x54348a){try{jsonpatch[_0x60ec('0x30')](_0x54348a,_0x1cb821,!![]);}catch(_0x3a4f86){return BPromise[_0x60ec('0x31')](_0x3a4f86);}return _0x54348a[_0x60ec('0x32')]();};}function saveUpdates(_0x1a836a,_0x4a9a9d){return function(_0x2a894f){if(_0x2a894f){return _0x2a894f[_0x60ec('0x33')](_0x1a836a)[_0x60ec('0x1e')](function(_0x371b0a){return _0x371b0a;});}return null;};}function removeEntity(_0x2f8a54,_0x1300e7){return function(_0x4923d0){if(_0x4923d0){return _0x4923d0[_0x60ec('0x34')]()[_0x60ec('0x1e')](function(){_0x2f8a54['status'](0xcc)[_0x60ec('0x2b')]();});}};}function handleEntityNotFound(_0x12718c,_0x387f47){return function(_0x23de20){if(!_0x23de20){_0x12718c['sendStatus'](0x194);}return _0x23de20;};}function handleError(_0x9c07a7,_0x3e7795){_0x3e7795=_0x3e7795||0x1f4;return function(_0x2a99d2){logger[_0x60ec('0x25')](_0x2a99d2[_0x60ec('0x35')]);if(_0x2a99d2[_0x60ec('0x36')]){delete _0x2a99d2[_0x60ec('0x36')];}_0x9c07a7[_0x60ec('0x2a')](_0x3e7795)[_0x60ec('0x37')](_0x2a99d2);};}exports[_0x60ec('0x38')]=function(_0x259b22,_0x36f3bf){var _0x38e5c4={},_0x1b2462={},_0x342c09={'count':0x0,'rows':[]};var _0x2effe1=_[_0x60ec('0x39')](db['FreshsalesConfiguration'][_0x60ec('0x3a')],function(_0x87e41c){return{'name':_0x87e41c['fieldName'],'type':_0x87e41c[_0x60ec('0x3b')]['key']};});_0x1b2462[_0x60ec('0x3c')]=_[_0x60ec('0x39')](_0x2effe1,_0x60ec('0x36'));_0x1b2462[_0x60ec('0x3d')]=_[_0x60ec('0x3e')](_0x259b22[_0x60ec('0x3d')]);_0x1b2462[_0x60ec('0x3f')]=_['intersection'](_0x1b2462['model'],_0x1b2462['query']);_0x38e5c4[_0x60ec('0x40')]=_['intersection'](_0x1b2462[_0x60ec('0x3c')],qs[_0x60ec('0x41')](_0x259b22['query'][_0x60ec('0x41')]));_0x38e5c4['attributes']=_0x38e5c4['attributes']['length']?_0x38e5c4[_0x60ec('0x40')]:_0x1b2462[_0x60ec('0x3c')];if(!_0x259b22[_0x60ec('0x3d')][_0x60ec('0x42')]('nolimit')){_0x38e5c4[_0x60ec('0x43')]=qs[_0x60ec('0x43')](_0x259b22[_0x60ec('0x3d')][_0x60ec('0x43')]);_0x38e5c4[_0x60ec('0x2e')]=qs[_0x60ec('0x2e')](_0x259b22[_0x60ec('0x3d')][_0x60ec('0x2e')]);}_0x38e5c4[_0x60ec('0x44')]=qs[_0x60ec('0x45')](_0x259b22[_0x60ec('0x3d')][_0x60ec('0x45')]);_0x38e5c4[_0x60ec('0x46')]=qs[_0x60ec('0x3f')](_['pick'](_0x259b22[_0x60ec('0x3d')],_0x1b2462[_0x60ec('0x3f')]));if(_0x259b22['query'][_0x60ec('0x47')]){_0x38e5c4['where']=_[_0x60ec('0x48')](_0x38e5c4[_0x60ec('0x46')],{'$or':_[_0x60ec('0x39')](_0x2effe1,function(_0x2e30b5){if(_0x2e30b5[_0x60ec('0x3b')]!=='VIRTUAL'){var _0x130d09={};_0x130d09[_0x2e30b5['name']]={'$like':'%'+_0x259b22[_0x60ec('0x3d')][_0x60ec('0x47')]+'%'};return _0x130d09;}})});}_0x38e5c4=_[_0x60ec('0x48')]({},_0x38e5c4,_0x259b22[_0x60ec('0x49')]);var _0x3b8b9d={'where':_0x38e5c4['where']};return db[_0x60ec('0x4a')]['count'](_0x3b8b9d)[_0x60ec('0x1e')](function(_0x39067b){_0x342c09['count']=_0x39067b;if(_0x259b22['query'][_0x60ec('0x4b')]){_0x38e5c4[_0x60ec('0x4c')]=[{'all':!![]}];}return db[_0x60ec('0x4a')][_0x60ec('0x4d')](_0x38e5c4);})[_0x60ec('0x1e')](function(_0x2a3963){_0x342c09[_0x60ec('0x4e')]=_0x2a3963;return _0x342c09;})[_0x60ec('0x1e')](respondWithFilteredResult(_0x36f3bf,_0x38e5c4))[_0x60ec('0x4f')](handleError(_0x36f3bf,null));};exports[_0x60ec('0x50')]=function(_0xc3c51d,_0x3c10af){var _0x43bfcf={'raw':![],'where':{'id':_0xc3c51d[_0x60ec('0x51')]['id']}},_0x3e838c={};_0x3e838c['model']=_[_0x60ec('0x3e')](db[_0x60ec('0x4a')][_0x60ec('0x3a')]);_0x3e838c[_0x60ec('0x3d')]=_[_0x60ec('0x3e')](_0xc3c51d['query']);_0x3e838c[_0x60ec('0x3f')]=_['intersection'](_0x3e838c[_0x60ec('0x3c')],_0x3e838c[_0x60ec('0x3d')]);_0x43bfcf['attributes']=_[_0x60ec('0x52')](_0x3e838c[_0x60ec('0x3c')],qs['fields'](_0xc3c51d['query'][_0x60ec('0x41')]));_0x43bfcf['attributes']=_0x43bfcf['attributes'][_0x60ec('0x53')]?_0x43bfcf['attributes']:_0x3e838c[_0x60ec('0x3c')];if(_0xc3c51d[_0x60ec('0x3d')]['includeAll']){_0x43bfcf[_0x60ec('0x4c')]=[{'all':!![]}];}_0x43bfcf=_[_0x60ec('0x48')]({},_0x43bfcf,_0xc3c51d[_0x60ec('0x49')]);return db['FreshsalesConfiguration'][_0x60ec('0x54')](_0x43bfcf)[_0x60ec('0x1e')](handleEntityNotFound(_0x3c10af,null))[_0x60ec('0x1e')](respondWithResult(_0x3c10af,null))[_0x60ec('0x4f')](handleError(_0x3c10af,null));};exports[_0x60ec('0x55')]=function(_0x2cfb5a,_0x33458c){return db[_0x60ec('0x4a')]['create'](_0x2cfb5a[_0x60ec('0x56')],{})[_0x60ec('0x1e')](respondWithResult(_0x33458c,0xc9))[_0x60ec('0x4f')](handleError(_0x33458c,null));};exports[_0x60ec('0x33')]=function(_0x4ea1f0,_0x434e48){if(_0x4ea1f0[_0x60ec('0x56')]['id']){delete _0x4ea1f0[_0x60ec('0x56')]['id'];}return db['FreshsalesConfiguration'][_0x60ec('0x54')]({'where':{'id':_0x4ea1f0[_0x60ec('0x51')]['id']}})[_0x60ec('0x1e')](handleEntityNotFound(_0x434e48,null))[_0x60ec('0x1e')](saveUpdates(_0x4ea1f0['body'],null))[_0x60ec('0x1e')](respondWithResult(_0x434e48,null))['catch'](handleError(_0x434e48,null));};exports[_0x60ec('0x34')]=function(_0x535dec,_0x4ebeeb){return db[_0x60ec('0x4a')][_0x60ec('0x54')]({'where':{'id':_0x535dec['params']['id']}})[_0x60ec('0x1e')](handleEntityNotFound(_0x4ebeeb,null))[_0x60ec('0x1e')](removeEntity(_0x4ebeeb,null))[_0x60ec('0x4f')](handleError(_0x4ebeeb,null));};exports[_0x60ec('0x57')]=function(_0x32e111,_0x2add8a,_0x4212c0){var _0x594b07={};var _0x4dc032={};var _0x257dbf;var _0x168be2;return db[_0x60ec('0x4a')]['findOne']({'where':{'id':_0x32e111['params']['id']}})[_0x60ec('0x1e')](handleEntityNotFound(_0x2add8a,null))['then'](function(_0x22dc71){if(_0x22dc71){_0x257dbf=_0x22dc71;_0x4dc032[_0x60ec('0x3c')]=_[_0x60ec('0x3e')](db[_0x60ec('0x58')][_0x60ec('0x3a')]);_0x4dc032[_0x60ec('0x3d')]=_['keys'](_0x32e111[_0x60ec('0x3d')]);_0x4dc032[_0x60ec('0x3f')]=_['intersection'](_0x4dc032['model'],_0x4dc032[_0x60ec('0x3d')]);_0x594b07[_0x60ec('0x40')]=_[_0x60ec('0x52')](_0x4dc032[_0x60ec('0x3c')],qs[_0x60ec('0x41')](_0x32e111[_0x60ec('0x3d')][_0x60ec('0x41')]));_0x594b07['attributes']=_0x594b07[_0x60ec('0x40')][_0x60ec('0x53')]?_0x594b07[_0x60ec('0x40')]:_0x4dc032[_0x60ec('0x3c')];_0x594b07['order']=qs[_0x60ec('0x45')](_0x32e111[_0x60ec('0x3d')][_0x60ec('0x45')]);_0x594b07[_0x60ec('0x46')]=qs[_0x60ec('0x3f')](_[_0x60ec('0x59')](_0x32e111[_0x60ec('0x3d')],_0x4dc032[_0x60ec('0x3f')]));if(_0x32e111['query'][_0x60ec('0x47')]){_0x594b07[_0x60ec('0x46')]=_['merge'](_0x594b07[_0x60ec('0x46')],{'$or':_[_0x60ec('0x39')](_0x594b07[_0x60ec('0x40')],function(_0x477344){var _0x26b352={};_0x26b352[_0x477344]={'$like':'%'+_0x32e111[_0x60ec('0x3d')][_0x60ec('0x47')]+'%'};return _0x26b352;})});}_0x594b07=_[_0x60ec('0x48')]({},_0x594b07,_0x32e111[_0x60ec('0x49')]);return _0x257dbf[_0x60ec('0x57')](_0x594b07);}})[_0x60ec('0x1e')](function(_0x360cf1){if(_0x360cf1){_0x168be2=_0x360cf1['length'];if(!_0x32e111[_0x60ec('0x3d')][_0x60ec('0x42')](_0x60ec('0x5a'))){_0x594b07[_0x60ec('0x43')]=qs['limit'](_0x32e111[_0x60ec('0x3d')][_0x60ec('0x43')]);_0x594b07[_0x60ec('0x2e')]=qs['offset'](_0x32e111['query'][_0x60ec('0x2e')]);}return _0x257dbf[_0x60ec('0x57')](_0x594b07);}})['then'](function(_0x3860ab){if(_0x3860ab){return _0x3860ab?{'count':_0x168be2,'rows':_0x3860ab}:null;}})[_0x60ec('0x1e')](respondWithResult(_0x2add8a,null))[_0x60ec('0x4f')](handleError(_0x2add8a,null));};exports['getDescriptions']=function(_0x2f91d1,_0x4542cc,_0x48632e){var _0x35a786={};var _0x265ca9={};var _0x24d51e;var _0xaa4386;return db[_0x60ec('0x4a')]['findOne']({'where':{'id':_0x2f91d1[_0x60ec('0x51')]['id']}})[_0x60ec('0x1e')](handleEntityNotFound(_0x4542cc,null))[_0x60ec('0x1e')](function(_0x2d90c8){if(_0x2d90c8){_0x24d51e=_0x2d90c8;_0x265ca9[_0x60ec('0x3c')]=_[_0x60ec('0x3e')](db[_0x60ec('0x58')]['rawAttributes']);_0x265ca9['query']=_[_0x60ec('0x3e')](_0x2f91d1[_0x60ec('0x3d')]);_0x265ca9[_0x60ec('0x3f')]=_['intersection'](_0x265ca9[_0x60ec('0x3c')],_0x265ca9[_0x60ec('0x3d')]);_0x35a786[_0x60ec('0x40')]=_[_0x60ec('0x52')](_0x265ca9[_0x60ec('0x3c')],qs[_0x60ec('0x41')](_0x2f91d1[_0x60ec('0x3d')][_0x60ec('0x41')]));_0x35a786[_0x60ec('0x40')]=_0x35a786[_0x60ec('0x40')][_0x60ec('0x53')]?_0x35a786[_0x60ec('0x40')]:_0x265ca9[_0x60ec('0x3c')];_0x35a786[_0x60ec('0x44')]=qs[_0x60ec('0x45')](_0x2f91d1[_0x60ec('0x3d')][_0x60ec('0x45')]);_0x35a786[_0x60ec('0x46')]=qs[_0x60ec('0x3f')](_[_0x60ec('0x59')](_0x2f91d1['query'],_0x265ca9[_0x60ec('0x3f')]));if(_0x2f91d1[_0x60ec('0x3d')][_0x60ec('0x47')]){_0x35a786[_0x60ec('0x46')]=_[_0x60ec('0x48')](_0x35a786['where'],{'$or':_['map'](_0x35a786[_0x60ec('0x40')],function(_0x436735){var _0xc23a9a={};_0xc23a9a[_0x436735]={'$like':'%'+_0x2f91d1[_0x60ec('0x3d')]['filter']+'%'};return _0xc23a9a;})});}_0x35a786=_[_0x60ec('0x48')]({},_0x35a786,_0x2f91d1[_0x60ec('0x49')]);return _0x24d51e[_0x60ec('0x5b')](_0x35a786);}})['then'](function(_0x7e9bc8){if(_0x7e9bc8){_0xaa4386=_0x7e9bc8[_0x60ec('0x53')];if(!_0x2f91d1['query'][_0x60ec('0x42')](_0x60ec('0x5a'))){_0x35a786[_0x60ec('0x43')]=qs[_0x60ec('0x43')](_0x2f91d1['query'][_0x60ec('0x43')]);_0x35a786[_0x60ec('0x2e')]=qs[_0x60ec('0x2e')](_0x2f91d1['query']['offset']);}return _0x24d51e[_0x60ec('0x5b')](_0x35a786);}})['then'](function(_0x4d7747){if(_0x4d7747){return _0x4d7747?{'count':_0xaa4386,'rows':_0x4d7747}:null;}})[_0x60ec('0x1e')](respondWithResult(_0x4542cc,null))[_0x60ec('0x4f')](handleError(_0x4542cc,null));};exports[_0x60ec('0x5c')]=function(_0x2f56b4,_0x2412fc,_0x47068a){var _0x1c513b={};var _0x12c7a8={};var _0xe9df4f;var _0x350a3b;return db[_0x60ec('0x4a')][_0x60ec('0x5d')]({'where':{'id':_0x2f56b4[_0x60ec('0x51')]['id']}})[_0x60ec('0x1e')](handleEntityNotFound(_0x2412fc,null))['then'](function(_0x20244d){if(_0x20244d){_0xe9df4f=_0x20244d;_0x12c7a8[_0x60ec('0x3c')]=_[_0x60ec('0x3e')](db[_0x60ec('0x58')][_0x60ec('0x3a')]);_0x12c7a8['query']=_['keys'](_0x2f56b4[_0x60ec('0x3d')]);_0x12c7a8[_0x60ec('0x3f')]=_[_0x60ec('0x52')](_0x12c7a8['model'],_0x12c7a8['query']);_0x1c513b[_0x60ec('0x40')]=_[_0x60ec('0x52')](_0x12c7a8[_0x60ec('0x3c')],qs[_0x60ec('0x41')](_0x2f56b4['query'][_0x60ec('0x41')]));_0x1c513b['attributes']=_0x1c513b[_0x60ec('0x40')][_0x60ec('0x53')]?_0x1c513b[_0x60ec('0x40')]:_0x12c7a8[_0x60ec('0x3c')];_0x1c513b[_0x60ec('0x44')]=qs[_0x60ec('0x45')](_0x2f56b4[_0x60ec('0x3d')]['sort']);_0x1c513b[_0x60ec('0x46')]=qs[_0x60ec('0x3f')](_[_0x60ec('0x59')](_0x2f56b4[_0x60ec('0x3d')],_0x12c7a8[_0x60ec('0x3f')]));if(_0x2f56b4['query']['filter']){_0x1c513b['where']=_[_0x60ec('0x48')](_0x1c513b[_0x60ec('0x46')],{'$or':_[_0x60ec('0x39')](_0x1c513b[_0x60ec('0x40')],function(_0x4e14a9){var _0x432b3c={};_0x432b3c[_0x4e14a9]={'$like':'%'+_0x2f56b4['query']['filter']+'%'};return _0x432b3c;})});}_0x1c513b=_[_0x60ec('0x48')]({},_0x1c513b,_0x2f56b4[_0x60ec('0x49')]);return _0xe9df4f['getFields'](_0x1c513b);}})[_0x60ec('0x1e')](function(_0xc2e703){if(_0xc2e703){_0x350a3b=_0xc2e703[_0x60ec('0x53')];if(!_0x2f56b4[_0x60ec('0x3d')][_0x60ec('0x42')]('nolimit')){_0x1c513b['limit']=qs[_0x60ec('0x43')](_0x2f56b4[_0x60ec('0x3d')]['limit']);_0x1c513b[_0x60ec('0x2e')]=qs[_0x60ec('0x2e')](_0x2f56b4['query'][_0x60ec('0x2e')]);}return _0xe9df4f[_0x60ec('0x5c')](_0x1c513b);}})['then'](function(_0x9848c6){if(_0x9848c6){return _0x9848c6?{'count':_0x350a3b,'rows':_0x9848c6}:null;}})[_0x60ec('0x1e')](respondWithResult(_0x2412fc,null))[_0x60ec('0x4f')](handleError(_0x2412fc,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 5d89b2c..afd6b42 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0884=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','lodash'];(function(_0x32c12a,_0x203c03){var _0x316553=function(_0x13ed0f){while(--_0x13ed0f){_0x32c12a['push'](_0x32c12a['shift']());}};_0x316553(++_0x203c03);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4088('0x0'));var util=require(_0x4088('0x1'));var logger=require(_0x4088('0x2'))(_0x4088('0x3'));var moment=require(_0x4088('0x4'));var BPromise=require(_0x4088('0x5'));var rp=require(_0x4088('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4088('0x7'));var config=require(_0x4088('0x8'));var attributes=require(_0x4088('0x9'));module[_0x4088('0xa')]=function(_0x3b1d74,_0x4da2f7){return _0x3b1d74['define'](_0x4088('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d8f=['bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x6d8f,0xdf));var _0xf6d8=function(_0x4f29a4,_0x57c0b2){_0x4f29a4=_0x4f29a4-0x0;var _0x35d220=_0x6d8f[_0x4f29a4];return _0x35d220;};'use strict';var _=require(_0xf6d8('0x0'));var util=require(_0xf6d8('0x1'));var logger=require(_0xf6d8('0x2'))(_0xf6d8('0x3'));var moment=require(_0xf6d8('0x4'));var BPromise=require(_0xf6d8('0x5'));var rp=require(_0xf6d8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6d8('0x7'));var config=require('../../config/environment');var attributes=require(_0xf6d8('0x8'));module['exports']=function(_0x775d99,_0x15c4de){return _0x775d99[_0xf6d8('0x9')](_0xf6d8('0xa'),attributes,{'tableName':_0xf6d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 58f6116..0a11591 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x073e=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x4f28b6,_0x43c89e){var _0x7ef2ac=function(_0x6b1e46){while(--_0x6b1e46){_0x4f28b6['push'](_0x4f28b6['shift']());}};_0x7ef2ac(++_0x43c89e);}(_0x073e,0x181));var _0xe073=function(_0x18d699,_0x165e23){_0x18d699=_0x18d699-0x0;var _0x509f0c=_0x073e[_0x18d699];return _0x509f0c;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var moment=require(_0xe073('0x2'));var BPromise=require(_0xe073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe073('0x4'));var logger=require(_0xe073('0x5'))(_0xe073('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe073('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44092d,_0x1bcaae,_0x3b4fc7){return new BPromise(function(_0x373bf6,_0x1a93da){return client['request'](_0x44092d,_0x3b4fc7)[_0xe073('0x8')](function(_0x7a1f21){logger[_0xe073('0x9')](_0xe073('0xa'),_0x1bcaae,'request\x20sent');logger[_0xe073('0xb')](_0xe073('0xc'),_0x1bcaae,_0xe073('0xd'),JSON[_0xe073('0xe')](_0x7a1f21));if(_0x7a1f21[_0xe073('0xf')]){if(_0x7a1f21[_0xe073('0xf')]['code']===0x1f4){logger[_0xe073('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1bcaae,_0x7a1f21[_0xe073('0xf')]['message']);return _0x1a93da(_0x7a1f21[_0xe073('0xf')]['message']);}logger[_0xe073('0xf')](_0xe073('0xa'),_0x1bcaae,_0x7a1f21[_0xe073('0xf')][_0xe073('0x10')]);return _0x373bf6(_0x7a1f21[_0xe073('0xf')][_0xe073('0x10')]);}else{logger[_0xe073('0x9')](_0xe073('0xa'),_0x1bcaae,_0xe073('0xd'));_0x373bf6(_0x7a1f21[_0xe073('0x11')][_0xe073('0x10')]);}})['catch'](function(_0x511ab2){logger['error'](_0xe073('0xa'),_0x1bcaae,_0x511ab2);_0x1a93da(_0x511ab2);});});} \ No newline at end of file +var _0xfd3a=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x289b0b,_0x15fbb3){var _0x30b646=function(_0x4fcd79){while(--_0x4fcd79){_0x289b0b['push'](_0x289b0b['shift']());}};_0x30b646(++_0x15fbb3);}(_0xfd3a,0x179));var _0xafd3=function(_0x58370e,_0x16bd7b){_0x58370e=_0x58370e-0x0;var _0x134bfd=_0xfd3a[_0x58370e];return _0x134bfd;};'use strict';var _=require(_0xafd3('0x0'));var util=require(_0xafd3('0x1'));var moment=require(_0xafd3('0x2'));var BPromise=require(_0xafd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafd3('0x4'))['db'];var utils=require(_0xafd3('0x5'));var logger=require(_0xafd3('0x6'))(_0xafd3('0x7'));var config=require(_0xafd3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xafd3('0x9')][_0xafd3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f7e16,_0x3766aa,_0xd2d780){return new BPromise(function(_0x4c4dcd,_0x478d8a){return client[_0xafd3('0xb')](_0x1f7e16,_0xd2d780)[_0xafd3('0xc')](function(_0x4d8860){logger[_0xafd3('0xd')](_0xafd3('0xe'),_0x3766aa,_0xafd3('0xf'));logger[_0xafd3('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x3766aa,'request\x20sent',JSON[_0xafd3('0x11')](_0x4d8860));if(_0x4d8860[_0xafd3('0x12')]){if(_0x4d8860['error']['code']===0x1f4){logger[_0xafd3('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3766aa,_0x4d8860[_0xafd3('0x12')][_0xafd3('0x13')]);return _0x478d8a(_0x4d8860[_0xafd3('0x12')]['message']);}logger[_0xafd3('0x12')](_0xafd3('0xe'),_0x3766aa,_0x4d8860[_0xafd3('0x12')][_0xafd3('0x13')]);return _0x4c4dcd(_0x4d8860[_0xafd3('0x12')][_0xafd3('0x13')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3766aa,'request\x20sent');_0x4c4dcd(_0x4d8860[_0xafd3('0x14')][_0xafd3('0x13')]);}})[_0xafd3('0x15')](function(_0x8e25de){logger[_0xafd3('0x12')](_0xafd3('0xe'),_0x3766aa,_0x8e25de);_0x478d8a(_0x8e25de);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index e445067..740e31a 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33f5=['show','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','index','get','/:id','isAuthenticated'];(function(_0x2f1c69,_0x3cee59){var _0x1601c5=function(_0x3d4b07){while(--_0x3d4b07){_0x2f1c69['push'](_0x2f1c69['shift']());}};_0x1601c5(++_0x3cee59);}(_0x33f5,0x1e1));var _0x533f=function(_0x414d8a,_0xc3f226){_0x414d8a=_0x414d8a-0x0;var _0x5b3717=_0x33f5[_0x414d8a];return _0x5b3717;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x533f('0x0'));var timeout=require(_0x533f('0x1'));var express=require(_0x533f('0x2'));var router=express[_0x533f('0x3')]();var auth=require(_0x533f('0x4'));var interaction=require(_0x533f('0x5'));var config=require(_0x533f('0x6'));var controller=require(_0x533f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x533f('0x8')]);router[_0x533f('0x9')](_0x533f('0xa'),auth[_0x533f('0xb')](),controller[_0x533f('0xc')]);router['post']('/',auth[_0x533f('0xb')](),controller['create']);router[_0x533f('0xd')](_0x533f('0xa'),auth[_0x533f('0xb')](),controller['update']);router[_0x533f('0xe')](_0x533f('0xa'),auth[_0x533f('0xb')](),controller[_0x533f('0xf')]);module[_0x533f('0x10')]=router; \ No newline at end of file +var _0xecac=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x37858a,_0x3b523f){var _0x1ff350=function(_0x13f59c){while(--_0x13f59c){_0x37858a['push'](_0x37858a['shift']());}};_0x1ff350(++_0x3b523f);}(_0xecac,0x160));var _0xceca=function(_0xc9a81d,_0x2db658){_0xc9a81d=_0xc9a81d-0x0;var _0x5c1047=_0xecac[_0xc9a81d];return _0x5c1047;};'use strict';var multer=require(_0xceca('0x0'));var util=require(_0xceca('0x1'));var path=require(_0xceca('0x2'));var timeout=require(_0xceca('0x3'));var express=require(_0xceca('0x4'));var router=express[_0xceca('0x5')]();var auth=require(_0xceca('0x6'));var interaction=require(_0xceca('0x7'));var config=require(_0xceca('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xceca('0x9')]('/',auth[_0xceca('0xa')](),controller[_0xceca('0xb')]);router[_0xceca('0x9')](_0xceca('0xc'),auth[_0xceca('0xa')](),controller[_0xceca('0xd')]);router[_0xceca('0xe')]('/',auth['isAuthenticated'](),controller[_0xceca('0xf')]);router[_0xceca('0x10')](_0xceca('0xc'),auth[_0xceca('0xa')](),controller[_0xceca('0x11')]);router[_0xceca('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xceca('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 06132cc..01f27d7 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5400=['STRING','sequelize','exports','string','variable'];(function(_0x1b13ec,_0x2ae19c){var _0x30d1b6=function(_0x1b29ce){while(--_0x1b29ce){_0x1b13ec['push'](_0x1b13ec['shift']());}};_0x30d1b6(++_0x2ae19c);}(_0x5400,0x15f));var _0x0540=function(_0x2b77c3,_0x1afa5b){_0x2b77c3=_0x2b77c3-0x0;var _0xaa22b0=_0x5400[_0x2b77c3];return _0xaa22b0;};'use strict';var Sequelize=require(_0x0540('0x0'));module[_0x0540('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable','keyValue'),'defaultValue':_0x0540('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x0540('0x2'),_0x0540('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0540('0x4')]},'idField':{'type':Sequelize[_0x0540('0x4')]},'nameField':{'type':Sequelize[_0x0540('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9512=['ENUM','customVariable','keyValue','string','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x1973e6,_0x45f6d6){var _0x3d2963=function(_0x1ed3b5){while(--_0x1ed3b5){_0x1973e6['push'](_0x1973e6['shift']());}};_0x3d2963(++_0x45f6d6);}(_0x9512,0x14b));var _0x2951=function(_0x1e003b,_0x3e4ded){_0x1e003b=_0x1e003b-0x0;var _0x268789=_0x9512[_0x1e003b];return _0x268789;};'use strict';var Sequelize=require(_0x2951('0x0'));module[_0x2951('0x1')]={'type':{'type':Sequelize[_0x2951('0x2')]('string','variable',_0x2951('0x3'),_0x2951('0x4')),'defaultValue':_0x2951('0x5')},'content':{'type':Sequelize[_0x2951('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2951('0x5'),_0x2951('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x2951('0x6')]},'idField':{'type':Sequelize[_0x2951('0x6')]},'nameField':{'type':Sequelize[_0x2951('0x6')]},'customField':{'type':Sequelize[_0x2951('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2951('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index caad0ec..27a35a0 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x574d=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','error','stack','name','send','FreshsalesField','rawAttributes','fieldName','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','count','includeAll','include','show','params','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x22d3f6,_0x21e150){var _0x410e2b=function(_0x4eadfd){while(--_0x4eadfd){_0x22d3f6['push'](_0x22d3f6['shift']());}};_0x410e2b(++_0x21e150);}(_0x574d,0xc0));var _0xd574=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x574d[_0x8c43de];return _0xa6591b;};'use strict';var pdf=require(_0xd574('0x0'));var emlformat=require(_0xd574('0x1'));var rimraf=require(_0xd574('0x2'));var zipdir=require(_0xd574('0x3'));var jsonpatch=require(_0xd574('0x4'));var rp=require(_0xd574('0x5'));var moment=require(_0xd574('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd574('0x7'));var util=require(_0xd574('0x8'));var path=require(_0xd574('0x9'));var sox=require(_0xd574('0xa'));var csv=require('to-csv');var ejs=require(_0xd574('0xb'));var fs=require('fs');var _=require(_0xd574('0xc'));var squel=require(_0xd574('0xd'));var crypto=require(_0xd574('0xe'));var jsforce=require(_0xd574('0xf'));var deskjs=require(_0xd574('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd574('0x11'));var Redis=require(_0xd574('0x12'));var authService=require(_0xd574('0x13'));var qs=require(_0xd574('0x14'));var as=require(_0xd574('0x15'));var hardwareService=require(_0xd574('0x16'));var logger=require(_0xd574('0x17'))('api');var utils=require(_0xd574('0x18'));var config=require(_0xd574('0x19'));var db=require(_0xd574('0x1a'))['db'];function respondWithStatusCode(_0x6bbebf,_0x1ddedb){_0x1ddedb=_0x1ddedb||0xcc;return function(_0x6c93de){if(_0x6c93de){return _0x6bbebf[_0xd574('0x1b')](_0x1ddedb);}return _0x6bbebf[_0xd574('0x1c')](_0x1ddedb)[_0xd574('0x1d')]();};}function respondWithResult(_0x460c2f,_0x43e251){_0x43e251=_0x43e251||0xc8;return function(_0x2cc660){if(_0x2cc660){return _0x460c2f['status'](_0x43e251)[_0xd574('0x1e')](_0x2cc660);}};}function respondWithFilteredResult(_0x147cdf,_0x2d66be){return function(_0x1537f4){if(_0x1537f4){var _0x46fb4c=_0x1537f4['count'],_0x341463=_0x2d66be['offset'],_0x137917=_0x2d66be[_0xd574('0x1f')]+_0x2d66be[_0xd574('0x20')],_0x2fcdfe;if(_0x137917>=_0x46fb4c){_0x137917=_0x46fb4c;_0x2fcdfe=0xc8;}else{_0x2fcdfe=0xce;}_0x147cdf[_0xd574('0x1c')](_0x2fcdfe);return _0x147cdf['set']('Content-Range',_0x341463+'-'+_0x137917+'/'+_0x46fb4c)[_0xd574('0x1e')](_0x1537f4);}return null;};}function patchUpdates(_0x1ba34c){return function(_0x407bdb){try{jsonpatch[_0xd574('0x21')](_0x407bdb,_0x1ba34c,!![]);}catch(_0x1c899f){return BPromise[_0xd574('0x22')](_0x1c899f);}return _0x407bdb[_0xd574('0x23')]();};}function saveUpdates(_0xf5939a,_0xefe45f){return function(_0x9f980d){if(_0x9f980d){return _0x9f980d[_0xd574('0x24')](_0xf5939a)['then'](function(_0x2b6647){return _0x2b6647;});}return null;};}function removeEntity(_0x105027,_0x481564){return function(_0x39c39d){if(_0x39c39d){return _0x39c39d['destroy']()[_0xd574('0x25')](function(){_0x105027[_0xd574('0x1c')](0xcc)[_0xd574('0x1d')]();});}};}function handleEntityNotFound(_0x3f85cf,_0x1aec00){return function(_0x72d2b8){if(!_0x72d2b8){_0x3f85cf[_0xd574('0x1b')](0x194);}return _0x72d2b8;};}function handleError(_0x37d229,_0x1e3316){_0x1e3316=_0x1e3316||0x1f4;return function(_0x36634c){logger[_0xd574('0x26')](_0x36634c[_0xd574('0x27')]);if(_0x36634c[_0xd574('0x28')]){delete _0x36634c[_0xd574('0x28')];}_0x37d229['status'](_0x1e3316)[_0xd574('0x29')](_0x36634c);};}exports['index']=function(_0x1dcd2f,_0x5c9224){var _0x49f2e9={},_0x379d47={},_0x17078c={'count':0x0,'rows':[]};var _0x2153d0=_['map'](db[_0xd574('0x2a')][_0xd574('0x2b')],function(_0x8eefda){return{'name':_0x8eefda[_0xd574('0x2c')],'type':_0x8eefda['type']['key']};});_0x379d47[_0xd574('0x2d')]=_[_0xd574('0x2e')](_0x2153d0,_0xd574('0x28'));_0x379d47[_0xd574('0x2f')]=_[_0xd574('0x30')](_0x1dcd2f[_0xd574('0x2f')]);_0x379d47['filters']=_['intersection'](_0x379d47[_0xd574('0x2d')],_0x379d47[_0xd574('0x2f')]);_0x49f2e9[_0xd574('0x31')]=_[_0xd574('0x32')](_0x379d47[_0xd574('0x2d')],qs[_0xd574('0x33')](_0x1dcd2f[_0xd574('0x2f')][_0xd574('0x33')]));_0x49f2e9['attributes']=_0x49f2e9['attributes'][_0xd574('0x34')]?_0x49f2e9[_0xd574('0x31')]:_0x379d47[_0xd574('0x2d')];if(!_0x1dcd2f[_0xd574('0x2f')][_0xd574('0x35')]('nolimit')){_0x49f2e9[_0xd574('0x20')]=qs[_0xd574('0x20')](_0x1dcd2f[_0xd574('0x2f')][_0xd574('0x20')]);_0x49f2e9[_0xd574('0x1f')]=qs[_0xd574('0x1f')](_0x1dcd2f[_0xd574('0x2f')]['offset']);}_0x49f2e9[_0xd574('0x36')]=qs['sort'](_0x1dcd2f[_0xd574('0x2f')][_0xd574('0x37')]);_0x49f2e9[_0xd574('0x38')]=qs[_0xd574('0x39')](_[_0xd574('0x3a')](_0x1dcd2f[_0xd574('0x2f')],_0x379d47[_0xd574('0x39')]));if(_0x1dcd2f[_0xd574('0x2f')][_0xd574('0x3b')]){_0x49f2e9[_0xd574('0x38')]=_[_0xd574('0x3c')](_0x49f2e9['where'],{'$or':_[_0xd574('0x2e')](_0x2153d0,function(_0x41391a){if(_0x41391a[_0xd574('0x3d')]!=='VIRTUAL'){var _0x19fcc6={};_0x19fcc6[_0x41391a[_0xd574('0x28')]]={'$like':'%'+_0x1dcd2f[_0xd574('0x2f')][_0xd574('0x3b')]+'%'};return _0x19fcc6;}})});}_0x49f2e9=_[_0xd574('0x3c')]({},_0x49f2e9,_0x1dcd2f[_0xd574('0x3e')]);var _0x5d32ce={'where':_0x49f2e9[_0xd574('0x38')]};return db[_0xd574('0x2a')][_0xd574('0x3f')](_0x5d32ce)[_0xd574('0x25')](function(_0x1544d4){_0x17078c['count']=_0x1544d4;if(_0x1dcd2f[_0xd574('0x2f')][_0xd574('0x40')]){_0x49f2e9[_0xd574('0x41')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x49f2e9);})['then'](function(_0x3322e2){_0x17078c['rows']=_0x3322e2;return _0x17078c;})['then'](respondWithFilteredResult(_0x5c9224,_0x49f2e9))['catch'](handleError(_0x5c9224,null));};exports[_0xd574('0x42')]=function(_0x4fbe2d,_0x244a82){var _0x20b570={'raw':!![],'where':{'id':_0x4fbe2d[_0xd574('0x43')]['id']}},_0x5b64ab={};_0x5b64ab[_0xd574('0x2d')]=_[_0xd574('0x30')](db[_0xd574('0x2a')]['rawAttributes']);_0x5b64ab[_0xd574('0x2f')]=_['keys'](_0x4fbe2d[_0xd574('0x2f')]);_0x5b64ab[_0xd574('0x39')]=_[_0xd574('0x32')](_0x5b64ab[_0xd574('0x2d')],_0x5b64ab[_0xd574('0x2f')]);_0x20b570[_0xd574('0x31')]=_[_0xd574('0x32')](_0x5b64ab[_0xd574('0x2d')],qs[_0xd574('0x33')](_0x4fbe2d[_0xd574('0x2f')][_0xd574('0x33')]));_0x20b570[_0xd574('0x31')]=_0x20b570[_0xd574('0x31')]['length']?_0x20b570[_0xd574('0x31')]:_0x5b64ab['model'];if(_0x4fbe2d['query'][_0xd574('0x40')]){_0x20b570[_0xd574('0x41')]=[{'all':!![]}];}_0x20b570=_['merge']({},_0x20b570,_0x4fbe2d[_0xd574('0x3e')]);return db[_0xd574('0x2a')][_0xd574('0x44')](_0x20b570)['then'](handleEntityNotFound(_0x244a82,null))[_0xd574('0x25')](respondWithResult(_0x244a82,null))[_0xd574('0x45')](handleError(_0x244a82,null));};exports[_0xd574('0x46')]=function(_0x2c0149,_0x3e3d85){return db[_0xd574('0x2a')]['create'](_0x2c0149[_0xd574('0x47')],{})[_0xd574('0x25')](respondWithResult(_0x3e3d85,0xc9))[_0xd574('0x45')](handleError(_0x3e3d85,null));};exports[_0xd574('0x24')]=function(_0x14d08b,_0x2a56a1){if(_0x14d08b[_0xd574('0x47')]['id']){delete _0x14d08b[_0xd574('0x47')]['id'];}return db[_0xd574('0x2a')][_0xd574('0x44')]({'where':{'id':_0x14d08b[_0xd574('0x43')]['id']}})[_0xd574('0x25')](handleEntityNotFound(_0x2a56a1,null))[_0xd574('0x25')](saveUpdates(_0x14d08b[_0xd574('0x47')],null))[_0xd574('0x25')](respondWithResult(_0x2a56a1,null))[_0xd574('0x45')](handleError(_0x2a56a1,null));};exports['destroy']=function(_0x3dbfdc,_0x3be45f){return db['FreshsalesField'][_0xd574('0x44')]({'where':{'id':_0x3dbfdc[_0xd574('0x43')]['id']}})[_0xd574('0x25')](handleEntityNotFound(_0x3be45f,null))[_0xd574('0x25')](removeEntity(_0x3be45f,null))[_0xd574('0x45')](handleError(_0x3be45f,null));}; \ No newline at end of file +var _0xcffe=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','FreshsalesField','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','options','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','fieldName','type','key','map','query','filters'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xcffe,0x1a1));var _0xecff=function(_0x354bd6,_0x4a7c74){_0x354bd6=_0x354bd6-0x0;var _0x39bf52=_0xcffe[_0x354bd6];return _0x39bf52;};'use strict';var pdf=require(_0xecff('0x0'));var emlformat=require(_0xecff('0x1'));var rimraf=require(_0xecff('0x2'));var zipdir=require(_0xecff('0x3'));var jsonpatch=require(_0xecff('0x4'));var rp=require(_0xecff('0x5'));var moment=require(_0xecff('0x6'));var BPromise=require(_0xecff('0x7'));var Mustache=require(_0xecff('0x8'));var util=require(_0xecff('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xecff('0xa'));var ejs=require(_0xecff('0xb'));var fs=require('fs');var _=require(_0xecff('0xc'));var squel=require(_0xecff('0xd'));var crypto=require(_0xecff('0xe'));var jsforce=require(_0xecff('0xf'));var deskjs=require(_0xecff('0x10'));var toCsv=require('to-csv');var querystring=require(_0xecff('0x11'));var Papa=require(_0xecff('0x12'));var Redis=require(_0xecff('0x13'));var authService=require(_0xecff('0x14'));var qs=require(_0xecff('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xecff('0x16'));var logger=require(_0xecff('0x17'))(_0xecff('0x18'));var utils=require(_0xecff('0x19'));var config=require(_0xecff('0x1a'));var db=require(_0xecff('0x1b'))['db'];function respondWithStatusCode(_0x16c5dd,_0x32627c){_0x32627c=_0x32627c||0xcc;return function(_0x3e907d){if(_0x3e907d){return _0x16c5dd[_0xecff('0x1c')](_0x32627c);}return _0x16c5dd[_0xecff('0x1d')](_0x32627c)[_0xecff('0x1e')]();};}function respondWithResult(_0x1e5973,_0xb8745f){_0xb8745f=_0xb8745f||0xc8;return function(_0x5495f9){if(_0x5495f9){return _0x1e5973['status'](_0xb8745f)[_0xecff('0x1f')](_0x5495f9);}};}function respondWithFilteredResult(_0x2e1d6f,_0x558ecd){return function(_0x35ce1f){if(_0x35ce1f){var _0x362ed0=_0x35ce1f[_0xecff('0x20')],_0x3a7623=_0x558ecd[_0xecff('0x21')],_0x596b09=_0x558ecd['offset']+_0x558ecd[_0xecff('0x22')],_0x52b62f;if(_0x596b09>=_0x362ed0){_0x596b09=_0x362ed0;_0x52b62f=0xc8;}else{_0x52b62f=0xce;}_0x2e1d6f[_0xecff('0x1d')](_0x52b62f);return _0x2e1d6f[_0xecff('0x23')](_0xecff('0x24'),_0x3a7623+'-'+_0x596b09+'/'+_0x362ed0)[_0xecff('0x1f')](_0x35ce1f);}return null;};}function patchUpdates(_0x1682a2){return function(_0x5c2503){try{jsonpatch[_0xecff('0x25')](_0x5c2503,_0x1682a2,!![]);}catch(_0x422bd8){return BPromise[_0xecff('0x26')](_0x422bd8);}return _0x5c2503[_0xecff('0x27')]();};}function saveUpdates(_0x49d0e2,_0x4bb94e){return function(_0x2e2bdd){if(_0x2e2bdd){return _0x2e2bdd[_0xecff('0x28')](_0x49d0e2)[_0xecff('0x29')](function(_0x284458){return _0x284458;});}return null;};}function removeEntity(_0x2402e0,_0x494754){return function(_0x14378d){if(_0x14378d){return _0x14378d['destroy']()['then'](function(){_0x2402e0[_0xecff('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2447da,_0x49c0cd){return function(_0x389281){if(!_0x389281){_0x2447da['sendStatus'](0x194);}return _0x389281;};}function handleError(_0x1fd7c6,_0x44f5f7){_0x44f5f7=_0x44f5f7||0x1f4;return function(_0x505e20){logger[_0xecff('0x2a')](_0x505e20[_0xecff('0x2b')]);if(_0x505e20[_0xecff('0x2c')]){delete _0x505e20[_0xecff('0x2c')];}_0x1fd7c6[_0xecff('0x1d')](_0x44f5f7)['send'](_0x505e20);};}exports['index']=function(_0x25effe,_0x484415){var _0x1281d8={},_0x3ef198={},_0x49a224={'count':0x0,'rows':[]};var _0x1dfeb6=_['map'](db['FreshsalesField']['rawAttributes'],function(_0x202ee0){return{'name':_0x202ee0[_0xecff('0x2d')],'type':_0x202ee0[_0xecff('0x2e')][_0xecff('0x2f')]};});_0x3ef198['model']=_[_0xecff('0x30')](_0x1dfeb6,_0xecff('0x2c'));_0x3ef198[_0xecff('0x31')]=_['keys'](_0x25effe[_0xecff('0x31')]);_0x3ef198[_0xecff('0x32')]=_[_0xecff('0x33')](_0x3ef198[_0xecff('0x34')],_0x3ef198['query']);_0x1281d8[_0xecff('0x35')]=_[_0xecff('0x33')](_0x3ef198['model'],qs[_0xecff('0x36')](_0x25effe[_0xecff('0x31')][_0xecff('0x36')]));_0x1281d8[_0xecff('0x35')]=_0x1281d8['attributes'][_0xecff('0x37')]?_0x1281d8[_0xecff('0x35')]:_0x3ef198[_0xecff('0x34')];if(!_0x25effe['query'][_0xecff('0x38')](_0xecff('0x39'))){_0x1281d8[_0xecff('0x22')]=qs[_0xecff('0x22')](_0x25effe[_0xecff('0x31')][_0xecff('0x22')]);_0x1281d8['offset']=qs['offset'](_0x25effe['query'][_0xecff('0x21')]);}_0x1281d8['order']=qs[_0xecff('0x3a')](_0x25effe[_0xecff('0x31')]['sort']);_0x1281d8[_0xecff('0x3b')]=qs[_0xecff('0x32')](_[_0xecff('0x3c')](_0x25effe['query'],_0x3ef198[_0xecff('0x32')]));if(_0x25effe[_0xecff('0x31')][_0xecff('0x3d')]){_0x1281d8['where']=_[_0xecff('0x3e')](_0x1281d8[_0xecff('0x3b')],{'$or':_[_0xecff('0x30')](_0x1dfeb6,function(_0x13a525){if(_0x13a525[_0xecff('0x2e')]!==_0xecff('0x3f')){var _0x1cf770={};_0x1cf770[_0x13a525[_0xecff('0x2c')]]={'$like':'%'+_0x25effe[_0xecff('0x31')][_0xecff('0x3d')]+'%'};return _0x1cf770;}})});}_0x1281d8=_[_0xecff('0x3e')]({},_0x1281d8,_0x25effe['options']);var _0x464349={'where':_0x1281d8[_0xecff('0x3b')]};return db[_0xecff('0x40')][_0xecff('0x20')](_0x464349)[_0xecff('0x29')](function(_0x19626e){_0x49a224[_0xecff('0x20')]=_0x19626e;if(_0x25effe[_0xecff('0x31')]['includeAll']){_0x1281d8[_0xecff('0x41')]=[{'all':!![]}];}return db['FreshsalesField'][_0xecff('0x42')](_0x1281d8);})[_0xecff('0x29')](function(_0x307e40){_0x49a224[_0xecff('0x43')]=_0x307e40;return _0x49a224;})[_0xecff('0x29')](respondWithFilteredResult(_0x484415,_0x1281d8))[_0xecff('0x44')](handleError(_0x484415,null));};exports[_0xecff('0x45')]=function(_0x55e2ae,_0x307b99){var _0x3dc857={'raw':!![],'where':{'id':_0x55e2ae['params']['id']}},_0x514b58={};_0x514b58[_0xecff('0x34')]=_[_0xecff('0x46')](db[_0xecff('0x40')][_0xecff('0x47')]);_0x514b58[_0xecff('0x31')]=_[_0xecff('0x46')](_0x55e2ae['query']);_0x514b58[_0xecff('0x32')]=_[_0xecff('0x33')](_0x514b58['model'],_0x514b58[_0xecff('0x31')]);_0x3dc857[_0xecff('0x35')]=_[_0xecff('0x33')](_0x514b58[_0xecff('0x34')],qs[_0xecff('0x36')](_0x55e2ae[_0xecff('0x31')]['fields']));_0x3dc857[_0xecff('0x35')]=_0x3dc857[_0xecff('0x35')][_0xecff('0x37')]?_0x3dc857['attributes']:_0x514b58[_0xecff('0x34')];if(_0x55e2ae[_0xecff('0x31')][_0xecff('0x48')]){_0x3dc857[_0xecff('0x41')]=[{'all':!![]}];}_0x3dc857=_['merge']({},_0x3dc857,_0x55e2ae[_0xecff('0x49')]);return db[_0xecff('0x40')]['find'](_0x3dc857)[_0xecff('0x29')](handleEntityNotFound(_0x307b99,null))[_0xecff('0x29')](respondWithResult(_0x307b99,null))['catch'](handleError(_0x307b99,null));};exports[_0xecff('0x4a')]=function(_0x509fd0,_0x3a6b26){return db[_0xecff('0x40')][_0xecff('0x4a')](_0x509fd0[_0xecff('0x4b')],{})[_0xecff('0x29')](respondWithResult(_0x3a6b26,0xc9))[_0xecff('0x44')](handleError(_0x3a6b26,null));};exports['update']=function(_0x596eb8,_0xa08a61){if(_0x596eb8[_0xecff('0x4b')]['id']){delete _0x596eb8[_0xecff('0x4b')]['id'];}return db[_0xecff('0x40')][_0xecff('0x4c')]({'where':{'id':_0x596eb8[_0xecff('0x4d')]['id']}})[_0xecff('0x29')](handleEntityNotFound(_0xa08a61,null))[_0xecff('0x29')](saveUpdates(_0x596eb8['body'],null))[_0xecff('0x29')](respondWithResult(_0xa08a61,null))[_0xecff('0x44')](handleError(_0xa08a61,null));};exports['destroy']=function(_0x262b3d,_0x576aa9){return db[_0xecff('0x40')][_0xecff('0x4c')]({'where':{'id':_0x262b3d['params']['id']}})[_0xecff('0x29')](handleEntityNotFound(_0x576aa9,null))[_0xecff('0x29')](removeEntity(_0x576aa9,null))[_0xecff('0x44')](handleError(_0x576aa9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 6070c5c..6d869cc 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c29=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash'];(function(_0x1e8d2c,_0x34985b){var _0x4de641=function(_0x5c998e){while(--_0x5c998e){_0x1e8d2c['push'](_0x1e8d2c['shift']());}};_0x4de641(++_0x34985b);}(_0x6c29,0x1c1));var _0x96c2=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0x6c29[_0x38841c];return _0x500610;};'use strict';var _=require(_0x96c2('0x0'));var util=require(_0x96c2('0x1'));var logger=require(_0x96c2('0x2'))(_0x96c2('0x3'));var moment=require(_0x96c2('0x4'));var BPromise=require(_0x96c2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x96c2('0x6'));var config=require(_0x96c2('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x96c2('0x8')]=function(_0x43d7fd,_0x2ee7c6){return _0x43d7fd[_0x96c2('0x9')](_0x96c2('0xa'),attributes,{'tableName':_0x96c2('0xb'),'paranoid':![],'indexes':[{'name':_0x96c2('0xc'),'fields':[_0x96c2('0xd'),_0x96c2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6fd6=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','lodash'];(function(_0x13c229,_0x48b932){var _0x5905eb=function(_0x2ff990){while(--_0x2ff990){_0x13c229['push'](_0x13c229['shift']());}};_0x5905eb(++_0x48b932);}(_0x6fd6,0x86));var _0x66fd=function(_0xf0ab7c,_0x23bbc2){_0xf0ab7c=_0xf0ab7c-0x0;var _0x198144=_0x6fd6[_0xf0ab7c];return _0x198144;};'use strict';var _=require(_0x66fd('0x0'));var util=require(_0x66fd('0x1'));var logger=require(_0x66fd('0x2'))(_0x66fd('0x3'));var moment=require(_0x66fd('0x4'));var BPromise=require(_0x66fd('0x5'));var rp=require(_0x66fd('0x6'));var fs=require('fs');var path=require(_0x66fd('0x7'));var rimraf=require('rimraf');var config=require(_0x66fd('0x8'));var attributes=require(_0x66fd('0x9'));module[_0x66fd('0xa')]=function(_0x36f5c9,_0x3a927f){return _0x36f5c9[_0x66fd('0xb')](_0x66fd('0xc'),attributes,{'tableName':_0x66fd('0xd'),'paranoid':![],'indexes':[{'name':_0x66fd('0xe'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index def8d9c..00851f9 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4b2=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesField,\x20%s,\x20%s','message'];(function(_0x611629,_0x45cf98){var _0x59dea0=function(_0x3fd324){while(--_0x3fd324){_0x611629['push'](_0x611629['shift']());}};_0x59dea0(++_0x45cf98);}(_0xe4b2,0xf4));var _0x2e4b=function(_0x58001e,_0x503864){_0x58001e=_0x58001e-0x0;var _0x3890d7=_0xe4b2[_0x58001e];return _0x3890d7;};'use strict';var _=require(_0x2e4b('0x0'));var util=require(_0x2e4b('0x1'));var moment=require(_0x2e4b('0x2'));var BPromise=require(_0x2e4b('0x3'));var rs=require(_0x2e4b('0x4'));var fs=require('fs');var Redis=require(_0x2e4b('0x5'));var db=require(_0x2e4b('0x6'))['db'];var utils=require(_0x2e4b('0x7'));var logger=require('../../config/logger')(_0x2e4b('0x8'));var config=require(_0x2e4b('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14d628,_0x4debaa,_0x3999ed){return new BPromise(function(_0x2dc43c,_0x30848d){return client[_0x2e4b('0xa')](_0x14d628,_0x3999ed)[_0x2e4b('0xb')](function(_0x5cc4d3){logger[_0x2e4b('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4debaa,_0x2e4b('0xd'));logger[_0x2e4b('0xe')](_0x2e4b('0xf'),_0x4debaa,_0x2e4b('0xd'),JSON[_0x2e4b('0x10')](_0x5cc4d3));if(_0x5cc4d3[_0x2e4b('0x11')]){if(_0x5cc4d3[_0x2e4b('0x11')]['code']===0x1f4){logger['error'](_0x2e4b('0x12'),_0x4debaa,_0x5cc4d3[_0x2e4b('0x11')][_0x2e4b('0x13')]);return _0x30848d(_0x5cc4d3[_0x2e4b('0x11')][_0x2e4b('0x13')]);}logger[_0x2e4b('0x11')](_0x2e4b('0x12'),_0x4debaa,_0x5cc4d3[_0x2e4b('0x11')]['message']);return _0x2dc43c(_0x5cc4d3[_0x2e4b('0x11')]['message']);}else{logger[_0x2e4b('0xc')](_0x2e4b('0x12'),_0x4debaa,_0x2e4b('0xd'));_0x2dc43c(_0x5cc4d3[_0x2e4b('0x14')][_0x2e4b('0x13')]);}})[_0x2e4b('0x15')](function(_0x76870){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4debaa,_0x76870);_0x30848d(_0x76870);});});} \ No newline at end of file +var _0xcaa8=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xcaa8,0x8e));var _0x8caa=function(_0x36ff7e,_0x1c67db){_0x36ff7e=_0x36ff7e-0x0;var _0x2bb885=_0xcaa8[_0x36ff7e];return _0x2bb885;};'use strict';var _=require(_0x8caa('0x0'));var util=require(_0x8caa('0x1'));var moment=require(_0x8caa('0x2'));var BPromise=require(_0x8caa('0x3'));var rs=require(_0x8caa('0x4'));var fs=require('fs');var Redis=require(_0x8caa('0x5'));var db=require(_0x8caa('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8caa('0x7'))(_0x8caa('0x8'));var config=require(_0x8caa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8caa('0xa')][_0x8caa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4055b1,_0x47e951,_0x4b4fe0){return new BPromise(function(_0x34a10,_0x42897a){return client[_0x8caa('0xc')](_0x4055b1,_0x4b4fe0)[_0x8caa('0xd')](function(_0x17dacf){logger[_0x8caa('0xe')](_0x8caa('0xf'),_0x47e951,_0x8caa('0x10'));logger[_0x8caa('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x47e951,'request\x20sent',JSON[_0x8caa('0x12')](_0x17dacf));if(_0x17dacf[_0x8caa('0x13')]){if(_0x17dacf['error']['code']===0x1f4){logger[_0x8caa('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x47e951,_0x17dacf[_0x8caa('0x13')]['message']);return _0x42897a(_0x17dacf['error'][_0x8caa('0x14')]);}logger[_0x8caa('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x47e951,_0x17dacf[_0x8caa('0x13')][_0x8caa('0x14')]);return _0x34a10(_0x17dacf[_0x8caa('0x13')][_0x8caa('0x14')]);}else{logger['info'](_0x8caa('0xf'),_0x47e951,_0x8caa('0x10'));_0x34a10(_0x17dacf[_0x8caa('0x15')]['message']);}})[_0x8caa('0x16')](function(_0x33bda5){logger[_0x8caa('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x47e951,_0x33bda5);_0x42897a(_0x33bda5);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index c350186..966664b 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bc7=['create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0bc7,0x1dc));var _0x70bc=function(_0x418735,_0x4eaca6){_0x418735=_0x418735-0x0;var _0x54225f=_0x0bc7[_0x418735];return _0x54225f;};'use strict';var multer=require(_0x70bc('0x0'));var util=require(_0x70bc('0x1'));var path=require(_0x70bc('0x2'));var timeout=require(_0x70bc('0x3'));var express=require(_0x70bc('0x4'));var router=express['Router']();var auth=require(_0x70bc('0x5'));var interaction=require(_0x70bc('0x6'));var config=require(_0x70bc('0x7'));var controller=require(_0x70bc('0x8'));router[_0x70bc('0x9')]('/',auth[_0x70bc('0xa')](),controller[_0x70bc('0xb')]);router[_0x70bc('0x9')]('/:id',auth[_0x70bc('0xa')](),controller[_0x70bc('0xc')]);router[_0x70bc('0x9')](_0x70bc('0xd'),auth[_0x70bc('0xa')](),controller[_0x70bc('0xe')]);router[_0x70bc('0x9')](_0x70bc('0xf'),auth['isAuthenticated'](),controller[_0x70bc('0x10')]);router[_0x70bc('0x11')]('/',auth[_0x70bc('0xa')](),controller[_0x70bc('0x12')]);router[_0x70bc('0x11')]('/:id/configurations',auth[_0x70bc('0xa')](),controller[_0x70bc('0x13')]);router[_0x70bc('0x14')](_0x70bc('0x15'),auth[_0x70bc('0xa')](),controller[_0x70bc('0x16')]);router[_0x70bc('0x17')](_0x70bc('0x15'),auth['isAuthenticated'](),controller[_0x70bc('0x18')]);module[_0x70bc('0x19')]=router; \ No newline at end of file +var _0x26d1=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','multer','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2522b6,_0x39ce8c){var _0xf5148=function(_0x5abb9a){while(--_0x5abb9a){_0x2522b6['push'](_0x2522b6['shift']());}};_0xf5148(++_0x39ce8c);}(_0x26d1,0x8e));var _0x126d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x26d1[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x126d('0x0'));var util=require('util');var path=require(_0x126d('0x1'));var timeout=require(_0x126d('0x2'));var express=require(_0x126d('0x3'));var router=express[_0x126d('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x126d('0x5'));var controller=require('./intSalesforceAccount.controller');router[_0x126d('0x6')]('/',auth[_0x126d('0x7')](),controller[_0x126d('0x8')]);router[_0x126d('0x6')](_0x126d('0x9'),auth['isAuthenticated'](),controller[_0x126d('0xa')]);router[_0x126d('0x6')](_0x126d('0xb'),auth[_0x126d('0x7')](),controller[_0x126d('0xc')]);router[_0x126d('0x6')](_0x126d('0xd'),auth['isAuthenticated'](),controller[_0x126d('0xe')]);router[_0x126d('0xf')]('/',auth[_0x126d('0x7')](),controller[_0x126d('0x10')]);router[_0x126d('0xf')]('/:id/configurations',auth[_0x126d('0x7')](),controller['addConfiguration']);router[_0x126d('0x11')](_0x126d('0x9'),auth[_0x126d('0x7')](),controller['update']);router[_0x126d('0x12')](_0x126d('0x9'),auth[_0x126d('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 7f1f147..d477cb0 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x536a51,_0x2bf510){var _0x4a4d9e=function(_0x20deef){while(--_0x20deef){_0x536a51['push'](_0x536a51['shift']());}};_0x4a4d9e(++_0x2bf510);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3de332,_0x2c88f8){_0x3de332=_0x3de332-0x0;var _0x5eccfb=_0x8ef6[_0x3de332];return _0x5eccfb;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')]},'description':{'type':Sequelize[_0x68ef('0x2')]},'username':{'type':Sequelize[_0x68ef('0x2')],'unique':_0x68ef('0x3')},'remoteUri':{'type':Sequelize[_0x68ef('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x68ef('0x2')]},'clientSecret':{'type':Sequelize[_0x68ef('0x2')]},'securityToken':{'type':Sequelize[_0x68ef('0x2')]},'serverUrl':{'type':Sequelize[_0x68ef('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x68ef('0x4')),'defaultValue':_0x68ef('0x5')}}; \ No newline at end of file +var _0xe14b=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14b,0x93));var _0xbe14=function(_0x1eead0,_0x2a4d3d){_0x1eead0=_0x1eead0-0x0;var _0x3d1569=_0xe14b[_0x1eead0];return _0x3d1569;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbe14('0x2')],'unique':_0xbe14('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xbe14('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xbe14('0x2')]},'serverUrl':{'type':Sequelize[_0xbe14('0x2')]},'type':{'type':Sequelize[_0xbe14('0x4')](_0xbe14('0x5'),_0xbe14('0x6')),'defaultValue':_0xbe14('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 0d2a4c0..54beb85 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','getConfigurations','findOne','SalesforceConfiguration','sort','AccountId','Subjects','getSubjects','getDescriptions','channel','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','slice','substring','Connection','login','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','IsArchived','Priority','Type','Case','Origin','Status','SuppliedName','remove','custom','includes','picklistValues','label','boolean','True','False','false','statusCode','test','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter'];(function(_0x2839d3,_0x432d96){var _0x468eac=function(_0x1de24d){while(--_0x1de24d){_0x2839d3['push'](_0x2839d3['shift']());}};_0x468eac(++_0x432d96);}(_0x2ef3,0xba));var _0x32ef=function(_0x14c815,_0x3ece92){_0x14c815=_0x14c815-0x0;var _0x3da3f3=_0x2ef3[_0x14c815];return _0x3da3f3;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x32ef('0x19'));var client=jayson['client'][_0x32ef('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1ef1ae,_0x5c3eb9,_0x539d18){if(_0x539d18){var _0x19ce1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19ce1['test'](_0x5c3eb9)){return _0x1ef1ae;}else{throw new db[(_0x32ef('0x1b'))][(_0x32ef('0x1c'))](_0x32ef('0x1d'));}}else{return _0x1ef1ae;}}function respondWithRpcPromise(_0x54c7f5,_0x57aff1,_0x55bf0b,_0x531e30){return new BPromise(function(_0x13db1a,_0x3950e6){var _0xb5aed2=_0x531e30||client;return _0xb5aed2['request'](_0x54c7f5,_0x55bf0b)['then'](function(_0x1eb468){logger[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57aff1,'request\x20sent');logger[_0x32ef('0x20')](_0x32ef('0x21'),_0x57aff1,'request\x20sent',JSON[_0x32ef('0x22')](_0x1eb468));if(_0x1eb468[_0x32ef('0x23')]){if(_0x1eb468[_0x32ef('0x23')][_0x32ef('0x24')]===0x1f4){logger[_0x32ef('0x23')](_0x32ef('0x1f'),_0x57aff1,_0x1eb468['error'][_0x32ef('0x25')]);return _0x3950e6(_0x1eb468['error'][_0x32ef('0x25')]);}logger[_0x32ef('0x23')]('SalesforceAccount,\x20%s,\x20%s',_0x57aff1,_0x1eb468[_0x32ef('0x23')][_0x32ef('0x25')]);return _0x13db1a(_0x1eb468[_0x32ef('0x23')]['message']);}else{logger['info'](_0x32ef('0x1f'),_0x57aff1,_0x32ef('0x26'));_0x13db1a(_0x1eb468[_0x32ef('0x27')]['message']);}})['catch'](function(_0x19ea6){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x57aff1,_0x19ea6);_0x3950e6(_0x19ea6);});});}function respondWithStatusCode(_0x278495,_0x14d4b3){_0x14d4b3=_0x14d4b3||0xcc;return function(_0x371540){if(_0x371540){return _0x278495[_0x32ef('0x28')](_0x14d4b3);}return _0x278495[_0x32ef('0x29')](_0x14d4b3)[_0x32ef('0x2a')]();};}function respondWithResult(_0x1874ea,_0x38aed5){_0x38aed5=_0x38aed5||0xc8;return function(_0x338f19){if(_0x338f19){return _0x1874ea[_0x32ef('0x29')](_0x38aed5)[_0x32ef('0x2b')](_0x338f19);}};}function respondWithFilteredResult(_0xba4b3f,_0x5a88a5){return function(_0xd65fde){if(_0xd65fde){var _0x2f5d06=_0xd65fde[_0x32ef('0x2c')],_0x5a04cd=_0x5a88a5[_0x32ef('0x2d')],_0x12de1a=_0x5a88a5['offset']+_0x5a88a5[_0x32ef('0x2e')],_0x3c569d;if(_0x12de1a>=_0x2f5d06){_0x12de1a=_0x2f5d06;_0x3c569d=0xc8;}else{_0x3c569d=0xce;}_0xba4b3f[_0x32ef('0x29')](_0x3c569d);return _0xba4b3f[_0x32ef('0x2f')](_0x32ef('0x30'),_0x5a04cd+'-'+_0x12de1a+'/'+_0x2f5d06)[_0x32ef('0x2b')](_0xd65fde);}return null;};}function patchUpdates(_0x1a6ed2){return function(_0x1a122d){try{jsonpatch['apply'](_0x1a122d,_0x1a6ed2,!![]);}catch(_0x36ac37){return BPromise['reject'](_0x36ac37);}return _0x1a122d[_0x32ef('0x31')]();};}function saveUpdates(_0x2b6c6a,_0x5a9565){return function(_0xcc2efb){if(_0xcc2efb){return _0xcc2efb[_0x32ef('0x32')](_0x2b6c6a)[_0x32ef('0x33')](function(_0x20b467){return _0x20b467;});}return null;};}function removeEntity(_0x120f30,_0x59a4a3){return function(_0x50ecd6){if(_0x50ecd6){return _0x50ecd6[_0x32ef('0x34')]()['then'](function(){_0x120f30[_0x32ef('0x29')](0xcc)[_0x32ef('0x2a')]();});}};}function handleEntityNotFound(_0x2f1349,_0x390670){return function(_0x389583){if(!_0x389583){_0x2f1349[_0x32ef('0x28')](0x194);}return _0x389583;};}function handleError(_0x566b56,_0x482d3a){_0x482d3a=_0x482d3a||0x1f4;return function(_0x484ad7){logger[_0x32ef('0x23')](_0x484ad7[_0x32ef('0x35')]);if(_0x484ad7[_0x32ef('0x36')]){delete _0x484ad7['name'];}_0x566b56['status'](_0x482d3a)[_0x32ef('0x37')](_0x484ad7);};}exports[_0x32ef('0x38')]=function(_0x410334,_0x480348){var _0x4abbd6={},_0xcbdec8={},_0x21706f={'count':0x0,'rows':[]};var _0x3ed1b0=_[_0x32ef('0x39')](db[_0x32ef('0x3a')][_0x32ef('0x3b')],function(_0x3223d5){return{'name':_0x3223d5[_0x32ef('0x3c')],'type':_0x3223d5[_0x32ef('0x3d')]['key']};});_0xcbdec8[_0x32ef('0x3e')]=_[_0x32ef('0x39')](_0x3ed1b0,_0x32ef('0x36'));_0xcbdec8['query']=_[_0x32ef('0x3f')](_0x410334[_0x32ef('0x40')]);_0xcbdec8[_0x32ef('0x41')]=_[_0x32ef('0x42')](_0xcbdec8[_0x32ef('0x3e')],_0xcbdec8[_0x32ef('0x40')]);_0x4abbd6[_0x32ef('0x43')]=_[_0x32ef('0x42')](_0xcbdec8[_0x32ef('0x3e')],qs[_0x32ef('0x44')](_0x410334[_0x32ef('0x40')][_0x32ef('0x44')]));_0x4abbd6['attributes']=_0x4abbd6[_0x32ef('0x43')][_0x32ef('0x45')]?_0x4abbd6[_0x32ef('0x43')]:_0xcbdec8[_0x32ef('0x3e')];if(!_0x410334[_0x32ef('0x40')][_0x32ef('0x46')](_0x32ef('0x47'))){_0x4abbd6['limit']=qs['limit'](_0x410334[_0x32ef('0x40')][_0x32ef('0x2e')]);_0x4abbd6[_0x32ef('0x2d')]=qs[_0x32ef('0x2d')](_0x410334['query'][_0x32ef('0x2d')]);}_0x4abbd6[_0x32ef('0x48')]=qs['sort'](_0x410334[_0x32ef('0x40')]['sort']);_0x4abbd6[_0x32ef('0x49')]=qs[_0x32ef('0x41')](_[_0x32ef('0x4a')](_0x410334[_0x32ef('0x40')],_0xcbdec8[_0x32ef('0x41')]));if(_0x410334[_0x32ef('0x40')][_0x32ef('0x4b')]){_0x4abbd6[_0x32ef('0x49')]=_[_0x32ef('0x4c')](_0x4abbd6[_0x32ef('0x49')],{'$or':_['map'](_0x3ed1b0,function(_0x18b943){if(_0x18b943['type']!==_0x32ef('0x4d')){var _0x33c25b={};_0x33c25b[_0x18b943[_0x32ef('0x36')]]={'$like':'%'+_0x410334['query'][_0x32ef('0x4b')]+'%'};return _0x33c25b;}})});}_0x4abbd6=_[_0x32ef('0x4c')]({},_0x4abbd6,_0x410334[_0x32ef('0x4e')]);var _0x241f82={'where':_0x4abbd6[_0x32ef('0x49')]};return db[_0x32ef('0x3a')][_0x32ef('0x2c')](_0x241f82)['then'](function(_0x5cb6fc){_0x21706f[_0x32ef('0x2c')]=_0x5cb6fc;if(_0x410334[_0x32ef('0x40')][_0x32ef('0x4f')]){_0x4abbd6[_0x32ef('0x50')]=[{'all':!![]}];}return db[_0x32ef('0x3a')][_0x32ef('0x51')](_0x4abbd6);})[_0x32ef('0x33')](function(_0x115fa3){_0x21706f[_0x32ef('0x52')]=_0x115fa3;return _0x21706f;})[_0x32ef('0x33')](respondWithFilteredResult(_0x480348,_0x4abbd6))[_0x32ef('0x53')](handleError(_0x480348,null));};exports[_0x32ef('0x54')]=function(_0x36a65c,_0x4c2534){var _0x420f00={'raw':![],'where':{'id':_0x36a65c[_0x32ef('0x55')]['id']}},_0x12fbd7={};_0x12fbd7[_0x32ef('0x3e')]=_[_0x32ef('0x3f')](db[_0x32ef('0x3a')][_0x32ef('0x3b')]);_0x12fbd7[_0x32ef('0x40')]=_[_0x32ef('0x3f')](_0x36a65c[_0x32ef('0x40')]);_0x12fbd7[_0x32ef('0x41')]=_[_0x32ef('0x42')](_0x12fbd7[_0x32ef('0x3e')],_0x12fbd7[_0x32ef('0x40')]);_0x420f00[_0x32ef('0x43')]=_[_0x32ef('0x42')](_0x12fbd7[_0x32ef('0x3e')],qs[_0x32ef('0x44')](_0x36a65c['query']['fields']));_0x420f00[_0x32ef('0x43')]=_0x420f00[_0x32ef('0x43')][_0x32ef('0x45')]?_0x420f00[_0x32ef('0x43')]:_0x12fbd7[_0x32ef('0x3e')];if(_0x36a65c[_0x32ef('0x40')][_0x32ef('0x4f')]){_0x420f00[_0x32ef('0x50')]=[{'all':!![]}];}_0x420f00=_[_0x32ef('0x4c')]({},_0x420f00,_0x36a65c[_0x32ef('0x4e')]);return db[_0x32ef('0x3a')]['find'](_0x420f00)[_0x32ef('0x33')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x33')](respondWithResult(_0x4c2534,null))[_0x32ef('0x53')](handleError(_0x4c2534,null));};exports[_0x32ef('0x56')]=function(_0x38314a,_0x387cf0){return db['SalesforceAccount'][_0x32ef('0x56')](_0x38314a[_0x32ef('0x57')],{})[_0x32ef('0x33')](respondWithResult(_0x387cf0,0xc9))['catch'](handleError(_0x387cf0,null));};exports[_0x32ef('0x32')]=function(_0x52692a,_0x2ee3dd){if(_0x52692a[_0x32ef('0x57')]['id']){delete _0x52692a['body']['id'];}return db[_0x32ef('0x3a')]['find']({'where':{'id':_0x52692a[_0x32ef('0x55')]['id']}})[_0x32ef('0x33')](handleEntityNotFound(_0x2ee3dd,null))[_0x32ef('0x33')](saveUpdates(_0x52692a[_0x32ef('0x57')],null))[_0x32ef('0x33')](respondWithResult(_0x2ee3dd,null))[_0x32ef('0x53')](handleError(_0x2ee3dd,null));};exports[_0x32ef('0x34')]=function(_0x56260f,_0x56cc75){return db[_0x32ef('0x3a')]['find']({'where':{'id':_0x56260f['params']['id']}})[_0x32ef('0x33')](handleEntityNotFound(_0x56cc75,null))[_0x32ef('0x33')](removeEntity(_0x56cc75,null))[_0x32ef('0x53')](handleError(_0x56cc75,null));};exports[_0x32ef('0x58')]=function(_0x2468e6,_0x356704,_0x316547){var _0x4249c3={};var _0x2b2cd4={};var _0x123571;var _0x4c125c;return db['SalesforceAccount'][_0x32ef('0x59')]({'where':{'id':_0x2468e6[_0x32ef('0x55')]['id']}})['then'](handleEntityNotFound(_0x356704,null))[_0x32ef('0x33')](function(_0x12e1ef){if(_0x12e1ef){_0x123571=_0x12e1ef;_0x2b2cd4[_0x32ef('0x3e')]=_['keys'](db[_0x32ef('0x5a')][_0x32ef('0x3b')]);_0x2b2cd4[_0x32ef('0x40')]=_['keys'](_0x2468e6['query']);_0x2b2cd4[_0x32ef('0x41')]=_['intersection'](_0x2b2cd4[_0x32ef('0x3e')],_0x2b2cd4['query']);_0x4249c3['attributes']=_[_0x32ef('0x42')](_0x2b2cd4[_0x32ef('0x3e')],qs[_0x32ef('0x44')](_0x2468e6['query'][_0x32ef('0x44')]));_0x4249c3[_0x32ef('0x43')]=_0x4249c3[_0x32ef('0x43')]['length']?_0x4249c3[_0x32ef('0x43')]:_0x2b2cd4[_0x32ef('0x3e')];_0x4249c3['order']=qs['sort'](_0x2468e6[_0x32ef('0x40')][_0x32ef('0x5b')]);_0x4249c3[_0x32ef('0x49')]=qs[_0x32ef('0x41')](_[_0x32ef('0x4a')](_0x2468e6[_0x32ef('0x40')],_0x2b2cd4['filters']));if(_0x2468e6[_0x32ef('0x40')][_0x32ef('0x4b')]){_0x4249c3[_0x32ef('0x49')]=_[_0x32ef('0x4c')](_0x4249c3[_0x32ef('0x49')],{'$or':_[_0x32ef('0x39')](_0x4249c3[_0x32ef('0x43')],function(_0x3ff282){var _0x229d6e={};_0x229d6e[_0x3ff282]={'$like':'%'+_0x2468e6['query'][_0x32ef('0x4b')]+'%'};return _0x229d6e;})});}_0x4249c3=_[_0x32ef('0x4c')]({},_0x4249c3,_0x2468e6[_0x32ef('0x4e')]);return _0x123571[_0x32ef('0x58')](_0x4249c3);}})[_0x32ef('0x33')](function(_0x5ad75c){if(_0x5ad75c){_0x4c125c=_0x5ad75c['length'];if(!_0x2468e6[_0x32ef('0x40')][_0x32ef('0x46')](_0x32ef('0x47'))){_0x4249c3[_0x32ef('0x2e')]=qs[_0x32ef('0x2e')](_0x2468e6['query'][_0x32ef('0x2e')]);_0x4249c3['offset']=qs[_0x32ef('0x2d')](_0x2468e6[_0x32ef('0x40')]['offset']);}return _0x123571['getConfigurations'](_0x4249c3);}})[_0x32ef('0x33')](function(_0x1538d0){if(_0x1538d0){return _0x1538d0?{'count':_0x4c125c,'rows':_0x1538d0}:null;}})[_0x32ef('0x33')](respondWithResult(_0x356704,null))['catch'](handleError(_0x356704,null));};exports['addConfiguration']=function(_0x3b4a8e,_0x5edd29,_0x7d2c3a){if(_0x3b4a8e[_0x32ef('0x57')]['id']){delete _0x3b4a8e['body']['id'];}return db[_0x32ef('0x3a')][_0x32ef('0x59')]({'where':{'id':_0x3b4a8e[_0x32ef('0x55')]['id']}})[_0x32ef('0x33')](handleEntityNotFound(_0x5edd29,null))[_0x32ef('0x33')](function(_0x268dcd){if(_0x268dcd){_0x3b4a8e[_0x32ef('0x57')][_0x32ef('0x5c')]=_0x268dcd['id'];_0x3b4a8e[_0x32ef('0x57')][_0x32ef('0x5d')]=integrations[_0x32ef('0x5e')](_0x3b4a8e[_0x32ef('0x57')]['channel'],_0x3b4a8e['body'][_0x32ef('0x3d')]);_0x3b4a8e[_0x32ef('0x57')]['Descriptions']=integrations[_0x32ef('0x5f')](_0x3b4a8e['body'][_0x32ef('0x60')],_0x3b4a8e[_0x32ef('0x57')][_0x32ef('0x3d')]);return db['SalesforceConfiguration'][_0x32ef('0x56')](_0x3b4a8e['body'],{'include':[{'model':db[_0x32ef('0x61')],'as':_0x32ef('0x5d')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x32ef('0x33')](respondWithResult(_0x5edd29,null))['catch'](handleError(_0x5edd29,null));};exports[_0x32ef('0x62')]=function(_0x4ce588,_0xdbfb6f,_0x199df6){var _0x1adcb8;var _0x4f3442='';var _0x48b35e='Task';return db[_0x32ef('0x3a')]['findOne']({'where':{'id':_0x4ce588[_0x32ef('0x55')]['id']},'attributes':['id',_0x32ef('0x63'),_0x32ef('0x64'),_0x32ef('0x65'),_0x32ef('0x66'),_0x32ef('0x67'),'securityToken']})[_0x32ef('0x33')](handleEntityNotFound(_0xdbfb6f,null))['then'](function(_0x5bbabf){if(_0x5bbabf){_0x4f3442=_0x5bbabf[_0x32ef('0x63')];var _0x5c4f2a=_0x4f3442[_0x32ef('0x68')](-0x1);if(_0x5c4f2a==='/'){_0x4f3442=_0x4f3442[_0x32ef('0x69')](0x0,_0x4f3442['lastIndexOf'](_0x5c4f2a));}_0x1adcb8=new jsforce[(_0x32ef('0x6a'))]({'oauth2':{'loginUrl':_0x4f3442,'clientId':_0x5bbabf[_0x32ef('0x64')],'clientSecret':_0x5bbabf[_0x32ef('0x65')]}});return _0x1adcb8[_0x32ef('0x6b')](_0x5bbabf[_0x32ef('0x66')],_0x5bbabf[_0x32ef('0x67')]['concat'](_0x5bbabf['securityToken']));}})[_0x32ef('0x33')](function(_0x5e0b55){if(_0x5e0b55){if(!_[_0x32ef('0x6c')](_0x4ce588[_0x32ef('0x40')][_0x32ef('0x6d')])){_0x48b35e=_0x4ce588[_0x32ef('0x40')][_0x32ef('0x6d')];}return _0x1adcb8[_0x32ef('0x6e')](_0x48b35e)['describe']();}})[_0x32ef('0x33')](function(_0x146f8c){var _0x251a4f=[_0x32ef('0x6f'),_0x32ef('0x70'),'CallObject','CallType',_0x32ef('0x71'),_0x32ef('0x72'),'Status',_0x32ef('0x73')];if(!_[_0x32ef('0x6c')](_0x4ce588[_0x32ef('0x40')][_0x32ef('0x6d')])&&_0x4ce588[_0x32ef('0x40')][_0x32ef('0x6d')]===_0x32ef('0x74')){_0x251a4f=[_0x32ef('0x73'),_0x32ef('0x75'),'Reason',_0x32ef('0x76'),_0x32ef('0x72'),'IsEscalated',_0x32ef('0x77'),'SuppliedCompany'];}if(_0x146f8c){_[_0x32ef('0x78')](_0x146f8c['fields'],function(_0x43f36e){return _0x43f36e[_0x32ef('0x79')]===![]&&!_0x251a4f[_0x32ef('0x7a')](_0x43f36e[_0x32ef('0x36')]);});return{'count':_0x146f8c['fields'][_0x32ef('0x45')],'rows':_[_0x32ef('0x39')](_0x146f8c[_0x32ef('0x44')],function(_0x57ca9a){return{'id':_0x57ca9a['name'],'name':_0x57ca9a['label'],'custom':_0x57ca9a[_0x32ef('0x79')],'options':_0x57ca9a[_0x32ef('0x7b')][_0x32ef('0x45')]>0x0?_[_0x32ef('0x39')](_0x57ca9a[_0x32ef('0x7b')],function(_0x5a1696){return{'name':_0x5a1696[_0x32ef('0x7c')],'value':_0x5a1696['value']};}):_0x57ca9a[_0x32ef('0x3d')]==_0x32ef('0x7d')?[{'name':_0x32ef('0x7e'),'value':'true'},{'name':_0x32ef('0x7f'),'value':_0x32ef('0x80')}]:[]};})};}})[_0x32ef('0x33')](respondWithResult(_0xdbfb6f,null))[_0x32ef('0x53')](function(_0x28bebb){var _0x4d4b5f=_0x4ce588[_0x32ef('0x40')]['test']?0x1f4:_0x28bebb[_0x32ef('0x81')]||0x1f4;logger[_0x32ef('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4d4b5f,JSON[_0x32ef('0x22')](_0x28bebb));delete _0x28bebb[_0x32ef('0x36')];if(_0x4d4b5f===0x191){_0x4d4b5f=0x190;}_0xdbfb6f[_0x32ef('0x29')](_0x4d4b5f)[_0x32ef('0x37')](_0x4ce588['query'][_0x32ef('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x28bebb['statusCode']}:_0x28bebb);});}; \ No newline at end of file +var _0x4975=['Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','getSubjects','type','channel','SalesforceField','Descriptions','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','substring','lastIndexOf','login','isNil','ticketType','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Case','Origin','IsEscalated','remove','custom','includes','label','picklistValues','value','boolean','True','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x6308d9,_0x59651a){var _0x1fb389=function(_0x12ccd1){while(--_0x12ccd1){_0x6308d9['push'](_0x6308d9['shift']());}};_0x1fb389(++_0x59651a);}(_0x4975,0x86));var _0x5497=function(_0x128cac,_0x241f0e){_0x128cac=_0x128cac-0x0;var _0x5b6245=_0x4975[_0x128cac];return _0x5b6245;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x5497('0x18'));var jayson=require(_0x5497('0x19'));var client=jayson[_0x5497('0x1a')][_0x5497('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x747dc7,_0x365144,_0x1f7169){if(_0x1f7169){var _0xaca97d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xaca97d[_0x5497('0x1c')](_0x365144)){return _0x747dc7;}else{throw new db[(_0x5497('0x1d'))]['ValidationError'](_0x5497('0x1e'));}}else{return _0x747dc7;}}function respondWithRpcPromise(_0x4fb8e9,_0x4237a9,_0x2bfd8a,_0x19e5f3){return new BPromise(function(_0x3ce50b,_0x37c18e){var _0x4073e6=_0x19e5f3||client;return _0x4073e6[_0x5497('0x1f')](_0x4fb8e9,_0x2bfd8a)['then'](function(_0x56a788){logger[_0x5497('0x20')](_0x5497('0x21'),_0x4237a9,_0x5497('0x22'));logger['debug'](_0x5497('0x23'),_0x4237a9,_0x5497('0x22'),JSON[_0x5497('0x24')](_0x56a788));if(_0x56a788[_0x5497('0x25')]){if(_0x56a788[_0x5497('0x25')][_0x5497('0x26')]===0x1f4){logger[_0x5497('0x25')](_0x5497('0x21'),_0x4237a9,_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);return _0x37c18e(_0x56a788[_0x5497('0x25')]['message']);}logger[_0x5497('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x4237a9,_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);return _0x3ce50b(_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);}else{logger[_0x5497('0x20')](_0x5497('0x21'),_0x4237a9,'request\x20sent');_0x3ce50b(_0x56a788['result'][_0x5497('0x27')]);}})[_0x5497('0x28')](function(_0x24482a){logger[_0x5497('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x4237a9,_0x24482a);_0x37c18e(_0x24482a);});});}function respondWithStatusCode(_0x13b7a4,_0x57268c){_0x57268c=_0x57268c||0xcc;return function(_0x1f3198){if(_0x1f3198){return _0x13b7a4[_0x5497('0x29')](_0x57268c);}return _0x13b7a4[_0x5497('0x2a')](_0x57268c)[_0x5497('0x2b')]();};}function respondWithResult(_0x163a30,_0x31cd01){_0x31cd01=_0x31cd01||0xc8;return function(_0x48b835){if(_0x48b835){return _0x163a30[_0x5497('0x2a')](_0x31cd01)['json'](_0x48b835);}};}function respondWithFilteredResult(_0x583d06,_0x498f15){return function(_0x39a2b7){if(_0x39a2b7){var _0x48d146=_0x39a2b7[_0x5497('0x2c')],_0x5e9356=_0x498f15['offset'],_0xc3465=_0x498f15['offset']+_0x498f15['limit'],_0xb14593;if(_0xc3465>=_0x48d146){_0xc3465=_0x48d146;_0xb14593=0xc8;}else{_0xb14593=0xce;}_0x583d06[_0x5497('0x2a')](_0xb14593);return _0x583d06[_0x5497('0x2d')](_0x5497('0x2e'),_0x5e9356+'-'+_0xc3465+'/'+_0x48d146)['json'](_0x39a2b7);}return null;};}function patchUpdates(_0x489f71){return function(_0x594866){try{jsonpatch[_0x5497('0x2f')](_0x594866,_0x489f71,!![]);}catch(_0x572460){return BPromise[_0x5497('0x30')](_0x572460);}return _0x594866[_0x5497('0x31')]();};}function saveUpdates(_0x77c575,_0x4d05c4){return function(_0x1d208f){if(_0x1d208f){return _0x1d208f[_0x5497('0x32')](_0x77c575)['then'](function(_0xce7cb2){return _0xce7cb2;});}return null;};}function removeEntity(_0xce2e81,_0x331dfc){return function(_0x489fbd){if(_0x489fbd){return _0x489fbd[_0x5497('0x33')]()[_0x5497('0x34')](function(){_0xce2e81[_0x5497('0x2a')](0xcc)[_0x5497('0x2b')]();});}};}function handleEntityNotFound(_0x412f5b,_0x4a6459){return function(_0x386845){if(!_0x386845){_0x412f5b[_0x5497('0x29')](0x194);}return _0x386845;};}function handleError(_0x558a70,_0x1ffc9b){_0x1ffc9b=_0x1ffc9b||0x1f4;return function(_0x44299b){logger[_0x5497('0x25')](_0x44299b[_0x5497('0x35')]);if(_0x44299b[_0x5497('0x36')]){delete _0x44299b[_0x5497('0x36')];}_0x558a70['status'](_0x1ffc9b)[_0x5497('0x37')](_0x44299b);};}exports['index']=function(_0x7880e4,_0x212199){var _0x2751f5={},_0x5ab18c={},_0x4ec5f7={'count':0x0,'rows':[]};var _0x396a9f=_[_0x5497('0x38')](db[_0x5497('0x39')][_0x5497('0x3a')],function(_0x43d15f){return{'name':_0x43d15f[_0x5497('0x3b')],'type':_0x43d15f['type'][_0x5497('0x3c')]};});_0x5ab18c[_0x5497('0x3d')]=_[_0x5497('0x38')](_0x396a9f,_0x5497('0x36'));_0x5ab18c[_0x5497('0x3e')]=_[_0x5497('0x3f')](_0x7880e4[_0x5497('0x3e')]);_0x5ab18c[_0x5497('0x40')]=_[_0x5497('0x41')](_0x5ab18c['model'],_0x5ab18c[_0x5497('0x3e')]);_0x2751f5[_0x5497('0x42')]=_[_0x5497('0x41')](_0x5ab18c[_0x5497('0x3d')],qs[_0x5497('0x43')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x43')]));_0x2751f5['attributes']=_0x2751f5[_0x5497('0x42')][_0x5497('0x44')]?_0x2751f5[_0x5497('0x42')]:_0x5ab18c[_0x5497('0x3d')];if(!_0x7880e4[_0x5497('0x3e')][_0x5497('0x45')](_0x5497('0x46'))){_0x2751f5['limit']=qs[_0x5497('0x47')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x47')]);_0x2751f5[_0x5497('0x48')]=qs[_0x5497('0x48')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x48')]);}_0x2751f5[_0x5497('0x49')]=qs[_0x5497('0x4a')](_0x7880e4[_0x5497('0x3e')]['sort']);_0x2751f5[_0x5497('0x4b')]=qs['filters'](_[_0x5497('0x4c')](_0x7880e4[_0x5497('0x3e')],_0x5ab18c[_0x5497('0x40')]));if(_0x7880e4[_0x5497('0x3e')][_0x5497('0x4d')]){_0x2751f5['where']=_[_0x5497('0x4e')](_0x2751f5[_0x5497('0x4b')],{'$or':_['map'](_0x396a9f,function(_0x4d9a8d){if(_0x4d9a8d['type']!==_0x5497('0x4f')){var _0x4aa6b8={};_0x4aa6b8[_0x4d9a8d[_0x5497('0x36')]]={'$like':'%'+_0x7880e4[_0x5497('0x3e')][_0x5497('0x4d')]+'%'};return _0x4aa6b8;}})});}_0x2751f5=_[_0x5497('0x4e')]({},_0x2751f5,_0x7880e4[_0x5497('0x50')]);var _0x5bf06d={'where':_0x2751f5['where']};return db['SalesforceAccount']['count'](_0x5bf06d)[_0x5497('0x34')](function(_0x43c430){_0x4ec5f7[_0x5497('0x2c')]=_0x43c430;if(_0x7880e4[_0x5497('0x3e')][_0x5497('0x51')]){_0x2751f5[_0x5497('0x52')]=[{'all':!![]}];}return db[_0x5497('0x39')][_0x5497('0x53')](_0x2751f5);})[_0x5497('0x34')](function(_0x57350a){_0x4ec5f7[_0x5497('0x54')]=_0x57350a;return _0x4ec5f7;})[_0x5497('0x34')](respondWithFilteredResult(_0x212199,_0x2751f5))[_0x5497('0x28')](handleError(_0x212199,null));};exports['show']=function(_0x3e4da2,_0x530475){var _0x12ffbc={'raw':![],'where':{'id':_0x3e4da2[_0x5497('0x55')]['id']}},_0x31f1ba={};_0x31f1ba['model']=_[_0x5497('0x3f')](db[_0x5497('0x39')]['rawAttributes']);_0x31f1ba[_0x5497('0x3e')]=_['keys'](_0x3e4da2[_0x5497('0x3e')]);_0x31f1ba['filters']=_[_0x5497('0x41')](_0x31f1ba[_0x5497('0x3d')],_0x31f1ba[_0x5497('0x3e')]);_0x12ffbc[_0x5497('0x42')]=_[_0x5497('0x41')](_0x31f1ba[_0x5497('0x3d')],qs[_0x5497('0x43')](_0x3e4da2[_0x5497('0x3e')]['fields']));_0x12ffbc[_0x5497('0x42')]=_0x12ffbc['attributes']['length']?_0x12ffbc[_0x5497('0x42')]:_0x31f1ba[_0x5497('0x3d')];if(_0x3e4da2['query'][_0x5497('0x51')]){_0x12ffbc[_0x5497('0x52')]=[{'all':!![]}];}_0x12ffbc=_[_0x5497('0x4e')]({},_0x12ffbc,_0x3e4da2[_0x5497('0x50')]);return db['SalesforceAccount'][_0x5497('0x56')](_0x12ffbc)['then'](handleEntityNotFound(_0x530475,null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x28')](handleError(_0x530475,null));};exports[_0x5497('0x57')]=function(_0x2f7ec8,_0x49c85a){return db['SalesforceAccount'][_0x5497('0x57')](_0x2f7ec8['body'],{})[_0x5497('0x34')](respondWithResult(_0x49c85a,0xc9))['catch'](handleError(_0x49c85a,null));};exports[_0x5497('0x32')]=function(_0x5b9e57,_0xb1eac0){if(_0x5b9e57[_0x5497('0x58')]['id']){delete _0x5b9e57['body']['id'];}return db[_0x5497('0x39')]['find']({'where':{'id':_0x5b9e57['params']['id']}})[_0x5497('0x34')](handleEntityNotFound(_0xb1eac0,null))[_0x5497('0x34')](saveUpdates(_0x5b9e57['body'],null))[_0x5497('0x34')](respondWithResult(_0xb1eac0,null))[_0x5497('0x28')](handleError(_0xb1eac0,null));};exports[_0x5497('0x33')]=function(_0x28b2a3,_0x3fca40){return db[_0x5497('0x39')]['find']({'where':{'id':_0x28b2a3[_0x5497('0x55')]['id']}})['then'](handleEntityNotFound(_0x3fca40,null))['then'](removeEntity(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};exports[_0x5497('0x59')]=function(_0x37e0b9,_0x23fd59,_0x544085){var _0x53eafd={};var _0x528fb4={};var _0x5f0243;var _0x5a676d;return db[_0x5497('0x39')][_0x5497('0x5a')]({'where':{'id':_0x37e0b9[_0x5497('0x55')]['id']}})[_0x5497('0x34')](handleEntityNotFound(_0x23fd59,null))[_0x5497('0x34')](function(_0x573f93){if(_0x573f93){_0x5f0243=_0x573f93;_0x528fb4[_0x5497('0x3d')]=_[_0x5497('0x3f')](db[_0x5497('0x5b')][_0x5497('0x3a')]);_0x528fb4['query']=_[_0x5497('0x3f')](_0x37e0b9[_0x5497('0x3e')]);_0x528fb4[_0x5497('0x40')]=_[_0x5497('0x41')](_0x528fb4['model'],_0x528fb4[_0x5497('0x3e')]);_0x53eafd[_0x5497('0x42')]=_[_0x5497('0x41')](_0x528fb4['model'],qs[_0x5497('0x43')](_0x37e0b9['query']['fields']));_0x53eafd['attributes']=_0x53eafd[_0x5497('0x42')][_0x5497('0x44')]?_0x53eafd[_0x5497('0x42')]:_0x528fb4['model'];_0x53eafd[_0x5497('0x49')]=qs[_0x5497('0x4a')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4a')]);_0x53eafd['where']=qs[_0x5497('0x40')](_[_0x5497('0x4c')](_0x37e0b9[_0x5497('0x3e')],_0x528fb4['filters']));if(_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4d')]){_0x53eafd[_0x5497('0x4b')]=_[_0x5497('0x4e')](_0x53eafd[_0x5497('0x4b')],{'$or':_[_0x5497('0x38')](_0x53eafd[_0x5497('0x42')],function(_0x4b4cfe){var _0x2c2651={};_0x2c2651[_0x4b4cfe]={'$like':'%'+_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4d')]+'%'};return _0x2c2651;})});}_0x53eafd=_[_0x5497('0x4e')]({},_0x53eafd,_0x37e0b9['options']);return _0x5f0243['getConfigurations'](_0x53eafd);}})['then'](function(_0x305d5b){if(_0x305d5b){_0x5a676d=_0x305d5b[_0x5497('0x44')];if(!_0x37e0b9[_0x5497('0x3e')]['hasOwnProperty'](_0x5497('0x46'))){_0x53eafd[_0x5497('0x47')]=qs[_0x5497('0x47')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x47')]);_0x53eafd[_0x5497('0x48')]=qs[_0x5497('0x48')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x48')]);}return _0x5f0243[_0x5497('0x59')](_0x53eafd);}})[_0x5497('0x34')](function(_0x5a8b3a){if(_0x5a8b3a){return _0x5a8b3a?{'count':_0x5a676d,'rows':_0x5a8b3a}:null;}})[_0x5497('0x34')](respondWithResult(_0x23fd59,null))[_0x5497('0x28')](handleError(_0x23fd59,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){if(_0x4ef195[_0x5497('0x58')]['id']){delete _0x4ef195[_0x5497('0x58')]['id'];}return db['SalesforceAccount'][_0x5497('0x5a')]({'where':{'id':_0x4ef195[_0x5497('0x55')]['id']}})[_0x5497('0x34')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x34')](function(_0x535dba){if(_0x535dba){_0x4ef195[_0x5497('0x58')][_0x5497('0x5d')]=_0x535dba['id'];_0x4ef195[_0x5497('0x58')]['Subjects']=integrations[_0x5497('0x5e')](_0x4ef195[_0x5497('0x58')]['channel'],_0x4ef195[_0x5497('0x58')][_0x5497('0x5f')]);_0x4ef195[_0x5497('0x58')]['Descriptions']=integrations['getDescriptions'](_0x4ef195[_0x5497('0x58')][_0x5497('0x60')],_0x4ef195[_0x5497('0x58')][_0x5497('0x5f')]);return db[_0x5497('0x5b')][_0x5497('0x57')](_0x4ef195[_0x5497('0x58')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x5497('0x61')],'as':_0x5497('0x62')}]});}return null;})['then'](respondWithResult(_0x5794ff,null))[_0x5497('0x28')](handleError(_0x5794ff,null));};exports[_0x5497('0x63')]=function(_0x7415ba,_0x510078,_0xd55539){var _0x3e1e7f;var _0x50356d='';var _0x338957=_0x5497('0x64');return db[_0x5497('0x39')][_0x5497('0x5a')]({'where':{'id':_0x7415ba[_0x5497('0x55')]['id']},'attributes':['id','remoteUri',_0x5497('0x65'),_0x5497('0x66'),_0x5497('0x67'),_0x5497('0x68'),_0x5497('0x69')]})['then'](handleEntityNotFound(_0x510078,null))[_0x5497('0x34')](function(_0xe6996a){if(_0xe6996a){_0x50356d=_0xe6996a[_0x5497('0x6a')];var _0x9e3f4=_0x50356d['slice'](-0x1);if(_0x9e3f4==='/'){_0x50356d=_0x50356d[_0x5497('0x6b')](0x0,_0x50356d[_0x5497('0x6c')](_0x9e3f4));}_0x3e1e7f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x50356d,'clientId':_0xe6996a[_0x5497('0x65')],'clientSecret':_0xe6996a[_0x5497('0x66')]}});return _0x3e1e7f[_0x5497('0x6d')](_0xe6996a[_0x5497('0x67')],_0xe6996a['password']['concat'](_0xe6996a['securityToken']));}})['then'](function(_0x594761){if(_0x594761){if(!_[_0x5497('0x6e')](_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')])){_0x338957=_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')];}return _0x3e1e7f['sobject'](_0x338957)['describe']();}})[_0x5497('0x34')](function(_0x3971dc){var _0x29a2a8=[_0x5497('0x70'),_0x5497('0x71'),_0x5497('0x72'),_0x5497('0x73'),_0x5497('0x74'),_0x5497('0x75'),_0x5497('0x76'),'Type'];if(!_[_0x5497('0x6e')](_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')])&&_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')]===_0x5497('0x77')){_0x29a2a8=['Type',_0x5497('0x78'),'Reason',_0x5497('0x76'),_0x5497('0x75'),_0x5497('0x79'),'SuppliedName','SuppliedCompany'];}if(_0x3971dc){_[_0x5497('0x7a')](_0x3971dc[_0x5497('0x43')],function(_0x953b31){return _0x953b31[_0x5497('0x7b')]===![]&&!_0x29a2a8[_0x5497('0x7c')](_0x953b31[_0x5497('0x36')]);});return{'count':_0x3971dc[_0x5497('0x43')][_0x5497('0x44')],'rows':_['map'](_0x3971dc['fields'],function(_0x492372){return{'id':_0x492372[_0x5497('0x36')],'name':_0x492372[_0x5497('0x7d')],'custom':_0x492372[_0x5497('0x7b')],'options':_0x492372[_0x5497('0x7e')]['length']>0x0?_['map'](_0x492372[_0x5497('0x7e')],function(_0xf38193){return{'name':_0xf38193['label'],'value':_0xf38193[_0x5497('0x7f')]};}):_0x492372[_0x5497('0x5f')]==_0x5497('0x80')?[{'name':_0x5497('0x81'),'value':'true'},{'name':'False','value':'false'}]:[]};})};}})['then'](respondWithResult(_0x510078,null))['catch'](function(_0x497295){var _0x579355=_0x7415ba[_0x5497('0x3e')]['test']?0x1f4:_0x497295[_0x5497('0x82')]||0x1f4;logger[_0x5497('0x25')](_0x5497('0x83'),_0x5497('0x63'),_0x579355,JSON[_0x5497('0x24')](_0x497295));delete _0x497295[_0x5497('0x36')];if(_0x579355===0x191){_0x579355=0x190;}_0x510078['status'](_0x579355)[_0x5497('0x37')](_0x7415ba['query'][_0x5497('0x1c')]?{'message':_0x5497('0x84'),'statusCode':_0x497295[_0x5497('0x82')]}:_0x497295);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index d25ad56..4f2302a 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x749c=['int_salesforce_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x749c,0x76));var _0xc749=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0x749c[_0x372515];return _0xa3bf4e;};'use strict';var _=require(_0xc749('0x0'));var util=require(_0xc749('0x1'));var logger=require(_0xc749('0x2'))(_0xc749('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc749('0x4'));var fs=require('fs');var path=require(_0xc749('0x5'));var rimraf=require(_0xc749('0x6'));var config=require(_0xc749('0x7'));var attributes=require(_0xc749('0x8'));var integrations=require(_0xc749('0x9'));module[_0xc749('0xa')]=function(_0x4f019e,_0x5bea6d){return _0x4f019e['define'](_0xc749('0xb'),attributes,{'tableName':_0xc749('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd693=['api','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x30994d,_0x2cc269){var _0x4554df=function(_0x125125){while(--_0x125125){_0x30994d['push'](_0x30994d['shift']());}};_0x4554df(++_0x2cc269);}(_0xd693,0x1bf));var _0x3d69=function(_0x8b247d,_0x9401a9){_0x8b247d=_0x8b247d-0x0;var _0x4e10a3=_0xd693[_0x8b247d];return _0x4e10a3;};'use strict';var _=require(_0x3d69('0x0'));var util=require(_0x3d69('0x1'));var logger=require(_0x3d69('0x2'))(_0x3d69('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d69('0x4'));var rimraf=require(_0x3d69('0x5'));var config=require('../../config/environment');var attributes=require(_0x3d69('0x6'));var integrations=require(_0x3d69('0x7'));module['exports']=function(_0x5454c0,_0x5b6df9){return _0x5454c0['define'](_0x3d69('0x8'),attributes,{'tableName':_0x3d69('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index dd14027..7db3afc 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','SalesforceAccount','findAll','options','raw','where','attributes','include','map','model','GetSalesforceAccount','stringify','ShowSalesforceAccount','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetSalesforceAccount']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowSalesforceAccount',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xda55=['include','model','find','ShowSalesforceAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xda55,0x6d));var _0x5da5=function(_0x2b27a0,_0x2ee33){_0x2b27a0=_0x2b27a0-0x0;var _0x44ec6b=_0xda55[_0x2b27a0];return _0x44ec6b;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});}exports[_0x5da5('0x16')]=function(_0x16b11f){var _0x3f7e98=this;return new Promise(function(_0x428b07,_0x547c58){return db[_0x5da5('0x17')][_0x5da5('0x18')]({'raw':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1a')]===undefined?!![]:![]:!![],'where':_0x16b11f['options']?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1b')]||null:null,'attributes':_0x16b11f[_0x5da5('0x19')]?_0x16b11f['options'][_0x5da5('0x1c')]||null:null,'limit':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1d')]||null:null,'include':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')]['include']?_[_0x5da5('0x1e')](_0x16b11f['options'][_0x5da5('0x1f')],function(_0x716ab7){return{'model':db[_0x716ab7[_0x5da5('0x20')]],'as':_0x716ab7['as'],'attributes':_0x716ab7['attributes'],'include':_0x716ab7[_0x5da5('0x1f')]?_[_0x5da5('0x1e')](_0x716ab7[_0x5da5('0x1f')],function(_0x21e795){return{'model':db[_0x21e795['model']],'as':_0x21e795['as'],'attributes':_0x21e795['attributes'],'include':_0x21e795['include']?_[_0x5da5('0x1e')](_0x21e795['include'],function(_0x4e8890){return{'model':db[_0x4e8890[_0x5da5('0x20')]],'as':_0x4e8890['as'],'attributes':_0x4e8890[_0x5da5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1798ae){logger[_0x5da5('0x13')]('GetSalesforceAccount',_0x16b11f);logger[_0x5da5('0xd')](_0x5da5('0x16'),_0x16b11f,JSON[_0x5da5('0xf')](_0x1798ae));_0x428b07(_0x1798ae);})[_0x5da5('0x15')](function(_0x766ed9){logger['error'](_0x5da5('0x16'),_0x766ed9[_0x5da5('0x12')],_0x16b11f);_0x547c58(_0x3f7e98[_0x5da5('0x10')](0x1f4,_0x766ed9[_0x5da5('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x5ee7f2){var _0x4cb022=this;return new Promise(function(_0x245273,_0x27ed41){return db[_0x5da5('0x17')][_0x5da5('0x21')]({'raw':_0x5ee7f2['options']?_0x5ee7f2['options'][_0x5da5('0x1a')]===undefined?!![]:![]:!![],'where':_0x5ee7f2['options']?_0x5ee7f2['options'][_0x5da5('0x1b')]||null:null,'attributes':_0x5ee7f2['options']?_0x5ee7f2[_0x5da5('0x19')][_0x5da5('0x1c')]||null:null,'include':_0x5ee7f2[_0x5da5('0x19')]?_0x5ee7f2[_0x5da5('0x19')][_0x5da5('0x1f')]?_[_0x5da5('0x1e')](_0x5ee7f2[_0x5da5('0x19')][_0x5da5('0x1f')],function(_0x52ce3c){return{'model':db[_0x52ce3c[_0x5da5('0x20')]],'as':_0x52ce3c['as'],'attributes':_0x52ce3c['attributes'],'include':_0x52ce3c[_0x5da5('0x1f')]?_[_0x5da5('0x1e')](_0x52ce3c[_0x5da5('0x1f')],function(_0x464623){return{'model':db[_0x464623[_0x5da5('0x20')]],'as':_0x464623['as'],'attributes':_0x464623[_0x5da5('0x1c')],'include':_0x464623[_0x5da5('0x1f')]?_[_0x5da5('0x1e')](_0x464623[_0x5da5('0x1f')],function(_0x1828e9){return{'model':db[_0x1828e9[_0x5da5('0x20')]],'as':_0x1828e9['as'],'attributes':_0x1828e9[_0x5da5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5da5('0xa')](function(_0x4f05d7){logger[_0x5da5('0x13')]('ShowSalesforceAccount',_0x5ee7f2);logger[_0x5da5('0xd')](_0x5da5('0x22'),_0x5ee7f2,JSON[_0x5da5('0xf')](_0x4f05d7));_0x245273(_0x4f05d7);})[_0x5da5('0x15')](function(_0x59c92e){logger[_0x5da5('0x10')](_0x5da5('0x22'),_0x59c92e[_0x5da5('0x12')],_0x5ee7f2);_0x27ed41(_0x4cb022['error'](0x1f4,_0x59c92e[_0x5da5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 72d3b88..178044f 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6281=['/:id','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','get','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create'];(function(_0x34a97f,_0x340c7a){var _0x501f54=function(_0x469572){while(--_0x469572){_0x34a97f['push'](_0x34a97f['shift']());}};_0x501f54(++_0x340c7a);}(_0x6281,0x71));var _0x1628=function(_0x278d8d,_0x458be8){_0x278d8d=_0x278d8d-0x0;var _0x8a6be7=_0x6281[_0x278d8d];return _0x8a6be7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1628('0x0'));var timeout=require('connect-timeout');var express=require(_0x1628('0x1'));var router=express[_0x1628('0x2')]();var auth=require(_0x1628('0x3'));var interaction=require(_0x1628('0x4'));var config=require(_0x1628('0x5'));var controller=require(_0x1628('0x6'));router['get']('/',auth[_0x1628('0x7')](),controller['index']);router[_0x1628('0x8')]('/:id',auth[_0x1628('0x7')](),controller['show']);router[_0x1628('0x8')](_0x1628('0x9'),auth[_0x1628('0x7')](),controller[_0x1628('0xa')]);router['get'](_0x1628('0xb'),auth[_0x1628('0x7')](),controller[_0x1628('0xc')]);router[_0x1628('0x8')]('/:id/descriptions',auth[_0x1628('0x7')](),controller[_0x1628('0xd')]);router['post']('/',auth[_0x1628('0x7')](),controller[_0x1628('0xe')]);router['put'](_0x1628('0xf'),auth[_0x1628('0x7')](),controller['update']);router['delete'](_0x1628('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x92bb=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','/:id','update','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index'];(function(_0x414081,_0x27cd77){var _0x547ea7=function(_0xc9e24e){while(--_0xc9e24e){_0x414081['push'](_0x414081['shift']());}};_0x547ea7(++_0x27cd77);}(_0x92bb,0xe7));var _0xb92b=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0x92bb[_0x4a8418];return _0x390174;};'use strict';var multer=require('multer');var util=require(_0xb92b('0x0'));var path=require(_0xb92b('0x1'));var timeout=require('connect-timeout');var express=require(_0xb92b('0x2'));var router=express[_0xb92b('0x3')]();var auth=require(_0xb92b('0x4'));var interaction=require(_0xb92b('0x5'));var config=require(_0xb92b('0x6'));var controller=require(_0xb92b('0x7'));router[_0xb92b('0x8')]('/',auth[_0xb92b('0x9')](),controller[_0xb92b('0xa')]);router[_0xb92b('0x8')]('/:id',auth[_0xb92b('0x9')](),controller[_0xb92b('0xb')]);router[_0xb92b('0x8')](_0xb92b('0xc'),auth[_0xb92b('0x9')](),controller[_0xb92b('0xd')]);router[_0xb92b('0x8')](_0xb92b('0xe'),auth[_0xb92b('0x9')](),controller[_0xb92b('0xf')]);router['get'](_0xb92b('0x10'),auth[_0xb92b('0x9')](),controller['getDescriptions']);router[_0xb92b('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb92b('0x12'),auth[_0xb92b('0x9')](),controller[_0xb92b('0x13')]);router['delete']('/:id',auth[_0xb92b('0x9')](),controller[_0xb92b('0x14')]);module[_0xb92b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 72ff09c..3615a56 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e73=['STRING','ENUM','Task','contact_lead','contact','lead','nothing','exports'];(function(_0x1db201,_0x4041a7){var _0x5ca8fe=function(_0x577a4a){while(--_0x577a4a){_0x1db201['push'](_0x1db201['shift']());}};_0x5ca8fe(++_0x4041a7);}(_0x6e73,0x107));var _0x36e7=function(_0x49b245,_0x341f9c){_0x49b245=_0x49b245-0x0;var _0x1b9cd1=_0x6e73[_0x49b245];return _0x1b9cd1;};'use strict';var Sequelize=require('sequelize');module[_0x36e7('0x0')]={'name':{'type':Sequelize[_0x36e7('0x1')]},'description':{'type':Sequelize[_0x36e7('0x1')]},'ticketType':{'type':Sequelize[_0x36e7('0x2')]('Task','Case'),'defaultValue':_0x36e7('0x3')},'moduleSearch':{'type':Sequelize[_0x36e7('0x2')](_0x36e7('0x4'),_0x36e7('0x5'),_0x36e7('0x6')),'defaultValue':_0x36e7('0x4')},'moduleCreate':{'type':Sequelize[_0x36e7('0x2')](_0x36e7('0x7'),'contact',_0x36e7('0x6')),'defaultValue':_0x36e7('0x6')}}; \ No newline at end of file +var _0x9452=['sequelize','STRING','Task','Case','ENUM','lead','contact_lead','contact'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x9452,0x188));var _0x2945=function(_0x3d71b5,_0x3b7916){_0x3d71b5=_0x3d71b5-0x0;var _0x585b5b=_0x9452[_0x3d71b5];return _0x585b5b;};'use strict';var Sequelize=require(_0x2945('0x0'));module['exports']={'name':{'type':Sequelize[_0x2945('0x1')]},'description':{'type':Sequelize[_0x2945('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x2945('0x2'),_0x2945('0x3')),'defaultValue':_0x2945('0x2')},'moduleSearch':{'type':Sequelize[_0x2945('0x4')]('contact_lead','contact',_0x2945('0x5')),'defaultValue':_0x2945('0x6')},'moduleCreate':{'type':Sequelize[_0x2945('0x4')]('nothing',_0x2945('0x7'),'lead'),'defaultValue':'lead'}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 514476a..c1c5b41 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f56=['create','update','body','findOne','SalesforceField','getFields','hasOwnProperty','getSubjects','getDescriptions','html-pdf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','reject','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','SalesforceConfiguration','includeAll','include','findAll','rows','show','params','rawAttributes','find'];(function(_0x3ebcd6,_0xc67194){var _0x4faf72=function(_0x1c6f4d){while(--_0x1c6f4d){_0x3ebcd6['push'](_0x3ebcd6['shift']());}};_0x4faf72(++_0xc67194);}(_0x0f56,0xc3));var _0x60f5=function(_0x5db35d,_0x9f1d82){_0x5db35d=_0x5db35d-0x0;var _0x35b039=_0x0f56[_0x5db35d];return _0x35b039;};'use strict';var pdf=require(_0x60f5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x60f5('0x1'));var moment=require(_0x60f5('0x2'));var BPromise=require(_0x60f5('0x3'));var Mustache=require(_0x60f5('0x4'));var util=require(_0x60f5('0x5'));var path=require(_0x60f5('0x6'));var sox=require(_0x60f5('0x7'));var csv=require(_0x60f5('0x8'));var ejs=require(_0x60f5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x60f5('0xa'));var crypto=require(_0x60f5('0xb'));var jsforce=require(_0x60f5('0xc'));var deskjs=require(_0x60f5('0xd'));var toCsv=require(_0x60f5('0x8'));var querystring=require(_0x60f5('0xe'));var Papa=require(_0x60f5('0xf'));var Redis=require(_0x60f5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x60f5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60f5('0x12'));var logger=require(_0x60f5('0x13'))(_0x60f5('0x14'));var utils=require(_0x60f5('0x15'));var config=require(_0x60f5('0x16'));var db=require(_0x60f5('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x60f5('0x18')][_0x60f5('0x19')]({'port':0x232a});function checkPasswordPattern(_0x36dca1,_0x41c064,_0x4f5f9e){if(_0x4f5f9e){var _0x514ca2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x514ca2[_0x60f5('0x1a')](_0x41c064)){return _0x36dca1;}else{throw new db[(_0x60f5('0x1b'))]['ValidationError'](_0x60f5('0x1c'));}}else{return _0x36dca1;}}function respondWithRpcPromise(_0x14bde1,_0x8687e7,_0x551408,_0x45e640){return new BPromise(function(_0x53469d,_0x41a7e0){var _0x317e41=_0x45e640||client;return _0x317e41[_0x60f5('0x1d')](_0x14bde1,_0x551408)[_0x60f5('0x1e')](function(_0x50597a){logger[_0x60f5('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x8687e7,_0x60f5('0x20'));logger[_0x60f5('0x21')](_0x60f5('0x22'),_0x8687e7,_0x60f5('0x20'),JSON[_0x60f5('0x23')](_0x50597a));if(_0x50597a[_0x60f5('0x24')]){if(_0x50597a[_0x60f5('0x24')]['code']===0x1f4){logger[_0x60f5('0x24')](_0x60f5('0x25'),_0x8687e7,_0x50597a[_0x60f5('0x24')][_0x60f5('0x26')]);return _0x41a7e0(_0x50597a[_0x60f5('0x24')]['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x8687e7,_0x50597a[_0x60f5('0x24')][_0x60f5('0x26')]);return _0x53469d(_0x50597a[_0x60f5('0x24')][_0x60f5('0x26')]);}else{logger[_0x60f5('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x8687e7,_0x60f5('0x20'));_0x53469d(_0x50597a[_0x60f5('0x27')][_0x60f5('0x26')]);}})[_0x60f5('0x28')](function(_0x5d8772){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x8687e7,_0x5d8772);_0x41a7e0(_0x5d8772);});});}function respondWithStatusCode(_0x5ca298,_0x68085e){_0x68085e=_0x68085e||0xcc;return function(_0x4e2344){if(_0x4e2344){return _0x5ca298[_0x60f5('0x29')](_0x68085e);}return _0x5ca298[_0x60f5('0x2a')](_0x68085e)[_0x60f5('0x2b')]();};}function respondWithResult(_0x3bfc1b,_0x2bb3ff){_0x2bb3ff=_0x2bb3ff||0xc8;return function(_0x2e3495){if(_0x2e3495){return _0x3bfc1b[_0x60f5('0x2a')](_0x2bb3ff)[_0x60f5('0x2c')](_0x2e3495);}};}function respondWithFilteredResult(_0x191bb4,_0x33fa9b){return function(_0x3653ba){if(_0x3653ba){var _0x2e005c=_0x3653ba[_0x60f5('0x2d')],_0x58601b=_0x33fa9b[_0x60f5('0x2e')],_0x398915=_0x33fa9b[_0x60f5('0x2e')]+_0x33fa9b['limit'],_0x12783e;if(_0x398915>=_0x2e005c){_0x398915=_0x2e005c;_0x12783e=0xc8;}else{_0x12783e=0xce;}_0x191bb4[_0x60f5('0x2a')](_0x12783e);return _0x191bb4['set']('Content-Range',_0x58601b+'-'+_0x398915+'/'+_0x2e005c)['json'](_0x3653ba);}return null;};}function patchUpdates(_0x5055b0){return function(_0x49a6b7){try{jsonpatch['apply'](_0x49a6b7,_0x5055b0,!![]);}catch(_0x118c48){return BPromise[_0x60f5('0x2f')](_0x118c48);}return _0x49a6b7['save']();};}function saveUpdates(_0x150315,_0x397527){return function(_0x5db6e6){if(_0x5db6e6){return _0x5db6e6['update'](_0x150315)[_0x60f5('0x1e')](function(_0x37e667){return _0x37e667;});}return null;};}function removeEntity(_0x416fd9,_0x3b9f2e){return function(_0x36018b){if(_0x36018b){return _0x36018b[_0x60f5('0x30')]()[_0x60f5('0x1e')](function(){_0x416fd9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x123fad,_0x4f6c6e){return function(_0x5d1f38){if(!_0x5d1f38){_0x123fad['sendStatus'](0x194);}return _0x5d1f38;};}function handleError(_0x17a647,_0x587fcf){_0x587fcf=_0x587fcf||0x1f4;return function(_0x4f4e49){logger[_0x60f5('0x24')](_0x4f4e49[_0x60f5('0x31')]);if(_0x4f4e49[_0x60f5('0x32')]){delete _0x4f4e49[_0x60f5('0x32')];}_0x17a647[_0x60f5('0x2a')](_0x587fcf)[_0x60f5('0x33')](_0x4f4e49);};}exports[_0x60f5('0x34')]=function(_0x410ac4,_0x514a0e){var _0x3536d5={},_0x2e7e59={},_0x1ea725={'count':0x0,'rows':[]};var _0x4d4bc3=_[_0x60f5('0x35')](db['SalesforceConfiguration']['rawAttributes'],function(_0x527477){return{'name':_0x527477[_0x60f5('0x36')],'type':_0x527477[_0x60f5('0x37')][_0x60f5('0x38')]};});_0x2e7e59[_0x60f5('0x39')]=_['map'](_0x4d4bc3,_0x60f5('0x32'));_0x2e7e59[_0x60f5('0x3a')]=_[_0x60f5('0x3b')](_0x410ac4[_0x60f5('0x3a')]);_0x2e7e59[_0x60f5('0x3c')]=_[_0x60f5('0x3d')](_0x2e7e59[_0x60f5('0x39')],_0x2e7e59[_0x60f5('0x3a')]);_0x3536d5[_0x60f5('0x3e')]=_[_0x60f5('0x3d')](_0x2e7e59[_0x60f5('0x39')],qs[_0x60f5('0x3f')](_0x410ac4['query'][_0x60f5('0x3f')]));_0x3536d5[_0x60f5('0x3e')]=_0x3536d5[_0x60f5('0x3e')][_0x60f5('0x40')]?_0x3536d5[_0x60f5('0x3e')]:_0x2e7e59[_0x60f5('0x39')];if(!_0x410ac4['query']['hasOwnProperty'](_0x60f5('0x41'))){_0x3536d5[_0x60f5('0x42')]=qs[_0x60f5('0x42')](_0x410ac4[_0x60f5('0x3a')][_0x60f5('0x42')]);_0x3536d5[_0x60f5('0x2e')]=qs[_0x60f5('0x2e')](_0x410ac4[_0x60f5('0x3a')][_0x60f5('0x2e')]);}_0x3536d5[_0x60f5('0x43')]=qs[_0x60f5('0x44')](_0x410ac4[_0x60f5('0x3a')][_0x60f5('0x44')]);_0x3536d5['where']=qs[_0x60f5('0x3c')](_[_0x60f5('0x45')](_0x410ac4['query'],_0x2e7e59[_0x60f5('0x3c')]));if(_0x410ac4[_0x60f5('0x3a')]['filter']){_0x3536d5[_0x60f5('0x46')]=_[_0x60f5('0x47')](_0x3536d5[_0x60f5('0x46')],{'$or':_[_0x60f5('0x35')](_0x4d4bc3,function(_0x5625f7){if(_0x5625f7[_0x60f5('0x37')]!==_0x60f5('0x48')){var _0x1bc31e={};_0x1bc31e[_0x5625f7['name']]={'$like':'%'+_0x410ac4['query'][_0x60f5('0x49')]+'%'};return _0x1bc31e;}})});}_0x3536d5=_[_0x60f5('0x47')]({},_0x3536d5,_0x410ac4[_0x60f5('0x4a')]);var _0x1c40c4={'where':_0x3536d5['where']};return db[_0x60f5('0x4b')]['count'](_0x1c40c4)[_0x60f5('0x1e')](function(_0x52892e){_0x1ea725[_0x60f5('0x2d')]=_0x52892e;if(_0x410ac4[_0x60f5('0x3a')][_0x60f5('0x4c')]){_0x3536d5[_0x60f5('0x4d')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x60f5('0x4e')](_0x3536d5);})['then'](function(_0x1080b9){_0x1ea725[_0x60f5('0x4f')]=_0x1080b9;return _0x1ea725;})[_0x60f5('0x1e')](respondWithFilteredResult(_0x514a0e,_0x3536d5))[_0x60f5('0x28')](handleError(_0x514a0e,null));};exports[_0x60f5('0x50')]=function(_0x1c8878,_0x43abf2){var _0x19c3db={'raw':![],'where':{'id':_0x1c8878[_0x60f5('0x51')]['id']}},_0x3b0882={};_0x3b0882[_0x60f5('0x39')]=_['keys'](db['SalesforceConfiguration'][_0x60f5('0x52')]);_0x3b0882['query']=_['keys'](_0x1c8878[_0x60f5('0x3a')]);_0x3b0882[_0x60f5('0x3c')]=_['intersection'](_0x3b0882['model'],_0x3b0882['query']);_0x19c3db['attributes']=_[_0x60f5('0x3d')](_0x3b0882[_0x60f5('0x39')],qs[_0x60f5('0x3f')](_0x1c8878['query'][_0x60f5('0x3f')]));_0x19c3db[_0x60f5('0x3e')]=_0x19c3db['attributes'][_0x60f5('0x40')]?_0x19c3db[_0x60f5('0x3e')]:_0x3b0882[_0x60f5('0x39')];if(_0x1c8878[_0x60f5('0x3a')][_0x60f5('0x4c')]){_0x19c3db[_0x60f5('0x4d')]=[{'all':!![]}];}_0x19c3db=_[_0x60f5('0x47')]({},_0x19c3db,_0x1c8878[_0x60f5('0x4a')]);return db[_0x60f5('0x4b')][_0x60f5('0x53')](_0x19c3db)[_0x60f5('0x1e')](handleEntityNotFound(_0x43abf2,null))['then'](respondWithResult(_0x43abf2,null))['catch'](handleError(_0x43abf2,null));};exports['create']=function(_0x2d59db,_0x282d53){return db[_0x60f5('0x4b')][_0x60f5('0x54')](_0x2d59db['body'],{})['then'](respondWithResult(_0x282d53,0xc9))[_0x60f5('0x28')](handleError(_0x282d53,null));};exports[_0x60f5('0x55')]=function(_0x4455b6,_0x5d17d7){if(_0x4455b6[_0x60f5('0x56')]['id']){delete _0x4455b6['body']['id'];}return db[_0x60f5('0x4b')][_0x60f5('0x53')]({'where':{'id':_0x4455b6[_0x60f5('0x51')]['id']}})[_0x60f5('0x1e')](handleEntityNotFound(_0x5d17d7,null))[_0x60f5('0x1e')](saveUpdates(_0x4455b6['body'],null))['then'](respondWithResult(_0x5d17d7,null))[_0x60f5('0x28')](handleError(_0x5d17d7,null));};exports[_0x60f5('0x30')]=function(_0x1bab69,_0x371797){return db[_0x60f5('0x4b')][_0x60f5('0x53')]({'where':{'id':_0x1bab69['params']['id']}})[_0x60f5('0x1e')](handleEntityNotFound(_0x371797,null))[_0x60f5('0x1e')](removeEntity(_0x371797,null))['catch'](handleError(_0x371797,null));};exports['getFields']=function(_0x4847b7,_0x234c62,_0x3345e2){var _0x359d09={};var _0x55fff8={};var _0x4d0b1e;var _0x100b46;return db[_0x60f5('0x4b')][_0x60f5('0x57')]({'where':{'id':_0x4847b7[_0x60f5('0x51')]['id']}})[_0x60f5('0x1e')](handleEntityNotFound(_0x234c62,null))[_0x60f5('0x1e')](function(_0x571ac3){if(_0x571ac3){_0x4d0b1e=_0x571ac3;_0x55fff8[_0x60f5('0x39')]=_[_0x60f5('0x3b')](db[_0x60f5('0x58')][_0x60f5('0x52')]);_0x55fff8[_0x60f5('0x3a')]=_['keys'](_0x4847b7[_0x60f5('0x3a')]);_0x55fff8[_0x60f5('0x3c')]=_[_0x60f5('0x3d')](_0x55fff8[_0x60f5('0x39')],_0x55fff8[_0x60f5('0x3a')]);_0x359d09[_0x60f5('0x3e')]=_[_0x60f5('0x3d')](_0x55fff8[_0x60f5('0x39')],qs[_0x60f5('0x3f')](_0x4847b7['query']['fields']));_0x359d09[_0x60f5('0x3e')]=_0x359d09[_0x60f5('0x3e')]['length']?_0x359d09[_0x60f5('0x3e')]:_0x55fff8[_0x60f5('0x39')];_0x359d09['order']=qs['sort'](_0x4847b7[_0x60f5('0x3a')]['sort']);_0x359d09[_0x60f5('0x46')]=qs[_0x60f5('0x3c')](_[_0x60f5('0x45')](_0x4847b7['query'],_0x55fff8[_0x60f5('0x3c')]));if(_0x4847b7[_0x60f5('0x3a')][_0x60f5('0x49')]){_0x359d09['where']=_[_0x60f5('0x47')](_0x359d09[_0x60f5('0x46')],{'$or':_[_0x60f5('0x35')](_0x359d09[_0x60f5('0x3e')],function(_0x42a3b9){var _0x29f868={};_0x29f868[_0x42a3b9]={'$like':'%'+_0x4847b7[_0x60f5('0x3a')][_0x60f5('0x49')]+'%'};return _0x29f868;})});}_0x359d09=_[_0x60f5('0x47')]({},_0x359d09,_0x4847b7[_0x60f5('0x4a')]);return _0x4d0b1e[_0x60f5('0x59')](_0x359d09);}})[_0x60f5('0x1e')](function(_0x8f87ce){if(_0x8f87ce){_0x100b46=_0x8f87ce['length'];if(!_0x4847b7[_0x60f5('0x3a')][_0x60f5('0x5a')](_0x60f5('0x41'))){_0x359d09[_0x60f5('0x42')]=qs['limit'](_0x4847b7[_0x60f5('0x3a')][_0x60f5('0x42')]);_0x359d09['offset']=qs[_0x60f5('0x2e')](_0x4847b7[_0x60f5('0x3a')][_0x60f5('0x2e')]);}return _0x4d0b1e[_0x60f5('0x59')](_0x359d09);}})[_0x60f5('0x1e')](function(_0x40ab73){if(_0x40ab73){return _0x40ab73?{'count':_0x100b46,'rows':_0x40ab73}:null;}})[_0x60f5('0x1e')](respondWithResult(_0x234c62,null))[_0x60f5('0x28')](handleError(_0x234c62,null));};exports[_0x60f5('0x5b')]=function(_0x29f59a,_0x59249c,_0xd3763c){var _0x55da2b={};var _0x5a7f8b={};var _0x3a1dec;var _0x3c4f66;return db[_0x60f5('0x4b')]['findOne']({'where':{'id':_0x29f59a[_0x60f5('0x51')]['id']}})[_0x60f5('0x1e')](handleEntityNotFound(_0x59249c,null))['then'](function(_0x4a7e78){if(_0x4a7e78){_0x3a1dec=_0x4a7e78;_0x5a7f8b[_0x60f5('0x39')]=_[_0x60f5('0x3b')](db[_0x60f5('0x58')][_0x60f5('0x52')]);_0x5a7f8b[_0x60f5('0x3a')]=_[_0x60f5('0x3b')](_0x29f59a[_0x60f5('0x3a')]);_0x5a7f8b[_0x60f5('0x3c')]=_[_0x60f5('0x3d')](_0x5a7f8b[_0x60f5('0x39')],_0x5a7f8b[_0x60f5('0x3a')]);_0x55da2b[_0x60f5('0x3e')]=_[_0x60f5('0x3d')](_0x5a7f8b[_0x60f5('0x39')],qs[_0x60f5('0x3f')](_0x29f59a[_0x60f5('0x3a')][_0x60f5('0x3f')]));_0x55da2b[_0x60f5('0x3e')]=_0x55da2b['attributes'][_0x60f5('0x40')]?_0x55da2b[_0x60f5('0x3e')]:_0x5a7f8b[_0x60f5('0x39')];_0x55da2b[_0x60f5('0x43')]=qs[_0x60f5('0x44')](_0x29f59a[_0x60f5('0x3a')][_0x60f5('0x44')]);_0x55da2b[_0x60f5('0x46')]=qs[_0x60f5('0x3c')](_[_0x60f5('0x45')](_0x29f59a[_0x60f5('0x3a')],_0x5a7f8b[_0x60f5('0x3c')]));if(_0x29f59a[_0x60f5('0x3a')][_0x60f5('0x49')]){_0x55da2b[_0x60f5('0x46')]=_[_0x60f5('0x47')](_0x55da2b[_0x60f5('0x46')],{'$or':_[_0x60f5('0x35')](_0x55da2b['attributes'],function(_0x519183){var _0x3ee07b={};_0x3ee07b[_0x519183]={'$like':'%'+_0x29f59a[_0x60f5('0x3a')]['filter']+'%'};return _0x3ee07b;})});}_0x55da2b=_[_0x60f5('0x47')]({},_0x55da2b,_0x29f59a['options']);return _0x3a1dec[_0x60f5('0x5b')](_0x55da2b);}})['then'](function(_0x3222f8){if(_0x3222f8){_0x3c4f66=_0x3222f8[_0x60f5('0x40')];if(!_0x29f59a[_0x60f5('0x3a')][_0x60f5('0x5a')](_0x60f5('0x41'))){_0x55da2b['limit']=qs[_0x60f5('0x42')](_0x29f59a['query'][_0x60f5('0x42')]);_0x55da2b['offset']=qs['offset'](_0x29f59a['query'][_0x60f5('0x2e')]);}return _0x3a1dec[_0x60f5('0x5b')](_0x55da2b);}})[_0x60f5('0x1e')](function(_0xd39dcd){if(_0xd39dcd){return _0xd39dcd?{'count':_0x3c4f66,'rows':_0xd39dcd}:null;}})[_0x60f5('0x1e')](respondWithResult(_0x59249c,null))['catch'](handleError(_0x59249c,null));};exports['getDescriptions']=function(_0x343329,_0x39cfd3,_0x5e843a){var _0x18df7e={};var _0x1c3deb={};var _0x1202a8;var _0x460838;return db['SalesforceConfiguration'][_0x60f5('0x57')]({'where':{'id':_0x343329[_0x60f5('0x51')]['id']}})[_0x60f5('0x1e')](handleEntityNotFound(_0x39cfd3,null))[_0x60f5('0x1e')](function(_0x12e076){if(_0x12e076){_0x1202a8=_0x12e076;_0x1c3deb[_0x60f5('0x39')]=_[_0x60f5('0x3b')](db['SalesforceField'][_0x60f5('0x52')]);_0x1c3deb['query']=_[_0x60f5('0x3b')](_0x343329['query']);_0x1c3deb[_0x60f5('0x3c')]=_[_0x60f5('0x3d')](_0x1c3deb['model'],_0x1c3deb[_0x60f5('0x3a')]);_0x18df7e[_0x60f5('0x3e')]=_[_0x60f5('0x3d')](_0x1c3deb[_0x60f5('0x39')],qs[_0x60f5('0x3f')](_0x343329['query'][_0x60f5('0x3f')]));_0x18df7e['attributes']=_0x18df7e['attributes'][_0x60f5('0x40')]?_0x18df7e[_0x60f5('0x3e')]:_0x1c3deb[_0x60f5('0x39')];_0x18df7e[_0x60f5('0x43')]=qs['sort'](_0x343329[_0x60f5('0x3a')]['sort']);_0x18df7e['where']=qs['filters'](_['pick'](_0x343329[_0x60f5('0x3a')],_0x1c3deb['filters']));if(_0x343329[_0x60f5('0x3a')][_0x60f5('0x49')]){_0x18df7e[_0x60f5('0x46')]=_[_0x60f5('0x47')](_0x18df7e[_0x60f5('0x46')],{'$or':_['map'](_0x18df7e[_0x60f5('0x3e')],function(_0x4de5fa){var _0xe74c0={};_0xe74c0[_0x4de5fa]={'$like':'%'+_0x343329[_0x60f5('0x3a')][_0x60f5('0x49')]+'%'};return _0xe74c0;})});}_0x18df7e=_[_0x60f5('0x47')]({},_0x18df7e,_0x343329[_0x60f5('0x4a')]);return _0x1202a8[_0x60f5('0x5c')](_0x18df7e);}})[_0x60f5('0x1e')](function(_0x3eb70f){if(_0x3eb70f){_0x460838=_0x3eb70f[_0x60f5('0x40')];if(!_0x343329[_0x60f5('0x3a')][_0x60f5('0x5a')](_0x60f5('0x41'))){_0x18df7e[_0x60f5('0x42')]=qs[_0x60f5('0x42')](_0x343329['query'][_0x60f5('0x42')]);_0x18df7e[_0x60f5('0x2e')]=qs['offset'](_0x343329[_0x60f5('0x3a')][_0x60f5('0x2e')]);}return _0x1202a8['getDescriptions'](_0x18df7e);}})['then'](function(_0x114cb4){if(_0x114cb4){return _0x114cb4?{'count':_0x460838,'rows':_0x114cb4}:null;}})['then'](respondWithResult(_0x39cfd3,null))[_0x60f5('0x28')](handleError(_0x39cfd3,null));}; \ No newline at end of file +var _0x935d=['index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','count','include','findAll','show','params','keys','includeAll','options','find','create','body','update','getFields','pick','nolimit','getSubjects','findOne','SalesforceField','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','request','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','SalesforceConfiguration,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','stack','name','send'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x935d,0x1e5));var _0xd935=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0x935d[_0x56daff];return _0x132c82;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd935('0x0'));var jsonpatch=require(_0xd935('0x1'));var rp=require(_0xd935('0x2'));var moment=require(_0xd935('0x3'));var BPromise=require(_0xd935('0x4'));var Mustache=require('mustache');var util=require(_0xd935('0x5'));var path=require(_0xd935('0x6'));var sox=require(_0xd935('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd935('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd935('0x9'));var Redis=require(_0xd935('0xa'));var authService=require('../../components/auth/service');var qs=require(_0xd935('0xb'));var as=require(_0xd935('0xc'));var hardwareService=require(_0xd935('0xd'));var logger=require(_0xd935('0xe'))(_0xd935('0xf'));var utils=require(_0xd935('0x10'));var config=require(_0xd935('0x11'));var db=require(_0xd935('0x12'))['db'];var jayson=require(_0xd935('0x13'));var client=jayson[_0xd935('0x14')][_0xd935('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3a248d,_0x3a0c2d,_0x1ea1f1){if(_0x1ea1f1){var _0x24dd5a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24dd5a['test'](_0x3a0c2d)){return _0x3a248d;}else{throw new db[(_0xd935('0x16'))][(_0xd935('0x17'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3a248d;}}function respondWithRpcPromise(_0x25a16b,_0x227ca5,_0x1169af,_0x182b80){return new BPromise(function(_0x1fecbf,_0x57a284){var _0x52196=_0x182b80||client;return _0x52196[_0xd935('0x18')](_0x25a16b,_0x1169af)['then'](function(_0x401d05){logger[_0xd935('0x19')]('SalesforceConfiguration,\x20%s,\x20%s',_0x227ca5,'request\x20sent');logger['debug'](_0xd935('0x1a'),_0x227ca5,_0xd935('0x1b'),JSON[_0xd935('0x1c')](_0x401d05));if(_0x401d05['error']){if(_0x401d05['error']['code']===0x1f4){logger['error'](_0xd935('0x1d'),_0x227ca5,_0x401d05[_0xd935('0x1e')][_0xd935('0x1f')]);return _0x57a284(_0x401d05[_0xd935('0x1e')][_0xd935('0x1f')]);}logger[_0xd935('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0x227ca5,_0x401d05['error']['message']);return _0x1fecbf(_0x401d05[_0xd935('0x1e')]['message']);}else{logger['info'](_0xd935('0x1d'),_0x227ca5,'request\x20sent');_0x1fecbf(_0x401d05[_0xd935('0x20')][_0xd935('0x1f')]);}})[_0xd935('0x21')](function(_0x4ace4e){logger[_0xd935('0x1e')](_0xd935('0x1d'),_0x227ca5,_0x4ace4e);_0x57a284(_0x4ace4e);});});}function respondWithStatusCode(_0x420d8d,_0x37d0b0){_0x37d0b0=_0x37d0b0||0xcc;return function(_0x54918c){if(_0x54918c){return _0x420d8d[_0xd935('0x22')](_0x37d0b0);}return _0x420d8d[_0xd935('0x23')](_0x37d0b0)[_0xd935('0x24')]();};}function respondWithResult(_0x3fb5d6,_0x744815){_0x744815=_0x744815||0xc8;return function(_0x53ac43){if(_0x53ac43){return _0x3fb5d6[_0xd935('0x23')](_0x744815)[_0xd935('0x25')](_0x53ac43);}};}function respondWithFilteredResult(_0x1006ce,_0x504314){return function(_0x1d8c92){if(_0x1d8c92){var _0x49dbdf=_0x1d8c92['count'],_0x2585c6=_0x504314[_0xd935('0x26')],_0x5cc2db=_0x504314['offset']+_0x504314[_0xd935('0x27')],_0x1b95b3;if(_0x5cc2db>=_0x49dbdf){_0x5cc2db=_0x49dbdf;_0x1b95b3=0xc8;}else{_0x1b95b3=0xce;}_0x1006ce['status'](_0x1b95b3);return _0x1006ce[_0xd935('0x28')](_0xd935('0x29'),_0x2585c6+'-'+_0x5cc2db+'/'+_0x49dbdf)[_0xd935('0x25')](_0x1d8c92);}return null;};}function patchUpdates(_0x5ad67b){return function(_0x24576c){try{jsonpatch['apply'](_0x24576c,_0x5ad67b,!![]);}catch(_0x36312a){return BPromise[_0xd935('0x2a')](_0x36312a);}return _0x24576c[_0xd935('0x2b')]();};}function saveUpdates(_0x4478ec,_0x48bb34){return function(_0x488917){if(_0x488917){return _0x488917['update'](_0x4478ec)[_0xd935('0x2c')](function(_0x1efef8){return _0x1efef8;});}return null;};}function removeEntity(_0x16dd1b,_0x42e07d){return function(_0x158fe8){if(_0x158fe8){return _0x158fe8[_0xd935('0x2d')]()[_0xd935('0x2c')](function(){_0x16dd1b[_0xd935('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10adcc,_0x1f2cde){return function(_0x3a8bdd){if(!_0x3a8bdd){_0x10adcc[_0xd935('0x22')](0x194);}return _0x3a8bdd;};}function handleError(_0x2f005b,_0x3a9caf){_0x3a9caf=_0x3a9caf||0x1f4;return function(_0x8be284){logger[_0xd935('0x1e')](_0x8be284[_0xd935('0x2e')]);if(_0x8be284[_0xd935('0x2f')]){delete _0x8be284['name'];}_0x2f005b[_0xd935('0x23')](_0x3a9caf)[_0xd935('0x30')](_0x8be284);};}exports[_0xd935('0x31')]=function(_0x36966b,_0x349e72){var _0x2278d7={},_0x4be75a={},_0x17b4c6={'count':0x0,'rows':[]};var _0x5f4603=_[_0xd935('0x32')](db[_0xd935('0x33')][_0xd935('0x34')],function(_0x4e7e81){return{'name':_0x4e7e81[_0xd935('0x35')],'type':_0x4e7e81[_0xd935('0x36')][_0xd935('0x37')]};});_0x4be75a[_0xd935('0x38')]=_['map'](_0x5f4603,_0xd935('0x2f'));_0x4be75a['query']=_['keys'](_0x36966b[_0xd935('0x39')]);_0x4be75a[_0xd935('0x3a')]=_[_0xd935('0x3b')](_0x4be75a[_0xd935('0x38')],_0x4be75a['query']);_0x2278d7[_0xd935('0x3c')]=_[_0xd935('0x3b')](_0x4be75a[_0xd935('0x38')],qs[_0xd935('0x3d')](_0x36966b['query'][_0xd935('0x3d')]));_0x2278d7[_0xd935('0x3c')]=_0x2278d7[_0xd935('0x3c')][_0xd935('0x3e')]?_0x2278d7[_0xd935('0x3c')]:_0x4be75a[_0xd935('0x38')];if(!_0x36966b[_0xd935('0x39')][_0xd935('0x3f')]('nolimit')){_0x2278d7['limit']=qs[_0xd935('0x27')](_0x36966b[_0xd935('0x39')][_0xd935('0x27')]);_0x2278d7[_0xd935('0x26')]=qs[_0xd935('0x26')](_0x36966b[_0xd935('0x39')][_0xd935('0x26')]);}_0x2278d7[_0xd935('0x40')]=qs[_0xd935('0x41')](_0x36966b[_0xd935('0x39')][_0xd935('0x41')]);_0x2278d7['where']=qs['filters'](_['pick'](_0x36966b['query'],_0x4be75a['filters']));if(_0x36966b['query'][_0xd935('0x42')]){_0x2278d7['where']=_[_0xd935('0x43')](_0x2278d7[_0xd935('0x44')],{'$or':_[_0xd935('0x32')](_0x5f4603,function(_0x1aaa27){if(_0x1aaa27[_0xd935('0x36')]!==_0xd935('0x45')){var _0x15b539={};_0x15b539[_0x1aaa27[_0xd935('0x2f')]]={'$like':'%'+_0x36966b[_0xd935('0x39')][_0xd935('0x42')]+'%'};return _0x15b539;}})});}_0x2278d7=_['merge']({},_0x2278d7,_0x36966b['options']);var _0x10a4ac={'where':_0x2278d7[_0xd935('0x44')]};return db[_0xd935('0x33')][_0xd935('0x46')](_0x10a4ac)[_0xd935('0x2c')](function(_0x5dde6f){_0x17b4c6['count']=_0x5dde6f;if(_0x36966b[_0xd935('0x39')]['includeAll']){_0x2278d7[_0xd935('0x47')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xd935('0x48')](_0x2278d7);})[_0xd935('0x2c')](function(_0x419a2e){_0x17b4c6['rows']=_0x419a2e;return _0x17b4c6;})[_0xd935('0x2c')](respondWithFilteredResult(_0x349e72,_0x2278d7))[_0xd935('0x21')](handleError(_0x349e72,null));};exports[_0xd935('0x49')]=function(_0x3ec763,_0x5774b7){var _0x35c1c7={'raw':![],'where':{'id':_0x3ec763[_0xd935('0x4a')]['id']}},_0x2abfa6={};_0x2abfa6['model']=_[_0xd935('0x4b')](db[_0xd935('0x33')][_0xd935('0x34')]);_0x2abfa6[_0xd935('0x39')]=_[_0xd935('0x4b')](_0x3ec763['query']);_0x2abfa6[_0xd935('0x3a')]=_[_0xd935('0x3b')](_0x2abfa6[_0xd935('0x38')],_0x2abfa6[_0xd935('0x39')]);_0x35c1c7[_0xd935('0x3c')]=_[_0xd935('0x3b')](_0x2abfa6[_0xd935('0x38')],qs[_0xd935('0x3d')](_0x3ec763[_0xd935('0x39')][_0xd935('0x3d')]));_0x35c1c7['attributes']=_0x35c1c7['attributes'][_0xd935('0x3e')]?_0x35c1c7['attributes']:_0x2abfa6[_0xd935('0x38')];if(_0x3ec763[_0xd935('0x39')][_0xd935('0x4c')]){_0x35c1c7[_0xd935('0x47')]=[{'all':!![]}];}_0x35c1c7=_[_0xd935('0x43')]({},_0x35c1c7,_0x3ec763[_0xd935('0x4d')]);return db[_0xd935('0x33')][_0xd935('0x4e')](_0x35c1c7)[_0xd935('0x2c')](handleEntityNotFound(_0x5774b7,null))['then'](respondWithResult(_0x5774b7,null))[_0xd935('0x21')](handleError(_0x5774b7,null));};exports['create']=function(_0x1a8236,_0x5c68d3){return db[_0xd935('0x33')][_0xd935('0x4f')](_0x1a8236[_0xd935('0x50')],{})['then'](respondWithResult(_0x5c68d3,0xc9))['catch'](handleError(_0x5c68d3,null));};exports[_0xd935('0x51')]=function(_0x47360d,_0x890916){if(_0x47360d['body']['id']){delete _0x47360d['body']['id'];}return db[_0xd935('0x33')][_0xd935('0x4e')]({'where':{'id':_0x47360d[_0xd935('0x4a')]['id']}})[_0xd935('0x2c')](handleEntityNotFound(_0x890916,null))[_0xd935('0x2c')](saveUpdates(_0x47360d['body'],null))[_0xd935('0x2c')](respondWithResult(_0x890916,null))['catch'](handleError(_0x890916,null));};exports[_0xd935('0x2d')]=function(_0x12e9f5,_0x32caa3){return db['SalesforceConfiguration'][_0xd935('0x4e')]({'where':{'id':_0x12e9f5['params']['id']}})['then'](handleEntityNotFound(_0x32caa3,null))['then'](removeEntity(_0x32caa3,null))[_0xd935('0x21')](handleError(_0x32caa3,null));};exports[_0xd935('0x52')]=function(_0x11de1e,_0x4b7f03,_0x381091){var _0x2629fa={};var _0x1487ae={};var _0x148919;var _0x3d12c4;return db[_0xd935('0x33')]['findOne']({'where':{'id':_0x11de1e[_0xd935('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b7f03,null))[_0xd935('0x2c')](function(_0x36baa8){if(_0x36baa8){_0x148919=_0x36baa8;_0x1487ae[_0xd935('0x38')]=_[_0xd935('0x4b')](db['SalesforceField'][_0xd935('0x34')]);_0x1487ae[_0xd935('0x39')]=_[_0xd935('0x4b')](_0x11de1e[_0xd935('0x39')]);_0x1487ae['filters']=_[_0xd935('0x3b')](_0x1487ae[_0xd935('0x38')],_0x1487ae['query']);_0x2629fa[_0xd935('0x3c')]=_[_0xd935('0x3b')](_0x1487ae[_0xd935('0x38')],qs[_0xd935('0x3d')](_0x11de1e[_0xd935('0x39')][_0xd935('0x3d')]));_0x2629fa[_0xd935('0x3c')]=_0x2629fa['attributes'][_0xd935('0x3e')]?_0x2629fa[_0xd935('0x3c')]:_0x1487ae[_0xd935('0x38')];_0x2629fa['order']=qs[_0xd935('0x41')](_0x11de1e[_0xd935('0x39')][_0xd935('0x41')]);_0x2629fa['where']=qs[_0xd935('0x3a')](_[_0xd935('0x53')](_0x11de1e[_0xd935('0x39')],_0x1487ae[_0xd935('0x3a')]));if(_0x11de1e[_0xd935('0x39')][_0xd935('0x42')]){_0x2629fa[_0xd935('0x44')]=_[_0xd935('0x43')](_0x2629fa[_0xd935('0x44')],{'$or':_[_0xd935('0x32')](_0x2629fa['attributes'],function(_0x44d3d5){var _0x30ab55={};_0x30ab55[_0x44d3d5]={'$like':'%'+_0x11de1e[_0xd935('0x39')][_0xd935('0x42')]+'%'};return _0x30ab55;})});}_0x2629fa=_[_0xd935('0x43')]({},_0x2629fa,_0x11de1e[_0xd935('0x4d')]);return _0x148919[_0xd935('0x52')](_0x2629fa);}})['then'](function(_0x26e7a4){if(_0x26e7a4){_0x3d12c4=_0x26e7a4[_0xd935('0x3e')];if(!_0x11de1e[_0xd935('0x39')][_0xd935('0x3f')](_0xd935('0x54'))){_0x2629fa[_0xd935('0x27')]=qs[_0xd935('0x27')](_0x11de1e['query'][_0xd935('0x27')]);_0x2629fa['offset']=qs[_0xd935('0x26')](_0x11de1e['query'][_0xd935('0x26')]);}return _0x148919[_0xd935('0x52')](_0x2629fa);}})['then'](function(_0x3c581b){if(_0x3c581b){return _0x3c581b?{'count':_0x3d12c4,'rows':_0x3c581b}:null;}})['then'](respondWithResult(_0x4b7f03,null))['catch'](handleError(_0x4b7f03,null));};exports[_0xd935('0x55')]=function(_0x34e950,_0x2d5276,_0x26be54){var _0x49cfa2={};var _0x5b3360={};var _0x195346;var _0x1bc575;return db[_0xd935('0x33')][_0xd935('0x56')]({'where':{'id':_0x34e950[_0xd935('0x4a')]['id']}})[_0xd935('0x2c')](handleEntityNotFound(_0x2d5276,null))[_0xd935('0x2c')](function(_0x3d9afd){if(_0x3d9afd){_0x195346=_0x3d9afd;_0x5b3360[_0xd935('0x38')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x5b3360[_0xd935('0x39')]=_[_0xd935('0x4b')](_0x34e950['query']);_0x5b3360['filters']=_[_0xd935('0x3b')](_0x5b3360[_0xd935('0x38')],_0x5b3360[_0xd935('0x39')]);_0x49cfa2['attributes']=_['intersection'](_0x5b3360[_0xd935('0x38')],qs[_0xd935('0x3d')](_0x34e950['query']['fields']));_0x49cfa2[_0xd935('0x3c')]=_0x49cfa2[_0xd935('0x3c')]['length']?_0x49cfa2[_0xd935('0x3c')]:_0x5b3360[_0xd935('0x38')];_0x49cfa2['order']=qs[_0xd935('0x41')](_0x34e950[_0xd935('0x39')]['sort']);_0x49cfa2[_0xd935('0x44')]=qs[_0xd935('0x3a')](_[_0xd935('0x53')](_0x34e950[_0xd935('0x39')],_0x5b3360[_0xd935('0x3a')]));if(_0x34e950['query'][_0xd935('0x42')]){_0x49cfa2[_0xd935('0x44')]=_[_0xd935('0x43')](_0x49cfa2[_0xd935('0x44')],{'$or':_['map'](_0x49cfa2[_0xd935('0x3c')],function(_0x5450ac){var _0x479e00={};_0x479e00[_0x5450ac]={'$like':'%'+_0x34e950[_0xd935('0x39')][_0xd935('0x42')]+'%'};return _0x479e00;})});}_0x49cfa2=_['merge']({},_0x49cfa2,_0x34e950['options']);return _0x195346[_0xd935('0x55')](_0x49cfa2);}})['then'](function(_0x5be84f){if(_0x5be84f){_0x1bc575=_0x5be84f['length'];if(!_0x34e950[_0xd935('0x39')]['hasOwnProperty'](_0xd935('0x54'))){_0x49cfa2[_0xd935('0x27')]=qs[_0xd935('0x27')](_0x34e950['query'][_0xd935('0x27')]);_0x49cfa2['offset']=qs['offset'](_0x34e950[_0xd935('0x39')][_0xd935('0x26')]);}return _0x195346['getSubjects'](_0x49cfa2);}})[_0xd935('0x2c')](function(_0x1de16d){if(_0x1de16d){return _0x1de16d?{'count':_0x1bc575,'rows':_0x1de16d}:null;}})[_0xd935('0x2c')](respondWithResult(_0x2d5276,null))['catch'](handleError(_0x2d5276,null));};exports['getDescriptions']=function(_0x32f078,_0x2eeda6,_0x541d41){var _0x699251={};var _0x2c1f33={};var _0x4b36b2;var _0x537358;return db['SalesforceConfiguration'][_0xd935('0x56')]({'where':{'id':_0x32f078[_0xd935('0x4a')]['id']}})[_0xd935('0x2c')](handleEntityNotFound(_0x2eeda6,null))['then'](function(_0x1c0d67){if(_0x1c0d67){_0x4b36b2=_0x1c0d67;_0x2c1f33[_0xd935('0x38')]=_[_0xd935('0x4b')](db[_0xd935('0x57')][_0xd935('0x34')]);_0x2c1f33[_0xd935('0x39')]=_[_0xd935('0x4b')](_0x32f078[_0xd935('0x39')]);_0x2c1f33[_0xd935('0x3a')]=_[_0xd935('0x3b')](_0x2c1f33[_0xd935('0x38')],_0x2c1f33[_0xd935('0x39')]);_0x699251['attributes']=_[_0xd935('0x3b')](_0x2c1f33[_0xd935('0x38')],qs[_0xd935('0x3d')](_0x32f078[_0xd935('0x39')][_0xd935('0x3d')]));_0x699251[_0xd935('0x3c')]=_0x699251['attributes'][_0xd935('0x3e')]?_0x699251[_0xd935('0x3c')]:_0x2c1f33[_0xd935('0x38')];_0x699251[_0xd935('0x40')]=qs[_0xd935('0x41')](_0x32f078[_0xd935('0x39')][_0xd935('0x41')]);_0x699251[_0xd935('0x44')]=qs[_0xd935('0x3a')](_[_0xd935('0x53')](_0x32f078[_0xd935('0x39')],_0x2c1f33[_0xd935('0x3a')]));if(_0x32f078['query'][_0xd935('0x42')]){_0x699251['where']=_['merge'](_0x699251[_0xd935('0x44')],{'$or':_[_0xd935('0x32')](_0x699251['attributes'],function(_0x4c6f8b){var _0x4c2d5d={};_0x4c2d5d[_0x4c6f8b]={'$like':'%'+_0x32f078[_0xd935('0x39')]['filter']+'%'};return _0x4c2d5d;})});}_0x699251=_[_0xd935('0x43')]({},_0x699251,_0x32f078[_0xd935('0x4d')]);return _0x4b36b2[_0xd935('0x58')](_0x699251);}})[_0xd935('0x2c')](function(_0x1be286){if(_0x1be286){_0x537358=_0x1be286[_0xd935('0x3e')];if(!_0x32f078['query'][_0xd935('0x3f')](_0xd935('0x54'))){_0x699251[_0xd935('0x27')]=qs[_0xd935('0x27')](_0x32f078['query'][_0xd935('0x27')]);_0x699251['offset']=qs['offset'](_0x32f078[_0xd935('0x39')]['offset']);}return _0x4b36b2[_0xd935('0x58')](_0x699251);}})[_0xd935('0x2c')](function(_0x1b0182){if(_0x1b0182){return _0x1b0182?{'count':_0x537358,'rows':_0x1b0182}:null;}})['then'](respondWithResult(_0x2eeda6,null))[_0xd935('0x21')](handleError(_0x2eeda6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 0e0ce31..a116fe0 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcdb=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfcdb,0xa1));var _0xbfcd=function(_0x52f1c9,_0x2f61cb){_0x52f1c9=_0x52f1c9-0x0;var _0x2009bb=_0xfcdb[_0x52f1c9];return _0x2009bb;};'use strict';var _=require(_0xbfcd('0x0'));var util=require(_0xbfcd('0x1'));var logger=require('../../config/logger')(_0xbfcd('0x2'));var moment=require(_0xbfcd('0x3'));var BPromise=require(_0xbfcd('0x4'));var rp=require(_0xbfcd('0x5'));var fs=require('fs');var path=require(_0xbfcd('0x6'));var rimraf=require(_0xbfcd('0x7'));var config=require(_0xbfcd('0x8'));var attributes=require(_0xbfcd('0x9'));module[_0xbfcd('0xa')]=function(_0x33cc5a,_0xe90826){return _0x33cc5a[_0xbfcd('0xb')]('SalesforceConfiguration',attributes,{'tableName':_0xbfcd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dc1=['api','moment','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x70504d,_0x34e810){var _0x47e29b=function(_0x119dfe){while(--_0x119dfe){_0x70504d['push'](_0x70504d['shift']());}};_0x47e29b(++_0x34e810);}(_0x9dc1,0xcf));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x19dc('0x0'));var util=require(_0x19dc('0x1'));var logger=require(_0x19dc('0x2'))(_0x19dc('0x3'));var moment=require(_0x19dc('0x4'));var BPromise=require('bluebird');var rp=require(_0x19dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x19dc('0x6'));var attributes=require(_0x19dc('0x7'));module['exports']=function(_0x5f29e0,_0xff1008){return _0x5f29e0['define'](_0x19dc('0x8'),attributes,{'tableName':_0x19dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 99e2b3e..8e199fa 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x000f=['../../config/logger','rpc','jayson/promise','http','request','info','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x000f,0x173));var _0xf000=function(_0x2a62e1,_0x169319){_0x2a62e1=_0x2a62e1-0x0;var _0x936fb4=_0x000f[_0x2a62e1];return _0x936fb4;};'use strict';var _=require(_0xf000('0x0'));var util=require(_0xf000('0x1'));var moment=require(_0xf000('0x2'));var BPromise=require(_0xf000('0x3'));var rs=require(_0xf000('0x4'));var fs=require('fs');var Redis=require(_0xf000('0x5'));var db=require(_0xf000('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf000('0x7'))(_0xf000('0x8'));var config=require('../../config/environment');var jayson=require(_0xf000('0x9'));var client=jayson['client'][_0xf000('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x120e25,_0x1f6c10,_0x4703a3){return new BPromise(function(_0x6606c,_0x3c8040){return client[_0xf000('0xb')](_0x120e25,_0x4703a3)['then'](function(_0x1a21f8){logger[_0xf000('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1f6c10,'request\x20sent');logger[_0xf000('0xd')](_0xf000('0xe'),_0x1f6c10,'request\x20sent',JSON[_0xf000('0xf')](_0x1a21f8));if(_0x1a21f8[_0xf000('0x10')]){if(_0x1a21f8[_0xf000('0x10')]['code']===0x1f4){logger[_0xf000('0x10')](_0xf000('0x11'),_0x1f6c10,_0x1a21f8[_0xf000('0x10')][_0xf000('0x12')]);return _0x3c8040(_0x1a21f8[_0xf000('0x10')]['message']);}logger[_0xf000('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1f6c10,_0x1a21f8[_0xf000('0x10')][_0xf000('0x12')]);return _0x6606c(_0x1a21f8[_0xf000('0x10')]['message']);}else{logger[_0xf000('0xc')](_0xf000('0x11'),_0x1f6c10,_0xf000('0x13'));_0x6606c(_0x1a21f8[_0xf000('0x14')][_0xf000('0x12')]);}})['catch'](function(_0x16018f){logger[_0xf000('0x10')](_0xf000('0x11'),_0x1f6c10,_0x16018f);_0x3c8040(_0x16018f);});});} \ No newline at end of file +var _0xaca4=['../../mysqldb','../../config/logger','http','request','then','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x532807,_0x92d7fd){var _0x40b83f=function(_0x1c312c){while(--_0x1c312c){_0x532807['push'](_0x532807['shift']());}};_0x40b83f(++_0x92d7fd);}(_0xaca4,0x6d));var _0x4aca=function(_0x415619,_0x337cb0){_0x415619=_0x415619-0x0;var _0x13f7c8=_0xaca4[_0x415619];return _0x13f7c8;};'use strict';var _=require(_0x4aca('0x0'));var util=require(_0x4aca('0x1'));var moment=require(_0x4aca('0x2'));var BPromise=require(_0x4aca('0x3'));var rs=require(_0x4aca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4aca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4aca('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4aca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e08,_0x70b7f6,_0x5c56b6){return new BPromise(function(_0x5d43ac,_0x37c9bf){return client[_0x4aca('0x8')](_0x4a6e08,_0x5c56b6)[_0x4aca('0x9')](function(_0x52c5be){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x70b7f6,'request\x20sent');logger[_0x4aca('0xa')](_0x4aca('0xb'),_0x70b7f6,_0x4aca('0xc'),JSON['stringify'](_0x52c5be));if(_0x52c5be[_0x4aca('0xd')]){if(_0x52c5be['error'][_0x4aca('0xe')]===0x1f4){logger['error'](_0x4aca('0xf'),_0x70b7f6,_0x52c5be[_0x4aca('0xd')]['message']);return _0x37c9bf(_0x52c5be[_0x4aca('0xd')][_0x4aca('0x10')]);}logger[_0x4aca('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x70b7f6,_0x52c5be[_0x4aca('0xd')][_0x4aca('0x10')]);return _0x5d43ac(_0x52c5be[_0x4aca('0xd')]['message']);}else{logger['info'](_0x4aca('0xf'),_0x70b7f6,_0x4aca('0xc'));_0x5d43ac(_0x52c5be[_0x4aca('0x11')][_0x4aca('0x10')]);}})[_0x4aca('0x12')](function(_0x1d26fa){logger[_0x4aca('0xd')](_0x4aca('0xf'),_0x70b7f6,_0x1d26fa);_0x37c9bf(_0x1d26fa);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 50e1d0b..8625946 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4c7=['create','put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','show','post'];(function(_0x7f8836,_0x5a60fd){var _0xf8b1d=function(_0x36d610){while(--_0x36d610){_0x7f8836['push'](_0x7f8836['shift']());}};_0xf8b1d(++_0x5a60fd);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x39ea87,_0x39dced){_0x39ea87=_0x39ea87-0x0;var _0x5cb7eb=_0xb4c7[_0x39ea87];return _0x5cb7eb;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var auth=require(_0x7b4c('0x5'));var interaction=require(_0x7b4c('0x6'));var config=require(_0x7b4c('0x7'));var controller=require(_0x7b4c('0x8'));router[_0x7b4c('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0xa')]);router[_0x7b4c('0x9')](_0x7b4c('0xb'),auth['isAuthenticated'](),controller[_0x7b4c('0xc')]);router[_0x7b4c('0xd')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xb'),auth[_0x7b4c('0x10')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xb'),auth[_0x7b4c('0x10')](),controller[_0x7b4c('0x13')]);module[_0x7b4c('0x14')]=router; \ No newline at end of file +var _0x1db9=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','put','update','delete','multer'];(function(_0x575bf6,_0x1534ef){var _0x18d26f=function(_0x68348d){while(--_0x68348d){_0x575bf6['push'](_0x575bf6['shift']());}};_0x18d26f(++_0x1534ef);}(_0x1db9,0x176));var _0x91db=function(_0x2305c8,_0x3036f2){_0x2305c8=_0x2305c8-0x0;var _0x41568c=_0x1db9[_0x2305c8];return _0x41568c;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x91db('0x6'));var config=require(_0x91db('0x7'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x91db('0x8')](),controller['index']);router['get'](_0x91db('0x9'),auth[_0x91db('0x8')](),controller[_0x91db('0xa')]);router[_0x91db('0xb')]('/',auth[_0x91db('0x8')](),controller['create']);router[_0x91db('0xc')]('/:id',auth[_0x91db('0x8')](),controller[_0x91db('0xd')]);router[_0x91db('0xe')]('/:id',auth[_0x91db('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index f544313..a53be9c 100644 --- a/server/api/intSalesforceField/intSalesforceField.attributes.js +++ b/server/api/intSalesforceField/intSalesforceField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f0e=['ENUM','string','variable','customVariable','STRING','sequelize','exports'];(function(_0x2d465a,_0x3d8d7f){var _0x267a49=function(_0x4d33bb){while(--_0x4d33bb){_0x2d465a['push'](_0x2d465a['shift']());}};_0x267a49(++_0x3d8d7f);}(_0x8f0e,0x10f));var _0xe8f0=function(_0x15b9d6,_0x1a075e){_0x15b9d6=_0x15b9d6-0x0;var _0x39a6a2=_0x8f0e[_0x15b9d6];return _0x39a6a2;};'use strict';var Sequelize=require(_0xe8f0('0x0'));module[_0xe8f0('0x1')]={'type':{'type':Sequelize[_0xe8f0('0x2')](_0xe8f0('0x3'),_0xe8f0('0x4'),_0xe8f0('0x5'),'keyValue'),'defaultValue':_0xe8f0('0x3')},'content':{'type':Sequelize[_0xe8f0('0x6')]},'key':{'type':Sequelize[_0xe8f0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe8f0('0x3'),_0xe8f0('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xe8f0('0x6')]},'idField':{'type':Sequelize[_0xe8f0('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x143d=['variable','customVariable','keyValue','STRING','sequelize','ENUM','string'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x143d,0x169));var _0xd143=function(_0x4c2623,_0x4838bb){_0x4c2623=_0x4c2623-0x0;var _0x2be431=_0x143d[_0x4c2623];return _0x2be431;};'use strict';var Sequelize=require(_0xd143('0x0'));module['exports']={'type':{'type':Sequelize[_0xd143('0x1')](_0xd143('0x2'),_0xd143('0x3'),_0xd143('0x4'),_0xd143('0x5')),'defaultValue':_0xd143('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd143('0x1')](_0xd143('0x2'),'variable',_0xd143('0x4'))},'keyContent':{'type':Sequelize[_0xd143('0x6')]},'idField':{'type':Sequelize[_0xd143('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 34d79b8..a88ff41 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','map','SalesforceField','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','show','intersection','find','create','body','catch','params','eml-format','rimraf'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2032,0xd9));var _0x2203=function(_0x145496,_0x5eaba7){_0x145496=_0x145496-0x0;var _0x14f1af=_0x2032[_0x145496];return _0x14f1af;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2203('0x0'));var rimraf=require(_0x2203('0x1'));var zipdir=require(_0x2203('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2203('0x3'));var moment=require(_0x2203('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2203('0x5'));var util=require(_0x2203('0x6'));var path=require(_0x2203('0x7'));var sox=require(_0x2203('0x8'));var csv=require(_0x2203('0x9'));var ejs=require(_0x2203('0xa'));var fs=require('fs');var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var db=require(_0x2203('0x16'))['db'];function respondWithStatusCode(_0x1abb51,_0x4b9376){_0x4b9376=_0x4b9376||0xcc;return function(_0x583bc7){if(_0x583bc7){return _0x1abb51['sendStatus'](_0x4b9376);}return _0x1abb51['status'](_0x4b9376)['end']();};}function respondWithResult(_0x238772,_0x538b30){_0x538b30=_0x538b30||0xc8;return function(_0x592e47){if(_0x592e47){return _0x238772[_0x2203('0x17')](_0x538b30)[_0x2203('0x18')](_0x592e47);}};}function respondWithFilteredResult(_0x1c1ead,_0x41af85){return function(_0x226209){if(_0x226209){var _0x3fe0a8=_0x226209[_0x2203('0x19')],_0x2c36e6=_0x41af85['offset'],_0x2c085c=_0x41af85[_0x2203('0x1a')]+_0x41af85[_0x2203('0x1b')],_0xdf9d0b;if(_0x2c085c>=_0x3fe0a8){_0x2c085c=_0x3fe0a8;_0xdf9d0b=0xc8;}else{_0xdf9d0b=0xce;}_0x1c1ead['status'](_0xdf9d0b);return _0x1c1ead[_0x2203('0x1c')](_0x2203('0x1d'),_0x2c36e6+'-'+_0x2c085c+'/'+_0x3fe0a8)['json'](_0x226209);}return null;};}function patchUpdates(_0x30c6f7){return function(_0x5ee83c){try{jsonpatch[_0x2203('0x1e')](_0x5ee83c,_0x30c6f7,!![]);}catch(_0x310b8c){return BPromise[_0x2203('0x1f')](_0x310b8c);}return _0x5ee83c[_0x2203('0x20')]();};}function saveUpdates(_0x15cb1a,_0x449039){return function(_0x538c23){if(_0x538c23){return _0x538c23[_0x2203('0x21')](_0x15cb1a)['then'](function(_0x5ac866){return _0x5ac866;});}return null;};}function removeEntity(_0x15f543,_0x496d82){return function(_0x3b8ef9){if(_0x3b8ef9){return _0x3b8ef9[_0x2203('0x22')]()['then'](function(){_0x15f543[_0x2203('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8da9,_0x226374){return function(_0x2718f5){if(!_0x2718f5){_0x5c8da9[_0x2203('0x23')](0x194);}return _0x2718f5;};}function handleError(_0xfd0970,_0x1244f4){_0x1244f4=_0x1244f4||0x1f4;return function(_0x3114ef){logger[_0x2203('0x24')](_0x3114ef[_0x2203('0x25')]);if(_0x3114ef['name']){delete _0x3114ef[_0x2203('0x26')];}_0xfd0970[_0x2203('0x17')](_0x1244f4)[_0x2203('0x27')](_0x3114ef);};}exports['index']=function(_0xb2071b,_0x1cec17){var _0x5c5fd3={},_0xd6e109={},_0xd91f5d={'count':0x0,'rows':[]};var _0x1c6a77=_[_0x2203('0x28')](db[_0x2203('0x29')][_0x2203('0x2a')],function(_0x9c53f){return{'name':_0x9c53f['fieldName'],'type':_0x9c53f[_0x2203('0x2b')][_0x2203('0x2c')]};});_0xd6e109[_0x2203('0x2d')]=_[_0x2203('0x28')](_0x1c6a77,'name');_0xd6e109[_0x2203('0x2e')]=_[_0x2203('0x2f')](_0xb2071b[_0x2203('0x2e')]);_0xd6e109[_0x2203('0x30')]=_['intersection'](_0xd6e109[_0x2203('0x2d')],_0xd6e109[_0x2203('0x2e')]);_0x5c5fd3['attributes']=_['intersection'](_0xd6e109[_0x2203('0x2d')],qs['fields'](_0xb2071b['query'][_0x2203('0x31')]));_0x5c5fd3[_0x2203('0x32')]=_0x5c5fd3[_0x2203('0x32')][_0x2203('0x33')]?_0x5c5fd3[_0x2203('0x32')]:_0xd6e109['model'];if(!_0xb2071b[_0x2203('0x2e')][_0x2203('0x34')]('nolimit')){_0x5c5fd3[_0x2203('0x1b')]=qs[_0x2203('0x1b')](_0xb2071b[_0x2203('0x2e')][_0x2203('0x1b')]);_0x5c5fd3[_0x2203('0x1a')]=qs[_0x2203('0x1a')](_0xb2071b[_0x2203('0x2e')][_0x2203('0x1a')]);}_0x5c5fd3[_0x2203('0x35')]=qs['sort'](_0xb2071b[_0x2203('0x2e')][_0x2203('0x36')]);_0x5c5fd3['where']=qs['filters'](_[_0x2203('0x37')](_0xb2071b['query'],_0xd6e109[_0x2203('0x30')]));if(_0xb2071b[_0x2203('0x2e')][_0x2203('0x38')]){_0x5c5fd3['where']=_['merge'](_0x5c5fd3[_0x2203('0x39')],{'$or':_['map'](_0x1c6a77,function(_0x2d0365){if(_0x2d0365['type']!==_0x2203('0x3a')){var _0x4b6fc5={};_0x4b6fc5[_0x2d0365[_0x2203('0x26')]]={'$like':'%'+_0xb2071b[_0x2203('0x2e')][_0x2203('0x38')]+'%'};return _0x4b6fc5;}})});}_0x5c5fd3=_[_0x2203('0x3b')]({},_0x5c5fd3,_0xb2071b[_0x2203('0x3c')]);var _0x5436d2={'where':_0x5c5fd3['where']};return db['SalesforceField'][_0x2203('0x19')](_0x5436d2)[_0x2203('0x3d')](function(_0x323798){_0xd91f5d[_0x2203('0x19')]=_0x323798;if(_0xb2071b[_0x2203('0x2e')][_0x2203('0x3e')]){_0x5c5fd3[_0x2203('0x3f')]=[{'all':!![]}];}return db['SalesforceField'][_0x2203('0x40')](_0x5c5fd3);})[_0x2203('0x3d')](function(_0x108fde){_0xd91f5d[_0x2203('0x41')]=_0x108fde;return _0xd91f5d;})['then'](respondWithFilteredResult(_0x1cec17,_0x5c5fd3))['catch'](handleError(_0x1cec17,null));};exports[_0x2203('0x42')]=function(_0x5494a1,_0x330303){var _0x446209={'raw':!![],'where':{'id':_0x5494a1['params']['id']}},_0x132091={};_0x132091['model']=_[_0x2203('0x2f')](db[_0x2203('0x29')][_0x2203('0x2a')]);_0x132091[_0x2203('0x2e')]=_[_0x2203('0x2f')](_0x5494a1[_0x2203('0x2e')]);_0x132091['filters']=_[_0x2203('0x43')](_0x132091[_0x2203('0x2d')],_0x132091[_0x2203('0x2e')]);_0x446209[_0x2203('0x32')]=_[_0x2203('0x43')](_0x132091[_0x2203('0x2d')],qs[_0x2203('0x31')](_0x5494a1[_0x2203('0x2e')][_0x2203('0x31')]));_0x446209[_0x2203('0x32')]=_0x446209['attributes'][_0x2203('0x33')]?_0x446209[_0x2203('0x32')]:_0x132091[_0x2203('0x2d')];if(_0x5494a1[_0x2203('0x2e')]['includeAll']){_0x446209['include']=[{'all':!![]}];}_0x446209=_[_0x2203('0x3b')]({},_0x446209,_0x5494a1['options']);return db[_0x2203('0x29')][_0x2203('0x44')](_0x446209)[_0x2203('0x3d')](handleEntityNotFound(_0x330303,null))[_0x2203('0x3d')](respondWithResult(_0x330303,null))['catch'](handleError(_0x330303,null));};exports[_0x2203('0x45')]=function(_0x102803,_0x5cd8c6){return db[_0x2203('0x29')][_0x2203('0x45')](_0x102803[_0x2203('0x46')],{})[_0x2203('0x3d')](respondWithResult(_0x5cd8c6,0xc9))['catch'](handleError(_0x5cd8c6,null));};exports['update']=function(_0x21b8ab,_0x5707c8){if(_0x21b8ab['body']['id']){delete _0x21b8ab[_0x2203('0x46')]['id'];}return db[_0x2203('0x29')][_0x2203('0x44')]({'where':{'id':_0x21b8ab['params']['id']}})['then'](handleEntityNotFound(_0x5707c8,null))[_0x2203('0x3d')](saveUpdates(_0x21b8ab[_0x2203('0x46')],null))[_0x2203('0x3d')](respondWithResult(_0x5707c8,null))[_0x2203('0x47')](handleError(_0x5707c8,null));};exports[_0x2203('0x22')]=function(_0x21fd78,_0x4a7f4e){return db[_0x2203('0x29')]['find']({'where':{'id':_0x21fd78[_0x2203('0x48')]['id']}})[_0x2203('0x3d')](handleEntityNotFound(_0x4a7f4e,null))[_0x2203('0x3d')](removeEntity(_0x4a7f4e,null))[_0x2203('0x47')](handleError(_0x4a7f4e,null));}; \ No newline at end of file +var _0xdb28=['json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status'];(function(_0x151935,_0x58df29){var _0x3c8f56=function(_0x31e2f6){while(--_0x31e2f6){_0x151935['push'](_0x151935['shift']());}};_0x3c8f56(++_0x58df29);}(_0xdb28,0x106));var _0x8db2=function(_0xfb1769,_0x2beef7){_0xfb1769=_0xfb1769-0x0;var _0x54af3c=_0xdb28[_0xfb1769];return _0x54af3c;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];function respondWithStatusCode(_0x1349f6,_0x204f49){_0x204f49=_0x204f49||0xcc;return function(_0x37d017){if(_0x37d017){return _0x1349f6['sendStatus'](_0x204f49);}return _0x1349f6['status'](_0x204f49)[_0x8db2('0x18')]();};}function respondWithResult(_0x15e87c,_0x350d61){_0x350d61=_0x350d61||0xc8;return function(_0x1d6a15){if(_0x1d6a15){return _0x15e87c[_0x8db2('0x19')](_0x350d61)[_0x8db2('0x1a')](_0x1d6a15);}};}function respondWithFilteredResult(_0x2f177a,_0x3c96a7){return function(_0x131252){if(_0x131252){var _0x16c8c2=_0x131252['count'],_0x5489a9=_0x3c96a7[_0x8db2('0x1b')],_0x13b0f5=_0x3c96a7[_0x8db2('0x1b')]+_0x3c96a7[_0x8db2('0x1c')],_0x24da1b;if(_0x13b0f5>=_0x16c8c2){_0x13b0f5=_0x16c8c2;_0x24da1b=0xc8;}else{_0x24da1b=0xce;}_0x2f177a[_0x8db2('0x19')](_0x24da1b);return _0x2f177a[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x5489a9+'-'+_0x13b0f5+'/'+_0x16c8c2)['json'](_0x131252);}return null;};}function patchUpdates(_0x5df464){return function(_0x77789){try{jsonpatch[_0x8db2('0x1f')](_0x77789,_0x5df464,!![]);}catch(_0x1310d3){return BPromise[_0x8db2('0x20')](_0x1310d3);}return _0x77789['save']();};}function saveUpdates(_0x431d60,_0x36a9ff){return function(_0x260940){if(_0x260940){return _0x260940[_0x8db2('0x21')](_0x431d60)[_0x8db2('0x22')](function(_0x597260){return _0x597260;});}return null;};}function removeEntity(_0x124467,_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x23')]()[_0x8db2('0x22')](function(){_0x124467[_0x8db2('0x19')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x5c6614,_0x256202){return function(_0x4f6516){if(!_0x4f6516){_0x5c6614['sendStatus'](0x194);}return _0x4f6516;};}function handleError(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0x1f4;return function(_0xec8cd2){logger[_0x8db2('0x24')](_0xec8cd2[_0x8db2('0x25')]);if(_0xec8cd2[_0x8db2('0x26')]){delete _0xec8cd2[_0x8db2('0x26')];}_0x52a9ca[_0x8db2('0x19')](_0x4d923c)['send'](_0xec8cd2);};}exports[_0x8db2('0x27')]=function(_0x372311,_0x430dd5){var _0x8b7cec={},_0x483aee={},_0x2e0691={'count':0x0,'rows':[]};var _0x11f398=_[_0x8db2('0x28')](db[_0x8db2('0x29')][_0x8db2('0x2a')],function(_0x21bae5){return{'name':_0x21bae5[_0x8db2('0x2b')],'type':_0x21bae5[_0x8db2('0x2c')][_0x8db2('0x2d')]};});_0x483aee['model']=_[_0x8db2('0x28')](_0x11f398,'name');_0x483aee['query']=_[_0x8db2('0x2e')](_0x372311[_0x8db2('0x2f')]);_0x483aee[_0x8db2('0x30')]=_['intersection'](_0x483aee[_0x8db2('0x31')],_0x483aee['query']);_0x8b7cec[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x483aee[_0x8db2('0x31')],qs['fields'](_0x372311['query'][_0x8db2('0x34')]));_0x8b7cec[_0x8db2('0x32')]=_0x8b7cec['attributes']['length']?_0x8b7cec[_0x8db2('0x32')]:_0x483aee[_0x8db2('0x31')];if(!_0x372311[_0x8db2('0x2f')][_0x8db2('0x35')](_0x8db2('0x36'))){_0x8b7cec[_0x8db2('0x1c')]=qs[_0x8db2('0x1c')](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1c')]);_0x8b7cec[_0x8db2('0x1b')]=qs['offset'](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1b')]);}_0x8b7cec['order']=qs[_0x8db2('0x37')](_0x372311[_0x8db2('0x2f')]['sort']);_0x8b7cec['where']=qs[_0x8db2('0x30')](_['pick'](_0x372311[_0x8db2('0x2f')],_0x483aee[_0x8db2('0x30')]));if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]){_0x8b7cec['where']=_[_0x8db2('0x39')](_0x8b7cec['where'],{'$or':_[_0x8db2('0x28')](_0x11f398,function(_0xd550ae){if(_0xd550ae[_0x8db2('0x2c')]!==_0x8db2('0x3a')){var _0x50e88a={};_0x50e88a[_0xd550ae['name']]={'$like':'%'+_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]+'%'};return _0x50e88a;}})});}_0x8b7cec=_['merge']({},_0x8b7cec,_0x372311[_0x8db2('0x3b')]);var _0x24bcfe={'where':_0x8b7cec[_0x8db2('0x3c')]};return db['SalesforceField'][_0x8db2('0x3d')](_0x24bcfe)[_0x8db2('0x22')](function(_0x953349){_0x2e0691[_0x8db2('0x3d')]=_0x953349;if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x3e')]){_0x8b7cec[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x29')][_0x8db2('0x40')](_0x8b7cec);})[_0x8db2('0x22')](function(_0x21cf7c){_0x2e0691[_0x8db2('0x41')]=_0x21cf7c;return _0x2e0691;})[_0x8db2('0x22')](respondWithFilteredResult(_0x430dd5,_0x8b7cec))['catch'](handleError(_0x430dd5,null));};exports[_0x8db2('0x42')]=function(_0x2b2472,_0x5e0382){var _0x49a7ae={'raw':!![],'where':{'id':_0x2b2472['params']['id']}},_0x249c73={};_0x249c73[_0x8db2('0x31')]=_[_0x8db2('0x2e')](db[_0x8db2('0x29')][_0x8db2('0x2a')]);_0x249c73[_0x8db2('0x2f')]=_[_0x8db2('0x2e')](_0x2b2472[_0x8db2('0x2f')]);_0x249c73['filters']=_[_0x8db2('0x33')](_0x249c73[_0x8db2('0x31')],_0x249c73[_0x8db2('0x2f')]);_0x49a7ae[_0x8db2('0x32')]=_['intersection'](_0x249c73[_0x8db2('0x31')],qs[_0x8db2('0x34')](_0x2b2472[_0x8db2('0x2f')][_0x8db2('0x34')]));_0x49a7ae['attributes']=_0x49a7ae[_0x8db2('0x32')]['length']?_0x49a7ae[_0x8db2('0x32')]:_0x249c73[_0x8db2('0x31')];if(_0x2b2472[_0x8db2('0x2f')]['includeAll']){_0x49a7ae['include']=[{'all':!![]}];}_0x49a7ae=_[_0x8db2('0x39')]({},_0x49a7ae,_0x2b2472['options']);return db[_0x8db2('0x29')][_0x8db2('0x43')](_0x49a7ae)[_0x8db2('0x22')](handleEntityNotFound(_0x5e0382,null))[_0x8db2('0x22')](respondWithResult(_0x5e0382,null))[_0x8db2('0x44')](handleError(_0x5e0382,null));};exports[_0x8db2('0x45')]=function(_0x4355e2,_0xab6bdd){return db[_0x8db2('0x29')][_0x8db2('0x45')](_0x4355e2[_0x8db2('0x46')],{})[_0x8db2('0x22')](respondWithResult(_0xab6bdd,0xc9))['catch'](handleError(_0xab6bdd,null));};exports[_0x8db2('0x21')]=function(_0x2ada52,_0xdbba64){if(_0x2ada52[_0x8db2('0x46')]['id']){delete _0x2ada52['body']['id'];}return db['SalesforceField'][_0x8db2('0x43')]({'where':{'id':_0x2ada52[_0x8db2('0x47')]['id']}})[_0x8db2('0x22')](handleEntityNotFound(_0xdbba64,null))['then'](saveUpdates(_0x2ada52['body'],null))['then'](respondWithResult(_0xdbba64,null))[_0x8db2('0x44')](handleError(_0xdbba64,null));};exports[_0x8db2('0x23')]=function(_0x55c7dd,_0x383fa1){return db[_0x8db2('0x29')][_0x8db2('0x43')]({'where':{'id':_0x55c7dd[_0x8db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x383fa1,null))['then'](removeEntity(_0x383fa1,null))[_0x8db2('0x44')](handleError(_0x383fa1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 88862cc..a0a0ed2 100644 --- a/server/api/intSalesforceField/intSalesforceField.model.js +++ b/server/api/intSalesforceField/intSalesforceField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1bd=['FieldId','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','idField'];(function(_0x3e2de7,_0x221fad){var _0x2ee603=function(_0x820fba){while(--_0x820fba){_0x3e2de7['push'](_0x3e2de7['shift']());}};_0x2ee603(++_0x221fad);}(_0xb1bd,0x105));var _0xdb1b=function(_0x37a45f,_0x5bf70b){_0x37a45f=_0x37a45f-0x0;var _0x4612d8=_0xb1bd[_0x37a45f];return _0x4612d8;};'use strict';var _=require(_0xdb1b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdb1b('0x1'));var moment=require('moment');var BPromise=require(_0xdb1b('0x2'));var rp=require(_0xdb1b('0x3'));var fs=require('fs');var path=require(_0xdb1b('0x4'));var rimraf=require(_0xdb1b('0x5'));var config=require(_0xdb1b('0x6'));var attributes=require(_0xdb1b('0x7'));module[_0xdb1b('0x8')]=function(_0x39c553,_0x245d1c){return _0x39c553['define'](_0xdb1b('0x9'),attributes,{'tableName':_0xdb1b('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xdb1b('0xb'),_0xdb1b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb76d=['rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x401426,_0x1b7832){var _0x32db0f=function(_0x425d99){while(--_0x425d99){_0x401426['push'](_0x401426['shift']());}};_0x32db0f(++_0x1b7832);}(_0xb76d,0x1cd));var _0xdb76=function(_0x2d1699,_0x47c65e){_0x2d1699=_0x2d1699-0x0;var _0x554380=_0xb76d[_0x2d1699];return _0x554380;};'use strict';var _=require('lodash');var util=require(_0xdb76('0x0'));var logger=require(_0xdb76('0x1'))(_0xdb76('0x2'));var moment=require(_0xdb76('0x3'));var BPromise=require(_0xdb76('0x4'));var rp=require(_0xdb76('0x5'));var fs=require('fs');var path=require(_0xdb76('0x6'));var rimraf=require(_0xdb76('0x7'));var config=require(_0xdb76('0x8'));var attributes=require(_0xdb76('0x9'));module['exports']=function(_0x23270d,_0x199c47){return _0x23270d[_0xdb76('0xa')](_0xdb76('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xdb76('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 928cb71..2a9cc24 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b02=['client','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34ecbf,_0x210898){var _0x115f8a=function(_0x559567){while(--_0x559567){_0x34ecbf['push'](_0x34ecbf['shift']());}};_0x115f8a(++_0x210898);}(_0x5b02,0xe9));var _0x25b0=function(_0x114daf,_0xa18e33){_0x114daf=_0x114daf-0x0;var _0x54b0be=_0x5b02[_0x114daf];return _0x54b0be;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var BPromise=require(_0x25b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x25b0('0x5'))(_0x25b0('0x6'));var config=require(_0x25b0('0x7'));var jayson=require(_0x25b0('0x8'));var client=jayson[_0x25b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d82c6,_0xd8276d,_0x49ef3a){return new BPromise(function(_0x412954,_0x4d3e71){return client['request'](_0x1d82c6,_0x49ef3a)[_0x25b0('0xa')](function(_0x45429b){logger[_0x25b0('0xb')]('SalesforceField,\x20%s,\x20%s',_0xd8276d,_0x25b0('0xc'));logger[_0x25b0('0xd')](_0x25b0('0xe'),_0xd8276d,_0x25b0('0xc'),JSON[_0x25b0('0xf')](_0x45429b));if(_0x45429b[_0x25b0('0x10')]){if(_0x45429b[_0x25b0('0x10')][_0x25b0('0x11')]===0x1f4){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x4d3e71(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x412954(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}else{logger[_0x25b0('0xb')]('SalesforceField,\x20%s,\x20%s',_0xd8276d,'request\x20sent');_0x412954(_0x45429b[_0x25b0('0x14')]['message']);}})[_0x25b0('0x15')](function(_0x1d009f){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x1d009f);_0x4d3e71(_0x1d009f);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1ec6b3,_0x4d613c){var _0x7f842c=function(_0x3e1c27){while(--_0x3e1c27){_0x1ec6b3['push'](_0x1ec6b3['shift']());}};_0x7f842c(++_0x4d613c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index be7fe1a..62ea22e 100644 --- a/server/api/intServicenowAccount/index.js +++ b/server/api/intServicenowAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d9f=['/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get'];(function(_0x33cf7d,_0x438f57){var _0x15e421=function(_0x586386){while(--_0x586386){_0x33cf7d['push'](_0x33cf7d['shift']());}};_0x15e421(++_0x438f57);}(_0x3d9f,0xd2));var _0xf3d9=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x3d9f[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xf3d9('0x0'));var util=require(_0xf3d9('0x1'));var path=require(_0xf3d9('0x2'));var timeout=require(_0xf3d9('0x3'));var express=require(_0xf3d9('0x4'));var router=express[_0xf3d9('0x5')]();var auth=require(_0xf3d9('0x6'));var interaction=require(_0xf3d9('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0xf3d9('0x8')](),controller['index']);router[_0xf3d9('0x9')](_0xf3d9('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xf3d9('0x9')](_0xf3d9('0xb'),auth[_0xf3d9('0x8')](),controller[_0xf3d9('0xc')]);router[_0xf3d9('0x9')](_0xf3d9('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xf3d9('0xe')]('/',auth[_0xf3d9('0x8')](),controller[_0xf3d9('0xf')]);router[_0xf3d9('0xe')](_0xf3d9('0xb'),auth['isAuthenticated'](),controller[_0xf3d9('0x10')]);router['put'](_0xf3d9('0xa'),auth[_0xf3d9('0x8')](),controller[_0xf3d9('0x11')]);router['delete'](_0xf3d9('0xa'),auth[_0xf3d9('0x8')](),controller[_0xf3d9('0x12')]);module[_0xf3d9('0x13')]=router; \ No newline at end of file +var _0x4c4e=['update','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x1e5e33,_0x452914){var _0x253631=function(_0x3a7753){while(--_0x3a7753){_0x1e5e33['push'](_0x1e5e33['shift']());}};_0x253631(++_0x452914);}(_0x4c4e,0x152));var _0xe4c4=function(_0x17efce,_0x242714){_0x17efce=_0x17efce-0x0;var _0x33420c=_0x4c4e[_0x17efce];return _0x33420c;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var auth=require(_0xe4c4('0x4'));var interaction=require(_0xe4c4('0x5'));var config=require(_0xe4c4('0x6'));var controller=require('./intServicenowAccount.controller');router[_0xe4c4('0x7')]('/',auth['isAuthenticated'](),controller[_0xe4c4('0x8')]);router[_0xe4c4('0x7')](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0xb')]);router[_0xe4c4('0x7')](_0xe4c4('0xc'),auth[_0xe4c4('0xa')](),controller['getConfigurations']);router['get'](_0xe4c4('0xd'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0xe')]);router[_0xe4c4('0xf')]('/',auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x10')]);router['post'](_0xe4c4('0xc'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x11')]);router[_0xe4c4('0x12')]('/:id',auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x13')]);router['delete'](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller['destroy']);module[_0xe4c4('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 581fe58..3d1a3b9 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js +++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf66f=['STRING','username','remoteUri','sequelize','exports'];(function(_0x3e0c2a,_0x367194){var _0x29431d=function(_0x30323d){while(--_0x30323d){_0x3e0c2a['push'](_0x3e0c2a['shift']());}};_0x29431d(++_0x367194);}(_0xf66f,0x12a));var _0xff66=function(_0x4bf793,_0x404922){_0x4bf793=_0x4bf793-0x0;var _0x55a44b=_0xf66f[_0x4bf793];return _0x55a44b;};'use strict';var Sequelize=require(_0xff66('0x0'));module[_0xff66('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xff66('0x2')]},'username':{'type':Sequelize[_0xff66('0x2')],'unique':_0xff66('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xff66('0x2')]},'remoteUri':{'type':Sequelize[_0xff66('0x2')],'unique':_0xff66('0x4')},'serverUrl':{'type':Sequelize[_0xff66('0x2')]}}; \ No newline at end of file +var _0x2406=['sequelize','exports','STRING','username','remoteUri'];(function(_0x19c5c8,_0x1f8ac8){var _0x1ee624=function(_0x23b8b6){while(--_0x23b8b6){_0x19c5c8['push'](_0x19c5c8['shift']());}};_0x1ee624(++_0x1f8ac8);}(_0x2406,0x12c));var _0x6240=function(_0x4e9c1d,_0x3b2a51){_0x4e9c1d=_0x4e9c1d-0x0;var _0x599d6a=_0x2406[_0x4e9c1d];return _0x599d6a;};'use strict';var Sequelize=require(_0x6240('0x0'));module[_0x6240('0x1')]={'name':{'type':Sequelize[_0x6240('0x2')]},'description':{'type':Sequelize[_0x6240('0x2')]},'username':{'type':Sequelize[_0x6240('0x2')],'unique':_0x6240('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6240('0x2')]},'remoteUri':{'type':Sequelize[_0x6240('0x2')],'unique':_0x6240('0x4')},'serverUrl':{'type':Sequelize[_0x6240('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index c11fbaf..78eca49 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.controller.js +++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe879=['stack','Wrong\x20credentials','statusCode','boolean','True','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','update','destroy','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','resolved_by','opened_by','sys_created_by','cmdb_ci','delivery_plan','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','username','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20'];(function(_0x32ed02,_0x2b10ac){var _0x489294=function(_0x5ef386){while(--_0x5ef386){_0x32ed02['push'](_0x32ed02['shift']());}};_0x489294(++_0x2b10ac);}(_0xe879,0xcb));var _0x9e87=function(_0x4248d6,_0x31e55d){_0x4248d6=_0x4248d6-0x0;var _0x3ea592=_0xe879[_0x4248d6];return _0x3ea592;};'use strict';var pdf=require(_0x9e87('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9e87('0x1'));var jsonpatch=require(_0x9e87('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e87('0x3'));var Mustache=require('mustache');var util=require(_0x9e87('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x9e87('0x5'));var ejs=require(_0x9e87('0x6'));var fs=require('fs');var _=require(_0x9e87('0x7'));var squel=require(_0x9e87('0x8'));var crypto=require(_0x9e87('0x9'));var jsforce=require(_0x9e87('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9e87('0x5'));var querystring=require(_0x9e87('0xb'));var Papa=require(_0x9e87('0xc'));var Redis=require(_0x9e87('0xd'));var authService=require(_0x9e87('0xe'));var qs=require(_0x9e87('0xf'));var as=require(_0x9e87('0x10'));var hardwareService=require(_0x9e87('0x11'));var logger=require(_0x9e87('0x12'))(_0x9e87('0x13'));var utils=require('../../config/utils');var config=require(_0x9e87('0x14'));var db=require(_0x9e87('0x15'))['db'];var integrations=require(_0x9e87('0x16'));var jayson=require(_0x9e87('0x17'));var client=jayson[_0x9e87('0x18')][_0x9e87('0x19')]({'port':0x232a});function checkPasswordPattern(_0x317de6,_0x1e3b5f,_0x3a2671){if(_0x3a2671){var _0x28df33=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28df33[_0x9e87('0x1a')](_0x1e3b5f)){return _0x317de6;}else{throw new db[(_0x9e87('0x1b'))][(_0x9e87('0x1c'))](_0x9e87('0x1d'));}}else{return _0x317de6;}}function respondWithRpcPromise(_0x2f1d60,_0x24f610,_0x25e004,_0x20fd90){return new BPromise(function(_0x46ce82,_0x2ec5c9){var _0x41f7ae=_0x20fd90||client;return _0x41f7ae['request'](_0x2f1d60,_0x25e004)[_0x9e87('0x1e')](function(_0x252222){logger[_0x9e87('0x1f')](_0x9e87('0x20'),_0x24f610,'request\x20sent');logger[_0x9e87('0x21')](_0x9e87('0x22'),_0x24f610,_0x9e87('0x23'),JSON[_0x9e87('0x24')](_0x252222));if(_0x252222[_0x9e87('0x25')]){if(_0x252222[_0x9e87('0x25')]['code']===0x1f4){logger[_0x9e87('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x24f610,_0x252222[_0x9e87('0x25')][_0x9e87('0x26')]);return _0x2ec5c9(_0x252222[_0x9e87('0x25')][_0x9e87('0x26')]);}logger[_0x9e87('0x25')](_0x9e87('0x20'),_0x24f610,_0x252222['error']['message']);return _0x46ce82(_0x252222[_0x9e87('0x25')]['message']);}else{logger[_0x9e87('0x1f')]('ServicenowAccount,\x20%s,\x20%s',_0x24f610,_0x9e87('0x23'));_0x46ce82(_0x252222['result'][_0x9e87('0x26')]);}})['catch'](function(_0x476980){logger[_0x9e87('0x25')](_0x9e87('0x20'),_0x24f610,_0x476980);_0x2ec5c9(_0x476980);});});}function respondWithStatusCode(_0xc38340,_0x5cc7bf){_0x5cc7bf=_0x5cc7bf||0xcc;return function(_0x5451fc){if(_0x5451fc){return _0xc38340[_0x9e87('0x27')](_0x5cc7bf);}return _0xc38340[_0x9e87('0x28')](_0x5cc7bf)[_0x9e87('0x29')]();};}function respondWithResult(_0x5bcd03,_0x51128d){_0x51128d=_0x51128d||0xc8;return function(_0x408914){if(_0x408914){return _0x5bcd03[_0x9e87('0x28')](_0x51128d)['json'](_0x408914);}};}function respondWithFilteredResult(_0x252c8b,_0x2584b4){return function(_0x1814de){if(_0x1814de){var _0x5edea9=_0x1814de['count'],_0x5c87c8=_0x2584b4[_0x9e87('0x2a')],_0x357275=_0x2584b4['offset']+_0x2584b4[_0x9e87('0x2b')],_0x3333ba;if(_0x357275>=_0x5edea9){_0x357275=_0x5edea9;_0x3333ba=0xc8;}else{_0x3333ba=0xce;}_0x252c8b['status'](_0x3333ba);return _0x252c8b['set'](_0x9e87('0x2c'),_0x5c87c8+'-'+_0x357275+'/'+_0x5edea9)[_0x9e87('0x2d')](_0x1814de);}return null;};}function patchUpdates(_0x5a56da){return function(_0x21258e){try{jsonpatch[_0x9e87('0x2e')](_0x21258e,_0x5a56da,!![]);}catch(_0x4fbf45){return BPromise[_0x9e87('0x2f')](_0x4fbf45);}return _0x21258e['save']();};}function saveUpdates(_0x1c4672,_0x41fec5){return function(_0xb220c1){if(_0xb220c1){return _0xb220c1[_0x9e87('0x30')](_0x1c4672)[_0x9e87('0x1e')](function(_0x5dd5cc){return _0x5dd5cc;});}return null;};}function removeEntity(_0x170de5,_0x3d58b9){return function(_0x307694){if(_0x307694){return _0x307694[_0x9e87('0x31')]()[_0x9e87('0x1e')](function(){_0x170de5['status'](0xcc)[_0x9e87('0x29')]();});}};}function handleEntityNotFound(_0x57cf50,_0x5c9763){return function(_0x3fb12b){if(!_0x3fb12b){_0x57cf50[_0x9e87('0x27')](0x194);}return _0x3fb12b;};}function handleError(_0x2f0d93,_0xe8c67a){_0xe8c67a=_0xe8c67a||0x1f4;return function(_0xa90aac){logger[_0x9e87('0x25')](_0xa90aac['stack']);if(_0xa90aac['name']){delete _0xa90aac['name'];}_0x2f0d93['status'](_0xe8c67a)[_0x9e87('0x32')](_0xa90aac);};}exports[_0x9e87('0x33')]=function(_0x1ba554,_0x3a84b3){var _0x5d9efe={},_0x14e853={},_0x270ba5={'count':0x0,'rows':[]};var _0x26c5aa=_[_0x9e87('0x34')](db[_0x9e87('0x35')][_0x9e87('0x36')],function(_0x39588f){return{'name':_0x39588f[_0x9e87('0x37')],'type':_0x39588f[_0x9e87('0x38')][_0x9e87('0x39')]};});_0x14e853['model']=_[_0x9e87('0x34')](_0x26c5aa,_0x9e87('0x3a'));_0x14e853[_0x9e87('0x3b')]=_[_0x9e87('0x3c')](_0x1ba554['query']);_0x14e853[_0x9e87('0x3d')]=_[_0x9e87('0x3e')](_0x14e853[_0x9e87('0x3f')],_0x14e853[_0x9e87('0x3b')]);_0x5d9efe['attributes']=_['intersection'](_0x14e853[_0x9e87('0x3f')],qs[_0x9e87('0x40')](_0x1ba554[_0x9e87('0x3b')][_0x9e87('0x40')]));_0x5d9efe[_0x9e87('0x41')]=_0x5d9efe['attributes'][_0x9e87('0x42')]?_0x5d9efe[_0x9e87('0x41')]:_0x14e853['model'];if(!_0x1ba554[_0x9e87('0x3b')]['hasOwnProperty'](_0x9e87('0x43'))){_0x5d9efe[_0x9e87('0x2b')]=qs['limit'](_0x1ba554[_0x9e87('0x3b')]['limit']);_0x5d9efe[_0x9e87('0x2a')]=qs[_0x9e87('0x2a')](_0x1ba554[_0x9e87('0x3b')][_0x9e87('0x2a')]);}_0x5d9efe[_0x9e87('0x44')]=qs[_0x9e87('0x45')](_0x1ba554[_0x9e87('0x3b')][_0x9e87('0x45')]);_0x5d9efe[_0x9e87('0x46')]=qs[_0x9e87('0x3d')](_['pick'](_0x1ba554[_0x9e87('0x3b')],_0x14e853[_0x9e87('0x3d')]));if(_0x1ba554['query'][_0x9e87('0x47')]){_0x5d9efe[_0x9e87('0x46')]=_[_0x9e87('0x48')](_0x5d9efe[_0x9e87('0x46')],{'$or':_['map'](_0x26c5aa,function(_0x55ba56){if(_0x55ba56[_0x9e87('0x38')]!==_0x9e87('0x49')){var _0x3d10bd={};_0x3d10bd[_0x55ba56[_0x9e87('0x3a')]]={'$like':'%'+_0x1ba554[_0x9e87('0x3b')]['filter']+'%'};return _0x3d10bd;}})});}_0x5d9efe=_[_0x9e87('0x48')]({},_0x5d9efe,_0x1ba554[_0x9e87('0x4a')]);var _0x1f6395={'where':_0x5d9efe[_0x9e87('0x46')]};return db[_0x9e87('0x35')][_0x9e87('0x4b')](_0x1f6395)[_0x9e87('0x1e')](function(_0x60212){_0x270ba5[_0x9e87('0x4b')]=_0x60212;if(_0x1ba554[_0x9e87('0x3b')]['includeAll']){_0x5d9efe[_0x9e87('0x4c')]=[{'all':!![]}];}return db[_0x9e87('0x35')][_0x9e87('0x4d')](_0x5d9efe);})['then'](function(_0x166497){_0x270ba5[_0x9e87('0x4e')]=_0x166497;return _0x270ba5;})[_0x9e87('0x1e')](respondWithFilteredResult(_0x3a84b3,_0x5d9efe))[_0x9e87('0x4f')](handleError(_0x3a84b3,null));};exports[_0x9e87('0x50')]=function(_0x268d07,_0x4c4e9d){var _0x39d901={'raw':![],'where':{'id':_0x268d07['params']['id']}},_0x27944b={};_0x27944b[_0x9e87('0x3f')]=_[_0x9e87('0x3c')](db[_0x9e87('0x35')][_0x9e87('0x36')]);_0x27944b['query']=_[_0x9e87('0x3c')](_0x268d07[_0x9e87('0x3b')]);_0x27944b[_0x9e87('0x3d')]=_[_0x9e87('0x3e')](_0x27944b['model'],_0x27944b['query']);_0x39d901['attributes']=_['intersection'](_0x27944b[_0x9e87('0x3f')],qs['fields'](_0x268d07[_0x9e87('0x3b')][_0x9e87('0x40')]));_0x39d901[_0x9e87('0x41')]=_0x39d901[_0x9e87('0x41')]['length']?_0x39d901[_0x9e87('0x41')]:_0x27944b[_0x9e87('0x3f')];if(_0x268d07['query'][_0x9e87('0x51')]){_0x39d901[_0x9e87('0x4c')]=[{'all':!![]}];}_0x39d901=_[_0x9e87('0x48')]({},_0x39d901,_0x268d07['options']);return db[_0x9e87('0x35')][_0x9e87('0x52')](_0x39d901)[_0x9e87('0x1e')](handleEntityNotFound(_0x4c4e9d,null))[_0x9e87('0x1e')](respondWithResult(_0x4c4e9d,null))[_0x9e87('0x4f')](handleError(_0x4c4e9d,null));};exports[_0x9e87('0x53')]=function(_0x45bed5,_0x2c9157){return db[_0x9e87('0x35')]['create'](_0x45bed5[_0x9e87('0x54')],{})['then'](respondWithResult(_0x2c9157,0xc9))[_0x9e87('0x4f')](handleError(_0x2c9157,null));};exports[_0x9e87('0x30')]=function(_0x9cfbf5,_0xa50bc3){if(_0x9cfbf5[_0x9e87('0x54')]['id']){delete _0x9cfbf5['body']['id'];}return db[_0x9e87('0x35')]['find']({'where':{'id':_0x9cfbf5[_0x9e87('0x55')]['id']}})[_0x9e87('0x1e')](handleEntityNotFound(_0xa50bc3,null))[_0x9e87('0x1e')](saveUpdates(_0x9cfbf5[_0x9e87('0x54')],null))[_0x9e87('0x1e')](respondWithResult(_0xa50bc3,null))['catch'](handleError(_0xa50bc3,null));};exports[_0x9e87('0x31')]=function(_0x158efe,_0x491ce6){return db[_0x9e87('0x35')][_0x9e87('0x52')]({'where':{'id':_0x158efe[_0x9e87('0x55')]['id']}})['then'](handleEntityNotFound(_0x491ce6,null))['then'](removeEntity(_0x491ce6,null))['catch'](handleError(_0x491ce6,null));};exports[_0x9e87('0x56')]=function(_0xdb23f0,_0x213e6e,_0x369ff9){var _0x22148d={};var _0xb04b9c={};var _0x41e9b8;var _0x526115;return db[_0x9e87('0x35')][_0x9e87('0x57')]({'where':{'id':_0xdb23f0[_0x9e87('0x55')]['id']}})[_0x9e87('0x1e')](handleEntityNotFound(_0x213e6e,null))['then'](function(_0x4270e6){if(_0x4270e6){_0x41e9b8=_0x4270e6;_0xb04b9c[_0x9e87('0x3f')]=_[_0x9e87('0x3c')](db[_0x9e87('0x58')][_0x9e87('0x36')]);_0xb04b9c[_0x9e87('0x3b')]=_[_0x9e87('0x3c')](_0xdb23f0['query']);_0xb04b9c[_0x9e87('0x3d')]=_[_0x9e87('0x3e')](_0xb04b9c[_0x9e87('0x3f')],_0xb04b9c['query']);_0x22148d[_0x9e87('0x41')]=_[_0x9e87('0x3e')](_0xb04b9c['model'],qs[_0x9e87('0x40')](_0xdb23f0[_0x9e87('0x3b')]['fields']));_0x22148d[_0x9e87('0x41')]=_0x22148d[_0x9e87('0x41')][_0x9e87('0x42')]?_0x22148d[_0x9e87('0x41')]:_0xb04b9c[_0x9e87('0x3f')];_0x22148d[_0x9e87('0x44')]=qs['sort'](_0xdb23f0[_0x9e87('0x3b')][_0x9e87('0x45')]);_0x22148d[_0x9e87('0x46')]=qs['filters'](_['pick'](_0xdb23f0[_0x9e87('0x3b')],_0xb04b9c['filters']));if(_0xdb23f0[_0x9e87('0x3b')][_0x9e87('0x47')]){_0x22148d[_0x9e87('0x46')]=_[_0x9e87('0x48')](_0x22148d[_0x9e87('0x46')],{'$or':_[_0x9e87('0x34')](_0x22148d[_0x9e87('0x41')],function(_0x4f9eb2){var _0x2e9e08={};_0x2e9e08[_0x4f9eb2]={'$like':'%'+_0xdb23f0[_0x9e87('0x3b')][_0x9e87('0x47')]+'%'};return _0x2e9e08;})});}_0x22148d=_[_0x9e87('0x48')]({},_0x22148d,_0xdb23f0[_0x9e87('0x4a')]);return _0x41e9b8[_0x9e87('0x56')](_0x22148d);}})[_0x9e87('0x1e')](function(_0x3e30d5){if(_0x3e30d5){_0x526115=_0x3e30d5[_0x9e87('0x42')];if(!_0xdb23f0[_0x9e87('0x3b')][_0x9e87('0x59')](_0x9e87('0x43'))){_0x22148d['limit']=qs[_0x9e87('0x2b')](_0xdb23f0[_0x9e87('0x3b')][_0x9e87('0x2b')]);_0x22148d['offset']=qs['offset'](_0xdb23f0['query']['offset']);}return _0x41e9b8[_0x9e87('0x56')](_0x22148d);}})['then'](function(_0x487fb0){if(_0x487fb0){return _0x487fb0?{'count':_0x526115,'rows':_0x487fb0}:null;}})[_0x9e87('0x1e')](respondWithResult(_0x213e6e,null))['catch'](handleError(_0x213e6e,null));};exports['addConfiguration']=function(_0x24cdd8,_0x1ad85e,_0x4a9416){if(_0x24cdd8[_0x9e87('0x54')]['id']){delete _0x24cdd8[_0x9e87('0x54')]['id'];}return db[_0x9e87('0x35')]['findOne']({'where':{'id':_0x24cdd8[_0x9e87('0x55')]['id']}})[_0x9e87('0x1e')](handleEntityNotFound(_0x1ad85e,null))[_0x9e87('0x1e')](function(_0x4d29d8){if(_0x4d29d8){_0x24cdd8['body'][_0x9e87('0x5a')]=_0x4d29d8['id'];_0x24cdd8[_0x9e87('0x54')][_0x9e87('0x5b')]=integrations[_0x9e87('0x5c')](_0x24cdd8[_0x9e87('0x54')]['channel'],_0x24cdd8[_0x9e87('0x54')][_0x9e87('0x38')]);_0x24cdd8[_0x9e87('0x54')][_0x9e87('0x5d')]=integrations[_0x9e87('0x5e')](_0x24cdd8[_0x9e87('0x54')][_0x9e87('0x5f')],_0x24cdd8[_0x9e87('0x54')][_0x9e87('0x38')]);return db[_0x9e87('0x58')][_0x9e87('0x53')](_0x24cdd8[_0x9e87('0x54')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x9e87('0x60')],'as':_0x9e87('0x5d')}]});}return null;})[_0x9e87('0x1e')](respondWithResult(_0x1ad85e,null))['catch'](handleError(_0x1ad85e,null));};exports[_0x9e87('0x61')]=function(_0x4f7303,_0xedba82,_0x5b8de1){var _0x59c8e3=[_0x9e87('0x62'),_0x9e87('0x63'),_0x9e87('0x64'),_0x9e87('0x65'),_0x9e87('0x66'),_0x9e87('0x67'),_0x9e87('0x68'),_0x9e87('0x69'),_0x9e87('0x6a')];var _0x26c9f6=[_0x9e87('0x6b'),_0x9e87('0x62'),_0x9e87('0x6c'),_0x9e87('0x6d'),_0x9e87('0x6e'),_0x9e87('0x6f'),'child_incidents','hold_reason','approval_history','number',_0x9e87('0x70'),'sys_updated_by',_0x9e87('0x71'),'user_input','sys_created_on','sys_domain','state',_0x9e87('0x72'),_0x9e87('0x64'),_0x9e87('0x44'),'calendar_stc','closed_at',_0x9e87('0x73'),_0x9e87('0x74'),'impact','active',_0x9e87('0x75'),_0x9e87('0x76'),_0x9e87('0x77'),_0x9e87('0x78'),_0x9e87('0x79'),_0x9e87('0x7a'),'expected_start',_0x9e87('0x7b'),'business_duration',_0x9e87('0x7c'),_0x9e87('0x7d'),_0x9e87('0x7e'),_0x9e87('0x7f'),_0x9e87('0x80'),'approval_set',_0x9e87('0x65'),_0x9e87('0x81'),_0x9e87('0x82'),_0x9e87('0x66'),_0x9e87('0x83'),_0x9e87('0x84'),_0x9e87('0x85'),'assignment_group',_0x9e87('0x86'),'additional_assignee_list','description',_0x9e87('0x87'),_0x9e87('0x67'),'sys_class_name',_0x9e87('0x88'),_0x9e87('0x89'),_0x9e87('0x8a'),_0x9e87('0x8b'),_0x9e87('0x8c'),_0x9e87('0x8d'),'reopened_by',_0x9e87('0x68'),_0x9e87('0x8e'),_0x9e87('0x8f'),_0x9e87('0x90'),_0x9e87('0x91'),_0x9e87('0x92'),_0x9e87('0x93'),_0x9e87('0x69'),_0x9e87('0x94'),_0x9e87('0x95'),_0x9e87('0x96'),'comments_and_work_notes',_0x9e87('0x97'),_0x9e87('0x98'),'reopen_count',_0x9e87('0x99'),_0x9e87('0x9a'),_0x9e87('0x9b'),_0x9e87('0x9c'),_0x9e87('0x9d'),_0x9e87('0x6a')];var _0x7e686d='';var _0x9c6cbe='';var _0x15db89=[];var _0x21bba3='';var _0x2733f1='';var _0x1ee268=[];var _0x4b523b='';var _0xa9dc3e='';var _0x14c58f={};var _0x269fc8='';return db[_0x9e87('0x35')]['findOne']({'where':{'id':_0x4f7303[_0x9e87('0x55')]['id']},'attributes':['id','username','password',_0x9e87('0x9e'),_0x9e87('0x9f'),_0x9e87('0xa0')]})[_0x9e87('0x1e')](handleEntityNotFound(_0xedba82,null))['then'](function(_0xa34571){if(_0xa34571){_0x269fc8=_0xa34571['remoteUri'];var _0x5efd72=_0x269fc8[_0x9e87('0xa1')](-0x1);if(_0x5efd72==='/'){_0x269fc8=_0x269fc8[_0x9e87('0xa2')](0x0,_0x269fc8[_0x9e87('0xa3')](_0x5efd72));}_0xa9dc3e=util['format'](_0x9e87('0xa4'),_0x269fc8);_0x4b523b=util['format'](_0x9e87('0xa5'),_0x269fc8);_0x14c58f={'user':_0xa34571[_0x9e87('0xa6')],'pass':_0xa34571[_0x9e87('0xa7')]};var _0x5d714f={'method':'GET','uri':_0xa9dc3e+_0x9e87('0xa8'),'auth':_0x14c58f,'json':!![]};return rp(_0x5d714f);}})[_0x9e87('0x1e')](function(_0x5d88b1){if(_0x5d88b1['result'][_0x9e87('0x42')]>0x0){_0x7e686d=_0x5d88b1[_0x9e87('0xa9')];}console[_0x9e87('0xaa')](_0x9e87('0xab'),_0x7e686d);_0x1ee268=[];_0x9c6cbe=Object[_0x9e87('0xac')]([],_0x7e686d);_['remove'](_0x9c6cbe,function(_0x16bb6f){return!_0x59c8e3[_0x9e87('0xad')](_0x16bb6f[_0x9e87('0x3a')]);});_0x9c6cbe[_0x9e87('0xae')](function(_0xb742a){var _0x555993=createFieldObject(_0x4b523b,_0x14c58f,_0xb742a[_0x9e87('0xaf')],_0xb742a['name'],_0xb742a[_0x9e87('0xb0')],![]);_0x1ee268[_0x9e87('0xb1')](_0x555993);});return Promise[_0x9e87('0xb2')](_0x1ee268);})[_0x9e87('0x1e')](function(_0x6fa760){_0x15db89=_0x6fa760;_0x21bba3=Object['assign']([],_0x7e686d);console[_0x9e87('0xaa')](_0x9e87('0xb3'),_0x7e686d);_[_0x9e87('0xb4')](_0x21bba3,function(_0x1c802c){return _0x26c9f6['includes'](_0x1c802c['name']);});console[_0x9e87('0xaa')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x21bba3);_0x1ee268=[];_0x21bba3[_0x9e87('0xae')](function(_0x55544c){var _0x61e3c1=createFieldObject(_0x4b523b,_0x14c58f,_0x55544c[_0x9e87('0xaf')],_0x55544c[_0x9e87('0x3a')],_0x55544c[_0x9e87('0xb0')],!![]);_0x1ee268[_0x9e87('0xb1')](_0x61e3c1);});return Promise[_0x9e87('0xb2')](_0x1ee268);})['then'](function(_0xf250a4){_0x2733f1=_0xf250a4;var _0x47bce1=_0x15db89[_0x9e87('0xb5')](_0x2733f1);return{'count':_0x47bce1['length'],'rows':_0x47bce1};})['then'](respondWithResult(_0xedba82,null))['catch'](function(_0x22285e){console[_0x9e87('0xaa')](_0x9e87('0xb6')+_0x22285e);var _0x290d75=_0x4f7303['query'][_0x9e87('0x1a')]?0x1f4:_0x22285e['statusCode']||0x1f4;logger[_0x9e87('0x25')](_0x22285e[_0x9e87('0xb7')]);delete _0x22285e[_0x9e87('0x3a')];if(_0x290d75===0x191){_0x290d75=0x190;}_0xedba82[_0x9e87('0x28')](_0x290d75)['send'](_0x4f7303['query'][_0x9e87('0x1a')]?{'message':_0x9e87('0xb8'),'statusCode':_0x22285e[_0x9e87('0xb9')]}:_0x22285e);});};function createFieldObject(_0x44601d,_0x500231,_0x271c5b,_0x22648a,_0x247aa9,_0x8dc9d2){return new Promise(function(_0x55504c,_0x1bc4c){var _0x449bde={'id':_0x22648a,'name':_0x247aa9,'custom':_0x8dc9d2};if(_0x271c5b===_0x9e87('0xba')){_0x449bde[_0x9e87('0x4a')]=[{'name':_0x9e87('0xbb'),'value':'true'},{'name':'False','value':_0x9e87('0xbc')}];_0x55504c(_0x449bde);}else{var _0x2cb847={'method':_0x9e87('0xbd'),'uri':_0x44601d+_0x9e87('0xbe')+_0x22648a,'auth':_0x500231,'json':!![]};return rp(_0x2cb847)[_0x9e87('0x1e')](function(_0x16b901){var _0x56f8c5=[];if(_0x16b901['result'][_0x9e87('0x42')]>0x0){_0x16b901['result'][_0x9e87('0xae')](function(_0x1990fd){if(_0x1990fd[_0x9e87('0xbf')]===_0x9e87('0xbc')){var _0x18afd3={'name':_0x1990fd[_0x9e87('0xb0')],'value':_0x1990fd[_0x9e87('0xc0')]};_0x56f8c5['push'](_0x18afd3);}});}_0x449bde[_0x9e87('0x4a')]=_0x56f8c5;if(_0x449bde[_0x9e87('0x4a')]['length']>0x0){_0x55504c(_0x449bde);}else{if(_0x8dc9d2==![]){_0x55504c();}else{_0x55504c(_0x449bde);}}});}});} \ No newline at end of file +var _0x05d0=['made_sla','knowledge','subcategory','incident_state','severity','parent','caused_by','watch_list','sys_updated_on','child_incidents','hold_reason','number','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','approval_set','work_notes','short_description','close_code','correlation_display','work_start','business_stc','additional_assignee_list','description','notify','sys_class_name','close_notes','follow_up','parent_incident','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_tags','escalation','correlation_id','location','username','email','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','log','remove','forEach','internalType','label','push','all','assign','TCL:\x20_object','ServiceNow\x20error:\x20','stack','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus','name','send','ServicenowAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','getConfigurations','findOne','ServicenowConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField'];(function(_0x52250b,_0x591cc6){var _0x1ea609=function(_0x1ff149){while(--_0x1ff149){_0x52250b['push'](_0x52250b['shift']());}};_0x1ea609(++_0x591cc6);}(_0x05d0,0x117));var _0x005d=function(_0x1dd8af,_0x55c989){_0x1dd8af=_0x1dd8af-0x0;var _0x127d02=_0x05d0[_0x1dd8af];return _0x127d02;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x005d('0x0'));var rimraf=require(_0x005d('0x1'));var zipdir=require(_0x005d('0x2'));var jsonpatch=require(_0x005d('0x3'));var rp=require(_0x005d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x005d('0x5'));var util=require(_0x005d('0x6'));var path=require(_0x005d('0x7'));var sox=require(_0x005d('0x8'));var csv=require(_0x005d('0x9'));var ejs=require(_0x005d('0xa'));var fs=require('fs');var _=require(_0x005d('0xb'));var squel=require(_0x005d('0xc'));var crypto=require(_0x005d('0xd'));var jsforce=require(_0x005d('0xe'));var deskjs=require(_0x005d('0xf'));var toCsv=require(_0x005d('0x9'));var querystring=require(_0x005d('0x10'));var Papa=require(_0x005d('0x11'));var Redis=require(_0x005d('0x12'));var authService=require(_0x005d('0x13'));var qs=require(_0x005d('0x14'));var as=require(_0x005d('0x15'));var hardwareService=require(_0x005d('0x16'));var logger=require(_0x005d('0x17'))('api');var utils=require(_0x005d('0x18'));var config=require('../../config/environment');var db=require(_0x005d('0x19'))['db'];var integrations=require(_0x005d('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0x005d('0x1b')][_0x005d('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xf9fe5,_0x346a87,_0x373ef9){if(_0x373ef9){var _0x1e6dd2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e6dd2[_0x005d('0x1d')](_0x346a87)){return _0xf9fe5;}else{throw new db[(_0x005d('0x1e'))][(_0x005d('0x1f'))](_0x005d('0x20'));}}else{return _0xf9fe5;}}function respondWithRpcPromise(_0x4cd734,_0x323c70,_0x309a7a,_0x3c10ee){return new BPromise(function(_0x1b5f05,_0x4943f6){var _0x531083=_0x3c10ee||client;return _0x531083['request'](_0x4cd734,_0x309a7a)[_0x005d('0x21')](function(_0x44f786){logger[_0x005d('0x22')](_0x005d('0x23'),_0x323c70,_0x005d('0x24'));logger[_0x005d('0x25')](_0x005d('0x26'),_0x323c70,_0x005d('0x24'),JSON[_0x005d('0x27')](_0x44f786));if(_0x44f786[_0x005d('0x28')]){if(_0x44f786[_0x005d('0x28')][_0x005d('0x29')]===0x1f4){logger[_0x005d('0x28')](_0x005d('0x23'),_0x323c70,_0x44f786[_0x005d('0x28')][_0x005d('0x2a')]);return _0x4943f6(_0x44f786[_0x005d('0x28')][_0x005d('0x2a')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x323c70,_0x44f786[_0x005d('0x28')][_0x005d('0x2a')]);return _0x1b5f05(_0x44f786[_0x005d('0x28')][_0x005d('0x2a')]);}else{logger['info'](_0x005d('0x23'),_0x323c70,'request\x20sent');_0x1b5f05(_0x44f786[_0x005d('0x2b')][_0x005d('0x2a')]);}})[_0x005d('0x2c')](function(_0x3e3117){logger[_0x005d('0x28')](_0x005d('0x23'),_0x323c70,_0x3e3117);_0x4943f6(_0x3e3117);});});}function respondWithStatusCode(_0x3d0ee4,_0x6fe758){_0x6fe758=_0x6fe758||0xcc;return function(_0x49a842){if(_0x49a842){return _0x3d0ee4['sendStatus'](_0x6fe758);}return _0x3d0ee4['status'](_0x6fe758)[_0x005d('0x2d')]();};}function respondWithResult(_0xc92514,_0x1fec40){_0x1fec40=_0x1fec40||0xc8;return function(_0x29f1bc){if(_0x29f1bc){return _0xc92514[_0x005d('0x2e')](_0x1fec40)['json'](_0x29f1bc);}};}function respondWithFilteredResult(_0x111059,_0x4d33e2){return function(_0x51eab7){if(_0x51eab7){var _0x23f8be=_0x51eab7[_0x005d('0x2f')],_0x25330b=_0x4d33e2[_0x005d('0x30')],_0x359d03=_0x4d33e2[_0x005d('0x30')]+_0x4d33e2[_0x005d('0x31')],_0x5f3d94;if(_0x359d03>=_0x23f8be){_0x359d03=_0x23f8be;_0x5f3d94=0xc8;}else{_0x5f3d94=0xce;}_0x111059['status'](_0x5f3d94);return _0x111059[_0x005d('0x32')](_0x005d('0x33'),_0x25330b+'-'+_0x359d03+'/'+_0x23f8be)[_0x005d('0x34')](_0x51eab7);}return null;};}function patchUpdates(_0x23cf3c){return function(_0x18e73f){try{jsonpatch[_0x005d('0x35')](_0x18e73f,_0x23cf3c,!![]);}catch(_0x1114ca){return BPromise[_0x005d('0x36')](_0x1114ca);}return _0x18e73f['save']();};}function saveUpdates(_0x416a52,_0x1ebfc1){return function(_0x559fc8){if(_0x559fc8){return _0x559fc8[_0x005d('0x37')](_0x416a52)[_0x005d('0x21')](function(_0x147a31){return _0x147a31;});}return null;};}function removeEntity(_0x39459f,_0x40267e){return function(_0x43ff76){if(_0x43ff76){return _0x43ff76[_0x005d('0x38')]()[_0x005d('0x21')](function(){_0x39459f[_0x005d('0x2e')](0xcc)[_0x005d('0x2d')]();});}};}function handleEntityNotFound(_0x2e6eee,_0x47ce74){return function(_0xd74588){if(!_0xd74588){_0x2e6eee[_0x005d('0x39')](0x194);}return _0xd74588;};}function handleError(_0x1b524b,_0x4f6f35){_0x4f6f35=_0x4f6f35||0x1f4;return function(_0x161798){logger[_0x005d('0x28')](_0x161798['stack']);if(_0x161798[_0x005d('0x3a')]){delete _0x161798[_0x005d('0x3a')];}_0x1b524b[_0x005d('0x2e')](_0x4f6f35)[_0x005d('0x3b')](_0x161798);};}exports['index']=function(_0x33631b,_0x48d976){var _0x27b08f={},_0x495f21={},_0x5a5600={'count':0x0,'rows':[]};var _0x30f6ee=_['map'](db[_0x005d('0x3c')][_0x005d('0x3d')],function(_0xdef8d4){return{'name':_0xdef8d4[_0x005d('0x3e')],'type':_0xdef8d4[_0x005d('0x3f')]['key']};});_0x495f21[_0x005d('0x40')]=_[_0x005d('0x41')](_0x30f6ee,_0x005d('0x3a'));_0x495f21[_0x005d('0x42')]=_[_0x005d('0x43')](_0x33631b[_0x005d('0x42')]);_0x495f21[_0x005d('0x44')]=_[_0x005d('0x45')](_0x495f21[_0x005d('0x40')],_0x495f21['query']);_0x27b08f[_0x005d('0x46')]=_[_0x005d('0x45')](_0x495f21['model'],qs[_0x005d('0x47')](_0x33631b[_0x005d('0x42')]['fields']));_0x27b08f['attributes']=_0x27b08f[_0x005d('0x46')][_0x005d('0x48')]?_0x27b08f['attributes']:_0x495f21[_0x005d('0x40')];if(!_0x33631b[_0x005d('0x42')]['hasOwnProperty'](_0x005d('0x49'))){_0x27b08f[_0x005d('0x31')]=qs[_0x005d('0x31')](_0x33631b[_0x005d('0x42')][_0x005d('0x31')]);_0x27b08f[_0x005d('0x30')]=qs[_0x005d('0x30')](_0x33631b['query'][_0x005d('0x30')]);}_0x27b08f[_0x005d('0x4a')]=qs['sort'](_0x33631b['query'][_0x005d('0x4b')]);_0x27b08f[_0x005d('0x4c')]=qs[_0x005d('0x44')](_['pick'](_0x33631b[_0x005d('0x42')],_0x495f21[_0x005d('0x44')]));if(_0x33631b[_0x005d('0x42')][_0x005d('0x4d')]){_0x27b08f[_0x005d('0x4c')]=_[_0x005d('0x4e')](_0x27b08f[_0x005d('0x4c')],{'$or':_[_0x005d('0x41')](_0x30f6ee,function(_0x200246){if(_0x200246[_0x005d('0x3f')]!==_0x005d('0x4f')){var _0x35df9b={};_0x35df9b[_0x200246[_0x005d('0x3a')]]={'$like':'%'+_0x33631b[_0x005d('0x42')]['filter']+'%'};return _0x35df9b;}})});}_0x27b08f=_['merge']({},_0x27b08f,_0x33631b[_0x005d('0x50')]);var _0x4b50df={'where':_0x27b08f[_0x005d('0x4c')]};return db[_0x005d('0x3c')][_0x005d('0x2f')](_0x4b50df)[_0x005d('0x21')](function(_0x1e2e67){_0x5a5600['count']=_0x1e2e67;if(_0x33631b[_0x005d('0x42')][_0x005d('0x51')]){_0x27b08f[_0x005d('0x52')]=[{'all':!![]}];}return db[_0x005d('0x3c')][_0x005d('0x53')](_0x27b08f);})[_0x005d('0x21')](function(_0x2e746e){_0x5a5600[_0x005d('0x54')]=_0x2e746e;return _0x5a5600;})[_0x005d('0x21')](respondWithFilteredResult(_0x48d976,_0x27b08f))[_0x005d('0x2c')](handleError(_0x48d976,null));};exports[_0x005d('0x55')]=function(_0x3f035a,_0x10d972){var _0x52894a={'raw':![],'where':{'id':_0x3f035a[_0x005d('0x56')]['id']}},_0x41f599={};_0x41f599[_0x005d('0x40')]=_[_0x005d('0x43')](db[_0x005d('0x3c')][_0x005d('0x3d')]);_0x41f599[_0x005d('0x42')]=_['keys'](_0x3f035a[_0x005d('0x42')]);_0x41f599['filters']=_[_0x005d('0x45')](_0x41f599['model'],_0x41f599[_0x005d('0x42')]);_0x52894a[_0x005d('0x46')]=_[_0x005d('0x45')](_0x41f599['model'],qs[_0x005d('0x47')](_0x3f035a[_0x005d('0x42')]['fields']));_0x52894a['attributes']=_0x52894a[_0x005d('0x46')][_0x005d('0x48')]?_0x52894a[_0x005d('0x46')]:_0x41f599['model'];if(_0x3f035a[_0x005d('0x42')][_0x005d('0x51')]){_0x52894a[_0x005d('0x52')]=[{'all':!![]}];}_0x52894a=_[_0x005d('0x4e')]({},_0x52894a,_0x3f035a[_0x005d('0x50')]);return db[_0x005d('0x3c')]['find'](_0x52894a)[_0x005d('0x21')](handleEntityNotFound(_0x10d972,null))[_0x005d('0x21')](respondWithResult(_0x10d972,null))[_0x005d('0x2c')](handleError(_0x10d972,null));};exports[_0x005d('0x57')]=function(_0x335e1f,_0x4ca455){return db[_0x005d('0x3c')][_0x005d('0x57')](_0x335e1f['body'],{})[_0x005d('0x21')](respondWithResult(_0x4ca455,0xc9))[_0x005d('0x2c')](handleError(_0x4ca455,null));};exports[_0x005d('0x37')]=function(_0x26f3d7,_0x3ac8e4){if(_0x26f3d7['body']['id']){delete _0x26f3d7['body']['id'];}return db[_0x005d('0x3c')]['find']({'where':{'id':_0x26f3d7[_0x005d('0x56')]['id']}})[_0x005d('0x21')](handleEntityNotFound(_0x3ac8e4,null))['then'](saveUpdates(_0x26f3d7[_0x005d('0x58')],null))[_0x005d('0x21')](respondWithResult(_0x3ac8e4,null))[_0x005d('0x2c')](handleError(_0x3ac8e4,null));};exports['destroy']=function(_0x2c7d85,_0x5f11ef){return db['ServicenowAccount']['find']({'where':{'id':_0x2c7d85[_0x005d('0x56')]['id']}})[_0x005d('0x21')](handleEntityNotFound(_0x5f11ef,null))['then'](removeEntity(_0x5f11ef,null))[_0x005d('0x2c')](handleError(_0x5f11ef,null));};exports[_0x005d('0x59')]=function(_0x43dd70,_0x4bdcac,_0x3889bd){var _0x3c4745={};var _0x494b2a={};var _0x3bfe92;var _0x281d1a;return db['ServicenowAccount'][_0x005d('0x5a')]({'where':{'id':_0x43dd70['params']['id']}})['then'](handleEntityNotFound(_0x4bdcac,null))['then'](function(_0x1e79b4){if(_0x1e79b4){_0x3bfe92=_0x1e79b4;_0x494b2a[_0x005d('0x40')]=_[_0x005d('0x43')](db[_0x005d('0x5b')][_0x005d('0x3d')]);_0x494b2a[_0x005d('0x42')]=_['keys'](_0x43dd70['query']);_0x494b2a[_0x005d('0x44')]=_['intersection'](_0x494b2a[_0x005d('0x40')],_0x494b2a[_0x005d('0x42')]);_0x3c4745[_0x005d('0x46')]=_['intersection'](_0x494b2a[_0x005d('0x40')],qs['fields'](_0x43dd70['query'][_0x005d('0x47')]));_0x3c4745[_0x005d('0x46')]=_0x3c4745['attributes'][_0x005d('0x48')]?_0x3c4745[_0x005d('0x46')]:_0x494b2a['model'];_0x3c4745[_0x005d('0x4a')]=qs['sort'](_0x43dd70['query'][_0x005d('0x4b')]);_0x3c4745[_0x005d('0x4c')]=qs[_0x005d('0x44')](_[_0x005d('0x5c')](_0x43dd70[_0x005d('0x42')],_0x494b2a[_0x005d('0x44')]));if(_0x43dd70['query']['filter']){_0x3c4745['where']=_[_0x005d('0x4e')](_0x3c4745['where'],{'$or':_[_0x005d('0x41')](_0x3c4745[_0x005d('0x46')],function(_0x4b3a7a){var _0x2102e3={};_0x2102e3[_0x4b3a7a]={'$like':'%'+_0x43dd70[_0x005d('0x42')]['filter']+'%'};return _0x2102e3;})});}_0x3c4745=_[_0x005d('0x4e')]({},_0x3c4745,_0x43dd70['options']);return _0x3bfe92[_0x005d('0x59')](_0x3c4745);}})[_0x005d('0x21')](function(_0xc1a80b){if(_0xc1a80b){_0x281d1a=_0xc1a80b[_0x005d('0x48')];if(!_0x43dd70[_0x005d('0x42')][_0x005d('0x5d')](_0x005d('0x49'))){_0x3c4745['limit']=qs['limit'](_0x43dd70[_0x005d('0x42')][_0x005d('0x31')]);_0x3c4745['offset']=qs[_0x005d('0x30')](_0x43dd70[_0x005d('0x42')][_0x005d('0x30')]);}return _0x3bfe92[_0x005d('0x59')](_0x3c4745);}})[_0x005d('0x21')](function(_0x58fde5){if(_0x58fde5){return _0x58fde5?{'count':_0x281d1a,'rows':_0x58fde5}:null;}})[_0x005d('0x21')](respondWithResult(_0x4bdcac,null))[_0x005d('0x2c')](handleError(_0x4bdcac,null));};exports[_0x005d('0x5e')]=function(_0x41e87c,_0x4eb79d,_0x4fe2cb){if(_0x41e87c[_0x005d('0x58')]['id']){delete _0x41e87c['body']['id'];}return db[_0x005d('0x3c')]['findOne']({'where':{'id':_0x41e87c[_0x005d('0x56')]['id']}})[_0x005d('0x21')](handleEntityNotFound(_0x4eb79d,null))[_0x005d('0x21')](function(_0x197493){if(_0x197493){_0x41e87c[_0x005d('0x58')]['AccountId']=_0x197493['id'];_0x41e87c[_0x005d('0x58')][_0x005d('0x5f')]=integrations[_0x005d('0x60')](_0x41e87c[_0x005d('0x58')][_0x005d('0x61')],_0x41e87c[_0x005d('0x58')]['type']);_0x41e87c['body'][_0x005d('0x62')]=integrations[_0x005d('0x63')](_0x41e87c[_0x005d('0x58')][_0x005d('0x61')],_0x41e87c[_0x005d('0x58')]['type']);return db[_0x005d('0x5b')][_0x005d('0x57')](_0x41e87c[_0x005d('0x58')],{'include':[{'model':db[_0x005d('0x64')],'as':'Subjects'},{'model':db[_0x005d('0x64')],'as':_0x005d('0x62')}]});}return null;})[_0x005d('0x21')](respondWithResult(_0x4eb79d,null))[_0x005d('0x2c')](handleError(_0x4eb79d,null));};exports['getFields']=function(_0x2f845d,_0x58adb8,_0x57daf6){var _0x430123=[_0x005d('0x65'),'hold_reason',_0x005d('0x66'),_0x005d('0x67'),'close_code','notify',_0x005d('0x68'),_0x005d('0x69'),'category'];var _0x1f5681=[_0x005d('0x6a'),_0x005d('0x65'),_0x005d('0x6b'),_0x005d('0x6c'),'upon_reject',_0x005d('0x6d'),_0x005d('0x6e'),_0x005d('0x6f'),'approval_history',_0x005d('0x70'),'resolved_by',_0x005d('0x71'),_0x005d('0x72'),'user_input',_0x005d('0x73'),'sys_domain',_0x005d('0x74'),_0x005d('0x75'),_0x005d('0x66'),_0x005d('0x4a'),'calendar_stc','closed_at','cmdb_ci',_0x005d('0x76'),_0x005d('0x77'),_0x005d('0x78'),_0x005d('0x79'),_0x005d('0x7a'),_0x005d('0x7b'),_0x005d('0x7c'),_0x005d('0x7d'),_0x005d('0x7e'),_0x005d('0x7f'),'opened_at',_0x005d('0x80'),_0x005d('0x81'),_0x005d('0x82'),_0x005d('0x83'),'resolved_at','caller_id',_0x005d('0x84'),'subcategory',_0x005d('0x85'),_0x005d('0x86'),_0x005d('0x87'),_0x005d('0x88'),'delivery_task',_0x005d('0x89'),'assignment_group',_0x005d('0x8a'),_0x005d('0x8b'),_0x005d('0x8c'),'calendar_duration',_0x005d('0x8d'),_0x005d('0x8e'),_0x005d('0x8f'),'closed_by',_0x005d('0x90'),_0x005d('0x91'),'sys_id','contact_type','reopened_by','incident_state',_0x005d('0x92'),_0x005d('0x93'),'company',_0x005d('0x94'),_0x005d('0x95'),_0x005d('0x96'),'severity',_0x005d('0x97'),_0x005d('0x98'),_0x005d('0x99'),'comments_and_work_notes',_0x005d('0x9a'),'sys_mod_count','reopen_count',_0x005d('0x9b'),_0x005d('0x9c'),'upon_approval',_0x005d('0x9d'),_0x005d('0x9e'),'category'];var _0x5ce707='';var _0x35e714='';var _0x3b8823=[];var _0x54341d='';var _0x13d1f5='';var _0x503613=[];var _0x52026b='';var _0x148457='';var _0x30ac4c={};var _0x33f2eb='';return db[_0x005d('0x3c')]['findOne']({'where':{'id':_0x2f845d[_0x005d('0x56')]['id']},'attributes':['id',_0x005d('0x9f'),'password',_0x005d('0xa0'),'remoteUri',_0x005d('0xa1')]})[_0x005d('0x21')](handleEntityNotFound(_0x58adb8,null))[_0x005d('0x21')](function(_0x5168f3){if(_0x5168f3){_0x33f2eb=_0x5168f3['remoteUri'];var _0x2aa6ad=_0x33f2eb[_0x005d('0xa2')](-0x1);if(_0x2aa6ad==='/'){_0x33f2eb=_0x33f2eb['substring'](0x0,_0x33f2eb[_0x005d('0xa3')](_0x2aa6ad));}_0x148457=util[_0x005d('0xa4')]('%s/api/now/doc/table/schema/',_0x33f2eb);_0x52026b=util[_0x005d('0xa4')](_0x005d('0xa5'),_0x33f2eb);_0x30ac4c={'user':_0x5168f3[_0x005d('0x9f')],'pass':_0x5168f3[_0x005d('0xa6')]};var _0x64c23a={'method':_0x005d('0xa7'),'uri':_0x148457+_0x005d('0xa8'),'auth':_0x30ac4c,'json':!![]};return rp(_0x64c23a);}})[_0x005d('0x21')](function(_0x24491e){if(_0x24491e[_0x005d('0x2b')][_0x005d('0x48')]>0x0){_0x5ce707=_0x24491e[_0x005d('0x2b')];}console[_0x005d('0xa9')]('incident\x20table\x20objects',_0x5ce707);_0x503613=[];_0x35e714=Object['assign']([],_0x5ce707);_[_0x005d('0xaa')](_0x35e714,function(_0x28e33f){return!_0x430123['includes'](_0x28e33f[_0x005d('0x3a')]);});_0x35e714[_0x005d('0xab')](function(_0x4d3628){var _0x109642=createFieldObject(_0x52026b,_0x30ac4c,_0x4d3628[_0x005d('0xac')],_0x4d3628[_0x005d('0x3a')],_0x4d3628[_0x005d('0xad')],![]);_0x503613[_0x005d('0xae')](_0x109642);});return Promise[_0x005d('0xaf')](_0x503613);})[_0x005d('0x21')](function(_0x23431a){_0x3b8823=_0x23431a;_0x54341d=Object[_0x005d('0xb0')]([],_0x5ce707);console[_0x005d('0xa9')](_0x005d('0xb1'),_0x5ce707);_['remove'](_0x54341d,function(_0x4bf76e){return _0x1f5681['includes'](_0x4bf76e[_0x005d('0x3a')]);});console[_0x005d('0xa9')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x54341d);_0x503613=[];_0x54341d[_0x005d('0xab')](function(_0xc51696){var _0x12895e=createFieldObject(_0x52026b,_0x30ac4c,_0xc51696[_0x005d('0xac')],_0xc51696[_0x005d('0x3a')],_0xc51696['label'],!![]);_0x503613[_0x005d('0xae')](_0x12895e);});return Promise['all'](_0x503613);})[_0x005d('0x21')](function(_0x3c8f41){_0x13d1f5=_0x3c8f41;var _0x188d58=_0x3b8823['concat'](_0x13d1f5);return{'count':_0x188d58[_0x005d('0x48')],'rows':_0x188d58};})['then'](respondWithResult(_0x58adb8,null))['catch'](function(_0x18a672){console[_0x005d('0xa9')](_0x005d('0xb2')+_0x18a672);var _0x448870=_0x2f845d['query']['test']?0x1f4:_0x18a672['statusCode']||0x1f4;logger['error'](_0x18a672[_0x005d('0xb3')]);delete _0x18a672[_0x005d('0x3a')];if(_0x448870===0x191){_0x448870=0x190;}_0x58adb8[_0x005d('0x2e')](_0x448870)[_0x005d('0x3b')](_0x2f845d[_0x005d('0x42')][_0x005d('0x1d')]?{'message':_0x005d('0xb4'),'statusCode':_0x18a672[_0x005d('0xb5')]}:_0x18a672);});};function createFieldObject(_0x21db66,_0x6b86cb,_0x59189a,_0x265cff,_0x35d8e2,_0x3e31c6){return new Promise(function(_0xb630b1,_0x7db087){var _0x4186a7={'id':_0x265cff,'name':_0x35d8e2,'custom':_0x3e31c6};if(_0x59189a===_0x005d('0xb6')){_0x4186a7[_0x005d('0x50')]=[{'name':_0x005d('0xb7'),'value':_0x005d('0xb8')},{'name':_0x005d('0xb9'),'value':_0x005d('0xba')}];_0xb630b1(_0x4186a7);}else{var _0x2eafd9={'method':_0x005d('0xa7'),'uri':_0x21db66+_0x005d('0xbb')+_0x265cff,'auth':_0x6b86cb,'json':!![]};return rp(_0x2eafd9)[_0x005d('0x21')](function(_0xeff2bb){var _0x2348fe=[];if(_0xeff2bb[_0x005d('0x2b')][_0x005d('0x48')]>0x0){_0xeff2bb[_0x005d('0x2b')]['forEach'](function(_0x1130f8){if(_0x1130f8[_0x005d('0xbc')]===_0x005d('0xba')){var _0x4caa3b={'name':_0x1130f8[_0x005d('0xad')],'value':_0x1130f8[_0x005d('0xbd')]};_0x2348fe[_0x005d('0xae')](_0x4caa3b);}});}_0x4186a7[_0x005d('0x50')]=_0x2348fe;if(_0x4186a7[_0x005d('0x50')][_0x005d('0x48')]>0x0){_0xb630b1(_0x4186a7);}else{if(_0x3e31c6==![]){_0xb630b1();}else{_0xb630b1(_0x4186a7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 034cc70..f3332f1 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['exports','ServicenowAccount','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x1421af,_0x516ce1){var _0x3964b5=function(_0x19dc1c){while(--_0x19dc1c){_0x1421af['push'](_0x1421af['shift']());}};_0x3964b5(++_0x516ce1);}(_0x008c,0x188));var _0xc008=function(_0x5139bb,_0x3fb5f4){_0x5139bb=_0x5139bb-0x0;var _0x306e2a=_0x008c[_0x5139bb];return _0x306e2a;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));var integrations=require(_0xc008('0xa'));module[_0xc008('0xb')]=function(_0x39bb5e,_0x9c8cb2){return _0x39bb5e['define'](_0xc008('0xc'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e85=['define','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0e85,0x7c));var _0x50e8=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x0e85[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var logger=require('../../config/logger')(_0x50e8('0x2'));var moment=require(_0x50e8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50e8('0x4'));var config=require('../../config/environment');var attributes=require(_0x50e8('0x5'));var integrations=require(_0x50e8('0x6'));module[_0x50e8('0x7')]=function(_0xfde42,_0x5e8b01){return _0xfde42[_0x50e8('0x8')](_0x50e8('0x9'),attributes,{'tableName':_0x50e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 673e122..af7948c 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js +++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83e7=['ServicenowAccount','findAll','options','raw','attributes','limit','map','model','include','then','ShowServicenowAccount','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount'];(function(_0x3ba79c,_0x1547d2){var _0xd2d1a4=function(_0x429fd1){while(--_0x429fd1){_0x3ba79c['push'](_0x3ba79c['shift']());}};_0xd2d1a4(++_0x1547d2);}(_0x83e7,0x1ee));var _0x783e=function(_0x36f688,_0x136a34){_0x36f688=_0x36f688-0x0;var _0x5483e4=_0x83e7[_0x36f688];return _0x5483e4;};'use strict';var _=require(_0x783e('0x0'));var util=require('util');var moment=require(_0x783e('0x1'));var BPromise=require('bluebird');var rs=require(_0x783e('0x2'));var fs=require('fs');var Redis=require(_0x783e('0x3'));var db=require(_0x783e('0x4'))['db'];var utils=require(_0x783e('0x5'));var logger=require(_0x783e('0x6'))(_0x783e('0x7'));var config=require(_0x783e('0x8'));var jayson=require(_0x783e('0x9'));var client=jayson[_0x783e('0xa')][_0x783e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x217dc9,_0x329383,_0x436d79){return new BPromise(function(_0xc28398,_0x53d787){return client[_0x783e('0xc')](_0x217dc9,_0x436d79)['then'](function(_0x188e33){logger[_0x783e('0xd')](_0x783e('0xe'),_0x329383,_0x783e('0xf'));logger[_0x783e('0x10')](_0x783e('0x11'),_0x329383,_0x783e('0xf'),JSON[_0x783e('0x12')](_0x188e33));if(_0x188e33[_0x783e('0x13')]){if(_0x188e33[_0x783e('0x13')][_0x783e('0x14')]===0x1f4){logger[_0x783e('0x13')](_0x783e('0xe'),_0x329383,_0x188e33[_0x783e('0x13')][_0x783e('0x15')]);return _0x53d787(_0x188e33['error'][_0x783e('0x15')]);}logger[_0x783e('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x329383,_0x188e33['error']['message']);return _0xc28398(_0x188e33[_0x783e('0x13')][_0x783e('0x15')]);}else{logger[_0x783e('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x329383,_0x783e('0xf'));_0xc28398(_0x188e33['result'][_0x783e('0x15')]);}})[_0x783e('0x16')](function(_0x4a8795){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x329383,_0x4a8795);_0x53d787(_0x4a8795);});});}exports[_0x783e('0x17')]=function(_0x1b9703){var _0x5823c9=this;return new Promise(function(_0x3b20cb,_0x5a2032){return db[_0x783e('0x18')][_0x783e('0x19')]({'raw':_0x1b9703[_0x783e('0x1a')]?_0x1b9703[_0x783e('0x1a')][_0x783e('0x1b')]===undefined?!![]:![]:!![],'where':_0x1b9703['options']?_0x1b9703[_0x783e('0x1a')]['where']||null:null,'attributes':_0x1b9703[_0x783e('0x1a')]?_0x1b9703[_0x783e('0x1a')][_0x783e('0x1c')]||null:null,'limit':_0x1b9703[_0x783e('0x1a')]?_0x1b9703['options'][_0x783e('0x1d')]||null:null,'include':_0x1b9703[_0x783e('0x1a')]?_0x1b9703[_0x783e('0x1a')]['include']?_[_0x783e('0x1e')](_0x1b9703[_0x783e('0x1a')]['include'],function(_0x50729a){return{'model':db[_0x50729a[_0x783e('0x1f')]],'as':_0x50729a['as'],'attributes':_0x50729a['attributes'],'include':_0x50729a[_0x783e('0x20')]?_[_0x783e('0x1e')](_0x50729a['include'],function(_0x31d5aa){return{'model':db[_0x31d5aa[_0x783e('0x1f')]],'as':_0x31d5aa['as'],'attributes':_0x31d5aa['attributes'],'include':_0x31d5aa['include']?_[_0x783e('0x1e')](_0x31d5aa[_0x783e('0x20')],function(_0x17acf7){return{'model':db[_0x17acf7['model']],'as':_0x17acf7['as'],'attributes':_0x17acf7[_0x783e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x783e('0x21')](function(_0x862ee3){logger['info'](_0x783e('0x17'),_0x1b9703);logger[_0x783e('0x10')]('GetServicenowAccount',_0x1b9703,JSON[_0x783e('0x12')](_0x862ee3));_0x3b20cb(_0x862ee3);})[_0x783e('0x16')](function(_0x22a8dc){logger['error'](_0x783e('0x17'),_0x22a8dc[_0x783e('0x15')],_0x1b9703);_0x5a2032(_0x5823c9[_0x783e('0x13')](0x1f4,_0x22a8dc[_0x783e('0x15')]));});});};exports[_0x783e('0x22')]=function(_0x1a731f){var _0x4634b5=this;return new Promise(function(_0x1b2957,_0x53f6d3){return db[_0x783e('0x18')][_0x783e('0x23')]({'raw':_0x1a731f[_0x783e('0x1a')]?_0x1a731f[_0x783e('0x1a')][_0x783e('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a731f['options']?_0x1a731f['options'][_0x783e('0x24')]||null:null,'attributes':_0x1a731f[_0x783e('0x1a')]?_0x1a731f[_0x783e('0x1a')][_0x783e('0x1c')]||null:null,'include':_0x1a731f[_0x783e('0x1a')]?_0x1a731f['options'][_0x783e('0x20')]?_[_0x783e('0x1e')](_0x1a731f[_0x783e('0x1a')][_0x783e('0x20')],function(_0x8895e8){return{'model':db[_0x8895e8[_0x783e('0x1f')]],'as':_0x8895e8['as'],'attributes':_0x8895e8[_0x783e('0x1c')],'include':_0x8895e8[_0x783e('0x20')]?_[_0x783e('0x1e')](_0x8895e8[_0x783e('0x20')],function(_0x23d7bb){return{'model':db[_0x23d7bb[_0x783e('0x1f')]],'as':_0x23d7bb['as'],'attributes':_0x23d7bb['attributes'],'include':_0x23d7bb[_0x783e('0x20')]?_['map'](_0x23d7bb[_0x783e('0x20')],function(_0x2f41c9){return{'model':db[_0x2f41c9[_0x783e('0x1f')]],'as':_0x2f41c9['as'],'attributes':_0x2f41c9['attributes']};}):[]};}):[]};}):[]:[]})[_0x783e('0x21')](function(_0x4bb9d3){logger[_0x783e('0xd')](_0x783e('0x22'),_0x1a731f);logger['debug'](_0x783e('0x22'),_0x1a731f,JSON[_0x783e('0x12')](_0x4bb9d3));_0x1b2957(_0x4bb9d3);})[_0x783e('0x16')](function(_0x3139ad){logger[_0x783e('0x13')](_0x783e('0x22'),_0x3139ad[_0x783e('0x15')],_0x1a731f);_0x53f6d3(_0x4634b5['error'](0x1f4,_0x3139ad[_0x783e('0x15')]));});});}; \ No newline at end of file +var _0x2649=['message','result','catch','GetServicenowAccount','findAll','options','raw','where','limit','include','map','model','attributes','ServicenowAccount','find','ShowServicenowAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1bb02b,_0x58453f){var _0x77b3b0=function(_0x36301c){while(--_0x36301c){_0x1bb02b['push'](_0x1bb02b['shift']());}};_0x77b3b0(++_0x58453f);}(_0x2649,0x1a8));var _0x9264=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x2649[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x9264('0x0'));var util=require(_0x9264('0x1'));var moment=require(_0x9264('0x2'));var BPromise=require('bluebird');var rs=require(_0x9264('0x3'));var fs=require('fs');var Redis=require(_0x9264('0x4'));var db=require(_0x9264('0x5'))['db'];var utils=require(_0x9264('0x6'));var logger=require(_0x9264('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9264('0x8'));var client=jayson['client'][_0x9264('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3246af,_0x5d3194,_0x106a31){return new BPromise(function(_0x7f1699,_0x54f40e){return client[_0x9264('0xa')](_0x3246af,_0x106a31)[_0x9264('0xb')](function(_0x3ece7f){logger[_0x9264('0xc')](_0x9264('0xd'),_0x5d3194,_0x9264('0xe'));logger[_0x9264('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5d3194,'request\x20sent',JSON[_0x9264('0x10')](_0x3ece7f));if(_0x3ece7f[_0x9264('0x11')]){if(_0x3ece7f[_0x9264('0x11')]['code']===0x1f4){logger[_0x9264('0x11')](_0x9264('0xd'),_0x5d3194,_0x3ece7f[_0x9264('0x11')][_0x9264('0x12')]);return _0x54f40e(_0x3ece7f[_0x9264('0x11')][_0x9264('0x12')]);}logger[_0x9264('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x5d3194,_0x3ece7f[_0x9264('0x11')]['message']);return _0x7f1699(_0x3ece7f['error'][_0x9264('0x12')]);}else{logger[_0x9264('0xc')](_0x9264('0xd'),_0x5d3194,_0x9264('0xe'));_0x7f1699(_0x3ece7f[_0x9264('0x13')][_0x9264('0x12')]);}})[_0x9264('0x14')](function(_0x17f63f){logger[_0x9264('0x11')](_0x9264('0xd'),_0x5d3194,_0x17f63f);_0x54f40e(_0x17f63f);});});}exports[_0x9264('0x15')]=function(_0x598a91){var _0x931c63=this;return new Promise(function(_0x336d12,_0xff13d0){return db['ServicenowAccount'][_0x9264('0x16')]({'raw':_0x598a91[_0x9264('0x17')]?_0x598a91['options'][_0x9264('0x18')]===undefined?!![]:![]:!![],'where':_0x598a91[_0x9264('0x17')]?_0x598a91[_0x9264('0x17')][_0x9264('0x19')]||null:null,'attributes':_0x598a91['options']?_0x598a91[_0x9264('0x17')]['attributes']||null:null,'limit':_0x598a91[_0x9264('0x17')]?_0x598a91[_0x9264('0x17')][_0x9264('0x1a')]||null:null,'include':_0x598a91[_0x9264('0x17')]?_0x598a91[_0x9264('0x17')][_0x9264('0x1b')]?_[_0x9264('0x1c')](_0x598a91[_0x9264('0x17')][_0x9264('0x1b')],function(_0x10013c){return{'model':db[_0x10013c[_0x9264('0x1d')]],'as':_0x10013c['as'],'attributes':_0x10013c[_0x9264('0x1e')],'include':_0x10013c[_0x9264('0x1b')]?_[_0x9264('0x1c')](_0x10013c[_0x9264('0x1b')],function(_0x113edb){return{'model':db[_0x113edb[_0x9264('0x1d')]],'as':_0x113edb['as'],'attributes':_0x113edb[_0x9264('0x1e')],'include':_0x113edb[_0x9264('0x1b')]?_['map'](_0x113edb[_0x9264('0x1b')],function(_0xafa6b7){return{'model':db[_0xafa6b7[_0x9264('0x1d')]],'as':_0xafa6b7['as'],'attributes':_0xafa6b7[_0x9264('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x357265){logger[_0x9264('0xc')](_0x9264('0x15'),_0x598a91);logger[_0x9264('0xf')]('GetServicenowAccount',_0x598a91,JSON[_0x9264('0x10')](_0x357265));_0x336d12(_0x357265);})[_0x9264('0x14')](function(_0x314bb8){logger[_0x9264('0x11')]('GetServicenowAccount',_0x314bb8[_0x9264('0x12')],_0x598a91);_0xff13d0(_0x931c63[_0x9264('0x11')](0x1f4,_0x314bb8[_0x9264('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x3926c7){var _0x2c2ff8=this;return new Promise(function(_0x269c59,_0x46f148){return db[_0x9264('0x1f')][_0x9264('0x20')]({'raw':_0x3926c7[_0x9264('0x17')]?_0x3926c7[_0x9264('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3926c7[_0x9264('0x17')]?_0x3926c7[_0x9264('0x17')]['where']||null:null,'attributes':_0x3926c7[_0x9264('0x17')]?_0x3926c7[_0x9264('0x17')][_0x9264('0x1e')]||null:null,'include':_0x3926c7[_0x9264('0x17')]?_0x3926c7['options'][_0x9264('0x1b')]?_[_0x9264('0x1c')](_0x3926c7['options'][_0x9264('0x1b')],function(_0x90e574){return{'model':db[_0x90e574[_0x9264('0x1d')]],'as':_0x90e574['as'],'attributes':_0x90e574[_0x9264('0x1e')],'include':_0x90e574[_0x9264('0x1b')]?_[_0x9264('0x1c')](_0x90e574['include'],function(_0x3f096d){return{'model':db[_0x3f096d['model']],'as':_0x3f096d['as'],'attributes':_0x3f096d[_0x9264('0x1e')],'include':_0x3f096d['include']?_[_0x9264('0x1c')](_0x3f096d[_0x9264('0x1b')],function(_0x58bc31){return{'model':db[_0x58bc31[_0x9264('0x1d')]],'as':_0x58bc31['as'],'attributes':_0x58bc31[_0x9264('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dbb12){logger['info'](_0x9264('0x21'),_0x3926c7);logger[_0x9264('0xf')](_0x9264('0x21'),_0x3926c7,JSON['stringify'](_0x5dbb12));_0x269c59(_0x5dbb12);})[_0x9264('0x14')](function(_0x2517fb){logger[_0x9264('0x11')](_0x9264('0x21'),_0x2517fb[_0x9264('0x12')],_0x3926c7);_0x46f148(_0x2c2ff8[_0x9264('0x11')](0x1f4,_0x2517fb['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ddfe976..3070d96 100644 --- a/server/api/intServicenowConfiguration/index.js +++ b/server/api/intServicenowConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51df=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x1c100b,_0x5e17a0){var _0x2417fe=function(_0x4f5756){while(--_0x4f5756){_0x1c100b['push'](_0x1c100b['shift']());}};_0x2417fe(++_0x5e17a0);}(_0x51df,0x1de));var _0xf51d=function(_0x449f7b,_0x22d969){_0x449f7b=_0x449f7b-0x0;var _0x13b84c=_0x51df[_0x449f7b];return _0x13b84c;};'use strict';var multer=require(_0xf51d('0x0'));var util=require(_0xf51d('0x1'));var path=require(_0xf51d('0x2'));var timeout=require(_0xf51d('0x3'));var express=require(_0xf51d('0x4'));var router=express['Router']();var auth=require(_0xf51d('0x5'));var interaction=require(_0xf51d('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0xf51d('0x7')]('/',auth[_0xf51d('0x8')](),controller[_0xf51d('0x9')]);router[_0xf51d('0x7')](_0xf51d('0xa'),auth[_0xf51d('0x8')](),controller[_0xf51d('0xb')]);router[_0xf51d('0x7')](_0xf51d('0xc'),auth[_0xf51d('0x8')](),controller['getFields']);router[_0xf51d('0x7')](_0xf51d('0xd'),auth['isAuthenticated'](),controller[_0xf51d('0xe')]);router['get'](_0xf51d('0xf'),auth['isAuthenticated'](),controller[_0xf51d('0x10')]);router[_0xf51d('0x11')]('/',auth['isAuthenticated'](),controller[_0xf51d('0x12')]);router[_0xf51d('0x13')](_0xf51d('0xa'),auth['isAuthenticated'](),controller[_0xf51d('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf51d('0x15')]=router; \ No newline at end of file +var _0x59aa=['/:id','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0x59aa,0xfd));var _0xa59a=function(_0x7f2892,_0x37c131){_0x7f2892=_0x7f2892-0x0;var _0xfb6599=_0x59aa[_0x7f2892];return _0xfb6599;};'use strict';var multer=require(_0xa59a('0x0'));var util=require(_0xa59a('0x1'));var path=require(_0xa59a('0x2'));var timeout=require(_0xa59a('0x3'));var express=require('express');var router=express[_0xa59a('0x4')]();var auth=require(_0xa59a('0x5'));var interaction=require(_0xa59a('0x6'));var config=require(_0xa59a('0x7'));var controller=require(_0xa59a('0x8'));router[_0xa59a('0x9')]('/',auth['isAuthenticated'](),controller[_0xa59a('0xa')]);router[_0xa59a('0x9')](_0xa59a('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa59a('0xc'),auth[_0xa59a('0xd')](),controller[_0xa59a('0xe')]);router[_0xa59a('0x9')](_0xa59a('0xf'),auth[_0xa59a('0xd')](),controller[_0xa59a('0x10')]);router['get'](_0xa59a('0x11'),auth[_0xa59a('0xd')](),controller['getDescriptions']);router[_0xa59a('0x12')]('/',auth[_0xa59a('0xd')](),controller['create']);router[_0xa59a('0x13')](_0xa59a('0xb'),auth[_0xa59a('0xd')](),controller[_0xa59a('0x14')]);router[_0xa59a('0x15')](_0xa59a('0xb'),auth['isAuthenticated'](),controller[_0xa59a('0x16')]);module[_0xa59a('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 7593cdd..b13658a 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e98=['sequelize','STRING'];(function(_0x59f86a,_0x5a4384){var _0x899f7e=function(_0xe60be2){while(--_0xe60be2){_0x59f86a['push'](_0x59f86a['shift']());}};_0x899f7e(++_0x5a4384);}(_0x6e98,0x154));var _0x86e9=function(_0xb36843,_0x57c1f4){_0xb36843=_0xb36843-0x0;var _0x227b83=_0x6e98[_0xb36843];return _0x227b83;};'use strict';var Sequelize=require(_0x86e9('0x0'));module['exports']={'name':{'type':Sequelize[_0x86e9('0x1')]},'description':{'type':Sequelize[_0x86e9('0x1')]}}; \ No newline at end of file +var _0xb1df=['STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb1df,0xc3));var _0xfb1d=function(_0x20d428,_0xdf2a0){_0x20d428=_0x20d428-0x0;var _0x48fc12=_0xb1df[_0x20d428];return _0x48fc12;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfb1d('0x0')]},'description':{'type':Sequelize[_0xfb1d('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 1c8a352..d63cac2 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2585=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','test','Sequelize','request','then','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','end','stack','name','ServicenowConfiguration','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','rawAttributes','body','find','getFields','findOne','ServicenowField','sort','hasOwnProperty','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1205a1,_0x27778d){var _0xe494f8=function(_0x809d4b){while(--_0x809d4b){_0x1205a1['push'](_0x1205a1['shift']());}};_0xe494f8(++_0x27778d);}(_0x2585,0x1a3));var _0x5258=function(_0x1c6e5b,_0x268fbc){_0x1c6e5b=_0x1c6e5b-0x0;var _0xec52b=_0x2585[_0x1c6e5b];return _0xec52b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5258('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5258('0x1'));var rp=require(_0x5258('0x2'));var moment=require(_0x5258('0x3'));var BPromise=require(_0x5258('0x4'));var Mustache=require('mustache');var util=require(_0x5258('0x5'));var path=require('path');var sox=require(_0x5258('0x6'));var csv=require(_0x5258('0x7'));var ejs=require(_0x5258('0x8'));var fs=require('fs');var _=require(_0x5258('0x9'));var squel=require(_0x5258('0xa'));var crypto=require('crypto');var jsforce=require(_0x5258('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5258('0x7'));var querystring=require(_0x5258('0xc'));var Papa=require(_0x5258('0xd'));var Redis=require(_0x5258('0xe'));var authService=require(_0x5258('0xf'));var qs=require(_0x5258('0x10'));var as=require(_0x5258('0x11'));var hardwareService=require(_0x5258('0x12'));var logger=require(_0x5258('0x13'))(_0x5258('0x14'));var utils=require(_0x5258('0x15'));var config=require(_0x5258('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5258('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x6db18f,_0x40f207,_0x54b28){if(_0x54b28){var _0x5e2e48=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e2e48[_0x5258('0x18')](_0x40f207)){return _0x6db18f;}else{throw new db[(_0x5258('0x19'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x6db18f;}}function respondWithRpcPromise(_0x2c8ff7,_0x15741b,_0x1c8cc7,_0x54325c){return new BPromise(function(_0x531d55,_0x56006d){var _0x35573b=_0x54325c||client;return _0x35573b[_0x5258('0x1a')](_0x2c8ff7,_0x1c8cc7)[_0x5258('0x1b')](function(_0x44c3af){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x15741b,'request\x20sent');logger['debug'](_0x5258('0x1c'),_0x15741b,_0x5258('0x1d'),JSON[_0x5258('0x1e')](_0x44c3af));if(_0x44c3af[_0x5258('0x1f')]){if(_0x44c3af['error'][_0x5258('0x20')]===0x1f4){logger[_0x5258('0x1f')](_0x5258('0x21'),_0x15741b,_0x44c3af[_0x5258('0x1f')][_0x5258('0x22')]);return _0x56006d(_0x44c3af[_0x5258('0x1f')][_0x5258('0x22')]);}logger[_0x5258('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x15741b,_0x44c3af['error'][_0x5258('0x22')]);return _0x531d55(_0x44c3af[_0x5258('0x1f')][_0x5258('0x22')]);}else{logger[_0x5258('0x23')](_0x5258('0x21'),_0x15741b,_0x5258('0x1d'));_0x531d55(_0x44c3af[_0x5258('0x24')][_0x5258('0x22')]);}})['catch'](function(_0x95df11){logger['error'](_0x5258('0x21'),_0x15741b,_0x95df11);_0x56006d(_0x95df11);});});}function respondWithStatusCode(_0x56a089,_0x407770){_0x407770=_0x407770||0xcc;return function(_0x4334c4){if(_0x4334c4){return _0x56a089[_0x5258('0x25')](_0x407770);}return _0x56a089[_0x5258('0x26')](_0x407770)['end']();};}function respondWithResult(_0x3c743f,_0x41da06){_0x41da06=_0x41da06||0xc8;return function(_0x371676){if(_0x371676){return _0x3c743f[_0x5258('0x26')](_0x41da06)['json'](_0x371676);}};}function respondWithFilteredResult(_0xfb88e7,_0x457bb1){return function(_0x2a75d2){if(_0x2a75d2){var _0x29b08f=_0x2a75d2[_0x5258('0x27')],_0x1678da=_0x457bb1[_0x5258('0x28')],_0x3187dd=_0x457bb1['offset']+_0x457bb1[_0x5258('0x29')],_0x4b071a;if(_0x3187dd>=_0x29b08f){_0x3187dd=_0x29b08f;_0x4b071a=0xc8;}else{_0x4b071a=0xce;}_0xfb88e7['status'](_0x4b071a);return _0xfb88e7[_0x5258('0x2a')](_0x5258('0x2b'),_0x1678da+'-'+_0x3187dd+'/'+_0x29b08f)['json'](_0x2a75d2);}return null;};}function patchUpdates(_0x3b8f66){return function(_0x841e65){try{jsonpatch[_0x5258('0x2c')](_0x841e65,_0x3b8f66,!![]);}catch(_0x5d5cf9){return BPromise[_0x5258('0x2d')](_0x5d5cf9);}return _0x841e65[_0x5258('0x2e')]();};}function saveUpdates(_0x183038,_0x301976){return function(_0x19e9b3){if(_0x19e9b3){return _0x19e9b3[_0x5258('0x2f')](_0x183038)[_0x5258('0x1b')](function(_0x6c2225){return _0x6c2225;});}return null;};}function removeEntity(_0x273221,_0x51fd47){return function(_0x532341){if(_0x532341){return _0x532341['destroy']()[_0x5258('0x1b')](function(){_0x273221['status'](0xcc)[_0x5258('0x30')]();});}};}function handleEntityNotFound(_0x138352,_0x318ffa){return function(_0x552c7d){if(!_0x552c7d){_0x138352['sendStatus'](0x194);}return _0x552c7d;};}function handleError(_0x58f6ff,_0x12b6bd){_0x12b6bd=_0x12b6bd||0x1f4;return function(_0x1d6250){logger[_0x5258('0x1f')](_0x1d6250[_0x5258('0x31')]);if(_0x1d6250[_0x5258('0x32')]){delete _0x1d6250[_0x5258('0x32')];}_0x58f6ff[_0x5258('0x26')](_0x12b6bd)['send'](_0x1d6250);};}exports['index']=function(_0x505a12,_0x3e07ba){var _0x2b9b01={},_0x2fa2a0={},_0x4f15d9={'count':0x0,'rows':[]};var _0x4fa9a7=_['map'](db[_0x5258('0x33')]['rawAttributes'],function(_0x30afe1){return{'name':_0x30afe1[_0x5258('0x34')],'type':_0x30afe1[_0x5258('0x35')][_0x5258('0x36')]};});_0x2fa2a0[_0x5258('0x37')]=_[_0x5258('0x38')](_0x4fa9a7,_0x5258('0x32'));_0x2fa2a0['query']=_['keys'](_0x505a12[_0x5258('0x39')]);_0x2fa2a0['filters']=_[_0x5258('0x3a')](_0x2fa2a0[_0x5258('0x37')],_0x2fa2a0[_0x5258('0x39')]);_0x2b9b01[_0x5258('0x3b')]=_['intersection'](_0x2fa2a0['model'],qs['fields'](_0x505a12['query'][_0x5258('0x3c')]));_0x2b9b01[_0x5258('0x3b')]=_0x2b9b01[_0x5258('0x3b')][_0x5258('0x3d')]?_0x2b9b01['attributes']:_0x2fa2a0[_0x5258('0x37')];if(!_0x505a12[_0x5258('0x39')]['hasOwnProperty'](_0x5258('0x3e'))){_0x2b9b01[_0x5258('0x29')]=qs[_0x5258('0x29')](_0x505a12[_0x5258('0x39')][_0x5258('0x29')]);_0x2b9b01[_0x5258('0x28')]=qs[_0x5258('0x28')](_0x505a12['query'][_0x5258('0x28')]);}_0x2b9b01[_0x5258('0x3f')]=qs['sort'](_0x505a12['query']['sort']);_0x2b9b01[_0x5258('0x40')]=qs['filters'](_[_0x5258('0x41')](_0x505a12[_0x5258('0x39')],_0x2fa2a0[_0x5258('0x42')]));if(_0x505a12['query'][_0x5258('0x43')]){_0x2b9b01[_0x5258('0x40')]=_[_0x5258('0x44')](_0x2b9b01[_0x5258('0x40')],{'$or':_[_0x5258('0x38')](_0x4fa9a7,function(_0x2a292b){if(_0x2a292b[_0x5258('0x35')]!==_0x5258('0x45')){var _0x5241cb={};_0x5241cb[_0x2a292b[_0x5258('0x32')]]={'$like':'%'+_0x505a12[_0x5258('0x39')][_0x5258('0x43')]+'%'};return _0x5241cb;}})});}_0x2b9b01=_['merge']({},_0x2b9b01,_0x505a12[_0x5258('0x46')]);var _0x5bd583={'where':_0x2b9b01['where']};return db[_0x5258('0x33')][_0x5258('0x27')](_0x5bd583)['then'](function(_0x3415c2){_0x4f15d9[_0x5258('0x27')]=_0x3415c2;if(_0x505a12[_0x5258('0x39')][_0x5258('0x47')]){_0x2b9b01[_0x5258('0x48')]=[{'all':!![]}];}return db[_0x5258('0x33')][_0x5258('0x49')](_0x2b9b01);})[_0x5258('0x1b')](function(_0x124f0b){_0x4f15d9['rows']=_0x124f0b;return _0x4f15d9;})[_0x5258('0x1b')](respondWithFilteredResult(_0x3e07ba,_0x2b9b01))[_0x5258('0x4a')](handleError(_0x3e07ba,null));};exports['show']=function(_0x3dcb4d,_0x1083f2){var _0x27b1ac={'raw':![],'where':{'id':_0x3dcb4d[_0x5258('0x4b')]['id']}},_0x1f08f7={};_0x1f08f7[_0x5258('0x37')]=_[_0x5258('0x4c')](db['ServicenowConfiguration'][_0x5258('0x4d')]);_0x1f08f7['query']=_[_0x5258('0x4c')](_0x3dcb4d['query']);_0x1f08f7[_0x5258('0x42')]=_[_0x5258('0x3a')](_0x1f08f7['model'],_0x1f08f7['query']);_0x27b1ac[_0x5258('0x3b')]=_['intersection'](_0x1f08f7[_0x5258('0x37')],qs[_0x5258('0x3c')](_0x3dcb4d[_0x5258('0x39')][_0x5258('0x3c')]));_0x27b1ac['attributes']=_0x27b1ac[_0x5258('0x3b')][_0x5258('0x3d')]?_0x27b1ac[_0x5258('0x3b')]:_0x1f08f7[_0x5258('0x37')];if(_0x3dcb4d['query'][_0x5258('0x47')]){_0x27b1ac[_0x5258('0x48')]=[{'all':!![]}];}_0x27b1ac=_[_0x5258('0x44')]({},_0x27b1ac,_0x3dcb4d[_0x5258('0x46')]);return db[_0x5258('0x33')]['find'](_0x27b1ac)['then'](handleEntityNotFound(_0x1083f2,null))[_0x5258('0x1b')](respondWithResult(_0x1083f2,null))[_0x5258('0x4a')](handleError(_0x1083f2,null));};exports['create']=function(_0x2539f1,_0x6137e8){return db[_0x5258('0x33')]['create'](_0x2539f1['body'],{})[_0x5258('0x1b')](respondWithResult(_0x6137e8,0xc9))[_0x5258('0x4a')](handleError(_0x6137e8,null));};exports[_0x5258('0x2f')]=function(_0x5ebfc6,_0x5db8ac){if(_0x5ebfc6['body']['id']){delete _0x5ebfc6[_0x5258('0x4e')]['id'];}return db[_0x5258('0x33')]['find']({'where':{'id':_0x5ebfc6['params']['id']}})[_0x5258('0x1b')](handleEntityNotFound(_0x5db8ac,null))['then'](saveUpdates(_0x5ebfc6[_0x5258('0x4e')],null))[_0x5258('0x1b')](respondWithResult(_0x5db8ac,null))[_0x5258('0x4a')](handleError(_0x5db8ac,null));};exports['destroy']=function(_0x219306,_0x3cb9ff){return db[_0x5258('0x33')][_0x5258('0x4f')]({'where':{'id':_0x219306[_0x5258('0x4b')]['id']}})[_0x5258('0x1b')](handleEntityNotFound(_0x3cb9ff,null))[_0x5258('0x1b')](removeEntity(_0x3cb9ff,null))[_0x5258('0x4a')](handleError(_0x3cb9ff,null));};exports[_0x5258('0x50')]=function(_0x2a10a5,_0x1c657f,_0x3b5582){var _0x3a4bae={};var _0x212ac2={};var _0x4f3bbc;var _0x55063d;return db[_0x5258('0x33')][_0x5258('0x51')]({'where':{'id':_0x2a10a5[_0x5258('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1c657f,null))[_0x5258('0x1b')](function(_0x8b121){if(_0x8b121){_0x4f3bbc=_0x8b121;_0x212ac2['model']=_[_0x5258('0x4c')](db[_0x5258('0x52')][_0x5258('0x4d')]);_0x212ac2['query']=_[_0x5258('0x4c')](_0x2a10a5[_0x5258('0x39')]);_0x212ac2[_0x5258('0x42')]=_['intersection'](_0x212ac2[_0x5258('0x37')],_0x212ac2[_0x5258('0x39')]);_0x3a4bae[_0x5258('0x3b')]=_[_0x5258('0x3a')](_0x212ac2[_0x5258('0x37')],qs[_0x5258('0x3c')](_0x2a10a5[_0x5258('0x39')]['fields']));_0x3a4bae['attributes']=_0x3a4bae[_0x5258('0x3b')]['length']?_0x3a4bae[_0x5258('0x3b')]:_0x212ac2[_0x5258('0x37')];_0x3a4bae[_0x5258('0x3f')]=qs[_0x5258('0x53')](_0x2a10a5['query'][_0x5258('0x53')]);_0x3a4bae[_0x5258('0x40')]=qs[_0x5258('0x42')](_['pick'](_0x2a10a5[_0x5258('0x39')],_0x212ac2[_0x5258('0x42')]));if(_0x2a10a5[_0x5258('0x39')]['filter']){_0x3a4bae['where']=_['merge'](_0x3a4bae[_0x5258('0x40')],{'$or':_['map'](_0x3a4bae['attributes'],function(_0x3da936){var _0x1326fd={};_0x1326fd[_0x3da936]={'$like':'%'+_0x2a10a5[_0x5258('0x39')][_0x5258('0x43')]+'%'};return _0x1326fd;})});}_0x3a4bae=_[_0x5258('0x44')]({},_0x3a4bae,_0x2a10a5[_0x5258('0x46')]);return _0x4f3bbc[_0x5258('0x50')](_0x3a4bae);}})['then'](function(_0x2517a5){if(_0x2517a5){_0x55063d=_0x2517a5[_0x5258('0x3d')];if(!_0x2a10a5[_0x5258('0x39')][_0x5258('0x54')]('nolimit')){_0x3a4bae['limit']=qs[_0x5258('0x29')](_0x2a10a5[_0x5258('0x39')][_0x5258('0x29')]);_0x3a4bae[_0x5258('0x28')]=qs[_0x5258('0x28')](_0x2a10a5[_0x5258('0x39')][_0x5258('0x28')]);}return _0x4f3bbc[_0x5258('0x50')](_0x3a4bae);}})[_0x5258('0x1b')](function(_0x2c4c75){if(_0x2c4c75){return _0x2c4c75?{'count':_0x55063d,'rows':_0x2c4c75}:null;}})[_0x5258('0x1b')](respondWithResult(_0x1c657f,null))[_0x5258('0x4a')](handleError(_0x1c657f,null));};exports['getSubjects']=function(_0x357fb5,_0x10b847,_0x13a562){var _0x25d818={};var _0x128ffb={};var _0x513ab5;var _0x2deb06;return db[_0x5258('0x33')][_0x5258('0x51')]({'where':{'id':_0x357fb5[_0x5258('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10b847,null))['then'](function(_0x43b4b1){if(_0x43b4b1){_0x513ab5=_0x43b4b1;_0x128ffb[_0x5258('0x37')]=_['keys'](db[_0x5258('0x52')]['rawAttributes']);_0x128ffb['query']=_['keys'](_0x357fb5[_0x5258('0x39')]);_0x128ffb[_0x5258('0x42')]=_[_0x5258('0x3a')](_0x128ffb[_0x5258('0x37')],_0x128ffb[_0x5258('0x39')]);_0x25d818[_0x5258('0x3b')]=_[_0x5258('0x3a')](_0x128ffb[_0x5258('0x37')],qs[_0x5258('0x3c')](_0x357fb5[_0x5258('0x39')]['fields']));_0x25d818[_0x5258('0x3b')]=_0x25d818[_0x5258('0x3b')][_0x5258('0x3d')]?_0x25d818['attributes']:_0x128ffb[_0x5258('0x37')];_0x25d818['order']=qs[_0x5258('0x53')](_0x357fb5[_0x5258('0x39')]['sort']);_0x25d818[_0x5258('0x40')]=qs['filters'](_['pick'](_0x357fb5[_0x5258('0x39')],_0x128ffb[_0x5258('0x42')]));if(_0x357fb5[_0x5258('0x39')][_0x5258('0x43')]){_0x25d818[_0x5258('0x40')]=_[_0x5258('0x44')](_0x25d818[_0x5258('0x40')],{'$or':_[_0x5258('0x38')](_0x25d818[_0x5258('0x3b')],function(_0x299786){var _0x45f5cf={};_0x45f5cf[_0x299786]={'$like':'%'+_0x357fb5['query'][_0x5258('0x43')]+'%'};return _0x45f5cf;})});}_0x25d818=_[_0x5258('0x44')]({},_0x25d818,_0x357fb5[_0x5258('0x46')]);return _0x513ab5[_0x5258('0x55')](_0x25d818);}})[_0x5258('0x1b')](function(_0x2b7dfb){if(_0x2b7dfb){_0x2deb06=_0x2b7dfb[_0x5258('0x3d')];if(!_0x357fb5[_0x5258('0x39')][_0x5258('0x54')](_0x5258('0x3e'))){_0x25d818[_0x5258('0x29')]=qs[_0x5258('0x29')](_0x357fb5[_0x5258('0x39')]['limit']);_0x25d818['offset']=qs[_0x5258('0x28')](_0x357fb5[_0x5258('0x39')][_0x5258('0x28')]);}return _0x513ab5['getSubjects'](_0x25d818);}})[_0x5258('0x1b')](function(_0x1d5300){if(_0x1d5300){return _0x1d5300?{'count':_0x2deb06,'rows':_0x1d5300}:null;}})[_0x5258('0x1b')](respondWithResult(_0x10b847,null))['catch'](handleError(_0x10b847,null));};exports['getDescriptions']=function(_0x34933b,_0x270fd2,_0x2d1810){var _0x3e988f={};var _0xa074f6={};var _0x17bfcb;var _0x17e424;return db[_0x5258('0x33')][_0x5258('0x51')]({'where':{'id':_0x34933b['params']['id']}})[_0x5258('0x1b')](handleEntityNotFound(_0x270fd2,null))[_0x5258('0x1b')](function(_0x5af3d4){if(_0x5af3d4){_0x17bfcb=_0x5af3d4;_0xa074f6[_0x5258('0x37')]=_[_0x5258('0x4c')](db[_0x5258('0x52')][_0x5258('0x4d')]);_0xa074f6[_0x5258('0x39')]=_[_0x5258('0x4c')](_0x34933b[_0x5258('0x39')]);_0xa074f6['filters']=_[_0x5258('0x3a')](_0xa074f6[_0x5258('0x37')],_0xa074f6['query']);_0x3e988f[_0x5258('0x3b')]=_[_0x5258('0x3a')](_0xa074f6[_0x5258('0x37')],qs['fields'](_0x34933b[_0x5258('0x39')][_0x5258('0x3c')]));_0x3e988f[_0x5258('0x3b')]=_0x3e988f[_0x5258('0x3b')][_0x5258('0x3d')]?_0x3e988f[_0x5258('0x3b')]:_0xa074f6[_0x5258('0x37')];_0x3e988f[_0x5258('0x3f')]=qs[_0x5258('0x53')](_0x34933b[_0x5258('0x39')][_0x5258('0x53')]);_0x3e988f[_0x5258('0x40')]=qs[_0x5258('0x42')](_[_0x5258('0x41')](_0x34933b[_0x5258('0x39')],_0xa074f6['filters']));if(_0x34933b[_0x5258('0x39')][_0x5258('0x43')]){_0x3e988f['where']=_[_0x5258('0x44')](_0x3e988f[_0x5258('0x40')],{'$or':_[_0x5258('0x38')](_0x3e988f[_0x5258('0x3b')],function(_0x589ad8){var _0x475720={};_0x475720[_0x589ad8]={'$like':'%'+_0x34933b[_0x5258('0x39')]['filter']+'%'};return _0x475720;})});}_0x3e988f=_[_0x5258('0x44')]({},_0x3e988f,_0x34933b[_0x5258('0x46')]);return _0x17bfcb[_0x5258('0x56')](_0x3e988f);}})[_0x5258('0x1b')](function(_0x4033b9){if(_0x4033b9){_0x17e424=_0x4033b9[_0x5258('0x3d')];if(!_0x34933b[_0x5258('0x39')][_0x5258('0x54')]('nolimit')){_0x3e988f[_0x5258('0x29')]=qs['limit'](_0x34933b[_0x5258('0x39')][_0x5258('0x29')]);_0x3e988f['offset']=qs['offset'](_0x34933b[_0x5258('0x39')][_0x5258('0x28')]);}return _0x17bfcb['getDescriptions'](_0x3e988f);}})[_0x5258('0x1b')](function(_0x1ba6a3){if(_0x1ba6a3){return _0x1ba6a3?{'count':_0x17e424,'rows':_0x1ba6a3}:null;}})['then'](respondWithResult(_0x270fd2,null))[_0x5258('0x4a')](handleError(_0x270fd2,null));}; \ No newline at end of file +var _0x6667=['fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ServicenowConfiguration','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','find','create','body','destroy','findOne','ServicenowField','pick','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf'];(function(_0x37ded7,_0x14cc8e){var _0x1c329e=function(_0x3203f9){while(--_0x3203f9){_0x37ded7['push'](_0x37ded7['shift']());}};_0x1c329e(++_0x14cc8e);}(_0x6667,0x10c));var _0x7666=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x6667[_0x1a9204];return _0x17ca68;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7666('0x0'));var rimraf=require(_0x7666('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7666('0x2'));var rp=require(_0x7666('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7666('0x4'));var util=require('util');var path=require(_0x7666('0x5'));var sox=require(_0x7666('0x6'));var csv=require(_0x7666('0x7'));var ejs=require(_0x7666('0x8'));var fs=require('fs');var _=require(_0x7666('0x9'));var squel=require(_0x7666('0xa'));var crypto=require(_0x7666('0xb'));var jsforce=require(_0x7666('0xc'));var deskjs=require(_0x7666('0xd'));var toCsv=require(_0x7666('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7666('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7666('0xf'));var hardwareService=require(_0x7666('0x10'));var logger=require(_0x7666('0x11'))(_0x7666('0x12'));var utils=require(_0x7666('0x13'));var config=require('../../config/environment');var db=require(_0x7666('0x14'))['db'];var jayson=require(_0x7666('0x15'));var client=jayson['client'][_0x7666('0x16')]({'port':0x232a});function checkPasswordPattern(_0x4736c3,_0x5693ed,_0x738ce3){if(_0x738ce3){var _0x1a0f46=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a0f46[_0x7666('0x17')](_0x5693ed)){return _0x4736c3;}else{throw new db[(_0x7666('0x18'))]['ValidationError'](_0x7666('0x19'));}}else{return _0x4736c3;}}function respondWithRpcPromise(_0x35f452,_0x33dc8a,_0x1d8a6d,_0x45e56f){return new BPromise(function(_0x4fb9bb,_0x5dceb8){var _0x150d28=_0x45e56f||client;return _0x150d28[_0x7666('0x1a')](_0x35f452,_0x1d8a6d)['then'](function(_0x692c14){logger[_0x7666('0x1b')](_0x7666('0x1c'),_0x33dc8a,_0x7666('0x1d'));logger[_0x7666('0x1e')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x33dc8a,_0x7666('0x1d'),JSON['stringify'](_0x692c14));if(_0x692c14[_0x7666('0x1f')]){if(_0x692c14[_0x7666('0x1f')][_0x7666('0x20')]===0x1f4){logger['error'](_0x7666('0x1c'),_0x33dc8a,_0x692c14[_0x7666('0x1f')][_0x7666('0x21')]);return _0x5dceb8(_0x692c14[_0x7666('0x1f')][_0x7666('0x21')]);}logger[_0x7666('0x1f')](_0x7666('0x1c'),_0x33dc8a,_0x692c14['error'][_0x7666('0x21')]);return _0x4fb9bb(_0x692c14['error'][_0x7666('0x21')]);}else{logger[_0x7666('0x1b')](_0x7666('0x1c'),_0x33dc8a,_0x7666('0x1d'));_0x4fb9bb(_0x692c14[_0x7666('0x22')][_0x7666('0x21')]);}})['catch'](function(_0x2ac48b){logger[_0x7666('0x1f')](_0x7666('0x1c'),_0x33dc8a,_0x2ac48b);_0x5dceb8(_0x2ac48b);});});}function respondWithStatusCode(_0x4465e6,_0x1491b9){_0x1491b9=_0x1491b9||0xcc;return function(_0x242407){if(_0x242407){return _0x4465e6['sendStatus'](_0x1491b9);}return _0x4465e6['status'](_0x1491b9)[_0x7666('0x23')]();};}function respondWithResult(_0x226a8f,_0x315fb9){_0x315fb9=_0x315fb9||0xc8;return function(_0x356ebd){if(_0x356ebd){return _0x226a8f[_0x7666('0x24')](_0x315fb9)[_0x7666('0x25')](_0x356ebd);}};}function respondWithFilteredResult(_0x24dae0,_0x424b0a){return function(_0x1119c4){if(_0x1119c4){var _0x35f779=_0x1119c4[_0x7666('0x26')],_0x49f1f2=_0x424b0a[_0x7666('0x27')],_0x16b2a6=_0x424b0a[_0x7666('0x27')]+_0x424b0a[_0x7666('0x28')],_0x5a8bd2;if(_0x16b2a6>=_0x35f779){_0x16b2a6=_0x35f779;_0x5a8bd2=0xc8;}else{_0x5a8bd2=0xce;}_0x24dae0['status'](_0x5a8bd2);return _0x24dae0['set'](_0x7666('0x29'),_0x49f1f2+'-'+_0x16b2a6+'/'+_0x35f779)['json'](_0x1119c4);}return null;};}function patchUpdates(_0xbe19bc){return function(_0x2477fe){try{jsonpatch[_0x7666('0x2a')](_0x2477fe,_0xbe19bc,!![]);}catch(_0x977e00){return BPromise[_0x7666('0x2b')](_0x977e00);}return _0x2477fe[_0x7666('0x2c')]();};}function saveUpdates(_0x2e3c92,_0x3b26cb){return function(_0x5deb8f){if(_0x5deb8f){return _0x5deb8f[_0x7666('0x2d')](_0x2e3c92)[_0x7666('0x2e')](function(_0x277610){return _0x277610;});}return null;};}function removeEntity(_0x3eb449,_0x425307){return function(_0x3e2f1c){if(_0x3e2f1c){return _0x3e2f1c['destroy']()[_0x7666('0x2e')](function(){_0x3eb449[_0x7666('0x24')](0xcc)[_0x7666('0x23')]();});}};}function handleEntityNotFound(_0x1053c6,_0x50c6a7){return function(_0x1bc536){if(!_0x1bc536){_0x1053c6['sendStatus'](0x194);}return _0x1bc536;};}function handleError(_0x1c80f0,_0x27b081){_0x27b081=_0x27b081||0x1f4;return function(_0x192af7){logger[_0x7666('0x1f')](_0x192af7[_0x7666('0x2f')]);if(_0x192af7['name']){delete _0x192af7[_0x7666('0x30')];}_0x1c80f0[_0x7666('0x24')](_0x27b081)[_0x7666('0x31')](_0x192af7);};}exports[_0x7666('0x32')]=function(_0x1311b2,_0xd8369e){var _0x5cfac7={},_0x22d4d3={},_0x5131ee={'count':0x0,'rows':[]};var _0x5e9ae8=_[_0x7666('0x33')](db[_0x7666('0x34')]['rawAttributes'],function(_0x18e157){return{'name':_0x18e157['fieldName'],'type':_0x18e157[_0x7666('0x35')][_0x7666('0x36')]};});_0x22d4d3[_0x7666('0x37')]=_[_0x7666('0x33')](_0x5e9ae8,'name');_0x22d4d3[_0x7666('0x38')]=_['keys'](_0x1311b2[_0x7666('0x38')]);_0x22d4d3[_0x7666('0x39')]=_[_0x7666('0x3a')](_0x22d4d3[_0x7666('0x37')],_0x22d4d3['query']);_0x5cfac7['attributes']=_[_0x7666('0x3a')](_0x22d4d3[_0x7666('0x37')],qs['fields'](_0x1311b2[_0x7666('0x38')][_0x7666('0x3b')]));_0x5cfac7['attributes']=_0x5cfac7[_0x7666('0x3c')][_0x7666('0x3d')]?_0x5cfac7[_0x7666('0x3c')]:_0x22d4d3[_0x7666('0x37')];if(!_0x1311b2[_0x7666('0x38')]['hasOwnProperty']('nolimit')){_0x5cfac7[_0x7666('0x28')]=qs[_0x7666('0x28')](_0x1311b2[_0x7666('0x38')][_0x7666('0x28')]);_0x5cfac7['offset']=qs[_0x7666('0x27')](_0x1311b2[_0x7666('0x38')]['offset']);}_0x5cfac7[_0x7666('0x3e')]=qs[_0x7666('0x3f')](_0x1311b2[_0x7666('0x38')][_0x7666('0x3f')]);_0x5cfac7[_0x7666('0x40')]=qs['filters'](_['pick'](_0x1311b2['query'],_0x22d4d3[_0x7666('0x39')]));if(_0x1311b2[_0x7666('0x38')][_0x7666('0x41')]){_0x5cfac7[_0x7666('0x40')]=_[_0x7666('0x42')](_0x5cfac7[_0x7666('0x40')],{'$or':_['map'](_0x5e9ae8,function(_0x5872d1){if(_0x5872d1[_0x7666('0x35')]!==_0x7666('0x43')){var _0x304826={};_0x304826[_0x5872d1[_0x7666('0x30')]]={'$like':'%'+_0x1311b2['query'][_0x7666('0x41')]+'%'};return _0x304826;}})});}_0x5cfac7=_[_0x7666('0x42')]({},_0x5cfac7,_0x1311b2[_0x7666('0x44')]);var _0x145105={'where':_0x5cfac7[_0x7666('0x40')]};return db[_0x7666('0x34')][_0x7666('0x26')](_0x145105)[_0x7666('0x2e')](function(_0x29750c){_0x5131ee[_0x7666('0x26')]=_0x29750c;if(_0x1311b2[_0x7666('0x38')]['includeAll']){_0x5cfac7[_0x7666('0x45')]=[{'all':!![]}];}return db[_0x7666('0x34')][_0x7666('0x46')](_0x5cfac7);})[_0x7666('0x2e')](function(_0x5a9df2){_0x5131ee[_0x7666('0x47')]=_0x5a9df2;return _0x5131ee;})[_0x7666('0x2e')](respondWithFilteredResult(_0xd8369e,_0x5cfac7))[_0x7666('0x48')](handleError(_0xd8369e,null));};exports[_0x7666('0x49')]=function(_0x814298,_0x5f07b2){var _0x2da0ea={'raw':![],'where':{'id':_0x814298[_0x7666('0x4a')]['id']}},_0x38882d={};_0x38882d[_0x7666('0x37')]=_['keys'](db['ServicenowConfiguration'][_0x7666('0x4b')]);_0x38882d[_0x7666('0x38')]=_[_0x7666('0x4c')](_0x814298[_0x7666('0x38')]);_0x38882d[_0x7666('0x39')]=_[_0x7666('0x3a')](_0x38882d[_0x7666('0x37')],_0x38882d[_0x7666('0x38')]);_0x2da0ea[_0x7666('0x3c')]=_[_0x7666('0x3a')](_0x38882d[_0x7666('0x37')],qs['fields'](_0x814298['query'][_0x7666('0x3b')]));_0x2da0ea[_0x7666('0x3c')]=_0x2da0ea[_0x7666('0x3c')][_0x7666('0x3d')]?_0x2da0ea['attributes']:_0x38882d[_0x7666('0x37')];if(_0x814298[_0x7666('0x38')][_0x7666('0x4d')]){_0x2da0ea[_0x7666('0x45')]=[{'all':!![]}];}_0x2da0ea=_['merge']({},_0x2da0ea,_0x814298[_0x7666('0x44')]);return db[_0x7666('0x34')][_0x7666('0x4e')](_0x2da0ea)[_0x7666('0x2e')](handleEntityNotFound(_0x5f07b2,null))['then'](respondWithResult(_0x5f07b2,null))[_0x7666('0x48')](handleError(_0x5f07b2,null));};exports[_0x7666('0x4f')]=function(_0xfde49b,_0x419b58){return db[_0x7666('0x34')]['create'](_0xfde49b[_0x7666('0x50')],{})['then'](respondWithResult(_0x419b58,0xc9))[_0x7666('0x48')](handleError(_0x419b58,null));};exports[_0x7666('0x2d')]=function(_0x19ed25,_0x14658e){if(_0x19ed25[_0x7666('0x50')]['id']){delete _0x19ed25[_0x7666('0x50')]['id'];}return db[_0x7666('0x34')][_0x7666('0x4e')]({'where':{'id':_0x19ed25[_0x7666('0x4a')]['id']}})[_0x7666('0x2e')](handleEntityNotFound(_0x14658e,null))['then'](saveUpdates(_0x19ed25[_0x7666('0x50')],null))['then'](respondWithResult(_0x14658e,null))[_0x7666('0x48')](handleError(_0x14658e,null));};exports[_0x7666('0x51')]=function(_0x2e13bd,_0x19188f){return db[_0x7666('0x34')][_0x7666('0x4e')]({'where':{'id':_0x2e13bd['params']['id']}})[_0x7666('0x2e')](handleEntityNotFound(_0x19188f,null))['then'](removeEntity(_0x19188f,null))['catch'](handleError(_0x19188f,null));};exports['getFields']=function(_0x55be0f,_0x1f953b,_0x56d3c8){var _0x1c730a={};var _0x1d7671={};var _0x17388b;var _0x5b6473;return db['ServicenowConfiguration'][_0x7666('0x52')]({'where':{'id':_0x55be0f['params']['id']}})[_0x7666('0x2e')](handleEntityNotFound(_0x1f953b,null))[_0x7666('0x2e')](function(_0x70d5a7){if(_0x70d5a7){_0x17388b=_0x70d5a7;_0x1d7671['model']=_[_0x7666('0x4c')](db[_0x7666('0x53')][_0x7666('0x4b')]);_0x1d7671['query']=_['keys'](_0x55be0f[_0x7666('0x38')]);_0x1d7671[_0x7666('0x39')]=_[_0x7666('0x3a')](_0x1d7671[_0x7666('0x37')],_0x1d7671[_0x7666('0x38')]);_0x1c730a['attributes']=_[_0x7666('0x3a')](_0x1d7671[_0x7666('0x37')],qs[_0x7666('0x3b')](_0x55be0f[_0x7666('0x38')][_0x7666('0x3b')]));_0x1c730a['attributes']=_0x1c730a[_0x7666('0x3c')]['length']?_0x1c730a[_0x7666('0x3c')]:_0x1d7671[_0x7666('0x37')];_0x1c730a[_0x7666('0x3e')]=qs[_0x7666('0x3f')](_0x55be0f[_0x7666('0x38')]['sort']);_0x1c730a[_0x7666('0x40')]=qs[_0x7666('0x39')](_[_0x7666('0x54')](_0x55be0f[_0x7666('0x38')],_0x1d7671['filters']));if(_0x55be0f[_0x7666('0x38')]['filter']){_0x1c730a['where']=_[_0x7666('0x42')](_0x1c730a[_0x7666('0x40')],{'$or':_['map'](_0x1c730a[_0x7666('0x3c')],function(_0x1457dc){var _0x53cb10={};_0x53cb10[_0x1457dc]={'$like':'%'+_0x55be0f[_0x7666('0x38')][_0x7666('0x41')]+'%'};return _0x53cb10;})});}_0x1c730a=_['merge']({},_0x1c730a,_0x55be0f['options']);return _0x17388b[_0x7666('0x55')](_0x1c730a);}})[_0x7666('0x2e')](function(_0x21e8cc){if(_0x21e8cc){_0x5b6473=_0x21e8cc['length'];if(!_0x55be0f['query'][_0x7666('0x56')](_0x7666('0x57'))){_0x1c730a[_0x7666('0x28')]=qs['limit'](_0x55be0f[_0x7666('0x38')][_0x7666('0x28')]);_0x1c730a[_0x7666('0x27')]=qs[_0x7666('0x27')](_0x55be0f[_0x7666('0x38')][_0x7666('0x27')]);}return _0x17388b[_0x7666('0x55')](_0x1c730a);}})[_0x7666('0x2e')](function(_0x3a8750){if(_0x3a8750){return _0x3a8750?{'count':_0x5b6473,'rows':_0x3a8750}:null;}})[_0x7666('0x2e')](respondWithResult(_0x1f953b,null))[_0x7666('0x48')](handleError(_0x1f953b,null));};exports['getSubjects']=function(_0x2039a4,_0x5a7df7,_0x4f5899){var _0x16c221={};var _0x1b6559={};var _0x4d139b;var _0x486166;return db[_0x7666('0x34')]['findOne']({'where':{'id':_0x2039a4[_0x7666('0x4a')]['id']}})[_0x7666('0x2e')](handleEntityNotFound(_0x5a7df7,null))['then'](function(_0x3d2b13){if(_0x3d2b13){_0x4d139b=_0x3d2b13;_0x1b6559[_0x7666('0x37')]=_[_0x7666('0x4c')](db[_0x7666('0x53')]['rawAttributes']);_0x1b6559['query']=_[_0x7666('0x4c')](_0x2039a4['query']);_0x1b6559['filters']=_[_0x7666('0x3a')](_0x1b6559['model'],_0x1b6559[_0x7666('0x38')]);_0x16c221[_0x7666('0x3c')]=_[_0x7666('0x3a')](_0x1b6559[_0x7666('0x37')],qs[_0x7666('0x3b')](_0x2039a4[_0x7666('0x38')][_0x7666('0x3b')]));_0x16c221[_0x7666('0x3c')]=_0x16c221[_0x7666('0x3c')][_0x7666('0x3d')]?_0x16c221['attributes']:_0x1b6559[_0x7666('0x37')];_0x16c221[_0x7666('0x3e')]=qs[_0x7666('0x3f')](_0x2039a4[_0x7666('0x38')][_0x7666('0x3f')]);_0x16c221[_0x7666('0x40')]=qs['filters'](_[_0x7666('0x54')](_0x2039a4[_0x7666('0x38')],_0x1b6559[_0x7666('0x39')]));if(_0x2039a4[_0x7666('0x38')]['filter']){_0x16c221[_0x7666('0x40')]=_['merge'](_0x16c221[_0x7666('0x40')],{'$or':_[_0x7666('0x33')](_0x16c221['attributes'],function(_0x26949a){var _0x4a6d21={};_0x4a6d21[_0x26949a]={'$like':'%'+_0x2039a4[_0x7666('0x38')]['filter']+'%'};return _0x4a6d21;})});}_0x16c221=_['merge']({},_0x16c221,_0x2039a4['options']);return _0x4d139b[_0x7666('0x58')](_0x16c221);}})['then'](function(_0x402a3f){if(_0x402a3f){_0x486166=_0x402a3f[_0x7666('0x3d')];if(!_0x2039a4[_0x7666('0x38')]['hasOwnProperty'](_0x7666('0x57'))){_0x16c221[_0x7666('0x28')]=qs[_0x7666('0x28')](_0x2039a4[_0x7666('0x38')]['limit']);_0x16c221['offset']=qs[_0x7666('0x27')](_0x2039a4['query'][_0x7666('0x27')]);}return _0x4d139b[_0x7666('0x58')](_0x16c221);}})[_0x7666('0x2e')](function(_0x511171){if(_0x511171){return _0x511171?{'count':_0x486166,'rows':_0x511171}:null;}})[_0x7666('0x2e')](respondWithResult(_0x5a7df7,null))[_0x7666('0x48')](handleError(_0x5a7df7,null));};exports[_0x7666('0x59')]=function(_0x4c5aff,_0x5d1cc3,_0x59e33e){var _0x1d263c={};var _0x950c5f={};var _0x4435d4;var _0x44d3d1;return db[_0x7666('0x34')][_0x7666('0x52')]({'where':{'id':_0x4c5aff[_0x7666('0x4a')]['id']}})[_0x7666('0x2e')](handleEntityNotFound(_0x5d1cc3,null))[_0x7666('0x2e')](function(_0x2a52c9){if(_0x2a52c9){_0x4435d4=_0x2a52c9;_0x950c5f[_0x7666('0x37')]=_[_0x7666('0x4c')](db[_0x7666('0x53')][_0x7666('0x4b')]);_0x950c5f['query']=_[_0x7666('0x4c')](_0x4c5aff[_0x7666('0x38')]);_0x950c5f[_0x7666('0x39')]=_[_0x7666('0x3a')](_0x950c5f[_0x7666('0x37')],_0x950c5f['query']);_0x1d263c[_0x7666('0x3c')]=_['intersection'](_0x950c5f[_0x7666('0x37')],qs[_0x7666('0x3b')](_0x4c5aff['query']['fields']));_0x1d263c['attributes']=_0x1d263c[_0x7666('0x3c')][_0x7666('0x3d')]?_0x1d263c['attributes']:_0x950c5f[_0x7666('0x37')];_0x1d263c[_0x7666('0x3e')]=qs[_0x7666('0x3f')](_0x4c5aff[_0x7666('0x38')][_0x7666('0x3f')]);_0x1d263c['where']=qs[_0x7666('0x39')](_[_0x7666('0x54')](_0x4c5aff[_0x7666('0x38')],_0x950c5f[_0x7666('0x39')]));if(_0x4c5aff[_0x7666('0x38')][_0x7666('0x41')]){_0x1d263c[_0x7666('0x40')]=_['merge'](_0x1d263c[_0x7666('0x40')],{'$or':_[_0x7666('0x33')](_0x1d263c['attributes'],function(_0x5cee58){var _0x1bcfda={};_0x1bcfda[_0x5cee58]={'$like':'%'+_0x4c5aff[_0x7666('0x38')]['filter']+'%'};return _0x1bcfda;})});}_0x1d263c=_['merge']({},_0x1d263c,_0x4c5aff[_0x7666('0x44')]);return _0x4435d4[_0x7666('0x59')](_0x1d263c);}})[_0x7666('0x2e')](function(_0x107384){if(_0x107384){_0x44d3d1=_0x107384[_0x7666('0x3d')];if(!_0x4c5aff[_0x7666('0x38')][_0x7666('0x56')](_0x7666('0x57'))){_0x1d263c[_0x7666('0x28')]=qs[_0x7666('0x28')](_0x4c5aff[_0x7666('0x38')][_0x7666('0x28')]);_0x1d263c[_0x7666('0x27')]=qs[_0x7666('0x27')](_0x4c5aff['query'][_0x7666('0x27')]);}return _0x4435d4[_0x7666('0x59')](_0x1d263c);}})[_0x7666('0x2e')](function(_0x740b6b){if(_0x740b6b){return _0x740b6b?{'count':_0x44d3d1,'rows':_0x740b6b}:null;}})[_0x7666('0x2e')](respondWithResult(_0x5d1cc3,null))['catch'](handleError(_0x5d1cc3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index f352c16..7c6ed82 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4743=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','int_servicenow_configurations','lodash'];(function(_0x423b75,_0x56bea4){var _0x4552ff=function(_0x43500c){while(--_0x43500c){_0x423b75['push'](_0x423b75['shift']());}};_0x4552ff(++_0x56bea4);}(_0x4743,0xdb));var _0x3474=function(_0x1a7276,_0x4d3e59){_0x1a7276=_0x1a7276-0x0;var _0x163cbb=_0x4743[_0x1a7276];return _0x163cbb;};'use strict';var _=require(_0x3474('0x0'));var util=require(_0x3474('0x1'));var logger=require(_0x3474('0x2'))(_0x3474('0x3'));var moment=require('moment');var BPromise=require(_0x3474('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3474('0x5'));var config=require(_0x3474('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x3474('0x7')]=function(_0x554145,_0x19678c){return _0x554145[_0x3474('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x3474('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5aba=['int_servicenow_configurations','lodash','api','bluebird','path','rimraf','../../config/environment','define'];(function(_0x45f06a,_0x2d6e27){var _0x381af5=function(_0x500942){while(--_0x500942){_0x45f06a['push'](_0x45f06a['shift']());}};_0x381af5(++_0x2d6e27);}(_0x5aba,0x69));var _0xa5ab=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x5aba[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0xa5ab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa5ab('0x1'));var moment=require('moment');var BPromise=require(_0xa5ab('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5ab('0x3'));var rimraf=require(_0xa5ab('0x4'));var config=require(_0xa5ab('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x558059,_0x54ec58){return _0x558059[_0xa5ab('0x6')]('ServicenowConfiguration',attributes,{'tableName':_0xa5ab('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index d3ebd44..2f169d5 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd281=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x392b4d,_0x4e28f1){var _0x139c92=function(_0x5a4cc5){while(--_0x5a4cc5){_0x392b4d['push'](_0x392b4d['shift']());}};_0x139c92(++_0x4e28f1);}(_0xd281,0x70));var _0x1d28=function(_0x3c94e5,_0x2f07c1){_0x3c94e5=_0x3c94e5-0x0;var _0x3ae717=_0xd281[_0x3c94e5];return _0x3ae717;};'use strict';var _=require('lodash');var util=require(_0x1d28('0x0'));var moment=require(_0x1d28('0x1'));var BPromise=require(_0x1d28('0x2'));var rs=require(_0x1d28('0x3'));var fs=require('fs');var Redis=require(_0x1d28('0x4'));var db=require(_0x1d28('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d28('0x6'))(_0x1d28('0x7'));var config=require('../../config/environment');var jayson=require(_0x1d28('0x8'));var client=jayson['client'][_0x1d28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12a62d,_0x47b14f,_0x4236cb){return new BPromise(function(_0x41d88c,_0x32f631){return client['request'](_0x12a62d,_0x4236cb)[_0x1d28('0xa')](function(_0x3de6aa){logger[_0x1d28('0xb')](_0x1d28('0xc'),_0x47b14f,_0x1d28('0xd'));logger[_0x1d28('0xe')](_0x1d28('0xf'),_0x47b14f,_0x1d28('0xd'),JSON[_0x1d28('0x10')](_0x3de6aa));if(_0x3de6aa[_0x1d28('0x11')]){if(_0x3de6aa[_0x1d28('0x11')][_0x1d28('0x12')]===0x1f4){logger[_0x1d28('0x11')](_0x1d28('0xc'),_0x47b14f,_0x3de6aa[_0x1d28('0x11')]['message']);return _0x32f631(_0x3de6aa[_0x1d28('0x11')][_0x1d28('0x13')]);}logger[_0x1d28('0x11')](_0x1d28('0xc'),_0x47b14f,_0x3de6aa[_0x1d28('0x11')][_0x1d28('0x13')]);return _0x41d88c(_0x3de6aa[_0x1d28('0x11')][_0x1d28('0x13')]);}else{logger[_0x1d28('0xb')](_0x1d28('0xc'),_0x47b14f,_0x1d28('0xd'));_0x41d88c(_0x3de6aa['result'][_0x1d28('0x13')]);}})[_0x1d28('0x14')](function(_0x4db569){logger[_0x1d28('0x11')](_0x1d28('0xc'),_0x47b14f,_0x4db569);_0x32f631(_0x4db569);});});} \ No newline at end of file +var _0xf1bf=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xf1bf,0x1f4));var _0xff1b=function(_0x1cbb2d,_0x14d41d){_0x1cbb2d=_0x1cbb2d-0x0;var _0x3daa20=_0xf1bf[_0x1cbb2d];return _0x3daa20;};'use strict';var _=require(_0xff1b('0x0'));var util=require(_0xff1b('0x1'));var moment=require(_0xff1b('0x2'));var BPromise=require(_0xff1b('0x3'));var rs=require(_0xff1b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xff1b('0x5'));var logger=require(_0xff1b('0x6'))(_0xff1b('0x7'));var config=require(_0xff1b('0x8'));var jayson=require(_0xff1b('0x9'));var client=jayson['client'][_0xff1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x262b87,_0x2e2851,_0x3b86ec){return new BPromise(function(_0x28c8ea,_0x100520){return client[_0xff1b('0xb')](_0x262b87,_0x3b86ec)[_0xff1b('0xc')](function(_0x191d16){logger[_0xff1b('0xd')](_0xff1b('0xe'),_0x2e2851,_0xff1b('0xf'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2e2851,_0xff1b('0xf'),JSON[_0xff1b('0x10')](_0x191d16));if(_0x191d16[_0xff1b('0x11')]){if(_0x191d16[_0xff1b('0x11')][_0xff1b('0x12')]===0x1f4){logger[_0xff1b('0x11')](_0xff1b('0xe'),_0x2e2851,_0x191d16['error'][_0xff1b('0x13')]);return _0x100520(_0x191d16[_0xff1b('0x11')]['message']);}logger[_0xff1b('0x11')](_0xff1b('0xe'),_0x2e2851,_0x191d16[_0xff1b('0x11')]['message']);return _0x28c8ea(_0x191d16[_0xff1b('0x11')][_0xff1b('0x13')]);}else{logger[_0xff1b('0xd')](_0xff1b('0xe'),_0x2e2851,_0xff1b('0xf'));_0x28c8ea(_0x191d16[_0xff1b('0x14')][_0xff1b('0x13')]);}})[_0xff1b('0x15')](function(_0x26ccc0){logger[_0xff1b('0x11')](_0xff1b('0xe'),_0x2e2851,_0x26ccc0);_0x100520(_0x26ccc0);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 78d6618..c70d766 100644 --- a/server/api/intServicenowField/index.js +++ b/server/api/intServicenowField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x427f=['index','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','./intServicenowField.controller','get','isAuthenticated'];(function(_0x4dd49c,_0x3fb62b){var _0x4b76f1=function(_0xb60f76){while(--_0xb60f76){_0x4dd49c['push'](_0x4dd49c['shift']());}};_0x4b76f1(++_0x3fb62b);}(_0x427f,0x133));var _0xf427=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x427f[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0xf427('0x0'));var util=require(_0xf427('0x1'));var path=require(_0xf427('0x2'));var timeout=require(_0xf427('0x3'));var express=require(_0xf427('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf427('0x5'));router[_0xf427('0x6')]('/',auth[_0xf427('0x7')](),controller[_0xf427('0x8')]);router[_0xf427('0x6')](_0xf427('0x9'),auth[_0xf427('0x7')](),controller[_0xf427('0xa')]);router['post']('/',auth[_0xf427('0x7')](),controller['create']);router[_0xf427('0xb')](_0xf427('0x9'),auth[_0xf427('0x7')](),controller[_0xf427('0xc')]);router[_0xf427('0xd')](_0xf427('0x9'),auth[_0xf427('0x7')](),controller[_0xf427('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe03f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x229d52,_0x3de6df){var _0x4df51f=function(_0x356a62){while(--_0x356a62){_0x229d52['push'](_0x229d52['shift']());}};_0x4df51f(++_0x3de6df);}(_0xe03f,0x10d));var _0xfe03=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe03f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xfe03('0x0'));var util=require(_0xfe03('0x1'));var path=require(_0xfe03('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe03('0x3'));var router=express[_0xfe03('0x4')]();var auth=require(_0xfe03('0x5'));var interaction=require(_0xfe03('0x6'));var config=require(_0xfe03('0x7'));var controller=require(_0xfe03('0x8'));router[_0xfe03('0x9')]('/',auth[_0xfe03('0xa')](),controller[_0xfe03('0xb')]);router[_0xfe03('0x9')](_0xfe03('0xc'),auth[_0xfe03('0xa')](),controller[_0xfe03('0xd')]);router[_0xfe03('0xe')]('/',auth[_0xfe03('0xa')](),controller[_0xfe03('0xf')]);router[_0xfe03('0x10')](_0xfe03('0xc'),auth[_0xfe03('0xa')](),controller[_0xfe03('0x11')]);router[_0xfe03('0x12')](_0xfe03('0xc'),auth[_0xfe03('0xa')](),controller[_0xfe03('0x13')]);module[_0xfe03('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index d8bb394..6f6baeb 100644 --- a/server/api/intServicenowField/intServicenowField.attributes.js +++ b/server/api/intServicenowField/intServicenowField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f11=['string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3f11,0x1a5));var _0x13f1=function(_0x5e804b,_0x242732){_0x5e804b=_0x5e804b-0x0;var _0x116e07=_0x3f11[_0x5e804b];return _0x116e07;};'use strict';var Sequelize=require(_0x13f1('0x0'));module[_0x13f1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x13f1('0x2'),_0x13f1('0x3'),_0x13f1('0x4'),_0x13f1('0x5')),'defaultValue':_0x13f1('0x2')},'content':{'type':Sequelize[_0x13f1('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x13f1('0x7')](_0x13f1('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x13f1('0x6')]},'idField':{'type':Sequelize[_0x13f1('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x13f1('0x6')]}}; \ No newline at end of file +var _0x22b3=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x29f9eb,_0x532a26){var _0x41ff70=function(_0x7e298c){while(--_0x7e298c){_0x29f9eb['push'](_0x29f9eb['shift']());}};_0x41ff70(++_0x532a26);}(_0x22b3,0x189));var _0x322b=function(_0x53910a,_0x75d8c2){_0x53910a=_0x53910a-0x0;var _0x49b070=_0x22b3[_0x53910a];return _0x49b070;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x322b('0x0')](_0x322b('0x1'),_0x322b('0x2'),_0x322b('0x3'),_0x322b('0x4')),'defaultValue':_0x322b('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x322b('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x322b('0x1'),_0x322b('0x2'),_0x322b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x322b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x322b('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index f36c63f..4d2be51 100644 --- a/server/api/intServicenowField/intServicenowField.controller.js +++ b/server/api/intServicenowField/intServicenowField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d37=['params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','save','then','destroy','error','stack','name','send','index','map','ServicenowField','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','catch','show','keys','rawAttributes','find','create','body','update'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0x8d37,0x1d5));var _0x78d3=function(_0x4e095e,_0x19730c){_0x4e095e=_0x4e095e-0x0;var _0x239b9b=_0x8d37[_0x4e095e];return _0x239b9b;};'use strict';var pdf=require(_0x78d3('0x0'));var emlformat=require(_0x78d3('0x1'));var rimraf=require(_0x78d3('0x2'));var zipdir=require(_0x78d3('0x3'));var jsonpatch=require(_0x78d3('0x4'));var rp=require('request-promise');var moment=require(_0x78d3('0x5'));var BPromise=require(_0x78d3('0x6'));var Mustache=require(_0x78d3('0x7'));var util=require(_0x78d3('0x8'));var path=require(_0x78d3('0x9'));var sox=require(_0x78d3('0xa'));var csv=require(_0x78d3('0xb'));var ejs=require(_0x78d3('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x78d3('0xd'));var crypto=require(_0x78d3('0xe'));var jsforce=require(_0x78d3('0xf'));var deskjs=require(_0x78d3('0x10'));var toCsv=require(_0x78d3('0xb'));var querystring=require(_0x78d3('0x11'));var Papa=require(_0x78d3('0x12'));var Redis=require(_0x78d3('0x13'));var authService=require(_0x78d3('0x14'));var qs=require(_0x78d3('0x15'));var as=require(_0x78d3('0x16'));var hardwareService=require(_0x78d3('0x17'));var logger=require(_0x78d3('0x18'))(_0x78d3('0x19'));var utils=require(_0x78d3('0x1a'));var config=require(_0x78d3('0x1b'));var db=require(_0x78d3('0x1c'))['db'];function respondWithStatusCode(_0x4d229a,_0x57c685){_0x57c685=_0x57c685||0xcc;return function(_0x3c5e07){if(_0x3c5e07){return _0x4d229a[_0x78d3('0x1d')](_0x57c685);}return _0x4d229a['status'](_0x57c685)[_0x78d3('0x1e')]();};}function respondWithResult(_0x4e8970,_0x3de55b){_0x3de55b=_0x3de55b||0xc8;return function(_0x1ca726){if(_0x1ca726){return _0x4e8970[_0x78d3('0x1f')](_0x3de55b)[_0x78d3('0x20')](_0x1ca726);}};}function respondWithFilteredResult(_0x3f0421,_0x3835fc){return function(_0x2a88aa){if(_0x2a88aa){var _0x3fe932=_0x2a88aa['count'],_0x516657=_0x3835fc[_0x78d3('0x21')],_0x189afc=_0x3835fc[_0x78d3('0x21')]+_0x3835fc[_0x78d3('0x22')],_0x163e72;if(_0x189afc>=_0x3fe932){_0x189afc=_0x3fe932;_0x163e72=0xc8;}else{_0x163e72=0xce;}_0x3f0421[_0x78d3('0x1f')](_0x163e72);return _0x3f0421[_0x78d3('0x23')]('Content-Range',_0x516657+'-'+_0x189afc+'/'+_0x3fe932)[_0x78d3('0x20')](_0x2a88aa);}return null;};}function patchUpdates(_0x151352){return function(_0x2c944c){try{jsonpatch[_0x78d3('0x24')](_0x2c944c,_0x151352,!![]);}catch(_0x2e9783){return BPromise['reject'](_0x2e9783);}return _0x2c944c[_0x78d3('0x25')]();};}function saveUpdates(_0x44312d,_0x2fa1a9){return function(_0x2c0e28){if(_0x2c0e28){return _0x2c0e28['update'](_0x44312d)[_0x78d3('0x26')](function(_0x5a48e0){return _0x5a48e0;});}return null;};}function removeEntity(_0x4e947e,_0x48612e){return function(_0x4d3ebd){if(_0x4d3ebd){return _0x4d3ebd[_0x78d3('0x27')]()[_0x78d3('0x26')](function(){_0x4e947e['status'](0xcc)[_0x78d3('0x1e')]();});}};}function handleEntityNotFound(_0x3ef49b,_0x34594f){return function(_0x317f67){if(!_0x317f67){_0x3ef49b['sendStatus'](0x194);}return _0x317f67;};}function handleError(_0x43192e,_0x23376c){_0x23376c=_0x23376c||0x1f4;return function(_0x261065){logger[_0x78d3('0x28')](_0x261065[_0x78d3('0x29')]);if(_0x261065[_0x78d3('0x2a')]){delete _0x261065['name'];}_0x43192e[_0x78d3('0x1f')](_0x23376c)[_0x78d3('0x2b')](_0x261065);};}exports[_0x78d3('0x2c')]=function(_0x23b040,_0x1ecc1b){var _0x2ac8e8={},_0x28a5f2={},_0x5f414e={'count':0x0,'rows':[]};var _0x52291a=_[_0x78d3('0x2d')](db[_0x78d3('0x2e')]['rawAttributes'],function(_0x2970e4){return{'name':_0x2970e4[_0x78d3('0x2f')],'type':_0x2970e4[_0x78d3('0x30')][_0x78d3('0x31')]};});_0x28a5f2[_0x78d3('0x32')]=_['map'](_0x52291a,'name');_0x28a5f2[_0x78d3('0x33')]=_['keys'](_0x23b040['query']);_0x28a5f2['filters']=_[_0x78d3('0x34')](_0x28a5f2['model'],_0x28a5f2[_0x78d3('0x33')]);_0x2ac8e8[_0x78d3('0x35')]=_[_0x78d3('0x34')](_0x28a5f2[_0x78d3('0x32')],qs['fields'](_0x23b040[_0x78d3('0x33')][_0x78d3('0x36')]));_0x2ac8e8[_0x78d3('0x35')]=_0x2ac8e8[_0x78d3('0x35')][_0x78d3('0x37')]?_0x2ac8e8['attributes']:_0x28a5f2[_0x78d3('0x32')];if(!_0x23b040[_0x78d3('0x33')]['hasOwnProperty'](_0x78d3('0x38'))){_0x2ac8e8[_0x78d3('0x22')]=qs['limit'](_0x23b040[_0x78d3('0x33')][_0x78d3('0x22')]);_0x2ac8e8[_0x78d3('0x21')]=qs['offset'](_0x23b040[_0x78d3('0x33')][_0x78d3('0x21')]);}_0x2ac8e8[_0x78d3('0x39')]=qs[_0x78d3('0x3a')](_0x23b040[_0x78d3('0x33')]['sort']);_0x2ac8e8['where']=qs[_0x78d3('0x3b')](_[_0x78d3('0x3c')](_0x23b040['query'],_0x28a5f2['filters']));if(_0x23b040[_0x78d3('0x33')][_0x78d3('0x3d')]){_0x2ac8e8[_0x78d3('0x3e')]=_[_0x78d3('0x3f')](_0x2ac8e8[_0x78d3('0x3e')],{'$or':_['map'](_0x52291a,function(_0x3284c9){if(_0x3284c9[_0x78d3('0x30')]!==_0x78d3('0x40')){var _0x5a8d56={};_0x5a8d56[_0x3284c9[_0x78d3('0x2a')]]={'$like':'%'+_0x23b040[_0x78d3('0x33')][_0x78d3('0x3d')]+'%'};return _0x5a8d56;}})});}_0x2ac8e8=_[_0x78d3('0x3f')]({},_0x2ac8e8,_0x23b040[_0x78d3('0x41')]);var _0xbf7d03={'where':_0x2ac8e8[_0x78d3('0x3e')]};return db[_0x78d3('0x2e')][_0x78d3('0x42')](_0xbf7d03)['then'](function(_0xe1012){_0x5f414e[_0x78d3('0x42')]=_0xe1012;if(_0x23b040[_0x78d3('0x33')][_0x78d3('0x43')]){_0x2ac8e8[_0x78d3('0x44')]=[{'all':!![]}];}return db[_0x78d3('0x2e')]['findAll'](_0x2ac8e8);})['then'](function(_0x3a40e0){_0x5f414e['rows']=_0x3a40e0;return _0x5f414e;})[_0x78d3('0x26')](respondWithFilteredResult(_0x1ecc1b,_0x2ac8e8))[_0x78d3('0x45')](handleError(_0x1ecc1b,null));};exports[_0x78d3('0x46')]=function(_0x19cfee,_0x1d44bf){var _0x5b921={'raw':!![],'where':{'id':_0x19cfee['params']['id']}},_0x49e7eb={};_0x49e7eb[_0x78d3('0x32')]=_[_0x78d3('0x47')](db[_0x78d3('0x2e')][_0x78d3('0x48')]);_0x49e7eb[_0x78d3('0x33')]=_[_0x78d3('0x47')](_0x19cfee['query']);_0x49e7eb[_0x78d3('0x3b')]=_['intersection'](_0x49e7eb[_0x78d3('0x32')],_0x49e7eb[_0x78d3('0x33')]);_0x5b921[_0x78d3('0x35')]=_[_0x78d3('0x34')](_0x49e7eb[_0x78d3('0x32')],qs[_0x78d3('0x36')](_0x19cfee[_0x78d3('0x33')][_0x78d3('0x36')]));_0x5b921[_0x78d3('0x35')]=_0x5b921[_0x78d3('0x35')][_0x78d3('0x37')]?_0x5b921[_0x78d3('0x35')]:_0x49e7eb[_0x78d3('0x32')];if(_0x19cfee[_0x78d3('0x33')][_0x78d3('0x43')]){_0x5b921[_0x78d3('0x44')]=[{'all':!![]}];}_0x5b921=_['merge']({},_0x5b921,_0x19cfee[_0x78d3('0x41')]);return db[_0x78d3('0x2e')][_0x78d3('0x49')](_0x5b921)['then'](handleEntityNotFound(_0x1d44bf,null))[_0x78d3('0x26')](respondWithResult(_0x1d44bf,null))[_0x78d3('0x45')](handleError(_0x1d44bf,null));};exports[_0x78d3('0x4a')]=function(_0x45d4cd,_0x123f4d){return db[_0x78d3('0x2e')][_0x78d3('0x4a')](_0x45d4cd[_0x78d3('0x4b')],{})[_0x78d3('0x26')](respondWithResult(_0x123f4d,0xc9))[_0x78d3('0x45')](handleError(_0x123f4d,null));};exports[_0x78d3('0x4c')]=function(_0x2d5a79,_0x654c86){if(_0x2d5a79[_0x78d3('0x4b')]['id']){delete _0x2d5a79[_0x78d3('0x4b')]['id'];}return db[_0x78d3('0x2e')][_0x78d3('0x49')]({'where':{'id':_0x2d5a79[_0x78d3('0x4d')]['id']}})[_0x78d3('0x26')](handleEntityNotFound(_0x654c86,null))['then'](saveUpdates(_0x2d5a79[_0x78d3('0x4b')],null))[_0x78d3('0x26')](respondWithResult(_0x654c86,null))[_0x78d3('0x45')](handleError(_0x654c86,null));};exports[_0x78d3('0x27')]=function(_0x3dc768,_0x33de46){return db['ServicenowField'][_0x78d3('0x49')]({'where':{'id':_0x3dc768[_0x78d3('0x4d')]['id']}})[_0x78d3('0x26')](handleEntityNotFound(_0x33de46,null))[_0x78d3('0x26')](removeEntity(_0x33de46,null))[_0x78d3('0x45')](handleError(_0x33de46,null));}; \ No newline at end of file +var _0x5a2a=['pick','filter','merge','where','VIRTUAL','options','count','findAll','rows','show','params','filters','includeAll','include','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','name','index','map','ServicenowField','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x547c0c,_0x1ad3a3){var _0x466c09=function(_0x55c3d4){while(--_0x55c3d4){_0x547c0c['push'](_0x547c0c['shift']());}};_0x466c09(++_0x1ad3a3);}(_0x5a2a,0xaa));var _0xa5a2=function(_0x506715,_0xb8928f){_0x506715=_0x506715-0x0;var _0x4c2c2b=_0x5a2a[_0x506715];return _0x4c2c2b;};'use strict';var pdf=require(_0xa5a2('0x0'));var emlformat=require(_0xa5a2('0x1'));var rimraf=require(_0xa5a2('0x2'));var zipdir=require(_0xa5a2('0x3'));var jsonpatch=require(_0xa5a2('0x4'));var rp=require(_0xa5a2('0x5'));var moment=require(_0xa5a2('0x6'));var BPromise=require(_0xa5a2('0x7'));var Mustache=require(_0xa5a2('0x8'));var util=require('util');var path=require(_0xa5a2('0x9'));var sox=require(_0xa5a2('0xa'));var csv=require(_0xa5a2('0xb'));var ejs=require(_0xa5a2('0xc'));var fs=require('fs');var _=require(_0xa5a2('0xd'));var squel=require(_0xa5a2('0xe'));var crypto=require(_0xa5a2('0xf'));var jsforce=require(_0xa5a2('0x10'));var deskjs=require(_0xa5a2('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa5a2('0x12'));var Redis=require(_0xa5a2('0x13'));var authService=require(_0xa5a2('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa5a2('0x15'));var hardwareService=require(_0xa5a2('0x16'));var logger=require(_0xa5a2('0x17'))(_0xa5a2('0x18'));var utils=require('../../config/utils');var config=require(_0xa5a2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bffa7,_0x81faf2){_0x81faf2=_0x81faf2||0xcc;return function(_0x34c596){if(_0x34c596){return _0x5bffa7[_0xa5a2('0x1a')](_0x81faf2);}return _0x5bffa7[_0xa5a2('0x1b')](_0x81faf2)['end']();};}function respondWithResult(_0x37f921,_0x2f011e){_0x2f011e=_0x2f011e||0xc8;return function(_0xbc2de){if(_0xbc2de){return _0x37f921[_0xa5a2('0x1b')](_0x2f011e)[_0xa5a2('0x1c')](_0xbc2de);}};}function respondWithFilteredResult(_0x1c582e,_0x2e0a9f){return function(_0x22013a){if(_0x22013a){var _0x5cc8ef=_0x22013a['count'],_0x2540c4=_0x2e0a9f[_0xa5a2('0x1d')],_0x6a1181=_0x2e0a9f['offset']+_0x2e0a9f[_0xa5a2('0x1e')],_0x6c1a9c;if(_0x6a1181>=_0x5cc8ef){_0x6a1181=_0x5cc8ef;_0x6c1a9c=0xc8;}else{_0x6c1a9c=0xce;}_0x1c582e[_0xa5a2('0x1b')](_0x6c1a9c);return _0x1c582e['set'](_0xa5a2('0x1f'),_0x2540c4+'-'+_0x6a1181+'/'+_0x5cc8ef)['json'](_0x22013a);}return null;};}function patchUpdates(_0x58c682){return function(_0x22afba){try{jsonpatch[_0xa5a2('0x20')](_0x22afba,_0x58c682,!![]);}catch(_0x2c215a){return BPromise[_0xa5a2('0x21')](_0x2c215a);}return _0x22afba[_0xa5a2('0x22')]();};}function saveUpdates(_0x6671ce,_0x5520d3){return function(_0x3e8aea){if(_0x3e8aea){return _0x3e8aea[_0xa5a2('0x23')](_0x6671ce)[_0xa5a2('0x24')](function(_0x565a65){return _0x565a65;});}return null;};}function removeEntity(_0xd9be94,_0x529b2d){return function(_0x5ebfbf){if(_0x5ebfbf){return _0x5ebfbf[_0xa5a2('0x25')]()[_0xa5a2('0x24')](function(){_0xd9be94[_0xa5a2('0x1b')](0xcc)[_0xa5a2('0x26')]();});}};}function handleEntityNotFound(_0x3f983a,_0x253cad){return function(_0x35e690){if(!_0x35e690){_0x3f983a[_0xa5a2('0x1a')](0x194);}return _0x35e690;};}function handleError(_0x32ff48,_0x57c6c1){_0x57c6c1=_0x57c6c1||0x1f4;return function(_0x4553b0){logger['error'](_0x4553b0['stack']);if(_0x4553b0[_0xa5a2('0x27')]){delete _0x4553b0[_0xa5a2('0x27')];}_0x32ff48[_0xa5a2('0x1b')](_0x57c6c1)['send'](_0x4553b0);};}exports[_0xa5a2('0x28')]=function(_0x1f0885,_0x13533b){var _0x303262={},_0x3daaa4={},_0x25066a={'count':0x0,'rows':[]};var _0x5755a3=_[_0xa5a2('0x29')](db[_0xa5a2('0x2a')][_0xa5a2('0x2b')],function(_0x5d5c2b){return{'name':_0x5d5c2b[_0xa5a2('0x2c')],'type':_0x5d5c2b[_0xa5a2('0x2d')][_0xa5a2('0x2e')]};});_0x3daaa4['model']=_[_0xa5a2('0x29')](_0x5755a3,_0xa5a2('0x27'));_0x3daaa4['query']=_[_0xa5a2('0x2f')](_0x1f0885[_0xa5a2('0x30')]);_0x3daaa4['filters']=_[_0xa5a2('0x31')](_0x3daaa4['model'],_0x3daaa4[_0xa5a2('0x30')]);_0x303262['attributes']=_['intersection'](_0x3daaa4[_0xa5a2('0x32')],qs[_0xa5a2('0x33')](_0x1f0885[_0xa5a2('0x30')][_0xa5a2('0x33')]));_0x303262[_0xa5a2('0x34')]=_0x303262['attributes'][_0xa5a2('0x35')]?_0x303262[_0xa5a2('0x34')]:_0x3daaa4[_0xa5a2('0x32')];if(!_0x1f0885['query'][_0xa5a2('0x36')](_0xa5a2('0x37'))){_0x303262[_0xa5a2('0x1e')]=qs['limit'](_0x1f0885[_0xa5a2('0x30')]['limit']);_0x303262[_0xa5a2('0x1d')]=qs[_0xa5a2('0x1d')](_0x1f0885['query'][_0xa5a2('0x1d')]);}_0x303262[_0xa5a2('0x38')]=qs['sort'](_0x1f0885[_0xa5a2('0x30')][_0xa5a2('0x39')]);_0x303262['where']=qs['filters'](_[_0xa5a2('0x3a')](_0x1f0885[_0xa5a2('0x30')],_0x3daaa4['filters']));if(_0x1f0885[_0xa5a2('0x30')][_0xa5a2('0x3b')]){_0x303262['where']=_[_0xa5a2('0x3c')](_0x303262[_0xa5a2('0x3d')],{'$or':_[_0xa5a2('0x29')](_0x5755a3,function(_0x1080e1){if(_0x1080e1['type']!==_0xa5a2('0x3e')){var _0x432aa6={};_0x432aa6[_0x1080e1[_0xa5a2('0x27')]]={'$like':'%'+_0x1f0885[_0xa5a2('0x30')]['filter']+'%'};return _0x432aa6;}})});}_0x303262=_[_0xa5a2('0x3c')]({},_0x303262,_0x1f0885[_0xa5a2('0x3f')]);var _0xeaeb41={'where':_0x303262[_0xa5a2('0x3d')]};return db[_0xa5a2('0x2a')][_0xa5a2('0x40')](_0xeaeb41)[_0xa5a2('0x24')](function(_0x358eed){_0x25066a['count']=_0x358eed;if(_0x1f0885[_0xa5a2('0x30')]['includeAll']){_0x303262['include']=[{'all':!![]}];}return db[_0xa5a2('0x2a')][_0xa5a2('0x41')](_0x303262);})[_0xa5a2('0x24')](function(_0x172c49){_0x25066a[_0xa5a2('0x42')]=_0x172c49;return _0x25066a;})[_0xa5a2('0x24')](respondWithFilteredResult(_0x13533b,_0x303262))['catch'](handleError(_0x13533b,null));};exports[_0xa5a2('0x43')]=function(_0x4cfefc,_0x39cacf){var _0x12258e={'raw':!![],'where':{'id':_0x4cfefc[_0xa5a2('0x44')]['id']}},_0x153c07={};_0x153c07[_0xa5a2('0x32')]=_[_0xa5a2('0x2f')](db[_0xa5a2('0x2a')]['rawAttributes']);_0x153c07[_0xa5a2('0x30')]=_['keys'](_0x4cfefc[_0xa5a2('0x30')]);_0x153c07[_0xa5a2('0x45')]=_[_0xa5a2('0x31')](_0x153c07[_0xa5a2('0x32')],_0x153c07[_0xa5a2('0x30')]);_0x12258e[_0xa5a2('0x34')]=_[_0xa5a2('0x31')](_0x153c07[_0xa5a2('0x32')],qs[_0xa5a2('0x33')](_0x4cfefc[_0xa5a2('0x30')]['fields']));_0x12258e[_0xa5a2('0x34')]=_0x12258e[_0xa5a2('0x34')][_0xa5a2('0x35')]?_0x12258e[_0xa5a2('0x34')]:_0x153c07['model'];if(_0x4cfefc[_0xa5a2('0x30')][_0xa5a2('0x46')]){_0x12258e[_0xa5a2('0x47')]=[{'all':!![]}];}_0x12258e=_[_0xa5a2('0x3c')]({},_0x12258e,_0x4cfefc[_0xa5a2('0x3f')]);return db['ServicenowField'][_0xa5a2('0x48')](_0x12258e)['then'](handleEntityNotFound(_0x39cacf,null))[_0xa5a2('0x24')](respondWithResult(_0x39cacf,null))[_0xa5a2('0x49')](handleError(_0x39cacf,null));};exports[_0xa5a2('0x4a')]=function(_0x242a0b,_0x12fca9){return db[_0xa5a2('0x2a')]['create'](_0x242a0b[_0xa5a2('0x4b')],{})[_0xa5a2('0x24')](respondWithResult(_0x12fca9,0xc9))[_0xa5a2('0x49')](handleError(_0x12fca9,null));};exports[_0xa5a2('0x23')]=function(_0x8bb685,_0x54bdf7){if(_0x8bb685[_0xa5a2('0x4b')]['id']){delete _0x8bb685[_0xa5a2('0x4b')]['id'];}return db[_0xa5a2('0x2a')][_0xa5a2('0x48')]({'where':{'id':_0x8bb685[_0xa5a2('0x44')]['id']}})[_0xa5a2('0x24')](handleEntityNotFound(_0x54bdf7,null))[_0xa5a2('0x24')](saveUpdates(_0x8bb685['body'],null))[_0xa5a2('0x24')](respondWithResult(_0x54bdf7,null))[_0xa5a2('0x49')](handleError(_0x54bdf7,null));};exports[_0xa5a2('0x25')]=function(_0x22e28b,_0x534901){return db[_0xa5a2('0x2a')]['find']({'where':{'id':_0x22e28b[_0xa5a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x534901,null))['then'](removeEntity(_0x534901,null))['catch'](handleError(_0x534901,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8c9fe12..567d873 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4008=['rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5043f3,_0x3be189){var _0x4e712c=function(_0x5bfc32){while(--_0x5bfc32){_0x5043f3['push'](_0x5043f3['shift']());}};_0x4e712c(++_0x3be189);}(_0x4008,0xf4));var _0x8400=function(_0x1a5ba8,_0x48bfdf){_0x1a5ba8=_0x1a5ba8-0x0;var _0x37bcab=_0x4008[_0x1a5ba8];return _0x37bcab;};'use strict';var _=require(_0x8400('0x0'));var util=require(_0x8400('0x1'));var logger=require(_0x8400('0x2'))(_0x8400('0x3'));var moment=require(_0x8400('0x4'));var BPromise=require(_0x8400('0x5'));var rp=require(_0x8400('0x6'));var fs=require('fs');var path=require(_0x8400('0x7'));var rimraf=require(_0x8400('0x8'));var config=require(_0x8400('0x9'));var attributes=require(_0x8400('0xa'));module[_0x8400('0xb')]=function(_0x24771b,_0xfae07){return _0x24771b[_0x8400('0xc')](_0x8400('0xd'),attributes,{'tableName':_0x8400('0xe'),'paranoid':![],'indexes':[{'name':_0x8400('0xf'),'fields':[_0x8400('0x10'),_0x8400('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x656a=['request-promise','path','rimraf','../../config/environment','exports','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','moment','bluebird'];(function(_0x1481d7,_0x4eae5b){var _0x4e7725=function(_0x4274d5){while(--_0x4274d5){_0x1481d7['push'](_0x1481d7['shift']());}};_0x4e7725(++_0x4eae5b);}(_0x656a,0x10d));var _0xa656=function(_0xce2ee4,_0x3fe1e1){_0xce2ee4=_0xce2ee4-0x0;var _0x3fd000=_0x656a[_0xce2ee4];return _0x3fd000;};'use strict';var _=require(_0xa656('0x0'));var util=require(_0xa656('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa656('0x2'));var BPromise=require(_0xa656('0x3'));var rp=require(_0xa656('0x4'));var fs=require('fs');var path=require(_0xa656('0x5'));var rimraf=require(_0xa656('0x6'));var config=require(_0xa656('0x7'));var attributes=require('./intServicenowField.attributes');module[_0xa656('0x8')]=function(_0x264ae0,_0x345d31){return _0x264ae0['define'](_0xa656('0x9'),attributes,{'tableName':_0xa656('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xa656('0xb'),_0xa656('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 8c08deb..2a95aab 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb840=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ServicenowField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x472ec0,_0x4681ca){var _0x3ddee6=function(_0x592151){while(--_0x592151){_0x472ec0['push'](_0x472ec0['shift']());}};_0x3ddee6(++_0x4681ca);}(_0xb840,0x15f));var _0x0b84=function(_0x9ddad9,_0x4d475c){_0x9ddad9=_0x9ddad9-0x0;var _0x363c96=_0xb840[_0x9ddad9];return _0x363c96;};'use strict';var _=require(_0x0b84('0x0'));var util=require(_0x0b84('0x1'));var moment=require(_0x0b84('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b84('0x3'));var db=require(_0x0b84('0x4'))['db'];var utils=require(_0x0b84('0x5'));var logger=require(_0x0b84('0x6'))(_0x0b84('0x7'));var config=require(_0x0b84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0b84('0x9')][_0x0b84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e878,_0x5d3ef0,_0x3f4a71){return new BPromise(function(_0x2acd6e,_0x448340){return client[_0x0b84('0xb')](_0x52e878,_0x3f4a71)[_0x0b84('0xc')](function(_0x3a39c2){logger['info'](_0x0b84('0xd'),_0x5d3ef0,'request\x20sent');logger[_0x0b84('0xe')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x5d3ef0,_0x0b84('0xf'),JSON[_0x0b84('0x10')](_0x3a39c2));if(_0x3a39c2[_0x0b84('0x11')]){if(_0x3a39c2[_0x0b84('0x11')][_0x0b84('0x12')]===0x1f4){logger[_0x0b84('0x11')](_0x0b84('0xd'),_0x5d3ef0,_0x3a39c2['error']['message']);return _0x448340(_0x3a39c2[_0x0b84('0x11')]['message']);}logger[_0x0b84('0x11')](_0x0b84('0xd'),_0x5d3ef0,_0x3a39c2['error'][_0x0b84('0x13')]);return _0x2acd6e(_0x3a39c2[_0x0b84('0x11')][_0x0b84('0x13')]);}else{logger['info'](_0x0b84('0xd'),_0x5d3ef0,'request\x20sent');_0x2acd6e(_0x3a39c2[_0x0b84('0x14')]['message']);}})[_0x0b84('0x15')](function(_0x29c020){logger[_0x0b84('0x11')](_0x0b84('0xd'),_0x5d3ef0,_0x29c020);_0x448340(_0x29c020);});});} \ No newline at end of file +var _0xd10d=['error','code','ServicenowField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','stringify'];(function(_0xa8710,_0x8dc771){var _0x59fb43=function(_0x59df9d){while(--_0x59df9d){_0xa8710['push'](_0xa8710['shift']());}};_0x59fb43(++_0x8dc771);}(_0xd10d,0x8a));var _0xdd10=function(_0x189a72,_0x4ac342){_0x189a72=_0x189a72-0x0;var _0x2b457a=_0xd10d[_0x189a72];return _0x2b457a;};'use strict';var _=require(_0xdd10('0x0'));var util=require('util');var moment=require(_0xdd10('0x1'));var BPromise=require(_0xdd10('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd10('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd10('0x4'));var logger=require(_0xdd10('0x5'))(_0xdd10('0x6'));var config=require(_0xdd10('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd10('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3578c9,_0x7e44fe,_0x3e1cff){return new BPromise(function(_0x52fa75,_0x4eb49f){return client['request'](_0x3578c9,_0x3e1cff)[_0xdd10('0x9')](function(_0x155a21){logger[_0xdd10('0xa')]('ServicenowField,\x20%s,\x20%s',_0x7e44fe,_0xdd10('0xb'));logger[_0xdd10('0xc')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x7e44fe,'request\x20sent',JSON[_0xdd10('0xd')](_0x155a21));if(_0x155a21['error']){if(_0x155a21[_0xdd10('0xe')][_0xdd10('0xf')]===0x1f4){logger['error'](_0xdd10('0x10'),_0x7e44fe,_0x155a21[_0xdd10('0xe')][_0xdd10('0x11')]);return _0x4eb49f(_0x155a21[_0xdd10('0xe')]['message']);}logger[_0xdd10('0xe')](_0xdd10('0x10'),_0x7e44fe,_0x155a21[_0xdd10('0xe')][_0xdd10('0x11')]);return _0x52fa75(_0x155a21[_0xdd10('0xe')][_0xdd10('0x11')]);}else{logger[_0xdd10('0xa')](_0xdd10('0x10'),_0x7e44fe,_0xdd10('0xb'));_0x52fa75(_0x155a21['result'][_0xdd10('0x11')]);}})[_0xdd10('0x12')](function(_0x58a2e4){logger['error'](_0xdd10('0x10'),_0x7e44fe,_0x58a2e4);_0x4eb49f(_0x58a2e4);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 6856cc9..5543276 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb826=['update','delete','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration'];(function(_0x5b0e1a,_0x75d24e){var _0x1f20bb=function(_0x11f93a){while(--_0x11f93a){_0x5b0e1a['push'](_0x5b0e1a['shift']());}};_0x1f20bb(++_0x75d24e);}(_0xb826,0x66));var _0x6b82=function(_0x356b4a,_0x5d07dd){_0x356b4a=_0x356b4a-0x0;var _0xdf9421=_0xb826[_0x356b4a];return _0xdf9421;};'use strict';var multer=require(_0x6b82('0x0'));var util=require(_0x6b82('0x1'));var path=require(_0x6b82('0x2'));var timeout=require(_0x6b82('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6b82('0x4'));var interaction=require(_0x6b82('0x5'));var config=require(_0x6b82('0x6'));var controller=require('./intSugarcrmAccount.controller');router[_0x6b82('0x7')]('/',auth['isAuthenticated'](),controller[_0x6b82('0x8')]);router[_0x6b82('0x7')](_0x6b82('0x9'),auth[_0x6b82('0xa')](),controller[_0x6b82('0xb')]);router['get'](_0x6b82('0xc'),auth['isAuthenticated'](),controller[_0x6b82('0xd')]);router[_0x6b82('0x7')](_0x6b82('0xe'),auth[_0x6b82('0xa')](),controller[_0x6b82('0xf')]);router['post']('/',auth[_0x6b82('0xa')](),controller[_0x6b82('0x10')]);router['post'](_0x6b82('0xc'),auth[_0x6b82('0xa')](),controller[_0x6b82('0x11')]);router['put']('/:id',auth[_0x6b82('0xa')](),controller[_0x6b82('0x12')]);router[_0x6b82('0x13')](_0x6b82('0x9'),auth[_0x6b82('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x769e=['addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getFields','post','create'];(function(_0x384c23,_0x30cd65){var _0x1fdf67=function(_0x21d205){while(--_0x21d205){_0x384c23['push'](_0x384c23['shift']());}};_0x1fdf67(++_0x30cd65);}(_0x769e,0x1e9));var _0xe769=function(_0x101d9e,_0x276538){_0x101d9e=_0x101d9e-0x0;var _0x4ef51e=_0x769e[_0x101d9e];return _0x4ef51e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe769('0x0'));var timeout=require(_0xe769('0x1'));var express=require(_0xe769('0x2'));var router=express[_0xe769('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe769('0x4'));var config=require(_0xe769('0x5'));var controller=require(_0xe769('0x6'));router[_0xe769('0x7')]('/',auth[_0xe769('0x8')](),controller['index']);router[_0xe769('0x7')](_0xe769('0x9'),auth[_0xe769('0x8')](),controller[_0xe769('0xa')]);router[_0xe769('0x7')](_0xe769('0xb'),auth[_0xe769('0x8')](),controller['getConfigurations']);router[_0xe769('0x7')]('/:id/fields',auth[_0xe769('0x8')](),controller[_0xe769('0xc')]);router[_0xe769('0xd')]('/',auth[_0xe769('0x8')](),controller[_0xe769('0xe')]);router[_0xe769('0xd')]('/:id/configurations',auth[_0xe769('0x8')](),controller[_0xe769('0xf')]);router[_0xe769('0x10')](_0xe769('0x9'),auth[_0xe769('0x8')](),controller[_0xe769('0x11')]);router[_0xe769('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe769('0x13')]);module[_0xe769('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 50bef04..2661410 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9146=['exports','STRING','sequelize'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x9146,0x164));var _0x6914=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x9146[_0x3b2244];return _0x2dcc14;};'use strict';var Sequelize=require(_0x6914('0x0'));module[_0x6914('0x1')]={'name':{'type':Sequelize[_0x6914('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6914('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6914('0x2')]},'remoteUri':{'type':Sequelize[_0x6914('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1cfd=['exports','STRING','remoteUri','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1cfd,0x1db));var _0xd1cf=function(_0x107e23,_0x3afffe){_0x107e23=_0x107e23-0x0;var _0x478eb9=_0x1cfd[_0x107e23];return _0x478eb9;};'use strict';var Sequelize=require(_0xd1cf('0x0'));module[_0xd1cf('0x1')]={'name':{'type':Sequelize[_0xd1cf('0x2')]},'description':{'type':Sequelize[_0xd1cf('0x2')]},'username':{'type':Sequelize[_0xd1cf('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xd1cf('0x2')]},'remoteUri':{'type':Sequelize[_0xd1cf('0x2')],'unique':_0xd1cf('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index f8bf008..4c44b15 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x069f=['request\x20sent','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','then','destroy','end','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SugarcrmAccount','includeAll','findAll','rows','show','find','create','body','params','findOne','SugarcrmConfiguration','order','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','module_fields','includes','label','endsWith','values','value','statusCode','Wrong\x20credentials','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','test','ValidationError','request','info'];(function(_0x1df757,_0x5b2423){var _0x3be1cb=function(_0x3f0261){while(--_0x3f0261){_0x1df757['push'](_0x1df757['shift']());}};_0x3be1cb(++_0x5b2423);}(_0x069f,0x1e0));var _0xf069=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x069f[_0xf0ec6e];return _0x8bbc27;};'use strict';var pdf=require(_0xf069('0x0'));var emlformat=require(_0xf069('0x1'));var rimraf=require(_0xf069('0x2'));var zipdir=require(_0xf069('0x3'));var jsonpatch=require(_0xf069('0x4'));var rp=require(_0xf069('0x5'));var moment=require(_0xf069('0x6'));var BPromise=require(_0xf069('0x7'));var Mustache=require(_0xf069('0x8'));var util=require(_0xf069('0x9'));var path=require(_0xf069('0xa'));var sox=require('sox');var csv=require(_0xf069('0xb'));var ejs=require(_0xf069('0xc'));var fs=require('fs');var _=require(_0xf069('0xd'));var squel=require(_0xf069('0xe'));var crypto=require('crypto');var jsforce=require(_0xf069('0xf'));var deskjs=require(_0xf069('0x10'));var toCsv=require(_0xf069('0xb'));var querystring=require(_0xf069('0x11'));var Papa=require(_0xf069('0x12'));var Redis=require(_0xf069('0x13'));var authService=require(_0xf069('0x14'));var qs=require(_0xf069('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf069('0x16'));var logger=require(_0xf069('0x17'))('api');var utils=require(_0xf069('0x18'));var config=require('../../config/environment');var db=require(_0xf069('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xf069('0x1a'));var client=jayson[_0xf069('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x51f8bd,_0x46a6cc,_0x5d545d){if(_0x5d545d){var _0x2e8c20=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e8c20[_0xf069('0x1c')](_0x46a6cc)){return _0x51f8bd;}else{throw new db['Sequelize'][(_0xf069('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x51f8bd;}}function respondWithRpcPromise(_0x30af8f,_0x4ecafc,_0x3fcb31,_0x4f67c5){return new BPromise(function(_0x1edf7f,_0x48b991){var _0x29a40f=_0x4f67c5||client;return _0x29a40f[_0xf069('0x1e')](_0x30af8f,_0x3fcb31)['then'](function(_0x30bcef){logger[_0xf069('0x1f')]('SugarcrmAccount,\x20%s,\x20%s',_0x4ecafc,_0xf069('0x20'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4ecafc,_0xf069('0x20'),JSON[_0xf069('0x21')](_0x30bcef));if(_0x30bcef['error']){if(_0x30bcef[_0xf069('0x22')]['code']===0x1f4){logger[_0xf069('0x22')](_0xf069('0x23'),_0x4ecafc,_0x30bcef[_0xf069('0x22')][_0xf069('0x24')]);return _0x48b991(_0x30bcef[_0xf069('0x22')]['message']);}logger[_0xf069('0x22')](_0xf069('0x23'),_0x4ecafc,_0x30bcef['error'][_0xf069('0x24')]);return _0x1edf7f(_0x30bcef['error'][_0xf069('0x24')]);}else{logger['info'](_0xf069('0x23'),_0x4ecafc,'request\x20sent');_0x1edf7f(_0x30bcef[_0xf069('0x25')][_0xf069('0x24')]);}})[_0xf069('0x26')](function(_0x353213){logger[_0xf069('0x22')](_0xf069('0x23'),_0x4ecafc,_0x353213);_0x48b991(_0x353213);});});}function respondWithStatusCode(_0x1a5392,_0x32e034){_0x32e034=_0x32e034||0xcc;return function(_0x105546){if(_0x105546){return _0x1a5392[_0xf069('0x27')](_0x32e034);}return _0x1a5392['status'](_0x32e034)['end']();};}function respondWithResult(_0x2f8442,_0xe75f45){_0xe75f45=_0xe75f45||0xc8;return function(_0x3752e8){if(_0x3752e8){return _0x2f8442[_0xf069('0x28')](_0xe75f45)['json'](_0x3752e8);}};}function respondWithFilteredResult(_0x30faa7,_0x11771d){return function(_0x789b06){if(_0x789b06){var _0x400c68=_0x789b06[_0xf069('0x29')],_0x32b793=_0x11771d['offset'],_0x386a8d=_0x11771d[_0xf069('0x2a')]+_0x11771d[_0xf069('0x2b')],_0x5c4154;if(_0x386a8d>=_0x400c68){_0x386a8d=_0x400c68;_0x5c4154=0xc8;}else{_0x5c4154=0xce;}_0x30faa7['status'](_0x5c4154);return _0x30faa7[_0xf069('0x2c')](_0xf069('0x2d'),_0x32b793+'-'+_0x386a8d+'/'+_0x400c68)[_0xf069('0x2e')](_0x789b06);}return null;};}function patchUpdates(_0x217ccd){return function(_0x1b00c3){try{jsonpatch['apply'](_0x1b00c3,_0x217ccd,!![]);}catch(_0x5ed6bd){return BPromise[_0xf069('0x2f')](_0x5ed6bd);}return _0x1b00c3['save']();};}function saveUpdates(_0x17a35b,_0x5d50ef){return function(_0x190a55){if(_0x190a55){return _0x190a55['update'](_0x17a35b)[_0xf069('0x30')](function(_0x1dd8d5){return _0x1dd8d5;});}return null;};}function removeEntity(_0x153ba8,_0x1a1caa){return function(_0x9061ce){if(_0x9061ce){return _0x9061ce[_0xf069('0x31')]()[_0xf069('0x30')](function(){_0x153ba8[_0xf069('0x28')](0xcc)[_0xf069('0x32')]();});}};}function handleEntityNotFound(_0x439505,_0x32d9df){return function(_0x16add3){if(!_0x16add3){_0x439505['sendStatus'](0x194);}return _0x16add3;};}function handleError(_0x251997,_0x2d15fb){_0x2d15fb=_0x2d15fb||0x1f4;return function(_0x5c862a){logger['error'](_0x5c862a[_0xf069('0x33')]);if(_0x5c862a[_0xf069('0x34')]){delete _0x5c862a[_0xf069('0x34')];}_0x251997[_0xf069('0x28')](_0x2d15fb)['send'](_0x5c862a);};}exports[_0xf069('0x35')]=function(_0x47cea8,_0x219af6){var _0x432f95={},_0x26205e={},_0x37cbfd={'count':0x0,'rows':[]};var _0x521583=_[_0xf069('0x36')](db['SugarcrmAccount'][_0xf069('0x37')],function(_0x56b7e0){return{'name':_0x56b7e0['fieldName'],'type':_0x56b7e0[_0xf069('0x38')][_0xf069('0x39')]};});_0x26205e[_0xf069('0x3a')]=_[_0xf069('0x36')](_0x521583,_0xf069('0x34'));_0x26205e[_0xf069('0x3b')]=_[_0xf069('0x3c')](_0x47cea8[_0xf069('0x3b')]);_0x26205e[_0xf069('0x3d')]=_['intersection'](_0x26205e[_0xf069('0x3a')],_0x26205e['query']);_0x432f95[_0xf069('0x3e')]=_[_0xf069('0x3f')](_0x26205e[_0xf069('0x3a')],qs[_0xf069('0x40')](_0x47cea8[_0xf069('0x3b')]['fields']));_0x432f95[_0xf069('0x3e')]=_0x432f95[_0xf069('0x3e')][_0xf069('0x41')]?_0x432f95[_0xf069('0x3e')]:_0x26205e[_0xf069('0x3a')];if(!_0x47cea8['query']['hasOwnProperty'](_0xf069('0x42'))){_0x432f95[_0xf069('0x2b')]=qs[_0xf069('0x2b')](_0x47cea8[_0xf069('0x3b')]['limit']);_0x432f95[_0xf069('0x2a')]=qs[_0xf069('0x2a')](_0x47cea8[_0xf069('0x3b')]['offset']);}_0x432f95['order']=qs['sort'](_0x47cea8[_0xf069('0x3b')][_0xf069('0x43')]);_0x432f95[_0xf069('0x44')]=qs[_0xf069('0x3d')](_[_0xf069('0x45')](_0x47cea8[_0xf069('0x3b')],_0x26205e[_0xf069('0x3d')]));if(_0x47cea8[_0xf069('0x3b')][_0xf069('0x46')]){_0x432f95['where']=_['merge'](_0x432f95[_0xf069('0x44')],{'$or':_[_0xf069('0x36')](_0x521583,function(_0x326ced){if(_0x326ced[_0xf069('0x38')]!==_0xf069('0x47')){var _0x16812a={};_0x16812a[_0x326ced[_0xf069('0x34')]]={'$like':'%'+_0x47cea8[_0xf069('0x3b')][_0xf069('0x46')]+'%'};return _0x16812a;}})});}_0x432f95=_[_0xf069('0x48')]({},_0x432f95,_0x47cea8[_0xf069('0x49')]);var _0x1f9365={'where':_0x432f95[_0xf069('0x44')]};return db[_0xf069('0x4a')][_0xf069('0x29')](_0x1f9365)[_0xf069('0x30')](function(_0x31661){_0x37cbfd[_0xf069('0x29')]=_0x31661;if(_0x47cea8[_0xf069('0x3b')][_0xf069('0x4b')]){_0x432f95['include']=[{'all':!![]}];}return db[_0xf069('0x4a')][_0xf069('0x4c')](_0x432f95);})['then'](function(_0x5427b1){_0x37cbfd[_0xf069('0x4d')]=_0x5427b1;return _0x37cbfd;})['then'](respondWithFilteredResult(_0x219af6,_0x432f95))['catch'](handleError(_0x219af6,null));};exports[_0xf069('0x4e')]=function(_0x2dabe3,_0x21e742){var _0x226f55={'raw':![],'where':{'id':_0x2dabe3['params']['id']}},_0x393a72={};_0x393a72[_0xf069('0x3a')]=_[_0xf069('0x3c')](db['SugarcrmAccount'][_0xf069('0x37')]);_0x393a72['query']=_[_0xf069('0x3c')](_0x2dabe3['query']);_0x393a72['filters']=_['intersection'](_0x393a72[_0xf069('0x3a')],_0x393a72[_0xf069('0x3b')]);_0x226f55['attributes']=_['intersection'](_0x393a72[_0xf069('0x3a')],qs['fields'](_0x2dabe3['query']['fields']));_0x226f55[_0xf069('0x3e')]=_0x226f55[_0xf069('0x3e')][_0xf069('0x41')]?_0x226f55[_0xf069('0x3e')]:_0x393a72['model'];if(_0x2dabe3[_0xf069('0x3b')][_0xf069('0x4b')]){_0x226f55['include']=[{'all':!![]}];}_0x226f55=_[_0xf069('0x48')]({},_0x226f55,_0x2dabe3[_0xf069('0x49')]);return db[_0xf069('0x4a')][_0xf069('0x4f')](_0x226f55)[_0xf069('0x30')](handleEntityNotFound(_0x21e742,null))[_0xf069('0x30')](respondWithResult(_0x21e742,null))[_0xf069('0x26')](handleError(_0x21e742,null));};exports[_0xf069('0x50')]=function(_0x1657a0,_0x3e4e45){return db[_0xf069('0x4a')][_0xf069('0x50')](_0x1657a0['body'],{})['then'](respondWithResult(_0x3e4e45,0xc9))['catch'](handleError(_0x3e4e45,null));};exports['update']=function(_0x5bfb2f,_0x36c978){if(_0x5bfb2f[_0xf069('0x51')]['id']){delete _0x5bfb2f['body']['id'];}return db[_0xf069('0x4a')]['find']({'where':{'id':_0x5bfb2f['params']['id']}})[_0xf069('0x30')](handleEntityNotFound(_0x36c978,null))[_0xf069('0x30')](saveUpdates(_0x5bfb2f[_0xf069('0x51')],null))[_0xf069('0x30')](respondWithResult(_0x36c978,null))[_0xf069('0x26')](handleError(_0x36c978,null));};exports[_0xf069('0x31')]=function(_0x2f2786,_0x294f70){return db[_0xf069('0x4a')][_0xf069('0x4f')]({'where':{'id':_0x2f2786[_0xf069('0x52')]['id']}})['then'](handleEntityNotFound(_0x294f70,null))['then'](removeEntity(_0x294f70,null))[_0xf069('0x26')](handleError(_0x294f70,null));};exports['getConfigurations']=function(_0x33476f,_0x20a561,_0x5eaffa){var _0x1e45ce={};var _0x41a898={};var _0x1cb48e;var _0x5b44fb;return db[_0xf069('0x4a')][_0xf069('0x53')]({'where':{'id':_0x33476f[_0xf069('0x52')]['id']}})[_0xf069('0x30')](handleEntityNotFound(_0x20a561,null))[_0xf069('0x30')](function(_0x158529){if(_0x158529){_0x1cb48e=_0x158529;_0x41a898[_0xf069('0x3a')]=_[_0xf069('0x3c')](db[_0xf069('0x54')][_0xf069('0x37')]);_0x41a898['query']=_[_0xf069('0x3c')](_0x33476f[_0xf069('0x3b')]);_0x41a898['filters']=_[_0xf069('0x3f')](_0x41a898['model'],_0x41a898['query']);_0x1e45ce[_0xf069('0x3e')]=_[_0xf069('0x3f')](_0x41a898[_0xf069('0x3a')],qs[_0xf069('0x40')](_0x33476f[_0xf069('0x3b')][_0xf069('0x40')]));_0x1e45ce['attributes']=_0x1e45ce[_0xf069('0x3e')][_0xf069('0x41')]?_0x1e45ce[_0xf069('0x3e')]:_0x41a898[_0xf069('0x3a')];_0x1e45ce[_0xf069('0x55')]=qs[_0xf069('0x43')](_0x33476f[_0xf069('0x3b')][_0xf069('0x43')]);_0x1e45ce['where']=qs[_0xf069('0x3d')](_[_0xf069('0x45')](_0x33476f[_0xf069('0x3b')],_0x41a898['filters']));if(_0x33476f[_0xf069('0x3b')][_0xf069('0x46')]){_0x1e45ce[_0xf069('0x44')]=_[_0xf069('0x48')](_0x1e45ce[_0xf069('0x44')],{'$or':_[_0xf069('0x36')](_0x1e45ce[_0xf069('0x3e')],function(_0x542b2b){var _0xfa9cbc={};_0xfa9cbc[_0x542b2b]={'$like':'%'+_0x33476f['query'][_0xf069('0x46')]+'%'};return _0xfa9cbc;})});}_0x1e45ce=_[_0xf069('0x48')]({},_0x1e45ce,_0x33476f['options']);return _0x1cb48e[_0xf069('0x56')](_0x1e45ce);}})[_0xf069('0x30')](function(_0x1c93ba){if(_0x1c93ba){_0x5b44fb=_0x1c93ba['length'];if(!_0x33476f[_0xf069('0x3b')][_0xf069('0x57')](_0xf069('0x42'))){_0x1e45ce['limit']=qs[_0xf069('0x2b')](_0x33476f[_0xf069('0x3b')][_0xf069('0x2b')]);_0x1e45ce[_0xf069('0x2a')]=qs[_0xf069('0x2a')](_0x33476f['query']['offset']);}return _0x1cb48e[_0xf069('0x56')](_0x1e45ce);}})[_0xf069('0x30')](function(_0x2a7917){if(_0x2a7917){return _0x2a7917?{'count':_0x5b44fb,'rows':_0x2a7917}:null;}})['then'](respondWithResult(_0x20a561,null))[_0xf069('0x26')](handleError(_0x20a561,null));};exports[_0xf069('0x58')]=function(_0x539a05,_0x18b2b7,_0x5d646a){if(_0x539a05[_0xf069('0x51')]['id']){delete _0x539a05[_0xf069('0x51')]['id'];}return db[_0xf069('0x4a')][_0xf069('0x53')]({'where':{'id':_0x539a05[_0xf069('0x52')]['id']}})[_0xf069('0x30')](handleEntityNotFound(_0x18b2b7,null))[_0xf069('0x30')](function(_0x3a9a50){if(_0x3a9a50){_0x539a05[_0xf069('0x51')][_0xf069('0x59')]=_0x3a9a50['id'];_0x539a05[_0xf069('0x51')][_0xf069('0x5a')]=integrations[_0xf069('0x5b')](_0x539a05[_0xf069('0x51')]['channel'],_0x539a05[_0xf069('0x51')][_0xf069('0x38')]);_0x539a05[_0xf069('0x51')][_0xf069('0x5c')]=integrations[_0xf069('0x5d')](_0x539a05[_0xf069('0x51')][_0xf069('0x5e')],_0x539a05[_0xf069('0x51')][_0xf069('0x38')]);return db[_0xf069('0x54')][_0xf069('0x50')](_0x539a05[_0xf069('0x51')],{'include':[{'model':db['SugarcrmField'],'as':_0xf069('0x5a')},{'model':db[_0xf069('0x5f')],'as':_0xf069('0x5c')}]});}return null;})[_0xf069('0x30')](respondWithResult(_0x18b2b7,null))[_0xf069('0x26')](handleError(_0x18b2b7,null));};exports[_0xf069('0x60')]=function(_0x9e6f6,_0x2d2cf2,_0x42cfaa){var _0x115d70='';var _0x3e9acd=['id','name','assigned_user_id',_0xf069('0x61'),_0xf069('0x62'),_0xf069('0x63'),_0xf069('0x64'),_0xf069('0x65'),_0xf069('0x66'),_0xf069('0x67'),_0xf069('0x68'),'direction'];return db['SugarcrmAccount'][_0xf069('0x53')]({'where':{'id':_0x9e6f6[_0xf069('0x52')]['id']},'attributes':['id',_0xf069('0x69'),_0xf069('0x6a'),'remoteUri']})[_0xf069('0x30')](handleEntityNotFound(_0x2d2cf2,null))[_0xf069('0x30')](function(_0x19a1b5){if(_0x19a1b5){_0x115d70=_0x19a1b5[_0xf069('0x6b')];var _0x4fa39d=_0x115d70['slice'](-0x1);if(_0x4fa39d==='/'){_0x115d70=_0x115d70[_0xf069('0x6c')](0x0,_0x115d70[_0xf069('0x6d')](_0x4fa39d));}return rp({'method':_0xf069('0x6e'),'uri':util[_0xf069('0x6f')](_0xf069('0x70'),_0x115d70,_0xf069('0x71')),'json':!![],'form':{'method':_0xf069('0x72'),'input_type':_0xf069('0x73'),'response_type':'JSON','rest_data':JSON[_0xf069('0x21')]({'user_auth':{'user_name':_0x19a1b5[_0xf069('0x69')],'password':_0x19a1b5[_0xf069('0x6a')],'encryption':'PLAIN'},'application':_0xf069('0x74')})}});}})[_0xf069('0x30')](function(_0x5a305b){if(_0x5a305b&&_0x5a305b['name']!==_0xf069('0x75')&&_0x5a305b[_0xf069('0x34')]!=='Password\x20Expired'){return rp({'method':_0xf069('0x6e'),'uri':util[_0xf069('0x6f')](_0xf069('0x70'),_0x115d70,_0xf069('0x71')),'json':!![],'form':{'method':_0xf069('0x76'),'input_type':_0xf069('0x73'),'response_type':_0xf069('0x73'),'rest_data':JSON['stringify']({'session':_0x5a305b['id'],'module_name':'Calls'})}})['then'](function(_0x36e4f4){if(_0x36e4f4){var _0x3d7055=_['values'](_0x36e4f4[_0xf069('0x77')]);_['remove'](_0x3d7055,function(_0x1ccd32){return _0x3e9acd[_0xf069('0x78')](_0x1ccd32[_0xf069('0x34')]);});return{'count':_0x3d7055[_0xf069('0x41')],'rows':_[_0xf069('0x36')](_0x3d7055,function(_0x5b2567){return{'id':_0x5b2567[_0xf069('0x34')],'name':_0x5b2567[_0xf069('0x79')],'custom':_[_0xf069('0x7a')](_0x5b2567[_0xf069('0x34')],'_c')?!![]:![],'options':_0x5b2567[_0xf069('0x49')]?_[_0xf069('0x36')](_[_0xf069('0x7b')](_0x5b2567[_0xf069('0x49')]),function(_0x40cee7){return{'name':_0x40cee7[_0xf069('0x7c')],'value':_0x40cee7['name']};}):[]};})};}})[_0xf069('0x30')](respondWithResult(_0x2d2cf2,null))[_0xf069('0x26')](function(_0x16a2fb){var _0x2ee3cb=_0x9e6f6[_0xf069('0x3b')][_0xf069('0x1c')]?0x1f4:_0x16a2fb[_0xf069('0x7d')]||0x1f4;logger[_0xf069('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0xf069('0x60'),_0x2ee3cb,JSON[_0xf069('0x21')](_0x16a2fb));delete _0x16a2fb[_0xf069('0x34')];if(_0x2ee3cb===0x191){_0x2ee3cb=0x190;}_0x2d2cf2[_0xf069('0x28')](_0x2ee3cb)['send'](_0x9e6f6['query']['test']?{'message':_0xf069('0x7e'),'statusCode':_0x16a2fb[_0xf069('0x7d')]}:_0x16a2fb);});}else{var _0x1980a5=0x1f4;_0x2d2cf2[_0xf069('0x28')](_0x1980a5)[_0xf069('0x7f')]({'message':_0xf069('0x7e'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xb75f=['getDescriptions','SugarcrmConfiguration','SugarcrmField','Subjects','assigned_user_id','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','getFields','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','save','update','sendStatus','stack','name','send','index','map','SugarcrmAccount','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','create','body','destroy','getConfigurations','findOne','rawAttributes','addConfiguration','AccountId','getSubjects','channel','Descriptions'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0xb75f,0xab));var _0xfb75=function(_0x3249ab,_0x53459d){_0x3249ab=_0x3249ab-0x0;var _0x2eddfc=_0xb75f[_0x3249ab];return _0x2eddfc;};'use strict';var pdf=require(_0xfb75('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfb75('0x1'));var zipdir=require(_0xfb75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb75('0x3'));var moment=require(_0xfb75('0x4'));var BPromise=require(_0xfb75('0x5'));var Mustache=require('mustache');var util=require(_0xfb75('0x6'));var path=require('path');var sox=require(_0xfb75('0x7'));var csv=require(_0xfb75('0x8'));var ejs=require(_0xfb75('0x9'));var fs=require('fs');var _=require(_0xfb75('0xa'));var squel=require(_0xfb75('0xb'));var crypto=require('crypto');var jsforce=require(_0xfb75('0xc'));var deskjs=require(_0xfb75('0xd'));var toCsv=require(_0xfb75('0x8'));var querystring=require(_0xfb75('0xe'));var Papa=require('papaparse');var Redis=require(_0xfb75('0xf'));var authService=require(_0xfb75('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfb75('0x11'));var hardwareService=require(_0xfb75('0x12'));var logger=require(_0xfb75('0x13'))(_0xfb75('0x14'));var utils=require('../../config/utils');var config=require(_0xfb75('0x15'));var db=require(_0xfb75('0x16'))['db'];var integrations=require(_0xfb75('0x17'));var jayson=require('jayson/promise');var client=jayson[_0xfb75('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x4cf448,_0x19e411,_0x459513){if(_0x459513){var _0x594ef6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x594ef6[_0xfb75('0x19')](_0x19e411)){return _0x4cf448;}else{throw new db[(_0xfb75('0x1a'))][(_0xfb75('0x1b'))](_0xfb75('0x1c'));}}else{return _0x4cf448;}}function respondWithRpcPromise(_0x5f26aa,_0x4ff0c4,_0x5a36d,_0x344ba1){return new BPromise(function(_0x1033b7,_0x2d759e){var _0x6455de=_0x344ba1||client;return _0x6455de[_0xfb75('0x1d')](_0x5f26aa,_0x5a36d)[_0xfb75('0x1e')](function(_0x191379){logger[_0xfb75('0x1f')](_0xfb75('0x20'),_0x4ff0c4,_0xfb75('0x21'));logger[_0xfb75('0x22')](_0xfb75('0x23'),_0x4ff0c4,_0xfb75('0x21'),JSON['stringify'](_0x191379));if(_0x191379[_0xfb75('0x24')]){if(_0x191379[_0xfb75('0x24')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x4ff0c4,_0x191379[_0xfb75('0x24')][_0xfb75('0x25')]);return _0x2d759e(_0x191379[_0xfb75('0x24')][_0xfb75('0x25')]);}logger[_0xfb75('0x24')](_0xfb75('0x20'),_0x4ff0c4,_0x191379[_0xfb75('0x24')][_0xfb75('0x25')]);return _0x1033b7(_0x191379[_0xfb75('0x24')][_0xfb75('0x25')]);}else{logger[_0xfb75('0x1f')](_0xfb75('0x20'),_0x4ff0c4,_0xfb75('0x21'));_0x1033b7(_0x191379[_0xfb75('0x26')][_0xfb75('0x25')]);}})[_0xfb75('0x27')](function(_0x52d73a){logger[_0xfb75('0x24')](_0xfb75('0x20'),_0x4ff0c4,_0x52d73a);_0x2d759e(_0x52d73a);});});}function respondWithStatusCode(_0x4a788a,_0x36c9d2){_0x36c9d2=_0x36c9d2||0xcc;return function(_0x16fa64){if(_0x16fa64){return _0x4a788a['sendStatus'](_0x36c9d2);}return _0x4a788a['status'](_0x36c9d2)[_0xfb75('0x28')]();};}function respondWithResult(_0x468bcf,_0x499dbd){_0x499dbd=_0x499dbd||0xc8;return function(_0x469697){if(_0x469697){return _0x468bcf[_0xfb75('0x29')](_0x499dbd)[_0xfb75('0x2a')](_0x469697);}};}function respondWithFilteredResult(_0x4a8857,_0x2c19ba){return function(_0x330d7a){if(_0x330d7a){var _0x1665ec=_0x330d7a[_0xfb75('0x2b')],_0x2b4f92=_0x2c19ba[_0xfb75('0x2c')],_0x854e2a=_0x2c19ba[_0xfb75('0x2c')]+_0x2c19ba[_0xfb75('0x2d')],_0x4dac07;if(_0x854e2a>=_0x1665ec){_0x854e2a=_0x1665ec;_0x4dac07=0xc8;}else{_0x4dac07=0xce;}_0x4a8857[_0xfb75('0x29')](_0x4dac07);return _0x4a8857[_0xfb75('0x2e')](_0xfb75('0x2f'),_0x2b4f92+'-'+_0x854e2a+'/'+_0x1665ec)[_0xfb75('0x2a')](_0x330d7a);}return null;};}function patchUpdates(_0x179198){return function(_0x2fe546){try{jsonpatch['apply'](_0x2fe546,_0x179198,!![]);}catch(_0x5ab26c){return BPromise['reject'](_0x5ab26c);}return _0x2fe546[_0xfb75('0x30')]();};}function saveUpdates(_0x435b49,_0x2a4375){return function(_0x2a7512){if(_0x2a7512){return _0x2a7512[_0xfb75('0x31')](_0x435b49)[_0xfb75('0x1e')](function(_0x5b09bb){return _0x5b09bb;});}return null;};}function removeEntity(_0x549be3,_0xfce3cc){return function(_0x4ffc8c){if(_0x4ffc8c){return _0x4ffc8c['destroy']()[_0xfb75('0x1e')](function(){_0x549be3[_0xfb75('0x29')](0xcc)[_0xfb75('0x28')]();});}};}function handleEntityNotFound(_0x40a773,_0x4165f4){return function(_0x3ecffe){if(!_0x3ecffe){_0x40a773[_0xfb75('0x32')](0x194);}return _0x3ecffe;};}function handleError(_0x399203,_0x30b7fa){_0x30b7fa=_0x30b7fa||0x1f4;return function(_0x277f97){logger['error'](_0x277f97[_0xfb75('0x33')]);if(_0x277f97['name']){delete _0x277f97[_0xfb75('0x34')];}_0x399203[_0xfb75('0x29')](_0x30b7fa)[_0xfb75('0x35')](_0x277f97);};}exports[_0xfb75('0x36')]=function(_0x15cbcf,_0x623bda){var _0x4502c7={},_0x150a77={},_0x2f5f95={'count':0x0,'rows':[]};var _0x216f83=_[_0xfb75('0x37')](db[_0xfb75('0x38')]['rawAttributes'],function(_0x2fcd31){return{'name':_0x2fcd31[_0xfb75('0x39')],'type':_0x2fcd31[_0xfb75('0x3a')]['key']};});_0x150a77[_0xfb75('0x3b')]=_[_0xfb75('0x37')](_0x216f83,'name');_0x150a77[_0xfb75('0x3c')]=_[_0xfb75('0x3d')](_0x15cbcf[_0xfb75('0x3c')]);_0x150a77['filters']=_[_0xfb75('0x3e')](_0x150a77[_0xfb75('0x3b')],_0x150a77[_0xfb75('0x3c')]);_0x4502c7[_0xfb75('0x3f')]=_['intersection'](_0x150a77[_0xfb75('0x3b')],qs[_0xfb75('0x40')](_0x15cbcf[_0xfb75('0x3c')][_0xfb75('0x40')]));_0x4502c7['attributes']=_0x4502c7[_0xfb75('0x3f')]['length']?_0x4502c7[_0xfb75('0x3f')]:_0x150a77[_0xfb75('0x3b')];if(!_0x15cbcf[_0xfb75('0x3c')][_0xfb75('0x41')]('nolimit')){_0x4502c7['limit']=qs['limit'](_0x15cbcf[_0xfb75('0x3c')][_0xfb75('0x2d')]);_0x4502c7['offset']=qs['offset'](_0x15cbcf[_0xfb75('0x3c')][_0xfb75('0x2c')]);}_0x4502c7[_0xfb75('0x42')]=qs[_0xfb75('0x43')](_0x15cbcf['query'][_0xfb75('0x43')]);_0x4502c7[_0xfb75('0x44')]=qs[_0xfb75('0x45')](_[_0xfb75('0x46')](_0x15cbcf[_0xfb75('0x3c')],_0x150a77[_0xfb75('0x45')]));if(_0x15cbcf[_0xfb75('0x3c')][_0xfb75('0x47')]){_0x4502c7[_0xfb75('0x44')]=_[_0xfb75('0x48')](_0x4502c7[_0xfb75('0x44')],{'$or':_[_0xfb75('0x37')](_0x216f83,function(_0x5dcbc9){if(_0x5dcbc9[_0xfb75('0x3a')]!==_0xfb75('0x49')){var _0x30a126={};_0x30a126[_0x5dcbc9[_0xfb75('0x34')]]={'$like':'%'+_0x15cbcf[_0xfb75('0x3c')]['filter']+'%'};return _0x30a126;}})});}_0x4502c7=_[_0xfb75('0x48')]({},_0x4502c7,_0x15cbcf[_0xfb75('0x4a')]);var _0x4123f5={'where':_0x4502c7[_0xfb75('0x44')]};return db[_0xfb75('0x38')][_0xfb75('0x2b')](_0x4123f5)[_0xfb75('0x1e')](function(_0x139399){_0x2f5f95[_0xfb75('0x2b')]=_0x139399;if(_0x15cbcf[_0xfb75('0x3c')][_0xfb75('0x4b')]){_0x4502c7[_0xfb75('0x4c')]=[{'all':!![]}];}return db[_0xfb75('0x38')][_0xfb75('0x4d')](_0x4502c7);})[_0xfb75('0x1e')](function(_0x3ffcc9){_0x2f5f95['rows']=_0x3ffcc9;return _0x2f5f95;})[_0xfb75('0x1e')](respondWithFilteredResult(_0x623bda,_0x4502c7))[_0xfb75('0x27')](handleError(_0x623bda,null));};exports[_0xfb75('0x4e')]=function(_0x13e0d0,_0x2fd486){var _0x38c403={'raw':![],'where':{'id':_0x13e0d0[_0xfb75('0x4f')]['id']}},_0x258d45={};_0x258d45[_0xfb75('0x3b')]=_[_0xfb75('0x3d')](db[_0xfb75('0x38')]['rawAttributes']);_0x258d45['query']=_[_0xfb75('0x3d')](_0x13e0d0[_0xfb75('0x3c')]);_0x258d45['filters']=_[_0xfb75('0x3e')](_0x258d45[_0xfb75('0x3b')],_0x258d45[_0xfb75('0x3c')]);_0x38c403[_0xfb75('0x3f')]=_[_0xfb75('0x3e')](_0x258d45['model'],qs[_0xfb75('0x40')](_0x13e0d0[_0xfb75('0x3c')][_0xfb75('0x40')]));_0x38c403[_0xfb75('0x3f')]=_0x38c403[_0xfb75('0x3f')][_0xfb75('0x50')]?_0x38c403[_0xfb75('0x3f')]:_0x258d45[_0xfb75('0x3b')];if(_0x13e0d0[_0xfb75('0x3c')][_0xfb75('0x4b')]){_0x38c403[_0xfb75('0x4c')]=[{'all':!![]}];}_0x38c403=_['merge']({},_0x38c403,_0x13e0d0['options']);return db[_0xfb75('0x38')][_0xfb75('0x51')](_0x38c403)[_0xfb75('0x1e')](handleEntityNotFound(_0x2fd486,null))[_0xfb75('0x1e')](respondWithResult(_0x2fd486,null))[_0xfb75('0x27')](handleError(_0x2fd486,null));};exports[_0xfb75('0x52')]=function(_0x227376,_0x1a8404){return db['SugarcrmAccount'][_0xfb75('0x52')](_0x227376[_0xfb75('0x53')],{})['then'](respondWithResult(_0x1a8404,0xc9))[_0xfb75('0x27')](handleError(_0x1a8404,null));};exports[_0xfb75('0x31')]=function(_0x5cac42,_0x31394d){if(_0x5cac42['body']['id']){delete _0x5cac42[_0xfb75('0x53')]['id'];}return db[_0xfb75('0x38')][_0xfb75('0x51')]({'where':{'id':_0x5cac42[_0xfb75('0x4f')]['id']}})[_0xfb75('0x1e')](handleEntityNotFound(_0x31394d,null))[_0xfb75('0x1e')](saveUpdates(_0x5cac42[_0xfb75('0x53')],null))['then'](respondWithResult(_0x31394d,null))[_0xfb75('0x27')](handleError(_0x31394d,null));};exports[_0xfb75('0x54')]=function(_0x3a395b,_0x8f16fc){return db[_0xfb75('0x38')][_0xfb75('0x51')]({'where':{'id':_0x3a395b[_0xfb75('0x4f')]['id']}})[_0xfb75('0x1e')](handleEntityNotFound(_0x8f16fc,null))['then'](removeEntity(_0x8f16fc,null))[_0xfb75('0x27')](handleError(_0x8f16fc,null));};exports[_0xfb75('0x55')]=function(_0x39dabb,_0x18f338,_0x27ecd0){var _0x2e7ccd={};var _0x4d2861={};var _0x39f3b3;var _0x213f67;return db['SugarcrmAccount'][_0xfb75('0x56')]({'where':{'id':_0x39dabb[_0xfb75('0x4f')]['id']}})[_0xfb75('0x1e')](handleEntityNotFound(_0x18f338,null))[_0xfb75('0x1e')](function(_0x408d84){if(_0x408d84){_0x39f3b3=_0x408d84;_0x4d2861[_0xfb75('0x3b')]=_['keys'](db['SugarcrmConfiguration'][_0xfb75('0x57')]);_0x4d2861['query']=_['keys'](_0x39dabb[_0xfb75('0x3c')]);_0x4d2861[_0xfb75('0x45')]=_[_0xfb75('0x3e')](_0x4d2861[_0xfb75('0x3b')],_0x4d2861['query']);_0x2e7ccd[_0xfb75('0x3f')]=_[_0xfb75('0x3e')](_0x4d2861[_0xfb75('0x3b')],qs[_0xfb75('0x40')](_0x39dabb['query']['fields']));_0x2e7ccd[_0xfb75('0x3f')]=_0x2e7ccd[_0xfb75('0x3f')][_0xfb75('0x50')]?_0x2e7ccd[_0xfb75('0x3f')]:_0x4d2861[_0xfb75('0x3b')];_0x2e7ccd[_0xfb75('0x42')]=qs[_0xfb75('0x43')](_0x39dabb['query']['sort']);_0x2e7ccd[_0xfb75('0x44')]=qs[_0xfb75('0x45')](_['pick'](_0x39dabb[_0xfb75('0x3c')],_0x4d2861[_0xfb75('0x45')]));if(_0x39dabb[_0xfb75('0x3c')]['filter']){_0x2e7ccd['where']=_[_0xfb75('0x48')](_0x2e7ccd['where'],{'$or':_[_0xfb75('0x37')](_0x2e7ccd[_0xfb75('0x3f')],function(_0x78f19d){var _0x2dd511={};_0x2dd511[_0x78f19d]={'$like':'%'+_0x39dabb[_0xfb75('0x3c')][_0xfb75('0x47')]+'%'};return _0x2dd511;})});}_0x2e7ccd=_[_0xfb75('0x48')]({},_0x2e7ccd,_0x39dabb[_0xfb75('0x4a')]);return _0x39f3b3['getConfigurations'](_0x2e7ccd);}})[_0xfb75('0x1e')](function(_0x686a6e){if(_0x686a6e){_0x213f67=_0x686a6e[_0xfb75('0x50')];if(!_0x39dabb[_0xfb75('0x3c')][_0xfb75('0x41')]('nolimit')){_0x2e7ccd[_0xfb75('0x2d')]=qs['limit'](_0x39dabb['query'][_0xfb75('0x2d')]);_0x2e7ccd[_0xfb75('0x2c')]=qs[_0xfb75('0x2c')](_0x39dabb[_0xfb75('0x3c')][_0xfb75('0x2c')]);}return _0x39f3b3[_0xfb75('0x55')](_0x2e7ccd);}})[_0xfb75('0x1e')](function(_0x497825){if(_0x497825){return _0x497825?{'count':_0x213f67,'rows':_0x497825}:null;}})['then'](respondWithResult(_0x18f338,null))['catch'](handleError(_0x18f338,null));};exports[_0xfb75('0x58')]=function(_0x3ade7e,_0x3e69c0,_0x212833){if(_0x3ade7e[_0xfb75('0x53')]['id']){delete _0x3ade7e[_0xfb75('0x53')]['id'];}return db['SugarcrmAccount'][_0xfb75('0x56')]({'where':{'id':_0x3ade7e[_0xfb75('0x4f')]['id']}})[_0xfb75('0x1e')](handleEntityNotFound(_0x3e69c0,null))['then'](function(_0xce0d69){if(_0xce0d69){_0x3ade7e[_0xfb75('0x53')][_0xfb75('0x59')]=_0xce0d69['id'];_0x3ade7e[_0xfb75('0x53')]['Subjects']=integrations[_0xfb75('0x5a')](_0x3ade7e[_0xfb75('0x53')][_0xfb75('0x5b')],_0x3ade7e[_0xfb75('0x53')][_0xfb75('0x3a')]);_0x3ade7e[_0xfb75('0x53')][_0xfb75('0x5c')]=integrations[_0xfb75('0x5d')](_0x3ade7e[_0xfb75('0x53')][_0xfb75('0x5b')],_0x3ade7e[_0xfb75('0x53')][_0xfb75('0x3a')]);return db[_0xfb75('0x5e')][_0xfb75('0x52')](_0x3ade7e[_0xfb75('0x53')],{'include':[{'model':db[_0xfb75('0x5f')],'as':_0xfb75('0x60')},{'model':db[_0xfb75('0x5f')],'as':'Descriptions'}]});}return null;})[_0xfb75('0x1e')](respondWithResult(_0x3e69c0,null))[_0xfb75('0x27')](handleError(_0x3e69c0,null));};exports['getFields']=function(_0x290f0d,_0x620665,_0x45076b){var _0x31cd62='';var _0xea2488=['id',_0xfb75('0x34'),_0xfb75('0x61'),'created_by',_0xfb75('0x62'),_0xfb75('0x63'),_0xfb75('0x64'),'duration_minutes',_0xfb75('0x65'),_0xfb75('0x66'),_0xfb75('0x67'),_0xfb75('0x68')];return db[_0xfb75('0x38')]['findOne']({'where':{'id':_0x290f0d['params']['id']},'attributes':['id',_0xfb75('0x69'),_0xfb75('0x6a'),_0xfb75('0x6b')]})[_0xfb75('0x1e')](handleEntityNotFound(_0x620665,null))[_0xfb75('0x1e')](function(_0x4eeb96){if(_0x4eeb96){_0x31cd62=_0x4eeb96['remoteUri'];var _0x2f1375=_0x31cd62[_0xfb75('0x6c')](-0x1);if(_0x2f1375==='/'){_0x31cd62=_0x31cd62[_0xfb75('0x6d')](0x0,_0x31cd62['lastIndexOf'](_0x2f1375));}return rp({'method':'POST','uri':util[_0xfb75('0x6e')](_0xfb75('0x6f'),_0x31cd62,_0xfb75('0x70')),'json':!![],'form':{'method':_0xfb75('0x71'),'input_type':_0xfb75('0x72'),'response_type':_0xfb75('0x72'),'rest_data':JSON[_0xfb75('0x73')]({'user_auth':{'user_name':_0x4eeb96[_0xfb75('0x69')],'password':_0x4eeb96['password'],'encryption':_0xfb75('0x74')},'application':_0xfb75('0x75')})}});}})[_0xfb75('0x1e')](function(_0x438aad){if(_0x438aad&&_0x438aad[_0xfb75('0x34')]!==_0xfb75('0x76')&&_0x438aad[_0xfb75('0x34')]!==_0xfb75('0x77')){return rp({'method':_0xfb75('0x78'),'uri':util[_0xfb75('0x6e')](_0xfb75('0x6f'),_0x31cd62,_0xfb75('0x70')),'json':!![],'form':{'method':_0xfb75('0x79'),'input_type':_0xfb75('0x72'),'response_type':'JSON','rest_data':JSON[_0xfb75('0x73')]({'session':_0x438aad['id'],'module_name':_0xfb75('0x7a')})}})[_0xfb75('0x1e')](function(_0x39c31b){if(_0x39c31b){var _0x488d6f=_[_0xfb75('0x7b')](_0x39c31b[_0xfb75('0x7c')]);_['remove'](_0x488d6f,function(_0x1ab9e5){return _0xea2488[_0xfb75('0x7d')](_0x1ab9e5[_0xfb75('0x34')]);});return{'count':_0x488d6f[_0xfb75('0x50')],'rows':_['map'](_0x488d6f,function(_0x4a96f9){return{'id':_0x4a96f9[_0xfb75('0x34')],'name':_0x4a96f9[_0xfb75('0x7e')],'custom':_[_0xfb75('0x7f')](_0x4a96f9['name'],'_c')?!![]:![],'options':_0x4a96f9[_0xfb75('0x4a')]?_[_0xfb75('0x37')](_[_0xfb75('0x7b')](_0x4a96f9['options']),function(_0x548c48){return{'name':_0x548c48[_0xfb75('0x80')],'value':_0x548c48[_0xfb75('0x34')]};}):[]};})};}})[_0xfb75('0x1e')](respondWithResult(_0x620665,null))['catch'](function(_0x18a51c){var _0x25d80d=_0x290f0d[_0xfb75('0x3c')][_0xfb75('0x19')]?0x1f4:_0x18a51c['statusCode']||0x1f4;logger[_0xfb75('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xfb75('0x81'),_0x25d80d,JSON[_0xfb75('0x73')](_0x18a51c));delete _0x18a51c['name'];if(_0x25d80d===0x191){_0x25d80d=0x190;}_0x620665[_0xfb75('0x29')](_0x25d80d)[_0xfb75('0x35')](_0x290f0d['query'][_0xfb75('0x19')]?{'message':_0xfb75('0x82'),'statusCode':_0x18a51c[_0xfb75('0x83')]}:_0x18a51c);});}else{var _0x1a279e=0x1f4;_0x620665['status'](_0x1a279e)[_0xfb75('0x35')]({'message':_0xfb75('0x82'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 89dba92..378b5b9 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6478=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x321546,_0x41b964){var _0xfea202=function(_0x54594d){while(--_0x54594d){_0x321546['push'](_0x321546['shift']());}};_0xfea202(++_0x41b964);}(_0x6478,0x1e7));var _0x8647=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0x6478[_0x2998db];return _0x115fea;};'use strict';var _=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var logger=require(_0x8647('0x2'))(_0x8647('0x3'));var moment=require(_0x8647('0x4'));var BPromise=require(_0x8647('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8647('0x6'));var rimraf=require(_0x8647('0x7'));var config=require(_0x8647('0x8'));var attributes=require(_0x8647('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5308e8,_0x5ef3f8){return _0x5308e8[_0x8647('0xa')](_0x8647('0xb'),attributes,{'tableName':_0x8647('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x792c=['../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x3f34aa,_0x2b059a){var _0x5ed27e=function(_0x30be2e){while(--_0x30be2e){_0x3f34aa['push'](_0x3f34aa['shift']());}};_0x5ed27e(++_0x2b059a);}(_0x792c,0x164));var _0xc792=function(_0x4085b3,_0x3bc836){_0x4085b3=_0x4085b3-0x0;var _0x2ca902=_0x792c[_0x4085b3];return _0x2ca902;};'use strict';var _=require(_0xc792('0x0'));var util=require(_0xc792('0x1'));var logger=require(_0xc792('0x2'))(_0xc792('0x3'));var moment=require(_0xc792('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc792('0x5'));var config=require(_0xc792('0x6'));var attributes=require(_0xc792('0x7'));var integrations=require(_0xc792('0x8'));module[_0xc792('0x9')]=function(_0x5afb38,_0x3fe0ec){return _0x5afb38[_0xc792('0xa')](_0xc792('0xb'),attributes,{'tableName':_0xc792('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 4e18388..88cdb19 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f91=['code','error','message','info','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','include','map','model','attributes','find','ShowSugarcrmAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3b6c61,_0x5a2cfc){var _0x3ffb2c=function(_0x4c4b67){while(--_0x4c4b67){_0x3b6c61['push'](_0x3b6c61['shift']());}};_0x3ffb2c(++_0x5a2cfc);}(_0x6f91,0xf7));var _0x16f9=function(_0x24431a,_0x52459a){_0x24431a=_0x24431a-0x0;var _0x454ec7=_0x6f91[_0x24431a];return _0x454ec7;};'use strict';var _=require('lodash');var util=require(_0x16f9('0x0'));var moment=require(_0x16f9('0x1'));var BPromise=require(_0x16f9('0x2'));var rs=require(_0x16f9('0x3'));var fs=require('fs');var Redis=require(_0x16f9('0x4'));var db=require(_0x16f9('0x5'))['db'];var utils=require(_0x16f9('0x6'));var logger=require(_0x16f9('0x7'))('rpc');var config=require(_0x16f9('0x8'));var jayson=require(_0x16f9('0x9'));var client=jayson['client'][_0x16f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36e37c,_0x1a49c6,_0x2dbf31){return new BPromise(function(_0x35b86f,_0x47820f){return client[_0x16f9('0xb')](_0x36e37c,_0x2dbf31)[_0x16f9('0xc')](function(_0x46c368){logger['info'](_0x16f9('0xd'),_0x1a49c6,_0x16f9('0xe'));logger[_0x16f9('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1a49c6,_0x16f9('0xe'),JSON[_0x16f9('0x10')](_0x46c368));if(_0x46c368['error']){if(_0x46c368['error'][_0x16f9('0x11')]===0x1f4){logger['error'](_0x16f9('0xd'),_0x1a49c6,_0x46c368[_0x16f9('0x12')]['message']);return _0x47820f(_0x46c368[_0x16f9('0x12')][_0x16f9('0x13')]);}logger[_0x16f9('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1a49c6,_0x46c368['error'][_0x16f9('0x13')]);return _0x35b86f(_0x46c368[_0x16f9('0x12')][_0x16f9('0x13')]);}else{logger[_0x16f9('0x14')](_0x16f9('0xd'),_0x1a49c6,_0x16f9('0xe'));_0x35b86f(_0x46c368['result'][_0x16f9('0x13')]);}})[_0x16f9('0x15')](function(_0x15712c){logger['error'](_0x16f9('0xd'),_0x1a49c6,_0x15712c);_0x47820f(_0x15712c);});});}exports[_0x16f9('0x16')]=function(_0x2f6915){var _0x5e9eb9=this;return new Promise(function(_0xc4ed39,_0x18ae18){return db[_0x16f9('0x17')]['findAll']({'raw':_0x2f6915[_0x16f9('0x18')]?_0x2f6915[_0x16f9('0x18')][_0x16f9('0x19')]===undefined?!![]:![]:!![],'where':_0x2f6915['options']?_0x2f6915[_0x16f9('0x18')][_0x16f9('0x1a')]||null:null,'attributes':_0x2f6915[_0x16f9('0x18')]?_0x2f6915['options']['attributes']||null:null,'limit':_0x2f6915[_0x16f9('0x18')]?_0x2f6915[_0x16f9('0x18')]['limit']||null:null,'include':_0x2f6915[_0x16f9('0x18')]?_0x2f6915[_0x16f9('0x18')][_0x16f9('0x1b')]?_[_0x16f9('0x1c')](_0x2f6915[_0x16f9('0x18')]['include'],function(_0x277d76){return{'model':db[_0x277d76[_0x16f9('0x1d')]],'as':_0x277d76['as'],'attributes':_0x277d76[_0x16f9('0x1e')],'include':_0x277d76['include']?_[_0x16f9('0x1c')](_0x277d76[_0x16f9('0x1b')],function(_0x15ed33){return{'model':db[_0x15ed33[_0x16f9('0x1d')]],'as':_0x15ed33['as'],'attributes':_0x15ed33[_0x16f9('0x1e')],'include':_0x15ed33[_0x16f9('0x1b')]?_[_0x16f9('0x1c')](_0x15ed33[_0x16f9('0x1b')],function(_0x427107){return{'model':db[_0x427107[_0x16f9('0x1d')]],'as':_0x427107['as'],'attributes':_0x427107['attributes']};}):[]};}):[]};}):[]:[]})[_0x16f9('0xc')](function(_0x53f9ad){logger['info'](_0x16f9('0x16'),_0x2f6915);logger[_0x16f9('0xf')]('GetSugarcrmAccount',_0x2f6915,JSON[_0x16f9('0x10')](_0x53f9ad));_0xc4ed39(_0x53f9ad);})['catch'](function(_0x308ede){logger[_0x16f9('0x12')](_0x16f9('0x16'),_0x308ede[_0x16f9('0x13')],_0x2f6915);_0x18ae18(_0x5e9eb9[_0x16f9('0x12')](0x1f4,_0x308ede[_0x16f9('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x68de2f){var _0x40c56a=this;return new Promise(function(_0x4b5b0b,_0x1f037d){return db['SugarcrmAccount'][_0x16f9('0x1f')]({'raw':_0x68de2f['options']?_0x68de2f[_0x16f9('0x18')][_0x16f9('0x19')]===undefined?!![]:![]:!![],'where':_0x68de2f[_0x16f9('0x18')]?_0x68de2f[_0x16f9('0x18')][_0x16f9('0x1a')]||null:null,'attributes':_0x68de2f[_0x16f9('0x18')]?_0x68de2f['options'][_0x16f9('0x1e')]||null:null,'include':_0x68de2f[_0x16f9('0x18')]?_0x68de2f[_0x16f9('0x18')][_0x16f9('0x1b')]?_[_0x16f9('0x1c')](_0x68de2f[_0x16f9('0x18')][_0x16f9('0x1b')],function(_0x1fa0ba){return{'model':db[_0x1fa0ba[_0x16f9('0x1d')]],'as':_0x1fa0ba['as'],'attributes':_0x1fa0ba[_0x16f9('0x1e')],'include':_0x1fa0ba['include']?_['map'](_0x1fa0ba[_0x16f9('0x1b')],function(_0x3f3b05){return{'model':db[_0x3f3b05[_0x16f9('0x1d')]],'as':_0x3f3b05['as'],'attributes':_0x3f3b05[_0x16f9('0x1e')],'include':_0x3f3b05[_0x16f9('0x1b')]?_['map'](_0x3f3b05[_0x16f9('0x1b')],function(_0x2a13df){return{'model':db[_0x2a13df[_0x16f9('0x1d')]],'as':_0x2a13df['as'],'attributes':_0x2a13df[_0x16f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x16f9('0xc')](function(_0x49ea28){logger[_0x16f9('0x14')](_0x16f9('0x20'),_0x68de2f);logger[_0x16f9('0xf')](_0x16f9('0x20'),_0x68de2f,JSON[_0x16f9('0x10')](_0x49ea28));_0x4b5b0b(_0x49ea28);})[_0x16f9('0x15')](function(_0x150b58){logger[_0x16f9('0x12')](_0x16f9('0x20'),_0x150b58['message'],_0x68de2f);_0x1f037d(_0x40c56a[_0x16f9('0x12')](0x1f4,_0x150b58[_0x16f9('0x13')]));});});}; \ No newline at end of file +var _0xfe3b=['../../config/environment','http','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','catch','GetSugarcrmAccount','options','attributes','limit','map','include','model','debug','ShowSugarcrmAccount','SugarcrmAccount','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5d6280,_0x3f72ab){var _0x77b738=function(_0x1b8208){while(--_0x1b8208){_0x5d6280['push'](_0x5d6280['shift']());}};_0x77b738(++_0x3f72ab);}(_0xfe3b,0x9c));var _0xbfe3=function(_0x4f03e5,_0x16d974){_0x4f03e5=_0x4f03e5-0x0;var _0x2d4e1c=_0xfe3b[_0x4f03e5];return _0x2d4e1c;};'use strict';var _=require(_0xbfe3('0x0'));var util=require(_0xbfe3('0x1'));var moment=require(_0xbfe3('0x2'));var BPromise=require(_0xbfe3('0x3'));var rs=require(_0xbfe3('0x4'));var fs=require('fs');var Redis=require(_0xbfe3('0x5'));var db=require(_0xbfe3('0x6'))['db'];var utils=require(_0xbfe3('0x7'));var logger=require(_0xbfe3('0x8'))('rpc');var config=require(_0xbfe3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbfe3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcdd415,_0x51a92c,_0x543533){return new BPromise(function(_0x2c1fd5,_0x147316){return client['request'](_0xcdd415,_0x543533)[_0xbfe3('0xb')](function(_0x215323){logger[_0xbfe3('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x51a92c,_0xbfe3('0xd'));logger['debug'](_0xbfe3('0xe'),_0x51a92c,_0xbfe3('0xd'),JSON[_0xbfe3('0xf')](_0x215323));if(_0x215323[_0xbfe3('0x10')]){if(_0x215323[_0xbfe3('0x10')][_0xbfe3('0x11')]===0x1f4){logger['error'](_0xbfe3('0x12'),_0x51a92c,_0x215323[_0xbfe3('0x10')][_0xbfe3('0x13')]);return _0x147316(_0x215323[_0xbfe3('0x10')][_0xbfe3('0x13')]);}logger[_0xbfe3('0x10')](_0xbfe3('0x12'),_0x51a92c,_0x215323['error'][_0xbfe3('0x13')]);return _0x2c1fd5(_0x215323['error'][_0xbfe3('0x13')]);}else{logger[_0xbfe3('0xc')](_0xbfe3('0x12'),_0x51a92c,_0xbfe3('0xd'));_0x2c1fd5(_0x215323['result'][_0xbfe3('0x13')]);}})[_0xbfe3('0x14')](function(_0x50567e){logger[_0xbfe3('0x10')](_0xbfe3('0x12'),_0x51a92c,_0x50567e);_0x147316(_0x50567e);});});}exports[_0xbfe3('0x15')]=function(_0x2a5f11){var _0xa289a8=this;return new Promise(function(_0x28edec,_0x2d111f){return db['SugarcrmAccount']['findAll']({'raw':_0x2a5f11[_0xbfe3('0x16')]?_0x2a5f11[_0xbfe3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2a5f11[_0xbfe3('0x16')]?_0x2a5f11['options']['where']||null:null,'attributes':_0x2a5f11[_0xbfe3('0x16')]?_0x2a5f11[_0xbfe3('0x16')][_0xbfe3('0x17')]||null:null,'limit':_0x2a5f11['options']?_0x2a5f11[_0xbfe3('0x16')][_0xbfe3('0x18')]||null:null,'include':_0x2a5f11[_0xbfe3('0x16')]?_0x2a5f11['options']['include']?_[_0xbfe3('0x19')](_0x2a5f11[_0xbfe3('0x16')]['include'],function(_0x5d70fb){return{'model':db[_0x5d70fb['model']],'as':_0x5d70fb['as'],'attributes':_0x5d70fb[_0xbfe3('0x17')],'include':_0x5d70fb[_0xbfe3('0x1a')]?_[_0xbfe3('0x19')](_0x5d70fb['include'],function(_0x5141e2){return{'model':db[_0x5141e2[_0xbfe3('0x1b')]],'as':_0x5141e2['as'],'attributes':_0x5141e2[_0xbfe3('0x17')],'include':_0x5141e2[_0xbfe3('0x1a')]?_[_0xbfe3('0x19')](_0x5141e2[_0xbfe3('0x1a')],function(_0x37cdf4){return{'model':db[_0x37cdf4[_0xbfe3('0x1b')]],'as':_0x37cdf4['as'],'attributes':_0x37cdf4[_0xbfe3('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbfe3('0xb')](function(_0x488c47){logger['info'](_0xbfe3('0x15'),_0x2a5f11);logger[_0xbfe3('0x1c')](_0xbfe3('0x15'),_0x2a5f11,JSON[_0xbfe3('0xf')](_0x488c47));_0x28edec(_0x488c47);})[_0xbfe3('0x14')](function(_0x2419e6){logger['error'](_0xbfe3('0x15'),_0x2419e6[_0xbfe3('0x13')],_0x2a5f11);_0x2d111f(_0xa289a8[_0xbfe3('0x10')](0x1f4,_0x2419e6[_0xbfe3('0x13')]));});});};exports[_0xbfe3('0x1d')]=function(_0x3ff68d){var _0x4090fb=this;return new Promise(function(_0x3f2d54,_0x429c34){return db[_0xbfe3('0x1e')]['find']({'raw':_0x3ff68d[_0xbfe3('0x16')]?_0x3ff68d['options'][_0xbfe3('0x1f')]===undefined?!![]:![]:!![],'where':_0x3ff68d[_0xbfe3('0x16')]?_0x3ff68d[_0xbfe3('0x16')][_0xbfe3('0x20')]||null:null,'attributes':_0x3ff68d[_0xbfe3('0x16')]?_0x3ff68d[_0xbfe3('0x16')][_0xbfe3('0x17')]||null:null,'include':_0x3ff68d[_0xbfe3('0x16')]?_0x3ff68d[_0xbfe3('0x16')][_0xbfe3('0x1a')]?_[_0xbfe3('0x19')](_0x3ff68d[_0xbfe3('0x16')][_0xbfe3('0x1a')],function(_0x235626){return{'model':db[_0x235626[_0xbfe3('0x1b')]],'as':_0x235626['as'],'attributes':_0x235626[_0xbfe3('0x17')],'include':_0x235626[_0xbfe3('0x1a')]?_[_0xbfe3('0x19')](_0x235626[_0xbfe3('0x1a')],function(_0x4723a4){return{'model':db[_0x4723a4['model']],'as':_0x4723a4['as'],'attributes':_0x4723a4[_0xbfe3('0x17')],'include':_0x4723a4[_0xbfe3('0x1a')]?_['map'](_0x4723a4[_0xbfe3('0x1a')],function(_0x561fdd){return{'model':db[_0x561fdd[_0xbfe3('0x1b')]],'as':_0x561fdd['as'],'attributes':_0x561fdd['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfe3('0xb')](function(_0x175390){logger[_0xbfe3('0xc')]('ShowSugarcrmAccount',_0x3ff68d);logger[_0xbfe3('0x1c')](_0xbfe3('0x1d'),_0x3ff68d,JSON[_0xbfe3('0xf')](_0x175390));_0x3f2d54(_0x175390);})[_0xbfe3('0x14')](function(_0x259681){logger[_0xbfe3('0x10')](_0xbfe3('0x1d'),_0x259681[_0xbfe3('0x13')],_0x3ff68d);_0x429c34(_0x4090fb[_0xbfe3('0x10')](0x1f4,_0x259681[_0xbfe3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index b10baae..9caa97b 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62b9=['../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','index','get','show','isAuthenticated','/:id/descriptions','getDescriptions','/:id','update','delete','multer','util','express','Router'];(function(_0x4b780c,_0x174cbf){var _0x4cff25=function(_0x56de6a){while(--_0x56de6a){_0x4b780c['push'](_0x4b780c['shift']());}};_0x4cff25(++_0x174cbf);}(_0x62b9,0x18c));var _0x962b=function(_0x4f3921,_0xf441ec){_0x4f3921=_0x4f3921-0x0;var _0x58120d=_0x62b9[_0x4f3921];return _0x58120d;};'use strict';var multer=require(_0x962b('0x0'));var util=require(_0x962b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x962b('0x2'));var router=express[_0x962b('0x3')]();var auth=require(_0x962b('0x4'));var interaction=require(_0x962b('0x5'));var config=require('../../config/environment');var controller=require(_0x962b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x962b('0x7')]);router[_0x962b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x962b('0x9')]);router[_0x962b('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x962b('0x8')]('/:id/subjects',auth[_0x962b('0xa')](),controller['getSubjects']);router[_0x962b('0x8')](_0x962b('0xb'),auth['isAuthenticated'](),controller[_0x962b('0xc')]);router['post']('/',auth[_0x962b('0xa')](),controller['create']);router['put'](_0x962b('0xd'),auth[_0x962b('0xa')](),controller[_0x962b('0xe')]);router[_0x962b('0xf')](_0x962b('0xd'),auth[_0x962b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8f62=['destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0x8f62,0x13c));var _0x28f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f62[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x28f6('0x0'));var util=require(_0x28f6('0x1'));var path=require('path');var timeout=require(_0x28f6('0x2'));var express=require(_0x28f6('0x3'));var router=express['Router']();var auth=require(_0x28f6('0x4'));var interaction=require(_0x28f6('0x5'));var config=require(_0x28f6('0x6'));var controller=require(_0x28f6('0x7'));router[_0x28f6('0x8')]('/',auth[_0x28f6('0x9')](),controller['index']);router[_0x28f6('0x8')](_0x28f6('0xa'),auth[_0x28f6('0x9')](),controller[_0x28f6('0xb')]);router[_0x28f6('0x8')]('/:id/fields',auth[_0x28f6('0x9')](),controller[_0x28f6('0xc')]);router[_0x28f6('0x8')](_0x28f6('0xd'),auth['isAuthenticated'](),controller[_0x28f6('0xe')]);router[_0x28f6('0x8')](_0x28f6('0xf'),auth[_0x28f6('0x9')](),controller[_0x28f6('0x10')]);router['post']('/',auth[_0x28f6('0x9')](),controller[_0x28f6('0x11')]);router[_0x28f6('0x12')]('/:id',auth[_0x28f6('0x9')](),controller['update']);router[_0x28f6('0x13')](_0x28f6('0xa'),auth[_0x28f6('0x9')](),controller[_0x28f6('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 8582910..6127d45 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda8e=['STRING','sequelize'];(function(_0x4b5cf7,_0x1fcda0){var _0x292b3b=function(_0x597030){while(--_0x597030){_0x4b5cf7['push'](_0x4b5cf7['shift']());}};_0x292b3b(++_0x1fcda0);}(_0xda8e,0x153));var _0xeda8=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0xda8e[_0x35b18a];return _0x4db1bd;};'use strict';var Sequelize=require(_0xeda8('0x0'));module['exports']={'name':{'type':Sequelize[_0xeda8('0x1')]},'description':{'type':Sequelize[_0xeda8('0x1')]}}; \ No newline at end of file +var _0xcb2f=['sequelize','STRING'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xcb2f,0x10e));var _0xfcb2=function(_0x4a6171,_0x15ded7){_0x4a6171=_0x4a6171-0x0;var _0x28ad51=_0xcb2f[_0x4a6171];return _0x28ad51;};'use strict';var Sequelize=require(_0xfcb2('0x0'));module['exports']={'name':{'type':Sequelize[_0xfcb2('0x1')]},'description':{'type':Sequelize[_0xfcb2('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index a7ee6c6..ed26884 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70a9=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','create','body','destroy','SugarcrmField','getFields','getSubjects','getDescriptions','findOne','rimraf','zip-dir','request-promise','moment','bluebird','util','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x15bb28,_0x2257e2){var _0x2e5700=function(_0x44a5c2){while(--_0x44a5c2){_0x15bb28['push'](_0x15bb28['shift']());}};_0x2e5700(++_0x2257e2);}(_0x70a9,0xcf));var _0x970a=function(_0x3cee05,_0x530dc9){_0x3cee05=_0x3cee05-0x0;var _0x2f358e=_0x70a9[_0x3cee05];return _0x2f358e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x970a('0x0'));var zipdir=require(_0x970a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x970a('0x2'));var moment=require(_0x970a('0x3'));var BPromise=require(_0x970a('0x4'));var Mustache=require('mustache');var util=require(_0x970a('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x970a('0x6'));var fs=require('fs');var _=require(_0x970a('0x7'));var squel=require(_0x970a('0x8'));var crypto=require(_0x970a('0x9'));var jsforce=require(_0x970a('0xa'));var deskjs=require(_0x970a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x970a('0xc'));var Papa=require(_0x970a('0xd'));var Redis=require(_0x970a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x970a('0xf'));var as=require(_0x970a('0x10'));var hardwareService=require(_0x970a('0x11'));var logger=require(_0x970a('0x12'))(_0x970a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x970a('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0xea7165,_0x33fc1b,_0x3b5be4){if(_0x3b5be4){var _0x5f2d76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f2d76['test'](_0x33fc1b)){return _0xea7165;}else{throw new db[(_0x970a('0x15'))][(_0x970a('0x16'))](_0x970a('0x17'));}}else{return _0xea7165;}}function respondWithRpcPromise(_0x199542,_0x514a56,_0x198861,_0xc71bfd){return new BPromise(function(_0x25008d,_0x52126e){var _0x230d5f=_0xc71bfd||client;return _0x230d5f[_0x970a('0x18')](_0x199542,_0x198861)[_0x970a('0x19')](function(_0x2938c3){logger['info'](_0x970a('0x1a'),_0x514a56,_0x970a('0x1b'));logger['debug'](_0x970a('0x1c'),_0x514a56,'request\x20sent',JSON[_0x970a('0x1d')](_0x2938c3));if(_0x2938c3[_0x970a('0x1e')]){if(_0x2938c3[_0x970a('0x1e')][_0x970a('0x1f')]===0x1f4){logger[_0x970a('0x1e')](_0x970a('0x1a'),_0x514a56,_0x2938c3[_0x970a('0x1e')][_0x970a('0x20')]);return _0x52126e(_0x2938c3['error']['message']);}logger[_0x970a('0x1e')](_0x970a('0x1a'),_0x514a56,_0x2938c3['error'][_0x970a('0x20')]);return _0x25008d(_0x2938c3['error'][_0x970a('0x20')]);}else{logger[_0x970a('0x21')](_0x970a('0x1a'),_0x514a56,_0x970a('0x1b'));_0x25008d(_0x2938c3[_0x970a('0x22')][_0x970a('0x20')]);}})[_0x970a('0x23')](function(_0x4f8013){logger[_0x970a('0x1e')](_0x970a('0x1a'),_0x514a56,_0x4f8013);_0x52126e(_0x4f8013);});});}function respondWithStatusCode(_0x58328f,_0xa0d4cd){_0xa0d4cd=_0xa0d4cd||0xcc;return function(_0x330a83){if(_0x330a83){return _0x58328f['sendStatus'](_0xa0d4cd);}return _0x58328f[_0x970a('0x24')](_0xa0d4cd)[_0x970a('0x25')]();};}function respondWithResult(_0x4e85dd,_0x121d7e){_0x121d7e=_0x121d7e||0xc8;return function(_0x4aaecb){if(_0x4aaecb){return _0x4e85dd[_0x970a('0x24')](_0x121d7e)['json'](_0x4aaecb);}};}function respondWithFilteredResult(_0x2a1688,_0x1a6eb3){return function(_0xea978d){if(_0xea978d){var _0x594fec=_0xea978d[_0x970a('0x26')],_0xbee720=_0x1a6eb3[_0x970a('0x27')],_0x310c8b=_0x1a6eb3[_0x970a('0x27')]+_0x1a6eb3[_0x970a('0x28')],_0xf5300e;if(_0x310c8b>=_0x594fec){_0x310c8b=_0x594fec;_0xf5300e=0xc8;}else{_0xf5300e=0xce;}_0x2a1688[_0x970a('0x24')](_0xf5300e);return _0x2a1688[_0x970a('0x29')](_0x970a('0x2a'),_0xbee720+'-'+_0x310c8b+'/'+_0x594fec)[_0x970a('0x2b')](_0xea978d);}return null;};}function patchUpdates(_0x42bef2){return function(_0x4f0ad1){try{jsonpatch[_0x970a('0x2c')](_0x4f0ad1,_0x42bef2,!![]);}catch(_0x10d4af){return BPromise[_0x970a('0x2d')](_0x10d4af);}return _0x4f0ad1[_0x970a('0x2e')]();};}function saveUpdates(_0x1ca044,_0x459d4d){return function(_0x7b50ce){if(_0x7b50ce){return _0x7b50ce[_0x970a('0x2f')](_0x1ca044)[_0x970a('0x19')](function(_0x1e0454){return _0x1e0454;});}return null;};}function removeEntity(_0x15cac5,_0x7531fc){return function(_0x38f1f4){if(_0x38f1f4){return _0x38f1f4['destroy']()['then'](function(){_0x15cac5[_0x970a('0x24')](0xcc)[_0x970a('0x25')]();});}};}function handleEntityNotFound(_0x466fe4,_0x178dff){return function(_0x16a7a6){if(!_0x16a7a6){_0x466fe4[_0x970a('0x30')](0x194);}return _0x16a7a6;};}function handleError(_0x44480e,_0x3958e3){_0x3958e3=_0x3958e3||0x1f4;return function(_0x5a8e7a){logger[_0x970a('0x1e')](_0x5a8e7a[_0x970a('0x31')]);if(_0x5a8e7a[_0x970a('0x32')]){delete _0x5a8e7a[_0x970a('0x32')];}_0x44480e['status'](_0x3958e3)[_0x970a('0x33')](_0x5a8e7a);};}exports[_0x970a('0x34')]=function(_0x5f49bd,_0x315d31){var _0x57918b={},_0x843396={},_0x565546={'count':0x0,'rows':[]};var _0x59dadc=_[_0x970a('0x35')](db[_0x970a('0x36')][_0x970a('0x37')],function(_0x5e97e4){return{'name':_0x5e97e4[_0x970a('0x38')],'type':_0x5e97e4['type'][_0x970a('0x39')]};});_0x843396[_0x970a('0x3a')]=_[_0x970a('0x35')](_0x59dadc,_0x970a('0x32'));_0x843396['query']=_[_0x970a('0x3b')](_0x5f49bd[_0x970a('0x3c')]);_0x843396[_0x970a('0x3d')]=_[_0x970a('0x3e')](_0x843396[_0x970a('0x3a')],_0x843396[_0x970a('0x3c')]);_0x57918b[_0x970a('0x3f')]=_[_0x970a('0x3e')](_0x843396[_0x970a('0x3a')],qs['fields'](_0x5f49bd['query'][_0x970a('0x40')]));_0x57918b['attributes']=_0x57918b[_0x970a('0x3f')]['length']?_0x57918b[_0x970a('0x3f')]:_0x843396['model'];if(!_0x5f49bd[_0x970a('0x3c')][_0x970a('0x41')](_0x970a('0x42'))){_0x57918b[_0x970a('0x28')]=qs[_0x970a('0x28')](_0x5f49bd[_0x970a('0x3c')][_0x970a('0x28')]);_0x57918b[_0x970a('0x27')]=qs[_0x970a('0x27')](_0x5f49bd[_0x970a('0x3c')][_0x970a('0x27')]);}_0x57918b[_0x970a('0x43')]=qs[_0x970a('0x44')](_0x5f49bd[_0x970a('0x3c')]['sort']);_0x57918b[_0x970a('0x45')]=qs[_0x970a('0x3d')](_[_0x970a('0x46')](_0x5f49bd[_0x970a('0x3c')],_0x843396[_0x970a('0x3d')]));if(_0x5f49bd[_0x970a('0x3c')][_0x970a('0x47')]){_0x57918b[_0x970a('0x45')]=_[_0x970a('0x48')](_0x57918b['where'],{'$or':_[_0x970a('0x35')](_0x59dadc,function(_0xeb34bc){if(_0xeb34bc['type']!==_0x970a('0x49')){var _0x5b104d={};_0x5b104d[_0xeb34bc[_0x970a('0x32')]]={'$like':'%'+_0x5f49bd[_0x970a('0x3c')][_0x970a('0x47')]+'%'};return _0x5b104d;}})});}_0x57918b=_[_0x970a('0x48')]({},_0x57918b,_0x5f49bd[_0x970a('0x4a')]);var _0x17f7df={'where':_0x57918b[_0x970a('0x45')]};return db[_0x970a('0x36')][_0x970a('0x26')](_0x17f7df)[_0x970a('0x19')](function(_0x45e5b1){_0x565546[_0x970a('0x26')]=_0x45e5b1;if(_0x5f49bd[_0x970a('0x3c')][_0x970a('0x4b')]){_0x57918b['include']=[{'all':!![]}];}return db[_0x970a('0x36')][_0x970a('0x4c')](_0x57918b);})[_0x970a('0x19')](function(_0x3501f1){_0x565546[_0x970a('0x4d')]=_0x3501f1;return _0x565546;})[_0x970a('0x19')](respondWithFilteredResult(_0x315d31,_0x57918b))[_0x970a('0x23')](handleError(_0x315d31,null));};exports[_0x970a('0x4e')]=function(_0x5a0231,_0x21e076){var _0x398b3d={'raw':![],'where':{'id':_0x5a0231[_0x970a('0x4f')]['id']}},_0x287a1d={};_0x287a1d[_0x970a('0x3a')]=_[_0x970a('0x3b')](db[_0x970a('0x36')][_0x970a('0x37')]);_0x287a1d['query']=_[_0x970a('0x3b')](_0x5a0231[_0x970a('0x3c')]);_0x287a1d[_0x970a('0x3d')]=_[_0x970a('0x3e')](_0x287a1d[_0x970a('0x3a')],_0x287a1d[_0x970a('0x3c')]);_0x398b3d[_0x970a('0x3f')]=_[_0x970a('0x3e')](_0x287a1d[_0x970a('0x3a')],qs[_0x970a('0x40')](_0x5a0231[_0x970a('0x3c')][_0x970a('0x40')]));_0x398b3d[_0x970a('0x3f')]=_0x398b3d[_0x970a('0x3f')][_0x970a('0x50')]?_0x398b3d[_0x970a('0x3f')]:_0x287a1d[_0x970a('0x3a')];if(_0x5a0231[_0x970a('0x3c')][_0x970a('0x4b')]){_0x398b3d[_0x970a('0x51')]=[{'all':!![]}];}_0x398b3d=_[_0x970a('0x48')]({},_0x398b3d,_0x5a0231[_0x970a('0x4a')]);return db[_0x970a('0x36')][_0x970a('0x52')](_0x398b3d)[_0x970a('0x19')](handleEntityNotFound(_0x21e076,null))[_0x970a('0x19')](respondWithResult(_0x21e076,null))[_0x970a('0x23')](handleError(_0x21e076,null));};exports['create']=function(_0x11593a,_0x5f31fb){return db[_0x970a('0x36')][_0x970a('0x53')](_0x11593a[_0x970a('0x54')],{})['then'](respondWithResult(_0x5f31fb,0xc9))[_0x970a('0x23')](handleError(_0x5f31fb,null));};exports[_0x970a('0x2f')]=function(_0x414c89,_0x24b30b){if(_0x414c89[_0x970a('0x54')]['id']){delete _0x414c89[_0x970a('0x54')]['id'];}return db[_0x970a('0x36')][_0x970a('0x52')]({'where':{'id':_0x414c89[_0x970a('0x4f')]['id']}})[_0x970a('0x19')](handleEntityNotFound(_0x24b30b,null))['then'](saveUpdates(_0x414c89[_0x970a('0x54')],null))[_0x970a('0x19')](respondWithResult(_0x24b30b,null))[_0x970a('0x23')](handleError(_0x24b30b,null));};exports[_0x970a('0x55')]=function(_0xe23906,_0x12899f){return db['SugarcrmConfiguration'][_0x970a('0x52')]({'where':{'id':_0xe23906['params']['id']}})[_0x970a('0x19')](handleEntityNotFound(_0x12899f,null))[_0x970a('0x19')](removeEntity(_0x12899f,null))[_0x970a('0x23')](handleError(_0x12899f,null));};exports['getFields']=function(_0x939e77,_0x4ee300,_0x49ea23){var _0x21cf4d={};var _0x152d13={};var _0x45192a;var _0x322b48;return db[_0x970a('0x36')]['findOne']({'where':{'id':_0x939e77[_0x970a('0x4f')]['id']}})[_0x970a('0x19')](handleEntityNotFound(_0x4ee300,null))[_0x970a('0x19')](function(_0x343e25){if(_0x343e25){_0x45192a=_0x343e25;_0x152d13[_0x970a('0x3a')]=_[_0x970a('0x3b')](db[_0x970a('0x56')]['rawAttributes']);_0x152d13[_0x970a('0x3c')]=_[_0x970a('0x3b')](_0x939e77[_0x970a('0x3c')]);_0x152d13['filters']=_['intersection'](_0x152d13['model'],_0x152d13['query']);_0x21cf4d[_0x970a('0x3f')]=_[_0x970a('0x3e')](_0x152d13['model'],qs[_0x970a('0x40')](_0x939e77[_0x970a('0x3c')][_0x970a('0x40')]));_0x21cf4d['attributes']=_0x21cf4d[_0x970a('0x3f')][_0x970a('0x50')]?_0x21cf4d[_0x970a('0x3f')]:_0x152d13[_0x970a('0x3a')];_0x21cf4d[_0x970a('0x43')]=qs[_0x970a('0x44')](_0x939e77['query']['sort']);_0x21cf4d['where']=qs[_0x970a('0x3d')](_[_0x970a('0x46')](_0x939e77[_0x970a('0x3c')],_0x152d13['filters']));if(_0x939e77[_0x970a('0x3c')][_0x970a('0x47')]){_0x21cf4d['where']=_['merge'](_0x21cf4d[_0x970a('0x45')],{'$or':_[_0x970a('0x35')](_0x21cf4d['attributes'],function(_0x333d21){var _0x402b22={};_0x402b22[_0x333d21]={'$like':'%'+_0x939e77['query'][_0x970a('0x47')]+'%'};return _0x402b22;})});}_0x21cf4d=_[_0x970a('0x48')]({},_0x21cf4d,_0x939e77['options']);return _0x45192a[_0x970a('0x57')](_0x21cf4d);}})['then'](function(_0x4e03df){if(_0x4e03df){_0x322b48=_0x4e03df[_0x970a('0x50')];if(!_0x939e77['query'][_0x970a('0x41')]('nolimit')){_0x21cf4d[_0x970a('0x28')]=qs[_0x970a('0x28')](_0x939e77[_0x970a('0x3c')][_0x970a('0x28')]);_0x21cf4d[_0x970a('0x27')]=qs[_0x970a('0x27')](_0x939e77[_0x970a('0x3c')][_0x970a('0x27')]);}return _0x45192a[_0x970a('0x57')](_0x21cf4d);}})[_0x970a('0x19')](function(_0x2451da){if(_0x2451da){return _0x2451da?{'count':_0x322b48,'rows':_0x2451da}:null;}})[_0x970a('0x19')](respondWithResult(_0x4ee300,null))[_0x970a('0x23')](handleError(_0x4ee300,null));};exports[_0x970a('0x58')]=function(_0x245e7a,_0x57cc4f,_0x3661b1){var _0x561c1c={};var _0x458d9b={};var _0x5667fd;var _0x305b01;return db[_0x970a('0x36')]['findOne']({'where':{'id':_0x245e7a[_0x970a('0x4f')]['id']}})[_0x970a('0x19')](handleEntityNotFound(_0x57cc4f,null))[_0x970a('0x19')](function(_0x325e4){if(_0x325e4){_0x5667fd=_0x325e4;_0x458d9b['model']=_[_0x970a('0x3b')](db[_0x970a('0x56')][_0x970a('0x37')]);_0x458d9b[_0x970a('0x3c')]=_[_0x970a('0x3b')](_0x245e7a[_0x970a('0x3c')]);_0x458d9b[_0x970a('0x3d')]=_[_0x970a('0x3e')](_0x458d9b[_0x970a('0x3a')],_0x458d9b[_0x970a('0x3c')]);_0x561c1c['attributes']=_[_0x970a('0x3e')](_0x458d9b[_0x970a('0x3a')],qs['fields'](_0x245e7a['query'][_0x970a('0x40')]));_0x561c1c[_0x970a('0x3f')]=_0x561c1c[_0x970a('0x3f')]['length']?_0x561c1c['attributes']:_0x458d9b[_0x970a('0x3a')];_0x561c1c[_0x970a('0x43')]=qs[_0x970a('0x44')](_0x245e7a[_0x970a('0x3c')][_0x970a('0x44')]);_0x561c1c[_0x970a('0x45')]=qs['filters'](_[_0x970a('0x46')](_0x245e7a[_0x970a('0x3c')],_0x458d9b['filters']));if(_0x245e7a[_0x970a('0x3c')][_0x970a('0x47')]){_0x561c1c[_0x970a('0x45')]=_[_0x970a('0x48')](_0x561c1c['where'],{'$or':_['map'](_0x561c1c[_0x970a('0x3f')],function(_0x1af93a){var _0x5c8dff={};_0x5c8dff[_0x1af93a]={'$like':'%'+_0x245e7a['query']['filter']+'%'};return _0x5c8dff;})});}_0x561c1c=_[_0x970a('0x48')]({},_0x561c1c,_0x245e7a[_0x970a('0x4a')]);return _0x5667fd[_0x970a('0x58')](_0x561c1c);}})[_0x970a('0x19')](function(_0x34a7ab){if(_0x34a7ab){_0x305b01=_0x34a7ab[_0x970a('0x50')];if(!_0x245e7a['query'][_0x970a('0x41')](_0x970a('0x42'))){_0x561c1c[_0x970a('0x28')]=qs[_0x970a('0x28')](_0x245e7a['query'][_0x970a('0x28')]);_0x561c1c[_0x970a('0x27')]=qs[_0x970a('0x27')](_0x245e7a[_0x970a('0x3c')][_0x970a('0x27')]);}return _0x5667fd[_0x970a('0x58')](_0x561c1c);}})[_0x970a('0x19')](function(_0x2f1128){if(_0x2f1128){return _0x2f1128?{'count':_0x305b01,'rows':_0x2f1128}:null;}})['then'](respondWithResult(_0x57cc4f,null))['catch'](handleError(_0x57cc4f,null));};exports[_0x970a('0x59')]=function(_0x32534a,_0x15b4dc,_0x3d309a){var _0x21e420={};var _0x51c286={};var _0x4e348c;var _0x489dcc;return db[_0x970a('0x36')][_0x970a('0x5a')]({'where':{'id':_0x32534a[_0x970a('0x4f')]['id']}})[_0x970a('0x19')](handleEntityNotFound(_0x15b4dc,null))[_0x970a('0x19')](function(_0x12572f){if(_0x12572f){_0x4e348c=_0x12572f;_0x51c286[_0x970a('0x3a')]=_[_0x970a('0x3b')](db[_0x970a('0x56')]['rawAttributes']);_0x51c286[_0x970a('0x3c')]=_[_0x970a('0x3b')](_0x32534a[_0x970a('0x3c')]);_0x51c286[_0x970a('0x3d')]=_['intersection'](_0x51c286[_0x970a('0x3a')],_0x51c286[_0x970a('0x3c')]);_0x21e420['attributes']=_[_0x970a('0x3e')](_0x51c286['model'],qs['fields'](_0x32534a['query']['fields']));_0x21e420['attributes']=_0x21e420[_0x970a('0x3f')][_0x970a('0x50')]?_0x21e420[_0x970a('0x3f')]:_0x51c286[_0x970a('0x3a')];_0x21e420['order']=qs['sort'](_0x32534a[_0x970a('0x3c')][_0x970a('0x44')]);_0x21e420[_0x970a('0x45')]=qs[_0x970a('0x3d')](_[_0x970a('0x46')](_0x32534a[_0x970a('0x3c')],_0x51c286[_0x970a('0x3d')]));if(_0x32534a[_0x970a('0x3c')][_0x970a('0x47')]){_0x21e420[_0x970a('0x45')]=_['merge'](_0x21e420[_0x970a('0x45')],{'$or':_[_0x970a('0x35')](_0x21e420[_0x970a('0x3f')],function(_0x3ff910){var _0x21add9={};_0x21add9[_0x3ff910]={'$like':'%'+_0x32534a[_0x970a('0x3c')][_0x970a('0x47')]+'%'};return _0x21add9;})});}_0x21e420=_[_0x970a('0x48')]({},_0x21e420,_0x32534a[_0x970a('0x4a')]);return _0x4e348c['getDescriptions'](_0x21e420);}})[_0x970a('0x19')](function(_0x12a1b6){if(_0x12a1b6){_0x489dcc=_0x12a1b6['length'];if(!_0x32534a[_0x970a('0x3c')][_0x970a('0x41')](_0x970a('0x42'))){_0x21e420['limit']=qs['limit'](_0x32534a[_0x970a('0x3c')]['limit']);_0x21e420[_0x970a('0x27')]=qs['offset'](_0x32534a['query']['offset']);}return _0x4e348c[_0x970a('0x59')](_0x21e420);}})[_0x970a('0x19')](function(_0x2c1ef2){if(_0x2c1ef2){return _0x2c1ef2?{'count':_0x489dcc,'rows':_0x2c1ef2}:null;}})[_0x970a('0x19')](respondWithResult(_0x15b4dc,null))[_0x970a('0x23')](handleError(_0x15b4dc,null));}; \ No newline at end of file +var _0x23e2=['jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','destroy','getFields','findOne','SugarcrmField','filter','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x23e2,0x167));var _0x223e=function(_0x42e675,_0x4f24ef){_0x42e675=_0x42e675-0x0;var _0x1e18b9=_0x23e2[_0x42e675];return _0x1e18b9;};'use strict';var pdf=require(_0x223e('0x0'));var emlformat=require(_0x223e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x223e('0x2'));var jsonpatch=require(_0x223e('0x3'));var rp=require('request-promise');var moment=require(_0x223e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x223e('0x5'));var util=require(_0x223e('0x6'));var path=require('path');var sox=require(_0x223e('0x7'));var csv=require(_0x223e('0x8'));var ejs=require(_0x223e('0x9'));var fs=require('fs');var _=require(_0x223e('0xa'));var squel=require(_0x223e('0xb'));var crypto=require(_0x223e('0xc'));var jsforce=require(_0x223e('0xd'));var deskjs=require(_0x223e('0xe'));var toCsv=require(_0x223e('0x8'));var querystring=require(_0x223e('0xf'));var Papa=require(_0x223e('0x10'));var Redis=require(_0x223e('0x11'));var authService=require(_0x223e('0x12'));var qs=require(_0x223e('0x13'));var as=require(_0x223e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x223e('0x15'))(_0x223e('0x16'));var utils=require('../../config/utils');var config=require(_0x223e('0x17'));var db=require(_0x223e('0x18'))['db'];var jayson=require(_0x223e('0x19'));var client=jayson[_0x223e('0x1a')][_0x223e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4a89c1,_0x40830d,_0x53f156){if(_0x53f156){var _0xd57ca0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd57ca0[_0x223e('0x1c')](_0x40830d)){return _0x4a89c1;}else{throw new db[(_0x223e('0x1d'))]['ValidationError'](_0x223e('0x1e'));}}else{return _0x4a89c1;}}function respondWithRpcPromise(_0xf31083,_0x29a224,_0x78bc8,_0x5d5d0f){return new BPromise(function(_0x3215aa,_0x4939c2){var _0x299d5a=_0x5d5d0f||client;return _0x299d5a[_0x223e('0x1f')](_0xf31083,_0x78bc8)[_0x223e('0x20')](function(_0x3cecc3){logger[_0x223e('0x21')](_0x223e('0x22'),_0x29a224,_0x223e('0x23'));logger[_0x223e('0x24')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x29a224,_0x223e('0x23'),JSON['stringify'](_0x3cecc3));if(_0x3cecc3[_0x223e('0x25')]){if(_0x3cecc3[_0x223e('0x25')]['code']===0x1f4){logger['error'](_0x223e('0x22'),_0x29a224,_0x3cecc3[_0x223e('0x25')]['message']);return _0x4939c2(_0x3cecc3['error'][_0x223e('0x26')]);}logger[_0x223e('0x25')](_0x223e('0x22'),_0x29a224,_0x3cecc3[_0x223e('0x25')][_0x223e('0x26')]);return _0x3215aa(_0x3cecc3[_0x223e('0x25')][_0x223e('0x26')]);}else{logger[_0x223e('0x21')](_0x223e('0x22'),_0x29a224,'request\x20sent');_0x3215aa(_0x3cecc3[_0x223e('0x27')][_0x223e('0x26')]);}})[_0x223e('0x28')](function(_0x5a41c1){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x29a224,_0x5a41c1);_0x4939c2(_0x5a41c1);});});}function respondWithStatusCode(_0x1ef0dc,_0x2c776b){_0x2c776b=_0x2c776b||0xcc;return function(_0x48eccb){if(_0x48eccb){return _0x1ef0dc['sendStatus'](_0x2c776b);}return _0x1ef0dc[_0x223e('0x29')](_0x2c776b)[_0x223e('0x2a')]();};}function respondWithResult(_0xf196b,_0x3ce2af){_0x3ce2af=_0x3ce2af||0xc8;return function(_0x2ad77f){if(_0x2ad77f){return _0xf196b['status'](_0x3ce2af)[_0x223e('0x2b')](_0x2ad77f);}};}function respondWithFilteredResult(_0x4dbe96,_0x22ab81){return function(_0x57d38f){if(_0x57d38f){var _0xff63db=_0x57d38f[_0x223e('0x2c')],_0x145d06=_0x22ab81[_0x223e('0x2d')],_0x1e071b=_0x22ab81[_0x223e('0x2d')]+_0x22ab81[_0x223e('0x2e')],_0x1ebfee;if(_0x1e071b>=_0xff63db){_0x1e071b=_0xff63db;_0x1ebfee=0xc8;}else{_0x1ebfee=0xce;}_0x4dbe96['status'](_0x1ebfee);return _0x4dbe96['set'](_0x223e('0x2f'),_0x145d06+'-'+_0x1e071b+'/'+_0xff63db)[_0x223e('0x2b')](_0x57d38f);}return null;};}function patchUpdates(_0x19dca5){return function(_0x1b4547){try{jsonpatch[_0x223e('0x30')](_0x1b4547,_0x19dca5,!![]);}catch(_0x6b92a3){return BPromise[_0x223e('0x31')](_0x6b92a3);}return _0x1b4547[_0x223e('0x32')]();};}function saveUpdates(_0x37f2f7,_0x483a69){return function(_0x309ee2){if(_0x309ee2){return _0x309ee2[_0x223e('0x33')](_0x37f2f7)[_0x223e('0x20')](function(_0x5f42c8){return _0x5f42c8;});}return null;};}function removeEntity(_0x1e6371,_0x1dd1bf){return function(_0x2cd3c1){if(_0x2cd3c1){return _0x2cd3c1['destroy']()['then'](function(){_0x1e6371['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bc878,_0x3f58ef){return function(_0x3c98fd){if(!_0x3c98fd){_0x1bc878[_0x223e('0x34')](0x194);}return _0x3c98fd;};}function handleError(_0x37c298,_0x2c7488){_0x2c7488=_0x2c7488||0x1f4;return function(_0x4dc01c){logger[_0x223e('0x25')](_0x4dc01c[_0x223e('0x35')]);if(_0x4dc01c['name']){delete _0x4dc01c[_0x223e('0x36')];}_0x37c298[_0x223e('0x29')](_0x2c7488)[_0x223e('0x37')](_0x4dc01c);};}exports[_0x223e('0x38')]=function(_0x163421,_0x4dd15c){var _0x5be1ae={},_0x2d64a3={},_0x4b6451={'count':0x0,'rows':[]};var _0x39b51b=_[_0x223e('0x39')](db[_0x223e('0x3a')][_0x223e('0x3b')],function(_0x5f3126){return{'name':_0x5f3126[_0x223e('0x3c')],'type':_0x5f3126[_0x223e('0x3d')][_0x223e('0x3e')]};});_0x2d64a3['model']=_[_0x223e('0x39')](_0x39b51b,_0x223e('0x36'));_0x2d64a3[_0x223e('0x3f')]=_['keys'](_0x163421[_0x223e('0x3f')]);_0x2d64a3['filters']=_[_0x223e('0x40')](_0x2d64a3[_0x223e('0x41')],_0x2d64a3[_0x223e('0x3f')]);_0x5be1ae['attributes']=_[_0x223e('0x40')](_0x2d64a3[_0x223e('0x41')],qs['fields'](_0x163421[_0x223e('0x3f')][_0x223e('0x42')]));_0x5be1ae[_0x223e('0x43')]=_0x5be1ae[_0x223e('0x43')][_0x223e('0x44')]?_0x5be1ae[_0x223e('0x43')]:_0x2d64a3[_0x223e('0x41')];if(!_0x163421[_0x223e('0x3f')][_0x223e('0x45')](_0x223e('0x46'))){_0x5be1ae[_0x223e('0x2e')]=qs[_0x223e('0x2e')](_0x163421[_0x223e('0x3f')][_0x223e('0x2e')]);_0x5be1ae[_0x223e('0x2d')]=qs[_0x223e('0x2d')](_0x163421['query'][_0x223e('0x2d')]);}_0x5be1ae[_0x223e('0x47')]=qs[_0x223e('0x48')](_0x163421[_0x223e('0x3f')][_0x223e('0x48')]);_0x5be1ae[_0x223e('0x49')]=qs[_0x223e('0x4a')](_[_0x223e('0x4b')](_0x163421['query'],_0x2d64a3[_0x223e('0x4a')]));if(_0x163421['query']['filter']){_0x5be1ae['where']=_[_0x223e('0x4c')](_0x5be1ae['where'],{'$or':_[_0x223e('0x39')](_0x39b51b,function(_0x4f4ef1){if(_0x4f4ef1[_0x223e('0x3d')]!==_0x223e('0x4d')){var _0x377e77={};_0x377e77[_0x4f4ef1['name']]={'$like':'%'+_0x163421[_0x223e('0x3f')]['filter']+'%'};return _0x377e77;}})});}_0x5be1ae=_[_0x223e('0x4c')]({},_0x5be1ae,_0x163421[_0x223e('0x4e')]);var _0x3e3c92={'where':_0x5be1ae['where']};return db[_0x223e('0x3a')][_0x223e('0x2c')](_0x3e3c92)[_0x223e('0x20')](function(_0x3226ef){_0x4b6451['count']=_0x3226ef;if(_0x163421[_0x223e('0x3f')][_0x223e('0x4f')]){_0x5be1ae[_0x223e('0x50')]=[{'all':!![]}];}return db[_0x223e('0x3a')][_0x223e('0x51')](_0x5be1ae);})['then'](function(_0x2a6c7c){_0x4b6451[_0x223e('0x52')]=_0x2a6c7c;return _0x4b6451;})[_0x223e('0x20')](respondWithFilteredResult(_0x4dd15c,_0x5be1ae))[_0x223e('0x28')](handleError(_0x4dd15c,null));};exports[_0x223e('0x53')]=function(_0xb06c8d,_0x22ed1d){var _0xb832d4={'raw':![],'where':{'id':_0xb06c8d[_0x223e('0x54')]['id']}},_0x6f7737={};_0x6f7737[_0x223e('0x41')]=_[_0x223e('0x55')](db[_0x223e('0x3a')]['rawAttributes']);_0x6f7737[_0x223e('0x3f')]=_[_0x223e('0x55')](_0xb06c8d[_0x223e('0x3f')]);_0x6f7737['filters']=_[_0x223e('0x40')](_0x6f7737[_0x223e('0x41')],_0x6f7737[_0x223e('0x3f')]);_0xb832d4[_0x223e('0x43')]=_['intersection'](_0x6f7737['model'],qs[_0x223e('0x42')](_0xb06c8d[_0x223e('0x3f')]['fields']));_0xb832d4[_0x223e('0x43')]=_0xb832d4[_0x223e('0x43')][_0x223e('0x44')]?_0xb832d4[_0x223e('0x43')]:_0x6f7737[_0x223e('0x41')];if(_0xb06c8d['query']['includeAll']){_0xb832d4[_0x223e('0x50')]=[{'all':!![]}];}_0xb832d4=_[_0x223e('0x4c')]({},_0xb832d4,_0xb06c8d[_0x223e('0x4e')]);return db['SugarcrmConfiguration'][_0x223e('0x56')](_0xb832d4)[_0x223e('0x20')](handleEntityNotFound(_0x22ed1d,null))[_0x223e('0x20')](respondWithResult(_0x22ed1d,null))[_0x223e('0x28')](handleError(_0x22ed1d,null));};exports[_0x223e('0x57')]=function(_0xd14dbb,_0x34279f){return db['SugarcrmConfiguration']['create'](_0xd14dbb['body'],{})[_0x223e('0x20')](respondWithResult(_0x34279f,0xc9))[_0x223e('0x28')](handleError(_0x34279f,null));};exports[_0x223e('0x33')]=function(_0x17bcc7,_0x235041){if(_0x17bcc7[_0x223e('0x58')]['id']){delete _0x17bcc7['body']['id'];}return db[_0x223e('0x3a')]['find']({'where':{'id':_0x17bcc7[_0x223e('0x54')]['id']}})[_0x223e('0x20')](handleEntityNotFound(_0x235041,null))['then'](saveUpdates(_0x17bcc7[_0x223e('0x58')],null))[_0x223e('0x20')](respondWithResult(_0x235041,null))[_0x223e('0x28')](handleError(_0x235041,null));};exports[_0x223e('0x59')]=function(_0x39ef39,_0x1fe4b5){return db[_0x223e('0x3a')][_0x223e('0x56')]({'where':{'id':_0x39ef39['params']['id']}})[_0x223e('0x20')](handleEntityNotFound(_0x1fe4b5,null))['then'](removeEntity(_0x1fe4b5,null))[_0x223e('0x28')](handleError(_0x1fe4b5,null));};exports[_0x223e('0x5a')]=function(_0x4d53b3,_0x3671fb,_0x26b830){var _0x14f85f={};var _0x401ec4={};var _0x1f5a87;var _0x3fcb23;return db[_0x223e('0x3a')][_0x223e('0x5b')]({'where':{'id':_0x4d53b3[_0x223e('0x54')]['id']}})[_0x223e('0x20')](handleEntityNotFound(_0x3671fb,null))[_0x223e('0x20')](function(_0x2a863a){if(_0x2a863a){_0x1f5a87=_0x2a863a;_0x401ec4['model']=_[_0x223e('0x55')](db[_0x223e('0x5c')]['rawAttributes']);_0x401ec4[_0x223e('0x3f')]=_['keys'](_0x4d53b3['query']);_0x401ec4[_0x223e('0x4a')]=_[_0x223e('0x40')](_0x401ec4[_0x223e('0x41')],_0x401ec4['query']);_0x14f85f[_0x223e('0x43')]=_['intersection'](_0x401ec4[_0x223e('0x41')],qs[_0x223e('0x42')](_0x4d53b3[_0x223e('0x3f')]['fields']));_0x14f85f[_0x223e('0x43')]=_0x14f85f['attributes'][_0x223e('0x44')]?_0x14f85f['attributes']:_0x401ec4['model'];_0x14f85f[_0x223e('0x47')]=qs[_0x223e('0x48')](_0x4d53b3[_0x223e('0x3f')][_0x223e('0x48')]);_0x14f85f[_0x223e('0x49')]=qs[_0x223e('0x4a')](_[_0x223e('0x4b')](_0x4d53b3[_0x223e('0x3f')],_0x401ec4[_0x223e('0x4a')]));if(_0x4d53b3[_0x223e('0x3f')]['filter']){_0x14f85f[_0x223e('0x49')]=_['merge'](_0x14f85f[_0x223e('0x49')],{'$or':_[_0x223e('0x39')](_0x14f85f[_0x223e('0x43')],function(_0x51b992){var _0x55b4de={};_0x55b4de[_0x51b992]={'$like':'%'+_0x4d53b3[_0x223e('0x3f')][_0x223e('0x5d')]+'%'};return _0x55b4de;})});}_0x14f85f=_['merge']({},_0x14f85f,_0x4d53b3[_0x223e('0x4e')]);return _0x1f5a87[_0x223e('0x5a')](_0x14f85f);}})['then'](function(_0xf11736){if(_0xf11736){_0x3fcb23=_0xf11736[_0x223e('0x44')];if(!_0x4d53b3[_0x223e('0x3f')][_0x223e('0x45')]('nolimit')){_0x14f85f['limit']=qs[_0x223e('0x2e')](_0x4d53b3[_0x223e('0x3f')]['limit']);_0x14f85f[_0x223e('0x2d')]=qs[_0x223e('0x2d')](_0x4d53b3[_0x223e('0x3f')][_0x223e('0x2d')]);}return _0x1f5a87['getFields'](_0x14f85f);}})['then'](function(_0x31bbd4){if(_0x31bbd4){return _0x31bbd4?{'count':_0x3fcb23,'rows':_0x31bbd4}:null;}})[_0x223e('0x20')](respondWithResult(_0x3671fb,null))[_0x223e('0x28')](handleError(_0x3671fb,null));};exports[_0x223e('0x5e')]=function(_0x4f4460,_0x425965,_0x49c64d){var _0x26c74e={};var _0xd85b2f={};var _0x34bddb;var _0x2aacdf;return db[_0x223e('0x3a')][_0x223e('0x5b')]({'where':{'id':_0x4f4460[_0x223e('0x54')]['id']}})[_0x223e('0x20')](handleEntityNotFound(_0x425965,null))['then'](function(_0x4c389a){if(_0x4c389a){_0x34bddb=_0x4c389a;_0xd85b2f['model']=_[_0x223e('0x55')](db['SugarcrmField']['rawAttributes']);_0xd85b2f[_0x223e('0x3f')]=_['keys'](_0x4f4460['query']);_0xd85b2f[_0x223e('0x4a')]=_['intersection'](_0xd85b2f['model'],_0xd85b2f[_0x223e('0x3f')]);_0x26c74e[_0x223e('0x43')]=_[_0x223e('0x40')](_0xd85b2f[_0x223e('0x41')],qs[_0x223e('0x42')](_0x4f4460[_0x223e('0x3f')][_0x223e('0x42')]));_0x26c74e[_0x223e('0x43')]=_0x26c74e[_0x223e('0x43')][_0x223e('0x44')]?_0x26c74e['attributes']:_0xd85b2f['model'];_0x26c74e['order']=qs['sort'](_0x4f4460['query'][_0x223e('0x48')]);_0x26c74e['where']=qs[_0x223e('0x4a')](_[_0x223e('0x4b')](_0x4f4460['query'],_0xd85b2f[_0x223e('0x4a')]));if(_0x4f4460['query'][_0x223e('0x5d')]){_0x26c74e[_0x223e('0x49')]=_[_0x223e('0x4c')](_0x26c74e[_0x223e('0x49')],{'$or':_[_0x223e('0x39')](_0x26c74e[_0x223e('0x43')],function(_0x3803e4){var _0x5d5320={};_0x5d5320[_0x3803e4]={'$like':'%'+_0x4f4460['query'][_0x223e('0x5d')]+'%'};return _0x5d5320;})});}_0x26c74e=_['merge']({},_0x26c74e,_0x4f4460[_0x223e('0x4e')]);return _0x34bddb[_0x223e('0x5e')](_0x26c74e);}})[_0x223e('0x20')](function(_0x4dd7cb){if(_0x4dd7cb){_0x2aacdf=_0x4dd7cb[_0x223e('0x44')];if(!_0x4f4460[_0x223e('0x3f')]['hasOwnProperty']('nolimit')){_0x26c74e[_0x223e('0x2e')]=qs[_0x223e('0x2e')](_0x4f4460['query'][_0x223e('0x2e')]);_0x26c74e[_0x223e('0x2d')]=qs[_0x223e('0x2d')](_0x4f4460['query']['offset']);}return _0x34bddb[_0x223e('0x5e')](_0x26c74e);}})['then'](function(_0x383096){if(_0x383096){return _0x383096?{'count':_0x2aacdf,'rows':_0x383096}:null;}})[_0x223e('0x20')](respondWithResult(_0x425965,null))[_0x223e('0x28')](handleError(_0x425965,null));};exports[_0x223e('0x5f')]=function(_0x485045,_0x58d298,_0x2d6f0f){var _0x155095={};var _0x3ca571={};var _0x13ebfc;var _0x46a768;return db[_0x223e('0x3a')]['findOne']({'where':{'id':_0x485045[_0x223e('0x54')]['id']}})[_0x223e('0x20')](handleEntityNotFound(_0x58d298,null))['then'](function(_0x51efe6){if(_0x51efe6){_0x13ebfc=_0x51efe6;_0x3ca571[_0x223e('0x41')]=_[_0x223e('0x55')](db[_0x223e('0x5c')][_0x223e('0x3b')]);_0x3ca571[_0x223e('0x3f')]=_['keys'](_0x485045[_0x223e('0x3f')]);_0x3ca571['filters']=_['intersection'](_0x3ca571[_0x223e('0x41')],_0x3ca571[_0x223e('0x3f')]);_0x155095[_0x223e('0x43')]=_[_0x223e('0x40')](_0x3ca571[_0x223e('0x41')],qs[_0x223e('0x42')](_0x485045['query'][_0x223e('0x42')]));_0x155095[_0x223e('0x43')]=_0x155095[_0x223e('0x43')][_0x223e('0x44')]?_0x155095['attributes']:_0x3ca571[_0x223e('0x41')];_0x155095[_0x223e('0x47')]=qs[_0x223e('0x48')](_0x485045[_0x223e('0x3f')]['sort']);_0x155095[_0x223e('0x49')]=qs[_0x223e('0x4a')](_[_0x223e('0x4b')](_0x485045['query'],_0x3ca571[_0x223e('0x4a')]));if(_0x485045[_0x223e('0x3f')][_0x223e('0x5d')]){_0x155095[_0x223e('0x49')]=_['merge'](_0x155095['where'],{'$or':_['map'](_0x155095[_0x223e('0x43')],function(_0x558a16){var _0x50508d={};_0x50508d[_0x558a16]={'$like':'%'+_0x485045[_0x223e('0x3f')][_0x223e('0x5d')]+'%'};return _0x50508d;})});}_0x155095=_[_0x223e('0x4c')]({},_0x155095,_0x485045[_0x223e('0x4e')]);return _0x13ebfc[_0x223e('0x5f')](_0x155095);}})[_0x223e('0x20')](function(_0x5f4da4){if(_0x5f4da4){_0x46a768=_0x5f4da4[_0x223e('0x44')];if(!_0x485045[_0x223e('0x3f')][_0x223e('0x45')](_0x223e('0x46'))){_0x155095[_0x223e('0x2e')]=qs['limit'](_0x485045[_0x223e('0x3f')][_0x223e('0x2e')]);_0x155095[_0x223e('0x2d')]=qs[_0x223e('0x2d')](_0x485045[_0x223e('0x3f')][_0x223e('0x2d')]);}return _0x13ebfc[_0x223e('0x5f')](_0x155095);}})[_0x223e('0x20')](function(_0x3af9d3){if(_0x3af9d3){return _0x3af9d3?{'count':_0x46a768,'rows':_0x3af9d3}:null;}})[_0x223e('0x20')](respondWithResult(_0x58d298,null))[_0x223e('0x28')](handleError(_0x58d298,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index acd3c63..e1535e8 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc96=['api','moment','request-promise','path','rimraf','exports','define','SugarcrmConfiguration'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0xbc96,0x1e8));var _0x6bc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6bc9('0x0'));var moment=require(_0x6bc9('0x1'));var BPromise=require('bluebird');var rp=require(_0x6bc9('0x2'));var fs=require('fs');var path=require(_0x6bc9('0x3'));var rimraf=require(_0x6bc9('0x4'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x6bc9('0x5')]=function(_0x565a89,_0x143fb1){return _0x565a89[_0x6bc9('0x6')](_0x6bc9('0x7'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09e6=['moment','bluebird','request-promise','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x436ac7,_0x2a9ef3){var _0x46c617=function(_0x4bee53){while(--_0x4bee53){_0x436ac7['push'](_0x436ac7['shift']());}};_0x46c617(++_0x2a9ef3);}(_0x09e6,0x99));var _0x609e=function(_0x51d3f7,_0x40e050){_0x51d3f7=_0x51d3f7-0x0;var _0x15e3c7=_0x09e6[_0x51d3f7];return _0x15e3c7;};'use strict';var _=require(_0x609e('0x0'));var util=require(_0x609e('0x1'));var logger=require(_0x609e('0x2'))('api');var moment=require(_0x609e('0x3'));var BPromise=require(_0x609e('0x4'));var rp=require(_0x609e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x609e('0x6'));var config=require('../../config/environment');var attributes=require(_0x609e('0x7'));module[_0x609e('0x8')]=function(_0x19894d,_0x2cc427){return _0x19894d[_0x609e('0x9')](_0x609e('0xa'),attributes,{'tableName':_0x609e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index fc2c7d1..ac70740 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4518=['result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message'];(function(_0x111154,_0x1e5e37){var _0xd50a13=function(_0x4b23e7){while(--_0x4b23e7){_0x111154['push'](_0x111154['shift']());}};_0xd50a13(++_0x1e5e37);}(_0x4518,0x155));var _0x8451=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x4518[_0x37a79c];return _0x561d89;};'use strict';var _=require(_0x8451('0x0'));var util=require(_0x8451('0x1'));var moment=require('moment');var BPromise=require(_0x8451('0x2'));var rs=require(_0x8451('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8451('0x4'))['db'];var utils=require(_0x8451('0x5'));var logger=require('../../config/logger')(_0x8451('0x6'));var config=require('../../config/environment');var jayson=require(_0x8451('0x7'));var client=jayson[_0x8451('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x234865,_0x2f8322,_0x5438a4){return new BPromise(function(_0x1123e2,_0xde06db){return client['request'](_0x234865,_0x5438a4)[_0x8451('0x9')](function(_0x49e86e){logger[_0x8451('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f8322,'request\x20sent');logger[_0x8451('0xb')](_0x8451('0xc'),_0x2f8322,_0x8451('0xd'),JSON[_0x8451('0xe')](_0x49e86e));if(_0x49e86e[_0x8451('0xf')]){if(_0x49e86e['error'][_0x8451('0x10')]===0x1f4){logger[_0x8451('0xf')](_0x8451('0x11'),_0x2f8322,_0x49e86e['error'][_0x8451('0x12')]);return _0xde06db(_0x49e86e[_0x8451('0xf')]['message']);}logger[_0x8451('0xf')](_0x8451('0x11'),_0x2f8322,_0x49e86e[_0x8451('0xf')][_0x8451('0x12')]);return _0x1123e2(_0x49e86e[_0x8451('0xf')][_0x8451('0x12')]);}else{logger[_0x8451('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f8322,_0x8451('0xd'));_0x1123e2(_0x49e86e[_0x8451('0x13')][_0x8451('0x12')]);}})['catch'](function(_0x591c2e){logger[_0x8451('0xf')](_0x8451('0x11'),_0x2f8322,_0x591c2e);_0xde06db(_0x591c2e);});});} \ No newline at end of file +var _0x7f68=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x7f68,0x18c));var _0x87f6=function(_0xed6261,_0x1f0ee2){_0xed6261=_0xed6261-0x0;var _0x4de7a5=_0x7f68[_0xed6261];return _0x4de7a5;};'use strict';var _=require(_0x87f6('0x0'));var util=require('util');var moment=require(_0x87f6('0x1'));var BPromise=require(_0x87f6('0x2'));var rs=require(_0x87f6('0x3'));var fs=require('fs');var Redis=require(_0x87f6('0x4'));var db=require(_0x87f6('0x5'))['db'];var utils=require(_0x87f6('0x6'));var logger=require(_0x87f6('0x7'))(_0x87f6('0x8'));var config=require(_0x87f6('0x9'));var jayson=require(_0x87f6('0xa'));var client=jayson[_0x87f6('0xb')][_0x87f6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d6144,_0x1e49a6,_0x53f7c0){return new BPromise(function(_0x318cac,_0xfe498e){return client[_0x87f6('0xd')](_0x4d6144,_0x53f7c0)['then'](function(_0x582a60){logger[_0x87f6('0xe')](_0x87f6('0xf'),_0x1e49a6,_0x87f6('0x10'));logger[_0x87f6('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1e49a6,'request\x20sent',JSON['stringify'](_0x582a60));if(_0x582a60[_0x87f6('0x12')]){if(_0x582a60[_0x87f6('0x12')][_0x87f6('0x13')]===0x1f4){logger[_0x87f6('0x12')](_0x87f6('0xf'),_0x1e49a6,_0x582a60['error'][_0x87f6('0x14')]);return _0xfe498e(_0x582a60['error']['message']);}logger[_0x87f6('0x12')](_0x87f6('0xf'),_0x1e49a6,_0x582a60[_0x87f6('0x12')][_0x87f6('0x14')]);return _0x318cac(_0x582a60[_0x87f6('0x12')][_0x87f6('0x14')]);}else{logger[_0x87f6('0xe')](_0x87f6('0xf'),_0x1e49a6,_0x87f6('0x10'));_0x318cac(_0x582a60[_0x87f6('0x15')]['message']);}})[_0x87f6('0x16')](function(_0x215e89){logger['error'](_0x87f6('0xf'),_0x1e49a6,_0x215e89);_0xfe498e(_0x215e89);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index bfdc1bb..61a17bc 100644 --- a/server/api/intSugarcrmField/index.js +++ b/server/api/intSugarcrmField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ad1=['show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id'];(function(_0x333d99,_0x87dd42){var _0x41c679=function(_0xae20f){while(--_0xae20f){_0x333d99['push'](_0x333d99['shift']());}};_0x41c679(++_0x87dd42);}(_0x1ad1,0xef));var _0x11ad=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x1ad1[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0x11ad('0x0'));var util=require(_0x11ad('0x1'));var path=require(_0x11ad('0x2'));var timeout=require('connect-timeout');var express=require(_0x11ad('0x3'));var router=express[_0x11ad('0x4')]();var auth=require(_0x11ad('0x5'));var interaction=require(_0x11ad('0x6'));var config=require(_0x11ad('0x7'));var controller=require(_0x11ad('0x8'));router[_0x11ad('0x9')]('/',auth[_0x11ad('0xa')](),controller[_0x11ad('0xb')]);router[_0x11ad('0x9')](_0x11ad('0xc'),auth['isAuthenticated'](),controller[_0x11ad('0xd')]);router[_0x11ad('0xe')]('/',auth['isAuthenticated'](),controller[_0x11ad('0xf')]);router[_0x11ad('0x10')](_0x11ad('0xc'),auth[_0x11ad('0xa')](),controller[_0x11ad('0x11')]);router[_0x11ad('0x12')]('/:id',auth[_0x11ad('0xa')](),controller[_0x11ad('0x13')]);module[_0x11ad('0x14')]=router; \ No newline at end of file +var _0x65b8=['/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x19c41d,_0x273eed){var _0x198e04=function(_0x251fc4){while(--_0x251fc4){_0x19c41d['push'](_0x19c41d['shift']());}};_0x198e04(++_0x273eed);}(_0x65b8,0x117));var _0x865b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x65b8[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x865b('0x0'));var util=require(_0x865b('0x1'));var path=require(_0x865b('0x2'));var timeout=require(_0x865b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x865b('0x4'));var interaction=require(_0x865b('0x5'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x865b('0x6')](),controller['index']);router['get'](_0x865b('0x7'),auth[_0x865b('0x6')](),controller[_0x865b('0x8')]);router['post']('/',auth[_0x865b('0x6')](),controller['create']);router[_0x865b('0x9')](_0x865b('0x7'),auth[_0x865b('0x6')](),controller['update']);router[_0x865b('0xa')](_0x865b('0x7'),auth[_0x865b('0x6')](),controller[_0x865b('0xb')]);module[_0x865b('0xc')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 0bb9134..10561ce 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js +++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc746=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x55f888,_0x148b57){var _0x3f6fa5=function(_0x2d3543){while(--_0x2d3543){_0x55f888['push'](_0x55f888['shift']());}};_0x3f6fa5(++_0x148b57);}(_0xc746,0xc9));var _0x6c74=function(_0x383223,_0x5cc56f){_0x383223=_0x383223-0x0;var _0x397d22=_0xc746[_0x383223];return _0x397d22;};'use strict';var Sequelize=require(_0x6c74('0x0'));module[_0x6c74('0x1')]={'type':{'type':Sequelize[_0x6c74('0x2')](_0x6c74('0x3'),_0x6c74('0x4'),_0x6c74('0x5'),_0x6c74('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6c74('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6c74('0x4'),_0x6c74('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6c74('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcb66=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb66,0x19f));var _0x6cb6=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xcb66[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require('sequelize');module[_0x6cb6('0x0')]={'type':{'type':Sequelize[_0x6cb6('0x1')](_0x6cb6('0x2'),_0x6cb6('0x3'),_0x6cb6('0x4'),'keyValue'),'defaultValue':_0x6cb6('0x2')},'content':{'type':Sequelize[_0x6cb6('0x5')]},'key':{'type':Sequelize[_0x6cb6('0x5')]},'keyType':{'type':Sequelize[_0x6cb6('0x1')](_0x6cb6('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x6cb6('0x5')]},'idField':{'type':Sequelize[_0x6cb6('0x5')]},'nameField':{'type':Sequelize[_0x6cb6('0x5')]},'customField':{'type':Sequelize[_0x6cb6('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6cb6('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a667359..78c2e80 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.controller.js +++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfa0=['merge','VIRTUAL','options','findAll','catch','show','params','keys','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SugarcrmField','rawAttributes','type','key','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbfa0,0x1a4));var _0x0bfa=function(_0x1bc4bb,_0x1d3784){_0x1bc4bb=_0x1bc4bb-0x0;var _0xb401bf=_0xbfa0[_0x1bc4bb];return _0xb401bf;};'use strict';var pdf=require(_0x0bfa('0x0'));var emlformat=require(_0x0bfa('0x1'));var rimraf=require(_0x0bfa('0x2'));var zipdir=require(_0x0bfa('0x3'));var jsonpatch=require(_0x0bfa('0x4'));var rp=require(_0x0bfa('0x5'));var moment=require(_0x0bfa('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0bfa('0x7'));var path=require(_0x0bfa('0x8'));var sox=require(_0x0bfa('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0bfa('0xa'));var squel=require(_0x0bfa('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0bfa('0xc'));var Redis=require('ioredis');var authService=require(_0x0bfa('0xd'));var qs=require(_0x0bfa('0xe'));var as=require(_0x0bfa('0xf'));var hardwareService=require(_0x0bfa('0x10'));var logger=require(_0x0bfa('0x11'))('api');var utils=require(_0x0bfa('0x12'));var config=require('../../config/environment');var db=require(_0x0bfa('0x13'))['db'];function respondWithStatusCode(_0x2bd214,_0x156d22){_0x156d22=_0x156d22||0xcc;return function(_0x477898){if(_0x477898){return _0x2bd214[_0x0bfa('0x14')](_0x156d22);}return _0x2bd214[_0x0bfa('0x15')](_0x156d22)[_0x0bfa('0x16')]();};}function respondWithResult(_0x121b89,_0x669ec3){_0x669ec3=_0x669ec3||0xc8;return function(_0x5b74b9){if(_0x5b74b9){return _0x121b89[_0x0bfa('0x15')](_0x669ec3)[_0x0bfa('0x17')](_0x5b74b9);}};}function respondWithFilteredResult(_0x224300,_0x4ef3e4){return function(_0x114a4d){if(_0x114a4d){var _0x9f22ef=_0x114a4d[_0x0bfa('0x18')],_0x473c7f=_0x4ef3e4[_0x0bfa('0x19')],_0x13ced2=_0x4ef3e4['offset']+_0x4ef3e4[_0x0bfa('0x1a')],_0xd236f8;if(_0x13ced2>=_0x9f22ef){_0x13ced2=_0x9f22ef;_0xd236f8=0xc8;}else{_0xd236f8=0xce;}_0x224300[_0x0bfa('0x15')](_0xd236f8);return _0x224300[_0x0bfa('0x1b')](_0x0bfa('0x1c'),_0x473c7f+'-'+_0x13ced2+'/'+_0x9f22ef)[_0x0bfa('0x17')](_0x114a4d);}return null;};}function patchUpdates(_0x522eff){return function(_0x261c7a){try{jsonpatch[_0x0bfa('0x1d')](_0x261c7a,_0x522eff,!![]);}catch(_0x572445){return BPromise['reject'](_0x572445);}return _0x261c7a[_0x0bfa('0x1e')]();};}function saveUpdates(_0x3dceeb,_0x1d548f){return function(_0x78bac2){if(_0x78bac2){return _0x78bac2[_0x0bfa('0x1f')](_0x3dceeb)[_0x0bfa('0x20')](function(_0x5c1de){return _0x5c1de;});}return null;};}function removeEntity(_0x1c368d,_0x18c37d){return function(_0x59bc75){if(_0x59bc75){return _0x59bc75[_0x0bfa('0x21')]()[_0x0bfa('0x20')](function(){_0x1c368d[_0x0bfa('0x15')](0xcc)[_0x0bfa('0x16')]();});}};}function handleEntityNotFound(_0x3e7d3c,_0xf5fd53){return function(_0x82be11){if(!_0x82be11){_0x3e7d3c[_0x0bfa('0x14')](0x194);}return _0x82be11;};}function handleError(_0x555d77,_0x22b858){_0x22b858=_0x22b858||0x1f4;return function(_0x11930b){logger['error'](_0x11930b[_0x0bfa('0x22')]);if(_0x11930b[_0x0bfa('0x23')]){delete _0x11930b[_0x0bfa('0x23')];}_0x555d77[_0x0bfa('0x15')](_0x22b858)[_0x0bfa('0x24')](_0x11930b);};}exports[_0x0bfa('0x25')]=function(_0x1f0f08,_0xba600a){var _0x268645={},_0x5ebc7a={},_0x2b9061={'count':0x0,'rows':[]};var _0x561da4=_[_0x0bfa('0x26')](db[_0x0bfa('0x27')][_0x0bfa('0x28')],function(_0x1d9d7a){return{'name':_0x1d9d7a['fieldName'],'type':_0x1d9d7a[_0x0bfa('0x29')][_0x0bfa('0x2a')]};});_0x5ebc7a['model']=_['map'](_0x561da4,_0x0bfa('0x23'));_0x5ebc7a[_0x0bfa('0x2b')]=_['keys'](_0x1f0f08[_0x0bfa('0x2b')]);_0x5ebc7a['filters']=_['intersection'](_0x5ebc7a['model'],_0x5ebc7a[_0x0bfa('0x2b')]);_0x268645[_0x0bfa('0x2c')]=_[_0x0bfa('0x2d')](_0x5ebc7a[_0x0bfa('0x2e')],qs[_0x0bfa('0x2f')](_0x1f0f08[_0x0bfa('0x2b')]['fields']));_0x268645['attributes']=_0x268645['attributes'][_0x0bfa('0x30')]?_0x268645[_0x0bfa('0x2c')]:_0x5ebc7a[_0x0bfa('0x2e')];if(!_0x1f0f08[_0x0bfa('0x2b')][_0x0bfa('0x31')](_0x0bfa('0x32'))){_0x268645['limit']=qs[_0x0bfa('0x1a')](_0x1f0f08['query'][_0x0bfa('0x1a')]);_0x268645[_0x0bfa('0x19')]=qs[_0x0bfa('0x19')](_0x1f0f08[_0x0bfa('0x2b')][_0x0bfa('0x19')]);}_0x268645['order']=qs[_0x0bfa('0x33')](_0x1f0f08[_0x0bfa('0x2b')]['sort']);_0x268645[_0x0bfa('0x34')]=qs[_0x0bfa('0x35')](_[_0x0bfa('0x36')](_0x1f0f08[_0x0bfa('0x2b')],_0x5ebc7a['filters']));if(_0x1f0f08[_0x0bfa('0x2b')][_0x0bfa('0x37')]){_0x268645[_0x0bfa('0x34')]=_[_0x0bfa('0x38')](_0x268645[_0x0bfa('0x34')],{'$or':_[_0x0bfa('0x26')](_0x561da4,function(_0x476fa7){if(_0x476fa7['type']!==_0x0bfa('0x39')){var _0x14da50={};_0x14da50[_0x476fa7[_0x0bfa('0x23')]]={'$like':'%'+_0x1f0f08['query'][_0x0bfa('0x37')]+'%'};return _0x14da50;}})});}_0x268645=_[_0x0bfa('0x38')]({},_0x268645,_0x1f0f08[_0x0bfa('0x3a')]);var _0x1dea6d={'where':_0x268645[_0x0bfa('0x34')]};return db[_0x0bfa('0x27')][_0x0bfa('0x18')](_0x1dea6d)[_0x0bfa('0x20')](function(_0x4df06a){_0x2b9061[_0x0bfa('0x18')]=_0x4df06a;if(_0x1f0f08[_0x0bfa('0x2b')]['includeAll']){_0x268645['include']=[{'all':!![]}];}return db[_0x0bfa('0x27')][_0x0bfa('0x3b')](_0x268645);})[_0x0bfa('0x20')](function(_0x1eb0c1){_0x2b9061['rows']=_0x1eb0c1;return _0x2b9061;})['then'](respondWithFilteredResult(_0xba600a,_0x268645))[_0x0bfa('0x3c')](handleError(_0xba600a,null));};exports[_0x0bfa('0x3d')]=function(_0x501bd6,_0xfb0c7){var _0x1a0201={'raw':!![],'where':{'id':_0x501bd6[_0x0bfa('0x3e')]['id']}},_0x17cdef={};_0x17cdef[_0x0bfa('0x2e')]=_[_0x0bfa('0x3f')](db[_0x0bfa('0x27')]['rawAttributes']);_0x17cdef[_0x0bfa('0x2b')]=_[_0x0bfa('0x3f')](_0x501bd6[_0x0bfa('0x2b')]);_0x17cdef[_0x0bfa('0x35')]=_[_0x0bfa('0x2d')](_0x17cdef[_0x0bfa('0x2e')],_0x17cdef[_0x0bfa('0x2b')]);_0x1a0201['attributes']=_[_0x0bfa('0x2d')](_0x17cdef[_0x0bfa('0x2e')],qs[_0x0bfa('0x2f')](_0x501bd6[_0x0bfa('0x2b')]['fields']));_0x1a0201[_0x0bfa('0x2c')]=_0x1a0201[_0x0bfa('0x2c')]['length']?_0x1a0201['attributes']:_0x17cdef[_0x0bfa('0x2e')];if(_0x501bd6[_0x0bfa('0x2b')]['includeAll']){_0x1a0201[_0x0bfa('0x40')]=[{'all':!![]}];}_0x1a0201=_[_0x0bfa('0x38')]({},_0x1a0201,_0x501bd6[_0x0bfa('0x3a')]);return db[_0x0bfa('0x27')][_0x0bfa('0x41')](_0x1a0201)[_0x0bfa('0x20')](handleEntityNotFound(_0xfb0c7,null))[_0x0bfa('0x20')](respondWithResult(_0xfb0c7,null))[_0x0bfa('0x3c')](handleError(_0xfb0c7,null));};exports[_0x0bfa('0x42')]=function(_0x58da92,_0x1f52d2){return db[_0x0bfa('0x27')][_0x0bfa('0x42')](_0x58da92[_0x0bfa('0x43')],{})['then'](respondWithResult(_0x1f52d2,0xc9))[_0x0bfa('0x3c')](handleError(_0x1f52d2,null));};exports[_0x0bfa('0x1f')]=function(_0x56177d,_0x530329){if(_0x56177d['body']['id']){delete _0x56177d[_0x0bfa('0x43')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x56177d['params']['id']}})[_0x0bfa('0x20')](handleEntityNotFound(_0x530329,null))[_0x0bfa('0x20')](saveUpdates(_0x56177d[_0x0bfa('0x43')],null))['then'](respondWithResult(_0x530329,null))[_0x0bfa('0x3c')](handleError(_0x530329,null));};exports[_0x0bfa('0x21')]=function(_0x5d714b,_0x4daaac){return db['SugarcrmField'][_0x0bfa('0x41')]({'where':{'id':_0x5d714b['params']['id']}})[_0x0bfa('0x20')](handleEntityNotFound(_0x4daaac,null))[_0x0bfa('0x20')](removeEntity(_0x4daaac,null))['catch'](handleError(_0x4daaac,null));}; \ No newline at end of file +var _0x4296=['../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','reject','save','update','then','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmField','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0x4296,0xc8));var _0x6429=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x4296[_0x4154a6];return _0x3b2786;};'use strict';var pdf=require(_0x6429('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6429('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6429('0x2'));var rp=require(_0x6429('0x3'));var moment=require(_0x6429('0x4'));var BPromise=require(_0x6429('0x5'));var Mustache=require(_0x6429('0x6'));var util=require(_0x6429('0x7'));var path=require(_0x6429('0x8'));var sox=require(_0x6429('0x9'));var csv=require('to-csv');var ejs=require(_0x6429('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6429('0xb'));var crypto=require('crypto');var jsforce=require(_0x6429('0xc'));var deskjs=require(_0x6429('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6429('0xe'));var Redis=require('ioredis');var authService=require(_0x6429('0xf'));var qs=require(_0x6429('0x10'));var as=require(_0x6429('0x11'));var hardwareService=require(_0x6429('0x12'));var logger=require(_0x6429('0x13'))(_0x6429('0x14'));var utils=require(_0x6429('0x15'));var config=require(_0x6429('0x16'));var db=require(_0x6429('0x17'))['db'];function respondWithStatusCode(_0x276ea2,_0x5f5b37){_0x5f5b37=_0x5f5b37||0xcc;return function(_0x594950){if(_0x594950){return _0x276ea2[_0x6429('0x18')](_0x5f5b37);}return _0x276ea2['status'](_0x5f5b37)[_0x6429('0x19')]();};}function respondWithResult(_0x3909e7,_0x4c7a51){_0x4c7a51=_0x4c7a51||0xc8;return function(_0x2eaca7){if(_0x2eaca7){return _0x3909e7['status'](_0x4c7a51)['json'](_0x2eaca7);}};}function respondWithFilteredResult(_0x155500,_0x9a8c72){return function(_0x5c6e30){if(_0x5c6e30){var _0xae1c29=_0x5c6e30[_0x6429('0x1a')],_0x40113a=_0x9a8c72[_0x6429('0x1b')],_0x1aacd0=_0x9a8c72[_0x6429('0x1b')]+_0x9a8c72[_0x6429('0x1c')],_0x18813f;if(_0x1aacd0>=_0xae1c29){_0x1aacd0=_0xae1c29;_0x18813f=0xc8;}else{_0x18813f=0xce;}_0x155500[_0x6429('0x1d')](_0x18813f);return _0x155500[_0x6429('0x1e')](_0x6429('0x1f'),_0x40113a+'-'+_0x1aacd0+'/'+_0xae1c29)['json'](_0x5c6e30);}return null;};}function patchUpdates(_0x414a1b){return function(_0x139fbf){try{jsonpatch['apply'](_0x139fbf,_0x414a1b,!![]);}catch(_0x2b5dbc){return BPromise[_0x6429('0x20')](_0x2b5dbc);}return _0x139fbf[_0x6429('0x21')]();};}function saveUpdates(_0x3fa178,_0x48cbc5){return function(_0x1b4e6e){if(_0x1b4e6e){return _0x1b4e6e[_0x6429('0x22')](_0x3fa178)[_0x6429('0x23')](function(_0x5d71c6){return _0x5d71c6;});}return null;};}function removeEntity(_0x445b87,_0x36f2de){return function(_0x4bf6f9){if(_0x4bf6f9){return _0x4bf6f9['destroy']()[_0x6429('0x23')](function(){_0x445b87[_0x6429('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12d8ca,_0xa971ad){return function(_0x5abf54){if(!_0x5abf54){_0x12d8ca[_0x6429('0x18')](0x194);}return _0x5abf54;};}function handleError(_0x273425,_0x47e61f){_0x47e61f=_0x47e61f||0x1f4;return function(_0xacbd51){logger['error'](_0xacbd51['stack']);if(_0xacbd51[_0x6429('0x24')]){delete _0xacbd51[_0x6429('0x24')];}_0x273425[_0x6429('0x1d')](_0x47e61f)[_0x6429('0x25')](_0xacbd51);};}exports[_0x6429('0x26')]=function(_0x4ab158,_0x80b49){var _0x267524={},_0x3c8e8d={},_0x2c5f90={'count':0x0,'rows':[]};var _0x31e6c2=_[_0x6429('0x27')](db['SugarcrmField'][_0x6429('0x28')],function(_0x234fe8){return{'name':_0x234fe8[_0x6429('0x29')],'type':_0x234fe8[_0x6429('0x2a')][_0x6429('0x2b')]};});_0x3c8e8d[_0x6429('0x2c')]=_[_0x6429('0x27')](_0x31e6c2,_0x6429('0x24'));_0x3c8e8d['query']=_[_0x6429('0x2d')](_0x4ab158[_0x6429('0x2e')]);_0x3c8e8d[_0x6429('0x2f')]=_[_0x6429('0x30')](_0x3c8e8d[_0x6429('0x2c')],_0x3c8e8d[_0x6429('0x2e')]);_0x267524[_0x6429('0x31')]=_[_0x6429('0x30')](_0x3c8e8d[_0x6429('0x2c')],qs['fields'](_0x4ab158[_0x6429('0x2e')][_0x6429('0x32')]));_0x267524[_0x6429('0x31')]=_0x267524[_0x6429('0x31')][_0x6429('0x33')]?_0x267524[_0x6429('0x31')]:_0x3c8e8d[_0x6429('0x2c')];if(!_0x4ab158[_0x6429('0x2e')][_0x6429('0x34')](_0x6429('0x35'))){_0x267524[_0x6429('0x1c')]=qs[_0x6429('0x1c')](_0x4ab158[_0x6429('0x2e')]['limit']);_0x267524[_0x6429('0x1b')]=qs[_0x6429('0x1b')](_0x4ab158[_0x6429('0x2e')][_0x6429('0x1b')]);}_0x267524[_0x6429('0x36')]=qs[_0x6429('0x37')](_0x4ab158[_0x6429('0x2e')][_0x6429('0x37')]);_0x267524[_0x6429('0x38')]=qs[_0x6429('0x2f')](_[_0x6429('0x39')](_0x4ab158[_0x6429('0x2e')],_0x3c8e8d[_0x6429('0x2f')]));if(_0x4ab158[_0x6429('0x2e')][_0x6429('0x3a')]){_0x267524[_0x6429('0x38')]=_[_0x6429('0x3b')](_0x267524['where'],{'$or':_[_0x6429('0x27')](_0x31e6c2,function(_0x512997){if(_0x512997[_0x6429('0x2a')]!==_0x6429('0x3c')){var _0x3cce8b={};_0x3cce8b[_0x512997[_0x6429('0x24')]]={'$like':'%'+_0x4ab158[_0x6429('0x2e')][_0x6429('0x3a')]+'%'};return _0x3cce8b;}})});}_0x267524=_[_0x6429('0x3b')]({},_0x267524,_0x4ab158[_0x6429('0x3d')]);var _0x5d6362={'where':_0x267524['where']};return db[_0x6429('0x3e')][_0x6429('0x1a')](_0x5d6362)[_0x6429('0x23')](function(_0x170c28){_0x2c5f90[_0x6429('0x1a')]=_0x170c28;if(_0x4ab158['query']['includeAll']){_0x267524[_0x6429('0x3f')]=[{'all':!![]}];}return db['SugarcrmField'][_0x6429('0x40')](_0x267524);})[_0x6429('0x23')](function(_0x563a27){_0x2c5f90[_0x6429('0x41')]=_0x563a27;return _0x2c5f90;})[_0x6429('0x23')](respondWithFilteredResult(_0x80b49,_0x267524))[_0x6429('0x42')](handleError(_0x80b49,null));};exports[_0x6429('0x43')]=function(_0x5e309e,_0x20b5ec){var _0x4bd54a={'raw':!![],'where':{'id':_0x5e309e[_0x6429('0x44')]['id']}},_0x3e618c={};_0x3e618c['model']=_[_0x6429('0x2d')](db[_0x6429('0x3e')][_0x6429('0x28')]);_0x3e618c['query']=_[_0x6429('0x2d')](_0x5e309e[_0x6429('0x2e')]);_0x3e618c[_0x6429('0x2f')]=_[_0x6429('0x30')](_0x3e618c[_0x6429('0x2c')],_0x3e618c[_0x6429('0x2e')]);_0x4bd54a[_0x6429('0x31')]=_[_0x6429('0x30')](_0x3e618c['model'],qs[_0x6429('0x32')](_0x5e309e[_0x6429('0x2e')][_0x6429('0x32')]));_0x4bd54a[_0x6429('0x31')]=_0x4bd54a['attributes'][_0x6429('0x33')]?_0x4bd54a[_0x6429('0x31')]:_0x3e618c[_0x6429('0x2c')];if(_0x5e309e[_0x6429('0x2e')][_0x6429('0x45')]){_0x4bd54a['include']=[{'all':!![]}];}_0x4bd54a=_[_0x6429('0x3b')]({},_0x4bd54a,_0x5e309e[_0x6429('0x3d')]);return db[_0x6429('0x3e')][_0x6429('0x46')](_0x4bd54a)[_0x6429('0x23')](handleEntityNotFound(_0x20b5ec,null))['then'](respondWithResult(_0x20b5ec,null))['catch'](handleError(_0x20b5ec,null));};exports['create']=function(_0x79c734,_0x25037c){return db[_0x6429('0x3e')][_0x6429('0x47')](_0x79c734['body'],{})['then'](respondWithResult(_0x25037c,0xc9))[_0x6429('0x42')](handleError(_0x25037c,null));};exports['update']=function(_0x210792,_0x455c53){if(_0x210792['body']['id']){delete _0x210792[_0x6429('0x48')]['id'];}return db[_0x6429('0x3e')][_0x6429('0x46')]({'where':{'id':_0x210792[_0x6429('0x44')]['id']}})[_0x6429('0x23')](handleEntityNotFound(_0x455c53,null))[_0x6429('0x23')](saveUpdates(_0x210792[_0x6429('0x48')],null))[_0x6429('0x23')](respondWithResult(_0x455c53,null))[_0x6429('0x42')](handleError(_0x455c53,null));};exports[_0x6429('0x49')]=function(_0x486041,_0x171e41){return db[_0x6429('0x3e')]['find']({'where':{'id':_0x486041['params']['id']}})['then'](handleEntityNotFound(_0x171e41,null))[_0x6429('0x23')](removeEntity(_0x171e41,null))[_0x6429('0x42')](handleError(_0x171e41,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index e6502fc..deddf6a 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.model.js +++ b/server/api/intSugarcrmField/intSugarcrmField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5044=['int_sugarcrm_fields','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField'];(function(_0xc52cf8,_0x4c9044){var _0x120a1f=function(_0x4794ee){while(--_0x4794ee){_0xc52cf8['push'](_0xc52cf8['shift']());}};_0x120a1f(++_0x4c9044);}(_0x5044,0x1de));var _0x4504=function(_0x2f863f,_0x2b8c4f){_0x2f863f=_0x2f863f-0x0;var _0x148335=_0x5044[_0x2f863f];return _0x148335;};'use strict';var _=require('lodash');var util=require(_0x4504('0x0'));var logger=require(_0x4504('0x1'))(_0x4504('0x2'));var moment=require(_0x4504('0x3'));var BPromise=require(_0x4504('0x4'));var rp=require(_0x4504('0x5'));var fs=require('fs');var path=require(_0x4504('0x6'));var rimraf=require(_0x4504('0x7'));var config=require(_0x4504('0x8'));var attributes=require(_0x4504('0x9'));module['exports']=function(_0xdd91e,_0x9c1abc){return _0xdd91e[_0x4504('0xa')](_0x4504('0xb'),attributes,{'tableName':_0x4504('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x4504('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4c2=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','define'];(function(_0x2a0a53,_0x3c8f51){var _0x12afed=function(_0x307a1e){while(--_0x307a1e){_0x2a0a53['push'](_0x2a0a53['shift']());}};_0x12afed(++_0x3c8f51);}(_0xc4c2,0x170));var _0x2c4c=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xc4c2[_0x42f009];return _0x22a1e0;};'use strict';var _=require('lodash');var util=require(_0x2c4c('0x0'));var logger=require(_0x2c4c('0x1'))(_0x2c4c('0x2'));var moment=require(_0x2c4c('0x3'));var BPromise=require(_0x2c4c('0x4'));var rp=require(_0x2c4c('0x5'));var fs=require('fs');var path=require(_0x2c4c('0x6'));var rimraf=require('rimraf');var config=require(_0x2c4c('0x7'));var attributes=require(_0x2c4c('0x8'));module['exports']=function(_0x3947e1,_0x8ca218){return _0x3947e1[_0x2c4c('0x9')](_0x2c4c('0xa'),attributes,{'tableName':_0x2c4c('0xb'),'paranoid':![],'indexes':[{'name':_0x2c4c('0xc'),'fields':[_0x2c4c('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 618c275..73ca70f 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5f50b5,_0xa8db83){_0x5f50b5=_0x5f50b5-0x0;var _0x54c383=_0x0b0e[_0x5f50b5];return _0x54c383;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x4fc2,0x111));var _0x24fc=function(_0x206f02,_0x36f322){_0x206f02=_0x206f02-0x0;var _0x8a2663=_0x4fc2[_0x206f02];return _0x8a2663;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 6be7d5a..00bcd13 100644 --- a/server/api/intVtigerAccount/index.js +++ b/server/api/intVtigerAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79f8=['getConfigurations','/:id/fields','getFields','post','put','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id','show','/:id/configurations','isAuthenticated'];(function(_0x4142b1,_0x1119af){var _0x346210=function(_0x5817af){while(--_0x5817af){_0x4142b1['push'](_0x4142b1['shift']());}};_0x346210(++_0x1119af);}(_0x79f8,0xd8));var _0x879f=function(_0x53b311,_0x10804d){_0x53b311=_0x53b311-0x0;var _0x40d829=_0x79f8[_0x53b311];return _0x40d829;};'use strict';var multer=require('multer');var util=require(_0x879f('0x0'));var path=require(_0x879f('0x1'));var timeout=require(_0x879f('0x2'));var express=require(_0x879f('0x3'));var router=express['Router']();var auth=require(_0x879f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x879f('0x5'));var controller=require('./intVtigerAccount.controller');router[_0x879f('0x6')]('/',auth['isAuthenticated'](),controller[_0x879f('0x7')]);router[_0x879f('0x6')](_0x879f('0x8'),auth['isAuthenticated'](),controller[_0x879f('0x9')]);router[_0x879f('0x6')](_0x879f('0xa'),auth[_0x879f('0xb')](),controller[_0x879f('0xc')]);router[_0x879f('0x6')](_0x879f('0xd'),auth[_0x879f('0xb')](),controller[_0x879f('0xe')]);router[_0x879f('0xf')]('/',auth[_0x879f('0xb')](),controller['create']);router[_0x879f('0xf')](_0x879f('0xa'),auth[_0x879f('0xb')](),controller['addConfiguration']);router[_0x879f('0x10')](_0x879f('0x8'),auth[_0x879f('0xb')](),controller['update']);router[_0x879f('0x11')](_0x879f('0x8'),auth[_0x879f('0xb')](),controller[_0x879f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1059=['delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','post','create','put'];(function(_0x188867,_0x3635a6){var _0x22da51=function(_0x17b19b){while(--_0x17b19b){_0x188867['push'](_0x188867['shift']());}};_0x22da51(++_0x3635a6);}(_0x1059,0x158));var _0x9105=function(_0x384f30,_0x4dc505){_0x384f30=_0x384f30-0x0;var _0x41fdb0=_0x1059[_0x384f30];return _0x41fdb0;};'use strict';var multer=require(_0x9105('0x0'));var util=require('util');var path=require(_0x9105('0x1'));var timeout=require(_0x9105('0x2'));var express=require(_0x9105('0x3'));var router=express[_0x9105('0x4')]();var auth=require(_0x9105('0x5'));var interaction=require(_0x9105('0x6'));var config=require(_0x9105('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x9105('0x8')]('/',auth[_0x9105('0x9')](),controller['index']);router['get'](_0x9105('0xa'),auth[_0x9105('0x9')](),controller['show']);router['get'](_0x9105('0xb'),auth['isAuthenticated'](),controller[_0x9105('0xc')]);router[_0x9105('0x8')]('/:id/fields',auth[_0x9105('0x9')](),controller['getFields']);router[_0x9105('0xd')]('/',auth[_0x9105('0x9')](),controller[_0x9105('0xe')]);router[_0x9105('0xd')](_0x9105('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9105('0xf')](_0x9105('0xa'),auth[_0x9105('0x9')](),controller['update']);router[_0x9105('0x10')](_0x9105('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x9105('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index a1deda9..0366efa 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js +++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6917=['HelpDesk','sequelize','STRING'];(function(_0x34a04c,_0x48551d){var _0x50770f=function(_0x121130){while(--_0x121130){_0x34a04c['push'](_0x34a04c['shift']());}};_0x50770f(++_0x48551d);}(_0x6917,0x14e));var _0x7691=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0x6917[_0xdd827a];return _0x2f46f1;};'use strict';var Sequelize=require(_0x7691('0x0'));module['exports']={'name':{'type':Sequelize[_0x7691('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7691('0x1')]},'username':{'type':Sequelize[_0x7691('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x7691('0x1')],'allowNull':![],'defaultValue':_0x7691('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7691('0x1')]},'accessKey':{'type':Sequelize[_0x7691('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe78e=['sequelize','exports','STRING'];(function(_0x4841d1,_0x586683){var _0x32b8ca=function(_0x41a801){while(--_0x41a801){_0x4841d1['push'](_0x4841d1['shift']());}};_0x32b8ca(++_0x586683);}(_0xe78e,0x1da));var _0xee78=function(_0x5e92cd,_0x1c5dd6){_0x5e92cd=_0x5e92cd-0x0;var _0x5885c6=_0xe78e[_0x5e92cd];return _0x5885c6;};'use strict';var Sequelize=require(_0xee78('0x0'));module[_0xee78('0x1')]={'name':{'type':Sequelize[_0xee78('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xee78('0x2')]},'username':{'type':Sequelize[_0xee78('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xee78('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xee78('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xee78('0x2')]},'accessKey':{'type':Sequelize[_0xee78('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 2b0d5f0..caad09b 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.controller.js +++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2d7=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','destroy','then','name','index','map','VtigerAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','options','find','create','body','params','findOne','VtigerConfiguration','sort','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','substring','format','%s/webservice.php','GET','getchallenge','success','login','describe','result','sessionName','reference','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19de91,_0x4be2b7){var _0x56001a=function(_0x27dd13){while(--_0x27dd13){_0x19de91['push'](_0x19de91['shift']());}};_0x56001a(++_0x4be2b7);}(_0xb2d7,0x155));var _0x7b2d=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0xb2d7[_0x202c61];return _0x540691;};'use strict';var pdf=require(_0x7b2d('0x0'));var emlformat=require(_0x7b2d('0x1'));var rimraf=require(_0x7b2d('0x2'));var zipdir=require(_0x7b2d('0x3'));var jsonpatch=require(_0x7b2d('0x4'));var rp=require(_0x7b2d('0x5'));var moment=require(_0x7b2d('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b2d('0x7'));var path=require(_0x7b2d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b2d('0x9'));var fs=require('fs');var _=require(_0x7b2d('0xa'));var squel=require(_0x7b2d('0xb'));var crypto=require(_0x7b2d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7b2d('0xd'));var querystring=require(_0x7b2d('0xe'));var Papa=require(_0x7b2d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7b2d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b2d('0x11'))(_0x7b2d('0x12'));var utils=require('../../config/utils');var config=require(_0x7b2d('0x13'));var db=require(_0x7b2d('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x7b2d('0x15'));var client=jayson[_0x7b2d('0x16')][_0x7b2d('0x17')]({'port':0x232a});function checkPasswordPattern(_0x266e83,_0x5b2890,_0x548f45){if(_0x548f45){var _0x3df61a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3df61a[_0x7b2d('0x18')](_0x5b2890)){return _0x266e83;}else{throw new db['Sequelize']['ValidationError'](_0x7b2d('0x19'));}}else{return _0x266e83;}}function respondWithRpcPromise(_0x431a78,_0x46f590,_0x2197aa,_0x33fa2b){return new BPromise(function(_0x28442a,_0x451ed5){var _0x3364fb=_0x33fa2b||client;return _0x3364fb[_0x7b2d('0x1a')](_0x431a78,_0x2197aa)['then'](function(_0x5d284f){logger[_0x7b2d('0x1b')](_0x7b2d('0x1c'),_0x46f590,_0x7b2d('0x1d'));logger[_0x7b2d('0x1e')](_0x7b2d('0x1f'),_0x46f590,_0x7b2d('0x1d'),JSON[_0x7b2d('0x20')](_0x5d284f));if(_0x5d284f[_0x7b2d('0x21')]){if(_0x5d284f[_0x7b2d('0x21')]['code']===0x1f4){logger[_0x7b2d('0x21')](_0x7b2d('0x1c'),_0x46f590,_0x5d284f[_0x7b2d('0x21')][_0x7b2d('0x22')]);return _0x451ed5(_0x5d284f[_0x7b2d('0x21')][_0x7b2d('0x22')]);}logger[_0x7b2d('0x21')](_0x7b2d('0x1c'),_0x46f590,_0x5d284f['error']['message']);return _0x28442a(_0x5d284f['error']['message']);}else{logger[_0x7b2d('0x1b')](_0x7b2d('0x1c'),_0x46f590,_0x7b2d('0x1d'));_0x28442a(_0x5d284f['result']['message']);}})[_0x7b2d('0x23')](function(_0x199215){logger[_0x7b2d('0x21')](_0x7b2d('0x1c'),_0x46f590,_0x199215);_0x451ed5(_0x199215);});});}function respondWithStatusCode(_0x432969,_0x532b0a){_0x532b0a=_0x532b0a||0xcc;return function(_0x4c2873){if(_0x4c2873){return _0x432969[_0x7b2d('0x24')](_0x532b0a);}return _0x432969[_0x7b2d('0x25')](_0x532b0a)[_0x7b2d('0x26')]();};}function respondWithResult(_0x5b25b5,_0x43bb96){_0x43bb96=_0x43bb96||0xc8;return function(_0x7d3986){if(_0x7d3986){return _0x5b25b5[_0x7b2d('0x25')](_0x43bb96)[_0x7b2d('0x27')](_0x7d3986);}};}function respondWithFilteredResult(_0x3095ec,_0x202c98){return function(_0x559487){if(_0x559487){var _0x2ae089=_0x559487[_0x7b2d('0x28')],_0x35e9ec=_0x202c98[_0x7b2d('0x29')],_0x3fbbff=_0x202c98['offset']+_0x202c98['limit'],_0x121c8c;if(_0x3fbbff>=_0x2ae089){_0x3fbbff=_0x2ae089;_0x121c8c=0xc8;}else{_0x121c8c=0xce;}_0x3095ec['status'](_0x121c8c);return _0x3095ec['set'](_0x7b2d('0x2a'),_0x35e9ec+'-'+_0x3fbbff+'/'+_0x2ae089)['json'](_0x559487);}return null;};}function patchUpdates(_0x4909c1){return function(_0x35c06c){try{jsonpatch[_0x7b2d('0x2b')](_0x35c06c,_0x4909c1,!![]);}catch(_0x5d8c28){return BPromise['reject'](_0x5d8c28);}return _0x35c06c[_0x7b2d('0x2c')]();};}function saveUpdates(_0x2edfa9,_0x47b0ab){return function(_0x4707f8){if(_0x4707f8){return _0x4707f8[_0x7b2d('0x2d')](_0x2edfa9)['then'](function(_0xa3badd){return _0xa3badd;});}return null;};}function removeEntity(_0x3d1793,_0x41640d){return function(_0x548b62){if(_0x548b62){return _0x548b62[_0x7b2d('0x2e')]()[_0x7b2d('0x2f')](function(){_0x3d1793[_0x7b2d('0x25')](0xcc)[_0x7b2d('0x26')]();});}};}function handleEntityNotFound(_0x396202,_0x39edbf){return function(_0x3f5f93){if(!_0x3f5f93){_0x396202['sendStatus'](0x194);}return _0x3f5f93;};}function handleError(_0x32f22d,_0x2dd939){_0x2dd939=_0x2dd939||0x1f4;return function(_0x5e542c){logger[_0x7b2d('0x21')](_0x5e542c['stack']);if(_0x5e542c['name']){delete _0x5e542c[_0x7b2d('0x30')];}_0x32f22d[_0x7b2d('0x25')](_0x2dd939)['send'](_0x5e542c);};}exports[_0x7b2d('0x31')]=function(_0x3ed9ab,_0x1759d7){var _0x2b41d6={},_0x407ac8={},_0xaf6bd8={'count':0x0,'rows':[]};var _0xbd7bb9=_[_0x7b2d('0x32')](db[_0x7b2d('0x33')][_0x7b2d('0x34')],function(_0x28f522){return{'name':_0x28f522['fieldName'],'type':_0x28f522[_0x7b2d('0x35')][_0x7b2d('0x36')]};});_0x407ac8[_0x7b2d('0x37')]=_[_0x7b2d('0x32')](_0xbd7bb9,'name');_0x407ac8[_0x7b2d('0x38')]=_[_0x7b2d('0x39')](_0x3ed9ab[_0x7b2d('0x38')]);_0x407ac8['filters']=_[_0x7b2d('0x3a')](_0x407ac8[_0x7b2d('0x37')],_0x407ac8['query']);_0x2b41d6[_0x7b2d('0x3b')]=_['intersection'](_0x407ac8[_0x7b2d('0x37')],qs[_0x7b2d('0x3c')](_0x3ed9ab['query']['fields']));_0x2b41d6[_0x7b2d('0x3b')]=_0x2b41d6['attributes'][_0x7b2d('0x3d')]?_0x2b41d6[_0x7b2d('0x3b')]:_0x407ac8[_0x7b2d('0x37')];if(!_0x3ed9ab['query']['hasOwnProperty'](_0x7b2d('0x3e'))){_0x2b41d6['limit']=qs[_0x7b2d('0x3f')](_0x3ed9ab[_0x7b2d('0x38')][_0x7b2d('0x3f')]);_0x2b41d6[_0x7b2d('0x29')]=qs[_0x7b2d('0x29')](_0x3ed9ab[_0x7b2d('0x38')][_0x7b2d('0x29')]);}_0x2b41d6[_0x7b2d('0x40')]=qs['sort'](_0x3ed9ab[_0x7b2d('0x38')]['sort']);_0x2b41d6[_0x7b2d('0x41')]=qs[_0x7b2d('0x42')](_[_0x7b2d('0x43')](_0x3ed9ab[_0x7b2d('0x38')],_0x407ac8[_0x7b2d('0x42')]));if(_0x3ed9ab[_0x7b2d('0x38')][_0x7b2d('0x44')]){_0x2b41d6[_0x7b2d('0x41')]=_[_0x7b2d('0x45')](_0x2b41d6[_0x7b2d('0x41')],{'$or':_[_0x7b2d('0x32')](_0xbd7bb9,function(_0x21a95e){if(_0x21a95e['type']!==_0x7b2d('0x46')){var _0x24939c={};_0x24939c[_0x21a95e[_0x7b2d('0x30')]]={'$like':'%'+_0x3ed9ab['query'][_0x7b2d('0x44')]+'%'};return _0x24939c;}})});}_0x2b41d6=_[_0x7b2d('0x45')]({},_0x2b41d6,_0x3ed9ab['options']);var _0x5c2ef3={'where':_0x2b41d6[_0x7b2d('0x41')]};return db[_0x7b2d('0x33')][_0x7b2d('0x28')](_0x5c2ef3)[_0x7b2d('0x2f')](function(_0x1a5adb){_0xaf6bd8[_0x7b2d('0x28')]=_0x1a5adb;if(_0x3ed9ab[_0x7b2d('0x38')][_0x7b2d('0x47')]){_0x2b41d6[_0x7b2d('0x48')]=[{'all':!![]}];}return db[_0x7b2d('0x33')][_0x7b2d('0x49')](_0x2b41d6);})[_0x7b2d('0x2f')](function(_0x39c35b){_0xaf6bd8[_0x7b2d('0x4a')]=_0x39c35b;return _0xaf6bd8;})['then'](respondWithFilteredResult(_0x1759d7,_0x2b41d6))[_0x7b2d('0x23')](handleError(_0x1759d7,null));};exports['show']=function(_0x13139f,_0x3884d9){var _0x2972e0={'raw':![],'where':{'id':_0x13139f['params']['id']}},_0x509c68={};_0x509c68['model']=_[_0x7b2d('0x39')](db[_0x7b2d('0x33')][_0x7b2d('0x34')]);_0x509c68['query']=_[_0x7b2d('0x39')](_0x13139f[_0x7b2d('0x38')]);_0x509c68[_0x7b2d('0x42')]=_[_0x7b2d('0x3a')](_0x509c68[_0x7b2d('0x37')],_0x509c68[_0x7b2d('0x38')]);_0x2972e0[_0x7b2d('0x3b')]=_[_0x7b2d('0x3a')](_0x509c68[_0x7b2d('0x37')],qs['fields'](_0x13139f['query']['fields']));_0x2972e0[_0x7b2d('0x3b')]=_0x2972e0[_0x7b2d('0x3b')][_0x7b2d('0x3d')]?_0x2972e0[_0x7b2d('0x3b')]:_0x509c68[_0x7b2d('0x37')];if(_0x13139f[_0x7b2d('0x38')][_0x7b2d('0x47')]){_0x2972e0[_0x7b2d('0x48')]=[{'all':!![]}];}_0x2972e0=_[_0x7b2d('0x45')]({},_0x2972e0,_0x13139f[_0x7b2d('0x4b')]);return db[_0x7b2d('0x33')][_0x7b2d('0x4c')](_0x2972e0)[_0x7b2d('0x2f')](handleEntityNotFound(_0x3884d9,null))[_0x7b2d('0x2f')](respondWithResult(_0x3884d9,null))[_0x7b2d('0x23')](handleError(_0x3884d9,null));};exports[_0x7b2d('0x4d')]=function(_0x4e0b86,_0x33d83c){return db[_0x7b2d('0x33')]['create'](_0x4e0b86[_0x7b2d('0x4e')],{})[_0x7b2d('0x2f')](respondWithResult(_0x33d83c,0xc9))[_0x7b2d('0x23')](handleError(_0x33d83c,null));};exports[_0x7b2d('0x2d')]=function(_0x400a87,_0x4d5a79){if(_0x400a87[_0x7b2d('0x4e')]['id']){delete _0x400a87[_0x7b2d('0x4e')]['id'];}return db[_0x7b2d('0x33')]['find']({'where':{'id':_0x400a87[_0x7b2d('0x4f')]['id']}})[_0x7b2d('0x2f')](handleEntityNotFound(_0x4d5a79,null))[_0x7b2d('0x2f')](saveUpdates(_0x400a87[_0x7b2d('0x4e')],null))[_0x7b2d('0x2f')](respondWithResult(_0x4d5a79,null))[_0x7b2d('0x23')](handleError(_0x4d5a79,null));};exports[_0x7b2d('0x2e')]=function(_0x2d4bb6,_0x1ed315){return db[_0x7b2d('0x33')]['find']({'where':{'id':_0x2d4bb6[_0x7b2d('0x4f')]['id']}})[_0x7b2d('0x2f')](handleEntityNotFound(_0x1ed315,null))[_0x7b2d('0x2f')](removeEntity(_0x1ed315,null))['catch'](handleError(_0x1ed315,null));};exports['getConfigurations']=function(_0x455726,_0x5ce23a,_0x213e0c){var _0x5add0b={};var _0x14a515={};var _0x733781;var _0x44ddc5;return db[_0x7b2d('0x33')][_0x7b2d('0x50')]({'where':{'id':_0x455726[_0x7b2d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ce23a,null))[_0x7b2d('0x2f')](function(_0x34dedd){if(_0x34dedd){_0x733781=_0x34dedd;_0x14a515[_0x7b2d('0x37')]=_[_0x7b2d('0x39')](db[_0x7b2d('0x51')]['rawAttributes']);_0x14a515[_0x7b2d('0x38')]=_['keys'](_0x455726[_0x7b2d('0x38')]);_0x14a515['filters']=_[_0x7b2d('0x3a')](_0x14a515[_0x7b2d('0x37')],_0x14a515[_0x7b2d('0x38')]);_0x5add0b[_0x7b2d('0x3b')]=_['intersection'](_0x14a515[_0x7b2d('0x37')],qs[_0x7b2d('0x3c')](_0x455726[_0x7b2d('0x38')]['fields']));_0x5add0b['attributes']=_0x5add0b[_0x7b2d('0x3b')][_0x7b2d('0x3d')]?_0x5add0b['attributes']:_0x14a515[_0x7b2d('0x37')];_0x5add0b[_0x7b2d('0x40')]=qs[_0x7b2d('0x52')](_0x455726[_0x7b2d('0x38')][_0x7b2d('0x52')]);_0x5add0b[_0x7b2d('0x41')]=qs[_0x7b2d('0x42')](_[_0x7b2d('0x43')](_0x455726[_0x7b2d('0x38')],_0x14a515['filters']));if(_0x455726['query'][_0x7b2d('0x44')]){_0x5add0b['where']=_[_0x7b2d('0x45')](_0x5add0b[_0x7b2d('0x41')],{'$or':_[_0x7b2d('0x32')](_0x5add0b[_0x7b2d('0x3b')],function(_0x142d2d){var _0x43dcad={};_0x43dcad[_0x142d2d]={'$like':'%'+_0x455726[_0x7b2d('0x38')][_0x7b2d('0x44')]+'%'};return _0x43dcad;})});}_0x5add0b=_[_0x7b2d('0x45')]({},_0x5add0b,_0x455726[_0x7b2d('0x4b')]);return _0x733781['getConfigurations'](_0x5add0b);}})['then'](function(_0x491c86){if(_0x491c86){_0x44ddc5=_0x491c86[_0x7b2d('0x3d')];if(!_0x455726[_0x7b2d('0x38')]['hasOwnProperty'](_0x7b2d('0x3e'))){_0x5add0b['limit']=qs['limit'](_0x455726['query'][_0x7b2d('0x3f')]);_0x5add0b[_0x7b2d('0x29')]=qs[_0x7b2d('0x29')](_0x455726[_0x7b2d('0x38')][_0x7b2d('0x29')]);}return _0x733781[_0x7b2d('0x53')](_0x5add0b);}})[_0x7b2d('0x2f')](function(_0x383037){if(_0x383037){return _0x383037?{'count':_0x44ddc5,'rows':_0x383037}:null;}})[_0x7b2d('0x2f')](respondWithResult(_0x5ce23a,null))[_0x7b2d('0x23')](handleError(_0x5ce23a,null));};exports[_0x7b2d('0x54')]=function(_0x5cf772,_0xf6fa02,_0xc51a1a){if(_0x5cf772[_0x7b2d('0x4e')]['id']){delete _0x5cf772[_0x7b2d('0x4e')]['id'];}return db['VtigerAccount'][_0x7b2d('0x50')]({'where':{'id':_0x5cf772['params']['id']}})['then'](handleEntityNotFound(_0xf6fa02,null))[_0x7b2d('0x2f')](function(_0x10865e){if(_0x10865e){_0x5cf772[_0x7b2d('0x4e')][_0x7b2d('0x55')]=_0x10865e['id'];_0x5cf772[_0x7b2d('0x4e')][_0x7b2d('0x56')]=integrations['getSubjects'](_0x5cf772[_0x7b2d('0x4e')][_0x7b2d('0x57')],_0x5cf772[_0x7b2d('0x4e')]['type']);_0x5cf772['body'][_0x7b2d('0x58')]=integrations[_0x7b2d('0x59')](_0x5cf772[_0x7b2d('0x4e')][_0x7b2d('0x57')],_0x5cf772[_0x7b2d('0x4e')][_0x7b2d('0x35')]);return db[_0x7b2d('0x51')]['create'](_0x5cf772[_0x7b2d('0x4e')],{'include':[{'model':db[_0x7b2d('0x5a')],'as':'Subjects'},{'model':db[_0x7b2d('0x5a')],'as':_0x7b2d('0x58')}]});}return null;})[_0x7b2d('0x2f')](respondWithResult(_0xf6fa02,null))[_0x7b2d('0x23')](handleError(_0xf6fa02,null));};var md5=require(_0x7b2d('0x5b'));exports[_0x7b2d('0x5c')]=function(_0x5b9737,_0x232070,_0xb2bb74){var _0x2b0866=null;var _0x493ffe=null;var _0x49e165=null;var _0x28a4d7=null;var _0x5cec09='';return db[_0x7b2d('0x33')][_0x7b2d('0x50')]({'where':{'id':_0x5b9737[_0x7b2d('0x4f')]['id']},'attributes':['id','name',_0x7b2d('0x5d'),_0x7b2d('0x5e'),_0x7b2d('0x5f'),_0x7b2d('0x60'),'serverUrl',_0x7b2d('0x61')]})['then'](handleEntityNotFound(_0x232070,null))[_0x7b2d('0x2f')](function(_0x3af830){if(_0x3af830){_0x2b0866=_0x3af830[_0x7b2d('0x5d')];_0x493ffe=_0x3af830['accessKey'];_0x49e165=_0x3af830['moduleName'];_0x5cec09=_0x3af830['remoteUri'];var _0x17d654=_0x5cec09['slice'](-0x1);if(_0x17d654==='/'){_0x5cec09=_0x5cec09[_0x7b2d('0x62')](0x0,_0x5cec09['lastIndexOf'](_0x17d654));}_0x28a4d7=util[_0x7b2d('0x63')](_0x7b2d('0x64'),_0x5cec09);var _0x17aac2={'method':_0x7b2d('0x65'),'uri':_0x28a4d7,'qs':{'operation':_0x7b2d('0x66'),'username':_0x3af830[_0x7b2d('0x5d')]},'json':!![]};return rp(_0x17aac2);}})[_0x7b2d('0x2f')](function(_0x67fc8c){if(_0x67fc8c[_0x7b2d('0x67')]){var _0x2b4cae={'method':'POST','uri':_0x28a4d7,'form':{'operation':_0x7b2d('0x68'),'username':_0x2b0866,'accessKey':md5(_0x67fc8c['result']['token']+_0x493ffe)},'json':!![]};return rp(_0x2b4cae);}})['then'](function(_0x513f2b){if(_0x513f2b['success']){var _0x100c2a={'method':'GET','uri':_0x28a4d7,'qs':{'operation':_0x7b2d('0x69'),'username':_0x2b0866,'sessionName':_0x513f2b[_0x7b2d('0x6a')][_0x7b2d('0x6b')],'elementType':_0x49e165},'json':!![]};return rp(_0x100c2a);}})[_0x7b2d('0x2f')](function(_0x39d6d8){if(_0x39d6d8[_0x7b2d('0x67')]){var _0x3d764d=['autogenerated',_0x7b2d('0x6c'),_0x7b2d('0x6d')];_[_0x7b2d('0x6e')](_0x39d6d8[_0x7b2d('0x6a')][_0x7b2d('0x3c')],function(_0x45c3b9){return _0x3d764d['includes'](_0x45c3b9[_0x7b2d('0x35')][_0x7b2d('0x30')]);});_[_0x7b2d('0x6e')](_0x39d6d8[_0x7b2d('0x6a')][_0x7b2d('0x3c')],function(_0x184aac){return _0x184aac[_0x7b2d('0x6f')]===_0x7b2d('0x70');});return{'count':_0x39d6d8['result'][_0x7b2d('0x3c')]['length'],'rows':_['map'](_0x39d6d8['result'][_0x7b2d('0x3c')],function(_0xf30ffe){return{'id':_0xf30ffe[_0x7b2d('0x30')],'name':_0xf30ffe[_0x7b2d('0x71')],'custom':_[_0x7b2d('0x72')](_0xf30ffe[_0x7b2d('0x30')],_0x7b2d('0x73'))?!![]:![],'options':_0xf30ffe[_0x7b2d('0x35')][_0x7b2d('0x30')]===_0x7b2d('0x74')&&_0xf30ffe[_0x7b2d('0x35')][_0x7b2d('0x75')][_0x7b2d('0x3d')]>0x0?_[_0x7b2d('0x32')](_0xf30ffe[_0x7b2d('0x35')][_0x7b2d('0x75')],function(_0x3284ee){return{'name':_0x3284ee['label'],'value':_0x3284ee['value']};}):[]};})};}})[_0x7b2d('0x2f')](respondWithResult(_0x232070,null))[_0x7b2d('0x23')](function(_0x808afd){console[_0x7b2d('0x76')](_0x7b2d('0x77')+_0x808afd);var _0x44414d=_0x5b9737[_0x7b2d('0x38')][_0x7b2d('0x18')]?0x1f4:_0x808afd[_0x7b2d('0x78')]||0x1f4;logger[_0x7b2d('0x21')](_0x7b2d('0x79'),_0x7b2d('0x5c'),_0x44414d,JSON[_0x7b2d('0x20')](_0x808afd));delete _0x808afd[_0x7b2d('0x30')];if(_0x44414d===0x191){_0x44414d=0x190;}_0x232070[_0x7b2d('0x25')](_0x44414d)[_0x7b2d('0x7a')](_0x5b9737[_0x7b2d('0x38')][_0x7b2d('0x18')]?{'message':_0x7b2d('0x7b'),'statusCode':_0x808afd[_0x7b2d('0x78')]}:_0x808afd);});}; \ No newline at end of file +var _0x4dfd=['addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','username','success','POST','describe','sessionName','autogenerated','reference','owner','remove','editable','false','label','picklist','picklistValues','value','log','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','set','apply','reject','update','destroy','end','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','length','options','create','body','find','params','getConfigurations','findOne'];(function(_0x319ce1,_0x48e3cb){var _0x54182b=function(_0x2d12b){while(--_0x2d12b){_0x319ce1['push'](_0x319ce1['shift']());}};_0x54182b(++_0x48e3cb);}(_0x4dfd,0xa2));var _0xd4df=function(_0x438e69,_0x2953e4){_0x438e69=_0x438e69-0x0;var _0x36e0b8=_0x4dfd[_0x438e69];return _0x36e0b8;};'use strict';var pdf=require(_0xd4df('0x0'));var emlformat=require(_0xd4df('0x1'));var rimraf=require(_0xd4df('0x2'));var zipdir=require(_0xd4df('0x3'));var jsonpatch=require(_0xd4df('0x4'));var rp=require(_0xd4df('0x5'));var moment=require(_0xd4df('0x6'));var BPromise=require(_0xd4df('0x7'));var Mustache=require(_0xd4df('0x8'));var util=require('util');var path=require(_0xd4df('0x9'));var sox=require(_0xd4df('0xa'));var csv=require(_0xd4df('0xb'));var ejs=require(_0xd4df('0xc'));var fs=require('fs');var _=require(_0xd4df('0xd'));var squel=require('squel');var crypto=require(_0xd4df('0xe'));var jsforce=require(_0xd4df('0xf'));var deskjs=require(_0xd4df('0x10'));var toCsv=require(_0xd4df('0xb'));var querystring=require(_0xd4df('0x11'));var Papa=require('papaparse');var Redis=require(_0xd4df('0x12'));var authService=require(_0xd4df('0x13'));var qs=require(_0xd4df('0x14'));var as=require(_0xd4df('0x15'));var hardwareService=require(_0xd4df('0x16'));var logger=require('../../config/logger')(_0xd4df('0x17'));var utils=require(_0xd4df('0x18'));var config=require(_0xd4df('0x19'));var db=require(_0xd4df('0x1a'))['db'];var integrations=require(_0xd4df('0x1b'));var jayson=require(_0xd4df('0x1c'));var client=jayson[_0xd4df('0x1d')][_0xd4df('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x2bac3f,_0x4e875e,_0x2909d7){if(_0x2909d7){var _0x40d162=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40d162[_0xd4df('0x1f')](_0x4e875e)){return _0x2bac3f;}else{throw new db[(_0xd4df('0x20'))][(_0xd4df('0x21'))](_0xd4df('0x22'));}}else{return _0x2bac3f;}}function respondWithRpcPromise(_0x33eeb0,_0x27b24b,_0x47bc3c,_0x1758cb){return new BPromise(function(_0xd3a6d7,_0x2eafe8){var _0x3a5367=_0x1758cb||client;return _0x3a5367['request'](_0x33eeb0,_0x47bc3c)[_0xd4df('0x23')](function(_0x5b1e51){logger[_0xd4df('0x24')](_0xd4df('0x25'),_0x27b24b,_0xd4df('0x26'));logger['debug'](_0xd4df('0x27'),_0x27b24b,'request\x20sent',JSON[_0xd4df('0x28')](_0x5b1e51));if(_0x5b1e51[_0xd4df('0x29')]){if(_0x5b1e51[_0xd4df('0x29')][_0xd4df('0x2a')]===0x1f4){logger[_0xd4df('0x29')]('VtigerAccount,\x20%s,\x20%s',_0x27b24b,_0x5b1e51['error']['message']);return _0x2eafe8(_0x5b1e51['error']['message']);}logger[_0xd4df('0x29')](_0xd4df('0x25'),_0x27b24b,_0x5b1e51['error'][_0xd4df('0x2b')]);return _0xd3a6d7(_0x5b1e51[_0xd4df('0x29')]['message']);}else{logger[_0xd4df('0x24')](_0xd4df('0x25'),_0x27b24b,_0xd4df('0x26'));_0xd3a6d7(_0x5b1e51[_0xd4df('0x2c')][_0xd4df('0x2b')]);}})['catch'](function(_0x5a841d){logger[_0xd4df('0x29')](_0xd4df('0x25'),_0x27b24b,_0x5a841d);_0x2eafe8(_0x5a841d);});});}function respondWithStatusCode(_0x1e0428,_0x3b15bf){_0x3b15bf=_0x3b15bf||0xcc;return function(_0x11c5a7){if(_0x11c5a7){return _0x1e0428[_0xd4df('0x2d')](_0x3b15bf);}return _0x1e0428[_0xd4df('0x2e')](_0x3b15bf)['end']();};}function respondWithResult(_0xe96eb3,_0x19d83d){_0x19d83d=_0x19d83d||0xc8;return function(_0x520dd4){if(_0x520dd4){return _0xe96eb3[_0xd4df('0x2e')](_0x19d83d)[_0xd4df('0x2f')](_0x520dd4);}};}function respondWithFilteredResult(_0x14f21a,_0x518731){return function(_0x90a032){if(_0x90a032){var _0x5e2e05=_0x90a032['count'],_0x5eef53=_0x518731[_0xd4df('0x30')],_0x1915e5=_0x518731[_0xd4df('0x30')]+_0x518731['limit'],_0x4ece0e;if(_0x1915e5>=_0x5e2e05){_0x1915e5=_0x5e2e05;_0x4ece0e=0xc8;}else{_0x4ece0e=0xce;}_0x14f21a[_0xd4df('0x2e')](_0x4ece0e);return _0x14f21a[_0xd4df('0x31')]('Content-Range',_0x5eef53+'-'+_0x1915e5+'/'+_0x5e2e05)[_0xd4df('0x2f')](_0x90a032);}return null;};}function patchUpdates(_0x4bf567){return function(_0x3c87e1){try{jsonpatch[_0xd4df('0x32')](_0x3c87e1,_0x4bf567,!![]);}catch(_0x101357){return BPromise[_0xd4df('0x33')](_0x101357);}return _0x3c87e1['save']();};}function saveUpdates(_0x53d30d,_0x4c112f){return function(_0x4d950e){if(_0x4d950e){return _0x4d950e[_0xd4df('0x34')](_0x53d30d)[_0xd4df('0x23')](function(_0x251b51){return _0x251b51;});}return null;};}function removeEntity(_0x35ecd0,_0x5cf5c4){return function(_0x4f0a20){if(_0x4f0a20){return _0x4f0a20[_0xd4df('0x35')]()['then'](function(){_0x35ecd0[_0xd4df('0x2e')](0xcc)[_0xd4df('0x36')]();});}};}function handleEntityNotFound(_0x24a186,_0x1cd80f){return function(_0x38e702){if(!_0x38e702){_0x24a186['sendStatus'](0x194);}return _0x38e702;};}function handleError(_0x1951f2,_0x24c412){_0x24c412=_0x24c412||0x1f4;return function(_0x3bb1a4){logger[_0xd4df('0x29')](_0x3bb1a4[_0xd4df('0x37')]);if(_0x3bb1a4[_0xd4df('0x38')]){delete _0x3bb1a4['name'];}_0x1951f2[_0xd4df('0x2e')](_0x24c412)[_0xd4df('0x39')](_0x3bb1a4);};}exports[_0xd4df('0x3a')]=function(_0x4073fb,_0x36418a){var _0x39520e={},_0x8559b7={},_0x5305cc={'count':0x0,'rows':[]};var _0x49d534=_['map'](db[_0xd4df('0x3b')][_0xd4df('0x3c')],function(_0x1fb5be){return{'name':_0x1fb5be[_0xd4df('0x3d')],'type':_0x1fb5be[_0xd4df('0x3e')]['key']};});_0x8559b7['model']=_[_0xd4df('0x3f')](_0x49d534,_0xd4df('0x38'));_0x8559b7[_0xd4df('0x40')]=_[_0xd4df('0x41')](_0x4073fb[_0xd4df('0x40')]);_0x8559b7[_0xd4df('0x42')]=_[_0xd4df('0x43')](_0x8559b7[_0xd4df('0x44')],_0x8559b7[_0xd4df('0x40')]);_0x39520e[_0xd4df('0x45')]=_[_0xd4df('0x43')](_0x8559b7[_0xd4df('0x44')],qs[_0xd4df('0x46')](_0x4073fb[_0xd4df('0x40')][_0xd4df('0x46')]));_0x39520e[_0xd4df('0x45')]=_0x39520e[_0xd4df('0x45')]['length']?_0x39520e[_0xd4df('0x45')]:_0x8559b7[_0xd4df('0x44')];if(!_0x4073fb[_0xd4df('0x40')][_0xd4df('0x47')](_0xd4df('0x48'))){_0x39520e[_0xd4df('0x49')]=qs[_0xd4df('0x49')](_0x4073fb[_0xd4df('0x40')][_0xd4df('0x49')]);_0x39520e[_0xd4df('0x30')]=qs[_0xd4df('0x30')](_0x4073fb['query']['offset']);}_0x39520e['order']=qs[_0xd4df('0x4a')](_0x4073fb[_0xd4df('0x40')][_0xd4df('0x4a')]);_0x39520e[_0xd4df('0x4b')]=qs[_0xd4df('0x42')](_[_0xd4df('0x4c')](_0x4073fb[_0xd4df('0x40')],_0x8559b7[_0xd4df('0x42')]));if(_0x4073fb['query'][_0xd4df('0x4d')]){_0x39520e[_0xd4df('0x4b')]=_['merge'](_0x39520e['where'],{'$or':_[_0xd4df('0x3f')](_0x49d534,function(_0x5574a3){if(_0x5574a3['type']!==_0xd4df('0x4e')){var _0x116eac={};_0x116eac[_0x5574a3[_0xd4df('0x38')]]={'$like':'%'+_0x4073fb[_0xd4df('0x40')][_0xd4df('0x4d')]+'%'};return _0x116eac;}})});}_0x39520e=_[_0xd4df('0x4f')]({},_0x39520e,_0x4073fb['options']);var _0x1605c1={'where':_0x39520e['where']};return db[_0xd4df('0x3b')][_0xd4df('0x50')](_0x1605c1)[_0xd4df('0x23')](function(_0x43ab87){_0x5305cc[_0xd4df('0x50')]=_0x43ab87;if(_0x4073fb[_0xd4df('0x40')][_0xd4df('0x51')]){_0x39520e[_0xd4df('0x52')]=[{'all':!![]}];}return db[_0xd4df('0x3b')][_0xd4df('0x53')](_0x39520e);})[_0xd4df('0x23')](function(_0x4099ad){_0x5305cc[_0xd4df('0x54')]=_0x4099ad;return _0x5305cc;})[_0xd4df('0x23')](respondWithFilteredResult(_0x36418a,_0x39520e))[_0xd4df('0x55')](handleError(_0x36418a,null));};exports['show']=function(_0x2883ee,_0x2c2efb){var _0x4338ba={'raw':![],'where':{'id':_0x2883ee['params']['id']}},_0x586690={};_0x586690['model']=_[_0xd4df('0x41')](db[_0xd4df('0x3b')]['rawAttributes']);_0x586690[_0xd4df('0x40')]=_['keys'](_0x2883ee[_0xd4df('0x40')]);_0x586690['filters']=_[_0xd4df('0x43')](_0x586690[_0xd4df('0x44')],_0x586690[_0xd4df('0x40')]);_0x4338ba['attributes']=_['intersection'](_0x586690[_0xd4df('0x44')],qs[_0xd4df('0x46')](_0x2883ee[_0xd4df('0x40')][_0xd4df('0x46')]));_0x4338ba[_0xd4df('0x45')]=_0x4338ba[_0xd4df('0x45')][_0xd4df('0x56')]?_0x4338ba[_0xd4df('0x45')]:_0x586690[_0xd4df('0x44')];if(_0x2883ee[_0xd4df('0x40')][_0xd4df('0x51')]){_0x4338ba[_0xd4df('0x52')]=[{'all':!![]}];}_0x4338ba=_[_0xd4df('0x4f')]({},_0x4338ba,_0x2883ee[_0xd4df('0x57')]);return db[_0xd4df('0x3b')]['find'](_0x4338ba)[_0xd4df('0x23')](handleEntityNotFound(_0x2c2efb,null))[_0xd4df('0x23')](respondWithResult(_0x2c2efb,null))[_0xd4df('0x55')](handleError(_0x2c2efb,null));};exports['create']=function(_0x29a886,_0x46bcd4){return db[_0xd4df('0x3b')][_0xd4df('0x58')](_0x29a886[_0xd4df('0x59')],{})[_0xd4df('0x23')](respondWithResult(_0x46bcd4,0xc9))[_0xd4df('0x55')](handleError(_0x46bcd4,null));};exports[_0xd4df('0x34')]=function(_0x6c5538,_0x5c194b){if(_0x6c5538['body']['id']){delete _0x6c5538['body']['id'];}return db['VtigerAccount'][_0xd4df('0x5a')]({'where':{'id':_0x6c5538['params']['id']}})[_0xd4df('0x23')](handleEntityNotFound(_0x5c194b,null))[_0xd4df('0x23')](saveUpdates(_0x6c5538['body'],null))[_0xd4df('0x23')](respondWithResult(_0x5c194b,null))[_0xd4df('0x55')](handleError(_0x5c194b,null));};exports['destroy']=function(_0x581651,_0x3dc3ab){return db['VtigerAccount'][_0xd4df('0x5a')]({'where':{'id':_0x581651[_0xd4df('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3dc3ab,null))[_0xd4df('0x23')](removeEntity(_0x3dc3ab,null))[_0xd4df('0x55')](handleError(_0x3dc3ab,null));};exports[_0xd4df('0x5c')]=function(_0x21355e,_0x39411b,_0x42c4f2){var _0x3b8b41={};var _0x1e0666={};var _0x161321;var _0x4ac2ae;return db[_0xd4df('0x3b')][_0xd4df('0x5d')]({'where':{'id':_0x21355e[_0xd4df('0x5b')]['id']}})['then'](handleEntityNotFound(_0x39411b,null))[_0xd4df('0x23')](function(_0x46c5f6){if(_0x46c5f6){_0x161321=_0x46c5f6;_0x1e0666[_0xd4df('0x44')]=_['keys'](db['VtigerConfiguration'][_0xd4df('0x3c')]);_0x1e0666['query']=_[_0xd4df('0x41')](_0x21355e[_0xd4df('0x40')]);_0x1e0666['filters']=_[_0xd4df('0x43')](_0x1e0666[_0xd4df('0x44')],_0x1e0666['query']);_0x3b8b41['attributes']=_[_0xd4df('0x43')](_0x1e0666[_0xd4df('0x44')],qs[_0xd4df('0x46')](_0x21355e[_0xd4df('0x40')][_0xd4df('0x46')]));_0x3b8b41[_0xd4df('0x45')]=_0x3b8b41[_0xd4df('0x45')]['length']?_0x3b8b41[_0xd4df('0x45')]:_0x1e0666[_0xd4df('0x44')];_0x3b8b41['order']=qs[_0xd4df('0x4a')](_0x21355e[_0xd4df('0x40')][_0xd4df('0x4a')]);_0x3b8b41[_0xd4df('0x4b')]=qs[_0xd4df('0x42')](_[_0xd4df('0x4c')](_0x21355e[_0xd4df('0x40')],_0x1e0666[_0xd4df('0x42')]));if(_0x21355e[_0xd4df('0x40')]['filter']){_0x3b8b41[_0xd4df('0x4b')]=_['merge'](_0x3b8b41[_0xd4df('0x4b')],{'$or':_[_0xd4df('0x3f')](_0x3b8b41['attributes'],function(_0x55868b){var _0x1340d6={};_0x1340d6[_0x55868b]={'$like':'%'+_0x21355e[_0xd4df('0x40')][_0xd4df('0x4d')]+'%'};return _0x1340d6;})});}_0x3b8b41=_[_0xd4df('0x4f')]({},_0x3b8b41,_0x21355e[_0xd4df('0x57')]);return _0x161321[_0xd4df('0x5c')](_0x3b8b41);}})[_0xd4df('0x23')](function(_0x46ae13){if(_0x46ae13){_0x4ac2ae=_0x46ae13['length'];if(!_0x21355e[_0xd4df('0x40')][_0xd4df('0x47')]('nolimit')){_0x3b8b41[_0xd4df('0x49')]=qs[_0xd4df('0x49')](_0x21355e[_0xd4df('0x40')][_0xd4df('0x49')]);_0x3b8b41['offset']=qs[_0xd4df('0x30')](_0x21355e['query'][_0xd4df('0x30')]);}return _0x161321[_0xd4df('0x5c')](_0x3b8b41);}})[_0xd4df('0x23')](function(_0x3ae97c){if(_0x3ae97c){return _0x3ae97c?{'count':_0x4ac2ae,'rows':_0x3ae97c}:null;}})[_0xd4df('0x23')](respondWithResult(_0x39411b,null))[_0xd4df('0x55')](handleError(_0x39411b,null));};exports[_0xd4df('0x5e')]=function(_0x2d4e44,_0x4ea2b0,_0x5c8fc9){if(_0x2d4e44[_0xd4df('0x59')]['id']){delete _0x2d4e44[_0xd4df('0x59')]['id'];}return db[_0xd4df('0x3b')][_0xd4df('0x5d')]({'where':{'id':_0x2d4e44['params']['id']}})[_0xd4df('0x23')](handleEntityNotFound(_0x4ea2b0,null))[_0xd4df('0x23')](function(_0x3542aa){if(_0x3542aa){_0x2d4e44[_0xd4df('0x59')]['AccountId']=_0x3542aa['id'];_0x2d4e44['body'][_0xd4df('0x5f')]=integrations[_0xd4df('0x60')](_0x2d4e44[_0xd4df('0x59')][_0xd4df('0x61')],_0x2d4e44[_0xd4df('0x59')][_0xd4df('0x3e')]);_0x2d4e44[_0xd4df('0x59')][_0xd4df('0x62')]=integrations['getDescriptions'](_0x2d4e44[_0xd4df('0x59')][_0xd4df('0x61')],_0x2d4e44[_0xd4df('0x59')][_0xd4df('0x3e')]);return db['VtigerConfiguration'][_0xd4df('0x58')](_0x2d4e44[_0xd4df('0x59')],{'include':[{'model':db[_0xd4df('0x63')],'as':_0xd4df('0x5f')},{'model':db[_0xd4df('0x63')],'as':_0xd4df('0x62')}]});}return null;})[_0xd4df('0x23')](respondWithResult(_0x4ea2b0,null))[_0xd4df('0x55')](handleError(_0x4ea2b0,null));};var md5=require(_0xd4df('0x64'));exports[_0xd4df('0x65')]=function(_0x2124ff,_0x171fae,_0x3be8ee){var _0x2852bb=null;var _0xa0c265=null;var _0x17f002=null;var _0x5b2c17=null;var _0x3950d3='';return db['VtigerAccount'][_0xd4df('0x5d')]({'where':{'id':_0x2124ff[_0xd4df('0x5b')]['id']},'attributes':['id',_0xd4df('0x38'),'username',_0xd4df('0x66'),_0xd4df('0x67'),_0xd4df('0x68'),_0xd4df('0x69'),_0xd4df('0x6a')]})[_0xd4df('0x23')](handleEntityNotFound(_0x171fae,null))[_0xd4df('0x23')](function(_0x1cedc4){if(_0x1cedc4){_0x2852bb=_0x1cedc4['username'];_0xa0c265=_0x1cedc4[_0xd4df('0x6a')];_0x17f002=_0x1cedc4[_0xd4df('0x67')];_0x3950d3=_0x1cedc4[_0xd4df('0x68')];var _0x93d783=_0x3950d3[_0xd4df('0x6b')](-0x1);if(_0x93d783==='/'){_0x3950d3=_0x3950d3[_0xd4df('0x6c')](0x0,_0x3950d3['lastIndexOf'](_0x93d783));}_0x5b2c17=util[_0xd4df('0x6d')](_0xd4df('0x6e'),_0x3950d3);var _0xa1b3db={'method':'GET','uri':_0x5b2c17,'qs':{'operation':'getchallenge','username':_0x1cedc4[_0xd4df('0x6f')]},'json':!![]};return rp(_0xa1b3db);}})[_0xd4df('0x23')](function(_0xf4e77b){if(_0xf4e77b[_0xd4df('0x70')]){var _0x3324d2={'method':_0xd4df('0x71'),'uri':_0x5b2c17,'form':{'operation':'login','username':_0x2852bb,'accessKey':md5(_0xf4e77b[_0xd4df('0x2c')]['token']+_0xa0c265)},'json':!![]};return rp(_0x3324d2);}})['then'](function(_0x5e3317){if(_0x5e3317[_0xd4df('0x70')]){var _0x350b6e={'method':'GET','uri':_0x5b2c17,'qs':{'operation':_0xd4df('0x72'),'username':_0x2852bb,'sessionName':_0x5e3317[_0xd4df('0x2c')][_0xd4df('0x73')],'elementType':_0x17f002},'json':!![]};return rp(_0x350b6e);}})[_0xd4df('0x23')](function(_0x2c42e2){if(_0x2c42e2[_0xd4df('0x70')]){var _0x1a1204=[_0xd4df('0x74'),_0xd4df('0x75'),_0xd4df('0x76')];_[_0xd4df('0x77')](_0x2c42e2[_0xd4df('0x2c')]['fields'],function(_0x1191fa){return _0x1a1204['includes'](_0x1191fa[_0xd4df('0x3e')]['name']);});_[_0xd4df('0x77')](_0x2c42e2[_0xd4df('0x2c')][_0xd4df('0x46')],function(_0x5df2c8){return _0x5df2c8[_0xd4df('0x78')]===_0xd4df('0x79');});return{'count':_0x2c42e2[_0xd4df('0x2c')][_0xd4df('0x46')][_0xd4df('0x56')],'rows':_[_0xd4df('0x3f')](_0x2c42e2[_0xd4df('0x2c')]['fields'],function(_0x4f5265){return{'id':_0x4f5265[_0xd4df('0x38')],'name':_0x4f5265[_0xd4df('0x7a')],'custom':_['startsWith'](_0x4f5265['name'],'cf_')?!![]:![],'options':_0x4f5265[_0xd4df('0x3e')]['name']===_0xd4df('0x7b')&&_0x4f5265['type'][_0xd4df('0x7c')][_0xd4df('0x56')]>0x0?_['map'](_0x4f5265[_0xd4df('0x3e')]['picklistValues'],function(_0x39b55b){return{'name':_0x39b55b[_0xd4df('0x7a')],'value':_0x39b55b[_0xd4df('0x7d')]};}):[]};})};}})['then'](respondWithResult(_0x171fae,null))[_0xd4df('0x55')](function(_0x4d3386){console[_0xd4df('0x7e')]('vTiger\x20error:\x20'+_0x4d3386);var _0xc510bd=_0x2124ff[_0xd4df('0x40')][_0xd4df('0x1f')]?0x1f4:_0x4d3386[_0xd4df('0x7f')]||0x1f4;logger[_0xd4df('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xd4df('0x65'),_0xc510bd,JSON['stringify'](_0x4d3386));delete _0x4d3386[_0xd4df('0x38')];if(_0xc510bd===0x191){_0xc510bd=0x190;}_0x171fae[_0xd4df('0x2e')](_0xc510bd)[_0xd4df('0x39')](_0x2124ff[_0xd4df('0x40')][_0xd4df('0x1f')]?{'message':'Wrong\x20credentials','statusCode':_0x4d3386[_0xd4df('0x7f')]}:_0x4d3386);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 343bf50..f56cd63 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.model.js +++ b/server/api/intVtigerAccount/intVtigerAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd92=['int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','VtigerAccount'];(function(_0x587804,_0x2ea6a5){var _0x43ce53=function(_0x1c75a3){while(--_0x1c75a3){_0x587804['push'](_0x587804['shift']());}};_0x43ce53(++_0x2ea6a5);}(_0xfd92,0x161));var _0x2fd9=function(_0x511e82,_0x5c8e7b){_0x511e82=_0x511e82-0x0;var _0x32bc8e=_0xfd92[_0x511e82];return _0x32bc8e;};'use strict';var _=require(_0x2fd9('0x0'));var util=require(_0x2fd9('0x1'));var logger=require(_0x2fd9('0x2'))('api');var moment=require(_0x2fd9('0x3'));var BPromise=require(_0x2fd9('0x4'));var rp=require(_0x2fd9('0x5'));var fs=require('fs');var path=require(_0x2fd9('0x6'));var rimraf=require(_0x2fd9('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x2fd9('0x8'));module['exports']=function(_0x2d6b21,_0x3120f0){return _0x2d6b21['define'](_0x2fd9('0x9'),attributes,{'tableName':_0x2fd9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25fc=['bluebird','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','lodash','util','api'];(function(_0x17e1f5,_0x60876){var _0x3a8b74=function(_0xa9fc3d){while(--_0xa9fc3d){_0x17e1f5['push'](_0x17e1f5['shift']());}};_0x3a8b74(++_0x60876);}(_0x25fc,0x1b5));var _0xc25f=function(_0x78894e,_0x41aaff){_0x78894e=_0x78894e-0x0;var _0x4d4eea=_0x25fc[_0x78894e];return _0x4d4eea;};'use strict';var _=require(_0xc25f('0x0'));var util=require(_0xc25f('0x1'));var logger=require('../../config/logger')(_0xc25f('0x2'));var moment=require('moment');var BPromise=require(_0xc25f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc25f('0x4'));var config=require(_0xc25f('0x5'));var attributes=require(_0xc25f('0x6'));var integrations=require(_0xc25f('0x7'));module['exports']=function(_0x51e1ae,_0x1b2d24){return _0x51e1ae[_0xc25f('0x8')]('VtigerAccount',attributes,{'tableName':_0xc25f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 1c0fc71..1babf5c 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7a5=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','include','map','model','ShowVtigerAccount','find','then'];(function(_0x428df1,_0x84f944){var _0x558c6a=function(_0xf5a33b){while(--_0xf5a33b){_0x428df1['push'](_0x428df1['shift']());}};_0x558c6a(++_0x84f944);}(_0xb7a5,0x1ce));var _0x5b7a=function(_0x1f4cc4,_0x22188a){_0x1f4cc4=_0x1f4cc4-0x0;var _0x5ab3a1=_0xb7a5[_0x1f4cc4];return _0x5ab3a1;};'use strict';var _=require('lodash');var util=require(_0x5b7a('0x0'));var moment=require(_0x5b7a('0x1'));var BPromise=require(_0x5b7a('0x2'));var rs=require(_0x5b7a('0x3'));var fs=require('fs');var Redis=require(_0x5b7a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b7a('0x5'));var logger=require(_0x5b7a('0x6'))('rpc');var config=require(_0x5b7a('0x7'));var jayson=require(_0x5b7a('0x8'));var client=jayson['client'][_0x5b7a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6b58db,_0x4052d4,_0x1c8981){return new BPromise(function(_0x4ca4bf,_0x36aae2){return client[_0x5b7a('0xa')](_0x6b58db,_0x1c8981)['then'](function(_0xb04798){logger[_0x5b7a('0xb')](_0x5b7a('0xc'),_0x4052d4,'request\x20sent');logger[_0x5b7a('0xd')](_0x5b7a('0xe'),_0x4052d4,_0x5b7a('0xf'),JSON[_0x5b7a('0x10')](_0xb04798));if(_0xb04798[_0x5b7a('0x11')]){if(_0xb04798[_0x5b7a('0x11')][_0x5b7a('0x12')]===0x1f4){logger[_0x5b7a('0x11')](_0x5b7a('0xc'),_0x4052d4,_0xb04798[_0x5b7a('0x11')][_0x5b7a('0x13')]);return _0x36aae2(_0xb04798[_0x5b7a('0x11')][_0x5b7a('0x13')]);}logger[_0x5b7a('0x11')](_0x5b7a('0xc'),_0x4052d4,_0xb04798[_0x5b7a('0x11')][_0x5b7a('0x13')]);return _0x4ca4bf(_0xb04798[_0x5b7a('0x11')][_0x5b7a('0x13')]);}else{logger[_0x5b7a('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x4052d4,_0x5b7a('0xf'));_0x4ca4bf(_0xb04798['result'][_0x5b7a('0x13')]);}})[_0x5b7a('0x14')](function(_0x1f60c6){logger[_0x5b7a('0x11')](_0x5b7a('0xc'),_0x4052d4,_0x1f60c6);_0x36aae2(_0x1f60c6);});});}exports[_0x5b7a('0x15')]=function(_0x3718f5){var _0x668666=this;return new Promise(function(_0x5da8f5,_0x5039fb){return db[_0x5b7a('0x16')][_0x5b7a('0x17')]({'raw':_0x3718f5[_0x5b7a('0x18')]?_0x3718f5['options']['raw']===undefined?!![]:![]:!![],'where':_0x3718f5['options']?_0x3718f5[_0x5b7a('0x18')][_0x5b7a('0x19')]||null:null,'attributes':_0x3718f5[_0x5b7a('0x18')]?_0x3718f5[_0x5b7a('0x18')][_0x5b7a('0x1a')]||null:null,'limit':_0x3718f5[_0x5b7a('0x18')]?_0x3718f5['options']['limit']||null:null,'include':_0x3718f5[_0x5b7a('0x18')]?_0x3718f5['options'][_0x5b7a('0x1b')]?_[_0x5b7a('0x1c')](_0x3718f5[_0x5b7a('0x18')][_0x5b7a('0x1b')],function(_0x33256b){return{'model':db[_0x33256b['model']],'as':_0x33256b['as'],'attributes':_0x33256b[_0x5b7a('0x1a')],'include':_0x33256b['include']?_[_0x5b7a('0x1c')](_0x33256b[_0x5b7a('0x1b')],function(_0x2e0a52){return{'model':db[_0x2e0a52[_0x5b7a('0x1d')]],'as':_0x2e0a52['as'],'attributes':_0x2e0a52[_0x5b7a('0x1a')],'include':_0x2e0a52[_0x5b7a('0x1b')]?_[_0x5b7a('0x1c')](_0x2e0a52[_0x5b7a('0x1b')],function(_0x7b750c){return{'model':db[_0x7b750c[_0x5b7a('0x1d')]],'as':_0x7b750c['as'],'attributes':_0x7b750c[_0x5b7a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3524d5){logger[_0x5b7a('0xb')](_0x5b7a('0x15'),_0x3718f5);logger[_0x5b7a('0xd')](_0x5b7a('0x15'),_0x3718f5,JSON['stringify'](_0x3524d5));_0x5da8f5(_0x3524d5);})['catch'](function(_0x4cd2ac){logger[_0x5b7a('0x11')](_0x5b7a('0x15'),_0x4cd2ac[_0x5b7a('0x13')],_0x3718f5);_0x5039fb(_0x668666['error'](0x1f4,_0x4cd2ac['message']));});});};exports[_0x5b7a('0x1e')]=function(_0x5c8c84){var _0x57c475=this;return new Promise(function(_0x5af025,_0x3c23e5){return db[_0x5b7a('0x16')][_0x5b7a('0x1f')]({'raw':_0x5c8c84[_0x5b7a('0x18')]?_0x5c8c84[_0x5b7a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c8c84['options']?_0x5c8c84[_0x5b7a('0x18')]['where']||null:null,'attributes':_0x5c8c84[_0x5b7a('0x18')]?_0x5c8c84[_0x5b7a('0x18')]['attributes']||null:null,'include':_0x5c8c84[_0x5b7a('0x18')]?_0x5c8c84['options'][_0x5b7a('0x1b')]?_['map'](_0x5c8c84['options']['include'],function(_0x35fd75){return{'model':db[_0x35fd75[_0x5b7a('0x1d')]],'as':_0x35fd75['as'],'attributes':_0x35fd75['attributes'],'include':_0x35fd75['include']?_[_0x5b7a('0x1c')](_0x35fd75[_0x5b7a('0x1b')],function(_0x52f500){return{'model':db[_0x52f500['model']],'as':_0x52f500['as'],'attributes':_0x52f500[_0x5b7a('0x1a')],'include':_0x52f500[_0x5b7a('0x1b')]?_[_0x5b7a('0x1c')](_0x52f500[_0x5b7a('0x1b')],function(_0x25b631){return{'model':db[_0x25b631[_0x5b7a('0x1d')]],'as':_0x25b631['as'],'attributes':_0x25b631[_0x5b7a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5b7a('0x20')](function(_0x1efe71){logger['info'](_0x5b7a('0x1e'),_0x5c8c84);logger['debug']('ShowVtigerAccount',_0x5c8c84,JSON[_0x5b7a('0x10')](_0x1efe71));_0x5af025(_0x1efe71);})[_0x5b7a('0x14')](function(_0x478ed5){logger['error'](_0x5b7a('0x1e'),_0x478ed5[_0x5b7a('0x13')],_0x5c8c84);_0x3c23e5(_0x57c475['error'](0x1f4,_0x478ed5[_0x5b7a('0x13')]));});});}; \ No newline at end of file +var _0xe656=['options','raw','where','attributes','limit','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0xe656,0xa3));var _0x6e65=function(_0x96cb8f,_0x1cdbb9){_0x96cb8f=_0x96cb8f-0x0;var _0x53b83b=_0xe656[_0x96cb8f];return _0x53b83b;};'use strict';var _=require('lodash');var util=require(_0x6e65('0x0'));var moment=require(_0x6e65('0x1'));var BPromise=require(_0x6e65('0x2'));var rs=require(_0x6e65('0x3'));var fs=require('fs');var Redis=require(_0x6e65('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e65('0x5'));var logger=require(_0x6e65('0x6'))(_0x6e65('0x7'));var config=require(_0x6e65('0x8'));var jayson=require(_0x6e65('0x9'));var client=jayson[_0x6e65('0xa')][_0x6e65('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cc624,_0x2c4eeb,_0x54dbb6){return new BPromise(function(_0x4195cc,_0x47c58a){return client[_0x6e65('0xc')](_0x5cc624,_0x54dbb6)['then'](function(_0x430cf3){logger[_0x6e65('0xd')](_0x6e65('0xe'),_0x2c4eeb,_0x6e65('0xf'));logger[_0x6e65('0x10')](_0x6e65('0x11'),_0x2c4eeb,_0x6e65('0xf'),JSON[_0x6e65('0x12')](_0x430cf3));if(_0x430cf3[_0x6e65('0x13')]){if(_0x430cf3[_0x6e65('0x13')][_0x6e65('0x14')]===0x1f4){logger['error'](_0x6e65('0xe'),_0x2c4eeb,_0x430cf3[_0x6e65('0x13')][_0x6e65('0x15')]);return _0x47c58a(_0x430cf3[_0x6e65('0x13')][_0x6e65('0x15')]);}logger[_0x6e65('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x2c4eeb,_0x430cf3[_0x6e65('0x13')][_0x6e65('0x15')]);return _0x4195cc(_0x430cf3[_0x6e65('0x13')][_0x6e65('0x15')]);}else{logger[_0x6e65('0xd')](_0x6e65('0xe'),_0x2c4eeb,_0x6e65('0xf'));_0x4195cc(_0x430cf3[_0x6e65('0x16')][_0x6e65('0x15')]);}})[_0x6e65('0x17')](function(_0x2695e7){logger[_0x6e65('0x13')](_0x6e65('0xe'),_0x2c4eeb,_0x2695e7);_0x47c58a(_0x2695e7);});});}exports[_0x6e65('0x18')]=function(_0x368126){var _0x33e571=this;return new Promise(function(_0x208089,_0x3369e1){return db[_0x6e65('0x19')][_0x6e65('0x1a')]({'raw':_0x368126[_0x6e65('0x1b')]?_0x368126[_0x6e65('0x1b')][_0x6e65('0x1c')]===undefined?!![]:![]:!![],'where':_0x368126[_0x6e65('0x1b')]?_0x368126['options'][_0x6e65('0x1d')]||null:null,'attributes':_0x368126[_0x6e65('0x1b')]?_0x368126[_0x6e65('0x1b')][_0x6e65('0x1e')]||null:null,'limit':_0x368126[_0x6e65('0x1b')]?_0x368126['options'][_0x6e65('0x1f')]||null:null,'include':_0x368126[_0x6e65('0x1b')]?_0x368126['options'][_0x6e65('0x20')]?_[_0x6e65('0x21')](_0x368126[_0x6e65('0x1b')][_0x6e65('0x20')],function(_0x335d97){return{'model':db[_0x335d97[_0x6e65('0x22')]],'as':_0x335d97['as'],'attributes':_0x335d97[_0x6e65('0x1e')],'include':_0x335d97['include']?_['map'](_0x335d97[_0x6e65('0x20')],function(_0xd8dd9f){return{'model':db[_0xd8dd9f['model']],'as':_0xd8dd9f['as'],'attributes':_0xd8dd9f['attributes'],'include':_0xd8dd9f[_0x6e65('0x20')]?_[_0x6e65('0x21')](_0xd8dd9f[_0x6e65('0x20')],function(_0x3a58d2){return{'model':db[_0x3a58d2[_0x6e65('0x22')]],'as':_0x3a58d2['as'],'attributes':_0x3a58d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e65('0x23')](function(_0x1b57cb){logger[_0x6e65('0xd')](_0x6e65('0x18'),_0x368126);logger[_0x6e65('0x10')](_0x6e65('0x18'),_0x368126,JSON[_0x6e65('0x12')](_0x1b57cb));_0x208089(_0x1b57cb);})[_0x6e65('0x17')](function(_0x4901fe){logger[_0x6e65('0x13')]('GetVtigerAccount',_0x4901fe['message'],_0x368126);_0x3369e1(_0x33e571[_0x6e65('0x13')](0x1f4,_0x4901fe[_0x6e65('0x15')]));});});};exports[_0x6e65('0x24')]=function(_0x2215b5){var _0x10541a=this;return new Promise(function(_0x5f31ce,_0x253b93){return db[_0x6e65('0x19')][_0x6e65('0x25')]({'raw':_0x2215b5[_0x6e65('0x1b')]?_0x2215b5['options']['raw']===undefined?!![]:![]:!![],'where':_0x2215b5['options']?_0x2215b5[_0x6e65('0x1b')][_0x6e65('0x1d')]||null:null,'attributes':_0x2215b5['options']?_0x2215b5[_0x6e65('0x1b')][_0x6e65('0x1e')]||null:null,'include':_0x2215b5['options']?_0x2215b5[_0x6e65('0x1b')][_0x6e65('0x20')]?_[_0x6e65('0x21')](_0x2215b5['options'][_0x6e65('0x20')],function(_0x16b9da){return{'model':db[_0x16b9da['model']],'as':_0x16b9da['as'],'attributes':_0x16b9da[_0x6e65('0x1e')],'include':_0x16b9da['include']?_['map'](_0x16b9da['include'],function(_0x4d34db){return{'model':db[_0x4d34db[_0x6e65('0x22')]],'as':_0x4d34db['as'],'attributes':_0x4d34db[_0x6e65('0x1e')],'include':_0x4d34db[_0x6e65('0x20')]?_[_0x6e65('0x21')](_0x4d34db[_0x6e65('0x20')],function(_0x3f77f6){return{'model':db[_0x3f77f6['model']],'as':_0x3f77f6['as'],'attributes':_0x3f77f6[_0x6e65('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b40e6){logger[_0x6e65('0xd')](_0x6e65('0x24'),_0x2215b5);logger[_0x6e65('0x10')](_0x6e65('0x24'),_0x2215b5,JSON[_0x6e65('0x12')](_0x5b40e6));_0x5f31ce(_0x5b40e6);})[_0x6e65('0x17')](function(_0x4ae1d7){logger[_0x6e65('0x13')](_0x6e65('0x24'),_0x4ae1d7[_0x6e65('0x15')],_0x2215b5);_0x253b93(_0x10541a[_0x6e65('0x13')](0x1f4,_0x4ae1d7[_0x6e65('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 0f45f82..c3e4663 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x4beed5,_0x2001c4){var _0xec6694=function(_0x58c14b){while(--_0x58c14b){_0x4beed5['push'](_0x4beed5['shift']());}};_0xec6694(++_0x2001c4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2be66f,_0x3c4c29){_0x2be66f=_0x2be66f-0x0;var _0x403664=_0x5f2f[_0x2be66f];return _0x403664;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x29c25f,_0x23420a){var _0x54c872=function(_0x3735ad){while(--_0x3735ad){_0x29c25f['push'](_0x29c25f['shift']());}};_0x54c872(++_0x23420a);}(_0xb10b,0x12a));var _0xbb10=function(_0x424a50,_0x1fd66d){_0x424a50=_0x424a50-0x0;var _0x1427b2=_0xb10b[_0x424a50];return _0x1427b2;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 431c82d..895ed3a 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6ff=['STRING','sequelize','exports'];(function(_0x1c4a48,_0x2c9904){var _0x3f1c1d=function(_0x2580b5){while(--_0x2580b5){_0x1c4a48['push'](_0x1c4a48['shift']());}};_0x3f1c1d(++_0x2c9904);}(_0xd6ff,0x14e));var _0xfd6f=function(_0x5dba37,_0x149b07){_0x5dba37=_0x5dba37-0x0;var _0x2339bc=_0xd6ff[_0x5dba37];return _0x2339bc;};'use strict';var Sequelize=require(_0xfd6f('0x0'));module[_0xfd6f('0x1')]={'name':{'type':Sequelize[_0xfd6f('0x2')]},'description':{'type':Sequelize[_0xfd6f('0x2')]}}; \ No newline at end of file +var _0xbaa0=['STRING','sequelize','exports'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0xbaa0,0xeb));var _0x0baa=function(_0x361ab0,_0x4034c0){_0x361ab0=_0x361ab0-0x0;var _0x64f8fa=_0xbaa0[_0x361ab0];return _0x64f8fa;};'use strict';var Sequelize=require(_0x0baa('0x0'));module[_0x0baa('0x1')]={'name':{'type':Sequelize[_0x0baa('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index d5540f6..6895bc0 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa88d=['order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','test','ValidationError','request','then','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x3e6a31,_0x35106e){var _0x2db1eb=function(_0xb43886){while(--_0xb43886){_0x3e6a31['push'](_0x3e6a31['shift']());}};_0x2db1eb(++_0x35106e);}(_0xa88d,0x1e4));var _0xda88=function(_0x16dffe,_0x42d19f){_0x16dffe=_0x16dffe-0x0;var _0x2758ea=_0xa88d[_0x16dffe];return _0x2758ea;};'use strict';var pdf=require(_0xda88('0x0'));var emlformat=require(_0xda88('0x1'));var rimraf=require(_0xda88('0x2'));var zipdir=require(_0xda88('0x3'));var jsonpatch=require(_0xda88('0x4'));var rp=require(_0xda88('0x5'));var moment=require(_0xda88('0x6'));var BPromise=require(_0xda88('0x7'));var Mustache=require(_0xda88('0x8'));var util=require(_0xda88('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xda88('0xa'));var ejs=require(_0xda88('0xb'));var fs=require('fs');var _=require(_0xda88('0xc'));var squel=require(_0xda88('0xd'));var crypto=require(_0xda88('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xda88('0xf'));var toCsv=require(_0xda88('0xa'));var querystring=require(_0xda88('0x10'));var Papa=require(_0xda88('0x11'));var Redis=require('ioredis');var authService=require(_0xda88('0x12'));var qs=require(_0xda88('0x13'));var as=require(_0xda88('0x14'));var hardwareService=require(_0xda88('0x15'));var logger=require(_0xda88('0x16'))(_0xda88('0x17'));var utils=require(_0xda88('0x18'));var config=require(_0xda88('0x19'));var db=require(_0xda88('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xda88('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x1907f0,_0x503af3,_0x2dbb2d){if(_0x2dbb2d){var _0x139eb3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x139eb3[_0xda88('0x1c')](_0x503af3)){return _0x1907f0;}else{throw new db['Sequelize'][(_0xda88('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1907f0;}}function respondWithRpcPromise(_0x338cda,_0x2b2b22,_0x2329a3,_0x3d807e){return new BPromise(function(_0x3c6a6b,_0x514dd9){var _0x268e55=_0x3d807e||client;return _0x268e55[_0xda88('0x1e')](_0x338cda,_0x2329a3)[_0xda88('0x1f')](function(_0x3a2e3c){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x2b2b22,_0xda88('0x20'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x2b2b22,_0xda88('0x20'),JSON[_0xda88('0x21')](_0x3a2e3c));if(_0x3a2e3c[_0xda88('0x22')]){if(_0x3a2e3c[_0xda88('0x22')][_0xda88('0x23')]===0x1f4){logger['error'](_0xda88('0x24'),_0x2b2b22,_0x3a2e3c[_0xda88('0x22')]['message']);return _0x514dd9(_0x3a2e3c['error'][_0xda88('0x25')]);}logger[_0xda88('0x22')](_0xda88('0x24'),_0x2b2b22,_0x3a2e3c[_0xda88('0x22')][_0xda88('0x25')]);return _0x3c6a6b(_0x3a2e3c[_0xda88('0x22')][_0xda88('0x25')]);}else{logger[_0xda88('0x26')](_0xda88('0x24'),_0x2b2b22,_0xda88('0x20'));_0x3c6a6b(_0x3a2e3c[_0xda88('0x27')]['message']);}})[_0xda88('0x28')](function(_0x517fa4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2b2b22,_0x517fa4);_0x514dd9(_0x517fa4);});});}function respondWithStatusCode(_0x29dd7e,_0x9e9ee8){_0x9e9ee8=_0x9e9ee8||0xcc;return function(_0xf114e8){if(_0xf114e8){return _0x29dd7e[_0xda88('0x29')](_0x9e9ee8);}return _0x29dd7e['status'](_0x9e9ee8)['end']();};}function respondWithResult(_0x3e5915,_0x4d79c1){_0x4d79c1=_0x4d79c1||0xc8;return function(_0x17d4fc){if(_0x17d4fc){return _0x3e5915[_0xda88('0x2a')](_0x4d79c1)[_0xda88('0x2b')](_0x17d4fc);}};}function respondWithFilteredResult(_0x2d1d51,_0x538910){return function(_0x101169){if(_0x101169){var _0x2fbd7d=_0x101169[_0xda88('0x2c')],_0x56ad56=_0x538910[_0xda88('0x2d')],_0x4c48fe=_0x538910[_0xda88('0x2d')]+_0x538910[_0xda88('0x2e')],_0x82ab8d;if(_0x4c48fe>=_0x2fbd7d){_0x4c48fe=_0x2fbd7d;_0x82ab8d=0xc8;}else{_0x82ab8d=0xce;}_0x2d1d51[_0xda88('0x2a')](_0x82ab8d);return _0x2d1d51[_0xda88('0x2f')](_0xda88('0x30'),_0x56ad56+'-'+_0x4c48fe+'/'+_0x2fbd7d)[_0xda88('0x2b')](_0x101169);}return null;};}function patchUpdates(_0x10314b){return function(_0x22b237){try{jsonpatch[_0xda88('0x31')](_0x22b237,_0x10314b,!![]);}catch(_0xd93038){return BPromise['reject'](_0xd93038);}return _0x22b237[_0xda88('0x32')]();};}function saveUpdates(_0xcae61f,_0x358211){return function(_0x2747a1){if(_0x2747a1){return _0x2747a1[_0xda88('0x33')](_0xcae61f)[_0xda88('0x1f')](function(_0x40e567){return _0x40e567;});}return null;};}function removeEntity(_0x30b8aa,_0x127ca){return function(_0x1fa1af){if(_0x1fa1af){return _0x1fa1af[_0xda88('0x34')]()[_0xda88('0x1f')](function(){_0x30b8aa[_0xda88('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe5b904,_0xdf31c0){return function(_0x23ff65){if(!_0x23ff65){_0xe5b904[_0xda88('0x29')](0x194);}return _0x23ff65;};}function handleError(_0x5b6d1c,_0x210c95){_0x210c95=_0x210c95||0x1f4;return function(_0x56d5d3){logger[_0xda88('0x22')](_0x56d5d3['stack']);if(_0x56d5d3['name']){delete _0x56d5d3[_0xda88('0x35')];}_0x5b6d1c['status'](_0x210c95)[_0xda88('0x36')](_0x56d5d3);};}exports[_0xda88('0x37')]=function(_0x51be95,_0x6f04ee){var _0x4a399c={},_0x2aa3d0={},_0x3c244a={'count':0x0,'rows':[]};var _0x327218=_[_0xda88('0x38')](db[_0xda88('0x39')][_0xda88('0x3a')],function(_0x5789e0){return{'name':_0x5789e0[_0xda88('0x3b')],'type':_0x5789e0['type']['key']};});_0x2aa3d0[_0xda88('0x3c')]=_[_0xda88('0x38')](_0x327218,_0xda88('0x35'));_0x2aa3d0[_0xda88('0x3d')]=_['keys'](_0x51be95['query']);_0x2aa3d0[_0xda88('0x3e')]=_[_0xda88('0x3f')](_0x2aa3d0['model'],_0x2aa3d0['query']);_0x4a399c[_0xda88('0x40')]=_[_0xda88('0x3f')](_0x2aa3d0[_0xda88('0x3c')],qs[_0xda88('0x41')](_0x51be95[_0xda88('0x3d')][_0xda88('0x41')]));_0x4a399c[_0xda88('0x40')]=_0x4a399c[_0xda88('0x40')]['length']?_0x4a399c[_0xda88('0x40')]:_0x2aa3d0[_0xda88('0x3c')];if(!_0x51be95['query'][_0xda88('0x42')](_0xda88('0x43'))){_0x4a399c[_0xda88('0x2e')]=qs[_0xda88('0x2e')](_0x51be95[_0xda88('0x3d')]['limit']);_0x4a399c[_0xda88('0x2d')]=qs['offset'](_0x51be95[_0xda88('0x3d')][_0xda88('0x2d')]);}_0x4a399c[_0xda88('0x44')]=qs['sort'](_0x51be95['query'][_0xda88('0x45')]);_0x4a399c[_0xda88('0x46')]=qs['filters'](_[_0xda88('0x47')](_0x51be95[_0xda88('0x3d')],_0x2aa3d0[_0xda88('0x3e')]));if(_0x51be95['query'][_0xda88('0x48')]){_0x4a399c[_0xda88('0x46')]=_[_0xda88('0x49')](_0x4a399c[_0xda88('0x46')],{'$or':_[_0xda88('0x38')](_0x327218,function(_0x553bc9){if(_0x553bc9[_0xda88('0x4a')]!=='VIRTUAL'){var _0x346de0={};_0x346de0[_0x553bc9[_0xda88('0x35')]]={'$like':'%'+_0x51be95[_0xda88('0x3d')]['filter']+'%'};return _0x346de0;}})});}_0x4a399c=_[_0xda88('0x49')]({},_0x4a399c,_0x51be95[_0xda88('0x4b')]);var _0x472eb3={'where':_0x4a399c[_0xda88('0x46')]};return db['VtigerConfiguration']['count'](_0x472eb3)[_0xda88('0x1f')](function(_0x5c08a3){_0x3c244a['count']=_0x5c08a3;if(_0x51be95['query'][_0xda88('0x4c')]){_0x4a399c[_0xda88('0x4d')]=[{'all':!![]}];}return db[_0xda88('0x39')][_0xda88('0x4e')](_0x4a399c);})['then'](function(_0x634c61){_0x3c244a[_0xda88('0x4f')]=_0x634c61;return _0x3c244a;})['then'](respondWithFilteredResult(_0x6f04ee,_0x4a399c))[_0xda88('0x28')](handleError(_0x6f04ee,null));};exports[_0xda88('0x50')]=function(_0x2bb6c9,_0x412b6a){var _0x393ef4={'raw':![],'where':{'id':_0x2bb6c9[_0xda88('0x51')]['id']}},_0x2a7bb3={};_0x2a7bb3[_0xda88('0x3c')]=_[_0xda88('0x52')](db[_0xda88('0x39')][_0xda88('0x3a')]);_0x2a7bb3[_0xda88('0x3d')]=_[_0xda88('0x52')](_0x2bb6c9[_0xda88('0x3d')]);_0x2a7bb3[_0xda88('0x3e')]=_[_0xda88('0x3f')](_0x2a7bb3['model'],_0x2a7bb3[_0xda88('0x3d')]);_0x393ef4[_0xda88('0x40')]=_[_0xda88('0x3f')](_0x2a7bb3[_0xda88('0x3c')],qs[_0xda88('0x41')](_0x2bb6c9[_0xda88('0x3d')]['fields']));_0x393ef4['attributes']=_0x393ef4['attributes'][_0xda88('0x53')]?_0x393ef4[_0xda88('0x40')]:_0x2a7bb3[_0xda88('0x3c')];if(_0x2bb6c9[_0xda88('0x3d')][_0xda88('0x4c')]){_0x393ef4[_0xda88('0x4d')]=[{'all':!![]}];}_0x393ef4=_[_0xda88('0x49')]({},_0x393ef4,_0x2bb6c9[_0xda88('0x4b')]);return db[_0xda88('0x39')][_0xda88('0x54')](_0x393ef4)[_0xda88('0x1f')](handleEntityNotFound(_0x412b6a,null))['then'](respondWithResult(_0x412b6a,null))[_0xda88('0x28')](handleError(_0x412b6a,null));};exports[_0xda88('0x55')]=function(_0x1ee4a3,_0x2a227a){return db[_0xda88('0x39')]['create'](_0x1ee4a3[_0xda88('0x56')],{})[_0xda88('0x1f')](respondWithResult(_0x2a227a,0xc9))[_0xda88('0x28')](handleError(_0x2a227a,null));};exports['update']=function(_0x596939,_0x19847a){if(_0x596939[_0xda88('0x56')]['id']){delete _0x596939['body']['id'];}return db[_0xda88('0x39')]['find']({'where':{'id':_0x596939[_0xda88('0x51')]['id']}})['then'](handleEntityNotFound(_0x19847a,null))[_0xda88('0x1f')](saveUpdates(_0x596939[_0xda88('0x56')],null))[_0xda88('0x1f')](respondWithResult(_0x19847a,null))[_0xda88('0x28')](handleError(_0x19847a,null));};exports[_0xda88('0x34')]=function(_0x2e5fc4,_0x4e154c){return db[_0xda88('0x39')][_0xda88('0x54')]({'where':{'id':_0x2e5fc4[_0xda88('0x51')]['id']}})[_0xda88('0x1f')](handleEntityNotFound(_0x4e154c,null))['then'](removeEntity(_0x4e154c,null))[_0xda88('0x28')](handleError(_0x4e154c,null));};exports[_0xda88('0x57')]=function(_0x15f4ce,_0x2a0ff2,_0x4b24f6){var _0x5c3af3={};var _0x196615={};var _0x2cd8fd;var _0x308bf0;return db['VtigerConfiguration'][_0xda88('0x58')]({'where':{'id':_0x15f4ce['params']['id']}})[_0xda88('0x1f')](handleEntityNotFound(_0x2a0ff2,null))[_0xda88('0x1f')](function(_0x2fab1c){if(_0x2fab1c){_0x2cd8fd=_0x2fab1c;_0x196615[_0xda88('0x3c')]=_[_0xda88('0x52')](db['VtigerField']['rawAttributes']);_0x196615[_0xda88('0x3d')]=_['keys'](_0x15f4ce[_0xda88('0x3d')]);_0x196615[_0xda88('0x3e')]=_['intersection'](_0x196615[_0xda88('0x3c')],_0x196615[_0xda88('0x3d')]);_0x5c3af3[_0xda88('0x40')]=_[_0xda88('0x3f')](_0x196615[_0xda88('0x3c')],qs[_0xda88('0x41')](_0x15f4ce[_0xda88('0x3d')][_0xda88('0x41')]));_0x5c3af3[_0xda88('0x40')]=_0x5c3af3[_0xda88('0x40')][_0xda88('0x53')]?_0x5c3af3[_0xda88('0x40')]:_0x196615[_0xda88('0x3c')];_0x5c3af3[_0xda88('0x44')]=qs[_0xda88('0x45')](_0x15f4ce[_0xda88('0x3d')][_0xda88('0x45')]);_0x5c3af3['where']=qs[_0xda88('0x3e')](_[_0xda88('0x47')](_0x15f4ce[_0xda88('0x3d')],_0x196615[_0xda88('0x3e')]));if(_0x15f4ce['query'][_0xda88('0x48')]){_0x5c3af3['where']=_[_0xda88('0x49')](_0x5c3af3['where'],{'$or':_[_0xda88('0x38')](_0x5c3af3[_0xda88('0x40')],function(_0x10ec84){var _0xc3e013={};_0xc3e013[_0x10ec84]={'$like':'%'+_0x15f4ce[_0xda88('0x3d')][_0xda88('0x48')]+'%'};return _0xc3e013;})});}_0x5c3af3=_[_0xda88('0x49')]({},_0x5c3af3,_0x15f4ce['options']);return _0x2cd8fd['getFields'](_0x5c3af3);}})[_0xda88('0x1f')](function(_0x47a591){if(_0x47a591){_0x308bf0=_0x47a591[_0xda88('0x53')];if(!_0x15f4ce[_0xda88('0x3d')][_0xda88('0x42')](_0xda88('0x43'))){_0x5c3af3['limit']=qs[_0xda88('0x2e')](_0x15f4ce[_0xda88('0x3d')][_0xda88('0x2e')]);_0x5c3af3[_0xda88('0x2d')]=qs[_0xda88('0x2d')](_0x15f4ce['query']['offset']);}return _0x2cd8fd[_0xda88('0x57')](_0x5c3af3);}})[_0xda88('0x1f')](function(_0x23665a){if(_0x23665a){return _0x23665a?{'count':_0x308bf0,'rows':_0x23665a}:null;}})[_0xda88('0x1f')](respondWithResult(_0x2a0ff2,null))[_0xda88('0x28')](handleError(_0x2a0ff2,null));};exports['getSubjects']=function(_0x2cb94c,_0x674cff,_0x49b5d2){var _0x3a6c65={};var _0x55e44f={};var _0x35e96a;var _0x32739f;return db[_0xda88('0x39')][_0xda88('0x58')]({'where':{'id':_0x2cb94c['params']['id']}})[_0xda88('0x1f')](handleEntityNotFound(_0x674cff,null))['then'](function(_0x595859){if(_0x595859){_0x35e96a=_0x595859;_0x55e44f[_0xda88('0x3c')]=_[_0xda88('0x52')](db[_0xda88('0x59')][_0xda88('0x3a')]);_0x55e44f[_0xda88('0x3d')]=_[_0xda88('0x52')](_0x2cb94c['query']);_0x55e44f[_0xda88('0x3e')]=_[_0xda88('0x3f')](_0x55e44f['model'],_0x55e44f[_0xda88('0x3d')]);_0x3a6c65['attributes']=_[_0xda88('0x3f')](_0x55e44f[_0xda88('0x3c')],qs[_0xda88('0x41')](_0x2cb94c[_0xda88('0x3d')][_0xda88('0x41')]));_0x3a6c65[_0xda88('0x40')]=_0x3a6c65[_0xda88('0x40')][_0xda88('0x53')]?_0x3a6c65['attributes']:_0x55e44f[_0xda88('0x3c')];_0x3a6c65[_0xda88('0x44')]=qs['sort'](_0x2cb94c['query'][_0xda88('0x45')]);_0x3a6c65[_0xda88('0x46')]=qs['filters'](_[_0xda88('0x47')](_0x2cb94c['query'],_0x55e44f[_0xda88('0x3e')]));if(_0x2cb94c[_0xda88('0x3d')][_0xda88('0x48')]){_0x3a6c65[_0xda88('0x46')]=_[_0xda88('0x49')](_0x3a6c65[_0xda88('0x46')],{'$or':_[_0xda88('0x38')](_0x3a6c65[_0xda88('0x40')],function(_0x479c4a){var _0x2d5792={};_0x2d5792[_0x479c4a]={'$like':'%'+_0x2cb94c[_0xda88('0x3d')][_0xda88('0x48')]+'%'};return _0x2d5792;})});}_0x3a6c65=_[_0xda88('0x49')]({},_0x3a6c65,_0x2cb94c[_0xda88('0x4b')]);return _0x35e96a[_0xda88('0x5a')](_0x3a6c65);}})[_0xda88('0x1f')](function(_0x192e34){if(_0x192e34){_0x32739f=_0x192e34['length'];if(!_0x2cb94c[_0xda88('0x3d')]['hasOwnProperty'](_0xda88('0x43'))){_0x3a6c65[_0xda88('0x2e')]=qs[_0xda88('0x2e')](_0x2cb94c[_0xda88('0x3d')][_0xda88('0x2e')]);_0x3a6c65['offset']=qs[_0xda88('0x2d')](_0x2cb94c[_0xda88('0x3d')][_0xda88('0x2d')]);}return _0x35e96a[_0xda88('0x5a')](_0x3a6c65);}})[_0xda88('0x1f')](function(_0x49c4cb){if(_0x49c4cb){return _0x49c4cb?{'count':_0x32739f,'rows':_0x49c4cb}:null;}})[_0xda88('0x1f')](respondWithResult(_0x674cff,null))[_0xda88('0x28')](handleError(_0x674cff,null));};exports[_0xda88('0x5b')]=function(_0x5baf40,_0x11554d,_0x5e7815){var _0x2c6c45={};var _0xd36d54={};var _0x4fda6e;var _0x515f4d;return db['VtigerConfiguration'][_0xda88('0x58')]({'where':{'id':_0x5baf40[_0xda88('0x51')]['id']}})['then'](handleEntityNotFound(_0x11554d,null))[_0xda88('0x1f')](function(_0x14884b){if(_0x14884b){_0x4fda6e=_0x14884b;_0xd36d54[_0xda88('0x3c')]=_[_0xda88('0x52')](db[_0xda88('0x59')][_0xda88('0x3a')]);_0xd36d54[_0xda88('0x3d')]=_['keys'](_0x5baf40[_0xda88('0x3d')]);_0xd36d54[_0xda88('0x3e')]=_[_0xda88('0x3f')](_0xd36d54[_0xda88('0x3c')],_0xd36d54[_0xda88('0x3d')]);_0x2c6c45['attributes']=_[_0xda88('0x3f')](_0xd36d54[_0xda88('0x3c')],qs[_0xda88('0x41')](_0x5baf40[_0xda88('0x3d')][_0xda88('0x41')]));_0x2c6c45[_0xda88('0x40')]=_0x2c6c45['attributes'][_0xda88('0x53')]?_0x2c6c45[_0xda88('0x40')]:_0xd36d54[_0xda88('0x3c')];_0x2c6c45['order']=qs[_0xda88('0x45')](_0x5baf40['query']['sort']);_0x2c6c45[_0xda88('0x46')]=qs['filters'](_[_0xda88('0x47')](_0x5baf40['query'],_0xd36d54[_0xda88('0x3e')]));if(_0x5baf40[_0xda88('0x3d')][_0xda88('0x48')]){_0x2c6c45[_0xda88('0x46')]=_['merge'](_0x2c6c45[_0xda88('0x46')],{'$or':_['map'](_0x2c6c45[_0xda88('0x40')],function(_0x563f4d){var _0x1e45b3={};_0x1e45b3[_0x563f4d]={'$like':'%'+_0x5baf40['query'][_0xda88('0x48')]+'%'};return _0x1e45b3;})});}_0x2c6c45=_[_0xda88('0x49')]({},_0x2c6c45,_0x5baf40[_0xda88('0x4b')]);return _0x4fda6e[_0xda88('0x5b')](_0x2c6c45);}})['then'](function(_0xe0d62c){if(_0xe0d62c){_0x515f4d=_0xe0d62c[_0xda88('0x53')];if(!_0x5baf40[_0xda88('0x3d')][_0xda88('0x42')](_0xda88('0x43'))){_0x2c6c45[_0xda88('0x2e')]=qs[_0xda88('0x2e')](_0x5baf40[_0xda88('0x3d')]['limit']);_0x2c6c45[_0xda88('0x2d')]=qs[_0xda88('0x2d')](_0x5baf40[_0xda88('0x3d')][_0xda88('0x2d')]);}return _0x4fda6e['getDescriptions'](_0x2c6c45);}})[_0xda88('0x1f')](function(_0x3087f2){if(_0x3087f2){return _0x3087f2?{'count':_0x515f4d,'rows':_0x3087f2}:null;}})['then'](respondWithResult(_0x11554d,null))[_0xda88('0x28')](handleError(_0x11554d,null));}; \ No newline at end of file +var _0xc92f=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','filter','options','VtigerConfiguration','includeAll','include','findAll','rows','find','create','body','params','getFields','findOne','getSubjects','VtigerField','getDescriptions','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','info','result','catch','sendStatus','status','count','offset','set','apply','reject','save','update','destroy','end','name','send','map'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xc92f,0x1e1));var _0xfc92=function(_0x21e609,_0x4f3962){_0x21e609=_0x21e609-0x0;var _0x179b00=_0xc92f[_0x21e609];return _0x179b00;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfc92('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfc92('0x1'));var moment=require(_0xfc92('0x2'));var BPromise=require(_0xfc92('0x3'));var Mustache=require(_0xfc92('0x4'));var util=require(_0xfc92('0x5'));var path=require('path');var sox=require(_0xfc92('0x6'));var csv=require(_0xfc92('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfc92('0x8'));var squel=require(_0xfc92('0x9'));var crypto=require(_0xfc92('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfc92('0xb'));var toCsv=require(_0xfc92('0x7'));var querystring=require(_0xfc92('0xc'));var Papa=require(_0xfc92('0xd'));var Redis=require('ioredis');var authService=require(_0xfc92('0xe'));var qs=require(_0xfc92('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc92('0x10'));var logger=require('../../config/logger')(_0xfc92('0x11'));var utils=require('../../config/utils');var config=require(_0xfc92('0x12'));var db=require(_0xfc92('0x13'))['db'];var jayson=require(_0xfc92('0x14'));var client=jayson['client'][_0xfc92('0x15')]({'port':0x232a});function checkPasswordPattern(_0xf0c6df,_0x37715f,_0x7567d1){if(_0x7567d1){var _0x13fe21=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13fe21[_0xfc92('0x16')](_0x37715f)){return _0xf0c6df;}else{throw new db[(_0xfc92('0x17'))][(_0xfc92('0x18'))](_0xfc92('0x19'));}}else{return _0xf0c6df;}}function respondWithRpcPromise(_0x1eae39,_0x20232c,_0x14fbf0,_0x224f81){return new BPromise(function(_0x5d8e1b,_0x14e150){var _0x5a9646=_0x224f81||client;return _0x5a9646[_0xfc92('0x1a')](_0x1eae39,_0x14fbf0)[_0xfc92('0x1b')](function(_0x2a00dd){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x20232c,'request\x20sent');logger[_0xfc92('0x1c')](_0xfc92('0x1d'),_0x20232c,_0xfc92('0x1e'),JSON[_0xfc92('0x1f')](_0x2a00dd));if(_0x2a00dd[_0xfc92('0x20')]){if(_0x2a00dd['error'][_0xfc92('0x21')]===0x1f4){logger[_0xfc92('0x20')]('VtigerConfiguration,\x20%s,\x20%s',_0x20232c,_0x2a00dd[_0xfc92('0x20')][_0xfc92('0x22')]);return _0x14e150(_0x2a00dd['error'][_0xfc92('0x22')]);}logger[_0xfc92('0x20')](_0xfc92('0x23'),_0x20232c,_0x2a00dd['error'][_0xfc92('0x22')]);return _0x5d8e1b(_0x2a00dd[_0xfc92('0x20')]['message']);}else{logger[_0xfc92('0x24')](_0xfc92('0x23'),_0x20232c,'request\x20sent');_0x5d8e1b(_0x2a00dd[_0xfc92('0x25')][_0xfc92('0x22')]);}})[_0xfc92('0x26')](function(_0x1c6f7f){logger[_0xfc92('0x20')](_0xfc92('0x23'),_0x20232c,_0x1c6f7f);_0x14e150(_0x1c6f7f);});});}function respondWithStatusCode(_0x4d2b98,_0x35d674){_0x35d674=_0x35d674||0xcc;return function(_0x377584){if(_0x377584){return _0x4d2b98[_0xfc92('0x27')](_0x35d674);}return _0x4d2b98[_0xfc92('0x28')](_0x35d674)['end']();};}function respondWithResult(_0x1f2851,_0x342cf6){_0x342cf6=_0x342cf6||0xc8;return function(_0x51c9c9){if(_0x51c9c9){return _0x1f2851[_0xfc92('0x28')](_0x342cf6)['json'](_0x51c9c9);}};}function respondWithFilteredResult(_0x1f2682,_0x4e5654){return function(_0x3f06c8){if(_0x3f06c8){var _0x24ad25=_0x3f06c8[_0xfc92('0x29')],_0x219cdc=_0x4e5654[_0xfc92('0x2a')],_0x5dabbb=_0x4e5654[_0xfc92('0x2a')]+_0x4e5654['limit'],_0x5692d2;if(_0x5dabbb>=_0x24ad25){_0x5dabbb=_0x24ad25;_0x5692d2=0xc8;}else{_0x5692d2=0xce;}_0x1f2682[_0xfc92('0x28')](_0x5692d2);return _0x1f2682[_0xfc92('0x2b')]('Content-Range',_0x219cdc+'-'+_0x5dabbb+'/'+_0x24ad25)['json'](_0x3f06c8);}return null;};}function patchUpdates(_0x5aa12d){return function(_0x2f3750){try{jsonpatch[_0xfc92('0x2c')](_0x2f3750,_0x5aa12d,!![]);}catch(_0x4ecc9f){return BPromise[_0xfc92('0x2d')](_0x4ecc9f);}return _0x2f3750[_0xfc92('0x2e')]();};}function saveUpdates(_0xf71bcc,_0x558a99){return function(_0xe16e97){if(_0xe16e97){return _0xe16e97[_0xfc92('0x2f')](_0xf71bcc)[_0xfc92('0x1b')](function(_0x95509b){return _0x95509b;});}return null;};}function removeEntity(_0x524830,_0xb089dd){return function(_0x4fec77){if(_0x4fec77){return _0x4fec77[_0xfc92('0x30')]()[_0xfc92('0x1b')](function(){_0x524830[_0xfc92('0x28')](0xcc)[_0xfc92('0x31')]();});}};}function handleEntityNotFound(_0x3b6a14,_0x55f8e2){return function(_0x46a7ff){if(!_0x46a7ff){_0x3b6a14[_0xfc92('0x27')](0x194);}return _0x46a7ff;};}function handleError(_0x2acb7a,_0x59007f){_0x59007f=_0x59007f||0x1f4;return function(_0xaffd26){logger['error'](_0xaffd26['stack']);if(_0xaffd26[_0xfc92('0x32')]){delete _0xaffd26[_0xfc92('0x32')];}_0x2acb7a[_0xfc92('0x28')](_0x59007f)[_0xfc92('0x33')](_0xaffd26);};}exports['index']=function(_0x34d678,_0x23c143){var _0x48ec89={},_0x3bc6f3={},_0x14b7e0={'count':0x0,'rows':[]};var _0x2a0c47=_[_0xfc92('0x34')](db['VtigerConfiguration'][_0xfc92('0x35')],function(_0x582f3b){return{'name':_0x582f3b[_0xfc92('0x36')],'type':_0x582f3b[_0xfc92('0x37')][_0xfc92('0x38')]};});_0x3bc6f3[_0xfc92('0x39')]=_[_0xfc92('0x34')](_0x2a0c47,_0xfc92('0x32'));_0x3bc6f3[_0xfc92('0x3a')]=_[_0xfc92('0x3b')](_0x34d678[_0xfc92('0x3a')]);_0x3bc6f3[_0xfc92('0x3c')]=_[_0xfc92('0x3d')](_0x3bc6f3[_0xfc92('0x39')],_0x3bc6f3[_0xfc92('0x3a')]);_0x48ec89[_0xfc92('0x3e')]=_['intersection'](_0x3bc6f3[_0xfc92('0x39')],qs[_0xfc92('0x3f')](_0x34d678[_0xfc92('0x3a')][_0xfc92('0x3f')]));_0x48ec89[_0xfc92('0x3e')]=_0x48ec89[_0xfc92('0x3e')][_0xfc92('0x40')]?_0x48ec89['attributes']:_0x3bc6f3[_0xfc92('0x39')];if(!_0x34d678['query'][_0xfc92('0x41')](_0xfc92('0x42'))){_0x48ec89[_0xfc92('0x43')]=qs[_0xfc92('0x43')](_0x34d678[_0xfc92('0x3a')][_0xfc92('0x43')]);_0x48ec89[_0xfc92('0x2a')]=qs['offset'](_0x34d678[_0xfc92('0x3a')][_0xfc92('0x2a')]);}_0x48ec89[_0xfc92('0x44')]=qs[_0xfc92('0x45')](_0x34d678[_0xfc92('0x3a')][_0xfc92('0x45')]);_0x48ec89['where']=qs[_0xfc92('0x3c')](_[_0xfc92('0x46')](_0x34d678[_0xfc92('0x3a')],_0x3bc6f3[_0xfc92('0x3c')]));if(_0x34d678[_0xfc92('0x3a')]['filter']){_0x48ec89[_0xfc92('0x47')]=_[_0xfc92('0x48')](_0x48ec89['where'],{'$or':_[_0xfc92('0x34')](_0x2a0c47,function(_0x2a72ee){if(_0x2a72ee[_0xfc92('0x37')]!=='VIRTUAL'){var _0x235e3e={};_0x235e3e[_0x2a72ee['name']]={'$like':'%'+_0x34d678[_0xfc92('0x3a')][_0xfc92('0x49')]+'%'};return _0x235e3e;}})});}_0x48ec89=_[_0xfc92('0x48')]({},_0x48ec89,_0x34d678[_0xfc92('0x4a')]);var _0x504c6c={'where':_0x48ec89[_0xfc92('0x47')]};return db[_0xfc92('0x4b')][_0xfc92('0x29')](_0x504c6c)[_0xfc92('0x1b')](function(_0x24196e){_0x14b7e0[_0xfc92('0x29')]=_0x24196e;if(_0x34d678[_0xfc92('0x3a')][_0xfc92('0x4c')]){_0x48ec89[_0xfc92('0x4d')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xfc92('0x4e')](_0x48ec89);})[_0xfc92('0x1b')](function(_0x12f067){_0x14b7e0[_0xfc92('0x4f')]=_0x12f067;return _0x14b7e0;})[_0xfc92('0x1b')](respondWithFilteredResult(_0x23c143,_0x48ec89))[_0xfc92('0x26')](handleError(_0x23c143,null));};exports['show']=function(_0x396272,_0x43c779){var _0x189e21={'raw':![],'where':{'id':_0x396272['params']['id']}},_0x2f9d08={};_0x2f9d08[_0xfc92('0x39')]=_['keys'](db[_0xfc92('0x4b')][_0xfc92('0x35')]);_0x2f9d08[_0xfc92('0x3a')]=_[_0xfc92('0x3b')](_0x396272[_0xfc92('0x3a')]);_0x2f9d08[_0xfc92('0x3c')]=_[_0xfc92('0x3d')](_0x2f9d08[_0xfc92('0x39')],_0x2f9d08[_0xfc92('0x3a')]);_0x189e21[_0xfc92('0x3e')]=_[_0xfc92('0x3d')](_0x2f9d08[_0xfc92('0x39')],qs['fields'](_0x396272[_0xfc92('0x3a')]['fields']));_0x189e21[_0xfc92('0x3e')]=_0x189e21[_0xfc92('0x3e')][_0xfc92('0x40')]?_0x189e21[_0xfc92('0x3e')]:_0x2f9d08[_0xfc92('0x39')];if(_0x396272[_0xfc92('0x3a')][_0xfc92('0x4c')]){_0x189e21[_0xfc92('0x4d')]=[{'all':!![]}];}_0x189e21=_['merge']({},_0x189e21,_0x396272[_0xfc92('0x4a')]);return db[_0xfc92('0x4b')][_0xfc92('0x50')](_0x189e21)[_0xfc92('0x1b')](handleEntityNotFound(_0x43c779,null))[_0xfc92('0x1b')](respondWithResult(_0x43c779,null))[_0xfc92('0x26')](handleError(_0x43c779,null));};exports[_0xfc92('0x51')]=function(_0x32e321,_0x2e0069){return db['VtigerConfiguration'][_0xfc92('0x51')](_0x32e321[_0xfc92('0x52')],{})[_0xfc92('0x1b')](respondWithResult(_0x2e0069,0xc9))[_0xfc92('0x26')](handleError(_0x2e0069,null));};exports['update']=function(_0xe827da,_0x322176){if(_0xe827da[_0xfc92('0x52')]['id']){delete _0xe827da[_0xfc92('0x52')]['id'];}return db['VtigerConfiguration'][_0xfc92('0x50')]({'where':{'id':_0xe827da[_0xfc92('0x53')]['id']}})[_0xfc92('0x1b')](handleEntityNotFound(_0x322176,null))[_0xfc92('0x1b')](saveUpdates(_0xe827da['body'],null))['then'](respondWithResult(_0x322176,null))[_0xfc92('0x26')](handleError(_0x322176,null));};exports[_0xfc92('0x30')]=function(_0x3bf05b,_0x5c9d1d){return db[_0xfc92('0x4b')][_0xfc92('0x50')]({'where':{'id':_0x3bf05b[_0xfc92('0x53')]['id']}})['then'](handleEntityNotFound(_0x5c9d1d,null))[_0xfc92('0x1b')](removeEntity(_0x5c9d1d,null))[_0xfc92('0x26')](handleError(_0x5c9d1d,null));};exports[_0xfc92('0x54')]=function(_0x4ae774,_0x27478e,_0x38ed0f){var _0x3a73cd={};var _0x2a2a3b={};var _0x2a74a2;var _0x551e5d;return db[_0xfc92('0x4b')][_0xfc92('0x55')]({'where':{'id':_0x4ae774[_0xfc92('0x53')]['id']}})[_0xfc92('0x1b')](handleEntityNotFound(_0x27478e,null))[_0xfc92('0x1b')](function(_0x492dc8){if(_0x492dc8){_0x2a74a2=_0x492dc8;_0x2a2a3b[_0xfc92('0x39')]=_[_0xfc92('0x3b')](db['VtigerField'][_0xfc92('0x35')]);_0x2a2a3b[_0xfc92('0x3a')]=_[_0xfc92('0x3b')](_0x4ae774[_0xfc92('0x3a')]);_0x2a2a3b['filters']=_['intersection'](_0x2a2a3b[_0xfc92('0x39')],_0x2a2a3b[_0xfc92('0x3a')]);_0x3a73cd[_0xfc92('0x3e')]=_['intersection'](_0x2a2a3b[_0xfc92('0x39')],qs[_0xfc92('0x3f')](_0x4ae774[_0xfc92('0x3a')][_0xfc92('0x3f')]));_0x3a73cd[_0xfc92('0x3e')]=_0x3a73cd[_0xfc92('0x3e')][_0xfc92('0x40')]?_0x3a73cd[_0xfc92('0x3e')]:_0x2a2a3b[_0xfc92('0x39')];_0x3a73cd['order']=qs['sort'](_0x4ae774[_0xfc92('0x3a')][_0xfc92('0x45')]);_0x3a73cd['where']=qs['filters'](_[_0xfc92('0x46')](_0x4ae774[_0xfc92('0x3a')],_0x2a2a3b[_0xfc92('0x3c')]));if(_0x4ae774[_0xfc92('0x3a')]['filter']){_0x3a73cd[_0xfc92('0x47')]=_[_0xfc92('0x48')](_0x3a73cd['where'],{'$or':_[_0xfc92('0x34')](_0x3a73cd[_0xfc92('0x3e')],function(_0x25dc17){var _0x241500={};_0x241500[_0x25dc17]={'$like':'%'+_0x4ae774[_0xfc92('0x3a')]['filter']+'%'};return _0x241500;})});}_0x3a73cd=_['merge']({},_0x3a73cd,_0x4ae774[_0xfc92('0x4a')]);return _0x2a74a2[_0xfc92('0x54')](_0x3a73cd);}})[_0xfc92('0x1b')](function(_0x131f8a){if(_0x131f8a){_0x551e5d=_0x131f8a[_0xfc92('0x40')];if(!_0x4ae774[_0xfc92('0x3a')][_0xfc92('0x41')](_0xfc92('0x42'))){_0x3a73cd[_0xfc92('0x43')]=qs[_0xfc92('0x43')](_0x4ae774[_0xfc92('0x3a')][_0xfc92('0x43')]);_0x3a73cd[_0xfc92('0x2a')]=qs[_0xfc92('0x2a')](_0x4ae774['query'][_0xfc92('0x2a')]);}return _0x2a74a2['getFields'](_0x3a73cd);}})['then'](function(_0x2aaa36){if(_0x2aaa36){return _0x2aaa36?{'count':_0x551e5d,'rows':_0x2aaa36}:null;}})[_0xfc92('0x1b')](respondWithResult(_0x27478e,null))[_0xfc92('0x26')](handleError(_0x27478e,null));};exports[_0xfc92('0x56')]=function(_0x34b527,_0x5dd382,_0x582ece){var _0x3dc5c5={};var _0x130202={};var _0x587d69;var _0x2b7061;return db[_0xfc92('0x4b')][_0xfc92('0x55')]({'where':{'id':_0x34b527[_0xfc92('0x53')]['id']}})['then'](handleEntityNotFound(_0x5dd382,null))['then'](function(_0x35d180){if(_0x35d180){_0x587d69=_0x35d180;_0x130202['model']=_[_0xfc92('0x3b')](db[_0xfc92('0x57')][_0xfc92('0x35')]);_0x130202[_0xfc92('0x3a')]=_[_0xfc92('0x3b')](_0x34b527['query']);_0x130202[_0xfc92('0x3c')]=_[_0xfc92('0x3d')](_0x130202[_0xfc92('0x39')],_0x130202[_0xfc92('0x3a')]);_0x3dc5c5[_0xfc92('0x3e')]=_['intersection'](_0x130202[_0xfc92('0x39')],qs[_0xfc92('0x3f')](_0x34b527['query'][_0xfc92('0x3f')]));_0x3dc5c5['attributes']=_0x3dc5c5[_0xfc92('0x3e')][_0xfc92('0x40')]?_0x3dc5c5[_0xfc92('0x3e')]:_0x130202[_0xfc92('0x39')];_0x3dc5c5[_0xfc92('0x44')]=qs[_0xfc92('0x45')](_0x34b527[_0xfc92('0x3a')][_0xfc92('0x45')]);_0x3dc5c5[_0xfc92('0x47')]=qs[_0xfc92('0x3c')](_[_0xfc92('0x46')](_0x34b527[_0xfc92('0x3a')],_0x130202[_0xfc92('0x3c')]));if(_0x34b527['query'][_0xfc92('0x49')]){_0x3dc5c5[_0xfc92('0x47')]=_[_0xfc92('0x48')](_0x3dc5c5[_0xfc92('0x47')],{'$or':_['map'](_0x3dc5c5['attributes'],function(_0x2805b7){var _0x5d3cca={};_0x5d3cca[_0x2805b7]={'$like':'%'+_0x34b527['query'][_0xfc92('0x49')]+'%'};return _0x5d3cca;})});}_0x3dc5c5=_[_0xfc92('0x48')]({},_0x3dc5c5,_0x34b527[_0xfc92('0x4a')]);return _0x587d69[_0xfc92('0x56')](_0x3dc5c5);}})[_0xfc92('0x1b')](function(_0x12e283){if(_0x12e283){_0x2b7061=_0x12e283[_0xfc92('0x40')];if(!_0x34b527['query']['hasOwnProperty'](_0xfc92('0x42'))){_0x3dc5c5[_0xfc92('0x43')]=qs[_0xfc92('0x43')](_0x34b527[_0xfc92('0x3a')][_0xfc92('0x43')]);_0x3dc5c5[_0xfc92('0x2a')]=qs['offset'](_0x34b527['query']['offset']);}return _0x587d69[_0xfc92('0x56')](_0x3dc5c5);}})['then'](function(_0x117d26){if(_0x117d26){return _0x117d26?{'count':_0x2b7061,'rows':_0x117d26}:null;}})[_0xfc92('0x1b')](respondWithResult(_0x5dd382,null))[_0xfc92('0x26')](handleError(_0x5dd382,null));};exports[_0xfc92('0x58')]=function(_0x186bf3,_0x2633d7,_0x4d7863){var _0x3a7ba0={};var _0x44739e={};var _0x3894a0;var _0x35b12f;return db['VtigerConfiguration'][_0xfc92('0x55')]({'where':{'id':_0x186bf3['params']['id']}})[_0xfc92('0x1b')](handleEntityNotFound(_0x2633d7,null))[_0xfc92('0x1b')](function(_0x1d1cca){if(_0x1d1cca){_0x3894a0=_0x1d1cca;_0x44739e['model']=_[_0xfc92('0x3b')](db[_0xfc92('0x57')]['rawAttributes']);_0x44739e['query']=_[_0xfc92('0x3b')](_0x186bf3['query']);_0x44739e[_0xfc92('0x3c')]=_[_0xfc92('0x3d')](_0x44739e['model'],_0x44739e[_0xfc92('0x3a')]);_0x3a7ba0[_0xfc92('0x3e')]=_['intersection'](_0x44739e[_0xfc92('0x39')],qs['fields'](_0x186bf3[_0xfc92('0x3a')][_0xfc92('0x3f')]));_0x3a7ba0[_0xfc92('0x3e')]=_0x3a7ba0[_0xfc92('0x3e')][_0xfc92('0x40')]?_0x3a7ba0[_0xfc92('0x3e')]:_0x44739e['model'];_0x3a7ba0[_0xfc92('0x44')]=qs[_0xfc92('0x45')](_0x186bf3[_0xfc92('0x3a')][_0xfc92('0x45')]);_0x3a7ba0[_0xfc92('0x47')]=qs['filters'](_[_0xfc92('0x46')](_0x186bf3[_0xfc92('0x3a')],_0x44739e[_0xfc92('0x3c')]));if(_0x186bf3[_0xfc92('0x3a')][_0xfc92('0x49')]){_0x3a7ba0[_0xfc92('0x47')]=_[_0xfc92('0x48')](_0x3a7ba0[_0xfc92('0x47')],{'$or':_[_0xfc92('0x34')](_0x3a7ba0[_0xfc92('0x3e')],function(_0x11be1c){var _0x209c8f={};_0x209c8f[_0x11be1c]={'$like':'%'+_0x186bf3[_0xfc92('0x3a')][_0xfc92('0x49')]+'%'};return _0x209c8f;})});}_0x3a7ba0=_[_0xfc92('0x48')]({},_0x3a7ba0,_0x186bf3[_0xfc92('0x4a')]);return _0x3894a0['getDescriptions'](_0x3a7ba0);}})['then'](function(_0x597753){if(_0x597753){_0x35b12f=_0x597753[_0xfc92('0x40')];if(!_0x186bf3[_0xfc92('0x3a')][_0xfc92('0x41')](_0xfc92('0x42'))){_0x3a7ba0[_0xfc92('0x43')]=qs[_0xfc92('0x43')](_0x186bf3[_0xfc92('0x3a')][_0xfc92('0x43')]);_0x3a7ba0[_0xfc92('0x2a')]=qs['offset'](_0x186bf3[_0xfc92('0x3a')]['offset']);}return _0x3894a0[_0xfc92('0x58')](_0x3a7ba0);}})[_0xfc92('0x1b')](function(_0x252dee){if(_0x252dee){return _0x252dee?{'count':_0x35b12f,'rows':_0x252dee}:null;}})[_0xfc92('0x1b')](respondWithResult(_0x2633d7,null))[_0xfc92('0x26')](handleError(_0x2633d7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index c4a88fe..52ecd92 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1506=['path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1506,0x130));var _0x6150=function(_0x50d02d,_0x4c0ae5){_0x50d02d=_0x50d02d-0x0;var _0x2f45d5=_0x1506[_0x50d02d];return _0x2f45d5;};'use strict';var _=require(_0x6150('0x0'));var util=require(_0x6150('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6150('0x2'));var BPromise=require('bluebird');var rp=require(_0x6150('0x3'));var fs=require('fs');var path=require(_0x6150('0x4'));var rimraf=require(_0x6150('0x5'));var config=require('../../config/environment');var attributes=require(_0x6150('0x6'));module[_0x6150('0x7')]=function(_0x2126d6,_0x14ad5d){return _0x2126d6[_0x6150('0x8')](_0x6150('0x9'),attributes,{'tableName':_0x6150('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcca0=['define','int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2027f5,_0x5a68c1){var _0x346d21=function(_0x28735c){while(--_0x28735c){_0x2027f5['push'](_0x2027f5['shift']());}};_0x346d21(++_0x5a68c1);}(_0xcca0,0xf2));var _0x0cca=function(_0x4d316c,_0xfee14d){_0x4d316c=_0x4d316c-0x0;var _0x59a7a0=_0xcca0[_0x4d316c];return _0x59a7a0;};'use strict';var _=require(_0x0cca('0x0'));var util=require(_0x0cca('0x1'));var logger=require('../../config/logger')(_0x0cca('0x2'));var moment=require(_0x0cca('0x3'));var BPromise=require(_0x0cca('0x4'));var rp=require(_0x0cca('0x5'));var fs=require('fs');var path=require(_0x0cca('0x6'));var rimraf=require(_0x0cca('0x7'));var config=require(_0x0cca('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x0cca('0x9')]=function(_0x29aa76,_0x642dd4){return _0x29aa76[_0x0cca('0xa')]('VtigerConfiguration',attributes,{'tableName':_0x0cca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 885f6da..df97cdf 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fb1=['error','code','message','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5fb1,0x1cf));var _0x15fb=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0x5fb1[_0x483ab9];return _0x35043b;};'use strict';var _=require(_0x15fb('0x0'));var util=require(_0x15fb('0x1'));var moment=require(_0x15fb('0x2'));var BPromise=require(_0x15fb('0x3'));var rs=require(_0x15fb('0x4'));var fs=require('fs');var Redis=require(_0x15fb('0x5'));var db=require(_0x15fb('0x6'))['db'];var utils=require(_0x15fb('0x7'));var logger=require('../../config/logger')(_0x15fb('0x8'));var config=require(_0x15fb('0x9'));var jayson=require(_0x15fb('0xa'));var client=jayson[_0x15fb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33d7b1,_0x24e1b6,_0x11568a){return new BPromise(function(_0x46ab82,_0x5ac4e0){return client[_0x15fb('0xc')](_0x33d7b1,_0x11568a)[_0x15fb('0xd')](function(_0x5dbe77){logger[_0x15fb('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x24e1b6,'request\x20sent');logger['debug'](_0x15fb('0xf'),_0x24e1b6,'request\x20sent',JSON[_0x15fb('0x10')](_0x5dbe77));if(_0x5dbe77[_0x15fb('0x11')]){if(_0x5dbe77[_0x15fb('0x11')][_0x15fb('0x12')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x24e1b6,_0x5dbe77[_0x15fb('0x11')]['message']);return _0x5ac4e0(_0x5dbe77[_0x15fb('0x11')][_0x15fb('0x13')]);}logger['error'](_0x15fb('0x14'),_0x24e1b6,_0x5dbe77[_0x15fb('0x11')][_0x15fb('0x13')]);return _0x46ab82(_0x5dbe77['error'][_0x15fb('0x13')]);}else{logger[_0x15fb('0xe')](_0x15fb('0x14'),_0x24e1b6,_0x15fb('0x15'));_0x46ab82(_0x5dbe77[_0x15fb('0x16')]['message']);}})[_0x15fb('0x17')](function(_0x4933bd){logger[_0x15fb('0x11')](_0x15fb('0x14'),_0x24e1b6,_0x4933bd);_0x5ac4e0(_0x4933bd);});});} \ No newline at end of file +var _0xd16e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x143036,_0x2bd7df){var _0x2a89b8=function(_0x145ec9){while(--_0x145ec9){_0x143036['push'](_0x143036['shift']());}};_0x2a89b8(++_0x2bd7df);}(_0xd16e,0x1cc));var _0xed16=function(_0x245bad,_0x29fdb4){_0x245bad=_0x245bad-0x0;var _0x22f559=_0xd16e[_0x245bad];return _0x22f559;};'use strict';var _=require(_0xed16('0x0'));var util=require(_0xed16('0x1'));var moment=require(_0xed16('0x2'));var BPromise=require(_0xed16('0x3'));var rs=require(_0xed16('0x4'));var fs=require('fs');var Redis=require(_0xed16('0x5'));var db=require(_0xed16('0x6'))['db'];var utils=require(_0xed16('0x7'));var logger=require(_0xed16('0x8'))(_0xed16('0x9'));var config=require(_0xed16('0xa'));var jayson=require(_0xed16('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x416ff9,_0x35fd16,_0x1a9d65){return new BPromise(function(_0x54749e,_0x6c5a0){return client[_0xed16('0xc')](_0x416ff9,_0x1a9d65)[_0xed16('0xd')](function(_0x2ed05e){logger[_0xed16('0xe')](_0xed16('0xf'),_0x35fd16,'request\x20sent');logger['debug'](_0xed16('0x10'),_0x35fd16,_0xed16('0x11'),JSON['stringify'](_0x2ed05e));if(_0x2ed05e[_0xed16('0x12')]){if(_0x2ed05e[_0xed16('0x12')][_0xed16('0x13')]===0x1f4){logger['error'](_0xed16('0xf'),_0x35fd16,_0x2ed05e['error']['message']);return _0x6c5a0(_0x2ed05e['error'][_0xed16('0x14')]);}logger[_0xed16('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x35fd16,_0x2ed05e['error'][_0xed16('0x14')]);return _0x54749e(_0x2ed05e[_0xed16('0x12')][_0xed16('0x14')]);}else{logger[_0xed16('0xe')](_0xed16('0xf'),_0x35fd16,'request\x20sent');_0x54749e(_0x2ed05e[_0xed16('0x15')]['message']);}})[_0xed16('0x16')](function(_0x5fcbac){logger[_0xed16('0x12')](_0xed16('0xf'),_0x35fd16,_0x5fcbac);_0x6c5a0(_0x5fcbac);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index a371ee5..31c126c 100644 --- a/server/api/intVtigerField/index.js +++ b/server/api/intVtigerField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa715=['show','create','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./intVtigerField.controller','isAuthenticated','index','get','/:id'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xa715,0x1e4));var _0x5a71=function(_0x4ecd4e,_0x59c597){_0x4ecd4e=_0x4ecd4e-0x0;var _0x14c5b5=_0xa715[_0x4ecd4e];return _0x14c5b5;};'use strict';var multer=require(_0x5a71('0x0'));var util=require('util');var path=require(_0x5a71('0x1'));var timeout=require(_0x5a71('0x2'));var express=require(_0x5a71('0x3'));var router=express[_0x5a71('0x4')]();var auth=require(_0x5a71('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5a71('0x6'));router['get']('/',auth[_0x5a71('0x7')](),controller[_0x5a71('0x8')]);router[_0x5a71('0x9')](_0x5a71('0xa'),auth[_0x5a71('0x7')](),controller[_0x5a71('0xb')]);router['post']('/',auth[_0x5a71('0x7')](),controller[_0x5a71('0xc')]);router['put'](_0x5a71('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5a71('0xd')](_0x5a71('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5a71('0xe')]=router; \ No newline at end of file +var _0x5dd8=['create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','get','show','post'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x5dd8,0xeb));var _0x85dd=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5dd8[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0x85dd('0x0'));var path=require(_0x85dd('0x1'));var timeout=require(_0x85dd('0x2'));var express=require(_0x85dd('0x3'));var router=express[_0x85dd('0x4')]();var auth=require(_0x85dd('0x5'));var interaction=require(_0x85dd('0x6'));var config=require('../../config/environment');var controller=require(_0x85dd('0x7'));router['get']('/',auth[_0x85dd('0x8')](),controller['index']);router[_0x85dd('0x9')]('/:id',auth[_0x85dd('0x8')](),controller[_0x85dd('0xa')]);router[_0x85dd('0xb')]('/',auth[_0x85dd('0x8')](),controller[_0x85dd('0xc')]);router[_0x85dd('0xd')]('/:id',auth[_0x85dd('0x8')](),controller[_0x85dd('0xe')]);router[_0x85dd('0xf')](_0x85dd('0x10'),auth[_0x85dd('0x8')](),controller[_0x85dd('0x11')]);module[_0x85dd('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index dadea50..178c637 100644 --- a/server/api/intVtigerField/intVtigerField.attributes.js +++ b/server/api/intVtigerField/intVtigerField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3c6=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x56550b,_0x55a4aa){var _0x4d31c5=function(_0x4d50f1){while(--_0x4d50f1){_0x56550b['push'](_0x56550b['shift']());}};_0x4d31c5(++_0x55a4aa);}(_0xd3c6,0x121));var _0x6d3c=function(_0x5aa97e,_0x26110e){_0x5aa97e=_0x5aa97e-0x0;var _0x265585=_0xd3c6[_0x5aa97e];return _0x265585;};'use strict';var Sequelize=require(_0x6d3c('0x0'));module[_0x6d3c('0x1')]={'type':{'type':Sequelize[_0x6d3c('0x2')](_0x6d3c('0x3'),_0x6d3c('0x4'),_0x6d3c('0x5'),_0x6d3c('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6d3c('0x7')]},'key':{'type':Sequelize[_0x6d3c('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6d3c('0x3'),_0x6d3c('0x4'),_0x6d3c('0x5'))},'keyContent':{'type':Sequelize[_0x6d3c('0x7')]},'idField':{'type':Sequelize[_0x6d3c('0x7')]},'nameField':{'type':Sequelize[_0x6d3c('0x7')]},'customField':{'type':Sequelize[_0x6d3c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d3c('0x7')]}}; \ No newline at end of file +var _0x4eea=['exports','ENUM','variable','customVariable','string','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4eea,0x149));var _0xa4ee=function(_0x29c5a3,_0x30c00f){_0x29c5a3=_0x29c5a3-0x0;var _0x1e12da=_0x4eea[_0x29c5a3];return _0x1e12da;};'use strict';var Sequelize=require('sequelize');module[_0xa4ee('0x0')]={'type':{'type':Sequelize[_0xa4ee('0x1')]('string',_0xa4ee('0x2'),_0xa4ee('0x3'),'keyValue'),'defaultValue':_0xa4ee('0x4')},'content':{'type':Sequelize[_0xa4ee('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa4ee('0x1')](_0xa4ee('0x4'),_0xa4ee('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa4ee('0x5')]},'customField':{'type':Sequelize[_0xa4ee('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 39741c2..bf120fc 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb90d=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','set','Content-Range','reject','update','then','destroy','stack','name','send','VtigerField','rawAttributes','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','find','create','body','params','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1a1dea,_0x32d801){var _0x9d897c=function(_0x4e52c1){while(--_0x4e52c1){_0x1a1dea['push'](_0x1a1dea['shift']());}};_0x9d897c(++_0x32d801);}(_0xb90d,0x191));var _0xdb90=function(_0x2f88bf,_0x761a0e){_0x2f88bf=_0x2f88bf-0x0;var _0x1b451e=_0xb90d[_0x2f88bf];return _0x1b451e;};'use strict';var pdf=require(_0xdb90('0x0'));var emlformat=require(_0xdb90('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdb90('0x2'));var rp=require(_0xdb90('0x3'));var moment=require(_0xdb90('0x4'));var BPromise=require(_0xdb90('0x5'));var Mustache=require('mustache');var util=require(_0xdb90('0x6'));var path=require(_0xdb90('0x7'));var sox=require(_0xdb90('0x8'));var csv=require(_0xdb90('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdb90('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdb90('0xb'));var deskjs=require(_0xdb90('0xc'));var toCsv=require(_0xdb90('0x9'));var querystring=require('querystring');var Papa=require(_0xdb90('0xd'));var Redis=require(_0xdb90('0xe'));var authService=require(_0xdb90('0xf'));var qs=require(_0xdb90('0x10'));var as=require(_0xdb90('0x11'));var hardwareService=require(_0xdb90('0x12'));var logger=require(_0xdb90('0x13'))(_0xdb90('0x14'));var utils=require(_0xdb90('0x15'));var config=require(_0xdb90('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d375b,_0x256d00){_0x256d00=_0x256d00||0xcc;return function(_0xe669b3){if(_0xe669b3){return _0x5d375b[_0xdb90('0x17')](_0x256d00);}return _0x5d375b['status'](_0x256d00)[_0xdb90('0x18')]();};}function respondWithResult(_0x397f9f,_0x3e4b5f){_0x3e4b5f=_0x3e4b5f||0xc8;return function(_0x437079){if(_0x437079){return _0x397f9f[_0xdb90('0x19')](_0x3e4b5f)[_0xdb90('0x1a')](_0x437079);}};}function respondWithFilteredResult(_0x26e8c9,_0x13678a){return function(_0x127273){if(_0x127273){var _0x4b6f92=_0x127273[_0xdb90('0x1b')],_0x29b1e0=_0x13678a[_0xdb90('0x1c')],_0x25c59d=_0x13678a['offset']+_0x13678a['limit'],_0x366849;if(_0x25c59d>=_0x4b6f92){_0x25c59d=_0x4b6f92;_0x366849=0xc8;}else{_0x366849=0xce;}_0x26e8c9[_0xdb90('0x19')](_0x366849);return _0x26e8c9[_0xdb90('0x1d')](_0xdb90('0x1e'),_0x29b1e0+'-'+_0x25c59d+'/'+_0x4b6f92)[_0xdb90('0x1a')](_0x127273);}return null;};}function patchUpdates(_0x198af6){return function(_0x31c583){try{jsonpatch['apply'](_0x31c583,_0x198af6,!![]);}catch(_0x4911aa){return BPromise[_0xdb90('0x1f')](_0x4911aa);}return _0x31c583['save']();};}function saveUpdates(_0x4da35b,_0x2f7531){return function(_0x224157){if(_0x224157){return _0x224157[_0xdb90('0x20')](_0x4da35b)[_0xdb90('0x21')](function(_0x1aadac){return _0x1aadac;});}return null;};}function removeEntity(_0x16c196,_0x327179){return function(_0x3b069a){if(_0x3b069a){return _0x3b069a[_0xdb90('0x22')]()[_0xdb90('0x21')](function(){_0x16c196[_0xdb90('0x19')](0xcc)[_0xdb90('0x18')]();});}};}function handleEntityNotFound(_0x1d543f,_0x4b4461){return function(_0x487acd){if(!_0x487acd){_0x1d543f[_0xdb90('0x17')](0x194);}return _0x487acd;};}function handleError(_0x33c636,_0x2be4c6){_0x2be4c6=_0x2be4c6||0x1f4;return function(_0x1abde3){logger['error'](_0x1abde3[_0xdb90('0x23')]);if(_0x1abde3[_0xdb90('0x24')]){delete _0x1abde3[_0xdb90('0x24')];}_0x33c636[_0xdb90('0x19')](_0x2be4c6)[_0xdb90('0x25')](_0x1abde3);};}exports['index']=function(_0x4add6c,_0xd37fac){var _0x5787b7={},_0x185630={},_0x539f0e={'count':0x0,'rows':[]};var _0x3782b8=_['map'](db[_0xdb90('0x26')][_0xdb90('0x27')],function(_0x2fa2ba){return{'name':_0x2fa2ba['fieldName'],'type':_0x2fa2ba['type'][_0xdb90('0x28')]};});_0x185630[_0xdb90('0x29')]=_[_0xdb90('0x2a')](_0x3782b8,_0xdb90('0x24'));_0x185630['query']=_[_0xdb90('0x2b')](_0x4add6c[_0xdb90('0x2c')]);_0x185630[_0xdb90('0x2d')]=_['intersection'](_0x185630[_0xdb90('0x29')],_0x185630[_0xdb90('0x2c')]);_0x5787b7[_0xdb90('0x2e')]=_[_0xdb90('0x2f')](_0x185630[_0xdb90('0x29')],qs[_0xdb90('0x30')](_0x4add6c[_0xdb90('0x2c')][_0xdb90('0x30')]));_0x5787b7[_0xdb90('0x2e')]=_0x5787b7[_0xdb90('0x2e')][_0xdb90('0x31')]?_0x5787b7['attributes']:_0x185630[_0xdb90('0x29')];if(!_0x4add6c[_0xdb90('0x2c')][_0xdb90('0x32')](_0xdb90('0x33'))){_0x5787b7[_0xdb90('0x34')]=qs[_0xdb90('0x34')](_0x4add6c['query'][_0xdb90('0x34')]);_0x5787b7[_0xdb90('0x1c')]=qs[_0xdb90('0x1c')](_0x4add6c[_0xdb90('0x2c')][_0xdb90('0x1c')]);}_0x5787b7[_0xdb90('0x35')]=qs['sort'](_0x4add6c[_0xdb90('0x2c')][_0xdb90('0x36')]);_0x5787b7['where']=qs[_0xdb90('0x2d')](_['pick'](_0x4add6c['query'],_0x185630[_0xdb90('0x2d')]));if(_0x4add6c[_0xdb90('0x2c')]['filter']){_0x5787b7[_0xdb90('0x37')]=_[_0xdb90('0x38')](_0x5787b7[_0xdb90('0x37')],{'$or':_[_0xdb90('0x2a')](_0x3782b8,function(_0x231083){if(_0x231083[_0xdb90('0x39')]!==_0xdb90('0x3a')){var _0x3f9c57={};_0x3f9c57[_0x231083[_0xdb90('0x24')]]={'$like':'%'+_0x4add6c[_0xdb90('0x2c')][_0xdb90('0x3b')]+'%'};return _0x3f9c57;}})});}_0x5787b7=_[_0xdb90('0x38')]({},_0x5787b7,_0x4add6c[_0xdb90('0x3c')]);var _0x34d7f3={'where':_0x5787b7[_0xdb90('0x37')]};return db[_0xdb90('0x26')][_0xdb90('0x1b')](_0x34d7f3)['then'](function(_0x34beb0){_0x539f0e[_0xdb90('0x1b')]=_0x34beb0;if(_0x4add6c['query'][_0xdb90('0x3d')]){_0x5787b7[_0xdb90('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0xdb90('0x3f')](_0x5787b7);})[_0xdb90('0x21')](function(_0x28fa08){_0x539f0e['rows']=_0x28fa08;return _0x539f0e;})['then'](respondWithFilteredResult(_0xd37fac,_0x5787b7))[_0xdb90('0x40')](handleError(_0xd37fac,null));};exports[_0xdb90('0x41')]=function(_0x433c9a,_0x31b720){var _0x375838={'raw':!![],'where':{'id':_0x433c9a['params']['id']}},_0x110076={};_0x110076[_0xdb90('0x29')]=_[_0xdb90('0x2b')](db['VtigerField'][_0xdb90('0x27')]);_0x110076[_0xdb90('0x2c')]=_[_0xdb90('0x2b')](_0x433c9a[_0xdb90('0x2c')]);_0x110076[_0xdb90('0x2d')]=_['intersection'](_0x110076[_0xdb90('0x29')],_0x110076[_0xdb90('0x2c')]);_0x375838['attributes']=_['intersection'](_0x110076['model'],qs['fields'](_0x433c9a[_0xdb90('0x2c')]['fields']));_0x375838[_0xdb90('0x2e')]=_0x375838[_0xdb90('0x2e')][_0xdb90('0x31')]?_0x375838['attributes']:_0x110076[_0xdb90('0x29')];if(_0x433c9a[_0xdb90('0x2c')][_0xdb90('0x3d')]){_0x375838[_0xdb90('0x3e')]=[{'all':!![]}];}_0x375838=_['merge']({},_0x375838,_0x433c9a[_0xdb90('0x3c')]);return db['VtigerField'][_0xdb90('0x42')](_0x375838)[_0xdb90('0x21')](handleEntityNotFound(_0x31b720,null))[_0xdb90('0x21')](respondWithResult(_0x31b720,null))[_0xdb90('0x40')](handleError(_0x31b720,null));};exports[_0xdb90('0x43')]=function(_0x53c9d4,_0x331e7e){return db[_0xdb90('0x26')][_0xdb90('0x43')](_0x53c9d4[_0xdb90('0x44')],{})['then'](respondWithResult(_0x331e7e,0xc9))[_0xdb90('0x40')](handleError(_0x331e7e,null));};exports[_0xdb90('0x20')]=function(_0x2d532c,_0x34b798){if(_0x2d532c[_0xdb90('0x44')]['id']){delete _0x2d532c[_0xdb90('0x44')]['id'];}return db[_0xdb90('0x26')][_0xdb90('0x42')]({'where':{'id':_0x2d532c[_0xdb90('0x45')]['id']}})[_0xdb90('0x21')](handleEntityNotFound(_0x34b798,null))[_0xdb90('0x21')](saveUpdates(_0x2d532c[_0xdb90('0x44')],null))[_0xdb90('0x21')](respondWithResult(_0x34b798,null))['catch'](handleError(_0x34b798,null));};exports['destroy']=function(_0x408b61,_0x5d1d83){return db[_0xdb90('0x26')][_0xdb90('0x42')]({'where':{'id':_0x408b61[_0xdb90('0x45')]['id']}})[_0xdb90('0x21')](handleEntityNotFound(_0x5d1d83,null))[_0xdb90('0x21')](removeEntity(_0x5d1d83,null))['catch'](handleError(_0x5d1d83,null));}; \ No newline at end of file +var _0x868c=['error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','map','VIRTUAL','includeAll','show','keys','intersection','include','catch','update','body','find','params','html-pdf','eml-format','rimraf','zip-dir','util','path','sox','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','end'];(function(_0x550fcd,_0x1f10a9){var _0x44d725=function(_0xbe5acc){while(--_0xbe5acc){_0x550fcd['push'](_0x550fcd['shift']());}};_0x44d725(++_0x1f10a9);}(_0x868c,0xaf));var _0xc868=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x868c[_0x2074db];return _0x27324c;};'use strict';var pdf=require(_0xc868('0x0'));var emlformat=require(_0xc868('0x1'));var rimraf=require(_0xc868('0x2'));var zipdir=require(_0xc868('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc868('0x4'));var path=require(_0xc868('0x5'));var sox=require(_0xc868('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc868('0x7'));var squel=require(_0xc868('0x8'));var crypto=require(_0xc868('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc868('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc868('0xb'));var Redis=require(_0xc868('0xc'));var authService=require(_0xc868('0xd'));var qs=require(_0xc868('0xe'));var as=require(_0xc868('0xf'));var hardwareService=require(_0xc868('0x10'));var logger=require('../../config/logger')(_0xc868('0x11'));var utils=require(_0xc868('0x12'));var config=require(_0xc868('0x13'));var db=require(_0xc868('0x14'))['db'];function respondWithStatusCode(_0x1be17b,_0x3e17a4){_0x3e17a4=_0x3e17a4||0xcc;return function(_0xbbf8cc){if(_0xbbf8cc){return _0x1be17b[_0xc868('0x15')](_0x3e17a4);}return _0x1be17b[_0xc868('0x16')](_0x3e17a4)['end']();};}function respondWithResult(_0x23e0ef,_0x4ffab8){_0x4ffab8=_0x4ffab8||0xc8;return function(_0x417d38){if(_0x417d38){return _0x23e0ef[_0xc868('0x16')](_0x4ffab8)['json'](_0x417d38);}};}function respondWithFilteredResult(_0x5a9aac,_0x15373d){return function(_0x4fb31e){if(_0x4fb31e){var _0x4e7ef7=_0x4fb31e[_0xc868('0x17')],_0x4d093b=_0x15373d['offset'],_0x47e757=_0x15373d[_0xc868('0x18')]+_0x15373d[_0xc868('0x19')],_0x869077;if(_0x47e757>=_0x4e7ef7){_0x47e757=_0x4e7ef7;_0x869077=0xc8;}else{_0x869077=0xce;}_0x5a9aac[_0xc868('0x16')](_0x869077);return _0x5a9aac[_0xc868('0x1a')](_0xc868('0x1b'),_0x4d093b+'-'+_0x47e757+'/'+_0x4e7ef7)[_0xc868('0x1c')](_0x4fb31e);}return null;};}function patchUpdates(_0x3bf0cb){return function(_0x22902d){try{jsonpatch[_0xc868('0x1d')](_0x22902d,_0x3bf0cb,!![]);}catch(_0x1950f7){return BPromise[_0xc868('0x1e')](_0x1950f7);}return _0x22902d[_0xc868('0x1f')]();};}function saveUpdates(_0xb27b8d,_0x5dd664){return function(_0x572ec1){if(_0x572ec1){return _0x572ec1['update'](_0xb27b8d)['then'](function(_0x551c90){return _0x551c90;});}return null;};}function removeEntity(_0xa29870,_0x3186e8){return function(_0x13fc69){if(_0x13fc69){return _0x13fc69[_0xc868('0x20')]()[_0xc868('0x21')](function(){_0xa29870[_0xc868('0x16')](0xcc)[_0xc868('0x22')]();});}};}function handleEntityNotFound(_0x324f03,_0x13a6dd){return function(_0x2be703){if(!_0x2be703){_0x324f03[_0xc868('0x15')](0x194);}return _0x2be703;};}function handleError(_0x3b295b,_0xc3c9ac){_0xc3c9ac=_0xc3c9ac||0x1f4;return function(_0x33ae3c){logger[_0xc868('0x23')](_0x33ae3c[_0xc868('0x24')]);if(_0x33ae3c[_0xc868('0x25')]){delete _0x33ae3c[_0xc868('0x25')];}_0x3b295b[_0xc868('0x16')](_0xc3c9ac)[_0xc868('0x26')](_0x33ae3c);};}exports[_0xc868('0x27')]=function(_0x99bf1e,_0x585960){var _0x5bb430={},_0x16eee0={},_0x314b00={'count':0x0,'rows':[]};var _0x899bdc=_['map'](db[_0xc868('0x28')][_0xc868('0x29')],function(_0x202fd8){return{'name':_0x202fd8[_0xc868('0x2a')],'type':_0x202fd8[_0xc868('0x2b')][_0xc868('0x2c')]};});_0x16eee0[_0xc868('0x2d')]=_['map'](_0x899bdc,'name');_0x16eee0['query']=_['keys'](_0x99bf1e[_0xc868('0x2e')]);_0x16eee0[_0xc868('0x2f')]=_['intersection'](_0x16eee0[_0xc868('0x2d')],_0x16eee0['query']);_0x5bb430[_0xc868('0x30')]=_['intersection'](_0x16eee0[_0xc868('0x2d')],qs[_0xc868('0x31')](_0x99bf1e['query'][_0xc868('0x31')]));_0x5bb430[_0xc868('0x30')]=_0x5bb430[_0xc868('0x30')][_0xc868('0x32')]?_0x5bb430[_0xc868('0x30')]:_0x16eee0[_0xc868('0x2d')];if(!_0x99bf1e[_0xc868('0x2e')]['hasOwnProperty'](_0xc868('0x33'))){_0x5bb430[_0xc868('0x19')]=qs['limit'](_0x99bf1e[_0xc868('0x2e')][_0xc868('0x19')]);_0x5bb430[_0xc868('0x18')]=qs[_0xc868('0x18')](_0x99bf1e[_0xc868('0x2e')]['offset']);}_0x5bb430[_0xc868('0x34')]=qs['sort'](_0x99bf1e[_0xc868('0x2e')][_0xc868('0x35')]);_0x5bb430['where']=qs[_0xc868('0x2f')](_[_0xc868('0x36')](_0x99bf1e[_0xc868('0x2e')],_0x16eee0[_0xc868('0x2f')]));if(_0x99bf1e[_0xc868('0x2e')][_0xc868('0x37')]){_0x5bb430['where']=_[_0xc868('0x38')](_0x5bb430[_0xc868('0x39')],{'$or':_[_0xc868('0x3a')](_0x899bdc,function(_0x5e1168){if(_0x5e1168[_0xc868('0x2b')]!==_0xc868('0x3b')){var _0xcf2d73={};_0xcf2d73[_0x5e1168[_0xc868('0x25')]]={'$like':'%'+_0x99bf1e[_0xc868('0x2e')][_0xc868('0x37')]+'%'};return _0xcf2d73;}})});}_0x5bb430=_[_0xc868('0x38')]({},_0x5bb430,_0x99bf1e['options']);var _0x2e8f09={'where':_0x5bb430['where']};return db[_0xc868('0x28')][_0xc868('0x17')](_0x2e8f09)['then'](function(_0x10fce6){_0x314b00[_0xc868('0x17')]=_0x10fce6;if(_0x99bf1e[_0xc868('0x2e')][_0xc868('0x3c')]){_0x5bb430['include']=[{'all':!![]}];}return db[_0xc868('0x28')]['findAll'](_0x5bb430);})[_0xc868('0x21')](function(_0x358e1e){_0x314b00['rows']=_0x358e1e;return _0x314b00;})[_0xc868('0x21')](respondWithFilteredResult(_0x585960,_0x5bb430))['catch'](handleError(_0x585960,null));};exports[_0xc868('0x3d')]=function(_0x530268,_0x3012c3){var _0x56d9f3={'raw':!![],'where':{'id':_0x530268['params']['id']}},_0x44527e={};_0x44527e[_0xc868('0x2d')]=_['keys'](db[_0xc868('0x28')][_0xc868('0x29')]);_0x44527e['query']=_[_0xc868('0x3e')](_0x530268['query']);_0x44527e['filters']=_[_0xc868('0x3f')](_0x44527e[_0xc868('0x2d')],_0x44527e[_0xc868('0x2e')]);_0x56d9f3[_0xc868('0x30')]=_[_0xc868('0x3f')](_0x44527e[_0xc868('0x2d')],qs[_0xc868('0x31')](_0x530268[_0xc868('0x2e')][_0xc868('0x31')]));_0x56d9f3['attributes']=_0x56d9f3[_0xc868('0x30')][_0xc868('0x32')]?_0x56d9f3[_0xc868('0x30')]:_0x44527e[_0xc868('0x2d')];if(_0x530268['query'][_0xc868('0x3c')]){_0x56d9f3[_0xc868('0x40')]=[{'all':!![]}];}_0x56d9f3=_[_0xc868('0x38')]({},_0x56d9f3,_0x530268['options']);return db['VtigerField']['find'](_0x56d9f3)['then'](handleEntityNotFound(_0x3012c3,null))[_0xc868('0x21')](respondWithResult(_0x3012c3,null))[_0xc868('0x41')](handleError(_0x3012c3,null));};exports['create']=function(_0x223d8c,_0x3c20e7){return db[_0xc868('0x28')]['create'](_0x223d8c['body'],{})['then'](respondWithResult(_0x3c20e7,0xc9))[_0xc868('0x41')](handleError(_0x3c20e7,null));};exports[_0xc868('0x42')]=function(_0x4879b9,_0x4f77a5){if(_0x4879b9['body']['id']){delete _0x4879b9[_0xc868('0x43')]['id'];}return db[_0xc868('0x28')][_0xc868('0x44')]({'where':{'id':_0x4879b9[_0xc868('0x45')]['id']}})[_0xc868('0x21')](handleEntityNotFound(_0x4f77a5,null))[_0xc868('0x21')](saveUpdates(_0x4879b9[_0xc868('0x43')],null))[_0xc868('0x21')](respondWithResult(_0x4f77a5,null))[_0xc868('0x41')](handleError(_0x4f77a5,null));};exports[_0xc868('0x20')]=function(_0xb964c4,_0x390fae){return db[_0xc868('0x28')][_0xc868('0x44')]({'where':{'id':_0xb964c4[_0xc868('0x45')]['id']}})[_0xc868('0x21')](handleEntityNotFound(_0x390fae,null))[_0xc868('0x21')](removeEntity(_0x390fae,null))[_0xc868('0x41')](handleError(_0x390fae,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 10e7dfb..77af164 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x2e49ec,_0x14780d){var _0x3e211f=function(_0x3b7dd6){while(--_0x3b7dd6){_0x2e49ec['push'](_0x2e49ec['shift']());}};_0x3e211f(++_0x14780d);}(_0x7a54,0x106));var _0x47a5=function(_0x435b1b,_0x379324){_0x435b1b=_0x435b1b-0x0;var _0x35cf42=_0x7a54[_0x435b1b];return _0x35cf42;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index e9d6fbb..2ff91a0 100644 --- a/server/api/intVtigerField/intVtigerField.rpc.js +++ b/server/api/intVtigerField/intVtigerField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc94f=['../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis'];(function(_0x8b547,_0xfc69a0){var _0x4b4b15=function(_0x4c8793){while(--_0x4c8793){_0x8b547['push'](_0x8b547['shift']());}};_0x4b4b15(++_0xfc69a0);}(_0xc94f,0xcd));var _0xfc94=function(_0xb45119,_0x90c648){_0xb45119=_0xb45119-0x0;var _0x469da0=_0xc94f[_0xb45119];return _0x469da0;};'use strict';var _=require(_0xfc94('0x0'));var util=require('util');var moment=require(_0xfc94('0x1'));var BPromise=require(_0xfc94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc94('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc94('0x4'));var logger=require(_0xfc94('0x5'))(_0xfc94('0x6'));var config=require(_0xfc94('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x402ee9,_0xff28ad,_0x4dc395){return new BPromise(function(_0xe044e8,_0x47afb8){return client[_0xfc94('0x8')](_0x402ee9,_0x4dc395)[_0xfc94('0x9')](function(_0x4212af){logger[_0xfc94('0xa')]('VtigerField,\x20%s,\x20%s',_0xff28ad,'request\x20sent');logger[_0xfc94('0xb')](_0xfc94('0xc'),_0xff28ad,_0xfc94('0xd'),JSON[_0xfc94('0xe')](_0x4212af));if(_0x4212af[_0xfc94('0xf')]){if(_0x4212af[_0xfc94('0xf')]['code']===0x1f4){logger['error'](_0xfc94('0x10'),_0xff28ad,_0x4212af[_0xfc94('0xf')][_0xfc94('0x11')]);return _0x47afb8(_0x4212af[_0xfc94('0xf')]['message']);}logger[_0xfc94('0xf')](_0xfc94('0x10'),_0xff28ad,_0x4212af[_0xfc94('0xf')][_0xfc94('0x11')]);return _0xe044e8(_0x4212af[_0xfc94('0xf')]['message']);}else{logger[_0xfc94('0xa')]('VtigerField,\x20%s,\x20%s',_0xff28ad,_0xfc94('0xd'));_0xe044e8(_0x4212af['result'][_0xfc94('0x11')]);}})[_0xfc94('0x12')](function(_0x2f7bd6){logger['error'](_0xfc94('0x10'),_0xff28ad,_0x2f7bd6);_0x47afb8(_0x2f7bd6);});});} \ No newline at end of file +var _0x9a2a=['request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xfb372d,_0x47e3e8){var _0x4bd6f8=function(_0x4c6c17){while(--_0x4c6c17){_0xfb372d['push'](_0xfb372d['shift']());}};_0x4bd6f8(++_0x47e3e8);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0x9a2a[_0x2ef8c1];return _0x288305;};'use strict';var _=require(_0xa9a2('0x0'));var util=require(_0xa9a2('0x1'));var moment=require(_0xa9a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a2('0x3'))['db'];var utils=require(_0xa9a2('0x4'));var logger=require(_0xa9a2('0x5'))(_0xa9a2('0x6'));var config=require(_0xa9a2('0x7'));var jayson=require(_0xa9a2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x388689,_0xb51739,_0xedae90){return new BPromise(function(_0x287343,_0xcd2750){return client[_0xa9a2('0x9')](_0x388689,_0xedae90)[_0xa9a2('0xa')](function(_0x26f1ce){logger[_0xa9a2('0xb')]('VtigerField,\x20%s,\x20%s',_0xb51739,_0xa9a2('0xc'));logger[_0xa9a2('0xd')](_0xa9a2('0xe'),_0xb51739,_0xa9a2('0xc'),JSON[_0xa9a2('0xf')](_0x26f1ce));if(_0x26f1ce[_0xa9a2('0x10')]){if(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x11')]===0x1f4){logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0x26f1ce['error'][_0xa9a2('0x13')]);return _0xcd2750(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);}logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);return _0x287343(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);}else{logger[_0xa9a2('0xb')](_0xa9a2('0x12'),_0xb51739,_0xa9a2('0xc'));_0x287343(_0x26f1ce[_0xa9a2('0x14')]['message']);}})[_0xa9a2('0x15')](function(_0xbb6546){logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0xbb6546);_0xcd2750(_0xbb6546);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index a051332..682ceea 100644 --- a/server/api/intZendeskAccount/index.js +++ b/server/api/intZendeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5254=['put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','addConfiguration'];(function(_0x1bbfec,_0x4186cd){var _0x3804a1=function(_0x4ef08c){while(--_0x4ef08c){_0x1bbfec['push'](_0x1bbfec['shift']());}};_0x3804a1(++_0x4186cd);}(_0x5254,0x15b));var _0x4525=function(_0x4f9818,_0x54325d){_0x4f9818=_0x4f9818-0x0;var _0x5e90b7=_0x5254[_0x4f9818];return _0x5e90b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4525('0x0'));var timeout=require(_0x4525('0x1'));var express=require(_0x4525('0x2'));var router=express['Router']();var auth=require(_0x4525('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4525('0x4'));var controller=require(_0x4525('0x5'));router[_0x4525('0x6')]('/',auth[_0x4525('0x7')](),controller['index']);router['get'](_0x4525('0x8'),auth[_0x4525('0x7')](),controller['show']);router[_0x4525('0x6')](_0x4525('0x9'),auth[_0x4525('0x7')](),controller[_0x4525('0xa')]);router['get']('/:id/fields',auth[_0x4525('0x7')](),controller[_0x4525('0xb')]);router[_0x4525('0xc')]('/',auth[_0x4525('0x7')](),controller['create']);router[_0x4525('0xc')]('/:id/configurations',auth[_0x4525('0x7')](),controller[_0x4525('0xd')]);router[_0x4525('0xe')](_0x4525('0x8'),auth['isAuthenticated'](),controller[_0x4525('0xf')]);router[_0x4525('0x10')]('/:id',auth[_0x4525('0x7')](),controller[_0x4525('0x11')]);module[_0x4525('0x12')]=router; \ No newline at end of file +var _0xaeb3=['express','Router','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','update','delete','multer','util','path','connect-timeout'];(function(_0x342465,_0x3aa51b){var _0x4a4da7=function(_0x1047e1){while(--_0x1047e1){_0x342465['push'](_0x342465['shift']());}};_0x4a4da7(++_0x3aa51b);}(_0xaeb3,0xb0));var _0x3aeb=function(_0x2ef7b0,_0x3c1a32){_0x2ef7b0=_0x2ef7b0-0x0;var _0x41739b=_0xaeb3[_0x2ef7b0];return _0x41739b;};'use strict';var multer=require(_0x3aeb('0x0'));var util=require(_0x3aeb('0x1'));var path=require(_0x3aeb('0x2'));var timeout=require(_0x3aeb('0x3'));var express=require(_0x3aeb('0x4'));var router=express[_0x3aeb('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3aeb('0x6'));var controller=require('./intZendeskAccount.controller');router[_0x3aeb('0x7')]('/',auth[_0x3aeb('0x8')](),controller['index']);router['get'](_0x3aeb('0x9'),auth[_0x3aeb('0x8')](),controller[_0x3aeb('0xa')]);router[_0x3aeb('0x7')](_0x3aeb('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x3aeb('0x7')](_0x3aeb('0xc'),auth[_0x3aeb('0x8')](),controller['getFields']);router[_0x3aeb('0xd')]('/',auth['isAuthenticated'](),controller[_0x3aeb('0xe')]);router[_0x3aeb('0xd')](_0x3aeb('0xb'),auth[_0x3aeb('0x8')](),controller[_0x3aeb('0xf')]);router['put'](_0x3aeb('0x9'),auth[_0x3aeb('0x8')](),controller[_0x3aeb('0x10')]);router[_0x3aeb('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 674d726..366b514 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js +++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75c3=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','newTab'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x75c3,0x171));var _0x375c=function(_0x140c54,_0x5a3b4c){_0x140c54=_0x140c54-0x0;var _0x121442=_0x75c3[_0x140c54];return _0x121442;};'use strict';var Sequelize=require(_0x375c('0x0'));module[_0x375c('0x1')]={'name':{'type':Sequelize[_0x375c('0x2')]},'description':{'type':Sequelize[_0x375c('0x2')]},'username':{'type':Sequelize[_0x375c('0x2')],'unique':_0x375c('0x3')},'password':{'type':Sequelize[_0x375c('0x2')]},'token':{'type':Sequelize[_0x375c('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x375c('0x4')},'authType':{'type':Sequelize[_0x375c('0x5')](_0x375c('0x6'),_0x375c('0x7')),'defaultValue':_0x375c('0x6')},'serverUrl':{'type':Sequelize[_0x375c('0x2')]},'type':{'type':Sequelize[_0x375c('0x5')]('integrationTab',_0x375c('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x452d=['username','ENUM','integrationTab','newTab','STRING'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x452d,0xd6));var _0xd452=function(_0x47f5ca,_0x4c316d){_0x47f5ca=_0x47f5ca-0x0;var _0x14e954=_0x452d[_0x47f5ca];return _0x14e954;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd452('0x0')]},'description':{'type':Sequelize[_0xd452('0x0')]},'username':{'type':Sequelize[_0xd452('0x0')],'unique':_0xd452('0x1')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd452('0x0')]},'remoteUri':{'type':Sequelize[_0xd452('0x0')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password','token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xd452('0x0')]},'type':{'type':Sequelize[_0xd452('0x2')](_0xd452('0x3'),_0xd452('0x4')),'defaultValue':_0xd452('0x3')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 52501bc..65d517d 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cf8=['query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','fields','include','body','find','getConfigurations','findOne','ZendeskConfiguration','map','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','ZendeskField','getFields','username','password','remoteUri','slice','GET','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','token','%s/token:%s','base64','subject','description','group','assignee','remove','position','title','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','Sequelize','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','json','offset','limit','Content-Range','update','destroy','then','name','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','keys'];(function(_0x5b7d83,_0x366850){var _0x11a5c3=function(_0x4b36cd){while(--_0x4b36cd){_0x5b7d83['push'](_0x5b7d83['shift']());}};_0x11a5c3(++_0x366850);}(_0x5cf8,0x12c));var _0x85cf=function(_0x3720d1,_0x968d8b){_0x3720d1=_0x3720d1-0x0;var _0x14a1e8=_0x5cf8[_0x3720d1];return _0x14a1e8;};'use strict';var pdf=require(_0x85cf('0x0'));var emlformat=require(_0x85cf('0x1'));var rimraf=require(_0x85cf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85cf('0x3'));var rp=require('request-promise');var moment=require(_0x85cf('0x4'));var BPromise=require(_0x85cf('0x5'));var Mustache=require(_0x85cf('0x6'));var util=require(_0x85cf('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x85cf('0x8'));var fs=require('fs');var _=require(_0x85cf('0x9'));var squel=require(_0x85cf('0xa'));var crypto=require(_0x85cf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x85cf('0xc'));var toCsv=require(_0x85cf('0xd'));var querystring=require(_0x85cf('0xe'));var Papa=require(_0x85cf('0xf'));var Redis=require(_0x85cf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x85cf('0x11'));var as=require(_0x85cf('0x12'));var hardwareService=require(_0x85cf('0x13'));var logger=require(_0x85cf('0x14'))(_0x85cf('0x15'));var utils=require(_0x85cf('0x16'));var config=require('../../config/environment');var db=require(_0x85cf('0x17'))['db'];var integrations=require(_0x85cf('0x18'));var jayson=require(_0x85cf('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1aaf7d,_0x40839a,_0x5916bd){if(_0x5916bd){var _0xcd92ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcd92ff[_0x85cf('0x1a')](_0x40839a)){return _0x1aaf7d;}else{throw new db[(_0x85cf('0x1b'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1aaf7d;}}function respondWithRpcPromise(_0xcc8d34,_0x403e50,_0xa587a8,_0x18a9f5){return new BPromise(function(_0x2d0856,_0x51b7b7){var _0x2af6d0=_0x18a9f5||client;return _0x2af6d0[_0x85cf('0x1c')](_0xcc8d34,_0xa587a8)['then'](function(_0x5883b5){logger[_0x85cf('0x1d')](_0x85cf('0x1e'),_0x403e50,_0x85cf('0x1f'));logger['debug'](_0x85cf('0x20'),_0x403e50,_0x85cf('0x1f'),JSON['stringify'](_0x5883b5));if(_0x5883b5[_0x85cf('0x21')]){if(_0x5883b5[_0x85cf('0x21')]['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x403e50,_0x5883b5[_0x85cf('0x21')]['message']);return _0x51b7b7(_0x5883b5[_0x85cf('0x21')][_0x85cf('0x22')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x403e50,_0x5883b5['error'][_0x85cf('0x22')]);return _0x2d0856(_0x5883b5[_0x85cf('0x21')][_0x85cf('0x22')]);}else{logger[_0x85cf('0x1d')]('ZendeskAccount,\x20%s,\x20%s',_0x403e50,_0x85cf('0x1f'));_0x2d0856(_0x5883b5['result'][_0x85cf('0x22')]);}})['catch'](function(_0x1593b1){logger['error'](_0x85cf('0x1e'),_0x403e50,_0x1593b1);_0x51b7b7(_0x1593b1);});});}function respondWithStatusCode(_0x267d63,_0x4b5bbf){_0x4b5bbf=_0x4b5bbf||0xcc;return function(_0x2e4aa9){if(_0x2e4aa9){return _0x267d63[_0x85cf('0x23')](_0x4b5bbf);}return _0x267d63[_0x85cf('0x24')](_0x4b5bbf)[_0x85cf('0x25')]();};}function respondWithResult(_0x49a8fb,_0x5c33a3){_0x5c33a3=_0x5c33a3||0xc8;return function(_0x3d98e5){if(_0x3d98e5){return _0x49a8fb[_0x85cf('0x24')](_0x5c33a3)[_0x85cf('0x26')](_0x3d98e5);}};}function respondWithFilteredResult(_0x5a8d3b,_0x5eab1e){return function(_0x5e76c6){if(_0x5e76c6){var _0x2368ff=_0x5e76c6['count'],_0x571ec2=_0x5eab1e['offset'],_0x24a66f=_0x5eab1e[_0x85cf('0x27')]+_0x5eab1e[_0x85cf('0x28')],_0xcd7376;if(_0x24a66f>=_0x2368ff){_0x24a66f=_0x2368ff;_0xcd7376=0xc8;}else{_0xcd7376=0xce;}_0x5a8d3b['status'](_0xcd7376);return _0x5a8d3b['set'](_0x85cf('0x29'),_0x571ec2+'-'+_0x24a66f+'/'+_0x2368ff)[_0x85cf('0x26')](_0x5e76c6);}return null;};}function patchUpdates(_0x2e8940){return function(_0x5b72b3){try{jsonpatch['apply'](_0x5b72b3,_0x2e8940,!![]);}catch(_0x286959){return BPromise['reject'](_0x286959);}return _0x5b72b3['save']();};}function saveUpdates(_0x4d351d,_0x3d72f8){return function(_0x406ad2){if(_0x406ad2){return _0x406ad2[_0x85cf('0x2a')](_0x4d351d)['then'](function(_0x1a9af2){return _0x1a9af2;});}return null;};}function removeEntity(_0x5d0695,_0x4d7102){return function(_0x3ea71c){if(_0x3ea71c){return _0x3ea71c[_0x85cf('0x2b')]()[_0x85cf('0x2c')](function(){_0x5d0695[_0x85cf('0x24')](0xcc)[_0x85cf('0x25')]();});}};}function handleEntityNotFound(_0x1001e5,_0x4fc26b){return function(_0x519f24){if(!_0x519f24){_0x1001e5[_0x85cf('0x23')](0x194);}return _0x519f24;};}function handleError(_0x1d1e60,_0x197adb){_0x197adb=_0x197adb||0x1f4;return function(_0x142077){logger[_0x85cf('0x21')](_0x142077['stack']);if(_0x142077[_0x85cf('0x2d')]){delete _0x142077['name'];}_0x1d1e60[_0x85cf('0x24')](_0x197adb)['send'](_0x142077);};}exports[_0x85cf('0x2e')]=function(_0x15f124,_0x1144a6){var _0x4cb240={},_0x45d414={},_0x5f48ee={'count':0x0,'rows':[]};var _0x1eea54=_['map'](db[_0x85cf('0x2f')][_0x85cf('0x30')],function(_0x5163d3){return{'name':_0x5163d3[_0x85cf('0x31')],'type':_0x5163d3[_0x85cf('0x32')][_0x85cf('0x33')]};});_0x45d414[_0x85cf('0x34')]=_['map'](_0x1eea54,_0x85cf('0x2d'));_0x45d414['query']=_[_0x85cf('0x35')](_0x15f124[_0x85cf('0x36')]);_0x45d414[_0x85cf('0x37')]=_[_0x85cf('0x38')](_0x45d414['model'],_0x45d414['query']);_0x4cb240['attributes']=_[_0x85cf('0x38')](_0x45d414[_0x85cf('0x34')],qs['fields'](_0x15f124[_0x85cf('0x36')]['fields']));_0x4cb240['attributes']=_0x4cb240[_0x85cf('0x39')][_0x85cf('0x3a')]?_0x4cb240[_0x85cf('0x39')]:_0x45d414[_0x85cf('0x34')];if(!_0x15f124['query'][_0x85cf('0x3b')](_0x85cf('0x3c'))){_0x4cb240[_0x85cf('0x28')]=qs[_0x85cf('0x28')](_0x15f124[_0x85cf('0x36')][_0x85cf('0x28')]);_0x4cb240[_0x85cf('0x27')]=qs[_0x85cf('0x27')](_0x15f124[_0x85cf('0x36')][_0x85cf('0x27')]);}_0x4cb240[_0x85cf('0x3d')]=qs[_0x85cf('0x3e')](_0x15f124[_0x85cf('0x36')][_0x85cf('0x3e')]);_0x4cb240[_0x85cf('0x3f')]=qs[_0x85cf('0x37')](_[_0x85cf('0x40')](_0x15f124[_0x85cf('0x36')],_0x45d414[_0x85cf('0x37')]));if(_0x15f124[_0x85cf('0x36')][_0x85cf('0x41')]){_0x4cb240[_0x85cf('0x3f')]=_[_0x85cf('0x42')](_0x4cb240['where'],{'$or':_['map'](_0x1eea54,function(_0x2e48ee){if(_0x2e48ee[_0x85cf('0x32')]!==_0x85cf('0x43')){var _0x33bbee={};_0x33bbee[_0x2e48ee[_0x85cf('0x2d')]]={'$like':'%'+_0x15f124['query']['filter']+'%'};return _0x33bbee;}})});}_0x4cb240=_[_0x85cf('0x42')]({},_0x4cb240,_0x15f124[_0x85cf('0x44')]);var _0xb55514={'where':_0x4cb240[_0x85cf('0x3f')]};return db[_0x85cf('0x2f')][_0x85cf('0x45')](_0xb55514)[_0x85cf('0x2c')](function(_0x5be2b2){_0x5f48ee[_0x85cf('0x45')]=_0x5be2b2;if(_0x15f124[_0x85cf('0x36')][_0x85cf('0x46')]){_0x4cb240['include']=[{'all':!![]}];}return db[_0x85cf('0x2f')][_0x85cf('0x47')](_0x4cb240);})[_0x85cf('0x2c')](function(_0x9e6acc){_0x5f48ee[_0x85cf('0x48')]=_0x9e6acc;return _0x5f48ee;})[_0x85cf('0x2c')](respondWithFilteredResult(_0x1144a6,_0x4cb240))[_0x85cf('0x49')](handleError(_0x1144a6,null));};exports['show']=function(_0x2ba8ec,_0x2e47cb){var _0x10255c={'raw':![],'where':{'id':_0x2ba8ec[_0x85cf('0x4a')]['id']}},_0x19ec3d={};_0x19ec3d[_0x85cf('0x34')]=_['keys'](db['ZendeskAccount']['rawAttributes']);_0x19ec3d['query']=_[_0x85cf('0x35')](_0x2ba8ec[_0x85cf('0x36')]);_0x19ec3d[_0x85cf('0x37')]=_[_0x85cf('0x38')](_0x19ec3d['model'],_0x19ec3d[_0x85cf('0x36')]);_0x10255c['attributes']=_['intersection'](_0x19ec3d[_0x85cf('0x34')],qs[_0x85cf('0x4b')](_0x2ba8ec['query'][_0x85cf('0x4b')]));_0x10255c[_0x85cf('0x39')]=_0x10255c[_0x85cf('0x39')]['length']?_0x10255c[_0x85cf('0x39')]:_0x19ec3d['model'];if(_0x2ba8ec[_0x85cf('0x36')][_0x85cf('0x46')]){_0x10255c[_0x85cf('0x4c')]=[{'all':!![]}];}_0x10255c=_[_0x85cf('0x42')]({},_0x10255c,_0x2ba8ec[_0x85cf('0x44')]);return db['ZendeskAccount']['find'](_0x10255c)['then'](handleEntityNotFound(_0x2e47cb,null))[_0x85cf('0x2c')](respondWithResult(_0x2e47cb,null))[_0x85cf('0x49')](handleError(_0x2e47cb,null));};exports['create']=function(_0x20f506,_0x4eb57b){return db[_0x85cf('0x2f')]['create'](_0x20f506[_0x85cf('0x4d')],{})[_0x85cf('0x2c')](respondWithResult(_0x4eb57b,0xc9))['catch'](handleError(_0x4eb57b,null));};exports[_0x85cf('0x2a')]=function(_0x3ee88b,_0x4408ac){if(_0x3ee88b[_0x85cf('0x4d')]['id']){delete _0x3ee88b['body']['id'];}return db[_0x85cf('0x2f')][_0x85cf('0x4e')]({'where':{'id':_0x3ee88b['params']['id']}})['then'](handleEntityNotFound(_0x4408ac,null))['then'](saveUpdates(_0x3ee88b[_0x85cf('0x4d')],null))['then'](respondWithResult(_0x4408ac,null))[_0x85cf('0x49')](handleError(_0x4408ac,null));};exports[_0x85cf('0x2b')]=function(_0x2b718a,_0x528f51){return db[_0x85cf('0x2f')]['find']({'where':{'id':_0x2b718a[_0x85cf('0x4a')]['id']}})[_0x85cf('0x2c')](handleEntityNotFound(_0x528f51,null))[_0x85cf('0x2c')](removeEntity(_0x528f51,null))[_0x85cf('0x49')](handleError(_0x528f51,null));};exports[_0x85cf('0x4f')]=function(_0xbb0fa6,_0x200362,_0x39b52){var _0x32d0a5={};var _0x55b8fb={};var _0x375290;var _0x1743d7;return db['ZendeskAccount'][_0x85cf('0x50')]({'where':{'id':_0xbb0fa6[_0x85cf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x200362,null))[_0x85cf('0x2c')](function(_0x4697d6){if(_0x4697d6){_0x375290=_0x4697d6;_0x55b8fb[_0x85cf('0x34')]=_[_0x85cf('0x35')](db[_0x85cf('0x51')][_0x85cf('0x30')]);_0x55b8fb[_0x85cf('0x36')]=_[_0x85cf('0x35')](_0xbb0fa6[_0x85cf('0x36')]);_0x55b8fb[_0x85cf('0x37')]=_[_0x85cf('0x38')](_0x55b8fb[_0x85cf('0x34')],_0x55b8fb[_0x85cf('0x36')]);_0x32d0a5[_0x85cf('0x39')]=_['intersection'](_0x55b8fb['model'],qs[_0x85cf('0x4b')](_0xbb0fa6[_0x85cf('0x36')][_0x85cf('0x4b')]));_0x32d0a5[_0x85cf('0x39')]=_0x32d0a5[_0x85cf('0x39')][_0x85cf('0x3a')]?_0x32d0a5[_0x85cf('0x39')]:_0x55b8fb[_0x85cf('0x34')];_0x32d0a5[_0x85cf('0x3d')]=qs[_0x85cf('0x3e')](_0xbb0fa6[_0x85cf('0x36')][_0x85cf('0x3e')]);_0x32d0a5[_0x85cf('0x3f')]=qs[_0x85cf('0x37')](_[_0x85cf('0x40')](_0xbb0fa6[_0x85cf('0x36')],_0x55b8fb['filters']));if(_0xbb0fa6[_0x85cf('0x36')][_0x85cf('0x41')]){_0x32d0a5['where']=_[_0x85cf('0x42')](_0x32d0a5['where'],{'$or':_[_0x85cf('0x52')](_0x32d0a5[_0x85cf('0x39')],function(_0x3afac9){var _0x1c237f={};_0x1c237f[_0x3afac9]={'$like':'%'+_0xbb0fa6[_0x85cf('0x36')][_0x85cf('0x41')]+'%'};return _0x1c237f;})});}_0x32d0a5=_[_0x85cf('0x42')]({},_0x32d0a5,_0xbb0fa6[_0x85cf('0x44')]);return _0x375290[_0x85cf('0x4f')](_0x32d0a5);}})[_0x85cf('0x2c')](function(_0x939630){if(_0x939630){_0x1743d7=_0x939630[_0x85cf('0x3a')];if(!_0xbb0fa6['query'][_0x85cf('0x3b')]('nolimit')){_0x32d0a5[_0x85cf('0x28')]=qs[_0x85cf('0x28')](_0xbb0fa6['query'][_0x85cf('0x28')]);_0x32d0a5['offset']=qs[_0x85cf('0x27')](_0xbb0fa6[_0x85cf('0x36')][_0x85cf('0x27')]);}return _0x375290[_0x85cf('0x4f')](_0x32d0a5);}})['then'](function(_0x5a63f1){if(_0x5a63f1){return _0x5a63f1?{'count':_0x1743d7,'rows':_0x5a63f1}:null;}})[_0x85cf('0x2c')](respondWithResult(_0x200362,null))[_0x85cf('0x49')](handleError(_0x200362,null));};exports['addConfiguration']=function(_0x1edb7f,_0x3b1ead,_0x2e9e95){if(_0x1edb7f[_0x85cf('0x4d')]['id']){delete _0x1edb7f[_0x85cf('0x4d')]['id'];}return db[_0x85cf('0x2f')][_0x85cf('0x50')]({'where':{'id':_0x1edb7f[_0x85cf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b1ead,null))[_0x85cf('0x2c')](function(_0x424c95){if(_0x424c95){_0x1edb7f[_0x85cf('0x4d')]['AccountId']=_0x424c95['id'];_0x1edb7f['body'][_0x85cf('0x53')]=integrations[_0x85cf('0x54')](_0x1edb7f[_0x85cf('0x4d')]['channel'],_0x1edb7f['body']['type']);_0x1edb7f[_0x85cf('0x4d')][_0x85cf('0x55')]=integrations[_0x85cf('0x56')](_0x1edb7f[_0x85cf('0x4d')][_0x85cf('0x57')],_0x1edb7f['body'][_0x85cf('0x32')]);return db[_0x85cf('0x51')][_0x85cf('0x58')](_0x1edb7f[_0x85cf('0x4d')],{'include':[{'model':db[_0x85cf('0x59')],'as':_0x85cf('0x53')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x85cf('0x2c')](respondWithResult(_0x3b1ead,null))[_0x85cf('0x49')](handleError(_0x3b1ead,null));};exports[_0x85cf('0x5a')]=function(_0xab69c2,_0x3623b9,_0x5d0a84){var _0xedd490='';return db['ZendeskAccount'][_0x85cf('0x50')]({'where':{'id':_0xab69c2['params']['id']},'attributes':['id',_0x85cf('0x5b'),_0x85cf('0x5c'),'token','authType',_0x85cf('0x5d')]})[_0x85cf('0x2c')](handleEntityNotFound(_0x3623b9,null))[_0x85cf('0x2c')](function(_0x146968){if(_0x146968){_0xedd490=_0x146968[_0x85cf('0x5d')];var _0x390bed=_0xedd490[_0x85cf('0x5e')](-0x1);if(_0x390bed==='/'){_0xedd490=_0xedd490['substring'](0x0,_0xedd490['lastIndexOf'](_0x390bed));}var _0x5b7042={'method':_0x85cf('0x5f'),'uri':util[_0x85cf('0x60')]('%s/%s',_0xedd490,_0x85cf('0x61')),'json':!![]};switch(_0x146968['authType']){case _0x85cf('0x5c'):_0x5b7042[_0x85cf('0x62')]={'Authorization':util[_0x85cf('0x60')](_0x85cf('0x63'),new Buffer(util[_0x85cf('0x60')](_0x85cf('0x64'),_0x146968[_0x85cf('0x5b')],_0x146968[_0x85cf('0x5c')]))[_0x85cf('0x65')]('base64'))};break;case _0x85cf('0x66'):_0x5b7042['headers']={'Authorization':util['format'](_0x85cf('0x63'),new Buffer(util[_0x85cf('0x60')](_0x85cf('0x67'),_0x146968['username'],_0x146968[_0x85cf('0x66')]))['toString'](_0x85cf('0x68')))};break;default:throw new db[(_0x85cf('0x1b'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x5b7042);}})[_0x85cf('0x2c')](function(_0x556878){if(_0x556878){var _0x2e4e4b=[_0x85cf('0x69'),_0x85cf('0x6a'),_0x85cf('0x6b'),_0x85cf('0x6c')];_[_0x85cf('0x6d')](_0x556878[_0x85cf('0x61')],function(_0x34eadc){return _0x2e4e4b['includes'](_0x34eadc['type']);});return{'count':_0x556878[_0x85cf('0x61')][_0x85cf('0x3a')],'rows':_['map'](_0x556878[_0x85cf('0x61')],function(_0xcd88a2){return{'id':_0xcd88a2['id'],'name':_0xcd88a2[_0x85cf('0x6e')]>0x7?_0xcd88a2[_0x85cf('0x6f')]:_0xcd88a2[_0x85cf('0x32')],'custom':_0xcd88a2[_0x85cf('0x6e')]>0x7?!![]:![],'options':_0xcd88a2['system_field_options']?_0xcd88a2['system_field_options']:_0xcd88a2[_0x85cf('0x70')]?_0xcd88a2[_0x85cf('0x70')]:[]};})};}})[_0x85cf('0x2c')](respondWithResult(_0x3623b9,null))[_0x85cf('0x49')](function(_0x42140f){var _0x890582=_0xab69c2[_0x85cf('0x36')][_0x85cf('0x1a')]?0x1f4:_0x42140f[_0x85cf('0x71')]||0x1f4;logger[_0x85cf('0x21')](_0x85cf('0x72'),_0x85cf('0x5a'),_0x890582,JSON[_0x85cf('0x73')](_0x42140f));delete _0x42140f[_0x85cf('0x2d')];if(_0x890582===0x191){_0x890582=0x190;}_0x3623b9[_0x85cf('0x24')](_0x890582)[_0x85cf('0x74')](_0xab69c2['query'][_0x85cf('0x1a')]?{'message':_0x85cf('0x75'),'statusCode':_0x42140f[_0x85cf('0x71')]}:_0x42140f);});}; \ No newline at end of file +var _0x2986=['stringify','send','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','error','code','message','ZendeskAccount,\x20%s,\x20%s','info','result','catch','sendStatus','end','json','offset','limit','status','Content-Range','apply','reject','save','update','destroy','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','rows','include','create','body','params','find','findOne','ZendeskConfiguration','getConfigurations','nolimit','getSubjects','channel','Subjects','ZendeskField','Descriptions','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','base64','headers','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','title','position','system_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x23f038,_0x2c526e){var _0x300794=function(_0x347fc6){while(--_0x347fc6){_0x23f038['push'](_0x23f038['shift']());}};_0x300794(++_0x2c526e);}(_0x2986,0x7b));var _0x6298=function(_0x1c1a90,_0x539675){_0x1c1a90=_0x1c1a90-0x0;var _0x47a19e=_0x2986[_0x1c1a90];return _0x47a19e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6298('0x0'));var moment=require(_0x6298('0x1'));var BPromise=require(_0x6298('0x2'));var Mustache=require(_0x6298('0x3'));var util=require(_0x6298('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6298('0x5'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6298('0x6'));var crypto=require(_0x6298('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6298('0x8'));var querystring=require(_0x6298('0x9'));var Papa=require(_0x6298('0xa'));var Redis=require(_0x6298('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x6298('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6298('0xd'));var logger=require(_0x6298('0xe'))('api');var utils=require(_0x6298('0xf'));var config=require('../../config/environment');var db=require(_0x6298('0x10'))['db'];var integrations=require(_0x6298('0x11'));var jayson=require(_0x6298('0x12'));var client=jayson['client'][_0x6298('0x13')]({'port':0x232a});function checkPasswordPattern(_0x36dd65,_0x4ebfee,_0x18db9a){if(_0x18db9a){var _0x1a5f5d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a5f5d[_0x6298('0x14')](_0x4ebfee)){return _0x36dd65;}else{throw new db[(_0x6298('0x15'))][(_0x6298('0x16'))](_0x6298('0x17'));}}else{return _0x36dd65;}}function respondWithRpcPromise(_0x3006ea,_0x535fef,_0x194c38,_0x2bd31d){return new BPromise(function(_0x39c871,_0x36e9da){var _0x46dcf9=_0x2bd31d||client;return _0x46dcf9[_0x6298('0x18')](_0x3006ea,_0x194c38)[_0x6298('0x19')](function(_0xdfba93){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x535fef,_0x6298('0x1a'));logger[_0x6298('0x1b')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x535fef,'request\x20sent',JSON['stringify'](_0xdfba93));if(_0xdfba93['error']){if(_0xdfba93[_0x6298('0x1c')][_0x6298('0x1d')]===0x1f4){logger[_0x6298('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0x535fef,_0xdfba93[_0x6298('0x1c')][_0x6298('0x1e')]);return _0x36e9da(_0xdfba93[_0x6298('0x1c')]['message']);}logger['error'](_0x6298('0x1f'),_0x535fef,_0xdfba93[_0x6298('0x1c')][_0x6298('0x1e')]);return _0x39c871(_0xdfba93[_0x6298('0x1c')][_0x6298('0x1e')]);}else{logger[_0x6298('0x20')](_0x6298('0x1f'),_0x535fef,_0x6298('0x1a'));_0x39c871(_0xdfba93[_0x6298('0x21')][_0x6298('0x1e')]);}})[_0x6298('0x22')](function(_0x1578b9){logger[_0x6298('0x1c')](_0x6298('0x1f'),_0x535fef,_0x1578b9);_0x36e9da(_0x1578b9);});});}function respondWithStatusCode(_0x12bd14,_0x1342e2){_0x1342e2=_0x1342e2||0xcc;return function(_0x181feb){if(_0x181feb){return _0x12bd14[_0x6298('0x23')](_0x1342e2);}return _0x12bd14['status'](_0x1342e2)[_0x6298('0x24')]();};}function respondWithResult(_0x22bed9,_0x5adc17){_0x5adc17=_0x5adc17||0xc8;return function(_0x13dd9a){if(_0x13dd9a){return _0x22bed9['status'](_0x5adc17)[_0x6298('0x25')](_0x13dd9a);}};}function respondWithFilteredResult(_0x9ad84b,_0x3c04a2){return function(_0x456cdf){if(_0x456cdf){var _0x31bbdb=_0x456cdf['count'],_0x55c6e3=_0x3c04a2[_0x6298('0x26')],_0x293306=_0x3c04a2[_0x6298('0x26')]+_0x3c04a2[_0x6298('0x27')],_0xb506a6;if(_0x293306>=_0x31bbdb){_0x293306=_0x31bbdb;_0xb506a6=0xc8;}else{_0xb506a6=0xce;}_0x9ad84b[_0x6298('0x28')](_0xb506a6);return _0x9ad84b['set'](_0x6298('0x29'),_0x55c6e3+'-'+_0x293306+'/'+_0x31bbdb)['json'](_0x456cdf);}return null;};}function patchUpdates(_0x58f9d9){return function(_0x1a3518){try{jsonpatch[_0x6298('0x2a')](_0x1a3518,_0x58f9d9,!![]);}catch(_0x3e8b97){return BPromise[_0x6298('0x2b')](_0x3e8b97);}return _0x1a3518[_0x6298('0x2c')]();};}function saveUpdates(_0x51c636,_0x5290b8){return function(_0x24747c){if(_0x24747c){return _0x24747c[_0x6298('0x2d')](_0x51c636)[_0x6298('0x19')](function(_0x2cc9d0){return _0x2cc9d0;});}return null;};}function removeEntity(_0x5771c8,_0x2ebdfb){return function(_0x211fcd){if(_0x211fcd){return _0x211fcd[_0x6298('0x2e')]()[_0x6298('0x19')](function(){_0x5771c8['status'](0xcc)[_0x6298('0x24')]();});}};}function handleEntityNotFound(_0xdee416,_0x12c163){return function(_0x22b9e3){if(!_0x22b9e3){_0xdee416[_0x6298('0x23')](0x194);}return _0x22b9e3;};}function handleError(_0x3e5f52,_0x4294a9){_0x4294a9=_0x4294a9||0x1f4;return function(_0x4fdb51){logger['error'](_0x4fdb51['stack']);if(_0x4fdb51[_0x6298('0x2f')]){delete _0x4fdb51[_0x6298('0x2f')];}_0x3e5f52[_0x6298('0x28')](_0x4294a9)['send'](_0x4fdb51);};}exports[_0x6298('0x30')]=function(_0x15c9a3,_0x462961){var _0x21742d={},_0x10a7dc={},_0x288edd={'count':0x0,'rows':[]};var _0x30209d=_[_0x6298('0x31')](db[_0x6298('0x32')][_0x6298('0x33')],function(_0x424527){return{'name':_0x424527[_0x6298('0x34')],'type':_0x424527[_0x6298('0x35')][_0x6298('0x36')]};});_0x10a7dc[_0x6298('0x37')]=_[_0x6298('0x31')](_0x30209d,'name');_0x10a7dc[_0x6298('0x38')]=_[_0x6298('0x39')](_0x15c9a3[_0x6298('0x38')]);_0x10a7dc[_0x6298('0x3a')]=_[_0x6298('0x3b')](_0x10a7dc['model'],_0x10a7dc[_0x6298('0x38')]);_0x21742d['attributes']=_['intersection'](_0x10a7dc[_0x6298('0x37')],qs[_0x6298('0x3c')](_0x15c9a3[_0x6298('0x38')]['fields']));_0x21742d['attributes']=_0x21742d[_0x6298('0x3d')][_0x6298('0x3e')]?_0x21742d['attributes']:_0x10a7dc['model'];if(!_0x15c9a3[_0x6298('0x38')][_0x6298('0x3f')]('nolimit')){_0x21742d[_0x6298('0x27')]=qs['limit'](_0x15c9a3['query']['limit']);_0x21742d[_0x6298('0x26')]=qs[_0x6298('0x26')](_0x15c9a3[_0x6298('0x38')]['offset']);}_0x21742d[_0x6298('0x40')]=qs[_0x6298('0x41')](_0x15c9a3['query']['sort']);_0x21742d['where']=qs[_0x6298('0x3a')](_[_0x6298('0x42')](_0x15c9a3[_0x6298('0x38')],_0x10a7dc['filters']));if(_0x15c9a3['query']['filter']){_0x21742d[_0x6298('0x43')]=_[_0x6298('0x44')](_0x21742d[_0x6298('0x43')],{'$or':_[_0x6298('0x31')](_0x30209d,function(_0x4dde0f){if(_0x4dde0f['type']!==_0x6298('0x45')){var _0x2d0be1={};_0x2d0be1[_0x4dde0f[_0x6298('0x2f')]]={'$like':'%'+_0x15c9a3['query'][_0x6298('0x46')]+'%'};return _0x2d0be1;}})});}_0x21742d=_[_0x6298('0x44')]({},_0x21742d,_0x15c9a3[_0x6298('0x47')]);var _0x38783c={'where':_0x21742d[_0x6298('0x43')]};return db[_0x6298('0x32')][_0x6298('0x48')](_0x38783c)[_0x6298('0x19')](function(_0x257af0){_0x288edd[_0x6298('0x48')]=_0x257af0;if(_0x15c9a3[_0x6298('0x38')][_0x6298('0x49')]){_0x21742d['include']=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x21742d);})[_0x6298('0x19')](function(_0x55a4d0){_0x288edd[_0x6298('0x4a')]=_0x55a4d0;return _0x288edd;})[_0x6298('0x19')](respondWithFilteredResult(_0x462961,_0x21742d))[_0x6298('0x22')](handleError(_0x462961,null));};exports['show']=function(_0x4ac0ce,_0x3de93b){var _0x3f6958={'raw':![],'where':{'id':_0x4ac0ce['params']['id']}},_0x24180d={};_0x24180d[_0x6298('0x37')]=_[_0x6298('0x39')](db[_0x6298('0x32')][_0x6298('0x33')]);_0x24180d[_0x6298('0x38')]=_[_0x6298('0x39')](_0x4ac0ce['query']);_0x24180d[_0x6298('0x3a')]=_['intersection'](_0x24180d['model'],_0x24180d[_0x6298('0x38')]);_0x3f6958[_0x6298('0x3d')]=_[_0x6298('0x3b')](_0x24180d['model'],qs[_0x6298('0x3c')](_0x4ac0ce[_0x6298('0x38')][_0x6298('0x3c')]));_0x3f6958['attributes']=_0x3f6958[_0x6298('0x3d')][_0x6298('0x3e')]?_0x3f6958[_0x6298('0x3d')]:_0x24180d[_0x6298('0x37')];if(_0x4ac0ce[_0x6298('0x38')][_0x6298('0x49')]){_0x3f6958[_0x6298('0x4b')]=[{'all':!![]}];}_0x3f6958=_['merge']({},_0x3f6958,_0x4ac0ce[_0x6298('0x47')]);return db[_0x6298('0x32')]['find'](_0x3f6958)['then'](handleEntityNotFound(_0x3de93b,null))[_0x6298('0x19')](respondWithResult(_0x3de93b,null))['catch'](handleError(_0x3de93b,null));};exports[_0x6298('0x4c')]=function(_0x43959a,_0x27e8ba){return db[_0x6298('0x32')][_0x6298('0x4c')](_0x43959a[_0x6298('0x4d')],{})[_0x6298('0x19')](respondWithResult(_0x27e8ba,0xc9))[_0x6298('0x22')](handleError(_0x27e8ba,null));};exports['update']=function(_0xdc2e71,_0x399ae1){if(_0xdc2e71[_0x6298('0x4d')]['id']){delete _0xdc2e71['body']['id'];}return db[_0x6298('0x32')]['find']({'where':{'id':_0xdc2e71[_0x6298('0x4e')]['id']}})[_0x6298('0x19')](handleEntityNotFound(_0x399ae1,null))[_0x6298('0x19')](saveUpdates(_0xdc2e71['body'],null))[_0x6298('0x19')](respondWithResult(_0x399ae1,null))[_0x6298('0x22')](handleError(_0x399ae1,null));};exports[_0x6298('0x2e')]=function(_0x480bf7,_0x4db036){return db[_0x6298('0x32')][_0x6298('0x4f')]({'where':{'id':_0x480bf7[_0x6298('0x4e')]['id']}})[_0x6298('0x19')](handleEntityNotFound(_0x4db036,null))[_0x6298('0x19')](removeEntity(_0x4db036,null))[_0x6298('0x22')](handleError(_0x4db036,null));};exports['getConfigurations']=function(_0xbc7c51,_0x537427,_0x2c0b47){var _0x4ee0b8={};var _0x94dbe5={};var _0x51aa08;var _0x408639;return db['ZendeskAccount'][_0x6298('0x50')]({'where':{'id':_0xbc7c51[_0x6298('0x4e')]['id']}})[_0x6298('0x19')](handleEntityNotFound(_0x537427,null))['then'](function(_0x2083ff){if(_0x2083ff){_0x51aa08=_0x2083ff;_0x94dbe5['model']=_[_0x6298('0x39')](db[_0x6298('0x51')][_0x6298('0x33')]);_0x94dbe5[_0x6298('0x38')]=_[_0x6298('0x39')](_0xbc7c51[_0x6298('0x38')]);_0x94dbe5[_0x6298('0x3a')]=_[_0x6298('0x3b')](_0x94dbe5[_0x6298('0x37')],_0x94dbe5[_0x6298('0x38')]);_0x4ee0b8['attributes']=_[_0x6298('0x3b')](_0x94dbe5[_0x6298('0x37')],qs[_0x6298('0x3c')](_0xbc7c51[_0x6298('0x38')][_0x6298('0x3c')]));_0x4ee0b8[_0x6298('0x3d')]=_0x4ee0b8[_0x6298('0x3d')]['length']?_0x4ee0b8[_0x6298('0x3d')]:_0x94dbe5[_0x6298('0x37')];_0x4ee0b8[_0x6298('0x40')]=qs['sort'](_0xbc7c51['query'][_0x6298('0x41')]);_0x4ee0b8['where']=qs[_0x6298('0x3a')](_[_0x6298('0x42')](_0xbc7c51[_0x6298('0x38')],_0x94dbe5['filters']));if(_0xbc7c51[_0x6298('0x38')]['filter']){_0x4ee0b8[_0x6298('0x43')]=_['merge'](_0x4ee0b8['where'],{'$or':_[_0x6298('0x31')](_0x4ee0b8[_0x6298('0x3d')],function(_0x5cc86d){var _0x492f50={};_0x492f50[_0x5cc86d]={'$like':'%'+_0xbc7c51[_0x6298('0x38')]['filter']+'%'};return _0x492f50;})});}_0x4ee0b8=_['merge']({},_0x4ee0b8,_0xbc7c51[_0x6298('0x47')]);return _0x51aa08[_0x6298('0x52')](_0x4ee0b8);}})[_0x6298('0x19')](function(_0xc6e125){if(_0xc6e125){_0x408639=_0xc6e125[_0x6298('0x3e')];if(!_0xbc7c51[_0x6298('0x38')]['hasOwnProperty'](_0x6298('0x53'))){_0x4ee0b8[_0x6298('0x27')]=qs[_0x6298('0x27')](_0xbc7c51[_0x6298('0x38')][_0x6298('0x27')]);_0x4ee0b8['offset']=qs[_0x6298('0x26')](_0xbc7c51[_0x6298('0x38')]['offset']);}return _0x51aa08['getConfigurations'](_0x4ee0b8);}})['then'](function(_0x24854e){if(_0x24854e){return _0x24854e?{'count':_0x408639,'rows':_0x24854e}:null;}})[_0x6298('0x19')](respondWithResult(_0x537427,null))[_0x6298('0x22')](handleError(_0x537427,null));};exports['addConfiguration']=function(_0x5211b3,_0xa389b7,_0x5ccb25){if(_0x5211b3['body']['id']){delete _0x5211b3[_0x6298('0x4d')]['id'];}return db[_0x6298('0x32')][_0x6298('0x50')]({'where':{'id':_0x5211b3[_0x6298('0x4e')]['id']}})[_0x6298('0x19')](handleEntityNotFound(_0xa389b7,null))[_0x6298('0x19')](function(_0x43e7bf){if(_0x43e7bf){_0x5211b3[_0x6298('0x4d')]['AccountId']=_0x43e7bf['id'];_0x5211b3[_0x6298('0x4d')]['Subjects']=integrations[_0x6298('0x54')](_0x5211b3[_0x6298('0x4d')][_0x6298('0x55')],_0x5211b3[_0x6298('0x4d')][_0x6298('0x35')]);_0x5211b3[_0x6298('0x4d')]['Descriptions']=integrations['getDescriptions'](_0x5211b3[_0x6298('0x4d')][_0x6298('0x55')],_0x5211b3['body'][_0x6298('0x35')]);return db[_0x6298('0x51')][_0x6298('0x4c')](_0x5211b3[_0x6298('0x4d')],{'include':[{'model':db['ZendeskField'],'as':_0x6298('0x56')},{'model':db[_0x6298('0x57')],'as':_0x6298('0x58')}]});}return null;})[_0x6298('0x19')](respondWithResult(_0xa389b7,null))[_0x6298('0x22')](handleError(_0xa389b7,null));};exports[_0x6298('0x59')]=function(_0x31fe0b,_0x52fa55,_0x5f0533){var _0x335d89='';return db[_0x6298('0x32')][_0x6298('0x50')]({'where':{'id':_0x31fe0b[_0x6298('0x4e')]['id']},'attributes':['id',_0x6298('0x5a'),_0x6298('0x5b'),_0x6298('0x5c'),_0x6298('0x5d'),_0x6298('0x5e')]})['then'](handleEntityNotFound(_0x52fa55,null))['then'](function(_0x1fc8bf){if(_0x1fc8bf){_0x335d89=_0x1fc8bf[_0x6298('0x5e')];var _0x2390dd=_0x335d89[_0x6298('0x5f')](-0x1);if(_0x2390dd==='/'){_0x335d89=_0x335d89[_0x6298('0x60')](0x0,_0x335d89[_0x6298('0x61')](_0x2390dd));}var _0x107505={'method':'GET','uri':util[_0x6298('0x62')](_0x6298('0x63'),_0x335d89,_0x6298('0x64')),'json':!![]};switch(_0x1fc8bf[_0x6298('0x5d')]){case _0x6298('0x5b'):_0x107505['headers']={'Authorization':util[_0x6298('0x62')](_0x6298('0x65'),new Buffer(util[_0x6298('0x62')](_0x6298('0x66'),_0x1fc8bf[_0x6298('0x5a')],_0x1fc8bf[_0x6298('0x5b')]))[_0x6298('0x67')](_0x6298('0x68')))};break;case'token':_0x107505[_0x6298('0x69')]={'Authorization':util[_0x6298('0x62')](_0x6298('0x65'),new Buffer(util[_0x6298('0x62')](_0x6298('0x6a'),_0x1fc8bf[_0x6298('0x5a')],_0x1fc8bf[_0x6298('0x5c')]))[_0x6298('0x67')](_0x6298('0x68')))};break;default:throw new db[(_0x6298('0x15'))][(_0x6298('0x16'))](_0x6298('0x6b'));}return rp(_0x107505);}})[_0x6298('0x19')](function(_0x31fc98){if(_0x31fc98){var _0x2d57e2=[_0x6298('0x6c'),_0x6298('0x6d'),_0x6298('0x6e'),_0x6298('0x6f')];_[_0x6298('0x70')](_0x31fc98[_0x6298('0x64')],function(_0x2a3100){return _0x2d57e2[_0x6298('0x71')](_0x2a3100['type']);});return{'count':_0x31fc98[_0x6298('0x64')]['length'],'rows':_[_0x6298('0x31')](_0x31fc98[_0x6298('0x64')],function(_0x374731){return{'id':_0x374731['id'],'name':_0x374731['position']>0x7?_0x374731[_0x6298('0x72')]:_0x374731['type'],'custom':_0x374731[_0x6298('0x73')]>0x7?!![]:![],'options':_0x374731['system_field_options']?_0x374731[_0x6298('0x74')]:_0x374731['custom_field_options']?_0x374731['custom_field_options']:[]};})};}})[_0x6298('0x19')](respondWithResult(_0x52fa55,null))[_0x6298('0x22')](function(_0x1c2f6e){var _0x39d2ab=_0x31fe0b[_0x6298('0x38')]['test']?0x1f4:_0x1c2f6e[_0x6298('0x75')]||0x1f4;logger[_0x6298('0x1c')](_0x6298('0x76'),'getFields',_0x39d2ab,JSON[_0x6298('0x77')](_0x1c2f6e));delete _0x1c2f6e[_0x6298('0x2f')];if(_0x39d2ab===0x191){_0x39d2ab=0x190;}_0x52fa55[_0x6298('0x28')](_0x39d2ab)[_0x6298('0x78')](_0x31fe0b[_0x6298('0x38')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1c2f6e['statusCode']}:_0x1c2f6e);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b8b4057..052dd31 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.model.js +++ b/server/api/intZendeskAccount/intZendeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde65=['define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0xde65,0x1b0));var _0x5de6=function(_0x38f41e,_0x2b8dc9){_0x38f41e=_0x38f41e-0x0;var _0x3d1128=_0xde65[_0x38f41e];return _0x3d1128;};'use strict';var _=require('lodash');var util=require(_0x5de6('0x0'));var logger=require(_0x5de6('0x1'))('api');var moment=require(_0x5de6('0x2'));var BPromise=require(_0x5de6('0x3'));var rp=require(_0x5de6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5de6('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x5de6('0x6'));module[_0x5de6('0x7')]=function(_0x40a68c,_0x2d0080){return _0x40a68c[_0x5de6('0x8')](_0x5de6('0x9'),attributes,{'tableName':_0x5de6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda1b=['exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xda1b,0x1bf));var _0xbda1=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xda1b[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xbda1('0x0'));var util=require(_0xbda1('0x1'));var logger=require(_0xbda1('0x2'))('api');var moment=require(_0xbda1('0x3'));var BPromise=require(_0xbda1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbda1('0x5'));var rimraf=require('rimraf');var config=require(_0xbda1('0x6'));var attributes=require(_0xbda1('0x7'));var integrations=require(_0xbda1('0x8'));module[_0xbda1('0x9')]=function(_0xf5dfb3,_0xfeacb7){return _0xf5dfb3['define'](_0xbda1('0xa'),attributes,{'tableName':_0xbda1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 67026f4..056a83e 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0xa71dcd,_0x202c94){var _0x51266c=function(_0x117883){while(--_0x117883){_0xa71dcd['push'](_0xa71dcd['shift']());}};_0x51266c(++_0x202c94);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file +var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xcb91[_0x8af54b];return _0x27d8f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 8d11a99..02c3d97 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34b9=['update','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put'];(function(_0x54f730,_0x1f62f3){var _0x3c9e95=function(_0x536f4b){while(--_0x536f4b){_0x54f730['push'](_0x54f730['shift']());}};_0x3c9e95(++_0x1f62f3);}(_0x34b9,0xba));var _0x934b=function(_0x1c3e2f,_0x32239d){_0x1c3e2f=_0x1c3e2f-0x0;var _0x4a9b74=_0x34b9[_0x1c3e2f];return _0x4a9b74;};'use strict';var multer=require(_0x934b('0x0'));var util=require(_0x934b('0x1'));var path=require('path');var timeout=require(_0x934b('0x2'));var express=require('express');var router=express[_0x934b('0x3')]();var auth=require(_0x934b('0x4'));var interaction=require(_0x934b('0x5'));var config=require('../../config/environment');var controller=require(_0x934b('0x6'));router[_0x934b('0x7')]('/',auth[_0x934b('0x8')](),controller['index']);router[_0x934b('0x7')](_0x934b('0x9'),auth[_0x934b('0x8')](),controller[_0x934b('0xa')]);router[_0x934b('0x7')]('/:id/fields',auth[_0x934b('0x8')](),controller['getFields']);router[_0x934b('0x7')](_0x934b('0xb'),auth['isAuthenticated'](),controller[_0x934b('0xc')]);router[_0x934b('0x7')](_0x934b('0xd'),auth[_0x934b('0x8')](),controller[_0x934b('0xe')]);router[_0x934b('0x7')](_0x934b('0xf'),auth[_0x934b('0x8')](),controller[_0x934b('0x10')]);router['post']('/',auth[_0x934b('0x8')](),controller[_0x934b('0x11')]);router[_0x934b('0x12')](_0x934b('0xf'),auth[_0x934b('0x8')](),controller[_0x934b('0x13')]);router[_0x934b('0x14')](_0x934b('0x9'),auth[_0x934b('0x8')](),controller[_0x934b('0x15')]);router['delete']('/:id',auth[_0x934b('0x8')](),controller[_0x934b('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8f52=['post','create','put','destroy','exports','path','express','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8f52,0x1bd));var _0x28f5=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x8f52[_0x21aec3];return _0x288bbc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x28f5('0x0'));var timeout=require('connect-timeout');var express=require(_0x28f5('0x1'));var router=express[_0x28f5('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x28f5('0x3'));var config=require(_0x28f5('0x4'));var controller=require(_0x28f5('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x28f5('0x6')](_0x28f5('0x7'),auth[_0x28f5('0x8')](),controller[_0x28f5('0x9')]);router[_0x28f5('0x6')](_0x28f5('0xa'),auth[_0x28f5('0x8')](),controller[_0x28f5('0xb')]);router[_0x28f5('0x6')](_0x28f5('0xc'),auth[_0x28f5('0x8')](),controller[_0x28f5('0xd')]);router[_0x28f5('0x6')](_0x28f5('0xe'),auth[_0x28f5('0x8')](),controller[_0x28f5('0xf')]);router[_0x28f5('0x6')](_0x28f5('0x10'),auth['isAuthenticated'](),controller['getTags']);router[_0x28f5('0x11')]('/',auth[_0x28f5('0x8')](),controller[_0x28f5('0x12')]);router[_0x28f5('0x11')](_0x28f5('0x10'),auth[_0x28f5('0x8')](),controller['setTags']);router[_0x28f5('0x13')](_0x28f5('0x7'),auth[_0x28f5('0x8')](),controller['update']);router['delete'](_0x28f5('0x7'),auth[_0x28f5('0x8')](),controller[_0x28f5('0x14')]);module[_0x28f5('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 808e5cb..d70e160 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1155=['sequelize','exports','STRING'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x1155,0x108));var _0x5115=function(_0x2869f1,_0x57ffa1){_0x2869f1=_0x2869f1-0x0;var _0x5d87e3=_0x1155[_0x2869f1];return _0x5d87e3;};'use strict';var Sequelize=require(_0x5115('0x0'));module[_0x5115('0x1')]={'name':{'type':Sequelize[_0x5115('0x2')]},'description':{'type':Sequelize[_0x5115('0x2')]}}; \ No newline at end of file +var _0xd07e=['exports','STRING'];(function(_0x18b029,_0x20e00a){var _0x42fd10=function(_0x5ba217){while(--_0x5ba217){_0x18b029['push'](_0x18b029['shift']());}};_0x42fd10(++_0x20e00a);}(_0xd07e,0x6c));var _0xed07=function(_0x476ebb,_0x17a1aa){_0x476ebb=_0x476ebb-0x0;var _0x48618e=_0xd07e[_0x476ebb];return _0x48618e;};'use strict';var Sequelize=require('sequelize');module[_0xed07('0x0')]={'name':{'type':Sequelize[_0xed07('0x1')]},'description':{'type':Sequelize[_0xed07('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 871229c..fea4018 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','http','test','Sequelize','request','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','ZendeskConfiguration','includeAll','findAll','params','include','find','create','body','getFields','findOne','rawAttributes','pick','getSubjects','ZendeskField','getDescriptions','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x11e2be,_0x7f459){var _0x33d33f=function(_0x5241c9){while(--_0x5241c9){_0x11e2be['push'](_0x11e2be['shift']());}};_0x33d33f(++_0x7f459);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x5fc3[_0x5a7112];return _0x3147f7;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var as=require(_0x35fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x14'))(_0x35fc('0x15'));var utils=require('../../config/utils');var config=require(_0x35fc('0x16'));var db=require(_0x35fc('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x35fc('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5d462a,_0x397738,_0x22055e){if(_0x22055e){var _0x2a6ad2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a6ad2[_0x35fc('0x19')](_0x397738)){return _0x5d462a;}else{throw new db[(_0x35fc('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d462a;}}function respondWithRpcPromise(_0x5eac0f,_0x558364,_0x398b67,_0x229d56){return new BPromise(function(_0x53b898,_0x154958){var _0x227a49=_0x229d56||client;return _0x227a49[_0x35fc('0x1b')](_0x5eac0f,_0x398b67)['then'](function(_0x26ba54){logger[_0x35fc('0x1c')]('ZendeskConfiguration,\x20%s,\x20%s',_0x558364,_0x35fc('0x1d'));logger[_0x35fc('0x1e')](_0x35fc('0x1f'),_0x558364,'request\x20sent',JSON[_0x35fc('0x20')](_0x26ba54));if(_0x26ba54[_0x35fc('0x21')]){if(_0x26ba54[_0x35fc('0x21')]['code']===0x1f4){logger[_0x35fc('0x21')](_0x35fc('0x22'),_0x558364,_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);return _0x154958(_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);}logger[_0x35fc('0x21')](_0x35fc('0x22'),_0x558364,_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);return _0x53b898(_0x26ba54['error'][_0x35fc('0x23')]);}else{logger[_0x35fc('0x1c')](_0x35fc('0x22'),_0x558364,_0x35fc('0x1d'));_0x53b898(_0x26ba54[_0x35fc('0x24')]['message']);}})[_0x35fc('0x25')](function(_0x4c587a){logger['error'](_0x35fc('0x22'),_0x558364,_0x4c587a);_0x154958(_0x4c587a);});});}function respondWithStatusCode(_0x5a93df,_0x3d4a98){_0x3d4a98=_0x3d4a98||0xcc;return function(_0x51cfec){if(_0x51cfec){return _0x5a93df[_0x35fc('0x26')](_0x3d4a98);}return _0x5a93df['status'](_0x3d4a98)[_0x35fc('0x27')]();};}function respondWithResult(_0xdfab9f,_0x5cb986){_0x5cb986=_0x5cb986||0xc8;return function(_0x519264){if(_0x519264){return _0xdfab9f[_0x35fc('0x28')](_0x5cb986)['json'](_0x519264);}};}function respondWithFilteredResult(_0x274208,_0x1a5d92){return function(_0x57001c){if(_0x57001c){var _0x26b7cb=_0x57001c[_0x35fc('0x29')],_0x645eac=_0x1a5d92[_0x35fc('0x2a')],_0x383837=_0x1a5d92[_0x35fc('0x2a')]+_0x1a5d92[_0x35fc('0x2b')],_0x9f3c8a;if(_0x383837>=_0x26b7cb){_0x383837=_0x26b7cb;_0x9f3c8a=0xc8;}else{_0x9f3c8a=0xce;}_0x274208['status'](_0x9f3c8a);return _0x274208[_0x35fc('0x2c')](_0x35fc('0x2d'),_0x645eac+'-'+_0x383837+'/'+_0x26b7cb)[_0x35fc('0x2e')](_0x57001c);}return null;};}function patchUpdates(_0x52acc5){return function(_0xe79f52){try{jsonpatch[_0x35fc('0x2f')](_0xe79f52,_0x52acc5,!![]);}catch(_0x3822a8){return BPromise[_0x35fc('0x30')](_0x3822a8);}return _0xe79f52[_0x35fc('0x31')]();};}function saveUpdates(_0x103181,_0x222ddb){return function(_0x37b435){if(_0x37b435){return _0x37b435[_0x35fc('0x32')](_0x103181)[_0x35fc('0x33')](function(_0x57072d){return _0x57072d;});}return null;};}function removeEntity(_0x5e0313,_0x114bc1){return function(_0x4af5fe){if(_0x4af5fe){return _0x4af5fe[_0x35fc('0x34')]()[_0x35fc('0x33')](function(){_0x5e0313[_0x35fc('0x28')](0xcc)[_0x35fc('0x27')]();});}};}function handleEntityNotFound(_0x271ba9,_0x12e78f){return function(_0x4e43b4){if(!_0x4e43b4){_0x271ba9[_0x35fc('0x26')](0x194);}return _0x4e43b4;};}function handleError(_0x330a14,_0x46b9ef){_0x46b9ef=_0x46b9ef||0x1f4;return function(_0x4441d8){logger[_0x35fc('0x21')](_0x4441d8[_0x35fc('0x35')]);if(_0x4441d8['name']){delete _0x4441d8[_0x35fc('0x36')];}_0x330a14[_0x35fc('0x28')](_0x46b9ef)[_0x35fc('0x37')](_0x4441d8);};}exports['index']=function(_0x2c657d,_0x48d223){var _0x2ecb2e={},_0x33a377={},_0x266a11={'count':0x0,'rows':[]};var _0x2e00e3=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0x20f5fe){return{'name':_0x20f5fe['fieldName'],'type':_0x20f5fe[_0x35fc('0x38')]['key']};});_0x33a377[_0x35fc('0x39')]=_[_0x35fc('0x3a')](_0x2e00e3,_0x35fc('0x36'));_0x33a377[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x2c657d[_0x35fc('0x3b')]);_0x33a377[_0x35fc('0x3d')]=_['intersection'](_0x33a377[_0x35fc('0x39')],_0x33a377[_0x35fc('0x3b')]);_0x2ecb2e['attributes']=_[_0x35fc('0x3e')](_0x33a377[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x2ecb2e[_0x35fc('0x40')]=_0x2ecb2e['attributes'][_0x35fc('0x41')]?_0x2ecb2e[_0x35fc('0x40')]:_0x33a377[_0x35fc('0x39')];if(!_0x2c657d['query'][_0x35fc('0x42')](_0x35fc('0x43'))){_0x2ecb2e['limit']=qs[_0x35fc('0x2b')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x2ecb2e[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x2a')]);}_0x2ecb2e[_0x35fc('0x44')]=qs['sort'](_0x2c657d['query'][_0x35fc('0x45')]);_0x2ecb2e[_0x35fc('0x46')]=qs['filters'](_['pick'](_0x2c657d['query'],_0x33a377[_0x35fc('0x3d')]));if(_0x2c657d[_0x35fc('0x3b')]['filter']){_0x2ecb2e[_0x35fc('0x46')]=_[_0x35fc('0x47')](_0x2ecb2e[_0x35fc('0x46')],{'$or':_[_0x35fc('0x3a')](_0x2e00e3,function(_0x5c52be){if(_0x5c52be['type']!=='VIRTUAL'){var _0x539157={};_0x539157[_0x5c52be['name']]={'$like':'%'+_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x539157;}})});}_0x2ecb2e=_['merge']({},_0x2ecb2e,_0x2c657d[_0x35fc('0x49')]);var _0x56cf1f={'where':_0x2ecb2e[_0x35fc('0x46')]};return db[_0x35fc('0x4a')][_0x35fc('0x29')](_0x56cf1f)[_0x35fc('0x33')](function(_0x16f7c8){_0x266a11['count']=_0x16f7c8;if(_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x4b')]){_0x2ecb2e['include']=[{'all':!![]}];}return db[_0x35fc('0x4a')][_0x35fc('0x4c')](_0x2ecb2e);})[_0x35fc('0x33')](function(_0x211746){_0x266a11['rows']=_0x211746;return _0x266a11;})[_0x35fc('0x33')](respondWithFilteredResult(_0x48d223,_0x2ecb2e))['catch'](handleError(_0x48d223,null));};exports['show']=function(_0x1b6160,_0x9db7e8){var _0x18dc78={'raw':![],'where':{'id':_0x1b6160[_0x35fc('0x4d')]['id']}},_0xca8aef={};_0xca8aef[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x4a')]['rawAttributes']);_0xca8aef[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x1b6160[_0x35fc('0x3b')]);_0xca8aef[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0xca8aef[_0x35fc('0x39')],_0xca8aef[_0x35fc('0x3b')]);_0x18dc78[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0xca8aef[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x1b6160[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x18dc78[_0x35fc('0x40')]=_0x18dc78['attributes']['length']?_0x18dc78[_0x35fc('0x40')]:_0xca8aef[_0x35fc('0x39')];if(_0x1b6160[_0x35fc('0x3b')][_0x35fc('0x4b')]){_0x18dc78[_0x35fc('0x4e')]=[{'all':!![]}];}_0x18dc78=_[_0x35fc('0x47')]({},_0x18dc78,_0x1b6160['options']);return db['ZendeskConfiguration'][_0x35fc('0x4f')](_0x18dc78)[_0x35fc('0x33')](handleEntityNotFound(_0x9db7e8,null))[_0x35fc('0x33')](respondWithResult(_0x9db7e8,null))[_0x35fc('0x25')](handleError(_0x9db7e8,null));};exports['create']=function(_0x467980,_0x13281f){return db['ZendeskConfiguration'][_0x35fc('0x50')](_0x467980[_0x35fc('0x51')],{})['then'](respondWithResult(_0x13281f,0xc9))[_0x35fc('0x25')](handleError(_0x13281f,null));};exports[_0x35fc('0x32')]=function(_0x26118e,_0x18f18b){if(_0x26118e['body']['id']){delete _0x26118e['body']['id'];}return db['ZendeskConfiguration'][_0x35fc('0x4f')]({'where':{'id':_0x26118e[_0x35fc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x18f18b,null))[_0x35fc('0x33')](saveUpdates(_0x26118e[_0x35fc('0x51')],null))[_0x35fc('0x33')](respondWithResult(_0x18f18b,null))[_0x35fc('0x25')](handleError(_0x18f18b,null));};exports[_0x35fc('0x34')]=function(_0x538be0,_0x2d9d45){return db[_0x35fc('0x4a')][_0x35fc('0x4f')]({'where':{'id':_0x538be0['params']['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x2d9d45,null))[_0x35fc('0x33')](removeEntity(_0x2d9d45,null))['catch'](handleError(_0x2d9d45,null));};exports[_0x35fc('0x52')]=function(_0x164c7b,_0x1c46b1,_0x1c4c33){var _0x314666={};var _0x41453b={};var _0x8501d1;var _0x998fd9;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x164c7b[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x1c46b1,null))['then'](function(_0x243871){if(_0x243871){_0x8501d1=_0x243871;_0x41453b['model']=_['keys'](db['ZendeskField'][_0x35fc('0x54')]);_0x41453b[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x164c7b[_0x35fc('0x3b')]);_0x41453b[_0x35fc('0x3d')]=_['intersection'](_0x41453b['model'],_0x41453b['query']);_0x314666['attributes']=_['intersection'](_0x41453b[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x314666['attributes']=_0x314666[_0x35fc('0x40')][_0x35fc('0x41')]?_0x314666[_0x35fc('0x40')]:_0x41453b[_0x35fc('0x39')];_0x314666[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x314666[_0x35fc('0x46')]=qs['filters'](_[_0x35fc('0x55')](_0x164c7b['query'],_0x41453b[_0x35fc('0x3d')]));if(_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x314666[_0x35fc('0x46')]=_['merge'](_0x314666[_0x35fc('0x46')],{'$or':_['map'](_0x314666['attributes'],function(_0x5f1d4a){var _0x10dd1a={};_0x10dd1a[_0x5f1d4a]={'$like':'%'+_0x164c7b['query'][_0x35fc('0x48')]+'%'};return _0x10dd1a;})});}_0x314666=_['merge']({},_0x314666,_0x164c7b[_0x35fc('0x49')]);return _0x8501d1['getFields'](_0x314666);}})[_0x35fc('0x33')](function(_0x455b84){if(_0x455b84){_0x998fd9=_0x455b84[_0x35fc('0x41')];if(!_0x164c7b[_0x35fc('0x3b')]['hasOwnProperty'](_0x35fc('0x43'))){_0x314666[_0x35fc('0x2b')]=qs[_0x35fc('0x2b')](_0x164c7b['query'][_0x35fc('0x2b')]);_0x314666[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x8501d1[_0x35fc('0x52')](_0x314666);}})[_0x35fc('0x33')](function(_0x4464d5){if(_0x4464d5){return _0x4464d5?{'count':_0x998fd9,'rows':_0x4464d5}:null;}})['then'](respondWithResult(_0x1c46b1,null))[_0x35fc('0x25')](handleError(_0x1c46b1,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d,_0x1c88d8){var _0x1b76f0={};var _0x586729={};var _0x4d09d4;var _0x3969d3;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x2600d2[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x4a926d,null))[_0x35fc('0x33')](function(_0x1932c9){if(_0x1932c9){_0x4d09d4=_0x1932c9;_0x586729[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x57')][_0x35fc('0x54')]);_0x586729[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x2600d2[_0x35fc('0x3b')]);_0x586729[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0x586729[_0x35fc('0x39')],_0x586729[_0x35fc('0x3b')]);_0x1b76f0[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x586729[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x2600d2['query'][_0x35fc('0x3f')]));_0x1b76f0['attributes']=_0x1b76f0[_0x35fc('0x40')][_0x35fc('0x41')]?_0x1b76f0[_0x35fc('0x40')]:_0x586729[_0x35fc('0x39')];_0x1b76f0[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x1b76f0[_0x35fc('0x46')]=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x2600d2['query'],_0x586729[_0x35fc('0x3d')]));if(_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x1b76f0[_0x35fc('0x46')]=_[_0x35fc('0x47')](_0x1b76f0[_0x35fc('0x46')],{'$or':_['map'](_0x1b76f0[_0x35fc('0x40')],function(_0x3353e0){var _0x277514={};_0x277514[_0x3353e0]={'$like':'%'+_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x277514;})});}_0x1b76f0=_[_0x35fc('0x47')]({},_0x1b76f0,_0x2600d2[_0x35fc('0x49')]);return _0x4d09d4[_0x35fc('0x56')](_0x1b76f0);}})[_0x35fc('0x33')](function(_0x5f23d8){if(_0x5f23d8){_0x3969d3=_0x5f23d8[_0x35fc('0x41')];if(!_0x2600d2['query'][_0x35fc('0x42')](_0x35fc('0x43'))){_0x1b76f0['limit']=qs[_0x35fc('0x2b')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x1b76f0[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x4d09d4[_0x35fc('0x56')](_0x1b76f0);}})[_0x35fc('0x33')](function(_0x5806bf){if(_0x5806bf){return _0x5806bf?{'count':_0x3969d3,'rows':_0x5806bf}:null;}})['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports['getDescriptions']=function(_0x160a6f,_0x23cf84,_0x8fc410){var _0x1f5cbc={};var _0x35ef53={};var _0x4f535a;var _0x226fdf;return db[_0x35fc('0x4a')][_0x35fc('0x53')]({'where':{'id':_0x160a6f[_0x35fc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23cf84,null))[_0x35fc('0x33')](function(_0x3ddd21){if(_0x3ddd21){_0x4f535a=_0x3ddd21;_0x35ef53[_0x35fc('0x39')]=_['keys'](db[_0x35fc('0x57')][_0x35fc('0x54')]);_0x35ef53[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x160a6f[_0x35fc('0x3b')]);_0x35ef53[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0x35ef53[_0x35fc('0x39')],_0x35ef53['query']);_0x1f5cbc[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x35ef53[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x1f5cbc['attributes']=_0x1f5cbc[_0x35fc('0x40')]['length']?_0x1f5cbc['attributes']:_0x35ef53[_0x35fc('0x39')];_0x1f5cbc['order']=qs[_0x35fc('0x45')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x1f5cbc['where']=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x160a6f[_0x35fc('0x3b')],_0x35ef53[_0x35fc('0x3d')]));if(_0x160a6f[_0x35fc('0x3b')]['filter']){_0x1f5cbc['where']=_['merge'](_0x1f5cbc[_0x35fc('0x46')],{'$or':_['map'](_0x1f5cbc[_0x35fc('0x40')],function(_0x1824c2){var _0x391321={};_0x391321[_0x1824c2]={'$like':'%'+_0x160a6f[_0x35fc('0x3b')]['filter']+'%'};return _0x391321;})});}_0x1f5cbc=_[_0x35fc('0x47')]({},_0x1f5cbc,_0x160a6f[_0x35fc('0x49')]);return _0x4f535a[_0x35fc('0x58')](_0x1f5cbc);}})['then'](function(_0x128286){if(_0x128286){_0x226fdf=_0x128286[_0x35fc('0x41')];if(!_0x160a6f[_0x35fc('0x3b')]['hasOwnProperty']('nolimit')){_0x1f5cbc['limit']=qs[_0x35fc('0x2b')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x1f5cbc[_0x35fc('0x2a')]=qs['offset'](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x4f535a['getDescriptions'](_0x1f5cbc);}})['then'](function(_0x143c94){if(_0x143c94){return _0x143c94?{'count':_0x226fdf,'rows':_0x143c94}:null;}})[_0x35fc('0x33')](respondWithResult(_0x23cf84,null))[_0x35fc('0x25')](handleError(_0x23cf84,null));};exports['getTags']=function(_0x4dd05f,_0x134e60,_0x432ba4){var _0x4d5204={};var _0x3439de={};var _0x163edb;var _0x1d96c9;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x4dd05f[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x134e60,null))[_0x35fc('0x33')](function(_0x4fd676){if(_0x4fd676){_0x163edb=_0x4fd676;_0x3439de[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x59')]['rawAttributes']);_0x3439de[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x4dd05f[_0x35fc('0x3b')]);_0x3439de['filters']=_[_0x35fc('0x3e')](_0x3439de[_0x35fc('0x39')],_0x3439de['query']);_0x4d5204[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x3439de[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x4d5204[_0x35fc('0x40')]=_0x4d5204[_0x35fc('0x40')][_0x35fc('0x41')]?_0x4d5204['attributes']:_0x3439de[_0x35fc('0x39')];_0x4d5204[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x4dd05f[_0x35fc('0x3b')]['sort']);_0x4d5204[_0x35fc('0x46')]=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x4dd05f[_0x35fc('0x3b')],_0x3439de[_0x35fc('0x3d')]));if(_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x4d5204[_0x35fc('0x46')]=_['merge'](_0x4d5204['where'],{'$or':_[_0x35fc('0x3a')](_0x4d5204[_0x35fc('0x40')],function(_0x961ee9){var _0x4ebf4a={};_0x4ebf4a[_0x961ee9]={'$like':'%'+_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x4ebf4a;})});}_0x4d5204=_[_0x35fc('0x47')]({},_0x4d5204,_0x4dd05f[_0x35fc('0x49')]);return _0x163edb['getTags'](_0x4d5204);}})['then'](function(_0x379650){if(_0x379650){_0x1d96c9=_0x379650['length'];if(!_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x42')]('nolimit')){_0x4d5204['limit']=qs[_0x35fc('0x2b')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x4d5204['offset']=qs[_0x35fc('0x2a')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x163edb['getTags'](_0x4d5204);}})[_0x35fc('0x33')](function(_0x32cbd){if(_0x32cbd){return _0x32cbd?{'count':_0x1d96c9,'rows':_0x32cbd}:null;}})[_0x35fc('0x33')](respondWithResult(_0x134e60,null))[_0x35fc('0x25')](handleError(_0x134e60,null));};exports['setTags']=function(_0x451cb8,_0x347e06,_0x6f8054){if(_0x451cb8[_0x35fc('0x51')]['id']){delete _0x451cb8[_0x35fc('0x51')]['id'];}return db[_0x35fc('0x4a')]['findOne']({'where':{'id':_0x451cb8[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x347e06,null))['then'](function(_0x4c3253){if(_0x4c3253){return _0x4c3253[_0x35fc('0x5a')](_0x451cb8['body'][_0x35fc('0x5b')]||[]);}return null;})[_0x35fc('0x33')](respondWithResult(_0x347e06,null))[_0x35fc('0x25')](handleError(_0x347e06,null));}; \ No newline at end of file +var _0x814b=['filters','pick','merge','type','VIRTUAL','filter','options','ZendeskConfiguration','count','includeAll','include','findAll','rows','show','params','keys','find','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','ZendeskConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x51242f,_0x1ef04d){var _0x531265=function(_0x43a030){while(--_0x43a030){_0x51242f['push'](_0x51242f['shift']());}};_0x531265(++_0x1ef04d);}(_0x814b,0x1a2));var _0xb814=function(_0x44044a,_0x3a0097){_0x44044a=_0x44044a-0x0;var _0x43bb6e=_0x814b[_0x44044a];return _0x43bb6e;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];var jayson=require(_0xb814('0x1a'));var client=jayson[_0xb814('0x1b')][_0xb814('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2ce718,_0x3bde14,_0x1438e7){if(_0x1438e7){var _0x41ed7b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41ed7b[_0xb814('0x1d')](_0x3bde14)){return _0x2ce718;}else{throw new db[(_0xb814('0x1e'))][(_0xb814('0x1f'))](_0xb814('0x20'));}}else{return _0x2ce718;}}function respondWithRpcPromise(_0x17f5bd,_0x39bfcf,_0x303aca,_0x3a71d6){return new BPromise(function(_0x45e0d0,_0x265a83){var _0x125ce2=_0x3a71d6||client;return _0x125ce2[_0xb814('0x21')](_0x17f5bd,_0x303aca)[_0xb814('0x22')](function(_0x48c9df){logger[_0xb814('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39bfcf,_0xb814('0x24'));logger[_0xb814('0x25')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x39bfcf,'request\x20sent',JSON['stringify'](_0x48c9df));if(_0x48c9df[_0xb814('0x26')]){if(_0x48c9df['error']['code']===0x1f4){logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x48c9df[_0xb814('0x26')]['message']);return _0x265a83(_0x48c9df[_0xb814('0x26')]['message']);}logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x48c9df[_0xb814('0x26')][_0xb814('0x28')]);return _0x45e0d0(_0x48c9df[_0xb814('0x26')][_0xb814('0x28')]);}else{logger[_0xb814('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39bfcf,_0xb814('0x24'));_0x45e0d0(_0x48c9df['result'][_0xb814('0x28')]);}})[_0xb814('0x29')](function(_0x31c7ec){logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x31c7ec);_0x265a83(_0x31c7ec);});});}function respondWithStatusCode(_0xb9e57d,_0x3d836c){_0x3d836c=_0x3d836c||0xcc;return function(_0x5755ea){if(_0x5755ea){return _0xb9e57d[_0xb814('0x2a')](_0x3d836c);}return _0xb9e57d[_0xb814('0x2b')](_0x3d836c)[_0xb814('0x2c')]();};}function respondWithResult(_0x349394,_0x32ed56){_0x32ed56=_0x32ed56||0xc8;return function(_0x1d5965){if(_0x1d5965){return _0x349394[_0xb814('0x2b')](_0x32ed56)[_0xb814('0x2d')](_0x1d5965);}};}function respondWithFilteredResult(_0x5a6291,_0x271aa8){return function(_0x328a08){if(_0x328a08){var _0x52ed64=_0x328a08['count'],_0x9008b2=_0x271aa8[_0xb814('0x2e')],_0x37d24d=_0x271aa8[_0xb814('0x2e')]+_0x271aa8['limit'],_0x530744;if(_0x37d24d>=_0x52ed64){_0x37d24d=_0x52ed64;_0x530744=0xc8;}else{_0x530744=0xce;}_0x5a6291[_0xb814('0x2b')](_0x530744);return _0x5a6291['set'](_0xb814('0x2f'),_0x9008b2+'-'+_0x37d24d+'/'+_0x52ed64)['json'](_0x328a08);}return null;};}function patchUpdates(_0x4cfc58){return function(_0x419cd9){try{jsonpatch['apply'](_0x419cd9,_0x4cfc58,!![]);}catch(_0x2431e2){return BPromise[_0xb814('0x30')](_0x2431e2);}return _0x419cd9[_0xb814('0x31')]();};}function saveUpdates(_0x599f9f,_0x51d5ae){return function(_0x26d3a9){if(_0x26d3a9){return _0x26d3a9[_0xb814('0x32')](_0x599f9f)['then'](function(_0x2c8943){return _0x2c8943;});}return null;};}function removeEntity(_0xe558d5,_0x692c72){return function(_0x217b7e){if(_0x217b7e){return _0x217b7e[_0xb814('0x33')]()[_0xb814('0x22')](function(){_0xe558d5[_0xb814('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3207ec,_0x2263f6){return function(_0x30de5a){if(!_0x30de5a){_0x3207ec[_0xb814('0x2a')](0x194);}return _0x30de5a;};}function handleError(_0x14100d,_0x4ff31a){_0x4ff31a=_0x4ff31a||0x1f4;return function(_0x16ef82){logger['error'](_0x16ef82[_0xb814('0x34')]);if(_0x16ef82[_0xb814('0x35')]){delete _0x16ef82[_0xb814('0x35')];}_0x14100d['status'](_0x4ff31a)[_0xb814('0x36')](_0x16ef82);};}exports[_0xb814('0x37')]=function(_0x4ea6f8,_0x2fcd92){var _0x2d0e27={},_0x1a8bd0={},_0x1f7cd8={'count':0x0,'rows':[]};var _0xd77d96=_[_0xb814('0x38')](db['ZendeskConfiguration'][_0xb814('0x39')],function(_0x4e4684){return{'name':_0x4e4684[_0xb814('0x3a')],'type':_0x4e4684['type'][_0xb814('0x3b')]};});_0x1a8bd0['model']=_[_0xb814('0x38')](_0xd77d96,_0xb814('0x35'));_0x1a8bd0['query']=_['keys'](_0x4ea6f8['query']);_0x1a8bd0['filters']=_[_0xb814('0x3c')](_0x1a8bd0[_0xb814('0x3d')],_0x1a8bd0[_0xb814('0x3e')]);_0x2d0e27[_0xb814('0x3f')]=_['intersection'](_0x1a8bd0['model'],qs[_0xb814('0x40')](_0x4ea6f8['query'][_0xb814('0x40')]));_0x2d0e27[_0xb814('0x3f')]=_0x2d0e27[_0xb814('0x3f')][_0xb814('0x41')]?_0x2d0e27[_0xb814('0x3f')]:_0x1a8bd0[_0xb814('0x3d')];if(!_0x4ea6f8[_0xb814('0x3e')][_0xb814('0x42')](_0xb814('0x43'))){_0x2d0e27['limit']=qs['limit'](_0x4ea6f8['query'][_0xb814('0x44')]);_0x2d0e27['offset']=qs[_0xb814('0x2e')](_0x4ea6f8['query'][_0xb814('0x2e')]);}_0x2d0e27[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x4ea6f8[_0xb814('0x3e')]['sort']);_0x2d0e27[_0xb814('0x47')]=qs[_0xb814('0x48')](_[_0xb814('0x49')](_0x4ea6f8[_0xb814('0x3e')],_0x1a8bd0[_0xb814('0x48')]));if(_0x4ea6f8[_0xb814('0x3e')]['filter']){_0x2d0e27[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2d0e27[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0xd77d96,function(_0x46408b){if(_0x46408b[_0xb814('0x4b')]!==_0xb814('0x4c')){var _0x519545={};_0x519545[_0x46408b['name']]={'$like':'%'+_0x4ea6f8[_0xb814('0x3e')][_0xb814('0x4d')]+'%'};return _0x519545;}})});}_0x2d0e27=_[_0xb814('0x4a')]({},_0x2d0e27,_0x4ea6f8[_0xb814('0x4e')]);var _0x43f1b={'where':_0x2d0e27[_0xb814('0x47')]};return db[_0xb814('0x4f')][_0xb814('0x50')](_0x43f1b)[_0xb814('0x22')](function(_0x344198){_0x1f7cd8[_0xb814('0x50')]=_0x344198;if(_0x4ea6f8['query'][_0xb814('0x51')]){_0x2d0e27[_0xb814('0x52')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xb814('0x53')](_0x2d0e27);})['then'](function(_0x2fb0f7){_0x1f7cd8[_0xb814('0x54')]=_0x2fb0f7;return _0x1f7cd8;})[_0xb814('0x22')](respondWithFilteredResult(_0x2fcd92,_0x2d0e27))[_0xb814('0x29')](handleError(_0x2fcd92,null));};exports[_0xb814('0x55')]=function(_0x4096d4,_0x2cc806){var _0x45480e={'raw':![],'where':{'id':_0x4096d4[_0xb814('0x56')]['id']}},_0x32a397={};_0x32a397['model']=_['keys'](db[_0xb814('0x4f')][_0xb814('0x39')]);_0x32a397[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x4096d4[_0xb814('0x3e')]);_0x32a397[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x32a397['model'],_0x32a397[_0xb814('0x3e')]);_0x45480e[_0xb814('0x3f')]=_[_0xb814('0x3c')](_0x32a397['model'],qs[_0xb814('0x40')](_0x4096d4['query'][_0xb814('0x40')]));_0x45480e['attributes']=_0x45480e[_0xb814('0x3f')][_0xb814('0x41')]?_0x45480e['attributes']:_0x32a397[_0xb814('0x3d')];if(_0x4096d4[_0xb814('0x3e')][_0xb814('0x51')]){_0x45480e['include']=[{'all':!![]}];}_0x45480e=_[_0xb814('0x4a')]({},_0x45480e,_0x4096d4['options']);return db[_0xb814('0x4f')][_0xb814('0x58')](_0x45480e)['then'](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x22')](respondWithResult(_0x2cc806,null))['catch'](handleError(_0x2cc806,null));};exports['create']=function(_0x3b9709,_0x35f59a){return db[_0xb814('0x4f')]['create'](_0x3b9709[_0xb814('0x59')],{})['then'](respondWithResult(_0x35f59a,0xc9))[_0xb814('0x29')](handleError(_0x35f59a,null));};exports[_0xb814('0x32')]=function(_0x58d6e5,_0x2db5a6){if(_0x58d6e5['body']['id']){delete _0x58d6e5[_0xb814('0x59')]['id'];}return db[_0xb814('0x4f')][_0xb814('0x58')]({'where':{'id':_0x58d6e5[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x2db5a6,null))[_0xb814('0x22')](saveUpdates(_0x58d6e5[_0xb814('0x59')],null))[_0xb814('0x22')](respondWithResult(_0x2db5a6,null))['catch'](handleError(_0x2db5a6,null));};exports[_0xb814('0x33')]=function(_0x5441c5,_0x5d71d5){return db[_0xb814('0x4f')][_0xb814('0x58')]({'where':{'id':_0x5441c5['params']['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x5d71d5,null))['then'](removeEntity(_0x5d71d5,null))['catch'](handleError(_0x5d71d5,null));};exports[_0xb814('0x5a')]=function(_0x5257be,_0x3ff213,_0xd1cd8b){var _0x2dec52={};var _0x586957={};var _0x1a0ef4;var _0x4df65c;return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x5257be[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x3ff213,null))[_0xb814('0x22')](function(_0x3b374b){if(_0x3b374b){_0x1a0ef4=_0x3b374b;_0x586957[_0xb814('0x3d')]=_[_0xb814('0x57')](db[_0xb814('0x5c')]['rawAttributes']);_0x586957[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x5257be[_0xb814('0x3e')]);_0x586957[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x586957[_0xb814('0x3d')],_0x586957['query']);_0x2dec52[_0xb814('0x3f')]=_['intersection'](_0x586957[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x5257be[_0xb814('0x3e')]['fields']));_0x2dec52[_0xb814('0x3f')]=_0x2dec52['attributes'][_0xb814('0x41')]?_0x2dec52['attributes']:_0x586957[_0xb814('0x3d')];_0x2dec52[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x5257be[_0xb814('0x3e')][_0xb814('0x46')]);_0x2dec52[_0xb814('0x47')]=qs[_0xb814('0x48')](_['pick'](_0x5257be[_0xb814('0x3e')],_0x586957['filters']));if(_0x5257be[_0xb814('0x3e')][_0xb814('0x4d')]){_0x2dec52[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2dec52[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x2dec52['attributes'],function(_0x12882a){var _0x1a2603={};_0x1a2603[_0x12882a]={'$like':'%'+_0x5257be['query'][_0xb814('0x4d')]+'%'};return _0x1a2603;})});}_0x2dec52=_[_0xb814('0x4a')]({},_0x2dec52,_0x5257be[_0xb814('0x4e')]);return _0x1a0ef4[_0xb814('0x5a')](_0x2dec52);}})[_0xb814('0x22')](function(_0x51d834){if(_0x51d834){_0x4df65c=_0x51d834[_0xb814('0x41')];if(!_0x5257be['query'][_0xb814('0x42')](_0xb814('0x43'))){_0x2dec52[_0xb814('0x44')]=qs[_0xb814('0x44')](_0x5257be[_0xb814('0x3e')][_0xb814('0x44')]);_0x2dec52['offset']=qs['offset'](_0x5257be['query'][_0xb814('0x2e')]);}return _0x1a0ef4['getFields'](_0x2dec52);}})[_0xb814('0x22')](function(_0x1d3954){if(_0x1d3954){return _0x1d3954?{'count':_0x4df65c,'rows':_0x1d3954}:null;}})[_0xb814('0x22')](respondWithResult(_0x3ff213,null))['catch'](handleError(_0x3ff213,null));};exports[_0xb814('0x5d')]=function(_0x3e5ce8,_0xee204,_0x5aabbe){var _0x30f717={};var _0x1bf0b7={};var _0x1f39c0;var _0x3564e0;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3e5ce8[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0xee204,null))[_0xb814('0x22')](function(_0x408870){if(_0x408870){_0x1f39c0=_0x408870;_0x1bf0b7[_0xb814('0x3d')]=_[_0xb814('0x57')](db[_0xb814('0x5c')][_0xb814('0x39')]);_0x1bf0b7[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x3e5ce8[_0xb814('0x3e')]);_0x1bf0b7[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x1bf0b7[_0xb814('0x3d')],_0x1bf0b7[_0xb814('0x3e')]);_0x30f717['attributes']=_[_0xb814('0x3c')](_0x1bf0b7[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x40')]));_0x30f717[_0xb814('0x3f')]=_0x30f717['attributes'][_0xb814('0x41')]?_0x30f717['attributes']:_0x1bf0b7[_0xb814('0x3d')];_0x30f717[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x46')]);_0x30f717['where']=qs['filters'](_[_0xb814('0x49')](_0x3e5ce8[_0xb814('0x3e')],_0x1bf0b7[_0xb814('0x48')]));if(_0x3e5ce8[_0xb814('0x3e')]['filter']){_0x30f717[_0xb814('0x47')]=_['merge'](_0x30f717[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x30f717['attributes'],function(_0x58b016){var _0x2fa6b7={};_0x2fa6b7[_0x58b016]={'$like':'%'+_0x3e5ce8['query'][_0xb814('0x4d')]+'%'};return _0x2fa6b7;})});}_0x30f717=_[_0xb814('0x4a')]({},_0x30f717,_0x3e5ce8[_0xb814('0x4e')]);return _0x1f39c0[_0xb814('0x5d')](_0x30f717);}})[_0xb814('0x22')](function(_0x420bde){if(_0x420bde){_0x3564e0=_0x420bde[_0xb814('0x41')];if(!_0x3e5ce8['query'][_0xb814('0x42')]('nolimit')){_0x30f717[_0xb814('0x44')]=qs['limit'](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x44')]);_0x30f717['offset']=qs[_0xb814('0x2e')](_0x3e5ce8['query'][_0xb814('0x2e')]);}return _0x1f39c0[_0xb814('0x5d')](_0x30f717);}})['then'](function(_0x5a0c4a){if(_0x5a0c4a){return _0x5a0c4a?{'count':_0x3564e0,'rows':_0x5a0c4a}:null;}})[_0xb814('0x22')](respondWithResult(_0xee204,null))[_0xb814('0x29')](handleError(_0xee204,null));};exports[_0xb814('0x5e')]=function(_0x6f5e6a,_0x220f8b,_0x4394da){var _0x2b12a9={};var _0x314600={};var _0x8cb107;var _0x34f49c;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x6f5e6a['params']['id']}})['then'](handleEntityNotFound(_0x220f8b,null))['then'](function(_0x45a202){if(_0x45a202){_0x8cb107=_0x45a202;_0x314600[_0xb814('0x3d')]=_[_0xb814('0x57')](db['ZendeskField'][_0xb814('0x39')]);_0x314600[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x6f5e6a[_0xb814('0x3e')]);_0x314600[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x314600[_0xb814('0x3d')],_0x314600[_0xb814('0x3e')]);_0x2b12a9['attributes']=_[_0xb814('0x3c')](_0x314600[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x6f5e6a[_0xb814('0x3e')]['fields']));_0x2b12a9[_0xb814('0x3f')]=_0x2b12a9[_0xb814('0x3f')][_0xb814('0x41')]?_0x2b12a9[_0xb814('0x3f')]:_0x314600[_0xb814('0x3d')];_0x2b12a9['order']=qs['sort'](_0x6f5e6a[_0xb814('0x3e')]['sort']);_0x2b12a9[_0xb814('0x47')]=qs[_0xb814('0x48')](_['pick'](_0x6f5e6a[_0xb814('0x3e')],_0x314600['filters']));if(_0x6f5e6a[_0xb814('0x3e')]['filter']){_0x2b12a9[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2b12a9[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x2b12a9[_0xb814('0x3f')],function(_0x1ae812){var _0x455b22={};_0x455b22[_0x1ae812]={'$like':'%'+_0x6f5e6a['query']['filter']+'%'};return _0x455b22;})});}_0x2b12a9=_[_0xb814('0x4a')]({},_0x2b12a9,_0x6f5e6a['options']);return _0x8cb107['getDescriptions'](_0x2b12a9);}})[_0xb814('0x22')](function(_0x8fbda1){if(_0x8fbda1){_0x34f49c=_0x8fbda1[_0xb814('0x41')];if(!_0x6f5e6a['query'][_0xb814('0x42')]('nolimit')){_0x2b12a9[_0xb814('0x44')]=qs[_0xb814('0x44')](_0x6f5e6a[_0xb814('0x3e')][_0xb814('0x44')]);_0x2b12a9['offset']=qs[_0xb814('0x2e')](_0x6f5e6a[_0xb814('0x3e')][_0xb814('0x2e')]);}return _0x8cb107['getDescriptions'](_0x2b12a9);}})[_0xb814('0x22')](function(_0x3fc77d){if(_0x3fc77d){return _0x3fc77d?{'count':_0x34f49c,'rows':_0x3fc77d}:null;}})[_0xb814('0x22')](respondWithResult(_0x220f8b,null))['catch'](handleError(_0x220f8b,null));};exports[_0xb814('0x5f')]=function(_0x2d0651,_0x9dc06b,_0x216d67){var _0x40b3c5={};var _0x1ae8e8={};var _0x37a7ab;var _0x472c38;return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x2d0651[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x9dc06b,null))[_0xb814('0x22')](function(_0x5b8d2e){if(_0x5b8d2e){_0x37a7ab=_0x5b8d2e;_0x1ae8e8['model']=_[_0xb814('0x57')](db['Tag'][_0xb814('0x39')]);_0x1ae8e8[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x2d0651[_0xb814('0x3e')]);_0x1ae8e8[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x1ae8e8[_0xb814('0x3d')],_0x1ae8e8['query']);_0x40b3c5['attributes']=_[_0xb814('0x3c')](_0x1ae8e8['model'],qs[_0xb814('0x40')](_0x2d0651[_0xb814('0x3e')][_0xb814('0x40')]));_0x40b3c5['attributes']=_0x40b3c5[_0xb814('0x3f')][_0xb814('0x41')]?_0x40b3c5[_0xb814('0x3f')]:_0x1ae8e8[_0xb814('0x3d')];_0x40b3c5[_0xb814('0x45')]=qs['sort'](_0x2d0651[_0xb814('0x3e')][_0xb814('0x46')]);_0x40b3c5['where']=qs[_0xb814('0x48')](_[_0xb814('0x49')](_0x2d0651[_0xb814('0x3e')],_0x1ae8e8['filters']));if(_0x2d0651[_0xb814('0x3e')][_0xb814('0x4d')]){_0x40b3c5['where']=_[_0xb814('0x4a')](_0x40b3c5[_0xb814('0x47')],{'$or':_['map'](_0x40b3c5[_0xb814('0x3f')],function(_0x269832){var _0x3f4cbf={};_0x3f4cbf[_0x269832]={'$like':'%'+_0x2d0651[_0xb814('0x3e')][_0xb814('0x4d')]+'%'};return _0x3f4cbf;})});}_0x40b3c5=_[_0xb814('0x4a')]({},_0x40b3c5,_0x2d0651[_0xb814('0x4e')]);return _0x37a7ab[_0xb814('0x5f')](_0x40b3c5);}})[_0xb814('0x22')](function(_0x1f8c7a){if(_0x1f8c7a){_0x472c38=_0x1f8c7a[_0xb814('0x41')];if(!_0x2d0651[_0xb814('0x3e')]['hasOwnProperty']('nolimit')){_0x40b3c5[_0xb814('0x44')]=qs['limit'](_0x2d0651['query'][_0xb814('0x44')]);_0x40b3c5['offset']=qs['offset'](_0x2d0651['query'][_0xb814('0x2e')]);}return _0x37a7ab[_0xb814('0x5f')](_0x40b3c5);}})[_0xb814('0x22')](function(_0x5eb4b1){if(_0x5eb4b1){return _0x5eb4b1?{'count':_0x472c38,'rows':_0x5eb4b1}:null;}})[_0xb814('0x22')](respondWithResult(_0x9dc06b,null))['catch'](handleError(_0x9dc06b,null));};exports[_0xb814('0x60')]=function(_0x2e6660,_0x49a8de,_0x3c6a59){if(_0x2e6660['body']['id']){delete _0x2e6660[_0xb814('0x59')]['id'];}return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x2e6660[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x49a8de,null))[_0xb814('0x22')](function(_0x1f2ef8){if(_0x1f2ef8){return _0x1f2ef8[_0xb814('0x60')](_0x2e6660[_0xb814('0x59')][_0xb814('0x61')]||[]);}return null;})[_0xb814('0x22')](respondWithResult(_0x49a8de,null))[_0xb814('0x29')](handleError(_0x49a8de,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 440311e..71598a3 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d3d=['util','moment','request-promise','rimraf','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x3b5915,_0x50ac3c){var _0x19525d=function(_0x1beba5){while(--_0x1beba5){_0x3b5915['push'](_0x3b5915['shift']());}};_0x19525d(++_0x50ac3c);}(_0x3d3d,0x11f));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd3d3('0x0'));var util=require(_0xd3d3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd3d3('0x2'));var BPromise=require('bluebird');var rp=require(_0xd3d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3d3('0x4'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xd3d3('0x5')]=function(_0x49c524,_0x1a2e0d){return _0x49c524[_0xd3d3('0x6')](_0xd3d3('0x7'),attributes,{'tableName':_0xd3d3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bc5=['../../config/environment','exports','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x329e96,_0x2473df){var _0x1b9ecb=function(_0x12932c){while(--_0x12932c){_0x329e96['push'](_0x329e96['shift']());}};_0x1b9ecb(++_0x2473df);}(_0x7bc5,0x19b));var _0x57bc=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0x7bc5[_0x5c6994];return _0x1d5c84;};'use strict';var _=require(_0x57bc('0x0'));var util=require(_0x57bc('0x1'));var logger=require(_0x57bc('0x2'))(_0x57bc('0x3'));var moment=require(_0x57bc('0x4'));var BPromise=require('bluebird');var rp=require(_0x57bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57bc('0x6'));var config=require(_0x57bc('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x57bc('0x8')]=function(_0x3c0288,_0xf0259d){return _0x3c0288[_0x57bc('0x9')]('ZendeskConfiguration',attributes,{'tableName':_0x57bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 14af117..cd8094f 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26b9=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x3476fe,_0x115016){var _0xc704bd=function(_0x22ba51){while(--_0x22ba51){_0x3476fe['push'](_0x3476fe['shift']());}};_0xc704bd(++_0x115016);}(_0x26b9,0x1bd));var _0x926b=function(_0x36ecbb,_0x1d44d9){_0x36ecbb=_0x36ecbb-0x0;var _0x324b0e=_0x26b9[_0x36ecbb];return _0x324b0e;};'use strict';var _=require('lodash');var util=require(_0x926b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x926b('0x1'));var db=require(_0x926b('0x2'))['db'];var utils=require(_0x926b('0x3'));var logger=require(_0x926b('0x4'))(_0x926b('0x5'));var config=require(_0x926b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x926b('0x7')][_0x926b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x300697,_0xcd05b2,_0x1aacc2){return new BPromise(function(_0x44f59c,_0x5e0de7){return client['request'](_0x300697,_0x1aacc2)['then'](function(_0x42525a){logger[_0x926b('0x9')](_0x926b('0xa'),_0xcd05b2,_0x926b('0xb'));logger[_0x926b('0xc')](_0x926b('0xd'),_0xcd05b2,'request\x20sent',JSON['stringify'](_0x42525a));if(_0x42525a['error']){if(_0x42525a[_0x926b('0xe')][_0x926b('0xf')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xcd05b2,_0x42525a[_0x926b('0xe')]['message']);return _0x5e0de7(_0x42525a[_0x926b('0xe')][_0x926b('0x10')]);}logger[_0x926b('0xe')](_0x926b('0xa'),_0xcd05b2,_0x42525a[_0x926b('0xe')][_0x926b('0x10')]);return _0x44f59c(_0x42525a[_0x926b('0xe')]['message']);}else{logger[_0x926b('0x9')]('ZendeskConfiguration,\x20%s,\x20%s',_0xcd05b2,'request\x20sent');_0x44f59c(_0x42525a[_0x926b('0x11')][_0x926b('0x10')]);}})[_0x926b('0x12')](function(_0x1b5018){logger[_0x926b('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0xcd05b2,_0x1b5018);_0x5e0de7(_0x1b5018);});});} \ No newline at end of file +var _0xb361=['then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request'];(function(_0x1f7fea,_0x5d824d){var _0x44cdca=function(_0x3016cb){while(--_0x3016cb){_0x1f7fea['push'](_0x1f7fea['shift']());}};_0x44cdca(++_0x5d824d);}(_0xb361,0x96));var _0x1b36=function(_0x1debb6,_0x2ebb05){_0x1debb6=_0x1debb6-0x0;var _0x1cade3=_0xb361[_0x1debb6];return _0x1cade3;};'use strict';var _=require(_0x1b36('0x0'));var util=require('util');var moment=require(_0x1b36('0x1'));var BPromise=require(_0x1b36('0x2'));var rs=require(_0x1b36('0x3'));var fs=require('fs');var Redis=require(_0x1b36('0x4'));var db=require(_0x1b36('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b36('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1b36('0x7'));var client=jayson['client'][_0x1b36('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b6ebb,_0x120509,_0x142cf6){return new BPromise(function(_0x2d3ef1,_0x33058a){return client[_0x1b36('0x9')](_0x4b6ebb,_0x142cf6)[_0x1b36('0xa')](function(_0x1d0a6d){logger[_0x1b36('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x120509,_0x1b36('0xc'));logger['debug'](_0x1b36('0xd'),_0x120509,'request\x20sent',JSON[_0x1b36('0xe')](_0x1d0a6d));if(_0x1d0a6d['error']){if(_0x1d0a6d[_0x1b36('0xf')][_0x1b36('0x10')]===0x1f4){logger[_0x1b36('0xf')](_0x1b36('0x11'),_0x120509,_0x1d0a6d['error'][_0x1b36('0x12')]);return _0x33058a(_0x1d0a6d['error'][_0x1b36('0x12')]);}logger[_0x1b36('0xf')](_0x1b36('0x11'),_0x120509,_0x1d0a6d['error'][_0x1b36('0x12')]);return _0x2d3ef1(_0x1d0a6d[_0x1b36('0xf')][_0x1b36('0x12')]);}else{logger['info'](_0x1b36('0x11'),_0x120509,_0x1b36('0xc'));_0x2d3ef1(_0x1d0a6d[_0x1b36('0x13')][_0x1b36('0x12')]);}})['catch'](function(_0x299d80){logger[_0x1b36('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x120509,_0x299d80);_0x33058a(_0x299d80);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5231d42..309b9d9 100644 --- a/server/api/intZendeskField/index.js +++ b/server/api/intZendeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1268=['create','put','/:id','update','delete','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','post'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1268,0x141));var _0x8126=function(_0x46ad68,_0x142bb2){_0x46ad68=_0x46ad68-0x0;var _0x36cd1a=_0x1268[_0x46ad68];return _0x36cd1a;};'use strict';var multer=require('multer');var util=require(_0x8126('0x0'));var path=require(_0x8126('0x1'));var timeout=require(_0x8126('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8126('0x3'));var config=require(_0x8126('0x4'));var controller=require(_0x8126('0x5'));router[_0x8126('0x6')]('/',auth[_0x8126('0x7')](),controller['index']);router[_0x8126('0x6')]('/:id',auth[_0x8126('0x7')](),controller['show']);router[_0x8126('0x8')]('/',auth['isAuthenticated'](),controller[_0x8126('0x9')]);router[_0x8126('0xa')](_0x8126('0xb'),auth[_0x8126('0x7')](),controller[_0x8126('0xc')]);router[_0x8126('0xd')](_0x8126('0xb'),auth[_0x8126('0x7')](),controller['destroy']);module[_0x8126('0xe')]=router; \ No newline at end of file +var _0x394f=['post','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show'];(function(_0x4bccaf,_0x4bdf3d){var _0x4458b2=function(_0x1c2f7b){while(--_0x1c2f7b){_0x4bccaf['push'](_0x4bccaf['shift']());}};_0x4458b2(++_0x4bdf3d);}(_0x394f,0x8f));var _0xf394=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x394f[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xf394('0x0'));var util=require('util');var path=require(_0xf394('0x1'));var timeout=require(_0xf394('0x2'));var express=require(_0xf394('0x3'));var router=express[_0xf394('0x4')]();var auth=require(_0xf394('0x5'));var interaction=require(_0xf394('0x6'));var config=require(_0xf394('0x7'));var controller=require('./intZendeskField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf394('0x8'),auth[_0xf394('0x9')](),controller[_0xf394('0xa')]);router[_0xf394('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf394('0x8'),auth[_0xf394('0x9')](),controller[_0xf394('0xc')]);router['delete'](_0xf394('0x8'),auth[_0xf394('0x9')](),controller['destroy']);module[_0xf394('0xd')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 037e47f..4055914 100644 --- a/server/api/intZendeskField/intZendeskField.attributes.js +++ b/server/api/intZendeskField/intZendeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc743=['ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x45130e,_0x2c5fcc){var _0x32f498=function(_0x3ce497){while(--_0x3ce497){_0x45130e['push'](_0x45130e['shift']());}};_0x32f498(++_0x2c5fcc);}(_0xc743,0x103));var _0x3c74=function(_0x596baa,_0x5accf3){_0x596baa=_0x596baa-0x0;var _0x78b6b7=_0xc743[_0x596baa];return _0x78b6b7;};'use strict';var Sequelize=require(_0x3c74('0x0'));module[_0x3c74('0x1')]={'type':{'type':Sequelize[_0x3c74('0x2')]('string',_0x3c74('0x3'),_0x3c74('0x4'),_0x3c74('0x5')),'defaultValue':_0x3c74('0x6')},'content':{'type':Sequelize[_0x3c74('0x7')]},'key':{'type':Sequelize[_0x3c74('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3c74('0x3'),_0x3c74('0x4'))},'keyContent':{'type':Sequelize[_0x3c74('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3c74('0x7')]},'customField':{'type':Sequelize[_0x3c74('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3c74('0x7')]}}; \ No newline at end of file +var _0xc978=['string','variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x368336,_0x5c1893){var _0x543009=function(_0x47487){while(--_0x47487){_0x368336['push'](_0x368336['shift']());}};_0x543009(++_0x5c1893);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8c97('0x0'));module[_0x8c97('0x1')]={'type':{'type':Sequelize[_0x8c97('0x2')](_0x8c97('0x3'),_0x8c97('0x4'),_0x8c97('0x5'),'keyValue'),'defaultValue':_0x8c97('0x3')},'content':{'type':Sequelize[_0x8c97('0x6')]},'key':{'type':Sequelize[_0x8c97('0x6')]},'keyType':{'type':Sequelize[_0x8c97('0x2')](_0x8c97('0x3'),_0x8c97('0x4'),_0x8c97('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8c97('0x6')]},'nameField':{'type':Sequelize[_0x8c97('0x6')]},'customField':{'type':Sequelize[_0x8c97('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c97('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index c745adf..e951df6 100644 --- a/server/api/intZendeskField/intZendeskField.controller.js +++ b/server/api/intZendeskField/intZendeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc89f=['sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','ZendeskField','findAll','rows','catch','show','params','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x248f00,_0xcaea24){var _0x602156=function(_0x48540f){while(--_0x48540f){_0x248f00['push'](_0x248f00['shift']());}};_0x602156(++_0xcaea24);}(_0xc89f,0x18f));var _0xfc89=function(_0x336dbd,_0x21b342){_0x336dbd=_0x336dbd-0x0;var _0x5bcb06=_0xc89f[_0x336dbd];return _0x5bcb06;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc89('0x0'));var rimraf=require(_0xfc89('0x1'));var zipdir=require(_0xfc89('0x2'));var jsonpatch=require(_0xfc89('0x3'));var rp=require(_0xfc89('0x4'));var moment=require('moment');var BPromise=require(_0xfc89('0x5'));var Mustache=require(_0xfc89('0x6'));var util=require('util');var path=require(_0xfc89('0x7'));var sox=require(_0xfc89('0x8'));var csv=require(_0xfc89('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfc89('0xa'));var squel=require(_0xfc89('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfc89('0x9'));var querystring=require('querystring');var Papa=require(_0xfc89('0xc'));var Redis=require(_0xfc89('0xd'));var authService=require(_0xfc89('0xe'));var qs=require(_0xfc89('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc89('0x10'))(_0xfc89('0x11'));var utils=require(_0xfc89('0x12'));var config=require(_0xfc89('0x13'));var db=require(_0xfc89('0x14'))['db'];function respondWithStatusCode(_0x2fd07b,_0x2ff304){_0x2ff304=_0x2ff304||0xcc;return function(_0x503c0d){if(_0x503c0d){return _0x2fd07b[_0xfc89('0x15')](_0x2ff304);}return _0x2fd07b[_0xfc89('0x16')](_0x2ff304)[_0xfc89('0x17')]();};}function respondWithResult(_0x5cf537,_0x3db494){_0x3db494=_0x3db494||0xc8;return function(_0x110729){if(_0x110729){return _0x5cf537[_0xfc89('0x16')](_0x3db494)['json'](_0x110729);}};}function respondWithFilteredResult(_0xaf6cc7,_0xef4d1e){return function(_0x45bee4){if(_0x45bee4){var _0x5df849=_0x45bee4['count'],_0x7d101c=_0xef4d1e['offset'],_0x125160=_0xef4d1e[_0xfc89('0x18')]+_0xef4d1e['limit'],_0x1d3679;if(_0x125160>=_0x5df849){_0x125160=_0x5df849;_0x1d3679=0xc8;}else{_0x1d3679=0xce;}_0xaf6cc7[_0xfc89('0x16')](_0x1d3679);return _0xaf6cc7[_0xfc89('0x19')](_0xfc89('0x1a'),_0x7d101c+'-'+_0x125160+'/'+_0x5df849)[_0xfc89('0x1b')](_0x45bee4);}return null;};}function patchUpdates(_0x5ab185){return function(_0xdbe46){try{jsonpatch[_0xfc89('0x1c')](_0xdbe46,_0x5ab185,!![]);}catch(_0x4506f5){return BPromise[_0xfc89('0x1d')](_0x4506f5);}return _0xdbe46[_0xfc89('0x1e')]();};}function saveUpdates(_0x4130f8,_0x189321){return function(_0x889470){if(_0x889470){return _0x889470[_0xfc89('0x1f')](_0x4130f8)[_0xfc89('0x20')](function(_0x10e071){return _0x10e071;});}return null;};}function removeEntity(_0x459426,_0x2e40d6){return function(_0x319c43){if(_0x319c43){return _0x319c43[_0xfc89('0x21')]()[_0xfc89('0x20')](function(){_0x459426[_0xfc89('0x16')](0xcc)[_0xfc89('0x17')]();});}};}function handleEntityNotFound(_0x252271,_0x37450){return function(_0x3fd1aa){if(!_0x3fd1aa){_0x252271[_0xfc89('0x15')](0x194);}return _0x3fd1aa;};}function handleError(_0x2ab3fe,_0x541992){_0x541992=_0x541992||0x1f4;return function(_0x237e20){logger[_0xfc89('0x22')](_0x237e20[_0xfc89('0x23')]);if(_0x237e20['name']){delete _0x237e20[_0xfc89('0x24')];}_0x2ab3fe['status'](_0x541992)[_0xfc89('0x25')](_0x237e20);};}exports['index']=function(_0x147f93,_0x5f3bad){var _0x13df11={},_0x334c02={},_0xbd4fe1={'count':0x0,'rows':[]};var _0x2321ac=_[_0xfc89('0x26')](db['ZendeskField'][_0xfc89('0x27')],function(_0x59f8b0){return{'name':_0x59f8b0['fieldName'],'type':_0x59f8b0[_0xfc89('0x28')][_0xfc89('0x29')]};});_0x334c02[_0xfc89('0x2a')]=_['map'](_0x2321ac,_0xfc89('0x24'));_0x334c02[_0xfc89('0x2b')]=_[_0xfc89('0x2c')](_0x147f93[_0xfc89('0x2b')]);_0x334c02[_0xfc89('0x2d')]=_[_0xfc89('0x2e')](_0x334c02[_0xfc89('0x2a')],_0x334c02[_0xfc89('0x2b')]);_0x13df11[_0xfc89('0x2f')]=_['intersection'](_0x334c02[_0xfc89('0x2a')],qs[_0xfc89('0x30')](_0x147f93['query']['fields']));_0x13df11['attributes']=_0x13df11[_0xfc89('0x2f')]['length']?_0x13df11[_0xfc89('0x2f')]:_0x334c02[_0xfc89('0x2a')];if(!_0x147f93['query']['hasOwnProperty'](_0xfc89('0x31'))){_0x13df11[_0xfc89('0x32')]=qs[_0xfc89('0x32')](_0x147f93[_0xfc89('0x2b')][_0xfc89('0x32')]);_0x13df11[_0xfc89('0x18')]=qs[_0xfc89('0x18')](_0x147f93[_0xfc89('0x2b')][_0xfc89('0x18')]);}_0x13df11[_0xfc89('0x33')]=qs[_0xfc89('0x34')](_0x147f93[_0xfc89('0x2b')][_0xfc89('0x34')]);_0x13df11[_0xfc89('0x35')]=qs['filters'](_['pick'](_0x147f93[_0xfc89('0x2b')],_0x334c02['filters']));if(_0x147f93[_0xfc89('0x2b')][_0xfc89('0x36')]){_0x13df11['where']=_[_0xfc89('0x37')](_0x13df11[_0xfc89('0x35')],{'$or':_[_0xfc89('0x26')](_0x2321ac,function(_0x1fc286){if(_0x1fc286['type']!==_0xfc89('0x38')){var _0x2b0699={};_0x2b0699[_0x1fc286[_0xfc89('0x24')]]={'$like':'%'+_0x147f93[_0xfc89('0x2b')][_0xfc89('0x36')]+'%'};return _0x2b0699;}})});}_0x13df11=_['merge']({},_0x13df11,_0x147f93['options']);var _0x471683={'where':_0x13df11[_0xfc89('0x35')]};return db['ZendeskField'][_0xfc89('0x39')](_0x471683)['then'](function(_0x46f4cc){_0xbd4fe1[_0xfc89('0x39')]=_0x46f4cc;if(_0x147f93['query'][_0xfc89('0x3a')]){_0x13df11['include']=[{'all':!![]}];}return db[_0xfc89('0x3b')][_0xfc89('0x3c')](_0x13df11);})[_0xfc89('0x20')](function(_0x3bd8cd){_0xbd4fe1[_0xfc89('0x3d')]=_0x3bd8cd;return _0xbd4fe1;})[_0xfc89('0x20')](respondWithFilteredResult(_0x5f3bad,_0x13df11))[_0xfc89('0x3e')](handleError(_0x5f3bad,null));};exports[_0xfc89('0x3f')]=function(_0x26f22c,_0x597861){var _0x16317c={'raw':!![],'where':{'id':_0x26f22c[_0xfc89('0x40')]['id']}},_0x5dc1bb={};_0x5dc1bb[_0xfc89('0x2a')]=_['keys'](db['ZendeskField'][_0xfc89('0x27')]);_0x5dc1bb[_0xfc89('0x2b')]=_[_0xfc89('0x2c')](_0x26f22c[_0xfc89('0x2b')]);_0x5dc1bb['filters']=_[_0xfc89('0x2e')](_0x5dc1bb[_0xfc89('0x2a')],_0x5dc1bb[_0xfc89('0x2b')]);_0x16317c[_0xfc89('0x2f')]=_[_0xfc89('0x2e')](_0x5dc1bb[_0xfc89('0x2a')],qs[_0xfc89('0x30')](_0x26f22c[_0xfc89('0x2b')][_0xfc89('0x30')]));_0x16317c['attributes']=_0x16317c[_0xfc89('0x2f')][_0xfc89('0x41')]?_0x16317c[_0xfc89('0x2f')]:_0x5dc1bb[_0xfc89('0x2a')];if(_0x26f22c[_0xfc89('0x2b')][_0xfc89('0x3a')]){_0x16317c[_0xfc89('0x42')]=[{'all':!![]}];}_0x16317c=_[_0xfc89('0x37')]({},_0x16317c,_0x26f22c['options']);return db[_0xfc89('0x3b')][_0xfc89('0x43')](_0x16317c)[_0xfc89('0x20')](handleEntityNotFound(_0x597861,null))[_0xfc89('0x20')](respondWithResult(_0x597861,null))[_0xfc89('0x3e')](handleError(_0x597861,null));};exports[_0xfc89('0x44')]=function(_0xd6e288,_0x22cd10){return db[_0xfc89('0x3b')][_0xfc89('0x44')](_0xd6e288[_0xfc89('0x45')],{})[_0xfc89('0x20')](respondWithResult(_0x22cd10,0xc9))[_0xfc89('0x3e')](handleError(_0x22cd10,null));};exports[_0xfc89('0x1f')]=function(_0x1942c1,_0x1f0d29){if(_0x1942c1['body']['id']){delete _0x1942c1['body']['id'];}return db[_0xfc89('0x3b')][_0xfc89('0x43')]({'where':{'id':_0x1942c1[_0xfc89('0x40')]['id']}})[_0xfc89('0x20')](handleEntityNotFound(_0x1f0d29,null))[_0xfc89('0x20')](saveUpdates(_0x1942c1[_0xfc89('0x45')],null))[_0xfc89('0x20')](respondWithResult(_0x1f0d29,null))[_0xfc89('0x3e')](handleError(_0x1f0d29,null));};exports['destroy']=function(_0x53271a,_0x418f4f){return db['ZendeskField']['find']({'where':{'id':_0x53271a[_0xfc89('0x40')]['id']}})[_0xfc89('0x20')](handleEntityNotFound(_0x418f4f,null))[_0xfc89('0x20')](removeEntity(_0x418f4f,null))[_0xfc89('0x3e')](handleError(_0x418f4f,null));}; \ No newline at end of file +var _0x7594=['status','json','count','offset','set','apply','reject','update','then','end','stack','name','send','index','map','ZendeskField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x36375a,_0x43ede3){var _0xe646d0=function(_0x4e9ea2){while(--_0x4e9ea2){_0x36375a['push'](_0x36375a['shift']());}};_0xe646d0(++_0x43ede3);}(_0x7594,0x19d));var _0x4759=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x7594[_0x48d6a3];return _0x38bfa0;};'use strict';var pdf=require(_0x4759('0x0'));var emlformat=require(_0x4759('0x1'));var rimraf=require(_0x4759('0x2'));var zipdir=require(_0x4759('0x3'));var jsonpatch=require(_0x4759('0x4'));var rp=require('request-promise');var moment=require(_0x4759('0x5'));var BPromise=require(_0x4759('0x6'));var Mustache=require('mustache');var util=require(_0x4759('0x7'));var path=require(_0x4759('0x8'));var sox=require(_0x4759('0x9'));var csv=require(_0x4759('0xa'));var ejs=require(_0x4759('0xb'));var fs=require('fs');var _=require(_0x4759('0xc'));var squel=require('squel');var crypto=require(_0x4759('0xd'));var jsforce=require(_0x4759('0xe'));var deskjs=require(_0x4759('0xf'));var toCsv=require(_0x4759('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4759('0x10'));var authService=require(_0x4759('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4759('0x12'));var hardwareService=require(_0x4759('0x13'));var logger=require(_0x4759('0x14'))(_0x4759('0x15'));var utils=require('../../config/utils');var config=require(_0x4759('0x16'));var db=require(_0x4759('0x17'))['db'];function respondWithStatusCode(_0x25460e,_0x915611){_0x915611=_0x915611||0xcc;return function(_0x519a53){if(_0x519a53){return _0x25460e[_0x4759('0x18')](_0x915611);}return _0x25460e[_0x4759('0x19')](_0x915611)['end']();};}function respondWithResult(_0x2ddd16,_0xf98f5c){_0xf98f5c=_0xf98f5c||0xc8;return function(_0x4a9ea9){if(_0x4a9ea9){return _0x2ddd16[_0x4759('0x19')](_0xf98f5c)[_0x4759('0x1a')](_0x4a9ea9);}};}function respondWithFilteredResult(_0x54f06a,_0x57b571){return function(_0x19590c){if(_0x19590c){var _0x123fd6=_0x19590c[_0x4759('0x1b')],_0x3562ce=_0x57b571[_0x4759('0x1c')],_0x50535b=_0x57b571[_0x4759('0x1c')]+_0x57b571['limit'],_0x2b1c46;if(_0x50535b>=_0x123fd6){_0x50535b=_0x123fd6;_0x2b1c46=0xc8;}else{_0x2b1c46=0xce;}_0x54f06a['status'](_0x2b1c46);return _0x54f06a[_0x4759('0x1d')]('Content-Range',_0x3562ce+'-'+_0x50535b+'/'+_0x123fd6)[_0x4759('0x1a')](_0x19590c);}return null;};}function patchUpdates(_0x498b13){return function(_0x443f84){try{jsonpatch[_0x4759('0x1e')](_0x443f84,_0x498b13,!![]);}catch(_0x23b276){return BPromise[_0x4759('0x1f')](_0x23b276);}return _0x443f84['save']();};}function saveUpdates(_0x289410,_0x49cd30){return function(_0x2e9407){if(_0x2e9407){return _0x2e9407[_0x4759('0x20')](_0x289410)[_0x4759('0x21')](function(_0x5a95ae){return _0x5a95ae;});}return null;};}function removeEntity(_0x5d3a00,_0x320254){return function(_0x1a844d){if(_0x1a844d){return _0x1a844d['destroy']()[_0x4759('0x21')](function(){_0x5d3a00[_0x4759('0x19')](0xcc)[_0x4759('0x22')]();});}};}function handleEntityNotFound(_0x185fbe,_0x5d193f){return function(_0x96206c){if(!_0x96206c){_0x185fbe[_0x4759('0x18')](0x194);}return _0x96206c;};}function handleError(_0x19e5bf,_0x454927){_0x454927=_0x454927||0x1f4;return function(_0x5e4894){logger['error'](_0x5e4894[_0x4759('0x23')]);if(_0x5e4894[_0x4759('0x24')]){delete _0x5e4894[_0x4759('0x24')];}_0x19e5bf[_0x4759('0x19')](_0x454927)[_0x4759('0x25')](_0x5e4894);};}exports[_0x4759('0x26')]=function(_0x16547f,_0x5cdf00){var _0x3d91b8={},_0x5dbfe9={},_0x565760={'count':0x0,'rows':[]};var _0xd9a641=_[_0x4759('0x27')](db[_0x4759('0x28')]['rawAttributes'],function(_0x28d008){return{'name':_0x28d008[_0x4759('0x29')],'type':_0x28d008[_0x4759('0x2a')]['key']};});_0x5dbfe9[_0x4759('0x2b')]=_[_0x4759('0x27')](_0xd9a641,_0x4759('0x24'));_0x5dbfe9[_0x4759('0x2c')]=_[_0x4759('0x2d')](_0x16547f[_0x4759('0x2c')]);_0x5dbfe9[_0x4759('0x2e')]=_[_0x4759('0x2f')](_0x5dbfe9[_0x4759('0x2b')],_0x5dbfe9[_0x4759('0x2c')]);_0x3d91b8[_0x4759('0x30')]=_[_0x4759('0x2f')](_0x5dbfe9[_0x4759('0x2b')],qs[_0x4759('0x31')](_0x16547f[_0x4759('0x2c')]['fields']));_0x3d91b8[_0x4759('0x30')]=_0x3d91b8[_0x4759('0x30')][_0x4759('0x32')]?_0x3d91b8[_0x4759('0x30')]:_0x5dbfe9[_0x4759('0x2b')];if(!_0x16547f[_0x4759('0x2c')][_0x4759('0x33')](_0x4759('0x34'))){_0x3d91b8['limit']=qs[_0x4759('0x35')](_0x16547f['query']['limit']);_0x3d91b8[_0x4759('0x1c')]=qs[_0x4759('0x1c')](_0x16547f[_0x4759('0x2c')][_0x4759('0x1c')]);}_0x3d91b8[_0x4759('0x36')]=qs[_0x4759('0x37')](_0x16547f['query']['sort']);_0x3d91b8['where']=qs[_0x4759('0x2e')](_[_0x4759('0x38')](_0x16547f[_0x4759('0x2c')],_0x5dbfe9[_0x4759('0x2e')]));if(_0x16547f[_0x4759('0x2c')][_0x4759('0x39')]){_0x3d91b8[_0x4759('0x3a')]=_[_0x4759('0x3b')](_0x3d91b8[_0x4759('0x3a')],{'$or':_[_0x4759('0x27')](_0xd9a641,function(_0x5b5be2){if(_0x5b5be2[_0x4759('0x2a')]!==_0x4759('0x3c')){var _0x2612d9={};_0x2612d9[_0x5b5be2[_0x4759('0x24')]]={'$like':'%'+_0x16547f[_0x4759('0x2c')][_0x4759('0x39')]+'%'};return _0x2612d9;}})});}_0x3d91b8=_[_0x4759('0x3b')]({},_0x3d91b8,_0x16547f[_0x4759('0x3d')]);var _0x5c6f4d={'where':_0x3d91b8['where']};return db[_0x4759('0x28')][_0x4759('0x1b')](_0x5c6f4d)[_0x4759('0x21')](function(_0x3602cc){_0x565760[_0x4759('0x1b')]=_0x3602cc;if(_0x16547f[_0x4759('0x2c')][_0x4759('0x3e')]){_0x3d91b8['include']=[{'all':!![]}];}return db[_0x4759('0x28')][_0x4759('0x3f')](_0x3d91b8);})[_0x4759('0x21')](function(_0x2ab23c){_0x565760['rows']=_0x2ab23c;return _0x565760;})['then'](respondWithFilteredResult(_0x5cdf00,_0x3d91b8))[_0x4759('0x40')](handleError(_0x5cdf00,null));};exports[_0x4759('0x41')]=function(_0xcce717,_0x135aa0){var _0x154275={'raw':!![],'where':{'id':_0xcce717[_0x4759('0x42')]['id']}},_0x14d420={};_0x14d420[_0x4759('0x2b')]=_['keys'](db['ZendeskField'][_0x4759('0x43')]);_0x14d420['query']=_[_0x4759('0x2d')](_0xcce717[_0x4759('0x2c')]);_0x14d420[_0x4759('0x2e')]=_[_0x4759('0x2f')](_0x14d420[_0x4759('0x2b')],_0x14d420[_0x4759('0x2c')]);_0x154275['attributes']=_[_0x4759('0x2f')](_0x14d420['model'],qs[_0x4759('0x31')](_0xcce717[_0x4759('0x2c')]['fields']));_0x154275[_0x4759('0x30')]=_0x154275[_0x4759('0x30')][_0x4759('0x32')]?_0x154275[_0x4759('0x30')]:_0x14d420[_0x4759('0x2b')];if(_0xcce717[_0x4759('0x2c')][_0x4759('0x3e')]){_0x154275[_0x4759('0x44')]=[{'all':!![]}];}_0x154275=_[_0x4759('0x3b')]({},_0x154275,_0xcce717[_0x4759('0x3d')]);return db[_0x4759('0x28')]['find'](_0x154275)[_0x4759('0x21')](handleEntityNotFound(_0x135aa0,null))[_0x4759('0x21')](respondWithResult(_0x135aa0,null))[_0x4759('0x40')](handleError(_0x135aa0,null));};exports[_0x4759('0x45')]=function(_0x202da1,_0x2a5e0d){return db[_0x4759('0x28')]['create'](_0x202da1['body'],{})[_0x4759('0x21')](respondWithResult(_0x2a5e0d,0xc9))['catch'](handleError(_0x2a5e0d,null));};exports['update']=function(_0x50974a,_0x1ba339){if(_0x50974a[_0x4759('0x46')]['id']){delete _0x50974a['body']['id'];}return db[_0x4759('0x28')][_0x4759('0x47')]({'where':{'id':_0x50974a[_0x4759('0x42')]['id']}})[_0x4759('0x21')](handleEntityNotFound(_0x1ba339,null))['then'](saveUpdates(_0x50974a[_0x4759('0x46')],null))[_0x4759('0x21')](respondWithResult(_0x1ba339,null))['catch'](handleError(_0x1ba339,null));};exports[_0x4759('0x48')]=function(_0x29cce5,_0x96b1fc){return db[_0x4759('0x28')][_0x4759('0x47')]({'where':{'id':_0x29cce5['params']['id']}})[_0x4759('0x21')](handleEntityNotFound(_0x96b1fc,null))[_0x4759('0x21')](removeEntity(_0x96b1fc,null))[_0x4759('0x40')](handleError(_0x96b1fc,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 46c194a..630956b 100644 --- a/server/api/intZendeskField/intZendeskField.model.js +++ b/server/api/intZendeskField/intZendeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x720c=['path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5f23ca,_0x40ec02){var _0x50e3cd=function(_0x48a8ac){while(--_0x48a8ac){_0x5f23ca['push'](_0x5f23ca['shift']());}};_0x50e3cd(++_0x40ec02);}(_0x720c,0x154));var _0xc720=function(_0x274a03,_0xa661ae){_0x274a03=_0x274a03-0x0;var _0x53b6dc=_0x720c[_0x274a03];return _0x53b6dc;};'use strict';var _=require(_0xc720('0x0'));var util=require('util');var logger=require(_0xc720('0x1'))(_0xc720('0x2'));var moment=require(_0xc720('0x3'));var BPromise=require(_0xc720('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc720('0x5'));var rimraf=require(_0xc720('0x6'));var config=require(_0xc720('0x7'));var attributes=require(_0xc720('0x8'));module[_0xc720('0x9')]=function(_0x6f8d9f,_0x7d6830){return _0x6f8d9f['define'](_0xc720('0xa'),attributes,{'tableName':_0xc720('0xb'),'paranoid':![],'indexes':[{'name':_0xc720('0xc'),'fields':[_0xc720('0xd'),_0xc720('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd110=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','idField','FieldId','lodash','util'];(function(_0x57f9c0,_0x5496a8){var _0x409bd0=function(_0x56a8fc){while(--_0x56a8fc){_0x57f9c0['push'](_0x57f9c0['shift']());}};_0x409bd0(++_0x5496a8);}(_0xd110,0x1e8));var _0x0d11=function(_0x2e31ff,_0x36289f){_0x2e31ff=_0x2e31ff-0x0;var _0x395754=_0xd110[_0x2e31ff];return _0x395754;};'use strict';var _=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var logger=require(_0x0d11('0x2'))('api');var moment=require(_0x0d11('0x3'));var BPromise=require(_0x0d11('0x4'));var rp=require(_0x0d11('0x5'));var fs=require('fs');var path=require(_0x0d11('0x6'));var rimraf=require(_0x0d11('0x7'));var config=require(_0x0d11('0x8'));var attributes=require(_0x0d11('0x9'));module[_0x0d11('0xa')]=function(_0x578537,_0xf61dad){return _0x578537['define'](_0x0d11('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x0d11('0xc'),_0x0d11('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 8b2d094..d61dbd4 100644 --- a/server/api/intZendeskField/intZendeskField.rpc.js +++ b/server/api/intZendeskField/intZendeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d33=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x0d33,0x136));var _0x30d3=function(_0x5a2674,_0x1c7e75){_0x5a2674=_0x5a2674-0x0;var _0x48c89c=_0x0d33[_0x5a2674];return _0x48c89c;};'use strict';var _=require(_0x30d3('0x0'));var util=require(_0x30d3('0x1'));var moment=require('moment');var BPromise=require(_0x30d3('0x2'));var rs=require(_0x30d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30d3('0x4'))['db'];var utils=require(_0x30d3('0x5'));var logger=require(_0x30d3('0x6'))(_0x30d3('0x7'));var config=require(_0x30d3('0x8'));var jayson=require(_0x30d3('0x9'));var client=jayson[_0x30d3('0xa')][_0x30d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4037c5,_0x2f5d47,_0x19612b){return new BPromise(function(_0x2bc640,_0x467b9c){return client[_0x30d3('0xc')](_0x4037c5,_0x19612b)[_0x30d3('0xd')](function(_0x160f6b){logger[_0x30d3('0xe')](_0x30d3('0xf'),_0x2f5d47,_0x30d3('0x10'));logger['debug'](_0x30d3('0x11'),_0x2f5d47,_0x30d3('0x10'),JSON['stringify'](_0x160f6b));if(_0x160f6b[_0x30d3('0x12')]){if(_0x160f6b['error']['code']===0x1f4){logger[_0x30d3('0x12')](_0x30d3('0xf'),_0x2f5d47,_0x160f6b[_0x30d3('0x12')]['message']);return _0x467b9c(_0x160f6b[_0x30d3('0x12')][_0x30d3('0x13')]);}logger[_0x30d3('0x12')](_0x30d3('0xf'),_0x2f5d47,_0x160f6b[_0x30d3('0x12')][_0x30d3('0x13')]);return _0x2bc640(_0x160f6b[_0x30d3('0x12')]['message']);}else{logger[_0x30d3('0xe')](_0x30d3('0xf'),_0x2f5d47,_0x30d3('0x10'));_0x2bc640(_0x160f6b[_0x30d3('0x14')]['message']);}})[_0x30d3('0x15')](function(_0x507b44){logger[_0x30d3('0x12')](_0x30d3('0xf'),_0x2f5d47,_0x507b44);_0x467b9c(_0x507b44);});});} \ No newline at end of file +var _0x5ece=['request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','info','ZendeskField,\x20%s,\x20%s'];(function(_0x5a9829,_0x220713){var _0x2f1832=function(_0x3ff7a6){while(--_0x3ff7a6){_0x5a9829['push'](_0x5a9829['shift']());}};_0x2f1832(++_0x220713);}(_0x5ece,0xbc));var _0xe5ec=function(_0x1d3227,_0x752cca){_0x1d3227=_0x1d3227-0x0;var _0x4c007e=_0x5ece[_0x1d3227];return _0x4c007e;};'use strict';var _=require(_0xe5ec('0x0'));var util=require(_0xe5ec('0x1'));var moment=require(_0xe5ec('0x2'));var BPromise=require(_0xe5ec('0x3'));var rs=require(_0xe5ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5ec('0x5'))['db'];var utils=require(_0xe5ec('0x6'));var logger=require('../../config/logger')(_0xe5ec('0x7'));var config=require(_0xe5ec('0x8'));var jayson=require(_0xe5ec('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x80b02b,_0x1f7d9e,_0x4c8b22){return new BPromise(function(_0x49f473,_0xf71190){return client['request'](_0x80b02b,_0x4c8b22)['then'](function(_0x522856){logger[_0xe5ec('0xa')](_0xe5ec('0xb'),_0x1f7d9e,_0xe5ec('0xc'));logger['debug'](_0xe5ec('0xd'),_0x1f7d9e,_0xe5ec('0xc'),JSON[_0xe5ec('0xe')](_0x522856));if(_0x522856[_0xe5ec('0xf')]){if(_0x522856[_0xe5ec('0xf')][_0xe5ec('0x10')]===0x1f4){logger[_0xe5ec('0xf')](_0xe5ec('0xb'),_0x1f7d9e,_0x522856[_0xe5ec('0xf')]['message']);return _0xf71190(_0x522856[_0xe5ec('0xf')][_0xe5ec('0x11')]);}logger[_0xe5ec('0xf')](_0xe5ec('0xb'),_0x1f7d9e,_0x522856[_0xe5ec('0xf')][_0xe5ec('0x11')]);return _0x49f473(_0x522856[_0xe5ec('0xf')][_0xe5ec('0x11')]);}else{logger[_0xe5ec('0xa')]('ZendeskField,\x20%s,\x20%s',_0x1f7d9e,_0xe5ec('0xc'));_0x49f473(_0x522856[_0xe5ec('0x12')]['message']);}})[_0xe5ec('0x13')](function(_0x52c63d){logger['error'](_0xe5ec('0xb'),_0x1f7d9e,_0x52c63d);_0xf71190(_0x52c63d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 9d0dca3..78748a4 100644 --- a/server/api/intZohoAccount/index.js +++ b/server/api/intZohoAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bef=['update','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x4bef,0x6b));var _0xf4be=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x4bef[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require('multer');var util=require(_0xf4be('0x0'));var path=require('path');var timeout=require(_0xf4be('0x1'));var express=require(_0xf4be('0x2'));var router=express[_0xf4be('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf4be('0x4'));var config=require(_0xf4be('0x5'));var controller=require(_0xf4be('0x6'));router[_0xf4be('0x7')]('/',auth[_0xf4be('0x8')](),controller['index']);router['get'](_0xf4be('0x9'),auth[_0xf4be('0x8')](),controller[_0xf4be('0xa')]);router[_0xf4be('0x7')]('/:id/configurations',auth[_0xf4be('0x8')](),controller[_0xf4be('0xb')]);router[_0xf4be('0x7')](_0xf4be('0xc'),auth[_0xf4be('0x8')](),controller[_0xf4be('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf4be('0xe')]);router[_0xf4be('0xf')](_0xf4be('0x10'),auth[_0xf4be('0x8')](),controller[_0xf4be('0x11')]);router[_0xf4be('0x12')](_0xf4be('0x9'),auth[_0xf4be('0x8')](),controller[_0xf4be('0x13')]);router['delete'](_0xf4be('0x9'),auth[_0xf4be('0x8')](),controller[_0xf4be('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc0f5=['addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post'];(function(_0x56a5e0,_0x207901){var _0x3e7026=function(_0x7b7ceb){while(--_0x7b7ceb){_0x56a5e0['push'](_0x56a5e0['shift']());}};_0x3e7026(++_0x207901);}(_0xc0f5,0xac));var _0x5c0f=function(_0x4429d9,_0x261ae6){_0x4429d9=_0x4429d9-0x0;var _0x178903=_0xc0f5[_0x4429d9];return _0x178903;};'use strict';var multer=require(_0x5c0f('0x0'));var util=require(_0x5c0f('0x1'));var path=require(_0x5c0f('0x2'));var timeout=require(_0x5c0f('0x3'));var express=require(_0x5c0f('0x4'));var router=express['Router']();var auth=require(_0x5c0f('0x5'));var interaction=require(_0x5c0f('0x6'));var config=require(_0x5c0f('0x7'));var controller=require(_0x5c0f('0x8'));router[_0x5c0f('0x9')]('/',auth[_0x5c0f('0xa')](),controller[_0x5c0f('0xb')]);router[_0x5c0f('0x9')](_0x5c0f('0xc'),auth[_0x5c0f('0xa')](),controller[_0x5c0f('0xd')]);router['get'](_0x5c0f('0xe'),auth[_0x5c0f('0xa')](),controller[_0x5c0f('0xf')]);router[_0x5c0f('0x9')](_0x5c0f('0x10'),auth[_0x5c0f('0xa')](),controller[_0x5c0f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5c0f('0x12')]);router[_0x5c0f('0x13')](_0x5c0f('0xe'),auth['isAuthenticated'](),controller[_0x5c0f('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5c0f('0x15')]);router[_0x5c0f('0x16')](_0x5c0f('0xc'),auth[_0x5c0f('0xa')](),controller['destroy']);module[_0x5c0f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ede20c2..96d0f17 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f70=['STRING','sequelize'];(function(_0x435411,_0x6c15bf){var _0x1d207e=function(_0x1b8da4){while(--_0x1b8da4){_0x435411['push'](_0x435411['shift']());}};_0x1d207e(++_0x6c15bf);}(_0x5f70,0x1a5));var _0x05f7=function(_0x42a6d1,_0x112049){_0x42a6d1=_0x42a6d1-0x0;var _0x4b7821=_0x5f70[_0x42a6d1];return _0x4b7821;};'use strict';var Sequelize=require(_0x05f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x05f7('0x1')]},'description':{'type':Sequelize[_0x05f7('0x1')]},'host':{'type':Sequelize[_0x05f7('0x1')]},'zone':{'type':Sequelize[_0x05f7('0x1')]},'clientId':{'type':Sequelize[_0x05f7('0x1')]},'clientSecret':{'type':Sequelize[_0x05f7('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x05f7('0x1')]}}; \ No newline at end of file +var _0x4bc4=['STRING','sequelize'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4bc4,0x175));var _0x44bc=function(_0xf47c99,_0x4a8f06){_0xf47c99=_0xf47c99-0x0;var _0x4a8464=_0x4bc4[_0xf47c99];return _0x4a8464;};'use strict';var Sequelize=require(_0x44bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x44bc('0x1')]},'description':{'type':Sequelize[_0x44bc('0x1')]},'host':{'type':Sequelize[_0x44bc('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x44bc('0x1')]},'clientSecret':{'type':Sequelize[_0x44bc('0x1')]},'serverUrl':{'type':Sequelize[_0x44bc('0x1')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x44bc('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 42f56f6..93f9802 100644 --- a/server/api/intZohoAccount/intZohoAccount.controller.js +++ b/server/api/intZohoAccount/intZohoAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd053=['count','offset','limit','set','Content-Range','apply','reject','save','end','stack','name','map','rawAttributes','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','ZohoAccount','includeAll','include','rows','catch','params','length','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','picklist','test','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','Sequelize','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json'];(function(_0x416a42,_0x46053a){var _0x1467a0=function(_0x177b36){while(--_0x177b36){_0x416a42['push'](_0x416a42['shift']());}};_0x1467a0(++_0x46053a);}(_0xd053,0xe7));var _0x3d05=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0xd053[_0x2a5b3b];return _0xae665a;};'use strict';var pdf=require(_0x3d05('0x0'));var emlformat=require(_0x3d05('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3d05('0x2'));var jsonpatch=require(_0x3d05('0x3'));var rp=require(_0x3d05('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d05('0x5'));var util=require(_0x3d05('0x6'));var path=require('path');var sox=require(_0x3d05('0x7'));var csv=require(_0x3d05('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3d05('0x9'));var squel=require(_0x3d05('0xa'));var crypto=require(_0x3d05('0xb'));var jsforce=require(_0x3d05('0xc'));var deskjs=require(_0x3d05('0xd'));var toCsv=require(_0x3d05('0x8'));var querystring=require(_0x3d05('0xe'));var Papa=require(_0x3d05('0xf'));var Redis=require(_0x3d05('0x10'));var authService=require(_0x3d05('0x11'));var qs=require(_0x3d05('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d05('0x13'));var logger=require(_0x3d05('0x14'))(_0x3d05('0x15'));var utils=require(_0x3d05('0x16'));var config=require(_0x3d05('0x17'));var db=require(_0x3d05('0x18'))['db'];var integrations=require(_0x3d05('0x19'));var jayson=require(_0x3d05('0x1a'));var client=jayson[_0x3d05('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x83d5a6,_0x2d62d7,_0x34f8b5){if(_0x34f8b5){var _0x3131e3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3131e3['test'](_0x2d62d7)){return _0x83d5a6;}else{throw new db[(_0x3d05('0x1c'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x83d5a6;}}function respondWithRpcPromise(_0x41f12c,_0x527c55,_0x20a85c,_0x5bd384){return new BPromise(function(_0x5a2daf,_0x1419b4){var _0x3389e5=_0x5bd384||client;return _0x3389e5[_0x3d05('0x1d')](_0x41f12c,_0x20a85c)[_0x3d05('0x1e')](function(_0x18ffa0){logger[_0x3d05('0x1f')](_0x3d05('0x20'),_0x527c55,_0x3d05('0x21'));logger[_0x3d05('0x22')](_0x3d05('0x23'),_0x527c55,_0x3d05('0x21'),JSON[_0x3d05('0x24')](_0x18ffa0));if(_0x18ffa0['error']){if(_0x18ffa0[_0x3d05('0x25')]['code']===0x1f4){logger[_0x3d05('0x25')](_0x3d05('0x20'),_0x527c55,_0x18ffa0[_0x3d05('0x25')][_0x3d05('0x26')]);return _0x1419b4(_0x18ffa0[_0x3d05('0x25')][_0x3d05('0x26')]);}logger[_0x3d05('0x25')](_0x3d05('0x20'),_0x527c55,_0x18ffa0[_0x3d05('0x25')][_0x3d05('0x26')]);return _0x5a2daf(_0x18ffa0[_0x3d05('0x25')]['message']);}else{logger[_0x3d05('0x1f')](_0x3d05('0x20'),_0x527c55,_0x3d05('0x21'));_0x5a2daf(_0x18ffa0[_0x3d05('0x27')]['message']);}})['catch'](function(_0x30d62c){logger[_0x3d05('0x25')](_0x3d05('0x20'),_0x527c55,_0x30d62c);_0x1419b4(_0x30d62c);});});}function respondWithStatusCode(_0x47f637,_0x17e89f){_0x17e89f=_0x17e89f||0xcc;return function(_0xcc6e72){if(_0xcc6e72){return _0x47f637[_0x3d05('0x28')](_0x17e89f);}return _0x47f637[_0x3d05('0x29')](_0x17e89f)['end']();};}function respondWithResult(_0x5cba9b,_0x164d58){_0x164d58=_0x164d58||0xc8;return function(_0x2c07d8){if(_0x2c07d8){return _0x5cba9b[_0x3d05('0x29')](_0x164d58)[_0x3d05('0x2a')](_0x2c07d8);}};}function respondWithFilteredResult(_0x5782e1,_0x3e17eb){return function(_0x268d4f){if(_0x268d4f){var _0x1acd06=_0x268d4f[_0x3d05('0x2b')],_0x4fbcd8=_0x3e17eb[_0x3d05('0x2c')],_0x33f77a=_0x3e17eb['offset']+_0x3e17eb[_0x3d05('0x2d')],_0x19ce4e;if(_0x33f77a>=_0x1acd06){_0x33f77a=_0x1acd06;_0x19ce4e=0xc8;}else{_0x19ce4e=0xce;}_0x5782e1[_0x3d05('0x29')](_0x19ce4e);return _0x5782e1[_0x3d05('0x2e')](_0x3d05('0x2f'),_0x4fbcd8+'-'+_0x33f77a+'/'+_0x1acd06)[_0x3d05('0x2a')](_0x268d4f);}return null;};}function patchUpdates(_0xf6b91c){return function(_0x2e2f84){try{jsonpatch[_0x3d05('0x30')](_0x2e2f84,_0xf6b91c,!![]);}catch(_0x41f858){return BPromise[_0x3d05('0x31')](_0x41f858);}return _0x2e2f84[_0x3d05('0x32')]();};}function saveUpdates(_0x2ede28,_0x449ba2){return function(_0x4d63ec){if(_0x4d63ec){return _0x4d63ec['update'](_0x2ede28)[_0x3d05('0x1e')](function(_0x2e7114){return _0x2e7114;});}return null;};}function removeEntity(_0x3ef21e,_0x783bcb){return function(_0x2de2cf){if(_0x2de2cf){return _0x2de2cf['destroy']()[_0x3d05('0x1e')](function(){_0x3ef21e[_0x3d05('0x29')](0xcc)[_0x3d05('0x33')]();});}};}function handleEntityNotFound(_0x3f8ddc,_0x115c27){return function(_0x4b1631){if(!_0x4b1631){_0x3f8ddc[_0x3d05('0x28')](0x194);}return _0x4b1631;};}function handleError(_0xc4961e,_0x2a4da8){_0x2a4da8=_0x2a4da8||0x1f4;return function(_0x25fe49){logger[_0x3d05('0x25')](_0x25fe49[_0x3d05('0x34')]);if(_0x25fe49[_0x3d05('0x35')]){delete _0x25fe49['name'];}_0xc4961e['status'](_0x2a4da8)['send'](_0x25fe49);};}exports['index']=function(_0x1c4e36,_0x40e8bf){var _0x542e41={},_0xfd249b={},_0x3e937b={'count':0x0,'rows':[]};var _0x43f688=_[_0x3d05('0x36')](db['ZohoAccount'][_0x3d05('0x37')],function(_0x2c4883){return{'name':_0x2c4883['fieldName'],'type':_0x2c4883['type']['key']};});_0xfd249b['model']=_[_0x3d05('0x36')](_0x43f688,_0x3d05('0x35'));_0xfd249b[_0x3d05('0x38')]=_[_0x3d05('0x39')](_0x1c4e36[_0x3d05('0x38')]);_0xfd249b[_0x3d05('0x3a')]=_[_0x3d05('0x3b')](_0xfd249b[_0x3d05('0x3c')],_0xfd249b[_0x3d05('0x38')]);_0x542e41[_0x3d05('0x3d')]=_['intersection'](_0xfd249b[_0x3d05('0x3c')],qs[_0x3d05('0x3e')](_0x1c4e36[_0x3d05('0x38')]['fields']));_0x542e41[_0x3d05('0x3d')]=_0x542e41[_0x3d05('0x3d')]['length']?_0x542e41['attributes']:_0xfd249b[_0x3d05('0x3c')];if(!_0x1c4e36[_0x3d05('0x38')][_0x3d05('0x3f')](_0x3d05('0x40'))){_0x542e41[_0x3d05('0x2d')]=qs[_0x3d05('0x2d')](_0x1c4e36[_0x3d05('0x38')][_0x3d05('0x2d')]);_0x542e41['offset']=qs['offset'](_0x1c4e36[_0x3d05('0x38')][_0x3d05('0x2c')]);}_0x542e41['order']=qs['sort'](_0x1c4e36['query'][_0x3d05('0x41')]);_0x542e41[_0x3d05('0x42')]=qs[_0x3d05('0x3a')](_[_0x3d05('0x43')](_0x1c4e36[_0x3d05('0x38')],_0xfd249b['filters']));if(_0x1c4e36[_0x3d05('0x38')]['filter']){_0x542e41[_0x3d05('0x42')]=_[_0x3d05('0x44')](_0x542e41[_0x3d05('0x42')],{'$or':_['map'](_0x43f688,function(_0x354b96){if(_0x354b96['type']!==_0x3d05('0x45')){var _0x54105b={};_0x54105b[_0x354b96['name']]={'$like':'%'+_0x1c4e36['query'][_0x3d05('0x46')]+'%'};return _0x54105b;}})});}_0x542e41=_[_0x3d05('0x44')]({},_0x542e41,_0x1c4e36[_0x3d05('0x47')]);var _0x2181c1={'where':_0x542e41['where']};return db[_0x3d05('0x48')][_0x3d05('0x2b')](_0x2181c1)[_0x3d05('0x1e')](function(_0x33a71d){_0x3e937b[_0x3d05('0x2b')]=_0x33a71d;if(_0x1c4e36['query'][_0x3d05('0x49')]){_0x542e41[_0x3d05('0x4a')]=[{'all':!![]}];}return db[_0x3d05('0x48')]['findAll'](_0x542e41);})[_0x3d05('0x1e')](function(_0x26dc2a){_0x3e937b[_0x3d05('0x4b')]=_0x26dc2a;return _0x3e937b;})['then'](respondWithFilteredResult(_0x40e8bf,_0x542e41))[_0x3d05('0x4c')](handleError(_0x40e8bf,null));};exports['show']=function(_0xbae78,_0x249c0f){var _0x5c6bb8={'raw':![],'where':{'id':_0xbae78[_0x3d05('0x4d')]['id']}},_0x19ac44={};_0x19ac44[_0x3d05('0x3c')]=_[_0x3d05('0x39')](db[_0x3d05('0x48')][_0x3d05('0x37')]);_0x19ac44[_0x3d05('0x38')]=_[_0x3d05('0x39')](_0xbae78[_0x3d05('0x38')]);_0x19ac44['filters']=_[_0x3d05('0x3b')](_0x19ac44[_0x3d05('0x3c')],_0x19ac44[_0x3d05('0x38')]);_0x5c6bb8[_0x3d05('0x3d')]=_[_0x3d05('0x3b')](_0x19ac44[_0x3d05('0x3c')],qs['fields'](_0xbae78[_0x3d05('0x38')][_0x3d05('0x3e')]));_0x5c6bb8[_0x3d05('0x3d')]=_0x5c6bb8[_0x3d05('0x3d')][_0x3d05('0x4e')]?_0x5c6bb8[_0x3d05('0x3d')]:_0x19ac44[_0x3d05('0x3c')];if(_0xbae78[_0x3d05('0x38')][_0x3d05('0x49')]){_0x5c6bb8[_0x3d05('0x4a')]=[{'all':!![]}];}_0x5c6bb8=_[_0x3d05('0x44')]({},_0x5c6bb8,_0xbae78['options']);return db['ZohoAccount'][_0x3d05('0x4f')](_0x5c6bb8)[_0x3d05('0x1e')](handleEntityNotFound(_0x249c0f,null))[_0x3d05('0x1e')](respondWithResult(_0x249c0f,null))['catch'](handleError(_0x249c0f,null));};exports[_0x3d05('0x50')]=function(_0x5526b7,_0x328ab7){return db['ZohoAccount'][_0x3d05('0x50')](_0x5526b7[_0x3d05('0x51')],{})[_0x3d05('0x1e')](respondWithResult(_0x328ab7,0xc9))['catch'](handleError(_0x328ab7,null));};exports['update']=function(_0x4127c5,_0x4ecae5){if(_0x4127c5[_0x3d05('0x51')]['id']){delete _0x4127c5[_0x3d05('0x51')]['id'];}return db[_0x3d05('0x48')]['find']({'where':{'id':_0x4127c5[_0x3d05('0x4d')]['id']}})[_0x3d05('0x1e')](handleEntityNotFound(_0x4ecae5,null))[_0x3d05('0x1e')](saveUpdates(_0x4127c5[_0x3d05('0x51')],null))[_0x3d05('0x1e')](respondWithResult(_0x4ecae5,null))[_0x3d05('0x4c')](handleError(_0x4ecae5,null));};exports[_0x3d05('0x52')]=function(_0x3c900e,_0x944d7f){return db['ZohoAccount']['find']({'where':{'id':_0x3c900e['params']['id']}})[_0x3d05('0x1e')](handleEntityNotFound(_0x944d7f,null))[_0x3d05('0x1e')](removeEntity(_0x944d7f,null))[_0x3d05('0x4c')](handleError(_0x944d7f,null));};exports[_0x3d05('0x53')]=function(_0x27155e,_0x1adcaf,_0x936c2a){var _0x5b1f91={};var _0x4112ad={};var _0x543158;var _0x2c84bd;return db['ZohoAccount'][_0x3d05('0x54')]({'where':{'id':_0x27155e[_0x3d05('0x4d')]['id']}})[_0x3d05('0x1e')](handleEntityNotFound(_0x1adcaf,null))['then'](function(_0x3a21f4){if(_0x3a21f4){_0x543158=_0x3a21f4;_0x4112ad[_0x3d05('0x3c')]=_[_0x3d05('0x39')](db[_0x3d05('0x55')][_0x3d05('0x37')]);_0x4112ad['query']=_['keys'](_0x27155e[_0x3d05('0x38')]);_0x4112ad['filters']=_[_0x3d05('0x3b')](_0x4112ad['model'],_0x4112ad['query']);_0x5b1f91[_0x3d05('0x3d')]=_[_0x3d05('0x3b')](_0x4112ad[_0x3d05('0x3c')],qs['fields'](_0x27155e[_0x3d05('0x38')]['fields']));_0x5b1f91[_0x3d05('0x3d')]=_0x5b1f91[_0x3d05('0x3d')][_0x3d05('0x4e')]?_0x5b1f91['attributes']:_0x4112ad['model'];_0x5b1f91['order']=qs[_0x3d05('0x41')](_0x27155e['query'][_0x3d05('0x41')]);_0x5b1f91[_0x3d05('0x42')]=qs[_0x3d05('0x3a')](_['pick'](_0x27155e['query'],_0x4112ad['filters']));if(_0x27155e[_0x3d05('0x38')]['filter']){_0x5b1f91[_0x3d05('0x42')]=_[_0x3d05('0x44')](_0x5b1f91[_0x3d05('0x42')],{'$or':_[_0x3d05('0x36')](_0x5b1f91[_0x3d05('0x3d')],function(_0x3c0f56){var _0x40275c={};_0x40275c[_0x3c0f56]={'$like':'%'+_0x27155e[_0x3d05('0x38')]['filter']+'%'};return _0x40275c;})});}_0x5b1f91=_[_0x3d05('0x44')]({},_0x5b1f91,_0x27155e['options']);return _0x543158[_0x3d05('0x53')](_0x5b1f91);}})[_0x3d05('0x1e')](function(_0x5400e9){if(_0x5400e9){_0x2c84bd=_0x5400e9[_0x3d05('0x4e')];if(!_0x27155e[_0x3d05('0x38')][_0x3d05('0x3f')](_0x3d05('0x40'))){_0x5b1f91[_0x3d05('0x2d')]=qs['limit'](_0x27155e[_0x3d05('0x38')][_0x3d05('0x2d')]);_0x5b1f91['offset']=qs[_0x3d05('0x2c')](_0x27155e['query']['offset']);}return _0x543158[_0x3d05('0x53')](_0x5b1f91);}})[_0x3d05('0x1e')](function(_0x1c6a43){if(_0x1c6a43){return _0x1c6a43?{'count':_0x2c84bd,'rows':_0x1c6a43}:null;}})['then'](respondWithResult(_0x1adcaf,null))[_0x3d05('0x4c')](handleError(_0x1adcaf,null));};exports[_0x3d05('0x56')]=function(_0x1afbe5,_0x5a4dab,_0x46ef0a){if(_0x1afbe5[_0x3d05('0x51')]['id']){delete _0x1afbe5[_0x3d05('0x51')]['id'];}return db['ZohoAccount'][_0x3d05('0x54')]({'where':{'id':_0x1afbe5[_0x3d05('0x4d')]['id']}})[_0x3d05('0x1e')](handleEntityNotFound(_0x5a4dab,null))['then'](function(_0x12d17e){if(_0x12d17e){_0x1afbe5[_0x3d05('0x51')][_0x3d05('0x57')]=_0x12d17e['id'];_0x1afbe5[_0x3d05('0x51')][_0x3d05('0x58')]=integrations[_0x3d05('0x59')](_0x1afbe5[_0x3d05('0x51')][_0x3d05('0x5a')],_0x1afbe5['body'][_0x3d05('0x5b')]);_0x1afbe5[_0x3d05('0x51')][_0x3d05('0x5c')]=integrations[_0x3d05('0x5d')](_0x1afbe5[_0x3d05('0x51')]['channel'],_0x1afbe5['body'][_0x3d05('0x5b')]);return db[_0x3d05('0x55')]['create'](_0x1afbe5['body'],{'include':[{'model':db['ZohoField'],'as':_0x3d05('0x58')},{'model':db[_0x3d05('0x5e')],'as':_0x3d05('0x5c')}]});}return null;})['then'](respondWithResult(_0x5a4dab,null))['catch'](handleError(_0x5a4dab,null));};function getAccessToken(_0x35ef36){return new Promise(function(_0xe32b1,_0x2fb676){var _0xe0b7f;switch(_0x35ef36[_0x3d05('0x5f')]){case'US':_0xe0b7f=_0x3d05('0x60');break;case'AU':_0xe0b7f=_0x3d05('0x61');break;case'EU':_0xe0b7f='https://accounts.zoho.eu';break;case'IN':_0xe0b7f=_0x3d05('0x62');break;case'CN':_0xe0b7f=_0x3d05('0x63');break;default:_0xe0b7f=_0x3d05('0x64');break;}var _0x420210={'method':_0x3d05('0x65'),'uri':_0xe0b7f+'/oauth/v2/token','qs':{'refresh_token':_0x35ef36[_0x3d05('0x66')],'client_id':_0x35ef36[_0x3d05('0x67')],'client_secret':_0x35ef36[_0x3d05('0x68')],'grant_type':_0x3d05('0x69')},'json':!![]};return rp(_0x420210)['then'](function(_0x48bd01){if(_0x48bd01[_0x3d05('0x6a')]){_0xe32b1(_0x48bd01['access_token']);}else{_0x2fb676(_0x3d05('0x6b'));}})[_0x3d05('0x4c')](function(_0x2ffdca){_0x2fb676(_0x2ffdca);});});}exports[_0x3d05('0x6c')]=function(_0x4f81cb,_0x217dad,_0x297c2f){var _0x4f43ef,_0x441edb,_0x2df447,_0xccaf42,_0x20303a;return db[_0x3d05('0x48')][_0x3d05('0x54')]({'where':{'id':_0x4f81cb['params']['id']},'attributes':['id',_0x3d05('0x6d'),_0x3d05('0x5f'),'clientId',_0x3d05('0x68'),_0x3d05('0x6e'),_0x3d05('0x6f'),_0x3d05('0x66')]})[_0x3d05('0x1e')](handleEntityNotFound(_0x217dad,null))[_0x3d05('0x1e')](function(_0x18f6b3){_0x20303a=_0x18f6b3;_0x4f43ef=_0x20303a[_0x3d05('0x6d')];_0x441edb=_0x4f43ef==='zoho.eu'?'eu':_0x3d05('0x70');_0x2df447=_0x20303a[_0x3d05('0x6e')];var _0x33a49e=_0x2df447['slice'](-0x1);if(_0x33a49e==='/'||_0x33a49e==='\x5c'||_0x33a49e===':'){_0x2df447=_0x2df447[_0x3d05('0x71')](0x0,_0x2df447[_0x3d05('0x72')](_0x33a49e));}if(!_0x20303a[_0x3d05('0x66')]){throw new Error(_0x3d05('0x73'));}return getAccessToken(_0x20303a);})[_0x3d05('0x1e')](function(_0x5af167){if(_0x5af167){return rp({'method':_0x3d05('0x74'),'uri':util[_0x3d05('0x75')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x441edb),'qs':{'module':'Calls'},'headers':{'Authorization':_0x3d05('0x76')+_0x5af167},'json':!![]});}})[_0x3d05('0x1e')](function(_0x1d3b78){if(_0x1d3b78){if(_0x1d3b78[_0x3d05('0x77')]&&_0x1d3b78[_0x3d05('0x77')][_0x3d05('0x25')]){throw new Error(_0x1d3b78[_0x3d05('0x77')][_0x3d05('0x25')]['message']);}var _0x2b44a6=[];var _0x8eaec6=[];var _0x158974=[_0x3d05('0x78'),'Subject',_0x3d05('0x79'),_0x3d05('0x7a'),'Call_Duration',_0x3d05('0x7b'),_0x3d05('0x7c'),_0x3d05('0x7d')];_0x8eaec6=_[_0x3d05('0x7e')](_0x1d3b78[_0x3d05('0x3e')],function(_0x1a3ae6){return _0x158974[_0x3d05('0x7f')](_0x1a3ae6['api_name']);});for(var _0x46ad32=0x0;_0x46ad32<_0x8eaec6['length'];_0x46ad32++){if(_0x8eaec6[_0x46ad32][_0x3d05('0x80')]===![]){_0x2b44a6[_0x3d05('0x81')]({'id':_0x8eaec6[_0x46ad32]['id'],'name':_0x8eaec6[_0x46ad32][_0x3d05('0x82')],'custom':_0x8eaec6[_0x46ad32][_0x3d05('0x83')],'options':_0x8eaec6[_0x46ad32][_0x3d05('0x84')]===_0x3d05('0x85')&&_0x8eaec6[_0x46ad32]['pick_list_values'][_0x3d05('0x4e')]>-0x1?_[_0x3d05('0x36')](_0x8eaec6[_0x46ad32]['pick_list_values'],function(_0x177c25){return{'name':_0x177c25,'value':_0x177c25};}):[]});}}return{'count':_0x2b44a6[_0x3d05('0x4e')],'rows':_0x2b44a6};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x217dad,null))['catch'](function(_0x4f5ce8){var _0x40decd=_0x4f81cb['query'][_0x3d05('0x86')]?0x1f4:_0x4f5ce8['statusCode']||0x1f4;logger[_0x3d05('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x40decd,JSON[_0x3d05('0x24')](_0x4f5ce8));delete _0x4f5ce8[_0x3d05('0x35')];if(_0x40decd===0x191){_0x40decd=0x190;}_0x217dad['status'](_0x40decd)[_0x3d05('0x87')](_0x4f81cb[_0x3d05('0x38')]['test']?{'message':_0x3d05('0x88'),'statusCode':_0x4f5ce8['statusCode']}:_0x4f5ce8);});}; \ No newline at end of file +var _0xb6b7=['rawAttributes','fieldName','key','name','query','keys','intersection','attributes','fields','length','model','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','filters','ZohoAccount','find','catch','create','body','params','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','type','ZohoField','Subjects','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','host','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','push','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','count','offset','set','apply','reject','save','destroy','stack','map'];(function(_0x47ad08,_0x28fcd1){var _0x302699=function(_0x45a213){while(--_0x45a213){_0x47ad08['push'](_0x47ad08['shift']());}};_0x302699(++_0x28fcd1);}(_0xb6b7,0xe4));var _0x7b6b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb6b7[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7b6b('0x0'));var emlformat=require(_0x7b6b('0x1'));var rimraf=require(_0x7b6b('0x2'));var zipdir=require(_0x7b6b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b6b('0x4'));var BPromise=require(_0x7b6b('0x5'));var Mustache=require(_0x7b6b('0x6'));var util=require(_0x7b6b('0x7'));var path=require('path');var sox=require(_0x7b6b('0x8'));var csv=require(_0x7b6b('0x9'));var ejs=require(_0x7b6b('0xa'));var fs=require('fs');var _=require(_0x7b6b('0xb'));var squel=require('squel');var crypto=require(_0x7b6b('0xc'));var jsforce=require(_0x7b6b('0xd'));var deskjs=require(_0x7b6b('0xe'));var toCsv=require(_0x7b6b('0x9'));var querystring=require('querystring');var Papa=require(_0x7b6b('0xf'));var Redis=require(_0x7b6b('0x10'));var authService=require(_0x7b6b('0x11'));var qs=require(_0x7b6b('0x12'));var as=require(_0x7b6b('0x13'));var hardwareService=require(_0x7b6b('0x14'));var logger=require('../../config/logger')(_0x7b6b('0x15'));var utils=require(_0x7b6b('0x16'));var config=require(_0x7b6b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7b6b('0x18'));var jayson=require(_0x7b6b('0x19'));var client=jayson[_0x7b6b('0x1a')][_0x7b6b('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2a5870,_0x4f08b9,_0x332466){if(_0x332466){var _0x5333ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5333ce[_0x7b6b('0x1c')](_0x4f08b9)){return _0x2a5870;}else{throw new db[(_0x7b6b('0x1d'))][(_0x7b6b('0x1e'))](_0x7b6b('0x1f'));}}else{return _0x2a5870;}}function respondWithRpcPromise(_0x36f7c1,_0x892b9e,_0x384afb,_0x224cb2){return new BPromise(function(_0x380e73,_0x2cf6a5){var _0x418e5a=_0x224cb2||client;return _0x418e5a[_0x7b6b('0x20')](_0x36f7c1,_0x384afb)[_0x7b6b('0x21')](function(_0x4137df){logger[_0x7b6b('0x22')](_0x7b6b('0x23'),_0x892b9e,_0x7b6b('0x24'));logger[_0x7b6b('0x25')](_0x7b6b('0x26'),_0x892b9e,'request\x20sent',JSON[_0x7b6b('0x27')](_0x4137df));if(_0x4137df[_0x7b6b('0x28')]){if(_0x4137df[_0x7b6b('0x28')][_0x7b6b('0x29')]===0x1f4){logger[_0x7b6b('0x28')](_0x7b6b('0x23'),_0x892b9e,_0x4137df['error'][_0x7b6b('0x2a')]);return _0x2cf6a5(_0x4137df['error'][_0x7b6b('0x2a')]);}logger[_0x7b6b('0x28')](_0x7b6b('0x23'),_0x892b9e,_0x4137df[_0x7b6b('0x28')][_0x7b6b('0x2a')]);return _0x380e73(_0x4137df[_0x7b6b('0x28')][_0x7b6b('0x2a')]);}else{logger['info'](_0x7b6b('0x23'),_0x892b9e,_0x7b6b('0x24'));_0x380e73(_0x4137df[_0x7b6b('0x2b')][_0x7b6b('0x2a')]);}})['catch'](function(_0x366373){logger[_0x7b6b('0x28')](_0x7b6b('0x23'),_0x892b9e,_0x366373);_0x2cf6a5(_0x366373);});});}function respondWithStatusCode(_0x5de877,_0x4da671){_0x4da671=_0x4da671||0xcc;return function(_0x307f87){if(_0x307f87){return _0x5de877[_0x7b6b('0x2c')](_0x4da671);}return _0x5de877[_0x7b6b('0x2d')](_0x4da671)[_0x7b6b('0x2e')]();};}function respondWithResult(_0x383695,_0x4db9b5){_0x4db9b5=_0x4db9b5||0xc8;return function(_0xab9809){if(_0xab9809){return _0x383695['status'](_0x4db9b5)['json'](_0xab9809);}};}function respondWithFilteredResult(_0xbba048,_0x539892){return function(_0x1cdf0b){if(_0x1cdf0b){var _0x1cf270=_0x1cdf0b[_0x7b6b('0x2f')],_0x54fe8d=_0x539892[_0x7b6b('0x30')],_0x45df28=_0x539892[_0x7b6b('0x30')]+_0x539892['limit'],_0x13a183;if(_0x45df28>=_0x1cf270){_0x45df28=_0x1cf270;_0x13a183=0xc8;}else{_0x13a183=0xce;}_0xbba048[_0x7b6b('0x2d')](_0x13a183);return _0xbba048[_0x7b6b('0x31')]('Content-Range',_0x54fe8d+'-'+_0x45df28+'/'+_0x1cf270)['json'](_0x1cdf0b);}return null;};}function patchUpdates(_0x1d2eb4){return function(_0x3cb5c9){try{jsonpatch[_0x7b6b('0x32')](_0x3cb5c9,_0x1d2eb4,!![]);}catch(_0x3e1f27){return BPromise[_0x7b6b('0x33')](_0x3e1f27);}return _0x3cb5c9[_0x7b6b('0x34')]();};}function saveUpdates(_0x3a9f21,_0x37332b){return function(_0x2881a5){if(_0x2881a5){return _0x2881a5['update'](_0x3a9f21)['then'](function(_0x33b036){return _0x33b036;});}return null;};}function removeEntity(_0x2db820,_0x3735f1){return function(_0xce4522){if(_0xce4522){return _0xce4522[_0x7b6b('0x35')]()['then'](function(){_0x2db820[_0x7b6b('0x2d')](0xcc)[_0x7b6b('0x2e')]();});}};}function handleEntityNotFound(_0x314310,_0x31d777){return function(_0x27378f){if(!_0x27378f){_0x314310[_0x7b6b('0x2c')](0x194);}return _0x27378f;};}function handleError(_0x4bd5ce,_0x6c06d5){_0x6c06d5=_0x6c06d5||0x1f4;return function(_0x3898f2){logger['error'](_0x3898f2[_0x7b6b('0x36')]);if(_0x3898f2['name']){delete _0x3898f2['name'];}_0x4bd5ce['status'](_0x6c06d5)['send'](_0x3898f2);};}exports['index']=function(_0x528a8b,_0x3479ee){var _0x34a82d={},_0x5b4c69={},_0x38ed1a={'count':0x0,'rows':[]};var _0x4bc40a=_[_0x7b6b('0x37')](db['ZohoAccount'][_0x7b6b('0x38')],function(_0x21d81e){return{'name':_0x21d81e[_0x7b6b('0x39')],'type':_0x21d81e['type'][_0x7b6b('0x3a')]};});_0x5b4c69['model']=_[_0x7b6b('0x37')](_0x4bc40a,_0x7b6b('0x3b'));_0x5b4c69[_0x7b6b('0x3c')]=_[_0x7b6b('0x3d')](_0x528a8b[_0x7b6b('0x3c')]);_0x5b4c69['filters']=_[_0x7b6b('0x3e')](_0x5b4c69['model'],_0x5b4c69[_0x7b6b('0x3c')]);_0x34a82d[_0x7b6b('0x3f')]=_[_0x7b6b('0x3e')](_0x5b4c69['model'],qs['fields'](_0x528a8b[_0x7b6b('0x3c')][_0x7b6b('0x40')]));_0x34a82d[_0x7b6b('0x3f')]=_0x34a82d['attributes'][_0x7b6b('0x41')]?_0x34a82d[_0x7b6b('0x3f')]:_0x5b4c69[_0x7b6b('0x42')];if(!_0x528a8b['query']['hasOwnProperty'](_0x7b6b('0x43'))){_0x34a82d[_0x7b6b('0x44')]=qs[_0x7b6b('0x44')](_0x528a8b[_0x7b6b('0x3c')][_0x7b6b('0x44')]);_0x34a82d[_0x7b6b('0x30')]=qs[_0x7b6b('0x30')](_0x528a8b[_0x7b6b('0x3c')][_0x7b6b('0x30')]);}_0x34a82d[_0x7b6b('0x45')]=qs[_0x7b6b('0x46')](_0x528a8b[_0x7b6b('0x3c')][_0x7b6b('0x46')]);_0x34a82d[_0x7b6b('0x47')]=qs['filters'](_[_0x7b6b('0x48')](_0x528a8b[_0x7b6b('0x3c')],_0x5b4c69['filters']));if(_0x528a8b[_0x7b6b('0x3c')][_0x7b6b('0x49')]){_0x34a82d[_0x7b6b('0x47')]=_[_0x7b6b('0x4a')](_0x34a82d[_0x7b6b('0x47')],{'$or':_[_0x7b6b('0x37')](_0x4bc40a,function(_0x1aec4d){if(_0x1aec4d['type']!==_0x7b6b('0x4b')){var _0x354305={};_0x354305[_0x1aec4d['name']]={'$like':'%'+_0x528a8b[_0x7b6b('0x3c')][_0x7b6b('0x49')]+'%'};return _0x354305;}})});}_0x34a82d=_[_0x7b6b('0x4a')]({},_0x34a82d,_0x528a8b[_0x7b6b('0x4c')]);var _0x3e2d3c={'where':_0x34a82d[_0x7b6b('0x47')]};return db['ZohoAccount'][_0x7b6b('0x2f')](_0x3e2d3c)[_0x7b6b('0x21')](function(_0x1516e6){_0x38ed1a['count']=_0x1516e6;if(_0x528a8b[_0x7b6b('0x3c')][_0x7b6b('0x4d')]){_0x34a82d[_0x7b6b('0x4e')]=[{'all':!![]}];}return db['ZohoAccount'][_0x7b6b('0x4f')](_0x34a82d);})['then'](function(_0x586e9f){_0x38ed1a['rows']=_0x586e9f;return _0x38ed1a;})[_0x7b6b('0x21')](respondWithFilteredResult(_0x3479ee,_0x34a82d))['catch'](handleError(_0x3479ee,null));};exports[_0x7b6b('0x50')]=function(_0x94004,_0x3ef0f8){var _0x5a111c={'raw':![],'where':{'id':_0x94004['params']['id']}},_0x9c6a5d={};_0x9c6a5d['model']=_[_0x7b6b('0x3d')](db['ZohoAccount'][_0x7b6b('0x38')]);_0x9c6a5d[_0x7b6b('0x3c')]=_['keys'](_0x94004[_0x7b6b('0x3c')]);_0x9c6a5d[_0x7b6b('0x51')]=_[_0x7b6b('0x3e')](_0x9c6a5d[_0x7b6b('0x42')],_0x9c6a5d[_0x7b6b('0x3c')]);_0x5a111c[_0x7b6b('0x3f')]=_[_0x7b6b('0x3e')](_0x9c6a5d['model'],qs[_0x7b6b('0x40')](_0x94004[_0x7b6b('0x3c')][_0x7b6b('0x40')]));_0x5a111c[_0x7b6b('0x3f')]=_0x5a111c[_0x7b6b('0x3f')][_0x7b6b('0x41')]?_0x5a111c[_0x7b6b('0x3f')]:_0x9c6a5d[_0x7b6b('0x42')];if(_0x94004['query'][_0x7b6b('0x4d')]){_0x5a111c[_0x7b6b('0x4e')]=[{'all':!![]}];}_0x5a111c=_[_0x7b6b('0x4a')]({},_0x5a111c,_0x94004[_0x7b6b('0x4c')]);return db[_0x7b6b('0x52')][_0x7b6b('0x53')](_0x5a111c)[_0x7b6b('0x21')](handleEntityNotFound(_0x3ef0f8,null))[_0x7b6b('0x21')](respondWithResult(_0x3ef0f8,null))[_0x7b6b('0x54')](handleError(_0x3ef0f8,null));};exports[_0x7b6b('0x55')]=function(_0x5a4e67,_0x3cc589){return db['ZohoAccount']['create'](_0x5a4e67[_0x7b6b('0x56')],{})[_0x7b6b('0x21')](respondWithResult(_0x3cc589,0xc9))[_0x7b6b('0x54')](handleError(_0x3cc589,null));};exports['update']=function(_0x2c9305,_0x4567d0){if(_0x2c9305[_0x7b6b('0x56')]['id']){delete _0x2c9305[_0x7b6b('0x56')]['id'];}return db[_0x7b6b('0x52')]['find']({'where':{'id':_0x2c9305[_0x7b6b('0x57')]['id']}})['then'](handleEntityNotFound(_0x4567d0,null))[_0x7b6b('0x21')](saveUpdates(_0x2c9305[_0x7b6b('0x56')],null))[_0x7b6b('0x21')](respondWithResult(_0x4567d0,null))['catch'](handleError(_0x4567d0,null));};exports['destroy']=function(_0x30b5b3,_0x56d3d7){return db[_0x7b6b('0x52')][_0x7b6b('0x53')]({'where':{'id':_0x30b5b3[_0x7b6b('0x57')]['id']}})[_0x7b6b('0x21')](handleEntityNotFound(_0x56d3d7,null))['then'](removeEntity(_0x56d3d7,null))['catch'](handleError(_0x56d3d7,null));};exports[_0x7b6b('0x58')]=function(_0x4b6231,_0xf4477e,_0x31f29b){var _0x2facb9={};var _0x3ded2f={};var _0x1f841b;var _0x586b28;return db[_0x7b6b('0x52')][_0x7b6b('0x59')]({'where':{'id':_0x4b6231[_0x7b6b('0x57')]['id']}})[_0x7b6b('0x21')](handleEntityNotFound(_0xf4477e,null))['then'](function(_0x12ede0){if(_0x12ede0){_0x1f841b=_0x12ede0;_0x3ded2f[_0x7b6b('0x42')]=_[_0x7b6b('0x3d')](db[_0x7b6b('0x5a')][_0x7b6b('0x38')]);_0x3ded2f['query']=_[_0x7b6b('0x3d')](_0x4b6231[_0x7b6b('0x3c')]);_0x3ded2f['filters']=_[_0x7b6b('0x3e')](_0x3ded2f['model'],_0x3ded2f[_0x7b6b('0x3c')]);_0x2facb9[_0x7b6b('0x3f')]=_[_0x7b6b('0x3e')](_0x3ded2f['model'],qs['fields'](_0x4b6231[_0x7b6b('0x3c')][_0x7b6b('0x40')]));_0x2facb9[_0x7b6b('0x3f')]=_0x2facb9[_0x7b6b('0x3f')]['length']?_0x2facb9[_0x7b6b('0x3f')]:_0x3ded2f[_0x7b6b('0x42')];_0x2facb9[_0x7b6b('0x45')]=qs['sort'](_0x4b6231[_0x7b6b('0x3c')][_0x7b6b('0x46')]);_0x2facb9[_0x7b6b('0x47')]=qs[_0x7b6b('0x51')](_[_0x7b6b('0x48')](_0x4b6231['query'],_0x3ded2f['filters']));if(_0x4b6231['query'][_0x7b6b('0x49')]){_0x2facb9['where']=_[_0x7b6b('0x4a')](_0x2facb9['where'],{'$or':_['map'](_0x2facb9[_0x7b6b('0x3f')],function(_0x480ef3){var _0x293062={};_0x293062[_0x480ef3]={'$like':'%'+_0x4b6231[_0x7b6b('0x3c')][_0x7b6b('0x49')]+'%'};return _0x293062;})});}_0x2facb9=_['merge']({},_0x2facb9,_0x4b6231['options']);return _0x1f841b[_0x7b6b('0x58')](_0x2facb9);}})['then'](function(_0x188768){if(_0x188768){_0x586b28=_0x188768[_0x7b6b('0x41')];if(!_0x4b6231['query'][_0x7b6b('0x5b')](_0x7b6b('0x43'))){_0x2facb9[_0x7b6b('0x44')]=qs['limit'](_0x4b6231[_0x7b6b('0x3c')]['limit']);_0x2facb9[_0x7b6b('0x30')]=qs[_0x7b6b('0x30')](_0x4b6231[_0x7b6b('0x3c')]['offset']);}return _0x1f841b[_0x7b6b('0x58')](_0x2facb9);}})[_0x7b6b('0x21')](function(_0xda9436){if(_0xda9436){return _0xda9436?{'count':_0x586b28,'rows':_0xda9436}:null;}})[_0x7b6b('0x21')](respondWithResult(_0xf4477e,null))[_0x7b6b('0x54')](handleError(_0xf4477e,null));};exports[_0x7b6b('0x5c')]=function(_0x5e4e45,_0x3d5984,_0x41cab6){if(_0x5e4e45[_0x7b6b('0x56')]['id']){delete _0x5e4e45['body']['id'];}return db[_0x7b6b('0x52')][_0x7b6b('0x59')]({'where':{'id':_0x5e4e45[_0x7b6b('0x57')]['id']}})[_0x7b6b('0x21')](handleEntityNotFound(_0x3d5984,null))['then'](function(_0x3a1869){if(_0x3a1869){_0x5e4e45[_0x7b6b('0x56')][_0x7b6b('0x5d')]=_0x3a1869['id'];_0x5e4e45[_0x7b6b('0x56')]['Subjects']=integrations[_0x7b6b('0x5e')](_0x5e4e45['body'][_0x7b6b('0x5f')],_0x5e4e45[_0x7b6b('0x56')]['type']);_0x5e4e45['body'][_0x7b6b('0x60')]=integrations[_0x7b6b('0x61')](_0x5e4e45['body'][_0x7b6b('0x5f')],_0x5e4e45[_0x7b6b('0x56')][_0x7b6b('0x62')]);return db[_0x7b6b('0x5a')]['create'](_0x5e4e45[_0x7b6b('0x56')],{'include':[{'model':db[_0x7b6b('0x63')],'as':_0x7b6b('0x64')},{'model':db[_0x7b6b('0x63')],'as':_0x7b6b('0x60')}]});}return null;})['then'](respondWithResult(_0x3d5984,null))[_0x7b6b('0x54')](handleError(_0x3d5984,null));};function getAccessToken(_0x29772a){return new Promise(function(_0xb58692,_0x2c30ad){var _0x385789;switch(_0x29772a['zone']){case'US':_0x385789='https://accounts.zoho.com';break;case'AU':_0x385789=_0x7b6b('0x65');break;case'EU':_0x385789=_0x7b6b('0x66');break;case'IN':_0x385789=_0x7b6b('0x67');break;case'CN':_0x385789=_0x7b6b('0x68');break;default:_0x385789='https://accounts.zoho.eu';break;}var _0x595dce={'method':_0x7b6b('0x69'),'uri':_0x385789+_0x7b6b('0x6a'),'qs':{'refresh_token':_0x29772a[_0x7b6b('0x6b')],'client_id':_0x29772a['clientId'],'client_secret':_0x29772a[_0x7b6b('0x6c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x595dce)[_0x7b6b('0x21')](function(_0x1184a9){if(_0x1184a9['access_token']){_0xb58692(_0x1184a9[_0x7b6b('0x6d')]);}else{_0x2c30ad(_0x7b6b('0x6e'));}})[_0x7b6b('0x54')](function(_0x464034){_0x2c30ad(_0x464034);});});}exports[_0x7b6b('0x6f')]=function(_0x3c4e5a,_0x538471,_0x21dcb4){var _0x5b2917,_0x30cfa3,_0x48c123,_0x33f917,_0x4a97e7;return db[_0x7b6b('0x52')][_0x7b6b('0x59')]({'where':{'id':_0x3c4e5a[_0x7b6b('0x57')]['id']},'attributes':['id','host',_0x7b6b('0x70'),'clientId','clientSecret',_0x7b6b('0x71'),_0x7b6b('0x29'),_0x7b6b('0x6b')]})[_0x7b6b('0x21')](handleEntityNotFound(_0x538471,null))['then'](function(_0x543587){_0x4a97e7=_0x543587;_0x5b2917=_0x4a97e7[_0x7b6b('0x72')];_0x30cfa3=_0x5b2917==='zoho.eu'?'eu':'com';_0x48c123=_0x4a97e7[_0x7b6b('0x71')];var _0x3514a0=_0x48c123[_0x7b6b('0x73')](-0x1);if(_0x3514a0==='/'||_0x3514a0==='\x5c'||_0x3514a0===':'){_0x48c123=_0x48c123[_0x7b6b('0x74')](0x0,_0x48c123[_0x7b6b('0x75')](_0x3514a0));}if(!_0x4a97e7[_0x7b6b('0x6b')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4a97e7);})[_0x7b6b('0x21')](function(_0x5b2fad){if(_0x5b2fad){return rp({'method':_0x7b6b('0x76'),'uri':util[_0x7b6b('0x77')](_0x7b6b('0x78'),_0x30cfa3),'qs':{'module':_0x7b6b('0x79')},'headers':{'Authorization':_0x7b6b('0x7a')+_0x5b2fad},'json':!![]});}})['then'](function(_0x568669){if(_0x568669){if(_0x568669[_0x7b6b('0x7b')]&&_0x568669['response']['error']){throw new Error(_0x568669['response'][_0x7b6b('0x28')][_0x7b6b('0x2a')]);}var _0x19bf48=[];var _0x144b6f=[];var _0x272b4c=[_0x7b6b('0x7c'),_0x7b6b('0x7d'),_0x7b6b('0x7e'),_0x7b6b('0x7f'),_0x7b6b('0x80'),_0x7b6b('0x81'),_0x7b6b('0x82'),_0x7b6b('0x83')];_0x144b6f=_['remove'](_0x568669[_0x7b6b('0x40')],function(_0x27ea5e){return _0x272b4c[_0x7b6b('0x84')](_0x27ea5e[_0x7b6b('0x85')]);});for(var _0x2e2067=0x0;_0x2e2067<_0x144b6f[_0x7b6b('0x41')];_0x2e2067++){if(_0x144b6f[_0x2e2067]['system_mandatory']===![]){_0x19bf48[_0x7b6b('0x86')]({'id':_0x144b6f[_0x2e2067]['id'],'name':_0x144b6f[_0x2e2067]['display_label'],'custom':_0x144b6f[_0x2e2067]['custom_field'],'options':_0x144b6f[_0x2e2067][_0x7b6b('0x87')]===_0x7b6b('0x88')&&_0x144b6f[_0x2e2067][_0x7b6b('0x89')][_0x7b6b('0x41')]>-0x1?_[_0x7b6b('0x37')](_0x144b6f[_0x2e2067][_0x7b6b('0x89')],function(_0x1d1b8a){return{'name':_0x1d1b8a,'value':_0x1d1b8a};}):[]});}}return{'count':_0x19bf48[_0x7b6b('0x41')],'rows':_0x19bf48};}else{return{'count':0x0,'rows':[]};}})[_0x7b6b('0x21')](respondWithResult(_0x538471,null))['catch'](function(_0xbb28fd){var _0x22c0de=_0x3c4e5a[_0x7b6b('0x3c')][_0x7b6b('0x1c')]?0x1f4:_0xbb28fd[_0x7b6b('0x8a')]||0x1f4;logger['error'](_0x7b6b('0x8b'),_0x7b6b('0x6f'),_0x22c0de,JSON[_0x7b6b('0x27')](_0xbb28fd));delete _0xbb28fd[_0x7b6b('0x3b')];if(_0x22c0de===0x191){_0x22c0de=0x190;}_0x538471[_0x7b6b('0x2d')](_0x22c0de)[_0x7b6b('0x8c')](_0x3c4e5a['query']['test']?{'message':_0x7b6b('0x8d'),'statusCode':_0xbb28fd['statusCode']}:_0xbb28fd);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index ca4be0c..3ae3ab2 100644 --- a/server/api/intZohoAccount/intZohoAccount.model.js +++ b/server/api/intZohoAccount/intZohoAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63fb=['POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lastIndexOf','refreshToken','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0x63fb,0xc0));var _0xb63f=function(_0x5e73b8,_0x42cc33){_0x5e73b8=_0x5e73b8-0x0;var _0x5387de=_0x63fb[_0x5e73b8];return _0x5387de;};'use strict';var _=require(_0xb63f('0x0'));var util=require(_0xb63f('0x1'));var logger=require(_0xb63f('0x2'))(_0xb63f('0x3'));var moment=require(_0xb63f('0x4'));var BPromise=require(_0xb63f('0x5'));var rp=require(_0xb63f('0x6'));var fs=require('fs');var path=require(_0xb63f('0x7'));var rimraf=require(_0xb63f('0x8'));var config=require('../../config/environment');var attributes=require(_0xb63f('0x9'));var integrations=require(_0xb63f('0xa'));module[_0xb63f('0xb')]=function(_0x22e495,_0x3cd953){return _0x22e495[_0xb63f('0xc')](_0xb63f('0xd'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5101d9,_0x3efbd6,_0x4efc65){if(_0x5101d9[_0xb63f('0xe')](_0xb63f('0xf'))||_0x5101d9[_0xb63f('0xe')](_0xb63f('0x10'))||_0x5101d9[_0xb63f('0xe')](_0xb63f('0x11'))||_0x5101d9['changed'](_0xb63f('0x12'))||_0x5101d9[_0xb63f('0xe')](_0xb63f('0x13'))||_0x5101d9[_0xb63f('0xe')](_0xb63f('0x14'))){var _0x3abfe0,_0x58c534;_0x3abfe0=_0x5101d9[_0xb63f('0x10')];var _0x3e19e1=_0x3abfe0[_0xb63f('0x15')](-0x1);if(_0x3e19e1==='/'||_0x3e19e1==='\x5c'||_0x3e19e1===':'){_0x3abfe0=_0x3abfe0[_0xb63f('0x16')](0x0,_0x3abfe0['lastIndexOf'](_0x3e19e1));}switch(_0x5101d9[_0xb63f('0xf')]){case'US':_0x58c534=_0xb63f('0x17');break;case'AU':_0x58c534=_0xb63f('0x18');break;case'IN':_0x58c534=_0xb63f('0x19');break;case'CN':_0x58c534=_0xb63f('0x1a');break;default:_0x58c534=_0xb63f('0x1b');break;}var _0x5beafd={'method':_0xb63f('0x1c'),'uri':_0x58c534+_0xb63f('0x1d'),'form':{'grant_type':_0xb63f('0x1e'),'client_id':_0x5101d9['clientId'],'client_secret':_0x5101d9[_0xb63f('0x12')],'redirect_uri':_0x5101d9['serverUrl'],'code':_0x5101d9['code']},'headers':{'Content-Type':_0xb63f('0x1f')}};return rp(_0x5beafd)[_0xb63f('0x20')](function(_0x47812a){var _0x513f5e=JSON[_0xb63f('0x21')](_0x47812a);if(_0x513f5e[_0xb63f('0x22')]){_0x5101d9['refreshToken']=_0x513f5e[_0xb63f('0x22')];logger[_0xb63f('0x23')](util[_0xb63f('0x24')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5101d9[_0xb63f('0x25')],_0x5101d9['id']));}else{logger[_0xb63f('0x26')](util[_0xb63f('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5101d9['name'],_0x5101d9['id']),util[_0xb63f('0x27')](_0x513f5e,{'showHidden':![],'depth':null}));}return _0x4efc65(null,_0x3efbd6);})[_0xb63f('0x28')](function(_0x4e16bb){logger[_0xb63f('0x26')](util[_0xb63f('0x24')](_0xb63f('0x29'),_0x5101d9[_0xb63f('0x25')],_0x5101d9['id']),util[_0xb63f('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x4efc65(_0x4e16bb);});}else{return _0x4efc65(null,_0x3efbd6);}},'beforeUpdate':function(_0x1e120e,_0x39df40,_0x18ddc9){if(_0x1e120e['changed'](_0xb63f('0xf'))||_0x1e120e[_0xb63f('0xe')](_0xb63f('0x10'))||_0x1e120e[_0xb63f('0xe')](_0xb63f('0x11'))||_0x1e120e[_0xb63f('0xe')](_0xb63f('0x12'))||_0x1e120e['changed']('code')||_0x1e120e[_0xb63f('0xe')](_0xb63f('0x14'))){var _0x563099,_0x292e49;_0x563099=_0x1e120e[_0xb63f('0x10')];var _0x26e083=_0x563099[_0xb63f('0x15')](-0x1);if(_0x26e083==='/'||_0x26e083==='\x5c'||_0x26e083===':'){_0x563099=_0x563099[_0xb63f('0x16')](0x0,_0x563099[_0xb63f('0x2a')](_0x26e083));}switch(_0x1e120e[_0xb63f('0xf')]){case'US':_0x292e49=_0xb63f('0x17');break;case'AU':_0x292e49=_0xb63f('0x18');break;case'IN':_0x292e49=_0xb63f('0x19');break;case'CN':_0x292e49='https://accounts.zoho.com.cn';break;default:_0x292e49=_0xb63f('0x1b');break;}var _0x48b413={'method':_0xb63f('0x1c'),'uri':_0x292e49+_0xb63f('0x1d'),'form':{'grant_type':_0xb63f('0x1e'),'client_id':_0x1e120e['clientId'],'client_secret':_0x1e120e[_0xb63f('0x12')],'redirect_uri':_0x1e120e[_0xb63f('0x10')],'code':_0x1e120e[_0xb63f('0x13')]},'headers':{'Content-Type':_0xb63f('0x1f')}};return rp(_0x48b413)['then'](function(_0x2b5178){var _0x28072b=JSON['parse'](_0x2b5178);if(_0x28072b[_0xb63f('0x22')]){_0x1e120e[_0xb63f('0x2b')]=_0x28072b[_0xb63f('0x22')];logger['info'](util[_0xb63f('0x24')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1e120e['name'],_0x1e120e['id']));}else{logger['error'](util[_0xb63f('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1e120e['name'],_0x1e120e['id']),util[_0xb63f('0x27')](_0x28072b,{'showHidden':![],'depth':null}));}return _0x18ddc9(null,_0x39df40);})[_0xb63f('0x28')](function(_0x4f379a){logger['error'](util[_0xb63f('0x24')](_0xb63f('0x29'),_0x1e120e[_0xb63f('0x25')],_0x1e120e['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x18ddc9(_0x4f379a);});}else{return _0x18ddc9(null,_0x39df40);}}}});}; \ No newline at end of file +var _0x9d3a=['https://accounts.zoho.com.au','https://accounts.zoho.com.cn','refreshToken','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','host','slice','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lastIndexOf'];(function(_0xcfec5d,_0x2fd0e7){var _0x4ec4d4=function(_0x4999bf){while(--_0x4999bf){_0xcfec5d['push'](_0xcfec5d['shift']());}};_0x4ec4d4(++_0x2fd0e7);}(_0x9d3a,0x17d));var _0xa9d3=function(_0x281372,_0x2a5398){_0x281372=_0x281372-0x0;var _0x4957b6=_0x9d3a[_0x281372];return _0x4957b6;};'use strict';var _=require('lodash');var util=require(_0xa9d3('0x0'));var logger=require(_0xa9d3('0x1'))(_0xa9d3('0x2'));var moment=require(_0xa9d3('0x3'));var BPromise=require(_0xa9d3('0x4'));var rp=require(_0xa9d3('0x5'));var fs=require('fs');var path=require(_0xa9d3('0x6'));var rimraf=require(_0xa9d3('0x7'));var config=require(_0xa9d3('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa9d3('0x9')]=function(_0x314f74,_0x4c65d6){return _0x314f74[_0xa9d3('0xa')]('ZohoAccount',attributes,{'tableName':_0xa9d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a4724,_0x4c419f,_0x19729c){if(_0x4a4724[_0xa9d3('0xc')](_0xa9d3('0xd'))||_0x4a4724[_0xa9d3('0xc')](_0xa9d3('0xe'))||_0x4a4724[_0xa9d3('0xc')]('clientId')||_0x4a4724[_0xa9d3('0xc')](_0xa9d3('0xf'))||_0x4a4724['changed'](_0xa9d3('0x10'))||_0x4a4724[_0xa9d3('0xc')](_0xa9d3('0x11'))){var _0x5ec1e7,_0x4d894f;_0x5ec1e7=_0x4a4724[_0xa9d3('0xe')];var _0x524628=_0x5ec1e7[_0xa9d3('0x12')](-0x1);if(_0x524628==='/'||_0x524628==='\x5c'||_0x524628===':'){_0x5ec1e7=_0x5ec1e7['substring'](0x0,_0x5ec1e7['lastIndexOf'](_0x524628));}switch(_0x4a4724[_0xa9d3('0xd')]){case'US':_0x4d894f=_0xa9d3('0x13');break;case'AU':_0x4d894f='https://accounts.zoho.com.au';break;case'IN':_0x4d894f=_0xa9d3('0x14');break;case'CN':_0x4d894f='https://accounts.zoho.com.cn';break;default:_0x4d894f=_0xa9d3('0x15');break;}var _0x4c4fcc={'method':_0xa9d3('0x16'),'uri':_0x4d894f+_0xa9d3('0x17'),'form':{'grant_type':_0xa9d3('0x18'),'client_id':_0x4a4724[_0xa9d3('0x19')],'client_secret':_0x4a4724[_0xa9d3('0xf')],'redirect_uri':_0x4a4724['serverUrl'],'code':_0x4a4724[_0xa9d3('0x10')]},'headers':{'Content-Type':_0xa9d3('0x1a')}};return rp(_0x4c4fcc)[_0xa9d3('0x1b')](function(_0x171a50){var _0x1eac69=JSON[_0xa9d3('0x1c')](_0x171a50);if(_0x1eac69[_0xa9d3('0x1d')]){_0x4a4724['refreshToken']=_0x1eac69[_0xa9d3('0x1d')];logger[_0xa9d3('0x1e')](util[_0xa9d3('0x1f')](_0xa9d3('0x20'),_0x4a4724[_0xa9d3('0x21')],_0x4a4724['id']));}else{logger[_0xa9d3('0x22')](util['format'](_0xa9d3('0x23'),_0x4a4724[_0xa9d3('0x21')],_0x4a4724['id']),util[_0xa9d3('0x24')](_0x1eac69,{'showHidden':![],'depth':null}));}return _0x19729c(null,_0x4c419f);})[_0xa9d3('0x25')](function(_0x2bc0a9){logger[_0xa9d3('0x22')](util['format'](_0xa9d3('0x23'),_0x4a4724[_0xa9d3('0x21')],_0x4a4724['id']),util[_0xa9d3('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x19729c(_0x2bc0a9);});}else{return _0x19729c(null,_0x4c419f);}},'beforeUpdate':function(_0x5b6a56,_0x41cbc7,_0x548d07){if(_0x5b6a56[_0xa9d3('0xc')]('zone')||_0x5b6a56[_0xa9d3('0xc')](_0xa9d3('0xe'))||_0x5b6a56[_0xa9d3('0xc')](_0xa9d3('0x19'))||_0x5b6a56[_0xa9d3('0xc')](_0xa9d3('0xf'))||_0x5b6a56[_0xa9d3('0xc')]('code')||_0x5b6a56[_0xa9d3('0xc')](_0xa9d3('0x11'))){var _0x480204,_0x28dd19;_0x480204=_0x5b6a56['serverUrl'];var _0x552017=_0x480204[_0xa9d3('0x12')](-0x1);if(_0x552017==='/'||_0x552017==='\x5c'||_0x552017===':'){_0x480204=_0x480204['substring'](0x0,_0x480204[_0xa9d3('0x26')](_0x552017));}switch(_0x5b6a56['zone']){case'US':_0x28dd19=_0xa9d3('0x13');break;case'AU':_0x28dd19=_0xa9d3('0x27');break;case'IN':_0x28dd19=_0xa9d3('0x14');break;case'CN':_0x28dd19=_0xa9d3('0x28');break;default:_0x28dd19='https://accounts.zoho.eu';break;}var _0x258d33={'method':_0xa9d3('0x16'),'uri':_0x28dd19+_0xa9d3('0x17'),'form':{'grant_type':_0xa9d3('0x18'),'client_id':_0x5b6a56[_0xa9d3('0x19')],'client_secret':_0x5b6a56[_0xa9d3('0xf')],'redirect_uri':_0x5b6a56[_0xa9d3('0xe')],'code':_0x5b6a56['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x258d33)[_0xa9d3('0x1b')](function(_0x22b394){var _0x110a08=JSON[_0xa9d3('0x1c')](_0x22b394);if(_0x110a08[_0xa9d3('0x1d')]){_0x5b6a56[_0xa9d3('0x29')]=_0x110a08['refresh_token'];logger[_0xa9d3('0x1e')](util[_0xa9d3('0x1f')](_0xa9d3('0x20'),_0x5b6a56['name'],_0x5b6a56['id']));}else{logger[_0xa9d3('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5b6a56[_0xa9d3('0x21')],_0x5b6a56['id']),util[_0xa9d3('0x24')](_0x110a08,{'showHidden':![],'depth':null}));}return _0x548d07(null,_0x41cbc7);})[_0xa9d3('0x25')](function(_0x3203b9){logger[_0xa9d3('0x22')](util['format'](_0xa9d3('0x23'),_0x5b6a56[_0xa9d3('0x21')],_0x5b6a56['id']),util[_0xa9d3('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x548d07(_0x3203b9);});}else{return _0x548d07(null,_0x41cbc7);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f8c26ae..43f71b5 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4de=['include','map','model','attributes','GetZohoAccount','catch','ShowZohoAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount','findAll','options','raw','where','limit'];(function(_0x8c5e96,_0x42f32e){var _0x114b08=function(_0x53da46){while(--_0x53da46){_0x8c5e96['push'](_0x8c5e96['shift']());}};_0x114b08(++_0x42f32e);}(_0xf4de,0xdf));var _0xef4d=function(_0x226b77,_0x1126c5){_0x226b77=_0x226b77-0x0;var _0x24df4a=_0xf4de[_0x226b77];return _0x24df4a;};'use strict';var _=require(_0xef4d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xef4d('0x1'));var rs=require(_0xef4d('0x2'));var fs=require('fs');var Redis=require(_0xef4d('0x3'));var db=require(_0xef4d('0x4'))['db'];var utils=require(_0xef4d('0x5'));var logger=require(_0xef4d('0x6'))(_0xef4d('0x7'));var config=require(_0xef4d('0x8'));var jayson=require(_0xef4d('0x9'));var client=jayson[_0xef4d('0xa')][_0xef4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x595b34,_0x2214a4,_0x233c3e){return new BPromise(function(_0x2db32f,_0x2c32b1){return client[_0xef4d('0xc')](_0x595b34,_0x233c3e)[_0xef4d('0xd')](function(_0x13055d){logger[_0xef4d('0xe')](_0xef4d('0xf'),_0x2214a4,_0xef4d('0x10'));logger[_0xef4d('0x11')](_0xef4d('0x12'),_0x2214a4,_0xef4d('0x10'),JSON[_0xef4d('0x13')](_0x13055d));if(_0x13055d['error']){if(_0x13055d[_0xef4d('0x14')][_0xef4d('0x15')]===0x1f4){logger[_0xef4d('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x2214a4,_0x13055d[_0xef4d('0x14')][_0xef4d('0x16')]);return _0x2c32b1(_0x13055d[_0xef4d('0x14')][_0xef4d('0x16')]);}logger['error'](_0xef4d('0xf'),_0x2214a4,_0x13055d[_0xef4d('0x14')]['message']);return _0x2db32f(_0x13055d[_0xef4d('0x14')]['message']);}else{logger['info'](_0xef4d('0xf'),_0x2214a4,_0xef4d('0x10'));_0x2db32f(_0x13055d['result']['message']);}})['catch'](function(_0x577592){logger[_0xef4d('0x14')](_0xef4d('0xf'),_0x2214a4,_0x577592);_0x2c32b1(_0x577592);});});}exports['GetZohoAccount']=function(_0x27306b){var _0x392f46=this;return new Promise(function(_0x163b4f,_0x5c4687){return db[_0xef4d('0x17')][_0xef4d('0x18')]({'raw':_0x27306b[_0xef4d('0x19')]?_0x27306b[_0xef4d('0x19')][_0xef4d('0x1a')]===undefined?!![]:![]:!![],'where':_0x27306b['options']?_0x27306b[_0xef4d('0x19')][_0xef4d('0x1b')]||null:null,'attributes':_0x27306b[_0xef4d('0x19')]?_0x27306b[_0xef4d('0x19')]['attributes']||null:null,'limit':_0x27306b[_0xef4d('0x19')]?_0x27306b[_0xef4d('0x19')][_0xef4d('0x1c')]||null:null,'include':_0x27306b[_0xef4d('0x19')]?_0x27306b['options'][_0xef4d('0x1d')]?_[_0xef4d('0x1e')](_0x27306b[_0xef4d('0x19')][_0xef4d('0x1d')],function(_0x560db9){return{'model':db[_0x560db9[_0xef4d('0x1f')]],'as':_0x560db9['as'],'attributes':_0x560db9[_0xef4d('0x20')],'include':_0x560db9[_0xef4d('0x1d')]?_[_0xef4d('0x1e')](_0x560db9['include'],function(_0x57da64){return{'model':db[_0x57da64['model']],'as':_0x57da64['as'],'attributes':_0x57da64['attributes'],'include':_0x57da64[_0xef4d('0x1d')]?_['map'](_0x57da64[_0xef4d('0x1d')],function(_0x37e9d1){return{'model':db[_0x37e9d1[_0xef4d('0x1f')]],'as':_0x37e9d1['as'],'attributes':_0x37e9d1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x227b14){logger[_0xef4d('0xe')](_0xef4d('0x21'),_0x27306b);logger['debug'](_0xef4d('0x21'),_0x27306b,JSON[_0xef4d('0x13')](_0x227b14));_0x163b4f(_0x227b14);})[_0xef4d('0x22')](function(_0x37a3e5){logger[_0xef4d('0x14')]('GetZohoAccount',_0x37a3e5[_0xef4d('0x16')],_0x27306b);_0x5c4687(_0x392f46[_0xef4d('0x14')](0x1f4,_0x37a3e5[_0xef4d('0x16')]));});});};exports[_0xef4d('0x23')]=function(_0x146abb){var _0x5c164e=this;return new Promise(function(_0x54f0d4,_0x3851ae){return db[_0xef4d('0x17')]['find']({'raw':_0x146abb['options']?_0x146abb[_0xef4d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x146abb['options']?_0x146abb[_0xef4d('0x19')][_0xef4d('0x1b')]||null:null,'attributes':_0x146abb[_0xef4d('0x19')]?_0x146abb[_0xef4d('0x19')]['attributes']||null:null,'include':_0x146abb[_0xef4d('0x19')]?_0x146abb[_0xef4d('0x19')][_0xef4d('0x1d')]?_[_0xef4d('0x1e')](_0x146abb['options'][_0xef4d('0x1d')],function(_0x4e1875){return{'model':db[_0x4e1875[_0xef4d('0x1f')]],'as':_0x4e1875['as'],'attributes':_0x4e1875[_0xef4d('0x20')],'include':_0x4e1875[_0xef4d('0x1d')]?_[_0xef4d('0x1e')](_0x4e1875[_0xef4d('0x1d')],function(_0x217ecd){return{'model':db[_0x217ecd[_0xef4d('0x1f')]],'as':_0x217ecd['as'],'attributes':_0x217ecd['attributes'],'include':_0x217ecd['include']?_[_0xef4d('0x1e')](_0x217ecd[_0xef4d('0x1d')],function(_0x942c8a){return{'model':db[_0x942c8a[_0xef4d('0x1f')]],'as':_0x942c8a['as'],'attributes':_0x942c8a[_0xef4d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xef4d('0xd')](function(_0x415dcc){logger[_0xef4d('0xe')](_0xef4d('0x23'),_0x146abb);logger[_0xef4d('0x11')](_0xef4d('0x23'),_0x146abb,JSON[_0xef4d('0x13')](_0x415dcc));_0x54f0d4(_0x415dcc);})[_0xef4d('0x22')](function(_0x1ce917){logger[_0xef4d('0x14')](_0xef4d('0x23'),_0x1ce917[_0xef4d('0x16')],_0x146abb);_0x3851ae(_0x5c164e[_0xef4d('0x14')](0x1f4,_0x1ce917[_0xef4d('0x16')]));});});}; \ No newline at end of file +var _0xeb33=['ShowZohoAccount','ZohoAccount','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x3b8ba1,_0x56e44c){var _0x10c1c6=function(_0x2589c0){while(--_0x2589c0){_0x3b8ba1['push'](_0x3b8ba1['shift']());}};_0x10c1c6(++_0x56e44c);}(_0xeb33,0xf0));var _0x3eb3=function(_0x10684b,_0x558993){_0x10684b=_0x10684b-0x0;var _0xf9894b=_0xeb33[_0x10684b];return _0xf9894b;};'use strict';var _=require(_0x3eb3('0x0'));var util=require(_0x3eb3('0x1'));var moment=require(_0x3eb3('0x2'));var BPromise=require('bluebird');var rs=require(_0x3eb3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3eb3('0x4'))(_0x3eb3('0x5'));var config=require(_0x3eb3('0x6'));var jayson=require(_0x3eb3('0x7'));var client=jayson['client'][_0x3eb3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf76efb,_0x4deb69,_0x2bd7f2){return new BPromise(function(_0xb2463c,_0x36c63b){return client[_0x3eb3('0x9')](_0xf76efb,_0x2bd7f2)[_0x3eb3('0xa')](function(_0x4bacce){logger[_0x3eb3('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x4deb69,'request\x20sent');logger[_0x3eb3('0xc')](_0x3eb3('0xd'),_0x4deb69,_0x3eb3('0xe'),JSON[_0x3eb3('0xf')](_0x4bacce));if(_0x4bacce[_0x3eb3('0x10')]){if(_0x4bacce['error'][_0x3eb3('0x11')]===0x1f4){logger[_0x3eb3('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x4deb69,_0x4bacce[_0x3eb3('0x10')]['message']);return _0x36c63b(_0x4bacce[_0x3eb3('0x10')]['message']);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4deb69,_0x4bacce['error']['message']);return _0xb2463c(_0x4bacce['error'][_0x3eb3('0x12')]);}else{logger['info'](_0x3eb3('0x13'),_0x4deb69,_0x3eb3('0xe'));_0xb2463c(_0x4bacce[_0x3eb3('0x14')]['message']);}})[_0x3eb3('0x15')](function(_0x44362f){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4deb69,_0x44362f);_0x36c63b(_0x44362f);});});}exports[_0x3eb3('0x16')]=function(_0xd6216c){var _0x1dcc2f=this;return new Promise(function(_0xd7ec94,_0x5d48b4){return db['ZohoAccount'][_0x3eb3('0x17')]({'raw':_0xd6216c[_0x3eb3('0x18')]?_0xd6216c[_0x3eb3('0x18')][_0x3eb3('0x19')]===undefined?!![]:![]:!![],'where':_0xd6216c['options']?_0xd6216c[_0x3eb3('0x18')][_0x3eb3('0x1a')]||null:null,'attributes':_0xd6216c['options']?_0xd6216c[_0x3eb3('0x18')][_0x3eb3('0x1b')]||null:null,'limit':_0xd6216c['options']?_0xd6216c[_0x3eb3('0x18')][_0x3eb3('0x1c')]||null:null,'include':_0xd6216c[_0x3eb3('0x18')]?_0xd6216c[_0x3eb3('0x18')][_0x3eb3('0x1d')]?_[_0x3eb3('0x1e')](_0xd6216c[_0x3eb3('0x18')]['include'],function(_0x28595b){return{'model':db[_0x28595b[_0x3eb3('0x1f')]],'as':_0x28595b['as'],'attributes':_0x28595b[_0x3eb3('0x1b')],'include':_0x28595b['include']?_[_0x3eb3('0x1e')](_0x28595b['include'],function(_0x322f53){return{'model':db[_0x322f53[_0x3eb3('0x1f')]],'as':_0x322f53['as'],'attributes':_0x322f53['attributes'],'include':_0x322f53[_0x3eb3('0x1d')]?_[_0x3eb3('0x1e')](_0x322f53[_0x3eb3('0x1d')],function(_0xd6ca77){return{'model':db[_0xd6ca77[_0x3eb3('0x1f')]],'as':_0xd6ca77['as'],'attributes':_0xd6ca77[_0x3eb3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3eb3('0xa')](function(_0x59ae62){logger['info']('GetZohoAccount',_0xd6216c);logger[_0x3eb3('0xc')](_0x3eb3('0x16'),_0xd6216c,JSON[_0x3eb3('0xf')](_0x59ae62));_0xd7ec94(_0x59ae62);})[_0x3eb3('0x15')](function(_0x3d77fc){logger[_0x3eb3('0x10')](_0x3eb3('0x16'),_0x3d77fc[_0x3eb3('0x12')],_0xd6216c);_0x5d48b4(_0x1dcc2f['error'](0x1f4,_0x3d77fc[_0x3eb3('0x12')]));});});};exports[_0x3eb3('0x20')]=function(_0x5ee378){var _0x267a10=this;return new Promise(function(_0x4ba2c4,_0x47920a){return db[_0x3eb3('0x21')]['find']({'raw':_0x5ee378[_0x3eb3('0x18')]?_0x5ee378[_0x3eb3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5ee378[_0x3eb3('0x18')]?_0x5ee378['options'][_0x3eb3('0x1a')]||null:null,'attributes':_0x5ee378[_0x3eb3('0x18')]?_0x5ee378[_0x3eb3('0x18')][_0x3eb3('0x1b')]||null:null,'include':_0x5ee378['options']?_0x5ee378[_0x3eb3('0x18')][_0x3eb3('0x1d')]?_[_0x3eb3('0x1e')](_0x5ee378[_0x3eb3('0x18')][_0x3eb3('0x1d')],function(_0x21df97){return{'model':db[_0x21df97['model']],'as':_0x21df97['as'],'attributes':_0x21df97[_0x3eb3('0x1b')],'include':_0x21df97[_0x3eb3('0x1d')]?_[_0x3eb3('0x1e')](_0x21df97[_0x3eb3('0x1d')],function(_0x4b33a5){return{'model':db[_0x4b33a5[_0x3eb3('0x1f')]],'as':_0x4b33a5['as'],'attributes':_0x4b33a5[_0x3eb3('0x1b')],'include':_0x4b33a5[_0x3eb3('0x1d')]?_[_0x3eb3('0x1e')](_0x4b33a5[_0x3eb3('0x1d')],function(_0x18c43a){return{'model':db[_0x18c43a[_0x3eb3('0x1f')]],'as':_0x18c43a['as'],'attributes':_0x18c43a[_0x3eb3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3eb3('0xa')](function(_0x18818b){logger[_0x3eb3('0xb')](_0x3eb3('0x20'),_0x5ee378);logger[_0x3eb3('0xc')](_0x3eb3('0x20'),_0x5ee378,JSON['stringify'](_0x18818b));_0x4ba2c4(_0x18818b);})[_0x3eb3('0x15')](function(_0x4385fc){logger['error'](_0x3eb3('0x20'),_0x4385fc['message'],_0x5ee378);_0x47920a(_0x267a10['error'](0x1f4,_0x4385fc[_0x3eb3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 519fe9f..298aec9 100644 --- a/server/api/intZohoConfiguration/index.js +++ b/server/api/intZohoConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','index','get','/:id','show','isAuthenticated','/:id/subjects','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2ee649,_0x46f2d4){var _0xbfa87d=function(_0x5082a2){while(--_0x5082a2){_0x2ee649['push'](_0x2ee649['shift']());}};_0xbfa87d(++_0x46f2d4);}(_0xbec8,0xb5));var _0x8bec=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0xbec8[_0x4b2251];return _0x5d22fb;};'use strict';var multer=require(_0x8bec('0x0'));var util=require(_0x8bec('0x1'));var path=require(_0x8bec('0x2'));var timeout=require(_0x8bec('0x3'));var express=require(_0x8bec('0x4'));var router=express[_0x8bec('0x5')]();var auth=require(_0x8bec('0x6'));var interaction=require(_0x8bec('0x7'));var config=require(_0x8bec('0x8'));var controller=require(_0x8bec('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8bec('0xa')]);router[_0x8bec('0xb')](_0x8bec('0xc'),auth['isAuthenticated'](),controller[_0x8bec('0xd')]);router[_0x8bec('0xb')]('/:id/fields',auth[_0x8bec('0xe')](),controller['getFields']);router[_0x8bec('0xb')](_0x8bec('0xf'),auth[_0x8bec('0xe')](),controller['getSubjects']);router[_0x8bec('0xb')]('/:id/descriptions',auth[_0x8bec('0xe')](),controller[_0x8bec('0x10')]);router['post']('/',auth[_0x8bec('0xe')](),controller[_0x8bec('0x11')]);router[_0x8bec('0x12')](_0x8bec('0xc'),auth[_0x8bec('0xe')](),controller[_0x8bec('0x13')]);router[_0x8bec('0x14')](_0x8bec('0xc'),auth[_0x8bec('0xe')](),controller[_0x8bec('0x15')]);module[_0x8bec('0x16')]=router; \ No newline at end of file +var _0x2c2d=['getDescriptions','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects'];(function(_0x12d85a,_0x8a8a3d){var _0x12a0a9=function(_0x380cc6){while(--_0x380cc6){_0x12d85a['push'](_0x12d85a['shift']());}};_0x12a0a9(++_0x8a8a3d);}(_0x2c2d,0x65));var _0xd2c2=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x2c2d[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0xd2c2('0x0'));var util=require('util');var path=require(_0xd2c2('0x1'));var timeout=require(_0xd2c2('0x2'));var express=require(_0xd2c2('0x3'));var router=express[_0xd2c2('0x4')]();var auth=require(_0xd2c2('0x5'));var interaction=require(_0xd2c2('0x6'));var config=require('../../config/environment');var controller=require(_0xd2c2('0x7'));router[_0xd2c2('0x8')]('/',auth[_0xd2c2('0x9')](),controller['index']);router[_0xd2c2('0x8')]('/:id',auth[_0xd2c2('0x9')](),controller[_0xd2c2('0xa')]);router[_0xd2c2('0x8')]('/:id/fields',auth[_0xd2c2('0x9')](),controller[_0xd2c2('0xb')]);router['get'](_0xd2c2('0xc'),auth['isAuthenticated'](),controller[_0xd2c2('0xd')]);router[_0xd2c2('0x8')]('/:id/descriptions',auth[_0xd2c2('0x9')](),controller[_0xd2c2('0xe')]);router[_0xd2c2('0xf')]('/',auth['isAuthenticated'](),controller[_0xd2c2('0x10')]);router[_0xd2c2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd2c2('0x12')]);router[_0xd2c2('0x13')](_0xd2c2('0x14'),auth['isAuthenticated'](),controller[_0xd2c2('0x15')]);module[_0xd2c2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 602b62d..4a81349 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc961=['Leads','sequelize','exports','STRING','ENUM'];(function(_0x5146e9,_0x539fea){var _0x36be24=function(_0x4dc2d8){while(--_0x4dc2d8){_0x5146e9['push'](_0x5146e9['shift']());}};_0x36be24(++_0x539fea);}(_0xc961,0xbf));var _0x1c96=function(_0x2b9ae3,_0xd6d709){_0x2b9ae3=_0x2b9ae3-0x0;var _0x4e18a2=_0xc961[_0x2b9ae3];return _0x4e18a2;};'use strict';var Sequelize=require(_0x1c96('0x0'));module[_0x1c96('0x1')]={'name':{'type':Sequelize[_0x1c96('0x2')]},'moduleCreate':{'type':Sequelize[_0x1c96('0x3')](_0x1c96('0x4'),'Contacts'),'defaultValue':_0x1c96('0x4')},'description':{'type':Sequelize[_0x1c96('0x2')]}}; \ No newline at end of file +var _0xe327=['STRING','Leads','Contacts','exports'];(function(_0x1ebc29,_0x296e63){var _0x3d59d1=function(_0x493c67){while(--_0x493c67){_0x1ebc29['push'](_0x1ebc29['shift']());}};_0x3d59d1(++_0x296e63);}(_0xe327,0x193));var _0x7e32=function(_0x416287,_0x590d89){_0x416287=_0x416287-0x0;var _0x2d504a=_0xe327[_0x416287];return _0x2d504a;};'use strict';var Sequelize=require('sequelize');module[_0x7e32('0x0')]={'name':{'type':Sequelize[_0x7e32('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x7e32('0x2'),_0x7e32('0x3')),'defaultValue':_0x7e32('0x2')},'description':{'type':Sequelize[_0x7e32('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 3c44777..429bc00 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','name','send','index','ZohoConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','ZohoField','sort','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x40ed4c,_0x3cfe12){var _0x31ac63=function(_0x572bc1){while(--_0x572bc1){_0x40ed4c['push'](_0x40ed4c['shift']());}};_0x31ac63(++_0x3cfe12);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){_0x510841['status'](0xcc)[_0x7995('0x2d')]();});}};}function handleEntityNotFound(_0x3acfc3,_0x4a176f){return function(_0x3e7020){if(!_0x3e7020){_0x3acfc3['sendStatus'](0x194);}return _0x3e7020;};}function handleError(_0x37917b,_0x1cb058){_0x1cb058=_0x1cb058||0x1f4;return function(_0x177cb4){logger['error'](_0x177cb4['stack']);if(_0x177cb4[_0x7995('0x36')]){delete _0x177cb4['name'];}_0x37917b['status'](_0x1cb058)[_0x7995('0x37')](_0x177cb4);};}exports[_0x7995('0x38')]=function(_0x5212ff,_0x1baa15){var _0x1922b4={},_0x2b772f={},_0x18667c={'count':0x0,'rows':[]};var _0x1e3dbf=_['map'](db[_0x7995('0x39')][_0x7995('0x3a')],function(_0xf612e6){return{'name':_0xf612e6[_0x7995('0x3b')],'type':_0xf612e6['type'][_0x7995('0x3c')]};});_0x2b772f[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x1e3dbf,_0x7995('0x36'));_0x2b772f[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x5212ff['query']);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],_0x2b772f[_0x7995('0x3f')]);_0x1922b4[_0x7995('0x43')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],qs[_0x7995('0x44')](_0x5212ff[_0x7995('0x3f')][_0x7995('0x44')]));_0x1922b4[_0x7995('0x43')]=_0x1922b4[_0x7995('0x43')][_0x7995('0x45')]?_0x1922b4['attributes']:_0x2b772f['model'];if(!_0x5212ff[_0x7995('0x3f')][_0x7995('0x46')]('nolimit')){_0x1922b4['limit']=qs[_0x7995('0x47')](_0x5212ff['query']['limit']);_0x1922b4[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x5212ff[_0x7995('0x3f')]['offset']);}_0x1922b4[_0x7995('0x48')]=qs['sort'](_0x5212ff[_0x7995('0x3f')]['sort']);_0x1922b4['where']=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x5212ff[_0x7995('0x3f')],_0x2b772f[_0x7995('0x41')]));if(_0x5212ff['query'][_0x7995('0x4a')]){_0x1922b4[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x1922b4[_0x7995('0x4b')],{'$or':_['map'](_0x1e3dbf,function(_0x5f28e7){if(_0x5f28e7[_0x7995('0x4d')]!=='VIRTUAL'){var _0x23c41d={};_0x23c41d[_0x5f28e7['name']]={'$like':'%'+_0x5212ff[_0x7995('0x3f')]['filter']+'%'};return _0x23c41d;}})});}_0x1922b4=_[_0x7995('0x4c')]({},_0x1922b4,_0x5212ff[_0x7995('0x4e')]);var _0x4d9245={'where':_0x1922b4[_0x7995('0x4b')]};return db[_0x7995('0x39')][_0x7995('0x2f')](_0x4d9245)[_0x7995('0x20')](function(_0x4c6837){_0x18667c[_0x7995('0x2f')]=_0x4c6837;if(_0x5212ff[_0x7995('0x3f')][_0x7995('0x4f')]){_0x1922b4['include']=[{'all':!![]}];}return db[_0x7995('0x39')][_0x7995('0x50')](_0x1922b4);})[_0x7995('0x20')](function(_0x3d8ae3){_0x18667c[_0x7995('0x51')]=_0x3d8ae3;return _0x18667c;})['then'](respondWithFilteredResult(_0x1baa15,_0x1922b4))[_0x7995('0x2a')](handleError(_0x1baa15,null));};exports[_0x7995('0x52')]=function(_0x5921b9,_0x3d1dbb){var _0x5843ba={'raw':![],'where':{'id':_0x5921b9[_0x7995('0x53')]['id']}},_0x1d87f9={};_0x1d87f9[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x39')][_0x7995('0x3a')]);_0x1d87f9[_0x7995('0x3f')]=_['keys'](_0x5921b9[_0x7995('0x3f')]);_0x1d87f9[_0x7995('0x41')]=_[_0x7995('0x42')](_0x1d87f9['model'],_0x1d87f9[_0x7995('0x3f')]);_0x5843ba[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1d87f9['model'],qs['fields'](_0x5921b9['query'][_0x7995('0x44')]));_0x5843ba[_0x7995('0x43')]=_0x5843ba['attributes'][_0x7995('0x45')]?_0x5843ba[_0x7995('0x43')]:_0x1d87f9[_0x7995('0x3d')];if(_0x5921b9[_0x7995('0x3f')][_0x7995('0x4f')]){_0x5843ba['include']=[{'all':!![]}];}_0x5843ba=_[_0x7995('0x4c')]({},_0x5843ba,_0x5921b9['options']);return db[_0x7995('0x39')][_0x7995('0x54')](_0x5843ba)[_0x7995('0x20')](handleEntityNotFound(_0x3d1dbb,null))['then'](respondWithResult(_0x3d1dbb,null))['catch'](handleError(_0x3d1dbb,null));};exports['create']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x39')][_0x7995('0x55')](_0x563f8e[_0x7995('0x56')],{})[_0x7995('0x20')](respondWithResult(_0x2e13b0,0xc9))[_0x7995('0x2a')](handleError(_0x2e13b0,null));};exports[_0x7995('0x35')]=function(_0xda6ce8,_0x328671){if(_0xda6ce8[_0x7995('0x56')]['id']){delete _0xda6ce8[_0x7995('0x56')]['id'];}return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0xda6ce8[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x328671,null))[_0x7995('0x20')](saveUpdates(_0xda6ce8[_0x7995('0x56')],null))[_0x7995('0x20')](respondWithResult(_0x328671,null))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['destroy']=function(_0x56a374,_0x630737){return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0x56a374['params']['id']}})['then'](handleEntityNotFound(_0x630737,null))[_0x7995('0x20')](removeEntity(_0x630737,null))[_0x7995('0x2a')](handleError(_0x630737,null));};exports[_0x7995('0x57')]=function(_0x332a85,_0x51c50b,_0x13cd7b){var _0x74ff38={};var _0xef5044={};var _0x33c49c;var _0x502d43;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x332a85[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x51c50b,null))[_0x7995('0x20')](function(_0x37072){if(_0x37072){_0x33c49c=_0x37072;_0xef5044[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0xef5044['query']=_[_0x7995('0x40')](_0x332a85[_0x7995('0x3f')]);_0xef5044[_0x7995('0x41')]=_[_0x7995('0x42')](_0xef5044['model'],_0xef5044['query']);_0x74ff38[_0x7995('0x43')]=_[_0x7995('0x42')](_0xef5044['model'],qs[_0x7995('0x44')](_0x332a85[_0x7995('0x3f')][_0x7995('0x44')]));_0x74ff38[_0x7995('0x43')]=_0x74ff38[_0x7995('0x43')]['length']?_0x74ff38[_0x7995('0x43')]:_0xef5044['model'];_0x74ff38[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x332a85[_0x7995('0x3f')][_0x7995('0x5a')]);_0x74ff38[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x332a85[_0x7995('0x3f')],_0xef5044[_0x7995('0x41')]));if(_0x332a85[_0x7995('0x3f')][_0x7995('0x4a')]){_0x74ff38[_0x7995('0x4b')]=_['merge'](_0x74ff38[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x74ff38[_0x7995('0x43')],function(_0xc2b660){var _0x2c6548={};_0x2c6548[_0xc2b660]={'$like':'%'+_0x332a85['query']['filter']+'%'};return _0x2c6548;})});}_0x74ff38=_[_0x7995('0x4c')]({},_0x74ff38,_0x332a85[_0x7995('0x4e')]);return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})[_0x7995('0x20')](function(_0x5aa2ec){if(_0x5aa2ec){_0x502d43=_0x5aa2ec[_0x7995('0x45')];if(!_0x332a85['query']['hasOwnProperty'](_0x7995('0x5b'))){_0x74ff38[_0x7995('0x47')]=qs[_0x7995('0x47')](_0x332a85[_0x7995('0x3f')][_0x7995('0x47')]);_0x74ff38[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x332a85[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})['then'](function(_0x2dc1f7){if(_0x2dc1f7){return _0x2dc1f7?{'count':_0x502d43,'rows':_0x2dc1f7}:null;}})[_0x7995('0x20')](respondWithResult(_0x51c50b,null))[_0x7995('0x2a')](handleError(_0x51c50b,null));};exports['getSubjects']=function(_0x1fe1cb,_0x1d2f9d,_0x705f0){var _0x3a7d9d={};var _0x3b0d30={};var _0x51ab1e;var _0x550a10;return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x1fe1cb[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x1d2f9d,null))['then'](function(_0x5e8b4c){if(_0x5e8b4c){_0x51ab1e=_0x5e8b4c;_0x3b0d30[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0x3b0d30['query']=_[_0x7995('0x40')](_0x1fe1cb[_0x7995('0x3f')]);_0x3b0d30['filters']=_['intersection'](_0x3b0d30[_0x7995('0x3d')],_0x3b0d30[_0x7995('0x3f')]);_0x3a7d9d['attributes']=_[_0x7995('0x42')](_0x3b0d30['model'],qs[_0x7995('0x44')](_0x1fe1cb[_0x7995('0x3f')]['fields']));_0x3a7d9d['attributes']=_0x3a7d9d[_0x7995('0x43')]['length']?_0x3a7d9d[_0x7995('0x43')]:_0x3b0d30[_0x7995('0x3d')];_0x3a7d9d[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x5a')]);_0x3a7d9d[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x1fe1cb[_0x7995('0x3f')],_0x3b0d30[_0x7995('0x41')]));if(_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]){_0x3a7d9d[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x3a7d9d[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x3a7d9d[_0x7995('0x43')],function(_0x2ff7ba){var _0xa2fc8e={};_0xa2fc8e[_0x2ff7ba]={'$like':'%'+_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]+'%'};return _0xa2fc8e;})});}_0x3a7d9d=_[_0x7995('0x4c')]({},_0x3a7d9d,_0x1fe1cb[_0x7995('0x4e')]);return _0x51ab1e[_0x7995('0x5c')](_0x3a7d9d);}})[_0x7995('0x20')](function(_0x2f7f51){if(_0x2f7f51){_0x550a10=_0x2f7f51[_0x7995('0x45')];if(!_0x1fe1cb['query'][_0x7995('0x46')](_0x7995('0x5b'))){_0x3a7d9d['limit']=qs['limit'](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x47')]);_0x3a7d9d[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x51ab1e['getSubjects'](_0x3a7d9d);}})[_0x7995('0x20')](function(_0xb68962){if(_0xb68962){return _0xb68962?{'count':_0x550a10,'rows':_0xb68962}:null;}})[_0x7995('0x20')](respondWithResult(_0x1d2f9d,null))[_0x7995('0x2a')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x5d')]=function(_0x3f0bff,_0x151d99,_0xc93dcb){var _0x560095={};var _0x1c8e7d={};var _0x2b8217;var _0x5c04c9;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x3f0bff[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x151d99,null))[_0x7995('0x20')](function(_0xe42797){if(_0xe42797){_0x2b8217=_0xe42797;_0x1c8e7d['model']=_[_0x7995('0x40')](db[_0x7995('0x59')]['rawAttributes']);_0x1c8e7d[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x3f0bff['query']);_0x1c8e7d[_0x7995('0x41')]=_['intersection'](_0x1c8e7d[_0x7995('0x3d')],_0x1c8e7d[_0x7995('0x3f')]);_0x560095[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1c8e7d[_0x7995('0x3d')],qs['fields'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x44')]));_0x560095[_0x7995('0x43')]=_0x560095['attributes'][_0x7995('0x45')]?_0x560095[_0x7995('0x43')]:_0x1c8e7d[_0x7995('0x3d')];_0x560095[_0x7995('0x48')]=qs['sort'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x5a')]);_0x560095[_0x7995('0x4b')]=qs['filters'](_['pick'](_0x3f0bff[_0x7995('0x3f')],_0x1c8e7d[_0x7995('0x41')]));if(_0x3f0bff['query']['filter']){_0x560095[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x560095[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x560095[_0x7995('0x43')],function(_0x551b5e){var _0x56003d={};_0x56003d[_0x551b5e]={'$like':'%'+_0x3f0bff[_0x7995('0x3f')]['filter']+'%'};return _0x56003d;})});}_0x560095=_['merge']({},_0x560095,_0x3f0bff[_0x7995('0x4e')]);return _0x2b8217[_0x7995('0x5d')](_0x560095);}})[_0x7995('0x20')](function(_0x5eb360){if(_0x5eb360){_0x5c04c9=_0x5eb360[_0x7995('0x45')];if(!_0x3f0bff[_0x7995('0x3f')][_0x7995('0x46')](_0x7995('0x5b'))){_0x560095[_0x7995('0x47')]=qs['limit'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x47')]);_0x560095[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x3f0bff['query'][_0x7995('0x30')]);}return _0x2b8217[_0x7995('0x5d')](_0x560095);}})['then'](function(_0x310272){if(_0x310272){return _0x310272?{'count':_0x5c04c9,'rows':_0x310272}:null;}})[_0x7995('0x20')](respondWithResult(_0x151d99,null))['catch'](handleError(_0x151d99,null));}; \ No newline at end of file +var _0x7217=['fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ZohoConfiguration','includeAll','rows','show','rawAttributes','keys','intersection','include','options','find','create','body','params','getFields','ZohoField','getSubjects','hasOwnProperty','getDescriptions','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','stack','name','index','map','type','key','model','query','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199930,_0x57ff6d,_0x109900){if(_0x109900){var _0x30da54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30da54[_0x7721('0x1d')](_0x57ff6d)){return _0x199930;}else{throw new db[(_0x7721('0x1e'))]['ValidationError'](_0x7721('0x1f'));}}else{return _0x199930;}}function respondWithRpcPromise(_0x25b1c0,_0x534f1b,_0x4e199a,_0x4b183e){return new BPromise(function(_0x5ed54,_0x25a628){var _0x3cc909=_0x4b183e||client;return _0x3cc909[_0x7721('0x20')](_0x25b1c0,_0x4e199a)['then'](function(_0x20f669){logger['info'](_0x7721('0x21'),_0x534f1b,'request\x20sent');logger[_0x7721('0x22')](_0x7721('0x23'),_0x534f1b,_0x7721('0x24'),JSON[_0x7721('0x25')](_0x20f669));if(_0x20f669[_0x7721('0x26')]){if(_0x20f669[_0x7721('0x26')][_0x7721('0x27')]===0x1f4){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669[_0x7721('0x26')]['message']);return _0x25a628(_0x20f669[_0x7721('0x26')][_0x7721('0x28')]);}logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669['error'][_0x7721('0x28')]);return _0x5ed54(_0x20f669['error'][_0x7721('0x28')]);}else{logger[_0x7721('0x29')](_0x7721('0x21'),_0x534f1b,_0x7721('0x24'));_0x5ed54(_0x20f669[_0x7721('0x2a')][_0x7721('0x28')]);}})[_0x7721('0x2b')](function(_0x5b4d74){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x5b4d74);_0x25a628(_0x5b4d74);});});}function respondWithStatusCode(_0x125564,_0x1f67c7){_0x1f67c7=_0x1f67c7||0xcc;return function(_0x40d550){if(_0x40d550){return _0x125564[_0x7721('0x2c')](_0x1f67c7);}return _0x125564[_0x7721('0x2d')](_0x1f67c7)[_0x7721('0x2e')]();};}function respondWithResult(_0x40f367,_0x52316e){_0x52316e=_0x52316e||0xc8;return function(_0x258ddf){if(_0x258ddf){return _0x40f367['status'](_0x52316e)['json'](_0x258ddf);}};}function respondWithFilteredResult(_0x315202,_0x343c19){return function(_0x53c904){if(_0x53c904){var _0x158d98=_0x53c904[_0x7721('0x2f')],_0x1ea4d=_0x343c19['offset'],_0x37b9f0=_0x343c19[_0x7721('0x30')]+_0x343c19[_0x7721('0x31')],_0xd7d703;if(_0x37b9f0>=_0x158d98){_0x37b9f0=_0x158d98;_0xd7d703=0xc8;}else{_0xd7d703=0xce;}_0x315202['status'](_0xd7d703);return _0x315202['set'](_0x7721('0x32'),_0x1ea4d+'-'+_0x37b9f0+'/'+_0x158d98)[_0x7721('0x33')](_0x53c904);}return null;};}function patchUpdates(_0x48f329){return function(_0x46f772){try{jsonpatch[_0x7721('0x34')](_0x46f772,_0x48f329,!![]);}catch(_0x382821){return BPromise['reject'](_0x382821);}return _0x46f772[_0x7721('0x35')]();};}function saveUpdates(_0x1ff31b,_0x1492d4){return function(_0x3f15e2){if(_0x3f15e2){return _0x3f15e2[_0x7721('0x36')](_0x1ff31b)['then'](function(_0x195ffb){return _0x195ffb;});}return null;};}function removeEntity(_0x3e4e56,_0xb2386d){return function(_0x5c5b33){if(_0x5c5b33){return _0x5c5b33[_0x7721('0x37')]()[_0x7721('0x38')](function(){_0x3e4e56['status'](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(!_0x326c50){_0x5ce026[_0x7721('0x2c')](0x194);}return _0x326c50;};}function handleError(_0x1d894b,_0x1c84c0){_0x1c84c0=_0x1c84c0||0x1f4;return function(_0x13c635){logger[_0x7721('0x26')](_0x13c635[_0x7721('0x39')]);if(_0x13c635[_0x7721('0x3a')]){delete _0x13c635[_0x7721('0x3a')];}_0x1d894b[_0x7721('0x2d')](_0x1c84c0)['send'](_0x13c635);};}exports[_0x7721('0x3b')]=function(_0x5e6663,_0x212384){var _0x35614c={},_0x7942f7={},_0x1d03de={'count':0x0,'rows':[]};var _0x3968f3=_[_0x7721('0x3c')](db['ZohoConfiguration']['rawAttributes'],function(_0x4cadef){return{'name':_0x4cadef['fieldName'],'type':_0x4cadef[_0x7721('0x3d')][_0x7721('0x3e')]};});_0x7942f7[_0x7721('0x3f')]=_[_0x7721('0x3c')](_0x3968f3,'name');_0x7942f7[_0x7721('0x40')]=_['keys'](_0x5e6663[_0x7721('0x40')]);_0x7942f7[_0x7721('0x41')]=_['intersection'](_0x7942f7[_0x7721('0x3f')],_0x7942f7[_0x7721('0x40')]);_0x35614c['attributes']=_['intersection'](_0x7942f7[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x5e6663[_0x7721('0x40')][_0x7721('0x42')]));_0x35614c['attributes']=_0x35614c[_0x7721('0x43')][_0x7721('0x44')]?_0x35614c[_0x7721('0x43')]:_0x7942f7[_0x7721('0x3f')];if(!_0x5e6663[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x35614c['limit']=qs[_0x7721('0x31')](_0x5e6663['query'][_0x7721('0x31')]);_0x35614c[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e6663['query'][_0x7721('0x30')]);}_0x35614c[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e6663['query'][_0x7721('0x47')]);_0x35614c[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e6663[_0x7721('0x40')],_0x7942f7[_0x7721('0x41')]));if(_0x5e6663[_0x7721('0x40')]['filter']){_0x35614c['where']=_[_0x7721('0x4a')](_0x35614c[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x3968f3,function(_0x39a3ad){if(_0x39a3ad[_0x7721('0x3d')]!==_0x7721('0x4b')){var _0x1d2ea5={};_0x1d2ea5[_0x39a3ad[_0x7721('0x3a')]]={'$like':'%'+_0x5e6663[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1d2ea5;}})});}_0x35614c=_['merge']({},_0x35614c,_0x5e6663['options']);var _0x5ed70d={'where':_0x35614c[_0x7721('0x48')]};return db[_0x7721('0x4d')][_0x7721('0x2f')](_0x5ed70d)['then'](function(_0x30107e){_0x1d03de[_0x7721('0x2f')]=_0x30107e;if(_0x5e6663['query'][_0x7721('0x4e')]){_0x35614c['include']=[{'all':!![]}];}return db[_0x7721('0x4d')]['findAll'](_0x35614c);})[_0x7721('0x38')](function(_0x196be4){_0x1d03de[_0x7721('0x4f')]=_0x196be4;return _0x1d03de;})['then'](respondWithFilteredResult(_0x212384,_0x35614c))[_0x7721('0x2b')](handleError(_0x212384,null));};exports[_0x7721('0x50')]=function(_0x499381,_0x223d93){var _0x1196c2={'raw':![],'where':{'id':_0x499381['params']['id']}},_0xf88e8c={};_0xf88e8c[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x4d')][_0x7721('0x51')]);_0xf88e8c[_0x7721('0x40')]=_[_0x7721('0x52')](_0x499381[_0x7721('0x40')]);_0xf88e8c[_0x7721('0x41')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],_0xf88e8c[_0x7721('0x40')]);_0x1196c2[_0x7721('0x43')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x499381[_0x7721('0x40')][_0x7721('0x42')]));_0x1196c2['attributes']=_0x1196c2[_0x7721('0x43')][_0x7721('0x44')]?_0x1196c2[_0x7721('0x43')]:_0xf88e8c[_0x7721('0x3f')];if(_0x499381[_0x7721('0x40')][_0x7721('0x4e')]){_0x1196c2[_0x7721('0x54')]=[{'all':!![]}];}_0x1196c2=_['merge']({},_0x1196c2,_0x499381[_0x7721('0x55')]);return db[_0x7721('0x4d')][_0x7721('0x56')](_0x1196c2)[_0x7721('0x38')](handleEntityNotFound(_0x223d93,null))[_0x7721('0x38')](respondWithResult(_0x223d93,null))[_0x7721('0x2b')](handleError(_0x223d93,null));};exports[_0x7721('0x57')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x4d')][_0x7721('0x57')](_0x33287d['body'],{})[_0x7721('0x38')](respondWithResult(_0x11b300,0xc9))[_0x7721('0x2b')](handleError(_0x11b300,null));};exports[_0x7721('0x36')]=function(_0x2ee3c0,_0x15ed3b){if(_0x2ee3c0[_0x7721('0x58')]['id']){delete _0x2ee3c0[_0x7721('0x58')]['id'];}return db[_0x7721('0x4d')][_0x7721('0x56')]({'where':{'id':_0x2ee3c0[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x15ed3b,null))[_0x7721('0x38')](saveUpdates(_0x2ee3c0[_0x7721('0x58')],null))[_0x7721('0x38')](respondWithResult(_0x15ed3b,null))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports['destroy']=function(_0x50e9e9,_0x4e112e){return db[_0x7721('0x4d')]['find']({'where':{'id':_0x50e9e9['params']['id']}})['then'](handleEntityNotFound(_0x4e112e,null))['then'](removeEntity(_0x4e112e,null))[_0x7721('0x2b')](handleError(_0x4e112e,null));};exports[_0x7721('0x5a')]=function(_0x13f254,_0x5343a1,_0x5181d7){var _0x5925b7={};var _0x51a3a2={};var _0x484b8e;var _0x24d1dc;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x13f254['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5343a1,null))[_0x7721('0x38')](function(_0x1ff090){if(_0x1ff090){_0x484b8e=_0x1ff090;_0x51a3a2['model']=_[_0x7721('0x52')](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x51a3a2[_0x7721('0x40')]=_[_0x7721('0x52')](_0x13f254[_0x7721('0x40')]);_0x51a3a2[_0x7721('0x41')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],_0x51a3a2[_0x7721('0x40')]);_0x5925b7[_0x7721('0x43')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x13f254[_0x7721('0x40')]['fields']));_0x5925b7[_0x7721('0x43')]=_0x5925b7[_0x7721('0x43')][_0x7721('0x44')]?_0x5925b7[_0x7721('0x43')]:_0x51a3a2['model'];_0x5925b7[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x13f254['query'][_0x7721('0x47')]);_0x5925b7['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x13f254[_0x7721('0x40')],_0x51a3a2[_0x7721('0x41')]));if(_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]){_0x5925b7[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5925b7[_0x7721('0x48')],{'$or':_['map'](_0x5925b7[_0x7721('0x43')],function(_0x24444f){var _0x112033={};_0x112033[_0x24444f]={'$like':'%'+_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x112033;})});}_0x5925b7=_[_0x7721('0x4a')]({},_0x5925b7,_0x13f254[_0x7721('0x55')]);return _0x484b8e['getFields'](_0x5925b7);}})[_0x7721('0x38')](function(_0xb19b84){if(_0xb19b84){_0x24d1dc=_0xb19b84['length'];if(!_0x13f254[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x5925b7[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x13f254[_0x7721('0x40')][_0x7721('0x31')]);_0x5925b7[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x13f254['query'][_0x7721('0x30')]);}return _0x484b8e[_0x7721('0x5a')](_0x5925b7);}})[_0x7721('0x38')](function(_0x5f08cc){if(_0x5f08cc){return _0x5f08cc?{'count':_0x24d1dc,'rows':_0x5f08cc}:null;}})['then'](respondWithResult(_0x5343a1,null))['catch'](handleError(_0x5343a1,null));};exports['getSubjects']=function(_0x5e966f,_0x1fc5f7,_0x2645dd){var _0x580473={};var _0x2d4b3a={};var _0x42f6e9;var _0xbbc86f;return db[_0x7721('0x4d')]['findOne']({'where':{'id':_0x5e966f[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x1fc5f7,null))[_0x7721('0x38')](function(_0x1bea13){if(_0x1bea13){_0x42f6e9=_0x1bea13;_0x2d4b3a[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x2d4b3a[_0x7721('0x40')]=_['keys'](_0x5e966f['query']);_0x2d4b3a[_0x7721('0x41')]=_[_0x7721('0x53')](_0x2d4b3a[_0x7721('0x3f')],_0x2d4b3a[_0x7721('0x40')]);_0x580473[_0x7721('0x43')]=_['intersection'](_0x2d4b3a['model'],qs[_0x7721('0x42')](_0x5e966f[_0x7721('0x40')][_0x7721('0x42')]));_0x580473[_0x7721('0x43')]=_0x580473[_0x7721('0x43')][_0x7721('0x44')]?_0x580473[_0x7721('0x43')]:_0x2d4b3a['model'];_0x580473[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e966f[_0x7721('0x40')]['sort']);_0x580473[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e966f[_0x7721('0x40')],_0x2d4b3a['filters']));if(_0x5e966f['query'][_0x7721('0x4c')]){_0x580473[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x580473[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x580473[_0x7721('0x43')],function(_0x59e80c){var _0x3855d5={};_0x3855d5[_0x59e80c]={'$like':'%'+_0x5e966f[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x3855d5;})});}_0x580473=_['merge']({},_0x580473,_0x5e966f[_0x7721('0x55')]);return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0xc20188){if(_0xc20188){_0xbbc86f=_0xc20188[_0x7721('0x44')];if(!_0x5e966f['query'][_0x7721('0x5d')]('nolimit')){_0x580473[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x5e966f[_0x7721('0x40')][_0x7721('0x31')]);_0x580473[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e966f[_0x7721('0x40')][_0x7721('0x30')]);}return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0x2c74d8){if(_0x2c74d8){return _0x2c74d8?{'count':_0xbbc86f,'rows':_0x2c74d8}:null;}})['then'](respondWithResult(_0x1fc5f7,null))[_0x7721('0x2b')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x5e')]=function(_0x39194e,_0x5eec29,_0x94af20){var _0x26b2cc={};var _0x139517={};var _0xc9761e;var _0xcd9f0d;return db['ZohoConfiguration'][_0x7721('0x5f')]({'where':{'id':_0x39194e[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5eec29,null))[_0x7721('0x38')](function(_0x30326d){if(_0x30326d){_0xc9761e=_0x30326d;_0x139517[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x139517['query']=_[_0x7721('0x52')](_0x39194e['query']);_0x139517[_0x7721('0x41')]=_[_0x7721('0x53')](_0x139517['model'],_0x139517[_0x7721('0x40')]);_0x26b2cc['attributes']=_['intersection'](_0x139517['model'],qs[_0x7721('0x42')](_0x39194e[_0x7721('0x40')][_0x7721('0x42')]));_0x26b2cc['attributes']=_0x26b2cc['attributes']['length']?_0x26b2cc[_0x7721('0x43')]:_0x139517[_0x7721('0x3f')];_0x26b2cc[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x39194e[_0x7721('0x40')][_0x7721('0x47')]);_0x26b2cc['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x39194e[_0x7721('0x40')],_0x139517[_0x7721('0x41')]));if(_0x39194e[_0x7721('0x40')][_0x7721('0x4c')]){_0x26b2cc[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x26b2cc[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x26b2cc[_0x7721('0x43')],function(_0x368dbb){var _0x58429d={};_0x58429d[_0x368dbb]={'$like':'%'+_0x39194e['query'][_0x7721('0x4c')]+'%'};return _0x58429d;})});}_0x26b2cc=_[_0x7721('0x4a')]({},_0x26b2cc,_0x39194e['options']);return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x4e3c93){if(_0x4e3c93){_0xcd9f0d=_0x4e3c93[_0x7721('0x44')];if(!_0x39194e['query']['hasOwnProperty'](_0x7721('0x45'))){_0x26b2cc[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x39194e[_0x7721('0x40')][_0x7721('0x31')]);_0x26b2cc['offset']=qs[_0x7721('0x30')](_0x39194e[_0x7721('0x40')][_0x7721('0x30')]);}return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x52fcc1){if(_0x52fcc1){return _0x52fcc1?{'count':_0xcd9f0d,'rows':_0x52fcc1}:null;}})[_0x7721('0x38')](respondWithResult(_0x5eec29,null))[_0x7721('0x2b')](handleError(_0x5eec29,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 4c98255..b80b35a 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dd0=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4654b2,_0x3c8d0e){var _0x5d6497=function(_0x426346){while(--_0x426346){_0x4654b2['push'](_0x4654b2['shift']());}};_0x5d6497(++_0x3c8d0e);}(_0x2dd0,0xad));var _0x02dd=function(_0x33d9e3,_0x2f1214){_0x33d9e3=_0x33d9e3-0x0;var _0xe7a894=_0x2dd0[_0x33d9e3];return _0xe7a894;};'use strict';var _=require(_0x02dd('0x0'));var util=require(_0x02dd('0x1'));var logger=require(_0x02dd('0x2'))(_0x02dd('0x3'));var moment=require(_0x02dd('0x4'));var BPromise=require(_0x02dd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x02dd('0x6'));var config=require('../../config/environment');var attributes=require(_0x02dd('0x7'));module[_0x02dd('0x8')]=function(_0x2a4983,_0x5c6ef3){return _0x2a4983[_0x02dd('0x9')](_0x02dd('0xa'),attributes,{'tableName':_0x02dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17c8=['ZohoConfiguration','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x19b1c2,_0x205062){var _0x4e1ae5=function(_0x5a1cb7){while(--_0x5a1cb7){_0x19b1c2['push'](_0x19b1c2['shift']());}};_0x4e1ae5(++_0x205062);}(_0x17c8,0x9d));var _0x817c=function(_0x5da18e,_0x43747b){_0x5da18e=_0x5da18e-0x0;var _0x5e7ceb=_0x17c8[_0x5da18e];return _0x5e7ceb;};'use strict';var _=require(_0x817c('0x0'));var util=require(_0x817c('0x1'));var logger=require(_0x817c('0x2'))(_0x817c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x817c('0x4'));var fs=require('fs');var path=require(_0x817c('0x5'));var rimraf=require(_0x817c('0x6'));var config=require(_0x817c('0x7'));var attributes=require(_0x817c('0x8'));module[_0x817c('0x9')]=function(_0x300db0,_0x58ab1d){return _0x300db0[_0x817c('0xa')](_0x817c('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index bcd5bac..b1e87b5 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc293=['request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x517e90,_0x5f3c35){var _0xddb6f1=function(_0x361e5c){while(--_0x361e5c){_0x517e90['push'](_0x517e90['shift']());}};_0xddb6f1(++_0x5f3c35);}(_0xc293,0x16a));var _0x3c29=function(_0x3473ec,_0x2170f3){_0x3473ec=_0x3473ec-0x0;var _0x59bac8=_0xc293[_0x3473ec];return _0x59bac8;};'use strict';var _=require(_0x3c29('0x0'));var util=require(_0x3c29('0x1'));var moment=require(_0x3c29('0x2'));var BPromise=require(_0x3c29('0x3'));var rs=require(_0x3c29('0x4'));var fs=require('fs');var Redis=require(_0x3c29('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3c29('0x6'));var config=require(_0x3c29('0x7'));var jayson=require(_0x3c29('0x8'));var client=jayson[_0x3c29('0x9')][_0x3c29('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50de9b,_0x50e609,_0x1a981a){return new BPromise(function(_0x3b6316,_0x16825b){return client['request'](_0x50de9b,_0x1a981a)[_0x3c29('0xb')](function(_0x55a05a){logger[_0x3c29('0xc')](_0x3c29('0xd'),_0x50e609,'request\x20sent');logger[_0x3c29('0xe')](_0x3c29('0xf'),_0x50e609,_0x3c29('0x10'),JSON['stringify'](_0x55a05a));if(_0x55a05a[_0x3c29('0x11')]){if(_0x55a05a[_0x3c29('0x11')][_0x3c29('0x12')]===0x1f4){logger['error'](_0x3c29('0xd'),_0x50e609,_0x55a05a[_0x3c29('0x11')]['message']);return _0x16825b(_0x55a05a['error']['message']);}logger[_0x3c29('0x11')](_0x3c29('0xd'),_0x50e609,_0x55a05a[_0x3c29('0x11')]['message']);return _0x3b6316(_0x55a05a['error'][_0x3c29('0x13')]);}else{logger[_0x3c29('0xc')](_0x3c29('0xd'),_0x50e609,'request\x20sent');_0x3b6316(_0x55a05a[_0x3c29('0x14')]['message']);}})['catch'](function(_0x163fcb){logger[_0x3c29('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x50e609,_0x163fcb);_0x16825b(_0x163fcb);});});} \ No newline at end of file +var _0x98ba=['rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x98ba,0x119));var _0xa98b=function(_0x5be6b2,_0x25f00e){_0x5be6b2=_0x5be6b2-0x0;var _0x384074=_0x98ba[_0x5be6b2];return _0x384074;};'use strict';var _=require(_0xa98b('0x0'));var util=require(_0xa98b('0x1'));var moment=require(_0xa98b('0x2'));var BPromise=require(_0xa98b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa98b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa98b('0x5'));var logger=require(_0xa98b('0x6'))(_0xa98b('0x7'));var config=require(_0xa98b('0x8'));var jayson=require(_0xa98b('0x9'));var client=jayson['client'][_0xa98b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x530097,_0x42833e,_0x55c49b){return new BPromise(function(_0x323c06,_0x55a10c){return client[_0xa98b('0xb')](_0x530097,_0x55c49b)[_0xa98b('0xc')](function(_0x8a49f9){logger[_0xa98b('0xd')](_0xa98b('0xe'),_0x42833e,_0xa98b('0xf'));logger[_0xa98b('0x10')](_0xa98b('0x11'),_0x42833e,_0xa98b('0xf'),JSON[_0xa98b('0x12')](_0x8a49f9));if(_0x8a49f9[_0xa98b('0x13')]){if(_0x8a49f9[_0xa98b('0x13')][_0xa98b('0x14')]===0x1f4){logger[_0xa98b('0x13')](_0xa98b('0xe'),_0x42833e,_0x8a49f9[_0xa98b('0x13')]['message']);return _0x55a10c(_0x8a49f9['error'][_0xa98b('0x15')]);}logger[_0xa98b('0x13')](_0xa98b('0xe'),_0x42833e,_0x8a49f9['error'][_0xa98b('0x15')]);return _0x323c06(_0x8a49f9['error'][_0xa98b('0x15')]);}else{logger['info'](_0xa98b('0xe'),_0x42833e,'request\x20sent');_0x323c06(_0x8a49f9[_0xa98b('0x16')][_0xa98b('0x15')]);}})[_0xa98b('0x17')](function(_0x41e1ad){logger[_0xa98b('0x13')](_0xa98b('0xe'),_0x42833e,_0x41e1ad);_0x55a10c(_0x41e1ad);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index e381ef7..50fa295 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7880=['Router','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0xf65bf8,_0x494a66){var _0x2e4a66=function(_0x50d0de){while(--_0x50d0de){_0xf65bf8['push'](_0xf65bf8['shift']());}};_0x2e4a66(++_0x494a66);}(_0x7880,0x1f4));var _0x0788=function(_0x3710a4,_0x411b57){_0x3710a4=_0x3710a4-0x0;var _0x470675=_0x7880[_0x3710a4];return _0x470675;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var auth=require(_0x0788('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0788('0x6'));var controller=require(_0x0788('0x7'));router[_0x0788('0x8')]('/',auth[_0x0788('0x9')](),controller[_0x0788('0xa')]);router[_0x0788('0x8')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0xc')]);router[_0x0788('0xd')]('/',auth['isAuthenticated'](),controller[_0x0788('0xe')]);router['put'](_0x0788('0xb'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router[_0x0788('0x10')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6d11=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path','express'];(function(_0x1d1fb4,_0x21b691){var _0x3d1d99=function(_0x53a2b8){while(--_0x53a2b8){_0x1d1fb4['push'](_0x1d1fb4['shift']());}};_0x3d1d99(++_0x21b691);}(_0x6d11,0xbf));var _0x16d1=function(_0x5828d0,_0x2c3e93){_0x5828d0=_0x5828d0-0x0;var _0x239b02=_0x6d11[_0x5828d0];return _0x239b02;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var auth=require(_0x16d1('0x4'));var interaction=require(_0x16d1('0x5'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x16d1('0x6')]('/',auth[_0x16d1('0x7')](),controller[_0x16d1('0x8')]);router[_0x16d1('0x6')](_0x16d1('0x9'),auth[_0x16d1('0x7')](),controller[_0x16d1('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x16d1('0xb')](_0x16d1('0x9'),auth[_0x16d1('0x7')](),controller[_0x16d1('0xc')]);router['delete'](_0x16d1('0x9'),auth[_0x16d1('0x7')](),controller[_0x16d1('0xd')]);module[_0x16d1('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 43915ef..d67e4cd 100644 --- a/server/api/intZohoField/intZohoField.attributes.js +++ b/server/api/intZohoField/intZohoField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd01a=['string','customVariable','keyValue','variable','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x5af415,_0x2fb650){var _0x48de47=function(_0x354222){while(--_0x354222){_0x5af415['push'](_0x5af415['shift']());}};_0x48de47(++_0x2fb650);}(_0xd01a,0x1ae));var _0xad01=function(_0x5d8bee,_0x4baba7){_0x5d8bee=_0x5d8bee-0x0;var _0x1ec71c=_0xd01a[_0x5d8bee];return _0x1ec71c;};'use strict';var Sequelize=require(_0xad01('0x0'));module['exports']={'type':{'type':Sequelize[_0xad01('0x1')](_0xad01('0x2'),'variable',_0xad01('0x3'),_0xad01('0x4')),'defaultValue':_0xad01('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xad01('0x1')](_0xad01('0x2'),_0xad01('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xad01('0x6')]},'nameField':{'type':Sequelize[_0xad01('0x6')]},'customField':{'type':Sequelize[_0xad01('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xad01('0x6')]}}; \ No newline at end of file +var _0x9dc3=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','string'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x9dc3,0xa5));var _0x39dc=function(_0x383e34,_0x46a499){_0x383e34=_0x383e34-0x0;var _0x319e3b=_0x9dc3[_0x383e34];return _0x319e3b;};'use strict';var Sequelize=require(_0x39dc('0x0'));module[_0x39dc('0x1')]={'type':{'type':Sequelize[_0x39dc('0x2')]('string','variable',_0x39dc('0x3'),_0x39dc('0x4')),'defaultValue':_0x39dc('0x5')},'content':{'type':Sequelize[_0x39dc('0x6')]},'key':{'type':Sequelize[_0x39dc('0x6')]},'keyType':{'type':Sequelize[_0x39dc('0x2')]('string',_0x39dc('0x7'),_0x39dc('0x3'))},'keyContent':{'type':Sequelize[_0x39dc('0x6')]},'idField':{'type':Sequelize[_0x39dc('0x6')]},'nameField':{'type':Sequelize[_0x39dc('0x6')]},'customField':{'type':Sequelize[_0x39dc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 9742579..d63e79a 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9871=['findAll','rows','catch','show','params','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','set','json','apply','reject','save','then','destroy','sendStatus','name','index','map','ZohoField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0x10fa7c,_0x265365){var _0x1bbd89=function(_0x55339d){while(--_0x55339d){_0x10fa7c['push'](_0x10fa7c['shift']());}};_0x1bbd89(++_0x265365);}(_0x9871,0x11e));var _0x1987=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x9871[_0x2db12b];return _0x20990b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1987('0x0'));var rimraf=require(_0x1987('0x1'));var zipdir=require(_0x1987('0x2'));var jsonpatch=require(_0x1987('0x3'));var rp=require('request-promise');var moment=require(_0x1987('0x4'));var BPromise=require(_0x1987('0x5'));var Mustache=require(_0x1987('0x6'));var util=require('util');var path=require(_0x1987('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1987('0x8'));var fs=require('fs');var _=require(_0x1987('0x9'));var squel=require(_0x1987('0xa'));var crypto=require(_0x1987('0xb'));var jsforce=require(_0x1987('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1987('0xd'));var Redis=require(_0x1987('0xe'));var authService=require(_0x1987('0xf'));var qs=require(_0x1987('0x10'));var as=require(_0x1987('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1987('0x12'))('api');var utils=require(_0x1987('0x13'));var config=require(_0x1987('0x14'));var db=require(_0x1987('0x15'))['db'];function respondWithStatusCode(_0xfc4294,_0x5af7df){_0x5af7df=_0x5af7df||0xcc;return function(_0x195df4){if(_0x195df4){return _0xfc4294['sendStatus'](_0x5af7df);}return _0xfc4294[_0x1987('0x16')](_0x5af7df)[_0x1987('0x17')]();};}function respondWithResult(_0x55a8ac,_0x3eb2d6){_0x3eb2d6=_0x3eb2d6||0xc8;return function(_0x27e0e6){if(_0x27e0e6){return _0x55a8ac[_0x1987('0x16')](_0x3eb2d6)['json'](_0x27e0e6);}};}function respondWithFilteredResult(_0x240cc7,_0x31a591){return function(_0x491fc4){if(_0x491fc4){var _0x306c5d=_0x491fc4[_0x1987('0x18')],_0x55b5f5=_0x31a591[_0x1987('0x19')],_0x6f7ec4=_0x31a591[_0x1987('0x19')]+_0x31a591['limit'],_0x5ae56b;if(_0x6f7ec4>=_0x306c5d){_0x6f7ec4=_0x306c5d;_0x5ae56b=0xc8;}else{_0x5ae56b=0xce;}_0x240cc7[_0x1987('0x16')](_0x5ae56b);return _0x240cc7[_0x1987('0x1a')]('Content-Range',_0x55b5f5+'-'+_0x6f7ec4+'/'+_0x306c5d)[_0x1987('0x1b')](_0x491fc4);}return null;};}function patchUpdates(_0x2bd111){return function(_0x5c365d){try{jsonpatch[_0x1987('0x1c')](_0x5c365d,_0x2bd111,!![]);}catch(_0x2c1d84){return BPromise[_0x1987('0x1d')](_0x2c1d84);}return _0x5c365d[_0x1987('0x1e')]();};}function saveUpdates(_0x5d885e,_0x57c6b0){return function(_0x19ec0d){if(_0x19ec0d){return _0x19ec0d['update'](_0x5d885e)[_0x1987('0x1f')](function(_0x27a0e7){return _0x27a0e7;});}return null;};}function removeEntity(_0xf68ac3,_0x1f17f0){return function(_0x1698bf){if(_0x1698bf){return _0x1698bf[_0x1987('0x20')]()[_0x1987('0x1f')](function(){_0xf68ac3[_0x1987('0x16')](0xcc)[_0x1987('0x17')]();});}};}function handleEntityNotFound(_0x44184a,_0x2be761){return function(_0x3cfefe){if(!_0x3cfefe){_0x44184a[_0x1987('0x21')](0x194);}return _0x3cfefe;};}function handleError(_0x591e8f,_0x44814e){_0x44814e=_0x44814e||0x1f4;return function(_0xbe563c){logger['error'](_0xbe563c['stack']);if(_0xbe563c[_0x1987('0x22')]){delete _0xbe563c[_0x1987('0x22')];}_0x591e8f[_0x1987('0x16')](_0x44814e)['send'](_0xbe563c);};}exports[_0x1987('0x23')]=function(_0x33819f,_0x4aa3fe){var _0x59ac1f={},_0x24f985={},_0x5f4127={'count':0x0,'rows':[]};var _0x3aa495=_[_0x1987('0x24')](db[_0x1987('0x25')][_0x1987('0x26')],function(_0x5f0e02){return{'name':_0x5f0e02[_0x1987('0x27')],'type':_0x5f0e02[_0x1987('0x28')][_0x1987('0x29')]};});_0x24f985[_0x1987('0x2a')]=_[_0x1987('0x24')](_0x3aa495,_0x1987('0x22'));_0x24f985['query']=_[_0x1987('0x2b')](_0x33819f[_0x1987('0x2c')]);_0x24f985[_0x1987('0x2d')]=_[_0x1987('0x2e')](_0x24f985['model'],_0x24f985[_0x1987('0x2c')]);_0x59ac1f[_0x1987('0x2f')]=_[_0x1987('0x2e')](_0x24f985[_0x1987('0x2a')],qs[_0x1987('0x30')](_0x33819f['query']['fields']));_0x59ac1f[_0x1987('0x2f')]=_0x59ac1f[_0x1987('0x2f')][_0x1987('0x31')]?_0x59ac1f[_0x1987('0x2f')]:_0x24f985[_0x1987('0x2a')];if(!_0x33819f[_0x1987('0x2c')]['hasOwnProperty'](_0x1987('0x32'))){_0x59ac1f[_0x1987('0x33')]=qs['limit'](_0x33819f['query'][_0x1987('0x33')]);_0x59ac1f[_0x1987('0x19')]=qs[_0x1987('0x19')](_0x33819f[_0x1987('0x2c')]['offset']);}_0x59ac1f['order']=qs[_0x1987('0x34')](_0x33819f[_0x1987('0x2c')][_0x1987('0x34')]);_0x59ac1f[_0x1987('0x35')]=qs[_0x1987('0x2d')](_['pick'](_0x33819f[_0x1987('0x2c')],_0x24f985['filters']));if(_0x33819f['query'][_0x1987('0x36')]){_0x59ac1f['where']=_[_0x1987('0x37')](_0x59ac1f['where'],{'$or':_[_0x1987('0x24')](_0x3aa495,function(_0x4d1b24){if(_0x4d1b24[_0x1987('0x28')]!==_0x1987('0x38')){var _0x445e23={};_0x445e23[_0x4d1b24[_0x1987('0x22')]]={'$like':'%'+_0x33819f[_0x1987('0x2c')][_0x1987('0x36')]+'%'};return _0x445e23;}})});}_0x59ac1f=_['merge']({},_0x59ac1f,_0x33819f[_0x1987('0x39')]);var _0x639247={'where':_0x59ac1f[_0x1987('0x35')]};return db[_0x1987('0x25')]['count'](_0x639247)[_0x1987('0x1f')](function(_0x368d63){_0x5f4127[_0x1987('0x18')]=_0x368d63;if(_0x33819f[_0x1987('0x2c')][_0x1987('0x3a')]){_0x59ac1f['include']=[{'all':!![]}];}return db[_0x1987('0x25')][_0x1987('0x3b')](_0x59ac1f);})[_0x1987('0x1f')](function(_0x17eb6c){_0x5f4127[_0x1987('0x3c')]=_0x17eb6c;return _0x5f4127;})[_0x1987('0x1f')](respondWithFilteredResult(_0x4aa3fe,_0x59ac1f))[_0x1987('0x3d')](handleError(_0x4aa3fe,null));};exports[_0x1987('0x3e')]=function(_0x5ba998,_0x496463){var _0x320967={'raw':!![],'where':{'id':_0x5ba998[_0x1987('0x3f')]['id']}},_0x388094={};_0x388094[_0x1987('0x2a')]=_[_0x1987('0x2b')](db[_0x1987('0x25')]['rawAttributes']);_0x388094[_0x1987('0x2c')]=_[_0x1987('0x2b')](_0x5ba998['query']);_0x388094[_0x1987('0x2d')]=_[_0x1987('0x2e')](_0x388094[_0x1987('0x2a')],_0x388094[_0x1987('0x2c')]);_0x320967[_0x1987('0x2f')]=_['intersection'](_0x388094['model'],qs[_0x1987('0x30')](_0x5ba998[_0x1987('0x2c')][_0x1987('0x30')]));_0x320967['attributes']=_0x320967[_0x1987('0x2f')][_0x1987('0x31')]?_0x320967[_0x1987('0x2f')]:_0x388094['model'];if(_0x5ba998[_0x1987('0x2c')][_0x1987('0x3a')]){_0x320967[_0x1987('0x40')]=[{'all':!![]}];}_0x320967=_[_0x1987('0x37')]({},_0x320967,_0x5ba998['options']);return db[_0x1987('0x25')][_0x1987('0x41')](_0x320967)['then'](handleEntityNotFound(_0x496463,null))[_0x1987('0x1f')](respondWithResult(_0x496463,null))[_0x1987('0x3d')](handleError(_0x496463,null));};exports[_0x1987('0x42')]=function(_0x16c290,_0x41bb21){return db[_0x1987('0x25')][_0x1987('0x42')](_0x16c290[_0x1987('0x43')],{})[_0x1987('0x1f')](respondWithResult(_0x41bb21,0xc9))[_0x1987('0x3d')](handleError(_0x41bb21,null));};exports[_0x1987('0x44')]=function(_0x2c54c5,_0x460e89){if(_0x2c54c5[_0x1987('0x43')]['id']){delete _0x2c54c5[_0x1987('0x43')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x2c54c5[_0x1987('0x3f')]['id']}})[_0x1987('0x1f')](handleEntityNotFound(_0x460e89,null))[_0x1987('0x1f')](saveUpdates(_0x2c54c5[_0x1987('0x43')],null))[_0x1987('0x1f')](respondWithResult(_0x460e89,null))[_0x1987('0x3d')](handleError(_0x460e89,null));};exports[_0x1987('0x20')]=function(_0x5735b2,_0xc4c1f6){return db['ZohoField'][_0x1987('0x41')]({'where':{'id':_0x5735b2['params']['id']}})[_0x1987('0x1f')](handleEntityNotFound(_0xc4c1f6,null))[_0x1987('0x1f')](removeEntity(_0xc4c1f6,null))[_0x1987('0x3d')](handleError(_0xc4c1f6,null));}; \ No newline at end of file +var _0x37d2=['moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','ZohoField','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x235045,_0xdb47c8){var _0x41123d=function(_0x152d80){while(--_0x152d80){_0x235045['push'](_0x235045['shift']());}};_0x41123d(++_0xdb47c8);}(_0x37d2,0x155));var _0x237d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x37d2[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x237d('0x0'));var zipdir=require(_0x237d('0x1'));var jsonpatch=require(_0x237d('0x2'));var rp=require(_0x237d('0x3'));var moment=require(_0x237d('0x4'));var BPromise=require(_0x237d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x237d('0x6'));var csv=require(_0x237d('0x7'));var ejs=require(_0x237d('0x8'));var fs=require('fs');var _=require(_0x237d('0x9'));var squel=require(_0x237d('0xa'));var crypto=require(_0x237d('0xb'));var jsforce=require(_0x237d('0xc'));var deskjs=require(_0x237d('0xd'));var toCsv=require(_0x237d('0x7'));var querystring=require('querystring');var Papa=require(_0x237d('0xe'));var Redis=require('ioredis');var authService=require(_0x237d('0xf'));var qs=require(_0x237d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x237d('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x237d('0x12'));var db=require(_0x237d('0x13'))['db'];function respondWithStatusCode(_0x1b141d,_0x4db16e){_0x4db16e=_0x4db16e||0xcc;return function(_0x4ef517){if(_0x4ef517){return _0x1b141d[_0x237d('0x14')](_0x4db16e);}return _0x1b141d[_0x237d('0x15')](_0x4db16e)[_0x237d('0x16')]();};}function respondWithResult(_0x36d838,_0x53bc9c){_0x53bc9c=_0x53bc9c||0xc8;return function(_0x1145c8){if(_0x1145c8){return _0x36d838['status'](_0x53bc9c)[_0x237d('0x17')](_0x1145c8);}};}function respondWithFilteredResult(_0x2d29b1,_0xe80d8c){return function(_0x229ce0){if(_0x229ce0){var _0x489354=_0x229ce0[_0x237d('0x18')],_0x3f628a=_0xe80d8c[_0x237d('0x19')],_0x15107e=_0xe80d8c[_0x237d('0x19')]+_0xe80d8c[_0x237d('0x1a')],_0x462f95;if(_0x15107e>=_0x489354){_0x15107e=_0x489354;_0x462f95=0xc8;}else{_0x462f95=0xce;}_0x2d29b1[_0x237d('0x15')](_0x462f95);return _0x2d29b1[_0x237d('0x1b')](_0x237d('0x1c'),_0x3f628a+'-'+_0x15107e+'/'+_0x489354)[_0x237d('0x17')](_0x229ce0);}return null;};}function patchUpdates(_0x2f542d){return function(_0x307efc){try{jsonpatch[_0x237d('0x1d')](_0x307efc,_0x2f542d,!![]);}catch(_0x4e11b2){return BPromise[_0x237d('0x1e')](_0x4e11b2);}return _0x307efc[_0x237d('0x1f')]();};}function saveUpdates(_0x2e4dd1,_0xed086d){return function(_0x17a858){if(_0x17a858){return _0x17a858[_0x237d('0x20')](_0x2e4dd1)[_0x237d('0x21')](function(_0x3b6c62){return _0x3b6c62;});}return null;};}function removeEntity(_0x54ee30,_0x1f4b3c){return function(_0x3bf9f8){if(_0x3bf9f8){return _0x3bf9f8[_0x237d('0x22')]()['then'](function(){_0x54ee30[_0x237d('0x15')](0xcc)[_0x237d('0x16')]();});}};}function handleEntityNotFound(_0x44538d,_0x35cd7a){return function(_0x2a4bd5){if(!_0x2a4bd5){_0x44538d['sendStatus'](0x194);}return _0x2a4bd5;};}function handleError(_0xe03eff,_0x1f6d04){_0x1f6d04=_0x1f6d04||0x1f4;return function(_0x73577){logger['error'](_0x73577['stack']);if(_0x73577[_0x237d('0x23')]){delete _0x73577[_0x237d('0x23')];}_0xe03eff[_0x237d('0x15')](_0x1f6d04)[_0x237d('0x24')](_0x73577);};}exports[_0x237d('0x25')]=function(_0x13a122,_0x2d031f){var _0x5e0971={},_0x144799={},_0x2d4444={'count':0x0,'rows':[]};var _0x57b7af=_[_0x237d('0x26')](db[_0x237d('0x27')][_0x237d('0x28')],function(_0x90492f){return{'name':_0x90492f[_0x237d('0x29')],'type':_0x90492f[_0x237d('0x2a')]['key']};});_0x144799[_0x237d('0x2b')]=_[_0x237d('0x26')](_0x57b7af,_0x237d('0x23'));_0x144799['query']=_[_0x237d('0x2c')](_0x13a122['query']);_0x144799[_0x237d('0x2d')]=_['intersection'](_0x144799[_0x237d('0x2b')],_0x144799[_0x237d('0x2e')]);_0x5e0971[_0x237d('0x2f')]=_[_0x237d('0x30')](_0x144799['model'],qs['fields'](_0x13a122['query'][_0x237d('0x31')]));_0x5e0971[_0x237d('0x2f')]=_0x5e0971['attributes'][_0x237d('0x32')]?_0x5e0971['attributes']:_0x144799[_0x237d('0x2b')];if(!_0x13a122['query'][_0x237d('0x33')](_0x237d('0x34'))){_0x5e0971[_0x237d('0x1a')]=qs[_0x237d('0x1a')](_0x13a122[_0x237d('0x2e')][_0x237d('0x1a')]);_0x5e0971[_0x237d('0x19')]=qs['offset'](_0x13a122[_0x237d('0x2e')][_0x237d('0x19')]);}_0x5e0971[_0x237d('0x35')]=qs[_0x237d('0x36')](_0x13a122[_0x237d('0x2e')][_0x237d('0x36')]);_0x5e0971['where']=qs[_0x237d('0x2d')](_['pick'](_0x13a122[_0x237d('0x2e')],_0x144799[_0x237d('0x2d')]));if(_0x13a122['query'][_0x237d('0x37')]){_0x5e0971['where']=_[_0x237d('0x38')](_0x5e0971[_0x237d('0x39')],{'$or':_[_0x237d('0x26')](_0x57b7af,function(_0x3bdf8b){if(_0x3bdf8b[_0x237d('0x2a')]!==_0x237d('0x3a')){var _0xbb8335={};_0xbb8335[_0x3bdf8b[_0x237d('0x23')]]={'$like':'%'+_0x13a122[_0x237d('0x2e')]['filter']+'%'};return _0xbb8335;}})});}_0x5e0971=_[_0x237d('0x38')]({},_0x5e0971,_0x13a122[_0x237d('0x3b')]);var _0x39ffa7={'where':_0x5e0971[_0x237d('0x39')]};return db['ZohoField'][_0x237d('0x18')](_0x39ffa7)[_0x237d('0x21')](function(_0x1c08a1){_0x2d4444[_0x237d('0x18')]=_0x1c08a1;if(_0x13a122[_0x237d('0x2e')][_0x237d('0x3c')]){_0x5e0971[_0x237d('0x3d')]=[{'all':!![]}];}return db[_0x237d('0x27')][_0x237d('0x3e')](_0x5e0971);})['then'](function(_0x583c68){_0x2d4444['rows']=_0x583c68;return _0x2d4444;})[_0x237d('0x21')](respondWithFilteredResult(_0x2d031f,_0x5e0971))[_0x237d('0x3f')](handleError(_0x2d031f,null));};exports[_0x237d('0x40')]=function(_0x3a0ba9,_0x42bb9b){var _0x448243={'raw':!![],'where':{'id':_0x3a0ba9['params']['id']}},_0x9d1301={};_0x9d1301['model']=_['keys'](db[_0x237d('0x27')][_0x237d('0x28')]);_0x9d1301[_0x237d('0x2e')]=_[_0x237d('0x2c')](_0x3a0ba9[_0x237d('0x2e')]);_0x9d1301[_0x237d('0x2d')]=_[_0x237d('0x30')](_0x9d1301['model'],_0x9d1301[_0x237d('0x2e')]);_0x448243[_0x237d('0x2f')]=_[_0x237d('0x30')](_0x9d1301[_0x237d('0x2b')],qs[_0x237d('0x31')](_0x3a0ba9['query']['fields']));_0x448243[_0x237d('0x2f')]=_0x448243[_0x237d('0x2f')][_0x237d('0x32')]?_0x448243[_0x237d('0x2f')]:_0x9d1301[_0x237d('0x2b')];if(_0x3a0ba9[_0x237d('0x2e')]['includeAll']){_0x448243['include']=[{'all':!![]}];}_0x448243=_[_0x237d('0x38')]({},_0x448243,_0x3a0ba9['options']);return db[_0x237d('0x27')][_0x237d('0x41')](_0x448243)['then'](handleEntityNotFound(_0x42bb9b,null))[_0x237d('0x21')](respondWithResult(_0x42bb9b,null))['catch'](handleError(_0x42bb9b,null));};exports[_0x237d('0x42')]=function(_0x5cbc2a,_0x58a734){return db[_0x237d('0x27')][_0x237d('0x42')](_0x5cbc2a[_0x237d('0x43')],{})[_0x237d('0x21')](respondWithResult(_0x58a734,0xc9))[_0x237d('0x3f')](handleError(_0x58a734,null));};exports[_0x237d('0x20')]=function(_0x5059bc,_0x16abc2){if(_0x5059bc[_0x237d('0x43')]['id']){delete _0x5059bc[_0x237d('0x43')]['id'];}return db[_0x237d('0x27')]['find']({'where':{'id':_0x5059bc[_0x237d('0x44')]['id']}})[_0x237d('0x21')](handleEntityNotFound(_0x16abc2,null))[_0x237d('0x21')](saveUpdates(_0x5059bc[_0x237d('0x43')],null))[_0x237d('0x21')](respondWithResult(_0x16abc2,null))[_0x237d('0x3f')](handleError(_0x16abc2,null));};exports[_0x237d('0x22')]=function(_0x423168,_0x1126ca){return db[_0x237d('0x27')][_0x237d('0x41')]({'where':{'id':_0x423168[_0x237d('0x44')]['id']}})[_0x237d('0x21')](handleEntityNotFound(_0x1126ca,null))[_0x237d('0x21')](removeEntity(_0x1126ca,null))[_0x237d('0x3f')](handleError(_0x1126ca,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 6ef68f1..430f3ef 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6caa=['rimraf','exports','define','ZohoField','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6caa,0x111));var _0xa6ca=function(_0x5593d1,_0x211b0f){_0x5593d1=_0x5593d1-0x0;var _0x5dc1fb=_0x6caa[_0x5593d1];return _0x5dc1fb;};'use strict';var _=require('lodash');var util=require(_0xa6ca('0x0'));var logger=require(_0xa6ca('0x1'))(_0xa6ca('0x2'));var moment=require(_0xa6ca('0x3'));var BPromise=require(_0xa6ca('0x4'));var rp=require(_0xa6ca('0x5'));var fs=require('fs');var path=require(_0xa6ca('0x6'));var rimraf=require(_0xa6ca('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0xa6ca('0x8')]=function(_0x2feb16,_0x185327){return _0x2feb16[_0xa6ca('0x9')](_0xa6ca('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xa6ca('0xb'),'fields':[_0xa6ca('0xc'),_0xa6ca('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x986f=['ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x986f,0x17e));var _0xf986=function(_0x259572,_0x508610){_0x259572=_0x259572-0x0;var _0x2a850e=_0x986f[_0x259572];return _0x2a850e;};'use strict';var _=require(_0xf986('0x0'));var util=require(_0xf986('0x1'));var logger=require(_0xf986('0x2'))('api');var moment=require(_0xf986('0x3'));var BPromise=require('bluebird');var rp=require(_0xf986('0x4'));var fs=require('fs');var path=require(_0xf986('0x5'));var rimraf=require(_0xf986('0x6'));var config=require(_0xf986('0x7'));var attributes=require(_0xf986('0x8'));module[_0xf986('0x9')]=function(_0x50b047,_0x6a24ab){return _0x50b047['define'](_0xf986('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xf986('0xb'),'fields':[_0xf986('0xc'),_0xf986('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 6a7ee1a..6c02136 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x250152,_0x3efc35){var _0x2dbec4=function(_0x8514a){while(--_0x8514a){_0x250152['push'](_0x250152['shift']());}};_0x2dbec4(++_0x3efc35);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x3eea=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','lodash','moment','bluebird','randomstring'];(function(_0xddff5,_0x2938a4){var _0x3b0c77=function(_0xad7230){while(--_0xad7230){_0xddff5['push'](_0xddff5['shift']());}};_0x3b0c77(++_0x2938a4);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x20dca7,_0x13535f){_0x20dca7=_0x20dca7-0x0;var _0x416f3f=_0x3eea[_0x20dca7];return _0x416f3f;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var moment=require(_0xa3ee('0x1'));var BPromise=require(_0xa3ee('0x2'));var rs=require(_0xa3ee('0x3'));var fs=require('fs');var Redis=require(_0xa3ee('0x4'));var db=require(_0xa3ee('0x5'))['db'];var utils=require(_0xa3ee('0x6'));var logger=require(_0xa3ee('0x7'))(_0xa3ee('0x8'));var config=require(_0xa3ee('0x9'));var jayson=require(_0xa3ee('0xa'));var client=jayson[_0xa3ee('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538bf9,_0x4183ee,_0x4e4588){return new BPromise(function(_0x37a3f0,_0x56f37b){return client[_0xa3ee('0xc')](_0x538bf9,_0x4e4588)['then'](function(_0xb1b96d){logger['info'](_0xa3ee('0xd'),_0x4183ee,_0xa3ee('0xe'));logger[_0xa3ee('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x4183ee,_0xa3ee('0xe'),JSON[_0xa3ee('0x10')](_0xb1b96d));if(_0xb1b96d['error']){if(_0xb1b96d['error'][_0xa3ee('0x11')]===0x1f4){logger[_0xa3ee('0x12')](_0xa3ee('0xd'),_0x4183ee,_0xb1b96d[_0xa3ee('0x12')]['message']);return _0x56f37b(_0xb1b96d[_0xa3ee('0x12')]['message']);}logger[_0xa3ee('0x12')](_0xa3ee('0xd'),_0x4183ee,_0xb1b96d[_0xa3ee('0x12')][_0xa3ee('0x13')]);return _0x37a3f0(_0xb1b96d['error'][_0xa3ee('0x13')]);}else{logger[_0xa3ee('0x14')]('ZohoField,\x20%s,\x20%s',_0x4183ee,'request\x20sent');_0x37a3f0(_0xb1b96d['result'][_0xa3ee('0x13')]);}})[_0xa3ee('0x15')](function(_0x354dd5){logger[_0xa3ee('0x12')]('ZohoField,\x20%s,\x20%s',_0x4183ee,_0x354dd5);_0x56f37b(_0x354dd5);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 8c1d8e8..bb87d6b 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0749=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','express','Router'];(function(_0x3fb544,_0x46c8f4){var _0x451c38=function(_0x549845){while(--_0x549845){_0x3fb544['push'](_0x3fb544['shift']());}};_0x451c38(++_0x46c8f4);}(_0x0749,0x16c));var _0x9074=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0749[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x9074('0x0'));var path=require(_0x9074('0x1'));var timeout=require(_0x9074('0x2'));var express=require(_0x9074('0x3'));var router=express[_0x9074('0x4')]();var auth=require(_0x9074('0x5'));var interaction=require(_0x9074('0x6'));var config=require(_0x9074('0x7'));module[_0x9074('0x8')]=router; \ No newline at end of file +var _0x8a38=['../../components/auth/service','../../components/interaction/service','../../config/environment','util','path'];(function(_0x1b0749,_0x1fed72){var _0x4167f2=function(_0x4f5720){while(--_0x4f5720){_0x1b0749['push'](_0x1b0749['shift']());}};_0x4167f2(++_0x1fed72);}(_0x8a38,0x170));var _0x88a3=function(_0x20455f,_0x423034){_0x20455f=_0x20455f-0x0;var _0x185213=_0x8a38[_0x20455f];return _0x185213;};'use strict';var multer=require('multer');var util=require(_0x88a3('0x0'));var path=require(_0x88a3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x88a3('0x2'));var interaction=require(_0x88a3('0x3'));var config=require(_0x88a3('0x4'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 89b402a..198ba4a 100644 --- a/server/api/integration/integration.attributes.js +++ b/server/api/integration/integration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb18=['app.js','BOOLEAN','sequelize','exports','STRING','unique_name_and_version'];(function(_0x528847,_0x1546a9){var _0x2b5f3c=function(_0xaebdd6){while(--_0xaebdd6){_0x528847['push'](_0x528847['shift']());}};_0x2b5f3c(++_0x1546a9);}(_0xdb18,0x122));var _0x8db1=function(_0x20bc2d,_0x46c74d){_0x20bc2d=_0x20bc2d-0x0;var _0x453574=_0xdb18[_0x20bc2d];return _0x453574;};'use strict';var Sequelize=require(_0x8db1('0x0'));module[_0x8db1('0x1')]={'name':{'type':Sequelize[_0x8db1('0x2')],'allowNull':![],'unique':_0x8db1('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8db1('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x8db1('0x4')},'filename':{'type':Sequelize[_0x8db1('0x2')]},'path':{'type':Sequelize[_0x8db1('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x8db1('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8db1('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x8db1('0x2')],'unique':'state'},'description':{'type':Sequelize[_0x8db1('0x2')]},'title':{'type':Sequelize[_0x8db1('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x5a28=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x104b47,_0x491eff){var _0x34a3f1=function(_0x467a15){while(--_0x467a15){_0x104b47['push'](_0x104b47['shift']());}};_0x34a3f1(++_0x491eff);}(_0x5a28,0xc5));var _0x85a2=function(_0x4f5ef9,_0x2eaea0){_0x4f5ef9=_0x4f5ef9-0x0;var _0x4e43c1=_0x5a28[_0x4f5ef9];return _0x4e43c1;};'use strict';var Sequelize=require(_0x85a2('0x0'));module[_0x85a2('0x1')]={'name':{'type':Sequelize[_0x85a2('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x85a2('0x2')],'allowNull':![],'unique':_0x85a2('0x3')},'main':{'type':Sequelize[_0x85a2('0x2')],'defaultValue':_0x85a2('0x4')},'filename':{'type':Sequelize[_0x85a2('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x85a2('0x2')]},'size':{'type':Sequelize[_0x85a2('0x5')]},'active':{'type':Sequelize[_0x85a2('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x85a2('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x85a2('0x7')},'description':{'type':Sequelize[_0x85a2('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x85a2('0x2')]},'link':{'type':Sequelize[_0x85a2('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 81ac13d..ac633b8 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x408c=['findAll','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','Integration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include'];(function(_0xf077cb,_0x11cfa6){var _0x5549d9=function(_0x131d90){while(--_0x131d90){_0xf077cb['push'](_0xf077cb['shift']());}};_0x5549d9(++_0x11cfa6);}(_0x408c,0x9d));var _0xc408=function(_0xdee30,_0x41b7b5){_0xdee30=_0xdee30-0x0;var _0x4b95ee=_0x408c[_0xdee30];return _0x4b95ee;};'use strict';var pdf=require(_0xc408('0x0'));var emlformat=require(_0xc408('0x1'));var rimraf=require(_0xc408('0x2'));var zipdir=require(_0xc408('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc408('0x4'));var moment=require(_0xc408('0x5'));var BPromise=require(_0xc408('0x6'));var Mustache=require(_0xc408('0x7'));var util=require(_0xc408('0x8'));var path=require(_0xc408('0x9'));var sox=require('sox');var csv=require(_0xc408('0xa'));var ejs=require(_0xc408('0xb'));var fs=require('fs');var _=require(_0xc408('0xc'));var squel=require(_0xc408('0xd'));var crypto=require('crypto');var jsforce=require(_0xc408('0xe'));var deskjs=require(_0xc408('0xf'));var toCsv=require(_0xc408('0xa'));var querystring=require('querystring');var Papa=require(_0xc408('0x10'));var Redis=require(_0xc408('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc408('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc408('0x13'));var logger=require(_0xc408('0x14'))(_0xc408('0x15'));var utils=require(_0xc408('0x16'));var config=require(_0xc408('0x17'));var db=require(_0xc408('0x18'))['db'];function respondWithStatusCode(_0x3ac9d,_0x4c56f2){_0x4c56f2=_0x4c56f2||0xcc;return function(_0x36b4e9){if(_0x36b4e9){return _0x3ac9d[_0xc408('0x19')](_0x4c56f2);}return _0x3ac9d[_0xc408('0x1a')](_0x4c56f2)[_0xc408('0x1b')]();};}function respondWithResult(_0x502e26,_0x1b941c){_0x1b941c=_0x1b941c||0xc8;return function(_0x55ceb5){if(_0x55ceb5){return _0x502e26[_0xc408('0x1a')](_0x1b941c)[_0xc408('0x1c')](_0x55ceb5);}};}function respondWithFilteredResult(_0x1e6a00,_0x28ba41){return function(_0x572b8d){if(_0x572b8d){var _0xf6cdba=_0x572b8d[_0xc408('0x1d')],_0x550e59=_0x28ba41[_0xc408('0x1e')],_0x1fa8c1=_0x28ba41[_0xc408('0x1e')]+_0x28ba41['limit'],_0x1d1f35;if(_0x1fa8c1>=_0xf6cdba){_0x1fa8c1=_0xf6cdba;_0x1d1f35=0xc8;}else{_0x1d1f35=0xce;}_0x1e6a00[_0xc408('0x1a')](_0x1d1f35);return _0x1e6a00[_0xc408('0x1f')](_0xc408('0x20'),_0x550e59+'-'+_0x1fa8c1+'/'+_0xf6cdba)['json'](_0x572b8d);}return null;};}function patchUpdates(_0x5e9bb8){return function(_0x4d5f29){try{jsonpatch[_0xc408('0x21')](_0x4d5f29,_0x5e9bb8,!![]);}catch(_0x39835a){return BPromise[_0xc408('0x22')](_0x39835a);}return _0x4d5f29[_0xc408('0x23')]();};}function saveUpdates(_0x2e4b2f,_0x46e862){return function(_0x3100ab){if(_0x3100ab){return _0x3100ab[_0xc408('0x24')](_0x2e4b2f)[_0xc408('0x25')](function(_0x3bd1fa){return _0x3bd1fa;});}return null;};}function removeEntity(_0x21ec50,_0xec6f9e){return function(_0x1be32c){if(_0x1be32c){return _0x1be32c[_0xc408('0x26')]()['then'](function(){_0x21ec50[_0xc408('0x1a')](0xcc)[_0xc408('0x1b')]();});}};}function handleEntityNotFound(_0x26e352,_0x3b4d66){return function(_0x41913e){if(!_0x41913e){_0x26e352[_0xc408('0x19')](0x194);}return _0x41913e;};}function handleError(_0x7c1ba9,_0x237ede){_0x237ede=_0x237ede||0x1f4;return function(_0x5c283d){logger[_0xc408('0x27')](_0x5c283d[_0xc408('0x28')]);if(_0x5c283d['name']){delete _0x5c283d['name'];}_0x7c1ba9[_0xc408('0x1a')](_0x237ede)[_0xc408('0x29')](_0x5c283d);};}exports[_0xc408('0x2a')]=function(_0x5b0a96,_0x369561){var _0x3213bd={},_0x1110d0={},_0x4e5234={'count':0x0,'rows':[]};var _0x70eefd=_['map'](db[_0xc408('0x2b')][_0xc408('0x2c')],function(_0x1c6ff7){return{'name':_0x1c6ff7[_0xc408('0x2d')],'type':_0x1c6ff7[_0xc408('0x2e')][_0xc408('0x2f')]};});_0x1110d0[_0xc408('0x30')]=_['map'](_0x70eefd,_0xc408('0x31'));_0x1110d0[_0xc408('0x32')]=_[_0xc408('0x33')](_0x5b0a96[_0xc408('0x32')]);_0x1110d0[_0xc408('0x34')]=_[_0xc408('0x35')](_0x1110d0['model'],_0x1110d0['query']);_0x3213bd[_0xc408('0x36')]=_['intersection'](_0x1110d0[_0xc408('0x30')],qs[_0xc408('0x37')](_0x5b0a96[_0xc408('0x32')]['fields']));_0x3213bd[_0xc408('0x36')]=_0x3213bd[_0xc408('0x36')][_0xc408('0x38')]?_0x3213bd['attributes']:_0x1110d0[_0xc408('0x30')];if(!_0x5b0a96[_0xc408('0x32')][_0xc408('0x39')]('nolimit')){_0x3213bd['limit']=qs['limit'](_0x5b0a96[_0xc408('0x32')][_0xc408('0x3a')]);_0x3213bd[_0xc408('0x1e')]=qs[_0xc408('0x1e')](_0x5b0a96[_0xc408('0x32')][_0xc408('0x1e')]);}_0x3213bd['order']=qs['sort'](_0x5b0a96['query']['sort']);_0x3213bd['where']=qs[_0xc408('0x34')](_[_0xc408('0x3b')](_0x5b0a96[_0xc408('0x32')],_0x1110d0['filters']));if(_0x5b0a96[_0xc408('0x32')][_0xc408('0x3c')]){_0x3213bd[_0xc408('0x3d')]=_[_0xc408('0x3e')](_0x3213bd[_0xc408('0x3d')],{'$or':_[_0xc408('0x3f')](_0x70eefd,function(_0x49efb6){if(_0x49efb6[_0xc408('0x2e')]!==_0xc408('0x40')){var _0x66e968={};_0x66e968[_0x49efb6[_0xc408('0x31')]]={'$like':'%'+_0x5b0a96[_0xc408('0x32')][_0xc408('0x3c')]+'%'};return _0x66e968;}})});}_0x3213bd=_['merge']({},_0x3213bd,_0x5b0a96[_0xc408('0x41')]);var _0x39914f={'where':_0x3213bd[_0xc408('0x3d')]};return db[_0xc408('0x2b')][_0xc408('0x1d')](_0x39914f)[_0xc408('0x25')](function(_0x1644ad){_0x4e5234[_0xc408('0x1d')]=_0x1644ad;if(_0x5b0a96['query'][_0xc408('0x42')]){_0x3213bd[_0xc408('0x43')]=[{'all':!![]}];}return db[_0xc408('0x2b')][_0xc408('0x44')](_0x3213bd);})[_0xc408('0x25')](function(_0x49129b){_0x4e5234['rows']=_0x49129b;return _0x4e5234;})[_0xc408('0x25')](respondWithFilteredResult(_0x369561,_0x3213bd))[_0xc408('0x45')](handleError(_0x369561,null));};exports[_0xc408('0x46')]=function(_0x49b0c9,_0x409ec5){var _0x2d7894={'raw':![],'where':{'id':_0x49b0c9[_0xc408('0x47')]['id']}},_0x299e1f={};_0x299e1f[_0xc408('0x30')]=_[_0xc408('0x33')](db[_0xc408('0x2b')][_0xc408('0x2c')]);_0x299e1f['query']=_[_0xc408('0x33')](_0x49b0c9[_0xc408('0x32')]);_0x299e1f[_0xc408('0x34')]=_[_0xc408('0x35')](_0x299e1f[_0xc408('0x30')],_0x299e1f['query']);_0x2d7894[_0xc408('0x36')]=_['intersection'](_0x299e1f[_0xc408('0x30')],qs[_0xc408('0x37')](_0x49b0c9[_0xc408('0x32')][_0xc408('0x37')]));_0x2d7894[_0xc408('0x36')]=_0x2d7894[_0xc408('0x36')][_0xc408('0x38')]?_0x2d7894[_0xc408('0x36')]:_0x299e1f[_0xc408('0x30')];if(_0x49b0c9[_0xc408('0x32')][_0xc408('0x42')]){_0x2d7894[_0xc408('0x43')]=[{'all':!![]}];}_0x2d7894=_[_0xc408('0x3e')]({},_0x2d7894,_0x49b0c9['options']);return db[_0xc408('0x2b')][_0xc408('0x48')](_0x2d7894)[_0xc408('0x25')](handleEntityNotFound(_0x409ec5,null))[_0xc408('0x25')](respondWithResult(_0x409ec5,null))['catch'](handleError(_0x409ec5,null));};exports[_0xc408('0x49')]=function(_0x38a4dd,_0x194234){return db[_0xc408('0x2b')][_0xc408('0x49')](_0x38a4dd['body'],{})[_0xc408('0x25')](respondWithResult(_0x194234,0xc9))['catch'](handleError(_0x194234,null));};exports[_0xc408('0x24')]=function(_0x50e7ec,_0x18d888){if(_0x50e7ec[_0xc408('0x4a')]['id']){delete _0x50e7ec[_0xc408('0x4a')]['id'];}return db[_0xc408('0x2b')][_0xc408('0x48')]({'where':{'id':_0x50e7ec['params']['id']}})[_0xc408('0x25')](handleEntityNotFound(_0x18d888,null))['then'](saveUpdates(_0x50e7ec['body'],null))['then'](respondWithResult(_0x18d888,null))[_0xc408('0x45')](handleError(_0x18d888,null));};exports[_0xc408('0x26')]=function(_0x46ac8f,_0x391178){return db[_0xc408('0x2b')][_0xc408('0x48')]({'where':{'id':_0x46ac8f[_0xc408('0x47')]['id']}})[_0xc408('0x25')](handleEntityNotFound(_0x391178,null))['then'](removeEntity(_0x391178,null))['catch'](handleError(_0x391178,null));}; \ No newline at end of file +var _0xa610=['key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','catch','create','body','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Integration','rawAttributes','type'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xa610,0x140));var _0x0a61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa610[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0a61('0x0'));var rimraf=require(_0x0a61('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a61('0x2'));var moment=require(_0x0a61('0x3'));var BPromise=require(_0x0a61('0x4'));var Mustache=require(_0x0a61('0x5'));var util=require(_0x0a61('0x6'));var path=require(_0x0a61('0x7'));var sox=require('sox');var csv=require(_0x0a61('0x8'));var ejs=require(_0x0a61('0x9'));var fs=require('fs');var _=require(_0x0a61('0xa'));var squel=require('squel');var crypto=require(_0x0a61('0xb'));var jsforce=require(_0x0a61('0xc'));var deskjs=require(_0x0a61('0xd'));var toCsv=require(_0x0a61('0x8'));var querystring=require(_0x0a61('0xe'));var Papa=require(_0x0a61('0xf'));var Redis=require(_0x0a61('0x10'));var authService=require(_0x0a61('0x11'));var qs=require(_0x0a61('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a61('0x13'))(_0x0a61('0x14'));var utils=require(_0x0a61('0x15'));var config=require(_0x0a61('0x16'));var db=require(_0x0a61('0x17'))['db'];function respondWithStatusCode(_0x58bc26,_0x5ac5d2){_0x5ac5d2=_0x5ac5d2||0xcc;return function(_0x11b728){if(_0x11b728){return _0x58bc26[_0x0a61('0x18')](_0x5ac5d2);}return _0x58bc26[_0x0a61('0x19')](_0x5ac5d2)[_0x0a61('0x1a')]();};}function respondWithResult(_0xf6707a,_0x1b87af){_0x1b87af=_0x1b87af||0xc8;return function(_0x5e1ea6){if(_0x5e1ea6){return _0xf6707a[_0x0a61('0x19')](_0x1b87af)['json'](_0x5e1ea6);}};}function respondWithFilteredResult(_0x7cd856,_0x2029b3){return function(_0x38358c){if(_0x38358c){var _0x8abbda=_0x38358c[_0x0a61('0x1b')],_0x51461e=_0x2029b3[_0x0a61('0x1c')],_0x3be53c=_0x2029b3[_0x0a61('0x1c')]+_0x2029b3['limit'],_0x1107d7;if(_0x3be53c>=_0x8abbda){_0x3be53c=_0x8abbda;_0x1107d7=0xc8;}else{_0x1107d7=0xce;}_0x7cd856[_0x0a61('0x19')](_0x1107d7);return _0x7cd856[_0x0a61('0x1d')](_0x0a61('0x1e'),_0x51461e+'-'+_0x3be53c+'/'+_0x8abbda)['json'](_0x38358c);}return null;};}function patchUpdates(_0x1c1779){return function(_0x529f2e){try{jsonpatch[_0x0a61('0x1f')](_0x529f2e,_0x1c1779,!![]);}catch(_0xb317c9){return BPromise[_0x0a61('0x20')](_0xb317c9);}return _0x529f2e['save']();};}function saveUpdates(_0x246fdd,_0x56a1f4){return function(_0x135a12){if(_0x135a12){return _0x135a12[_0x0a61('0x21')](_0x246fdd)[_0x0a61('0x22')](function(_0x267a06){return _0x267a06;});}return null;};}function removeEntity(_0x5a8a18,_0x47455f){return function(_0x339082){if(_0x339082){return _0x339082[_0x0a61('0x23')]()['then'](function(){_0x5a8a18[_0x0a61('0x19')](0xcc)[_0x0a61('0x1a')]();});}};}function handleEntityNotFound(_0x28ab78,_0x24edb5){return function(_0x451858){if(!_0x451858){_0x28ab78[_0x0a61('0x18')](0x194);}return _0x451858;};}function handleError(_0x2da4a6,_0x4ad71e){_0x4ad71e=_0x4ad71e||0x1f4;return function(_0x336b35){logger[_0x0a61('0x24')](_0x336b35[_0x0a61('0x25')]);if(_0x336b35[_0x0a61('0x26')]){delete _0x336b35[_0x0a61('0x26')];}_0x2da4a6[_0x0a61('0x19')](_0x4ad71e)[_0x0a61('0x27')](_0x336b35);};}exports[_0x0a61('0x28')]=function(_0x55532c,_0x22ada4){var _0x38e7e5={},_0x386ae8={},_0x53930c={'count':0x0,'rows':[]};var _0x5042ce=_[_0x0a61('0x29')](db[_0x0a61('0x2a')][_0x0a61('0x2b')],function(_0x387c7c){return{'name':_0x387c7c['fieldName'],'type':_0x387c7c[_0x0a61('0x2c')][_0x0a61('0x2d')]};});_0x386ae8[_0x0a61('0x2e')]=_[_0x0a61('0x29')](_0x5042ce,'name');_0x386ae8[_0x0a61('0x2f')]=_[_0x0a61('0x30')](_0x55532c['query']);_0x386ae8['filters']=_[_0x0a61('0x31')](_0x386ae8[_0x0a61('0x2e')],_0x386ae8[_0x0a61('0x2f')]);_0x38e7e5[_0x0a61('0x32')]=_['intersection'](_0x386ae8['model'],qs[_0x0a61('0x33')](_0x55532c[_0x0a61('0x2f')][_0x0a61('0x33')]));_0x38e7e5[_0x0a61('0x32')]=_0x38e7e5[_0x0a61('0x32')][_0x0a61('0x34')]?_0x38e7e5[_0x0a61('0x32')]:_0x386ae8['model'];if(!_0x55532c[_0x0a61('0x2f')]['hasOwnProperty'](_0x0a61('0x35'))){_0x38e7e5[_0x0a61('0x36')]=qs[_0x0a61('0x36')](_0x55532c['query'][_0x0a61('0x36')]);_0x38e7e5[_0x0a61('0x1c')]=qs['offset'](_0x55532c['query'][_0x0a61('0x1c')]);}_0x38e7e5[_0x0a61('0x37')]=qs[_0x0a61('0x38')](_0x55532c[_0x0a61('0x2f')][_0x0a61('0x38')]);_0x38e7e5[_0x0a61('0x39')]=qs[_0x0a61('0x3a')](_[_0x0a61('0x3b')](_0x55532c[_0x0a61('0x2f')],_0x386ae8[_0x0a61('0x3a')]));if(_0x55532c['query'][_0x0a61('0x3c')]){_0x38e7e5[_0x0a61('0x39')]=_[_0x0a61('0x3d')](_0x38e7e5[_0x0a61('0x39')],{'$or':_[_0x0a61('0x29')](_0x5042ce,function(_0x41f016){if(_0x41f016[_0x0a61('0x2c')]!==_0x0a61('0x3e')){var _0x347068={};_0x347068[_0x41f016[_0x0a61('0x26')]]={'$like':'%'+_0x55532c[_0x0a61('0x2f')][_0x0a61('0x3c')]+'%'};return _0x347068;}})});}_0x38e7e5=_[_0x0a61('0x3d')]({},_0x38e7e5,_0x55532c[_0x0a61('0x3f')]);var _0x5e6fa3={'where':_0x38e7e5[_0x0a61('0x39')]};return db[_0x0a61('0x2a')][_0x0a61('0x1b')](_0x5e6fa3)['then'](function(_0x2f4320){_0x53930c[_0x0a61('0x1b')]=_0x2f4320;if(_0x55532c[_0x0a61('0x2f')]['includeAll']){_0x38e7e5[_0x0a61('0x40')]=[{'all':!![]}];}return db[_0x0a61('0x2a')][_0x0a61('0x41')](_0x38e7e5);})[_0x0a61('0x22')](function(_0x2e0634){_0x53930c[_0x0a61('0x42')]=_0x2e0634;return _0x53930c;})['then'](respondWithFilteredResult(_0x22ada4,_0x38e7e5))['catch'](handleError(_0x22ada4,null));};exports[_0x0a61('0x43')]=function(_0x1c5517,_0x4baa8b){var _0x5adc06={'raw':![],'where':{'id':_0x1c5517[_0x0a61('0x44')]['id']}},_0x4aa8d6={};_0x4aa8d6['model']=_[_0x0a61('0x30')](db[_0x0a61('0x2a')][_0x0a61('0x2b')]);_0x4aa8d6[_0x0a61('0x2f')]=_[_0x0a61('0x30')](_0x1c5517[_0x0a61('0x2f')]);_0x4aa8d6[_0x0a61('0x3a')]=_['intersection'](_0x4aa8d6[_0x0a61('0x2e')],_0x4aa8d6[_0x0a61('0x2f')]);_0x5adc06['attributes']=_[_0x0a61('0x31')](_0x4aa8d6['model'],qs[_0x0a61('0x33')](_0x1c5517['query'][_0x0a61('0x33')]));_0x5adc06[_0x0a61('0x32')]=_0x5adc06[_0x0a61('0x32')][_0x0a61('0x34')]?_0x5adc06[_0x0a61('0x32')]:_0x4aa8d6[_0x0a61('0x2e')];if(_0x1c5517[_0x0a61('0x2f')]['includeAll']){_0x5adc06['include']=[{'all':!![]}];}_0x5adc06=_[_0x0a61('0x3d')]({},_0x5adc06,_0x1c5517['options']);return db[_0x0a61('0x2a')]['find'](_0x5adc06)[_0x0a61('0x22')](handleEntityNotFound(_0x4baa8b,null))[_0x0a61('0x22')](respondWithResult(_0x4baa8b,null))[_0x0a61('0x45')](handleError(_0x4baa8b,null));};exports[_0x0a61('0x46')]=function(_0x5effa5,_0x2302be){return db['Integration'][_0x0a61('0x46')](_0x5effa5[_0x0a61('0x47')],{})[_0x0a61('0x22')](respondWithResult(_0x2302be,0xc9))[_0x0a61('0x45')](handleError(_0x2302be,null));};exports[_0x0a61('0x21')]=function(_0x4a29db,_0x2823f8){if(_0x4a29db['body']['id']){delete _0x4a29db[_0x0a61('0x47')]['id'];}return db['Integration'][_0x0a61('0x48')]({'where':{'id':_0x4a29db[_0x0a61('0x44')]['id']}})[_0x0a61('0x22')](handleEntityNotFound(_0x2823f8,null))['then'](saveUpdates(_0x4a29db['body'],null))['then'](respondWithResult(_0x2823f8,null))['catch'](handleError(_0x2823f8,null));};exports[_0x0a61('0x23')]=function(_0x56ba02,_0x260f62){return db[_0x0a61('0x2a')][_0x0a61('0x48')]({'where':{'id':_0x56ba02[_0x0a61('0x44')]['id']}})['then'](handleEntityNotFound(_0x260f62,null))[_0x0a61('0x22')](removeEntity(_0x260f62,null))[_0x0a61('0x45')](handleError(_0x260f62,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 36cdb14..a761fb4 100644 --- a/server/api/integration/integration.model.js +++ b/server/api/integration/integration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8cb=['rimraf','../../config/environment','exports','define','Integration','integrations','lodash','util','moment','bluebird','request-promise'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa8cb,0xc1));var _0xba8c=function(_0x37ddd9,_0x3e0026){_0x37ddd9=_0x37ddd9-0x0;var _0x2d0b9e=_0xa8cb[_0x37ddd9];return _0x2d0b9e;};'use strict';var _=require(_0xba8c('0x0'));var util=require(_0xba8c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xba8c('0x2'));var BPromise=require(_0xba8c('0x3'));var rp=require(_0xba8c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba8c('0x5'));var config=require(_0xba8c('0x6'));var attributes=require('./integration.attributes');module[_0xba8c('0x7')]=function(_0x4fe117,_0x5dc2dd){return _0x4fe117[_0xba8c('0x8')](_0xba8c('0x9'),attributes,{'tableName':_0xba8c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca18=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Integration','integrations','util','../../config/logger'];(function(_0xbc45ce,_0x5a8d2d){var _0x52d639=function(_0x5b91e9){while(--_0x5b91e9){_0xbc45ce['push'](_0xbc45ce['shift']());}};_0x52d639(++_0x5a8d2d);}(_0xca18,0xb2));var _0x8ca1=function(_0x259c7e,_0x96223a){_0x259c7e=_0x259c7e-0x0;var _0x15d791=_0xca18[_0x259c7e];return _0x15d791;};'use strict';var _=require('lodash');var util=require(_0x8ca1('0x0'));var logger=require(_0x8ca1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8ca1('0x2'));var rp=require(_0x8ca1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ca1('0x4'));var config=require(_0x8ca1('0x5'));var attributes=require('./integration.attributes');module[_0x8ca1('0x6')]=function(_0x3e5fb9,_0x547b74){return _0x3e5fb9[_0x8ca1('0x7')](_0x8ca1('0x8'),attributes,{'tableName':_0x8ca1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 6f9ab1e..e8501e6 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76ed=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1d0447,_0x3052a1){var _0x52c76a=function(_0x4112e7){while(--_0x4112e7){_0x1d0447['push'](_0x1d0447['shift']());}};_0x52c76a(++_0x3052a1);}(_0x76ed,0x1d0));var _0xd76e=function(_0xea466c,_0x5c0d65){_0xea466c=_0xea466c-0x0;var _0x348fe3=_0x76ed[_0xea466c];return _0x348fe3;};'use strict';var _=require(_0xd76e('0x0'));var util=require(_0xd76e('0x1'));var moment=require('moment');var BPromise=require(_0xd76e('0x2'));var rs=require(_0xd76e('0x3'));var fs=require('fs');var Redis=require(_0xd76e('0x4'));var db=require(_0xd76e('0x5'))['db'];var utils=require(_0xd76e('0x6'));var logger=require(_0xd76e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd76e('0x8'));var client=jayson[_0xd76e('0x9')][_0xd76e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb3682c,_0x3e4c93,_0x1fe2e2){return new BPromise(function(_0xb23af2,_0x249dff){return client['request'](_0xb3682c,_0x1fe2e2)[_0xd76e('0xb')](function(_0x35f986){logger[_0xd76e('0xc')](_0xd76e('0xd'),_0x3e4c93,'request\x20sent');logger[_0xd76e('0xe')](_0xd76e('0xf'),_0x3e4c93,'request\x20sent',JSON[_0xd76e('0x10')](_0x35f986));if(_0x35f986[_0xd76e('0x11')]){if(_0x35f986[_0xd76e('0x11')]['code']===0x1f4){logger['error'](_0xd76e('0xd'),_0x3e4c93,_0x35f986['error']['message']);return _0x249dff(_0x35f986[_0xd76e('0x11')][_0xd76e('0x12')]);}logger[_0xd76e('0x11')](_0xd76e('0xd'),_0x3e4c93,_0x35f986[_0xd76e('0x11')][_0xd76e('0x12')]);return _0xb23af2(_0x35f986['error'][_0xd76e('0x12')]);}else{logger[_0xd76e('0xc')](_0xd76e('0xd'),_0x3e4c93,'request\x20sent');_0xb23af2(_0x35f986[_0xd76e('0x13')]['message']);}})[_0xd76e('0x14')](function(_0x54cede){logger[_0xd76e('0x11')]('Integration,\x20%s,\x20%s',_0x3e4c93,_0x54cede);_0x249dff(_0x54cede);});});} \ No newline at end of file +var _0xf128=['rpc','../../config/environment','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3461c8,_0x2a904f){var _0x411111=function(_0x591ad1){while(--_0x591ad1){_0x3461c8['push'](_0x3461c8['shift']());}};_0x411111(++_0x2a904f);}(_0xf128,0x109));var _0x8f12=function(_0x1f5048,_0x35594a){_0x1f5048=_0x1f5048-0x0;var _0x4f17fd=_0xf128[_0x1f5048];return _0x4f17fd;};'use strict';var _=require(_0x8f12('0x0'));var util=require(_0x8f12('0x1'));var moment=require(_0x8f12('0x2'));var BPromise=require(_0x8f12('0x3'));var rs=require(_0x8f12('0x4'));var fs=require('fs');var Redis=require(_0x8f12('0x5'));var db=require(_0x8f12('0x6'))['db'];var utils=require(_0x8f12('0x7'));var logger=require('../../config/logger')(_0x8f12('0x8'));var config=require(_0x8f12('0x9'));var jayson=require(_0x8f12('0xa'));var client=jayson[_0x8f12('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x297aef,_0x3a563d,_0x2ff8d3){return new BPromise(function(_0x5087e6,_0x30db87){return client[_0x8f12('0xc')](_0x297aef,_0x2ff8d3)[_0x8f12('0xd')](function(_0x186c89){logger['info'](_0x8f12('0xe'),_0x3a563d,'request\x20sent');logger['debug'](_0x8f12('0xf'),_0x3a563d,_0x8f12('0x10'),JSON['stringify'](_0x186c89));if(_0x186c89[_0x8f12('0x11')]){if(_0x186c89['error']['code']===0x1f4){logger[_0x8f12('0x11')]('Integration,\x20%s,\x20%s',_0x3a563d,_0x186c89[_0x8f12('0x11')][_0x8f12('0x12')]);return _0x30db87(_0x186c89[_0x8f12('0x11')][_0x8f12('0x12')]);}logger[_0x8f12('0x11')](_0x8f12('0xe'),_0x3a563d,_0x186c89[_0x8f12('0x11')]['message']);return _0x5087e6(_0x186c89[_0x8f12('0x11')][_0x8f12('0x12')]);}else{logger[_0x8f12('0x13')](_0x8f12('0xe'),_0x3a563d,_0x8f12('0x10'));_0x5087e6(_0x186c89[_0x8f12('0x14')][_0x8f12('0x12')]);}})['catch'](function(_0x52bf35){logger[_0x8f12('0x11')](_0x8f12('0xe'),_0x3a563d,_0x52bf35);_0x30db87(_0x52bf35);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 1275346..721c939 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcac=['./integrationReport.controller','get','isAuthenticated','index','describe','show','post','create','put','update','delete','/:id','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xdcac,0x139));var _0xcdca=function(_0x32ba56,_0x52162b){_0x32ba56=_0x32ba56-0x0;var _0x5e1414=_0xdcac[_0x32ba56];return _0x5e1414;};'use strict';var multer=require('multer');var util=require(_0xcdca('0x0'));var path=require('path');var timeout=require(_0xcdca('0x1'));var express=require(_0xcdca('0x2'));var router=express[_0xcdca('0x3')]();var auth=require(_0xcdca('0x4'));var interaction=require(_0xcdca('0x5'));var config=require(_0xcdca('0x6'));var controller=require(_0xcdca('0x7'));router[_0xcdca('0x8')]('/',auth[_0xcdca('0x9')](),controller[_0xcdca('0xa')]);router[_0xcdca('0x8')]('/describe',auth[_0xcdca('0x9')](),controller[_0xcdca('0xb')]);router['get']('/:id',auth[_0xcdca('0x9')](),controller[_0xcdca('0xc')]);router[_0xcdca('0xd')]('/',auth[_0xcdca('0x9')](),controller[_0xcdca('0xe')]);router[_0xcdca('0xf')]('/:id',auth[_0xcdca('0x9')](),controller[_0xcdca('0x10')]);router[_0xcdca('0x11')](_0xcdca('0x12'),auth[_0xcdca('0x9')](),controller[_0xcdca('0x13')]);module['exports']=router; \ No newline at end of file +var _0x240e=['put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','show','create'];(function(_0x20bd4e,_0x2880cb){var _0x5acfed=function(_0x438f34){while(--_0x438f34){_0x20bd4e['push'](_0x20bd4e['shift']());}};_0x5acfed(++_0x2880cb);}(_0x240e,0x96));var _0xe240=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x240e[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require('multer');var util=require(_0xe240('0x0'));var path=require('path');var timeout=require(_0xe240('0x1'));var express=require('express');var router=express[_0xe240('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe240('0x3'));var config=require(_0xe240('0x4'));var controller=require(_0xe240('0x5'));router[_0xe240('0x6')]('/',auth[_0xe240('0x7')](),controller[_0xe240('0x8')]);router[_0xe240('0x6')]('/describe',auth[_0xe240('0x7')](),controller[_0xe240('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe240('0xa')]);router['post']('/',auth[_0xe240('0x7')](),controller[_0xe240('0xb')]);router[_0xe240('0xc')](_0xe240('0xd'),auth[_0xe240('0x7')](),controller[_0xe240('0xe')]);router[_0xe240('0xf')]('/:id',auth[_0xe240('0x7')](),controller[_0xe240('0x10')]);module[_0xe240('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 5e194da..11261a1 100644 --- a/server/api/integrationReport/integrationReport.attributes.js +++ b/server/api/integrationReport/integrationReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77ee=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x511f28,_0x172aad){var _0x55a3ee=function(_0x13c6ca){while(--_0x13c6ca){_0x511f28['push'](_0x511f28['shift']());}};_0x55a3ee(++_0x172aad);}(_0x77ee,0x16b));var _0xe77e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x77ee[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xe77e('0x0'));module[_0xe77e('0x1')]={'integration':{'type':Sequelize[_0xe77e('0x2')]},'eventChannel':{'type':Sequelize[_0xe77e('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xe77e('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe77e('0x2')]},'calleridnum':{'type':Sequelize[_0xe77e('0x2')]},'calleridname':{'type':Sequelize[_0xe77e('0x2')]},'queue':{'type':Sequelize[_0xe77e('0x2')]},'interface':{'type':Sequelize[_0xe77e('0x2')]},'membername':{'type':Sequelize[_0xe77e('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xe77e('0x4')]},'holdtime':{'type':Sequelize[_0xe77e('0x3')]},'agentcomplete':{'type':Sequelize[_0xe77e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe77e('0x3')]},'reason':{'type':Sequelize[_0xe77e('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xe77e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xe77e('0x4')]},'lastevent':{'type':Sequelize[_0xe77e('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xe77e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe77e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe77e('0x2')]},'language':{'type':Sequelize[_0xe77e('0x2')]},'accountcode':{'type':Sequelize[_0xe77e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe77e('0x2')]},'priority':{'type':Sequelize[_0xe77e('0x2')]},'destchannel':{'type':Sequelize[_0xe77e('0x2')]},'destchannelstate':{'type':Sequelize[_0xe77e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe77e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe77e('0x2')]},'destcalleridname':{'type':Sequelize[_0xe77e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xe77e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe77e('0x2')]},'destlanguage':{'type':Sequelize[_0xe77e('0x2')]},'destaccountcode':{'type':Sequelize[_0xe77e('0x2')]},'destcontext':{'type':Sequelize[_0xe77e('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xe77e('0x2')]},'destuniqueid':{'type':Sequelize[_0xe77e('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xe77e('0x2')]},'subject':{'type':Sequelize[_0xe77e('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xe77e('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xe77e('0x6')]},'status':{'type':Sequelize[_0xe77e('0x7')](_0xe77e('0x8'),_0xe77e('0x9'),_0xe77e('0xa'),_0xe77e('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xe77e('0x2')]},'appdata':{'type':Sequelize[_0xe77e('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6e9b=['TEXT','ENUM','SENT','SENDING','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x6e9b,0xb5));var _0xb6e9=function(_0x1fbcc2,_0x5b0f9a){_0x1fbcc2=_0x1fbcc2-0x0;var _0x4630d0=_0x6e9b[_0x1fbcc2];return _0x4630d0;};'use strict';var Sequelize=require(_0xb6e9('0x0'));module[_0xb6e9('0x1')]={'integration':{'type':Sequelize[_0xb6e9('0x2')]},'eventChannel':{'type':Sequelize[_0xb6e9('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xb6e9('0x2')]},'integrationId':{'type':Sequelize[_0xb6e9('0x3')]},'contacts':{'type':Sequelize[_0xb6e9('0x2')]},'uniqueid':{'type':Sequelize[_0xb6e9('0x2')]},'calleridnum':{'type':Sequelize[_0xb6e9('0x2')]},'calleridname':{'type':Sequelize[_0xb6e9('0x2')]},'queue':{'type':Sequelize[_0xb6e9('0x2')]},'interface':{'type':Sequelize[_0xb6e9('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xb6e9('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xb6e9('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb6e9('0x3')]},'reason':{'type':Sequelize[_0xb6e9('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb6e9('0x4')]},'agentdump':{'type':Sequelize[_0xb6e9('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xb6e9('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xb6e9('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb6e9('0x2')]},'connectedlinename':{'type':Sequelize[_0xb6e9('0x2')]},'language':{'type':Sequelize[_0xb6e9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb6e9('0x2')]},'exten':{'type':Sequelize[_0xb6e9('0x2')]},'priority':{'type':Sequelize[_0xb6e9('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xb6e9('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb6e9('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb6e9('0x2')]},'destcalleridname':{'type':Sequelize[_0xb6e9('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xb6e9('0x2')]},'destlanguage':{'type':Sequelize[_0xb6e9('0x2')]},'destaccountcode':{'type':Sequelize[_0xb6e9('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xb6e9('0x2')]},'destpriority':{'type':Sequelize[_0xb6e9('0x2')]},'destuniqueid':{'type':Sequelize[_0xb6e9('0x2')]},'messageId':{'type':Sequelize[_0xb6e9('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xb6e9('0x2')]},'from':{'type':Sequelize[_0xb6e9('0x2')]},'to':{'type':Sequelize[_0xb6e9('0x2')]},'cc':{'type':Sequelize[_0xb6e9('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xb6e9('0x6')]},'status':{'type':Sequelize[_0xb6e9('0x7')](_0xb6e9('0x8'),_0xb6e9('0x9'),'RECEIVED',_0xb6e9('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b465904..1d4c503 100644 --- a/server/api/integrationReport/integrationReport.controller.js +++ b/server/api/integrationReport/integrationReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6343=['type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','rimraf','zip-dir','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','reject','update','destroy','then','error','stack','name','send','index','IntegrationReport','rawAttributes'];(function(_0x257984,_0x167661){var _0x5154cf=function(_0x22aa81){while(--_0x22aa81){_0x257984['push'](_0x257984['shift']());}};_0x5154cf(++_0x167661);}(_0x6343,0x168));var _0x3634=function(_0x49aa19,_0x421b3d){_0x49aa19=_0x49aa19-0x0;var _0x4ec300=_0x6343[_0x49aa19];return _0x4ec300;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3634('0x0'));var zipdir=require(_0x3634('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3634('0x2'));var util=require(_0x3634('0x3'));var path=require('path');var sox=require(_0x3634('0x4'));var csv=require(_0x3634('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x5'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var db=require(_0x3634('0x11'))['db'];function respondWithStatusCode(_0x1d180f,_0x1e6a04){_0x1e6a04=_0x1e6a04||0xcc;return function(_0x151c8c){if(_0x151c8c){return _0x1d180f[_0x3634('0x12')](_0x1e6a04);}return _0x1d180f[_0x3634('0x13')](_0x1e6a04)[_0x3634('0x14')]();};}function respondWithResult(_0x36f54b,_0x299e53){_0x299e53=_0x299e53||0xc8;return function(_0x71d09b){if(_0x71d09b){return _0x36f54b[_0x3634('0x13')](_0x299e53)[_0x3634('0x15')](_0x71d09b);}};}function respondWithFilteredResult(_0x5a5063,_0x167247){return function(_0x48787f){if(_0x48787f){var _0x69609d=_0x48787f[_0x3634('0x16')],_0x18285c=_0x167247['offset'],_0x2fc628=_0x167247[_0x3634('0x17')]+_0x167247['limit'],_0x78f93f;if(_0x2fc628>=_0x69609d){_0x2fc628=_0x69609d;_0x78f93f=0xc8;}else{_0x78f93f=0xce;}_0x5a5063['status'](_0x78f93f);return _0x5a5063[_0x3634('0x18')]('Content-Range',_0x18285c+'-'+_0x2fc628+'/'+_0x69609d)[_0x3634('0x15')](_0x48787f);}return null;};}function patchUpdates(_0x32e3c6){return function(_0x1e4f1d){try{jsonpatch['apply'](_0x1e4f1d,_0x32e3c6,!![]);}catch(_0x3ab7a5){return BPromise[_0x3634('0x19')](_0x3ab7a5);}return _0x1e4f1d['save']();};}function saveUpdates(_0xeb9231,_0x506281){return function(_0x742e56){if(_0x742e56){return _0x742e56[_0x3634('0x1a')](_0xeb9231)['then'](function(_0x29a343){return _0x29a343;});}return null;};}function removeEntity(_0x3df472,_0x206c8e){return function(_0x505026){if(_0x505026){return _0x505026[_0x3634('0x1b')]()[_0x3634('0x1c')](function(){_0x3df472['status'](0xcc)[_0x3634('0x14')]();});}};}function handleEntityNotFound(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(!_0x3a8c41){_0x596acb[_0x3634('0x12')](0x194);}return _0x3a8c41;};}function handleError(_0x5df6fb,_0x1b25be){_0x1b25be=_0x1b25be||0x1f4;return function(_0x21fd2c){logger[_0x3634('0x1d')](_0x21fd2c[_0x3634('0x1e')]);if(_0x21fd2c[_0x3634('0x1f')]){delete _0x21fd2c[_0x3634('0x1f')];}_0x5df6fb[_0x3634('0x13')](_0x1b25be)[_0x3634('0x20')](_0x21fd2c);};}exports[_0x3634('0x21')]=function(_0x52e9ae,_0x1b0a44){var _0x552cc3={},_0x58841d={},_0x59f481={'count':0x0,'rows':[]};var _0x7a35c4=_['map'](db[_0x3634('0x22')][_0x3634('0x23')],function(_0x49804f){return{'name':_0x49804f['fieldName'],'type':_0x49804f[_0x3634('0x24')]['key']};});_0x58841d[_0x3634('0x25')]=_['map'](_0x7a35c4,_0x3634('0x1f'));_0x58841d[_0x3634('0x26')]=_[_0x3634('0x27')](_0x52e9ae[_0x3634('0x26')]);_0x58841d[_0x3634('0x28')]=_[_0x3634('0x29')](_0x58841d[_0x3634('0x25')],_0x58841d[_0x3634('0x26')]);_0x552cc3['attributes']=_['intersection'](_0x58841d['model'],qs[_0x3634('0x2a')](_0x52e9ae['query'][_0x3634('0x2a')]));_0x552cc3[_0x3634('0x2b')]=_0x552cc3[_0x3634('0x2b')][_0x3634('0x2c')]?_0x552cc3[_0x3634('0x2b')]:_0x58841d[_0x3634('0x25')];if(!_0x52e9ae['query'][_0x3634('0x2d')](_0x3634('0x2e'))){_0x552cc3[_0x3634('0x2f')]=qs[_0x3634('0x2f')](_0x52e9ae[_0x3634('0x26')][_0x3634('0x2f')]);_0x552cc3[_0x3634('0x17')]=qs[_0x3634('0x17')](_0x52e9ae[_0x3634('0x26')]['offset']);}_0x552cc3[_0x3634('0x30')]=qs[_0x3634('0x31')](_0x52e9ae[_0x3634('0x26')][_0x3634('0x31')]);_0x552cc3['where']=qs[_0x3634('0x28')](_[_0x3634('0x32')](_0x52e9ae[_0x3634('0x26')],_0x58841d['filters']));if(_0x52e9ae['query']['filter']){_0x552cc3[_0x3634('0x33')]=_[_0x3634('0x34')](_0x552cc3['where'],{'$or':_[_0x3634('0x35')](_0x7a35c4,function(_0x173ffd){if(_0x173ffd[_0x3634('0x24')]!==_0x3634('0x36')){var _0x18157f={};_0x18157f[_0x173ffd[_0x3634('0x1f')]]={'$like':'%'+_0x52e9ae[_0x3634('0x26')]['filter']+'%'};return _0x18157f;}})});}_0x552cc3=_[_0x3634('0x34')]({},_0x552cc3,_0x52e9ae['options']);var _0x35b71e={'where':_0x552cc3[_0x3634('0x33')]};return db[_0x3634('0x22')][_0x3634('0x16')](_0x35b71e)[_0x3634('0x1c')](function(_0x597511){_0x59f481[_0x3634('0x16')]=_0x597511;if(_0x52e9ae[_0x3634('0x26')][_0x3634('0x37')]){_0x552cc3[_0x3634('0x38')]=[{'all':!![]}];}return db[_0x3634('0x22')][_0x3634('0x39')](_0x552cc3);})[_0x3634('0x1c')](function(_0x25cd52){_0x59f481[_0x3634('0x3a')]=_0x25cd52;return _0x59f481;})['then'](respondWithFilteredResult(_0x1b0a44,_0x552cc3))['catch'](handleError(_0x1b0a44,null));};exports[_0x3634('0x3b')]=function(_0x5533cd,_0x50d718){var _0x5948db={'raw':![],'where':{'id':_0x5533cd['params']['id']}},_0x80f1a2={};_0x80f1a2[_0x3634('0x25')]=_[_0x3634('0x27')](db['IntegrationReport']['rawAttributes']);_0x80f1a2['query']=_[_0x3634('0x27')](_0x5533cd[_0x3634('0x26')]);_0x80f1a2['filters']=_[_0x3634('0x29')](_0x80f1a2[_0x3634('0x25')],_0x80f1a2[_0x3634('0x26')]);_0x5948db[_0x3634('0x2b')]=_[_0x3634('0x29')](_0x80f1a2['model'],qs['fields'](_0x5533cd[_0x3634('0x26')][_0x3634('0x2a')]));_0x5948db[_0x3634('0x2b')]=_0x5948db[_0x3634('0x2b')][_0x3634('0x2c')]?_0x5948db[_0x3634('0x2b')]:_0x80f1a2['model'];if(_0x5533cd[_0x3634('0x26')][_0x3634('0x37')]){_0x5948db[_0x3634('0x38')]=[{'all':!![]}];}_0x5948db=_['merge']({},_0x5948db,_0x5533cd['options']);return db[_0x3634('0x22')][_0x3634('0x3c')](_0x5948db)[_0x3634('0x1c')](handleEntityNotFound(_0x50d718,null))[_0x3634('0x1c')](respondWithResult(_0x50d718,null))[_0x3634('0x3d')](handleError(_0x50d718,null));};exports[_0x3634('0x3e')]=function(_0x3f513a,_0x38a75a){return db['IntegrationReport'][_0x3634('0x3e')](_0x3f513a[_0x3634('0x3f')],{})[_0x3634('0x1c')](respondWithResult(_0x38a75a,0xc9))[_0x3634('0x3d')](handleError(_0x38a75a,null));};exports[_0x3634('0x1a')]=function(_0x151654,_0x10e5e4){if(_0x151654[_0x3634('0x3f')]['id']){delete _0x151654[_0x3634('0x3f')]['id'];}return db['IntegrationReport'][_0x3634('0x3c')]({'where':{'id':_0x151654[_0x3634('0x40')]['id']}})['then'](handleEntityNotFound(_0x10e5e4,null))[_0x3634('0x1c')](saveUpdates(_0x151654[_0x3634('0x3f')],null))[_0x3634('0x1c')](respondWithResult(_0x10e5e4,null))[_0x3634('0x3d')](handleError(_0x10e5e4,null));};exports[_0x3634('0x1b')]=function(_0x1ca58d,_0x5cc8d1){return db[_0x3634('0x22')][_0x3634('0x3c')]({'where':{'id':_0x1ca58d[_0x3634('0x40')]['id']}})[_0x3634('0x1c')](handleEntityNotFound(_0x5cc8d1,null))[_0x3634('0x1c')](removeEntity(_0x5cc8d1,null))['catch'](handleError(_0x5cc8d1,null));};exports[_0x3634('0x41')]=function(_0x20f9f8,_0x5c44f1){return db['IntegrationReport'][_0x3634('0x41')]()['then'](respondWithResult(_0x5c44f1,null))[_0x3634('0x3d')](handleError(_0x5c44f1,null));}; \ No newline at end of file +var _0x341c=['set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','destroy','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit'];(function(_0x345eb2,_0xdf98e5){var _0x3b1eaf=function(_0x55acee){while(--_0x55acee){_0x345eb2['push'](_0x345eb2['shift']());}};_0x3b1eaf(++_0xdf98e5);}(_0x341c,0xcc));var _0xc341=function(_0x484bf4,_0x2b975c){_0x484bf4=_0x484bf4-0x0;var _0x31c683=_0x341c[_0x484bf4];return _0x31c683;};'use strict';var pdf=require(_0xc341('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc341('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc341('0x2'));var rp=require(_0xc341('0x3'));var moment=require(_0xc341('0x4'));var BPromise=require(_0xc341('0x5'));var Mustache=require(_0xc341('0x6'));var util=require(_0xc341('0x7'));var path=require(_0xc341('0x8'));var sox=require(_0xc341('0x9'));var csv=require('to-csv');var ejs=require(_0xc341('0xa'));var fs=require('fs');var _=require(_0xc341('0xb'));var squel=require(_0xc341('0xc'));var crypto=require(_0xc341('0xd'));var jsforce=require(_0xc341('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc341('0xf'));var querystring=require(_0xc341('0x10'));var Papa=require(_0xc341('0x11'));var Redis=require(_0xc341('0x12'));var authService=require(_0xc341('0x13'));var qs=require(_0xc341('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc341('0x15'));var logger=require(_0xc341('0x16'))(_0xc341('0x17'));var utils=require(_0xc341('0x18'));var config=require(_0xc341('0x19'));var db=require(_0xc341('0x1a'))['db'];function respondWithStatusCode(_0x5dd1f8,_0x551f9d){_0x551f9d=_0x551f9d||0xcc;return function(_0x15c85c){if(_0x15c85c){return _0x5dd1f8[_0xc341('0x1b')](_0x551f9d);}return _0x5dd1f8[_0xc341('0x1c')](_0x551f9d)[_0xc341('0x1d')]();};}function respondWithResult(_0x245595,_0x483e30){_0x483e30=_0x483e30||0xc8;return function(_0x22fdc3){if(_0x22fdc3){return _0x245595[_0xc341('0x1c')](_0x483e30)[_0xc341('0x1e')](_0x22fdc3);}};}function respondWithFilteredResult(_0x158c47,_0x989024){return function(_0x2bd235){if(_0x2bd235){var _0x203a06=_0x2bd235[_0xc341('0x1f')],_0x26bbce=_0x989024['offset'],_0x33da6b=_0x989024['offset']+_0x989024[_0xc341('0x20')],_0xdbf615;if(_0x33da6b>=_0x203a06){_0x33da6b=_0x203a06;_0xdbf615=0xc8;}else{_0xdbf615=0xce;}_0x158c47[_0xc341('0x1c')](_0xdbf615);return _0x158c47[_0xc341('0x21')](_0xc341('0x22'),_0x26bbce+'-'+_0x33da6b+'/'+_0x203a06)[_0xc341('0x1e')](_0x2bd235);}return null;};}function patchUpdates(_0x3555c1){return function(_0x40242a){try{jsonpatch[_0xc341('0x23')](_0x40242a,_0x3555c1,!![]);}catch(_0x18937d){return BPromise[_0xc341('0x24')](_0x18937d);}return _0x40242a[_0xc341('0x25')]();};}function saveUpdates(_0x220b76,_0x55a3c3){return function(_0x556281){if(_0x556281){return _0x556281[_0xc341('0x26')](_0x220b76)[_0xc341('0x27')](function(_0x21b23c){return _0x21b23c;});}return null;};}function removeEntity(_0x247774,_0x330cb2){return function(_0x230754){if(_0x230754){return _0x230754['destroy']()[_0xc341('0x27')](function(){_0x247774[_0xc341('0x1c')](0xcc)[_0xc341('0x1d')]();});}};}function handleEntityNotFound(_0x5a4912,_0x5c749b){return function(_0x440a4d){if(!_0x440a4d){_0x5a4912['sendStatus'](0x194);}return _0x440a4d;};}function handleError(_0x19a47f,_0x466e0f){_0x466e0f=_0x466e0f||0x1f4;return function(_0x2fc83e){logger[_0xc341('0x28')](_0x2fc83e[_0xc341('0x29')]);if(_0x2fc83e['name']){delete _0x2fc83e[_0xc341('0x2a')];}_0x19a47f[_0xc341('0x1c')](_0x466e0f)[_0xc341('0x2b')](_0x2fc83e);};}exports[_0xc341('0x2c')]=function(_0x3446b3,_0x3b6cd2){var _0x7c443f={},_0x51af9d={},_0x44eec7={'count':0x0,'rows':[]};var _0x421213=_[_0xc341('0x2d')](db[_0xc341('0x2e')][_0xc341('0x2f')],function(_0x31ef05){return{'name':_0x31ef05[_0xc341('0x30')],'type':_0x31ef05[_0xc341('0x31')][_0xc341('0x32')]};});_0x51af9d['model']=_[_0xc341('0x2d')](_0x421213,_0xc341('0x2a'));_0x51af9d[_0xc341('0x33')]=_[_0xc341('0x34')](_0x3446b3[_0xc341('0x33')]);_0x51af9d[_0xc341('0x35')]=_[_0xc341('0x36')](_0x51af9d[_0xc341('0x37')],_0x51af9d[_0xc341('0x33')]);_0x7c443f[_0xc341('0x38')]=_[_0xc341('0x36')](_0x51af9d['model'],qs['fields'](_0x3446b3[_0xc341('0x33')]['fields']));_0x7c443f[_0xc341('0x38')]=_0x7c443f[_0xc341('0x38')][_0xc341('0x39')]?_0x7c443f[_0xc341('0x38')]:_0x51af9d[_0xc341('0x37')];if(!_0x3446b3[_0xc341('0x33')][_0xc341('0x3a')](_0xc341('0x3b'))){_0x7c443f[_0xc341('0x20')]=qs['limit'](_0x3446b3[_0xc341('0x33')][_0xc341('0x20')]);_0x7c443f[_0xc341('0x3c')]=qs[_0xc341('0x3c')](_0x3446b3[_0xc341('0x33')]['offset']);}_0x7c443f['order']=qs['sort'](_0x3446b3[_0xc341('0x33')][_0xc341('0x3d')]);_0x7c443f[_0xc341('0x3e')]=qs[_0xc341('0x35')](_['pick'](_0x3446b3['query'],_0x51af9d[_0xc341('0x35')]));if(_0x3446b3[_0xc341('0x33')][_0xc341('0x3f')]){_0x7c443f[_0xc341('0x3e')]=_['merge'](_0x7c443f[_0xc341('0x3e')],{'$or':_[_0xc341('0x2d')](_0x421213,function(_0x4cd018){if(_0x4cd018[_0xc341('0x31')]!=='VIRTUAL'){var _0x2d0858={};_0x2d0858[_0x4cd018[_0xc341('0x2a')]]={'$like':'%'+_0x3446b3[_0xc341('0x33')][_0xc341('0x3f')]+'%'};return _0x2d0858;}})});}_0x7c443f=_[_0xc341('0x40')]({},_0x7c443f,_0x3446b3[_0xc341('0x41')]);var _0x3aac1a={'where':_0x7c443f[_0xc341('0x3e')]};return db[_0xc341('0x2e')][_0xc341('0x1f')](_0x3aac1a)[_0xc341('0x27')](function(_0xaf5a3b){_0x44eec7['count']=_0xaf5a3b;if(_0x3446b3[_0xc341('0x33')][_0xc341('0x42')]){_0x7c443f[_0xc341('0x43')]=[{'all':!![]}];}return db[_0xc341('0x2e')][_0xc341('0x44')](_0x7c443f);})[_0xc341('0x27')](function(_0x303ba1){_0x44eec7[_0xc341('0x45')]=_0x303ba1;return _0x44eec7;})[_0xc341('0x27')](respondWithFilteredResult(_0x3b6cd2,_0x7c443f))[_0xc341('0x46')](handleError(_0x3b6cd2,null));};exports[_0xc341('0x47')]=function(_0x2cb5ba,_0x19f77){var _0x5edcd2={'raw':![],'where':{'id':_0x2cb5ba[_0xc341('0x48')]['id']}},_0x4ccfb9={};_0x4ccfb9[_0xc341('0x37')]=_['keys'](db[_0xc341('0x2e')][_0xc341('0x2f')]);_0x4ccfb9[_0xc341('0x33')]=_['keys'](_0x2cb5ba[_0xc341('0x33')]);_0x4ccfb9['filters']=_[_0xc341('0x36')](_0x4ccfb9[_0xc341('0x37')],_0x4ccfb9[_0xc341('0x33')]);_0x5edcd2[_0xc341('0x38')]=_[_0xc341('0x36')](_0x4ccfb9[_0xc341('0x37')],qs['fields'](_0x2cb5ba[_0xc341('0x33')][_0xc341('0x49')]));_0x5edcd2[_0xc341('0x38')]=_0x5edcd2['attributes'][_0xc341('0x39')]?_0x5edcd2['attributes']:_0x4ccfb9[_0xc341('0x37')];if(_0x2cb5ba[_0xc341('0x33')][_0xc341('0x42')]){_0x5edcd2[_0xc341('0x43')]=[{'all':!![]}];}_0x5edcd2=_[_0xc341('0x40')]({},_0x5edcd2,_0x2cb5ba['options']);return db[_0xc341('0x2e')]['find'](_0x5edcd2)['then'](handleEntityNotFound(_0x19f77,null))[_0xc341('0x27')](respondWithResult(_0x19f77,null))[_0xc341('0x46')](handleError(_0x19f77,null));};exports['create']=function(_0x50b202,_0x550bcd){return db['IntegrationReport'][_0xc341('0x4a')](_0x50b202[_0xc341('0x4b')],{})['then'](respondWithResult(_0x550bcd,0xc9))['catch'](handleError(_0x550bcd,null));};exports[_0xc341('0x26')]=function(_0x500137,_0x37e484){if(_0x500137[_0xc341('0x4b')]['id']){delete _0x500137[_0xc341('0x4b')]['id'];}return db[_0xc341('0x2e')][_0xc341('0x4c')]({'where':{'id':_0x500137[_0xc341('0x48')]['id']}})[_0xc341('0x27')](handleEntityNotFound(_0x37e484,null))[_0xc341('0x27')](saveUpdates(_0x500137[_0xc341('0x4b')],null))[_0xc341('0x27')](respondWithResult(_0x37e484,null))[_0xc341('0x46')](handleError(_0x37e484,null));};exports[_0xc341('0x4d')]=function(_0x34c83e,_0x2126a7){return db[_0xc341('0x2e')][_0xc341('0x4c')]({'where':{'id':_0x34c83e[_0xc341('0x48')]['id']}})[_0xc341('0x27')](handleEntityNotFound(_0x2126a7,null))[_0xc341('0x27')](removeEntity(_0x2126a7,null))[_0xc341('0x46')](handleError(_0x2126a7,null));};exports[_0xc341('0x4e')]=function(_0x5574dc,_0x475a9c){return db[_0xc341('0x2e')][_0xc341('0x4e')]()[_0xc341('0x27')](respondWithResult(_0x475a9c,null))[_0xc341('0x46')](handleError(_0x475a9c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index fc3b43b..674a802 100644 --- a/server/api/integrationReport/integrationReport.model.js +++ b/server/api/integrationReport/integrationReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28e6=['./integrationReport.attributes','exports','define','IntegrationReport','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2ba3d4,_0x75d6e3){var _0x3c3625=function(_0x668c6d){while(--_0x668c6d){_0x2ba3d4['push'](_0x2ba3d4['shift']());}};_0x3c3625(++_0x75d6e3);}(_0x28e6,0x67));var _0x628e=function(_0x505949,_0x5b990e){_0x505949=_0x505949-0x0;var _0xab50b0=_0x28e6[_0x505949];return _0xab50b0;};'use strict';var _=require('lodash');var util=require(_0x628e('0x0'));var logger=require(_0x628e('0x1'))('api');var moment=require(_0x628e('0x2'));var BPromise=require(_0x628e('0x3'));var rp=require(_0x628e('0x4'));var fs=require('fs');var path=require(_0x628e('0x5'));var rimraf=require('rimraf');var config=require(_0x628e('0x6'));var attributes=require(_0x628e('0x7'));module[_0x628e('0x8')]=function(_0x3b8680,_0x38e33c){return _0x3b8680[_0x628e('0x9')](_0x628e('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd970=['api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','report_integration','lodash','util','../../config/logger'];(function(_0x380650,_0x42ec3f){var _0x52de64=function(_0x1cbc3b){while(--_0x1cbc3b){_0x380650['push'](_0x380650['shift']());}};_0x52de64(++_0x42ec3f);}(_0xd970,0x19d));var _0x0d97=function(_0x35038d,_0x1c27cd){_0x35038d=_0x35038d-0x0;var _0x124d63=_0xd970[_0x35038d];return _0x124d63;};'use strict';var _=require(_0x0d97('0x0'));var util=require(_0x0d97('0x1'));var logger=require(_0x0d97('0x2'))(_0x0d97('0x3'));var moment=require(_0x0d97('0x4'));var BPromise=require(_0x0d97('0x5'));var rp=require(_0x0d97('0x6'));var fs=require('fs');var path=require(_0x0d97('0x7'));var rimraf=require(_0x0d97('0x8'));var config=require('../../config/environment');var attributes=require(_0x0d97('0x9'));module[_0x0d97('0xa')]=function(_0x1b4638,_0x569a98){return _0x1b4638[_0x0d97('0xb')]('IntegrationReport',attributes,{'tableName':_0x0d97('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index a3d22d4..b311838 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0x0b0e[_0x44f974];return _0x805dbd;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0xac4a=['IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xac4a,0x13f));var _0xaac4=function(_0x11a3a9,_0x2646f4){_0x11a3a9=_0x11a3a9-0x0;var _0x3dcf7c=_0xac4a[_0x11a3a9];return _0x3dcf7c;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('IntegrationReport,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('IntegrationReport,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index cd4e6c4..7466ec8 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout'];(function(_0x19cb66,_0x2cde06){var _0x5714c7=function(_0x1b4ae2){while(--_0x1b4ae2){_0x19cb66['push'](_0x19cb66['shift']());}};_0x5714c7(++_0x2cde06);}(_0x008c,0x188));var _0xc008=function(_0x5e5b72,_0x486a42){_0x5e5b72=_0x5e5b72-0x0;var _0x2247d1=_0x008c[_0x5e5b72];return _0x2247d1;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['post']('/:id/sub_intervals',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0x11'),auth[_0xc008('0xa')](),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x15')]=router; \ No newline at end of file +var _0x55ca=['/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','create','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x55ca,0x126));var _0xa55c=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x55ca[_0xe30e17];return _0x2342c9;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0x6')]('/:id/sub_intervals',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0xd')](_0xa55c('0x10'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index b76dd51..e1515df 100644 --- a/server/api/interval/interval.attributes.js +++ b/server/api/interval/interval.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd10=['exports','STRING'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0xdd10,0x1a0));var _0x0dd1=function(_0x511622,_0xb94b14){_0x511622=_0x511622-0x0;var _0x3815bf=_0xdd10[_0x511622];return _0x3815bf;};'use strict';var Sequelize=require('sequelize');module[_0x0dd1('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0dd1('0x1')]},'interval':{'type':Sequelize[_0x0dd1('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x2a59=['STRING','exports'];(function(_0x24d91e,_0x5f0df4){var _0x34d6f6=function(_0x43c778){while(--_0x43c778){_0x24d91e['push'](_0x24d91e['shift']());}};_0x34d6f6(++_0x5f0df4);}(_0x2a59,0x11f));var _0x92a5=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x2a59[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require('sequelize');module[_0x92a5('0x0')]={'name':{'type':Sequelize[_0x92a5('0x1')]},'description':{'type':Sequelize[_0x92a5('0x1')]},'interval':{'type':Sequelize[_0x92a5('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 7609cea..63e77af 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','addInterval','IntervalId','getIntervals','findOne','order','options','addIntervals','sequelize','transaction','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','end','sendStatus','error','name','send','Interval','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x44dbfb,_0x46aa41){var _0x540754=function(_0xee3f24){while(--_0xee3f24){_0x44dbfb['push'](_0x44dbfb['shift']());}};_0x540754(++_0x46aa41);}(_0x55ca,0x126));var _0xa55c=function(_0x28a180,_0x5bb5b0){_0x28a180=_0x28a180-0x0;var _0x1161d3=_0x55ca[_0x28a180];return _0x1161d3;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var db=require(_0xa55c('0x16'))['db'];var extensions=require(_0xa55c('0x17'));function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=_0x3ccf65[_0xa55c('0x1a')],_0x25934f=_0x4e0b2f[_0xa55c('0x1b')],_0x31e10d=_0x4e0b2f[_0xa55c('0x1b')]+_0x4e0b2f[_0xa55c('0x1c')],_0x1c4cfd;if(_0x31e10d>=_0x3dcf4f){_0x31e10d=_0x3dcf4f;_0x1c4cfd=0xc8;}else{_0x1c4cfd=0xce;}_0x247e77['status'](_0x1c4cfd);return _0x247e77[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x25934f+'-'+_0x31e10d+'/'+_0x3dcf4f)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x358b61){return function(_0x23a1ae){try{jsonpatch[_0xa55c('0x1f')](_0x23a1ae,_0x358b61,!![]);}catch(_0x4c0daf){return BPromise['reject'](_0x4c0daf);}return _0x23a1ae[_0xa55c('0x20')]();};}function saveUpdates(_0x3776ac,_0xade4c4){return function(_0x4cfe10){if(_0x4cfe10){return _0x4cfe10[_0xa55c('0x21')](_0x3776ac)[_0xa55c('0x22')](function(_0x54945a){return _0x54945a;});}return null;};}function removeEntity(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x23')]()[_0xa55c('0x22')](function(){var _0x49ed04=_0x940f28[_0xa55c('0x24')]({'plain':!![]});var _0x504c24='Intervals';return db['UserProfileResource'][_0xa55c('0x23')]({'where':{'type':_0x504c24,'resourceId':_0x49ed04['id']}})['then'](function(){return _0x940f28;});})[_0xa55c('0x22')](function(){_0x187a87[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0xf0e574,_0x2313a9){return function(_0x170ba4){if(!_0x170ba4){_0xf0e574[_0xa55c('0x26')](0x194);}return _0x170ba4;};}function handleError(_0x11e7f7,_0x192df2){_0x192df2=_0x192df2||0x1f4;return function(_0x3cd152){logger[_0xa55c('0x27')](_0x3cd152['stack']);if(_0x3cd152[_0xa55c('0x28')]){delete _0x3cd152[_0xa55c('0x28')];}_0x11e7f7[_0xa55c('0x18')](_0x192df2)[_0xa55c('0x29')](_0x3cd152);};}exports['index']=function(_0x1377b0,_0x22f6b6){var _0x1b8388={},_0x201941={},_0x45ee8d={'count':0x0,'rows':[]};var _0x3c3cb5=_['map'](db[_0xa55c('0x2a')]['rawAttributes'],function(_0x35c9c2){return{'name':_0x35c9c2[_0xa55c('0x2b')],'type':_0x35c9c2[_0xa55c('0x2c')][_0xa55c('0x2d')]};});_0x201941['model']=_[_0xa55c('0x2e')](_0x3c3cb5,_0xa55c('0x28'));_0x201941[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x1377b0[_0xa55c('0x2f')]);_0x201941[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x201941[_0xa55c('0x33')],_0x201941[_0xa55c('0x2f')]);_0x1b8388[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x201941['model'],qs['fields'](_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x1b8388['attributes']=_0x1b8388[_0xa55c('0x34')][_0xa55c('0x36')]?_0x1b8388[_0xa55c('0x34')]:_0x201941[_0xa55c('0x33')];if(!_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x37')](_0xa55c('0x38'))){_0x1b8388[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x1377b0['query']['limit']);_0x1b8388['offset']=qs[_0xa55c('0x1b')](_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x1b')]);}_0x1b8388['order']=qs[_0xa55c('0x39')](_0x1377b0['query'][_0xa55c('0x39')]);_0x1b8388['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x3a')](_0x1377b0[_0xa55c('0x2f')],_0x201941['filters']));if(_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x3b')]){_0x1b8388['where']=_[_0xa55c('0x3c')](_0x1b8388[_0xa55c('0x3d')],{'$or':_['map'](_0x3c3cb5,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2c')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x28')]]={'$like':'%'+_0x1377b0['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1b8388=_['merge']({},_0x1b8388,_0x1377b0['options']);var _0x3b3308={'where':_0x1b8388[_0xa55c('0x3d')]};return db[_0xa55c('0x2a')][_0xa55c('0x1a')](_0x3b3308)[_0xa55c('0x22')](function(_0x56d17c){_0x45ee8d[_0xa55c('0x1a')]=_0x56d17c;if(_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x3e')]){_0x1b8388[_0xa55c('0x3f')]=[{'all':!![]}];}return db[_0xa55c('0x2a')][_0xa55c('0x40')](_0x1b8388);})['then'](function(_0x386e34){_0x45ee8d['rows']=_0x386e34;return _0x45ee8d;})['then'](respondWithFilteredResult(_0x22f6b6,_0x1b8388))[_0xa55c('0x41')](handleError(_0x22f6b6,null));};exports[_0xa55c('0x42')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':!![],'where':{'id':_0x496920[_0xa55c('0x43')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x33')]=_[_0xa55c('0x30')](db['Interval'][_0xa55c('0x44')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x33')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x35')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x34')]['length']?_0x508bd3[_0xa55c('0x34')]:_0x5f25f7[_0xa55c('0x33')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3f')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3c')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x2a')][_0xa55c('0x45')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x22')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x41')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x2a')][_0xa55c('0x46')](_0x46f839['body'],{})[_0xa55c('0x22')](function(_0x58a7ea){var _0x2157d6=_0x46f839[_0xa55c('0x47')][_0xa55c('0x24')]({'plain':!![]});if(!_0x2157d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2157d6[_0xa55c('0x48')]===_0xa55c('0x47')){var _0x574fe9=_0x58a7ea[_0xa55c('0x24')]({'plain':!![]});var _0x34de95=_0xa55c('0x49');return db[_0xa55c('0x4a')][_0xa55c('0x45')]({'where':{'name':_0x34de95,'userProfileId':_0x2157d6[_0xa55c('0x4b')]},'raw':!![]})[_0xa55c('0x22')](function(_0x129626){if(_0x129626&&_0x129626[_0xa55c('0x4c')]===0x0){return db[_0xa55c('0x4d')]['create']({'name':_0x574fe9[_0xa55c('0x28')],'resourceId':_0x574fe9['id'],'type':_0x129626[_0xa55c('0x28')],'sectionId':_0x129626['id']},{})[_0xa55c('0x22')](function(){return _0x58a7ea;});}else{return _0x58a7ea;}})['catch'](function(_0x4c3095){logger[_0xa55c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c3095);throw _0x4c3095;});}return _0x58a7ea;})[_0xa55c('0x22')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x21')]=function(_0x228df4,_0x181802){if(_0x228df4[_0xa55c('0x4e')]['id']){delete _0x228df4[_0xa55c('0x4e')]['id'];}return db['Interval'][_0xa55c('0x45')]({'where':{'id':_0x228df4[_0xa55c('0x43')]['id']}})['then'](handleEntityNotFound(_0x181802,null))[_0xa55c('0x22')](saveUpdates(_0x228df4[_0xa55c('0x4e')],null))[_0xa55c('0x22')](respondWithResult(_0x181802,null))[_0xa55c('0x41')](handleError(_0x181802,null));};exports['destroy']=function(_0x4def35,_0x267965){return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x4def35[_0xa55c('0x43')]['id']}})['then'](handleEntityNotFound(_0x267965,null))[_0xa55c('0x22')](removeEntity(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x4f')]=function(_0x437ced,_0x20593d,_0x2ccfb1){if(_0x437ced[_0xa55c('0x4e')]['id']){delete _0x437ced['body']['id'];}return db[_0xa55c('0x2a')]['find']({'where':{'id':_0x437ced[_0xa55c('0x43')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x20593d,null))[_0xa55c('0x22')](function(_0x1e1c5b){if(_0x1e1c5b){_0x437ced[_0xa55c('0x4e')][_0xa55c('0x50')]=_0x1e1c5b['id'];return db[_0xa55c('0x2a')]['create'](_0x437ced[_0xa55c('0x4e')]);}})[_0xa55c('0x22')](respondWithResult(_0x20593d,null))[_0xa55c('0x41')](handleError(_0x20593d,null));};exports[_0xa55c('0x51')]=function(_0x3fa00f,_0x5ba2b0,_0xa72718){var _0x3cd40d={};var _0x28bac4={};var _0x20e53c;var _0x3cbb63;return db['Interval'][_0xa55c('0x52')]({'where':{'id':_0x3fa00f[_0xa55c('0x43')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x5ba2b0,null))[_0xa55c('0x22')](function(_0x3ba56d){if(_0x3ba56d){_0x20e53c=_0x3ba56d;_0x28bac4['model']=_[_0xa55c('0x30')](db['Interval'][_0xa55c('0x44')]);_0x28bac4['query']=_[_0xa55c('0x30')](_0x3fa00f['query']);_0x28bac4[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x28bac4[_0xa55c('0x33')],_0x28bac4[_0xa55c('0x2f')]);_0x3cd40d[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x28bac4[_0xa55c('0x33')],qs[_0xa55c('0x35')](_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x3cd40d['attributes']=_0x3cd40d[_0xa55c('0x34')][_0xa55c('0x36')]?_0x3cd40d['attributes']:_0x28bac4[_0xa55c('0x33')];_0x3cd40d[_0xa55c('0x53')]=qs[_0xa55c('0x39')](_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x39')]);_0x3cd40d[_0xa55c('0x3d')]=qs[_0xa55c('0x31')](_[_0xa55c('0x3a')](_0x3fa00f['query'],_0x28bac4[_0xa55c('0x31')]));if(_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x3b')]){_0x3cd40d[_0xa55c('0x3d')]=_[_0xa55c('0x3c')](_0x3cd40d[_0xa55c('0x3d')],{'$or':_[_0xa55c('0x2e')](_0x3cd40d[_0xa55c('0x34')],function(_0x25d5a1){var _0x4a08ca={};_0x4a08ca[_0x25d5a1]={'$like':'%'+_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x3b')]+'%'};return _0x4a08ca;})});}_0x3cd40d=_[_0xa55c('0x3c')]({},_0x3cd40d,_0x3fa00f[_0xa55c('0x54')]);return _0x20e53c[_0xa55c('0x51')](_0x3cd40d);}})[_0xa55c('0x22')](function(_0x3ea755){if(_0x3ea755){_0x3cbb63=_0x3ea755[_0xa55c('0x36')];if(!_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x37')](_0xa55c('0x38'))){_0x3cd40d['limit']=qs[_0xa55c('0x1c')](_0x3fa00f['query'][_0xa55c('0x1c')]);_0x3cd40d[_0xa55c('0x1b')]=qs[_0xa55c('0x1b')](_0x3fa00f['query']['offset']);}return _0x20e53c[_0xa55c('0x51')](_0x3cd40d);}})[_0xa55c('0x22')](function(_0x23c84c){if(_0x23c84c){return _0x23c84c?{'count':_0x3cbb63,'rows':_0x23c84c}:null;}})[_0xa55c('0x22')](respondWithResult(_0x5ba2b0,null))['catch'](handleError(_0x5ba2b0,null));};exports[_0xa55c('0x55')]=function(_0xd02251,_0x8ea1c6,_0x3a9910){return db[_0xa55c('0x2a')]['findOne']({'where':{'id':_0xd02251['params']['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x8ea1c6,null))[_0xa55c('0x22')](function(_0x3f9d0a){if(_0x3f9d0a){return db[_0xa55c('0x56')][_0xa55c('0x57')](function(_0x4b2032){return db[_0xa55c('0x2a')][_0xa55c('0x23')]({'where':{'IntervalId':_0xd02251['params']['id']},'transaction':_0x4b2032})[_0xa55c('0x22')](function(_0x1ab28b){var _0xa340fb=_['map'](_0xd02251[_0xa55c('0x4e')],function(_0x3ff604){delete _0x3ff604['id'];_0x3ff604[_0xa55c('0x50')]=_0xd02251[_0xa55c('0x43')]['id'];return _0x3ff604;});return db[_0xa55c('0x2a')]['bulkCreate'](_0xa340fb,{'transaction':_0x4b2032});});})[_0xa55c('0x22')](function(){return db[_0xa55c('0x2a')]['findAll']({'where':{'IntervalId':_0xd02251['params']['id']}});});}})[_0xa55c('0x22')](respondWithResult(_0x8ea1c6,null))['catch'](handleError(_0x8ea1c6,null));}; \ No newline at end of file +var _0x3e74=['error','name','send','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','catch','create','user','Intervals','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','hasOwnProperty','nolimit','sequelize','transaction','bulkCreate','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../components/extensions/rewrite','end','json','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus'];(function(_0x1d3d00,_0x56a53c){var _0x57c566=function(_0x23417f){while(--_0x23417f){_0x1d3d00['push'](_0x1d3d00['shift']());}};_0x57c566(++_0x56a53c);}(_0x3e74,0x175));var _0x43e7=function(_0x2540be,_0x18d68c){_0x2540be=_0x2540be-0x0;var _0x143634=_0x3e74[_0x2540be];return _0x143634;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var db=require('../../mysqldb')['db'];var extensions=require(_0x43e7('0x14'));function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=_0x328445[_0x43e7('0x17')],_0x5c4eaa=_0x203378['offset'],_0xdf16c=_0x203378['offset']+_0x203378[_0x43e7('0x18')],_0x264575;if(_0xdf16c>=_0x4de324){_0xdf16c=_0x4de324;_0x264575=0xc8;}else{_0x264575=0xce;}_0x14c146[_0x43e7('0x19')](_0x264575);return _0x14c146[_0x43e7('0x1a')](_0x43e7('0x1b'),_0x5c4eaa+'-'+_0xdf16c+'/'+_0x4de324)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x1f24fb){return function(_0x619236){try{jsonpatch[_0x43e7('0x1c')](_0x619236,_0x1f24fb,!![]);}catch(_0x2377a3){return BPromise[_0x43e7('0x1d')](_0x2377a3);}return _0x619236[_0x43e7('0x1e')]();};}function saveUpdates(_0x177ee1,_0x4b5d64){return function(_0xef1a5a){if(_0xef1a5a){return _0xef1a5a[_0x43e7('0x1f')](_0x177ee1)['then'](function(_0x2898b5){return _0x2898b5;});}return null;};}function removeEntity(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')]()[_0x43e7('0x21')](function(){var _0x54a9e7=_0x28aacc[_0x43e7('0x22')]({'plain':!![]});var _0x4eea52='Intervals';return db[_0x43e7('0x23')][_0x43e7('0x20')]({'where':{'type':_0x4eea52,'resourceId':_0x54a9e7['id']}})['then'](function(){return _0x28aacc;});})[_0x43e7('0x21')](function(){_0x3e281e['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x5c5e67,_0x1af208){return function(_0x1b5f50){if(!_0x1b5f50){_0x5c5e67[_0x43e7('0x24')](0x194);}return _0x1b5f50;};}function handleError(_0x405f85,_0x51f4d7){_0x51f4d7=_0x51f4d7||0x1f4;return function(_0x52b7b3){logger[_0x43e7('0x25')](_0x52b7b3['stack']);if(_0x52b7b3[_0x43e7('0x26')]){delete _0x52b7b3[_0x43e7('0x26')];}_0x405f85[_0x43e7('0x19')](_0x51f4d7)[_0x43e7('0x27')](_0x52b7b3);};}exports['index']=function(_0x33a1a5,_0x4690a6){var _0x45b675={},_0x50f9f5={},_0x442c3b={'count':0x0,'rows':[]};var _0x84dd4d=_[_0x43e7('0x28')](db[_0x43e7('0x29')][_0x43e7('0x2a')],function(_0x35dbcd){return{'name':_0x35dbcd[_0x43e7('0x2b')],'type':_0x35dbcd[_0x43e7('0x2c')][_0x43e7('0x2d')]};});_0x50f9f5[_0x43e7('0x2e')]=_['map'](_0x84dd4d,_0x43e7('0x26'));_0x50f9f5[_0x43e7('0x2f')]=_[_0x43e7('0x30')](_0x33a1a5[_0x43e7('0x2f')]);_0x50f9f5[_0x43e7('0x31')]=_['intersection'](_0x50f9f5[_0x43e7('0x2e')],_0x50f9f5[_0x43e7('0x2f')]);_0x45b675[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x50f9f5['model'],qs['fields'](_0x33a1a5['query'][_0x43e7('0x34')]));_0x45b675[_0x43e7('0x32')]=_0x45b675[_0x43e7('0x32')][_0x43e7('0x35')]?_0x45b675[_0x43e7('0x32')]:_0x50f9f5[_0x43e7('0x2e')];if(!_0x33a1a5['query']['hasOwnProperty']('nolimit')){_0x45b675['limit']=qs['limit'](_0x33a1a5['query']['limit']);_0x45b675[_0x43e7('0x36')]=qs['offset'](_0x33a1a5[_0x43e7('0x2f')][_0x43e7('0x36')]);}_0x45b675[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0x33a1a5[_0x43e7('0x2f')][_0x43e7('0x38')]);_0x45b675[_0x43e7('0x39')]=qs['filters'](_['pick'](_0x33a1a5['query'],_0x50f9f5[_0x43e7('0x31')]));if(_0x33a1a5[_0x43e7('0x2f')][_0x43e7('0x3a')]){_0x45b675[_0x43e7('0x39')]=_[_0x43e7('0x3b')](_0x45b675[_0x43e7('0x39')],{'$or':_[_0x43e7('0x28')](_0x84dd4d,function(_0x2ffd43){if(_0x2ffd43['type']!==_0x43e7('0x3c')){var _0x2b0ffe={};_0x2b0ffe[_0x2ffd43['name']]={'$like':'%'+_0x33a1a5[_0x43e7('0x2f')]['filter']+'%'};return _0x2b0ffe;}})});}_0x45b675=_[_0x43e7('0x3b')]({},_0x45b675,_0x33a1a5[_0x43e7('0x3d')]);var _0x1c6f45={'where':_0x45b675[_0x43e7('0x39')]};return db[_0x43e7('0x29')][_0x43e7('0x17')](_0x1c6f45)['then'](function(_0x574a93){_0x442c3b[_0x43e7('0x17')]=_0x574a93;if(_0x33a1a5[_0x43e7('0x2f')][_0x43e7('0x3e')]){_0x45b675[_0x43e7('0x3f')]=[{'all':!![]}];}return db[_0x43e7('0x29')]['findAll'](_0x45b675);})[_0x43e7('0x21')](function(_0x4227c4){_0x442c3b['rows']=_0x4227c4;return _0x442c3b;})[_0x43e7('0x21')](respondWithFilteredResult(_0x4690a6,_0x45b675))['catch'](handleError(_0x4690a6,null));};exports[_0x43e7('0x40')]=function(_0x504101,_0x3d81ae){var _0x3b4235={'raw':!![],'where':{'id':_0x504101[_0x43e7('0x41')]['id']}},_0x3a5807={};_0x3a5807['model']=_['keys'](db[_0x43e7('0x29')][_0x43e7('0x2a')]);_0x3a5807[_0x43e7('0x2f')]=_[_0x43e7('0x30')](_0x504101['query']);_0x3a5807['filters']=_['intersection'](_0x3a5807[_0x43e7('0x2e')],_0x3a5807['query']);_0x3b4235[_0x43e7('0x32')]=_['intersection'](_0x3a5807['model'],qs[_0x43e7('0x34')](_0x504101['query'][_0x43e7('0x34')]));_0x3b4235[_0x43e7('0x32')]=_0x3b4235[_0x43e7('0x32')][_0x43e7('0x35')]?_0x3b4235['attributes']:_0x3a5807[_0x43e7('0x2e')];if(_0x504101[_0x43e7('0x2f')][_0x43e7('0x3e')]){_0x3b4235[_0x43e7('0x3f')]=[{'all':!![]}];}_0x3b4235=_[_0x43e7('0x3b')]({},_0x3b4235,_0x504101[_0x43e7('0x3d')]);return db['Interval']['find'](_0x3b4235)[_0x43e7('0x21')](handleEntityNotFound(_0x3d81ae,null))[_0x43e7('0x21')](respondWithResult(_0x3d81ae,null))[_0x43e7('0x42')](handleError(_0x3d81ae,null));};exports['create']=function(_0x5c1c18,_0x56489b){return db[_0x43e7('0x29')][_0x43e7('0x43')](_0x5c1c18['body'],{})[_0x43e7('0x21')](function(_0x47686e){var _0x3c96fe=_0x5c1c18['user']['get']({'plain':!![]});if(!_0x3c96fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c96fe['role']===_0x43e7('0x44')){var _0xe955fc=_0x47686e['get']({'plain':!![]});var _0x23e7cb=_0x43e7('0x45');return db[_0x43e7('0x46')][_0x43e7('0x47')]({'where':{'name':_0x23e7cb,'userProfileId':_0x3c96fe['userProfileId']},'raw':!![]})[_0x43e7('0x21')](function(_0x483f20){if(_0x483f20&&_0x483f20['autoAssociation']===0x0){return db[_0x43e7('0x23')][_0x43e7('0x43')]({'name':_0xe955fc[_0x43e7('0x26')],'resourceId':_0xe955fc['id'],'type':_0x483f20[_0x43e7('0x26')],'sectionId':_0x483f20['id']},{})[_0x43e7('0x21')](function(){return _0x47686e;});}else{return _0x47686e;}})[_0x43e7('0x42')](function(_0x1cd87c){logger[_0x43e7('0x25')](_0x43e7('0x48'),_0x1cd87c);throw _0x1cd87c;});}return _0x47686e;})[_0x43e7('0x21')](respondWithResult(_0x56489b,0xc9))['catch'](handleError(_0x56489b,null));};exports[_0x43e7('0x1f')]=function(_0x46c910,_0x499c03){if(_0x46c910[_0x43e7('0x49')]['id']){delete _0x46c910['body']['id'];}return db[_0x43e7('0x29')][_0x43e7('0x47')]({'where':{'id':_0x46c910[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x499c03,null))[_0x43e7('0x21')](saveUpdates(_0x46c910['body'],null))['then'](respondWithResult(_0x499c03,null))[_0x43e7('0x42')](handleError(_0x499c03,null));};exports[_0x43e7('0x20')]=function(_0x399942,_0x29c53d){return db[_0x43e7('0x29')][_0x43e7('0x47')]({'where':{'id':_0x399942[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x29c53d,null))[_0x43e7('0x21')](removeEntity(_0x29c53d,null))[_0x43e7('0x42')](handleError(_0x29c53d,null));};exports[_0x43e7('0x4a')]=function(_0x4ace49,_0x1ec35a,_0x2da2f3){if(_0x4ace49['body']['id']){delete _0x4ace49[_0x43e7('0x49')]['id'];}return db[_0x43e7('0x29')][_0x43e7('0x47')]({'where':{'id':_0x4ace49['params']['id']}})['then'](handleEntityNotFound(_0x1ec35a,null))[_0x43e7('0x21')](function(_0x3d9a29){if(_0x3d9a29){_0x4ace49['body'][_0x43e7('0x4b')]=_0x3d9a29['id'];return db['Interval']['create'](_0x4ace49[_0x43e7('0x49')]);}})[_0x43e7('0x21')](respondWithResult(_0x1ec35a,null))[_0x43e7('0x42')](handleError(_0x1ec35a,null));};exports[_0x43e7('0x4c')]=function(_0x68697,_0x4dfdb0,_0xc3976){var _0xdb9fbe={};var _0x4d89bd={};var _0x20283b;var _0x1267c5;return db[_0x43e7('0x29')]['findOne']({'where':{'id':_0x68697['params']['id']}})['then'](handleEntityNotFound(_0x4dfdb0,null))[_0x43e7('0x21')](function(_0x4058ce){if(_0x4058ce){_0x20283b=_0x4058ce;_0x4d89bd[_0x43e7('0x2e')]=_[_0x43e7('0x30')](db['Interval']['rawAttributes']);_0x4d89bd[_0x43e7('0x2f')]=_[_0x43e7('0x30')](_0x68697[_0x43e7('0x2f')]);_0x4d89bd[_0x43e7('0x31')]=_['intersection'](_0x4d89bd[_0x43e7('0x2e')],_0x4d89bd[_0x43e7('0x2f')]);_0xdb9fbe[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x4d89bd[_0x43e7('0x2e')],qs[_0x43e7('0x34')](_0x68697[_0x43e7('0x2f')][_0x43e7('0x34')]));_0xdb9fbe[_0x43e7('0x32')]=_0xdb9fbe[_0x43e7('0x32')][_0x43e7('0x35')]?_0xdb9fbe['attributes']:_0x4d89bd['model'];_0xdb9fbe[_0x43e7('0x37')]=qs['sort'](_0x68697['query']['sort']);_0xdb9fbe[_0x43e7('0x39')]=qs[_0x43e7('0x31')](_['pick'](_0x68697[_0x43e7('0x2f')],_0x4d89bd[_0x43e7('0x31')]));if(_0x68697[_0x43e7('0x2f')]['filter']){_0xdb9fbe[_0x43e7('0x39')]=_[_0x43e7('0x3b')](_0xdb9fbe[_0x43e7('0x39')],{'$or':_[_0x43e7('0x28')](_0xdb9fbe[_0x43e7('0x32')],function(_0x472a19){var _0x1e02fa={};_0x1e02fa[_0x472a19]={'$like':'%'+_0x68697['query'][_0x43e7('0x3a')]+'%'};return _0x1e02fa;})});}_0xdb9fbe=_[_0x43e7('0x3b')]({},_0xdb9fbe,_0x68697[_0x43e7('0x3d')]);return _0x20283b['getIntervals'](_0xdb9fbe);}})['then'](function(_0x30377a){if(_0x30377a){_0x1267c5=_0x30377a['length'];if(!_0x68697['query'][_0x43e7('0x4d')](_0x43e7('0x4e'))){_0xdb9fbe['limit']=qs[_0x43e7('0x18')](_0x68697[_0x43e7('0x2f')][_0x43e7('0x18')]);_0xdb9fbe[_0x43e7('0x36')]=qs[_0x43e7('0x36')](_0x68697[_0x43e7('0x2f')][_0x43e7('0x36')]);}return _0x20283b['getIntervals'](_0xdb9fbe);}})[_0x43e7('0x21')](function(_0x1bb7ad){if(_0x1bb7ad){return _0x1bb7ad?{'count':_0x1267c5,'rows':_0x1bb7ad}:null;}})['then'](respondWithResult(_0x4dfdb0,null))[_0x43e7('0x42')](handleError(_0x4dfdb0,null));};exports['addIntervals']=function(_0x26ee52,_0x248936,_0x37301b){return db[_0x43e7('0x29')]['findOne']({'where':{'id':_0x26ee52[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x248936,null))[_0x43e7('0x21')](function(_0x556001){if(_0x556001){return db[_0x43e7('0x4f')][_0x43e7('0x50')](function(_0x219dc6){return db[_0x43e7('0x29')][_0x43e7('0x20')]({'where':{'IntervalId':_0x26ee52['params']['id']},'transaction':_0x219dc6})[_0x43e7('0x21')](function(_0x1afa94){var _0x35d133=_[_0x43e7('0x28')](_0x26ee52[_0x43e7('0x49')],function(_0x8122f4){delete _0x8122f4['id'];_0x8122f4[_0x43e7('0x4b')]=_0x26ee52['params']['id'];return _0x8122f4;});return db['Interval'][_0x43e7('0x51')](_0x35d133,{'transaction':_0x219dc6});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x26ee52[_0x43e7('0x41')]['id']}});});}})[_0x43e7('0x21')](respondWithResult(_0x248936,null))[_0x43e7('0x42')](handleError(_0x248936,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index c87a881..a8ed7b9 100644 --- a/server/api/interval/interval.model.js +++ b/server/api/interval/interval.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51c4=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','util'];(function(_0x5b4a72,_0x12652b){var _0x431f6c=function(_0x514782){while(--_0x514782){_0x5b4a72['push'](_0x5b4a72['shift']());}};_0x431f6c(++_0x12652b);}(_0x51c4,0x192));var _0x451c=function(_0x331018,_0x63f1c5){_0x331018=_0x331018-0x0;var _0x42439c=_0x51c4[_0x331018];return _0x42439c;};'use strict';var _=require('lodash');var util=require(_0x451c('0x0'));var logger=require(_0x451c('0x1'))(_0x451c('0x2'));var moment=require('moment');var BPromise=require(_0x451c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x451c('0x4'));var rimraf=require(_0x451c('0x5'));var config=require(_0x451c('0x6'));var attributes=require(_0x451c('0x7'));var extensions=require(_0x451c('0x8'));module[_0x451c('0x9')]=function(_0x211b7e,_0x3ba692){return _0x211b7e['define'](_0x451c('0xa'),attributes,{'tableName':_0x451c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xdb4846,_0x550fba){extensions[_0x451c('0xc')](_0x211b7e,_0xdb4846);},'afterBulkCreate':function(_0x5f0588,_0x5de5a1,_0x15643){_0x15643();extensions['rewrite'](_0x211b7e,_0x5f0588[0x0]);},'afterUpdate':function(_0x3322d5,_0x4c1c87){extensions[_0x451c('0xc')](_0x211b7e,_0x3322d5);},'afterDestroy':function(_0x21151f,_0x152781){extensions[_0x451c('0xc')](_0x211b7e,_0x21151f);}}});}; \ No newline at end of file +var _0x85cf=['../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x85cf,0x76));var _0xf85c=function(_0x41d67e,_0x336a28){_0x41d67e=_0x41d67e-0x0;var _0x100cb2=_0x85cf[_0x41d67e];return _0x100cb2;};'use strict';var _=require('lodash');var util=require(_0xf85c('0x0'));var logger=require(_0xf85c('0x1'))(_0xf85c('0x2'));var moment=require(_0xf85c('0x3'));var BPromise=require(_0xf85c('0x4'));var rp=require(_0xf85c('0x5'));var fs=require('fs');var path=require(_0xf85c('0x6'));var rimraf=require(_0xf85c('0x7'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0xf85c('0x8'));module[_0xf85c('0x9')]=function(_0x51ac85,_0x386a60){return _0x51ac85[_0xf85c('0xa')](_0xf85c('0xb'),attributes,{'tableName':_0xf85c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1857d9,_0x55bd07){extensions['rewrite'](_0x51ac85,_0x1857d9);},'afterBulkCreate':function(_0x25aa6e,_0x2de6b4,_0x487736){_0x487736();extensions['rewrite'](_0x51ac85,_0x25aa6e[0x0]);},'afterUpdate':function(_0x8e918b,_0x4ae483){extensions[_0xf85c('0xd')](_0x51ac85,_0x8e918b);},'afterDestroy':function(_0x7e65bc,_0x65739c){extensions['rewrite'](_0x51ac85,_0x7e65bc);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 4a5882f..fa6f54d 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x584c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','Interval,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetInterval','Interval','options','attributes','map','include','model','then','ShowInterval','find','raw','where','lodash','moment'];(function(_0x3d5e49,_0x395791){var _0xf909a8=function(_0x2d45d0){while(--_0x2d45d0){_0x3d5e49['push'](_0x3d5e49['shift']());}};_0xf909a8(++_0x395791);}(_0x584c,0xca));var _0xc584=function(_0x5cd57d,_0x3e5b81){_0x5cd57d=_0x5cd57d-0x0;var _0x16d3fe=_0x584c[_0x5cd57d];return _0x16d3fe;};'use strict';var _=require(_0xc584('0x0'));var util=require('util');var moment=require(_0xc584('0x1'));var BPromise=require(_0xc584('0x2'));var rs=require(_0xc584('0x3'));var fs=require('fs');var Redis=require(_0xc584('0x4'));var db=require(_0xc584('0x5'))['db'];var utils=require(_0xc584('0x6'));var logger=require(_0xc584('0x7'))(_0xc584('0x8'));var config=require(_0xc584('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc584('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c674b,_0x16d589,_0x487772){return new BPromise(function(_0x297c80,_0x2b8353){return client[_0xc584('0xb')](_0x3c674b,_0x487772)['then'](function(_0x153ff7){logger['info'](_0xc584('0xc'),_0x16d589,'request\x20sent');logger[_0xc584('0xd')]('Interval,\x20%s,\x20%s,\x20%s',_0x16d589,_0xc584('0xe'),JSON[_0xc584('0xf')](_0x153ff7));if(_0x153ff7[_0xc584('0x10')]){if(_0x153ff7[_0xc584('0x10')][_0xc584('0x11')]===0x1f4){logger[_0xc584('0x10')](_0xc584('0xc'),_0x16d589,_0x153ff7[_0xc584('0x10')][_0xc584('0x12')]);return _0x2b8353(_0x153ff7['error'][_0xc584('0x12')]);}logger[_0xc584('0x10')](_0xc584('0xc'),_0x16d589,_0x153ff7[_0xc584('0x10')][_0xc584('0x12')]);return _0x297c80(_0x153ff7['error'][_0xc584('0x12')]);}else{logger[_0xc584('0x13')](_0xc584('0xc'),_0x16d589,'request\x20sent');_0x297c80(_0x153ff7[_0xc584('0x14')][_0xc584('0x12')]);}})[_0xc584('0x15')](function(_0x498d42){logger[_0xc584('0x10')]('Interval,\x20%s,\x20%s',_0x16d589,_0x498d42);_0x2b8353(_0x498d42);});});}exports[_0xc584('0x16')]=function(_0x4d388a){var _0x3fefc4=this;return new Promise(function(_0x338c4d,_0x49deae){return db[_0xc584('0x17')]['findAll']({'raw':_0x4d388a[_0xc584('0x18')]?_0x4d388a[_0xc584('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d388a[_0xc584('0x18')]?_0x4d388a[_0xc584('0x18')]['where']||null:null,'attributes':_0x4d388a[_0xc584('0x18')]?_0x4d388a[_0xc584('0x18')][_0xc584('0x19')]||null:null,'limit':_0x4d388a[_0xc584('0x18')]?_0x4d388a[_0xc584('0x18')]['limit']||null:null,'include':_0x4d388a[_0xc584('0x18')]?_0x4d388a[_0xc584('0x18')]['include']?_[_0xc584('0x1a')](_0x4d388a[_0xc584('0x18')][_0xc584('0x1b')],function(_0x11e602){return{'model':db[_0x11e602[_0xc584('0x1c')]],'as':_0x11e602['as'],'attributes':_0x11e602[_0xc584('0x19')],'include':_0x11e602['include']?_[_0xc584('0x1a')](_0x11e602[_0xc584('0x1b')],function(_0x2b7410){return{'model':db[_0x2b7410[_0xc584('0x1c')]],'as':_0x2b7410['as'],'attributes':_0x2b7410[_0xc584('0x19')],'include':_0x2b7410[_0xc584('0x1b')]?_[_0xc584('0x1a')](_0x2b7410[_0xc584('0x1b')],function(_0x5e3592){return{'model':db[_0x5e3592[_0xc584('0x1c')]],'as':_0x5e3592['as'],'attributes':_0x5e3592['attributes']};}):[]};}):[]};}):[]:[]})[_0xc584('0x1d')](function(_0x2f89e3){logger[_0xc584('0x13')](_0xc584('0x16'),_0x4d388a);logger[_0xc584('0xd')](_0xc584('0x16'),_0x4d388a,JSON['stringify'](_0x2f89e3));_0x338c4d(_0x2f89e3);})[_0xc584('0x15')](function(_0x2aee62){logger[_0xc584('0x10')]('GetInterval',_0x2aee62[_0xc584('0x12')],_0x4d388a);_0x49deae(_0x3fefc4[_0xc584('0x10')](0x1f4,_0x2aee62[_0xc584('0x12')]));});});};exports[_0xc584('0x1e')]=function(_0x379216){var _0x5530cb=this;return new Promise(function(_0x4f186e,_0x54439b){return db[_0xc584('0x17')][_0xc584('0x1f')]({'raw':_0x379216['options']?_0x379216[_0xc584('0x18')][_0xc584('0x20')]===undefined?!![]:![]:!![],'where':_0x379216[_0xc584('0x18')]?_0x379216['options'][_0xc584('0x21')]||null:null,'attributes':_0x379216[_0xc584('0x18')]?_0x379216[_0xc584('0x18')][_0xc584('0x19')]||null:null,'include':_0x379216[_0xc584('0x18')]?_0x379216[_0xc584('0x18')][_0xc584('0x1b')]?_['map'](_0x379216['options']['include'],function(_0x5a6c4f){return{'model':db[_0x5a6c4f[_0xc584('0x1c')]],'as':_0x5a6c4f['as'],'attributes':_0x5a6c4f['attributes'],'include':_0x5a6c4f[_0xc584('0x1b')]?_[_0xc584('0x1a')](_0x5a6c4f['include'],function(_0x5b4fa5){return{'model':db[_0x5b4fa5[_0xc584('0x1c')]],'as':_0x5b4fa5['as'],'attributes':_0x5b4fa5['attributes'],'include':_0x5b4fa5[_0xc584('0x1b')]?_[_0xc584('0x1a')](_0x5b4fa5[_0xc584('0x1b')],function(_0x5df544){return{'model':db[_0x5df544[_0xc584('0x1c')]],'as':_0x5df544['as'],'attributes':_0x5df544[_0xc584('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc584('0x1d')](function(_0x4fb0c1){logger[_0xc584('0x13')](_0xc584('0x1e'),_0x379216);logger[_0xc584('0xd')](_0xc584('0x1e'),_0x379216,JSON[_0xc584('0xf')](_0x4fb0c1));_0x4f186e(_0x4fb0c1);})[_0xc584('0x15')](function(_0x4efc21){logger[_0xc584('0x10')]('ShowInterval',_0x4efc21['message'],_0x379216);_0x54439b(_0x5530cb['error'](0x1f4,_0x4efc21[_0xc584('0x12')]));});});}; \ No newline at end of file +var _0xbd3a=['result','catch','GetInterval','Interval','findAll','options','attributes','limit','include','map','model','raw','where','ShowInterval','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','error','code','Interval,\x20%s,\x20%s','message'];(function(_0x411871,_0x3f6641){var _0x2ab4fc=function(_0x5c6919){while(--_0x5c6919){_0x411871['push'](_0x411871['shift']());}};_0x2ab4fc(++_0x3f6641);}(_0xbd3a,0x158));var _0xabd3=function(_0x56ee7e,_0x31be7a){_0x56ee7e=_0x56ee7e-0x0;var _0x5a8d6a=_0xbd3a[_0x56ee7e];return _0x5a8d6a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xabd3('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabd3('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xabd3('0x2'));var logger=require(_0xabd3('0x3'))('rpc');var config=require(_0xabd3('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xabd3('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x335669,_0x1049f8,_0x28483d){return new BPromise(function(_0x28b6fe,_0x534b0c){return client[_0xabd3('0x6')](_0x335669,_0x28483d)[_0xabd3('0x7')](function(_0x5f00d4){logger[_0xabd3('0x8')]('Interval,\x20%s,\x20%s',_0x1049f8,_0xabd3('0x9'));logger[_0xabd3('0xa')]('Interval,\x20%s,\x20%s,\x20%s',_0x1049f8,_0xabd3('0x9'),JSON[_0xabd3('0xb')](_0x5f00d4));if(_0x5f00d4[_0xabd3('0xc')]){if(_0x5f00d4['error'][_0xabd3('0xd')]===0x1f4){logger[_0xabd3('0xc')](_0xabd3('0xe'),_0x1049f8,_0x5f00d4[_0xabd3('0xc')][_0xabd3('0xf')]);return _0x534b0c(_0x5f00d4[_0xabd3('0xc')][_0xabd3('0xf')]);}logger['error'](_0xabd3('0xe'),_0x1049f8,_0x5f00d4[_0xabd3('0xc')][_0xabd3('0xf')]);return _0x28b6fe(_0x5f00d4['error'][_0xabd3('0xf')]);}else{logger[_0xabd3('0x8')](_0xabd3('0xe'),_0x1049f8,'request\x20sent');_0x28b6fe(_0x5f00d4[_0xabd3('0x10')][_0xabd3('0xf')]);}})[_0xabd3('0x11')](function(_0x5a16ce){logger['error'](_0xabd3('0xe'),_0x1049f8,_0x5a16ce);_0x534b0c(_0x5a16ce);});});}exports[_0xabd3('0x12')]=function(_0x26ab2d){var _0x1c633e=this;return new Promise(function(_0xbbb363,_0x392be4){return db[_0xabd3('0x13')][_0xabd3('0x14')]({'raw':_0x26ab2d[_0xabd3('0x15')]?_0x26ab2d[_0xabd3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x26ab2d[_0xabd3('0x15')]?_0x26ab2d[_0xabd3('0x15')]['where']||null:null,'attributes':_0x26ab2d[_0xabd3('0x15')]?_0x26ab2d['options'][_0xabd3('0x16')]||null:null,'limit':_0x26ab2d[_0xabd3('0x15')]?_0x26ab2d['options'][_0xabd3('0x17')]||null:null,'include':_0x26ab2d['options']?_0x26ab2d[_0xabd3('0x15')][_0xabd3('0x18')]?_[_0xabd3('0x19')](_0x26ab2d['options'][_0xabd3('0x18')],function(_0x2733ef){return{'model':db[_0x2733ef['model']],'as':_0x2733ef['as'],'attributes':_0x2733ef['attributes'],'include':_0x2733ef[_0xabd3('0x18')]?_[_0xabd3('0x19')](_0x2733ef[_0xabd3('0x18')],function(_0x1a60de){return{'model':db[_0x1a60de[_0xabd3('0x1a')]],'as':_0x1a60de['as'],'attributes':_0x1a60de[_0xabd3('0x16')],'include':_0x1a60de[_0xabd3('0x18')]?_[_0xabd3('0x19')](_0x1a60de[_0xabd3('0x18')],function(_0x3262a1){return{'model':db[_0x3262a1['model']],'as':_0x3262a1['as'],'attributes':_0x3262a1['attributes']};}):[]};}):[]};}):[]:[]})[_0xabd3('0x7')](function(_0x4e8bea){logger[_0xabd3('0x8')](_0xabd3('0x12'),_0x26ab2d);logger['debug'](_0xabd3('0x12'),_0x26ab2d,JSON[_0xabd3('0xb')](_0x4e8bea));_0xbbb363(_0x4e8bea);})[_0xabd3('0x11')](function(_0x1f9e3b){logger['error'](_0xabd3('0x12'),_0x1f9e3b['message'],_0x26ab2d);_0x392be4(_0x1c633e[_0xabd3('0xc')](0x1f4,_0x1f9e3b[_0xabd3('0xf')]));});});};exports['ShowInterval']=function(_0xe98db7){var _0x3e4439=this;return new Promise(function(_0x7c8480,_0x25a3d4){return db[_0xabd3('0x13')]['find']({'raw':_0xe98db7[_0xabd3('0x15')]?_0xe98db7[_0xabd3('0x15')][_0xabd3('0x1b')]===undefined?!![]:![]:!![],'where':_0xe98db7[_0xabd3('0x15')]?_0xe98db7[_0xabd3('0x15')][_0xabd3('0x1c')]||null:null,'attributes':_0xe98db7['options']?_0xe98db7['options'][_0xabd3('0x16')]||null:null,'include':_0xe98db7[_0xabd3('0x15')]?_0xe98db7['options'][_0xabd3('0x18')]?_[_0xabd3('0x19')](_0xe98db7[_0xabd3('0x15')][_0xabd3('0x18')],function(_0x493320){return{'model':db[_0x493320[_0xabd3('0x1a')]],'as':_0x493320['as'],'attributes':_0x493320[_0xabd3('0x16')],'include':_0x493320[_0xabd3('0x18')]?_[_0xabd3('0x19')](_0x493320['include'],function(_0x3c681a){return{'model':db[_0x3c681a['model']],'as':_0x3c681a['as'],'attributes':_0x3c681a['attributes'],'include':_0x3c681a['include']?_[_0xabd3('0x19')](_0x3c681a[_0xabd3('0x18')],function(_0x2230d8){return{'model':db[_0x2230d8['model']],'as':_0x2230d8['as'],'attributes':_0x2230d8[_0xabd3('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31af37){logger[_0xabd3('0x8')]('ShowInterval',_0xe98db7);logger[_0xabd3('0xa')](_0xabd3('0x1d'),_0xe98db7,JSON[_0xabd3('0xb')](_0x31af37));_0x7c8480(_0x31af37);})[_0xabd3('0x11')](function(_0x265cc9){logger['error'](_0xabd3('0x1d'),_0x265cc9[_0xabd3('0xf')],_0xe98db7);_0x25a3d4(_0x3e4439[_0xabd3('0xc')](0x1f4,_0x265cc9[_0xabd3('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index e564dc8..e2dd9a8 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd710=['./jira.controller','post','isAuthenticated','send','express','Router'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xd710,0x124));var _0x0d71=function(_0x2d35fb,_0x4b2bf5){_0x2d35fb=_0x2d35fb-0x0;var _0x1b9fa9=_0xd710[_0x2d35fb];return _0x1b9fa9;};'use strict';var express=require(_0x0d71('0x0'));var router=express[_0x0d71('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0d71('0x2'));router[_0x0d71('0x3')]('/',auth[_0x0d71('0x4')](),controller[_0x0d71('0x5')]);module['exports']=router; \ No newline at end of file +var _0xb968=['./jira.controller','isAuthenticated','exports','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb968,0xe9));var _0x8b96=function(_0x2e316e,_0x23f028){_0x2e316e=_0x2e316e-0x0;var _0x56ac89=_0xb968[_0x2e316e];return _0x56ac89;};'use strict';var express=require(_0x8b96('0x0'));var router=express['Router']();var auth=require(_0x8b96('0x1'));var controller=require(_0x8b96('0x2'));router['post']('/',auth[_0x8b96('0x3')](),controller['send']);module[_0x8b96('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 050c9ad..615d8e7 100644 --- a/server/api/jira/jira.controller.js +++ b/server/api/jira/jira.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdde2=['application/json','Basic\x20','request','setEncoding','utf8','data','end','status','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','body','headers','socket','remoteAddress','connection','bluebird','https','../../config/logger','support','3eAmWpBVP0','MOTGUI','description','stringify','issuetype','customfield_11500','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','POST'];(function(_0x112929,_0x7da466){var _0x333c16=function(_0x762dc0){while(--_0x762dc0){_0x112929['push'](_0x112929['shift']());}};_0x333c16(++_0x7da466);}(_0xdde2,0xcb));var _0x2dde=function(_0x1c4383,_0x388b1a){_0x1c4383=_0x1c4383-0x0;var _0x50bcda=_0xdde2[_0x1c4383];return _0x50bcda;};'use strict';var BPromise=require(_0x2dde('0x0'));var https=require(_0x2dde('0x1'));var logger=require(_0x2dde('0x2'))('api');var USERNAME=_0x2dde('0x3');var PASSWORD=_0x2dde('0x4');function openIssue(_0x49c447,_0x3eacba){var _0x489fcd={'fields':{'project':{'key':_0x49c447['key']||_0x2dde('0x5')},'summary':(_0x49c447['summary']||'Report')+'\x20from\x20'+_0x49c447['ip'],'description':_0x49c447[_0x2dde('0x6')]||JSON[_0x2dde('0x7')](_0x49c447),'issuetype':{'name':_0x49c447[_0x2dde('0x8')]||'Bug'}}};_0x489fcd['fields'][_0x2dde('0x9')]=_0x49c447['email'];_0x489fcd[_0x2dde('0xa')]['customfield_11501']=_0x49c447['oldToken'];_0x489fcd[_0x2dde('0xa')][_0x2dde('0xb')]=_0x49c447[_0x2dde('0xc')];_0x489fcd[_0x2dde('0xa')][_0x2dde('0xd')]=_0x49c447[_0x2dde('0xe')];_0x489fcd['fields'][_0x2dde('0xf')]=_0x49c447[_0x2dde('0x10')];_0x489fcd['fields']['customfield_10102']=_0x49c447['ip'];var _0x4c9eb8={'host':_0x2dde('0x11'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x2dde('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x2dde('0x13'),'Authorization':_0x2dde('0x14')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x29adb7=JSON[_0x2dde('0x7')](_0x489fcd);var _0x5689ae=https[_0x2dde('0x15')](_0x4c9eb8,function(_0x3cc26f){_0x3cc26f[_0x2dde('0x16')](_0x2dde('0x17'));var _0x2bef10='';_0x3cc26f['on'](_0x2dde('0x18'),function(_0x315ec6){_0x2bef10+=_0x315ec6;});_0x3cc26f['on'](_0x2dde('0x19'),function(){if(_0x3eacba){return _0x3eacba[_0x2dde('0x1a')](_0x3cc26f['statusCode'])['json'](JSON[_0x2dde('0x1b')](_0x2bef10));}});});_0x5689ae['on'](_0x2dde('0x1c'),function(_0x1569d1){if(_0x3eacba){return _0x3eacba[_0x2dde('0x1a')](0x1f4)[_0x2dde('0x1d')]({'errors':[{'message':_0x2dde('0x1e'),'type':'api.jira'}]});}});_0x5689ae[_0x2dde('0x1f')](_0x29adb7);_0x5689ae['end']();}exports['openIssue']=openIssue;exports['send']=function(_0x1afb41,_0x3256d1){_0x1afb41[_0x2dde('0x20')]['ip']=_0x1afb41[_0x2dde('0x21')]['x-forwarded-for']||_0x1afb41['connection']['remoteAddress']||_0x1afb41[_0x2dde('0x22')][_0x2dde('0x23')]||_0x1afb41[_0x2dde('0x24')][_0x2dde('0x22')]['remoteAddress'];return openIssue(_0x1afb41[_0x2dde('0x20')],_0x3256d1);}; \ No newline at end of file +var _0x0c1d=['track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','setEncoding','data','status','statusCode','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','end','openIssue','body','headers','connection','remoteAddress','socket','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11503','name','customfield_11504','reason'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0c1d,0x68));var _0xd0c1=function(_0x125905,_0x4f166c){_0x125905=_0x125905-0x0;var _0x7a9cf=_0x0c1d[_0x125905];return _0x7a9cf;};'use strict';var BPromise=require('bluebird');var https=require(_0xd0c1('0x0'));var logger=require(_0xd0c1('0x1'))(_0xd0c1('0x2'));var USERNAME=_0xd0c1('0x3');var PASSWORD=_0xd0c1('0x4');function openIssue(_0x5862e1,_0x435ec0){var _0x4fe22a={'fields':{'project':{'key':_0x5862e1[_0xd0c1('0x5')]||_0xd0c1('0x6')},'summary':(_0x5862e1[_0xd0c1('0x7')]||_0xd0c1('0x8'))+_0xd0c1('0x9')+_0x5862e1['ip'],'description':_0x5862e1[_0xd0c1('0xa')]||JSON[_0xd0c1('0xb')](_0x5862e1),'issuetype':{'name':_0x5862e1[_0xd0c1('0xc')]||_0xd0c1('0xd')}}};_0x4fe22a[_0xd0c1('0xe')][_0xd0c1('0xf')]=_0x5862e1['email'];_0x4fe22a[_0xd0c1('0xe')][_0xd0c1('0x10')]=_0x5862e1[_0xd0c1('0x11')];_0x4fe22a[_0xd0c1('0xe')]['customfield_11502']=_0x5862e1['newToken'];_0x4fe22a[_0xd0c1('0xe')][_0xd0c1('0x12')]=_0x5862e1[_0xd0c1('0x13')];_0x4fe22a[_0xd0c1('0xe')][_0xd0c1('0x14')]=_0x5862e1[_0xd0c1('0x15')];_0x4fe22a['fields']['customfield_10102']=_0x5862e1['ip'];var _0x1fa960={'host':_0xd0c1('0x16'),'port':0x1bb,'path':_0xd0c1('0x17'),'method':_0xd0c1('0x18'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xd0c1('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xd0c1('0x1a')](_0xd0c1('0x1b'))}};var _0x4a9cbf=JSON[_0xd0c1('0xb')](_0x4fe22a);var _0x1cbdc8=https['request'](_0x1fa960,function(_0x16ddad){_0x16ddad[_0xd0c1('0x1c')]('utf8');var _0x27b644='';_0x16ddad['on'](_0xd0c1('0x1d'),function(_0x5cfe36){_0x27b644+=_0x5cfe36;});_0x16ddad['on']('end',function(){if(_0x435ec0){return _0x435ec0[_0xd0c1('0x1e')](_0x16ddad[_0xd0c1('0x1f')])['json'](JSON['parse'](_0x27b644));}});});_0x1cbdc8['on'](_0xd0c1('0x20'),function(_0x35f78b){if(_0x435ec0){return _0x435ec0['status'](0x1f4)['json']({'errors':[{'message':_0xd0c1('0x21'),'type':'api.jira'}]});}});_0x1cbdc8[_0xd0c1('0x22')](_0x4a9cbf);_0x1cbdc8[_0xd0c1('0x23')]();}exports[_0xd0c1('0x24')]=openIssue;exports['send']=function(_0x2312e9,_0x5b8290){_0x2312e9[_0xd0c1('0x25')]['ip']=_0x2312e9[_0xd0c1('0x26')]['x-forwarded-for']||_0x2312e9[_0xd0c1('0x27')][_0xd0c1('0x28')]||_0x2312e9[_0xd0c1('0x29')][_0xd0c1('0x28')]||_0x2312e9['connection'][_0xd0c1('0x29')]['remoteAddress'];return openIssue(_0x2312e9['body'],_0x5b8290);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index cbdf39e..0edc8be 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e80=['isAuthenticated','post','create','put','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','describe','/:id'];(function(_0x58bda9,_0x1d7931){var _0x9ba053=function(_0x5e4e77){while(--_0x5e4e77){_0x58bda9['push'](_0x58bda9['shift']());}};_0x9ba053(++_0x1d7931);}(_0x8e80,0x181));var _0x08e8=function(_0x5eff86,_0x2cdd22){_0x5eff86=_0x5eff86-0x0;var _0x4b3010=_0x8e80[_0x5eff86];return _0x4b3010;};'use strict';var multer=require(_0x08e8('0x0'));var util=require(_0x08e8('0x1'));var path=require(_0x08e8('0x2'));var timeout=require(_0x08e8('0x3'));var express=require(_0x08e8('0x4'));var router=express[_0x08e8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x08e8('0x6'));var config=require(_0x08e8('0x7'));var controller=require(_0x08e8('0x8'));router[_0x08e8('0x9')]('/',auth['isAuthenticated'](),controller[_0x08e8('0xa')]);router['get'](_0x08e8('0xb'),auth['isAuthenticated'](),controller[_0x08e8('0xc')]);router[_0x08e8('0x9')](_0x08e8('0xd'),auth[_0x08e8('0xe')](),controller['show']);router[_0x08e8('0xf')]('/',auth[_0x08e8('0xe')](),controller[_0x08e8('0x10')]);router[_0x08e8('0x11')]('/:id',auth[_0x08e8('0xe')](),controller['update']);router['delete']('/:id',auth[_0x08e8('0xe')](),controller['destroy']);module[_0x08e8('0x12')]=router; \ No newline at end of file +var _0xe565=['delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x34c55d,_0x45444c){var _0x598e11=function(_0x1aa289){while(--_0x1aa289){_0x34c55d['push'](_0x34c55d['shift']());}};_0x598e11(++_0x45444c);}(_0xe565,0x1c4));var _0x5e56=function(_0x37be88,_0x3ba401){_0x37be88=_0x37be88-0x0;var _0x3b4d66=_0xe565[_0x37be88];return _0x3b4d66;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e56('0x0'));var timeout=require(_0x5e56('0x1'));var express=require(_0x5e56('0x2'));var router=express[_0x5e56('0x3')]();var auth=require(_0x5e56('0x4'));var interaction=require(_0x5e56('0x5'));var config=require('../../config/environment');var controller=require(_0x5e56('0x6'));router[_0x5e56('0x7')]('/',auth[_0x5e56('0x8')](),controller['index']);router[_0x5e56('0x7')](_0x5e56('0x9'),auth[_0x5e56('0x8')](),controller[_0x5e56('0xa')]);router[_0x5e56('0x7')](_0x5e56('0xb'),auth['isAuthenticated'](),controller[_0x5e56('0xc')]);router['post']('/',auth[_0x5e56('0x8')](),controller[_0x5e56('0xd')]);router[_0x5e56('0xe')](_0x5e56('0xb'),auth[_0x5e56('0x8')](),controller[_0x5e56('0xf')]);router[_0x5e56('0x10')](_0x5e56('0xb'),auth[_0x5e56('0x8')](),controller[_0x5e56('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 3a5af6f..9184921 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc837=['exports','STRING','TEXT','sequelize'];(function(_0x327e02,_0x3d9b2d){var _0x5ed316=function(_0x44fe7b){while(--_0x44fe7b){_0x327e02['push'](_0x327e02['shift']());}};_0x5ed316(++_0x3d9b2d);}(_0xc837,0x17b));var _0x7c83=function(_0x137af2,_0x296423){_0x137af2=_0x137af2-0x0;var _0x58dc5e=_0xc837[_0x137af2];return _0x58dc5e;};'use strict';var Sequelize=require(_0x7c83('0x0'));module[_0x7c83('0x1')]={'question':{'type':Sequelize[_0x7c83('0x2')]},'answer':{'type':Sequelize[_0x7c83('0x3')]('long')},'membername':{'type':Sequelize[_0x7c83('0x2')]},'projectname':{'type':Sequelize[_0x7c83('0x2')]},'queue':{'type':Sequelize[_0x7c83('0x2')]},'uniqueid':{'type':Sequelize[_0x7c83('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x7c83('0x2')]}}; \ No newline at end of file +var _0x41e6=['long','sequelize','exports','STRING','TEXT'];(function(_0x2c8bb6,_0xed930d){var _0x360c48=function(_0x31553a){while(--_0x31553a){_0x2c8bb6['push'](_0x2c8bb6['shift']());}};_0x360c48(++_0xed930d);}(_0x41e6,0x92));var _0x641e=function(_0x302b5e,_0x564a8e){_0x302b5e=_0x302b5e-0x0;var _0x523ab7=_0x41e6[_0x302b5e];return _0x523ab7;};'use strict';var Sequelize=require(_0x641e('0x0'));module[_0x641e('0x1')]={'question':{'type':Sequelize[_0x641e('0x2')]},'answer':{'type':Sequelize[_0x641e('0x3')](_0x641e('0x4'))},'membername':{'type':Sequelize[_0x641e('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x641e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x641e('0x2')]},'calleridnum':{'type':Sequelize[_0x641e('0x2')]},'questionId':{'type':Sequelize[_0x641e('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 4a438f8..214dd8a 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5ee=['ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','fields','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv'];(function(_0x182aa3,_0x55cb6c){var _0x4bd366=function(_0x200578){while(--_0x200578){_0x182aa3['push'](_0x182aa3['shift']());}};_0x4bd366(++_0x55cb6c);}(_0xf5ee,0x1b3));var _0xef5e=function(_0x3c7616,_0x1ad775){_0x3c7616=_0x3c7616-0x0;var _0x290716=_0xf5ee[_0x3c7616];return _0x290716;};'use strict';var pdf=require(_0xef5e('0x0'));var emlformat=require(_0xef5e('0x1'));var rimraf=require(_0xef5e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef5e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xef5e('0x4'));var Mustache=require('mustache');var util=require(_0xef5e('0x5'));var path=require(_0xef5e('0x6'));var sox=require(_0xef5e('0x7'));var csv=require(_0xef5e('0x8'));var ejs=require(_0xef5e('0x9'));var fs=require('fs');var _=require(_0xef5e('0xa'));var squel=require('squel');var crypto=require(_0xef5e('0xb'));var jsforce=require(_0xef5e('0xc'));var deskjs=require(_0xef5e('0xd'));var toCsv=require(_0xef5e('0x8'));var querystring=require(_0xef5e('0xe'));var Papa=require(_0xef5e('0xf'));var Redis=require('ioredis');var authService=require(_0xef5e('0x10'));var qs=require(_0xef5e('0x11'));var as=require(_0xef5e('0x12'));var hardwareService=require(_0xef5e('0x13'));var logger=require('../../config/logger')(_0xef5e('0x14'));var utils=require(_0xef5e('0x15'));var config=require(_0xef5e('0x16'));var db=require(_0xef5e('0x17'))['db'];function respondWithStatusCode(_0x28e454,_0x1eaa33){_0x1eaa33=_0x1eaa33||0xcc;return function(_0x2cb704){if(_0x2cb704){return _0x28e454[_0xef5e('0x18')](_0x1eaa33);}return _0x28e454[_0xef5e('0x19')](_0x1eaa33)[_0xef5e('0x1a')]();};}function respondWithResult(_0x250a4d,_0x4afb93){_0x4afb93=_0x4afb93||0xc8;return function(_0x3b1749){if(_0x3b1749){return _0x250a4d[_0xef5e('0x19')](_0x4afb93)[_0xef5e('0x1b')](_0x3b1749);}};}function respondWithFilteredResult(_0x3221d8,_0x5632be){return function(_0x44472f){if(_0x44472f){var _0x1bc076=_0x44472f['count'],_0x22132f=_0x5632be[_0xef5e('0x1c')],_0x3f222a=_0x5632be[_0xef5e('0x1c')]+_0x5632be[_0xef5e('0x1d')],_0x452619;if(_0x3f222a>=_0x1bc076){_0x3f222a=_0x1bc076;_0x452619=0xc8;}else{_0x452619=0xce;}_0x3221d8['status'](_0x452619);return _0x3221d8['set']('Content-Range',_0x22132f+'-'+_0x3f222a+'/'+_0x1bc076)[_0xef5e('0x1b')](_0x44472f);}return null;};}function patchUpdates(_0x543441){return function(_0xb34a49){try{jsonpatch[_0xef5e('0x1e')](_0xb34a49,_0x543441,!![]);}catch(_0x47c652){return BPromise[_0xef5e('0x1f')](_0x47c652);}return _0xb34a49[_0xef5e('0x20')]();};}function saveUpdates(_0x5cf196,_0x59789f){return function(_0x27fab0){if(_0x27fab0){return _0x27fab0[_0xef5e('0x21')](_0x5cf196)[_0xef5e('0x22')](function(_0x1e21bc){return _0x1e21bc;});}return null;};}function removeEntity(_0x4e722f,_0x2f6c21){return function(_0x2d9a7b){if(_0x2d9a7b){return _0x2d9a7b[_0xef5e('0x23')]()[_0xef5e('0x22')](function(){_0x4e722f[_0xef5e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e11f0,_0x1c09fe){return function(_0x37af88){if(!_0x37af88){_0x5e11f0[_0xef5e('0x18')](0x194);}return _0x37af88;};}function handleError(_0x47371a,_0x38e90f){_0x38e90f=_0x38e90f||0x1f4;return function(_0x1d7154){logger['error'](_0x1d7154[_0xef5e('0x24')]);if(_0x1d7154[_0xef5e('0x25')]){delete _0x1d7154[_0xef5e('0x25')];}_0x47371a['status'](_0x38e90f)['send'](_0x1d7154);};}exports[_0xef5e('0x26')]=function(_0x1a49c3,_0x4a9823){var _0x1b3806={},_0x3869e5={},_0x516a76={'count':0x0,'rows':[]};var _0xed45f3=_[_0xef5e('0x27')](db[_0xef5e('0x28')][_0xef5e('0x29')],function(_0x553607){return{'name':_0x553607[_0xef5e('0x2a')],'type':_0x553607[_0xef5e('0x2b')][_0xef5e('0x2c')]};});_0x3869e5[_0xef5e('0x2d')]=_[_0xef5e('0x27')](_0xed45f3,_0xef5e('0x25'));_0x3869e5[_0xef5e('0x2e')]=_[_0xef5e('0x2f')](_0x1a49c3[_0xef5e('0x2e')]);_0x3869e5[_0xef5e('0x30')]=_[_0xef5e('0x31')](_0x3869e5[_0xef5e('0x2d')],_0x3869e5[_0xef5e('0x2e')]);_0x1b3806[_0xef5e('0x32')]=_['intersection'](_0x3869e5[_0xef5e('0x2d')],qs['fields'](_0x1a49c3[_0xef5e('0x2e')]['fields']));_0x1b3806[_0xef5e('0x32')]=_0x1b3806[_0xef5e('0x32')][_0xef5e('0x33')]?_0x1b3806[_0xef5e('0x32')]:_0x3869e5[_0xef5e('0x2d')];if(!_0x1a49c3[_0xef5e('0x2e')][_0xef5e('0x34')](_0xef5e('0x35'))){_0x1b3806[_0xef5e('0x1d')]=qs[_0xef5e('0x1d')](_0x1a49c3['query'][_0xef5e('0x1d')]);_0x1b3806[_0xef5e('0x1c')]=qs['offset'](_0x1a49c3[_0xef5e('0x2e')][_0xef5e('0x1c')]);}_0x1b3806[_0xef5e('0x36')]=qs['sort'](_0x1a49c3[_0xef5e('0x2e')][_0xef5e('0x37')]);_0x1b3806[_0xef5e('0x38')]=qs[_0xef5e('0x30')](_[_0xef5e('0x39')](_0x1a49c3[_0xef5e('0x2e')],_0x3869e5[_0xef5e('0x30')]));if(_0x1a49c3[_0xef5e('0x2e')][_0xef5e('0x3a')]){_0x1b3806['where']=_['merge'](_0x1b3806[_0xef5e('0x38')],{'$or':_[_0xef5e('0x27')](_0xed45f3,function(_0x55fc3d){if(_0x55fc3d[_0xef5e('0x2b')]!==_0xef5e('0x3b')){var _0x254419={};_0x254419[_0x55fc3d[_0xef5e('0x25')]]={'$like':'%'+_0x1a49c3['query']['filter']+'%'};return _0x254419;}})});}_0x1b3806=_[_0xef5e('0x3c')]({},_0x1b3806,_0x1a49c3[_0xef5e('0x3d')]);var _0x4aa49c={'where':_0x1b3806[_0xef5e('0x38')]};return db['JscriptyAnswerReport']['count'](_0x4aa49c)[_0xef5e('0x22')](function(_0x2b352e){_0x516a76[_0xef5e('0x3e')]=_0x2b352e;if(_0x1a49c3[_0xef5e('0x2e')][_0xef5e('0x3f')]){_0x1b3806[_0xef5e('0x40')]=[{'all':!![]}];}return db[_0xef5e('0x28')][_0xef5e('0x41')](_0x1b3806);})[_0xef5e('0x22')](function(_0x3f2e27){_0x516a76[_0xef5e('0x42')]=_0x3f2e27;return _0x516a76;})[_0xef5e('0x22')](respondWithFilteredResult(_0x4a9823,_0x1b3806))[_0xef5e('0x43')](handleError(_0x4a9823,null));};exports['show']=function(_0x1048e5,_0x408a82){var _0x535fb6={'raw':!![],'where':{'id':_0x1048e5[_0xef5e('0x44')]['id']}},_0x52fbe5={};_0x52fbe5[_0xef5e('0x2d')]=_[_0xef5e('0x2f')](db[_0xef5e('0x28')]['rawAttributes']);_0x52fbe5[_0xef5e('0x2e')]=_[_0xef5e('0x2f')](_0x1048e5['query']);_0x52fbe5[_0xef5e('0x30')]=_[_0xef5e('0x31')](_0x52fbe5[_0xef5e('0x2d')],_0x52fbe5['query']);_0x535fb6[_0xef5e('0x32')]=_[_0xef5e('0x31')](_0x52fbe5[_0xef5e('0x2d')],qs[_0xef5e('0x45')](_0x1048e5['query']['fields']));_0x535fb6[_0xef5e('0x32')]=_0x535fb6[_0xef5e('0x32')]['length']?_0x535fb6[_0xef5e('0x32')]:_0x52fbe5[_0xef5e('0x2d')];if(_0x1048e5[_0xef5e('0x2e')][_0xef5e('0x3f')]){_0x535fb6['include']=[{'all':!![]}];}_0x535fb6=_['merge']({},_0x535fb6,_0x1048e5[_0xef5e('0x3d')]);return db[_0xef5e('0x28')]['find'](_0x535fb6)['then'](handleEntityNotFound(_0x408a82,null))[_0xef5e('0x22')](respondWithResult(_0x408a82,null))[_0xef5e('0x43')](handleError(_0x408a82,null));};exports[_0xef5e('0x46')]=function(_0x2ad7f3,_0x2c4a8c){return db[_0xef5e('0x28')][_0xef5e('0x46')](_0x2ad7f3[_0xef5e('0x47')],{})[_0xef5e('0x22')](respondWithResult(_0x2c4a8c,0xc9))['catch'](handleError(_0x2c4a8c,null));};exports[_0xef5e('0x21')]=function(_0x22bb7c,_0x9c894d){if(_0x22bb7c[_0xef5e('0x47')]['id']){delete _0x22bb7c[_0xef5e('0x47')]['id'];}return db[_0xef5e('0x28')][_0xef5e('0x48')]({'where':{'id':_0x22bb7c[_0xef5e('0x44')]['id']}})[_0xef5e('0x22')](handleEntityNotFound(_0x9c894d,null))[_0xef5e('0x22')](saveUpdates(_0x22bb7c[_0xef5e('0x47')],null))[_0xef5e('0x22')](respondWithResult(_0x9c894d,null))[_0xef5e('0x43')](handleError(_0x9c894d,null));};exports[_0xef5e('0x23')]=function(_0x26b56b,_0xa2751e){return db[_0xef5e('0x28')][_0xef5e('0x48')]({'where':{'id':_0x26b56b[_0xef5e('0x44')]['id']}})[_0xef5e('0x22')](handleEntityNotFound(_0xa2751e,null))['then'](removeEntity(_0xa2751e,null))[_0xef5e('0x43')](handleError(_0xa2751e,null));};exports[_0xef5e('0x49')]=function(_0x55a460,_0x3d78f9){return db[_0xef5e('0x28')][_0xef5e('0x49')]()[_0xef5e('0x22')](respondWithResult(_0x3d78f9,null))[_0xef5e('0x43')](handleError(_0x3d78f9,null));}; \ No newline at end of file +var _0x3f18=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x2cd5ce,_0x5b039c){var _0x5f46cd=function(_0x585f65){while(--_0x585f65){_0x2cd5ce['push'](_0x2cd5ce['shift']());}};_0x5f46cd(++_0x5b039c);}(_0x3f18,0xc9));var _0x83f1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3f18[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x83f1('0x0'));var jsonpatch=require(_0x83f1('0x1'));var rp=require(_0x83f1('0x2'));var moment=require(_0x83f1('0x3'));var BPromise=require(_0x83f1('0x4'));var Mustache=require(_0x83f1('0x5'));var util=require(_0x83f1('0x6'));var path=require(_0x83f1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x83f1('0x8'));var fs=require('fs');var _=require(_0x83f1('0x9'));var squel=require('squel');var crypto=require(_0x83f1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x83f1('0xb'));var toCsv=require(_0x83f1('0xc'));var querystring=require(_0x83f1('0xd'));var Papa=require(_0x83f1('0xe'));var Redis=require(_0x83f1('0xf'));var authService=require(_0x83f1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x83f1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x83f1('0x12'))(_0x83f1('0x13'));var utils=require(_0x83f1('0x14'));var config=require(_0x83f1('0x15'));var db=require(_0x83f1('0x16'))['db'];function respondWithStatusCode(_0x5e7a35,_0x447d71){_0x447d71=_0x447d71||0xcc;return function(_0x4f9ebe){if(_0x4f9ebe){return _0x5e7a35[_0x83f1('0x17')](_0x447d71);}return _0x5e7a35['status'](_0x447d71)[_0x83f1('0x18')]();};}function respondWithResult(_0x42efc2,_0x519765){_0x519765=_0x519765||0xc8;return function(_0x140146){if(_0x140146){return _0x42efc2[_0x83f1('0x19')](_0x519765)[_0x83f1('0x1a')](_0x140146);}};}function respondWithFilteredResult(_0x45334c,_0x2479df){return function(_0x586598){if(_0x586598){var _0x5cc96a=_0x586598['count'],_0x36bca4=_0x2479df[_0x83f1('0x1b')],_0x2d008b=_0x2479df[_0x83f1('0x1b')]+_0x2479df['limit'],_0x54c4d6;if(_0x2d008b>=_0x5cc96a){_0x2d008b=_0x5cc96a;_0x54c4d6=0xc8;}else{_0x54c4d6=0xce;}_0x45334c[_0x83f1('0x19')](_0x54c4d6);return _0x45334c[_0x83f1('0x1c')](_0x83f1('0x1d'),_0x36bca4+'-'+_0x2d008b+'/'+_0x5cc96a)['json'](_0x586598);}return null;};}function patchUpdates(_0x295e13){return function(_0x30da92){try{jsonpatch[_0x83f1('0x1e')](_0x30da92,_0x295e13,!![]);}catch(_0x4c401d){return BPromise[_0x83f1('0x1f')](_0x4c401d);}return _0x30da92['save']();};}function saveUpdates(_0x141b19,_0x29bf82){return function(_0x15509b){if(_0x15509b){return _0x15509b[_0x83f1('0x20')](_0x141b19)[_0x83f1('0x21')](function(_0x58e0bb){return _0x58e0bb;});}return null;};}function removeEntity(_0x394a74,_0x369c06){return function(_0x1a538b){if(_0x1a538b){return _0x1a538b[_0x83f1('0x22')]()['then'](function(){_0x394a74['status'](0xcc)[_0x83f1('0x18')]();});}};}function handleEntityNotFound(_0xb36ad7,_0x30b87d){return function(_0x33626d){if(!_0x33626d){_0xb36ad7[_0x83f1('0x17')](0x194);}return _0x33626d;};}function handleError(_0x4fdd90,_0x495205){_0x495205=_0x495205||0x1f4;return function(_0x5b26b7){logger['error'](_0x5b26b7[_0x83f1('0x23')]);if(_0x5b26b7['name']){delete _0x5b26b7[_0x83f1('0x24')];}_0x4fdd90[_0x83f1('0x19')](_0x495205)[_0x83f1('0x25')](_0x5b26b7);};}exports['index']=function(_0x4f903c,_0x568a0f){var _0x402ae8={},_0x4a99a0={},_0x4cec8a={'count':0x0,'rows':[]};var _0x3f39eb=_[_0x83f1('0x26')](db[_0x83f1('0x27')][_0x83f1('0x28')],function(_0x35f2da){return{'name':_0x35f2da[_0x83f1('0x29')],'type':_0x35f2da[_0x83f1('0x2a')][_0x83f1('0x2b')]};});_0x4a99a0[_0x83f1('0x2c')]=_[_0x83f1('0x26')](_0x3f39eb,_0x83f1('0x24'));_0x4a99a0[_0x83f1('0x2d')]=_[_0x83f1('0x2e')](_0x4f903c['query']);_0x4a99a0[_0x83f1('0x2f')]=_['intersection'](_0x4a99a0[_0x83f1('0x2c')],_0x4a99a0['query']);_0x402ae8[_0x83f1('0x30')]=_[_0x83f1('0x31')](_0x4a99a0[_0x83f1('0x2c')],qs[_0x83f1('0x32')](_0x4f903c['query'][_0x83f1('0x32')]));_0x402ae8[_0x83f1('0x30')]=_0x402ae8[_0x83f1('0x30')]['length']?_0x402ae8[_0x83f1('0x30')]:_0x4a99a0[_0x83f1('0x2c')];if(!_0x4f903c[_0x83f1('0x2d')][_0x83f1('0x33')](_0x83f1('0x34'))){_0x402ae8[_0x83f1('0x35')]=qs[_0x83f1('0x35')](_0x4f903c[_0x83f1('0x2d')][_0x83f1('0x35')]);_0x402ae8[_0x83f1('0x1b')]=qs[_0x83f1('0x1b')](_0x4f903c[_0x83f1('0x2d')][_0x83f1('0x1b')]);}_0x402ae8[_0x83f1('0x36')]=qs[_0x83f1('0x37')](_0x4f903c[_0x83f1('0x2d')][_0x83f1('0x37')]);_0x402ae8[_0x83f1('0x38')]=qs[_0x83f1('0x2f')](_[_0x83f1('0x39')](_0x4f903c[_0x83f1('0x2d')],_0x4a99a0['filters']));if(_0x4f903c[_0x83f1('0x2d')][_0x83f1('0x3a')]){_0x402ae8[_0x83f1('0x38')]=_[_0x83f1('0x3b')](_0x402ae8[_0x83f1('0x38')],{'$or':_[_0x83f1('0x26')](_0x3f39eb,function(_0x332fdb){if(_0x332fdb[_0x83f1('0x2a')]!==_0x83f1('0x3c')){var _0x1433a5={};_0x1433a5[_0x332fdb[_0x83f1('0x24')]]={'$like':'%'+_0x4f903c[_0x83f1('0x2d')][_0x83f1('0x3a')]+'%'};return _0x1433a5;}})});}_0x402ae8=_[_0x83f1('0x3b')]({},_0x402ae8,_0x4f903c[_0x83f1('0x3d')]);var _0x36cc17={'where':_0x402ae8[_0x83f1('0x38')]};return db['JscriptyAnswerReport']['count'](_0x36cc17)[_0x83f1('0x21')](function(_0x11cc6c){_0x4cec8a[_0x83f1('0x3e')]=_0x11cc6c;if(_0x4f903c[_0x83f1('0x2d')][_0x83f1('0x3f')]){_0x402ae8[_0x83f1('0x40')]=[{'all':!![]}];}return db[_0x83f1('0x27')][_0x83f1('0x41')](_0x402ae8);})[_0x83f1('0x21')](function(_0x13a69f){_0x4cec8a['rows']=_0x13a69f;return _0x4cec8a;})[_0x83f1('0x21')](respondWithFilteredResult(_0x568a0f,_0x402ae8))[_0x83f1('0x42')](handleError(_0x568a0f,null));};exports[_0x83f1('0x43')]=function(_0x579ae7,_0x34364e){var _0x4e355a={'raw':!![],'where':{'id':_0x579ae7[_0x83f1('0x44')]['id']}},_0x33b4fa={};_0x33b4fa[_0x83f1('0x2c')]=_[_0x83f1('0x2e')](db['JscriptyAnswerReport'][_0x83f1('0x28')]);_0x33b4fa[_0x83f1('0x2d')]=_[_0x83f1('0x2e')](_0x579ae7['query']);_0x33b4fa['filters']=_[_0x83f1('0x31')](_0x33b4fa['model'],_0x33b4fa[_0x83f1('0x2d')]);_0x4e355a['attributes']=_[_0x83f1('0x31')](_0x33b4fa[_0x83f1('0x2c')],qs[_0x83f1('0x32')](_0x579ae7[_0x83f1('0x2d')][_0x83f1('0x32')]));_0x4e355a[_0x83f1('0x30')]=_0x4e355a[_0x83f1('0x30')]['length']?_0x4e355a['attributes']:_0x33b4fa[_0x83f1('0x2c')];if(_0x579ae7[_0x83f1('0x2d')][_0x83f1('0x3f')]){_0x4e355a[_0x83f1('0x40')]=[{'all':!![]}];}_0x4e355a=_['merge']({},_0x4e355a,_0x579ae7[_0x83f1('0x3d')]);return db[_0x83f1('0x27')][_0x83f1('0x45')](_0x4e355a)[_0x83f1('0x21')](handleEntityNotFound(_0x34364e,null))[_0x83f1('0x21')](respondWithResult(_0x34364e,null))[_0x83f1('0x42')](handleError(_0x34364e,null));};exports[_0x83f1('0x46')]=function(_0x49fa95,_0x4123fe){return db[_0x83f1('0x27')][_0x83f1('0x46')](_0x49fa95[_0x83f1('0x47')],{})[_0x83f1('0x21')](respondWithResult(_0x4123fe,0xc9))[_0x83f1('0x42')](handleError(_0x4123fe,null));};exports[_0x83f1('0x20')]=function(_0x30026d,_0x43c025){if(_0x30026d[_0x83f1('0x47')]['id']){delete _0x30026d[_0x83f1('0x47')]['id'];}return db[_0x83f1('0x27')]['find']({'where':{'id':_0x30026d[_0x83f1('0x44')]['id']}})[_0x83f1('0x21')](handleEntityNotFound(_0x43c025,null))[_0x83f1('0x21')](saveUpdates(_0x30026d[_0x83f1('0x47')],null))[_0x83f1('0x21')](respondWithResult(_0x43c025,null))['catch'](handleError(_0x43c025,null));};exports[_0x83f1('0x22')]=function(_0x5cf7ea,_0x3412f0){return db['JscriptyAnswerReport'][_0x83f1('0x45')]({'where':{'id':_0x5cf7ea[_0x83f1('0x44')]['id']}})[_0x83f1('0x21')](handleEntityNotFound(_0x3412f0,null))[_0x83f1('0x21')](removeEntity(_0x3412f0,null))[_0x83f1('0x42')](handleError(_0x3412f0,null));};exports['describe']=function(_0x1812bf,_0xda5909){return db[_0x83f1('0x27')][_0x83f1('0x48')]()['then'](respondWithResult(_0xda5909,null))[_0x83f1('0x42')](handleError(_0xda5909,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 80b6343..0f446ca 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59cb=['define','report_jscripty_answers','lodash','util','moment','bluebird','request-promise','rimraf','./jscriptyAnswerReport.attributes'];(function(_0x7143f8,_0x1047b3){var _0x4c26bf=function(_0x429aab){while(--_0x429aab){_0x7143f8['push'](_0x7143f8['shift']());}};_0x4c26bf(++_0x1047b3);}(_0x59cb,0x9b));var _0xb59c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x59cb[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb59c('0x0'));var util=require(_0xb59c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb59c('0x2'));var BPromise=require(_0xb59c('0x3'));var rp=require(_0xb59c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb59c('0x5'));var config=require('../../config/environment');var attributes=require(_0xb59c('0x6'));module['exports']=function(_0x1abcc1,_0x586ee1){return _0x1abcc1[_0xb59c('0x7')]('JscriptyAnswerReport',attributes,{'tableName':_0xb59c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x009d=['../../config/environment','./jscriptyAnswerReport.attributes','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x28fe2c,_0x51c669){var _0x29b188=function(_0x4ef630){while(--_0x4ef630){_0x28fe2c['push'](_0x28fe2c['shift']());}};_0x29b188(++_0x51c669);}(_0x009d,0x19b));var _0xd009=function(_0x3ad230,_0x2341d1){_0x3ad230=_0x3ad230-0x0;var _0x415fd7=_0x009d[_0x3ad230];return _0x415fd7;};'use strict';var _=require(_0xd009('0x0'));var util=require(_0xd009('0x1'));var logger=require(_0xd009('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd009('0x3'));var rp=require(_0xd009('0x4'));var fs=require('fs');var path=require(_0xd009('0x5'));var rimraf=require(_0xd009('0x6'));var config=require(_0xd009('0x7'));var attributes=require(_0xd009('0x8'));module['exports']=function(_0xdde129,_0x7357b6){return _0xdde129['define'](_0xd009('0x9'),attributes,{'tableName':_0xd009('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 8566150..dafe76a 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x690e=['request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x2fea3f,_0x143c24){var _0xe7b365=function(_0x4fb734){while(--_0x4fb734){_0x2fea3f['push'](_0x2fea3f['shift']());}};_0xe7b365(++_0x143c24);}(_0x690e,0x14e));var _0xe690=function(_0xe2ca8a,_0x2b6fdb){_0xe2ca8a=_0xe2ca8a-0x0;var _0x508dbc=_0x690e[_0xe2ca8a];return _0x508dbc;};'use strict';var _=require(_0xe690('0x0'));var util=require(_0xe690('0x1'));var moment=require(_0xe690('0x2'));var BPromise=require(_0xe690('0x3'));var rs=require(_0xe690('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe690('0x5'))['db'];var utils=require(_0xe690('0x6'));var logger=require('../../config/logger')(_0xe690('0x7'));var config=require(_0xe690('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe690('0x9')][_0xe690('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249e76,_0x6c9c6,_0x3c57c2){return new BPromise(function(_0x3feaaf,_0x272d62){return client[_0xe690('0xb')](_0x249e76,_0x3c57c2)[_0xe690('0xc')](function(_0xe60b6d){logger[_0xe690('0xd')](_0xe690('0xe'),_0x6c9c6,'request\x20sent');logger[_0xe690('0xf')](_0xe690('0x10'),_0x6c9c6,_0xe690('0x11'),JSON[_0xe690('0x12')](_0xe60b6d));if(_0xe60b6d['error']){if(_0xe60b6d[_0xe690('0x13')]['code']===0x1f4){logger[_0xe690('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x6c9c6,_0xe60b6d[_0xe690('0x13')][_0xe690('0x14')]);return _0x272d62(_0xe60b6d['error']['message']);}logger[_0xe690('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x6c9c6,_0xe60b6d[_0xe690('0x13')][_0xe690('0x14')]);return _0x3feaaf(_0xe60b6d['error'][_0xe690('0x14')]);}else{logger[_0xe690('0xd')](_0xe690('0xe'),_0x6c9c6,_0xe690('0x11'));_0x3feaaf(_0xe60b6d[_0xe690('0x15')][_0xe690('0x14')]);}})[_0xe690('0x16')](function(_0x400de8){logger[_0xe690('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x6c9c6,_0x400de8);_0x272d62(_0x400de8);});});} \ No newline at end of file +var _0xdd3c=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x351be4,_0x2d1332){var _0x192da5=function(_0x3e0e25){while(--_0x3e0e25){_0x351be4['push'](_0x351be4['shift']());}};_0x192da5(++_0x2d1332);}(_0xdd3c,0xd5));var _0xcdd3=function(_0x520f31,_0x4453a5){_0x520f31=_0x520f31-0x0;var _0x5c011e=_0xdd3c[_0x520f31];return _0x5c011e;};'use strict';var _=require('lodash');var util=require(_0xcdd3('0x0'));var moment=require(_0xcdd3('0x1'));var BPromise=require(_0xcdd3('0x2'));var rs=require(_0xcdd3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdd3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdd3('0x5'))(_0xcdd3('0x6'));var config=require(_0xcdd3('0x7'));var jayson=require(_0xcdd3('0x8'));var client=jayson[_0xcdd3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x348418,_0x285290,_0xab2a8c){return new BPromise(function(_0x25e6b3,_0x1a4c04){return client['request'](_0x348418,_0xab2a8c)[_0xcdd3('0xa')](function(_0x28ba8a){logger[_0xcdd3('0xb')](_0xcdd3('0xc'),_0x285290,_0xcdd3('0xd'));logger[_0xcdd3('0xe')](_0xcdd3('0xf'),_0x285290,'request\x20sent',JSON[_0xcdd3('0x10')](_0x28ba8a));if(_0x28ba8a[_0xcdd3('0x11')]){if(_0x28ba8a[_0xcdd3('0x11')]['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x285290,_0x28ba8a[_0xcdd3('0x11')]['message']);return _0x1a4c04(_0x28ba8a[_0xcdd3('0x11')]['message']);}logger[_0xcdd3('0x11')](_0xcdd3('0xc'),_0x285290,_0x28ba8a['error'][_0xcdd3('0x12')]);return _0x25e6b3(_0x28ba8a[_0xcdd3('0x11')]['message']);}else{logger[_0xcdd3('0xb')](_0xcdd3('0xc'),_0x285290,'request\x20sent');_0x25e6b3(_0x28ba8a[_0xcdd3('0x13')][_0xcdd3('0x12')]);}})[_0xcdd3('0x14')](function(_0x40b60a){logger[_0xcdd3('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x285290,_0x40b60a);_0x1a4c04(_0x40b60a);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9f02227..0063bac 100644 --- a/server/api/jscriptyProject/index.js +++ b/server/api/jscriptyProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5208=['/:id/summary','30s','getSummary','post','/:id/clone','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers'];(function(_0x5c94e4,_0x221243){var _0x1b17aa=function(_0x2e872e){while(--_0x2e872e){_0x5c94e4['push'](_0x5c94e4['shift']());}};_0x1b17aa(++_0x221243);}(_0x5208,0x1d5));var _0x8520=function(_0x4595c7,_0x1dfd25){_0x4595c7=_0x4595c7-0x0;var _0x506697=_0x5208[_0x4595c7];return _0x506697;};'use strict';var multer=require('multer');var util=require(_0x8520('0x0'));var path=require(_0x8520('0x1'));var timeout=require(_0x8520('0x2'));var express=require(_0x8520('0x3'));var router=express[_0x8520('0x4')]();var auth=require(_0x8520('0x5'));var interaction=require(_0x8520('0x6'));var config=require(_0x8520('0x7'));var controller=require('./jscriptyProject.controller');router[_0x8520('0x8')]('/',auth[_0x8520('0x9')](),controller[_0x8520('0xa')]);router[_0x8520('0x8')](_0x8520('0xb'),auth[_0x8520('0x9')](),controller[_0x8520('0xc')]);router['get'](_0x8520('0xd'),auth[_0x8520('0x9')](),controller[_0x8520('0xe')]);router[_0x8520('0x8')](_0x8520('0xf'),auth[_0x8520('0x9')](),controller[_0x8520('0x10')]);router[_0x8520('0x8')](_0x8520('0x11'),auth[_0x8520('0x9')](),timeout(_0x8520('0x12')),controller[_0x8520('0x13')]);router[_0x8520('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8520('0x14')](_0x8520('0x15'),auth[_0x8520('0x9')](),controller['clone']);router[_0x8520('0x16')](_0x8520('0xb'),auth[_0x8520('0x9')](),controller[_0x8520('0x17')]);router[_0x8520('0x18')](_0x8520('0xb'),auth[_0x8520('0x9')](),controller[_0x8520('0x19')]);module[_0x8520('0x1a')]=router; \ No newline at end of file +var _0x7342=['30s','post','create','/:id/clone','put','update','destroy','multer','express','Router','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary'];(function(_0x3fe498,_0x5ba491){var _0x484587=function(_0x255254){while(--_0x255254){_0x3fe498['push'](_0x3fe498['shift']());}};_0x484587(++_0x5ba491);}(_0x7342,0x157));var _0x2734=function(_0x2c35d2,_0x564324){_0x2c35d2=_0x2c35d2-0x0;var _0x546e46=_0x7342[_0x2c35d2];return _0x546e46;};'use strict';var multer=require(_0x2734('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2734('0x1'));var router=express[_0x2734('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x2734('0x3'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x2734('0x4')]('/',auth['isAuthenticated'](),controller[_0x2734('0x5')]);router[_0x2734('0x4')](_0x2734('0x6'),auth[_0x2734('0x7')](),controller[_0x2734('0x8')]);router[_0x2734('0x4')](_0x2734('0x9'),auth[_0x2734('0x7')](),controller[_0x2734('0xa')]);router[_0x2734('0x4')](_0x2734('0xb'),auth['isAuthenticated'](),controller[_0x2734('0xc')]);router['get'](_0x2734('0xd'),auth[_0x2734('0x7')](),timeout(_0x2734('0xe')),controller['getSummary']);router[_0x2734('0xf')]('/',auth['isAuthenticated'](),controller[_0x2734('0x10')]);router[_0x2734('0xf')](_0x2734('0x11'),auth[_0x2734('0x7')](),controller['clone']);router[_0x2734('0x12')]('/:id',auth[_0x2734('0x7')](),controller[_0x2734('0x13')]);router['delete'](_0x2734('0x6'),auth[_0x2734('0x7')](),controller[_0x2734('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 8498cf6..72c209a 100644 --- a/server/api/jscriptyProject/jscriptyProject.attributes.js +++ b/server/api/jscriptyProject/jscriptyProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8532=['description','BOOLEAN','sequelize','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x4cb272,_0x52c0e9){var _0x57b4aa=function(_0x1efefb){while(--_0x1efefb){_0x4cb272['push'](_0x4cb272['shift']());}};_0x57b4aa(++_0x52c0e9);}(_0x8532,0x1f1));var _0x2853=function(_0x367161,_0x30f55b){_0x367161=_0x367161-0x0;var _0x244b2a=_0x8532[_0x367161];return _0x244b2a;};'use strict';var Sequelize=require(_0x2853('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0x2853('0x1')],'unique':_0x2853('0x2')},'description':{'type':Sequelize[_0x2853('0x1')]},'formData':{'type':Sequelize[_0x2853('0x3')](_0x2853('0x4')),'set':function(_0x503f2a){if(_[_0x2853('0x5')](_0x503f2a)){this[_0x2853('0x6')](_0x2853('0x7'),JSON[_0x2853('0x8')](_0x503f2a));}else if(_[_0x2853('0x9')](_0x503f2a)){this[_0x2853('0x6')](_0x2853('0x7'),_0x503f2a);}else{this[_0x2853('0x6')](_0x2853('0x7'),util[_0x2853('0xa')](_0x2853('0xb'),this[_0x2853('0xc')](_0x2853('0x2'))||'',this[_0x2853('0xc')](_0x2853('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2853('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4d6e=['format','getDataValue','BOOLEAN','sequelize','lodash','util','STRING','name','long','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x2a829f,_0x1b0c15){var _0x5737c3=function(_0x2376f9){while(--_0x2376f9){_0x2a829f['push'](_0x2a829f['shift']());}};_0x5737c3(++_0x1b0c15);}(_0x4d6e,0xd5));var _0xe4d6=function(_0x20d81d,_0xe5667e){_0x20d81d=_0x20d81d-0x0;var _0x4242e8=_0x4d6e[_0x20d81d];return _0x4242e8;};'use strict';var Sequelize=require(_0xe4d6('0x0'));var _=require(_0xe4d6('0x1'));var util=require(_0xe4d6('0x2'));module['exports']={'name':{'type':Sequelize[_0xe4d6('0x3')],'unique':_0xe4d6('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xe4d6('0x5')),'set':function(_0x453443){if(_[_0xe4d6('0x6')](_0x453443)){this[_0xe4d6('0x7')](_0xe4d6('0x8'),JSON[_0xe4d6('0x9')](_0x453443));}else if(_[_0xe4d6('0xa')](_0x453443)){this[_0xe4d6('0x7')]('formData',_0x453443);}else{this['setDataValue'](_0xe4d6('0x8'),util[_0xe4d6('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xe4d6('0xc')](_0xe4d6('0x4'))||'',this[_0xe4d6('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe4d6('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe4d6('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index cdb82e3..6754e08 100644 --- a/server/api/jscriptyProject/jscriptyProject.controller.js +++ b/server/api/jscriptyProject/jscriptyProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5294=['Unable\x20to\x20retrieve\x20the\x20current\x20user','catch','getSessions','findOne','JscriptySessionReport','ProjectId','filter','findAll','getAnswers','JscriptyAnswerReport','fromCharCode','apply','toString','indexOf','replace','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','get','Projects','destroy','error','stack','name','map','JscriptyProject','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','rows','show','params','rawAttributes','filters','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body'];(function(_0x66a29,_0x117998){var _0x6d7d77=function(_0x364173){while(--_0x364173){_0x66a29['push'](_0x66a29['shift']());}};_0x6d7d77(++_0x117998);}(_0x5294,0x111));var _0x4529=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5294[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x4529('0x0'));var emlformat=require(_0x4529('0x1'));var rimraf=require(_0x4529('0x2'));var zipdir=require(_0x4529('0x3'));var jsonpatch=require(_0x4529('0x4'));var rp=require(_0x4529('0x5'));var moment=require('moment');var BPromise=require(_0x4529('0x6'));var Mustache=require(_0x4529('0x7'));var util=require(_0x4529('0x8'));var path=require('path');var sox=require(_0x4529('0x9'));var csv=require(_0x4529('0xa'));var ejs=require(_0x4529('0xb'));var fs=require('fs');var _=require(_0x4529('0xc'));var squel=require('squel');var crypto=require(_0x4529('0xd'));var jsforce=require(_0x4529('0xe'));var deskjs=require(_0x4529('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4529('0x10'));var authService=require(_0x4529('0x11'));var qs=require(_0x4529('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4529('0x13'));var logger=require(_0x4529('0x14'))(_0x4529('0x15'));var utils=require(_0x4529('0x16'));var config=require(_0x4529('0x17'));var db=require(_0x4529('0x18'))['db'];function respondWithStatusCode(_0x4d733b,_0x5c3de9){_0x5c3de9=_0x5c3de9||0xcc;return function(_0x416dcb){if(_0x416dcb){return _0x4d733b[_0x4529('0x19')](_0x5c3de9);}return _0x4d733b['status'](_0x5c3de9)[_0x4529('0x1a')]();};}function respondWithResult(_0x48d375,_0x3bf3fb){_0x3bf3fb=_0x3bf3fb||0xc8;return function(_0x381501){if(_0x381501){return _0x48d375[_0x4529('0x1b')](_0x3bf3fb)[_0x4529('0x1c')](_0x381501);}};}function respondWithFilteredResult(_0x598c96,_0x3fa1a0){return function(_0x6dec9a){if(_0x6dec9a){var _0x208e16=_0x6dec9a[_0x4529('0x1d')],_0x5ecbd0=_0x3fa1a0[_0x4529('0x1e')],_0x1c34fc=_0x3fa1a0['offset']+_0x3fa1a0[_0x4529('0x1f')],_0xea8f44;if(_0x1c34fc>=_0x208e16){_0x1c34fc=_0x208e16;_0xea8f44=0xc8;}else{_0xea8f44=0xce;}_0x598c96[_0x4529('0x1b')](_0xea8f44);return _0x598c96['set'](_0x4529('0x20'),_0x5ecbd0+'-'+_0x1c34fc+'/'+_0x208e16)[_0x4529('0x1c')](_0x6dec9a);}return null;};}function patchUpdates(_0x10b3e1){return function(_0x51fb23){try{jsonpatch['apply'](_0x51fb23,_0x10b3e1,!![]);}catch(_0x6f1cda){return BPromise[_0x4529('0x21')](_0x6f1cda);}return _0x51fb23[_0x4529('0x22')]();};}function saveUpdates(_0x1c70d4,_0x32b8dc){return function(_0x5c7e39){if(_0x5c7e39){return _0x5c7e39[_0x4529('0x23')](_0x1c70d4)[_0x4529('0x24')](function(_0x12621d){return _0x12621d;});}return null;};}function removeEntity(_0x4418b4,_0xf26d88){return function(_0x25fa11){if(_0x25fa11){return _0x25fa11['destroy']()[_0x4529('0x24')](function(){var _0xee9870=_0x25fa11[_0x4529('0x25')]({'plain':!![]});var _0x49fcdf=_0x4529('0x26');return db['UserProfileResource'][_0x4529('0x27')]({'where':{'type':_0x49fcdf,'resourceId':_0xee9870['id']}})[_0x4529('0x24')](function(){return _0x25fa11;});})[_0x4529('0x24')](function(){_0x4418b4[_0x4529('0x1b')](0xcc)[_0x4529('0x1a')]();});}};}function handleEntityNotFound(_0x460036,_0x2647d3){return function(_0x5e4997){if(!_0x5e4997){_0x460036[_0x4529('0x19')](0x194);}return _0x5e4997;};}function handleError(_0x539d48,_0x5d129a){_0x5d129a=_0x5d129a||0x1f4;return function(_0x52065b){logger[_0x4529('0x28')](_0x52065b[_0x4529('0x29')]);if(_0x52065b[_0x4529('0x2a')]){delete _0x52065b[_0x4529('0x2a')];}_0x539d48[_0x4529('0x1b')](_0x5d129a)['send'](_0x52065b);};}exports['index']=function(_0x258957,_0x3596cf){var _0x28097f={},_0x3e0d2c={},_0x5a9d63={'count':0x0,'rows':[]};var _0x4e0d75=_[_0x4529('0x2b')](db[_0x4529('0x2c')]['rawAttributes'],function(_0x37ac06){return{'name':_0x37ac06[_0x4529('0x2d')],'type':_0x37ac06[_0x4529('0x2e')][_0x4529('0x2f')]};});_0x3e0d2c[_0x4529('0x30')]=_[_0x4529('0x2b')](_0x4e0d75,_0x4529('0x2a'));_0x3e0d2c[_0x4529('0x31')]=_[_0x4529('0x32')](_0x258957[_0x4529('0x31')]);_0x3e0d2c['filters']=_[_0x4529('0x33')](_0x3e0d2c[_0x4529('0x30')],_0x3e0d2c[_0x4529('0x31')]);_0x28097f[_0x4529('0x34')]=_[_0x4529('0x33')](_0x3e0d2c['model'],qs[_0x4529('0x35')](_0x258957[_0x4529('0x31')][_0x4529('0x35')]));_0x28097f['attributes']=_0x28097f[_0x4529('0x34')][_0x4529('0x36')]?_0x28097f[_0x4529('0x34')]:_0x3e0d2c['model'];if(!_0x258957[_0x4529('0x31')][_0x4529('0x37')](_0x4529('0x38'))){_0x28097f[_0x4529('0x1f')]=qs['limit'](_0x258957['query'][_0x4529('0x1f')]);_0x28097f[_0x4529('0x1e')]=qs['offset'](_0x258957['query']['offset']);}_0x28097f[_0x4529('0x39')]=qs[_0x4529('0x3a')](_0x258957[_0x4529('0x31')][_0x4529('0x3a')]);_0x28097f[_0x4529('0x3b')]=qs['filters'](_[_0x4529('0x3c')](_0x258957[_0x4529('0x31')],_0x3e0d2c['filters']));if(_0x258957[_0x4529('0x31')]['filter']){_0x28097f['where']=_[_0x4529('0x3d')](_0x28097f[_0x4529('0x3b')],{'$or':_[_0x4529('0x2b')](_0x4e0d75,function(_0x5e3f91){if(_0x5e3f91[_0x4529('0x2e')]!=='VIRTUAL'){var _0x2caadf={};_0x2caadf[_0x5e3f91['name']]={'$like':'%'+_0x258957['query']['filter']+'%'};return _0x2caadf;}})});}_0x28097f=_[_0x4529('0x3d')]({},_0x28097f,_0x258957[_0x4529('0x3e')]);var _0x978dc9={'where':_0x28097f[_0x4529('0x3b')]};return db[_0x4529('0x2c')][_0x4529('0x1d')](_0x978dc9)[_0x4529('0x24')](function(_0x9b923e){_0x5a9d63[_0x4529('0x1d')]=_0x9b923e;if(_0x258957[_0x4529('0x31')][_0x4529('0x3f')]){_0x28097f['include']=[{'all':!![]}];}return db[_0x4529('0x2c')]['findAll'](_0x28097f);})[_0x4529('0x24')](function(_0x24fb21){_0x5a9d63[_0x4529('0x40')]=_0x24fb21;return _0x5a9d63;})['then'](respondWithFilteredResult(_0x3596cf,_0x28097f))['catch'](handleError(_0x3596cf,null));};exports[_0x4529('0x41')]=function(_0x55c7e3,_0x245368){var _0xdcc803={'raw':![],'where':{'id':_0x55c7e3[_0x4529('0x42')]['id']}},_0x3c3151={};_0x3c3151[_0x4529('0x30')]=_[_0x4529('0x32')](db[_0x4529('0x2c')][_0x4529('0x43')]);_0x3c3151[_0x4529('0x31')]=_[_0x4529('0x32')](_0x55c7e3['query']);_0x3c3151[_0x4529('0x44')]=_[_0x4529('0x33')](_0x3c3151['model'],_0x3c3151[_0x4529('0x31')]);_0xdcc803[_0x4529('0x34')]=_[_0x4529('0x33')](_0x3c3151['model'],qs[_0x4529('0x35')](_0x55c7e3['query'][_0x4529('0x35')]));_0xdcc803['attributes']=_0xdcc803[_0x4529('0x34')][_0x4529('0x36')]?_0xdcc803[_0x4529('0x34')]:_0x3c3151[_0x4529('0x30')];if(_0x55c7e3[_0x4529('0x31')][_0x4529('0x3f')]){_0xdcc803[_0x4529('0x45')]=[{'all':!![]}];}_0xdcc803=_[_0x4529('0x3d')]({},_0xdcc803,_0x55c7e3[_0x4529('0x3e')]);return db[_0x4529('0x2c')][_0x4529('0x46')](_0xdcc803)[_0x4529('0x24')](handleEntityNotFound(_0x245368,null))[_0x4529('0x24')](respondWithResult(_0x245368,null))['catch'](handleError(_0x245368,null));};exports[_0x4529('0x47')]=function(_0x3cb323,_0x3fb4b3){return db[_0x4529('0x2c')][_0x4529('0x47')](_0x3cb323['body'],{})[_0x4529('0x24')](function(_0x5178f3){var _0x3c669f=_0x3cb323[_0x4529('0x48')][_0x4529('0x25')]({'plain':!![]});if(!_0x3c669f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c669f[_0x4529('0x49')]===_0x4529('0x48')){var _0x66f1a4=_0x5178f3[_0x4529('0x25')]({'plain':!![]});var _0x1d77cb=_0x4529('0x26');return db[_0x4529('0x4a')][_0x4529('0x46')]({'where':{'name':_0x1d77cb,'userProfileId':_0x3c669f[_0x4529('0x4b')]},'raw':!![]})['then'](function(_0x1069d2){if(_0x1069d2&&_0x1069d2[_0x4529('0x4c')]===0x0){return db[_0x4529('0x4d')][_0x4529('0x47')]({'name':_0x66f1a4['name'],'resourceId':_0x66f1a4['id'],'type':_0x1069d2[_0x4529('0x2a')],'sectionId':_0x1069d2['id']},{})['then'](function(){return _0x5178f3;});}else{return _0x5178f3;}})['catch'](function(_0x387aa9){logger[_0x4529('0x28')](_0x4529('0x4e'),_0x387aa9);throw _0x387aa9;});}return _0x5178f3;})['then'](respondWithResult(_0x3fb4b3,0xc9))['catch'](handleError(_0x3fb4b3,null));};exports[_0x4529('0x4f')]=function(_0x18e060,_0xc3c62e){var _0x2ac267={'where':{'id':_0x18e060[_0x4529('0x42')]['id']}},_0x14bd01={};_0x14bd01[_0x4529('0x30')]=_[_0x4529('0x32')](db[_0x4529('0x2c')][_0x4529('0x43')]);_0x2ac267[_0x4529('0x34')]=_[_0x4529('0x33')](_0x14bd01['model'],qs[_0x4529('0x35')](_0x18e060[_0x4529('0x31')]['fields']));_0x2ac267[_0x4529('0x34')]=_0x2ac267[_0x4529('0x34')][_0x4529('0x36')]?_0x2ac267[_0x4529('0x34')]:_0x14bd01[_0x4529('0x30')];if(_0x18e060[_0x4529('0x31')]['includeAll']){_0x2ac267[_0x4529('0x45')]=[{'all':!![]}];}_0x2ac267=_[_0x4529('0x3d')]({},_0x2ac267,_0x18e060['options']);return db[_0x4529('0x2c')][_0x4529('0x46')](_0x2ac267)['then'](handleEntityNotFound(_0xc3c62e,null))[_0x4529('0x24')](function(_0x8c07b9){if(_0x8c07b9){var _0xd27473=_0x8c07b9[_0x4529('0x25')]({'plain':!![]});_0xd27473=qs[_0x4529('0x50')](_0xd27473,['id',_0x4529('0x51'),_0x4529('0x52')]);_0x18e060[_0x4529('0x53')]=_[_0x4529('0x50')](_0x18e060[_0x4529('0x53')],['id',_0x4529('0x51'),_0x4529('0x52')]);return db[_0x4529('0x2c')][_0x4529('0x47')](_[_0x4529('0x3d')](_0xd27473,_0x18e060['body']),{'include':_0x18e060[_0x4529('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0x4529('0x24')](function(_0x1d2fd0){var _0x10e27f=_0x18e060[_0x4529('0x48')][_0x4529('0x25')]({'plain':!![]});if(!_0x10e27f)throw new Error(_0x4529('0x54'));if(_0x10e27f['role']===_0x4529('0x48')){var _0x358c8e=_0x1d2fd0['get']({'plain':!![]});var _0xb49d0c=_0x4529('0x26');return db[_0x4529('0x4a')][_0x4529('0x46')]({'where':{'name':_0xb49d0c,'userProfileId':_0x10e27f['userProfileId']},'raw':!![]})['then'](function(_0xc20216){if(_0xc20216&&_0xc20216[_0x4529('0x4c')]===0x0){return db[_0x4529('0x4d')][_0x4529('0x47')]({'name':_0x358c8e[_0x4529('0x2a')],'resourceId':_0x358c8e['id'],'type':_0xc20216['name'],'sectionId':_0xc20216['id']},{})[_0x4529('0x24')](function(){return _0x1d2fd0;});}else{return _0x1d2fd0;}})[_0x4529('0x55')](function(_0x5ca367){logger['error'](_0x4529('0x4e'),_0x5ca367);throw _0x5ca367;});}return _0x1d2fd0;});}})['then'](respondWithResult(_0xc3c62e,0xc9))[_0x4529('0x55')](handleError(_0xc3c62e,null));};exports[_0x4529('0x23')]=function(_0x538139,_0x18fd49){if(_0x538139[_0x4529('0x53')]['id']){delete _0x538139[_0x4529('0x53')]['id'];}return db[_0x4529('0x2c')][_0x4529('0x46')]({'where':{'id':_0x538139['params']['id']}})[_0x4529('0x24')](handleEntityNotFound(_0x18fd49,null))[_0x4529('0x24')](saveUpdates(_0x538139[_0x4529('0x53')],null))[_0x4529('0x24')](respondWithResult(_0x18fd49,null))['catch'](handleError(_0x18fd49,null));};exports[_0x4529('0x27')]=function(_0x368239,_0x38c2fe){return db[_0x4529('0x2c')]['find']({'where':{'id':_0x368239[_0x4529('0x42')]['id']}})[_0x4529('0x24')](handleEntityNotFound(_0x38c2fe,null))[_0x4529('0x24')](removeEntity(_0x38c2fe,null))[_0x4529('0x55')](handleError(_0x38c2fe,null));};exports[_0x4529('0x56')]=function(_0x44d4e5,_0x385857,_0x336474){var _0x2f9669={'raw':!![],'where':{}};var _0xb29fc3={};var _0x5ae965={'count':0x0,'rows':[]};return db[_0x4529('0x2c')][_0x4529('0x57')]({'where':{'id':_0x44d4e5[_0x4529('0x42')]['id']}})[_0x4529('0x24')](handleEntityNotFound(_0x385857,null))['then'](function(_0x4deb77){if(_0x4deb77){_0xb29fc3[_0x4529('0x30')]=_[_0x4529('0x32')](db[_0x4529('0x58')][_0x4529('0x43')]);_0xb29fc3[_0x4529('0x31')]=_[_0x4529('0x32')](_0x44d4e5[_0x4529('0x31')]);_0xb29fc3[_0x4529('0x44')]=_[_0x4529('0x33')](_0xb29fc3[_0x4529('0x30')],_0xb29fc3[_0x4529('0x31')]);_0x2f9669[_0x4529('0x34')]=_[_0x4529('0x33')](_0xb29fc3[_0x4529('0x30')],qs['fields'](_0x44d4e5[_0x4529('0x31')]['fields']));_0x2f9669[_0x4529('0x34')]=_0x2f9669[_0x4529('0x34')][_0x4529('0x36')]?_0x2f9669['attributes']:_0xb29fc3[_0x4529('0x30')];if(!_0x44d4e5['query']['hasOwnProperty'](_0x4529('0x38'))){_0x2f9669['limit']=qs['limit'](_0x44d4e5[_0x4529('0x31')][_0x4529('0x1f')]);_0x2f9669[_0x4529('0x1e')]=qs['offset'](_0x44d4e5[_0x4529('0x31')][_0x4529('0x1e')]);}_0x2f9669['order']=qs[_0x4529('0x3a')](_0x44d4e5[_0x4529('0x31')][_0x4529('0x3a')]);_0x2f9669[_0x4529('0x3b')]=qs[_0x4529('0x44')](_[_0x4529('0x3c')](_0x44d4e5[_0x4529('0x31')],_0xb29fc3['filters']));_0x2f9669[_0x4529('0x3b')][_0x4529('0x59')]=_0x4deb77['id'];if(_0x44d4e5[_0x4529('0x31')][_0x4529('0x5a')]){_0x2f9669['where']=_[_0x4529('0x3d')](_0x2f9669[_0x4529('0x3b')],{'$or':_[_0x4529('0x2b')](_0x2f9669[_0x4529('0x34')],function(_0x598ee2){var _0x57a6e2={};_0x57a6e2[_0x598ee2]={'$like':'%'+_0x44d4e5[_0x4529('0x31')][_0x4529('0x5a')]+'%'};return _0x57a6e2;})});}_0x2f9669=_[_0x4529('0x3d')]({},_0x2f9669,_0x44d4e5[_0x4529('0x3e')]);return db[_0x4529('0x58')][_0x4529('0x1d')]({'where':_0x2f9669[_0x4529('0x3b')]})[_0x4529('0x24')](function(_0x1e05b0){_0x5ae965[_0x4529('0x1d')]=_0x1e05b0;if(_0x44d4e5['query'][_0x4529('0x3f')]){_0x2f9669[_0x4529('0x45')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4529('0x5b')](_0x2f9669);})['then'](function(_0x10a140){_0x5ae965[_0x4529('0x40')]=_0x10a140;return _0x5ae965;});}})[_0x4529('0x24')](respondWithFilteredResult(_0x385857,_0x2f9669))[_0x4529('0x55')](handleError(_0x385857,null));};exports[_0x4529('0x5c')]=function(_0x5b18c7,_0x2e26d3,_0x477fc6){var _0x45c42d={'raw':!![],'where':{}};var _0x467380={};var _0x1647c5={'count':0x0,'rows':[]};return db[_0x4529('0x2c')][_0x4529('0x57')]({'where':{'id':_0x5b18c7[_0x4529('0x42')]['id']}})[_0x4529('0x24')](handleEntityNotFound(_0x2e26d3,null))['then'](function(_0x2fddb6){if(_0x2fddb6){_0x467380[_0x4529('0x30')]=_[_0x4529('0x32')](db[_0x4529('0x5d')][_0x4529('0x43')]);_0x467380['query']=_[_0x4529('0x32')](_0x5b18c7[_0x4529('0x31')]);_0x467380['filters']=_['intersection'](_0x467380['model'],_0x467380[_0x4529('0x31')]);_0x45c42d[_0x4529('0x34')]=_[_0x4529('0x33')](_0x467380[_0x4529('0x30')],qs[_0x4529('0x35')](_0x5b18c7[_0x4529('0x31')][_0x4529('0x35')]));_0x45c42d[_0x4529('0x34')]=_0x45c42d[_0x4529('0x34')]['length']?_0x45c42d[_0x4529('0x34')]:_0x467380[_0x4529('0x30')];if(!_0x5b18c7[_0x4529('0x31')]['hasOwnProperty'](_0x4529('0x38'))){_0x45c42d[_0x4529('0x1f')]=qs[_0x4529('0x1f')](_0x5b18c7[_0x4529('0x31')][_0x4529('0x1f')]);_0x45c42d[_0x4529('0x1e')]=qs['offset'](_0x5b18c7[_0x4529('0x31')][_0x4529('0x1e')]);}_0x45c42d[_0x4529('0x39')]=qs[_0x4529('0x3a')](_0x5b18c7['query']['sort']);_0x45c42d['where']=qs[_0x4529('0x44')](_[_0x4529('0x3c')](_0x5b18c7[_0x4529('0x31')],_0x467380['filters']));_0x45c42d[_0x4529('0x3b')][_0x4529('0x59')]=_0x2fddb6['id'];if(_0x5b18c7[_0x4529('0x31')][_0x4529('0x5a')]){_0x45c42d[_0x4529('0x3b')]=_['merge'](_0x45c42d[_0x4529('0x3b')],{'$or':_[_0x4529('0x2b')](_0x45c42d[_0x4529('0x34')],function(_0x447ae6){var _0x3a94cd={};_0x3a94cd[_0x447ae6]={'$like':'%'+_0x5b18c7['query'][_0x4529('0x5a')]+'%'};return _0x3a94cd;})});}_0x45c42d=_[_0x4529('0x3d')]({},_0x45c42d,_0x5b18c7['options']);return db[_0x4529('0x5d')][_0x4529('0x1d')]({'where':_0x45c42d['where']})[_0x4529('0x24')](function(_0x57939c){_0x1647c5[_0x4529('0x1d')]=_0x57939c;if(_0x5b18c7['query'][_0x4529('0x3f')]){_0x45c42d[_0x4529('0x45')]=[{'all':!![]}];}return db[_0x4529('0x5d')][_0x4529('0x5b')](_0x45c42d);})[_0x4529('0x24')](function(_0x48b88d){_0x1647c5[_0x4529('0x40')]=_0x48b88d;return _0x1647c5;});}})[_0x4529('0x24')](respondWithFilteredResult(_0x2e26d3,_0x45c42d))[_0x4529('0x55')](handleError(_0x2e26d3,null));};function char(_0xf00710){return'number'===typeof _0xf00710?String[_0x4529('0x5e')][_0x4529('0x5f')](null,arguments):_0xf00710;}function needsEncapsulation(_0x4985d1){return!!_0x4985d1&&(_0x4985d1[_0x4529('0x60')]()[_0x4529('0x61')](char(0xd))>=0x0||_0x4985d1['toString']()[_0x4529('0x61')](char(0xa))>=0x0||_0x4985d1['toString']()[_0x4529('0x61')](char(0x2c))>=0x0||_0x4985d1[_0x4529('0x60')]()[_0x4529('0x61')](char(0x22))>=0x0);}function encapsulate(_0x3535a8){var _0x9e8f8a=char(0x22),_0x56dca1='\x5c'+char(0x22),_0x2cc08a=_0x3535a8['toString']()[_0x4529('0x62')](new RegExp(_0x9e8f8a,'g'),_0x56dca1);return _0x9e8f8a+_0x2cc08a+_0x9e8f8a;}exports['getSummary']=function(_0x2bd2c5,_0x45b607,_0x216754){var _0x13952a,_0x22aac1;var _0xbb52f={'where':{'ProjectId':_0x2bd2c5[_0x4529('0x42')]['id']}};if(_0x2bd2c5[_0x4529('0x31')][_0x4529('0x63')]){_0xbb52f[_0x4529('0x3b')][_0x4529('0x64')]=JSON['parse'](_0x2bd2c5[_0x4529('0x31')]['startTime']);}return db['JscriptySessionReport'][_0x4529('0x5b')](_0xbb52f)['then'](handleEntityNotFound(_0x45b607,null))[_0x4529('0x24')](function(_0xee293a){if(_0xee293a){_0x13952a=_0xee293a;return db[_0x4529('0x65')][_0x4529('0x5b')]({'where':{'SessionId':{'$in':_[_0x4529('0x2b')](_0x13952a,'id')},'ProjectId':_0x2bd2c5[_0x4529('0x42')]['id']},'order':_0x4529('0x66')});}})[_0x4529('0x24')](handleEntityNotFound(_0x45b607,null))['then'](function(_0x4100c5){if(_0x4100c5){_0x22aac1=_0x4100c5;var _0xe1b705={};for(var _0xb147c7=0x0,_0x402cbe=_0x22aac1[_0x4529('0x36')];_0xb147c7<_0x402cbe;_0xb147c7++){if(!_0xe1b705[_0x4529('0x37')](_0x22aac1[_0xb147c7]['questionId'])){_0xe1b705[_0x22aac1[_0xb147c7][_0x4529('0x67')]]=needsEncapsulation(_0x22aac1[_0xb147c7]['question'])?encapsulate(_0x22aac1[_0xb147c7][_0x4529('0x68')]):_0x22aac1[_0xb147c7]['question'];}}var _0xb2380=[],_0x306a53={};for(var _0x4e6dd1=0x0,_0x382043=_0x13952a[_0x4529('0x36')];_0x4e6dd1<_0x382043;_0x4e6dd1++){_0x306a53={'ProjectId':_0x2bd2c5[_0x4529('0x42')]['id'],'SessionId':_0x13952a[_0x4e6dd1]['id'],'StartTime':moment(_0x13952a[_0x4e6dd1][_0x4529('0x64')])[_0x4529('0x69')](_0x4529('0x6a'))};for(var _0x3d96a2=0x0,_0x135a60=_0x22aac1[_0x4529('0x36')];_0x3d96a2<_0x135a60;_0x3d96a2++){if(_0x22aac1[_0x3d96a2][_0x4529('0x6b')]==_0x13952a[_0x4e6dd1]['id']&&_0xe1b705[_0x4529('0x37')](_0x22aac1[_0x3d96a2]['questionId'])){_0x306a53[_0xe1b705[_0x22aac1[_0x3d96a2][_0x4529('0x67')]]]=_0x22aac1[_0x3d96a2][_0x4529('0x6c')];}}for(var _0x30d0b4 in _0xe1b705){if(!_0x306a53['hasOwnProperty'](_0xe1b705[_0x30d0b4])){_0x306a53[_0xe1b705[_0x30d0b4]]=null;}}_0xb2380[_0x4529('0x6d')](_0x306a53);}return _0xb2380;}})['then'](function(_0xbbe4cb){if(!_[_0x4529('0x6e')](_0xbbe4cb)){var _0x5663a0=toCsv(_0xbbe4cb);var _0x3ad6a2=Date['now']();fs[_0x4529('0x6f')](util[_0x4529('0x69')](_0x4529('0x70'),_0x2bd2c5[_0x4529('0x42')]['id'],_0x3ad6a2),_0x5663a0);_0x45b607[_0x4529('0x71')](_0x4529('0x72'),_0x4529('0x73')+util[_0x4529('0x69')]('Jscripty_Project_%d_Summary_%s.csv',_0x2bd2c5[_0x4529('0x42')]['id'],_0x3ad6a2));_0x45b607[_0x4529('0x71')](_0x4529('0x74'),_0x4529('0x75'));return _0x45b607[_0x4529('0x76')](util[_0x4529('0x69')](_0x4529('0x70'),_0x2bd2c5['params']['id'],_0x3ad6a2));}else{return _0x45b607[_0x4529('0x19')](0xcc);}})[_0x4529('0x55')](handleError(_0x45b607,null));}; \ No newline at end of file +var _0xc73a=['bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','include','rows','catch','includeAll','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','params','getSessions','JscriptySessionReport','sort','ProjectId','getAnswers','findOne','JscriptyAnswerReport','pick','findAll','number','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','moment'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0xc73a,0x72));var _0xac73=function(_0x14005e,_0x57ea6b){_0x14005e=_0x14005e-0x0;var _0x4361dc=_0xc73a[_0x14005e];return _0x4361dc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xac73('0x0'));var rimraf=require(_0xac73('0x1'));var zipdir=require(_0xac73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xac73('0x3'));var BPromise=require(_0xac73('0x4'));var Mustache=require(_0xac73('0x5'));var util=require('util');var path=require(_0xac73('0x6'));var sox=require(_0xac73('0x7'));var csv=require(_0xac73('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xac73('0x9'));var squel=require(_0xac73('0xa'));var crypto=require(_0xac73('0xb'));var jsforce=require(_0xac73('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xac73('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xac73('0xd'));var authService=require(_0xac73('0xe'));var qs=require(_0xac73('0xf'));var as=require(_0xac73('0x10'));var hardwareService=require(_0xac73('0x11'));var logger=require(_0xac73('0x12'))(_0xac73('0x13'));var utils=require(_0xac73('0x14'));var config=require('../../config/environment');var db=require(_0xac73('0x15'))['db'];function respondWithStatusCode(_0xda821e,_0x40d791){_0x40d791=_0x40d791||0xcc;return function(_0x7b4ade){if(_0x7b4ade){return _0xda821e[_0xac73('0x16')](_0x40d791);}return _0xda821e[_0xac73('0x17')](_0x40d791)['end']();};}function respondWithResult(_0x20bcbc,_0x54a0fa){_0x54a0fa=_0x54a0fa||0xc8;return function(_0x3b8c56){if(_0x3b8c56){return _0x20bcbc[_0xac73('0x17')](_0x54a0fa)[_0xac73('0x18')](_0x3b8c56);}};}function respondWithFilteredResult(_0x133c96,_0x5579e1){return function(_0x113430){if(_0x113430){var _0x1466ca=_0x113430[_0xac73('0x19')],_0x518a0d=_0x5579e1['offset'],_0x1d947c=_0x5579e1[_0xac73('0x1a')]+_0x5579e1[_0xac73('0x1b')],_0x2532bc;if(_0x1d947c>=_0x1466ca){_0x1d947c=_0x1466ca;_0x2532bc=0xc8;}else{_0x2532bc=0xce;}_0x133c96[_0xac73('0x17')](_0x2532bc);return _0x133c96[_0xac73('0x1c')](_0xac73('0x1d'),_0x518a0d+'-'+_0x1d947c+'/'+_0x1466ca)['json'](_0x113430);}return null;};}function patchUpdates(_0x1e2bfd){return function(_0x20976e){try{jsonpatch['apply'](_0x20976e,_0x1e2bfd,!![]);}catch(_0x131a1d){return BPromise[_0xac73('0x1e')](_0x131a1d);}return _0x20976e[_0xac73('0x1f')]();};}function saveUpdates(_0x150ee5,_0x102a02){return function(_0xeef7ea){if(_0xeef7ea){return _0xeef7ea[_0xac73('0x20')](_0x150ee5)[_0xac73('0x21')](function(_0x38edae){return _0x38edae;});}return null;};}function removeEntity(_0x5cb544,_0x999f70){return function(_0x1c42ff){if(_0x1c42ff){return _0x1c42ff[_0xac73('0x22')]()['then'](function(){var _0x40df24=_0x1c42ff['get']({'plain':!![]});var _0xc7791d=_0xac73('0x23');return db[_0xac73('0x24')][_0xac73('0x22')]({'where':{'type':_0xc7791d,'resourceId':_0x40df24['id']}})[_0xac73('0x21')](function(){return _0x1c42ff;});})[_0xac73('0x21')](function(){_0x5cb544[_0xac73('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc76c54,_0x3e9d1c){return function(_0xf07e1f){if(!_0xf07e1f){_0xc76c54[_0xac73('0x16')](0x194);}return _0xf07e1f;};}function handleError(_0x180b3e,_0x2dcfa6){_0x2dcfa6=_0x2dcfa6||0x1f4;return function(_0x5c9f7b){logger[_0xac73('0x25')](_0x5c9f7b[_0xac73('0x26')]);if(_0x5c9f7b[_0xac73('0x27')]){delete _0x5c9f7b[_0xac73('0x27')];}_0x180b3e[_0xac73('0x17')](_0x2dcfa6)[_0xac73('0x28')](_0x5c9f7b);};}exports[_0xac73('0x29')]=function(_0x2bc336,_0x35dd60){var _0x4bc16f={},_0xfc0e93={},_0x2bcfb5={'count':0x0,'rows':[]};var _0x42792e=_[_0xac73('0x2a')](db[_0xac73('0x2b')][_0xac73('0x2c')],function(_0x5cf86e){return{'name':_0x5cf86e[_0xac73('0x2d')],'type':_0x5cf86e[_0xac73('0x2e')][_0xac73('0x2f')]};});_0xfc0e93[_0xac73('0x30')]=_['map'](_0x42792e,_0xac73('0x27'));_0xfc0e93[_0xac73('0x31')]=_[_0xac73('0x32')](_0x2bc336[_0xac73('0x31')]);_0xfc0e93[_0xac73('0x33')]=_[_0xac73('0x34')](_0xfc0e93[_0xac73('0x30')],_0xfc0e93[_0xac73('0x31')]);_0x4bc16f[_0xac73('0x35')]=_[_0xac73('0x34')](_0xfc0e93[_0xac73('0x30')],qs[_0xac73('0x36')](_0x2bc336[_0xac73('0x31')][_0xac73('0x36')]));_0x4bc16f[_0xac73('0x35')]=_0x4bc16f[_0xac73('0x35')][_0xac73('0x37')]?_0x4bc16f[_0xac73('0x35')]:_0xfc0e93['model'];if(!_0x2bc336[_0xac73('0x31')][_0xac73('0x38')](_0xac73('0x39'))){_0x4bc16f['limit']=qs['limit'](_0x2bc336[_0xac73('0x31')]['limit']);_0x4bc16f['offset']=qs[_0xac73('0x1a')](_0x2bc336[_0xac73('0x31')][_0xac73('0x1a')]);}_0x4bc16f[_0xac73('0x3a')]=qs['sort'](_0x2bc336[_0xac73('0x31')]['sort']);_0x4bc16f[_0xac73('0x3b')]=qs[_0xac73('0x33')](_['pick'](_0x2bc336[_0xac73('0x31')],_0xfc0e93[_0xac73('0x33')]));if(_0x2bc336[_0xac73('0x31')][_0xac73('0x3c')]){_0x4bc16f[_0xac73('0x3b')]=_[_0xac73('0x3d')](_0x4bc16f[_0xac73('0x3b')],{'$or':_[_0xac73('0x2a')](_0x42792e,function(_0x2d1b64){if(_0x2d1b64[_0xac73('0x2e')]!=='VIRTUAL'){var _0x21ee15={};_0x21ee15[_0x2d1b64['name']]={'$like':'%'+_0x2bc336[_0xac73('0x31')]['filter']+'%'};return _0x21ee15;}})});}_0x4bc16f=_[_0xac73('0x3d')]({},_0x4bc16f,_0x2bc336['options']);var _0xb42088={'where':_0x4bc16f[_0xac73('0x3b')]};return db['JscriptyProject'][_0xac73('0x19')](_0xb42088)[_0xac73('0x21')](function(_0x55565a){_0x2bcfb5['count']=_0x55565a;if(_0x2bc336['query']['includeAll']){_0x4bc16f[_0xac73('0x3e')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x4bc16f);})['then'](function(_0x37644a){_0x2bcfb5[_0xac73('0x3f')]=_0x37644a;return _0x2bcfb5;})[_0xac73('0x21')](respondWithFilteredResult(_0x35dd60,_0x4bc16f))[_0xac73('0x40')](handleError(_0x35dd60,null));};exports['show']=function(_0x5dab73,_0x235947){var _0x3ed3c2={'raw':![],'where':{'id':_0x5dab73['params']['id']}},_0x17d594={};_0x17d594[_0xac73('0x30')]=_[_0xac73('0x32')](db['JscriptyProject'][_0xac73('0x2c')]);_0x17d594[_0xac73('0x31')]=_[_0xac73('0x32')](_0x5dab73[_0xac73('0x31')]);_0x17d594['filters']=_[_0xac73('0x34')](_0x17d594[_0xac73('0x30')],_0x17d594[_0xac73('0x31')]);_0x3ed3c2['attributes']=_[_0xac73('0x34')](_0x17d594[_0xac73('0x30')],qs[_0xac73('0x36')](_0x5dab73[_0xac73('0x31')]['fields']));_0x3ed3c2[_0xac73('0x35')]=_0x3ed3c2[_0xac73('0x35')]['length']?_0x3ed3c2[_0xac73('0x35')]:_0x17d594[_0xac73('0x30')];if(_0x5dab73[_0xac73('0x31')][_0xac73('0x41')]){_0x3ed3c2[_0xac73('0x3e')]=[{'all':!![]}];}_0x3ed3c2=_['merge']({},_0x3ed3c2,_0x5dab73[_0xac73('0x42')]);return db[_0xac73('0x2b')]['find'](_0x3ed3c2)[_0xac73('0x21')](handleEntityNotFound(_0x235947,null))[_0xac73('0x21')](respondWithResult(_0x235947,null))[_0xac73('0x40')](handleError(_0x235947,null));};exports[_0xac73('0x43')]=function(_0x463ebe,_0x1982d2){return db['JscriptyProject'][_0xac73('0x43')](_0x463ebe[_0xac73('0x44')],{})[_0xac73('0x21')](function(_0x5c0bac){var _0x1bb6d2=_0x463ebe['user'][_0xac73('0x45')]({'plain':!![]});if(!_0x1bb6d2)throw new Error(_0xac73('0x46'));if(_0x1bb6d2['role']===_0xac73('0x47')){var _0x47f7d9=_0x5c0bac[_0xac73('0x45')]({'plain':!![]});var _0x5cf61b=_0xac73('0x23');return db[_0xac73('0x48')][_0xac73('0x49')]({'where':{'name':_0x5cf61b,'userProfileId':_0x1bb6d2[_0xac73('0x4a')]},'raw':!![]})[_0xac73('0x21')](function(_0x47c181){if(_0x47c181&&_0x47c181[_0xac73('0x4b')]===0x0){return db[_0xac73('0x24')]['create']({'name':_0x47f7d9[_0xac73('0x27')],'resourceId':_0x47f7d9['id'],'type':_0x47c181[_0xac73('0x27')],'sectionId':_0x47c181['id']},{})[_0xac73('0x21')](function(){return _0x5c0bac;});}else{return _0x5c0bac;}})[_0xac73('0x40')](function(_0x52917b){logger['error'](_0xac73('0x4c'),_0x52917b);throw _0x52917b;});}return _0x5c0bac;})[_0xac73('0x21')](respondWithResult(_0x1982d2,0xc9))[_0xac73('0x40')](handleError(_0x1982d2,null));};exports[_0xac73('0x4d')]=function(_0x3dd84c,_0x3053da){var _0x1fa693={'where':{'id':_0x3dd84c['params']['id']}},_0x44509c={};_0x44509c['model']=_[_0xac73('0x32')](db['JscriptyProject'][_0xac73('0x2c')]);_0x1fa693[_0xac73('0x35')]=_[_0xac73('0x34')](_0x44509c[_0xac73('0x30')],qs[_0xac73('0x36')](_0x3dd84c[_0xac73('0x31')][_0xac73('0x36')]));_0x1fa693['attributes']=_0x1fa693[_0xac73('0x35')][_0xac73('0x37')]?_0x1fa693['attributes']:_0x44509c['model'];if(_0x3dd84c[_0xac73('0x31')][_0xac73('0x41')]){_0x1fa693[_0xac73('0x3e')]=[{'all':!![]}];}_0x1fa693=_[_0xac73('0x3d')]({},_0x1fa693,_0x3dd84c['options']);return db['JscriptyProject']['find'](_0x1fa693)[_0xac73('0x21')](handleEntityNotFound(_0x3053da,null))['then'](function(_0x13749e){if(_0x13749e){var _0x2ab65b=_0x13749e[_0xac73('0x45')]({'plain':!![]});_0x2ab65b=qs[_0xac73('0x4e')](_0x2ab65b,['id',_0xac73('0x4f'),_0xac73('0x50')]);_0x3dd84c[_0xac73('0x44')]=_[_0xac73('0x4e')](_0x3dd84c[_0xac73('0x44')],['id',_0xac73('0x4f'),_0xac73('0x50')]);return db['JscriptyProject'][_0xac73('0x43')](_['merge'](_0x2ab65b,_0x3dd84c[_0xac73('0x44')]),{'include':_0x3dd84c[_0xac73('0x31')][_0xac73('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0xf79c75){var _0x4e4126=_0x3dd84c[_0xac73('0x47')][_0xac73('0x45')]({'plain':!![]});if(!_0x4e4126)throw new Error(_0xac73('0x46'));if(_0x4e4126[_0xac73('0x51')]==='user'){var _0x424859=_0xf79c75[_0xac73('0x45')]({'plain':!![]});var _0x5c2817=_0xac73('0x23');return db[_0xac73('0x48')][_0xac73('0x49')]({'where':{'name':_0x5c2817,'userProfileId':_0x4e4126['userProfileId']},'raw':!![]})[_0xac73('0x21')](function(_0x172cd3){if(_0x172cd3&&_0x172cd3[_0xac73('0x4b')]===0x0){return db['UserProfileResource'][_0xac73('0x43')]({'name':_0x424859['name'],'resourceId':_0x424859['id'],'type':_0x172cd3[_0xac73('0x27')],'sectionId':_0x172cd3['id']},{})['then'](function(){return _0xf79c75;});}else{return _0xf79c75;}})['catch'](function(_0x1c6c02){logger[_0xac73('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c6c02);throw _0x1c6c02;});}return _0xf79c75;});}})[_0xac73('0x21')](respondWithResult(_0x3053da,0xc9))['catch'](handleError(_0x3053da,null));};exports['update']=function(_0x1bc555,_0x4237af){if(_0x1bc555['body']['id']){delete _0x1bc555[_0xac73('0x44')]['id'];}return db[_0xac73('0x2b')]['find']({'where':{'id':_0x1bc555[_0xac73('0x52')]['id']}})[_0xac73('0x21')](handleEntityNotFound(_0x4237af,null))[_0xac73('0x21')](saveUpdates(_0x1bc555[_0xac73('0x44')],null))[_0xac73('0x21')](respondWithResult(_0x4237af,null))[_0xac73('0x40')](handleError(_0x4237af,null));};exports['destroy']=function(_0x2a5dd3,_0x5deb00){return db['JscriptyProject'][_0xac73('0x49')]({'where':{'id':_0x2a5dd3[_0xac73('0x52')]['id']}})[_0xac73('0x21')](handleEntityNotFound(_0x5deb00,null))['then'](removeEntity(_0x5deb00,null))[_0xac73('0x40')](handleError(_0x5deb00,null));};exports[_0xac73('0x53')]=function(_0xb60033,_0x2ad67e,_0x4569f4){var _0x468515={'raw':!![],'where':{}};var _0x5f1cce={};var _0x1c8f8a={'count':0x0,'rows':[]};return db[_0xac73('0x2b')]['findOne']({'where':{'id':_0xb60033[_0xac73('0x52')]['id']}})[_0xac73('0x21')](handleEntityNotFound(_0x2ad67e,null))[_0xac73('0x21')](function(_0x105e15){if(_0x105e15){_0x5f1cce['model']=_[_0xac73('0x32')](db[_0xac73('0x54')][_0xac73('0x2c')]);_0x5f1cce['query']=_['keys'](_0xb60033[_0xac73('0x31')]);_0x5f1cce['filters']=_[_0xac73('0x34')](_0x5f1cce['model'],_0x5f1cce[_0xac73('0x31')]);_0x468515[_0xac73('0x35')]=_[_0xac73('0x34')](_0x5f1cce[_0xac73('0x30')],qs[_0xac73('0x36')](_0xb60033[_0xac73('0x31')]['fields']));_0x468515[_0xac73('0x35')]=_0x468515[_0xac73('0x35')][_0xac73('0x37')]?_0x468515[_0xac73('0x35')]:_0x5f1cce[_0xac73('0x30')];if(!_0xb60033[_0xac73('0x31')][_0xac73('0x38')](_0xac73('0x39'))){_0x468515['limit']=qs['limit'](_0xb60033[_0xac73('0x31')]['limit']);_0x468515['offset']=qs[_0xac73('0x1a')](_0xb60033['query'][_0xac73('0x1a')]);}_0x468515[_0xac73('0x3a')]=qs[_0xac73('0x55')](_0xb60033['query'][_0xac73('0x55')]);_0x468515[_0xac73('0x3b')]=qs[_0xac73('0x33')](_['pick'](_0xb60033[_0xac73('0x31')],_0x5f1cce[_0xac73('0x33')]));_0x468515[_0xac73('0x3b')][_0xac73('0x56')]=_0x105e15['id'];if(_0xb60033[_0xac73('0x31')][_0xac73('0x3c')]){_0x468515['where']=_[_0xac73('0x3d')](_0x468515[_0xac73('0x3b')],{'$or':_[_0xac73('0x2a')](_0x468515[_0xac73('0x35')],function(_0x5af14c){var _0x15f0b4={};_0x15f0b4[_0x5af14c]={'$like':'%'+_0xb60033[_0xac73('0x31')][_0xac73('0x3c')]+'%'};return _0x15f0b4;})});}_0x468515=_[_0xac73('0x3d')]({},_0x468515,_0xb60033[_0xac73('0x42')]);return db[_0xac73('0x54')][_0xac73('0x19')]({'where':_0x468515[_0xac73('0x3b')]})[_0xac73('0x21')](function(_0x1606de){_0x1c8f8a['count']=_0x1606de;if(_0xb60033['query']['includeAll']){_0x468515['include']=[{'all':!![]}];}return db[_0xac73('0x54')]['findAll'](_0x468515);})[_0xac73('0x21')](function(_0x349e97){_0x1c8f8a[_0xac73('0x3f')]=_0x349e97;return _0x1c8f8a;});}})[_0xac73('0x21')](respondWithFilteredResult(_0x2ad67e,_0x468515))[_0xac73('0x40')](handleError(_0x2ad67e,null));};exports[_0xac73('0x57')]=function(_0x115c63,_0x92992a,_0x4faff8){var _0x533922={'raw':!![],'where':{}};var _0xb4c8d5={};var _0x5983ed={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xac73('0x58')]({'where':{'id':_0x115c63[_0xac73('0x52')]['id']}})[_0xac73('0x21')](handleEntityNotFound(_0x92992a,null))[_0xac73('0x21')](function(_0x828e76){if(_0x828e76){_0xb4c8d5['model']=_[_0xac73('0x32')](db[_0xac73('0x59')][_0xac73('0x2c')]);_0xb4c8d5[_0xac73('0x31')]=_[_0xac73('0x32')](_0x115c63[_0xac73('0x31')]);_0xb4c8d5[_0xac73('0x33')]=_[_0xac73('0x34')](_0xb4c8d5[_0xac73('0x30')],_0xb4c8d5[_0xac73('0x31')]);_0x533922[_0xac73('0x35')]=_[_0xac73('0x34')](_0xb4c8d5[_0xac73('0x30')],qs['fields'](_0x115c63[_0xac73('0x31')][_0xac73('0x36')]));_0x533922['attributes']=_0x533922[_0xac73('0x35')][_0xac73('0x37')]?_0x533922[_0xac73('0x35')]:_0xb4c8d5[_0xac73('0x30')];if(!_0x115c63['query']['hasOwnProperty'](_0xac73('0x39'))){_0x533922[_0xac73('0x1b')]=qs['limit'](_0x115c63[_0xac73('0x31')]['limit']);_0x533922['offset']=qs['offset'](_0x115c63[_0xac73('0x31')][_0xac73('0x1a')]);}_0x533922[_0xac73('0x3a')]=qs[_0xac73('0x55')](_0x115c63[_0xac73('0x31')]['sort']);_0x533922[_0xac73('0x3b')]=qs[_0xac73('0x33')](_[_0xac73('0x5a')](_0x115c63[_0xac73('0x31')],_0xb4c8d5['filters']));_0x533922[_0xac73('0x3b')]['ProjectId']=_0x828e76['id'];if(_0x115c63['query'][_0xac73('0x3c')]){_0x533922[_0xac73('0x3b')]=_[_0xac73('0x3d')](_0x533922[_0xac73('0x3b')],{'$or':_[_0xac73('0x2a')](_0x533922[_0xac73('0x35')],function(_0x38c389){var _0x4cee19={};_0x4cee19[_0x38c389]={'$like':'%'+_0x115c63[_0xac73('0x31')][_0xac73('0x3c')]+'%'};return _0x4cee19;})});}_0x533922=_[_0xac73('0x3d')]({},_0x533922,_0x115c63[_0xac73('0x42')]);return db[_0xac73('0x59')][_0xac73('0x19')]({'where':_0x533922[_0xac73('0x3b')]})[_0xac73('0x21')](function(_0x5f7bc8){_0x5983ed[_0xac73('0x19')]=_0x5f7bc8;if(_0x115c63[_0xac73('0x31')][_0xac73('0x41')]){_0x533922[_0xac73('0x3e')]=[{'all':!![]}];}return db[_0xac73('0x59')][_0xac73('0x5b')](_0x533922);})[_0xac73('0x21')](function(_0x3da570){_0x5983ed['rows']=_0x3da570;return _0x5983ed;});}})['then'](respondWithFilteredResult(_0x92992a,_0x533922))['catch'](handleError(_0x92992a,null));};function char(_0x650837){return _0xac73('0x5c')===typeof _0x650837?String['fromCharCode'][_0xac73('0x5d')](null,arguments):_0x650837;}function needsEncapsulation(_0x199f49){return!!_0x199f49&&(_0x199f49[_0xac73('0x5e')]()[_0xac73('0x5f')](char(0xd))>=0x0||_0x199f49[_0xac73('0x5e')]()[_0xac73('0x5f')](char(0xa))>=0x0||_0x199f49[_0xac73('0x5e')]()[_0xac73('0x5f')](char(0x2c))>=0x0||_0x199f49[_0xac73('0x5e')]()[_0xac73('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x19a791){var _0x21a2e7=char(0x22),_0x81fd7d='\x5c'+char(0x22),_0xff7c51=_0x19a791[_0xac73('0x5e')]()[_0xac73('0x60')](new RegExp(_0x21a2e7,'g'),_0x81fd7d);return _0x21a2e7+_0xff7c51+_0x21a2e7;}exports[_0xac73('0x61')]=function(_0x31ee4a,_0x39445b,_0x32756f){var _0x557ac5,_0x168f31;var _0x3e203b={'where':{'ProjectId':_0x31ee4a[_0xac73('0x52')]['id']}};if(_0x31ee4a[_0xac73('0x31')][_0xac73('0x62')]){_0x3e203b[_0xac73('0x3b')][_0xac73('0x63')]=JSON[_0xac73('0x64')](_0x31ee4a[_0xac73('0x31')][_0xac73('0x62')]);}return db['JscriptySessionReport'][_0xac73('0x5b')](_0x3e203b)[_0xac73('0x21')](handleEntityNotFound(_0x39445b,null))['then'](function(_0x34afe4){if(_0x34afe4){_0x557ac5=_0x34afe4;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_['map'](_0x557ac5,'id')},'ProjectId':_0x31ee4a[_0xac73('0x52')]['id']},'order':_0xac73('0x65')});}})['then'](handleEntityNotFound(_0x39445b,null))[_0xac73('0x21')](function(_0x29e9be){if(_0x29e9be){_0x168f31=_0x29e9be;var _0x445fd0={};for(var _0x4c680a=0x0,_0x10c881=_0x168f31['length'];_0x4c680a<_0x10c881;_0x4c680a++){if(!_0x445fd0[_0xac73('0x38')](_0x168f31[_0x4c680a][_0xac73('0x66')])){_0x445fd0[_0x168f31[_0x4c680a]['questionId']]=needsEncapsulation(_0x168f31[_0x4c680a][_0xac73('0x67')])?encapsulate(_0x168f31[_0x4c680a][_0xac73('0x67')]):_0x168f31[_0x4c680a]['question'];}}var _0x123029=[],_0x7b1423={};for(var _0x56a1ee=0x0,_0x407852=_0x557ac5[_0xac73('0x37')];_0x56a1ee<_0x407852;_0x56a1ee++){_0x7b1423={'ProjectId':_0x31ee4a[_0xac73('0x52')]['id'],'SessionId':_0x557ac5[_0x56a1ee]['id'],'StartTime':moment(_0x557ac5[_0x56a1ee][_0xac73('0x63')])[_0xac73('0x68')](_0xac73('0x69'))};for(var _0xaf3bb3=0x0,_0x481575=_0x168f31['length'];_0xaf3bb3<_0x481575;_0xaf3bb3++){if(_0x168f31[_0xaf3bb3][_0xac73('0x6a')]==_0x557ac5[_0x56a1ee]['id']&&_0x445fd0[_0xac73('0x38')](_0x168f31[_0xaf3bb3]['questionId'])){_0x7b1423[_0x445fd0[_0x168f31[_0xaf3bb3]['questionId']]]=_0x168f31[_0xaf3bb3][_0xac73('0x6b')];}}for(var _0x64ac58 in _0x445fd0){if(!_0x7b1423['hasOwnProperty'](_0x445fd0[_0x64ac58])){_0x7b1423[_0x445fd0[_0x64ac58]]=null;}}_0x123029[_0xac73('0x6c')](_0x7b1423);}return _0x123029;}})['then'](function(_0x5bc0b1){if(!_[_0xac73('0x6d')](_0x5bc0b1)){var _0x5f0f70=toCsv(_0x5bc0b1);var _0x3d8fdf=Date[_0xac73('0x6e')]();fs[_0xac73('0x6f')](util[_0xac73('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x31ee4a[_0xac73('0x52')]['id'],_0x3d8fdf),_0x5f0f70);_0x39445b[_0xac73('0x70')]('Content-disposition',_0xac73('0x71')+util[_0xac73('0x68')](_0xac73('0x72'),_0x31ee4a[_0xac73('0x52')]['id'],_0x3d8fdf));_0x39445b['setHeader']('Content-type',_0xac73('0x73'));return _0x39445b[_0xac73('0x74')](util['format'](_0xac73('0x75'),_0x31ee4a['params']['id'],_0x3d8fdf));}else{return _0x39445b['sendStatus'](0xcc);}})[_0xac73('0x40')](handleError(_0x39445b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 21ff978..cb7f17b 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cc8=['moment','bluebird','request-promise','rimraf','./jscriptyProject.attributes','JscriptyProject','jscripty_projects'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x1cc8,0x1ab));var _0x81cc=function(_0x42a331,_0x479404){_0x42a331=_0x42a331-0x0;var _0x1c6077=_0x1cc8[_0x42a331];return _0x1c6077;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x81cc('0x0'));var BPromise=require(_0x81cc('0x1'));var rp=require(_0x81cc('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81cc('0x3'));var config=require('../../config/environment');var attributes=require(_0x81cc('0x4'));module['exports']=function(_0x48fa88,_0x35daf5){return _0x48fa88['define'](_0x81cc('0x5'),attributes,{'tableName':_0x81cc('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf64b=['exports','define','lodash','util','api','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes'];(function(_0xe23db4,_0x125dd5){var _0x3906c2=function(_0x52dea2){while(--_0x52dea2){_0xe23db4['push'](_0xe23db4['shift']());}};_0x3906c2(++_0x125dd5);}(_0xf64b,0x188));var _0xbf64=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0xf64b[_0x13843f];return _0x1063ae;};'use strict';var _=require(_0xbf64('0x0'));var util=require(_0xbf64('0x1'));var logger=require('../../config/logger')(_0xbf64('0x2'));var moment=require('moment');var BPromise=require(_0xbf64('0x3'));var rp=require(_0xbf64('0x4'));var fs=require('fs');var path=require(_0xbf64('0x5'));var rimraf=require(_0xbf64('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf64('0x7'));module[_0xbf64('0x8')]=function(_0x9d50df,_0xf155e5){return _0x9d50df[_0xbf64('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index e00e944..b5a9c58 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ad8=['http','request','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x1ad8,0x172));var _0x81ad=function(_0x173b53,_0x30fb52){_0x173b53=_0x173b53-0x0;var _0x9c1a80=_0x1ad8[_0x173b53];return _0x9c1a80;};'use strict';var _=require(_0x81ad('0x0'));var util=require(_0x81ad('0x1'));var moment=require(_0x81ad('0x2'));var BPromise=require(_0x81ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x81ad('0x5'))(_0x81ad('0x6'));var config=require('../../config/environment');var jayson=require(_0x81ad('0x7'));var client=jayson['client'][_0x81ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x64f198,_0x4cea83,_0x244610){return new BPromise(function(_0x31134e,_0x55492e){return client[_0x81ad('0x9')](_0x64f198,_0x244610)[_0x81ad('0xa')](function(_0x4c7ce7){logger['info'](_0x81ad('0xb'),_0x4cea83,_0x81ad('0xc'));logger[_0x81ad('0xd')](_0x81ad('0xe'),_0x4cea83,_0x81ad('0xc'),JSON[_0x81ad('0xf')](_0x4c7ce7));if(_0x4c7ce7[_0x81ad('0x10')]){if(_0x4c7ce7[_0x81ad('0x10')][_0x81ad('0x11')]===0x1f4){logger[_0x81ad('0x10')](_0x81ad('0xb'),_0x4cea83,_0x4c7ce7['error']['message']);return _0x55492e(_0x4c7ce7['error'][_0x81ad('0x12')]);}logger[_0x81ad('0x10')](_0x81ad('0xb'),_0x4cea83,_0x4c7ce7[_0x81ad('0x10')]['message']);return _0x31134e(_0x4c7ce7[_0x81ad('0x10')][_0x81ad('0x12')]);}else{logger[_0x81ad('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x4cea83,_0x81ad('0xc'));_0x31134e(_0x4c7ce7['result'][_0x81ad('0x12')]);}})[_0x81ad('0x14')](function(_0x18bc2e){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4cea83,_0x18bc2e);_0x55492e(_0x18bc2e);});});} \ No newline at end of file +var _0x2844=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x40dfd9,_0x7fe907){var _0x387c19=function(_0x850e91){while(--_0x850e91){_0x40dfd9['push'](_0x40dfd9['shift']());}};_0x387c19(++_0x7fe907);}(_0x2844,0xef));var _0x4284=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x2844[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x4284('0x0'));var util=require(_0x4284('0x1'));var moment=require(_0x4284('0x2'));var BPromise=require(_0x4284('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4284('0x4'));var db=require(_0x4284('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4284('0x6'));var config=require(_0x4284('0x7'));var jayson=require(_0x4284('0x8'));var client=jayson[_0x4284('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xab6002,_0x4b8ba2,_0xd049c6){return new BPromise(function(_0x3f32fa,_0x27502f){return client[_0x4284('0xa')](_0xab6002,_0xd049c6)[_0x4284('0xb')](function(_0x36e273){logger[_0x4284('0xc')](_0x4284('0xd'),_0x4b8ba2,_0x4284('0xe'));logger[_0x4284('0xf')](_0x4284('0x10'),_0x4b8ba2,'request\x20sent',JSON[_0x4284('0x11')](_0x36e273));if(_0x36e273[_0x4284('0x12')]){if(_0x36e273[_0x4284('0x12')]['code']===0x1f4){logger[_0x4284('0x12')](_0x4284('0xd'),_0x4b8ba2,_0x36e273[_0x4284('0x12')]['message']);return _0x27502f(_0x36e273[_0x4284('0x12')][_0x4284('0x13')]);}logger[_0x4284('0x12')](_0x4284('0xd'),_0x4b8ba2,_0x36e273[_0x4284('0x12')][_0x4284('0x13')]);return _0x3f32fa(_0x36e273[_0x4284('0x12')][_0x4284('0x13')]);}else{logger[_0x4284('0xc')](_0x4284('0xd'),_0x4b8ba2,_0x4284('0xe'));_0x3f32fa(_0x36e273[_0x4284('0x14')]['message']);}})[_0x4284('0x15')](function(_0x5488e4){logger['error'](_0x4284('0xd'),_0x4b8ba2,_0x5488e4);_0x27502f(_0x5488e4);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 47bfdd1..7b2d61b 100644 --- a/server/api/jscriptyQuestionReport/index.js +++ b/server/api/jscriptyQuestionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd268=['put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','create'];(function(_0x39c0fe,_0x285b08){var _0x381a92=function(_0x11d10a){while(--_0x11d10a){_0x39c0fe['push'](_0x39c0fe['shift']());}};_0x381a92(++_0x285b08);}(_0xd268,0xab));var _0x8d26=function(_0x27b6df,_0xa944c5){_0x27b6df=_0x27b6df-0x0;var _0x473b8d=_0xd268[_0x27b6df];return _0x473b8d;};'use strict';var multer=require('multer');var util=require(_0x8d26('0x0'));var path=require('path');var timeout=require(_0x8d26('0x1'));var express=require('express');var router=express[_0x8d26('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x8d26('0x3'));var config=require('../../config/environment');var controller=require(_0x8d26('0x4'));router[_0x8d26('0x5')]('/',auth[_0x8d26('0x6')](),controller['index']);router[_0x8d26('0x5')](_0x8d26('0x7'),auth[_0x8d26('0x6')](),controller['describe']);router[_0x8d26('0x5')]('/:id',auth[_0x8d26('0x6')](),controller['show']);router['post']('/',auth[_0x8d26('0x6')](),controller[_0x8d26('0x8')]);router[_0x8d26('0x9')](_0x8d26('0xa'),auth[_0x8d26('0x6')](),controller[_0x8d26('0xb')]);router[_0x8d26('0xc')](_0x8d26('0xa'),auth[_0x8d26('0x6')](),controller[_0x8d26('0xd')]);module[_0x8d26('0xe')]=router; \ No newline at end of file +var _0xd55c=['/:id','show','post','create','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0xd55c,0x1ee));var _0xcd55=function(_0x44ecc5,_0x19285d){_0x44ecc5=_0x44ecc5-0x0;var _0x594b27=_0xd55c[_0x44ecc5];return _0x594b27;};'use strict';var multer=require('multer');var util=require(_0xcd55('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcd55('0x1'));var router=express[_0xcd55('0x2')]();var auth=require(_0xcd55('0x3'));var interaction=require(_0xcd55('0x4'));var config=require('../../config/environment');var controller=require(_0xcd55('0x5'));router[_0xcd55('0x6')]('/',auth[_0xcd55('0x7')](),controller[_0xcd55('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xcd55('0x9')]);router['get'](_0xcd55('0xa'),auth[_0xcd55('0x7')](),controller[_0xcd55('0xb')]);router[_0xcd55('0xc')]('/',auth[_0xcd55('0x7')](),controller[_0xcd55('0xd')]);router['put'](_0xcd55('0xa'),auth[_0xcd55('0x7')](),controller[_0xcd55('0xe')]);router[_0xcd55('0xf')](_0xcd55('0xa'),auth[_0xcd55('0x7')](),controller[_0xcd55('0x10')]);module[_0xcd55('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 270a911..8f59562 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x630e=['sequelize','exports','long','STRING'];(function(_0x2e84f6,_0x5354c8){var _0x59d210=function(_0x494b6e){while(--_0x494b6e){_0x2e84f6['push'](_0x2e84f6['shift']());}};_0x59d210(++_0x5354c8);}(_0x630e,0x1e4));var _0xe630=function(_0x514027,_0x16da6c){_0x514027=_0x514027-0x0;var _0x6a296a=_0x630e[_0x514027];return _0x6a296a;};'use strict';var Sequelize=require(_0xe630('0x0'));module[_0xe630('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT'](_0xe630('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe630('0x3')]},'calleridname':{'type':Sequelize[_0xe630('0x3')]},'calleridnum':{'type':Sequelize[_0xe630('0x3')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3f8f=['exports','STRING','TEXT','long'];(function(_0xe644b7,_0x3dd6d6){var _0x438743=function(_0x367f5e){while(--_0x367f5e){_0xe644b7['push'](_0xe644b7['shift']());}};_0x438743(++_0x3dd6d6);}(_0x3f8f,0xf0));var _0xf3f8=function(_0x114323,_0x48727c){_0x114323=_0x114323-0x0;var _0xec9a50=_0x3f8f[_0x114323];return _0xec9a50;};'use strict';var Sequelize=require('sequelize');module[_0xf3f8('0x0')]={'question':{'type':Sequelize[_0xf3f8('0x1')]},'answer':{'type':Sequelize[_0xf3f8('0x2')](_0xf3f8('0x3'))},'membername':{'type':Sequelize[_0xf3f8('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf3f8('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xf3f8('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 2b72741..87d5628 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfef5=['model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','include','JscriptyQuestionReport','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','stack','name','send','rawAttributes','fieldName','type','key'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xfef5,0x67));var _0x5fef=function(_0x539a28,_0x592515){_0x539a28=_0x539a28-0x0;var _0x2fce01=_0xfef5[_0x539a28];return _0x2fce01;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5fef('0x0'));var rimraf=require(_0x5fef('0x1'));var zipdir=require(_0x5fef('0x2'));var jsonpatch=require(_0x5fef('0x3'));var rp=require(_0x5fef('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5fef('0x5'));var util=require(_0x5fef('0x6'));var path=require(_0x5fef('0x7'));var sox=require(_0x5fef('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5fef('0x9'));var squel=require('squel');var crypto=require(_0x5fef('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5fef('0xb'));var toCsv=require(_0x5fef('0xc'));var querystring=require(_0x5fef('0xd'));var Papa=require(_0x5fef('0xe'));var Redis=require(_0x5fef('0xf'));var authService=require(_0x5fef('0x10'));var qs=require(_0x5fef('0x11'));var as=require(_0x5fef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5fef('0x13'));var utils=require(_0x5fef('0x14'));var config=require('../../config/environment');var db=require(_0x5fef('0x15'))['db'];function respondWithStatusCode(_0x56f7bd,_0x4a8257){_0x4a8257=_0x4a8257||0xcc;return function(_0x1889d3){if(_0x1889d3){return _0x56f7bd[_0x5fef('0x16')](_0x4a8257);}return _0x56f7bd[_0x5fef('0x17')](_0x4a8257)[_0x5fef('0x18')]();};}function respondWithResult(_0x3ea1e4,_0x495303){_0x495303=_0x495303||0xc8;return function(_0x545dde){if(_0x545dde){return _0x3ea1e4[_0x5fef('0x17')](_0x495303)[_0x5fef('0x19')](_0x545dde);}};}function respondWithFilteredResult(_0x3d5a20,_0x49888d){return function(_0x1bde04){if(_0x1bde04){var _0x50e81b=_0x1bde04[_0x5fef('0x1a')],_0x4e72c9=_0x49888d['offset'],_0x262d45=_0x49888d[_0x5fef('0x1b')]+_0x49888d[_0x5fef('0x1c')],_0x259a2d;if(_0x262d45>=_0x50e81b){_0x262d45=_0x50e81b;_0x259a2d=0xc8;}else{_0x259a2d=0xce;}_0x3d5a20[_0x5fef('0x17')](_0x259a2d);return _0x3d5a20['set'](_0x5fef('0x1d'),_0x4e72c9+'-'+_0x262d45+'/'+_0x50e81b)['json'](_0x1bde04);}return null;};}function patchUpdates(_0x542cda){return function(_0x5d609a){try{jsonpatch[_0x5fef('0x1e')](_0x5d609a,_0x542cda,!![]);}catch(_0x18f0c9){return BPromise['reject'](_0x18f0c9);}return _0x5d609a[_0x5fef('0x1f')]();};}function saveUpdates(_0x4efe92,_0x3d6f16){return function(_0x3801fa){if(_0x3801fa){return _0x3801fa[_0x5fef('0x20')](_0x4efe92)[_0x5fef('0x21')](function(_0x7b7dd8){return _0x7b7dd8;});}return null;};}function removeEntity(_0x285924,_0x373d0f){return function(_0x30dcea){if(_0x30dcea){return _0x30dcea['destroy']()['then'](function(){_0x285924[_0x5fef('0x17')](0xcc)[_0x5fef('0x18')]();});}};}function handleEntityNotFound(_0x4b90a2,_0x232bff){return function(_0x3ccd02){if(!_0x3ccd02){_0x4b90a2[_0x5fef('0x16')](0x194);}return _0x3ccd02;};}function handleError(_0x25fd42,_0x548718){_0x548718=_0x548718||0x1f4;return function(_0x47e77e){logger['error'](_0x47e77e[_0x5fef('0x22')]);if(_0x47e77e[_0x5fef('0x23')]){delete _0x47e77e['name'];}_0x25fd42[_0x5fef('0x17')](_0x548718)[_0x5fef('0x24')](_0x47e77e);};}exports['index']=function(_0x24c27b,_0x4588b2){var _0x4a9c59={},_0x1db214={},_0x97ef06={'count':0x0,'rows':[]};var _0x4ef831=_['map'](db['JscriptyQuestionReport'][_0x5fef('0x25')],function(_0x4dd6f3){return{'name':_0x4dd6f3[_0x5fef('0x26')],'type':_0x4dd6f3[_0x5fef('0x27')][_0x5fef('0x28')]};});_0x1db214[_0x5fef('0x29')]=_[_0x5fef('0x2a')](_0x4ef831,_0x5fef('0x23'));_0x1db214[_0x5fef('0x2b')]=_['keys'](_0x24c27b[_0x5fef('0x2b')]);_0x1db214[_0x5fef('0x2c')]=_[_0x5fef('0x2d')](_0x1db214[_0x5fef('0x29')],_0x1db214[_0x5fef('0x2b')]);_0x4a9c59[_0x5fef('0x2e')]=_[_0x5fef('0x2d')](_0x1db214[_0x5fef('0x29')],qs['fields'](_0x24c27b[_0x5fef('0x2b')][_0x5fef('0x2f')]));_0x4a9c59[_0x5fef('0x2e')]=_0x4a9c59[_0x5fef('0x2e')]['length']?_0x4a9c59['attributes']:_0x1db214['model'];if(!_0x24c27b[_0x5fef('0x2b')][_0x5fef('0x30')](_0x5fef('0x31'))){_0x4a9c59[_0x5fef('0x1c')]=qs[_0x5fef('0x1c')](_0x24c27b[_0x5fef('0x2b')][_0x5fef('0x1c')]);_0x4a9c59['offset']=qs[_0x5fef('0x1b')](_0x24c27b[_0x5fef('0x2b')]['offset']);}_0x4a9c59['order']=qs[_0x5fef('0x32')](_0x24c27b[_0x5fef('0x2b')][_0x5fef('0x32')]);_0x4a9c59['where']=qs[_0x5fef('0x2c')](_[_0x5fef('0x33')](_0x24c27b['query'],_0x1db214['filters']));if(_0x24c27b['query'][_0x5fef('0x34')]){_0x4a9c59['where']=_[_0x5fef('0x35')](_0x4a9c59[_0x5fef('0x36')],{'$or':_['map'](_0x4ef831,function(_0x449aa0){if(_0x449aa0['type']!==_0x5fef('0x37')){var _0x5143bc={};_0x5143bc[_0x449aa0[_0x5fef('0x23')]]={'$like':'%'+_0x24c27b[_0x5fef('0x2b')][_0x5fef('0x34')]+'%'};return _0x5143bc;}})});}_0x4a9c59=_['merge']({},_0x4a9c59,_0x24c27b[_0x5fef('0x38')]);var _0x5ecb04={'where':_0x4a9c59['where']};return db['JscriptyQuestionReport'][_0x5fef('0x1a')](_0x5ecb04)['then'](function(_0xad8232){_0x97ef06[_0x5fef('0x1a')]=_0xad8232;if(_0x24c27b['query']['includeAll']){_0x4a9c59[_0x5fef('0x39')]=[{'all':!![]}];}return db[_0x5fef('0x3a')][_0x5fef('0x3b')](_0x4a9c59);})[_0x5fef('0x21')](function(_0x2bb674){_0x97ef06[_0x5fef('0x3c')]=_0x2bb674;return _0x97ef06;})[_0x5fef('0x21')](respondWithFilteredResult(_0x4588b2,_0x4a9c59))[_0x5fef('0x3d')](handleError(_0x4588b2,null));};exports[_0x5fef('0x3e')]=function(_0x28bf55,_0x57419a){var _0xff3d3e={'raw':!![],'where':{'id':_0x28bf55[_0x5fef('0x3f')]['id']}},_0x2514ff={};_0x2514ff[_0x5fef('0x29')]=_[_0x5fef('0x40')](db['JscriptyQuestionReport']['rawAttributes']);_0x2514ff[_0x5fef('0x2b')]=_[_0x5fef('0x40')](_0x28bf55['query']);_0x2514ff[_0x5fef('0x2c')]=_['intersection'](_0x2514ff[_0x5fef('0x29')],_0x2514ff[_0x5fef('0x2b')]);_0xff3d3e[_0x5fef('0x2e')]=_[_0x5fef('0x2d')](_0x2514ff[_0x5fef('0x29')],qs[_0x5fef('0x2f')](_0x28bf55['query'][_0x5fef('0x2f')]));_0xff3d3e[_0x5fef('0x2e')]=_0xff3d3e[_0x5fef('0x2e')][_0x5fef('0x41')]?_0xff3d3e[_0x5fef('0x2e')]:_0x2514ff[_0x5fef('0x29')];if(_0x28bf55['query'][_0x5fef('0x42')]){_0xff3d3e[_0x5fef('0x39')]=[{'all':!![]}];}_0xff3d3e=_[_0x5fef('0x35')]({},_0xff3d3e,_0x28bf55[_0x5fef('0x38')]);return db[_0x5fef('0x3a')][_0x5fef('0x43')](_0xff3d3e)['then'](handleEntityNotFound(_0x57419a,null))[_0x5fef('0x21')](respondWithResult(_0x57419a,null))[_0x5fef('0x3d')](handleError(_0x57419a,null));};exports[_0x5fef('0x44')]=function(_0x419f63,_0x179053){return db['JscriptyQuestionReport'][_0x5fef('0x44')](_0x419f63[_0x5fef('0x45')],{})[_0x5fef('0x21')](respondWithResult(_0x179053,0xc9))['catch'](handleError(_0x179053,null));};exports[_0x5fef('0x20')]=function(_0x1eec51,_0x209c5){if(_0x1eec51[_0x5fef('0x45')]['id']){delete _0x1eec51['body']['id'];}return db[_0x5fef('0x3a')]['find']({'where':{'id':_0x1eec51['params']['id']}})[_0x5fef('0x21')](handleEntityNotFound(_0x209c5,null))[_0x5fef('0x21')](saveUpdates(_0x1eec51[_0x5fef('0x45')],null))['then'](respondWithResult(_0x209c5,null))[_0x5fef('0x3d')](handleError(_0x209c5,null));};exports[_0x5fef('0x46')]=function(_0x7493b6,_0x1fc6a9){return db[_0x5fef('0x3a')][_0x5fef('0x43')]({'where':{'id':_0x7493b6['params']['id']}})[_0x5fef('0x21')](handleEntityNotFound(_0x1fc6a9,null))[_0x5fef('0x21')](removeEntity(_0x1fc6a9,null))[_0x5fef('0x3d')](handleError(_0x1fc6a9,null));};exports['describe']=function(_0x402233,_0x37984a){return db['JscriptyQuestionReport'][_0x5fef('0x47')]()[_0x5fef('0x21')](respondWithResult(_0x37984a,null))[_0x5fef('0x3d')](handleError(_0x37984a,null));}; \ No newline at end of file +var _0x57c5=['model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','type','filter','options','JscriptyQuestionReport','count','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','describe','html-pdf','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','key'];(function(_0x13869e,_0x1f3ac6){var _0x1462dd=function(_0xae33c9){while(--_0xae33c9){_0x13869e['push'](_0x13869e['shift']());}};_0x1462dd(++_0x1f3ac6);}(_0x57c5,0x65));var _0x557c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x57c5[_0x4b369d];return _0x571a98;};'use strict';var pdf=require(_0x557c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x557c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x557c('0x2'));var moment=require('moment');var BPromise=require(_0x557c('0x3'));var Mustache=require(_0x557c('0x4'));var util=require(_0x557c('0x5'));var path=require(_0x557c('0x6'));var sox=require('sox');var csv=require(_0x557c('0x7'));var ejs=require(_0x557c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x557c('0x9'));var crypto=require(_0x557c('0xa'));var jsforce=require(_0x557c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x557c('0xc'));var Papa=require(_0x557c('0xd'));var Redis=require(_0x557c('0xe'));var authService=require(_0x557c('0xf'));var qs=require(_0x557c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x557c('0x11'))(_0x557c('0x12'));var utils=require(_0x557c('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x547b50,_0x31c9b7){_0x31c9b7=_0x31c9b7||0xcc;return function(_0x5c1bdf){if(_0x5c1bdf){return _0x547b50[_0x557c('0x14')](_0x31c9b7);}return _0x547b50[_0x557c('0x15')](_0x31c9b7)[_0x557c('0x16')]();};}function respondWithResult(_0x21b9a3,_0x3a0175){_0x3a0175=_0x3a0175||0xc8;return function(_0x40551d){if(_0x40551d){return _0x21b9a3[_0x557c('0x15')](_0x3a0175)['json'](_0x40551d);}};}function respondWithFilteredResult(_0x303371,_0xe3c60f){return function(_0x478306){if(_0x478306){var _0x38e0e5=_0x478306['count'],_0x1f63f2=_0xe3c60f[_0x557c('0x17')],_0x2ec0f7=_0xe3c60f[_0x557c('0x17')]+_0xe3c60f['limit'],_0x3df64c;if(_0x2ec0f7>=_0x38e0e5){_0x2ec0f7=_0x38e0e5;_0x3df64c=0xc8;}else{_0x3df64c=0xce;}_0x303371[_0x557c('0x15')](_0x3df64c);return _0x303371[_0x557c('0x18')](_0x557c('0x19'),_0x1f63f2+'-'+_0x2ec0f7+'/'+_0x38e0e5)['json'](_0x478306);}return null;};}function patchUpdates(_0x1b888c){return function(_0x50ed66){try{jsonpatch[_0x557c('0x1a')](_0x50ed66,_0x1b888c,!![]);}catch(_0x3d5981){return BPromise[_0x557c('0x1b')](_0x3d5981);}return _0x50ed66[_0x557c('0x1c')]();};}function saveUpdates(_0x5c3f25,_0x1ebbcb){return function(_0x4675ed){if(_0x4675ed){return _0x4675ed[_0x557c('0x1d')](_0x5c3f25)[_0x557c('0x1e')](function(_0x1922ba){return _0x1922ba;});}return null;};}function removeEntity(_0x295ec3,_0x4d48d9){return function(_0x1d0c66){if(_0x1d0c66){return _0x1d0c66[_0x557c('0x1f')]()[_0x557c('0x1e')](function(){_0x295ec3[_0x557c('0x15')](0xcc)[_0x557c('0x16')]();});}};}function handleEntityNotFound(_0x23e05a,_0x1ea587){return function(_0x1381a0){if(!_0x1381a0){_0x23e05a[_0x557c('0x14')](0x194);}return _0x1381a0;};}function handleError(_0x585de8,_0x283f93){_0x283f93=_0x283f93||0x1f4;return function(_0x30de20){logger['error'](_0x30de20[_0x557c('0x20')]);if(_0x30de20['name']){delete _0x30de20[_0x557c('0x21')];}_0x585de8[_0x557c('0x15')](_0x283f93)[_0x557c('0x22')](_0x30de20);};}exports[_0x557c('0x23')]=function(_0x50a577,_0x231bc7){var _0x2a3653={},_0x3c1067={},_0x318999={'count':0x0,'rows':[]};var _0x486430=_[_0x557c('0x24')](db['JscriptyQuestionReport']['rawAttributes'],function(_0xdb5f4d){return{'name':_0xdb5f4d[_0x557c('0x25')],'type':_0xdb5f4d['type'][_0x557c('0x26')]};});_0x3c1067[_0x557c('0x27')]=_[_0x557c('0x24')](_0x486430,_0x557c('0x21'));_0x3c1067['query']=_[_0x557c('0x28')](_0x50a577[_0x557c('0x29')]);_0x3c1067['filters']=_[_0x557c('0x2a')](_0x3c1067[_0x557c('0x27')],_0x3c1067[_0x557c('0x29')]);_0x2a3653['attributes']=_[_0x557c('0x2a')](_0x3c1067[_0x557c('0x27')],qs[_0x557c('0x2b')](_0x50a577[_0x557c('0x29')][_0x557c('0x2b')]));_0x2a3653['attributes']=_0x2a3653['attributes'][_0x557c('0x2c')]?_0x2a3653[_0x557c('0x2d')]:_0x3c1067[_0x557c('0x27')];if(!_0x50a577['query'][_0x557c('0x2e')](_0x557c('0x2f'))){_0x2a3653['limit']=qs[_0x557c('0x30')](_0x50a577['query'][_0x557c('0x30')]);_0x2a3653[_0x557c('0x17')]=qs['offset'](_0x50a577[_0x557c('0x29')][_0x557c('0x17')]);}_0x2a3653[_0x557c('0x31')]=qs[_0x557c('0x32')](_0x50a577[_0x557c('0x29')]['sort']);_0x2a3653[_0x557c('0x33')]=qs[_0x557c('0x34')](_['pick'](_0x50a577[_0x557c('0x29')],_0x3c1067[_0x557c('0x34')]));if(_0x50a577[_0x557c('0x29')]['filter']){_0x2a3653['where']=_[_0x557c('0x35')](_0x2a3653[_0x557c('0x33')],{'$or':_[_0x557c('0x24')](_0x486430,function(_0x4edf5f){if(_0x4edf5f[_0x557c('0x36')]!=='VIRTUAL'){var _0x13bc66={};_0x13bc66[_0x4edf5f[_0x557c('0x21')]]={'$like':'%'+_0x50a577[_0x557c('0x29')][_0x557c('0x37')]+'%'};return _0x13bc66;}})});}_0x2a3653=_[_0x557c('0x35')]({},_0x2a3653,_0x50a577[_0x557c('0x38')]);var _0x4a82c8={'where':_0x2a3653['where']};return db[_0x557c('0x39')][_0x557c('0x3a')](_0x4a82c8)[_0x557c('0x1e')](function(_0x208a9f){_0x318999[_0x557c('0x3a')]=_0x208a9f;if(_0x50a577[_0x557c('0x29')]['includeAll']){_0x2a3653[_0x557c('0x3b')]=[{'all':!![]}];}return db[_0x557c('0x39')][_0x557c('0x3c')](_0x2a3653);})['then'](function(_0x2764df){_0x318999['rows']=_0x2764df;return _0x318999;})['then'](respondWithFilteredResult(_0x231bc7,_0x2a3653))[_0x557c('0x3d')](handleError(_0x231bc7,null));};exports[_0x557c('0x3e')]=function(_0x510d93,_0x24d7d1){var _0x394bdb={'raw':!![],'where':{'id':_0x510d93[_0x557c('0x3f')]['id']}},_0xb64c50={};_0xb64c50[_0x557c('0x27')]=_[_0x557c('0x28')](db['JscriptyQuestionReport'][_0x557c('0x40')]);_0xb64c50[_0x557c('0x29')]=_[_0x557c('0x28')](_0x510d93[_0x557c('0x29')]);_0xb64c50[_0x557c('0x34')]=_[_0x557c('0x2a')](_0xb64c50['model'],_0xb64c50[_0x557c('0x29')]);_0x394bdb[_0x557c('0x2d')]=_['intersection'](_0xb64c50['model'],qs[_0x557c('0x2b')](_0x510d93['query'][_0x557c('0x2b')]));_0x394bdb['attributes']=_0x394bdb[_0x557c('0x2d')][_0x557c('0x2c')]?_0x394bdb[_0x557c('0x2d')]:_0xb64c50[_0x557c('0x27')];if(_0x510d93['query'][_0x557c('0x41')]){_0x394bdb[_0x557c('0x3b')]=[{'all':!![]}];}_0x394bdb=_[_0x557c('0x35')]({},_0x394bdb,_0x510d93['options']);return db[_0x557c('0x39')][_0x557c('0x42')](_0x394bdb)[_0x557c('0x1e')](handleEntityNotFound(_0x24d7d1,null))[_0x557c('0x1e')](respondWithResult(_0x24d7d1,null))[_0x557c('0x3d')](handleError(_0x24d7d1,null));};exports[_0x557c('0x43')]=function(_0x5e5581,_0x80d1a0){return db[_0x557c('0x39')][_0x557c('0x43')](_0x5e5581[_0x557c('0x44')],{})[_0x557c('0x1e')](respondWithResult(_0x80d1a0,0xc9))[_0x557c('0x3d')](handleError(_0x80d1a0,null));};exports[_0x557c('0x1d')]=function(_0x5b52c2,_0x37e5a0){if(_0x5b52c2[_0x557c('0x44')]['id']){delete _0x5b52c2['body']['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x5b52c2[_0x557c('0x3f')]['id']}})[_0x557c('0x1e')](handleEntityNotFound(_0x37e5a0,null))[_0x557c('0x1e')](saveUpdates(_0x5b52c2['body'],null))[_0x557c('0x1e')](respondWithResult(_0x37e5a0,null))[_0x557c('0x3d')](handleError(_0x37e5a0,null));};exports[_0x557c('0x1f')]=function(_0x2f8fe8,_0x2a0aa2){return db[_0x557c('0x39')][_0x557c('0x42')]({'where':{'id':_0x2f8fe8[_0x557c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a0aa2,null))[_0x557c('0x1e')](removeEntity(_0x2a0aa2,null))['catch'](handleError(_0x2a0aa2,null));};exports['describe']=function(_0x1c1cc9,_0x510077){return db[_0x557c('0x39')][_0x557c('0x45')]()['then'](respondWithResult(_0x510077,null))[_0x557c('0x3d')](handleError(_0x510077,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 8dece3b..100d931 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x413a=['JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x4902b2,_0x2aa573){var _0xafeb15=function(_0x3d212c){while(--_0x3d212c){_0x4902b2['push'](_0x4902b2['shift']());}};_0xafeb15(++_0x2aa573);}(_0x413a,0x1ba));var _0xa413=function(_0x290e47,_0x589056){_0x290e47=_0x290e47-0x0;var _0x42162f=_0x413a[_0x290e47];return _0x42162f;};'use strict';var _=require(_0xa413('0x0'));var util=require('util');var logger=require(_0xa413('0x1'))(_0xa413('0x2'));var moment=require(_0xa413('0x3'));var BPromise=require(_0xa413('0x4'));var rp=require(_0xa413('0x5'));var fs=require('fs');var path=require(_0xa413('0x6'));var rimraf=require('rimraf');var config=require(_0xa413('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xa413('0x8')]=function(_0x43eb5a,_0x374280){return _0x43eb5a['define'](_0xa413('0x9'),attributes,{'tableName':_0xa413('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8b8=['rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','../../config/logger','api','moment','request-promise'];(function(_0x152678,_0x11e0ac){var _0x311a9=function(_0x4f5291){while(--_0x4f5291){_0x152678['push'](_0x152678['shift']());}};_0x311a9(++_0x11e0ac);}(_0xc8b8,0x19d));var _0x8c8b=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xc8b8[_0x2f6f50];return _0x2cf365;};'use strict';var _=require(_0x8c8b('0x0'));var util=require('util');var logger=require(_0x8c8b('0x1'))(_0x8c8b('0x2'));var moment=require(_0x8c8b('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c8b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c8b('0x5'));var config=require(_0x8c8b('0x6'));var attributes=require(_0x8c8b('0x7'));module[_0x8c8b('0x8')]=function(_0x83b06e,_0x4430f3){return _0x83b06e[_0x8c8b('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x8c8b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index cf08b0c..bd993e4 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcab=['util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x1919de,_0x4ed1ba){var _0x16ecd9=function(_0x48a062){while(--_0x48a062){_0x1919de['push'](_0x1919de['shift']());}};_0x16ecd9(++_0x4ed1ba);}(_0xdcab,0xa7));var _0xbdca=function(_0x4e8e1a,_0x15fb8d){_0x4e8e1a=_0x4e8e1a-0x0;var _0x2f9469=_0xdcab[_0x4e8e1a];return _0x2f9469;};'use strict';var _=require(_0xbdca('0x0'));var util=require(_0xbdca('0x1'));var moment=require(_0xbdca('0x2'));var BPromise=require(_0xbdca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdca('0x4'));var db=require(_0xbdca('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbdca('0x6'));var config=require(_0xbdca('0x7'));var jayson=require(_0xbdca('0x8'));var client=jayson[_0xbdca('0x9')][_0xbdca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2568e9,_0x22626e,_0xaa5160){return new BPromise(function(_0x55446f,_0x4dd8b7){return client[_0xbdca('0xb')](_0x2568e9,_0xaa5160)[_0xbdca('0xc')](function(_0xbdf605){logger[_0xbdca('0xd')](_0xbdca('0xe'),_0x22626e,_0xbdca('0xf'));logger['debug'](_0xbdca('0x10'),_0x22626e,_0xbdca('0xf'),JSON['stringify'](_0xbdf605));if(_0xbdf605[_0xbdca('0x11')]){if(_0xbdf605[_0xbdca('0x11')][_0xbdca('0x12')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x22626e,_0xbdf605['error'][_0xbdca('0x13')]);return _0x4dd8b7(_0xbdf605[_0xbdca('0x11')]['message']);}logger[_0xbdca('0x11')](_0xbdca('0xe'),_0x22626e,_0xbdf605['error'][_0xbdca('0x13')]);return _0x55446f(_0xbdf605[_0xbdca('0x11')][_0xbdca('0x13')]);}else{logger['info'](_0xbdca('0xe'),_0x22626e,_0xbdca('0xf'));_0x55446f(_0xbdf605[_0xbdca('0x14')][_0xbdca('0x13')]);}})['catch'](function(_0x5bcf8a){logger[_0xbdca('0x11')](_0xbdca('0xe'),_0x22626e,_0x5bcf8a);_0x4dd8b7(_0x5bcf8a);});});} \ No newline at end of file +var _0x995d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x995d,0x138));var _0xd995=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x995d[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0xd995('0x0'));var util=require(_0xd995('0x1'));var moment=require(_0xd995('0x2'));var BPromise=require(_0xd995('0x3'));var rs=require(_0xd995('0x4'));var fs=require('fs');var Redis=require(_0xd995('0x5'));var db=require(_0xd995('0x6'))['db'];var utils=require(_0xd995('0x7'));var logger=require(_0xd995('0x8'))(_0xd995('0x9'));var config=require(_0xd995('0xa'));var jayson=require(_0xd995('0xb'));var client=jayson[_0xd995('0xc')][_0xd995('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x12d6a4,_0x49f363,_0x1e4b30){return new BPromise(function(_0x1f20f5,_0x5ed7d1){return client['request'](_0x12d6a4,_0x1e4b30)['then'](function(_0x3efb6c){logger['info'](_0xd995('0xe'),_0x49f363,_0xd995('0xf'));logger['debug'](_0xd995('0x10'),_0x49f363,_0xd995('0xf'),JSON[_0xd995('0x11')](_0x3efb6c));if(_0x3efb6c[_0xd995('0x12')]){if(_0x3efb6c[_0xd995('0x12')][_0xd995('0x13')]===0x1f4){logger['error'](_0xd995('0xe'),_0x49f363,_0x3efb6c[_0xd995('0x12')][_0xd995('0x14')]);return _0x5ed7d1(_0x3efb6c[_0xd995('0x12')][_0xd995('0x14')]);}logger[_0xd995('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x49f363,_0x3efb6c['error'][_0xd995('0x14')]);return _0x1f20f5(_0x3efb6c['error'][_0xd995('0x14')]);}else{logger[_0xd995('0x15')](_0xd995('0xe'),_0x49f363,'request\x20sent');_0x1f20f5(_0x3efb6c[_0xd995('0x16')][_0xd995('0x14')]);}})[_0xd995('0x17')](function(_0x5b034d){logger[_0xd995('0x12')](_0xd995('0xe'),_0x49f363,_0x5b034d);_0x5ed7d1(_0x5b034d);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index b089e14..b452ee9 100644 --- a/server/api/jscriptySessionReport/index.js +++ b/server/api/jscriptySessionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa631=['get','isAuthenticated','describe','show','/:id/questions','getQuestions','create','put','/:id','update','delete','destroy','util','path','connect-timeout','Router','../../config/environment','./jscriptySessionReport.controller'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0xa631,0xe4));var _0x1a63=function(_0x174a73,_0x19b20a){_0x174a73=_0x174a73-0x0;var _0x4a39b3=_0xa631[_0x174a73];return _0x4a39b3;};'use strict';var multer=require('multer');var util=require(_0x1a63('0x0'));var path=require(_0x1a63('0x1'));var timeout=require(_0x1a63('0x2'));var express=require('express');var router=express[_0x1a63('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a63('0x4'));var controller=require(_0x1a63('0x5'));router[_0x1a63('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x1a63('0x7')](),controller[_0x1a63('0x8')]);router[_0x1a63('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x1a63('0x9')]);router[_0x1a63('0x6')](_0x1a63('0xa'),auth[_0x1a63('0x7')](),controller[_0x1a63('0xb')]);router['post']('/',auth[_0x1a63('0x7')](),controller[_0x1a63('0xc')]);router[_0x1a63('0xd')](_0x1a63('0xe'),auth['isAuthenticated'](),controller[_0x1a63('0xf')]);router[_0x1a63('0x10')](_0x1a63('0xe'),auth['isAuthenticated'](),controller[_0x1a63('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf873=['../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xf873,0xb2));var _0x3f87=function(_0x419e4b,_0x285904){_0x419e4b=_0x419e4b-0x0;var _0x170c95=_0xf873[_0x419e4b];return _0x170c95;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var auth=require(_0x3f87('0x5'));var interaction=require(_0x3f87('0x6'));var config=require(_0x3f87('0x7'));var controller=require(_0x3f87('0x8'));router['get']('/',auth[_0x3f87('0x9')](),controller[_0x3f87('0xa')]);router[_0x3f87('0xb')]('/describe',auth[_0x3f87('0x9')](),controller[_0x3f87('0xc')]);router[_0x3f87('0xb')](_0x3f87('0xd'),auth[_0x3f87('0x9')](),controller[_0x3f87('0xe')]);router['get'](_0x3f87('0xf'),auth[_0x3f87('0x9')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')]('/',auth[_0x3f87('0x9')](),controller[_0x3f87('0x12')]);router[_0x3f87('0x13')](_0x3f87('0xd'),auth[_0x3f87('0x9')](),controller[_0x3f87('0x14')]);router[_0x3f87('0x15')](_0x3f87('0xd'),auth[_0x3f87('0x9')](),controller[_0x3f87('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index aa496c8..39abca4 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bd1=['format','STRING','sequelize','DATE','setDataValue','starttime'];(function(_0x48c7c1,_0x256827){var _0x11701d=function(_0x5e4204){while(--_0x5e4204){_0x48c7c1['push'](_0x48c7c1['shift']());}};_0x11701d(++_0x256827);}(_0x9bd1,0x194));var _0x19bd=function(_0x1f5c64,_0x4cc38a){_0x1f5c64=_0x1f5c64-0x0;var _0x44a30e=_0x9bd1[_0x1f5c64];return _0x44a30e;};'use strict';var moment=require('moment');var Sequelize=require(_0x19bd('0x0'));module['exports']={'starttime':{'type':Sequelize[_0x19bd('0x1')],'set':function(_0x1088ad){this[_0x19bd('0x2')](_0x19bd('0x3'),_0x1088ad);this[_0x19bd('0x2')]('endtime',moment()[_0x19bd('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x19bd('0x1')]},'membername':{'type':Sequelize[_0x19bd('0x5')]},'projectname':{'type':Sequelize[_0x19bd('0x5')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x19bd('0x5')]},'calleridname':{'type':Sequelize[_0x19bd('0x5')]},'calleridnum':{'type':Sequelize[_0x19bd('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3039=['DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','exports'];(function(_0xbc9917,_0x479324){var _0x20ab5a=function(_0x43951d){while(--_0x43951d){_0xbc9917['push'](_0xbc9917['shift']());}};_0x20ab5a(++_0x479324);}(_0x3039,0x6b));var _0x9303=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3039[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9303('0x0')]={'starttime':{'type':Sequelize[_0x9303('0x1')],'set':function(_0xd4f567){this[_0x9303('0x2')](_0x9303('0x3'),_0xd4f567);this[_0x9303('0x2')](_0x9303('0x4'),moment()[_0x9303('0x5')](_0x9303('0x6')));}},'endtime':{'type':Sequelize[_0x9303('0x1')]},'membername':{'type':Sequelize[_0x9303('0x7')]},'projectname':{'type':Sequelize[_0x9303('0x7')]},'queue':{'type':Sequelize[_0x9303('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9303('0x7')]},'completed':{'type':Sequelize[_0x9303('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 551785a..ea984fa 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe52c=['set','json','apply','save','update','then','error','name','send','index','map','JscriptySessionReport','fieldName','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','intersection','find','create','body','describe','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','end','count','offset','limit'];(function(_0x3bfeda,_0x564686){var _0xe778b1=function(_0x54f76e){while(--_0x54f76e){_0x3bfeda['push'](_0x3bfeda['shift']());}};_0xe778b1(++_0x564686);}(_0xe52c,0x10f));var _0xce52=function(_0x193a49,_0x1a62a2){_0x193a49=_0x193a49-0x0;var _0x3c268c=_0xe52c[_0x193a49];return _0x3c268c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xce52('0x0'));var rimraf=require(_0xce52('0x1'));var zipdir=require(_0xce52('0x2'));var jsonpatch=require(_0xce52('0x3'));var rp=require(_0xce52('0x4'));var moment=require(_0xce52('0x5'));var BPromise=require(_0xce52('0x6'));var Mustache=require('mustache');var util=require(_0xce52('0x7'));var path=require(_0xce52('0x8'));var sox=require(_0xce52('0x9'));var csv=require(_0xce52('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xce52('0xb'));var squel=require(_0xce52('0xc'));var crypto=require(_0xce52('0xd'));var jsforce=require(_0xce52('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce52('0xa'));var querystring=require(_0xce52('0xf'));var Papa=require(_0xce52('0x10'));var Redis=require(_0xce52('0x11'));var authService=require(_0xce52('0x12'));var qs=require(_0xce52('0x13'));var as=require(_0xce52('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce52('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xce52('0x16'))['db'];function respondWithStatusCode(_0x34ea5b,_0xf58587){_0xf58587=_0xf58587||0xcc;return function(_0x26d697){if(_0x26d697){return _0x34ea5b[_0xce52('0x17')](_0xf58587);}return _0x34ea5b[_0xce52('0x18')](_0xf58587)[_0xce52('0x19')]();};}function respondWithResult(_0x44cbf5,_0x390a1f){_0x390a1f=_0x390a1f||0xc8;return function(_0x2ef77c){if(_0x2ef77c){return _0x44cbf5[_0xce52('0x18')](_0x390a1f)['json'](_0x2ef77c);}};}function respondWithFilteredResult(_0x3de1bb,_0x194359){return function(_0x1bb4c6){if(_0x1bb4c6){var _0x1909e4=_0x1bb4c6[_0xce52('0x1a')],_0x216a6b=_0x194359[_0xce52('0x1b')],_0x5ea51f=_0x194359[_0xce52('0x1b')]+_0x194359[_0xce52('0x1c')],_0x10f3bd;if(_0x5ea51f>=_0x1909e4){_0x5ea51f=_0x1909e4;_0x10f3bd=0xc8;}else{_0x10f3bd=0xce;}_0x3de1bb[_0xce52('0x18')](_0x10f3bd);return _0x3de1bb[_0xce52('0x1d')]('Content-Range',_0x216a6b+'-'+_0x5ea51f+'/'+_0x1909e4)[_0xce52('0x1e')](_0x1bb4c6);}return null;};}function patchUpdates(_0xd4dd1b){return function(_0x500fbc){try{jsonpatch[_0xce52('0x1f')](_0x500fbc,_0xd4dd1b,!![]);}catch(_0x56e467){return BPromise['reject'](_0x56e467);}return _0x500fbc[_0xce52('0x20')]();};}function saveUpdates(_0x7e936e,_0x115cc0){return function(_0x4259ce){if(_0x4259ce){return _0x4259ce[_0xce52('0x21')](_0x7e936e)[_0xce52('0x22')](function(_0x42f074){return _0x42f074;});}return null;};}function removeEntity(_0x5c3bfe,_0x4a5fd3){return function(_0x16a28d){if(_0x16a28d){return _0x16a28d['destroy']()[_0xce52('0x22')](function(){_0x5c3bfe[_0xce52('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x139b29,_0x59bde6){return function(_0x3ed0e5){if(!_0x3ed0e5){_0x139b29[_0xce52('0x17')](0x194);}return _0x3ed0e5;};}function handleError(_0x211a25,_0x4ce31f){_0x4ce31f=_0x4ce31f||0x1f4;return function(_0x45026b){logger[_0xce52('0x23')](_0x45026b['stack']);if(_0x45026b[_0xce52('0x24')]){delete _0x45026b[_0xce52('0x24')];}_0x211a25[_0xce52('0x18')](_0x4ce31f)[_0xce52('0x25')](_0x45026b);};}exports[_0xce52('0x26')]=function(_0x447e1d,_0x3cf077){var _0x35f45b={},_0x13ba12={},_0x571656={'count':0x0,'rows':[]};var _0x4714f3=_[_0xce52('0x27')](db[_0xce52('0x28')]['rawAttributes'],function(_0x144698){return{'name':_0x144698[_0xce52('0x29')],'type':_0x144698['type'][_0xce52('0x2a')]};});_0x13ba12[_0xce52('0x2b')]=_['map'](_0x4714f3,_0xce52('0x24'));_0x13ba12[_0xce52('0x2c')]=_['keys'](_0x447e1d[_0xce52('0x2c')]);_0x13ba12['filters']=_['intersection'](_0x13ba12[_0xce52('0x2b')],_0x13ba12['query']);_0x35f45b[_0xce52('0x2d')]=_['intersection'](_0x13ba12[_0xce52('0x2b')],qs['fields'](_0x447e1d['query'][_0xce52('0x2e')]));_0x35f45b['attributes']=_0x35f45b[_0xce52('0x2d')][_0xce52('0x2f')]?_0x35f45b[_0xce52('0x2d')]:_0x13ba12[_0xce52('0x2b')];if(!_0x447e1d[_0xce52('0x2c')][_0xce52('0x30')](_0xce52('0x31'))){_0x35f45b['limit']=qs['limit'](_0x447e1d[_0xce52('0x2c')][_0xce52('0x1c')]);_0x35f45b[_0xce52('0x1b')]=qs[_0xce52('0x1b')](_0x447e1d[_0xce52('0x2c')][_0xce52('0x1b')]);}_0x35f45b[_0xce52('0x32')]=qs[_0xce52('0x33')](_0x447e1d[_0xce52('0x2c')][_0xce52('0x33')]);_0x35f45b[_0xce52('0x34')]=qs[_0xce52('0x35')](_[_0xce52('0x36')](_0x447e1d[_0xce52('0x2c')],_0x13ba12[_0xce52('0x35')]));if(_0x447e1d[_0xce52('0x2c')][_0xce52('0x37')]){_0x35f45b[_0xce52('0x34')]=_['merge'](_0x35f45b['where'],{'$or':_[_0xce52('0x27')](_0x4714f3,function(_0x3bec10){if(_0x3bec10['type']!==_0xce52('0x38')){var _0x217d72={};_0x217d72[_0x3bec10[_0xce52('0x24')]]={'$like':'%'+_0x447e1d[_0xce52('0x2c')][_0xce52('0x37')]+'%'};return _0x217d72;}})});}_0x35f45b=_[_0xce52('0x39')]({},_0x35f45b,_0x447e1d[_0xce52('0x3a')]);var _0xcd0055={'where':_0x35f45b['where']};return db['JscriptySessionReport'][_0xce52('0x1a')](_0xcd0055)[_0xce52('0x22')](function(_0x442721){_0x571656[_0xce52('0x1a')]=_0x442721;if(_0x447e1d[_0xce52('0x2c')][_0xce52('0x3b')]){_0x35f45b[_0xce52('0x3c')]=[{'all':!![]}];}return db[_0xce52('0x28')][_0xce52('0x3d')](_0x35f45b);})[_0xce52('0x22')](function(_0x15e251){_0x571656[_0xce52('0x3e')]=_0x15e251;return _0x571656;})[_0xce52('0x22')](respondWithFilteredResult(_0x3cf077,_0x35f45b))[_0xce52('0x3f')](handleError(_0x3cf077,null));};exports['show']=function(_0x3bc32f,_0x40a7db){var _0x4c6e13={'raw':!![],'where':{'id':_0x3bc32f[_0xce52('0x40')]['id']}},_0xd4dcf={};_0xd4dcf[_0xce52('0x2b')]=_[_0xce52('0x41')](db[_0xce52('0x28')][_0xce52('0x42')]);_0xd4dcf[_0xce52('0x2c')]=_[_0xce52('0x41')](_0x3bc32f[_0xce52('0x2c')]);_0xd4dcf[_0xce52('0x35')]=_[_0xce52('0x43')](_0xd4dcf['model'],_0xd4dcf['query']);_0x4c6e13[_0xce52('0x2d')]=_[_0xce52('0x43')](_0xd4dcf[_0xce52('0x2b')],qs[_0xce52('0x2e')](_0x3bc32f['query'][_0xce52('0x2e')]));_0x4c6e13['attributes']=_0x4c6e13[_0xce52('0x2d')][_0xce52('0x2f')]?_0x4c6e13[_0xce52('0x2d')]:_0xd4dcf[_0xce52('0x2b')];if(_0x3bc32f[_0xce52('0x2c')][_0xce52('0x3b')]){_0x4c6e13['include']=[{'all':!![]}];}_0x4c6e13=_[_0xce52('0x39')]({},_0x4c6e13,_0x3bc32f[_0xce52('0x3a')]);return db[_0xce52('0x28')][_0xce52('0x44')](_0x4c6e13)[_0xce52('0x22')](handleEntityNotFound(_0x40a7db,null))[_0xce52('0x22')](respondWithResult(_0x40a7db,null))[_0xce52('0x3f')](handleError(_0x40a7db,null));};exports[_0xce52('0x45')]=function(_0x2ce873,_0x3daccb){return db[_0xce52('0x28')][_0xce52('0x45')](_0x2ce873[_0xce52('0x46')],{})[_0xce52('0x22')](respondWithResult(_0x3daccb,0xc9))[_0xce52('0x3f')](handleError(_0x3daccb,null));};exports[_0xce52('0x21')]=function(_0x3d2121,_0x4476b4){if(_0x3d2121[_0xce52('0x46')]['id']){delete _0x3d2121[_0xce52('0x46')]['id'];}return db['JscriptySessionReport'][_0xce52('0x44')]({'where':{'id':_0x3d2121[_0xce52('0x40')]['id']}})[_0xce52('0x22')](handleEntityNotFound(_0x4476b4,null))[_0xce52('0x22')](saveUpdates(_0x3d2121['body'],null))['then'](respondWithResult(_0x4476b4,null))[_0xce52('0x3f')](handleError(_0x4476b4,null));};exports['destroy']=function(_0x253f2c,_0x76c8c7){return db['JscriptySessionReport'][_0xce52('0x44')]({'where':{'id':_0x253f2c['params']['id']}})[_0xce52('0x22')](handleEntityNotFound(_0x76c8c7,null))[_0xce52('0x22')](removeEntity(_0x76c8c7,null))[_0xce52('0x3f')](handleError(_0x76c8c7,null));};exports['describe']=function(_0x3de990,_0x45cf70){return db['JscriptySessionReport'][_0xce52('0x47')]()[_0xce52('0x22')](respondWithResult(_0x45cf70,null))[_0xce52('0x3f')](handleError(_0x45cf70,null));};exports['getQuestions']=function(_0x41d0c4,_0x552730,_0x151378){var _0x2bd9e4={'raw':!![],'where':{}};var _0x45c431={};var _0xe06594={'count':0x0,'rows':[]};return db[_0xce52('0x28')][_0xce52('0x48')]({'where':{'id':_0x41d0c4[_0xce52('0x40')]['id']}})[_0xce52('0x22')](handleEntityNotFound(_0x552730,null))[_0xce52('0x22')](function(_0x37c5d0){if(_0x37c5d0){_0x45c431['model']=_['keys'](db[_0xce52('0x49')]['rawAttributes']);_0x45c431[_0xce52('0x2c')]=_[_0xce52('0x41')](_0x41d0c4[_0xce52('0x2c')]);_0x45c431[_0xce52('0x35')]=_[_0xce52('0x43')](_0x45c431[_0xce52('0x2b')],_0x45c431[_0xce52('0x2c')]);_0x2bd9e4[_0xce52('0x2d')]=_[_0xce52('0x43')](_0x45c431['model'],qs['fields'](_0x41d0c4[_0xce52('0x2c')][_0xce52('0x2e')]));_0x2bd9e4[_0xce52('0x2d')]=_0x2bd9e4[_0xce52('0x2d')][_0xce52('0x2f')]?_0x2bd9e4[_0xce52('0x2d')]:_0x45c431['model'];if(!_0x41d0c4[_0xce52('0x2c')][_0xce52('0x30')](_0xce52('0x31'))){_0x2bd9e4[_0xce52('0x1c')]=qs[_0xce52('0x1c')](_0x41d0c4[_0xce52('0x2c')][_0xce52('0x1c')]);_0x2bd9e4['offset']=qs[_0xce52('0x1b')](_0x41d0c4[_0xce52('0x2c')][_0xce52('0x1b')]);}_0x2bd9e4['order']=qs['sort'](_0x41d0c4[_0xce52('0x2c')][_0xce52('0x33')]);_0x2bd9e4[_0xce52('0x34')]=qs[_0xce52('0x35')](_[_0xce52('0x36')](_0x41d0c4[_0xce52('0x2c')],_0x45c431[_0xce52('0x35')]));_0x2bd9e4[_0xce52('0x34')][_0xce52('0x4a')]=_0x37c5d0['id'];if(_0x41d0c4['query'][_0xce52('0x37')]){_0x2bd9e4[_0xce52('0x34')]=_[_0xce52('0x39')](_0x2bd9e4[_0xce52('0x34')],{'$or':_['map'](_0x2bd9e4[_0xce52('0x2d')],function(_0x31d5c){var _0x56c8a5={};_0x56c8a5[_0x31d5c]={'$like':'%'+_0x41d0c4[_0xce52('0x2c')][_0xce52('0x37')]+'%'};return _0x56c8a5;})});}_0x2bd9e4=_[_0xce52('0x39')]({},_0x2bd9e4,_0x41d0c4[_0xce52('0x3a')]);return db[_0xce52('0x49')][_0xce52('0x1a')]({'where':_0x2bd9e4['where']})[_0xce52('0x22')](function(_0x50443a){_0xe06594['count']=_0x50443a;if(_0x41d0c4[_0xce52('0x2c')][_0xce52('0x3b')]){_0x2bd9e4[_0xce52('0x3c')]=[{'all':!![]}];}return db[_0xce52('0x49')][_0xce52('0x3d')](_0x2bd9e4);})[_0xce52('0x22')](function(_0xdcfd0f){_0xe06594[_0xce52('0x3e')]=_0xdcfd0f;return _0xe06594;});}})[_0xce52('0x22')](respondWithFilteredResult(_0x552730,_0x2bd9e4))[_0xce52('0x3f')](handleError(_0x552730,null));}; \ No newline at end of file +var _0x0b3b=['limit','set','Content-Range','reject','then','destroy','error','stack','name','index','map','JscriptySessionReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','options','find','create','update','body','JscriptyQuestionReport','sort','include','html-pdf','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','json','offset'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0b3b,0xb6));var _0xb0b3=function(_0x5ee5f8,_0x1659e6){_0x5ee5f8=_0x5ee5f8-0x0;var _0x21492e=_0x0b3b[_0x5ee5f8];return _0x21492e;};'use strict';var pdf=require(_0xb0b3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb0b3('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb0b3('0x2'));var Mustache=require(_0xb0b3('0x3'));var util=require('util');var path=require(_0xb0b3('0x4'));var sox=require(_0xb0b3('0x5'));var csv=require('to-csv');var ejs=require(_0xb0b3('0x6'));var fs=require('fs');var _=require(_0xb0b3('0x7'));var squel=require(_0xb0b3('0x8'));var crypto=require(_0xb0b3('0x9'));var jsforce=require(_0xb0b3('0xa'));var deskjs=require(_0xb0b3('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb0b3('0xc'));var Papa=require(_0xb0b3('0xd'));var Redis=require(_0xb0b3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb0b3('0xf'));var as=require(_0xb0b3('0x10'));var hardwareService=require(_0xb0b3('0x11'));var logger=require(_0xb0b3('0x12'))(_0xb0b3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb0b3('0x14'))['db'];function respondWithStatusCode(_0x3da407,_0x192028){_0x192028=_0x192028||0xcc;return function(_0x5aa467){if(_0x5aa467){return _0x3da407['sendStatus'](_0x192028);}return _0x3da407['status'](_0x192028)[_0xb0b3('0x15')]();};}function respondWithResult(_0x133c00,_0x4f2e01){_0x4f2e01=_0x4f2e01||0xc8;return function(_0x400620){if(_0x400620){return _0x133c00[_0xb0b3('0x16')](_0x4f2e01)[_0xb0b3('0x17')](_0x400620);}};}function respondWithFilteredResult(_0x519cf7,_0x460de2){return function(_0x266d1a){if(_0x266d1a){var _0x5c3188=_0x266d1a['count'],_0x572dc6=_0x460de2[_0xb0b3('0x18')],_0x6afec5=_0x460de2[_0xb0b3('0x18')]+_0x460de2[_0xb0b3('0x19')],_0xf1f76a;if(_0x6afec5>=_0x5c3188){_0x6afec5=_0x5c3188;_0xf1f76a=0xc8;}else{_0xf1f76a=0xce;}_0x519cf7[_0xb0b3('0x16')](_0xf1f76a);return _0x519cf7[_0xb0b3('0x1a')](_0xb0b3('0x1b'),_0x572dc6+'-'+_0x6afec5+'/'+_0x5c3188)['json'](_0x266d1a);}return null;};}function patchUpdates(_0x4c76d9){return function(_0xa9b31f){try{jsonpatch['apply'](_0xa9b31f,_0x4c76d9,!![]);}catch(_0xac1349){return BPromise[_0xb0b3('0x1c')](_0xac1349);}return _0xa9b31f['save']();};}function saveUpdates(_0x355f05,_0x21e827){return function(_0x181435){if(_0x181435){return _0x181435['update'](_0x355f05)[_0xb0b3('0x1d')](function(_0x4be460){return _0x4be460;});}return null;};}function removeEntity(_0x6ea8f7,_0x419e53){return function(_0x1c7c26){if(_0x1c7c26){return _0x1c7c26[_0xb0b3('0x1e')]()[_0xb0b3('0x1d')](function(){_0x6ea8f7[_0xb0b3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x72a988,_0x4ab5cf){return function(_0x40ead0){if(!_0x40ead0){_0x72a988['sendStatus'](0x194);}return _0x40ead0;};}function handleError(_0x5196c8,_0x2eea80){_0x2eea80=_0x2eea80||0x1f4;return function(_0x595248){logger[_0xb0b3('0x1f')](_0x595248[_0xb0b3('0x20')]);if(_0x595248[_0xb0b3('0x21')]){delete _0x595248['name'];}_0x5196c8[_0xb0b3('0x16')](_0x2eea80)['send'](_0x595248);};}exports[_0xb0b3('0x22')]=function(_0x5ee5b8,_0x382ca5){var _0x88c5ef={},_0x533cbe={},_0x34c3ce={'count':0x0,'rows':[]};var _0x4f076c=_[_0xb0b3('0x23')](db[_0xb0b3('0x24')][_0xb0b3('0x25')],function(_0x27c7fe){return{'name':_0x27c7fe['fieldName'],'type':_0x27c7fe[_0xb0b3('0x26')]['key']};});_0x533cbe[_0xb0b3('0x27')]=_[_0xb0b3('0x23')](_0x4f076c,_0xb0b3('0x21'));_0x533cbe[_0xb0b3('0x28')]=_[_0xb0b3('0x29')](_0x5ee5b8[_0xb0b3('0x28')]);_0x533cbe[_0xb0b3('0x2a')]=_['intersection'](_0x533cbe[_0xb0b3('0x27')],_0x533cbe[_0xb0b3('0x28')]);_0x88c5ef['attributes']=_[_0xb0b3('0x2b')](_0x533cbe['model'],qs[_0xb0b3('0x2c')](_0x5ee5b8['query'][_0xb0b3('0x2c')]));_0x88c5ef[_0xb0b3('0x2d')]=_0x88c5ef[_0xb0b3('0x2d')][_0xb0b3('0x2e')]?_0x88c5ef[_0xb0b3('0x2d')]:_0x533cbe[_0xb0b3('0x27')];if(!_0x5ee5b8[_0xb0b3('0x28')][_0xb0b3('0x2f')]('nolimit')){_0x88c5ef[_0xb0b3('0x19')]=qs['limit'](_0x5ee5b8[_0xb0b3('0x28')][_0xb0b3('0x19')]);_0x88c5ef['offset']=qs['offset'](_0x5ee5b8[_0xb0b3('0x28')][_0xb0b3('0x18')]);}_0x88c5ef[_0xb0b3('0x30')]=qs['sort'](_0x5ee5b8[_0xb0b3('0x28')]['sort']);_0x88c5ef[_0xb0b3('0x31')]=qs[_0xb0b3('0x2a')](_[_0xb0b3('0x32')](_0x5ee5b8[_0xb0b3('0x28')],_0x533cbe[_0xb0b3('0x2a')]));if(_0x5ee5b8['query'][_0xb0b3('0x33')]){_0x88c5ef[_0xb0b3('0x31')]=_[_0xb0b3('0x34')](_0x88c5ef[_0xb0b3('0x31')],{'$or':_[_0xb0b3('0x23')](_0x4f076c,function(_0x56cdad){if(_0x56cdad['type']!==_0xb0b3('0x35')){var _0x14ea57={};_0x14ea57[_0x56cdad[_0xb0b3('0x21')]]={'$like':'%'+_0x5ee5b8[_0xb0b3('0x28')]['filter']+'%'};return _0x14ea57;}})});}_0x88c5ef=_[_0xb0b3('0x34')]({},_0x88c5ef,_0x5ee5b8['options']);var _0x34bedf={'where':_0x88c5ef['where']};return db['JscriptySessionReport'][_0xb0b3('0x36')](_0x34bedf)[_0xb0b3('0x1d')](function(_0x779ee2){_0x34c3ce['count']=_0x779ee2;if(_0x5ee5b8['query'][_0xb0b3('0x37')]){_0x88c5ef['include']=[{'all':!![]}];}return db[_0xb0b3('0x24')][_0xb0b3('0x38')](_0x88c5ef);})[_0xb0b3('0x1d')](function(_0x4398a5){_0x34c3ce[_0xb0b3('0x39')]=_0x4398a5;return _0x34c3ce;})[_0xb0b3('0x1d')](respondWithFilteredResult(_0x382ca5,_0x88c5ef))[_0xb0b3('0x3a')](handleError(_0x382ca5,null));};exports[_0xb0b3('0x3b')]=function(_0x124d97,_0xf470b7){var _0x46f20c={'raw':!![],'where':{'id':_0x124d97[_0xb0b3('0x3c')]['id']}},_0x4484d1={};_0x4484d1[_0xb0b3('0x27')]=_[_0xb0b3('0x29')](db[_0xb0b3('0x24')]['rawAttributes']);_0x4484d1[_0xb0b3('0x28')]=_[_0xb0b3('0x29')](_0x124d97['query']);_0x4484d1[_0xb0b3('0x2a')]=_['intersection'](_0x4484d1['model'],_0x4484d1[_0xb0b3('0x28')]);_0x46f20c[_0xb0b3('0x2d')]=_[_0xb0b3('0x2b')](_0x4484d1[_0xb0b3('0x27')],qs[_0xb0b3('0x2c')](_0x124d97[_0xb0b3('0x28')][_0xb0b3('0x2c')]));_0x46f20c['attributes']=_0x46f20c['attributes'][_0xb0b3('0x2e')]?_0x46f20c['attributes']:_0x4484d1['model'];if(_0x124d97[_0xb0b3('0x28')]['includeAll']){_0x46f20c['include']=[{'all':!![]}];}_0x46f20c=_[_0xb0b3('0x34')]({},_0x46f20c,_0x124d97[_0xb0b3('0x3d')]);return db[_0xb0b3('0x24')][_0xb0b3('0x3e')](_0x46f20c)[_0xb0b3('0x1d')](handleEntityNotFound(_0xf470b7,null))[_0xb0b3('0x1d')](respondWithResult(_0xf470b7,null))[_0xb0b3('0x3a')](handleError(_0xf470b7,null));};exports[_0xb0b3('0x3f')]=function(_0x2b65a2,_0x11aab8){return db[_0xb0b3('0x24')][_0xb0b3('0x3f')](_0x2b65a2['body'],{})[_0xb0b3('0x1d')](respondWithResult(_0x11aab8,0xc9))[_0xb0b3('0x3a')](handleError(_0x11aab8,null));};exports[_0xb0b3('0x40')]=function(_0x192e80,_0x425db2){if(_0x192e80[_0xb0b3('0x41')]['id']){delete _0x192e80[_0xb0b3('0x41')]['id'];}return db['JscriptySessionReport'][_0xb0b3('0x3e')]({'where':{'id':_0x192e80[_0xb0b3('0x3c')]['id']}})[_0xb0b3('0x1d')](handleEntityNotFound(_0x425db2,null))['then'](saveUpdates(_0x192e80[_0xb0b3('0x41')],null))['then'](respondWithResult(_0x425db2,null))[_0xb0b3('0x3a')](handleError(_0x425db2,null));};exports['destroy']=function(_0x4055af,_0x18d73f){return db[_0xb0b3('0x24')]['find']({'where':{'id':_0x4055af[_0xb0b3('0x3c')]['id']}})[_0xb0b3('0x1d')](handleEntityNotFound(_0x18d73f,null))['then'](removeEntity(_0x18d73f,null))[_0xb0b3('0x3a')](handleError(_0x18d73f,null));};exports['describe']=function(_0x290212,_0x4fa595){return db[_0xb0b3('0x24')]['describe']()['then'](respondWithResult(_0x4fa595,null))[_0xb0b3('0x3a')](handleError(_0x4fa595,null));};exports['getQuestions']=function(_0x59f1ce,_0x4eae18,_0x542405){var _0x5b43a3={'raw':!![],'where':{}};var _0x179c02={};var _0x96ace={'count':0x0,'rows':[]};return db[_0xb0b3('0x24')]['findOne']({'where':{'id':_0x59f1ce[_0xb0b3('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4eae18,null))[_0xb0b3('0x1d')](function(_0x119345){if(_0x119345){_0x179c02['model']=_['keys'](db[_0xb0b3('0x42')][_0xb0b3('0x25')]);_0x179c02['query']=_[_0xb0b3('0x29')](_0x59f1ce[_0xb0b3('0x28')]);_0x179c02['filters']=_['intersection'](_0x179c02['model'],_0x179c02[_0xb0b3('0x28')]);_0x5b43a3[_0xb0b3('0x2d')]=_[_0xb0b3('0x2b')](_0x179c02['model'],qs[_0xb0b3('0x2c')](_0x59f1ce[_0xb0b3('0x28')][_0xb0b3('0x2c')]));_0x5b43a3[_0xb0b3('0x2d')]=_0x5b43a3[_0xb0b3('0x2d')][_0xb0b3('0x2e')]?_0x5b43a3[_0xb0b3('0x2d')]:_0x179c02[_0xb0b3('0x27')];if(!_0x59f1ce[_0xb0b3('0x28')]['hasOwnProperty']('nolimit')){_0x5b43a3['limit']=qs[_0xb0b3('0x19')](_0x59f1ce['query'][_0xb0b3('0x19')]);_0x5b43a3['offset']=qs[_0xb0b3('0x18')](_0x59f1ce[_0xb0b3('0x28')][_0xb0b3('0x18')]);}_0x5b43a3[_0xb0b3('0x30')]=qs[_0xb0b3('0x43')](_0x59f1ce[_0xb0b3('0x28')][_0xb0b3('0x43')]);_0x5b43a3[_0xb0b3('0x31')]=qs[_0xb0b3('0x2a')](_[_0xb0b3('0x32')](_0x59f1ce[_0xb0b3('0x28')],_0x179c02[_0xb0b3('0x2a')]));_0x5b43a3['where']['SessionId']=_0x119345['id'];if(_0x59f1ce[_0xb0b3('0x28')][_0xb0b3('0x33')]){_0x5b43a3[_0xb0b3('0x31')]=_[_0xb0b3('0x34')](_0x5b43a3['where'],{'$or':_[_0xb0b3('0x23')](_0x5b43a3[_0xb0b3('0x2d')],function(_0x4d876f){var _0x3198ce={};_0x3198ce[_0x4d876f]={'$like':'%'+_0x59f1ce['query'][_0xb0b3('0x33')]+'%'};return _0x3198ce;})});}_0x5b43a3=_[_0xb0b3('0x34')]({},_0x5b43a3,_0x59f1ce[_0xb0b3('0x3d')]);return db[_0xb0b3('0x42')][_0xb0b3('0x36')]({'where':_0x5b43a3[_0xb0b3('0x31')]})['then'](function(_0x5a19a9){_0x96ace[_0xb0b3('0x36')]=_0x5a19a9;if(_0x59f1ce[_0xb0b3('0x28')][_0xb0b3('0x37')]){_0x5b43a3[_0xb0b3('0x44')]=[{'all':!![]}];}return db[_0xb0b3('0x42')][_0xb0b3('0x38')](_0x5b43a3);})[_0xb0b3('0x1d')](function(_0x2e379d){_0x96ace[_0xb0b3('0x39')]=_0x2e379d;return _0x96ace;});}})[_0xb0b3('0x1d')](respondWithFilteredResult(_0x4eae18,_0x5b43a3))[_0xb0b3('0x3a')](handleError(_0x4eae18,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3e9a940..158c43d 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x580d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','lodash'];(function(_0x4b4fb4,_0x18c001){var _0x23e4ed=function(_0x59194a){while(--_0x59194a){_0x4b4fb4['push'](_0x4b4fb4['shift']());}};_0x23e4ed(++_0x18c001);}(_0x580d,0x110));var _0xd580=function(_0x39435f,_0x86adaf){_0x39435f=_0x39435f-0x0;var _0x228d3e=_0x580d[_0x39435f];return _0x228d3e;};'use strict';var _=require(_0xd580('0x0'));var util=require(_0xd580('0x1'));var logger=require(_0xd580('0x2'))('api');var moment=require(_0xd580('0x3'));var BPromise=require(_0xd580('0x4'));var rp=require(_0xd580('0x5'));var fs=require('fs');var path=require(_0xd580('0x6'));var rimraf=require(_0xd580('0x7'));var config=require(_0xd580('0x8'));var attributes=require(_0xd580('0x9'));module['exports']=function(_0x44ce0d,_0x1c458e){return _0x44ce0d[_0xd580('0xa')](_0xd580('0xb'),attributes,{'tableName':_0xd580('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf20d=['bluebird','request-promise','path','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x3e083b,_0x433086){var _0x33fe6f=function(_0x142842){while(--_0x142842){_0x3e083b['push'](_0x3e083b['shift']());}};_0x33fe6f(++_0x433086);}(_0xf20d,0x193));var _0xdf20=function(_0x321277,_0x1bea3d){_0x321277=_0x321277-0x0;var _0x1843d8=_0xf20d[_0x321277];return _0x1843d8;};'use strict';var _=require(_0xdf20('0x0'));var util=require(_0xdf20('0x1'));var logger=require(_0xdf20('0x2'))(_0xdf20('0x3'));var moment=require(_0xdf20('0x4'));var BPromise=require(_0xdf20('0x5'));var rp=require(_0xdf20('0x6'));var fs=require('fs');var path=require(_0xdf20('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf20('0x8'));module[_0xdf20('0x9')]=function(_0x50f4c6,_0x143f59){return _0x50f4c6[_0xdf20('0xa')]('JscriptySessionReport',attributes,{'tableName':_0xdf20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 37fe944..3d68b90 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa49e=['stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x599618,_0x4164f9){var _0x12e7fa=function(_0x5b8255){while(--_0x5b8255){_0x599618['push'](_0x599618['shift']());}};_0x12e7fa(++_0x4164f9);}(_0xa49e,0x147));var _0xea49=function(_0xac21df,_0x4f3ba2){_0xac21df=_0xac21df-0x0;var _0x1faa60=_0xa49e[_0xac21df];return _0x1faa60;};'use strict';var _=require(_0xea49('0x0'));var util=require('util');var moment=require(_0xea49('0x1'));var BPromise=require('bluebird');var rs=require(_0xea49('0x2'));var fs=require('fs');var Redis=require(_0xea49('0x3'));var db=require(_0xea49('0x4'))['db'];var utils=require(_0xea49('0x5'));var logger=require(_0xea49('0x6'))(_0xea49('0x7'));var config=require(_0xea49('0x8'));var jayson=require(_0xea49('0x9'));var client=jayson[_0xea49('0xa')][_0xea49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ba938,_0xd4bedb,_0x4bec0c){return new BPromise(function(_0x15d8e1,_0x33d9a7){return client['request'](_0x3ba938,_0x4bec0c)[_0xea49('0xc')](function(_0x286a06){logger[_0xea49('0xd')](_0xea49('0xe'),_0xd4bedb,'request\x20sent');logger[_0xea49('0xf')](_0xea49('0x10'),_0xd4bedb,_0xea49('0x11'),JSON[_0xea49('0x12')](_0x286a06));if(_0x286a06[_0xea49('0x13')]){if(_0x286a06['error']['code']===0x1f4){logger[_0xea49('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0xd4bedb,_0x286a06[_0xea49('0x13')][_0xea49('0x14')]);return _0x33d9a7(_0x286a06['error'][_0xea49('0x14')]);}logger[_0xea49('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0xd4bedb,_0x286a06[_0xea49('0x13')][_0xea49('0x14')]);return _0x15d8e1(_0x286a06[_0xea49('0x13')][_0xea49('0x14')]);}else{logger[_0xea49('0xd')](_0xea49('0xe'),_0xd4bedb,'request\x20sent');_0x15d8e1(_0x286a06[_0xea49('0x15')][_0xea49('0x14')]);}})[_0xea49('0x16')](function(_0x33c3a5){logger[_0xea49('0x13')](_0xea49('0xe'),_0xd4bedb,_0x33c3a5);_0x33d9a7(_0x33c3a5);});});} \ No newline at end of file +var _0x7e0b=['http','request','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0x7e0b,0x8f));var _0xb7e0=function(_0x3a6f71,_0x580b89){_0x3a6f71=_0x3a6f71-0x0;var _0x1ab0d8=_0x7e0b[_0x3a6f71];return _0x1ab0d8;};'use strict';var _=require('lodash');var util=require(_0xb7e0('0x0'));var moment=require(_0xb7e0('0x1'));var BPromise=require(_0xb7e0('0x2'));var rs=require(_0xb7e0('0x3'));var fs=require('fs');var Redis=require(_0xb7e0('0x4'));var db=require(_0xb7e0('0x5'))['db'];var utils=require(_0xb7e0('0x6'));var logger=require(_0xb7e0('0x7'))('rpc');var config=require(_0xb7e0('0x8'));var jayson=require(_0xb7e0('0x9'));var client=jayson[_0xb7e0('0xa')][_0xb7e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e167,_0x2e9746,_0x318605){return new BPromise(function(_0x3a1b7a,_0x1848f0){return client[_0xb7e0('0xc')](_0x12e167,_0x318605)['then'](function(_0x1b9f88){logger[_0xb7e0('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x2e9746,_0xb7e0('0xe'));logger[_0xb7e0('0xf')](_0xb7e0('0x10'),_0x2e9746,_0xb7e0('0xe'),JSON['stringify'](_0x1b9f88));if(_0x1b9f88[_0xb7e0('0x11')]){if(_0x1b9f88['error'][_0xb7e0('0x12')]===0x1f4){logger[_0xb7e0('0x11')](_0xb7e0('0x13'),_0x2e9746,_0x1b9f88[_0xb7e0('0x11')][_0xb7e0('0x14')]);return _0x1848f0(_0x1b9f88[_0xb7e0('0x11')][_0xb7e0('0x14')]);}logger[_0xb7e0('0x11')](_0xb7e0('0x13'),_0x2e9746,_0x1b9f88[_0xb7e0('0x11')]['message']);return _0x3a1b7a(_0x1b9f88[_0xb7e0('0x11')][_0xb7e0('0x14')]);}else{logger[_0xb7e0('0xd')](_0xb7e0('0x13'),_0x2e9746,_0xb7e0('0xe'));_0x3a1b7a(_0x1b9f88['result'][_0xb7e0('0x14')]);}})[_0xb7e0('0x15')](function(_0x4d5f18){logger['error'](_0xb7e0('0x13'),_0x2e9746,_0x4d5f18);_0x1848f0(_0x4d5f18);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d828e14..b9a48ec 100644 --- a/server/api/license/index.js +++ b/server/api/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x305d=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','put','/:id','isAuthenticated','multer','util','path','connect-timeout'];(function(_0x38a228,_0x2b23cd){var _0x206eea=function(_0x3d8dd6){while(--_0x3d8dd6){_0x38a228['push'](_0x38a228['shift']());}};_0x206eea(++_0x2b23cd);}(_0x305d,0xb2));var _0xd305=function(_0x2ae3e4,_0x1916ff){_0x2ae3e4=_0x2ae3e4-0x0;var _0x4d0dce=_0x305d[_0x2ae3e4];return _0x4d0dce;};'use strict';var multer=require(_0xd305('0x0'));var util=require(_0xd305('0x1'));var path=require(_0xd305('0x2'));var timeout=require(_0xd305('0x3'));var express=require(_0xd305('0x4'));var router=express[_0xd305('0x5')]();var auth=require(_0xd305('0x6'));var interaction=require(_0xd305('0x7'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0xd305('0x8')]('/',controller[_0xd305('0x9')]);router[_0xd305('0xa')](_0xd305('0xb'),auth[_0xd305('0xc')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xd863=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put','/:id','isAuthenticated'];(function(_0x25d722,_0x13cf9c){var _0x23416e=function(_0x5a96a8){while(--_0x5a96a8){_0x25d722['push'](_0x25d722['shift']());}};_0x23416e(++_0x13cf9c);}(_0xd863,0xb4));var _0x3d86=function(_0x43adef,_0x57612c){_0x43adef=_0x43adef-0x0;var _0x463c1c=_0xd863[_0x43adef];return _0x463c1c;};'use strict';var multer=require(_0x3d86('0x0'));var util=require('util');var path=require(_0x3d86('0x1'));var timeout=require(_0x3d86('0x2'));var express=require(_0x3d86('0x3'));var router=express[_0x3d86('0x4')]();var auth=require(_0x3d86('0x5'));var interaction=require(_0x3d86('0x6'));var config=require(_0x3d86('0x7'));var controller=require('./license.controller');router['get']('/',controller[_0x3d86('0x8')]);router[_0x3d86('0x9')](_0x3d86('0xa'),auth[_0x3d86('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index e9a8528..82a6ad7 100644 --- a/server/api/license/license.attributes.js +++ b/server/api/license/license.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0x7a54,0x106));var _0x47a5=function(_0x2e8790,_0x2d9677){_0x2e8790=_0x2e8790-0x0;var _0x2bce62=_0x7a54[_0x2e8790];return _0x2bce62;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'license':{'type':Sequelize[_0x47a5('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x47a5('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2675=['sequelize','STRING','INTEGER'];(function(_0x3790c5,_0x45b2dd){var _0xd105da=function(_0x25fdf0){while(--_0x25fdf0){_0x3790c5['push'](_0x3790c5['shift']());}};_0xd105da(++_0x45b2dd);}(_0x2675,0x75));var _0x5267=function(_0x4064ea,_0x55b0bd){_0x4064ea=_0x4064ea-0x0;var _0x2bc4ee=_0x2675[_0x4064ea];return _0x2bc4ee;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x5267('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x5267('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 83c79ff..a1fc21e 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe809=['path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','options','getLicense','body','find','get','checkLicense','key','demo','catch','html-pdf','zip-dir','moment','bluebird','mustache','util'];(function(_0xf18452,_0x1df28e){var _0x2d87c2=function(_0x261467){while(--_0x261467){_0xf18452['push'](_0xf18452['shift']());}};_0x2d87c2(++_0x1df28e);}(_0xe809,0x15c));var _0x9e80=function(_0x45bb22,_0x457039){_0x45bb22=_0x45bb22-0x0;var _0x100a48=_0xe809[_0x45bb22];return _0x100a48;};'use strict';var pdf=require(_0x9e80('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9e80('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9e80('0x2'));var BPromise=require(_0x9e80('0x3'));var Mustache=require(_0x9e80('0x4'));var util=require(_0x9e80('0x5'));var path=require(_0x9e80('0x6'));var sox=require(_0x9e80('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9e80('0x8'));var squel=require(_0x9e80('0x9'));var crypto=require(_0x9e80('0xa'));var jsforce=require(_0x9e80('0xb'));var deskjs=require(_0x9e80('0xc'));var toCsv=require(_0x9e80('0xd'));var querystring=require(_0x9e80('0xe'));var Papa=require(_0x9e80('0xf'));var Redis=require('ioredis');var authService=require(_0x9e80('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9e80('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e80('0x12'))(_0x9e80('0x13'));var utils=require('../../config/utils');var config=require(_0x9e80('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b000e,_0x3161e5){_0x3161e5=_0x3161e5||0xcc;return function(_0x5cc6d1){if(_0x5cc6d1){return _0x2b000e[_0x9e80('0x15')](_0x3161e5);}return _0x2b000e[_0x9e80('0x16')](_0x3161e5)[_0x9e80('0x17')]();};}function respondWithResult(_0x4f2e58,_0x1680a5){_0x1680a5=_0x1680a5||0xc8;return function(_0x3e7f64){if(_0x3e7f64){return _0x4f2e58[_0x9e80('0x16')](_0x1680a5)[_0x9e80('0x18')](_0x3e7f64);}};}function respondWithFilteredResult(_0x1ce2da,_0x1d9d61){return function(_0x43417d){if(_0x43417d){var _0x37e6fe=_0x43417d[_0x9e80('0x19')],_0x33ee6b=_0x1d9d61[_0x9e80('0x1a')],_0x38a7f5=_0x1d9d61[_0x9e80('0x1a')]+_0x1d9d61['limit'],_0x4ea335;if(_0x38a7f5>=_0x37e6fe){_0x38a7f5=_0x37e6fe;_0x4ea335=0xc8;}else{_0x4ea335=0xce;}_0x1ce2da[_0x9e80('0x16')](_0x4ea335);return _0x1ce2da[_0x9e80('0x1b')](_0x9e80('0x1c'),_0x33ee6b+'-'+_0x38a7f5+'/'+_0x37e6fe)['json'](_0x43417d);}return null;};}function patchUpdates(_0x74fb95){return function(_0x3cf1da){try{jsonpatch[_0x9e80('0x1d')](_0x3cf1da,_0x74fb95,!![]);}catch(_0xfbe8ad){return BPromise[_0x9e80('0x1e')](_0xfbe8ad);}return _0x3cf1da[_0x9e80('0x1f')]();};}function saveUpdates(_0x5a535c,_0x5cbd49){return function(_0x1441b8){if(_0x1441b8){return _0x1441b8[_0x9e80('0x20')](_0x5a535c)[_0x9e80('0x21')](function(_0x2ed1fd){return _0x2ed1fd;});}return null;};}function removeEntity(_0x5bf7eb,_0x2ce57f){return function(_0x3ddc72){if(_0x3ddc72){return _0x3ddc72[_0x9e80('0x22')]()[_0x9e80('0x21')](function(){_0x5bf7eb[_0x9e80('0x16')](0xcc)[_0x9e80('0x17')]();});}};}function handleEntityNotFound(_0x3e0e9d,_0x4be772){return function(_0x18faf1){if(!_0x18faf1){_0x3e0e9d[_0x9e80('0x15')](0x194);}return _0x18faf1;};}function handleError(_0x1764ca,_0x2b0a1b){_0x2b0a1b=_0x2b0a1b||0x1f4;return function(_0x466267){logger[_0x9e80('0x23')](_0x466267[_0x9e80('0x24')]);if(_0x466267[_0x9e80('0x25')]){delete _0x466267[_0x9e80('0x25')];}_0x1764ca[_0x9e80('0x16')](_0x2b0a1b)[_0x9e80('0x26')](_0x466267);};}var utilLicense=require(_0x9e80('0x27'));exports[_0x9e80('0x28')]=function(_0x38ccd0,_0xea179e){var _0x474293={'raw':!![],'where':{'id':0x1}},_0x4da83b={};_0x4da83b[_0x9e80('0x29')]=_[_0x9e80('0x2a')](db[_0x9e80('0x2b')][_0x9e80('0x2c')]);_0x4da83b[_0x9e80('0x2d')]=_[_0x9e80('0x2a')](_0x38ccd0['query']);_0x4da83b['filters']=_[_0x9e80('0x2e')](_0x4da83b[_0x9e80('0x29')],_0x4da83b[_0x9e80('0x2d')]);_0x474293[_0x9e80('0x2f')]=_[_0x9e80('0x2e')](_0x4da83b[_0x9e80('0x29')],qs['fields'](_0x38ccd0[_0x9e80('0x2d')][_0x9e80('0x30')]));_0x474293[_0x9e80('0x2f')]=_0x474293[_0x9e80('0x2f')][_0x9e80('0x31')]?_0x474293[_0x9e80('0x2f')]:_0x4da83b[_0x9e80('0x29')];_0x474293=_['merge']({},_0x474293,_0x38ccd0[_0x9e80('0x32')]);return utilLicense[_0x9e80('0x33')](_0x474293)['then'](respondWithResult(_0xea179e,null))['catch'](handleError(_0xea179e,null));};exports[_0x9e80('0x20')]=function(_0x487112,_0x24dca1){if(_0x487112['body']['id']){delete _0x487112[_0x9e80('0x34')]['id'];}return db[_0x9e80('0x2b')][_0x9e80('0x35')]({'where':{'id':_0x487112['params']['id']}})[_0x9e80('0x21')](handleEntityNotFound(_0x24dca1,null))[_0x9e80('0x21')](function(_0x4045de){var _0x29523d=_0x4045de[_0x9e80('0x36')]({'plain':!![]});return utilLicense[_0x9e80('0x37')](_0x29523d,_0x487112[_0x9e80('0x34')][_0x9e80('0x38')]);})[_0x9e80('0x21')](function(_0x1d4ee9){if(!_0x1d4ee9[_0x9e80('0x39')]){return saveUpdates(_0x487112['body'],null);}return _0x1d4ee9;})[_0x9e80('0x21')](respondWithResult(_0x24dca1,null))[_0x9e80('0x3a')](handleError(_0x24dca1,null));}; \ No newline at end of file +var _0xdb48=['status','count','offset','limit','set','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','../../config/license/util','index','model','License','rawAttributes','query','filters','attributes','intersection','fields','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x56c394,_0x5e9757){var _0x1eeb36=function(_0x302142){while(--_0x302142){_0x56c394['push'](_0x56c394['shift']());}};_0x1eeb36(++_0x5e9757);}(_0xdb48,0x12a));var _0x8db4=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xdb48[_0x1eda20];return _0x31b953;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8db4('0x0'));var rimraf=require(_0x8db4('0x1'));var zipdir=require(_0x8db4('0x2'));var jsonpatch=require(_0x8db4('0x3'));var rp=require('request-promise');var moment=require(_0x8db4('0x4'));var BPromise=require(_0x8db4('0x5'));var Mustache=require(_0x8db4('0x6'));var util=require('util');var path=require(_0x8db4('0x7'));var sox=require(_0x8db4('0x8'));var csv=require('to-csv');var ejs=require(_0x8db4('0x9'));var fs=require('fs');var _=require(_0x8db4('0xa'));var squel=require(_0x8db4('0xb'));var crypto=require(_0x8db4('0xc'));var jsforce=require(_0x8db4('0xd'));var deskjs=require(_0x8db4('0xe'));var toCsv=require(_0x8db4('0xf'));var querystring=require(_0x8db4('0x10'));var Papa=require(_0x8db4('0x11'));var Redis=require(_0x8db4('0x12'));var authService=require(_0x8db4('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8db4('0x14'));var logger=require(_0x8db4('0x15'))(_0x8db4('0x16'));var utils=require(_0x8db4('0x17'));var config=require(_0x8db4('0x18'));var db=require(_0x8db4('0x19'))['db'];function respondWithStatusCode(_0x511b37,_0x11d1a5){_0x11d1a5=_0x11d1a5||0xcc;return function(_0x43aaf2){if(_0x43aaf2){return _0x511b37[_0x8db4('0x1a')](_0x11d1a5);}return _0x511b37[_0x8db4('0x1b')](_0x11d1a5)['end']();};}function respondWithResult(_0x1edf02,_0x3b8521){_0x3b8521=_0x3b8521||0xc8;return function(_0x52bb75){if(_0x52bb75){return _0x1edf02[_0x8db4('0x1b')](_0x3b8521)['json'](_0x52bb75);}};}function respondWithFilteredResult(_0x266550,_0x2a2c9f){return function(_0x1aee19){if(_0x1aee19){var _0xb87629=_0x1aee19[_0x8db4('0x1c')],_0x180595=_0x2a2c9f[_0x8db4('0x1d')],_0x28d1c9=_0x2a2c9f['offset']+_0x2a2c9f[_0x8db4('0x1e')],_0x32c596;if(_0x28d1c9>=_0xb87629){_0x28d1c9=_0xb87629;_0x32c596=0xc8;}else{_0x32c596=0xce;}_0x266550['status'](_0x32c596);return _0x266550[_0x8db4('0x1f')]('Content-Range',_0x180595+'-'+_0x28d1c9+'/'+_0xb87629)[_0x8db4('0x20')](_0x1aee19);}return null;};}function patchUpdates(_0xf42bbb){return function(_0x1e4258){try{jsonpatch[_0x8db4('0x21')](_0x1e4258,_0xf42bbb,!![]);}catch(_0xcc67d3){return BPromise[_0x8db4('0x22')](_0xcc67d3);}return _0x1e4258[_0x8db4('0x23')]();};}function saveUpdates(_0x493bb0,_0x2c0674){return function(_0x3254bd){if(_0x3254bd){return _0x3254bd[_0x8db4('0x24')](_0x493bb0)['then'](function(_0x42c5f3){return _0x42c5f3;});}return null;};}function removeEntity(_0xd850dc,_0x5deecf){return function(_0x38b705){if(_0x38b705){return _0x38b705[_0x8db4('0x25')]()[_0x8db4('0x26')](function(){_0xd850dc['status'](0xcc)[_0x8db4('0x27')]();});}};}function handleEntityNotFound(_0x3708ef,_0x3ee1a0){return function(_0xe61bc7){if(!_0xe61bc7){_0x3708ef[_0x8db4('0x1a')](0x194);}return _0xe61bc7;};}function handleError(_0x3c14d5,_0x29a2e3){_0x29a2e3=_0x29a2e3||0x1f4;return function(_0x3e00ef){logger[_0x8db4('0x28')](_0x3e00ef[_0x8db4('0x29')]);if(_0x3e00ef[_0x8db4('0x2a')]){delete _0x3e00ef[_0x8db4('0x2a')];}_0x3c14d5[_0x8db4('0x1b')](_0x29a2e3)[_0x8db4('0x2b')](_0x3e00ef);};}var utilLicense=require(_0x8db4('0x2c'));exports[_0x8db4('0x2d')]=function(_0x49318e,_0x392f23){var _0x1d955f={'raw':!![],'where':{'id':0x1}},_0xafc418={};_0xafc418[_0x8db4('0x2e')]=_['keys'](db[_0x8db4('0x2f')][_0x8db4('0x30')]);_0xafc418[_0x8db4('0x31')]=_['keys'](_0x49318e[_0x8db4('0x31')]);_0xafc418[_0x8db4('0x32')]=_['intersection'](_0xafc418[_0x8db4('0x2e')],_0xafc418[_0x8db4('0x31')]);_0x1d955f[_0x8db4('0x33')]=_[_0x8db4('0x34')](_0xafc418[_0x8db4('0x2e')],qs[_0x8db4('0x35')](_0x49318e['query'][_0x8db4('0x35')]));_0x1d955f[_0x8db4('0x33')]=_0x1d955f[_0x8db4('0x33')]['length']?_0x1d955f[_0x8db4('0x33')]:_0xafc418[_0x8db4('0x2e')];_0x1d955f=_[_0x8db4('0x36')]({},_0x1d955f,_0x49318e[_0x8db4('0x37')]);return utilLicense[_0x8db4('0x38')](_0x1d955f)['then'](respondWithResult(_0x392f23,null))[_0x8db4('0x39')](handleError(_0x392f23,null));};exports[_0x8db4('0x24')]=function(_0x137627,_0x23ee49){if(_0x137627['body']['id']){delete _0x137627[_0x8db4('0x3a')]['id'];}return db[_0x8db4('0x2f')][_0x8db4('0x3b')]({'where':{'id':_0x137627[_0x8db4('0x3c')]['id']}})['then'](handleEntityNotFound(_0x23ee49,null))[_0x8db4('0x26')](function(_0x3a3363){var _0x1cb1d0=_0x3a3363[_0x8db4('0x3d')]({'plain':!![]});return utilLicense[_0x8db4('0x3e')](_0x1cb1d0,_0x137627[_0x8db4('0x3a')][_0x8db4('0x3f')]);})[_0x8db4('0x26')](function(_0x35ef8c){if(!_0x35ef8c[_0x8db4('0x40')]){return saveUpdates(_0x137627['body'],null);}return _0x35ef8c;})[_0x8db4('0x26')](respondWithResult(_0x23ee49,null))[_0x8db4('0x39')](handleError(_0x23ee49,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 054aff2..070d9fb 100644 --- a/server/api/license/license.model.js +++ b/server/api/license/license.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabe8=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./license.attributes','exports','license'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0xabe8,0x8c));var _0x8abe=function(_0x5c2bb2,_0x558245){_0x5c2bb2=_0x5c2bb2-0x0;var _0x1d9c4f=_0xabe8[_0x5c2bb2];return _0x1d9c4f;};'use strict';var _=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var logger=require(_0x8abe('0x2'))('api');var moment=require(_0x8abe('0x3'));var BPromise=require(_0x8abe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8abe('0x5'));var rimraf=require('rimraf');var config=require(_0x8abe('0x6'));var attributes=require(_0x8abe('0x7'));module[_0x8abe('0x8')]=function(_0x3a24e6,_0x7619bb){return _0x3a24e6['define']('License',attributes,{'tableName':_0x8abe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe97=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','define','License','license','lodash'];(function(_0x960516,_0x4a0dea){var _0x5a81e6=function(_0x2a0b4e){while(--_0x2a0b4e){_0x960516['push'](_0x960516['shift']());}};_0x5a81e6(++_0x4a0dea);}(_0xbe97,0x8e));var _0x7be9=function(_0x403846,_0x16e0e7){_0x403846=_0x403846-0x0;var _0x58c527=_0xbe97[_0x403846];return _0x58c527;};'use strict';var _=require(_0x7be9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7be9('0x1'));var moment=require(_0x7be9('0x2'));var BPromise=require(_0x7be9('0x3'));var rp=require(_0x7be9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7be9('0x5'));var config=require(_0x7be9('0x6'));var attributes=require(_0x7be9('0x7'));module['exports']=function(_0x3779ef,_0x1b9468){return _0x3779ef[_0x7be9('0x8')](_0x7be9('0x9'),attributes,{'tableName':_0x7be9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 231434d..5be8399 100644 --- a/server/api/license/license.rpc.js +++ b/server/api/license/license.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb95=['client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','jayson/promise'];(function(_0x4894d4,_0x47f5af){var _0x1a8fce=function(_0x10a511){while(--_0x10a511){_0x4894d4['push'](_0x4894d4['shift']());}};_0x1a8fce(++_0x47f5af);}(_0xbb95,0x7f));var _0x5bb9=function(_0x14be19,_0x3067bb){_0x14be19=_0x14be19-0x0;var _0x240fb4=_0xbb95[_0x14be19];return _0x240fb4;};'use strict';var _=require(_0x5bb9('0x0'));var util=require(_0x5bb9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5bb9('0x2'));var fs=require('fs');var Redis=require(_0x5bb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bb9('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5bb9('0x5'));var client=jayson[_0x5bb9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x180e69,_0x123a6a,_0x39f347){return new BPromise(function(_0x5e8b1c,_0x95777c){return client[_0x5bb9('0x7')](_0x180e69,_0x39f347)[_0x5bb9('0x8')](function(_0x267319){logger[_0x5bb9('0x9')](_0x5bb9('0xa'),_0x123a6a,_0x5bb9('0xb'));logger[_0x5bb9('0xc')](_0x5bb9('0xd'),_0x123a6a,_0x5bb9('0xb'),JSON['stringify'](_0x267319));if(_0x267319['error']){if(_0x267319[_0x5bb9('0xe')][_0x5bb9('0xf')]===0x1f4){logger[_0x5bb9('0xe')](_0x5bb9('0xa'),_0x123a6a,_0x267319[_0x5bb9('0xe')][_0x5bb9('0x10')]);return _0x95777c(_0x267319[_0x5bb9('0xe')]['message']);}logger['error'](_0x5bb9('0xa'),_0x123a6a,_0x267319[_0x5bb9('0xe')][_0x5bb9('0x10')]);return _0x5e8b1c(_0x267319['error'][_0x5bb9('0x10')]);}else{logger[_0x5bb9('0x9')]('License,\x20%s,\x20%s',_0x123a6a,_0x5bb9('0xb'));_0x5e8b1c(_0x267319[_0x5bb9('0x11')][_0x5bb9('0x10')]);}})[_0x5bb9('0x12')](function(_0x119092){logger[_0x5bb9('0xe')](_0x5bb9('0xa'),_0x123a6a,_0x119092);_0x95777c(_0x119092);});});} \ No newline at end of file +var _0xa664=['request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x5c512d,_0x477128){var _0x52ebb4=function(_0x5add7c){while(--_0x5add7c){_0x5c512d['push'](_0x5c512d['shift']());}};_0x52ebb4(++_0x477128);}(_0xa664,0x132));var _0x4a66=function(_0x1d8de2,_0x21305b){_0x1d8de2=_0x1d8de2-0x0;var _0x367c50=_0xa664[_0x1d8de2];return _0x367c50;};'use strict';var _=require('lodash');var util=require(_0x4a66('0x0'));var moment=require(_0x4a66('0x1'));var BPromise=require(_0x4a66('0x2'));var rs=require(_0x4a66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a66('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4a66('0x5'));var config=require(_0x4a66('0x6'));var jayson=require(_0x4a66('0x7'));var client=jayson[_0x4a66('0x8')][_0x4a66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fe28c,_0x358eb6,_0x521808){return new BPromise(function(_0x4484c5,_0x3d51bf){return client[_0x4a66('0xa')](_0x3fe28c,_0x521808)[_0x4a66('0xb')](function(_0x4a3c4c){logger[_0x4a66('0xc')](_0x4a66('0xd'),_0x358eb6,'request\x20sent');logger[_0x4a66('0xe')](_0x4a66('0xf'),_0x358eb6,_0x4a66('0x10'),JSON[_0x4a66('0x11')](_0x4a3c4c));if(_0x4a3c4c[_0x4a66('0x12')]){if(_0x4a3c4c[_0x4a66('0x12')][_0x4a66('0x13')]===0x1f4){logger[_0x4a66('0x12')](_0x4a66('0xd'),_0x358eb6,_0x4a3c4c[_0x4a66('0x12')][_0x4a66('0x14')]);return _0x3d51bf(_0x4a3c4c[_0x4a66('0x12')][_0x4a66('0x14')]);}logger[_0x4a66('0x12')](_0x4a66('0xd'),_0x358eb6,_0x4a3c4c[_0x4a66('0x12')][_0x4a66('0x14')]);return _0x4484c5(_0x4a3c4c['error'][_0x4a66('0x14')]);}else{logger[_0x4a66('0xc')](_0x4a66('0xd'),_0x358eb6,_0x4a66('0x10'));_0x4484c5(_0x4a3c4c[_0x4a66('0x15')][_0x4a66('0x14')]);}})[_0x4a66('0x16')](function(_0x20954d){logger['error'](_0x4a66('0xd'),_0x358eb6,_0x20954d);_0x3d51bf(_0x20954d);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9d9d462..aa25f3e 100644 --- a/server/api/mailAccount/index.js +++ b/server/api/mailAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c4a=['show','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','addInteraction','/:id/applications','addApplications','/:id/send','/:id/users','addAgents','update','delete','removeAnswers','removeImap','removeSmtp','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6c4a,0x162));var _0xa6c4=function(_0x23531f,_0x262dd3){_0x23531f=_0x23531f-0x0;var _0x56b5d3=_0x6c4a[_0x23531f];return _0x56b5d3;};'use strict';var multer=require(_0xa6c4('0x0'));var util=require(_0xa6c4('0x1'));var path=require('path');var timeout=require(_0xa6c4('0x2'));var express=require(_0xa6c4('0x3'));var router=express[_0xa6c4('0x4')]();var auth=require(_0xa6c4('0x5'));var interaction=require(_0xa6c4('0x6'));var config=require(_0xa6c4('0x7'));var controller=require(_0xa6c4('0x8'));router[_0xa6c4('0x9')]('/',auth[_0xa6c4('0xa')](),controller[_0xa6c4('0xb')]);router[_0xa6c4('0x9')](_0xa6c4('0xc'),auth[_0xa6c4('0xa')](),controller['describe']);router[_0xa6c4('0x9')](_0xa6c4('0xd'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0xe')]);router[_0xa6c4('0x9')]('/:id/dispositions',auth[_0xa6c4('0xa')](),controller['getDispositions']);router[_0xa6c4('0x9')](_0xa6c4('0xf'),auth['isAuthenticated'](),controller[_0xa6c4('0x10')]);router[_0xa6c4('0x9')](_0xa6c4('0x11'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x12')]);router[_0xa6c4('0x9')](_0xa6c4('0x13'),auth['isAuthenticated'](),controller[_0xa6c4('0x14')]);router['get'](_0xa6c4('0x15'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x16')]);router[_0xa6c4('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xa6c4('0x9')](_0xa6c4('0x17'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x18')]);router['get'](_0xa6c4('0x19'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x1a')]);router[_0xa6c4('0x9')]('/:id/users',auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x1b')]);router[_0xa6c4('0x1c')](_0xa6c4('0x1d'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x1e')]);router[_0xa6c4('0x1c')]('/:id/canned_answers',auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x1f')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa6c4('0x20')]);router[_0xa6c4('0x1c')](_0xa6c4('0x11'),auth[_0xa6c4('0xa')](),controller['addImap']);router[_0xa6c4('0x1c')](_0xa6c4('0x13'),auth['isAuthenticated'](),controller['addSmtp']);router[_0xa6c4('0x1c')](_0xa6c4('0x15'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x21')]);router[_0xa6c4('0x1c')](_0xa6c4('0x22'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x23')]);router[_0xa6c4('0x1c')](_0xa6c4('0x24'),auth['isAuthenticated'](),controller['send']);router[_0xa6c4('0x1c')](_0xa6c4('0x25'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x26')]);router['put'](_0xa6c4('0xd'),auth['isAuthenticated'](),controller[_0xa6c4('0x27')]);router['delete'](_0xa6c4('0x1d'),auth[_0xa6c4('0xa')](),controller['removeDispositions']);router[_0xa6c4('0x28')](_0xa6c4('0xf'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x29')]);router[_0xa6c4('0x28')](_0xa6c4('0x11'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x2a')]);router[_0xa6c4('0x28')](_0xa6c4('0x13'),auth[_0xa6c4('0xa')](),controller[_0xa6c4('0x2b')]);router[_0xa6c4('0x28')](_0xa6c4('0xd'),auth['isAuthenticated'](),controller[_0xa6c4('0x2c')]);router[_0xa6c4('0x28')](_0xa6c4('0x25'),auth[_0xa6c4('0xa')](),controller['removeAgents']);module[_0xa6c4('0x2d')]=router; \ No newline at end of file +var _0xb57f=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeImap','destroy','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xb57f,0x1c9));var _0xfb57=function(_0x4c8d76,_0x5322b0){_0x4c8d76=_0x4c8d76-0x0;var _0x39a74f=_0xb57f[_0x4c8d76];return _0x39a74f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfb57('0x0'));var timeout=require(_0xfb57('0x1'));var express=require(_0xfb57('0x2'));var router=express[_0xfb57('0x3')]();var auth=require(_0xfb57('0x4'));var interaction=require(_0xfb57('0x5'));var config=require(_0xfb57('0x6'));var controller=require(_0xfb57('0x7'));router[_0xfb57('0x8')]('/',auth[_0xfb57('0x9')](),controller['index']);router['get'](_0xfb57('0xa'),auth[_0xfb57('0x9')](),controller['describe']);router[_0xfb57('0x8')](_0xfb57('0xb'),auth['isAuthenticated'](),controller[_0xfb57('0xc')]);router[_0xfb57('0x8')](_0xfb57('0xd'),auth[_0xfb57('0x9')](),controller[_0xfb57('0xe')]);router[_0xfb57('0x8')](_0xfb57('0xf'),auth['isAuthenticated'](),controller[_0xfb57('0x10')]);router[_0xfb57('0x8')](_0xfb57('0x11'),auth['isAuthenticated'](),controller[_0xfb57('0x12')]);router[_0xfb57('0x8')](_0xfb57('0x13'),auth['isAuthenticated'](),controller[_0xfb57('0x14')]);router[_0xfb57('0x8')](_0xfb57('0x15'),auth[_0xfb57('0x9')](),controller['getInteractions']);router[_0xfb57('0x8')](_0xfb57('0x16'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x17')]);router[_0xfb57('0x8')](_0xfb57('0x18'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x19')]);router[_0xfb57('0x8')](_0xfb57('0x1a'),auth[_0xfb57('0x9')](),controller['verifySmtp']);router[_0xfb57('0x8')](_0xfb57('0x1b'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x1c')]);router[_0xfb57('0x1d')](_0xfb57('0xd'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x1e')]);router[_0xfb57('0x1d')](_0xfb57('0xf'),auth['isAuthenticated'](),controller[_0xfb57('0x1f')]);router[_0xfb57('0x1d')]('/',auth[_0xfb57('0x9')](),controller[_0xfb57('0x20')]);router[_0xfb57('0x1d')](_0xfb57('0x11'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x21')]);router[_0xfb57('0x1d')]('/:id/out_servers',auth[_0xfb57('0x9')](),controller['addSmtp']);router['post'](_0xfb57('0x15'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xfb57('0x1d')](_0xfb57('0x16'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x22')]);router[_0xfb57('0x1d')](_0xfb57('0x23'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x24')]);router[_0xfb57('0x1d')]('/:id/users',auth[_0xfb57('0x9')](),controller[_0xfb57('0x25')]);router[_0xfb57('0x26')]('/:id',auth[_0xfb57('0x9')](),controller[_0xfb57('0x27')]);router['delete']('/:id/dispositions',auth[_0xfb57('0x9')](),controller[_0xfb57('0x28')]);router[_0xfb57('0x29')](_0xfb57('0xf'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x2a')]);router[_0xfb57('0x29')](_0xfb57('0x11'),auth[_0xfb57('0x9')](),controller[_0xfb57('0x2b')]);router[_0xfb57('0x29')](_0xfb57('0x13'),auth['isAuthenticated'](),controller['removeSmtp']);router['delete']('/:id',auth[_0xfb57('0x9')](),controller[_0xfb57('0x2c')]);router[_0xfb57('0x29')](_0xfb57('0x1b'),auth['isAuthenticated'](),controller[_0xfb57('0x2d')]);module[_0xfb57('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7eaf726..b3f394c 100644 --- a/server/api/mailAccount/mailAccount.attributes.js +++ b/server/api/mailAccount/mailAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf159=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x59fb3c,_0x5ebc86){var _0x57747e=function(_0x5c7b07){while(--_0x5c7b07){_0x59fb3c['push'](_0x59fb3c['shift']());}};_0x57747e(++_0x5ebc86);}(_0xf159,0x78));var _0x9f15=function(_0x2a9064,_0x4830ec){_0x2a9064=_0x2a9064-0x0;var _0x3fb3db=_0xf159[_0x2a9064];return _0x3fb3db;};'use strict';var Sequelize=require(_0x9f15('0x0'));module[_0x9f15('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9f15('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9f15('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x9f15('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x9f15('0x4')]},'markAsUnread':{'type':Sequelize[_0x9f15('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9f15('0x2')],'allowNull':![],'defaultValue':_0x9f15('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x9f15('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9f15('0x4')],'defaultValue':function(){return _0x9f15('0x7');}},'notificationSound':{'type':Sequelize[_0x9f15('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f15('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9f15('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9f15('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f15('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9f15('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x9f15('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x9f15('0x3')],'defaultValue':![],'comment':_0x9f15('0xa'),'set':function(_0x125b1c){if(!_0x125b1c)this[_0x9f15('0xb')](_0x9f15('0xc'),null);this[_0x9f15('0xb')]('mandatoryDisposition',_0x125b1c);}}}; \ No newline at end of file +var _0x6413=['UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING','BOOLEAN','TEXT','INTEGER'];(function(_0x3bb7da,_0x48b9a9){var _0x2ac833=function(_0x11ba5f){while(--_0x11ba5f){_0x3bb7da['push'](_0x3bb7da['shift']());}};_0x2ac833(++_0x48b9a9);}(_0x6413,0x95));var _0x3641=function(_0x46a00a,_0x1ebb84){_0x46a00a=_0x46a00a-0x0;var _0x2fc495=_0x6413[_0x46a00a];return _0x2fc495;};'use strict';var Sequelize=require('sequelize');module[_0x3641('0x0')]={'description':{'type':Sequelize[_0x3641('0x1')]},'name':{'type':Sequelize[_0x3641('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3641('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3641('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3641('0x3')]},'markAsUnread':{'type':Sequelize[_0x3641('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3641('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x3641('0x4')](0x2)[_0x3641('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3641('0x3')],'defaultValue':function(){return _0x3641('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3641('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3641('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3641('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3641('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3641('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3641('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x3641('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x3641('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x48d8ce){if(!_0x48d8ce)this['setDataValue'](_0x3641('0x8'),null);this[_0x3641('0x9')](_0x3641('0xa'),_0x48d8ce);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 62904a9..ee70d0c 100644 --- a/server/api/mailAccount/mailAccount.controller.js +++ b/server/api/mailAccount/mailAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf398=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','MailAccounts','UserProfileResource','status','stack','name','send','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','keys','intersection','attributes','query','fields','nolimit','where','filters','pick','filter','VIRTUAL','merge','MailAccount','includeAll','include','findAll','rows','show','params','Imap','options','find','update','body','MailServerOut','describe','addDisposition','MailAccountId','Disposition','create','findOne','hasOwnProperty','order','sort','ids','length','CannedAnswer','removeAnswers','key','ListId','active','isNil','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','password','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','DESC','from','email','attachments','join','root','server/files/attachments','secure','auth','SendMail','sendMail','Contacts','CmContact','List\x20not\x20found','messageId','subject','attach','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','html-pdf'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0xf398,0x181));var _0x8f39=function(_0x29c19e,_0x2ef2af){_0x29c19e=_0x29c19e-0x0;var _0x217287=_0xf398[_0x29c19e];return _0x217287;};'use strict';var pdf=require(_0x8f39('0x0'));var emlformat=require(_0x8f39('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8f39('0x2'));var jsonpatch=require(_0x8f39('0x3'));var rp=require(_0x8f39('0x4'));var moment=require(_0x8f39('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8f39('0x6'));var util=require(_0x8f39('0x7'));var path=require(_0x8f39('0x8'));var sox=require(_0x8f39('0x9'));var csv=require(_0x8f39('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8f39('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8f39('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8f39('0xd'));var Papa=require(_0x8f39('0xe'));var Redis=require(_0x8f39('0xf'));var authService=require(_0x8f39('0x10'));var qs=require(_0x8f39('0x11'));var as=require(_0x8f39('0x12'));var hardwareService=require(_0x8f39('0x13'));var logger=require(_0x8f39('0x14'))('api');var utils=require(_0x8f39('0x15'));var config=require(_0x8f39('0x16'));var db=require(_0x8f39('0x17'))['db'];config[_0x8f39('0x18')]=_[_0x8f39('0x19')](config[_0x8f39('0x18')],{'host':_0x8f39('0x1a'),'port':0x18eb});var socket=require(_0x8f39('0x1b'))(new Redis(config[_0x8f39('0x18')]));require('./mailAccount.socket')[_0x8f39('0x1c')](socket);var jayson=require(_0x8f39('0x1d'));var client=jayson[_0x8f39('0x1e')][_0x8f39('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x5c0e02,_0x23994b,_0x36ff7a){if(_0x36ff7a){var _0x156b64=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x156b64[_0x8f39('0x20')](_0x23994b)){return _0x5c0e02;}else{throw new db['Sequelize'][(_0x8f39('0x21'))](_0x8f39('0x22'));}}else{return _0x5c0e02;}}function respondWithRpcPromise(_0x8f8477,_0x47d524,_0x4f36ab,_0x45d68d){return new BPromise(function(_0x1ec32b,_0x510c3b){var _0x29acba=_0x45d68d||client;return _0x29acba['request'](_0x8f8477,_0x4f36ab)['then'](function(_0x33a7b1){logger['info'](_0x8f39('0x23'),_0x47d524,_0x8f39('0x24'));logger[_0x8f39('0x25')](_0x8f39('0x26'),_0x47d524,'request\x20sent',JSON['stringify'](_0x33a7b1));if(_0x33a7b1[_0x8f39('0x27')]){if(_0x33a7b1[_0x8f39('0x27')][_0x8f39('0x28')]===0x1f4){logger[_0x8f39('0x27')](_0x8f39('0x23'),_0x47d524,_0x33a7b1[_0x8f39('0x27')]['message']);return _0x510c3b(_0x33a7b1[_0x8f39('0x27')]['message']);}logger[_0x8f39('0x27')]('MailAccount,\x20%s,\x20%s',_0x47d524,_0x33a7b1[_0x8f39('0x27')]['message']);return _0x1ec32b(_0x33a7b1['error'][_0x8f39('0x29')]);}else{logger[_0x8f39('0x2a')](_0x8f39('0x23'),_0x47d524,'request\x20sent');_0x1ec32b(_0x33a7b1[_0x8f39('0x2b')]['message']);}})[_0x8f39('0x2c')](function(_0xa8777d){logger[_0x8f39('0x27')](_0x8f39('0x23'),_0x47d524,_0xa8777d);_0x510c3b(_0xa8777d);});});}function respondWithStatusCode(_0x1c18ca,_0x1985d5){_0x1985d5=_0x1985d5||0xcc;return function(_0x50159a){if(_0x50159a){return _0x1c18ca['sendStatus'](_0x1985d5);}return _0x1c18ca['status'](_0x1985d5)[_0x8f39('0x2d')]();};}function respondWithResult(_0x4bf0e8,_0x249a4e){_0x249a4e=_0x249a4e||0xc8;return function(_0x20bd3b){if(_0x20bd3b){return _0x4bf0e8['status'](_0x249a4e)[_0x8f39('0x2e')](_0x20bd3b);}};}function respondWithFilteredResult(_0x521a2b,_0x2383d7){return function(_0x4b95b8){if(_0x4b95b8){var _0x3d0d52=_0x4b95b8[_0x8f39('0x2f')],_0x50edaf=_0x2383d7['offset'],_0x1c8321=_0x2383d7[_0x8f39('0x30')]+_0x2383d7[_0x8f39('0x31')],_0xdb63a5;if(_0x1c8321>=_0x3d0d52){_0x1c8321=_0x3d0d52;_0xdb63a5=0xc8;}else{_0xdb63a5=0xce;}_0x521a2b['status'](_0xdb63a5);return _0x521a2b[_0x8f39('0x32')]('Content-Range',_0x50edaf+'-'+_0x1c8321+'/'+_0x3d0d52)[_0x8f39('0x2e')](_0x4b95b8);}return null;};}function patchUpdates(_0x485693){return function(_0x11f0bb){try{jsonpatch[_0x8f39('0x33')](_0x11f0bb,_0x485693,!![]);}catch(_0x505b87){return BPromise[_0x8f39('0x34')](_0x505b87);}return _0x11f0bb[_0x8f39('0x35')]();};}function saveUpdates(_0x44bc00,_0x8c33e3){return function(_0x53dd11){if(_0x53dd11){return _0x53dd11['update'](_0x44bc00)[_0x8f39('0x36')](function(_0x2c8439){return _0x2c8439;});}return null;};}function removeEntity(_0x1a0305,_0x128476){return function(_0x3db2d1){if(_0x3db2d1){return _0x3db2d1[_0x8f39('0x37')]()[_0x8f39('0x36')](function(){var _0x5477cb=_0x3db2d1[_0x8f39('0x38')]({'plain':!![]});var _0x195acd=_0x8f39('0x39');return db[_0x8f39('0x3a')]['destroy']({'where':{'type':_0x195acd,'resourceId':_0x5477cb['id']}})[_0x8f39('0x36')](function(){return _0x3db2d1;});})[_0x8f39('0x36')](function(){_0x1a0305[_0x8f39('0x3b')](0xcc)[_0x8f39('0x2d')]();});}};}function handleEntityNotFound(_0x247231,_0x54fab0){return function(_0x906412){if(!_0x906412){_0x247231['sendStatus'](0x194);}return _0x906412;};}function handleError(_0x10ec3d,_0x2fca56){_0x2fca56=_0x2fca56||0x1f4;return function(_0x27d9c7){logger[_0x8f39('0x27')](_0x27d9c7[_0x8f39('0x3c')]);if(_0x27d9c7[_0x8f39('0x3d')]){delete _0x27d9c7['name'];}_0x10ec3d[_0x8f39('0x3b')](_0x2fca56)[_0x8f39('0x3e')](_0x27d9c7);};}exports[_0x8f39('0x3f')]=function(_0x231946,_0x571197){var _0x23a2ee={'include':[{'model':db[_0x8f39('0x40')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x8f39('0x41')},{'model':db[_0x8f39('0x42')],'as':_0x8f39('0x43')}]},_0x5416e2={},_0x3b3678={'count':0x0,'rows':[]};var _0x5836e6=_[_0x8f39('0x44')](db['MailAccount'][_0x8f39('0x45')],function(_0x31eb60){return{'name':_0x31eb60['fieldName'],'type':_0x31eb60[_0x8f39('0x46')]['key']};});_0x5416e2[_0x8f39('0x47')]=_['map'](_0x5836e6,'name');_0x5416e2['query']=_[_0x8f39('0x48')](_0x231946['query']);_0x5416e2['filters']=_[_0x8f39('0x49')](_0x5416e2[_0x8f39('0x47')],_0x5416e2['query']);_0x23a2ee[_0x8f39('0x4a')]=_['intersection'](_0x5416e2['model'],qs['fields'](_0x231946[_0x8f39('0x4b')][_0x8f39('0x4c')]));_0x23a2ee[_0x8f39('0x4a')]=_0x23a2ee[_0x8f39('0x4a')]['length']?_0x23a2ee[_0x8f39('0x4a')]:_0x5416e2[_0x8f39('0x47')];if(!_0x231946[_0x8f39('0x4b')]['hasOwnProperty'](_0x8f39('0x4d'))){_0x23a2ee[_0x8f39('0x31')]=qs[_0x8f39('0x31')](_0x231946[_0x8f39('0x4b')][_0x8f39('0x31')]);_0x23a2ee[_0x8f39('0x30')]=qs['offset'](_0x231946['query']['offset']);}_0x23a2ee['order']=qs['sort'](_0x231946[_0x8f39('0x4b')]['sort']);_0x23a2ee[_0x8f39('0x4e')]=qs[_0x8f39('0x4f')](_[_0x8f39('0x50')](_0x231946[_0x8f39('0x4b')],_0x5416e2[_0x8f39('0x4f')]));if(_0x231946[_0x8f39('0x4b')][_0x8f39('0x51')]){_0x23a2ee[_0x8f39('0x4e')]=_['merge'](_0x23a2ee[_0x8f39('0x4e')],{'$or':_[_0x8f39('0x44')](_0x5836e6,function(_0x2d9d14){if(_0x2d9d14[_0x8f39('0x46')]!==_0x8f39('0x52')){var _0x4198b5={};_0x4198b5[_0x2d9d14[_0x8f39('0x3d')]]={'$like':'%'+_0x231946[_0x8f39('0x4b')]['filter']+'%'};return _0x4198b5;}})});}_0x23a2ee=_[_0x8f39('0x53')]({},_0x23a2ee,_0x231946['options']);var _0xbbb13d={'where':_0x23a2ee['where']};return db[_0x8f39('0x54')][_0x8f39('0x2f')](_0xbbb13d)[_0x8f39('0x36')](function(_0x4a2a72){_0x3b3678[_0x8f39('0x2f')]=_0x4a2a72;if(_0x231946[_0x8f39('0x4b')][_0x8f39('0x55')]){_0x23a2ee[_0x8f39('0x56')]=[{'all':!![]}];}return db[_0x8f39('0x54')][_0x8f39('0x57')](_0x23a2ee);})['then'](function(_0x405cce){_0x3b3678[_0x8f39('0x58')]=_0x405cce;return _0x3b3678;})['then'](respondWithFilteredResult(_0x571197,_0x23a2ee))[_0x8f39('0x2c')](handleError(_0x571197,null));};exports[_0x8f39('0x59')]=function(_0x3e2738,_0x522af3){var _0x35a5cb={'raw':![],'where':{'id':_0x3e2738[_0x8f39('0x5a')]['id']},'include':[{'model':db[_0x8f39('0x40')],'as':_0x8f39('0x5b')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x8f39('0x42')],'as':'mandatoryDispositionPause'}]},_0x21bf4a={};_0x21bf4a[_0x8f39('0x47')]=_[_0x8f39('0x48')](db['MailAccount'][_0x8f39('0x45')]);_0x21bf4a[_0x8f39('0x4b')]=_['keys'](_0x3e2738[_0x8f39('0x4b')]);_0x21bf4a['filters']=_[_0x8f39('0x49')](_0x21bf4a[_0x8f39('0x47')],_0x21bf4a[_0x8f39('0x4b')]);_0x35a5cb[_0x8f39('0x4a')]=_['intersection'](_0x21bf4a[_0x8f39('0x47')],qs['fields'](_0x3e2738[_0x8f39('0x4b')][_0x8f39('0x4c')]));_0x35a5cb[_0x8f39('0x4a')]=_0x35a5cb['attributes']['length']?_0x35a5cb[_0x8f39('0x4a')]:_0x21bf4a[_0x8f39('0x47')];if(_0x3e2738[_0x8f39('0x4b')][_0x8f39('0x55')]){_0x35a5cb[_0x8f39('0x56')]=[{'all':!![]}];}_0x35a5cb=_[_0x8f39('0x53')]({},_0x35a5cb,_0x3e2738[_0x8f39('0x5c')]);return db[_0x8f39('0x54')][_0x8f39('0x5d')](_0x35a5cb)[_0x8f39('0x36')](handleEntityNotFound(_0x522af3,null))[_0x8f39('0x36')](respondWithResult(_0x522af3,null))[_0x8f39('0x2c')](handleError(_0x522af3,null));};exports[_0x8f39('0x5e')]=function(_0x571482,_0x232aeb){if(_0x571482[_0x8f39('0x5f')]['id']){delete _0x571482[_0x8f39('0x5f')]['id'];}return db[_0x8f39('0x54')][_0x8f39('0x5d')]({'where':{'id':_0x571482[_0x8f39('0x5a')]['id']},'include':[{'model':db[_0x8f39('0x40')],'as':_0x8f39('0x5b')},{'model':db[_0x8f39('0x60')],'as':'Smtp'},{'model':db[_0x8f39('0x42')],'as':_0x8f39('0x43')}]})[_0x8f39('0x36')](handleEntityNotFound(_0x232aeb,null))[_0x8f39('0x36')](saveUpdates(_0x571482[_0x8f39('0x5f')],null))[_0x8f39('0x36')](function(_0x201a69){if(_0x201a69&&_0x571482['body'][_0x8f39('0x5b')]){return db['MailServerIn']['update'](_0x571482['body'][_0x8f39('0x5b')],{'where':{'MailAccountId':_0x201a69['id']}})['then'](function(){return _0x201a69;});}return _0x201a69;})['then'](function(_0x1fed67){if(_0x1fed67&&_0x571482[_0x8f39('0x5f')][_0x8f39('0x41')]){return db[_0x8f39('0x60')][_0x8f39('0x5e')](_0x571482[_0x8f39('0x5f')][_0x8f39('0x41')],{'where':{'MailAccountId':_0x1fed67['id']}})['then'](function(){return _0x1fed67;});}return _0x1fed67;})[_0x8f39('0x36')](respondWithResult(_0x232aeb,null))['catch'](handleError(_0x232aeb,null));};exports[_0x8f39('0x61')]=function(_0x5b43fa,_0x103a58){return db[_0x8f39('0x54')][_0x8f39('0x61')]()[_0x8f39('0x36')](respondWithResult(_0x103a58,null))[_0x8f39('0x2c')](handleError(_0x103a58,null));};exports[_0x8f39('0x62')]=function(_0x507b3b,_0x2d1ba2,_0x4fab7f){if(_0x507b3b['body']['id']){delete _0x507b3b[_0x8f39('0x5f')]['id'];}return db[_0x8f39('0x54')]['find']({'where':{'id':_0x507b3b['params']['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x2d1ba2,null))[_0x8f39('0x36')](function(_0x2aa1c8){if(_0x2aa1c8){_0x507b3b[_0x8f39('0x5f')][_0x8f39('0x63')]=_0x2aa1c8['id'];return db[_0x8f39('0x64')][_0x8f39('0x65')](_0x507b3b[_0x8f39('0x5f')]);}})[_0x8f39('0x36')](respondWithResult(_0x2d1ba2,null))[_0x8f39('0x2c')](handleError(_0x2d1ba2,null));};exports['getDispositions']=function(_0x3f62f1,_0x22d4d6,_0x22937c){var _0x42f880={'raw':![],'where':{}};var _0x359f98={};var _0xd6bdb1={'count':0x0,'rows':[]};return db['MailAccount'][_0x8f39('0x66')]({'where':{'id':_0x3f62f1[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x22d4d6,null))[_0x8f39('0x36')](function(_0x3e10b1){if(_0x3e10b1){_0x359f98[_0x8f39('0x47')]=_['keys'](db[_0x8f39('0x64')][_0x8f39('0x45')]);_0x359f98[_0x8f39('0x4b')]=_[_0x8f39('0x48')](_0x3f62f1[_0x8f39('0x4b')]);_0x359f98[_0x8f39('0x4f')]=_[_0x8f39('0x49')](_0x359f98['model'],_0x359f98['query']);_0x42f880[_0x8f39('0x4a')]=_[_0x8f39('0x49')](_0x359f98['model'],qs[_0x8f39('0x4c')](_0x3f62f1[_0x8f39('0x4b')][_0x8f39('0x4c')]));_0x42f880['attributes']=_0x42f880[_0x8f39('0x4a')]['length']?_0x42f880[_0x8f39('0x4a')]:_0x359f98[_0x8f39('0x47')];if(!_0x3f62f1[_0x8f39('0x4b')][_0x8f39('0x67')](_0x8f39('0x4d'))){_0x42f880[_0x8f39('0x31')]=qs['limit'](_0x3f62f1[_0x8f39('0x4b')][_0x8f39('0x31')]);_0x42f880[_0x8f39('0x30')]=qs['offset'](_0x3f62f1['query'][_0x8f39('0x30')]);}_0x42f880[_0x8f39('0x68')]=qs[_0x8f39('0x69')](_0x3f62f1[_0x8f39('0x4b')][_0x8f39('0x69')]);_0x42f880[_0x8f39('0x4e')]=qs[_0x8f39('0x4f')](_['pick'](_0x3f62f1[_0x8f39('0x4b')],_0x359f98[_0x8f39('0x4f')]));_0x42f880[_0x8f39('0x4e')]['MailAccountId']=_0x3e10b1['id'];if(_0x3f62f1[_0x8f39('0x4b')][_0x8f39('0x51')]){_0x42f880[_0x8f39('0x4e')]=_['merge'](_0x42f880[_0x8f39('0x4e')],{'$or':_[_0x8f39('0x44')](_0x42f880[_0x8f39('0x4a')],function(_0x2ace35){var _0x2bfe3d={};_0x2bfe3d[_0x2ace35]={'$like':'%'+_0x3f62f1['query']['filter']+'%'};return _0x2bfe3d;})});}_0x42f880=_[_0x8f39('0x53')]({},_0x42f880,_0x3f62f1[_0x8f39('0x5c')]);return db[_0x8f39('0x64')]['count']({'where':_0x42f880[_0x8f39('0x4e')]})[_0x8f39('0x36')](function(_0xb4a3de){_0xd6bdb1['count']=_0xb4a3de;if(_0x3f62f1['query']['includeAll']){_0x42f880['include']=[{'all':!![]}];}return db['Disposition'][_0x8f39('0x57')](_0x42f880);})['then'](function(_0x26761f){_0xd6bdb1[_0x8f39('0x58')]=_0x26761f;return _0xd6bdb1;});}})[_0x8f39('0x36')](respondWithFilteredResult(_0x22d4d6,_0x42f880))[_0x8f39('0x2c')](handleError(_0x22d4d6,null));};exports['removeDispositions']=function(_0x28fafd,_0x5c1fcb,_0x37c103){return db[_0x8f39('0x54')]['find']({'where':{'id':_0x28fafd[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x5c1fcb,null))[_0x8f39('0x36')](function(_0x41158f){if(_0x41158f){return _0x41158f['removeDispositions'](_0x28fafd[_0x8f39('0x4b')][_0x8f39('0x6a')]);}})[_0x8f39('0x36')](respondWithStatusCode(_0x5c1fcb,null))[_0x8f39('0x2c')](handleError(_0x5c1fcb,null));};exports['addAnswer']=function(_0x45770b,_0x55287e,_0x319aa0){if(_0x45770b[_0x8f39('0x5f')]['id']){delete _0x45770b[_0x8f39('0x5f')]['id'];}return db[_0x8f39('0x54')]['find']({'where':{'id':_0x45770b[_0x8f39('0x5a')]['id']}})['then'](handleEntityNotFound(_0x55287e,null))[_0x8f39('0x36')](function(_0x372c93){if(_0x372c93){_0x45770b[_0x8f39('0x5f')][_0x8f39('0x63')]=_0x372c93['id'];return db['CannedAnswer']['create'](_0x45770b[_0x8f39('0x5f')]);}})[_0x8f39('0x36')](respondWithResult(_0x55287e,null))[_0x8f39('0x2c')](handleError(_0x55287e,null));};exports['getAnswers']=function(_0x457e26,_0x40a8d2,_0x39197b){var _0x1fe93b={'raw':![],'where':{}};var _0x4cc99d={};var _0x35a53f={'count':0x0,'rows':[]};return db[_0x8f39('0x54')]['findOne']({'where':{'id':_0x457e26[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x40a8d2,null))['then'](function(_0x44195e){if(_0x44195e){_0x4cc99d['model']=_[_0x8f39('0x48')](db['CannedAnswer'][_0x8f39('0x45')]);_0x4cc99d[_0x8f39('0x4b')]=_[_0x8f39('0x48')](_0x457e26[_0x8f39('0x4b')]);_0x4cc99d['filters']=_[_0x8f39('0x49')](_0x4cc99d[_0x8f39('0x47')],_0x4cc99d[_0x8f39('0x4b')]);_0x1fe93b[_0x8f39('0x4a')]=_[_0x8f39('0x49')](_0x4cc99d[_0x8f39('0x47')],qs[_0x8f39('0x4c')](_0x457e26[_0x8f39('0x4b')][_0x8f39('0x4c')]));_0x1fe93b[_0x8f39('0x4a')]=_0x1fe93b['attributes'][_0x8f39('0x6b')]?_0x1fe93b[_0x8f39('0x4a')]:_0x4cc99d['model'];if(!_0x457e26[_0x8f39('0x4b')][_0x8f39('0x67')](_0x8f39('0x4d'))){_0x1fe93b[_0x8f39('0x31')]=qs[_0x8f39('0x31')](_0x457e26[_0x8f39('0x4b')]['limit']);_0x1fe93b[_0x8f39('0x30')]=qs[_0x8f39('0x30')](_0x457e26[_0x8f39('0x4b')][_0x8f39('0x30')]);}_0x1fe93b[_0x8f39('0x68')]=qs[_0x8f39('0x69')](_0x457e26[_0x8f39('0x4b')][_0x8f39('0x69')]);_0x1fe93b[_0x8f39('0x4e')]=qs[_0x8f39('0x4f')](_[_0x8f39('0x50')](_0x457e26[_0x8f39('0x4b')],_0x4cc99d[_0x8f39('0x4f')]));_0x1fe93b[_0x8f39('0x4e')][_0x8f39('0x63')]=_0x44195e['id'];if(_0x457e26[_0x8f39('0x4b')][_0x8f39('0x51')]){_0x1fe93b[_0x8f39('0x4e')]=_[_0x8f39('0x53')](_0x1fe93b[_0x8f39('0x4e')],{'$or':_[_0x8f39('0x44')](_0x1fe93b[_0x8f39('0x4a')],function(_0x2d2f0f){var _0x25f9f1={};_0x25f9f1[_0x2d2f0f]={'$like':'%'+_0x457e26[_0x8f39('0x4b')][_0x8f39('0x51')]+'%'};return _0x25f9f1;})});}_0x1fe93b=_[_0x8f39('0x53')]({},_0x1fe93b,_0x457e26[_0x8f39('0x5c')]);return db[_0x8f39('0x6c')][_0x8f39('0x2f')]({'where':_0x1fe93b[_0x8f39('0x4e')]})['then'](function(_0x2d66b1){_0x35a53f[_0x8f39('0x2f')]=_0x2d66b1;if(_0x457e26[_0x8f39('0x4b')][_0x8f39('0x55')]){_0x1fe93b[_0x8f39('0x56')]=[{'all':!![]}];}return db[_0x8f39('0x6c')][_0x8f39('0x57')](_0x1fe93b);})[_0x8f39('0x36')](function(_0x73d7b4){_0x35a53f[_0x8f39('0x58')]=_0x73d7b4;return _0x35a53f;});}})[_0x8f39('0x36')](respondWithFilteredResult(_0x40a8d2,_0x1fe93b))[_0x8f39('0x2c')](handleError(_0x40a8d2,null));};exports[_0x8f39('0x6d')]=function(_0x27f59e,_0x6f1985,_0x58ad37){return db[_0x8f39('0x54')][_0x8f39('0x5d')]({'where':{'id':_0x27f59e[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x6f1985,null))[_0x8f39('0x36')](function(_0x23ad9a){if(_0x23ad9a){return _0x23ad9a[_0x8f39('0x6d')](_0x27f59e[_0x8f39('0x4b')]['ids']);}})[_0x8f39('0x36')](respondWithStatusCode(_0x6f1985,null))['catch'](handleError(_0x6f1985,null));};exports[_0x8f39('0x65')]=function(_0x27cad7,_0x3db568){var _0x510101={'name':_0x27cad7['body'][_0x8f39('0x3d')],'key':_0x27cad7['body'][_0x8f39('0x6e')],'email':_0x27cad7[_0x8f39('0x5f')]['email'],'ListId':_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x6f')],'active':!_['isNil'](_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x70')])?_0x27cad7[_0x8f39('0x5f')]['active']:!![],'description':_0x27cad7[_0x8f39('0x5f')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x8f39('0x71')](_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x72')])){if(_0x27cad7['body'][_0x8f39('0x73')]){_0x510101[_0x8f39('0x5b')][_0x8f39('0x74')]=_0x510101['Smtp'][_0x8f39('0x74')]=_0x27cad7['body'][_0x8f39('0x75')];_0x510101[_0x8f39('0x5b')]['password']=_0x510101[_0x8f39('0x41')][_0x8f39('0x76')]=_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x77')];}else{_0x510101[_0x8f39('0x5b')][_0x8f39('0x78')]=_0x510101[_0x8f39('0x41')][_0x8f39('0x78')]=![];}_0x510101[_0x8f39('0x5b')][_0x8f39('0x79')]=_0x27cad7[_0x8f39('0x5f')]['Imap']['host'];_0x510101['Imap'][_0x8f39('0x7a')]=_0x27cad7['body'][_0x8f39('0x5b')]['port'];_0x510101['Smtp']['host']=_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x41')]['host'];_0x510101[_0x8f39('0x41')][_0x8f39('0x7a')]=_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x41')]['port'];}else{_0x510101[_0x8f39('0x5b')][_0x8f39('0x7b')]=_0x510101[_0x8f39('0x41')][_0x8f39('0x7b')]=_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x72')];_0x510101[_0x8f39('0x5b')][_0x8f39('0x74')]=_0x510101['Smtp']['user']=_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x75')];_0x510101[_0x8f39('0x5b')][_0x8f39('0x7c')]=_0x510101[_0x8f39('0x41')][_0x8f39('0x76')]=_0x27cad7[_0x8f39('0x5f')][_0x8f39('0x77')];}return db[_0x8f39('0x54')]['create'](_0x510101,{'include':[{'model':db['MailServerOut'],'as':_0x8f39('0x41')},{'model':db[_0x8f39('0x40')],'as':_0x8f39('0x5b')}]})[_0x8f39('0x36')](function(_0x467cdf){var _0x6eaabc=_0x27cad7['user']['get']({'plain':!![]});if(!_0x6eaabc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6eaabc[_0x8f39('0x7d')]===_0x8f39('0x74')){var _0x28ca93=_0x467cdf[_0x8f39('0x38')]({'plain':!![]});return db[_0x8f39('0x7e')][_0x8f39('0x5d')]({'where':{'name':_0x8f39('0x39'),'userProfileId':_0x6eaabc[_0x8f39('0x7f')]},'raw':!![]})[_0x8f39('0x36')](function(_0xfc511){if(_0xfc511&&_0xfc511[_0x8f39('0x80')]===0x0){return db[_0x8f39('0x3a')][_0x8f39('0x65')]({'name':_0x28ca93[_0x8f39('0x3d')],'resourceId':_0x28ca93['id'],'type':_0xfc511['name'],'sectionId':_0xfc511['id']},{})['then'](function(){return _0x467cdf;});}else{return _0x467cdf;}})[_0x8f39('0x2c')](function(_0xffa2e6){logger[_0x8f39('0x27')](_0x8f39('0x81'),_0xffa2e6);throw _0xffa2e6;});}return _0x467cdf;})['then'](respondWithResult(_0x3db568,0xc9))['catch'](handleError(_0x3db568,null));};exports[_0x8f39('0x82')]=function(_0x1563c1,_0x289888,_0x3e685e){return db[_0x8f39('0x54')][_0x8f39('0x66')]({'where':{'id':_0x1563c1[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x289888,null))[_0x8f39('0x36')](function(_0x52c920){if(_0x52c920){return _0x52c920[_0x8f39('0x82')]();}return null;})[_0x8f39('0x36')](respondWithResult(_0x289888,null))[_0x8f39('0x2c')](handleError(_0x289888,null));};exports[_0x8f39('0x83')]=function(_0x3a85dd,_0x47e957,_0xb474b){if(_0x3a85dd[_0x8f39('0x5f')]['id']){delete _0x3a85dd[_0x8f39('0x5f')]['id'];}return db[_0x8f39('0x54')][_0x8f39('0x5d')]({'where':{'id':_0x3a85dd['params']['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x47e957,null))[_0x8f39('0x36')](function(_0x9de87){if(_0x9de87){_0x3a85dd[_0x8f39('0x5f')][_0x8f39('0x63')]=_0x9de87['id'];return db[_0x8f39('0x40')][_0x8f39('0x65')](_0x3a85dd[_0x8f39('0x5f')]);}})['then'](respondWithResult(_0x47e957,null))[_0x8f39('0x2c')](handleError(_0x47e957,null));};exports[_0x8f39('0x84')]=function(_0x109e95,_0x590a35,_0xd74478){return db['MailAccount']['findOne']({'where':{'id':_0x109e95[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x590a35,null))['then'](function(_0x5bbf2f){if(_0x5bbf2f){return _0x5bbf2f[_0x8f39('0x85')](null);}return null;})[_0x8f39('0x36')](respondWithStatusCode(_0x590a35,null))[_0x8f39('0x2c')](handleError(_0x590a35,null));};exports[_0x8f39('0x86')]=function(_0x3a4389,_0x3d8f3a,_0x4ad965){return db[_0x8f39('0x54')][_0x8f39('0x66')]({'where':{'id':_0x3a4389[_0x8f39('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3d8f3a,null))[_0x8f39('0x36')](function(_0xfee22e){if(_0xfee22e){return _0xfee22e[_0x8f39('0x86')]();}return null;})[_0x8f39('0x36')](respondWithResult(_0x3d8f3a,null))[_0x8f39('0x2c')](handleError(_0x3d8f3a,null));};exports['addSmtp']=function(_0x2b7169,_0x534880,_0x147a6e){if(_0x2b7169[_0x8f39('0x5f')]['id']){delete _0x2b7169[_0x8f39('0x5f')]['id'];}return db[_0x8f39('0x54')][_0x8f39('0x5d')]({'where':{'id':_0x2b7169[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x534880,null))[_0x8f39('0x36')](function(_0x29a830){if(_0x29a830){_0x2b7169['body'][_0x8f39('0x63')]=_0x29a830['id'];return db[_0x8f39('0x60')][_0x8f39('0x65')](_0x2b7169['body']);}})['then'](respondWithResult(_0x534880,null))[_0x8f39('0x2c')](handleError(_0x534880,null));};exports['removeSmtp']=function(_0x36aad5,_0xd47bab,_0xbc59bf){return db[_0x8f39('0x54')][_0x8f39('0x66')]({'where':{'id':_0x36aad5[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0xd47bab,null))[_0x8f39('0x36')](function(_0x193944){if(_0x193944){return _0x193944[_0x8f39('0x87')](null);}return null;})[_0x8f39('0x36')](respondWithStatusCode(_0xd47bab,null))[_0x8f39('0x2c')](handleError(_0xd47bab,null));};exports[_0x8f39('0x88')]=function(_0x533bea,_0x556bfe,_0x209e1c){return db[_0x8f39('0x89')][_0x8f39('0x5d')]({'where':{'id':_0x533bea[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x556bfe,null))[_0x8f39('0x36')](function(_0x523aaf){if(_0x523aaf){return _0x523aaf[_0x8f39('0x88')](_0x533bea[_0x8f39('0x5f')][_0x8f39('0x6a')],_[_0x8f39('0x8a')](_0x533bea[_0x8f39('0x5f')],[_0x8f39('0x6a'),'id'])||{});}})[_0x8f39('0x36')](respondWithResult(_0x556bfe,null))[_0x8f39('0x2c')](handleError(_0x556bfe,null));};exports['getInteractions']=function(_0x507445,_0x495eec,_0x34f4ec){var _0x12bd1f={'raw':![],'where':{}};var _0x858052={};var _0x374880={'count':0x0,'rows':[]};return db['MailAccount'][_0x8f39('0x66')]({'where':{'id':_0x507445['params']['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x495eec,null))[_0x8f39('0x36')](function(_0x1c874b){if(_0x1c874b){_0x858052['model']=_['keys'](db['MailInteraction']['rawAttributes']);_0x858052[_0x8f39('0x4b')]=_['keys'](_0x507445['query']);_0x858052[_0x8f39('0x4f')]=_['intersection'](_0x858052['model'],_0x858052[_0x8f39('0x4b')]);_0x12bd1f[_0x8f39('0x4a')]=_[_0x8f39('0x49')](_0x858052['model'],qs[_0x8f39('0x4c')](_0x507445[_0x8f39('0x4b')][_0x8f39('0x4c')]));_0x12bd1f[_0x8f39('0x4a')]=_0x12bd1f[_0x8f39('0x4a')][_0x8f39('0x6b')]?_0x12bd1f[_0x8f39('0x4a')]:_0x858052[_0x8f39('0x47')];if(!_0x507445[_0x8f39('0x4b')][_0x8f39('0x67')](_0x8f39('0x4d'))){_0x12bd1f[_0x8f39('0x31')]=qs[_0x8f39('0x31')](_0x507445[_0x8f39('0x4b')][_0x8f39('0x31')]);_0x12bd1f['offset']=qs[_0x8f39('0x30')](_0x507445[_0x8f39('0x4b')][_0x8f39('0x30')]);}_0x12bd1f[_0x8f39('0x68')]=qs[_0x8f39('0x69')](_0x507445[_0x8f39('0x4b')][_0x8f39('0x69')]);_0x12bd1f[_0x8f39('0x4e')]=qs['filters'](_['pick'](_0x507445[_0x8f39('0x4b')],_0x858052[_0x8f39('0x4f')]));_0x12bd1f['where'][_0x8f39('0x63')]=_0x1c874b['id'];if(_0x507445[_0x8f39('0x4b')][_0x8f39('0x51')]){_0x12bd1f[_0x8f39('0x4e')]=_['merge'](_0x12bd1f[_0x8f39('0x4e')],{'$or':_[_0x8f39('0x44')](_0x12bd1f[_0x8f39('0x4a')],function(_0x349fc6){var _0xdf9341={};_0xdf9341[_0x349fc6]={'$like':'%'+_0x507445[_0x8f39('0x4b')][_0x8f39('0x51')]+'%'};return _0xdf9341;})});}_0x12bd1f=_[_0x8f39('0x53')]({},_0x12bd1f,_0x507445[_0x8f39('0x5c')]);return db['MailInteraction'][_0x8f39('0x2f')]({'where':_0x12bd1f['where']})[_0x8f39('0x36')](function(_0x3e1a8a){_0x374880[_0x8f39('0x2f')]=_0x3e1a8a;if(_0x507445[_0x8f39('0x4b')][_0x8f39('0x55')]){_0x12bd1f[_0x8f39('0x56')]=[{'model':db['CmContact'],'as':_0x8f39('0x8b'),'required':![]},{'model':db['User'],'as':_0x8f39('0x8c'),'attributes':[_0x8f39('0x3d'),_0x8f39('0x8d'),_0x8f39('0x8e')],'required':![]},{'model':db[_0x8f39('0x8f')],'as':'Tags','attributes':['id',_0x8f39('0x3d'),_0x8f39('0x90')],'where':_0x507445['query']['tag']?{'id':_0x507445['query'][_0x8f39('0x91')]}:undefined,'required':_0x507445[_0x8f39('0x4b')][_0x8f39('0x91')]?!![]:![]}];}return db[_0x8f39('0x89')][_0x8f39('0x57')](_0x12bd1f);})[_0x8f39('0x36')](function(_0x21944c){_0x374880['rows']=_0x21944c;return _0x374880;});}})[_0x8f39('0x36')](respondWithFilteredResult(_0x495eec,_0x12bd1f))[_0x8f39('0x2c')](handleError(_0x495eec,null));};exports[_0x8f39('0x92')]=function(_0x282a7b,_0x3cd96a,_0x2473da){return db['MailAccount'][_0x8f39('0x66')]({'where':{'id':_0x282a7b['params']['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x3cd96a,null))[_0x8f39('0x36')](function(_0x7ff4d8){if(_0x7ff4d8){return db[_0x8f39('0x93')][_0x8f39('0x94')](function(_0x12af13){return db[_0x8f39('0x95')][_0x8f39('0x37')]({'where':{'MailAccountId':_0x282a7b[_0x8f39('0x5a')]['id']},'transaction':_0x12af13})[_0x8f39('0x36')](function(_0xf31f98){var _0x10848a=_['map'](_0x282a7b['body'],function(_0x5cb2b8){_0x5cb2b8[_0x8f39('0x63')]=_0x282a7b[_0x8f39('0x5a')]['id'];return _0x5cb2b8;});return db[_0x8f39('0x95')]['bulkCreate'](_0x10848a,{'transaction':_0x12af13});});})[_0x8f39('0x36')](function(){return db[_0x8f39('0x95')][_0x8f39('0x96')]({'where':{'MailAccountId':_0x282a7b[_0x8f39('0x5a')]['id']},'order':_0x8f39('0x97')});});}})[_0x8f39('0x36')](respondWithResult(_0x3cd96a,null))[_0x8f39('0x2c')](handleError(_0x3cd96a,null));};exports[_0x8f39('0x98')]=function(_0x48a33a,_0x4a2d9a,_0x326afd){var _0x3c827b={};var _0x927c5f={};var _0x545bbc;var _0x4f73f8;return db[_0x8f39('0x54')][_0x8f39('0x66')]({'where':{'id':_0x48a33a['params']['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x4a2d9a,null))['then'](function(_0x3651c7){if(_0x3651c7){_0x545bbc=_0x3651c7;_0x927c5f[_0x8f39('0x47')]=_[_0x8f39('0x48')](db[_0x8f39('0x95')][_0x8f39('0x45')]);_0x927c5f[_0x8f39('0x4b')]=_['keys'](_0x48a33a['query']);_0x927c5f['filters']=_[_0x8f39('0x49')](_0x927c5f[_0x8f39('0x47')],_0x927c5f[_0x8f39('0x4b')]);_0x3c827b[_0x8f39('0x4a')]=_[_0x8f39('0x49')](_0x927c5f[_0x8f39('0x47')],qs['fields'](_0x48a33a[_0x8f39('0x4b')][_0x8f39('0x4c')]));_0x3c827b[_0x8f39('0x4a')]=_0x3c827b[_0x8f39('0x4a')][_0x8f39('0x6b')]?_0x3c827b[_0x8f39('0x4a')]:_0x927c5f[_0x8f39('0x47')];_0x3c827b[_0x8f39('0x68')]=qs[_0x8f39('0x69')](_0x48a33a['query'][_0x8f39('0x69')]);_0x3c827b[_0x8f39('0x4e')]=qs['filters'](_[_0x8f39('0x50')](_0x48a33a[_0x8f39('0x4b')],_0x927c5f['filters']));if(_0x48a33a[_0x8f39('0x4b')][_0x8f39('0x51')]){_0x3c827b[_0x8f39('0x4e')]=_[_0x8f39('0x53')](_0x3c827b[_0x8f39('0x4e')],{'$or':_[_0x8f39('0x44')](_0x3c827b[_0x8f39('0x4a')],function(_0x33a33b){var _0x54319d={};_0x54319d[_0x33a33b]={'$like':'%'+_0x48a33a[_0x8f39('0x4b')][_0x8f39('0x51')]+'%'};return _0x54319d;})});}_0x3c827b=_[_0x8f39('0x53')]({},_0x3c827b,_0x48a33a['options']);return _0x545bbc[_0x8f39('0x98')](_0x3c827b);}})[_0x8f39('0x36')](function(_0x24e2b7){if(_0x24e2b7){_0x4f73f8=_0x24e2b7[_0x8f39('0x6b')];if(!_0x48a33a[_0x8f39('0x4b')][_0x8f39('0x67')]('nolimit')){_0x3c827b[_0x8f39('0x31')]=qs[_0x8f39('0x31')](_0x48a33a[_0x8f39('0x4b')][_0x8f39('0x31')]);_0x3c827b['offset']=qs[_0x8f39('0x30')](_0x48a33a[_0x8f39('0x4b')][_0x8f39('0x30')]);}return _0x545bbc['getApplications'](_0x3c827b);}})['then'](function(_0x2fffcb){if(_0x2fffcb){return _0x2fffcb?{'count':_0x4f73f8,'rows':_0x2fffcb}:null;}})[_0x8f39('0x36')](respondWithResult(_0x4a2d9a,null))[_0x8f39('0x2c')](handleError(_0x4a2d9a,null));};exports[_0x8f39('0x99')]=function(_0x2df20f,_0x33ad06,_0x1d4761){var _0x31bee0={'raw':!![],'where':{}};var _0x23d0b4={};var _0x294a9e={'count':0x0,'rows':[]};return db[_0x8f39('0x54')][_0x8f39('0x66')]({'where':{'id':_0x2df20f[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x33ad06,null))[_0x8f39('0x36')](function(_0x2daf26){if(_0x2daf26){_0x23d0b4[_0x8f39('0x47')]=_[_0x8f39('0x48')](db['MailMessage']['rawAttributes']);_0x23d0b4['query']=_[_0x8f39('0x48')](_0x2df20f[_0x8f39('0x4b')]);_0x23d0b4[_0x8f39('0x4f')]=_[_0x8f39('0x49')](_0x23d0b4[_0x8f39('0x47')],_0x23d0b4[_0x8f39('0x4b')]);_0x31bee0['attributes']=_[_0x8f39('0x49')](_0x23d0b4['model'],qs['fields'](_0x2df20f[_0x8f39('0x4b')][_0x8f39('0x4c')]));_0x31bee0[_0x8f39('0x4a')]=_0x31bee0[_0x8f39('0x4a')][_0x8f39('0x6b')]?_0x31bee0[_0x8f39('0x4a')]:_0x23d0b4[_0x8f39('0x47')];if(!_0x2df20f['query'][_0x8f39('0x67')](_0x8f39('0x4d'))){_0x31bee0[_0x8f39('0x31')]=qs[_0x8f39('0x31')](_0x2df20f[_0x8f39('0x4b')]['limit']);_0x31bee0['offset']=qs['offset'](_0x2df20f[_0x8f39('0x4b')][_0x8f39('0x30')]);}_0x31bee0['order']=qs['sort'](_0x2df20f[_0x8f39('0x4b')][_0x8f39('0x69')]);_0x31bee0[_0x8f39('0x4e')]=qs['filters'](_['pick'](_0x2df20f['query'],_0x23d0b4[_0x8f39('0x4f')]));_0x31bee0['where'][_0x8f39('0x63')]=_0x2daf26['id'];if(_0x2df20f[_0x8f39('0x4b')][_0x8f39('0x51')]){_0x31bee0[_0x8f39('0x4e')]=_[_0x8f39('0x53')](_0x31bee0[_0x8f39('0x4e')],{'$or':_[_0x8f39('0x44')](_0x31bee0[_0x8f39('0x4a')],function(_0x63e9f6){var _0x345984={};_0x345984[_0x63e9f6]={'$like':'%'+_0x2df20f['query'][_0x8f39('0x51')]+'%'};return _0x345984;})});}if(_0x2df20f[_0x8f39('0x4b')][_0x8f39('0x9a')]){var _0xd307c6=_0x2df20f['query'][_0x8f39('0x9a')][_0x8f39('0x9b')](',');var _0x176896={};_0x176896[_0xd307c6[0x0]]={'$gte':moment(_0xd307c6[0x1])[_0x8f39('0x9c')](_0x8f39('0x9d'))};_0x31bee0[_0x8f39('0x4e')]=_[_0x8f39('0x53')](_0x31bee0[_0x8f39('0x4e')],_0x176896);}_0x31bee0=_[_0x8f39('0x53')]({},_0x31bee0,_0x2df20f['options']);return db[_0x8f39('0x9e')][_0x8f39('0x2f')]({'where':_0x31bee0['where']})['then'](function(_0x2b5d18){_0x294a9e[_0x8f39('0x2f')]=_0x2b5d18;if(_0x2df20f[_0x8f39('0x4b')][_0x8f39('0x55')]){_0x31bee0[_0x8f39('0x56')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x31bee0);})[_0x8f39('0x36')](function(_0x247e02){_0x294a9e[_0x8f39('0x58')]=_0x247e02;return _0x294a9e;});}})[_0x8f39('0x36')](respondWithFilteredResult(_0x33ad06,_0x31bee0))['catch'](handleError(_0x33ad06,null));};exports[_0x8f39('0x3e')]=function(_0x210b8a,_0x2489db,_0x445195){var _0x4ed5fa,_0x226aae={},_0xdbbb57;if(_0x210b8a[_0x8f39('0x5f')]['to']){_0xdbbb57=_0x210b8a[_0x8f39('0x5f')]['to'][_0x8f39('0x9b')](',')[0x0];}return db[_0x8f39('0x54')][_0x8f39('0x5d')]({'where':{'id':_0x210b8a[_0x8f39('0x5a')]['id']},'include':[{'model':db[_0x8f39('0x9f')],'as':_0x8f39('0xa0'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0xdbbb57},'limit':0x1,'order':[['updatedAt',_0x8f39('0xa1')]]}]},{'model':db['MailServerOut'],'as':_0x8f39('0x41'),'raw':!![]}]})[_0x8f39('0x36')](handleEntityNotFound(_0x2489db,null))[_0x8f39('0x36')](function(_0x223b7b){if(_0x223b7b){_0x4ed5fa=_0x223b7b;if(_0x223b7b[_0x8f39('0x41')]){if(_[_0x8f39('0x71')](_0x210b8a[_0x8f39('0x5f')]['from'])){_0x210b8a['body'][_0x8f39('0xa2')]=util[_0x8f39('0x9c')]('%s\x20<%s>',_0x223b7b[_0x8f39('0x3d')],_0x223b7b[_0x8f39('0xa3')]||_0x223b7b['Smtp'][_0x8f39('0x74')]);}if(_0x210b8a[_0x8f39('0x5f')][_0x8f39('0xa4')]&&_0x210b8a['body'][_0x8f39('0xa4')][_0x8f39('0x6b')]){for(var _0x5e6bd6=0x0;_0x5e6bd6<_0x210b8a[_0x8f39('0x5f')]['attachments'][_0x8f39('0x6b')];_0x5e6bd6+=0x1){_0x210b8a[_0x8f39('0x5f')][_0x8f39('0xa4')][_0x5e6bd6]={'filename':_0x210b8a[_0x8f39('0x5f')][_0x8f39('0xa4')][_0x5e6bd6][_0x8f39('0x3d')],'path':path[_0x8f39('0xa5')](config[_0x8f39('0xa6')],_0x8f39('0xa7'),_0x210b8a[_0x8f39('0x5f')][_0x8f39('0xa4')][_0x5e6bd6]['basename'])};}}var _0x47856d={'tls':{'rejectUnauthorized':![]}};if(_[_0x8f39('0x71')](_0x223b7b['Smtp'][_0x8f39('0x7b')])){if(_0x223b7b[_0x8f39('0x41')][_0x8f39('0x78')]){_0x47856d['auth']={'user':_0x223b7b[_0x8f39('0x41')][_0x8f39('0x74')],'pass':_0x223b7b[_0x8f39('0x41')]['pass']};}_0x47856d['host']=_0x223b7b[_0x8f39('0x41')][_0x8f39('0x79')];_0x47856d['port']=_0x223b7b['Smtp'][_0x8f39('0x7a')];_0x47856d[_0x8f39('0xa8')]=_0x223b7b[_0x8f39('0x41')][_0x8f39('0xa8')];}else{_0x47856d[_0x8f39('0x7b')]=_0x223b7b['Smtp']['service'];_0x47856d[_0x8f39('0xa9')]={'user':_0x223b7b[_0x8f39('0x41')][_0x8f39('0x74')],'pass':_0x223b7b[_0x8f39('0x41')][_0x8f39('0x76')]};}return respondWithRpcPromise(_0x8f39('0xaa'),_0x8f39('0xab'),{'account':_0x47856d,'message':_0x210b8a['body']});}else{throw new Error('List\x20not\x20found');}}})[_0x8f39('0x36')](function(_0x5108df){if(_0x5108df){_0x226aae=_0x5108df;if(_0x4ed5fa['List']){if(_0x4ed5fa['List']['Contacts'][_0x8f39('0x6b')]){return _0x4ed5fa[_0x8f39('0xa0')][_0x8f39('0xac')][0x0];}else{return db[_0x8f39('0xad')][_0x8f39('0x65')](_['defaults'](_0x210b8a[_0x8f39('0x5f')],{'firstName':_0x210b8a[_0x8f39('0x5f')]['to'],'email':_0x210b8a['body']['to'],'phone':_0x210b8a[_0x8f39('0x5f')]['to'],'ListId':_0x4ed5fa['ListId']}));}}else{throw new Error(_0x8f39('0xae'));}}})[_0x8f39('0x36')](function(_0x30fe54){if(_0x30fe54){var _0x10344f={'UserId':_0x210b8a[_0x8f39('0x74')]['id'],'ContactId':_0x30fe54['id'],'MailAccountId':_0x4ed5fa['id'],'inReplyTo':_0x226aae[_0x8f39('0xaf')],'to':_0x210b8a['body'][_0x8f39('0xa2')],'cc':_0x210b8a[_0x8f39('0x5f')]['cc'],'subject':_0x210b8a[_0x8f39('0x5f')][_0x8f39('0xb0')],'attach':_0x210b8a['body'][_0x8f39('0xb1')],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0x210b8a[_0x8f39('0x5f')][_0x8f39('0x5f')],'Messages':[_[_0x8f39('0x53')](_0x210b8a['body'],{'messageId':_0x226aae[_0x8f39('0xaf')],'sentAt':moment()[_0x8f39('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x4ed5fa['id'],'UserId':_0x210b8a[_0x8f39('0x74')]['id'],'ContactId':_0x30fe54['id']})]};if(_0x210b8a[_0x8f39('0x5f')]['Interaction']){_0x10344f=_[_0x8f39('0x53')](_0x10344f,_0x210b8a[_0x8f39('0x5f')][_0x8f39('0xb2')]);}return db[_0x8f39('0x89')][_0x8f39('0x65')](_0x10344f,{'include':[{'model':db[_0x8f39('0x9e')],'as':_0x8f39('0xb3')}]});}})['then'](respondWithResult(_0x2489db,null))[_0x8f39('0x2c')](handleError(_0x2489db,null));};exports[_0x8f39('0xb4')]=function(_0x2ec6e3,_0x377765,_0xedfdc9){return db[_0x8f39('0x54')][_0x8f39('0x5d')]({'where':{'id':_0x2ec6e3[_0x8f39('0x5a')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x8f39('0x36')](handleEntityNotFound(_0x377765,null))[_0x8f39('0x36')](function(_0x3560e3){if(_0x3560e3&&_0x3560e3['Smtp']){var _0x244865={'id':_0x3560e3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3560e3['Smtp'][_0x8f39('0x7b')]){_0x244865['service']=_0x3560e3[_0x8f39('0x41')][_0x8f39('0x7b')];}else{_0x244865['host']=_0x3560e3[_0x8f39('0x41')]['host'];_0x244865['port']=_0x3560e3['Smtp'][_0x8f39('0x7a')];_0x244865[_0x8f39('0xa8')]=_0x3560e3[_0x8f39('0x41')]['secure'];}if(_0x3560e3[_0x8f39('0x41')]['authentication']){_0x244865['auth']={'user':_0x3560e3[_0x8f39('0x41')][_0x8f39('0x74')],'pass':_0x3560e3[_0x8f39('0x41')][_0x8f39('0x76')]};}return respondWithRpcPromise(_0x8f39('0xb5'),'verifySmtp',{'account':_0x244865});}})[_0x8f39('0x36')](respondWithResult(_0x377765,null))[_0x8f39('0x2c')](handleError(_0x377765,null));};exports['destroy']=function(_0x420b5f,_0x2ad91c){return db['MailAccount'][_0x8f39('0x5d')]({'where':{'id':_0x420b5f[_0x8f39('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2ad91c,null))[_0x8f39('0x36')](function(_0x1a0cda){if(_0x1a0cda&&_0x1a0cda['service']){throw new db[(_0x8f39('0xb6'))]['ValidationError'](_0x8f39('0xb7'));}return _0x1a0cda;})[_0x8f39('0x36')](removeEntity(_0x2ad91c,null))[_0x8f39('0x2c')](handleError(_0x2ad91c,null));};exports[_0x8f39('0xb8')]=function(_0x5eed96,_0x52e396,_0x52e29a){return db['MailAccount'][_0x8f39('0x5d')]({'where':{'id':_0x5eed96[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x52e396,null))[_0x8f39('0x36')](function(_0x4d13be){if(_0x4d13be){return _0x4d13be['addAgents'](_0x5eed96[_0x8f39('0x5f')][_0x8f39('0x6a')],_[_0x8f39('0x8a')](_0x5eed96[_0x8f39('0x5f')],[_0x8f39('0x6a'),'id'])||{})[_0x8f39('0xb9')](function(_0x581b96){for(var _0x470ae1=0x0;_0x470ae1<_0x5eed96[_0x8f39('0x5f')]['ids'][_0x8f39('0x6b')];_0x470ae1+=0x1){socket[_0x8f39('0xba')](_0x8f39('0xbb'),{'UserId':_0x5eed96['body']['ids'][_0x470ae1],'MailAccountId':_0x5eed96['params']['id']});}return _0x581b96;});}})[_0x8f39('0x36')](respondWithResult(_0x52e396,null))[_0x8f39('0x2c')](handleError(_0x52e396,null));};exports[_0x8f39('0xbc')]=function(_0x52999a,_0x5aa7b2,_0x87ea28){return db[_0x8f39('0x54')][_0x8f39('0x5d')]({'where':{'id':_0x52999a[_0x8f39('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5aa7b2,null))[_0x8f39('0x36')](function(_0x4b6e24){if(_0x4b6e24){return _0x4b6e24[_0x8f39('0xbc')](_0x52999a[_0x8f39('0x4b')][_0x8f39('0x6a')])[_0x8f39('0x36')](function(){if(_[_0x8f39('0xbd')](_0x52999a[_0x8f39('0x4b')][_0x8f39('0x6a')])){for(var _0x9bad39=0x0;_0x9bad39<_0x52999a[_0x8f39('0x4b')][_0x8f39('0x6a')][_0x8f39('0x6b')];_0x9bad39+=0x1){socket[_0x8f39('0xba')]('userMailAccount:remove',{'UserId':Number(_0x52999a[_0x8f39('0x4b')][_0x8f39('0x6a')][_0x9bad39]),'MailAccountId':Number(_0x52999a[_0x8f39('0x5a')]['id'])});}}else{socket[_0x8f39('0xba')](_0x8f39('0xbe'),{'UserId':Number(_0x52999a[_0x8f39('0x4b')][_0x8f39('0x6a')]),'MailAccountId':Number(_0x52999a[_0x8f39('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5aa7b2,null))['catch'](handleError(_0x5aa7b2,null));};exports[_0x8f39('0xbf')]=function(_0x5cabe2,_0x5d19fb,_0x51f9fe){var _0x475ade={};var _0x61d915={};var _0x123c15;var _0x56e62f;return db['MailAccount']['findOne']({'where':{'id':_0x5cabe2[_0x8f39('0x5a')]['id']}})[_0x8f39('0x36')](handleEntityNotFound(_0x5d19fb,null))[_0x8f39('0x36')](function(_0x32ff26){if(_0x32ff26){_0x123c15=_0x32ff26;_0x61d915[_0x8f39('0x47')]=_[_0x8f39('0x48')](db[_0x8f39('0xc0')][_0x8f39('0x45')]);_0x61d915[_0x8f39('0x4b')]=_[_0x8f39('0x48')](_0x5cabe2[_0x8f39('0x4b')]);_0x61d915[_0x8f39('0x4f')]=_[_0x8f39('0x49')](_0x61d915[_0x8f39('0x47')],_0x61d915[_0x8f39('0x4b')]);_0x475ade[_0x8f39('0x4a')]=_[_0x8f39('0x49')](_0x61d915[_0x8f39('0x47')],qs[_0x8f39('0x4c')](_0x5cabe2[_0x8f39('0x4b')][_0x8f39('0x4c')]));_0x475ade[_0x8f39('0x4a')]=_0x475ade[_0x8f39('0x4a')][_0x8f39('0x6b')]?_0x475ade[_0x8f39('0x4a')]:_0x61d915[_0x8f39('0x47')];_0x475ade[_0x8f39('0x68')]=qs['sort'](_0x5cabe2[_0x8f39('0x4b')][_0x8f39('0x69')]);_0x475ade[_0x8f39('0x4e')]=qs[_0x8f39('0x4f')](_[_0x8f39('0x50')](_0x5cabe2[_0x8f39('0x4b')],_0x61d915[_0x8f39('0x4f')]));if(_0x5cabe2[_0x8f39('0x4b')]['filter']){_0x475ade[_0x8f39('0x4e')]=_[_0x8f39('0x53')](_0x475ade[_0x8f39('0x4e')],{'$or':_[_0x8f39('0x44')](_0x475ade[_0x8f39('0x4a')],function(_0x5dfdcf){var _0x53caaf={};_0x53caaf[_0x5dfdcf]={'$like':'%'+_0x5cabe2[_0x8f39('0x4b')][_0x8f39('0x51')]+'%'};return _0x53caaf;})});}_0x475ade=_[_0x8f39('0x53')]({},_0x475ade,_0x5cabe2[_0x8f39('0x5c')]);return _0x123c15['getAgents'](_0x475ade);}})[_0x8f39('0x36')](function(_0x437796){if(_0x437796){_0x56e62f=_0x437796['length'];if(!_0x5cabe2[_0x8f39('0x4b')]['hasOwnProperty']('nolimit')){_0x475ade['limit']=qs[_0x8f39('0x31')](_0x5cabe2[_0x8f39('0x4b')][_0x8f39('0x31')]);_0x475ade[_0x8f39('0x30')]=qs[_0x8f39('0x30')](_0x5cabe2[_0x8f39('0x4b')][_0x8f39('0x30')]);}return _0x123c15[_0x8f39('0xbf')](_0x475ade);}})[_0x8f39('0x36')](function(_0x5baae1){if(_0x5baae1){return _0x5baae1?{'count':_0x56e62f,'rows':_0x5baae1}:null;}})[_0x8f39('0x36')](respondWithResult(_0x5d19fb,null))[_0x8f39('0x2c')](handleError(_0x5d19fb,null));}; \ No newline at end of file +var _0x68aa=['Smtp','Pause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','Imap','mandatoryDispositionPause','length','update','body','describe','addDisposition','find','MailAccountId','create','getDispositions','findOne','nolimit','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','cservice','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','color','tag','addApplications','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','from','format','%s\x20<%s>','attachments','join','root','basename','auth','secure','SendMail','List\x20not\x20found','messageId','attach','out','Interaction','VerifySmtp','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','destroy','UserProfileResource','end','name','index','MailServerIn','MailServerOut'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x68aa,0x81));var _0xa68a=function(_0x2daec7,_0x2f1ee7){_0x2daec7=_0x2daec7-0x0;var _0x274aa4=_0x68aa[_0x2daec7];return _0x274aa4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa68a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa68a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa68a('0x2'));var Mustache=require(_0xa68a('0x3'));var util=require(_0xa68a('0x4'));var path=require(_0xa68a('0x5'));var sox=require(_0xa68a('0x6'));var csv=require(_0xa68a('0x7'));var ejs=require(_0xa68a('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa68a('0x9'));var crypto=require(_0xa68a('0xa'));var jsforce=require(_0xa68a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa68a('0x7'));var querystring=require(_0xa68a('0xc'));var Papa=require(_0xa68a('0xd'));var Redis=require(_0xa68a('0xe'));var authService=require(_0xa68a('0xf'));var qs=require(_0xa68a('0x10'));var as=require(_0xa68a('0x11'));var hardwareService=require(_0xa68a('0x12'));var logger=require(_0xa68a('0x13'))('api');var utils=require(_0xa68a('0x14'));var config=require(_0xa68a('0x15'));var db=require('../../mysqldb')['db'];config[_0xa68a('0x16')]=_[_0xa68a('0x17')](config[_0xa68a('0x16')],{'host':_0xa68a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa68a('0x19'))[_0xa68a('0x1a')](socket);var jayson=require(_0xa68a('0x1b'));var client=jayson[_0xa68a('0x1c')][_0xa68a('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x3f43f6,_0x3412c7,_0x45732d){if(_0x45732d){var _0x1f6426=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f6426[_0xa68a('0x1e')](_0x3412c7)){return _0x3f43f6;}else{throw new db[(_0xa68a('0x1f'))][(_0xa68a('0x20'))](_0xa68a('0x21'));}}else{return _0x3f43f6;}}function respondWithRpcPromise(_0x9bf370,_0x1e2d96,_0x2e2db3,_0x3ebd5f){return new BPromise(function(_0x4a9693,_0x431ece){var _0x10e0b4=_0x3ebd5f||client;return _0x10e0b4[_0xa68a('0x22')](_0x9bf370,_0x2e2db3)[_0xa68a('0x23')](function(_0x5894d0){logger[_0xa68a('0x24')](_0xa68a('0x25'),_0x1e2d96,_0xa68a('0x26'));logger[_0xa68a('0x27')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x1e2d96,_0xa68a('0x26'),JSON[_0xa68a('0x28')](_0x5894d0));if(_0x5894d0[_0xa68a('0x29')]){if(_0x5894d0[_0xa68a('0x29')][_0xa68a('0x2a')]===0x1f4){logger[_0xa68a('0x29')](_0xa68a('0x25'),_0x1e2d96,_0x5894d0[_0xa68a('0x29')]['message']);return _0x431ece(_0x5894d0[_0xa68a('0x29')][_0xa68a('0x2b')]);}logger[_0xa68a('0x29')](_0xa68a('0x25'),_0x1e2d96,_0x5894d0[_0xa68a('0x29')][_0xa68a('0x2b')]);return _0x4a9693(_0x5894d0[_0xa68a('0x29')]['message']);}else{logger[_0xa68a('0x24')]('MailAccount,\x20%s,\x20%s',_0x1e2d96,'request\x20sent');_0x4a9693(_0x5894d0[_0xa68a('0x2c')][_0xa68a('0x2b')]);}})['catch'](function(_0x28ec8c){logger[_0xa68a('0x29')](_0xa68a('0x25'),_0x1e2d96,_0x28ec8c);_0x431ece(_0x28ec8c);});});}function respondWithStatusCode(_0x34d837,_0x4e1a00){_0x4e1a00=_0x4e1a00||0xcc;return function(_0xd78d77){if(_0xd78d77){return _0x34d837[_0xa68a('0x2d')](_0x4e1a00);}return _0x34d837[_0xa68a('0x2e')](_0x4e1a00)['end']();};}function respondWithResult(_0x1f3862,_0x2c809f){_0x2c809f=_0x2c809f||0xc8;return function(_0x2211bf){if(_0x2211bf){return _0x1f3862[_0xa68a('0x2e')](_0x2c809f)[_0xa68a('0x2f')](_0x2211bf);}};}function respondWithFilteredResult(_0xe6c844,_0x1ce9b7){return function(_0x386afc){if(_0x386afc){var _0x2d5b74=_0x386afc[_0xa68a('0x30')],_0x12955f=_0x1ce9b7[_0xa68a('0x31')],_0xd3a2c=_0x1ce9b7[_0xa68a('0x31')]+_0x1ce9b7['limit'],_0x1810eb;if(_0xd3a2c>=_0x2d5b74){_0xd3a2c=_0x2d5b74;_0x1810eb=0xc8;}else{_0x1810eb=0xce;}_0xe6c844[_0xa68a('0x2e')](_0x1810eb);return _0xe6c844['set'](_0xa68a('0x32'),_0x12955f+'-'+_0xd3a2c+'/'+_0x2d5b74)[_0xa68a('0x2f')](_0x386afc);}return null;};}function patchUpdates(_0x3688a1){return function(_0x1b8e3a){try{jsonpatch[_0xa68a('0x33')](_0x1b8e3a,_0x3688a1,!![]);}catch(_0xa71455){return BPromise[_0xa68a('0x34')](_0xa71455);}return _0x1b8e3a[_0xa68a('0x35')]();};}function saveUpdates(_0x33f416,_0x434de7){return function(_0x4dd232){if(_0x4dd232){return _0x4dd232['update'](_0x33f416)['then'](function(_0x2082ad){return _0x2082ad;});}return null;};}function removeEntity(_0x464bc5,_0x31165f){return function(_0x251260){if(_0x251260){return _0x251260[_0xa68a('0x36')]()[_0xa68a('0x23')](function(){var _0x5009ea=_0x251260['get']({'plain':!![]});var _0x2f9e58='MailAccounts';return db[_0xa68a('0x37')][_0xa68a('0x36')]({'where':{'type':_0x2f9e58,'resourceId':_0x5009ea['id']}})[_0xa68a('0x23')](function(){return _0x251260;});})[_0xa68a('0x23')](function(){_0x464bc5[_0xa68a('0x2e')](0xcc)[_0xa68a('0x38')]();});}};}function handleEntityNotFound(_0x5d2bf8,_0x384d94){return function(_0x52dde4){if(!_0x52dde4){_0x5d2bf8['sendStatus'](0x194);}return _0x52dde4;};}function handleError(_0x3fb153,_0x2a290a){_0x2a290a=_0x2a290a||0x1f4;return function(_0x1d9032){logger[_0xa68a('0x29')](_0x1d9032['stack']);if(_0x1d9032[_0xa68a('0x39')]){delete _0x1d9032[_0xa68a('0x39')];}_0x3fb153[_0xa68a('0x2e')](_0x2a290a)['send'](_0x1d9032);};}exports[_0xa68a('0x3a')]=function(_0x5cfb57,_0x360c6d){var _0xe07fdc={'include':[{'model':db[_0xa68a('0x3b')],'as':'Imap'},{'model':db[_0xa68a('0x3c')],'as':_0xa68a('0x3d')},{'model':db[_0xa68a('0x3e')],'as':'mandatoryDispositionPause'}]},_0x23a0ec={},_0x4fa5e1={'count':0x0,'rows':[]};var _0x33119d=_[_0xa68a('0x3f')](db[_0xa68a('0x40')][_0xa68a('0x41')],function(_0x971f8e){return{'name':_0x971f8e[_0xa68a('0x42')],'type':_0x971f8e[_0xa68a('0x43')][_0xa68a('0x44')]};});_0x23a0ec[_0xa68a('0x45')]=_[_0xa68a('0x3f')](_0x33119d,_0xa68a('0x39'));_0x23a0ec[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x5cfb57[_0xa68a('0x46')]);_0x23a0ec[_0xa68a('0x48')]=_['intersection'](_0x23a0ec['model'],_0x23a0ec[_0xa68a('0x46')]);_0xe07fdc[_0xa68a('0x49')]=_[_0xa68a('0x4a')](_0x23a0ec[_0xa68a('0x45')],qs[_0xa68a('0x4b')](_0x5cfb57['query']['fields']));_0xe07fdc[_0xa68a('0x49')]=_0xe07fdc['attributes']['length']?_0xe07fdc[_0xa68a('0x49')]:_0x23a0ec[_0xa68a('0x45')];if(!_0x5cfb57[_0xa68a('0x46')][_0xa68a('0x4c')]('nolimit')){_0xe07fdc[_0xa68a('0x4d')]=qs[_0xa68a('0x4d')](_0x5cfb57[_0xa68a('0x46')][_0xa68a('0x4d')]);_0xe07fdc[_0xa68a('0x31')]=qs[_0xa68a('0x31')](_0x5cfb57['query']['offset']);}_0xe07fdc[_0xa68a('0x4e')]=qs[_0xa68a('0x4f')](_0x5cfb57['query'][_0xa68a('0x4f')]);_0xe07fdc[_0xa68a('0x50')]=qs[_0xa68a('0x48')](_[_0xa68a('0x51')](_0x5cfb57[_0xa68a('0x46')],_0x23a0ec[_0xa68a('0x48')]));if(_0x5cfb57[_0xa68a('0x46')][_0xa68a('0x52')]){_0xe07fdc['where']=_[_0xa68a('0x53')](_0xe07fdc[_0xa68a('0x50')],{'$or':_[_0xa68a('0x3f')](_0x33119d,function(_0x347463){if(_0x347463[_0xa68a('0x43')]!==_0xa68a('0x54')){var _0x1f8eae={};_0x1f8eae[_0x347463[_0xa68a('0x39')]]={'$like':'%'+_0x5cfb57[_0xa68a('0x46')][_0xa68a('0x52')]+'%'};return _0x1f8eae;}})});}_0xe07fdc=_[_0xa68a('0x53')]({},_0xe07fdc,_0x5cfb57[_0xa68a('0x55')]);var _0x3074d3={'where':_0xe07fdc[_0xa68a('0x50')]};return db[_0xa68a('0x40')][_0xa68a('0x30')](_0x3074d3)[_0xa68a('0x23')](function(_0x40c148){_0x4fa5e1['count']=_0x40c148;if(_0x5cfb57[_0xa68a('0x46')][_0xa68a('0x56')]){_0xe07fdc[_0xa68a('0x57')]=[{'all':!![]}];}return db[_0xa68a('0x40')][_0xa68a('0x58')](_0xe07fdc);})[_0xa68a('0x23')](function(_0x34ed5e){_0x4fa5e1['rows']=_0x34ed5e;return _0x4fa5e1;})[_0xa68a('0x23')](respondWithFilteredResult(_0x360c6d,_0xe07fdc))[_0xa68a('0x59')](handleError(_0x360c6d,null));};exports['show']=function(_0xaf914e,_0x25ab15){var _0x23ebf8={'raw':![],'where':{'id':_0xaf914e[_0xa68a('0x5a')]['id']},'include':[{'model':db[_0xa68a('0x3b')],'as':_0xa68a('0x5b')},{'model':db[_0xa68a('0x3c')],'as':_0xa68a('0x3d')},{'model':db['Pause'],'as':_0xa68a('0x5c')}]},_0x1c97e1={};_0x1c97e1['model']=_[_0xa68a('0x47')](db[_0xa68a('0x40')]['rawAttributes']);_0x1c97e1[_0xa68a('0x46')]=_['keys'](_0xaf914e[_0xa68a('0x46')]);_0x1c97e1[_0xa68a('0x48')]=_['intersection'](_0x1c97e1[_0xa68a('0x45')],_0x1c97e1[_0xa68a('0x46')]);_0x23ebf8['attributes']=_[_0xa68a('0x4a')](_0x1c97e1[_0xa68a('0x45')],qs[_0xa68a('0x4b')](_0xaf914e[_0xa68a('0x46')][_0xa68a('0x4b')]));_0x23ebf8['attributes']=_0x23ebf8[_0xa68a('0x49')][_0xa68a('0x5d')]?_0x23ebf8[_0xa68a('0x49')]:_0x1c97e1[_0xa68a('0x45')];if(_0xaf914e[_0xa68a('0x46')][_0xa68a('0x56')]){_0x23ebf8['include']=[{'all':!![]}];}_0x23ebf8=_[_0xa68a('0x53')]({},_0x23ebf8,_0xaf914e[_0xa68a('0x55')]);return db[_0xa68a('0x40')]['find'](_0x23ebf8)[_0xa68a('0x23')](handleEntityNotFound(_0x25ab15,null))[_0xa68a('0x23')](respondWithResult(_0x25ab15,null))[_0xa68a('0x59')](handleError(_0x25ab15,null));};exports[_0xa68a('0x5e')]=function(_0x2028d7,_0x198155){if(_0x2028d7[_0xa68a('0x5f')]['id']){delete _0x2028d7[_0xa68a('0x5f')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2028d7[_0xa68a('0x5a')]['id']},'include':[{'model':db[_0xa68a('0x3b')],'as':_0xa68a('0x5b')},{'model':db[_0xa68a('0x3c')],'as':_0xa68a('0x3d')},{'model':db[_0xa68a('0x3e')],'as':_0xa68a('0x5c')}]})['then'](handleEntityNotFound(_0x198155,null))['then'](saveUpdates(_0x2028d7[_0xa68a('0x5f')],null))[_0xa68a('0x23')](function(_0x3f12d8){if(_0x3f12d8&&_0x2028d7['body'][_0xa68a('0x5b')]){return db['MailServerIn'][_0xa68a('0x5e')](_0x2028d7[_0xa68a('0x5f')]['Imap'],{'where':{'MailAccountId':_0x3f12d8['id']}})[_0xa68a('0x23')](function(){return _0x3f12d8;});}return _0x3f12d8;})['then'](function(_0x4bd73c){if(_0x4bd73c&&_0x2028d7[_0xa68a('0x5f')][_0xa68a('0x3d')]){return db['MailServerOut'][_0xa68a('0x5e')](_0x2028d7[_0xa68a('0x5f')][_0xa68a('0x3d')],{'where':{'MailAccountId':_0x4bd73c['id']}})[_0xa68a('0x23')](function(){return _0x4bd73c;});}return _0x4bd73c;})[_0xa68a('0x23')](respondWithResult(_0x198155,null))[_0xa68a('0x59')](handleError(_0x198155,null));};exports[_0xa68a('0x60')]=function(_0x2db6ce,_0x37e6e4){return db['MailAccount'][_0xa68a('0x60')]()['then'](respondWithResult(_0x37e6e4,null))[_0xa68a('0x59')](handleError(_0x37e6e4,null));};exports[_0xa68a('0x61')]=function(_0x40fa06,_0x3daceb,_0x5a1bd0){if(_0x40fa06[_0xa68a('0x5f')]['id']){delete _0x40fa06['body']['id'];}return db[_0xa68a('0x40')][_0xa68a('0x62')]({'where':{'id':_0x40fa06['params']['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x3daceb,null))[_0xa68a('0x23')](function(_0x2083d7){if(_0x2083d7){_0x40fa06[_0xa68a('0x5f')][_0xa68a('0x63')]=_0x2083d7['id'];return db['Disposition'][_0xa68a('0x64')](_0x40fa06[_0xa68a('0x5f')]);}})['then'](respondWithResult(_0x3daceb,null))['catch'](handleError(_0x3daceb,null));};exports[_0xa68a('0x65')]=function(_0x5010d9,_0xd5b741,_0x4227fb){var _0x510f38={'raw':![],'where':{}};var _0x5a995d={};var _0x3a78b3={'count':0x0,'rows':[]};return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x5010d9[_0xa68a('0x5a')]['id']}})['then'](handleEntityNotFound(_0xd5b741,null))['then'](function(_0x4cdfa0){if(_0x4cdfa0){_0x5a995d[_0xa68a('0x45')]=_[_0xa68a('0x47')](db['Disposition'][_0xa68a('0x41')]);_0x5a995d[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x5010d9[_0xa68a('0x46')]);_0x5a995d[_0xa68a('0x48')]=_[_0xa68a('0x4a')](_0x5a995d[_0xa68a('0x45')],_0x5a995d[_0xa68a('0x46')]);_0x510f38[_0xa68a('0x49')]=_['intersection'](_0x5a995d[_0xa68a('0x45')],qs[_0xa68a('0x4b')](_0x5010d9[_0xa68a('0x46')][_0xa68a('0x4b')]));_0x510f38[_0xa68a('0x49')]=_0x510f38['attributes'][_0xa68a('0x5d')]?_0x510f38[_0xa68a('0x49')]:_0x5a995d[_0xa68a('0x45')];if(!_0x5010d9[_0xa68a('0x46')]['hasOwnProperty'](_0xa68a('0x67'))){_0x510f38[_0xa68a('0x4d')]=qs['limit'](_0x5010d9['query'][_0xa68a('0x4d')]);_0x510f38[_0xa68a('0x31')]=qs[_0xa68a('0x31')](_0x5010d9[_0xa68a('0x46')][_0xa68a('0x31')]);}_0x510f38[_0xa68a('0x4e')]=qs[_0xa68a('0x4f')](_0x5010d9[_0xa68a('0x46')][_0xa68a('0x4f')]);_0x510f38[_0xa68a('0x50')]=qs[_0xa68a('0x48')](_[_0xa68a('0x51')](_0x5010d9[_0xa68a('0x46')],_0x5a995d[_0xa68a('0x48')]));_0x510f38['where'][_0xa68a('0x63')]=_0x4cdfa0['id'];if(_0x5010d9[_0xa68a('0x46')][_0xa68a('0x52')]){_0x510f38['where']=_[_0xa68a('0x53')](_0x510f38[_0xa68a('0x50')],{'$or':_[_0xa68a('0x3f')](_0x510f38[_0xa68a('0x49')],function(_0x1f4a05){var _0xe28a25={};_0xe28a25[_0x1f4a05]={'$like':'%'+_0x5010d9[_0xa68a('0x46')]['filter']+'%'};return _0xe28a25;})});}_0x510f38=_['merge']({},_0x510f38,_0x5010d9[_0xa68a('0x55')]);return db[_0xa68a('0x68')]['count']({'where':_0x510f38['where']})[_0xa68a('0x23')](function(_0x4fc0ae){_0x3a78b3[_0xa68a('0x30')]=_0x4fc0ae;if(_0x5010d9['query'][_0xa68a('0x56')]){_0x510f38['include']=[{'all':!![]}];}return db[_0xa68a('0x68')][_0xa68a('0x58')](_0x510f38);})[_0xa68a('0x23')](function(_0x58899c){_0x3a78b3[_0xa68a('0x69')]=_0x58899c;return _0x3a78b3;});}})[_0xa68a('0x23')](respondWithFilteredResult(_0xd5b741,_0x510f38))['catch'](handleError(_0xd5b741,null));};exports[_0xa68a('0x6a')]=function(_0x23adf5,_0x44fea7,_0x32f260){return db[_0xa68a('0x40')]['find']({'where':{'id':_0x23adf5[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x44fea7,null))[_0xa68a('0x23')](function(_0x29479d){if(_0x29479d){return _0x29479d[_0xa68a('0x6a')](_0x23adf5[_0xa68a('0x46')][_0xa68a('0x6b')]);}})[_0xa68a('0x23')](respondWithStatusCode(_0x44fea7,null))[_0xa68a('0x59')](handleError(_0x44fea7,null));};exports[_0xa68a('0x6c')]=function(_0x4f1568,_0x4b7560,_0x1c2e6e){if(_0x4f1568[_0xa68a('0x5f')]['id']){delete _0x4f1568[_0xa68a('0x5f')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x4f1568[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x4b7560,null))[_0xa68a('0x23')](function(_0x3aaa7c){if(_0x3aaa7c){_0x4f1568['body']['MailAccountId']=_0x3aaa7c['id'];return db[_0xa68a('0x6d')][_0xa68a('0x64')](_0x4f1568[_0xa68a('0x5f')]);}})[_0xa68a('0x23')](respondWithResult(_0x4b7560,null))[_0xa68a('0x59')](handleError(_0x4b7560,null));};exports[_0xa68a('0x6e')]=function(_0x5b590b,_0x1f616c,_0x3d9386){var _0x32a676={'raw':![],'where':{}};var _0x3516db={};var _0x4ece4c={'count':0x0,'rows':[]};return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x5b590b['params']['id']}})['then'](handleEntityNotFound(_0x1f616c,null))[_0xa68a('0x23')](function(_0x170bf8){if(_0x170bf8){_0x3516db[_0xa68a('0x45')]=_[_0xa68a('0x47')](db['CannedAnswer'][_0xa68a('0x41')]);_0x3516db[_0xa68a('0x46')]=_['keys'](_0x5b590b[_0xa68a('0x46')]);_0x3516db[_0xa68a('0x48')]=_[_0xa68a('0x4a')](_0x3516db[_0xa68a('0x45')],_0x3516db['query']);_0x32a676[_0xa68a('0x49')]=_[_0xa68a('0x4a')](_0x3516db[_0xa68a('0x45')],qs[_0xa68a('0x4b')](_0x5b590b[_0xa68a('0x46')][_0xa68a('0x4b')]));_0x32a676[_0xa68a('0x49')]=_0x32a676[_0xa68a('0x49')][_0xa68a('0x5d')]?_0x32a676[_0xa68a('0x49')]:_0x3516db[_0xa68a('0x45')];if(!_0x5b590b[_0xa68a('0x46')]['hasOwnProperty'](_0xa68a('0x67'))){_0x32a676[_0xa68a('0x4d')]=qs[_0xa68a('0x4d')](_0x5b590b[_0xa68a('0x46')][_0xa68a('0x4d')]);_0x32a676[_0xa68a('0x31')]=qs[_0xa68a('0x31')](_0x5b590b['query'][_0xa68a('0x31')]);}_0x32a676[_0xa68a('0x4e')]=qs['sort'](_0x5b590b['query'][_0xa68a('0x4f')]);_0x32a676['where']=qs[_0xa68a('0x48')](_[_0xa68a('0x51')](_0x5b590b['query'],_0x3516db[_0xa68a('0x48')]));_0x32a676[_0xa68a('0x50')][_0xa68a('0x63')]=_0x170bf8['id'];if(_0x5b590b[_0xa68a('0x46')][_0xa68a('0x52')]){_0x32a676[_0xa68a('0x50')]=_[_0xa68a('0x53')](_0x32a676['where'],{'$or':_[_0xa68a('0x3f')](_0x32a676[_0xa68a('0x49')],function(_0x1af7e7){var _0x5cbc32={};_0x5cbc32[_0x1af7e7]={'$like':'%'+_0x5b590b['query'][_0xa68a('0x52')]+'%'};return _0x5cbc32;})});}_0x32a676=_[_0xa68a('0x53')]({},_0x32a676,_0x5b590b['options']);return db[_0xa68a('0x6d')][_0xa68a('0x30')]({'where':_0x32a676[_0xa68a('0x50')]})[_0xa68a('0x23')](function(_0x23cac2){_0x4ece4c[_0xa68a('0x30')]=_0x23cac2;if(_0x5b590b[_0xa68a('0x46')][_0xa68a('0x56')]){_0x32a676[_0xa68a('0x57')]=[{'all':!![]}];}return db[_0xa68a('0x6d')][_0xa68a('0x58')](_0x32a676);})[_0xa68a('0x23')](function(_0x14c311){_0x4ece4c[_0xa68a('0x69')]=_0x14c311;return _0x4ece4c;});}})['then'](respondWithFilteredResult(_0x1f616c,_0x32a676))[_0xa68a('0x59')](handleError(_0x1f616c,null));};exports[_0xa68a('0x6f')]=function(_0x5a0842,_0x5774c5,_0x50fc81){return db[_0xa68a('0x40')]['find']({'where':{'id':_0x5a0842[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x5774c5,null))['then'](function(_0x87a083){if(_0x87a083){return _0x87a083[_0xa68a('0x6f')](_0x5a0842[_0xa68a('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x5774c5,null))['catch'](handleError(_0x5774c5,null));};exports[_0xa68a('0x64')]=function(_0x3371bf,_0x45f810){var _0x3ee8ea={'name':_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x39')],'key':_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x44')],'email':_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x70')],'ListId':_0x3371bf['body'][_0xa68a('0x71')],'active':!_[_0xa68a('0x72')](_0x3371bf['body']['active'])?_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x73')]:!![],'description':_0x3371bf[_0xa68a('0x5f')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x3371bf[_0xa68a('0x5f')]['cservice'])){if(_0x3371bf['body'][_0xa68a('0x74')]){_0x3ee8ea[_0xa68a('0x5b')][_0xa68a('0x75')]=_0x3ee8ea[_0xa68a('0x3d')][_0xa68a('0x75')]=_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x76')];_0x3ee8ea[_0xa68a('0x5b')][_0xa68a('0x77')]=_0x3ee8ea[_0xa68a('0x3d')][_0xa68a('0x78')]=_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x79')];}else{_0x3ee8ea['Imap'][_0xa68a('0x7a')]=_0x3ee8ea['Smtp'][_0xa68a('0x7a')]=![];}_0x3ee8ea['Imap'][_0xa68a('0x7b')]=_0x3371bf[_0xa68a('0x5f')]['Imap'][_0xa68a('0x7b')];_0x3ee8ea[_0xa68a('0x5b')][_0xa68a('0x7c')]=_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x5b')][_0xa68a('0x7c')];_0x3ee8ea[_0xa68a('0x3d')][_0xa68a('0x7b')]=_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x3d')][_0xa68a('0x7b')];_0x3ee8ea[_0xa68a('0x3d')]['port']=_0x3371bf[_0xa68a('0x5f')]['Smtp'][_0xa68a('0x7c')];}else{_0x3ee8ea[_0xa68a('0x5b')]['service']=_0x3ee8ea[_0xa68a('0x3d')][_0xa68a('0x7d')]=_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x7e')];_0x3ee8ea[_0xa68a('0x5b')]['user']=_0x3ee8ea[_0xa68a('0x3d')]['user']=_0x3371bf[_0xa68a('0x5f')][_0xa68a('0x76')];_0x3ee8ea[_0xa68a('0x5b')][_0xa68a('0x77')]=_0x3ee8ea[_0xa68a('0x3d')][_0xa68a('0x78')]=_0x3371bf['body'][_0xa68a('0x79')];}return db[_0xa68a('0x40')][_0xa68a('0x64')](_0x3ee8ea,{'include':[{'model':db['MailServerOut'],'as':_0xa68a('0x3d')},{'model':db['MailServerIn'],'as':_0xa68a('0x5b')}]})[_0xa68a('0x23')](function(_0x4a30f6){var _0x49767e=_0x3371bf[_0xa68a('0x75')][_0xa68a('0x7f')]({'plain':!![]});if(!_0x49767e)throw new Error(_0xa68a('0x80'));if(_0x49767e['role']===_0xa68a('0x75')){var _0xeca714=_0x4a30f6[_0xa68a('0x7f')]({'plain':!![]});return db[_0xa68a('0x81')][_0xa68a('0x62')]({'where':{'name':_0xa68a('0x82'),'userProfileId':_0x49767e[_0xa68a('0x83')]},'raw':!![]})[_0xa68a('0x23')](function(_0x33259c){if(_0x33259c&&_0x33259c[_0xa68a('0x84')]===0x0){return db[_0xa68a('0x37')][_0xa68a('0x64')]({'name':_0xeca714[_0xa68a('0x39')],'resourceId':_0xeca714['id'],'type':_0x33259c[_0xa68a('0x39')],'sectionId':_0x33259c['id']},{})[_0xa68a('0x23')](function(){return _0x4a30f6;});}else{return _0x4a30f6;}})[_0xa68a('0x59')](function(_0x14a333){logger['error'](_0xa68a('0x85'),_0x14a333);throw _0x14a333;});}return _0x4a30f6;})[_0xa68a('0x23')](respondWithResult(_0x45f810,0xc9))[_0xa68a('0x59')](handleError(_0x45f810,null));};exports[_0xa68a('0x86')]=function(_0x5980be,_0x65ed65,_0x2895bd){return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x5980be[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x65ed65,null))[_0xa68a('0x23')](function(_0x28d3af){if(_0x28d3af){return _0x28d3af[_0xa68a('0x86')]();}return null;})[_0xa68a('0x23')](respondWithResult(_0x65ed65,null))[_0xa68a('0x59')](handleError(_0x65ed65,null));};exports[_0xa68a('0x87')]=function(_0x139ff0,_0x30bb05,_0x3116f9){if(_0x139ff0[_0xa68a('0x5f')]['id']){delete _0x139ff0[_0xa68a('0x5f')]['id'];}return db['MailAccount'][_0xa68a('0x62')]({'where':{'id':_0x139ff0['params']['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x30bb05,null))[_0xa68a('0x23')](function(_0x3a97c1){if(_0x3a97c1){_0x139ff0[_0xa68a('0x5f')][_0xa68a('0x63')]=_0x3a97c1['id'];return db['MailServerIn']['create'](_0x139ff0[_0xa68a('0x5f')]);}})[_0xa68a('0x23')](respondWithResult(_0x30bb05,null))['catch'](handleError(_0x30bb05,null));};exports[_0xa68a('0x88')]=function(_0x3bc130,_0x4e3d61,_0x207369){return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x3bc130[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x4e3d61,null))[_0xa68a('0x23')](function(_0x36a2e0){if(_0x36a2e0){return _0x36a2e0[_0xa68a('0x89')](null);}return null;})[_0xa68a('0x23')](respondWithStatusCode(_0x4e3d61,null))[_0xa68a('0x59')](handleError(_0x4e3d61,null));};exports[_0xa68a('0x8a')]=function(_0x3bd589,_0x465845,_0x59656e){return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x3bd589['params']['id']}})['then'](handleEntityNotFound(_0x465845,null))[_0xa68a('0x23')](function(_0x586db4){if(_0x586db4){return _0x586db4[_0xa68a('0x8a')]();}return null;})[_0xa68a('0x23')](respondWithResult(_0x465845,null))['catch'](handleError(_0x465845,null));};exports['addSmtp']=function(_0x146711,_0x251ce4,_0x5218d8){if(_0x146711['body']['id']){delete _0x146711['body']['id'];}return db['MailAccount'][_0xa68a('0x62')]({'where':{'id':_0x146711[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x251ce4,null))[_0xa68a('0x23')](function(_0x2a43df){if(_0x2a43df){_0x146711[_0xa68a('0x5f')][_0xa68a('0x63')]=_0x2a43df['id'];return db['MailServerOut'][_0xa68a('0x64')](_0x146711[_0xa68a('0x5f')]);}})[_0xa68a('0x23')](respondWithResult(_0x251ce4,null))[_0xa68a('0x59')](handleError(_0x251ce4,null));};exports['removeSmtp']=function(_0x1bdb19,_0x36e35e,_0x44558d){return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x1bdb19[_0xa68a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x36e35e,null))['then'](function(_0x4f3490){if(_0x4f3490){return _0x4f3490[_0xa68a('0x8b')](null);}return null;})[_0xa68a('0x23')](respondWithStatusCode(_0x36e35e,null))[_0xa68a('0x59')](handleError(_0x36e35e,null));};exports[_0xa68a('0x8c')]=function(_0x12d27c,_0x238cf6,_0x2f3729){return db['MailInteraction'][_0xa68a('0x62')]({'where':{'id':_0x12d27c[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x238cf6,null))[_0xa68a('0x23')](function(_0x13ca79){if(_0x13ca79){return _0x13ca79[_0xa68a('0x8c')](_0x12d27c[_0xa68a('0x5f')][_0xa68a('0x6b')],_[_0xa68a('0x8d')](_0x12d27c['body'],[_0xa68a('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x238cf6,null))[_0xa68a('0x59')](handleError(_0x238cf6,null));};exports[_0xa68a('0x8e')]=function(_0x2971c6,_0x46d3fa,_0x1c62f9){var _0xe1030={'raw':![],'where':{}};var _0x434a9b={};var _0x5c2a8d={'count':0x0,'rows':[]};return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x2971c6[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x46d3fa,null))[_0xa68a('0x23')](function(_0x5194e6){if(_0x5194e6){_0x434a9b[_0xa68a('0x45')]=_[_0xa68a('0x47')](db[_0xa68a('0x8f')]['rawAttributes']);_0x434a9b[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x2971c6['query']);_0x434a9b[_0xa68a('0x48')]=_[_0xa68a('0x4a')](_0x434a9b['model'],_0x434a9b['query']);_0xe1030['attributes']=_['intersection'](_0x434a9b[_0xa68a('0x45')],qs[_0xa68a('0x4b')](_0x2971c6[_0xa68a('0x46')][_0xa68a('0x4b')]));_0xe1030[_0xa68a('0x49')]=_0xe1030['attributes']['length']?_0xe1030['attributes']:_0x434a9b[_0xa68a('0x45')];if(!_0x2971c6[_0xa68a('0x46')][_0xa68a('0x4c')](_0xa68a('0x67'))){_0xe1030[_0xa68a('0x4d')]=qs[_0xa68a('0x4d')](_0x2971c6[_0xa68a('0x46')][_0xa68a('0x4d')]);_0xe1030['offset']=qs[_0xa68a('0x31')](_0x2971c6['query'][_0xa68a('0x31')]);}_0xe1030[_0xa68a('0x4e')]=qs['sort'](_0x2971c6[_0xa68a('0x46')][_0xa68a('0x4f')]);_0xe1030[_0xa68a('0x50')]=qs[_0xa68a('0x48')](_['pick'](_0x2971c6[_0xa68a('0x46')],_0x434a9b[_0xa68a('0x48')]));_0xe1030[_0xa68a('0x50')][_0xa68a('0x63')]=_0x5194e6['id'];if(_0x2971c6[_0xa68a('0x46')][_0xa68a('0x52')]){_0xe1030[_0xa68a('0x50')]=_[_0xa68a('0x53')](_0xe1030[_0xa68a('0x50')],{'$or':_[_0xa68a('0x3f')](_0xe1030['attributes'],function(_0x137ac2){var _0x565703={};_0x565703[_0x137ac2]={'$like':'%'+_0x2971c6[_0xa68a('0x46')][_0xa68a('0x52')]+'%'};return _0x565703;})});}_0xe1030=_[_0xa68a('0x53')]({},_0xe1030,_0x2971c6[_0xa68a('0x55')]);return db[_0xa68a('0x8f')][_0xa68a('0x30')]({'where':_0xe1030[_0xa68a('0x50')]})[_0xa68a('0x23')](function(_0x4fbde4){_0x5c2a8d[_0xa68a('0x30')]=_0x4fbde4;if(_0x2971c6['query'][_0xa68a('0x56')]){_0xe1030['include']=[{'model':db[_0xa68a('0x90')],'as':_0xa68a('0x91'),'required':![]},{'model':db[_0xa68a('0x92')],'as':_0xa68a('0x93'),'attributes':[_0xa68a('0x39'),_0xa68a('0x94'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa68a('0x39'),_0xa68a('0x95')],'where':_0x2971c6[_0xa68a('0x46')][_0xa68a('0x96')]?{'id':_0x2971c6[_0xa68a('0x46')][_0xa68a('0x96')]}:undefined,'required':_0x2971c6['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0xa68a('0x58')](_0xe1030);})[_0xa68a('0x23')](function(_0x446212){_0x5c2a8d[_0xa68a('0x69')]=_0x446212;return _0x5c2a8d;});}})[_0xa68a('0x23')](respondWithFilteredResult(_0x46d3fa,_0xe1030))['catch'](handleError(_0x46d3fa,null));};exports[_0xa68a('0x97')]=function(_0x3ad7c5,_0x176061,_0xd47c01){return db['MailAccount'][_0xa68a('0x66')]({'where':{'id':_0x3ad7c5[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x176061,null))[_0xa68a('0x23')](function(_0x20594a){if(_0x20594a){return db['sequelize']['transaction'](function(_0x42e9b5){return db[_0xa68a('0x98')]['destroy']({'where':{'MailAccountId':_0x3ad7c5[_0xa68a('0x5a')]['id']},'transaction':_0x42e9b5})[_0xa68a('0x23')](function(_0xa77257){var _0x3cd5c7=_['map'](_0x3ad7c5[_0xa68a('0x5f')],function(_0x2a451f){_0x2a451f[_0xa68a('0x63')]=_0x3ad7c5[_0xa68a('0x5a')]['id'];return _0x2a451f;});return db[_0xa68a('0x98')]['bulkCreate'](_0x3cd5c7,{'transaction':_0x42e9b5});});})[_0xa68a('0x23')](function(){return db[_0xa68a('0x98')][_0xa68a('0x99')]({'where':{'MailAccountId':_0x3ad7c5[_0xa68a('0x5a')]['id']},'order':_0xa68a('0x9a')});});}})['then'](respondWithResult(_0x176061,null))['catch'](handleError(_0x176061,null));};exports[_0xa68a('0x9b')]=function(_0x30b075,_0x19bb35,_0x5dffaf){var _0x52f6d2={};var _0x560184={};var _0x8cce22;var _0x5d4ea0;return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x30b075[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x19bb35,null))[_0xa68a('0x23')](function(_0x40a16c){if(_0x40a16c){_0x8cce22=_0x40a16c;_0x560184['model']=_['keys'](db['MailApplication'][_0xa68a('0x41')]);_0x560184[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x30b075[_0xa68a('0x46')]);_0x560184['filters']=_[_0xa68a('0x4a')](_0x560184['model'],_0x560184['query']);_0x52f6d2[_0xa68a('0x49')]=_[_0xa68a('0x4a')](_0x560184[_0xa68a('0x45')],qs[_0xa68a('0x4b')](_0x30b075['query'][_0xa68a('0x4b')]));_0x52f6d2[_0xa68a('0x49')]=_0x52f6d2[_0xa68a('0x49')][_0xa68a('0x5d')]?_0x52f6d2[_0xa68a('0x49')]:_0x560184[_0xa68a('0x45')];_0x52f6d2['order']=qs[_0xa68a('0x4f')](_0x30b075[_0xa68a('0x46')][_0xa68a('0x4f')]);_0x52f6d2[_0xa68a('0x50')]=qs[_0xa68a('0x48')](_[_0xa68a('0x51')](_0x30b075[_0xa68a('0x46')],_0x560184[_0xa68a('0x48')]));if(_0x30b075['query'][_0xa68a('0x52')]){_0x52f6d2['where']=_[_0xa68a('0x53')](_0x52f6d2['where'],{'$or':_[_0xa68a('0x3f')](_0x52f6d2[_0xa68a('0x49')],function(_0x37e473){var _0x1a7dca={};_0x1a7dca[_0x37e473]={'$like':'%'+_0x30b075[_0xa68a('0x46')][_0xa68a('0x52')]+'%'};return _0x1a7dca;})});}_0x52f6d2=_[_0xa68a('0x53')]({},_0x52f6d2,_0x30b075[_0xa68a('0x55')]);return _0x8cce22['getApplications'](_0x52f6d2);}})[_0xa68a('0x23')](function(_0x30e6f2){if(_0x30e6f2){_0x5d4ea0=_0x30e6f2[_0xa68a('0x5d')];if(!_0x30b075[_0xa68a('0x46')][_0xa68a('0x4c')](_0xa68a('0x67'))){_0x52f6d2[_0xa68a('0x4d')]=qs[_0xa68a('0x4d')](_0x30b075[_0xa68a('0x46')][_0xa68a('0x4d')]);_0x52f6d2[_0xa68a('0x31')]=qs['offset'](_0x30b075['query'][_0xa68a('0x31')]);}return _0x8cce22[_0xa68a('0x9b')](_0x52f6d2);}})[_0xa68a('0x23')](function(_0x34a077){if(_0x34a077){return _0x34a077?{'count':_0x5d4ea0,'rows':_0x34a077}:null;}})[_0xa68a('0x23')](respondWithResult(_0x19bb35,null))[_0xa68a('0x59')](handleError(_0x19bb35,null));};exports[_0xa68a('0x9c')]=function(_0x40358c,_0x3e2928,_0x277f61){var _0x4011aa={'raw':!![],'where':{}};var _0x501c89={};var _0xeb32d={'count':0x0,'rows':[]};return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x40358c['params']['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x3e2928,null))[_0xa68a('0x23')](function(_0x2a4af6){if(_0x2a4af6){_0x501c89['model']=_['keys'](db[_0xa68a('0x9d')][_0xa68a('0x41')]);_0x501c89['query']=_[_0xa68a('0x47')](_0x40358c[_0xa68a('0x46')]);_0x501c89[_0xa68a('0x48')]=_[_0xa68a('0x4a')](_0x501c89[_0xa68a('0x45')],_0x501c89[_0xa68a('0x46')]);_0x4011aa[_0xa68a('0x49')]=_[_0xa68a('0x4a')](_0x501c89[_0xa68a('0x45')],qs[_0xa68a('0x4b')](_0x40358c['query'][_0xa68a('0x4b')]));_0x4011aa[_0xa68a('0x49')]=_0x4011aa['attributes'][_0xa68a('0x5d')]?_0x4011aa[_0xa68a('0x49')]:_0x501c89['model'];if(!_0x40358c[_0xa68a('0x46')][_0xa68a('0x4c')](_0xa68a('0x67'))){_0x4011aa[_0xa68a('0x4d')]=qs['limit'](_0x40358c['query'][_0xa68a('0x4d')]);_0x4011aa['offset']=qs[_0xa68a('0x31')](_0x40358c[_0xa68a('0x46')]['offset']);}_0x4011aa[_0xa68a('0x4e')]=qs['sort'](_0x40358c[_0xa68a('0x46')]['sort']);_0x4011aa[_0xa68a('0x50')]=qs[_0xa68a('0x48')](_[_0xa68a('0x51')](_0x40358c[_0xa68a('0x46')],_0x501c89[_0xa68a('0x48')]));_0x4011aa['where'][_0xa68a('0x63')]=_0x2a4af6['id'];if(_0x40358c['query'][_0xa68a('0x52')]){_0x4011aa['where']=_['merge'](_0x4011aa[_0xa68a('0x50')],{'$or':_[_0xa68a('0x3f')](_0x4011aa[_0xa68a('0x49')],function(_0x722aa4){var _0x1a4068={};_0x1a4068[_0x722aa4]={'$like':'%'+_0x40358c[_0xa68a('0x46')][_0xa68a('0x52')]+'%'};return _0x1a4068;})});}if(_0x40358c['query']['$gte']){var _0x22d5b7=_0x40358c[_0xa68a('0x46')][_0xa68a('0x9e')][_0xa68a('0x9f')](',');var _0x2e3452={};_0x2e3452[_0x22d5b7[0x0]]={'$gte':moment(_0x22d5b7[0x1])['format'](_0xa68a('0xa0'))};_0x4011aa[_0xa68a('0x50')]=_[_0xa68a('0x53')](_0x4011aa[_0xa68a('0x50')],_0x2e3452);}_0x4011aa=_[_0xa68a('0x53')]({},_0x4011aa,_0x40358c['options']);return db[_0xa68a('0x9d')][_0xa68a('0x30')]({'where':_0x4011aa[_0xa68a('0x50')]})[_0xa68a('0x23')](function(_0x2535fe){_0xeb32d[_0xa68a('0x30')]=_0x2535fe;if(_0x40358c[_0xa68a('0x46')][_0xa68a('0x56')]){_0x4011aa[_0xa68a('0x57')]=[{'all':!![]}];}return db[_0xa68a('0x9d')][_0xa68a('0x58')](_0x4011aa);})[_0xa68a('0x23')](function(_0x24f9d1){_0xeb32d['rows']=_0x24f9d1;return _0xeb32d;});}})[_0xa68a('0x23')](respondWithFilteredResult(_0x3e2928,_0x4011aa))[_0xa68a('0x59')](handleError(_0x3e2928,null));};exports[_0xa68a('0xa1')]=function(_0x415b5e,_0x3073bf,_0x5443e0){var _0x3d3577,_0x8941d7={},_0x23e6f6;if(_0x415b5e[_0xa68a('0x5f')]['to']){_0x23e6f6=_0x415b5e['body']['to'][_0xa68a('0x9f')](',')[0x0];}return db[_0xa68a('0x40')][_0xa68a('0x62')]({'where':{'id':_0x415b5e[_0xa68a('0x5a')]['id']},'include':[{'model':db[_0xa68a('0xa2')],'as':_0xa68a('0xa3'),'include':[{'model':db[_0xa68a('0x90')],'as':_0xa68a('0xa4'),'where':{'email':_0x23e6f6},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xa68a('0x3c')],'as':_0xa68a('0x3d'),'raw':!![]}]})[_0xa68a('0x23')](handleEntityNotFound(_0x3073bf,null))[_0xa68a('0x23')](function(_0x49a2f5){if(_0x49a2f5){_0x3d3577=_0x49a2f5;if(_0x49a2f5[_0xa68a('0x3d')]){if(_[_0xa68a('0x72')](_0x415b5e[_0xa68a('0x5f')][_0xa68a('0xa5')])){_0x415b5e['body'][_0xa68a('0xa5')]=util[_0xa68a('0xa6')](_0xa68a('0xa7'),_0x49a2f5['name'],_0x49a2f5[_0xa68a('0x70')]||_0x49a2f5[_0xa68a('0x3d')]['user']);}if(_0x415b5e[_0xa68a('0x5f')][_0xa68a('0xa8')]&&_0x415b5e['body'][_0xa68a('0xa8')]['length']){for(var _0x2eb3fb=0x0;_0x2eb3fb<_0x415b5e[_0xa68a('0x5f')]['attachments'][_0xa68a('0x5d')];_0x2eb3fb+=0x1){_0x415b5e[_0xa68a('0x5f')]['attachments'][_0x2eb3fb]={'filename':_0x415b5e[_0xa68a('0x5f')][_0xa68a('0xa8')][_0x2eb3fb]['name'],'path':path[_0xa68a('0xa9')](config[_0xa68a('0xaa')],'server/files/attachments',_0x415b5e[_0xa68a('0x5f')][_0xa68a('0xa8')][_0x2eb3fb][_0xa68a('0xab')])};}}var _0x5d7913={'tls':{'rejectUnauthorized':![]}};if(_[_0xa68a('0x72')](_0x49a2f5[_0xa68a('0x3d')]['service'])){if(_0x49a2f5[_0xa68a('0x3d')][_0xa68a('0x7a')]){_0x5d7913[_0xa68a('0xac')]={'user':_0x49a2f5[_0xa68a('0x3d')]['user'],'pass':_0x49a2f5[_0xa68a('0x3d')][_0xa68a('0x78')]};}_0x5d7913[_0xa68a('0x7b')]=_0x49a2f5[_0xa68a('0x3d')]['host'];_0x5d7913['port']=_0x49a2f5[_0xa68a('0x3d')][_0xa68a('0x7c')];_0x5d7913[_0xa68a('0xad')]=_0x49a2f5[_0xa68a('0x3d')][_0xa68a('0xad')];}else{_0x5d7913['service']=_0x49a2f5[_0xa68a('0x3d')]['service'];_0x5d7913[_0xa68a('0xac')]={'user':_0x49a2f5['Smtp'][_0xa68a('0x75')],'pass':_0x49a2f5[_0xa68a('0x3d')][_0xa68a('0x78')]};}return respondWithRpcPromise(_0xa68a('0xae'),'sendMail',{'account':_0x5d7913,'message':_0x415b5e[_0xa68a('0x5f')]});}else{throw new Error(_0xa68a('0xaf'));}}})[_0xa68a('0x23')](function(_0x38fcdd){if(_0x38fcdd){_0x8941d7=_0x38fcdd;if(_0x3d3577[_0xa68a('0xa3')]){if(_0x3d3577['List'][_0xa68a('0xa4')][_0xa68a('0x5d')]){return _0x3d3577[_0xa68a('0xa3')][_0xa68a('0xa4')][0x0];}else{return db[_0xa68a('0x90')][_0xa68a('0x64')](_['defaults'](_0x415b5e['body'],{'firstName':_0x415b5e['body']['to'],'email':_0x415b5e[_0xa68a('0x5f')]['to'],'phone':_0x415b5e[_0xa68a('0x5f')]['to'],'ListId':_0x3d3577[_0xa68a('0x71')]}));}}else{throw new Error(_0xa68a('0xaf'));}}})['then'](function(_0x22bf13){if(_0x22bf13){var _0x11d7b={'UserId':_0x415b5e[_0xa68a('0x75')]['id'],'ContactId':_0x22bf13['id'],'MailAccountId':_0x3d3577['id'],'inReplyTo':_0x8941d7[_0xa68a('0xb0')],'to':_0x415b5e[_0xa68a('0x5f')][_0xa68a('0xa5')],'cc':_0x415b5e[_0xa68a('0x5f')]['cc'],'subject':_0x415b5e[_0xa68a('0x5f')]['subject'],'attach':_0x415b5e[_0xa68a('0x5f')][_0xa68a('0xb1')],'firstMsgDirection':_0xa68a('0xb2'),'lastMsgAt':moment()[_0xa68a('0xa6')](_0xa68a('0xa0')),'lastMsgDirection':_0xa68a('0xb2'),'lastMsgBody':_0x415b5e[_0xa68a('0x5f')][_0xa68a('0x5f')],'Messages':[_[_0xa68a('0x53')](_0x415b5e['body'],{'messageId':_0x8941d7[_0xa68a('0xb0')],'sentAt':moment()[_0xa68a('0xa6')](_0xa68a('0xa0')),'read':!![],'MailAccountId':_0x3d3577['id'],'UserId':_0x415b5e[_0xa68a('0x75')]['id'],'ContactId':_0x22bf13['id']})]};if(_0x415b5e['body'][_0xa68a('0xb3')]){_0x11d7b=_[_0xa68a('0x53')](_0x11d7b,_0x415b5e[_0xa68a('0x5f')]['Interaction']);}return db[_0xa68a('0x8f')][_0xa68a('0x64')](_0x11d7b,{'include':[{'model':db[_0xa68a('0x9d')],'as':'Messages'}]});}})[_0xa68a('0x23')](respondWithResult(_0x3073bf,null))['catch'](handleError(_0x3073bf,null));};exports['verifySmtp']=function(_0x35505b,_0x420423,_0x3c9338){return db['MailAccount'][_0xa68a('0x62')]({'where':{'id':_0x35505b[_0xa68a('0x5a')]['id']},'include':[{'model':db[_0xa68a('0x3c')],'as':_0xa68a('0x3d'),'raw':!![]}]})[_0xa68a('0x23')](handleEntityNotFound(_0x420423,null))[_0xa68a('0x23')](function(_0x282176){if(_0x282176&&_0x282176[_0xa68a('0x3d')]){var _0x5336ac={'id':_0x282176['id'],'tls':{'rejectUnauthorized':![]}};if(_0x282176[_0xa68a('0x3d')][_0xa68a('0x7d')]){_0x5336ac[_0xa68a('0x7d')]=_0x282176[_0xa68a('0x3d')][_0xa68a('0x7d')];}else{_0x5336ac[_0xa68a('0x7b')]=_0x282176[_0xa68a('0x3d')][_0xa68a('0x7b')];_0x5336ac[_0xa68a('0x7c')]=_0x282176['Smtp'][_0xa68a('0x7c')];_0x5336ac[_0xa68a('0xad')]=_0x282176[_0xa68a('0x3d')]['secure'];}if(_0x282176['Smtp']['authentication']){_0x5336ac['auth']={'user':_0x282176[_0xa68a('0x3d')][_0xa68a('0x75')],'pass':_0x282176[_0xa68a('0x3d')][_0xa68a('0x78')]};}return respondWithRpcPromise(_0xa68a('0xb4'),_0xa68a('0xb5'),{'account':_0x5336ac});}})[_0xa68a('0x23')](respondWithResult(_0x420423,null))[_0xa68a('0x59')](handleError(_0x420423,null));};exports[_0xa68a('0x36')]=function(_0xa19db7,_0x23ceff){return db[_0xa68a('0x40')][_0xa68a('0x62')]({'where':{'id':_0xa19db7[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x23ceff,null))[_0xa68a('0x23')](function(_0x4d433){if(_0x4d433&&_0x4d433[_0xa68a('0x7d')]){throw new db[(_0xa68a('0x1f'))]['ValidationError'](_0xa68a('0xb6'));}return _0x4d433;})['then'](removeEntity(_0x23ceff,null))[_0xa68a('0x59')](handleError(_0x23ceff,null));};exports['addAgents']=function(_0x66e5b8,_0xf0467c,_0x4f06d0){return db[_0xa68a('0x40')]['find']({'where':{'id':_0x66e5b8[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0xf0467c,null))[_0xa68a('0x23')](function(_0x48425c){if(_0x48425c){return _0x48425c[_0xa68a('0xb7')](_0x66e5b8[_0xa68a('0x5f')]['ids'],_[_0xa68a('0x8d')](_0x66e5b8[_0xa68a('0x5f')],['ids','id'])||{})[_0xa68a('0xb8')](function(_0x5dd43d){for(var _0x5afa5f=0x0;_0x5afa5f<_0x66e5b8[_0xa68a('0x5f')][_0xa68a('0x6b')]['length'];_0x5afa5f+=0x1){socket[_0xa68a('0xb9')](_0xa68a('0xba'),{'UserId':_0x66e5b8['body'][_0xa68a('0x6b')][_0x5afa5f],'MailAccountId':_0x66e5b8[_0xa68a('0x5a')]['id']});}return _0x5dd43d;});}})[_0xa68a('0x23')](respondWithResult(_0xf0467c,null))['catch'](handleError(_0xf0467c,null));};exports['removeAgents']=function(_0x5eed19,_0x4abd84,_0x187d93){return db[_0xa68a('0x40')]['find']({'where':{'id':_0x5eed19[_0xa68a('0x5a')]['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x4abd84,null))[_0xa68a('0x23')](function(_0x28e7c8){if(_0x28e7c8){return _0x28e7c8['removeAgents'](_0x5eed19['query'][_0xa68a('0x6b')])[_0xa68a('0x23')](function(){if(_[_0xa68a('0xbb')](_0x5eed19['query'][_0xa68a('0x6b')])){for(var _0x303f85=0x0;_0x303f85<_0x5eed19[_0xa68a('0x46')][_0xa68a('0x6b')]['length'];_0x303f85+=0x1){socket[_0xa68a('0xb9')](_0xa68a('0xbc'),{'UserId':Number(_0x5eed19[_0xa68a('0x46')][_0xa68a('0x6b')][_0x303f85]),'MailAccountId':Number(_0x5eed19[_0xa68a('0x5a')]['id'])});}}else{socket[_0xa68a('0xb9')](_0xa68a('0xbc'),{'UserId':Number(_0x5eed19['query'][_0xa68a('0x6b')]),'MailAccountId':Number(_0x5eed19[_0xa68a('0x5a')]['id'])});}});}})[_0xa68a('0x23')](respondWithStatusCode(_0x4abd84,null))[_0xa68a('0x59')](handleError(_0x4abd84,null));};exports[_0xa68a('0xbd')]=function(_0x10d79e,_0x232a29,_0x556fe5){var _0x302613={};var _0x63c78b={};var _0x328e40;var _0x1f83b5;return db[_0xa68a('0x40')][_0xa68a('0x66')]({'where':{'id':_0x10d79e['params']['id']}})[_0xa68a('0x23')](handleEntityNotFound(_0x232a29,null))['then'](function(_0x5a417a){if(_0x5a417a){_0x328e40=_0x5a417a;_0x63c78b[_0xa68a('0x45')]=_[_0xa68a('0x47')](db['User'][_0xa68a('0x41')]);_0x63c78b['query']=_[_0xa68a('0x47')](_0x10d79e[_0xa68a('0x46')]);_0x63c78b[_0xa68a('0x48')]=_['intersection'](_0x63c78b[_0xa68a('0x45')],_0x63c78b[_0xa68a('0x46')]);_0x302613[_0xa68a('0x49')]=_['intersection'](_0x63c78b[_0xa68a('0x45')],qs[_0xa68a('0x4b')](_0x10d79e[_0xa68a('0x46')][_0xa68a('0x4b')]));_0x302613[_0xa68a('0x49')]=_0x302613['attributes']['length']?_0x302613['attributes']:_0x63c78b['model'];_0x302613['order']=qs[_0xa68a('0x4f')](_0x10d79e[_0xa68a('0x46')][_0xa68a('0x4f')]);_0x302613[_0xa68a('0x50')]=qs[_0xa68a('0x48')](_['pick'](_0x10d79e[_0xa68a('0x46')],_0x63c78b[_0xa68a('0x48')]));if(_0x10d79e['query'][_0xa68a('0x52')]){_0x302613[_0xa68a('0x50')]=_[_0xa68a('0x53')](_0x302613[_0xa68a('0x50')],{'$or':_[_0xa68a('0x3f')](_0x302613[_0xa68a('0x49')],function(_0x2b6889){var _0x4b4761={};_0x4b4761[_0x2b6889]={'$like':'%'+_0x10d79e[_0xa68a('0x46')][_0xa68a('0x52')]+'%'};return _0x4b4761;})});}_0x302613=_[_0xa68a('0x53')]({},_0x302613,_0x10d79e[_0xa68a('0x55')]);return _0x328e40[_0xa68a('0xbd')](_0x302613);}})[_0xa68a('0x23')](function(_0x4ca7d4){if(_0x4ca7d4){_0x1f83b5=_0x4ca7d4[_0xa68a('0x5d')];if(!_0x10d79e[_0xa68a('0x46')]['hasOwnProperty'](_0xa68a('0x67'))){_0x302613[_0xa68a('0x4d')]=qs[_0xa68a('0x4d')](_0x10d79e[_0xa68a('0x46')][_0xa68a('0x4d')]);_0x302613[_0xa68a('0x31')]=qs['offset'](_0x10d79e[_0xa68a('0x46')]['offset']);}return _0x328e40[_0xa68a('0xbd')](_0x302613);}})[_0xa68a('0x23')](function(_0x30f794){if(_0x30f794){return _0x30f794?{'count':_0x1f83b5,'rows':_0x30f794}:null;}})[_0xa68a('0x23')](respondWithResult(_0x232a29,null))['catch'](handleError(_0x232a29,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 9f46deb..3573f8a 100644 --- a/server/api/mailAccount/mailAccount.events.js +++ b/server/api/mailAccount/mailAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f4a=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x3f4a,0xc0));var _0xa3f4=function(_0x126e5f,_0x550275){_0x126e5f=_0x126e5f-0x0;var _0x4e6878=_0x3f4a[_0x126e5f];return _0x4e6878;};'use strict';var EventEmitter=require(_0xa3f4('0x0'));var MailAccount=require(_0xa3f4('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa3f4('0x2')](0x0);var events={'afterCreate':_0xa3f4('0x3'),'afterUpdate':_0xa3f4('0x4'),'afterDestroy':_0xa3f4('0x5')};function emitEvent(_0x3f3dab){return function(_0x254c8a,_0x6ec9e5,_0x422fc){MailAccountEvents[_0xa3f4('0x6')](_0x3f3dab+':'+_0x254c8a['id'],_0x254c8a);MailAccountEvents[_0xa3f4('0x6')](_0x3f3dab,_0x254c8a);_0x422fc(null);};}for(var e in events){if(events[_0xa3f4('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xa3f4('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xb1af=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','save','update'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xb1af,0x154));var _0xfb1a=function(_0x42a63f,_0x59b73f){_0x42a63f=_0x42a63f-0x0;var _0x495a79=_0xb1af[_0x42a63f];return _0x495a79;};'use strict';var EventEmitter=require(_0xfb1a('0x0'));var MailAccount=require(_0xfb1a('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfb1a('0x2'),'afterUpdate':_0xfb1a('0x3'),'afterDestroy':_0xfb1a('0x4')};function emitEvent(_0x3823f0){return function(_0x238158,_0x5691cf,_0x220d75){MailAccountEvents[_0xfb1a('0x5')](_0x3823f0+':'+_0x238158['id'],_0x238158);MailAccountEvents['emit'](_0x3823f0,_0x238158);_0x220d75(null);};}for(var e in events){if(events[_0xfb1a('0x6')](e)){var event=events[e];MailAccount[_0xfb1a('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 760dd71..f078d81 100644 --- a/server/api/mailAccount/mailAccount.model.js +++ b/server/api/mailAccount/mailAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeca3=['api','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger'];(function(_0x53d0fb,_0x59b722){var _0x5633e8=function(_0x261db5){while(--_0x261db5){_0x53d0fb['push'](_0x53d0fb['shift']());}};_0x5633e8(++_0x59b722);}(_0xeca3,0x99));var _0x3eca=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xeca3[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x3eca('0x0'));var util=require(_0x3eca('0x1'));var logger=require(_0x3eca('0x2'))(_0x3eca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3eca('0x4'));var fs=require('fs');var path=require(_0x3eca('0x5'));var rimraf=require(_0x3eca('0x6'));var config=require(_0x3eca('0x7'));var attributes=require(_0x3eca('0x8'));module[_0x3eca('0x9')]=function(_0x5407f9,_0x6312d1){return _0x5407f9[_0x3eca('0xa')](_0x3eca('0xb'),attributes,{'tableName':_0x3eca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe086=['exports','define','mail_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xe086,0x15f));var _0x6e08=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe086[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6e08('0x0'));var util=require('util');var logger=require(_0x6e08('0x1'))(_0x6e08('0x2'));var moment=require(_0x6e08('0x3'));var BPromise=require(_0x6e08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e08('0x5'));var rimraf=require(_0x6e08('0x6'));var config=require(_0x6e08('0x7'));var attributes=require(_0x6e08('0x8'));module[_0x6e08('0x9')]=function(_0x1a26a9,_0x21319f){return _0x1a26a9[_0x6e08('0xa')]('MailAccount',attributes,{'tableName':_0x6e08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 1084b32..1c0026a 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc40=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','Contacts','MailApplication','Applications','Smtp','List','get','account','omit','applications','list','orderBy','priority','asc','length','close','autoclose','*,*,*,*','defaults','create','List\x20not\x20found','messageId','generate','subject','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','attach','format','interaction','contact','attachments','originCc','bcc','Attachment','Attachments','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailAccount','findAll','options','raw','where','attributes','include','map','model','GetMailAccount','ShowMailAccount','mail','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory'];(function(_0x25ada9,_0x5f0e07){var _0x59e1ab=function(_0x241d91){while(--_0x241d91){_0x25ada9['push'](_0x25ada9['shift']());}};_0x59e1ab(++_0x5f0e07);}(_0xcc40,0x97));var _0x0cc4=function(_0x2bfcb6,_0x4a2177){_0x2bfcb6=_0x2bfcb6-0x0;var _0x366baf=_0xcc40[_0x2bfcb6];return _0x366baf;};'use strict';var _=require(_0x0cc4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0cc4('0x1'));var rs=require(_0x0cc4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cc4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cc4('0x4'))(_0x0cc4('0x5'));var config=require('../../config/environment');var jayson=require(_0x0cc4('0x6'));var client=jayson['client'][_0x0cc4('0x7')]({'port':0x232c});config['redis']=_['defaults'](config[_0x0cc4('0x8')],{'host':_0x0cc4('0x9'),'port':0x18eb});var socket=require(_0x0cc4('0xa'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x0cc4('0xb')](socket);function respondWithRpcPromise(_0x36b2b2,_0x5205b0,_0x584d01){return new BPromise(function(_0x40e8f6,_0x1da7b0){return client[_0x0cc4('0xc')](_0x36b2b2,_0x584d01)[_0x0cc4('0xd')](function(_0x1614d2){logger[_0x0cc4('0xe')](_0x0cc4('0xf'),_0x5205b0,_0x0cc4('0x10'));logger[_0x0cc4('0x11')](_0x0cc4('0x12'),_0x5205b0,_0x0cc4('0x10'),JSON[_0x0cc4('0x13')](_0x1614d2));if(_0x1614d2[_0x0cc4('0x14')]){if(_0x1614d2[_0x0cc4('0x14')][_0x0cc4('0x15')]===0x1f4){logger['error'](_0x0cc4('0xf'),_0x5205b0,_0x1614d2[_0x0cc4('0x14')][_0x0cc4('0x16')]);return _0x1da7b0(_0x1614d2[_0x0cc4('0x14')][_0x0cc4('0x16')]);}logger['error'](_0x0cc4('0xf'),_0x5205b0,_0x1614d2[_0x0cc4('0x14')][_0x0cc4('0x16')]);return _0x40e8f6(_0x1614d2[_0x0cc4('0x14')]['message']);}else{logger[_0x0cc4('0xe')](_0x0cc4('0xf'),_0x5205b0,_0x0cc4('0x10'));_0x40e8f6(_0x1614d2['result'][_0x0cc4('0x16')]);}})[_0x0cc4('0x17')](function(_0x3b3f83){logger['error'](_0x0cc4('0xf'),_0x5205b0,_0x3b3f83);_0x1da7b0(_0x3b3f83);});});}exports['GetMailAccount']=function(_0x502991){var _0x3b9b96=this;return new Promise(function(_0x5c8a6e,_0x20a35f){return db[_0x0cc4('0x18')][_0x0cc4('0x19')]({'raw':_0x502991[_0x0cc4('0x1a')]?_0x502991[_0x0cc4('0x1a')][_0x0cc4('0x1b')]===undefined?!![]:![]:!![],'where':_0x502991[_0x0cc4('0x1a')]?_0x502991['options'][_0x0cc4('0x1c')]||null:null,'attributes':_0x502991['options']?_0x502991['options'][_0x0cc4('0x1d')]||null:null,'limit':_0x502991[_0x0cc4('0x1a')]?_0x502991[_0x0cc4('0x1a')]['limit']||null:null,'include':_0x502991[_0x0cc4('0x1a')]?_0x502991[_0x0cc4('0x1a')][_0x0cc4('0x1e')]?_[_0x0cc4('0x1f')](_0x502991[_0x0cc4('0x1a')]['include'],function(_0x349adf){return{'model':db[_0x349adf['model']],'as':_0x349adf['as'],'attributes':_0x349adf[_0x0cc4('0x1d')],'include':_0x349adf[_0x0cc4('0x1e')]?_[_0x0cc4('0x1f')](_0x349adf[_0x0cc4('0x1e')],function(_0x209d17){return{'model':db[_0x209d17[_0x0cc4('0x20')]],'as':_0x209d17['as'],'attributes':_0x209d17[_0x0cc4('0x1d')],'include':_0x209d17['include']?_['map'](_0x209d17[_0x0cc4('0x1e')],function(_0x29d2ea){return{'model':db[_0x29d2ea[_0x0cc4('0x20')]],'as':_0x29d2ea['as'],'attributes':_0x29d2ea[_0x0cc4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0cc4('0xd')](function(_0x31fbde){logger[_0x0cc4('0xe')]('GetMailAccount',_0x502991);logger['debug'](_0x0cc4('0x21'),_0x502991,JSON[_0x0cc4('0x13')](_0x31fbde));_0x5c8a6e(_0x31fbde);})[_0x0cc4('0x17')](function(_0x247fa0){logger['error'](_0x0cc4('0x21'),_0x247fa0['message'],_0x502991);_0x20a35f(_0x3b9b96['error'](0x1f4,_0x247fa0[_0x0cc4('0x16')]));});});};exports['ShowMailAccount']=function(_0x44d694){var _0x22d9d9=this;return new Promise(function(_0x506763,_0x5b7fbd){return db[_0x0cc4('0x18')]['find']({'raw':_0x44d694['options']?_0x44d694[_0x0cc4('0x1a')][_0x0cc4('0x1b')]===undefined?!![]:![]:!![],'where':_0x44d694[_0x0cc4('0x1a')]?_0x44d694[_0x0cc4('0x1a')][_0x0cc4('0x1c')]||null:null,'attributes':_0x44d694[_0x0cc4('0x1a')]?_0x44d694[_0x0cc4('0x1a')]['attributes']||null:null,'include':_0x44d694[_0x0cc4('0x1a')]?_0x44d694[_0x0cc4('0x1a')][_0x0cc4('0x1e')]?_[_0x0cc4('0x1f')](_0x44d694[_0x0cc4('0x1a')][_0x0cc4('0x1e')],function(_0x39b6ec){return{'model':db[_0x39b6ec[_0x0cc4('0x20')]],'as':_0x39b6ec['as'],'attributes':_0x39b6ec['attributes'],'include':_0x39b6ec[_0x0cc4('0x1e')]?_[_0x0cc4('0x1f')](_0x39b6ec[_0x0cc4('0x1e')],function(_0x10d0e8){return{'model':db[_0x10d0e8['model']],'as':_0x10d0e8['as'],'attributes':_0x10d0e8[_0x0cc4('0x1d')],'include':_0x10d0e8['include']?_['map'](_0x10d0e8[_0x0cc4('0x1e')],function(_0x1cbc4f){return{'model':db[_0x1cbc4f[_0x0cc4('0x20')]],'as':_0x1cbc4f['as'],'attributes':_0x1cbc4f[_0x0cc4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0cc4('0xd')](function(_0x1370a4){logger[_0x0cc4('0xe')](_0x0cc4('0x22'),_0x44d694);logger[_0x0cc4('0x11')](_0x0cc4('0x22'),_0x44d694,JSON['stringify'](_0x1370a4));_0x506763(_0x1370a4);})[_0x0cc4('0x17')](function(_0x24177c){logger['error'](_0x0cc4('0x22'),_0x24177c[_0x0cc4('0x16')],_0x44d694);_0x5b7fbd(_0x22d9d9[_0x0cc4('0x14')](0x1f4,_0x24177c[_0x0cc4('0x16')]));});});};exports['NotifyMailAccount']=function(_0x3d6872){var _0x58afd7=this;return new Promise(function(_0x477554,_0x3d7d68){var _0x3f9fde={'body':_0x3d6872['body'],'channel':_0x0cc4('0x23')};var _0x36d358=_['difference'](_[_0x0cc4('0x24')](db[_0x0cc4('0x25')][_0x0cc4('0x26')]),[_0x0cc4('0x27'),_0x0cc4('0x28'),_0x0cc4('0x29'),_0x0cc4('0x2a')]);var _0xfa0c2f=![];if(_0x3d6872[_0x0cc4('0x2b')]['id']){delete _0x3d6872['body']['id'];}if(_[_0x0cc4('0x2c')](_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x2d')])){return _0x3d7d68(_0x58afd7[_0x0cc4('0x14')](0x1f4,_0x0cc4('0x2e')));}if(_['isNil'](_0x3d6872['body'][_0x0cc4('0x2b')])||_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x2b')]===''){return _0x3d7d68(_0x58afd7['error'](0x1f4,_0x0cc4('0x2f')));}if(_[_0x0cc4('0x2c')](_0x3d6872['body'][_0x0cc4('0x30')])){return _0x3d7d68(_0x58afd7['error'](0x1f4,_0x0cc4('0x31')+_0x36d358));}if(!_[_0x0cc4('0x32')](_0x36d358,_0x3d6872['body'][_0x0cc4('0x30')])){return _0x3d7d68(_0x58afd7['error'](0x1f4,_0x0cc4('0x33')+_0x36d358));}var _0x102968={};_0x102968[_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x30')]]=_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x2d')];return db[_0x0cc4('0x18')][_0x0cc4('0x34')]({'where':{'id':_0x3d6872['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0cc4('0x25')],'as':_0x0cc4('0x35'),'where':_0x102968,'limit':0x1,'order':[[_0x0cc4('0x28'),'DESC']]}]},{'model':db[_0x0cc4('0x36')],'as':_0x0cc4('0x37')},{'model':db['MailServerOut'],'as':_0x0cc4('0x38')}]})[_0x0cc4('0xd')](function(_0x1fcc15){if(_0x1fcc15&&_0x1fcc15[_0x0cc4('0x39')]){var _0x23b4b9=_0x1fcc15[_0x0cc4('0x3a')]({'plain':!![]});_0x3f9fde[_0x0cc4('0x3b')]=_[_0x0cc4('0x3c')](_0x23b4b9,[_0x0cc4('0x37'),_0x0cc4('0x39')]);_0x3f9fde[_0x0cc4('0x3d')]=_0x23b4b9[_0x0cc4('0x37')];_0x3f9fde[_0x0cc4('0x3e')]=_0x23b4b9[_0x0cc4('0x39')];_0x3f9fde[_0x0cc4('0x3d')]=_[_0x0cc4('0x3f')](_0x3f9fde['applications'],[_0x0cc4('0x40')],[_0x0cc4('0x41')]);if(_0x3f9fde[_0x0cc4('0x3b')]&&_0x3f9fde[_0x0cc4('0x3b')]['autoclose']){_0x3f9fde['applications']['push']({'id':0x0,'priority':_0x3f9fde['applications'][_0x0cc4('0x42')]+0x1,'app':_0x0cc4('0x43'),'appdata':_0x0cc4('0x44'),'interval':_0x0cc4('0x45')});}if(_0x3f9fde[_0x0cc4('0x3b')]['Applications']){delete _0x3f9fde[_0x0cc4('0x3b')][_0x0cc4('0x37')];}if(_0x3f9fde[_0x0cc4('0x3b')][_0x0cc4('0x39')]){delete _0x3f9fde['account'][_0x0cc4('0x39')];}if(_0x23b4b9[_0x0cc4('0x39')][_0x0cc4('0x35')]['length']){return _0x23b4b9[_0x0cc4('0x39')]['Contacts'][0x0];}var _0x118167=_[_0x0cc4('0x46')](_0x3d6872['body'],{'firstName':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x2d')],'ListId':_0x23b4b9[_0x0cc4('0x2a')]});_0x118167[_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x30')]]=_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x2d')];return db[_0x0cc4('0x25')][_0x0cc4('0x47')](_0x118167);}else{throw new Error(_0x0cc4('0x48'));}})['then'](function(_0x1ded19){_0x3f9fde['contact']=_0x1ded19;if(_0x1ded19){if(!_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')]['messageId']){_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x49')]=rs[_0x0cc4('0x4a')]()+'\x20'+_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x2d')];}var _0x2ac331={'ContactId':_0x1ded19['id'],'MailAccountId':_0x3d6872[_0x0cc4('0x3b')]['id'],'inReplyTo':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')]['messageId'],'to':_0x3d6872[_0x0cc4('0x2b')]['message']['from'],'cc':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')]['cc'],'subject':_0x3d6872[_0x0cc4('0x2b')]['message'][_0x0cc4('0x4b')],'attach':_0x3d6872['body'][_0x0cc4('0x16')]['attach'],'lastMsgAt':moment()['format'](_0x0cc4('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x2b')]};return db['MailInteraction'][_0x0cc4('0x34')]({'where':{'closed':![],'MailAccountId':_0x3d6872[_0x0cc4('0x3b')]['id']},'include':[{'model':db[_0x0cc4('0x4d')],'as':_0x0cc4('0x4e'),'attributes':[_0x0cc4('0x49')],'where':{'messageId':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x4f')]}}]})[_0x0cc4('0xd')](function(_0x28498e){if(_0x28498e){return[_0x28498e,![]];}return db[_0x0cc4('0x50')]['create'](_0x2ac331)['then'](function(_0x26e315){return[_0x26e315,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0cc4('0x51')](function(_0x47819c,_0x4715fd){if(_0x47819c){_0xfa0c2f=_0x4715fd;if(!_0x4715fd){return _0x47819c[_0x0cc4('0x52')]({'inReplyTo':_0x3d6872[_0x0cc4('0x2b')]['message'][_0x0cc4('0x49')],'to':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x2d')],'cc':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')]['cc'],'subject':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x4b')],'attach':_0x47819c[_0x0cc4('0x53')]?_0x47819c[_0x0cc4('0x53')]:_0x3d6872[_0x0cc4('0x2b')]['message'][_0x0cc4('0x53')],'substatus':null,'substatusAt':moment()[_0x0cc4('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x0cc4('0x54')](_0x0cc4('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x3d6872['body']['body']});}else{return _0x47819c;}}})['then'](function(_0xf949d0){_0x3f9fde[_0x0cc4('0x55')]=_0xf949d0['get']({'plain':!![]});_0x3f9fde[_0x0cc4('0x55')]['created']=_0xfa0c2f;return db[_0x0cc4('0x4d')][_0x0cc4('0x47')]({'body':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x2b')],'MailAccountId':_0x3d6872[_0x0cc4('0x3b')]['id'],'MailInteractionId':_0xf949d0['id'],'direction':'in','ContactId':_0x3f9fde[_0x0cc4('0x56')]['id'],'messageId':_0x3d6872['body'][_0x0cc4('0x16')]['messageId'],'from':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x2d')],'to':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')]['to'],'cc':_0x3d6872['body'][_0x0cc4('0x16')]['cc'],'subject':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x4b')],'attach':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x53')],'Attachments':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x57')],'originTo':_0x3d6872[_0x0cc4('0x2b')]['message']['originTo'],'originCc':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x58')],'bcc':_0x3d6872[_0x0cc4('0x2b')][_0x0cc4('0x16')][_0x0cc4('0x59')]},{'include':[{'model':db[_0x0cc4('0x5a')],'as':_0x0cc4('0x5b')}]});})['then'](function(_0x7840d6){_0x3f9fde['message']=_0x7840d6;if(_0x3f9fde[_0x0cc4('0x55')][_0x0cc4('0x5c')]){return db[_0x0cc4('0x5d')][_0x0cc4('0x34')]({'attributes':['id','name'],'where':{'id':_0x3f9fde[_0x0cc4('0x55')][_0x0cc4('0x5c')]}})[_0x0cc4('0xd')](function(_0x32c381){if(_0x32c381){_0x3f9fde[_0x0cc4('0x3d')][_0x0cc4('0x5e')]({'id':0x0,'priority':0x0,'app':_0x0cc4('0x5f'),'appdata':_0x32c381['name']+','+(_0x3f9fde[_0x0cc4('0x3b')][_0x0cc4('0x60')]||0xa),'interval':_0x0cc4('0x45')});}return respondWithRpcPromise(_0x0cc4('0x61'),'startRouting',_0x3f9fde);});}return respondWithRpcPromise(_0x0cc4('0x61'),_0x0cc4('0x62'),_0x3f9fde);})['then'](function(_0x1f8567){_0x477554(_0x1f8567);})[_0x0cc4('0x17')](function(_0x45c27e){_0x3d7d68(_0x58afd7[_0x0cc4('0x14')](0x1f4,_0x45c27e[_0x0cc4('0x16')]));});});}; \ No newline at end of file +var _0xee4e=['MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','include','model','map','info','ShowMailAccount','find','raw','stringify','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','Applications','get','omit','applications','list','priority','asc','autoclose','push','close','*,*,*,*','length','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','spread','update','interaction','created','originTo','bcc','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0xee4e,0x122));var _0xeee4=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xee4e[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xeee4('0x0'));var util=require(_0xeee4('0x1'));var moment=require(_0xeee4('0x2'));var BPromise=require('bluebird');var rs=require(_0xeee4('0x3'));var fs=require('fs');var Redis=require(_0xeee4('0x4'));var db=require(_0xeee4('0x5'))['db'];var utils=require(_0xeee4('0x6'));var logger=require(_0xeee4('0x7'))(_0xeee4('0x8'));var config=require(_0xeee4('0x9'));var jayson=require(_0xeee4('0xa'));var client=jayson['client'][_0xeee4('0xb')]({'port':0x232c});config[_0xeee4('0xc')]=_[_0xeee4('0xd')](config['redis'],{'host':_0xeee4('0xe'),'port':0x18eb});var socket=require(_0xeee4('0xf'))(new Redis(config[_0xeee4('0xc')]));require('./mailAccount.socket')[_0xeee4('0x10')](socket);function respondWithRpcPromise(_0x1456f0,_0x10d27f,_0x59f64e){return new BPromise(function(_0x1af09f,_0x50d6f8){return client[_0xeee4('0x11')](_0x1456f0,_0x59f64e)[_0xeee4('0x12')](function(_0xd54ff2){logger['info'](_0xeee4('0x13'),_0x10d27f,_0xeee4('0x14'));logger[_0xeee4('0x15')](_0xeee4('0x16'),_0x10d27f,'request\x20sent',JSON['stringify'](_0xd54ff2));if(_0xd54ff2[_0xeee4('0x17')]){if(_0xd54ff2[_0xeee4('0x17')][_0xeee4('0x18')]===0x1f4){logger[_0xeee4('0x17')](_0xeee4('0x13'),_0x10d27f,_0xd54ff2['error']['message']);return _0x50d6f8(_0xd54ff2[_0xeee4('0x17')][_0xeee4('0x19')]);}logger[_0xeee4('0x17')](_0xeee4('0x13'),_0x10d27f,_0xd54ff2[_0xeee4('0x17')][_0xeee4('0x19')]);return _0x1af09f(_0xd54ff2['error'][_0xeee4('0x19')]);}else{logger['info'](_0xeee4('0x13'),_0x10d27f,'request\x20sent');_0x1af09f(_0xd54ff2[_0xeee4('0x1a')][_0xeee4('0x19')]);}})[_0xeee4('0x1b')](function(_0x557433){logger[_0xeee4('0x17')](_0xeee4('0x13'),_0x10d27f,_0x557433);_0x50d6f8(_0x557433);});});}exports[_0xeee4('0x1c')]=function(_0x5b62f9){var _0x133d76=this;return new Promise(function(_0x33765d,_0x3a981c){return db[_0xeee4('0x1d')]['findAll']({'raw':_0x5b62f9[_0xeee4('0x1e')]?_0x5b62f9[_0xeee4('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5b62f9[_0xeee4('0x1e')]?_0x5b62f9[_0xeee4('0x1e')][_0xeee4('0x1f')]||null:null,'attributes':_0x5b62f9[_0xeee4('0x1e')]?_0x5b62f9['options'][_0xeee4('0x20')]||null:null,'limit':_0x5b62f9[_0xeee4('0x1e')]?_0x5b62f9[_0xeee4('0x1e')]['limit']||null:null,'include':_0x5b62f9['options']?_0x5b62f9[_0xeee4('0x1e')][_0xeee4('0x21')]?_['map'](_0x5b62f9[_0xeee4('0x1e')]['include'],function(_0x46a6e1){return{'model':db[_0x46a6e1[_0xeee4('0x22')]],'as':_0x46a6e1['as'],'attributes':_0x46a6e1[_0xeee4('0x20')],'include':_0x46a6e1[_0xeee4('0x21')]?_[_0xeee4('0x23')](_0x46a6e1[_0xeee4('0x21')],function(_0x41ef12){return{'model':db[_0x41ef12[_0xeee4('0x22')]],'as':_0x41ef12['as'],'attributes':_0x41ef12[_0xeee4('0x20')],'include':_0x41ef12[_0xeee4('0x21')]?_['map'](_0x41ef12['include'],function(_0x344c1b){return{'model':db[_0x344c1b[_0xeee4('0x22')]],'as':_0x344c1b['as'],'attributes':_0x344c1b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x36b26f){logger[_0xeee4('0x24')]('GetMailAccount',_0x5b62f9);logger[_0xeee4('0x15')](_0xeee4('0x1c'),_0x5b62f9,JSON['stringify'](_0x36b26f));_0x33765d(_0x36b26f);})['catch'](function(_0x54088b){logger[_0xeee4('0x17')](_0xeee4('0x1c'),_0x54088b[_0xeee4('0x19')],_0x5b62f9);_0x3a981c(_0x133d76[_0xeee4('0x17')](0x1f4,_0x54088b[_0xeee4('0x19')]));});});};exports[_0xeee4('0x25')]=function(_0x2f8a9d){var _0x20843d=this;return new Promise(function(_0x4a7815,_0x51971e){return db['MailAccount'][_0xeee4('0x26')]({'raw':_0x2f8a9d['options']?_0x2f8a9d[_0xeee4('0x1e')][_0xeee4('0x27')]===undefined?!![]:![]:!![],'where':_0x2f8a9d[_0xeee4('0x1e')]?_0x2f8a9d[_0xeee4('0x1e')][_0xeee4('0x1f')]||null:null,'attributes':_0x2f8a9d[_0xeee4('0x1e')]?_0x2f8a9d[_0xeee4('0x1e')]['attributes']||null:null,'include':_0x2f8a9d[_0xeee4('0x1e')]?_0x2f8a9d[_0xeee4('0x1e')]['include']?_['map'](_0x2f8a9d[_0xeee4('0x1e')]['include'],function(_0x25563f){return{'model':db[_0x25563f[_0xeee4('0x22')]],'as':_0x25563f['as'],'attributes':_0x25563f[_0xeee4('0x20')],'include':_0x25563f[_0xeee4('0x21')]?_['map'](_0x25563f['include'],function(_0x136189){return{'model':db[_0x136189['model']],'as':_0x136189['as'],'attributes':_0x136189[_0xeee4('0x20')],'include':_0x136189[_0xeee4('0x21')]?_[_0xeee4('0x23')](_0x136189[_0xeee4('0x21')],function(_0x4536e4){return{'model':db[_0x4536e4[_0xeee4('0x22')]],'as':_0x4536e4['as'],'attributes':_0x4536e4['attributes']};}):[]};}):[]};}):[]:[]})[_0xeee4('0x12')](function(_0x91f224){logger[_0xeee4('0x24')](_0xeee4('0x25'),_0x2f8a9d);logger[_0xeee4('0x15')](_0xeee4('0x25'),_0x2f8a9d,JSON[_0xeee4('0x28')](_0x91f224));_0x4a7815(_0x91f224);})['catch'](function(_0x27da76){logger[_0xeee4('0x17')](_0xeee4('0x25'),_0x27da76[_0xeee4('0x19')],_0x2f8a9d);_0x51971e(_0x20843d[_0xeee4('0x17')](0x1f4,_0x27da76[_0xeee4('0x19')]));});});};exports['NotifyMailAccount']=function(_0x3e12b9){var _0x51c06d=this;return new Promise(function(_0x5c9915,_0x5a12df){var _0x17112f={'body':_0x3e12b9[_0xeee4('0x29')],'channel':'mail'};var _0x22c853=_[_0xeee4('0x2a')](_[_0xeee4('0x2b')](db[_0xeee4('0x2c')][_0xeee4('0x2d')]),[_0xeee4('0x2e'),_0xeee4('0x2f'),_0xeee4('0x30'),_0xeee4('0x31')]);var _0x1479ee=![];if(_0x3e12b9[_0xeee4('0x29')]['id']){delete _0x3e12b9[_0xeee4('0x29')]['id'];}if(_[_0xeee4('0x32')](_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x33')])){return _0x5a12df(_0x51c06d['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xeee4('0x32')](_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x29')])||_0x3e12b9[_0xeee4('0x29')]['body']===''){return _0x5a12df(_0x51c06d['error'](0x1f4,_0xeee4('0x34')));}if(_[_0xeee4('0x32')](_0x3e12b9[_0xeee4('0x29')]['mapKey'])){return _0x5a12df(_0x51c06d['error'](0x1f4,_0xeee4('0x35')+_0x22c853));}if(!_[_0xeee4('0x36')](_0x22c853,_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x37')])){return _0x5a12df(_0x51c06d[_0xeee4('0x17')](0x1f4,_0xeee4('0x38')+_0x22c853));}var _0x3fff39={};_0x3fff39[_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x37')]]=_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x33')];return db[_0xeee4('0x1d')][_0xeee4('0x26')]({'where':{'id':_0x3e12b9[_0xeee4('0x39')]['id']},'include':[{'model':db[_0xeee4('0x3a')],'as':_0xeee4('0x3b'),'include':[{'model':db[_0xeee4('0x2c')],'as':_0xeee4('0x3c'),'where':_0x3fff39,'limit':0x1,'order':[[_0xeee4('0x2f'),_0xeee4('0x3d')]]}]},{'model':db['MailApplication'],'as':_0xeee4('0x3e')},{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x2e21ea){if(_0x2e21ea&&_0x2e21ea[_0xeee4('0x3b')]){var _0x54fcda=_0x2e21ea[_0xeee4('0x3f')]({'plain':!![]});_0x17112f['account']=_[_0xeee4('0x40')](_0x54fcda,['Applications',_0xeee4('0x3b')]);_0x17112f[_0xeee4('0x41')]=_0x54fcda[_0xeee4('0x3e')];_0x17112f[_0xeee4('0x42')]=_0x54fcda[_0xeee4('0x3b')];_0x17112f[_0xeee4('0x41')]=_['orderBy'](_0x17112f[_0xeee4('0x41')],[_0xeee4('0x43')],[_0xeee4('0x44')]);if(_0x17112f[_0xeee4('0x39')]&&_0x17112f[_0xeee4('0x39')][_0xeee4('0x45')]){_0x17112f['applications'][_0xeee4('0x46')]({'id':0x0,'priority':_0x17112f[_0xeee4('0x41')]['length']+0x1,'app':_0xeee4('0x47'),'appdata':_0xeee4('0x45'),'interval':_0xeee4('0x48')});}if(_0x17112f[_0xeee4('0x39')]['Applications']){delete _0x17112f[_0xeee4('0x39')][_0xeee4('0x3e')];}if(_0x17112f[_0xeee4('0x39')]['List']){delete _0x17112f[_0xeee4('0x39')][_0xeee4('0x3b')];}if(_0x54fcda[_0xeee4('0x3b')]['Contacts'][_0xeee4('0x49')]){return _0x54fcda[_0xeee4('0x3b')][_0xeee4('0x3c')][0x0];}var _0x1ae1cb=_[_0xeee4('0xd')](_0x3e12b9[_0xeee4('0x29')],{'firstName':_0x3e12b9[_0xeee4('0x29')]['from'],'ListId':_0x54fcda[_0xeee4('0x31')]});_0x1ae1cb[_0x3e12b9['body'][_0xeee4('0x37')]]=_0x3e12b9[_0xeee4('0x29')]['from'];return db[_0xeee4('0x2c')]['create'](_0x1ae1cb);}else{throw new Error(_0xeee4('0x4a'));}})[_0xeee4('0x12')](function(_0x5a4fad){_0x17112f[_0xeee4('0x4b')]=_0x5a4fad;if(_0x5a4fad){if(!_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x4c')]){_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')]['messageId']=rs[_0xeee4('0x4d')]()+'\x20'+_0x3e12b9[_0xeee4('0x29')]['message']['from'];}var _0x55f7fe={'ContactId':_0x5a4fad['id'],'MailAccountId':_0x3e12b9['account']['id'],'inReplyTo':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x4c')],'to':_0x3e12b9['body']['message'][_0xeee4('0x33')],'cc':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')]['cc'],'subject':_0x3e12b9[_0xeee4('0x29')]['message'][_0xeee4('0x4e')],'attach':_0x3e12b9['body'][_0xeee4('0x19')][_0xeee4('0x4f')],'lastMsgAt':moment()[_0xeee4('0x50')](_0xeee4('0x51')),'lastMsgDirection':'in','lastMsgBody':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x29')]};return db[_0xeee4('0x52')][_0xeee4('0x26')]({'where':{'closed':![],'MailAccountId':_0x3e12b9[_0xeee4('0x39')]['id']},'include':[{'model':db[_0xeee4('0x53')],'as':_0xeee4('0x54'),'attributes':['messageId'],'where':{'messageId':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x55')]}}]})[_0xeee4('0x12')](function(_0x1439b6){if(_0x1439b6){return[_0x1439b6,![]];}return db[_0xeee4('0x52')][_0xeee4('0x56')](_0x55f7fe)[_0xeee4('0x12')](function(_0x31a1bf){return[_0x31a1bf,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xeee4('0x57')](function(_0x2fb63f,_0x2b7be3){if(_0x2fb63f){_0x1479ee=_0x2b7be3;if(!_0x2b7be3){return _0x2fb63f[_0xeee4('0x58')]({'inReplyTo':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x4c')],'to':_0x3e12b9[_0xeee4('0x29')]['message'][_0xeee4('0x33')],'cc':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')]['cc'],'subject':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x4e')],'attach':_0x2fb63f[_0xeee4('0x4f')]?_0x2fb63f[_0xeee4('0x4f')]:_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x4f')],'substatus':null,'substatusAt':moment()[_0xeee4('0x50')](_0xeee4('0x51')),'lastMsgAt':moment()[_0xeee4('0x50')](_0xeee4('0x51')),'lastMsgDirection':'in','lastMsgBody':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x29')]});}else{return _0x2fb63f;}}})['then'](function(_0x129234){_0x17112f['interaction']=_0x129234[_0xeee4('0x3f')]({'plain':!![]});_0x17112f[_0xeee4('0x59')][_0xeee4('0x5a')]=_0x1479ee;return db['MailMessage'][_0xeee4('0x56')]({'body':_0x3e12b9['body']['body'],'MailAccountId':_0x3e12b9[_0xeee4('0x39')]['id'],'MailInteractionId':_0x129234['id'],'direction':'in','ContactId':_0x17112f[_0xeee4('0x4b')]['id'],'messageId':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x4c')],'from':_0x3e12b9['body']['message'][_0xeee4('0x33')],'to':_0x3e12b9[_0xeee4('0x29')]['message']['to'],'cc':_0x3e12b9[_0xeee4('0x29')]['message']['cc'],'subject':_0x3e12b9[_0xeee4('0x29')]['message'][_0xeee4('0x4e')],'attach':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x4f')],'Attachments':_0x3e12b9[_0xeee4('0x29')]['message']['attachments'],'originTo':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')][_0xeee4('0x5b')],'originCc':_0x3e12b9[_0xeee4('0x29')][_0xeee4('0x19')]['originCc'],'bcc':_0x3e12b9['body'][_0xeee4('0x19')][_0xeee4('0x5c')]},{'include':[{'model':db[_0xeee4('0x5d')],'as':_0xeee4('0x5e')}]});})[_0xeee4('0x12')](function(_0x5b33b2){_0x17112f[_0xeee4('0x19')]=_0x5b33b2;if(_0x17112f[_0xeee4('0x59')][_0xeee4('0x5f')]){return db[_0xeee4('0x60')][_0xeee4('0x26')]({'attributes':['id',_0xeee4('0x61')],'where':{'id':_0x17112f[_0xeee4('0x59')][_0xeee4('0x5f')]}})['then'](function(_0x2ab4fa){if(_0x2ab4fa){_0x17112f[_0xeee4('0x41')][_0xeee4('0x62')]({'id':0x0,'priority':0x0,'app':_0xeee4('0x63'),'appdata':_0x2ab4fa[_0xeee4('0x61')]+','+(_0x17112f['account'][_0xeee4('0x64')]||0xa),'interval':_0xeee4('0x48')});}return respondWithRpcPromise(_0xeee4('0x65'),_0xeee4('0x66'),_0x17112f);});}return respondWithRpcPromise(_0xeee4('0x65'),_0xeee4('0x66'),_0x17112f);})[_0xeee4('0x12')](function(_0x41dfd5){_0x5c9915(_0x41dfd5);})[_0xeee4('0x1b')](function(_0x505c99){_0x5a12df(_0x51c06d[_0xeee4('0x17')](0x1f4,_0x505c99[_0xeee4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 644452b..0637aba 100644 --- a/server/api/mailAccount/mailAccount.socket.js +++ b/server/api/mailAccount/mailAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dfa=['update','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x6dfa,0x7b));var _0xa6df=function(_0x14114d,_0x33f634){_0x14114d=_0x14114d-0x0;var _0x1c8da4=_0x6dfa[_0x14114d];return _0x1c8da4;};'use strict';var MailAccountEvents=require(_0xa6df('0x0'));var events=[_0xa6df('0x1'),_0xa6df('0x2'),_0xa6df('0x3')];function createListener(_0x38f44c,_0x496a2f){return function(_0x1965ad){_0x496a2f['emit'](_0x38f44c,_0x1965ad);};}function removeListener(_0x2ea163,_0x4da450){return function(){MailAccountEvents['removeListener'](_0x2ea163,_0x4da450);};}exports[_0xa6df('0x4')]=function(_0x273081){for(var _0x3299a2=0x0,_0x4721a5=events[_0xa6df('0x5')];_0x3299a2<_0x4721a5;_0x3299a2++){var _0x16e528=events[_0x3299a2];var _0x57f22d=createListener(_0xa6df('0x6')+_0x16e528,_0x273081);MailAccountEvents['on'](_0x16e528,_0x57f22d);}}; \ No newline at end of file +var _0x9305=['register','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0xac872c,_0xf478b1){var _0x3179c1=function(_0x305fd8){while(--_0x305fd8){_0xac872c['push'](_0xac872c['shift']());}};_0x3179c1(++_0xf478b1);}(_0x9305,0x1e2));var _0x5930=function(_0x46a076,_0x54cf87){_0x46a076=_0x46a076-0x0;var _0x4a930d=_0x9305[_0x46a076];return _0x4a930d;};'use strict';var MailAccountEvents=require(_0x5930('0x0'));var events=[_0x5930('0x1'),_0x5930('0x2'),_0x5930('0x3')];function createListener(_0x5be178,_0x1769b6){return function(_0x1fc6b1){_0x1769b6[_0x5930('0x4')](_0x5be178,_0x1fc6b1);};}function removeListener(_0x16c710,_0x50d9ab){return function(){MailAccountEvents[_0x5930('0x5')](_0x16c710,_0x50d9ab);};}exports[_0x5930('0x6')]=function(_0x70d74f){for(var _0x2c4ada=0x0,_0x4b9cdf=events['length'];_0x2c4ada<_0x4b9cdf;_0x2c4ada++){var _0x2a3d8c=events[_0x2c4ada];var _0x80c566=createListener(_0x5930('0x7')+_0x2a3d8c,_0x70d74f);MailAccountEvents['on'](_0x2a3d8c,_0x80c566);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2482cf5..925384b 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4f4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3e383b,_0x181e68){var _0x248a9d=function(_0x36c458){while(--_0x36c458){_0x3e383b['push'](_0x3e383b['shift']());}};_0x248a9d(++_0x181e68);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x233c69,_0xa62a77){_0x233c69=_0x233c69-0x0;var _0x1cc9b7=_0xd4f4[_0x233c69];return _0x1cc9b7;};'use strict';var multer=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var path=require(_0x4d4f('0x2'));var timeout=require(_0x4d4f('0x3'));var express=require(_0x4d4f('0x4'));var router=express[_0x4d4f('0x5')]();var auth=require(_0x4d4f('0x6'));var interaction=require(_0x4d4f('0x7'));var config=require(_0x4d4f('0x8'));var controller=require(_0x4d4f('0x9'));router[_0x4d4f('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4d4f('0xb')](_0x4d4f('0xc'),auth[_0x4d4f('0xd')](),controller[_0x4d4f('0xe')]);router[_0x4d4f('0xf')](_0x4d4f('0xc'),auth[_0x4d4f('0xd')](),controller[_0x4d4f('0x10')]);module[_0x4d4f('0x11')]=router; \ No newline at end of file +var _0xaa88=['isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','show','/:id'];(function(_0x495680,_0x54962a){var _0x4199b7=function(_0x39b4fe){while(--_0x39b4fe){_0x495680['push'](_0x495680['shift']());}};_0x4199b7(++_0x54962a);}(_0xaa88,0x137));var _0x8aa8=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0xaa88[_0xbeb808];return _0x5d6909;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var auth=require(_0x8aa8('0x5'));var interaction=require(_0x8aa8('0x6'));var config=require(_0x8aa8('0x7'));var controller=require(_0x8aa8('0x8'));router[_0x8aa8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['put'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);module[_0x8aa8('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 868856c..00a10fd 100644 --- a/server/api/mailApplication/mailApplication.attributes.js +++ b/server/api/mailApplication/mailApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x703a=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x2e7eb5,_0x234560){var _0x401a31=function(_0x3710fe){while(--_0x3710fe){_0x2e7eb5['push'](_0x2e7eb5['shift']());}};_0x401a31(++_0x234560);}(_0x703a,0xaa));var _0xa703=function(_0x2c5f2f,_0x490849){_0x2c5f2f=_0x2c5f2f-0x0;var _0x85a7fc=_0x703a[_0x2c5f2f];return _0x85a7fc;};'use strict';var Sequelize=require(_0xa703('0x0'));module[_0xa703('0x1')]={'priority':{'type':Sequelize[_0xa703('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa703('0x3')],'allowNull':![],'defaultValue':_0xa703('0x4')},'appdata':{'type':Sequelize[_0xa703('0x5')]()},'description':{'type':Sequelize[_0xa703('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa703('0x6')}}; \ No newline at end of file +var _0xd6a6=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xa656ef,_0x3d31df){var _0x20e81=function(_0x128119){while(--_0x128119){_0xa656ef['push'](_0xa656ef['shift']());}};_0x20e81(++_0x3d31df);}(_0xd6a6,0x65));var _0x6d6a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd6a6[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6d6a('0x0'));module[_0x6d6a('0x1')]={'priority':{'type':Sequelize[_0x6d6a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6d6a('0x3')],'allowNull':![],'defaultValue':_0x6d6a('0x4')},'appdata':{'type':Sequelize[_0x6d6a('0x5')]()},'description':{'type':Sequelize[_0x6d6a('0x3')]},'interval':{'type':Sequelize[_0x6d6a('0x3')],'defaultValue':_0x6d6a('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 089bc7a..9246ba2 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6a8=['request-promise','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','params','model','keys','MailApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','options','find','catch','body','html-pdf','eml-format','zip-dir'];(function(_0x29db25,_0x457467){var _0x48b1a5=function(_0x5cb05f){while(--_0x5cb05f){_0x29db25['push'](_0x29db25['shift']());}};_0x48b1a5(++_0x457467);}(_0xe6a8,0x13b));var _0x8e6a=function(_0x27bece,_0x478949){_0x27bece=_0x27bece-0x0;var _0x5595e1=_0xe6a8[_0x27bece];return _0x5595e1;};'use strict';var pdf=require(_0x8e6a('0x0'));var emlformat=require(_0x8e6a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8e6a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e6a('0x3'));var moment=require(_0x8e6a('0x4'));var BPromise=require(_0x8e6a('0x5'));var Mustache=require('mustache');var util=require(_0x8e6a('0x6'));var path=require(_0x8e6a('0x7'));var sox=require('sox');var csv=require(_0x8e6a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8e6a('0x9'));var squel=require(_0x8e6a('0xa'));var crypto=require('crypto');var jsforce=require(_0x8e6a('0xb'));var deskjs=require(_0x8e6a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8e6a('0xd'));var Redis=require(_0x8e6a('0xe'));var authService=require(_0x8e6a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8e6a('0x10'));var hardwareService=require(_0x8e6a('0x11'));var logger=require(_0x8e6a('0x12'))(_0x8e6a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8e6a('0x14'))['db'];function respondWithStatusCode(_0x3f7c2c,_0x1fb892){_0x1fb892=_0x1fb892||0xcc;return function(_0x2f0883){if(_0x2f0883){return _0x3f7c2c[_0x8e6a('0x15')](_0x1fb892);}return _0x3f7c2c[_0x8e6a('0x16')](_0x1fb892)['end']();};}function respondWithResult(_0x15637e,_0x17544f){_0x17544f=_0x17544f||0xc8;return function(_0x513781){if(_0x513781){return _0x15637e[_0x8e6a('0x16')](_0x17544f)[_0x8e6a('0x17')](_0x513781);}};}function respondWithFilteredResult(_0x23d7da,_0x1cc131){return function(_0xa96d73){if(_0xa96d73){var _0x5b47de=_0xa96d73['count'],_0x2c4ba7=_0x1cc131[_0x8e6a('0x18')],_0xa39117=_0x1cc131[_0x8e6a('0x18')]+_0x1cc131[_0x8e6a('0x19')],_0xd7b97c;if(_0xa39117>=_0x5b47de){_0xa39117=_0x5b47de;_0xd7b97c=0xc8;}else{_0xd7b97c=0xce;}_0x23d7da['status'](_0xd7b97c);return _0x23d7da[_0x8e6a('0x1a')](_0x8e6a('0x1b'),_0x2c4ba7+'-'+_0xa39117+'/'+_0x5b47de)[_0x8e6a('0x17')](_0xa96d73);}return null;};}function patchUpdates(_0x3f153a){return function(_0xb33197){try{jsonpatch[_0x8e6a('0x1c')](_0xb33197,_0x3f153a,!![]);}catch(_0x2f26fd){return BPromise[_0x8e6a('0x1d')](_0x2f26fd);}return _0xb33197[_0x8e6a('0x1e')]();};}function saveUpdates(_0x121d2b,_0x4b0c5d){return function(_0x4c2fcd){if(_0x4c2fcd){return _0x4c2fcd[_0x8e6a('0x1f')](_0x121d2b)[_0x8e6a('0x20')](function(_0x3ce1a2){return _0x3ce1a2;});}return null;};}function removeEntity(_0x229ea5,_0x346872){return function(_0x29f2ee){if(_0x29f2ee){return _0x29f2ee[_0x8e6a('0x21')]()[_0x8e6a('0x20')](function(){_0x229ea5[_0x8e6a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8d3e25,_0x44c11c){return function(_0x4591ae){if(!_0x4591ae){_0x8d3e25[_0x8e6a('0x15')](0x194);}return _0x4591ae;};}function handleError(_0x37c8e6,_0x124293){_0x124293=_0x124293||0x1f4;return function(_0x10308b){logger['error'](_0x10308b[_0x8e6a('0x22')]);if(_0x10308b['name']){delete _0x10308b[_0x8e6a('0x23')];}_0x37c8e6['status'](_0x124293)['send'](_0x10308b);};}exports[_0x8e6a('0x24')]=function(_0x3391bb,_0x1c84c2){var _0x3ecf36={'raw':!![],'where':{'id':_0x3391bb[_0x8e6a('0x25')]['id']}},_0x2af88e={};_0x2af88e[_0x8e6a('0x26')]=_[_0x8e6a('0x27')](db[_0x8e6a('0x28')][_0x8e6a('0x29')]);_0x2af88e['query']=_['keys'](_0x3391bb[_0x8e6a('0x2a')]);_0x2af88e['filters']=_[_0x8e6a('0x2b')](_0x2af88e[_0x8e6a('0x26')],_0x2af88e[_0x8e6a('0x2a')]);_0x3ecf36[_0x8e6a('0x2c')]=_[_0x8e6a('0x2b')](_0x2af88e[_0x8e6a('0x26')],qs[_0x8e6a('0x2d')](_0x3391bb[_0x8e6a('0x2a')][_0x8e6a('0x2d')]));_0x3ecf36['attributes']=_0x3ecf36[_0x8e6a('0x2c')][_0x8e6a('0x2e')]?_0x3ecf36['attributes']:_0x2af88e[_0x8e6a('0x26')];if(_0x3391bb[_0x8e6a('0x2a')][_0x8e6a('0x2f')]){_0x3ecf36[_0x8e6a('0x30')]=[{'all':!![]}];}_0x3ecf36=_['merge']({},_0x3ecf36,_0x3391bb[_0x8e6a('0x31')]);return db[_0x8e6a('0x28')][_0x8e6a('0x32')](_0x3ecf36)[_0x8e6a('0x20')](handleEntityNotFound(_0x1c84c2,null))['then'](respondWithResult(_0x1c84c2,null))[_0x8e6a('0x33')](handleError(_0x1c84c2,null));};exports[_0x8e6a('0x1f')]=function(_0x5c6bda,_0x3a4c42){if(_0x5c6bda[_0x8e6a('0x34')]['id']){delete _0x5c6bda[_0x8e6a('0x34')]['id'];}return db[_0x8e6a('0x28')]['find']({'where':{'id':_0x5c6bda[_0x8e6a('0x25')]['id']}})['then'](handleEntityNotFound(_0x3a4c42,null))[_0x8e6a('0x20')](saveUpdates(_0x5c6bda[_0x8e6a('0x34')],null))['then'](respondWithResult(_0x3a4c42,null))[_0x8e6a('0x33')](handleError(_0x3a4c42,null));};exports[_0x8e6a('0x21')]=function(_0x462f1a,_0x3e1aec){return db[_0x8e6a('0x28')][_0x8e6a('0x32')]({'where':{'id':_0x462f1a[_0x8e6a('0x25')]['id']}})[_0x8e6a('0x20')](handleEntityNotFound(_0x3e1aec,null))[_0x8e6a('0x20')](removeEntity(_0x3e1aec,null))['catch'](handleError(_0x3e1aec,null));}; \ No newline at end of file +var _0x832e=['includeAll','include','options','catch','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length'];(function(_0x3a10e3,_0x5b00a4){var _0x125b4b=function(_0x5f3d1a){while(--_0x5f3d1a){_0x3a10e3['push'](_0x3a10e3['shift']());}};_0x125b4b(++_0x5b00a4);}(_0x832e,0x13c));var _0xe832=function(_0x333678,_0x2c3f50){_0x333678=_0x333678-0x0;var _0x53839e=_0x832e[_0x333678];return _0x53839e;};'use strict';var pdf=require(_0xe832('0x0'));var emlformat=require(_0xe832('0x1'));var rimraf=require(_0xe832('0x2'));var zipdir=require(_0xe832('0x3'));var jsonpatch=require(_0xe832('0x4'));var rp=require(_0xe832('0x5'));var moment=require(_0xe832('0x6'));var BPromise=require(_0xe832('0x7'));var Mustache=require(_0xe832('0x8'));var util=require(_0xe832('0x9'));var path=require('path');var sox=require(_0xe832('0xa'));var csv=require(_0xe832('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe832('0xc'));var squel=require(_0xe832('0xd'));var crypto=require(_0xe832('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe832('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe832('0x10'));var Papa=require(_0xe832('0x11'));var Redis=require('ioredis');var authService=require(_0xe832('0x12'));var qs=require(_0xe832('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe832('0x14'));var logger=require(_0xe832('0x15'))(_0xe832('0x16'));var utils=require(_0xe832('0x17'));var config=require(_0xe832('0x18'));var db=require(_0xe832('0x19'))['db'];function respondWithStatusCode(_0x586800,_0x5aea6c){_0x5aea6c=_0x5aea6c||0xcc;return function(_0x45910e){if(_0x45910e){return _0x586800[_0xe832('0x1a')](_0x5aea6c);}return _0x586800['status'](_0x5aea6c)['end']();};}function respondWithResult(_0x3b5e9f,_0x104bfa){_0x104bfa=_0x104bfa||0xc8;return function(_0x5065c9){if(_0x5065c9){return _0x3b5e9f[_0xe832('0x1b')](_0x104bfa)[_0xe832('0x1c')](_0x5065c9);}};}function respondWithFilteredResult(_0x2fa8e7,_0xd0d335){return function(_0x26147a){if(_0x26147a){var _0x35c9c2=_0x26147a[_0xe832('0x1d')],_0x133327=_0xd0d335[_0xe832('0x1e')],_0x19d4cd=_0xd0d335[_0xe832('0x1e')]+_0xd0d335[_0xe832('0x1f')],_0x27c86a;if(_0x19d4cd>=_0x35c9c2){_0x19d4cd=_0x35c9c2;_0x27c86a=0xc8;}else{_0x27c86a=0xce;}_0x2fa8e7[_0xe832('0x1b')](_0x27c86a);return _0x2fa8e7[_0xe832('0x20')](_0xe832('0x21'),_0x133327+'-'+_0x19d4cd+'/'+_0x35c9c2)[_0xe832('0x1c')](_0x26147a);}return null;};}function patchUpdates(_0x56d3e6){return function(_0x1c98d0){try{jsonpatch[_0xe832('0x22')](_0x1c98d0,_0x56d3e6,!![]);}catch(_0x37bf84){return BPromise[_0xe832('0x23')](_0x37bf84);}return _0x1c98d0[_0xe832('0x24')]();};}function saveUpdates(_0x1935cb,_0x468eee){return function(_0x513df0){if(_0x513df0){return _0x513df0[_0xe832('0x25')](_0x1935cb)[_0xe832('0x26')](function(_0x156c21){return _0x156c21;});}return null;};}function removeEntity(_0x2f400e,_0x427d98){return function(_0x2b97c0){if(_0x2b97c0){return _0x2b97c0[_0xe832('0x27')]()[_0xe832('0x26')](function(){_0x2f400e[_0xe832('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53b607,_0x478c88){return function(_0x4661bb){if(!_0x4661bb){_0x53b607[_0xe832('0x1a')](0x194);}return _0x4661bb;};}function handleError(_0x366456,_0x184eda){_0x184eda=_0x184eda||0x1f4;return function(_0x57441b){logger[_0xe832('0x28')](_0x57441b[_0xe832('0x29')]);if(_0x57441b[_0xe832('0x2a')]){delete _0x57441b[_0xe832('0x2a')];}_0x366456[_0xe832('0x1b')](_0x184eda)[_0xe832('0x2b')](_0x57441b);};}exports[_0xe832('0x2c')]=function(_0x280c5e,_0x35e299){var _0x2d554e={'raw':!![],'where':{'id':_0x280c5e[_0xe832('0x2d')]['id']}},_0x3439b3={};_0x3439b3[_0xe832('0x2e')]=_[_0xe832('0x2f')](db[_0xe832('0x30')][_0xe832('0x31')]);_0x3439b3[_0xe832('0x32')]=_[_0xe832('0x2f')](_0x280c5e['query']);_0x3439b3[_0xe832('0x33')]=_[_0xe832('0x34')](_0x3439b3[_0xe832('0x2e')],_0x3439b3[_0xe832('0x32')]);_0x2d554e[_0xe832('0x35')]=_[_0xe832('0x34')](_0x3439b3[_0xe832('0x2e')],qs[_0xe832('0x36')](_0x280c5e[_0xe832('0x32')][_0xe832('0x36')]));_0x2d554e[_0xe832('0x35')]=_0x2d554e['attributes'][_0xe832('0x37')]?_0x2d554e[_0xe832('0x35')]:_0x3439b3[_0xe832('0x2e')];if(_0x280c5e[_0xe832('0x32')][_0xe832('0x38')]){_0x2d554e[_0xe832('0x39')]=[{'all':!![]}];}_0x2d554e=_['merge']({},_0x2d554e,_0x280c5e[_0xe832('0x3a')]);return db[_0xe832('0x30')]['find'](_0x2d554e)[_0xe832('0x26')](handleEntityNotFound(_0x35e299,null))['then'](respondWithResult(_0x35e299,null))[_0xe832('0x3b')](handleError(_0x35e299,null));};exports[_0xe832('0x25')]=function(_0x5e294b,_0x1bf1b7){if(_0x5e294b[_0xe832('0x3c')]['id']){delete _0x5e294b[_0xe832('0x3c')]['id'];}return db[_0xe832('0x30')][_0xe832('0x3d')]({'where':{'id':_0x5e294b[_0xe832('0x2d')]['id']}})[_0xe832('0x26')](handleEntityNotFound(_0x1bf1b7,null))[_0xe832('0x26')](saveUpdates(_0x5e294b[_0xe832('0x3c')],null))[_0xe832('0x26')](respondWithResult(_0x1bf1b7,null))[_0xe832('0x3b')](handleError(_0x1bf1b7,null));};exports[_0xe832('0x27')]=function(_0x54a254,_0x208130){return db[_0xe832('0x30')]['find']({'where':{'id':_0x54a254['params']['id']}})[_0xe832('0x26')](handleEntityNotFound(_0x208130,null))[_0xe832('0x26')](removeEntity(_0x208130,null))['catch'](handleError(_0x208130,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 8ea6c36..58d57d0 100644 --- a/server/api/mailApplication/mailApplication.model.js +++ b/server/api/mailApplication/mailApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0da=['define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x515d8d,_0x5a7b53){var _0x296990=function(_0x172593){while(--_0x172593){_0x515d8d['push'](_0x515d8d['shift']());}};_0x296990(++_0x5a7b53);}(_0xd0da,0x1b1));var _0xad0d=function(_0x3ae8f4,_0x2920f4){_0x3ae8f4=_0x3ae8f4-0x0;var _0x367312=_0xd0da[_0x3ae8f4];return _0x367312;};'use strict';var _=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var logger=require(_0xad0d('0x2'))(_0xad0d('0x3'));var moment=require(_0xad0d('0x4'));var BPromise=require('bluebird');var rp=require(_0xad0d('0x5'));var fs=require('fs');var path=require(_0xad0d('0x6'));var rimraf=require(_0xad0d('0x7'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xad0d('0x8')]=function(_0x5ddb42,_0x5cfc7d){return _0x5ddb42[_0xad0d('0x9')](_0xad0d('0xa'),attributes,{'tableName':_0xad0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad0d('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4efb=['bluebird','path','rimraf','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x5ba205,_0x117be5){var _0xfbd601=function(_0x17d6a3){while(--_0x17d6a3){_0x5ba205['push'](_0x5ba205['shift']());}};_0xfbd601(++_0x117be5);}(_0x4efb,0xfa));var _0xb4ef=function(_0x2eb076,_0x3eeab7){_0x2eb076=_0x2eb076-0x0;var _0x59e891=_0x4efb[_0x2eb076];return _0x59e891;};'use strict';var _=require('lodash');var util=require(_0xb4ef('0x0'));var logger=require(_0xb4ef('0x1'))(_0xb4ef('0x2'));var moment=require('moment');var BPromise=require(_0xb4ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4ef('0x4'));var rimraf=require(_0xb4ef('0x5'));var config=require('../../config/environment');var attributes=require(_0xb4ef('0x6'));module['exports']=function(_0x1f69fc,_0xd99454){return _0x1f69fc[_0xb4ef('0x7')](_0xb4ef('0x8'),attributes,{'tableName':_0xb4ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb4ef('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 4cbb0a6..f89aa4a 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94b3=['body','options','raw','where','attributes','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','MailApplication,\x20%s,\x20%s','message','UpdateMailApplication','MailApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94b3,0x98));var _0x394b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x94b3[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x394b('0x0'));var moment=require(_0x394b('0x1'));var BPromise=require(_0x394b('0x2'));var rs=require(_0x394b('0x3'));var fs=require('fs');var Redis=require(_0x394b('0x4'));var db=require(_0x394b('0x5'))['db'];var utils=require(_0x394b('0x6'));var logger=require(_0x394b('0x7'))('rpc');var config=require(_0x394b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x394b('0x9')][_0x394b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3195ee,_0x2cab17,_0x54816a){return new BPromise(function(_0x30a414,_0x2082f4){return client[_0x394b('0xb')](_0x3195ee,_0x54816a)[_0x394b('0xc')](function(_0x37645e){logger[_0x394b('0xd')]('MailApplication,\x20%s,\x20%s',_0x2cab17,_0x394b('0xe'));logger[_0x394b('0xf')](_0x394b('0x10'),_0x2cab17,_0x394b('0xe'),JSON['stringify'](_0x37645e));if(_0x37645e['error']){if(_0x37645e[_0x394b('0x11')]['code']===0x1f4){logger[_0x394b('0x11')](_0x394b('0x12'),_0x2cab17,_0x37645e[_0x394b('0x11')]['message']);return _0x2082f4(_0x37645e[_0x394b('0x11')][_0x394b('0x13')]);}logger[_0x394b('0x11')](_0x394b('0x12'),_0x2cab17,_0x37645e[_0x394b('0x11')][_0x394b('0x13')]);return _0x30a414(_0x37645e[_0x394b('0x11')][_0x394b('0x13')]);}else{logger[_0x394b('0xd')](_0x394b('0x12'),_0x2cab17,'request\x20sent');_0x30a414(_0x37645e['result'][_0x394b('0x13')]);}})['catch'](function(_0x376fea){logger[_0x394b('0x11')](_0x394b('0x12'),_0x2cab17,_0x376fea);_0x2082f4(_0x376fea);});});}exports[_0x394b('0x14')]=function(_0x114833){var _0x540ef4=this;return new Promise(function(_0x3fb303,_0x527f01){return db[_0x394b('0x15')]['update'](_0x114833[_0x394b('0x16')],{'raw':_0x114833[_0x394b('0x17')]?_0x114833[_0x394b('0x17')][_0x394b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x114833[_0x394b('0x17')]?_0x114833[_0x394b('0x17')][_0x394b('0x19')]||null:null,'attributes':_0x114833['options']?_0x114833['options'][_0x394b('0x1a')]||null:null,'limit':_0x114833[_0x394b('0x17')]?_0x114833[_0x394b('0x17')]['limit']||null:null})[_0x394b('0xc')](function(_0x1baf2b){logger[_0x394b('0xd')](_0x394b('0x14'),_0x114833);logger[_0x394b('0xf')](_0x394b('0x14'),_0x114833,JSON[_0x394b('0x1b')](_0x1baf2b));_0x3fb303(_0x1baf2b);})[_0x394b('0x1c')](function(_0x32955c){logger['error']('UpdateMailApplication',_0x32955c[_0x394b('0x13')],_0x114833);_0x527f01(_0x540ef4['error'](0x1f4,_0x32955c[_0x394b('0x13')]));});});}; \ No newline at end of file +var _0xe63b=['catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result'];(function(_0x5f0f68,_0x4a4557){var _0x397ad1=function(_0x122a20){while(--_0x122a20){_0x5f0f68['push'](_0x5f0f68['shift']());}};_0x397ad1(++_0x4a4557);}(_0xe63b,0x10a));var _0xbe63=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0xe63b[_0x10791d];return _0x1b4f9c;};'use strict';var _=require(_0xbe63('0x0'));var util=require(_0xbe63('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe63('0x2'));var fs=require('fs');var Redis=require(_0xbe63('0x3'));var db=require(_0xbe63('0x4'))['db'];var utils=require(_0xbe63('0x5'));var logger=require(_0xbe63('0x6'))(_0xbe63('0x7'));var config=require(_0xbe63('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbe63('0x9')][_0xbe63('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a161b,_0x14b67a,_0x4e5c38){return new BPromise(function(_0xb51ae1,_0x58c640){return client[_0xbe63('0xb')](_0x1a161b,_0x4e5c38)[_0xbe63('0xc')](function(_0x47cf98){logger[_0xbe63('0xd')](_0xbe63('0xe'),_0x14b67a,'request\x20sent');logger[_0xbe63('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x14b67a,'request\x20sent',JSON[_0xbe63('0x10')](_0x47cf98));if(_0x47cf98[_0xbe63('0x11')]){if(_0x47cf98['error'][_0xbe63('0x12')]===0x1f4){logger[_0xbe63('0x11')](_0xbe63('0xe'),_0x14b67a,_0x47cf98['error'][_0xbe63('0x13')]);return _0x58c640(_0x47cf98[_0xbe63('0x11')][_0xbe63('0x13')]);}logger[_0xbe63('0x11')](_0xbe63('0xe'),_0x14b67a,_0x47cf98[_0xbe63('0x11')][_0xbe63('0x13')]);return _0xb51ae1(_0x47cf98[_0xbe63('0x11')][_0xbe63('0x13')]);}else{logger[_0xbe63('0xd')](_0xbe63('0xe'),_0x14b67a,_0xbe63('0x14'));_0xb51ae1(_0x47cf98[_0xbe63('0x15')][_0xbe63('0x13')]);}})[_0xbe63('0x16')](function(_0x1c1248){logger['error'](_0xbe63('0xe'),_0x14b67a,_0x1c1248);_0x58c640(_0x1c1248);});});}exports[_0xbe63('0x17')]=function(_0x328a1d){var _0x1f6d33=this;return new Promise(function(_0x4c5b9b,_0x5bfcc1){return db[_0xbe63('0x18')][_0xbe63('0x19')](_0x328a1d[_0xbe63('0x1a')],{'raw':_0x328a1d[_0xbe63('0x1b')]?_0x328a1d['options'][_0xbe63('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x328a1d[_0xbe63('0x1b')]?_0x328a1d['options'][_0xbe63('0x1d')]||null:null,'attributes':_0x328a1d[_0xbe63('0x1b')]?_0x328a1d['options'][_0xbe63('0x1e')]||null:null,'limit':_0x328a1d[_0xbe63('0x1b')]?_0x328a1d[_0xbe63('0x1b')][_0xbe63('0x1f')]||null:null})[_0xbe63('0xc')](function(_0x369a55){logger['info'](_0xbe63('0x17'),_0x328a1d);logger[_0xbe63('0xf')]('UpdateMailApplication',_0x328a1d,JSON[_0xbe63('0x10')](_0x369a55));_0x4c5b9b(_0x369a55);})[_0xbe63('0x16')](function(_0x58b9ca){logger[_0xbe63('0x11')]('UpdateMailApplication',_0x58b9ca[_0xbe63('0x13')],_0x328a1d);_0x5bfcc1(_0x1f6d33[_0xbe63('0x11')](0x1f4,_0x58b9ca[_0xbe63('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 3058c1c..be68d34 100644 --- a/server/api/mailInteraction/index.js +++ b/server/api/mailInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c48=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','put','tracked','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x55e235,_0x25c20b){var _0x4014c7=function(_0xd352fe){while(--_0xd352fe){_0x55e235['push'](_0x55e235['shift']());}};_0x4014c7(++_0x25c20b);}(_0x5c48,0x172));var _0x85c4=function(_0x12e1eb,_0xfe1d7d){_0x12e1eb=_0x12e1eb-0x0;var _0x5dad2e=_0x5c48[_0x12e1eb];return _0x5dad2e;};'use strict';var multer=require(_0x85c4('0x0'));var util=require(_0x85c4('0x1'));var path=require(_0x85c4('0x2'));var timeout=require(_0x85c4('0x3'));var express=require(_0x85c4('0x4'));var router=express[_0x85c4('0x5')]();var auth=require(_0x85c4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x85c4('0x7'));var controller=require('./mailInteraction.controller');router[_0x85c4('0x8')]('/',auth[_0x85c4('0x9')](),controller['index']);router[_0x85c4('0x8')](_0x85c4('0xa'),auth[_0x85c4('0x9')](),controller[_0x85c4('0xb')]);router[_0x85c4('0x8')](_0x85c4('0xc'),auth[_0x85c4('0x9')](),controller['show']);router['get'](_0x85c4('0xd'),auth[_0x85c4('0x9')](),controller[_0x85c4('0xe')]);router['get'](_0x85c4('0xf'),auth['isAuthenticated'](),controller[_0x85c4('0x10')]);router[_0x85c4('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x85c4('0x11')](_0x85c4('0xd'),auth[_0x85c4('0x9')](),controller[_0x85c4('0x12')]);router[_0x85c4('0x11')](_0x85c4('0x13'),auth['isAuthenticated'](),interaction['tracked']('mail','mailinteraction:addtags'),controller['addTags']);router[_0x85c4('0x14')](_0x85c4('0xc'),auth[_0x85c4('0x9')](),interaction[_0x85c4('0x15')](_0x85c4('0x16'),_0x85c4('0x17')),controller[_0x85c4('0x18')]);router[_0x85c4('0x19')](_0x85c4('0xc'),auth[_0x85c4('0x9')](),interaction['tracked'](_0x85c4('0x16'),_0x85c4('0x1a')),controller[_0x85c4('0x1b')]);router[_0x85c4('0x19')]('/:id/tags',auth[_0x85c4('0x9')](),controller[_0x85c4('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xb416=['./mailInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','getMessages','download','post','create','addMessage','mail','mailinteraction:addtags','put','/:id','mailinteraction:update','delete','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb416,0x173));var _0x6b41=function(_0x20a4f5,_0x4c8fbc){_0x20a4f5=_0x20a4f5-0x0;var _0x547c6a=_0xb416[_0x20a4f5];return _0x547c6a;};'use strict';var multer=require(_0x6b41('0x0'));var util=require(_0x6b41('0x1'));var path=require('path');var timeout=require(_0x6b41('0x2'));var express=require(_0x6b41('0x3'));var router=express[_0x6b41('0x4')]();var auth=require(_0x6b41('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b41('0x6'));var controller=require(_0x6b41('0x7'));router[_0x6b41('0x8')]('/',auth[_0x6b41('0x9')](),controller[_0x6b41('0xa')]);router[_0x6b41('0x8')]('/describe',auth[_0x6b41('0x9')](),controller[_0x6b41('0xb')]);router['get']('/:id',auth[_0x6b41('0x9')](),controller['show']);router[_0x6b41('0x8')](_0x6b41('0xc'),auth[_0x6b41('0x9')](),controller[_0x6b41('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x6b41('0xe')]);router[_0x6b41('0xf')]('/',auth[_0x6b41('0x9')](),controller[_0x6b41('0x10')]);router[_0x6b41('0xf')](_0x6b41('0xc'),auth[_0x6b41('0x9')](),controller[_0x6b41('0x11')]);router[_0x6b41('0xf')]('/:id/tags',auth[_0x6b41('0x9')](),interaction['tracked'](_0x6b41('0x12'),_0x6b41('0x13')),controller['addTags']);router[_0x6b41('0x14')](_0x6b41('0x15'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x6b41('0x16')),controller['update']);router['delete']('/:id',auth[_0x6b41('0x9')](),interaction['tracked'](_0x6b41('0x12'),'mailinteraction:destroy'),controller['destroy']);router[_0x6b41('0x17')](_0x6b41('0x18'),auth[_0x6b41('0x9')](),controller[_0x6b41('0x19')]);module[_0x6b41('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 6649194..f9a2e5d 100644 --- a/server/api/mailInteraction/mailInteraction.attributes.js +++ b/server/api/mailInteraction/mailInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4552=['out','sequelize','iconv','exports','STRING','TEXT','long','BOOLEAN','DATE','ENUM'];(function(_0x441e18,_0x2a4780){var _0x4adf21=function(_0xe35818){while(--_0xe35818){_0x441e18['push'](_0x441e18['shift']());}};_0x4adf21(++_0x2a4780);}(_0x4552,0xe7));var _0x2455=function(_0x1c5a61,_0x4e6f20){_0x1c5a61=_0x1c5a61-0x0;var _0x151af2=_0x4552[_0x1c5a61];return _0x151af2;};'use strict';var Sequelize=require(_0x2455('0x0'));var iconv=require(_0x2455('0x1'));module[_0x2455('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2455('0x3')]},'note':{'type':Sequelize[_0x2455('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x2455('0x3')]},'cc':{'type':Sequelize[_0x2455('0x4')](_0x2455('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x2455('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2455('0x7')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x2455('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x2455('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2455('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x2455('0x4')](_0x2455('0x5'))},'lastMsgText':{'type':Sequelize[_0x2455('0x4')]('long')}}; \ No newline at end of file +var _0xe7aa=['ENUM','TEXT','long','iconv','exports','BOOLEAN','DATE','STRING','out'];(function(_0x56d9ca,_0x285978){var _0x4c497d=function(_0x3e5ceb){while(--_0x3e5ceb){_0x56d9ca['push'](_0x56d9ca['shift']());}};_0x4c497d(++_0x285978);}(_0xe7aa,0x1f2));var _0xae7a=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xe7aa[_0x4bb66f];return _0xf2772f;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xae7a('0x0'));module[_0xae7a('0x1')]={'closed':{'type':Sequelize[_0xae7a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xae7a('0x3')]},'disposition':{'type':Sequelize[_0xae7a('0x4')]},'note':{'type':Sequelize[_0xae7a('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xae7a('0x4')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xae7a('0x3')]},'substatus':{'type':Sequelize[_0xae7a('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xae7a('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xae7a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xae7a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xae7a('0x6')]('in',_0xae7a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xae7a('0x7')]('long')},'lastMsgText':{'type':Sequelize[_0xae7a('0x7')](_0xae7a('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 9d80fd1..768e2e1 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6029=['Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','plainBody','keys','some','isEmpty','where','i.MailAccountId\x20IN\x20?','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','MailAccountId','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','fields','a.key','Account.key','a.mandatoryDisposition','i.id','i.createdAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','attachments','tmp','format','bcc','subject','Attachment','Attachments','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','basename','existsSync','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','count','offset','save','update','then','error','stack','Users','TagIds','Tags','push','MailInteraction','lastMsgBody','lastMsgText','trimStart','catch','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','nolimit','limit','order','sort','pick','select','field','color','from','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x6029,0x7a));var _0x9602=function(_0x194cbc,_0x5e28e7){_0x194cbc=_0x194cbc-0x0;var _0x2ff26a=_0x6029[_0x194cbc];return _0x2ff26a;};'use strict';var pdf=require(_0x9602('0x0'));var emlformat=require(_0x9602('0x1'));var rimraf=require(_0x9602('0x2'));var zipdir=require(_0x9602('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9602('0x4'));var moment=require(_0x9602('0x5'));var BPromise=require(_0x9602('0x6'));var Mustache=require(_0x9602('0x7'));var util=require('util');var path=require(_0x9602('0x8'));var sox=require('sox');var csv=require(_0x9602('0x9'));var ejs=require(_0x9602('0xa'));var fs=require('fs');var _=require(_0x9602('0xb'));var squel=require('squel');var crypto=require(_0x9602('0xc'));var jsforce=require(_0x9602('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9602('0xe'));var Papa=require(_0x9602('0xf'));var htmlToText=require(_0x9602('0x10'));var Redis=require(_0x9602('0x11'));var authService=require(_0x9602('0x12'));var qs=require(_0x9602('0x13'));var as=require(_0x9602('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9602('0x15'));var config=require('../../config/environment');var db=require(_0x9602('0x16'))['db'];config[_0x9602('0x17')]=_[_0x9602('0x18')](config['redis'],{'host':_0x9602('0x19'),'port':0x18eb});var socket=require(_0x9602('0x1a'))(new Redis(config[_0x9602('0x17')]));require(_0x9602('0x1b'))[_0x9602('0x1c')](socket);function respondWithStatusCode(_0x78415e,_0x309bd8){_0x309bd8=_0x309bd8||0xcc;return function(_0x209e76){if(_0x209e76){return _0x78415e['sendStatus'](_0x309bd8);}return _0x78415e[_0x9602('0x1d')](_0x309bd8)[_0x9602('0x1e')]();};}function respondWithResult(_0x37cd29,_0x433f89){_0x433f89=_0x433f89||0xc8;return function(_0xe39f3f){if(_0xe39f3f){return _0x37cd29['status'](_0x433f89)[_0x9602('0x1f')](_0xe39f3f);}};}function respondWithFilteredResult(_0x118421,_0x426bfc){return function(_0x20d17c){if(_0x20d17c){var _0x5de82e=_0x20d17c[_0x9602('0x20')],_0xaea038=_0x426bfc[_0x9602('0x21')],_0x3279e6=_0x426bfc[_0x9602('0x21')]+_0x426bfc['limit'],_0x3d0a7e;if(_0x3279e6>=_0x5de82e){_0x3279e6=_0x5de82e;_0x3d0a7e=0xc8;}else{_0x3d0a7e=0xce;}_0x118421['status'](_0x3d0a7e);return _0x118421['set']('Content-Range',_0xaea038+'-'+_0x3279e6+'/'+_0x5de82e)['json'](_0x20d17c);}return null;};}function patchUpdates(_0x46d72a){return function(_0xd3ed7a){try{jsonpatch['apply'](_0xd3ed7a,_0x46d72a,!![]);}catch(_0x18d855){return BPromise['reject'](_0x18d855);}return _0xd3ed7a[_0x9602('0x22')]();};}function saveUpdates(_0xa47e71,_0x44f489){return function(_0x908983){if(_0x908983){return _0x908983[_0x9602('0x23')](_0xa47e71)[_0x9602('0x24')](function(_0x874c9e){return _0x874c9e;});}return null;};}function removeEntity(_0x565104,_0x220f24){return function(_0x54a3af){if(_0x54a3af){return _0x54a3af['destroy']()['then'](function(){_0x565104[_0x9602('0x1d')](0xcc)[_0x9602('0x1e')]();});}};}function handleEntityNotFound(_0x45d78e,_0x3b57e5){return function(_0x54bbc5){if(!_0x54bbc5){_0x45d78e['sendStatus'](0x194);}return _0x54bbc5;};}function handleError(_0x35e61e,_0x1dc37f){_0x1dc37f=_0x1dc37f||0x1f4;return function(_0x14d385){logger[_0x9602('0x25')](_0x14d385[_0x9602('0x26')]);if(_0x14d385['name']){delete _0x14d385['name'];}_0x35e61e[_0x9602('0x1d')](_0x1dc37f)['send'](_0x14d385);};}function getInteractionUsers(_0x22c3e2,_0x13975d){return new BPromise(function(_0x4e8134,_0xd50947){try{if(_0x13975d[_0x22c3e2['id']]){_0x22c3e2[_0x9602('0x27')]=_['map'](_0x13975d[_0x22c3e2['id']],function(_0x3414e3){return{'id':_0x3414e3['id']};});}}catch(_0xf4db4b){_0xd50947(_0xf4db4b);}_0x4e8134(_0x22c3e2);});}function getInteractionTags(_0x421ad7,_0x4747a7){return new BPromise(function(_0x2b3da4,_0x2a0de2){try{if(_0x421ad7[_0x9602('0x28')]){_0x421ad7[_0x9602('0x29')]=[];_0x421ad7[_0x9602('0x28')]['split'](',')['forEach'](function(_0x233274){_0x421ad7[_0x9602('0x29')][_0x9602('0x2a')](_0x4747a7[_0x233274]);});}delete _0x421ad7[_0x9602('0x28')];}catch(_0x5e3598){_0x2a0de2(_0x5e3598);}_0x2b3da4(_0x421ad7);});}function getLastMessageText(_0x4de7fd){return new BPromise(function(_0x4a9c72,_0x1b5079){return db[_0x9602('0x2b')]['findOne']({'where':{'id':_0x4de7fd['id']},'attributes':[_0x9602('0x2c'),'lastMsgText'],'raw':!![]})[_0x9602('0x24')](function(_0x1f0870){if(!_0x1f0870['lastMsgText']){_0x4de7fd[_0x9602('0x2d')]=_[_0x9602('0x2e')](htmlToText['fromString'](_0x1f0870['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x4de7fd[_0x9602('0x2d')]=_0x1f0870[_0x9602('0x2d')];}_0x4a9c72(_0x4de7fd);})['catch'](function(_0x4e196a){_0x1b5079(_0x4e196a);});});}function updateMailInteraction(_0x4dd741,_0x1e55e1,_0xa51c31,_0x3d6239){return new BPromise(function(_0x297201,_0x266817){return getInteractionUsers(_0x4dd741,_0xa51c31)[_0x9602('0x24')](function(_0x3450ca){return getInteractionTags(_0x3450ca,_0x1e55e1);})[_0x9602('0x24')](function(_0x5c92c1){if(_0x3d6239){_0x297201(getLastMessageText(_0x5c92c1));}else{_0x297201(_0x5c92c1);}})[_0x9602('0x2f')](function(_0xb414fa){_0x266817(_0xb414fa);});});}exports[_0x9602('0x30')]=function(_0x2f84e0,_0x35a8df){var _0x2b3c49={},_0x4ac3a3={},_0x5648a0={'count':0x0,'rows':[]};var _0x265c19=_[_0x9602('0x31')](db[_0x9602('0x2b')][_0x9602('0x32')],function(_0xae6291){return{'name':_0xae6291[_0x9602('0x33')],'type':_0xae6291[_0x9602('0x34')][_0x9602('0x35')]};});_0x4ac3a3[_0x9602('0x36')]=_[_0x9602('0x31')](_0x265c19,_0x9602('0x37'));_0x4ac3a3[_0x9602('0x38')]=_['keys'](_0x2f84e0[_0x9602('0x38')]);_0x4ac3a3[_0x9602('0x39')]=_[_0x9602('0x3a')](_0x4ac3a3['model'],_0x4ac3a3['query']);_0x2b3c49['attributes']=_[_0x9602('0x3a')](_0x4ac3a3[_0x9602('0x36')],qs['fields'](_0x2f84e0['query']['fields']));_0x2b3c49['attributes']=_0x2b3c49[_0x9602('0x3b')]['length']?_0x2b3c49['attributes']:_0x4ac3a3['model'];if(!_0x2f84e0['query']['hasOwnProperty'](_0x9602('0x3c'))){_0x2b3c49['limit']=qs['limit'](_0x2f84e0[_0x9602('0x38')][_0x9602('0x3d')]);_0x2b3c49[_0x9602('0x21')]=qs[_0x9602('0x21')](_0x2f84e0[_0x9602('0x38')][_0x9602('0x21')]);}_0x2b3c49[_0x9602('0x3e')]=qs['sort'](_0x2f84e0[_0x9602('0x38')][_0x9602('0x3f')]);_0x2b3c49['where']=qs[_0x9602('0x39')](_[_0x9602('0x40')](_0x2f84e0[_0x9602('0x38')],_0x4ac3a3[_0x9602('0x39')]));var _0x139d08=[];var _0x173e3f=squel[_0x9602('0x41')]()[_0x9602('0x42')]('id')['field']('name')[_0x9602('0x42')](_0x9602('0x43'))[_0x9602('0x44')]('tools_tags');var _0x5e3f89=squel[_0x9602('0x41')]()[_0x9602('0x42')](_0x9602('0x45'))[_0x9602('0x42')](_0x9602('0x46'))[_0x9602('0x44')](_0x9602('0x47'),'ui')[_0x9602('0x48')](_0x9602('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x5e471c=squel[_0x9602('0x41')]()[_0x9602('0x44')]('mail_interactions','i')[_0x9602('0x48')](_0x9602('0x4a'),'c',_0x9602('0x4b'))[_0x9602('0x48')](_0x9602('0x49'),'o',_0x9602('0x4c'))[_0x9602('0x48')](_0x9602('0x4d'),'a',_0x9602('0x4e'))[_0x9602('0x48')](_0x9602('0x4f'),'me',_0x9602('0x50'))[_0x9602('0x48')](_0x9602('0x51'),'it','it.MailInteractionId\x20=\x20i.id')[_0x9602('0x48')](_0x9602('0x52'),'t',_0x9602('0x53'));var _0x37da65=squel['expr']();var _0x18270d=[];var _0x4f9694=squel[_0x9602('0x54')]();var _0xb567bc;if(_0x2f84e0[_0x9602('0x38')][_0x9602('0x55')]){_0xb567bc=as[_0x9602('0x56')](_0x2f84e0['query']['search']);var _0x5e8caf=_0xb567bc[_0x9602('0x57')];for(var _0x353c32=0x0;_0x353c32<_0xb567bc[_0x9602('0x58')][_0x9602('0x59')];_0x353c32++){var _0x2847dd=_0xb567bc[_0x9602('0x58')][_0x353c32];var _0x472ed5='i';var _0xda0dce=_[_0x9602('0x5a')](_0x265c19,[_0x9602('0x37'),_0x2847dd[_0x9602('0x42')]]);if(!_0xda0dce){switch(_0x2847dd[_0x9602('0x42')]){case _0x9602('0x5b'):if(_0x2847dd[_0x9602('0x5c')]==0x1){_0x5e471c[_0x9602('0x5d')]('`'+_0x2847dd['field']+'`\x20=\x200');}else{_0x5e471c[_0x9602('0x5d')]('`'+_0x2847dd[_0x9602('0x42')]+_0x9602('0x5e'));}break;case'Contact':if(_0x2847dd[_0x9602('0x5f')]===_0x9602('0x60')){if(_0x2847dd[_0x9602('0x5c')][_0x9602('0x61')]('\x20')[_0x9602('0x59')]>0x1){_0x37da65[_0x5e8caf]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9602('0x62')](_0x2847dd[_0x9602('0x5c')]),null);}else{var _0x82541b='%'+_0x2847dd[_0x9602('0x5c')]+'%';_0x37da65[_0x5e8caf](_0x9602('0x63'),_0x82541b,_0x82541b,_0x82541b);}}else{_0xda0dce=_[_0x9602('0x5a')](_0x265c19,['name',_0x9602('0x64')]);_0x2847dd[_0x9602('0x42')]=_0x9602('0x64');_0xc92913=as[_0x9602('0x65')](_0x472ed5,_0xda0dce[_0x9602('0x34')],_0x2847dd);_0x37da65[_0x5e8caf](_0xc92913['text'],_0xc92913[_0x9602('0x5c')][_0x9602('0x66')],_0xc92913[_0x9602('0x5c')]['end']);}break;case _0x9602('0x67'):var _0x3fb318=_0x2847dd[_0x9602('0x5c')][_0x9602('0x61')](',')[_0x9602('0x31')](function(_0x1e36ff){return Number(_0x1e36ff);});_0x3fb318[_0x9602('0x68')](function(_0x52374c){_0x4f9694['or'](_0x9602('0x69'),'%,'+_0x52374c+',%');});_0x18270d=_[_0x9602('0x6a')](_0x18270d,_0x3fb318);break;case _0x9602('0x6b'):if(_0x2847dd[_0x9602('0x5f')]===_0x9602('0x60')){_0x37da65[_0x5e8caf](_0x9602('0x6c'),'%'+_0x2847dd[_0x9602('0x5c')]+'%',null);}else{_0xda0dce=_[_0x9602('0x5a')](_0x265c19,[_0x9602('0x37'),_0x9602('0x6d')]);_0x2847dd[_0x9602('0x42')]=_0x9602('0x6d');_0xc92913=as[_0x9602('0x65')](_0x472ed5,_0xda0dce['type'],_0x2847dd);_0x37da65[_0x5e8caf](_0xc92913[_0x9602('0x6e')],_0xc92913[_0x9602('0x5c')]['start'],_0xc92913[_0x9602('0x5c')]['end']);}break;case _0x9602('0x6f'):_0xc92913=as[_0x9602('0x65')]('me',null,_0x2847dd);_0x37da65[_0x5e8caf](_0xc92913[_0x9602('0x6e')],_0xc92913['value'][_0x9602('0x66')],_0xc92913[_0x9602('0x5c')][_0x9602('0x1e')]);break;}}else{var _0xc92913=as['buildExpression'](_0x472ed5,_0xda0dce[_0x9602('0x34')],_0x2847dd);_0x37da65[_0x5e8caf](_0xc92913[_0x9602('0x6e')],_0xc92913[_0x9602('0x5c')][_0x9602('0x66')],_0xc92913[_0x9602('0x5c')][_0x9602('0x1e')]);}}}else{var _0x5544d4=_(_0x2f84e0[_0x9602('0x38')])[_0x9602('0x70')]()[_0x9602('0x31')](function(_0x41d456){return _[_0x9602('0x71')](_0x265c19,['name',_0x41d456])?_0x41d456:undefined;})['compact']()[_0x9602('0x5c')]();if(!_[_0x9602('0x72')](_0x5544d4)){_0x5544d4[_0x9602('0x68')](function(_0x5b21b2){if(_0x5b21b2==='MailAccountId'){_0x5e471c[_0x9602('0x73')](_0x9602('0x74'),[]['concat'](_0x2f84e0[_0x9602('0x38')][_0x5b21b2]));}else if(_0x5b21b2===_0x9602('0x75')){var _0x767620=JSON[_0x9602('0x76')](_0x2f84e0[_0x9602('0x38')][_0x5b21b2])['$gte'];var _0x2615ef=JSON[_0x9602('0x76')](_0x2f84e0['query'][_0x5b21b2])['$lte'];_0x5e471c[_0x9602('0x73')](_0x9602('0x77'),_0x767620,_0x2615ef);}else{if(_0x2f84e0['query'][_0x5b21b2]===_0x9602('0x78')){_0x5e471c[_0x9602('0x73')]('i.'+_0x5b21b2+_0x9602('0x79'));}else{_0x5e471c[_0x9602('0x73')]('i.'+_0x5b21b2+'\x20=\x20?',_0x2f84e0['query'][_0x5b21b2]);}}});}if(_0x2f84e0[_0x9602('0x38')]['read']){if(_0x2f84e0[_0x9602('0x38')]['read']==0x1){_0x5e471c['having'](_0x9602('0x7a'));}else{_0x5e471c[_0x9602('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0x2f84e0[_0x9602('0x38')][_0x9602('0x7b')]){_0x18270d=_[_0x9602('0x7c')](_0x2f84e0[_0x9602('0x38')]['tag'])?_0x2f84e0['query']['tag']:new Array(_0x2f84e0[_0x9602('0x38')][_0x9602('0x7b')]);_0x18270d[_0x9602('0x68')](function(_0x2f8695){_0x4f9694['or'](_0x9602('0x69'),'%,'+_0x2f8695+',%');});}if(_0x2f84e0['query']['filter']){var _0x5542c3=_0x2f84e0[_0x9602('0x38')][_0x9602('0x7d')][_0x9602('0x7e')]('\x5c','\x5c\x5c')[_0x9602('0x7e')]('\x27\x27',_0x9602('0x7f'));if(qs[_0x9602('0x80')](_0x5542c3)){_0x37da65['or'](_0x9602('0x81'),_0x5542c3+'%');}else if(qs['isEmail'](_0x5542c3)){_0x37da65['or'](_0x9602('0x82'),_0x5542c3+'%');}else{_0x37da65['or'](_0x9602('0x83'),qs[_0x9602('0x62')](_0x5542c3))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9602('0x62')](_0x5542c3));}}}_0x5e471c[_0x9602('0x73')](_0x37da65);_0x5e471c[_0x9602('0x84')]('i.id');var _0x2151d9={'type':db[_0x9602('0x85')][_0x9602('0x86')][_0x9602('0x87')],'raw':!![]};var _0x277e42=_0x5e471c[_0x9602('0x88')]();_0x277e42[_0x9602('0x42')]('i.id');_0x277e42[_0x9602('0x42')](_0x9602('0x89'),_0x9602('0x5b'));if(_0x2b3c49[_0x9602('0x3e')]){_0x2b3c49[_0x9602('0x3e')][_0x9602('0x68')](function(_0x174d4e){_0x5e471c[_0x9602('0x3e')]('i.'+_0x174d4e[0x0],_0x174d4e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9602('0x72')](_0x18270d)){_0x5e471c['having'](_0x4f9694);_0x277e42['where'](_0x9602('0x8a'),_0x18270d);}BPromise[_0x9602('0x8b')]()[_0x9602('0x24')](function(){if(!_0xb567bc&&_0x2f84e0['query'][_0x9602('0x8c')])return;return _0x2f84e0[_0x9602('0x8d')][_0x9602('0x8e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3347ff){if(_[_0x9602('0x72')](_0x3347ff)){_0x277e42[_0x9602('0x73')](_0x9602('0x8f'));_0x5e471c[_0x9602('0x73')]('i.MailAccountId\x20IS\x20NULL');}else{_0x277e42['where'](_0x9602('0x74'),_[_0x9602('0x31')](_0x3347ff,'id'));_0x5e471c[_0x9602('0x73')]('i.MailAccountId\x20IN\x20?',_[_0x9602('0x31')](_0x3347ff,'id'));}});})['then'](function(){db[_0x9602('0x90')]['query'](_0x277e42[_0x9602('0x91')](),_0x2151d9)[_0x9602('0x24')](function(_0x27dad4){_0x5648a0[_0x9602('0x20')]=_0x27dad4[_0x9602('0x59')];if(_0x5648a0[_0x9602('0x20')]===0x0)return[];return db[_0x9602('0x90')][_0x9602('0x38')](_0x173e3f[_0x9602('0x91')](),_0x2151d9)[_0x9602('0x24')](function(_0x186e30){_0x139d08=_['keyBy'](_0x186e30,'id');_0x2151d9=_[_0x9602('0x92')](_0x2151d9,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f84e0[_0x9602('0x38')][_0x9602('0x93')]){_0x2b3c49[_0x9602('0x3b')]['forEach'](function(_0x5afac4){_0x5e471c[_0x9602('0x42')]('i.'+_0x5afac4);});}else{_0x5e471c[_0x9602('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x5e471c['field'](_0x9602('0x94'),_0x9602('0x95'));_0x5e471c[_0x9602('0x42')](_0x9602('0x96'),'Account.mandatoryDisposition');_0x5e471c[_0x9602('0x42')](_0x9602('0x97'));_0x5e471c['field'](_0x9602('0x98'));_0x5e471c['field']('i.updatedAt');_0x5e471c[_0x9602('0x42')](_0x9602('0x99'));_0x5e471c['field'](_0x9602('0x9a'));_0x5e471c[_0x9602('0x42')]('i.attach');_0x5e471c[_0x9602('0x42')](_0x9602('0x9b'));_0x5e471c[_0x9602('0x42')](_0x9602('0x9c'));_0x5e471c['field']('i.subject');_0x5e471c[_0x9602('0x42')]('i.disposition');_0x5e471c[_0x9602('0x42')](_0x9602('0x9d'));_0x5e471c['field'](_0x9602('0x9e'));_0x5e471c[_0x9602('0x42')](_0x9602('0x9f'));_0x5e471c[_0x9602('0x42')](_0x9602('0xa0'));_0x5e471c[_0x9602('0x42')](_0x9602('0xa1'));_0x5e471c[_0x9602('0x42')]('c.firstName',_0x9602('0xa2'));_0x5e471c[_0x9602('0x42')](_0x9602('0xa3'),'Contact.lastName');_0x5e471c[_0x9602('0x42')](_0x9602('0xa4'),'Contact.email');_0x5e471c[_0x9602('0x42')](_0x9602('0xa5'),'Contact.phone');_0x5e471c[_0x9602('0x42')](_0x9602('0xa6'),_0x9602('0xa7'));_0x5e471c[_0x9602('0x42')](_0x9602('0xa8'),'Contact.fax');_0x5e471c[_0x9602('0x42')](_0x9602('0xa9'),_0x9602('0x28'));}_0x5e471c[_0x9602('0x3d')](_0x2b3c49[_0x9602('0x3d')]);_0x5e471c['offset'](_0x2b3c49[_0x9602('0x21')]);return db['sequelize']['query'](_0x5e471c[_0x9602('0x91')](),_0x2151d9);})['then'](function(_0x2ef976){_0x5e3f89[_0x9602('0x73')](_0x9602('0xaa'),_['map'](_0x2ef976,'id'));return db[_0x9602('0x90')]['query'](_0x5e3f89['toString'](),_0x2151d9)[_0x9602('0x24')](function(_0x5e2eac){var _0x5a6b90=_[_0x9602('0xab')](_0x5e2eac,_0x9602('0xac'));var _0x3ade26=[];return db[_0x9602('0xad')]['findOne']({'attributes':[_0x9602('0xae')],'raw':!![]})[_0x9602('0x24')](function(_0x3bb438){var _0x3b830e=_0x3bb438[_0x9602('0xae')];_0x2ef976[_0x9602('0x68')](function(_0x266124){_0x3ade26['push'](updateMailInteraction(_0x266124,_0x139d08,_0x5a6b90,_0x3b830e));});return BPromise[_0x9602('0xaf')](_0x3ade26);});});});})[_0x9602('0x24')](function(_0x2d1489){_0x5648a0[_0x9602('0xb0')]=_0x2d1489;return _0x5648a0;})['then'](respondWithFilteredResult(_0x35a8df,_0x2b3c49));})[_0x9602('0x2f')](handleError(_0x35a8df,null));};exports[_0x9602('0xb1')]=function(_0x81abe9,_0x5714fb){var _0x3d04e5={'raw':![],'where':{'id':_0x81abe9[_0x9602('0xb2')]['id']}},_0x197537={};_0x197537['model']=_[_0x9602('0x70')](db[_0x9602('0x2b')][_0x9602('0x32')]);_0x197537[_0x9602('0x38')]=_[_0x9602('0x70')](_0x81abe9[_0x9602('0x38')]);_0x197537[_0x9602('0x39')]=_[_0x9602('0x3a')](_0x197537[_0x9602('0x36')],_0x197537[_0x9602('0x38')]);_0x3d04e5[_0x9602('0x3b')]=_['intersection'](_0x197537['model'],qs[_0x9602('0x93')](_0x81abe9[_0x9602('0x38')][_0x9602('0x93')]));_0x3d04e5['attributes']=_0x3d04e5['attributes'][_0x9602('0x59')]?_0x3d04e5[_0x9602('0x3b')]:_0x197537[_0x9602('0x36')];if(_0x81abe9['query'][_0x9602('0xb3')]){_0x3d04e5[_0x9602('0xb4')]=[{'all':!![]}];}_0x3d04e5=_[_0x9602('0x92')]({},_0x3d04e5,_0x81abe9[_0x9602('0xb5')]);return db['MailInteraction'][_0x9602('0x5a')](_0x3d04e5)[_0x9602('0x24')](handleEntityNotFound(_0x5714fb,null))['then'](respondWithResult(_0x5714fb,null))[_0x9602('0x2f')](handleError(_0x5714fb,null));};exports[_0x9602('0xb6')]=function(_0x353b2e,_0x5ccea9){return db[_0x9602('0x2b')][_0x9602('0xb6')](_0x353b2e[_0x9602('0xb7')],{})['then'](respondWithResult(_0x5ccea9,0xc9))[_0x9602('0x2f')](handleError(_0x5ccea9,null));};exports[_0x9602('0x23')]=function(_0x510fe7,_0x3cc4d0){if(_0x510fe7[_0x9602('0xb7')]['id']){delete _0x510fe7[_0x9602('0xb7')]['id'];}return db['MailInteraction'][_0x9602('0x5a')]({'where':{'id':_0x510fe7[_0x9602('0xb2')]['id']}})[_0x9602('0x24')](handleEntityNotFound(_0x3cc4d0,null))[_0x9602('0x24')](saveUpdates(_0x510fe7['body'],null))[_0x9602('0x24')](respondWithResult(_0x3cc4d0,null))['catch'](handleError(_0x3cc4d0,null));};exports[_0x9602('0xb8')]=function(_0xaf4c24,_0x198aed){return db[_0x9602('0x2b')][_0x9602('0x5a')]({'where':{'id':_0xaf4c24[_0x9602('0xb2')]['id']}})[_0x9602('0x24')](handleEntityNotFound(_0x198aed,null))[_0x9602('0x24')](removeEntity(_0x198aed,null))[_0x9602('0x2f')](handleError(_0x198aed,null));};exports[_0x9602('0xb9')]=function(_0x564a92,_0x44f49e){return db['MailInteraction']['describe']()['then'](respondWithResult(_0x44f49e,null))[_0x9602('0x2f')](handleError(_0x44f49e,null));};exports[_0x9602('0xba')]=function(_0x769dd3,_0x45712f,_0x51acb7){return db[_0x9602('0xbb')]['find']({'where':{'id':_0x769dd3['params']['id']}})[_0x9602('0x24')](handleEntityNotFound(_0x45712f,null))[_0x9602('0x24')](function(_0x5dfcd6){if(_0x5dfcd6){return _0x5dfcd6[_0x9602('0xba')](_0x769dd3['body'][_0x9602('0xbc')],_[_0x9602('0xbd')](_0x769dd3[_0x9602('0xb7')],['ids','id'])||{});}})[_0x9602('0x24')](respondWithResult(_0x45712f,null))['catch'](handleError(_0x45712f,null));};exports[_0x9602('0xbe')]=function(_0x5d4d78,_0x4cf21e,_0x470cc2){var _0x114352={'raw':![],'where':{}};var _0x4a0778={};var _0x27f553={'count':0x0,'rows':[]};return db[_0x9602('0x2b')][_0x9602('0xbf')]({'where':{'id':_0x5d4d78[_0x9602('0xb2')]['id']}})[_0x9602('0x24')](handleEntityNotFound(_0x4cf21e,null))[_0x9602('0x24')](function(_0xe715c9){if(_0xe715c9){_0x4a0778[_0x9602('0x36')]=_[_0x9602('0x70')](db[_0x9602('0xbb')][_0x9602('0x32')]);_0x4a0778[_0x9602('0x38')]=_['keys'](_0x5d4d78[_0x9602('0x38')]);_0x4a0778[_0x9602('0x39')]=_[_0x9602('0x3a')](_0x4a0778[_0x9602('0x36')],_0x4a0778[_0x9602('0x38')]);_0x114352['attributes']=_[_0x9602('0x3a')](_0x4a0778[_0x9602('0x36')],qs[_0x9602('0x93')](_0x5d4d78[_0x9602('0x38')][_0x9602('0x93')]));_0x114352['attributes']=_0x114352[_0x9602('0x3b')][_0x9602('0x59')]?_0x114352['attributes']:_0x4a0778[_0x9602('0x36')];if(!_0x5d4d78[_0x9602('0x38')][_0x9602('0xc0')]('nolimit')){_0x114352[_0x9602('0x3d')]=qs['limit'](_0x5d4d78[_0x9602('0x38')]['limit']);_0x114352[_0x9602('0x21')]=qs[_0x9602('0x21')](_0x5d4d78[_0x9602('0x38')][_0x9602('0x21')]);}_0x114352[_0x9602('0x3e')]=qs['sort'](_0x5d4d78[_0x9602('0x38')][_0x9602('0x3f')]);_0x114352['where']=qs['filters'](_[_0x9602('0x40')](_0x5d4d78['query'],_0x4a0778[_0x9602('0x39')]));_0x114352[_0x9602('0x73')][_0x9602('0xac')]=_0xe715c9['id'];if(_0x5d4d78[_0x9602('0x38')][_0x9602('0x7d')]){_0x114352['where']=_['merge'](_0x114352[_0x9602('0x73')],{'$or':_[_0x9602('0x31')](_0x114352[_0x9602('0x3b')],function(_0x29d004){var _0xc9c696={};_0xc9c696[_0x29d004]={'$like':'%'+_0x5d4d78[_0x9602('0x38')]['filter']+'%'};return _0xc9c696;})});}if(_0x5d4d78[_0x9602('0x38')][_0x9602('0xc1')]){var _0x324c42=_0x5d4d78[_0x9602('0x38')][_0x9602('0xc1')][_0x9602('0x61')](',');var _0xcc27f3={};_0xcc27f3[_0x324c42[0x0]]={'$gte':moment(_0x324c42[0x1])['format'](_0x9602('0xc2'))};_0x114352['where']=_[_0x9602('0x92')](_0x114352[_0x9602('0x73')],_0xcc27f3);}_0x114352=_[_0x9602('0x92')]({},_0x114352,_0x5d4d78[_0x9602('0xb5')]);return db[_0x9602('0xbb')][_0x9602('0x20')]({'where':_0x114352[_0x9602('0x73')]})['then'](function(_0xbd92c){_0x27f553[_0x9602('0x20')]=_0xbd92c;if(_0x5d4d78[_0x9602('0x38')][_0x9602('0xb3')]){_0x114352[_0x9602('0xb4')]=[{'all':!![]}];}return db[_0x9602('0xbb')][_0x9602('0xc3')](_0x114352);})[_0x9602('0x24')](function(_0x332e91){_0x27f553[_0x9602('0xb0')]=_0x332e91;return _0x27f553;});}})[_0x9602('0x24')](respondWithFilteredResult(_0x4cf21e,_0x114352))[_0x9602('0x2f')](handleError(_0x4cf21e,null));};exports[_0x9602('0xc4')]=function(_0x58a765,_0x31351d,_0x1b3d03){return db[_0x9602('0x2b')]['find']({'where':{'id':_0x58a765[_0x9602('0xb2')]['id']}})[_0x9602('0x24')](handleEntityNotFound(_0x31351d,null))['then'](function(_0x412512){if(_0x412512){return _0x412512['setTags'](_0x58a765['body'][_0x9602('0xbc')],_[_0x9602('0xbd')](_0x58a765['body'],[_0x9602('0xbc'),'id'])||{})[_0x9602('0xc5')](function(){return db[_0x9602('0x67')][_0x9602('0xc3')]({'attributes':['id',_0x9602('0x37'),_0x9602('0x43')],'where':{'id':_0x58a765[_0x9602('0xb7')][_0x9602('0xbc')]}});})[_0x9602('0x24')](function(_0x153c16){socket[_0x9602('0xc6')](_0x9602('0xc7'),{'id':Number(_0x58a765[_0x9602('0xb2')]['id']),'tags':_0x153c16||[]});return{'id':Number(_0x58a765[_0x9602('0xb2')]['id']),'tags':_0x153c16||[]};});}})[_0x9602('0x24')](respondWithResult(_0x31351d,null))['catch'](handleError(_0x31351d,null));};exports[_0x9602('0xc8')]=function(_0x1fee0c,_0x3979ce,_0x164b75){return db[_0x9602('0x2b')][_0x9602('0x5a')]({'where':{'id':_0x1fee0c[_0x9602('0xb2')]['id']}})[_0x9602('0x24')](handleEntityNotFound(_0x3979ce,null))[_0x9602('0x24')](function(_0x3d432e){if(_0x3d432e){return _0x3d432e[_0x9602('0xc8')](_0x1fee0c[_0x9602('0x38')]['ids']);}})[_0x9602('0x24')](respondWithStatusCode(_0x3979ce,null))[_0x9602('0x2f')](handleError(_0x3979ce,null));};exports[_0x9602('0xc9')]=function(_0x24aa09,_0xac24a8){var _0xa44de5=moment()[_0x9602('0xca')]()[_0x9602('0x91')]();var _0x42333c=path[_0x9602('0xcb')](config[_0x9602('0xcc')],'server',_0x9602('0xcd'),_0x9602('0xce'));var _0x18deab=path[_0x9602('0xcb')](config[_0x9602('0xcc')],'server',_0x9602('0xcd'),_0x9602('0xcf'));var _0x3dd306=path['join'](_0x18deab,_0xa44de5);var _0x2502e8=util[_0x9602('0xd0')]('interaction-%s.zip',_0xa44de5);var _0x401f58=path['join'](_0x18deab,_0x2502e8);var _0x5b8173=![];return db[_0x9602('0x2b')][_0x9602('0x5a')]({'where':{'id':_0x24aa09['params']['id']}})[_0x9602('0x24')](handleEntityNotFound(_0xac24a8,null))[_0x9602('0x24')](function(_0x487446){if(_0x487446){return _0x487446[_0x9602('0xbe')]({'attributes':['id','body',_0x9602('0x44'),'to','cc',_0x9602('0xd1'),_0x9602('0xd2'),_0x9602('0x75')],'where':{'secret':![]},'include':_0x24aa09[_0x9602('0x38')][_0x9602('0xce')]?[{'model':db[_0x9602('0xd3')],'as':_0x9602('0xd4')}]:undefined,'order':qs[_0x9602('0x3f')]('id')});}return[];})['then'](function(_0xf2fafd){_0x5b8173=_0xf2fafd[_0x9602('0x59')];if(_0xf2fafd[_0x9602('0x59')]){fs[_0x9602('0xd5')](_0x3dd306);return BPromise[_0x9602('0xd6')](_0xf2fafd,function(_0x331335,_0x5017b3){var _0x52912a=_0x331335;var _0x244226={'from':_0x52912a[_0x9602('0x44')],'to':_0x52912a['to'],'subject':_0x52912a[_0x9602('0xd2')],'html':_0x52912a[_0x9602('0xb7')],'headers':{'Date':moment(_0x52912a[_0x9602('0x75')])['format'](_0x9602('0xd7'))},'attachments':[]};if(_0x331335['cc']){_0x244226['headers']['Cc']=_0x331335['cc'];}if(_0x331335[_0x9602('0xd1')]){_0x244226['headers'][_0x9602('0xd8')]=_0x331335[_0x9602('0xd1')];}return new BPromise(function(_0x39c3a0,_0x2d7f22){if(_0x331335[_0x9602('0xd4')]){for(var _0x19f421=0x0;_0x19f421<_0x331335[_0x9602('0xd4')]['length'];_0x19f421++){var _0x1f302a=_0x331335['Attachments'][_0x19f421];var _0x395b91=path[_0x9602('0xcb')](_0x42333c,_0x1f302a[_0x9602('0xd9')]);if(fs[_0x9602('0xda')](_0x395b91)){_0x244226[_0x9602('0xce')][_0x9602('0x2a')]({'name':_0x1f302a[_0x9602('0x37')],'contentType':_0x1f302a['type'],'data':fs[_0x9602('0xdb')](_0x395b91)});}}}emlformat[_0x9602('0xdc')](_0x244226,function(_0x4b9447,_0x240d94){if(_0x4b9447)return _0x2d7f22(_0x4b9447);fs[_0x9602('0xdd')](path['join'](_0x3dd306,util[_0x9602('0xd0')]('message%d.eml',_0x5017b3)),_0x240d94);return _0x39c3a0(_0x240d94);});});});}})[_0x9602('0x24')](function(){if(_0x5b8173){return new BPromise(function(_0x546765,_0x340984){zipdir(_0x3dd306,{'saveTo':_0x401f58},function(_0xd0f41c,_0x4b66d0){if(_0xd0f41c)return _0x340984(_0xd0f41c);return _0x546765(_0x4b66d0);});});}})[_0x9602('0x24')](function(){if(_0x5b8173){return new BPromise(function(_0x56e20f,_0x4b7597){rimraf(_0x3dd306,function(_0x1f9092){if(_0x1f9092)_0x4b7597(_0x1f9092);return _0x56e20f();});});}})[_0x9602('0x24')](function(){if(_0x5b8173){return _0xac24a8[_0x9602('0xc9')](_0x401f58,_0x2502e8,function(_0x3929d0){if(_0x3929d0){console[_0x9602('0xde')](_0x9602('0xdf'),_0x3929d0);}else{fs[_0x9602('0xe0')](_0x401f58);}});}else{return _0xac24a8['sendStatus'](0xc8);}})[_0x9602('0x2f')](handleError(_0xac24a8,null));}; \ No newline at end of file +var _0x9c7f=['getMessages','MailInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','mailInteractionTags:save','removeTags','download','unix','join','server','files','root','tmp','interaction-%s.zip','subject','createdAt','Attachment','Attachments','mkdirSync','each','headers','Bcc','bcc','basename','existsSync','attachments','build','writeFileSync','message%d.eml','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./mailInteraction.socket','register','status','end','json','count','offset','limit','set','apply','reject','update','destroy','then','sendStatus','name','Users','TagIds','Tags','split','forEach','push','MailInteraction','findOne','lastMsgBody','trimStart','fromString','lastMsgText','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','length','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','plainBody','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','resolve','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','rows','catch','show','includeAll','include','options','body','params','describe','addMessage','MailMessage','ids','omit'];(function(_0x218dab,_0x274c74){var _0x57937e=function(_0x2d7993){while(--_0x2d7993){_0x218dab['push'](_0x218dab['shift']());}};_0x57937e(++_0x274c74);}(_0x9c7f,0x109));var _0xf9c7=function(_0x17dd51,_0x2d09c6){_0x17dd51=_0x17dd51-0x0;var _0x462eb0=_0x9c7f[_0x17dd51];return _0x462eb0;};'use strict';var pdf=require(_0xf9c7('0x0'));var emlformat=require(_0xf9c7('0x1'));var rimraf=require(_0xf9c7('0x2'));var zipdir=require(_0xf9c7('0x3'));var jsonpatch=require(_0xf9c7('0x4'));var rp=require(_0xf9c7('0x5'));var moment=require(_0xf9c7('0x6'));var BPromise=require(_0xf9c7('0x7'));var Mustache=require(_0xf9c7('0x8'));var util=require(_0xf9c7('0x9'));var path=require(_0xf9c7('0xa'));var sox=require(_0xf9c7('0xb'));var csv=require('to-csv');var ejs=require(_0xf9c7('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf9c7('0xd'));var crypto=require('crypto');var jsforce=require(_0xf9c7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf9c7('0xf'));var querystring=require(_0xf9c7('0x10'));var Papa=require(_0xf9c7('0x11'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf9c7('0x12'));var as=require(_0xf9c7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9c7('0x14'))(_0xf9c7('0x15'));var utils=require(_0xf9c7('0x16'));var config=require('../../config/environment');var db=require(_0xf9c7('0x17'))['db'];config['redis']=_['defaults'](config[_0xf9c7('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf9c7('0x19'))(new Redis(config[_0xf9c7('0x18')]));require(_0xf9c7('0x1a'))[_0xf9c7('0x1b')](socket);function respondWithStatusCode(_0x34f094,_0x41b0e9){_0x41b0e9=_0x41b0e9||0xcc;return function(_0x51237c){if(_0x51237c){return _0x34f094['sendStatus'](_0x41b0e9);}return _0x34f094[_0xf9c7('0x1c')](_0x41b0e9)[_0xf9c7('0x1d')]();};}function respondWithResult(_0x22954e,_0x11da81){_0x11da81=_0x11da81||0xc8;return function(_0x240bcb){if(_0x240bcb){return _0x22954e['status'](_0x11da81)[_0xf9c7('0x1e')](_0x240bcb);}};}function respondWithFilteredResult(_0x216ec1,_0x463d03){return function(_0x1a0ea7){if(_0x1a0ea7){var _0x2a63d1=_0x1a0ea7[_0xf9c7('0x1f')],_0x269bd6=_0x463d03[_0xf9c7('0x20')],_0x427a00=_0x463d03[_0xf9c7('0x20')]+_0x463d03[_0xf9c7('0x21')],_0x4dc03d;if(_0x427a00>=_0x2a63d1){_0x427a00=_0x2a63d1;_0x4dc03d=0xc8;}else{_0x4dc03d=0xce;}_0x216ec1['status'](_0x4dc03d);return _0x216ec1[_0xf9c7('0x22')]('Content-Range',_0x269bd6+'-'+_0x427a00+'/'+_0x2a63d1)[_0xf9c7('0x1e')](_0x1a0ea7);}return null;};}function patchUpdates(_0x3ac80c){return function(_0xd4a079){try{jsonpatch[_0xf9c7('0x23')](_0xd4a079,_0x3ac80c,!![]);}catch(_0x175afd){return BPromise[_0xf9c7('0x24')](_0x175afd);}return _0xd4a079['save']();};}function saveUpdates(_0x2a89bf,_0xed29f2){return function(_0x4b6f5e){if(_0x4b6f5e){return _0x4b6f5e[_0xf9c7('0x25')](_0x2a89bf)['then'](function(_0x360dda){return _0x360dda;});}return null;};}function removeEntity(_0x3a6899,_0x482712){return function(_0x30404d){if(_0x30404d){return _0x30404d[_0xf9c7('0x26')]()[_0xf9c7('0x27')](function(){_0x3a6899[_0xf9c7('0x1c')](0xcc)[_0xf9c7('0x1d')]();});}};}function handleEntityNotFound(_0x29b0a0,_0x19d6be){return function(_0x39b9a8){if(!_0x39b9a8){_0x29b0a0[_0xf9c7('0x28')](0x194);}return _0x39b9a8;};}function handleError(_0x5e3568,_0x20ca35){_0x20ca35=_0x20ca35||0x1f4;return function(_0x490c8d){logger['error'](_0x490c8d['stack']);if(_0x490c8d[_0xf9c7('0x29')]){delete _0x490c8d['name'];}_0x5e3568['status'](_0x20ca35)['send'](_0x490c8d);};}function getInteractionUsers(_0xb75fea,_0x4c663b){return new BPromise(function(_0x1f0f95,_0x118385){try{if(_0x4c663b[_0xb75fea['id']]){_0xb75fea[_0xf9c7('0x2a')]=_['map'](_0x4c663b[_0xb75fea['id']],function(_0x372989){return{'id':_0x372989['id']};});}}catch(_0x542353){_0x118385(_0x542353);}_0x1f0f95(_0xb75fea);});}function getInteractionTags(_0x717d0f,_0x2b2460){return new BPromise(function(_0x53d035,_0xbba307){try{if(_0x717d0f[_0xf9c7('0x2b')]){_0x717d0f[_0xf9c7('0x2c')]=[];_0x717d0f['TagIds'][_0xf9c7('0x2d')](',')[_0xf9c7('0x2e')](function(_0x30ba82){_0x717d0f[_0xf9c7('0x2c')][_0xf9c7('0x2f')](_0x2b2460[_0x30ba82]);});}delete _0x717d0f[_0xf9c7('0x2b')];}catch(_0x55389e){_0xbba307(_0x55389e);}_0x53d035(_0x717d0f);});}function getLastMessageText(_0x2089a0){return new BPromise(function(_0x2fe688,_0x5f2bdf){return db[_0xf9c7('0x30')][_0xf9c7('0x31')]({'where':{'id':_0x2089a0['id']},'attributes':[_0xf9c7('0x32'),'lastMsgText'],'raw':!![]})[_0xf9c7('0x27')](function(_0x37e6f0){if(!_0x37e6f0['lastMsgText']){_0x2089a0['lastMsgText']=_[_0xf9c7('0x33')](htmlToText[_0xf9c7('0x34')](_0x37e6f0[_0xf9c7('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2089a0[_0xf9c7('0x35')]=_0x37e6f0[_0xf9c7('0x35')];}_0x2fe688(_0x2089a0);})['catch'](function(_0x21907f){_0x5f2bdf(_0x21907f);});});}function updateMailInteraction(_0x11b1d5,_0x49e1e7,_0x261f8c,_0x1a5615){return new BPromise(function(_0x225fe9,_0x24dbe8){return getInteractionUsers(_0x11b1d5,_0x261f8c)[_0xf9c7('0x27')](function(_0x133e8e){return getInteractionTags(_0x133e8e,_0x49e1e7);})[_0xf9c7('0x27')](function(_0x5103a1){if(_0x1a5615){_0x225fe9(getLastMessageText(_0x5103a1));}else{_0x225fe9(_0x5103a1);}})['catch'](function(_0x16becb){_0x24dbe8(_0x16becb);});});}exports[_0xf9c7('0x36')]=function(_0x155e7e,_0x429bbb){var _0x1e046e={},_0x5d0588={},_0x1a9d94={'count':0x0,'rows':[]};var _0x2e1f0b=_[_0xf9c7('0x37')](db[_0xf9c7('0x30')][_0xf9c7('0x38')],function(_0x2379ad){return{'name':_0x2379ad[_0xf9c7('0x39')],'type':_0x2379ad[_0xf9c7('0x3a')][_0xf9c7('0x3b')]};});_0x5d0588[_0xf9c7('0x3c')]=_[_0xf9c7('0x37')](_0x2e1f0b,_0xf9c7('0x29'));_0x5d0588[_0xf9c7('0x3d')]=_[_0xf9c7('0x3e')](_0x155e7e['query']);_0x5d0588[_0xf9c7('0x3f')]=_['intersection'](_0x5d0588[_0xf9c7('0x3c')],_0x5d0588[_0xf9c7('0x3d')]);_0x1e046e[_0xf9c7('0x40')]=_[_0xf9c7('0x41')](_0x5d0588[_0xf9c7('0x3c')],qs['fields'](_0x155e7e['query'][_0xf9c7('0x42')]));_0x1e046e[_0xf9c7('0x40')]=_0x1e046e['attributes']['length']?_0x1e046e[_0xf9c7('0x40')]:_0x5d0588['model'];if(!_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x43')](_0xf9c7('0x44'))){_0x1e046e[_0xf9c7('0x21')]=qs[_0xf9c7('0x21')](_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x21')]);_0x1e046e[_0xf9c7('0x20')]=qs[_0xf9c7('0x20')](_0x155e7e[_0xf9c7('0x3d')]['offset']);}_0x1e046e[_0xf9c7('0x45')]=qs[_0xf9c7('0x46')](_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x46')]);_0x1e046e[_0xf9c7('0x47')]=qs[_0xf9c7('0x3f')](_[_0xf9c7('0x48')](_0x155e7e[_0xf9c7('0x3d')],_0x5d0588[_0xf9c7('0x3f')]));var _0x32b4da=[];var _0x4675b7=squel[_0xf9c7('0x49')]()[_0xf9c7('0x4a')]('id')[_0xf9c7('0x4a')](_0xf9c7('0x29'))[_0xf9c7('0x4a')]('color')[_0xf9c7('0x4b')](_0xf9c7('0x4c'));var _0x48b206=squel[_0xf9c7('0x49')]()[_0xf9c7('0x4a')](_0xf9c7('0x4d'))['field']('ui.MailInteractionId')[_0xf9c7('0x4b')](_0xf9c7('0x4e'),'ui')[_0xf9c7('0x4f')](_0xf9c7('0x50'),'u',_0xf9c7('0x51'));var _0x906754=squel['select']()[_0xf9c7('0x4b')](_0xf9c7('0x52'),'i')[_0xf9c7('0x4f')]('cm_contacts','c',_0xf9c7('0x53'))[_0xf9c7('0x4f')](_0xf9c7('0x50'),'o',_0xf9c7('0x54'))[_0xf9c7('0x4f')](_0xf9c7('0x55'),'a',_0xf9c7('0x56'))[_0xf9c7('0x4f')](_0xf9c7('0x57'),'me',_0xf9c7('0x58'))[_0xf9c7('0x4f')]('mail_interaction_has_tags','it',_0xf9c7('0x59'))['left_join'](_0xf9c7('0x4c'),'t',_0xf9c7('0x5a'));var _0x365c6e=squel['expr']();var _0xe74393=[];var _0x41edde=squel[_0xf9c7('0x5b')]();var _0x299cb7;if(_0x155e7e[_0xf9c7('0x3d')]['search']){_0x299cb7=as['parseSearch'](_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x5c')]);var _0x12e455=_0x299cb7[_0xf9c7('0x5d')];for(var _0x1e2af0=0x0;_0x1e2af0<_0x299cb7[_0xf9c7('0x5e')]['length'];_0x1e2af0++){var _0x578e82=_0x299cb7[_0xf9c7('0x5e')][_0x1e2af0];var _0x38f7de='i';var _0x28a6ac=_[_0xf9c7('0x5f')](_0x2e1f0b,[_0xf9c7('0x29'),_0x578e82['field']]);if(!_0x28a6ac){switch(_0x578e82['field']){case _0xf9c7('0x60'):if(_0x578e82[_0xf9c7('0x61')]==0x1){_0x906754[_0xf9c7('0x62')]('`'+_0x578e82[_0xf9c7('0x4a')]+_0xf9c7('0x63'));}else{_0x906754[_0xf9c7('0x62')]('`'+_0x578e82[_0xf9c7('0x4a')]+_0xf9c7('0x64'));}break;case'Contact':if(_0x578e82['operator']===_0xf9c7('0x65')){if(_0x578e82[_0xf9c7('0x61')][_0xf9c7('0x2d')]('\x20')[_0xf9c7('0x66')]>0x1){_0x365c6e[_0x12e455]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf9c7('0x67')](_0x578e82[_0xf9c7('0x61')]),null);}else{var _0x2eb943='%'+_0x578e82[_0xf9c7('0x61')]+'%';_0x365c6e[_0x12e455](_0xf9c7('0x68'),_0x2eb943,_0x2eb943,_0x2eb943);}}else{_0x28a6ac=_[_0xf9c7('0x5f')](_0x2e1f0b,['name',_0xf9c7('0x69')]);_0x578e82[_0xf9c7('0x4a')]=_0xf9c7('0x69');_0x3343d0=as['buildExpression'](_0x38f7de,_0x28a6ac['type'],_0x578e82);_0x365c6e[_0x12e455](_0x3343d0['text'],_0x3343d0[_0xf9c7('0x61')][_0xf9c7('0x6a')],_0x3343d0[_0xf9c7('0x61')][_0xf9c7('0x1d')]);}break;case _0xf9c7('0x6b'):var _0x53d882=_0x578e82[_0xf9c7('0x61')]['split'](',')['map'](function(_0x2f7b16){return Number(_0x2f7b16);});_0x53d882[_0xf9c7('0x2e')](function(_0x19f6cc){_0x41edde['or'](_0xf9c7('0x6c'),'%,'+_0x19f6cc+',%');});_0xe74393=_[_0xf9c7('0x6d')](_0xe74393,_0x53d882);break;case _0xf9c7('0x6e'):if(_0x578e82[_0xf9c7('0x6f')]===_0xf9c7('0x65')){_0x365c6e[_0x12e455](_0xf9c7('0x70'),'%'+_0x578e82['value']+'%',null);}else{_0x28a6ac=_[_0xf9c7('0x5f')](_0x2e1f0b,[_0xf9c7('0x29'),_0xf9c7('0x71')]);_0x578e82['field']='UserId';_0x3343d0=as[_0xf9c7('0x72')](_0x38f7de,_0x28a6ac[_0xf9c7('0x3a')],_0x578e82);_0x365c6e[_0x12e455](_0x3343d0[_0xf9c7('0x73')],_0x3343d0[_0xf9c7('0x61')][_0xf9c7('0x6a')],_0x3343d0['value'][_0xf9c7('0x1d')]);}break;case _0xf9c7('0x74'):_0x3343d0=as[_0xf9c7('0x72')]('me',null,_0x578e82);_0x365c6e[_0x12e455](_0x3343d0[_0xf9c7('0x73')],_0x3343d0[_0xf9c7('0x61')][_0xf9c7('0x6a')],_0x3343d0[_0xf9c7('0x61')][_0xf9c7('0x1d')]);break;}}else{var _0x3343d0=as['buildExpression'](_0x38f7de,_0x28a6ac['type'],_0x578e82);_0x365c6e[_0x12e455](_0x3343d0[_0xf9c7('0x73')],_0x3343d0[_0xf9c7('0x61')][_0xf9c7('0x6a')],_0x3343d0[_0xf9c7('0x61')]['end']);}}}else{var _0xdeeed=_(_0x155e7e[_0xf9c7('0x3d')])['keys']()[_0xf9c7('0x37')](function(_0x4438ca){return _[_0xf9c7('0x75')](_0x2e1f0b,[_0xf9c7('0x29'),_0x4438ca])?_0x4438ca:undefined;})[_0xf9c7('0x76')]()[_0xf9c7('0x61')]();if(!_[_0xf9c7('0x77')](_0xdeeed)){_0xdeeed[_0xf9c7('0x2e')](function(_0x19c82a){if(_0x19c82a===_0xf9c7('0x78')){_0x906754[_0xf9c7('0x47')](_0xf9c7('0x79'),[][_0xf9c7('0x7a')](_0x155e7e[_0xf9c7('0x3d')][_0x19c82a]));}else if(_0x19c82a==='createdAt'){var _0xccbb5b=JSON[_0xf9c7('0x7b')](_0x155e7e[_0xf9c7('0x3d')][_0x19c82a])['$gte'];var _0x90c885=JSON[_0xf9c7('0x7b')](_0x155e7e[_0xf9c7('0x3d')][_0x19c82a])['$lte'];_0x906754[_0xf9c7('0x47')](_0xf9c7('0x7c'),_0xccbb5b,_0x90c885);}else{if(_0x155e7e[_0xf9c7('0x3d')][_0x19c82a]===_0xf9c7('0x7d')){_0x906754[_0xf9c7('0x47')]('i.'+_0x19c82a+_0xf9c7('0x7e'));}else{_0x906754['where']('i.'+_0x19c82a+_0xf9c7('0x7f'),_0x155e7e[_0xf9c7('0x3d')][_0x19c82a]);}}});}if(_0x155e7e['query'][_0xf9c7('0x80')]){if(_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x80')]==0x1){_0x906754[_0xf9c7('0x62')](_0xf9c7('0x81'));}else{_0x906754['having'](_0xf9c7('0x82'));}}if(_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x83')]){_0xe74393=_[_0xf9c7('0x84')](_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x83')])?_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x83')]:new Array(_0x155e7e[_0xf9c7('0x3d')]['tag']);_0xe74393[_0xf9c7('0x2e')](function(_0x46b7e3){_0x41edde['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46b7e3+',%');});}if(_0x155e7e['query'][_0xf9c7('0x85')]){var _0x4c706c=_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x85')][_0xf9c7('0x86')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xf9c7('0x87'));if(qs[_0xf9c7('0x88')](_0x4c706c)){_0x365c6e['or'](_0xf9c7('0x89'),_0x4c706c+'%');}else if(qs['isEmail'](_0x4c706c)){_0x365c6e['or'](_0xf9c7('0x8a'),_0x4c706c+'%');}else{_0x365c6e['or'](_0xf9c7('0x8b'),qs['getFullTextValue'](_0x4c706c))['or'](_0xf9c7('0x8c'),qs['getFullTextValue'](_0x4c706c));}}}_0x906754['where'](_0x365c6e);_0x906754[_0xf9c7('0x8d')](_0xf9c7('0x8e'));var _0x52d14b={'type':db[_0xf9c7('0x8f')][_0xf9c7('0x90')]['SELECT'],'raw':!![]};var _0x31b387=_0x906754['clone']();_0x31b387['field'](_0xf9c7('0x8e'));_0x31b387['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf9c7('0x60'));if(_0x1e046e[_0xf9c7('0x45')]){_0x1e046e['order'][_0xf9c7('0x2e')](function(_0x5b8ce){_0x906754[_0xf9c7('0x45')]('i.'+_0x5b8ce[0x0],_0x5b8ce[0x1]==='DESC'?![]:!![]);});}if(!_[_0xf9c7('0x77')](_0xe74393)){_0x906754['having'](_0x41edde);_0x31b387['where']('t.id\x20IN\x20?',_0xe74393);}BPromise[_0xf9c7('0x91')]()['then'](function(){if(!_0x299cb7&&_0x155e7e[_0xf9c7('0x3d')][_0xf9c7('0x78')])return;return _0x155e7e[_0xf9c7('0x92')][_0xf9c7('0x93')]({'attributes':['id'],'raw':!![]})[_0xf9c7('0x27')](function(_0x216fcf){if(_[_0xf9c7('0x77')](_0x216fcf)){_0x31b387[_0xf9c7('0x47')](_0xf9c7('0x94'));_0x906754[_0xf9c7('0x47')](_0xf9c7('0x94'));}else{_0x31b387['where'](_0xf9c7('0x79'),_[_0xf9c7('0x37')](_0x216fcf,'id'));_0x906754[_0xf9c7('0x47')](_0xf9c7('0x79'),_[_0xf9c7('0x37')](_0x216fcf,'id'));}});})[_0xf9c7('0x27')](function(){db[_0xf9c7('0x95')][_0xf9c7('0x3d')](_0x31b387[_0xf9c7('0x96')](),_0x52d14b)[_0xf9c7('0x27')](function(_0x4aba79){_0x1a9d94[_0xf9c7('0x1f')]=_0x4aba79[_0xf9c7('0x66')];if(_0x1a9d94[_0xf9c7('0x1f')]===0x0)return[];return db[_0xf9c7('0x95')]['query'](_0x4675b7[_0xf9c7('0x96')](),_0x52d14b)['then'](function(_0x2fcfb5){_0x32b4da=_['keyBy'](_0x2fcfb5,'id');_0x52d14b=_[_0xf9c7('0x97')](_0x52d14b,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x155e7e['query'][_0xf9c7('0x42')]){_0x1e046e[_0xf9c7('0x40')][_0xf9c7('0x2e')](function(_0xadbba1){_0x906754['field']('i.'+_0xadbba1);});}else{_0x906754[_0xf9c7('0x4a')](_0xf9c7('0x98'),_0xf9c7('0x60'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0x99'),_0xf9c7('0x9a'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0x9b'),_0xf9c7('0x9c'));_0x906754[_0xf9c7('0x4a')]('i.id');_0x906754[_0xf9c7('0x4a')]('i.createdAt');_0x906754['field']('i.updatedAt');_0x906754[_0xf9c7('0x4a')]('i.closed');_0x906754[_0xf9c7('0x4a')](_0xf9c7('0x9d'));_0x906754[_0xf9c7('0x4a')]('i.attach');_0x906754[_0xf9c7('0x4a')](_0xf9c7('0x9e'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0x9f'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xa0'));_0x906754[_0xf9c7('0x4a')]('i.disposition');_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xa1'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xa2'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xa3'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xa4'));_0x906754['field'](_0xf9c7('0xa5'));_0x906754['field'](_0xf9c7('0xa6'),_0xf9c7('0xa7'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xa8'),'Contact.lastName');_0x906754['field'](_0xf9c7('0xa9'),_0xf9c7('0xaa'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xab'),'Contact.phone');_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xac'),_0xf9c7('0xad'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xae'),_0xf9c7('0xaf'));_0x906754[_0xf9c7('0x4a')](_0xf9c7('0xb0'),_0xf9c7('0x2b'));}_0x906754['limit'](_0x1e046e[_0xf9c7('0x21')]);_0x906754[_0xf9c7('0x20')](_0x1e046e[_0xf9c7('0x20')]);return db[_0xf9c7('0x95')][_0xf9c7('0x3d')](_0x906754[_0xf9c7('0x96')](),_0x52d14b);})[_0xf9c7('0x27')](function(_0x15f9b0){_0x48b206[_0xf9c7('0x47')]('ui.MailInteractionId\x20IN\x20?',_[_0xf9c7('0x37')](_0x15f9b0,'id'));return db[_0xf9c7('0x95')][_0xf9c7('0x3d')](_0x48b206[_0xf9c7('0x96')](),_0x52d14b)[_0xf9c7('0x27')](function(_0x1d8a8d){var _0x510da0=_[_0xf9c7('0xb1')](_0x1d8a8d,'MailInteractionId');var _0x378321=[];return db[_0xf9c7('0xb2')][_0xf9c7('0x31')]({'attributes':[_0xf9c7('0xb3')],'raw':!![]})[_0xf9c7('0x27')](function(_0x477a3f){var _0x58aaef=_0x477a3f['enableEmailPreview'];_0x15f9b0['forEach'](function(_0x5068f6){_0x378321[_0xf9c7('0x2f')](updateMailInteraction(_0x5068f6,_0x32b4da,_0x510da0,_0x58aaef));});return BPromise['all'](_0x378321);});});});})['then'](function(_0x165d63){_0x1a9d94[_0xf9c7('0xb4')]=_0x165d63;return _0x1a9d94;})[_0xf9c7('0x27')](respondWithFilteredResult(_0x429bbb,_0x1e046e));})[_0xf9c7('0xb5')](handleError(_0x429bbb,null));};exports[_0xf9c7('0xb6')]=function(_0x4c32e5,_0x4a939f){var _0x52b533={'raw':![],'where':{'id':_0x4c32e5['params']['id']}},_0x1841ff={};_0x1841ff[_0xf9c7('0x3c')]=_[_0xf9c7('0x3e')](db[_0xf9c7('0x30')]['rawAttributes']);_0x1841ff[_0xf9c7('0x3d')]=_[_0xf9c7('0x3e')](_0x4c32e5[_0xf9c7('0x3d')]);_0x1841ff[_0xf9c7('0x3f')]=_[_0xf9c7('0x41')](_0x1841ff['model'],_0x1841ff['query']);_0x52b533['attributes']=_['intersection'](_0x1841ff[_0xf9c7('0x3c')],qs['fields'](_0x4c32e5[_0xf9c7('0x3d')][_0xf9c7('0x42')]));_0x52b533[_0xf9c7('0x40')]=_0x52b533[_0xf9c7('0x40')][_0xf9c7('0x66')]?_0x52b533[_0xf9c7('0x40')]:_0x1841ff[_0xf9c7('0x3c')];if(_0x4c32e5[_0xf9c7('0x3d')][_0xf9c7('0xb7')]){_0x52b533[_0xf9c7('0xb8')]=[{'all':!![]}];}_0x52b533=_[_0xf9c7('0x97')]({},_0x52b533,_0x4c32e5[_0xf9c7('0xb9')]);return db[_0xf9c7('0x30')]['find'](_0x52b533)[_0xf9c7('0x27')](handleEntityNotFound(_0x4a939f,null))[_0xf9c7('0x27')](respondWithResult(_0x4a939f,null))[_0xf9c7('0xb5')](handleError(_0x4a939f,null));};exports['create']=function(_0x90ab58,_0x4ae747){return db[_0xf9c7('0x30')]['create'](_0x90ab58[_0xf9c7('0xba')],{})['then'](respondWithResult(_0x4ae747,0xc9))[_0xf9c7('0xb5')](handleError(_0x4ae747,null));};exports['update']=function(_0xa0cb52,_0x158a1a){if(_0xa0cb52['body']['id']){delete _0xa0cb52[_0xf9c7('0xba')]['id'];}return db[_0xf9c7('0x30')][_0xf9c7('0x5f')]({'where':{'id':_0xa0cb52[_0xf9c7('0xbb')]['id']}})[_0xf9c7('0x27')](handleEntityNotFound(_0x158a1a,null))['then'](saveUpdates(_0xa0cb52[_0xf9c7('0xba')],null))[_0xf9c7('0x27')](respondWithResult(_0x158a1a,null))['catch'](handleError(_0x158a1a,null));};exports[_0xf9c7('0x26')]=function(_0x523820,_0x444119){return db[_0xf9c7('0x30')]['find']({'where':{'id':_0x523820[_0xf9c7('0xbb')]['id']}})[_0xf9c7('0x27')](handleEntityNotFound(_0x444119,null))['then'](removeEntity(_0x444119,null))[_0xf9c7('0xb5')](handleError(_0x444119,null));};exports[_0xf9c7('0xbc')]=function(_0x31ebb6,_0xdb3666){return db['MailInteraction'][_0xf9c7('0xbc')]()[_0xf9c7('0x27')](respondWithResult(_0xdb3666,null))[_0xf9c7('0xb5')](handleError(_0xdb3666,null));};exports[_0xf9c7('0xbd')]=function(_0x9baad8,_0x48d6df,_0x35ccdd){return db[_0xf9c7('0xbe')][_0xf9c7('0x5f')]({'where':{'id':_0x9baad8[_0xf9c7('0xbb')]['id']}})[_0xf9c7('0x27')](handleEntityNotFound(_0x48d6df,null))[_0xf9c7('0x27')](function(_0x4ab304){if(_0x4ab304){return _0x4ab304[_0xf9c7('0xbd')](_0x9baad8[_0xf9c7('0xba')][_0xf9c7('0xbf')],_[_0xf9c7('0xc0')](_0x9baad8[_0xf9c7('0xba')],[_0xf9c7('0xbf'),'id'])||{});}})[_0xf9c7('0x27')](respondWithResult(_0x48d6df,null))[_0xf9c7('0xb5')](handleError(_0x48d6df,null));};exports[_0xf9c7('0xc1')]=function(_0x445735,_0x5458a3,_0x86d0ee){var _0x5efb66={'raw':![],'where':{}};var _0x2cb2a8={};var _0x1ba11c={'count':0x0,'rows':[]};return db[_0xf9c7('0x30')]['findOne']({'where':{'id':_0x445735[_0xf9c7('0xbb')]['id']}})[_0xf9c7('0x27')](handleEntityNotFound(_0x5458a3,null))['then'](function(_0x5504a5){if(_0x5504a5){_0x2cb2a8[_0xf9c7('0x3c')]=_[_0xf9c7('0x3e')](db['MailMessage'][_0xf9c7('0x38')]);_0x2cb2a8['query']=_[_0xf9c7('0x3e')](_0x445735[_0xf9c7('0x3d')]);_0x2cb2a8[_0xf9c7('0x3f')]=_[_0xf9c7('0x41')](_0x2cb2a8[_0xf9c7('0x3c')],_0x2cb2a8[_0xf9c7('0x3d')]);_0x5efb66[_0xf9c7('0x40')]=_[_0xf9c7('0x41')](_0x2cb2a8['model'],qs[_0xf9c7('0x42')](_0x445735[_0xf9c7('0x3d')][_0xf9c7('0x42')]));_0x5efb66[_0xf9c7('0x40')]=_0x5efb66[_0xf9c7('0x40')][_0xf9c7('0x66')]?_0x5efb66[_0xf9c7('0x40')]:_0x2cb2a8[_0xf9c7('0x3c')];if(!_0x445735['query'][_0xf9c7('0x43')]('nolimit')){_0x5efb66['limit']=qs[_0xf9c7('0x21')](_0x445735['query'][_0xf9c7('0x21')]);_0x5efb66[_0xf9c7('0x20')]=qs[_0xf9c7('0x20')](_0x445735[_0xf9c7('0x3d')][_0xf9c7('0x20')]);}_0x5efb66['order']=qs[_0xf9c7('0x46')](_0x445735[_0xf9c7('0x3d')][_0xf9c7('0x46')]);_0x5efb66[_0xf9c7('0x47')]=qs[_0xf9c7('0x3f')](_[_0xf9c7('0x48')](_0x445735[_0xf9c7('0x3d')],_0x2cb2a8[_0xf9c7('0x3f')]));_0x5efb66[_0xf9c7('0x47')][_0xf9c7('0xc2')]=_0x5504a5['id'];if(_0x445735['query'][_0xf9c7('0x85')]){_0x5efb66['where']=_[_0xf9c7('0x97')](_0x5efb66[_0xf9c7('0x47')],{'$or':_[_0xf9c7('0x37')](_0x5efb66['attributes'],function(_0x4bb736){var _0x3d1e4d={};_0x3d1e4d[_0x4bb736]={'$like':'%'+_0x445735[_0xf9c7('0x3d')][_0xf9c7('0x85')]+'%'};return _0x3d1e4d;})});}if(_0x445735['query'][_0xf9c7('0xc3')]){var _0x3f9a83=_0x445735[_0xf9c7('0x3d')][_0xf9c7('0xc3')][_0xf9c7('0x2d')](',');var _0x2a4c23={};_0x2a4c23[_0x3f9a83[0x0]]={'$gte':moment(_0x3f9a83[0x1])[_0xf9c7('0xc4')](_0xf9c7('0xc5'))};_0x5efb66['where']=_['merge'](_0x5efb66[_0xf9c7('0x47')],_0x2a4c23);}_0x5efb66=_['merge']({},_0x5efb66,_0x445735[_0xf9c7('0xb9')]);return db['MailMessage'][_0xf9c7('0x1f')]({'where':_0x5efb66[_0xf9c7('0x47')]})[_0xf9c7('0x27')](function(_0x21905d){_0x1ba11c[_0xf9c7('0x1f')]=_0x21905d;if(_0x445735[_0xf9c7('0x3d')][_0xf9c7('0xb7')]){_0x5efb66[_0xf9c7('0xb8')]=[{'all':!![]}];}return db[_0xf9c7('0xbe')]['findAll'](_0x5efb66);})[_0xf9c7('0x27')](function(_0x417ae0){_0x1ba11c[_0xf9c7('0xb4')]=_0x417ae0;return _0x1ba11c;});}})[_0xf9c7('0x27')](respondWithFilteredResult(_0x5458a3,_0x5efb66))[_0xf9c7('0xb5')](handleError(_0x5458a3,null));};exports[_0xf9c7('0xc6')]=function(_0x4b6b59,_0x55b7ae,_0x568352){return db['MailInteraction'][_0xf9c7('0x5f')]({'where':{'id':_0x4b6b59['params']['id']}})[_0xf9c7('0x27')](handleEntityNotFound(_0x55b7ae,null))[_0xf9c7('0x27')](function(_0x4c8921){if(_0x4c8921){return _0x4c8921[_0xf9c7('0xc7')](_0x4b6b59[_0xf9c7('0xba')][_0xf9c7('0xbf')],_[_0xf9c7('0xc0')](_0x4b6b59[_0xf9c7('0xba')],[_0xf9c7('0xbf'),'id'])||{})[_0xf9c7('0xc8')](function(){return db[_0xf9c7('0x6b')][_0xf9c7('0xc9')]({'attributes':['id','name','color'],'where':{'id':_0x4b6b59[_0xf9c7('0xba')][_0xf9c7('0xbf')]}});})[_0xf9c7('0x27')](function(_0x49cb56){socket['emit'](_0xf9c7('0xca'),{'id':Number(_0x4b6b59['params']['id']),'tags':_0x49cb56||[]});return{'id':Number(_0x4b6b59['params']['id']),'tags':_0x49cb56||[]};});}})[_0xf9c7('0x27')](respondWithResult(_0x55b7ae,null))[_0xf9c7('0xb5')](handleError(_0x55b7ae,null));};exports[_0xf9c7('0xcb')]=function(_0x55a102,_0x3eb465,_0x50fcf6){return db[_0xf9c7('0x30')]['find']({'where':{'id':_0x55a102['params']['id']}})['then'](handleEntityNotFound(_0x3eb465,null))[_0xf9c7('0x27')](function(_0x474f08){if(_0x474f08){return _0x474f08[_0xf9c7('0xcb')](_0x55a102[_0xf9c7('0x3d')]['ids']);}})[_0xf9c7('0x27')](respondWithStatusCode(_0x3eb465,null))[_0xf9c7('0xb5')](handleError(_0x3eb465,null));};exports[_0xf9c7('0xcc')]=function(_0x1ca501,_0x218994){var _0x10dae6=moment()[_0xf9c7('0xcd')]()[_0xf9c7('0x96')]();var _0x15f46c=path[_0xf9c7('0xce')](config['root'],_0xf9c7('0xcf'),_0xf9c7('0xd0'),'attachments');var _0x360b14=path[_0xf9c7('0xce')](config[_0xf9c7('0xd1')],_0xf9c7('0xcf'),'files',_0xf9c7('0xd2'));var _0x4264a4=path[_0xf9c7('0xce')](_0x360b14,_0x10dae6);var _0x23cb15=util[_0xf9c7('0xc4')](_0xf9c7('0xd3'),_0x10dae6);var _0x363805=path[_0xf9c7('0xce')](_0x360b14,_0x23cb15);var _0x163c9f=![];return db['MailInteraction'][_0xf9c7('0x5f')]({'where':{'id':_0x1ca501[_0xf9c7('0xbb')]['id']}})[_0xf9c7('0x27')](handleEntityNotFound(_0x218994,null))[_0xf9c7('0x27')](function(_0x31bc20){if(_0x31bc20){return _0x31bc20[_0xf9c7('0xc1')]({'attributes':['id',_0xf9c7('0xba'),_0xf9c7('0x4b'),'to','cc','bcc',_0xf9c7('0xd4'),_0xf9c7('0xd5')],'where':{'secret':![]},'include':_0x1ca501['query']['attachments']?[{'model':db[_0xf9c7('0xd6')],'as':_0xf9c7('0xd7')}]:undefined,'order':qs['sort']('id')});}return[];})['then'](function(_0x18e8ed){_0x163c9f=_0x18e8ed['length'];if(_0x18e8ed[_0xf9c7('0x66')]){fs[_0xf9c7('0xd8')](_0x4264a4);return BPromise[_0xf9c7('0xd9')](_0x18e8ed,function(_0x8b5a75,_0x3d8bdc){var _0x3432ac=_0x8b5a75;var _0x313203={'from':_0x3432ac[_0xf9c7('0x4b')],'to':_0x3432ac['to'],'subject':_0x3432ac[_0xf9c7('0xd4')],'html':_0x3432ac[_0xf9c7('0xba')],'headers':{'Date':moment(_0x3432ac[_0xf9c7('0xd5')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x8b5a75['cc']){_0x313203[_0xf9c7('0xda')]['Cc']=_0x8b5a75['cc'];}if(_0x8b5a75['bcc']){_0x313203[_0xf9c7('0xda')][_0xf9c7('0xdb')]=_0x8b5a75[_0xf9c7('0xdc')];}return new BPromise(function(_0x2fb0d0,_0x4d760a){if(_0x8b5a75[_0xf9c7('0xd7')]){for(var _0x37d7fd=0x0;_0x37d7fd<_0x8b5a75['Attachments'][_0xf9c7('0x66')];_0x37d7fd++){var _0x5ea6aa=_0x8b5a75[_0xf9c7('0xd7')][_0x37d7fd];var _0x5ca419=path['join'](_0x15f46c,_0x5ea6aa[_0xf9c7('0xdd')]);if(fs[_0xf9c7('0xde')](_0x5ca419)){_0x313203[_0xf9c7('0xdf')][_0xf9c7('0x2f')]({'name':_0x5ea6aa[_0xf9c7('0x29')],'contentType':_0x5ea6aa['type'],'data':fs['readFileSync'](_0x5ca419)});}}}emlformat[_0xf9c7('0xe0')](_0x313203,function(_0x50fbc4,_0x25d6fd){if(_0x50fbc4)return _0x4d760a(_0x50fbc4);fs[_0xf9c7('0xe1')](path['join'](_0x4264a4,util[_0xf9c7('0xc4')](_0xf9c7('0xe2'),_0x3d8bdc)),_0x25d6fd);return _0x2fb0d0(_0x25d6fd);});});});}})['then'](function(){if(_0x163c9f){return new BPromise(function(_0x156b81,_0x3a449d){zipdir(_0x4264a4,{'saveTo':_0x363805},function(_0x4ad2f3,_0x17e5bd){if(_0x4ad2f3)return _0x3a449d(_0x4ad2f3);return _0x156b81(_0x17e5bd);});});}})[_0xf9c7('0x27')](function(){if(_0x163c9f){return new BPromise(function(_0x55ddd8,_0x6b0402){rimraf(_0x4264a4,function(_0x5da729){if(_0x5da729)_0x6b0402(_0x5da729);return _0x55ddd8();});});}})[_0xf9c7('0x27')](function(){if(_0x163c9f){return _0x218994['download'](_0x363805,_0x23cb15,function(_0x58a4e7){if(_0x58a4e7){console[_0xf9c7('0xe3')]('err',_0x58a4e7);}else{fs[_0xf9c7('0xe4')](_0x363805);}});}else{return _0x218994[_0xf9c7('0x28')](0xc8);}})[_0xf9c7('0xb5')](handleError(_0x218994,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 070eace..a2e5e57 100644 --- a/server/api/mailInteraction/mailInteraction.events.js +++ b/server/api/mailInteraction/mailInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf09b=['Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x57ade9,_0x3c9db1){var _0x22ad36=function(_0x2b938f){while(--_0x2b938f){_0x57ade9['push'](_0x57ade9['shift']());}};_0x22ad36(++_0x3c9db1);}(_0xf09b,0x116));var _0xbf09=function(_0x32e7a1,_0x32c0a2){_0x32e7a1=_0x32e7a1-0x0;var _0x488edc=_0xf09b[_0x32e7a1];return _0x488edc;};'use strict';var EventEmitter=require(_0xbf09('0x0'));var MailInteraction=require(_0xbf09('0x1'))['db'][_0xbf09('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xbf09('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbf09('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf09('0x5'),'afterDestroy':_0xbf09('0x6')};function emitEvent(_0x2ea2e7){return function(_0x81d6ba,_0x251ace,_0x142594){_0x81d6ba[_0xbf09('0x7')]({'attributes':['id'],'raw':!![]})[_0xbf09('0x8')](function(_0x527067){_0x81d6ba[_0xbf09('0x9')](_0xbf09('0xa'),_0x527067[_0xbf09('0xb')](function(_0xad23c9){return{'id':_0xad23c9['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x81d6ba['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5adfaa){_0x81d6ba[_0xbf09('0x9')](_0xbf09('0xc'),_0x5adfaa[_0xbf09('0xd')]);MailInteractionEvents[_0xbf09('0xe')](_0x2ea2e7+':'+_0x81d6ba['id'],_0x81d6ba);MailInteractionEvents[_0xbf09('0xe')](_0x2ea2e7,_0x81d6ba);_0x142594(null);})[_0xbf09('0xf')](_0x142594(null));};}for(var e in events){if(events[_0xbf09('0x10')](e)){var event=events[e];MailInteraction[_0xbf09('0x11')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xb964=['length','emit','catch','hasOwnProperty','exports','events','MailInteraction','../../mysqldb','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb964,0xf5));var _0x4b96=function(_0x35b40c,_0x4e6730){_0x35b40c=_0x35b40c-0x0;var _0x59a65b=_0xb964[_0x35b40c];return _0x59a65b;};'use strict';var EventEmitter=require(_0x4b96('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4b96('0x1')];var MailMessage=require(_0x4b96('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b96('0x3'),'afterUpdate':_0x4b96('0x4'),'afterDestroy':_0x4b96('0x5')};function emitEvent(_0x2e67ae){return function(_0xceef42,_0x3aeef4,_0x2f1d5b){_0xceef42[_0x4b96('0x6')]({'attributes':['id'],'raw':!![]})[_0x4b96('0x7')](function(_0x304dce){_0xceef42[_0x4b96('0x8')]('Users',_0x304dce['map'](function(_0x57f0ca){return{'id':_0x57f0ca['id']};}));return MailMessage[_0x4b96('0x9')]({'where':{'MailInteractionId':_0xceef42['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b96('0x7')](function(_0x29a029){_0xceef42[_0x4b96('0x8')](_0x4b96('0xa'),_0x29a029[_0x4b96('0xb')]);MailInteractionEvents[_0x4b96('0xc')](_0x2e67ae+':'+_0xceef42['id'],_0xceef42);MailInteractionEvents[_0x4b96('0xc')](_0x2e67ae,_0xceef42);_0x2f1d5b(null);})[_0x4b96('0xd')](_0x2f1d5b(null));};}for(var e in events){if(events[_0x4b96('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x4b96('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 0df5aa7..62f0182 100644 --- a/server/api/mailInteraction/mailInteraction.model.js +++ b/server/api/mailInteraction/mailInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef92=['closed','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','fti_mail_interactions','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','substatus','changed'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0xef92,0xf2));var _0x2ef9=function(_0x4f797d,_0x446559){_0x4f797d=_0x4f797d-0x0;var _0x1b48f3=_0xef92[_0x4f797d];return _0x1b48f3;};'use strict';var _=require(_0x2ef9('0x0'));var util=require(_0x2ef9('0x1'));var logger=require(_0x2ef9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2ef9('0x3'));var rp=require(_0x2ef9('0x4'));var fs=require('fs');var path=require(_0x2ef9('0x5'));var rimraf=require(_0x2ef9('0x6'));var config=require(_0x2ef9('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x2ef9('0x8')]=function(_0x320ef6,_0x1012f4){return _0x320ef6[_0x2ef9('0x9')](_0x2ef9('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x2ef9('0xb'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1837c4,_0x274857,_0x1c1bbc){if(_0x1837c4['substatus']){_0x1837c4[_0x2ef9('0xc')]=moment()[_0x2ef9('0xd')](_0x2ef9('0xe'));}if(_0x1837c4['closed']){_0x1837c4[_0x2ef9('0xf')]=moment()[_0x2ef9('0xd')](_0x2ef9('0xe'));}_0x1c1bbc(null,_0x274857);},'beforeUpdate':function(_0x344ddf,_0x444bc2,_0x4bd88f){if(_0x344ddf['changed'](_0x2ef9('0x10'))){_0x344ddf[_0x2ef9('0xc')]=_0x344ddf[_0x2ef9('0x10')]?moment()[_0x2ef9('0xd')](_0x2ef9('0xe')):null;}if(_0x344ddf[_0x2ef9('0x11')](_0x2ef9('0x12'))){_0x344ddf[_0x2ef9('0xf')]=moment()[_0x2ef9('0xd')](_0x2ef9('0xe'));_0x344ddf[_0x2ef9('0x10')]=null;_0x344ddf[_0x2ef9('0xc')]=null;}_0x4bd88f(null,_0x344ddf);},'afterUpdate':function(_0x3209cd,_0x446b55,_0x545f4d){var _0x11880b=_0x320ef6['models'];var _0x3f980d=_0x3209cd[_0x2ef9('0x13')]({'plain':!![]});if(_0x3f980d[_0x2ef9('0x12')]){return _0x11880b[_0x2ef9('0x14')][_0x2ef9('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x3f980d['id']}})[_0x2ef9('0x16')](function(){_0x545f4d();})[_0x2ef9('0x17')](function(_0x5e43e4){_0x545f4d(_0x5e43e4);});}else{_0x545f4d();}}},'charset':_0x2ef9('0x18'),'collate':_0x2ef9('0x19')});}; \ No newline at end of file +var _0x84e1=['YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','format'];(function(_0x289adb,_0xc223e2){var _0x50f905=function(_0x1cb2dc){while(--_0x1cb2dc){_0x289adb['push'](_0x289adb['shift']());}};_0x50f905(++_0xc223e2);}(_0x84e1,0x1dc));var _0x184e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x84e1[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x184e('0x0'));var util=require(_0x184e('0x1'));var logger=require(_0x184e('0x2'))(_0x184e('0x3'));var moment=require(_0x184e('0x4'));var BPromise=require(_0x184e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x184e('0x6'));var rimraf=require(_0x184e('0x7'));var config=require(_0x184e('0x8'));var attributes=require(_0x184e('0x9'));module[_0x184e('0xa')]=function(_0x86a78e,_0x396183){return _0x86a78e['define'](_0x184e('0xb'),attributes,{'tableName':_0x184e('0xc'),'paranoid':![],'indexes':[{'name':_0x184e('0xd'),'fields':['subject','to'],'type':_0x184e('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1b948a,_0x22af83,_0x430a7e){if(_0x1b948a['substatus']){_0x1b948a[_0x184e('0xf')]=moment()[_0x184e('0x10')](_0x184e('0x11'));}if(_0x1b948a[_0x184e('0x12')]){_0x1b948a[_0x184e('0x13')]=moment()[_0x184e('0x10')](_0x184e('0x11'));}_0x430a7e(null,_0x22af83);},'beforeUpdate':function(_0x15da74,_0x1f2e7a,_0x7acac7){if(_0x15da74[_0x184e('0x14')](_0x184e('0x15'))){_0x15da74['substatusAt']=_0x15da74[_0x184e('0x15')]?moment()['format'](_0x184e('0x11')):null;}if(_0x15da74[_0x184e('0x14')](_0x184e('0x12'))){_0x15da74[_0x184e('0x13')]=moment()[_0x184e('0x10')](_0x184e('0x11'));_0x15da74[_0x184e('0x15')]=null;_0x15da74[_0x184e('0xf')]=null;}_0x7acac7(null,_0x15da74);},'afterUpdate':function(_0x10b179,_0x4c5442,_0x1f3d61){var _0x5d3a36=_0x86a78e[_0x184e('0x16')];var _0x4ce10a=_0x10b179['get']({'plain':!![]});if(_0x4ce10a[_0x184e('0x12')]){return _0x5d3a36[_0x184e('0x17')][_0x184e('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x4ce10a['id']}})[_0x184e('0x19')](function(){_0x1f3d61();})[_0x184e('0x1a')](function(_0x262762){_0x1f3d61(_0x262762);});}else{_0x1f3d61();}}},'charset':_0x184e('0x1b'),'collate':_0x184e('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 2056afa..8fdce02 100644 --- a/server/api/mailInteraction/mailInteraction.rpc.js +++ b/server/api/mailInteraction/mailInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3140=['info','result','UpdateMailInteraction','MailInteraction','update','body','raw','options','where','catch','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3140,0xaf));var _0x0314=function(_0x5f4b06,_0x3e5997){_0x5f4b06=_0x5f4b06-0x0;var _0x55cc05=_0x3140[_0x5f4b06];return _0x55cc05;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});config[_0x0314('0xc')]=_[_0x0314('0xd')](config[_0x0314('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0314('0xe'))(new Redis(config[_0x0314('0xc')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xf2561e,_0x4e6545,_0x17bde3){return new BPromise(function(_0x13adcb,_0x3a7713){return client[_0x0314('0xf')](_0xf2561e,_0x17bde3)[_0x0314('0x10')](function(_0x3e9964){logger['info'](_0x0314('0x11'),_0x4e6545,_0x0314('0x12'));logger[_0x0314('0x13')](_0x0314('0x14'),_0x4e6545,_0x0314('0x12'),JSON[_0x0314('0x15')](_0x3e9964));if(_0x3e9964[_0x0314('0x16')]){if(_0x3e9964['error'][_0x0314('0x17')]===0x1f4){logger[_0x0314('0x16')](_0x0314('0x11'),_0x4e6545,_0x3e9964[_0x0314('0x16')][_0x0314('0x18')]);return _0x3a7713(_0x3e9964[_0x0314('0x16')][_0x0314('0x18')]);}logger[_0x0314('0x16')]('MailInteraction,\x20%s,\x20%s',_0x4e6545,_0x3e9964[_0x0314('0x16')][_0x0314('0x18')]);return _0x13adcb(_0x3e9964[_0x0314('0x16')]['message']);}else{logger[_0x0314('0x19')]('MailInteraction,\x20%s,\x20%s',_0x4e6545,'request\x20sent');_0x13adcb(_0x3e9964[_0x0314('0x1a')][_0x0314('0x18')]);}})['catch'](function(_0x1edd7f){logger[_0x0314('0x16')]('MailInteraction,\x20%s,\x20%s',_0x4e6545,_0x1edd7f);_0x3a7713(_0x1edd7f);});});}exports[_0x0314('0x1b')]=function(_0x59ce1f){var _0xd03f0f=this;return new Promise(function(_0x41f75e,_0x16d273){return db[_0x0314('0x1c')][_0x0314('0x1d')](_0x59ce1f[_0x0314('0x1e')],{'raw':_0x59ce1f['options']?_0x59ce1f['options'][_0x0314('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59ce1f[_0x0314('0x20')]?_0x59ce1f[_0x0314('0x20')][_0x0314('0x21')]||null:null,'attributes':_0x59ce1f[_0x0314('0x20')]?_0x59ce1f[_0x0314('0x20')]['attributes']||null:null,'limit':_0x59ce1f[_0x0314('0x20')]?_0x59ce1f[_0x0314('0x20')]['limit']||null:null})[_0x0314('0x10')](function(_0xfc4893){logger[_0x0314('0x19')](_0x0314('0x1b'),_0x59ce1f);logger[_0x0314('0x13')](_0x0314('0x1b'),_0x59ce1f,JSON['stringify'](_0xfc4893));_0x41f75e(_0xfc4893);})[_0x0314('0x22')](function(_0x2e0c77){logger[_0x0314('0x16')]('UpdateMailInteraction',_0x2e0c77[_0x0314('0x18')],_0x59ce1f);_0x16d273(_0xd03f0f[_0x0314('0x16')](0x1f4,_0x2e0c77['message']));});});};exports['AddTagsToMailInteraction']=function(_0x2fc520){return new Promise(function(_0x21d6a5,_0x550dc4){return db[_0x0314('0x1c')][_0x0314('0x23')]({'where':_0x2fc520['options']?_0x2fc520['options'][_0x0314('0x21')]||null:null})[_0x0314('0x10')](function(_0x4e34a1){if(_0x4e34a1){return _0x4e34a1[_0x0314('0x24')](_0x2fc520[_0x0314('0x1e')][_0x0314('0x25')],_['omit'](_0x2fc520[_0x0314('0x1e')],[_0x0314('0x25'),'id'])||{});}})[_0x0314('0x26')](function(_0x1e42f0){logger['info'](_0x0314('0x27'),_0x2fc520);logger['debug']('AddTags',_0x2fc520,JSON[_0x0314('0x15')](_0x1e42f0));_0x21d6a5(_0x1e42f0);})[_0x0314('0x22')](function(_0x346c84){logger['error'](_0x0314('0x27'),_0x346c84['message'],_0x2fc520);_0x550dc4(_this[_0x0314('0x16')](0x1f4,_0x346c84['message']));});});}; \ No newline at end of file +var _0x136c=['addTags','omit','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','MailInteraction,\x20%s,\x20%s','message','info','UpdateMailInteraction','MailInteraction','body','raw','options','where','attributes','limit','debug','catch','AddTagsToMailInteraction','find'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0x136c,0x1d2));var _0xc136=function(_0x55df0b,_0x166a76){_0x55df0b=_0x55df0b-0x0;var _0x582dfb=_0x136c[_0x55df0b];return _0x582dfb;};'use strict';var _=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var moment=require('moment');var BPromise=require(_0xc136('0x2'));var rs=require(_0xc136('0x3'));var fs=require('fs');var Redis=require(_0xc136('0x4'));var db=require(_0xc136('0x5'))['db'];var utils=require(_0xc136('0x6'));var logger=require(_0xc136('0x7'))(_0xc136('0x8'));var config=require(_0xc136('0x9'));var jayson=require(_0xc136('0xa'));var client=jayson['client'][_0xc136('0xb')]({'port':0x232a});config['redis']=_[_0xc136('0xc')](config[_0xc136('0xd')],{'host':_0xc136('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc136('0xd')]));require('./mailInteraction.socket')[_0xc136('0xf')](socket);function respondWithRpcPromise(_0x31f7c3,_0x181f1d,_0x230e15){return new BPromise(function(_0x1cec7b,_0x339ac8){return client[_0xc136('0x10')](_0x31f7c3,_0x230e15)[_0xc136('0x11')](function(_0x10afdd){logger['info']('MailInteraction,\x20%s,\x20%s',_0x181f1d,_0xc136('0x12'));logger['debug'](_0xc136('0x13'),_0x181f1d,_0xc136('0x12'),JSON[_0xc136('0x14')](_0x10afdd));if(_0x10afdd['error']){if(_0x10afdd['error'][_0xc136('0x15')]===0x1f4){logger[_0xc136('0x16')](_0xc136('0x17'),_0x181f1d,_0x10afdd['error']['message']);return _0x339ac8(_0x10afdd[_0xc136('0x16')][_0xc136('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x181f1d,_0x10afdd['error'][_0xc136('0x18')]);return _0x1cec7b(_0x10afdd[_0xc136('0x16')][_0xc136('0x18')]);}else{logger[_0xc136('0x19')](_0xc136('0x17'),_0x181f1d,_0xc136('0x12'));_0x1cec7b(_0x10afdd['result']['message']);}})['catch'](function(_0x40b238){logger['error'](_0xc136('0x17'),_0x181f1d,_0x40b238);_0x339ac8(_0x40b238);});});}exports[_0xc136('0x1a')]=function(_0x357483){var _0x3f1f4d=this;return new Promise(function(_0x5f0575,_0x2b8527){return db[_0xc136('0x1b')]['update'](_0x357483[_0xc136('0x1c')],{'raw':_0x357483['options']?_0x357483['options'][_0xc136('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x357483[_0xc136('0x1e')]?_0x357483['options'][_0xc136('0x1f')]||null:null,'attributes':_0x357483[_0xc136('0x1e')]?_0x357483[_0xc136('0x1e')][_0xc136('0x20')]||null:null,'limit':_0x357483['options']?_0x357483[_0xc136('0x1e')][_0xc136('0x21')]||null:null})['then'](function(_0x3432b0){logger['info'](_0xc136('0x1a'),_0x357483);logger[_0xc136('0x22')]('UpdateMailInteraction',_0x357483,JSON['stringify'](_0x3432b0));_0x5f0575(_0x3432b0);})[_0xc136('0x23')](function(_0x10bda3){logger['error'](_0xc136('0x1a'),_0x10bda3[_0xc136('0x18')],_0x357483);_0x2b8527(_0x3f1f4d[_0xc136('0x16')](0x1f4,_0x10bda3[_0xc136('0x18')]));});});};exports[_0xc136('0x24')]=function(_0x1c1057){return new Promise(function(_0xa3e411,_0x5f3027){return db[_0xc136('0x1b')][_0xc136('0x25')]({'where':_0x1c1057[_0xc136('0x1e')]?_0x1c1057[_0xc136('0x1e')][_0xc136('0x1f')]||null:null})[_0xc136('0x11')](function(_0x309f54){if(_0x309f54){return _0x309f54[_0xc136('0x26')](_0x1c1057[_0xc136('0x1c')]['ids'],_[_0xc136('0x27')](_0x1c1057[_0xc136('0x1c')],[_0xc136('0x28'),'id'])||{});}})['spread'](function(_0x3478fb){logger['info']('AddTags',_0x1c1057);logger[_0xc136('0x22')](_0xc136('0x29'),_0x1c1057,JSON[_0xc136('0x14')](_0x3478fb));_0xa3e411(_0x3478fb);})['catch'](function(_0x37cb75){logger[_0xc136('0x16')]('AddTags',_0x37cb75[_0xc136('0x18')],_0x1c1057);_0x5f3027(_this[_0xc136('0x16')](0x1f4,_0x37cb75['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b9412db..956c583 100644 --- a/server/api/mailInteraction/mailInteraction.socket.js +++ b/server/api/mailInteraction/mailInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eee=['mailInteraction:','./mailInteraction.events','remove','update','emit'];(function(_0x22afc9,_0xd3633a){var _0x50e77f=function(_0x249465){while(--_0x249465){_0x22afc9['push'](_0x22afc9['shift']());}};_0x50e77f(++_0xd3633a);}(_0x0eee,0x114));var _0xe0ee=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x0eee[_0x34bc6c];return _0x168820;};'use strict';var MailInteractionEvents=require(_0xe0ee('0x0'));var events=['save',_0xe0ee('0x1'),_0xe0ee('0x2')];function createListener(_0x44e92e,_0x2eb78b){return function(_0x4a0848){_0x2eb78b[_0xe0ee('0x3')](_0x44e92e,_0x4a0848);};}function removeListener(_0x246078,_0x5b90fa){return function(){MailInteractionEvents['removeListener'](_0x246078,_0x5b90fa);};}exports['register']=function(_0x49f26f){for(var _0x4af997=0x0,_0x38b2d7=events['length'];_0x4af997<_0x38b2d7;_0x4af997++){var _0x1ce3b5=events[_0x4af997];var _0xa90d78=createListener(_0xe0ee('0x4')+_0x1ce3b5,_0x49f26f);MailInteractionEvents['on'](_0x1ce3b5,_0xa90d78);}}; \ No newline at end of file +var _0xcc82=['length','mailInteraction:','save','remove','update','removeListener','register'];(function(_0x277fda,_0x57df6e){var _0x34475a=function(_0x164c2d){while(--_0x164c2d){_0x277fda['push'](_0x277fda['shift']());}};_0x34475a(++_0x57df6e);}(_0xcc82,0x175));var _0x2cc8=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0xcc82[_0x96f74c];return _0x379222;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2cc8('0x0'),_0x2cc8('0x1'),_0x2cc8('0x2')];function createListener(_0x4904f3,_0x3007ef){return function(_0x480a1a){_0x3007ef['emit'](_0x4904f3,_0x480a1a);};}function removeListener(_0xb6a960,_0x30fd47){return function(){MailInteractionEvents[_0x2cc8('0x3')](_0xb6a960,_0x30fd47);};}exports[_0x2cc8('0x4')]=function(_0x479502){for(var _0x8d1e8f=0x0,_0x497f8d=events[_0x2cc8('0x5')];_0x8d1e8f<_0x497f8d;_0x8d1e8f++){var _0x430498=events[_0x8d1e8f];var _0x2d12fa=createListener(_0x2cc8('0x6')+_0x430498,_0x479502);MailInteractionEvents['on'](_0x430498,_0x2d12fa);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 68435e4..7b37535 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6d6=['mailmessage:create','update','put','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','/:id/download','download','post','mail'];(function(_0xc5462a,_0x40e2e9){var _0x7d0b67=function(_0x2cd8a0){while(--_0x2cd8a0){_0xc5462a['push'](_0xc5462a['shift']());}};_0x7d0b67(++_0x40e2e9);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x7e6a44,_0x479c65){_0x7e6a44=_0x7e6a44-0x0;var _0x195fbf=_0xd6d6[_0x7e6a44];return _0x195fbf;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var auth=require(_0x6d6d('0x5'));var interaction=require(_0x6d6d('0x6'));var config=require(_0x6d6d('0x7'));var controller=require(_0x6d6d('0x8'));router[_0x6d6d('0x9')]('/',auth[_0x6d6d('0xa')](),controller['index']);router[_0x6d6d('0x9')](_0x6d6d('0xb'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xc')]);router[_0x6d6d('0x9')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['show']);router['get'](_0x6d6d('0xe'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xf')]);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xa')](),interaction['tracked'](_0x6d6d('0x11'),_0x6d6d('0x12')),controller['create']);router['put'](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')](_0x6d6d('0x15'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x16')]);router[_0x6d6d('0x14')]('/:id/reject',auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x17')]);router[_0x6d6d('0x18')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['destroy']);module[_0x6d6d('0x19')]=router; \ No newline at end of file +var _0x24ca=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','update','put','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x470f1d,_0x349204){var _0x552f1c=function(_0x218c46){while(--_0x218c46){_0x470f1d['push'](_0x470f1d['shift']());}};_0x552f1c(++_0x349204);}(_0x24ca,0x1bc));var _0xa24c=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0x24ca[_0xf10840];return _0x1fdf7e;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var auth=require(_0xa24c('0x4'));var interaction=require(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var controller=require(_0xa24c('0x7'));router[_0xa24c('0x8')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x8')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xc')]);router['get'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router['get'](_0xa24c('0xf'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x10')]);router[_0xa24c('0x11')]('/',auth[_0xa24c('0x9')](),interaction[_0xa24c('0x12')](_0xa24c('0x13'),_0xa24c('0x14')),controller[_0xa24c('0x15')]);router['put'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x16')]);router[_0xa24c('0x17')]('/:id/accept',auth[_0xa24c('0x9')](),controller[_0xa24c('0x18')]);router[_0xa24c('0x17')](_0xa24c('0x19'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x1a')]);router[_0xa24c('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xa24c('0x1c')]);module[_0xa24c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index da59fdf..d6a2c65 100644 --- a/server/api/mailMessage/mailMessage.attributes.js +++ b/server/api/mailMessage/mailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0a3=['medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','lodash','exports','long','TEXT'];(function(_0x1e549a,_0x2b7c39){var _0x17931f=function(_0x3b9f5c){while(--_0x3b9f5c){_0x1e549a['push'](_0x1e549a['shift']());}};_0x17931f(++_0x2b7c39);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x3ec1c2,_0x233cb7){_0x3ec1c2=_0x3ec1c2-0x0;var _0x36d421=_0xa0a3[_0x3ec1c2];return _0x36d421;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3a0a('0x0'));module[_0x3a0a('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3a0a('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x3a0a('0x3')](_0x3a0a('0x4'))},'read':{'type':Sequelize[_0x3a0a('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3a0a('0x6')]('in',_0x3a0a('0x7')),'defaultValue':_0x3a0a('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3a0a('0x8')](0x1fe)},'from':{'type':Sequelize[_0x3a0a('0x8')]},'to':{'type':Sequelize[_0x3a0a('0x3')](_0x3a0a('0x2'))},'cc':{'type':Sequelize[_0x3a0a('0x3')](_0x3a0a('0x2'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x3a0a('0x3')]},'sentAt':{'type':Sequelize[_0x3a0a('0x9')]},'attach':{'type':Sequelize[_0x3a0a('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3a0a('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3a0a('0x9')]},'originTo':{'type':Sequelize[_0x3a0a('0x3')](_0x3a0a('0x2'))},'originCc':{'type':Sequelize['TEXT']('long')}}; \ No newline at end of file +var _0x288a=['BOOLEAN','out','STRING','DATE','INTEGER','lodash','exports','TEXT','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x288a,0x188));var _0xa288=function(_0x36280c,_0x212f07){_0x36280c=_0x36280c-0x0;var _0x59e914=_0x288a[_0x36280c];return _0x59e914;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa288('0x0'));module[_0xa288('0x1')]={'body':{'type':Sequelize[_0xa288('0x2')](_0xa288('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xa288('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa288('0x5')),'defaultValue':_0xa288('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa288('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xa288('0x2')](_0xa288('0x3'))},'cc':{'type':Sequelize[_0xa288('0x2')]('long')},'bcc':{'type':Sequelize[_0xa288('0x2')](_0xa288('0x3'))},'subject':{'type':Sequelize[_0xa288('0x2')]},'sentAt':{'type':Sequelize[_0xa288('0x7')]},'attach':{'type':Sequelize[_0xa288('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xa288('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xa288('0x7')]},'originTo':{'type':Sequelize[_0xa288('0x2')]('long')},'originCc':{'type':Sequelize['TEXT']('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 84117f7..8de1c87 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf8e=['CmContact','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','Contacts','ListId','SendMail','sendMail','messageId','format','mail-interactions','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','read1stAt','interaction','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','server','tmp','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','err','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','count','offset','Content-Range','reject','destroy','end','stack','name','send','MailMessage','fieldName','key','model','map','query','keys','intersection','fields','length','nolimit','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','rawAttributes','attributes','include','find','update','body','params','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List'];(function(_0xe36de8,_0x498a95){var _0x1ffd45=function(_0x4a18c1){while(--_0x4a18c1){_0xe36de8['push'](_0xe36de8['shift']());}};_0x1ffd45(++_0x498a95);}(_0xcf8e,0x196));var _0xecf8=function(_0x32289e,_0x143a9d){_0x32289e=_0x32289e-0x0;var _0x496d3a=_0xcf8e[_0x32289e];return _0x496d3a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xecf8('0x0'));var rimraf=require(_0xecf8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xecf8('0x2'));var moment=require(_0xecf8('0x3'));var BPromise=require(_0xecf8('0x4'));var Mustache=require(_0xecf8('0x5'));var util=require(_0xecf8('0x6'));var path=require(_0xecf8('0x7'));var sox=require(_0xecf8('0x8'));var csv=require(_0xecf8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xecf8('0xa'));var squel=require(_0xecf8('0xb'));var crypto=require(_0xecf8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xecf8('0x9'));var querystring=require(_0xecf8('0xd'));var Papa=require(_0xecf8('0xe'));var Redis=require(_0xecf8('0xf'));var authService=require(_0xecf8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xecf8('0x11'));var hardwareService=require(_0xecf8('0x12'));var logger=require(_0xecf8('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xecf8('0x14'));var db=require(_0xecf8('0x15'))['db'];config[_0xecf8('0x16')]=_[_0xecf8('0x17')](config[_0xecf8('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xecf8('0x18'))(new Redis(config[_0xecf8('0x16')]));require(_0xecf8('0x19'))['register'](socket);var jayson=require(_0xecf8('0x1a'));var client=jayson[_0xecf8('0x1b')][_0xecf8('0x1c')]({'port':0x232c});var client9003=jayson[_0xecf8('0x1b')][_0xecf8('0x1c')]({'port':0x232b});var client9002=jayson[_0xecf8('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x230ae6,_0x21dcb3,_0x2ab3c3){if(_0x2ab3c3){var _0x114776=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x114776[_0xecf8('0x1d')](_0x21dcb3)){return _0x230ae6;}else{throw new db[(_0xecf8('0x1e'))][(_0xecf8('0x1f'))](_0xecf8('0x20'));}}else{return _0x230ae6;}}function respondWithRpcPromise(_0x1fec35,_0xca2ebd,_0x29c724,_0x5dccff){return new BPromise(function(_0x5c0a4c,_0x4095a2){var _0x450d52=_0x5dccff||client;return _0x450d52['request'](_0x1fec35,_0x29c724)[_0xecf8('0x21')](function(_0x119ccc){logger['info']('MailMessage,\x20%s,\x20%s',_0xca2ebd,_0xecf8('0x22'));logger[_0xecf8('0x23')]('MailMessage,\x20%s,\x20%s,\x20%s',_0xca2ebd,'request\x20sent',JSON[_0xecf8('0x24')](_0x119ccc));if(_0x119ccc[_0xecf8('0x25')]){if(_0x119ccc['error'][_0xecf8('0x26')]===0x1f4){logger[_0xecf8('0x25')](_0xecf8('0x27'),_0xca2ebd,_0x119ccc['error'][_0xecf8('0x28')]);return _0x4095a2(_0x119ccc['error'][_0xecf8('0x28')]);}logger[_0xecf8('0x25')](_0xecf8('0x27'),_0xca2ebd,_0x119ccc[_0xecf8('0x25')][_0xecf8('0x28')]);return _0x5c0a4c(_0x119ccc[_0xecf8('0x25')][_0xecf8('0x28')]);}else{logger[_0xecf8('0x29')](_0xecf8('0x27'),_0xca2ebd,_0xecf8('0x22'));_0x5c0a4c(_0x119ccc[_0xecf8('0x2a')][_0xecf8('0x28')]);}})[_0xecf8('0x2b')](function(_0x243fb0){logger[_0xecf8('0x25')]('MailMessage,\x20%s,\x20%s',_0xca2ebd,_0x243fb0);_0x4095a2(_0x243fb0);});});}function respondWithStatusCode(_0x1628ce,_0x43e1e0){_0x43e1e0=_0x43e1e0||0xcc;return function(_0x821334){if(_0x821334){return _0x1628ce[_0xecf8('0x2c')](_0x43e1e0);}return _0x1628ce['status'](_0x43e1e0)['end']();};}function respondWithResult(_0x3bf4b6,_0x781c02){_0x781c02=_0x781c02||0xc8;return function(_0x18a80d){if(_0x18a80d){return _0x3bf4b6[_0xecf8('0x2d')](_0x781c02)[_0xecf8('0x2e')](_0x18a80d);}};}function respondWithFilteredResult(_0x5a4ae3,_0x324cc8){return function(_0x40954c){if(_0x40954c){var _0x4af32b=_0x40954c[_0xecf8('0x2f')],_0x4ddd46=_0x324cc8[_0xecf8('0x30')],_0x10afa2=_0x324cc8[_0xecf8('0x30')]+_0x324cc8['limit'],_0x19fec8;if(_0x10afa2>=_0x4af32b){_0x10afa2=_0x4af32b;_0x19fec8=0xc8;}else{_0x19fec8=0xce;}_0x5a4ae3['status'](_0x19fec8);return _0x5a4ae3['set'](_0xecf8('0x31'),_0x4ddd46+'-'+_0x10afa2+'/'+_0x4af32b)['json'](_0x40954c);}return null;};}function patchUpdates(_0x3be1e2){return function(_0x87b20a){try{jsonpatch['apply'](_0x87b20a,_0x3be1e2,!![]);}catch(_0x21d596){return BPromise[_0xecf8('0x32')](_0x21d596);}return _0x87b20a['save']();};}function saveUpdates(_0x14983f,_0x33a75a){return function(_0x1ca063){if(_0x1ca063){return _0x1ca063['update'](_0x14983f)[_0xecf8('0x21')](function(_0xe36240){return _0xe36240;});}return null;};}function removeEntity(_0x2cefaf,_0x4f650b){return function(_0x180b1f){if(_0x180b1f){return _0x180b1f[_0xecf8('0x33')]()['then'](function(){_0x2cefaf[_0xecf8('0x2d')](0xcc)[_0xecf8('0x34')]();});}};}function handleEntityNotFound(_0x5c06f3,_0x100cb7){return function(_0x1ab094){if(!_0x1ab094){_0x5c06f3[_0xecf8('0x2c')](0x194);}return _0x1ab094;};}function handleError(_0x596e86,_0x4d94fd){_0x4d94fd=_0x4d94fd||0x1f4;return function(_0x4cf688){logger[_0xecf8('0x25')](_0x4cf688[_0xecf8('0x35')]);if(_0x4cf688[_0xecf8('0x36')]){delete _0x4cf688[_0xecf8('0x36')];}_0x596e86[_0xecf8('0x2d')](_0x4d94fd)[_0xecf8('0x37')](_0x4cf688);};}exports['index']=function(_0x4792e6,_0x41cc4b){var _0x3466ed={},_0x2c3eea={},_0x56d2e5={'count':0x0,'rows':[]};var _0x44adfc=_['map'](db[_0xecf8('0x38')]['rawAttributes'],function(_0x57979e){return{'name':_0x57979e[_0xecf8('0x39')],'type':_0x57979e['type'][_0xecf8('0x3a')]};});_0x2c3eea[_0xecf8('0x3b')]=_[_0xecf8('0x3c')](_0x44adfc,'name');_0x2c3eea[_0xecf8('0x3d')]=_[_0xecf8('0x3e')](_0x4792e6['query']);_0x2c3eea['filters']=_[_0xecf8('0x3f')](_0x2c3eea[_0xecf8('0x3b')],_0x2c3eea[_0xecf8('0x3d')]);_0x3466ed['attributes']=_[_0xecf8('0x3f')](_0x2c3eea['model'],qs[_0xecf8('0x40')](_0x4792e6[_0xecf8('0x3d')][_0xecf8('0x40')]));_0x3466ed['attributes']=_0x3466ed['attributes'][_0xecf8('0x41')]?_0x3466ed['attributes']:_0x2c3eea['model'];if(!_0x4792e6['query']['hasOwnProperty'](_0xecf8('0x42'))){_0x3466ed[_0xecf8('0x43')]=qs[_0xecf8('0x43')](_0x4792e6[_0xecf8('0x3d')][_0xecf8('0x43')]);_0x3466ed['offset']=qs['offset'](_0x4792e6[_0xecf8('0x3d')]['offset']);}_0x3466ed[_0xecf8('0x44')]=qs[_0xecf8('0x45')](_0x4792e6['query'][_0xecf8('0x45')]);_0x3466ed[_0xecf8('0x46')]=qs['filters'](_['pick'](_0x4792e6[_0xecf8('0x3d')],_0x2c3eea[_0xecf8('0x47')]));if(_0x4792e6[_0xecf8('0x3d')][_0xecf8('0x48')]){_0x3466ed[_0xecf8('0x46')]=_[_0xecf8('0x49')](_0x3466ed['where'],{'$or':_[_0xecf8('0x3c')](_0x44adfc,function(_0x452d2e){if(_0x452d2e[_0xecf8('0x4a')]!==_0xecf8('0x4b')){var _0x389c94={};_0x389c94[_0x452d2e['name']]={'$like':'%'+_0x4792e6['query'][_0xecf8('0x48')]+'%'};return _0x389c94;}})});}_0x3466ed=_[_0xecf8('0x49')]({},_0x3466ed,_0x4792e6[_0xecf8('0x4c')]);var _0x253f6f={'where':_0x3466ed['where']};return db[_0xecf8('0x38')][_0xecf8('0x2f')](_0x253f6f)[_0xecf8('0x21')](function(_0x6977b2){_0x56d2e5[_0xecf8('0x2f')]=_0x6977b2;if(_0x4792e6[_0xecf8('0x3d')][_0xecf8('0x4d')]){_0x3466ed['include']=[{'all':!![]}];}return db[_0xecf8('0x38')][_0xecf8('0x4e')](_0x3466ed);})[_0xecf8('0x21')](function(_0x5a7aed){_0x56d2e5['rows']=_0x5a7aed;return _0x56d2e5;})[_0xecf8('0x21')](respondWithFilteredResult(_0x41cc4b,_0x3466ed))[_0xecf8('0x2b')](handleError(_0x41cc4b,null));};exports[_0xecf8('0x4f')]=function(_0x3e8e95,_0x22783e){var _0x131a76={'raw':!![],'where':{'id':_0x3e8e95['params']['id']}},_0x1dbd6e={};_0x1dbd6e[_0xecf8('0x3b')]=_['keys'](db[_0xecf8('0x38')][_0xecf8('0x50')]);_0x1dbd6e[_0xecf8('0x3d')]=_[_0xecf8('0x3e')](_0x3e8e95['query']);_0x1dbd6e['filters']=_[_0xecf8('0x3f')](_0x1dbd6e[_0xecf8('0x3b')],_0x1dbd6e['query']);_0x131a76[_0xecf8('0x51')]=_[_0xecf8('0x3f')](_0x1dbd6e[_0xecf8('0x3b')],qs[_0xecf8('0x40')](_0x3e8e95[_0xecf8('0x3d')][_0xecf8('0x40')]));_0x131a76[_0xecf8('0x51')]=_0x131a76[_0xecf8('0x51')]['length']?_0x131a76[_0xecf8('0x51')]:_0x1dbd6e[_0xecf8('0x3b')];if(_0x3e8e95[_0xecf8('0x3d')][_0xecf8('0x4d')]){_0x131a76[_0xecf8('0x52')]=[{'all':!![]}];}_0x131a76=_['merge']({},_0x131a76,_0x3e8e95[_0xecf8('0x4c')]);return db[_0xecf8('0x38')][_0xecf8('0x53')](_0x131a76)[_0xecf8('0x21')](handleEntityNotFound(_0x22783e,null))[_0xecf8('0x21')](respondWithResult(_0x22783e,null))[_0xecf8('0x2b')](handleError(_0x22783e,null));};exports[_0xecf8('0x54')]=function(_0x320095,_0xa90d1e){if(_0x320095[_0xecf8('0x55')]['id']){delete _0x320095[_0xecf8('0x55')]['id'];}return db[_0xecf8('0x38')][_0xecf8('0x53')]({'where':{'id':_0x320095[_0xecf8('0x56')]['id']}})[_0xecf8('0x21')](handleEntityNotFound(_0xa90d1e,null))['then'](saveUpdates(_0x320095[_0xecf8('0x55')],null))[_0xecf8('0x21')](respondWithResult(_0xa90d1e,null))['catch'](handleError(_0xa90d1e,null));};exports[_0xecf8('0x33')]=function(_0x7adb56,_0x1b0585){return db[_0xecf8('0x38')][_0xecf8('0x53')]({'where':{'id':_0x7adb56['params']['id']}})[_0xecf8('0x21')](handleEntityNotFound(_0x1b0585,null))[_0xecf8('0x21')](removeEntity(_0x1b0585,null))[_0xecf8('0x2b')](handleError(_0x1b0585,null));};exports[_0xecf8('0x57')]=function(_0xa0cd17,_0x3619c9){return db[_0xecf8('0x38')][_0xecf8('0x57')]()['then'](respondWithResult(_0x3619c9,null))[_0xecf8('0x2b')](handleError(_0x3619c9,null));};exports[_0xecf8('0x58')]=function(_0x4ce2b6,_0x59e6d6){return db[_0xecf8('0x38')][_0xecf8('0x58')](_0x4ce2b6[_0xecf8('0x55')])['then'](function(_0x1593a0){if(_0x1593a0){if(_0x1593a0[_0xecf8('0x59')]===_0xecf8('0x5a')&&!_0x1593a0[_0xecf8('0x5b')]){var _0xc8dbbc,_0x19e553,_0xe0ea52;if(_0x4ce2b6['body']['to']){_0x19e553=_0x4ce2b6[_0xecf8('0x55')]['to'][_0xecf8('0x5c')](',')[0x0];}return db[_0xecf8('0x5d')][_0xecf8('0x5e')]({'where':{'id':_0x1593a0[_0xecf8('0x5f')]},'include':[{'model':db[_0xecf8('0x60')],'as':_0xecf8('0x61'),'include':[{'model':db[_0xecf8('0x62')],'as':'Contacts','where':{'email':_0x19e553},'limit':0x1,'order':[[_0xecf8('0x63'),'DESC']]}]},{'model':db[_0xecf8('0x64')],'as':_0xecf8('0x65'),'raw':!![]}]})[_0xecf8('0x21')](function(_0x4bb8fb){_0xc8dbbc=_0x4bb8fb;if(_0xc8dbbc&&_0xc8dbbc['Smtp']){var _0x434436={'tls':{'rejectUnauthorized':![]}};if(_[_0xecf8('0x66')](_0xc8dbbc[_0xecf8('0x65')][_0xecf8('0x67')])){_0x434436['host']=_0xc8dbbc[_0xecf8('0x65')][_0xecf8('0x68')];_0x434436['port']=_0xc8dbbc[_0xecf8('0x65')][_0xecf8('0x69')];_0x434436[_0xecf8('0x6a')]=_0xc8dbbc['Smtp'][_0xecf8('0x6a')];if(_0xc8dbbc[_0xecf8('0x65')][_0xecf8('0x6b')]){_0x434436[_0xecf8('0x6c')]={'user':_0xc8dbbc['Smtp'][_0xecf8('0x6d')],'pass':_0xc8dbbc['Smtp'][_0xecf8('0x6e')]};}}else{_0x434436['service']=_0xc8dbbc[_0xecf8('0x65')]['service'];_0x434436[_0xecf8('0x6c')]={'user':_0xc8dbbc[_0xecf8('0x65')]['user'],'pass':_0xc8dbbc[_0xecf8('0x65')][_0xecf8('0x6e')]};_0x434436[_0xecf8('0x6a')]=_0xc8dbbc['Smtp'][_0xecf8('0x6a')];}if(_0x4ce2b6[_0xecf8('0x55')]['attachments']&&_0x4ce2b6[_0xecf8('0x55')][_0xecf8('0x6f')][_0xecf8('0x41')]){for(var _0x213d33=0x0;_0x213d33<_0x4ce2b6[_0xecf8('0x55')][_0xecf8('0x6f')]['length'];_0x213d33+=0x1){_0x4ce2b6[_0xecf8('0x55')][_0xecf8('0x6f')][_0x213d33]={'filename':_0x4ce2b6[_0xecf8('0x55')][_0xecf8('0x6f')][_0x213d33][_0xecf8('0x36')],'path':path[_0xecf8('0x70')](config[_0xecf8('0x71')],_0xecf8('0x72'),_0x4ce2b6['body'][_0xecf8('0x6f')][_0x213d33][_0xecf8('0x73')])};}}_0xe0ea52={'account':_0x434436,'message':_0x4ce2b6['body']};return;}})['then'](function(){if(_0xc8dbbc[_0xecf8('0x61')]){if(_0xc8dbbc[_0xecf8('0x61')][_0xecf8('0x74')][_0xecf8('0x41')]){return _0xc8dbbc[_0xecf8('0x61')][_0xecf8('0x74')][0x0];}else{return db['CmContact'][_0xecf8('0x58')](_[_0xecf8('0x17')](_0x4ce2b6[_0xecf8('0x55')],{'firstName':_0x4ce2b6['body']['to'],'email':_0x4ce2b6['body']['to'],'phone':_0x4ce2b6[_0xecf8('0x55')]['to'],'ListId':_0xc8dbbc[_0xecf8('0x75')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xecf8('0x21')](function(){if(_0xe0ea52){return respondWithRpcPromise(_0xecf8('0x76'),_0xecf8('0x77'),_0xe0ea52,client9003)[_0xecf8('0x21')](function(_0x4c6914){return _0x1593a0[_0xecf8('0x54')]({'read':!![],'messageId':_0x4c6914[_0xecf8('0x78')],'sentAt':moment()[_0xecf8('0x79')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x5599c2){logger[_0xecf8('0x25')]('%s',JSON[_0xecf8('0x24')](_0x5599c2));return _0x1593a0;});}return _0x1593a0;});}return _0x1593a0;}})[_0xecf8('0x21')](respondWithResult(_0x59e6d6,0xc9))[_0xecf8('0x2b')](handleError(_0x59e6d6,null));};var interaction_log=require(_0xecf8('0x13'))(_0xecf8('0x7a'));exports[_0xecf8('0x7b')]=function(_0x3c7c52,_0x3b0f54,_0x4d79e4){var _0x457990={'channel':_0xecf8('0x7c')};if(_0x3c7c52[_0xecf8('0x55')]['id']){delete _0x3c7c52[_0xecf8('0x55')]['id'];}_0x3c7c52[_0xecf8('0x55')][_0xecf8('0x7d')]=!![];_0x3c7c52[_0xecf8('0x55')][_0xecf8('0x7e')]=moment()['format'](_0xecf8('0x7f'));_0x3c7c52['body'][_0xecf8('0x80')]=_0x3c7c52[_0xecf8('0x55')][_0xecf8('0x80')]||_0x3c7c52[_0xecf8('0x6d')]['id'];return db[_0xecf8('0x38')][_0xecf8('0x53')]({'where':{'id':_0x3c7c52['params']['id'],'UserId':null},'include':[{'model':db[_0xecf8('0x62')],'as':_0xecf8('0x81')}]})['then'](handleEntityNotFound(_0x3b0f54,null))[_0xecf8('0x21')](saveUpdates(_0x3c7c52[_0xecf8('0x55')],null))[_0xecf8('0x21')](function(_0x5d7ed9){if(_0x5d7ed9){_0x457990['message']=_0x5d7ed9[_0xecf8('0x82')]({'plain':!![]});return db[_0xecf8('0x83')][_0xecf8('0x53')]({'where':{'id':_0x5d7ed9['MailInteractionId']}});}return null;})[_0xecf8('0x21')](handleEntityNotFound(_0x3b0f54,null))[_0xecf8('0x21')](function(_0x19acf3){if(_0x19acf3){return _0x19acf3[_0xecf8('0x54')]({'UserId':_0x3c7c52[_0xecf8('0x55')]['UserId'],'read1stAt':_['isNil'](_0x19acf3[_0xecf8('0x84')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xecf8('0x21')](function(_0x506612){if(_0x506612){_0x457990[_0xecf8('0x85')]=_0x506612[_0xecf8('0x82')]({'plain':!![]});interaction_log[_0xecf8('0x29')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3c7c52[_0xecf8('0x6d')]['id'],_0x3c7c52[_0xecf8('0x6d')][_0xecf8('0x36')],_0x3c7c52[_0xecf8('0x6d')]['role'],_0x457990[_0xecf8('0x85')]['id'],_0x3c7c52[_0xecf8('0x55')]?JSON[_0xecf8('0x24')](_0x3c7c52['body']):_0xecf8('0x86'));return respondWithRpcPromise(_0xecf8('0x87'),_0xecf8('0x88'),_0x457990);}return null;})[_0xecf8('0x21')](function(_0x4d4830){if(_0x4d4830){if(_0x3c7c52[_0xecf8('0x55')][_0xecf8('0x89')]){_0x457990[_0xecf8('0x28')][_0xecf8('0x8a')]=util[_0xecf8('0x79')](_0xecf8('0x8b'),_0x3c7c52[_0xecf8('0x6d')]['name']);_0x457990[_0xecf8('0x28')][_0xecf8('0x8c')]=_0x457990[_0xecf8('0x8c')];_0x457990[_0xecf8('0x28')][_0xecf8('0x8d')]=_0xecf8('0x7b');return respondWithRpcPromise(_0xecf8('0x8e'),_0xecf8('0x8e'),{'event':_0xecf8('0x8f'),'message':_0x457990[_0xecf8('0x28')]},client9002)[_0xecf8('0x21')](function(){return _0x457990;});}return _0x457990;}return null;})[_0xecf8('0x21')](respondWithResult(_0x3b0f54,null))['catch'](handleError(_0x3b0f54,null));};var interaction_log=require('../../config/logger')(_0xecf8('0x7a'));exports[_0xecf8('0x32')]=function(_0x9c38c4,_0x35696a,_0x28dcdf){var _0x5dc32={'agent':{},'channel':'mail'};if(_0x9c38c4[_0xecf8('0x55')]['id']){delete _0x9c38c4[_0xecf8('0x55')]['id'];}_0x9c38c4[_0xecf8('0x55')]['UserId']=_0x9c38c4[_0xecf8('0x55')][_0xecf8('0x80')]||_0x9c38c4[_0xecf8('0x6d')]['id'];_0x5dc32['agent']['id']=_0x9c38c4[_0xecf8('0x55')]['UserId'];return db[_0xecf8('0x38')][_0xecf8('0x53')]({'where':{'id':_0x9c38c4[_0xecf8('0x56')]['id'],'UserId':null}})[_0xecf8('0x21')](handleEntityNotFound(_0x35696a,null))['then'](function(_0xc29e74){if(_0xc29e74){_0x5dc32[_0xecf8('0x28')]=_0xc29e74[_0xecf8('0x82')]({'plain':!![]});return db[_0xecf8('0x83')][_0xecf8('0x53')]({'where':{'id':_0xc29e74[_0xecf8('0x90')]}});}return null;})[_0xecf8('0x21')](handleEntityNotFound(_0x35696a,null))[_0xecf8('0x21')](function(_0x2c8b47){if(_0x2c8b47){_0x5dc32['interaction']=_0x2c8b47[_0xecf8('0x82')]({'plain':!![]});interaction_log[_0xecf8('0x29')](_0xecf8('0x91'),_0x9c38c4[_0xecf8('0x6d')]['id'],_0x9c38c4[_0xecf8('0x6d')][_0xecf8('0x36')],_0x9c38c4['user']['role'],_0x5dc32[_0xecf8('0x85')]['id'],_0x9c38c4[_0xecf8('0x55')]?JSON[_0xecf8('0x24')](_0x9c38c4[_0xecf8('0x55')]):_0xecf8('0x86'));return respondWithRpcPromise(_0xecf8('0x92'),_0xecf8('0x93'),_0x5dc32);}return null;})['then'](function(_0x430263){if(_0x430263){_0x430263[_0xecf8('0x28')]['interface']=util[_0xecf8('0x79')]('SIP/%s',_0x9c38c4[_0xecf8('0x6d')][_0xecf8('0x36')]);_0x430263['message'][_0xecf8('0x8c')]=_0x5dc32['channel'];_0x430263[_0xecf8('0x28')]['event']=_0xecf8('0x32');respondWithRpcPromise('EventManager',_0xecf8('0x8e'),{'event':_0xecf8('0x94'),'message':_0x430263['message']},client9002);return _0x5dc32;}return null;})[_0xecf8('0x21')](respondWithResult(_0x35696a,null))[_0xecf8('0x2b')](handleError(_0x35696a,null));};exports[_0xecf8('0x95')]=function(_0x4bc354,_0x387f2e){var _0x29dbd0=moment()[_0xecf8('0x96')]()[_0xecf8('0x97')]();var _0x219420=path[_0xecf8('0x70')](config['root'],_0xecf8('0x98'),'files',_0xecf8('0x99'));var _0x349ec2=path[_0xecf8('0x70')](config[_0xecf8('0x71')],_0xecf8('0x98'),_0xecf8('0x9a'),'attachments');var _0x16330b=util[_0xecf8('0x79')](_0xecf8('0x9b'),_0x29dbd0);return db['MailMessage'][_0xecf8('0x53')]({'where':{'id':_0x4bc354[_0xecf8('0x56')]['id']},'attributes':['id',_0xecf8('0x55'),_0xecf8('0x9c'),'to','cc',_0xecf8('0x9d'),_0xecf8('0x9e'),_0xecf8('0x9f')],'include':_0x4bc354[_0xecf8('0x3d')][_0xecf8('0x6f')]?[{'model':db[_0xecf8('0xa0')],'as':_0xecf8('0xa1')}]:undefined})[_0xecf8('0x21')](handleEntityNotFound(_0x387f2e,null))[_0xecf8('0x21')](function(_0x2fefc1){if(_0x2fefc1){var _0x8f848f=_0x2fefc1;var _0x45f222={'from':_0x8f848f['from'],'to':_0x8f848f['to'],'subject':_0x8f848f[_0xecf8('0x9e')],'html':_0x8f848f[_0xecf8('0x55')],'headers':{'Date':moment(_0x8f848f[_0xecf8('0x9f')])[_0xecf8('0x79')](_0xecf8('0xa2'))},'attachments':[]};if(_0x2fefc1['cc']){_0x45f222[_0xecf8('0xa3')]['Cc']=_0x2fefc1['cc'];}if(_0x2fefc1[_0xecf8('0x9d')]){_0x45f222[_0xecf8('0xa3')][_0xecf8('0xa4')]=_0x2fefc1['bcc'];}return new BPromise(function(_0x2e85d6,_0x1252eb){if(_0x2fefc1['Attachments']){for(var _0x280db2=0x0;_0x280db2<_0x2fefc1['Attachments'][_0xecf8('0x41')];_0x280db2++){var _0x3fe2cc=_0x2fefc1[_0xecf8('0xa1')][_0x280db2];var _0x89f6e7=path['join'](_0x349ec2,_0x3fe2cc[_0xecf8('0x73')]);if(fs['existsSync'](_0x89f6e7)){_0x45f222[_0xecf8('0x6f')][_0xecf8('0xa5')]({'name':_0x3fe2cc[_0xecf8('0x36')],'contentType':_0x3fe2cc[_0xecf8('0x4a')],'data':fs[_0xecf8('0xa6')](_0x89f6e7)});}}}emlformat['build'](_0x45f222,function(_0x203da7,_0x2d2a9c){if(_0x203da7)return _0x1252eb(_0x203da7);fs['writeFileSync'](path[_0xecf8('0x70')](_0x219420,_0x16330b),_0x2d2a9c);return _0x2e85d6(_0x2d2a9c);});});}})[_0xecf8('0x21')](function(_0x151565){if(_0x151565){return _0x387f2e[_0xecf8('0x95')](path[_0xecf8('0x70')](_0x219420,_0x16330b),_0x16330b,function(_0x5b106d){if(_0x5b106d){console['log'](_0xecf8('0xa7'),_0x5b106d);}else{fs['unlinkSync'](path['join'](_0x219420,_0x16330b));}});}})[_0xecf8('0x2b')](handleError(_0x387f2e,null));}; \ No newline at end of file +var _0xb48d=['interaction','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','download','unix','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','rows','show','params','includeAll','body','find','describe','create','direction','out','secret','split','MailAccount','findOne','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','join','root','server/files/attachments','basename','sendMail','format','stringify','mail-interactions','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','read1stAt','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb48d,0xcd));var _0xdb48=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xb48d[_0x525c7b];return _0x27b33e;};'use strict';var pdf=require(_0xdb48('0x0'));var emlformat=require(_0xdb48('0x1'));var rimraf=require(_0xdb48('0x2'));var zipdir=require(_0xdb48('0x3'));var jsonpatch=require(_0xdb48('0x4'));var rp=require(_0xdb48('0x5'));var moment=require(_0xdb48('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xdb48('0x7'));var util=require(_0xdb48('0x8'));var path=require(_0xdb48('0x9'));var sox=require(_0xdb48('0xa'));var csv=require(_0xdb48('0xb'));var ejs=require(_0xdb48('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb48('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdb48('0xe'));var toCsv=require(_0xdb48('0xb'));var querystring=require(_0xdb48('0xf'));var Papa=require(_0xdb48('0x10'));var Redis=require(_0xdb48('0x11'));var authService=require(_0xdb48('0x12'));var qs=require(_0xdb48('0x13'));var as=require(_0xdb48('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb48('0x15'))(_0xdb48('0x16'));var utils=require(_0xdb48('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xdb48('0x18')]=_[_0xdb48('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdb48('0x1a'))(new Redis(config[_0xdb48('0x18')]));require('./mailMessage.socket')[_0xdb48('0x1b')](socket);var jayson=require(_0xdb48('0x1c'));var client=jayson[_0xdb48('0x1d')][_0xdb48('0x1e')]({'port':0x232c});var client9003=jayson[_0xdb48('0x1d')]['http']({'port':0x232b});var client9002=jayson[_0xdb48('0x1d')][_0xdb48('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x20a506,_0x1b56ae,_0x4a100c){if(_0x4a100c){var _0x1cdc2b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cdc2b[_0xdb48('0x1f')](_0x1b56ae)){return _0x20a506;}else{throw new db[(_0xdb48('0x20'))][(_0xdb48('0x21'))](_0xdb48('0x22'));}}else{return _0x20a506;}}function respondWithRpcPromise(_0x9c6407,_0x4c28ed,_0x44cdc7,_0x534d55){return new BPromise(function(_0x139f89,_0x3eb6e4){var _0x5e7f7d=_0x534d55||client;return _0x5e7f7d['request'](_0x9c6407,_0x44cdc7)[_0xdb48('0x23')](function(_0xc64034){logger['info'](_0xdb48('0x24'),_0x4c28ed,_0xdb48('0x25'));logger[_0xdb48('0x26')](_0xdb48('0x27'),_0x4c28ed,_0xdb48('0x25'),JSON['stringify'](_0xc64034));if(_0xc64034[_0xdb48('0x28')]){if(_0xc64034[_0xdb48('0x28')][_0xdb48('0x29')]===0x1f4){logger[_0xdb48('0x28')](_0xdb48('0x24'),_0x4c28ed,_0xc64034['error']['message']);return _0x3eb6e4(_0xc64034[_0xdb48('0x28')][_0xdb48('0x2a')]);}logger[_0xdb48('0x28')](_0xdb48('0x24'),_0x4c28ed,_0xc64034[_0xdb48('0x28')]['message']);return _0x139f89(_0xc64034[_0xdb48('0x28')][_0xdb48('0x2a')]);}else{logger['info'](_0xdb48('0x24'),_0x4c28ed,_0xdb48('0x25'));_0x139f89(_0xc64034['result'][_0xdb48('0x2a')]);}})[_0xdb48('0x2b')](function(_0x781478){logger[_0xdb48('0x28')](_0xdb48('0x24'),_0x4c28ed,_0x781478);_0x3eb6e4(_0x781478);});});}function respondWithStatusCode(_0xa240d7,_0x4a0998){_0x4a0998=_0x4a0998||0xcc;return function(_0x2d6375){if(_0x2d6375){return _0xa240d7['sendStatus'](_0x4a0998);}return _0xa240d7[_0xdb48('0x2c')](_0x4a0998)[_0xdb48('0x2d')]();};}function respondWithResult(_0x555561,_0x516341){_0x516341=_0x516341||0xc8;return function(_0x3a58f2){if(_0x3a58f2){return _0x555561['status'](_0x516341)['json'](_0x3a58f2);}};}function respondWithFilteredResult(_0x42bc48,_0x367f61){return function(_0x1ba073){if(_0x1ba073){var _0x58db5a=_0x1ba073['count'],_0x2bceb3=_0x367f61['offset'],_0x518407=_0x367f61[_0xdb48('0x2e')]+_0x367f61[_0xdb48('0x2f')],_0x378ae8;if(_0x518407>=_0x58db5a){_0x518407=_0x58db5a;_0x378ae8=0xc8;}else{_0x378ae8=0xce;}_0x42bc48[_0xdb48('0x2c')](_0x378ae8);return _0x42bc48[_0xdb48('0x30')](_0xdb48('0x31'),_0x2bceb3+'-'+_0x518407+'/'+_0x58db5a)[_0xdb48('0x32')](_0x1ba073);}return null;};}function patchUpdates(_0x52cb84){return function(_0x209959){try{jsonpatch[_0xdb48('0x33')](_0x209959,_0x52cb84,!![]);}catch(_0x76d8de){return BPromise[_0xdb48('0x34')](_0x76d8de);}return _0x209959[_0xdb48('0x35')]();};}function saveUpdates(_0x58330f,_0x2fffce){return function(_0x44973c){if(_0x44973c){return _0x44973c[_0xdb48('0x36')](_0x58330f)[_0xdb48('0x23')](function(_0x5b1bd7){return _0x5b1bd7;});}return null;};}function removeEntity(_0xa416f0,_0x150877){return function(_0x55c818){if(_0x55c818){return _0x55c818[_0xdb48('0x37')]()[_0xdb48('0x23')](function(){_0xa416f0[_0xdb48('0x2c')](0xcc)[_0xdb48('0x2d')]();});}};}function handleEntityNotFound(_0x40608b,_0xddada5){return function(_0x318ae9){if(!_0x318ae9){_0x40608b['sendStatus'](0x194);}return _0x318ae9;};}function handleError(_0x4f8ecf,_0x100718){_0x100718=_0x100718||0x1f4;return function(_0x5aa4c1){logger['error'](_0x5aa4c1[_0xdb48('0x38')]);if(_0x5aa4c1[_0xdb48('0x39')]){delete _0x5aa4c1[_0xdb48('0x39')];}_0x4f8ecf[_0xdb48('0x2c')](_0x100718)[_0xdb48('0x3a')](_0x5aa4c1);};}exports[_0xdb48('0x3b')]=function(_0x2afec3,_0x4e66de){var _0xc1c66d={},_0x406866={},_0x4df26f={'count':0x0,'rows':[]};var _0x973402=_[_0xdb48('0x3c')](db[_0xdb48('0x3d')][_0xdb48('0x3e')],function(_0x3b3532){return{'name':_0x3b3532['fieldName'],'type':_0x3b3532[_0xdb48('0x3f')][_0xdb48('0x40')]};});_0x406866[_0xdb48('0x41')]=_[_0xdb48('0x3c')](_0x973402,_0xdb48('0x39'));_0x406866[_0xdb48('0x42')]=_[_0xdb48('0x43')](_0x2afec3[_0xdb48('0x42')]);_0x406866[_0xdb48('0x44')]=_['intersection'](_0x406866[_0xdb48('0x41')],_0x406866[_0xdb48('0x42')]);_0xc1c66d[_0xdb48('0x45')]=_['intersection'](_0x406866['model'],qs[_0xdb48('0x46')](_0x2afec3[_0xdb48('0x42')]['fields']));_0xc1c66d[_0xdb48('0x45')]=_0xc1c66d[_0xdb48('0x45')][_0xdb48('0x47')]?_0xc1c66d[_0xdb48('0x45')]:_0x406866[_0xdb48('0x41')];if(!_0x2afec3[_0xdb48('0x42')][_0xdb48('0x48')](_0xdb48('0x49'))){_0xc1c66d[_0xdb48('0x2f')]=qs[_0xdb48('0x2f')](_0x2afec3['query']['limit']);_0xc1c66d[_0xdb48('0x2e')]=qs[_0xdb48('0x2e')](_0x2afec3[_0xdb48('0x42')][_0xdb48('0x2e')]);}_0xc1c66d[_0xdb48('0x4a')]=qs[_0xdb48('0x4b')](_0x2afec3[_0xdb48('0x42')][_0xdb48('0x4b')]);_0xc1c66d[_0xdb48('0x4c')]=qs['filters'](_['pick'](_0x2afec3[_0xdb48('0x42')],_0x406866[_0xdb48('0x44')]));if(_0x2afec3[_0xdb48('0x42')][_0xdb48('0x4d')]){_0xc1c66d['where']=_[_0xdb48('0x4e')](_0xc1c66d['where'],{'$or':_[_0xdb48('0x3c')](_0x973402,function(_0x340af1){if(_0x340af1[_0xdb48('0x3f')]!==_0xdb48('0x4f')){var _0x1294df={};_0x1294df[_0x340af1[_0xdb48('0x39')]]={'$like':'%'+_0x2afec3['query'][_0xdb48('0x4d')]+'%'};return _0x1294df;}})});}_0xc1c66d=_[_0xdb48('0x4e')]({},_0xc1c66d,_0x2afec3[_0xdb48('0x50')]);var _0x36c043={'where':_0xc1c66d['where']};return db[_0xdb48('0x3d')][_0xdb48('0x51')](_0x36c043)[_0xdb48('0x23')](function(_0x5716d5){_0x4df26f[_0xdb48('0x51')]=_0x5716d5;if(_0x2afec3[_0xdb48('0x42')]['includeAll']){_0xc1c66d[_0xdb48('0x52')]=[{'all':!![]}];}return db[_0xdb48('0x3d')]['findAll'](_0xc1c66d);})[_0xdb48('0x23')](function(_0x4c2c42){_0x4df26f[_0xdb48('0x53')]=_0x4c2c42;return _0x4df26f;})[_0xdb48('0x23')](respondWithFilteredResult(_0x4e66de,_0xc1c66d))[_0xdb48('0x2b')](handleError(_0x4e66de,null));};exports[_0xdb48('0x54')]=function(_0x275c1a,_0x4b7033){var _0x4c975e={'raw':!![],'where':{'id':_0x275c1a[_0xdb48('0x55')]['id']}},_0x1ab9a3={};_0x1ab9a3['model']=_[_0xdb48('0x43')](db[_0xdb48('0x3d')][_0xdb48('0x3e')]);_0x1ab9a3['query']=_[_0xdb48('0x43')](_0x275c1a[_0xdb48('0x42')]);_0x1ab9a3[_0xdb48('0x44')]=_['intersection'](_0x1ab9a3[_0xdb48('0x41')],_0x1ab9a3[_0xdb48('0x42')]);_0x4c975e[_0xdb48('0x45')]=_['intersection'](_0x1ab9a3[_0xdb48('0x41')],qs[_0xdb48('0x46')](_0x275c1a[_0xdb48('0x42')][_0xdb48('0x46')]));_0x4c975e['attributes']=_0x4c975e[_0xdb48('0x45')][_0xdb48('0x47')]?_0x4c975e[_0xdb48('0x45')]:_0x1ab9a3['model'];if(_0x275c1a[_0xdb48('0x42')][_0xdb48('0x56')]){_0x4c975e[_0xdb48('0x52')]=[{'all':!![]}];}_0x4c975e=_['merge']({},_0x4c975e,_0x275c1a['options']);return db[_0xdb48('0x3d')]['find'](_0x4c975e)[_0xdb48('0x23')](handleEntityNotFound(_0x4b7033,null))[_0xdb48('0x23')](respondWithResult(_0x4b7033,null))[_0xdb48('0x2b')](handleError(_0x4b7033,null));};exports['update']=function(_0x30d1bd,_0x3fb487){if(_0x30d1bd[_0xdb48('0x57')]['id']){delete _0x30d1bd[_0xdb48('0x57')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x30d1bd['params']['id']}})['then'](handleEntityNotFound(_0x3fb487,null))['then'](saveUpdates(_0x30d1bd[_0xdb48('0x57')],null))['then'](respondWithResult(_0x3fb487,null))[_0xdb48('0x2b')](handleError(_0x3fb487,null));};exports['destroy']=function(_0x6839b3,_0x2f5acc){return db['MailMessage'][_0xdb48('0x58')]({'where':{'id':_0x6839b3['params']['id']}})[_0xdb48('0x23')](handleEntityNotFound(_0x2f5acc,null))[_0xdb48('0x23')](removeEntity(_0x2f5acc,null))[_0xdb48('0x2b')](handleError(_0x2f5acc,null));};exports[_0xdb48('0x59')]=function(_0x5f4281,_0x58526f){return db[_0xdb48('0x3d')][_0xdb48('0x59')]()[_0xdb48('0x23')](respondWithResult(_0x58526f,null))['catch'](handleError(_0x58526f,null));};exports[_0xdb48('0x5a')]=function(_0x57ac64,_0x526535){return db['MailMessage'][_0xdb48('0x5a')](_0x57ac64[_0xdb48('0x57')])[_0xdb48('0x23')](function(_0xf73f6f){if(_0xf73f6f){if(_0xf73f6f[_0xdb48('0x5b')]===_0xdb48('0x5c')&&!_0xf73f6f[_0xdb48('0x5d')]){var _0x598431,_0x579f3e,_0x3129f7;if(_0x57ac64[_0xdb48('0x57')]['to']){_0x579f3e=_0x57ac64[_0xdb48('0x57')]['to'][_0xdb48('0x5e')](',')[0x0];}return db[_0xdb48('0x5f')][_0xdb48('0x60')]({'where':{'id':_0xf73f6f['MailAccountId']},'include':[{'model':db['CmList'],'as':_0xdb48('0x61'),'include':[{'model':db[_0xdb48('0x62')],'as':_0xdb48('0x63'),'where':{'email':_0x579f3e},'limit':0x1,'order':[[_0xdb48('0x64'),_0xdb48('0x65')]]}]},{'model':db[_0xdb48('0x66')],'as':_0xdb48('0x67'),'raw':!![]}]})['then'](function(_0x1f440d){_0x598431=_0x1f440d;if(_0x598431&&_0x598431['Smtp']){var _0x1573cc={'tls':{'rejectUnauthorized':![]}};if(_[_0xdb48('0x68')](_0x598431['Smtp']['service'])){_0x1573cc[_0xdb48('0x69')]=_0x598431[_0xdb48('0x67')][_0xdb48('0x69')];_0x1573cc[_0xdb48('0x6a')]=_0x598431[_0xdb48('0x67')][_0xdb48('0x6a')];_0x1573cc[_0xdb48('0x6b')]=_0x598431[_0xdb48('0x67')][_0xdb48('0x6b')];if(_0x598431[_0xdb48('0x67')][_0xdb48('0x6c')]){_0x1573cc[_0xdb48('0x6d')]={'user':_0x598431[_0xdb48('0x67')][_0xdb48('0x6e')],'pass':_0x598431[_0xdb48('0x67')][_0xdb48('0x6f')]};}}else{_0x1573cc[_0xdb48('0x70')]=_0x598431[_0xdb48('0x67')]['service'];_0x1573cc[_0xdb48('0x6d')]={'user':_0x598431['Smtp'][_0xdb48('0x6e')],'pass':_0x598431[_0xdb48('0x67')][_0xdb48('0x6f')]};_0x1573cc['secure']=_0x598431[_0xdb48('0x67')]['secure'];}if(_0x57ac64[_0xdb48('0x57')]['attachments']&&_0x57ac64[_0xdb48('0x57')][_0xdb48('0x71')][_0xdb48('0x47')]){for(var _0x5075fd=0x0;_0x5075fd<_0x57ac64[_0xdb48('0x57')]['attachments']['length'];_0x5075fd+=0x1){_0x57ac64[_0xdb48('0x57')][_0xdb48('0x71')][_0x5075fd]={'filename':_0x57ac64['body'][_0xdb48('0x71')][_0x5075fd][_0xdb48('0x39')],'path':path[_0xdb48('0x72')](config[_0xdb48('0x73')],_0xdb48('0x74'),_0x57ac64[_0xdb48('0x57')]['attachments'][_0x5075fd][_0xdb48('0x75')])};}}_0x3129f7={'account':_0x1573cc,'message':_0x57ac64[_0xdb48('0x57')]};return;}})[_0xdb48('0x23')](function(){if(_0x598431[_0xdb48('0x61')]){if(_0x598431[_0xdb48('0x61')]['Contacts'][_0xdb48('0x47')]){return _0x598431[_0xdb48('0x61')]['Contacts'][0x0];}else{return db['CmContact'][_0xdb48('0x5a')](_['defaults'](_0x57ac64[_0xdb48('0x57')],{'firstName':_0x57ac64[_0xdb48('0x57')]['to'],'email':_0x57ac64[_0xdb48('0x57')]['to'],'phone':_0x57ac64[_0xdb48('0x57')]['to'],'ListId':_0x598431['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xdb48('0x23')](function(){if(_0x3129f7){return respondWithRpcPromise('SendMail',_0xdb48('0x76'),_0x3129f7,client9003)[_0xdb48('0x23')](function(_0x3d65b4){return _0xf73f6f[_0xdb48('0x36')]({'read':!![],'messageId':_0x3d65b4['messageId'],'sentAt':moment()[_0xdb48('0x77')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdb48('0x2b')](function(_0x2c9cec){logger[_0xdb48('0x28')]('%s',JSON[_0xdb48('0x78')](_0x2c9cec));return _0xf73f6f;});}return _0xf73f6f;});}return _0xf73f6f;}})[_0xdb48('0x23')](respondWithResult(_0x526535,0xc9))[_0xdb48('0x2b')](handleError(_0x526535,null));};var interaction_log=require(_0xdb48('0x15'))(_0xdb48('0x79'));exports[_0xdb48('0x7a')]=function(_0x5a7f22,_0x142ff5,_0x240651){var _0x2382cd={'channel':_0xdb48('0x7b')};if(_0x5a7f22['body']['id']){delete _0x5a7f22[_0xdb48('0x57')]['id'];}_0x5a7f22['body'][_0xdb48('0x7c')]=!![];_0x5a7f22[_0xdb48('0x57')][_0xdb48('0x7d')]=moment()[_0xdb48('0x77')](_0xdb48('0x7e'));_0x5a7f22[_0xdb48('0x57')][_0xdb48('0x7f')]=_0x5a7f22[_0xdb48('0x57')]['UserId']||_0x5a7f22[_0xdb48('0x6e')]['id'];return db[_0xdb48('0x3d')][_0xdb48('0x58')]({'where':{'id':_0x5a7f22[_0xdb48('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xdb48('0x62')],'as':_0xdb48('0x80')}]})[_0xdb48('0x23')](handleEntityNotFound(_0x142ff5,null))['then'](saveUpdates(_0x5a7f22[_0xdb48('0x57')],null))[_0xdb48('0x23')](function(_0x39179f){if(_0x39179f){_0x2382cd[_0xdb48('0x2a')]=_0x39179f[_0xdb48('0x81')]({'plain':!![]});return db[_0xdb48('0x82')][_0xdb48('0x58')]({'where':{'id':_0x39179f['MailInteractionId']}});}return null;})[_0xdb48('0x23')](handleEntityNotFound(_0x142ff5,null))[_0xdb48('0x23')](function(_0x2c1ca2){if(_0x2c1ca2){return _0x2c1ca2['update']({'UserId':_0x5a7f22[_0xdb48('0x57')][_0xdb48('0x7f')],'read1stAt':_[_0xdb48('0x68')](_0x2c1ca2[_0xdb48('0x83')])?moment()[_0xdb48('0x77')](_0xdb48('0x7e')):undefined});}return null;})[_0xdb48('0x23')](function(_0x473dcd){if(_0x473dcd){_0x2382cd['interaction']=_0x473dcd['get']({'plain':!![]});interaction_log[_0xdb48('0x84')](_0xdb48('0x85'),_0x5a7f22['user']['id'],_0x5a7f22[_0xdb48('0x6e')][_0xdb48('0x39')],_0x5a7f22[_0xdb48('0x6e')][_0xdb48('0x86')],_0x2382cd[_0xdb48('0x87')]['id'],_0x5a7f22[_0xdb48('0x57')]?JSON[_0xdb48('0x78')](_0x5a7f22[_0xdb48('0x57')]):_0xdb48('0x88'));return respondWithRpcPromise('AcceptMessage',_0xdb48('0x89'),_0x2382cd);}return null;})['then'](function(_0x596fab){if(_0x596fab){if(_0x5a7f22['body'][_0xdb48('0x8a')]){_0x2382cd[_0xdb48('0x2a')][_0xdb48('0x8b')]=util[_0xdb48('0x77')](_0xdb48('0x8c'),_0x5a7f22[_0xdb48('0x6e')][_0xdb48('0x39')]);_0x2382cd[_0xdb48('0x2a')][_0xdb48('0x8d')]=_0x2382cd[_0xdb48('0x8d')];_0x2382cd[_0xdb48('0x2a')][_0xdb48('0x8e')]=_0xdb48('0x7a');return respondWithRpcPromise(_0xdb48('0x8f'),_0xdb48('0x8f'),{'event':_0xdb48('0x90'),'message':_0x2382cd[_0xdb48('0x2a')]},client9002)[_0xdb48('0x23')](function(){return _0x2382cd;});}return _0x2382cd;}return null;})[_0xdb48('0x23')](respondWithResult(_0x142ff5,null))['catch'](handleError(_0x142ff5,null));};var interaction_log=require(_0xdb48('0x15'))('mail-interactions');exports[_0xdb48('0x34')]=function(_0x4742ac,_0x38adce,_0x66e7a4){var _0x228a1f={'agent':{},'channel':_0xdb48('0x7b')};if(_0x4742ac['body']['id']){delete _0x4742ac[_0xdb48('0x57')]['id'];}_0x4742ac[_0xdb48('0x57')][_0xdb48('0x7f')]=_0x4742ac[_0xdb48('0x57')][_0xdb48('0x7f')]||_0x4742ac['user']['id'];_0x228a1f[_0xdb48('0x91')]['id']=_0x4742ac[_0xdb48('0x57')][_0xdb48('0x7f')];return db['MailMessage'][_0xdb48('0x58')]({'where':{'id':_0x4742ac['params']['id'],'UserId':null}})[_0xdb48('0x23')](handleEntityNotFound(_0x38adce,null))[_0xdb48('0x23')](function(_0xdd0916){if(_0xdd0916){_0x228a1f['message']=_0xdd0916[_0xdb48('0x81')]({'plain':!![]});return db[_0xdb48('0x82')][_0xdb48('0x58')]({'where':{'id':_0xdd0916[_0xdb48('0x92')]}});}return null;})[_0xdb48('0x23')](handleEntityNotFound(_0x38adce,null))[_0xdb48('0x23')](function(_0x23640f){if(_0x23640f){_0x228a1f[_0xdb48('0x87')]=_0x23640f[_0xdb48('0x81')]({'plain':!![]});interaction_log[_0xdb48('0x84')](_0xdb48('0x93'),_0x4742ac[_0xdb48('0x6e')]['id'],_0x4742ac['user'][_0xdb48('0x39')],_0x4742ac['user'][_0xdb48('0x86')],_0x228a1f[_0xdb48('0x87')]['id'],_0x4742ac[_0xdb48('0x57')]?JSON[_0xdb48('0x78')](_0x4742ac[_0xdb48('0x57')]):'null');return respondWithRpcPromise(_0xdb48('0x94'),_0xdb48('0x95'),_0x228a1f);}return null;})[_0xdb48('0x23')](function(_0x36f3e0){if(_0x36f3e0){_0x36f3e0[_0xdb48('0x2a')][_0xdb48('0x8b')]=util[_0xdb48('0x77')]('SIP/%s',_0x4742ac['user']['name']);_0x36f3e0['message'][_0xdb48('0x8d')]=_0x228a1f[_0xdb48('0x8d')];_0x36f3e0['message']['event']=_0xdb48('0x34');respondWithRpcPromise(_0xdb48('0x8f'),_0xdb48('0x8f'),{'event':'rejectmessage','message':_0x36f3e0['message']},client9002);return _0x228a1f;}return null;})[_0xdb48('0x23')](respondWithResult(_0x38adce,null))[_0xdb48('0x2b')](handleError(_0x38adce,null));};exports[_0xdb48('0x96')]=function(_0x2c8058,_0x2f4803){var _0x11b998=moment()[_0xdb48('0x97')]()['toString']();var _0x150fd4=path[_0xdb48('0x72')](config[_0xdb48('0x73')],_0xdb48('0x98'),_0xdb48('0x99'),'tmp');var _0x381d49=path[_0xdb48('0x72')](config[_0xdb48('0x73')],_0xdb48('0x98'),_0xdb48('0x99'),_0xdb48('0x71'));var _0x7dd4da=util[_0xdb48('0x77')](_0xdb48('0x9a'),_0x11b998);return db[_0xdb48('0x3d')]['find']({'where':{'id':_0x2c8058[_0xdb48('0x55')]['id']},'attributes':['id','body',_0xdb48('0x9b'),'to','cc',_0xdb48('0x9c'),_0xdb48('0x9d'),_0xdb48('0x9e')],'include':_0x2c8058[_0xdb48('0x42')]['attachments']?[{'model':db[_0xdb48('0x9f')],'as':'Attachments'}]:undefined})[_0xdb48('0x23')](handleEntityNotFound(_0x2f4803,null))[_0xdb48('0x23')](function(_0x36878){if(_0x36878){var _0x5ee808=_0x36878;var _0xe8ee4e={'from':_0x5ee808[_0xdb48('0x9b')],'to':_0x5ee808['to'],'subject':_0x5ee808['subject'],'html':_0x5ee808[_0xdb48('0x57')],'headers':{'Date':moment(_0x5ee808[_0xdb48('0x9e')])[_0xdb48('0x77')](_0xdb48('0xa0'))},'attachments':[]};if(_0x36878['cc']){_0xe8ee4e[_0xdb48('0xa1')]['Cc']=_0x36878['cc'];}if(_0x36878[_0xdb48('0x9c')]){_0xe8ee4e[_0xdb48('0xa1')][_0xdb48('0xa2')]=_0x36878['bcc'];}return new BPromise(function(_0x4c33a2,_0x49f029){if(_0x36878[_0xdb48('0xa3')]){for(var _0x14f4b6=0x0;_0x14f4b6<_0x36878[_0xdb48('0xa3')][_0xdb48('0x47')];_0x14f4b6++){var _0x6dc405=_0x36878[_0xdb48('0xa3')][_0x14f4b6];var _0x95e987=path[_0xdb48('0x72')](_0x381d49,_0x6dc405['basename']);if(fs[_0xdb48('0xa4')](_0x95e987)){_0xe8ee4e[_0xdb48('0x71')]['push']({'name':_0x6dc405[_0xdb48('0x39')],'contentType':_0x6dc405[_0xdb48('0x3f')],'data':fs[_0xdb48('0xa5')](_0x95e987)});}}}emlformat[_0xdb48('0xa6')](_0xe8ee4e,function(_0x2b20ec,_0x56559){if(_0x2b20ec)return _0x49f029(_0x2b20ec);fs['writeFileSync'](path[_0xdb48('0x72')](_0x150fd4,_0x7dd4da),_0x56559);return _0x4c33a2(_0x56559);});});}})[_0xdb48('0x23')](function(_0x230d96){if(_0x230d96){return _0x2f4803[_0xdb48('0x96')](path[_0xdb48('0x72')](_0x150fd4,_0x7dd4da),_0x7dd4da,function(_0x294427){if(_0x294427){console[_0xdb48('0xa7')](_0xdb48('0xa8'),_0x294427);}else{fs[_0xdb48('0xa9')](path[_0xdb48('0x72')](_0x150fd4,_0x7dd4da));}});}})[_0xdb48('0x2b')](handleError(_0x2f4803,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index b3bc0f6..918c5e6 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe73e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xe73e,0x1ee));var _0xee73=function(_0x44e16c,_0x549736){_0x44e16c=_0x44e16c-0x0;var _0x3924ac=_0xe73e[_0x44e16c];return _0x3924ac;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xee73('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xee73('0x1')](0x0);var events={'afterCreate':_0xee73('0x2'),'afterUpdate':_0xee73('0x3'),'afterDestroy':_0xee73('0x4')};function emitEvent(_0x7fd433){return function(_0x5bbdd9,_0x4db308,_0x53cf41){MailMessageEvents[_0xee73('0x5')](_0x7fd433+':'+_0x5bbdd9['id'],_0x5bbdd9);MailMessageEvents[_0xee73('0x5')](_0x7fd433,_0x5bbdd9);_0x53cf41(null);};}for(var e in events){if(events[_0xee73('0x6')](e)){var event=events[e];MailMessage[_0xee73('0x7')](e,emitEvent(event));}}module[_0xee73('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xf50f=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5251f0,_0xc08e2d){var _0x31ff23=function(_0x3f0419){while(--_0x3f0419){_0x5251f0['push'](_0x5251f0['shift']());}};_0x31ff23(++_0xc08e2d);}(_0xf50f,0x147));var _0xff50=function(_0x561917,_0x27147f){_0x561917=_0x561917-0x0;var _0x17ce4f=_0xf50f[_0x561917];return _0x17ce4f;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xff50('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xff50('0x1')](0x0);var events={'afterCreate':_0xff50('0x2'),'afterUpdate':'update','afterDestroy':_0xff50('0x3')};function emitEvent(_0x5dd83a){return function(_0x5bdd7b,_0x39f296,_0x241dc3){MailMessageEvents['emit'](_0x5dd83a+':'+_0x5bdd7b['id'],_0x5bdd7b);MailMessageEvents[_0xff50('0x4')](_0x5dd83a,_0x5bdd7b);_0x241dc3(null);};}for(var e in events){if(events[_0xff50('0x5')](e)){var event=events[e];MailMessage[_0xff50('0x6')](e,emitEvent(event));}}module[_0xff50('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 436c1df..63c72e8 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x339c=['MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','moment','html-to-text','path','rimraf','./mailMessage.attributes','exports','define'];(function(_0x31e3d5,_0x3fa1cd){var _0x4da910=function(_0x5dc244){while(--_0x5dc244){_0x31e3d5['push'](_0x31e3d5['shift']());}};_0x4da910(++_0x3fa1cd);}(_0x339c,0xc2));var _0xc339=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x339c[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xc339('0x0'));var util=require(_0xc339('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc339('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0xc339('0x3'));var fs=require('fs');var path=require(_0xc339('0x4'));var rimraf=require(_0xc339('0x5'));var config=require('../../config/environment');var attributes=require(_0xc339('0x6'));module[_0xc339('0x7')]=function(_0x345c48,_0x4974ab){return _0x345c48[_0xc339('0x8')](_0xc339('0x9'),attributes,{'tableName':_0xc339('0xa'),'paranoid':![],'indexes':[{'name':_0xc339('0xb'),'fields':[_0xc339('0xb')]},{'name':_0xc339('0xc'),'fields':[_0xc339('0xd'),'subject'],'type':_0xc339('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x395da4,_0x150334,_0x5bb493){if(_0x395da4[_0xc339('0xf')]){_0x395da4[_0xc339('0xd')]=htmlToText['fromString'](_0x395da4[_0xc339('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5bb493(null,_0x150334);},'afterCreate':function(_0x141abc,_0x1403ab,_0x405328){var _0x2b8bf1=_0x345c48[_0xc339('0x10')];var _0x56bcda=_0x141abc[_0xc339('0x11')]({'plain':!![]});if(_0x56bcda[_0xc339('0x12')][_0xc339('0x13')]()==='in'||_0x56bcda['direction'][_0xc339('0x13')]()==='out'&&!_0x56bcda['secret']&&!_['isNil'](_0x56bcda[_0xc339('0x14')])){_0x2b8bf1[_0xc339('0x15')][_0xc339('0x16')]({'where':{'id':_0x56bcda[_0xc339('0x17')]}})[_0xc339('0x18')](function(_0x123382){if(_0x123382){_0x123382[_0xc339('0x19')]({'lastMsgAt':_0x56bcda[_0xc339('0x1a')],'lastMsgDirection':_0x56bcda[_0xc339('0x12')][_0xc339('0x13')](),'lastMsgBody':_0x56bcda[_0xc339('0xf')]});}})['catch'](function(_0x50ecd1){console[_0xc339('0x1b')](_0x50ecd1);});}_0x405328();}},'charset':_0xc339('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xcd55=['MailInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','fromString','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne'];(function(_0xf230c7,_0x50fb7c){var _0x5a47f6=function(_0x4e5e5e){while(--_0x4e5e5e){_0xf230c7['push'](_0xf230c7['shift']());}};_0x5a47f6(++_0x50fb7c);}(_0xcd55,0x132));var _0x5cd5=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xcd55[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x5cd5('0x0'));var util=require(_0x5cd5('0x1'));var logger=require(_0x5cd5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5cd5('0x3'));var rp=require(_0x5cd5('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x5cd5('0x5'));var rimraf=require(_0x5cd5('0x6'));var config=require(_0x5cd5('0x7'));var attributes=require('./mailMessage.attributes');module[_0x5cd5('0x8')]=function(_0x2a7563,_0x1c5391){return _0x2a7563['define'](_0x5cd5('0x9'),attributes,{'tableName':_0x5cd5('0xa'),'paranoid':![],'indexes':[{'name':_0x5cd5('0xb'),'fields':[_0x5cd5('0xb')]},{'name':_0x5cd5('0xc'),'fields':['plainBody',_0x5cd5('0xd')],'type':_0x5cd5('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52c70c,_0x15aa5d,_0x15e68e){if(_0x52c70c['body']){_0x52c70c['plainBody']=htmlToText[_0x5cd5('0xf')](_0x52c70c['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x15e68e(null,_0x15aa5d);},'afterCreate':function(_0x133c00,_0x2aff82,_0x2e87d2){var _0x883826=_0x2a7563['models'];var _0x34d363=_0x133c00[_0x5cd5('0x10')]({'plain':!![]});if(_0x34d363[_0x5cd5('0x11')]['toLowerCase']()==='in'||_0x34d363[_0x5cd5('0x11')][_0x5cd5('0x12')]()==='out'&&!_0x34d363[_0x5cd5('0x13')]&&!_[_0x5cd5('0x14')](_0x34d363[_0x5cd5('0x15')])){_0x883826[_0x5cd5('0x16')][_0x5cd5('0x17')]({'where':{'id':_0x34d363[_0x5cd5('0x18')]}})['then'](function(_0x39db90){if(_0x39db90){_0x39db90[_0x5cd5('0x19')]({'lastMsgAt':_0x34d363[_0x5cd5('0x1a')],'lastMsgDirection':_0x34d363[_0x5cd5('0x11')][_0x5cd5('0x12')](),'lastMsgBody':_0x34d363['body']});}})[_0x5cd5('0x1b')](function(_0x244343){console['error'](_0x244343);});}_0x2e87d2();}},'charset':_0x5cd5('0x1c'),'collate':_0x5cd5('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 988f51c..925d265 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfcb=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateMailMessage','MailMessage','create','body','raw','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xecd8a2,_0x1fb96b){var _0x1c9756=function(_0x24c9c5){while(--_0x24c9c5){_0xecd8a2['push'](_0xecd8a2['shift']());}};_0x1c9756(++_0x1fb96b);}(_0xcfcb,0x7a));var _0xbcfc=function(_0x18bee8,_0x15e890){_0x18bee8=_0x18bee8-0x0;var _0x4301a9=_0xcfcb[_0x18bee8];return _0x4301a9;};'use strict';var _=require(_0xbcfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbcfc('0x1'));var fs=require('fs');var Redis=require(_0xbcfc('0x2'));var db=require(_0xbcfc('0x3'))['db'];var utils=require(_0xbcfc('0x4'));var logger=require(_0xbcfc('0x5'))(_0xbcfc('0x6'));var config=require(_0xbcfc('0x7'));var jayson=require(_0xbcfc('0x8'));var client=jayson[_0xbcfc('0x9')][_0xbcfc('0xa')]({'port':0x232a});config[_0xbcfc('0xb')]=_[_0xbcfc('0xc')](config[_0xbcfc('0xb')],{'host':_0xbcfc('0xd'),'port':0x18eb});var socket=require(_0xbcfc('0xe'))(new Redis(config[_0xbcfc('0xb')]));require(_0xbcfc('0xf'))['register'](socket);function respondWithRpcPromise(_0x4f80d7,_0x4d8e4b,_0x541fe2){return new BPromise(function(_0x2fda61,_0x39dbff){return client[_0xbcfc('0x10')](_0x4f80d7,_0x541fe2)[_0xbcfc('0x11')](function(_0x35f4d6){logger[_0xbcfc('0x12')](_0xbcfc('0x13'),_0x4d8e4b,'request\x20sent');logger['debug'](_0xbcfc('0x14'),_0x4d8e4b,_0xbcfc('0x15'),JSON['stringify'](_0x35f4d6));if(_0x35f4d6[_0xbcfc('0x16')]){if(_0x35f4d6['error'][_0xbcfc('0x17')]===0x1f4){logger[_0xbcfc('0x16')]('MailMessage,\x20%s,\x20%s',_0x4d8e4b,_0x35f4d6[_0xbcfc('0x16')][_0xbcfc('0x18')]);return _0x39dbff(_0x35f4d6[_0xbcfc('0x16')][_0xbcfc('0x18')]);}logger[_0xbcfc('0x16')](_0xbcfc('0x13'),_0x4d8e4b,_0x35f4d6['error'][_0xbcfc('0x18')]);return _0x2fda61(_0x35f4d6[_0xbcfc('0x16')]['message']);}else{logger[_0xbcfc('0x12')](_0xbcfc('0x13'),_0x4d8e4b,'request\x20sent');_0x2fda61(_0x35f4d6['result'][_0xbcfc('0x18')]);}})[_0xbcfc('0x19')](function(_0x24347f){logger['error'](_0xbcfc('0x13'),_0x4d8e4b,_0x24347f);_0x39dbff(_0x24347f);});});}exports[_0xbcfc('0x1a')]=function(_0xa81743){var _0x15f506=this;return new Promise(function(_0x2eb72a,_0x5c8e96){return db[_0xbcfc('0x1b')][_0xbcfc('0x1c')](_0xa81743[_0xbcfc('0x1d')],{'raw':_0xa81743['options']?_0xa81743['options'][_0xbcfc('0x1e')]===undefined?!![]:![]:!![]})[_0xbcfc('0x11')](function(_0x43f168){logger[_0xbcfc('0x12')](_0xbcfc('0x1a'),_0xa81743);logger[_0xbcfc('0x1f')](_0xbcfc('0x1a'),_0xa81743,JSON['stringify'](_0x43f168));_0x2eb72a(_0x43f168);})[_0xbcfc('0x19')](function(_0x46f05a){logger['error'](_0xbcfc('0x1a'),_0x46f05a['message'],_0xa81743);_0x5c8e96(_0x15f506[_0xbcfc('0x16')](0x1f4,_0x46f05a[_0xbcfc('0x18')]));});});}; \ No newline at end of file +var _0x04cc=['register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket'];(function(_0x42a7f5,_0xec13a9){var _0x5dbf4b=function(_0x263e0c){while(--_0x263e0c){_0x42a7f5['push'](_0x42a7f5['shift']());}};_0x5dbf4b(++_0xec13a9);}(_0x04cc,0x11a));var _0xc04c=function(_0x46bfe1,_0x42d186){_0x46bfe1=_0x46bfe1-0x0;var _0x42c931=_0x04cc[_0x46bfe1];return _0x42c931;};'use strict';var _=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var moment=require(_0xc04c('0x2'));var BPromise=require(_0xc04c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc04c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc04c('0x5'))(_0xc04c('0x6'));var config=require(_0xc04c('0x7'));var jayson=require(_0xc04c('0x8'));var client=jayson[_0xc04c('0x9')][_0xc04c('0xa')]({'port':0x232a});config[_0xc04c('0xb')]=_['defaults'](config[_0xc04c('0xb')],{'host':_0xc04c('0xc'),'port':0x18eb});var socket=require(_0xc04c('0xd'))(new Redis(config[_0xc04c('0xb')]));require(_0xc04c('0xe'))[_0xc04c('0xf')](socket);function respondWithRpcPromise(_0x1c363d,_0x1b6102,_0x4dcea5){return new BPromise(function(_0x4c6e10,_0x1e7ced){return client[_0xc04c('0x10')](_0x1c363d,_0x4dcea5)[_0xc04c('0x11')](function(_0x188bb7){logger[_0xc04c('0x12')](_0xc04c('0x13'),_0x1b6102,_0xc04c('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x1b6102,_0xc04c('0x14'),JSON['stringify'](_0x188bb7));if(_0x188bb7[_0xc04c('0x15')]){if(_0x188bb7[_0xc04c('0x15')][_0xc04c('0x16')]===0x1f4){logger[_0xc04c('0x15')]('MailMessage,\x20%s,\x20%s',_0x1b6102,_0x188bb7[_0xc04c('0x15')][_0xc04c('0x17')]);return _0x1e7ced(_0x188bb7[_0xc04c('0x15')][_0xc04c('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x1b6102,_0x188bb7['error'][_0xc04c('0x17')]);return _0x4c6e10(_0x188bb7[_0xc04c('0x15')]['message']);}else{logger[_0xc04c('0x12')]('MailMessage,\x20%s,\x20%s',_0x1b6102,_0xc04c('0x14'));_0x4c6e10(_0x188bb7[_0xc04c('0x18')]['message']);}})[_0xc04c('0x19')](function(_0x8daa87){logger[_0xc04c('0x15')](_0xc04c('0x13'),_0x1b6102,_0x8daa87);_0x1e7ced(_0x8daa87);});});}exports[_0xc04c('0x1a')]=function(_0xa20dae){var _0x260a51=this;return new Promise(function(_0x17fba4,_0x9b1151){return db[_0xc04c('0x1b')][_0xc04c('0x1c')](_0xa20dae['body'],{'raw':_0xa20dae[_0xc04c('0x1d')]?_0xa20dae[_0xc04c('0x1d')][_0xc04c('0x1e')]===undefined?!![]:![]:!![]})[_0xc04c('0x11')](function(_0x2422af){logger[_0xc04c('0x12')](_0xc04c('0x1a'),_0xa20dae);logger[_0xc04c('0x1f')](_0xc04c('0x1a'),_0xa20dae,JSON[_0xc04c('0x20')](_0x2422af));_0x17fba4(_0x2422af);})['catch'](function(_0x270176){logger['error'](_0xc04c('0x1a'),_0x270176[_0xc04c('0x17')],_0xa20dae);_0x9b1151(_0x260a51[_0xc04c('0x15')](0x1f4,_0x270176[_0xc04c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 21d6f1b..65a00b6 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cde=['save','remove','emit','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x1cde,0x1e7));var _0xe1cd=function(_0x27dc1e,_0xeecd5e){_0x27dc1e=_0x27dc1e-0x0;var _0x2fb3fa=_0x1cde[_0x27dc1e];return _0x2fb3fa;};'use strict';var MailMessageEvents=require(_0xe1cd('0x0'));var events=[_0xe1cd('0x1'),_0xe1cd('0x2'),'update'];function createListener(_0x1e64f4,_0x3a7304){return function(_0xdee242){_0x3a7304[_0xe1cd('0x3')](_0x1e64f4,_0xdee242);};}function removeListener(_0x1b7489,_0x448817){return function(){MailMessageEvents[_0xe1cd('0x4')](_0x1b7489,_0x448817);};}exports[_0xe1cd('0x5')]=function(_0x31d63c){for(var _0x558587=0x0,_0x5205b5=events[_0xe1cd('0x6')];_0x558587<_0x5205b5;_0x558587++){var _0x4567de=events[_0x558587];var _0x23006e=createListener(_0xe1cd('0x7')+_0x4567de,_0x31d63c);MailMessageEvents['on'](_0x4567de,_0x23006e);}}; \ No newline at end of file +var _0x5615=['./mailMessage.events','save','removeListener','length'];(function(_0x3ced3b,_0x305ff8){var _0x54d47c=function(_0x51aa20){while(--_0x51aa20){_0x3ced3b['push'](_0x3ced3b['shift']());}};_0x54d47c(++_0x305ff8);}(_0x5615,0xa0));var _0x5561=function(_0x66009f,_0x2d25e4){_0x66009f=_0x66009f-0x0;var _0xcba83a=_0x5615[_0x66009f];return _0xcba83a;};'use strict';var MailMessageEvents=require(_0x5561('0x0'));var events=[_0x5561('0x1'),'remove','update'];function createListener(_0x18528e,_0x1817b9){return function(_0x397210){_0x1817b9['emit'](_0x18528e,_0x397210);};}function removeListener(_0x401236,_0x389854){return function(){MailMessageEvents[_0x5561('0x2')](_0x401236,_0x389854);};}exports['register']=function(_0x3aaddb){for(var _0x1ef83c=0x0,_0xf685a2=events[_0x5561('0x3')];_0x1ef83c<_0xf685a2;_0x1ef83c++){var _0x4c03f0=events[_0x1ef83c];var _0x7bdaa=createListener('mailMessage:'+_0x4c03f0,_0x3aaddb);MailMessageEvents['on'](_0x4c03f0,_0x7bdaa);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 86bdc5e..ddb859b 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x652a=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put'];(function(_0x3b83ad,_0x51290d){var _0x20e6fd=function(_0x5f4f4f){while(--_0x5f4f4f){_0x3b83ad['push'](_0x3b83ad['shift']());}};_0x20e6fd(++_0x51290d);}(_0x652a,0x92));var _0xa652=function(_0x40ff79,_0x578a04){_0x40ff79=_0x40ff79-0x0;var _0x32234c=_0x652a[_0x40ff79];return _0x32234c;};'use strict';var multer=require(_0xa652('0x0'));var util=require(_0xa652('0x1'));var path=require(_0xa652('0x2'));var timeout=require(_0xa652('0x3'));var express=require('express');var router=express[_0xa652('0x4')]();var auth=require(_0xa652('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa652('0x6'));var controller=require(_0xa652('0x7'));router[_0xa652('0x8')]('/',auth[_0xa652('0x9')](),controller['index']);router[_0xa652('0x8')](_0xa652('0xa'),auth[_0xa652('0x9')](),controller[_0xa652('0xb')]);router[_0xa652('0x8')](_0xa652('0xc'),auth[_0xa652('0x9')](),controller[_0xa652('0xd')]);router['get']('/:id/members',auth[_0xa652('0x9')](),controller[_0xa652('0xe')]);router[_0xa652('0x8')](_0xa652('0xf'),auth[_0xa652('0x9')](),controller[_0xa652('0x10')]);router[_0xa652('0x8')](_0xa652('0x11'),auth[_0xa652('0x9')](),controller[_0xa652('0x12')]);router[_0xa652('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa652('0x13')](_0xa652('0xf'),auth[_0xa652('0x9')](),controller[_0xa652('0x14')]);router[_0xa652('0x13')](_0xa652('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0xa652('0x15')](_0xa652('0xc'),auth[_0xa652('0x9')](),controller[_0xa652('0x16')]);router[_0xa652('0x17')](_0xa652('0xc'),auth[_0xa652('0x9')](),controller[_0xa652('0x18')]);router[_0xa652('0x17')](_0xa652('0xf'),auth[_0xa652('0x9')](),controller[_0xa652('0x19')]);router[_0xa652('0x17')](_0xa652('0x11'),auth[_0xa652('0x9')](),controller[_0xa652('0x1a')]);module[_0xa652('0x1b')]=router; \ No newline at end of file +var _0x3453=['isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get'];(function(_0x578124,_0x1410ae){var _0x3fbca4=function(_0x8da044){while(--_0x8da044){_0x578124['push'](_0x578124['shift']());}};_0x3fbca4(++_0x1410ae);}(_0x3453,0x136));var _0x3345=function(_0x41b466,_0x4285ab){_0x41b466=_0x41b466-0x0;var _0x548bf0=_0x3453[_0x41b466];return _0x548bf0;};'use strict';var multer=require(_0x3345('0x0'));var util=require(_0x3345('0x1'));var path=require('path');var timeout=require(_0x3345('0x2'));var express=require(_0x3345('0x3'));var router=express[_0x3345('0x4')]();var auth=require(_0x3345('0x5'));var interaction=require(_0x3345('0x6'));var config=require('../../config/environment');var controller=require(_0x3345('0x7'));router[_0x3345('0x8')]('/',auth[_0x3345('0x9')](),controller[_0x3345('0xa')]);router[_0x3345('0x8')](_0x3345('0xb'),auth[_0x3345('0x9')](),controller['describe']);router[_0x3345('0x8')](_0x3345('0xc'),auth[_0x3345('0x9')](),controller[_0x3345('0xd')]);router[_0x3345('0x8')]('/:id/members',auth[_0x3345('0x9')](),controller[_0x3345('0xe')]);router[_0x3345('0x8')](_0x3345('0xf'),auth[_0x3345('0x9')](),controller[_0x3345('0x10')]);router['get'](_0x3345('0x11'),auth[_0x3345('0x9')](),controller[_0x3345('0x12')]);router[_0x3345('0x13')]('/',auth[_0x3345('0x9')](),controller[_0x3345('0x14')]);router[_0x3345('0x13')](_0x3345('0xf'),auth[_0x3345('0x9')](),controller[_0x3345('0x15')]);router[_0x3345('0x13')](_0x3345('0x11'),auth['isAuthenticated'](),controller[_0x3345('0x16')]);router['put'](_0x3345('0xc'),auth[_0x3345('0x9')](),controller[_0x3345('0x17')]);router[_0x3345('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x3345('0x19')]);router[_0x3345('0x18')](_0x3345('0xf'),auth[_0x3345('0x9')](),controller[_0x3345('0x1a')]);router[_0x3345('0x18')](_0x3345('0x11'),auth[_0x3345('0x9')](),controller[_0x3345('0x1b')]);module[_0x3345('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 98fda0c..fe7243f 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd14e=['sequelize','STRING','name','INTEGER'];(function(_0x3f369c,_0x1c5793){var _0x3f851a=function(_0x482e57){while(--_0x482e57){_0x3f369c['push'](_0x3f369c['shift']());}};_0x3f851a(++_0x1c5793);}(_0xd14e,0x1b8));var _0xed14=function(_0x5e8331,_0xb09b84){_0x5e8331=_0x5e8331-0x0;var _0x1a8486=_0xd14e[_0x5e8331];return _0x1a8486;};'use strict';var Sequelize=require(_0xed14('0x0'));module['exports']={'name':{'type':Sequelize[_0xed14('0x1')],'unique':_0xed14('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xed14('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0xd7a3=['name','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xd7a3,0xf4));var _0x3d7a=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xd7a3[_0x2df507];return _0x1f7167;};'use strict';var Sequelize=require(_0x3d7a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3d7a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3d7a('0x2')]},'timeout':{'type':Sequelize[_0x3d7a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3d7a('0x4')](_0x3d7a('0x5'),'beepall',_0x3d7a('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index b289410..9e54b2c 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3091=['jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','then','get','MailQueues','UserProfileResource','destroy','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','nolimit','order','MailQueueId','findAll','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto'];(function(_0x41aff9,_0x396c2d){var _0x5b0773=function(_0x244801){while(--_0x244801){_0x41aff9['push'](_0x41aff9['shift']());}};_0x5b0773(++_0x396c2d);}(_0x3091,0x84));var _0x1309=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3091[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x1309('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1309('0x1'));var jsonpatch=require(_0x1309('0x2'));var rp=require(_0x1309('0x3'));var moment=require(_0x1309('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1309('0x5'));var util=require(_0x1309('0x6'));var path=require(_0x1309('0x7'));var sox=require(_0x1309('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1309('0x9'));var crypto=require(_0x1309('0xa'));var jsforce=require(_0x1309('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1309('0xc'));var querystring=require('querystring');var Papa=require(_0x1309('0xd'));var Redis=require(_0x1309('0xe'));var authService=require(_0x1309('0xf'));var qs=require(_0x1309('0x10'));var as=require(_0x1309('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1309('0x12'))(_0x1309('0x13'));var utils=require(_0x1309('0x14'));var config=require(_0x1309('0x15'));var db=require(_0x1309('0x16'))['db'];config['redis']=_[_0x1309('0x17')](config[_0x1309('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1309('0x19'))(new Redis(config[_0x1309('0x18')]));require(_0x1309('0x1a'))[_0x1309('0x1b')](socket);function respondWithStatusCode(_0x9e12e5,_0x33c227){_0x33c227=_0x33c227||0xcc;return function(_0x265243){if(_0x265243){return _0x9e12e5[_0x1309('0x1c')](_0x33c227);}return _0x9e12e5['status'](_0x33c227)[_0x1309('0x1d')]();};}function respondWithResult(_0xaeafa6,_0xb762d2){_0xb762d2=_0xb762d2||0xc8;return function(_0x219867){if(_0x219867){return _0xaeafa6[_0x1309('0x1e')](_0xb762d2)[_0x1309('0x1f')](_0x219867);}};}function respondWithFilteredResult(_0x35dce5,_0x3756e9){return function(_0x2f6404){if(_0x2f6404){var _0x947f1c=_0x2f6404[_0x1309('0x20')],_0x28d721=_0x3756e9[_0x1309('0x21')],_0x33db03=_0x3756e9['offset']+_0x3756e9[_0x1309('0x22')],_0x20bcea;if(_0x33db03>=_0x947f1c){_0x33db03=_0x947f1c;_0x20bcea=0xc8;}else{_0x20bcea=0xce;}_0x35dce5[_0x1309('0x1e')](_0x20bcea);return _0x35dce5[_0x1309('0x23')](_0x1309('0x24'),_0x28d721+'-'+_0x33db03+'/'+_0x947f1c)[_0x1309('0x1f')](_0x2f6404);}return null;};}function patchUpdates(_0x33aea2){return function(_0x913285){try{jsonpatch[_0x1309('0x25')](_0x913285,_0x33aea2,!![]);}catch(_0x10be22){return BPromise[_0x1309('0x26')](_0x10be22);}return _0x913285['save']();};}function saveUpdates(_0x10789f,_0x249488){return function(_0x481ccf){if(_0x481ccf){return _0x481ccf['update'](_0x10789f)[_0x1309('0x27')](function(_0x517a79){return _0x517a79;});}return null;};}function removeEntity(_0x219211,_0xbcd36c){return function(_0x3f1e03){if(_0x3f1e03){return _0x3f1e03['destroy']()['then'](function(){var _0x5aaa67=_0x3f1e03[_0x1309('0x28')]({'plain':!![]});var _0x20bdc5=_0x1309('0x29');return db[_0x1309('0x2a')][_0x1309('0x2b')]({'where':{'type':_0x20bdc5,'resourceId':_0x5aaa67['id']}})[_0x1309('0x27')](function(){return _0x3f1e03;});})[_0x1309('0x27')](function(){_0x219211['status'](0xcc)[_0x1309('0x1d')]();});}};}function handleEntityNotFound(_0x2caf23,_0x3c17ae){return function(_0x5759a2){if(!_0x5759a2){_0x2caf23['sendStatus'](0x194);}return _0x5759a2;};}function handleError(_0x1f87d5,_0x30449d){_0x30449d=_0x30449d||0x1f4;return function(_0x25712b){logger['error'](_0x25712b[_0x1309('0x2c')]);if(_0x25712b['name']){delete _0x25712b[_0x1309('0x2d')];}_0x1f87d5['status'](_0x30449d)[_0x1309('0x2e')](_0x25712b);};}exports[_0x1309('0x2f')]=function(_0x4d3928,_0x297353){var _0x3ff454={},_0x327919={},_0x17d6e0={'count':0x0,'rows':[]};var _0x160801=_[_0x1309('0x30')](db[_0x1309('0x31')][_0x1309('0x32')],function(_0x3c777b){return{'name':_0x3c777b[_0x1309('0x33')],'type':_0x3c777b['type'][_0x1309('0x34')]};});_0x327919[_0x1309('0x35')]=_[_0x1309('0x30')](_0x160801,_0x1309('0x2d'));_0x327919[_0x1309('0x36')]=_['keys'](_0x4d3928[_0x1309('0x36')]);_0x327919[_0x1309('0x37')]=_[_0x1309('0x38')](_0x327919[_0x1309('0x35')],_0x327919['query']);_0x3ff454['attributes']=_['intersection'](_0x327919[_0x1309('0x35')],qs[_0x1309('0x39')](_0x4d3928[_0x1309('0x36')]['fields']));_0x3ff454[_0x1309('0x3a')]=_0x3ff454['attributes'][_0x1309('0x3b')]?_0x3ff454[_0x1309('0x3a')]:_0x327919[_0x1309('0x35')];if(!_0x4d3928[_0x1309('0x36')][_0x1309('0x3c')]('nolimit')){_0x3ff454[_0x1309('0x22')]=qs[_0x1309('0x22')](_0x4d3928[_0x1309('0x36')][_0x1309('0x22')]);_0x3ff454[_0x1309('0x21')]=qs[_0x1309('0x21')](_0x4d3928[_0x1309('0x36')][_0x1309('0x21')]);}_0x3ff454['order']=qs[_0x1309('0x3d')](_0x4d3928[_0x1309('0x36')][_0x1309('0x3d')]);_0x3ff454['where']=qs[_0x1309('0x37')](_[_0x1309('0x3e')](_0x4d3928[_0x1309('0x36')],_0x327919[_0x1309('0x37')]));if(_0x4d3928['query']['filter']){_0x3ff454['where']=_[_0x1309('0x3f')](_0x3ff454[_0x1309('0x40')],{'$or':_[_0x1309('0x30')](_0x160801,function(_0x32f3ab){if(_0x32f3ab['type']!==_0x1309('0x41')){var _0x5acebd={};_0x5acebd[_0x32f3ab['name']]={'$like':'%'+_0x4d3928[_0x1309('0x36')][_0x1309('0x42')]+'%'};return _0x5acebd;}})});}_0x3ff454=_[_0x1309('0x3f')]({},_0x3ff454,_0x4d3928[_0x1309('0x43')]);var _0x2067a8={'where':_0x3ff454['where']};return db[_0x1309('0x31')][_0x1309('0x20')](_0x2067a8)['then'](function(_0x38292a){_0x17d6e0[_0x1309('0x20')]=_0x38292a;if(_0x4d3928[_0x1309('0x36')][_0x1309('0x44')]){_0x3ff454[_0x1309('0x45')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x3ff454);})[_0x1309('0x27')](function(_0x455429){_0x17d6e0['rows']=_0x455429;return _0x17d6e0;})['then'](respondWithFilteredResult(_0x297353,_0x3ff454))['catch'](handleError(_0x297353,null));};exports[_0x1309('0x46')]=function(_0xe27817,_0x2a6743){var _0x5e5344={'raw':!![],'where':{'id':_0xe27817[_0x1309('0x47')]['id']}},_0x2c8407={};_0x2c8407[_0x1309('0x35')]=_['keys'](db[_0x1309('0x31')][_0x1309('0x32')]);_0x2c8407[_0x1309('0x36')]=_[_0x1309('0x48')](_0xe27817[_0x1309('0x36')]);_0x2c8407[_0x1309('0x37')]=_[_0x1309('0x38')](_0x2c8407[_0x1309('0x35')],_0x2c8407[_0x1309('0x36')]);_0x5e5344[_0x1309('0x3a')]=_[_0x1309('0x38')](_0x2c8407[_0x1309('0x35')],qs[_0x1309('0x39')](_0xe27817[_0x1309('0x36')]['fields']));_0x5e5344[_0x1309('0x3a')]=_0x5e5344[_0x1309('0x3a')]['length']?_0x5e5344[_0x1309('0x3a')]:_0x2c8407[_0x1309('0x35')];if(_0xe27817['query'][_0x1309('0x44')]){_0x5e5344[_0x1309('0x45')]=[{'all':!![]}];}_0x5e5344=_[_0x1309('0x3f')]({},_0x5e5344,_0xe27817['options']);return db[_0x1309('0x31')][_0x1309('0x49')](_0x5e5344)[_0x1309('0x27')](handleEntityNotFound(_0x2a6743,null))[_0x1309('0x27')](respondWithResult(_0x2a6743,null))[_0x1309('0x4a')](handleError(_0x2a6743,null));};exports[_0x1309('0x4b')]=function(_0x189de1,_0x38e60c){return db[_0x1309('0x31')]['create'](_0x189de1[_0x1309('0x4c')],{})[_0x1309('0x27')](function(_0x1ccb91){var _0xf1d0f2=_0x189de1[_0x1309('0x4d')]['get']({'plain':!![]});if(!_0xf1d0f2)throw new Error(_0x1309('0x4e'));if(_0xf1d0f2[_0x1309('0x4f')]===_0x1309('0x4d')){var _0x30a720=_0x1ccb91[_0x1309('0x28')]({'plain':!![]});var _0xf79047=_0x1309('0x29');return db['UserProfileSection']['find']({'where':{'name':_0xf79047,'userProfileId':_0xf1d0f2['userProfileId']},'raw':!![]})['then'](function(_0x101d64){if(_0x101d64&&_0x101d64[_0x1309('0x50')]===0x0){return db[_0x1309('0x2a')][_0x1309('0x4b')]({'name':_0x30a720[_0x1309('0x2d')],'resourceId':_0x30a720['id'],'type':_0x101d64['name'],'sectionId':_0x101d64['id']},{})['then'](function(){return _0x1ccb91;});}else{return _0x1ccb91;}})[_0x1309('0x4a')](function(_0x5ecca1){logger['error'](_0x1309('0x51'),_0x5ecca1);throw _0x5ecca1;});}return _0x1ccb91;})[_0x1309('0x27')](respondWithResult(_0x38e60c,0xc9))['catch'](handleError(_0x38e60c,null));};exports[_0x1309('0x52')]=function(_0x182cf1,_0x295e62){if(_0x182cf1['body']['id']){delete _0x182cf1[_0x1309('0x4c')]['id'];}return db[_0x1309('0x31')][_0x1309('0x49')]({'where':{'id':_0x182cf1['params']['id']}})[_0x1309('0x27')](handleEntityNotFound(_0x295e62,null))['then'](saveUpdates(_0x182cf1[_0x1309('0x4c')],null))[_0x1309('0x27')](respondWithResult(_0x295e62,null))['catch'](handleError(_0x295e62,null));};exports['destroy']=function(_0x1ffb56,_0x15e8d2){return db[_0x1309('0x31')][_0x1309('0x49')]({'where':{'id':_0x1ffb56[_0x1309('0x47')]['id']}})[_0x1309('0x27')](handleEntityNotFound(_0x15e8d2,null))['then'](removeEntity(_0x15e8d2,null))[_0x1309('0x4a')](handleError(_0x15e8d2,null));};exports[_0x1309('0x53')]=function(_0x5c300e,_0x338f16){return db[_0x1309('0x31')]['describe']()[_0x1309('0x27')](respondWithResult(_0x338f16,null))[_0x1309('0x4a')](handleError(_0x338f16,null));};exports[_0x1309('0x54')]=function(_0x270218,_0x4cfb2a,_0x1a219c){var _0x428984={'raw':!![],'where':{}},_0x80baab={},_0x30fb37;return db[_0x1309('0x31')][_0x1309('0x55')]({'where':{'id':_0x270218[_0x1309('0x47')]['id']}})[_0x1309('0x27')](handleEntityNotFound(_0x4cfb2a,null))[_0x1309('0x27')](function(_0x1848b8){if(_0x1848b8){_0x30fb37=_0x1848b8[_0x1309('0x28')]({'plain':!![]});_0x80baab[_0x1309('0x35')]=_['keys'](db[_0x1309('0x56')][_0x1309('0x32')]);_0x80baab[_0x1309('0x36')]=_[_0x1309('0x48')](_0x270218[_0x1309('0x36')]);_0x80baab['filters']=_[_0x1309('0x38')](_0x80baab[_0x1309('0x35')],_0x80baab[_0x1309('0x36')]);_0x428984[_0x1309('0x3a')]=_[_0x1309('0x38')](_0x80baab['model'],qs[_0x1309('0x39')](_0x270218[_0x1309('0x36')][_0x1309('0x39')]));_0x428984['attributes']=_0x428984['attributes'][_0x1309('0x3b')]?_0x428984[_0x1309('0x3a')]:_0x80baab['model'];if(!_0x270218[_0x1309('0x36')][_0x1309('0x3c')](_0x1309('0x57'))){_0x428984['limit']=qs[_0x1309('0x22')](_0x270218[_0x1309('0x36')][_0x1309('0x22')]);_0x428984[_0x1309('0x21')]=qs['offset'](_0x270218[_0x1309('0x36')][_0x1309('0x21')]);}_0x428984[_0x1309('0x58')]=qs[_0x1309('0x3d')](_0x270218[_0x1309('0x36')][_0x1309('0x3d')]);_0x428984[_0x1309('0x40')]=qs[_0x1309('0x37')](_[_0x1309('0x3e')](_0x270218[_0x1309('0x36')],_0x80baab[_0x1309('0x37')]));_0x428984['where'][_0x1309('0x59')]=_0x1848b8['id'];if(_0x270218[_0x1309('0x36')]['filter']){_0x428984[_0x1309('0x40')]=_[_0x1309('0x3f')](_0x428984['where'],{'$or':_['map'](_0x428984[_0x1309('0x3a')],function(_0x506058){var _0x1042be={};_0x1042be[_0x506058]={'$like':'%'+_0x270218['query'][_0x1309('0x42')]+'%'};return _0x1042be;})});}_0x428984=_[_0x1309('0x3f')]({},_0x428984,_0x270218[_0x1309('0x43')]);return db[_0x1309('0x56')][_0x1309('0x5a')](_0x428984);}})[_0x1309('0x27')](function(_0x77a4d2){if(_0x77a4d2){return db[_0x1309('0x5b')]['findAndCountAll']({'where':{'id':_[_0x1309('0x30')](_0x77a4d2,_0x1309('0x5c')),'role':_0x1309('0x5d')},'attributes':['id','name',_0x1309('0x5e'),_0x1309('0x5f'),_0x1309('0x60')]});}})[_0x1309('0x27')](function(_0x53940d){if(_0x53940d){return{'count':_0x53940d[_0x1309('0x20')],'rows':_['map'](_0x53940d['rows'],function(_0x5934b3){return{'membername':_0x5934b3['name'],'UserId':_0x5934b3['id'],'queue_name':_0x30fb37['name'],'MailQueueId':_0x30fb37['id'],'interface':util[_0x1309('0x61')](_0x1309('0x62'),_0x1309('0x63'),_0x5934b3[_0x1309('0x2d')]),'penalty':0x0,'paused':_0x5934b3['mailPause'],'createdAt':_0x5934b3[_0x1309('0x60')],'updatedAt':_0x5934b3[_0x1309('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1309('0x27')](respondWithFilteredResult(_0x4cfb2a,_0x428984))['catch'](handleError(_0x4cfb2a,null));};exports[_0x1309('0x64')]=function(_0x138035,_0x8111a2,_0x4cd017){var _0x544b7f={};var _0x5ee413={};var _0x51235b;var _0x4ece5c;return db[_0x1309('0x31')][_0x1309('0x55')]({'where':{'id':_0x138035['params']['id']}})[_0x1309('0x27')](handleEntityNotFound(_0x8111a2,null))[_0x1309('0x27')](function(_0x4dabd0){if(_0x4dabd0){_0x51235b=_0x4dabd0;_0x5ee413['model']=_[_0x1309('0x48')](db[_0x1309('0x65')][_0x1309('0x32')]);_0x5ee413['query']=_[_0x1309('0x48')](_0x138035[_0x1309('0x36')]);_0x5ee413[_0x1309('0x37')]=_[_0x1309('0x38')](_0x5ee413[_0x1309('0x35')],_0x5ee413[_0x1309('0x36')]);_0x544b7f[_0x1309('0x3a')]=_['intersection'](_0x5ee413[_0x1309('0x35')],qs['fields'](_0x138035[_0x1309('0x36')][_0x1309('0x39')]));_0x544b7f[_0x1309('0x3a')]=_0x544b7f['attributes'][_0x1309('0x3b')]?_0x544b7f[_0x1309('0x3a')]:_0x5ee413[_0x1309('0x35')];_0x544b7f[_0x1309('0x58')]=qs[_0x1309('0x3d')](_0x138035[_0x1309('0x36')][_0x1309('0x3d')]);_0x544b7f[_0x1309('0x40')]=qs[_0x1309('0x37')](_[_0x1309('0x3e')](_0x138035[_0x1309('0x36')],_0x5ee413['filters']));if(_0x138035['query']['filter']){_0x544b7f[_0x1309('0x40')]=_[_0x1309('0x3f')](_0x544b7f[_0x1309('0x40')],{'$or':_[_0x1309('0x30')](_0x544b7f[_0x1309('0x3a')],function(_0x2f2269){var _0x3200ae={};_0x3200ae[_0x2f2269]={'$like':'%'+_0x138035[_0x1309('0x36')][_0x1309('0x42')]+'%'};return _0x3200ae;})});}_0x544b7f=_[_0x1309('0x3f')]({},_0x544b7f,_0x138035['options']);return _0x51235b[_0x1309('0x64')](_0x544b7f);}})[_0x1309('0x27')](function(_0x1885ab){if(_0x1885ab){_0x4ece5c=_0x1885ab[_0x1309('0x3b')];if(!_0x138035[_0x1309('0x36')][_0x1309('0x3c')](_0x1309('0x57'))){_0x544b7f['limit']=qs[_0x1309('0x22')](_0x138035[_0x1309('0x36')]['limit']);_0x544b7f['offset']=qs['offset'](_0x138035[_0x1309('0x36')][_0x1309('0x21')]);}return _0x51235b[_0x1309('0x64')](_0x544b7f);}})['then'](function(_0x4bc8c2){if(_0x4bc8c2){return _0x4bc8c2?{'count':_0x4ece5c,'rows':_0x4bc8c2}:null;}})[_0x1309('0x27')](respondWithResult(_0x8111a2,null))[_0x1309('0x4a')](handleError(_0x8111a2,null));};exports[_0x1309('0x66')]=function(_0xbad152,_0x4be3db,_0x21b5cc){var _0x4358a3=_0xbad152[_0x1309('0x4c')][_0x1309('0x67')];return db[_0x1309('0x65')][_0x1309('0x5a')]({'where':{'id':_0x4358a3},'attributes':['id'],'include':[{'model':db[_0x1309('0x5b')],'as':_0x1309('0x68'),'attributes':['id',_0x1309('0x2d'),_0x1309('0x69'),_0x1309('0x6a'),_0x1309('0x6b')],'raw':!![]}]})['then'](function(_0x44577e){if(_0x44577e){var _0x273fa5=_[_0x1309('0x6c')](_0x44577e,function(_0xa3231f){var _0x108244=_0xa3231f[_0x1309('0x28')]({'plain':!![]});return _0x108244[_0x1309('0x68')];});return db[_0x1309('0x31')][_0x1309('0x49')]({'where':{'id':_0xbad152[_0x1309('0x47')]['id']}})[_0x1309('0x27')](function(_0x1f6269){return db[_0x1309('0x6d')]['transaction'](function(_0x29e48f){return _0x1f6269[_0x1309('0x66')](_0x4358a3,{'transaction':_0x29e48f})[_0x1309('0x27')](function(){return BPromise[_0x1309('0x6e')](_0x273fa5,function(_0x285a1e){return db[_0x1309('0x56')][_0x1309('0x6f')]({'where':{'UserId':_0x285a1e['id'],'MailQueueId':_0xbad152['params']['id']},'transaction':_0x29e48f});});})[_0x1309('0x27')](function(){_0x273fa5[_0x1309('0x70')](function(_0x45de18){socket[_0x1309('0x71')](_0x1309('0x72'),{'UserId':_0x45de18['id'],'MailQueueId':_0x1f6269['id']});});});});});}})[_0x1309('0x27')](respondWithStatusCode(_0x4be3db,null))[_0x1309('0x4a')](handleError(_0x4be3db,null));};exports[_0x1309('0x73')]=function(_0x39cf57,_0x5a3a03,_0x1e3a78){return db['Team'][_0x1309('0x5a')]({'where':{'id':_0x39cf57[_0x1309('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1309('0x5b')],'as':_0x1309('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a3a03,null))[_0x1309('0x27')](function(_0xab64a7){var _0x5f5724=_['map'](_0xab64a7,'id');var _0x9fc6c8=[];var _0x1a4a26=[];var _0x16bd9f=squel[_0x1309('0x74')]();_0x16bd9f[_0x1309('0x75')]('tq.TeamId')[_0x1309('0x76')](_0x1309('0x77'),'tq')[_0x1309('0x78')](_0x1309('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1309('0x40')]('MailQueueId\x20=\x20?',_0x39cf57[_0x1309('0x47')]['id']);for(var _0xb0890b=0x0;_0xb0890b<_0xab64a7[_0x1309('0x3b')];_0xb0890b+=0x1){let _0x7fa5bf=_0xab64a7[_0xb0890b];for(var _0x3eafa3=0x0;_0x3eafa3<_0x7fa5bf['Agents'][_0x1309('0x3b')];_0x3eafa3+=0x1){let _0x3aa069=_0x7fa5bf[_0x1309('0x68')][_0x3eafa3];var _0x909c22=_0x16bd9f[_0x1309('0x7a')]();_0x909c22[_0x1309('0x40')]('ut.UserId\x20=\x20?',_0x3aa069['id']);_0x1a4a26[_0x1309('0x7b')](db[_0x1309('0x6d')][_0x1309('0x36')](_0x909c22[_0x1309('0x7c')](),{'type':db[_0x1309('0x6d')][_0x1309('0x7d')][_0x1309('0x7e')]})[_0x1309('0x27')](function(_0xe64b78){if(_0xe64b78[_0x1309('0x3b')]===0x1){return _0x3aa069['id'];}else{var _0x515813=_[_0x1309('0x7f')](_['map'](_0xe64b78,_0x1309('0x80')),function(_0x2be370){return _[_0x1309('0x81')](_0x5f5724,_0x2be370);});if(_0x515813){return _0x3aa069['id'];}}}));}}return BPromise[_0x1309('0x82')](_0x1a4a26)['then'](function(_0x4d63c2){_0x9fc6c8=_(_0x9fc6c8)[_0x1309('0x83')](_0x4d63c2)[_0x1309('0x84')]()[_0x1309('0x85')]();return db[_0x1309('0x31')][_0x1309('0x49')]({'where':{'id':_0x39cf57[_0x1309('0x47')]['id']}})[_0x1309('0x27')](function(_0x220efd){return db[_0x1309('0x6d')][_0x1309('0x86')](function(_0x2d2b2e){return _0x220efd[_0x1309('0x73')](_0x39cf57[_0x1309('0x36')][_0x1309('0x67')],{'transaction':_0x2d2b2e})[_0x1309('0x27')](function(){if(!_[_0x1309('0x87')](_0x9fc6c8)){return _0x220efd[_0x1309('0x88')](_0x9fc6c8,{'transaction':_0x2d2b2e});}})[_0x1309('0x27')](function(){_0x9fc6c8[_0x1309('0x70')](function(_0x3baba0){socket['emit'](_0x1309('0x89'),{'UserId':_0x3baba0,'MailQueueId':_0x220efd['id']});});});});});});})[_0x1309('0x27')](respondWithStatusCode(_0x5a3a03,null))[_0x1309('0x4a')](handleError(_0x5a3a03,null));};exports[_0x1309('0x8a')]=function(_0x343a1b,_0x257ef3,_0x469f63){return db[_0x1309('0x31')][_0x1309('0x49')]({'where':{'id':_0x343a1b[_0x1309('0x47')]['id']}})[_0x1309('0x27')](handleEntityNotFound(_0x257ef3,null))[_0x1309('0x27')](function(_0x2c8441){if(_0x2c8441){return _0x2c8441['addAgents'](_0x343a1b[_0x1309('0x4c')][_0x1309('0x67')],_[_0x1309('0x8b')](_0x343a1b[_0x1309('0x4c')],[_0x1309('0x67'),'id'])||{})[_0x1309('0x8c')](function(_0x497136){for(var _0x203a2a=0x0;_0x203a2a<_0x343a1b[_0x1309('0x4c')][_0x1309('0x67')][_0x1309('0x3b')];_0x203a2a+=0x1){socket[_0x1309('0x71')](_0x1309('0x72'),{'UserId':_0x343a1b[_0x1309('0x4c')][_0x1309('0x67')][_0x203a2a],'MailQueueId':_0x343a1b[_0x1309('0x47')]['id']});}return _0x497136;});}})['then'](respondWithResult(_0x257ef3,null))[_0x1309('0x4a')](handleError(_0x257ef3,null));};exports[_0x1309('0x88')]=function(_0x16855c,_0x4f9da3,_0x3491b3){return db['MailQueue'][_0x1309('0x49')]({'where':{'id':_0x16855c[_0x1309('0x47')]['id']}})[_0x1309('0x27')](handleEntityNotFound(_0x4f9da3,null))['then'](function(_0x5e2a41){if(_0x5e2a41){return _0x5e2a41[_0x1309('0x88')](_0x16855c['query'][_0x1309('0x67')])[_0x1309('0x27')](function(){if(_[_0x1309('0x8d')](_0x16855c[_0x1309('0x36')][_0x1309('0x67')])){for(var _0x5363cb=0x0;_0x5363cb<_0x16855c['query'][_0x1309('0x67')][_0x1309('0x3b')];_0x5363cb+=0x1){socket[_0x1309('0x71')](_0x1309('0x89'),{'UserId':Number(_0x16855c[_0x1309('0x36')][_0x1309('0x67')][_0x5363cb]),'MailQueueId':Number(_0x16855c[_0x1309('0x47')]['id'])});}}else{socket[_0x1309('0x71')](_0x1309('0x89'),{'UserId':Number(_0x16855c[_0x1309('0x36')][_0x1309('0x67')]),'MailQueueId':Number(_0x16855c['params']['id'])});}});}})[_0x1309('0x27')](respondWithStatusCode(_0x4f9da3,null))[_0x1309('0x4a')](handleError(_0x4f9da3,null));};exports['getAgents']=function(_0x289e39,_0x22c2ce,_0x59d052){var _0x579437={};var _0x2b01a6={};var _0x26c74c;var _0x3c6e4b;return db[_0x1309('0x31')][_0x1309('0x55')]({'where':{'id':_0x289e39['params']['id']}})[_0x1309('0x27')](handleEntityNotFound(_0x22c2ce,null))[_0x1309('0x27')](function(_0x4a638a){if(_0x4a638a){_0x26c74c=_0x4a638a;_0x2b01a6[_0x1309('0x35')]=_[_0x1309('0x48')](db[_0x1309('0x5b')]['rawAttributes']);_0x2b01a6[_0x1309('0x36')]=_['keys'](_0x289e39[_0x1309('0x36')]);_0x2b01a6[_0x1309('0x37')]=_[_0x1309('0x38')](_0x2b01a6['model'],_0x2b01a6['query']);_0x579437['attributes']=_['intersection'](_0x2b01a6[_0x1309('0x35')],qs['fields'](_0x289e39[_0x1309('0x36')][_0x1309('0x39')]));_0x579437[_0x1309('0x3a')]=_0x579437[_0x1309('0x3a')][_0x1309('0x3b')]?_0x579437[_0x1309('0x3a')]:_0x2b01a6[_0x1309('0x35')];_0x579437['order']=qs['sort'](_0x289e39[_0x1309('0x36')][_0x1309('0x3d')]);_0x579437[_0x1309('0x40')]=qs[_0x1309('0x37')](_['pick'](_0x289e39[_0x1309('0x36')],_0x2b01a6[_0x1309('0x37')]));if(_0x289e39[_0x1309('0x36')][_0x1309('0x42')]){_0x579437[_0x1309('0x40')]=_[_0x1309('0x3f')](_0x579437[_0x1309('0x40')],{'$or':_[_0x1309('0x30')](_0x579437[_0x1309('0x3a')],function(_0x471125){var _0x5459f9={};_0x5459f9[_0x471125]={'$like':'%'+_0x289e39[_0x1309('0x36')][_0x1309('0x42')]+'%'};return _0x5459f9;})});}_0x579437=_[_0x1309('0x3f')]({},_0x579437,_0x289e39[_0x1309('0x43')]);return _0x26c74c[_0x1309('0x8e')](_0x579437);}})[_0x1309('0x27')](function(_0x12caff){if(_0x12caff){_0x3c6e4b=_0x12caff[_0x1309('0x3b')];if(!_0x289e39['query'][_0x1309('0x3c')](_0x1309('0x57'))){_0x579437[_0x1309('0x22')]=qs[_0x1309('0x22')](_0x289e39[_0x1309('0x36')]['limit']);_0x579437[_0x1309('0x21')]=qs['offset'](_0x289e39[_0x1309('0x36')]['offset']);}return _0x26c74c['getAgents'](_0x579437);}})[_0x1309('0x27')](function(_0x13e77d){if(_0x13e77d){return _0x13e77d?{'count':_0x3c6e4b,'rows':_0x13e77d}:null;}})[_0x1309('0x27')](respondWithResult(_0x22c2ce,null))[_0x1309('0x4a')](handleError(_0x22c2ce,null));}; \ No newline at end of file +var _0x1589=['rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','catch','show','keys','intersection','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserMailQueue','hasOwnProperty','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','online','voicePause','sequelize','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','join','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','all','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','map','MailQueue'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x1589,0x159));var _0x9158=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x1589[_0x419e17];return _0x1f2044;};'use strict';var pdf=require(_0x9158('0x0'));var emlformat=require(_0x9158('0x1'));var rimraf=require(_0x9158('0x2'));var zipdir=require(_0x9158('0x3'));var jsonpatch=require(_0x9158('0x4'));var rp=require(_0x9158('0x5'));var moment=require(_0x9158('0x6'));var BPromise=require(_0x9158('0x7'));var Mustache=require('mustache');var util=require(_0x9158('0x8'));var path=require(_0x9158('0x9'));var sox=require('sox');var csv=require(_0x9158('0xa'));var ejs=require(_0x9158('0xb'));var fs=require('fs');var _=require(_0x9158('0xc'));var squel=require(_0x9158('0xd'));var crypto=require(_0x9158('0xe'));var jsforce=require(_0x9158('0xf'));var deskjs=require(_0x9158('0x10'));var toCsv=require(_0x9158('0xa'));var querystring=require(_0x9158('0x11'));var Papa=require(_0x9158('0x12'));var Redis=require('ioredis');var authService=require(_0x9158('0x13'));var qs=require(_0x9158('0x14'));var as=require(_0x9158('0x15'));var hardwareService=require(_0x9158('0x16'));var logger=require('../../config/logger')(_0x9158('0x17'));var utils=require(_0x9158('0x18'));var config=require(_0x9158('0x19'));var db=require('../../mysqldb')['db'];config[_0x9158('0x1a')]=_[_0x9158('0x1b')](config[_0x9158('0x1a')],{'host':_0x9158('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9158('0x1a')]));require('./mailQueue.socket')[_0x9158('0x1d')](socket);function respondWithStatusCode(_0xdfa59,_0x3a3179){_0x3a3179=_0x3a3179||0xcc;return function(_0x3e56df){if(_0x3e56df){return _0xdfa59[_0x9158('0x1e')](_0x3a3179);}return _0xdfa59['status'](_0x3a3179)[_0x9158('0x1f')]();};}function respondWithResult(_0x22c7f0,_0x25d1a2){_0x25d1a2=_0x25d1a2||0xc8;return function(_0x309556){if(_0x309556){return _0x22c7f0[_0x9158('0x20')](_0x25d1a2)[_0x9158('0x21')](_0x309556);}};}function respondWithFilteredResult(_0x5e0ac3,_0x63986d){return function(_0x2e7784){if(_0x2e7784){var _0x1e8ee6=_0x2e7784[_0x9158('0x22')],_0x56c89a=_0x63986d[_0x9158('0x23')],_0x509344=_0x63986d[_0x9158('0x23')]+_0x63986d[_0x9158('0x24')],_0xd0bbb7;if(_0x509344>=_0x1e8ee6){_0x509344=_0x1e8ee6;_0xd0bbb7=0xc8;}else{_0xd0bbb7=0xce;}_0x5e0ac3[_0x9158('0x20')](_0xd0bbb7);return _0x5e0ac3['set'](_0x9158('0x25'),_0x56c89a+'-'+_0x509344+'/'+_0x1e8ee6)[_0x9158('0x21')](_0x2e7784);}return null;};}function patchUpdates(_0x59abfa){return function(_0x208447){try{jsonpatch[_0x9158('0x26')](_0x208447,_0x59abfa,!![]);}catch(_0x12e7dd){return BPromise['reject'](_0x12e7dd);}return _0x208447[_0x9158('0x27')]();};}function saveUpdates(_0x198b15,_0x432dd6){return function(_0x255841){if(_0x255841){return _0x255841[_0x9158('0x28')](_0x198b15)['then'](function(_0x8c73e9){return _0x8c73e9;});}return null;};}function removeEntity(_0x57c852,_0x40b0e5){return function(_0x5ea21a){if(_0x5ea21a){return _0x5ea21a[_0x9158('0x29')]()[_0x9158('0x2a')](function(){var _0x4bc176=_0x5ea21a[_0x9158('0x2b')]({'plain':!![]});var _0x3764d1='MailQueues';return db[_0x9158('0x2c')][_0x9158('0x29')]({'where':{'type':_0x3764d1,'resourceId':_0x4bc176['id']}})[_0x9158('0x2a')](function(){return _0x5ea21a;});})['then'](function(){_0x57c852[_0x9158('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x236ac1,_0x5a664a){return function(_0x14f2d6){if(!_0x14f2d6){_0x236ac1['sendStatus'](0x194);}return _0x14f2d6;};}function handleError(_0x7461ab,_0x45496c){_0x45496c=_0x45496c||0x1f4;return function(_0x6347ae){logger[_0x9158('0x2d')](_0x6347ae[_0x9158('0x2e')]);if(_0x6347ae[_0x9158('0x2f')]){delete _0x6347ae[_0x9158('0x2f')];}_0x7461ab[_0x9158('0x20')](_0x45496c)[_0x9158('0x30')](_0x6347ae);};}exports['index']=function(_0x18d83d,_0x46aed9){var _0x291ae4={},_0x3c9f63={},_0x596047={'count':0x0,'rows':[]};var _0x312365=_[_0x9158('0x31')](db[_0x9158('0x32')][_0x9158('0x33')],function(_0x3257c4){return{'name':_0x3257c4[_0x9158('0x34')],'type':_0x3257c4[_0x9158('0x35')]['key']};});_0x3c9f63[_0x9158('0x36')]=_[_0x9158('0x31')](_0x312365,_0x9158('0x2f'));_0x3c9f63[_0x9158('0x37')]=_['keys'](_0x18d83d[_0x9158('0x37')]);_0x3c9f63[_0x9158('0x38')]=_['intersection'](_0x3c9f63[_0x9158('0x36')],_0x3c9f63['query']);_0x291ae4[_0x9158('0x39')]=_['intersection'](_0x3c9f63['model'],qs[_0x9158('0x3a')](_0x18d83d[_0x9158('0x37')]['fields']));_0x291ae4[_0x9158('0x39')]=_0x291ae4[_0x9158('0x39')][_0x9158('0x3b')]?_0x291ae4[_0x9158('0x39')]:_0x3c9f63[_0x9158('0x36')];if(!_0x18d83d[_0x9158('0x37')]['hasOwnProperty'](_0x9158('0x3c'))){_0x291ae4[_0x9158('0x24')]=qs[_0x9158('0x24')](_0x18d83d[_0x9158('0x37')][_0x9158('0x24')]);_0x291ae4[_0x9158('0x23')]=qs[_0x9158('0x23')](_0x18d83d[_0x9158('0x37')][_0x9158('0x23')]);}_0x291ae4[_0x9158('0x3d')]=qs[_0x9158('0x3e')](_0x18d83d[_0x9158('0x37')]['sort']);_0x291ae4[_0x9158('0x3f')]=qs[_0x9158('0x38')](_[_0x9158('0x40')](_0x18d83d[_0x9158('0x37')],_0x3c9f63[_0x9158('0x38')]));if(_0x18d83d[_0x9158('0x37')][_0x9158('0x41')]){_0x291ae4[_0x9158('0x3f')]=_['merge'](_0x291ae4[_0x9158('0x3f')],{'$or':_['map'](_0x312365,function(_0x257d7c){if(_0x257d7c[_0x9158('0x35')]!=='VIRTUAL'){var _0x45582a={};_0x45582a[_0x257d7c['name']]={'$like':'%'+_0x18d83d[_0x9158('0x37')][_0x9158('0x41')]+'%'};return _0x45582a;}})});}_0x291ae4=_[_0x9158('0x42')]({},_0x291ae4,_0x18d83d[_0x9158('0x43')]);var _0xc6feb8={'where':_0x291ae4[_0x9158('0x3f')]};return db[_0x9158('0x32')]['count'](_0xc6feb8)[_0x9158('0x2a')](function(_0xf2aa1a){_0x596047['count']=_0xf2aa1a;if(_0x18d83d[_0x9158('0x37')]['includeAll']){_0x291ae4['include']=[{'all':!![]}];}return db['MailQueue'][_0x9158('0x44')](_0x291ae4);})[_0x9158('0x2a')](function(_0x32bf67){_0x596047['rows']=_0x32bf67;return _0x596047;})['then'](respondWithFilteredResult(_0x46aed9,_0x291ae4))[_0x9158('0x45')](handleError(_0x46aed9,null));};exports[_0x9158('0x46')]=function(_0x5d317e,_0x110b9b){var _0x2ec90a={'raw':!![],'where':{'id':_0x5d317e['params']['id']}},_0x25aa4f={};_0x25aa4f[_0x9158('0x36')]=_['keys'](db['MailQueue'][_0x9158('0x33')]);_0x25aa4f[_0x9158('0x37')]=_[_0x9158('0x47')](_0x5d317e[_0x9158('0x37')]);_0x25aa4f[_0x9158('0x38')]=_[_0x9158('0x48')](_0x25aa4f[_0x9158('0x36')],_0x25aa4f[_0x9158('0x37')]);_0x2ec90a[_0x9158('0x39')]=_[_0x9158('0x48')](_0x25aa4f[_0x9158('0x36')],qs[_0x9158('0x3a')](_0x5d317e[_0x9158('0x37')][_0x9158('0x3a')]));_0x2ec90a[_0x9158('0x39')]=_0x2ec90a[_0x9158('0x39')][_0x9158('0x3b')]?_0x2ec90a[_0x9158('0x39')]:_0x25aa4f[_0x9158('0x36')];if(_0x5d317e[_0x9158('0x37')][_0x9158('0x49')]){_0x2ec90a[_0x9158('0x4a')]=[{'all':!![]}];}_0x2ec90a=_[_0x9158('0x42')]({},_0x2ec90a,_0x5d317e[_0x9158('0x43')]);return db['MailQueue']['find'](_0x2ec90a)[_0x9158('0x2a')](handleEntityNotFound(_0x110b9b,null))[_0x9158('0x2a')](respondWithResult(_0x110b9b,null))['catch'](handleError(_0x110b9b,null));};exports['create']=function(_0x43f6cc,_0x33f2d4){return db['MailQueue'][_0x9158('0x4b')](_0x43f6cc[_0x9158('0x4c')],{})[_0x9158('0x2a')](function(_0x4ccabc){var _0x2320fe=_0x43f6cc[_0x9158('0x4d')][_0x9158('0x2b')]({'plain':!![]});if(!_0x2320fe)throw new Error(_0x9158('0x4e'));if(_0x2320fe[_0x9158('0x4f')]===_0x9158('0x4d')){var _0x465097=_0x4ccabc[_0x9158('0x2b')]({'plain':!![]});var _0x196be7='MailQueues';return db['UserProfileSection'][_0x9158('0x50')]({'where':{'name':_0x196be7,'userProfileId':_0x2320fe[_0x9158('0x51')]},'raw':!![]})[_0x9158('0x2a')](function(_0x13fea7){if(_0x13fea7&&_0x13fea7[_0x9158('0x52')]===0x0){return db[_0x9158('0x2c')]['create']({'name':_0x465097['name'],'resourceId':_0x465097['id'],'type':_0x13fea7[_0x9158('0x2f')],'sectionId':_0x13fea7['id']},{})['then'](function(){return _0x4ccabc;});}else{return _0x4ccabc;}})[_0x9158('0x45')](function(_0x1c9b59){logger[_0x9158('0x2d')](_0x9158('0x53'),_0x1c9b59);throw _0x1c9b59;});}return _0x4ccabc;})[_0x9158('0x2a')](respondWithResult(_0x33f2d4,0xc9))['catch'](handleError(_0x33f2d4,null));};exports[_0x9158('0x28')]=function(_0x2b1ece,_0xc825b6){if(_0x2b1ece[_0x9158('0x4c')]['id']){delete _0x2b1ece['body']['id'];}return db['MailQueue']['find']({'where':{'id':_0x2b1ece[_0x9158('0x54')]['id']}})[_0x9158('0x2a')](handleEntityNotFound(_0xc825b6,null))[_0x9158('0x2a')](saveUpdates(_0x2b1ece[_0x9158('0x4c')],null))[_0x9158('0x2a')](respondWithResult(_0xc825b6,null))['catch'](handleError(_0xc825b6,null));};exports[_0x9158('0x29')]=function(_0x1bdec3,_0x758eea){return db[_0x9158('0x32')][_0x9158('0x50')]({'where':{'id':_0x1bdec3['params']['id']}})[_0x9158('0x2a')](handleEntityNotFound(_0x758eea,null))[_0x9158('0x2a')](removeEntity(_0x758eea,null))[_0x9158('0x45')](handleError(_0x758eea,null));};exports['describe']=function(_0x2318ed,_0x40a39b){return db[_0x9158('0x32')][_0x9158('0x55')]()[_0x9158('0x2a')](respondWithResult(_0x40a39b,null))[_0x9158('0x45')](handleError(_0x40a39b,null));};exports['getMembers']=function(_0x2ce2be,_0x15593a,_0xad70c3){var _0x51055f={'raw':!![],'where':{}},_0xfd7cd8={},_0x58c605;return db[_0x9158('0x32')][_0x9158('0x56')]({'where':{'id':_0x2ce2be[_0x9158('0x54')]['id']}})[_0x9158('0x2a')](handleEntityNotFound(_0x15593a,null))[_0x9158('0x2a')](function(_0x2cad20){if(_0x2cad20){_0x58c605=_0x2cad20[_0x9158('0x2b')]({'plain':!![]});_0xfd7cd8[_0x9158('0x36')]=_[_0x9158('0x47')](db[_0x9158('0x57')][_0x9158('0x33')]);_0xfd7cd8['query']=_['keys'](_0x2ce2be[_0x9158('0x37')]);_0xfd7cd8[_0x9158('0x38')]=_[_0x9158('0x48')](_0xfd7cd8[_0x9158('0x36')],_0xfd7cd8[_0x9158('0x37')]);_0x51055f['attributes']=_[_0x9158('0x48')](_0xfd7cd8[_0x9158('0x36')],qs[_0x9158('0x3a')](_0x2ce2be[_0x9158('0x37')][_0x9158('0x3a')]));_0x51055f[_0x9158('0x39')]=_0x51055f[_0x9158('0x39')][_0x9158('0x3b')]?_0x51055f[_0x9158('0x39')]:_0xfd7cd8[_0x9158('0x36')];if(!_0x2ce2be[_0x9158('0x37')][_0x9158('0x58')](_0x9158('0x3c'))){_0x51055f[_0x9158('0x24')]=qs[_0x9158('0x24')](_0x2ce2be[_0x9158('0x37')][_0x9158('0x24')]);_0x51055f[_0x9158('0x23')]=qs[_0x9158('0x23')](_0x2ce2be[_0x9158('0x37')]['offset']);}_0x51055f['order']=qs[_0x9158('0x3e')](_0x2ce2be[_0x9158('0x37')]['sort']);_0x51055f[_0x9158('0x3f')]=qs[_0x9158('0x38')](_['pick'](_0x2ce2be[_0x9158('0x37')],_0xfd7cd8[_0x9158('0x38')]));_0x51055f['where'][_0x9158('0x59')]=_0x2cad20['id'];if(_0x2ce2be[_0x9158('0x37')][_0x9158('0x41')]){_0x51055f[_0x9158('0x3f')]=_[_0x9158('0x42')](_0x51055f[_0x9158('0x3f')],{'$or':_[_0x9158('0x31')](_0x51055f[_0x9158('0x39')],function(_0x27ce22){var _0x3262ec={};_0x3262ec[_0x27ce22]={'$like':'%'+_0x2ce2be[_0x9158('0x37')][_0x9158('0x41')]+'%'};return _0x3262ec;})});}_0x51055f=_['merge']({},_0x51055f,_0x2ce2be[_0x9158('0x43')]);return db[_0x9158('0x57')]['findAll'](_0x51055f);}})[_0x9158('0x2a')](function(_0x5e08a5){if(_0x5e08a5){return db[_0x9158('0x5a')][_0x9158('0x5b')]({'where':{'id':_['map'](_0x5e08a5,_0x9158('0x5c')),'role':_0x9158('0x5d')},'attributes':['id',_0x9158('0x2f'),_0x9158('0x5e'),'updatedAt','createdAt']});}})['then'](function(_0x3a7b14){if(_0x3a7b14){return{'count':_0x3a7b14['count'],'rows':_[_0x9158('0x31')](_0x3a7b14['rows'],function(_0x5f1629){return{'membername':_0x5f1629['name'],'UserId':_0x5f1629['id'],'queue_name':_0x58c605[_0x9158('0x2f')],'MailQueueId':_0x58c605['id'],'interface':util[_0x9158('0x5f')](_0x9158('0x60'),_0x9158('0x61'),_0x5f1629['name']),'penalty':0x0,'paused':_0x5f1629['mailPause'],'createdAt':_0x5f1629[_0x9158('0x62')],'updatedAt':_0x5f1629['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9158('0x2a')](respondWithFilteredResult(_0x15593a,_0x51055f))[_0x9158('0x45')](handleError(_0x15593a,null));};exports['getTeams']=function(_0x5de3fa,_0x807403,_0x4f0623){var _0x42ca60={};var _0x4d6ec2={};var _0x4c3557;var _0x32baca;return db[_0x9158('0x32')][_0x9158('0x56')]({'where':{'id':_0x5de3fa[_0x9158('0x54')]['id']}})['then'](handleEntityNotFound(_0x807403,null))['then'](function(_0x11ca22){if(_0x11ca22){_0x4c3557=_0x11ca22;_0x4d6ec2['model']=_['keys'](db[_0x9158('0x63')]['rawAttributes']);_0x4d6ec2[_0x9158('0x37')]=_['keys'](_0x5de3fa[_0x9158('0x37')]);_0x4d6ec2[_0x9158('0x38')]=_[_0x9158('0x48')](_0x4d6ec2[_0x9158('0x36')],_0x4d6ec2[_0x9158('0x37')]);_0x42ca60[_0x9158('0x39')]=_[_0x9158('0x48')](_0x4d6ec2[_0x9158('0x36')],qs['fields'](_0x5de3fa[_0x9158('0x37')][_0x9158('0x3a')]));_0x42ca60[_0x9158('0x39')]=_0x42ca60['attributes'][_0x9158('0x3b')]?_0x42ca60[_0x9158('0x39')]:_0x4d6ec2[_0x9158('0x36')];_0x42ca60[_0x9158('0x3d')]=qs[_0x9158('0x3e')](_0x5de3fa['query'][_0x9158('0x3e')]);_0x42ca60[_0x9158('0x3f')]=qs[_0x9158('0x38')](_[_0x9158('0x40')](_0x5de3fa[_0x9158('0x37')],_0x4d6ec2['filters']));if(_0x5de3fa['query']['filter']){_0x42ca60[_0x9158('0x3f')]=_[_0x9158('0x42')](_0x42ca60[_0x9158('0x3f')],{'$or':_['map'](_0x42ca60[_0x9158('0x39')],function(_0x29cc0a){var _0x3bf0b8={};_0x3bf0b8[_0x29cc0a]={'$like':'%'+_0x5de3fa[_0x9158('0x37')]['filter']+'%'};return _0x3bf0b8;})});}_0x42ca60=_[_0x9158('0x42')]({},_0x42ca60,_0x5de3fa[_0x9158('0x43')]);return _0x4c3557[_0x9158('0x64')](_0x42ca60);}})[_0x9158('0x2a')](function(_0x1a47eb){if(_0x1a47eb){_0x32baca=_0x1a47eb[_0x9158('0x3b')];if(!_0x5de3fa[_0x9158('0x37')]['hasOwnProperty']('nolimit')){_0x42ca60[_0x9158('0x24')]=qs[_0x9158('0x24')](_0x5de3fa[_0x9158('0x37')][_0x9158('0x24')]);_0x42ca60['offset']=qs[_0x9158('0x23')](_0x5de3fa[_0x9158('0x37')]['offset']);}return _0x4c3557[_0x9158('0x64')](_0x42ca60);}})['then'](function(_0x278efa){if(_0x278efa){return _0x278efa?{'count':_0x32baca,'rows':_0x278efa}:null;}})[_0x9158('0x2a')](respondWithResult(_0x807403,null))[_0x9158('0x45')](handleError(_0x807403,null));};exports[_0x9158('0x65')]=function(_0x372849,_0x1a5066,_0x134af3){var _0x266154=_0x372849['body'][_0x9158('0x66')];return db[_0x9158('0x63')]['findAll']({'where':{'id':_0x266154},'attributes':['id'],'include':[{'model':db[_0x9158('0x5a')],'as':'Agents','attributes':['id',_0x9158('0x2f'),_0x9158('0x67'),_0x9158('0x68'),'interface'],'raw':!![]}]})[_0x9158('0x2a')](function(_0x1e376f){if(_0x1e376f){var _0x26eaca=_['flatMap'](_0x1e376f,function(_0x4c7ae2){var _0x266d83=_0x4c7ae2[_0x9158('0x2b')]({'plain':!![]});return _0x266d83['Agents'];});return db[_0x9158('0x32')][_0x9158('0x50')]({'where':{'id':_0x372849[_0x9158('0x54')]['id']}})[_0x9158('0x2a')](function(_0x4ba78b){return db[_0x9158('0x69')]['transaction'](function(_0x22ca62){return _0x4ba78b[_0x9158('0x65')](_0x266154,{'transaction':_0x22ca62})[_0x9158('0x2a')](function(){return BPromise['each'](_0x26eaca,function(_0x4f802a){return db[_0x9158('0x57')][_0x9158('0x6a')]({'where':{'UserId':_0x4f802a['id'],'MailQueueId':_0x372849[_0x9158('0x54')]['id']},'transaction':_0x22ca62});});})[_0x9158('0x2a')](function(){_0x26eaca[_0x9158('0x6b')](function(_0xf9d1bc){socket[_0x9158('0x6c')](_0x9158('0x6d'),{'UserId':_0xf9d1bc['id'],'MailQueueId':_0x4ba78b['id']});});});});});}})[_0x9158('0x2a')](respondWithStatusCode(_0x1a5066,null))[_0x9158('0x45')](handleError(_0x1a5066,null));};exports[_0x9158('0x6e')]=function(_0x3903c5,_0x165a60,_0x326df9){return db[_0x9158('0x63')][_0x9158('0x44')]({'where':{'id':_0x3903c5['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9158('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x165a60,null))[_0x9158('0x2a')](function(_0x4ea170){var _0x200ddd=_['map'](_0x4ea170,'id');var _0x53a322=[];var _0x81837=[];var _0x4ff880=squel[_0x9158('0x70')]();_0x4ff880[_0x9158('0x71')](_0x9158('0x72'))[_0x9158('0x73')]('team_has_mail_queues','tq')[_0x9158('0x74')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9158('0x3f')](_0x9158('0x75'),_0x3903c5[_0x9158('0x54')]['id']);for(var _0x4f6381=0x0;_0x4f6381<_0x4ea170[_0x9158('0x3b')];_0x4f6381+=0x1){let _0x215c55=_0x4ea170[_0x4f6381];for(var _0x1c78a9=0x0;_0x1c78a9<_0x215c55[_0x9158('0x6f')][_0x9158('0x3b')];_0x1c78a9+=0x1){let _0x4d266e=_0x215c55[_0x9158('0x6f')][_0x1c78a9];var _0x5b9be5=_0x4ff880[_0x9158('0x76')]();_0x5b9be5[_0x9158('0x3f')]('ut.UserId\x20=\x20?',_0x4d266e['id']);_0x81837[_0x9158('0x77')](db[_0x9158('0x69')][_0x9158('0x37')](_0x5b9be5[_0x9158('0x78')](),{'type':db[_0x9158('0x69')][_0x9158('0x79')][_0x9158('0x7a')]})['then'](function(_0xa29726){if(_0xa29726[_0x9158('0x3b')]===0x1){return _0x4d266e['id'];}else{var _0x47c640=_[_0x9158('0x7b')](_[_0x9158('0x31')](_0xa29726,'TeamId'),function(_0x32e731){return _['includes'](_0x200ddd,_0x32e731);});if(_0x47c640){return _0x4d266e['id'];}}}));}}return BPromise[_0x9158('0x7c')](_0x81837)[_0x9158('0x2a')](function(_0x5a700a){_0x53a322=_(_0x53a322)['union'](_0x5a700a)['compact']()[_0x9158('0x7d')]();return db[_0x9158('0x32')]['find']({'where':{'id':_0x3903c5['params']['id']}})[_0x9158('0x2a')](function(_0x5ad12f){return db['sequelize']['transaction'](function(_0xb53dfc){return _0x5ad12f[_0x9158('0x6e')](_0x3903c5['query'][_0x9158('0x66')],{'transaction':_0xb53dfc})[_0x9158('0x2a')](function(){if(!_[_0x9158('0x7e')](_0x53a322)){return _0x5ad12f[_0x9158('0x7f')](_0x53a322,{'transaction':_0xb53dfc});}})['then'](function(){_0x53a322[_0x9158('0x6b')](function(_0xe9d4fc){socket[_0x9158('0x6c')](_0x9158('0x80'),{'UserId':_0xe9d4fc,'MailQueueId':_0x5ad12f['id']});});});});});});})['then'](respondWithStatusCode(_0x165a60,null))[_0x9158('0x45')](handleError(_0x165a60,null));};exports['addAgents']=function(_0x5a3e4e,_0x40e7cf,_0x2b157f){return db[_0x9158('0x32')]['find']({'where':{'id':_0x5a3e4e[_0x9158('0x54')]['id']}})[_0x9158('0x2a')](handleEntityNotFound(_0x40e7cf,null))['then'](function(_0x3a1ebb){if(_0x3a1ebb){return _0x3a1ebb[_0x9158('0x81')](_0x5a3e4e[_0x9158('0x4c')][_0x9158('0x66')],_[_0x9158('0x82')](_0x5a3e4e[_0x9158('0x4c')],['ids','id'])||{})['spread'](function(_0x2896d8){for(var _0x3299cc=0x0;_0x3299cc<_0x5a3e4e[_0x9158('0x4c')]['ids'][_0x9158('0x3b')];_0x3299cc+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x5a3e4e[_0x9158('0x4c')][_0x9158('0x66')][_0x3299cc],'MailQueueId':_0x5a3e4e['params']['id']});}return _0x2896d8;});}})[_0x9158('0x2a')](respondWithResult(_0x40e7cf,null))[_0x9158('0x45')](handleError(_0x40e7cf,null));};exports[_0x9158('0x7f')]=function(_0xd6e63c,_0x3cce29,_0x143dd6){return db[_0x9158('0x32')][_0x9158('0x50')]({'where':{'id':_0xd6e63c[_0x9158('0x54')]['id']}})[_0x9158('0x2a')](handleEntityNotFound(_0x3cce29,null))[_0x9158('0x2a')](function(_0x274086){if(_0x274086){return _0x274086[_0x9158('0x7f')](_0xd6e63c['query'][_0x9158('0x66')])['then'](function(){if(_['isArray'](_0xd6e63c['query'][_0x9158('0x66')])){for(var _0x5f2b6d=0x0;_0x5f2b6d<_0xd6e63c['query'][_0x9158('0x66')][_0x9158('0x3b')];_0x5f2b6d+=0x1){socket[_0x9158('0x6c')](_0x9158('0x80'),{'UserId':Number(_0xd6e63c[_0x9158('0x37')][_0x9158('0x66')][_0x5f2b6d]),'MailQueueId':Number(_0xd6e63c[_0x9158('0x54')]['id'])});}}else{socket[_0x9158('0x6c')]('userMailQueue:remove',{'UserId':Number(_0xd6e63c['query'][_0x9158('0x66')]),'MailQueueId':Number(_0xd6e63c[_0x9158('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3cce29,null))[_0x9158('0x45')](handleError(_0x3cce29,null));};exports['getAgents']=function(_0x2e4863,_0x1eece3,_0x539550){var _0x33db93={};var _0x36700c={};var _0x22b715;var _0xfeb67b;return db[_0x9158('0x32')][_0x9158('0x56')]({'where':{'id':_0x2e4863[_0x9158('0x54')]['id']}})['then'](handleEntityNotFound(_0x1eece3,null))[_0x9158('0x2a')](function(_0x1b45d6){if(_0x1b45d6){_0x22b715=_0x1b45d6;_0x36700c['model']=_[_0x9158('0x47')](db[_0x9158('0x5a')]['rawAttributes']);_0x36700c[_0x9158('0x37')]=_[_0x9158('0x47')](_0x2e4863[_0x9158('0x37')]);_0x36700c[_0x9158('0x38')]=_[_0x9158('0x48')](_0x36700c[_0x9158('0x36')],_0x36700c[_0x9158('0x37')]);_0x33db93[_0x9158('0x39')]=_[_0x9158('0x48')](_0x36700c[_0x9158('0x36')],qs[_0x9158('0x3a')](_0x2e4863['query'][_0x9158('0x3a')]));_0x33db93[_0x9158('0x39')]=_0x33db93[_0x9158('0x39')][_0x9158('0x3b')]?_0x33db93[_0x9158('0x39')]:_0x36700c[_0x9158('0x36')];_0x33db93[_0x9158('0x3d')]=qs[_0x9158('0x3e')](_0x2e4863[_0x9158('0x37')][_0x9158('0x3e')]);_0x33db93[_0x9158('0x3f')]=qs['filters'](_[_0x9158('0x40')](_0x2e4863['query'],_0x36700c['filters']));if(_0x2e4863[_0x9158('0x37')][_0x9158('0x41')]){_0x33db93['where']=_[_0x9158('0x42')](_0x33db93[_0x9158('0x3f')],{'$or':_[_0x9158('0x31')](_0x33db93['attributes'],function(_0x2818a4){var _0x1ed7db={};_0x1ed7db[_0x2818a4]={'$like':'%'+_0x2e4863[_0x9158('0x37')][_0x9158('0x41')]+'%'};return _0x1ed7db;})});}_0x33db93=_[_0x9158('0x42')]({},_0x33db93,_0x2e4863[_0x9158('0x43')]);return _0x22b715[_0x9158('0x83')](_0x33db93);}})['then'](function(_0x14bab4){if(_0x14bab4){_0xfeb67b=_0x14bab4['length'];if(!_0x2e4863[_0x9158('0x37')][_0x9158('0x58')](_0x9158('0x3c'))){_0x33db93[_0x9158('0x24')]=qs[_0x9158('0x24')](_0x2e4863[_0x9158('0x37')][_0x9158('0x24')]);_0x33db93[_0x9158('0x23')]=qs[_0x9158('0x23')](_0x2e4863[_0x9158('0x37')]['offset']);}return _0x22b715[_0x9158('0x83')](_0x33db93);}})[_0x9158('0x2a')](function(_0x2f52b9){if(_0x2f52b9){return _0x2f52b9?{'count':_0xfeb67b,'rows':_0x2f52b9}:null;}})[_0x9158('0x2a')](respondWithResult(_0x1eece3,null))['catch'](handleError(_0x1eece3,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 999d608..eeff765 100644 --- a/server/api/mailQueue/mailQueue.events.js +++ b/server/api/mailQueue/mailQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4044=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5d0d22,_0x125fb9){var _0x4a5d85=function(_0x1c7f61){while(--_0x1c7f61){_0x5d0d22['push'](_0x5d0d22['shift']());}};_0x4a5d85(++_0x125fb9);}(_0x4044,0x1a0));var _0x4404=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4044[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x4404('0x0'));var MailQueue=require(_0x4404('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4404('0x2')](0x0);var events={'afterCreate':_0x4404('0x3'),'afterUpdate':'update','afterDestroy':_0x4404('0x4')};function emitEvent(_0x34ce03){return function(_0x4208a1,_0x341663,_0x5b04db){MailQueueEvents[_0x4404('0x5')](_0x34ce03+':'+_0x4208a1['id'],_0x4208a1);MailQueueEvents[_0x4404('0x5')](_0x34ce03,_0x4208a1);_0x5b04db(null);};}for(var e in events){if(events[_0x4404('0x6')](e)){var event=events[e];MailQueue[_0x4404('0x7')](e,emitEvent(event));}}module[_0x4404('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xe257=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xbbdc80,_0x44545b){var _0x40b7c6=function(_0x3a0478){while(--_0x3a0478){_0xbbdc80['push'](_0xbbdc80['shift']());}};_0x40b7c6(++_0x44545b);}(_0xe257,0x153));var _0x7e25=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xe257[_0x4bacb6];return _0x58c029;};'use strict';var EventEmitter=require(_0x7e25('0x0'));var MailQueue=require(_0x7e25('0x1'))['db'][_0x7e25('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7e25('0x3')](0x0);var events={'afterCreate':_0x7e25('0x4'),'afterUpdate':_0x7e25('0x5'),'afterDestroy':_0x7e25('0x6')};function emitEvent(_0x8de726){return function(_0x424d1f,_0xa81551,_0x2cd18b){MailQueueEvents[_0x7e25('0x7')](_0x8de726+':'+_0x424d1f['id'],_0x424d1f);MailQueueEvents['emit'](_0x8de726,_0x424d1f);_0x2cd18b(null);};}for(var e in events){if(events[_0x7e25('0x8')](e)){var event=events[e];MailQueue[_0x7e25('0x9')](e,emitEvent(event));}}module[_0x7e25('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 56638bf..d26814a 100644 --- a/server/api/mailQueue/mailQueue.model.js +++ b/server/api/mailQueue/mailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cf3=['path','rimraf','../../config/environment','exports','define','MailQueue','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c1633,_0x13c722){var _0x490a1c=function(_0x12e22b){while(--_0x12e22b){_0x5c1633['push'](_0x5c1633['shift']());}};_0x490a1c(++_0x13c722);}(_0x7cf3,0x1c2));var _0x37cf=function(_0x5d9ceb,_0x1a49f5){_0x5d9ceb=_0x5d9ceb-0x0;var _0x33ce82=_0x7cf3[_0x5d9ceb];return _0x33ce82;};'use strict';var _=require(_0x37cf('0x0'));var util=require('util');var logger=require(_0x37cf('0x1'))(_0x37cf('0x2'));var moment=require(_0x37cf('0x3'));var BPromise=require(_0x37cf('0x4'));var rp=require(_0x37cf('0x5'));var fs=require('fs');var path=require(_0x37cf('0x6'));var rimraf=require(_0x37cf('0x7'));var config=require(_0x37cf('0x8'));var attributes=require('./mailQueue.attributes');module[_0x37cf('0x9')]=function(_0x2c67a0,_0x1b4bf8){return _0x2c67a0[_0x37cf('0xa')](_0x37cf('0xb'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5d0=['MailQueue','mail_queues','lodash','../../config/logger','api','bluebird','path','rimraf','define'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xc5d0,0xc8));var _0x0c5d=function(_0x5c2310,_0x2cacbf){_0x5c2310=_0x5c2310-0x0;var _0x3d6433=_0xc5d0[_0x5c2310];return _0x3d6433;};'use strict';var _=require(_0x0c5d('0x0'));var util=require('util');var logger=require(_0x0c5d('0x1'))(_0x0c5d('0x2'));var moment=require('moment');var BPromise=require(_0x0c5d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c5d('0x4'));var rimraf=require(_0x0c5d('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x20702a,_0x2de01e){return _0x20702a[_0x0c5d('0x6')](_0x0c5d('0x7'),attributes,{'tableName':_0x0c5d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 0c06e44..9abc57d 100644 --- a/server/api/mailQueue/mailQueue.rpc.js +++ b/server/api/mailQueue/mailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa33=['moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailQueue','MailQueue','options','attributes','limit','map','include','model','catch','ShowMailQueue','find','raw','where','lodash','util'];(function(_0x4f505c,_0x2803aa){var _0xb2f687=function(_0x274b12){while(--_0x274b12){_0x4f505c['push'](_0x4f505c['shift']());}};_0xb2f687(++_0x2803aa);}(_0xfa33,0x73));var _0x3fa3=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0xfa33[_0x4cf8d4];return _0x2c1beb;};'use strict';var _=require(_0x3fa3('0x0'));var util=require(_0x3fa3('0x1'));var moment=require(_0x3fa3('0x2'));var BPromise=require(_0x3fa3('0x3'));var rs=require(_0x3fa3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3fa3('0x5'))(_0x3fa3('0x6'));var config=require(_0x3fa3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3fa3('0x8')][_0x3fa3('0x9')]({'port':0x232a});config[_0x3fa3('0xa')]=_['defaults'](config[_0x3fa3('0xa')],{'host':_0x3fa3('0xb'),'port':0x18eb});var socket=require(_0x3fa3('0xc'))(new Redis(config[_0x3fa3('0xa')]));require(_0x3fa3('0xd'))['register'](socket);function respondWithRpcPromise(_0x37c589,_0x11e160,_0x42dadc){return new BPromise(function(_0x17b58f,_0x1905b8){return client[_0x3fa3('0xe')](_0x37c589,_0x42dadc)[_0x3fa3('0xf')](function(_0x115fb6){logger[_0x3fa3('0x10')](_0x3fa3('0x11'),_0x11e160,'request\x20sent');logger[_0x3fa3('0x12')](_0x3fa3('0x13'),_0x11e160,_0x3fa3('0x14'),JSON[_0x3fa3('0x15')](_0x115fb6));if(_0x115fb6['error']){if(_0x115fb6[_0x3fa3('0x16')][_0x3fa3('0x17')]===0x1f4){logger[_0x3fa3('0x16')](_0x3fa3('0x11'),_0x11e160,_0x115fb6[_0x3fa3('0x16')][_0x3fa3('0x18')]);return _0x1905b8(_0x115fb6[_0x3fa3('0x16')][_0x3fa3('0x18')]);}logger[_0x3fa3('0x16')](_0x3fa3('0x11'),_0x11e160,_0x115fb6[_0x3fa3('0x16')][_0x3fa3('0x18')]);return _0x17b58f(_0x115fb6['error'][_0x3fa3('0x18')]);}else{logger[_0x3fa3('0x10')](_0x3fa3('0x11'),_0x11e160,'request\x20sent');_0x17b58f(_0x115fb6[_0x3fa3('0x19')]['message']);}})['catch'](function(_0x3e9d78){logger['error'](_0x3fa3('0x11'),_0x11e160,_0x3e9d78);_0x1905b8(_0x3e9d78);});});}exports[_0x3fa3('0x1a')]=function(_0x1f434d){var _0x5c3ea8=this;return new Promise(function(_0x26d22e,_0x5c8418){return db[_0x3fa3('0x1b')]['findAll']({'raw':_0x1f434d[_0x3fa3('0x1c')]?_0x1f434d['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f434d[_0x3fa3('0x1c')]?_0x1f434d[_0x3fa3('0x1c')]['where']||null:null,'attributes':_0x1f434d[_0x3fa3('0x1c')]?_0x1f434d[_0x3fa3('0x1c')][_0x3fa3('0x1d')]||null:null,'limit':_0x1f434d['options']?_0x1f434d[_0x3fa3('0x1c')][_0x3fa3('0x1e')]||null:null,'include':_0x1f434d[_0x3fa3('0x1c')]?_0x1f434d['options']['include']?_[_0x3fa3('0x1f')](_0x1f434d[_0x3fa3('0x1c')][_0x3fa3('0x20')],function(_0x582f6b){return{'model':db[_0x582f6b[_0x3fa3('0x21')]],'as':_0x582f6b['as'],'attributes':_0x582f6b[_0x3fa3('0x1d')],'include':_0x582f6b['include']?_[_0x3fa3('0x1f')](_0x582f6b['include'],function(_0x10b5db){return{'model':db[_0x10b5db['model']],'as':_0x10b5db['as'],'attributes':_0x10b5db[_0x3fa3('0x1d')],'include':_0x10b5db[_0x3fa3('0x20')]?_[_0x3fa3('0x1f')](_0x10b5db['include'],function(_0x17b848){return{'model':db[_0x17b848[_0x3fa3('0x21')]],'as':_0x17b848['as'],'attributes':_0x17b848[_0x3fa3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3fa3('0xf')](function(_0x3cd916){logger['info'](_0x3fa3('0x1a'),_0x1f434d);logger[_0x3fa3('0x12')](_0x3fa3('0x1a'),_0x1f434d,JSON[_0x3fa3('0x15')](_0x3cd916));_0x26d22e(_0x3cd916);})[_0x3fa3('0x22')](function(_0x35c5db){logger[_0x3fa3('0x16')](_0x3fa3('0x1a'),_0x35c5db[_0x3fa3('0x18')],_0x1f434d);_0x5c8418(_0x5c3ea8[_0x3fa3('0x16')](0x1f4,_0x35c5db[_0x3fa3('0x18')]));});});};exports[_0x3fa3('0x23')]=function(_0xbdcf95){var _0x49793a=this;return new Promise(function(_0x2136ce,_0x40c295){return db[_0x3fa3('0x1b')][_0x3fa3('0x24')]({'raw':_0xbdcf95[_0x3fa3('0x1c')]?_0xbdcf95['options'][_0x3fa3('0x25')]===undefined?!![]:![]:!![],'where':_0xbdcf95['options']?_0xbdcf95[_0x3fa3('0x1c')][_0x3fa3('0x26')]||null:null,'attributes':_0xbdcf95[_0x3fa3('0x1c')]?_0xbdcf95[_0x3fa3('0x1c')][_0x3fa3('0x1d')]||null:null,'include':_0xbdcf95['options']?_0xbdcf95[_0x3fa3('0x1c')][_0x3fa3('0x20')]?_[_0x3fa3('0x1f')](_0xbdcf95['options'][_0x3fa3('0x20')],function(_0x41bd52){return{'model':db[_0x41bd52[_0x3fa3('0x21')]],'as':_0x41bd52['as'],'attributes':_0x41bd52[_0x3fa3('0x1d')],'include':_0x41bd52['include']?_[_0x3fa3('0x1f')](_0x41bd52[_0x3fa3('0x20')],function(_0x245d78){return{'model':db[_0x245d78[_0x3fa3('0x21')]],'as':_0x245d78['as'],'attributes':_0x245d78[_0x3fa3('0x1d')],'include':_0x245d78['include']?_[_0x3fa3('0x1f')](_0x245d78[_0x3fa3('0x20')],function(_0x4b31d7){return{'model':db[_0x4b31d7['model']],'as':_0x4b31d7['as'],'attributes':_0x4b31d7[_0x3fa3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bddde){logger[_0x3fa3('0x10')]('ShowMailQueue',_0xbdcf95);logger[_0x3fa3('0x12')](_0x3fa3('0x23'),_0xbdcf95,JSON['stringify'](_0x4bddde));_0x2136ce(_0x4bddde);})[_0x3fa3('0x22')](function(_0x5e9602){logger['error'](_0x3fa3('0x23'),_0x5e9602[_0x3fa3('0x18')],_0xbdcf95);_0x40c295(_0x49793a[_0x3fa3('0x16')](0x1f4,_0x5e9602[_0x3fa3('0x18')]));});});}; \ No newline at end of file +var _0x5a52=['defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetMailQueue','ShowMailQueue','find','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http'];(function(_0x40317e,_0x59e2f9){var _0x5a3918=function(_0x5b67e9){while(--_0x5b67e9){_0x40317e['push'](_0x40317e['shift']());}};_0x5a3918(++_0x59e2f9);}(_0x5a52,0xc3));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x25a5('0x0'));var util=require(_0x25a5('0x1'));var moment=require('moment');var BPromise=require(_0x25a5('0x2'));var rs=require(_0x25a5('0x3'));var fs=require('fs');var Redis=require(_0x25a5('0x4'));var db=require(_0x25a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x25a5('0x6'))(_0x25a5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25a5('0x8')][_0x25a5('0x9')]({'port':0x232a});config['redis']=_[_0x25a5('0xa')](config[_0x25a5('0xb')],{'host':_0x25a5('0xc'),'port':0x18eb});var socket=require(_0x25a5('0xd'))(new Redis(config[_0x25a5('0xb')]));require(_0x25a5('0xe'))['register'](socket);function respondWithRpcPromise(_0x3721fc,_0x26d817,_0x54e86b){return new BPromise(function(_0x5f0860,_0x4db68c){return client[_0x25a5('0xf')](_0x3721fc,_0x54e86b)[_0x25a5('0x10')](function(_0x8ae0f9){logger[_0x25a5('0x11')](_0x25a5('0x12'),_0x26d817,_0x25a5('0x13'));logger['debug'](_0x25a5('0x14'),_0x26d817,'request\x20sent',JSON[_0x25a5('0x15')](_0x8ae0f9));if(_0x8ae0f9['error']){if(_0x8ae0f9['error'][_0x25a5('0x16')]===0x1f4){logger[_0x25a5('0x17')]('MailQueue,\x20%s,\x20%s',_0x26d817,_0x8ae0f9[_0x25a5('0x17')]['message']);return _0x4db68c(_0x8ae0f9[_0x25a5('0x17')][_0x25a5('0x18')]);}logger[_0x25a5('0x17')]('MailQueue,\x20%s,\x20%s',_0x26d817,_0x8ae0f9[_0x25a5('0x17')]['message']);return _0x5f0860(_0x8ae0f9['error'][_0x25a5('0x18')]);}else{logger[_0x25a5('0x11')](_0x25a5('0x12'),_0x26d817,_0x25a5('0x13'));_0x5f0860(_0x8ae0f9[_0x25a5('0x19')][_0x25a5('0x18')]);}})[_0x25a5('0x1a')](function(_0x3b7399){logger[_0x25a5('0x17')](_0x25a5('0x12'),_0x26d817,_0x3b7399);_0x4db68c(_0x3b7399);});});}exports['GetMailQueue']=function(_0x4d45e6){var _0x4a94fc=this;return new Promise(function(_0x47846f,_0x109c50){return db[_0x25a5('0x1b')][_0x25a5('0x1c')]({'raw':_0x4d45e6['options']?_0x4d45e6[_0x25a5('0x1d')][_0x25a5('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d45e6[_0x25a5('0x1d')]?_0x4d45e6[_0x25a5('0x1d')][_0x25a5('0x1f')]||null:null,'attributes':_0x4d45e6[_0x25a5('0x1d')]?_0x4d45e6[_0x25a5('0x1d')][_0x25a5('0x20')]||null:null,'limit':_0x4d45e6[_0x25a5('0x1d')]?_0x4d45e6[_0x25a5('0x1d')][_0x25a5('0x21')]||null:null,'include':_0x4d45e6[_0x25a5('0x1d')]?_0x4d45e6[_0x25a5('0x1d')][_0x25a5('0x22')]?_[_0x25a5('0x23')](_0x4d45e6['options'][_0x25a5('0x22')],function(_0x8c34e6){return{'model':db[_0x8c34e6[_0x25a5('0x24')]],'as':_0x8c34e6['as'],'attributes':_0x8c34e6[_0x25a5('0x20')],'include':_0x8c34e6[_0x25a5('0x22')]?_[_0x25a5('0x23')](_0x8c34e6['include'],function(_0xcf16bb){return{'model':db[_0xcf16bb['model']],'as':_0xcf16bb['as'],'attributes':_0xcf16bb['attributes'],'include':_0xcf16bb[_0x25a5('0x22')]?_[_0x25a5('0x23')](_0xcf16bb[_0x25a5('0x22')],function(_0x406b90){return{'model':db[_0x406b90[_0x25a5('0x24')]],'as':_0x406b90['as'],'attributes':_0x406b90[_0x25a5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x393f2e){logger['info'](_0x25a5('0x25'),_0x4d45e6);logger['debug'](_0x25a5('0x25'),_0x4d45e6,JSON[_0x25a5('0x15')](_0x393f2e));_0x47846f(_0x393f2e);})[_0x25a5('0x1a')](function(_0x58eb5d){logger[_0x25a5('0x17')]('GetMailQueue',_0x58eb5d[_0x25a5('0x18')],_0x4d45e6);_0x109c50(_0x4a94fc[_0x25a5('0x17')](0x1f4,_0x58eb5d[_0x25a5('0x18')]));});});};exports[_0x25a5('0x26')]=function(_0x27d1b1){var _0x1956e7=this;return new Promise(function(_0xb04e66,_0x2b0bbf){return db[_0x25a5('0x1b')][_0x25a5('0x27')]({'raw':_0x27d1b1[_0x25a5('0x1d')]?_0x27d1b1[_0x25a5('0x1d')][_0x25a5('0x1e')]===undefined?!![]:![]:!![],'where':_0x27d1b1[_0x25a5('0x1d')]?_0x27d1b1[_0x25a5('0x1d')][_0x25a5('0x1f')]||null:null,'attributes':_0x27d1b1[_0x25a5('0x1d')]?_0x27d1b1[_0x25a5('0x1d')]['attributes']||null:null,'include':_0x27d1b1[_0x25a5('0x1d')]?_0x27d1b1[_0x25a5('0x1d')][_0x25a5('0x22')]?_[_0x25a5('0x23')](_0x27d1b1[_0x25a5('0x1d')][_0x25a5('0x22')],function(_0x117d72){return{'model':db[_0x117d72[_0x25a5('0x24')]],'as':_0x117d72['as'],'attributes':_0x117d72[_0x25a5('0x20')],'include':_0x117d72[_0x25a5('0x22')]?_['map'](_0x117d72[_0x25a5('0x22')],function(_0x2d4c34){return{'model':db[_0x2d4c34['model']],'as':_0x2d4c34['as'],'attributes':_0x2d4c34[_0x25a5('0x20')],'include':_0x2d4c34[_0x25a5('0x22')]?_[_0x25a5('0x23')](_0x2d4c34[_0x25a5('0x22')],function(_0x5d90ec){return{'model':db[_0x5d90ec[_0x25a5('0x24')]],'as':_0x5d90ec['as'],'attributes':_0x5d90ec[_0x25a5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x25a5('0x10')](function(_0x12203b){logger[_0x25a5('0x11')](_0x25a5('0x26'),_0x27d1b1);logger[_0x25a5('0x28')](_0x25a5('0x26'),_0x27d1b1,JSON[_0x25a5('0x15')](_0x12203b));_0xb04e66(_0x12203b);})[_0x25a5('0x1a')](function(_0x4ce524){logger[_0x25a5('0x17')]('ShowMailQueue',_0x4ce524['message'],_0x27d1b1);_0x2b0bbf(_0x1956e7[_0x25a5('0x17')](0x1f4,_0x4ce524[_0x25a5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 44f7966..3f4c08e 100644 --- a/server/api/mailQueue/mailQueue.socket.js +++ b/server/api/mailQueue/mailQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x548b=['mailQueue:','./mailQueue.events','save','update','emit','removeListener','length'];(function(_0x2ff44c,_0xee717e){var _0x424af0=function(_0x51da2b){while(--_0x51da2b){_0x2ff44c['push'](_0x2ff44c['shift']());}};_0x424af0(++_0xee717e);}(_0x548b,0x16d));var _0xb548=function(_0x3f4b07,_0x15d850){_0x3f4b07=_0x3f4b07-0x0;var _0x46de71=_0x548b[_0x3f4b07];return _0x46de71;};'use strict';var MailQueueEvents=require(_0xb548('0x0'));var events=[_0xb548('0x1'),'remove',_0xb548('0x2')];function createListener(_0x481ee8,_0x4fdc9f){return function(_0x6509bf){_0x4fdc9f[_0xb548('0x3')](_0x481ee8,_0x6509bf);};}function removeListener(_0x169ec6,_0x4daab3){return function(){MailQueueEvents[_0xb548('0x4')](_0x169ec6,_0x4daab3);};}exports['register']=function(_0x11eaf1){for(var _0x4a4180=0x0,_0x5872ce=events[_0xb548('0x5')];_0x4a4180<_0x5872ce;_0x4a4180++){var _0x5bb347=events[_0x4a4180];var _0x5acbc3=createListener(_0xb548('0x6')+_0x5bb347,_0x11eaf1);MailQueueEvents['on'](_0x5bb347,_0x5acbc3);}}; \ No newline at end of file +var _0xc6cd=['removeListener','register','length','./mailQueue.events','save','remove','emit'];(function(_0x58a1a5,_0x12ea23){var _0x4d3356=function(_0x34d5ef){while(--_0x34d5ef){_0x58a1a5['push'](_0x58a1a5['shift']());}};_0x4d3356(++_0x12ea23);}(_0xc6cd,0x73));var _0xdc6c=function(_0x46d3e9,_0xbf7c1c){_0x46d3e9=_0x46d3e9-0x0;var _0x50a49c=_0xc6cd[_0x46d3e9];return _0x50a49c;};'use strict';var MailQueueEvents=require(_0xdc6c('0x0'));var events=[_0xdc6c('0x1'),_0xdc6c('0x2'),'update'];function createListener(_0x524304,_0x335f9a){return function(_0x34318e){_0x335f9a[_0xdc6c('0x3')](_0x524304,_0x34318e);};}function removeListener(_0x4c69d8,_0x55d278){return function(){MailQueueEvents[_0xdc6c('0x4')](_0x4c69d8,_0x55d278);};}exports[_0xdc6c('0x5')]=function(_0x3fe1b1){for(var _0x3927c0=0x0,_0x3dc4b1=events[_0xdc6c('0x6')];_0x3927c0<_0x3dc4b1;_0x3927c0++){var _0x35fde4=events[_0x3927c0];var _0x4ba31f=createListener('mailQueue:'+_0x35fde4,_0x3fe1b1);MailQueueEvents['on'](_0x35fde4,_0x4ba31f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 31480df..17419a9 100644 --- a/server/api/mailQueueReport/index.js +++ b/server/api/mailQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e6a=['/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','describe'];(function(_0x58c851,_0x1f3d96){var _0x534d8a=function(_0x10c1a0){while(--_0x10c1a0){_0x58c851['push'](_0x58c851['shift']());}};_0x534d8a(++_0x1f3d96);}(_0x0e6a,0x8d));var _0xa0e6=function(_0x443cdc,_0x1d1da7){_0x443cdc=_0x443cdc-0x0;var _0x13bd4b=_0x0e6a[_0x443cdc];return _0x13bd4b;};'use strict';var multer=require(_0xa0e6('0x0'));var util=require(_0xa0e6('0x1'));var path=require(_0xa0e6('0x2'));var timeout=require(_0xa0e6('0x3'));var express=require(_0xa0e6('0x4'));var router=express[_0xa0e6('0x5')]();var auth=require(_0xa0e6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa0e6('0x7'));var controller=require(_0xa0e6('0x8'));router[_0xa0e6('0x9')]('/',auth['isAuthenticated'](),controller[_0xa0e6('0xa')]);router[_0xa0e6('0x9')](_0xa0e6('0xb'),auth['isAuthenticated'](),controller[_0xa0e6('0xc')]);router[_0xa0e6('0x9')](_0xa0e6('0xd'),auth[_0xa0e6('0xe')](),controller[_0xa0e6('0xf')]);router['post']('/',auth[_0xa0e6('0xe')](),controller[_0xa0e6('0x10')]);router[_0xa0e6('0x11')]('/:id',auth[_0xa0e6('0xe')](),controller[_0xa0e6('0x12')]);router[_0xa0e6('0x13')](_0xa0e6('0xd'),auth['isAuthenticated'](),controller[_0xa0e6('0x14')]);module[_0xa0e6('0x15')]=router; \ No newline at end of file +var _0x75a8=['destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x1a3669,_0x52c747){var _0x533e5b=function(_0xceee9c){while(--_0xceee9c){_0x1a3669['push'](_0x1a3669['shift']());}};_0x533e5b(++_0x52c747);}(_0x75a8,0x155));var _0x875a=function(_0x1e3761,_0x506580){_0x1e3761=_0x1e3761-0x0;var _0x543ecd=_0x75a8[_0x1e3761];return _0x543ecd;};'use strict';var multer=require(_0x875a('0x0'));var util=require(_0x875a('0x1'));var path=require(_0x875a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x875a('0x3')]();var auth=require(_0x875a('0x4'));var interaction=require(_0x875a('0x5'));var config=require(_0x875a('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x875a('0x7')](),controller[_0x875a('0x8')]);router[_0x875a('0x9')](_0x875a('0xa'),auth[_0x875a('0x7')](),controller[_0x875a('0xb')]);router[_0x875a('0x9')](_0x875a('0xc'),auth[_0x875a('0x7')](),controller[_0x875a('0xd')]);router[_0x875a('0xe')]('/',auth[_0x875a('0x7')](),controller[_0x875a('0xf')]);router[_0x875a('0x10')](_0x875a('0xc'),auth['isAuthenticated'](),controller[_0x875a('0x11')]);router[_0x875a('0x12')](_0x875a('0xc'),auth[_0x875a('0x7')](),controller[_0x875a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index cace4e9..9d1636e 100644 --- a/server/api/mailQueueReport/mailQueueReport.attributes.js +++ b/server/api/mailQueueReport/mailQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6488=['exports','DATE','STRING','moment','sequelize'];(function(_0x7b7e39,_0x5a5a05){var _0x87fa3f=function(_0x1c686d){while(--_0x1c686d){_0x7b7e39['push'](_0x7b7e39['shift']());}};_0x87fa3f(++_0x5a5a05);}(_0x6488,0x143));var _0x8648=function(_0x44e827,_0x145ed8){_0x44e827=_0x44e827-0x0;var _0xa19d97=_0x6488[_0x44e827];return _0xa19d97;};'use strict';var moment=require(_0x8648('0x0'));var Sequelize=require(_0x8648('0x1'));module[_0x8648('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8648('0x3')]},'leaveAt':{'type':Sequelize[_0x8648('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8648('0x4')]}}; \ No newline at end of file +var _0x2555=['exports','STRING','DATE','moment','sequelize'];(function(_0x12ffdd,_0x15988c){var _0x160a32=function(_0xed5abd){while(--_0xed5abd){_0x12ffdd['push'](_0x12ffdd['shift']());}};_0x160a32(++_0x15988c);}(_0x2555,0x10c));var _0x5255=function(_0x35917e,_0x4b9426){_0x35917e=_0x35917e-0x0;var _0xc8a28=_0x2555[_0x35917e];return _0xc8a28;};'use strict';var moment=require(_0x5255('0x0'));var Sequelize=require(_0x5255('0x1'));module[_0x5255('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5255('0x3')]},'joinAt':{'type':Sequelize[_0x5255('0x4')]},'leaveAt':{'type':Sequelize[_0x5255('0x4')]},'acceptAt':{'type':Sequelize[_0x5255('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5255('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index f1e3f81..198a23d 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43e4=['catch','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','MailQueueReport','rawAttributes','fieldName','model','map','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','findAll','rows','show','params','keys','find'];(function(_0x4e9fe6,_0x47f91c){var _0x49c536=function(_0x127f69){while(--_0x127f69){_0x4e9fe6['push'](_0x4e9fe6['shift']());}};_0x49c536(++_0x47f91c);}(_0x43e4,0x93));var _0x443e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x43e4[_0x4c12ec];return _0x3ae42c;};'use strict';var pdf=require(_0x443e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x443e('0x1'));var zipdir=require(_0x443e('0x2'));var jsonpatch=require(_0x443e('0x3'));var rp=require(_0x443e('0x4'));var moment=require(_0x443e('0x5'));var BPromise=require(_0x443e('0x6'));var Mustache=require('mustache');var util=require(_0x443e('0x7'));var path=require(_0x443e('0x8'));var sox=require(_0x443e('0x9'));var csv=require(_0x443e('0xa'));var ejs=require(_0x443e('0xb'));var fs=require('fs');var _=require(_0x443e('0xc'));var squel=require(_0x443e('0xd'));var crypto=require(_0x443e('0xe'));var jsforce=require(_0x443e('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x443e('0x10'));var Papa=require(_0x443e('0x11'));var Redis=require(_0x443e('0x12'));var authService=require(_0x443e('0x13'));var qs=require(_0x443e('0x14'));var as=require(_0x443e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x443e('0x16'))(_0x443e('0x17'));var utils=require(_0x443e('0x18'));var config=require('../../config/environment');var db=require(_0x443e('0x19'))['db'];function respondWithStatusCode(_0x278598,_0x22bb3a){_0x22bb3a=_0x22bb3a||0xcc;return function(_0x2ab498){if(_0x2ab498){return _0x278598[_0x443e('0x1a')](_0x22bb3a);}return _0x278598[_0x443e('0x1b')](_0x22bb3a)[_0x443e('0x1c')]();};}function respondWithResult(_0x2e1dcc,_0xded9dc){_0xded9dc=_0xded9dc||0xc8;return function(_0x1e2f7e){if(_0x1e2f7e){return _0x2e1dcc['status'](_0xded9dc)[_0x443e('0x1d')](_0x1e2f7e);}};}function respondWithFilteredResult(_0xf011df,_0x13a30b){return function(_0x2e508f){if(_0x2e508f){var _0x56c5cb=_0x2e508f[_0x443e('0x1e')],_0x29cb7f=_0x13a30b['offset'],_0xe9f023=_0x13a30b[_0x443e('0x1f')]+_0x13a30b[_0x443e('0x20')],_0x378711;if(_0xe9f023>=_0x56c5cb){_0xe9f023=_0x56c5cb;_0x378711=0xc8;}else{_0x378711=0xce;}_0xf011df['status'](_0x378711);return _0xf011df['set'](_0x443e('0x21'),_0x29cb7f+'-'+_0xe9f023+'/'+_0x56c5cb)[_0x443e('0x1d')](_0x2e508f);}return null;};}function patchUpdates(_0x428378){return function(_0x6a8b54){try{jsonpatch[_0x443e('0x22')](_0x6a8b54,_0x428378,!![]);}catch(_0x3d3c0e){return BPromise[_0x443e('0x23')](_0x3d3c0e);}return _0x6a8b54[_0x443e('0x24')]();};}function saveUpdates(_0x2ae546,_0x41b4e9){return function(_0x5347e7){if(_0x5347e7){return _0x5347e7[_0x443e('0x25')](_0x2ae546)['then'](function(_0x26635e){return _0x26635e;});}return null;};}function removeEntity(_0x1b5b34,_0x41926d){return function(_0x2694c9){if(_0x2694c9){return _0x2694c9[_0x443e('0x26')]()[_0x443e('0x27')](function(){_0x1b5b34[_0x443e('0x1b')](0xcc)[_0x443e('0x1c')]();});}};}function handleEntityNotFound(_0x42c31c,_0x227f0d){return function(_0x25d6ae){if(!_0x25d6ae){_0x42c31c['sendStatus'](0x194);}return _0x25d6ae;};}function handleError(_0x3340d4,_0xbf673b){_0xbf673b=_0xbf673b||0x1f4;return function(_0x3e9a83){logger['error'](_0x3e9a83[_0x443e('0x28')]);if(_0x3e9a83['name']){delete _0x3e9a83[_0x443e('0x29')];}_0x3340d4[_0x443e('0x1b')](_0xbf673b)[_0x443e('0x2a')](_0x3e9a83);};}exports['index']=function(_0xc4554e,_0x88681e){var _0x418963={},_0x280b5c={},_0x52847d={'count':0x0,'rows':[]};var _0x97c5df=_['map'](db[_0x443e('0x2b')][_0x443e('0x2c')],function(_0x218dc3){return{'name':_0x218dc3[_0x443e('0x2d')],'type':_0x218dc3['type']['key']};});_0x280b5c[_0x443e('0x2e')]=_[_0x443e('0x2f')](_0x97c5df,'name');_0x280b5c['query']=_['keys'](_0xc4554e[_0x443e('0x30')]);_0x280b5c[_0x443e('0x31')]=_['intersection'](_0x280b5c['model'],_0x280b5c[_0x443e('0x30')]);_0x418963['attributes']=_[_0x443e('0x32')](_0x280b5c[_0x443e('0x2e')],qs[_0x443e('0x33')](_0xc4554e[_0x443e('0x30')][_0x443e('0x33')]));_0x418963['attributes']=_0x418963['attributes'][_0x443e('0x34')]?_0x418963[_0x443e('0x35')]:_0x280b5c['model'];if(!_0xc4554e[_0x443e('0x30')][_0x443e('0x36')](_0x443e('0x37'))){_0x418963[_0x443e('0x20')]=qs[_0x443e('0x20')](_0xc4554e[_0x443e('0x30')][_0x443e('0x20')]);_0x418963['offset']=qs[_0x443e('0x1f')](_0xc4554e[_0x443e('0x30')][_0x443e('0x1f')]);}_0x418963['order']=qs[_0x443e('0x38')](_0xc4554e['query'][_0x443e('0x38')]);_0x418963[_0x443e('0x39')]=qs[_0x443e('0x31')](_['pick'](_0xc4554e['query'],_0x280b5c[_0x443e('0x31')]));if(_0xc4554e[_0x443e('0x30')][_0x443e('0x3a')]){_0x418963[_0x443e('0x39')]=_[_0x443e('0x3b')](_0x418963['where'],{'$or':_['map'](_0x97c5df,function(_0x379bf9){if(_0x379bf9[_0x443e('0x3c')]!=='VIRTUAL'){var _0x187e63={};_0x187e63[_0x379bf9[_0x443e('0x29')]]={'$like':'%'+_0xc4554e['query']['filter']+'%'};return _0x187e63;}})});}_0x418963=_[_0x443e('0x3b')]({},_0x418963,_0xc4554e[_0x443e('0x3d')]);var _0xa4ee05={'where':_0x418963[_0x443e('0x39')]};return db[_0x443e('0x2b')][_0x443e('0x1e')](_0xa4ee05)[_0x443e('0x27')](function(_0x4f814b){_0x52847d[_0x443e('0x1e')]=_0x4f814b;if(_0xc4554e[_0x443e('0x30')][_0x443e('0x3e')]){_0x418963['include']=[{'all':!![]}];}return db[_0x443e('0x2b')][_0x443e('0x3f')](_0x418963);})['then'](function(_0x556261){_0x52847d[_0x443e('0x40')]=_0x556261;return _0x52847d;})[_0x443e('0x27')](respondWithFilteredResult(_0x88681e,_0x418963))['catch'](handleError(_0x88681e,null));};exports[_0x443e('0x41')]=function(_0x576072,_0x550349){var _0x3bbebd={'raw':!![],'where':{'id':_0x576072[_0x443e('0x42')]['id']}},_0x1960af={};_0x1960af['model']=_['keys'](db[_0x443e('0x2b')][_0x443e('0x2c')]);_0x1960af[_0x443e('0x30')]=_[_0x443e('0x43')](_0x576072['query']);_0x1960af['filters']=_[_0x443e('0x32')](_0x1960af[_0x443e('0x2e')],_0x1960af['query']);_0x3bbebd[_0x443e('0x35')]=_[_0x443e('0x32')](_0x1960af[_0x443e('0x2e')],qs[_0x443e('0x33')](_0x576072[_0x443e('0x30')][_0x443e('0x33')]));_0x3bbebd[_0x443e('0x35')]=_0x3bbebd[_0x443e('0x35')][_0x443e('0x34')]?_0x3bbebd[_0x443e('0x35')]:_0x1960af[_0x443e('0x2e')];if(_0x576072[_0x443e('0x30')][_0x443e('0x3e')]){_0x3bbebd['include']=[{'all':!![]}];}_0x3bbebd=_[_0x443e('0x3b')]({},_0x3bbebd,_0x576072['options']);return db[_0x443e('0x2b')][_0x443e('0x44')](_0x3bbebd)[_0x443e('0x27')](handleEntityNotFound(_0x550349,null))[_0x443e('0x27')](respondWithResult(_0x550349,null))[_0x443e('0x45')](handleError(_0x550349,null));};exports['create']=function(_0x547e32,_0x199903){return db[_0x443e('0x2b')]['create'](_0x547e32[_0x443e('0x46')],{})['then'](respondWithResult(_0x199903,0xc9))[_0x443e('0x45')](handleError(_0x199903,null));};exports['update']=function(_0x234a72,_0x5a327d){if(_0x234a72[_0x443e('0x46')]['id']){delete _0x234a72['body']['id'];}return db['MailQueueReport'][_0x443e('0x44')]({'where':{'id':_0x234a72['params']['id']}})[_0x443e('0x27')](handleEntityNotFound(_0x5a327d,null))[_0x443e('0x27')](saveUpdates(_0x234a72[_0x443e('0x46')],null))[_0x443e('0x27')](respondWithResult(_0x5a327d,null))[_0x443e('0x45')](handleError(_0x5a327d,null));};exports['destroy']=function(_0x16720a,_0x36e655){return db['MailQueueReport']['find']({'where':{'id':_0x16720a['params']['id']}})[_0x443e('0x27')](handleEntityNotFound(_0x36e655,null))[_0x443e('0x27')](removeEntity(_0x36e655,null))[_0x443e('0x45')](handleError(_0x36e655,null));};exports[_0x443e('0x47')]=function(_0x3ef577,_0x51e312){return db[_0x443e('0x2b')][_0x443e('0x47')]()[_0x443e('0x27')](respondWithResult(_0x51e312,null))['catch'](handleError(_0x51e312,null));}; \ No newline at end of file +var _0x3d76=['count','includeAll','include','findAll','rows','params','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','apply','reject','update','then','destroy','end','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','type','VIRTUAL','merge','options'];(function(_0x588cd2,_0x3e7175){var _0x29840e=function(_0x441b70){while(--_0x441b70){_0x588cd2['push'](_0x588cd2['shift']());}};_0x29840e(++_0x3e7175);}(_0x3d76,0x17d));var _0x63d7=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x3d76[_0x5d80de];return _0x1c7556;};'use strict';var pdf=require(_0x63d7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x63d7('0x1'));var zipdir=require(_0x63d7('0x2'));var jsonpatch=require(_0x63d7('0x3'));var rp=require(_0x63d7('0x4'));var moment=require(_0x63d7('0x5'));var BPromise=require(_0x63d7('0x6'));var Mustache=require(_0x63d7('0x7'));var util=require('util');var path=require(_0x63d7('0x8'));var sox=require(_0x63d7('0x9'));var csv=require(_0x63d7('0xa'));var ejs=require(_0x63d7('0xb'));var fs=require('fs');var _=require(_0x63d7('0xc'));var squel=require(_0x63d7('0xd'));var crypto=require('crypto');var jsforce=require(_0x63d7('0xe'));var deskjs=require(_0x63d7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x63d7('0x10'));var Papa=require(_0x63d7('0x11'));var Redis=require(_0x63d7('0x12'));var authService=require(_0x63d7('0x13'));var qs=require(_0x63d7('0x14'));var as=require(_0x63d7('0x15'));var hardwareService=require(_0x63d7('0x16'));var logger=require(_0x63d7('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x63d7('0x18'));var db=require(_0x63d7('0x19'))['db'];function respondWithStatusCode(_0x13b9f4,_0x1c32fd){_0x1c32fd=_0x1c32fd||0xcc;return function(_0x1c47e5){if(_0x1c47e5){return _0x13b9f4[_0x63d7('0x1a')](_0x1c32fd);}return _0x13b9f4[_0x63d7('0x1b')](_0x1c32fd)['end']();};}function respondWithResult(_0x5c4afe,_0x158c4f){_0x158c4f=_0x158c4f||0xc8;return function(_0x30c758){if(_0x30c758){return _0x5c4afe[_0x63d7('0x1b')](_0x158c4f)[_0x63d7('0x1c')](_0x30c758);}};}function respondWithFilteredResult(_0x29ce19,_0x52ff34){return function(_0x30f59e){if(_0x30f59e){var _0x166768=_0x30f59e['count'],_0x558c15=_0x52ff34[_0x63d7('0x1d')],_0x545452=_0x52ff34[_0x63d7('0x1d')]+_0x52ff34[_0x63d7('0x1e')],_0x43837d;if(_0x545452>=_0x166768){_0x545452=_0x166768;_0x43837d=0xc8;}else{_0x43837d=0xce;}_0x29ce19[_0x63d7('0x1b')](_0x43837d);return _0x29ce19['set']('Content-Range',_0x558c15+'-'+_0x545452+'/'+_0x166768)[_0x63d7('0x1c')](_0x30f59e);}return null;};}function patchUpdates(_0x3a8a18){return function(_0x1ae900){try{jsonpatch[_0x63d7('0x1f')](_0x1ae900,_0x3a8a18,!![]);}catch(_0x1339e5){return BPromise[_0x63d7('0x20')](_0x1339e5);}return _0x1ae900['save']();};}function saveUpdates(_0x4305a9,_0x3d52ba){return function(_0x66cd1f){if(_0x66cd1f){return _0x66cd1f[_0x63d7('0x21')](_0x4305a9)[_0x63d7('0x22')](function(_0x15e952){return _0x15e952;});}return null;};}function removeEntity(_0x2c0eab,_0x1b8408){return function(_0x356f6a){if(_0x356f6a){return _0x356f6a[_0x63d7('0x23')]()['then'](function(){_0x2c0eab['status'](0xcc)[_0x63d7('0x24')]();});}};}function handleEntityNotFound(_0x5f529d,_0x2329a5){return function(_0x221830){if(!_0x221830){_0x5f529d[_0x63d7('0x1a')](0x194);}return _0x221830;};}function handleError(_0x596e39,_0x307097){_0x307097=_0x307097||0x1f4;return function(_0x55ebee){logger['error'](_0x55ebee[_0x63d7('0x25')]);if(_0x55ebee[_0x63d7('0x26')]){delete _0x55ebee['name'];}_0x596e39[_0x63d7('0x1b')](_0x307097)[_0x63d7('0x27')](_0x55ebee);};}exports[_0x63d7('0x28')]=function(_0x1dda5d,_0x2e58e2){var _0x46d7bd={},_0x29515b={},_0x458f03={'count':0x0,'rows':[]};var _0x356e44=_[_0x63d7('0x29')](db[_0x63d7('0x2a')][_0x63d7('0x2b')],function(_0x2c10ee){return{'name':_0x2c10ee[_0x63d7('0x2c')],'type':_0x2c10ee['type'][_0x63d7('0x2d')]};});_0x29515b[_0x63d7('0x2e')]=_[_0x63d7('0x29')](_0x356e44,_0x63d7('0x26'));_0x29515b[_0x63d7('0x2f')]=_[_0x63d7('0x30')](_0x1dda5d[_0x63d7('0x2f')]);_0x29515b[_0x63d7('0x31')]=_[_0x63d7('0x32')](_0x29515b['model'],_0x29515b[_0x63d7('0x2f')]);_0x46d7bd[_0x63d7('0x33')]=_[_0x63d7('0x32')](_0x29515b['model'],qs[_0x63d7('0x34')](_0x1dda5d['query'][_0x63d7('0x34')]));_0x46d7bd[_0x63d7('0x33')]=_0x46d7bd[_0x63d7('0x33')][_0x63d7('0x35')]?_0x46d7bd[_0x63d7('0x33')]:_0x29515b['model'];if(!_0x1dda5d[_0x63d7('0x2f')][_0x63d7('0x36')]('nolimit')){_0x46d7bd[_0x63d7('0x1e')]=qs['limit'](_0x1dda5d['query'][_0x63d7('0x1e')]);_0x46d7bd[_0x63d7('0x1d')]=qs[_0x63d7('0x1d')](_0x1dda5d[_0x63d7('0x2f')][_0x63d7('0x1d')]);}_0x46d7bd[_0x63d7('0x37')]=qs['sort'](_0x1dda5d['query']['sort']);_0x46d7bd[_0x63d7('0x38')]=qs['filters'](_[_0x63d7('0x39')](_0x1dda5d[_0x63d7('0x2f')],_0x29515b[_0x63d7('0x31')]));if(_0x1dda5d[_0x63d7('0x2f')][_0x63d7('0x3a')]){_0x46d7bd['where']=_['merge'](_0x46d7bd[_0x63d7('0x38')],{'$or':_['map'](_0x356e44,function(_0x175e57){if(_0x175e57[_0x63d7('0x3b')]!==_0x63d7('0x3c')){var _0xc76dfc={};_0xc76dfc[_0x175e57[_0x63d7('0x26')]]={'$like':'%'+_0x1dda5d['query']['filter']+'%'};return _0xc76dfc;}})});}_0x46d7bd=_[_0x63d7('0x3d')]({},_0x46d7bd,_0x1dda5d[_0x63d7('0x3e')]);var _0x4c61ab={'where':_0x46d7bd[_0x63d7('0x38')]};return db[_0x63d7('0x2a')]['count'](_0x4c61ab)['then'](function(_0x6abc2d){_0x458f03[_0x63d7('0x3f')]=_0x6abc2d;if(_0x1dda5d[_0x63d7('0x2f')][_0x63d7('0x40')]){_0x46d7bd[_0x63d7('0x41')]=[{'all':!![]}];}return db[_0x63d7('0x2a')][_0x63d7('0x42')](_0x46d7bd);})[_0x63d7('0x22')](function(_0x1ee34e){_0x458f03[_0x63d7('0x43')]=_0x1ee34e;return _0x458f03;})[_0x63d7('0x22')](respondWithFilteredResult(_0x2e58e2,_0x46d7bd))['catch'](handleError(_0x2e58e2,null));};exports['show']=function(_0x17eac5,_0x4a34a2){var _0x543b2f={'raw':!![],'where':{'id':_0x17eac5[_0x63d7('0x44')]['id']}},_0x2be96a={};_0x2be96a['model']=_[_0x63d7('0x30')](db[_0x63d7('0x2a')][_0x63d7('0x2b')]);_0x2be96a[_0x63d7('0x2f')]=_[_0x63d7('0x30')](_0x17eac5['query']);_0x2be96a[_0x63d7('0x31')]=_['intersection'](_0x2be96a[_0x63d7('0x2e')],_0x2be96a[_0x63d7('0x2f')]);_0x543b2f[_0x63d7('0x33')]=_[_0x63d7('0x32')](_0x2be96a['model'],qs['fields'](_0x17eac5[_0x63d7('0x2f')][_0x63d7('0x34')]));_0x543b2f[_0x63d7('0x33')]=_0x543b2f[_0x63d7('0x33')][_0x63d7('0x35')]?_0x543b2f['attributes']:_0x2be96a['model'];if(_0x17eac5[_0x63d7('0x2f')][_0x63d7('0x40')]){_0x543b2f['include']=[{'all':!![]}];}_0x543b2f=_[_0x63d7('0x3d')]({},_0x543b2f,_0x17eac5['options']);return db[_0x63d7('0x2a')][_0x63d7('0x45')](_0x543b2f)['then'](handleEntityNotFound(_0x4a34a2,null))[_0x63d7('0x22')](respondWithResult(_0x4a34a2,null))[_0x63d7('0x46')](handleError(_0x4a34a2,null));};exports[_0x63d7('0x47')]=function(_0x546ca9,_0x1da079){return db['MailQueueReport']['create'](_0x546ca9[_0x63d7('0x48')],{})[_0x63d7('0x22')](respondWithResult(_0x1da079,0xc9))[_0x63d7('0x46')](handleError(_0x1da079,null));};exports['update']=function(_0x37fc33,_0x33a912){if(_0x37fc33[_0x63d7('0x48')]['id']){delete _0x37fc33[_0x63d7('0x48')]['id'];}return db[_0x63d7('0x2a')]['find']({'where':{'id':_0x37fc33['params']['id']}})['then'](handleEntityNotFound(_0x33a912,null))[_0x63d7('0x22')](saveUpdates(_0x37fc33[_0x63d7('0x48')],null))[_0x63d7('0x22')](respondWithResult(_0x33a912,null))['catch'](handleError(_0x33a912,null));};exports[_0x63d7('0x23')]=function(_0x405b8d,_0x524ccc){return db[_0x63d7('0x2a')][_0x63d7('0x45')]({'where':{'id':_0x405b8d[_0x63d7('0x44')]['id']}})[_0x63d7('0x22')](handleEntityNotFound(_0x524ccc,null))[_0x63d7('0x22')](removeEntity(_0x524ccc,null))[_0x63d7('0x46')](handleError(_0x524ccc,null));};exports[_0x63d7('0x49')]=function(_0x2033e0,_0x264607){return db[_0x63d7('0x2a')][_0x63d7('0x49')]()[_0x63d7('0x22')](respondWithResult(_0x264607,null))[_0x63d7('0x46')](handleError(_0x264607,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 3759773..f735757 100644 --- a/server/api/mailQueueReport/mailQueueReport.model.js +++ b/server/api/mailQueueReport/mailQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83cc=['api','bluebird','request-promise','./mailQueueReport.attributes','exports','MailQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0x23f6ba,_0x3672ec){var _0x39dea2=function(_0xcfea27){while(--_0xcfea27){_0x23f6ba['push'](_0x23f6ba['shift']());}};_0x39dea2(++_0x3672ec);}(_0x83cc,0x115));var _0xc83c=function(_0x3986fc,_0x41fd49){_0x3986fc=_0x3986fc-0x0;var _0x514bd1=_0x83cc[_0x3986fc];return _0x514bd1;};'use strict';var _=require(_0xc83c('0x0'));var util=require(_0xc83c('0x1'));var logger=require(_0xc83c('0x2'))(_0xc83c('0x3'));var moment=require('moment');var BPromise=require(_0xc83c('0x4'));var rp=require(_0xc83c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc83c('0x6'));module[_0xc83c('0x7')]=function(_0x4d0639,_0x4a0e00){return _0x4d0639['define'](_0xc83c('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xc83c('0x9'),'fields':[_0xc83c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb2cf=['report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x4d525c,_0x277dac){var _0x3f0655=function(_0x5e8102){while(--_0x5e8102){_0x4d525c['push'](_0x4d525c['shift']());}};_0x3f0655(++_0x277dac);}(_0xb2cf,0x10c));var _0xfb2c=function(_0x2e2b0e,_0x5120a5){_0x2e2b0e=_0x2e2b0e-0x0;var _0x107572=_0xb2cf[_0x2e2b0e];return _0x107572;};'use strict';var _=require(_0xfb2c('0x0'));var util=require(_0xfb2c('0x1'));var logger=require(_0xfb2c('0x2'))(_0xfb2c('0x3'));var moment=require(_0xfb2c('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb2c('0x5'));var fs=require('fs');var path=require(_0xfb2c('0x6'));var rimraf=require('rimraf');var config=require(_0xfb2c('0x7'));var attributes=require(_0xfb2c('0x8'));module[_0xfb2c('0x9')]=function(_0x25fabe,_0xf7c813){return _0x25fabe[_0xfb2c('0xa')](_0xfb2c('0xb'),attributes,{'tableName':_0xfb2c('0xc'),'paranoid':![],'indexes':[{'name':_0xfb2c('0xd'),'fields':[_0xfb2c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 33514b1..94c4582 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','MailQueueReport,\x20%s,\x20%s','message','result','catch','MailQueueReport','create','body','options','CreateMailQueueReport','UpdateMailQueueReport','update','raw','limit','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x5fbebd,_0xbb5e14){var _0x106eaa=function(_0x4bdc98){while(--_0x4bdc98){_0x5fbebd['push'](_0x5fbebd['shift']());}};_0x106eaa(++_0xbb5e14);}(_0x0295,0x1f0));var _0x5029=function(_0x3bb0d4,_0xe492ec){_0x3bb0d4=_0x3bb0d4-0x0;var _0x269be3=_0x0295[_0x3bb0d4];return _0x269be3;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('MailQueueReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}exports['CreateMailQueueReport']=function(_0x1ed567){var _0x31a155=this;return new Promise(function(_0x35de81,_0x4902f3){return db[_0x5029('0x15')][_0x5029('0x16')](_0x1ed567[_0x5029('0x17')],{'raw':_0x1ed567['options']?_0x1ed567[_0x5029('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x5029('0xa')](function(_0x8a414c){logger[_0x5029('0xb')](_0x5029('0x19'),_0x1ed567);logger['debug']('CreateMailQueueReport',_0x1ed567,JSON[_0x5029('0xf')](_0x8a414c));_0x35de81(_0x8a414c);})['catch'](function(_0x3f657d){logger[_0x5029('0x10')](_0x5029('0x19'),_0x3f657d[_0x5029('0x12')],_0x1ed567);_0x4902f3(_0x31a155[_0x5029('0x10')](0x1f4,_0x3f657d[_0x5029('0x12')]));});});};exports[_0x5029('0x1a')]=function(_0x356dac){var _0x3e857d=this;return new Promise(function(_0x4ceaae,_0x564866){return db['MailQueueReport'][_0x5029('0x1b')](_0x356dac[_0x5029('0x17')],{'raw':_0x356dac['options']?_0x356dac['options'][_0x5029('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x356dac[_0x5029('0x18')]?_0x356dac[_0x5029('0x18')]['where']||null:null,'attributes':_0x356dac[_0x5029('0x18')]?_0x356dac[_0x5029('0x18')]['attributes']||null:null,'limit':_0x356dac[_0x5029('0x18')]?_0x356dac[_0x5029('0x18')][_0x5029('0x1d')]||null:null})['then'](function(_0x32da06){logger[_0x5029('0xb')](_0x5029('0x1a'),_0x356dac);logger['debug'](_0x5029('0x1a'),_0x356dac,JSON[_0x5029('0xf')](_0x32da06));_0x4ceaae(_0x32da06);})['catch'](function(_0x1d79b9){logger[_0x5029('0x10')](_0x5029('0x1a'),_0x1d79b9[_0x5029('0x12')],_0x356dac);_0x564866(_0x3e857d[_0x5029('0x10')](0x1f4,_0x1d79b9[_0x5029('0x12')]));});});}; \ No newline at end of file +var _0xafc4=['info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateMailQueueReport','MailQueueReport','body','options','raw','debug','UpdateMailQueueReport','update','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x5d5c06,_0x5e97f6){var _0x2ccc0d=function(_0x5e1db9){while(--_0x5e1db9){_0x5d5c06['push'](_0x5d5c06['shift']());}};_0x2ccc0d(++_0x5e97f6);}(_0xafc4,0x69));var _0x4afc=function(_0x27633c,_0x4c5eac){_0x27633c=_0x27633c-0x0;var _0x16d17e=_0xafc4[_0x27633c];return _0x16d17e;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('MailQueueReport,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('MailQueueReport,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}exports[_0x4afc('0x14')]=function(_0x22f809){var _0x3ad418=this;return new Promise(function(_0x16365f,_0x135349){return db[_0x4afc('0x15')]['create'](_0x22f809[_0x4afc('0x16')],{'raw':_0x22f809[_0x4afc('0x17')]?_0x22f809[_0x4afc('0x17')][_0x4afc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3bddc0){logger[_0x4afc('0xb')](_0x4afc('0x14'),_0x22f809);logger[_0x4afc('0x19')](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x3bddc0));_0x16365f(_0x3bddc0);})[_0x4afc('0x13')](function(_0x573a75){logger[_0x4afc('0xf')](_0x4afc('0x14'),_0x573a75['message'],_0x22f809);_0x135349(_0x3ad418[_0x4afc('0xf')](0x1f4,_0x573a75['message']));});});};exports[_0x4afc('0x1a')]=function(_0x2a0314){var _0x1e454e=this;return new Promise(function(_0x2876f2,_0x86dbd4){return db[_0x4afc('0x15')][_0x4afc('0x1b')](_0x2a0314[_0x4afc('0x16')],{'raw':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')][_0x4afc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')]['where']||null:null,'attributes':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')][_0x4afc('0x1c')]||null:null,'limit':_0x2a0314['options']?_0x2a0314['options']['limit']||null:null})[_0x4afc('0xa')](function(_0x5db47e){logger['info'](_0x4afc('0x1a'),_0x2a0314);logger[_0x4afc('0x19')]('UpdateMailQueueReport',_0x2a0314,JSON['stringify'](_0x5db47e));_0x2876f2(_0x5db47e);})['catch'](function(_0x3bae1a){logger[_0x4afc('0xf')](_0x4afc('0x1a'),_0x3bae1a[_0x4afc('0x11')],_0x2a0314);_0x86dbd4(_0x1e454e[_0x4afc('0xf')](0x1f4,_0x3bae1a[_0x4afc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index f99cbab..88aeb83 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e00=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x9e00,0x11f));var _0x09e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9e00[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x09e0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x09e0('0x1'));var express=require(_0x09e0('0x2'));var router=express[_0x09e0('0x3')]();var auth=require(_0x09e0('0x4'));var interaction=require(_0x09e0('0x5'));var config=require(_0x09e0('0x6'));module[_0x09e0('0x7')]=router; \ No newline at end of file +var _0x95c3=['path','connect-timeout','express','Router','../../config/environment','exports','multer'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x95c3,0xfb));var _0x395c=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x95c3[_0x2cf2e9];return _0xd3670d;};'use strict';var multer=require(_0x395c('0x0'));var util=require('util');var path=require(_0x395c('0x1'));var timeout=require(_0x395c('0x2'));var express=require(_0x395c('0x3'));var router=express[_0x395c('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x395c('0x5'));module[_0x395c('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index c6bd954..ba65e7d 100644 --- a/server/api/mailServerIn/mailServerIn.attributes.js +++ b/server/api/mailServerIn/mailServerIn.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9077=['BOOLEAN','INBOX','INTEGER','exports','STRING','username'];(function(_0x403a22,_0x2f926c){var _0x3402fd=function(_0x4d092e){while(--_0x4d092e){_0x403a22['push'](_0x403a22['shift']());}};_0x3402fd(++_0x2f926c);}(_0x9077,0x1c5));var _0x7907=function(_0x2ff14f,_0x9fcd30){_0x2ff14f=_0x2ff14f-0x0;var _0x4b89a8=_0x9077[_0x2ff14f];return _0x4b89a8;};'use strict';var Sequelize=require('sequelize');module[_0x7907('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7907('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x7907('0x1')],'unique':_0x7907('0x2')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x7907('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x7907('0x4')},'connTimeout':{'type':Sequelize[_0x7907('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7907('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7907('0x1')]}}; \ No newline at end of file +var _0x1509=['exports','STRING','BOOLEAN','username','INTEGER','INBOX'];(function(_0x4ad30a,_0x3846a5){var _0x167c9d=function(_0x18dc35){while(--_0x18dc35){_0x4ad30a['push'](_0x4ad30a['shift']());}};_0x167c9d(++_0x3846a5);}(_0x1509,0x1aa));var _0x9150=function(_0x38917c,_0x168703){_0x38917c=_0x38917c-0x0;var _0xbde5d3=_0x1509[_0x38917c];return _0xbde5d3;};'use strict';var Sequelize=require('sequelize');module[_0x9150('0x0')]={'description':{'type':Sequelize[_0x9150('0x1')]},'host':{'type':Sequelize[_0x9150('0x1')]},'authentication':{'type':Sequelize[_0x9150('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9150('0x1')],'unique':_0x9150('0x3')},'password':{'type':Sequelize[_0x9150('0x1')]},'port':{'type':Sequelize[_0x9150('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9150('0x1')],'defaultValue':_0x9150('0x5')},'connTimeout':{'type':Sequelize[_0x9150('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x9150('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d512e3d..a55a406 100644 --- a/server/api/mailServerIn/mailServerIn.model.js +++ b/server/api/mailServerIn/mailServerIn.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae60=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash'];(function(_0x4067a9,_0x237ed6){var _0x36b34d=function(_0x3d4123){while(--_0x3d4123){_0x4067a9['push'](_0x4067a9['shift']());}};_0x36b34d(++_0x237ed6);}(_0xae60,0x1c7));var _0x0ae6=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xae60[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var logger=require(_0x0ae6('0x2'))('api');var moment=require(_0x0ae6('0x3'));var BPromise=require(_0x0ae6('0x4'));var rp=require(_0x0ae6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x0ae6('0x8')]=function(_0x25ac7c,_0x30e000){return _0x25ac7c[_0x0ae6('0x9')](_0x0ae6('0xa'),attributes,{'tableName':_0x0ae6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2884=['request-promise','path','./mailServerIn.attributes','exports','MailServerIn','lodash','../../config/logger','api','moment'];(function(_0xf0e6ac,_0x46822d){var _0x1a0ceb=function(_0x3e259b){while(--_0x3e259b){_0xf0e6ac['push'](_0xf0e6ac['shift']());}};_0x1a0ceb(++_0x46822d);}(_0x2884,0x1eb));var _0x4288=function(_0x19b4ce,_0x187040){_0x19b4ce=_0x19b4ce-0x0;var _0x180b52=_0x2884[_0x19b4ce];return _0x180b52;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var logger=require(_0x4288('0x1'))(_0x4288('0x2'));var moment=require(_0x4288('0x3'));var BPromise=require('bluebird');var rp=require(_0x4288('0x4'));var fs=require('fs');var path=require(_0x4288('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4288('0x6'));module[_0x4288('0x7')]=function(_0x3d67f7,_0x59dffa){return _0x3d67f7['define'](_0x4288('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 4e0b0de..d6ea52a 100644 --- a/server/api/mailServerIn/mailServerIn.rpc.js +++ b/server/api/mailServerIn/mailServerIn.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a78=['MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','MailServerIn','findAll','options','where','attributes','limit','include','model','map','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','debug'];(function(_0x5f1ccf,_0x2e1381){var _0x297782=function(_0x2459b8){while(--_0x2459b8){_0x5f1ccf['push'](_0x5f1ccf['shift']());}};_0x297782(++_0x2e1381);}(_0x0a78,0xcc));var _0x80a7=function(_0x245ce4,_0x127347){_0x245ce4=_0x245ce4-0x0;var _0x1746f9=_0x0a78[_0x245ce4];return _0x1746f9;};'use strict';var _=require(_0x80a7('0x0'));var util=require(_0x80a7('0x1'));var moment=require(_0x80a7('0x2'));var BPromise=require(_0x80a7('0x3'));var rs=require(_0x80a7('0x4'));var fs=require('fs');var Redis=require(_0x80a7('0x5'));var db=require(_0x80a7('0x6'))['db'];var utils=require(_0x80a7('0x7'));var logger=require(_0x80a7('0x8'))(_0x80a7('0x9'));var config=require(_0x80a7('0xa'));var jayson=require(_0x80a7('0xb'));var client=jayson[_0x80a7('0xc')][_0x80a7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c0af8,_0x1667ed,_0x1e100e){return new BPromise(function(_0x58915d,_0x415ca8){return client[_0x80a7('0xe')](_0x4c0af8,_0x1e100e)[_0x80a7('0xf')](function(_0x1ebf9a){logger['info'](_0x80a7('0x10'),_0x1667ed,'request\x20sent');logger[_0x80a7('0x11')](_0x80a7('0x12'),_0x1667ed,_0x80a7('0x13'),JSON[_0x80a7('0x14')](_0x1ebf9a));if(_0x1ebf9a[_0x80a7('0x15')]){if(_0x1ebf9a[_0x80a7('0x15')][_0x80a7('0x16')]===0x1f4){logger[_0x80a7('0x15')](_0x80a7('0x10'),_0x1667ed,_0x1ebf9a['error']['message']);return _0x415ca8(_0x1ebf9a[_0x80a7('0x15')][_0x80a7('0x17')]);}logger[_0x80a7('0x15')](_0x80a7('0x10'),_0x1667ed,_0x1ebf9a[_0x80a7('0x15')][_0x80a7('0x17')]);return _0x58915d(_0x1ebf9a[_0x80a7('0x15')]['message']);}else{logger[_0x80a7('0x18')](_0x80a7('0x10'),_0x1667ed,_0x80a7('0x13'));_0x58915d(_0x1ebf9a[_0x80a7('0x19')]['message']);}})[_0x80a7('0x1a')](function(_0xb57838){logger[_0x80a7('0x15')](_0x80a7('0x10'),_0x1667ed,_0xb57838);_0x415ca8(_0xb57838);});});}exports['GetMailServerIn']=function(_0xbc19ad){var _0xab023=this;return new Promise(function(_0x4e983d,_0x12ecb4){return db[_0x80a7('0x1b')][_0x80a7('0x1c')]({'raw':_0xbc19ad[_0x80a7('0x1d')]?_0xbc19ad['options']['raw']===undefined?!![]:![]:!![],'where':_0xbc19ad['options']?_0xbc19ad[_0x80a7('0x1d')][_0x80a7('0x1e')]||null:null,'attributes':_0xbc19ad[_0x80a7('0x1d')]?_0xbc19ad[_0x80a7('0x1d')][_0x80a7('0x1f')]||null:null,'limit':_0xbc19ad[_0x80a7('0x1d')]?_0xbc19ad[_0x80a7('0x1d')][_0x80a7('0x20')]||null:null,'include':_0xbc19ad[_0x80a7('0x1d')]?_0xbc19ad[_0x80a7('0x1d')][_0x80a7('0x21')]?_['map'](_0xbc19ad[_0x80a7('0x1d')][_0x80a7('0x21')],function(_0x5506e0){return{'model':db[_0x5506e0[_0x80a7('0x22')]],'as':_0x5506e0['as'],'attributes':_0x5506e0['attributes'],'include':_0x5506e0[_0x80a7('0x21')]?_[_0x80a7('0x23')](_0x5506e0['include'],function(_0x360525){return{'model':db[_0x360525[_0x80a7('0x22')]],'as':_0x360525['as'],'attributes':_0x360525[_0x80a7('0x1f')],'include':_0x360525[_0x80a7('0x21')]?_[_0x80a7('0x23')](_0x360525['include'],function(_0x34f5e8){return{'model':db[_0x34f5e8['model']],'as':_0x34f5e8['as'],'attributes':_0x34f5e8['attributes']};}):[]};}):[]};}):[]:[]})[_0x80a7('0xf')](function(_0x26824e){logger['info'](_0x80a7('0x24'),_0xbc19ad);logger['debug']('GetMailServerIn',_0xbc19ad,JSON[_0x80a7('0x14')](_0x26824e));_0x4e983d(_0x26824e);})[_0x80a7('0x1a')](function(_0x17e7f3){logger[_0x80a7('0x15')](_0x80a7('0x24'),_0x17e7f3['message'],_0xbc19ad);_0x12ecb4(_0xab023['error'](0x1f4,_0x17e7f3[_0x80a7('0x17')]));});});}; \ No newline at end of file +var _0x531e=['model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x3774c7,_0x361f2b){var _0x1db61e=function(_0x442a9e){while(--_0x442a9e){_0x3774c7['push'](_0x3774c7['shift']());}};_0x1db61e(++_0x361f2b);}(_0x531e,0x85));var _0xe531=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x531e[_0x3a9661];return _0x5bb119;};'use strict';var _=require(_0xe531('0x0'));var util=require(_0xe531('0x1'));var moment=require(_0xe531('0x2'));var BPromise=require(_0xe531('0x3'));var rs=require(_0xe531('0x4'));var fs=require('fs');var Redis=require(_0xe531('0x5'));var db=require(_0xe531('0x6'))['db'];var utils=require(_0xe531('0x7'));var logger=require('../../config/logger')(_0xe531('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe531('0x9')][_0xe531('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13061b,_0x4f7dbe,_0x5f1768){return new BPromise(function(_0x541a76,_0xad3cb4){return client[_0xe531('0xb')](_0x13061b,_0x5f1768)[_0xe531('0xc')](function(_0x3a5128){logger[_0xe531('0xd')](_0xe531('0xe'),_0x4f7dbe,'request\x20sent');logger[_0xe531('0xf')](_0xe531('0x10'),_0x4f7dbe,_0xe531('0x11'),JSON[_0xe531('0x12')](_0x3a5128));if(_0x3a5128['error']){if(_0x3a5128[_0xe531('0x13')]['code']===0x1f4){logger['error'](_0xe531('0xe'),_0x4f7dbe,_0x3a5128['error'][_0xe531('0x14')]);return _0xad3cb4(_0x3a5128[_0xe531('0x13')][_0xe531('0x14')]);}logger[_0xe531('0x13')](_0xe531('0xe'),_0x4f7dbe,_0x3a5128[_0xe531('0x13')][_0xe531('0x14')]);return _0x541a76(_0x3a5128[_0xe531('0x13')][_0xe531('0x14')]);}else{logger[_0xe531('0xd')]('MailServerIn,\x20%s,\x20%s',_0x4f7dbe,_0xe531('0x11'));_0x541a76(_0x3a5128['result']['message']);}})[_0xe531('0x15')](function(_0x31603a){logger[_0xe531('0x13')](_0xe531('0xe'),_0x4f7dbe,_0x31603a);_0xad3cb4(_0x31603a);});});}exports[_0xe531('0x16')]=function(_0x550bdc){var _0x221db0=this;return new Promise(function(_0x409a8f,_0x284730){return db[_0xe531('0x17')][_0xe531('0x18')]({'raw':_0x550bdc[_0xe531('0x19')]?_0x550bdc[_0xe531('0x19')][_0xe531('0x1a')]===undefined?!![]:![]:!![],'where':_0x550bdc[_0xe531('0x19')]?_0x550bdc['options'][_0xe531('0x1b')]||null:null,'attributes':_0x550bdc['options']?_0x550bdc['options'][_0xe531('0x1c')]||null:null,'limit':_0x550bdc['options']?_0x550bdc['options'][_0xe531('0x1d')]||null:null,'include':_0x550bdc[_0xe531('0x19')]?_0x550bdc[_0xe531('0x19')][_0xe531('0x1e')]?_[_0xe531('0x1f')](_0x550bdc[_0xe531('0x19')][_0xe531('0x1e')],function(_0x106f11){return{'model':db[_0x106f11[_0xe531('0x20')]],'as':_0x106f11['as'],'attributes':_0x106f11[_0xe531('0x1c')],'include':_0x106f11['include']?_['map'](_0x106f11[_0xe531('0x1e')],function(_0x1b2359){return{'model':db[_0x1b2359[_0xe531('0x20')]],'as':_0x1b2359['as'],'attributes':_0x1b2359[_0xe531('0x1c')],'include':_0x1b2359[_0xe531('0x1e')]?_[_0xe531('0x1f')](_0x1b2359[_0xe531('0x1e')],function(_0x1296bb){return{'model':db[_0x1296bb[_0xe531('0x20')]],'as':_0x1296bb['as'],'attributes':_0x1296bb['attributes']};}):[]};}):[]};}):[]:[]})[_0xe531('0xc')](function(_0x2c6dfd){logger['info'](_0xe531('0x16'),_0x550bdc);logger['debug'](_0xe531('0x16'),_0x550bdc,JSON[_0xe531('0x12')](_0x2c6dfd));_0x409a8f(_0x2c6dfd);})[_0xe531('0x15')](function(_0x2752f7){logger[_0xe531('0x13')]('GetMailServerIn',_0x2752f7[_0xe531('0x14')],_0x550bdc);_0x284730(_0x221db0['error'](0x1f4,_0x2752f7[_0xe531('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index cce790a..138de57 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc18a=['Router','../../config/environment','./mailServerOut.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','util','express'];(function(_0x2a6e24,_0x5ba22c){var _0x27e170=function(_0x3e00f7){while(--_0x3e00f7){_0x2a6e24['push'](_0x2a6e24['shift']());}};_0x27e170(++_0x5ba22c);}(_0xc18a,0xce));var _0xac18=function(_0x4d67bd,_0x8d2160){_0x4d67bd=_0x4d67bd-0x0;var _0x4de7c6=_0xc18a[_0x4d67bd];return _0x4de7c6;};'use strict';var multer=require('multer');var util=require(_0xac18('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac18('0x1'));var router=express[_0xac18('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac18('0x3'));var controller=require(_0xac18('0x4'));router[_0xac18('0x5')]('/',auth['isAuthenticated'](),controller[_0xac18('0x6')]);router[_0xac18('0x5')](_0xac18('0x7'),auth['isAuthenticated'](),controller[_0xac18('0x8')]);router[_0xac18('0x9')]('/',auth[_0xac18('0xa')](),controller[_0xac18('0xb')]);router[_0xac18('0xc')](_0xac18('0x7'),auth[_0xac18('0xa')](),controller[_0xac18('0xd')]);router[_0xac18('0xe')](_0xac18('0x7'),auth[_0xac18('0xa')](),controller[_0xac18('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf13c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','path'];(function(_0x55519c,_0x4c36a4){var _0x394716=function(_0x52ed78){while(--_0x52ed78){_0x55519c['push'](_0x55519c['shift']());}};_0x394716(++_0x4c36a4);}(_0xf13c,0x1c6));var _0xcf13=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xf13c[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xcf13('0x0'));var util=require('util');var path=require(_0xcf13('0x1'));var timeout=require(_0xcf13('0x2'));var express=require(_0xcf13('0x3'));var router=express[_0xcf13('0x4')]();var auth=require(_0xcf13('0x5'));var interaction=require(_0xcf13('0x6'));var config=require(_0xcf13('0x7'));var controller=require(_0xcf13('0x8'));router[_0xcf13('0x9')]('/',auth[_0xcf13('0xa')](),controller[_0xcf13('0xb')]);router['get'](_0xcf13('0xc'),auth[_0xcf13('0xa')](),controller[_0xcf13('0xd')]);router[_0xcf13('0xe')]('/',auth[_0xcf13('0xa')](),controller[_0xcf13('0xf')]);router['put'](_0xcf13('0xc'),auth[_0xcf13('0xa')](),controller['update']);router[_0xcf13('0x10')](_0xcf13('0xc'),auth[_0xcf13('0xa')](),controller[_0xcf13('0x11')]);module[_0xcf13('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 87c4064..7966d7e 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0324=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x2934c9,_0x358fca){var _0x4b09b8=function(_0x4ab2fe){while(--_0x4ab2fe){_0x2934c9['push'](_0x2934c9['shift']());}};_0x4b09b8(++_0x358fca);}(_0x0324,0x90));var _0x4032=function(_0x463c68,_0x37c42c){_0x463c68=_0x463c68-0x0;var _0x18a5b3=_0x0324[_0x463c68];return _0x18a5b3;};'use strict';var Sequelize=require('sequelize');module[_0x4032('0x0')]={'description':{'type':Sequelize[_0x4032('0x1')]},'host':{'type':Sequelize[_0x4032('0x1')]},'user':{'type':Sequelize[_0x4032('0x1')]},'pass':{'type':Sequelize[_0x4032('0x1')]},'port':{'type':Sequelize[_0x4032('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x4032('0x1')]},'authentication':{'type':Sequelize[_0x4032('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9bdb=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x2e5364,_0x328ff2){var _0x536996=function(_0x2f97e6){while(--_0x2f97e6){_0x2e5364['push'](_0x2e5364['shift']());}};_0x536996(++_0x328ff2);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x2f6a32,_0x5bb4dc){_0x2f6a32=_0x2f6a32-0x0;var _0x3ccfbe=_0x9bdb[_0x2f6a32];return _0x3ccfbe;};'use strict';var Sequelize=require(_0xb9bd('0x0'));module[_0xb9bd('0x1')]={'description':{'type':Sequelize[_0xb9bd('0x2')]},'host':{'type':Sequelize[_0xb9bd('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xb9bd('0x2')]},'port':{'type':Sequelize[_0xb9bd('0x3')]},'secure':{'type':Sequelize[_0xb9bd('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xb9bd('0x2')]},'authentication':{'type':Sequelize[_0xb9bd('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 39dd331..b808fcf 100644 --- a/server/api/mailServerOut/mailServerOut.controller.js +++ b/server/api/mailServerOut/mailServerOut.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa421=['attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','MailServerOut','includeAll','include','params','rawAttributes','options','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection'];(function(_0x40f179,_0x44c188){var _0xc832d6=function(_0x25aad1){while(--_0x25aad1){_0x40f179['push'](_0x40f179['shift']());}};_0xc832d6(++_0x44c188);}(_0xa421,0x17e));var _0x1a42=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xa421[_0x125ff8];return _0x2d9ef;};'use strict';var pdf=require(_0x1a42('0x0'));var emlformat=require(_0x1a42('0x1'));var rimraf=require(_0x1a42('0x2'));var zipdir=require(_0x1a42('0x3'));var jsonpatch=require(_0x1a42('0x4'));var rp=require(_0x1a42('0x5'));var moment=require(_0x1a42('0x6'));var BPromise=require(_0x1a42('0x7'));var Mustache=require(_0x1a42('0x8'));var util=require(_0x1a42('0x9'));var path=require(_0x1a42('0xa'));var sox=require(_0x1a42('0xb'));var csv=require(_0x1a42('0xc'));var ejs=require(_0x1a42('0xd'));var fs=require('fs');var _=require(_0x1a42('0xe'));var squel=require(_0x1a42('0xf'));var crypto=require(_0x1a42('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a42('0x11'));var Redis=require(_0x1a42('0x12'));var authService=require(_0x1a42('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1a42('0x14'));var hardwareService=require(_0x1a42('0x15'));var logger=require(_0x1a42('0x16'))(_0x1a42('0x17'));var utils=require('../../config/utils');var config=require(_0x1a42('0x18'));var db=require(_0x1a42('0x19'))['db'];function respondWithStatusCode(_0x16c3e0,_0x44370b){_0x44370b=_0x44370b||0xcc;return function(_0x5846da){if(_0x5846da){return _0x16c3e0[_0x1a42('0x1a')](_0x44370b);}return _0x16c3e0['status'](_0x44370b)[_0x1a42('0x1b')]();};}function respondWithResult(_0x20cf9c,_0xcfbc0f){_0xcfbc0f=_0xcfbc0f||0xc8;return function(_0x3a8693){if(_0x3a8693){return _0x20cf9c['status'](_0xcfbc0f)['json'](_0x3a8693);}};}function respondWithFilteredResult(_0x2560c9,_0x19e25e){return function(_0x41309d){if(_0x41309d){var _0x3af0e2=_0x41309d[_0x1a42('0x1c')],_0x34dae3=_0x19e25e[_0x1a42('0x1d')],_0x5662ed=_0x19e25e['offset']+_0x19e25e[_0x1a42('0x1e')],_0x26955f;if(_0x5662ed>=_0x3af0e2){_0x5662ed=_0x3af0e2;_0x26955f=0xc8;}else{_0x26955f=0xce;}_0x2560c9[_0x1a42('0x1f')](_0x26955f);return _0x2560c9['set'](_0x1a42('0x20'),_0x34dae3+'-'+_0x5662ed+'/'+_0x3af0e2)[_0x1a42('0x21')](_0x41309d);}return null;};}function patchUpdates(_0x39d067){return function(_0x50f6dc){try{jsonpatch[_0x1a42('0x22')](_0x50f6dc,_0x39d067,!![]);}catch(_0x36fefa){return BPromise[_0x1a42('0x23')](_0x36fefa);}return _0x50f6dc['save']();};}function saveUpdates(_0xafb8aa,_0x2fcf9b){return function(_0x454672){if(_0x454672){return _0x454672['update'](_0xafb8aa)[_0x1a42('0x24')](function(_0x4bf8bd){return _0x4bf8bd;});}return null;};}function removeEntity(_0x214886,_0x36e2a2){return function(_0x102e03){if(_0x102e03){return _0x102e03[_0x1a42('0x25')]()['then'](function(){_0x214886['status'](0xcc)[_0x1a42('0x1b')]();});}};}function handleEntityNotFound(_0x5c28d9,_0x4e4884){return function(_0x583e57){if(!_0x583e57){_0x5c28d9['sendStatus'](0x194);}return _0x583e57;};}function handleError(_0x5bad7b,_0x452237){_0x452237=_0x452237||0x1f4;return function(_0x4c7950){logger[_0x1a42('0x26')](_0x4c7950[_0x1a42('0x27')]);if(_0x4c7950[_0x1a42('0x28')]){delete _0x4c7950[_0x1a42('0x28')];}_0x5bad7b[_0x1a42('0x1f')](_0x452237)[_0x1a42('0x29')](_0x4c7950);};}exports[_0x1a42('0x2a')]=function(_0x3fc7b6,_0x727f4){var _0x1850d5={},_0x2d6d0c={},_0x15a46d={'count':0x0,'rows':[]};var _0x1c8cea=_[_0x1a42('0x2b')](db['MailServerOut']['rawAttributes'],function(_0x4efc03){return{'name':_0x4efc03[_0x1a42('0x2c')],'type':_0x4efc03[_0x1a42('0x2d')]['key']};});_0x2d6d0c[_0x1a42('0x2e')]=_[_0x1a42('0x2b')](_0x1c8cea,_0x1a42('0x28'));_0x2d6d0c[_0x1a42('0x2f')]=_[_0x1a42('0x30')](_0x3fc7b6['query']);_0x2d6d0c['filters']=_[_0x1a42('0x31')](_0x2d6d0c[_0x1a42('0x2e')],_0x2d6d0c[_0x1a42('0x2f')]);_0x1850d5[_0x1a42('0x32')]=_['intersection'](_0x2d6d0c[_0x1a42('0x2e')],qs[_0x1a42('0x33')](_0x3fc7b6[_0x1a42('0x2f')][_0x1a42('0x33')]));_0x1850d5[_0x1a42('0x32')]=_0x1850d5[_0x1a42('0x32')][_0x1a42('0x34')]?_0x1850d5['attributes']:_0x2d6d0c[_0x1a42('0x2e')];if(!_0x3fc7b6[_0x1a42('0x2f')][_0x1a42('0x35')]('nolimit')){_0x1850d5['limit']=qs['limit'](_0x3fc7b6[_0x1a42('0x2f')][_0x1a42('0x1e')]);_0x1850d5[_0x1a42('0x1d')]=qs[_0x1a42('0x1d')](_0x3fc7b6[_0x1a42('0x2f')][_0x1a42('0x1d')]);}_0x1850d5[_0x1a42('0x36')]=qs[_0x1a42('0x37')](_0x3fc7b6[_0x1a42('0x2f')][_0x1a42('0x37')]);_0x1850d5[_0x1a42('0x38')]=qs[_0x1a42('0x39')](_[_0x1a42('0x3a')](_0x3fc7b6[_0x1a42('0x2f')],_0x2d6d0c['filters']));if(_0x3fc7b6[_0x1a42('0x2f')][_0x1a42('0x3b')]){_0x1850d5[_0x1a42('0x38')]=_['merge'](_0x1850d5[_0x1a42('0x38')],{'$or':_['map'](_0x1c8cea,function(_0x47586f){if(_0x47586f['type']!==_0x1a42('0x3c')){var _0x3d3960={};_0x3d3960[_0x47586f[_0x1a42('0x28')]]={'$like':'%'+_0x3fc7b6[_0x1a42('0x2f')][_0x1a42('0x3b')]+'%'};return _0x3d3960;}})});}_0x1850d5=_[_0x1a42('0x3d')]({},_0x1850d5,_0x3fc7b6['options']);var _0x4150a5={'where':_0x1850d5[_0x1a42('0x38')]};return db[_0x1a42('0x3e')][_0x1a42('0x1c')](_0x4150a5)[_0x1a42('0x24')](function(_0x3ecab6){_0x15a46d[_0x1a42('0x1c')]=_0x3ecab6;if(_0x3fc7b6[_0x1a42('0x2f')][_0x1a42('0x3f')]){_0x1850d5[_0x1a42('0x40')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x1850d5);})[_0x1a42('0x24')](function(_0x3bb2f2){_0x15a46d['rows']=_0x3bb2f2;return _0x15a46d;})[_0x1a42('0x24')](respondWithFilteredResult(_0x727f4,_0x1850d5))['catch'](handleError(_0x727f4,null));};exports['show']=function(_0x2fbea9,_0x14450d){var _0x2b4337={'raw':!![],'where':{'id':_0x2fbea9[_0x1a42('0x41')]['id']}},_0x4f82c9={};_0x4f82c9[_0x1a42('0x2e')]=_[_0x1a42('0x30')](db['MailServerOut'][_0x1a42('0x42')]);_0x4f82c9[_0x1a42('0x2f')]=_[_0x1a42('0x30')](_0x2fbea9[_0x1a42('0x2f')]);_0x4f82c9[_0x1a42('0x39')]=_['intersection'](_0x4f82c9['model'],_0x4f82c9[_0x1a42('0x2f')]);_0x2b4337[_0x1a42('0x32')]=_[_0x1a42('0x31')](_0x4f82c9[_0x1a42('0x2e')],qs['fields'](_0x2fbea9[_0x1a42('0x2f')][_0x1a42('0x33')]));_0x2b4337['attributes']=_0x2b4337[_0x1a42('0x32')]['length']?_0x2b4337[_0x1a42('0x32')]:_0x4f82c9[_0x1a42('0x2e')];if(_0x2fbea9[_0x1a42('0x2f')][_0x1a42('0x3f')]){_0x2b4337[_0x1a42('0x40')]=[{'all':!![]}];}_0x2b4337=_[_0x1a42('0x3d')]({},_0x2b4337,_0x2fbea9[_0x1a42('0x43')]);return db[_0x1a42('0x3e')]['find'](_0x2b4337)['then'](handleEntityNotFound(_0x14450d,null))[_0x1a42('0x24')](respondWithResult(_0x14450d,null))[_0x1a42('0x44')](handleError(_0x14450d,null));};exports[_0x1a42('0x45')]=function(_0x22e5ec,_0x37cc69){return db['MailServerOut'][_0x1a42('0x45')](_0x22e5ec[_0x1a42('0x46')],{})[_0x1a42('0x24')](respondWithResult(_0x37cc69,0xc9))['catch'](handleError(_0x37cc69,null));};exports['update']=function(_0x464593,_0x2e5c86){if(_0x464593['body']['id']){delete _0x464593[_0x1a42('0x46')]['id'];}return db[_0x1a42('0x3e')][_0x1a42('0x47')]({'where':{'id':_0x464593[_0x1a42('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e5c86,null))[_0x1a42('0x24')](saveUpdates(_0x464593['body'],null))[_0x1a42('0x24')](respondWithResult(_0x2e5c86,null))[_0x1a42('0x44')](handleError(_0x2e5c86,null));};exports[_0x1a42('0x25')]=function(_0x18d7c4,_0x420241){return db[_0x1a42('0x3e')][_0x1a42('0x47')]({'where':{'id':_0x18d7c4[_0x1a42('0x41')]['id']}})[_0x1a42('0x24')](handleEntityNotFound(_0x420241,null))['then'](removeEntity(_0x420241,null))[_0x1a42('0x44')](handleError(_0x420241,null));}; \ No newline at end of file +var _0x4931=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','MailServerOut','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x89ae4b,_0x48f80a){var _0x4f0275=function(_0x5ced95){while(--_0x5ced95){_0x89ae4b['push'](_0x89ae4b['shift']());}};_0x4f0275(++_0x48f80a);}(_0x4931,0x81));var _0x1493=function(_0x2b118a,_0x47dad0){_0x2b118a=_0x2b118a-0x0;var _0x1b8585=_0x4931[_0x2b118a];return _0x1b8585;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1493('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1493('0x1'));var rp=require(_0x1493('0x2'));var moment=require(_0x1493('0x3'));var BPromise=require(_0x1493('0x4'));var Mustache=require(_0x1493('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1493('0x6'));var csv=require(_0x1493('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1493('0x8'));var squel=require(_0x1493('0x9'));var crypto=require('crypto');var jsforce=require(_0x1493('0xa'));var deskjs=require(_0x1493('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1493('0xc'));var Redis=require(_0x1493('0xd'));var authService=require(_0x1493('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1493('0xf'));var hardwareService=require(_0x1493('0x10'));var logger=require(_0x1493('0x11'))(_0x1493('0x12'));var utils=require(_0x1493('0x13'));var config=require(_0x1493('0x14'));var db=require(_0x1493('0x15'))['db'];function respondWithStatusCode(_0x902ca6,_0x3b3d16){_0x3b3d16=_0x3b3d16||0xcc;return function(_0x307c70){if(_0x307c70){return _0x902ca6[_0x1493('0x16')](_0x3b3d16);}return _0x902ca6[_0x1493('0x17')](_0x3b3d16)[_0x1493('0x18')]();};}function respondWithResult(_0x44c222,_0xf392c9){_0xf392c9=_0xf392c9||0xc8;return function(_0x52ef37){if(_0x52ef37){return _0x44c222[_0x1493('0x17')](_0xf392c9)['json'](_0x52ef37);}};}function respondWithFilteredResult(_0x579020,_0x239fe2){return function(_0x569e8f){if(_0x569e8f){var _0x3d924d=_0x569e8f['count'],_0x28c855=_0x239fe2['offset'],_0x19287f=_0x239fe2['offset']+_0x239fe2[_0x1493('0x19')],_0x4fbfe1;if(_0x19287f>=_0x3d924d){_0x19287f=_0x3d924d;_0x4fbfe1=0xc8;}else{_0x4fbfe1=0xce;}_0x579020[_0x1493('0x17')](_0x4fbfe1);return _0x579020[_0x1493('0x1a')](_0x1493('0x1b'),_0x28c855+'-'+_0x19287f+'/'+_0x3d924d)[_0x1493('0x1c')](_0x569e8f);}return null;};}function patchUpdates(_0xe5d785){return function(_0x35eec6){try{jsonpatch[_0x1493('0x1d')](_0x35eec6,_0xe5d785,!![]);}catch(_0x19795a){return BPromise[_0x1493('0x1e')](_0x19795a);}return _0x35eec6['save']();};}function saveUpdates(_0xe54024,_0x247313){return function(_0x2c1b76){if(_0x2c1b76){return _0x2c1b76[_0x1493('0x1f')](_0xe54024)[_0x1493('0x20')](function(_0x1ccae9){return _0x1ccae9;});}return null;};}function removeEntity(_0x249823,_0x5e4ff3){return function(_0x3e501e){if(_0x3e501e){return _0x3e501e[_0x1493('0x21')]()[_0x1493('0x20')](function(){_0x249823[_0x1493('0x17')](0xcc)[_0x1493('0x18')]();});}};}function handleEntityNotFound(_0x497cb8,_0x5abf61){return function(_0x3f75cc){if(!_0x3f75cc){_0x497cb8[_0x1493('0x16')](0x194);}return _0x3f75cc;};}function handleError(_0x23eb42,_0x196666){_0x196666=_0x196666||0x1f4;return function(_0x142010){logger[_0x1493('0x22')](_0x142010[_0x1493('0x23')]);if(_0x142010[_0x1493('0x24')]){delete _0x142010[_0x1493('0x24')];}_0x23eb42['status'](_0x196666)['send'](_0x142010);};}exports[_0x1493('0x25')]=function(_0x1ff1d0,_0x1315df){var _0xf44b8a={},_0x188805={},_0xc5f87f={'count':0x0,'rows':[]};var _0x3d520a=_['map'](db['MailServerOut'][_0x1493('0x26')],function(_0x258147){return{'name':_0x258147[_0x1493('0x27')],'type':_0x258147[_0x1493('0x28')][_0x1493('0x29')]};});_0x188805[_0x1493('0x2a')]=_[_0x1493('0x2b')](_0x3d520a,_0x1493('0x24'));_0x188805[_0x1493('0x2c')]=_[_0x1493('0x2d')](_0x1ff1d0['query']);_0x188805[_0x1493('0x2e')]=_['intersection'](_0x188805[_0x1493('0x2a')],_0x188805[_0x1493('0x2c')]);_0xf44b8a[_0x1493('0x2f')]=_[_0x1493('0x30')](_0x188805[_0x1493('0x2a')],qs[_0x1493('0x31')](_0x1ff1d0['query']['fields']));_0xf44b8a[_0x1493('0x2f')]=_0xf44b8a['attributes'][_0x1493('0x32')]?_0xf44b8a['attributes']:_0x188805['model'];if(!_0x1ff1d0[_0x1493('0x2c')][_0x1493('0x33')](_0x1493('0x34'))){_0xf44b8a[_0x1493('0x19')]=qs['limit'](_0x1ff1d0[_0x1493('0x2c')][_0x1493('0x19')]);_0xf44b8a[_0x1493('0x35')]=qs[_0x1493('0x35')](_0x1ff1d0[_0x1493('0x2c')][_0x1493('0x35')]);}_0xf44b8a[_0x1493('0x36')]=qs['sort'](_0x1ff1d0['query'][_0x1493('0x37')]);_0xf44b8a[_0x1493('0x38')]=qs[_0x1493('0x2e')](_['pick'](_0x1ff1d0[_0x1493('0x2c')],_0x188805[_0x1493('0x2e')]));if(_0x1ff1d0[_0x1493('0x2c')][_0x1493('0x39')]){_0xf44b8a[_0x1493('0x38')]=_[_0x1493('0x3a')](_0xf44b8a['where'],{'$or':_[_0x1493('0x2b')](_0x3d520a,function(_0x41bcff){if(_0x41bcff[_0x1493('0x28')]!==_0x1493('0x3b')){var _0x172a8e={};_0x172a8e[_0x41bcff[_0x1493('0x24')]]={'$like':'%'+_0x1ff1d0['query']['filter']+'%'};return _0x172a8e;}})});}_0xf44b8a=_[_0x1493('0x3a')]({},_0xf44b8a,_0x1ff1d0['options']);var _0x464f42={'where':_0xf44b8a[_0x1493('0x38')]};return db[_0x1493('0x3c')]['count'](_0x464f42)[_0x1493('0x20')](function(_0x62d57e){_0xc5f87f[_0x1493('0x3d')]=_0x62d57e;if(_0x1ff1d0[_0x1493('0x2c')][_0x1493('0x3e')]){_0xf44b8a[_0x1493('0x3f')]=[{'all':!![]}];}return db['MailServerOut'][_0x1493('0x40')](_0xf44b8a);})[_0x1493('0x20')](function(_0x36b0e0){_0xc5f87f[_0x1493('0x41')]=_0x36b0e0;return _0xc5f87f;})[_0x1493('0x20')](respondWithFilteredResult(_0x1315df,_0xf44b8a))[_0x1493('0x42')](handleError(_0x1315df,null));};exports[_0x1493('0x43')]=function(_0x57eec5,_0x59ad16){var _0x5d533f={'raw':!![],'where':{'id':_0x57eec5[_0x1493('0x44')]['id']}},_0x16c043={};_0x16c043[_0x1493('0x2a')]=_[_0x1493('0x2d')](db[_0x1493('0x3c')]['rawAttributes']);_0x16c043[_0x1493('0x2c')]=_[_0x1493('0x2d')](_0x57eec5[_0x1493('0x2c')]);_0x16c043[_0x1493('0x2e')]=_[_0x1493('0x30')](_0x16c043['model'],_0x16c043[_0x1493('0x2c')]);_0x5d533f[_0x1493('0x2f')]=_[_0x1493('0x30')](_0x16c043[_0x1493('0x2a')],qs['fields'](_0x57eec5[_0x1493('0x2c')][_0x1493('0x31')]));_0x5d533f['attributes']=_0x5d533f[_0x1493('0x2f')][_0x1493('0x32')]?_0x5d533f[_0x1493('0x2f')]:_0x16c043[_0x1493('0x2a')];if(_0x57eec5['query'][_0x1493('0x3e')]){_0x5d533f[_0x1493('0x3f')]=[{'all':!![]}];}_0x5d533f=_[_0x1493('0x3a')]({},_0x5d533f,_0x57eec5[_0x1493('0x45')]);return db[_0x1493('0x3c')][_0x1493('0x46')](_0x5d533f)[_0x1493('0x20')](handleEntityNotFound(_0x59ad16,null))[_0x1493('0x20')](respondWithResult(_0x59ad16,null))[_0x1493('0x42')](handleError(_0x59ad16,null));};exports[_0x1493('0x47')]=function(_0x44fb5b,_0x2d7a54){return db[_0x1493('0x3c')][_0x1493('0x47')](_0x44fb5b[_0x1493('0x48')],{})[_0x1493('0x20')](respondWithResult(_0x2d7a54,0xc9))[_0x1493('0x42')](handleError(_0x2d7a54,null));};exports[_0x1493('0x1f')]=function(_0x4a12e6,_0x34df8e){if(_0x4a12e6[_0x1493('0x48')]['id']){delete _0x4a12e6[_0x1493('0x48')]['id'];}return db[_0x1493('0x3c')][_0x1493('0x46')]({'where':{'id':_0x4a12e6[_0x1493('0x44')]['id']}})[_0x1493('0x20')](handleEntityNotFound(_0x34df8e,null))[_0x1493('0x20')](saveUpdates(_0x4a12e6['body'],null))[_0x1493('0x20')](respondWithResult(_0x34df8e,null))[_0x1493('0x42')](handleError(_0x34df8e,null));};exports['destroy']=function(_0x5e91bf,_0x15a1ec){return db[_0x1493('0x3c')][_0x1493('0x46')]({'where':{'id':_0x5e91bf[_0x1493('0x44')]['id']}})['then'](handleEntityNotFound(_0x15a1ec,null))['then'](removeEntity(_0x15a1ec,null))[_0x1493('0x42')](handleError(_0x15a1ec,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 666ef7f..ab1015c 100644 --- a/server/api/mailServerOut/mailServerOut.model.js +++ b/server/api/mailServerOut/mailServerOut.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x687b=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x4cc9d5,_0x4fd790){var _0x287fcf=function(_0x18cc62){while(--_0x18cc62){_0x4cc9d5['push'](_0x4cc9d5['shift']());}};_0x287fcf(++_0x4fd790);}(_0x687b,0x14a));var _0xb687=function(_0x338442,_0x1974d1){_0x338442=_0x338442-0x0;var _0x11179b=_0x687b[_0x338442];return _0x11179b;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['mail_servers_out','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0x226b07,_0xc27f7){var _0x51535c=function(_0x3eebb7){while(--_0x3eebb7){_0x226b07['push'](_0x226b07['shift']());}};_0x51535c(++_0xc27f7);}(_0x326f,0xd1));var _0xf326=function(_0x398c66,_0x4fbb3f){_0x398c66=_0x398c66-0x0;var _0x585fbf=_0x326f[_0x398c66];return _0x585fbf;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index bfb2a9a..cc05a3a 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf322=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x18161d,_0x490f29){var _0x68b361=function(_0x5c3fbb){while(--_0x5c3fbb){_0x18161d['push'](_0x18161d['shift']());}};_0x68b361(++_0x490f29);}(_0xf322,0xda));var _0x2f32=function(_0x28f0af,_0x41f93c){_0x28f0af=_0x28f0af-0x0;var _0x29021c=_0xf322[_0x28f0af];return _0x29021c;};'use strict';var _=require(_0x2f32('0x0'));var util=require('util');var moment=require(_0x2f32('0x1'));var BPromise=require(_0x2f32('0x2'));var rs=require(_0x2f32('0x3'));var fs=require('fs');var Redis=require(_0x2f32('0x4'));var db=require(_0x2f32('0x5'))['db'];var utils=require(_0x2f32('0x6'));var logger=require(_0x2f32('0x7'))(_0x2f32('0x8'));var config=require(_0x2f32('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2f32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc9d9c5,_0x46f89f,_0x98c8aa){return new BPromise(function(_0x4e1f64,_0x342181){return client[_0x2f32('0xb')](_0xc9d9c5,_0x98c8aa)[_0x2f32('0xc')](function(_0x322ce7){logger[_0x2f32('0xd')](_0x2f32('0xe'),_0x46f89f,_0x2f32('0xf'));logger['debug'](_0x2f32('0x10'),_0x46f89f,_0x2f32('0xf'),JSON[_0x2f32('0x11')](_0x322ce7));if(_0x322ce7[_0x2f32('0x12')]){if(_0x322ce7[_0x2f32('0x12')][_0x2f32('0x13')]===0x1f4){logger[_0x2f32('0x12')](_0x2f32('0xe'),_0x46f89f,_0x322ce7['error'][_0x2f32('0x14')]);return _0x342181(_0x322ce7[_0x2f32('0x12')][_0x2f32('0x14')]);}logger[_0x2f32('0x12')]('MailServerOut,\x20%s,\x20%s',_0x46f89f,_0x322ce7['error'][_0x2f32('0x14')]);return _0x4e1f64(_0x322ce7[_0x2f32('0x12')]['message']);}else{logger[_0x2f32('0xd')](_0x2f32('0xe'),_0x46f89f,_0x2f32('0xf'));_0x4e1f64(_0x322ce7[_0x2f32('0x15')][_0x2f32('0x14')]);}})[_0x2f32('0x16')](function(_0xea122b){logger['error'](_0x2f32('0xe'),_0x46f89f,_0xea122b);_0x342181(_0xea122b);});});} \ No newline at end of file +var _0x06df=['bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x2b000c,_0x40be20){var _0x637770=function(_0x26d34c){while(--_0x26d34c){_0x2b000c['push'](_0x2b000c['shift']());}};_0x637770(++_0x40be20);}(_0x06df,0x11f));var _0xf06d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x06df[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf06d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf06d('0x1'));var rs=require(_0xf06d('0x2'));var fs=require('fs');var Redis=require(_0xf06d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf06d('0x4'))('rpc');var config=require(_0xf06d('0x5'));var jayson=require(_0xf06d('0x6'));var client=jayson[_0xf06d('0x7')][_0xf06d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e2aa6,_0x21df07,_0x3ddbc2){return new BPromise(function(_0x4ac150,_0x159b38){return client['request'](_0x1e2aa6,_0x3ddbc2)[_0xf06d('0x9')](function(_0x5878c3){logger['info'](_0xf06d('0xa'),_0x21df07,_0xf06d('0xb'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0x21df07,'request\x20sent',JSON[_0xf06d('0xc')](_0x5878c3));if(_0x5878c3[_0xf06d('0xd')]){if(_0x5878c3[_0xf06d('0xd')][_0xf06d('0xe')]===0x1f4){logger['error']('MailServerOut,\x20%s,\x20%s',_0x21df07,_0x5878c3[_0xf06d('0xd')][_0xf06d('0xf')]);return _0x159b38(_0x5878c3[_0xf06d('0xd')][_0xf06d('0xf')]);}logger['error'](_0xf06d('0xa'),_0x21df07,_0x5878c3[_0xf06d('0xd')][_0xf06d('0xf')]);return _0x4ac150(_0x5878c3['error'][_0xf06d('0xf')]);}else{logger[_0xf06d('0x10')](_0xf06d('0xa'),_0x21df07,_0xf06d('0xb'));_0x4ac150(_0x5878c3[_0xf06d('0x11')][_0xf06d('0xf')]);}})['catch'](function(_0x13caeb){logger[_0xf06d('0xd')]('MailServerOut,\x20%s,\x20%s',_0x21df07,_0x13caeb);_0x159b38(_0x13caeb);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ccba04e..f622cf0 100644 --- a/server/api/mailSubstatus/index.js +++ b/server/api/mailSubstatus/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd5e=['update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','post','create','put','/:id'];(function(_0x4a09c1,_0x503c99){var _0x391abe=function(_0x5602e4){while(--_0x5602e4){_0x4a09c1['push'](_0x4a09c1['shift']());}};_0x391abe(++_0x503c99);}(_0xbd5e,0x1a7));var _0xebd5=function(_0x1a1d22,_0x50bdf8){_0x1a1d22=_0x1a1d22-0x0;var _0x23ab47=_0xbd5e[_0x1a1d22];return _0x23ab47;};'use strict';var multer=require('multer');var util=require(_0xebd5('0x0'));var path=require(_0xebd5('0x1'));var timeout=require(_0xebd5('0x2'));var express=require('express');var router=express[_0xebd5('0x3')]();var auth=require(_0xebd5('0x4'));var interaction=require(_0xebd5('0x5'));var config=require(_0xebd5('0x6'));var controller=require(_0xebd5('0x7'));router[_0xebd5('0x8')]('/',auth['isAuthenticated'](),controller[_0xebd5('0x9')]);router[_0xebd5('0x8')](_0xebd5('0xa'),auth[_0xebd5('0xb')](),controller[_0xebd5('0xc')]);router[_0xebd5('0x8')]('/:id',auth[_0xebd5('0xb')](),controller['show']);router[_0xebd5('0xd')]('/',auth[_0xebd5('0xb')](),controller[_0xebd5('0xe')]);router[_0xebd5('0xf')](_0xebd5('0x10'),auth[_0xebd5('0xb')](),controller[_0xebd5('0x11')]);router[_0xebd5('0x12')](_0xebd5('0x10'),auth[_0xebd5('0xb')](),controller['destroy']);module[_0xebd5('0x13')]=router; \ No newline at end of file +var _0x8099=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','exports','multer'];(function(_0x3e3cd0,_0x4718c4){var _0x3221f0=function(_0xbda8cb){while(--_0xbda8cb){_0x3e3cd0['push'](_0x3e3cd0['shift']());}};_0x3221f0(++_0x4718c4);}(_0x8099,0x167));var _0x9809=function(_0x3d9886,_0x2338e9){_0x3d9886=_0x3d9886-0x0;var _0x107acb=_0x8099[_0x3d9886];return _0x107acb;};'use strict';var multer=require(_0x9809('0x0'));var util=require(_0x9809('0x1'));var path=require('path');var timeout=require(_0x9809('0x2'));var express=require(_0x9809('0x3'));var router=express[_0x9809('0x4')]();var auth=require(_0x9809('0x5'));var interaction=require(_0x9809('0x6'));var config=require(_0x9809('0x7'));var controller=require('./mailSubstatus.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9809('0x8')](_0x9809('0x9'),auth[_0x9809('0xa')](),controller[_0x9809('0xb')]);router[_0x9809('0x8')]('/:id',auth[_0x9809('0xa')](),controller['show']);router[_0x9809('0xc')]('/',auth[_0x9809('0xa')](),controller[_0x9809('0xd')]);router[_0x9809('0xe')](_0x9809('0xf'),auth[_0x9809('0xa')](),controller[_0x9809('0x10')]);router['delete'](_0x9809('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x9809('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index e0982d5..7e3a4d4 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c1=['STRING','name','sequelize'];(function(_0x19a21c,_0x4e03f8){var _0x3e9b9f=function(_0x40efad){while(--_0x40efad){_0x19a21c['push'](_0x19a21c['shift']());}};_0x3e9b9f(++_0x4e03f8);}(_0x49c1,0xef));var _0x149c=function(_0x3fc29c,_0x1184f3){_0x3fc29c=_0x3fc29c-0x0;var _0x1cd07e=_0x49c1[_0x3fc29c];return _0x1cd07e;};'use strict';var Sequelize=require(_0x149c('0x0'));module['exports']={'name':{'type':Sequelize[_0x149c('0x1')],'unique':_0x149c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x149c('0x1')]}}; \ No newline at end of file +var _0x1228=['STRING','sequelize'];(function(_0xb30afc,_0x4c42cd){var _0x50e4ec=function(_0x54d9e6){while(--_0x54d9e6){_0xb30afc['push'](_0xb30afc['shift']());}};_0x50e4ec(++_0x4c42cd);}(_0x1228,0x12f));var _0x8122=function(_0x3ea05c,_0x4c4b65){_0x3ea05c=_0x3ea05c-0x0;var _0x40c3b9=_0x1228[_0x3ea05c];return _0x40c3b9;};'use strict';var Sequelize=require(_0x8122('0x0'));module['exports']={'name':{'type':Sequelize[_0x8122('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8122('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 3ea82d6..0c7ba9d 100644 --- a/server/api/mailSubstatus/mailSubstatus.controller.js +++ b/server/api/mailSubstatus/mailSubstatus.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['findAll','rows','catch','find','create','body','params','destroy','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','update','then','error','stack','name','index','MailSubstatus','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x5a12f7,_0x2defde){var _0x35d426=function(_0x279bff){while(--_0x279bff){_0x5a12f7['push'](_0x5a12f7['shift']());}};_0x35d426(++_0x2defde);}(_0xe14b,0x93));var _0xbe14=function(_0x56c87e,_0x3f0c89){_0x56c87e=_0x56c87e-0x0;var _0x168c3b=_0xe14b[_0x56c87e];return _0x168c3b;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];function respondWithStatusCode(_0x3d38c2,_0x27792f){_0x27792f=_0x27792f||0xcc;return function(_0x3b898d){if(_0x3b898d){return _0x3d38c2[_0xbe14('0x15')](_0x27792f);}return _0x3d38c2[_0xbe14('0x16')](_0x27792f)[_0xbe14('0x17')]();};}function respondWithResult(_0xa2cf72,_0x1e4826){_0x1e4826=_0x1e4826||0xc8;return function(_0x33fd54){if(_0x33fd54){return _0xa2cf72[_0xbe14('0x16')](_0x1e4826)['json'](_0x33fd54);}};}function respondWithFilteredResult(_0x55b3a7,_0x3f58f5){return function(_0x3dc4a9){if(_0x3dc4a9){var _0xf4ac9=_0x3dc4a9[_0xbe14('0x18')],_0x37ce4e=_0x3f58f5[_0xbe14('0x19')],_0x4e8f34=_0x3f58f5[_0xbe14('0x19')]+_0x3f58f5[_0xbe14('0x1a')],_0x21c789;if(_0x4e8f34>=_0xf4ac9){_0x4e8f34=_0xf4ac9;_0x21c789=0xc8;}else{_0x21c789=0xce;}_0x55b3a7[_0xbe14('0x16')](_0x21c789);return _0x55b3a7[_0xbe14('0x1b')]('Content-Range',_0x37ce4e+'-'+_0x4e8f34+'/'+_0xf4ac9)[_0xbe14('0x1c')](_0x3dc4a9);}return null;};}function patchUpdates(_0x456ca8){return function(_0x329588){try{jsonpatch[_0xbe14('0x1d')](_0x329588,_0x456ca8,!![]);}catch(_0x3249da){return BPromise[_0xbe14('0x1e')](_0x3249da);}return _0x329588['save']();};}function saveUpdates(_0x24f820,_0x4a1bbd){return function(_0x417c8d){if(_0x417c8d){return _0x417c8d[_0xbe14('0x1f')](_0x24f820)[_0xbe14('0x20')](function(_0x51dc0b){return _0x51dc0b;});}return null;};}function removeEntity(_0xe60f42,_0x56d845){return function(_0x3c1c85){if(_0x3c1c85){return _0x3c1c85['destroy']()[_0xbe14('0x20')](function(){_0xe60f42['status'](0xcc)[_0xbe14('0x17')]();});}};}function handleEntityNotFound(_0x3d3608,_0x505dbd){return function(_0x2da350){if(!_0x2da350){_0x3d3608['sendStatus'](0x194);}return _0x2da350;};}function handleError(_0x4587a8,_0x4851f8){_0x4851f8=_0x4851f8||0x1f4;return function(_0x36a21e){logger[_0xbe14('0x21')](_0x36a21e[_0xbe14('0x22')]);if(_0x36a21e[_0xbe14('0x23')]){delete _0x36a21e[_0xbe14('0x23')];}_0x4587a8[_0xbe14('0x16')](_0x4851f8)['send'](_0x36a21e);};}exports[_0xbe14('0x24')]=function(_0x1ba46a,_0x391556){var _0x169369={},_0x5dd475={},_0x16f884={'count':0x0,'rows':[]};var _0x29fc64=_['map'](db[_0xbe14('0x25')][_0xbe14('0x26')],function(_0x1c7cc7){return{'name':_0x1c7cc7[_0xbe14('0x27')],'type':_0x1c7cc7[_0xbe14('0x28')][_0xbe14('0x29')]};});_0x5dd475[_0xbe14('0x2a')]=_[_0xbe14('0x2b')](_0x29fc64,_0xbe14('0x23'));_0x5dd475[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](_0x1ba46a[_0xbe14('0x2c')]);_0x5dd475[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],_0x5dd475[_0xbe14('0x2c')]);_0x169369[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],qs[_0xbe14('0x31')](_0x1ba46a['query'][_0xbe14('0x31')]));_0x169369['attributes']=_0x169369['attributes'][_0xbe14('0x32')]?_0x169369['attributes']:_0x5dd475[_0xbe14('0x2a')];if(!_0x1ba46a[_0xbe14('0x2c')]['hasOwnProperty']('nolimit')){_0x169369['limit']=qs[_0xbe14('0x1a')](_0x1ba46a[_0xbe14('0x2c')]['limit']);_0x169369[_0xbe14('0x19')]=qs[_0xbe14('0x19')](_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x19')]);}_0x169369[_0xbe14('0x33')]=qs['sort'](_0x1ba46a['query'][_0xbe14('0x34')]);_0x169369['where']=qs['filters'](_['pick'](_0x1ba46a[_0xbe14('0x2c')],_0x5dd475[_0xbe14('0x2e')]));if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x35')]){_0x169369[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x169369[_0xbe14('0x36')],{'$or':_[_0xbe14('0x2b')](_0x29fc64,function(_0x2d9c12){if(_0x2d9c12[_0xbe14('0x28')]!==_0xbe14('0x38')){var _0x32c59d={};_0x32c59d[_0x2d9c12['name']]={'$like':'%'+_0x1ba46a['query'][_0xbe14('0x35')]+'%'};return _0x32c59d;}})});}_0x169369=_[_0xbe14('0x37')]({},_0x169369,_0x1ba46a[_0xbe14('0x39')]);var _0x520e09={'where':_0x169369[_0xbe14('0x36')]};return db[_0xbe14('0x25')][_0xbe14('0x18')](_0x520e09)[_0xbe14('0x20')](function(_0x3bd454){_0x16f884[_0xbe14('0x18')]=_0x3bd454;if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x3a')]){_0x169369[_0xbe14('0x3b')]=[{'all':!![]}];}return db['MailSubstatus'][_0xbe14('0x3c')](_0x169369);})[_0xbe14('0x20')](function(_0x3463c4){_0x16f884[_0xbe14('0x3d')]=_0x3463c4;return _0x16f884;})[_0xbe14('0x20')](respondWithFilteredResult(_0x391556,_0x169369))[_0xbe14('0x3e')](handleError(_0x391556,null));};exports['show']=function(_0xb0f143,_0x1974a4){var _0x1220c9={'raw':!![],'where':{'id':_0xb0f143['params']['id']}},_0x36263c={};_0x36263c['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x25')][_0xbe14('0x26')]);_0x36263c['query']=_['keys'](_0xb0f143[_0xbe14('0x2c')]);_0x36263c['filters']=_['intersection'](_0x36263c[_0xbe14('0x2a')],_0x36263c[_0xbe14('0x2c')]);_0x1220c9[_0xbe14('0x30')]=_['intersection'](_0x36263c['model'],qs['fields'](_0xb0f143[_0xbe14('0x2c')][_0xbe14('0x31')]));_0x1220c9[_0xbe14('0x30')]=_0x1220c9['attributes'][_0xbe14('0x32')]?_0x1220c9[_0xbe14('0x30')]:_0x36263c[_0xbe14('0x2a')];if(_0xb0f143[_0xbe14('0x2c')]['includeAll']){_0x1220c9['include']=[{'all':!![]}];}_0x1220c9=_[_0xbe14('0x37')]({},_0x1220c9,_0xb0f143[_0xbe14('0x39')]);return db[_0xbe14('0x25')][_0xbe14('0x3f')](_0x1220c9)[_0xbe14('0x20')](handleEntityNotFound(_0x1974a4,null))['then'](respondWithResult(_0x1974a4,null))['catch'](handleError(_0x1974a4,null));};exports[_0xbe14('0x40')]=function(_0x2a3623,_0x238c60){return db[_0xbe14('0x25')]['create'](_0x2a3623[_0xbe14('0x41')],{})[_0xbe14('0x20')](respondWithResult(_0x238c60,0xc9))['catch'](handleError(_0x238c60,null));};exports[_0xbe14('0x1f')]=function(_0x2a35e5,_0x2d6ee8){if(_0x2a35e5[_0xbe14('0x41')]['id']){delete _0x2a35e5['body']['id'];}return db['MailSubstatus'][_0xbe14('0x3f')]({'where':{'id':_0x2a35e5[_0xbe14('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d6ee8,null))['then'](saveUpdates(_0x2a35e5[_0xbe14('0x41')],null))[_0xbe14('0x20')](respondWithResult(_0x2d6ee8,null))[_0xbe14('0x3e')](handleError(_0x2d6ee8,null));};exports[_0xbe14('0x43')]=function(_0xdbc6e1,_0xd04fd5){return db[_0xbe14('0x25')]['find']({'where':{'id':_0xdbc6e1[_0xbe14('0x42')]['id']}})[_0xbe14('0x20')](handleEntityNotFound(_0xd04fd5,null))[_0xbe14('0x20')](removeEntity(_0xd04fd5,null))[_0xbe14('0x3e')](handleError(_0xd04fd5,null));};exports[_0xbe14('0x44')]=function(_0x494c32,_0x3a221b){return db[_0xbe14('0x25')][_0xbe14('0x44')]()[_0xbe14('0x20')](respondWithResult(_0x3a221b,null))[_0xbe14('0x3e')](handleError(_0x3a221b,null));}; \ No newline at end of file +var _0xee14=['show','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','MailSubstatus','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x483c91,_0x5bbc6c){var _0x1a1437=function(_0x210757){while(--_0x210757){_0x483c91['push'](_0x483c91['shift']());}};_0x1a1437(++_0x5bbc6c);}(_0xee14,0x13a));var _0x4ee1=function(_0x4de82f,_0x38d758){_0x4de82f=_0x4de82f-0x0;var _0x33ddb6=_0xee14[_0x4de82f];return _0x33ddb6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4ee1('0x0'));var zipdir=require(_0x4ee1('0x1'));var jsonpatch=require(_0x4ee1('0x2'));var rp=require(_0x4ee1('0x3'));var moment=require(_0x4ee1('0x4'));var BPromise=require(_0x4ee1('0x5'));var Mustache=require(_0x4ee1('0x6'));var util=require(_0x4ee1('0x7'));var path=require(_0x4ee1('0x8'));var sox=require('sox');var csv=require(_0x4ee1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0x9'));var querystring=require('querystring');var Papa=require(_0x4ee1('0xf'));var Redis=require(_0x4ee1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x11'));var as=require(_0x4ee1('0x12'));var hardwareService=require(_0x4ee1('0x13'));var logger=require(_0x4ee1('0x14'))('api');var utils=require(_0x4ee1('0x15'));var config=require(_0x4ee1('0x16'));var db=require(_0x4ee1('0x17'))['db'];function respondWithStatusCode(_0x2d5d3c,_0x2f864e){_0x2f864e=_0x2f864e||0xcc;return function(_0x174427){if(_0x174427){return _0x2d5d3c['sendStatus'](_0x2f864e);}return _0x2d5d3c[_0x4ee1('0x18')](_0x2f864e)[_0x4ee1('0x19')]();};}function respondWithResult(_0x1096a5,_0x24a915){_0x24a915=_0x24a915||0xc8;return function(_0x46d2c2){if(_0x46d2c2){return _0x1096a5[_0x4ee1('0x18')](_0x24a915)[_0x4ee1('0x1a')](_0x46d2c2);}};}function respondWithFilteredResult(_0x359bab,_0xb7eafd){return function(_0x4e3490){if(_0x4e3490){var _0x2f9194=_0x4e3490[_0x4ee1('0x1b')],_0x38008f=_0xb7eafd[_0x4ee1('0x1c')],_0x34651b=_0xb7eafd[_0x4ee1('0x1c')]+_0xb7eafd[_0x4ee1('0x1d')],_0x1b1e0e;if(_0x34651b>=_0x2f9194){_0x34651b=_0x2f9194;_0x1b1e0e=0xc8;}else{_0x1b1e0e=0xce;}_0x359bab[_0x4ee1('0x18')](_0x1b1e0e);return _0x359bab[_0x4ee1('0x1e')](_0x4ee1('0x1f'),_0x38008f+'-'+_0x34651b+'/'+_0x2f9194)['json'](_0x4e3490);}return null;};}function patchUpdates(_0x236215){return function(_0x3db827){try{jsonpatch[_0x4ee1('0x20')](_0x3db827,_0x236215,!![]);}catch(_0x1034fb){return BPromise[_0x4ee1('0x21')](_0x1034fb);}return _0x3db827[_0x4ee1('0x22')]();};}function saveUpdates(_0x48a959,_0x8a631f){return function(_0x333e96){if(_0x333e96){return _0x333e96[_0x4ee1('0x23')](_0x48a959)[_0x4ee1('0x24')](function(_0x160a26){return _0x160a26;});}return null;};}function removeEntity(_0x224b54,_0x328f21){return function(_0x40fd98){if(_0x40fd98){return _0x40fd98[_0x4ee1('0x25')]()[_0x4ee1('0x24')](function(){_0x224b54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(!_0xaf87e7){_0x14110c[_0x4ee1('0x26')](0x194);}return _0xaf87e7;};}function handleError(_0x1e9a50,_0x28efdc){_0x28efdc=_0x28efdc||0x1f4;return function(_0x57d45d){logger['error'](_0x57d45d[_0x4ee1('0x27')]);if(_0x57d45d[_0x4ee1('0x28')]){delete _0x57d45d['name'];}_0x1e9a50[_0x4ee1('0x18')](_0x28efdc)[_0x4ee1('0x29')](_0x57d45d);};}exports[_0x4ee1('0x2a')]=function(_0x215949,_0x2d699c){var _0x3c7b2a={},_0x45bd0d={},_0x56c4d3={'count':0x0,'rows':[]};var _0x1f7b74=_['map'](db[_0x4ee1('0x2b')]['rawAttributes'],function(_0x3dc870){return{'name':_0x3dc870[_0x4ee1('0x2c')],'type':_0x3dc870[_0x4ee1('0x2d')][_0x4ee1('0x2e')]};});_0x45bd0d[_0x4ee1('0x2f')]=_['map'](_0x1f7b74,_0x4ee1('0x28'));_0x45bd0d['query']=_[_0x4ee1('0x30')](_0x215949[_0x4ee1('0x31')]);_0x45bd0d[_0x4ee1('0x32')]=_[_0x4ee1('0x33')](_0x45bd0d[_0x4ee1('0x2f')],_0x45bd0d['query']);_0x3c7b2a[_0x4ee1('0x34')]=_[_0x4ee1('0x33')](_0x45bd0d[_0x4ee1('0x2f')],qs[_0x4ee1('0x35')](_0x215949[_0x4ee1('0x31')][_0x4ee1('0x35')]));_0x3c7b2a['attributes']=_0x3c7b2a['attributes'][_0x4ee1('0x36')]?_0x3c7b2a[_0x4ee1('0x34')]:_0x45bd0d[_0x4ee1('0x2f')];if(!_0x215949['query'][_0x4ee1('0x37')](_0x4ee1('0x38'))){_0x3c7b2a[_0x4ee1('0x1d')]=qs[_0x4ee1('0x1d')](_0x215949[_0x4ee1('0x31')][_0x4ee1('0x1d')]);_0x3c7b2a[_0x4ee1('0x1c')]=qs[_0x4ee1('0x1c')](_0x215949[_0x4ee1('0x31')][_0x4ee1('0x1c')]);}_0x3c7b2a[_0x4ee1('0x39')]=qs[_0x4ee1('0x3a')](_0x215949[_0x4ee1('0x31')]['sort']);_0x3c7b2a[_0x4ee1('0x3b')]=qs[_0x4ee1('0x32')](_[_0x4ee1('0x3c')](_0x215949['query'],_0x45bd0d['filters']));if(_0x215949[_0x4ee1('0x31')][_0x4ee1('0x3d')]){_0x3c7b2a[_0x4ee1('0x3b')]=_[_0x4ee1('0x3e')](_0x3c7b2a['where'],{'$or':_[_0x4ee1('0x3f')](_0x1f7b74,function(_0x2ed16f){if(_0x2ed16f[_0x4ee1('0x2d')]!==_0x4ee1('0x40')){var _0x2653c4={};_0x2653c4[_0x2ed16f[_0x4ee1('0x28')]]={'$like':'%'+_0x215949[_0x4ee1('0x31')][_0x4ee1('0x3d')]+'%'};return _0x2653c4;}})});}_0x3c7b2a=_['merge']({},_0x3c7b2a,_0x215949[_0x4ee1('0x41')]);var _0x1116b4={'where':_0x3c7b2a[_0x4ee1('0x3b')]};return db[_0x4ee1('0x2b')][_0x4ee1('0x1b')](_0x1116b4)[_0x4ee1('0x24')](function(_0x543b2e){_0x56c4d3[_0x4ee1('0x1b')]=_0x543b2e;if(_0x215949[_0x4ee1('0x31')][_0x4ee1('0x42')]){_0x3c7b2a[_0x4ee1('0x43')]=[{'all':!![]}];}return db[_0x4ee1('0x2b')][_0x4ee1('0x44')](_0x3c7b2a);})[_0x4ee1('0x24')](function(_0xaac883){_0x56c4d3[_0x4ee1('0x45')]=_0xaac883;return _0x56c4d3;})[_0x4ee1('0x24')](respondWithFilteredResult(_0x2d699c,_0x3c7b2a))[_0x4ee1('0x46')](handleError(_0x2d699c,null));};exports[_0x4ee1('0x47')]=function(_0x34fc7a,_0x51fd40){var _0x3b3bed={'raw':!![],'where':{'id':_0x34fc7a['params']['id']}},_0x40a3e3={};_0x40a3e3[_0x4ee1('0x2f')]=_['keys'](db[_0x4ee1('0x2b')]['rawAttributes']);_0x40a3e3[_0x4ee1('0x31')]=_[_0x4ee1('0x30')](_0x34fc7a['query']);_0x40a3e3[_0x4ee1('0x32')]=_[_0x4ee1('0x33')](_0x40a3e3[_0x4ee1('0x2f')],_0x40a3e3[_0x4ee1('0x31')]);_0x3b3bed['attributes']=_[_0x4ee1('0x33')](_0x40a3e3[_0x4ee1('0x2f')],qs[_0x4ee1('0x35')](_0x34fc7a['query']['fields']));_0x3b3bed[_0x4ee1('0x34')]=_0x3b3bed[_0x4ee1('0x34')][_0x4ee1('0x36')]?_0x3b3bed[_0x4ee1('0x34')]:_0x40a3e3[_0x4ee1('0x2f')];if(_0x34fc7a['query']['includeAll']){_0x3b3bed[_0x4ee1('0x43')]=[{'all':!![]}];}_0x3b3bed=_[_0x4ee1('0x3e')]({},_0x3b3bed,_0x34fc7a[_0x4ee1('0x41')]);return db[_0x4ee1('0x2b')]['find'](_0x3b3bed)[_0x4ee1('0x24')](handleEntityNotFound(_0x51fd40,null))[_0x4ee1('0x24')](respondWithResult(_0x51fd40,null))['catch'](handleError(_0x51fd40,null));};exports[_0x4ee1('0x48')]=function(_0x16dc20,_0x21edeb){return db[_0x4ee1('0x2b')][_0x4ee1('0x48')](_0x16dc20[_0x4ee1('0x49')],{})[_0x4ee1('0x24')](respondWithResult(_0x21edeb,0xc9))[_0x4ee1('0x46')](handleError(_0x21edeb,null));};exports[_0x4ee1('0x23')]=function(_0x4ebb28,_0x49b667){if(_0x4ebb28[_0x4ee1('0x49')]['id']){delete _0x4ebb28[_0x4ee1('0x49')]['id'];}return db[_0x4ee1('0x2b')][_0x4ee1('0x4a')]({'where':{'id':_0x4ebb28['params']['id']}})[_0x4ee1('0x24')](handleEntityNotFound(_0x49b667,null))[_0x4ee1('0x24')](saveUpdates(_0x4ebb28[_0x4ee1('0x49')],null))[_0x4ee1('0x24')](respondWithResult(_0x49b667,null))[_0x4ee1('0x46')](handleError(_0x49b667,null));};exports['destroy']=function(_0x1c71ba,_0x4ae560){return db[_0x4ee1('0x2b')]['find']({'where':{'id':_0x1c71ba[_0x4ee1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ae560,null))[_0x4ee1('0x24')](removeEntity(_0x4ae560,null))['catch'](handleError(_0x4ae560,null));};exports[_0x4ee1('0x4c')]=function(_0x480796,_0xd19964){return db['MailSubstatus'][_0x4ee1('0x4c')]()[_0x4ee1('0x24')](respondWithResult(_0xd19964,null))[_0x4ee1('0x46')](handleError(_0xd19964,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 9cb3c5c..4ff6c7c 100644 --- a/server/api/mailSubstatus/mailSubstatus.model.js +++ b/server/api/mailSubstatus/mailSubstatus.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd4f=['exports','define','MailSubstatus','lodash','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x13706e,_0x4e4954){_0x13706e=_0x13706e-0x0;var _0x1b6e08=_0xdd4f[_0x13706e];return _0x1b6e08;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfdd4('0x1'));var BPromise=require(_0xfdd4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd4('0x3'));var rimraf=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var attributes=require('./mailSubstatus.attributes');module[_0xfdd4('0x6')]=function(_0x43cbcf,_0x30e080){return _0x43cbcf[_0xfdd4('0x7')](_0xfdd4('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb3b=['moment','path','../../config/environment','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api'];(function(_0xacedb7,_0x221975){var _0x5ccd63=function(_0x377bbb){while(--_0x377bbb){_0xacedb7['push'](_0xacedb7['shift']());}};_0x5ccd63(++_0x221975);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0xeb3b[_0x297c55];return _0x120389;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var logger=require(_0xbeb3('0x2'))(_0xbeb3('0x3'));var moment=require(_0xbeb3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbeb3('0x5'));var rimraf=require('rimraf');var config=require(_0xbeb3('0x6'));var attributes=require('./mailSubstatus.attributes');module[_0xbeb3('0x7')]=function(_0x5ae6f9,_0x8d8cce){return _0x5ae6f9[_0xbeb3('0x8')](_0xbeb3('0x9'),attributes,{'tableName':_0xbeb3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 0be2abd..dcee50e 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a7=['message','MailSubstatus,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x114099,_0x4bb684){var _0xb6fae1=function(_0x53d8c4){while(--_0x53d8c4){_0x114099['push'](_0x114099['shift']());}};_0xb6fae1(++_0x4bb684);}(_0x91a7,0xe7));var _0x791a=function(_0x5426a4,_0x61b647){_0x5426a4=_0x5426a4-0x0;var _0x3a1619=_0x91a7[_0x5426a4];return _0x3a1619;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x48bef2,_0x15347a){var _0x5e88b0=function(_0x375d15){while(--_0x375d15){_0x48bef2['push'](_0x48bef2['shift']());}};_0x5e88b0(++_0x15347a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x37814c,_0x52d3db){_0x37814c=_0x37814c-0x0;var _0x195cd4=_0xb43b[_0x37814c];return _0x195cd4;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index dda8966..30d7d9f 100644 --- a/server/api/mailTransferReport/index.js +++ b/server/api/mailTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0fa=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','/:id','isAuthenticated','post','update','delete','destroy'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0xe0fa,0xfd));var _0xae0f=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0xe0fa[_0xdd0313];return _0x2bd7e8;};'use strict';var multer=require(_0xae0f('0x0'));var util=require(_0xae0f('0x1'));var path=require(_0xae0f('0x2'));var timeout=require(_0xae0f('0x3'));var express=require(_0xae0f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xae0f('0x5'));var config=require(_0xae0f('0x6'));var controller=require(_0xae0f('0x7'));router[_0xae0f('0x8')]('/',auth['isAuthenticated'](),controller[_0xae0f('0x9')]);router[_0xae0f('0x8')](_0xae0f('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xae0f('0xb'),auth[_0xae0f('0xc')](),controller['show']);router[_0xae0f('0xd')]('/',auth[_0xae0f('0xc')](),controller['create']);router['put'](_0xae0f('0xb'),auth[_0xae0f('0xc')](),controller[_0xae0f('0xe')]);router[_0xae0f('0xf')]('/:id',auth[_0xae0f('0xc')](),controller[_0xae0f('0x10')]);module[_0xae0f('0x11')]=router; \ No newline at end of file +var _0x87c3=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','destroy'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x87c3,0x1a2));var _0x387c=function(_0x7d5aed,_0x5d0097){_0x7d5aed=_0x7d5aed-0x0;var _0xb118b0=_0x87c3[_0x7d5aed];return _0xb118b0;};'use strict';var multer=require(_0x387c('0x0'));var util=require(_0x387c('0x1'));var path=require(_0x387c('0x2'));var timeout=require('connect-timeout');var express=require(_0x387c('0x3'));var router=express[_0x387c('0x4')]();var auth=require(_0x387c('0x5'));var interaction=require(_0x387c('0x6'));var config=require(_0x387c('0x7'));var controller=require(_0x387c('0x8'));router[_0x387c('0x9')]('/',auth[_0x387c('0xa')](),controller[_0x387c('0xb')]);router[_0x387c('0x9')](_0x387c('0xc'),auth[_0x387c('0xa')](),controller[_0x387c('0xd')]);router['get'](_0x387c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x387c('0xf')]('/',auth['isAuthenticated'](),controller[_0x387c('0x10')]);router['put'](_0x387c('0xe'),auth['isAuthenticated'](),controller[_0x387c('0x11')]);router['delete'](_0x387c('0xe'),auth[_0x387c('0xa')](),controller[_0x387c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 9b3df1d..3f5501d 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37d1=['moment','sequelize','exports','STRING','ENUM','agent','queue','DATE','NOW'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x37d1,0xfc));var _0x137d=function(_0x1affa4,_0x2a293b){_0x1affa4=_0x1affa4-0x0;var _0x30cacf=_0x37d1[_0x1affa4];return _0x30cacf;};'use strict';var moment=require(_0x137d('0x0'));var Sequelize=require(_0x137d('0x1'));module[_0x137d('0x2')]={'uniqueid':{'type':Sequelize[_0x137d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x137d('0x4')]('account',_0x137d('0x5'),_0x137d('0x6')),'allowNull':![],'defaultValue':_0x137d('0x6')},'transferredAt':{'type':Sequelize[_0x137d('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x137d('0x8')]}}; \ No newline at end of file +var _0x46e3=['DATE','NOW','exports','STRING','account'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x46e3,0x115));var _0x346e=function(_0x323e43,_0x1e42c0){_0x323e43=_0x323e43-0x0;var _0x3e5f9a=_0x46e3[_0x323e43];return _0x3e5f9a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x346e('0x0')]={'uniqueid':{'type':Sequelize[_0x346e('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x346e('0x2'),'agent','queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x346e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x346e('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 57f6e5e..9e215a9 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x4bde95,_0x5f4dd2){var _0x4134c5=function(_0x593eb6){while(--_0x593eb6){_0x4bde95['push'](_0x4bde95['shift']());}};_0x4134c5(++_0x5f4dd2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file +var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x147d11,_0x36e857){var _0x4ec49a=function(_0x167b97){while(--_0x167b97){_0x147d11['push'](_0x147d11['shift']());}};_0x4ec49a(++_0x36e857);}(_0x7a54,0x106));var _0x47a5=function(_0x34b3bd,_0x3a870c){_0x34b3bd=_0x34b3bd-0x0;var _0x8020d0=_0x7a54[_0x34b3bd];return _0x8020d0;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index f7fef90..68544f6 100644 --- a/server/api/mailTransferReport/mailTransferReport.model.js +++ b/server/api/mailTransferReport/mailTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b14=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','uniqueid'];(function(_0x1472a0,_0x577abd){var _0x34d59a=function(_0x3ed123){while(--_0x3ed123){_0x1472a0['push'](_0x1472a0['shift']());}};_0x34d59a(++_0x577abd);}(_0x1b14,0xd1));var _0x41b1=function(_0x11745f,_0x2f2f1f){_0x11745f=_0x11745f-0x0;var _0x3bcce5=_0x1b14[_0x11745f];return _0x3bcce5;};'use strict';var _=require(_0x41b1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x41b1('0x1'));var moment=require(_0x41b1('0x2'));var BPromise=require('bluebird');var rp=require(_0x41b1('0x3'));var fs=require('fs');var path=require(_0x41b1('0x4'));var rimraf=require(_0x41b1('0x5'));var config=require(_0x41b1('0x6'));var attributes=require(_0x41b1('0x7'));module['exports']=function(_0x3ee837,_0x442e02){return _0x3ee837[_0x41b1('0x8')](_0x41b1('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x41b1('0xa'),'fields':[_0x41b1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d50=['api','bluebird','request-promise','path','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x592680,_0x44c7c4){var _0x19297e=function(_0x2c9ec2){while(--_0x2c9ec2){_0x592680['push'](_0x592680['shift']());}};_0x19297e(++_0x44c7c4);}(_0x8d50,0xb3));var _0x08d5=function(_0x36c775,_0x274f69){_0x36c775=_0x36c775-0x0;var _0x4ab309=_0x8d50[_0x36c775];return _0x4ab309;};'use strict';var _=require(_0x08d5('0x0'));var util=require(_0x08d5('0x1'));var logger=require(_0x08d5('0x2'))(_0x08d5('0x3'));var moment=require('moment');var BPromise=require(_0x08d5('0x4'));var rp=require(_0x08d5('0x5'));var fs=require('fs');var path=require(_0x08d5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x08d5('0x7'));module[_0x08d5('0x8')]=function(_0x359016,_0x82fd1b){return _0x359016[_0x08d5('0x9')](_0x08d5('0xa'),attributes,{'tableName':_0x08d5('0xb'),'paranoid':![],'indexes':[{'name':_0x08d5('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 1100f81..1b59cb0 100644 --- a/server/api/mailTransferReport/mailTransferReport.rpc.js +++ b/server/api/mailTransferReport/mailTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2d2=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','MailTransferReport,\x20%s,\x20%s','message'];(function(_0x2e819c,_0x3f99a5){var _0x24e271=function(_0x27d596){while(--_0x27d596){_0x2e819c['push'](_0x2e819c['shift']());}};_0x24e271(++_0x3f99a5);}(_0xf2d2,0xbf));var _0x2f2d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf2d2[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x2f2d('0x0'));var util=require(_0x2f2d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f2d('0x2'));var fs=require('fs');var Redis=require(_0x2f2d('0x3'));var db=require(_0x2f2d('0x4'))['db'];var utils=require(_0x2f2d('0x5'));var logger=require(_0x2f2d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2f2d('0x7')][_0x2f2d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41c94,_0x2a7586,_0xb74f61){return new BPromise(function(_0x12934a,_0x2c0055){return client[_0x2f2d('0x9')](_0x41c94,_0xb74f61)[_0x2f2d('0xa')](function(_0x12438e){logger[_0x2f2d('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x2a7586,_0x2f2d('0xc'));logger[_0x2f2d('0xd')](_0x2f2d('0xe'),_0x2a7586,_0x2f2d('0xc'),JSON[_0x2f2d('0xf')](_0x12438e));if(_0x12438e[_0x2f2d('0x10')]){if(_0x12438e[_0x2f2d('0x10')]['code']===0x1f4){logger[_0x2f2d('0x10')](_0x2f2d('0x11'),_0x2a7586,_0x12438e[_0x2f2d('0x10')][_0x2f2d('0x12')]);return _0x2c0055(_0x12438e[_0x2f2d('0x10')][_0x2f2d('0x12')]);}logger['error'](_0x2f2d('0x11'),_0x2a7586,_0x12438e[_0x2f2d('0x10')][_0x2f2d('0x12')]);return _0x12934a(_0x12438e['error']['message']);}else{logger[_0x2f2d('0xb')](_0x2f2d('0x11'),_0x2a7586,_0x2f2d('0xc'));_0x12934a(_0x12438e[_0x2f2d('0x13')]['message']);}})[_0x2f2d('0x14')](function(_0x28a826){logger[_0x2f2d('0x10')](_0x2f2d('0x11'),_0x2a7586,_0x28a826);_0x2c0055(_0x28a826);});});} \ No newline at end of file +var _0xe306=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xe306,0x1c7));var _0x6e30=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe306[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x6e30('0x0'));var util=require('util');var moment=require(_0x6e30('0x1'));var BPromise=require(_0x6e30('0x2'));var rs=require(_0x6e30('0x3'));var fs=require('fs');var Redis=require(_0x6e30('0x4'));var db=require(_0x6e30('0x5'))['db'];var utils=require(_0x6e30('0x6'));var logger=require(_0x6e30('0x7'))(_0x6e30('0x8'));var config=require(_0x6e30('0x9'));var jayson=require(_0x6e30('0xa'));var client=jayson[_0x6e30('0xb')][_0x6e30('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a47d4,_0x5e81e7,_0x11abab){return new BPromise(function(_0x98c630,_0x2d67c4){return client[_0x6e30('0xd')](_0x5a47d4,_0x11abab)[_0x6e30('0xe')](function(_0x246487){logger[_0x6e30('0xf')](_0x6e30('0x10'),_0x5e81e7,_0x6e30('0x11'));logger[_0x6e30('0x12')](_0x6e30('0x13'),_0x5e81e7,'request\x20sent',JSON[_0x6e30('0x14')](_0x246487));if(_0x246487[_0x6e30('0x15')]){if(_0x246487[_0x6e30('0x15')]['code']===0x1f4){logger[_0x6e30('0x15')]('MailTransferReport,\x20%s,\x20%s',_0x5e81e7,_0x246487['error']['message']);return _0x2d67c4(_0x246487[_0x6e30('0x15')][_0x6e30('0x16')]);}logger[_0x6e30('0x15')](_0x6e30('0x10'),_0x5e81e7,_0x246487[_0x6e30('0x15')]['message']);return _0x98c630(_0x246487[_0x6e30('0x15')]['message']);}else{logger[_0x6e30('0xf')](_0x6e30('0x10'),_0x5e81e7,_0x6e30('0x11'));_0x98c630(_0x246487[_0x6e30('0x17')][_0x6e30('0x16')]);}})['catch'](function(_0x1e44ef){logger[_0x6e30('0x15')](_0x6e30('0x10'),_0x5e81e7,_0x1e44ef);_0x2d67c4(_0x1e44ef);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a390f9f..9ea0b4e 100644 --- a/server/api/memberReport/index.js +++ b/server/api/memberReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdad0=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','describe','show','post','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x4b935a,_0x327ee3){var _0xa298f0=function(_0x3e07c2){while(--_0x3e07c2){_0x4b935a['push'](_0x4b935a['shift']());}};_0xa298f0(++_0x327ee3);}(_0xdad0,0xd9));var _0x0dad=function(_0x22e169,_0x386042){_0x22e169=_0x22e169-0x0;var _0x594a5d=_0xdad0[_0x22e169];return _0x594a5d;};'use strict';var multer=require(_0x0dad('0x0'));var util=require(_0x0dad('0x1'));var path=require('path');var timeout=require(_0x0dad('0x2'));var express=require(_0x0dad('0x3'));var router=express[_0x0dad('0x4')]();var auth=require(_0x0dad('0x5'));var interaction=require(_0x0dad('0x6'));var config=require(_0x0dad('0x7'));var controller=require(_0x0dad('0x8'));router['get']('/',auth[_0x0dad('0x9')](),controller[_0x0dad('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0dad('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0dad('0xc')]);router[_0x0dad('0xd')]('/',auth['isAuthenticated'](),controller[_0x0dad('0xe')]);router['put']('/:id',auth[_0x0dad('0x9')](),controller[_0x0dad('0xf')]);router[_0x0dad('0x10')](_0x0dad('0x11'),auth[_0x0dad('0x9')](),controller[_0x0dad('0x12')]);module[_0x0dad('0x13')]=router; \ No newline at end of file +var _0x7ab7=['index','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x788fe4,_0xd284bf){var _0x39e3e9=function(_0x23da0c){while(--_0x23da0c){_0x788fe4['push'](_0x788fe4['shift']());}};_0x39e3e9(++_0xd284bf);}(_0x7ab7,0x9d));var _0x77ab=function(_0xb7322b,_0x213722){_0xb7322b=_0xb7322b-0x0;var _0x359c73=_0x7ab7[_0xb7322b];return _0x359c73;};'use strict';var multer=require(_0x77ab('0x0'));var util=require(_0x77ab('0x1'));var path=require(_0x77ab('0x2'));var timeout=require(_0x77ab('0x3'));var express=require(_0x77ab('0x4'));var router=express[_0x77ab('0x5')]();var auth=require(_0x77ab('0x6'));var interaction=require(_0x77ab('0x7'));var config=require(_0x77ab('0x8'));var controller=require('./memberReport.controller');router[_0x77ab('0x9')]('/',auth[_0x77ab('0xa')](),controller[_0x77ab('0xb')]);router[_0x77ab('0x9')]('/describe',auth[_0x77ab('0xa')](),controller[_0x77ab('0xc')]);router[_0x77ab('0x9')](_0x77ab('0xd'),auth['isAuthenticated'](),controller[_0x77ab('0xe')]);router[_0x77ab('0xf')]('/',auth['isAuthenticated'](),controller[_0x77ab('0x10')]);router['put'](_0x77ab('0xd'),auth[_0x77ab('0xa')](),controller[_0x77ab('0x11')]);router[_0x77ab('0x12')]('/:id',auth[_0x77ab('0xa')](),controller[_0x77ab('0x13')]);module[_0x77ab('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e68f873..23e5c4c 100644 --- a/server/api/memberReport/memberReport.attributes.js +++ b/server/api/memberReport/memberReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15eb=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]'];(function(_0x232372,_0x18e2cb){var _0x4ff2a5=function(_0x49263b){while(--_0x49263b){_0x232372['push'](_0x232372['shift']());}};_0x4ff2a5(++_0x18e2cb);}(_0x15eb,0xf0));var _0xb15e=function(_0x4c231a,_0x614b93){_0x4c231a=_0x4c231a-0x0;var _0x531ff7=_0x15eb[_0x4c231a];return _0x531ff7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb15e('0x0'));module[_0xb15e('0x1')]={'channel':{'type':Sequelize[_0xb15e('0x2')]},'membername':{'type':Sequelize[_0xb15e('0x2')]},'interface':{'type':Sequelize[_0xb15e('0x2')]},'type':{'type':Sequelize[_0xb15e('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xb15e('0x3')},'duration':{'type':Sequelize[_0xb15e('0x4')]},'enterAt':{'type':Sequelize[_0xb15e('0x5')]},'exitAt':{'type':Sequelize[_0xb15e('0x5')],'set':function(_0x52792e){var _0xa4fd58=moment(_0x52792e);var _0x40a540=moment(this[_0xb15e('0x6')](_0xb15e('0x7')));var _0x54d8d5=_0xa4fd58[_0xb15e('0x8')](_0x40a540,'seconds');this[_0xb15e('0x9')](_0xb15e('0xa'),_0x52792e);this[_0xb15e('0x9')](_0xb15e('0xb'),_0x54d8d5||null);}},'data1':{'type':Sequelize[_0xb15e('0x2')],'comment':_0xb15e('0xc')},'data2':{'type':Sequelize[_0xb15e('0x2')],'comment':_0xb15e('0xd')},'data3':{'type':Sequelize[_0xb15e('0x2')],'comment':_0xb15e('0xe')},'data4':{'type':Sequelize[_0xb15e('0x2')],'comment':_0xb15e('0xf')},'data5':{'type':Sequelize[_0xb15e('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xb15e('0x2')]},'internal':{'type':Sequelize[_0xb15e('0x4')]},'uniqueid':{'type':Sequelize[_0xb15e('0x2')]}}; \ No newline at end of file +var _0x8382=['DATE','enterAt','diff','seconds','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x8382,0xca));var _0x2838=function(_0x967f27,_0x35c5de){_0x967f27=_0x967f27-0x0;var _0x435e43=_0x8382[_0x967f27];return _0x435e43;};'use strict';var Sequelize=require(_0x2838('0x0'));var moment=require('moment');module[_0x2838('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2838('0x2')]},'interface':{'type':Sequelize[_0x2838('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x2838('0x3'),'comment':_0x2838('0x4')},'duration':{'type':Sequelize[_0x2838('0x5')]},'enterAt':{'type':Sequelize[_0x2838('0x6')]},'exitAt':{'type':Sequelize[_0x2838('0x6')],'set':function(_0x4f377c){var _0x4b83c2=moment(_0x4f377c);var _0x345ae1=moment(this['getDataValue'](_0x2838('0x7')));var _0x18c344=_0x4b83c2[_0x2838('0x8')](_0x345ae1,_0x2838('0x9'));this['setDataValue'](_0x2838('0xa'),_0x4f377c);this['setDataValue'](_0x2838('0xb'),_0x18c344||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x2838('0xc')},'data2':{'type':Sequelize[_0x2838('0x2')],'comment':_0x2838('0xd')},'data3':{'type':Sequelize[_0x2838('0x2')],'comment':_0x2838('0xe')},'data4':{'type':Sequelize[_0x2838('0x2')],'comment':_0x2838('0xf')},'data5':{'type':Sequelize[_0x2838('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x2838('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2838('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 7e3ad3c..a489ada 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cec=['body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','merge','where','type','MemberReport','includeAll','include','rows','rawAttributes','options','find','catch','create'];(function(_0x2d7229,_0x8a4dc9){var _0x37d1a9=function(_0x26bfc0){while(--_0x26bfc0){_0x2d7229['push'](_0x2d7229['shift']());}};_0x37d1a9(++_0x8a4dc9);}(_0x4cec,0x97));var _0xc4ce=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x4cec[_0x12fc8d];return _0x3f9d04;};'use strict';var pdf=require(_0xc4ce('0x0'));var emlformat=require(_0xc4ce('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc4ce('0x2'));var jsonpatch=require(_0xc4ce('0x3'));var rp=require(_0xc4ce('0x4'));var moment=require(_0xc4ce('0x5'));var BPromise=require(_0xc4ce('0x6'));var Mustache=require(_0xc4ce('0x7'));var util=require(_0xc4ce('0x8'));var path=require(_0xc4ce('0x9'));var sox=require(_0xc4ce('0xa'));var csv=require('to-csv');var ejs=require(_0xc4ce('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4ce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc4ce('0xd'));var toCsv=require(_0xc4ce('0xe'));var querystring=require('querystring');var Papa=require(_0xc4ce('0xf'));var Redis=require('ioredis');var authService=require(_0xc4ce('0x10'));var qs=require(_0xc4ce('0x11'));var as=require(_0xc4ce('0x12'));var hardwareService=require(_0xc4ce('0x13'));var logger=require(_0xc4ce('0x14'))(_0xc4ce('0x15'));var utils=require(_0xc4ce('0x16'));var config=require(_0xc4ce('0x17'));var db=require(_0xc4ce('0x18'))['db'];function respondWithStatusCode(_0x522366,_0x25b5f8){_0x25b5f8=_0x25b5f8||0xcc;return function(_0x453253){if(_0x453253){return _0x522366[_0xc4ce('0x19')](_0x25b5f8);}return _0x522366[_0xc4ce('0x1a')](_0x25b5f8)[_0xc4ce('0x1b')]();};}function respondWithResult(_0x341f7d,_0x1269ee){_0x1269ee=_0x1269ee||0xc8;return function(_0x1701c2){if(_0x1701c2){return _0x341f7d[_0xc4ce('0x1a')](_0x1269ee)[_0xc4ce('0x1c')](_0x1701c2);}};}function respondWithFilteredResult(_0xa5c24b,_0x95aeb2){return function(_0x4cda92){if(_0x4cda92){var _0xa82c2a=_0x4cda92[_0xc4ce('0x1d')],_0x59a6b0=_0x95aeb2[_0xc4ce('0x1e')],_0xf01415=_0x95aeb2[_0xc4ce('0x1e')]+_0x95aeb2[_0xc4ce('0x1f')],_0x12b3f6;if(_0xf01415>=_0xa82c2a){_0xf01415=_0xa82c2a;_0x12b3f6=0xc8;}else{_0x12b3f6=0xce;}_0xa5c24b[_0xc4ce('0x1a')](_0x12b3f6);return _0xa5c24b[_0xc4ce('0x20')](_0xc4ce('0x21'),_0x59a6b0+'-'+_0xf01415+'/'+_0xa82c2a)[_0xc4ce('0x1c')](_0x4cda92);}return null;};}function patchUpdates(_0x2ed31d){return function(_0x5b3e0e){try{jsonpatch[_0xc4ce('0x22')](_0x5b3e0e,_0x2ed31d,!![]);}catch(_0xe7c5be){return BPromise[_0xc4ce('0x23')](_0xe7c5be);}return _0x5b3e0e[_0xc4ce('0x24')]();};}function saveUpdates(_0x165fc0,_0x1cb419){return function(_0x3b1349){if(_0x3b1349){return _0x3b1349[_0xc4ce('0x25')](_0x165fc0)['then'](function(_0x37bb07){return _0x37bb07;});}return null;};}function removeEntity(_0x59b768,_0x64e668){return function(_0x376a6d){if(_0x376a6d){return _0x376a6d[_0xc4ce('0x26')]()[_0xc4ce('0x27')](function(){_0x59b768[_0xc4ce('0x1a')](0xcc)[_0xc4ce('0x1b')]();});}};}function handleEntityNotFound(_0x2cca63,_0x344760){return function(_0x336123){if(!_0x336123){_0x2cca63[_0xc4ce('0x19')](0x194);}return _0x336123;};}function handleError(_0x1b6369,_0x5b7d6a){_0x5b7d6a=_0x5b7d6a||0x1f4;return function(_0x42c33d){logger[_0xc4ce('0x28')](_0x42c33d[_0xc4ce('0x29')]);if(_0x42c33d[_0xc4ce('0x2a')]){delete _0x42c33d['name'];}_0x1b6369[_0xc4ce('0x1a')](_0x5b7d6a)[_0xc4ce('0x2b')](_0x42c33d);};}exports['index']=function(_0x420793,_0x63ebd0){var _0x969077={},_0x4d1f11={},_0x1afc7d={'count':0x0,'rows':[]};var _0x3e9c30=_[_0xc4ce('0x2c')](db['MemberReport']['rawAttributes'],function(_0x9d40ec){return{'name':_0x9d40ec[_0xc4ce('0x2d')],'type':_0x9d40ec['type'][_0xc4ce('0x2e')]};});_0x4d1f11[_0xc4ce('0x2f')]=_[_0xc4ce('0x2c')](_0x3e9c30,_0xc4ce('0x2a'));_0x4d1f11[_0xc4ce('0x30')]=_[_0xc4ce('0x31')](_0x420793[_0xc4ce('0x30')]);_0x4d1f11[_0xc4ce('0x32')]=_[_0xc4ce('0x33')](_0x4d1f11[_0xc4ce('0x2f')],_0x4d1f11[_0xc4ce('0x30')]);_0x969077['attributes']=_['intersection'](_0x4d1f11['model'],qs[_0xc4ce('0x34')](_0x420793['query'][_0xc4ce('0x34')]));_0x969077[_0xc4ce('0x35')]=_0x969077[_0xc4ce('0x35')][_0xc4ce('0x36')]?_0x969077[_0xc4ce('0x35')]:_0x4d1f11[_0xc4ce('0x2f')];if(!_0x420793[_0xc4ce('0x30')][_0xc4ce('0x37')](_0xc4ce('0x38'))){_0x969077['limit']=qs[_0xc4ce('0x1f')](_0x420793[_0xc4ce('0x30')]['limit']);_0x969077[_0xc4ce('0x1e')]=qs['offset'](_0x420793[_0xc4ce('0x30')][_0xc4ce('0x1e')]);}_0x969077[_0xc4ce('0x39')]=qs[_0xc4ce('0x3a')](_0x420793[_0xc4ce('0x30')][_0xc4ce('0x3a')]);_0x969077['where']=qs['filters'](_['pick'](_0x420793[_0xc4ce('0x30')],_0x4d1f11[_0xc4ce('0x32')]));if(_0x420793['query']['filter']){_0x969077['where']=_[_0xc4ce('0x3b')](_0x969077[_0xc4ce('0x3c')],{'$or':_[_0xc4ce('0x2c')](_0x3e9c30,function(_0x136324){if(_0x136324[_0xc4ce('0x3d')]!=='VIRTUAL'){var _0x3c9195={};_0x3c9195[_0x136324[_0xc4ce('0x2a')]]={'$like':'%'+_0x420793[_0xc4ce('0x30')]['filter']+'%'};return _0x3c9195;}})});}_0x969077=_[_0xc4ce('0x3b')]({},_0x969077,_0x420793['options']);var _0x2e5317={'where':_0x969077[_0xc4ce('0x3c')]};return db[_0xc4ce('0x3e')][_0xc4ce('0x1d')](_0x2e5317)[_0xc4ce('0x27')](function(_0x403b61){_0x1afc7d[_0xc4ce('0x1d')]=_0x403b61;if(_0x420793['query'][_0xc4ce('0x3f')]){_0x969077[_0xc4ce('0x40')]=[{'all':!![]}];}return db['MemberReport']['findAll'](_0x969077);})[_0xc4ce('0x27')](function(_0xbfab01){_0x1afc7d[_0xc4ce('0x41')]=_0xbfab01;return _0x1afc7d;})[_0xc4ce('0x27')](respondWithFilteredResult(_0x63ebd0,_0x969077))['catch'](handleError(_0x63ebd0,null));};exports['show']=function(_0x58f0ba,_0x28faba){var _0x56612c={'raw':!![],'where':{'id':_0x58f0ba['params']['id']}},_0x73cac9={};_0x73cac9[_0xc4ce('0x2f')]=_['keys'](db[_0xc4ce('0x3e')][_0xc4ce('0x42')]);_0x73cac9[_0xc4ce('0x30')]=_[_0xc4ce('0x31')](_0x58f0ba[_0xc4ce('0x30')]);_0x73cac9['filters']=_['intersection'](_0x73cac9[_0xc4ce('0x2f')],_0x73cac9[_0xc4ce('0x30')]);_0x56612c['attributes']=_[_0xc4ce('0x33')](_0x73cac9[_0xc4ce('0x2f')],qs['fields'](_0x58f0ba['query'][_0xc4ce('0x34')]));_0x56612c[_0xc4ce('0x35')]=_0x56612c[_0xc4ce('0x35')][_0xc4ce('0x36')]?_0x56612c[_0xc4ce('0x35')]:_0x73cac9[_0xc4ce('0x2f')];if(_0x58f0ba[_0xc4ce('0x30')][_0xc4ce('0x3f')]){_0x56612c[_0xc4ce('0x40')]=[{'all':!![]}];}_0x56612c=_[_0xc4ce('0x3b')]({},_0x56612c,_0x58f0ba[_0xc4ce('0x43')]);return db[_0xc4ce('0x3e')][_0xc4ce('0x44')](_0x56612c)[_0xc4ce('0x27')](handleEntityNotFound(_0x28faba,null))['then'](respondWithResult(_0x28faba,null))[_0xc4ce('0x45')](handleError(_0x28faba,null));};exports[_0xc4ce('0x46')]=function(_0x5eaf91,_0x1d86a3){return db[_0xc4ce('0x3e')][_0xc4ce('0x46')](_0x5eaf91[_0xc4ce('0x47')],{})['then'](respondWithResult(_0x1d86a3,0xc9))['catch'](handleError(_0x1d86a3,null));};exports[_0xc4ce('0x25')]=function(_0x50c621,_0x8d2a13){if(_0x50c621[_0xc4ce('0x47')]['id']){delete _0x50c621['body']['id'];}return db['MemberReport'][_0xc4ce('0x44')]({'where':{'id':_0x50c621['params']['id']}})[_0xc4ce('0x27')](handleEntityNotFound(_0x8d2a13,null))[_0xc4ce('0x27')](saveUpdates(_0x50c621['body'],null))[_0xc4ce('0x27')](respondWithResult(_0x8d2a13,null))[_0xc4ce('0x45')](handleError(_0x8d2a13,null));};exports[_0xc4ce('0x26')]=function(_0x5d01c0,_0x37729a){return db[_0xc4ce('0x3e')][_0xc4ce('0x44')]({'where':{'id':_0x5d01c0[_0xc4ce('0x48')]['id']}})['then'](handleEntityNotFound(_0x37729a,null))['then'](removeEntity(_0x37729a,null))[_0xc4ce('0x45')](handleError(_0x37729a,null));};exports[_0xc4ce('0x49')]=function(_0x1b4d5f,_0x2c55af){return db[_0xc4ce('0x3e')][_0xc4ce('0x49')]()[_0xc4ce('0x27')](respondWithResult(_0x2c55af,null))[_0xc4ce('0x45')](handleError(_0x2c55af,null));}; \ No newline at end of file +var _0x20d9=['fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','options','MemberReport','include','findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','attributes','intersection'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x20d9,0xa5));var _0x920d=function(_0x45547f,_0x2e4492){_0x45547f=_0x45547f-0x0;var _0x2356f2=_0x20d9[_0x45547f];return _0x2356f2;};'use strict';var pdf=require(_0x920d('0x0'));var emlformat=require(_0x920d('0x1'));var rimraf=require(_0x920d('0x2'));var zipdir=require(_0x920d('0x3'));var jsonpatch=require(_0x920d('0x4'));var rp=require(_0x920d('0x5'));var moment=require(_0x920d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x920d('0x7'));var util=require(_0x920d('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x920d('0x9'));var squel=require(_0x920d('0xa'));var crypto=require(_0x920d('0xb'));var jsforce=require(_0x920d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x920d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x920d('0xe'));var qs=require(_0x920d('0xf'));var as=require(_0x920d('0x10'));var hardwareService=require(_0x920d('0x11'));var logger=require(_0x920d('0x12'))(_0x920d('0x13'));var utils=require(_0x920d('0x14'));var config=require(_0x920d('0x15'));var db=require(_0x920d('0x16'))['db'];function respondWithStatusCode(_0x100852,_0x54cac4){_0x54cac4=_0x54cac4||0xcc;return function(_0x39f318){if(_0x39f318){return _0x100852[_0x920d('0x17')](_0x54cac4);}return _0x100852[_0x920d('0x18')](_0x54cac4)[_0x920d('0x19')]();};}function respondWithResult(_0xa58877,_0x229fcd){_0x229fcd=_0x229fcd||0xc8;return function(_0x5a32d9){if(_0x5a32d9){return _0xa58877[_0x920d('0x18')](_0x229fcd)[_0x920d('0x1a')](_0x5a32d9);}};}function respondWithFilteredResult(_0x292c4c,_0x4907fa){return function(_0x34564f){if(_0x34564f){var _0x4ddd7e=_0x34564f[_0x920d('0x1b')],_0x37c84c=_0x4907fa[_0x920d('0x1c')],_0x3b64d7=_0x4907fa[_0x920d('0x1c')]+_0x4907fa[_0x920d('0x1d')],_0x3cfc59;if(_0x3b64d7>=_0x4ddd7e){_0x3b64d7=_0x4ddd7e;_0x3cfc59=0xc8;}else{_0x3cfc59=0xce;}_0x292c4c[_0x920d('0x18')](_0x3cfc59);return _0x292c4c[_0x920d('0x1e')](_0x920d('0x1f'),_0x37c84c+'-'+_0x3b64d7+'/'+_0x4ddd7e)['json'](_0x34564f);}return null;};}function patchUpdates(_0x5518bf){return function(_0x1830ce){try{jsonpatch[_0x920d('0x20')](_0x1830ce,_0x5518bf,!![]);}catch(_0x4ec8db){return BPromise['reject'](_0x4ec8db);}return _0x1830ce[_0x920d('0x21')]();};}function saveUpdates(_0x4bc15c,_0x11851b){return function(_0x142c80){if(_0x142c80){return _0x142c80[_0x920d('0x22')](_0x4bc15c)[_0x920d('0x23')](function(_0x930abb){return _0x930abb;});}return null;};}function removeEntity(_0x2ba96c,_0x83de99){return function(_0x2d23e0){if(_0x2d23e0){return _0x2d23e0[_0x920d('0x24')]()[_0x920d('0x23')](function(){_0x2ba96c[_0x920d('0x18')](0xcc)[_0x920d('0x19')]();});}};}function handleEntityNotFound(_0x28e655,_0x288dd9){return function(_0x3d0e26){if(!_0x3d0e26){_0x28e655[_0x920d('0x17')](0x194);}return _0x3d0e26;};}function handleError(_0x337e7b,_0x47c7ee){_0x47c7ee=_0x47c7ee||0x1f4;return function(_0x2ab4f1){logger[_0x920d('0x25')](_0x2ab4f1[_0x920d('0x26')]);if(_0x2ab4f1['name']){delete _0x2ab4f1[_0x920d('0x27')];}_0x337e7b[_0x920d('0x18')](_0x47c7ee)[_0x920d('0x28')](_0x2ab4f1);};}exports[_0x920d('0x29')]=function(_0x53c868,_0x1da3e9){var _0x47afdd={},_0xd5e0d2={},_0x269c42={'count':0x0,'rows':[]};var _0x19ea02=_[_0x920d('0x2a')](db['MemberReport'][_0x920d('0x2b')],function(_0x318fd1){return{'name':_0x318fd1['fieldName'],'type':_0x318fd1[_0x920d('0x2c')][_0x920d('0x2d')]};});_0xd5e0d2[_0x920d('0x2e')]=_[_0x920d('0x2a')](_0x19ea02,_0x920d('0x27'));_0xd5e0d2[_0x920d('0x2f')]=_[_0x920d('0x30')](_0x53c868[_0x920d('0x2f')]);_0xd5e0d2['filters']=_['intersection'](_0xd5e0d2[_0x920d('0x2e')],_0xd5e0d2[_0x920d('0x2f')]);_0x47afdd[_0x920d('0x31')]=_[_0x920d('0x32')](_0xd5e0d2[_0x920d('0x2e')],qs[_0x920d('0x33')](_0x53c868[_0x920d('0x2f')][_0x920d('0x33')]));_0x47afdd[_0x920d('0x31')]=_0x47afdd[_0x920d('0x31')][_0x920d('0x34')]?_0x47afdd[_0x920d('0x31')]:_0xd5e0d2[_0x920d('0x2e')];if(!_0x53c868[_0x920d('0x2f')][_0x920d('0x35')](_0x920d('0x36'))){_0x47afdd[_0x920d('0x1d')]=qs['limit'](_0x53c868[_0x920d('0x2f')][_0x920d('0x1d')]);_0x47afdd[_0x920d('0x1c')]=qs[_0x920d('0x1c')](_0x53c868[_0x920d('0x2f')][_0x920d('0x1c')]);}_0x47afdd[_0x920d('0x37')]=qs['sort'](_0x53c868[_0x920d('0x2f')]['sort']);_0x47afdd[_0x920d('0x38')]=qs[_0x920d('0x39')](_[_0x920d('0x3a')](_0x53c868[_0x920d('0x2f')],_0xd5e0d2[_0x920d('0x39')]));if(_0x53c868[_0x920d('0x2f')]['filter']){_0x47afdd['where']=_[_0x920d('0x3b')](_0x47afdd[_0x920d('0x38')],{'$or':_[_0x920d('0x2a')](_0x19ea02,function(_0x3420af){if(_0x3420af[_0x920d('0x2c')]!==_0x920d('0x3c')){var _0xe331ab={};_0xe331ab[_0x3420af[_0x920d('0x27')]]={'$like':'%'+_0x53c868[_0x920d('0x2f')]['filter']+'%'};return _0xe331ab;}})});}_0x47afdd=_['merge']({},_0x47afdd,_0x53c868[_0x920d('0x3d')]);var _0x237648={'where':_0x47afdd['where']};return db[_0x920d('0x3e')][_0x920d('0x1b')](_0x237648)[_0x920d('0x23')](function(_0x53b4a0){_0x269c42[_0x920d('0x1b')]=_0x53b4a0;if(_0x53c868['query']['includeAll']){_0x47afdd[_0x920d('0x3f')]=[{'all':!![]}];}return db['MemberReport'][_0x920d('0x40')](_0x47afdd);})[_0x920d('0x23')](function(_0x4e6184){_0x269c42[_0x920d('0x41')]=_0x4e6184;return _0x269c42;})[_0x920d('0x23')](respondWithFilteredResult(_0x1da3e9,_0x47afdd))[_0x920d('0x42')](handleError(_0x1da3e9,null));};exports['show']=function(_0x47025a,_0x36eac2){var _0x4c5c86={'raw':!![],'where':{'id':_0x47025a[_0x920d('0x43')]['id']}},_0x416c1d={};_0x416c1d['model']=_[_0x920d('0x30')](db[_0x920d('0x3e')][_0x920d('0x2b')]);_0x416c1d[_0x920d('0x2f')]=_[_0x920d('0x30')](_0x47025a['query']);_0x416c1d[_0x920d('0x39')]=_[_0x920d('0x32')](_0x416c1d[_0x920d('0x2e')],_0x416c1d['query']);_0x4c5c86[_0x920d('0x31')]=_[_0x920d('0x32')](_0x416c1d['model'],qs[_0x920d('0x33')](_0x47025a[_0x920d('0x2f')][_0x920d('0x33')]));_0x4c5c86[_0x920d('0x31')]=_0x4c5c86[_0x920d('0x31')][_0x920d('0x34')]?_0x4c5c86[_0x920d('0x31')]:_0x416c1d['model'];if(_0x47025a[_0x920d('0x2f')]['includeAll']){_0x4c5c86[_0x920d('0x3f')]=[{'all':!![]}];}_0x4c5c86=_[_0x920d('0x3b')]({},_0x4c5c86,_0x47025a['options']);return db[_0x920d('0x3e')][_0x920d('0x44')](_0x4c5c86)[_0x920d('0x23')](handleEntityNotFound(_0x36eac2,null))[_0x920d('0x23')](respondWithResult(_0x36eac2,null))[_0x920d('0x42')](handleError(_0x36eac2,null));};exports[_0x920d('0x45')]=function(_0x58f025,_0xf0cddf){return db[_0x920d('0x3e')][_0x920d('0x45')](_0x58f025['body'],{})[_0x920d('0x23')](respondWithResult(_0xf0cddf,0xc9))['catch'](handleError(_0xf0cddf,null));};exports[_0x920d('0x22')]=function(_0x28da35,_0x2c1318){if(_0x28da35[_0x920d('0x46')]['id']){delete _0x28da35['body']['id'];}return db[_0x920d('0x3e')][_0x920d('0x44')]({'where':{'id':_0x28da35[_0x920d('0x43')]['id']}})[_0x920d('0x23')](handleEntityNotFound(_0x2c1318,null))['then'](saveUpdates(_0x28da35[_0x920d('0x46')],null))[_0x920d('0x23')](respondWithResult(_0x2c1318,null))[_0x920d('0x42')](handleError(_0x2c1318,null));};exports[_0x920d('0x24')]=function(_0xc3b19e,_0x33b48e){return db[_0x920d('0x3e')][_0x920d('0x44')]({'where':{'id':_0xc3b19e[_0x920d('0x43')]['id']}})[_0x920d('0x23')](handleEntityNotFound(_0x33b48e,null))[_0x920d('0x23')](removeEntity(_0x33b48e,null))[_0x920d('0x42')](handleError(_0x33b48e,null));};exports[_0x920d('0x47')]=function(_0x185937,_0x2691c0){return db[_0x920d('0x3e')]['describe']()[_0x920d('0x23')](respondWithResult(_0x2691c0,null))[_0x920d('0x42')](handleError(_0x2691c0,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 72e7ca6..689d8ed 100644 --- a/server/api/memberReport/memberReport.model.js +++ b/server/api/memberReport/memberReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd033=['./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xf001f4,_0x45ccc1){var _0x5156fe=function(_0x17a3ee){while(--_0x17a3ee){_0xf001f4['push'](_0xf001f4['shift']());}};_0x5156fe(++_0x45ccc1);}(_0xd033,0x78));var _0x3d03=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xd033[_0x571c1d];return _0x33c609;};'use strict';var _=require('lodash');var util=require(_0x3d03('0x0'));var logger=require('../../config/logger')(_0x3d03('0x1'));var moment=require(_0x3d03('0x2'));var BPromise=require(_0x3d03('0x3'));var rp=require(_0x3d03('0x4'));var fs=require('fs');var path=require(_0x3d03('0x5'));var rimraf=require(_0x3d03('0x6'));var config=require(_0x3d03('0x7'));var attributes=require(_0x3d03('0x8'));module[_0x3d03('0x9')]=function(_0x1c7695,_0x1605ca){return _0x1c7695[_0x3d03('0xa')](_0x3d03('0xb'),attributes,{'tableName':_0x3d03('0xc'),'paranoid':![],'indexes':[{'name':_0x3d03('0xd'),'fields':[_0x3d03('0xe'),_0x3d03('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd302=['path','rimraf','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xd302,0x12f));var _0x2d30=function(_0x3f5ffb,_0x2b7965){_0x3f5ffb=_0x3f5ffb-0x0;var _0x4b9897=_0xd302[_0x3f5ffb];return _0x4b9897;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2d30('0x0'))(_0x2d30('0x1'));var moment=require(_0x2d30('0x2'));var BPromise=require(_0x2d30('0x3'));var rp=require(_0x2d30('0x4'));var fs=require('fs');var path=require(_0x2d30('0x5'));var rimraf=require(_0x2d30('0x6'));var config=require('../../config/environment');var attributes=require(_0x2d30('0x7'));module[_0x2d30('0x8')]=function(_0x413898,_0x3f3fcc){return _0x413898[_0x2d30('0x9')](_0x2d30('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x2d30('0xb'),'fields':[_0x2d30('0xc'),_0x2d30('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index e090698..c784fd7 100644 --- a/server/api/memberReport/memberReport.rpc.js +++ b/server/api/memberReport/memberReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8845=['debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MemberReport','findAll','options','raw','where','attributes','include','map','model','then','GetMemberReport','CreateMemberReport','create','body','UpdateMemberReport','update','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x8845,0xbd));var _0x5884=function(_0x480290,_0x4974cf){_0x480290=_0x480290-0x0;var _0x18261c=_0x8845[_0x480290];return _0x18261c;};'use strict';var _=require(_0x5884('0x0'));var util=require(_0x5884('0x1'));var moment=require('moment');var BPromise=require(_0x5884('0x2'));var rs=require(_0x5884('0x3'));var fs=require('fs');var Redis=require(_0x5884('0x4'));var db=require(_0x5884('0x5'))['db'];var utils=require(_0x5884('0x6'));var logger=require(_0x5884('0x7'))(_0x5884('0x8'));var config=require(_0x5884('0x9'));var jayson=require(_0x5884('0xa'));var client=jayson['client'][_0x5884('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x116f87,_0x5ecff1,_0x4cfac5){return new BPromise(function(_0xa6221f,_0x473692){return client[_0x5884('0xc')](_0x116f87,_0x4cfac5)['then'](function(_0x37d860){logger[_0x5884('0xd')](_0x5884('0xe'),_0x5ecff1,_0x5884('0xf'));logger[_0x5884('0x10')](_0x5884('0x11'),_0x5ecff1,_0x5884('0xf'),JSON[_0x5884('0x12')](_0x37d860));if(_0x37d860[_0x5884('0x13')]){if(_0x37d860[_0x5884('0x13')][_0x5884('0x14')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x5ecff1,_0x37d860['error'][_0x5884('0x15')]);return _0x473692(_0x37d860['error'][_0x5884('0x15')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x5ecff1,_0x37d860['error'][_0x5884('0x15')]);return _0xa6221f(_0x37d860[_0x5884('0x13')][_0x5884('0x15')]);}else{logger[_0x5884('0xd')](_0x5884('0xe'),_0x5ecff1,_0x5884('0xf'));_0xa6221f(_0x37d860[_0x5884('0x16')][_0x5884('0x15')]);}})[_0x5884('0x17')](function(_0x3fdb86){logger[_0x5884('0x13')]('MemberReport,\x20%s,\x20%s',_0x5ecff1,_0x3fdb86);_0x473692(_0x3fdb86);});});}exports['GetMemberReport']=function(_0x4c5587){var _0x149552=this;return new Promise(function(_0x3c05b1,_0x1a050d){return db[_0x5884('0x18')][_0x5884('0x19')]({'raw':_0x4c5587[_0x5884('0x1a')]?_0x4c5587[_0x5884('0x1a')][_0x5884('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c5587['options']?_0x4c5587[_0x5884('0x1a')][_0x5884('0x1c')]||null:null,'attributes':_0x4c5587[_0x5884('0x1a')]?_0x4c5587[_0x5884('0x1a')][_0x5884('0x1d')]||null:null,'limit':_0x4c5587['options']?_0x4c5587['options']['limit']||null:null,'include':_0x4c5587['options']?_0x4c5587[_0x5884('0x1a')][_0x5884('0x1e')]?_[_0x5884('0x1f')](_0x4c5587[_0x5884('0x1a')][_0x5884('0x1e')],function(_0x2caa45){return{'model':db[_0x2caa45[_0x5884('0x20')]],'as':_0x2caa45['as'],'attributes':_0x2caa45[_0x5884('0x1d')],'include':_0x2caa45['include']?_[_0x5884('0x1f')](_0x2caa45[_0x5884('0x1e')],function(_0x43d11f){return{'model':db[_0x43d11f[_0x5884('0x20')]],'as':_0x43d11f['as'],'attributes':_0x43d11f['attributes'],'include':_0x43d11f['include']?_[_0x5884('0x1f')](_0x43d11f['include'],function(_0x9bc340){return{'model':db[_0x9bc340[_0x5884('0x20')]],'as':_0x9bc340['as'],'attributes':_0x9bc340[_0x5884('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5884('0x21')](function(_0x295914){logger[_0x5884('0xd')]('GetMemberReport',_0x4c5587);logger[_0x5884('0x10')](_0x5884('0x22'),_0x4c5587,JSON[_0x5884('0x12')](_0x295914));_0x3c05b1(_0x295914);})[_0x5884('0x17')](function(_0x4e0171){logger[_0x5884('0x13')](_0x5884('0x22'),_0x4e0171[_0x5884('0x15')],_0x4c5587);_0x1a050d(_0x149552['error'](0x1f4,_0x4e0171['message']));});});};exports[_0x5884('0x23')]=function(_0x2a5ecc){var _0x3df0cf=this;return new Promise(function(_0x315d75,_0x3f28b1){return db[_0x5884('0x18')][_0x5884('0x24')](_0x2a5ecc[_0x5884('0x25')],{'raw':_0x2a5ecc[_0x5884('0x1a')]?_0x2a5ecc[_0x5884('0x1a')][_0x5884('0x1b')]===undefined?!![]:![]:!![]})[_0x5884('0x21')](function(_0xe53aa1){logger[_0x5884('0xd')]('CreateMemberReport',_0x2a5ecc);logger[_0x5884('0x10')]('CreateMemberReport',_0x2a5ecc,JSON['stringify'](_0xe53aa1));_0x315d75(_0xe53aa1);})[_0x5884('0x17')](function(_0xb34753){logger[_0x5884('0x13')](_0x5884('0x23'),_0xb34753[_0x5884('0x15')],_0x2a5ecc);_0x3f28b1(_0x3df0cf['error'](0x1f4,_0xb34753[_0x5884('0x15')]));});});};exports[_0x5884('0x26')]=function(_0x17c9d9){var _0x2fcefc=this;return new Promise(function(_0x34a1e3,_0x5603da){return db[_0x5884('0x18')][_0x5884('0x27')](_0x17c9d9[_0x5884('0x25')],{'raw':_0x17c9d9[_0x5884('0x1a')]?_0x17c9d9[_0x5884('0x1a')][_0x5884('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17c9d9[_0x5884('0x1a')]?_0x17c9d9['options']['where']||null:null,'attributes':_0x17c9d9['options']?_0x17c9d9['options'][_0x5884('0x1d')]||null:null,'limit':_0x17c9d9['options']?_0x17c9d9[_0x5884('0x1a')][_0x5884('0x28')]||null:null})[_0x5884('0x21')](function(_0x2537d4){logger[_0x5884('0xd')]('UpdateMemberReport',_0x17c9d9);logger[_0x5884('0x10')](_0x5884('0x26'),_0x17c9d9,JSON['stringify'](_0x2537d4));_0x34a1e3(_0x2537d4);})['catch'](function(_0x25ad19){logger[_0x5884('0x13')](_0x5884('0x26'),_0x25ad19['message'],_0x17c9d9);_0x5603da(_0x2fcefc['error'](0x1f4,_0x25ad19[_0x5884('0x15')]));});});}; \ No newline at end of file +var _0x66d8=['http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetMemberReport','MemberReport','raw','options','where','attributes','limit','include','map','model','create','CreateMemberReport','UpdateMemberReport','update','body','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0xa2512a,_0x44699f){var _0x4f2e19=function(_0x3255cc){while(--_0x3255cc){_0xa2512a['push'](_0xa2512a['shift']());}};_0x4f2e19(++_0x44699f);}(_0x66d8,0x1a8));var _0x866d=function(_0x64a51,_0x1c61b7){_0x64a51=_0x64a51-0x0;var _0x1eba45=_0x66d8[_0x64a51];return _0x1eba45;};'use strict';var _=require('lodash');var util=require(_0x866d('0x0'));var moment=require(_0x866d('0x1'));var BPromise=require('bluebird');var rs=require(_0x866d('0x2'));var fs=require('fs');var Redis=require(_0x866d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x866d('0x4'));var logger=require(_0x866d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x866d('0x6'));var client=jayson[_0x866d('0x7')][_0x866d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2878dc,_0x13bedd,_0x4f70af){return new BPromise(function(_0x355020,_0x67d353){return client['request'](_0x2878dc,_0x4f70af)[_0x866d('0x9')](function(_0xf0b014){logger[_0x866d('0xa')](_0x866d('0xb'),_0x13bedd,_0x866d('0xc'));logger[_0x866d('0xd')](_0x866d('0xe'),_0x13bedd,'request\x20sent',JSON[_0x866d('0xf')](_0xf0b014));if(_0xf0b014['error']){if(_0xf0b014['error'][_0x866d('0x10')]===0x1f4){logger[_0x866d('0x11')](_0x866d('0xb'),_0x13bedd,_0xf0b014[_0x866d('0x11')][_0x866d('0x12')]);return _0x67d353(_0xf0b014[_0x866d('0x11')]['message']);}logger[_0x866d('0x11')](_0x866d('0xb'),_0x13bedd,_0xf0b014[_0x866d('0x11')][_0x866d('0x12')]);return _0x355020(_0xf0b014[_0x866d('0x11')][_0x866d('0x12')]);}else{logger[_0x866d('0xa')]('MemberReport,\x20%s,\x20%s',_0x13bedd,_0x866d('0xc'));_0x355020(_0xf0b014[_0x866d('0x13')][_0x866d('0x12')]);}})[_0x866d('0x14')](function(_0xccc80b){logger[_0x866d('0x11')]('MemberReport,\x20%s,\x20%s',_0x13bedd,_0xccc80b);_0x67d353(_0xccc80b);});});}exports[_0x866d('0x15')]=function(_0x57cca0){var _0x2848fd=this;return new Promise(function(_0x277537,_0x142d67){return db[_0x866d('0x16')]['findAll']({'raw':_0x57cca0['options']?_0x57cca0['options'][_0x866d('0x17')]===undefined?!![]:![]:!![],'where':_0x57cca0[_0x866d('0x18')]?_0x57cca0[_0x866d('0x18')][_0x866d('0x19')]||null:null,'attributes':_0x57cca0[_0x866d('0x18')]?_0x57cca0[_0x866d('0x18')][_0x866d('0x1a')]||null:null,'limit':_0x57cca0[_0x866d('0x18')]?_0x57cca0[_0x866d('0x18')][_0x866d('0x1b')]||null:null,'include':_0x57cca0[_0x866d('0x18')]?_0x57cca0[_0x866d('0x18')][_0x866d('0x1c')]?_[_0x866d('0x1d')](_0x57cca0['options']['include'],function(_0x42276d){return{'model':db[_0x42276d[_0x866d('0x1e')]],'as':_0x42276d['as'],'attributes':_0x42276d[_0x866d('0x1a')],'include':_0x42276d[_0x866d('0x1c')]?_[_0x866d('0x1d')](_0x42276d[_0x866d('0x1c')],function(_0x1afeb2){return{'model':db[_0x1afeb2[_0x866d('0x1e')]],'as':_0x1afeb2['as'],'attributes':_0x1afeb2[_0x866d('0x1a')],'include':_0x1afeb2[_0x866d('0x1c')]?_[_0x866d('0x1d')](_0x1afeb2[_0x866d('0x1c')],function(_0x117b63){return{'model':db[_0x117b63[_0x866d('0x1e')]],'as':_0x117b63['as'],'attributes':_0x117b63[_0x866d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33c4e5){logger[_0x866d('0xa')]('GetMemberReport',_0x57cca0);logger['debug'](_0x866d('0x15'),_0x57cca0,JSON[_0x866d('0xf')](_0x33c4e5));_0x277537(_0x33c4e5);})[_0x866d('0x14')](function(_0x3c2d3a){logger[_0x866d('0x11')]('GetMemberReport',_0x3c2d3a['message'],_0x57cca0);_0x142d67(_0x2848fd['error'](0x1f4,_0x3c2d3a['message']));});});};exports['CreateMemberReport']=function(_0xec9c8b){var _0x4238bd=this;return new Promise(function(_0x2b69de,_0x22b16a){return db['MemberReport'][_0x866d('0x1f')](_0xec9c8b['body'],{'raw':_0xec9c8b[_0x866d('0x18')]?_0xec9c8b[_0x866d('0x18')][_0x866d('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x1a89ec){logger[_0x866d('0xa')](_0x866d('0x20'),_0xec9c8b);logger[_0x866d('0xd')](_0x866d('0x20'),_0xec9c8b,JSON[_0x866d('0xf')](_0x1a89ec));_0x2b69de(_0x1a89ec);})[_0x866d('0x14')](function(_0x338e86){logger[_0x866d('0x11')](_0x866d('0x20'),_0x338e86[_0x866d('0x12')],_0xec9c8b);_0x22b16a(_0x4238bd['error'](0x1f4,_0x338e86[_0x866d('0x12')]));});});};exports[_0x866d('0x21')]=function(_0x5e64ef){var _0x394de9=this;return new Promise(function(_0x4ef422,_0x3f14f5){return db[_0x866d('0x16')][_0x866d('0x22')](_0x5e64ef[_0x866d('0x23')],{'raw':_0x5e64ef[_0x866d('0x18')]?_0x5e64ef[_0x866d('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e64ef[_0x866d('0x18')]?_0x5e64ef[_0x866d('0x18')][_0x866d('0x19')]||null:null,'attributes':_0x5e64ef[_0x866d('0x18')]?_0x5e64ef[_0x866d('0x18')]['attributes']||null:null,'limit':_0x5e64ef['options']?_0x5e64ef[_0x866d('0x18')][_0x866d('0x1b')]||null:null})['then'](function(_0x18edb4){logger['info'](_0x866d('0x21'),_0x5e64ef);logger[_0x866d('0xd')]('UpdateMemberReport',_0x5e64ef,JSON[_0x866d('0xf')](_0x18edb4));_0x4ef422(_0x18edb4);})[_0x866d('0x14')](function(_0x21e42c){logger['error']('UpdateMemberReport',_0x21e42c[_0x866d('0x12')],_0x5e64ef);_0x3f14f5(_0x394de9['error'](0x1f4,_0x21e42c[_0x866d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index f5c877e..2cc7ecd 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5fa=['../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','exports','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x32ab87,_0x5803d0){_0x32ab87=_0x32ab87-0x0;var _0x5ae2b0=_0xa5fa[_0x32ab87];return _0x5ae2b0;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var auth=require(_0xaa5f('0x4'));var interaction=require(_0xaa5f('0x5'));var config=require('../../config/environment');var controller=require(_0xaa5f('0x6'));router[_0xaa5f('0x7')]('/',controller[_0xaa5f('0x8')]);module[_0xaa5f('0x9')]=router; \ No newline at end of file +var _0x80ed=['../../config/environment','./migration.controller','index','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2b3c36,_0x2692e1){var _0x1c1840=function(_0x559719){while(--_0x559719){_0x2b3c36['push'](_0x2b3c36['shift']());}};_0x1c1840(++_0x2692e1);}(_0x80ed,0x11c));var _0xd80e=function(_0x3b23a9,_0xefc80c){_0x3b23a9=_0x3b23a9-0x0;var _0x4469b6=_0x80ed[_0x3b23a9];return _0x4469b6;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var auth=require(_0xd80e('0x4'));var interaction=require(_0xd80e('0x5'));var config=require(_0xd80e('0x6'));var controller=require(_0xd80e('0x7'));router['get']('/',controller[_0xd80e('0x8')]);module[_0xd80e('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 1065dc5..5fad910 100644 --- a/server/api/migration/migration.attributes.js +++ b/server/api/migration/migration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47fd=['STRING','sequelize','exports'];(function(_0x384691,_0x1f4e03){var _0x28b395=function(_0x541706){while(--_0x541706){_0x384691['push'](_0x384691['shift']());}};_0x28b395(++_0x1f4e03);}(_0x47fd,0x142));var _0xd47f=function(_0x389b98,_0x58b439){_0x389b98=_0x389b98-0x0;var _0x65b7c6=_0x47fd[_0x389b98];return _0x65b7c6;};'use strict';var Sequelize=require(_0xd47f('0x0'));module[_0xd47f('0x1')]={'version':{'type':Sequelize[_0xd47f('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x4b1d=['exports','STRING','version','sequelize'];(function(_0x5983d6,_0x3f02bf){var _0x443a1f=function(_0x163fd3){while(--_0x163fd3){_0x5983d6['push'](_0x5983d6['shift']());}};_0x443a1f(++_0x3f02bf);}(_0x4b1d,0x1c3));var _0xd4b1=function(_0x1581a3,_0x264e2a){_0x1581a3=_0x1581a3-0x0;var _0x5b72e8=_0x4b1d[_0x1581a3];return _0x5b72e8;};'use strict';var Sequelize=require(_0xd4b1('0x0'));module[_0xd4b1('0x1')]={'version':{'type':Sequelize[_0xd4b1('0x2')],'unique':_0xd4b1('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index e7d7651..56612d4 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2b12da,_0xd14082){var _0x14bb51=function(_0x509989){while(--_0x509989){_0x2b12da['push'](_0x2b12da['shift']());}};_0x14bb51(++_0xd14082);}(_0x7a54,0x106));var _0x47a5=function(_0x4ec824,_0x1f1718){_0x4ec824=_0x4ec824-0x0;var _0x214e6b=_0x7a54[_0x4ec824];return _0x214e6b;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['Migration'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));}; \ No newline at end of file +var _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x3e3ccd,_0x6adc7c){var _0x4a2555=function(_0x151cf7){while(--_0x151cf7){_0x3e3ccd['push'](_0x3e3ccd['shift']());}};_0x4a2555(++_0x6adc7c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1403ff,_0x2315d3){_0x1403ff=_0x1403ff-0x0;var _0x54351f=_0x5f2f[_0x1403ff];return _0x54351f;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index c5e7236..c1aa4fa 100644 --- a/server/api/migration/migration.model.js +++ b/server/api/migration/migration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8eb3=['api','request-promise','path','rimraf','exports','define','lodash','util','../../config/logger'];(function(_0x503171,_0x5288f5){var _0x4446dd=function(_0x482820){while(--_0x482820){_0x503171['push'](_0x503171['shift']());}};_0x4446dd(++_0x5288f5);}(_0x8eb3,0x165));var _0x38eb=function(_0x2a5be5,_0x2abc6a){_0x2a5be5=_0x2a5be5-0x0;var _0x420249=_0x8eb3[_0x2a5be5];return _0x420249;};'use strict';var _=require(_0x38eb('0x0'));var util=require(_0x38eb('0x1'));var logger=require(_0x38eb('0x2'))(_0x38eb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x38eb('0x4'));var fs=require('fs');var path=require(_0x38eb('0x5'));var rimraf=require(_0x38eb('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x38eb('0x7')]=function(_0x43f3e0,_0x22673f){return _0x43f3e0[_0x38eb('0x8')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b7b=['rimraf','./migration.attributes','exports','Migration','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3b7b,0x18a));var _0xb3b7=function(_0x5f090f,_0x7b135e){_0x5f090f=_0x5f090f-0x0;var _0x2084f4=_0x3b7b[_0x5f090f];return _0x2084f4;};'use strict';var _=require('lodash');var util=require(_0xb3b7('0x0'));var logger=require(_0xb3b7('0x1'))(_0xb3b7('0x2'));var moment=require(_0xb3b7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb3b7('0x4'));var fs=require('fs');var path=require(_0xb3b7('0x5'));var rimraf=require(_0xb3b7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb3b7('0x7'));module[_0xb3b7('0x8')]=function(_0x518902,_0x513b8c){return _0x518902['define'](_0xb3b7('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 87ec428..6f14d77 100644 --- a/server/api/migration/migration.rpc.js +++ b/server/api/migration/migration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18b1=['then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0x18b1,0x9a));var _0x118b=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x18b1[_0x375492];return _0x18ba5b;};'use strict';var _=require(_0x118b('0x0'));var util=require(_0x118b('0x1'));var moment=require(_0x118b('0x2'));var BPromise=require(_0x118b('0x3'));var rs=require(_0x118b('0x4'));var fs=require('fs');var Redis=require(_0x118b('0x5'));var db=require(_0x118b('0x6'))['db'];var utils=require(_0x118b('0x7'));var logger=require(_0x118b('0x8'))(_0x118b('0x9'));var config=require(_0x118b('0xa'));var jayson=require(_0x118b('0xb'));var client=jayson['client'][_0x118b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b6bdf,_0x4f3330,_0xc60601){return new BPromise(function(_0x434e62,_0xb6b7e1){return client[_0x118b('0xd')](_0x1b6bdf,_0xc60601)[_0x118b('0xe')](function(_0x242e80){logger[_0x118b('0xf')](_0x118b('0x10'),_0x4f3330,_0x118b('0x11'));logger['debug'](_0x118b('0x12'),_0x4f3330,_0x118b('0x11'),JSON[_0x118b('0x13')](_0x242e80));if(_0x242e80['error']){if(_0x242e80['error']['code']===0x1f4){logger['error'](_0x118b('0x10'),_0x4f3330,_0x242e80[_0x118b('0x14')][_0x118b('0x15')]);return _0xb6b7e1(_0x242e80[_0x118b('0x14')]['message']);}logger[_0x118b('0x14')]('Migration,\x20%s,\x20%s',_0x4f3330,_0x242e80[_0x118b('0x14')][_0x118b('0x15')]);return _0x434e62(_0x242e80[_0x118b('0x14')][_0x118b('0x15')]);}else{logger[_0x118b('0xf')]('Migration,\x20%s,\x20%s',_0x4f3330,'request\x20sent');_0x434e62(_0x242e80[_0x118b('0x16')][_0x118b('0x15')]);}})[_0x118b('0x17')](function(_0x368bd5){logger['error'](_0x118b('0x10'),_0x4f3330,_0x368bd5);_0xb6b7e1(_0x368bd5);});});} \ No newline at end of file +var _0xa92a=['../../config/utils','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0xa92a,0x1c7));var _0xaa92=function(_0x3ee1fe,_0x59f2a1){_0x3ee1fe=_0x3ee1fe-0x0;var _0x1ae57a=_0xa92a[_0x3ee1fe];return _0x1ae57a;};'use strict';var _=require(_0xaa92('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa92('0x1'));var rs=require(_0xaa92('0x2'));var fs=require('fs');var Redis=require(_0xaa92('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa92('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaa92('0x5')][_0xaa92('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2467c6,_0x199049,_0x2c6c03){return new BPromise(function(_0x2fa9df,_0x5a930e){return client[_0xaa92('0x7')](_0x2467c6,_0x2c6c03)[_0xaa92('0x8')](function(_0x308292){logger[_0xaa92('0x9')](_0xaa92('0xa'),_0x199049,_0xaa92('0xb'));logger['debug'](_0xaa92('0xc'),_0x199049,_0xaa92('0xb'),JSON['stringify'](_0x308292));if(_0x308292[_0xaa92('0xd')]){if(_0x308292[_0xaa92('0xd')][_0xaa92('0xe')]===0x1f4){logger[_0xaa92('0xd')]('Migration,\x20%s,\x20%s',_0x199049,_0x308292[_0xaa92('0xd')][_0xaa92('0xf')]);return _0x5a930e(_0x308292[_0xaa92('0xd')][_0xaa92('0xf')]);}logger[_0xaa92('0xd')](_0xaa92('0xa'),_0x199049,_0x308292['error'][_0xaa92('0xf')]);return _0x2fa9df(_0x308292[_0xaa92('0xd')][_0xaa92('0xf')]);}else{logger['info'](_0xaa92('0xa'),_0x199049,'request\x20sent');_0x2fa9df(_0x308292['result']['message']);}})[_0xaa92('0x10')](function(_0x34fc76){logger['error']('Migration,\x20%s,\x20%s',_0x199049,_0x34fc76);_0x5a930e(_0x34fc76);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index fdf0470..a51c5f1 100644 --- a/server/api/network/index.js +++ b/server/api/network/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c9c=['get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./network.controller'];(function(_0x45713f,_0x480973){var _0x1f0e03=function(_0x48da85){while(--_0x48da85){_0x45713f['push'](_0x45713f['shift']());}};_0x1f0e03(++_0x480973);}(_0x8c9c,0xf9));var _0xc8c9=function(_0xc4f906,_0x2076b0){_0xc4f906=_0xc4f906-0x0;var _0xed62b8=_0x8c9c[_0xc4f906];return _0xed62b8;};'use strict';var multer=require(_0xc8c9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc8c9('0x1'));var router=express[_0xc8c9('0x2')]();var auth=require(_0xc8c9('0x3'));var interaction=require(_0xc8c9('0x4'));var config=require('../../config/environment');var controller=require(_0xc8c9('0x5'));router[_0xc8c9('0x6')]('/',auth[_0xc8c9('0x7')](),controller['index']);router[_0xc8c9('0x6')](_0xc8c9('0x8'),auth[_0xc8c9('0x7')](),controller['show']);router[_0xc8c9('0x9')]('/',auth[_0xc8c9('0x7')](),controller[_0xc8c9('0xa')]);router[_0xc8c9('0xb')](_0xc8c9('0x8'),auth[_0xc8c9('0x7')](),controller[_0xc8c9('0xc')]);router[_0xc8c9('0xd')](_0xc8c9('0x8'),auth[_0xc8c9('0x7')](),controller['destroy']);module[_0xc8c9('0xe')]=router; \ No newline at end of file +var _0x45c6=['put','/:id','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','show','post','create'];(function(_0x1d3097,_0x180164){var _0x58dc67=function(_0x3292df){while(--_0x3292df){_0x1d3097['push'](_0x1d3097['shift']());}};_0x58dc67(++_0x180164);}(_0x45c6,0x74));var _0x645c=function(_0x775967,_0x39331a){_0x775967=_0x775967-0x0;var _0x2a9200=_0x45c6[_0x775967];return _0x2a9200;};'use strict';var multer=require('multer');var util=require(_0x645c('0x0'));var path=require(_0x645c('0x1'));var timeout=require(_0x645c('0x2'));var express=require('express');var router=express[_0x645c('0x3')]();var auth=require(_0x645c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x645c('0x5'));var controller=require(_0x645c('0x6'));router[_0x645c('0x7')]('/',auth[_0x645c('0x8')](),controller['index']);router[_0x645c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x645c('0x9')]);router[_0x645c('0xa')]('/',auth[_0x645c('0x8')](),controller[_0x645c('0xb')]);router[_0x645c('0xc')](_0x645c('0xd'),auth[_0x645c('0x8')](),controller['update']);router[_0x645c('0xe')](_0x645c('0xd'),auth[_0x645c('0x8')](),controller['destroy']);module[_0x645c('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index c43f167..1f12b5f 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaccc=['sequelize','exports','ENUM','localnet','externip','STRING'];(function(_0x17ad34,_0x55392e){var _0x2e8a58=function(_0x409628){while(--_0x409628){_0x17ad34['push'](_0x17ad34['shift']());}};_0x2e8a58(++_0x55392e);}(_0xaccc,0xd2));var _0xcacc=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xaccc[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0xcacc('0x0'));module[_0xcacc('0x1')]={'type':{'type':Sequelize[_0xcacc('0x2')](_0xcacc('0x3'),_0xcacc('0x4'))},'value':{'type':Sequelize[_0xcacc('0x5')]}}; \ No newline at end of file +var _0x99fd=['sequelize','exports','ENUM','externip'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x99fd,0xa0));var _0xd99f=function(_0x290bbb,_0x56fe1c){_0x290bbb=_0x290bbb-0x0;var _0x15693e=_0x99fd[_0x290bbb];return _0x15693e;};'use strict';var Sequelize=require(_0xd99f('0x0'));module[_0xd99f('0x1')]={'type':{'type':Sequelize[_0xd99f('0x2')]('localnet',_0xd99f('0x3'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 818fff9..2dcdb2c 100644 --- a/server/api/network/network.controller.js +++ b/server/api/network/network.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5715=['path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','apply','reject','update','destroy','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','type','options','Network','includeAll','findAll','rows','show','length','include','merge','find','create','transaction','body','readFileSync','join','root','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','sequelize','params','utf8','writeFileSync','server/files/templates/network.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x5715,0xc5));var _0x5571=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x5715[_0x3d42d8];return _0x27fc41;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5571('0x0'));var rimraf=require(_0x5571('0x1'));var zipdir=require(_0x5571('0x2'));var jsonpatch=require(_0x5571('0x3'));var rp=require(_0x5571('0x4'));var moment=require(_0x5571('0x5'));var BPromise=require(_0x5571('0x6'));var Mustache=require(_0x5571('0x7'));var util=require(_0x5571('0x8'));var path=require(_0x5571('0x9'));var sox=require(_0x5571('0xa'));var csv=require(_0x5571('0xb'));var ejs=require(_0x5571('0xc'));var fs=require('fs');var _=require(_0x5571('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5571('0xe'));var deskjs=require(_0x5571('0xf'));var toCsv=require(_0x5571('0xb'));var querystring=require(_0x5571('0x10'));var Papa=require(_0x5571('0x11'));var Redis=require('ioredis');var authService=require(_0x5571('0x12'));var qs=require(_0x5571('0x13'));var as=require(_0x5571('0x14'));var hardwareService=require(_0x5571('0x15'));var logger=require(_0x5571('0x16'))(_0x5571('0x17'));var utils=require(_0x5571('0x18'));var config=require(_0x5571('0x19'));var db=require(_0x5571('0x1a'))['db'];var jayson=require(_0x5571('0x1b'));var client=jayson[_0x5571('0x1c')][_0x5571('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x26c9d3,_0x560cc9,_0x427031){if(_0x427031){var _0x57fd29=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57fd29[_0x5571('0x1e')](_0x560cc9)){return _0x26c9d3;}else{throw new db[(_0x5571('0x1f'))][(_0x5571('0x20'))](_0x5571('0x21'));}}else{return _0x26c9d3;}}function respondWithRpcPromise(_0x3488df,_0x279080,_0x227bca,_0x4aedab){return new BPromise(function(_0x4b2f7d,_0x1c8ac2){var _0x43adc5=_0x4aedab||client;return _0x43adc5[_0x5571('0x22')](_0x3488df,_0x227bca)[_0x5571('0x23')](function(_0x5c6ff4){logger[_0x5571('0x24')](_0x5571('0x25'),_0x279080,_0x5571('0x26'));logger[_0x5571('0x27')]('Network,\x20%s,\x20%s,\x20%s',_0x279080,_0x5571('0x26'),JSON[_0x5571('0x28')](_0x5c6ff4));if(_0x5c6ff4[_0x5571('0x29')]){if(_0x5c6ff4[_0x5571('0x29')]['code']===0x1f4){logger[_0x5571('0x29')]('Network,\x20%s,\x20%s',_0x279080,_0x5c6ff4[_0x5571('0x29')][_0x5571('0x2a')]);return _0x1c8ac2(_0x5c6ff4['error']['message']);}logger[_0x5571('0x29')](_0x5571('0x25'),_0x279080,_0x5c6ff4[_0x5571('0x29')][_0x5571('0x2a')]);return _0x4b2f7d(_0x5c6ff4['error'][_0x5571('0x2a')]);}else{logger[_0x5571('0x24')](_0x5571('0x25'),_0x279080,'request\x20sent');_0x4b2f7d(_0x5c6ff4[_0x5571('0x2b')][_0x5571('0x2a')]);}})[_0x5571('0x2c')](function(_0x1ac249){logger['error'](_0x5571('0x25'),_0x279080,_0x1ac249);_0x1c8ac2(_0x1ac249);});});}function respondWithStatusCode(_0x238ebd,_0x18fa1c){_0x18fa1c=_0x18fa1c||0xcc;return function(_0x507057){if(_0x507057){return _0x238ebd[_0x5571('0x2d')](_0x18fa1c);}return _0x238ebd[_0x5571('0x2e')](_0x18fa1c)[_0x5571('0x2f')]();};}function respondWithResult(_0x3a9112,_0x4549e1){_0x4549e1=_0x4549e1||0xc8;return function(_0x1800ad){if(_0x1800ad){return _0x3a9112['status'](_0x4549e1)['json'](_0x1800ad);}};}function respondWithFilteredResult(_0x26fe76,_0x49e5a4){return function(_0x10beb5){if(_0x10beb5){var _0x400833=_0x10beb5[_0x5571('0x30')],_0x34a61a=_0x49e5a4['offset'],_0x466a05=_0x49e5a4[_0x5571('0x31')]+_0x49e5a4[_0x5571('0x32')],_0x1ee249;if(_0x466a05>=_0x400833){_0x466a05=_0x400833;_0x1ee249=0xc8;}else{_0x1ee249=0xce;}_0x26fe76['status'](_0x1ee249);return _0x26fe76[_0x5571('0x33')]('Content-Range',_0x34a61a+'-'+_0x466a05+'/'+_0x400833)['json'](_0x10beb5);}return null;};}function patchUpdates(_0x328556){return function(_0x379519){try{jsonpatch[_0x5571('0x34')](_0x379519,_0x328556,!![]);}catch(_0x28e5da){return BPromise[_0x5571('0x35')](_0x28e5da);}return _0x379519['save']();};}function saveUpdates(_0x5e69de,_0x4282d7){return function(_0x99ad71){if(_0x99ad71){return _0x99ad71[_0x5571('0x36')](_0x5e69de)[_0x5571('0x23')](function(_0x1ef0c5){return _0x1ef0c5;});}return null;};}function removeEntity(_0x28724d,_0x5dcc7c){return function(_0x40b638){if(_0x40b638){return _0x40b638[_0x5571('0x37')]()[_0x5571('0x23')](function(){_0x28724d[_0x5571('0x2e')](0xcc)[_0x5571('0x2f')]();});}};}function handleEntityNotFound(_0x586a6b,_0x3867b1){return function(_0x5dc1de){if(!_0x5dc1de){_0x586a6b['sendStatus'](0x194);}return _0x5dc1de;};}function handleError(_0x509846,_0x392545){_0x392545=_0x392545||0x1f4;return function(_0x1dc3ab){logger[_0x5571('0x29')](_0x1dc3ab[_0x5571('0x38')]);if(_0x1dc3ab[_0x5571('0x39')]){delete _0x1dc3ab[_0x5571('0x39')];}_0x509846[_0x5571('0x2e')](_0x392545)['send'](_0x1dc3ab);};}exports[_0x5571('0x3a')]=function(_0x119d9e,_0x14a021){var _0x34b3ef={},_0x8799d1={},_0x464d25={'count':0x0,'rows':[]};var _0xd7b37b=_[_0x5571('0x3b')](db['Network'][_0x5571('0x3c')],function(_0x48e2f3){return{'name':_0x48e2f3['fieldName'],'type':_0x48e2f3['type'][_0x5571('0x3d')]};});_0x8799d1[_0x5571('0x3e')]=_['map'](_0xd7b37b,_0x5571('0x39'));_0x8799d1[_0x5571('0x3f')]=_[_0x5571('0x40')](_0x119d9e[_0x5571('0x3f')]);_0x8799d1[_0x5571('0x41')]=_[_0x5571('0x42')](_0x8799d1[_0x5571('0x3e')],_0x8799d1[_0x5571('0x3f')]);_0x34b3ef[_0x5571('0x43')]=_['intersection'](_0x8799d1[_0x5571('0x3e')],qs[_0x5571('0x44')](_0x119d9e[_0x5571('0x3f')]['fields']));_0x34b3ef[_0x5571('0x43')]=_0x34b3ef[_0x5571('0x43')]['length']?_0x34b3ef['attributes']:_0x8799d1[_0x5571('0x3e')];if(!_0x119d9e[_0x5571('0x3f')][_0x5571('0x45')](_0x5571('0x46'))){_0x34b3ef[_0x5571('0x32')]=qs[_0x5571('0x32')](_0x119d9e[_0x5571('0x3f')]['limit']);_0x34b3ef[_0x5571('0x31')]=qs[_0x5571('0x31')](_0x119d9e['query']['offset']);}_0x34b3ef[_0x5571('0x47')]=qs['sort'](_0x119d9e[_0x5571('0x3f')]['sort']);_0x34b3ef[_0x5571('0x48')]=qs[_0x5571('0x41')](_[_0x5571('0x49')](_0x119d9e[_0x5571('0x3f')],_0x8799d1[_0x5571('0x41')]));if(_0x119d9e['query'][_0x5571('0x4a')]){_0x34b3ef[_0x5571('0x48')]=_['merge'](_0x34b3ef[_0x5571('0x48')],{'$or':_[_0x5571('0x3b')](_0xd7b37b,function(_0x6c14c4){if(_0x6c14c4[_0x5571('0x4b')]!=='VIRTUAL'){var _0x31c9={};_0x31c9[_0x6c14c4['name']]={'$like':'%'+_0x119d9e['query']['filter']+'%'};return _0x31c9;}})});}_0x34b3ef=_['merge']({},_0x34b3ef,_0x119d9e[_0x5571('0x4c')]);var _0x17e5b8={'where':_0x34b3ef[_0x5571('0x48')]};return db[_0x5571('0x4d')][_0x5571('0x30')](_0x17e5b8)[_0x5571('0x23')](function(_0x1603c8){_0x464d25[_0x5571('0x30')]=_0x1603c8;if(_0x119d9e[_0x5571('0x3f')][_0x5571('0x4e')]){_0x34b3ef['include']=[{'all':!![]}];}return db[_0x5571('0x4d')][_0x5571('0x4f')](_0x34b3ef);})[_0x5571('0x23')](function(_0x8ae92c){_0x464d25[_0x5571('0x50')]=_0x8ae92c;return _0x464d25;})[_0x5571('0x23')](respondWithFilteredResult(_0x14a021,_0x34b3ef))['catch'](handleError(_0x14a021,null));};exports[_0x5571('0x51')]=function(_0x4576bc,_0x8156f3){var _0xd5bf65={'raw':!![],'where':{'id':_0x4576bc['params']['id']}},_0x2e4646={};_0x2e4646[_0x5571('0x3e')]=_[_0x5571('0x40')](db[_0x5571('0x4d')][_0x5571('0x3c')]);_0x2e4646[_0x5571('0x3f')]=_[_0x5571('0x40')](_0x4576bc[_0x5571('0x3f')]);_0x2e4646[_0x5571('0x41')]=_[_0x5571('0x42')](_0x2e4646['model'],_0x2e4646[_0x5571('0x3f')]);_0xd5bf65[_0x5571('0x43')]=_[_0x5571('0x42')](_0x2e4646[_0x5571('0x3e')],qs[_0x5571('0x44')](_0x4576bc['query'][_0x5571('0x44')]));_0xd5bf65['attributes']=_0xd5bf65[_0x5571('0x43')][_0x5571('0x52')]?_0xd5bf65['attributes']:_0x2e4646[_0x5571('0x3e')];if(_0x4576bc[_0x5571('0x3f')][_0x5571('0x4e')]){_0xd5bf65[_0x5571('0x53')]=[{'all':!![]}];}_0xd5bf65=_[_0x5571('0x54')]({},_0xd5bf65,_0x4576bc['options']);return db[_0x5571('0x4d')][_0x5571('0x55')](_0xd5bf65)[_0x5571('0x23')](handleEntityNotFound(_0x8156f3,null))[_0x5571('0x23')](respondWithResult(_0x8156f3,null))[_0x5571('0x2c')](handleError(_0x8156f3,null));};exports[_0x5571('0x56')]=function(_0x4bd4e0,_0x506d21,_0x1b07bc){var _0x500717;return db['sequelize'][_0x5571('0x57')](function(_0x4ef2aa){return db[_0x5571('0x4d')][_0x5571('0x56')](_0x4bd4e0['body'],{'raw':!![]})[_0x5571('0x23')](function(_0x3ce53d){_0x500717=_0x3ce53d;return db[_0x5571('0x4d')][_0x5571('0x4f')]({'where':{'type':_0x4bd4e0[_0x5571('0x58')][_0x5571('0x4b')]},'raw':!![]});})[_0x5571('0x23')](function(_0x167dc1){var _0x3d5b2b=fs[_0x5571('0x59')](path[_0x5571('0x5a')](config[_0x5571('0x5b')],'server/files/templates/network.ejs'),'utf8');var _0x3ece09=ejs[_0x5571('0x5c')](_0x3d5b2b,{'networks':_0x167dc1||[]});fs['writeFileSync'](util[_0x5571('0x5d')](_0x5571('0x5e'),_0x4bd4e0[_0x5571('0x58')][_0x5571('0x4b')][_0x5571('0x5f')]()),_0x3ece09);})[_0x5571('0x23')](function(){return respondWithRpcPromise(_0x5571('0x60'),_0x5571('0x56'),{'module':_0x5571('0x61')});})[_0x5571('0x23')](function(){return _0x500717;});})['then'](respondWithResult(_0x506d21,0xc9))[_0x5571('0x2c')](handleError(_0x506d21,null));};exports[_0x5571('0x36')]=function(_0x146f91,_0x361117,_0x12a072){var _0x3f10b5;return db[_0x5571('0x62')][_0x5571('0x57')](function(_0x5223c0){return db[_0x5571('0x4d')][_0x5571('0x55')]({'where':{'id':_0x146f91[_0x5571('0x63')]['id']}})['then'](handleEntityNotFound(_0x361117,null))[_0x5571('0x23')](saveUpdates(_0x146f91['body'],null))['then'](function(_0x478c92){if(_0x478c92){_0x3f10b5=_0x478c92;return db[_0x5571('0x4d')]['findAll']({'where':{'type':_0x3f10b5[_0x5571('0x4b')]},'raw':!![]});}return null;})['then'](function(_0x3065bd){if(_0x3065bd){var _0xd421cd=fs[_0x5571('0x59')](path[_0x5571('0x5a')](config['root'],'server/files/templates/network.ejs'),_0x5571('0x64'));var _0xbd5240=ejs[_0x5571('0x5c')](_0xd421cd,{'networks':_0x3065bd||[]});fs[_0x5571('0x65')](util[_0x5571('0x5d')](_0x5571('0x5e'),_0x3f10b5[_0x5571('0x4b')][_0x5571('0x5f')]()),_0xbd5240);return respondWithRpcPromise(_0x5571('0x60'),_0x5571('0x36'),{'module':_0x5571('0x61')});}return null;})[_0x5571('0x23')](function(_0x3cfdf4){if(_0x3cfdf4){return _0x3f10b5;}return null;});})[_0x5571('0x23')](respondWithResult(_0x361117,null))['catch'](handleError(_0x361117,null));};exports[_0x5571('0x37')]=function(_0xa8e555,_0x23332b,_0x2ef3ec){var _0xce1529;return db['Network'][_0x5571('0x55')]({'where':{'id':_0xa8e555[_0x5571('0x63')]['id']}})[_0x5571('0x23')](function(_0x810ef2){_0xce1529=_0x810ef2;return _0x810ef2;})[_0x5571('0x23')](handleEntityNotFound(_0x23332b,null))[_0x5571('0x23')](removeEntity(_0x23332b,null))[_0x5571('0x23')](function(){if(_0xce1529){return db['Network'][_0x5571('0x4f')]({'where':{'type':_0xce1529['type']},'raw':!![]});}})['then'](function(_0x18e059){if(_0x18e059){var _0x453448=fs[_0x5571('0x59')](path[_0x5571('0x5a')](config[_0x5571('0x5b')],_0x5571('0x66')),'utf8');var _0x5c055e=ejs[_0x5571('0x5c')](_0x453448,{'networks':_0x18e059||[]});fs[_0x5571('0x65')](util[_0x5571('0x5d')](_0x5571('0x5e'),_0xce1529['type'][_0x5571('0x5f')]()),_0x5c055e);return respondWithRpcPromise(_0x5571('0x60'),_0x5571('0x37'),{'module':_0x5571('0x61')});}})[_0x5571('0x2c')](handleError(_0x23332b,null));}; \ No newline at end of file +var _0x79f2=['show','params','include','options','find','create','sequelize','body','readFileSync','join','root','server/files/templates/network.ejs','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','update','transaction','utf8','writeFileSync','chan_sip.so','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','test','ValidationError','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','count','offset','limit','Content-Range','save','sendStatus','name','send','index','map','Network','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows'];(function(_0x4e7129,_0x500cb0){var _0x248b7c=function(_0x13ea65){while(--_0x13ea65){_0x4e7129['push'](_0x4e7129['shift']());}};_0x248b7c(++_0x500cb0);}(_0x79f2,0x78));var _0x279f=function(_0x43e659,_0x518723){_0x43e659=_0x43e659-0x0;var _0x13d891=_0x79f2[_0x43e659];return _0x13d891;};'use strict';var pdf=require(_0x279f('0x0'));var emlformat=require(_0x279f('0x1'));var rimraf=require(_0x279f('0x2'));var zipdir=require(_0x279f('0x3'));var jsonpatch=require(_0x279f('0x4'));var rp=require(_0x279f('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x279f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x279f('0x7'));var csv=require(_0x279f('0x8'));var ejs=require(_0x279f('0x9'));var fs=require('fs');var _=require(_0x279f('0xa'));var squel=require(_0x279f('0xb'));var crypto=require('crypto');var jsforce=require(_0x279f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x279f('0x8'));var querystring=require(_0x279f('0xd'));var Papa=require(_0x279f('0xe'));var Redis=require('ioredis');var authService=require(_0x279f('0xf'));var qs=require(_0x279f('0x10'));var as=require(_0x279f('0x11'));var hardwareService=require(_0x279f('0x12'));var logger=require(_0x279f('0x13'))(_0x279f('0x14'));var utils=require(_0x279f('0x15'));var config=require('../../config/environment');var db=require(_0x279f('0x16'))['db'];var jayson=require(_0x279f('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x666329,_0x464850,_0x4fa9be){if(_0x4fa9be){var _0x51a468=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x51a468[_0x279f('0x18')](_0x464850)){return _0x666329;}else{throw new db['Sequelize'][(_0x279f('0x19'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x666329;}}function respondWithRpcPromise(_0x4fb3b3,_0x79be35,_0x1ab745,_0x24081b){return new BPromise(function(_0x45dbab,_0x14a933){var _0x3174b4=_0x24081b||client;return _0x3174b4[_0x279f('0x1a')](_0x4fb3b3,_0x1ab745)[_0x279f('0x1b')](function(_0x3190a4){logger[_0x279f('0x1c')](_0x279f('0x1d'),_0x79be35,_0x279f('0x1e'));logger[_0x279f('0x1f')](_0x279f('0x20'),_0x79be35,_0x279f('0x1e'),JSON['stringify'](_0x3190a4));if(_0x3190a4['error']){if(_0x3190a4[_0x279f('0x21')]['code']===0x1f4){logger[_0x279f('0x21')](_0x279f('0x1d'),_0x79be35,_0x3190a4[_0x279f('0x21')][_0x279f('0x22')]);return _0x14a933(_0x3190a4['error'][_0x279f('0x22')]);}logger[_0x279f('0x21')](_0x279f('0x1d'),_0x79be35,_0x3190a4[_0x279f('0x21')]['message']);return _0x45dbab(_0x3190a4[_0x279f('0x21')][_0x279f('0x22')]);}else{logger['info'](_0x279f('0x1d'),_0x79be35,_0x279f('0x1e'));_0x45dbab(_0x3190a4[_0x279f('0x23')]['message']);}})[_0x279f('0x24')](function(_0x26ac5f){logger['error'](_0x279f('0x1d'),_0x79be35,_0x26ac5f);_0x14a933(_0x26ac5f);});});}function respondWithStatusCode(_0x5d24d4,_0x290471){_0x290471=_0x290471||0xcc;return function(_0x21cd0d){if(_0x21cd0d){return _0x5d24d4['sendStatus'](_0x290471);}return _0x5d24d4[_0x279f('0x25')](_0x290471)[_0x279f('0x26')]();};}function respondWithResult(_0x33da01,_0xe891b2){_0xe891b2=_0xe891b2||0xc8;return function(_0x17d4ed){if(_0x17d4ed){return _0x33da01[_0x279f('0x25')](_0xe891b2)[_0x279f('0x27')](_0x17d4ed);}};}function respondWithFilteredResult(_0x5bf798,_0xc75248){return function(_0x49e048){if(_0x49e048){var _0x3391e1=_0x49e048[_0x279f('0x28')],_0x416fad=_0xc75248[_0x279f('0x29')],_0x199e26=_0xc75248[_0x279f('0x29')]+_0xc75248[_0x279f('0x2a')],_0x46c52d;if(_0x199e26>=_0x3391e1){_0x199e26=_0x3391e1;_0x46c52d=0xc8;}else{_0x46c52d=0xce;}_0x5bf798['status'](_0x46c52d);return _0x5bf798['set'](_0x279f('0x2b'),_0x416fad+'-'+_0x199e26+'/'+_0x3391e1)['json'](_0x49e048);}return null;};}function patchUpdates(_0xea1505){return function(_0x25e146){try{jsonpatch['apply'](_0x25e146,_0xea1505,!![]);}catch(_0x2b2209){return BPromise['reject'](_0x2b2209);}return _0x25e146[_0x279f('0x2c')]();};}function saveUpdates(_0x164e67,_0x15cfb8){return function(_0x3c2e54){if(_0x3c2e54){return _0x3c2e54['update'](_0x164e67)['then'](function(_0x3f888a){return _0x3f888a;});}return null;};}function removeEntity(_0x45b8b4,_0x39e3b3){return function(_0x1dd497){if(_0x1dd497){return _0x1dd497['destroy']()[_0x279f('0x1b')](function(){_0x45b8b4[_0x279f('0x25')](0xcc)[_0x279f('0x26')]();});}};}function handleEntityNotFound(_0x193bf1,_0x76b8f8){return function(_0x508524){if(!_0x508524){_0x193bf1[_0x279f('0x2d')](0x194);}return _0x508524;};}function handleError(_0xd5418f,_0x1419dd){_0x1419dd=_0x1419dd||0x1f4;return function(_0xedb97e){logger[_0x279f('0x21')](_0xedb97e['stack']);if(_0xedb97e[_0x279f('0x2e')]){delete _0xedb97e[_0x279f('0x2e')];}_0xd5418f[_0x279f('0x25')](_0x1419dd)[_0x279f('0x2f')](_0xedb97e);};}exports[_0x279f('0x30')]=function(_0x531878,_0x3314c8){var _0x163cb3={},_0x16b70c={},_0x15c148={'count':0x0,'rows':[]};var _0x52e5f0=_[_0x279f('0x31')](db[_0x279f('0x32')][_0x279f('0x33')],function(_0x1febfe){return{'name':_0x1febfe[_0x279f('0x34')],'type':_0x1febfe[_0x279f('0x35')][_0x279f('0x36')]};});_0x16b70c['model']=_[_0x279f('0x31')](_0x52e5f0,'name');_0x16b70c[_0x279f('0x37')]=_[_0x279f('0x38')](_0x531878['query']);_0x16b70c['filters']=_[_0x279f('0x39')](_0x16b70c['model'],_0x16b70c[_0x279f('0x37')]);_0x163cb3[_0x279f('0x3a')]=_[_0x279f('0x39')](_0x16b70c[_0x279f('0x3b')],qs[_0x279f('0x3c')](_0x531878[_0x279f('0x37')][_0x279f('0x3c')]));_0x163cb3[_0x279f('0x3a')]=_0x163cb3[_0x279f('0x3a')][_0x279f('0x3d')]?_0x163cb3[_0x279f('0x3a')]:_0x16b70c['model'];if(!_0x531878[_0x279f('0x37')][_0x279f('0x3e')](_0x279f('0x3f'))){_0x163cb3[_0x279f('0x2a')]=qs[_0x279f('0x2a')](_0x531878[_0x279f('0x37')][_0x279f('0x2a')]);_0x163cb3['offset']=qs[_0x279f('0x29')](_0x531878['query'][_0x279f('0x29')]);}_0x163cb3['order']=qs[_0x279f('0x40')](_0x531878[_0x279f('0x37')]['sort']);_0x163cb3['where']=qs[_0x279f('0x41')](_[_0x279f('0x42')](_0x531878['query'],_0x16b70c[_0x279f('0x41')]));if(_0x531878['query'][_0x279f('0x43')]){_0x163cb3[_0x279f('0x44')]=_[_0x279f('0x45')](_0x163cb3['where'],{'$or':_['map'](_0x52e5f0,function(_0x933a3f){if(_0x933a3f['type']!==_0x279f('0x46')){var _0x428393={};_0x428393[_0x933a3f[_0x279f('0x2e')]]={'$like':'%'+_0x531878[_0x279f('0x37')][_0x279f('0x43')]+'%'};return _0x428393;}})});}_0x163cb3=_[_0x279f('0x45')]({},_0x163cb3,_0x531878['options']);var _0x2c2166={'where':_0x163cb3[_0x279f('0x44')]};return db['Network']['count'](_0x2c2166)[_0x279f('0x1b')](function(_0x5d6375){_0x15c148[_0x279f('0x28')]=_0x5d6375;if(_0x531878['query'][_0x279f('0x47')]){_0x163cb3['include']=[{'all':!![]}];}return db[_0x279f('0x32')][_0x279f('0x48')](_0x163cb3);})[_0x279f('0x1b')](function(_0x242441){_0x15c148[_0x279f('0x49')]=_0x242441;return _0x15c148;})[_0x279f('0x1b')](respondWithFilteredResult(_0x3314c8,_0x163cb3))[_0x279f('0x24')](handleError(_0x3314c8,null));};exports[_0x279f('0x4a')]=function(_0x469413,_0x146f29){var _0x4dd474={'raw':!![],'where':{'id':_0x469413[_0x279f('0x4b')]['id']}},_0x199d40={};_0x199d40['model']=_[_0x279f('0x38')](db[_0x279f('0x32')]['rawAttributes']);_0x199d40[_0x279f('0x37')]=_[_0x279f('0x38')](_0x469413['query']);_0x199d40[_0x279f('0x41')]=_[_0x279f('0x39')](_0x199d40['model'],_0x199d40['query']);_0x4dd474['attributes']=_[_0x279f('0x39')](_0x199d40['model'],qs['fields'](_0x469413[_0x279f('0x37')][_0x279f('0x3c')]));_0x4dd474[_0x279f('0x3a')]=_0x4dd474[_0x279f('0x3a')][_0x279f('0x3d')]?_0x4dd474[_0x279f('0x3a')]:_0x199d40[_0x279f('0x3b')];if(_0x469413[_0x279f('0x37')][_0x279f('0x47')]){_0x4dd474[_0x279f('0x4c')]=[{'all':!![]}];}_0x4dd474=_[_0x279f('0x45')]({},_0x4dd474,_0x469413[_0x279f('0x4d')]);return db[_0x279f('0x32')][_0x279f('0x4e')](_0x4dd474)['then'](handleEntityNotFound(_0x146f29,null))[_0x279f('0x1b')](respondWithResult(_0x146f29,null))[_0x279f('0x24')](handleError(_0x146f29,null));};exports[_0x279f('0x4f')]=function(_0x9cc61,_0x30feaa,_0x34300b){var _0x511919;return db[_0x279f('0x50')]['transaction'](function(_0x4f7fc3){return db[_0x279f('0x32')][_0x279f('0x4f')](_0x9cc61[_0x279f('0x51')],{'raw':!![]})[_0x279f('0x1b')](function(_0x1f152b){_0x511919=_0x1f152b;return db[_0x279f('0x32')][_0x279f('0x48')]({'where':{'type':_0x9cc61['body'][_0x279f('0x35')]},'raw':!![]});})[_0x279f('0x1b')](function(_0x28092b){var _0xd9bb63=fs[_0x279f('0x52')](path[_0x279f('0x53')](config[_0x279f('0x54')],_0x279f('0x55')),'utf8');var _0x5f3907=ejs[_0x279f('0x56')](_0xd9bb63,{'networks':_0x28092b||[]});fs['writeFileSync'](util[_0x279f('0x57')](_0x279f('0x58'),_0x9cc61['body'][_0x279f('0x35')][_0x279f('0x59')]()),_0x5f3907);})[_0x279f('0x1b')](function(){return respondWithRpcPromise(_0x279f('0x5a'),'create',{'module':'chan_sip.so'});})[_0x279f('0x1b')](function(){return _0x511919;});})['then'](respondWithResult(_0x30feaa,0xc9))[_0x279f('0x24')](handleError(_0x30feaa,null));};exports[_0x279f('0x5b')]=function(_0x3115cd,_0x323734,_0x4893b0){var _0xf38ac6;return db['sequelize'][_0x279f('0x5c')](function(_0x227519){return db[_0x279f('0x32')][_0x279f('0x4e')]({'where':{'id':_0x3115cd[_0x279f('0x4b')]['id']}})[_0x279f('0x1b')](handleEntityNotFound(_0x323734,null))['then'](saveUpdates(_0x3115cd[_0x279f('0x51')],null))[_0x279f('0x1b')](function(_0x297406){if(_0x297406){_0xf38ac6=_0x297406;return db[_0x279f('0x32')][_0x279f('0x48')]({'where':{'type':_0xf38ac6[_0x279f('0x35')]},'raw':!![]});}return null;})[_0x279f('0x1b')](function(_0x2dff8c){if(_0x2dff8c){var _0xec1b8f=fs[_0x279f('0x52')](path['join'](config[_0x279f('0x54')],_0x279f('0x55')),_0x279f('0x5d'));var _0x354802=ejs[_0x279f('0x56')](_0xec1b8f,{'networks':_0x2dff8c||[]});fs[_0x279f('0x5e')](util['format'](_0x279f('0x58'),_0xf38ac6[_0x279f('0x35')][_0x279f('0x59')]()),_0x354802);return respondWithRpcPromise(_0x279f('0x5a'),_0x279f('0x5b'),{'module':_0x279f('0x5f')});}return null;})[_0x279f('0x1b')](function(_0x40d377){if(_0x40d377){return _0xf38ac6;}return null;});})['then'](respondWithResult(_0x323734,null))[_0x279f('0x24')](handleError(_0x323734,null));};exports['destroy']=function(_0x2521fa,_0xa2bc4e,_0x38a279){var _0x91b874;return db[_0x279f('0x32')][_0x279f('0x4e')]({'where':{'id':_0x2521fa[_0x279f('0x4b')]['id']}})[_0x279f('0x1b')](function(_0x200920){_0x91b874=_0x200920;return _0x200920;})['then'](handleEntityNotFound(_0xa2bc4e,null))[_0x279f('0x1b')](removeEntity(_0xa2bc4e,null))[_0x279f('0x1b')](function(){if(_0x91b874){return db['Network'][_0x279f('0x48')]({'where':{'type':_0x91b874['type']},'raw':!![]});}})[_0x279f('0x1b')](function(_0x403c54){if(_0x403c54){var _0x4346bd=fs[_0x279f('0x52')](path['join'](config[_0x279f('0x54')],_0x279f('0x55')),'utf8');var _0x43038c=ejs[_0x279f('0x56')](_0x4346bd,{'networks':_0x403c54||[]});fs[_0x279f('0x5e')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x91b874[_0x279f('0x35')]['toLowerCase']()),_0x43038c);return respondWithRpcPromise(_0x279f('0x5a'),_0x279f('0x60'),{'module':_0x279f('0x5f')});}})[_0x279f('0x24')](handleError(_0xa2bc4e,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 2a2cc72..13f6671 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8da=['exports','define','Network','network','util','../../config/logger','api','path','rimraf','../../config/environment','./network.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe8da,0x190));var _0xae8d=function(_0x114d6c,_0x51b172){_0x114d6c=_0x114d6c-0x0;var _0x360985=_0xe8da[_0x114d6c];return _0x360985;};'use strict';var _=require('lodash');var util=require(_0xae8d('0x0'));var logger=require(_0xae8d('0x1'))(_0xae8d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae8d('0x3'));var rimraf=require(_0xae8d('0x4'));var config=require(_0xae8d('0x5'));var attributes=require(_0xae8d('0x6'));module[_0xae8d('0x7')]=function(_0x1e8da6,_0xbcd25){return _0x1e8da6[_0xae8d('0x8')](_0xae8d('0x9'),attributes,{'tableName':_0xae8d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e12=['Network','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x3fb930,_0x25817f){var _0x5f1eb5=function(_0x222551){while(--_0x222551){_0x3fb930['push'](_0x3fb930['shift']());}};_0x5f1eb5(++_0x25817f);}(_0x5e12,0xbf));var _0x25e1=function(_0xb7ee6e,_0x3c4e94){_0xb7ee6e=_0xb7ee6e-0x0;var _0x8b7173=_0x5e12[_0xb7ee6e];return _0x8b7173;};'use strict';var _=require(_0x25e1('0x0'));var util=require(_0x25e1('0x1'));var logger=require(_0x25e1('0x2'))('api');var moment=require(_0x25e1('0x3'));var BPromise=require('bluebird');var rp=require(_0x25e1('0x4'));var fs=require('fs');var path=require(_0x25e1('0x5'));var rimraf=require('rimraf');var config=require(_0x25e1('0x6'));var attributes=require('./network.attributes');module[_0x25e1('0x7')]=function(_0x7a1a4e,_0x45da2c){return _0x7a1a4e[_0x25e1('0x8')](_0x25e1('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 06bbc37..e1967a3 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6a3=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0xf6a3,0xe2));var _0x3f6a=function(_0x1099ce,_0x37ebbc){_0x1099ce=_0x1099ce-0x0;var _0x1c193e=_0xf6a3[_0x1099ce];return _0x1c193e;};'use strict';var _=require(_0x3f6a('0x0'));var util=require(_0x3f6a('0x1'));var moment=require(_0x3f6a('0x2'));var BPromise=require(_0x3f6a('0x3'));var rs=require(_0x3f6a('0x4'));var fs=require('fs');var Redis=require(_0x3f6a('0x5'));var db=require(_0x3f6a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f6a('0x7'))(_0x3f6a('0x8'));var config=require(_0x3f6a('0x9'));var jayson=require(_0x3f6a('0xa'));var client=jayson[_0x3f6a('0xb')][_0x3f6a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd85505,_0x4941e1,_0x6b6356){return new BPromise(function(_0x2f17aa,_0x26c02f){return client[_0x3f6a('0xd')](_0xd85505,_0x6b6356)[_0x3f6a('0xe')](function(_0x8b4518){logger[_0x3f6a('0xf')](_0x3f6a('0x10'),_0x4941e1,_0x3f6a('0x11'));logger[_0x3f6a('0x12')](_0x3f6a('0x13'),_0x4941e1,_0x3f6a('0x11'),JSON[_0x3f6a('0x14')](_0x8b4518));if(_0x8b4518['error']){if(_0x8b4518[_0x3f6a('0x15')][_0x3f6a('0x16')]===0x1f4){logger[_0x3f6a('0x15')](_0x3f6a('0x10'),_0x4941e1,_0x8b4518['error'][_0x3f6a('0x17')]);return _0x26c02f(_0x8b4518['error'][_0x3f6a('0x17')]);}logger[_0x3f6a('0x15')]('Network,\x20%s,\x20%s',_0x4941e1,_0x8b4518[_0x3f6a('0x15')][_0x3f6a('0x17')]);return _0x2f17aa(_0x8b4518[_0x3f6a('0x15')][_0x3f6a('0x17')]);}else{logger[_0x3f6a('0xf')](_0x3f6a('0x10'),_0x4941e1,'request\x20sent');_0x2f17aa(_0x8b4518['result']['message']);}})[_0x3f6a('0x18')](function(_0x1d7fea){logger[_0x3f6a('0x15')](_0x3f6a('0x10'),_0x4941e1,_0x1d7fea);_0x26c02f(_0x1d7fea);});});} \ No newline at end of file +var _0x57c7=['lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch'];(function(_0x57a634,_0x266a81){var _0x4c47cb=function(_0x4ddfda){while(--_0x4ddfda){_0x57a634['push'](_0x57a634['shift']());}};_0x4c47cb(++_0x266a81);}(_0x57c7,0x12c));var _0x757c=function(_0x26b343,_0x1d1c39){_0x26b343=_0x26b343-0x0;var _0x5334e4=_0x57c7[_0x26b343];return _0x5334e4;};'use strict';var _=require(_0x757c('0x0'));var util=require(_0x757c('0x1'));var moment=require(_0x757c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x757c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x757c('0x4'));var logger=require(_0x757c('0x5'))('rpc');var config=require(_0x757c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x757c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x340570,_0x32142e,_0x268609){return new BPromise(function(_0x1d4d63,_0x51d80e){return client[_0x757c('0x8')](_0x340570,_0x268609)[_0x757c('0x9')](function(_0x48baa5){logger[_0x757c('0xa')]('Network,\x20%s,\x20%s',_0x32142e,_0x757c('0xb'));logger['debug'](_0x757c('0xc'),_0x32142e,_0x757c('0xb'),JSON[_0x757c('0xd')](_0x48baa5));if(_0x48baa5[_0x757c('0xe')]){if(_0x48baa5[_0x757c('0xe')][_0x757c('0xf')]===0x1f4){logger[_0x757c('0xe')](_0x757c('0x10'),_0x32142e,_0x48baa5[_0x757c('0xe')]['message']);return _0x51d80e(_0x48baa5[_0x757c('0xe')][_0x757c('0x11')]);}logger[_0x757c('0xe')]('Network,\x20%s,\x20%s',_0x32142e,_0x48baa5[_0x757c('0xe')]['message']);return _0x1d4d63(_0x48baa5[_0x757c('0xe')][_0x757c('0x11')]);}else{logger['info'](_0x757c('0x10'),_0x32142e,_0x757c('0xb'));_0x1d4d63(_0x48baa5[_0x757c('0x12')]['message']);}})[_0x757c('0x13')](function(_0x1bd4be){logger[_0x757c('0xe')]('Network,\x20%s,\x20%s',_0x32142e,_0x1bd4be);_0x51d80e(_0x1bd4be);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 179816b..2cb23d6 100644 --- a/server/api/openchannelAccount/index.js +++ b/server/api/openchannelAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38ea=['removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','getInteractions','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/users','addAgents','/:id/send','send','delete','destroy','removeDispositions'];(function(_0x2904eb,_0x4f23a1){var _0x42bd3d=function(_0x575257){while(--_0x575257){_0x2904eb['push'](_0x2904eb['shift']());}};_0x42bd3d(++_0x4f23a1);}(_0x38ea,0x18f));var _0xa38e=function(_0x37b53b,_0x37b494){_0x37b53b=_0x37b53b-0x0;var _0x4dd7f5=_0x38ea[_0x37b53b];return _0x4dd7f5;};'use strict';var multer=require(_0xa38e('0x0'));var util=require(_0xa38e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa38e('0x2'));var router=express[_0xa38e('0x3')]();var auth=require(_0xa38e('0x4'));var interaction=require(_0xa38e('0x5'));var config=require(_0xa38e('0x6'));var controller=require('./openchannelAccount.controller');router[_0xa38e('0x7')]('/',auth['isAuthenticated'](),controller[_0xa38e('0x8')]);router[_0xa38e('0x7')](_0xa38e('0x9'),auth[_0xa38e('0xa')](),controller[_0xa38e('0xb')]);router[_0xa38e('0x7')](_0xa38e('0xc'),auth[_0xa38e('0xa')](),controller['show']);router['get'](_0xa38e('0xd'),auth[_0xa38e('0xa')](),controller[_0xa38e('0xe')]);router[_0xa38e('0x7')](_0xa38e('0xf'),auth[_0xa38e('0xa')](),controller['getAnswers']);router[_0xa38e('0x7')]('/:id/applications',auth[_0xa38e('0xa')](),controller[_0xa38e('0x10')]);router['get']('/:id/interactions',auth[_0xa38e('0xa')](),controller[_0xa38e('0x11')]);router[_0xa38e('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xa38e('0x12')]);router[_0xa38e('0x13')]('/',auth[_0xa38e('0xa')](),controller['create']);router[_0xa38e('0x13')]('/:id/dispositions',auth[_0xa38e('0xa')](),controller[_0xa38e('0x14')]);router['post']('/:id/canned_answers',auth[_0xa38e('0xa')](),controller[_0xa38e('0x15')]);router[_0xa38e('0x13')](_0xa38e('0x16'),controller[_0xa38e('0x17')]);router[_0xa38e('0x13')](_0xa38e('0x18'),auth[_0xa38e('0xa')](),controller[_0xa38e('0x19')]);router['post'](_0xa38e('0x1a'),auth[_0xa38e('0xa')](),controller[_0xa38e('0x1b')]);router[_0xa38e('0x13')](_0xa38e('0x1c'),auth[_0xa38e('0xa')](),controller[_0xa38e('0x1d')]);router['put']('/:id',auth[_0xa38e('0xa')](),controller['update']);router[_0xa38e('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0xa38e('0x1f')]);router[_0xa38e('0x1e')]('/:id/dispositions',auth[_0xa38e('0xa')](),controller[_0xa38e('0x20')]);router[_0xa38e('0x1e')](_0xa38e('0xf'),auth[_0xa38e('0xa')](),controller[_0xa38e('0x21')]);router['delete']('/:id/users',auth[_0xa38e('0xa')](),controller[_0xa38e('0x22')]);module[_0xa38e('0x23')]=router; \ No newline at end of file +var _0x911d=['/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','post','create','addDisposition','/:id/notify','notify','addAgents','/:id/send','send','update','delete','removeAnswers','/:id/users','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe'];(function(_0x21b488,_0xdd7e73){var _0x1f8e37=function(_0x2d0751){while(--_0x2d0751){_0x21b488['push'](_0x21b488['shift']());}};_0x1f8e37(++_0xdd7e73);}(_0x911d,0x114));var _0xd911=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0x911d[_0x219d87];return _0x22823d;};'use strict';var multer=require(_0xd911('0x0'));var util=require(_0xd911('0x1'));var path=require(_0xd911('0x2'));var timeout=require(_0xd911('0x3'));var express=require(_0xd911('0x4'));var router=express[_0xd911('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd911('0x6'));var config=require(_0xd911('0x7'));var controller=require('./openchannelAccount.controller');router[_0xd911('0x8')]('/',auth['isAuthenticated'](),controller[_0xd911('0x9')]);router['get']('/describe',auth[_0xd911('0xa')](),controller[_0xd911('0xb')]);router[_0xd911('0x8')](_0xd911('0xc'),auth[_0xd911('0xa')](),controller['show']);router[_0xd911('0x8')](_0xd911('0xd'),auth[_0xd911('0xa')](),controller[_0xd911('0xe')]);router['get'](_0xd911('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xd911('0x10'),auth[_0xd911('0xa')](),controller[_0xd911('0x11')]);router[_0xd911('0x8')](_0xd911('0x12'),auth[_0xd911('0xa')](),controller['getInteractions']);router['get']('/:id/users',auth[_0xd911('0xa')](),controller['getAgents']);router[_0xd911('0x13')]('/',auth[_0xd911('0xa')](),controller[_0xd911('0x14')]);router[_0xd911('0x13')](_0xd911('0xd'),auth[_0xd911('0xa')](),controller[_0xd911('0x15')]);router[_0xd911('0x13')](_0xd911('0xf'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xd911('0x13')](_0xd911('0x16'),controller[_0xd911('0x17')]);router[_0xd911('0x13')](_0xd911('0x10'),auth[_0xd911('0xa')](),controller['addApplications']);router[_0xd911('0x13')]('/:id/users',auth[_0xd911('0xa')](),controller[_0xd911('0x18')]);router[_0xd911('0x13')](_0xd911('0x19'),auth[_0xd911('0xa')](),controller[_0xd911('0x1a')]);router['put'](_0xd911('0xc'),auth[_0xd911('0xa')](),controller[_0xd911('0x1b')]);router['delete']('/:id',auth[_0xd911('0xa')](),controller['destroy']);router[_0xd911('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xd911('0x1c')](_0xd911('0xf'),auth[_0xd911('0xa')](),controller[_0xd911('0x1d')]);router[_0xd911('0x1c')](_0xd911('0x1e'),auth[_0xd911('0xa')](),controller[_0xd911('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 484724d..8d1d031 100644 --- a/server/api/openchannelAccount/openchannelAccount.attributes.js +++ b/server/api/openchannelAccount/openchannelAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8ae=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','randomstring','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0xa84eb1,_0x3b682f){var _0x3c3df9=function(_0x5befa5){while(--_0x5befa5){_0xa84eb1['push'](_0xa84eb1['shift']());}};_0x3c3df9(++_0x3b682f);}(_0xf8ae,0x180));var _0xef8a=function(_0x47c1f4,_0x4847a5){_0x47c1f4=_0x47c1f4-0x0;var _0x3e17b3=_0xf8ae[_0x47c1f4];return _0x3e17b3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xef8a('0x0'));module[_0xef8a('0x1')]={'name':{'type':Sequelize[_0xef8a('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xef8a('0x2')],'defaultValue':function(){return rs[_0xef8a('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xef8a('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xef8a('0x4')],'defaultValue':function(){return _0xef8a('0x5');}},'notificationSound':{'type':Sequelize[_0xef8a('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xef8a('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xef8a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xef8a('0x2')]},'queueTransfer':{'type':Sequelize[_0xef8a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xef8a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef8a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef8a('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xef8a('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x46cfb9){if(!_0x46cfb9)this[_0xef8a('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x46cfb9);}}}; \ No newline at end of file +var _0xdbe0=['sequelize','exports','STRING','name','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x5a1c55,_0x25c9ca){var _0xa3ce=function(_0x2da888){while(--_0x2da888){_0x5a1c55['push'](_0x5a1c55['shift']());}};_0xa3ce(++_0x25c9ca);}(_0xdbe0,0x1a2));var _0x0dbe=function(_0x4d6d86,_0x290fe5){_0x4d6d86=_0x4d6d86-0x0;var _0xbb94f7=_0xdbe0[_0x4d6d86];return _0xbb94f7;};'use strict';var Sequelize=require(_0x0dbe('0x0'));var rs=require('randomstring');module[_0x0dbe('0x1')]={'name':{'type':Sequelize[_0x0dbe('0x2')],'unique':_0x0dbe('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0dbe('0x2')]},'token':{'type':Sequelize[_0x0dbe('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x0dbe('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0dbe('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0dbe('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0dbe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0dbe('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0dbe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0dbe('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0dbe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0dbe('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0dbe('0x5')],'defaultValue':![],'comment':_0x0dbe('0x7'),'set':function(_0x5de2b3){if(!_0x5de2b3)this[_0x0dbe('0x8')](_0x0dbe('0x9'),null);this[_0x0dbe('0x8')](_0x0dbe('0xa'),_0x5de2b3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0bff718..7ed5f1b 100644 --- a/server/api/openchannelAccount/openchannelAccount.controller.js +++ b/server/api/openchannelAccount/openchannelAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb0=['ValidationError','request','info','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','offset','limit','Content-Range','save','then','destroy','get','UserProfileResource','end','sendStatus','stack','name','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','mandatoryDispositionPause','attributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','Disposition','hasOwnProperty','OpenchannelAccountId','count','removeDispositions','addAnswer','CannedAnswer','nolimit','order','removeAnswers','notify','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','Applications','List','account','applications','list','orderBy','priority','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','update','interaction','created','autoclose','unmanaged','OpenchannelMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','ids','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','send','DESC','out','Messages','dataValues','push','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','test'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1cb0,0x154));var _0x01cb=function(_0x29c1c0,_0x4b9049){_0x29c1c0=_0x29c1c0-0x0;var _0x31f4ac=_0x1cb0[_0x29c1c0];return _0x31f4ac;};'use strict';var pdf=require(_0x01cb('0x0'));var emlformat=require(_0x01cb('0x1'));var rimraf=require(_0x01cb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01cb('0x3'));var rp=require(_0x01cb('0x4'));var moment=require(_0x01cb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x01cb('0x6'));var path=require('path');var sox=require(_0x01cb('0x7'));var csv=require(_0x01cb('0x8'));var ejs=require(_0x01cb('0x9'));var fs=require('fs');var _=require(_0x01cb('0xa'));var squel=require(_0x01cb('0xb'));var crypto=require('crypto');var jsforce=require(_0x01cb('0xc'));var deskjs=require(_0x01cb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x01cb('0xe'));var Papa=require('papaparse');var Redis=require(_0x01cb('0xf'));var authService=require(_0x01cb('0x10'));var qs=require(_0x01cb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01cb('0x12'));var logger=require(_0x01cb('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x01cb('0x14'));var db=require(_0x01cb('0x15'))['db'];config[_0x01cb('0x16')]=_[_0x01cb('0x17')](config[_0x01cb('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x01cb('0x18'))(new Redis(config[_0x01cb('0x16')]));require(_0x01cb('0x19'))[_0x01cb('0x1a')](socket);var jayson=require(_0x01cb('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x01cb('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x401b4,_0x491087,_0x12caec){if(_0x12caec){var _0x727d4a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x727d4a[_0x01cb('0x1d')](_0x491087)){return _0x401b4;}else{throw new db['Sequelize'][(_0x01cb('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x401b4;}}function respondWithRpcPromise(_0x17c9bb,_0x5be829,_0x1e7f3d,_0x259437){return new BPromise(function(_0x29d0fd,_0x3d5f17){var _0x65e6=_0x259437||client;return _0x65e6[_0x01cb('0x1f')](_0x17c9bb,_0x1e7f3d)['then'](function(_0x558ad3){logger[_0x01cb('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x5be829,_0x01cb('0x21'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5be829,'request\x20sent',JSON[_0x01cb('0x22')](_0x558ad3));if(_0x558ad3[_0x01cb('0x23')]){if(_0x558ad3['error'][_0x01cb('0x24')]===0x1f4){logger['error'](_0x01cb('0x25'),_0x5be829,_0x558ad3['error'][_0x01cb('0x26')]);return _0x3d5f17(_0x558ad3[_0x01cb('0x23')]['message']);}logger[_0x01cb('0x23')](_0x01cb('0x25'),_0x5be829,_0x558ad3[_0x01cb('0x23')][_0x01cb('0x26')]);return _0x29d0fd(_0x558ad3[_0x01cb('0x23')][_0x01cb('0x26')]);}else{logger[_0x01cb('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x5be829,_0x01cb('0x21'));_0x29d0fd(_0x558ad3[_0x01cb('0x27')][_0x01cb('0x26')]);}})[_0x01cb('0x28')](function(_0x126ca3){logger[_0x01cb('0x23')](_0x01cb('0x25'),_0x5be829,_0x126ca3);_0x3d5f17(_0x126ca3);});});}function respondWithStatusCode(_0x16fae4,_0x2db03a){_0x2db03a=_0x2db03a||0xcc;return function(_0x5ccd48){if(_0x5ccd48){return _0x16fae4['sendStatus'](_0x2db03a);}return _0x16fae4[_0x01cb('0x29')](_0x2db03a)['end']();};}function respondWithResult(_0x516e3e,_0x173362){_0x173362=_0x173362||0xc8;return function(_0x31e464){if(_0x31e464){return _0x516e3e[_0x01cb('0x29')](_0x173362)['json'](_0x31e464);}};}function respondWithFilteredResult(_0x56c50e,_0x316925){return function(_0x448bb8){if(_0x448bb8){var _0x129881=_0x448bb8['count'],_0x53ffa0=_0x316925[_0x01cb('0x2a')],_0x2a3649=_0x316925['offset']+_0x316925[_0x01cb('0x2b')],_0x4c2a09;if(_0x2a3649>=_0x129881){_0x2a3649=_0x129881;_0x4c2a09=0xc8;}else{_0x4c2a09=0xce;}_0x56c50e['status'](_0x4c2a09);return _0x56c50e['set'](_0x01cb('0x2c'),_0x53ffa0+'-'+_0x2a3649+'/'+_0x129881)['json'](_0x448bb8);}return null;};}function patchUpdates(_0x5610cc){return function(_0x22f6c6){try{jsonpatch['apply'](_0x22f6c6,_0x5610cc,!![]);}catch(_0x4167b){return BPromise['reject'](_0x4167b);}return _0x22f6c6[_0x01cb('0x2d')]();};}function saveUpdates(_0x3f0efb,_0x524202){return function(_0x2ba09e){if(_0x2ba09e){return _0x2ba09e['update'](_0x3f0efb)[_0x01cb('0x2e')](function(_0x102180){return _0x102180;});}return null;};}function removeEntity(_0x611542,_0x35644b){return function(_0x34c4b8){if(_0x34c4b8){return _0x34c4b8[_0x01cb('0x2f')]()[_0x01cb('0x2e')](function(){var _0x1f050b=_0x34c4b8[_0x01cb('0x30')]({'plain':!![]});var _0x4e3cec='OpenchannelAccounts';return db[_0x01cb('0x31')][_0x01cb('0x2f')]({'where':{'type':_0x4e3cec,'resourceId':_0x1f050b['id']}})['then'](function(){return _0x34c4b8;});})[_0x01cb('0x2e')](function(){_0x611542['status'](0xcc)[_0x01cb('0x32')]();});}};}function handleEntityNotFound(_0x4d60c4,_0x1b3e96){return function(_0x11940b){if(!_0x11940b){_0x4d60c4[_0x01cb('0x33')](0x194);}return _0x11940b;};}function handleError(_0x4557b3,_0x376e3b){_0x376e3b=_0x376e3b||0x1f4;return function(_0x111084){logger[_0x01cb('0x23')](_0x111084[_0x01cb('0x34')]);if(_0x111084['name']){delete _0x111084[_0x01cb('0x35')];}_0x4557b3[_0x01cb('0x29')](_0x376e3b)['send'](_0x111084);};}exports[_0x01cb('0x36')]=function(_0x3684cd,_0x29ccec){var _0x2a657a={'include':[{'model':db[_0x01cb('0x37')],'as':'mandatoryDispositionPause'}]},_0x59e197={},_0x3c3a58={'count':0x0,'rows':[]};var _0x41aa33=_[_0x01cb('0x38')](db[_0x01cb('0x39')][_0x01cb('0x3a')],function(_0x2f8815){return{'name':_0x2f8815[_0x01cb('0x3b')],'type':_0x2f8815[_0x01cb('0x3c')][_0x01cb('0x3d')]};});_0x59e197[_0x01cb('0x3e')]=_['map'](_0x41aa33,_0x01cb('0x35'));_0x59e197[_0x01cb('0x3f')]=_[_0x01cb('0x40')](_0x3684cd['query']);_0x59e197['filters']=_[_0x01cb('0x41')](_0x59e197['model'],_0x59e197['query']);_0x2a657a['attributes']=_['intersection'](_0x59e197[_0x01cb('0x3e')],qs[_0x01cb('0x42')](_0x3684cd[_0x01cb('0x3f')][_0x01cb('0x42')]));_0x2a657a['attributes']=_0x2a657a['attributes']['length']?_0x2a657a['attributes']:_0x59e197[_0x01cb('0x3e')];if(!_0x3684cd[_0x01cb('0x3f')]['hasOwnProperty']('nolimit')){_0x2a657a[_0x01cb('0x2b')]=qs['limit'](_0x3684cd['query'][_0x01cb('0x2b')]);_0x2a657a['offset']=qs[_0x01cb('0x2a')](_0x3684cd[_0x01cb('0x3f')][_0x01cb('0x2a')]);}_0x2a657a['order']=qs['sort'](_0x3684cd[_0x01cb('0x3f')][_0x01cb('0x43')]);_0x2a657a[_0x01cb('0x44')]=qs[_0x01cb('0x45')](_[_0x01cb('0x46')](_0x3684cd[_0x01cb('0x3f')],_0x59e197['filters']));if(_0x3684cd[_0x01cb('0x3f')][_0x01cb('0x47')]){_0x2a657a[_0x01cb('0x44')]=_[_0x01cb('0x48')](_0x2a657a[_0x01cb('0x44')],{'$or':_[_0x01cb('0x38')](_0x41aa33,function(_0x5732f1){if(_0x5732f1[_0x01cb('0x3c')]!==_0x01cb('0x49')){var _0x4c7f66={};_0x4c7f66[_0x5732f1[_0x01cb('0x35')]]={'$like':'%'+_0x3684cd[_0x01cb('0x3f')][_0x01cb('0x47')]+'%'};return _0x4c7f66;}})});}_0x2a657a=_['merge']({},_0x2a657a,_0x3684cd[_0x01cb('0x4a')]);var _0x33f4a9={'where':_0x2a657a[_0x01cb('0x44')]};return db['OpenchannelAccount']['count'](_0x33f4a9)['then'](function(_0x2e5c39){_0x3c3a58['count']=_0x2e5c39;if(_0x3684cd['query']['includeAll']){_0x2a657a[_0x01cb('0x4b')]=[{'all':!![]}];}return db[_0x01cb('0x39')][_0x01cb('0x4c')](_0x2a657a);})['then'](function(_0x1d6f32){_0x3c3a58[_0x01cb('0x4d')]=_0x1d6f32;return _0x3c3a58;})[_0x01cb('0x2e')](respondWithFilteredResult(_0x29ccec,_0x2a657a))[_0x01cb('0x28')](handleError(_0x29ccec,null));};exports[_0x01cb('0x4e')]=function(_0x4a2453,_0x27941e){var _0x242e4f={'raw':![],'where':{'id':_0x4a2453[_0x01cb('0x4f')]['id']},'include':[{'model':db[_0x01cb('0x37')],'as':_0x01cb('0x50')}]},_0xd38c9={};_0xd38c9[_0x01cb('0x3e')]=_[_0x01cb('0x40')](db['OpenchannelAccount'][_0x01cb('0x3a')]);_0xd38c9['query']=_['keys'](_0x4a2453[_0x01cb('0x3f')]);_0xd38c9['filters']=_['intersection'](_0xd38c9[_0x01cb('0x3e')],_0xd38c9['query']);_0x242e4f[_0x01cb('0x51')]=_['intersection'](_0xd38c9[_0x01cb('0x3e')],qs[_0x01cb('0x42')](_0x4a2453[_0x01cb('0x3f')][_0x01cb('0x42')]));_0x242e4f['attributes']=_0x242e4f[_0x01cb('0x51')][_0x01cb('0x52')]?_0x242e4f['attributes']:_0xd38c9['model'];if(_0x4a2453['query'][_0x01cb('0x53')]){_0x242e4f[_0x01cb('0x4b')]=[{'all':!![]}];}_0x242e4f=_[_0x01cb('0x48')]({},_0x242e4f,_0x4a2453[_0x01cb('0x4a')]);return db[_0x01cb('0x39')][_0x01cb('0x54')](_0x242e4f)['then'](handleEntityNotFound(_0x27941e,null))[_0x01cb('0x2e')](respondWithResult(_0x27941e,null))['catch'](handleError(_0x27941e,null));};exports[_0x01cb('0x55')]=function(_0x27e2b9,_0x947975){return db[_0x01cb('0x39')][_0x01cb('0x55')](_0x27e2b9[_0x01cb('0x56')],{})['then'](function(_0x33ab6a){var _0x4fab36=_0x27e2b9[_0x01cb('0x57')][_0x01cb('0x30')]({'plain':!![]});if(!_0x4fab36)throw new Error(_0x01cb('0x58'));if(_0x4fab36[_0x01cb('0x59')]==='user'){var _0x18ea3a=_0x33ab6a['get']({'plain':!![]});var _0x1537e0=_0x01cb('0x5a');return db[_0x01cb('0x5b')]['find']({'where':{'name':_0x1537e0,'userProfileId':_0x4fab36[_0x01cb('0x5c')]},'raw':!![]})[_0x01cb('0x2e')](function(_0x43b4d6){if(_0x43b4d6&&_0x43b4d6[_0x01cb('0x5d')]===0x0){return db['UserProfileResource'][_0x01cb('0x55')]({'name':_0x18ea3a[_0x01cb('0x35')],'resourceId':_0x18ea3a['id'],'type':_0x43b4d6[_0x01cb('0x35')],'sectionId':_0x43b4d6['id']},{})[_0x01cb('0x2e')](function(){return _0x33ab6a;});}else{return _0x33ab6a;}})[_0x01cb('0x28')](function(_0x419086){logger[_0x01cb('0x23')](_0x01cb('0x5e'),_0x419086);throw _0x419086;});}return _0x33ab6a;})[_0x01cb('0x2e')](respondWithResult(_0x947975,0xc9))['catch'](handleError(_0x947975,null));};exports['update']=function(_0x18c8d7,_0x5af608){if(_0x18c8d7[_0x01cb('0x56')]['id']){delete _0x18c8d7[_0x01cb('0x56')]['id'];}return db[_0x01cb('0x39')][_0x01cb('0x54')]({'where':{'id':_0x18c8d7['params']['id']},'include':[{'model':db[_0x01cb('0x37')],'as':_0x01cb('0x50')}]})[_0x01cb('0x2e')](handleEntityNotFound(_0x5af608,null))[_0x01cb('0x2e')](saveUpdates(_0x18c8d7[_0x01cb('0x56')],null))[_0x01cb('0x2e')](respondWithResult(_0x5af608,null))[_0x01cb('0x28')](handleError(_0x5af608,null));};exports[_0x01cb('0x2f')]=function(_0x29edd6,_0x2ce96b){return db[_0x01cb('0x39')][_0x01cb('0x54')]({'where':{'id':_0x29edd6[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x2ce96b,null))[_0x01cb('0x2e')](removeEntity(_0x2ce96b,null))[_0x01cb('0x28')](handleError(_0x2ce96b,null));};exports[_0x01cb('0x5f')]=function(_0x400ebd,_0x169d5b){return db[_0x01cb('0x39')][_0x01cb('0x5f')]()[_0x01cb('0x2e')](respondWithResult(_0x169d5b,null))[_0x01cb('0x28')](handleError(_0x169d5b,null));};exports['addDisposition']=function(_0x55a29b,_0x205f23,_0xe100dc){if(_0x55a29b['body']['id']){delete _0x55a29b['body']['id'];}return db[_0x01cb('0x39')]['find']({'where':{'id':_0x55a29b[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x205f23,null))['then'](function(_0x3098a5){if(_0x3098a5){_0x55a29b['body']['OpnechannelAccountId']=_0x3098a5['id'];return db['Disposition'][_0x01cb('0x55')](_0x55a29b[_0x01cb('0x56')]);}})[_0x01cb('0x2e')](respondWithResult(_0x205f23,null))[_0x01cb('0x28')](handleError(_0x205f23,null));};exports['getDispositions']=function(_0x3d83f0,_0x46a1f3,_0x16b3c0){var _0x4b8131={'raw':![],'where':{}};var _0x5ae1b7={};var _0x36a864={'count':0x0,'rows':[]};return db[_0x01cb('0x39')][_0x01cb('0x60')]({'where':{'id':_0x3d83f0[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x46a1f3,null))[_0x01cb('0x2e')](function(_0x20cd64){if(_0x20cd64){_0x5ae1b7[_0x01cb('0x3e')]=_[_0x01cb('0x40')](db[_0x01cb('0x61')][_0x01cb('0x3a')]);_0x5ae1b7['query']=_[_0x01cb('0x40')](_0x3d83f0[_0x01cb('0x3f')]);_0x5ae1b7[_0x01cb('0x45')]=_[_0x01cb('0x41')](_0x5ae1b7['model'],_0x5ae1b7['query']);_0x4b8131['attributes']=_[_0x01cb('0x41')](_0x5ae1b7[_0x01cb('0x3e')],qs[_0x01cb('0x42')](_0x3d83f0[_0x01cb('0x3f')][_0x01cb('0x42')]));_0x4b8131[_0x01cb('0x51')]=_0x4b8131[_0x01cb('0x51')][_0x01cb('0x52')]?_0x4b8131[_0x01cb('0x51')]:_0x5ae1b7['model'];if(!_0x3d83f0[_0x01cb('0x3f')][_0x01cb('0x62')]('nolimit')){_0x4b8131[_0x01cb('0x2b')]=qs[_0x01cb('0x2b')](_0x3d83f0['query'][_0x01cb('0x2b')]);_0x4b8131[_0x01cb('0x2a')]=qs[_0x01cb('0x2a')](_0x3d83f0[_0x01cb('0x3f')]['offset']);}_0x4b8131['order']=qs[_0x01cb('0x43')](_0x3d83f0[_0x01cb('0x3f')]['sort']);_0x4b8131[_0x01cb('0x44')]=qs[_0x01cb('0x45')](_[_0x01cb('0x46')](_0x3d83f0['query'],_0x5ae1b7[_0x01cb('0x45')]));_0x4b8131[_0x01cb('0x44')][_0x01cb('0x63')]=_0x20cd64['id'];if(_0x3d83f0['query'][_0x01cb('0x47')]){_0x4b8131[_0x01cb('0x44')]=_[_0x01cb('0x48')](_0x4b8131['where'],{'$or':_[_0x01cb('0x38')](_0x4b8131[_0x01cb('0x51')],function(_0x128582){var _0x29d6d4={};_0x29d6d4[_0x128582]={'$like':'%'+_0x3d83f0[_0x01cb('0x3f')][_0x01cb('0x47')]+'%'};return _0x29d6d4;})});}_0x4b8131=_[_0x01cb('0x48')]({},_0x4b8131,_0x3d83f0[_0x01cb('0x4a')]);return db[_0x01cb('0x61')]['count']({'where':_0x4b8131['where']})[_0x01cb('0x2e')](function(_0x8c56cf){_0x36a864[_0x01cb('0x64')]=_0x8c56cf;if(_0x3d83f0[_0x01cb('0x3f')][_0x01cb('0x53')]){_0x4b8131[_0x01cb('0x4b')]=[{'all':!![]}];}return db[_0x01cb('0x61')]['findAll'](_0x4b8131);})['then'](function(_0x5e0e1a){_0x36a864['rows']=_0x5e0e1a;return _0x36a864;});}})[_0x01cb('0x2e')](respondWithFilteredResult(_0x46a1f3,_0x4b8131))[_0x01cb('0x28')](handleError(_0x46a1f3,null));};exports[_0x01cb('0x65')]=function(_0x1d5209,_0x2d073c,_0x26feae){return db[_0x01cb('0x39')][_0x01cb('0x54')]({'where':{'id':_0x1d5209[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x2d073c,null))[_0x01cb('0x2e')](function(_0x2b4329){if(_0x2b4329){return _0x2b4329[_0x01cb('0x65')](_0x1d5209['query']['ids']);}})[_0x01cb('0x2e')](respondWithStatusCode(_0x2d073c,null))['catch'](handleError(_0x2d073c,null));};exports[_0x01cb('0x66')]=function(_0x25bed1,_0x20db6a,_0x3ed1db){if(_0x25bed1[_0x01cb('0x56')]['id']){delete _0x25bed1['body']['id'];}return db[_0x01cb('0x39')][_0x01cb('0x54')]({'where':{'id':_0x25bed1[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x20db6a,null))['then'](function(_0x55d19d){if(_0x55d19d){_0x25bed1['body'][_0x01cb('0x63')]=_0x55d19d['id'];return db[_0x01cb('0x67')][_0x01cb('0x55')](_0x25bed1[_0x01cb('0x56')]);}})[_0x01cb('0x2e')](respondWithResult(_0x20db6a,null))[_0x01cb('0x28')](handleError(_0x20db6a,null));};exports['getAnswers']=function(_0x3f7794,_0x330524,_0x3169e9){var _0x50b774={'raw':![],'where':{}};var _0x11540c={};var _0x217c70={'count':0x0,'rows':[]};return db[_0x01cb('0x39')]['findOne']({'where':{'id':_0x3f7794['params']['id']}})['then'](handleEntityNotFound(_0x330524,null))[_0x01cb('0x2e')](function(_0x144f78){if(_0x144f78){_0x11540c[_0x01cb('0x3e')]=_[_0x01cb('0x40')](db[_0x01cb('0x67')][_0x01cb('0x3a')]);_0x11540c[_0x01cb('0x3f')]=_[_0x01cb('0x40')](_0x3f7794[_0x01cb('0x3f')]);_0x11540c['filters']=_[_0x01cb('0x41')](_0x11540c[_0x01cb('0x3e')],_0x11540c[_0x01cb('0x3f')]);_0x50b774[_0x01cb('0x51')]=_[_0x01cb('0x41')](_0x11540c[_0x01cb('0x3e')],qs[_0x01cb('0x42')](_0x3f7794[_0x01cb('0x3f')][_0x01cb('0x42')]));_0x50b774[_0x01cb('0x51')]=_0x50b774['attributes']['length']?_0x50b774[_0x01cb('0x51')]:_0x11540c[_0x01cb('0x3e')];if(!_0x3f7794[_0x01cb('0x3f')][_0x01cb('0x62')](_0x01cb('0x68'))){_0x50b774[_0x01cb('0x2b')]=qs['limit'](_0x3f7794['query']['limit']);_0x50b774[_0x01cb('0x2a')]=qs['offset'](_0x3f7794[_0x01cb('0x3f')]['offset']);}_0x50b774[_0x01cb('0x69')]=qs[_0x01cb('0x43')](_0x3f7794[_0x01cb('0x3f')][_0x01cb('0x43')]);_0x50b774[_0x01cb('0x44')]=qs[_0x01cb('0x45')](_[_0x01cb('0x46')](_0x3f7794['query'],_0x11540c[_0x01cb('0x45')]));_0x50b774[_0x01cb('0x44')][_0x01cb('0x63')]=_0x144f78['id'];if(_0x3f7794[_0x01cb('0x3f')][_0x01cb('0x47')]){_0x50b774[_0x01cb('0x44')]=_['merge'](_0x50b774[_0x01cb('0x44')],{'$or':_[_0x01cb('0x38')](_0x50b774['attributes'],function(_0x4e20ca){var _0x4577c0={};_0x4577c0[_0x4e20ca]={'$like':'%'+_0x3f7794['query'][_0x01cb('0x47')]+'%'};return _0x4577c0;})});}_0x50b774=_[_0x01cb('0x48')]({},_0x50b774,_0x3f7794[_0x01cb('0x4a')]);return db[_0x01cb('0x67')][_0x01cb('0x64')]({'where':_0x50b774['where']})[_0x01cb('0x2e')](function(_0xf71296){_0x217c70['count']=_0xf71296;if(_0x3f7794['query'][_0x01cb('0x53')]){_0x50b774[_0x01cb('0x4b')]=[{'all':!![]}];}return db[_0x01cb('0x67')][_0x01cb('0x4c')](_0x50b774);})[_0x01cb('0x2e')](function(_0x3e60b6){_0x217c70[_0x01cb('0x4d')]=_0x3e60b6;return _0x217c70;});}})[_0x01cb('0x2e')](respondWithFilteredResult(_0x330524,_0x50b774))[_0x01cb('0x28')](handleError(_0x330524,null));};exports['removeAnswers']=function(_0x1f29ef,_0x4795da,_0x5a038a){return db[_0x01cb('0x39')][_0x01cb('0x54')]({'where':{'id':_0x1f29ef[_0x01cb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4795da,null))[_0x01cb('0x2e')](function(_0x4d157c){if(_0x4d157c){return _0x4d157c[_0x01cb('0x6a')](_0x1f29ef[_0x01cb('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0x4795da,null))[_0x01cb('0x28')](handleError(_0x4795da,null));};exports[_0x01cb('0x6b')]=function(_0x32121f,_0x1bcfcd,_0x211ba3){var _0x315cbc={'body':_0x32121f[_0x01cb('0x56')],'channel':'openchannel'};var _0x2e7e50=[];var _0x7eddcf=[];var _0x32ed85={};var _0x16e093=![];return db['CmContact']['describe']()['then'](function(_0x268f56){if(!_0x268f56){throw new db['Sequelize']['ValidationError'](_0x01cb('0x6c'));}_0x2e7e50=_['difference'](_[_0x01cb('0x40')](_0x268f56),['createdAt',_0x01cb('0x6d')]);_0x7eddcf=_[_0x01cb('0x6e')](_[_0x01cb('0x40')](_0x268f56),[_0x01cb('0x6f'),'updatedAt',_0x01cb('0x70'),'ListId']);if(_0x32121f['body']['id']){delete _0x32121f[_0x01cb('0x56')]['id'];}if(_[_0x01cb('0x71')](_0x32121f[_0x01cb('0x56')][_0x01cb('0x72')])){throw new db[(_0x01cb('0x73'))][(_0x01cb('0x1e'))](_0x01cb('0x74'));}if(_[_0x01cb('0x71')](_0x32121f['body'][_0x01cb('0x56')])||_0x32121f['body'][_0x01cb('0x56')]===''){throw new db[(_0x01cb('0x73'))][(_0x01cb('0x1e'))](_0x01cb('0x75'));}if(_['isNil'](_0x32121f[_0x01cb('0x56')][_0x01cb('0x76')])){throw new db[(_0x01cb('0x73'))][(_0x01cb('0x1e'))](_0x01cb('0x77')+_0x7eddcf);}if(!_[_0x01cb('0x78')](_0x7eddcf,_0x32121f[_0x01cb('0x56')][_0x01cb('0x76')])){throw new db[(_0x01cb('0x73'))][(_0x01cb('0x1e'))](_0x01cb('0x79')+_0x7eddcf);}_0x32ed85[_0x32121f['body'][_0x01cb('0x76')]]=_0x32121f[_0x01cb('0x56')][_0x01cb('0x72')];})['then'](function(){return db['OpenchannelAccount'][_0x01cb('0x54')]({'where':{'id':_0x32121f[_0x01cb('0x4f')]['id']},'include':[{'model':db[_0x01cb('0x7a')],'as':'List','include':[{'model':db[_0x01cb('0x7b')],'as':_0x01cb('0x7c'),'where':_0x32ed85,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x01cb('0x7d')}]});})[_0x01cb('0x2e')](handleEntityNotFound(_0x1bcfcd,null))['then'](function(_0xca7dce){if(_0xca7dce&&_0xca7dce[_0x01cb('0x7e')]){_0x315cbc[_0x01cb('0x7f')]=_0xca7dce;_0x315cbc[_0x01cb('0x80')]=_0xca7dce[_0x01cb('0x7d')];_0x315cbc[_0x01cb('0x81')]=_0xca7dce[_0x01cb('0x7e')];_0x315cbc[_0x01cb('0x80')]=_[_0x01cb('0x82')](_0x315cbc[_0x01cb('0x80')],[_0x01cb('0x83')],['asc']);if(_0x315cbc[_0x01cb('0x7f')][_0x01cb('0x7d')]){delete _0x315cbc[_0x01cb('0x7f')][_0x01cb('0x7d')];}if(_0x315cbc[_0x01cb('0x7f')]['List']&&_0x315cbc[_0x01cb('0x7f')][_0x01cb('0x7e')][_0x01cb('0x7c')][_0x01cb('0x52')]){return _0x315cbc[_0x01cb('0x7f')][_0x01cb('0x7e')][_0x01cb('0x7c')][0x0];}var _0x8c9b1c=_[_0x01cb('0x17')](_0x32121f['body'],{'firstName':_0x32121f[_0x01cb('0x56')][_0x01cb('0x72')],'ListId':_0xca7dce[_0x01cb('0x84')]});_0x8c9b1c[_0x32121f[_0x01cb('0x56')][_0x01cb('0x76')]]=_0x32121f[_0x01cb('0x56')][_0x01cb('0x72')];return db[_0x01cb('0x7b')][_0x01cb('0x55')](_0x8c9b1c,{'fields':_0x2e7e50,'raw':!![]});}})[_0x01cb('0x2e')](handleEntityNotFound(_0x1bcfcd,null))[_0x01cb('0x2e')](function(_0x404375){_0x315cbc[_0x01cb('0x85')]=_0x404375;if(_0x404375){var _0xccfbde={'ContactId':_0x404375['id'],'OpenchannelAccountId':_0x32121f[_0x01cb('0x4f')]['id'],'from':(_0x404375[_0x01cb('0x86')]||'')+'\x20'+(_0x404375[_0x01cb('0x87')]||'')};var _0xca4efb={'OpenchannelAccountId':_0x32121f[_0x01cb('0x4f')]['id'],'closed':![]};if(_0x32121f['body'][_0x01cb('0x88')]){_0xca4efb[_0x01cb('0x88')]=_0x32121f[_0x01cb('0x56')]['threadId'];return db[_0x01cb('0x89')][_0x01cb('0x54')]({'where':_0xca4efb})['then'](function(_0x3514e7){if(_0x3514e7){return[_0x3514e7,![]];}_0xccfbde[_0x01cb('0x88')]=_0x32121f['body'][_0x01cb('0x88')];_0xccfbde[_0x01cb('0x8a')]=_0x32121f[_0x01cb('0x56')][_0x01cb('0x8a')];return db['OpenchannelInteraction'][_0x01cb('0x55')](_0xccfbde)[_0x01cb('0x2e')](function(_0x338ce4){return[_0x338ce4,!![]];});});}else{_0xca4efb[_0x01cb('0x88')]=null;}_0xca4efb[_0x01cb('0x8b')]=_0x404375['id'];return db[_0x01cb('0x89')][_0x01cb('0x54')]({'where':_0xca4efb})[_0x01cb('0x2e')](function(_0x5d3625){if(_0x5d3625){return[_0x5d3625,![]];}return db[_0x01cb('0x89')][_0x01cb('0x55')](_0xccfbde)[_0x01cb('0x2e')](function(_0x544a93){return[_0x544a93,!![]];});});}})[_0x01cb('0x8c')](function(_0x1efb06,_0x551e66){if(_0x1efb06){_0x16e093=_0x551e66;if(!_0x551e66){var _0x1a6a77={'from':(_0x315cbc[_0x01cb('0x85')][_0x01cb('0x86')]||'')+'\x20'+(_0x315cbc[_0x01cb('0x85')][_0x01cb('0x87')]||'')};if(_0x32121f[_0x01cb('0x56')]['threadId']&&_0x32121f[_0x01cb('0x56')]['messageId']&&_0x32121f[_0x01cb('0x56')]['threadId']!=_0x32121f[_0x01cb('0x56')][_0x01cb('0x8d')]){_0x1a6a77[_0x01cb('0x88')]=_0x32121f[_0x01cb('0x56')]['messageId'];}return _0x1efb06[_0x01cb('0x8e')](_0x1a6a77);}else{return _0x1efb06;}}})[_0x01cb('0x2e')](function(_0x31ec0f){_0x315cbc[_0x01cb('0x8f')]=_0x31ec0f[_0x01cb('0x30')]({'plain':!![]});_0x315cbc[_0x01cb('0x8f')]['created']=_0x16e093;if(_0x315cbc[_0x01cb('0x8f')][_0x01cb('0x90')]){if(_0x315cbc[_0x01cb('0x7f')][_0x01cb('0x91')]){_0x315cbc[_0x01cb('0x80')]['push']({'id':0x0,'priority':_0x315cbc[_0x01cb('0x80')][_0x01cb('0x52')]+0x1,'app':'close','appdata':_0x01cb('0x92'),'interval':'*,*,*,*'});}}return db[_0x01cb('0x93')][_0x01cb('0x55')]({'body':_0x32121f[_0x01cb('0x56')]['body'],'OpenchannelAccountId':_0x32121f[_0x01cb('0x4f')]['id'],'OpenchannelInteractionId':_0x31ec0f['id'],'direction':'in','ContactId':_0x315cbc[_0x01cb('0x85')]['id'],'AttachmentId':_0x32121f[_0x01cb('0x56')][_0x01cb('0x94')]});})[_0x01cb('0x2e')](function(_0x8c7adf){_0x315cbc[_0x01cb('0x26')]=_0x8c7adf;if(_0x315cbc[_0x01cb('0x8f')]['UserId']){return db[_0x01cb('0x95')][_0x01cb('0x54')]({'attributes':['id',_0x01cb('0x35')],'where':{'id':_0x315cbc[_0x01cb('0x8f')][_0x01cb('0x96')]}})[_0x01cb('0x2e')](function(_0x38b9c9){if(_0x38b9c9){_0x315cbc[_0x01cb('0x80')]['unshift']({'id':0x0,'priority':0x0,'app':_0x01cb('0x97'),'appdata':_0x38b9c9[_0x01cb('0x35')]+','+(_0x315cbc[_0x01cb('0x7f')][_0x01cb('0x98')]||0xa),'interval':'*,*,*,*'});_0x315cbc['forcedOwnership']=![];}return respondWithRpcPromise(_0x01cb('0x99'),'startRouting',_0x315cbc);});}return respondWithRpcPromise('Start',_0x01cb('0x9a'),_0x315cbc);})['then'](function(_0x5995f8){respondWithRpcPromise(_0x01cb('0x9b'),_0x01cb('0x9b'),{'event':_0x01cb('0x6b'),'message':_0x5995f8},client9002);return _0x5995f8;})[_0x01cb('0x2e')](respondWithResult(_0x1bcfcd,null))[_0x01cb('0x28')](handleError(_0x1bcfcd,null));};exports[_0x01cb('0x9c')]=function(_0x4aee4f,_0x5cec70,_0x164784){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4aee4f[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x5cec70,null))[_0x01cb('0x2e')](function(_0x53781b){if(_0x53781b){return db[_0x01cb('0x9d')][_0x01cb('0x9e')](function(_0x338d5b){return db[_0x01cb('0x9f')]['destroy']({'where':{'OpenchannelAccountId':_0x4aee4f[_0x01cb('0x4f')]['id']},'transaction':_0x338d5b})[_0x01cb('0x2e')](function(_0x50f250){var _0x518aa5=_['map'](_0x4aee4f[_0x01cb('0x56')],function(_0x4f8d78){_0x4f8d78[_0x01cb('0x63')]=_0x4aee4f[_0x01cb('0x4f')]['id'];return _0x4f8d78;});return db[_0x01cb('0x9f')][_0x01cb('0xa0')](_0x518aa5,{'transaction':_0x338d5b});});})[_0x01cb('0x2e')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x4aee4f[_0x01cb('0x4f')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x5cec70,null))[_0x01cb('0x28')](handleError(_0x5cec70,null));};exports[_0x01cb('0xa1')]=function(_0x25b17f,_0x4b1ce6,_0xf61b69){var _0x269f91={};var _0x50a2ab={};var _0x563ba9;var _0x39e4e5;return db[_0x01cb('0x39')][_0x01cb('0x60')]({'where':{'id':_0x25b17f['params']['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x4b1ce6,null))[_0x01cb('0x2e')](function(_0x2d4ab4){if(_0x2d4ab4){_0x563ba9=_0x2d4ab4;_0x50a2ab[_0x01cb('0x3e')]=_[_0x01cb('0x40')](db[_0x01cb('0x9f')][_0x01cb('0x3a')]);_0x50a2ab[_0x01cb('0x3f')]=_[_0x01cb('0x40')](_0x25b17f[_0x01cb('0x3f')]);_0x50a2ab['filters']=_[_0x01cb('0x41')](_0x50a2ab['model'],_0x50a2ab[_0x01cb('0x3f')]);_0x269f91['attributes']=_[_0x01cb('0x41')](_0x50a2ab[_0x01cb('0x3e')],qs[_0x01cb('0x42')](_0x25b17f[_0x01cb('0x3f')][_0x01cb('0x42')]));_0x269f91[_0x01cb('0x51')]=_0x269f91['attributes'][_0x01cb('0x52')]?_0x269f91[_0x01cb('0x51')]:_0x50a2ab[_0x01cb('0x3e')];_0x269f91['order']=qs[_0x01cb('0x43')](_0x25b17f['query'][_0x01cb('0x43')]);_0x269f91['where']=qs[_0x01cb('0x45')](_[_0x01cb('0x46')](_0x25b17f[_0x01cb('0x3f')],_0x50a2ab[_0x01cb('0x45')]));if(_0x25b17f[_0x01cb('0x3f')][_0x01cb('0x47')]){_0x269f91[_0x01cb('0x44')]=_['merge'](_0x269f91[_0x01cb('0x44')],{'$or':_['map'](_0x269f91[_0x01cb('0x51')],function(_0x423499){var _0xa0ad16={};_0xa0ad16[_0x423499]={'$like':'%'+_0x25b17f['query'][_0x01cb('0x47')]+'%'};return _0xa0ad16;})});}_0x269f91=_[_0x01cb('0x48')]({},_0x269f91,_0x25b17f[_0x01cb('0x4a')]);return _0x563ba9[_0x01cb('0xa1')](_0x269f91);}})[_0x01cb('0x2e')](function(_0x329700){if(_0x329700){_0x39e4e5=_0x329700[_0x01cb('0x52')];if(!_0x25b17f[_0x01cb('0x3f')][_0x01cb('0x62')](_0x01cb('0x68'))){_0x269f91[_0x01cb('0x2b')]=qs[_0x01cb('0x2b')](_0x25b17f['query'][_0x01cb('0x2b')]);_0x269f91[_0x01cb('0x2a')]=qs[_0x01cb('0x2a')](_0x25b17f[_0x01cb('0x3f')][_0x01cb('0x2a')]);}return _0x563ba9[_0x01cb('0xa1')](_0x269f91);}})[_0x01cb('0x2e')](function(_0x3c6f88){if(_0x3c6f88){return _0x3c6f88?{'count':_0x39e4e5,'rows':_0x3c6f88}:null;}})['then'](respondWithResult(_0x4b1ce6,null))['catch'](handleError(_0x4b1ce6,null));};exports[_0x01cb('0xa2')]=function(_0x56cf00,_0x33cfad,_0x5476a5){var _0x24a0bb={'raw':![],'where':{}};var _0x33a40b={};var _0x36c144={'count':0x0,'rows':[]};return db[_0x01cb('0x39')]['findOne']({'where':{'id':_0x56cf00['params']['id']}})['then'](handleEntityNotFound(_0x33cfad,null))[_0x01cb('0x2e')](function(_0xbb70f8){if(_0xbb70f8){_0x33a40b[_0x01cb('0x3e')]=_[_0x01cb('0x40')](db['OpenchannelInteraction'][_0x01cb('0x3a')]);_0x33a40b['query']=_[_0x01cb('0x40')](_0x56cf00[_0x01cb('0x3f')]);_0x33a40b[_0x01cb('0x45')]=_[_0x01cb('0x41')](_0x33a40b[_0x01cb('0x3e')],_0x33a40b['query']);_0x24a0bb['attributes']=_[_0x01cb('0x41')](_0x33a40b[_0x01cb('0x3e')],qs[_0x01cb('0x42')](_0x56cf00[_0x01cb('0x3f')][_0x01cb('0x42')]));_0x24a0bb[_0x01cb('0x51')]=_0x24a0bb[_0x01cb('0x51')][_0x01cb('0x52')]?_0x24a0bb[_0x01cb('0x51')]:_0x33a40b[_0x01cb('0x3e')];if(!_0x56cf00[_0x01cb('0x3f')][_0x01cb('0x62')]('nolimit')){_0x24a0bb[_0x01cb('0x2b')]=qs[_0x01cb('0x2b')](_0x56cf00['query'][_0x01cb('0x2b')]);_0x24a0bb[_0x01cb('0x2a')]=qs[_0x01cb('0x2a')](_0x56cf00['query'][_0x01cb('0x2a')]);}_0x24a0bb[_0x01cb('0x69')]=qs[_0x01cb('0x43')](_0x56cf00[_0x01cb('0x3f')][_0x01cb('0x43')]);_0x24a0bb[_0x01cb('0x44')]=qs[_0x01cb('0x45')](_[_0x01cb('0x46')](_0x56cf00[_0x01cb('0x3f')],_0x33a40b[_0x01cb('0x45')]));_0x24a0bb[_0x01cb('0x44')][_0x01cb('0x63')]=_0xbb70f8['id'];if(_0x56cf00[_0x01cb('0x3f')][_0x01cb('0x47')]){_0x24a0bb[_0x01cb('0x44')]=_[_0x01cb('0x48')](_0x24a0bb[_0x01cb('0x44')],{'$or':_[_0x01cb('0x38')](_0x24a0bb['attributes'],function(_0x2e77a0){var _0x2b29b7={};_0x2b29b7[_0x2e77a0]={'$like':'%'+_0x56cf00['query']['filter']+'%'};return _0x2b29b7;})});}_0x24a0bb=_['merge']({},_0x24a0bb,_0x56cf00['options']);return db[_0x01cb('0x89')]['count']({'where':_0x24a0bb[_0x01cb('0x44')]})[_0x01cb('0x2e')](function(_0x30e79e){_0x36c144[_0x01cb('0x64')]=_0x30e79e;if(_0x56cf00[_0x01cb('0x3f')][_0x01cb('0x53')]){_0x24a0bb['include']=[{'model':db[_0x01cb('0x7b')],'as':_0x01cb('0xa3'),'required':![]},{'model':db['User'],'as':_0x01cb('0xa4'),'attributes':['name',_0x01cb('0xa5'),_0x01cb('0xa6')],'required':![]},{'model':db['Tag'],'as':_0x01cb('0xa7'),'attributes':['id',_0x01cb('0x35'),_0x01cb('0xa8')],'where':_0x56cf00[_0x01cb('0x3f')][_0x01cb('0xa9')]?{'id':_0x56cf00[_0x01cb('0x3f')][_0x01cb('0xa9')]}:undefined,'required':_0x56cf00['query'][_0x01cb('0xa9')]?!![]:![]}];}return db[_0x01cb('0x89')]['findAll'](_0x24a0bb);})['then'](function(_0x3d1475){_0x36c144[_0x01cb('0x4d')]=_0x3d1475;return _0x36c144;});}})[_0x01cb('0x2e')](respondWithFilteredResult(_0x33cfad,_0x24a0bb))['catch'](handleError(_0x33cfad,null));};exports[_0x01cb('0xaa')]=function(_0x3f0cef,_0x20c8a5,_0x2c3649){return db['OpenchannelAccount'][_0x01cb('0x54')]({'where':{'id':_0x3f0cef[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x20c8a5,null))[_0x01cb('0x2e')](function(_0x4bc247){if(_0x4bc247){return _0x4bc247[_0x01cb('0xaa')](_0x3f0cef[_0x01cb('0x56')][_0x01cb('0xab')],_[_0x01cb('0xac')](_0x3f0cef[_0x01cb('0x56')],[_0x01cb('0xab'),'id'])||{})['spread'](function(_0x502b51){for(var _0x3c3840=0x0;_0x3c3840<_0x3f0cef[_0x01cb('0x56')][_0x01cb('0xab')]['length'];_0x3c3840+=0x1){socket['emit'](_0x01cb('0xad'),{'UserId':_0x3f0cef[_0x01cb('0x56')][_0x01cb('0xab')][_0x3c3840],'OpenchannelAccountId':_0x3f0cef[_0x01cb('0x4f')]['id']});}return _0x502b51;});}})['then'](respondWithResult(_0x20c8a5,null))[_0x01cb('0x28')](handleError(_0x20c8a5,null));};exports[_0x01cb('0xae')]=function(_0x29be65,_0x719298,_0x1b80b0){return db[_0x01cb('0x39')][_0x01cb('0x54')]({'where':{'id':_0x29be65[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x719298,null))[_0x01cb('0x2e')](function(_0x439ff0){if(_0x439ff0){return _0x439ff0['removeAgents'](_0x29be65[_0x01cb('0x3f')]['ids'])[_0x01cb('0x2e')](function(){if(_[_0x01cb('0xaf')](_0x29be65[_0x01cb('0x3f')]['ids'])){for(var _0x5eb740=0x0;_0x5eb740<_0x29be65[_0x01cb('0x3f')]['ids']['length'];_0x5eb740+=0x1){socket[_0x01cb('0xb0')](_0x01cb('0xb1'),{'UserId':Number(_0x29be65[_0x01cb('0x3f')][_0x01cb('0xab')][_0x5eb740]),'OpenchannelAccountId':Number(_0x29be65[_0x01cb('0x4f')]['id'])});}}else{socket['emit'](_0x01cb('0xb1'),{'UserId':Number(_0x29be65[_0x01cb('0x3f')][_0x01cb('0xab')]),'OpenchannelAccountId':Number(_0x29be65['params']['id'])});}});}})['then'](respondWithStatusCode(_0x719298,null))[_0x01cb('0x28')](handleError(_0x719298,null));};exports[_0x01cb('0xb2')]=function(_0x4cdc01,_0x475758,_0x5151f3){var _0x5dda57={};var _0x5558a6={};var _0x571f18;var _0x4aff84;return db[_0x01cb('0x39')]['findOne']({'where':{'id':_0x4cdc01[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x475758,null))[_0x01cb('0x2e')](function(_0x5d45eb){if(_0x5d45eb){_0x571f18=_0x5d45eb;_0x5558a6[_0x01cb('0x3e')]=_[_0x01cb('0x40')](db['User'][_0x01cb('0x3a')]);_0x5558a6[_0x01cb('0x3f')]=_[_0x01cb('0x40')](_0x4cdc01[_0x01cb('0x3f')]);_0x5558a6[_0x01cb('0x45')]=_[_0x01cb('0x41')](_0x5558a6[_0x01cb('0x3e')],_0x5558a6[_0x01cb('0x3f')]);_0x5dda57['attributes']=_[_0x01cb('0x41')](_0x5558a6[_0x01cb('0x3e')],qs[_0x01cb('0x42')](_0x4cdc01[_0x01cb('0x3f')][_0x01cb('0x42')]));_0x5dda57[_0x01cb('0x51')]=_0x5dda57[_0x01cb('0x51')][_0x01cb('0x52')]?_0x5dda57[_0x01cb('0x51')]:_0x5558a6[_0x01cb('0x3e')];_0x5dda57[_0x01cb('0x69')]=qs[_0x01cb('0x43')](_0x4cdc01[_0x01cb('0x3f')]['sort']);_0x5dda57[_0x01cb('0x44')]=qs[_0x01cb('0x45')](_[_0x01cb('0x46')](_0x4cdc01[_0x01cb('0x3f')],_0x5558a6[_0x01cb('0x45')]));if(_0x4cdc01['query'][_0x01cb('0x47')]){_0x5dda57[_0x01cb('0x44')]=_['merge'](_0x5dda57[_0x01cb('0x44')],{'$or':_[_0x01cb('0x38')](_0x5dda57[_0x01cb('0x51')],function(_0x2b99e8){var _0x58e4c1={};_0x58e4c1[_0x2b99e8]={'$like':'%'+_0x4cdc01[_0x01cb('0x3f')][_0x01cb('0x47')]+'%'};return _0x58e4c1;})});}_0x5dda57=_['merge']({},_0x5dda57,_0x4cdc01['options']);return _0x571f18[_0x01cb('0xb2')](_0x5dda57);}})[_0x01cb('0x2e')](function(_0x1f13dc){if(_0x1f13dc){_0x4aff84=_0x1f13dc['length'];if(!_0x4cdc01['query'][_0x01cb('0x62')](_0x01cb('0x68'))){_0x5dda57[_0x01cb('0x2b')]=qs[_0x01cb('0x2b')](_0x4cdc01[_0x01cb('0x3f')][_0x01cb('0x2b')]);_0x5dda57['offset']=qs['offset'](_0x4cdc01['query'][_0x01cb('0x2a')]);}return _0x571f18[_0x01cb('0xb2')](_0x5dda57);}})['then'](function(_0x39b5a2){if(_0x39b5a2){return _0x39b5a2?{'count':_0x4aff84,'rows':_0x39b5a2}:null;}})['then'](respondWithResult(_0x475758,null))[_0x01cb('0x28')](handleError(_0x475758,null));};exports[_0x01cb('0xb3')]=function(_0x50435d,_0x5563c8,_0x4adf11){var _0x52a03d,_0x38f1ce,_0x155cf3;if(_[_0x01cb('0x71')](_0x50435d[_0x01cb('0x56')]['body'])||_0x50435d[_0x01cb('0x56')][_0x01cb('0x56')]===''){throw new db[(_0x01cb('0x73'))][(_0x01cb('0x1e'))](_0x01cb('0x75'));}if(_[_0x01cb('0x71')](_0x50435d[_0x01cb('0x56')]['to'])){}_0x52a03d=_0x50435d[_0x01cb('0x56')]['to'];return db[_0x01cb('0x39')][_0x01cb('0x60')]({'where':{'id':_0x50435d[_0x01cb('0x4f')]['id']}})[_0x01cb('0x2e')](handleEntityNotFound(_0x5563c8,null))['then'](function(_0x27fac8){if(_0x27fac8){return db[_0x01cb('0x39')][_0x01cb('0x54')]({'where':{'id':_0x27fac8['id']},'include':[{'model':db[_0x01cb('0x7a')],'as':_0x01cb('0x7e'),'include':[{'model':db[_0x01cb('0x7b')],'as':_0x01cb('0x7c'),'where':{[_0x27fac8[_0x01cb('0x76')]]:_0x52a03d},'limit':0x1,'order':[[_0x01cb('0x6d'),_0x01cb('0xb4')]]}]}]})[_0x01cb('0x2e')](handleEntityNotFound(_0x5563c8,null))['then'](function(_0x348352){if(_0x348352&&_0x348352[_0x01cb('0x7e')]){_0x38f1ce=_0x348352[_0x01cb('0x30')]({'plain':!![]});if(_0x38f1ce['List']&&_0x38f1ce[_0x01cb('0x7e')][_0x01cb('0x7c')][_0x01cb('0x52')]){return _0x38f1ce[_0x01cb('0x7e')]['Contacts'][0x0];}return db[_0x01cb('0x7b')][_0x01cb('0x55')](_[_0x01cb('0x17')](_0x50435d['body'],{'firstName':_0x52a03d,[_0x348352['mapKey']]:_0x52a03d,'phone':_0x52a03d,'ListId':_0x38f1ce['ListId']}));}})[_0x01cb('0x2e')](handleEntityNotFound(_0x5563c8,null))['then'](function(_0x5643ec){if(_0x5643ec){_0x155cf3=_0x5643ec;return db[_0x01cb('0x89')][_0x01cb('0x54')]({'where':{'ContactId':_0x155cf3['id'],'closed':![],'OpenchannelAccountId':_0x38f1ce['id']}})[_0x01cb('0x2e')](function(_0x2e3954){if(_0x2e3954){return[_0x2e3954,![]];}return db[_0x01cb('0x89')][_0x01cb('0x55')]({'UserId':_0x50435d[_0x01cb('0x57')]['id'],'ContactId':_0x155cf3['id'],'OpenchannelAccountId':_0x38f1ce['id'],'lastMsgDirection':_0x01cb('0xb5'),'Messages':[_[_0x01cb('0x48')](_0x50435d['body'],{'read':![],'body':_0x50435d[_0x01cb('0x56')]['body'],'OpenchannelAccountId':_0x38f1ce['id'],'UserId':_0x50435d[_0x01cb('0x57')]['id'],'ContactId':_0x155cf3['id']})]},{'include':[{'model':db[_0x01cb('0x93')],'as':_0x01cb('0xb6')}]})[_0x01cb('0x2e')](function(_0x51af65){return[_0x51af65,!![]];});});}})[_0x01cb('0x8c')](function(_0x415b99,_0xaf34f9){if(_0xaf34f9){return _0x415b99;}return db[_0x01cb('0x93')][_0x01cb('0x55')](_['merge'](_0x50435d[_0x01cb('0x56')],{'read':![],'body':_0x50435d['body'][_0x01cb('0x56')],'OpenchannelAccountId':_0x38f1ce['id'],'OpenchannelInteractionId':_0x415b99['id'],'UserId':_0x50435d[_0x01cb('0x57')]['id'],'ContactId':_0x155cf3['id']}))[_0x01cb('0x2e')](function(_0x23898d){_0x415b99[_0x01cb('0xb7')][_0x01cb('0xb6')]=[];_0x415b99['dataValues'][_0x01cb('0xb6')][_0x01cb('0xb8')](_0x23898d[_0x01cb('0xb7')]);return _0x415b99;});});}})[_0x01cb('0x2e')](respondWithResult(_0x5563c8,null))[_0x01cb('0x28')](handleError(_0x5563c8,null));}; \ No newline at end of file +var _0xd36f=['OpenchannelAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','body','describe','addDisposition','Disposition','findOne','OpenchannelAccountId','count','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','List','Contacts','DESC','applications','Applications','list','orderBy','priority','asc','account','length','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','addApplications','transaction','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','Owner','fullname','Tag','Tags','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map'];(function(_0x4e379c,_0x53dc9e){var _0x3bb7a1=function(_0x5553c3){while(--_0x5553c3){_0x4e379c['push'](_0x4e379c['shift']());}};_0x3bb7a1(++_0x53dc9e);}(_0xd36f,0x13a));var _0xfd36=function(_0x2b2aab,_0x1063a5){_0x2b2aab=_0x2b2aab-0x0;var _0x24656a=_0xd36f[_0x2b2aab];return _0x24656a;};'use strict';var pdf=require(_0xfd36('0x0'));var emlformat=require(_0xfd36('0x1'));var rimraf=require(_0xfd36('0x2'));var zipdir=require(_0xfd36('0x3'));var jsonpatch=require(_0xfd36('0x4'));var rp=require(_0xfd36('0x5'));var moment=require(_0xfd36('0x6'));var BPromise=require(_0xfd36('0x7'));var Mustache=require(_0xfd36('0x8'));var util=require(_0xfd36('0x9'));var path=require(_0xfd36('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfd36('0xb'));var squel=require(_0xfd36('0xc'));var crypto=require(_0xfd36('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfd36('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfd36('0xf'));var Papa=require(_0xfd36('0x10'));var Redis=require('ioredis');var authService=require(_0xfd36('0x11'));var qs=require(_0xfd36('0x12'));var as=require(_0xfd36('0x13'));var hardwareService=require(_0xfd36('0x14'));var logger=require(_0xfd36('0x15'))(_0xfd36('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfd36('0x17'))['db'];config[_0xfd36('0x18')]=_[_0xfd36('0x19')](config[_0xfd36('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd36('0x1a'))(new Redis(config[_0xfd36('0x18')]));require('./openchannelAccount.socket')[_0xfd36('0x1b')](socket);var jayson=require(_0xfd36('0x1c'));var client=jayson[_0xfd36('0x1d')][_0xfd36('0x1e')]({'port':0x232c});var client9002=jayson[_0xfd36('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x47b65f,_0x15194d,_0x117f71){if(_0x117f71){var _0x6811b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6811b0[_0xfd36('0x1f')](_0x15194d)){return _0x47b65f;}else{throw new db[(_0xfd36('0x20'))][(_0xfd36('0x21'))](_0xfd36('0x22'));}}else{return _0x47b65f;}}function respondWithRpcPromise(_0xe717c4,_0x11b967,_0x237101,_0x37c7c8){return new BPromise(function(_0x3e41b3,_0x34df75){var _0x9d9d89=_0x37c7c8||client;return _0x9d9d89[_0xfd36('0x23')](_0xe717c4,_0x237101)[_0xfd36('0x24')](function(_0x6283cd){logger[_0xfd36('0x25')](_0xfd36('0x26'),_0x11b967,'request\x20sent');logger[_0xfd36('0x27')](_0xfd36('0x28'),_0x11b967,_0xfd36('0x29'),JSON[_0xfd36('0x2a')](_0x6283cd));if(_0x6283cd[_0xfd36('0x2b')]){if(_0x6283cd['error']['code']===0x1f4){logger[_0xfd36('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x11b967,_0x6283cd[_0xfd36('0x2b')][_0xfd36('0x2c')]);return _0x34df75(_0x6283cd[_0xfd36('0x2b')]['message']);}logger['error'](_0xfd36('0x26'),_0x11b967,_0x6283cd['error'][_0xfd36('0x2c')]);return _0x3e41b3(_0x6283cd[_0xfd36('0x2b')][_0xfd36('0x2c')]);}else{logger[_0xfd36('0x25')](_0xfd36('0x26'),_0x11b967,_0xfd36('0x29'));_0x3e41b3(_0x6283cd['result'][_0xfd36('0x2c')]);}})[_0xfd36('0x2d')](function(_0x1cb28e){logger[_0xfd36('0x2b')](_0xfd36('0x26'),_0x11b967,_0x1cb28e);_0x34df75(_0x1cb28e);});});}function respondWithStatusCode(_0x1b994a,_0x2142c2){_0x2142c2=_0x2142c2||0xcc;return function(_0x1c9569){if(_0x1c9569){return _0x1b994a['sendStatus'](_0x2142c2);}return _0x1b994a[_0xfd36('0x2e')](_0x2142c2)[_0xfd36('0x2f')]();};}function respondWithResult(_0x1a52e1,_0x1b8d3e){_0x1b8d3e=_0x1b8d3e||0xc8;return function(_0x571f0d){if(_0x571f0d){return _0x1a52e1['status'](_0x1b8d3e)[_0xfd36('0x30')](_0x571f0d);}};}function respondWithFilteredResult(_0xa739c6,_0x5927f3){return function(_0x142430){if(_0x142430){var _0x292d59=_0x142430['count'],_0x3cd4b8=_0x5927f3['offset'],_0x3f31e4=_0x5927f3[_0xfd36('0x31')]+_0x5927f3[_0xfd36('0x32')],_0x12cfbc;if(_0x3f31e4>=_0x292d59){_0x3f31e4=_0x292d59;_0x12cfbc=0xc8;}else{_0x12cfbc=0xce;}_0xa739c6[_0xfd36('0x2e')](_0x12cfbc);return _0xa739c6[_0xfd36('0x33')](_0xfd36('0x34'),_0x3cd4b8+'-'+_0x3f31e4+'/'+_0x292d59)[_0xfd36('0x30')](_0x142430);}return null;};}function patchUpdates(_0x5343a9){return function(_0x18ac24){try{jsonpatch[_0xfd36('0x35')](_0x18ac24,_0x5343a9,!![]);}catch(_0x968175){return BPromise[_0xfd36('0x36')](_0x968175);}return _0x18ac24[_0xfd36('0x37')]();};}function saveUpdates(_0x362a2e,_0xc052cd){return function(_0x273ce3){if(_0x273ce3){return _0x273ce3['update'](_0x362a2e)['then'](function(_0x50cad5){return _0x50cad5;});}return null;};}function removeEntity(_0x37f390,_0x39d23c){return function(_0x4be799){if(_0x4be799){return _0x4be799[_0xfd36('0x38')]()[_0xfd36('0x24')](function(){var _0xb47f59=_0x4be799[_0xfd36('0x39')]({'plain':!![]});var _0x1b9b74=_0xfd36('0x3a');return db[_0xfd36('0x3b')][_0xfd36('0x38')]({'where':{'type':_0x1b9b74,'resourceId':_0xb47f59['id']}})['then'](function(){return _0x4be799;});})[_0xfd36('0x24')](function(){_0x37f390['status'](0xcc)[_0xfd36('0x2f')]();});}};}function handleEntityNotFound(_0x53d73d,_0x101b15){return function(_0x4b7085){if(!_0x4b7085){_0x53d73d['sendStatus'](0x194);}return _0x4b7085;};}function handleError(_0x1f5393,_0x46d730){_0x46d730=_0x46d730||0x1f4;return function(_0x29d4fd){logger[_0xfd36('0x2b')](_0x29d4fd[_0xfd36('0x3c')]);if(_0x29d4fd[_0xfd36('0x3d')]){delete _0x29d4fd[_0xfd36('0x3d')];}_0x1f5393[_0xfd36('0x2e')](_0x46d730)[_0xfd36('0x3e')](_0x29d4fd);};}exports['index']=function(_0x4763e7,_0x604f18){var _0xdf9caa={'include':[{'model':db[_0xfd36('0x3f')],'as':_0xfd36('0x40')}]},_0x48c341={},_0x496ab3={'count':0x0,'rows':[]};var _0x21725d=_[_0xfd36('0x41')](db[_0xfd36('0x42')]['rawAttributes'],function(_0x12b0c0){return{'name':_0x12b0c0[_0xfd36('0x43')],'type':_0x12b0c0[_0xfd36('0x44')][_0xfd36('0x45')]};});_0x48c341[_0xfd36('0x46')]=_[_0xfd36('0x41')](_0x21725d,_0xfd36('0x3d'));_0x48c341['query']=_[_0xfd36('0x47')](_0x4763e7[_0xfd36('0x48')]);_0x48c341[_0xfd36('0x49')]=_[_0xfd36('0x4a')](_0x48c341[_0xfd36('0x46')],_0x48c341['query']);_0xdf9caa[_0xfd36('0x4b')]=_[_0xfd36('0x4a')](_0x48c341[_0xfd36('0x46')],qs[_0xfd36('0x4c')](_0x4763e7[_0xfd36('0x48')]['fields']));_0xdf9caa[_0xfd36('0x4b')]=_0xdf9caa[_0xfd36('0x4b')]['length']?_0xdf9caa['attributes']:_0x48c341['model'];if(!_0x4763e7[_0xfd36('0x48')][_0xfd36('0x4d')](_0xfd36('0x4e'))){_0xdf9caa[_0xfd36('0x32')]=qs[_0xfd36('0x32')](_0x4763e7[_0xfd36('0x48')][_0xfd36('0x32')]);_0xdf9caa[_0xfd36('0x31')]=qs[_0xfd36('0x31')](_0x4763e7[_0xfd36('0x48')][_0xfd36('0x31')]);}_0xdf9caa[_0xfd36('0x4f')]=qs[_0xfd36('0x50')](_0x4763e7[_0xfd36('0x48')][_0xfd36('0x50')]);_0xdf9caa[_0xfd36('0x51')]=qs[_0xfd36('0x49')](_[_0xfd36('0x52')](_0x4763e7['query'],_0x48c341['filters']));if(_0x4763e7[_0xfd36('0x48')][_0xfd36('0x53')]){_0xdf9caa['where']=_[_0xfd36('0x54')](_0xdf9caa[_0xfd36('0x51')],{'$or':_['map'](_0x21725d,function(_0x43ff74){if(_0x43ff74[_0xfd36('0x44')]!=='VIRTUAL'){var _0x59edca={};_0x59edca[_0x43ff74[_0xfd36('0x3d')]]={'$like':'%'+_0x4763e7[_0xfd36('0x48')]['filter']+'%'};return _0x59edca;}})});}_0xdf9caa=_['merge']({},_0xdf9caa,_0x4763e7[_0xfd36('0x55')]);var _0x1eec91={'where':_0xdf9caa[_0xfd36('0x51')]};return db[_0xfd36('0x42')]['count'](_0x1eec91)[_0xfd36('0x24')](function(_0x483b9c){_0x496ab3['count']=_0x483b9c;if(_0x4763e7[_0xfd36('0x48')][_0xfd36('0x56')]){_0xdf9caa[_0xfd36('0x57')]=[{'all':!![]}];}return db[_0xfd36('0x42')][_0xfd36('0x58')](_0xdf9caa);})[_0xfd36('0x24')](function(_0x45d0b4){_0x496ab3[_0xfd36('0x59')]=_0x45d0b4;return _0x496ab3;})['then'](respondWithFilteredResult(_0x604f18,_0xdf9caa))[_0xfd36('0x2d')](handleError(_0x604f18,null));};exports[_0xfd36('0x5a')]=function(_0x25f1f9,_0xa0de1b){var _0x29539e={'raw':![],'where':{'id':_0x25f1f9['params']['id']},'include':[{'model':db['Pause'],'as':_0xfd36('0x40')}]},_0x4056b6={};_0x4056b6['model']=_['keys'](db[_0xfd36('0x42')][_0xfd36('0x5b')]);_0x4056b6[_0xfd36('0x48')]=_[_0xfd36('0x47')](_0x25f1f9[_0xfd36('0x48')]);_0x4056b6[_0xfd36('0x49')]=_[_0xfd36('0x4a')](_0x4056b6[_0xfd36('0x46')],_0x4056b6[_0xfd36('0x48')]);_0x29539e[_0xfd36('0x4b')]=_['intersection'](_0x4056b6['model'],qs[_0xfd36('0x4c')](_0x25f1f9['query']['fields']));_0x29539e[_0xfd36('0x4b')]=_0x29539e['attributes']['length']?_0x29539e[_0xfd36('0x4b')]:_0x4056b6[_0xfd36('0x46')];if(_0x25f1f9['query']['includeAll']){_0x29539e[_0xfd36('0x57')]=[{'all':!![]}];}_0x29539e=_['merge']({},_0x29539e,_0x25f1f9[_0xfd36('0x55')]);return db[_0xfd36('0x42')]['find'](_0x29539e)['then'](handleEntityNotFound(_0xa0de1b,null))[_0xfd36('0x24')](respondWithResult(_0xa0de1b,null))['catch'](handleError(_0xa0de1b,null));};exports[_0xfd36('0x5c')]=function(_0x42e9c3,_0x5da993){return db[_0xfd36('0x42')]['create'](_0x42e9c3['body'],{})[_0xfd36('0x24')](function(_0x35d720){var _0x539966=_0x42e9c3['user'][_0xfd36('0x39')]({'plain':!![]});if(!_0x539966)throw new Error(_0xfd36('0x5d'));if(_0x539966[_0xfd36('0x5e')]===_0xfd36('0x5f')){var _0x551e63=_0x35d720[_0xfd36('0x39')]({'plain':!![]});var _0x11b220=_0xfd36('0x3a');return db[_0xfd36('0x60')][_0xfd36('0x61')]({'where':{'name':_0x11b220,'userProfileId':_0x539966[_0xfd36('0x62')]},'raw':!![]})[_0xfd36('0x24')](function(_0x315978){if(_0x315978&&_0x315978[_0xfd36('0x63')]===0x0){return db[_0xfd36('0x3b')][_0xfd36('0x5c')]({'name':_0x551e63['name'],'resourceId':_0x551e63['id'],'type':_0x315978[_0xfd36('0x3d')],'sectionId':_0x315978['id']},{})['then'](function(){return _0x35d720;});}else{return _0x35d720;}})['catch'](function(_0x2745b0){logger['error'](_0xfd36('0x64'),_0x2745b0);throw _0x2745b0;});}return _0x35d720;})[_0xfd36('0x24')](respondWithResult(_0x5da993,0xc9))[_0xfd36('0x2d')](handleError(_0x5da993,null));};exports[_0xfd36('0x65')]=function(_0x267a9f,_0x1c9617){if(_0x267a9f['body']['id']){delete _0x267a9f['body']['id'];}return db[_0xfd36('0x42')][_0xfd36('0x61')]({'where':{'id':_0x267a9f[_0xfd36('0x66')]['id']},'include':[{'model':db[_0xfd36('0x3f')],'as':_0xfd36('0x40')}]})['then'](handleEntityNotFound(_0x1c9617,null))[_0xfd36('0x24')](saveUpdates(_0x267a9f[_0xfd36('0x67')],null))[_0xfd36('0x24')](respondWithResult(_0x1c9617,null))[_0xfd36('0x2d')](handleError(_0x1c9617,null));};exports[_0xfd36('0x38')]=function(_0xd642ef,_0x510d9a){return db[_0xfd36('0x42')]['find']({'where':{'id':_0xd642ef[_0xfd36('0x66')]['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0x510d9a,null))['then'](removeEntity(_0x510d9a,null))[_0xfd36('0x2d')](handleError(_0x510d9a,null));};exports[_0xfd36('0x68')]=function(_0x121469,_0x1319fd){return db[_0xfd36('0x42')][_0xfd36('0x68')]()['then'](respondWithResult(_0x1319fd,null))[_0xfd36('0x2d')](handleError(_0x1319fd,null));};exports[_0xfd36('0x69')]=function(_0x2a1003,_0x4a4320,_0x5c4ef9){if(_0x2a1003[_0xfd36('0x67')]['id']){delete _0x2a1003[_0xfd36('0x67')]['id'];}return db[_0xfd36('0x42')][_0xfd36('0x61')]({'where':{'id':_0x2a1003[_0xfd36('0x66')]['id']}})['then'](handleEntityNotFound(_0x4a4320,null))['then'](function(_0x1047df){if(_0x1047df){_0x2a1003[_0xfd36('0x67')]['OpnechannelAccountId']=_0x1047df['id'];return db[_0xfd36('0x6a')][_0xfd36('0x5c')](_0x2a1003[_0xfd36('0x67')]);}})[_0xfd36('0x24')](respondWithResult(_0x4a4320,null))['catch'](handleError(_0x4a4320,null));};exports['getDispositions']=function(_0x5e3834,_0x44dd75,_0x4b2b18){var _0x1498f7={'raw':![],'where':{}};var _0x25e4de={};var _0x7f09f7={'count':0x0,'rows':[]};return db[_0xfd36('0x42')][_0xfd36('0x6b')]({'where':{'id':_0x5e3834[_0xfd36('0x66')]['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0x44dd75,null))['then'](function(_0x25bd1f){if(_0x25bd1f){_0x25e4de[_0xfd36('0x46')]=_['keys'](db['Disposition'][_0xfd36('0x5b')]);_0x25e4de[_0xfd36('0x48')]=_[_0xfd36('0x47')](_0x5e3834['query']);_0x25e4de[_0xfd36('0x49')]=_[_0xfd36('0x4a')](_0x25e4de['model'],_0x25e4de[_0xfd36('0x48')]);_0x1498f7[_0xfd36('0x4b')]=_['intersection'](_0x25e4de['model'],qs[_0xfd36('0x4c')](_0x5e3834[_0xfd36('0x48')][_0xfd36('0x4c')]));_0x1498f7[_0xfd36('0x4b')]=_0x1498f7[_0xfd36('0x4b')]['length']?_0x1498f7['attributes']:_0x25e4de[_0xfd36('0x46')];if(!_0x5e3834[_0xfd36('0x48')][_0xfd36('0x4d')](_0xfd36('0x4e'))){_0x1498f7[_0xfd36('0x32')]=qs['limit'](_0x5e3834['query']['limit']);_0x1498f7[_0xfd36('0x31')]=qs[_0xfd36('0x31')](_0x5e3834[_0xfd36('0x48')][_0xfd36('0x31')]);}_0x1498f7[_0xfd36('0x4f')]=qs[_0xfd36('0x50')](_0x5e3834[_0xfd36('0x48')]['sort']);_0x1498f7[_0xfd36('0x51')]=qs[_0xfd36('0x49')](_[_0xfd36('0x52')](_0x5e3834[_0xfd36('0x48')],_0x25e4de[_0xfd36('0x49')]));_0x1498f7['where'][_0xfd36('0x6c')]=_0x25bd1f['id'];if(_0x5e3834['query'][_0xfd36('0x53')]){_0x1498f7[_0xfd36('0x51')]=_[_0xfd36('0x54')](_0x1498f7[_0xfd36('0x51')],{'$or':_[_0xfd36('0x41')](_0x1498f7[_0xfd36('0x4b')],function(_0x525d9e){var _0x1acd5b={};_0x1acd5b[_0x525d9e]={'$like':'%'+_0x5e3834['query']['filter']+'%'};return _0x1acd5b;})});}_0x1498f7=_['merge']({},_0x1498f7,_0x5e3834[_0xfd36('0x55')]);return db[_0xfd36('0x6a')][_0xfd36('0x6d')]({'where':_0x1498f7[_0xfd36('0x51')]})[_0xfd36('0x24')](function(_0x2e23f9){_0x7f09f7[_0xfd36('0x6d')]=_0x2e23f9;if(_0x5e3834[_0xfd36('0x48')][_0xfd36('0x56')]){_0x1498f7['include']=[{'all':!![]}];}return db[_0xfd36('0x6a')][_0xfd36('0x58')](_0x1498f7);})[_0xfd36('0x24')](function(_0x2ad163){_0x7f09f7[_0xfd36('0x59')]=_0x2ad163;return _0x7f09f7;});}})['then'](respondWithFilteredResult(_0x44dd75,_0x1498f7))['catch'](handleError(_0x44dd75,null));};exports[_0xfd36('0x6e')]=function(_0x3eebbd,_0x562b4b,_0x2e0890){return db[_0xfd36('0x42')][_0xfd36('0x61')]({'where':{'id':_0x3eebbd[_0xfd36('0x66')]['id']}})['then'](handleEntityNotFound(_0x562b4b,null))['then'](function(_0xea760d){if(_0xea760d){return _0xea760d[_0xfd36('0x6e')](_0x3eebbd[_0xfd36('0x48')][_0xfd36('0x6f')]);}})[_0xfd36('0x24')](respondWithStatusCode(_0x562b4b,null))[_0xfd36('0x2d')](handleError(_0x562b4b,null));};exports[_0xfd36('0x70')]=function(_0x13d32b,_0x3bbd7e,_0x5202d5){if(_0x13d32b[_0xfd36('0x67')]['id']){delete _0x13d32b['body']['id'];}return db[_0xfd36('0x42')][_0xfd36('0x61')]({'where':{'id':_0x13d32b['params']['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0x3bbd7e,null))[_0xfd36('0x24')](function(_0x54c14d){if(_0x54c14d){_0x13d32b[_0xfd36('0x67')]['OpenchannelAccountId']=_0x54c14d['id'];return db[_0xfd36('0x71')][_0xfd36('0x5c')](_0x13d32b[_0xfd36('0x67')]);}})[_0xfd36('0x24')](respondWithResult(_0x3bbd7e,null))[_0xfd36('0x2d')](handleError(_0x3bbd7e,null));};exports['getAnswers']=function(_0x49d01c,_0x174033,_0x454f78){var _0x2b58cd={'raw':![],'where':{}};var _0x5dce49={};var _0x25711d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xfd36('0x6b')]({'where':{'id':_0x49d01c[_0xfd36('0x66')]['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0x174033,null))[_0xfd36('0x24')](function(_0x5e267b){if(_0x5e267b){_0x5dce49[_0xfd36('0x46')]=_['keys'](db[_0xfd36('0x71')]['rawAttributes']);_0x5dce49['query']=_[_0xfd36('0x47')](_0x49d01c[_0xfd36('0x48')]);_0x5dce49[_0xfd36('0x49')]=_['intersection'](_0x5dce49[_0xfd36('0x46')],_0x5dce49[_0xfd36('0x48')]);_0x2b58cd[_0xfd36('0x4b')]=_['intersection'](_0x5dce49[_0xfd36('0x46')],qs['fields'](_0x49d01c[_0xfd36('0x48')]['fields']));_0x2b58cd[_0xfd36('0x4b')]=_0x2b58cd['attributes']['length']?_0x2b58cd[_0xfd36('0x4b')]:_0x5dce49[_0xfd36('0x46')];if(!_0x49d01c['query'][_0xfd36('0x4d')](_0xfd36('0x4e'))){_0x2b58cd['limit']=qs['limit'](_0x49d01c[_0xfd36('0x48')]['limit']);_0x2b58cd[_0xfd36('0x31')]=qs[_0xfd36('0x31')](_0x49d01c[_0xfd36('0x48')]['offset']);}_0x2b58cd['order']=qs[_0xfd36('0x50')](_0x49d01c[_0xfd36('0x48')][_0xfd36('0x50')]);_0x2b58cd[_0xfd36('0x51')]=qs[_0xfd36('0x49')](_[_0xfd36('0x52')](_0x49d01c['query'],_0x5dce49[_0xfd36('0x49')]));_0x2b58cd['where'][_0xfd36('0x6c')]=_0x5e267b['id'];if(_0x49d01c[_0xfd36('0x48')][_0xfd36('0x53')]){_0x2b58cd[_0xfd36('0x51')]=_['merge'](_0x2b58cd[_0xfd36('0x51')],{'$or':_[_0xfd36('0x41')](_0x2b58cd[_0xfd36('0x4b')],function(_0x49234b){var _0x28119a={};_0x28119a[_0x49234b]={'$like':'%'+_0x49d01c['query'][_0xfd36('0x53')]+'%'};return _0x28119a;})});}_0x2b58cd=_[_0xfd36('0x54')]({},_0x2b58cd,_0x49d01c[_0xfd36('0x55')]);return db[_0xfd36('0x71')][_0xfd36('0x6d')]({'where':_0x2b58cd[_0xfd36('0x51')]})['then'](function(_0x5bbfe4){_0x25711d[_0xfd36('0x6d')]=_0x5bbfe4;if(_0x49d01c[_0xfd36('0x48')]['includeAll']){_0x2b58cd[_0xfd36('0x57')]=[{'all':!![]}];}return db[_0xfd36('0x71')][_0xfd36('0x58')](_0x2b58cd);})[_0xfd36('0x24')](function(_0x2677f1){_0x25711d[_0xfd36('0x59')]=_0x2677f1;return _0x25711d;});}})[_0xfd36('0x24')](respondWithFilteredResult(_0x174033,_0x2b58cd))['catch'](handleError(_0x174033,null));};exports[_0xfd36('0x72')]=function(_0x27dec3,_0x3814b7,_0x45cece){return db['OpenchannelAccount'][_0xfd36('0x61')]({'where':{'id':_0x27dec3[_0xfd36('0x66')]['id']}})['then'](handleEntityNotFound(_0x3814b7,null))['then'](function(_0x100a07){if(_0x100a07){return _0x100a07[_0xfd36('0x72')](_0x27dec3['query'][_0xfd36('0x6f')]);}})[_0xfd36('0x24')](respondWithStatusCode(_0x3814b7,null))[_0xfd36('0x2d')](handleError(_0x3814b7,null));};exports[_0xfd36('0x73')]=function(_0x2b9146,_0xd6c5e7,_0xd6c6f5){var _0x10341c={'body':_0x2b9146[_0xfd36('0x67')],'channel':_0xfd36('0x74')};var _0x369f16=[];var _0x2b2b53=[];var _0xa0b147={};var _0x1bccd3=![];return db[_0xfd36('0x75')][_0xfd36('0x68')]()[_0xfd36('0x24')](function(_0x135b97){if(!_0x135b97){throw new db[(_0xfd36('0x20'))]['ValidationError'](_0xfd36('0x76'));}_0x369f16=_[_0xfd36('0x77')](_[_0xfd36('0x47')](_0x135b97),[_0xfd36('0x78'),_0xfd36('0x79')]);_0x2b2b53=_[_0xfd36('0x77')](_[_0xfd36('0x47')](_0x135b97),[_0xfd36('0x78'),_0xfd36('0x79'),_0xfd36('0x7a'),_0xfd36('0x7b')]);if(_0x2b9146[_0xfd36('0x67')]['id']){delete _0x2b9146[_0xfd36('0x67')]['id'];}if(_[_0xfd36('0x7c')](_0x2b9146[_0xfd36('0x67')]['from'])){throw new db[(_0xfd36('0x20'))][(_0xfd36('0x21'))](_0xfd36('0x7d'));}if(_['isNil'](_0x2b9146[_0xfd36('0x67')][_0xfd36('0x67')])||_0x2b9146[_0xfd36('0x67')]['body']===''){throw new db[(_0xfd36('0x20'))][(_0xfd36('0x21'))](_0xfd36('0x7e'));}if(_[_0xfd36('0x7c')](_0x2b9146[_0xfd36('0x67')][_0xfd36('0x7f')])){throw new db[(_0xfd36('0x20'))][(_0xfd36('0x21'))](_0xfd36('0x80')+_0x2b2b53);}if(!_[_0xfd36('0x81')](_0x2b2b53,_0x2b9146[_0xfd36('0x67')][_0xfd36('0x7f')])){throw new db[(_0xfd36('0x20'))][(_0xfd36('0x21'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2b2b53);}_0xa0b147[_0x2b9146[_0xfd36('0x67')][_0xfd36('0x7f')]]=_0x2b9146[_0xfd36('0x67')][_0xfd36('0x82')];})[_0xfd36('0x24')](function(){return db[_0xfd36('0x42')][_0xfd36('0x61')]({'where':{'id':_0x2b9146[_0xfd36('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0xfd36('0x83'),'include':[{'model':db[_0xfd36('0x75')],'as':_0xfd36('0x84'),'where':_0xa0b147,'limit':0x1,'order':[['updatedAt',_0xfd36('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0xfd36('0x24')](handleEntityNotFound(_0xd6c5e7,null))['then'](function(_0x2f09b5){if(_0x2f09b5&&_0x2f09b5[_0xfd36('0x83')]){_0x10341c['account']=_0x2f09b5;_0x10341c[_0xfd36('0x86')]=_0x2f09b5[_0xfd36('0x87')];_0x10341c[_0xfd36('0x88')]=_0x2f09b5[_0xfd36('0x83')];_0x10341c[_0xfd36('0x86')]=_[_0xfd36('0x89')](_0x10341c[_0xfd36('0x86')],[_0xfd36('0x8a')],[_0xfd36('0x8b')]);if(_0x10341c[_0xfd36('0x8c')][_0xfd36('0x87')]){delete _0x10341c[_0xfd36('0x8c')][_0xfd36('0x87')];}if(_0x10341c[_0xfd36('0x8c')]['List']&&_0x10341c['account'][_0xfd36('0x83')][_0xfd36('0x84')][_0xfd36('0x8d')]){return _0x10341c[_0xfd36('0x8c')][_0xfd36('0x83')][_0xfd36('0x84')][0x0];}var _0x46d813=_[_0xfd36('0x19')](_0x2b9146[_0xfd36('0x67')],{'firstName':_0x2b9146[_0xfd36('0x67')][_0xfd36('0x82')],'ListId':_0x2f09b5['ListId']});_0x46d813[_0x2b9146[_0xfd36('0x67')]['mapKey']]=_0x2b9146['body'][_0xfd36('0x82')];return db[_0xfd36('0x75')][_0xfd36('0x5c')](_0x46d813,{'fields':_0x369f16,'raw':!![]});}})[_0xfd36('0x24')](handleEntityNotFound(_0xd6c5e7,null))[_0xfd36('0x24')](function(_0x5b67bf){_0x10341c[_0xfd36('0x8e')]=_0x5b67bf;if(_0x5b67bf){var _0x23151d={'ContactId':_0x5b67bf['id'],'OpenchannelAccountId':_0x2b9146[_0xfd36('0x66')]['id'],'from':(_0x5b67bf[_0xfd36('0x8f')]||'')+'\x20'+(_0x5b67bf[_0xfd36('0x90')]||'')};var _0x20f36a={'OpenchannelAccountId':_0x2b9146[_0xfd36('0x66')]['id'],'closed':![]};if(_0x2b9146['body'][_0xfd36('0x91')]){_0x20f36a['threadId']=_0x2b9146[_0xfd36('0x67')][_0xfd36('0x91')];return db[_0xfd36('0x92')][_0xfd36('0x61')]({'where':_0x20f36a})['then'](function(_0x57ff22){if(_0x57ff22){return[_0x57ff22,![]];}_0x23151d['threadId']=_0x2b9146[_0xfd36('0x67')]['threadId'];_0x23151d[_0xfd36('0x93')]=_0x2b9146[_0xfd36('0x67')][_0xfd36('0x93')];return db['OpenchannelInteraction'][_0xfd36('0x5c')](_0x23151d)[_0xfd36('0x24')](function(_0x308350){return[_0x308350,!![]];});});}else{_0x20f36a[_0xfd36('0x91')]=null;}_0x20f36a[_0xfd36('0x94')]=_0x5b67bf['id'];return db[_0xfd36('0x92')][_0xfd36('0x61')]({'where':_0x20f36a})[_0xfd36('0x24')](function(_0x202633){if(_0x202633){return[_0x202633,![]];}return db['OpenchannelInteraction'][_0xfd36('0x5c')](_0x23151d)[_0xfd36('0x24')](function(_0x37e2f3){return[_0x37e2f3,!![]];});});}})['spread'](function(_0x36260f,_0x4e48cd){if(_0x36260f){_0x1bccd3=_0x4e48cd;if(!_0x4e48cd){var _0x3a8121={'from':(_0x10341c[_0xfd36('0x8e')][_0xfd36('0x8f')]||'')+'\x20'+(_0x10341c[_0xfd36('0x8e')][_0xfd36('0x90')]||'')};if(_0x2b9146[_0xfd36('0x67')][_0xfd36('0x91')]&&_0x2b9146[_0xfd36('0x67')][_0xfd36('0x95')]&&_0x2b9146[_0xfd36('0x67')][_0xfd36('0x91')]!=_0x2b9146[_0xfd36('0x67')][_0xfd36('0x95')]){_0x3a8121[_0xfd36('0x91')]=_0x2b9146['body'][_0xfd36('0x95')];}return _0x36260f[_0xfd36('0x65')](_0x3a8121);}else{return _0x36260f;}}})[_0xfd36('0x24')](function(_0x1d9935){_0x10341c[_0xfd36('0x96')]=_0x1d9935[_0xfd36('0x39')]({'plain':!![]});_0x10341c['interaction'][_0xfd36('0x97')]=_0x1bccd3;if(_0x10341c[_0xfd36('0x96')][_0xfd36('0x97')]){if(_0x10341c[_0xfd36('0x8c')][_0xfd36('0x98')]){_0x10341c[_0xfd36('0x86')][_0xfd36('0x99')]({'id':0x0,'priority':_0x10341c['applications'][_0xfd36('0x8d')]+0x1,'app':_0xfd36('0x9a'),'appdata':_0xfd36('0x9b'),'interval':'*,*,*,*'});}}return db[_0xfd36('0x9c')][_0xfd36('0x5c')]({'body':_0x2b9146[_0xfd36('0x67')]['body'],'OpenchannelAccountId':_0x2b9146[_0xfd36('0x66')]['id'],'OpenchannelInteractionId':_0x1d9935['id'],'direction':'in','ContactId':_0x10341c[_0xfd36('0x8e')]['id'],'AttachmentId':_0x2b9146[_0xfd36('0x67')][_0xfd36('0x9d')]});})[_0xfd36('0x24')](function(_0x1f0bde){_0x10341c[_0xfd36('0x2c')]=_0x1f0bde;if(_0x10341c['interaction']['UserId']){return db[_0xfd36('0x9e')]['find']({'attributes':['id',_0xfd36('0x3d')],'where':{'id':_0x10341c[_0xfd36('0x96')][_0xfd36('0x9f')]}})[_0xfd36('0x24')](function(_0x6b7def){if(_0x6b7def){_0x10341c[_0xfd36('0x86')][_0xfd36('0xa0')]({'id':0x0,'priority':0x0,'app':_0xfd36('0xa1'),'appdata':_0x6b7def[_0xfd36('0x3d')]+','+(_0x10341c['account'][_0xfd36('0xa2')]||0xa),'interval':_0xfd36('0xa3')});_0x10341c['forcedOwnership']=![];}return respondWithRpcPromise(_0xfd36('0xa4'),_0xfd36('0xa5'),_0x10341c);});}return respondWithRpcPromise(_0xfd36('0xa4'),'startRouting',_0x10341c);})[_0xfd36('0x24')](function(_0x43b454){respondWithRpcPromise(_0xfd36('0xa6'),_0xfd36('0xa6'),{'event':_0xfd36('0x73'),'message':_0x43b454},client9002);return _0x43b454;})[_0xfd36('0x24')](respondWithResult(_0xd6c5e7,null))[_0xfd36('0x2d')](handleError(_0xd6c5e7,null));};exports[_0xfd36('0xa7')]=function(_0x5e7614,_0xe45eae,_0x2f9805){return db[_0xfd36('0x42')]['findOne']({'where':{'id':_0x5e7614[_0xfd36('0x66')]['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0xe45eae,null))['then'](function(_0x34ffb1){if(_0x34ffb1){return db['sequelize'][_0xfd36('0xa8')](function(_0x4b9b35){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x5e7614[_0xfd36('0x66')]['id']},'transaction':_0x4b9b35})[_0xfd36('0x24')](function(_0x69e0d6){var _0xac4339=_['map'](_0x5e7614['body'],function(_0xe3dafe){_0xe3dafe[_0xfd36('0x6c')]=_0x5e7614[_0xfd36('0x66')]['id'];return _0xe3dafe;});return db[_0xfd36('0xa9')]['bulkCreate'](_0xac4339,{'transaction':_0x4b9b35});});})[_0xfd36('0x24')](function(){return db[_0xfd36('0xa9')][_0xfd36('0xaa')]({'where':{'OpenchannelAccountId':_0x5e7614[_0xfd36('0x66')]['id']},'order':_0xfd36('0x8a')});});}})[_0xfd36('0x24')](respondWithResult(_0xe45eae,null))[_0xfd36('0x2d')](handleError(_0xe45eae,null));};exports['getApplications']=function(_0x8adc19,_0x4d0d32,_0x228e4f){var _0x411c3b={};var _0x4f408e={};var _0x5de01d;var _0x140399;return db['OpenchannelAccount'][_0xfd36('0x6b')]({'where':{'id':_0x8adc19[_0xfd36('0x66')]['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0x4d0d32,null))[_0xfd36('0x24')](function(_0x5c78ff){if(_0x5c78ff){_0x5de01d=_0x5c78ff;_0x4f408e[_0xfd36('0x46')]=_[_0xfd36('0x47')](db[_0xfd36('0xa9')][_0xfd36('0x5b')]);_0x4f408e[_0xfd36('0x48')]=_[_0xfd36('0x47')](_0x8adc19[_0xfd36('0x48')]);_0x4f408e[_0xfd36('0x49')]=_[_0xfd36('0x4a')](_0x4f408e[_0xfd36('0x46')],_0x4f408e['query']);_0x411c3b[_0xfd36('0x4b')]=_['intersection'](_0x4f408e[_0xfd36('0x46')],qs['fields'](_0x8adc19[_0xfd36('0x48')][_0xfd36('0x4c')]));_0x411c3b[_0xfd36('0x4b')]=_0x411c3b[_0xfd36('0x4b')]['length']?_0x411c3b[_0xfd36('0x4b')]:_0x4f408e[_0xfd36('0x46')];_0x411c3b[_0xfd36('0x4f')]=qs[_0xfd36('0x50')](_0x8adc19['query'][_0xfd36('0x50')]);_0x411c3b['where']=qs[_0xfd36('0x49')](_[_0xfd36('0x52')](_0x8adc19[_0xfd36('0x48')],_0x4f408e['filters']));if(_0x8adc19[_0xfd36('0x48')]['filter']){_0x411c3b[_0xfd36('0x51')]=_[_0xfd36('0x54')](_0x411c3b[_0xfd36('0x51')],{'$or':_['map'](_0x411c3b[_0xfd36('0x4b')],function(_0x382cb1){var _0x4da7c0={};_0x4da7c0[_0x382cb1]={'$like':'%'+_0x8adc19[_0xfd36('0x48')][_0xfd36('0x53')]+'%'};return _0x4da7c0;})});}_0x411c3b=_[_0xfd36('0x54')]({},_0x411c3b,_0x8adc19['options']);return _0x5de01d[_0xfd36('0xab')](_0x411c3b);}})[_0xfd36('0x24')](function(_0x219b6e){if(_0x219b6e){_0x140399=_0x219b6e[_0xfd36('0x8d')];if(!_0x8adc19[_0xfd36('0x48')][_0xfd36('0x4d')]('nolimit')){_0x411c3b[_0xfd36('0x32')]=qs[_0xfd36('0x32')](_0x8adc19['query'][_0xfd36('0x32')]);_0x411c3b[_0xfd36('0x31')]=qs[_0xfd36('0x31')](_0x8adc19['query'][_0xfd36('0x31')]);}return _0x5de01d[_0xfd36('0xab')](_0x411c3b);}})[_0xfd36('0x24')](function(_0x55908a){if(_0x55908a){return _0x55908a?{'count':_0x140399,'rows':_0x55908a}:null;}})['then'](respondWithResult(_0x4d0d32,null))[_0xfd36('0x2d')](handleError(_0x4d0d32,null));};exports[_0xfd36('0xac')]=function(_0x4798e2,_0x298cd9,_0x505f07){var _0x17a6d8={'raw':![],'where':{}};var _0x3c92c8={};var _0x5c1048={'count':0x0,'rows':[]};return db[_0xfd36('0x42')]['findOne']({'where':{'id':_0x4798e2[_0xfd36('0x66')]['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0x298cd9,null))[_0xfd36('0x24')](function(_0x14e2c5){if(_0x14e2c5){_0x3c92c8['model']=_[_0xfd36('0x47')](db[_0xfd36('0x92')][_0xfd36('0x5b')]);_0x3c92c8['query']=_['keys'](_0x4798e2[_0xfd36('0x48')]);_0x3c92c8[_0xfd36('0x49')]=_['intersection'](_0x3c92c8[_0xfd36('0x46')],_0x3c92c8[_0xfd36('0x48')]);_0x17a6d8[_0xfd36('0x4b')]=_[_0xfd36('0x4a')](_0x3c92c8[_0xfd36('0x46')],qs[_0xfd36('0x4c')](_0x4798e2[_0xfd36('0x48')][_0xfd36('0x4c')]));_0x17a6d8[_0xfd36('0x4b')]=_0x17a6d8[_0xfd36('0x4b')][_0xfd36('0x8d')]?_0x17a6d8[_0xfd36('0x4b')]:_0x3c92c8[_0xfd36('0x46')];if(!_0x4798e2['query'][_0xfd36('0x4d')]('nolimit')){_0x17a6d8[_0xfd36('0x32')]=qs[_0xfd36('0x32')](_0x4798e2[_0xfd36('0x48')][_0xfd36('0x32')]);_0x17a6d8[_0xfd36('0x31')]=qs['offset'](_0x4798e2[_0xfd36('0x48')][_0xfd36('0x31')]);}_0x17a6d8[_0xfd36('0x4f')]=qs[_0xfd36('0x50')](_0x4798e2[_0xfd36('0x48')]['sort']);_0x17a6d8['where']=qs['filters'](_[_0xfd36('0x52')](_0x4798e2[_0xfd36('0x48')],_0x3c92c8[_0xfd36('0x49')]));_0x17a6d8['where'][_0xfd36('0x6c')]=_0x14e2c5['id'];if(_0x4798e2[_0xfd36('0x48')][_0xfd36('0x53')]){_0x17a6d8['where']=_[_0xfd36('0x54')](_0x17a6d8[_0xfd36('0x51')],{'$or':_['map'](_0x17a6d8[_0xfd36('0x4b')],function(_0x2ae252){var _0x31a936={};_0x31a936[_0x2ae252]={'$like':'%'+_0x4798e2[_0xfd36('0x48')][_0xfd36('0x53')]+'%'};return _0x31a936;})});}_0x17a6d8=_[_0xfd36('0x54')]({},_0x17a6d8,_0x4798e2['options']);return db['OpenchannelInteraction']['count']({'where':_0x17a6d8[_0xfd36('0x51')]})[_0xfd36('0x24')](function(_0x165291){_0x5c1048[_0xfd36('0x6d')]=_0x165291;if(_0x4798e2[_0xfd36('0x48')][_0xfd36('0x56')]){_0x17a6d8[_0xfd36('0x57')]=[{'model':db[_0xfd36('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xfd36('0xad'),'attributes':[_0xfd36('0x3d'),_0xfd36('0xae'),'internal'],'required':![]},{'model':db[_0xfd36('0xaf')],'as':_0xfd36('0xb0'),'attributes':['id',_0xfd36('0x3d'),'color'],'where':_0x4798e2[_0xfd36('0x48')][_0xfd36('0xb1')]?{'id':_0x4798e2[_0xfd36('0x48')][_0xfd36('0xb1')]}:undefined,'required':_0x4798e2['query'][_0xfd36('0xb1')]?!![]:![]}];}return db[_0xfd36('0x92')][_0xfd36('0x58')](_0x17a6d8);})[_0xfd36('0x24')](function(_0x6a65a6){_0x5c1048[_0xfd36('0x59')]=_0x6a65a6;return _0x5c1048;});}})[_0xfd36('0x24')](respondWithFilteredResult(_0x298cd9,_0x17a6d8))['catch'](handleError(_0x298cd9,null));};exports[_0xfd36('0xb2')]=function(_0x2b893a,_0x56ba0b,_0x459241){return db['OpenchannelAccount'][_0xfd36('0x61')]({'where':{'id':_0x2b893a['params']['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0x56ba0b,null))[_0xfd36('0x24')](function(_0x29fcd5){if(_0x29fcd5){return _0x29fcd5[_0xfd36('0xb2')](_0x2b893a[_0xfd36('0x67')][_0xfd36('0x6f')],_[_0xfd36('0xb3')](_0x2b893a[_0xfd36('0x67')],['ids','id'])||{})[_0xfd36('0xb4')](function(_0x2ffdac){for(var _0xe0e591=0x0;_0xe0e591<_0x2b893a['body'][_0xfd36('0x6f')][_0xfd36('0x8d')];_0xe0e591+=0x1){socket[_0xfd36('0xb5')](_0xfd36('0xb6'),{'UserId':_0x2b893a[_0xfd36('0x67')][_0xfd36('0x6f')][_0xe0e591],'OpenchannelAccountId':_0x2b893a[_0xfd36('0x66')]['id']});}return _0x2ffdac;});}})['then'](respondWithResult(_0x56ba0b,null))[_0xfd36('0x2d')](handleError(_0x56ba0b,null));};exports[_0xfd36('0xb7')]=function(_0x2fc00a,_0x595632,_0x22e97f){return db[_0xfd36('0x42')][_0xfd36('0x61')]({'where':{'id':_0x2fc00a[_0xfd36('0x66')]['id']}})['then'](handleEntityNotFound(_0x595632,null))[_0xfd36('0x24')](function(_0x482036){if(_0x482036){return _0x482036[_0xfd36('0xb7')](_0x2fc00a[_0xfd36('0x48')][_0xfd36('0x6f')])[_0xfd36('0x24')](function(){if(_[_0xfd36('0xb8')](_0x2fc00a[_0xfd36('0x48')][_0xfd36('0x6f')])){for(var _0x3ed165=0x0;_0x3ed165<_0x2fc00a[_0xfd36('0x48')][_0xfd36('0x6f')][_0xfd36('0x8d')];_0x3ed165+=0x1){socket[_0xfd36('0xb5')](_0xfd36('0xb9'),{'UserId':Number(_0x2fc00a[_0xfd36('0x48')][_0xfd36('0x6f')][_0x3ed165]),'OpenchannelAccountId':Number(_0x2fc00a['params']['id'])});}}else{socket[_0xfd36('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2fc00a[_0xfd36('0x48')]['ids']),'OpenchannelAccountId':Number(_0x2fc00a['params']['id'])});}});}})[_0xfd36('0x24')](respondWithStatusCode(_0x595632,null))[_0xfd36('0x2d')](handleError(_0x595632,null));};exports['getAgents']=function(_0x25f35c,_0x182363,_0x3ef139){var _0x7002ab={};var _0x2db659={};var _0x312ead;var _0x37a976;return db[_0xfd36('0x42')][_0xfd36('0x6b')]({'where':{'id':_0x25f35c[_0xfd36('0x66')]['id']}})['then'](handleEntityNotFound(_0x182363,null))[_0xfd36('0x24')](function(_0x38b314){if(_0x38b314){_0x312ead=_0x38b314;_0x2db659[_0xfd36('0x46')]=_[_0xfd36('0x47')](db[_0xfd36('0x9e')][_0xfd36('0x5b')]);_0x2db659['query']=_[_0xfd36('0x47')](_0x25f35c['query']);_0x2db659[_0xfd36('0x49')]=_[_0xfd36('0x4a')](_0x2db659[_0xfd36('0x46')],_0x2db659[_0xfd36('0x48')]);_0x7002ab[_0xfd36('0x4b')]=_[_0xfd36('0x4a')](_0x2db659['model'],qs[_0xfd36('0x4c')](_0x25f35c[_0xfd36('0x48')][_0xfd36('0x4c')]));_0x7002ab[_0xfd36('0x4b')]=_0x7002ab[_0xfd36('0x4b')][_0xfd36('0x8d')]?_0x7002ab[_0xfd36('0x4b')]:_0x2db659[_0xfd36('0x46')];_0x7002ab[_0xfd36('0x4f')]=qs['sort'](_0x25f35c['query'][_0xfd36('0x50')]);_0x7002ab[_0xfd36('0x51')]=qs[_0xfd36('0x49')](_[_0xfd36('0x52')](_0x25f35c['query'],_0x2db659[_0xfd36('0x49')]));if(_0x25f35c[_0xfd36('0x48')][_0xfd36('0x53')]){_0x7002ab[_0xfd36('0x51')]=_[_0xfd36('0x54')](_0x7002ab['where'],{'$or':_[_0xfd36('0x41')](_0x7002ab[_0xfd36('0x4b')],function(_0x3b070b){var _0x45bb19={};_0x45bb19[_0x3b070b]={'$like':'%'+_0x25f35c[_0xfd36('0x48')][_0xfd36('0x53')]+'%'};return _0x45bb19;})});}_0x7002ab=_[_0xfd36('0x54')]({},_0x7002ab,_0x25f35c[_0xfd36('0x55')]);return _0x312ead[_0xfd36('0xba')](_0x7002ab);}})['then'](function(_0x295b3b){if(_0x295b3b){_0x37a976=_0x295b3b[_0xfd36('0x8d')];if(!_0x25f35c[_0xfd36('0x48')]['hasOwnProperty'](_0xfd36('0x4e'))){_0x7002ab[_0xfd36('0x32')]=qs[_0xfd36('0x32')](_0x25f35c[_0xfd36('0x48')]['limit']);_0x7002ab['offset']=qs[_0xfd36('0x31')](_0x25f35c[_0xfd36('0x48')][_0xfd36('0x31')]);}return _0x312ead['getAgents'](_0x7002ab);}})[_0xfd36('0x24')](function(_0x4d665b){if(_0x4d665b){return _0x4d665b?{'count':_0x37a976,'rows':_0x4d665b}:null;}})['then'](respondWithResult(_0x182363,null))[_0xfd36('0x2d')](handleError(_0x182363,null));};exports['send']=function(_0x252fd1,_0x1a44ee,_0x1a0c96){var _0x48359f,_0x40627b,_0x59875b;if(_[_0xfd36('0x7c')](_0x252fd1['body'][_0xfd36('0x67')])||_0x252fd1['body'][_0xfd36('0x67')]===''){throw new db[(_0xfd36('0x20'))][(_0xfd36('0x21'))](_0xfd36('0x7e'));}if(_[_0xfd36('0x7c')](_0x252fd1[_0xfd36('0x67')]['to'])){}_0x48359f=_0x252fd1[_0xfd36('0x67')]['to'];return db['OpenchannelAccount'][_0xfd36('0x6b')]({'where':{'id':_0x252fd1['params']['id']}})[_0xfd36('0x24')](handleEntityNotFound(_0x1a44ee,null))[_0xfd36('0x24')](function(_0x156ae6){if(_0x156ae6){return db[_0xfd36('0x42')][_0xfd36('0x61')]({'where':{'id':_0x156ae6['id']},'include':[{'model':db[_0xfd36('0xbb')],'as':_0xfd36('0x83'),'include':[{'model':db[_0xfd36('0x75')],'as':_0xfd36('0x84'),'where':{[_0x156ae6[_0xfd36('0x7f')]]:_0x48359f},'limit':0x1,'order':[[_0xfd36('0x79'),_0xfd36('0x85')]]}]}]})['then'](handleEntityNotFound(_0x1a44ee,null))[_0xfd36('0x24')](function(_0x4b9367){if(_0x4b9367&&_0x4b9367[_0xfd36('0x83')]){_0x40627b=_0x4b9367['get']({'plain':!![]});if(_0x40627b['List']&&_0x40627b['List'][_0xfd36('0x84')][_0xfd36('0x8d')]){return _0x40627b[_0xfd36('0x83')][_0xfd36('0x84')][0x0];}return db['CmContact'][_0xfd36('0x5c')](_['defaults'](_0x252fd1[_0xfd36('0x67')],{'firstName':_0x48359f,[_0x4b9367[_0xfd36('0x7f')]]:_0x48359f,'phone':_0x48359f,'ListId':_0x40627b[_0xfd36('0x7b')]}));}})['then'](handleEntityNotFound(_0x1a44ee,null))[_0xfd36('0x24')](function(_0x4cc662){if(_0x4cc662){_0x59875b=_0x4cc662;return db['OpenchannelInteraction'][_0xfd36('0x61')]({'where':{'ContactId':_0x59875b['id'],'closed':![],'OpenchannelAccountId':_0x40627b['id']}})[_0xfd36('0x24')](function(_0x324ba5){if(_0x324ba5){return[_0x324ba5,![]];}return db['OpenchannelInteraction'][_0xfd36('0x5c')]({'UserId':_0x252fd1[_0xfd36('0x5f')]['id'],'ContactId':_0x59875b['id'],'OpenchannelAccountId':_0x40627b['id'],'lastMsgDirection':'out','Messages':[_[_0xfd36('0x54')](_0x252fd1[_0xfd36('0x67')],{'read':![],'body':_0x252fd1[_0xfd36('0x67')][_0xfd36('0x67')],'OpenchannelAccountId':_0x40627b['id'],'UserId':_0x252fd1[_0xfd36('0x5f')]['id'],'ContactId':_0x59875b['id']})]},{'include':[{'model':db[_0xfd36('0x9c')],'as':_0xfd36('0xbc')}]})[_0xfd36('0x24')](function(_0x27d4aa){return[_0x27d4aa,!![]];});});}})['spread'](function(_0x2b8910,_0x3aa541){if(_0x3aa541){return _0x2b8910;}return db['OpenchannelMessage'][_0xfd36('0x5c')](_[_0xfd36('0x54')](_0x252fd1[_0xfd36('0x67')],{'read':![],'body':_0x252fd1[_0xfd36('0x67')][_0xfd36('0x67')],'OpenchannelAccountId':_0x40627b['id'],'OpenchannelInteractionId':_0x2b8910['id'],'UserId':_0x252fd1[_0xfd36('0x5f')]['id'],'ContactId':_0x59875b['id']}))[_0xfd36('0x24')](function(_0x428d5b){_0x2b8910[_0xfd36('0xbd')][_0xfd36('0xbc')]=[];_0x2b8910[_0xfd36('0xbd')]['Messages']['push'](_0x428d5b[_0xfd36('0xbd')]);return _0x2b8910;});});}})[_0xfd36('0x24')](respondWithResult(_0x1a44ee,null))[_0xfd36('0x2d')](handleError(_0x1a44ee,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 02424d4..e7d8db3 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa57c=['update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners'];(function(_0xbadd27,_0x1aa93a){var _0x3684ed=function(_0x180007){while(--_0x180007){_0xbadd27['push'](_0xbadd27['shift']());}};_0x3684ed(++_0x1aa93a);}(_0xa57c,0x165));var _0xca57=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa57c[_0xaa1b3e];return _0x454d7d;};'use strict';var EventEmitter=require(_0xca57('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xca57('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xca57('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xca57('0x3'),'afterDestroy':_0xca57('0x4')};function emitEvent(_0x511a1f){return function(_0x63d414,_0x1c3196,_0x2b61dd){OpenchannelAccountEvents[_0xca57('0x5')](_0x511a1f+':'+_0x63d414['id'],_0x63d414);OpenchannelAccountEvents['emit'](_0x511a1f,_0x63d414);_0x2b61dd(null);};}for(var e in events){if(events[_0xca57('0x6')](e)){var event=events[e];OpenchannelAccount[_0xca57('0x7')](e,emitEvent(event));}}module[_0xca57('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x5253=['events','OpenchannelAccount','emit','hasOwnProperty','exports'];(function(_0x1a78e8,_0x456080){var _0x461bcd=function(_0x53bcc7){while(--_0x53bcc7){_0x1a78e8['push'](_0x1a78e8['shift']());}};_0x461bcd(++_0x456080);}(_0x5253,0x96));var _0x3525=function(_0x4d5938,_0x427617){_0x4d5938=_0x4d5938-0x0;var _0x995bd6=_0x5253[_0x4d5938];return _0x995bd6;};'use strict';var EventEmitter=require(_0x3525('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x3525('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x34b152){return function(_0x1b258f,_0x46739e,_0x1251f){OpenchannelAccountEvents[_0x3525('0x2')](_0x34b152+':'+_0x1b258f['id'],_0x1b258f);OpenchannelAccountEvents[_0x3525('0x2')](_0x34b152,_0x1b258f);_0x1251f(null);};}for(var e in events){if(events[_0x3525('0x3')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x3525('0x4')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 1fb8b1e..0c63831 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2bb=['OpenchannelAccount','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./openchannelAccount.attributes','exports'];(function(_0x48f37a,_0x22cebe){var _0x38e220=function(_0x3ddd37){while(--_0x3ddd37){_0x48f37a['push'](_0x48f37a['shift']());}};_0x38e220(++_0x22cebe);}(_0xc2bb,0x1da));var _0xbc2b=function(_0x3917d3,_0xab2510){_0x3917d3=_0x3917d3-0x0;var _0x36b6fa=_0xc2bb[_0x3917d3];return _0x36b6fa;};'use strict';var _=require(_0xbc2b('0x0'));var util=require(_0xbc2b('0x1'));var logger=require(_0xbc2b('0x2'))(_0xbc2b('0x3'));var moment=require(_0xbc2b('0x4'));var BPromise=require('bluebird');var rp=require(_0xbc2b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc2b('0x6'));var config=require(_0xbc2b('0x7'));var attributes=require(_0xbc2b('0x8'));module[_0xbc2b('0x9')]=function(_0x5ddb4f,_0x317eef){return _0x5ddb4f['define'](_0xbc2b('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c9f=['define','openchannel_accounts','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1c9f,0xec));var _0xf1c9=function(_0x137bb3,_0x36d102){_0x137bb3=_0x137bb3-0x0;var _0x5504e4=_0x1c9f[_0x137bb3];return _0x5504e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf1c9('0x0'))(_0xf1c9('0x1'));var moment=require(_0xf1c9('0x2'));var BPromise=require('bluebird');var rp=require(_0xf1c9('0x3'));var fs=require('fs');var path=require(_0xf1c9('0x4'));var rimraf=require(_0xf1c9('0x5'));var config=require(_0xf1c9('0x6'));var attributes=require('./openchannelAccount.attributes');module['exports']=function(_0x45dce9,_0x989b24){return _0x45dce9[_0xf1c9('0x7')]('OpenchannelAccount',attributes,{'tableName':_0xf1c9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 06625df..bb77cd6 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x480a=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info'];(function(_0x3d7444,_0xadd16e){var _0xb20c74=function(_0x37e764){while(--_0x37e764){_0x3d7444['push'](_0x3d7444['shift']());}};_0xb20c74(++_0xadd16e);}(_0x480a,0x9a));var _0xa480=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x480a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa480('0x0'));var util=require(_0xa480('0x1'));var moment=require(_0xa480('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa480('0x3'));var db=require(_0xa480('0x4'))['db'];var utils=require(_0xa480('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xa480('0x6')]=_[_0xa480('0x7')](config[_0xa480('0x6')],{'host':_0xa480('0x8'),'port':0x18eb});var socket=require(_0xa480('0x9'))(new Redis(config['redis']));require(_0xa480('0xa'))[_0xa480('0xb')](socket);function respondWithRpcPromise(_0x2e8597,_0xa65df0,_0x128e64){return new BPromise(function(_0x21d70d,_0x564879){return client[_0xa480('0xc')](_0x2e8597,_0x128e64)['then'](function(_0x13dda5){logger[_0xa480('0xd')](_0xa480('0xe'),_0xa65df0,_0xa480('0xf'));logger[_0xa480('0x10')](_0xa480('0x11'),_0xa65df0,'request\x20sent',JSON['stringify'](_0x13dda5));if(_0x13dda5[_0xa480('0x12')]){if(_0x13dda5[_0xa480('0x12')]['code']===0x1f4){logger[_0xa480('0x12')](_0xa480('0xe'),_0xa65df0,_0x13dda5['error'][_0xa480('0x13')]);return _0x564879(_0x13dda5[_0xa480('0x12')]['message']);}logger[_0xa480('0x12')](_0xa480('0xe'),_0xa65df0,_0x13dda5[_0xa480('0x12')]['message']);return _0x21d70d(_0x13dda5[_0xa480('0x12')][_0xa480('0x13')]);}else{logger[_0xa480('0xd')](_0xa480('0xe'),_0xa65df0,'request\x20sent');_0x21d70d(_0x13dda5['result'][_0xa480('0x13')]);}})[_0xa480('0x14')](function(_0x20ec49){logger[_0xa480('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0xa65df0,_0x20ec49);_0x564879(_0x20ec49);});});} \ No newline at end of file +var _0x2781=['request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x2eea63,_0x44676d){var _0x47d3ba=function(_0x204225){while(--_0x204225){_0x2eea63['push'](_0x2eea63['shift']());}};_0x47d3ba(++_0x44676d);}(_0x2781,0x10e));var _0x1278=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2781[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x1278('0x0'));var util=require('util');var moment=require(_0x1278('0x1'));var BPromise=require(_0x1278('0x2'));var rs=require(_0x1278('0x3'));var fs=require('fs');var Redis=require(_0x1278('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1278('0x5'));var logger=require(_0x1278('0x6'))(_0x1278('0x7'));var config=require('../../config/environment');var jayson=require(_0x1278('0x8'));var client=jayson[_0x1278('0x9')][_0x1278('0xa')]({'port':0x232a});config[_0x1278('0xb')]=_[_0x1278('0xc')](config[_0x1278('0xb')],{'host':_0x1278('0xd'),'port':0x18eb});var socket=require(_0x1278('0xe'))(new Redis(config[_0x1278('0xb')]));require(_0x1278('0xf'))['register'](socket);function respondWithRpcPromise(_0x3c37fc,_0x44e4b6,_0x333845){return new BPromise(function(_0x328b98,_0x368b9f){return client[_0x1278('0x10')](_0x3c37fc,_0x333845)[_0x1278('0x11')](function(_0x58db09){logger[_0x1278('0x12')](_0x1278('0x13'),_0x44e4b6,_0x1278('0x14'));logger[_0x1278('0x15')](_0x1278('0x16'),_0x44e4b6,'request\x20sent',JSON[_0x1278('0x17')](_0x58db09));if(_0x58db09[_0x1278('0x18')]){if(_0x58db09['error'][_0x1278('0x19')]===0x1f4){logger[_0x1278('0x18')](_0x1278('0x13'),_0x44e4b6,_0x58db09['error'][_0x1278('0x1a')]);return _0x368b9f(_0x58db09[_0x1278('0x18')][_0x1278('0x1a')]);}logger[_0x1278('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x44e4b6,_0x58db09['error'][_0x1278('0x1a')]);return _0x328b98(_0x58db09[_0x1278('0x18')][_0x1278('0x1a')]);}else{logger[_0x1278('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x44e4b6,_0x1278('0x14'));_0x328b98(_0x58db09[_0x1278('0x1b')][_0x1278('0x1a')]);}})[_0x1278('0x1c')](function(_0x2ffae3){logger[_0x1278('0x18')](_0x1278('0x13'),_0x44e4b6,_0x2ffae3);_0x368b9f(_0x2ffae3);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 206a747..024b8ba 100644 --- a/server/api/openchannelAccount/openchannelAccount.socket.js +++ b/server/api/openchannelAccount/openchannelAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8bf=['length','openchannelAccount:','./openchannelAccount.events','save','emit','removeListener'];(function(_0x12aade,_0x590f8c){var _0x2e2ae0=function(_0x56f3ba){while(--_0x56f3ba){_0x12aade['push'](_0x12aade['shift']());}};_0x2e2ae0(++_0x590f8c);}(_0xc8bf,0xb0));var _0xfc8b=function(_0xdb1964,_0x2258aa){_0xdb1964=_0xdb1964-0x0;var _0x402d7e=_0xc8bf[_0xdb1964];return _0x402d7e;};'use strict';var OpenchannelAccountEvents=require(_0xfc8b('0x0'));var events=[_0xfc8b('0x1'),'remove','update'];function createListener(_0x2aa94f,_0x18055d){return function(_0x20109e){_0x18055d[_0xfc8b('0x2')](_0x2aa94f,_0x20109e);};}function removeListener(_0x2ffe88,_0xb92e59){return function(){OpenchannelAccountEvents[_0xfc8b('0x3')](_0x2ffe88,_0xb92e59);};}exports['register']=function(_0x332ea3){for(var _0x242c5b=0x0,_0x310439=events[_0xfc8b('0x4')];_0x242c5b<_0x310439;_0x242c5b++){var _0x334fa2=events[_0x242c5b];var _0x58014e=createListener(_0xfc8b('0x5')+_0x334fa2,_0x332ea3);OpenchannelAccountEvents['on'](_0x334fa2,_0x58014e);}}; \ No newline at end of file +var _0xb513=['length','openchannelAccount:','save','update','emit','removeListener','register'];(function(_0x986b92,_0x43d679){var _0x20ef3f=function(_0x2b192c){while(--_0x2b192c){_0x986b92['push'](_0x986b92['shift']());}};_0x20ef3f(++_0x43d679);}(_0xb513,0xc6));var _0x3b51=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0xb513[_0x43026b];return _0x4a96cd;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x3b51('0x0'),'remove',_0x3b51('0x1')];function createListener(_0x323e4f,_0x32e1f6){return function(_0x2a7c38){_0x32e1f6[_0x3b51('0x2')](_0x323e4f,_0x2a7c38);};}function removeListener(_0x55d451,_0x6aad15){return function(){OpenchannelAccountEvents[_0x3b51('0x3')](_0x55d451,_0x6aad15);};}exports[_0x3b51('0x4')]=function(_0x4f9abb){for(var _0x34adf0=0x0,_0x2c9021=events[_0x3b51('0x5')];_0x34adf0<_0x2c9021;_0x34adf0++){var _0x59f1f9=events[_0x34adf0];var _0x5e5236=createListener(_0x3b51('0x6')+_0x59f1f9,_0x4f9abb);OpenchannelAccountEvents['on'](_0x59f1f9,_0x5e5236);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 50fd625..e444abc 100644 --- a/server/api/openchannelApplication/index.js +++ b/server/api/openchannelApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f3d=['put','/:id','update','delete','exports','multer','connect-timeout','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create'];(function(_0x685e41,_0x4fbbe7){var _0x10b996=function(_0x2fd406){while(--_0x2fd406){_0x685e41['push'](_0x685e41['shift']());}};_0x10b996(++_0x4fbbe7);}(_0x3f3d,0x1a5));var _0xd3f3=function(_0xa7c05d,_0x312374){_0xa7c05d=_0xa7c05d-0x0;var _0x47b002=_0x3f3d[_0xa7c05d];return _0x47b002;};'use strict';var multer=require(_0xd3f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd3f3('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xd3f3('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xd3f3('0x3'));var controller=require(_0xd3f3('0x4'));router[_0xd3f3('0x5')]('/',auth[_0xd3f3('0x6')](),controller[_0xd3f3('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd3f3('0x8')]);router[_0xd3f3('0x9')]('/',auth['isAuthenticated'](),controller[_0xd3f3('0xa')]);router[_0xd3f3('0xb')](_0xd3f3('0xc'),auth[_0xd3f3('0x6')](),controller[_0xd3f3('0xd')]);router[_0xd3f3('0xe')](_0xd3f3('0xc'),auth[_0xd3f3('0x6')](),controller['destroy']);module[_0xd3f3('0xf')]=router; \ No newline at end of file +var _0x99c5=['util','path','Router','../../components/auth/service','../../components/interaction/service','get','show','post','create','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x295a5c,_0xfd0b5){var _0x53339e=function(_0x5ee71d){while(--_0x5ee71d){_0x295a5c['push'](_0x295a5c['shift']());}};_0x53339e(++_0xfd0b5);}(_0x99c5,0xe0));var _0x599c=function(_0x11aadc,_0x1dd983){_0x11aadc=_0x11aadc-0x0;var _0x1a80bc=_0x99c5[_0x11aadc];return _0x1a80bc;};'use strict';var multer=require('multer');var util=require(_0x599c('0x0'));var path=require(_0x599c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x599c('0x2')]();var auth=require(_0x599c('0x3'));var interaction=require(_0x599c('0x4'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x599c('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x599c('0x6')]);router[_0x599c('0x7')]('/',auth['isAuthenticated'](),controller[_0x599c('0x8')]);router[_0x599c('0x9')](_0x599c('0xa'),auth[_0x599c('0xb')](),controller[_0x599c('0xc')]);router[_0x599c('0xd')]('/:id',auth[_0x599c('0xb')](),controller[_0x599c('0xe')]);module[_0x599c('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6235dfb..c9c6b9d 100644 --- a/server/api/openchannelApplication/openchannelApplication.attributes.js +++ b/server/api/openchannelApplication/openchannelApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafb7=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xafb7,0xe7));var _0x7afb=function(_0x1baf2d,_0x5e2fed){_0x1baf2d=_0x1baf2d-0x0;var _0x58f808=_0xafb7[_0x1baf2d];return _0x58f808;};'use strict';var Sequelize=require(_0x7afb('0x0'));module[_0x7afb('0x1')]={'priority':{'type':Sequelize[_0x7afb('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7afb('0x3')],'allowNull':![],'defaultValue':_0x7afb('0x4')},'appdata':{'type':Sequelize[_0x7afb('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7afb('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x00bd=['TEXT','sequelize','exports','STRING','noop'];(function(_0x1a80db,_0x39be26){var _0x143503=function(_0x7b5ad4){while(--_0x7b5ad4){_0x1a80db['push'](_0x1a80db['shift']());}};_0x143503(++_0x39be26);}(_0x00bd,0x1b4));var _0xd00b=function(_0x412b43,_0x3b56ac){_0x412b43=_0x412b43-0x0;var _0x5cded0=_0x00bd[_0x412b43];return _0x5cded0;};'use strict';var Sequelize=require(_0xd00b('0x0'));module[_0xd00b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd00b('0x2')],'allowNull':![],'defaultValue':_0xd00b('0x3')},'appdata':{'type':Sequelize[_0xd00b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd00b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index ab3e227..fd7785e 100644 --- a/server/api/openchannelApplication/openchannelApplication.controller.js +++ b/server/api/openchannelApplication/openchannelApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x933f=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x82b0a1,_0x5aa20a){var _0x25b782=function(_0x2693b5){while(--_0x2693b5){_0x82b0a1['push'](_0x82b0a1['shift']());}};_0x25b782(++_0x5aa20a);}(_0x933f,0xb4));var _0xf933=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x933f[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0xf933('0x0'));var emlformat=require(_0xf933('0x1'));var rimraf=require(_0xf933('0x2'));var zipdir=require(_0xf933('0x3'));var jsonpatch=require(_0xf933('0x4'));var rp=require(_0xf933('0x5'));var moment=require(_0xf933('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf933('0x7'));var util=require(_0xf933('0x8'));var path=require(_0xf933('0x9'));var sox=require('sox');var csv=require(_0xf933('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf933('0xb'));var squel=require(_0xf933('0xc'));var crypto=require(_0xf933('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf933('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf933('0xf'));var Papa=require(_0xf933('0x10'));var Redis=require(_0xf933('0x11'));var authService=require(_0xf933('0x12'));var qs=require(_0xf933('0x13'));var as=require(_0xf933('0x14'));var hardwareService=require(_0xf933('0x15'));var logger=require(_0xf933('0x16'))(_0xf933('0x17'));var utils=require(_0xf933('0x18'));var config=require('../../config/environment');var db=require(_0xf933('0x19'))['db'];function respondWithStatusCode(_0x5822da,_0x356571){_0x356571=_0x356571||0xcc;return function(_0x2712bc){if(_0x2712bc){return _0x5822da[_0xf933('0x1a')](_0x356571);}return _0x5822da[_0xf933('0x1b')](_0x356571)[_0xf933('0x1c')]();};}function respondWithResult(_0x56d674,_0xdecf2c){_0xdecf2c=_0xdecf2c||0xc8;return function(_0x3d7540){if(_0x3d7540){return _0x56d674['status'](_0xdecf2c)[_0xf933('0x1d')](_0x3d7540);}};}function respondWithFilteredResult(_0x117e91,_0x1f8bf9){return function(_0x58b0f1){if(_0x58b0f1){var _0x28b111=_0x58b0f1[_0xf933('0x1e')],_0x584fd0=_0x1f8bf9[_0xf933('0x1f')],_0x28eeeb=_0x1f8bf9['offset']+_0x1f8bf9[_0xf933('0x20')],_0x517066;if(_0x28eeeb>=_0x28b111){_0x28eeeb=_0x28b111;_0x517066=0xc8;}else{_0x517066=0xce;}_0x117e91[_0xf933('0x1b')](_0x517066);return _0x117e91[_0xf933('0x21')](_0xf933('0x22'),_0x584fd0+'-'+_0x28eeeb+'/'+_0x28b111)[_0xf933('0x1d')](_0x58b0f1);}return null;};}function patchUpdates(_0x1f6d18){return function(_0x19da3c){try{jsonpatch[_0xf933('0x23')](_0x19da3c,_0x1f6d18,!![]);}catch(_0x39a7bc){return BPromise[_0xf933('0x24')](_0x39a7bc);}return _0x19da3c[_0xf933('0x25')]();};}function saveUpdates(_0x29b48b,_0x2bb6d5){return function(_0x1f12fc){if(_0x1f12fc){return _0x1f12fc[_0xf933('0x26')](_0x29b48b)[_0xf933('0x27')](function(_0x100869){return _0x100869;});}return null;};}function removeEntity(_0x5dad38,_0x14ec3a){return function(_0x2ef71e){if(_0x2ef71e){return _0x2ef71e[_0xf933('0x28')]()[_0xf933('0x27')](function(){_0x5dad38[_0xf933('0x1b')](0xcc)[_0xf933('0x1c')]();});}};}function handleEntityNotFound(_0x53fd5e,_0x4526c3){return function(_0x5f3e60){if(!_0x5f3e60){_0x53fd5e[_0xf933('0x1a')](0x194);}return _0x5f3e60;};}function handleError(_0x1bc003,_0x3c3eae){_0x3c3eae=_0x3c3eae||0x1f4;return function(_0x146652){logger[_0xf933('0x29')](_0x146652[_0xf933('0x2a')]);if(_0x146652[_0xf933('0x2b')]){delete _0x146652[_0xf933('0x2b')];}_0x1bc003[_0xf933('0x1b')](_0x3c3eae)[_0xf933('0x2c')](_0x146652);};}exports[_0xf933('0x2d')]=function(_0x59a1ed,_0xd6369f){var _0x4d7bd9={},_0x5da1de={},_0x31be44={'count':0x0,'rows':[]};var _0x56d39b=_[_0xf933('0x2e')](db[_0xf933('0x2f')][_0xf933('0x30')],function(_0x19c7cb){return{'name':_0x19c7cb[_0xf933('0x31')],'type':_0x19c7cb[_0xf933('0x32')][_0xf933('0x33')]};});_0x5da1de['model']=_[_0xf933('0x2e')](_0x56d39b,'name');_0x5da1de[_0xf933('0x34')]=_[_0xf933('0x35')](_0x59a1ed['query']);_0x5da1de[_0xf933('0x36')]=_[_0xf933('0x37')](_0x5da1de['model'],_0x5da1de['query']);_0x4d7bd9['attributes']=_[_0xf933('0x37')](_0x5da1de[_0xf933('0x38')],qs[_0xf933('0x39')](_0x59a1ed['query'][_0xf933('0x39')]));_0x4d7bd9['attributes']=_0x4d7bd9[_0xf933('0x3a')][_0xf933('0x3b')]?_0x4d7bd9['attributes']:_0x5da1de[_0xf933('0x38')];if(!_0x59a1ed[_0xf933('0x34')][_0xf933('0x3c')](_0xf933('0x3d'))){_0x4d7bd9[_0xf933('0x20')]=qs[_0xf933('0x20')](_0x59a1ed[_0xf933('0x34')][_0xf933('0x20')]);_0x4d7bd9['offset']=qs[_0xf933('0x1f')](_0x59a1ed[_0xf933('0x34')][_0xf933('0x1f')]);}_0x4d7bd9[_0xf933('0x3e')]=qs[_0xf933('0x3f')](_0x59a1ed[_0xf933('0x34')][_0xf933('0x3f')]);_0x4d7bd9[_0xf933('0x40')]=qs[_0xf933('0x36')](_[_0xf933('0x41')](_0x59a1ed[_0xf933('0x34')],_0x5da1de[_0xf933('0x36')]));if(_0x59a1ed[_0xf933('0x34')][_0xf933('0x42')]){_0x4d7bd9[_0xf933('0x40')]=_[_0xf933('0x43')](_0x4d7bd9[_0xf933('0x40')],{'$or':_[_0xf933('0x2e')](_0x56d39b,function(_0xf60e02){if(_0xf60e02['type']!=='VIRTUAL'){var _0x5acf4a={};_0x5acf4a[_0xf60e02[_0xf933('0x2b')]]={'$like':'%'+_0x59a1ed[_0xf933('0x34')][_0xf933('0x42')]+'%'};return _0x5acf4a;}})});}_0x4d7bd9=_[_0xf933('0x43')]({},_0x4d7bd9,_0x59a1ed['options']);var _0x2be2bc={'where':_0x4d7bd9['where']};return db[_0xf933('0x2f')][_0xf933('0x1e')](_0x2be2bc)[_0xf933('0x27')](function(_0xb4210c){_0x31be44[_0xf933('0x1e')]=_0xb4210c;if(_0x59a1ed[_0xf933('0x34')][_0xf933('0x44')]){_0x4d7bd9[_0xf933('0x45')]=[{'all':!![]}];}return db[_0xf933('0x2f')][_0xf933('0x46')](_0x4d7bd9);})[_0xf933('0x27')](function(_0x5739fe){_0x31be44[_0xf933('0x47')]=_0x5739fe;return _0x31be44;})['then'](respondWithFilteredResult(_0xd6369f,_0x4d7bd9))['catch'](handleError(_0xd6369f,null));};exports[_0xf933('0x48')]=function(_0x41c518,_0x48be71){var _0x54fc7f={'raw':!![],'where':{'id':_0x41c518[_0xf933('0x49')]['id']}},_0x3366ad={};_0x3366ad[_0xf933('0x38')]=_[_0xf933('0x35')](db[_0xf933('0x2f')][_0xf933('0x30')]);_0x3366ad[_0xf933('0x34')]=_[_0xf933('0x35')](_0x41c518[_0xf933('0x34')]);_0x3366ad['filters']=_[_0xf933('0x37')](_0x3366ad[_0xf933('0x38')],_0x3366ad[_0xf933('0x34')]);_0x54fc7f[_0xf933('0x3a')]=_[_0xf933('0x37')](_0x3366ad['model'],qs[_0xf933('0x39')](_0x41c518[_0xf933('0x34')][_0xf933('0x39')]));_0x54fc7f[_0xf933('0x3a')]=_0x54fc7f[_0xf933('0x3a')][_0xf933('0x3b')]?_0x54fc7f[_0xf933('0x3a')]:_0x3366ad[_0xf933('0x38')];if(_0x41c518['query'][_0xf933('0x44')]){_0x54fc7f[_0xf933('0x45')]=[{'all':!![]}];}_0x54fc7f=_[_0xf933('0x43')]({},_0x54fc7f,_0x41c518[_0xf933('0x4a')]);return db[_0xf933('0x2f')][_0xf933('0x4b')](_0x54fc7f)['then'](handleEntityNotFound(_0x48be71,null))[_0xf933('0x27')](respondWithResult(_0x48be71,null))[_0xf933('0x4c')](handleError(_0x48be71,null));};exports['create']=function(_0x32151b,_0x2bbec6){return db[_0xf933('0x2f')][_0xf933('0x4d')](_0x32151b['body'],{})[_0xf933('0x27')](respondWithResult(_0x2bbec6,0xc9))[_0xf933('0x4c')](handleError(_0x2bbec6,null));};exports[_0xf933('0x26')]=function(_0xb0fad2,_0x3e54ee){if(_0xb0fad2[_0xf933('0x4e')]['id']){delete _0xb0fad2[_0xf933('0x4e')]['id'];}return db[_0xf933('0x2f')][_0xf933('0x4b')]({'where':{'id':_0xb0fad2[_0xf933('0x49')]['id']}})[_0xf933('0x27')](handleEntityNotFound(_0x3e54ee,null))[_0xf933('0x27')](saveUpdates(_0xb0fad2[_0xf933('0x4e')],null))['then'](respondWithResult(_0x3e54ee,null))['catch'](handleError(_0x3e54ee,null));};exports[_0xf933('0x28')]=function(_0x3a68f7,_0x5cc925){return db[_0xf933('0x2f')][_0xf933('0x4b')]({'where':{'id':_0x3a68f7['params']['id']}})[_0xf933('0x27')](handleEntityNotFound(_0x5cc925,null))[_0xf933('0x27')](removeEntity(_0x5cc925,null))[_0xf933('0x4c')](handleError(_0x5cc925,null));}; \ No newline at end of file +var _0x33ce=['end','json','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','OpenchannelApplication','count','includeAll','include','catch','show','length','find','create','body','params','destroy','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x33ce,0x1d9));var _0xe33c=function(_0x4532d9,_0x3ea59d){_0x4532d9=_0x4532d9-0x0;var _0x330ad0=_0x33ce[_0x4532d9];return _0x330ad0;};'use strict';var pdf=require(_0xe33c('0x0'));var emlformat=require(_0xe33c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe33c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe33c('0x3'));var moment=require(_0xe33c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe33c('0x5'));var util=require(_0xe33c('0x6'));var path=require(_0xe33c('0x7'));var sox=require(_0xe33c('0x8'));var csv=require(_0xe33c('0x9'));var ejs=require(_0xe33c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe33c('0xb'));var crypto=require('crypto');var jsforce=require(_0xe33c('0xc'));var deskjs=require(_0xe33c('0xd'));var toCsv=require(_0xe33c('0x9'));var querystring=require(_0xe33c('0xe'));var Papa=require(_0xe33c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe33c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe33c('0x11'));var logger=require(_0xe33c('0x12'))(_0xe33c('0x13'));var utils=require(_0xe33c('0x14'));var config=require(_0xe33c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fc352,_0x3b27ee){_0x3b27ee=_0x3b27ee||0xcc;return function(_0x220f3e){if(_0x220f3e){return _0x2fc352[_0xe33c('0x16')](_0x3b27ee);}return _0x2fc352[_0xe33c('0x17')](_0x3b27ee)[_0xe33c('0x18')]();};}function respondWithResult(_0x273aa3,_0x49c4eb){_0x49c4eb=_0x49c4eb||0xc8;return function(_0x28265c){if(_0x28265c){return _0x273aa3[_0xe33c('0x17')](_0x49c4eb)[_0xe33c('0x19')](_0x28265c);}};}function respondWithFilteredResult(_0x37cde3,_0x133b4b){return function(_0x3d66ea){if(_0x3d66ea){var _0x154c59=_0x3d66ea['count'],_0x5e839c=_0x133b4b[_0xe33c('0x1a')],_0x700a91=_0x133b4b[_0xe33c('0x1a')]+_0x133b4b[_0xe33c('0x1b')],_0x8875c5;if(_0x700a91>=_0x154c59){_0x700a91=_0x154c59;_0x8875c5=0xc8;}else{_0x8875c5=0xce;}_0x37cde3[_0xe33c('0x17')](_0x8875c5);return _0x37cde3['set'](_0xe33c('0x1c'),_0x5e839c+'-'+_0x700a91+'/'+_0x154c59)['json'](_0x3d66ea);}return null;};}function patchUpdates(_0x14ea14){return function(_0x3bbbc3){try{jsonpatch[_0xe33c('0x1d')](_0x3bbbc3,_0x14ea14,!![]);}catch(_0x92a597){return BPromise[_0xe33c('0x1e')](_0x92a597);}return _0x3bbbc3['save']();};}function saveUpdates(_0x10cb68,_0xad5004){return function(_0x2e02c3){if(_0x2e02c3){return _0x2e02c3[_0xe33c('0x1f')](_0x10cb68)['then'](function(_0x36d687){return _0x36d687;});}return null;};}function removeEntity(_0x46241c,_0x2c14ba){return function(_0x174e82){if(_0x174e82){return _0x174e82['destroy']()[_0xe33c('0x20')](function(){_0x46241c['status'](0xcc)[_0xe33c('0x18')]();});}};}function handleEntityNotFound(_0x3f19c8,_0x5b0d33){return function(_0x51558b){if(!_0x51558b){_0x3f19c8['sendStatus'](0x194);}return _0x51558b;};}function handleError(_0x2ea5e0,_0x4ccaa0){_0x4ccaa0=_0x4ccaa0||0x1f4;return function(_0x2eee38){logger[_0xe33c('0x21')](_0x2eee38[_0xe33c('0x22')]);if(_0x2eee38[_0xe33c('0x23')]){delete _0x2eee38[_0xe33c('0x23')];}_0x2ea5e0[_0xe33c('0x17')](_0x4ccaa0)[_0xe33c('0x24')](_0x2eee38);};}exports[_0xe33c('0x25')]=function(_0x52066f,_0xab4728){var _0x5a4789={},_0x9e093f={},_0x2ee05f={'count':0x0,'rows':[]};var _0x4a5872=_[_0xe33c('0x26')](db['OpenchannelApplication'][_0xe33c('0x27')],function(_0x5aeb8e){return{'name':_0x5aeb8e[_0xe33c('0x28')],'type':_0x5aeb8e[_0xe33c('0x29')][_0xe33c('0x2a')]};});_0x9e093f[_0xe33c('0x2b')]=_[_0xe33c('0x26')](_0x4a5872,'name');_0x9e093f[_0xe33c('0x2c')]=_[_0xe33c('0x2d')](_0x52066f[_0xe33c('0x2c')]);_0x9e093f[_0xe33c('0x2e')]=_[_0xe33c('0x2f')](_0x9e093f[_0xe33c('0x2b')],_0x9e093f['query']);_0x5a4789[_0xe33c('0x30')]=_[_0xe33c('0x2f')](_0x9e093f['model'],qs[_0xe33c('0x31')](_0x52066f[_0xe33c('0x2c')][_0xe33c('0x31')]));_0x5a4789[_0xe33c('0x30')]=_0x5a4789['attributes']['length']?_0x5a4789[_0xe33c('0x30')]:_0x9e093f[_0xe33c('0x2b')];if(!_0x52066f[_0xe33c('0x2c')][_0xe33c('0x32')](_0xe33c('0x33'))){_0x5a4789[_0xe33c('0x1b')]=qs[_0xe33c('0x1b')](_0x52066f[_0xe33c('0x2c')]['limit']);_0x5a4789[_0xe33c('0x1a')]=qs[_0xe33c('0x1a')](_0x52066f[_0xe33c('0x2c')][_0xe33c('0x1a')]);}_0x5a4789[_0xe33c('0x34')]=qs[_0xe33c('0x35')](_0x52066f[_0xe33c('0x2c')]['sort']);_0x5a4789[_0xe33c('0x36')]=qs[_0xe33c('0x2e')](_['pick'](_0x52066f[_0xe33c('0x2c')],_0x9e093f[_0xe33c('0x2e')]));if(_0x52066f[_0xe33c('0x2c')][_0xe33c('0x37')]){_0x5a4789[_0xe33c('0x36')]=_['merge'](_0x5a4789[_0xe33c('0x36')],{'$or':_[_0xe33c('0x26')](_0x4a5872,function(_0x1865ff){if(_0x1865ff['type']!==_0xe33c('0x38')){var _0x963728={};_0x963728[_0x1865ff[_0xe33c('0x23')]]={'$like':'%'+_0x52066f['query'][_0xe33c('0x37')]+'%'};return _0x963728;}})});}_0x5a4789=_[_0xe33c('0x39')]({},_0x5a4789,_0x52066f[_0xe33c('0x3a')]);var _0x428448={'where':_0x5a4789['where']};return db[_0xe33c('0x3b')][_0xe33c('0x3c')](_0x428448)[_0xe33c('0x20')](function(_0x3cb320){_0x2ee05f[_0xe33c('0x3c')]=_0x3cb320;if(_0x52066f[_0xe33c('0x2c')][_0xe33c('0x3d')]){_0x5a4789[_0xe33c('0x3e')]=[{'all':!![]}];}return db[_0xe33c('0x3b')]['findAll'](_0x5a4789);})['then'](function(_0x14f807){_0x2ee05f['rows']=_0x14f807;return _0x2ee05f;})[_0xe33c('0x20')](respondWithFilteredResult(_0xab4728,_0x5a4789))[_0xe33c('0x3f')](handleError(_0xab4728,null));};exports[_0xe33c('0x40')]=function(_0x574336,_0x29f091){var _0x305f7f={'raw':!![],'where':{'id':_0x574336['params']['id']}},_0x2335e2={};_0x2335e2[_0xe33c('0x2b')]=_[_0xe33c('0x2d')](db[_0xe33c('0x3b')]['rawAttributes']);_0x2335e2[_0xe33c('0x2c')]=_['keys'](_0x574336['query']);_0x2335e2[_0xe33c('0x2e')]=_[_0xe33c('0x2f')](_0x2335e2['model'],_0x2335e2[_0xe33c('0x2c')]);_0x305f7f[_0xe33c('0x30')]=_[_0xe33c('0x2f')](_0x2335e2[_0xe33c('0x2b')],qs[_0xe33c('0x31')](_0x574336['query'][_0xe33c('0x31')]));_0x305f7f['attributes']=_0x305f7f['attributes'][_0xe33c('0x41')]?_0x305f7f[_0xe33c('0x30')]:_0x2335e2[_0xe33c('0x2b')];if(_0x574336[_0xe33c('0x2c')]['includeAll']){_0x305f7f['include']=[{'all':!![]}];}_0x305f7f=_[_0xe33c('0x39')]({},_0x305f7f,_0x574336['options']);return db[_0xe33c('0x3b')][_0xe33c('0x42')](_0x305f7f)[_0xe33c('0x20')](handleEntityNotFound(_0x29f091,null))['then'](respondWithResult(_0x29f091,null))[_0xe33c('0x3f')](handleError(_0x29f091,null));};exports['create']=function(_0x3218cf,_0x50f738){return db['OpenchannelApplication'][_0xe33c('0x43')](_0x3218cf['body'],{})[_0xe33c('0x20')](respondWithResult(_0x50f738,0xc9))[_0xe33c('0x3f')](handleError(_0x50f738,null));};exports[_0xe33c('0x1f')]=function(_0x5d5c8d,_0x25c556){if(_0x5d5c8d['body']['id']){delete _0x5d5c8d[_0xe33c('0x44')]['id'];}return db['OpenchannelApplication'][_0xe33c('0x42')]({'where':{'id':_0x5d5c8d[_0xe33c('0x45')]['id']}})['then'](handleEntityNotFound(_0x25c556,null))[_0xe33c('0x20')](saveUpdates(_0x5d5c8d[_0xe33c('0x44')],null))['then'](respondWithResult(_0x25c556,null))[_0xe33c('0x3f')](handleError(_0x25c556,null));};exports[_0xe33c('0x46')]=function(_0x1f0903,_0x24520a){return db[_0xe33c('0x3b')][_0xe33c('0x42')]({'where':{'id':_0x1f0903[_0xe33c('0x45')]['id']}})[_0xe33c('0x20')](handleEntityNotFound(_0x24520a,null))[_0xe33c('0x20')](removeEntity(_0x24520a,null))[_0xe33c('0x3f')](handleError(_0x24520a,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 886ace7..24aebeb 100644 --- a/server/api/openchannelApplication/openchannelApplication.model.js +++ b/server/api/openchannelApplication/openchannelApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07f9=['define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0x3630e4,_0x387a59){var _0x5b087e=function(_0x3cddcd){while(--_0x3cddcd){_0x3630e4['push'](_0x3630e4['shift']());}};_0x5b087e(++_0x387a59);}(_0x07f9,0xe5));var _0x907f=function(_0xb48350,_0x605de2){_0xb48350=_0xb48350-0x0;var _0x49e0f9=_0x07f9[_0xb48350];return _0x49e0f9;};'use strict';var _=require(_0x907f('0x0'));var util=require('util');var logger=require(_0x907f('0x1'))(_0x907f('0x2'));var moment=require(_0x907f('0x3'));var BPromise=require(_0x907f('0x4'));var rp=require(_0x907f('0x5'));var fs=require('fs');var path=require(_0x907f('0x6'));var rimraf=require(_0x907f('0x7'));var config=require(_0x907f('0x8'));var attributes=require(_0x907f('0x9'));module[_0x907f('0xa')]=function(_0x4d4709,_0x564ae7){return _0x4d4709[_0x907f('0xb')](_0x907f('0xc'),attributes,{'tableName':_0x907f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x907f('0xe')});}; \ No newline at end of file +var _0x463d=['../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x463d,0x168));var _0xd463=function(_0x20c983,_0x5230f2){_0x20c983=_0x20c983-0x0;var _0x3b747a=_0x463d[_0x20c983];return _0x3b747a;};'use strict';var _=require(_0xd463('0x0'));var util=require(_0xd463('0x1'));var logger=require('../../config/logger')(_0xd463('0x2'));var moment=require(_0xd463('0x3'));var BPromise=require(_0xd463('0x4'));var rp=require(_0xd463('0x5'));var fs=require('fs');var path=require(_0xd463('0x6'));var rimraf=require(_0xd463('0x7'));var config=require(_0xd463('0x8'));var attributes=require(_0xd463('0x9'));module[_0xd463('0xa')]=function(_0x4d3a45,_0x122c69){return _0x4d3a45[_0xd463('0xb')](_0xd463('0xc'),attributes,{'tableName':_0xd463('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd463('0xe'),'collate':_0xd463('0xf')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index f4dd554..3849189 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x57df4e,_0x2acb6d){var _0x29f72e=function(_0x16158a){while(--_0x16158a){_0x57df4e['push'](_0x57df4e['shift']());}};_0x29f72e(++_0x2acb6d);}(_0xb10b,0x12a));var _0xbb10=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb10b[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify'];(function(_0x471a85,_0x239e8d){var _0x5f2039=function(_0x378952){while(--_0x378952){_0x471a85['push'](_0x471a85['shift']());}};_0x5f2039(++_0x239e8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14d66b,_0x570a85){_0x14d66b=_0x14d66b-0x0;var _0x43fd36=_0x5f2f[_0x14d66b];return _0x43fd36;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index d100e99..7a8146b 100644 --- a/server/api/openchannelInteraction/index.js +++ b/server/api/openchannelInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f87=['connect-timeout','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','tracked','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','util','path'];(function(_0x2275ab,_0x268eca){var _0x25b636=function(_0x1a6fa9){while(--_0x1a6fa9){_0x2275ab['push'](_0x2275ab['shift']());}};_0x25b636(++_0x268eca);}(_0x1f87,0x14e));var _0x71f8=function(_0xedc5db,_0x210b81){_0xedc5db=_0xedc5db-0x0;var _0x319879=_0x1f87[_0xedc5db];return _0x319879;};'use strict';var multer=require('multer');var util=require(_0x71f8('0x0'));var path=require(_0x71f8('0x1'));var timeout=require(_0x71f8('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x71f8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x71f8('0x4'));var controller=require(_0x71f8('0x5'));router['get']('/',auth[_0x71f8('0x6')](),controller[_0x71f8('0x7')]);router[_0x71f8('0x8')](_0x71f8('0x9'),auth[_0x71f8('0x6')](),controller['describe']);router[_0x71f8('0x8')](_0x71f8('0xa'),auth[_0x71f8('0x6')](),controller[_0x71f8('0xb')]);router['get'](_0x71f8('0xc'),auth[_0x71f8('0x6')](),controller['getMessages']);router[_0x71f8('0x8')](_0x71f8('0xd'),auth[_0x71f8('0x6')](),controller[_0x71f8('0xe')]);router[_0x71f8('0xf')]('/',auth[_0x71f8('0x6')](),controller[_0x71f8('0x10')]);router['post'](_0x71f8('0xc'),auth[_0x71f8('0x6')](),controller[_0x71f8('0x11')]);router[_0x71f8('0xf')](_0x71f8('0x12'),auth[_0x71f8('0x6')](),interaction['tracked'](_0x71f8('0x13'),_0x71f8('0x14')),controller['addTags']);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x71f8('0x15')](_0x71f8('0x13'),_0x71f8('0x16')),controller['update']);router[_0x71f8('0x17')]('/:id',auth[_0x71f8('0x6')](),interaction[_0x71f8('0x15')](_0x71f8('0x13'),_0x71f8('0x18')),controller[_0x71f8('0x19')]);router[_0x71f8('0x17')](_0x71f8('0x12'),auth[_0x71f8('0x6')](),controller[_0x71f8('0x1a')]);module[_0x71f8('0x1b')]=router; \ No newline at end of file +var _0xc396=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path'];(function(_0x230ed4,_0x3f72aa){var _0x4fd456=function(_0x2fbb71){while(--_0x2fbb71){_0x230ed4['push'](_0x230ed4['shift']());}};_0x4fd456(++_0x3f72aa);}(_0xc396,0x1c4));var _0x6c39=function(_0x5c2c1e,_0xf9be12){_0x5c2c1e=_0x5c2c1e-0x0;var _0x590a3e=_0xc396[_0x5c2c1e];return _0x590a3e;};'use strict';var multer=require(_0x6c39('0x0'));var util=require(_0x6c39('0x1'));var path=require(_0x6c39('0x2'));var timeout=require(_0x6c39('0x3'));var express=require(_0x6c39('0x4'));var router=express[_0x6c39('0x5')]();var auth=require(_0x6c39('0x6'));var interaction=require(_0x6c39('0x7'));var config=require('../../config/environment');var controller=require(_0x6c39('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6c39('0x9')]);router[_0x6c39('0xa')](_0x6c39('0xb'),auth[_0x6c39('0xc')](),controller[_0x6c39('0xd')]);router[_0x6c39('0xa')](_0x6c39('0xe'),auth[_0x6c39('0xc')](),controller[_0x6c39('0xf')]);router[_0x6c39('0xa')](_0x6c39('0x10'),auth[_0x6c39('0xc')](),controller[_0x6c39('0x11')]);router['get'](_0x6c39('0x12'),auth[_0x6c39('0xc')](),controller[_0x6c39('0x13')]);router[_0x6c39('0x14')]('/',auth[_0x6c39('0xc')](),controller['create']);router[_0x6c39('0x14')](_0x6c39('0x10'),auth['isAuthenticated'](),controller[_0x6c39('0x15')]);router[_0x6c39('0x14')](_0x6c39('0x16'),auth[_0x6c39('0xc')](),interaction[_0x6c39('0x17')](_0x6c39('0x18'),_0x6c39('0x19')),controller[_0x6c39('0x1a')]);router[_0x6c39('0x1b')](_0x6c39('0xe'),auth[_0x6c39('0xc')](),interaction['tracked']('openchannel',_0x6c39('0x1c')),controller[_0x6c39('0x1d')]);router[_0x6c39('0x1e')](_0x6c39('0xe'),auth['isAuthenticated'](),interaction[_0x6c39('0x17')](_0x6c39('0x18'),_0x6c39('0x1f')),controller[_0x6c39('0x20')]);router[_0x6c39('0x1e')](_0x6c39('0x16'),auth['isAuthenticated'](),controller[_0x6c39('0x21')]);module[_0x6c39('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 33e1f35..b7c8829 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js +++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc64f=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x7ef48e,_0x5f2089){var _0x199a9e=function(_0x104887){while(--_0x104887){_0x7ef48e['push'](_0x7ef48e['shift']());}};_0x199a9e(++_0x5f2089);}(_0xc64f,0x78));var _0xfc64=function(_0x1023b6,_0x1f7323){_0x1023b6=_0x1023b6-0x0;var _0x2b68fe=_0xc64f[_0x1023b6];return _0x2b68fe;};'use strict';var Sequelize=require(_0xfc64('0x0'));module['exports']={'closed':{'type':Sequelize[_0xfc64('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfc64('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfc64('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xfc64('0x3')]},'lastMsgAt':{'type':Sequelize[_0xfc64('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xfc64('0x4')]('in',_0xfc64('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xfc64('0x3')]}}; \ No newline at end of file +var _0xb619=['STRING','ENUM','out','BOOLEAN','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb619,0x80));var _0x9b61=function(_0x873b71,_0x4d40e5){_0x873b71=_0x873b71-0x0;var _0x451749=_0xb619[_0x873b71];return _0x451749;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x9b61('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9b61('0x1')]},'disposition':{'type':Sequelize[_0x9b61('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x9b61('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9b61('0x3')]('in',_0x9b61('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9b61('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 65079e2..2f782f6 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.controller.js +++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5162=['Openchannel','YYYY-MM-DD','mkdirSync','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','Private','basename','existsSync','createReadStream','System','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','html-pdf','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','stack','name','send','map','TagIds','Tags','split','forEach','push','catch','index','fieldName','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','color','tools_tags','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','buildExpression','text','body','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','user','getOpenchannelAccounts','toString','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','all','show','params','rawAttributes','intersection','includeAll','include','merge','options','OpenchannelInteraction','create','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','filter','findAll','rows','addTags','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Messages','direction','secret','CmContact','firstName','lastName','Attachment','Account','Owner','fullname','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5162,0x103));var _0x2516=function(_0x5e2f7b,_0x226498){_0x5e2f7b=_0x5e2f7b-0x0;var _0x3c386e=_0x5162[_0x5e2f7b];return _0x3c386e;};'use strict';var pdf=require(_0x2516('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2516('0x1'));var moment=require(_0x2516('0x2'));var BPromise=require(_0x2516('0x3'));var Mustache=require(_0x2516('0x4'));var util=require(_0x2516('0x5'));var path=require(_0x2516('0x6'));var sox=require(_0x2516('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0xc'));var querystring=require(_0x2516('0xd'));var Papa=require(_0x2516('0xe'));var Redis=require('ioredis');var authService=require(_0x2516('0xf'));var qs=require(_0x2516('0x10'));var as=require(_0x2516('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];config[_0x2516('0x14')]=_[_0x2516('0x15')](config['redis'],{'host':_0x2516('0x16'),'port':0x18eb});var socket=require(_0x2516('0x17'))(new Redis(config[_0x2516('0x14')]));require(_0x2516('0x18'))[_0x2516('0x19')](socket);function respondWithStatusCode(_0x558d20,_0x3e5e0f){_0x3e5e0f=_0x3e5e0f||0xcc;return function(_0x2edb47){if(_0x2edb47){return _0x558d20[_0x2516('0x1a')](_0x3e5e0f);}return _0x558d20[_0x2516('0x1b')](_0x3e5e0f)[_0x2516('0x1c')]();};}function respondWithResult(_0x2ec31f,_0x19aacb){_0x19aacb=_0x19aacb||0xc8;return function(_0x5dee15){if(_0x5dee15){return _0x2ec31f[_0x2516('0x1b')](_0x19aacb)['json'](_0x5dee15);}};}function respondWithFilteredResult(_0x1fdd73,_0x1ced29){return function(_0x1a1005){if(_0x1a1005){var _0x564d05=_0x1a1005[_0x2516('0x1d')],_0x1979d7=_0x1ced29[_0x2516('0x1e')],_0x5e96c7=_0x1ced29[_0x2516('0x1e')]+_0x1ced29[_0x2516('0x1f')],_0x532d46;if(_0x5e96c7>=_0x564d05){_0x5e96c7=_0x564d05;_0x532d46=0xc8;}else{_0x532d46=0xce;}_0x1fdd73[_0x2516('0x1b')](_0x532d46);return _0x1fdd73[_0x2516('0x20')](_0x2516('0x21'),_0x1979d7+'-'+_0x5e96c7+'/'+_0x564d05)[_0x2516('0x22')](_0x1a1005);}return null;};}function patchUpdates(_0x248c5a){return function(_0x37485b){try{jsonpatch[_0x2516('0x23')](_0x37485b,_0x248c5a,!![]);}catch(_0x11e78b){return BPromise[_0x2516('0x24')](_0x11e78b);}return _0x37485b['save']();};}function saveUpdates(_0x559a3e,_0x12db4d){return function(_0x1c8993){if(_0x1c8993){return _0x1c8993[_0x2516('0x25')](_0x559a3e)[_0x2516('0x26')](function(_0x3ffb6d){return _0x3ffb6d;});}return null;};}function removeEntity(_0x32de7a,_0x3d906d){return function(_0x950477){if(_0x950477){return _0x950477['destroy']()[_0x2516('0x26')](function(){_0x32de7a[_0x2516('0x1b')](0xcc)[_0x2516('0x1c')]();});}};}function handleEntityNotFound(_0x434d54,_0x47f4fb){return function(_0x399c16){if(!_0x399c16){_0x434d54[_0x2516('0x1a')](0x194);}return _0x399c16;};}function handleError(_0x1f722c,_0x3d728a){_0x3d728a=_0x3d728a||0x1f4;return function(_0xd84b29){logger['error'](_0xd84b29[_0x2516('0x27')]);if(_0xd84b29[_0x2516('0x28')]){delete _0xd84b29[_0x2516('0x28')];}_0x1f722c[_0x2516('0x1b')](_0x3d728a)[_0x2516('0x29')](_0xd84b29);};}function getInteractionUsers(_0x285e67,_0x556f01){return new BPromise(function(_0x136893,_0x20dc9f){try{if(_0x556f01[_0x285e67['id']]){_0x285e67['Users']=_[_0x2516('0x2a')](_0x556f01[_0x285e67['id']],function(_0x1de031){return{'id':_0x1de031['id']};});}}catch(_0x4527f1){_0x20dc9f(_0x4527f1);}_0x136893(_0x285e67);});}function getInteractionTags(_0x3b1aa6,_0x539704){return new BPromise(function(_0x170324,_0x2e92f2){try{if(_0x3b1aa6[_0x2516('0x2b')]){_0x3b1aa6[_0x2516('0x2c')]=[];_0x3b1aa6[_0x2516('0x2b')][_0x2516('0x2d')](',')[_0x2516('0x2e')](function(_0x2a5346){_0x3b1aa6[_0x2516('0x2c')][_0x2516('0x2f')](_0x539704[_0x2a5346]);});}delete _0x3b1aa6['TagIds'];}catch(_0x3e7a55){_0x2e92f2(_0x3e7a55);}_0x170324(_0x3b1aa6);});}function updateOpenchannelInteraction(_0x54147b,_0x35fdf8,_0x4dff85){return new BPromise(function(_0x121574,_0x49a34a){return getInteractionUsers(_0x54147b,_0x4dff85)[_0x2516('0x26')](function(_0x9133f8){return getInteractionTags(_0x9133f8,_0x35fdf8);})[_0x2516('0x26')](function(_0x261cff){_0x121574(_0x261cff);})[_0x2516('0x30')](function(_0x3947e7){_0x49a34a(_0x3947e7);});});}exports[_0x2516('0x31')]=function(_0x1c74ca,_0x1ad634){var _0x5e67bc={},_0x2965e6={},_0x4578c7={'count':0x0,'rows':[]};var _0x3d7552=_[_0x2516('0x2a')](db['OpenchannelInteraction']['rawAttributes'],function(_0x3f505f){return{'name':_0x3f505f[_0x2516('0x32')],'type':_0x3f505f[_0x2516('0x33')][_0x2516('0x34')]};});_0x2965e6[_0x2516('0x35')]=_[_0x2516('0x2a')](_0x3d7552,_0x2516('0x28'));_0x2965e6[_0x2516('0x36')]=_[_0x2516('0x37')](_0x1c74ca[_0x2516('0x36')]);_0x2965e6['filters']=_['intersection'](_0x2965e6[_0x2516('0x35')],_0x2965e6[_0x2516('0x36')]);_0x5e67bc['attributes']=_['intersection'](_0x2965e6[_0x2516('0x35')],qs[_0x2516('0x38')](_0x1c74ca['query'][_0x2516('0x38')]));_0x5e67bc['attributes']=_0x5e67bc[_0x2516('0x39')][_0x2516('0x3a')]?_0x5e67bc['attributes']:_0x2965e6[_0x2516('0x35')];if(!_0x1c74ca[_0x2516('0x36')][_0x2516('0x3b')](_0x2516('0x3c'))){_0x5e67bc[_0x2516('0x1f')]=qs[_0x2516('0x1f')](_0x1c74ca[_0x2516('0x36')][_0x2516('0x1f')]);_0x5e67bc[_0x2516('0x1e')]=qs[_0x2516('0x1e')](_0x1c74ca[_0x2516('0x36')][_0x2516('0x1e')]);}_0x5e67bc[_0x2516('0x3d')]=qs['sort'](_0x1c74ca[_0x2516('0x36')][_0x2516('0x3e')]);_0x5e67bc['where']=qs[_0x2516('0x3f')](_[_0x2516('0x40')](_0x1c74ca[_0x2516('0x36')],_0x2965e6[_0x2516('0x3f')]));var _0x421c58=[];var _0x582cb6=squel[_0x2516('0x41')]()[_0x2516('0x42')]('id')[_0x2516('0x42')](_0x2516('0x28'))[_0x2516('0x42')](_0x2516('0x43'))['from'](_0x2516('0x44'));var _0x30fb17=squel[_0x2516('0x41')]()[_0x2516('0x42')](_0x2516('0x45'))[_0x2516('0x42')](_0x2516('0x46'))['from'](_0x2516('0x47'),'ui')['left_join'](_0x2516('0x48'),'u','u.id\x20=\x20ui.UserId');var _0x396be6=squel[_0x2516('0x41')]()[_0x2516('0x49')]('openchannel_interactions','i')['left_join'](_0x2516('0x4a'),'c',_0x2516('0x4b'))['left_join']('users','o',_0x2516('0x4c'))[_0x2516('0x4d')](_0x2516('0x4e'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x2516('0x4d')]('openchannel_messages','me',_0x2516('0x4f'))[_0x2516('0x4d')](_0x2516('0x50'),'it',_0x2516('0x51'))['left_join'](_0x2516('0x44'),'t',_0x2516('0x52'));var _0x16b382=squel[_0x2516('0x53')]();var _0x43874c=[];var _0x482883=squel[_0x2516('0x53')]();var _0x226466;if(_0x1c74ca[_0x2516('0x36')][_0x2516('0x54')]){_0x226466=as['parseSearch'](_0x1c74ca[_0x2516('0x36')][_0x2516('0x54')]);var _0x19b57a=_0x226466[_0x2516('0x55')];for(var _0xdeb59b=0x0;_0xdeb59b<_0x226466['conditions'][_0x2516('0x3a')];_0xdeb59b++){var _0x1aa854=_0x226466[_0x2516('0x56')][_0xdeb59b];var _0x2810e8='i';var _0x1ebe64=_[_0x2516('0x57')](_0x3d7552,['name',_0x1aa854['field']]);if(!_0x1ebe64){switch(_0x1aa854['field']){case _0x2516('0x58'):if(_0x1aa854['value']==0x1){_0x396be6['having']('`'+_0x1aa854['field']+_0x2516('0x59'));}else{_0x396be6[_0x2516('0x5a')]('`'+_0x1aa854[_0x2516('0x42')]+_0x2516('0x5b'));}break;case _0x2516('0x5c'):if(_0x1aa854['operator']===_0x2516('0x5d')){if(_0x1aa854[_0x2516('0x5e')][_0x2516('0x2d')]('\x20')['length']>0x1){_0x16b382[_0x19b57a](_0x2516('0x5f'),qs[_0x2516('0x60')](_0x1aa854['value']),null);}else{var _0x1b5411='%'+_0x1aa854[_0x2516('0x5e')]+'%';_0x16b382[_0x19b57a](_0x2516('0x61'),_0x1b5411,_0x1b5411,_0x1b5411);}}else{_0x1ebe64=_[_0x2516('0x57')](_0x3d7552,[_0x2516('0x28'),'ContactId']);_0x1aa854['field']=_0x2516('0x62');_0x29cf37=as['buildExpression'](_0x2810e8,_0x1ebe64[_0x2516('0x33')],_0x1aa854);_0x16b382[_0x19b57a](_0x29cf37['text'],_0x29cf37[_0x2516('0x5e')][_0x2516('0x63')],_0x29cf37[_0x2516('0x5e')][_0x2516('0x1c')]);}break;case _0x2516('0x64'):var _0x4751fd=_0x1aa854[_0x2516('0x5e')][_0x2516('0x2d')](',')[_0x2516('0x2a')](function(_0xe6bfc7){return Number(_0xe6bfc7);});_0x4751fd[_0x2516('0x2e')](function(_0x4f095a){_0x482883['or'](_0x2516('0x65'),'%,'+_0x4f095a+',%');});_0x43874c=_[_0x2516('0x66')](_0x43874c,_0x4751fd);break;case _0x2516('0x67'):if(_0x1aa854['operator']===_0x2516('0x5d')){_0x16b382[_0x19b57a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1aa854[_0x2516('0x5e')]+'%',null);}else{_0x1ebe64=_[_0x2516('0x57')](_0x3d7552,[_0x2516('0x28'),'UserId']);_0x1aa854['field']='UserId';_0x29cf37=as[_0x2516('0x68')](_0x2810e8,_0x1ebe64[_0x2516('0x33')],_0x1aa854);_0x16b382[_0x19b57a](_0x29cf37[_0x2516('0x69')],_0x29cf37[_0x2516('0x5e')]['start'],_0x29cf37[_0x2516('0x5e')][_0x2516('0x1c')]);}break;case _0x2516('0x6a'):_0x29cf37=as['buildExpression']('me',null,_0x1aa854);_0x16b382[_0x19b57a](_0x29cf37[_0x2516('0x69')],_0x29cf37[_0x2516('0x5e')][_0x2516('0x63')],_0x29cf37[_0x2516('0x5e')][_0x2516('0x1c')]);break;}}else{var _0x29cf37=as[_0x2516('0x68')](_0x2810e8,_0x1ebe64[_0x2516('0x33')],_0x1aa854);_0x16b382[_0x19b57a](_0x29cf37[_0x2516('0x69')],_0x29cf37[_0x2516('0x5e')][_0x2516('0x63')],_0x29cf37[_0x2516('0x5e')][_0x2516('0x1c')]);}}}else{var _0x47f211=_(_0x1c74ca[_0x2516('0x36')])[_0x2516('0x37')]()[_0x2516('0x2a')](function(_0x105940){return _[_0x2516('0x6b')](_0x3d7552,[_0x2516('0x28'),_0x105940])?_0x105940:undefined;})[_0x2516('0x6c')]()['value']();if(!_[_0x2516('0x6d')](_0x47f211)){_0x47f211[_0x2516('0x2e')](function(_0x2ee658){if(_0x2ee658===_0x2516('0x6e')){_0x396be6[_0x2516('0x6f')](_0x2516('0x70'),[]['concat'](_0x1c74ca['query'][_0x2ee658]));}else if(_0x2ee658==='createdAt'){var _0x331d78=JSON[_0x2516('0x71')](_0x1c74ca[_0x2516('0x36')][_0x2ee658])[_0x2516('0x72')];var _0x58730b=JSON['parse'](_0x1c74ca[_0x2516('0x36')][_0x2ee658])['$lte'];_0x396be6[_0x2516('0x6f')](_0x2516('0x73'),_0x331d78,_0x58730b);}else{if(_0x1c74ca['query'][_0x2ee658]===_0x2516('0x74')){_0x396be6[_0x2516('0x6f')]('i.'+_0x2ee658+_0x2516('0x75'));}else{_0x396be6[_0x2516('0x6f')]('i.'+_0x2ee658+_0x2516('0x76'),_0x1c74ca[_0x2516('0x36')][_0x2ee658]);}}});}if(_0x1c74ca[_0x2516('0x36')][_0x2516('0x77')]){if(_0x1c74ca[_0x2516('0x36')]['read']==0x1){_0x396be6['having'](_0x2516('0x78'));}else{_0x396be6[_0x2516('0x5a')](_0x2516('0x79'));}}if(_0x1c74ca['query'][_0x2516('0x7a')]){_0x43874c=_['isArray'](_0x1c74ca[_0x2516('0x36')][_0x2516('0x7a')])?_0x1c74ca[_0x2516('0x36')][_0x2516('0x7a')]:new Array(_0x1c74ca[_0x2516('0x36')][_0x2516('0x7a')]);_0x43874c[_0x2516('0x2e')](function(_0x3379f8){_0x482883['or'](_0x2516('0x65'),'%,'+_0x3379f8+',%');});}if(_0x1c74ca[_0x2516('0x36')]['filter']){var _0x4eac04=_0x1c74ca[_0x2516('0x36')]['filter']['replace']('\x5c','\x5c\x5c')[_0x2516('0x7b')]('\x27\x27',_0x2516('0x7c'));if(qs[_0x2516('0x7d')](_0x4eac04)){_0x16b382['or'](_0x2516('0x7e'),_0x4eac04+'%');}else{_0x16b382['or'](_0x2516('0x7f'),qs[_0x2516('0x60')](_0x4eac04))['or'](_0x2516('0x80'),_0x4eac04+'%')['or'](_0x2516('0x81'),_0x4eac04+'%');}}}_0x396be6[_0x2516('0x6f')](_0x16b382);_0x396be6['group'](_0x2516('0x82'));var _0x2e1029={'type':db[_0x2516('0x83')][_0x2516('0x84')]['SELECT'],'raw':!![]};var _0x9df753=_0x396be6[_0x2516('0x85')]();_0x9df753[_0x2516('0x42')](_0x2516('0x82'));_0x9df753[_0x2516('0x42')](_0x2516('0x86'),'unreadMessages');if(_0x5e67bc[_0x2516('0x3d')]){_0x5e67bc['order']['forEach'](function(_0x377083){_0x396be6[_0x2516('0x3d')]('i.'+_0x377083[0x0],_0x377083[0x1]===_0x2516('0x87')?![]:!![]);});}if(!_['isEmpty'](_0x43874c)){_0x396be6[_0x2516('0x5a')](_0x482883);_0x9df753[_0x2516('0x6f')](_0x2516('0x88'),_0x43874c);}BPromise[_0x2516('0x89')]()['then'](function(){if(!_0x226466&&_0x1c74ca[_0x2516('0x36')][_0x2516('0x6e')])return;return _0x1c74ca[_0x2516('0x8a')][_0x2516('0x8b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x42d604){if(_[_0x2516('0x6d')](_0x42d604)){_0x9df753[_0x2516('0x6f')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x396be6[_0x2516('0x6f')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x9df753[_0x2516('0x6f')](_0x2516('0x70'),_[_0x2516('0x2a')](_0x42d604,'id'));_0x396be6[_0x2516('0x6f')](_0x2516('0x70'),_['map'](_0x42d604,'id'));}});})['then'](function(){db['sequelize'][_0x2516('0x36')](_0x9df753[_0x2516('0x8c')](),_0x2e1029)['then'](function(_0x2a54ee){_0x4578c7[_0x2516('0x1d')]=_0x2a54ee[_0x2516('0x3a')];if(_0x4578c7[_0x2516('0x1d')]===0x0)return[];return db[_0x2516('0x8d')][_0x2516('0x36')](_0x582cb6['toString'](),_0x2e1029)[_0x2516('0x26')](function(_0x13d4fb){_0x421c58=_[_0x2516('0x8e')](_0x13d4fb,'id');_0x2e1029=_['merge'](_0x2e1029,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c74ca['query'][_0x2516('0x38')]){_0x5e67bc[_0x2516('0x39')][_0x2516('0x2e')](function(_0x1fee50){_0x396be6['field']('i.'+_0x1fee50);});}else{_0x396be6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2516('0x58'));_0x396be6[_0x2516('0x42')](_0x2516('0x8f'),_0x2516('0x90'));_0x396be6[_0x2516('0x42')](_0x2516('0x91'),_0x2516('0x92'));_0x396be6[_0x2516('0x42')]('i.*');_0x396be6[_0x2516('0x42')](_0x2516('0x93'),_0x2516('0x94'));_0x396be6[_0x2516('0x42')](_0x2516('0x95'),'Contact.lastName');_0x396be6[_0x2516('0x42')](_0x2516('0x96'),'Contact.email');_0x396be6[_0x2516('0x42')](_0x2516('0x97'),_0x2516('0x98'));_0x396be6[_0x2516('0x42')](_0x2516('0x99'),_0x2516('0x9a'));_0x396be6['field'](_0x2516('0x9b'),_0x2516('0x9c'));_0x396be6[_0x2516('0x42')](_0x2516('0x9d'),_0x2516('0x2b'));}_0x396be6[_0x2516('0x1f')](_0x5e67bc[_0x2516('0x1f')]);_0x396be6[_0x2516('0x1e')](_0x5e67bc[_0x2516('0x1e')]);return db['sequelize'][_0x2516('0x36')](_0x396be6['toString'](),_0x2e1029);})[_0x2516('0x26')](function(_0x1b860d){_0x30fb17['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x2516('0x2a')](_0x1b860d,'id'));return db[_0x2516('0x8d')][_0x2516('0x36')](_0x30fb17[_0x2516('0x8c')](),_0x2e1029)[_0x2516('0x26')](function(_0x2aa16c){var _0x2ca1d5=_[_0x2516('0x9e')](_0x2aa16c,_0x2516('0x9f'));var _0x36eab7=[];_0x1b860d[_0x2516('0x2e')](function(_0x18a9e9){_0x36eab7[_0x2516('0x2f')](updateOpenchannelInteraction(_0x18a9e9,_0x421c58,_0x2ca1d5));});return BPromise[_0x2516('0xa0')](_0x36eab7);});});})[_0x2516('0x26')](function(_0x48354a){_0x4578c7['rows']=_0x48354a;return _0x4578c7;})[_0x2516('0x26')](respondWithFilteredResult(_0x1ad634,_0x5e67bc));})[_0x2516('0x30')](handleError(_0x1ad634,null));};exports[_0x2516('0xa1')]=function(_0x56aa6c,_0x17548a){var _0x3d2e74={'raw':![],'where':{'id':_0x56aa6c[_0x2516('0xa2')]['id']}},_0x317b9a={};_0x317b9a[_0x2516('0x35')]=_[_0x2516('0x37')](db['OpenchannelInteraction'][_0x2516('0xa3')]);_0x317b9a[_0x2516('0x36')]=_[_0x2516('0x37')](_0x56aa6c[_0x2516('0x36')]);_0x317b9a[_0x2516('0x3f')]=_[_0x2516('0xa4')](_0x317b9a[_0x2516('0x35')],_0x317b9a[_0x2516('0x36')]);_0x3d2e74[_0x2516('0x39')]=_[_0x2516('0xa4')](_0x317b9a[_0x2516('0x35')],qs[_0x2516('0x38')](_0x56aa6c[_0x2516('0x36')][_0x2516('0x38')]));_0x3d2e74[_0x2516('0x39')]=_0x3d2e74[_0x2516('0x39')]['length']?_0x3d2e74['attributes']:_0x317b9a[_0x2516('0x35')];if(_0x56aa6c[_0x2516('0x36')][_0x2516('0xa5')]){_0x3d2e74[_0x2516('0xa6')]=[{'all':!![]}];}_0x3d2e74=_[_0x2516('0xa7')]({},_0x3d2e74,_0x56aa6c[_0x2516('0xa8')]);return db[_0x2516('0xa9')][_0x2516('0x57')](_0x3d2e74)['then'](handleEntityNotFound(_0x17548a,null))[_0x2516('0x26')](respondWithResult(_0x17548a,null))[_0x2516('0x30')](handleError(_0x17548a,null));};exports[_0x2516('0xaa')]=function(_0x54b632,_0x76abf4){return db['OpenchannelInteraction'][_0x2516('0xaa')](_0x54b632['body'],{})[_0x2516('0x26')](respondWithResult(_0x76abf4,0xc9))[_0x2516('0x30')](handleError(_0x76abf4,null));};exports['update']=function(_0xd47496,_0x582e79){if(_0xd47496[_0x2516('0x6a')]['id']){delete _0xd47496[_0x2516('0x6a')]['id'];}return db[_0x2516('0xa9')][_0x2516('0x57')]({'where':{'id':_0xd47496[_0x2516('0xa2')]['id']}})[_0x2516('0x26')](handleEntityNotFound(_0x582e79,null))[_0x2516('0x26')](saveUpdates(_0xd47496[_0x2516('0x6a')],null))[_0x2516('0x26')](respondWithResult(_0x582e79,null))['catch'](handleError(_0x582e79,null));};exports[_0x2516('0xab')]=function(_0x23581f,_0x36164a){return db[_0x2516('0xa9')]['find']({'where':{'id':_0x23581f[_0x2516('0xa2')]['id']}})[_0x2516('0x26')](handleEntityNotFound(_0x36164a,null))[_0x2516('0x26')](removeEntity(_0x36164a,null))[_0x2516('0x30')](handleError(_0x36164a,null));};exports[_0x2516('0xac')]=function(_0x5ab495,_0x21e596){return db[_0x2516('0xa9')][_0x2516('0xac')]()[_0x2516('0x26')](respondWithResult(_0x21e596,null))[_0x2516('0x30')](handleError(_0x21e596,null));};exports[_0x2516('0xad')]=function(_0x5cfee4,_0x8fead9,_0x49a464){return db[_0x2516('0xae')]['find']({'where':{'id':_0x5cfee4['params']['id']}})[_0x2516('0x26')](handleEntityNotFound(_0x8fead9,null))[_0x2516('0x26')](function(_0x2750e4){if(_0x2750e4){return _0x2750e4['addMessage'](_0x5cfee4[_0x2516('0x6a')][_0x2516('0xaf')],_['omit'](_0x5cfee4[_0x2516('0x6a')],[_0x2516('0xaf'),'id'])||{});}})['then'](respondWithResult(_0x8fead9,null))['catch'](handleError(_0x8fead9,null));};exports[_0x2516('0xb0')]=function(_0x315e40,_0x26108b,_0x832177){var _0x4683c1={'raw':![],'where':{}};var _0x41f2b2={};var _0x573ab2={'count':0x0,'rows':[]};return db[_0x2516('0xa9')][_0x2516('0xb1')]({'where':{'id':_0x315e40[_0x2516('0xa2')]['id']}})[_0x2516('0x26')](handleEntityNotFound(_0x26108b,null))['then'](function(_0x329adb){if(_0x329adb){_0x41f2b2[_0x2516('0x35')]=_[_0x2516('0x37')](db[_0x2516('0xae')]['rawAttributes']);_0x41f2b2[_0x2516('0x36')]=_[_0x2516('0x37')](_0x315e40[_0x2516('0x36')]);_0x41f2b2['filters']=_[_0x2516('0xa4')](_0x41f2b2[_0x2516('0x35')],_0x41f2b2[_0x2516('0x36')]);_0x4683c1[_0x2516('0x39')]=_['intersection'](_0x41f2b2[_0x2516('0x35')],qs[_0x2516('0x38')](_0x315e40[_0x2516('0x36')][_0x2516('0x38')]));_0x4683c1[_0x2516('0x39')]=_0x4683c1[_0x2516('0x39')]['length']?_0x4683c1[_0x2516('0x39')]:_0x41f2b2[_0x2516('0x35')];if(!_0x315e40[_0x2516('0x36')]['hasOwnProperty'](_0x2516('0x3c'))){_0x4683c1[_0x2516('0x1f')]=qs['limit'](_0x315e40['query'][_0x2516('0x1f')]);_0x4683c1[_0x2516('0x1e')]=qs[_0x2516('0x1e')](_0x315e40[_0x2516('0x36')][_0x2516('0x1e')]);}_0x4683c1[_0x2516('0x3d')]=qs[_0x2516('0x3e')](_0x315e40['query'][_0x2516('0x3e')]);_0x4683c1[_0x2516('0x6f')]=qs[_0x2516('0x3f')](_[_0x2516('0x40')](_0x315e40[_0x2516('0x36')],_0x41f2b2[_0x2516('0x3f')]));_0x4683c1[_0x2516('0x6f')][_0x2516('0x9f')]=_0x329adb['id'];if(_0x315e40[_0x2516('0x36')][_0x2516('0xb2')]){_0x4683c1[_0x2516('0x6f')]=_[_0x2516('0xa7')](_0x4683c1['where'],{'$or':_[_0x2516('0x2a')](_0x4683c1[_0x2516('0x39')],function(_0x5d46cb){var _0x3f680b={};_0x3f680b[_0x5d46cb]={'$like':'%'+_0x315e40[_0x2516('0x36')][_0x2516('0xb2')]+'%'};return _0x3f680b;})});}if(_0x315e40[_0x2516('0x36')][_0x2516('0x72')]){var _0x59b13a=_0x315e40[_0x2516('0x36')][_0x2516('0x72')]['split'](',');var _0x353c8f={};_0x353c8f[_0x59b13a[0x0]]={'$gte':moment(_0x59b13a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4683c1[_0x2516('0x6f')]=_[_0x2516('0xa7')](_0x4683c1[_0x2516('0x6f')],_0x353c8f);}_0x4683c1=_['merge']({},_0x4683c1,_0x315e40[_0x2516('0xa8')]);return db[_0x2516('0xae')]['count']({'where':_0x4683c1['where']})[_0x2516('0x26')](function(_0x439311){_0x573ab2[_0x2516('0x1d')]=_0x439311;if(_0x315e40[_0x2516('0x36')][_0x2516('0xa5')]){_0x4683c1[_0x2516('0xa6')]=[{'all':!![]}];}return db[_0x2516('0xae')][_0x2516('0xb3')](_0x4683c1);})[_0x2516('0x26')](function(_0x59981a){_0x573ab2[_0x2516('0xb4')]=_0x59981a;return _0x573ab2;});}})[_0x2516('0x26')](respondWithFilteredResult(_0x26108b,_0x4683c1))[_0x2516('0x30')](handleError(_0x26108b,null));};exports[_0x2516('0xb5')]=function(_0x60d5ab,_0x3d7ebd,_0x5dd88d){return db[_0x2516('0xa9')][_0x2516('0x57')]({'where':{'id':_0x60d5ab[_0x2516('0xa2')]['id']}})[_0x2516('0x26')](handleEntityNotFound(_0x3d7ebd,null))[_0x2516('0x26')](function(_0x32d4d1){if(_0x32d4d1){return _0x32d4d1[_0x2516('0xb6')](_0x60d5ab[_0x2516('0x6a')][_0x2516('0xaf')],_[_0x2516('0xb7')](_0x60d5ab[_0x2516('0x6a')],[_0x2516('0xaf'),'id'])||{})[_0x2516('0xb8')](function(){return db['Tag'][_0x2516('0xb3')]({'attributes':['id',_0x2516('0x28'),'color'],'where':{'id':_0x60d5ab['body'][_0x2516('0xaf')]}});})[_0x2516('0x26')](function(_0x2fb9c1){socket[_0x2516('0xb9')](_0x2516('0xba'),{'id':Number(_0x60d5ab['params']['id']),'tags':_0x2fb9c1||[]});return{'id':Number(_0x60d5ab[_0x2516('0xa2')]['id']),'tags':_0x2fb9c1||[]};});}})[_0x2516('0x26')](respondWithResult(_0x3d7ebd,null))[_0x2516('0x30')](handleError(_0x3d7ebd,null));};exports[_0x2516('0xbb')]=function(_0x59eb11,_0x4806dd,_0x516d3c){return db[_0x2516('0xa9')][_0x2516('0x57')]({'where':{'id':_0x59eb11[_0x2516('0xa2')]['id']}})[_0x2516('0x26')](handleEntityNotFound(_0x4806dd,null))['then'](function(_0x46e4cb){if(_0x46e4cb){return _0x46e4cb['removeTags'](_0x59eb11[_0x2516('0x36')][_0x2516('0xaf')]);}})['then'](respondWithStatusCode(_0x4806dd,null))[_0x2516('0x30')](handleError(_0x4806dd,null));};exports[_0x2516('0xbc')]=function(_0x2f2e9a,_0x764d61){var _0x1bcf2c=moment()[_0x2516('0xbd')]()[_0x2516('0x8c')]();var _0xa7ab36=path[_0x2516('0xbe')](config[_0x2516('0xbf')],_0x2516('0xc0'),_0x2516('0xc1'),_0x2516('0xc2'));var _0x4a9a7a=path[_0x2516('0xbe')](config[_0x2516('0xbf')],_0x2516('0xc0'),'files',_0x2516('0xc3'));var _0x1993cf=path[_0x2516('0xbe')](_0xa7ab36,_0x1bcf2c);var _0x3988eb=util[_0x2516('0xc4')](_0x2516('0xc5'),_0x2f2e9a[_0x2516('0xa2')]['id'],_0x1bcf2c);var _0x54ab55=path['join'](_0xa7ab36,_0x3988eb);var _0x36cf08=![];return db[_0x2516('0xa9')][_0x2516('0x57')]({'where':{'id':_0x2f2e9a[_0x2516('0xa2')]['id']},'include':[{'model':db[_0x2516('0xae')],'as':_0x2516('0xc6'),'attributes':['id','body','createdAt',_0x2516('0xc7'),_0x2516('0xc8'),_0x2516('0x77')],'include':[{'model':db[_0x2516('0x67')],'as':_0x2516('0x67'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x2516('0xc9')],'as':_0x2516('0x5c'),'attributes':['id',_0x2516('0xca'),_0x2516('0xcb')],'raw':!![]},{'model':db['Attachment'],'as':_0x2516('0xcc'),'raw':!![]}]},{'model':db['OpenchannelAccount'],'as':_0x2516('0xcd'),'attributes':['id','name']},{'model':db['User'],'as':_0x2516('0xce'),'attributes':['id',_0x2516('0xcf')]}]})['then'](handleEntityNotFound(_0x764d61,null))[_0x2516('0x26')](function(_0x54dbc2){if(_0x54dbc2){var _0x2b7b53=_0x54dbc2[_0x2516('0xd0')]({'plain':!![]});_0x36cf08=!![];var _0x49e8fc={'format':'A4','border':_0x2516('0xd1'),'header':{'height':_0x2516('0xd2'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':'30px','contents':{'default':util[_0x2516('0xc4')](_0x2516('0xd3'),util['format'](_0x2516('0xd4'),_0x2516('0xd5'),_0x2b7b53['id']),moment()[_0x2516('0xc4')](_0x2516('0xd6'))[_0x2516('0x8c')]())}}};fs[_0x2516('0xd7')](_0x1993cf);var _0x2646c0={'channel':_0x2516('0xd5'),'account':_0x2b7b53[_0x2516('0xcd')][_0x2516('0x28')],'agent':_0x2b7b53['Owner']?_0x2b7b53['Owner']['fullname']:_0x2516('0xd8'),'createdAt':moment(_0x2b7b53[_0x2516('0xd9')])['format'](_0x2516('0xda'))[_0x2516('0x8c')](),'closedAt':_0x2b7b53[_0x2516('0xdb')]?moment(_0x2b7b53['closedAt'])[_0x2516('0xc4')](_0x2516('0xda'))[_0x2516('0x8c')]():'','disposition':_0x2b7b53[_0x2516('0xdc')],'visibility':_0x2b7b53[_0x2516('0xdd')]?_0x2516('0xde'):_0x2516('0xdf'),'messages':_(_0x2b7b53[_0x2516('0xc6')])[_0x2516('0xb2')]({'secret':![]})['map'](function(_0xddc88){if(_0xddc88[_0x2516('0xcc')]){var _0x38e016=path[_0x2516('0xbe')](_0x4a9a7a,_0xddc88[_0x2516('0xcc')][_0x2516('0xe0')]);if(fs[_0x2516('0xe1')](_0x38e016)){fs[_0x2516('0xe2')](_0x38e016)['pipe'](fs['createWriteStream'](path[_0x2516('0xbe')](_0x1993cf,_0xddc88[_0x2516('0xcc')][_0x2516('0xe0')])));}}return{'date':moment(_0xddc88[_0x2516('0xd9')])['format'](_0x2516('0xda'))['toString'](),'sender':_0xddc88[_0x2516('0xc7')]==='out'?_0xddc88[_0x2516('0x67')]?_0xddc88[_0x2516('0x67')][_0x2516('0xcf')]:_0x2516('0xe3'):_0xddc88[_0x2516('0x5c')][_0x2516('0xca')]+(_0xddc88[_0x2516('0x5c')][_0x2516('0xcb')]?'\x20'+_0xddc88[_0x2516('0x5c')][_0x2516('0xcb')]:''),'body':_0xddc88[_0x2516('0xcc')]?_0xddc88['Attachment'][_0x2516('0xe0')]:_0xddc88[_0x2516('0x6a')],'direction':_0xddc88[_0x2516('0xc7')]===_0x2516('0xe4')?'A':'C','secret':_0xddc88['secret'],'read':_0xddc88[_0x2516('0x77')],'attachment':_0xddc88[_0x2516('0xcc')]};})[_0x2516('0x5e')]()};return ejs[_0x2516('0xe5')](path['join'](config[_0x2516('0xbf')],_0x2516('0xc0'),_0x2516('0xe6'),_0x2516('0xe7')),{'interaction':_0x2646c0})[_0x2516('0x26')](function(_0x3e6d9b){return new BPromise(function(_0x263a06,_0x3e0f43){pdf[_0x2516('0xaa')](_0x3e6d9b,_0x49e8fc)[_0x2516('0xe8')](path[_0x2516('0xbe')](_0x1993cf,_0x2516('0xe9')+_0x2b7b53['id']+'-'+_0x1bcf2c+_0x2516('0xea')),function(_0x4732a3,_0xb4f46b){if(_0x4732a3)return _0x3e0f43(_0x4732a3);_0x263a06(_0xb4f46b);});});});}})[_0x2516('0x26')](function(){if(_0x36cf08){return new BPromise(function(_0x56ae20,_0xeeea8b){zipdir(_0x1993cf,{'saveTo':_0x54ab55},function(_0x2f3cdd,_0x511805){if(_0x2f3cdd)return _0xeeea8b(_0x2f3cdd);return _0x56ae20(_0x511805);});})[_0x2516('0x26')](function(){return new BPromise(function(_0x1eddb2,_0x361ad0){rimraf(_0x1993cf,function(_0x45559b){if(_0x45559b)_0x361ad0(_0x45559b);return _0x1eddb2();});});})[_0x2516('0x26')](function(){return _0x764d61[_0x2516('0xbc')](_0x54ab55,_0x3988eb,function(_0x3a2e9e){if(_0x3a2e9e){console['log'](_0x2516('0xeb'),_0x3a2e9e);}else{fs['unlinkSync'](_0x54ab55);}});});}else{return _0x764d61[_0x2516('0x1a')](0xc8);}})[_0x2516('0x30')](handleError(_0x764d61,null));}; \ No newline at end of file +var _0x2eb2=['save','update','then','destroy','error','stack','name','Users','map','TagIds','forEach','Tags','push','catch','index','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','OpenchannelAccountId','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','unreadMessages','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','groupBy','OpenchannelInteractionId','rows','show','include','create','OpenchannelInteraction','body','params','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','nolimit','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','join','root','server','files','tmp','transcript-%d-%s.zip','Messages','direction','secret','CmContact','firstName','lastName','Attachment','OpenchannelAccount','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','format','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','mkdirSync','fullname','closedAt','disposition','threadId','Private','basename','createReadStream','pipe','createWriteStream','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','count','offset','limit','set','Content-Range','apply'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2eb2,0x19f));var _0x22eb=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x2eb2[_0x54d4a8];return _0x3b321b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x22eb('0x0'));var rimraf=require(_0x22eb('0x1'));var zipdir=require(_0x22eb('0x2'));var jsonpatch=require(_0x22eb('0x3'));var rp=require(_0x22eb('0x4'));var moment=require(_0x22eb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x22eb('0x6'));var util=require('util');var path=require('path');var sox=require(_0x22eb('0x7'));var csv=require(_0x22eb('0x8'));var ejs=require(_0x22eb('0x9'));var fs=require('fs');var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x8'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22eb('0x13'))('api');var utils=require(_0x22eb('0x14'));var config=require(_0x22eb('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x22eb('0x16')](config[_0x22eb('0x17')],{'host':_0x22eb('0x18'),'port':0x18eb});var socket=require(_0x22eb('0x19'))(new Redis(config[_0x22eb('0x17')]));require('./openchannelInteraction.socket')[_0x22eb('0x1a')](socket);function respondWithStatusCode(_0x53f14e,_0x1f5089){_0x1f5089=_0x1f5089||0xcc;return function(_0x55ede8){if(_0x55ede8){return _0x53f14e[_0x22eb('0x1b')](_0x1f5089);}return _0x53f14e[_0x22eb('0x1c')](_0x1f5089)['end']();};}function respondWithResult(_0x48b63c,_0x4bc29a){_0x4bc29a=_0x4bc29a||0xc8;return function(_0x2ed8a7){if(_0x2ed8a7){return _0x48b63c['status'](_0x4bc29a)['json'](_0x2ed8a7);}};}function respondWithFilteredResult(_0x428586,_0x4d9a71){return function(_0x4d9b09){if(_0x4d9b09){var _0xb7a73a=_0x4d9b09[_0x22eb('0x1d')],_0x2a55e4=_0x4d9a71['offset'],_0x385bcb=_0x4d9a71[_0x22eb('0x1e')]+_0x4d9a71[_0x22eb('0x1f')],_0x1ff041;if(_0x385bcb>=_0xb7a73a){_0x385bcb=_0xb7a73a;_0x1ff041=0xc8;}else{_0x1ff041=0xce;}_0x428586[_0x22eb('0x1c')](_0x1ff041);return _0x428586[_0x22eb('0x20')](_0x22eb('0x21'),_0x2a55e4+'-'+_0x385bcb+'/'+_0xb7a73a)['json'](_0x4d9b09);}return null;};}function patchUpdates(_0x2eb115){return function(_0x293bd2){try{jsonpatch[_0x22eb('0x22')](_0x293bd2,_0x2eb115,!![]);}catch(_0x49ce2a){return BPromise['reject'](_0x49ce2a);}return _0x293bd2[_0x22eb('0x23')]();};}function saveUpdates(_0x267d97,_0x434ecb){return function(_0x44639a){if(_0x44639a){return _0x44639a[_0x22eb('0x24')](_0x267d97)[_0x22eb('0x25')](function(_0x43dacb){return _0x43dacb;});}return null;};}function removeEntity(_0x4e7e69,_0x2e8f7c){return function(_0x11edbd){if(_0x11edbd){return _0x11edbd[_0x22eb('0x26')]()[_0x22eb('0x25')](function(){_0x4e7e69[_0x22eb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12c133,_0x6f8ff3){return function(_0x2f3b39){if(!_0x2f3b39){_0x12c133['sendStatus'](0x194);}return _0x2f3b39;};}function handleError(_0xe0783c,_0x259847){_0x259847=_0x259847||0x1f4;return function(_0x4b409a){logger[_0x22eb('0x27')](_0x4b409a[_0x22eb('0x28')]);if(_0x4b409a[_0x22eb('0x29')]){delete _0x4b409a[_0x22eb('0x29')];}_0xe0783c[_0x22eb('0x1c')](_0x259847)['send'](_0x4b409a);};}function getInteractionUsers(_0x49dd59,_0x2a950e){return new BPromise(function(_0x25e5bc,_0x44cf91){try{if(_0x2a950e[_0x49dd59['id']]){_0x49dd59[_0x22eb('0x2a')]=_[_0x22eb('0x2b')](_0x2a950e[_0x49dd59['id']],function(_0x14724e){return{'id':_0x14724e['id']};});}}catch(_0x2375e7){_0x44cf91(_0x2375e7);}_0x25e5bc(_0x49dd59);});}function getInteractionTags(_0x13814f,_0x382784){return new BPromise(function(_0x39cec1,_0x24e9dc){try{if(_0x13814f[_0x22eb('0x2c')]){_0x13814f['Tags']=[];_0x13814f[_0x22eb('0x2c')]['split'](',')[_0x22eb('0x2d')](function(_0x1e035a){_0x13814f[_0x22eb('0x2e')][_0x22eb('0x2f')](_0x382784[_0x1e035a]);});}delete _0x13814f[_0x22eb('0x2c')];}catch(_0x158cfa){_0x24e9dc(_0x158cfa);}_0x39cec1(_0x13814f);});}function updateOpenchannelInteraction(_0x35fb89,_0x476cdb,_0x22354d){return new BPromise(function(_0x232af4,_0x509bb7){return getInteractionUsers(_0x35fb89,_0x22354d)['then'](function(_0x239a41){return getInteractionTags(_0x239a41,_0x476cdb);})['then'](function(_0x55ee20){_0x232af4(_0x55ee20);})[_0x22eb('0x30')](function(_0xaa12a0){_0x509bb7(_0xaa12a0);});});}exports[_0x22eb('0x31')]=function(_0x478289,_0x45c53e){var _0x332e9a={},_0x3855df={},_0x42a6d6={'count':0x0,'rows':[]};var _0x7f169=_[_0x22eb('0x2b')](db['OpenchannelInteraction'][_0x22eb('0x32')],function(_0x47be01){return{'name':_0x47be01['fieldName'],'type':_0x47be01[_0x22eb('0x33')][_0x22eb('0x34')]};});_0x3855df['model']=_[_0x22eb('0x2b')](_0x7f169,_0x22eb('0x29'));_0x3855df[_0x22eb('0x35')]=_[_0x22eb('0x36')](_0x478289[_0x22eb('0x35')]);_0x3855df['filters']=_[_0x22eb('0x37')](_0x3855df[_0x22eb('0x38')],_0x3855df['query']);_0x332e9a[_0x22eb('0x39')]=_[_0x22eb('0x37')](_0x3855df[_0x22eb('0x38')],qs[_0x22eb('0x3a')](_0x478289[_0x22eb('0x35')]['fields']));_0x332e9a['attributes']=_0x332e9a[_0x22eb('0x39')][_0x22eb('0x3b')]?_0x332e9a['attributes']:_0x3855df[_0x22eb('0x38')];if(!_0x478289[_0x22eb('0x35')][_0x22eb('0x3c')]('nolimit')){_0x332e9a[_0x22eb('0x1f')]=qs[_0x22eb('0x1f')](_0x478289[_0x22eb('0x35')][_0x22eb('0x1f')]);_0x332e9a[_0x22eb('0x1e')]=qs[_0x22eb('0x1e')](_0x478289['query'][_0x22eb('0x1e')]);}_0x332e9a[_0x22eb('0x3d')]=qs['sort'](_0x478289[_0x22eb('0x35')][_0x22eb('0x3e')]);_0x332e9a[_0x22eb('0x3f')]=qs[_0x22eb('0x40')](_[_0x22eb('0x41')](_0x478289[_0x22eb('0x35')],_0x3855df[_0x22eb('0x40')]));var _0x78b250=[];var _0x1bafa3=squel[_0x22eb('0x42')]()[_0x22eb('0x43')]('id')[_0x22eb('0x43')](_0x22eb('0x29'))[_0x22eb('0x43')](_0x22eb('0x44'))[_0x22eb('0x45')](_0x22eb('0x46'));var _0x46e3ec=squel['select']()[_0x22eb('0x43')](_0x22eb('0x47'))['field'](_0x22eb('0x48'))[_0x22eb('0x45')]('user_has_openchannel_interactions','ui')['left_join']('users','u',_0x22eb('0x49'));var _0x1efc65=squel['select']()['from'](_0x22eb('0x4a'),'i')[_0x22eb('0x4b')](_0x22eb('0x4c'),'c',_0x22eb('0x4d'))[_0x22eb('0x4b')](_0x22eb('0x4e'),'o',_0x22eb('0x4f'))[_0x22eb('0x4b')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x22eb('0x4b')]('openchannel_messages','me',_0x22eb('0x50'))['left_join'](_0x22eb('0x51'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x36b174=squel['expr']();var _0x320211=[];var _0x3b35c6=squel['expr']();var _0x24e6ba;if(_0x478289['query'][_0x22eb('0x52')]){_0x24e6ba=as[_0x22eb('0x53')](_0x478289[_0x22eb('0x35')][_0x22eb('0x52')]);var _0x44499c=_0x24e6ba[_0x22eb('0x54')];for(var _0xc26ad7=0x0;_0xc26ad7<_0x24e6ba[_0x22eb('0x55')][_0x22eb('0x3b')];_0xc26ad7++){var _0x527ef1=_0x24e6ba[_0x22eb('0x55')][_0xc26ad7];var _0x3ae464='i';var _0x557fac=_[_0x22eb('0x56')](_0x7f169,[_0x22eb('0x29'),_0x527ef1[_0x22eb('0x43')]]);if(!_0x557fac){switch(_0x527ef1[_0x22eb('0x43')]){case'unreadMessages':if(_0x527ef1[_0x22eb('0x57')]==0x1){_0x1efc65[_0x22eb('0x58')]('`'+_0x527ef1[_0x22eb('0x43')]+_0x22eb('0x59'));}else{_0x1efc65[_0x22eb('0x58')]('`'+_0x527ef1[_0x22eb('0x43')]+'`\x20>\x200');}break;case _0x22eb('0x5a'):if(_0x527ef1['operator']===_0x22eb('0x5b')){if(_0x527ef1['value'][_0x22eb('0x5c')]('\x20')[_0x22eb('0x3b')]>0x1){_0x36b174[_0x44499c](_0x22eb('0x5d'),qs[_0x22eb('0x5e')](_0x527ef1[_0x22eb('0x57')]),null);}else{var _0x4aa0c5='%'+_0x527ef1['value']+'%';_0x36b174[_0x44499c](_0x22eb('0x5f'),_0x4aa0c5,_0x4aa0c5,_0x4aa0c5);}}else{_0x557fac=_[_0x22eb('0x56')](_0x7f169,['name',_0x22eb('0x60')]);_0x527ef1[_0x22eb('0x43')]=_0x22eb('0x60');_0x16099e=as[_0x22eb('0x61')](_0x3ae464,_0x557fac[_0x22eb('0x33')],_0x527ef1);_0x36b174[_0x44499c](_0x16099e[_0x22eb('0x62')],_0x16099e[_0x22eb('0x57')][_0x22eb('0x63')],_0x16099e[_0x22eb('0x57')][_0x22eb('0x64')]);}break;case _0x22eb('0x65'):var _0x5f30c9=_0x527ef1[_0x22eb('0x57')][_0x22eb('0x5c')](',')[_0x22eb('0x2b')](function(_0x2562a1){return Number(_0x2562a1);});_0x5f30c9[_0x22eb('0x2d')](function(_0x24465a){_0x3b35c6['or'](_0x22eb('0x66'),'%,'+_0x24465a+',%');});_0x320211=_[_0x22eb('0x67')](_0x320211,_0x5f30c9);break;case _0x22eb('0x68'):if(_0x527ef1[_0x22eb('0x69')]===_0x22eb('0x5b')){_0x36b174[_0x44499c](_0x22eb('0x6a'),'%'+_0x527ef1[_0x22eb('0x57')]+'%',null);}else{_0x557fac=_[_0x22eb('0x56')](_0x7f169,['name','UserId']);_0x527ef1[_0x22eb('0x43')]=_0x22eb('0x6b');_0x16099e=as[_0x22eb('0x61')](_0x3ae464,_0x557fac[_0x22eb('0x33')],_0x527ef1);_0x36b174[_0x44499c](_0x16099e[_0x22eb('0x62')],_0x16099e['value'][_0x22eb('0x63')],_0x16099e[_0x22eb('0x57')]['end']);}break;case'body':_0x16099e=as[_0x22eb('0x61')]('me',null,_0x527ef1);_0x36b174[_0x44499c](_0x16099e[_0x22eb('0x62')],_0x16099e[_0x22eb('0x57')][_0x22eb('0x63')],_0x16099e[_0x22eb('0x57')][_0x22eb('0x64')]);break;}}else{var _0x16099e=as[_0x22eb('0x61')](_0x3ae464,_0x557fac[_0x22eb('0x33')],_0x527ef1);_0x36b174[_0x44499c](_0x16099e[_0x22eb('0x62')],_0x16099e[_0x22eb('0x57')][_0x22eb('0x63')],_0x16099e[_0x22eb('0x57')][_0x22eb('0x64')]);}}}else{var _0x4aea9d=_(_0x478289[_0x22eb('0x35')])[_0x22eb('0x36')]()[_0x22eb('0x2b')](function(_0x5dbc43){return _[_0x22eb('0x6c')](_0x7f169,['name',_0x5dbc43])?_0x5dbc43:undefined;})[_0x22eb('0x6d')]()['value']();if(!_[_0x22eb('0x6e')](_0x4aea9d)){_0x4aea9d[_0x22eb('0x2d')](function(_0x4a8f0d){if(_0x4a8f0d===_0x22eb('0x6f')){_0x1efc65[_0x22eb('0x3f')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x478289[_0x22eb('0x35')][_0x4a8f0d]));}else if(_0x4a8f0d===_0x22eb('0x70')){var _0x1984f0=JSON[_0x22eb('0x71')](_0x478289[_0x22eb('0x35')][_0x4a8f0d])[_0x22eb('0x72')];var _0x4f5eee=JSON[_0x22eb('0x71')](_0x478289['query'][_0x4a8f0d])['$lte'];_0x1efc65[_0x22eb('0x3f')](_0x22eb('0x73'),_0x1984f0,_0x4f5eee);}else{if(_0x478289[_0x22eb('0x35')][_0x4a8f0d]===_0x22eb('0x74')){_0x1efc65[_0x22eb('0x3f')]('i.'+_0x4a8f0d+_0x22eb('0x75'));}else{_0x1efc65[_0x22eb('0x3f')]('i.'+_0x4a8f0d+_0x22eb('0x76'),_0x478289['query'][_0x4a8f0d]);}}});}if(_0x478289['query'][_0x22eb('0x77')]){if(_0x478289[_0x22eb('0x35')]['read']==0x1){_0x1efc65[_0x22eb('0x58')](_0x22eb('0x78'));}else{_0x1efc65[_0x22eb('0x58')](_0x22eb('0x79'));}}if(_0x478289[_0x22eb('0x35')][_0x22eb('0x7a')]){_0x320211=_['isArray'](_0x478289[_0x22eb('0x35')][_0x22eb('0x7a')])?_0x478289[_0x22eb('0x35')]['tag']:new Array(_0x478289['query'][_0x22eb('0x7a')]);_0x320211[_0x22eb('0x2d')](function(_0xa4178f){_0x3b35c6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa4178f+',%');});}if(_0x478289[_0x22eb('0x35')]['filter']){var _0x1a305d=_0x478289[_0x22eb('0x35')][_0x22eb('0x7b')][_0x22eb('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x22eb('0x7d'));if(qs[_0x22eb('0x7e')](_0x1a305d)){_0x36b174['or'](_0x22eb('0x7f'),_0x1a305d+'%');}else{_0x36b174['or'](_0x22eb('0x80'),qs[_0x22eb('0x5e')](_0x1a305d))['or'](_0x22eb('0x81'),_0x1a305d+'%')['or'](_0x22eb('0x82'),_0x1a305d+'%');}}}_0x1efc65[_0x22eb('0x3f')](_0x36b174);_0x1efc65[_0x22eb('0x83')](_0x22eb('0x84'));var _0x14006f={'type':db['Sequelize'][_0x22eb('0x85')][_0x22eb('0x86')],'raw':!![]};var _0x5e7d49=_0x1efc65['clone']();_0x5e7d49['field'](_0x22eb('0x84'));_0x5e7d49[_0x22eb('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x22eb('0x87'));if(_0x332e9a[_0x22eb('0x3d')]){_0x332e9a[_0x22eb('0x3d')][_0x22eb('0x2d')](function(_0x8cbc83){_0x1efc65['order']('i.'+_0x8cbc83[0x0],_0x8cbc83[0x1]==='DESC'?![]:!![]);});}if(!_[_0x22eb('0x6e')](_0x320211)){_0x1efc65[_0x22eb('0x58')](_0x3b35c6);_0x5e7d49[_0x22eb('0x3f')]('t.id\x20IN\x20?',_0x320211);}BPromise['resolve']()[_0x22eb('0x25')](function(){if(!_0x24e6ba&&_0x478289['query']['OpenchannelAccountId'])return;return _0x478289[_0x22eb('0x88')][_0x22eb('0x89')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4da36f){if(_[_0x22eb('0x6e')](_0x4da36f)){_0x5e7d49[_0x22eb('0x3f')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x1efc65[_0x22eb('0x3f')](_0x22eb('0x8a'));}else{_0x5e7d49[_0x22eb('0x3f')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x22eb('0x2b')](_0x4da36f,'id'));_0x1efc65[_0x22eb('0x3f')](_0x22eb('0x8b'),_[_0x22eb('0x2b')](_0x4da36f,'id'));}});})[_0x22eb('0x25')](function(){db['sequelize'][_0x22eb('0x35')](_0x5e7d49[_0x22eb('0x8c')](),_0x14006f)[_0x22eb('0x25')](function(_0x4bc34a){_0x42a6d6['count']=_0x4bc34a[_0x22eb('0x3b')];if(_0x42a6d6[_0x22eb('0x1d')]===0x0)return[];return db[_0x22eb('0x8d')]['query'](_0x1bafa3[_0x22eb('0x8c')](),_0x14006f)[_0x22eb('0x25')](function(_0x2a0062){_0x78b250=_['keyBy'](_0x2a0062,'id');_0x14006f=_[_0x22eb('0x8e')](_0x14006f,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x478289['query'][_0x22eb('0x3a')]){_0x332e9a[_0x22eb('0x39')][_0x22eb('0x2d')](function(_0x49f362){_0x1efc65[_0x22eb('0x43')]('i.'+_0x49f362);});}else{_0x1efc65[_0x22eb('0x43')](_0x22eb('0x8f'),_0x22eb('0x87'));_0x1efc65[_0x22eb('0x43')]('a.key',_0x22eb('0x90'));_0x1efc65['field'](_0x22eb('0x91'),_0x22eb('0x92'));_0x1efc65[_0x22eb('0x43')]('i.*');_0x1efc65[_0x22eb('0x43')](_0x22eb('0x93'),_0x22eb('0x94'));_0x1efc65[_0x22eb('0x43')](_0x22eb('0x95'),_0x22eb('0x96'));_0x1efc65[_0x22eb('0x43')](_0x22eb('0x97'),_0x22eb('0x98'));_0x1efc65[_0x22eb('0x43')](_0x22eb('0x99'),'Contact.phone');_0x1efc65[_0x22eb('0x43')](_0x22eb('0x9a'),_0x22eb('0x9b'));_0x1efc65[_0x22eb('0x43')]('c.fax',_0x22eb('0x9c'));_0x1efc65[_0x22eb('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x22eb('0x2c'));}_0x1efc65[_0x22eb('0x1f')](_0x332e9a[_0x22eb('0x1f')]);_0x1efc65[_0x22eb('0x1e')](_0x332e9a[_0x22eb('0x1e')]);return db[_0x22eb('0x8d')][_0x22eb('0x35')](_0x1efc65['toString'](),_0x14006f);})[_0x22eb('0x25')](function(_0x266e24){_0x46e3ec['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x22eb('0x2b')](_0x266e24,'id'));return db[_0x22eb('0x8d')][_0x22eb('0x35')](_0x46e3ec[_0x22eb('0x8c')](),_0x14006f)[_0x22eb('0x25')](function(_0x53c3c9){var _0x4e6fa6=_[_0x22eb('0x9d')](_0x53c3c9,_0x22eb('0x9e'));var _0x5cf5e5=[];_0x266e24[_0x22eb('0x2d')](function(_0x35767e){_0x5cf5e5[_0x22eb('0x2f')](updateOpenchannelInteraction(_0x35767e,_0x78b250,_0x4e6fa6));});return BPromise['all'](_0x5cf5e5);});});})[_0x22eb('0x25')](function(_0x345a23){_0x42a6d6[_0x22eb('0x9f')]=_0x345a23;return _0x42a6d6;})[_0x22eb('0x25')](respondWithFilteredResult(_0x45c53e,_0x332e9a));})[_0x22eb('0x30')](handleError(_0x45c53e,null));};exports[_0x22eb('0xa0')]=function(_0x203b47,_0x2063c8){var _0x51a3b8={'raw':![],'where':{'id':_0x203b47['params']['id']}},_0x4f63a3={};_0x4f63a3[_0x22eb('0x38')]=_['keys'](db['OpenchannelInteraction'][_0x22eb('0x32')]);_0x4f63a3[_0x22eb('0x35')]=_['keys'](_0x203b47[_0x22eb('0x35')]);_0x4f63a3[_0x22eb('0x40')]=_[_0x22eb('0x37')](_0x4f63a3[_0x22eb('0x38')],_0x4f63a3['query']);_0x51a3b8[_0x22eb('0x39')]=_[_0x22eb('0x37')](_0x4f63a3[_0x22eb('0x38')],qs['fields'](_0x203b47['query']['fields']));_0x51a3b8[_0x22eb('0x39')]=_0x51a3b8[_0x22eb('0x39')][_0x22eb('0x3b')]?_0x51a3b8['attributes']:_0x4f63a3[_0x22eb('0x38')];if(_0x203b47['query']['includeAll']){_0x51a3b8[_0x22eb('0xa1')]=[{'all':!![]}];}_0x51a3b8=_[_0x22eb('0x8e')]({},_0x51a3b8,_0x203b47['options']);return db['OpenchannelInteraction'][_0x22eb('0x56')](_0x51a3b8)[_0x22eb('0x25')](handleEntityNotFound(_0x2063c8,null))[_0x22eb('0x25')](respondWithResult(_0x2063c8,null))[_0x22eb('0x30')](handleError(_0x2063c8,null));};exports[_0x22eb('0xa2')]=function(_0x5d1209,_0x47aa85){return db[_0x22eb('0xa3')][_0x22eb('0xa2')](_0x5d1209[_0x22eb('0xa4')],{})['then'](respondWithResult(_0x47aa85,0xc9))[_0x22eb('0x30')](handleError(_0x47aa85,null));};exports['update']=function(_0x548b57,_0x2e8450){if(_0x548b57[_0x22eb('0xa4')]['id']){delete _0x548b57['body']['id'];}return db[_0x22eb('0xa3')]['find']({'where':{'id':_0x548b57[_0x22eb('0xa5')]['id']}})['then'](handleEntityNotFound(_0x2e8450,null))[_0x22eb('0x25')](saveUpdates(_0x548b57['body'],null))[_0x22eb('0x25')](respondWithResult(_0x2e8450,null))[_0x22eb('0x30')](handleError(_0x2e8450,null));};exports[_0x22eb('0x26')]=function(_0x461803,_0x43ace3){return db['OpenchannelInteraction'][_0x22eb('0x56')]({'where':{'id':_0x461803['params']['id']}})[_0x22eb('0x25')](handleEntityNotFound(_0x43ace3,null))[_0x22eb('0x25')](removeEntity(_0x43ace3,null))[_0x22eb('0x30')](handleError(_0x43ace3,null));};exports[_0x22eb('0xa6')]=function(_0x2ecd26,_0x29931e){return db['OpenchannelInteraction'][_0x22eb('0xa6')]()['then'](respondWithResult(_0x29931e,null))['catch'](handleError(_0x29931e,null));};exports[_0x22eb('0xa7')]=function(_0x277b27,_0x701fd0,_0x5ab24d){return db['OpenchannelMessage'][_0x22eb('0x56')]({'where':{'id':_0x277b27['params']['id']}})[_0x22eb('0x25')](handleEntityNotFound(_0x701fd0,null))[_0x22eb('0x25')](function(_0x207c36){if(_0x207c36){return _0x207c36[_0x22eb('0xa7')](_0x277b27[_0x22eb('0xa4')][_0x22eb('0xa8')],_[_0x22eb('0xa9')](_0x277b27[_0x22eb('0xa4')],[_0x22eb('0xa8'),'id'])||{});}})['then'](respondWithResult(_0x701fd0,null))[_0x22eb('0x30')](handleError(_0x701fd0,null));};exports[_0x22eb('0xaa')]=function(_0x374a54,_0x171c21,_0x10c70a){var _0x3598cf={'raw':![],'where':{}};var _0x42dbfb={};var _0x34b34d={'count':0x0,'rows':[]};return db[_0x22eb('0xa3')][_0x22eb('0xab')]({'where':{'id':_0x374a54['params']['id']}})[_0x22eb('0x25')](handleEntityNotFound(_0x171c21,null))['then'](function(_0x1a9a7c){if(_0x1a9a7c){_0x42dbfb[_0x22eb('0x38')]=_[_0x22eb('0x36')](db[_0x22eb('0xac')][_0x22eb('0x32')]);_0x42dbfb['query']=_[_0x22eb('0x36')](_0x374a54[_0x22eb('0x35')]);_0x42dbfb[_0x22eb('0x40')]=_[_0x22eb('0x37')](_0x42dbfb[_0x22eb('0x38')],_0x42dbfb[_0x22eb('0x35')]);_0x3598cf[_0x22eb('0x39')]=_['intersection'](_0x42dbfb[_0x22eb('0x38')],qs[_0x22eb('0x3a')](_0x374a54[_0x22eb('0x35')][_0x22eb('0x3a')]));_0x3598cf['attributes']=_0x3598cf[_0x22eb('0x39')][_0x22eb('0x3b')]?_0x3598cf[_0x22eb('0x39')]:_0x42dbfb[_0x22eb('0x38')];if(!_0x374a54[_0x22eb('0x35')][_0x22eb('0x3c')](_0x22eb('0xad'))){_0x3598cf['limit']=qs[_0x22eb('0x1f')](_0x374a54[_0x22eb('0x35')][_0x22eb('0x1f')]);_0x3598cf[_0x22eb('0x1e')]=qs[_0x22eb('0x1e')](_0x374a54[_0x22eb('0x35')][_0x22eb('0x1e')]);}_0x3598cf['order']=qs['sort'](_0x374a54[_0x22eb('0x35')]['sort']);_0x3598cf[_0x22eb('0x3f')]=qs['filters'](_['pick'](_0x374a54[_0x22eb('0x35')],_0x42dbfb[_0x22eb('0x40')]));_0x3598cf[_0x22eb('0x3f')][_0x22eb('0x9e')]=_0x1a9a7c['id'];if(_0x374a54['query'][_0x22eb('0x7b')]){_0x3598cf[_0x22eb('0x3f')]=_[_0x22eb('0x8e')](_0x3598cf['where'],{'$or':_[_0x22eb('0x2b')](_0x3598cf[_0x22eb('0x39')],function(_0x2030c1){var _0x315a73={};_0x315a73[_0x2030c1]={'$like':'%'+_0x374a54[_0x22eb('0x35')]['filter']+'%'};return _0x315a73;})});}if(_0x374a54[_0x22eb('0x35')][_0x22eb('0x72')]){var _0x4770dd=_0x374a54[_0x22eb('0x35')]['$gte'][_0x22eb('0x5c')](',');var _0x2500ad={};_0x2500ad[_0x4770dd[0x0]]={'$gte':moment(_0x4770dd[0x1])['format'](_0x22eb('0xae'))};_0x3598cf[_0x22eb('0x3f')]=_[_0x22eb('0x8e')](_0x3598cf[_0x22eb('0x3f')],_0x2500ad);}_0x3598cf=_[_0x22eb('0x8e')]({},_0x3598cf,_0x374a54[_0x22eb('0xaf')]);return db[_0x22eb('0xac')][_0x22eb('0x1d')]({'where':_0x3598cf[_0x22eb('0x3f')]})['then'](function(_0xf7141f){_0x34b34d[_0x22eb('0x1d')]=_0xf7141f;if(_0x374a54[_0x22eb('0x35')][_0x22eb('0xb0')]){_0x3598cf['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x22eb('0xb1')](_0x3598cf);})['then'](function(_0x57e2a7){_0x34b34d[_0x22eb('0x9f')]=_0x57e2a7;return _0x34b34d;});}})[_0x22eb('0x25')](respondWithFilteredResult(_0x171c21,_0x3598cf))[_0x22eb('0x30')](handleError(_0x171c21,null));};exports[_0x22eb('0xb2')]=function(_0x3b84ec,_0x44d9d5,_0x5cf6ee){return db[_0x22eb('0xa3')][_0x22eb('0x56')]({'where':{'id':_0x3b84ec[_0x22eb('0xa5')]['id']}})['then'](handleEntityNotFound(_0x44d9d5,null))[_0x22eb('0x25')](function(_0x55ed17){if(_0x55ed17){return _0x55ed17[_0x22eb('0xb3')](_0x3b84ec['body'][_0x22eb('0xa8')],_['omit'](_0x3b84ec[_0x22eb('0xa4')],[_0x22eb('0xa8'),'id'])||{})[_0x22eb('0xb4')](function(){return db[_0x22eb('0x65')][_0x22eb('0xb1')]({'attributes':['id',_0x22eb('0x29'),_0x22eb('0x44')],'where':{'id':_0x3b84ec[_0x22eb('0xa4')][_0x22eb('0xa8')]}});})[_0x22eb('0x25')](function(_0x5020e2){socket[_0x22eb('0xb5')](_0x22eb('0xb6'),{'id':Number(_0x3b84ec['params']['id']),'tags':_0x5020e2||[]});return{'id':Number(_0x3b84ec[_0x22eb('0xa5')]['id']),'tags':_0x5020e2||[]};});}})[_0x22eb('0x25')](respondWithResult(_0x44d9d5,null))[_0x22eb('0x30')](handleError(_0x44d9d5,null));};exports[_0x22eb('0xb7')]=function(_0x490a10,_0x4d56bc,_0x55faec){return db[_0x22eb('0xa3')]['find']({'where':{'id':_0x490a10['params']['id']}})[_0x22eb('0x25')](handleEntityNotFound(_0x4d56bc,null))[_0x22eb('0x25')](function(_0x40a277){if(_0x40a277){return _0x40a277['removeTags'](_0x490a10['query'][_0x22eb('0xa8')]);}})[_0x22eb('0x25')](respondWithStatusCode(_0x4d56bc,null))[_0x22eb('0x30')](handleError(_0x4d56bc,null));};exports[_0x22eb('0xb8')]=function(_0x380363,_0x1aae1d){var _0x5d4b82=moment()['unix']()[_0x22eb('0x8c')]();var _0x1fcd37=path[_0x22eb('0xb9')](config[_0x22eb('0xba')],_0x22eb('0xbb'),_0x22eb('0xbc'),_0x22eb('0xbd'));var _0x37e436=path[_0x22eb('0xb9')](config['root'],_0x22eb('0xbb'),'files','attachments');var _0x14c341=path['join'](_0x1fcd37,_0x5d4b82);var _0x70c32e=util['format'](_0x22eb('0xbe'),_0x380363[_0x22eb('0xa5')]['id'],_0x5d4b82);var _0x8bea22=path[_0x22eb('0xb9')](_0x1fcd37,_0x70c32e);var _0x4e06db=![];return db[_0x22eb('0xa3')][_0x22eb('0x56')]({'where':{'id':_0x380363[_0x22eb('0xa5')]['id']},'include':[{'model':db[_0x22eb('0xac')],'as':_0x22eb('0xbf'),'attributes':['id',_0x22eb('0xa4'),'createdAt',_0x22eb('0xc0'),_0x22eb('0xc1'),_0x22eb('0x77')],'include':[{'model':db['User'],'as':_0x22eb('0x68'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x22eb('0xc2')],'as':_0x22eb('0x5a'),'attributes':['id',_0x22eb('0xc3'),_0x22eb('0xc4')],'raw':!![]},{'model':db[_0x22eb('0xc5')],'as':_0x22eb('0xc5'),'raw':!![]}]},{'model':db[_0x22eb('0xc6')],'as':'Account','attributes':['id',_0x22eb('0x29')]},{'model':db['User'],'as':_0x22eb('0xc7'),'attributes':['id','fullname']}]})[_0x22eb('0x25')](handleEntityNotFound(_0x1aae1d,null))['then'](function(_0x3f3a0b){if(_0x3f3a0b){var _0x51b3e7=_0x3f3a0b[_0x22eb('0xc8')]({'plain':!![]});_0x4e06db=!![];var _0x12d3c0={'format':'A4','border':'10px','header':{'height':_0x22eb('0xc9'),'contents':{'first':_0x22eb('0xca')}},'footer':{'height':_0x22eb('0xcb'),'contents':{'default':util[_0x22eb('0xcc')](_0x22eb('0xcd'),util[_0x22eb('0xcc')](_0x22eb('0xce'),'Openchannel',_0x51b3e7['id']),moment()['format'](_0x22eb('0xcf'))[_0x22eb('0x8c')]())}}};fs[_0x22eb('0xd0')](_0x14c341);var _0x5ee54e={'channel':'Openchannel','account':_0x51b3e7['Account'][_0x22eb('0x29')],'agent':_0x51b3e7[_0x22eb('0xc7')]?_0x51b3e7[_0x22eb('0xc7')][_0x22eb('0xd1')]:'N.A.','createdAt':moment(_0x51b3e7[_0x22eb('0x70')])['format'](_0x22eb('0xae'))[_0x22eb('0x8c')](),'closedAt':_0x51b3e7['closed']?moment(_0x51b3e7[_0x22eb('0xd2')])['format'](_0x22eb('0xae'))['toString']():'','disposition':_0x51b3e7[_0x22eb('0xd3')],'visibility':_0x51b3e7[_0x22eb('0xd4')]?'Public':_0x22eb('0xd5'),'messages':_(_0x51b3e7[_0x22eb('0xbf')])[_0x22eb('0x7b')]({'secret':![]})['map'](function(_0x495779){if(_0x495779[_0x22eb('0xc5')]){var _0x5d369a=path['join'](_0x37e436,_0x495779['Attachment'][_0x22eb('0xd6')]);if(fs['existsSync'](_0x5d369a)){fs[_0x22eb('0xd7')](_0x5d369a)[_0x22eb('0xd8')](fs[_0x22eb('0xd9')](path[_0x22eb('0xb9')](_0x14c341,_0x495779[_0x22eb('0xc5')][_0x22eb('0xd6')])));}}return{'date':moment(_0x495779[_0x22eb('0x70')])['format'](_0x22eb('0xae'))[_0x22eb('0x8c')](),'sender':_0x495779['direction']===_0x22eb('0xda')?_0x495779[_0x22eb('0x68')]?_0x495779[_0x22eb('0x68')][_0x22eb('0xd1')]:_0x22eb('0xdb'):_0x495779[_0x22eb('0x5a')]['firstName']+(_0x495779[_0x22eb('0x5a')][_0x22eb('0xc4')]?'\x20'+_0x495779['Contact']['lastName']:''),'body':_0x495779[_0x22eb('0xc5')]?_0x495779['Attachment']['basename']:_0x495779[_0x22eb('0xa4')],'direction':_0x495779[_0x22eb('0xc0')]==='out'?'A':'C','secret':_0x495779[_0x22eb('0xc1')],'read':_0x495779['read'],'attachment':_0x495779[_0x22eb('0xc5')]};})[_0x22eb('0x57')]()};return ejs[_0x22eb('0xdc')](path[_0x22eb('0xb9')](config[_0x22eb('0xba')],_0x22eb('0xbb'),'views',_0x22eb('0xdd')),{'interaction':_0x5ee54e})[_0x22eb('0x25')](function(_0x29a55c){return new BPromise(function(_0x28bfef,_0x5b944d){pdf[_0x22eb('0xa2')](_0x29a55c,_0x12d3c0)[_0x22eb('0xde')](path[_0x22eb('0xb9')](_0x14c341,_0x22eb('0xdf')+_0x51b3e7['id']+'-'+_0x5d4b82+_0x22eb('0xe0')),function(_0x242569,_0x1e0409){if(_0x242569)return _0x5b944d(_0x242569);_0x28bfef(_0x1e0409);});});});}})['then'](function(){if(_0x4e06db){return new BPromise(function(_0x454624,_0x127a72){zipdir(_0x14c341,{'saveTo':_0x8bea22},function(_0x5eab5e,_0x2b1c67){if(_0x5eab5e)return _0x127a72(_0x5eab5e);return _0x454624(_0x2b1c67);});})[_0x22eb('0x25')](function(){return new BPromise(function(_0x5a098c,_0x19bd52){rimraf(_0x14c341,function(_0x290942){if(_0x290942)_0x19bd52(_0x290942);return _0x5a098c();});});})['then'](function(){return _0x1aae1d[_0x22eb('0xb8')](_0x8bea22,_0x70c32e,function(_0x194980){if(_0x194980){console['log']('err',_0x194980);}else{fs['unlinkSync'](_0x8bea22);}});});}else{return _0x1aae1d[_0x22eb('0x1b')](0xc8);}})[_0x22eb('0x30')](handleError(_0x1aae1d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index ec13c6e..8dfca22 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.events.js +++ b/server/api/openchannelInteraction/openchannelInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9eaa=['getUsers','then','setDataValue','Users','map','length','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x965eaf,_0x4918c1){var _0x942772=function(_0x9cd9f1){while(--_0x9cd9f1){_0x965eaf['push'](_0x965eaf['shift']());}};_0x942772(++_0x4918c1);}(_0x9eaa,0x126));var _0xa9ea=function(_0x24ac61,_0x171b58){_0x24ac61=_0x24ac61-0x0;var _0x38081a=_0x9eaa[_0x24ac61];return _0x38081a;};'use strict';var EventEmitter=require(_0xa9ea('0x0'));var OpenchannelInteraction=require(_0xa9ea('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0xa9ea('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xa9ea('0x3')](0x0);var events={'afterCreate':_0xa9ea('0x4'),'afterUpdate':'update','afterDestroy':_0xa9ea('0x5')};function emitEvent(_0x167e4b){return function(_0x50b989,_0x2cc631,_0x3e4c8b){_0x50b989[_0xa9ea('0x6')]({'attributes':['id'],'raw':!![]})[_0xa9ea('0x7')](function(_0x4a7d84){_0x50b989[_0xa9ea('0x8')](_0xa9ea('0x9'),_0x4a7d84[_0xa9ea('0xa')](function(_0x53c533){return{'id':_0x53c533['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x50b989['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa9ea('0x7')](function(_0x3e7ace){_0x50b989[_0xa9ea('0x8')]('unreadMessages',_0x3e7ace[_0xa9ea('0xb')]);OpenchannelInteractionEvents[_0xa9ea('0xc')](_0x167e4b+':'+_0x50b989['id'],_0x50b989);OpenchannelInteractionEvents[_0xa9ea('0xc')](_0x167e4b,_0x50b989);_0x3e4c8b(null);})['catch'](_0x3e4c8b(null));};}for(var e in events){if(events[_0xa9ea('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xa9ea('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xa033=['hook','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','hasOwnProperty'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa033,0xf1));var _0x3a03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa033[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3a03('0x0'));var OpenchannelInteraction=require(_0x3a03('0x1'))['db'][_0x3a03('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3a03('0x3')](0x0);var events={'afterCreate':_0x3a03('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x46d5ee){return function(_0x494495,_0x1c2c62,_0xeee9a3){_0x494495[_0x3a03('0x5')]({'attributes':['id'],'raw':!![]})[_0x3a03('0x6')](function(_0x34022a){_0x494495[_0x3a03('0x7')]('Users',_0x34022a[_0x3a03('0x8')](function(_0x36c675){return{'id':_0x36c675['id']};}));return OpenchannelMessage[_0x3a03('0x9')]({'where':{'OpenchannelInteractionId':_0x494495['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3a03('0x6')](function(_0x54b645){_0x494495[_0x3a03('0x7')](_0x3a03('0xa'),_0x54b645[_0x3a03('0xb')]);OpenchannelInteractionEvents[_0x3a03('0xc')](_0x46d5ee+':'+_0x494495['id'],_0x494495);OpenchannelInteractionEvents[_0x3a03('0xc')](_0x46d5ee,_0x494495);_0xeee9a3(null);})['catch'](_0xeee9a3(null));};}for(var e in events){if(events[_0x3a03('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x3a03('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 064e6d0..7152ac2 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.model.js +++ b/server/api/openchannelInteraction/openchannelInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06f4=['api','moment','path','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','changed','format','lodash','util'];(function(_0x525026,_0x57074a){var _0x34a75f=function(_0x3859a7){while(--_0x3859a7){_0x525026['push'](_0x525026['shift']());}};_0x34a75f(++_0x57074a);}(_0x06f4,0x136));var _0x406f=function(_0x326938,_0x398878){_0x326938=_0x326938-0x0;var _0x63c014=_0x06f4[_0x326938];return _0x63c014;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var logger=require('../../config/logger')(_0x406f('0x2'));var moment=require(_0x406f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x406f('0x4'));var rimraf=require('rimraf');var config=require(_0x406f('0x5'));var attributes=require(_0x406f('0x6'));module[_0x406f('0x7')]=function(_0x32b2bd,_0x59821c){return _0x32b2bd[_0x406f('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x406f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c39ce,_0xc2f682,_0x54eb68){if(_0x1c39ce[_0x406f('0xa')]('closed')){_0x1c39ce['closedAt']=moment()[_0x406f('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x54eb68(null,_0x1c39ce);}}});}; \ No newline at end of file +var _0x7579=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions','changed','closedAt'];(function(_0x4e1386,_0x2bc8a0){var _0x240049=function(_0x34eaed){while(--_0x34eaed){_0x4e1386['push'](_0x4e1386['shift']());}};_0x240049(++_0x2bc8a0);}(_0x7579,0x1e2));var _0x9757=function(_0x5bb1fa,_0x4989aa){_0x5bb1fa=_0x5bb1fa-0x0;var _0xba07d=_0x7579[_0x5bb1fa];return _0xba07d;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0x9757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51a1c8,_0x2d65dd,_0x2f9867){if(_0x51a1c8[_0x9757('0xc')]('closed')){_0x51a1c8[_0x9757('0xd')]=moment()[_0x9757('0xe')](_0x9757('0xf'));}_0x2f9867(null,_0x51a1c8);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 6a32a4b..308cf0b 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js +++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x528e=['debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x61265e,_0x17c814){var _0x2682ed=function(_0x5a3283){while(--_0x5a3283){_0x61265e['push'](_0x61265e['shift']());}};_0x2682ed(++_0x17c814);}(_0x528e,0x157));var _0xe528=function(_0x40b56b,_0x3e6852){_0x40b56b=_0x40b56b-0x0;var _0x187126=_0x528e[_0x40b56b];return _0x187126;};'use strict';var _=require(_0xe528('0x0'));var util=require(_0xe528('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe528('0x2'))['db'];var utils=require(_0xe528('0x3'));var logger=require(_0xe528('0x4'))('rpc');var config=require(_0xe528('0x5'));var jayson=require(_0xe528('0x6'));var client=jayson[_0xe528('0x7')][_0xe528('0x8')]({'port':0x232a});config[_0xe528('0x9')]=_[_0xe528('0xa')](config[_0xe528('0x9')],{'host':_0xe528('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xe528('0xc')](socket);function respondWithRpcPromise(_0x38cfad,_0x1fed42,_0x344582){return new BPromise(function(_0x2216a6,_0x6a2a47){return client[_0xe528('0xd')](_0x38cfad,_0x344582)['then'](function(_0x4cbfcd){logger[_0xe528('0xe')](_0xe528('0xf'),_0x1fed42,_0xe528('0x10'));logger[_0xe528('0x11')](_0xe528('0x12'),_0x1fed42,_0xe528('0x10'),JSON[_0xe528('0x13')](_0x4cbfcd));if(_0x4cbfcd[_0xe528('0x14')]){if(_0x4cbfcd[_0xe528('0x14')][_0xe528('0x15')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1fed42,_0x4cbfcd[_0xe528('0x14')][_0xe528('0x16')]);return _0x6a2a47(_0x4cbfcd[_0xe528('0x14')][_0xe528('0x16')]);}logger[_0xe528('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1fed42,_0x4cbfcd[_0xe528('0x14')][_0xe528('0x16')]);return _0x2216a6(_0x4cbfcd[_0xe528('0x14')][_0xe528('0x16')]);}else{logger[_0xe528('0xe')](_0xe528('0xf'),_0x1fed42,_0xe528('0x10'));_0x2216a6(_0x4cbfcd['result'][_0xe528('0x16')]);}})[_0xe528('0x17')](function(_0xda261c){logger[_0xe528('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1fed42,_0xda261c);_0x6a2a47(_0xda261c);});});}exports[_0xe528('0x18')]=function(_0x12f267){var _0x339281=this;return new Promise(function(_0x1205d5,_0x1e8abe){return db[_0xe528('0x19')][_0xe528('0x1a')](_0x12f267[_0xe528('0x1b')],{'raw':_0x12f267[_0xe528('0x1c')]?_0x12f267['options'][_0xe528('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12f267[_0xe528('0x1c')]?_0x12f267[_0xe528('0x1c')][_0xe528('0x1e')]||null:null,'attributes':_0x12f267[_0xe528('0x1c')]?_0x12f267[_0xe528('0x1c')][_0xe528('0x1f')]||null:null,'limit':_0x12f267['options']?_0x12f267[_0xe528('0x1c')][_0xe528('0x20')]||null:null})[_0xe528('0x21')](function(_0x1c3efb){logger[_0xe528('0xe')](_0xe528('0x18'),_0x12f267);logger[_0xe528('0x11')](_0xe528('0x18'),_0x12f267,JSON['stringify'](_0x1c3efb));_0x1205d5(_0x1c3efb);})[_0xe528('0x17')](function(_0x286ef1){logger['error']('UpdateOpenchannelInteraction',_0x286ef1[_0xe528('0x16')],_0x12f267);_0x1e8abe(_0x339281['error'](0x1f4,_0x286ef1[_0xe528('0x16')]));});});};exports[_0xe528('0x22')]=function(_0x25d4b4){return new Promise(function(_0x29cde3,_0x4c9d14){return db['OpenchannelInteraction'][_0xe528('0x23')]({'where':_0x25d4b4['options']?_0x25d4b4['options'][_0xe528('0x1e')]||null:null})['then'](function(_0x2a9d4f){if(_0x2a9d4f){return _0x2a9d4f['addTags'](_0x25d4b4['body'][_0xe528('0x24')],_[_0xe528('0x25')](_0x25d4b4[_0xe528('0x1b')],[_0xe528('0x24'),'id'])||{});}})[_0xe528('0x26')](function(_0x14c1d9){logger[_0xe528('0xe')](_0xe528('0x27'),_0x25d4b4);logger[_0xe528('0x11')](_0xe528('0x27'),_0x25d4b4,JSON[_0xe528('0x13')](_0x14c1d9));_0x29cde3(_0x14c1d9);})[_0xe528('0x17')](function(_0x5991a5){logger['error'](_0xe528('0x27'),_0x5991a5[_0xe528('0x16')],_0x25d4b4);_0x4c9d14(_this['error'](0x1f4,_0x5991a5[_0xe528('0x16')]));});});}; \ No newline at end of file +var _0x9792=['spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','code','message','error','request\x20sent','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','where','attributes','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit'];(function(_0x282ded,_0x3805ef){var _0x5845d0=function(_0x28fb01){while(--_0x28fb01){_0x282ded['push'](_0x282ded['shift']());}};_0x5845d0(++_0x3805ef);}(_0x9792,0x9e));var _0x2979=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x9792[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x2979('0x0'));var util=require('util');var moment=require(_0x2979('0x1'));var BPromise=require(_0x2979('0x2'));var rs=require(_0x2979('0x3'));var fs=require('fs');var Redis=require(_0x2979('0x4'));var db=require(_0x2979('0x5'))['db'];var utils=require(_0x2979('0x6'));var logger=require('../../config/logger')(_0x2979('0x7'));var config=require('../../config/environment');var jayson=require(_0x2979('0x8'));var client=jayson[_0x2979('0x9')][_0x2979('0xa')]({'port':0x232a});config[_0x2979('0xb')]=_[_0x2979('0xc')](config[_0x2979('0xb')],{'host':_0x2979('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2979('0xb')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x37bb7d,_0x5510c0,_0x374f64){return new BPromise(function(_0x117f77,_0x375a5c){return client[_0x2979('0xe')](_0x37bb7d,_0x374f64)[_0x2979('0xf')](function(_0x28c0f1){logger[_0x2979('0x10')](_0x2979('0x11'),_0x5510c0,'request\x20sent');logger[_0x2979('0x12')](_0x2979('0x13'),_0x5510c0,'request\x20sent',JSON[_0x2979('0x14')](_0x28c0f1));if(_0x28c0f1['error']){if(_0x28c0f1['error'][_0x2979('0x15')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x5510c0,_0x28c0f1['error'][_0x2979('0x16')]);return _0x375a5c(_0x28c0f1['error'][_0x2979('0x16')]);}logger[_0x2979('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5510c0,_0x28c0f1[_0x2979('0x17')]['message']);return _0x117f77(_0x28c0f1[_0x2979('0x17')][_0x2979('0x16')]);}else{logger['info'](_0x2979('0x11'),_0x5510c0,_0x2979('0x18'));_0x117f77(_0x28c0f1['result'][_0x2979('0x16')]);}})[_0x2979('0x19')](function(_0x4f5f25){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x5510c0,_0x4f5f25);_0x375a5c(_0x4f5f25);});});}exports[_0x2979('0x1a')]=function(_0x442f76){var _0x45c572=this;return new Promise(function(_0x2cc36c,_0x3348f2){return db[_0x2979('0x1b')]['update'](_0x442f76['body'],{'raw':_0x442f76[_0x2979('0x1c')]?_0x442f76[_0x2979('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x442f76[_0x2979('0x1c')]?_0x442f76[_0x2979('0x1c')][_0x2979('0x1d')]||null:null,'attributes':_0x442f76['options']?_0x442f76[_0x2979('0x1c')][_0x2979('0x1e')]||null:null,'limit':_0x442f76['options']?_0x442f76['options']['limit']||null:null})[_0x2979('0xf')](function(_0x3fbcbd){logger[_0x2979('0x10')](_0x2979('0x1a'),_0x442f76);logger['debug'](_0x2979('0x1a'),_0x442f76,JSON[_0x2979('0x14')](_0x3fbcbd));_0x2cc36c(_0x3fbcbd);})['catch'](function(_0x315bba){logger[_0x2979('0x17')](_0x2979('0x1a'),_0x315bba[_0x2979('0x16')],_0x442f76);_0x3348f2(_0x45c572['error'](0x1f4,_0x315bba['message']));});});};exports[_0x2979('0x1f')]=function(_0x28b4bf){return new Promise(function(_0x18c065,_0x4b3ad3){return db[_0x2979('0x1b')][_0x2979('0x20')]({'where':_0x28b4bf[_0x2979('0x1c')]?_0x28b4bf[_0x2979('0x1c')]['where']||null:null})[_0x2979('0xf')](function(_0x513ea9){if(_0x513ea9){return _0x513ea9[_0x2979('0x21')](_0x28b4bf[_0x2979('0x22')][_0x2979('0x23')],_[_0x2979('0x24')](_0x28b4bf[_0x2979('0x22')],[_0x2979('0x23'),'id'])||{});}})[_0x2979('0x25')](function(_0x433be7){logger[_0x2979('0x10')](_0x2979('0x26'),_0x28b4bf);logger['debug'](_0x2979('0x26'),_0x28b4bf,JSON['stringify'](_0x433be7));_0x18c065(_0x433be7);})[_0x2979('0x19')](function(_0x4b76a7){logger[_0x2979('0x17')]('AddTags',_0x4b76a7[_0x2979('0x16')],_0x28b4bf);_0x4b3ad3(_this[_0x2979('0x17')](0x1f4,_0x4b76a7['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index e72b54c..0cdfe2f 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.socket.js +++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1872=['update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x1872,0x195));var _0x2187=function(_0x5ed024,_0x20fcac){_0x5ed024=_0x5ed024-0x0;var _0x529b32=_0x1872[_0x5ed024];return _0x529b32;};'use strict';var OpenchannelInteractionEvents=require(_0x2187('0x0'));var events=[_0x2187('0x1'),_0x2187('0x2'),_0x2187('0x3')];function createListener(_0x242ec9,_0x4c5867){return function(_0x2b71fa){_0x4c5867[_0x2187('0x4')](_0x242ec9,_0x2b71fa);};}function removeListener(_0x21677d,_0x4745fd){return function(){OpenchannelInteractionEvents['removeListener'](_0x21677d,_0x4745fd);};}exports[_0x2187('0x5')]=function(_0xa60018){for(var _0x4233c5=0x0,_0x205032=events[_0x2187('0x6')];_0x4233c5<_0x205032;_0x4233c5++){var _0x3d2330=events[_0x4233c5];var _0x29ccbe=createListener(_0x2187('0x7')+_0x3d2330,_0xa60018);OpenchannelInteractionEvents['on'](_0x3d2330,_0x29ccbe);}}; \ No newline at end of file +var _0x3095=['./openchannelInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0x55879f,_0x228047){var _0x511732=function(_0x2500ca){while(--_0x2500ca){_0x55879f['push'](_0x55879f['shift']());}};_0x511732(++_0x228047);}(_0x3095,0x1a4));var _0x5309=function(_0x2d9f8b,_0x1eca48){_0x2d9f8b=_0x2d9f8b-0x0;var _0x251209=_0x3095[_0x2d9f8b];return _0x251209;};'use strict';var OpenchannelInteractionEvents=require(_0x5309('0x0'));var events=[_0x5309('0x1'),_0x5309('0x2'),_0x5309('0x3')];function createListener(_0x4e5fc4,_0x2aacd0){return function(_0x1ff127){_0x2aacd0[_0x5309('0x4')](_0x4e5fc4,_0x1ff127);};}function removeListener(_0x5e324a,_0x273978){return function(){OpenchannelInteractionEvents[_0x5309('0x5')](_0x5e324a,_0x273978);};}exports['register']=function(_0x2473aa){for(var _0x2c2b65=0x0,_0x5dd0fe=events[_0x5309('0x6')];_0x2c2b65<_0x5dd0fe;_0x2c2b65++){var _0x43eeaa=events[_0x2c2b65];var _0x151ab6=createListener('openchannelInteraction:'+_0x43eeaa,_0x2473aa);OpenchannelInteractionEvents['on'](_0x43eeaa,_0x151ab6);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 522a99a..7435da1 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5af7=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannelmessage:create','create','put','update','accept','/:id/reject','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1565f1,_0x15f9b7){var _0x39a923=function(_0x61365a){while(--_0x61365a){_0x1565f1['push'](_0x1565f1['shift']());}};_0x39a923(++_0x15f9b7);}(_0x5af7,0xa2));var _0x75af=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x5af7[_0x9307ea];return _0x295554;};'use strict';var multer=require(_0x75af('0x0'));var util=require('util');var path=require(_0x75af('0x1'));var timeout=require(_0x75af('0x2'));var express=require(_0x75af('0x3'));var router=express[_0x75af('0x4')]();var auth=require(_0x75af('0x5'));var interaction=require(_0x75af('0x6'));var config=require('../../config/environment');var controller=require('./openchannelMessage.controller');router[_0x75af('0x7')]('/',auth[_0x75af('0x8')](),controller[_0x75af('0x9')]);router[_0x75af('0x7')](_0x75af('0xa'),auth[_0x75af('0x8')](),controller[_0x75af('0xb')]);router[_0x75af('0x7')](_0x75af('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x75af('0xd')]('/',auth[_0x75af('0x8')](),interaction[_0x75af('0xe')]('openchannel',_0x75af('0xf')),controller[_0x75af('0x10')]);router[_0x75af('0x11')](_0x75af('0xc'),auth[_0x75af('0x8')](),controller[_0x75af('0x12')]);router[_0x75af('0x11')]('/:id/accept',auth[_0x75af('0x8')](),controller[_0x75af('0x13')]);router[_0x75af('0x11')](_0x75af('0x14'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x75af('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1390=['put','/:id','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','index','isAuthenticated','show','post','openchannelmessage:create','create'];(function(_0x395d32,_0x519b7b){var _0x1a6cf4=function(_0x410c95){while(--_0x410c95){_0x395d32['push'](_0x395d32['shift']());}};_0x1a6cf4(++_0x519b7b);}(_0x1390,0xb1));var _0x0139=function(_0x5acebc,_0x2873ae){_0x5acebc=_0x5acebc-0x0;var _0x3908c7=_0x1390[_0x5acebc];return _0x3908c7;};'use strict';var multer=require(_0x0139('0x0'));var util=require(_0x0139('0x1'));var path=require(_0x0139('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0139('0x3')]();var auth=require(_0x0139('0x4'));var interaction=require(_0x0139('0x5'));var config=require(_0x0139('0x6'));var controller=require(_0x0139('0x7'));router[_0x0139('0x8')]('/',auth['isAuthenticated'](),controller[_0x0139('0x9')]);router[_0x0139('0x8')]('/describe',auth[_0x0139('0xa')](),controller['describe']);router[_0x0139('0x8')]('/:id',auth[_0x0139('0xa')](),controller[_0x0139('0xb')]);router[_0x0139('0xc')]('/',auth[_0x0139('0xa')](),interaction['tracked']('openchannel',_0x0139('0xd')),controller[_0x0139('0xe')]);router[_0x0139('0xf')](_0x0139('0x10'),auth[_0x0139('0xa')](),controller[_0x0139('0x11')]);router[_0x0139('0xf')](_0x0139('0x12'),auth[_0x0139('0xa')](),controller[_0x0139('0x13')]);router[_0x0139('0xf')]('/:id/reject',auth[_0x0139('0xa')](),controller[_0x0139('0x14')]);router[_0x0139('0x15')](_0x0139('0x10'),auth['isAuthenticated'](),controller[_0x0139('0x16')]);module[_0x0139('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 04f6bf3..a245d12 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9315=['sequelize','BOOLEAN','ENUM','out','DATE'];(function(_0x1ad48c,_0x2f06f9){var _0x519709=function(_0x1f026c){while(--_0x1f026c){_0x1ad48c['push'](_0x1ad48c['shift']());}};_0x519709(++_0x2f06f9);}(_0x9315,0x172));var _0x5931=function(_0x4a609b,_0x1ed1e8){_0x4a609b=_0x4a609b-0x0;var _0x50f18b=_0x9315[_0x4a609b];return _0x50f18b;};'use strict';var Sequelize=require(_0x5931('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x5931('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5931('0x2')]('in',_0x5931('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x5931('0x4')]}}; \ No newline at end of file +var _0xb9d4=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x7ba1c3,_0x3dd545){var _0x82b393=function(_0x1550ce){while(--_0x1550ce){_0x7ba1c3['push'](_0x7ba1c3['shift']());}};_0x82b393(++_0x3dd545);}(_0xb9d4,0x133));var _0x4b9d=function(_0x121ed0,_0x3961d9){_0x121ed0=_0x121ed0-0x0;var _0x81ae5c=_0xb9d4[_0x121ed0];return _0x81ae5c;};'use strict';var Sequelize=require(_0x4b9d('0x0'));module[_0x4b9d('0x1')]={'body':{'type':Sequelize[_0x4b9d('0x2')](_0x4b9d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4b9d('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4b9d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b9d('0x5')]('in','out'),'defaultValue':_0x4b9d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4b9d('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c68720f..083e022 100644 --- a/server/api/openchannelMessage/openchannelMessage.controller.js +++ b/server/api/openchannelMessage/openchannelMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcddd=['fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','update','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','get','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','map','OpenchannelMessage','fieldName','type','model','keys','query','filters','intersection','attributes'];(function(_0x25a055,_0x173511){var _0x2295f9=function(_0x579d8e){while(--_0x579d8e){_0x25a055['push'](_0x25a055['shift']());}};_0x2295f9(++_0x173511);}(_0xcddd,0xa9));var _0xdcdd=function(_0x5770a3,_0x110b04){_0x5770a3=_0x5770a3-0x0;var _0x14f377=_0xcddd[_0x5770a3];return _0x14f377;};'use strict';var pdf=require(_0xdcdd('0x0'));var emlformat=require(_0xdcdd('0x1'));var rimraf=require(_0xdcdd('0x2'));var zipdir=require(_0xdcdd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdcdd('0x4'));var moment=require('moment');var BPromise=require(_0xdcdd('0x5'));var Mustache=require(_0xdcdd('0x6'));var util=require(_0xdcdd('0x7'));var path=require(_0xdcdd('0x8'));var sox=require('sox');var csv=require(_0xdcdd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdcdd('0xa'));var crypto=require(_0xdcdd('0xb'));var jsforce=require(_0xdcdd('0xc'));var deskjs=require(_0xdcdd('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdcdd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdcdd('0xf'));var qs=require(_0xdcdd('0x10'));var as=require(_0xdcdd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcdd('0x12'))(_0xdcdd('0x13'));var utils=require(_0xdcdd('0x14'));var config=require('../../config/environment');var db=require(_0xdcdd('0x15'))['db'];config[_0xdcdd('0x16')]=_['defaults'](config[_0xdcdd('0x16')],{'host':_0xdcdd('0x17'),'port':0x18eb});var socket=require(_0xdcdd('0x18'))(new Redis(config[_0xdcdd('0x16')]));require(_0xdcdd('0x19'))[_0xdcdd('0x1a')](socket);var jayson=require(_0xdcdd('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2dfea6,_0x4699fe,_0x168637){if(_0x168637){var _0x3de823=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3de823[_0xdcdd('0x1c')](_0x4699fe)){return _0x2dfea6;}else{throw new db['Sequelize'][(_0xdcdd('0x1d'))](_0xdcdd('0x1e'));}}else{return _0x2dfea6;}}function respondWithRpcPromise(_0x256a9a,_0x286cca,_0x14f4b3,_0x164fe5){return new BPromise(function(_0x1ca3a6,_0x222c61){var _0xeb134e=_0x164fe5||client;return _0xeb134e[_0xdcdd('0x1f')](_0x256a9a,_0x14f4b3)[_0xdcdd('0x20')](function(_0x3d8ea5){logger['info'](_0xdcdd('0x21'),_0x286cca,_0xdcdd('0x22'));logger[_0xdcdd('0x23')](_0xdcdd('0x24'),_0x286cca,_0xdcdd('0x22'),JSON[_0xdcdd('0x25')](_0x3d8ea5));if(_0x3d8ea5['error']){if(_0x3d8ea5[_0xdcdd('0x26')][_0xdcdd('0x27')]===0x1f4){logger[_0xdcdd('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x286cca,_0x3d8ea5['error'][_0xdcdd('0x28')]);return _0x222c61(_0x3d8ea5['error'][_0xdcdd('0x28')]);}logger[_0xdcdd('0x26')](_0xdcdd('0x21'),_0x286cca,_0x3d8ea5['error'][_0xdcdd('0x28')]);return _0x1ca3a6(_0x3d8ea5[_0xdcdd('0x26')][_0xdcdd('0x28')]);}else{logger[_0xdcdd('0x29')](_0xdcdd('0x21'),_0x286cca,_0xdcdd('0x22'));_0x1ca3a6(_0x3d8ea5['result'][_0xdcdd('0x28')]);}})[_0xdcdd('0x2a')](function(_0x17b29f){logger[_0xdcdd('0x26')](_0xdcdd('0x21'),_0x286cca,_0x17b29f);_0x222c61(_0x17b29f);});});}function respondWithStatusCode(_0x268d60,_0x4cc3aa){_0x4cc3aa=_0x4cc3aa||0xcc;return function(_0x2e6adc){if(_0x2e6adc){return _0x268d60[_0xdcdd('0x2b')](_0x4cc3aa);}return _0x268d60[_0xdcdd('0x2c')](_0x4cc3aa)['end']();};}function respondWithResult(_0x1c3019,_0x1cf8f6){_0x1cf8f6=_0x1cf8f6||0xc8;return function(_0x524cd9){if(_0x524cd9){return _0x1c3019[_0xdcdd('0x2c')](_0x1cf8f6)[_0xdcdd('0x2d')](_0x524cd9);}};}function respondWithFilteredResult(_0x465557,_0x425d62){return function(_0xbef1f1){if(_0xbef1f1){var _0xe82c9=_0xbef1f1[_0xdcdd('0x2e')],_0x41e4fe=_0x425d62[_0xdcdd('0x2f')],_0x31febc=_0x425d62[_0xdcdd('0x2f')]+_0x425d62[_0xdcdd('0x30')],_0x585839;if(_0x31febc>=_0xe82c9){_0x31febc=_0xe82c9;_0x585839=0xc8;}else{_0x585839=0xce;}_0x465557[_0xdcdd('0x2c')](_0x585839);return _0x465557[_0xdcdd('0x31')](_0xdcdd('0x32'),_0x41e4fe+'-'+_0x31febc+'/'+_0xe82c9)[_0xdcdd('0x2d')](_0xbef1f1);}return null;};}function patchUpdates(_0x13ba4d){return function(_0x295094){try{jsonpatch[_0xdcdd('0x33')](_0x295094,_0x13ba4d,!![]);}catch(_0x25748c){return BPromise[_0xdcdd('0x34')](_0x25748c);}return _0x295094[_0xdcdd('0x35')]();};}function saveUpdates(_0x1dde19,_0x1d6f17){return function(_0x3a0232){if(_0x3a0232){return _0x3a0232['update'](_0x1dde19)['then'](function(_0x2fd48f){return _0x2fd48f;});}return null;};}function removeEntity(_0x23acb0,_0x414adb){return function(_0x5083a6){if(_0x5083a6){return _0x5083a6[_0xdcdd('0x36')]()[_0xdcdd('0x20')](function(){_0x23acb0[_0xdcdd('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c35d0,_0xd6df9d){return function(_0xc51823){if(!_0xc51823){_0x1c35d0['sendStatus'](0x194);}return _0xc51823;};}function handleError(_0x355623,_0x49fded){_0x49fded=_0x49fded||0x1f4;return function(_0xa42bbb){logger[_0xdcdd('0x26')](_0xa42bbb[_0xdcdd('0x37')]);if(_0xa42bbb['name']){delete _0xa42bbb[_0xdcdd('0x38')];}_0x355623[_0xdcdd('0x2c')](_0x49fded)['send'](_0xa42bbb);};}exports['index']=function(_0x871a5,_0x424706){var _0x50dffb={},_0x569af9={},_0x20eb74={'count':0x0,'rows':[]};var _0x8a51fe=_[_0xdcdd('0x39')](db[_0xdcdd('0x3a')]['rawAttributes'],function(_0x5a2b57){return{'name':_0x5a2b57[_0xdcdd('0x3b')],'type':_0x5a2b57[_0xdcdd('0x3c')]['key']};});_0x569af9[_0xdcdd('0x3d')]=_['map'](_0x8a51fe,_0xdcdd('0x38'));_0x569af9['query']=_[_0xdcdd('0x3e')](_0x871a5[_0xdcdd('0x3f')]);_0x569af9[_0xdcdd('0x40')]=_[_0xdcdd('0x41')](_0x569af9[_0xdcdd('0x3d')],_0x569af9[_0xdcdd('0x3f')]);_0x50dffb[_0xdcdd('0x42')]=_[_0xdcdd('0x41')](_0x569af9[_0xdcdd('0x3d')],qs[_0xdcdd('0x43')](_0x871a5[_0xdcdd('0x3f')][_0xdcdd('0x43')]));_0x50dffb[_0xdcdd('0x42')]=_0x50dffb['attributes'][_0xdcdd('0x44')]?_0x50dffb[_0xdcdd('0x42')]:_0x569af9[_0xdcdd('0x3d')];if(!_0x871a5[_0xdcdd('0x3f')]['hasOwnProperty'](_0xdcdd('0x45'))){_0x50dffb[_0xdcdd('0x30')]=qs[_0xdcdd('0x30')](_0x871a5[_0xdcdd('0x3f')][_0xdcdd('0x30')]);_0x50dffb[_0xdcdd('0x2f')]=qs[_0xdcdd('0x2f')](_0x871a5[_0xdcdd('0x3f')][_0xdcdd('0x2f')]);}_0x50dffb[_0xdcdd('0x46')]=qs['sort'](_0x871a5['query'][_0xdcdd('0x47')]);_0x50dffb[_0xdcdd('0x48')]=qs['filters'](_[_0xdcdd('0x49')](_0x871a5[_0xdcdd('0x3f')],_0x569af9[_0xdcdd('0x40')]));if(_0x871a5[_0xdcdd('0x3f')][_0xdcdd('0x4a')]){_0x50dffb[_0xdcdd('0x48')]=_['merge'](_0x50dffb[_0xdcdd('0x48')],{'$or':_[_0xdcdd('0x39')](_0x8a51fe,function(_0x7eb236){if(_0x7eb236[_0xdcdd('0x3c')]!=='VIRTUAL'){var _0x3e0123={};_0x3e0123[_0x7eb236[_0xdcdd('0x38')]]={'$like':'%'+_0x871a5[_0xdcdd('0x3f')][_0xdcdd('0x4a')]+'%'};return _0x3e0123;}})});}_0x50dffb=_[_0xdcdd('0x4b')]({},_0x50dffb,_0x871a5[_0xdcdd('0x4c')]);var _0x16e7e2={'where':_0x50dffb['where']};return db[_0xdcdd('0x3a')][_0xdcdd('0x2e')](_0x16e7e2)[_0xdcdd('0x20')](function(_0x2b48e2){_0x20eb74[_0xdcdd('0x2e')]=_0x2b48e2;if(_0x871a5[_0xdcdd('0x3f')][_0xdcdd('0x4d')]){_0x50dffb[_0xdcdd('0x4e')]=[{'all':!![]}];}return db[_0xdcdd('0x3a')][_0xdcdd('0x4f')](_0x50dffb);})[_0xdcdd('0x20')](function(_0x454f2e){_0x20eb74[_0xdcdd('0x50')]=_0x454f2e;return _0x20eb74;})[_0xdcdd('0x20')](respondWithFilteredResult(_0x424706,_0x50dffb))['catch'](handleError(_0x424706,null));};exports['show']=function(_0xc1accc,_0x334ff3){var _0x54f9ca={'raw':!![],'where':{'id':_0xc1accc[_0xdcdd('0x51')]['id']}},_0x25be49={};_0x25be49[_0xdcdd('0x3d')]=_['keys'](db[_0xdcdd('0x3a')][_0xdcdd('0x52')]);_0x25be49[_0xdcdd('0x3f')]=_[_0xdcdd('0x3e')](_0xc1accc[_0xdcdd('0x3f')]);_0x25be49[_0xdcdd('0x40')]=_[_0xdcdd('0x41')](_0x25be49[_0xdcdd('0x3d')],_0x25be49[_0xdcdd('0x3f')]);_0x54f9ca[_0xdcdd('0x42')]=_[_0xdcdd('0x41')](_0x25be49[_0xdcdd('0x3d')],qs[_0xdcdd('0x43')](_0xc1accc['query'][_0xdcdd('0x43')]));_0x54f9ca[_0xdcdd('0x42')]=_0x54f9ca[_0xdcdd('0x42')]['length']?_0x54f9ca[_0xdcdd('0x42')]:_0x25be49[_0xdcdd('0x3d')];if(_0xc1accc[_0xdcdd('0x3f')][_0xdcdd('0x4d')]){_0x54f9ca[_0xdcdd('0x4e')]=[{'all':!![]}];}_0x54f9ca=_[_0xdcdd('0x4b')]({},_0x54f9ca,_0xc1accc[_0xdcdd('0x4c')]);return db[_0xdcdd('0x3a')][_0xdcdd('0x53')](_0x54f9ca)[_0xdcdd('0x20')](handleEntityNotFound(_0x334ff3,null))['then'](respondWithResult(_0x334ff3,null))[_0xdcdd('0x2a')](handleError(_0x334ff3,null));};exports['create']=function(_0x1a6a66,_0x5d2407){return db[_0xdcdd('0x3a')][_0xdcdd('0x54')](_0x1a6a66[_0xdcdd('0x55')],{})[_0xdcdd('0x20')](respondWithResult(_0x5d2407,0xc9))['catch'](handleError(_0x5d2407,null));};exports[_0xdcdd('0x56')]=function(_0x49e17e,_0x1aa113){if(_0x49e17e[_0xdcdd('0x55')]['id']){delete _0x49e17e[_0xdcdd('0x55')]['id'];}return db[_0xdcdd('0x3a')][_0xdcdd('0x53')]({'where':{'id':_0x49e17e[_0xdcdd('0x51')]['id']}})[_0xdcdd('0x20')](handleEntityNotFound(_0x1aa113,null))['then'](saveUpdates(_0x49e17e[_0xdcdd('0x55')],null))['then'](respondWithResult(_0x1aa113,null))[_0xdcdd('0x2a')](handleError(_0x1aa113,null));};exports[_0xdcdd('0x36')]=function(_0x2f32c6,_0x560705){return db['OpenchannelMessage'][_0xdcdd('0x53')]({'where':{'id':_0x2f32c6[_0xdcdd('0x51')]['id']}})[_0xdcdd('0x20')](handleEntityNotFound(_0x560705,null))[_0xdcdd('0x20')](removeEntity(_0x560705,null))[_0xdcdd('0x2a')](handleError(_0x560705,null));};exports[_0xdcdd('0x57')]=function(_0x52ffd9,_0x58cb6b){return db['OpenchannelMessage']['describe']()[_0xdcdd('0x20')](respondWithResult(_0x58cb6b,null))[_0xdcdd('0x2a')](handleError(_0x58cb6b,null));};var interaction_log=require(_0xdcdd('0x12'))(_0xdcdd('0x58'));exports[_0xdcdd('0x59')]=function(_0xa5a9d1,_0x1d3898,_0x100040){var _0x5969a2={'channel':_0xdcdd('0x5a')};if(_0xa5a9d1[_0xdcdd('0x55')]['id']){delete _0xa5a9d1[_0xdcdd('0x55')]['id'];}_0xa5a9d1[_0xdcdd('0x55')][_0xdcdd('0x5b')]=!![];_0xa5a9d1[_0xdcdd('0x55')][_0xdcdd('0x5c')]=moment()[_0xdcdd('0x5d')](_0xdcdd('0x5e'));_0xa5a9d1[_0xdcdd('0x55')][_0xdcdd('0x5f')]=_0xa5a9d1['body']['UserId']||_0xa5a9d1[_0xdcdd('0x60')]['id'];return db[_0xdcdd('0x3a')][_0xdcdd('0x53')]({'where':{'id':_0xa5a9d1[_0xdcdd('0x51')]['id'],'UserId':null},'include':[{'model':db[_0xdcdd('0x61')],'as':_0xdcdd('0x62')}]})[_0xdcdd('0x20')](handleEntityNotFound(_0x1d3898,null))['then'](saveUpdates(_0xa5a9d1[_0xdcdd('0x55')],null))['then'](function(_0x495a6d){if(_0x495a6d){_0x5969a2['message']=_0x495a6d['get']({'plain':!![]});return db[_0xdcdd('0x63')][_0xdcdd('0x53')]({'where':{'id':_0x495a6d[_0xdcdd('0x64')]}});}return null;})[_0xdcdd('0x20')](handleEntityNotFound(_0x1d3898,null))[_0xdcdd('0x20')](function(_0x19060e){if(_0x19060e){return _0x19060e['update']({'UserId':_0xa5a9d1['body']['UserId'],'read1stAt':_[_0xdcdd('0x65')](_0x19060e['read1stAt'])?moment()[_0xdcdd('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdcdd('0x20')](function(_0x8d44a7){if(_0x8d44a7){_0x5969a2[_0xdcdd('0x66')]=_0x8d44a7[_0xdcdd('0x67')]({'plain':!![]});interaction_log[_0xdcdd('0x29')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa5a9d1['user']['id'],_0xa5a9d1['user']['name'],_0xa5a9d1[_0xdcdd('0x60')][_0xdcdd('0x68')],_0x5969a2['interaction']['id'],_0xa5a9d1['body']?JSON[_0xdcdd('0x25')](_0xa5a9d1[_0xdcdd('0x55')]):_0xdcdd('0x69'));return respondWithRpcPromise(_0xdcdd('0x6a'),_0xdcdd('0x6b'),_0x5969a2);}return null;})[_0xdcdd('0x20')](function(_0x5c17ae){if(_0x5c17ae){if(_0xa5a9d1[_0xdcdd('0x55')]['manual']){_0x5969a2['message'][_0xdcdd('0x6c')]=util[_0xdcdd('0x5d')](_0xdcdd('0x6d'),_0xa5a9d1[_0xdcdd('0x60')][_0xdcdd('0x38')]);_0x5969a2[_0xdcdd('0x28')][_0xdcdd('0x6e')]=_0x5969a2[_0xdcdd('0x6e')];_0x5969a2[_0xdcdd('0x28')][_0xdcdd('0x6f')]='accept';return respondWithRpcPromise(_0xdcdd('0x70'),_0xdcdd('0x70'),{'event':_0xdcdd('0x71'),'message':_0x5969a2[_0xdcdd('0x28')]},client9002)[_0xdcdd('0x20')](function(){return _0x5969a2;});}return _0x5969a2;}return null;})[_0xdcdd('0x20')](respondWithResult(_0x1d3898,null))['catch'](handleError(_0x1d3898,null));};var interaction_log=require(_0xdcdd('0x12'))(_0xdcdd('0x58'));exports[_0xdcdd('0x34')]=function(_0x4217a2,_0x263cd8,_0x519048){var _0x2eb747={'agent':{},'channel':_0xdcdd('0x5a')};if(_0x4217a2[_0xdcdd('0x55')]['id']){delete _0x4217a2[_0xdcdd('0x55')]['id'];}_0x4217a2[_0xdcdd('0x55')][_0xdcdd('0x5f')]=_0x4217a2[_0xdcdd('0x55')]['UserId']||_0x4217a2[_0xdcdd('0x60')]['id'];_0x2eb747[_0xdcdd('0x72')]['id']=_0x4217a2[_0xdcdd('0x55')]['UserId'];return db[_0xdcdd('0x3a')][_0xdcdd('0x53')]({'where':{'id':_0x4217a2[_0xdcdd('0x51')]['id'],'UserId':null}})[_0xdcdd('0x20')](handleEntityNotFound(_0x263cd8,null))[_0xdcdd('0x20')](function(_0x27ec8f){if(_0x27ec8f){_0x2eb747[_0xdcdd('0x28')]=_0x27ec8f[_0xdcdd('0x67')]({'plain':!![]});return db[_0xdcdd('0x63')][_0xdcdd('0x53')]({'where':{'id':_0x27ec8f[_0xdcdd('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x263cd8,null))[_0xdcdd('0x20')](function(_0xceb9b0){if(_0xceb9b0){_0x2eb747['interaction']=_0xceb9b0['get']({'plain':!![]});interaction_log[_0xdcdd('0x29')](_0xdcdd('0x73'),_0x4217a2[_0xdcdd('0x60')]['id'],_0x4217a2[_0xdcdd('0x60')][_0xdcdd('0x38')],_0x4217a2['user'][_0xdcdd('0x68')],_0x2eb747[_0xdcdd('0x66')]['id'],_0x4217a2[_0xdcdd('0x55')]?JSON['stringify'](_0x4217a2['body']):_0xdcdd('0x69'));return respondWithRpcPromise(_0xdcdd('0x74'),_0xdcdd('0x75'),_0x2eb747);}return null;})[_0xdcdd('0x20')](function(_0x536074){if(_0x536074){_0x536074[_0xdcdd('0x28')][_0xdcdd('0x6c')]=util[_0xdcdd('0x5d')](_0xdcdd('0x6d'),_0x4217a2[_0xdcdd('0x60')]['name']);_0x536074['message'][_0xdcdd('0x6e')]=_0x2eb747[_0xdcdd('0x6e')];_0x536074[_0xdcdd('0x28')][_0xdcdd('0x6f')]=_0xdcdd('0x34');respondWithRpcPromise(_0xdcdd('0x70'),'EventManager',{'event':'rejectmessage','message':_0x536074[_0xdcdd('0x28')]},client9002);return _0x2eb747;}return null;})['then'](respondWithResult(_0x263cd8,null))['catch'](handleError(_0x263cd8,null));}; \ No newline at end of file +var _0x92b1=['get','OpenchannelInteraction','OpenchannelInteractionId','isNil','role','interaction','stringify','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','OpenchannelMessage','fieldName','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact'];(function(_0x1ef394,_0xcb2135){var _0x40ebcb=function(_0x5c28da){while(--_0x5c28da){_0x1ef394['push'](_0x1ef394['shift']());}};_0x40ebcb(++_0xcb2135);}(_0x92b1,0x96));var _0x192b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x92b1[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x192b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x192b('0x1'));var jsonpatch=require(_0x192b('0x2'));var rp=require('request-promise');var moment=require(_0x192b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x192b('0x4'));var util=require(_0x192b('0x5'));var path=require(_0x192b('0x6'));var sox=require(_0x192b('0x7'));var csv=require(_0x192b('0x8'));var ejs=require(_0x192b('0x9'));var fs=require('fs');var _=require(_0x192b('0xa'));var squel=require(_0x192b('0xb'));var crypto=require(_0x192b('0xc'));var jsforce=require(_0x192b('0xd'));var deskjs=require(_0x192b('0xe'));var toCsv=require(_0x192b('0x8'));var querystring=require(_0x192b('0xf'));var Papa=require(_0x192b('0x10'));var Redis=require(_0x192b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x192b('0x12'));var as=require(_0x192b('0x13'));var hardwareService=require(_0x192b('0x14'));var logger=require(_0x192b('0x15'))(_0x192b('0x16'));var utils=require(_0x192b('0x17'));var config=require(_0x192b('0x18'));var db=require(_0x192b('0x19'))['db'];config[_0x192b('0x1a')]=_[_0x192b('0x1b')](config['redis'],{'host':_0x192b('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x192b('0x1a')]));require('./openchannelMessage.socket')[_0x192b('0x1d')](socket);var jayson=require(_0x192b('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x192b('0x1f')][_0x192b('0x20')]({'port':0x232a});function checkPasswordPattern(_0x4f437c,_0x140ee0,_0x17c532){if(_0x17c532){var _0x17c7b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17c7b5[_0x192b('0x21')](_0x140ee0)){return _0x4f437c;}else{throw new db[(_0x192b('0x22'))]['ValidationError'](_0x192b('0x23'));}}else{return _0x4f437c;}}function respondWithRpcPromise(_0x1cdacd,_0x277384,_0x28fd04,_0x17963f){return new BPromise(function(_0x2d98a5,_0x2ef3c5){var _0x5bfc84=_0x17963f||client;return _0x5bfc84[_0x192b('0x24')](_0x1cdacd,_0x28fd04)['then'](function(_0x3633cf){logger['info'](_0x192b('0x25'),_0x277384,_0x192b('0x26'));logger[_0x192b('0x27')](_0x192b('0x28'),_0x277384,_0x192b('0x26'),JSON['stringify'](_0x3633cf));if(_0x3633cf[_0x192b('0x29')]){if(_0x3633cf[_0x192b('0x29')][_0x192b('0x2a')]===0x1f4){logger[_0x192b('0x29')](_0x192b('0x25'),_0x277384,_0x3633cf[_0x192b('0x29')][_0x192b('0x2b')]);return _0x2ef3c5(_0x3633cf[_0x192b('0x29')][_0x192b('0x2b')]);}logger[_0x192b('0x29')](_0x192b('0x25'),_0x277384,_0x3633cf[_0x192b('0x29')][_0x192b('0x2b')]);return _0x2d98a5(_0x3633cf[_0x192b('0x29')][_0x192b('0x2b')]);}else{logger[_0x192b('0x2c')](_0x192b('0x25'),_0x277384,_0x192b('0x26'));_0x2d98a5(_0x3633cf[_0x192b('0x2d')]['message']);}})['catch'](function(_0x950d0){logger[_0x192b('0x29')](_0x192b('0x25'),_0x277384,_0x950d0);_0x2ef3c5(_0x950d0);});});}function respondWithStatusCode(_0x43109c,_0x54ac6b){_0x54ac6b=_0x54ac6b||0xcc;return function(_0x394b7a){if(_0x394b7a){return _0x43109c[_0x192b('0x2e')](_0x54ac6b);}return _0x43109c['status'](_0x54ac6b)[_0x192b('0x2f')]();};}function respondWithResult(_0x32367c,_0x3f8989){_0x3f8989=_0x3f8989||0xc8;return function(_0x291bac){if(_0x291bac){return _0x32367c[_0x192b('0x30')](_0x3f8989)[_0x192b('0x31')](_0x291bac);}};}function respondWithFilteredResult(_0x6b9090,_0x267f4c){return function(_0x4b6640){if(_0x4b6640){var _0x26fd91=_0x4b6640[_0x192b('0x32')],_0x17ef95=_0x267f4c['offset'],_0xd867d5=_0x267f4c['offset']+_0x267f4c[_0x192b('0x33')],_0x530209;if(_0xd867d5>=_0x26fd91){_0xd867d5=_0x26fd91;_0x530209=0xc8;}else{_0x530209=0xce;}_0x6b9090[_0x192b('0x30')](_0x530209);return _0x6b9090['set'](_0x192b('0x34'),_0x17ef95+'-'+_0xd867d5+'/'+_0x26fd91)['json'](_0x4b6640);}return null;};}function patchUpdates(_0x1d60fe){return function(_0xd131d7){try{jsonpatch[_0x192b('0x35')](_0xd131d7,_0x1d60fe,!![]);}catch(_0x532ec8){return BPromise[_0x192b('0x36')](_0x532ec8);}return _0xd131d7['save']();};}function saveUpdates(_0x1a4c8f,_0x4e9407){return function(_0x343591){if(_0x343591){return _0x343591[_0x192b('0x37')](_0x1a4c8f)[_0x192b('0x38')](function(_0x2ddd82){return _0x2ddd82;});}return null;};}function removeEntity(_0x229bd7,_0x5d7df1){return function(_0x23af0b){if(_0x23af0b){return _0x23af0b[_0x192b('0x39')]()['then'](function(){_0x229bd7[_0x192b('0x30')](0xcc)[_0x192b('0x2f')]();});}};}function handleEntityNotFound(_0x3cdc6f,_0x294d48){return function(_0x513d0b){if(!_0x513d0b){_0x3cdc6f[_0x192b('0x2e')](0x194);}return _0x513d0b;};}function handleError(_0x3ed31e,_0x4775f8){_0x4775f8=_0x4775f8||0x1f4;return function(_0x15d711){logger[_0x192b('0x29')](_0x15d711[_0x192b('0x3a')]);if(_0x15d711[_0x192b('0x3b')]){delete _0x15d711[_0x192b('0x3b')];}_0x3ed31e[_0x192b('0x30')](_0x4775f8)[_0x192b('0x3c')](_0x15d711);};}exports[_0x192b('0x3d')]=function(_0x5529f7,_0x14d781){var _0x5e57cf={},_0x382eb8={},_0x69ab43={'count':0x0,'rows':[]};var _0x3e19c1=_['map'](db[_0x192b('0x3e')]['rawAttributes'],function(_0x485143){return{'name':_0x485143[_0x192b('0x3f')],'type':_0x485143['type'][_0x192b('0x40')]};});_0x382eb8[_0x192b('0x41')]=_[_0x192b('0x42')](_0x3e19c1,_0x192b('0x3b'));_0x382eb8[_0x192b('0x43')]=_[_0x192b('0x44')](_0x5529f7[_0x192b('0x43')]);_0x382eb8[_0x192b('0x45')]=_['intersection'](_0x382eb8[_0x192b('0x41')],_0x382eb8[_0x192b('0x43')]);_0x5e57cf['attributes']=_['intersection'](_0x382eb8['model'],qs['fields'](_0x5529f7[_0x192b('0x43')][_0x192b('0x46')]));_0x5e57cf['attributes']=_0x5e57cf[_0x192b('0x47')][_0x192b('0x48')]?_0x5e57cf['attributes']:_0x382eb8[_0x192b('0x41')];if(!_0x5529f7[_0x192b('0x43')][_0x192b('0x49')](_0x192b('0x4a'))){_0x5e57cf[_0x192b('0x33')]=qs[_0x192b('0x33')](_0x5529f7['query'][_0x192b('0x33')]);_0x5e57cf[_0x192b('0x4b')]=qs[_0x192b('0x4b')](_0x5529f7[_0x192b('0x43')]['offset']);}_0x5e57cf[_0x192b('0x4c')]=qs[_0x192b('0x4d')](_0x5529f7[_0x192b('0x43')]['sort']);_0x5e57cf['where']=qs['filters'](_['pick'](_0x5529f7[_0x192b('0x43')],_0x382eb8['filters']));if(_0x5529f7[_0x192b('0x43')]['filter']){_0x5e57cf[_0x192b('0x4e')]=_[_0x192b('0x4f')](_0x5e57cf[_0x192b('0x4e')],{'$or':_['map'](_0x3e19c1,function(_0x4fee80){if(_0x4fee80['type']!==_0x192b('0x50')){var _0x356a58={};_0x356a58[_0x4fee80[_0x192b('0x3b')]]={'$like':'%'+_0x5529f7[_0x192b('0x43')][_0x192b('0x51')]+'%'};return _0x356a58;}})});}_0x5e57cf=_[_0x192b('0x4f')]({},_0x5e57cf,_0x5529f7[_0x192b('0x52')]);var _0x52afe3={'where':_0x5e57cf[_0x192b('0x4e')]};return db[_0x192b('0x3e')][_0x192b('0x32')](_0x52afe3)['then'](function(_0x9f5a4a){_0x69ab43[_0x192b('0x32')]=_0x9f5a4a;if(_0x5529f7[_0x192b('0x43')][_0x192b('0x53')]){_0x5e57cf[_0x192b('0x54')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x192b('0x55')](_0x5e57cf);})[_0x192b('0x38')](function(_0x5e85b4){_0x69ab43[_0x192b('0x56')]=_0x5e85b4;return _0x69ab43;})['then'](respondWithFilteredResult(_0x14d781,_0x5e57cf))[_0x192b('0x57')](handleError(_0x14d781,null));};exports[_0x192b('0x58')]=function(_0xf22e85,_0x2ace73){var _0x7ec4c={'raw':!![],'where':{'id':_0xf22e85[_0x192b('0x59')]['id']}},_0x552e0c={};_0x552e0c[_0x192b('0x41')]=_[_0x192b('0x44')](db[_0x192b('0x3e')][_0x192b('0x5a')]);_0x552e0c[_0x192b('0x43')]=_[_0x192b('0x44')](_0xf22e85['query']);_0x552e0c[_0x192b('0x45')]=_[_0x192b('0x5b')](_0x552e0c[_0x192b('0x41')],_0x552e0c[_0x192b('0x43')]);_0x7ec4c['attributes']=_[_0x192b('0x5b')](_0x552e0c[_0x192b('0x41')],qs[_0x192b('0x46')](_0xf22e85[_0x192b('0x43')][_0x192b('0x46')]));_0x7ec4c[_0x192b('0x47')]=_0x7ec4c[_0x192b('0x47')]['length']?_0x7ec4c[_0x192b('0x47')]:_0x552e0c[_0x192b('0x41')];if(_0xf22e85[_0x192b('0x43')][_0x192b('0x53')]){_0x7ec4c[_0x192b('0x54')]=[{'all':!![]}];}_0x7ec4c=_[_0x192b('0x4f')]({},_0x7ec4c,_0xf22e85[_0x192b('0x52')]);return db['OpenchannelMessage'][_0x192b('0x5c')](_0x7ec4c)[_0x192b('0x38')](handleEntityNotFound(_0x2ace73,null))[_0x192b('0x38')](respondWithResult(_0x2ace73,null))[_0x192b('0x57')](handleError(_0x2ace73,null));};exports['create']=function(_0x4996af,_0x1dbcf4){return db['OpenchannelMessage'][_0x192b('0x5d')](_0x4996af[_0x192b('0x5e')],{})['then'](respondWithResult(_0x1dbcf4,0xc9))[_0x192b('0x57')](handleError(_0x1dbcf4,null));};exports[_0x192b('0x37')]=function(_0x4ea93b,_0xfd120e){if(_0x4ea93b[_0x192b('0x5e')]['id']){delete _0x4ea93b[_0x192b('0x5e')]['id'];}return db['OpenchannelMessage'][_0x192b('0x5c')]({'where':{'id':_0x4ea93b['params']['id']}})[_0x192b('0x38')](handleEntityNotFound(_0xfd120e,null))['then'](saveUpdates(_0x4ea93b[_0x192b('0x5e')],null))['then'](respondWithResult(_0xfd120e,null))[_0x192b('0x57')](handleError(_0xfd120e,null));};exports[_0x192b('0x39')]=function(_0x183c27,_0x953247){return db['OpenchannelMessage'][_0x192b('0x5c')]({'where':{'id':_0x183c27[_0x192b('0x59')]['id']}})[_0x192b('0x38')](handleEntityNotFound(_0x953247,null))['then'](removeEntity(_0x953247,null))[_0x192b('0x57')](handleError(_0x953247,null));};exports[_0x192b('0x5f')]=function(_0x57e81e,_0x23b922){return db[_0x192b('0x3e')][_0x192b('0x5f')]()[_0x192b('0x38')](respondWithResult(_0x23b922,null))[_0x192b('0x57')](handleError(_0x23b922,null));};var interaction_log=require(_0x192b('0x15'))(_0x192b('0x60'));exports[_0x192b('0x61')]=function(_0x3cf00d,_0x1c3a0a,_0x15be39){var _0x35613b={'channel':_0x192b('0x62')};if(_0x3cf00d['body']['id']){delete _0x3cf00d['body']['id'];}_0x3cf00d[_0x192b('0x5e')][_0x192b('0x63')]=!![];_0x3cf00d[_0x192b('0x5e')][_0x192b('0x64')]=moment()[_0x192b('0x65')](_0x192b('0x66'));_0x3cf00d[_0x192b('0x5e')][_0x192b('0x67')]=_0x3cf00d[_0x192b('0x5e')][_0x192b('0x67')]||_0x3cf00d[_0x192b('0x68')]['id'];return db['OpenchannelMessage'][_0x192b('0x5c')]({'where':{'id':_0x3cf00d['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x192b('0x69')}]})[_0x192b('0x38')](handleEntityNotFound(_0x1c3a0a,null))[_0x192b('0x38')](saveUpdates(_0x3cf00d[_0x192b('0x5e')],null))[_0x192b('0x38')](function(_0x408547){if(_0x408547){_0x35613b[_0x192b('0x2b')]=_0x408547[_0x192b('0x6a')]({'plain':!![]});return db[_0x192b('0x6b')]['find']({'where':{'id':_0x408547[_0x192b('0x6c')]}});}return null;})[_0x192b('0x38')](handleEntityNotFound(_0x1c3a0a,null))[_0x192b('0x38')](function(_0x55cc8a){if(_0x55cc8a){return _0x55cc8a[_0x192b('0x37')]({'UserId':_0x3cf00d[_0x192b('0x5e')]['UserId'],'read1stAt':_[_0x192b('0x6d')](_0x55cc8a['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x192b('0x38')](function(_0x86c5f3){if(_0x86c5f3){_0x35613b['interaction']=_0x86c5f3[_0x192b('0x6a')]({'plain':!![]});interaction_log[_0x192b('0x2c')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cf00d[_0x192b('0x68')]['id'],_0x3cf00d[_0x192b('0x68')][_0x192b('0x3b')],_0x3cf00d[_0x192b('0x68')][_0x192b('0x6e')],_0x35613b[_0x192b('0x6f')]['id'],_0x3cf00d[_0x192b('0x5e')]?JSON[_0x192b('0x70')](_0x3cf00d['body']):_0x192b('0x71'));return respondWithRpcPromise(_0x192b('0x72'),_0x192b('0x73'),_0x35613b);}return null;})[_0x192b('0x38')](function(_0xabd92b){if(_0xabd92b){if(_0x3cf00d[_0x192b('0x5e')][_0x192b('0x74')]){_0x35613b[_0x192b('0x2b')][_0x192b('0x75')]=util['format'](_0x192b('0x76'),_0x3cf00d[_0x192b('0x68')]['name']);_0x35613b[_0x192b('0x2b')]['channel']=_0x35613b[_0x192b('0x77')];_0x35613b[_0x192b('0x2b')][_0x192b('0x78')]=_0x192b('0x61');return respondWithRpcPromise('EventManager',_0x192b('0x79'),{'event':_0x192b('0x7a'),'message':_0x35613b['message']},client9002)[_0x192b('0x38')](function(){return _0x35613b;});}return _0x35613b;}return null;})[_0x192b('0x38')](respondWithResult(_0x1c3a0a,null))[_0x192b('0x57')](handleError(_0x1c3a0a,null));};var interaction_log=require(_0x192b('0x15'))(_0x192b('0x60'));exports[_0x192b('0x36')]=function(_0x4d9f89,_0x3b9f73,_0x27f257){var _0x4a814a={'agent':{},'channel':'openchannel'};if(_0x4d9f89['body']['id']){delete _0x4d9f89[_0x192b('0x5e')]['id'];}_0x4d9f89[_0x192b('0x5e')][_0x192b('0x67')]=_0x4d9f89[_0x192b('0x5e')][_0x192b('0x67')]||_0x4d9f89['user']['id'];_0x4a814a[_0x192b('0x7b')]['id']=_0x4d9f89['body'][_0x192b('0x67')];return db[_0x192b('0x3e')][_0x192b('0x5c')]({'where':{'id':_0x4d9f89[_0x192b('0x59')]['id'],'UserId':null}})[_0x192b('0x38')](handleEntityNotFound(_0x3b9f73,null))[_0x192b('0x38')](function(_0x4cf490){if(_0x4cf490){_0x4a814a[_0x192b('0x2b')]=_0x4cf490[_0x192b('0x6a')]({'plain':!![]});return db[_0x192b('0x6b')][_0x192b('0x5c')]({'where':{'id':_0x4cf490['OpenchannelInteractionId']}});}return null;})[_0x192b('0x38')](handleEntityNotFound(_0x3b9f73,null))[_0x192b('0x38')](function(_0x41960c){if(_0x41960c){_0x4a814a[_0x192b('0x6f')]=_0x41960c[_0x192b('0x6a')]({'plain':!![]});interaction_log['info'](_0x192b('0x7c'),_0x4d9f89[_0x192b('0x68')]['id'],_0x4d9f89[_0x192b('0x68')][_0x192b('0x3b')],_0x4d9f89[_0x192b('0x68')][_0x192b('0x6e')],_0x4a814a['interaction']['id'],_0x4d9f89[_0x192b('0x5e')]?JSON[_0x192b('0x70')](_0x4d9f89['body']):'null');return respondWithRpcPromise(_0x192b('0x7d'),_0x192b('0x7e'),_0x4a814a);}return null;})[_0x192b('0x38')](function(_0x2f380f){if(_0x2f380f){_0x2f380f[_0x192b('0x2b')][_0x192b('0x75')]=util[_0x192b('0x65')](_0x192b('0x76'),_0x4d9f89['user'][_0x192b('0x3b')]);_0x2f380f[_0x192b('0x2b')][_0x192b('0x77')]=_0x4a814a[_0x192b('0x77')];_0x2f380f[_0x192b('0x2b')]['event']='reject';respondWithRpcPromise('EventManager',_0x192b('0x79'),{'event':_0x192b('0x7f'),'message':_0x2f380f[_0x192b('0x2b')]},client9002);return _0x4a814a;}return null;})[_0x192b('0x38')](respondWithResult(_0x3b9f73,null))[_0x192b('0x57')](handleError(_0x3b9f73,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index fc5ce42..a60b4da 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcd7=['hook','exports','setMaxListeners','emit','hasOwnProperty'];(function(_0x56e953,_0xb299b9){var _0x2f722a=function(_0x4aa39e){while(--_0x4aa39e){_0x56e953['push'](_0x56e953['shift']());}};_0x2f722a(++_0xb299b9);}(_0xdcd7,0x12e));var _0x7dcd=function(_0x49ca95,_0x50c62b){_0x49ca95=_0x49ca95-0x0;var _0x4699f9=_0xdcd7[_0x49ca95];return _0x4699f9;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7dcd('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1af470){return function(_0x544a5e,_0x30c623,_0x126a02){OpenchannelMessageEvents[_0x7dcd('0x1')](_0x1af470+':'+_0x544a5e['id'],_0x544a5e);OpenchannelMessageEvents[_0x7dcd('0x1')](_0x1af470,_0x544a5e);_0x126a02(null);};}for(var e in events){if(events[_0x7dcd('0x2')](e)){var event=events[e];OpenchannelMessage[_0x7dcd('0x3')](e,emitEvent(event));}}module[_0x7dcd('0x4')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0706=['save','update','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x0706,0xfd));var _0x6070=function(_0x3f8a92,_0x1dfe4a){_0x3f8a92=_0x3f8a92-0x0;var _0x10882c=_0x0706[_0x3f8a92];return _0x10882c;};'use strict';var EventEmitter=require(_0x6070('0x0'));var OpenchannelMessage=require(_0x6070('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6070('0x2')](0x0);var events={'afterCreate':_0x6070('0x3'),'afterUpdate':_0x6070('0x4'),'afterDestroy':'remove'};function emitEvent(_0x23f7b5){return function(_0xebd446,_0x1a8b5c,_0x272898){OpenchannelMessageEvents['emit'](_0x23f7b5+':'+_0xebd446['id'],_0xebd446);OpenchannelMessageEvents['emit'](_0x23f7b5,_0xebd446);_0x272898(null);};}for(var e in events){if(events[_0x6070('0x5')](e)){var event=events[e];OpenchannelMessage[_0x6070('0x6')](e,emitEvent(event));}}module[_0x6070('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index d1affdf..17fb0c4 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4390=['afterCreate','format','replyUri','length','POST','method','OpenchannelMessage,\x20%s,\x20%s','threadId','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info'];(function(_0x68a9d4,_0x4dcea0){var _0x1ab9d9=function(_0x14436f){while(--_0x14436f){_0x68a9d4['push'](_0x68a9d4['shift']());}};_0x1ab9d9(++_0x4dcea0);}(_0x4390,0xc1));var _0x0439=function(_0x410d41,_0x5ec624){_0x410d41=_0x410d41-0x0;var _0x5c7144=_0x4390[_0x410d41];return _0x5c7144;};'use strict';var _=require(_0x0439('0x0'));var util=require(_0x0439('0x1'));var logger=require(_0x0439('0x2'))(_0x0439('0x3'));var moment=require(_0x0439('0x4'));var BPromise=require(_0x0439('0x5'));var rp=require(_0x0439('0x6'));var fs=require('fs');var path=require(_0x0439('0x7'));var rimraf=require(_0x0439('0x8'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0x0439('0x9')]=function(_0x1f8cc5,_0x3a9583){return _0x1f8cc5[_0x0439('0xa')](_0x0439('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x0439('0xc'),'fields':[_0x0439('0xd')],'type':_0x0439('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b3b7b,_0x2d4e0c,_0x582023){var _0xe27410=_0x1f8cc5[_0x0439('0xf')];var _0xb7f424=_0x1b3b7b[_0x0439('0x10')]({'plain':!![]});if(_0xb7f424[_0x0439('0x11')][_0x0439('0x12')]()==='in'||_0xb7f424[_0x0439('0x11')][_0x0439('0x12')]()===_0x0439('0x13')&&!_0xb7f424['secret']&&!_['isNil'](_0xb7f424[_0x0439('0x14')])){_0xe27410[_0x0439('0x15')]['findOne']({'where':{'id':_0xb7f424[_0x0439('0x16')]}})[_0x0439('0x17')](function(_0xaacadf){if(_0xaacadf){_0xaacadf[_0x0439('0x18')]({'lastMsgAt':_0xb7f424[_0x0439('0x19')],'lastMsgDirection':_0xb7f424[_0x0439('0x11')][_0x0439('0x12')]()});}})[_0x0439('0x1a')](function(_0x542943){console[_0x0439('0x1b')](_0x542943);});}if(_0xb7f424[_0x0439('0x11')]===_0x0439('0x13')&&!_0xb7f424['secret']){var _0x58a60d;_0xe27410[_0x0439('0x1c')][_0x0439('0x1d')]()['then'](function(_0x12a8a3){return _0xe27410[_0x0439('0x1e')][_0x0439('0x1f')]({'where':{'id':_0xb7f424[_0x0439('0x20')]},'include':[{'model':_0xe27410['OpenchannelInteraction'],'as':_0x0439('0x21'),'where':{'id':_0xb7f424[_0x0439('0x16')]},'limit':0x1,'include':[{'model':_0xe27410[_0x0439('0x1c')],'as':_0x0439('0x22'),'attributes':_[_0x0439('0x23')](_0x12a8a3)}]}]});})['then'](function(_0x46988f){_0x58a60d=_0x46988f[_0x0439('0x10')]({'plain':!![]});if(_0x58a60d&&_0x58a60d['replyUri']){logger[_0x0439('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x0439('0x25'),util[_0x0439('0x26')]('Forwarding\x20message\x20%d\x20to\x20%s',_0xb7f424['id'],_0x58a60d[_0x0439('0x27')]));if(_0x58a60d[_0x0439('0x21')]&&_0x58a60d[_0x0439('0x21')][_0x0439('0x28')]){_0xb7f424['Interaction']=_['omit'](_0x58a60d['Interactions'][0x0],'Contact');_0xb7f424['Contact']=_0x58a60d[_0x0439('0x21')][0x0][_0x0439('0x22')];}var _0x2d4e0c={'method':_0x0439('0x29'),'uri':encodeURI(_0x58a60d[_0x0439('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2d4e0c[_0x0439('0x2a')]){case'GET':_0x2d4e0c['qs']=_0xb7f424;break;case _0x0439('0x29'):_0x2d4e0c[_0x0439('0xd')]=_0xb7f424;break;}return rp(_0x2d4e0c)[_0x0439('0x17')](function(_0x11d730){logger[_0x0439('0x24')](_0x0439('0x2b'),'afterCreate',util[_0x0439('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0xb7f424['id'],_0x58a60d[_0x0439('0x27')]));if(_0x11d730[_0x0439('0xd')][_0x0439('0x2c')]&&_0x11d730[_0x0439('0xd')][_0x0439('0x2c')]!=_0xb7f424['Interaction'][_0x0439('0x2c')]){return _0xe27410['OpenchannelInteraction'][_0x0439('0x18')]({'threadId':_0x11d730[_0x0439('0xd')][_0x0439('0x2c')]},{'logging':!![],'where':{'id':_0xb7f424['Interaction']['id']}});}else{return;}})[_0x0439('0x17')](function(){return _0x1b3b7b[_0x0439('0x18')]({'read':!![]});})[_0x0439('0x1a')](function(_0x40db05){logger[_0x0439('0x1b')](_0x0439('0x2b'),_0x0439('0x25'),util['inspect'](_0x40db05,{'showHidden':![],'depth':null}));_0x582023();});}else{_0x582023();}})['finally'](function(){_0x582023();});}else{_0x582023();}}},'charset':_0x0439('0x2d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4f18=['out','isNil','UserId','findOne','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','method','GET','POST','threadId','Interaction','update','finally','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','./openchannelMessage.attributes','exports','define','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x1465c1,_0xa8fd77){var _0x104621=function(_0x2bd254){while(--_0x2bd254){_0x1465c1['push'](_0x1465c1['shift']());}};_0x104621(++_0xa8fd77);}(_0x4f18,0xa9));var _0x84f1=function(_0x5db2a6,_0x396bae){_0x5db2a6=_0x5db2a6-0x0;var _0x325e7f=_0x4f18[_0x5db2a6];return _0x325e7f;};'use strict';var _=require('lodash');var util=require(_0x84f1('0x0'));var logger=require(_0x84f1('0x1'))(_0x84f1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x84f1('0x3'));var fs=require('fs');var path=require(_0x84f1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x84f1('0x5'));module[_0x84f1('0x6')]=function(_0x363227,_0x471a60){return _0x363227[_0x84f1('0x7')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x84f1('0x8'),'fields':[_0x84f1('0x9')],'type':_0x84f1('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x266587,_0x21f3eb,_0xef0dba){var _0x1738f3=_0x363227[_0x84f1('0xb')];var _0x1f07b1=_0x266587[_0x84f1('0xc')]({'plain':!![]});if(_0x1f07b1[_0x84f1('0xd')]['toLowerCase']()==='in'||_0x1f07b1[_0x84f1('0xd')][_0x84f1('0xe')]()===_0x84f1('0xf')&&!_0x1f07b1['secret']&&!_[_0x84f1('0x10')](_0x1f07b1[_0x84f1('0x11')])){_0x1738f3['OpenchannelInteraction'][_0x84f1('0x12')]({'where':{'id':_0x1f07b1[_0x84f1('0x13')]}})[_0x84f1('0x14')](function(_0x1933a4){if(_0x1933a4){_0x1933a4['update']({'lastMsgAt':_0x1f07b1[_0x84f1('0x15')],'lastMsgDirection':_0x1f07b1[_0x84f1('0xd')][_0x84f1('0xe')]()});}})[_0x84f1('0x16')](function(_0x2e94df){console[_0x84f1('0x17')](_0x2e94df);});}if(_0x1f07b1[_0x84f1('0xd')]===_0x84f1('0xf')&&!_0x1f07b1['secret']){var _0x394c1b;_0x1738f3[_0x84f1('0x18')]['describe']()[_0x84f1('0x14')](function(_0x53fa3c){return _0x1738f3[_0x84f1('0x19')][_0x84f1('0x1a')]({'where':{'id':_0x1f07b1[_0x84f1('0x1b')]},'include':[{'model':_0x1738f3[_0x84f1('0x1c')],'as':_0x84f1('0x1d'),'where':{'id':_0x1f07b1[_0x84f1('0x13')]},'limit':0x1,'include':[{'model':_0x1738f3[_0x84f1('0x18')],'as':_0x84f1('0x1e'),'attributes':_[_0x84f1('0x1f')](_0x53fa3c)}]}]});})['then'](function(_0x5608ab){_0x394c1b=_0x5608ab[_0x84f1('0xc')]({'plain':!![]});if(_0x394c1b&&_0x394c1b['replyUri']){logger[_0x84f1('0x20')](_0x84f1('0x21'),_0x84f1('0x22'),util[_0x84f1('0x23')](_0x84f1('0x24'),_0x1f07b1['id'],_0x394c1b[_0x84f1('0x25')]));if(_0x394c1b[_0x84f1('0x1d')]&&_0x394c1b['Interactions']['length']){_0x1f07b1['Interaction']=_['omit'](_0x394c1b[_0x84f1('0x1d')][0x0],_0x84f1('0x1e'));_0x1f07b1[_0x84f1('0x1e')]=_0x394c1b[_0x84f1('0x1d')][0x0][_0x84f1('0x1e')];}var _0x21f3eb={'method':'POST','uri':encodeURI(_0x394c1b['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x21f3eb[_0x84f1('0x26')]){case _0x84f1('0x27'):_0x21f3eb['qs']=_0x1f07b1;break;case _0x84f1('0x28'):_0x21f3eb['body']=_0x1f07b1;break;}return rp(_0x21f3eb)[_0x84f1('0x14')](function(_0x4a64ba){logger['info'](_0x84f1('0x21'),_0x84f1('0x22'),util[_0x84f1('0x23')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1f07b1['id'],_0x394c1b[_0x84f1('0x25')]));if(_0x4a64ba[_0x84f1('0x9')]['threadId']&&_0x4a64ba[_0x84f1('0x9')][_0x84f1('0x29')]!=_0x1f07b1[_0x84f1('0x2a')][_0x84f1('0x29')]){return _0x1738f3['OpenchannelInteraction'][_0x84f1('0x2b')]({'threadId':_0x4a64ba[_0x84f1('0x9')][_0x84f1('0x29')]},{'logging':!![],'where':{'id':_0x1f07b1[_0x84f1('0x2a')]['id']}});}else{return;}})[_0x84f1('0x14')](function(){return _0x266587[_0x84f1('0x2b')]({'read':!![]});})[_0x84f1('0x16')](function(_0x1543b7){logger[_0x84f1('0x17')](_0x84f1('0x21'),_0x84f1('0x22'),util['inspect'](_0x1543b7,{'showHidden':![],'depth':null}));_0xef0dba();});}else{_0xef0dba();}})[_0x84f1('0x2c')](function(){_0xef0dba();});}else{_0xef0dba();}}},'charset':'utf8mb4','collate':_0x84f1('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index a69d079..7d04fce 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74af=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateOpenchannelMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x74af,0x178));var _0xf74a=function(_0x3315be,_0x296105){_0x3315be=_0x3315be-0x0;var _0x26b529=_0x74af[_0x3315be];return _0x26b529;};'use strict';var _=require(_0xf74a('0x0'));var util=require(_0xf74a('0x1'));var moment=require(_0xf74a('0x2'));var BPromise=require(_0xf74a('0x3'));var rs=require(_0xf74a('0x4'));var fs=require('fs');var Redis=require(_0xf74a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf74a('0x6'));var logger=require(_0xf74a('0x7'))(_0xf74a('0x8'));var config=require(_0xf74a('0x9'));var jayson=require(_0xf74a('0xa'));var client=jayson[_0xf74a('0xb')][_0xf74a('0xc')]({'port':0x232a});config['redis']=_[_0xf74a('0xd')](config[_0xf74a('0xe')],{'host':_0xf74a('0xf'),'port':0x18eb});var socket=require(_0xf74a('0x10'))(new Redis(config[_0xf74a('0xe')]));require(_0xf74a('0x11'))[_0xf74a('0x12')](socket);function respondWithRpcPromise(_0x78bbd9,_0x206db9,_0x15c591){return new BPromise(function(_0xd6896f,_0xd79080){return client[_0xf74a('0x13')](_0x78bbd9,_0x15c591)[_0xf74a('0x14')](function(_0x15f94b){logger['info'](_0xf74a('0x15'),_0x206db9,'request\x20sent');logger[_0xf74a('0x16')](_0xf74a('0x17'),_0x206db9,_0xf74a('0x18'),JSON[_0xf74a('0x19')](_0x15f94b));if(_0x15f94b[_0xf74a('0x1a')]){if(_0x15f94b[_0xf74a('0x1a')]['code']===0x1f4){logger[_0xf74a('0x1a')]('OpenchannelMessage,\x20%s,\x20%s',_0x206db9,_0x15f94b[_0xf74a('0x1a')][_0xf74a('0x1b')]);return _0xd79080(_0x15f94b['error'][_0xf74a('0x1b')]);}logger[_0xf74a('0x1a')](_0xf74a('0x15'),_0x206db9,_0x15f94b[_0xf74a('0x1a')]['message']);return _0xd6896f(_0x15f94b[_0xf74a('0x1a')]['message']);}else{logger['info'](_0xf74a('0x15'),_0x206db9,_0xf74a('0x18'));_0xd6896f(_0x15f94b[_0xf74a('0x1c')]['message']);}})['catch'](function(_0x56f11a){logger[_0xf74a('0x1a')](_0xf74a('0x15'),_0x206db9,_0x56f11a);_0xd79080(_0x56f11a);});});}exports[_0xf74a('0x1d')]=function(_0x21ee4b){var _0x47be71=this;return new Promise(function(_0x5759a4,_0x417d83){return db['OpenchannelMessage'][_0xf74a('0x1e')](_0x21ee4b[_0xf74a('0x1f')],{'raw':_0x21ee4b[_0xf74a('0x20')]?_0x21ee4b[_0xf74a('0x20')][_0xf74a('0x21')]===undefined?!![]:![]:!![]})[_0xf74a('0x14')](function(_0x32c37c){logger['info'](_0xf74a('0x1d'),_0x21ee4b);logger['debug'](_0xf74a('0x1d'),_0x21ee4b,JSON[_0xf74a('0x19')](_0x32c37c));_0x5759a4(_0x32c37c);})[_0xf74a('0x22')](function(_0x28ca54){logger[_0xf74a('0x1a')](_0xf74a('0x1d'),_0x28ca54['message'],_0x21ee4b);_0x417d83(_0x47be71[_0xf74a('0x1a')](0x1f4,_0x28ca54[_0xf74a('0x1b')]));});});}; \ No newline at end of file +var _0x7af9=['../../config/logger','rpc','http','redis','defaults','socket.io-emitter','./openchannelMessage.socket','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','OpenchannelMessage','body','options','raw','CreateOpenchannelMessage','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x53ec44,_0x279f19){var _0x16dcaf=function(_0x29021c){while(--_0x29021c){_0x53ec44['push'](_0x53ec44['shift']());}};_0x16dcaf(++_0x279f19);}(_0x7af9,0x95));var _0x97af=function(_0x1c6b1a,_0x458388){_0x1c6b1a=_0x1c6b1a-0x0;var _0x5534c7=_0x7af9[_0x1c6b1a];return _0x5534c7;};'use strict';var _=require(_0x97af('0x0'));var util=require('util');var moment=require(_0x97af('0x1'));var BPromise=require(_0x97af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97af('0x3'));var db=require(_0x97af('0x4'))['db'];var utils=require(_0x97af('0x5'));var logger=require(_0x97af('0x6'))(_0x97af('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x97af('0x8')]({'port':0x232a});config[_0x97af('0x9')]=_[_0x97af('0xa')](config[_0x97af('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x97af('0xb'))(new Redis(config[_0x97af('0x9')]));require(_0x97af('0xc'))['register'](socket);function respondWithRpcPromise(_0x175bbc,_0x5cd1e0,_0x46ac08){return new BPromise(function(_0x19ad23,_0x18a9e5){return client[_0x97af('0xd')](_0x175bbc,_0x46ac08)[_0x97af('0xe')](function(_0x3cc156){logger[_0x97af('0xf')](_0x97af('0x10'),_0x5cd1e0,_0x97af('0x11'));logger[_0x97af('0x12')](_0x97af('0x13'),_0x5cd1e0,'request\x20sent',JSON[_0x97af('0x14')](_0x3cc156));if(_0x3cc156['error']){if(_0x3cc156['error'][_0x97af('0x15')]===0x1f4){logger[_0x97af('0x16')](_0x97af('0x10'),_0x5cd1e0,_0x3cc156[_0x97af('0x16')][_0x97af('0x17')]);return _0x18a9e5(_0x3cc156[_0x97af('0x16')][_0x97af('0x17')]);}logger['error'](_0x97af('0x10'),_0x5cd1e0,_0x3cc156['error'][_0x97af('0x17')]);return _0x19ad23(_0x3cc156['error'][_0x97af('0x17')]);}else{logger['info'](_0x97af('0x10'),_0x5cd1e0,_0x97af('0x11'));_0x19ad23(_0x3cc156[_0x97af('0x18')][_0x97af('0x17')]);}})[_0x97af('0x19')](function(_0x5ad2bc){logger[_0x97af('0x16')](_0x97af('0x10'),_0x5cd1e0,_0x5ad2bc);_0x18a9e5(_0x5ad2bc);});});}exports['CreateOpenchannelMessage']=function(_0x519297){var _0x454140=this;return new Promise(function(_0x3447ce,_0x5dcd87){return db[_0x97af('0x1a')]['create'](_0x519297[_0x97af('0x1b')],{'raw':_0x519297[_0x97af('0x1c')]?_0x519297[_0x97af('0x1c')][_0x97af('0x1d')]===undefined?!![]:![]:!![]})[_0x97af('0xe')](function(_0x53323a){logger[_0x97af('0xf')](_0x97af('0x1e'),_0x519297);logger[_0x97af('0x12')](_0x97af('0x1e'),_0x519297,JSON[_0x97af('0x14')](_0x53323a));_0x3447ce(_0x53323a);})[_0x97af('0x19')](function(_0x275e8c){logger[_0x97af('0x16')]('CreateOpenchannelMessage',_0x275e8c[_0x97af('0x17')],_0x519297);_0x5dcd87(_0x454140[_0x97af('0x16')](0x1f4,_0x275e8c[_0x97af('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 0efece8..ba0d718 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var OpenchannelMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xe706=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0xe706,0xa3));var _0x6e70=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0xe706[_0x4c2dfc];return _0xfd728d;};'use strict';var OpenchannelMessageEvents=require(_0x6e70('0x0'));var events=[_0x6e70('0x1'),_0x6e70('0x2'),'update'];function createListener(_0x2cae77,_0x315629){return function(_0x2ca810){_0x315629[_0x6e70('0x3')](_0x2cae77,_0x2ca810);};}function removeListener(_0x142c27,_0x2164a4){return function(){OpenchannelMessageEvents[_0x6e70('0x4')](_0x142c27,_0x2164a4);};}exports[_0x6e70('0x5')]=function(_0x1b0389){for(var _0x4381d1=0x0,_0x36357b=events[_0x6e70('0x6')];_0x4381d1<_0x36357b;_0x4381d1++){var _0x45a2d4=events[_0x4381d1];var _0x188ed3=createListener(_0x6e70('0x7')+_0x45a2d4,_0x1b0389);OpenchannelMessageEvents['on'](_0x45a2d4,_0x188ed3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 69c75ec..4888ced 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34f2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','/:id','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router'];(function(_0x5d3ddf,_0x4c2faa){var _0x54dfd7=function(_0x37621d){while(--_0x37621d){_0x5d3ddf['push'](_0x5d3ddf['shift']());}};_0x54dfd7(++_0x4c2faa);}(_0x34f2,0x15a));var _0x234f=function(_0x33dc80,_0x484cd3){_0x33dc80=_0x33dc80-0x0;var _0x3019a1=_0x34f2[_0x33dc80];return _0x3019a1;};'use strict';var multer=require(_0x234f('0x0'));var util=require(_0x234f('0x1'));var path=require('path');var timeout=require(_0x234f('0x2'));var express=require(_0x234f('0x3'));var router=express[_0x234f('0x4')]();var auth=require(_0x234f('0x5'));var interaction=require(_0x234f('0x6'));var config=require(_0x234f('0x7'));var controller=require(_0x234f('0x8'));router[_0x234f('0x9')]('/',auth[_0x234f('0xa')](),controller[_0x234f('0xb')]);router[_0x234f('0x9')](_0x234f('0xc'),auth[_0x234f('0xa')](),controller[_0x234f('0xd')]);router[_0x234f('0x9')]('/:id',auth[_0x234f('0xa')](),controller[_0x234f('0xe')]);router['get']('/:id/members',auth[_0x234f('0xa')](),controller[_0x234f('0xf')]);router[_0x234f('0x9')](_0x234f('0x10'),auth[_0x234f('0xa')](),controller['getTeams']);router[_0x234f('0x9')](_0x234f('0x11'),auth[_0x234f('0xa')](),controller[_0x234f('0x12')]);router['post']('/',auth[_0x234f('0xa')](),controller['create']);router[_0x234f('0x13')](_0x234f('0x10'),auth[_0x234f('0xa')](),controller[_0x234f('0x14')]);router[_0x234f('0x13')](_0x234f('0x11'),auth[_0x234f('0xa')](),controller['addAgents']);router['put'](_0x234f('0x15'),auth[_0x234f('0xa')](),controller['update']);router[_0x234f('0x16')](_0x234f('0x15'),auth[_0x234f('0xa')](),controller[_0x234f('0x17')]);router[_0x234f('0x16')](_0x234f('0x10'),auth[_0x234f('0xa')](),controller[_0x234f('0x18')]);router[_0x234f('0x16')]('/:id/users',auth[_0x234f('0xa')](),controller[_0x234f('0x19')]);module[_0x234f('0x1a')]=router; \ No newline at end of file +var _0x28b1=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x28b1,0x1d6));var _0x128b=function(_0x2327a1,_0x40d43d){_0x2327a1=_0x2327a1-0x0;var _0x186a61=_0x28b1[_0x2327a1];return _0x186a61;};'use strict';var multer=require(_0x128b('0x0'));var util=require(_0x128b('0x1'));var path=require(_0x128b('0x2'));var timeout=require('connect-timeout');var express=require(_0x128b('0x3'));var router=express[_0x128b('0x4')]();var auth=require(_0x128b('0x5'));var interaction=require(_0x128b('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x128b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x128b('0x7')]('/describe',auth[_0x128b('0x8')](),controller[_0x128b('0x9')]);router[_0x128b('0x7')](_0x128b('0xa'),auth[_0x128b('0x8')](),controller[_0x128b('0xb')]);router['get']('/:id/members',auth[_0x128b('0x8')](),controller['getMembers']);router['get'](_0x128b('0xc'),auth[_0x128b('0x8')](),controller[_0x128b('0xd')]);router[_0x128b('0x7')](_0x128b('0xe'),auth['isAuthenticated'](),controller[_0x128b('0xf')]);router['post']('/',auth[_0x128b('0x8')](),controller[_0x128b('0x10')]);router[_0x128b('0x11')](_0x128b('0xc'),auth[_0x128b('0x8')](),controller[_0x128b('0x12')]);router[_0x128b('0x11')](_0x128b('0xe'),auth[_0x128b('0x8')](),controller[_0x128b('0x13')]);router[_0x128b('0x14')](_0x128b('0xa'),auth[_0x128b('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x128b('0x15')](_0x128b('0xc'),auth[_0x128b('0x8')](),controller[_0x128b('0x16')]);router[_0x128b('0x15')]('/:id/users',auth[_0x128b('0x8')](),controller[_0x128b('0x17')]);module[_0x128b('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 22ca211..07bd06e 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f2b=['ENUM','beepall','sequelize','exports','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f2b,0x1be));var _0xb3f2=function(_0x3b995c,_0x287043){_0x3b995c=_0x3b995c-0x0;var _0xccb854=_0x3f2b[_0x3b995c];return _0xccb854;};'use strict';var Sequelize=require(_0xb3f2('0x0'));module[_0xb3f2('0x1')]={'name':{'type':Sequelize[_0xb3f2('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb3f2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb3f2('0x4')]('rrmemory',_0xb3f2('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x2bb6=['beepall','roundrobin','STRING','INTEGER','ENUM','rrmemory'];(function(_0x576fe1,_0x3e025d){var _0x3410be=function(_0x285f71){while(--_0x285f71){_0x576fe1['push'](_0x576fe1['shift']());}};_0x3410be(++_0x3e025d);}(_0x2bb6,0x146));var _0x62bb=function(_0x1e6c85,_0x59c747){_0x1e6c85=_0x1e6c85-0x0;var _0x16ec9b=_0x2bb6[_0x1e6c85];return _0x16ec9b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x62bb('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x62bb('0x0')]},'timeout':{'type':Sequelize[_0x62bb('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x62bb('0x2')](_0x62bb('0x3'),_0x62bb('0x4'),_0x62bb('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index ca8e7a8..3fb6333 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ba8=['index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','OpenchannelQueue','then','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','get','UserOpenchannelQueue','order','OpenchannelQueueId','merge','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','Team','addTeams','Agents','online','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','OpenchannelQueues','UserProfileResource','end','error','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ba8,0xe2));var _0x87ba=function(_0x13e500,_0x6e4350){_0x13e500=_0x13e500-0x0;var _0x5d85da=_0x7ba8[_0x13e500];return _0x5d85da;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x87ba('0x0'));var zipdir=require(_0x87ba('0x1'));var jsonpatch=require(_0x87ba('0x2'));var rp=require(_0x87ba('0x3'));var moment=require(_0x87ba('0x4'));var BPromise=require(_0x87ba('0x5'));var Mustache=require(_0x87ba('0x6'));var util=require('util');var path=require('path');var sox=require(_0x87ba('0x7'));var csv=require(_0x87ba('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x87ba('0x9'));var squel=require(_0x87ba('0xa'));var crypto=require('crypto');var jsforce=require(_0x87ba('0xb'));var deskjs=require(_0x87ba('0xc'));var toCsv=require('to-csv');var querystring=require(_0x87ba('0xd'));var Papa=require(_0x87ba('0xe'));var Redis=require(_0x87ba('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x87ba('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87ba('0x11'));var logger=require('../../config/logger')(_0x87ba('0x12'));var utils=require(_0x87ba('0x13'));var config=require(_0x87ba('0x14'));var db=require(_0x87ba('0x15'))['db'];config[_0x87ba('0x16')]=_[_0x87ba('0x17')](config[_0x87ba('0x16')],{'host':_0x87ba('0x18'),'port':0x18eb});var socket=require(_0x87ba('0x19'))(new Redis(config[_0x87ba('0x16')]));require(_0x87ba('0x1a'))[_0x87ba('0x1b')](socket);function respondWithStatusCode(_0x21fe5b,_0x132442){_0x132442=_0x132442||0xcc;return function(_0xa94bf0){if(_0xa94bf0){return _0x21fe5b[_0x87ba('0x1c')](_0x132442);}return _0x21fe5b[_0x87ba('0x1d')](_0x132442)['end']();};}function respondWithResult(_0xbaa75e,_0x59a341){_0x59a341=_0x59a341||0xc8;return function(_0x13d530){if(_0x13d530){return _0xbaa75e[_0x87ba('0x1d')](_0x59a341)[_0x87ba('0x1e')](_0x13d530);}};}function respondWithFilteredResult(_0x19ecf2,_0x4b41c7){return function(_0x596494){if(_0x596494){var _0x3bbcc5=_0x596494[_0x87ba('0x1f')],_0x3f644f=_0x4b41c7['offset'],_0x580538=_0x4b41c7[_0x87ba('0x20')]+_0x4b41c7[_0x87ba('0x21')],_0x55228c;if(_0x580538>=_0x3bbcc5){_0x580538=_0x3bbcc5;_0x55228c=0xc8;}else{_0x55228c=0xce;}_0x19ecf2['status'](_0x55228c);return _0x19ecf2[_0x87ba('0x22')]('Content-Range',_0x3f644f+'-'+_0x580538+'/'+_0x3bbcc5)[_0x87ba('0x1e')](_0x596494);}return null;};}function patchUpdates(_0x3ca167){return function(_0x4e272d){try{jsonpatch[_0x87ba('0x23')](_0x4e272d,_0x3ca167,!![]);}catch(_0x8d19a6){return BPromise[_0x87ba('0x24')](_0x8d19a6);}return _0x4e272d[_0x87ba('0x25')]();};}function saveUpdates(_0x3ffb55,_0x249741){return function(_0x151844){if(_0x151844){return _0x151844[_0x87ba('0x26')](_0x3ffb55)['then'](function(_0x5a3cef){return _0x5a3cef;});}return null;};}function removeEntity(_0xc982b3,_0x5efd3e){return function(_0x4f7f5c){if(_0x4f7f5c){return _0x4f7f5c[_0x87ba('0x27')]()['then'](function(){var _0x4d890a=_0x4f7f5c['get']({'plain':!![]});var _0x183a5e=_0x87ba('0x28');return db[_0x87ba('0x29')][_0x87ba('0x27')]({'where':{'type':_0x183a5e,'resourceId':_0x4d890a['id']}})['then'](function(){return _0x4f7f5c;});})['then'](function(){_0xc982b3[_0x87ba('0x1d')](0xcc)[_0x87ba('0x2a')]();});}};}function handleEntityNotFound(_0x460dc6,_0x56850a){return function(_0x45dc2c){if(!_0x45dc2c){_0x460dc6[_0x87ba('0x1c')](0x194);}return _0x45dc2c;};}function handleError(_0x559706,_0x674edb){_0x674edb=_0x674edb||0x1f4;return function(_0x3d0a0d){logger[_0x87ba('0x2b')](_0x3d0a0d['stack']);if(_0x3d0a0d[_0x87ba('0x2c')]){delete _0x3d0a0d[_0x87ba('0x2c')];}_0x559706[_0x87ba('0x1d')](_0x674edb)[_0x87ba('0x2d')](_0x3d0a0d);};}exports[_0x87ba('0x2e')]=function(_0x4ca7a5,_0x3985ec){var _0x45466a={},_0x3d5af3={},_0x44ea4c={'count':0x0,'rows':[]};var _0x260f23=_[_0x87ba('0x2f')](db['OpenchannelQueue'][_0x87ba('0x30')],function(_0x4d31a2){return{'name':_0x4d31a2[_0x87ba('0x31')],'type':_0x4d31a2['type']['key']};});_0x3d5af3[_0x87ba('0x32')]=_['map'](_0x260f23,_0x87ba('0x2c'));_0x3d5af3[_0x87ba('0x33')]=_[_0x87ba('0x34')](_0x4ca7a5[_0x87ba('0x33')]);_0x3d5af3[_0x87ba('0x35')]=_['intersection'](_0x3d5af3[_0x87ba('0x32')],_0x3d5af3[_0x87ba('0x33')]);_0x45466a[_0x87ba('0x36')]=_[_0x87ba('0x37')](_0x3d5af3['model'],qs[_0x87ba('0x38')](_0x4ca7a5[_0x87ba('0x33')][_0x87ba('0x38')]));_0x45466a[_0x87ba('0x36')]=_0x45466a['attributes'][_0x87ba('0x39')]?_0x45466a[_0x87ba('0x36')]:_0x3d5af3[_0x87ba('0x32')];if(!_0x4ca7a5[_0x87ba('0x33')][_0x87ba('0x3a')](_0x87ba('0x3b'))){_0x45466a[_0x87ba('0x21')]=qs[_0x87ba('0x21')](_0x4ca7a5['query']['limit']);_0x45466a[_0x87ba('0x20')]=qs[_0x87ba('0x20')](_0x4ca7a5[_0x87ba('0x33')][_0x87ba('0x20')]);}_0x45466a['order']=qs[_0x87ba('0x3c')](_0x4ca7a5[_0x87ba('0x33')][_0x87ba('0x3c')]);_0x45466a[_0x87ba('0x3d')]=qs[_0x87ba('0x35')](_[_0x87ba('0x3e')](_0x4ca7a5['query'],_0x3d5af3[_0x87ba('0x35')]));if(_0x4ca7a5[_0x87ba('0x33')]['filter']){_0x45466a[_0x87ba('0x3d')]=_['merge'](_0x45466a[_0x87ba('0x3d')],{'$or':_[_0x87ba('0x2f')](_0x260f23,function(_0x6c1422){if(_0x6c1422['type']!=='VIRTUAL'){var _0x522040={};_0x522040[_0x6c1422[_0x87ba('0x2c')]]={'$like':'%'+_0x4ca7a5[_0x87ba('0x33')][_0x87ba('0x3f')]+'%'};return _0x522040;}})});}_0x45466a=_['merge']({},_0x45466a,_0x4ca7a5[_0x87ba('0x40')]);var _0x484979={'where':_0x45466a[_0x87ba('0x3d')]};return db[_0x87ba('0x41')]['count'](_0x484979)[_0x87ba('0x42')](function(_0x1e88ee){_0x44ea4c[_0x87ba('0x1f')]=_0x1e88ee;if(_0x4ca7a5[_0x87ba('0x33')][_0x87ba('0x43')]){_0x45466a[_0x87ba('0x44')]=[{'all':!![]}];}return db[_0x87ba('0x41')][_0x87ba('0x45')](_0x45466a);})[_0x87ba('0x42')](function(_0x52cd14){_0x44ea4c[_0x87ba('0x46')]=_0x52cd14;return _0x44ea4c;})[_0x87ba('0x42')](respondWithFilteredResult(_0x3985ec,_0x45466a))[_0x87ba('0x47')](handleError(_0x3985ec,null));};exports['show']=function(_0x502cb0,_0x329096){var _0x5a13b9={'raw':!![],'where':{'id':_0x502cb0['params']['id']}},_0x27f74a={};_0x27f74a[_0x87ba('0x32')]=_[_0x87ba('0x34')](db['OpenchannelQueue']['rawAttributes']);_0x27f74a[_0x87ba('0x33')]=_[_0x87ba('0x34')](_0x502cb0['query']);_0x27f74a['filters']=_[_0x87ba('0x37')](_0x27f74a['model'],_0x27f74a[_0x87ba('0x33')]);_0x5a13b9[_0x87ba('0x36')]=_[_0x87ba('0x37')](_0x27f74a[_0x87ba('0x32')],qs[_0x87ba('0x38')](_0x502cb0['query']['fields']));_0x5a13b9[_0x87ba('0x36')]=_0x5a13b9[_0x87ba('0x36')][_0x87ba('0x39')]?_0x5a13b9[_0x87ba('0x36')]:_0x27f74a['model'];if(_0x502cb0['query']['includeAll']){_0x5a13b9[_0x87ba('0x44')]=[{'all':!![]}];}_0x5a13b9=_['merge']({},_0x5a13b9,_0x502cb0[_0x87ba('0x40')]);return db[_0x87ba('0x41')][_0x87ba('0x48')](_0x5a13b9)[_0x87ba('0x42')](handleEntityNotFound(_0x329096,null))[_0x87ba('0x42')](respondWithResult(_0x329096,null))['catch'](handleError(_0x329096,null));};exports[_0x87ba('0x49')]=function(_0x199c47,_0x17e850){return db[_0x87ba('0x41')][_0x87ba('0x49')](_0x199c47[_0x87ba('0x4a')],{})['then'](function(_0x46f5a5){var _0x54e467=_0x199c47[_0x87ba('0x4b')]['get']({'plain':!![]});if(!_0x54e467)throw new Error(_0x87ba('0x4c'));if(_0x54e467[_0x87ba('0x4d')]==='user'){var _0x5846c0=_0x46f5a5['get']({'plain':!![]});var _0x114730=_0x87ba('0x28');return db[_0x87ba('0x4e')][_0x87ba('0x48')]({'where':{'name':_0x114730,'userProfileId':_0x54e467[_0x87ba('0x4f')]},'raw':!![]})['then'](function(_0x1cf020){if(_0x1cf020&&_0x1cf020[_0x87ba('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x5846c0[_0x87ba('0x2c')],'resourceId':_0x5846c0['id'],'type':_0x1cf020[_0x87ba('0x2c')],'sectionId':_0x1cf020['id']},{})[_0x87ba('0x42')](function(){return _0x46f5a5;});}else{return _0x46f5a5;}})[_0x87ba('0x47')](function(_0x5558b4){logger[_0x87ba('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5558b4);throw _0x5558b4;});}return _0x46f5a5;})['then'](respondWithResult(_0x17e850,0xc9))[_0x87ba('0x47')](handleError(_0x17e850,null));};exports[_0x87ba('0x26')]=function(_0x2d3561,_0x594325){if(_0x2d3561[_0x87ba('0x4a')]['id']){delete _0x2d3561['body']['id'];}return db[_0x87ba('0x41')]['find']({'where':{'id':_0x2d3561[_0x87ba('0x51')]['id']}})['then'](handleEntityNotFound(_0x594325,null))[_0x87ba('0x42')](saveUpdates(_0x2d3561[_0x87ba('0x4a')],null))[_0x87ba('0x42')](respondWithResult(_0x594325,null))[_0x87ba('0x47')](handleError(_0x594325,null));};exports[_0x87ba('0x27')]=function(_0x29a7fb,_0x32dded){return db[_0x87ba('0x41')][_0x87ba('0x48')]({'where':{'id':_0x29a7fb[_0x87ba('0x51')]['id']}})[_0x87ba('0x42')](handleEntityNotFound(_0x32dded,null))['then'](removeEntity(_0x32dded,null))[_0x87ba('0x47')](handleError(_0x32dded,null));};exports['describe']=function(_0x46386d,_0x34d1ba){return db[_0x87ba('0x41')][_0x87ba('0x52')]()['then'](respondWithResult(_0x34d1ba,null))['catch'](handleError(_0x34d1ba,null));};exports[_0x87ba('0x53')]=function(_0x548feb,_0x1f60e2,_0x262482){var _0x40c581={'raw':!![],'where':{}},_0x3221f3={},_0x17e7d9;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x548feb[_0x87ba('0x51')]['id']}})[_0x87ba('0x42')](handleEntityNotFound(_0x1f60e2,null))[_0x87ba('0x42')](function(_0x9476fe){if(_0x9476fe){_0x17e7d9=_0x9476fe[_0x87ba('0x54')]({'plain':!![]});_0x3221f3['model']=_[_0x87ba('0x34')](db[_0x87ba('0x55')][_0x87ba('0x30')]);_0x3221f3['query']=_[_0x87ba('0x34')](_0x548feb[_0x87ba('0x33')]);_0x3221f3[_0x87ba('0x35')]=_[_0x87ba('0x37')](_0x3221f3[_0x87ba('0x32')],_0x3221f3[_0x87ba('0x33')]);_0x40c581[_0x87ba('0x36')]=_[_0x87ba('0x37')](_0x3221f3[_0x87ba('0x32')],qs[_0x87ba('0x38')](_0x548feb[_0x87ba('0x33')][_0x87ba('0x38')]));_0x40c581[_0x87ba('0x36')]=_0x40c581['attributes']['length']?_0x40c581[_0x87ba('0x36')]:_0x3221f3['model'];if(!_0x548feb[_0x87ba('0x33')][_0x87ba('0x3a')]('nolimit')){_0x40c581[_0x87ba('0x21')]=qs[_0x87ba('0x21')](_0x548feb['query']['limit']);_0x40c581[_0x87ba('0x20')]=qs['offset'](_0x548feb[_0x87ba('0x33')][_0x87ba('0x20')]);}_0x40c581[_0x87ba('0x56')]=qs[_0x87ba('0x3c')](_0x548feb['query'][_0x87ba('0x3c')]);_0x40c581[_0x87ba('0x3d')]=qs[_0x87ba('0x35')](_[_0x87ba('0x3e')](_0x548feb['query'],_0x3221f3['filters']));_0x40c581['where'][_0x87ba('0x57')]=_0x9476fe['id'];if(_0x548feb[_0x87ba('0x33')]['filter']){_0x40c581['where']=_[_0x87ba('0x58')](_0x40c581[_0x87ba('0x3d')],{'$or':_[_0x87ba('0x2f')](_0x40c581[_0x87ba('0x36')],function(_0x5d9386){var _0x2e8ad0={};_0x2e8ad0[_0x5d9386]={'$like':'%'+_0x548feb[_0x87ba('0x33')][_0x87ba('0x3f')]+'%'};return _0x2e8ad0;})});}_0x40c581=_[_0x87ba('0x58')]({},_0x40c581,_0x548feb[_0x87ba('0x40')]);return db[_0x87ba('0x55')][_0x87ba('0x45')](_0x40c581);}})[_0x87ba('0x42')](function(_0x476d16){if(_0x476d16){return db[_0x87ba('0x59')][_0x87ba('0x5a')]({'where':{'id':_['map'](_0x476d16,_0x87ba('0x5b')),'role':_0x87ba('0x5c')},'attributes':['id',_0x87ba('0x2c'),'openchannelPause',_0x87ba('0x5d'),_0x87ba('0x5e')]});}})[_0x87ba('0x42')](function(_0x3cb10e){if(_0x3cb10e){return{'count':_0x3cb10e['count'],'rows':_[_0x87ba('0x2f')](_0x3cb10e['rows'],function(_0x4c4a5f){return{'membername':_0x4c4a5f[_0x87ba('0x2c')],'UserId':_0x4c4a5f['id'],'queue_name':_0x17e7d9[_0x87ba('0x2c')],'OpenchannelQueueId':_0x17e7d9['id'],'interface':util[_0x87ba('0x5f')](_0x87ba('0x60'),_0x87ba('0x61'),_0x4c4a5f['name']),'penalty':0x0,'paused':_0x4c4a5f[_0x87ba('0x62')],'createdAt':_0x4c4a5f[_0x87ba('0x5e')],'updatedAt':_0x4c4a5f[_0x87ba('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1f60e2,_0x40c581))[_0x87ba('0x47')](handleError(_0x1f60e2,null));};exports[_0x87ba('0x63')]=function(_0x48d073,_0x405f72,_0x80108c){var _0x1c4550={};var _0x102600={};var _0x2d9f7f;var _0x1cefa1;return db[_0x87ba('0x41')]['findOne']({'where':{'id':_0x48d073['params']['id']}})['then'](handleEntityNotFound(_0x405f72,null))[_0x87ba('0x42')](function(_0x7d4626){if(_0x7d4626){_0x2d9f7f=_0x7d4626;_0x102600[_0x87ba('0x32')]=_[_0x87ba('0x34')](db[_0x87ba('0x64')][_0x87ba('0x30')]);_0x102600[_0x87ba('0x33')]=_['keys'](_0x48d073['query']);_0x102600[_0x87ba('0x35')]=_[_0x87ba('0x37')](_0x102600['model'],_0x102600[_0x87ba('0x33')]);_0x1c4550['attributes']=_['intersection'](_0x102600[_0x87ba('0x32')],qs[_0x87ba('0x38')](_0x48d073[_0x87ba('0x33')]['fields']));_0x1c4550['attributes']=_0x1c4550['attributes'][_0x87ba('0x39')]?_0x1c4550[_0x87ba('0x36')]:_0x102600['model'];_0x1c4550[_0x87ba('0x56')]=qs['sort'](_0x48d073[_0x87ba('0x33')][_0x87ba('0x3c')]);_0x1c4550[_0x87ba('0x3d')]=qs[_0x87ba('0x35')](_['pick'](_0x48d073[_0x87ba('0x33')],_0x102600[_0x87ba('0x35')]));if(_0x48d073[_0x87ba('0x33')]['filter']){_0x1c4550[_0x87ba('0x3d')]=_[_0x87ba('0x58')](_0x1c4550[_0x87ba('0x3d')],{'$or':_['map'](_0x1c4550[_0x87ba('0x36')],function(_0x30523b){var _0x10313a={};_0x10313a[_0x30523b]={'$like':'%'+_0x48d073[_0x87ba('0x33')][_0x87ba('0x3f')]+'%'};return _0x10313a;})});}_0x1c4550=_[_0x87ba('0x58')]({},_0x1c4550,_0x48d073[_0x87ba('0x40')]);return _0x2d9f7f[_0x87ba('0x63')](_0x1c4550);}})[_0x87ba('0x42')](function(_0x46237a){if(_0x46237a){_0x1cefa1=_0x46237a[_0x87ba('0x39')];if(!_0x48d073[_0x87ba('0x33')][_0x87ba('0x3a')](_0x87ba('0x3b'))){_0x1c4550[_0x87ba('0x21')]=qs[_0x87ba('0x21')](_0x48d073['query'][_0x87ba('0x21')]);_0x1c4550[_0x87ba('0x20')]=qs['offset'](_0x48d073['query'][_0x87ba('0x20')]);}return _0x2d9f7f[_0x87ba('0x63')](_0x1c4550);}})[_0x87ba('0x42')](function(_0x5ae106){if(_0x5ae106){return _0x5ae106?{'count':_0x1cefa1,'rows':_0x5ae106}:null;}})[_0x87ba('0x42')](respondWithResult(_0x405f72,null))[_0x87ba('0x47')](handleError(_0x405f72,null));};exports[_0x87ba('0x65')]=function(_0x4de90d,_0x18f7d4,_0x402df8){var _0x2562b1=_0x4de90d['body']['ids'];return db['Team'][_0x87ba('0x45')]({'where':{'id':_0x2562b1},'attributes':['id'],'include':[{'model':db[_0x87ba('0x59')],'as':_0x87ba('0x66'),'attributes':['id',_0x87ba('0x2c'),_0x87ba('0x67'),'voicePause','interface'],'raw':!![]}]})[_0x87ba('0x42')](function(_0x167c9d){if(_0x167c9d){var _0x59defd=_[_0x87ba('0x68')](_0x167c9d,function(_0xf7a241){var _0x89bd6c=_0xf7a241[_0x87ba('0x54')]({'plain':!![]});return _0x89bd6c[_0x87ba('0x66')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x4de90d[_0x87ba('0x51')]['id']}})[_0x87ba('0x42')](function(_0x9e4bb8){return db[_0x87ba('0x69')][_0x87ba('0x6a')](function(_0x514290){return _0x9e4bb8['addTeams'](_0x2562b1,{'transaction':_0x514290})[_0x87ba('0x42')](function(){return BPromise[_0x87ba('0x6b')](_0x59defd,function(_0x452ca6){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x452ca6['id'],'OpenchannelQueueId':_0x4de90d[_0x87ba('0x51')]['id']},'transaction':_0x514290});});})[_0x87ba('0x42')](function(){_0x59defd[_0x87ba('0x6c')](function(_0x5c0225){socket[_0x87ba('0x6d')](_0x87ba('0x6e'),{'UserId':_0x5c0225['id'],'OpenchannelQueueId':_0x9e4bb8['id']});});});});});}})[_0x87ba('0x42')](respondWithStatusCode(_0x18f7d4,null))['catch'](handleError(_0x18f7d4,null));};exports[_0x87ba('0x6f')]=function(_0x16d1bf,_0x39dca3,_0x536d38){return db[_0x87ba('0x64')][_0x87ba('0x45')]({'where':{'id':_0x16d1bf[_0x87ba('0x33')][_0x87ba('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x87ba('0x66'),'attributes':['id'],'raw':!![]}]})[_0x87ba('0x42')](handleEntityNotFound(_0x39dca3,null))['then'](function(_0x255ae4){var _0x2434de=_[_0x87ba('0x2f')](_0x255ae4,'id');var _0x79cb0c=[];var _0x38f6da=[];var _0x35b91a=squel['select']();_0x35b91a[_0x87ba('0x71')](_0x87ba('0x72'))['from'](_0x87ba('0x73'),'tq')['join'](_0x87ba('0x74'),'ut',_0x87ba('0x75'))[_0x87ba('0x3d')]('OpenchannelQueueId\x20=\x20?',_0x16d1bf[_0x87ba('0x51')]['id']);for(var _0x45a708=0x0;_0x45a708<_0x255ae4[_0x87ba('0x39')];_0x45a708+=0x1){let _0x4bde3e=_0x255ae4[_0x45a708];for(var _0xc88857=0x0;_0xc88857<_0x4bde3e[_0x87ba('0x66')][_0x87ba('0x39')];_0xc88857+=0x1){let _0x98904e=_0x4bde3e[_0x87ba('0x66')][_0xc88857];var _0x2ba4ec=_0x35b91a[_0x87ba('0x76')]();_0x2ba4ec[_0x87ba('0x3d')]('ut.UserId\x20=\x20?',_0x98904e['id']);_0x38f6da['push'](db[_0x87ba('0x69')][_0x87ba('0x33')](_0x2ba4ec['toString'](),{'type':db['sequelize'][_0x87ba('0x77')][_0x87ba('0x78')]})[_0x87ba('0x42')](function(_0x3499d7){if(_0x3499d7[_0x87ba('0x39')]===0x1){return _0x98904e['id'];}else{var _0x346ab8=_[_0x87ba('0x79')](_[_0x87ba('0x2f')](_0x3499d7,_0x87ba('0x7a')),function(_0xb090f8){return _[_0x87ba('0x7b')](_0x2434de,_0xb090f8);});if(_0x346ab8){return _0x98904e['id'];}}}));}}return BPromise[_0x87ba('0x7c')](_0x38f6da)[_0x87ba('0x42')](function(_0x431fcd){_0x79cb0c=_(_0x79cb0c)[_0x87ba('0x7d')](_0x431fcd)[_0x87ba('0x7e')]()[_0x87ba('0x7f')]();return db[_0x87ba('0x41')][_0x87ba('0x48')]({'where':{'id':_0x16d1bf[_0x87ba('0x51')]['id']}})[_0x87ba('0x42')](function(_0x5da75c){return db[_0x87ba('0x69')][_0x87ba('0x6a')](function(_0x227f16){return _0x5da75c['removeTeams'](_0x16d1bf[_0x87ba('0x33')][_0x87ba('0x70')],{'transaction':_0x227f16})[_0x87ba('0x42')](function(){if(!_[_0x87ba('0x80')](_0x79cb0c)){return _0x5da75c[_0x87ba('0x81')](_0x79cb0c,{'transaction':_0x227f16});}})[_0x87ba('0x42')](function(){_0x79cb0c[_0x87ba('0x6c')](function(_0x352230){socket[_0x87ba('0x6d')](_0x87ba('0x82'),{'UserId':_0x352230,'OpenchannelQueueId':_0x5da75c['id']});});});});});});})[_0x87ba('0x42')](respondWithStatusCode(_0x39dca3,null))[_0x87ba('0x47')](handleError(_0x39dca3,null));};exports['addAgents']=function(_0x319148,_0x5748d7,_0x44741f){return db[_0x87ba('0x41')][_0x87ba('0x48')]({'where':{'id':_0x319148[_0x87ba('0x51')]['id']}})[_0x87ba('0x42')](handleEntityNotFound(_0x5748d7,null))[_0x87ba('0x42')](function(_0x1b361b){if(_0x1b361b){return _0x1b361b[_0x87ba('0x83')](_0x319148['body']['ids'],_[_0x87ba('0x84')](_0x319148[_0x87ba('0x4a')],[_0x87ba('0x70'),'id'])||{})[_0x87ba('0x85')](function(_0x5965cf){for(var _0x37bbef=0x0;_0x37bbef<_0x319148[_0x87ba('0x4a')]['ids'][_0x87ba('0x39')];_0x37bbef+=0x1){socket[_0x87ba('0x6d')](_0x87ba('0x6e'),{'UserId':_0x319148['body'][_0x87ba('0x70')][_0x37bbef],'OpenchannelQueueId':_0x319148[_0x87ba('0x51')]['id']});}return _0x5965cf;});}})[_0x87ba('0x42')](respondWithResult(_0x5748d7,null))[_0x87ba('0x47')](handleError(_0x5748d7,null));};exports['removeAgents']=function(_0x2c3088,_0x12d69e,_0x2d6e0a){return db[_0x87ba('0x41')][_0x87ba('0x48')]({'where':{'id':_0x2c3088[_0x87ba('0x51')]['id']}})[_0x87ba('0x42')](handleEntityNotFound(_0x12d69e,null))[_0x87ba('0x42')](function(_0xe0e392){if(_0xe0e392){return _0xe0e392[_0x87ba('0x81')](_0x2c3088[_0x87ba('0x33')]['ids'])[_0x87ba('0x42')](function(){if(_['isArray'](_0x2c3088[_0x87ba('0x33')][_0x87ba('0x70')])){for(var _0x271771=0x0;_0x271771<_0x2c3088[_0x87ba('0x33')][_0x87ba('0x70')][_0x87ba('0x39')];_0x271771+=0x1){socket[_0x87ba('0x6d')](_0x87ba('0x82'),{'UserId':Number(_0x2c3088[_0x87ba('0x33')][_0x87ba('0x70')][_0x271771]),'OpenchannelQueueId':Number(_0x2c3088[_0x87ba('0x51')]['id'])});}}else{socket[_0x87ba('0x6d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2c3088[_0x87ba('0x33')][_0x87ba('0x70')]),'OpenchannelQueueId':Number(_0x2c3088[_0x87ba('0x51')]['id'])});}});}})[_0x87ba('0x42')](respondWithStatusCode(_0x12d69e,null))['catch'](handleError(_0x12d69e,null));};exports[_0x87ba('0x86')]=function(_0x4caaeb,_0x2c5b59,_0x44cd9e){var _0x5a72b6={};var _0x2695c1={};var _0x147a10;var _0x26332d;return db[_0x87ba('0x41')][_0x87ba('0x87')]({'where':{'id':_0x4caaeb[_0x87ba('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c5b59,null))[_0x87ba('0x42')](function(_0x1020ab){if(_0x1020ab){_0x147a10=_0x1020ab;_0x2695c1[_0x87ba('0x32')]=_[_0x87ba('0x34')](db['User'][_0x87ba('0x30')]);_0x2695c1[_0x87ba('0x33')]=_[_0x87ba('0x34')](_0x4caaeb[_0x87ba('0x33')]);_0x2695c1[_0x87ba('0x35')]=_[_0x87ba('0x37')](_0x2695c1[_0x87ba('0x32')],_0x2695c1[_0x87ba('0x33')]);_0x5a72b6[_0x87ba('0x36')]=_[_0x87ba('0x37')](_0x2695c1[_0x87ba('0x32')],qs[_0x87ba('0x38')](_0x4caaeb[_0x87ba('0x33')][_0x87ba('0x38')]));_0x5a72b6[_0x87ba('0x36')]=_0x5a72b6[_0x87ba('0x36')][_0x87ba('0x39')]?_0x5a72b6[_0x87ba('0x36')]:_0x2695c1[_0x87ba('0x32')];_0x5a72b6[_0x87ba('0x56')]=qs[_0x87ba('0x3c')](_0x4caaeb[_0x87ba('0x33')][_0x87ba('0x3c')]);_0x5a72b6[_0x87ba('0x3d')]=qs[_0x87ba('0x35')](_[_0x87ba('0x3e')](_0x4caaeb[_0x87ba('0x33')],_0x2695c1[_0x87ba('0x35')]));if(_0x4caaeb['query'][_0x87ba('0x3f')]){_0x5a72b6[_0x87ba('0x3d')]=_[_0x87ba('0x58')](_0x5a72b6['where'],{'$or':_[_0x87ba('0x2f')](_0x5a72b6['attributes'],function(_0x2171b2){var _0xb0f2e4={};_0xb0f2e4[_0x2171b2]={'$like':'%'+_0x4caaeb[_0x87ba('0x33')][_0x87ba('0x3f')]+'%'};return _0xb0f2e4;})});}_0x5a72b6=_[_0x87ba('0x58')]({},_0x5a72b6,_0x4caaeb[_0x87ba('0x40')]);return _0x147a10[_0x87ba('0x86')](_0x5a72b6);}})[_0x87ba('0x42')](function(_0x5c4a2f){if(_0x5c4a2f){_0x26332d=_0x5c4a2f[_0x87ba('0x39')];if(!_0x4caaeb[_0x87ba('0x33')][_0x87ba('0x3a')](_0x87ba('0x3b'))){_0x5a72b6['limit']=qs[_0x87ba('0x21')](_0x4caaeb[_0x87ba('0x33')][_0x87ba('0x21')]);_0x5a72b6[_0x87ba('0x20')]=qs['offset'](_0x4caaeb[_0x87ba('0x33')][_0x87ba('0x20')]);}return _0x147a10[_0x87ba('0x86')](_0x5a72b6);}})['then'](function(_0x345b1e){if(_0x345b1e){return _0x345b1e?{'count':_0x26332d,'rows':_0x345b1e}:null;}})['then'](respondWithResult(_0x2c5b59,null))[_0x87ba('0x47')](handleError(_0x2c5b59,null));}; \ No newline at end of file +var _0x0276=['key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserOpenchannelQueue','User','findAndCountAll','UserId','openchannelPause','createdAt','format','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','count','offset','limit','status','set','Content-Range','json','apply','save','update','then','get','OpenchannelQueues','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x0276,0x167));var _0x6027=function(_0x8e74c4,_0x4c3b72){_0x8e74c4=_0x8e74c4-0x0;var _0x50e53f=_0x0276[_0x8e74c4];return _0x50e53f;};'use strict';var pdf=require(_0x6027('0x0'));var emlformat=require(_0x6027('0x1'));var rimraf=require(_0x6027('0x2'));var zipdir=require(_0x6027('0x3'));var jsonpatch=require(_0x6027('0x4'));var rp=require(_0x6027('0x5'));var moment=require(_0x6027('0x6'));var BPromise=require(_0x6027('0x7'));var Mustache=require('mustache');var util=require(_0x6027('0x8'));var path=require('path');var sox=require(_0x6027('0x9'));var csv=require(_0x6027('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6027('0xb'));var jsforce=require(_0x6027('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6027('0xa'));var querystring=require('querystring');var Papa=require(_0x6027('0xd'));var Redis=require('ioredis');var authService=require(_0x6027('0xe'));var qs=require(_0x6027('0xf'));var as=require(_0x6027('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6027('0x11'))(_0x6027('0x12'));var utils=require(_0x6027('0x13'));var config=require(_0x6027('0x14'));var db=require('../../mysqldb')['db'];config[_0x6027('0x15')]=_[_0x6027('0x16')](config[_0x6027('0x15')],{'host':_0x6027('0x17'),'port':0x18eb});var socket=require(_0x6027('0x18'))(new Redis(config[_0x6027('0x15')]));require('./openchannelQueue.socket')[_0x6027('0x19')](socket);function respondWithStatusCode(_0x38bdb3,_0x403a11){_0x403a11=_0x403a11||0xcc;return function(_0x59aa7e){if(_0x59aa7e){return _0x38bdb3[_0x6027('0x1a')](_0x403a11);}return _0x38bdb3['status'](_0x403a11)['end']();};}function respondWithResult(_0x14cfbc,_0x2bfadb){_0x2bfadb=_0x2bfadb||0xc8;return function(_0x21d13a){if(_0x21d13a){return _0x14cfbc['status'](_0x2bfadb)['json'](_0x21d13a);}};}function respondWithFilteredResult(_0x330a7b,_0x2e7ed8){return function(_0x37aeea){if(_0x37aeea){var _0x58b2b5=_0x37aeea[_0x6027('0x1b')],_0x1136ca=_0x2e7ed8[_0x6027('0x1c')],_0x176cb7=_0x2e7ed8['offset']+_0x2e7ed8[_0x6027('0x1d')],_0x555e27;if(_0x176cb7>=_0x58b2b5){_0x176cb7=_0x58b2b5;_0x555e27=0xc8;}else{_0x555e27=0xce;}_0x330a7b[_0x6027('0x1e')](_0x555e27);return _0x330a7b[_0x6027('0x1f')](_0x6027('0x20'),_0x1136ca+'-'+_0x176cb7+'/'+_0x58b2b5)[_0x6027('0x21')](_0x37aeea);}return null;};}function patchUpdates(_0x4cc62c){return function(_0x4631d7){try{jsonpatch[_0x6027('0x22')](_0x4631d7,_0x4cc62c,!![]);}catch(_0x583efe){return BPromise['reject'](_0x583efe);}return _0x4631d7[_0x6027('0x23')]();};}function saveUpdates(_0x52e3b6,_0x572ac1){return function(_0x139c9d){if(_0x139c9d){return _0x139c9d[_0x6027('0x24')](_0x52e3b6)['then'](function(_0xb1300d){return _0xb1300d;});}return null;};}function removeEntity(_0x371f35,_0xe0882){return function(_0x492758){if(_0x492758){return _0x492758['destroy']()[_0x6027('0x25')](function(){var _0xecd4b6=_0x492758[_0x6027('0x26')]({'plain':!![]});var _0x911856=_0x6027('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x911856,'resourceId':_0xecd4b6['id']}})['then'](function(){return _0x492758;});})[_0x6027('0x25')](function(){_0x371f35['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e55d2,_0x237426){return function(_0x2fe59c){if(!_0x2fe59c){_0x3e55d2[_0x6027('0x1a')](0x194);}return _0x2fe59c;};}function handleError(_0x2054e5,_0x33687a){_0x33687a=_0x33687a||0x1f4;return function(_0x4f778c){logger[_0x6027('0x28')](_0x4f778c[_0x6027('0x29')]);if(_0x4f778c[_0x6027('0x2a')]){delete _0x4f778c['name'];}_0x2054e5[_0x6027('0x1e')](_0x33687a)['send'](_0x4f778c);};}exports[_0x6027('0x2b')]=function(_0x16c2b7,_0x49e4b6){var _0x54b727={},_0x35f892={},_0x4c1ab1={'count':0x0,'rows':[]};var _0x5e36d2=_[_0x6027('0x2c')](db[_0x6027('0x2d')][_0x6027('0x2e')],function(_0x44de6d){return{'name':_0x44de6d[_0x6027('0x2f')],'type':_0x44de6d[_0x6027('0x30')][_0x6027('0x31')]};});_0x35f892[_0x6027('0x32')]=_['map'](_0x5e36d2,'name');_0x35f892['query']=_[_0x6027('0x33')](_0x16c2b7[_0x6027('0x34')]);_0x35f892[_0x6027('0x35')]=_[_0x6027('0x36')](_0x35f892[_0x6027('0x32')],_0x35f892['query']);_0x54b727[_0x6027('0x37')]=_['intersection'](_0x35f892['model'],qs[_0x6027('0x38')](_0x16c2b7[_0x6027('0x34')][_0x6027('0x38')]));_0x54b727[_0x6027('0x37')]=_0x54b727[_0x6027('0x37')]['length']?_0x54b727[_0x6027('0x37')]:_0x35f892[_0x6027('0x32')];if(!_0x16c2b7[_0x6027('0x34')][_0x6027('0x39')](_0x6027('0x3a'))){_0x54b727[_0x6027('0x1d')]=qs['limit'](_0x16c2b7[_0x6027('0x34')][_0x6027('0x1d')]);_0x54b727[_0x6027('0x1c')]=qs['offset'](_0x16c2b7[_0x6027('0x34')][_0x6027('0x1c')]);}_0x54b727[_0x6027('0x3b')]=qs[_0x6027('0x3c')](_0x16c2b7[_0x6027('0x34')][_0x6027('0x3c')]);_0x54b727[_0x6027('0x3d')]=qs[_0x6027('0x35')](_[_0x6027('0x3e')](_0x16c2b7[_0x6027('0x34')],_0x35f892['filters']));if(_0x16c2b7[_0x6027('0x34')][_0x6027('0x3f')]){_0x54b727[_0x6027('0x3d')]=_['merge'](_0x54b727[_0x6027('0x3d')],{'$or':_[_0x6027('0x2c')](_0x5e36d2,function(_0x418f3e){if(_0x418f3e[_0x6027('0x30')]!==_0x6027('0x40')){var _0xc64058={};_0xc64058[_0x418f3e[_0x6027('0x2a')]]={'$like':'%'+_0x16c2b7['query'][_0x6027('0x3f')]+'%'};return _0xc64058;}})});}_0x54b727=_[_0x6027('0x41')]({},_0x54b727,_0x16c2b7[_0x6027('0x42')]);var _0x575a05={'where':_0x54b727['where']};return db['OpenchannelQueue'][_0x6027('0x1b')](_0x575a05)[_0x6027('0x25')](function(_0x4d908a){_0x4c1ab1[_0x6027('0x1b')]=_0x4d908a;if(_0x16c2b7['query'][_0x6027('0x43')]){_0x54b727['include']=[{'all':!![]}];}return db[_0x6027('0x2d')][_0x6027('0x44')](_0x54b727);})[_0x6027('0x25')](function(_0xbb1f1f){_0x4c1ab1[_0x6027('0x45')]=_0xbb1f1f;return _0x4c1ab1;})[_0x6027('0x25')](respondWithFilteredResult(_0x49e4b6,_0x54b727))[_0x6027('0x46')](handleError(_0x49e4b6,null));};exports['show']=function(_0x48b6b3,_0x41b179){var _0x182ee6={'raw':!![],'where':{'id':_0x48b6b3[_0x6027('0x47')]['id']}},_0x24707b={};_0x24707b['model']=_[_0x6027('0x33')](db[_0x6027('0x2d')][_0x6027('0x2e')]);_0x24707b[_0x6027('0x34')]=_[_0x6027('0x33')](_0x48b6b3[_0x6027('0x34')]);_0x24707b['filters']=_[_0x6027('0x36')](_0x24707b['model'],_0x24707b[_0x6027('0x34')]);_0x182ee6[_0x6027('0x37')]=_[_0x6027('0x36')](_0x24707b[_0x6027('0x32')],qs['fields'](_0x48b6b3[_0x6027('0x34')][_0x6027('0x38')]));_0x182ee6[_0x6027('0x37')]=_0x182ee6[_0x6027('0x37')][_0x6027('0x48')]?_0x182ee6['attributes']:_0x24707b[_0x6027('0x32')];if(_0x48b6b3['query'][_0x6027('0x43')]){_0x182ee6['include']=[{'all':!![]}];}_0x182ee6=_['merge']({},_0x182ee6,_0x48b6b3[_0x6027('0x42')]);return db['OpenchannelQueue'][_0x6027('0x49')](_0x182ee6)[_0x6027('0x25')](handleEntityNotFound(_0x41b179,null))[_0x6027('0x25')](respondWithResult(_0x41b179,null))[_0x6027('0x46')](handleError(_0x41b179,null));};exports['create']=function(_0x59fe5d,_0x4f7d9e){return db[_0x6027('0x2d')][_0x6027('0x4a')](_0x59fe5d['body'],{})[_0x6027('0x25')](function(_0x184bee){var _0x1aa506=_0x59fe5d[_0x6027('0x4b')]['get']({'plain':!![]});if(!_0x1aa506)throw new Error(_0x6027('0x4c'));if(_0x1aa506['role']==='user'){var _0x491817=_0x184bee[_0x6027('0x26')]({'plain':!![]});var _0x1cd1ba=_0x6027('0x27');return db[_0x6027('0x4d')][_0x6027('0x49')]({'where':{'name':_0x1cd1ba,'userProfileId':_0x1aa506[_0x6027('0x4e')]},'raw':!![]})[_0x6027('0x25')](function(_0xeb3480){if(_0xeb3480&&_0xeb3480[_0x6027('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x491817['name'],'resourceId':_0x491817['id'],'type':_0xeb3480[_0x6027('0x2a')],'sectionId':_0xeb3480['id']},{})[_0x6027('0x25')](function(){return _0x184bee;});}else{return _0x184bee;}})[_0x6027('0x46')](function(_0x37b418){logger[_0x6027('0x28')](_0x6027('0x50'),_0x37b418);throw _0x37b418;});}return _0x184bee;})[_0x6027('0x25')](respondWithResult(_0x4f7d9e,0xc9))['catch'](handleError(_0x4f7d9e,null));};exports[_0x6027('0x24')]=function(_0xfc132c,_0x496bff){if(_0xfc132c[_0x6027('0x51')]['id']){delete _0xfc132c['body']['id'];}return db[_0x6027('0x2d')][_0x6027('0x49')]({'where':{'id':_0xfc132c[_0x6027('0x47')]['id']}})[_0x6027('0x25')](handleEntityNotFound(_0x496bff,null))['then'](saveUpdates(_0xfc132c[_0x6027('0x51')],null))[_0x6027('0x25')](respondWithResult(_0x496bff,null))[_0x6027('0x46')](handleError(_0x496bff,null));};exports['destroy']=function(_0x327540,_0xc7f3f4){return db['OpenchannelQueue']['find']({'where':{'id':_0x327540['params']['id']}})[_0x6027('0x25')](handleEntityNotFound(_0xc7f3f4,null))[_0x6027('0x25')](removeEntity(_0xc7f3f4,null))[_0x6027('0x46')](handleError(_0xc7f3f4,null));};exports[_0x6027('0x52')]=function(_0x24724b,_0x311baa){return db[_0x6027('0x2d')]['describe']()[_0x6027('0x25')](respondWithResult(_0x311baa,null))[_0x6027('0x46')](handleError(_0x311baa,null));};exports[_0x6027('0x53')]=function(_0x4122c0,_0x9c495c,_0xab67c3){var _0x4ce2c8={'raw':!![],'where':{}},_0x26c1ce={},_0x4876b1;return db[_0x6027('0x2d')]['findOne']({'where':{'id':_0x4122c0[_0x6027('0x47')]['id']}})['then'](handleEntityNotFound(_0x9c495c,null))['then'](function(_0x322799){if(_0x322799){_0x4876b1=_0x322799['get']({'plain':!![]});_0x26c1ce[_0x6027('0x32')]=_[_0x6027('0x33')](db['UserOpenchannelQueue'][_0x6027('0x2e')]);_0x26c1ce[_0x6027('0x34')]=_[_0x6027('0x33')](_0x4122c0[_0x6027('0x34')]);_0x26c1ce[_0x6027('0x35')]=_[_0x6027('0x36')](_0x26c1ce['model'],_0x26c1ce[_0x6027('0x34')]);_0x4ce2c8['attributes']=_[_0x6027('0x36')](_0x26c1ce[_0x6027('0x32')],qs[_0x6027('0x38')](_0x4122c0['query'][_0x6027('0x38')]));_0x4ce2c8[_0x6027('0x37')]=_0x4ce2c8[_0x6027('0x37')]['length']?_0x4ce2c8['attributes']:_0x26c1ce[_0x6027('0x32')];if(!_0x4122c0['query'][_0x6027('0x39')](_0x6027('0x3a'))){_0x4ce2c8[_0x6027('0x1d')]=qs['limit'](_0x4122c0[_0x6027('0x34')][_0x6027('0x1d')]);_0x4ce2c8[_0x6027('0x1c')]=qs[_0x6027('0x1c')](_0x4122c0[_0x6027('0x34')][_0x6027('0x1c')]);}_0x4ce2c8['order']=qs[_0x6027('0x3c')](_0x4122c0[_0x6027('0x34')][_0x6027('0x3c')]);_0x4ce2c8[_0x6027('0x3d')]=qs['filters'](_[_0x6027('0x3e')](_0x4122c0['query'],_0x26c1ce['filters']));_0x4ce2c8[_0x6027('0x3d')]['OpenchannelQueueId']=_0x322799['id'];if(_0x4122c0[_0x6027('0x34')][_0x6027('0x3f')]){_0x4ce2c8[_0x6027('0x3d')]=_[_0x6027('0x41')](_0x4ce2c8[_0x6027('0x3d')],{'$or':_[_0x6027('0x2c')](_0x4ce2c8[_0x6027('0x37')],function(_0x3dace5){var _0x55e856={};_0x55e856[_0x3dace5]={'$like':'%'+_0x4122c0[_0x6027('0x34')]['filter']+'%'};return _0x55e856;})});}_0x4ce2c8=_[_0x6027('0x41')]({},_0x4ce2c8,_0x4122c0[_0x6027('0x42')]);return db[_0x6027('0x54')][_0x6027('0x44')](_0x4ce2c8);}})[_0x6027('0x25')](function(_0x328c49){if(_0x328c49){return db[_0x6027('0x55')][_0x6027('0x56')]({'where':{'id':_[_0x6027('0x2c')](_0x328c49,_0x6027('0x57')),'role':'agent'},'attributes':['id',_0x6027('0x2a'),_0x6027('0x58'),'updatedAt',_0x6027('0x59')]});}})['then'](function(_0x1e1ae5){if(_0x1e1ae5){return{'count':_0x1e1ae5['count'],'rows':_['map'](_0x1e1ae5['rows'],function(_0x578afc){return{'membername':_0x578afc[_0x6027('0x2a')],'UserId':_0x578afc['id'],'queue_name':_0x4876b1['name'],'OpenchannelQueueId':_0x4876b1['id'],'interface':util[_0x6027('0x5a')]('%s/%s',_0x6027('0x5b'),_0x578afc['name']),'penalty':0x0,'paused':_0x578afc[_0x6027('0x58')],'createdAt':_0x578afc[_0x6027('0x59')],'updatedAt':_0x578afc[_0x6027('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x9c495c,_0x4ce2c8))[_0x6027('0x46')](handleError(_0x9c495c,null));};exports[_0x6027('0x5d')]=function(_0x122edb,_0x3a9235,_0x15cc00){var _0x27ac08={};var _0xfbb50a={};var _0x751a76;var _0x29f2b5;return db[_0x6027('0x2d')][_0x6027('0x5e')]({'where':{'id':_0x122edb[_0x6027('0x47')]['id']}})[_0x6027('0x25')](handleEntityNotFound(_0x3a9235,null))['then'](function(_0x474ac2){if(_0x474ac2){_0x751a76=_0x474ac2;_0xfbb50a['model']=_[_0x6027('0x33')](db[_0x6027('0x5f')][_0x6027('0x2e')]);_0xfbb50a[_0x6027('0x34')]=_['keys'](_0x122edb[_0x6027('0x34')]);_0xfbb50a[_0x6027('0x35')]=_[_0x6027('0x36')](_0xfbb50a[_0x6027('0x32')],_0xfbb50a[_0x6027('0x34')]);_0x27ac08['attributes']=_[_0x6027('0x36')](_0xfbb50a['model'],qs[_0x6027('0x38')](_0x122edb[_0x6027('0x34')][_0x6027('0x38')]));_0x27ac08['attributes']=_0x27ac08[_0x6027('0x37')][_0x6027('0x48')]?_0x27ac08['attributes']:_0xfbb50a[_0x6027('0x32')];_0x27ac08[_0x6027('0x3b')]=qs['sort'](_0x122edb['query'][_0x6027('0x3c')]);_0x27ac08[_0x6027('0x3d')]=qs[_0x6027('0x35')](_[_0x6027('0x3e')](_0x122edb[_0x6027('0x34')],_0xfbb50a['filters']));if(_0x122edb['query']['filter']){_0x27ac08[_0x6027('0x3d')]=_[_0x6027('0x41')](_0x27ac08[_0x6027('0x3d')],{'$or':_[_0x6027('0x2c')](_0x27ac08['attributes'],function(_0x2c73d8){var _0x2d4c97={};_0x2d4c97[_0x2c73d8]={'$like':'%'+_0x122edb[_0x6027('0x34')]['filter']+'%'};return _0x2d4c97;})});}_0x27ac08=_['merge']({},_0x27ac08,_0x122edb['options']);return _0x751a76[_0x6027('0x5d')](_0x27ac08);}})[_0x6027('0x25')](function(_0x364404){if(_0x364404){_0x29f2b5=_0x364404[_0x6027('0x48')];if(!_0x122edb[_0x6027('0x34')][_0x6027('0x39')](_0x6027('0x3a'))){_0x27ac08[_0x6027('0x1d')]=qs[_0x6027('0x1d')](_0x122edb['query'][_0x6027('0x1d')]);_0x27ac08[_0x6027('0x1c')]=qs[_0x6027('0x1c')](_0x122edb['query'][_0x6027('0x1c')]);}return _0x751a76['getTeams'](_0x27ac08);}})[_0x6027('0x25')](function(_0x31a03f){if(_0x31a03f){return _0x31a03f?{'count':_0x29f2b5,'rows':_0x31a03f}:null;}})['then'](respondWithResult(_0x3a9235,null))[_0x6027('0x46')](handleError(_0x3a9235,null));};exports[_0x6027('0x60')]=function(_0x3f0fa7,_0x45d0ac,_0x471c4d){var _0xa7f210=_0x3f0fa7[_0x6027('0x51')][_0x6027('0x61')];return db[_0x6027('0x5f')][_0x6027('0x44')]({'where':{'id':_0xa7f210},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6027('0x62'),'attributes':['id',_0x6027('0x2a'),_0x6027('0x63'),'voicePause','interface'],'raw':!![]}]})[_0x6027('0x25')](function(_0x3e7d30){if(_0x3e7d30){var _0x23ad4b=_[_0x6027('0x64')](_0x3e7d30,function(_0x48ad48){var _0x2d11df=_0x48ad48[_0x6027('0x26')]({'plain':!![]});return _0x2d11df[_0x6027('0x62')];});return db[_0x6027('0x2d')][_0x6027('0x49')]({'where':{'id':_0x3f0fa7[_0x6027('0x47')]['id']}})['then'](function(_0x2488cf){return db[_0x6027('0x65')][_0x6027('0x66')](function(_0x10b337){return _0x2488cf[_0x6027('0x60')](_0xa7f210,{'transaction':_0x10b337})['then'](function(){return BPromise[_0x6027('0x67')](_0x23ad4b,function(_0x5d1e3f){return db[_0x6027('0x54')][_0x6027('0x68')]({'where':{'UserId':_0x5d1e3f['id'],'OpenchannelQueueId':_0x3f0fa7[_0x6027('0x47')]['id']},'transaction':_0x10b337});});})['then'](function(){_0x23ad4b[_0x6027('0x69')](function(_0xd56308){socket['emit'](_0x6027('0x6a'),{'UserId':_0xd56308['id'],'OpenchannelQueueId':_0x2488cf['id']});});});});});}})['then'](respondWithStatusCode(_0x45d0ac,null))[_0x6027('0x46')](handleError(_0x45d0ac,null));};exports[_0x6027('0x6b')]=function(_0x440e72,_0x598e27,_0x362f78){return db['Team'][_0x6027('0x44')]({'where':{'id':_0x440e72[_0x6027('0x34')][_0x6027('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6027('0x62'),'attributes':['id'],'raw':!![]}]})[_0x6027('0x25')](handleEntityNotFound(_0x598e27,null))[_0x6027('0x25')](function(_0x29926c){var _0x12e4d3=_[_0x6027('0x2c')](_0x29926c,'id');var _0x41e07e=[];var _0xdf65da=[];var _0x297733=squel[_0x6027('0x6c')]();_0x297733[_0x6027('0x6d')](_0x6027('0x6e'))[_0x6027('0x6f')](_0x6027('0x70'),'tq')[_0x6027('0x71')](_0x6027('0x72'),'ut',_0x6027('0x73'))[_0x6027('0x3d')](_0x6027('0x74'),_0x440e72['params']['id']);for(var _0x2c3711=0x0;_0x2c3711<_0x29926c[_0x6027('0x48')];_0x2c3711+=0x1){let _0x3db67b=_0x29926c[_0x2c3711];for(var _0x578cac=0x0;_0x578cac<_0x3db67b['Agents']['length'];_0x578cac+=0x1){let _0x31dd1f=_0x3db67b[_0x6027('0x62')][_0x578cac];var _0x32b064=_0x297733[_0x6027('0x75')]();_0x32b064[_0x6027('0x3d')](_0x6027('0x76'),_0x31dd1f['id']);_0xdf65da[_0x6027('0x77')](db['sequelize'][_0x6027('0x34')](_0x32b064['toString'](),{'type':db[_0x6027('0x65')][_0x6027('0x78')][_0x6027('0x79')]})[_0x6027('0x25')](function(_0x5c377c){if(_0x5c377c[_0x6027('0x48')]===0x1){return _0x31dd1f['id'];}else{var _0x4c10cf=_['every'](_['map'](_0x5c377c,_0x6027('0x7a')),function(_0x5cc76a){return _['includes'](_0x12e4d3,_0x5cc76a);});if(_0x4c10cf){return _0x31dd1f['id'];}}}));}}return BPromise[_0x6027('0x7b')](_0xdf65da)[_0x6027('0x25')](function(_0x2aa12c){_0x41e07e=_(_0x41e07e)[_0x6027('0x7c')](_0x2aa12c)[_0x6027('0x7d')]()[_0x6027('0x7e')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x440e72[_0x6027('0x47')]['id']}})['then'](function(_0x40bdc1){return db[_0x6027('0x65')][_0x6027('0x66')](function(_0x5eee29){return _0x40bdc1['removeTeams'](_0x440e72[_0x6027('0x34')][_0x6027('0x61')],{'transaction':_0x5eee29})[_0x6027('0x25')](function(){if(!_[_0x6027('0x7f')](_0x41e07e)){return _0x40bdc1[_0x6027('0x80')](_0x41e07e,{'transaction':_0x5eee29});}})[_0x6027('0x25')](function(){_0x41e07e[_0x6027('0x69')](function(_0x1064b6){socket[_0x6027('0x81')](_0x6027('0x82'),{'UserId':_0x1064b6,'OpenchannelQueueId':_0x40bdc1['id']});});});});});});})[_0x6027('0x25')](respondWithStatusCode(_0x598e27,null))[_0x6027('0x46')](handleError(_0x598e27,null));};exports[_0x6027('0x83')]=function(_0xf8dc6a,_0x4ac9a1,_0x1e2861){return db[_0x6027('0x2d')][_0x6027('0x49')]({'where':{'id':_0xf8dc6a[_0x6027('0x47')]['id']}})[_0x6027('0x25')](handleEntityNotFound(_0x4ac9a1,null))['then'](function(_0x3270a2){if(_0x3270a2){return _0x3270a2['addAgents'](_0xf8dc6a[_0x6027('0x51')][_0x6027('0x61')],_[_0x6027('0x84')](_0xf8dc6a[_0x6027('0x51')],['ids','id'])||{})[_0x6027('0x85')](function(_0x15db24){for(var _0x130076=0x0;_0x130076<_0xf8dc6a[_0x6027('0x51')][_0x6027('0x61')][_0x6027('0x48')];_0x130076+=0x1){socket[_0x6027('0x81')](_0x6027('0x6a'),{'UserId':_0xf8dc6a[_0x6027('0x51')][_0x6027('0x61')][_0x130076],'OpenchannelQueueId':_0xf8dc6a[_0x6027('0x47')]['id']});}return _0x15db24;});}})[_0x6027('0x25')](respondWithResult(_0x4ac9a1,null))['catch'](handleError(_0x4ac9a1,null));};exports['removeAgents']=function(_0x5ca38e,_0x4a2e46,_0x2263f1){return db[_0x6027('0x2d')][_0x6027('0x49')]({'where':{'id':_0x5ca38e[_0x6027('0x47')]['id']}})[_0x6027('0x25')](handleEntityNotFound(_0x4a2e46,null))['then'](function(_0x237a7e){if(_0x237a7e){return _0x237a7e[_0x6027('0x80')](_0x5ca38e[_0x6027('0x34')]['ids'])['then'](function(){if(_[_0x6027('0x86')](_0x5ca38e['query'][_0x6027('0x61')])){for(var _0x233072=0x0;_0x233072<_0x5ca38e[_0x6027('0x34')][_0x6027('0x61')][_0x6027('0x48')];_0x233072+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x5ca38e[_0x6027('0x34')]['ids'][_0x233072]),'OpenchannelQueueId':Number(_0x5ca38e[_0x6027('0x47')]['id'])});}}else{socket[_0x6027('0x81')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5ca38e[_0x6027('0x34')][_0x6027('0x61')]),'OpenchannelQueueId':Number(_0x5ca38e[_0x6027('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a2e46,null))[_0x6027('0x46')](handleError(_0x4a2e46,null));};exports[_0x6027('0x87')]=function(_0x55833a,_0x25aa4e,_0x5be7ac){var _0xb606ed={};var _0x158dd7={};var _0x1f180b;var _0x4dd1a7;return db['OpenchannelQueue'][_0x6027('0x5e')]({'where':{'id':_0x55833a[_0x6027('0x47')]['id']}})['then'](handleEntityNotFound(_0x25aa4e,null))[_0x6027('0x25')](function(_0x4bf14b){if(_0x4bf14b){_0x1f180b=_0x4bf14b;_0x158dd7['model']=_[_0x6027('0x33')](db['User'][_0x6027('0x2e')]);_0x158dd7[_0x6027('0x34')]=_[_0x6027('0x33')](_0x55833a[_0x6027('0x34')]);_0x158dd7[_0x6027('0x35')]=_[_0x6027('0x36')](_0x158dd7['model'],_0x158dd7[_0x6027('0x34')]);_0xb606ed[_0x6027('0x37')]=_[_0x6027('0x36')](_0x158dd7[_0x6027('0x32')],qs[_0x6027('0x38')](_0x55833a[_0x6027('0x34')]['fields']));_0xb606ed['attributes']=_0xb606ed[_0x6027('0x37')]['length']?_0xb606ed[_0x6027('0x37')]:_0x158dd7[_0x6027('0x32')];_0xb606ed['order']=qs['sort'](_0x55833a['query'][_0x6027('0x3c')]);_0xb606ed[_0x6027('0x3d')]=qs['filters'](_[_0x6027('0x3e')](_0x55833a[_0x6027('0x34')],_0x158dd7[_0x6027('0x35')]));if(_0x55833a[_0x6027('0x34')][_0x6027('0x3f')]){_0xb606ed[_0x6027('0x3d')]=_['merge'](_0xb606ed[_0x6027('0x3d')],{'$or':_[_0x6027('0x2c')](_0xb606ed['attributes'],function(_0x4c50b2){var _0x39895={};_0x39895[_0x4c50b2]={'$like':'%'+_0x55833a[_0x6027('0x34')][_0x6027('0x3f')]+'%'};return _0x39895;})});}_0xb606ed=_[_0x6027('0x41')]({},_0xb606ed,_0x55833a[_0x6027('0x42')]);return _0x1f180b[_0x6027('0x87')](_0xb606ed);}})['then'](function(_0x145aa5){if(_0x145aa5){_0x4dd1a7=_0x145aa5[_0x6027('0x48')];if(!_0x55833a[_0x6027('0x34')]['hasOwnProperty'](_0x6027('0x3a'))){_0xb606ed['limit']=qs[_0x6027('0x1d')](_0x55833a['query'][_0x6027('0x1d')]);_0xb606ed[_0x6027('0x1c')]=qs[_0x6027('0x1c')](_0x55833a['query'][_0x6027('0x1c')]);}return _0x1f180b['getAgents'](_0xb606ed);}})[_0x6027('0x25')](function(_0x5e6e7b){if(_0x5e6e7b){return _0x5e6e7b?{'count':_0x4dd1a7,'rows':_0x5e6e7b}:null;}})['then'](respondWithResult(_0x25aa4e,null))[_0x6027('0x46')](handleError(_0x25aa4e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index da17832..4a9fd6b 100644 --- a/server/api/openchannelQueue/openchannelQueue.events.js +++ b/server/api/openchannelQueue/openchannelQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93b0=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93b0,0x16d));var _0x093b=function(_0x40e361,_0x55210b){_0x40e361=_0x40e361-0x0;var _0x36ac99=_0x93b0[_0x40e361];return _0x36ac99;};'use strict';var EventEmitter=require(_0x093b('0x0'));var OpenchannelQueue=require(_0x093b('0x1'))['db'][_0x093b('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x093b('0x3')](0x0);var events={'afterCreate':_0x093b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5d84f3){return function(_0x43498a,_0x55ee86,_0x167b8c){OpenchannelQueueEvents[_0x093b('0x5')](_0x5d84f3+':'+_0x43498a['id'],_0x43498a);OpenchannelQueueEvents[_0x093b('0x5')](_0x5d84f3,_0x43498a);_0x167b8c(null);};}for(var e in events){if(events[_0x093b('0x6')](e)){var event=events[e];OpenchannelQueue[_0x093b('0x7')](e,emitEvent(event));}}module[_0x093b('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x8dd8=['save','remove','emit','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x196d7,_0x3679c2){var _0x29f093=function(_0x29a89f){while(--_0x29a89f){_0x196d7['push'](_0x196d7['shift']());}};_0x29f093(++_0x3679c2);}(_0x8dd8,0x14c));var _0x88dd=function(_0x4c7e7f,_0x3335c6){_0x4c7e7f=_0x4c7e7f-0x0;var _0x26c35e=_0x8dd8[_0x4c7e7f];return _0x26c35e;};'use strict';var EventEmitter=require(_0x88dd('0x0'));var OpenchannelQueue=require(_0x88dd('0x1'))['db'][_0x88dd('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x88dd('0x3')](0x0);var events={'afterCreate':_0x88dd('0x4'),'afterUpdate':'update','afterDestroy':_0x88dd('0x5')};function emitEvent(_0x38ddbd){return function(_0x4d3c39,_0x36f15b,_0x1f14f3){OpenchannelQueueEvents[_0x88dd('0x6')](_0x38ddbd+':'+_0x4d3c39['id'],_0x4d3c39);OpenchannelQueueEvents[_0x88dd('0x6')](_0x38ddbd,_0x4d3c39);_0x1f14f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x88dd('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index c54f073..ee64b2f 100644 --- a/server/api/openchannelQueue/openchannelQueue.model.js +++ b/server/api/openchannelQueue/openchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2b4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x49cd8e,_0x3c745f){var _0x43f139=function(_0x40545c){while(--_0x40545c){_0x49cd8e['push'](_0x49cd8e['shift']());}};_0x43f139(++_0x3c745f);}(_0xe2b4,0x1d3));var _0x4e2b=function(_0x218224,_0x1f0d85){_0x218224=_0x218224-0x0;var _0x295149=_0xe2b4[_0x218224];return _0x295149;};'use strict';var _=require(_0x4e2b('0x0'));var util=require('util');var logger=require(_0x4e2b('0x1'))(_0x4e2b('0x2'));var moment=require(_0x4e2b('0x3'));var BPromise=require(_0x4e2b('0x4'));var rp=require(_0x4e2b('0x5'));var fs=require('fs');var path=require(_0x4e2b('0x6'));var rimraf=require(_0x4e2b('0x7'));var config=require(_0x4e2b('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0x4e2b('0x9')]=function(_0x1fffcd,_0x85b152){return _0x1fffcd[_0x4e2b('0xa')](_0x4e2b('0xb'),attributes,{'tableName':_0x4e2b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34ab=['api','moment','bluebird','request-promise','path','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0xa3eb88,_0x2e6f02){var _0x2d6a6b=function(_0x97988b){while(--_0x97988b){_0xa3eb88['push'](_0xa3eb88['shift']());}};_0x2d6a6b(++_0x2e6f02);}(_0x34ab,0x169));var _0xb34a=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0x34ab[_0x4551f6];return _0x581dc2;};'use strict';var _=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var logger=require(_0xb34a('0x2'))(_0xb34a('0x3'));var moment=require(_0xb34a('0x4'));var BPromise=require(_0xb34a('0x5'));var rp=require(_0xb34a('0x6'));var fs=require('fs');var path=require(_0xb34a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb34a('0x8'));module[_0xb34a('0x9')]=function(_0x14a0b7,_0x528d48){return _0x14a0b7[_0xb34a('0xa')](_0xb34a('0xb'),attributes,{'tableName':_0xb34a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index e332e35..1e13a40 100644 --- a/server/api/openchannelQueue/openchannelQueue.rpc.js +++ b/server/api/openchannelQueue/openchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c3a=['http','defaults','redis','socket.io-emitter','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueue','options','include','map','model','attributes','info','GetOpenchannelQueue','find','raw','where','debug','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x241b59,_0x4c1d6f){var _0x56f450=function(_0x4e5c18){while(--_0x4e5c18){_0x241b59['push'](_0x241b59['shift']());}};_0x56f450(++_0x4c1d6f);}(_0x6c3a,0x10d));var _0xa6c3=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0x6c3a[_0x25bca6];return _0x3f8d02;};'use strict';var _=require(_0xa6c3('0x0'));var util=require(_0xa6c3('0x1'));var moment=require(_0xa6c3('0x2'));var BPromise=require(_0xa6c3('0x3'));var rs=require(_0xa6c3('0x4'));var fs=require('fs');var Redis=require(_0xa6c3('0x5'));var db=require(_0xa6c3('0x6'))['db'];var utils=require(_0xa6c3('0x7'));var logger=require(_0xa6c3('0x8'))(_0xa6c3('0x9'));var config=require('../../config/environment');var jayson=require(_0xa6c3('0xa'));var client=jayson['client'][_0xa6c3('0xb')]({'port':0x232a});config['redis']=_[_0xa6c3('0xc')](config[_0xa6c3('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa6c3('0xe'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xa6c3('0xf')](socket);function respondWithRpcPromise(_0x3f97cd,_0x54930a,_0x254509){return new BPromise(function(_0x271ccd,_0x419564){return client[_0xa6c3('0x10')](_0x3f97cd,_0x254509)[_0xa6c3('0x11')](function(_0xcb1ffc){logger['info'](_0xa6c3('0x12'),_0x54930a,_0xa6c3('0x13'));logger['debug'](_0xa6c3('0x14'),_0x54930a,_0xa6c3('0x13'),JSON[_0xa6c3('0x15')](_0xcb1ffc));if(_0xcb1ffc['error']){if(_0xcb1ffc[_0xa6c3('0x16')][_0xa6c3('0x17')]===0x1f4){logger[_0xa6c3('0x16')](_0xa6c3('0x12'),_0x54930a,_0xcb1ffc[_0xa6c3('0x16')][_0xa6c3('0x18')]);return _0x419564(_0xcb1ffc[_0xa6c3('0x16')][_0xa6c3('0x18')]);}logger[_0xa6c3('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x54930a,_0xcb1ffc[_0xa6c3('0x16')]['message']);return _0x271ccd(_0xcb1ffc[_0xa6c3('0x16')][_0xa6c3('0x18')]);}else{logger['info'](_0xa6c3('0x12'),_0x54930a,_0xa6c3('0x13'));_0x271ccd(_0xcb1ffc[_0xa6c3('0x19')][_0xa6c3('0x18')]);}})[_0xa6c3('0x1a')](function(_0x306996){logger[_0xa6c3('0x16')](_0xa6c3('0x12'),_0x54930a,_0x306996);_0x419564(_0x306996);});});}exports['GetOpenchannelQueue']=function(_0x4746cf){var _0x3b84ed=this;return new Promise(function(_0x1c8f33,_0x1c8a8a){return db[_0xa6c3('0x1b')]['findAll']({'raw':_0x4746cf[_0xa6c3('0x1c')]?_0x4746cf[_0xa6c3('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4746cf['options']?_0x4746cf[_0xa6c3('0x1c')]['where']||null:null,'attributes':_0x4746cf[_0xa6c3('0x1c')]?_0x4746cf[_0xa6c3('0x1c')]['attributes']||null:null,'limit':_0x4746cf[_0xa6c3('0x1c')]?_0x4746cf[_0xa6c3('0x1c')]['limit']||null:null,'include':_0x4746cf[_0xa6c3('0x1c')]?_0x4746cf[_0xa6c3('0x1c')][_0xa6c3('0x1d')]?_[_0xa6c3('0x1e')](_0x4746cf[_0xa6c3('0x1c')][_0xa6c3('0x1d')],function(_0x35181a){return{'model':db[_0x35181a[_0xa6c3('0x1f')]],'as':_0x35181a['as'],'attributes':_0x35181a['attributes'],'include':_0x35181a[_0xa6c3('0x1d')]?_['map'](_0x35181a[_0xa6c3('0x1d')],function(_0x17cc9d){return{'model':db[_0x17cc9d['model']],'as':_0x17cc9d['as'],'attributes':_0x17cc9d['attributes'],'include':_0x17cc9d[_0xa6c3('0x1d')]?_[_0xa6c3('0x1e')](_0x17cc9d[_0xa6c3('0x1d')],function(_0x44a59e){return{'model':db[_0x44a59e[_0xa6c3('0x1f')]],'as':_0x44a59e['as'],'attributes':_0x44a59e[_0xa6c3('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa6c3('0x11')](function(_0x4e1a65){logger[_0xa6c3('0x21')](_0xa6c3('0x22'),_0x4746cf);logger['debug']('GetOpenchannelQueue',_0x4746cf,JSON[_0xa6c3('0x15')](_0x4e1a65));_0x1c8f33(_0x4e1a65);})[_0xa6c3('0x1a')](function(_0x1210ed){logger[_0xa6c3('0x16')](_0xa6c3('0x22'),_0x1210ed[_0xa6c3('0x18')],_0x4746cf);_0x1c8a8a(_0x3b84ed[_0xa6c3('0x16')](0x1f4,_0x1210ed[_0xa6c3('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x41387c){var _0x31f9e2=this;return new Promise(function(_0x404ce9,_0x543ff0){return db[_0xa6c3('0x1b')][_0xa6c3('0x23')]({'raw':_0x41387c[_0xa6c3('0x1c')]?_0x41387c[_0xa6c3('0x1c')][_0xa6c3('0x24')]===undefined?!![]:![]:!![],'where':_0x41387c[_0xa6c3('0x1c')]?_0x41387c['options'][_0xa6c3('0x25')]||null:null,'attributes':_0x41387c[_0xa6c3('0x1c')]?_0x41387c[_0xa6c3('0x1c')]['attributes']||null:null,'include':_0x41387c['options']?_0x41387c[_0xa6c3('0x1c')][_0xa6c3('0x1d')]?_['map'](_0x41387c[_0xa6c3('0x1c')]['include'],function(_0xfd674e){return{'model':db[_0xfd674e['model']],'as':_0xfd674e['as'],'attributes':_0xfd674e['attributes'],'include':_0xfd674e[_0xa6c3('0x1d')]?_[_0xa6c3('0x1e')](_0xfd674e[_0xa6c3('0x1d')],function(_0x5845b7){return{'model':db[_0x5845b7['model']],'as':_0x5845b7['as'],'attributes':_0x5845b7[_0xa6c3('0x20')],'include':_0x5845b7[_0xa6c3('0x1d')]?_[_0xa6c3('0x1e')](_0x5845b7[_0xa6c3('0x1d')],function(_0x8dc3b7){return{'model':db[_0x8dc3b7['model']],'as':_0x8dc3b7['as'],'attributes':_0x8dc3b7[_0xa6c3('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa6c3('0x11')](function(_0x54e662){logger['info']('ShowOpenchannelQueue',_0x41387c);logger[_0xa6c3('0x26')]('ShowOpenchannelQueue',_0x41387c,JSON[_0xa6c3('0x15')](_0x54e662));_0x404ce9(_0x54e662);})['catch'](function(_0xcf1b17){logger[_0xa6c3('0x16')](_0xa6c3('0x27'),_0xcf1b17[_0xa6c3('0x18')],_0x41387c);_0x543ff0(_0x31f9e2['error'](0x1f4,_0xcf1b17[_0xa6c3('0x18')]));});});}; \ No newline at end of file +var _0xb69f=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetOpenchannelQueue','debug','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x312b06,_0x5ad05e){var _0x54dd60=function(_0x837599){while(--_0x837599){_0x312b06['push'](_0x312b06['shift']());}};_0x54dd60(++_0x5ad05e);}(_0xb69f,0x193));var _0xfb69=function(_0x583209,_0x10f795){_0x583209=_0x583209-0x0;var _0x14f8cf=_0xb69f[_0x583209];return _0x14f8cf;};'use strict';var _=require(_0xfb69('0x0'));var util=require('util');var moment=require(_0xfb69('0x1'));var BPromise=require(_0xfb69('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb69('0x3'));var db=require(_0xfb69('0x4'))['db'];var utils=require(_0xfb69('0x5'));var logger=require(_0xfb69('0x6'))('rpc');var config=require(_0xfb69('0x7'));var jayson=require(_0xfb69('0x8'));var client=jayson[_0xfb69('0x9')][_0xfb69('0xa')]({'port':0x232a});config[_0xfb69('0xb')]=_[_0xfb69('0xc')](config['redis'],{'host':_0xfb69('0xd'),'port':0x18eb});var socket=require(_0xfb69('0xe'))(new Redis(config[_0xfb69('0xb')]));require('./openchannelQueue.socket')[_0xfb69('0xf')](socket);function respondWithRpcPromise(_0xb8d62d,_0x1f6c5f,_0x23a35a){return new BPromise(function(_0x4e484d,_0x22e682){return client['request'](_0xb8d62d,_0x23a35a)[_0xfb69('0x10')](function(_0x4a6d53){logger[_0xfb69('0x11')](_0xfb69('0x12'),_0x1f6c5f,_0xfb69('0x13'));logger['debug'](_0xfb69('0x14'),_0x1f6c5f,_0xfb69('0x13'),JSON[_0xfb69('0x15')](_0x4a6d53));if(_0x4a6d53['error']){if(_0x4a6d53[_0xfb69('0x16')][_0xfb69('0x17')]===0x1f4){logger[_0xfb69('0x16')](_0xfb69('0x12'),_0x1f6c5f,_0x4a6d53['error']['message']);return _0x22e682(_0x4a6d53[_0xfb69('0x16')][_0xfb69('0x18')]);}logger['error'](_0xfb69('0x12'),_0x1f6c5f,_0x4a6d53[_0xfb69('0x16')]['message']);return _0x4e484d(_0x4a6d53['error'][_0xfb69('0x18')]);}else{logger[_0xfb69('0x11')](_0xfb69('0x12'),_0x1f6c5f,_0xfb69('0x13'));_0x4e484d(_0x4a6d53[_0xfb69('0x19')][_0xfb69('0x18')]);}})[_0xfb69('0x1a')](function(_0x5b2a07){logger['error'](_0xfb69('0x12'),_0x1f6c5f,_0x5b2a07);_0x22e682(_0x5b2a07);});});}exports['GetOpenchannelQueue']=function(_0x554437){var _0x209c0b=this;return new Promise(function(_0x468dd3,_0x322664){return db['OpenchannelQueue'][_0xfb69('0x1b')]({'raw':_0x554437[_0xfb69('0x1c')]?_0x554437[_0xfb69('0x1c')][_0xfb69('0x1d')]===undefined?!![]:![]:!![],'where':_0x554437[_0xfb69('0x1c')]?_0x554437['options'][_0xfb69('0x1e')]||null:null,'attributes':_0x554437[_0xfb69('0x1c')]?_0x554437[_0xfb69('0x1c')][_0xfb69('0x1f')]||null:null,'limit':_0x554437[_0xfb69('0x1c')]?_0x554437[_0xfb69('0x1c')][_0xfb69('0x20')]||null:null,'include':_0x554437['options']?_0x554437[_0xfb69('0x1c')]['include']?_[_0xfb69('0x21')](_0x554437[_0xfb69('0x1c')][_0xfb69('0x22')],function(_0x53da27){return{'model':db[_0x53da27[_0xfb69('0x23')]],'as':_0x53da27['as'],'attributes':_0x53da27['attributes'],'include':_0x53da27['include']?_[_0xfb69('0x21')](_0x53da27[_0xfb69('0x22')],function(_0x459711){return{'model':db[_0x459711['model']],'as':_0x459711['as'],'attributes':_0x459711[_0xfb69('0x1f')],'include':_0x459711['include']?_['map'](_0x459711['include'],function(_0x1e5bd7){return{'model':db[_0x1e5bd7[_0xfb69('0x23')]],'as':_0x1e5bd7['as'],'attributes':_0x1e5bd7[_0xfb69('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb69('0x10')](function(_0x36448a){logger[_0xfb69('0x11')](_0xfb69('0x24'),_0x554437);logger[_0xfb69('0x25')](_0xfb69('0x24'),_0x554437,JSON[_0xfb69('0x15')](_0x36448a));_0x468dd3(_0x36448a);})[_0xfb69('0x1a')](function(_0x1e5b81){logger['error'](_0xfb69('0x24'),_0x1e5b81[_0xfb69('0x18')],_0x554437);_0x322664(_0x209c0b[_0xfb69('0x16')](0x1f4,_0x1e5b81[_0xfb69('0x18')]));});});};exports[_0xfb69('0x26')]=function(_0x44555f){var _0x584883=this;return new Promise(function(_0x5bcda4,_0x56b2cd){return db[_0xfb69('0x27')][_0xfb69('0x28')]({'raw':_0x44555f[_0xfb69('0x1c')]?_0x44555f[_0xfb69('0x1c')][_0xfb69('0x1d')]===undefined?!![]:![]:!![],'where':_0x44555f[_0xfb69('0x1c')]?_0x44555f['options'][_0xfb69('0x1e')]||null:null,'attributes':_0x44555f['options']?_0x44555f['options'][_0xfb69('0x1f')]||null:null,'include':_0x44555f[_0xfb69('0x1c')]?_0x44555f[_0xfb69('0x1c')][_0xfb69('0x22')]?_[_0xfb69('0x21')](_0x44555f[_0xfb69('0x1c')][_0xfb69('0x22')],function(_0x4fd6f7){return{'model':db[_0x4fd6f7[_0xfb69('0x23')]],'as':_0x4fd6f7['as'],'attributes':_0x4fd6f7[_0xfb69('0x1f')],'include':_0x4fd6f7[_0xfb69('0x22')]?_[_0xfb69('0x21')](_0x4fd6f7[_0xfb69('0x22')],function(_0x436ab1){return{'model':db[_0x436ab1[_0xfb69('0x23')]],'as':_0x436ab1['as'],'attributes':_0x436ab1[_0xfb69('0x1f')],'include':_0x436ab1[_0xfb69('0x22')]?_[_0xfb69('0x21')](_0x436ab1[_0xfb69('0x22')],function(_0x329ee8){return{'model':db[_0x329ee8['model']],'as':_0x329ee8['as'],'attributes':_0x329ee8[_0xfb69('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb69('0x10')](function(_0x4a22c1){logger['info'](_0xfb69('0x26'),_0x44555f);logger[_0xfb69('0x25')](_0xfb69('0x26'),_0x44555f,JSON['stringify'](_0x4a22c1));_0x5bcda4(_0x4a22c1);})[_0xfb69('0x1a')](function(_0x4059d9){logger[_0xfb69('0x16')](_0xfb69('0x26'),_0x4059d9['message'],_0x44555f);_0x56b2cd(_0x584883[_0xfb69('0x16')](0x1f4,_0x4059d9[_0xfb69('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b582201..76cc38f 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa13d=['length','remove','update','register'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xa13d,0xc9));var _0xda13=function(_0x1d4463,_0x251a2c){_0x1d4463=_0x1d4463-0x0;var _0x371edc=_0xa13d[_0x1d4463];return _0x371edc;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xda13('0x0'),_0xda13('0x1')];function createListener(_0x3c0c40,_0x57c0f9){return function(_0x5af302){_0x57c0f9['emit'](_0x3c0c40,_0x5af302);};}function removeListener(_0x452d08,_0x3a1a5b){return function(){OpenchannelQueueEvents['removeListener'](_0x452d08,_0x3a1a5b);};}exports[_0xda13('0x2')]=function(_0x57ffe8){for(var _0x22155f=0x0,_0x3fbfd5=events[_0xda13('0x3')];_0x22155f<_0x3fbfd5;_0x22155f++){var _0x39c650=events[_0x22155f];var _0x378cba=createListener('openchannelQueue:'+_0x39c650,_0x57ffe8);OpenchannelQueueEvents['on'](_0x39c650,_0x378cba);}}; \ No newline at end of file +var _0x4a93=['save','remove','emit'];(function(_0x41390c,_0x253f50){var _0x1f2cb0=function(_0x16dfe6){while(--_0x16dfe6){_0x41390c['push'](_0x41390c['shift']());}};_0x1f2cb0(++_0x253f50);}(_0x4a93,0xde));var _0x34a9=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4a93[_0x5d6456];return _0x4d66c1;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x34a9('0x0'),_0x34a9('0x1'),'update'];function createListener(_0x372fe5,_0x7f5d){return function(_0x2e282b){_0x7f5d[_0x34a9('0x2')](_0x372fe5,_0x2e282b);};}function removeListener(_0x1cffe7,_0x26e870){return function(){OpenchannelQueueEvents['removeListener'](_0x1cffe7,_0x26e870);};}exports['register']=function(_0x294bdd){for(var _0x38ee52=0x0,_0x548a79=events['length'];_0x38ee52<_0x548a79;_0x38ee52++){var _0x3534af=events[_0x38ee52];var _0x411f5e=createListener('openchannelQueue:'+_0x3534af,_0x294bdd);OpenchannelQueueEvents['on'](_0x3534af,_0x411f5e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 0deeac0..2a7cb92 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','/:id','isAuthenticated','post','put','delete','exports','multer','util','connect-timeout'];(function(_0x2fcf9d,_0x86df01){var _0xd948a=function(_0x1d4d2c){while(--_0x1d4d2c){_0x2fcf9d['push'](_0x2fcf9d['shift']());}};_0xd948a(++_0x86df01);}(_0x8cab,0x13d));var _0xb8ca=function(_0x417dc7,_0x37ab2b){_0x417dc7=_0x417dc7-0x0;var _0x2f00cc=_0x8cab[_0x417dc7];return _0x2f00cc;};'use strict';var multer=require(_0xb8ca('0x0'));var util=require(_0xb8ca('0x1'));var path=require('path');var timeout=require(_0xb8ca('0x2'));var express=require(_0xb8ca('0x3'));var router=express[_0xb8ca('0x4')]();var auth=require(_0xb8ca('0x5'));var interaction=require(_0xb8ca('0x6'));var config=require(_0xb8ca('0x7'));var controller=require(_0xb8ca('0x8'));router[_0xb8ca('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb8ca('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb8ca('0x9')](_0xb8ca('0xa'),auth[_0xb8ca('0xb')](),controller['show']);router[_0xb8ca('0xc')]('/',auth[_0xb8ca('0xb')](),controller['create']);router[_0xb8ca('0xd')]('/:id',auth[_0xb8ca('0xb')](),controller['update']);router[_0xb8ca('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb8ca('0xf')]=router; \ No newline at end of file +var _0x0b5d=['index','/describe','describe','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','isAuthenticated'];(function(_0x2a88c9,_0x4d2b20){var _0x378268=function(_0x111151){while(--_0x111151){_0x2a88c9['push'](_0x2a88c9['shift']());}};_0x378268(++_0x4d2b20);}(_0x0b5d,0x1ec));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd0b5('0x0'));var util=require(_0xd0b5('0x1'));var path=require('path');var timeout=require(_0xd0b5('0x2'));var express=require('express');var router=express[_0xd0b5('0x3')]();var auth=require(_0xd0b5('0x4'));var interaction=require(_0xd0b5('0x5'));var config=require('../../config/environment');var controller=require(_0xd0b5('0x6'));router['get']('/',auth[_0xd0b5('0x7')](),controller[_0xd0b5('0x8')]);router['get'](_0xd0b5('0x9'),auth[_0xd0b5('0x7')](),controller[_0xd0b5('0xa')]);router[_0xd0b5('0xb')](_0xd0b5('0xc'),auth[_0xd0b5('0x7')](),controller[_0xd0b5('0xd')]);router[_0xd0b5('0xe')]('/',auth[_0xd0b5('0x7')](),controller[_0xd0b5('0xf')]);router[_0xd0b5('0x10')](_0xd0b5('0xc'),auth[_0xd0b5('0x7')](),controller['update']);router[_0xd0b5('0x11')](_0xd0b5('0xc'),auth[_0xd0b5('0x7')](),controller[_0xd0b5('0x12')]);module[_0xd0b5('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2a87489..3e81c77 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae79=['STRING','DATE','moment','sequelize'];(function(_0x595cc4,_0x4f535d){var _0xe13592=function(_0x36a96d){while(--_0x36a96d){_0x595cc4['push'](_0x595cc4['shift']());}};_0xe13592(++_0x4f535d);}(_0xae79,0x1ba));var _0x9ae7=function(_0x2be2cd,_0x3b6590){_0x2be2cd=_0x2be2cd-0x0;var _0x4243e5=_0xae79[_0x2be2cd];return _0x4243e5;};'use strict';var moment=require(_0x9ae7('0x0'));var Sequelize=require(_0x9ae7('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9ae7('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9ae7('0x3')]},'leaveAt':{'type':Sequelize[_0x9ae7('0x3')]},'acceptAt':{'type':Sequelize[_0x9ae7('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9ae7('0x2')]}}; \ No newline at end of file +var _0xa58c=['moment','sequelize','exports','STRING','DATE'];(function(_0x42c040,_0x31b07f){var _0x127a14=function(_0x1867ef){while(--_0x1867ef){_0x42c040['push'](_0x42c040['shift']());}};_0x127a14(++_0x31b07f);}(_0xa58c,0xc3));var _0xca58=function(_0x5c6ed0,_0x692fc4){_0x5c6ed0=_0x5c6ed0-0x0;var _0x310a03=_0xa58c[_0x5c6ed0];return _0x310a03;};'use strict';var moment=require(_0xca58('0x0'));var Sequelize=require(_0xca58('0x1'));module[_0xca58('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xca58('0x3')]},'joinAt':{'type':Sequelize[_0xca58('0x4')]},'leaveAt':{'type':Sequelize[_0xca58('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xca58('0x4')]},'reason':{'type':Sequelize[_0xca58('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b468868..20a46c2 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4815=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','apply','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','catch','show','params','intersection','include','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1e66c4,_0x15e7e2){var _0x493540=function(_0x12e329){while(--_0x12e329){_0x1e66c4['push'](_0x1e66c4['shift']());}};_0x493540(++_0x15e7e2);}(_0x4815,0xff));var _0x5481=function(_0x81b6dd,_0x2fcbab){_0x81b6dd=_0x81b6dd-0x0;var _0x12e1a3=_0x4815[_0x81b6dd];return _0x12e1a3;};'use strict';var pdf=require(_0x5481('0x0'));var emlformat=require(_0x5481('0x1'));var rimraf=require(_0x5481('0x2'));var zipdir=require(_0x5481('0x3'));var jsonpatch=require(_0x5481('0x4'));var rp=require(_0x5481('0x5'));var moment=require(_0x5481('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5481('0x7'));var path=require(_0x5481('0x8'));var sox=require(_0x5481('0x9'));var csv=require(_0x5481('0xa'));var ejs=require(_0x5481('0xb'));var fs=require('fs');var _=require(_0x5481('0xc'));var squel=require(_0x5481('0xd'));var crypto=require(_0x5481('0xe'));var jsforce=require(_0x5481('0xf'));var deskjs=require(_0x5481('0x10'));var toCsv=require(_0x5481('0xa'));var querystring=require(_0x5481('0x11'));var Papa=require(_0x5481('0x12'));var Redis=require(_0x5481('0x13'));var authService=require(_0x5481('0x14'));var qs=require(_0x5481('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5481('0x16'))(_0x5481('0x17'));var utils=require(_0x5481('0x18'));var config=require(_0x5481('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd75bec,_0x5645c5){_0x5645c5=_0x5645c5||0xcc;return function(_0x34f04a){if(_0x34f04a){return _0xd75bec[_0x5481('0x1a')](_0x5645c5);}return _0xd75bec[_0x5481('0x1b')](_0x5645c5)['end']();};}function respondWithResult(_0x17569e,_0x5e9ec1){_0x5e9ec1=_0x5e9ec1||0xc8;return function(_0x18dc20){if(_0x18dc20){return _0x17569e[_0x5481('0x1b')](_0x5e9ec1)[_0x5481('0x1c')](_0x18dc20);}};}function respondWithFilteredResult(_0x3f839f,_0x24ee7a){return function(_0x35d490){if(_0x35d490){var _0x31b8c9=_0x35d490['count'],_0x2deceb=_0x24ee7a[_0x5481('0x1d')],_0x667928=_0x24ee7a[_0x5481('0x1d')]+_0x24ee7a[_0x5481('0x1e')],_0x981a4d;if(_0x667928>=_0x31b8c9){_0x667928=_0x31b8c9;_0x981a4d=0xc8;}else{_0x981a4d=0xce;}_0x3f839f['status'](_0x981a4d);return _0x3f839f['set']('Content-Range',_0x2deceb+'-'+_0x667928+'/'+_0x31b8c9)['json'](_0x35d490);}return null;};}function patchUpdates(_0x3b3a11){return function(_0x23319a){try{jsonpatch[_0x5481('0x1f')](_0x23319a,_0x3b3a11,!![]);}catch(_0x4acda2){return BPromise['reject'](_0x4acda2);}return _0x23319a['save']();};}function saveUpdates(_0x2ec488,_0x277bd1){return function(_0x272ef4){if(_0x272ef4){return _0x272ef4[_0x5481('0x20')](_0x2ec488)[_0x5481('0x21')](function(_0x1b18d2){return _0x1b18d2;});}return null;};}function removeEntity(_0xd7b006,_0x3e70a3){return function(_0x30c183){if(_0x30c183){return _0x30c183[_0x5481('0x22')]()[_0x5481('0x21')](function(){_0xd7b006['status'](0xcc)[_0x5481('0x23')]();});}};}function handleEntityNotFound(_0x4c86d5,_0x321b28){return function(_0x3b3451){if(!_0x3b3451){_0x4c86d5[_0x5481('0x1a')](0x194);}return _0x3b3451;};}function handleError(_0x3093b4,_0x31ba21){_0x31ba21=_0x31ba21||0x1f4;return function(_0x36b19b){logger[_0x5481('0x24')](_0x36b19b[_0x5481('0x25')]);if(_0x36b19b[_0x5481('0x26')]){delete _0x36b19b['name'];}_0x3093b4['status'](_0x31ba21)[_0x5481('0x27')](_0x36b19b);};}exports[_0x5481('0x28')]=function(_0x47e722,_0x1ed0f7){var _0x16730b={},_0x145baf={},_0x39dc47={'count':0x0,'rows':[]};var _0x36c81a=_[_0x5481('0x29')](db[_0x5481('0x2a')][_0x5481('0x2b')],function(_0x347cac){return{'name':_0x347cac['fieldName'],'type':_0x347cac[_0x5481('0x2c')][_0x5481('0x2d')]};});_0x145baf[_0x5481('0x2e')]=_[_0x5481('0x29')](_0x36c81a,_0x5481('0x26'));_0x145baf[_0x5481('0x2f')]=_[_0x5481('0x30')](_0x47e722['query']);_0x145baf[_0x5481('0x31')]=_['intersection'](_0x145baf['model'],_0x145baf['query']);_0x16730b[_0x5481('0x32')]=_['intersection'](_0x145baf[_0x5481('0x2e')],qs[_0x5481('0x33')](_0x47e722[_0x5481('0x2f')][_0x5481('0x33')]));_0x16730b[_0x5481('0x32')]=_0x16730b[_0x5481('0x32')]['length']?_0x16730b[_0x5481('0x32')]:_0x145baf[_0x5481('0x2e')];if(!_0x47e722['query'][_0x5481('0x34')](_0x5481('0x35'))){_0x16730b[_0x5481('0x1e')]=qs['limit'](_0x47e722[_0x5481('0x2f')][_0x5481('0x1e')]);_0x16730b[_0x5481('0x1d')]=qs[_0x5481('0x1d')](_0x47e722[_0x5481('0x2f')][_0x5481('0x1d')]);}_0x16730b[_0x5481('0x36')]=qs[_0x5481('0x37')](_0x47e722[_0x5481('0x2f')][_0x5481('0x37')]);_0x16730b[_0x5481('0x38')]=qs[_0x5481('0x31')](_[_0x5481('0x39')](_0x47e722[_0x5481('0x2f')],_0x145baf['filters']));if(_0x47e722[_0x5481('0x2f')]['filter']){_0x16730b['where']=_['merge'](_0x16730b['where'],{'$or':_[_0x5481('0x29')](_0x36c81a,function(_0x19e8df){if(_0x19e8df['type']!=='VIRTUAL'){var _0x5438cb={};_0x5438cb[_0x19e8df[_0x5481('0x26')]]={'$like':'%'+_0x47e722[_0x5481('0x2f')]['filter']+'%'};return _0x5438cb;}})});}_0x16730b=_[_0x5481('0x3a')]({},_0x16730b,_0x47e722['options']);var _0xd02d73={'where':_0x16730b[_0x5481('0x38')]};return db[_0x5481('0x2a')]['count'](_0xd02d73)['then'](function(_0x440134){_0x39dc47['count']=_0x440134;if(_0x47e722[_0x5481('0x2f')][_0x5481('0x3b')]){_0x16730b['include']=[{'all':!![]}];}return db[_0x5481('0x2a')]['findAll'](_0x16730b);})[_0x5481('0x21')](function(_0x5a2a87){_0x39dc47['rows']=_0x5a2a87;return _0x39dc47;})[_0x5481('0x21')](respondWithFilteredResult(_0x1ed0f7,_0x16730b))[_0x5481('0x3c')](handleError(_0x1ed0f7,null));};exports[_0x5481('0x3d')]=function(_0xa08071,_0x19007d){var _0x189c08={'raw':!![],'where':{'id':_0xa08071[_0x5481('0x3e')]['id']}},_0x1d95a2={};_0x1d95a2[_0x5481('0x2e')]=_['keys'](db[_0x5481('0x2a')][_0x5481('0x2b')]);_0x1d95a2[_0x5481('0x2f')]=_[_0x5481('0x30')](_0xa08071[_0x5481('0x2f')]);_0x1d95a2['filters']=_[_0x5481('0x3f')](_0x1d95a2[_0x5481('0x2e')],_0x1d95a2['query']);_0x189c08[_0x5481('0x32')]=_[_0x5481('0x3f')](_0x1d95a2[_0x5481('0x2e')],qs['fields'](_0xa08071[_0x5481('0x2f')][_0x5481('0x33')]));_0x189c08[_0x5481('0x32')]=_0x189c08[_0x5481('0x32')]['length']?_0x189c08[_0x5481('0x32')]:_0x1d95a2['model'];if(_0xa08071[_0x5481('0x2f')][_0x5481('0x3b')]){_0x189c08[_0x5481('0x40')]=[{'all':!![]}];}_0x189c08=_[_0x5481('0x3a')]({},_0x189c08,_0xa08071['options']);return db['OpenchannelQueueReport'][_0x5481('0x41')](_0x189c08)[_0x5481('0x21')](handleEntityNotFound(_0x19007d,null))['then'](respondWithResult(_0x19007d,null))[_0x5481('0x3c')](handleError(_0x19007d,null));};exports['create']=function(_0x55d85e,_0x5d53b9){return db['OpenchannelQueueReport']['create'](_0x55d85e[_0x5481('0x42')],{})[_0x5481('0x21')](respondWithResult(_0x5d53b9,0xc9))[_0x5481('0x3c')](handleError(_0x5d53b9,null));};exports[_0x5481('0x20')]=function(_0x156890,_0x4254cc){if(_0x156890[_0x5481('0x42')]['id']){delete _0x156890[_0x5481('0x42')]['id'];}return db[_0x5481('0x2a')][_0x5481('0x41')]({'where':{'id':_0x156890['params']['id']}})[_0x5481('0x21')](handleEntityNotFound(_0x4254cc,null))[_0x5481('0x21')](saveUpdates(_0x156890[_0x5481('0x42')],null))[_0x5481('0x21')](respondWithResult(_0x4254cc,null))[_0x5481('0x3c')](handleError(_0x4254cc,null));};exports[_0x5481('0x22')]=function(_0x323071,_0x23c48){return db[_0x5481('0x2a')]['find']({'where':{'id':_0x323071['params']['id']}})[_0x5481('0x21')](handleEntityNotFound(_0x23c48,null))[_0x5481('0x21')](removeEntity(_0x23c48,null))[_0x5481('0x3c')](handleError(_0x23c48,null));};exports[_0x5481('0x43')]=function(_0x5019de,_0xb3e589){return db[_0x5481('0x2a')][_0x5481('0x43')]()['then'](respondWithResult(_0xb3e589,null))[_0x5481('0x3c')](handleError(_0xb3e589,null));}; \ No newline at end of file +var _0x9af6=['params','describe','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','end','name','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','length','limit','order','sort','merge','where','map','VIRTUAL','filter','OpenchannelQueueReport','includeAll','include','rows','catch','show','intersection','find','create','body'];(function(_0x5f52d3,_0x5523a0){var _0x4f3e9f=function(_0xef136a){while(--_0xef136a){_0x5f52d3['push'](_0x5f52d3['shift']());}};_0x4f3e9f(++_0x5523a0);}(_0x9af6,0x1d7));var _0x69af=function(_0x10f63e,_0x31b2d3){_0x10f63e=_0x10f63e-0x0;var _0x50b3d5=_0x9af6[_0x10f63e];return _0x50b3d5;};'use strict';var pdf=require(_0x69af('0x0'));var emlformat=require(_0x69af('0x1'));var rimraf=require(_0x69af('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x69af('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x69af('0x4'));var util=require(_0x69af('0x5'));var path=require(_0x69af('0x6'));var sox=require('sox');var csv=require(_0x69af('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x69af('0x8'));var squel=require(_0x69af('0x9'));var crypto=require(_0x69af('0xa'));var jsforce=require(_0x69af('0xb'));var deskjs=require(_0x69af('0xc'));var toCsv=require(_0x69af('0x7'));var querystring=require(_0x69af('0xd'));var Papa=require(_0x69af('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x69af('0xf'));var as=require(_0x69af('0x10'));var hardwareService=require(_0x69af('0x11'));var logger=require(_0x69af('0x12'))(_0x69af('0x13'));var utils=require(_0x69af('0x14'));var config=require(_0x69af('0x15'));var db=require(_0x69af('0x16'))['db'];function respondWithStatusCode(_0x57808d,_0x10aced){_0x10aced=_0x10aced||0xcc;return function(_0x3350e5){if(_0x3350e5){return _0x57808d[_0x69af('0x17')](_0x10aced);}return _0x57808d[_0x69af('0x18')](_0x10aced)['end']();};}function respondWithResult(_0x216a93,_0x24a78e){_0x24a78e=_0x24a78e||0xc8;return function(_0x3cbe74){if(_0x3cbe74){return _0x216a93[_0x69af('0x18')](_0x24a78e)[_0x69af('0x19')](_0x3cbe74);}};}function respondWithFilteredResult(_0x30cd50,_0x463cf7){return function(_0x467fae){if(_0x467fae){var _0x543ac0=_0x467fae[_0x69af('0x1a')],_0x11feb8=_0x463cf7[_0x69af('0x1b')],_0x46ab23=_0x463cf7[_0x69af('0x1b')]+_0x463cf7['limit'],_0x1061ff;if(_0x46ab23>=_0x543ac0){_0x46ab23=_0x543ac0;_0x1061ff=0xc8;}else{_0x1061ff=0xce;}_0x30cd50[_0x69af('0x18')](_0x1061ff);return _0x30cd50[_0x69af('0x1c')](_0x69af('0x1d'),_0x11feb8+'-'+_0x46ab23+'/'+_0x543ac0)[_0x69af('0x19')](_0x467fae);}return null;};}function patchUpdates(_0x244594){return function(_0x12aef4){try{jsonpatch[_0x69af('0x1e')](_0x12aef4,_0x244594,!![]);}catch(_0x3ccd1c){return BPromise['reject'](_0x3ccd1c);}return _0x12aef4[_0x69af('0x1f')]();};}function saveUpdates(_0x403dac,_0x484562){return function(_0x4a4c0f){if(_0x4a4c0f){return _0x4a4c0f[_0x69af('0x20')](_0x403dac)[_0x69af('0x21')](function(_0x8d099e){return _0x8d099e;});}return null;};}function removeEntity(_0xda665b,_0x463930){return function(_0x5343e8){if(_0x5343e8){return _0x5343e8[_0x69af('0x22')]()['then'](function(){_0xda665b[_0x69af('0x18')](0xcc)[_0x69af('0x23')]();});}};}function handleEntityNotFound(_0x2dae36,_0x1803cb){return function(_0x281659){if(!_0x281659){_0x2dae36[_0x69af('0x17')](0x194);}return _0x281659;};}function handleError(_0x45ac64,_0x3651d3){_0x3651d3=_0x3651d3||0x1f4;return function(_0x685a94){logger['error'](_0x685a94['stack']);if(_0x685a94[_0x69af('0x24')]){delete _0x685a94[_0x69af('0x24')];}_0x45ac64[_0x69af('0x18')](_0x3651d3)['send'](_0x685a94);};}exports['index']=function(_0x1fb18c,_0x1d5ebc){var _0x24eb4d={},_0x5ae83d={},_0x1ce509={'count':0x0,'rows':[]};var _0x243fd1=_['map'](db['OpenchannelQueueReport'][_0x69af('0x25')],function(_0x58e7d0){return{'name':_0x58e7d0[_0x69af('0x26')],'type':_0x58e7d0[_0x69af('0x27')]['key']};});_0x5ae83d[_0x69af('0x28')]=_['map'](_0x243fd1,_0x69af('0x24'));_0x5ae83d[_0x69af('0x29')]=_[_0x69af('0x2a')](_0x1fb18c['query']);_0x5ae83d[_0x69af('0x2b')]=_['intersection'](_0x5ae83d[_0x69af('0x28')],_0x5ae83d[_0x69af('0x29')]);_0x24eb4d['attributes']=_['intersection'](_0x5ae83d['model'],qs[_0x69af('0x2c')](_0x1fb18c[_0x69af('0x29')][_0x69af('0x2c')]));_0x24eb4d[_0x69af('0x2d')]=_0x24eb4d[_0x69af('0x2d')][_0x69af('0x2e')]?_0x24eb4d[_0x69af('0x2d')]:_0x5ae83d['model'];if(!_0x1fb18c[_0x69af('0x29')]['hasOwnProperty']('nolimit')){_0x24eb4d[_0x69af('0x2f')]=qs[_0x69af('0x2f')](_0x1fb18c[_0x69af('0x29')]['limit']);_0x24eb4d[_0x69af('0x1b')]=qs[_0x69af('0x1b')](_0x1fb18c[_0x69af('0x29')][_0x69af('0x1b')]);}_0x24eb4d[_0x69af('0x30')]=qs[_0x69af('0x31')](_0x1fb18c['query'][_0x69af('0x31')]);_0x24eb4d['where']=qs['filters'](_['pick'](_0x1fb18c[_0x69af('0x29')],_0x5ae83d['filters']));if(_0x1fb18c['query']['filter']){_0x24eb4d['where']=_[_0x69af('0x32')](_0x24eb4d[_0x69af('0x33')],{'$or':_[_0x69af('0x34')](_0x243fd1,function(_0x5decde){if(_0x5decde[_0x69af('0x27')]!==_0x69af('0x35')){var _0x1eff46={};_0x1eff46[_0x5decde[_0x69af('0x24')]]={'$like':'%'+_0x1fb18c[_0x69af('0x29')][_0x69af('0x36')]+'%'};return _0x1eff46;}})});}_0x24eb4d=_[_0x69af('0x32')]({},_0x24eb4d,_0x1fb18c['options']);var _0x8b8ae6={'where':_0x24eb4d[_0x69af('0x33')]};return db[_0x69af('0x37')]['count'](_0x8b8ae6)[_0x69af('0x21')](function(_0x4ef552){_0x1ce509[_0x69af('0x1a')]=_0x4ef552;if(_0x1fb18c[_0x69af('0x29')][_0x69af('0x38')]){_0x24eb4d[_0x69af('0x39')]=[{'all':!![]}];}return db[_0x69af('0x37')]['findAll'](_0x24eb4d);})[_0x69af('0x21')](function(_0x407aeb){_0x1ce509[_0x69af('0x3a')]=_0x407aeb;return _0x1ce509;})[_0x69af('0x21')](respondWithFilteredResult(_0x1d5ebc,_0x24eb4d))[_0x69af('0x3b')](handleError(_0x1d5ebc,null));};exports[_0x69af('0x3c')]=function(_0x13d957,_0x3eceef){var _0x3639f1={'raw':!![],'where':{'id':_0x13d957['params']['id']}},_0xdb8745={};_0xdb8745[_0x69af('0x28')]=_[_0x69af('0x2a')](db[_0x69af('0x37')]['rawAttributes']);_0xdb8745['query']=_[_0x69af('0x2a')](_0x13d957[_0x69af('0x29')]);_0xdb8745[_0x69af('0x2b')]=_[_0x69af('0x3d')](_0xdb8745[_0x69af('0x28')],_0xdb8745[_0x69af('0x29')]);_0x3639f1[_0x69af('0x2d')]=_['intersection'](_0xdb8745['model'],qs['fields'](_0x13d957[_0x69af('0x29')][_0x69af('0x2c')]));_0x3639f1['attributes']=_0x3639f1[_0x69af('0x2d')]['length']?_0x3639f1['attributes']:_0xdb8745[_0x69af('0x28')];if(_0x13d957['query']['includeAll']){_0x3639f1[_0x69af('0x39')]=[{'all':!![]}];}_0x3639f1=_[_0x69af('0x32')]({},_0x3639f1,_0x13d957['options']);return db[_0x69af('0x37')][_0x69af('0x3e')](_0x3639f1)[_0x69af('0x21')](handleEntityNotFound(_0x3eceef,null))['then'](respondWithResult(_0x3eceef,null))[_0x69af('0x3b')](handleError(_0x3eceef,null));};exports['create']=function(_0x15169b,_0x292077){return db[_0x69af('0x37')][_0x69af('0x3f')](_0x15169b[_0x69af('0x40')],{})['then'](respondWithResult(_0x292077,0xc9))[_0x69af('0x3b')](handleError(_0x292077,null));};exports['update']=function(_0x104806,_0x519f2c){if(_0x104806['body']['id']){delete _0x104806[_0x69af('0x40')]['id'];}return db[_0x69af('0x37')]['find']({'where':{'id':_0x104806[_0x69af('0x41')]['id']}})['then'](handleEntityNotFound(_0x519f2c,null))[_0x69af('0x21')](saveUpdates(_0x104806[_0x69af('0x40')],null))[_0x69af('0x21')](respondWithResult(_0x519f2c,null))[_0x69af('0x3b')](handleError(_0x519f2c,null));};exports['destroy']=function(_0x5e5609,_0x1908d9){return db[_0x69af('0x37')][_0x69af('0x3e')]({'where':{'id':_0x5e5609[_0x69af('0x41')]['id']}})['then'](handleEntityNotFound(_0x1908d9,null))[_0x69af('0x21')](removeEntity(_0x1908d9,null))[_0x69af('0x3b')](handleError(_0x1908d9,null));};exports[_0x69af('0x42')]=function(_0x50aef1,_0x21483a){return db[_0x69af('0x37')]['describe']()['then'](respondWithResult(_0x21483a,null))[_0x69af('0x3b')](handleError(_0x21483a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 1bcadb2..06645eb 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe50e=['report_openchannel_queue','uniqueid','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport'];(function(_0x563a75,_0x538718){var _0x452083=function(_0x1617a3){while(--_0x1617a3){_0x563a75['push'](_0x563a75['shift']());}};_0x452083(++_0x538718);}(_0xe50e,0xf9));var _0xee50=function(_0x3fdf36,_0x3f338e){_0x3fdf36=_0x3fdf36-0x0;var _0x2a93c1=_0xe50e[_0x3fdf36];return _0x2a93c1;};'use strict';var _=require(_0xee50('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xee50('0x1'));var BPromise=require(_0xee50('0x2'));var rp=require(_0xee50('0x3'));var fs=require('fs');var path=require(_0xee50('0x4'));var rimraf=require(_0xee50('0x5'));var config=require(_0xee50('0x6'));var attributes=require(_0xee50('0x7'));module[_0xee50('0x8')]=function(_0x3fe965,_0x3b0585){return _0x3fe965[_0xee50('0x9')](_0xee50('0xa'),attributes,{'tableName':_0xee50('0xb'),'paranoid':![],'indexes':[{'name':_0xee50('0xc'),'fields':[_0xee50('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79de=['rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x121195,_0x2cd8b8){var _0x363aea=function(_0xa148f9){while(--_0xa148f9){_0x121195['push'](_0x121195['shift']());}};_0x363aea(++_0x2cd8b8);}(_0x79de,0x1a8));var _0xe79d=function(_0x34e975,_0x17d894){_0x34e975=_0x34e975-0x0;var _0x25cf5d=_0x79de[_0x34e975];return _0x25cf5d;};'use strict';var _=require(_0xe79d('0x0'));var util=require('util');var logger=require(_0xe79d('0x1'))(_0xe79d('0x2'));var moment=require(_0xe79d('0x3'));var BPromise=require(_0xe79d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe79d('0x5'));var config=require(_0xe79d('0x6'));var attributes=require(_0xe79d('0x7'));module[_0xe79d('0x8')]=function(_0xc9b37,_0x36064f){return _0xc9b37[_0xe79d('0x9')](_0xe79d('0xa'),attributes,{'tableName':_0xe79d('0xb'),'paranoid':![],'indexes':[{'name':_0xe79d('0xc'),'fields':[_0xe79d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 30b797a..04e62d6 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfb1=['request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','OpenchannelQueueReport','body','options','raw','then','catch','UpdateOpenchannelQueueReport','update','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x23ff10,_0x5f3391){var _0x2a4532=function(_0x548310){while(--_0x548310){_0x23ff10['push'](_0x23ff10['shift']());}};_0x2a4532(++_0x5f3391);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x3ff1e2,_0x2ff6e8){_0x3ff1e2=_0x3ff1e2-0x0;var _0x96da8d=_0xdfb1[_0x3ff1e2];return _0x96da8d;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var moment=require(_0x1dfb('0x2'));var BPromise=require(_0x1dfb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dfb('0x4'));var db=require(_0x1dfb('0x5'))['db'];var utils=require(_0x1dfb('0x6'));var logger=require(_0x1dfb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1dfb('0x8')][_0x1dfb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e10d9,_0x496be7,_0x42d45e){return new BPromise(function(_0x491406,_0x141081){return client[_0x1dfb('0xa')](_0x1e10d9,_0x42d45e)['then'](function(_0x24d8b9){logger[_0x1dfb('0xb')](_0x1dfb('0xc'),_0x496be7,'request\x20sent');logger[_0x1dfb('0xd')](_0x1dfb('0xe'),_0x496be7,_0x1dfb('0xf'),JSON[_0x1dfb('0x10')](_0x24d8b9));if(_0x24d8b9[_0x1dfb('0x11')]){if(_0x24d8b9[_0x1dfb('0x11')][_0x1dfb('0x12')]===0x1f4){logger[_0x1dfb('0x11')](_0x1dfb('0xc'),_0x496be7,_0x24d8b9['error'][_0x1dfb('0x13')]);return _0x141081(_0x24d8b9[_0x1dfb('0x11')]['message']);}logger[_0x1dfb('0x11')](_0x1dfb('0xc'),_0x496be7,_0x24d8b9[_0x1dfb('0x11')]['message']);return _0x491406(_0x24d8b9[_0x1dfb('0x11')][_0x1dfb('0x13')]);}else{logger[_0x1dfb('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x496be7,_0x1dfb('0xf'));_0x491406(_0x24d8b9[_0x1dfb('0x14')][_0x1dfb('0x13')]);}})['catch'](function(_0x1186d1){logger[_0x1dfb('0x11')](_0x1dfb('0xc'),_0x496be7,_0x1186d1);_0x141081(_0x1186d1);});});}exports['CreateOpenchannelQueueReport']=function(_0x51c0fc){var _0x2415fe=this;return new Promise(function(_0x22cfdc,_0x37c3dc){return db[_0x1dfb('0x15')]['create'](_0x51c0fc[_0x1dfb('0x16')],{'raw':_0x51c0fc[_0x1dfb('0x17')]?_0x51c0fc[_0x1dfb('0x17')][_0x1dfb('0x18')]===undefined?!![]:![]:!![]})[_0x1dfb('0x19')](function(_0x4dff46){logger[_0x1dfb('0xb')]('CreateOpenchannelQueueReport',_0x51c0fc);logger['debug']('CreateOpenchannelQueueReport',_0x51c0fc,JSON[_0x1dfb('0x10')](_0x4dff46));_0x22cfdc(_0x4dff46);})[_0x1dfb('0x1a')](function(_0x3cb51e){logger['error']('CreateOpenchannelQueueReport',_0x3cb51e['message'],_0x51c0fc);_0x37c3dc(_0x2415fe[_0x1dfb('0x11')](0x1f4,_0x3cb51e[_0x1dfb('0x13')]));});});};exports[_0x1dfb('0x1b')]=function(_0x1250c4){var _0x128cc6=this;return new Promise(function(_0x55da8b,_0x136a7d){return db[_0x1dfb('0x15')][_0x1dfb('0x1c')](_0x1250c4['body'],{'raw':_0x1250c4['options']?_0x1250c4[_0x1dfb('0x17')][_0x1dfb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1250c4['options']?_0x1250c4['options']['where']||null:null,'attributes':_0x1250c4[_0x1dfb('0x17')]?_0x1250c4[_0x1dfb('0x17')]['attributes']||null:null,'limit':_0x1250c4[_0x1dfb('0x17')]?_0x1250c4['options'][_0x1dfb('0x1d')]||null:null})[_0x1dfb('0x19')](function(_0x51b2e9){logger[_0x1dfb('0xb')](_0x1dfb('0x1b'),_0x1250c4);logger[_0x1dfb('0xd')]('UpdateOpenchannelQueueReport',_0x1250c4,JSON[_0x1dfb('0x10')](_0x51b2e9));_0x55da8b(_0x51b2e9);})[_0x1dfb('0x1a')](function(_0x2dfa60){logger[_0x1dfb('0x11')](_0x1dfb('0x1b'),_0x2dfa60['message'],_0x1250c4);_0x136a7d(_0x128cc6[_0x1dfb('0x11')](0x1f4,_0x2dfa60[_0x1dfb('0x13')]));});});}; \ No newline at end of file +var _0x14b2=['debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','then','catch','update','attributes','limit','UpdateOpenchannelQueueReport'];(function(_0x36800b,_0x404b49){var _0x564f89=function(_0x16cea1){while(--_0x16cea1){_0x36800b['push'](_0x36800b['shift']());}};_0x564f89(++_0x404b49);}(_0x14b2,0x1a1));var _0x214b=function(_0x37ef86,_0xee4769){_0x37ef86=_0x37ef86-0x0;var _0x15cfe9=_0x14b2[_0x37ef86];return _0x15cfe9;};'use strict';var _=require(_0x214b('0x0'));var util=require(_0x214b('0x1'));var moment=require('moment');var BPromise=require(_0x214b('0x2'));var rs=require(_0x214b('0x3'));var fs=require('fs');var Redis=require(_0x214b('0x4'));var db=require(_0x214b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x214b('0x6'))(_0x214b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x214b('0x8')][_0x214b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30867e,_0x3003ab,_0x188bab){return new BPromise(function(_0x117ddd,_0x4cd18e){return client[_0x214b('0xa')](_0x30867e,_0x188bab)['then'](function(_0x232e01){logger['info'](_0x214b('0xb'),_0x3003ab,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3003ab,_0x214b('0xc'),JSON[_0x214b('0xd')](_0x232e01));if(_0x232e01['error']){if(_0x232e01[_0x214b('0xe')][_0x214b('0xf')]===0x1f4){logger[_0x214b('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3003ab,_0x232e01[_0x214b('0xe')]['message']);return _0x4cd18e(_0x232e01['error'][_0x214b('0x10')]);}logger[_0x214b('0xe')](_0x214b('0xb'),_0x3003ab,_0x232e01[_0x214b('0xe')][_0x214b('0x10')]);return _0x117ddd(_0x232e01[_0x214b('0xe')]['message']);}else{logger[_0x214b('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3003ab,_0x214b('0xc'));_0x117ddd(_0x232e01[_0x214b('0x12')][_0x214b('0x10')]);}})['catch'](function(_0x4d2557){logger[_0x214b('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3003ab,_0x4d2557);_0x4cd18e(_0x4d2557);});});}exports[_0x214b('0x13')]=function(_0xbe4932){var _0x4d42e6=this;return new Promise(function(_0x25e18a,_0x4cc219){return db[_0x214b('0x14')][_0x214b('0x15')](_0xbe4932[_0x214b('0x16')],{'raw':_0xbe4932['options']?_0xbe4932[_0x214b('0x17')][_0x214b('0x18')]===undefined?!![]:![]:!![]})[_0x214b('0x19')](function(_0x3dc351){logger[_0x214b('0x11')]('CreateOpenchannelQueueReport',_0xbe4932);logger['debug'](_0x214b('0x13'),_0xbe4932,JSON[_0x214b('0xd')](_0x3dc351));_0x25e18a(_0x3dc351);})[_0x214b('0x1a')](function(_0x2ddfe4){logger['error'](_0x214b('0x13'),_0x2ddfe4[_0x214b('0x10')],_0xbe4932);_0x4cc219(_0x4d42e6[_0x214b('0xe')](0x1f4,_0x2ddfe4[_0x214b('0x10')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x36b7de){var _0x26c805=this;return new Promise(function(_0x7ad1cc,_0x220d38){return db[_0x214b('0x14')][_0x214b('0x1b')](_0x36b7de[_0x214b('0x16')],{'raw':_0x36b7de[_0x214b('0x17')]?_0x36b7de[_0x214b('0x17')][_0x214b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36b7de[_0x214b('0x17')]?_0x36b7de['options']['where']||null:null,'attributes':_0x36b7de[_0x214b('0x17')]?_0x36b7de[_0x214b('0x17')][_0x214b('0x1c')]||null:null,'limit':_0x36b7de[_0x214b('0x17')]?_0x36b7de['options'][_0x214b('0x1d')]||null:null})[_0x214b('0x19')](function(_0x586879){logger['info'](_0x214b('0x1e'),_0x36b7de);logger[_0x214b('0x1f')](_0x214b('0x1e'),_0x36b7de,JSON['stringify'](_0x586879));_0x7ad1cc(_0x586879);})[_0x214b('0x1a')](function(_0x4f449f){logger['error'](_0x214b('0x1e'),_0x4f449f[_0x214b('0x10')],_0x36b7de);_0x220d38(_0x26c805[_0x214b('0xe')](0x1f4,_0x4f449f[_0x214b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index d367808..174b240 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 2364db3..b871d29 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1286=['ENUM','account','agent','queue','DATE','NOW','moment','STRING'];(function(_0x3007e7,_0x118c1d){var _0x88db52=function(_0x30ec60){while(--_0x30ec60){_0x3007e7['push'](_0x3007e7['shift']());}};_0x88db52(++_0x118c1d);}(_0x1286,0x86));var _0x6128=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x1286[_0x385eb1];return _0x5d40eb;};'use strict';var moment=require(_0x6128('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6128('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6128('0x2')](_0x6128('0x3'),_0x6128('0x4'),_0x6128('0x5')),'allowNull':![],'defaultValue':_0x6128('0x5')},'transferredAt':{'type':Sequelize[_0x6128('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x6128('0x7')]}}; \ No newline at end of file +var _0xa7d1=['STRING','agent','queue','DATE','NOW','moment','exports'];(function(_0x3e2581,_0x305815){var _0x35aa2c=function(_0x302c69){while(--_0x302c69){_0x3e2581['push'](_0x3e2581['shift']());}};_0x35aa2c(++_0x305815);}(_0xa7d1,0xc9));var _0x1a7d=function(_0x2d580b,_0x2b11f3){_0x2d580b=_0x2d580b-0x0;var _0x7c1374=_0xa7d1[_0x2d580b];return _0x7c1374;};'use strict';var moment=require(_0x1a7d('0x0'));var Sequelize=require('sequelize');module[_0x1a7d('0x1')]={'uniqueid':{'type':Sequelize[_0x1a7d('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x1a7d('0x3'),_0x1a7d('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x1a7d('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x1a7d('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 352b782..a17dabc 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9991=['options','count','includeAll','include','rows','catch','params','create','body','destroy','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge'];(function(_0x43efa5,_0x2e09e){var _0xb78e07=function(_0x435f07){while(--_0x435f07){_0x43efa5['push'](_0x43efa5['shift']());}};_0xb78e07(++_0x2e09e);}(_0x9991,0xe4));var _0x1999=function(_0x4af6ca,_0x2102a5){_0x4af6ca=_0x4af6ca-0x0;var _0x4787dd=_0x9991[_0x4af6ca];return _0x4787dd;};'use strict';var pdf=require(_0x1999('0x0'));var emlformat=require(_0x1999('0x1'));var rimraf=require(_0x1999('0x2'));var zipdir=require(_0x1999('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1999('0x4'));var moment=require('moment');var BPromise=require(_0x1999('0x5'));var Mustache=require(_0x1999('0x6'));var util=require(_0x1999('0x7'));var path=require(_0x1999('0x8'));var sox=require(_0x1999('0x9'));var csv=require(_0x1999('0xa'));var ejs=require(_0x1999('0xb'));var fs=require('fs');var _=require(_0x1999('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1999('0xd'));var deskjs=require(_0x1999('0xe'));var toCsv=require(_0x1999('0xa'));var querystring=require(_0x1999('0xf'));var Papa=require(_0x1999('0x10'));var Redis=require(_0x1999('0x11'));var authService=require(_0x1999('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1999('0x13'));var hardwareService=require(_0x1999('0x14'));var logger=require(_0x1999('0x15'))('api');var utils=require(_0x1999('0x16'));var config=require(_0x1999('0x17'));var db=require(_0x1999('0x18'))['db'];function respondWithStatusCode(_0x511884,_0x543285){_0x543285=_0x543285||0xcc;return function(_0x281575){if(_0x281575){return _0x511884[_0x1999('0x19')](_0x543285);}return _0x511884[_0x1999('0x1a')](_0x543285)[_0x1999('0x1b')]();};}function respondWithResult(_0x31fe71,_0x3f3195){_0x3f3195=_0x3f3195||0xc8;return function(_0x41db0a){if(_0x41db0a){return _0x31fe71[_0x1999('0x1a')](_0x3f3195)[_0x1999('0x1c')](_0x41db0a);}};}function respondWithFilteredResult(_0xa0d899,_0x1f71d2){return function(_0x1c5f14){if(_0x1c5f14){var _0x551349=_0x1c5f14['count'],_0x4b05fb=_0x1f71d2[_0x1999('0x1d')],_0x26723c=_0x1f71d2[_0x1999('0x1d')]+_0x1f71d2[_0x1999('0x1e')],_0x4ecd64;if(_0x26723c>=_0x551349){_0x26723c=_0x551349;_0x4ecd64=0xc8;}else{_0x4ecd64=0xce;}_0xa0d899[_0x1999('0x1a')](_0x4ecd64);return _0xa0d899['set']('Content-Range',_0x4b05fb+'-'+_0x26723c+'/'+_0x551349)[_0x1999('0x1c')](_0x1c5f14);}return null;};}function patchUpdates(_0x2d2698){return function(_0x1e73b3){try{jsonpatch[_0x1999('0x1f')](_0x1e73b3,_0x2d2698,!![]);}catch(_0x41b98c){return BPromise[_0x1999('0x20')](_0x41b98c);}return _0x1e73b3[_0x1999('0x21')]();};}function saveUpdates(_0x4d0874,_0x37c191){return function(_0x1869e2){if(_0x1869e2){return _0x1869e2[_0x1999('0x22')](_0x4d0874)['then'](function(_0x577b1f){return _0x577b1f;});}return null;};}function removeEntity(_0x2d55e8,_0x469dcb){return function(_0x53337d){if(_0x53337d){return _0x53337d['destroy']()[_0x1999('0x23')](function(){_0x2d55e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5291c6,_0x33d8a7){return function(_0x5919cb){if(!_0x5919cb){_0x5291c6[_0x1999('0x19')](0x194);}return _0x5919cb;};}function handleError(_0x40a4b7,_0xc939bd){_0xc939bd=_0xc939bd||0x1f4;return function(_0x25ef42){logger[_0x1999('0x24')](_0x25ef42[_0x1999('0x25')]);if(_0x25ef42[_0x1999('0x26')]){delete _0x25ef42[_0x1999('0x26')];}_0x40a4b7[_0x1999('0x1a')](_0xc939bd)[_0x1999('0x27')](_0x25ef42);};}exports[_0x1999('0x28')]=function(_0x1ea2bb,_0x497509){var _0x3a7314={},_0x106650={},_0x46d285={'count':0x0,'rows':[]};var _0x49e624=_['map'](db[_0x1999('0x29')][_0x1999('0x2a')],function(_0x5d95d4){return{'name':_0x5d95d4[_0x1999('0x2b')],'type':_0x5d95d4[_0x1999('0x2c')][_0x1999('0x2d')]};});_0x106650[_0x1999('0x2e')]=_['map'](_0x49e624,_0x1999('0x26'));_0x106650['query']=_[_0x1999('0x2f')](_0x1ea2bb[_0x1999('0x30')]);_0x106650[_0x1999('0x31')]=_[_0x1999('0x32')](_0x106650[_0x1999('0x2e')],_0x106650['query']);_0x3a7314[_0x1999('0x33')]=_[_0x1999('0x32')](_0x106650['model'],qs[_0x1999('0x34')](_0x1ea2bb['query']['fields']));_0x3a7314[_0x1999('0x33')]=_0x3a7314[_0x1999('0x33')][_0x1999('0x35')]?_0x3a7314[_0x1999('0x33')]:_0x106650[_0x1999('0x2e')];if(!_0x1ea2bb[_0x1999('0x30')]['hasOwnProperty']('nolimit')){_0x3a7314['limit']=qs['limit'](_0x1ea2bb[_0x1999('0x30')][_0x1999('0x1e')]);_0x3a7314['offset']=qs[_0x1999('0x1d')](_0x1ea2bb[_0x1999('0x30')][_0x1999('0x1d')]);}_0x3a7314[_0x1999('0x36')]=qs['sort'](_0x1ea2bb[_0x1999('0x30')][_0x1999('0x37')]);_0x3a7314[_0x1999('0x38')]=qs[_0x1999('0x31')](_[_0x1999('0x39')](_0x1ea2bb['query'],_0x106650[_0x1999('0x31')]));if(_0x1ea2bb[_0x1999('0x30')][_0x1999('0x3a')]){_0x3a7314[_0x1999('0x38')]=_['merge'](_0x3a7314[_0x1999('0x38')],{'$or':_['map'](_0x49e624,function(_0xb5ea3c){if(_0xb5ea3c[_0x1999('0x2c')]!=='VIRTUAL'){var _0x4a5c74={};_0x4a5c74[_0xb5ea3c[_0x1999('0x26')]]={'$like':'%'+_0x1ea2bb[_0x1999('0x30')][_0x1999('0x3a')]+'%'};return _0x4a5c74;}})});}_0x3a7314=_[_0x1999('0x3b')]({},_0x3a7314,_0x1ea2bb[_0x1999('0x3c')]);var _0x238e99={'where':_0x3a7314['where']};return db[_0x1999('0x29')]['count'](_0x238e99)[_0x1999('0x23')](function(_0x540788){_0x46d285[_0x1999('0x3d')]=_0x540788;if(_0x1ea2bb['query'][_0x1999('0x3e')]){_0x3a7314[_0x1999('0x3f')]=[{'all':!![]}];}return db[_0x1999('0x29')]['findAll'](_0x3a7314);})[_0x1999('0x23')](function(_0x49ab11){_0x46d285[_0x1999('0x40')]=_0x49ab11;return _0x46d285;})[_0x1999('0x23')](respondWithFilteredResult(_0x497509,_0x3a7314))[_0x1999('0x41')](handleError(_0x497509,null));};exports['show']=function(_0x155830,_0x5f406a){var _0x1ae582={'raw':!![],'where':{'id':_0x155830[_0x1999('0x42')]['id']}},_0x1767ad={};_0x1767ad['model']=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x1767ad[_0x1999('0x30')]=_[_0x1999('0x2f')](_0x155830[_0x1999('0x30')]);_0x1767ad[_0x1999('0x31')]=_[_0x1999('0x32')](_0x1767ad[_0x1999('0x2e')],_0x1767ad[_0x1999('0x30')]);_0x1ae582[_0x1999('0x33')]=_['intersection'](_0x1767ad[_0x1999('0x2e')],qs[_0x1999('0x34')](_0x155830['query']['fields']));_0x1ae582['attributes']=_0x1ae582['attributes'][_0x1999('0x35')]?_0x1ae582[_0x1999('0x33')]:_0x1767ad['model'];if(_0x155830[_0x1999('0x30')][_0x1999('0x3e')]){_0x1ae582[_0x1999('0x3f')]=[{'all':!![]}];}_0x1ae582=_[_0x1999('0x3b')]({},_0x1ae582,_0x155830['options']);return db[_0x1999('0x29')]['find'](_0x1ae582)['then'](handleEntityNotFound(_0x5f406a,null))[_0x1999('0x23')](respondWithResult(_0x5f406a,null))[_0x1999('0x41')](handleError(_0x5f406a,null));};exports['create']=function(_0x334523,_0x355059){return db[_0x1999('0x29')][_0x1999('0x43')](_0x334523[_0x1999('0x44')],{})[_0x1999('0x23')](respondWithResult(_0x355059,0xc9))[_0x1999('0x41')](handleError(_0x355059,null));};exports[_0x1999('0x22')]=function(_0x55bd49,_0x18ae74){if(_0x55bd49[_0x1999('0x44')]['id']){delete _0x55bd49[_0x1999('0x44')]['id'];}return db[_0x1999('0x29')]['find']({'where':{'id':_0x55bd49[_0x1999('0x42')]['id']}})[_0x1999('0x23')](handleEntityNotFound(_0x18ae74,null))[_0x1999('0x23')](saveUpdates(_0x55bd49[_0x1999('0x44')],null))[_0x1999('0x23')](respondWithResult(_0x18ae74,null))['catch'](handleError(_0x18ae74,null));};exports[_0x1999('0x45')]=function(_0x530b32,_0x49729c){return db['OpenchannelTransferReport'][_0x1999('0x46')]({'where':{'id':_0x530b32[_0x1999('0x42')]['id']}})[_0x1999('0x23')](handleEntityNotFound(_0x49729c,null))[_0x1999('0x23')](removeEntity(_0x49729c,null))[_0x1999('0x41')](handleError(_0x49729c,null));};exports['describe']=function(_0x2c8944,_0x5d6a6c){return db[_0x1999('0x29')][_0x1999('0x47')]()[_0x1999('0x23')](respondWithResult(_0x5d6a6c,null))['catch'](handleError(_0x5d6a6c,null));}; \ No newline at end of file +var _0x98a7=['send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','nolimit','sort','where','pick','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','params','intersection','length','merge','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x98a7,0x106));var _0x798a=function(_0x286957,_0xc46221){_0x286957=_0x286957-0x0;var _0x2c94d5=_0x98a7[_0x286957];return _0x2c94d5;};'use strict';var pdf=require(_0x798a('0x0'));var emlformat=require(_0x798a('0x1'));var rimraf=require(_0x798a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x798a('0x3'));var rp=require(_0x798a('0x4'));var moment=require(_0x798a('0x5'));var BPromise=require(_0x798a('0x6'));var Mustache=require(_0x798a('0x7'));var util=require(_0x798a('0x8'));var path=require(_0x798a('0x9'));var sox=require(_0x798a('0xa'));var csv=require(_0x798a('0xb'));var ejs=require(_0x798a('0xc'));var fs=require('fs');var _=require(_0x798a('0xd'));var squel=require(_0x798a('0xe'));var crypto=require('crypto');var jsforce=require(_0x798a('0xf'));var deskjs=require(_0x798a('0x10'));var toCsv=require(_0x798a('0xb'));var querystring=require(_0x798a('0x11'));var Papa=require(_0x798a('0x12'));var Redis=require(_0x798a('0x13'));var authService=require(_0x798a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x798a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x798a('0x16'))(_0x798a('0x17'));var utils=require(_0x798a('0x18'));var config=require(_0x798a('0x19'));var db=require(_0x798a('0x1a'))['db'];function respondWithStatusCode(_0x31c3c8,_0xca7ed6){_0xca7ed6=_0xca7ed6||0xcc;return function(_0x7dcd02){if(_0x7dcd02){return _0x31c3c8[_0x798a('0x1b')](_0xca7ed6);}return _0x31c3c8[_0x798a('0x1c')](_0xca7ed6)[_0x798a('0x1d')]();};}function respondWithResult(_0x508200,_0x5bb116){_0x5bb116=_0x5bb116||0xc8;return function(_0x31746d){if(_0x31746d){return _0x508200[_0x798a('0x1c')](_0x5bb116)[_0x798a('0x1e')](_0x31746d);}};}function respondWithFilteredResult(_0x5cf639,_0x1cc132){return function(_0xe53f67){if(_0xe53f67){var _0x31fcae=_0xe53f67['count'],_0x4bab19=_0x1cc132[_0x798a('0x1f')],_0x4f2d37=_0x1cc132[_0x798a('0x1f')]+_0x1cc132[_0x798a('0x20')],_0x5547b4;if(_0x4f2d37>=_0x31fcae){_0x4f2d37=_0x31fcae;_0x5547b4=0xc8;}else{_0x5547b4=0xce;}_0x5cf639[_0x798a('0x1c')](_0x5547b4);return _0x5cf639['set'](_0x798a('0x21'),_0x4bab19+'-'+_0x4f2d37+'/'+_0x31fcae)[_0x798a('0x1e')](_0xe53f67);}return null;};}function patchUpdates(_0x555e83){return function(_0x3c6cb5){try{jsonpatch[_0x798a('0x22')](_0x3c6cb5,_0x555e83,!![]);}catch(_0x241aa6){return BPromise[_0x798a('0x23')](_0x241aa6);}return _0x3c6cb5[_0x798a('0x24')]();};}function saveUpdates(_0x4e36f7,_0x36b0a3){return function(_0x2f09dc){if(_0x2f09dc){return _0x2f09dc[_0x798a('0x25')](_0x4e36f7)[_0x798a('0x26')](function(_0xbf4c1f){return _0xbf4c1f;});}return null;};}function removeEntity(_0x55f40e,_0xc7c7fa){return function(_0x80ddf5){if(_0x80ddf5){return _0x80ddf5['destroy']()[_0x798a('0x26')](function(){_0x55f40e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cf376,_0xc2d501){return function(_0x2b1327){if(!_0x2b1327){_0x4cf376[_0x798a('0x1b')](0x194);}return _0x2b1327;};}function handleError(_0x4d2724,_0x1e9d7a){_0x1e9d7a=_0x1e9d7a||0x1f4;return function(_0x316488){logger[_0x798a('0x27')](_0x316488[_0x798a('0x28')]);if(_0x316488[_0x798a('0x29')]){delete _0x316488[_0x798a('0x29')];}_0x4d2724[_0x798a('0x1c')](_0x1e9d7a)[_0x798a('0x2a')](_0x316488);};}exports['index']=function(_0x185571,_0x3ae4aa){var _0x3e9c2f={},_0xbf49f8={},_0x47735c={'count':0x0,'rows':[]};var _0x556ac2=_[_0x798a('0x2b')](db[_0x798a('0x2c')][_0x798a('0x2d')],function(_0x451249){return{'name':_0x451249[_0x798a('0x2e')],'type':_0x451249[_0x798a('0x2f')]['key']};});_0xbf49f8[_0x798a('0x30')]=_['map'](_0x556ac2,'name');_0xbf49f8[_0x798a('0x31')]=_[_0x798a('0x32')](_0x185571['query']);_0xbf49f8[_0x798a('0x33')]=_['intersection'](_0xbf49f8[_0x798a('0x30')],_0xbf49f8[_0x798a('0x31')]);_0x3e9c2f['attributes']=_['intersection'](_0xbf49f8[_0x798a('0x30')],qs[_0x798a('0x34')](_0x185571[_0x798a('0x31')][_0x798a('0x34')]));_0x3e9c2f[_0x798a('0x35')]=_0x3e9c2f['attributes']['length']?_0x3e9c2f[_0x798a('0x35')]:_0xbf49f8[_0x798a('0x30')];if(!_0x185571[_0x798a('0x31')]['hasOwnProperty'](_0x798a('0x36'))){_0x3e9c2f['limit']=qs['limit'](_0x185571[_0x798a('0x31')]['limit']);_0x3e9c2f[_0x798a('0x1f')]=qs[_0x798a('0x1f')](_0x185571[_0x798a('0x31')][_0x798a('0x1f')]);}_0x3e9c2f['order']=qs[_0x798a('0x37')](_0x185571['query'][_0x798a('0x37')]);_0x3e9c2f[_0x798a('0x38')]=qs['filters'](_[_0x798a('0x39')](_0x185571[_0x798a('0x31')],_0xbf49f8[_0x798a('0x33')]));if(_0x185571[_0x798a('0x31')]['filter']){_0x3e9c2f['where']=_['merge'](_0x3e9c2f['where'],{'$or':_[_0x798a('0x2b')](_0x556ac2,function(_0xc99e81){if(_0xc99e81[_0x798a('0x2f')]!==_0x798a('0x3a')){var _0x180dc2={};_0x180dc2[_0xc99e81['name']]={'$like':'%'+_0x185571[_0x798a('0x31')][_0x798a('0x3b')]+'%'};return _0x180dc2;}})});}_0x3e9c2f=_['merge']({},_0x3e9c2f,_0x185571[_0x798a('0x3c')]);var _0xc27530={'where':_0x3e9c2f[_0x798a('0x38')]};return db[_0x798a('0x2c')][_0x798a('0x3d')](_0xc27530)[_0x798a('0x26')](function(_0x55828e){_0x47735c['count']=_0x55828e;if(_0x185571[_0x798a('0x31')][_0x798a('0x3e')]){_0x3e9c2f[_0x798a('0x3f')]=[{'all':!![]}];}return db[_0x798a('0x2c')]['findAll'](_0x3e9c2f);})[_0x798a('0x26')](function(_0x52a444){_0x47735c[_0x798a('0x40')]=_0x52a444;return _0x47735c;})['then'](respondWithFilteredResult(_0x3ae4aa,_0x3e9c2f))[_0x798a('0x41')](handleError(_0x3ae4aa,null));};exports[_0x798a('0x42')]=function(_0x4a05e2,_0x3d5715){var _0x2f4113={'raw':!![],'where':{'id':_0x4a05e2[_0x798a('0x43')]['id']}},_0x427324={};_0x427324[_0x798a('0x30')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x427324[_0x798a('0x31')]=_['keys'](_0x4a05e2[_0x798a('0x31')]);_0x427324[_0x798a('0x33')]=_[_0x798a('0x44')](_0x427324[_0x798a('0x30')],_0x427324[_0x798a('0x31')]);_0x2f4113[_0x798a('0x35')]=_[_0x798a('0x44')](_0x427324[_0x798a('0x30')],qs['fields'](_0x4a05e2['query'][_0x798a('0x34')]));_0x2f4113[_0x798a('0x35')]=_0x2f4113[_0x798a('0x35')][_0x798a('0x45')]?_0x2f4113['attributes']:_0x427324['model'];if(_0x4a05e2[_0x798a('0x31')][_0x798a('0x3e')]){_0x2f4113[_0x798a('0x3f')]=[{'all':!![]}];}_0x2f4113=_[_0x798a('0x46')]({},_0x2f4113,_0x4a05e2[_0x798a('0x3c')]);return db[_0x798a('0x2c')][_0x798a('0x47')](_0x2f4113)[_0x798a('0x26')](handleEntityNotFound(_0x3d5715,null))[_0x798a('0x26')](respondWithResult(_0x3d5715,null))[_0x798a('0x41')](handleError(_0x3d5715,null));};exports['create']=function(_0x2c451b,_0x1887f0){return db[_0x798a('0x2c')][_0x798a('0x48')](_0x2c451b[_0x798a('0x49')],{})['then'](respondWithResult(_0x1887f0,0xc9))[_0x798a('0x41')](handleError(_0x1887f0,null));};exports['update']=function(_0x47740c,_0x50dab7){if(_0x47740c[_0x798a('0x49')]['id']){delete _0x47740c[_0x798a('0x49')]['id'];}return db[_0x798a('0x2c')][_0x798a('0x47')]({'where':{'id':_0x47740c[_0x798a('0x43')]['id']}})[_0x798a('0x26')](handleEntityNotFound(_0x50dab7,null))[_0x798a('0x26')](saveUpdates(_0x47740c[_0x798a('0x49')],null))[_0x798a('0x26')](respondWithResult(_0x50dab7,null))[_0x798a('0x41')](handleError(_0x50dab7,null));};exports[_0x798a('0x4a')]=function(_0x3b1a81,_0xc482c7){return db['OpenchannelTransferReport'][_0x798a('0x47')]({'where':{'id':_0x3b1a81[_0x798a('0x43')]['id']}})[_0x798a('0x26')](handleEntityNotFound(_0xc482c7,null))[_0x798a('0x26')](removeEntity(_0xc482c7,null))[_0x798a('0x41')](handleError(_0xc482c7,null));};exports[_0x798a('0x4b')]=function(_0x436bd5,_0x3a9f97){return db[_0x798a('0x2c')][_0x798a('0x4b')]()[_0x798a('0x26')](respondWithResult(_0x3a9f97,null))[_0x798a('0x41')](handleError(_0x3a9f97,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 33b9a7f..ce4954d 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42fd=['../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x42fd,0x131));var _0xd42f=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x42fd[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0xd42f('0x0'));var util=require(_0xd42f('0x1'));var logger=require(_0xd42f('0x2'))(_0xd42f('0x3'));var moment=require('moment');var BPromise=require(_0xd42f('0x4'));var rp=require(_0xd42f('0x5'));var fs=require('fs');var path=require(_0xd42f('0x6'));var rimraf=require('rimraf');var config=require(_0xd42f('0x7'));var attributes=require(_0xd42f('0x8'));module[_0xd42f('0x9')]=function(_0x4f8985,_0x341c5e){return _0x4f8985['define'](_0xd42f('0xa'),attributes,{'tableName':_0xd42f('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd42f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x13ff=['request-promise','path','rimraf','../../config/environment','exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x45098f,_0x16c0f8){var _0x2264ee=function(_0x185348){while(--_0x185348){_0x45098f['push'](_0x45098f['shift']());}};_0x2264ee(++_0x16c0f8);}(_0x13ff,0x1d0));var _0xf13f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x13ff[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xf13f('0x0'));var util=require(_0xf13f('0x1'));var logger=require(_0xf13f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf13f('0x3'));var rp=require(_0xf13f('0x4'));var fs=require('fs');var path=require(_0xf13f('0x5'));var rimraf=require(_0xf13f('0x6'));var config=require(_0xf13f('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0xf13f('0x8')]=function(_0xc89ca5,_0x4409b0){return _0xc89ca5[_0xf13f('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0xf13f('0xa'),'paranoid':![],'indexes':[{'name':_0xf13f('0xb'),'fields':[_0xf13f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index a8e9a6c..324222e 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x255a=['moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x3c17b3,_0x27db9a){var _0x573acd=function(_0x647e39){while(--_0x647e39){_0x3c17b3['push'](_0x3c17b3['shift']());}};_0x573acd(++_0x27db9a);}(_0x255a,0x1b7));var _0xa255=function(_0x59bcdf,_0x1aab8b){_0x59bcdf=_0x59bcdf-0x0;var _0x32d6db=_0x255a[_0x59bcdf];return _0x32d6db;};'use strict';var _=require(_0xa255('0x0'));var util=require('util');var moment=require(_0xa255('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa255('0x2'));var db=require(_0xa255('0x3'))['db'];var utils=require(_0xa255('0x4'));var logger=require('../../config/logger')(_0xa255('0x5'));var config=require('../../config/environment');var jayson=require(_0xa255('0x6'));var client=jayson[_0xa255('0x7')][_0xa255('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aa9de,_0x433023,_0x401d14){return new BPromise(function(_0x179633,_0x842dbb){return client['request'](_0x5aa9de,_0x401d14)[_0xa255('0x9')](function(_0x165bb6){logger[_0xa255('0xa')](_0xa255('0xb'),_0x433023,'request\x20sent');logger['debug'](_0xa255('0xc'),_0x433023,_0xa255('0xd'),JSON[_0xa255('0xe')](_0x165bb6));if(_0x165bb6[_0xa255('0xf')]){if(_0x165bb6[_0xa255('0xf')][_0xa255('0x10')]===0x1f4){logger[_0xa255('0xf')](_0xa255('0xb'),_0x433023,_0x165bb6[_0xa255('0xf')][_0xa255('0x11')]);return _0x842dbb(_0x165bb6[_0xa255('0xf')][_0xa255('0x11')]);}logger[_0xa255('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x433023,_0x165bb6[_0xa255('0xf')][_0xa255('0x11')]);return _0x179633(_0x165bb6[_0xa255('0xf')][_0xa255('0x11')]);}else{logger['info'](_0xa255('0xb'),_0x433023,_0xa255('0xd'));_0x179633(_0x165bb6[_0xa255('0x12')][_0xa255('0x11')]);}})[_0xa255('0x13')](function(_0x65c37){logger[_0xa255('0xf')](_0xa255('0xb'),_0x433023,_0x65c37);_0x842dbb(_0x65c37);});});} \ No newline at end of file +var _0x40cb=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x34ac87,_0x3c1d01){var _0x2bbe19=function(_0x597103){while(--_0x597103){_0x34ac87['push'](_0x34ac87['shift']());}};_0x2bbe19(++_0x3c1d01);}(_0x40cb,0x108));var _0xb40c=function(_0xd0e9a,_0x26cdb2){_0xd0e9a=_0xd0e9a-0x0;var _0x2830d9=_0x40cb[_0xd0e9a];return _0x2830d9;};'use strict';var _=require(_0xb40c('0x0'));var util=require(_0xb40c('0x1'));var moment=require(_0xb40c('0x2'));var BPromise=require(_0xb40c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb40c('0x4'));var db=require(_0xb40c('0x5'))['db'];var utils=require(_0xb40c('0x6'));var logger=require(_0xb40c('0x7'))('rpc');var config=require(_0xb40c('0x8'));var jayson=require(_0xb40c('0x9'));var client=jayson['client'][_0xb40c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb9fba5,_0x198379,_0x3f0e0e){return new BPromise(function(_0x345f54,_0x389402){return client[_0xb40c('0xb')](_0xb9fba5,_0x3f0e0e)['then'](function(_0x9e3634){logger['info'](_0xb40c('0xc'),_0x198379,_0xb40c('0xd'));logger[_0xb40c('0xe')](_0xb40c('0xf'),_0x198379,_0xb40c('0xd'),JSON[_0xb40c('0x10')](_0x9e3634));if(_0x9e3634[_0xb40c('0x11')]){if(_0x9e3634[_0xb40c('0x11')]['code']===0x1f4){logger[_0xb40c('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x198379,_0x9e3634['error'][_0xb40c('0x12')]);return _0x389402(_0x9e3634[_0xb40c('0x11')]['message']);}logger[_0xb40c('0x11')](_0xb40c('0xc'),_0x198379,_0x9e3634[_0xb40c('0x11')][_0xb40c('0x12')]);return _0x345f54(_0x9e3634[_0xb40c('0x11')]['message']);}else{logger[_0xb40c('0x13')](_0xb40c('0xc'),_0x198379,_0xb40c('0xd'));_0x345f54(_0x9e3634[_0xb40c('0x14')][_0xb40c('0x12')]);}})[_0xb40c('0x15')](function(_0x43c4e6){logger[_0xb40c('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x198379,_0x43c4e6);_0x389402(_0x43c4e6);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a6d2812..26326de 100644 --- a/server/api/pause/index.js +++ b/server/api/pause/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60ca=['isAuthenticated','index','/:id','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','get'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x60ca,0x1ca));var _0xa60c=function(_0x5e0a7f,_0x1ca1ff){_0x5e0a7f=_0x5e0a7f-0x0;var _0x4975c8=_0x60ca[_0x5e0a7f];return _0x4975c8;};'use strict';var multer=require(_0xa60c('0x0'));var util=require(_0xa60c('0x1'));var path=require(_0xa60c('0x2'));var timeout=require(_0xa60c('0x3'));var express=require(_0xa60c('0x4'));var router=express[_0xa60c('0x5')]();var auth=require(_0xa60c('0x6'));var interaction=require(_0xa60c('0x7'));var config=require('../../config/environment');var controller=require(_0xa60c('0x8'));router[_0xa60c('0x9')]('/',auth[_0xa60c('0xa')](),controller[_0xa60c('0xb')]);router['get'](_0xa60c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa60c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa60c('0xe')](_0xa60c('0xc'),auth[_0xa60c('0xa')](),controller[_0xa60c('0xf')]);router['delete']('/:id',auth[_0xa60c('0xa')](),controller[_0xa60c('0x10')]);module[_0xa60c('0x11')]=router; \ No newline at end of file +var _0x1939=['create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post'];(function(_0x3f09dd,_0x69a6b5){var _0x391ae6=function(_0x3b583c){while(--_0x3b583c){_0x3f09dd['push'](_0x3f09dd['shift']());}};_0x391ae6(++_0x69a6b5);}(_0x1939,0xaf));var _0x9193=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0x1939[_0x1d3791];return _0x40fbf5;};'use strict';var multer=require(_0x9193('0x0'));var util=require(_0x9193('0x1'));var path=require(_0x9193('0x2'));var timeout=require('connect-timeout');var express=require(_0x9193('0x3'));var router=express[_0x9193('0x4')]();var auth=require(_0x9193('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x9193('0x6')]('/',auth[_0x9193('0x7')](),controller[_0x9193('0x8')]);router[_0x9193('0x6')](_0x9193('0x9'),auth[_0x9193('0x7')](),controller[_0x9193('0xa')]);router[_0x9193('0xb')]('/',auth[_0x9193('0x7')](),controller[_0x9193('0xc')]);router[_0x9193('0xd')](_0x9193('0x9'),auth[_0x9193('0x7')](),controller['update']);router[_0x9193('0xe')](_0x9193('0x9'),auth[_0x9193('0x7')](),controller[_0x9193('0xf')]);module[_0x9193('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index da42017..17a2f38 100644 --- a/server/api/pause/pause.attributes.js +++ b/server/api/pause/pause.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9d0=['STRING','sequelize','exports'];(function(_0x437425,_0x55b620){var _0x199d1b=function(_0x12c8ec){while(--_0x12c8ec){_0x437425['push'](_0x437425['shift']());}};_0x199d1b(++_0x55b620);}(_0xf9d0,0xf4));var _0x0f9d=function(_0x5ec926,_0x2905b7){_0x5ec926=_0x5ec926-0x0;var _0x1a90ca=_0xf9d0[_0x5ec926];return _0x1a90ca;};'use strict';var Sequelize=require(_0x0f9d('0x0'));module[_0x0f9d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0f9d('0x2')]}}; \ No newline at end of file +var _0x11a1=['name','sequelize','exports','STRING'];(function(_0x344e3d,_0x344459){var _0x5d41a6=function(_0x214fa0){while(--_0x214fa0){_0x344e3d['push'](_0x344e3d['shift']());}};_0x5d41a6(++_0x344459);}(_0x11a1,0xbd));var _0x111a=function(_0x206866,_0x2e6eea){_0x206866=_0x206866-0x0;var _0x389788=_0x11a1[_0x206866];return _0x389788;};'use strict';var Sequelize=require(_0x111a('0x0'));module[_0x111a('0x1')]={'name':{'type':Sequelize[_0x111a('0x2')],'unique':_0x111a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x111a('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 9667246..fb3c26d 100644 --- a/server/api/pause/pause.controller.js +++ b/server/api/pause/pause.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb09=['query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','name','merge','options','Pause','includeAll','findAll','show','length','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','reject','save','update','then','destroy','Pauses','UserProfileResource','end','stack','send','rawAttributes','type','model','map'];(function(_0x5cedc2,_0x1d8dd6){var _0x185555=function(_0x5ef3b8){while(--_0x5ef3b8){_0x5cedc2['push'](_0x5cedc2['shift']());}};_0x185555(++_0x1d8dd6);}(_0xcb09,0x1a0));var _0x9cb0=function(_0x5963ab,_0xe179e){_0x5963ab=_0x5963ab-0x0;var _0x4e27dd=_0xcb09[_0x5963ab];return _0x4e27dd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9cb0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9cb0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9cb0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9cb0('0x3'));var util=require(_0x9cb0('0x4'));var path=require(_0x9cb0('0x5'));var sox=require(_0x9cb0('0x6'));var csv=require(_0x9cb0('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9cb0('0x8'));var jsforce=require(_0x9cb0('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9cb0('0xa'));var Papa=require(_0x9cb0('0xb'));var Redis=require(_0x9cb0('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9cb0('0xd'));var as=require(_0x9cb0('0xe'));var hardwareService=require(_0x9cb0('0xf'));var logger=require('../../config/logger')(_0x9cb0('0x10'));var utils=require(_0x9cb0('0x11'));var config=require(_0x9cb0('0x12'));var db=require(_0x9cb0('0x13'))['db'];function respondWithStatusCode(_0x363005,_0x3ab270){_0x3ab270=_0x3ab270||0xcc;return function(_0x30a6a3){if(_0x30a6a3){return _0x363005[_0x9cb0('0x14')](_0x3ab270);}return _0x363005[_0x9cb0('0x15')](_0x3ab270)['end']();};}function respondWithResult(_0x4f88c4,_0x3d90f5){_0x3d90f5=_0x3d90f5||0xc8;return function(_0xb04f57){if(_0xb04f57){return _0x4f88c4['status'](_0x3d90f5)['json'](_0xb04f57);}};}function respondWithFilteredResult(_0x4634fd,_0x4c5af4){return function(_0x35f673){if(_0x35f673){var _0x281708=_0x35f673[_0x9cb0('0x16')],_0x30017a=_0x4c5af4[_0x9cb0('0x17')],_0xd5d84=_0x4c5af4['offset']+_0x4c5af4[_0x9cb0('0x18')],_0x2cf721;if(_0xd5d84>=_0x281708){_0xd5d84=_0x281708;_0x2cf721=0xc8;}else{_0x2cf721=0xce;}_0x4634fd[_0x9cb0('0x15')](_0x2cf721);return _0x4634fd['set'](_0x9cb0('0x19'),_0x30017a+'-'+_0xd5d84+'/'+_0x281708)['json'](_0x35f673);}return null;};}function patchUpdates(_0x1e3af7){return function(_0x17d8bc){try{jsonpatch['apply'](_0x17d8bc,_0x1e3af7,!![]);}catch(_0x4290fb){return BPromise[_0x9cb0('0x1a')](_0x4290fb);}return _0x17d8bc[_0x9cb0('0x1b')]();};}function saveUpdates(_0x2ddbd3,_0x53dc0d){return function(_0x2e8821){if(_0x2e8821){return _0x2e8821[_0x9cb0('0x1c')](_0x2ddbd3)[_0x9cb0('0x1d')](function(_0x24959a){return _0x24959a;});}return null;};}function removeEntity(_0x1d3070,_0xf83d0a){return function(_0x2c7955){if(_0x2c7955){return _0x2c7955[_0x9cb0('0x1e')]()[_0x9cb0('0x1d')](function(){var _0x441497=_0x2c7955['get']({'plain':!![]});var _0xaa7cfb=_0x9cb0('0x1f');return db[_0x9cb0('0x20')]['destroy']({'where':{'type':_0xaa7cfb,'resourceId':_0x441497['id']}})[_0x9cb0('0x1d')](function(){return _0x2c7955;});})[_0x9cb0('0x1d')](function(){_0x1d3070[_0x9cb0('0x15')](0xcc)[_0x9cb0('0x21')]();});}};}function handleEntityNotFound(_0x5522c7,_0x1956f8){return function(_0x36ea1e){if(!_0x36ea1e){_0x5522c7[_0x9cb0('0x14')](0x194);}return _0x36ea1e;};}function handleError(_0x50a478,_0x59fe7d){_0x59fe7d=_0x59fe7d||0x1f4;return function(_0x15fbd8){logger['error'](_0x15fbd8[_0x9cb0('0x22')]);if(_0x15fbd8['name']){delete _0x15fbd8['name'];}_0x50a478[_0x9cb0('0x15')](_0x59fe7d)[_0x9cb0('0x23')](_0x15fbd8);};}exports['index']=function(_0xab9c15,_0x2f5a99){var _0x109686={},_0x18ae85={},_0x9245e4={'count':0x0,'rows':[]};var _0x4b809c=_['map'](db['Pause'][_0x9cb0('0x24')],function(_0x212dcc){return{'name':_0x212dcc['fieldName'],'type':_0x212dcc[_0x9cb0('0x25')]['key']};});_0x18ae85[_0x9cb0('0x26')]=_[_0x9cb0('0x27')](_0x4b809c,'name');_0x18ae85[_0x9cb0('0x28')]=_[_0x9cb0('0x29')](_0xab9c15[_0x9cb0('0x28')]);_0x18ae85['filters']=_[_0x9cb0('0x2a')](_0x18ae85[_0x9cb0('0x26')],_0x18ae85[_0x9cb0('0x28')]);_0x109686['attributes']=_[_0x9cb0('0x2a')](_0x18ae85[_0x9cb0('0x26')],qs['fields'](_0xab9c15['query'][_0x9cb0('0x2b')]));_0x109686['attributes']=_0x109686[_0x9cb0('0x2c')]['length']?_0x109686[_0x9cb0('0x2c')]:_0x18ae85[_0x9cb0('0x26')];if(!_0xab9c15['query'][_0x9cb0('0x2d')]('nolimit')){_0x109686[_0x9cb0('0x18')]=qs[_0x9cb0('0x18')](_0xab9c15['query']['limit']);_0x109686[_0x9cb0('0x17')]=qs[_0x9cb0('0x17')](_0xab9c15[_0x9cb0('0x28')][_0x9cb0('0x17')]);}_0x109686[_0x9cb0('0x2e')]=qs[_0x9cb0('0x2f')](_0xab9c15['query'][_0x9cb0('0x2f')]);_0x109686[_0x9cb0('0x30')]=qs[_0x9cb0('0x31')](_[_0x9cb0('0x32')](_0xab9c15[_0x9cb0('0x28')],_0x18ae85[_0x9cb0('0x31')]));if(_0xab9c15['query'][_0x9cb0('0x33')]){_0x109686[_0x9cb0('0x30')]=_['merge'](_0x109686[_0x9cb0('0x30')],{'$or':_[_0x9cb0('0x27')](_0x4b809c,function(_0xc201ee){if(_0xc201ee[_0x9cb0('0x25')]!==_0x9cb0('0x34')){var _0x354c24={};_0x354c24[_0xc201ee[_0x9cb0('0x35')]]={'$like':'%'+_0xab9c15[_0x9cb0('0x28')]['filter']+'%'};return _0x354c24;}})});}_0x109686=_[_0x9cb0('0x36')]({},_0x109686,_0xab9c15[_0x9cb0('0x37')]);var _0x395e86={'where':_0x109686[_0x9cb0('0x30')]};return db[_0x9cb0('0x38')][_0x9cb0('0x16')](_0x395e86)[_0x9cb0('0x1d')](function(_0x14e90a){_0x9245e4[_0x9cb0('0x16')]=_0x14e90a;if(_0xab9c15[_0x9cb0('0x28')][_0x9cb0('0x39')]){_0x109686['include']=[{'all':!![]}];}return db[_0x9cb0('0x38')][_0x9cb0('0x3a')](_0x109686);})['then'](function(_0x116a77){_0x9245e4['rows']=_0x116a77;return _0x9245e4;})[_0x9cb0('0x1d')](respondWithFilteredResult(_0x2f5a99,_0x109686))['catch'](handleError(_0x2f5a99,null));};exports[_0x9cb0('0x3b')]=function(_0x5d4625,_0x3a28f9){var _0x21cd65={'raw':!![],'where':{'id':_0x5d4625['params']['id']}},_0x2cd90b={};_0x2cd90b[_0x9cb0('0x26')]=_[_0x9cb0('0x29')](db[_0x9cb0('0x38')][_0x9cb0('0x24')]);_0x2cd90b[_0x9cb0('0x28')]=_[_0x9cb0('0x29')](_0x5d4625[_0x9cb0('0x28')]);_0x2cd90b[_0x9cb0('0x31')]=_[_0x9cb0('0x2a')](_0x2cd90b['model'],_0x2cd90b[_0x9cb0('0x28')]);_0x21cd65[_0x9cb0('0x2c')]=_[_0x9cb0('0x2a')](_0x2cd90b[_0x9cb0('0x26')],qs['fields'](_0x5d4625['query'][_0x9cb0('0x2b')]));_0x21cd65[_0x9cb0('0x2c')]=_0x21cd65[_0x9cb0('0x2c')][_0x9cb0('0x3c')]?_0x21cd65[_0x9cb0('0x2c')]:_0x2cd90b[_0x9cb0('0x26')];if(_0x5d4625[_0x9cb0('0x28')][_0x9cb0('0x39')]){_0x21cd65[_0x9cb0('0x3d')]=[{'all':!![]}];}_0x21cd65=_[_0x9cb0('0x36')]({},_0x21cd65,_0x5d4625['options']);return db['Pause'][_0x9cb0('0x3e')](_0x21cd65)[_0x9cb0('0x1d')](handleEntityNotFound(_0x3a28f9,null))[_0x9cb0('0x1d')](respondWithResult(_0x3a28f9,null))[_0x9cb0('0x3f')](handleError(_0x3a28f9,null));};exports[_0x9cb0('0x40')]=function(_0x1966fd,_0x13ce27){return db[_0x9cb0('0x38')][_0x9cb0('0x40')](_0x1966fd[_0x9cb0('0x41')],{})['then'](function(_0x57190b){var _0x12e611=_0x1966fd[_0x9cb0('0x42')][_0x9cb0('0x43')]({'plain':!![]});if(!_0x12e611)throw new Error(_0x9cb0('0x44'));if(_0x12e611[_0x9cb0('0x45')]==='user'){var _0x1080f2=_0x57190b[_0x9cb0('0x43')]({'plain':!![]});var _0x33c3b3=_0x9cb0('0x1f');return db[_0x9cb0('0x46')][_0x9cb0('0x3e')]({'where':{'name':_0x33c3b3,'userProfileId':_0x12e611[_0x9cb0('0x47')]},'raw':!![]})[_0x9cb0('0x1d')](function(_0x433806){if(_0x433806&&_0x433806[_0x9cb0('0x48')]===0x0){return db[_0x9cb0('0x20')][_0x9cb0('0x40')]({'name':_0x1080f2[_0x9cb0('0x35')],'resourceId':_0x1080f2['id'],'type':_0x433806['name'],'sectionId':_0x433806['id']},{})[_0x9cb0('0x1d')](function(){return _0x57190b;});}else{return _0x57190b;}})[_0x9cb0('0x3f')](function(_0x313311){logger[_0x9cb0('0x49')](_0x9cb0('0x4a'),_0x313311);throw _0x313311;});}return _0x57190b;})[_0x9cb0('0x1d')](respondWithResult(_0x13ce27,0xc9))[_0x9cb0('0x3f')](handleError(_0x13ce27,null));};exports[_0x9cb0('0x1c')]=function(_0x444c9f,_0x167f59){if(_0x444c9f[_0x9cb0('0x41')]['id']){delete _0x444c9f[_0x9cb0('0x41')]['id'];}return db[_0x9cb0('0x38')]['find']({'where':{'id':_0x444c9f[_0x9cb0('0x4b')]['id']}})[_0x9cb0('0x1d')](handleEntityNotFound(_0x167f59,null))[_0x9cb0('0x1d')](saveUpdates(_0x444c9f[_0x9cb0('0x41')],null))['then'](respondWithResult(_0x167f59,null))[_0x9cb0('0x3f')](handleError(_0x167f59,null));};exports[_0x9cb0('0x1e')]=function(_0x3695de,_0x5e1dd4){return db[_0x9cb0('0x38')][_0x9cb0('0x3e')]({'where':{'id':_0x3695de[_0x9cb0('0x4b')]['id']}})[_0x9cb0('0x1d')](handleEntityNotFound(_0x5e1dd4,null))['then'](removeEntity(_0x5e1dd4,null))['catch'](handleError(_0x5e1dd4,null));}; \ No newline at end of file +var _0xbf9c=['length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','show','params','keys','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','html-pdf','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields'];(function(_0x27d895,_0x311607){var _0x121939=function(_0x3a03a7){while(--_0x3a03a7){_0x27d895['push'](_0x27d895['shift']());}};_0x121939(++_0x311607);}(_0xbf9c,0x1c5));var _0xcbf9=function(_0x3ad108,_0x30e894){_0x3ad108=_0x3ad108-0x0;var _0x38f5a4=_0xbf9c[_0x3ad108];return _0x38f5a4;};'use strict';var pdf=require(_0xcbf9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcbf9('0x1'));var zipdir=require(_0xcbf9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcbf9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcbf9('0x4'));var util=require(_0xcbf9('0x5'));var path=require(_0xcbf9('0x6'));var sox=require(_0xcbf9('0x7'));var csv=require(_0xcbf9('0x8'));var ejs=require(_0xcbf9('0x9'));var fs=require('fs');var _=require(_0xcbf9('0xa'));var squel=require(_0xcbf9('0xb'));var crypto=require(_0xcbf9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcbf9('0xd'));var toCsv=require(_0xcbf9('0x8'));var querystring=require('querystring');var Papa=require(_0xcbf9('0xe'));var Redis=require(_0xcbf9('0xf'));var authService=require(_0xcbf9('0x10'));var qs=require(_0xcbf9('0x11'));var as=require(_0xcbf9('0x12'));var hardwareService=require(_0xcbf9('0x13'));var logger=require(_0xcbf9('0x14'))(_0xcbf9('0x15'));var utils=require(_0xcbf9('0x16'));var config=require(_0xcbf9('0x17'));var db=require(_0xcbf9('0x18'))['db'];function respondWithStatusCode(_0x2f41da,_0x35261b){_0x35261b=_0x35261b||0xcc;return function(_0x243d11){if(_0x243d11){return _0x2f41da[_0xcbf9('0x19')](_0x35261b);}return _0x2f41da[_0xcbf9('0x1a')](_0x35261b)[_0xcbf9('0x1b')]();};}function respondWithResult(_0x3e52b0,_0x43aea0){_0x43aea0=_0x43aea0||0xc8;return function(_0x1fd26f){if(_0x1fd26f){return _0x3e52b0[_0xcbf9('0x1a')](_0x43aea0)[_0xcbf9('0x1c')](_0x1fd26f);}};}function respondWithFilteredResult(_0x31da1b,_0x130a5f){return function(_0x4cda98){if(_0x4cda98){var _0x301c61=_0x4cda98[_0xcbf9('0x1d')],_0x4b0118=_0x130a5f[_0xcbf9('0x1e')],_0x1c3854=_0x130a5f[_0xcbf9('0x1e')]+_0x130a5f[_0xcbf9('0x1f')],_0x980d96;if(_0x1c3854>=_0x301c61){_0x1c3854=_0x301c61;_0x980d96=0xc8;}else{_0x980d96=0xce;}_0x31da1b[_0xcbf9('0x1a')](_0x980d96);return _0x31da1b['set'](_0xcbf9('0x20'),_0x4b0118+'-'+_0x1c3854+'/'+_0x301c61)[_0xcbf9('0x1c')](_0x4cda98);}return null;};}function patchUpdates(_0x333541){return function(_0x556c39){try{jsonpatch[_0xcbf9('0x21')](_0x556c39,_0x333541,!![]);}catch(_0x5d97a8){return BPromise[_0xcbf9('0x22')](_0x5d97a8);}return _0x556c39[_0xcbf9('0x23')]();};}function saveUpdates(_0x34a22b,_0x593586){return function(_0x190e2e){if(_0x190e2e){return _0x190e2e['update'](_0x34a22b)[_0xcbf9('0x24')](function(_0x196a14){return _0x196a14;});}return null;};}function removeEntity(_0x5bafaa,_0x48fa7c){return function(_0x27cd63){if(_0x27cd63){return _0x27cd63[_0xcbf9('0x25')]()[_0xcbf9('0x24')](function(){var _0x519e95=_0x27cd63['get']({'plain':!![]});var _0x7beb6d=_0xcbf9('0x26');return db[_0xcbf9('0x27')][_0xcbf9('0x25')]({'where':{'type':_0x7beb6d,'resourceId':_0x519e95['id']}})[_0xcbf9('0x24')](function(){return _0x27cd63;});})[_0xcbf9('0x24')](function(){_0x5bafaa[_0xcbf9('0x1a')](0xcc)[_0xcbf9('0x1b')]();});}};}function handleEntityNotFound(_0x3c3e9e,_0x241ba9){return function(_0xa7713f){if(!_0xa7713f){_0x3c3e9e[_0xcbf9('0x19')](0x194);}return _0xa7713f;};}function handleError(_0x226404,_0x589866){_0x589866=_0x589866||0x1f4;return function(_0x218c15){logger[_0xcbf9('0x28')](_0x218c15[_0xcbf9('0x29')]);if(_0x218c15['name']){delete _0x218c15[_0xcbf9('0x2a')];}_0x226404[_0xcbf9('0x1a')](_0x589866)[_0xcbf9('0x2b')](_0x218c15);};}exports[_0xcbf9('0x2c')]=function(_0x8af9b3,_0x25054c){var _0x1ad0b5={},_0x1a6c78={},_0x158a85={'count':0x0,'rows':[]};var _0x5551e0=_[_0xcbf9('0x2d')](db[_0xcbf9('0x2e')][_0xcbf9('0x2f')],function(_0x1046c7){return{'name':_0x1046c7[_0xcbf9('0x30')],'type':_0x1046c7[_0xcbf9('0x31')][_0xcbf9('0x32')]};});_0x1a6c78['model']=_['map'](_0x5551e0,_0xcbf9('0x2a'));_0x1a6c78[_0xcbf9('0x33')]=_['keys'](_0x8af9b3[_0xcbf9('0x33')]);_0x1a6c78[_0xcbf9('0x34')]=_[_0xcbf9('0x35')](_0x1a6c78[_0xcbf9('0x36')],_0x1a6c78[_0xcbf9('0x33')]);_0x1ad0b5[_0xcbf9('0x37')]=_[_0xcbf9('0x35')](_0x1a6c78['model'],qs[_0xcbf9('0x38')](_0x8af9b3[_0xcbf9('0x33')][_0xcbf9('0x38')]));_0x1ad0b5[_0xcbf9('0x37')]=_0x1ad0b5[_0xcbf9('0x37')][_0xcbf9('0x39')]?_0x1ad0b5[_0xcbf9('0x37')]:_0x1a6c78[_0xcbf9('0x36')];if(!_0x8af9b3[_0xcbf9('0x33')]['hasOwnProperty'](_0xcbf9('0x3a'))){_0x1ad0b5['limit']=qs[_0xcbf9('0x1f')](_0x8af9b3[_0xcbf9('0x33')]['limit']);_0x1ad0b5['offset']=qs['offset'](_0x8af9b3[_0xcbf9('0x33')][_0xcbf9('0x1e')]);}_0x1ad0b5[_0xcbf9('0x3b')]=qs[_0xcbf9('0x3c')](_0x8af9b3[_0xcbf9('0x33')][_0xcbf9('0x3c')]);_0x1ad0b5['where']=qs['filters'](_[_0xcbf9('0x3d')](_0x8af9b3[_0xcbf9('0x33')],_0x1a6c78['filters']));if(_0x8af9b3[_0xcbf9('0x33')]['filter']){_0x1ad0b5[_0xcbf9('0x3e')]=_[_0xcbf9('0x3f')](_0x1ad0b5[_0xcbf9('0x3e')],{'$or':_['map'](_0x5551e0,function(_0x349501){if(_0x349501['type']!==_0xcbf9('0x40')){var _0xd67bb3={};_0xd67bb3[_0x349501[_0xcbf9('0x2a')]]={'$like':'%'+_0x8af9b3[_0xcbf9('0x33')][_0xcbf9('0x41')]+'%'};return _0xd67bb3;}})});}_0x1ad0b5=_[_0xcbf9('0x3f')]({},_0x1ad0b5,_0x8af9b3[_0xcbf9('0x42')]);var _0xbc1671={'where':_0x1ad0b5[_0xcbf9('0x3e')]};return db[_0xcbf9('0x2e')]['count'](_0xbc1671)['then'](function(_0x5ee0c1){_0x158a85['count']=_0x5ee0c1;if(_0x8af9b3['query'][_0xcbf9('0x43')]){_0x1ad0b5[_0xcbf9('0x44')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x1ad0b5);})[_0xcbf9('0x24')](function(_0x2f367b){_0x158a85['rows']=_0x2f367b;return _0x158a85;})[_0xcbf9('0x24')](respondWithFilteredResult(_0x25054c,_0x1ad0b5))['catch'](handleError(_0x25054c,null));};exports[_0xcbf9('0x45')]=function(_0x76e877,_0x59959e){var _0x3be8d9={'raw':!![],'where':{'id':_0x76e877[_0xcbf9('0x46')]['id']}},_0x7002f6={};_0x7002f6[_0xcbf9('0x36')]=_[_0xcbf9('0x47')](db[_0xcbf9('0x2e')][_0xcbf9('0x2f')]);_0x7002f6[_0xcbf9('0x33')]=_[_0xcbf9('0x47')](_0x76e877['query']);_0x7002f6[_0xcbf9('0x34')]=_[_0xcbf9('0x35')](_0x7002f6[_0xcbf9('0x36')],_0x7002f6[_0xcbf9('0x33')]);_0x3be8d9[_0xcbf9('0x37')]=_['intersection'](_0x7002f6[_0xcbf9('0x36')],qs[_0xcbf9('0x38')](_0x76e877['query']['fields']));_0x3be8d9[_0xcbf9('0x37')]=_0x3be8d9[_0xcbf9('0x37')][_0xcbf9('0x39')]?_0x3be8d9['attributes']:_0x7002f6[_0xcbf9('0x36')];if(_0x76e877['query']['includeAll']){_0x3be8d9['include']=[{'all':!![]}];}_0x3be8d9=_['merge']({},_0x3be8d9,_0x76e877[_0xcbf9('0x42')]);return db[_0xcbf9('0x2e')][_0xcbf9('0x48')](_0x3be8d9)[_0xcbf9('0x24')](handleEntityNotFound(_0x59959e,null))[_0xcbf9('0x24')](respondWithResult(_0x59959e,null))[_0xcbf9('0x49')](handleError(_0x59959e,null));};exports[_0xcbf9('0x4a')]=function(_0x343794,_0x234fd2){return db[_0xcbf9('0x2e')][_0xcbf9('0x4a')](_0x343794['body'],{})[_0xcbf9('0x24')](function(_0x5592d4){var _0x58f945=_0x343794[_0xcbf9('0x4b')][_0xcbf9('0x4c')]({'plain':!![]});if(!_0x58f945)throw new Error(_0xcbf9('0x4d'));if(_0x58f945[_0xcbf9('0x4e')]===_0xcbf9('0x4b')){var _0xb379b7=_0x5592d4['get']({'plain':!![]});var _0x4a5d51=_0xcbf9('0x26');return db[_0xcbf9('0x4f')][_0xcbf9('0x48')]({'where':{'name':_0x4a5d51,'userProfileId':_0x58f945[_0xcbf9('0x50')]},'raw':!![]})['then'](function(_0x1a1e4a){if(_0x1a1e4a&&_0x1a1e4a[_0xcbf9('0x51')]===0x0){return db[_0xcbf9('0x27')][_0xcbf9('0x4a')]({'name':_0xb379b7[_0xcbf9('0x2a')],'resourceId':_0xb379b7['id'],'type':_0x1a1e4a[_0xcbf9('0x2a')],'sectionId':_0x1a1e4a['id']},{})[_0xcbf9('0x24')](function(){return _0x5592d4;});}else{return _0x5592d4;}})[_0xcbf9('0x49')](function(_0x36ee43){logger[_0xcbf9('0x28')](_0xcbf9('0x52'),_0x36ee43);throw _0x36ee43;});}return _0x5592d4;})[_0xcbf9('0x24')](respondWithResult(_0x234fd2,0xc9))[_0xcbf9('0x49')](handleError(_0x234fd2,null));};exports[_0xcbf9('0x53')]=function(_0x5c2d4e,_0x2bc637){if(_0x5c2d4e[_0xcbf9('0x54')]['id']){delete _0x5c2d4e[_0xcbf9('0x54')]['id'];}return db['Pause'][_0xcbf9('0x48')]({'where':{'id':_0x5c2d4e['params']['id']}})['then'](handleEntityNotFound(_0x2bc637,null))['then'](saveUpdates(_0x5c2d4e[_0xcbf9('0x54')],null))['then'](respondWithResult(_0x2bc637,null))[_0xcbf9('0x49')](handleError(_0x2bc637,null));};exports[_0xcbf9('0x25')]=function(_0x181e47,_0x27fe6b){return db['Pause'][_0xcbf9('0x48')]({'where':{'id':_0x181e47[_0xcbf9('0x46')]['id']}})['then'](handleEntityNotFound(_0x27fe6b,null))['then'](removeEntity(_0x27fe6b,null))[_0xcbf9('0x49')](handleError(_0x27fe6b,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 0010529..5b434a6 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88c7=['api','moment','path','rimraf','./pause.attributes','exports','define','lodash'];(function(_0x3889ae,_0x4770c3){var _0x6533dd=function(_0x4275f7){while(--_0x4275f7){_0x3889ae['push'](_0x3889ae['shift']());}};_0x6533dd(++_0x4770c3);}(_0x88c7,0x6f));var _0x788c=function(_0x357411,_0xb8308e){_0x357411=_0x357411-0x0;var _0x2a72be=_0x88c7[_0x357411];return _0x2a72be;};'use strict';var _=require(_0x788c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x788c('0x1'));var moment=require(_0x788c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x788c('0x3'));var rimraf=require(_0x788c('0x4'));var config=require('../../config/environment');var attributes=require(_0x788c('0x5'));module[_0x788c('0x6')]=function(_0x4e6f8b,_0xbde9d1){return _0x4e6f8b[_0x788c('0x7')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3423=['Pause','tools_pauses','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define'];(function(_0x597eb2,_0x165f5c){var _0x56875f=function(_0x5de36e){while(--_0x5de36e){_0x597eb2['push'](_0x597eb2['shift']());}};_0x56875f(++_0x165f5c);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require(_0x3342('0x8'));module[_0x3342('0x9')]=function(_0x467453,_0x2ccbe0){return _0x467453[_0x3342('0xa')](_0x3342('0xb'),attributes,{'tableName':_0x3342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index efcd9f0..6cc6733 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fb7=['request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowPause','find','options','where','attributes','include','map','model','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x355090,_0x397f24){var _0x145086=function(_0x8b708e){while(--_0x8b708e){_0x355090['push'](_0x355090['shift']());}};_0x145086(++_0x397f24);}(_0x3fb7,0x189));var _0x73fb=function(_0x394e5b,_0x434567){_0x394e5b=_0x394e5b-0x0;var _0x5a1644=_0x3fb7[_0x394e5b];return _0x5a1644;};'use strict';var _=require('lodash');var util=require(_0x73fb('0x0'));var moment=require('moment');var BPromise=require(_0x73fb('0x1'));var rs=require(_0x73fb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73fb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x73fb('0x4'))(_0x73fb('0x5'));var config=require(_0x73fb('0x6'));var jayson=require(_0x73fb('0x7'));var client=jayson[_0x73fb('0x8')][_0x73fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33d35b,_0x65ffd5,_0x1455de){return new BPromise(function(_0x2413ee,_0x2c0bd5){return client[_0x73fb('0xa')](_0x33d35b,_0x1455de)[_0x73fb('0xb')](function(_0x312912){logger[_0x73fb('0xc')](_0x73fb('0xd'),_0x65ffd5,_0x73fb('0xe'));logger[_0x73fb('0xf')](_0x73fb('0x10'),_0x65ffd5,_0x73fb('0xe'),JSON[_0x73fb('0x11')](_0x312912));if(_0x312912[_0x73fb('0x12')]){if(_0x312912['error'][_0x73fb('0x13')]===0x1f4){logger['error'](_0x73fb('0xd'),_0x65ffd5,_0x312912[_0x73fb('0x12')][_0x73fb('0x14')]);return _0x2c0bd5(_0x312912[_0x73fb('0x12')][_0x73fb('0x14')]);}logger[_0x73fb('0x12')](_0x73fb('0xd'),_0x65ffd5,_0x312912[_0x73fb('0x12')][_0x73fb('0x14')]);return _0x2413ee(_0x312912[_0x73fb('0x12')][_0x73fb('0x14')]);}else{logger[_0x73fb('0xc')](_0x73fb('0xd'),_0x65ffd5,'request\x20sent');_0x2413ee(_0x312912[_0x73fb('0x15')]['message']);}})['catch'](function(_0x185c9b){logger[_0x73fb('0x12')]('Pause,\x20%s,\x20%s',_0x65ffd5,_0x185c9b);_0x2c0bd5(_0x185c9b);});});}exports[_0x73fb('0x16')]=function(_0x1c9fa3){var _0x2de617=this;return new Promise(function(_0x3ea9dd,_0x4ee169){return db['Pause'][_0x73fb('0x17')]({'raw':_0x1c9fa3[_0x73fb('0x18')]?_0x1c9fa3[_0x73fb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1c9fa3[_0x73fb('0x18')]?_0x1c9fa3[_0x73fb('0x18')][_0x73fb('0x19')]||null:null,'attributes':_0x1c9fa3[_0x73fb('0x18')]?_0x1c9fa3[_0x73fb('0x18')][_0x73fb('0x1a')]||null:null,'include':_0x1c9fa3['options']?_0x1c9fa3[_0x73fb('0x18')][_0x73fb('0x1b')]?_[_0x73fb('0x1c')](_0x1c9fa3['options']['include'],function(_0x357967){return{'model':db[_0x357967[_0x73fb('0x1d')]],'as':_0x357967['as'],'attributes':_0x357967['attributes'],'include':_0x357967[_0x73fb('0x1b')]?_[_0x73fb('0x1c')](_0x357967[_0x73fb('0x1b')],function(_0x23d849){return{'model':db[_0x23d849[_0x73fb('0x1d')]],'as':_0x23d849['as'],'attributes':_0x23d849[_0x73fb('0x1a')],'include':_0x23d849[_0x73fb('0x1b')]?_[_0x73fb('0x1c')](_0x23d849[_0x73fb('0x1b')],function(_0x5286b9){return{'model':db[_0x5286b9['model']],'as':_0x5286b9['as'],'attributes':_0x5286b9[_0x73fb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x73fb('0xb')](function(_0x3fa7f0){logger[_0x73fb('0xc')](_0x73fb('0x16'),_0x1c9fa3);logger[_0x73fb('0xf')](_0x73fb('0x16'),_0x1c9fa3,JSON['stringify'](_0x3fa7f0));_0x3ea9dd(_0x3fa7f0);})[_0x73fb('0x1e')](function(_0x281449){logger[_0x73fb('0x12')](_0x73fb('0x16'),_0x281449[_0x73fb('0x14')],_0x1c9fa3);_0x4ee169(_0x2de617[_0x73fb('0x12')](0x1f4,_0x281449[_0x73fb('0x14')]));});});}; \ No newline at end of file +var _0x5d37=['then','info','Pause,\x20%s,\x20%s','debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowPause','Pause','find','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x349915,_0x124261){var _0x8be4f3=function(_0x3a82a9){while(--_0x3a82a9){_0x349915['push'](_0x349915['shift']());}};_0x8be4f3(++_0x124261);}(_0x5d37,0x135));var _0x75d3=function(_0x3b1109,_0x38c97e){_0x3b1109=_0x3b1109-0x0;var _0x2905d6=_0x5d37[_0x3b1109];return _0x2905d6;};'use strict';var _=require(_0x75d3('0x0'));var util=require('util');var moment=require(_0x75d3('0x1'));var BPromise=require(_0x75d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75d3('0x3'));var db=require(_0x75d3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d3('0x5'))(_0x75d3('0x6'));var config=require(_0x75d3('0x7'));var jayson=require(_0x75d3('0x8'));var client=jayson[_0x75d3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2786e5,_0x1a3f1b,_0x34af85){return new BPromise(function(_0x82fbfe,_0x40d315){return client[_0x75d3('0xa')](_0x2786e5,_0x34af85)[_0x75d3('0xb')](function(_0x3a676b){logger[_0x75d3('0xc')](_0x75d3('0xd'),_0x1a3f1b,'request\x20sent');logger[_0x75d3('0xe')](_0x75d3('0xf'),_0x1a3f1b,_0x75d3('0x10'),JSON[_0x75d3('0x11')](_0x3a676b));if(_0x3a676b['error']){if(_0x3a676b[_0x75d3('0x12')][_0x75d3('0x13')]===0x1f4){logger[_0x75d3('0x12')]('Pause,\x20%s,\x20%s',_0x1a3f1b,_0x3a676b[_0x75d3('0x12')]['message']);return _0x40d315(_0x3a676b[_0x75d3('0x12')][_0x75d3('0x14')]);}logger['error'](_0x75d3('0xd'),_0x1a3f1b,_0x3a676b['error']['message']);return _0x82fbfe(_0x3a676b['error'][_0x75d3('0x14')]);}else{logger[_0x75d3('0xc')](_0x75d3('0xd'),_0x1a3f1b,_0x75d3('0x10'));_0x82fbfe(_0x3a676b['result'][_0x75d3('0x14')]);}})[_0x75d3('0x15')](function(_0x59e291){logger[_0x75d3('0x12')](_0x75d3('0xd'),_0x1a3f1b,_0x59e291);_0x40d315(_0x59e291);});});}exports[_0x75d3('0x16')]=function(_0x1ce594){var _0x4f03ed=this;return new Promise(function(_0x3726fb,_0x265d62){return db[_0x75d3('0x17')][_0x75d3('0x18')]({'raw':_0x1ce594[_0x75d3('0x19')]?_0x1ce594[_0x75d3('0x19')][_0x75d3('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ce594[_0x75d3('0x19')]?_0x1ce594[_0x75d3('0x19')][_0x75d3('0x1b')]||null:null,'attributes':_0x1ce594[_0x75d3('0x19')]?_0x1ce594[_0x75d3('0x19')][_0x75d3('0x1c')]||null:null,'include':_0x1ce594['options']?_0x1ce594[_0x75d3('0x19')][_0x75d3('0x1d')]?_[_0x75d3('0x1e')](_0x1ce594[_0x75d3('0x19')][_0x75d3('0x1d')],function(_0x1a51f0){return{'model':db[_0x1a51f0[_0x75d3('0x1f')]],'as':_0x1a51f0['as'],'attributes':_0x1a51f0[_0x75d3('0x1c')],'include':_0x1a51f0[_0x75d3('0x1d')]?_[_0x75d3('0x1e')](_0x1a51f0['include'],function(_0x317e73){return{'model':db[_0x317e73[_0x75d3('0x1f')]],'as':_0x317e73['as'],'attributes':_0x317e73[_0x75d3('0x1c')],'include':_0x317e73[_0x75d3('0x1d')]?_[_0x75d3('0x1e')](_0x317e73[_0x75d3('0x1d')],function(_0x296b0e){return{'model':db[_0x296b0e[_0x75d3('0x1f')]],'as':_0x296b0e['as'],'attributes':_0x296b0e[_0x75d3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x75d3('0xb')](function(_0x1fbc66){logger[_0x75d3('0xc')](_0x75d3('0x16'),_0x1ce594);logger['debug']('ShowPause',_0x1ce594,JSON[_0x75d3('0x11')](_0x1fbc66));_0x3726fb(_0x1fbc66);})['catch'](function(_0x28fdf2){logger[_0x75d3('0x12')]('ShowPause',_0x28fdf2[_0x75d3('0x14')],_0x1ce594);_0x265d62(_0x4f03ed['error'](0x1f4,_0x28fdf2[_0x75d3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8147c50..80a030e 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0d3=['../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','show','/:id/download','isAuthenticated','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','extname','now','post','single','file','webhookPost','put','exports','multer','util','path','connect-timeout','Router'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xe0d3,0x9b));var _0x3e0d=function(_0x4b03c2,_0x513a21){_0x4b03c2=_0x4b03c2-0x0;var _0x5c00c3=_0xe0d3[_0x4b03c2];return _0x5c00c3;};'use strict';var multer=require(_0x3e0d('0x0'));var util=require(_0x3e0d('0x1'));var path=require(_0x3e0d('0x2'));var timeout=require(_0x3e0d('0x3'));var express=require('express');var router=express[_0x3e0d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3e0d('0x5'));var config=require(_0x3e0d('0x6'));var controller=require(_0x3e0d('0x7'));router[_0x3e0d('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e0d('0x9')]);router[_0x3e0d('0x8')](_0x3e0d('0xa'),controller[_0x3e0d('0xb')]);router[_0x3e0d('0x8')](_0x3e0d('0xc'),auth['isAuthenticated'](),controller[_0x3e0d('0xd')]);router['get'](_0x3e0d('0xe'),auth[_0x3e0d('0xf')](),controller['download']);var upload=multer({'storage':multer[_0x3e0d('0x10')]({'destination':function(_0x54067c,_0xd55d1,_0x52825e){_0x52825e(null,path[_0x3e0d('0x11')](config[_0x3e0d('0x12')],_0x3e0d('0x13')));},'filename':function(_0x1fb8f1,_0x734a9b,_0x6fcdd3){_0x734a9b['originalname']=_0x734a9b[_0x3e0d('0x14')][_0x3e0d('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6fcdd3(null,util[_0x3e0d('0x16')]('%s-%s%s',path[_0x3e0d('0x17')](_0x734a9b[_0x3e0d('0x14')],path[_0x3e0d('0x18')](_0x734a9b['originalname'])),Date[_0x3e0d('0x19')](),path[_0x3e0d('0x18')](_0x734a9b[_0x3e0d('0x14')])));}})});router[_0x3e0d('0x1a')]('/',upload[_0x3e0d('0x1b')](_0x3e0d('0x1c')),controller['upload']);router[_0x3e0d('0x1a')](_0x3e0d('0xa'),controller[_0x3e0d('0x1d')]);router[_0x3e0d('0x1e')](_0x3e0d('0xc'),auth[_0x3e0d('0xf')](),controller['update']);router['delete'](_0x3e0d('0xc'),auth[_0x3e0d('0xf')](),controller['delete']);module[_0x3e0d('0x1f')]=router; \ No newline at end of file +var _0xf703=['show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','upload','/webhook','webhookPost','put','update','delete','exports','multer','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','webhookGet','/:id'];(function(_0x43c1dc,_0x13e96f){var _0x1d5192=function(_0x113d0b){while(--_0x113d0b){_0x43c1dc['push'](_0x43c1dc['shift']());}};_0x1d5192(++_0x13e96f);}(_0xf703,0x16c));var _0x3f70=function(_0x415ccb,_0x5f5ae8){_0x415ccb=_0x415ccb-0x0;var _0x457924=_0xf703[_0x415ccb];return _0x457924;};'use strict';var multer=require(_0x3f70('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3f70('0x1'));var express=require(_0x3f70('0x2'));var router=express[_0x3f70('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f70('0x4'));var controller=require('./plugin.controller');router[_0x3f70('0x5')]('/',auth[_0x3f70('0x6')](),controller[_0x3f70('0x7')]);router[_0x3f70('0x5')]('/webhook',controller[_0x3f70('0x8')]);router[_0x3f70('0x5')](_0x3f70('0x9'),auth[_0x3f70('0x6')](),controller[_0x3f70('0xa')]);router[_0x3f70('0x5')](_0x3f70('0xb'),auth[_0x3f70('0x6')](),controller[_0x3f70('0xc')]);var upload=multer({'storage':multer[_0x3f70('0xd')]({'destination':function(_0x686991,_0x1357ed,_0x1e2380){_0x1e2380(null,path[_0x3f70('0xe')](config[_0x3f70('0xf')],_0x3f70('0x10')));},'filename':function(_0x571523,_0x4619fa,_0x4d7e9f){_0x4619fa[_0x3f70('0x11')]=_0x4619fa[_0x3f70('0x11')][_0x3f70('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d7e9f(null,util[_0x3f70('0x13')](_0x3f70('0x14'),path[_0x3f70('0x15')](_0x4619fa['originalname'],path['extname'](_0x4619fa['originalname'])),Date[_0x3f70('0x16')](),path[_0x3f70('0x17')](_0x4619fa[_0x3f70('0x11')])));}})});router[_0x3f70('0x18')]('/',upload[_0x3f70('0x19')](_0x3f70('0x1a')),controller[_0x3f70('0x1b')]);router[_0x3f70('0x18')](_0x3f70('0x1c'),controller[_0x3f70('0x1d')]);router[_0x3f70('0x1e')](_0x3f70('0x9'),auth['isAuthenticated'](),controller[_0x3f70('0x1f')]);router[_0x3f70('0x20')]('/:id',auth[_0x3f70('0x6')](),controller[_0x3f70('0x20')]);module[_0x3f70('0x21')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 925a506..8f44e62 100644 --- a/server/api/plugin/plugin.attributes.js +++ b/server/api/plugin/plugin.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa869=['ENUM','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0xa869,0x1f3));var _0x9a86=function(_0x4b7ff4,_0x1d1358){_0x4b7ff4=_0x4b7ff4-0x0;var _0x40f5bb=_0xa869[_0x4b7ff4];return _0x40f5bb;};'use strict';var Sequelize=require('sequelize');module[_0x9a86('0x0')]={'name':{'type':Sequelize[_0x9a86('0x1')]},'type':{'type':Sequelize['ENUM'](_0x9a86('0x2'),_0x9a86('0x3'))},'description':{'type':Sequelize[_0x9a86('0x4')]},'version':{'type':Sequelize[_0x9a86('0x4')]},'path':{'type':Sequelize[_0x9a86('0x1')],'comment':_0x9a86('0x5')},'active':{'type':Sequelize[_0x9a86('0x6')],'defaultValue':0x0,'comment':_0x9a86('0x7')},'sidebar':{'type':Sequelize[_0x9a86('0x8')](_0x9a86('0x9'),'agentOnly',_0x9a86('0xa'),_0x9a86('0xb')),'defaultValue':'always','comment':_0x9a86('0xc')},'icon':{'type':Sequelize[_0x9a86('0x1')]},'adminUrl':{'type':Sequelize[_0x9a86('0x1')]},'agentUrl':{'type':Sequelize[_0x9a86('0x1')]},'scriptName':{'type':Sequelize[_0x9a86('0x1')]},'scriptPath':{'type':Sequelize[_0x9a86('0x1')]}}; \ No newline at end of file +var _0x1417=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always'];(function(_0x2708bd,_0x4ba344){var _0x2cf973=function(_0x5c5403){while(--_0x5c5403){_0x2708bd['push'](_0x2708bd['shift']());}};_0x2cf973(++_0x4ba344);}(_0x1417,0x17b));var _0x7141=function(_0x5b3e71,_0xa5b355){_0x5b3e71=_0x5b3e71-0x0;var _0x290be6=_0x1417[_0x5b3e71];return _0x290be6;};'use strict';var Sequelize=require(_0x7141('0x0'));module[_0x7141('0x1')]={'name':{'type':Sequelize[_0x7141('0x2')]},'type':{'type':Sequelize[_0x7141('0x3')](_0x7141('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x7141('0x2')],'comment':_0x7141('0x5')},'active':{'type':Sequelize[_0x7141('0x6')],'defaultValue':0x0,'comment':_0x7141('0x7')},'sidebar':{'type':Sequelize[_0x7141('0x3')](_0x7141('0x8'),_0x7141('0x9'),_0x7141('0xa'),_0x7141('0xb')),'defaultValue':_0x7141('0xa'),'comment':_0x7141('0xc')},'icon':{'type':Sequelize[_0x7141('0x2')]},'adminUrl':{'type':Sequelize[_0x7141('0x2')]},'agentUrl':{'type':Sequelize[_0x7141('0x2')]},'scriptName':{'type':Sequelize[_0x7141('0x2')]},'scriptPath':{'type':Sequelize[_0x7141('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index ad33b28..d7fe34a 100644 --- a/server/api/plugin/plugin.controller.js +++ b/server/api/plugin/plugin.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0ee=['path','to-csv','ejs','lodash','crypto','jsforce','papaparse','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','localhost','socket.io-emitter','./plugin.socket','register','status','json','count','offset','limit','set','reject','save','destroy','then','get','Plugins','UserProfileResource','end','sendStatus','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','include','merge','join','server/files/plugins','format','%s.zip','createWriteStream','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','root','dirname','basename','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','filename','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','undefined','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','find','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','http://localhost:','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x38193f,_0x2c6649){var _0x283b66=function(_0x1da004){while(--_0x1da004){_0x38193f['push'](_0x38193f['shift']());}};_0x283b66(++_0x2c6649);}(_0xd0ee,0xa0));var _0xed0e=function(_0x21a72d,_0x1a900f){_0x21a72d=_0x21a72d-0x0;var _0x4d6930=_0xd0ee[_0x21a72d];return _0x4d6930;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xed0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed0e('0x1'));var jsonpatch=require(_0xed0e('0x2'));var rp=require(_0xed0e('0x3'));var moment=require(_0xed0e('0x4'));var BPromise=require(_0xed0e('0x5'));var Mustache=require('mustache');var util=require(_0xed0e('0x6'));var path=require(_0xed0e('0x7'));var sox=require('sox');var csv=require(_0xed0e('0x8'));var ejs=require(_0xed0e('0x9'));var fs=require('fs');var _=require(_0xed0e('0xa'));var squel=require('squel');var crypto=require(_0xed0e('0xb'));var jsforce=require(_0xed0e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xed0e('0xd'));var extract=require(_0xed0e('0xe'));var rimraf=require(_0xed0e('0xf'));var archiver=require('archiver');var Redis=require(_0xed0e('0x10'));var authService=require(_0xed0e('0x11'));var qs=require(_0xed0e('0x12'));var as=require(_0xed0e('0x13'));var hardwareService=require(_0xed0e('0x14'));var logger=require(_0xed0e('0x15'))(_0xed0e('0x16'));var utils=require(_0xed0e('0x17'));var config=require('../../config/environment');var db=require(_0xed0e('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xed0e('0x19'),'port':0x18eb});var socket=require(_0xed0e('0x1a'))(new Redis(config['redis']));require(_0xed0e('0x1b'))[_0xed0e('0x1c')](socket);function respondWithStatusCode(_0x5cfac1,_0x1d31ff){_0x1d31ff=_0x1d31ff||0xcc;return function(_0x1be0d4){if(_0x1be0d4){return _0x5cfac1['sendStatus'](_0x1d31ff);}return _0x5cfac1[_0xed0e('0x1d')](_0x1d31ff)['end']();};}function respondWithResult(_0x51b868,_0x311563){_0x311563=_0x311563||0xc8;return function(_0x50ea9f){if(_0x50ea9f){return _0x51b868['status'](_0x311563)[_0xed0e('0x1e')](_0x50ea9f);}};}function respondWithFilteredResult(_0x5d3a51,_0x28f9f9){return function(_0x2ddf49){if(_0x2ddf49){var _0x2782f0=_0x2ddf49[_0xed0e('0x1f')],_0x134076=_0x28f9f9[_0xed0e('0x20')],_0x1fbadb=_0x28f9f9[_0xed0e('0x20')]+_0x28f9f9[_0xed0e('0x21')],_0x430ccf;if(_0x1fbadb>=_0x2782f0){_0x1fbadb=_0x2782f0;_0x430ccf=0xc8;}else{_0x430ccf=0xce;}_0x5d3a51[_0xed0e('0x1d')](_0x430ccf);return _0x5d3a51[_0xed0e('0x22')]('Content-Range',_0x134076+'-'+_0x1fbadb+'/'+_0x2782f0)[_0xed0e('0x1e')](_0x2ddf49);}return null;};}function patchUpdates(_0x2983bf){return function(_0x24713d){try{jsonpatch['apply'](_0x24713d,_0x2983bf,!![]);}catch(_0x403c5e){return BPromise[_0xed0e('0x23')](_0x403c5e);}return _0x24713d[_0xed0e('0x24')]();};}function saveUpdates(_0x195040,_0x5ea83f){return function(_0x45f39b){if(_0x45f39b){return _0x45f39b['update'](_0x195040)['then'](function(_0x913c82){return _0x913c82;});}return null;};}function removeEntity(_0x1d3cfa,_0xeffaf6){return function(_0x2618e1){if(_0x2618e1){return _0x2618e1[_0xed0e('0x25')]()[_0xed0e('0x26')](function(){var _0x4d6ad9=_0x2618e1[_0xed0e('0x27')]({'plain':!![]});var _0x16c2b9=_0xed0e('0x28');return db[_0xed0e('0x29')][_0xed0e('0x25')]({'where':{'type':_0x16c2b9,'resourceId':_0x4d6ad9['id']}})[_0xed0e('0x26')](function(){return _0x2618e1;});})[_0xed0e('0x26')](function(){_0x1d3cfa[_0xed0e('0x1d')](0xcc)[_0xed0e('0x2a')]();});}};}function handleEntityNotFound(_0x5061e4,_0x6c0e86){return function(_0x7c995e){if(!_0x7c995e){_0x5061e4[_0xed0e('0x2b')](0x194);}return _0x7c995e;};}function handleError(_0x1a6ba1,_0x242614){_0x242614=_0x242614||0x1f4;return function(_0x504895){logger['error'](_0x504895['stack']);if(_0x504895[_0xed0e('0x2c')]){delete _0x504895[_0xed0e('0x2c')];}_0x1a6ba1[_0xed0e('0x1d')](_0x242614)[_0xed0e('0x2d')](_0x504895);};}exports[_0xed0e('0x2e')]=function(_0x10233b,_0xea7c3){var _0x8434fa={},_0x471da8={},_0x33807a={'count':0x0,'rows':[]};var _0x163211=_[_0xed0e('0x2f')](db[_0xed0e('0x30')][_0xed0e('0x31')],function(_0x29c3e7){return{'name':_0x29c3e7[_0xed0e('0x32')],'type':_0x29c3e7[_0xed0e('0x33')][_0xed0e('0x34')]};});_0x471da8[_0xed0e('0x35')]=_[_0xed0e('0x2f')](_0x163211,_0xed0e('0x2c'));_0x471da8['query']=_[_0xed0e('0x36')](_0x10233b[_0xed0e('0x37')]);_0x471da8[_0xed0e('0x38')]=_['intersection'](_0x471da8[_0xed0e('0x35')],_0x471da8[_0xed0e('0x37')]);_0x8434fa[_0xed0e('0x39')]=_[_0xed0e('0x3a')](_0x471da8['model'],qs[_0xed0e('0x3b')](_0x10233b['query'][_0xed0e('0x3b')]));_0x8434fa['attributes']=_0x8434fa[_0xed0e('0x39')]['length']?_0x8434fa[_0xed0e('0x39')]:_0x471da8[_0xed0e('0x35')];if(!_0x10233b[_0xed0e('0x37')][_0xed0e('0x3c')]('nolimit')){_0x8434fa[_0xed0e('0x21')]=qs[_0xed0e('0x21')](_0x10233b['query'][_0xed0e('0x21')]);_0x8434fa[_0xed0e('0x20')]=qs[_0xed0e('0x20')](_0x10233b[_0xed0e('0x37')][_0xed0e('0x20')]);}_0x8434fa[_0xed0e('0x3d')]=qs[_0xed0e('0x3e')](_0x10233b[_0xed0e('0x37')][_0xed0e('0x3e')]);_0x8434fa[_0xed0e('0x3f')]=qs[_0xed0e('0x38')](_[_0xed0e('0x40')](_0x10233b['query'],_0x471da8[_0xed0e('0x38')]));if(_0x10233b[_0xed0e('0x37')]['filter']){_0x8434fa[_0xed0e('0x3f')]=_['merge'](_0x8434fa[_0xed0e('0x3f')],{'$or':_[_0xed0e('0x2f')](_0x163211,function(_0x5792bd){if(_0x5792bd[_0xed0e('0x33')]!==_0xed0e('0x41')){var _0x126760={};_0x126760[_0x5792bd[_0xed0e('0x2c')]]={'$like':'%'+_0x10233b[_0xed0e('0x37')][_0xed0e('0x42')]+'%'};return _0x126760;}})});}_0x8434fa=_['merge']({},_0x8434fa,_0x10233b[_0xed0e('0x43')]);var _0x1070f6={'where':_0x8434fa['where']};return db[_0xed0e('0x30')][_0xed0e('0x1f')](_0x1070f6)[_0xed0e('0x26')](function(_0x2fa09f){_0x33807a[_0xed0e('0x1f')]=_0x2fa09f;if(_0x10233b['query'][_0xed0e('0x44')]){_0x8434fa['include']=[{'all':!![]}];}return db[_0xed0e('0x30')][_0xed0e('0x45')](_0x8434fa);})['then'](function(_0x220559){_0x33807a[_0xed0e('0x46')]=_0x220559;return _0x33807a;})[_0xed0e('0x26')](respondWithFilteredResult(_0xea7c3,_0x8434fa))[_0xed0e('0x47')](handleError(_0xea7c3,null));};exports[_0xed0e('0x48')]=function(_0x11e26a,_0x2321a8){var _0x18780c={'raw':!![],'where':{'id':_0x11e26a[_0xed0e('0x49')]['id']}},_0x62dbc0={};_0x62dbc0['model']=_[_0xed0e('0x36')](db[_0xed0e('0x30')]['rawAttributes']);_0x62dbc0['query']=_[_0xed0e('0x36')](_0x11e26a['query']);_0x62dbc0[_0xed0e('0x38')]=_[_0xed0e('0x3a')](_0x62dbc0[_0xed0e('0x35')],_0x62dbc0[_0xed0e('0x37')]);_0x18780c['attributes']=_[_0xed0e('0x3a')](_0x62dbc0[_0xed0e('0x35')],qs['fields'](_0x11e26a[_0xed0e('0x37')][_0xed0e('0x3b')]));_0x18780c[_0xed0e('0x39')]=_0x18780c[_0xed0e('0x39')][_0xed0e('0x4a')]?_0x18780c[_0xed0e('0x39')]:_0x62dbc0[_0xed0e('0x35')];if(_0x11e26a['query']['includeAll']){_0x18780c[_0xed0e('0x4b')]=[{'all':!![]}];}_0x18780c=_[_0xed0e('0x4c')]({},_0x18780c,_0x11e26a[_0xed0e('0x43')]);return db[_0xed0e('0x30')]['find'](_0x18780c)['then'](handleEntityNotFound(_0x2321a8,null))['then'](respondWithResult(_0x2321a8,null))[_0xed0e('0x47')](handleError(_0x2321a8,null));};exports['download']=function(_0x2dcc15,_0x417af7,_0x50c2f0){return db[_0xed0e('0x30')]['find']({'where':{'id':_0x2dcc15['params']['id']},'attributes':[_0xed0e('0x2c'),_0xed0e('0x7')],'raw':!![]})[_0xed0e('0x26')](handleEntityNotFound(_0x417af7,null))[_0xed0e('0x26')](function(_0x5dc414){if(_0x5dc414){var _0x190079=path[_0xed0e('0x4d')](config['root'],_0xed0e('0x4e'),util[_0xed0e('0x4f')](_0xed0e('0x50'),path['basename'](_0x5dc414[_0xed0e('0x7')])));var _0x1c9489=fs[_0xed0e('0x51')](_0x190079);var _0x1052b2=archiver('zip',{'zlib':{'level':0x9}});_0x1052b2['on'](_0xed0e('0x52'),function(_0x34d099){if(_0x34d099[_0xed0e('0x53')]===_0xed0e('0x54')){logger[_0xed0e('0x55')](_0x34d099);}else{throw new db[(_0xed0e('0x56'))][(_0xed0e('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1052b2['on'](_0xed0e('0x55'),function(_0x3a881f){throw new db[(_0xed0e('0x56'))]['Error'](_0xed0e('0x58'));});_0x1052b2[_0xed0e('0x59')](_0x1c9489);_0x1052b2['glob']('**/*',{'cwd':path[_0xed0e('0x4d')](config[_0xed0e('0x5a')],_0xed0e('0x4e'),path[_0xed0e('0x5b')](_0x5dc414[_0xed0e('0x7')])),'ignore':[path['join'](path[_0xed0e('0x5c')](_0x5dc414['path']),_0xed0e('0x5d')),path[_0xed0e('0x4d')](path['basename'](_0x5dc414['path']),_0xed0e('0x5e'))],'nodir':!![]})[_0xed0e('0x5f')]();_0x1c9489['on']('close',function(){if(!fs[_0xed0e('0x60')](_0x190079)){throw new db[(_0xed0e('0x56'))][(_0xed0e('0x57'))](_0xed0e('0x61'));}return _0x417af7[_0xed0e('0x62')](_0x190079,util[_0xed0e('0x4f')](_0xed0e('0x50'),path[_0xed0e('0x5c')](_0x5dc414[_0xed0e('0x7')])),function(_0x5701b7){if(_0x5701b7){throw new db[(_0xed0e('0x56'))]['Error'](_0xed0e('0x63'));}fs[_0xed0e('0x64')](_0x190079);logger[_0xed0e('0x65')]('Download\x20completed');logger[_0xed0e('0x65')](_0xed0e('0x66'));});});}return null;})[_0xed0e('0x47')](handleError(_0x417af7,null));};exports[_0xed0e('0x67')]=function(_0x4dedad,_0x1de0d8,_0x95a656){var _0x2bade2=path['basename'](_0x4dedad['file'][_0xed0e('0x68')],path['extname'](_0x4dedad['file']['filename']));var _0xa431d8=path[_0xed0e('0x4d')](config['root'],_0xed0e('0x4e'),_0x4dedad['file'][_0xed0e('0x68')]);var _0x550205=path[_0xed0e('0x4d')](config[_0xed0e('0x5a')],_0xed0e('0x4e'),_0x2bade2);logger[_0xed0e('0x65')]('Plugin\x20upload\x20filepath:\x20%s',_0xa431d8);logger[_0xed0e('0x65')](_0xed0e('0x69'),_0x550205);try{fs['chmodSync'](_0xa431d8,parseInt(_0xed0e('0x6a'),0x8));extract(_0xa431d8,{'dir':_0x550205},function(_0x40acd0){if(_0x40acd0){logger['error'](_0x40acd0);handleError(_0x40acd0,!![]);};var _0xd3fcc1=fs[_0xed0e('0x6b')](_0x550205);if(_0xd3fcc1[_0xed0e('0x4a')]>0x1){removeReferences(_0xa431d8,_0x550205);logger[_0xed0e('0x55')](_0xed0e('0x6c'));return _0x95a656(new Error(_0xed0e('0x6c')));}var _0x2a7ad9=fs['lstatSync'](path[_0xed0e('0x4d')](_0x550205,_0xd3fcc1[0x0]));if(_0x2a7ad9[_0xed0e('0x6d')]()){removeReferences(_0xa431d8,_0x550205);logger['error']('Invalid\x20plugin\x20structure');return _0x95a656(new Error('Invalid\x20plugin\x20structure'));}if(_0x2a7ad9[_0xed0e('0x6e')]()){var _0x33d7e4=fs[_0xed0e('0x6b')](path[_0xed0e('0x4d')](_0x550205,_0xd3fcc1[0x0]));if(_0x33d7e4[_0xed0e('0x4a')]===0x0){removeReferences(_0xa431d8,_0x550205);logger['error']('Invalid\x20plugin\x20structure');return _0x95a656(new Error(_0xed0e('0x6c')));}var _0x51076f=_0x33d7e4[_0xed0e('0x6f')](function(_0x159cad){return _0x159cad===_0xed0e('0x70');});if(!_0x51076f){return _0x95a656(new Error(_0xed0e('0x71')));}var _0x11b25d=fs[_0xed0e('0x72')](path['join'](_0x550205,_0xd3fcc1[0x0],_0xed0e('0x70')));var _0x30f7cf=JSON['parse'](_0x11b25d);if(_0xed0e('0x73')==typeof _0x30f7cf[_0xed0e('0x2c')]){return _0x95a656(new Error(_0xed0e('0x74')));}if(_0xed0e('0x73')==typeof _0x30f7cf[_0xed0e('0x33')]){return _0x95a656(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xed0e('0x73')==typeof _0x30f7cf[_0xed0e('0x75')]){return _0x95a656(new Error(_0xed0e('0x76')));}if('undefined'==typeof _0x30f7cf[_0xed0e('0x77')]){return _0x95a656(new Error(_0xed0e('0x78')));}if(_0x30f7cf[_0xed0e('0x33')]===_0xed0e('0x79')){if(_0xed0e('0x73')==typeof _0x30f7cf['parameters'][_0xed0e('0x7a')]){return _0x95a656(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xed0e('0x73')==typeof _0x30f7cf[_0xed0e('0x77')]['views'][_0xed0e('0x7b')]&&_0xed0e('0x73')==typeof _0x30f7cf['parameters'][_0xed0e('0x7a')][_0xed0e('0x7c')]){return _0x95a656(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x30f7cf[_0xed0e('0x33')]===_0xed0e('0x7d')){if(_0xed0e('0x73')==typeof _0x30f7cf[_0xed0e('0x77')][_0xed0e('0x7e')]){return _0x95a656(new Error(_0xed0e('0x7f')));}if(_0xed0e('0x73')==typeof _0x30f7cf[_0xed0e('0x77')][_0xed0e('0x80')]){return _0x95a656(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x95a656(new Error(_0xed0e('0x81')));}var _0x51b43a=_0x30f7cf[_0xed0e('0x2c')];var _0x3a50d4=_0x30f7cf[_0xed0e('0x82')];var _0x19b3f9=_0x30f7cf[_0xed0e('0x33')];var _0x4cdaeb=_0x30f7cf[_0xed0e('0x83')]?_0x30f7cf['sidebar']:_0xed0e('0x84');var _0x4993ba=_0x30f7cf[_0xed0e('0x85')]?_0x30f7cf[_0xed0e('0x85')]:_0xed0e('0x86');var _0x5200dd='';var _0x30b5cd='';var _0x565896='';var _0x4ceae4='';var _0x14cf1f=_0x30f7cf['version'];if(_0x19b3f9===_0xed0e('0x79')){if('undefined'!=typeof _0x30f7cf['parameters'][_0xed0e('0x7a')][_0xed0e('0x7b')]){var _0x3d9a0c=_0x30f7cf[_0xed0e('0x77')][_0xed0e('0x7a')][_0xed0e('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xed0e('0x87')](_0x3d9a0c)){_0x5200dd=path[_0xed0e('0x4d')](_0xed0e('0x88'),_0x2bade2,_0xd3fcc1[0x0],_0x3d9a0c);}else{_0x5200dd=_0x3d9a0c;}}else{logger[_0xed0e('0x65')](_0xed0e('0x89'));}if(_0xed0e('0x73')!=typeof _0x30f7cf[_0xed0e('0x77')][_0xed0e('0x7a')][_0xed0e('0x7c')]){var _0x39a227=_0x30f7cf['parameters'][_0xed0e('0x7a')][_0xed0e('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x39a227)){_0x30b5cd=path[_0xed0e('0x4d')]('plugins',_0x2bade2,_0xd3fcc1[0x0],_0x39a227);}else{_0x30b5cd=_0x39a227;}}else{logger['info'](_0xed0e('0x8a'));}}else if(_0x19b3f9==='script'){_0x565896=_0x30f7cf['parameters'][_0xed0e('0x7e')];_0x4ceae4=_0x30f7cf['parameters']['scriptPath'];if('undefined'!=typeof _0x30f7cf['parameters']['views']){if(_0xed0e('0x73')!=typeof _0x30f7cf[_0xed0e('0x77')][_0xed0e('0x7a')]['admin']){var _0x3d9a0c=_0x30f7cf[_0xed0e('0x77')][_0xed0e('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x3d9a0c)){_0x5200dd=path[_0xed0e('0x4d')](_0xed0e('0x88'),_0x2bade2,_0xd3fcc1[0x0],_0x3d9a0c);}else{_0x5200dd=_0x3d9a0c;}}if(_0xed0e('0x73')!=typeof _0x30f7cf[_0xed0e('0x77')][_0xed0e('0x7a')][_0xed0e('0x7c')]){var _0x39a227=_0x30f7cf['parameters'][_0xed0e('0x7a')][_0xed0e('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xed0e('0x87')](_0x39a227)){_0x30b5cd=path[_0xed0e('0x4d')](_0xed0e('0x88'),_0x2bade2,_0xd3fcc1[0x0],_0x39a227);}else{_0x30b5cd=_0x39a227;}}}}var _0x4f7aa4={'name':_0x51b43a,'description':_0x3a50d4,'path':path[_0xed0e('0x4d')](_0x2bade2,_0xd3fcc1[0x0]),'type':_0x19b3f9,'sidebar':_0x4cdaeb,'icon':_0x4993ba,'adminUrl':_0x5200dd,'agentUrl':_0x30b5cd,'scriptName':_0x565896,'scriptPath':_0x4ceae4,'version':_0x14cf1f};removeReferences(_0xa431d8,null);return db[_0xed0e('0x30')][_0xed0e('0x8b')](_0x4f7aa4)['then'](function(_0x2b90bc){var _0xab3a05={'role':_0x4dedad[_0xed0e('0x8c')][_0xed0e('0x8d')],'userProfileId':_0x4dedad['body'][_0xed0e('0x8e')]};if(!_0xab3a05)throw new Error(_0xed0e('0x8f'));if(_0xab3a05[_0xed0e('0x8d')]===_0xed0e('0x90')){var _0x47ea4d=_0x2b90bc[_0xed0e('0x27')]({'plain':!![]});return db[_0xed0e('0x91')]['find']({'where':{'name':'Plugins','userProfileId':_0xab3a05[_0xed0e('0x8e')]},'raw':!![]})[_0xed0e('0x26')](function(_0x9e18d0){if(_0x9e18d0&&_0x9e18d0[_0xed0e('0x92')]===0x0){return db[_0xed0e('0x29')][_0xed0e('0x8b')]({'name':_0x47ea4d[_0xed0e('0x2c')],'resourceId':_0x47ea4d['id'],'type':_0x9e18d0['name'],'sectionId':_0x9e18d0['id']},{})[_0xed0e('0x26')](function(){return _0x2b90bc;});}else{return _0x2b90bc;}})['catch'](function(_0x9d1560){logger[_0xed0e('0x55')](_0xed0e('0x93'),_0x9d1560);throw _0x9d1560;});}return _0x2b90bc;})['then'](respondWithResult(_0x1de0d8,null))[_0xed0e('0x47')](handleError(_0x1de0d8,null));}});}catch(_0x5348a1){_0x1de0d8[_0xed0e('0x1d')](0x1f4)[_0xed0e('0x2d')](_0x5348a1);}};function removeReferences(_0x536f96,_0x160a7d){try{if(_0x536f96){fs['unlinkSync'](_0x536f96);logger[_0xed0e('0x65')](_0xed0e('0x94'));}if(_0x160a7d){rimraf(_0x160a7d,function(){});logger[_0xed0e('0x65')](_0xed0e('0x95'));}}catch(_0x48e93a){logger['error'](_0x48e93a);}}exports['update']=function(_0xc5d2f6,_0x114897,_0x14c164){return db[_0xed0e('0x30')][_0xed0e('0x96')]({'where':{'id':_0xc5d2f6['params']['id']}})[_0xed0e('0x26')](handleEntityNotFound(_0x114897,null))[_0xed0e('0x26')](saveUpdates(_0xc5d2f6[_0xed0e('0x8c')],null))[_0xed0e('0x26')](respondWithResult(_0x114897,null))['catch'](handleError(_0x114897,null));};exports[_0xed0e('0x97')]=function(_0x60d5e5,_0x51d663,_0x5852ea){return db[_0xed0e('0x30')]['find']({'where':{'id':_0x60d5e5[_0xed0e('0x49')]['id']}})['then'](function(_0xa54065){if(_0xa54065){return _0xa54065[_0xed0e('0x25')]();}})[_0xed0e('0x26')](function(_0x2abf67){rimraf(path['join'](config[_0xed0e('0x5a')],_0xed0e('0x4e'),path[_0xed0e('0x5b')](_0x2abf67[_0xed0e('0x7')])),function(){});return _0x2abf67;})[_0xed0e('0x26')](handleEntityNotFound(_0x51d663,null))[_0xed0e('0x26')](respondWithStatusCode(_0x51d663,null))[_0xed0e('0x47')](handleError(_0x51d663,null));};exports['webhookGet']=function(_0xdc1fe4,_0x48527e,_0x2d591c){return BPromise[_0xed0e('0x98')]()[_0xed0e('0x26')](function(){if(!_0xdc1fe4[_0xed0e('0x37')][_0xed0e('0x7')]){throw new Error(_0xed0e('0x99'));}if(!_0xdc1fe4[_0xed0e('0x37')][_0xed0e('0x9a')]){throw new Error(_0xed0e('0x9b'));}var _0x406ac1=_0xdc1fe4[_0xed0e('0x37')][_0xed0e('0x9c')]?_0xdc1fe4['query'][_0xed0e('0x9c')]+':'+_0xdc1fe4[_0xed0e('0x37')]['port']:'http://localhost:'+_0xdc1fe4[_0xed0e('0x37')]['port'];var _0x3bcb4e=_0xdc1fe4[_0xed0e('0x37')]['json']?_0xdc1fe4[_0xed0e('0x37')][_0xed0e('0x1e')]:!![];var _0x2dd7d0=_0xdc1fe4['query'][_0xed0e('0x9d')]?_0xdc1fe4['query'][_0xed0e('0x9d')]:null;var _0x253e51={'method':_0xdc1fe4[_0xed0e('0x9e')],'uri':util[_0xed0e('0x4f')](_0xed0e('0x9f'),_0x406ac1,_0xdc1fe4['query']['path']),'json':_0x3bcb4e,'resolveWithFullResponse':!![],'encoding':_0x2dd7d0,'qs':_0xdc1fe4['query']};if(_0xdc1fe4['headers']){_0x253e51['headers']=_0xdc1fe4[_0xed0e('0xa0')];if(_0x253e51['headers'][_0xed0e('0xa1')]){delete _0x253e51['headers'][_0xed0e('0xa1')];}}if(_0x253e51[_0xed0e('0xa0')][_0xed0e('0xa2')]){delete _0x253e51['headers'][_0xed0e('0xa2')];}return rp(_0x253e51);})['then'](function(_0x51a152){if(_0x51a152){_0x48527e['set'](_0x51a152[_0xed0e('0xa0')]);logger[_0xed0e('0x65')](_0x51a152[_0xed0e('0x8c')]);if(_[_0xed0e('0xa3')](_0xdc1fe4[_0xed0e('0x37')]['path'],'download')&&_0x51a152['statusCode']==0x1f4){return _0x48527e[_0xed0e('0x2b')](_0x51a152[_0xed0e('0xa4')]);}else{return _0x48527e[_0xed0e('0x1d')](_0x51a152[_0xed0e('0xa4')])['send'](_0x51a152[_0xed0e('0x8c')]);}}else{return _0x48527e[_0xed0e('0x2b')](0xc8);}})['catch'](handleError(_0x48527e,null));};exports[_0xed0e('0xa5')]=function(_0x5e4435,_0x396adb,_0x25898e){return BPromise[_0xed0e('0x98')]()[_0xed0e('0x26')](function(){if(!_0x5e4435['query'][_0xed0e('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5e4435[_0xed0e('0x37')][_0xed0e('0x9a')]){throw new Error(_0xed0e('0x9b'));}var _0x442f01=_0x5e4435[_0xed0e('0x37')][_0xed0e('0x9c')]?_0x5e4435[_0xed0e('0x37')][_0xed0e('0x9c')]+':'+_0x5e4435['query']['port']:_0xed0e('0xa6')+_0x5e4435[_0xed0e('0x37')]['port'];var _0xe07406=_0x5e4435['query'][_0xed0e('0x1e')]?_0x5e4435[_0xed0e('0x37')][_0xed0e('0x1e')]:!![];var _0x4b781c=_0x5e4435[_0xed0e('0x37')][_0xed0e('0x9d')]?_0x5e4435[_0xed0e('0x37')][_0xed0e('0x9d')]:null;var _0x48de95={'method':_0x5e4435[_0xed0e('0x9e')],'uri':util['format'](_0xed0e('0x9f'),_0x442f01,_0x5e4435['query']['path']),'json':_0xe07406,'resolveWithFullResponse':!![],'encoding':_0x4b781c,'body':_0x5e4435[_0xed0e('0x8c')]};if(_0x5e4435['headers']){_0x48de95[_0xed0e('0xa0')]=_0x5e4435[_0xed0e('0xa0')];if(_0x48de95[_0xed0e('0xa0')][_0xed0e('0xa1')]){delete _0x48de95['headers']['content-length'];}}if(_0x48de95[_0xed0e('0xa0')]['content-type']){delete _0x48de95['headers'][_0xed0e('0xa2')];}return rp(_0x48de95);})['then'](function(_0x29e928){if(_0x29e928){_0x396adb[_0xed0e('0x22')](_0x29e928[_0xed0e('0xa0')]);logger[_0xed0e('0x65')](_0x29e928[_0xed0e('0x8c')]);return _0x396adb[_0xed0e('0x1d')](_0x29e928[_0xed0e('0xa4')])[_0xed0e('0x2d')](_0x29e928['body']);}else{return _0x396adb[_0xed0e('0x2b')](0xc8);}})[_0xed0e('0x47')](handleError(_0x396adb,null));}; \ No newline at end of file +var _0xb0b7=['createWriteStream','warning','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','dirname','attachments/**/*','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','admin','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','papaparse','extract-zip','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','download','join','server/files/plugins','format','%s.zip','basename'];(function(_0x23da4d,_0x63498c){var _0x4ae55=function(_0x323d75){while(--_0x323d75){_0x23da4d['push'](_0x23da4d['shift']());}};_0x4ae55(++_0x63498c);}(_0xb0b7,0xef));var _0x7b0b=function(_0x539cf6,_0x7466a2){_0x539cf6=_0x539cf6-0x0;var _0x4216b8=_0xb0b7[_0x539cf6];return _0x4216b8;};'use strict';var pdf=require(_0x7b0b('0x0'));var emlformat=require(_0x7b0b('0x1'));var rimraf=require(_0x7b0b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b0b('0x3'));var rp=require('request-promise');var moment=require(_0x7b0b('0x4'));var BPromise=require(_0x7b0b('0x5'));var Mustache=require(_0x7b0b('0x6'));var util=require(_0x7b0b('0x7'));var path=require(_0x7b0b('0x8'));var sox=require(_0x7b0b('0x9'));var csv=require('to-csv');var ejs=require(_0x7b0b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7b0b('0xb'));var crypto=require(_0x7b0b('0xc'));var jsforce=require(_0x7b0b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b0b('0xe'));var extract=require(_0x7b0b('0xf'));var rimraf=require(_0x7b0b('0x2'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x7b0b('0x10'));var qs=require(_0x7b0b('0x11'));var as=require(_0x7b0b('0x12'));var hardwareService=require(_0x7b0b('0x13'));var logger=require('../../config/logger')(_0x7b0b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7b0b('0x15'))['db'];config[_0x7b0b('0x16')]=_[_0x7b0b('0x17')](config['redis'],{'host':_0x7b0b('0x18'),'port':0x18eb});var socket=require(_0x7b0b('0x19'))(new Redis(config[_0x7b0b('0x16')]));require(_0x7b0b('0x1a'))['register'](socket);function respondWithStatusCode(_0x25a073,_0x4941a4){_0x4941a4=_0x4941a4||0xcc;return function(_0x40397c){if(_0x40397c){return _0x25a073[_0x7b0b('0x1b')](_0x4941a4);}return _0x25a073[_0x7b0b('0x1c')](_0x4941a4)[_0x7b0b('0x1d')]();};}function respondWithResult(_0x225b4a,_0x20ae5c){_0x20ae5c=_0x20ae5c||0xc8;return function(_0x110e18){if(_0x110e18){return _0x225b4a[_0x7b0b('0x1c')](_0x20ae5c)[_0x7b0b('0x1e')](_0x110e18);}};}function respondWithFilteredResult(_0x10cf4e,_0x33a0ee){return function(_0x4ad5a3){if(_0x4ad5a3){var _0x512de2=_0x4ad5a3[_0x7b0b('0x1f')],_0x5955b7=_0x33a0ee[_0x7b0b('0x20')],_0x28f8ae=_0x33a0ee['offset']+_0x33a0ee['limit'],_0x2bf0fd;if(_0x28f8ae>=_0x512de2){_0x28f8ae=_0x512de2;_0x2bf0fd=0xc8;}else{_0x2bf0fd=0xce;}_0x10cf4e['status'](_0x2bf0fd);return _0x10cf4e[_0x7b0b('0x21')](_0x7b0b('0x22'),_0x5955b7+'-'+_0x28f8ae+'/'+_0x512de2)[_0x7b0b('0x1e')](_0x4ad5a3);}return null;};}function patchUpdates(_0x4241a5){return function(_0x456ec0){try{jsonpatch[_0x7b0b('0x23')](_0x456ec0,_0x4241a5,!![]);}catch(_0x341ed8){return BPromise[_0x7b0b('0x24')](_0x341ed8);}return _0x456ec0[_0x7b0b('0x25')]();};}function saveUpdates(_0x4c1a6f,_0x17b110){return function(_0x1fb283){if(_0x1fb283){return _0x1fb283[_0x7b0b('0x26')](_0x4c1a6f)[_0x7b0b('0x27')](function(_0x5231ec){return _0x5231ec;});}return null;};}function removeEntity(_0x41e21e,_0x32a4ed){return function(_0x18143b){if(_0x18143b){return _0x18143b['destroy']()['then'](function(){var _0x174c91=_0x18143b[_0x7b0b('0x28')]({'plain':!![]});var _0x4e9ca0='Plugins';return db[_0x7b0b('0x29')][_0x7b0b('0x2a')]({'where':{'type':_0x4e9ca0,'resourceId':_0x174c91['id']}})[_0x7b0b('0x27')](function(){return _0x18143b;});})[_0x7b0b('0x27')](function(){_0x41e21e[_0x7b0b('0x1c')](0xcc)[_0x7b0b('0x1d')]();});}};}function handleEntityNotFound(_0x482c41,_0xbdad47){return function(_0x46c205){if(!_0x46c205){_0x482c41['sendStatus'](0x194);}return _0x46c205;};}function handleError(_0x5eebf8,_0x4cfd5f){_0x4cfd5f=_0x4cfd5f||0x1f4;return function(_0x37bdab){logger['error'](_0x37bdab[_0x7b0b('0x2b')]);if(_0x37bdab['name']){delete _0x37bdab[_0x7b0b('0x2c')];}_0x5eebf8['status'](_0x4cfd5f)[_0x7b0b('0x2d')](_0x37bdab);};}exports[_0x7b0b('0x2e')]=function(_0x237a65,_0x5d7e7b){var _0x4948a1={},_0x3d2b43={},_0x1ba642={'count':0x0,'rows':[]};var _0x1e7c2f=_[_0x7b0b('0x2f')](db[_0x7b0b('0x30')][_0x7b0b('0x31')],function(_0x1acfa0){return{'name':_0x1acfa0[_0x7b0b('0x32')],'type':_0x1acfa0[_0x7b0b('0x33')][_0x7b0b('0x34')]};});_0x3d2b43[_0x7b0b('0x35')]=_['map'](_0x1e7c2f,_0x7b0b('0x2c'));_0x3d2b43[_0x7b0b('0x36')]=_[_0x7b0b('0x37')](_0x237a65[_0x7b0b('0x36')]);_0x3d2b43[_0x7b0b('0x38')]=_['intersection'](_0x3d2b43[_0x7b0b('0x35')],_0x3d2b43[_0x7b0b('0x36')]);_0x4948a1[_0x7b0b('0x39')]=_[_0x7b0b('0x3a')](_0x3d2b43['model'],qs[_0x7b0b('0x3b')](_0x237a65[_0x7b0b('0x36')]['fields']));_0x4948a1['attributes']=_0x4948a1[_0x7b0b('0x39')][_0x7b0b('0x3c')]?_0x4948a1['attributes']:_0x3d2b43[_0x7b0b('0x35')];if(!_0x237a65[_0x7b0b('0x36')][_0x7b0b('0x3d')](_0x7b0b('0x3e'))){_0x4948a1[_0x7b0b('0x3f')]=qs[_0x7b0b('0x3f')](_0x237a65[_0x7b0b('0x36')][_0x7b0b('0x3f')]);_0x4948a1['offset']=qs['offset'](_0x237a65[_0x7b0b('0x36')][_0x7b0b('0x20')]);}_0x4948a1['order']=qs['sort'](_0x237a65[_0x7b0b('0x36')]['sort']);_0x4948a1[_0x7b0b('0x40')]=qs[_0x7b0b('0x38')](_[_0x7b0b('0x41')](_0x237a65['query'],_0x3d2b43[_0x7b0b('0x38')]));if(_0x237a65[_0x7b0b('0x36')]['filter']){_0x4948a1[_0x7b0b('0x40')]=_[_0x7b0b('0x42')](_0x4948a1['where'],{'$or':_['map'](_0x1e7c2f,function(_0x5280a7){if(_0x5280a7[_0x7b0b('0x33')]!==_0x7b0b('0x43')){var _0x1fd879={};_0x1fd879[_0x5280a7[_0x7b0b('0x2c')]]={'$like':'%'+_0x237a65[_0x7b0b('0x36')]['filter']+'%'};return _0x1fd879;}})});}_0x4948a1=_[_0x7b0b('0x42')]({},_0x4948a1,_0x237a65[_0x7b0b('0x44')]);var _0x2e737c={'where':_0x4948a1['where']};return db[_0x7b0b('0x30')][_0x7b0b('0x1f')](_0x2e737c)['then'](function(_0x592866){_0x1ba642[_0x7b0b('0x1f')]=_0x592866;if(_0x237a65['query'][_0x7b0b('0x45')]){_0x4948a1[_0x7b0b('0x46')]=[{'all':!![]}];}return db[_0x7b0b('0x30')][_0x7b0b('0x47')](_0x4948a1);})[_0x7b0b('0x27')](function(_0x3d83c7){_0x1ba642[_0x7b0b('0x48')]=_0x3d83c7;return _0x1ba642;})['then'](respondWithFilteredResult(_0x5d7e7b,_0x4948a1))[_0x7b0b('0x49')](handleError(_0x5d7e7b,null));};exports[_0x7b0b('0x4a')]=function(_0xbd33b4,_0x38e6c1){var _0x786dd1={'raw':!![],'where':{'id':_0xbd33b4[_0x7b0b('0x4b')]['id']}},_0x29fc22={};_0x29fc22[_0x7b0b('0x35')]=_[_0x7b0b('0x37')](db[_0x7b0b('0x30')][_0x7b0b('0x31')]);_0x29fc22[_0x7b0b('0x36')]=_['keys'](_0xbd33b4[_0x7b0b('0x36')]);_0x29fc22[_0x7b0b('0x38')]=_[_0x7b0b('0x3a')](_0x29fc22[_0x7b0b('0x35')],_0x29fc22[_0x7b0b('0x36')]);_0x786dd1[_0x7b0b('0x39')]=_[_0x7b0b('0x3a')](_0x29fc22[_0x7b0b('0x35')],qs['fields'](_0xbd33b4[_0x7b0b('0x36')][_0x7b0b('0x3b')]));_0x786dd1[_0x7b0b('0x39')]=_0x786dd1[_0x7b0b('0x39')][_0x7b0b('0x3c')]?_0x786dd1[_0x7b0b('0x39')]:_0x29fc22[_0x7b0b('0x35')];if(_0xbd33b4[_0x7b0b('0x36')][_0x7b0b('0x45')]){_0x786dd1[_0x7b0b('0x46')]=[{'all':!![]}];}_0x786dd1=_[_0x7b0b('0x42')]({},_0x786dd1,_0xbd33b4[_0x7b0b('0x44')]);return db['Plugin'][_0x7b0b('0x4c')](_0x786dd1)[_0x7b0b('0x27')](handleEntityNotFound(_0x38e6c1,null))[_0x7b0b('0x27')](respondWithResult(_0x38e6c1,null))['catch'](handleError(_0x38e6c1,null));};exports[_0x7b0b('0x4d')]=function(_0x5b094d,_0x42c43d,_0x1c4b80){return db[_0x7b0b('0x30')]['find']({'where':{'id':_0x5b094d[_0x7b0b('0x4b')]['id']},'attributes':[_0x7b0b('0x2c'),_0x7b0b('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x42c43d,null))[_0x7b0b('0x27')](function(_0x2846b7){if(_0x2846b7){var _0x247ffb=path[_0x7b0b('0x4e')](config['root'],_0x7b0b('0x4f'),util[_0x7b0b('0x50')](_0x7b0b('0x51'),path[_0x7b0b('0x52')](_0x2846b7[_0x7b0b('0x8')])));var _0x175223=fs[_0x7b0b('0x53')](_0x247ffb);var _0x1da2fb=archiver('zip',{'zlib':{'level':0x9}});_0x1da2fb['on'](_0x7b0b('0x54'),function(_0x32be17){if(_0x32be17['code']==='ENOENT'){logger[_0x7b0b('0x55')](_0x32be17);}else{throw new db[(_0x7b0b('0x56'))]['Error'](_0x7b0b('0x57'));}});_0x1da2fb['on'](_0x7b0b('0x55'),function(_0x39322c){throw new db[(_0x7b0b('0x56'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x1da2fb[_0x7b0b('0x58')](_0x175223);_0x1da2fb[_0x7b0b('0x59')](_0x7b0b('0x5a'),{'cwd':path[_0x7b0b('0x4e')](config[_0x7b0b('0x5b')],_0x7b0b('0x4f'),path[_0x7b0b('0x5c')](_0x2846b7[_0x7b0b('0x8')])),'ignore':[path['join'](path[_0x7b0b('0x52')](_0x2846b7[_0x7b0b('0x8')]),'node_modules/**/*'),path[_0x7b0b('0x4e')](path['basename'](_0x2846b7[_0x7b0b('0x8')]),_0x7b0b('0x5d'))],'nodir':!![]})['finalize']();_0x175223['on'](_0x7b0b('0x5e'),function(){if(!fs['existsSync'](_0x247ffb)){throw new db[(_0x7b0b('0x56'))]['Error'](_0x7b0b('0x5f'));}return _0x42c43d[_0x7b0b('0x4d')](_0x247ffb,util[_0x7b0b('0x50')]('%s.zip',path[_0x7b0b('0x52')](_0x2846b7[_0x7b0b('0x8')])),function(_0x4cf71d){if(_0x4cf71d){throw new db[(_0x7b0b('0x56'))]['Error'](_0x7b0b('0x60'));}fs[_0x7b0b('0x61')](_0x247ffb);logger[_0x7b0b('0x62')](_0x7b0b('0x63'));logger[_0x7b0b('0x62')]('Temporary\x20file\x20removed');});});}return null;})[_0x7b0b('0x49')](handleError(_0x42c43d,null));};exports[_0x7b0b('0x64')]=function(_0x48b771,_0x10eab3,_0x585eba){var _0x25e654=path[_0x7b0b('0x52')](_0x48b771['file'][_0x7b0b('0x65')],path[_0x7b0b('0x66')](_0x48b771['file']['filename']));var _0x12799c=path[_0x7b0b('0x4e')](config['root'],_0x7b0b('0x4f'),_0x48b771[_0x7b0b('0x67')][_0x7b0b('0x65')]);var _0x551fd0=path['join'](config[_0x7b0b('0x5b')],_0x7b0b('0x4f'),_0x25e654);logger['info'](_0x7b0b('0x68'),_0x12799c);logger[_0x7b0b('0x62')](_0x7b0b('0x69'),_0x551fd0);try{fs[_0x7b0b('0x6a')](_0x12799c,parseInt(_0x7b0b('0x6b'),0x8));extract(_0x12799c,{'dir':_0x551fd0},function(_0x12cc64){if(_0x12cc64){logger[_0x7b0b('0x55')](_0x12cc64);handleError(_0x12cc64,!![]);};var _0x24de7a=fs[_0x7b0b('0x6c')](_0x551fd0);if(_0x24de7a[_0x7b0b('0x3c')]>0x1){removeReferences(_0x12799c,_0x551fd0);logger[_0x7b0b('0x55')](_0x7b0b('0x6d'));return _0x585eba(new Error(_0x7b0b('0x6d')));}var _0x57d5cd=fs['lstatSync'](path[_0x7b0b('0x4e')](_0x551fd0,_0x24de7a[0x0]));if(_0x57d5cd[_0x7b0b('0x6e')]()){removeReferences(_0x12799c,_0x551fd0);logger[_0x7b0b('0x55')](_0x7b0b('0x6d'));return _0x585eba(new Error(_0x7b0b('0x6d')));}if(_0x57d5cd[_0x7b0b('0x6f')]()){var _0xe4c8c3=fs['readdirSync'](path[_0x7b0b('0x4e')](_0x551fd0,_0x24de7a[0x0]));if(_0xe4c8c3[_0x7b0b('0x3c')]===0x0){removeReferences(_0x12799c,_0x551fd0);logger[_0x7b0b('0x55')]('Invalid\x20plugin\x20structure');return _0x585eba(new Error(_0x7b0b('0x6d')));}var _0x23d04e=_0xe4c8c3[_0x7b0b('0x70')](function(_0x2b65eb){return _0x2b65eb===_0x7b0b('0x71');});if(!_0x23d04e){return _0x585eba(new Error(_0x7b0b('0x72')));}var _0x5cd8b1=fs['readFileSync'](path['join'](_0x551fd0,_0x24de7a[0x0],'manifest.json'));var _0x29b90a=JSON['parse'](_0x5cd8b1);if(_0x7b0b('0x73')==typeof _0x29b90a[_0x7b0b('0x2c')]){return _0x585eba(new Error(_0x7b0b('0x74')));}if(_0x7b0b('0x73')==typeof _0x29b90a[_0x7b0b('0x33')]){return _0x585eba(new Error(_0x7b0b('0x75')));}if(_0x7b0b('0x73')==typeof _0x29b90a['version']){return _0x585eba(new Error(_0x7b0b('0x76')));}if(_0x7b0b('0x73')==typeof _0x29b90a[_0x7b0b('0x77')]){return _0x585eba(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x29b90a['type']===_0x7b0b('0x78')){if(_0x7b0b('0x73')==typeof _0x29b90a[_0x7b0b('0x77')][_0x7b0b('0x79')]){return _0x585eba(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x7b0b('0x73')==typeof _0x29b90a['parameters']['views'][_0x7b0b('0x7a')]&&'undefined'==typeof _0x29b90a[_0x7b0b('0x77')][_0x7b0b('0x79')][_0x7b0b('0x7b')]){return _0x585eba(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x29b90a['type']===_0x7b0b('0x7c')){if(_0x7b0b('0x73')==typeof _0x29b90a['parameters']['scriptName']){return _0x585eba(new Error(_0x7b0b('0x7d')));}if(_0x7b0b('0x73')==typeof _0x29b90a['parameters']['scriptPath']){return _0x585eba(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x585eba(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x5104b7=_0x29b90a[_0x7b0b('0x2c')];var _0x27db85=_0x29b90a[_0x7b0b('0x7e')];var _0x419eaa=_0x29b90a[_0x7b0b('0x33')];var _0x1d691b=_0x29b90a[_0x7b0b('0x7f')]?_0x29b90a[_0x7b0b('0x7f')]:'always';var _0x4c38e5=_0x29b90a['icon']?_0x29b90a[_0x7b0b('0x80')]:_0x7b0b('0x81');var _0x433a04='';var _0x510eaa='';var _0x330409='';var _0x3dee37='';var _0x239a3c=_0x29b90a['version'];if(_0x419eaa===_0x7b0b('0x78')){if(_0x7b0b('0x73')!=typeof _0x29b90a[_0x7b0b('0x77')][_0x7b0b('0x79')][_0x7b0b('0x7a')]){var _0x10dfc4=_0x29b90a['parameters'][_0x7b0b('0x79')][_0x7b0b('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x7b0b('0x82')](_0x10dfc4)){_0x433a04=path['join'](_0x7b0b('0x83'),_0x25e654,_0x24de7a[0x0],_0x10dfc4);}else{_0x433a04=_0x10dfc4;}}else{logger[_0x7b0b('0x62')](_0x7b0b('0x84'));}if('undefined'!=typeof _0x29b90a[_0x7b0b('0x77')]['views'][_0x7b0b('0x7b')]){var _0x209f4e=_0x29b90a[_0x7b0b('0x77')][_0x7b0b('0x79')][_0x7b0b('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x7b0b('0x82')](_0x209f4e)){_0x510eaa=path[_0x7b0b('0x4e')](_0x7b0b('0x83'),_0x25e654,_0x24de7a[0x0],_0x209f4e);}else{_0x510eaa=_0x209f4e;}}else{logger[_0x7b0b('0x62')](_0x7b0b('0x85'));}}else if(_0x419eaa==='script'){_0x330409=_0x29b90a['parameters'][_0x7b0b('0x86')];_0x3dee37=_0x29b90a[_0x7b0b('0x77')]['scriptPath'];if(_0x7b0b('0x73')!=typeof _0x29b90a[_0x7b0b('0x77')][_0x7b0b('0x79')]){if(_0x7b0b('0x73')!=typeof _0x29b90a[_0x7b0b('0x77')][_0x7b0b('0x79')]['admin']){var _0x10dfc4=_0x29b90a[_0x7b0b('0x77')][_0x7b0b('0x79')][_0x7b0b('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x7b0b('0x82')](_0x10dfc4)){_0x433a04=path['join'](_0x7b0b('0x83'),_0x25e654,_0x24de7a[0x0],_0x10dfc4);}else{_0x433a04=_0x10dfc4;}}if('undefined'!=typeof _0x29b90a['parameters'][_0x7b0b('0x79')]['agent']){var _0x209f4e=_0x29b90a[_0x7b0b('0x77')][_0x7b0b('0x79')][_0x7b0b('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x209f4e)){_0x510eaa=path['join'](_0x7b0b('0x83'),_0x25e654,_0x24de7a[0x0],_0x209f4e);}else{_0x510eaa=_0x209f4e;}}}}var _0x5336b8={'name':_0x5104b7,'description':_0x27db85,'path':path[_0x7b0b('0x4e')](_0x25e654,_0x24de7a[0x0]),'type':_0x419eaa,'sidebar':_0x1d691b,'icon':_0x4c38e5,'adminUrl':_0x433a04,'agentUrl':_0x510eaa,'scriptName':_0x330409,'scriptPath':_0x3dee37,'version':_0x239a3c};removeReferences(_0x12799c,null);return db[_0x7b0b('0x30')]['create'](_0x5336b8)['then'](function(_0x6e2607){var _0x44dd82={'role':_0x48b771[_0x7b0b('0x87')][_0x7b0b('0x88')],'userProfileId':_0x48b771['body'][_0x7b0b('0x89')]};if(!_0x44dd82)throw new Error(_0x7b0b('0x8a'));if(_0x44dd82['role']===_0x7b0b('0x8b')){var _0x3f412b=_0x6e2607[_0x7b0b('0x28')]({'plain':!![]});return db[_0x7b0b('0x8c')]['find']({'where':{'name':'Plugins','userProfileId':_0x44dd82['userProfileId']},'raw':!![]})[_0x7b0b('0x27')](function(_0x3153b3){if(_0x3153b3&&_0x3153b3[_0x7b0b('0x8d')]===0x0){return db[_0x7b0b('0x29')]['create']({'name':_0x3f412b[_0x7b0b('0x2c')],'resourceId':_0x3f412b['id'],'type':_0x3153b3[_0x7b0b('0x2c')],'sectionId':_0x3153b3['id']},{})['then'](function(){return _0x6e2607;});}else{return _0x6e2607;}})[_0x7b0b('0x49')](function(_0x5a5e71){logger[_0x7b0b('0x55')](_0x7b0b('0x8e'),_0x5a5e71);throw _0x5a5e71;});}return _0x6e2607;})[_0x7b0b('0x27')](respondWithResult(_0x10eab3,null))[_0x7b0b('0x49')](handleError(_0x10eab3,null));}});}catch(_0x6cae69){_0x10eab3['status'](0x1f4)[_0x7b0b('0x2d')](_0x6cae69);}};function removeReferences(_0x16db84,_0x1d14d3){try{if(_0x16db84){fs[_0x7b0b('0x61')](_0x16db84);logger[_0x7b0b('0x62')](_0x7b0b('0x8f'));}if(_0x1d14d3){rimraf(_0x1d14d3,function(){});logger[_0x7b0b('0x62')](_0x7b0b('0x90'));}}catch(_0x4b079f){logger['error'](_0x4b079f);}}exports[_0x7b0b('0x26')]=function(_0x599f75,_0x3f4c74,_0x290129){return db[_0x7b0b('0x30')]['find']({'where':{'id':_0x599f75[_0x7b0b('0x4b')]['id']}})[_0x7b0b('0x27')](handleEntityNotFound(_0x3f4c74,null))[_0x7b0b('0x27')](saveUpdates(_0x599f75[_0x7b0b('0x87')],null))[_0x7b0b('0x27')](respondWithResult(_0x3f4c74,null))[_0x7b0b('0x49')](handleError(_0x3f4c74,null));};exports['delete']=function(_0x290a7a,_0x2dbe07,_0x3f536d){return db[_0x7b0b('0x30')][_0x7b0b('0x4c')]({'where':{'id':_0x290a7a[_0x7b0b('0x4b')]['id']}})[_0x7b0b('0x27')](function(_0x472ddc){if(_0x472ddc){return _0x472ddc[_0x7b0b('0x2a')]();}})[_0x7b0b('0x27')](function(_0x4786fa){rimraf(path['join'](config['root'],_0x7b0b('0x4f'),path[_0x7b0b('0x5c')](_0x4786fa['path'])),function(){});return _0x4786fa;})[_0x7b0b('0x27')](handleEntityNotFound(_0x2dbe07,null))[_0x7b0b('0x27')](respondWithStatusCode(_0x2dbe07,null))[_0x7b0b('0x49')](handleError(_0x2dbe07,null));};exports[_0x7b0b('0x91')]=function(_0x2d0649,_0x1abffe,_0x28cdc3){return BPromise[_0x7b0b('0x92')]()[_0x7b0b('0x27')](function(){if(!_0x2d0649[_0x7b0b('0x36')]['path']){throw new Error(_0x7b0b('0x93'));}if(!_0x2d0649[_0x7b0b('0x36')][_0x7b0b('0x94')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x37863a=_0x2d0649[_0x7b0b('0x36')]['hostname']?_0x2d0649[_0x7b0b('0x36')][_0x7b0b('0x95')]+':'+_0x2d0649['query'][_0x7b0b('0x94')]:'http://localhost:'+_0x2d0649[_0x7b0b('0x36')]['port'];var _0x212e1c=_0x2d0649['query'][_0x7b0b('0x1e')]?_0x2d0649[_0x7b0b('0x36')][_0x7b0b('0x1e')]:!![];var _0x11f4e7=_0x2d0649[_0x7b0b('0x36')][_0x7b0b('0x96')]?_0x2d0649[_0x7b0b('0x36')][_0x7b0b('0x96')]:null;var _0xbeaad2={'method':_0x2d0649[_0x7b0b('0x97')],'uri':util[_0x7b0b('0x50')](_0x7b0b('0x98'),_0x37863a,_0x2d0649[_0x7b0b('0x36')][_0x7b0b('0x8')]),'json':_0x212e1c,'resolveWithFullResponse':!![],'encoding':_0x11f4e7,'qs':_0x2d0649[_0x7b0b('0x36')]};if(_0x2d0649[_0x7b0b('0x99')]){_0xbeaad2[_0x7b0b('0x99')]=_0x2d0649[_0x7b0b('0x99')];if(_0xbeaad2[_0x7b0b('0x99')][_0x7b0b('0x9a')]){delete _0xbeaad2[_0x7b0b('0x99')][_0x7b0b('0x9a')];}}if(_0xbeaad2[_0x7b0b('0x99')][_0x7b0b('0x9b')]){delete _0xbeaad2[_0x7b0b('0x99')][_0x7b0b('0x9b')];}return rp(_0xbeaad2);})[_0x7b0b('0x27')](function(_0x3d0a3e){if(_0x3d0a3e){_0x1abffe[_0x7b0b('0x21')](_0x3d0a3e[_0x7b0b('0x99')]);logger['info'](_0x3d0a3e['body']);if(_[_0x7b0b('0x9c')](_0x2d0649['query'][_0x7b0b('0x8')],'download')&&_0x3d0a3e[_0x7b0b('0x9d')]==0x1f4){return _0x1abffe[_0x7b0b('0x1b')](_0x3d0a3e['statusCode']);}else{return _0x1abffe['status'](_0x3d0a3e[_0x7b0b('0x9d')])[_0x7b0b('0x2d')](_0x3d0a3e[_0x7b0b('0x87')]);}}else{return _0x1abffe[_0x7b0b('0x1b')](0xc8);}})[_0x7b0b('0x49')](handleError(_0x1abffe,null));};exports[_0x7b0b('0x9e')]=function(_0x2cef16,_0x59e48d,_0xfcaa82){return BPromise[_0x7b0b('0x92')]()[_0x7b0b('0x27')](function(){if(!_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x8')]){throw new Error(_0x7b0b('0x93'));}if(!_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x94')]){throw new Error(_0x7b0b('0x9f'));}var _0x19d690=_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x95')]?_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x95')]+':'+_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x94')]:_0x7b0b('0xa0')+_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x94')];var _0x389c6f=_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x1e')]?_0x2cef16[_0x7b0b('0x36')]['json']:!![];var _0x3e0cc0=_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x96')]?_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x96')]:null;var _0x490cd4={'method':_0x2cef16['method'],'uri':util['format'](_0x7b0b('0x98'),_0x19d690,_0x2cef16[_0x7b0b('0x36')][_0x7b0b('0x8')]),'json':_0x389c6f,'resolveWithFullResponse':!![],'encoding':_0x3e0cc0,'body':_0x2cef16[_0x7b0b('0x87')]};if(_0x2cef16[_0x7b0b('0x99')]){_0x490cd4[_0x7b0b('0x99')]=_0x2cef16[_0x7b0b('0x99')];if(_0x490cd4[_0x7b0b('0x99')][_0x7b0b('0x9a')]){delete _0x490cd4[_0x7b0b('0x99')][_0x7b0b('0x9a')];}}if(_0x490cd4[_0x7b0b('0x99')][_0x7b0b('0x9b')]){delete _0x490cd4[_0x7b0b('0x99')]['content-type'];}return rp(_0x490cd4);})['then'](function(_0x1594dd){if(_0x1594dd){_0x59e48d[_0x7b0b('0x21')](_0x1594dd[_0x7b0b('0x99')]);logger[_0x7b0b('0x62')](_0x1594dd[_0x7b0b('0x87')]);return _0x59e48d['status'](_0x1594dd['statusCode'])[_0x7b0b('0x2d')](_0x1594dd['body']);}else{return _0x59e48d[_0x7b0b('0x1b')](0xc8);}})[_0x7b0b('0x49')](handleError(_0x59e48d,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index fc11b3e..2a15ce3 100644 --- a/server/api/plugin/plugin.events.js +++ b/server/api/plugin/plugin.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33af=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2651df,_0x109c85){var _0x33e60d=function(_0x10ae65){while(--_0x10ae65){_0x2651df['push'](_0x2651df['shift']());}};_0x33e60d(++_0x109c85);}(_0x33af,0xec));var _0xf33a=function(_0x77d286,_0x1ddc6d){_0x77d286=_0x77d286-0x0;var _0x5446a5=_0x33af[_0x77d286];return _0x5446a5;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xf33a('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xf33a('0x1')](0x0);var events={'afterCreate':_0xf33a('0x2'),'afterUpdate':_0xf33a('0x3'),'afterDestroy':_0xf33a('0x4')};function emitEvent(_0x169f02){return function(_0x25f156,_0x4c734e,_0x433e25){PluginEvents[_0xf33a('0x5')](_0x169f02+':'+_0x25f156['id'],_0x25f156);PluginEvents['emit'](_0x169f02,_0x25f156);_0x433e25(null);};}for(var e in events){if(events[_0xf33a('0x6')](e)){var event=events[e];Plugin[_0xf33a('0x7')](e,emitEvent(event));}}module[_0xf33a('0x8')]=PluginEvents; \ No newline at end of file +var _0xe820=['hook','exports','events','Plugin','update','remove','emit','hasOwnProperty'];(function(_0x2d1b47,_0x11d484){var _0x3178ff=function(_0x3cb26d){while(--_0x3cb26d){_0x2d1b47['push'](_0x2d1b47['shift']());}};_0x3178ff(++_0x11d484);}(_0xe820,0xd2));var _0x0e82=function(_0x4b9c62,_0x1f790b){_0x4b9c62=_0x4b9c62-0x0;var _0x3b8c7a=_0xe820[_0x4b9c62];return _0x3b8c7a;};'use strict';var EventEmitter=require(_0x0e82('0x0'));var Plugin=require('../../mysqldb')['db'][_0x0e82('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e82('0x2'),'afterDestroy':_0x0e82('0x3')};function emitEvent(_0x25fc00){return function(_0x59b28d,_0xc6d61e,_0x5de50f){PluginEvents[_0x0e82('0x4')](_0x25fc00+':'+_0x59b28d['id'],_0x59b28d);PluginEvents[_0x0e82('0x4')](_0x25fc00,_0x59b28d);_0x5de50f(null);};}for(var e in events){if(events[_0x0e82('0x5')](e)){var event=events[e];Plugin[_0x0e82('0x6')](e,emitEvent(event));}}module[_0x0e82('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index d38da11..f615d84 100644 --- a/server/api/plugin/plugin.model.js +++ b/server/api/plugin/plugin.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes'];(function(_0x16295e,_0x4a9b05){var _0x2d9e54=function(_0x396291){while(--_0x396291){_0x16295e['push'](_0x16295e['shift']());}};_0x2d9e54(++_0x4a9b05);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3a451d,_0x1a0736){_0x3a451d=_0x3a451d-0x0;var _0x4eda16=_0x8ef6[_0x3a451d];return _0x4eda16;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd28=['rimraf','./plugin.attributes','exports','define','util','../../config/logger','moment','request-promise','path'];(function(_0x28a5be,_0x4a59c3){var _0x180c70=function(_0x2d3b77){while(--_0x2d3b77){_0x28a5be['push'](_0x28a5be['shift']());}};_0x180c70(++_0x4a59c3);}(_0xfd28,0x148));var _0x8fd2=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xfd28[_0x580647];return _0x5f0792;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 497e28e..ab03778 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0aae=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./plugin.socket','register','request','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','debug','lodash'];(function(_0x544af8,_0x49fc86){var _0x4fa3ef=function(_0x113b11){while(--_0x113b11){_0x544af8['push'](_0x544af8['shift']());}};_0x4fa3ef(++_0x49fc86);}(_0x0aae,0x8b));var _0xe0aa=function(_0x4d4553,_0x270ed3){_0x4d4553=_0x4d4553-0x0;var _0x4f44fa=_0x0aae[_0x4d4553];return _0x4f44fa;};'use strict';var _=require(_0xe0aa('0x0'));var util=require('util');var moment=require(_0xe0aa('0x1'));var BPromise=require(_0xe0aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0aa('0x3'));var db=require(_0xe0aa('0x4'))['db'];var utils=require(_0xe0aa('0x5'));var logger=require(_0xe0aa('0x6'))(_0xe0aa('0x7'));var config=require(_0xe0aa('0x8'));var jayson=require(_0xe0aa('0x9'));var client=jayson[_0xe0aa('0xa')][_0xe0aa('0xb')]({'port':0x232a});config['redis']=_[_0xe0aa('0xc')](config[_0xe0aa('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0aa('0xe'))(new Redis(config[_0xe0aa('0xd')]));require(_0xe0aa('0xf'))[_0xe0aa('0x10')](socket);function respondWithRpcPromise(_0x2ace53,_0x53c936,_0x839663){return new BPromise(function(_0x30a6d6,_0x204245){return client[_0xe0aa('0x11')](_0x2ace53,_0x839663)['then'](function(_0x18311e){logger[_0xe0aa('0x12')]('Plugin,\x20%s,\x20%s',_0x53c936,_0xe0aa('0x13'));logger['debug'](_0xe0aa('0x14'),_0x53c936,_0xe0aa('0x13'),JSON[_0xe0aa('0x15')](_0x18311e));if(_0x18311e[_0xe0aa('0x16')]){if(_0x18311e['error']['code']===0x1f4){logger[_0xe0aa('0x16')](_0xe0aa('0x17'),_0x53c936,_0x18311e[_0xe0aa('0x16')][_0xe0aa('0x18')]);return _0x204245(_0x18311e[_0xe0aa('0x16')][_0xe0aa('0x18')]);}logger['error'](_0xe0aa('0x17'),_0x53c936,_0x18311e['error'][_0xe0aa('0x18')]);return _0x30a6d6(_0x18311e['error'][_0xe0aa('0x18')]);}else{logger[_0xe0aa('0x12')](_0xe0aa('0x17'),_0x53c936,_0xe0aa('0x13'));_0x30a6d6(_0x18311e[_0xe0aa('0x19')][_0xe0aa('0x18')]);}})[_0xe0aa('0x1a')](function(_0x47845b){logger[_0xe0aa('0x16')]('Plugin,\x20%s,\x20%s',_0x53c936,_0x47845b);_0x204245(_0x47845b);});});}exports[_0xe0aa('0x1b')]=function(_0x29690b){var _0x32cb3b=this;return new Promise(function(_0x562799,_0x42976b){return db[_0xe0aa('0x1c')][_0xe0aa('0x1d')](_0x29690b[_0xe0aa('0x1e')],{'raw':_0x29690b[_0xe0aa('0x1f')]?_0x29690b[_0xe0aa('0x1f')][_0xe0aa('0x20')]===undefined?!![]:![]:!![]})[_0xe0aa('0x21')](function(_0x232123){logger[_0xe0aa('0x12')](_0xe0aa('0x1b'),_0x29690b);logger[_0xe0aa('0x22')](_0xe0aa('0x1b'),_0x29690b,JSON[_0xe0aa('0x15')](_0x232123));_0x562799(_0x232123);})[_0xe0aa('0x1a')](function(_0x1318eb){logger['error'](_0xe0aa('0x1b'),_0x1318eb[_0xe0aa('0x18')],_0x29690b);_0x42976b(_0x32cb3b[_0xe0aa('0x16')](0x1f4,_0x1318eb[_0xe0aa('0x18')]));});});}; \ No newline at end of file +var _0xdc40=['debug','error','code','message','catch','CreatePlugin','Plugin','options','stringify','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x564b40,_0x54371e){var _0x28b5a9=function(_0x2c37ea){while(--_0x2c37ea){_0x564b40['push'](_0x564b40['shift']());}};_0x28b5a9(++_0x54371e);}(_0xdc40,0x1ad));var _0x0dc4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc40[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0dc4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0dc4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dc4('0x2'));var db=require(_0x0dc4('0x3'))['db'];var utils=require(_0x0dc4('0x4'));var logger=require(_0x0dc4('0x5'))(_0x0dc4('0x6'));var config=require(_0x0dc4('0x7'));var jayson=require(_0x0dc4('0x8'));var client=jayson[_0x0dc4('0x9')][_0x0dc4('0xa')]({'port':0x232a});config['redis']=_[_0x0dc4('0xb')](config['redis'],{'host':_0x0dc4('0xc'),'port':0x18eb});var socket=require(_0x0dc4('0xd'))(new Redis(config[_0x0dc4('0xe')]));require(_0x0dc4('0xf'))[_0x0dc4('0x10')](socket);function respondWithRpcPromise(_0x20ef8a,_0x527f04,_0x2d95d1){return new BPromise(function(_0x5ef91e,_0x3b9929){return client['request'](_0x20ef8a,_0x2d95d1)[_0x0dc4('0x11')](function(_0x4e738d){logger[_0x0dc4('0x12')](_0x0dc4('0x13'),_0x527f04,_0x0dc4('0x14'));logger[_0x0dc4('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x527f04,_0x0dc4('0x14'),JSON['stringify'](_0x4e738d));if(_0x4e738d[_0x0dc4('0x16')]){if(_0x4e738d[_0x0dc4('0x16')][_0x0dc4('0x17')]===0x1f4){logger[_0x0dc4('0x16')](_0x0dc4('0x13'),_0x527f04,_0x4e738d[_0x0dc4('0x16')][_0x0dc4('0x18')]);return _0x3b9929(_0x4e738d[_0x0dc4('0x16')]['message']);}logger['error'](_0x0dc4('0x13'),_0x527f04,_0x4e738d[_0x0dc4('0x16')][_0x0dc4('0x18')]);return _0x5ef91e(_0x4e738d[_0x0dc4('0x16')]['message']);}else{logger[_0x0dc4('0x12')]('Plugin,\x20%s,\x20%s',_0x527f04,'request\x20sent');_0x5ef91e(_0x4e738d['result'][_0x0dc4('0x18')]);}})[_0x0dc4('0x19')](function(_0x1550cc){logger[_0x0dc4('0x16')]('Plugin,\x20%s,\x20%s',_0x527f04,_0x1550cc);_0x3b9929(_0x1550cc);});});}exports[_0x0dc4('0x1a')]=function(_0x4306c7){var _0x2c9763=this;return new Promise(function(_0x274b1e,_0x383afb){return db[_0x0dc4('0x1b')]['create'](_0x4306c7['body'],{'raw':_0x4306c7[_0x0dc4('0x1c')]?_0x4306c7[_0x0dc4('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x0dc4('0x11')](function(_0x5ddf1a){logger[_0x0dc4('0x12')](_0x0dc4('0x1a'),_0x4306c7);logger[_0x0dc4('0x15')]('CreatePlugin',_0x4306c7,JSON[_0x0dc4('0x1d')](_0x5ddf1a));_0x274b1e(_0x5ddf1a);})[_0x0dc4('0x19')](function(_0x253244){logger[_0x0dc4('0x16')](_0x0dc4('0x1a'),_0x253244[_0x0dc4('0x18')],_0x4306c7);_0x383afb(_0x2c9763[_0x0dc4('0x16')](0x1f4,_0x253244[_0x0dc4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 4e03dd9..583d8ec 100644 --- a/server/api/plugin/plugin.socket.js +++ b/server/api/plugin/plugin.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4892=['emit','removeListener','length','plugin:','./plugin.events','save','update'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4892,0x1ee));var _0x2489=function(_0x392031,_0x55569c){_0x392031=_0x392031-0x0;var _0x451293=_0x4892[_0x392031];return _0x451293;};'use strict';var PluginEvents=require(_0x2489('0x0'));var events=[_0x2489('0x1'),'remove',_0x2489('0x2')];function createListener(_0x4a9298,_0x5c0198){return function(_0xfd57e8){_0x5c0198[_0x2489('0x3')](_0x4a9298,_0xfd57e8);};}function removeListener(_0x18e904,_0x292066){return function(){PluginEvents[_0x2489('0x4')](_0x18e904,_0x292066);};}exports['register']=function(_0x158453){for(var _0x5bcd39=0x0,_0x37af26=events[_0x2489('0x5')];_0x5bcd39<_0x37af26;_0x5bcd39++){var _0x2f22c4=events[_0x5bcd39];var _0x55c483=createListener(_0x2489('0x6')+_0x2f22c4,_0x158453);PluginEvents['on'](_0x2f22c4,_0x55c483);}}; \ No newline at end of file +var _0x3c99=['plugin:','./plugin.events','save','remove','update','emit','removeListener','register','length'];(function(_0x810a78,_0x1e3706){var _0x24a295=function(_0x3c6272){while(--_0x3c6272){_0x810a78['push'](_0x810a78['shift']());}};_0x24a295(++_0x1e3706);}(_0x3c99,0x118));var _0x93c9=function(_0x4a14c5,_0x1a5046){_0x4a14c5=_0x4a14c5-0x0;var _0xbc2a7=_0x3c99[_0x4a14c5];return _0xbc2a7;};'use strict';var PluginEvents=require(_0x93c9('0x0'));var events=[_0x93c9('0x1'),_0x93c9('0x2'),_0x93c9('0x3')];function createListener(_0x48d79d,_0x1cef96){return function(_0x50ce88){_0x1cef96[_0x93c9('0x4')](_0x48d79d,_0x50ce88);};}function removeListener(_0x3b55f1,_0x5dc64f){return function(){PluginEvents[_0x93c9('0x5')](_0x3b55f1,_0x5dc64f);};}exports[_0x93c9('0x6')]=function(_0x4e7a67){for(var _0x456925=0x0,_0x57abb3=events[_0x93c9('0x7')];_0x456925<_0x57abb3;_0x456925++){var _0x1f0b11=events[_0x456925];var _0x929db=createListener(_0x93c9('0x8')+_0x1f0b11,_0x4e7a67);PluginEvents['on'](_0x1f0b11,_0x929db);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index ebf4625..f05e56c 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3eb=['create','put','update','delete','exports','express','../../components/auth/service','./pm2.controller','get','/:id','isAuthenticated','show','post'];(function(_0x15482e,_0x25b23c){var _0x4a0651=function(_0x5afab4){while(--_0x5afab4){_0x15482e['push'](_0x15482e['shift']());}};_0x4a0651(++_0x25b23c);}(_0xb3eb,0xc8));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xbb3e('0x0'));var router=express['Router']();var auth=require(_0xbb3e('0x1'));var controller=require(_0xbb3e('0x2'));router[_0xbb3e('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbb3e('0x3')](_0xbb3e('0x4'),auth[_0xbb3e('0x5')](),controller[_0xbb3e('0x6')]);router[_0xbb3e('0x7')]('/',auth['isAuthenticated'](),controller[_0xbb3e('0x8')]);router[_0xbb3e('0x9')](_0xbb3e('0x4'),auth[_0xbb3e('0x5')](),controller[_0xbb3e('0xa')]);router[_0xbb3e('0xb')](_0xbb3e('0x4'),auth[_0xbb3e('0x5')](),controller['destroy']);module[_0xbb3e('0xc')]=router; \ No newline at end of file +var _0xa015=['Router','../../components/auth/service','./pm2.controller','index','get','isAuthenticated','show','create','put','/:id','update','destroy','exports','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa015,0x6f));var _0x5a01=function(_0x347a0c,_0x6624e7){_0x347a0c=_0x347a0c-0x0;var _0x184eec=_0xa015[_0x347a0c];return _0x184eec;};'use strict';var express=require(_0x5a01('0x0'));var router=express[_0x5a01('0x1')]();var auth=require(_0x5a01('0x2'));var controller=require(_0x5a01('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0x5a01('0x4')]);router[_0x5a01('0x5')]('/:id',auth[_0x5a01('0x6')](),controller[_0x5a01('0x7')]);router['post']('/',auth[_0x5a01('0x6')](),controller[_0x5a01('0x8')]);router[_0x5a01('0x9')](_0x5a01('0xa'),auth[_0x5a01('0x6')](),controller[_0x5a01('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5a01('0xc')]);module[_0x5a01('0xd')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 5e48943..8e22473 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9dd1=['api','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','list','then','reject','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','chdir','dirname','start','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','../../config/pm2','../../config/logger'];(function(_0x524dc1,_0x2fc391){var _0x89ebb7=function(_0x4137be){while(--_0x4137be){_0x524dc1['push'](_0x524dc1['shift']());}};_0x89ebb7(++_0x2fc391);}(_0x9dd1,0x16f));var _0x19dd=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0x9dd1[_0x813d0a];return _0x241352;};'use strict';var _=require('lodash');var pm2=require(_0x19dd('0x0'));var logger=require(_0x19dd('0x1'))(_0x19dd('0x2'));var path=require('path');var exec=require(_0x19dd('0x3'))[_0x19dd('0x4')];var BPromise=require(_0x19dd('0x5'));function handleEntityNotFound(_0x511517,_0x4be953){return function(_0x50b6eb){if(!_0x50b6eb){_0x511517[_0x19dd('0x6')](0x194);;}return _0x50b6eb;};}function respondWithResult(_0x44534d,_0x4f03f7){_0x4f03f7=_0x4f03f7||0xc8;return function(_0x5b8bd0){if(_0x5b8bd0){return _0x44534d[_0x19dd('0x7')](_0x4f03f7)[_0x19dd('0x8')](_0x5b8bd0);}return null;};}function handleError(_0x268e3f,_0x47ca8c){_0x47ca8c=_0x47ca8c||0x1f4;return function(_0x413408){logger[_0x19dd('0x9')](_0x413408[_0x19dd('0xa')]);if(_0x413408[_0x19dd('0xb')]){delete _0x413408[_0x19dd('0xb')];}_0x268e3f[_0x19dd('0x7')](_0x47ca8c)['send'](_0x413408);};}function execChildProcess(){return new BPromise(function(_0x553615,_0x1ec304){exec(_0x19dd('0xc'),function(_0x2ea0b9,_0x4a3e03,_0x1e5273){logger[_0x19dd('0xd')](_0x4a3e03);logger[_0x19dd('0xd')](_0x1e5273);if(_0x2ea0b9){logger[_0x19dd('0x9')](_0x2ea0b9);return _0x1ec304(_0x2ea0b9);}return _0x553615(_0x4a3e03);});});}exports['index']=function(_0x1b6b3c,_0x383e03){return pm2[_0x19dd('0xe')]()[_0x19dd('0xf')](function(_0x2469f5){if(_0x2469f5){var _0x21d64c=_[_0x19dd('0x10')](_0x2469f5,function(_0x41e4ff){return _0x41e4ff[_0x19dd('0xb')]===_0x19dd('0x11')||_0x41e4ff[_0x19dd('0xb')]===_0x19dd('0x12');});return{'rows':_0x21d64c,'count':_0x21d64c[_0x19dd('0x13')]};}return null;})[_0x19dd('0xf')](respondWithResult(_0x383e03,null))[_0x19dd('0x14')](handleError(_0x383e03,null));};exports[_0x19dd('0x15')]=function(_0x44df7e,_0x3b557e){return pm2[_0x19dd('0x16')](_0x44df7e[_0x19dd('0x17')]['id'])[_0x19dd('0xf')](respondWithResult(_0x3b557e,null))[_0x19dd('0xf')](handleEntityNotFound(_0x3b557e,null))[_0x19dd('0x14')](handleError(_0x3b557e,null));};exports['create']=function(_0x59eac7,_0x4eee65){if(_0x59eac7[_0x19dd('0x18')]['name']&&_0x59eac7[_0x19dd('0x18')][_0x19dd('0x19')]){var _0x523d15=path[_0x19dd('0x1a')](__dirname,_0x19dd('0x1b'),_0x59eac7[_0x19dd('0x18')][_0x19dd('0x19')]);var _0x57f527=process['cwd']();process[_0x19dd('0x1c')](path[_0x19dd('0x1d')](_0x523d15));return execChildProcess()[_0x19dd('0xf')](function(_0x7a0ec7){process['chdir'](_0x57f527);return pm2[_0x19dd('0x1e')]({'name':_0x59eac7[_0x19dd('0x18')][_0x19dd('0xb')],'script':_0x523d15});})[_0x19dd('0xf')](function(_0x1796f9){pm2['dump']();return _0x1796f9[0x0];})[_0x19dd('0xf')](respondWithResult(_0x4eee65,0xc9))[_0x19dd('0x14')](handleError(_0x4eee65,null));}else{return _0x4eee65[_0x19dd('0x7')](0x1f4)[_0x19dd('0x1f')]({'message':_0x19dd('0x20')});}};exports[_0x19dd('0x21')]=function(_0x3536ee,_0x4ad6c8){if(_0x3536ee[_0x19dd('0x18')]['id']){delete _0x3536ee[_0x19dd('0x18')]['id'];}var _0x2409e8={'online':_0x19dd('0x22'),'stopped':'stop'};if(_0x2409e8[_0x19dd('0x23')](_0x3536ee[_0x19dd('0x18')][_0x19dd('0x7')])){return pm2[_0x2409e8[_0x3536ee['body']['status']]](_0x3536ee[_0x19dd('0x17')]['id'])['then'](respondWithResult(_0x4ad6c8,0xc8))[_0x19dd('0x14')](handleError(_0x4ad6c8,null));}else{return _0x4ad6c8['status'](0x1f4)[_0x19dd('0x1f')]({'message':_0x19dd('0x24')});}};exports[_0x19dd('0x25')]=function(_0x3801af,_0x3396ed){if(_0x3801af[_0x19dd('0x18')]['id']){delete _0x3801af[_0x19dd('0x18')]['id'];}if(_0x3801af[_0x19dd('0x17')]['id']){return pm2[_0x19dd('0x26')](_0x3801af[_0x19dd('0x17')]['id'])['then'](function(_0x34beec){pm2[_0x19dd('0x27')]();return _0x34beec[0x0];})[_0x19dd('0xf')](respondWithResult(_0x3396ed,null))[_0x19dd('0x14')](handleError(_0x3396ed,null));}else{return _0x3396ed[_0x19dd('0x7')](0x1f4)['send']({'message':_0x19dd('0x28')});}}; \ No newline at end of file +var _0x9857=['dump','restart','stop','Unknown\x20status','destroy','delete','lodash','api','path','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','index','list','reject','motion2','length','catch','params','then','create','body','join','cwd','chdir'];(function(_0x4034c1,_0x13b600){var _0x540790=function(_0x7ea364){while(--_0x7ea364){_0x4034c1['push'](_0x4034c1['shift']());}};_0x540790(++_0x13b600);}(_0x9857,0x126));var _0x7985=function(_0x33fcd4,_0x52887b){_0x33fcd4=_0x33fcd4-0x0;var _0x56093b=_0x9857[_0x33fcd4];return _0x56093b;};'use strict';var _=require(_0x7985('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x7985('0x1'));var path=require(_0x7985('0x2'));var exec=require('child_process')[_0x7985('0x3')];var BPromise=require(_0x7985('0x4'));function handleEntityNotFound(_0x440cb8,_0x45a60e){return function(_0x5dcd7c){if(!_0x5dcd7c){_0x440cb8[_0x7985('0x5')](0x194);;}return _0x5dcd7c;};}function respondWithResult(_0x451a0f,_0x469c41){_0x469c41=_0x469c41||0xc8;return function(_0x5c35ac){if(_0x5c35ac){return _0x451a0f[_0x7985('0x6')](_0x469c41)[_0x7985('0x7')](_0x5c35ac);}return null;};}function handleError(_0x49ad4b,_0x290313){_0x290313=_0x290313||0x1f4;return function(_0x4cafd3){logger[_0x7985('0x8')](_0x4cafd3[_0x7985('0x9')]);if(_0x4cafd3['name']){delete _0x4cafd3[_0x7985('0xa')];}_0x49ad4b[_0x7985('0x6')](_0x290313)[_0x7985('0xb')](_0x4cafd3);};}function execChildProcess(){return new BPromise(function(_0x5797c2,_0x3e3f1e){exec('npm\x20install',function(_0x2b1d51,_0x8dfbd3,_0x3398ef){logger[_0x7985('0xc')](_0x8dfbd3);logger[_0x7985('0xc')](_0x3398ef);if(_0x2b1d51){logger['error'](_0x2b1d51);return _0x3e3f1e(_0x2b1d51);}return _0x5797c2(_0x8dfbd3);});});}exports[_0x7985('0xd')]=function(_0x2a68a9,_0x3e9baf){return pm2[_0x7985('0xe')]()['then'](function(_0x43d335){if(_0x43d335){var _0x2e3142=_[_0x7985('0xf')](_0x43d335,function(_0x9806fa){return _0x9806fa['name']==='express'||_0x9806fa[_0x7985('0xa')]===_0x7985('0x10');});return{'rows':_0x2e3142,'count':_0x2e3142[_0x7985('0x11')]};}return null;})['then'](respondWithResult(_0x3e9baf,null))[_0x7985('0x12')](handleError(_0x3e9baf,null));};exports['show']=function(_0xd6d73c,_0x4a944d){return pm2['describe'](_0xd6d73c[_0x7985('0x13')]['id'])['then'](respondWithResult(_0x4a944d,null))[_0x7985('0x14')](handleEntityNotFound(_0x4a944d,null))[_0x7985('0x12')](handleError(_0x4a944d,null));};exports[_0x7985('0x15')]=function(_0x57dcc2,_0x3797ce){if(_0x57dcc2[_0x7985('0x16')][_0x7985('0xa')]&&_0x57dcc2[_0x7985('0x16')]['script']){var _0x624402=path[_0x7985('0x17')](__dirname,'../../files/plugins',_0x57dcc2[_0x7985('0x16')]['script']);var _0xa466e0=process[_0x7985('0x18')]();process[_0x7985('0x19')](path['dirname'](_0x624402));return execChildProcess()[_0x7985('0x14')](function(_0x4d601b){process['chdir'](_0xa466e0);return pm2['start']({'name':_0x57dcc2['body'][_0x7985('0xa')],'script':_0x624402});})['then'](function(_0x1aaa27){pm2[_0x7985('0x1a')]();return _0x1aaa27[0x0];})[_0x7985('0x14')](respondWithResult(_0x3797ce,0xc9))[_0x7985('0x12')](handleError(_0x3797ce,null));}else{return _0x3797ce[_0x7985('0x6')](0x1f4)[_0x7985('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x324bdf,_0xa37597){if(_0x324bdf[_0x7985('0x16')]['id']){delete _0x324bdf[_0x7985('0x16')]['id'];}var _0x21b5cf={'online':_0x7985('0x1b'),'stopped':_0x7985('0x1c')};if(_0x21b5cf['hasOwnProperty'](_0x324bdf['body'][_0x7985('0x6')])){return pm2[_0x21b5cf[_0x324bdf[_0x7985('0x16')][_0x7985('0x6')]]](_0x324bdf['params']['id'])[_0x7985('0x14')](respondWithResult(_0xa37597,0xc8))[_0x7985('0x12')](handleError(_0xa37597,null));}else{return _0xa37597['status'](0x1f4)['send']({'message':_0x7985('0x1d')});}};exports[_0x7985('0x1e')]=function(_0x382137,_0x68449a){if(_0x382137[_0x7985('0x16')]['id']){delete _0x382137['body']['id'];}if(_0x382137[_0x7985('0x13')]['id']){return pm2[_0x7985('0x1f')](_0x382137[_0x7985('0x13')]['id'])['then'](function(_0x5b18b7){pm2[_0x7985('0x1a')]();return _0x5b18b7[0x0];})['then'](respondWithResult(_0x68449a,null))[_0x7985('0x12')](handleError(_0x68449a,null));}else{return _0x68449a[_0x7985('0x6')](0x1f4)[_0x7985('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8fb40d4..cf8a293 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cce=['exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x6cce,0x1f1));var _0xe6cc=function(_0x29f9af,_0x4f3d10){_0x29f9af=_0x29f9af-0x0;var _0x56e4a8=_0x6cce[_0x29f9af];return _0x56e4a8;};'use strict';var multer=require('multer');var util=require(_0xe6cc('0x0'));var path=require(_0xe6cc('0x1'));var timeout=require('connect-timeout');var express=require(_0xe6cc('0x2'));var router=express[_0xe6cc('0x3')]();var auth=require(_0xe6cc('0x4'));var interaction=require(_0xe6cc('0x5'));var config=require(_0xe6cc('0x6'));module[_0xe6cc('0x7')]=router; \ No newline at end of file +var _0xf4b2=['../../config/environment','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf4b2,0x9e));var _0x2f4b=function(_0x5d1a8a,_0x423eb5){_0x5d1a8a=_0x5d1a8a-0x0;var _0x3891e8=_0xf4b2[_0x5d1a8a];return _0x3891e8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2f4b('0x0'));var express=require('express');var router=express[_0x2f4b('0x1')]();var auth=require(_0x2f4b('0x2'));var interaction=require(_0x2f4b('0x3'));var config=require(_0x2f4b('0x4'));module[_0x2f4b('0x5')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 20e65b2..2cbc11e 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa321=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x517244,_0x13269f){var _0x5e9e1d=function(_0x979e53){while(--_0x979e53){_0x517244['push'](_0x517244['shift']());}};_0x5e9e1d(++_0x13269f);}(_0xa321,0xf4));var _0x1a32=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0xa321[_0x4dbba7];return _0x43ef83;};'use strict';var Sequelize=require(_0x1a32('0x0'));module[_0x1a32('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1a32('0x2')]},'uniqueid':{'type':Sequelize[_0x1a32('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1a32('0x2')]},'ringtime':{'type':Sequelize[_0x1a32('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x1a32('0x3')]},'campaigntype':{'type':Sequelize[_0x1a32('0x3')]},'membername':{'type':Sequelize[_0x1a32('0x3')]}}; \ No newline at end of file +var _0xbc47=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x5305f2,_0x180334){var _0x59a8f7=function(_0x30b5d8){while(--_0x30b5d8){_0x5305f2['push'](_0x5305f2['shift']());}};_0x59a8f7(++_0x180334);}(_0xbc47,0xd9));var _0x7bc4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xbc47[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require(_0x7bc4('0x0'));module[_0x7bc4('0x1')]={'state':{'type':Sequelize[_0x7bc4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x7bc4('0x3')]},'scheduledat':{'type':Sequelize[_0x7bc4('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7bc4('0x4')]},'ringtime':{'type':Sequelize[_0x7bc4('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7bc4('0x3')]},'campaigntype':{'type':Sequelize[_0x7bc4('0x3')]},'membername':{'type':Sequelize[_0x7bc4('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 56d0339..d11f454 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.model.js +++ b/server/api/reportAgentPreview/reportAgentPreview.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61fb=['../../config/logger','api','moment','bluebird','path','rimraf','exports','ReportAgentPreview','lodash'];(function(_0x5bd7d0,_0x535f62){var _0x4dfccb=function(_0x218147){while(--_0x218147){_0x5bd7d0['push'](_0x5bd7d0['shift']());}};_0x4dfccb(++_0x535f62);}(_0x61fb,0x8f));var _0xb61f=function(_0x1e11c2,_0x1bcbca){_0x1e11c2=_0x1e11c2-0x0;var _0x4faa44=_0x61fb[_0x1e11c2];return _0x4faa44;};'use strict';var _=require(_0xb61f('0x0'));var util=require('util');var logger=require(_0xb61f('0x1'))(_0xb61f('0x2'));var moment=require(_0xb61f('0x3'));var BPromise=require(_0xb61f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb61f('0x5'));var rimraf=require(_0xb61f('0x6'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xb61f('0x7')]=function(_0x128d12,_0x3d7dc9){return _0x128d12['define'](_0xb61f('0x8'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50f5=['../../config/logger','api','moment','request-promise','path','exports','define','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x50f5,0xb3));var _0x550f=function(_0x2101d5,_0x1c65af){_0x2101d5=_0x2101d5-0x0;var _0x4b8e51=_0x50f5[_0x2101d5];return _0x4b8e51;};'use strict';var _=require(_0x550f('0x0'));var util=require('util');var logger=require(_0x550f('0x1'))(_0x550f('0x2'));var moment=require(_0x550f('0x3'));var BPromise=require('bluebird');var rp=require(_0x550f('0x4'));var fs=require('fs');var path=require(_0x550f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0x550f('0x6')]=function(_0x2c5dd5,_0x45ba99){return _0x2c5dd5[_0x550f('0x7')](_0x550f('0x8'),attributes,{'tableName':_0x550f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 4613b83..bf5b68c 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js +++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50f7=['then','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x256731,_0x2d1e58){var _0x4ee31d=function(_0x5ef541){while(--_0x5ef541){_0x256731['push'](_0x256731['shift']());}};_0x4ee31d(++_0x2d1e58);}(_0x50f7,0x153));var _0x750f=function(_0x3260c8,_0x3fb3ac){_0x3260c8=_0x3260c8-0x0;var _0x606798=_0x50f7[_0x3260c8];return _0x606798;};'use strict';var _=require(_0x750f('0x0'));var util=require(_0x750f('0x1'));var moment=require('moment');var BPromise=require(_0x750f('0x2'));var rs=require(_0x750f('0x3'));var fs=require('fs');var Redis=require(_0x750f('0x4'));var db=require(_0x750f('0x5'))['db'];var utils=require(_0x750f('0x6'));var logger=require(_0x750f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x750f('0x8'));var client=jayson[_0x750f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x577f73,_0x2c2b6c,_0x552060){return new BPromise(function(_0x5e52e2,_0xae0e5b){return client[_0x750f('0xa')](_0x577f73,_0x552060)[_0x750f('0xb')](function(_0x390c95){logger['info'](_0x750f('0xc'),_0x2c2b6c,'request\x20sent');logger[_0x750f('0xd')](_0x750f('0xe'),_0x2c2b6c,'request\x20sent',JSON['stringify'](_0x390c95));if(_0x390c95[_0x750f('0xf')]){if(_0x390c95[_0x750f('0xf')]['code']===0x1f4){logger[_0x750f('0xf')](_0x750f('0xc'),_0x2c2b6c,_0x390c95[_0x750f('0xf')][_0x750f('0x10')]);return _0xae0e5b(_0x390c95['error'][_0x750f('0x10')]);}logger['error'](_0x750f('0xc'),_0x2c2b6c,_0x390c95[_0x750f('0xf')][_0x750f('0x10')]);return _0x5e52e2(_0x390c95['error'][_0x750f('0x10')]);}else{logger[_0x750f('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x2c2b6c,'request\x20sent');_0x5e52e2(_0x390c95[_0x750f('0x12')]['message']);}})['catch'](function(_0x1ab97e){logger['error'](_0x750f('0xc'),_0x2c2b6c,_0x1ab97e);_0xae0e5b(_0x1ab97e);});});}exports[_0x750f('0x13')]=function(_0x4bc4e6){var _0x3e5388=this;return new Promise(function(_0x1e3ec0,_0xe19bc){return db[_0x750f('0x14')][_0x750f('0x15')](_0x4bc4e6[_0x750f('0x16')],{'raw':_0x4bc4e6[_0x750f('0x17')]?_0x4bc4e6[_0x750f('0x17')][_0x750f('0x18')]===undefined?!![]:![]:!![]})[_0x750f('0xb')](function(_0x402d25){logger[_0x750f('0x11')]('CreateReportAgentPreview',_0x4bc4e6);logger[_0x750f('0xd')]('CreateReportAgentPreview',_0x4bc4e6,JSON['stringify'](_0x402d25));_0x1e3ec0(_0x402d25);})['catch'](function(_0x1176c8){logger[_0x750f('0xf')](_0x750f('0x13'),_0x1176c8[_0x750f('0x10')],_0x4bc4e6);_0xe19bc(_0x3e5388[_0x750f('0xf')](0x1f4,_0x1176c8['message']));});});}; \ No newline at end of file +var _0x4323=['jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','result','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4323,0x1b2));var _0x3432=function(_0x44d9b9,_0x409a69){_0x44d9b9=_0x44d9b9-0x0;var _0x47493f=_0x4323[_0x44d9b9];return _0x47493f;};'use strict';var _=require(_0x3432('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3432('0x1'));var rs=require(_0x3432('0x2'));var fs=require('fs');var Redis=require(_0x3432('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3432('0x4'));var logger=require(_0x3432('0x5'))(_0x3432('0x6'));var config=require(_0x3432('0x7'));var jayson=require(_0x3432('0x8'));var client=jayson[_0x3432('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59758b,_0x109eff,_0x4bca45){return new BPromise(function(_0x5eda43,_0x5a042e){return client[_0x3432('0xa')](_0x59758b,_0x4bca45)[_0x3432('0xb')](function(_0x9b8fe7){logger[_0x3432('0xc')](_0x3432('0xd'),_0x109eff,_0x3432('0xe'));logger[_0x3432('0xf')](_0x3432('0x10'),_0x109eff,_0x3432('0xe'),JSON['stringify'](_0x9b8fe7));if(_0x9b8fe7[_0x3432('0x11')]){if(_0x9b8fe7[_0x3432('0x11')]['code']===0x1f4){logger[_0x3432('0x11')](_0x3432('0xd'),_0x109eff,_0x9b8fe7[_0x3432('0x11')][_0x3432('0x12')]);return _0x5a042e(_0x9b8fe7[_0x3432('0x11')][_0x3432('0x12')]);}logger[_0x3432('0x11')](_0x3432('0xd'),_0x109eff,_0x9b8fe7['error'][_0x3432('0x12')]);return _0x5eda43(_0x9b8fe7[_0x3432('0x11')][_0x3432('0x12')]);}else{logger['info'](_0x3432('0xd'),_0x109eff,'request\x20sent');_0x5eda43(_0x9b8fe7[_0x3432('0x13')][_0x3432('0x12')]);}})['catch'](function(_0x475cf6){logger['error'](_0x3432('0xd'),_0x109eff,_0x475cf6);_0x5a042e(_0x475cf6);});});}exports['CreateReportAgentPreview']=function(_0x27b858){var _0x45d96a=this;return new Promise(function(_0x5089fe,_0x202810){return db[_0x3432('0x14')][_0x3432('0x15')](_0x27b858[_0x3432('0x16')],{'raw':_0x27b858[_0x3432('0x17')]?_0x27b858['options'][_0x3432('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5fe4d5){logger[_0x3432('0xc')](_0x3432('0x19'),_0x27b858);logger[_0x3432('0xf')](_0x3432('0x19'),_0x27b858,JSON['stringify'](_0x5fe4d5));_0x5089fe(_0x5fe4d5);})['catch'](function(_0x273e21){logger['error'](_0x3432('0x19'),_0x273e21[_0x3432('0x12')],_0x27b858);_0x202810(_0x45d96a[_0x3432('0x11')](0x1f4,_0x273e21[_0x3432('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1482cd3..772c040 100644 --- a/server/api/rpc/index.js +++ b/server/api/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb35e=['showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax'];(function(_0x1865cc,_0x3f9c95){var _0x36491c=function(_0x45fc16){while(--_0x45fc16){_0x1865cc['push'](_0x1865cc['shift']());}};_0x36491c(++_0x3f9c95);}(_0xb35e,0x96));var _0xeb35=function(_0xe464f3,_0xd7ff9c){_0xe464f3=_0xe464f3-0x0;var _0x2037b6=_0xb35e[_0xe464f3];return _0x2037b6;};'use strict';var multer=require('multer');var util=require(_0xeb35('0x0'));var path=require(_0xeb35('0x1'));var express=require(_0xeb35('0x2'));var router=express[_0xeb35('0x3')]();var auth=require(_0xeb35('0x4'));var controller=require(_0xeb35('0x5'));router['get'](_0xeb35('0x6'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x8')]);router[_0xeb35('0x9')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xeb35('0x7')](),controller[_0xeb35('0xa')]);router[_0xeb35('0x9')](_0xeb35('0xb'),auth[_0xeb35('0x7')](),controller[_0xeb35('0xc')]);router[_0xeb35('0x9')](_0xeb35('0xd'),auth[_0xeb35('0x7')](),controller[_0xeb35('0xe')]);router[_0xeb35('0x9')](_0xeb35('0xf'),auth['isAuthenticated'](),controller['chatQueues']);router['get']('/mail/queues',auth[_0xeb35('0x7')](),controller[_0xeb35('0x10')]);router[_0xeb35('0x9')](_0xeb35('0x11'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x12')]);router[_0xeb35('0x9')]('/openchannel/queues',auth[_0xeb35('0x7')](),controller[_0xeb35('0x13')]);router[_0xeb35('0x9')](_0xeb35('0x14'),auth['isAuthenticated'](),controller[_0xeb35('0x15')]);router[_0xeb35('0x9')]('/fax/queues',auth[_0xeb35('0x7')](),controller[_0xeb35('0x16')]);router[_0xeb35('0x9')](_0xeb35('0x17'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x18')]);router['get']('/voice/queues/channels',auth[_0xeb35('0x7')](),controller[_0xeb35('0x19')]);router[_0xeb35('0x9')](_0xeb35('0x1a'),auth['isAuthenticated'](),controller[_0xeb35('0x1b')]);router[_0xeb35('0x9')](_0xeb35('0x1c'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x1d')]);router[_0xeb35('0x9')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xeb35('0x7')](),controller[_0xeb35('0x1e')]);router[_0xeb35('0x9')](_0xeb35('0x1f'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x20')]);router['get'](_0xeb35('0x21'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x22')]);router['get'](_0xeb35('0x23'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x24')]);router[_0xeb35('0x9')](_0xeb35('0x25'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x26')]);router[_0xeb35('0x27')](_0xeb35('0x28'),auth['isAuthenticated'](),controller[_0xeb35('0x29')]);router[_0xeb35('0x9')](_0xeb35('0x2a'),auth['isAuthenticated'](),controller[_0xeb35('0x2b')]);router[_0xeb35('0x9')]('/trunks',auth[_0xeb35('0x7')](),controller['trunks']);router[_0xeb35('0x9')](_0xeb35('0x2c'),auth['isAuthenticated'](),controller[_0xeb35('0x2d')]);router[_0xeb35('0x9')]('/fax/accounts',auth[_0xeb35('0x7')](),controller[_0xeb35('0x2e')]);router[_0xeb35('0x9')](_0xeb35('0x2f'),auth[_0xeb35('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xeb35('0x9')](_0xeb35('0x30'),auth[_0xeb35('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0xeb35('0x9')]('/openchannel/queues/waitinginteractions',auth[_0xeb35('0x7')](),controller[_0xeb35('0x31')]);router[_0xeb35('0x9')](_0xeb35('0x32'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x33')]);router[_0xeb35('0x9')](_0xeb35('0x34'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x35')]);router[_0xeb35('0x36')](_0xeb35('0x37'),auth['isAuthenticated'](),controller[_0xeb35('0x38')](_0xeb35('0x39')));router[_0xeb35('0x9')]('/mail/queues/:id',auth['isAuthenticated'](),controller[_0xeb35('0x3a')]);router['post']('/chat/queues/:id/notify',auth[_0xeb35('0x7')](),controller[_0xeb35('0x38')]('chat'));router[_0xeb35('0x9')](_0xeb35('0x3b'),auth['isAuthenticated'](),controller[_0xeb35('0x3c')]);router[_0xeb35('0x36')](_0xeb35('0x3d'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x38')](_0xeb35('0x3e')));router['get']('/fax/queues/:id',auth[_0xeb35('0x7')](),controller[_0xeb35('0x3f')]);router[_0xeb35('0x36')]('/openchannel/queues/:id/notify',auth[_0xeb35('0x7')](),controller[_0xeb35('0x38')](_0xeb35('0x40')));router[_0xeb35('0x9')](_0xeb35('0x41'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x42')]);router['post'](_0xeb35('0x43'),auth[_0xeb35('0x7')](),controller['queueNotify'](_0xeb35('0x44')));router[_0xeb35('0x9')](_0xeb35('0x45'),auth[_0xeb35('0x7')](),controller[_0xeb35('0x46')]);router[_0xeb35('0x36')]('/agents/:id/notify',auth['isAuthenticated'](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0x3457=['/mail/queues/:id/notify','mail','showMailQueues','chat','/chat/queues/:id','/fax/queues/:id/notify','queueNotify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','outboundChannels','/agents','agentCapacity','/telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post'];(function(_0x4511b1,_0x4073a7){var _0x71629f=function(_0x1c0e77){while(--_0x1c0e77){_0x4511b1['push'](_0x4511b1['shift']());}};_0x71629f(++_0x4073a7);}(_0x3457,0x93));var _0x7345=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3457[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require('express');var router=express[_0x7345('0x0')]();var auth=require(_0x7345('0x1'));var controller=require(_0x7345('0x2'));router[_0x7345('0x3')](_0x7345('0x4'),auth[_0x7345('0x5')](),controller['voiceChannels']);router[_0x7345('0x3')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x7345('0x3')](_0x7345('0x6'),auth[_0x7345('0x5')](),controller[_0x7345('0x7')]);router[_0x7345('0x3')](_0x7345('0x8'),auth['isAuthenticated'](),controller[_0x7345('0x9')]);router[_0x7345('0x3')](_0x7345('0xa'),auth[_0x7345('0x5')](),controller['chatQueues']);router[_0x7345('0x3')](_0x7345('0xb'),auth[_0x7345('0x5')](),controller[_0x7345('0xc')]);router['get'](_0x7345('0xd'),auth['isAuthenticated'](),controller[_0x7345('0xe')]);router[_0x7345('0x3')](_0x7345('0xf'),auth['isAuthenticated'](),controller[_0x7345('0x10')]);router[_0x7345('0x3')](_0x7345('0x11'),auth[_0x7345('0x5')](),controller[_0x7345('0x12')]);router[_0x7345('0x3')]('/fax/queues',auth[_0x7345('0x5')](),controller[_0x7345('0x13')]);router[_0x7345('0x3')](_0x7345('0x14'),auth[_0x7345('0x5')](),controller[_0x7345('0x15')]);router[_0x7345('0x3')]('/voice/queues/channels',auth[_0x7345('0x5')](),controller[_0x7345('0x16')]);router['get'](_0x7345('0x17'),auth['isAuthenticated'](),controller[_0x7345('0x18')]);router[_0x7345('0x3')](_0x7345('0x19'),auth[_0x7345('0x5')](),controller[_0x7345('0x1a')]);router[_0x7345('0x3')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x7345('0x5')](),controller[_0x7345('0x1b')]);router[_0x7345('0x3')](_0x7345('0x1c'),auth[_0x7345('0x5')](),controller['showVoiceQueues']);router[_0x7345('0x3')](_0x7345('0x1d'),auth[_0x7345('0x5')](),controller[_0x7345('0x1e')]);router['get']('/outbound/channels',auth['isAuthenticated'](),controller[_0x7345('0x1f')]);router[_0x7345('0x3')](_0x7345('0x20'),auth['isAuthenticated'](),controller['agents']);router['put']('/agents/:id/capacity',auth[_0x7345('0x5')](),controller[_0x7345('0x21')]);router[_0x7345('0x3')](_0x7345('0x22'),auth[_0x7345('0x5')](),controller['telephones']);router['get']('/trunks',auth[_0x7345('0x5')](),controller[_0x7345('0x23')]);router[_0x7345('0x3')]('/campaigns',auth[_0x7345('0x5')](),controller[_0x7345('0x24')]);router[_0x7345('0x3')](_0x7345('0x25'),auth['isAuthenticated'](),controller[_0x7345('0x26')]);router[_0x7345('0x3')](_0x7345('0x27'),auth[_0x7345('0x5')](),controller[_0x7345('0x28')]);router[_0x7345('0x3')](_0x7345('0x29'),auth[_0x7345('0x5')](),controller[_0x7345('0x2a')]);router[_0x7345('0x3')](_0x7345('0x2b'),auth[_0x7345('0x5')](),controller['openchannelQueuesWaitingInteractions']);router[_0x7345('0x3')](_0x7345('0x2c'),auth[_0x7345('0x5')](),controller['smsQueuesWaitingInteractions']);router[_0x7345('0x3')](_0x7345('0x2d'),auth[_0x7345('0x5')](),controller[_0x7345('0x2e')]);router[_0x7345('0x2f')](_0x7345('0x30'),auth[_0x7345('0x5')](),controller['queueNotify'](_0x7345('0x31')));router[_0x7345('0x3')]('/mail/queues/:id',auth[_0x7345('0x5')](),controller[_0x7345('0x32')]);router['post']('/chat/queues/:id/notify',auth[_0x7345('0x5')](),controller['queueNotify'](_0x7345('0x33')));router[_0x7345('0x3')](_0x7345('0x34'),auth[_0x7345('0x5')](),controller['showChatQueues']);router[_0x7345('0x2f')](_0x7345('0x35'),auth['isAuthenticated'](),controller[_0x7345('0x36')](_0x7345('0x37')));router['get']('/fax/queues/:id',auth[_0x7345('0x5')](),controller[_0x7345('0x38')]);router[_0x7345('0x2f')](_0x7345('0x39'),auth[_0x7345('0x5')](),controller[_0x7345('0x36')]('openchannel'));router[_0x7345('0x3')](_0x7345('0x3a'),auth[_0x7345('0x5')](),controller[_0x7345('0x3b')]);router['post'](_0x7345('0x3c'),auth[_0x7345('0x5')](),controller['queueNotify'](_0x7345('0x3d')));router[_0x7345('0x3')](_0x7345('0x3e'),auth[_0x7345('0x5')](),controller[_0x7345('0x3f')]);router[_0x7345('0x2f')](_0x7345('0x40'),auth[_0x7345('0x5')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5a85555..6698351 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdd5=['outboundChannels','OutboundChannels','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','chatQueues','showChatQueues','ChatQueues','mailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','Start','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','TransferReport','create','agentTransferTimeout','lodash','util','../../config/logger','jayson/promise','client','http','request','then','error','code','message','catch','status','sendStatus','name','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound'];(function(_0x1d6951,_0x129299){var _0x380992=function(_0x3021b7){while(--_0x3021b7){_0x1d6951['push'](_0x1d6951['shift']());}};_0x380992(++_0x129299);}(_0xbdd5,0x18f));var _0x5bdd=function(_0x5356bb,_0x4ccf34){_0x5356bb=_0x5356bb-0x0;var _0x8f9ef3=_0xbdd5[_0x5356bb];return _0x8f9ef3;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x5bdd('0x0'));var util=require(_0x5bdd('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x5bdd('0x2'))('api');var jayson=require(_0x5bdd('0x3'));var amiClient=jayson[_0x5bdd('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x5bdd('0x4')]['http']({'port':0x232b});var routingClient=jayson[_0x5bdd('0x4')][_0x5bdd('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x1f15be,_0x3d02ed,_0x58b3ad){return new BPromise(function(_0x4c1b0e,_0x2ee614){var _0x53d14a=_0x58b3ad?_0x58b3ad:amiClient;return _0x53d14a[_0x5bdd('0x6')](_0x1f15be,_0x3d02ed)[_0x5bdd('0x7')](function(_0xbb807d){if(_0xbb807d[_0x5bdd('0x8')]){if(_0xbb807d[_0x5bdd('0x8')][_0x5bdd('0x9')]===0x1f4){return _0x2ee614(_0xbb807d['error'][_0x5bdd('0xa')]);}return _0x4c1b0e(_0xbb807d[_0x5bdd('0x8')][_0x5bdd('0xa')]);}else{_0x4c1b0e(_0xbb807d['result']);}})[_0x5bdd('0xb')](function(_0x333abe){_0x2ee614(_0x333abe);});});}function respondWithResult(_0x1a7d3f,_0x3ae7af){_0x3ae7af=_0x3ae7af||0xc8;return function(_0x51a53c){if(_0x51a53c){return _0x1a7d3f[_0x5bdd('0xc')](_0x3ae7af)['json'](_0x51a53c);}return _0x1a7d3f[_0x5bdd('0xd')](0x194);};}function handleError(_0x5a7cda,_0x529d48){_0x529d48=_0x529d48||0x1f4;return function(_0x307cc3){logger[_0x5bdd('0x8')](_0x307cc3['stack']);if(_0x307cc3[_0x5bdd('0xe')]){delete _0x307cc3['name'];}_0x5a7cda['status'](_0x529d48)[_0x5bdd('0xf')](_0x307cc3);};}function findById(_0x28a024){return function(_0x1391f4){if(!_[_0x5bdd('0x10')](_0x28a024)&&!_[_0x5bdd('0x10')](_0x1391f4)&&!_[_0x5bdd('0x10')](_0x1391f4[_0x5bdd('0x11')])){return _[_0x5bdd('0x12')](_0x1391f4['rows'],function(_0x35ddef){return _0x35ddef['id']==_0x28a024;});}return null;};}exports[_0x5bdd('0x13')]=function(_0x238b11,_0x5a6912){return respondWithRpcPromise('VoiceChannels',_0x238b11[_0x5bdd('0x14')])[_0x5bdd('0x7')](respondWithResult(_0x5a6912,null))[_0x5bdd('0xb')](handleError(_0x5a6912,null));};exports[_0x5bdd('0x15')]=function(_0x223c71,_0x136368){return respondWithRpcPromise(_0x5bdd('0x16'),_[_0x5bdd('0x17')](_0x223c71[_0x5bdd('0x14')],_0x223c71[_0x5bdd('0x18')]))[_0x5bdd('0x7')](respondWithResult(_0x136368,null))[_0x5bdd('0xb')](handleError(_0x136368,null));};exports[_0x5bdd('0x19')]=function(_0x4cc4df,_0x12e0c8){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x4cc4df[_0x5bdd('0x14')],_0x4cc4df[_0x5bdd('0x18')]))[_0x5bdd('0x7')](respondWithResult(_0x12e0c8,null))[_0x5bdd('0xb')](handleError(_0x12e0c8,null));};exports['voiceQueues']=function(_0x2ed16e,_0x5ddb65){return respondWithRpcPromise(_0x5bdd('0x1a'),_0x2ed16e[_0x5bdd('0x14')])[_0x5bdd('0x7')](respondWithResult(_0x5ddb65,null))[_0x5bdd('0xb')](handleError(_0x5ddb65,null));};exports[_0x5bdd('0x1b')]=function(_0xe9063c,_0x58efd4){return respondWithRpcPromise(_0x5bdd('0x1a'),_0xe9063c['query'])[_0x5bdd('0x7')](findById(_0xe9063c[_0x5bdd('0x18')]['id']))[_0x5bdd('0x7')](respondWithResult(_0x58efd4,null))[_0x5bdd('0xb')](handleError(_0x58efd4,null));};exports[_0x5bdd('0x1c')]=function(_0x69c866,_0x41e243){return respondWithRpcPromise(_0x5bdd('0x1d'),_[_0x5bdd('0x17')](_0x69c866['query'],_0x69c866['params']))[_0x5bdd('0x7')](respondWithResult(_0x41e243,null))[_0x5bdd('0xb')](handleError(_0x41e243,null));};exports['voiceQueuesChannels']=function(_0x5686c6,_0x181c3d){return respondWithRpcPromise(_0x5bdd('0x1e'),_0x5686c6[_0x5bdd('0x14')])[_0x5bdd('0x7')](respondWithResult(_0x181c3d,null))[_0x5bdd('0xb')](handleError(_0x181c3d,null));};exports[_0x5bdd('0x1f')]=function(_0x196cac,_0x6cfdd3){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x5bdd('0x17')](_0x196cac['query'],_0x196cac[_0x5bdd('0x18')]))[_0x5bdd('0x7')](respondWithResult(_0x6cfdd3,null))[_0x5bdd('0xb')](handleError(_0x6cfdd3,null));};exports[_0x5bdd('0x20')]=function(_0x5c306b,_0x344efe){return respondWithRpcPromise(_0x5bdd('0x21'),_[_0x5bdd('0x17')](_0x5c306b[_0x5bdd('0x14')],_0x5c306b[_0x5bdd('0x18')]))[_0x5bdd('0x7')](respondWithResult(_0x344efe,null))['catch'](handleError(_0x344efe,null));};exports[_0x5bdd('0x22')]=function(_0x4ef65e,_0x3533d6){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x4ef65e[_0x5bdd('0x14')],_0x4ef65e[_0x5bdd('0x18')]))[_0x5bdd('0x7')](respondWithResult(_0x3533d6,null))[_0x5bdd('0xb')](handleError(_0x3533d6,null));};exports[_0x5bdd('0x23')]=function(_0xa889e3,_0x22a79e){return respondWithRpcPromise(_0x5bdd('0x24'),_0xa889e3[_0x5bdd('0x14')])[_0x5bdd('0x7')](respondWithResult(_0x22a79e,null))[_0x5bdd('0xb')](handleError(_0x22a79e,null));};exports[_0x5bdd('0x25')]=function(_0x5652,_0x40ff46){return respondWithRpcPromise(_0x5bdd('0x26'),_0x5652[_0x5bdd('0x14')])['then'](respondWithResult(_0x40ff46,null))['catch'](handleError(_0x40ff46,null));};exports['agents']=function(_0x1e7574,_0x38eafb){var _0x2c72e4;return respondWithRpcPromise(_0x5bdd('0x27'),_0x1e7574[_0x5bdd('0x14')])['then'](function(_0x996927){_0x2c72e4=_0x996927;return respondWithRpcPromise(_0x5bdd('0x27'),_0x1e7574[_0x5bdd('0x14')],routingClient);})['then'](function(_0x4ceaad){return _[_0x5bdd('0x17')]({},_0x4ceaad,_0x2c72e4);})[_0x5bdd('0x7')](respondWithResult(_0x38eafb,null))[_0x5bdd('0xb')](handleError(_0x38eafb,null));};exports[_0x5bdd('0x28')]=function(_0x25c940,_0x15b8e5){if(_0x25c940[_0x5bdd('0x29')]&&_0x25c940[_0x5bdd('0x29')]['interaction']&&_0x25c940[_0x5bdd('0x2a')]&&_0x25c940[_0x5bdd('0x2a')][_0x5bdd('0xe')]){for(var _0x471eef in _0x25c940['body'][_0x5bdd('0x2b')]){if(_0x25c940[_0x5bdd('0x29')]['interaction'][_0x5bdd('0x2c')](_0x471eef)){db[_0x5bdd('0x2d')][_0x5bdd('0x2e')]({'where':{'channel':_0x471eef,'membername':_0x25c940[_0x5bdd('0x2a')]['name'],'type':_0x5bdd('0x2f'),'exitAt':null,'uniqueid':_0x25c940[_0x5bdd('0x29')][_0x5bdd('0x2b')][_0x471eef]&&_0x25c940[_0x5bdd('0x29')][_0x5bdd('0x2b')][_0x471eef][_0x5bdd('0x30')]?{'$notIn':_0x25c940[_0x5bdd('0x29')][_0x5bdd('0x2b')][_0x471eef]}:{'$ne':null}}})['then'](function(_0x26dca0){var _0x4337e5=moment()[_0x5bdd('0x31')](_0x5bdd('0x32'));for(var _0x340037=0x0,_0x4a670e=_0x26dca0[_0x5bdd('0x30')];_0x340037<_0x4a670e;_0x340037+=0x1){_0x26dca0[_0x340037][_0x5bdd('0x33')]({'exitAt':_0x4337e5});}});for(var _0x40d27a=0x0;_0x40d27a<_0x25c940[_0x5bdd('0x29')][_0x5bdd('0x2b')][_0x471eef][_0x5bdd('0x30')];_0x40d27a+=0x1){db[_0x5bdd('0x2d')][_0x5bdd('0x34')]({'where':{'channel':_0x471eef,'membername':_0x25c940[_0x5bdd('0x2a')]['name'],'type':_0x5bdd('0x2f'),'uniqueid':_0x25c940[_0x5bdd('0x29')]['interaction'][_0x471eef][_0x40d27a],'exitAt':null},'defaults':{'channel':_0x471eef,'membername':_0x25c940['user'][_0x5bdd('0xe')],'interface':_['isNil'](_0x25c940[_0x5bdd('0x2a')][_0x5bdd('0x35')])?util[_0x5bdd('0x31')]('SIP/%s',_0x25c940[_0x5bdd('0x2a')][_0x5bdd('0xe')]):_0x25c940[_0x5bdd('0x2a')][_0x5bdd('0x35')],'type':_0x5bdd('0x2f'),'enterAt':moment()[_0x5bdd('0x31')](_0x5bdd('0x32')),'role':_0x5bdd('0x36'),'internal':_0x25c940['user'][_0x5bdd('0x37')],'uniqueid':_0x25c940[_0x5bdd('0x29')][_0x5bdd('0x2b')][_0x471eef][_0x40d27a]}});}}}}return respondWithRpcPromise(_0x5bdd('0x38'),{'id':_0x25c940['params']['id'],'capacity':_0x25c940[_0x5bdd('0x29')][_0x5bdd('0x39')]},routingClient)[_0x5bdd('0x7')](respondWithResult(_0x15b8e5,null))[_0x5bdd('0xb')](handleError(_0x15b8e5,null));};exports[_0x5bdd('0x3a')]=function(_0xae49e4,_0x4a1a4a){return respondWithRpcPromise(_0x5bdd('0x3b'),_0xae49e4[_0x5bdd('0x14')])[_0x5bdd('0x7')](respondWithResult(_0x4a1a4a,null))[_0x5bdd('0xb')](handleError(_0x4a1a4a,null));};exports[_0x5bdd('0x3c')]=function(_0x27e805,_0xc1a4d5){return respondWithRpcPromise(_0x5bdd('0x3d'),_0x27e805['query'])[_0x5bdd('0x7')](respondWithResult(_0xc1a4d5,null))[_0x5bdd('0xb')](handleError(_0xc1a4d5,null));};exports['campaigns']=function(_0x27a03a,_0x50223b){return respondWithRpcPromise('Campaigns',_0x27a03a['query'])[_0x5bdd('0x7')](respondWithResult(_0x50223b,null))[_0x5bdd('0xb')](handleError(_0x50223b,null));};exports[_0x5bdd('0x3e')]=function(_0x37a2ae,_0x50d5b2){return respondWithRpcPromise('ChatQueues',_0x37a2ae[_0x5bdd('0x14')],routingClient)[_0x5bdd('0x7')](respondWithResult(_0x50d5b2,null))[_0x5bdd('0xb')](handleError(_0x50d5b2,null));};exports[_0x5bdd('0x3f')]=function(_0x41ab0b,_0x4ac334){return respondWithRpcPromise(_0x5bdd('0x40'),_0x41ab0b['query'],routingClient)[_0x5bdd('0x7')](findById(_0x41ab0b['params']['id']))[_0x5bdd('0x7')](respondWithResult(_0x4ac334,null))[_0x5bdd('0xb')](handleError(_0x4ac334,null));};exports[_0x5bdd('0x41')]=function(_0x124135,_0x5a1868){return respondWithRpcPromise('MailQueues',_0x124135[_0x5bdd('0x14')],routingClient)[_0x5bdd('0x7')](respondWithResult(_0x5a1868,null))[_0x5bdd('0xb')](handleError(_0x5a1868,null));};exports[_0x5bdd('0x42')]=function(_0x59db7f,_0x562cf4){return respondWithRpcPromise('MailQueues',_0x59db7f[_0x5bdd('0x14')],routingClient)[_0x5bdd('0x7')](findById(_0x59db7f['params']['id']))[_0x5bdd('0x7')](respondWithResult(_0x562cf4,null))[_0x5bdd('0xb')](handleError(_0x562cf4,null));};exports[_0x5bdd('0x43')]=function(_0x157942,_0x170707){return respondWithRpcPromise(_0x5bdd('0x44'),_0x157942[_0x5bdd('0x14')],mailClient)[_0x5bdd('0x7')](respondWithResult(_0x170707,null))[_0x5bdd('0xb')](handleError(_0x170707,null));};exports[_0x5bdd('0x45')]=function(_0x7db697,_0x5a331e){return respondWithRpcPromise(_0x5bdd('0x46'),_0x7db697[_0x5bdd('0x14')],routingClient)['then'](respondWithResult(_0x5a331e,null))['catch'](handleError(_0x5a331e,null));};exports['showOpenchannelQueues']=function(_0x30b7e5,_0xefa7e9){return respondWithRpcPromise(_0x5bdd('0x46'),_0x30b7e5['query'],routingClient)[_0x5bdd('0x7')](findById(_0x30b7e5[_0x5bdd('0x18')]['id']))['then'](respondWithResult(_0xefa7e9,null))[_0x5bdd('0xb')](handleError(_0xefa7e9,null));};exports[_0x5bdd('0x47')]=function(_0x53f8e2,_0x50950a){return respondWithRpcPromise(_0x5bdd('0x48'),_0x53f8e2[_0x5bdd('0x14')],routingClient)['then'](respondWithResult(_0x50950a,null))[_0x5bdd('0xb')](handleError(_0x50950a,null));};exports[_0x5bdd('0x49')]=function(_0x5dc805,_0x50f3ca){return respondWithRpcPromise(_0x5bdd('0x48'),_0x5dc805['query'],routingClient)['then'](findById(_0x5dc805[_0x5bdd('0x18')]['id']))['then'](respondWithResult(_0x50f3ca,null))[_0x5bdd('0xb')](handleError(_0x50f3ca,null));};exports['faxQueues']=function(_0xc0fc78,_0x51c058){return respondWithRpcPromise(_0x5bdd('0x4a'),_0xc0fc78[_0x5bdd('0x14')],routingClient)[_0x5bdd('0x7')](respondWithResult(_0x51c058,null))[_0x5bdd('0xb')](handleError(_0x51c058,null));};exports[_0x5bdd('0x4b')]=function(_0x40f967,_0x20119c){return respondWithRpcPromise(_0x5bdd('0x4a'),_0x40f967[_0x5bdd('0x14')],routingClient)[_0x5bdd('0x7')](findById(_0x40f967[_0x5bdd('0x18')]['id']))[_0x5bdd('0x7')](respondWithResult(_0x20119c,null))['catch'](handleError(_0x20119c,null));};exports[_0x5bdd('0x4c')]=function(_0xf0455f,_0x379602){return respondWithRpcPromise('FaxAccounts',_0xf0455f[_0x5bdd('0x14')])[_0x5bdd('0x7')](respondWithResult(_0x379602,null))['catch'](handleError(_0x379602,null));};exports[_0x5bdd('0x4d')]=function(_0x57d478,_0x11e9ec){return respondWithRpcPromise(_0x5bdd('0x4e'),_0x57d478[_0x5bdd('0x14')],routingClient)[_0x5bdd('0x7')](respondWithResult(_0x11e9ec,null))[_0x5bdd('0xb')](handleError(_0x11e9ec,null));};exports['mailQueuesWaitingInteractions']=function(_0x4442a6,_0x5bfc80){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x4442a6['query'],routingClient)['then'](respondWithResult(_0x5bfc80,null))[_0x5bdd('0xb')](handleError(_0x5bfc80,null));};exports[_0x5bdd('0x4f')]=function(_0xf7f1,_0x4fcfa4){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0xf7f1['query'],routingClient)[_0x5bdd('0x7')](respondWithResult(_0x4fcfa4,null))['catch'](handleError(_0x4fcfa4,null));};exports[_0x5bdd('0x50')]=function(_0x594643,_0x15516b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x594643['query'],routingClient)[_0x5bdd('0x7')](respondWithResult(_0x15516b,null))[_0x5bdd('0xb')](handleError(_0x15516b,null));};exports[_0x5bdd('0x51')]=function(_0x319b10,_0x47d364){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x319b10[_0x5bdd('0x14')],routingClient)[_0x5bdd('0x7')](respondWithResult(_0x47d364,null))[_0x5bdd('0xb')](handleError(_0x47d364,null));};exports[_0x5bdd('0x52')]=function(_0x126e23){return function(_0x4adfce,_0x582824){var _0x21bd39,_0x14729f;var _0x8aff86=_[_0x5bdd('0x53')](_0x126e23);var _0x5b73e1=_0x126e23===_0x5bdd('0x54')?_0x5bdd('0x55'):'Account';return db[_0x8aff86+_0x5bdd('0x56')][_0x5bdd('0x57')]({'raw':!![],'where':{'id':_0x4adfce[_0x5bdd('0x18')]['id']}})[_0x5bdd('0x7')](function(_0x1bf512){if(_['isNil'](_0x1bf512)){throw new Error(_0x8aff86+_0x5bdd('0x58'));}_0x21bd39=_0x1bf512;return db[_0x8aff86+_0x5bdd('0x59')][_0x5bdd('0x57')]({'where':{'id':_0x4adfce[_0x5bdd('0x29')]['messageId']},'include':[{'model':db[_0x8aff86+_0x5bdd('0x5a')],'as':_0x5bdd('0x5a')},{'model':db[_0x8aff86+_0x5b73e1],'as':_0x5bdd('0x5b')}]});})[_0x5bdd('0x7')](function(_0x5cdc7b){if(_[_0x5bdd('0x10')](_0x5cdc7b)){throw new Error(_0x8aff86+_0x5bdd('0x5c'));}_0x14729f=_0x5cdc7b;return _0x5cdc7b[_0x5bdd('0x5d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5bdd('0x7')](function(){var _0x463ccc={'uniqueid':_0x126e23+'.'+_0x14729f['id']+'.'+_0x14729f['Interaction']['id'],'FromUserId':_0x4adfce[_0x5bdd('0x2a')]['id'],'type':_0x5bdd('0x5e')};_0x463ccc[_0x8aff86+'MessageId']=_0x14729f['id'];_0x463ccc[_0x8aff86+_0x5bdd('0x5f')]=_0x14729f[_0x5bdd('0x5a')]['id'];_0x463ccc[_0x5bdd('0x60')+_0x8aff86+_0x5b73e1+'Id']=_0x14729f[_0x5bdd('0x5b')]['id'];_0x463ccc['To'+_0x8aff86+_0x5bdd('0x61')]=_0x21bd39['id'];return db[_0x8aff86+'TransferReport']['create'](_0x463ccc);})[_0x5bdd('0x7')](function(){return respondWithRpcPromise(_0x5bdd('0x62'),{'channel':_0x126e23,'interaction':_0x14729f[_0x5bdd('0x5a')],'message':_0x14729f,'account':_0x14729f['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x5bdd('0x5e'),'appdata':_0x21bd39[_0x5bdd('0xe')]+','+(_0x14729f[_0x5bdd('0x5b')]['queueTransferTimeout']||0x12c),'interval':_0x5bdd('0x63')}]},routingClient);})[_0x5bdd('0x7')](respondWithResult(_0x582824,null))['catch'](handleError(_0x582824,null));};};exports[_0x5bdd('0x64')]=function(_0x58373e,_0x477ebd){var _0x4b1b6d,_0x518482;if(_[_0x5bdd('0x10')](_0x58373e['body'][_0x5bdd('0x65')])){throw new Error(_0x5bdd('0x66'));}var _0x5206d8=_0x58373e['body'][_0x5bdd('0x65')];var _0x34c9cb=_['capitalize'](_0x5206d8);var _0x4acb2e=_0x5206d8===_0x5bdd('0x54')?_0x5bdd('0x55'):_0x5bdd('0x5b');return db[_0x5bdd('0x67')][_0x5bdd('0x57')]({'raw':!![],'where':{'id':_0x58373e[_0x5bdd('0x18')]['id'],'role':'agent'}})[_0x5bdd('0x7')](function(_0x58c4b4){if(_[_0x5bdd('0x10')](_0x58c4b4)){throw new Error(_0x5bdd('0x68'));}_0x4b1b6d=_0x58c4b4;return db[_0x34c9cb+_0x5bdd('0x59')][_0x5bdd('0x57')]({'where':{'id':_0x58373e[_0x5bdd('0x29')]['messageId']},'include':[{'model':db[_0x34c9cb+_0x5bdd('0x5a')],'as':_0x5bdd('0x5a')},{'model':db[_0x34c9cb+_0x4acb2e],'as':'Account'}]});})[_0x5bdd('0x7')](function(_0xc114af){if(_[_0x5bdd('0x10')](_0xc114af)){throw new Error(_0x34c9cb+_0x5bdd('0x5c'));}_0x518482=_0xc114af;return _0xc114af[_0x5bdd('0x5d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5bdd('0x7')](function(){var _0x1d9bbf={'uniqueid':_0x5206d8+'.'+_0x518482['id']+'.'+_0x518482[_0x5bdd('0x5a')]['id'],'FromUserId':_0x58373e[_0x5bdd('0x2a')]['id'],'type':_0x5bdd('0x5e'),'ToUserId':_0x4b1b6d['id']};_0x1d9bbf[_0x34c9cb+_0x5bdd('0x69')]=_0x518482['id'];_0x1d9bbf[_0x34c9cb+_0x5bdd('0x5f')]=_0x518482[_0x5bdd('0x5a')]['id'];_0x1d9bbf[_0x5bdd('0x60')+_0x34c9cb+_0x4acb2e+'Id']=_0x518482[_0x5bdd('0x5b')]['id'];return db[_0x34c9cb+_0x5bdd('0x6a')][_0x5bdd('0x6b')](_0x1d9bbf);})[_0x5bdd('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x5206d8,'interaction':_0x518482['Interaction'],'message':_0x518482,'account':_0x518482[_0x5bdd('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4b1b6d['name']+','+(_0x518482[_0x5bdd('0x5b')][_0x5bdd('0x6c')]||0x12c),'interval':_0x5bdd('0x63')}]},routingClient);})[_0x5bdd('0x7')](respondWithResult(_0x477ebd,null))[_0x5bdd('0xb')](handleError(_0x477ebd,null));}; \ No newline at end of file +var _0xf518=['voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','interface','format','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','\x20Queue\x20not\x20found','Message','findOne','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','create','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','query','voiceQueues','showVoiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf518,0xc5));var _0x8f51=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0xf518[_0x42bb6d];return _0x1db89b;};'use strict';var BPromise=require(_0x8f51('0x0'));var moment=require(_0x8f51('0x1'));var _=require(_0x8f51('0x2'));var util=require(_0x8f51('0x3'));var db=require(_0x8f51('0x4'))['db'];var logger=require(_0x8f51('0x5'))(_0x8f51('0x6'));var jayson=require(_0x8f51('0x7'));var amiClient=jayson[_0x8f51('0x8')][_0x8f51('0x9')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xfdb9bf,_0x3ab52b,_0x311093){return new BPromise(function(_0x1237f5,_0x282656){var _0x137c70=_0x311093?_0x311093:amiClient;return _0x137c70[_0x8f51('0xa')](_0xfdb9bf,_0x3ab52b)[_0x8f51('0xb')](function(_0x350da4){if(_0x350da4[_0x8f51('0xc')]){if(_0x350da4[_0x8f51('0xc')][_0x8f51('0xd')]===0x1f4){return _0x282656(_0x350da4['error'][_0x8f51('0xe')]);}return _0x1237f5(_0x350da4[_0x8f51('0xc')][_0x8f51('0xe')]);}else{_0x1237f5(_0x350da4['result']);}})['catch'](function(_0x33fdbb){_0x282656(_0x33fdbb);});});}function respondWithResult(_0x1e0091,_0x2f7f6d){_0x2f7f6d=_0x2f7f6d||0xc8;return function(_0xd236ad){if(_0xd236ad){return _0x1e0091[_0x8f51('0xf')](_0x2f7f6d)[_0x8f51('0x10')](_0xd236ad);}return _0x1e0091[_0x8f51('0x11')](0x194);};}function handleError(_0x48bc0d,_0x2efad4){_0x2efad4=_0x2efad4||0x1f4;return function(_0xc450ae){logger[_0x8f51('0xc')](_0xc450ae[_0x8f51('0x12')]);if(_0xc450ae[_0x8f51('0x13')]){delete _0xc450ae[_0x8f51('0x13')];}_0x48bc0d[_0x8f51('0xf')](_0x2efad4)[_0x8f51('0x14')](_0xc450ae);};}function findById(_0x35c8ba){return function(_0x426cfa){if(!_[_0x8f51('0x15')](_0x35c8ba)&&!_[_0x8f51('0x15')](_0x426cfa)&&!_[_0x8f51('0x15')](_0x426cfa[_0x8f51('0x16')])){return _[_0x8f51('0x17')](_0x426cfa[_0x8f51('0x16')],function(_0x349cb3){return _0x349cb3['id']==_0x35c8ba;});}return null;};}exports[_0x8f51('0x18')]=function(_0xb14abb,_0x3f4c94){return respondWithRpcPromise(_0x8f51('0x19'),_0xb14abb['query'])[_0x8f51('0xb')](respondWithResult(_0x3f4c94,null))[_0x8f51('0x1a')](handleError(_0x3f4c94,null));};exports[_0x8f51('0x1b')]=function(_0x51643a,_0x52c9d1){return respondWithRpcPromise(_0x8f51('0x1c'),_[_0x8f51('0x1d')](_0x51643a['query'],_0x51643a[_0x8f51('0x1e')]))['then'](respondWithResult(_0x52c9d1,null))['catch'](handleError(_0x52c9d1,null));};exports[_0x8f51('0x1f')]=function(_0x3a3ccf,_0x57b7e0){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x3a3ccf[_0x8f51('0x20')],_0x3a3ccf[_0x8f51('0x1e')]))[_0x8f51('0xb')](respondWithResult(_0x57b7e0,null))[_0x8f51('0x1a')](handleError(_0x57b7e0,null));};exports[_0x8f51('0x21')]=function(_0x1e3db6,_0x39437f){return respondWithRpcPromise('VoiceQueues',_0x1e3db6[_0x8f51('0x20')])[_0x8f51('0xb')](respondWithResult(_0x39437f,null))[_0x8f51('0x1a')](handleError(_0x39437f,null));};exports[_0x8f51('0x22')]=function(_0x38ed09,_0x2b94f3){return respondWithRpcPromise(_0x8f51('0x23'),_0x38ed09[_0x8f51('0x20')])['then'](findById(_0x38ed09[_0x8f51('0x1e')]['id']))[_0x8f51('0xb')](respondWithResult(_0x2b94f3,null))[_0x8f51('0x1a')](handleError(_0x2b94f3,null));};exports[_0x8f51('0x24')]=function(_0x28100b,_0x1ffdfc){return respondWithRpcPromise(_0x8f51('0x25'),_[_0x8f51('0x1d')](_0x28100b['query'],_0x28100b[_0x8f51('0x1e')]))['then'](respondWithResult(_0x1ffdfc,null))[_0x8f51('0x1a')](handleError(_0x1ffdfc,null));};exports[_0x8f51('0x26')]=function(_0xd7d4ab,_0x4ff4f1){return respondWithRpcPromise(_0x8f51('0x27'),_0xd7d4ab['query'])[_0x8f51('0xb')](respondWithResult(_0x4ff4f1,null))['catch'](handleError(_0x4ff4f1,null));};exports['voiceQueuesChannel']=function(_0x3b67a4,_0x2934bb){return respondWithRpcPromise(_0x8f51('0x28'),_['merge'](_0x3b67a4[_0x8f51('0x20')],_0x3b67a4[_0x8f51('0x1e')]))[_0x8f51('0xb')](respondWithResult(_0x2934bb,null))[_0x8f51('0x1a')](handleError(_0x2934bb,null));};exports[_0x8f51('0x29')]=function(_0x4179df,_0x45c31f){return respondWithRpcPromise(_0x8f51('0x2a'),_[_0x8f51('0x1d')](_0x4179df[_0x8f51('0x20')],_0x4179df[_0x8f51('0x1e')]))[_0x8f51('0xb')](respondWithResult(_0x45c31f,null))[_0x8f51('0x1a')](handleError(_0x45c31f,null));};exports[_0x8f51('0x2b')]=function(_0x4f0ee2,_0x4eec9e){return respondWithRpcPromise(_0x8f51('0x2c'),_[_0x8f51('0x1d')](_0x4f0ee2[_0x8f51('0x20')],_0x4f0ee2[_0x8f51('0x1e')]))[_0x8f51('0xb')](respondWithResult(_0x4eec9e,null))[_0x8f51('0x1a')](handleError(_0x4eec9e,null));};exports['outbound']=function(_0x11d5e4,_0x2fdd16){return respondWithRpcPromise(_0x8f51('0x2d'),_0x11d5e4['query'])['then'](respondWithResult(_0x2fdd16,null))[_0x8f51('0x1a')](handleError(_0x2fdd16,null));};exports[_0x8f51('0x2e')]=function(_0x3238d9,_0x69fa89){return respondWithRpcPromise('OutboundChannels',_0x3238d9[_0x8f51('0x20')])[_0x8f51('0xb')](respondWithResult(_0x69fa89,null))[_0x8f51('0x1a')](handleError(_0x69fa89,null));};exports[_0x8f51('0x2f')]=function(_0x524c77,_0x3ba8d0){var _0x16c61d;return respondWithRpcPromise('Agents',_0x524c77[_0x8f51('0x20')])[_0x8f51('0xb')](function(_0x1fec5f){_0x16c61d=_0x1fec5f;return respondWithRpcPromise(_0x8f51('0x30'),_0x524c77['query'],routingClient);})[_0x8f51('0xb')](function(_0x3c2832){return _[_0x8f51('0x1d')]({},_0x3c2832,_0x16c61d);})[_0x8f51('0xb')](respondWithResult(_0x3ba8d0,null))[_0x8f51('0x1a')](handleError(_0x3ba8d0,null));};exports[_0x8f51('0x31')]=function(_0x172bb3,_0x4cc455){if(_0x172bb3[_0x8f51('0x32')]&&_0x172bb3['body'][_0x8f51('0x33')]&&_0x172bb3['user']&&_0x172bb3[_0x8f51('0x34')]['name']){for(var _0x4d64b8 in _0x172bb3[_0x8f51('0x32')]['interaction']){if(_0x172bb3[_0x8f51('0x32')][_0x8f51('0x33')][_0x8f51('0x35')](_0x4d64b8)){db[_0x8f51('0x36')][_0x8f51('0x37')]({'where':{'channel':_0x4d64b8,'membername':_0x172bb3[_0x8f51('0x34')][_0x8f51('0x13')],'type':_0x8f51('0x38'),'exitAt':null,'uniqueid':_0x172bb3[_0x8f51('0x32')][_0x8f51('0x33')][_0x4d64b8]&&_0x172bb3[_0x8f51('0x32')][_0x8f51('0x33')][_0x4d64b8][_0x8f51('0x39')]?{'$notIn':_0x172bb3['body'][_0x8f51('0x33')][_0x4d64b8]}:{'$ne':null}}})[_0x8f51('0xb')](function(_0x3deaf5){var _0x27c699=moment()['format'](_0x8f51('0x3a'));for(var _0x3a2ee8=0x0,_0x384247=_0x3deaf5[_0x8f51('0x39')];_0x3a2ee8<_0x384247;_0x3a2ee8+=0x1){_0x3deaf5[_0x3a2ee8]['updateAttributes']({'exitAt':_0x27c699});}});for(var _0xa473ff=0x0;_0xa473ff<_0x172bb3['body'][_0x8f51('0x33')][_0x4d64b8][_0x8f51('0x39')];_0xa473ff+=0x1){db[_0x8f51('0x36')]['findOrCreate']({'where':{'channel':_0x4d64b8,'membername':_0x172bb3[_0x8f51('0x34')][_0x8f51('0x13')],'type':_0x8f51('0x38'),'uniqueid':_0x172bb3[_0x8f51('0x32')][_0x8f51('0x33')][_0x4d64b8][_0xa473ff],'exitAt':null},'defaults':{'channel':_0x4d64b8,'membername':_0x172bb3[_0x8f51('0x34')][_0x8f51('0x13')],'interface':_[_0x8f51('0x15')](_0x172bb3['user'][_0x8f51('0x3b')])?util[_0x8f51('0x3c')](_0x8f51('0x3d'),_0x172bb3['user'][_0x8f51('0x13')]):_0x172bb3[_0x8f51('0x34')]['interface'],'type':_0x8f51('0x38'),'enterAt':moment()[_0x8f51('0x3c')](_0x8f51('0x3a')),'role':_0x8f51('0x3e'),'internal':_0x172bb3[_0x8f51('0x34')][_0x8f51('0x3f')],'uniqueid':_0x172bb3['body'][_0x8f51('0x33')][_0x4d64b8][_0xa473ff]}});}}}}return respondWithRpcPromise(_0x8f51('0x40'),{'id':_0x172bb3[_0x8f51('0x1e')]['id'],'capacity':_0x172bb3[_0x8f51('0x32')][_0x8f51('0x41')]},routingClient)['then'](respondWithResult(_0x4cc455,null))[_0x8f51('0x1a')](handleError(_0x4cc455,null));};exports[_0x8f51('0x42')]=function(_0x3c7239,_0xf04d72){return respondWithRpcPromise(_0x8f51('0x43'),_0x3c7239['query'])['then'](respondWithResult(_0xf04d72,null))[_0x8f51('0x1a')](handleError(_0xf04d72,null));};exports[_0x8f51('0x44')]=function(_0x219c7d,_0x59ccc7){return respondWithRpcPromise(_0x8f51('0x45'),_0x219c7d[_0x8f51('0x20')])[_0x8f51('0xb')](respondWithResult(_0x59ccc7,null))[_0x8f51('0x1a')](handleError(_0x59ccc7,null));};exports[_0x8f51('0x46')]=function(_0x269726,_0x2c1249){return respondWithRpcPromise(_0x8f51('0x47'),_0x269726[_0x8f51('0x20')])[_0x8f51('0xb')](respondWithResult(_0x2c1249,null))[_0x8f51('0x1a')](handleError(_0x2c1249,null));};exports[_0x8f51('0x48')]=function(_0x13f2a5,_0x10ba05){return respondWithRpcPromise(_0x8f51('0x49'),_0x13f2a5[_0x8f51('0x20')],routingClient)[_0x8f51('0xb')](respondWithResult(_0x10ba05,null))[_0x8f51('0x1a')](handleError(_0x10ba05,null));};exports[_0x8f51('0x4a')]=function(_0xb9baad,_0x244556){return respondWithRpcPromise(_0x8f51('0x49'),_0xb9baad[_0x8f51('0x20')],routingClient)['then'](findById(_0xb9baad[_0x8f51('0x1e')]['id']))[_0x8f51('0xb')](respondWithResult(_0x244556,null))[_0x8f51('0x1a')](handleError(_0x244556,null));};exports['mailQueues']=function(_0x34936a,_0x3597c8){return respondWithRpcPromise('MailQueues',_0x34936a[_0x8f51('0x20')],routingClient)['then'](respondWithResult(_0x3597c8,null))[_0x8f51('0x1a')](handleError(_0x3597c8,null));};exports['showMailQueues']=function(_0x4d15e7,_0x50720c){return respondWithRpcPromise(_0x8f51('0x4b'),_0x4d15e7[_0x8f51('0x20')],routingClient)[_0x8f51('0xb')](findById(_0x4d15e7[_0x8f51('0x1e')]['id']))[_0x8f51('0xb')](respondWithResult(_0x50720c,null))[_0x8f51('0x1a')](handleError(_0x50720c,null));};exports[_0x8f51('0x4c')]=function(_0xc32208,_0x3efe9f){return respondWithRpcPromise(_0x8f51('0x4d'),_0xc32208[_0x8f51('0x20')],mailClient)[_0x8f51('0xb')](respondWithResult(_0x3efe9f,null))[_0x8f51('0x1a')](handleError(_0x3efe9f,null));};exports['openchannelQueues']=function(_0x4c5ee2,_0x2aaeb0){return respondWithRpcPromise(_0x8f51('0x4e'),_0x4c5ee2['query'],routingClient)[_0x8f51('0xb')](respondWithResult(_0x2aaeb0,null))[_0x8f51('0x1a')](handleError(_0x2aaeb0,null));};exports['showOpenchannelQueues']=function(_0x44680b,_0x767776){return respondWithRpcPromise('OpenchannelQueues',_0x44680b[_0x8f51('0x20')],routingClient)[_0x8f51('0xb')](findById(_0x44680b[_0x8f51('0x1e')]['id']))['then'](respondWithResult(_0x767776,null))['catch'](handleError(_0x767776,null));};exports[_0x8f51('0x4f')]=function(_0x34ff4c,_0x273f9b){return respondWithRpcPromise(_0x8f51('0x50'),_0x34ff4c[_0x8f51('0x20')],routingClient)['then'](respondWithResult(_0x273f9b,null))[_0x8f51('0x1a')](handleError(_0x273f9b,null));};exports[_0x8f51('0x51')]=function(_0x2f179d,_0x18c56){return respondWithRpcPromise(_0x8f51('0x50'),_0x2f179d[_0x8f51('0x20')],routingClient)['then'](findById(_0x2f179d['params']['id']))['then'](respondWithResult(_0x18c56,null))[_0x8f51('0x1a')](handleError(_0x18c56,null));};exports[_0x8f51('0x52')]=function(_0x29fd22,_0x3be8cd){return respondWithRpcPromise('FaxQueues',_0x29fd22['query'],routingClient)[_0x8f51('0xb')](respondWithResult(_0x3be8cd,null))['catch'](handleError(_0x3be8cd,null));};exports[_0x8f51('0x53')]=function(_0x316c36,_0x3de998){return respondWithRpcPromise('FaxQueues',_0x316c36[_0x8f51('0x20')],routingClient)[_0x8f51('0xb')](findById(_0x316c36[_0x8f51('0x1e')]['id']))[_0x8f51('0xb')](respondWithResult(_0x3de998,null))[_0x8f51('0x1a')](handleError(_0x3de998,null));};exports[_0x8f51('0x54')]=function(_0x230697,_0x24f14d){return respondWithRpcPromise(_0x8f51('0x55'),_0x230697[_0x8f51('0x20')])['then'](respondWithResult(_0x24f14d,null))[_0x8f51('0x1a')](handleError(_0x24f14d,null));};exports['chatQueuesWaitingInteractions']=function(_0x49828b,_0x2bdba2){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x49828b[_0x8f51('0x20')],routingClient)[_0x8f51('0xb')](respondWithResult(_0x2bdba2,null))['catch'](handleError(_0x2bdba2,null));};exports[_0x8f51('0x56')]=function(_0x24a9d5,_0x129880){return respondWithRpcPromise(_0x8f51('0x57'),_0x24a9d5[_0x8f51('0x20')],routingClient)[_0x8f51('0xb')](respondWithResult(_0x129880,null))[_0x8f51('0x1a')](handleError(_0x129880,null));};exports[_0x8f51('0x58')]=function(_0x5ed6ef,_0x291018){return respondWithRpcPromise(_0x8f51('0x59'),_0x5ed6ef['query'],routingClient)['then'](respondWithResult(_0x291018,null))[_0x8f51('0x1a')](handleError(_0x291018,null));};exports[_0x8f51('0x5a')]=function(_0x3e3824,_0x39a584){return respondWithRpcPromise(_0x8f51('0x5b'),_0x3e3824[_0x8f51('0x20')],routingClient)[_0x8f51('0xb')](respondWithResult(_0x39a584,null))[_0x8f51('0x1a')](handleError(_0x39a584,null));};exports[_0x8f51('0x5c')]=function(_0x253a8f,_0x34b17e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x253a8f[_0x8f51('0x20')],routingClient)['then'](respondWithResult(_0x34b17e,null))[_0x8f51('0x1a')](handleError(_0x34b17e,null));};exports[_0x8f51('0x5d')]=function(_0x58230f){return function(_0x3fe750,_0x375572){var _0x3ae6c5,_0x3261ff;var _0x336d4e=_[_0x8f51('0x5e')](_0x58230f);var _0x17801a=_0x58230f===_0x8f51('0x5f')?_0x8f51('0x60'):_0x8f51('0x61');return db[_0x336d4e+'Queue']['findOne']({'raw':!![],'where':{'id':_0x3fe750[_0x8f51('0x1e')]['id']}})[_0x8f51('0xb')](function(_0xcdd594){if(_['isNil'](_0xcdd594)){throw new Error(_0x336d4e+_0x8f51('0x62'));}_0x3ae6c5=_0xcdd594;return db[_0x336d4e+_0x8f51('0x63')][_0x8f51('0x64')]({'where':{'id':_0x3fe750[_0x8f51('0x32')]['messageId']},'include':[{'model':db[_0x336d4e+_0x8f51('0x65')],'as':'Interaction'},{'model':db[_0x336d4e+_0x17801a],'as':'Account'}]});})['then'](function(_0x441fc5){if(_[_0x8f51('0x15')](_0x441fc5)){throw new Error(_0x336d4e+_0x8f51('0x66'));}_0x3261ff=_0x441fc5;return _0x441fc5[_0x8f51('0x67')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3a5739={'uniqueid':_0x58230f+'.'+_0x3261ff['id']+'.'+_0x3261ff['Interaction']['id'],'FromUserId':_0x3fe750['user']['id'],'type':_0x8f51('0x68')};_0x3a5739[_0x336d4e+_0x8f51('0x69')]=_0x3261ff['id'];_0x3a5739[_0x336d4e+_0x8f51('0x6a')]=_0x3261ff[_0x8f51('0x65')]['id'];_0x3a5739[_0x8f51('0x6b')+_0x336d4e+_0x17801a+'Id']=_0x3261ff[_0x8f51('0x61')]['id'];_0x3a5739['To'+_0x336d4e+_0x8f51('0x6c')]=_0x3ae6c5['id'];return db[_0x336d4e+_0x8f51('0x6d')]['create'](_0x3a5739);})['then'](function(){return respondWithRpcPromise(_0x8f51('0x6e'),{'channel':_0x58230f,'interaction':_0x3261ff[_0x8f51('0x65')],'message':_0x3261ff,'account':_0x3261ff['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x8f51('0x68'),'appdata':_0x3ae6c5[_0x8f51('0x13')]+','+(_0x3261ff[_0x8f51('0x61')][_0x8f51('0x6f')]||0x12c),'interval':_0x8f51('0x70')}]},routingClient);})['then'](respondWithResult(_0x375572,null))[_0x8f51('0x1a')](handleError(_0x375572,null));};};exports['agentNotify']=function(_0x41e627,_0x51da98){var _0x4171e0,_0x14b86f;if(_[_0x8f51('0x15')](_0x41e627[_0x8f51('0x32')][_0x8f51('0x71')])){throw new Error(_0x8f51('0x72'));}var _0x5e6844=_0x41e627[_0x8f51('0x32')][_0x8f51('0x71')];var _0x3fe017=_['capitalize'](_0x5e6844);var _0x298299=_0x5e6844===_0x8f51('0x5f')?_0x8f51('0x60'):'Account';return db[_0x8f51('0x73')][_0x8f51('0x64')]({'raw':!![],'where':{'id':_0x41e627[_0x8f51('0x1e')]['id'],'role':_0x8f51('0x3e')}})['then'](function(_0x988967){if(_[_0x8f51('0x15')](_0x988967)){throw new Error(_0x8f51('0x74'));}_0x4171e0=_0x988967;return db[_0x3fe017+_0x8f51('0x63')][_0x8f51('0x64')]({'where':{'id':_0x41e627[_0x8f51('0x32')]['messageId']},'include':[{'model':db[_0x3fe017+_0x8f51('0x65')],'as':_0x8f51('0x65')},{'model':db[_0x3fe017+_0x298299],'as':_0x8f51('0x61')}]});})['then'](function(_0x49b80f){if(_['isNil'](_0x49b80f)){throw new Error(_0x3fe017+_0x8f51('0x66'));}_0x14b86f=_0x49b80f;return _0x49b80f[_0x8f51('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8f51('0xb')](function(){var _0x342154={'uniqueid':_0x5e6844+'.'+_0x14b86f['id']+'.'+_0x14b86f[_0x8f51('0x65')]['id'],'FromUserId':_0x41e627[_0x8f51('0x34')]['id'],'type':_0x8f51('0x68'),'ToUserId':_0x4171e0['id']};_0x342154[_0x3fe017+'MessageId']=_0x14b86f['id'];_0x342154[_0x3fe017+'InteractionId']=_0x14b86f[_0x8f51('0x65')]['id'];_0x342154['From'+_0x3fe017+_0x298299+'Id']=_0x14b86f[_0x8f51('0x61')]['id'];return db[_0x3fe017+_0x8f51('0x6d')][_0x8f51('0x75')](_0x342154);})[_0x8f51('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x5e6844,'interaction':_0x14b86f[_0x8f51('0x65')],'message':_0x14b86f,'account':_0x14b86f[_0x8f51('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8f51('0x3e'),'appdata':_0x4171e0['name']+','+(_0x14b86f['Account'][_0x8f51('0x76')]||0x12c),'interval':_0x8f51('0x70')}]},routingClient);})['then'](respondWithResult(_0x51da98,null))[_0x8f51('0x1a')](handleError(_0x51da98,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 22962ed..7857242 100644 --- a/server/api/schedule/index.js +++ b/server/api/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff8c=['../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','run','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x48c7a5,_0x50d468){var _0x17106a=function(_0x103376){while(--_0x103376){_0x48c7a5['push'](_0x48c7a5['shift']());}};_0x17106a(++_0x50d468);}(_0xff8c,0x162));var _0xcff8=function(_0x279522,_0x497270){_0x279522=_0x279522-0x0;var _0xc6071d=_0xff8c[_0x279522];return _0xc6071d;};'use strict';var multer=require(_0xcff8('0x0'));var util=require(_0xcff8('0x1'));var path=require(_0xcff8('0x2'));var timeout=require(_0xcff8('0x3'));var express=require(_0xcff8('0x4'));var router=express[_0xcff8('0x5')]();var auth=require(_0xcff8('0x6'));var interaction=require(_0xcff8('0x7'));var config=require(_0xcff8('0x8'));var controller=require(_0xcff8('0x9'));router[_0xcff8('0xa')]('/',auth[_0xcff8('0xb')](),controller[_0xcff8('0xc')]);router[_0xcff8('0xa')](_0xcff8('0xd'),auth[_0xcff8('0xb')](),controller['show']);router['get']('/:id/run',auth[_0xcff8('0xb')](),controller[_0xcff8('0xe')]);router[_0xcff8('0xf')]('/',auth[_0xcff8('0xb')](),controller[_0xcff8('0x10')]);router['put']('/:id',auth[_0xcff8('0xb')](),controller['update']);router[_0xcff8('0x11')](_0xcff8('0xd'),auth[_0xcff8('0xb')](),controller['destroy']);module[_0xcff8('0x12')]=router; \ No newline at end of file +var _0x6beb=['/:id','isAuthenticated','/:id/run','run','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','get'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0x6beb,0x199));var _0xb6be=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6beb[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xb6be('0x0'));var util=require('util');var path=require(_0xb6be('0x1'));var timeout=require(_0xb6be('0x2'));var express=require(_0xb6be('0x3'));var router=express[_0xb6be('0x4')]();var auth=require(_0xb6be('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb6be('0x6'));var controller=require(_0xb6be('0x7'));router[_0xb6be('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb6be('0x9'),auth[_0xb6be('0xa')](),controller['show']);router[_0xb6be('0x8')](_0xb6be('0xb'),auth[_0xb6be('0xa')](),controller[_0xb6be('0xc')]);router[_0xb6be('0xd')]('/',auth['isAuthenticated'](),controller[_0xb6be('0xe')]);router[_0xb6be('0xf')](_0xb6be('0x9'),auth[_0xb6be('0xa')](),controller['update']);router[_0xb6be('0x10')](_0xb6be('0x9'),auth['isAuthenticated'](),controller[_0xb6be('0x11')]);module[_0xb6be('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index adec5d4..2696f8d 100644 --- a/server/api/schedule/schedule.attributes.js +++ b/server/api/schedule/schedule.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8af=['pdf','xlsx','custom','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER','ENUM','months','days','hours','minutes','csv'];(function(_0x4ce40c,_0x3400d3){var _0x3cb443=function(_0x495683){while(--_0x495683){_0x4ce40c['push'](_0x4ce40c['shift']());}};_0x3cb443(++_0x3400d3);}(_0xf8af,0x8b));var _0xff8a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf8af[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xff8a('0x0'));module['exports']={'name':{'type':Sequelize[_0xff8a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xff8a('0x1')]},'active':{'type':Sequelize[_0xff8a('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xff8a('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xff8a('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xff8a('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xff8a('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xff8a('0x5')]('years','quarters',_0xff8a('0x6'),'weeks',_0xff8a('0x7'),_0xff8a('0x8'),_0xff8a('0x9')),'allowNull':![],'defaultValue':_0xff8a('0x7')},'output':{'type':Sequelize[_0xff8a('0x5')](_0xff8a('0xa'),_0xff8a('0xb'),_0xff8a('0xc')),'allowNull':![],'defaultValue':_0xff8a('0xa')},'type':{'type':Sequelize[_0xff8a('0x5')](_0xff8a('0xd'),'default'),'allowNull':![],'defaultValue':_0xff8a('0xd')},'sendMail':{'type':Sequelize[_0xff8a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xff8a('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xff8a('0xe')]},'sendIfEmpty':{'type':Sequelize[_0xff8a('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdb70=['sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours','minutes','days','csv','pdf','default','custom','TEXT'];(function(_0x22ae47,_0x488df2){var _0x1b908b=function(_0x5c336f){while(--_0x5c336f){_0x22ae47['push'](_0x22ae47['shift']());}};_0x1b908b(++_0x488df2);}(_0xdb70,0xa0));var _0x0db7=function(_0x5d96ee,_0x523278){_0x5d96ee=_0x5d96ee-0x0;var _0x39092b=_0xdb70[_0x5d96ee];return _0x39092b;};'use strict';var Sequelize=require(_0x0db7('0x0'));module[_0x0db7('0x1')]={'name':{'type':Sequelize[_0x0db7('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0db7('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0db7('0x2')],'allowNull':![],'defaultValue':_0x0db7('0x4')},'startAt':{'type':Sequelize[_0x0db7('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x0db7('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0db7('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0db7('0x7')](_0x0db7('0x8'),_0x0db7('0x9'),_0x0db7('0xa'),_0x0db7('0xb'),'days',_0x0db7('0xc'),_0x0db7('0xd')),'allowNull':![],'defaultValue':_0x0db7('0xe')},'output':{'type':Sequelize[_0x0db7('0x7')](_0x0db7('0xf'),_0x0db7('0x10'),'xlsx'),'allowNull':![],'defaultValue':_0x0db7('0xf')},'type':{'type':Sequelize[_0x0db7('0x7')]('custom',_0x0db7('0x11')),'allowNull':![],'defaultValue':_0x0db7('0x12')},'sendMail':{'type':Sequelize[_0x0db7('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x0db7('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x0db7('0x13')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index e464000..61c4e51 100644 --- a/server/api/schedule/schedule.controller.js +++ b/server/api/schedule/schedule.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f84=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','body','run','../../config/schedule','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create'];(function(_0x1afbc8,_0x195d4b){var _0x41635f=function(_0x2d19eb){while(--_0x2d19eb){_0x1afbc8['push'](_0x1afbc8['shift']());}};_0x41635f(++_0x195d4b);}(_0x7f84,0x1b4));var _0x47f8=function(_0x24b33c,_0x33cb97){_0x24b33c=_0x24b33c-0x0;var _0x33becf=_0x7f84[_0x24b33c];return _0x33becf;};'use strict';var pdf=require(_0x47f8('0x0'));var emlformat=require(_0x47f8('0x1'));var rimraf=require(_0x47f8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47f8('0x3'));var rp=require(_0x47f8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47f8('0x5'));var path=require(_0x47f8('0x6'));var sox=require(_0x47f8('0x7'));var csv=require(_0x47f8('0x8'));var ejs=require(_0x47f8('0x9'));var fs=require('fs');var _=require(_0x47f8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x47f8('0xb'));var deskjs=require(_0x47f8('0xc'));var toCsv=require(_0x47f8('0x8'));var querystring=require(_0x47f8('0xd'));var Papa=require(_0x47f8('0xe'));var Redis=require('ioredis');var authService=require(_0x47f8('0xf'));var qs=require(_0x47f8('0x10'));var as=require(_0x47f8('0x11'));var hardwareService=require(_0x47f8('0x12'));var logger=require(_0x47f8('0x13'))(_0x47f8('0x14'));var utils=require(_0x47f8('0x15'));var config=require('../../config/environment');var db=require(_0x47f8('0x16'))['db'];function respondWithStatusCode(_0xe03441,_0x3c6737){_0x3c6737=_0x3c6737||0xcc;return function(_0x17a206){if(_0x17a206){return _0xe03441[_0x47f8('0x17')](_0x3c6737);}return _0xe03441[_0x47f8('0x18')](_0x3c6737)[_0x47f8('0x19')]();};}function respondWithResult(_0xfb5b59,_0x172f24){_0x172f24=_0x172f24||0xc8;return function(_0xa72005){if(_0xa72005){return _0xfb5b59[_0x47f8('0x18')](_0x172f24)[_0x47f8('0x1a')](_0xa72005);}};}function respondWithFilteredResult(_0x13475f,_0x4fad0c){return function(_0x374d2f){if(_0x374d2f){var _0x1744f0=_0x374d2f[_0x47f8('0x1b')],_0x2b5a7d=_0x4fad0c[_0x47f8('0x1c')],_0x1538d7=_0x4fad0c[_0x47f8('0x1c')]+_0x4fad0c[_0x47f8('0x1d')],_0x1fe84a;if(_0x1538d7>=_0x1744f0){_0x1538d7=_0x1744f0;_0x1fe84a=0xc8;}else{_0x1fe84a=0xce;}_0x13475f['status'](_0x1fe84a);return _0x13475f[_0x47f8('0x1e')](_0x47f8('0x1f'),_0x2b5a7d+'-'+_0x1538d7+'/'+_0x1744f0)[_0x47f8('0x1a')](_0x374d2f);}return null;};}function patchUpdates(_0x3a1d94){return function(_0x186973){try{jsonpatch[_0x47f8('0x20')](_0x186973,_0x3a1d94,!![]);}catch(_0x349367){return BPromise[_0x47f8('0x21')](_0x349367);}return _0x186973[_0x47f8('0x22')]();};}function saveUpdates(_0x86ab4f,_0x4274ff){return function(_0xdb792d){if(_0xdb792d){return _0xdb792d[_0x47f8('0x23')](_0x86ab4f)[_0x47f8('0x24')](function(_0x8c3fe){return _0x8c3fe;});}return null;};}function removeEntity(_0x29bd11,_0x4d4406){return function(_0x5146d9){if(_0x5146d9){return _0x5146d9[_0x47f8('0x25')]()['then'](function(){var _0x5da67f=_0x5146d9['get']({'plain':!![]});var _0xa97996=_0x47f8('0x26');return db[_0x47f8('0x27')][_0x47f8('0x25')]({'where':{'type':_0xa97996,'resourceId':_0x5da67f['id']}})[_0x47f8('0x24')](function(){return _0x5146d9;});})[_0x47f8('0x24')](function(){_0x29bd11[_0x47f8('0x18')](0xcc)[_0x47f8('0x19')]();});}};}function handleEntityNotFound(_0x53de00,_0xf7c814){return function(_0xb85947){if(!_0xb85947){_0x53de00['sendStatus'](0x194);}return _0xb85947;};}function handleError(_0xa2fd9,_0x21a512){_0x21a512=_0x21a512||0x1f4;return function(_0x3a5d17){logger[_0x47f8('0x28')](_0x3a5d17[_0x47f8('0x29')]);if(_0x3a5d17[_0x47f8('0x2a')]){delete _0x3a5d17[_0x47f8('0x2a')];}_0xa2fd9[_0x47f8('0x18')](_0x21a512)[_0x47f8('0x2b')](_0x3a5d17);};}exports['index']=function(_0x35243b,_0x192aaa){var _0x26dc3d={},_0x3e9ea0={},_0x7a8316={'count':0x0,'rows':[]};var _0x1074e6=_[_0x47f8('0x2c')](db[_0x47f8('0x2d')][_0x47f8('0x2e')],function(_0x232008){return{'name':_0x232008[_0x47f8('0x2f')],'type':_0x232008[_0x47f8('0x30')][_0x47f8('0x31')]};});_0x3e9ea0[_0x47f8('0x32')]=_[_0x47f8('0x2c')](_0x1074e6,_0x47f8('0x2a'));_0x3e9ea0[_0x47f8('0x33')]=_['keys'](_0x35243b[_0x47f8('0x33')]);_0x3e9ea0['filters']=_[_0x47f8('0x34')](_0x3e9ea0[_0x47f8('0x32')],_0x3e9ea0['query']);_0x26dc3d[_0x47f8('0x35')]=_[_0x47f8('0x34')](_0x3e9ea0[_0x47f8('0x32')],qs[_0x47f8('0x36')](_0x35243b['query'][_0x47f8('0x36')]));_0x26dc3d[_0x47f8('0x35')]=_0x26dc3d[_0x47f8('0x35')][_0x47f8('0x37')]?_0x26dc3d[_0x47f8('0x35')]:_0x3e9ea0[_0x47f8('0x32')];if(!_0x35243b[_0x47f8('0x33')][_0x47f8('0x38')]('nolimit')){_0x26dc3d['limit']=qs['limit'](_0x35243b['query'][_0x47f8('0x1d')]);_0x26dc3d[_0x47f8('0x1c')]=qs['offset'](_0x35243b['query']['offset']);}_0x26dc3d[_0x47f8('0x39')]=qs[_0x47f8('0x3a')](_0x35243b[_0x47f8('0x33')]['sort']);_0x26dc3d['where']=qs['filters'](_['pick'](_0x35243b['query'],_0x3e9ea0[_0x47f8('0x3b')]));if(_0x35243b[_0x47f8('0x33')][_0x47f8('0x3c')]){_0x26dc3d[_0x47f8('0x3d')]=_[_0x47f8('0x3e')](_0x26dc3d['where'],{'$or':_[_0x47f8('0x2c')](_0x1074e6,function(_0x23334c){if(_0x23334c[_0x47f8('0x30')]!==_0x47f8('0x3f')){var _0x2bee79={};_0x2bee79[_0x23334c[_0x47f8('0x2a')]]={'$like':'%'+_0x35243b[_0x47f8('0x33')][_0x47f8('0x3c')]+'%'};return _0x2bee79;}})});}_0x26dc3d=_['merge']({},_0x26dc3d,_0x35243b[_0x47f8('0x40')]);var _0x320067={'where':_0x26dc3d[_0x47f8('0x3d')]};return db[_0x47f8('0x2d')][_0x47f8('0x1b')](_0x320067)[_0x47f8('0x24')](function(_0x281408){_0x7a8316['count']=_0x281408;if(_0x35243b[_0x47f8('0x33')][_0x47f8('0x41')]){_0x26dc3d[_0x47f8('0x42')]=[{'all':!![]}];}return db['Schedule'][_0x47f8('0x43')](_0x26dc3d);})[_0x47f8('0x24')](function(_0x35046f){_0x7a8316[_0x47f8('0x44')]=_0x35046f;return _0x7a8316;})[_0x47f8('0x24')](respondWithFilteredResult(_0x192aaa,_0x26dc3d))[_0x47f8('0x45')](handleError(_0x192aaa,null));};exports[_0x47f8('0x46')]=function(_0xf2daf5,_0x111e6d){var _0x3cc53f={'raw':![],'where':{'id':_0xf2daf5[_0x47f8('0x47')]['id']}},_0x20d501={};_0x20d501[_0x47f8('0x32')]=_[_0x47f8('0x48')](db['Schedule'][_0x47f8('0x2e')]);_0x20d501['query']=_['keys'](_0xf2daf5[_0x47f8('0x33')]);_0x20d501['filters']=_[_0x47f8('0x34')](_0x20d501['model'],_0x20d501['query']);_0x3cc53f[_0x47f8('0x35')]=_[_0x47f8('0x34')](_0x20d501[_0x47f8('0x32')],qs[_0x47f8('0x36')](_0xf2daf5['query'][_0x47f8('0x36')]));_0x3cc53f[_0x47f8('0x35')]=_0x3cc53f['attributes'][_0x47f8('0x37')]?_0x3cc53f[_0x47f8('0x35')]:_0x20d501[_0x47f8('0x32')];if(_0xf2daf5[_0x47f8('0x33')][_0x47f8('0x41')]){_0x3cc53f['include']=[{'all':!![]}];}_0x3cc53f=_[_0x47f8('0x3e')]({},_0x3cc53f,_0xf2daf5[_0x47f8('0x40')]);return db[_0x47f8('0x2d')]['find'](_0x3cc53f)[_0x47f8('0x24')](handleEntityNotFound(_0x111e6d,null))[_0x47f8('0x24')](respondWithResult(_0x111e6d,null))[_0x47f8('0x45')](handleError(_0x111e6d,null));};exports['create']=function(_0x114348,_0x4d28d8){return db[_0x47f8('0x2d')][_0x47f8('0x49')](_0x114348['body'],{})['then'](function(_0x11faaf){var _0x3e4a25=_0x114348[_0x47f8('0x4a')][_0x47f8('0x4b')]({'plain':!![]});if(!_0x3e4a25)throw new Error(_0x47f8('0x4c'));if(_0x3e4a25[_0x47f8('0x4d')]==='user'){var _0x23c495=_0x11faaf[_0x47f8('0x4b')]({'plain':!![]});var _0xeae1c6=_0x47f8('0x26');return db[_0x47f8('0x4e')][_0x47f8('0x4f')]({'where':{'name':_0xeae1c6,'userProfileId':_0x3e4a25[_0x47f8('0x50')]},'raw':!![]})[_0x47f8('0x24')](function(_0xba2e78){if(_0xba2e78&&_0xba2e78[_0x47f8('0x51')]===0x0){return db[_0x47f8('0x27')][_0x47f8('0x49')]({'name':_0x23c495['name'],'resourceId':_0x23c495['id'],'type':_0xba2e78[_0x47f8('0x2a')],'sectionId':_0xba2e78['id']},{})[_0x47f8('0x24')](function(){return _0x11faaf;});}else{return _0x11faaf;}})[_0x47f8('0x45')](function(_0x3e5c82){logger[_0x47f8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e5c82);throw _0x3e5c82;});}return _0x11faaf;})[_0x47f8('0x24')](respondWithResult(_0x4d28d8,0xc9))[_0x47f8('0x45')](handleError(_0x4d28d8,null));};exports[_0x47f8('0x23')]=function(_0x222af4,_0x8af0dc){if(_0x222af4[_0x47f8('0x52')]['id']){delete _0x222af4['body']['id'];}return db['Schedule'][_0x47f8('0x4f')]({'where':{'id':_0x222af4[_0x47f8('0x47')]['id']}})[_0x47f8('0x24')](handleEntityNotFound(_0x8af0dc,null))[_0x47f8('0x24')](saveUpdates(_0x222af4[_0x47f8('0x52')],null))[_0x47f8('0x24')](respondWithResult(_0x8af0dc,null))[_0x47f8('0x45')](handleError(_0x8af0dc,null));};exports['destroy']=function(_0x466758,_0x1f8dba){return db[_0x47f8('0x2d')]['find']({'where':{'id':_0x466758[_0x47f8('0x47')]['id']}})[_0x47f8('0x24')](handleEntityNotFound(_0x1f8dba,null))['then'](removeEntity(_0x1f8dba,null))[_0x47f8('0x45')](handleError(_0x1f8dba,null));};exports[_0x47f8('0x53')]=function(_0x2d8c17,_0x5282ae,_0x437dba){var _0x312cc5=require(_0x47f8('0x54'));return db['Schedule']['find']({'where':{'id':_0x2d8c17[_0x47f8('0x47')]['id']},'raw':!![]})[_0x47f8('0x24')](handleEntityNotFound(_0x5282ae,null))['then'](function(){_0x312cc5[_0x47f8('0x53')](_0x2d8c17['params']['id']);})[_0x47f8('0x24')](respondWithStatusCode(_0x5282ae,null))['catch'](handleError(_0x5282ae,null));}; \ No newline at end of file +var _0xef31=['mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','apply','save','update','then','destroy','get','Scheduler','error','stack','name','send','index','map','Schedule','rawAttributes','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef31,0xa3));var _0x1ef3=function(_0x140faa,_0x2a4114){_0x140faa=_0x140faa-0x0;var _0x228f97=_0xef31[_0x140faa];return _0x228f97;};'use strict';var pdf=require(_0x1ef3('0x0'));var emlformat=require(_0x1ef3('0x1'));var rimraf=require(_0x1ef3('0x2'));var zipdir=require(_0x1ef3('0x3'));var jsonpatch=require(_0x1ef3('0x4'));var rp=require('request-promise');var moment=require(_0x1ef3('0x5'));var BPromise=require(_0x1ef3('0x6'));var Mustache=require(_0x1ef3('0x7'));var util=require(_0x1ef3('0x8'));var path=require(_0x1ef3('0x9'));var sox=require(_0x1ef3('0xa'));var csv=require(_0x1ef3('0xb'));var ejs=require(_0x1ef3('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ef3('0xd'));var jsforce=require(_0x1ef3('0xe'));var deskjs=require(_0x1ef3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1ef3('0x10'));var Papa=require(_0x1ef3('0x11'));var Redis=require(_0x1ef3('0x12'));var authService=require(_0x1ef3('0x13'));var qs=require(_0x1ef3('0x14'));var as=require(_0x1ef3('0x15'));var hardwareService=require(_0x1ef3('0x16'));var logger=require(_0x1ef3('0x17'))(_0x1ef3('0x18'));var utils=require(_0x1ef3('0x19'));var config=require(_0x1ef3('0x1a'));var db=require(_0x1ef3('0x1b'))['db'];function respondWithStatusCode(_0x5cc2ae,_0x23cc31){_0x23cc31=_0x23cc31||0xcc;return function(_0x3fc670){if(_0x3fc670){return _0x5cc2ae[_0x1ef3('0x1c')](_0x23cc31);}return _0x5cc2ae[_0x1ef3('0x1d')](_0x23cc31)[_0x1ef3('0x1e')]();};}function respondWithResult(_0x304b11,_0x654194){_0x654194=_0x654194||0xc8;return function(_0x241946){if(_0x241946){return _0x304b11[_0x1ef3('0x1d')](_0x654194)['json'](_0x241946);}};}function respondWithFilteredResult(_0x5f0074,_0xc325ce){return function(_0x2f49db){if(_0x2f49db){var _0x44de0d=_0x2f49db[_0x1ef3('0x1f')],_0x262931=_0xc325ce[_0x1ef3('0x20')],_0x5b3624=_0xc325ce[_0x1ef3('0x20')]+_0xc325ce['limit'],_0x368455;if(_0x5b3624>=_0x44de0d){_0x5b3624=_0x44de0d;_0x368455=0xc8;}else{_0x368455=0xce;}_0x5f0074[_0x1ef3('0x1d')](_0x368455);return _0x5f0074[_0x1ef3('0x21')]('Content-Range',_0x262931+'-'+_0x5b3624+'/'+_0x44de0d)['json'](_0x2f49db);}return null;};}function patchUpdates(_0xac750d){return function(_0xe62243){try{jsonpatch[_0x1ef3('0x22')](_0xe62243,_0xac750d,!![]);}catch(_0xb527b1){return BPromise['reject'](_0xb527b1);}return _0xe62243[_0x1ef3('0x23')]();};}function saveUpdates(_0x1a12e6,_0x120bdf){return function(_0xdc22e6){if(_0xdc22e6){return _0xdc22e6[_0x1ef3('0x24')](_0x1a12e6)[_0x1ef3('0x25')](function(_0x4e3266){return _0x4e3266;});}return null;};}function removeEntity(_0x3cbbc1,_0x469ec6){return function(_0x54cc53){if(_0x54cc53){return _0x54cc53[_0x1ef3('0x26')]()[_0x1ef3('0x25')](function(){var _0x141b1a=_0x54cc53[_0x1ef3('0x27')]({'plain':!![]});var _0x5a1f07=_0x1ef3('0x28');return db['UserProfileResource'][_0x1ef3('0x26')]({'where':{'type':_0x5a1f07,'resourceId':_0x141b1a['id']}})[_0x1ef3('0x25')](function(){return _0x54cc53;});})[_0x1ef3('0x25')](function(){_0x3cbbc1['status'](0xcc)[_0x1ef3('0x1e')]();});}};}function handleEntityNotFound(_0x26c0c8,_0x10d014){return function(_0x4d4181){if(!_0x4d4181){_0x26c0c8['sendStatus'](0x194);}return _0x4d4181;};}function handleError(_0x34ad63,_0xe66f3e){_0xe66f3e=_0xe66f3e||0x1f4;return function(_0x420be1){logger[_0x1ef3('0x29')](_0x420be1[_0x1ef3('0x2a')]);if(_0x420be1[_0x1ef3('0x2b')]){delete _0x420be1[_0x1ef3('0x2b')];}_0x34ad63[_0x1ef3('0x1d')](_0xe66f3e)[_0x1ef3('0x2c')](_0x420be1);};}exports[_0x1ef3('0x2d')]=function(_0x4ead3c,_0xecef3){var _0xd0a684={},_0x46f71e={},_0x59445f={'count':0x0,'rows':[]};var _0x537d6d=_[_0x1ef3('0x2e')](db[_0x1ef3('0x2f')][_0x1ef3('0x30')],function(_0x528c33){return{'name':_0x528c33['fieldName'],'type':_0x528c33[_0x1ef3('0x31')]['key']};});_0x46f71e[_0x1ef3('0x32')]=_[_0x1ef3('0x2e')](_0x537d6d,_0x1ef3('0x2b'));_0x46f71e['query']=_[_0x1ef3('0x33')](_0x4ead3c[_0x1ef3('0x34')]);_0x46f71e[_0x1ef3('0x35')]=_['intersection'](_0x46f71e[_0x1ef3('0x32')],_0x46f71e['query']);_0xd0a684[_0x1ef3('0x36')]=_['intersection'](_0x46f71e[_0x1ef3('0x32')],qs[_0x1ef3('0x37')](_0x4ead3c[_0x1ef3('0x34')][_0x1ef3('0x37')]));_0xd0a684[_0x1ef3('0x36')]=_0xd0a684[_0x1ef3('0x36')][_0x1ef3('0x38')]?_0xd0a684['attributes']:_0x46f71e[_0x1ef3('0x32')];if(!_0x4ead3c[_0x1ef3('0x34')][_0x1ef3('0x39')]('nolimit')){_0xd0a684['limit']=qs[_0x1ef3('0x3a')](_0x4ead3c[_0x1ef3('0x34')][_0x1ef3('0x3a')]);_0xd0a684[_0x1ef3('0x20')]=qs[_0x1ef3('0x20')](_0x4ead3c[_0x1ef3('0x34')][_0x1ef3('0x20')]);}_0xd0a684[_0x1ef3('0x3b')]=qs[_0x1ef3('0x3c')](_0x4ead3c['query'][_0x1ef3('0x3c')]);_0xd0a684[_0x1ef3('0x3d')]=qs[_0x1ef3('0x35')](_[_0x1ef3('0x3e')](_0x4ead3c[_0x1ef3('0x34')],_0x46f71e[_0x1ef3('0x35')]));if(_0x4ead3c['query'][_0x1ef3('0x3f')]){_0xd0a684['where']=_[_0x1ef3('0x40')](_0xd0a684['where'],{'$or':_[_0x1ef3('0x2e')](_0x537d6d,function(_0x33f7d4){if(_0x33f7d4[_0x1ef3('0x31')]!==_0x1ef3('0x41')){var _0x1ff68e={};_0x1ff68e[_0x33f7d4[_0x1ef3('0x2b')]]={'$like':'%'+_0x4ead3c[_0x1ef3('0x34')][_0x1ef3('0x3f')]+'%'};return _0x1ff68e;}})});}_0xd0a684=_['merge']({},_0xd0a684,_0x4ead3c['options']);var _0x490742={'where':_0xd0a684[_0x1ef3('0x3d')]};return db[_0x1ef3('0x2f')][_0x1ef3('0x1f')](_0x490742)[_0x1ef3('0x25')](function(_0x292c4e){_0x59445f[_0x1ef3('0x1f')]=_0x292c4e;if(_0x4ead3c[_0x1ef3('0x34')][_0x1ef3('0x42')]){_0xd0a684[_0x1ef3('0x43')]=[{'all':!![]}];}return db[_0x1ef3('0x2f')][_0x1ef3('0x44')](_0xd0a684);})['then'](function(_0x34c621){_0x59445f['rows']=_0x34c621;return _0x59445f;})['then'](respondWithFilteredResult(_0xecef3,_0xd0a684))[_0x1ef3('0x45')](handleError(_0xecef3,null));};exports[_0x1ef3('0x46')]=function(_0x3f912f,_0x5d7f04){var _0x38b9e8={'raw':![],'where':{'id':_0x3f912f['params']['id']}},_0x479839={};_0x479839['model']=_[_0x1ef3('0x33')](db['Schedule'][_0x1ef3('0x30')]);_0x479839[_0x1ef3('0x34')]=_[_0x1ef3('0x33')](_0x3f912f[_0x1ef3('0x34')]);_0x479839[_0x1ef3('0x35')]=_[_0x1ef3('0x47')](_0x479839['model'],_0x479839[_0x1ef3('0x34')]);_0x38b9e8['attributes']=_[_0x1ef3('0x47')](_0x479839[_0x1ef3('0x32')],qs[_0x1ef3('0x37')](_0x3f912f[_0x1ef3('0x34')][_0x1ef3('0x37')]));_0x38b9e8[_0x1ef3('0x36')]=_0x38b9e8[_0x1ef3('0x36')]['length']?_0x38b9e8['attributes']:_0x479839[_0x1ef3('0x32')];if(_0x3f912f[_0x1ef3('0x34')][_0x1ef3('0x42')]){_0x38b9e8[_0x1ef3('0x43')]=[{'all':!![]}];}_0x38b9e8=_[_0x1ef3('0x40')]({},_0x38b9e8,_0x3f912f[_0x1ef3('0x48')]);return db[_0x1ef3('0x2f')][_0x1ef3('0x49')](_0x38b9e8)['then'](handleEntityNotFound(_0x5d7f04,null))[_0x1ef3('0x25')](respondWithResult(_0x5d7f04,null))[_0x1ef3('0x45')](handleError(_0x5d7f04,null));};exports[_0x1ef3('0x4a')]=function(_0x56a82a,_0x42a919){return db[_0x1ef3('0x2f')][_0x1ef3('0x4a')](_0x56a82a[_0x1ef3('0x4b')],{})['then'](function(_0x20200d){var _0x425403=_0x56a82a[_0x1ef3('0x4c')]['get']({'plain':!![]});if(!_0x425403)throw new Error(_0x1ef3('0x4d'));if(_0x425403['role']==='user'){var _0x133f29=_0x20200d[_0x1ef3('0x27')]({'plain':!![]});var _0x2829ee=_0x1ef3('0x28');return db[_0x1ef3('0x4e')][_0x1ef3('0x49')]({'where':{'name':_0x2829ee,'userProfileId':_0x425403[_0x1ef3('0x4f')]},'raw':!![]})[_0x1ef3('0x25')](function(_0x5794f7){if(_0x5794f7&&_0x5794f7[_0x1ef3('0x50')]===0x0){return db[_0x1ef3('0x51')][_0x1ef3('0x4a')]({'name':_0x133f29[_0x1ef3('0x2b')],'resourceId':_0x133f29['id'],'type':_0x5794f7[_0x1ef3('0x2b')],'sectionId':_0x5794f7['id']},{})[_0x1ef3('0x25')](function(){return _0x20200d;});}else{return _0x20200d;}})['catch'](function(_0x333ea1){logger[_0x1ef3('0x29')](_0x1ef3('0x52'),_0x333ea1);throw _0x333ea1;});}return _0x20200d;})[_0x1ef3('0x25')](respondWithResult(_0x42a919,0xc9))[_0x1ef3('0x45')](handleError(_0x42a919,null));};exports[_0x1ef3('0x24')]=function(_0xe10a3c,_0x12a90a){if(_0xe10a3c[_0x1ef3('0x4b')]['id']){delete _0xe10a3c[_0x1ef3('0x4b')]['id'];}return db[_0x1ef3('0x2f')][_0x1ef3('0x49')]({'where':{'id':_0xe10a3c[_0x1ef3('0x53')]['id']}})[_0x1ef3('0x25')](handleEntityNotFound(_0x12a90a,null))[_0x1ef3('0x25')](saveUpdates(_0xe10a3c[_0x1ef3('0x4b')],null))[_0x1ef3('0x25')](respondWithResult(_0x12a90a,null))[_0x1ef3('0x45')](handleError(_0x12a90a,null));};exports[_0x1ef3('0x26')]=function(_0x15669f,_0x20b4bc){return db[_0x1ef3('0x2f')][_0x1ef3('0x49')]({'where':{'id':_0x15669f[_0x1ef3('0x53')]['id']}})[_0x1ef3('0x25')](handleEntityNotFound(_0x20b4bc,null))[_0x1ef3('0x25')](removeEntity(_0x20b4bc,null))[_0x1ef3('0x45')](handleError(_0x20b4bc,null));};exports[_0x1ef3('0x54')]=function(_0xf3d77b,_0x3b40df,_0x3ea67f){var _0x4d7586=require('../../config/schedule');return db[_0x1ef3('0x2f')][_0x1ef3('0x49')]({'where':{'id':_0xf3d77b[_0x1ef3('0x53')]['id']},'raw':!![]})[_0x1ef3('0x25')](handleEntityNotFound(_0x3b40df,null))[_0x1ef3('0x25')](function(){_0x4d7586[_0x1ef3('0x54')](_0xf3d77b[_0x1ef3('0x53')]['id']);})[_0x1ef3('0x25')](respondWithStatusCode(_0x3b40df,null))[_0x1ef3('0x45')](handleError(_0x3b40df,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 094e2a6..c8f14f1 100644 --- a/server/api/schedule/schedule.model.js +++ b/server/api/schedule/schedule.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ca2=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','define','Schedule','tools_schedules'];(function(_0x3fc422,_0x4ccf34){var _0x37eaaf=function(_0x59f4a2){while(--_0x59f4a2){_0x3fc422['push'](_0x3fc422['shift']());}};_0x37eaaf(++_0x4ccf34);}(_0x4ca2,0x8c));var _0x24ca=function(_0x4bfc12,_0x142724){_0x4bfc12=_0x4bfc12-0x0;var _0x33b8ee=_0x4ca2[_0x4bfc12];return _0x33b8ee;};'use strict';var _=require(_0x24ca('0x0'));var util=require(_0x24ca('0x1'));var logger=require(_0x24ca('0x2'))('api');var moment=require(_0x24ca('0x3'));var BPromise=require(_0x24ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24ca('0x5'));var rimraf=require(_0x24ca('0x6'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module['exports']=function(_0x3615cd,_0x20e700){return _0x3615cd[_0x24ca('0x7')](_0x24ca('0x8'),attributes,{'tableName':_0x24ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8283=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8283,0xbd));var _0x3828=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8283[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3828('0x0'));var util=require(_0x3828('0x1'));var logger=require('../../config/logger')(_0x3828('0x2'));var moment=require('moment');var BPromise=require(_0x3828('0x3'));var rp=require(_0x3828('0x4'));var fs=require('fs');var path=require(_0x3828('0x5'));var rimraf=require(_0x3828('0x6'));var config=require(_0x3828('0x7'));var attributes=require('./schedule.attributes');module['exports']=function(_0x1e8b91,_0x1aea3d){return _0x1e8b91[_0x3828('0x8')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8be8bd6..36b0972 100644 --- a/server/api/schedule/schedule.rpc.js +++ b/server/api/schedule/schedule.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fe2=['then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x3fe2,0x109));var _0x23fe=function(_0x161fee,_0x339629){_0x161fee=_0x161fee-0x0;var _0x58415b=_0x3fe2[_0x161fee];return _0x58415b;};'use strict';var _=require(_0x23fe('0x0'));var util=require(_0x23fe('0x1'));var moment=require(_0x23fe('0x2'));var BPromise=require(_0x23fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23fe('0x4'))['db'];var utils=require(_0x23fe('0x5'));var logger=require(_0x23fe('0x6'))(_0x23fe('0x7'));var config=require(_0x23fe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbdbd6b,_0x5f2b85,_0x15a240){return new BPromise(function(_0x23fe96,_0x1994bb){return client[_0x23fe('0xa')](_0xbdbd6b,_0x15a240)[_0x23fe('0xb')](function(_0x48d806){logger[_0x23fe('0xc')](_0x23fe('0xd'),_0x5f2b85,_0x23fe('0xe'));logger[_0x23fe('0xf')](_0x23fe('0x10'),_0x5f2b85,'request\x20sent',JSON[_0x23fe('0x11')](_0x48d806));if(_0x48d806[_0x23fe('0x12')]){if(_0x48d806['error'][_0x23fe('0x13')]===0x1f4){logger[_0x23fe('0x12')](_0x23fe('0xd'),_0x5f2b85,_0x48d806[_0x23fe('0x12')]['message']);return _0x1994bb(_0x48d806['error'][_0x23fe('0x14')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x5f2b85,_0x48d806[_0x23fe('0x12')][_0x23fe('0x14')]);return _0x23fe96(_0x48d806[_0x23fe('0x12')]['message']);}else{logger[_0x23fe('0xc')](_0x23fe('0xd'),_0x5f2b85,_0x23fe('0xe'));_0x23fe96(_0x48d806[_0x23fe('0x15')]['message']);}})[_0x23fe('0x16')](function(_0x3673c7){logger[_0x23fe('0x12')](_0x23fe('0xd'),_0x5f2b85,_0x3673c7);_0x1994bb(_0x3673c7);});});} \ No newline at end of file +var _0xdb9d=['Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xdb9d,0x9b));var _0xddb9=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xdb9d[_0x453e2b];return _0x50f306;};'use strict';var _=require(_0xddb9('0x0'));var util=require(_0xddb9('0x1'));var moment=require(_0xddb9('0x2'));var BPromise=require('bluebird');var rs=require(_0xddb9('0x3'));var fs=require('fs');var Redis=require(_0xddb9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddb9('0x5'));var logger=require(_0xddb9('0x6'))(_0xddb9('0x7'));var config=require(_0xddb9('0x8'));var jayson=require(_0xddb9('0x9'));var client=jayson[_0xddb9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x222d50,_0x48b657,_0x59e519){return new BPromise(function(_0x14655a,_0x22dc66){return client[_0xddb9('0xb')](_0x222d50,_0x59e519)[_0xddb9('0xc')](function(_0x1c3175){logger['info'](_0xddb9('0xd'),_0x48b657,_0xddb9('0xe'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x48b657,_0xddb9('0xe'),JSON[_0xddb9('0xf')](_0x1c3175));if(_0x1c3175[_0xddb9('0x10')]){if(_0x1c3175['error'][_0xddb9('0x11')]===0x1f4){logger[_0xddb9('0x10')](_0xddb9('0xd'),_0x48b657,_0x1c3175[_0xddb9('0x10')]['message']);return _0x22dc66(_0x1c3175[_0xddb9('0x10')][_0xddb9('0x12')]);}logger[_0xddb9('0x10')]('Schedule,\x20%s,\x20%s',_0x48b657,_0x1c3175[_0xddb9('0x10')][_0xddb9('0x12')]);return _0x14655a(_0x1c3175[_0xddb9('0x10')][_0xddb9('0x12')]);}else{logger[_0xddb9('0x13')](_0xddb9('0xd'),_0x48b657,_0xddb9('0xe'));_0x14655a(_0x1c3175[_0xddb9('0x14')][_0xddb9('0x12')]);}})['catch'](function(_0x5cc643){logger[_0xddb9('0x10')](_0xddb9('0xd'),_0x48b657,_0x5cc643);_0x22dc66(_0x5cc643);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 378104d..69cb2fe 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4590=['../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0x4590,0x1c5));var _0x0459=function(_0x248925,_0x41bc57){_0x248925=_0x248925-0x0;var _0x2d975d=_0x4590[_0x248925];return _0x2d975d;};'use strict';var multer=require(_0x0459('0x0'));var util=require('util');var path=require(_0x0459('0x1'));var timeout=require(_0x0459('0x2'));var express=require(_0x0459('0x3'));var router=express[_0x0459('0x4')]();var auth=require(_0x0459('0x5'));var interaction=require(_0x0459('0x6'));var config=require(_0x0459('0x7'));var controller=require(_0x0459('0x8'));router[_0x0459('0x9')]('/',auth[_0x0459('0xa')](),controller[_0x0459('0xb')]);router[_0x0459('0x9')](_0x0459('0xc'),auth[_0x0459('0xa')](),controller[_0x0459('0xd')]);router[_0x0459('0x9')](_0x0459('0xe'),auth[_0x0459('0xa')](),controller[_0x0459('0xf')]);router[_0x0459('0x9')](_0x0459('0x10'),auth[_0x0459('0xa')](),controller[_0x0459('0x11')]);router['post']('/',auth[_0x0459('0xa')](),controller[_0x0459('0x12')]);router[_0x0459('0x13')]('/:id',auth[_0x0459('0xa')](),controller[_0x0459('0x14')]);router[_0x0459('0x15')](_0x0459('0xe'),auth[_0x0459('0xa')](),controller[_0x0459('0x16')]);module['exports']=router; \ No newline at end of file +var _0x4b04=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','post','put','update','delete','destroy','exports'];(function(_0x3d71fe,_0x5d8d29){var _0x5ad250=function(_0x11025a){while(--_0x11025a){_0x3d71fe['push'](_0x3d71fe['shift']());}};_0x5ad250(++_0x5d8d29);}(_0x4b04,0x1e3));var _0x44b0=function(_0x1a4070,_0x570a3f){_0x1a4070=_0x1a4070-0x0;var _0x3d995e=_0x4b04[_0x1a4070];return _0x3d995e;};'use strict';var multer=require(_0x44b0('0x0'));var util=require(_0x44b0('0x1'));var path=require('path');var timeout=require(_0x44b0('0x2'));var express=require(_0x44b0('0x3'));var router=express[_0x44b0('0x4')]();var auth=require(_0x44b0('0x5'));var interaction=require(_0x44b0('0x6'));var config=require(_0x44b0('0x7'));var controller=require(_0x44b0('0x8'));router[_0x44b0('0x9')]('/',auth[_0x44b0('0xa')](),controller[_0x44b0('0xb')]);router['get'](_0x44b0('0xc'),auth[_0x44b0('0xa')](),controller[_0x44b0('0xd')]);router[_0x44b0('0x9')](_0x44b0('0xe'),auth[_0x44b0('0xa')](),controller[_0x44b0('0xf')]);router[_0x44b0('0x9')]('/:id/download',auth[_0x44b0('0xa')](),controller[_0x44b0('0x10')]);router[_0x44b0('0x11')]('/',auth[_0x44b0('0xa')](),controller['create']);router[_0x44b0('0x12')](_0x44b0('0xe'),auth[_0x44b0('0xa')](),controller[_0x44b0('0x13')]);router[_0x44b0('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x44b0('0x15')]);module[_0x44b0('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 8f6bb04..b8e7f74 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8958=['INTEGER','setDataValue','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','getDataValue','extname','value','STRING','replace'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x8958,0x93));var _0x8895=function(_0x588646,_0x4b190a){_0x588646=_0x588646-0x0;var _0x4fea90=_0x8958[_0x588646];return _0x4fea90;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8895('0x0'));var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8895('0x1')]('value')?path[_0x8895('0x2')](this[_0x8895('0x1')](_0x8895('0x3'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8895('0x4')]},'value':{'type':Sequelize[_0x8895('0x4')],'set':function(_0x124e1e){var _0x40cec6=_0x124e1e[_0x8895('0x5')](/\\/g,'/');this['setDataValue'](_0x8895('0x3'),_0x40cec6);}},'rating':{'type':Sequelize[_0x8895('0x6')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8895('0x6')],'set':function(_0x24fe49){this[_0x8895('0x7')](_0x8895('0x8'),moment()[_0x8895('0x9')](_0x24fe49,'ms'));this[_0x8895('0x7')](_0x8895('0xa'),moment());this[_0x8895('0x7')]('duration',_0x24fe49);}},'startedAt':{'type':Sequelize[_0x8895('0xb')],'get':function(){return moment(this[_0x8895('0x1')](_0x8895('0x8')))[_0x8895('0xc')](_0x8895('0xd'))[_0x8895('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8895('0x1')](_0x8895('0xa')))[_0x8895('0xc')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x8895('0xb')],'get':function(){return moment(this['getDataValue'](_0x8895('0xf')))[_0x8895('0xc')](_0x8895('0xd'))[_0x8895('0xe')]();}},'updatedAt':{'type':Sequelize[_0x8895('0xb')],'get':function(){return moment(this['getDataValue'](_0x8895('0x10')))[_0x8895('0xc')](_0x8895('0xd'))[_0x8895('0xe')]();}}}; \ No newline at end of file +var _0x24ca=['format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE'];(function(_0x38567a,_0x1abb77){var _0x1491df=function(_0x2af4cb){while(--_0x2af4cb){_0x38567a['push'](_0x38567a['shift']());}};_0x1491df(++_0x1abb77);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x24ca[_0x4bb145];return _0x4db596;};'use strict';var Sequelize=require(_0xa24c('0x0'));var moment=require('moment');var path=require(_0xa24c('0x1'));var config=require(_0xa24c('0x2'));module[_0xa24c('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa24c('0x4')](_0xa24c('0x5'))?path[_0xa24c('0x6')](this[_0xa24c('0x4')](_0xa24c('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xa24c('0x7')]},'channel':{'type':Sequelize[_0xa24c('0x7')]},'value':{'type':Sequelize[_0xa24c('0x7')],'set':function(_0x2dd348){var _0x257264=_0x2dd348[_0xa24c('0x8')](/\\/g,'/');this['setDataValue'](_0xa24c('0x5'),_0x257264);}},'rating':{'type':Sequelize[_0xa24c('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa24c('0x9')],'set':function(_0x5eac78){this[_0xa24c('0xa')](_0xa24c('0xb'),moment()[_0xa24c('0xc')](_0x5eac78,'ms'));this[_0xa24c('0xa')](_0xa24c('0xd'),moment());this[_0xa24c('0xa')](_0xa24c('0xe'),_0x5eac78);}},'startedAt':{'type':Sequelize[_0xa24c('0xf')],'get':function(){return moment(this[_0xa24c('0x4')]('startedAt'))[_0xa24c('0x10')](_0xa24c('0x11'))[_0xa24c('0x12')]();}},'closedAt':{'type':Sequelize[_0xa24c('0xf')],'get':function(){return moment(this['getDataValue'](_0xa24c('0xd')))[_0xa24c('0x10')](_0xa24c('0x11'))[_0xa24c('0x12')]();}},'createdAt':{'type':Sequelize[_0xa24c('0xf')],'get':function(){return moment(this[_0xa24c('0x4')](_0xa24c('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0xa24c('0x12')]();}},'updatedAt':{'type':Sequelize[_0xa24c('0xf')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xa24c('0x10')](_0xa24c('0x11'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 2739ef6..b2929ce 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41cb=['includeAll','include','findAll','show','params','find','create','body','catch','duration','closedAt','value','describe','../../components/encryptor','uniqueid','root','format','secrets','server/files/screen_recordings','existsSync','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x4adeab,_0xc170d0){var _0x33956f=function(_0x1e32f1){while(--_0x1e32f1){_0x4adeab['push'](_0x4adeab['shift']());}};_0x33956f(++_0xc170d0);}(_0x41cb,0x1b8));var _0xb41c=function(_0x467000,_0x2c3cd3){_0x467000=_0x467000-0x0;var _0x5f332e=_0x41cb[_0x467000];return _0x5f332e;};'use strict';var pdf=require(_0xb41c('0x0'));var emlformat=require(_0xb41c('0x1'));var rimraf=require(_0xb41c('0x2'));var zipdir=require(_0xb41c('0x3'));var jsonpatch=require(_0xb41c('0x4'));var rp=require(_0xb41c('0x5'));var moment=require(_0xb41c('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb41c('0x7'));var path=require('path');var sox=require(_0xb41c('0x8'));var csv=require(_0xb41c('0x9'));var ejs=require(_0xb41c('0xa'));var fs=require('fs');var _=require(_0xb41c('0xb'));var squel=require(_0xb41c('0xc'));var crypto=require(_0xb41c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb41c('0xe'));var toCsv=require(_0xb41c('0x9'));var querystring=require(_0xb41c('0xf'));var Papa=require('papaparse');var Redis=require(_0xb41c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb41c('0x11'));var as=require(_0xb41c('0x12'));var hardwareService=require(_0xb41c('0x13'));var logger=require('../../config/logger')(_0xb41c('0x14'));var utils=require(_0xb41c('0x15'));var config=require('../../config/environment');var db=require(_0xb41c('0x16'))['db'];function respondWithStatusCode(_0x528501,_0x3fbc85){_0x3fbc85=_0x3fbc85||0xcc;return function(_0x10b6b6){if(_0x10b6b6){return _0x528501[_0xb41c('0x17')](_0x3fbc85);}return _0x528501[_0xb41c('0x18')](_0x3fbc85)['end']();};}function respondWithResult(_0x19a7f0,_0x2c588b){_0x2c588b=_0x2c588b||0xc8;return function(_0x18bcdc){if(_0x18bcdc){return _0x19a7f0[_0xb41c('0x18')](_0x2c588b)[_0xb41c('0x19')](_0x18bcdc);}};}function respondWithFilteredResult(_0x4d5e67,_0x1e2bbb){return function(_0x27b55e){if(_0x27b55e){var _0xbcb989=_0x27b55e[_0xb41c('0x1a')],_0x3a420a=_0x1e2bbb[_0xb41c('0x1b')],_0x179e5e=_0x1e2bbb['offset']+_0x1e2bbb[_0xb41c('0x1c')],_0x37a668;if(_0x179e5e>=_0xbcb989){_0x179e5e=_0xbcb989;_0x37a668=0xc8;}else{_0x37a668=0xce;}_0x4d5e67[_0xb41c('0x18')](_0x37a668);return _0x4d5e67['set'](_0xb41c('0x1d'),_0x3a420a+'-'+_0x179e5e+'/'+_0xbcb989)['json'](_0x27b55e);}return null;};}function patchUpdates(_0x2a03d5){return function(_0x1543d2){try{jsonpatch[_0xb41c('0x1e')](_0x1543d2,_0x2a03d5,!![]);}catch(_0x4b597b){return BPromise[_0xb41c('0x1f')](_0x4b597b);}return _0x1543d2[_0xb41c('0x20')]();};}function saveUpdates(_0x34100c,_0x380f57){return function(_0x8bd164){if(_0x8bd164){return _0x8bd164[_0xb41c('0x21')](_0x34100c)['then'](function(_0x1672d8){return _0x1672d8;});}return null;};}function removeEntity(_0x26c0ca,_0x45c47d){return function(_0x256d51){if(_0x256d51){return _0x256d51[_0xb41c('0x22')]()[_0xb41c('0x23')](function(){_0x26c0ca[_0xb41c('0x18')](0xcc)[_0xb41c('0x24')]();});}};}function handleEntityNotFound(_0x24b693,_0x3d05e1){return function(_0x686f2c){if(!_0x686f2c){_0x24b693['sendStatus'](0x194);}return _0x686f2c;};}function handleError(_0x142cd0,_0x10324d){_0x10324d=_0x10324d||0x1f4;return function(_0x4f4f92){logger[_0xb41c('0x25')](_0x4f4f92[_0xb41c('0x26')]);if(_0x4f4f92[_0xb41c('0x27')]){delete _0x4f4f92[_0xb41c('0x27')];}_0x142cd0['status'](_0x10324d)[_0xb41c('0x28')](_0x4f4f92);};}exports[_0xb41c('0x29')]=function(_0x370c67,_0x4c6602){var _0x24ab14={},_0x23460f={},_0xdb8d0a={'count':0x0,'rows':[]};var _0x3f1c20=_[_0xb41c('0x2a')](db[_0xb41c('0x2b')][_0xb41c('0x2c')],function(_0x7ec0ba){return{'name':_0x7ec0ba[_0xb41c('0x2d')],'type':_0x7ec0ba[_0xb41c('0x2e')][_0xb41c('0x2f')]};});_0x23460f[_0xb41c('0x30')]=_[_0xb41c('0x31')](_[_0xb41c('0x2a')](_0x3f1c20,'name'),['format']);_0x23460f['query']=_[_0xb41c('0x32')](_0x370c67[_0xb41c('0x33')]);_0x23460f[_0xb41c('0x34')]=_[_0xb41c('0x35')](_0x23460f['model'],_0x23460f[_0xb41c('0x33')]);_0x24ab14['attributes']=_['intersection'](_0x23460f[_0xb41c('0x30')],qs['fields'](_0x370c67[_0xb41c('0x33')][_0xb41c('0x36')]));_0x24ab14[_0xb41c('0x37')]=_0x24ab14[_0xb41c('0x37')][_0xb41c('0x38')]?_0x24ab14[_0xb41c('0x37')]:_0x23460f['model'];if(!_0x370c67[_0xb41c('0x33')][_0xb41c('0x39')]('nolimit')){_0x24ab14[_0xb41c('0x1c')]=qs[_0xb41c('0x1c')](_0x370c67['query'][_0xb41c('0x1c')]);_0x24ab14[_0xb41c('0x1b')]=qs[_0xb41c('0x1b')](_0x370c67[_0xb41c('0x33')][_0xb41c('0x1b')]);}_0x24ab14['order']=qs[_0xb41c('0x3a')](_0x370c67[_0xb41c('0x33')][_0xb41c('0x3a')]);_0x24ab14[_0xb41c('0x3b')]=qs[_0xb41c('0x34')](_[_0xb41c('0x3c')](_0x370c67[_0xb41c('0x33')],_0x23460f[_0xb41c('0x34')]));if(_0x370c67[_0xb41c('0x33')][_0xb41c('0x3d')]){_0x24ab14[_0xb41c('0x3b')]=_[_0xb41c('0x3e')](_0x24ab14[_0xb41c('0x3b')],{'$or':_[_0xb41c('0x2a')](_0x3f1c20,function(_0x5bc8c4){if(_0x5bc8c4[_0xb41c('0x2e')]!==_0xb41c('0x3f')){var _0x332e4e={};_0x332e4e[_0x5bc8c4['name']]={'$like':'%'+_0x370c67['query'][_0xb41c('0x3d')]+'%'};return _0x332e4e;}})});}_0x24ab14=_['merge']({},_0x24ab14,_0x370c67[_0xb41c('0x40')]);var _0xf5bb4f={'where':_0x24ab14[_0xb41c('0x3b')]};return db[_0xb41c('0x2b')]['count'](_0xf5bb4f)[_0xb41c('0x23')](function(_0x48e2a4){_0xdb8d0a[_0xb41c('0x1a')]=_0x48e2a4;if(_0x370c67[_0xb41c('0x33')][_0xb41c('0x41')]){_0x24ab14[_0xb41c('0x42')]=[{'all':!![]}];}return db['ScreenRecording'][_0xb41c('0x43')](_0x24ab14);})[_0xb41c('0x23')](function(_0x1e8d05){_0xdb8d0a['rows']=_0x1e8d05;return _0xdb8d0a;})[_0xb41c('0x23')](respondWithFilteredResult(_0x4c6602,_0x24ab14))['catch'](handleError(_0x4c6602,null));};exports[_0xb41c('0x44')]=function(_0xd27121,_0x596014){var _0x37c6e5={'raw':![],'where':{'id':_0xd27121[_0xb41c('0x45')]['id']}},_0x296eb5={};_0x296eb5[_0xb41c('0x30')]=_[_0xb41c('0x32')](db['ScreenRecording'][_0xb41c('0x2c')]);_0x296eb5[_0xb41c('0x33')]=_[_0xb41c('0x32')](_0xd27121['query']);_0x296eb5[_0xb41c('0x34')]=_['intersection'](_0x296eb5[_0xb41c('0x30')],_0x296eb5[_0xb41c('0x33')]);_0x37c6e5[_0xb41c('0x37')]=_[_0xb41c('0x35')](_0x296eb5[_0xb41c('0x30')],qs[_0xb41c('0x36')](_0xd27121[_0xb41c('0x33')][_0xb41c('0x36')]));_0x37c6e5[_0xb41c('0x37')]=_0x37c6e5[_0xb41c('0x37')][_0xb41c('0x38')]?_0x37c6e5['attributes']:_0x296eb5['model'];if(_0xd27121[_0xb41c('0x33')][_0xb41c('0x41')]){_0x37c6e5[_0xb41c('0x42')]=[{'all':!![]}];}_0x37c6e5=_['merge']({},_0x37c6e5,_0xd27121[_0xb41c('0x40')]);return db[_0xb41c('0x2b')][_0xb41c('0x46')](_0x37c6e5)[_0xb41c('0x23')](handleEntityNotFound(_0x596014,null))[_0xb41c('0x23')](respondWithResult(_0x596014,null))['catch'](handleError(_0x596014,null));};exports[_0xb41c('0x47')]=function(_0x550cce,_0x7b518d){return db[_0xb41c('0x2b')]['create'](_0x550cce[_0xb41c('0x48')],{})[_0xb41c('0x23')](respondWithResult(_0x7b518d,0xc9))[_0xb41c('0x49')](handleError(_0x7b518d,null));};exports[_0xb41c('0x21')]=function(_0x3e8552,_0x1c134){if(_0x3e8552[_0xb41c('0x48')]['id']){delete _0x3e8552[_0xb41c('0x48')]['id'];}delete _0x3e8552[_0xb41c('0x48')][_0xb41c('0x4a')];delete _0x3e8552['body']['createdAt'];delete _0x3e8552[_0xb41c('0x48')][_0xb41c('0x4b')];delete _0x3e8552[_0xb41c('0x48')][_0xb41c('0x4c')];return db[_0xb41c('0x2b')][_0xb41c('0x46')]({'where':{'id':_0x3e8552['params']['id']}})[_0xb41c('0x23')](handleEntityNotFound(_0x1c134,null))[_0xb41c('0x23')](saveUpdates(_0x3e8552[_0xb41c('0x48')],null))['then'](respondWithResult(_0x1c134,null))[_0xb41c('0x49')](handleError(_0x1c134,null));};exports[_0xb41c('0x4d')]=function(_0x26b987,_0x13a787){return db[_0xb41c('0x2b')]['describe']()['then'](respondWithResult(_0x13a787,null))['catch'](handleError(_0x13a787,null));};exports['download']=function(_0x153d27,_0x2b4f69,_0x1303ba){var _0x3ad17c=require(_0xb41c('0x4e'));var _0x2b6b36=![];var _0x486bf3={};if(_0x153d27[_0xb41c('0x33')][_0xb41c('0x2e')]&&_0x153d27[_0xb41c('0x33')][_0xb41c('0x2e')]==='uniqueid'){_0x486bf3[_0xb41c('0x4f')]=_0x153d27[_0xb41c('0x45')]['id'];}else{_0x486bf3['id']=_0x153d27['params']['id'];}return db[_0xb41c('0x2b')][_0xb41c('0x46')]({'where':_0x486bf3,'attributes':['id',_0xb41c('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x2b4f69,null))[_0xb41c('0x23')](function(_0x18f60f){if(_0x18f60f){var _0x1e11b2=path['join'](config[_0xb41c('0x50')],'server/files/screen_recordings',_0x18f60f[_0xb41c('0x4c')]);var _0x4d4df1=util[_0xb41c('0x51')]('%s.cypher',_0x1e11b2);if(fs['existsSync'](_0x4d4df1)){_0x2b6b36=!![];return _0x3ad17c['decryptFile'](_0x4d4df1,_0x1e11b2,config[_0xb41c('0x52')]['recording'])[_0xb41c('0x23')](function(){return _0x18f60f;});}return _0x18f60f;}})[_0xb41c('0x23')](function(_0x4ac0fb){if(_0x4ac0fb){var _0x492050=path['join'](config['root'],_0xb41c('0x53'),_0x4ac0fb[_0xb41c('0x4c')]);if(!fs[_0xb41c('0x54')](_0x492050)){throw new db['Sequelize']['ValidationError'](_0xb41c('0x55'));}if(_0x4ac0fb[_0xb41c('0x56')]){return _0x2b4f69[_0xb41c('0x57')](_0x492050,_0x4ac0fb['filename']+path[_0xb41c('0x58')](_0x492050),function(){if(_0x2b6b36){fs[_0xb41c('0x59')](_0x492050);}});}else{return _0x2b4f69['download'](_0x492050,function(_0x5e24e7){if(_0x2b6b36){fs['unlink'](_0x492050);}});}}})[_0xb41c('0x49')](function(_0x23471b){if(_0x23471b[_0xb41c('0x5a')]===_0xb41c('0x55')){_0x2b4f69[_0xb41c('0x18')](0x194)['send'](_0xb41c('0x5b'));}else{return handleError(_0x2b4f69,null);}});};exports['destroy']=function(_0x24380b,_0x1863d9){return db[_0xb41c('0x2b')]['find']({'where':{'id':_0x24380b[_0xb41c('0x45')]['id']}})['then'](function(_0x2eb221){if(!_0x2eb221)throw new ReferenceError(_0xb41c('0x5c'));return _0x2eb221;})['then'](function(_0xc029fa){var _0x4db22a=path[_0xb41c('0x5d')](config['root'],_0xb41c('0x53'),_0xc029fa[_0xb41c('0x4c')]);logger[_0xb41c('0x5e')](_0xb41c('0x5f'),_0x4db22a);if(!_[_0xb41c('0x60')](_0xc029fa[_0xb41c('0x4c')])&&fs[_0xb41c('0x54')](_0x4db22a)){logger[_0xb41c('0x5e')](_0xb41c('0x61')+_0x4db22a+_0xb41c('0x62'));fs['unlinkSync'](_0x4db22a);}_0x4db22a=_0x4db22a+_0xb41c('0x63');if(!_[_0xb41c('0x60')](_0xc029fa[_0xb41c('0x4c')])&&fs['existsSync'](_0x4db22a)){logger['info'](_0xb41c('0x61')+_0x4db22a+_0xb41c('0x62'));fs[_0xb41c('0x64')](_0x4db22a);}return _0xc029fa;})[_0xb41c('0x23')](function(_0x58a5cb){if(!_0x58a5cb)throw new InternalError();return _0x58a5cb[_0xb41c('0x22')]();})[_0xb41c('0x23')](function(){_0x1863d9[_0xb41c('0x18')](0xcc)[_0xb41c('0x24')]();})[_0xb41c('0x49')](function(_0x459f14){var _0x232a0f=0x1f4;if(e instanceof ReferenceError){_0x232a0f=0x194;}else if(e instanceof InternalError){_0x232a0f=0x1f4;}logger['error'](_0x459f14['stack']);if(_0x459f14['name']){delete _0x459f14['name'];}_0x1863d9[_0xb41c('0x18')](_0x232a0f)[_0xb41c('0x28')](_0x459f14);});}; \ No newline at end of file +var _0x3738=['attributes','fields','length','nolimit','sort','where','pick','merge','filter','count','findAll','rows','catch','show','intersection','includeAll','include','options','find','create','body','duration','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','limit','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','format','keys','query','filters'];(function(_0x1c9842,_0x31b85c){var _0x1371b2=function(_0x582b51){while(--_0x582b51){_0x1c9842['push'](_0x1c9842['shift']());}};_0x1371b2(++_0x31b85c);}(_0x3738,0x1e5));var _0x8373=function(_0x18de8c,_0x4505c7){_0x18de8c=_0x18de8c-0x0;var _0x255fef=_0x3738[_0x18de8c];return _0x255fef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8373('0x0'));var rimraf=require(_0x8373('0x1'));var zipdir=require(_0x8373('0x2'));var jsonpatch=require(_0x8373('0x3'));var rp=require(_0x8373('0x4'));var moment=require(_0x8373('0x5'));var BPromise=require(_0x8373('0x6'));var Mustache=require(_0x8373('0x7'));var util=require(_0x8373('0x8'));var path=require(_0x8373('0x9'));var sox=require(_0x8373('0xa'));var csv=require(_0x8373('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8373('0xc'));var squel=require(_0x8373('0xd'));var crypto=require(_0x8373('0xe'));var jsforce=require(_0x8373('0xf'));var deskjs=require(_0x8373('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8373('0x11'));var Papa=require(_0x8373('0x12'));var Redis=require(_0x8373('0x13'));var authService=require(_0x8373('0x14'));var qs=require(_0x8373('0x15'));var as=require(_0x8373('0x16'));var hardwareService=require(_0x8373('0x17'));var logger=require(_0x8373('0x18'))('api');var utils=require(_0x8373('0x19'));var config=require('../../config/environment');var db=require(_0x8373('0x1a'))['db'];function respondWithStatusCode(_0x524e78,_0x44dde0){_0x44dde0=_0x44dde0||0xcc;return function(_0x15f15e){if(_0x15f15e){return _0x524e78['sendStatus'](_0x44dde0);}return _0x524e78[_0x8373('0x1b')](_0x44dde0)[_0x8373('0x1c')]();};}function respondWithResult(_0x3b1be6,_0x1d08ca){_0x1d08ca=_0x1d08ca||0xc8;return function(_0x527e4f){if(_0x527e4f){return _0x3b1be6[_0x8373('0x1b')](_0x1d08ca)[_0x8373('0x1d')](_0x527e4f);}};}function respondWithFilteredResult(_0x184a86,_0x5945e9){return function(_0x23f545){if(_0x23f545){var _0x3526d2=_0x23f545['count'],_0x3613ed=_0x5945e9[_0x8373('0x1e')],_0x276318=_0x5945e9[_0x8373('0x1e')]+_0x5945e9[_0x8373('0x1f')],_0x192b83;if(_0x276318>=_0x3526d2){_0x276318=_0x3526d2;_0x192b83=0xc8;}else{_0x192b83=0xce;}_0x184a86[_0x8373('0x1b')](_0x192b83);return _0x184a86['set']('Content-Range',_0x3613ed+'-'+_0x276318+'/'+_0x3526d2)[_0x8373('0x1d')](_0x23f545);}return null;};}function patchUpdates(_0x4f5dfa){return function(_0x2520ce){try{jsonpatch[_0x8373('0x20')](_0x2520ce,_0x4f5dfa,!![]);}catch(_0x238450){return BPromise[_0x8373('0x21')](_0x238450);}return _0x2520ce['save']();};}function saveUpdates(_0x1f1bc1,_0x3f946c){return function(_0x31af2a){if(_0x31af2a){return _0x31af2a[_0x8373('0x22')](_0x1f1bc1)['then'](function(_0x591e27){return _0x591e27;});}return null;};}function removeEntity(_0x250b1a,_0x552a2a){return function(_0x2b8259){if(_0x2b8259){return _0x2b8259[_0x8373('0x23')]()[_0x8373('0x24')](function(){_0x250b1a[_0x8373('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5ce4,_0x169841){return function(_0x3552bf){if(!_0x3552bf){_0x2b5ce4[_0x8373('0x25')](0x194);}return _0x3552bf;};}function handleError(_0x53eeae,_0xb76467){_0xb76467=_0xb76467||0x1f4;return function(_0x3de2e2){logger[_0x8373('0x26')](_0x3de2e2[_0x8373('0x27')]);if(_0x3de2e2[_0x8373('0x28')]){delete _0x3de2e2['name'];}_0x53eeae[_0x8373('0x1b')](_0xb76467)[_0x8373('0x29')](_0x3de2e2);};}exports[_0x8373('0x2a')]=function(_0x71b224,_0x42c8ca){var _0x27858f={},_0x4a57e5={},_0x14cd4b={'count':0x0,'rows':[]};var _0x104cdb=_['map'](db[_0x8373('0x2b')][_0x8373('0x2c')],function(_0x2074c4){return{'name':_0x2074c4[_0x8373('0x2d')],'type':_0x2074c4[_0x8373('0x2e')][_0x8373('0x2f')]};});_0x4a57e5[_0x8373('0x30')]=_[_0x8373('0x31')](_[_0x8373('0x32')](_0x104cdb,_0x8373('0x28')),[_0x8373('0x33')]);_0x4a57e5['query']=_[_0x8373('0x34')](_0x71b224[_0x8373('0x35')]);_0x4a57e5[_0x8373('0x36')]=_['intersection'](_0x4a57e5[_0x8373('0x30')],_0x4a57e5[_0x8373('0x35')]);_0x27858f[_0x8373('0x37')]=_['intersection'](_0x4a57e5[_0x8373('0x30')],qs[_0x8373('0x38')](_0x71b224[_0x8373('0x35')][_0x8373('0x38')]));_0x27858f[_0x8373('0x37')]=_0x27858f[_0x8373('0x37')][_0x8373('0x39')]?_0x27858f['attributes']:_0x4a57e5[_0x8373('0x30')];if(!_0x71b224[_0x8373('0x35')]['hasOwnProperty'](_0x8373('0x3a'))){_0x27858f['limit']=qs[_0x8373('0x1f')](_0x71b224[_0x8373('0x35')][_0x8373('0x1f')]);_0x27858f[_0x8373('0x1e')]=qs[_0x8373('0x1e')](_0x71b224[_0x8373('0x35')]['offset']);}_0x27858f['order']=qs[_0x8373('0x3b')](_0x71b224['query']['sort']);_0x27858f[_0x8373('0x3c')]=qs[_0x8373('0x36')](_[_0x8373('0x3d')](_0x71b224[_0x8373('0x35')],_0x4a57e5[_0x8373('0x36')]));if(_0x71b224['query']['filter']){_0x27858f[_0x8373('0x3c')]=_[_0x8373('0x3e')](_0x27858f[_0x8373('0x3c')],{'$or':_['map'](_0x104cdb,function(_0x1a81c9){if(_0x1a81c9[_0x8373('0x2e')]!=='VIRTUAL'){var _0x50daae={};_0x50daae[_0x1a81c9['name']]={'$like':'%'+_0x71b224[_0x8373('0x35')][_0x8373('0x3f')]+'%'};return _0x50daae;}})});}_0x27858f=_[_0x8373('0x3e')]({},_0x27858f,_0x71b224['options']);var _0x389382={'where':_0x27858f[_0x8373('0x3c')]};return db[_0x8373('0x2b')][_0x8373('0x40')](_0x389382)[_0x8373('0x24')](function(_0x19348b){_0x14cd4b[_0x8373('0x40')]=_0x19348b;if(_0x71b224[_0x8373('0x35')]['includeAll']){_0x27858f['include']=[{'all':!![]}];}return db[_0x8373('0x2b')][_0x8373('0x41')](_0x27858f);})['then'](function(_0x32518c){_0x14cd4b[_0x8373('0x42')]=_0x32518c;return _0x14cd4b;})[_0x8373('0x24')](respondWithFilteredResult(_0x42c8ca,_0x27858f))[_0x8373('0x43')](handleError(_0x42c8ca,null));};exports[_0x8373('0x44')]=function(_0x3c8820,_0x20bd35){var _0x16e9c2={'raw':![],'where':{'id':_0x3c8820['params']['id']}},_0x5b27f6={};_0x5b27f6[_0x8373('0x30')]=_[_0x8373('0x34')](db[_0x8373('0x2b')][_0x8373('0x2c')]);_0x5b27f6[_0x8373('0x35')]=_[_0x8373('0x34')](_0x3c8820['query']);_0x5b27f6[_0x8373('0x36')]=_['intersection'](_0x5b27f6['model'],_0x5b27f6[_0x8373('0x35')]);_0x16e9c2[_0x8373('0x37')]=_[_0x8373('0x45')](_0x5b27f6[_0x8373('0x30')],qs['fields'](_0x3c8820[_0x8373('0x35')][_0x8373('0x38')]));_0x16e9c2[_0x8373('0x37')]=_0x16e9c2['attributes'][_0x8373('0x39')]?_0x16e9c2[_0x8373('0x37')]:_0x5b27f6[_0x8373('0x30')];if(_0x3c8820[_0x8373('0x35')][_0x8373('0x46')]){_0x16e9c2[_0x8373('0x47')]=[{'all':!![]}];}_0x16e9c2=_[_0x8373('0x3e')]({},_0x16e9c2,_0x3c8820[_0x8373('0x48')]);return db[_0x8373('0x2b')][_0x8373('0x49')](_0x16e9c2)[_0x8373('0x24')](handleEntityNotFound(_0x20bd35,null))[_0x8373('0x24')](respondWithResult(_0x20bd35,null))[_0x8373('0x43')](handleError(_0x20bd35,null));};exports['create']=function(_0x23fe72,_0x1dea5a){return db[_0x8373('0x2b')][_0x8373('0x4a')](_0x23fe72['body'],{})[_0x8373('0x24')](respondWithResult(_0x1dea5a,0xc9))[_0x8373('0x43')](handleError(_0x1dea5a,null));};exports[_0x8373('0x22')]=function(_0x267b96,_0x583535){if(_0x267b96[_0x8373('0x4b')]['id']){delete _0x267b96[_0x8373('0x4b')]['id'];}delete _0x267b96[_0x8373('0x4b')][_0x8373('0x4c')];delete _0x267b96['body'][_0x8373('0x4d')];delete _0x267b96['body'][_0x8373('0x4e')];delete _0x267b96[_0x8373('0x4b')][_0x8373('0x4f')];return db[_0x8373('0x2b')][_0x8373('0x49')]({'where':{'id':_0x267b96[_0x8373('0x50')]['id']}})['then'](handleEntityNotFound(_0x583535,null))['then'](saveUpdates(_0x267b96[_0x8373('0x4b')],null))['then'](respondWithResult(_0x583535,null))[_0x8373('0x43')](handleError(_0x583535,null));};exports[_0x8373('0x51')]=function(_0x142c82,_0x263307){return db[_0x8373('0x2b')][_0x8373('0x51')]()[_0x8373('0x24')](respondWithResult(_0x263307,null))['catch'](handleError(_0x263307,null));};exports[_0x8373('0x52')]=function(_0x54208a,_0x350a39,_0x3693c3){var _0x260c90=require(_0x8373('0x53'));var _0x4b0d5d=![];var _0x5adee3={};if(_0x54208a[_0x8373('0x35')][_0x8373('0x2e')]&&_0x54208a['query'][_0x8373('0x2e')]===_0x8373('0x54')){_0x5adee3['uniqueid']=_0x54208a[_0x8373('0x50')]['id'];}else{_0x5adee3['id']=_0x54208a[_0x8373('0x50')]['id'];}return db['ScreenRecording'][_0x8373('0x49')]({'where':_0x5adee3,'attributes':['id',_0x8373('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x350a39,null))[_0x8373('0x24')](function(_0x5ed2d9){if(_0x5ed2d9){var _0x4894d0=path[_0x8373('0x55')](config['root'],_0x8373('0x56'),_0x5ed2d9['value']);var _0x1650cd=util[_0x8373('0x33')](_0x8373('0x57'),_0x4894d0);if(fs[_0x8373('0x58')](_0x1650cd)){_0x4b0d5d=!![];return _0x260c90[_0x8373('0x59')](_0x1650cd,_0x4894d0,config[_0x8373('0x5a')][_0x8373('0x5b')])[_0x8373('0x24')](function(){return _0x5ed2d9;});}return _0x5ed2d9;}})[_0x8373('0x24')](function(_0x2322e9){if(_0x2322e9){var _0x4b9904=path[_0x8373('0x55')](config[_0x8373('0x5c')],_0x8373('0x56'),_0x2322e9[_0x8373('0x4f')]);if(!fs[_0x8373('0x58')](_0x4b9904)){throw new db[(_0x8373('0x5d'))][(_0x8373('0x5e'))](_0x8373('0x5f'));}if(_0x2322e9[_0x8373('0x60')]){return _0x350a39[_0x8373('0x52')](_0x4b9904,_0x2322e9[_0x8373('0x60')]+path[_0x8373('0x61')](_0x4b9904),function(){if(_0x4b0d5d){fs[_0x8373('0x62')](_0x4b9904);}});}else{return _0x350a39[_0x8373('0x52')](_0x4b9904,function(_0x12d7e2){if(_0x4b0d5d){fs[_0x8373('0x62')](_0x4b9904);}});}}})['catch'](function(_0x2fd646){if(_0x2fd646[_0x8373('0x63')]===_0x8373('0x5f')){_0x350a39[_0x8373('0x1b')](0x194)[_0x8373('0x29')](_0x8373('0x64'));}else{return handleError(_0x350a39,null);}});};exports['destroy']=function(_0x30ece7,_0x5dc451){return db[_0x8373('0x2b')][_0x8373('0x49')]({'where':{'id':_0x30ece7[_0x8373('0x50')]['id']}})[_0x8373('0x24')](function(_0x56150f){if(!_0x56150f)throw new ReferenceError(_0x8373('0x65'));return _0x56150f;})[_0x8373('0x24')](function(_0x487579){var _0x32aa0b=path[_0x8373('0x55')](config['root'],'server/files/screen_recordings',_0x487579['value']);logger[_0x8373('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x32aa0b);if(!_['isNil'](_0x487579['value'])&&fs[_0x8373('0x58')](_0x32aa0b)){logger[_0x8373('0x66')](_0x8373('0x67')+_0x32aa0b+_0x8373('0x68'));fs[_0x8373('0x69')](_0x32aa0b);}_0x32aa0b=_0x32aa0b+_0x8373('0x6a');if(!_[_0x8373('0x6b')](_0x487579[_0x8373('0x4f')])&&fs[_0x8373('0x58')](_0x32aa0b)){logger[_0x8373('0x66')]('File:\x20\x22'+_0x32aa0b+_0x8373('0x68'));fs['unlinkSync'](_0x32aa0b);}return _0x487579;})[_0x8373('0x24')](function(_0x515cfb){if(!_0x515cfb)throw new InternalError();return _0x515cfb[_0x8373('0x23')]();})[_0x8373('0x24')](function(){_0x5dc451[_0x8373('0x1b')](0xcc)[_0x8373('0x1c')]();})['catch'](function(_0x57be60){var _0x2c95dd=0x1f4;if(e instanceof ReferenceError){_0x2c95dd=0x194;}else if(e instanceof InternalError){_0x2c95dd=0x1f4;}logger[_0x8373('0x26')](_0x57be60[_0x8373('0x27')]);if(_0x57be60[_0x8373('0x28')]){delete _0x57be60[_0x8373('0x28')];}_0x5dc451[_0x8373('0x1b')](_0x2c95dd)[_0x8373('0x29')](_0x57be60);});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 57c8116..f59ea45 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd489=['exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xd489,0x148));var _0x9d48=function(_0x24285e,_0x30d9cd){_0x24285e=_0x24285e-0x0;var _0x130827=_0xd489[_0x24285e];return _0x130827;};'use strict';var _=require(_0x9d48('0x0'));var util=require(_0x9d48('0x1'));var logger=require(_0x9d48('0x2'))(_0x9d48('0x3'));var moment=require(_0x9d48('0x4'));var BPromise=require(_0x9d48('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d48('0x6'));var config=require(_0x9d48('0x7'));var attributes=require('./screenRecording.attributes');module[_0x9d48('0x8')]=function(_0x1e4655,_0x1c2805){return _0x1e4655['define'](_0x9d48('0x9'),attributes,{'tableName':_0x9d48('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x9d48('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe980=['define','ScreenRecording','screen_recordings','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x503679,_0x1d99bf){var _0x2c6c2b=function(_0x451623){while(--_0x451623){_0x503679['push'](_0x503679['shift']());}};_0x2c6c2b(++_0x1d99bf);}(_0xe980,0x1bf));var _0x0e98=function(_0xf4bede,_0x25282a){_0xf4bede=_0xf4bede-0x0;var _0x832749=_0xe980[_0xf4bede];return _0x832749;};'use strict';var _=require(_0x0e98('0x0'));var util=require(_0x0e98('0x1'));var logger=require('../../config/logger')(_0x0e98('0x2'));var moment=require(_0x0e98('0x3'));var BPromise=require(_0x0e98('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e98('0x5'));var config=require(_0x0e98('0x6'));var attributes=require(_0x0e98('0x7'));module[_0x0e98('0x8')]=function(_0x1a61af,_0x4c4ad2){return _0x1a61af[_0x0e98('0x9')](_0x0e98('0xa'),attributes,{'tableName':_0x0e98('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 7e8f809..c81fa86 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x466c95,_0x35014e){var _0x4ce0e5=function(_0x48f805){while(--_0x48f805){_0x466c95['push'](_0x466c95['shift']());}};_0x4ce0e5(++_0x35014e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x58ef1d,_0x18707f){var _0x15f2b9=function(_0x190c8a){while(--_0x190c8a){_0x58ef1d['push'](_0x58ef1d['shift']());}};_0x15f2b9(++_0x18707f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 0d36456..3632bfc 100644 --- a/server/api/setting/index.js +++ b/server/api/setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce22=['Router','../../components/interaction/service','../../config/environment','./setting.controller','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','file','addLogo','logologin','originalname','single','preferred','favicon','addFavicon','put','isAuthenticated','update','util','connect-timeout','express'];(function(_0x1cf99d,_0x38ad39){var _0x149a69=function(_0x5576c8){while(--_0x5576c8){_0x1cf99d['push'](_0x1cf99d['shift']());}};_0x149a69(++_0x38ad39);}(_0xce22,0x9d));var _0x2ce2=function(_0x533105,_0x2548e5){_0x533105=_0x533105-0x0;var _0x53f40b=_0xce22[_0x533105];return _0x53f40b;};'use strict';var multer=require('multer');var util=require(_0x2ce2('0x0'));var path=require('path');var timeout=require(_0x2ce2('0x1'));var express=require(_0x2ce2('0x2'));var router=express[_0x2ce2('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2ce2('0x4'));var config=require(_0x2ce2('0x5'));var controller=require(_0x2ce2('0x6'));router[_0x2ce2('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2ce2('0x7')](_0x2ce2('0x8'),controller[_0x2ce2('0x9')]);router['get'](_0x2ce2('0xa'),controller[_0x2ce2('0xb')]);router[_0x2ce2('0x7')](_0x2ce2('0xc'),controller[_0x2ce2('0xd')]);router[_0x2ce2('0x7')](_0x2ce2('0xe'),controller[_0x2ce2('0xf')]);router['get'](_0x2ce2('0x10'),controller[_0x2ce2('0x11')]);router['get'](_0x2ce2('0x12'),controller[_0x2ce2('0x13')]);var upload=multer({'storage':multer[_0x2ce2('0x14')]({'destination':function(_0x58846e,_0x28f184,_0x2ef37f){_0x2ef37f(null,path[_0x2ce2('0x15')](config[_0x2ce2('0x16')],_0x2ce2('0x17')));},'filename':function(_0x22deb0,_0x506345,_0x2f1d91){_0x2f1d91(null,util[_0x2ce2('0x18')](_0x2ce2('0x19'),_0x2ce2('0x1a'),path[_0x2ce2('0x1b')](_0x506345['originalname'])));}})});router[_0x2ce2('0x1c')]('/:id/logo',upload['single'](_0x2ce2('0x1d')),controller[_0x2ce2('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x528cef,_0x270fbe,_0x5e8701){_0x5e8701(null,path[_0x2ce2('0x15')](config[_0x2ce2('0x16')],_0x2ce2('0x17')));},'filename':function(_0x773a3a,_0x4c9fe4,_0x4ac5e2){_0x4ac5e2(null,util[_0x2ce2('0x18')]('%s%s',_0x2ce2('0x1f'),path[_0x2ce2('0x1b')](_0x4c9fe4[_0x2ce2('0x20')])));}})});router[_0x2ce2('0x1c')]('/:id/logo_login',upload[_0x2ce2('0x21')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x279d8b,_0x13428a,_0x34cac5){_0x34cac5(null,path[_0x2ce2('0x15')](config[_0x2ce2('0x16')],_0x2ce2('0x17')));},'filename':function(_0x50f737,_0x304f92,_0x8c05a2){_0x8c05a2(null,util['format']('%s%s',_0x2ce2('0x22'),path['extname'](_0x304f92['originalname'])));}})});router[_0x2ce2('0x1c')](_0x2ce2('0x10'),upload[_0x2ce2('0x21')](_0x2ce2('0x1d')),controller['addPreferred']);var upload=multer({'storage':multer[_0x2ce2('0x14')]({'destination':function(_0x18188d,_0x16a6c4,_0x4605e8){_0x4605e8(null,path['join'](config[_0x2ce2('0x16')],_0x2ce2('0x17')));},'filename':function(_0x42cc7a,_0x13e32e,_0x5da084){_0x5da084(null,util[_0x2ce2('0x18')](_0x2ce2('0x19'),_0x2ce2('0x23'),path['extname'](_0x13e32e[_0x2ce2('0x20')])));}})});router[_0x2ce2('0x1c')](_0x2ce2('0x12'),upload['single'](_0x2ce2('0x1d')),controller[_0x2ce2('0x24')]);router[_0x2ce2('0x25')](_0x2ce2('0x8'),auth[_0x2ce2('0x26')](),controller[_0x2ce2('0x27')]);module['exports']=router; \ No newline at end of file +var _0x6704=['%s%s','logo','extname','originalname','post','/:id/logo','single','file','addLogo','server/files/images/logos/','logologin','addLogoLogin','addPreferred','favicon','addFavicon','put','update','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format'];(function(_0x2bff4f,_0x6aa9d6){var _0x1c8f59=function(_0x12e2ca){while(--_0x12e2ca){_0x2bff4f['push'](_0x2bff4f['shift']());}};_0x1c8f59(++_0x6aa9d6);}(_0x6704,0x66));var _0x4670=function(_0x5d4cb5,_0x22025e){_0x5d4cb5=_0x5d4cb5-0x0;var _0x25561e=_0x6704[_0x5d4cb5];return _0x25561e;};'use strict';var multer=require(_0x4670('0x0'));var util=require(_0x4670('0x1'));var path=require('path');var timeout=require(_0x4670('0x2'));var express=require(_0x4670('0x3'));var router=express[_0x4670('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4670('0x5'));var config=require('../../config/environment');var controller=require(_0x4670('0x6'));router[_0x4670('0x7')]('/',auth[_0x4670('0x8')](),controller[_0x4670('0x9')]);router[_0x4670('0x7')](_0x4670('0xa'),controller[_0x4670('0xb')]);router[_0x4670('0x7')]('/:id/logo',controller['getLogo']);router[_0x4670('0x7')](_0x4670('0xc'),controller[_0x4670('0xd')]);router['get'](_0x4670('0xe'),controller[_0x4670('0xf')]);router[_0x4670('0x7')](_0x4670('0x10'),controller[_0x4670('0x11')]);router[_0x4670('0x7')](_0x4670('0x12'),controller[_0x4670('0x13')]);var upload=multer({'storage':multer[_0x4670('0x14')]({'destination':function(_0x334b1e,_0x39abd1,_0x2d2d9d){_0x2d2d9d(null,path[_0x4670('0x15')](config[_0x4670('0x16')],'server/files/images/logos/'));},'filename':function(_0x12d0d7,_0x5f1a3d,_0x32cfc3){_0x32cfc3(null,util[_0x4670('0x17')](_0x4670('0x18'),_0x4670('0x19'),path[_0x4670('0x1a')](_0x5f1a3d[_0x4670('0x1b')])));}})});router[_0x4670('0x1c')](_0x4670('0x1d'),upload[_0x4670('0x1e')](_0x4670('0x1f')),controller[_0x4670('0x20')]);var upload=multer({'storage':multer[_0x4670('0x14')]({'destination':function(_0xcc5c5d,_0x2a3144,_0x41cb09){_0x41cb09(null,path[_0x4670('0x15')](config['root'],_0x4670('0x21')));},'filename':function(_0x3d695c,_0x1ae468,_0x3382ca){_0x3382ca(null,util['format'](_0x4670('0x18'),_0x4670('0x22'),path[_0x4670('0x1a')](_0x1ae468[_0x4670('0x1b')])));}})});router[_0x4670('0x1c')](_0x4670('0xc'),upload[_0x4670('0x1e')](_0x4670('0x1f')),controller[_0x4670('0x23')]);var upload=multer({'storage':multer[_0x4670('0x14')]({'destination':function(_0x48e8c6,_0x243171,_0x2722fd){_0x2722fd(null,path[_0x4670('0x15')](config[_0x4670('0x16')],_0x4670('0x21')));},'filename':function(_0x4f1f06,_0x4e6382,_0x4931fc){_0x4931fc(null,util[_0x4670('0x17')](_0x4670('0x18'),'preferred',path[_0x4670('0x1a')](_0x4e6382['originalname'])));}})});router[_0x4670('0x1c')]('/:id/preferred',upload['single']('file'),controller[_0x4670('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x24f699,_0x3be2b0,_0x2642c2){_0x2642c2(null,path[_0x4670('0x15')](config[_0x4670('0x16')],'server/files/images/logos/'));},'filename':function(_0x451f4d,_0x4fc2ed,_0x39d6bc){_0x39d6bc(null,util['format'](_0x4670('0x18'),_0x4670('0x25'),path[_0x4670('0x1a')](_0x4fc2ed[_0x4670('0x1b')])));}})});router[_0x4670('0x1c')](_0x4670('0x12'),upload[_0x4670('0x1e')]('file'),controller[_0x4670('0x26')]);router[_0x4670('0x27')](_0x4670('0xa'),auth[_0x4670('0x8')](),controller[_0x4670('0x28')]);module[_0x4670('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index b910f7e..025ed30 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f66=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0x4f66,0x78));var _0x64f6=function(_0x280a2f,_0x5945e9){_0x280a2f=_0x280a2f-0x0;var _0x12a09e=_0x4f66[_0x280a2f];return _0x12a09e;};'use strict';var Sequelize=require(_0x64f6('0x0'));module[_0x64f6('0x1')]={'min_internal':{'type':Sequelize[_0x64f6('0x2')](0xb),'unique':_0x64f6('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x64f6('0x2')](0xb),'unique':_0x64f6('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x64f6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x64f6('0x5')],'defaultValue':_0x64f6('0x6')},'logo':{'type':Sequelize[_0x64f6('0x5')]},'defaultLogo':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x64f6('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x64f6('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x64f6('0x5')]},'turnaddr':{'type':Sequelize[_0x64f6('0x5')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x64f6('0x5')]},'pageTitle':{'type':Sequelize[_0x64f6('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x64f6('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x64f6('0x5')],'defaultValue':_0x64f6('0x8')},'enableEmailPreview':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x64f6('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x64f6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x64f6('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x64f6('0x5')],'defaultValue':_0x64f6('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x64f6('0x5')]},'defaultPreferred':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x64f6('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x64f6('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x64f6('0x5')]},'defaultFavicon':{'type':Sequelize[_0x64f6('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x64f6('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0x424b=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','min_internal','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN'];(function(_0x13e842,_0x52c4ee){var _0x9ce52f=function(_0x570a06){while(--_0x570a06){_0x13e842['push'](_0x13e842['shift']());}};_0x9ce52f(++_0x52c4ee);}(_0x424b,0x1ce));var _0xb424=function(_0x4507d1,_0x6c48bf){_0x4507d1=_0x4507d1-0x0;var _0x19c727=_0x424b[_0x4507d1];return _0x19c727;};'use strict';var Sequelize=require(_0xb424('0x0'));module[_0xb424('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xb424('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb424('0x3')](0xb),'unique':_0xb424('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xb424('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xb424('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb424('0x6')]},'defaultLoginLogo':{'type':Sequelize[_0xb424('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb424('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xb424('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xb424('0x6')]},'turnaddr':{'type':Sequelize[_0xb424('0x6')]},'turnusername':{'type':Sequelize[_0xb424('0x6')]},'turnpassword':{'type':Sequelize[_0xb424('0x6')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xb424('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xb424('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xb424('0x6')],'defaultValue':_0xb424('0x8')},'enableEmailPreview':{'type':Sequelize[_0xb424('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0xb424('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xb424('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb424('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xb424('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb424('0x6')],'defaultValue':_0xb424('0x9')},'chatTimeout':{'type':Sequelize[_0xb424('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb424('0x6')]},'defaultPreferred':{'type':Sequelize[_0xb424('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xb424('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xb424('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0xb424('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb424('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xb424('0x6')]},'defaultFavicon':{'type':Sequelize[_0xb424('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8a3ad14..6570d9d 100644 --- a/server/api/setting/setting.controller.js +++ b/server/api/setting/setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd032=['send','index','map','Setting','rawAttributes','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','options','includeAll','findAll','show','params','include','find','update','body','get','readFileSync','join','render','server/files/templates/turn.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','logo','preferred','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','default_logo.png','upperFirst','download','getLogoLogin','getLicense','favicon','default_loginLogo.png','default','custom','\x20not\x20found','securePassword','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','destroy','name'];(function(_0x3fe66e,_0x331cdb){var _0x23d9b5=function(_0xf131e4){while(--_0xf131e4){_0x3fe66e['push'](_0x3fe66e['shift']());}};_0x23d9b5(++_0x331cdb);}(_0xd032,0xc8));var _0x2d03=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xd032[_0xaa1b3e];return _0x454d7d;};'use strict';var pdf=require(_0x2d03('0x0'));var emlformat=require(_0x2d03('0x1'));var rimraf=require(_0x2d03('0x2'));var zipdir=require(_0x2d03('0x3'));var jsonpatch=require(_0x2d03('0x4'));var rp=require(_0x2d03('0x5'));var moment=require('moment');var BPromise=require(_0x2d03('0x6'));var Mustache=require(_0x2d03('0x7'));var util=require(_0x2d03('0x8'));var path=require(_0x2d03('0x9'));var sox=require(_0x2d03('0xa'));var csv=require(_0x2d03('0xb'));var ejs=require(_0x2d03('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2d03('0xd'));var crypto=require(_0x2d03('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2d03('0xb'));var querystring=require(_0x2d03('0xf'));var Papa=require(_0x2d03('0x10'));var Redis=require(_0x2d03('0x11'));var authService=require(_0x2d03('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2d03('0x13'));var hardwareService=require(_0x2d03('0x14'));var logger=require(_0x2d03('0x15'))(_0x2d03('0x16'));var utils=require(_0x2d03('0x17'));var config=require('../../config/environment');var db=require(_0x2d03('0x18'))['db'];var jayson=require(_0x2d03('0x19'));var client=jayson['client'][_0x2d03('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xeb891b,_0x2cd9fe,_0x288647){if(_0x288647){var _0x977c1d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x977c1d['test'](_0x2cd9fe)){return _0xeb891b;}else{throw new db[(_0x2d03('0x1b'))][(_0x2d03('0x1c'))](_0x2d03('0x1d'));}}else{return _0xeb891b;}}function respondWithRpcPromise(_0x34530c,_0x54011a,_0x49b5ff,_0x239278){return new BPromise(function(_0x133680,_0x4622a3){var _0x45763c=_0x239278||client;return _0x45763c[_0x2d03('0x1e')](_0x34530c,_0x49b5ff)[_0x2d03('0x1f')](function(_0x5177de){logger[_0x2d03('0x20')](_0x2d03('0x21'),_0x54011a,_0x2d03('0x22'));logger['debug'](_0x2d03('0x23'),_0x54011a,_0x2d03('0x22'),JSON[_0x2d03('0x24')](_0x5177de));if(_0x5177de[_0x2d03('0x25')]){if(_0x5177de[_0x2d03('0x25')]['code']===0x1f4){logger[_0x2d03('0x25')]('Setting,\x20%s,\x20%s',_0x54011a,_0x5177de['error'][_0x2d03('0x26')]);return _0x4622a3(_0x5177de[_0x2d03('0x25')][_0x2d03('0x26')]);}logger[_0x2d03('0x25')](_0x2d03('0x21'),_0x54011a,_0x5177de['error'][_0x2d03('0x26')]);return _0x133680(_0x5177de['error'][_0x2d03('0x26')]);}else{logger[_0x2d03('0x20')]('Setting,\x20%s,\x20%s',_0x54011a,'request\x20sent');_0x133680(_0x5177de[_0x2d03('0x27')][_0x2d03('0x26')]);}})[_0x2d03('0x28')](function(_0x27f58a){logger[_0x2d03('0x25')]('Setting,\x20%s,\x20%s',_0x54011a,_0x27f58a);_0x4622a3(_0x27f58a);});});}function respondWithStatusCode(_0x4cf4b5,_0x4de10e){_0x4de10e=_0x4de10e||0xcc;return function(_0x3aff80){if(_0x3aff80){return _0x4cf4b5[_0x2d03('0x29')](_0x4de10e);}return _0x4cf4b5[_0x2d03('0x2a')](_0x4de10e)[_0x2d03('0x2b')]();};}function respondWithResult(_0x293271,_0x540095){_0x540095=_0x540095||0xc8;return function(_0x2d9023){if(_0x2d9023){return _0x293271['status'](_0x540095)[_0x2d03('0x2c')](_0x2d9023);}};}function respondWithFilteredResult(_0x3c0503,_0x1589b9){return function(_0x3a924e){if(_0x3a924e){var _0x26e25b=_0x3a924e['count'],_0x3c91a=_0x1589b9[_0x2d03('0x2d')],_0x419f1b=_0x1589b9[_0x2d03('0x2d')]+_0x1589b9[_0x2d03('0x2e')],_0x1b3583;if(_0x419f1b>=_0x26e25b){_0x419f1b=_0x26e25b;_0x1b3583=0xc8;}else{_0x1b3583=0xce;}_0x3c0503[_0x2d03('0x2a')](_0x1b3583);return _0x3c0503['set'](_0x2d03('0x2f'),_0x3c91a+'-'+_0x419f1b+'/'+_0x26e25b)[_0x2d03('0x2c')](_0x3a924e);}return null;};}function patchUpdates(_0x3d3946){return function(_0x3df50f){try{jsonpatch['apply'](_0x3df50f,_0x3d3946,!![]);}catch(_0x205074){return BPromise[_0x2d03('0x30')](_0x205074);}return _0x3df50f[_0x2d03('0x31')]();};}function saveUpdates(_0xea1c86,_0x437ffe){return function(_0x20facd){if(_0x20facd){return _0x20facd['update'](_0xea1c86)[_0x2d03('0x1f')](function(_0x26421c){return _0x26421c;});}return null;};}function removeEntity(_0x52d9fb,_0x272e13){return function(_0x21ad15){if(_0x21ad15){return _0x21ad15[_0x2d03('0x32')]()['then'](function(){_0x52d9fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d190f,_0x3800b9){return function(_0x4e9a2b){if(!_0x4e9a2b){_0x3d190f['sendStatus'](0x194);}return _0x4e9a2b;};}function handleError(_0x544018,_0x23a3fc){_0x23a3fc=_0x23a3fc||0x1f4;return function(_0x352e52){logger['error'](_0x352e52['stack']);if(_0x352e52[_0x2d03('0x33')]){delete _0x352e52[_0x2d03('0x33')];}_0x544018['status'](_0x23a3fc)[_0x2d03('0x34')](_0x352e52);};}exports[_0x2d03('0x35')]=function(_0x50f19b,_0xcdad7){var _0x3a2ff8={},_0x17eab5={},_0x225603={'count':0x0,'rows':[]};var _0x134c6a=_[_0x2d03('0x36')](db[_0x2d03('0x37')][_0x2d03('0x38')],function(_0x3f43a2){return{'name':_0x3f43a2['fieldName'],'type':_0x3f43a2['type'][_0x2d03('0x39')]};});_0x17eab5['model']=_['map'](_0x134c6a,_0x2d03('0x33'));_0x17eab5['query']=_[_0x2d03('0x3a')](_0x50f19b[_0x2d03('0x3b')]);_0x17eab5['filters']=_[_0x2d03('0x3c')](_0x17eab5['model'],_0x17eab5[_0x2d03('0x3b')]);_0x3a2ff8[_0x2d03('0x3d')]=_[_0x2d03('0x3c')](_0x17eab5[_0x2d03('0x3e')],qs[_0x2d03('0x3f')](_0x50f19b[_0x2d03('0x3b')][_0x2d03('0x3f')]));_0x3a2ff8[_0x2d03('0x3d')]=_0x3a2ff8[_0x2d03('0x3d')][_0x2d03('0x40')]?_0x3a2ff8[_0x2d03('0x3d')]:_0x17eab5['model'];if(!_0x50f19b[_0x2d03('0x3b')][_0x2d03('0x41')](_0x2d03('0x42'))){_0x3a2ff8[_0x2d03('0x2e')]=qs[_0x2d03('0x2e')](_0x50f19b[_0x2d03('0x3b')][_0x2d03('0x2e')]);_0x3a2ff8[_0x2d03('0x2d')]=qs[_0x2d03('0x2d')](_0x50f19b[_0x2d03('0x3b')][_0x2d03('0x2d')]);}_0x3a2ff8[_0x2d03('0x43')]=qs[_0x2d03('0x44')](_0x50f19b[_0x2d03('0x3b')]['sort']);_0x3a2ff8['where']=qs[_0x2d03('0x45')](_['pick'](_0x50f19b['query'],_0x17eab5[_0x2d03('0x45')]));if(_0x50f19b[_0x2d03('0x3b')][_0x2d03('0x46')]){_0x3a2ff8[_0x2d03('0x47')]=_[_0x2d03('0x48')](_0x3a2ff8[_0x2d03('0x47')],{'$or':_['map'](_0x134c6a,function(_0x2cc571){if(_0x2cc571[_0x2d03('0x49')]!=='VIRTUAL'){var _0x945356={};_0x945356[_0x2cc571['name']]={'$like':'%'+_0x50f19b[_0x2d03('0x3b')][_0x2d03('0x46')]+'%'};return _0x945356;}})});}_0x3a2ff8=_[_0x2d03('0x48')]({},_0x3a2ff8,_0x50f19b[_0x2d03('0x4a')]);var _0x126dec={'where':_0x3a2ff8[_0x2d03('0x47')]};return db[_0x2d03('0x37')]['count'](_0x126dec)[_0x2d03('0x1f')](function(_0x33c8a2){_0x225603['count']=_0x33c8a2;if(_0x50f19b['query'][_0x2d03('0x4b')]){_0x3a2ff8['include']=[{'all':!![]}];}return db[_0x2d03('0x37')][_0x2d03('0x4c')](_0x3a2ff8);})['then'](function(_0x404631){_0x225603['rows']=_0x404631;return _0x225603;})[_0x2d03('0x1f')](respondWithFilteredResult(_0xcdad7,_0x3a2ff8))[_0x2d03('0x28')](handleError(_0xcdad7,null));};exports[_0x2d03('0x4d')]=function(_0x29aaaa,_0x33a567){var _0x483b7a={'raw':![],'where':{'id':_0x29aaaa[_0x2d03('0x4e')]['id']}},_0x2f67de={};_0x2f67de[_0x2d03('0x3e')]=_[_0x2d03('0x3a')](db[_0x2d03('0x37')][_0x2d03('0x38')]);_0x2f67de[_0x2d03('0x3b')]=_[_0x2d03('0x3a')](_0x29aaaa['query']);_0x2f67de[_0x2d03('0x45')]=_['intersection'](_0x2f67de[_0x2d03('0x3e')],_0x2f67de[_0x2d03('0x3b')]);_0x483b7a[_0x2d03('0x3d')]=_[_0x2d03('0x3c')](_0x2f67de[_0x2d03('0x3e')],qs['fields'](_0x29aaaa[_0x2d03('0x3b')]['fields']));_0x483b7a[_0x2d03('0x3d')]=_0x483b7a[_0x2d03('0x3d')][_0x2d03('0x40')]?_0x483b7a[_0x2d03('0x3d')]:_0x2f67de[_0x2d03('0x3e')];if(_0x29aaaa[_0x2d03('0x3b')][_0x2d03('0x4b')]){_0x483b7a[_0x2d03('0x4f')]=[{'all':!![]}];}_0x483b7a=_[_0x2d03('0x48')]({},_0x483b7a,_0x29aaaa[_0x2d03('0x4a')]);return db[_0x2d03('0x37')][_0x2d03('0x50')](_0x483b7a)['then'](handleEntityNotFound(_0x33a567,null))[_0x2d03('0x1f')](respondWithResult(_0x33a567,null))[_0x2d03('0x28')](handleError(_0x33a567,null));};exports[_0x2d03('0x51')]=function(_0x535b2b,_0x52ee2c,_0x2be469){var _0x44dcc7;return db[_0x2d03('0x37')]['find']({'where':{'id':_0x535b2b[_0x2d03('0x4e')]['id']}})[_0x2d03('0x1f')](handleEntityNotFound(_0x52ee2c,null))[_0x2d03('0x1f')](saveUpdates(_0x535b2b[_0x2d03('0x52')],null))['then'](function(_0x1b4c1c){if(_0x1b4c1c){_0x44dcc7=_0x1b4c1c[_0x2d03('0x53')]({'plain':!![]});var _0x113b67=fs[_0x2d03('0x54')](path[_0x2d03('0x55')](config['root'],'server/files/templates/stun.ejs'),'utf8');var _0x163eb1=ejs[_0x2d03('0x56')](_0x113b67,_0x44dcc7);var _0x4b2f7d=fs[_0x2d03('0x54')](path[_0x2d03('0x55')](config['root'],_0x2d03('0x57')),_0x2d03('0x58'));var _0x1c6e04=ejs[_0x2d03('0x56')](_0x4b2f7d,_0x44dcc7);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x163eb1);fs['writeFileSync'](_0x2d03('0x59'),_0x1c6e04);return respondWithRpcPromise(_0x2d03('0x5a'),_0x2d03('0x51'),{'module':_0x2d03('0x5b')});}})['then'](function(){return respondWithRpcPromise(_0x2d03('0x5a'),'update',{'module':_0x2d03('0x5c')});})[_0x2d03('0x1f')](function(){return _0x44dcc7||null;})[_0x2d03('0x1f')](respondWithResult(_0x52ee2c,null))['catch'](handleError(_0x52ee2c,null));};exports[_0x2d03('0x5d')]=function(_0x13a0ae,_0x192804,_0x1a709a){if(_0x13a0ae[_0x2d03('0x5e')]&&_0x13a0ae[_0x2d03('0x5e')][_0x2d03('0x5f')]){_0x13a0ae['body']['logo']=_0x13a0ae[_0x2d03('0x5e')][_0x2d03('0x5f')];}return db['Setting'][_0x2d03('0x50')]({'where':{'id':_0x13a0ae[_0x2d03('0x4e')]['id']}})[_0x2d03('0x1f')](handleEntityNotFound(_0x192804,null))[_0x2d03('0x1f')](saveUpdates(_0x13a0ae[_0x2d03('0x52')],null))[_0x2d03('0x1f')](respondWithResult(_0x192804,null))['catch'](handleError(_0x192804,null));};exports[_0x2d03('0x60')]=function(_0x5ed159,_0x54e7e1,_0x52d927){if(_0x5ed159['file']&&_0x5ed159[_0x2d03('0x5e')][_0x2d03('0x5f')]){_0x5ed159[_0x2d03('0x52')][_0x2d03('0x61')]=_0x5ed159[_0x2d03('0x5e')]['filename'];}return db[_0x2d03('0x37')]['find']({'where':{'id':_0x5ed159['params']['id']}})[_0x2d03('0x1f')](handleEntityNotFound(_0x54e7e1,null))[_0x2d03('0x1f')](saveUpdates(_0x5ed159[_0x2d03('0x52')],null))['then'](respondWithResult(_0x54e7e1,null))['catch'](handleError(_0x54e7e1,null));};var utilLicense=require(_0x2d03('0x62'));exports['getLogo']=function(_0x412bb4,_0x5cf9dc,_0x20661a){var _0x26fb00=_0x2d03('0x63');var _0x113368={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x14d1b6){if(_0x14d1b6){_0x113368=_0x14d1b6;}return db[_0x2d03('0x37')][_0x2d03('0x50')]({'where':{'id':_0x412bb4[_0x2d03('0x4e')]['id']},'attributes':[_0x2d03('0x64'),_0x2d03('0x61'),_0x2d03('0x65'),'favicon',_0x2d03('0x66'),'defaultLoginLogo',_0x2d03('0x67'),_0x2d03('0x68')],'raw':!![]});})[_0x2d03('0x1f')](handleEntityNotFound(_0x5cf9dc,null))[_0x2d03('0x1f')](function(_0x13e097){if(_0x13e097){var _0x3a56b5=_0x13e097[_0x2d03('0x64')]&&fs[_0x2d03('0x69')](path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x26fb00,_[_0x2d03('0x6b')](_0x13e097[_0x2d03('0x64')])))?path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x26fb00,_[_0x2d03('0x6b')](_0x13e097[_0x2d03('0x64')])):path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x26fb00,_[_0x2d03('0x6b')](_0x2d03('0x6c')));var _0xdd2072='default'+_[_0x2d03('0x6d')](_0x2d03('0x64'));if(_0x13e097[_0xdd2072]||!_0x113368['custom']){_0x3a56b5=path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x26fb00,_['toLower'](_0x2d03('0x6c')));}if(!fs['existsSync'](_0x3a56b5)){throw new db['Sequelize'][(_0x2d03('0x1c'))](_['upperFirst'](_0x2d03('0x64'))+'\x20not\x20found');}return _0x5cf9dc[_0x2d03('0x6e')](_0x3a56b5);}})['catch'](handleError(_0x5cf9dc,null));};var utilLicense=require(_0x2d03('0x62'));exports[_0x2d03('0x6f')]=function(_0x1d6dc0,_0x183ab0,_0x1ba6ad){var _0x1c7825=_0x2d03('0x63');var _0x499511={'custom':![]};return utilLicense[_0x2d03('0x70')]()[_0x2d03('0x1f')](function(_0x10f50f){if(_0x10f50f){_0x499511=_0x10f50f;}return db[_0x2d03('0x37')]['find']({'where':{'id':_0x1d6dc0[_0x2d03('0x4e')]['id']},'attributes':[_0x2d03('0x64'),_0x2d03('0x61'),_0x2d03('0x65'),_0x2d03('0x71'),'defaultLogo','defaultLoginLogo',_0x2d03('0x67'),'defaultFavicon'],'raw':!![]});})[_0x2d03('0x1f')](handleEntityNotFound(_0x183ab0,null))['then'](function(_0x5b1bad){if(_0x5b1bad){var _0x1e4308=_0x5b1bad[_0x2d03('0x61')]&&fs['existsSync'](path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x1c7825,_[_0x2d03('0x6b')](_0x5b1bad[_0x2d03('0x61')])))?path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x1c7825,_[_0x2d03('0x6b')](_0x5b1bad['loginLogo'])):path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x1c7825,_[_0x2d03('0x6b')](_0x2d03('0x72')));var _0x319e64=_0x2d03('0x73')+_[_0x2d03('0x6d')](_0x2d03('0x61'));if(_0x5b1bad[_0x319e64]||!_0x499511[_0x2d03('0x74')]){_0x1e4308=path[_0x2d03('0x55')](config['root'],_0x1c7825,_[_0x2d03('0x6b')](_0x2d03('0x72')));}if(!fs[_0x2d03('0x69')](_0x1e4308)){throw new db[(_0x2d03('0x1b'))][(_0x2d03('0x1c'))](_[_0x2d03('0x6d')](_0x2d03('0x61'))+_0x2d03('0x75'));}return _0x183ab0[_0x2d03('0x6e')](_0x1e4308);}})['catch'](handleError(_0x183ab0,null));};exports['gdpr']=function(_0x52b05c,_0x575e80){return db[_0x2d03('0x37')]['find']({'where':{'id':_0x52b05c['params']['id']},'attributes':[_0x2d03('0x76')]})[_0x2d03('0x1f')](respondWithResult(_0x575e80,null))[_0x2d03('0x28')](handleError(_0x575e80,null));};exports[_0x2d03('0x77')]=function(_0xa52889,_0x3c9228,_0x46360b){if(_0xa52889[_0x2d03('0x5e')]&&_0xa52889[_0x2d03('0x5e')][_0x2d03('0x5f')]){_0xa52889['body'][_0x2d03('0x65')]=_0xa52889[_0x2d03('0x5e')][_0x2d03('0x5f')];}return db[_0x2d03('0x37')]['find']({'where':{'id':_0xa52889[_0x2d03('0x4e')]['id']}})[_0x2d03('0x1f')](handleEntityNotFound(_0x3c9228,null))[_0x2d03('0x1f')](saveUpdates(_0xa52889['body'],null))[_0x2d03('0x1f')](respondWithResult(_0x3c9228,null))[_0x2d03('0x28')](handleError(_0x3c9228,null));};var utilLicense=require('../../config/license/util');exports[_0x2d03('0x78')]=function(_0x28315a,_0x34fc31,_0x36210e){var _0x1a6957=_0x2d03('0x63');var _0x471271={'custom':![]};return utilLicense['getLicense']()[_0x2d03('0x1f')](function(_0x393522){if(_0x393522){_0x471271=_0x393522;}return db[_0x2d03('0x37')][_0x2d03('0x50')]({'where':{'id':_0x28315a[_0x2d03('0x4e')]['id']},'attributes':[_0x2d03('0x64'),_0x2d03('0x61'),_0x2d03('0x65'),_0x2d03('0x71'),_0x2d03('0x66'),_0x2d03('0x79'),_0x2d03('0x67'),_0x2d03('0x68')],'raw':!![]});})[_0x2d03('0x1f')](handleEntityNotFound(_0x34fc31,null))[_0x2d03('0x1f')](function(_0x88e530){if(_0x88e530){var _0x49494f=_0x88e530[_0x2d03('0x65')]&&fs[_0x2d03('0x69')](path['join'](config[_0x2d03('0x6a')],_0x1a6957,_[_0x2d03('0x6b')](_0x88e530[_0x2d03('0x65')])))?path[_0x2d03('0x55')](config['root'],_0x1a6957,_[_0x2d03('0x6b')](_0x88e530[_0x2d03('0x65')])):path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x1a6957,_[_0x2d03('0x6b')](_0x2d03('0x7a')));var _0x315dde=_0x2d03('0x73')+_[_0x2d03('0x6d')]('preferred');if(_0x88e530[_0x315dde]||!_0x471271[_0x2d03('0x74')]||!_0x471271[_0x2d03('0x65')]){_0x49494f=path['join'](config['root'],_0x1a6957,_['toLower'](_0x2d03('0x7a')));}if(!fs[_0x2d03('0x69')](_0x49494f)){throw new db[(_0x2d03('0x1b'))][(_0x2d03('0x1c'))](_['upperFirst'](_0x2d03('0x65'))+'\x20not\x20found');}return _0x34fc31['download'](_0x49494f);}})[_0x2d03('0x28')](handleError(_0x34fc31,null));};exports[_0x2d03('0x7b')]=function(_0x19a3ca,_0x10bb99,_0x8fc0c1){if(_0x19a3ca[_0x2d03('0x5e')]&&_0x19a3ca[_0x2d03('0x5e')][_0x2d03('0x5f')]){_0x19a3ca[_0x2d03('0x52')][_0x2d03('0x71')]=_0x19a3ca[_0x2d03('0x5e')]['filename'];}return db[_0x2d03('0x37')][_0x2d03('0x50')]({'where':{'id':_0x19a3ca[_0x2d03('0x4e')]['id']}})[_0x2d03('0x1f')](handleEntityNotFound(_0x10bb99,null))[_0x2d03('0x1f')](saveUpdates(_0x19a3ca['body'],null))[_0x2d03('0x1f')](respondWithResult(_0x10bb99,null))[_0x2d03('0x28')](handleError(_0x10bb99,null));};var utilLicense=require(_0x2d03('0x62'));exports[_0x2d03('0x7c')]=function(_0x30507a,_0x4135ef,_0x4f5c19){var _0x531622=_0x2d03('0x63');var _0x5d3cdf={'custom':![]};return utilLicense[_0x2d03('0x70')]()[_0x2d03('0x1f')](function(_0x381307){if(_0x381307){_0x5d3cdf=_0x381307;}return db[_0x2d03('0x37')][_0x2d03('0x50')]({'where':{'id':_0x30507a[_0x2d03('0x4e')]['id']},'attributes':[_0x2d03('0x64'),_0x2d03('0x61'),_0x2d03('0x65'),_0x2d03('0x71'),_0x2d03('0x66'),'defaultLoginLogo',_0x2d03('0x67'),_0x2d03('0x68')],'raw':!![]});})[_0x2d03('0x1f')](handleEntityNotFound(_0x4135ef,null))[_0x2d03('0x1f')](function(_0x379328){if(_0x379328){var _0x2c6cbf=_0x379328['favicon']&&fs[_0x2d03('0x69')](path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x531622,_[_0x2d03('0x6b')](_0x379328[_0x2d03('0x71')])))?path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x531622,_[_0x2d03('0x6b')](_0x379328[_0x2d03('0x71')])):path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x531622,_['toLower'](_0x2d03('0x7d')));var _0x1f7666=_0x2d03('0x73')+_[_0x2d03('0x6d')]('favicon');if(_0x379328[_0x1f7666]||!_0x5d3cdf[_0x2d03('0x74')]){_0x2c6cbf=path[_0x2d03('0x55')](config[_0x2d03('0x6a')],_0x531622,_[_0x2d03('0x6b')](_0x2d03('0x7d')));}if(!fs[_0x2d03('0x69')](_0x2c6cbf)){throw new db[(_0x2d03('0x1b'))][(_0x2d03('0x1c'))](_[_0x2d03('0x6d')](_0x2d03('0x71'))+_0x2d03('0x75'));}return _0x4135ef['download'](_0x2c6cbf);}})['catch'](handleError(_0x4135ef,null));}; \ No newline at end of file +var _0x5c79=['favicon','default_loginLogo.png','Sequelize','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','status','json','count','offset','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Setting','include','rows','show','params','includeAll','find','body','get','readFileSync','join','server/files/templates/stun.ejs','render','/etc/asterisk/stun_xcally.conf','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','default_logo.png','default','upperFirst','custom','\x20not\x20found','download','../../config/license/util','getLicense','preferred'];(function(_0xe3e89f,_0x38738e){var _0x5afa39=function(_0x555575){while(--_0x555575){_0xe3e89f['push'](_0xe3e89f['shift']());}};_0x5afa39(++_0x38738e);}(_0x5c79,0x18c));var _0x95c7=function(_0x399d76,_0xdc4493){_0x399d76=_0x399d76-0x0;var _0x3b19a1=_0x5c79[_0x399d76];return _0x3b19a1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x95c7('0x0'));var rimraf=require(_0x95c7('0x1'));var zipdir=require(_0x95c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95c7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x95c7('0x4'));var path=require(_0x95c7('0x5'));var sox=require(_0x95c7('0x6'));var csv=require(_0x95c7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x95c7('0x8'));var squel=require(_0x95c7('0x9'));var crypto=require(_0x95c7('0xa'));var jsforce=require(_0x95c7('0xb'));var deskjs=require(_0x95c7('0xc'));var toCsv=require(_0x95c7('0x7'));var querystring=require(_0x95c7('0xd'));var Papa=require(_0x95c7('0xe'));var Redis=require('ioredis');var authService=require(_0x95c7('0xf'));var qs=require(_0x95c7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95c7('0x11'));var logger=require(_0x95c7('0x12'))(_0x95c7('0x13'));var utils=require('../../config/utils');var config=require(_0x95c7('0x14'));var db=require(_0x95c7('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x95c7('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x56210c,_0x2c8949,_0x1ed03a){if(_0x1ed03a){var _0x1e5dd4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e5dd4[_0x95c7('0x17')](_0x2c8949)){return _0x56210c;}else{throw new db['Sequelize'][(_0x95c7('0x18'))](_0x95c7('0x19'));}}else{return _0x56210c;}}function respondWithRpcPromise(_0x3681bb,_0x2bc977,_0x22e834,_0x48243a){return new BPromise(function(_0x3e37a8,_0x563369){var _0x493a6f=_0x48243a||client;return _0x493a6f[_0x95c7('0x1a')](_0x3681bb,_0x22e834)['then'](function(_0x528840){logger['info']('Setting,\x20%s,\x20%s',_0x2bc977,_0x95c7('0x1b'));logger[_0x95c7('0x1c')]('Setting,\x20%s,\x20%s,\x20%s',_0x2bc977,'request\x20sent',JSON[_0x95c7('0x1d')](_0x528840));if(_0x528840[_0x95c7('0x1e')]){if(_0x528840[_0x95c7('0x1e')][_0x95c7('0x1f')]===0x1f4){logger['error'](_0x95c7('0x20'),_0x2bc977,_0x528840[_0x95c7('0x1e')][_0x95c7('0x21')]);return _0x563369(_0x528840[_0x95c7('0x1e')][_0x95c7('0x21')]);}logger[_0x95c7('0x1e')](_0x95c7('0x20'),_0x2bc977,_0x528840[_0x95c7('0x1e')]['message']);return _0x3e37a8(_0x528840['error'][_0x95c7('0x21')]);}else{logger['info'](_0x95c7('0x20'),_0x2bc977,_0x95c7('0x1b'));_0x3e37a8(_0x528840[_0x95c7('0x22')][_0x95c7('0x21')]);}})[_0x95c7('0x23')](function(_0x70f4ee){logger[_0x95c7('0x1e')](_0x95c7('0x20'),_0x2bc977,_0x70f4ee);_0x563369(_0x70f4ee);});});}function respondWithStatusCode(_0x2dd2e9,_0x937310){_0x937310=_0x937310||0xcc;return function(_0x1e2fef){if(_0x1e2fef){return _0x2dd2e9['sendStatus'](_0x937310);}return _0x2dd2e9['status'](_0x937310)['end']();};}function respondWithResult(_0x3b9b04,_0x2f53f7){_0x2f53f7=_0x2f53f7||0xc8;return function(_0x1e0765){if(_0x1e0765){return _0x3b9b04[_0x95c7('0x24')](_0x2f53f7)[_0x95c7('0x25')](_0x1e0765);}};}function respondWithFilteredResult(_0x515a44,_0x38c8fa){return function(_0x47f300){if(_0x47f300){var _0x49bf3c=_0x47f300[_0x95c7('0x26')],_0x3457b2=_0x38c8fa['offset'],_0x3a262f=_0x38c8fa[_0x95c7('0x27')]+_0x38c8fa['limit'],_0x2e2e6d;if(_0x3a262f>=_0x49bf3c){_0x3a262f=_0x49bf3c;_0x2e2e6d=0xc8;}else{_0x2e2e6d=0xce;}_0x515a44[_0x95c7('0x24')](_0x2e2e6d);return _0x515a44[_0x95c7('0x28')]('Content-Range',_0x3457b2+'-'+_0x3a262f+'/'+_0x49bf3c)[_0x95c7('0x25')](_0x47f300);}return null;};}function patchUpdates(_0x366470){return function(_0x1cf324){try{jsonpatch[_0x95c7('0x29')](_0x1cf324,_0x366470,!![]);}catch(_0x58405c){return BPromise[_0x95c7('0x2a')](_0x58405c);}return _0x1cf324[_0x95c7('0x2b')]();};}function saveUpdates(_0xe7fece,_0x23d716){return function(_0x5ef197){if(_0x5ef197){return _0x5ef197[_0x95c7('0x2c')](_0xe7fece)[_0x95c7('0x2d')](function(_0xb64ddf){return _0xb64ddf;});}return null;};}function removeEntity(_0x1fb692,_0x403043){return function(_0x5d8226){if(_0x5d8226){return _0x5d8226[_0x95c7('0x2e')]()['then'](function(){_0x1fb692[_0x95c7('0x24')](0xcc)[_0x95c7('0x2f')]();});}};}function handleEntityNotFound(_0xdb9613,_0x13002e){return function(_0x20120f){if(!_0x20120f){_0xdb9613[_0x95c7('0x30')](0x194);}return _0x20120f;};}function handleError(_0x480e69,_0x809cc5){_0x809cc5=_0x809cc5||0x1f4;return function(_0xc00f04){logger['error'](_0xc00f04[_0x95c7('0x31')]);if(_0xc00f04[_0x95c7('0x32')]){delete _0xc00f04['name'];}_0x480e69[_0x95c7('0x24')](_0x809cc5)[_0x95c7('0x33')](_0xc00f04);};}exports[_0x95c7('0x34')]=function(_0x34d99d,_0x1f8b53){var _0x27b5b9={},_0xbea19e={},_0x3b6f06={'count':0x0,'rows':[]};var _0x2277d6=_[_0x95c7('0x35')](db['Setting'][_0x95c7('0x36')],function(_0x2aa7ae){return{'name':_0x2aa7ae['fieldName'],'type':_0x2aa7ae[_0x95c7('0x37')][_0x95c7('0x38')]};});_0xbea19e[_0x95c7('0x39')]=_[_0x95c7('0x35')](_0x2277d6,'name');_0xbea19e[_0x95c7('0x3a')]=_[_0x95c7('0x3b')](_0x34d99d[_0x95c7('0x3a')]);_0xbea19e['filters']=_[_0x95c7('0x3c')](_0xbea19e[_0x95c7('0x39')],_0xbea19e[_0x95c7('0x3a')]);_0x27b5b9['attributes']=_[_0x95c7('0x3c')](_0xbea19e['model'],qs[_0x95c7('0x3d')](_0x34d99d[_0x95c7('0x3a')][_0x95c7('0x3d')]));_0x27b5b9[_0x95c7('0x3e')]=_0x27b5b9[_0x95c7('0x3e')][_0x95c7('0x3f')]?_0x27b5b9[_0x95c7('0x3e')]:_0xbea19e[_0x95c7('0x39')];if(!_0x34d99d[_0x95c7('0x3a')][_0x95c7('0x40')]('nolimit')){_0x27b5b9['limit']=qs[_0x95c7('0x41')](_0x34d99d[_0x95c7('0x3a')]['limit']);_0x27b5b9[_0x95c7('0x27')]=qs['offset'](_0x34d99d[_0x95c7('0x3a')]['offset']);}_0x27b5b9[_0x95c7('0x42')]=qs[_0x95c7('0x43')](_0x34d99d['query'][_0x95c7('0x43')]);_0x27b5b9['where']=qs[_0x95c7('0x44')](_[_0x95c7('0x45')](_0x34d99d['query'],_0xbea19e[_0x95c7('0x44')]));if(_0x34d99d['query'][_0x95c7('0x46')]){_0x27b5b9[_0x95c7('0x47')]=_[_0x95c7('0x48')](_0x27b5b9[_0x95c7('0x47')],{'$or':_[_0x95c7('0x35')](_0x2277d6,function(_0x48aef5){if(_0x48aef5[_0x95c7('0x37')]!==_0x95c7('0x49')){var _0x40970c={};_0x40970c[_0x48aef5['name']]={'$like':'%'+_0x34d99d[_0x95c7('0x3a')]['filter']+'%'};return _0x40970c;}})});}_0x27b5b9=_['merge']({},_0x27b5b9,_0x34d99d[_0x95c7('0x4a')]);var _0x162531={'where':_0x27b5b9[_0x95c7('0x47')]};return db[_0x95c7('0x4b')][_0x95c7('0x26')](_0x162531)[_0x95c7('0x2d')](function(_0x1272ae){_0x3b6f06[_0x95c7('0x26')]=_0x1272ae;if(_0x34d99d[_0x95c7('0x3a')]['includeAll']){_0x27b5b9[_0x95c7('0x4c')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x27b5b9);})['then'](function(_0x21e90e){_0x3b6f06[_0x95c7('0x4d')]=_0x21e90e;return _0x3b6f06;})['then'](respondWithFilteredResult(_0x1f8b53,_0x27b5b9))[_0x95c7('0x23')](handleError(_0x1f8b53,null));};exports[_0x95c7('0x4e')]=function(_0x33e9e0,_0x5cb787){var _0x1da8a0={'raw':![],'where':{'id':_0x33e9e0[_0x95c7('0x4f')]['id']}},_0x2a4670={};_0x2a4670[_0x95c7('0x39')]=_[_0x95c7('0x3b')](db[_0x95c7('0x4b')][_0x95c7('0x36')]);_0x2a4670['query']=_[_0x95c7('0x3b')](_0x33e9e0['query']);_0x2a4670[_0x95c7('0x44')]=_[_0x95c7('0x3c')](_0x2a4670[_0x95c7('0x39')],_0x2a4670[_0x95c7('0x3a')]);_0x1da8a0['attributes']=_[_0x95c7('0x3c')](_0x2a4670[_0x95c7('0x39')],qs[_0x95c7('0x3d')](_0x33e9e0[_0x95c7('0x3a')]['fields']));_0x1da8a0[_0x95c7('0x3e')]=_0x1da8a0['attributes'][_0x95c7('0x3f')]?_0x1da8a0[_0x95c7('0x3e')]:_0x2a4670[_0x95c7('0x39')];if(_0x33e9e0[_0x95c7('0x3a')][_0x95c7('0x50')]){_0x1da8a0['include']=[{'all':!![]}];}_0x1da8a0=_[_0x95c7('0x48')]({},_0x1da8a0,_0x33e9e0['options']);return db[_0x95c7('0x4b')][_0x95c7('0x51')](_0x1da8a0)[_0x95c7('0x2d')](handleEntityNotFound(_0x5cb787,null))[_0x95c7('0x2d')](respondWithResult(_0x5cb787,null))[_0x95c7('0x23')](handleError(_0x5cb787,null));};exports['update']=function(_0x34d894,_0x1da914,_0x43cd7d){var _0x275f91;return db[_0x95c7('0x4b')]['find']({'where':{'id':_0x34d894['params']['id']}})[_0x95c7('0x2d')](handleEntityNotFound(_0x1da914,null))[_0x95c7('0x2d')](saveUpdates(_0x34d894[_0x95c7('0x52')],null))['then'](function(_0x5df94f){if(_0x5df94f){_0x275f91=_0x5df94f[_0x95c7('0x53')]({'plain':!![]});var _0x297fd9=fs[_0x95c7('0x54')](path[_0x95c7('0x55')](config['root'],_0x95c7('0x56')),'utf8');var _0x4a1823=ejs[_0x95c7('0x57')](_0x297fd9,_0x275f91);var _0x58fc68=fs[_0x95c7('0x54')](path[_0x95c7('0x55')](config['root'],'server/files/templates/turn.ejs'),'utf8');var _0x1a77e5=ejs[_0x95c7('0x57')](_0x58fc68,_0x275f91);fs['writeFileSync'](_0x95c7('0x58'),_0x4a1823);fs[_0x95c7('0x59')](_0x95c7('0x5a'),_0x1a77e5);return respondWithRpcPromise(_0x95c7('0x5b'),_0x95c7('0x2c'),{'module':_0x95c7('0x5c')});}})[_0x95c7('0x2d')](function(){return respondWithRpcPromise(_0x95c7('0x5b'),'update',{'module':_0x95c7('0x5d')});})[_0x95c7('0x2d')](function(){return _0x275f91||null;})['then'](respondWithResult(_0x1da914,null))[_0x95c7('0x23')](handleError(_0x1da914,null));};exports['addLogo']=function(_0x156022,_0x584d43,_0x482f6d){if(_0x156022[_0x95c7('0x5e')]&&_0x156022[_0x95c7('0x5e')][_0x95c7('0x5f')]){_0x156022[_0x95c7('0x52')]['logo']=_0x156022['file'][_0x95c7('0x5f')];}return db[_0x95c7('0x4b')][_0x95c7('0x51')]({'where':{'id':_0x156022[_0x95c7('0x4f')]['id']}})[_0x95c7('0x2d')](handleEntityNotFound(_0x584d43,null))[_0x95c7('0x2d')](saveUpdates(_0x156022[_0x95c7('0x52')],null))[_0x95c7('0x2d')](respondWithResult(_0x584d43,null))[_0x95c7('0x23')](handleError(_0x584d43,null));};exports[_0x95c7('0x60')]=function(_0xbb9dfe,_0x136113,_0x436f9f){if(_0xbb9dfe['file']&&_0xbb9dfe[_0x95c7('0x5e')][_0x95c7('0x5f')]){_0xbb9dfe[_0x95c7('0x52')][_0x95c7('0x61')]=_0xbb9dfe['file']['filename'];}return db[_0x95c7('0x4b')][_0x95c7('0x51')]({'where':{'id':_0xbb9dfe[_0x95c7('0x4f')]['id']}})[_0x95c7('0x2d')](handleEntityNotFound(_0x136113,null))[_0x95c7('0x2d')](saveUpdates(_0xbb9dfe['body'],null))[_0x95c7('0x2d')](respondWithResult(_0x136113,null))[_0x95c7('0x23')](handleError(_0x136113,null));};var utilLicense=require('../../config/license/util');exports[_0x95c7('0x62')]=function(_0x31c27b,_0x2e6b5b,_0x33d083){var _0xa7e00=_0x95c7('0x63');var _0x273232={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x117061){if(_0x117061){_0x273232=_0x117061;}return db[_0x95c7('0x4b')][_0x95c7('0x51')]({'where':{'id':_0x31c27b[_0x95c7('0x4f')]['id']},'attributes':[_0x95c7('0x64'),_0x95c7('0x61'),'preferred','favicon',_0x95c7('0x65'),_0x95c7('0x66'),'defaultPreferred',_0x95c7('0x67')],'raw':!![]});})[_0x95c7('0x2d')](handleEntityNotFound(_0x2e6b5b,null))[_0x95c7('0x2d')](function(_0x36cb1b){if(_0x36cb1b){var _0x287952=_0x36cb1b[_0x95c7('0x64')]&&fs[_0x95c7('0x68')](path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0xa7e00,_[_0x95c7('0x6a')](_0x36cb1b[_0x95c7('0x64')])))?path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0xa7e00,_['toLower'](_0x36cb1b['logo'])):path['join'](config[_0x95c7('0x69')],_0xa7e00,_['toLower'](_0x95c7('0x6b')));var _0x9caed8=_0x95c7('0x6c')+_[_0x95c7('0x6d')](_0x95c7('0x64'));if(_0x36cb1b[_0x9caed8]||!_0x273232[_0x95c7('0x6e')]){_0x287952=path[_0x95c7('0x55')](config['root'],_0xa7e00,_[_0x95c7('0x6a')](_0x95c7('0x6b')));}if(!fs[_0x95c7('0x68')](_0x287952)){throw new db['Sequelize']['ValidationError'](_[_0x95c7('0x6d')](_0x95c7('0x64'))+_0x95c7('0x6f'));}return _0x2e6b5b[_0x95c7('0x70')](_0x287952);}})['catch'](handleError(_0x2e6b5b,null));};var utilLicense=require(_0x95c7('0x71'));exports['getLogoLogin']=function(_0x429c22,_0x5a7189,_0x2dac96){var _0x13f637=_0x95c7('0x63');var _0x5287e0={'custom':![]};return utilLicense[_0x95c7('0x72')]()[_0x95c7('0x2d')](function(_0x86a4c1){if(_0x86a4c1){_0x5287e0=_0x86a4c1;}return db[_0x95c7('0x4b')][_0x95c7('0x51')]({'where':{'id':_0x429c22[_0x95c7('0x4f')]['id']},'attributes':['logo',_0x95c7('0x61'),_0x95c7('0x73'),_0x95c7('0x74'),_0x95c7('0x65'),_0x95c7('0x66'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5a7189,null))[_0x95c7('0x2d')](function(_0x3aa794){if(_0x3aa794){var _0x50fe14=_0x3aa794[_0x95c7('0x61')]&&fs[_0x95c7('0x68')](path['join'](config['root'],_0x13f637,_['toLower'](_0x3aa794[_0x95c7('0x61')])))?path['join'](config[_0x95c7('0x69')],_0x13f637,_[_0x95c7('0x6a')](_0x3aa794[_0x95c7('0x61')])):path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0x13f637,_[_0x95c7('0x6a')](_0x95c7('0x75')));var _0x4756b5=_0x95c7('0x6c')+_[_0x95c7('0x6d')](_0x95c7('0x61'));if(_0x3aa794[_0x4756b5]||!_0x5287e0[_0x95c7('0x6e')]){_0x50fe14=path['join'](config[_0x95c7('0x69')],_0x13f637,_[_0x95c7('0x6a')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x50fe14)){throw new db[(_0x95c7('0x76'))][(_0x95c7('0x18'))](_[_0x95c7('0x6d')](_0x95c7('0x61'))+_0x95c7('0x6f'));}return _0x5a7189[_0x95c7('0x70')](_0x50fe14);}})['catch'](handleError(_0x5a7189,null));};exports[_0x95c7('0x77')]=function(_0x1919d5,_0x5653ef){return db[_0x95c7('0x4b')][_0x95c7('0x51')]({'where':{'id':_0x1919d5[_0x95c7('0x4f')]['id']},'attributes':[_0x95c7('0x78')]})[_0x95c7('0x2d')](respondWithResult(_0x5653ef,null))[_0x95c7('0x23')](handleError(_0x5653ef,null));};exports[_0x95c7('0x79')]=function(_0x394f7a,_0x502614,_0x50017b){if(_0x394f7a[_0x95c7('0x5e')]&&_0x394f7a[_0x95c7('0x5e')][_0x95c7('0x5f')]){_0x394f7a[_0x95c7('0x52')]['preferred']=_0x394f7a[_0x95c7('0x5e')]['filename'];}return db[_0x95c7('0x4b')][_0x95c7('0x51')]({'where':{'id':_0x394f7a['params']['id']}})[_0x95c7('0x2d')](handleEntityNotFound(_0x502614,null))[_0x95c7('0x2d')](saveUpdates(_0x394f7a[_0x95c7('0x52')],null))[_0x95c7('0x2d')](respondWithResult(_0x502614,null))['catch'](handleError(_0x502614,null));};var utilLicense=require(_0x95c7('0x71'));exports[_0x95c7('0x7a')]=function(_0x4528a7,_0x33fdbc,_0x1684aa){var _0x2071b3='server/files/images/logos';var _0x459ac3={'custom':![]};return utilLicense[_0x95c7('0x72')]()[_0x95c7('0x2d')](function(_0x4de86f){if(_0x4de86f){_0x459ac3=_0x4de86f;}return db['Setting'][_0x95c7('0x51')]({'where':{'id':_0x4528a7[_0x95c7('0x4f')]['id']},'attributes':['logo',_0x95c7('0x61'),'preferred',_0x95c7('0x74'),_0x95c7('0x65'),'defaultLoginLogo',_0x95c7('0x7b'),_0x95c7('0x67')],'raw':!![]});})[_0x95c7('0x2d')](handleEntityNotFound(_0x33fdbc,null))[_0x95c7('0x2d')](function(_0x21408b){if(_0x21408b){var _0x10e872=_0x21408b[_0x95c7('0x73')]&&fs[_0x95c7('0x68')](path[_0x95c7('0x55')](config['root'],_0x2071b3,_[_0x95c7('0x6a')](_0x21408b['preferred'])))?path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0x2071b3,_[_0x95c7('0x6a')](_0x21408b['preferred'])):path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0x2071b3,_[_0x95c7('0x6a')](_0x95c7('0x7c')));var _0x8b8a8a=_0x95c7('0x6c')+_[_0x95c7('0x6d')](_0x95c7('0x73'));if(_0x21408b[_0x8b8a8a]||!_0x459ac3[_0x95c7('0x6e')]||!_0x459ac3[_0x95c7('0x73')]){_0x10e872=path['join'](config[_0x95c7('0x69')],_0x2071b3,_[_0x95c7('0x6a')](_0x95c7('0x7c')));}if(!fs[_0x95c7('0x68')](_0x10e872)){throw new db[(_0x95c7('0x76'))][(_0x95c7('0x18'))](_[_0x95c7('0x6d')](_0x95c7('0x73'))+_0x95c7('0x6f'));}return _0x33fdbc[_0x95c7('0x70')](_0x10e872);}})[_0x95c7('0x23')](handleError(_0x33fdbc,null));};exports[_0x95c7('0x7d')]=function(_0x46fefc,_0x2de28e,_0x47153b){if(_0x46fefc['file']&&_0x46fefc[_0x95c7('0x5e')][_0x95c7('0x5f')]){_0x46fefc[_0x95c7('0x52')][_0x95c7('0x74')]=_0x46fefc[_0x95c7('0x5e')][_0x95c7('0x5f')];}return db[_0x95c7('0x4b')][_0x95c7('0x51')]({'where':{'id':_0x46fefc[_0x95c7('0x4f')]['id']}})[_0x95c7('0x2d')](handleEntityNotFound(_0x2de28e,null))[_0x95c7('0x2d')](saveUpdates(_0x46fefc[_0x95c7('0x52')],null))[_0x95c7('0x2d')](respondWithResult(_0x2de28e,null))[_0x95c7('0x23')](handleError(_0x2de28e,null));};var utilLicense=require(_0x95c7('0x71'));exports[_0x95c7('0x7e')]=function(_0x2b7e47,_0x7a5c3,_0x1fb4c0){var _0x1350e7=_0x95c7('0x63');var _0x5f2eca={'custom':![]};return utilLicense[_0x95c7('0x72')]()[_0x95c7('0x2d')](function(_0x254065){if(_0x254065){_0x5f2eca=_0x254065;}return db[_0x95c7('0x4b')][_0x95c7('0x51')]({'where':{'id':_0x2b7e47[_0x95c7('0x4f')]['id']},'attributes':[_0x95c7('0x64'),'loginLogo',_0x95c7('0x73'),_0x95c7('0x74'),_0x95c7('0x65'),_0x95c7('0x66'),_0x95c7('0x7b'),_0x95c7('0x67')],'raw':!![]});})[_0x95c7('0x2d')](handleEntityNotFound(_0x7a5c3,null))[_0x95c7('0x2d')](function(_0x552fc3){if(_0x552fc3){var _0x2524f5=_0x552fc3[_0x95c7('0x74')]&&fs[_0x95c7('0x68')](path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0x1350e7,_['toLower'](_0x552fc3[_0x95c7('0x74')])))?path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0x1350e7,_['toLower'](_0x552fc3[_0x95c7('0x74')])):path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0x1350e7,_['toLower'](_0x95c7('0x7f')));var _0x382a8f=_0x95c7('0x6c')+_[_0x95c7('0x6d')](_0x95c7('0x74'));if(_0x552fc3[_0x382a8f]||!_0x5f2eca[_0x95c7('0x6e')]){_0x2524f5=path[_0x95c7('0x55')](config[_0x95c7('0x69')],_0x1350e7,_['toLower'](_0x95c7('0x7f')));}if(!fs[_0x95c7('0x68')](_0x2524f5)){throw new db[(_0x95c7('0x76'))]['ValidationError'](_[_0x95c7('0x6d')](_0x95c7('0x74'))+_0x95c7('0x6f'));}return _0x7a5c3['download'](_0x2524f5);}})['catch'](handleError(_0x7a5c3,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index a614b3b..abaf92f 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9af5=['path','../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','util','api','bluebird','request-promise'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x9af5,0x1f3));var _0x59af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9af5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x59af('0x0'));var util=require(_0x59af('0x1'));var logger=require('../../config/logger')(_0x59af('0x2'));var moment=require('moment');var BPromise=require(_0x59af('0x3'));var rp=require(_0x59af('0x4'));var fs=require('fs');var path=require(_0x59af('0x5'));var rimraf=require('rimraf');var config=require(_0x59af('0x6'));var attributes=require(_0x59af('0x7'));module[_0x59af('0x8')]=function(_0x531f6d,_0x4f354a){return _0x531f6d[_0x59af('0x9')](_0x59af('0xa'),attributes,{'tableName':_0x59af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a35=['util','../../config/logger','bluebird','path','rimraf','./setting.attributes','exports','Setting','settings','lodash'];(function(_0x398559,_0x88773d){var _0x405eab=function(_0x165c58){while(--_0x165c58){_0x398559['push'](_0x398559['shift']());}};_0x405eab(++_0x88773d);}(_0x2a35,0x18f));var _0x52a3=function(_0x19d161,_0x45f161){_0x19d161=_0x19d161-0x0;var _0x794ee3=_0x2a35[_0x19d161];return _0x794ee3;};'use strict';var _=require(_0x52a3('0x0'));var util=require(_0x52a3('0x1'));var logger=require(_0x52a3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x52a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52a3('0x4'));var rimraf=require(_0x52a3('0x5'));var config=require('../../config/environment');var attributes=require(_0x52a3('0x6'));module[_0x52a3('0x7')]=function(_0x4a7161,_0x12b591){return _0x4a7161['define'](_0x52a3('0x8'),attributes,{'tableName':_0x52a3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 5bdcc57..9925640 100644 --- a/server/api/setting/setting.rpc.js +++ b/server/api/setting/setting.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa31a=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment'];(function(_0x6731ab,_0x34e2be){var _0x9bae32=function(_0x3dc3f1){while(--_0x3dc3f1){_0x6731ab['push'](_0x6731ab['shift']());}};_0x9bae32(++_0x34e2be);}(_0xa31a,0xd1));var _0xaa31=function(_0x3758a2,_0x2136dc){_0x3758a2=_0x3758a2-0x0;var _0xd4ab71=_0xa31a[_0x3758a2];return _0xd4ab71;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa31('0x0'));var BPromise=require(_0xaa31('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa31('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa31('0x3'));var logger=require(_0xaa31('0x4'))(_0xaa31('0x5'));var config=require('../../config/environment');var jayson=require(_0xaa31('0x6'));var client=jayson[_0xaa31('0x7')][_0xaa31('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ea02a,_0x2d1827,_0x5edd86){return new BPromise(function(_0x22d380,_0x1e8334){return client['request'](_0x1ea02a,_0x5edd86)[_0xaa31('0x9')](function(_0x433bca){logger['info'](_0xaa31('0xa'),_0x2d1827,'request\x20sent');logger[_0xaa31('0xb')](_0xaa31('0xc'),_0x2d1827,_0xaa31('0xd'),JSON[_0xaa31('0xe')](_0x433bca));if(_0x433bca[_0xaa31('0xf')]){if(_0x433bca['error'][_0xaa31('0x10')]===0x1f4){logger[_0xaa31('0xf')](_0xaa31('0xa'),_0x2d1827,_0x433bca[_0xaa31('0xf')][_0xaa31('0x11')]);return _0x1e8334(_0x433bca[_0xaa31('0xf')][_0xaa31('0x11')]);}logger['error'](_0xaa31('0xa'),_0x2d1827,_0x433bca[_0xaa31('0xf')][_0xaa31('0x11')]);return _0x22d380(_0x433bca['error'][_0xaa31('0x11')]);}else{logger[_0xaa31('0x12')]('Setting,\x20%s,\x20%s',_0x2d1827,_0xaa31('0xd'));_0x22d380(_0x433bca[_0xaa31('0x13')][_0xaa31('0x11')]);}})[_0xaa31('0x14')](function(_0xbb3873){logger[_0xaa31('0xf')](_0xaa31('0xa'),_0x2d1827,_0xbb3873);_0x1e8334(_0xbb3873);});});} \ No newline at end of file +var _0xf151=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e71ba,_0x19afd7){var _0x290751=function(_0x4ab19c){while(--_0x4ab19c){_0x3e71ba['push'](_0x3e71ba['shift']());}};_0x290751(++_0x19afd7);}(_0xf151,0x94));var _0x1f15=function(_0x5fb5,_0x5d329e){_0x5fb5=_0x5fb5-0x0;var _0x77d6f=_0xf151[_0x5fb5];return _0x77d6f;};'use strict';var _=require(_0x1f15('0x0'));var util=require(_0x1f15('0x1'));var moment=require(_0x1f15('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f15('0x3'));var fs=require('fs');var Redis=require(_0x1f15('0x4'));var db=require(_0x1f15('0x5'))['db'];var utils=require(_0x1f15('0x6'));var logger=require(_0x1f15('0x7'))(_0x1f15('0x8'));var config=require(_0x1f15('0x9'));var jayson=require(_0x1f15('0xa'));var client=jayson[_0x1f15('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22eb8c,_0x207044,_0x2acc58){return new BPromise(function(_0x1d2c79,_0x4d949a){return client[_0x1f15('0xc')](_0x22eb8c,_0x2acc58)[_0x1f15('0xd')](function(_0x2bd2a9){logger['info'](_0x1f15('0xe'),_0x207044,_0x1f15('0xf'));logger['debug'](_0x1f15('0x10'),_0x207044,'request\x20sent',JSON[_0x1f15('0x11')](_0x2bd2a9));if(_0x2bd2a9[_0x1f15('0x12')]){if(_0x2bd2a9[_0x1f15('0x12')][_0x1f15('0x13')]===0x1f4){logger['error'](_0x1f15('0xe'),_0x207044,_0x2bd2a9[_0x1f15('0x12')][_0x1f15('0x14')]);return _0x4d949a(_0x2bd2a9[_0x1f15('0x12')][_0x1f15('0x14')]);}logger[_0x1f15('0x12')]('Setting,\x20%s,\x20%s',_0x207044,_0x2bd2a9[_0x1f15('0x12')][_0x1f15('0x14')]);return _0x1d2c79(_0x2bd2a9['error'][_0x1f15('0x14')]);}else{logger[_0x1f15('0x15')](_0x1f15('0xe'),_0x207044,'request\x20sent');_0x1d2c79(_0x2bd2a9[_0x1f15('0x16')][_0x1f15('0x14')]);}})[_0x1f15('0x17')](function(_0x1c09df){logger[_0x1f15('0x12')](_0x1f15('0xe'),_0x207044,_0x1c09df);_0x4d949a(_0x1c09df);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 81ee734..302c51a 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa992=['/:id/users','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','create','post','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','status'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa992,0x18c));var _0x2a99=function(_0x996ee7,_0x54fefe){_0x996ee7=_0x996ee7-0x0;var _0x54e031=_0xa992[_0x996ee7];return _0x54e031;};'use strict';var multer=require(_0x2a99('0x0'));var util=require(_0x2a99('0x1'));var path=require(_0x2a99('0x2'));var timeout=require(_0x2a99('0x3'));var express=require('express');var router=express[_0x2a99('0x4')]();var auth=require(_0x2a99('0x5'));var interaction=require(_0x2a99('0x6'));var config=require(_0x2a99('0x7'));var controller=require(_0x2a99('0x8'));router[_0x2a99('0x9')]('/',auth[_0x2a99('0xa')](),controller[_0x2a99('0xb')]);router[_0x2a99('0x9')](_0x2a99('0xc'),auth['isAuthenticated'](),controller[_0x2a99('0xd')]);router[_0x2a99('0x9')](_0x2a99('0xe'),auth[_0x2a99('0xa')](),controller[_0x2a99('0xf')]);router[_0x2a99('0x9')](_0x2a99('0x10'),auth[_0x2a99('0xa')](),controller[_0x2a99('0x11')]);router[_0x2a99('0x9')](_0x2a99('0x12'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x2a99('0x9')](_0x2a99('0x13'),auth[_0x2a99('0xa')](),controller[_0x2a99('0x14')]);router[_0x2a99('0x9')](_0x2a99('0x15'),auth['isAuthenticated'](),controller[_0x2a99('0x16')]);router[_0x2a99('0x9')](_0x2a99('0x17'),controller[_0x2a99('0x18')]);router[_0x2a99('0x9')]('/:id/users',auth[_0x2a99('0xa')](),controller['getAgents']);router['post']('/',auth[_0x2a99('0xa')](),controller[_0x2a99('0x19')]);router[_0x2a99('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x2a99('0x1a')](_0x2a99('0x12'),auth['isAuthenticated'](),controller[_0x2a99('0x1b')]);router[_0x2a99('0x1a')](_0x2a99('0x1c'),controller[_0x2a99('0x1d')]);router['post'](_0x2a99('0x13'),auth[_0x2a99('0xa')](),controller[_0x2a99('0x1e')]);router[_0x2a99('0x1a')](_0x2a99('0x1f'),auth['isAuthenticated'](),controller[_0x2a99('0x20')]);router[_0x2a99('0x1a')](_0x2a99('0x17'),controller[_0x2a99('0x21')]);router[_0x2a99('0x1a')](_0x2a99('0x22'),auth[_0x2a99('0xa')](),controller[_0x2a99('0x23')]);router[_0x2a99('0x24')](_0x2a99('0xe'),auth['isAuthenticated'](),controller[_0x2a99('0x25')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2a99('0x26')]);router['delete']('/:id/dispositions',auth[_0x2a99('0xa')](),controller['removeDispositions']);router[_0x2a99('0x27')](_0x2a99('0x12'),auth[_0x2a99('0xa')](),controller[_0x2a99('0x28')]);router[_0x2a99('0x27')](_0x2a99('0x22'),auth[_0x2a99('0xa')](),controller[_0x2a99('0x29')]);module[_0x2a99('0x2a')]=router; \ No newline at end of file +var _0x5e03=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','/:id/notify','notify','addApplications','/:id/send','/:id/status','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x484812,_0x3e0004){var _0x19cf8e=function(_0x13d7d4){while(--_0x13d7d4){_0x484812['push'](_0x484812['shift']());}};_0x19cf8e(++_0x3e0004);}(_0x5e03,0xbf));var _0x35e0=function(_0x103968,_0x16dfd0){_0x103968=_0x103968-0x0;var _0x1783d9=_0x5e03[_0x103968];return _0x1783d9;};'use strict';var multer=require('multer');var util=require(_0x35e0('0x0'));var path=require(_0x35e0('0x1'));var timeout=require(_0x35e0('0x2'));var express=require(_0x35e0('0x3'));var router=express[_0x35e0('0x4')]();var auth=require(_0x35e0('0x5'));var interaction=require(_0x35e0('0x6'));var config=require(_0x35e0('0x7'));var controller=require(_0x35e0('0x8'));router['get']('/',auth[_0x35e0('0x9')](),controller[_0x35e0('0xa')]);router[_0x35e0('0xb')](_0x35e0('0xc'),auth[_0x35e0('0x9')](),controller[_0x35e0('0xd')]);router[_0x35e0('0xb')](_0x35e0('0xe'),auth[_0x35e0('0x9')](),controller[_0x35e0('0xf')]);router['get'](_0x35e0('0x10'),auth[_0x35e0('0x9')](),controller[_0x35e0('0x11')]);router[_0x35e0('0xb')](_0x35e0('0x12'),auth[_0x35e0('0x9')](),controller[_0x35e0('0x13')]);router[_0x35e0('0xb')](_0x35e0('0x14'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35e0('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x35e0('0x15')]);router[_0x35e0('0xb')]('/:id/status',controller['statusGet']);router[_0x35e0('0xb')](_0x35e0('0x16'),auth[_0x35e0('0x9')](),controller[_0x35e0('0x17')]);router[_0x35e0('0x18')]('/',auth[_0x35e0('0x9')](),controller[_0x35e0('0x19')]);router[_0x35e0('0x18')](_0x35e0('0x10'),auth[_0x35e0('0x9')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x35e0('0x9')](),controller['addAnswer']);router['post'](_0x35e0('0x1a'),controller[_0x35e0('0x1b')]);router[_0x35e0('0x18')](_0x35e0('0x14'),auth['isAuthenticated'](),controller[_0x35e0('0x1c')]);router[_0x35e0('0x18')](_0x35e0('0x1d'),auth[_0x35e0('0x9')](),controller['send']);router[_0x35e0('0x18')](_0x35e0('0x1e'),controller['status']);router['post'](_0x35e0('0x16'),auth[_0x35e0('0x9')](),controller[_0x35e0('0x1f')]);router[_0x35e0('0x20')](_0x35e0('0xe'),auth[_0x35e0('0x9')](),controller[_0x35e0('0x21')]);router[_0x35e0('0x22')](_0x35e0('0xe'),auth['isAuthenticated'](),controller[_0x35e0('0x23')]);router[_0x35e0('0x22')](_0x35e0('0x10'),auth[_0x35e0('0x9')](),controller['removeDispositions']);router[_0x35e0('0x22')]('/:id/canned_answers',auth[_0x35e0('0x9')](),controller[_0x35e0('0x24')]);router[_0x35e0('0x22')]('/:id/users',auth[_0x35e0('0x9')](),controller[_0x35e0('0x25')]);module[_0x35e0('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ac5240f..f4c6d9c 100644 --- a/server/api/smsAccount/smsAccount.attributes.js +++ b/server/api/smsAccount/smsAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee54=['plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','connectel','clicksend'];(function(_0x2bddf9,_0x22c873){var _0x3f3ae9=function(_0x2d91ac){while(--_0x2d91ac){_0x2bddf9['push'](_0x2bddf9['shift']());}};_0x3f3ae9(++_0x22c873);}(_0xee54,0x1f0));var _0x4ee5=function(_0x5d085e,_0xf12fac){_0x5d085e=_0x5d085e-0x0;var _0x19189f=_0xee54[_0x5d085e];return _0x19189f;};'use strict';var Sequelize=require(_0x4ee5('0x0'));var rs=require(_0x4ee5('0x1'));module[_0x4ee5('0x2')]={'name':{'type':Sequelize[_0x4ee5('0x3')],'unique':_0x4ee5('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x4ee5('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x4ee5('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x4ee5('0x3')],'defaultValue':function(){return rs[_0x4ee5('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4ee5('0x6')](_0x4ee5('0x7'),'skebby',_0x4ee5('0x8'),_0x4ee5('0x9'),_0x4ee5('0xa'),_0x4ee5('0xb'),_0x4ee5('0xc'),_0x4ee5('0xd'),_0x4ee5('0xe'))},'accountSid':{'type':Sequelize[_0x4ee5('0x3')]},'authId':{'type':Sequelize[_0x4ee5('0x3')]},'authToken':{'type':Sequelize[_0x4ee5('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x4ee5('0x3')]},'password':{'type':Sequelize[_0x4ee5('0x3')]},'apiKey':{'type':Sequelize[_0x4ee5('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x4ee5('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x4ee5('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4ee5('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4ee5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4ee5('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4ee5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4ee5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x4ee5('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x4ee5('0xf')],'defaultValue':![],'comment':_0x4ee5('0x12'),'set':function(_0x201862){if(!_0x201862)this[_0x4ee5('0x13')](_0x4ee5('0x14'),null);this[_0x4ee5('0x13')](_0x4ee5('0x15'),_0x201862);}}}; \ No newline at end of file +var _0xbf6b=['BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','clicksend','plivo','clickatell','csc','infobip','intelepeer'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xbf6b,0x194));var _0xbbf6=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xbf6b[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xbbf6('0x0'));var rs=require(_0xbbf6('0x1'));module[_0xbbf6('0x2')]={'name':{'type':Sequelize[_0xbbf6('0x3')],'unique':_0xbbf6('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xbbf6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xbbf6('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xbbf6('0x3')]},'type':{'type':Sequelize[_0xbbf6('0x5')](_0xbbf6('0x6'),_0xbbf6('0x7'),'connectel',_0xbbf6('0x8'),_0xbbf6('0x9'),_0xbbf6('0xa'),_0xbbf6('0xb'),_0xbbf6('0xc'),_0xbbf6('0xd'))},'accountSid':{'type':Sequelize[_0xbbf6('0x3')]},'authId':{'type':Sequelize[_0xbbf6('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xbbf6('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xbbf6('0x3')]},'password':{'type':Sequelize[_0xbbf6('0x3')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xbbf6('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xbbf6('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbbf6('0xf');}},'notificationSound':{'type':Sequelize[_0xbbf6('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbbf6('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbbf6('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbbf6('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbbf6('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbbf6('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbbf6('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xbbf6('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xbbf6('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbbf6('0x12'),'set':function(_0x3ab554){if(!_0x3ab554)this[_0xbbf6('0x13')](_0xbbf6('0x14'),null);this[_0xbbf6('0x13')](_0xbbf6('0x15'),_0x3ab554);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index d277319..d8763a5 100644 --- a/server/api/smsAccount/smsAccount.controller.js +++ b/server/api/smsAccount/smsAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4674=['result','sendStatus','status','end','json','count','offset','set','apply','reject','destroy','SmsAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','pick','removeDispositions','SmsAccountId','getAnswers','CannedAnswer','removeAnswers','ids','sms','Applications','account','orderBy','priority','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','clicksend','message_id','Text','MessageUUID','infobip','results','text','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','omit','contact','SmsInteraction','interaction','get','created','push','applications','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','entity\x20found','stringify','text/xml','send','\x0a','addApplications','transaction','SmsApplication','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','DESC','List','Messages','spread','dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','redif','DELIVERED','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent'];(function(_0x3d57fb,_0x3b2d2e){var _0x186696=function(_0x5a5dd7){while(--_0x5a5dd7){_0x3d57fb['push'](_0x3d57fb['shift']());}};_0x186696(++_0x3b2d2e);}(_0x4674,0x193));var _0x4467=function(_0x3ad7c8,_0x3aae5b){_0x3ad7c8=_0x3ad7c8-0x0;var _0x4e2549=_0x4674[_0x3ad7c8];return _0x4e2549;};'use strict';var pdf=require(_0x4467('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4467('0x1'));var zipdir=require(_0x4467('0x2'));var jsonpatch=require(_0x4467('0x3'));var rp=require(_0x4467('0x4'));var moment=require(_0x4467('0x5'));var BPromise=require(_0x4467('0x6'));var Mustache=require(_0x4467('0x7'));var util=require('util');var path=require('path');var sox=require(_0x4467('0x8'));var csv=require(_0x4467('0x9'));var ejs=require(_0x4467('0xa'));var fs=require('fs');var _=require(_0x4467('0xb'));var squel=require('squel');var crypto=require(_0x4467('0xc'));var jsforce=require(_0x4467('0xd'));var deskjs=require(_0x4467('0xe'));var toCsv=require(_0x4467('0x9'));var querystring=require(_0x4467('0xf'));var Papa=require(_0x4467('0x10'));var Redis=require(_0x4467('0x11'));var authService=require(_0x4467('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4467('0x13'));var hardwareService=require(_0x4467('0x14'));var logger=require(_0x4467('0x15'))(_0x4467('0x16'));var utils=require('../../config/utils');var config=require(_0x4467('0x17'));var db=require(_0x4467('0x18'))['db'];config[_0x4467('0x19')]=_[_0x4467('0x1a')](config[_0x4467('0x19')],{'host':_0x4467('0x1b'),'port':0x18eb});var socket=require(_0x4467('0x1c'))(new Redis(config[_0x4467('0x19')]));require('./smsAccount.socket')[_0x4467('0x1d')](socket);var jayson=require(_0x4467('0x1e'));var client=jayson[_0x4467('0x1f')]['http']({'port':0x232c});function checkPasswordPattern(_0x5d13f3,_0x414e72,_0x115914){if(_0x115914){var _0x48f27a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48f27a[_0x4467('0x20')](_0x414e72)){return _0x5d13f3;}else{throw new db[(_0x4467('0x21'))]['ValidationError'](_0x4467('0x22'));}}else{return _0x5d13f3;}}function respondWithRpcPromise(_0x433b3a,_0x56e50c,_0xc5cd,_0x28921c){return new BPromise(function(_0xe464c2,_0x3af9d3){var _0x2c1116=_0x28921c||client;return _0x2c1116[_0x4467('0x23')](_0x433b3a,_0xc5cd)[_0x4467('0x24')](function(_0x16d545){logger[_0x4467('0x25')](_0x4467('0x26'),_0x56e50c,'request\x20sent');logger[_0x4467('0x27')](_0x4467('0x28'),_0x56e50c,'request\x20sent',JSON['stringify'](_0x16d545));if(_0x16d545[_0x4467('0x29')]){if(_0x16d545['error'][_0x4467('0x2a')]===0x1f4){logger[_0x4467('0x29')](_0x4467('0x26'),_0x56e50c,_0x16d545[_0x4467('0x29')][_0x4467('0x2b')]);return _0x3af9d3(_0x16d545[_0x4467('0x29')][_0x4467('0x2b')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x56e50c,_0x16d545[_0x4467('0x29')][_0x4467('0x2b')]);return _0xe464c2(_0x16d545[_0x4467('0x29')][_0x4467('0x2b')]);}else{logger[_0x4467('0x25')](_0x4467('0x26'),_0x56e50c,_0x4467('0x2c'));_0xe464c2(_0x16d545[_0x4467('0x2d')]['message']);}})['catch'](function(_0xeb7d02){logger[_0x4467('0x29')]('SmsAccount,\x20%s,\x20%s',_0x56e50c,_0xeb7d02);_0x3af9d3(_0xeb7d02);});});}function respondWithStatusCode(_0x284bed,_0x3a5e08){_0x3a5e08=_0x3a5e08||0xcc;return function(_0x21bbc9){if(_0x21bbc9){return _0x284bed[_0x4467('0x2e')](_0x3a5e08);}return _0x284bed[_0x4467('0x2f')](_0x3a5e08)[_0x4467('0x30')]();};}function respondWithResult(_0x384b5d,_0x4a6921){_0x4a6921=_0x4a6921||0xc8;return function(_0x202903){if(_0x202903){return _0x384b5d[_0x4467('0x2f')](_0x4a6921)[_0x4467('0x31')](_0x202903);}};}function respondWithFilteredResult(_0x528049,_0x2fce55){return function(_0x1c1bef){if(_0x1c1bef){var _0x144063=_0x1c1bef[_0x4467('0x32')],_0x3bbce6=_0x2fce55[_0x4467('0x33')],_0x1c5fa9=_0x2fce55['offset']+_0x2fce55['limit'],_0x96ae3c;if(_0x1c5fa9>=_0x144063){_0x1c5fa9=_0x144063;_0x96ae3c=0xc8;}else{_0x96ae3c=0xce;}_0x528049[_0x4467('0x2f')](_0x96ae3c);return _0x528049[_0x4467('0x34')]('Content-Range',_0x3bbce6+'-'+_0x1c5fa9+'/'+_0x144063)['json'](_0x1c1bef);}return null;};}function patchUpdates(_0x5880e0){return function(_0x1c7d54){try{jsonpatch[_0x4467('0x35')](_0x1c7d54,_0x5880e0,!![]);}catch(_0x105a9c){return BPromise[_0x4467('0x36')](_0x105a9c);}return _0x1c7d54['save']();};}function saveUpdates(_0x406526,_0x5da666){return function(_0xd2a649){if(_0xd2a649){return _0xd2a649['update'](_0x406526)[_0x4467('0x24')](function(_0x1a462e){return _0x1a462e;});}return null;};}function removeEntity(_0xffa829,_0x43df83){return function(_0x5d1787){if(_0x5d1787){return _0x5d1787[_0x4467('0x37')]()[_0x4467('0x24')](function(){var _0x1cd73a=_0x5d1787['get']({'plain':!![]});var _0x268e84=_0x4467('0x38');return db[_0x4467('0x39')]['destroy']({'where':{'type':_0x268e84,'resourceId':_0x1cd73a['id']}})['then'](function(){return _0x5d1787;});})[_0x4467('0x24')](function(){_0xffa829[_0x4467('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33868f,_0x2e5465){return function(_0x5ce620){if(!_0x5ce620){_0x33868f['sendStatus'](0x194);}return _0x5ce620;};}function handleError(_0x4a4f71,_0x5eb853){_0x5eb853=_0x5eb853||0x1f4;return function(_0x289e21){logger[_0x4467('0x29')](_0x289e21[_0x4467('0x3a')]);if(_0x289e21[_0x4467('0x3b')]){delete _0x289e21[_0x4467('0x3b')];}_0x4a4f71[_0x4467('0x2f')](_0x5eb853)['send'](_0x289e21);};}exports['index']=function(_0x365709,_0x20aa99){var _0x282a62={'include':[{'model':db[_0x4467('0x3c')],'as':_0x4467('0x3d')}]},_0x1a71d4={},_0x20487d={'count':0x0,'rows':[]};var _0x3a1e2f=_[_0x4467('0x3e')](db[_0x4467('0x3f')]['rawAttributes'],function(_0x3a41d8){return{'name':_0x3a41d8[_0x4467('0x40')],'type':_0x3a41d8[_0x4467('0x41')]['key']};});_0x1a71d4[_0x4467('0x42')]=_[_0x4467('0x3e')](_0x3a1e2f,_0x4467('0x3b'));_0x1a71d4[_0x4467('0x43')]=_[_0x4467('0x44')](_0x365709[_0x4467('0x43')]);_0x1a71d4['filters']=_[_0x4467('0x45')](_0x1a71d4[_0x4467('0x42')],_0x1a71d4[_0x4467('0x43')]);_0x282a62['attributes']=_['intersection'](_0x1a71d4[_0x4467('0x42')],qs[_0x4467('0x46')](_0x365709[_0x4467('0x43')][_0x4467('0x46')]));_0x282a62[_0x4467('0x47')]=_0x282a62['attributes']['length']?_0x282a62[_0x4467('0x47')]:_0x1a71d4[_0x4467('0x42')];if(!_0x365709[_0x4467('0x43')][_0x4467('0x48')](_0x4467('0x49'))){_0x282a62[_0x4467('0x4a')]=qs[_0x4467('0x4a')](_0x365709[_0x4467('0x43')][_0x4467('0x4a')]);_0x282a62['offset']=qs[_0x4467('0x33')](_0x365709[_0x4467('0x43')][_0x4467('0x33')]);}_0x282a62[_0x4467('0x4b')]=qs['sort'](_0x365709[_0x4467('0x43')][_0x4467('0x4c')]);_0x282a62['where']=qs[_0x4467('0x4d')](_['pick'](_0x365709['query'],_0x1a71d4['filters']));if(_0x365709['query'][_0x4467('0x4e')]){_0x282a62[_0x4467('0x4f')]=_[_0x4467('0x50')](_0x282a62[_0x4467('0x4f')],{'$or':_[_0x4467('0x3e')](_0x3a1e2f,function(_0x3947a7){if(_0x3947a7[_0x4467('0x41')]!==_0x4467('0x51')){var _0x3507a8={};_0x3507a8[_0x3947a7[_0x4467('0x3b')]]={'$like':'%'+_0x365709[_0x4467('0x43')][_0x4467('0x4e')]+'%'};return _0x3507a8;}})});}_0x282a62=_[_0x4467('0x50')]({},_0x282a62,_0x365709[_0x4467('0x52')]);var _0xfef3a4={'where':_0x282a62[_0x4467('0x4f')]};return db[_0x4467('0x3f')]['count'](_0xfef3a4)[_0x4467('0x24')](function(_0x5f227c){_0x20487d['count']=_0x5f227c;if(_0x365709[_0x4467('0x43')][_0x4467('0x53')]){_0x282a62[_0x4467('0x54')]=[{'all':!![]}];}return db[_0x4467('0x3f')][_0x4467('0x55')](_0x282a62);})['then'](function(_0x5640d0){_0x20487d[_0x4467('0x56')]=_0x5640d0;return _0x20487d;})[_0x4467('0x24')](respondWithFilteredResult(_0x20aa99,_0x282a62))['catch'](handleError(_0x20aa99,null));};exports[_0x4467('0x57')]=function(_0x3624db,_0x20235d){var _0x2fc079={'raw':![],'where':{'id':_0x3624db[_0x4467('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x13608f={};_0x13608f['model']=_[_0x4467('0x44')](db[_0x4467('0x3f')][_0x4467('0x59')]);_0x13608f[_0x4467('0x43')]=_['keys'](_0x3624db[_0x4467('0x43')]);_0x13608f[_0x4467('0x4d')]=_[_0x4467('0x45')](_0x13608f[_0x4467('0x42')],_0x13608f[_0x4467('0x43')]);_0x2fc079['attributes']=_[_0x4467('0x45')](_0x13608f[_0x4467('0x42')],qs[_0x4467('0x46')](_0x3624db[_0x4467('0x43')][_0x4467('0x46')]));_0x2fc079[_0x4467('0x47')]=_0x2fc079[_0x4467('0x47')][_0x4467('0x5a')]?_0x2fc079[_0x4467('0x47')]:_0x13608f['model'];if(_0x3624db['query'][_0x4467('0x53')]){_0x2fc079[_0x4467('0x54')]=[{'all':!![]}];}_0x2fc079=_[_0x4467('0x50')]({},_0x2fc079,_0x3624db[_0x4467('0x52')]);return db[_0x4467('0x3f')][_0x4467('0x5b')](_0x2fc079)['then'](handleEntityNotFound(_0x20235d,null))[_0x4467('0x24')](respondWithResult(_0x20235d,null))[_0x4467('0x5c')](handleError(_0x20235d,null));};exports['create']=function(_0x495bac,_0x2aea7f){return db['SmsAccount'][_0x4467('0x5d')](_0x495bac[_0x4467('0x5e')],{})[_0x4467('0x24')](function(_0x27d31e){var _0x23df78=_0x495bac[_0x4467('0x5f')]['get']({'plain':!![]});if(!_0x23df78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23df78[_0x4467('0x60')]==='user'){var _0x493b85=_0x27d31e['get']({'plain':!![]});var _0x3182d1=_0x4467('0x38');return db[_0x4467('0x61')][_0x4467('0x5b')]({'where':{'name':_0x3182d1,'userProfileId':_0x23df78[_0x4467('0x62')]},'raw':!![]})[_0x4467('0x24')](function(_0x653cd9){if(_0x653cd9&&_0x653cd9['autoAssociation']===0x0){return db[_0x4467('0x39')]['create']({'name':_0x493b85['name'],'resourceId':_0x493b85['id'],'type':_0x653cd9[_0x4467('0x3b')],'sectionId':_0x653cd9['id']},{})[_0x4467('0x24')](function(){return _0x27d31e;});}else{return _0x27d31e;}})[_0x4467('0x5c')](function(_0x26847c){logger[_0x4467('0x29')](_0x4467('0x63'),_0x26847c);throw _0x26847c;});}return _0x27d31e;})['then'](respondWithResult(_0x2aea7f,0xc9))[_0x4467('0x5c')](handleError(_0x2aea7f,null));};exports[_0x4467('0x64')]=function(_0x298cc1,_0x2d9e26){if(_0x298cc1['body']['id']){delete _0x298cc1[_0x4467('0x5e')]['id'];}return db[_0x4467('0x3f')][_0x4467('0x5b')]({'where':{'id':_0x298cc1[_0x4467('0x58')]['id']},'include':[{'model':db[_0x4467('0x3c')],'as':_0x4467('0x3d')}]})[_0x4467('0x24')](handleEntityNotFound(_0x2d9e26,null))[_0x4467('0x24')](saveUpdates(_0x298cc1['body'],null))[_0x4467('0x24')](respondWithResult(_0x2d9e26,null))[_0x4467('0x5c')](handleError(_0x2d9e26,null));};exports['destroy']=function(_0x3862a8,_0x3a0d93){return db[_0x4467('0x3f')][_0x4467('0x5b')]({'where':{'id':_0x3862a8['params']['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x3a0d93,null))[_0x4467('0x24')](removeEntity(_0x3a0d93,null))[_0x4467('0x5c')](handleError(_0x3a0d93,null));};exports[_0x4467('0x65')]=function(_0x1a987e,_0x13c4eb){return db[_0x4467('0x3f')]['describe']()[_0x4467('0x24')](respondWithResult(_0x13c4eb,null))['catch'](handleError(_0x13c4eb,null));};exports[_0x4467('0x66')]=function(_0x471ce3,_0x449cb3,_0x4d9168){if(_0x471ce3[_0x4467('0x5e')]['id']){delete _0x471ce3[_0x4467('0x5e')]['id'];}return db[_0x4467('0x3f')]['find']({'where':{'id':_0x471ce3['params']['id']}})['then'](handleEntityNotFound(_0x449cb3,null))[_0x4467('0x24')](function(_0x25a59b){if(_0x25a59b){_0x471ce3[_0x4467('0x5e')]['SmsAccountId']=_0x25a59b['id'];return db[_0x4467('0x67')][_0x4467('0x5d')](_0x471ce3[_0x4467('0x5e')]);}})[_0x4467('0x24')](respondWithResult(_0x449cb3,null))[_0x4467('0x5c')](handleError(_0x449cb3,null));};exports[_0x4467('0x68')]=function(_0x4e10cf,_0x4a159d,_0x452a52){var _0x434dbe={'raw':![],'where':{}};var _0x549ce8={};var _0x105b03={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4467('0x69')]({'where':{'id':_0x4e10cf['params']['id']}})['then'](handleEntityNotFound(_0x4a159d,null))[_0x4467('0x24')](function(_0x4238a2){if(_0x4238a2){_0x549ce8[_0x4467('0x42')]=_[_0x4467('0x44')](db[_0x4467('0x67')]['rawAttributes']);_0x549ce8[_0x4467('0x43')]=_[_0x4467('0x44')](_0x4e10cf['query']);_0x549ce8[_0x4467('0x4d')]=_[_0x4467('0x45')](_0x549ce8[_0x4467('0x42')],_0x549ce8[_0x4467('0x43')]);_0x434dbe[_0x4467('0x47')]=_[_0x4467('0x45')](_0x549ce8[_0x4467('0x42')],qs['fields'](_0x4e10cf[_0x4467('0x43')][_0x4467('0x46')]));_0x434dbe[_0x4467('0x47')]=_0x434dbe[_0x4467('0x47')][_0x4467('0x5a')]?_0x434dbe[_0x4467('0x47')]:_0x549ce8[_0x4467('0x42')];if(!_0x4e10cf[_0x4467('0x43')][_0x4467('0x48')]('nolimit')){_0x434dbe['limit']=qs['limit'](_0x4e10cf[_0x4467('0x43')][_0x4467('0x4a')]);_0x434dbe[_0x4467('0x33')]=qs[_0x4467('0x33')](_0x4e10cf[_0x4467('0x43')]['offset']);}_0x434dbe['order']=qs[_0x4467('0x4c')](_0x4e10cf[_0x4467('0x43')][_0x4467('0x4c')]);_0x434dbe[_0x4467('0x4f')]=qs['filters'](_[_0x4467('0x6a')](_0x4e10cf[_0x4467('0x43')],_0x549ce8['filters']));_0x434dbe[_0x4467('0x4f')]['SmsAccountId']=_0x4238a2['id'];if(_0x4e10cf['query'][_0x4467('0x4e')]){_0x434dbe[_0x4467('0x4f')]=_[_0x4467('0x50')](_0x434dbe[_0x4467('0x4f')],{'$or':_[_0x4467('0x3e')](_0x434dbe[_0x4467('0x47')],function(_0x13bdd0){var _0x335bd5={};_0x335bd5[_0x13bdd0]={'$like':'%'+_0x4e10cf[_0x4467('0x43')][_0x4467('0x4e')]+'%'};return _0x335bd5;})});}_0x434dbe=_[_0x4467('0x50')]({},_0x434dbe,_0x4e10cf[_0x4467('0x52')]);return db['Disposition'][_0x4467('0x32')]({'where':_0x434dbe[_0x4467('0x4f')]})[_0x4467('0x24')](function(_0x1a8f47){_0x105b03[_0x4467('0x32')]=_0x1a8f47;if(_0x4e10cf[_0x4467('0x43')][_0x4467('0x53')]){_0x434dbe[_0x4467('0x54')]=[{'all':!![]}];}return db[_0x4467('0x67')]['findAll'](_0x434dbe);})[_0x4467('0x24')](function(_0x512f4b){_0x105b03[_0x4467('0x56')]=_0x512f4b;return _0x105b03;});}})[_0x4467('0x24')](respondWithFilteredResult(_0x4a159d,_0x434dbe))[_0x4467('0x5c')](handleError(_0x4a159d,null));};exports[_0x4467('0x6b')]=function(_0x1f90cb,_0x31eadb,_0x53cce6){return db[_0x4467('0x3f')]['find']({'where':{'id':_0x1f90cb[_0x4467('0x58')]['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x31eadb,null))['then'](function(_0x5083e4){if(_0x5083e4){return _0x5083e4['removeDispositions'](_0x1f90cb[_0x4467('0x43')]['ids']);}})[_0x4467('0x24')](respondWithStatusCode(_0x31eadb,null))['catch'](handleError(_0x31eadb,null));};exports['addAnswer']=function(_0x270733,_0x27f687,_0x3394b6){if(_0x270733['body']['id']){delete _0x270733[_0x4467('0x5e')]['id'];}return db[_0x4467('0x3f')]['find']({'where':{'id':_0x270733['params']['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x27f687,null))[_0x4467('0x24')](function(_0x1e1020){if(_0x1e1020){_0x270733[_0x4467('0x5e')][_0x4467('0x6c')]=_0x1e1020['id'];return db['CannedAnswer']['create'](_0x270733[_0x4467('0x5e')]);}})['then'](respondWithResult(_0x27f687,null))[_0x4467('0x5c')](handleError(_0x27f687,null));};exports[_0x4467('0x6d')]=function(_0x1062ca,_0x2d5fa1,_0x487856){var _0x56af8f={'raw':![],'where':{}};var _0x33c0b5={};var _0x5e438e={'count':0x0,'rows':[]};return db[_0x4467('0x3f')]['findOne']({'where':{'id':_0x1062ca['params']['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x2d5fa1,null))[_0x4467('0x24')](function(_0x5b1f28){if(_0x5b1f28){_0x33c0b5[_0x4467('0x42')]=_['keys'](db[_0x4467('0x6e')]['rawAttributes']);_0x33c0b5['query']=_['keys'](_0x1062ca['query']);_0x33c0b5[_0x4467('0x4d')]=_[_0x4467('0x45')](_0x33c0b5[_0x4467('0x42')],_0x33c0b5[_0x4467('0x43')]);_0x56af8f[_0x4467('0x47')]=_[_0x4467('0x45')](_0x33c0b5[_0x4467('0x42')],qs[_0x4467('0x46')](_0x1062ca[_0x4467('0x43')][_0x4467('0x46')]));_0x56af8f[_0x4467('0x47')]=_0x56af8f[_0x4467('0x47')][_0x4467('0x5a')]?_0x56af8f[_0x4467('0x47')]:_0x33c0b5[_0x4467('0x42')];if(!_0x1062ca['query'][_0x4467('0x48')](_0x4467('0x49'))){_0x56af8f[_0x4467('0x4a')]=qs[_0x4467('0x4a')](_0x1062ca['query'][_0x4467('0x4a')]);_0x56af8f[_0x4467('0x33')]=qs[_0x4467('0x33')](_0x1062ca[_0x4467('0x43')]['offset']);}_0x56af8f[_0x4467('0x4b')]=qs[_0x4467('0x4c')](_0x1062ca[_0x4467('0x43')][_0x4467('0x4c')]);_0x56af8f[_0x4467('0x4f')]=qs[_0x4467('0x4d')](_[_0x4467('0x6a')](_0x1062ca[_0x4467('0x43')],_0x33c0b5['filters']));_0x56af8f[_0x4467('0x4f')]['SmsAccountId']=_0x5b1f28['id'];if(_0x1062ca[_0x4467('0x43')][_0x4467('0x4e')]){_0x56af8f[_0x4467('0x4f')]=_[_0x4467('0x50')](_0x56af8f[_0x4467('0x4f')],{'$or':_[_0x4467('0x3e')](_0x56af8f[_0x4467('0x47')],function(_0x3da618){var _0x2df817={};_0x2df817[_0x3da618]={'$like':'%'+_0x1062ca['query']['filter']+'%'};return _0x2df817;})});}_0x56af8f=_[_0x4467('0x50')]({},_0x56af8f,_0x1062ca[_0x4467('0x52')]);return db[_0x4467('0x6e')]['count']({'where':_0x56af8f[_0x4467('0x4f')]})[_0x4467('0x24')](function(_0xbf2702){_0x5e438e['count']=_0xbf2702;if(_0x1062ca['query'][_0x4467('0x53')]){_0x56af8f[_0x4467('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4467('0x55')](_0x56af8f);})[_0x4467('0x24')](function(_0x5d03ca){_0x5e438e['rows']=_0x5d03ca;return _0x5e438e;});}})['then'](respondWithFilteredResult(_0x2d5fa1,_0x56af8f))[_0x4467('0x5c')](handleError(_0x2d5fa1,null));};exports[_0x4467('0x6f')]=function(_0x319bdc,_0x3d6783,_0x565249){return db[_0x4467('0x3f')][_0x4467('0x5b')]({'where':{'id':_0x319bdc[_0x4467('0x58')]['id']}})['then'](handleEntityNotFound(_0x3d6783,null))[_0x4467('0x24')](function(_0x575cfd){if(_0x575cfd){return _0x575cfd['removeAnswers'](_0x319bdc['query'][_0x4467('0x70')]);}})['then'](respondWithStatusCode(_0x3d6783,null))[_0x4467('0x5c')](handleError(_0x3d6783,null));};exports['notify']=function(_0x505a13,_0x483611,_0x2eea88){var _0x6ddc53={'channel':_0x4467('0x71')};var _0x44f2e0=[];var _0x2d52d4=[];var _0x205d4a={};return db[_0x4467('0x3f')][_0x4467('0x5b')]({'where':{'id':_0x505a13[_0x4467('0x58')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x4467('0x72')}]})[_0x4467('0x24')](handleEntityNotFound(_0x483611,null))[_0x4467('0x24')](function(_0x112a01){_0x6ddc53[_0x4467('0x73')]=_0x112a01;_0x6ddc53['applications']=_[_0x4467('0x74')](_0x112a01[_0x4467('0x72')],[_0x4467('0x75')],['asc']);if(_0x6ddc53[_0x4467('0x73')]['Applications']){delete _0x6ddc53[_0x4467('0x73')]['Applications'];}return db[_0x4467('0x76')]['describe']();})[_0x4467('0x24')](function(_0xcfc446){if(!_0xcfc446){throw new db[(_0x4467('0x21'))][(_0x4467('0x77'))](_0x4467('0x78'));}_0x44f2e0=_[_0x4467('0x79')](_[_0x4467('0x44')](_0xcfc446),[_0x4467('0x7a'),_0x4467('0x7b')]);_0x2d52d4=_[_0x4467('0x79')](_[_0x4467('0x44')](_0xcfc446),[_0x4467('0x7a'),_0x4467('0x7b'),_0x4467('0x7c'),_0x4467('0x7d')]);_0x6ddc53[_0x4467('0x5e')]={'mapKey':_0x4467('0x7e')};if(_0x6ddc53['account'][_0x4467('0x41')]){switch(_0x6ddc53['account'][_0x4467('0x41')]){case _0x4467('0x7f'):_0x6ddc53['body'][_0x4467('0x80')]=_0x505a13[_0x4467('0x5e')][_0x4467('0x81')];_0x6ddc53['body']['body']=_0x505a13[_0x4467('0x5e')][_0x4467('0x82')];_0x6ddc53['body'][_0x4467('0x83')]=_0x505a13[_0x4467('0x5e')][_0x4467('0x84')];break;case _0x4467('0x85'):_0x6ddc53[_0x4467('0x5e')][_0x4467('0x80')]='+'+_0x505a13[_0x4467('0x5e')][_0x4467('0x86')];_0x6ddc53[_0x4467('0x5e')]['body']=_0x505a13['body']['text'];break;case'connectel':_0x6ddc53['body']['from']=_0x505a13['body'][_0x4467('0x80')];_0x6ddc53[_0x4467('0x5e')]['body']=_0x505a13['body'][_0x4467('0x2b')];break;case _0x4467('0x87'):_0x6ddc53[_0x4467('0x5e')]['from']=_0x505a13['body'][_0x4467('0x80')];_0x6ddc53[_0x4467('0x5e')]['body']=_0x505a13[_0x4467('0x5e')][_0x4467('0x5e')];_0x6ddc53[_0x4467('0x5e')][_0x4467('0x83')]=_0x505a13[_0x4467('0x5e')][_0x4467('0x88')];break;case'plivo':_0x6ddc53['body'][_0x4467('0x80')]=_0x505a13[_0x4467('0x5e')]['From'];_0x6ddc53[_0x4467('0x5e')][_0x4467('0x5e')]=_0x505a13['body'][_0x4467('0x89')];_0x6ddc53['body']['messageId']=_0x505a13[_0x4467('0x5e')][_0x4467('0x8a')];break;case _0x4467('0x8b'):_0x6ddc53[_0x4467('0x5e')][_0x4467('0x80')]='+'+_0x505a13[_0x4467('0x5e')][_0x4467('0x8c')][0x0][_0x4467('0x80')];_0x6ddc53['body'][_0x4467('0x5e')]=_0x505a13[_0x4467('0x5e')][_0x4467('0x8c')][0x0][_0x4467('0x8d')];_0x6ddc53['body'][_0x4467('0x83')]=_0x505a13[_0x4467('0x5e')][_0x4467('0x8c')][0x0]['messageId'];break;case _0x4467('0x8e'):_0x6ddc53['body'][_0x4467('0x80')]=_0x505a13[_0x4467('0x5e')][_0x4467('0x8f')];_0x6ddc53[_0x4467('0x5e')][_0x4467('0x5e')]=_0x505a13[_0x4467('0x5e')]['segmentedMessage'][_0x4467('0x2b')];break;case _0x4467('0x90'):_0x6ddc53[_0x4467('0x5e')][_0x4467('0x80')]=_0x505a13[_0x4467('0x5e')][_0x4467('0x91')];_0x6ddc53['body']['body']=_0x505a13[_0x4467('0x5e')][_0x4467('0x8d')];_0x6ddc53[_0x4467('0x5e')]['messageId']=_0x505a13[_0x4467('0x5e')][_0x4467('0x92')];break;case _0x4467('0x93'):_0x6ddc53[_0x4467('0x5e')][_0x4467('0x80')]=_0x505a13[_0x4467('0x5e')]['from'];_0x6ddc53['body'][_0x4467('0x5e')]=_0x505a13[_0x4467('0x5e')][_0x4467('0x2b')];_0x6ddc53[_0x4467('0x5e')][_0x4467('0x83')]=_0x505a13['body']['refid'];break;}}if(_0x6ddc53[_0x4467('0x5e')]['id']){delete _0x6ddc53[_0x4467('0x5e')]['id'];}if(_[_0x4467('0x94')](_0x6ddc53[_0x4467('0x5e')][_0x4467('0x80')])){throw new db[(_0x4467('0x21'))][(_0x4467('0x77'))](_0x4467('0x95'));}if(_[_0x4467('0x94')](_0x6ddc53[_0x4467('0x5e')][_0x4467('0x5e')])||_0x6ddc53[_0x4467('0x5e')][_0x4467('0x5e')]===''){throw new db['Sequelize'][(_0x4467('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4467('0x94')](_0x6ddc53[_0x4467('0x5e')][_0x4467('0x96')])){throw new db[(_0x4467('0x21'))][(_0x4467('0x77'))](_0x4467('0x97')+_0x2d52d4);}if(!_[_0x4467('0x98')](_0x2d52d4,_0x6ddc53['body'][_0x4467('0x96')])){throw new db[(_0x4467('0x21'))][(_0x4467('0x77'))](_0x4467('0x99')+_0x2d52d4);}_0x205d4a[_0x6ddc53[_0x4467('0x5e')]['mapKey']]=_0x6ddc53['body']['from'];return db[_0x4467('0x9a')][_0x4467('0x5b')]({'where':{'id':_0x6ddc53[_0x4467('0x73')][_0x4467('0x7d')]},'include':[{'model':db[_0x4467('0x76')],'as':_0x4467('0x9b'),'where':_0x205d4a,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x4467('0x24')](handleEntityNotFound(_0x483611,null))[_0x4467('0x24')](function(_0x212c89){if(_0x212c89){_0x6ddc53['list']=_[_0x4467('0x9c')](_0x212c89,[_0x4467('0x9b')]);if(_0x212c89[_0x4467('0x9b')]['length']){return _0x212c89[_0x4467('0x9b')][0x0];}var _0x119d66=_['defaults'](_0x6ddc53[_0x4467('0x5e')],{'firstName':_0x6ddc53[_0x4467('0x5e')][_0x4467('0x80')],'ListId':_0x212c89['id']});_0x119d66[_0x6ddc53[_0x4467('0x5e')]['mapKey']]=_0x6ddc53[_0x4467('0x5e')][_0x4467('0x80')];return db['CmContact']['create'](_0x119d66,{'fields':_0x44f2e0,'raw':!![]});}})[_0x4467('0x24')](handleEntityNotFound(_0x483611,null))[_0x4467('0x24')](function(_0x54e622){if(_0x54e622){_0x6ddc53[_0x4467('0x9d')]=_0x54e622;var _0x43a694={'ContactId':_0x54e622['id'],'phone':_0x6ddc53[_0x4467('0x5e')][_0x4467('0x80')],'SmsAccountId':_0x505a13[_0x4467('0x58')]['id']};var _0x32607d={'ContactId':_0x54e622['id'],'SmsAccountId':_0x505a13[_0x4467('0x58')]['id'],'closed':![]};return db[_0x4467('0x9e')][_0x4467('0x5b')]({'where':_0x32607d})[_0x4467('0x24')](function(_0x596d7c){if(_0x596d7c){return[_0x596d7c,![]];}return db['SmsInteraction'][_0x4467('0x5d')](_0x43a694)['then'](function(_0xdb08e7){return[_0xdb08e7,!![]];});});}})['spread'](function(_0x1cc984,_0x222f3e){_0x6ddc53[_0x4467('0x9f')]=_0x1cc984[_0x4467('0xa0')]({'plain':!![]});_0x6ddc53[_0x4467('0x9f')][_0x4467('0xa1')]=![];if(_0x222f3e){if(_0x6ddc53[_0x4467('0x73')]['autoclose']){_0x6ddc53['applications'][_0x4467('0xa2')]({'id':0x0,'priority':_0x6ddc53[_0x4467('0xa3')][_0x4467('0x5a')]+0x1,'app':'close','appdata':_0x4467('0xa4'),'interval':_0x4467('0xa5')});}_0x6ddc53[_0x4467('0x9f')][_0x4467('0xa1')]=!![];}return db[_0x4467('0xa6')]['create']({'phone':_0x6ddc53['body'][_0x4467('0x80')],'messageId':_0x6ddc53[_0x4467('0x5e')][_0x4467('0x83')],'body':_0x6ddc53['body'][_0x4467('0x5e')],'SmsAccountId':_0x505a13[_0x4467('0x58')]['id'],'SmsInteractionId':_0x1cc984['id'],'direction':'in','ContactId':_0x1cc984[_0x4467('0xa7')],'AttachmentId':_0x6ddc53[_0x4467('0x5e')][_0x4467('0xa8')]});})[_0x4467('0x24')](function(_0x193780){_0x6ddc53[_0x4467('0x2b')]=_0x193780;if(_0x6ddc53['interaction'][_0x4467('0xa9')]){return db[_0x4467('0xaa')][_0x4467('0x5b')]({'attributes':['id','name'],'where':{'id':_0x6ddc53[_0x4467('0x9f')][_0x4467('0xa9')]}})[_0x4467('0x24')](function(_0x4a3684){if(_0x4a3684){_0x6ddc53[_0x4467('0xa3')][_0x4467('0xab')]({'id':0x0,'priority':0x0,'app':_0x4467('0xac'),'appdata':_0x4a3684[_0x4467('0x3b')]+','+(_0x6ddc53[_0x4467('0x73')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4467('0xad'),_0x4467('0xae'),_0x6ddc53);});}return respondWithRpcPromise(_0x4467('0xad'),_0x4467('0xae'),_0x6ddc53);})[_0x4467('0x24')](function(_0x2258ba){if(_0x2258ba){var _0x5431d1=0xc8;var _0x469905='receiveMessage';logger[_0x4467('0x25')](_0x4467('0x28'),_0x469905,_0x5431d1,'entity\x20found');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x469905,_0x5431d1,_0x4467('0xaf'),JSON[_0x4467('0xb0')](_0x2258ba));if(_0x6ddc53[_0x4467('0x73')][_0x4467('0x41')]===_0x4467('0x7f')){return _0x483611[_0x4467('0x2f')](_0x5431d1)[_0x4467('0x34')]('Content-Type',_0x4467('0xb1'))[_0x4467('0xb2')](_0x4467('0xb3'));}else{return _0x483611['status'](_0x5431d1)[_0x4467('0x31')](_0x2258ba);}}})[_0x4467('0x5c')](handleError(_0x483611,null));};exports[_0x4467('0xb4')]=function(_0x522f94,_0x3de048,_0x4ec6a2){return db[_0x4467('0x3f')][_0x4467('0x69')]({'where':{'id':_0x522f94[_0x4467('0x58')]['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x3de048,null))[_0x4467('0x24')](function(_0x4a6754){if(_0x4a6754){return db['sequelize'][_0x4467('0xb5')](function(_0x371bcd){return db['SmsApplication'][_0x4467('0x37')]({'where':{'SmsAccountId':_0x522f94['params']['id']},'transaction':_0x371bcd})[_0x4467('0x24')](function(_0x2e622e){var _0x3a9009=_[_0x4467('0x3e')](_0x522f94[_0x4467('0x5e')],function(_0x11a416){_0x11a416[_0x4467('0x6c')]=_0x522f94['params']['id'];return _0x11a416;});return db[_0x4467('0xb6')]['bulkCreate'](_0x3a9009,{'transaction':_0x371bcd});});})[_0x4467('0x24')](function(){return db[_0x4467('0xb6')][_0x4467('0xb7')]({'where':{'SmsAccountId':_0x522f94['params']['id']},'order':_0x4467('0x75')});});}})[_0x4467('0x24')](respondWithResult(_0x3de048,null))[_0x4467('0x5c')](handleError(_0x3de048,null));};exports[_0x4467('0xb8')]=function(_0x388404,_0x1d6552,_0x1c75c2){var _0x2c9bd2={};var _0x241ffd={};var _0x6802bc;var _0x31c493;return db['SmsAccount'][_0x4467('0x69')]({'where':{'id':_0x388404[_0x4467('0x58')]['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x1d6552,null))[_0x4467('0x24')](function(_0x136288){if(_0x136288){_0x6802bc=_0x136288;_0x241ffd[_0x4467('0x42')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x241ffd['query']=_[_0x4467('0x44')](_0x388404[_0x4467('0x43')]);_0x241ffd['filters']=_['intersection'](_0x241ffd[_0x4467('0x42')],_0x241ffd[_0x4467('0x43')]);_0x2c9bd2[_0x4467('0x47')]=_[_0x4467('0x45')](_0x241ffd['model'],qs[_0x4467('0x46')](_0x388404[_0x4467('0x43')][_0x4467('0x46')]));_0x2c9bd2['attributes']=_0x2c9bd2[_0x4467('0x47')]['length']?_0x2c9bd2[_0x4467('0x47')]:_0x241ffd[_0x4467('0x42')];_0x2c9bd2[_0x4467('0x4b')]=qs[_0x4467('0x4c')](_0x388404['query'][_0x4467('0x4c')]);_0x2c9bd2[_0x4467('0x4f')]=qs['filters'](_[_0x4467('0x6a')](_0x388404[_0x4467('0x43')],_0x241ffd[_0x4467('0x4d')]));if(_0x388404['query'][_0x4467('0x4e')]){_0x2c9bd2[_0x4467('0x4f')]=_['merge'](_0x2c9bd2[_0x4467('0x4f')],{'$or':_['map'](_0x2c9bd2[_0x4467('0x47')],function(_0x1c3737){var _0x1a6a4c={};_0x1a6a4c[_0x1c3737]={'$like':'%'+_0x388404['query'][_0x4467('0x4e')]+'%'};return _0x1a6a4c;})});}_0x2c9bd2=_[_0x4467('0x50')]({},_0x2c9bd2,_0x388404[_0x4467('0x52')]);return _0x6802bc[_0x4467('0xb8')](_0x2c9bd2);}})[_0x4467('0x24')](function(_0x3627ae){if(_0x3627ae){_0x31c493=_0x3627ae[_0x4467('0x5a')];if(!_0x388404[_0x4467('0x43')]['hasOwnProperty'](_0x4467('0x49'))){_0x2c9bd2[_0x4467('0x4a')]=qs[_0x4467('0x4a')](_0x388404[_0x4467('0x43')]['limit']);_0x2c9bd2[_0x4467('0x33')]=qs['offset'](_0x388404[_0x4467('0x43')][_0x4467('0x33')]);}return _0x6802bc[_0x4467('0xb8')](_0x2c9bd2);}})['then'](function(_0x476b79){if(_0x476b79){return _0x476b79?{'count':_0x31c493,'rows':_0x476b79}:null;}})['then'](respondWithResult(_0x1d6552,null))[_0x4467('0x5c')](handleError(_0x1d6552,null));};exports[_0x4467('0xb9')]=function(_0x40366f,_0x4bf25d,_0x4105a0){var _0x4e3d6c={'raw':![],'where':{}};var _0x3b03fe={};var _0x1f090f={'count':0x0,'rows':[]};return db[_0x4467('0x3f')][_0x4467('0x69')]({'where':{'id':_0x40366f[_0x4467('0x58')]['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x4bf25d,null))[_0x4467('0x24')](function(_0x3c650e){if(_0x3c650e){_0x3b03fe[_0x4467('0x42')]=_[_0x4467('0x44')](db[_0x4467('0x9e')][_0x4467('0x59')]);_0x3b03fe['query']=_[_0x4467('0x44')](_0x40366f['query']);_0x3b03fe[_0x4467('0x4d')]=_['intersection'](_0x3b03fe[_0x4467('0x42')],_0x3b03fe[_0x4467('0x43')]);_0x4e3d6c['attributes']=_[_0x4467('0x45')](_0x3b03fe[_0x4467('0x42')],qs[_0x4467('0x46')](_0x40366f[_0x4467('0x43')][_0x4467('0x46')]));_0x4e3d6c['attributes']=_0x4e3d6c['attributes']['length']?_0x4e3d6c[_0x4467('0x47')]:_0x3b03fe[_0x4467('0x42')];if(!_0x40366f['query'][_0x4467('0x48')](_0x4467('0x49'))){_0x4e3d6c['limit']=qs[_0x4467('0x4a')](_0x40366f['query'][_0x4467('0x4a')]);_0x4e3d6c[_0x4467('0x33')]=qs['offset'](_0x40366f['query']['offset']);}_0x4e3d6c['order']=qs[_0x4467('0x4c')](_0x40366f[_0x4467('0x43')][_0x4467('0x4c')]);_0x4e3d6c[_0x4467('0x4f')]=qs[_0x4467('0x4d')](_['pick'](_0x40366f[_0x4467('0x43')],_0x3b03fe['filters']));_0x4e3d6c[_0x4467('0x4f')][_0x4467('0x6c')]=_0x3c650e['id'];if(_0x40366f[_0x4467('0x43')]['filter']){_0x4e3d6c[_0x4467('0x4f')]=_[_0x4467('0x50')](_0x4e3d6c[_0x4467('0x4f')],{'$or':_['map'](_0x4e3d6c[_0x4467('0x47')],function(_0x1b0e94){var _0x276d3a={};_0x276d3a[_0x1b0e94]={'$like':'%'+_0x40366f[_0x4467('0x43')][_0x4467('0x4e')]+'%'};return _0x276d3a;})});}_0x4e3d6c=_['merge']({},_0x4e3d6c,_0x40366f[_0x4467('0x52')]);return db[_0x4467('0x9e')][_0x4467('0x32')]({'where':_0x4e3d6c['where']})[_0x4467('0x24')](function(_0x2b0631){_0x1f090f[_0x4467('0x32')]=_0x2b0631;if(_0x40366f['query'][_0x4467('0x53')]){_0x4e3d6c[_0x4467('0x54')]=[{'model':db[_0x4467('0x76')],'as':_0x4467('0xba'),'required':![]},{'model':db[_0x4467('0xaa')],'as':_0x4467('0xbb'),'attributes':[_0x4467('0x3b'),_0x4467('0xbc'),_0x4467('0xbd')],'required':![]},{'model':db[_0x4467('0xbe')],'as':_0x4467('0xbf'),'attributes':['id',_0x4467('0x3b'),'color'],'where':_0x40366f[_0x4467('0x43')][_0x4467('0xc0')]?{'id':_0x40366f[_0x4467('0x43')][_0x4467('0xc0')]}:undefined,'required':_0x40366f[_0x4467('0x43')][_0x4467('0xc0')]?!![]:![]}];}return db['SmsInteraction'][_0x4467('0x55')](_0x4e3d6c);})['then'](function(_0x4d644e){_0x1f090f[_0x4467('0x56')]=_0x4d644e;return _0x1f090f;});}})[_0x4467('0x24')](respondWithFilteredResult(_0x4bf25d,_0x4e3d6c))['catch'](handleError(_0x4bf25d,null));};exports[_0x4467('0xb2')]=function(_0x41f1ac,_0x577c57,_0x380503){var _0x32ef93,_0x26dcf0,_0x2a32b7;if(_[_0x4467('0x94')](_0x41f1ac[_0x4467('0x5e')]['body'])||_0x41f1ac[_0x4467('0x5e')][_0x4467('0x5e')]===''){throw new db[(_0x4467('0x21'))][(_0x4467('0x77'))](_0x4467('0xc1'));}if(_[_0x4467('0x94')](_0x41f1ac[_0x4467('0x5e')]['to'])){throw new db[(_0x4467('0x21'))][(_0x4467('0x77'))](_0x4467('0xc2'));}_0x32ef93=_0x41f1ac['body']['to'];return db['SmsAccount'][_0x4467('0x5b')]({'where':{'id':_0x41f1ac[_0x4467('0x58')]['id']},'include':[{'model':db[_0x4467('0x9a')],'as':'List','include':[{'model':db[_0x4467('0x76')],'as':_0x4467('0x9b'),'where':{'mobile':_0x32ef93},'limit':0x1,'order':[['updatedAt',_0x4467('0xc3')]]}]}]})['then'](handleEntityNotFound(_0x577c57,null))[_0x4467('0x24')](function(_0x383629){if(_0x383629&&_0x383629[_0x4467('0xc4')]){_0x26dcf0=_0x383629[_0x4467('0xa0')]({'plain':!![]});if(_0x26dcf0[_0x4467('0xc4')]&&_0x26dcf0[_0x4467('0xc4')][_0x4467('0x9b')][_0x4467('0x5a')]){return _0x26dcf0[_0x4467('0xc4')][_0x4467('0x9b')][0x0];}return db[_0x4467('0x76')][_0x4467('0x5d')](_['defaults'](_0x41f1ac[_0x4467('0x5e')],{'firstName':_0x32ef93,'mobile':_0x32ef93,'phone':_0x32ef93,'ListId':_0x26dcf0[_0x4467('0x7d')]}));}})[_0x4467('0x24')](handleEntityNotFound(_0x577c57,null))['then'](function(_0x1f8431){if(_0x1f8431){_0x2a32b7=_0x1f8431;return db[_0x4467('0x9e')][_0x4467('0x5b')]({'where':{'ContactId':_0x2a32b7['id'],'closed':![],'SmsAccountId':_0x26dcf0['id']}})[_0x4467('0x24')](function(_0x41da0e){if(_0x41da0e){return[_0x41da0e,![]];}return db[_0x4467('0x9e')]['create']({'UserId':_0x41f1ac[_0x4467('0x5f')]['id'],'ContactId':_0x2a32b7['id'],'SmsAccountId':_0x26dcf0['id'],'phone':_0x32ef93,'firstMsgDirection':'out','Messages':[_['merge'](_0x41f1ac[_0x4467('0x5e')],{'read':![],'body':_0x41f1ac[_0x4467('0x5e')][_0x4467('0x5e')],'phone':_0x32ef93,'SmsAccountId':_0x26dcf0['id'],'UserId':_0x41f1ac[_0x4467('0x5f')]['id'],'ContactId':_0x2a32b7['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x4467('0xc5')}]})['then'](function(_0xa7d1ad){return[_0xa7d1ad,!![]];});});}})[_0x4467('0xc6')](function(_0xa24a80,_0xf42e5a){if(_0xf42e5a){return _0xa24a80;}return db['SmsMessage'][_0x4467('0x5d')](_['merge'](_0x41f1ac[_0x4467('0x5e')],{'read':![],'body':_0x41f1ac[_0x4467('0x5e')]['body'],'phone':_0x32ef93,'SmsAccountId':_0x26dcf0['id'],'SmsInteractionId':_0xa24a80['id'],'UserId':_0x41f1ac['user']['id'],'ContactId':_0x2a32b7['id']}))[_0x4467('0x24')](function(_0x13deab){_0xa24a80[_0x4467('0xc7')][_0x4467('0xc5')]=[];_0xa24a80[_0x4467('0xc7')][_0x4467('0xc5')][_0x4467('0xa2')](_0x13deab[_0x4467('0xc7')]);return _0xa24a80;});})[_0x4467('0x24')](respondWithResult(_0x577c57,null))[_0x4467('0x5c')](handleError(_0x577c57,null));};exports['status']=function(_0x50bb2d,_0x179b21,_0x5268fe){if(_0x50bb2d[_0x4467('0x5e')]['id']){delete _0x50bb2d['body']['id'];}console['log'](_0x4467('0xc8'),_0x50bb2d[_0x4467('0x5e')]);var _0x2cc3d6,_0x169bac,_0x518619;return db[_0x4467('0x3f')][_0x4467('0x5b')]({'where':{'id':_0x50bb2d['params']['id']}})['then'](handleEntityNotFound(_0x179b21,null))[_0x4467('0x24')](function(_0x36b4ff){if(_0x36b4ff){_0x518619=_0x36b4ff;logger[_0x4467('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4467('0xc9'),_0x36b4ff['type'],util[_0x4467('0xca')](_0x50bb2d[_0x4467('0x5e')],{'showHidden':![],'depth':null}));switch(_0x36b4ff['type']){case _0x4467('0x85'):if(_0x50bb2d['body']['skebby_dispatch_id']&&_0x50bb2d['body'][_0x4467('0x2f')]){_0x169bac=_0x50bb2d[_0x4467('0x5e')][_0x4467('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x50bb2d[_0x4467('0x5e')][_0x4467('0xcb')]}});}break;case _0x4467('0xcc'):if(_0x50bb2d['body'][_0x4467('0xcd')]&&_0x50bb2d['body']['statusInt']){_0x169bac=_0x50bb2d[_0x4467('0x5e')][_0x4467('0xce')];return db['SmsMessage']['find']({'where':{'messageId':_0x50bb2d[_0x4467('0x5e')][_0x4467('0xcd')]}});}break;case _0x4467('0x87'):if(_0x50bb2d[_0x4467('0x5e')][_0x4467('0x88')]&&_0x50bb2d['body'][_0x4467('0xcf')]){_0x169bac=_0x50bb2d['body'][_0x4467('0xcf')];return db[_0x4467('0xa6')][_0x4467('0x5b')]({'where':{'messageId':_0x50bb2d[_0x4467('0x5e')][_0x4467('0x88')]}});}break;case _0x4467('0x8b'):var _0x260f40=_0x50bb2d[_0x4467('0x5e')]['results'][0x0];if(_0x260f40[_0x4467('0x83')]&&_0x260f40[_0x4467('0x2f')]['groupName']==='DELIVERED'){_0x169bac=_0x260f40[_0x4467('0x2f')][_0x4467('0xd0')];return db[_0x4467('0xa6')][_0x4467('0x5b')]({'where':{'messageId':_0x260f40['messageId']}});}break;case'clickatell':if(_0x50bb2d[_0x4467('0x5e')]['messageId']&&_0x50bb2d[_0x4467('0x5e')][_0x4467('0x2f')]){_0x169bac=_0x50bb2d[_0x4467('0x5e')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x50bb2d[_0x4467('0x5e')][_0x4467('0x83')]}});}break;case _0x4467('0x93'):if(_0x50bb2d[_0x4467('0x5e')][_0x4467('0xd1')]&&_0x50bb2d[_0x4467('0x5e')]['status']){_0x169bac=_0x50bb2d[_0x4467('0x5e')]['status'];return db[_0x4467('0xa6')][_0x4467('0x5b')]({'where':{'messageId':_0x50bb2d[_0x4467('0x5e')][_0x4467('0xd1')]}});}break;}}})[_0x4467('0x24')](handleEntityNotFound(_0x179b21,null))[_0x4467('0x24')](function(_0x4042b4){if(_0x4042b4){_0x2cc3d6=_0x4042b4;switch(_0x518619[_0x4467('0x41')]){case _0x4467('0x85'):if(_0x169bac===_0x4467('0xd2')){return _0x2cc3d6[_0x4467('0x64')]({'read':!![]});}else{logger['error'](_0x4467('0x28'),_0x4467('0x2f'),_0x4467('0x85'),util[_0x4467('0xca')](_0x50bb2d[_0x4467('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x4467('0xcc'):if(_0x169bac==='1'){return _0x2cc3d6[_0x4467('0x64')]({'read':!![]});}else{logger[_0x4467('0x29')](_0x4467('0x28'),_0x4467('0x2f'),_0x4467('0x85'),util[_0x4467('0xca')](_0x50bb2d[_0x4467('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x4467('0x87'):if(!_0x50bb2d[_0x4467('0x5e')]['error_code']&&_0x169bac>=0xc8&&_0x169bac<=0xce){return _0x2cc3d6['update']({'read':!![]});}else{logger['error'](_0x4467('0x28'),_0x4467('0x2f'),_0x4467('0x87'),util[_0x4467('0xca')](_0x50bb2d['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4d1e34=_0x50bb2d[_0x4467('0x5e')][_0x4467('0x8c')][0x0];if(_0x4d1e34[_0x4467('0x2f')][_0x4467('0xd0')]===_0x4467('0xd2')){return _0x2cc3d6['update']({'read':!![]});}else{logger['error'](_0x4467('0x28'),_0x4467('0x2f'),'infobip',util[_0x4467('0xca')](_0x50bb2d['body'],{'showHidden':![],'depth':null}));}break;case _0x4467('0x90'):if(_0x169bac=='DELIVERED_TO_GATEWAY'||_0x169bac==_0x4467('0xd3')){return _0x2cc3d6[_0x4467('0x64')]({'read':!![]});}else{logger['error'](_0x4467('0x28'),_0x4467('0x2f'),_0x4467('0x90'),util[_0x4467('0xca')](_0x50bb2d[_0x4467('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x4467('0x93'):if(_0x169bac===_0x4467('0xd4')||_0x169bac===_0x4467('0xd5')){return _0x2cc3d6[_0x4467('0x64')]({'read':!![]});}else{logger[_0x4467('0x29')](_0x4467('0x28'),_0x4467('0x2f'),_0x4467('0x93'),util[_0x4467('0xca')](_0x50bb2d[_0x4467('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x2cc3d6;}})['then'](respondWithResult(_0x179b21,null))[_0x4467('0x5c')](handleError(_0x179b21,null));};exports[_0x4467('0xd6')]=function(_0x58e456,_0x2c4a6a,_0x352c89){var _0x57156a,_0x561ccd,_0x458600;return db[_0x4467('0x3f')][_0x4467('0x5b')]({'where':{'id':_0x58e456[_0x4467('0x58')]['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x2c4a6a,null))[_0x4467('0x24')](function(_0x54e452){if(_0x54e452){_0x458600=_0x54e452;logger[_0x4467('0x27')](_0x4467('0x28'),_0x4467('0x2f'),_0x4467('0xc9'),_0x54e452['type'],util['inspect'](_0x58e456['query'],{'showHidden':![],'depth':null}));switch(_0x54e452[_0x4467('0x41')]){case'csc':if(_0x58e456[_0x4467('0x43')]['message-id']&&_0x58e456[_0x4467('0x43')][_0x4467('0xd7')]){_0x561ccd=_0x58e456[_0x4467('0x43')]['state'];return db['SmsMessage']['find']({'where':{'messageId':_0x58e456['query'][_0x4467('0xd8')]}});}break;}}})[_0x4467('0x24')](handleEntityNotFound(_0x2c4a6a,null))[_0x4467('0x24')](function(_0x25d12a){if(_0x25d12a){_0x57156a=_0x25d12a;switch(_0x458600[_0x4467('0x41')]){case _0x4467('0x8e'):if(_0x561ccd==='2'||_0x561ccd==='6'){return _0x57156a[_0x4467('0x64')]({'read':!![]});}else{logger[_0x4467('0x29')](_0x4467('0x28'),_0x4467('0x2f'),_0x4467('0x8e'),util[_0x4467('0xca')](_0x58e456[_0x4467('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x57156a;}})[_0x4467('0x24')](respondWithResult(_0x2c4a6a,null))[_0x4467('0x5c')](handleError(_0x2c4a6a,null));};exports['addAgents']=function(_0x4fbf3d,_0x908395,_0x1a75db){return db['SmsAccount'][_0x4467('0x5b')]({'where':{'id':_0x4fbf3d[_0x4467('0x58')]['id']}})['then'](handleEntityNotFound(_0x908395,null))['then'](function(_0x461d07){if(_0x461d07){return _0x461d07[_0x4467('0xd9')](_0x4fbf3d[_0x4467('0x5e')][_0x4467('0x70')],_[_0x4467('0x9c')](_0x4fbf3d[_0x4467('0x5e')],[_0x4467('0x70'),'id'])||{})[_0x4467('0xc6')](function(_0x514a4c){for(var _0x1ddbcd=0x0;_0x1ddbcd<_0x4fbf3d[_0x4467('0x5e')][_0x4467('0x70')]['length'];_0x1ddbcd+=0x1){socket[_0x4467('0xda')](_0x4467('0xdb'),{'UserId':_0x4fbf3d[_0x4467('0x5e')][_0x4467('0x70')][_0x1ddbcd],'SmsAccountId':_0x4fbf3d[_0x4467('0x58')]['id']});}return _0x514a4c;});}})['then'](respondWithResult(_0x908395,null))[_0x4467('0x5c')](handleError(_0x908395,null));};exports[_0x4467('0xdc')]=function(_0x25ad36,_0x396b27,_0x4ce341){return db[_0x4467('0x3f')][_0x4467('0x5b')]({'where':{'id':_0x25ad36[_0x4467('0x58')]['id']}})['then'](handleEntityNotFound(_0x396b27,null))[_0x4467('0x24')](function(_0x48af13){if(_0x48af13){return _0x48af13[_0x4467('0xdc')](_0x25ad36[_0x4467('0x43')][_0x4467('0x70')])[_0x4467('0x24')](function(){if(_[_0x4467('0xdd')](_0x25ad36['query']['ids'])){for(var _0x5dd7f5=0x0;_0x5dd7f5<_0x25ad36[_0x4467('0x43')]['ids'][_0x4467('0x5a')];_0x5dd7f5+=0x1){socket[_0x4467('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x25ad36[_0x4467('0x43')][_0x4467('0x70')][_0x5dd7f5]),'SmsAccountId':Number(_0x25ad36[_0x4467('0x58')]['id'])});}}else{socket['emit'](_0x4467('0xde'),{'UserId':Number(_0x25ad36['query'][_0x4467('0x70')]),'SmsAccountId':Number(_0x25ad36[_0x4467('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x396b27,null))[_0x4467('0x5c')](handleError(_0x396b27,null));};exports[_0x4467('0xdf')]=function(_0x307f24,_0x372e91,_0x2aaf0a){var _0x54382f={};var _0x3bf46e={};var _0x413005;var _0x3e27ea;return db[_0x4467('0x3f')][_0x4467('0x69')]({'where':{'id':_0x307f24[_0x4467('0x58')]['id']}})[_0x4467('0x24')](handleEntityNotFound(_0x372e91,null))[_0x4467('0x24')](function(_0x350426){if(_0x350426){_0x413005=_0x350426;_0x3bf46e[_0x4467('0x42')]=_[_0x4467('0x44')](db[_0x4467('0xaa')][_0x4467('0x59')]);_0x3bf46e[_0x4467('0x43')]=_[_0x4467('0x44')](_0x307f24['query']);_0x3bf46e[_0x4467('0x4d')]=_['intersection'](_0x3bf46e['model'],_0x3bf46e['query']);_0x54382f[_0x4467('0x47')]=_[_0x4467('0x45')](_0x3bf46e[_0x4467('0x42')],qs[_0x4467('0x46')](_0x307f24[_0x4467('0x43')][_0x4467('0x46')]));_0x54382f[_0x4467('0x47')]=_0x54382f['attributes'][_0x4467('0x5a')]?_0x54382f[_0x4467('0x47')]:_0x3bf46e[_0x4467('0x42')];_0x54382f[_0x4467('0x4b')]=qs[_0x4467('0x4c')](_0x307f24[_0x4467('0x43')][_0x4467('0x4c')]);_0x54382f[_0x4467('0x4f')]=qs['filters'](_['pick'](_0x307f24[_0x4467('0x43')],_0x3bf46e[_0x4467('0x4d')]));if(_0x307f24['query'][_0x4467('0x4e')]){_0x54382f['where']=_[_0x4467('0x50')](_0x54382f[_0x4467('0x4f')],{'$or':_['map'](_0x54382f['attributes'],function(_0x43674e){var _0x4e1314={};_0x4e1314[_0x43674e]={'$like':'%'+_0x307f24[_0x4467('0x43')][_0x4467('0x4e')]+'%'};return _0x4e1314;})});}_0x54382f=_['merge']({},_0x54382f,_0x307f24[_0x4467('0x52')]);return _0x413005[_0x4467('0xdf')](_0x54382f);}})['then'](function(_0xde6338){if(_0xde6338){_0x3e27ea=_0xde6338[_0x4467('0x5a')];if(!_0x307f24[_0x4467('0x43')][_0x4467('0x48')]('nolimit')){_0x54382f[_0x4467('0x4a')]=qs['limit'](_0x307f24[_0x4467('0x43')]['limit']);_0x54382f['offset']=qs[_0x4467('0x33')](_0x307f24[_0x4467('0x43')][_0x4467('0x33')]);}return _0x413005[_0x4467('0xdf')](_0x54382f);}})[_0x4467('0x24')](function(_0x4ddec1){if(_0x4ddec1){return _0x4ddec1?{'count':_0x3e27ea,'rows':_0x4ddec1}:null;}})[_0x4467('0x24')](respondWithResult(_0x372e91,null))['catch'](handleError(_0x372e91,null));}; \ No newline at end of file +var _0x2f1b=['DESC','omit','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml','\x0a','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','Tag','tag','List','out','Messages','spread','dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','redif','skebby','DELIVERED','error_code','DELIVERED_TO_GATEWAY','DELIVRD','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','Content-Range','reject','update','destroy','get','SmsAccounts','UserProfileResource','then','sendStatus','stack','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','Disposition','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','includeAll','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','priority','asc','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','from','sender','text','connectel','clicksend','plivo','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmContact','Contacts'];(function(_0x2b2ce4,_0x38e23a){var _0x347ddd=function(_0x1c8e56){while(--_0x1c8e56){_0x2b2ce4['push'](_0x2b2ce4['shift']());}};_0x347ddd(++_0x38e23a);}(_0x2f1b,0x11f));var _0xb2f1=function(_0x182a5e,_0x497279){_0x182a5e=_0x182a5e-0x0;var _0x152e3a=_0x2f1b[_0x182a5e];return _0x152e3a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb2f1('0x0'));var rimraf=require(_0xb2f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2f1('0x2'));var rp=require(_0xb2f1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb2f1('0x4'));var path=require(_0xb2f1('0x5'));var sox=require('sox');var csv=require(_0xb2f1('0x6'));var ejs=require(_0xb2f1('0x7'));var fs=require('fs');var _=require(_0xb2f1('0x8'));var squel=require(_0xb2f1('0x9'));var crypto=require(_0xb2f1('0xa'));var jsforce=require(_0xb2f1('0xb'));var deskjs=require(_0xb2f1('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb2f1('0xd'));var authService=require(_0xb2f1('0xe'));var qs=require(_0xb2f1('0xf'));var as=require(_0xb2f1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2f1('0x11'))(_0xb2f1('0x12'));var utils=require(_0xb2f1('0x13'));var config=require(_0xb2f1('0x14'));var db=require(_0xb2f1('0x15'))['db'];config[_0xb2f1('0x16')]=_[_0xb2f1('0x17')](config['redis'],{'host':_0xb2f1('0x18'),'port':0x18eb});var socket=require(_0xb2f1('0x19'))(new Redis(config[_0xb2f1('0x16')]));require(_0xb2f1('0x1a'))['register'](socket);var jayson=require(_0xb2f1('0x1b'));var client=jayson['client'][_0xb2f1('0x1c')]({'port':0x232c});function checkPasswordPattern(_0xa6ec43,_0xab0fab,_0x20ff6b){if(_0x20ff6b){var _0x5da3f7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5da3f7[_0xb2f1('0x1d')](_0xab0fab)){return _0xa6ec43;}else{throw new db[(_0xb2f1('0x1e'))]['ValidationError'](_0xb2f1('0x1f'));}}else{return _0xa6ec43;}}function respondWithRpcPromise(_0x3c8fd9,_0x2e82d3,_0x307d46,_0x82981d){return new BPromise(function(_0x71acda,_0x3da3ff){var _0x237d54=_0x82981d||client;return _0x237d54[_0xb2f1('0x20')](_0x3c8fd9,_0x307d46)['then'](function(_0x198ce3){logger[_0xb2f1('0x21')](_0xb2f1('0x22'),_0x2e82d3,'request\x20sent');logger[_0xb2f1('0x23')](_0xb2f1('0x24'),_0x2e82d3,'request\x20sent',JSON[_0xb2f1('0x25')](_0x198ce3));if(_0x198ce3[_0xb2f1('0x26')]){if(_0x198ce3['error']['code']===0x1f4){logger[_0xb2f1('0x26')]('SmsAccount,\x20%s,\x20%s',_0x2e82d3,_0x198ce3['error'][_0xb2f1('0x27')]);return _0x3da3ff(_0x198ce3['error'][_0xb2f1('0x27')]);}logger[_0xb2f1('0x26')](_0xb2f1('0x22'),_0x2e82d3,_0x198ce3[_0xb2f1('0x26')]['message']);return _0x71acda(_0x198ce3['error'][_0xb2f1('0x27')]);}else{logger[_0xb2f1('0x21')](_0xb2f1('0x22'),_0x2e82d3,'request\x20sent');_0x71acda(_0x198ce3[_0xb2f1('0x28')][_0xb2f1('0x27')]);}})['catch'](function(_0x50608e){logger[_0xb2f1('0x26')](_0xb2f1('0x22'),_0x2e82d3,_0x50608e);_0x3da3ff(_0x50608e);});});}function respondWithStatusCode(_0x3c830b,_0x1c1874){_0x1c1874=_0x1c1874||0xcc;return function(_0x592abb){if(_0x592abb){return _0x3c830b['sendStatus'](_0x1c1874);}return _0x3c830b[_0xb2f1('0x29')](_0x1c1874)[_0xb2f1('0x2a')]();};}function respondWithResult(_0x39c7d8,_0x487f92){_0x487f92=_0x487f92||0xc8;return function(_0x5391a3){if(_0x5391a3){return _0x39c7d8[_0xb2f1('0x29')](_0x487f92)[_0xb2f1('0x2b')](_0x5391a3);}};}function respondWithFilteredResult(_0xa0518,_0x1a1e0a){return function(_0x2b126d){if(_0x2b126d){var _0x133357=_0x2b126d[_0xb2f1('0x2c')],_0x537dc7=_0x1a1e0a[_0xb2f1('0x2d')],_0x4974b9=_0x1a1e0a['offset']+_0x1a1e0a['limit'],_0x17510a;if(_0x4974b9>=_0x133357){_0x4974b9=_0x133357;_0x17510a=0xc8;}else{_0x17510a=0xce;}_0xa0518[_0xb2f1('0x29')](_0x17510a);return _0xa0518['set'](_0xb2f1('0x2e'),_0x537dc7+'-'+_0x4974b9+'/'+_0x133357)['json'](_0x2b126d);}return null;};}function patchUpdates(_0x669fc6){return function(_0x5188e8){try{jsonpatch['apply'](_0x5188e8,_0x669fc6,!![]);}catch(_0x28a1f6){return BPromise[_0xb2f1('0x2f')](_0x28a1f6);}return _0x5188e8['save']();};}function saveUpdates(_0x231267,_0x217b79){return function(_0x2c45cb){if(_0x2c45cb){return _0x2c45cb[_0xb2f1('0x30')](_0x231267)['then'](function(_0x1b4a64){return _0x1b4a64;});}return null;};}function removeEntity(_0x4365db,_0x5ca552){return function(_0x6efed4){if(_0x6efed4){return _0x6efed4[_0xb2f1('0x31')]()['then'](function(){var _0x9a161b=_0x6efed4[_0xb2f1('0x32')]({'plain':!![]});var _0x714aee=_0xb2f1('0x33');return db[_0xb2f1('0x34')]['destroy']({'where':{'type':_0x714aee,'resourceId':_0x9a161b['id']}})[_0xb2f1('0x35')](function(){return _0x6efed4;});})[_0xb2f1('0x35')](function(){_0x4365db[_0xb2f1('0x29')](0xcc)[_0xb2f1('0x2a')]();});}};}function handleEntityNotFound(_0x2e686c,_0x5911cc){return function(_0xd72425){if(!_0xd72425){_0x2e686c[_0xb2f1('0x36')](0x194);}return _0xd72425;};}function handleError(_0x320b25,_0x19965b){_0x19965b=_0x19965b||0x1f4;return function(_0x2bc66a){logger['error'](_0x2bc66a[_0xb2f1('0x37')]);if(_0x2bc66a['name']){delete _0x2bc66a[_0xb2f1('0x38')];}_0x320b25['status'](_0x19965b)[_0xb2f1('0x39')](_0x2bc66a);};}exports[_0xb2f1('0x3a')]=function(_0x447386,_0x506918){var _0x3e3a8a={'include':[{'model':db['Pause'],'as':_0xb2f1('0x3b')}]},_0x15d90c={},_0x571c7e={'count':0x0,'rows':[]};var _0x3f73a4=_['map'](db[_0xb2f1('0x3c')][_0xb2f1('0x3d')],function(_0x48590f){return{'name':_0x48590f[_0xb2f1('0x3e')],'type':_0x48590f[_0xb2f1('0x3f')]['key']};});_0x15d90c[_0xb2f1('0x40')]=_[_0xb2f1('0x41')](_0x3f73a4,'name');_0x15d90c['query']=_[_0xb2f1('0x42')](_0x447386['query']);_0x15d90c[_0xb2f1('0x43')]=_['intersection'](_0x15d90c[_0xb2f1('0x40')],_0x15d90c[_0xb2f1('0x44')]);_0x3e3a8a[_0xb2f1('0x45')]=_[_0xb2f1('0x46')](_0x15d90c[_0xb2f1('0x40')],qs[_0xb2f1('0x47')](_0x447386[_0xb2f1('0x44')]['fields']));_0x3e3a8a[_0xb2f1('0x45')]=_0x3e3a8a[_0xb2f1('0x45')][_0xb2f1('0x48')]?_0x3e3a8a['attributes']:_0x15d90c[_0xb2f1('0x40')];if(!_0x447386[_0xb2f1('0x44')][_0xb2f1('0x49')](_0xb2f1('0x4a'))){_0x3e3a8a[_0xb2f1('0x4b')]=qs['limit'](_0x447386[_0xb2f1('0x44')][_0xb2f1('0x4b')]);_0x3e3a8a[_0xb2f1('0x2d')]=qs[_0xb2f1('0x2d')](_0x447386[_0xb2f1('0x44')][_0xb2f1('0x2d')]);}_0x3e3a8a[_0xb2f1('0x4c')]=qs['sort'](_0x447386[_0xb2f1('0x44')][_0xb2f1('0x4d')]);_0x3e3a8a[_0xb2f1('0x4e')]=qs[_0xb2f1('0x43')](_[_0xb2f1('0x4f')](_0x447386[_0xb2f1('0x44')],_0x15d90c['filters']));if(_0x447386[_0xb2f1('0x44')][_0xb2f1('0x50')]){_0x3e3a8a[_0xb2f1('0x4e')]=_[_0xb2f1('0x51')](_0x3e3a8a['where'],{'$or':_[_0xb2f1('0x41')](_0x3f73a4,function(_0x5295d0){if(_0x5295d0[_0xb2f1('0x3f')]!==_0xb2f1('0x52')){var _0x248c90={};_0x248c90[_0x5295d0[_0xb2f1('0x38')]]={'$like':'%'+_0x447386[_0xb2f1('0x44')][_0xb2f1('0x50')]+'%'};return _0x248c90;}})});}_0x3e3a8a=_[_0xb2f1('0x51')]({},_0x3e3a8a,_0x447386[_0xb2f1('0x53')]);var _0xc13aa5={'where':_0x3e3a8a['where']};return db[_0xb2f1('0x3c')][_0xb2f1('0x2c')](_0xc13aa5)[_0xb2f1('0x35')](function(_0x4a4f3c){_0x571c7e[_0xb2f1('0x2c')]=_0x4a4f3c;if(_0x447386[_0xb2f1('0x44')]['includeAll']){_0x3e3a8a[_0xb2f1('0x54')]=[{'all':!![]}];}return db[_0xb2f1('0x3c')][_0xb2f1('0x55')](_0x3e3a8a);})['then'](function(_0x427fae){_0x571c7e[_0xb2f1('0x56')]=_0x427fae;return _0x571c7e;})[_0xb2f1('0x35')](respondWithFilteredResult(_0x506918,_0x3e3a8a))[_0xb2f1('0x57')](handleError(_0x506918,null));};exports['show']=function(_0x2fed04,_0x4d828e){var _0x49b967={'raw':![],'where':{'id':_0x2fed04[_0xb2f1('0x58')]['id']},'include':[{'model':db[_0xb2f1('0x59')],'as':'mandatoryDispositionPause'}]},_0x5f1450={};_0x5f1450['model']=_[_0xb2f1('0x42')](db['SmsAccount'][_0xb2f1('0x3d')]);_0x5f1450[_0xb2f1('0x44')]=_[_0xb2f1('0x42')](_0x2fed04[_0xb2f1('0x44')]);_0x5f1450['filters']=_[_0xb2f1('0x46')](_0x5f1450[_0xb2f1('0x40')],_0x5f1450[_0xb2f1('0x44')]);_0x49b967[_0xb2f1('0x45')]=_[_0xb2f1('0x46')](_0x5f1450[_0xb2f1('0x40')],qs[_0xb2f1('0x47')](_0x2fed04['query'][_0xb2f1('0x47')]));_0x49b967['attributes']=_0x49b967[_0xb2f1('0x45')][_0xb2f1('0x48')]?_0x49b967[_0xb2f1('0x45')]:_0x5f1450[_0xb2f1('0x40')];if(_0x2fed04['query']['includeAll']){_0x49b967[_0xb2f1('0x54')]=[{'all':!![]}];}_0x49b967=_[_0xb2f1('0x51')]({},_0x49b967,_0x2fed04['options']);return db['SmsAccount'][_0xb2f1('0x5a')](_0x49b967)[_0xb2f1('0x35')](handleEntityNotFound(_0x4d828e,null))[_0xb2f1('0x35')](respondWithResult(_0x4d828e,null))[_0xb2f1('0x57')](handleError(_0x4d828e,null));};exports[_0xb2f1('0x5b')]=function(_0x3dbf80,_0x221fad){return db[_0xb2f1('0x3c')][_0xb2f1('0x5b')](_0x3dbf80[_0xb2f1('0x5c')],{})[_0xb2f1('0x35')](function(_0x1d18f4){var _0x24985f=_0x3dbf80[_0xb2f1('0x5d')]['get']({'plain':!![]});if(!_0x24985f)throw new Error(_0xb2f1('0x5e'));if(_0x24985f[_0xb2f1('0x5f')]===_0xb2f1('0x5d')){var _0x4b7712=_0x1d18f4['get']({'plain':!![]});var _0x3e9b60=_0xb2f1('0x33');return db[_0xb2f1('0x60')]['find']({'where':{'name':_0x3e9b60,'userProfileId':_0x24985f[_0xb2f1('0x61')]},'raw':!![]})[_0xb2f1('0x35')](function(_0xede0a0){if(_0xede0a0&&_0xede0a0[_0xb2f1('0x62')]===0x0){return db[_0xb2f1('0x34')]['create']({'name':_0x4b7712['name'],'resourceId':_0x4b7712['id'],'type':_0xede0a0[_0xb2f1('0x38')],'sectionId':_0xede0a0['id']},{})[_0xb2f1('0x35')](function(){return _0x1d18f4;});}else{return _0x1d18f4;}})['catch'](function(_0x50acab){logger[_0xb2f1('0x26')](_0xb2f1('0x63'),_0x50acab);throw _0x50acab;});}return _0x1d18f4;})['then'](respondWithResult(_0x221fad,0xc9))[_0xb2f1('0x57')](handleError(_0x221fad,null));};exports['update']=function(_0xabfa68,_0x32a06e){if(_0xabfa68[_0xb2f1('0x5c')]['id']){delete _0xabfa68[_0xb2f1('0x5c')]['id'];}return db[_0xb2f1('0x3c')][_0xb2f1('0x5a')]({'where':{'id':_0xabfa68[_0xb2f1('0x58')]['id']},'include':[{'model':db[_0xb2f1('0x59')],'as':'mandatoryDispositionPause'}]})[_0xb2f1('0x35')](handleEntityNotFound(_0x32a06e,null))[_0xb2f1('0x35')](saveUpdates(_0xabfa68[_0xb2f1('0x5c')],null))['then'](respondWithResult(_0x32a06e,null))['catch'](handleError(_0x32a06e,null));};exports[_0xb2f1('0x31')]=function(_0x49ceff,_0x3903a5){return db[_0xb2f1('0x3c')]['find']({'where':{'id':_0x49ceff['params']['id']}})['then'](handleEntityNotFound(_0x3903a5,null))[_0xb2f1('0x35')](removeEntity(_0x3903a5,null))[_0xb2f1('0x57')](handleError(_0x3903a5,null));};exports[_0xb2f1('0x64')]=function(_0x414a3b,_0x5d373a){return db[_0xb2f1('0x3c')]['describe']()[_0xb2f1('0x35')](respondWithResult(_0x5d373a,null))[_0xb2f1('0x57')](handleError(_0x5d373a,null));};exports[_0xb2f1('0x65')]=function(_0xf45d9e,_0x25c727,_0x5103a9){if(_0xf45d9e[_0xb2f1('0x5c')]['id']){delete _0xf45d9e[_0xb2f1('0x5c')]['id'];}return db[_0xb2f1('0x3c')][_0xb2f1('0x5a')]({'where':{'id':_0xf45d9e['params']['id']}})['then'](handleEntityNotFound(_0x25c727,null))[_0xb2f1('0x35')](function(_0x2633ca){if(_0x2633ca){_0xf45d9e['body']['SmsAccountId']=_0x2633ca['id'];return db['Disposition'][_0xb2f1('0x5b')](_0xf45d9e[_0xb2f1('0x5c')]);}})['then'](respondWithResult(_0x25c727,null))[_0xb2f1('0x57')](handleError(_0x25c727,null));};exports[_0xb2f1('0x66')]=function(_0x1a757f,_0xe52dc3,_0x2174e9){var _0x5563b={'raw':![],'where':{}};var _0x264a7a={};var _0x2a34d0={'count':0x0,'rows':[]};return db[_0xb2f1('0x3c')]['findOne']({'where':{'id':_0x1a757f[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0xe52dc3,null))['then'](function(_0x5e86af){if(_0x5e86af){_0x264a7a[_0xb2f1('0x40')]=_[_0xb2f1('0x42')](db[_0xb2f1('0x67')][_0xb2f1('0x3d')]);_0x264a7a[_0xb2f1('0x44')]=_[_0xb2f1('0x42')](_0x1a757f[_0xb2f1('0x44')]);_0x264a7a[_0xb2f1('0x43')]=_[_0xb2f1('0x46')](_0x264a7a[_0xb2f1('0x40')],_0x264a7a[_0xb2f1('0x44')]);_0x5563b[_0xb2f1('0x45')]=_[_0xb2f1('0x46')](_0x264a7a[_0xb2f1('0x40')],qs[_0xb2f1('0x47')](_0x1a757f[_0xb2f1('0x44')][_0xb2f1('0x47')]));_0x5563b[_0xb2f1('0x45')]=_0x5563b[_0xb2f1('0x45')][_0xb2f1('0x48')]?_0x5563b['attributes']:_0x264a7a[_0xb2f1('0x40')];if(!_0x1a757f[_0xb2f1('0x44')][_0xb2f1('0x49')](_0xb2f1('0x4a'))){_0x5563b[_0xb2f1('0x4b')]=qs[_0xb2f1('0x4b')](_0x1a757f[_0xb2f1('0x44')][_0xb2f1('0x4b')]);_0x5563b[_0xb2f1('0x2d')]=qs['offset'](_0x1a757f[_0xb2f1('0x44')][_0xb2f1('0x2d')]);}_0x5563b[_0xb2f1('0x4c')]=qs[_0xb2f1('0x4d')](_0x1a757f[_0xb2f1('0x44')][_0xb2f1('0x4d')]);_0x5563b[_0xb2f1('0x4e')]=qs['filters'](_[_0xb2f1('0x4f')](_0x1a757f[_0xb2f1('0x44')],_0x264a7a['filters']));_0x5563b[_0xb2f1('0x4e')][_0xb2f1('0x68')]=_0x5e86af['id'];if(_0x1a757f[_0xb2f1('0x44')]['filter']){_0x5563b[_0xb2f1('0x4e')]=_[_0xb2f1('0x51')](_0x5563b[_0xb2f1('0x4e')],{'$or':_[_0xb2f1('0x41')](_0x5563b[_0xb2f1('0x45')],function(_0x42f5cd){var _0x74e729={};_0x74e729[_0x42f5cd]={'$like':'%'+_0x1a757f[_0xb2f1('0x44')][_0xb2f1('0x50')]+'%'};return _0x74e729;})});}_0x5563b=_[_0xb2f1('0x51')]({},_0x5563b,_0x1a757f[_0xb2f1('0x53')]);return db[_0xb2f1('0x67')][_0xb2f1('0x2c')]({'where':_0x5563b['where']})[_0xb2f1('0x35')](function(_0x3a06a2){_0x2a34d0[_0xb2f1('0x2c')]=_0x3a06a2;if(_0x1a757f[_0xb2f1('0x44')]['includeAll']){_0x5563b[_0xb2f1('0x54')]=[{'all':!![]}];}return db['Disposition'][_0xb2f1('0x55')](_0x5563b);})[_0xb2f1('0x35')](function(_0x1be3e8){_0x2a34d0['rows']=_0x1be3e8;return _0x2a34d0;});}})['then'](respondWithFilteredResult(_0xe52dc3,_0x5563b))[_0xb2f1('0x57')](handleError(_0xe52dc3,null));};exports[_0xb2f1('0x69')]=function(_0x33abf4,_0x469777,_0x518ada){return db[_0xb2f1('0x3c')][_0xb2f1('0x5a')]({'where':{'id':_0x33abf4['params']['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x469777,null))['then'](function(_0xe5dfcc){if(_0xe5dfcc){return _0xe5dfcc['removeDispositions'](_0x33abf4[_0xb2f1('0x44')][_0xb2f1('0x6a')]);}})[_0xb2f1('0x35')](respondWithStatusCode(_0x469777,null))[_0xb2f1('0x57')](handleError(_0x469777,null));};exports[_0xb2f1('0x6b')]=function(_0x5df10c,_0x12cc31,_0x4be4e0){if(_0x5df10c[_0xb2f1('0x5c')]['id']){delete _0x5df10c[_0xb2f1('0x5c')]['id'];}return db['SmsAccount'][_0xb2f1('0x5a')]({'where':{'id':_0x5df10c[_0xb2f1('0x58')]['id']}})['then'](handleEntityNotFound(_0x12cc31,null))[_0xb2f1('0x35')](function(_0x406188){if(_0x406188){_0x5df10c[_0xb2f1('0x5c')][_0xb2f1('0x68')]=_0x406188['id'];return db[_0xb2f1('0x6c')][_0xb2f1('0x5b')](_0x5df10c[_0xb2f1('0x5c')]);}})[_0xb2f1('0x35')](respondWithResult(_0x12cc31,null))[_0xb2f1('0x57')](handleError(_0x12cc31,null));};exports[_0xb2f1('0x6d')]=function(_0x3ecb51,_0x27f7c3,_0x4fb9a5){var _0x2ed4af={'raw':![],'where':{}};var _0x4a106b={};var _0x54c94a={'count':0x0,'rows':[]};return db['SmsAccount'][_0xb2f1('0x6e')]({'where':{'id':_0x3ecb51[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x27f7c3,null))[_0xb2f1('0x35')](function(_0x1d15c2){if(_0x1d15c2){_0x4a106b['model']=_[_0xb2f1('0x42')](db[_0xb2f1('0x6c')][_0xb2f1('0x3d')]);_0x4a106b['query']=_[_0xb2f1('0x42')](_0x3ecb51['query']);_0x4a106b[_0xb2f1('0x43')]=_[_0xb2f1('0x46')](_0x4a106b[_0xb2f1('0x40')],_0x4a106b[_0xb2f1('0x44')]);_0x2ed4af[_0xb2f1('0x45')]=_['intersection'](_0x4a106b['model'],qs[_0xb2f1('0x47')](_0x3ecb51[_0xb2f1('0x44')][_0xb2f1('0x47')]));_0x2ed4af['attributes']=_0x2ed4af[_0xb2f1('0x45')][_0xb2f1('0x48')]?_0x2ed4af[_0xb2f1('0x45')]:_0x4a106b[_0xb2f1('0x40')];if(!_0x3ecb51[_0xb2f1('0x44')][_0xb2f1('0x49')]('nolimit')){_0x2ed4af['limit']=qs[_0xb2f1('0x4b')](_0x3ecb51[_0xb2f1('0x44')][_0xb2f1('0x4b')]);_0x2ed4af[_0xb2f1('0x2d')]=qs['offset'](_0x3ecb51['query']['offset']);}_0x2ed4af['order']=qs['sort'](_0x3ecb51[_0xb2f1('0x44')][_0xb2f1('0x4d')]);_0x2ed4af[_0xb2f1('0x4e')]=qs[_0xb2f1('0x43')](_['pick'](_0x3ecb51[_0xb2f1('0x44')],_0x4a106b[_0xb2f1('0x43')]));_0x2ed4af[_0xb2f1('0x4e')][_0xb2f1('0x68')]=_0x1d15c2['id'];if(_0x3ecb51[_0xb2f1('0x44')][_0xb2f1('0x50')]){_0x2ed4af[_0xb2f1('0x4e')]=_[_0xb2f1('0x51')](_0x2ed4af[_0xb2f1('0x4e')],{'$or':_[_0xb2f1('0x41')](_0x2ed4af[_0xb2f1('0x45')],function(_0x289cb0){var _0x3dfbe0={};_0x3dfbe0[_0x289cb0]={'$like':'%'+_0x3ecb51[_0xb2f1('0x44')][_0xb2f1('0x50')]+'%'};return _0x3dfbe0;})});}_0x2ed4af=_[_0xb2f1('0x51')]({},_0x2ed4af,_0x3ecb51[_0xb2f1('0x53')]);return db[_0xb2f1('0x6c')][_0xb2f1('0x2c')]({'where':_0x2ed4af[_0xb2f1('0x4e')]})[_0xb2f1('0x35')](function(_0x5ab7b1){_0x54c94a[_0xb2f1('0x2c')]=_0x5ab7b1;if(_0x3ecb51[_0xb2f1('0x44')][_0xb2f1('0x6f')]){_0x2ed4af[_0xb2f1('0x54')]=[{'all':!![]}];}return db[_0xb2f1('0x6c')][_0xb2f1('0x55')](_0x2ed4af);})[_0xb2f1('0x35')](function(_0x42dedf){_0x54c94a['rows']=_0x42dedf;return _0x54c94a;});}})['then'](respondWithFilteredResult(_0x27f7c3,_0x2ed4af))['catch'](handleError(_0x27f7c3,null));};exports[_0xb2f1('0x70')]=function(_0xe68e9f,_0x2dd625,_0x598075){return db[_0xb2f1('0x3c')][_0xb2f1('0x5a')]({'where':{'id':_0xe68e9f[_0xb2f1('0x58')]['id']}})['then'](handleEntityNotFound(_0x2dd625,null))[_0xb2f1('0x35')](function(_0x4f2c8b){if(_0x4f2c8b){return _0x4f2c8b[_0xb2f1('0x70')](_0xe68e9f[_0xb2f1('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x2dd625,null))[_0xb2f1('0x57')](handleError(_0x2dd625,null));};exports[_0xb2f1('0x71')]=function(_0x4d78ab,_0x1726b4,_0x5398dc){var _0xfdf32f={'channel':_0xb2f1('0x72')};var _0x4f6dae=[];var _0x1ab0e8=[];var _0x290395={};return db[_0xb2f1('0x3c')][_0xb2f1('0x5a')]({'where':{'id':_0x4d78ab[_0xb2f1('0x58')]['id']},'include':[{'model':db[_0xb2f1('0x73')],'as':_0xb2f1('0x74')}]})[_0xb2f1('0x35')](handleEntityNotFound(_0x1726b4,null))[_0xb2f1('0x35')](function(_0x2aac81){_0xfdf32f[_0xb2f1('0x75')]=_0x2aac81;_0xfdf32f[_0xb2f1('0x76')]=_['orderBy'](_0x2aac81[_0xb2f1('0x74')],[_0xb2f1('0x77')],[_0xb2f1('0x78')]);if(_0xfdf32f[_0xb2f1('0x75')][_0xb2f1('0x74')]){delete _0xfdf32f[_0xb2f1('0x75')][_0xb2f1('0x74')];}return db['CmContact'][_0xb2f1('0x64')]();})['then'](function(_0x43af50){if(!_0x43af50){throw new db[(_0xb2f1('0x1e'))]['ValidationError'](_0xb2f1('0x79'));}_0x4f6dae=_[_0xb2f1('0x7a')](_[_0xb2f1('0x42')](_0x43af50),[_0xb2f1('0x7b'),_0xb2f1('0x7c')]);_0x1ab0e8=_[_0xb2f1('0x7a')](_[_0xb2f1('0x42')](_0x43af50),[_0xb2f1('0x7b'),_0xb2f1('0x7c'),_0xb2f1('0x7d'),_0xb2f1('0x7e')]);_0xfdf32f[_0xb2f1('0x5c')]={'mapKey':_0xb2f1('0x7f')};if(_0xfdf32f[_0xb2f1('0x75')][_0xb2f1('0x3f')]){switch(_0xfdf32f[_0xb2f1('0x75')][_0xb2f1('0x3f')]){case _0xb2f1('0x80'):_0xfdf32f[_0xb2f1('0x5c')]['from']=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x81')];_0xfdf32f[_0xb2f1('0x5c')]['body']=_0x4d78ab['body'][_0xb2f1('0x82')];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x83')]=_0x4d78ab[_0xb2f1('0x5c')]['MessageSid'];break;case'skebby':_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x84')]='+'+_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x85')];_0xfdf32f[_0xb2f1('0x5c')]['body']=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x86')];break;case _0xb2f1('0x87'):_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x84')]=_0x4d78ab['body']['from'];_0xfdf32f[_0xb2f1('0x5c')]['body']=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x27')];break;case _0xb2f1('0x88'):_0xfdf32f['body'][_0xb2f1('0x84')]=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x84')];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x5c')]=_0x4d78ab[_0xb2f1('0x5c')]['body'];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x83')]=_0x4d78ab[_0xb2f1('0x5c')]['message_id'];break;case _0xb2f1('0x89'):_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x84')]=_0x4d78ab['body'][_0xb2f1('0x81')];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x5c')]=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x8a')];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x83')]=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x8b')];break;case _0xb2f1('0x8c'):_0xfdf32f['body'][_0xb2f1('0x84')]='+'+_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x8d')][0x0][_0xb2f1('0x84')];_0xfdf32f['body']['body']=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x8d')][0x0][_0xb2f1('0x86')];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x83')]=_0x4d78ab['body'][_0xb2f1('0x8d')][0x0][_0xb2f1('0x83')];break;case _0xb2f1('0x8e'):_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x84')]=_0x4d78ab[_0xb2f1('0x5c')]['originatingAddress'];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x5c')]=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x8f')][_0xb2f1('0x27')];break;case _0xb2f1('0x90'):_0xfdf32f['body'][_0xb2f1('0x84')]=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x91')];_0xfdf32f['body']['body']=_0x4d78ab['body'][_0xb2f1('0x86')];_0xfdf32f[_0xb2f1('0x5c')]['messageId']=_0x4d78ab[_0xb2f1('0x5c')]['replyMessageId'];break;case _0xb2f1('0x92'):_0xfdf32f[_0xb2f1('0x5c')]['from']=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x84')];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x5c')]=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x27')];_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x83')]=_0x4d78ab[_0xb2f1('0x5c')][_0xb2f1('0x93')];break;}}if(_0xfdf32f[_0xb2f1('0x5c')]['id']){delete _0xfdf32f[_0xb2f1('0x5c')]['id'];}if(_[_0xb2f1('0x94')](_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x84')])){throw new db[(_0xb2f1('0x1e'))][(_0xb2f1('0x95'))](_0xb2f1('0x96'));}if(_[_0xb2f1('0x94')](_0xfdf32f['body'][_0xb2f1('0x5c')])||_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x5c')]===''){throw new db[(_0xb2f1('0x1e'))]['ValidationError'](_0xb2f1('0x97'));}if(_[_0xb2f1('0x94')](_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x98')])){throw new db[(_0xb2f1('0x1e'))][(_0xb2f1('0x95'))](_0xb2f1('0x99')+_0x1ab0e8);}if(!_[_0xb2f1('0x9a')](_0x1ab0e8,_0xfdf32f['body'][_0xb2f1('0x98')])){throw new db[(_0xb2f1('0x1e'))][(_0xb2f1('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ab0e8);}_0x290395[_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x98')]]=_0xfdf32f['body'][_0xb2f1('0x84')];return db['CmList'][_0xb2f1('0x5a')]({'where':{'id':_0xfdf32f[_0xb2f1('0x75')]['ListId']},'include':[{'model':db[_0xb2f1('0x9b')],'as':_0xb2f1('0x9c'),'where':_0x290395,'limit':0x1,'order':[[_0xb2f1('0x7c'),_0xb2f1('0x9d')]]}]});})[_0xb2f1('0x35')](handleEntityNotFound(_0x1726b4,null))[_0xb2f1('0x35')](function(_0x5959b7){if(_0x5959b7){_0xfdf32f['list']=_[_0xb2f1('0x9e')](_0x5959b7,['Contacts']);if(_0x5959b7[_0xb2f1('0x9c')][_0xb2f1('0x48')]){return _0x5959b7[_0xb2f1('0x9c')][0x0];}var _0x5767fa=_[_0xb2f1('0x17')](_0xfdf32f[_0xb2f1('0x5c')],{'firstName':_0xfdf32f['body'][_0xb2f1('0x84')],'ListId':_0x5959b7['id']});_0x5767fa[_0xfdf32f['body'][_0xb2f1('0x98')]]=_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x84')];return db[_0xb2f1('0x9b')][_0xb2f1('0x5b')](_0x5767fa,{'fields':_0x4f6dae,'raw':!![]});}})['then'](handleEntityNotFound(_0x1726b4,null))[_0xb2f1('0x35')](function(_0x3f8acc){if(_0x3f8acc){_0xfdf32f[_0xb2f1('0x9f')]=_0x3f8acc;var _0x435653={'ContactId':_0x3f8acc['id'],'phone':_0xfdf32f['body'][_0xb2f1('0x84')],'SmsAccountId':_0x4d78ab[_0xb2f1('0x58')]['id']};var _0x5aab2e={'ContactId':_0x3f8acc['id'],'SmsAccountId':_0x4d78ab[_0xb2f1('0x58')]['id'],'closed':![]};return db[_0xb2f1('0xa0')]['find']({'where':_0x5aab2e})[_0xb2f1('0x35')](function(_0x4e9fc2){if(_0x4e9fc2){return[_0x4e9fc2,![]];}return db['SmsInteraction'][_0xb2f1('0x5b')](_0x435653)[_0xb2f1('0x35')](function(_0x329c50){return[_0x329c50,!![]];});});}})['spread'](function(_0x102a05,_0x4ea148){_0xfdf32f[_0xb2f1('0xa1')]=_0x102a05['get']({'plain':!![]});_0xfdf32f['interaction'][_0xb2f1('0xa2')]=![];if(_0x4ea148){if(_0xfdf32f[_0xb2f1('0x75')][_0xb2f1('0xa3')]){_0xfdf32f['applications'][_0xb2f1('0xa4')]({'id':0x0,'priority':_0xfdf32f[_0xb2f1('0x76')]['length']+0x1,'app':_0xb2f1('0xa5'),'appdata':_0xb2f1('0xa6'),'interval':_0xb2f1('0xa7')});}_0xfdf32f[_0xb2f1('0xa1')][_0xb2f1('0xa2')]=!![];}return db[_0xb2f1('0xa8')][_0xb2f1('0x5b')]({'phone':_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x84')],'messageId':_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x83')],'body':_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0x5c')],'SmsAccountId':_0x4d78ab[_0xb2f1('0x58')]['id'],'SmsInteractionId':_0x102a05['id'],'direction':'in','ContactId':_0x102a05[_0xb2f1('0xa9')],'AttachmentId':_0xfdf32f[_0xb2f1('0x5c')][_0xb2f1('0xaa')]});})[_0xb2f1('0x35')](function(_0x6e9356){_0xfdf32f[_0xb2f1('0x27')]=_0x6e9356;if(_0xfdf32f[_0xb2f1('0xa1')]['UserId']){return db['User']['find']({'attributes':['id',_0xb2f1('0x38')],'where':{'id':_0xfdf32f[_0xb2f1('0xa1')][_0xb2f1('0xab')]}})[_0xb2f1('0x35')](function(_0x40048f){if(_0x40048f){_0xfdf32f[_0xb2f1('0x76')][_0xb2f1('0xac')]({'id':0x0,'priority':0x0,'app':_0xb2f1('0xad'),'appdata':_0x40048f[_0xb2f1('0x38')]+','+(_0xfdf32f[_0xb2f1('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0xb2f1('0xa7')});}return respondWithRpcPromise('Start',_0xb2f1('0xae'),_0xfdf32f);});}return respondWithRpcPromise(_0xb2f1('0xaf'),_0xb2f1('0xae'),_0xfdf32f);})[_0xb2f1('0x35')](function(_0x55d93a){if(_0x55d93a){var _0xbf7bbd=0xc8;var _0x4b8c3c=_0xb2f1('0xb0');logger[_0xb2f1('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4b8c3c,_0xbf7bbd,'entity\x20found');logger[_0xb2f1('0x23')](_0xb2f1('0xb1'),_0x4b8c3c,_0xbf7bbd,_0xb2f1('0xb2'),JSON[_0xb2f1('0x25')](_0x55d93a));if(_0xfdf32f[_0xb2f1('0x75')]['type']===_0xb2f1('0x80')){return _0x1726b4[_0xb2f1('0x29')](_0xbf7bbd)[_0xb2f1('0xb3')](_0xb2f1('0xb4'),_0xb2f1('0xb5'))[_0xb2f1('0x39')](_0xb2f1('0xb6'));}else{return _0x1726b4[_0xb2f1('0x29')](_0xbf7bbd)[_0xb2f1('0x2b')](_0x55d93a);}}})[_0xb2f1('0x57')](handleError(_0x1726b4,null));};exports[_0xb2f1('0xb7')]=function(_0x4b1bba,_0x3569fc,_0x274793){return db[_0xb2f1('0x3c')][_0xb2f1('0x6e')]({'where':{'id':_0x4b1bba[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x3569fc,null))[_0xb2f1('0x35')](function(_0x4fccd6){if(_0x4fccd6){return db['sequelize'][_0xb2f1('0xb8')](function(_0x1af394){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x4b1bba[_0xb2f1('0x58')]['id']},'transaction':_0x1af394})[_0xb2f1('0x35')](function(_0x236298){var _0x364569=_[_0xb2f1('0x41')](_0x4b1bba[_0xb2f1('0x5c')],function(_0x16f9b7){_0x16f9b7['SmsAccountId']=_0x4b1bba[_0xb2f1('0x58')]['id'];return _0x16f9b7;});return db[_0xb2f1('0x73')][_0xb2f1('0xb9')](_0x364569,{'transaction':_0x1af394});});})[_0xb2f1('0x35')](function(){return db[_0xb2f1('0x73')][_0xb2f1('0xba')]({'where':{'SmsAccountId':_0x4b1bba[_0xb2f1('0x58')]['id']},'order':_0xb2f1('0x77')});});}})[_0xb2f1('0x35')](respondWithResult(_0x3569fc,null))[_0xb2f1('0x57')](handleError(_0x3569fc,null));};exports['getApplications']=function(_0x1a4857,_0x511150,_0x5c152b){var _0x4204a7={};var _0xe01162={};var _0x157873;var _0x5e3f12;return db['SmsAccount']['findOne']({'where':{'id':_0x1a4857[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x511150,null))[_0xb2f1('0x35')](function(_0x43d812){if(_0x43d812){_0x157873=_0x43d812;_0xe01162['model']=_[_0xb2f1('0x42')](db['SmsApplication']['rawAttributes']);_0xe01162[_0xb2f1('0x44')]=_['keys'](_0x1a4857['query']);_0xe01162[_0xb2f1('0x43')]=_[_0xb2f1('0x46')](_0xe01162[_0xb2f1('0x40')],_0xe01162['query']);_0x4204a7[_0xb2f1('0x45')]=_['intersection'](_0xe01162[_0xb2f1('0x40')],qs[_0xb2f1('0x47')](_0x1a4857[_0xb2f1('0x44')]['fields']));_0x4204a7['attributes']=_0x4204a7['attributes']['length']?_0x4204a7[_0xb2f1('0x45')]:_0xe01162[_0xb2f1('0x40')];_0x4204a7[_0xb2f1('0x4c')]=qs['sort'](_0x1a4857[_0xb2f1('0x44')][_0xb2f1('0x4d')]);_0x4204a7['where']=qs[_0xb2f1('0x43')](_['pick'](_0x1a4857[_0xb2f1('0x44')],_0xe01162[_0xb2f1('0x43')]));if(_0x1a4857[_0xb2f1('0x44')][_0xb2f1('0x50')]){_0x4204a7['where']=_[_0xb2f1('0x51')](_0x4204a7[_0xb2f1('0x4e')],{'$or':_[_0xb2f1('0x41')](_0x4204a7[_0xb2f1('0x45')],function(_0x340174){var _0x58f722={};_0x58f722[_0x340174]={'$like':'%'+_0x1a4857[_0xb2f1('0x44')][_0xb2f1('0x50')]+'%'};return _0x58f722;})});}_0x4204a7=_[_0xb2f1('0x51')]({},_0x4204a7,_0x1a4857['options']);return _0x157873[_0xb2f1('0xbb')](_0x4204a7);}})[_0xb2f1('0x35')](function(_0x51db37){if(_0x51db37){_0x5e3f12=_0x51db37[_0xb2f1('0x48')];if(!_0x1a4857['query']['hasOwnProperty'](_0xb2f1('0x4a'))){_0x4204a7['limit']=qs[_0xb2f1('0x4b')](_0x1a4857[_0xb2f1('0x44')][_0xb2f1('0x4b')]);_0x4204a7[_0xb2f1('0x2d')]=qs[_0xb2f1('0x2d')](_0x1a4857[_0xb2f1('0x44')]['offset']);}return _0x157873[_0xb2f1('0xbb')](_0x4204a7);}})[_0xb2f1('0x35')](function(_0x195e84){if(_0x195e84){return _0x195e84?{'count':_0x5e3f12,'rows':_0x195e84}:null;}})['then'](respondWithResult(_0x511150,null))[_0xb2f1('0x57')](handleError(_0x511150,null));};exports[_0xb2f1('0xbc')]=function(_0x38e972,_0x4873bd,_0x5a8e30){var _0x3ce17a={'raw':![],'where':{}};var _0x58c543={};var _0x26be2a={'count':0x0,'rows':[]};return db[_0xb2f1('0x3c')][_0xb2f1('0x6e')]({'where':{'id':_0x38e972[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x4873bd,null))['then'](function(_0x1958e0){if(_0x1958e0){_0x58c543[_0xb2f1('0x40')]=_['keys'](db[_0xb2f1('0xa0')][_0xb2f1('0x3d')]);_0x58c543[_0xb2f1('0x44')]=_[_0xb2f1('0x42')](_0x38e972[_0xb2f1('0x44')]);_0x58c543[_0xb2f1('0x43')]=_[_0xb2f1('0x46')](_0x58c543[_0xb2f1('0x40')],_0x58c543[_0xb2f1('0x44')]);_0x3ce17a[_0xb2f1('0x45')]=_[_0xb2f1('0x46')](_0x58c543['model'],qs[_0xb2f1('0x47')](_0x38e972[_0xb2f1('0x44')]['fields']));_0x3ce17a[_0xb2f1('0x45')]=_0x3ce17a[_0xb2f1('0x45')][_0xb2f1('0x48')]?_0x3ce17a[_0xb2f1('0x45')]:_0x58c543['model'];if(!_0x38e972[_0xb2f1('0x44')][_0xb2f1('0x49')](_0xb2f1('0x4a'))){_0x3ce17a[_0xb2f1('0x4b')]=qs[_0xb2f1('0x4b')](_0x38e972[_0xb2f1('0x44')][_0xb2f1('0x4b')]);_0x3ce17a[_0xb2f1('0x2d')]=qs[_0xb2f1('0x2d')](_0x38e972[_0xb2f1('0x44')][_0xb2f1('0x2d')]);}_0x3ce17a[_0xb2f1('0x4c')]=qs['sort'](_0x38e972[_0xb2f1('0x44')]['sort']);_0x3ce17a[_0xb2f1('0x4e')]=qs[_0xb2f1('0x43')](_[_0xb2f1('0x4f')](_0x38e972[_0xb2f1('0x44')],_0x58c543[_0xb2f1('0x43')]));_0x3ce17a[_0xb2f1('0x4e')][_0xb2f1('0x68')]=_0x1958e0['id'];if(_0x38e972[_0xb2f1('0x44')][_0xb2f1('0x50')]){_0x3ce17a[_0xb2f1('0x4e')]=_[_0xb2f1('0x51')](_0x3ce17a[_0xb2f1('0x4e')],{'$or':_[_0xb2f1('0x41')](_0x3ce17a[_0xb2f1('0x45')],function(_0x3ab408){var _0x536630={};_0x536630[_0x3ab408]={'$like':'%'+_0x38e972[_0xb2f1('0x44')][_0xb2f1('0x50')]+'%'};return _0x536630;})});}_0x3ce17a=_['merge']({},_0x3ce17a,_0x38e972['options']);return db[_0xb2f1('0xa0')][_0xb2f1('0x2c')]({'where':_0x3ce17a[_0xb2f1('0x4e')]})['then'](function(_0x41c07c){_0x26be2a[_0xb2f1('0x2c')]=_0x41c07c;if(_0x38e972[_0xb2f1('0x44')][_0xb2f1('0x6f')]){_0x3ce17a['include']=[{'model':db['CmContact'],'as':_0xb2f1('0xbd'),'required':![]},{'model':db[_0xb2f1('0xbe')],'as':_0xb2f1('0xbf'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xb2f1('0xc0')],'as':'Tags','attributes':['id',_0xb2f1('0x38'),'color'],'where':_0x38e972[_0xb2f1('0x44')][_0xb2f1('0xc1')]?{'id':_0x38e972['query'][_0xb2f1('0xc1')]}:undefined,'required':_0x38e972[_0xb2f1('0x44')][_0xb2f1('0xc1')]?!![]:![]}];}return db[_0xb2f1('0xa0')][_0xb2f1('0x55')](_0x3ce17a);})[_0xb2f1('0x35')](function(_0x581bc5){_0x26be2a['rows']=_0x581bc5;return _0x26be2a;});}})['then'](respondWithFilteredResult(_0x4873bd,_0x3ce17a))[_0xb2f1('0x57')](handleError(_0x4873bd,null));};exports[_0xb2f1('0x39')]=function(_0x3a1a6a,_0x3c008b,_0x350685){var _0x3ce5d0,_0x1e9bd3,_0xcbda88;if(_[_0xb2f1('0x94')](_0x3a1a6a[_0xb2f1('0x5c')]['body'])||_0x3a1a6a[_0xb2f1('0x5c')]['body']===''){throw new db[(_0xb2f1('0x1e'))]['ValidationError'](_0xb2f1('0x97'));}if(_[_0xb2f1('0x94')](_0x3a1a6a[_0xb2f1('0x5c')]['to'])){throw new db[(_0xb2f1('0x1e'))]['ValidationError']('to\x20is\x20mandatory');}_0x3ce5d0=_0x3a1a6a[_0xb2f1('0x5c')]['to'];return db['SmsAccount'][_0xb2f1('0x5a')]({'where':{'id':_0x3a1a6a['params']['id']},'include':[{'model':db['CmList'],'as':_0xb2f1('0xc2'),'include':[{'model':db['CmContact'],'as':_0xb2f1('0x9c'),'where':{'mobile':_0x3ce5d0},'limit':0x1,'order':[[_0xb2f1('0x7c'),_0xb2f1('0x9d')]]}]}]})[_0xb2f1('0x35')](handleEntityNotFound(_0x3c008b,null))['then'](function(_0x309668){if(_0x309668&&_0x309668['List']){_0x1e9bd3=_0x309668[_0xb2f1('0x32')]({'plain':!![]});if(_0x1e9bd3[_0xb2f1('0xc2')]&&_0x1e9bd3[_0xb2f1('0xc2')][_0xb2f1('0x9c')][_0xb2f1('0x48')]){return _0x1e9bd3[_0xb2f1('0xc2')][_0xb2f1('0x9c')][0x0];}return db[_0xb2f1('0x9b')][_0xb2f1('0x5b')](_['defaults'](_0x3a1a6a[_0xb2f1('0x5c')],{'firstName':_0x3ce5d0,'mobile':_0x3ce5d0,'phone':_0x3ce5d0,'ListId':_0x1e9bd3['ListId']}));}})[_0xb2f1('0x35')](handleEntityNotFound(_0x3c008b,null))[_0xb2f1('0x35')](function(_0x296968){if(_0x296968){_0xcbda88=_0x296968;return db[_0xb2f1('0xa0')]['find']({'where':{'ContactId':_0xcbda88['id'],'closed':![],'SmsAccountId':_0x1e9bd3['id']}})[_0xb2f1('0x35')](function(_0x493a42){if(_0x493a42){return[_0x493a42,![]];}return db[_0xb2f1('0xa0')]['create']({'UserId':_0x3a1a6a[_0xb2f1('0x5d')]['id'],'ContactId':_0xcbda88['id'],'SmsAccountId':_0x1e9bd3['id'],'phone':_0x3ce5d0,'firstMsgDirection':_0xb2f1('0xc3'),'Messages':[_[_0xb2f1('0x51')](_0x3a1a6a[_0xb2f1('0x5c')],{'read':![],'body':_0x3a1a6a[_0xb2f1('0x5c')][_0xb2f1('0x5c')],'phone':_0x3ce5d0,'SmsAccountId':_0x1e9bd3['id'],'UserId':_0x3a1a6a['user']['id'],'ContactId':_0xcbda88['id']})]},{'include':[{'model':db[_0xb2f1('0xa8')],'as':_0xb2f1('0xc4')}]})[_0xb2f1('0x35')](function(_0x24b73b){return[_0x24b73b,!![]];});});}})[_0xb2f1('0xc5')](function(_0x33e306,_0x112635){if(_0x112635){return _0x33e306;}return db[_0xb2f1('0xa8')][_0xb2f1('0x5b')](_[_0xb2f1('0x51')](_0x3a1a6a[_0xb2f1('0x5c')],{'read':![],'body':_0x3a1a6a['body'][_0xb2f1('0x5c')],'phone':_0x3ce5d0,'SmsAccountId':_0x1e9bd3['id'],'SmsInteractionId':_0x33e306['id'],'UserId':_0x3a1a6a[_0xb2f1('0x5d')]['id'],'ContactId':_0xcbda88['id']}))[_0xb2f1('0x35')](function(_0x2d6a81){_0x33e306[_0xb2f1('0xc6')][_0xb2f1('0xc4')]=[];_0x33e306[_0xb2f1('0xc6')][_0xb2f1('0xc4')]['push'](_0x2d6a81[_0xb2f1('0xc6')]);return _0x33e306;});})[_0xb2f1('0x35')](respondWithResult(_0x3c008b,null))['catch'](handleError(_0x3c008b,null));};exports[_0xb2f1('0x29')]=function(_0x1e223a,_0x2c20c5,_0x3c89e9){if(_0x1e223a[_0xb2f1('0x5c')]['id']){delete _0x1e223a['body']['id'];}console['log'](_0xb2f1('0xc7'),_0x1e223a[_0xb2f1('0x5c')]);var _0x3ab610,_0x3ed226,_0x52e708;return db['SmsAccount']['find']({'where':{'id':_0x1e223a[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x2c20c5,null))['then'](function(_0x2f6ba3){if(_0x2f6ba3){_0x52e708=_0x2f6ba3;logger[_0xb2f1('0x23')](_0xb2f1('0x24'),_0xb2f1('0x29'),_0xb2f1('0xc8'),_0x2f6ba3['type'],util[_0xb2f1('0xc9')](_0x1e223a[_0xb2f1('0x5c')],{'showHidden':![],'depth':null}));switch(_0x2f6ba3['type']){case'skebby':if(_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0xca')]&&_0x1e223a['body'][_0xb2f1('0x29')]){_0x3ed226=_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0x29')];return db[_0xb2f1('0xa8')]['find']({'where':{'messageId':_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0xca')]}});}break;case _0xb2f1('0x87'):if(_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0xcb')]&&_0x1e223a[_0xb2f1('0x5c')]['statusInt']){_0x3ed226=_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0xcc')];return db[_0xb2f1('0xa8')][_0xb2f1('0x5a')]({'where':{'messageId':_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0xcb')]}});}break;case _0xb2f1('0x88'):if(_0x1e223a['body'][_0xb2f1('0xcd')]&&_0x1e223a['body'][_0xb2f1('0xce')]){_0x3ed226=_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0xce')];return db[_0xb2f1('0xa8')][_0xb2f1('0x5a')]({'where':{'messageId':_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0xcd')]}});}break;case'infobip':var _0x32ed99=_0x1e223a['body'][_0xb2f1('0x8d')][0x0];if(_0x32ed99[_0xb2f1('0x83')]&&_0x32ed99[_0xb2f1('0x29')][_0xb2f1('0xcf')]==='DELIVERED'){_0x3ed226=_0x32ed99['status'][_0xb2f1('0xcf')];return db['SmsMessage'][_0xb2f1('0x5a')]({'where':{'messageId':_0x32ed99[_0xb2f1('0x83')]}});}break;case _0xb2f1('0x90'):if(_0x1e223a['body'][_0xb2f1('0x83')]&&_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0x29')]){_0x3ed226=_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0x29')];return db[_0xb2f1('0xa8')][_0xb2f1('0x5a')]({'where':{'messageId':_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0x83')]}});}break;case'intelepeer':if(_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0xd0')]&&_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0x29')]){_0x3ed226=_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0x29')];return db[_0xb2f1('0xa8')]['find']({'where':{'messageId':_0x1e223a['body'][_0xb2f1('0xd0')]}});}break;}}})[_0xb2f1('0x35')](handleEntityNotFound(_0x2c20c5,null))['then'](function(_0x521c83){if(_0x521c83){_0x3ab610=_0x521c83;switch(_0x52e708[_0xb2f1('0x3f')]){case _0xb2f1('0xd1'):if(_0x3ed226===_0xb2f1('0xd2')){return _0x3ab610['update']({'read':!![]});}else{logger[_0xb2f1('0x26')](_0xb2f1('0x24'),_0xb2f1('0x29'),_0xb2f1('0xd1'),util['inspect'](_0x1e223a[_0xb2f1('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb2f1('0x87'):if(_0x3ed226==='1'){return _0x3ab610['update']({'read':!![]});}else{logger[_0xb2f1('0x26')](_0xb2f1('0x24'),_0xb2f1('0x29'),_0xb2f1('0xd1'),util['inspect'](_0x1e223a[_0xb2f1('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb2f1('0x88'):if(!_0x1e223a['body'][_0xb2f1('0xd3')]&&_0x3ed226>=0xc8&&_0x3ed226<=0xce){return _0x3ab610[_0xb2f1('0x30')]({'read':!![]});}else{logger[_0xb2f1('0x26')](_0xb2f1('0x24'),'status',_0xb2f1('0x88'),util['inspect'](_0x1e223a[_0xb2f1('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb2f1('0x8c'):var _0x3e08d6=_0x1e223a[_0xb2f1('0x5c')][_0xb2f1('0x8d')][0x0];if(_0x3e08d6[_0xb2f1('0x29')][_0xb2f1('0xcf')]===_0xb2f1('0xd2')){return _0x3ab610[_0xb2f1('0x30')]({'read':!![]});}else{logger[_0xb2f1('0x26')](_0xb2f1('0x24'),_0xb2f1('0x29'),_0xb2f1('0x8c'),util[_0xb2f1('0xc9')](_0x1e223a[_0xb2f1('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb2f1('0x90'):if(_0x3ed226==_0xb2f1('0xd4')||_0x3ed226=='RECEIVED_BY_RECIPIENT'){return _0x3ab610[_0xb2f1('0x30')]({'read':!![]});}else{logger[_0xb2f1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb2f1('0x29'),'clickatell',util[_0xb2f1('0xc9')](_0x1e223a['body'],{'showHidden':![],'depth':null}));}break;case _0xb2f1('0x92'):if(_0x3ed226===_0xb2f1('0xd5')||_0x3ed226==='ACCEPTD'){return _0x3ab610[_0xb2f1('0x30')]({'read':!![]});}else{logger[_0xb2f1('0x26')](_0xb2f1('0x24'),'status','intelepeer',util[_0xb2f1('0xc9')](_0x1e223a[_0xb2f1('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x3ab610;}})[_0xb2f1('0x35')](respondWithResult(_0x2c20c5,null))[_0xb2f1('0x57')](handleError(_0x2c20c5,null));};exports['statusGet']=function(_0x5b0fd5,_0x5abe2d,_0x395ffd){var _0x10ff0b,_0xea2fa7,_0x14d04b;return db['SmsAccount']['find']({'where':{'id':_0x5b0fd5[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x5abe2d,null))[_0xb2f1('0x35')](function(_0x46a425){if(_0x46a425){_0x14d04b=_0x46a425;logger[_0xb2f1('0x23')](_0xb2f1('0x24'),_0xb2f1('0x29'),'received\x20delivery\x20report\x20from',_0x46a425[_0xb2f1('0x3f')],util[_0xb2f1('0xc9')](_0x5b0fd5[_0xb2f1('0x44')],{'showHidden':![],'depth':null}));switch(_0x46a425[_0xb2f1('0x3f')]){case _0xb2f1('0x8e'):if(_0x5b0fd5[_0xb2f1('0x44')]['message-id']&&_0x5b0fd5[_0xb2f1('0x44')][_0xb2f1('0xd6')]){_0xea2fa7=_0x5b0fd5['query']['state'];return db[_0xb2f1('0xa8')][_0xb2f1('0x5a')]({'where':{'messageId':_0x5b0fd5[_0xb2f1('0x44')]['message-id']}});}break;}}})[_0xb2f1('0x35')](handleEntityNotFound(_0x5abe2d,null))[_0xb2f1('0x35')](function(_0x4fec1f){if(_0x4fec1f){_0x10ff0b=_0x4fec1f;switch(_0x14d04b[_0xb2f1('0x3f')]){case'csc':if(_0xea2fa7==='2'||_0xea2fa7==='6'){return _0x10ff0b['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb2f1('0x29'),_0xb2f1('0x8e'),util[_0xb2f1('0xc9')](_0x5b0fd5[_0xb2f1('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x10ff0b;}})[_0xb2f1('0x35')](respondWithResult(_0x5abe2d,null))['catch'](handleError(_0x5abe2d,null));};exports['addAgents']=function(_0x16d7fb,_0x4c4a18,_0x3af5ee){return db[_0xb2f1('0x3c')][_0xb2f1('0x5a')]({'where':{'id':_0x16d7fb[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x4c4a18,null))[_0xb2f1('0x35')](function(_0x1d5461){if(_0x1d5461){return _0x1d5461[_0xb2f1('0xd7')](_0x16d7fb[_0xb2f1('0x5c')][_0xb2f1('0x6a')],_[_0xb2f1('0x9e')](_0x16d7fb['body'],[_0xb2f1('0x6a'),'id'])||{})[_0xb2f1('0xc5')](function(_0x1c9093){for(var _0x32a6d3=0x0;_0x32a6d3<_0x16d7fb['body'][_0xb2f1('0x6a')][_0xb2f1('0x48')];_0x32a6d3+=0x1){socket['emit'](_0xb2f1('0xd8'),{'UserId':_0x16d7fb[_0xb2f1('0x5c')]['ids'][_0x32a6d3],'SmsAccountId':_0x16d7fb[_0xb2f1('0x58')]['id']});}return _0x1c9093;});}})[_0xb2f1('0x35')](respondWithResult(_0x4c4a18,null))[_0xb2f1('0x57')](handleError(_0x4c4a18,null));};exports[_0xb2f1('0xd9')]=function(_0x1313d7,_0x34b4f5,_0x265e7a){return db[_0xb2f1('0x3c')][_0xb2f1('0x5a')]({'where':{'id':_0x1313d7['params']['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x34b4f5,null))['then'](function(_0x125eed){if(_0x125eed){return _0x125eed[_0xb2f1('0xd9')](_0x1313d7[_0xb2f1('0x44')][_0xb2f1('0x6a')])['then'](function(){if(_[_0xb2f1('0xda')](_0x1313d7[_0xb2f1('0x44')][_0xb2f1('0x6a')])){for(var _0xddc01e=0x0;_0xddc01e<_0x1313d7[_0xb2f1('0x44')][_0xb2f1('0x6a')][_0xb2f1('0x48')];_0xddc01e+=0x1){socket[_0xb2f1('0xdb')](_0xb2f1('0xdc'),{'UserId':Number(_0x1313d7['query'][_0xb2f1('0x6a')][_0xddc01e]),'SmsAccountId':Number(_0x1313d7[_0xb2f1('0x58')]['id'])});}}else{socket[_0xb2f1('0xdb')](_0xb2f1('0xdc'),{'UserId':Number(_0x1313d7[_0xb2f1('0x44')][_0xb2f1('0x6a')]),'SmsAccountId':Number(_0x1313d7[_0xb2f1('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x34b4f5,null))['catch'](handleError(_0x34b4f5,null));};exports[_0xb2f1('0xdd')]=function(_0x23ff48,_0x4ec008,_0x347eb3){var _0x63e56e={};var _0x593aff={};var _0x30d3f7;var _0x5bb26b;return db[_0xb2f1('0x3c')][_0xb2f1('0x6e')]({'where':{'id':_0x23ff48[_0xb2f1('0x58')]['id']}})[_0xb2f1('0x35')](handleEntityNotFound(_0x4ec008,null))[_0xb2f1('0x35')](function(_0x357a69){if(_0x357a69){_0x30d3f7=_0x357a69;_0x593aff[_0xb2f1('0x40')]=_['keys'](db[_0xb2f1('0xbe')][_0xb2f1('0x3d')]);_0x593aff[_0xb2f1('0x44')]=_[_0xb2f1('0x42')](_0x23ff48[_0xb2f1('0x44')]);_0x593aff['filters']=_[_0xb2f1('0x46')](_0x593aff[_0xb2f1('0x40')],_0x593aff[_0xb2f1('0x44')]);_0x63e56e['attributes']=_[_0xb2f1('0x46')](_0x593aff['model'],qs['fields'](_0x23ff48['query'][_0xb2f1('0x47')]));_0x63e56e[_0xb2f1('0x45')]=_0x63e56e[_0xb2f1('0x45')][_0xb2f1('0x48')]?_0x63e56e[_0xb2f1('0x45')]:_0x593aff[_0xb2f1('0x40')];_0x63e56e[_0xb2f1('0x4c')]=qs[_0xb2f1('0x4d')](_0x23ff48[_0xb2f1('0x44')][_0xb2f1('0x4d')]);_0x63e56e[_0xb2f1('0x4e')]=qs[_0xb2f1('0x43')](_[_0xb2f1('0x4f')](_0x23ff48[_0xb2f1('0x44')],_0x593aff[_0xb2f1('0x43')]));if(_0x23ff48[_0xb2f1('0x44')]['filter']){_0x63e56e['where']=_[_0xb2f1('0x51')](_0x63e56e[_0xb2f1('0x4e')],{'$or':_[_0xb2f1('0x41')](_0x63e56e[_0xb2f1('0x45')],function(_0x5d05e3){var _0x40a52f={};_0x40a52f[_0x5d05e3]={'$like':'%'+_0x23ff48[_0xb2f1('0x44')][_0xb2f1('0x50')]+'%'};return _0x40a52f;})});}_0x63e56e=_[_0xb2f1('0x51')]({},_0x63e56e,_0x23ff48[_0xb2f1('0x53')]);return _0x30d3f7[_0xb2f1('0xdd')](_0x63e56e);}})[_0xb2f1('0x35')](function(_0x32b824){if(_0x32b824){_0x5bb26b=_0x32b824[_0xb2f1('0x48')];if(!_0x23ff48['query'][_0xb2f1('0x49')](_0xb2f1('0x4a'))){_0x63e56e[_0xb2f1('0x4b')]=qs[_0xb2f1('0x4b')](_0x23ff48['query'][_0xb2f1('0x4b')]);_0x63e56e[_0xb2f1('0x2d')]=qs[_0xb2f1('0x2d')](_0x23ff48[_0xb2f1('0x44')][_0xb2f1('0x2d')]);}return _0x30d3f7[_0xb2f1('0xdd')](_0x63e56e);}})['then'](function(_0x5083ed){if(_0x5083ed){return _0x5083ed?{'count':_0x5bb26b,'rows':_0x5083ed}:null;}})[_0xb2f1('0x35')](respondWithResult(_0x4ec008,null))[_0xb2f1('0x57')](handleError(_0x4ec008,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 03717aa..d5d659e 100644 --- a/server/api/smsAccount/smsAccount.events.js +++ b/server/api/smsAccount/smsAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ec4=['update','remove','emit','hook','exports','events','../../mysqldb','SmsAccount','save'];(function(_0x2a9bbd,_0x4648d5){var _0x57c6a3=function(_0x4ebff6){while(--_0x4ebff6){_0x2a9bbd['push'](_0x2a9bbd['shift']());}};_0x57c6a3(++_0x4648d5);}(_0x8ec4,0x191));var _0x48ec=function(_0x1c100b,_0x5e17a0){_0x1c100b=_0x1c100b-0x0;var _0x2417fe=_0x8ec4[_0x1c100b];return _0x2417fe;};'use strict';var EventEmitter=require(_0x48ec('0x0'));var SmsAccount=require(_0x48ec('0x1'))['db'][_0x48ec('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x48ec('0x3'),'afterUpdate':_0x48ec('0x4'),'afterDestroy':_0x48ec('0x5')};function emitEvent(_0x5a9cb6){return function(_0x19fe77,_0x7214d0,_0x479dc5){SmsAccountEvents[_0x48ec('0x6')](_0x5a9cb6+':'+_0x19fe77['id'],_0x19fe77);SmsAccountEvents[_0x48ec('0x6')](_0x5a9cb6,_0x19fe77);_0x479dc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x48ec('0x7')](e,emitEvent(event));}}module[_0x48ec('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x1fb6=['hasOwnProperty','hook','events','setMaxListeners','save','update','remove'];(function(_0x22bddb,_0x1de77d){var _0x94f70d=function(_0x53f4dc){while(--_0x53f4dc){_0x22bddb['push'](_0x22bddb['shift']());}};_0x94f70d(++_0x1de77d);}(_0x1fb6,0x19f));var _0x61fb=function(_0x1a1639,_0xa100f1){_0x1a1639=_0x1a1639-0x0;var _0x12e31f=_0x1fb6[_0x1a1639];return _0x12e31f;};'use strict';var EventEmitter=require(_0x61fb('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x61fb('0x1')](0x0);var events={'afterCreate':_0x61fb('0x2'),'afterUpdate':_0x61fb('0x3'),'afterDestroy':_0x61fb('0x4')};function emitEvent(_0x4c206b){return function(_0x3adcae,_0x20b66c,_0x16b82a){SmsAccountEvents['emit'](_0x4c206b+':'+_0x3adcae['id'],_0x3adcae);SmsAccountEvents['emit'](_0x4c206b,_0x3adcae);_0x16b82a(null);};}for(var e in events){if(events[_0x61fb('0x5')](e)){var event=events[e];SmsAccount[_0x61fb('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 8133ce2..1499ef4 100644 --- a/server/api/smsAccount/smsAccount.model.js +++ b/server/api/smsAccount/smsAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x255c=['util','../../config/logger','api','moment','request-promise','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash'];(function(_0xc94beb,_0x4faf29){var _0x3b19c5=function(_0x277f8c){while(--_0x277f8c){_0xc94beb['push'](_0xc94beb['shift']());}};_0x3b19c5(++_0x4faf29);}(_0x255c,0x1a3));var _0xc255=function(_0x5a905e,_0x31aa4a){_0x5a905e=_0x5a905e-0x0;var _0x4124d6=_0x255c[_0x5a905e];return _0x4124d6;};'use strict';var _=require(_0xc255('0x0'));var util=require(_0xc255('0x1'));var logger=require(_0xc255('0x2'))(_0xc255('0x3'));var moment=require(_0xc255('0x4'));var BPromise=require('bluebird');var rp=require(_0xc255('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc255('0x6'));var config=require('../../config/environment');var attributes=require(_0xc255('0x7'));module[_0xc255('0x8')]=function(_0xb3e465,_0x11daf7){return _0xb3e465[_0xc255('0x9')](_0xc255('0xa'),attributes,{'tableName':_0xc255('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11f7=['util','../../config/logger','api','moment','request-promise','path','rimraf','define','SmsAccount','lodash'];(function(_0x22431e,_0x5af0a3){var _0xd978e9=function(_0x2bbdd7){while(--_0x2bbdd7){_0x22431e['push'](_0x22431e['shift']());}};_0xd978e9(++_0x5af0a3);}(_0x11f7,0x135));var _0x711f=function(_0x45bec2,_0x4989b8){_0x45bec2=_0x45bec2-0x0;var _0x4b8d06=_0x11f7[_0x45bec2];return _0x4b8d06;};'use strict';var _=require(_0x711f('0x0'));var util=require(_0x711f('0x1'));var logger=require(_0x711f('0x2'))(_0x711f('0x3'));var moment=require(_0x711f('0x4'));var BPromise=require('bluebird');var rp=require(_0x711f('0x5'));var fs=require('fs');var path=require(_0x711f('0x6'));var rimraf=require(_0x711f('0x7'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module['exports']=function(_0x4cef16,_0x10bef6){return _0x4cef16[_0x711f('0x8')](_0x711f('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 9625144..6be3c1f 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fbf=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','request\x20sent','debug','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','find','raw','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3e5f6d,_0x121db6){var _0x1bea6e=function(_0x435c7c){while(--_0x435c7c){_0x3e5f6d['push'](_0x3e5f6d['shift']());}};_0x1bea6e(++_0x121db6);}(_0x4fbf,0x127));var _0xf4fb=function(_0x53cc0b,_0x4cdaa4){_0x53cc0b=_0x53cc0b-0x0;var _0x3d4891=_0x4fbf[_0x53cc0b];return _0x3d4891;};'use strict';var _=require('lodash');var util=require(_0xf4fb('0x0'));var moment=require(_0xf4fb('0x1'));var BPromise=require(_0xf4fb('0x2'));var rs=require(_0xf4fb('0x3'));var fs=require('fs');var Redis=require(_0xf4fb('0x4'));var db=require(_0xf4fb('0x5'))['db'];var utils=require(_0xf4fb('0x6'));var logger=require(_0xf4fb('0x7'))(_0xf4fb('0x8'));var config=require(_0xf4fb('0x9'));var jayson=require(_0xf4fb('0xa'));var client=jayson[_0xf4fb('0xb')]['http']({'port':0x232a});config[_0xf4fb('0xc')]=_[_0xf4fb('0xd')](config['redis'],{'host':_0xf4fb('0xe'),'port':0x18eb});var socket=require(_0xf4fb('0xf'))(new Redis(config[_0xf4fb('0xc')]));require(_0xf4fb('0x10'))[_0xf4fb('0x11')](socket);function respondWithRpcPromise(_0x7e406b,_0x228a33,_0x1b9dd5){return new BPromise(function(_0x548ae8,_0x1162e5){return client['request'](_0x7e406b,_0x1b9dd5)[_0xf4fb('0x12')](function(_0x5385a7){logger[_0xf4fb('0x13')]('SmsAccount,\x20%s,\x20%s',_0x228a33,_0xf4fb('0x14'));logger[_0xf4fb('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x228a33,_0xf4fb('0x14'),JSON[_0xf4fb('0x16')](_0x5385a7));if(_0x5385a7[_0xf4fb('0x17')]){if(_0x5385a7['error'][_0xf4fb('0x18')]===0x1f4){logger[_0xf4fb('0x17')](_0xf4fb('0x19'),_0x228a33,_0x5385a7[_0xf4fb('0x17')][_0xf4fb('0x1a')]);return _0x1162e5(_0x5385a7['error'][_0xf4fb('0x1a')]);}logger[_0xf4fb('0x17')](_0xf4fb('0x19'),_0x228a33,_0x5385a7[_0xf4fb('0x17')]['message']);return _0x548ae8(_0x5385a7[_0xf4fb('0x17')][_0xf4fb('0x1a')]);}else{logger[_0xf4fb('0x13')]('SmsAccount,\x20%s,\x20%s',_0x228a33,_0xf4fb('0x14'));_0x548ae8(_0x5385a7[_0xf4fb('0x1b')]['message']);}})[_0xf4fb('0x1c')](function(_0x1f5071){logger[_0xf4fb('0x17')](_0xf4fb('0x19'),_0x228a33,_0x1f5071);_0x1162e5(_0x1f5071);});});}exports[_0xf4fb('0x1d')]=function(_0x1fdd58){var _0x8f75b1=this;return new Promise(function(_0x52a3e2,_0x2214f7){return db['SmsAccount'][_0xf4fb('0x1e')]({'raw':_0x1fdd58['options']?_0x1fdd58['options'][_0xf4fb('0x1f')]===undefined?!![]:![]:!![],'where':_0x1fdd58['options']?_0x1fdd58[_0xf4fb('0x20')][_0xf4fb('0x21')]||null:null,'attributes':_0x1fdd58[_0xf4fb('0x20')]?_0x1fdd58[_0xf4fb('0x20')][_0xf4fb('0x22')]||null:null,'include':_0x1fdd58[_0xf4fb('0x20')]?_0x1fdd58[_0xf4fb('0x20')][_0xf4fb('0x23')]?_[_0xf4fb('0x24')](_0x1fdd58[_0xf4fb('0x20')][_0xf4fb('0x23')],function(_0x262894){return{'model':db[_0x262894[_0xf4fb('0x25')]],'as':_0x262894['as'],'attributes':_0x262894[_0xf4fb('0x22')],'include':_0x262894['include']?_[_0xf4fb('0x24')](_0x262894[_0xf4fb('0x23')],function(_0xab8523){return{'model':db[_0xab8523[_0xf4fb('0x25')]],'as':_0xab8523['as'],'attributes':_0xab8523['attributes'],'include':_0xab8523[_0xf4fb('0x23')]?_['map'](_0xab8523[_0xf4fb('0x23')],function(_0x1b5286){return{'model':db[_0x1b5286['model']],'as':_0x1b5286['as'],'attributes':_0x1b5286['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a0c67){logger[_0xf4fb('0x13')]('ShowSmsAccount',_0x1fdd58);logger['debug'](_0xf4fb('0x1d'),_0x1fdd58,JSON[_0xf4fb('0x16')](_0x2a0c67));_0x52a3e2(_0x2a0c67);})[_0xf4fb('0x1c')](function(_0x2c0eea){logger[_0xf4fb('0x17')](_0xf4fb('0x1d'),_0x2c0eea[_0xf4fb('0x1a')],_0x1fdd58);_0x2214f7(_0x8f75b1[_0xf4fb('0x17')](0x1f4,_0x2c0eea[_0xf4fb('0x1a')]));});});}; \ No newline at end of file +var _0x47c4=['socket.io-emitter','./smsAccount.socket','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','ShowSmsAccount','find','options','raw','where','attributes','include','map','model','then','debug','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x106486,_0x2803df){var _0x2e8f05=function(_0x3d1cc5){while(--_0x3d1cc5){_0x106486['push'](_0x106486['shift']());}};_0x2e8f05(++_0x2803df);}(_0x47c4,0x9f));var _0x447c=function(_0x4ac716,_0x40243f){_0x4ac716=_0x4ac716-0x0;var _0x35f56b=_0x47c4[_0x4ac716];return _0x35f56b;};'use strict';var _=require(_0x447c('0x0'));var util=require(_0x447c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x447c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x447c('0x3'));var logger=require(_0x447c('0x4'))(_0x447c('0x5'));var config=require('../../config/environment');var jayson=require(_0x447c('0x6'));var client=jayson[_0x447c('0x7')][_0x447c('0x8')]({'port':0x232a});config[_0x447c('0x9')]=_[_0x447c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x447c('0xb'))(new Redis(config[_0x447c('0x9')]));require(_0x447c('0xc'))['register'](socket);function respondWithRpcPromise(_0x3c9c1b,_0x4b25fd,_0xfff424){return new BPromise(function(_0x5d5565,_0x4c66d2){return client['request'](_0x3c9c1b,_0xfff424)['then'](function(_0x142abb){logger['info']('SmsAccount,\x20%s,\x20%s',_0x4b25fd,'request\x20sent');logger['debug'](_0x447c('0xd'),_0x4b25fd,_0x447c('0xe'),JSON[_0x447c('0xf')](_0x142abb));if(_0x142abb[_0x447c('0x10')]){if(_0x142abb['error'][_0x447c('0x11')]===0x1f4){logger['error'](_0x447c('0x12'),_0x4b25fd,_0x142abb[_0x447c('0x10')][_0x447c('0x13')]);return _0x4c66d2(_0x142abb[_0x447c('0x10')]['message']);}logger[_0x447c('0x10')](_0x447c('0x12'),_0x4b25fd,_0x142abb[_0x447c('0x10')][_0x447c('0x13')]);return _0x5d5565(_0x142abb['error'][_0x447c('0x13')]);}else{logger[_0x447c('0x14')](_0x447c('0x12'),_0x4b25fd,_0x447c('0xe'));_0x5d5565(_0x142abb[_0x447c('0x15')]['message']);}})[_0x447c('0x16')](function(_0xbc8d83){logger[_0x447c('0x10')](_0x447c('0x12'),_0x4b25fd,_0xbc8d83);_0x4c66d2(_0xbc8d83);});});}exports[_0x447c('0x17')]=function(_0x576406){var _0x4fadc0=this;return new Promise(function(_0x4a0a90,_0x4a9770){return db['SmsAccount'][_0x447c('0x18')]({'raw':_0x576406[_0x447c('0x19')]?_0x576406[_0x447c('0x19')][_0x447c('0x1a')]===undefined?!![]:![]:!![],'where':_0x576406['options']?_0x576406[_0x447c('0x19')][_0x447c('0x1b')]||null:null,'attributes':_0x576406['options']?_0x576406[_0x447c('0x19')][_0x447c('0x1c')]||null:null,'include':_0x576406['options']?_0x576406['options'][_0x447c('0x1d')]?_[_0x447c('0x1e')](_0x576406[_0x447c('0x19')][_0x447c('0x1d')],function(_0x539f76){return{'model':db[_0x539f76[_0x447c('0x1f')]],'as':_0x539f76['as'],'attributes':_0x539f76['attributes'],'include':_0x539f76[_0x447c('0x1d')]?_[_0x447c('0x1e')](_0x539f76[_0x447c('0x1d')],function(_0x19a9c3){return{'model':db[_0x19a9c3[_0x447c('0x1f')]],'as':_0x19a9c3['as'],'attributes':_0x19a9c3[_0x447c('0x1c')],'include':_0x19a9c3[_0x447c('0x1d')]?_[_0x447c('0x1e')](_0x19a9c3[_0x447c('0x1d')],function(_0x48f5ec){return{'model':db[_0x48f5ec[_0x447c('0x1f')]],'as':_0x48f5ec['as'],'attributes':_0x48f5ec[_0x447c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x447c('0x20')](function(_0x9249a1){logger[_0x447c('0x14')](_0x447c('0x17'),_0x576406);logger[_0x447c('0x21')](_0x447c('0x17'),_0x576406,JSON['stringify'](_0x9249a1));_0x4a0a90(_0x9249a1);})[_0x447c('0x16')](function(_0x2468f5){logger[_0x447c('0x10')](_0x447c('0x17'),_0x2468f5[_0x447c('0x13')],_0x576406);_0x4a9770(_0x4fadc0[_0x447c('0x10')](0x1f4,_0x2468f5[_0x447c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index fd03d37..c625261 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89a4=['smsAccount:','save','remove','update','emit','removeListener','length'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0x89a4,0x1e4));var _0x489a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x89a4[_0x2641f9];return _0x585741;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x489a('0x0'),_0x489a('0x1'),_0x489a('0x2')];function createListener(_0x1da070,_0x50a506){return function(_0x4773bc){_0x50a506[_0x489a('0x3')](_0x1da070,_0x4773bc);};}function removeListener(_0x1f2115,_0x1d58b7){return function(){SmsAccountEvents[_0x489a('0x4')](_0x1f2115,_0x1d58b7);};}exports['register']=function(_0x4256da){for(var _0x12a3a8=0x0,_0x2289d7=events[_0x489a('0x5')];_0x12a3a8<_0x2289d7;_0x12a3a8++){var _0xdb09d7=events[_0x12a3a8];var _0x2bb1cf=createListener(_0x489a('0x6')+_0xdb09d7,_0x4256da);SmsAccountEvents['on'](_0xdb09d7,_0x2bb1cf);}}; \ No newline at end of file +var _0x7b7f=['./smsAccount.events','save','remove','update','removeListener','length','smsAccount:'];(function(_0xe43eea,_0x577840){var _0x28a66d=function(_0x48d6b2){while(--_0x48d6b2){_0xe43eea['push'](_0xe43eea['shift']());}};_0x28a66d(++_0x577840);}(_0x7b7f,0x118));var _0xf7b7=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7b7f[_0x40ac5e];return _0x2839d6;};'use strict';var SmsAccountEvents=require(_0xf7b7('0x0'));var events=[_0xf7b7('0x1'),_0xf7b7('0x2'),_0xf7b7('0x3')];function createListener(_0xdaba0a,_0xa7d368){return function(_0x5d378a){_0xa7d368['emit'](_0xdaba0a,_0x5d378a);};}function removeListener(_0xd3831e,_0x3d1a61){return function(){SmsAccountEvents[_0xf7b7('0x4')](_0xd3831e,_0x3d1a61);};}exports['register']=function(_0x1f09ea){for(var _0x254b8a=0x0,_0x13010d=events[_0xf7b7('0x5')];_0x254b8a<_0x13010d;_0x254b8a++){var _0x1f1e1e=events[_0x254b8a];var _0x315424=createListener(_0xf7b7('0x6')+_0x1f1e1e,_0x1f09ea);SmsAccountEvents['on'](_0x1f1e1e,_0x315424);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 048d07d..df8e43f 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35c3=['../../components/interaction/service','../../config/environment','./smsApplication.controller','isAuthenticated','get','/:id','show','create','put','delete','destroy','exports','multer','connect-timeout','express'];(function(_0xd4b6dc,_0x3c8825){var _0x44646d=function(_0x9fef95){while(--_0x9fef95){_0xd4b6dc['push'](_0xd4b6dc['shift']());}};_0x44646d(++_0x3c8825);}(_0x35c3,0x174));var _0x335c=function(_0xb22600,_0x566613){_0xb22600=_0xb22600-0x0;var _0x3e0139=_0x35c3[_0xb22600];return _0x3e0139;};'use strict';var multer=require(_0x335c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x335c('0x1'));var express=require(_0x335c('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x335c('0x3'));var config=require(_0x335c('0x4'));var controller=require(_0x335c('0x5'));router['get']('/',auth[_0x335c('0x6')](),controller['index']);router[_0x335c('0x7')](_0x335c('0x8'),auth[_0x335c('0x6')](),controller[_0x335c('0x9')]);router['post']('/',auth[_0x335c('0x6')](),controller[_0x335c('0xa')]);router[_0x335c('0xb')](_0x335c('0x8'),auth[_0x335c('0x6')](),controller['update']);router[_0x335c('0xc')](_0x335c('0x8'),auth[_0x335c('0x6')](),controller[_0x335c('0xd')]);module[_0x335c('0xe')]=router; \ No newline at end of file +var _0x07a0=['delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','show','post','create','put','update'];(function(_0x2b4cd0,_0x457878){var _0x474616=function(_0x435315){while(--_0x435315){_0x2b4cd0['push'](_0x2b4cd0['shift']());}};_0x474616(++_0x457878);}(_0x07a0,0x1c5));var _0x007a=function(_0x442a04,_0x38439f){_0x442a04=_0x442a04-0x0;var _0x3e8ac0=_0x07a0[_0x442a04];return _0x3e8ac0;};'use strict';var multer=require('multer');var util=require(_0x007a('0x0'));var path=require(_0x007a('0x1'));var timeout=require(_0x007a('0x2'));var express=require(_0x007a('0x3'));var router=express[_0x007a('0x4')]();var auth=require(_0x007a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x007a('0x6'));var controller=require(_0x007a('0x7'));router[_0x007a('0x8')]('/',auth[_0x007a('0x9')](),controller['index']);router[_0x007a('0x8')]('/:id',auth[_0x007a('0x9')](),controller[_0x007a('0xa')]);router[_0x007a('0xb')]('/',auth['isAuthenticated'](),controller[_0x007a('0xc')]);router[_0x007a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x007a('0xe')]);router[_0x007a('0xf')](_0x007a('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x007a('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 9282f3a..8f9538e 100644 --- a/server/api/smsApplication/smsApplication.attributes.js +++ b/server/api/smsApplication/smsApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf66f=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xf66f,0x143));var _0xff66=function(_0x51b10b,_0x311567){_0x51b10b=_0x51b10b-0x0;var _0x45b2cf=_0xf66f[_0x51b10b];return _0x45b2cf;};'use strict';var Sequelize=require(_0xff66('0x0'));module[_0xff66('0x1')]={'priority':{'type':Sequelize[_0xff66('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xff66('0x3')},'appdata':{'type':Sequelize[_0xff66('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xff66('0x5')],'defaultValue':_0xff66('0x6')}}; \ No newline at end of file +var _0xf402=['sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x72b63,_0x5f03af){var _0x38aa51=function(_0x10c794){while(--_0x10c794){_0x72b63['push'](_0x72b63['shift']());}};_0x38aa51(++_0x5f03af);}(_0xf402,0x19e));var _0x2f40=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf402[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x2f40('0x0'));module[_0x2f40('0x1')]={'priority':{'type':Sequelize[_0x2f40('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2f40('0x3')},'appdata':{'type':Sequelize[_0x2f40('0x4')]()},'description':{'type':Sequelize[_0x2f40('0x5')]},'interval':{'type':Sequelize[_0x2f40('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 6fd8a3d..0424430 100644 --- a/server/api/smsApplication/smsApplication.controller.js +++ b/server/api/smsApplication/smsApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x785a=['destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','intersection','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then'];(function(_0x370597,_0x39eaf2){var _0x3e5ca2=function(_0x1e1d7b){while(--_0x1e1d7b){_0x370597['push'](_0x370597['shift']());}};_0x3e5ca2(++_0x39eaf2);}(_0x785a,0x17b));var _0xa785=function(_0x25b223,_0x4b87d7){_0x25b223=_0x25b223-0x0;var _0x4bdedf=_0x785a[_0x25b223];return _0x4bdedf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa785('0x0'));var rimraf=require(_0xa785('0x1'));var zipdir=require(_0xa785('0x2'));var jsonpatch=require(_0xa785('0x3'));var rp=require(_0xa785('0x4'));var moment=require(_0xa785('0x5'));var BPromise=require(_0xa785('0x6'));var Mustache=require(_0xa785('0x7'));var util=require(_0xa785('0x8'));var path=require(_0xa785('0x9'));var sox=require(_0xa785('0xa'));var csv=require(_0xa785('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa785('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa785('0xd'));var toCsv=require(_0xa785('0xb'));var querystring=require(_0xa785('0xe'));var Papa=require(_0xa785('0xf'));var Redis=require(_0xa785('0x10'));var authService=require(_0xa785('0x11'));var qs=require(_0xa785('0x12'));var as=require(_0xa785('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa785('0x14'))(_0xa785('0x15'));var utils=require('../../config/utils');var config=require(_0xa785('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5334a1,_0x35f91a){_0x35f91a=_0x35f91a||0xcc;return function(_0x9f2f){if(_0x9f2f){return _0x5334a1[_0xa785('0x17')](_0x35f91a);}return _0x5334a1[_0xa785('0x18')](_0x35f91a)['end']();};}function respondWithResult(_0x4d2d98,_0x2aa67e){_0x2aa67e=_0x2aa67e||0xc8;return function(_0x4a4fd9){if(_0x4a4fd9){return _0x4d2d98['status'](_0x2aa67e)[_0xa785('0x19')](_0x4a4fd9);}};}function respondWithFilteredResult(_0x23b2a2,_0x4ecc2b){return function(_0x456019){if(_0x456019){var _0xe03bed=_0x456019[_0xa785('0x1a')],_0x2a2425=_0x4ecc2b[_0xa785('0x1b')],_0x416989=_0x4ecc2b['offset']+_0x4ecc2b[_0xa785('0x1c')],_0x3bed3a;if(_0x416989>=_0xe03bed){_0x416989=_0xe03bed;_0x3bed3a=0xc8;}else{_0x3bed3a=0xce;}_0x23b2a2[_0xa785('0x18')](_0x3bed3a);return _0x23b2a2[_0xa785('0x1d')]('Content-Range',_0x2a2425+'-'+_0x416989+'/'+_0xe03bed)[_0xa785('0x19')](_0x456019);}return null;};}function patchUpdates(_0x2b6ecc){return function(_0x3d5066){try{jsonpatch[_0xa785('0x1e')](_0x3d5066,_0x2b6ecc,!![]);}catch(_0xaeeff3){return BPromise[_0xa785('0x1f')](_0xaeeff3);}return _0x3d5066[_0xa785('0x20')]();};}function saveUpdates(_0x452cbe,_0x27273a){return function(_0x24c5ee){if(_0x24c5ee){return _0x24c5ee[_0xa785('0x21')](_0x452cbe)[_0xa785('0x22')](function(_0x48d7b4){return _0x48d7b4;});}return null;};}function removeEntity(_0x46c8dc,_0xebc8ec){return function(_0xe3841){if(_0xe3841){return _0xe3841[_0xa785('0x23')]()[_0xa785('0x22')](function(){_0x46c8dc[_0xa785('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x911f38,_0x19207e){return function(_0x76b52e){if(!_0x76b52e){_0x911f38[_0xa785('0x17')](0x194);}return _0x76b52e;};}function handleError(_0x398c79,_0x2ff8c3){_0x2ff8c3=_0x2ff8c3||0x1f4;return function(_0x2e4923){logger[_0xa785('0x24')](_0x2e4923[_0xa785('0x25')]);if(_0x2e4923[_0xa785('0x26')]){delete _0x2e4923[_0xa785('0x26')];}_0x398c79[_0xa785('0x18')](_0x2ff8c3)[_0xa785('0x27')](_0x2e4923);};}exports[_0xa785('0x28')]=function(_0x3162f0,_0xe825f1){var _0x49d948={},_0x537358={},_0x661bab={'count':0x0,'rows':[]};var _0x500654=_[_0xa785('0x29')](db[_0xa785('0x2a')][_0xa785('0x2b')],function(_0x1bb99e){return{'name':_0x1bb99e['fieldName'],'type':_0x1bb99e[_0xa785('0x2c')][_0xa785('0x2d')]};});_0x537358[_0xa785('0x2e')]=_['map'](_0x500654,_0xa785('0x26'));_0x537358['query']=_[_0xa785('0x2f')](_0x3162f0[_0xa785('0x30')]);_0x537358[_0xa785('0x31')]=_['intersection'](_0x537358[_0xa785('0x2e')],_0x537358[_0xa785('0x30')]);_0x49d948[_0xa785('0x32')]=_['intersection'](_0x537358[_0xa785('0x2e')],qs[_0xa785('0x33')](_0x3162f0['query'][_0xa785('0x33')]));_0x49d948[_0xa785('0x32')]=_0x49d948[_0xa785('0x32')][_0xa785('0x34')]?_0x49d948[_0xa785('0x32')]:_0x537358[_0xa785('0x2e')];if(!_0x3162f0[_0xa785('0x30')][_0xa785('0x35')]('nolimit')){_0x49d948[_0xa785('0x1c')]=qs[_0xa785('0x1c')](_0x3162f0['query']['limit']);_0x49d948[_0xa785('0x1b')]=qs[_0xa785('0x1b')](_0x3162f0[_0xa785('0x30')][_0xa785('0x1b')]);}_0x49d948['order']=qs['sort'](_0x3162f0[_0xa785('0x30')][_0xa785('0x36')]);_0x49d948[_0xa785('0x37')]=qs[_0xa785('0x31')](_[_0xa785('0x38')](_0x3162f0[_0xa785('0x30')],_0x537358[_0xa785('0x31')]));if(_0x3162f0['query'][_0xa785('0x39')]){_0x49d948['where']=_[_0xa785('0x3a')](_0x49d948[_0xa785('0x37')],{'$or':_[_0xa785('0x29')](_0x500654,function(_0x489563){if(_0x489563[_0xa785('0x2c')]!==_0xa785('0x3b')){var _0x3256c8={};_0x3256c8[_0x489563[_0xa785('0x26')]]={'$like':'%'+_0x3162f0[_0xa785('0x30')][_0xa785('0x39')]+'%'};return _0x3256c8;}})});}_0x49d948=_[_0xa785('0x3a')]({},_0x49d948,_0x3162f0['options']);var _0x10bd35={'where':_0x49d948['where']};return db[_0xa785('0x2a')]['count'](_0x10bd35)[_0xa785('0x22')](function(_0x3a1a6d){_0x661bab['count']=_0x3a1a6d;if(_0x3162f0[_0xa785('0x30')][_0xa785('0x3c')]){_0x49d948[_0xa785('0x3d')]=[{'all':!![]}];}return db[_0xa785('0x2a')]['findAll'](_0x49d948);})[_0xa785('0x22')](function(_0x32570b){_0x661bab[_0xa785('0x3e')]=_0x32570b;return _0x661bab;})['then'](respondWithFilteredResult(_0xe825f1,_0x49d948))[_0xa785('0x3f')](handleError(_0xe825f1,null));};exports['show']=function(_0x1bae5d,_0x322ba7){var _0x5b1572={'raw':!![],'where':{'id':_0x1bae5d[_0xa785('0x40')]['id']}},_0x2acf9a={};_0x2acf9a[_0xa785('0x2e')]=_['keys'](db[_0xa785('0x2a')][_0xa785('0x2b')]);_0x2acf9a['query']=_[_0xa785('0x2f')](_0x1bae5d[_0xa785('0x30')]);_0x2acf9a[_0xa785('0x31')]=_[_0xa785('0x41')](_0x2acf9a['model'],_0x2acf9a[_0xa785('0x30')]);_0x5b1572['attributes']=_[_0xa785('0x41')](_0x2acf9a['model'],qs[_0xa785('0x33')](_0x1bae5d['query'][_0xa785('0x33')]));_0x5b1572[_0xa785('0x32')]=_0x5b1572[_0xa785('0x32')][_0xa785('0x34')]?_0x5b1572[_0xa785('0x32')]:_0x2acf9a[_0xa785('0x2e')];if(_0x1bae5d[_0xa785('0x30')][_0xa785('0x3c')]){_0x5b1572[_0xa785('0x3d')]=[{'all':!![]}];}_0x5b1572=_[_0xa785('0x3a')]({},_0x5b1572,_0x1bae5d['options']);return db[_0xa785('0x2a')][_0xa785('0x42')](_0x5b1572)[_0xa785('0x22')](handleEntityNotFound(_0x322ba7,null))['then'](respondWithResult(_0x322ba7,null))[_0xa785('0x3f')](handleError(_0x322ba7,null));};exports[_0xa785('0x43')]=function(_0x2a4c58,_0x3ce6f3){return db[_0xa785('0x2a')][_0xa785('0x43')](_0x2a4c58[_0xa785('0x44')],{})[_0xa785('0x22')](respondWithResult(_0x3ce6f3,0xc9))[_0xa785('0x3f')](handleError(_0x3ce6f3,null));};exports[_0xa785('0x21')]=function(_0x1b878b,_0x5f2f74){if(_0x1b878b['body']['id']){delete _0x1b878b[_0xa785('0x44')]['id'];}return db[_0xa785('0x2a')][_0xa785('0x42')]({'where':{'id':_0x1b878b[_0xa785('0x40')]['id']}})[_0xa785('0x22')](handleEntityNotFound(_0x5f2f74,null))['then'](saveUpdates(_0x1b878b[_0xa785('0x44')],null))[_0xa785('0x22')](respondWithResult(_0x5f2f74,null))[_0xa785('0x3f')](handleError(_0x5f2f74,null));};exports[_0xa785('0x23')]=function(_0x479592,_0x3cc9bc){return db[_0xa785('0x2a')][_0xa785('0x42')]({'where':{'id':_0x479592[_0xa785('0x40')]['id']}})[_0xa785('0x22')](handleEntityNotFound(_0x3cc9bc,null))[_0xa785('0x22')](removeEntity(_0x3cc9bc,null))['catch'](handleError(_0x3cc9bc,null));}; \ No newline at end of file +var _0x42c0=['index','map','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','SmsApplication','count','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','length','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name'];(function(_0xbc663,_0x4fd0cd){var _0x267b1f=function(_0x4950f5){while(--_0x4950f5){_0xbc663['push'](_0xbc663['shift']());}};_0x267b1f(++_0x4fd0cd);}(_0x42c0,0x137));var _0x042c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x42c0[_0x1589dd];return _0x1bddd1;};'use strict';var pdf=require(_0x042c('0x0'));var emlformat=require(_0x042c('0x1'));var rimraf=require(_0x042c('0x2'));var zipdir=require(_0x042c('0x3'));var jsonpatch=require(_0x042c('0x4'));var rp=require('request-promise');var moment=require(_0x042c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x042c('0x6'));var util=require('util');var path=require(_0x042c('0x7'));var sox=require(_0x042c('0x8'));var csv=require('to-csv');var ejs=require(_0x042c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x042c('0xa'));var crypto=require(_0x042c('0xb'));var jsforce=require(_0x042c('0xc'));var deskjs=require(_0x042c('0xd'));var toCsv=require(_0x042c('0xe'));var querystring=require(_0x042c('0xf'));var Papa=require(_0x042c('0x10'));var Redis=require(_0x042c('0x11'));var authService=require(_0x042c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x042c('0x13'));var hardwareService=require(_0x042c('0x14'));var logger=require(_0x042c('0x15'))(_0x042c('0x16'));var utils=require(_0x042c('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x304079,_0x19f6fa){_0x19f6fa=_0x19f6fa||0xcc;return function(_0x2d5bd7){if(_0x2d5bd7){return _0x304079[_0x042c('0x18')](_0x19f6fa);}return _0x304079['status'](_0x19f6fa)[_0x042c('0x19')]();};}function respondWithResult(_0x15e2a4,_0x510d87){_0x510d87=_0x510d87||0xc8;return function(_0x51c61c){if(_0x51c61c){return _0x15e2a4[_0x042c('0x1a')](_0x510d87)['json'](_0x51c61c);}};}function respondWithFilteredResult(_0x3211c5,_0x259bb2){return function(_0x112b80){if(_0x112b80){var _0x189d4a=_0x112b80['count'],_0x5f1a57=_0x259bb2[_0x042c('0x1b')],_0x3fe343=_0x259bb2[_0x042c('0x1b')]+_0x259bb2[_0x042c('0x1c')],_0x4a34d6;if(_0x3fe343>=_0x189d4a){_0x3fe343=_0x189d4a;_0x4a34d6=0xc8;}else{_0x4a34d6=0xce;}_0x3211c5[_0x042c('0x1a')](_0x4a34d6);return _0x3211c5[_0x042c('0x1d')](_0x042c('0x1e'),_0x5f1a57+'-'+_0x3fe343+'/'+_0x189d4a)[_0x042c('0x1f')](_0x112b80);}return null;};}function patchUpdates(_0x492498){return function(_0x458fc3){try{jsonpatch[_0x042c('0x20')](_0x458fc3,_0x492498,!![]);}catch(_0x1ce619){return BPromise[_0x042c('0x21')](_0x1ce619);}return _0x458fc3[_0x042c('0x22')]();};}function saveUpdates(_0xec175f,_0x873694){return function(_0xf24f1b){if(_0xf24f1b){return _0xf24f1b[_0x042c('0x23')](_0xec175f)['then'](function(_0x2ab755){return _0x2ab755;});}return null;};}function removeEntity(_0x35b19e,_0x36983f){return function(_0x2d74bc){if(_0x2d74bc){return _0x2d74bc[_0x042c('0x24')]()[_0x042c('0x25')](function(){_0x35b19e[_0x042c('0x1a')](0xcc)[_0x042c('0x19')]();});}};}function handleEntityNotFound(_0x2fbe85,_0x2bf6da){return function(_0x7e4f5c){if(!_0x7e4f5c){_0x2fbe85['sendStatus'](0x194);}return _0x7e4f5c;};}function handleError(_0x544c57,_0x2d124f){_0x2d124f=_0x2d124f||0x1f4;return function(_0x4e018b){logger['error'](_0x4e018b['stack']);if(_0x4e018b[_0x042c('0x26')]){delete _0x4e018b[_0x042c('0x26')];}_0x544c57[_0x042c('0x1a')](_0x2d124f)['send'](_0x4e018b);};}exports[_0x042c('0x27')]=function(_0xa419bd,_0x5379f0){var _0x53a77f={},_0x52cf30={},_0x2f66ad={'count':0x0,'rows':[]};var _0xa4a0e7=_[_0x042c('0x28')](db['SmsApplication']['rawAttributes'],function(_0x4fbdcf){return{'name':_0x4fbdcf['fieldName'],'type':_0x4fbdcf[_0x042c('0x29')]['key']};});_0x52cf30[_0x042c('0x2a')]=_[_0x042c('0x28')](_0xa4a0e7,_0x042c('0x26'));_0x52cf30[_0x042c('0x2b')]=_['keys'](_0xa419bd['query']);_0x52cf30[_0x042c('0x2c')]=_['intersection'](_0x52cf30['model'],_0x52cf30[_0x042c('0x2b')]);_0x53a77f[_0x042c('0x2d')]=_['intersection'](_0x52cf30[_0x042c('0x2a')],qs[_0x042c('0x2e')](_0xa419bd[_0x042c('0x2b')]['fields']));_0x53a77f[_0x042c('0x2d')]=_0x53a77f['attributes']['length']?_0x53a77f[_0x042c('0x2d')]:_0x52cf30[_0x042c('0x2a')];if(!_0xa419bd[_0x042c('0x2b')][_0x042c('0x2f')](_0x042c('0x30'))){_0x53a77f['limit']=qs[_0x042c('0x1c')](_0xa419bd[_0x042c('0x2b')]['limit']);_0x53a77f['offset']=qs[_0x042c('0x1b')](_0xa419bd[_0x042c('0x2b')][_0x042c('0x1b')]);}_0x53a77f[_0x042c('0x31')]=qs[_0x042c('0x32')](_0xa419bd[_0x042c('0x2b')][_0x042c('0x32')]);_0x53a77f[_0x042c('0x33')]=qs[_0x042c('0x2c')](_['pick'](_0xa419bd['query'],_0x52cf30[_0x042c('0x2c')]));if(_0xa419bd['query']['filter']){_0x53a77f[_0x042c('0x33')]=_['merge'](_0x53a77f[_0x042c('0x33')],{'$or':_[_0x042c('0x28')](_0xa4a0e7,function(_0x241bf7){if(_0x241bf7['type']!==_0x042c('0x34')){var _0x3973be={};_0x3973be[_0x241bf7['name']]={'$like':'%'+_0xa419bd['query']['filter']+'%'};return _0x3973be;}})});}_0x53a77f=_[_0x042c('0x35')]({},_0x53a77f,_0xa419bd[_0x042c('0x36')]);var _0x108a63={'where':_0x53a77f[_0x042c('0x33')]};return db[_0x042c('0x37')]['count'](_0x108a63)[_0x042c('0x25')](function(_0x355615){_0x2f66ad[_0x042c('0x38')]=_0x355615;if(_0xa419bd[_0x042c('0x2b')][_0x042c('0x39')]){_0x53a77f['include']=[{'all':!![]}];}return db['SmsApplication'][_0x042c('0x3a')](_0x53a77f);})[_0x042c('0x25')](function(_0x14cf5e){_0x2f66ad[_0x042c('0x3b')]=_0x14cf5e;return _0x2f66ad;})[_0x042c('0x25')](respondWithFilteredResult(_0x5379f0,_0x53a77f))[_0x042c('0x3c')](handleError(_0x5379f0,null));};exports[_0x042c('0x3d')]=function(_0x418192,_0x3dfc05){var _0x20c5c3={'raw':!![],'where':{'id':_0x418192[_0x042c('0x3e')]['id']}},_0x31133e={};_0x31133e[_0x042c('0x2a')]=_['keys'](db[_0x042c('0x37')][_0x042c('0x3f')]);_0x31133e[_0x042c('0x2b')]=_['keys'](_0x418192[_0x042c('0x2b')]);_0x31133e[_0x042c('0x2c')]=_[_0x042c('0x40')](_0x31133e[_0x042c('0x2a')],_0x31133e[_0x042c('0x2b')]);_0x20c5c3[_0x042c('0x2d')]=_[_0x042c('0x40')](_0x31133e[_0x042c('0x2a')],qs[_0x042c('0x2e')](_0x418192[_0x042c('0x2b')]['fields']));_0x20c5c3['attributes']=_0x20c5c3[_0x042c('0x2d')][_0x042c('0x41')]?_0x20c5c3[_0x042c('0x2d')]:_0x31133e['model'];if(_0x418192[_0x042c('0x2b')][_0x042c('0x39')]){_0x20c5c3[_0x042c('0x42')]=[{'all':!![]}];}_0x20c5c3=_[_0x042c('0x35')]({},_0x20c5c3,_0x418192['options']);return db['SmsApplication'][_0x042c('0x43')](_0x20c5c3)[_0x042c('0x25')](handleEntityNotFound(_0x3dfc05,null))[_0x042c('0x25')](respondWithResult(_0x3dfc05,null))[_0x042c('0x3c')](handleError(_0x3dfc05,null));};exports[_0x042c('0x44')]=function(_0x4e2a49,_0x44b14f){return db[_0x042c('0x37')]['create'](_0x4e2a49['body'],{})['then'](respondWithResult(_0x44b14f,0xc9))[_0x042c('0x3c')](handleError(_0x44b14f,null));};exports[_0x042c('0x23')]=function(_0x30be0c,_0xc63675){if(_0x30be0c[_0x042c('0x45')]['id']){delete _0x30be0c['body']['id'];}return db[_0x042c('0x37')]['find']({'where':{'id':_0x30be0c[_0x042c('0x3e')]['id']}})[_0x042c('0x25')](handleEntityNotFound(_0xc63675,null))[_0x042c('0x25')](saveUpdates(_0x30be0c[_0x042c('0x45')],null))[_0x042c('0x25')](respondWithResult(_0xc63675,null))[_0x042c('0x3c')](handleError(_0xc63675,null));};exports[_0x042c('0x24')]=function(_0x4acdc7,_0x37aabc){return db[_0x042c('0x37')][_0x042c('0x43')]({'where':{'id':_0x4acdc7[_0x042c('0x3e')]['id']}})[_0x042c('0x25')](handleEntityNotFound(_0x37aabc,null))['then'](removeEntity(_0x37aabc,null))['catch'](handleError(_0x37aabc,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ece75a7..29019c4 100644 --- a/server/api/smsApplication/smsApplication.model.js +++ b/server/api/smsApplication/smsApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe84a=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xe84a,0x155));var _0xae84=function(_0x5de8bf,_0x24e115){_0x5de8bf=_0x5de8bf-0x0;var _0x2be3e3=_0xe84a[_0x5de8bf];return _0x2be3e3;};'use strict';var _=require(_0xae84('0x0'));var util=require(_0xae84('0x1'));var logger=require(_0xae84('0x2'))(_0xae84('0x3'));var moment=require(_0xae84('0x4'));var BPromise=require(_0xae84('0x5'));var rp=require(_0xae84('0x6'));var fs=require('fs');var path=require(_0xae84('0x7'));var rimraf=require(_0xae84('0x8'));var config=require(_0xae84('0x9'));var attributes=require(_0xae84('0xa'));module[_0xae84('0xb')]=function(_0x5e25af,_0xe15c3b){return _0x5e25af[_0xae84('0xc')](_0xae84('0xd'),attributes,{'tableName':_0xae84('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae84('0xf'),'collate':_0xae84('0x10')});}; \ No newline at end of file +var _0x7bb6=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x5e6f16,_0x5e5508){var _0xe972f3=function(_0x2d3857){while(--_0x2d3857){_0x5e6f16['push'](_0x5e6f16['shift']());}};_0xe972f3(++_0x5e5508);}(_0x7bb6,0xc5));var _0x67bb=function(_0x59860b,_0x4f77e0){_0x59860b=_0x59860b-0x0;var _0x4cdade=_0x7bb6[_0x59860b];return _0x4cdade;};'use strict';var _=require(_0x67bb('0x0'));var util=require(_0x67bb('0x1'));var logger=require(_0x67bb('0x2'))(_0x67bb('0x3'));var moment=require('moment');var BPromise=require(_0x67bb('0x4'));var rp=require(_0x67bb('0x5'));var fs=require('fs');var path=require(_0x67bb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x67bb('0x7'));module[_0x67bb('0x8')]=function(_0x4296e3,_0xc8a226){return _0x4296e3[_0x67bb('0x9')](_0x67bb('0xa'),attributes,{'tableName':_0x67bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67bb('0xc'),'collate':_0x67bb('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 1ace783..59e7eb2 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90b5=['http','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x395667,_0x45593a){var _0x5cdb8f=function(_0x2be0fd){while(--_0x2be0fd){_0x395667['push'](_0x395667['shift']());}};_0x5cdb8f(++_0x45593a);}(_0x90b5,0x139));var _0x590b=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x90b5[_0x4b9dc9];return _0x57b302;};'use strict';var _=require(_0x590b('0x0'));var util=require('util');var moment=require(_0x590b('0x1'));var BPromise=require(_0x590b('0x2'));var rs=require(_0x590b('0x3'));var fs=require('fs');var Redis=require(_0x590b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x590b('0x5'))(_0x590b('0x6'));var config=require('../../config/environment');var jayson=require(_0x590b('0x7'));var client=jayson[_0x590b('0x8')][_0x590b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e54fe,_0x30bc6e,_0x3663a0){return new BPromise(function(_0x3ec156,_0x9c408b){return client[_0x590b('0xa')](_0x5e54fe,_0x3663a0)[_0x590b('0xb')](function(_0x2103c0){logger[_0x590b('0xc')](_0x590b('0xd'),_0x30bc6e,'request\x20sent');logger[_0x590b('0xe')](_0x590b('0xf'),_0x30bc6e,'request\x20sent',JSON[_0x590b('0x10')](_0x2103c0));if(_0x2103c0['error']){if(_0x2103c0[_0x590b('0x11')][_0x590b('0x12')]===0x1f4){logger[_0x590b('0x11')](_0x590b('0xd'),_0x30bc6e,_0x2103c0['error'][_0x590b('0x13')]);return _0x9c408b(_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);}logger[_0x590b('0x11')](_0x590b('0xd'),_0x30bc6e,_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);return _0x3ec156(_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);}else{logger[_0x590b('0xc')](_0x590b('0xd'),_0x30bc6e,_0x590b('0x14'));_0x3ec156(_0x2103c0[_0x590b('0x15')][_0x590b('0x13')]);}})[_0x590b('0x16')](function(_0x4f2512){logger[_0x590b('0x11')]('SmsApplication,\x20%s,\x20%s',_0x30bc6e,_0x4f2512);_0x9c408b(_0x4f2512);});});} \ No newline at end of file +var _0xfcbd=['SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1fb025,_0x449881){var _0x39335b=function(_0x496911){while(--_0x496911){_0x1fb025['push'](_0x1fb025['shift']());}};_0x39335b(++_0x449881);}(_0xfcbd,0x160));var _0xdfcb=function(_0x95554c,_0x58daa3){_0x95554c=_0x95554c-0x0;var _0x50a6b0=_0xfcbd[_0x95554c];return _0x50a6b0;};'use strict';var _=require(_0xdfcb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdfcb('0x1'));var rs=require(_0xdfcb('0x2'));var fs=require('fs');var Redis=require(_0xdfcb('0x3'));var db=require(_0xdfcb('0x4'))['db'];var utils=require(_0xdfcb('0x5'));var logger=require(_0xdfcb('0x6'))(_0xdfcb('0x7'));var config=require(_0xdfcb('0x8'));var jayson=require(_0xdfcb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46956c,_0x183ea8,_0xb8de95){return new BPromise(function(_0x3c5431,_0xbe50d6){return client[_0xdfcb('0xa')](_0x46956c,_0xb8de95)[_0xdfcb('0xb')](function(_0x5e650d){logger[_0xdfcb('0xc')](_0xdfcb('0xd'),_0x183ea8,_0xdfcb('0xe'));logger[_0xdfcb('0xf')](_0xdfcb('0x10'),_0x183ea8,_0xdfcb('0xe'),JSON[_0xdfcb('0x11')](_0x5e650d));if(_0x5e650d[_0xdfcb('0x12')]){if(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x13')]===0x1f4){logger[_0xdfcb('0x12')]('SmsApplication,\x20%s,\x20%s',_0x183ea8,_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);return _0xbe50d6(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);}logger[_0xdfcb('0x12')]('SmsApplication,\x20%s,\x20%s',_0x183ea8,_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);return _0x3c5431(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);}else{logger[_0xdfcb('0xc')]('SmsApplication,\x20%s,\x20%s',_0x183ea8,_0xdfcb('0xe'));_0x3c5431(_0x5e650d[_0xdfcb('0x15')][_0xdfcb('0x14')]);}})[_0xdfcb('0x16')](function(_0x11437d){logger[_0xdfcb('0x12')](_0xdfcb('0xd'),_0x183ea8,_0x11437d);_0xbe50d6(_0x11437d);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 5a6e11d..572eaf8 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35a6=['describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','tracked','smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated'];(function(_0x585950,_0x481196){var _0x406a35=function(_0x9c540f){while(--_0x9c540f){_0x585950['push'](_0x585950['shift']());}};_0x406a35(++_0x481196);}(_0x35a6,0x122));var _0x635a=function(_0x8a2dae,_0x2a21a7){_0x8a2dae=_0x8a2dae-0x0;var _0x308f20=_0x35a6[_0x8a2dae];return _0x308f20;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x635a('0x0'));var timeout=require(_0x635a('0x1'));var express=require(_0x635a('0x2'));var router=express[_0x635a('0x3')]();var auth=require(_0x635a('0x4'));var interaction=require(_0x635a('0x5'));var config=require('../../config/environment');var controller=require('./smsInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x635a('0x6')]);router[_0x635a('0x7')](_0x635a('0x8'),auth[_0x635a('0x9')](),controller[_0x635a('0xa')]);router[_0x635a('0x7')](_0x635a('0xb'),auth[_0x635a('0x9')](),controller[_0x635a('0xc')]);router[_0x635a('0x7')](_0x635a('0xd'),auth[_0x635a('0x9')](),controller['getMessages']);router['get'](_0x635a('0xe'),auth[_0x635a('0x9')](),controller[_0x635a('0xf')]);router['post']('/',auth[_0x635a('0x9')](),controller[_0x635a('0x10')]);router[_0x635a('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0x635a('0x12')]);router[_0x635a('0x11')](_0x635a('0x13'),auth[_0x635a('0x9')](),interaction['tracked'](_0x635a('0x14'),_0x635a('0x15')),controller[_0x635a('0x16')]);router['put'](_0x635a('0xb'),auth[_0x635a('0x9')](),interaction[_0x635a('0x17')](_0x635a('0x14'),_0x635a('0x18')),controller[_0x635a('0x19')]);router[_0x635a('0x1a')]('/:id',auth[_0x635a('0x9')](),interaction[_0x635a('0x17')](_0x635a('0x14'),_0x635a('0x1b')),controller['destroy']);router['delete'](_0x635a('0x13'),auth[_0x635a('0x9')](),controller[_0x635a('0x1c')]);module[_0x635a('0x1d')]=router; \ No newline at end of file +var _0x2ebd=['smsinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','/describe','isAuthenticated','describe','show','getMessages','/:id/download','download','post','create','/:id/messages','tracked','smsinteraction:addtags','addTags','/:id','update'];(function(_0x58e39a,_0x474e33){var _0x5233f4=function(_0x3fa875){while(--_0x3fa875){_0x58e39a['push'](_0x58e39a['shift']());}};_0x5233f4(++_0x474e33);}(_0x2ebd,0x1c8));var _0xd2eb=function(_0x5495b3,_0x10cd9a){_0x5495b3=_0x5495b3-0x0;var _0x5e6721=_0x2ebd[_0x5495b3];return _0x5e6721;};'use strict';var multer=require(_0xd2eb('0x0'));var util=require(_0xd2eb('0x1'));var path=require(_0xd2eb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd2eb('0x3')]();var auth=require(_0xd2eb('0x4'));var interaction=require(_0xd2eb('0x5'));var config=require(_0xd2eb('0x6'));var controller=require(_0xd2eb('0x7'));router[_0xd2eb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd2eb('0x8')](_0xd2eb('0x9'),auth[_0xd2eb('0xa')](),controller[_0xd2eb('0xb')]);router[_0xd2eb('0x8')]('/:id',auth[_0xd2eb('0xa')](),controller[_0xd2eb('0xc')]);router['get']('/:id/messages',auth[_0xd2eb('0xa')](),controller[_0xd2eb('0xd')]);router[_0xd2eb('0x8')](_0xd2eb('0xe'),auth[_0xd2eb('0xa')](),controller[_0xd2eb('0xf')]);router[_0xd2eb('0x10')]('/',auth[_0xd2eb('0xa')](),controller[_0xd2eb('0x11')]);router[_0xd2eb('0x10')](_0xd2eb('0x12'),auth[_0xd2eb('0xa')](),controller['addMessage']);router[_0xd2eb('0x10')]('/:id/tags',auth[_0xd2eb('0xa')](),interaction[_0xd2eb('0x13')]('sms',_0xd2eb('0x14')),controller[_0xd2eb('0x15')]);router['put'](_0xd2eb('0x16'),auth[_0xd2eb('0xa')](),interaction[_0xd2eb('0x13')]('sms','smsinteraction:update'),controller[_0xd2eb('0x17')]);router['delete']('/:id',auth[_0xd2eb('0xa')](),interaction[_0xd2eb('0x13')]('sms',_0xd2eb('0x18')),controller[_0xd2eb('0x19')]);router[_0xd2eb('0x1a')](_0xd2eb('0x1b'),auth[_0xd2eb('0xa')](),controller[_0xd2eb('0x1c')]);module[_0xd2eb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index fde5edc..e41ac11 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3195af,_0x536c46){var _0x358a02=function(_0x3bec6f){while(--_0x3bec6f){_0x3195af['push'](_0x3195af['shift']());}};_0x358a02(++_0x536c46);}(_0xb10b,0x12a));var _0xbb10=function(_0x2acec2,_0x12ebf1){_0x2acec2=_0x2acec2-0x0;var _0x19aa0d=_0xb10b[_0x2acec2];return _0x19aa0d;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');module[_0xbb10('0x1')]={'closed':{'type':Sequelize[_0xbb10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb10('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbb10('0x4')]},'phone':{'type':Sequelize[_0xbb10('0x4')]},'read1stAt':{'type':Sequelize[_0xbb10('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb10('0x5')]('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xcb91=['exports','BOOLEAN','DATE','STRING','out'];(function(_0x5d04fa,_0x391603){var _0x52b2d8=function(_0x25e8c6){while(--_0x25e8c6){_0x5d04fa['push'](_0x5d04fa['shift']());}};_0x52b2d8(++_0x391603);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xcb91[_0x5dc03e];return _0x466a07;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1cb9('0x0')]={'closed':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1cb9('0x2')]},'disposition':{'type':Sequelize[_0x1cb9('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'read1stAt':{'type':Sequelize[_0x1cb9('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cb9('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1cb9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cb9('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 1dce17d..c1d1d42 100644 --- a/server/api/smsInteraction/smsInteraction.controller.js +++ b/server/api/smsInteraction/smsInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccb9=['c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','catch','show','params','includeAll','include','create','describe','addMessage','SmsMessage','omit','findOne','format','options','findAll','setTags','ids','spread','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Messages','createdAt','secret','fullname','CmContact','Contact','firstName','lastName','Account','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Sms','YYYY-MM-DD','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','System','direction','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','sendStatus','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','map','TagIds','split','forEach','push','then','index','SmsInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','select','field','from','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','length','find','unreadMessages','value','having','`\x20>\x200','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','DESC','resolve','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','i.*','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile'];(function(_0x2a3d00,_0x5523f1){var _0xf600f6=function(_0x597736){while(--_0x597736){_0x2a3d00['push'](_0x2a3d00['shift']());}};_0xf600f6(++_0x5523f1);}(_0xccb9,0x124));var _0x9ccb=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xccb9[_0x369151];return _0x4292d5;};'use strict';var pdf=require(_0x9ccb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ccb('0x1'));var zipdir=require(_0x9ccb('0x2'));var jsonpatch=require(_0x9ccb('0x3'));var rp=require(_0x9ccb('0x4'));var moment=require('moment');var BPromise=require(_0x9ccb('0x5'));var Mustache=require(_0x9ccb('0x6'));var util=require(_0x9ccb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9ccb('0x8'));var ejs=require(_0x9ccb('0x9'));var fs=require('fs');var _=require(_0x9ccb('0xa'));var squel=require(_0x9ccb('0xb'));var crypto=require(_0x9ccb('0xc'));var jsforce=require(_0x9ccb('0xd'));var deskjs=require(_0x9ccb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9ccb('0xf'));var Papa=require(_0x9ccb('0x10'));var Redis=require(_0x9ccb('0x11'));var authService=require(_0x9ccb('0x12'));var qs=require(_0x9ccb('0x13'));var as=require(_0x9ccb('0x14'));var hardwareService=require(_0x9ccb('0x15'));var logger=require(_0x9ccb('0x16'))(_0x9ccb('0x17'));var utils=require('../../config/utils');var config=require(_0x9ccb('0x18'));var db=require(_0x9ccb('0x19'))['db'];config[_0x9ccb('0x1a')]=_[_0x9ccb('0x1b')](config['redis'],{'host':_0x9ccb('0x1c'),'port':0x18eb});var socket=require(_0x9ccb('0x1d'))(new Redis(config[_0x9ccb('0x1a')]));require('./smsInteraction.socket')[_0x9ccb('0x1e')](socket);function respondWithStatusCode(_0x2d9e00,_0x5f18b2){_0x5f18b2=_0x5f18b2||0xcc;return function(_0x24bb14){if(_0x24bb14){return _0x2d9e00['sendStatus'](_0x5f18b2);}return _0x2d9e00[_0x9ccb('0x1f')](_0x5f18b2)[_0x9ccb('0x20')]();};}function respondWithResult(_0x4cba60,_0x49dc3f){_0x49dc3f=_0x49dc3f||0xc8;return function(_0xafcb1b){if(_0xafcb1b){return _0x4cba60[_0x9ccb('0x1f')](_0x49dc3f)[_0x9ccb('0x21')](_0xafcb1b);}};}function respondWithFilteredResult(_0x223e30,_0x5e5229){return function(_0x40a475){if(_0x40a475){var _0x25df18=_0x40a475[_0x9ccb('0x22')],_0x43434e=_0x5e5229[_0x9ccb('0x23')],_0x32968b=_0x5e5229[_0x9ccb('0x23')]+_0x5e5229['limit'],_0x383251;if(_0x32968b>=_0x25df18){_0x32968b=_0x25df18;_0x383251=0xc8;}else{_0x383251=0xce;}_0x223e30[_0x9ccb('0x1f')](_0x383251);return _0x223e30[_0x9ccb('0x24')](_0x9ccb('0x25'),_0x43434e+'-'+_0x32968b+'/'+_0x25df18)['json'](_0x40a475);}return null;};}function patchUpdates(_0x59aa49){return function(_0x20a58f){try{jsonpatch[_0x9ccb('0x26')](_0x20a58f,_0x59aa49,!![]);}catch(_0x33a20b){return BPromise[_0x9ccb('0x27')](_0x33a20b);}return _0x20a58f[_0x9ccb('0x28')]();};}function saveUpdates(_0x25c570,_0x1a5522){return function(_0x174683){if(_0x174683){return _0x174683[_0x9ccb('0x29')](_0x25c570)['then'](function(_0x53b8a6){return _0x53b8a6;});}return null;};}function removeEntity(_0xae8e3f,_0x4361a3){return function(_0x3b4f93){if(_0x3b4f93){return _0x3b4f93[_0x9ccb('0x2a')]()['then'](function(){_0xae8e3f[_0x9ccb('0x1f')](0xcc)[_0x9ccb('0x20')]();});}};}function handleEntityNotFound(_0x199b54,_0x1652fa){return function(_0x3cc23c){if(!_0x3cc23c){_0x199b54['sendStatus'](0x194);}return _0x3cc23c;};}function handleError(_0x21f880,_0x570dc5){_0x570dc5=_0x570dc5||0x1f4;return function(_0x240669){logger['error'](_0x240669['stack']);if(_0x240669[_0x9ccb('0x2b')]){delete _0x240669[_0x9ccb('0x2b')];}_0x21f880[_0x9ccb('0x1f')](_0x570dc5)['send'](_0x240669);};}function getInteractionUsers(_0x43a8e8,_0x90bfce){return new BPromise(function(_0x332006,_0x52046d){try{if(_0x90bfce[_0x43a8e8['id']]){_0x43a8e8['Users']=_[_0x9ccb('0x2c')](_0x90bfce[_0x43a8e8['id']],function(_0xebb1fb){return{'id':_0xebb1fb['id']};});}}catch(_0x2f09bb){_0x52046d(_0x2f09bb);}_0x332006(_0x43a8e8);});}function getInteractionTags(_0x36abb6,_0x2ddc19){return new BPromise(function(_0x1aef28,_0x12dbd8){try{if(_0x36abb6[_0x9ccb('0x2d')]){_0x36abb6['Tags']=[];_0x36abb6[_0x9ccb('0x2d')][_0x9ccb('0x2e')](',')[_0x9ccb('0x2f')](function(_0xe3d70b){_0x36abb6['Tags'][_0x9ccb('0x30')](_0x2ddc19[_0xe3d70b]);});}delete _0x36abb6['TagIds'];}catch(_0x1bff6b){_0x12dbd8(_0x1bff6b);}_0x1aef28(_0x36abb6);});}function updateSmsInteraction(_0x26d436,_0x5ec81e,_0x5374d2){return new BPromise(function(_0x4ec037,_0x4511c0){return getInteractionUsers(_0x26d436,_0x5374d2)['then'](function(_0x48b892){return getInteractionTags(_0x48b892,_0x5ec81e);})[_0x9ccb('0x31')](function(_0x25dd66){_0x4ec037(_0x25dd66);})['catch'](function(_0x136ac2){_0x4511c0(_0x136ac2);});});}exports[_0x9ccb('0x32')]=function(_0x21927f,_0x414fc8){var _0x5eb09d={},_0x3b235e={},_0x3244d2={'count':0x0,'rows':[]};var _0x5a9387=_[_0x9ccb('0x2c')](db[_0x9ccb('0x33')][_0x9ccb('0x34')],function(_0x554bd1){return{'name':_0x554bd1[_0x9ccb('0x35')],'type':_0x554bd1[_0x9ccb('0x36')][_0x9ccb('0x37')]};});_0x3b235e['model']=_[_0x9ccb('0x2c')](_0x5a9387,_0x9ccb('0x2b'));_0x3b235e[_0x9ccb('0x38')]=_[_0x9ccb('0x39')](_0x21927f[_0x9ccb('0x38')]);_0x3b235e[_0x9ccb('0x3a')]=_[_0x9ccb('0x3b')](_0x3b235e[_0x9ccb('0x3c')],_0x3b235e[_0x9ccb('0x38')]);_0x5eb09d[_0x9ccb('0x3d')]=_['intersection'](_0x3b235e[_0x9ccb('0x3c')],qs[_0x9ccb('0x3e')](_0x21927f['query'][_0x9ccb('0x3e')]));_0x5eb09d[_0x9ccb('0x3d')]=_0x5eb09d[_0x9ccb('0x3d')]['length']?_0x5eb09d[_0x9ccb('0x3d')]:_0x3b235e[_0x9ccb('0x3c')];if(!_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x3f')](_0x9ccb('0x40'))){_0x5eb09d['limit']=qs[_0x9ccb('0x41')](_0x21927f['query'][_0x9ccb('0x41')]);_0x5eb09d['offset']=qs[_0x9ccb('0x23')](_0x21927f[_0x9ccb('0x38')]['offset']);}_0x5eb09d[_0x9ccb('0x42')]=qs[_0x9ccb('0x43')](_0x21927f['query']['sort']);_0x5eb09d[_0x9ccb('0x44')]=qs[_0x9ccb('0x3a')](_['pick'](_0x21927f[_0x9ccb('0x38')],_0x3b235e[_0x9ccb('0x3a')]));var _0x3f9c5d=[];var _0x27e059=squel[_0x9ccb('0x45')]()[_0x9ccb('0x46')]('id')['field'](_0x9ccb('0x2b'))[_0x9ccb('0x46')]('color')[_0x9ccb('0x47')]('tools_tags');var _0x44f3fe=squel[_0x9ccb('0x45')]()[_0x9ccb('0x46')]('u.id')[_0x9ccb('0x46')](_0x9ccb('0x48'))[_0x9ccb('0x47')](_0x9ccb('0x49'),'ui')[_0x9ccb('0x4a')](_0x9ccb('0x4b'),'u',_0x9ccb('0x4c'));var _0x191651=squel[_0x9ccb('0x45')]()[_0x9ccb('0x47')](_0x9ccb('0x4d'),'i')['left_join'](_0x9ccb('0x4e'),'c',_0x9ccb('0x4f'))[_0x9ccb('0x4a')]('users','o',_0x9ccb('0x50'))[_0x9ccb('0x4a')](_0x9ccb('0x51'),'a',_0x9ccb('0x52'))[_0x9ccb('0x4a')](_0x9ccb('0x53'),'me',_0x9ccb('0x54'))[_0x9ccb('0x4a')]('sms_interaction_has_tags','it',_0x9ccb('0x55'))['left_join'](_0x9ccb('0x56'),'t',_0x9ccb('0x57'));var _0x428f5f=squel[_0x9ccb('0x58')]();var _0x42521e=[];var _0x5edff0=squel[_0x9ccb('0x58')]();var _0x24282a;if(_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x59')]){_0x24282a=as['parseSearch'](_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x59')]);var _0x3f850b=_0x24282a['sqlOperator'];for(var _0x13c8aa=0x0;_0x13c8aa<_0x24282a[_0x9ccb('0x5a')][_0x9ccb('0x5b')];_0x13c8aa++){var _0x41f4a1=_0x24282a[_0x9ccb('0x5a')][_0x13c8aa];var _0x3ba99d='i';var _0x5f5c02=_[_0x9ccb('0x5c')](_0x5a9387,['name',_0x41f4a1['field']]);if(!_0x5f5c02){switch(_0x41f4a1['field']){case _0x9ccb('0x5d'):if(_0x41f4a1[_0x9ccb('0x5e')]==0x1){_0x191651[_0x9ccb('0x5f')]('`'+_0x41f4a1[_0x9ccb('0x46')]+'`\x20=\x200');}else{_0x191651[_0x9ccb('0x5f')]('`'+_0x41f4a1[_0x9ccb('0x46')]+_0x9ccb('0x60'));}break;case'Contact':if(_0x41f4a1[_0x9ccb('0x61')]==='$substring'){if(_0x41f4a1[_0x9ccb('0x5e')][_0x9ccb('0x2e')]('\x20')[_0x9ccb('0x5b')]>0x1){_0x428f5f[_0x3f850b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9ccb('0x62')](_0x41f4a1[_0x9ccb('0x5e')]),null);}else{var _0xa7d486='%'+_0x41f4a1[_0x9ccb('0x5e')]+'%';_0x428f5f[_0x3f850b](_0x9ccb('0x63'),_0xa7d486,_0xa7d486,_0xa7d486);}}else{_0x5f5c02=_[_0x9ccb('0x5c')](_0x5a9387,['name',_0x9ccb('0x64')]);_0x41f4a1[_0x9ccb('0x46')]=_0x9ccb('0x64');_0x2daa03=as['buildExpression'](_0x3ba99d,_0x5f5c02[_0x9ccb('0x36')],_0x41f4a1);_0x428f5f[_0x3f850b](_0x2daa03[_0x9ccb('0x65')],_0x2daa03[_0x9ccb('0x5e')][_0x9ccb('0x66')],_0x2daa03[_0x9ccb('0x5e')][_0x9ccb('0x20')]);}break;case _0x9ccb('0x67'):var _0xb5c40=_0x41f4a1[_0x9ccb('0x5e')][_0x9ccb('0x2e')](',')[_0x9ccb('0x2c')](function(_0x18c80a){return Number(_0x18c80a);});_0xb5c40[_0x9ccb('0x2f')](function(_0x58a870){_0x5edff0['or'](_0x9ccb('0x68'),'%,'+_0x58a870+',%');});_0x42521e=_[_0x9ccb('0x69')](_0x42521e,_0xb5c40);break;case _0x9ccb('0x6a'):if(_0x41f4a1[_0x9ccb('0x61')]===_0x9ccb('0x6b')){_0x428f5f[_0x3f850b](_0x9ccb('0x6c'),'%'+_0x41f4a1[_0x9ccb('0x5e')]+'%',null);}else{_0x5f5c02=_['find'](_0x5a9387,[_0x9ccb('0x2b'),_0x9ccb('0x6d')]);_0x41f4a1[_0x9ccb('0x46')]=_0x9ccb('0x6d');_0x2daa03=as[_0x9ccb('0x6e')](_0x3ba99d,_0x5f5c02[_0x9ccb('0x36')],_0x41f4a1);_0x428f5f[_0x3f850b](_0x2daa03[_0x9ccb('0x65')],_0x2daa03[_0x9ccb('0x5e')][_0x9ccb('0x66')],_0x2daa03['value']['end']);}break;case _0x9ccb('0x6f'):_0x2daa03=as[_0x9ccb('0x6e')]('me',null,_0x41f4a1);_0x428f5f[_0x3f850b](_0x2daa03[_0x9ccb('0x65')],_0x2daa03[_0x9ccb('0x5e')][_0x9ccb('0x66')],_0x2daa03[_0x9ccb('0x5e')][_0x9ccb('0x20')]);break;}}else{var _0x2daa03=as['buildExpression'](_0x3ba99d,_0x5f5c02[_0x9ccb('0x36')],_0x41f4a1);_0x428f5f[_0x3f850b](_0x2daa03[_0x9ccb('0x65')],_0x2daa03[_0x9ccb('0x5e')][_0x9ccb('0x66')],_0x2daa03[_0x9ccb('0x5e')][_0x9ccb('0x20')]);}}}else{var _0x84f4c3=_(_0x21927f['query'])[_0x9ccb('0x39')]()[_0x9ccb('0x2c')](function(_0x16f063){return _['some'](_0x5a9387,[_0x9ccb('0x2b'),_0x16f063])?_0x16f063:undefined;})[_0x9ccb('0x70')]()[_0x9ccb('0x5e')]();if(!_[_0x9ccb('0x71')](_0x84f4c3)){_0x84f4c3[_0x9ccb('0x2f')](function(_0x1c5abb){if(_0x1c5abb===_0x9ccb('0x72')){_0x191651[_0x9ccb('0x44')](_0x9ccb('0x73'),[][_0x9ccb('0x74')](_0x21927f[_0x9ccb('0x38')][_0x1c5abb]));}else if(_0x1c5abb==='createdAt'){var _0x40f59b=JSON[_0x9ccb('0x75')](_0x21927f['query'][_0x1c5abb])['$gte'];var _0x3a7795=JSON[_0x9ccb('0x75')](_0x21927f['query'][_0x1c5abb])[_0x9ccb('0x76')];_0x191651[_0x9ccb('0x44')](_0x9ccb('0x77'),_0x40f59b,_0x3a7795);}else{if(_0x21927f[_0x9ccb('0x38')][_0x1c5abb]===_0x9ccb('0x78')){_0x191651['where']('i.'+_0x1c5abb+'\x20IS\x20NULL');}else{_0x191651[_0x9ccb('0x44')]('i.'+_0x1c5abb+_0x9ccb('0x79'),_0x21927f[_0x9ccb('0x38')][_0x1c5abb]);}}});}if(_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x7a')]){if(_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x7a')]==0x1){_0x191651[_0x9ccb('0x5f')](_0x9ccb('0x7b'));}else{_0x191651['having']('`unreadMessages`\x20>\x200');}}if(_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x7c')]){_0x42521e=_[_0x9ccb('0x7d')](_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x7c')])?_0x21927f['query']['tag']:new Array(_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x7c')]);_0x42521e[_0x9ccb('0x2f')](function(_0x16f0c2){_0x5edff0['or'](_0x9ccb('0x68'),'%,'+_0x16f0c2+',%');});}if(_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x7e')]){var _0x2d5197=_0x21927f['query'][_0x9ccb('0x7e')][_0x9ccb('0x7f')]('\x5c','\x5c\x5c')[_0x9ccb('0x7f')]('\x27\x27',_0x9ccb('0x80'));if(qs['isNumeric'](_0x2d5197)){_0x428f5f['or'](_0x9ccb('0x81'),_0x2d5197+'%')['or']('i.phone\x20LIKE\x20?',_0x2d5197+'%');}else{_0x428f5f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9ccb('0x62')](_0x2d5197))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2d5197+'%');}}}_0x191651[_0x9ccb('0x44')](_0x428f5f);_0x191651[_0x9ccb('0x82')](_0x9ccb('0x83'));var _0x1b1096={'type':db[_0x9ccb('0x84')][_0x9ccb('0x85')]['SELECT'],'raw':!![]};var _0x146be1=_0x191651['clone']();_0x146be1[_0x9ccb('0x46')]('i.id');_0x146be1[_0x9ccb('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9ccb('0x5d'));if(_0x5eb09d[_0x9ccb('0x42')]){_0x5eb09d[_0x9ccb('0x42')][_0x9ccb('0x2f')](function(_0x3ea6bf){_0x191651[_0x9ccb('0x42')]('i.'+_0x3ea6bf[0x0],_0x3ea6bf[0x1]===_0x9ccb('0x86')?![]:!![]);});}if(!_['isEmpty'](_0x42521e)){_0x191651[_0x9ccb('0x5f')](_0x5edff0);_0x146be1[_0x9ccb('0x44')]('t.id\x20IN\x20?',_0x42521e);}BPromise[_0x9ccb('0x87')]()[_0x9ccb('0x31')](function(){if(!_0x24282a&&_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x72')])return;return _0x21927f['user'][_0x9ccb('0x88')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4c0a01){if(_[_0x9ccb('0x71')](_0x4c0a01)){_0x146be1[_0x9ccb('0x44')]('i.SmsAccountId\x20IS\x20NULL');_0x191651[_0x9ccb('0x44')](_0x9ccb('0x89'));}else{_0x146be1[_0x9ccb('0x44')](_0x9ccb('0x73'),_[_0x9ccb('0x2c')](_0x4c0a01,'id'));_0x191651[_0x9ccb('0x44')](_0x9ccb('0x73'),_[_0x9ccb('0x2c')](_0x4c0a01,'id'));}});})[_0x9ccb('0x31')](function(){db[_0x9ccb('0x8a')][_0x9ccb('0x38')](_0x146be1['toString'](),_0x1b1096)[_0x9ccb('0x31')](function(_0x2ea892){_0x3244d2[_0x9ccb('0x22')]=_0x2ea892[_0x9ccb('0x5b')];if(_0x3244d2[_0x9ccb('0x22')]===0x0)return[];return db[_0x9ccb('0x8a')][_0x9ccb('0x38')](_0x27e059[_0x9ccb('0x8b')](),_0x1b1096)['then'](function(_0x4585f9){_0x3f9c5d=_[_0x9ccb('0x8c')](_0x4585f9,'id');_0x1b1096=_[_0x9ccb('0x8d')](_0x1b1096,{'model':db[_0x9ccb('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x21927f[_0x9ccb('0x38')][_0x9ccb('0x3e')]){_0x5eb09d[_0x9ccb('0x3d')]['forEach'](function(_0x565972){_0x191651[_0x9ccb('0x46')]('i.'+_0x565972);});}else{_0x191651[_0x9ccb('0x46')](_0x9ccb('0x8e'),'unreadMessages');_0x191651['field'](_0x9ccb('0x8f'),'Account.key');_0x191651[_0x9ccb('0x46')]('a.mandatoryDisposition',_0x9ccb('0x90'));_0x191651[_0x9ccb('0x46')](_0x9ccb('0x91'));_0x191651[_0x9ccb('0x46')]('c.firstName','Contact.firstName');_0x191651[_0x9ccb('0x46')](_0x9ccb('0x92'),'Contact.lastName');_0x191651[_0x9ccb('0x46')](_0x9ccb('0x93'),_0x9ccb('0x94'));_0x191651[_0x9ccb('0x46')](_0x9ccb('0x95'),_0x9ccb('0x96'));_0x191651[_0x9ccb('0x46')](_0x9ccb('0x97'),'Contact.mobile');_0x191651[_0x9ccb('0x46')](_0x9ccb('0x98'),'Contact.fax');_0x191651[_0x9ccb('0x46')](_0x9ccb('0x99'),_0x9ccb('0x2d'));}_0x191651[_0x9ccb('0x41')](_0x5eb09d['limit']);_0x191651['offset'](_0x5eb09d[_0x9ccb('0x23')]);return db[_0x9ccb('0x8a')]['query'](_0x191651[_0x9ccb('0x8b')](),_0x1b1096);})['then'](function(_0x113fc9){_0x44f3fe[_0x9ccb('0x44')](_0x9ccb('0x9a'),_[_0x9ccb('0x2c')](_0x113fc9,'id'));return db[_0x9ccb('0x8a')][_0x9ccb('0x38')](_0x44f3fe[_0x9ccb('0x8b')](),_0x1b1096)['then'](function(_0x3f35d4){var _0x5c0e30=_[_0x9ccb('0x9b')](_0x3f35d4,_0x9ccb('0x9c'));var _0x215e97=[];_0x113fc9[_0x9ccb('0x2f')](function(_0x290e3d){_0x215e97['push'](updateSmsInteraction(_0x290e3d,_0x3f9c5d,_0x5c0e30));});return BPromise[_0x9ccb('0x9d')](_0x215e97);});});})[_0x9ccb('0x31')](function(_0x1c323e){_0x3244d2[_0x9ccb('0x9e')]=_0x1c323e;return _0x3244d2;})[_0x9ccb('0x31')](respondWithFilteredResult(_0x414fc8,_0x5eb09d));})[_0x9ccb('0x9f')](handleError(_0x414fc8,null));};exports[_0x9ccb('0xa0')]=function(_0x5a088e,_0x2a0550){var _0x24739c={'raw':![],'where':{'id':_0x5a088e[_0x9ccb('0xa1')]['id']}},_0x5d29aa={};_0x5d29aa[_0x9ccb('0x3c')]=_[_0x9ccb('0x39')](db[_0x9ccb('0x33')][_0x9ccb('0x34')]);_0x5d29aa[_0x9ccb('0x38')]=_['keys'](_0x5a088e[_0x9ccb('0x38')]);_0x5d29aa[_0x9ccb('0x3a')]=_[_0x9ccb('0x3b')](_0x5d29aa['model'],_0x5d29aa[_0x9ccb('0x38')]);_0x24739c[_0x9ccb('0x3d')]=_[_0x9ccb('0x3b')](_0x5d29aa[_0x9ccb('0x3c')],qs['fields'](_0x5a088e[_0x9ccb('0x38')][_0x9ccb('0x3e')]));_0x24739c['attributes']=_0x24739c[_0x9ccb('0x3d')][_0x9ccb('0x5b')]?_0x24739c[_0x9ccb('0x3d')]:_0x5d29aa[_0x9ccb('0x3c')];if(_0x5a088e[_0x9ccb('0x38')][_0x9ccb('0xa2')]){_0x24739c[_0x9ccb('0xa3')]=[{'all':!![]}];}_0x24739c=_[_0x9ccb('0x8d')]({},_0x24739c,_0x5a088e['options']);return db['SmsInteraction'][_0x9ccb('0x5c')](_0x24739c)[_0x9ccb('0x31')](handleEntityNotFound(_0x2a0550,null))[_0x9ccb('0x31')](respondWithResult(_0x2a0550,null))[_0x9ccb('0x9f')](handleError(_0x2a0550,null));};exports['create']=function(_0x39f2c4,_0x371481){return db[_0x9ccb('0x33')][_0x9ccb('0xa4')](_0x39f2c4[_0x9ccb('0x6f')],{})['then'](respondWithResult(_0x371481,0xc9))[_0x9ccb('0x9f')](handleError(_0x371481,null));};exports['update']=function(_0x2f5984,_0x5006ba){if(_0x2f5984[_0x9ccb('0x6f')]['id']){delete _0x2f5984['body']['id'];}return db[_0x9ccb('0x33')][_0x9ccb('0x5c')]({'where':{'id':_0x2f5984['params']['id']}})[_0x9ccb('0x31')](handleEntityNotFound(_0x5006ba,null))[_0x9ccb('0x31')](saveUpdates(_0x2f5984[_0x9ccb('0x6f')],null))[_0x9ccb('0x31')](respondWithResult(_0x5006ba,null))['catch'](handleError(_0x5006ba,null));};exports['destroy']=function(_0x53bfcc,_0x56d401){return db[_0x9ccb('0x33')]['find']({'where':{'id':_0x53bfcc['params']['id']}})[_0x9ccb('0x31')](handleEntityNotFound(_0x56d401,null))[_0x9ccb('0x31')](removeEntity(_0x56d401,null))[_0x9ccb('0x9f')](handleError(_0x56d401,null));};exports[_0x9ccb('0xa5')]=function(_0x57db04,_0x45ec91){return db['SmsInteraction']['describe']()[_0x9ccb('0x31')](respondWithResult(_0x45ec91,null))[_0x9ccb('0x9f')](handleError(_0x45ec91,null));};exports[_0x9ccb('0xa6')]=function(_0x496dfb,_0x3a89f0,_0x25c4c1){return db[_0x9ccb('0xa7')]['find']({'where':{'id':_0x496dfb['params']['id']}})['then'](handleEntityNotFound(_0x3a89f0,null))[_0x9ccb('0x31')](function(_0x116689){if(_0x116689){return _0x116689[_0x9ccb('0xa6')](_0x496dfb['body']['ids'],_[_0x9ccb('0xa8')](_0x496dfb[_0x9ccb('0x6f')],['ids','id'])||{});}})[_0x9ccb('0x31')](respondWithResult(_0x3a89f0,null))[_0x9ccb('0x9f')](handleError(_0x3a89f0,null));};exports['getMessages']=function(_0x114e57,_0x3cd6c9,_0xc39208){var _0x5982e7={'raw':![],'where':{}};var _0x53000a={};var _0x147ad1={'count':0x0,'rows':[]};return db[_0x9ccb('0x33')][_0x9ccb('0xa9')]({'where':{'id':_0x114e57[_0x9ccb('0xa1')]['id']}})[_0x9ccb('0x31')](handleEntityNotFound(_0x3cd6c9,null))[_0x9ccb('0x31')](function(_0x496b9c){if(_0x496b9c){_0x53000a['model']=_[_0x9ccb('0x39')](db['SmsMessage']['rawAttributes']);_0x53000a[_0x9ccb('0x38')]=_[_0x9ccb('0x39')](_0x114e57[_0x9ccb('0x38')]);_0x53000a[_0x9ccb('0x3a')]=_[_0x9ccb('0x3b')](_0x53000a['model'],_0x53000a[_0x9ccb('0x38')]);_0x5982e7[_0x9ccb('0x3d')]=_[_0x9ccb('0x3b')](_0x53000a[_0x9ccb('0x3c')],qs[_0x9ccb('0x3e')](_0x114e57['query']['fields']));_0x5982e7[_0x9ccb('0x3d')]=_0x5982e7['attributes'][_0x9ccb('0x5b')]?_0x5982e7[_0x9ccb('0x3d')]:_0x53000a['model'];if(!_0x114e57[_0x9ccb('0x38')][_0x9ccb('0x3f')](_0x9ccb('0x40'))){_0x5982e7['limit']=qs[_0x9ccb('0x41')](_0x114e57[_0x9ccb('0x38')][_0x9ccb('0x41')]);_0x5982e7[_0x9ccb('0x23')]=qs[_0x9ccb('0x23')](_0x114e57[_0x9ccb('0x38')]['offset']);}_0x5982e7['order']=qs[_0x9ccb('0x43')](_0x114e57[_0x9ccb('0x38')][_0x9ccb('0x43')]);_0x5982e7['where']=qs[_0x9ccb('0x3a')](_['pick'](_0x114e57['query'],_0x53000a[_0x9ccb('0x3a')]));_0x5982e7['where'][_0x9ccb('0x9c')]=_0x496b9c['id'];if(_0x114e57[_0x9ccb('0x38')][_0x9ccb('0x7e')]){_0x5982e7['where']=_[_0x9ccb('0x8d')](_0x5982e7[_0x9ccb('0x44')],{'$or':_[_0x9ccb('0x2c')](_0x5982e7[_0x9ccb('0x3d')],function(_0x2c1958){var _0x3677e6={};_0x3677e6[_0x2c1958]={'$like':'%'+_0x114e57[_0x9ccb('0x38')][_0x9ccb('0x7e')]+'%'};return _0x3677e6;})});}if(_0x114e57[_0x9ccb('0x38')]['$gte']){var _0x1fbafb=_0x114e57[_0x9ccb('0x38')]['$gte'][_0x9ccb('0x2e')](',');var _0x16fab4={};_0x16fab4[_0x1fbafb[0x0]]={'$gte':moment(_0x1fbafb[0x1])[_0x9ccb('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5982e7[_0x9ccb('0x44')]=_['merge'](_0x5982e7['where'],_0x16fab4);}_0x5982e7=_[_0x9ccb('0x8d')]({},_0x5982e7,_0x114e57[_0x9ccb('0xab')]);return db['SmsMessage'][_0x9ccb('0x22')]({'where':_0x5982e7['where']})[_0x9ccb('0x31')](function(_0x4b862d){_0x147ad1[_0x9ccb('0x22')]=_0x4b862d;if(_0x114e57[_0x9ccb('0x38')][_0x9ccb('0xa2')]){_0x5982e7[_0x9ccb('0xa3')]=[{'all':!![]}];}return db[_0x9ccb('0xa7')][_0x9ccb('0xac')](_0x5982e7);})[_0x9ccb('0x31')](function(_0x2bc8d9){_0x147ad1[_0x9ccb('0x9e')]=_0x2bc8d9;return _0x147ad1;});}})['then'](respondWithFilteredResult(_0x3cd6c9,_0x5982e7))[_0x9ccb('0x9f')](handleError(_0x3cd6c9,null));};exports['addTags']=function(_0xa37b1b,_0x5a45c0,_0x562f47){return db['SmsInteraction']['find']({'where':{'id':_0xa37b1b[_0x9ccb('0xa1')]['id']}})[_0x9ccb('0x31')](handleEntityNotFound(_0x5a45c0,null))[_0x9ccb('0x31')](function(_0x5e0956){if(_0x5e0956){return _0x5e0956[_0x9ccb('0xad')](_0xa37b1b['body'][_0x9ccb('0xae')],_[_0x9ccb('0xa8')](_0xa37b1b[_0x9ccb('0x6f')],[_0x9ccb('0xae'),'id'])||{})[_0x9ccb('0xaf')](function(){return db[_0x9ccb('0x67')][_0x9ccb('0xac')]({'attributes':['id','name','color'],'where':{'id':_0xa37b1b[_0x9ccb('0x6f')][_0x9ccb('0xae')]}});})[_0x9ccb('0x31')](function(_0x5c07f5){socket['emit'](_0x9ccb('0xb0'),{'id':Number(_0xa37b1b[_0x9ccb('0xa1')]['id']),'tags':_0x5c07f5||[]});return{'id':Number(_0xa37b1b[_0x9ccb('0xa1')]['id']),'tags':_0x5c07f5||[]};});}})['then'](respondWithResult(_0x5a45c0,null))[_0x9ccb('0x9f')](handleError(_0x5a45c0,null));};exports[_0x9ccb('0xb1')]=function(_0xf421b9,_0x3a3905,_0x4e2269){return db['SmsInteraction'][_0x9ccb('0x5c')]({'where':{'id':_0xf421b9[_0x9ccb('0xa1')]['id']}})[_0x9ccb('0x31')](handleEntityNotFound(_0x3a3905,null))[_0x9ccb('0x31')](function(_0xc79fed){if(_0xc79fed){return _0xc79fed[_0x9ccb('0xb1')](_0xf421b9[_0x9ccb('0x38')]['ids']);}})[_0x9ccb('0x31')](respondWithStatusCode(_0x3a3905,null))[_0x9ccb('0x9f')](handleError(_0x3a3905,null));};exports[_0x9ccb('0xb2')]=function(_0x1a98bf,_0x42eda1){var _0x512434=moment()[_0x9ccb('0xb3')]()[_0x9ccb('0x8b')]();var _0x2d3bbc=path[_0x9ccb('0xb4')](config['root'],_0x9ccb('0xb5'),_0x9ccb('0xb6'),_0x9ccb('0xb7'));var _0x6b6ac2=path[_0x9ccb('0xb4')](config[_0x9ccb('0xb8')],_0x9ccb('0xb5'),_0x9ccb('0xb6'),_0x9ccb('0xb9'));var _0x39396d=path[_0x9ccb('0xb4')](_0x2d3bbc,_0x512434);var _0x336d15=util[_0x9ccb('0xaa')](_0x9ccb('0xba'),_0x1a98bf[_0x9ccb('0xa1')]['id'],_0x512434);var _0x7cf0a3=path['join'](_0x2d3bbc,_0x336d15);var _0x3ff5f1=![];return db['SmsInteraction'][_0x9ccb('0x5c')]({'where':{'id':_0x1a98bf['params']['id']},'include':[{'model':db['SmsMessage'],'as':_0x9ccb('0xbb'),'attributes':['id',_0x9ccb('0x6f'),_0x9ccb('0xbc'),'direction',_0x9ccb('0xbd'),_0x9ccb('0x7a')],'include':[{'model':db[_0x9ccb('0x6a')],'as':_0x9ccb('0x6a'),'attributes':['id',_0x9ccb('0xbe')],'raw':!![]},{'model':db[_0x9ccb('0xbf')],'as':_0x9ccb('0xc0'),'attributes':['id',_0x9ccb('0xc1'),_0x9ccb('0xc2')],'raw':!![]}]},{'model':db['SmsAccount'],'as':_0x9ccb('0xc3'),'attributes':['id',_0x9ccb('0x2b')]},{'model':db[_0x9ccb('0x6a')],'as':_0x9ccb('0xc4'),'attributes':['id',_0x9ccb('0xbe')]}]})[_0x9ccb('0x31')](handleEntityNotFound(_0x42eda1,null))[_0x9ccb('0x31')](function(_0x43d4f7){if(_0x43d4f7){var _0x2da238=_0x43d4f7[_0x9ccb('0xc5')]({'plain':!![]});_0x3ff5f1=!![];var _0x4503f8={'format':'A4','border':_0x9ccb('0xc6'),'header':{'height':_0x9ccb('0xc7'),'contents':{'first':_0x9ccb('0xc8')}},'footer':{'height':_0x9ccb('0xc9'),'contents':{'default':util[_0x9ccb('0xaa')](_0x9ccb('0xca'),util[_0x9ccb('0xaa')]('%s\x20#%d',_0x9ccb('0xcb'),_0x2da238['id']),moment()[_0x9ccb('0xaa')](_0x9ccb('0xcc'))[_0x9ccb('0x8b')]())}}};fs[_0x9ccb('0xcd')](_0x39396d);var _0x604e7d={'channel':_0x9ccb('0xcb'),'account':_0x2da238[_0x9ccb('0xc3')][_0x9ccb('0x2b')],'agent':_0x2da238[_0x9ccb('0xc4')]?_0x2da238[_0x9ccb('0xc4')][_0x9ccb('0xbe')]:'N.A.','createdAt':moment(_0x2da238[_0x9ccb('0xbc')])[_0x9ccb('0xaa')](_0x9ccb('0xce'))[_0x9ccb('0x8b')](),'closedAt':_0x2da238[_0x9ccb('0xcf')]?moment(_0x2da238['closedAt'])[_0x9ccb('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9ccb('0x8b')]():'','disposition':_0x2da238[_0x9ccb('0xd0')],'messages':_(_0x2da238['Messages'])['filter']({'secret':![]})[_0x9ccb('0x2c')](function(_0x23bbbc){return{'date':moment(_0x23bbbc['createdAt'])['format'](_0x9ccb('0xce'))[_0x9ccb('0x8b')](),'sender':_0x23bbbc['direction']==='out'?_0x23bbbc[_0x9ccb('0x6a')]?_0x23bbbc['User'][_0x9ccb('0xbe')]:_0x9ccb('0xd1'):_0x23bbbc[_0x9ccb('0xc0')][_0x9ccb('0xc1')]+(_0x23bbbc[_0x9ccb('0xc0')]['lastName']?'\x20'+_0x23bbbc[_0x9ccb('0xc0')][_0x9ccb('0xc2')]:''),'body':_0x23bbbc['body'],'direction':_0x23bbbc[_0x9ccb('0xd2')]===_0x9ccb('0xd3')?'A':'C','secret':_0x23bbbc['secret'],'read':_0x23bbbc[_0x9ccb('0x7a')]};})[_0x9ccb('0x5e')]()};return ejs[_0x9ccb('0xd4')](path[_0x9ccb('0xb4')](config[_0x9ccb('0xb8')],'server',_0x9ccb('0xd5'),_0x9ccb('0xd6')),{'interaction':_0x604e7d})[_0x9ccb('0x31')](function(_0x394bd0){return new BPromise(function(_0x330cea,_0x2ffd6e){pdf[_0x9ccb('0xa4')](_0x394bd0,_0x4503f8)[_0x9ccb('0xd7')](path['join'](_0x39396d,_0x9ccb('0xd8')+_0x2da238['id']+'-'+_0x512434+_0x9ccb('0xd9')),function(_0xfeca35,_0x4a797b){if(_0xfeca35)return _0x2ffd6e(_0xfeca35);_0x330cea(_0x4a797b);});});});}})[_0x9ccb('0x31')](function(){if(_0x3ff5f1){return new BPromise(function(_0x5d1599,_0x5ae8db){zipdir(_0x39396d,{'saveTo':_0x7cf0a3},function(_0x5642bc,_0x412dc7){if(_0x5642bc)return _0x5ae8db(_0x5642bc);return _0x5d1599(_0x412dc7);});})['then'](function(){return new BPromise(function(_0x4ae273,_0x1fd8d8){rimraf(_0x39396d,function(_0x4821fe){if(_0x4821fe)_0x1fd8d8(_0x4821fe);return _0x4ae273();});});})['then'](function(){return _0x42eda1[_0x9ccb('0xb2')](_0x7cf0a3,_0x336d15,function(_0x4f127b){if(_0x4f127b){console[_0x9ccb('0xda')](_0x9ccb('0xdb'),_0x4f127b);}else{fs[_0x9ccb('0xdc')](_0x7cf0a3);}});});}else{return _0x42eda1[_0x9ccb('0xdd')](0xc8);}})[_0x9ccb('0x9f')](handleError(_0x42eda1,null));}; \ No newline at end of file +var _0xf43c=['body','some','compact','isEmpty','SmsAccountId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','rawAttributes','includeAll','include','options','create','SmsMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','SmsInteractionId','merge','$gte','format','findAll','addTags','setTags','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','Messages','direction','secret','User','firstName','lastName','SmsAccount','Account','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','fullname','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','out','views','downloadInteraction.html','transcript-','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./smsInteraction.socket','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','split','push','catch','index','SmsInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','select','field','color','tools_tags','u.id','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xf43c,0x160));var _0xcf43=function(_0x412e7a,_0x61ec70){_0x412e7a=_0x412e7a-0x0;var _0x3d7c10=_0xf43c[_0x412e7a];return _0x3d7c10;};'use strict';var pdf=require(_0xcf43('0x0'));var emlformat=require(_0xcf43('0x1'));var rimraf=require(_0xcf43('0x2'));var zipdir=require(_0xcf43('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf43('0x4'));var moment=require('moment');var BPromise=require(_0xcf43('0x5'));var Mustache=require(_0xcf43('0x6'));var util=require(_0xcf43('0x7'));var path=require(_0xcf43('0x8'));var sox=require(_0xcf43('0x9'));var csv=require(_0xcf43('0xa'));var ejs=require(_0xcf43('0xb'));var fs=require('fs');var _=require(_0xcf43('0xc'));var squel=require(_0xcf43('0xd'));var crypto=require(_0xcf43('0xe'));var jsforce=require(_0xcf43('0xf'));var deskjs=require(_0xcf43('0x10'));var toCsv=require(_0xcf43('0xa'));var querystring=require('querystring');var Papa=require(_0xcf43('0x11'));var Redis=require('ioredis');var authService=require(_0xcf43('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcf43('0x13'));var hardwareService=require(_0xcf43('0x14'));var logger=require(_0xcf43('0x15'))(_0xcf43('0x16'));var utils=require(_0xcf43('0x17'));var config=require(_0xcf43('0x18'));var db=require('../../mysqldb')['db'];config[_0xcf43('0x19')]=_[_0xcf43('0x1a')](config[_0xcf43('0x19')],{'host':_0xcf43('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf43('0x19')]));require(_0xcf43('0x1c'))['register'](socket);function respondWithStatusCode(_0x411390,_0x123392){_0x123392=_0x123392||0xcc;return function(_0xb77ac7){if(_0xb77ac7){return _0x411390[_0xcf43('0x1d')](_0x123392);}return _0x411390[_0xcf43('0x1e')](_0x123392)[_0xcf43('0x1f')]();};}function respondWithResult(_0x3e98f0,_0x2cc340){_0x2cc340=_0x2cc340||0xc8;return function(_0x3cbc14){if(_0x3cbc14){return _0x3e98f0[_0xcf43('0x1e')](_0x2cc340)[_0xcf43('0x20')](_0x3cbc14);}};}function respondWithFilteredResult(_0x1fb6ba,_0x4adc5c){return function(_0x1c21dd){if(_0x1c21dd){var _0x14cac7=_0x1c21dd[_0xcf43('0x21')],_0x5453be=_0x4adc5c[_0xcf43('0x22')],_0x46f83d=_0x4adc5c[_0xcf43('0x22')]+_0x4adc5c['limit'],_0x3ebcc5;if(_0x46f83d>=_0x14cac7){_0x46f83d=_0x14cac7;_0x3ebcc5=0xc8;}else{_0x3ebcc5=0xce;}_0x1fb6ba[_0xcf43('0x1e')](_0x3ebcc5);return _0x1fb6ba['set'](_0xcf43('0x23'),_0x5453be+'-'+_0x46f83d+'/'+_0x14cac7)[_0xcf43('0x20')](_0x1c21dd);}return null;};}function patchUpdates(_0x973151){return function(_0x5b1399){try{jsonpatch[_0xcf43('0x24')](_0x5b1399,_0x973151,!![]);}catch(_0x1d9e5a){return BPromise['reject'](_0x1d9e5a);}return _0x5b1399[_0xcf43('0x25')]();};}function saveUpdates(_0x579c92,_0x274ebb){return function(_0x3cf4b9){if(_0x3cf4b9){return _0x3cf4b9[_0xcf43('0x26')](_0x579c92)[_0xcf43('0x27')](function(_0x5497b5){return _0x5497b5;});}return null;};}function removeEntity(_0x3a4a28,_0x1b6e27){return function(_0x1ce288){if(_0x1ce288){return _0x1ce288[_0xcf43('0x28')]()['then'](function(){_0x3a4a28[_0xcf43('0x1e')](0xcc)[_0xcf43('0x1f')]();});}};}function handleEntityNotFound(_0x57406d,_0x4864a8){return function(_0x43ddc7){if(!_0x43ddc7){_0x57406d[_0xcf43('0x1d')](0x194);}return _0x43ddc7;};}function handleError(_0x389010,_0xa303eb){_0xa303eb=_0xa303eb||0x1f4;return function(_0xbce67b){logger[_0xcf43('0x29')](_0xbce67b[_0xcf43('0x2a')]);if(_0xbce67b[_0xcf43('0x2b')]){delete _0xbce67b[_0xcf43('0x2b')];}_0x389010[_0xcf43('0x1e')](_0xa303eb)[_0xcf43('0x2c')](_0xbce67b);};}function getInteractionUsers(_0x220fbb,_0x565e58){return new BPromise(function(_0x101f0e,_0x5a9b64){try{if(_0x565e58[_0x220fbb['id']]){_0x220fbb[_0xcf43('0x2d')]=_[_0xcf43('0x2e')](_0x565e58[_0x220fbb['id']],function(_0x24dbd3){return{'id':_0x24dbd3['id']};});}}catch(_0x36c567){_0x5a9b64(_0x36c567);}_0x101f0e(_0x220fbb);});}function getInteractionTags(_0x17f2d3,_0x4e4852){return new BPromise(function(_0x38640f,_0x17ddea){try{if(_0x17f2d3[_0xcf43('0x2f')]){_0x17f2d3[_0xcf43('0x30')]=[];_0x17f2d3[_0xcf43('0x2f')][_0xcf43('0x31')](',')['forEach'](function(_0x528482){_0x17f2d3[_0xcf43('0x30')][_0xcf43('0x32')](_0x4e4852[_0x528482]);});}delete _0x17f2d3[_0xcf43('0x2f')];}catch(_0x4cda28){_0x17ddea(_0x4cda28);}_0x38640f(_0x17f2d3);});}function updateSmsInteraction(_0x25ce4a,_0x4848db,_0x3f622a){return new BPromise(function(_0xb4bebb,_0x2d050b){return getInteractionUsers(_0x25ce4a,_0x3f622a)[_0xcf43('0x27')](function(_0x13a9ad){return getInteractionTags(_0x13a9ad,_0x4848db);})[_0xcf43('0x27')](function(_0x421e18){_0xb4bebb(_0x421e18);})[_0xcf43('0x33')](function(_0x198573){_0x2d050b(_0x198573);});});}exports[_0xcf43('0x34')]=function(_0x3ae004,_0xae3f66){var _0x5c3bf8={},_0x5f5e35={},_0xfa8cc6={'count':0x0,'rows':[]};var _0x392390=_[_0xcf43('0x2e')](db[_0xcf43('0x35')]['rawAttributes'],function(_0x109752){return{'name':_0x109752['fieldName'],'type':_0x109752[_0xcf43('0x36')][_0xcf43('0x37')]};});_0x5f5e35[_0xcf43('0x38')]=_['map'](_0x392390,_0xcf43('0x2b'));_0x5f5e35[_0xcf43('0x39')]=_[_0xcf43('0x3a')](_0x3ae004[_0xcf43('0x39')]);_0x5f5e35[_0xcf43('0x3b')]=_[_0xcf43('0x3c')](_0x5f5e35[_0xcf43('0x38')],_0x5f5e35[_0xcf43('0x39')]);_0x5c3bf8[_0xcf43('0x3d')]=_[_0xcf43('0x3c')](_0x5f5e35[_0xcf43('0x38')],qs['fields'](_0x3ae004[_0xcf43('0x39')][_0xcf43('0x3e')]));_0x5c3bf8[_0xcf43('0x3d')]=_0x5c3bf8['attributes']['length']?_0x5c3bf8[_0xcf43('0x3d')]:_0x5f5e35[_0xcf43('0x38')];if(!_0x3ae004[_0xcf43('0x39')]['hasOwnProperty'](_0xcf43('0x3f'))){_0x5c3bf8[_0xcf43('0x40')]=qs[_0xcf43('0x40')](_0x3ae004[_0xcf43('0x39')][_0xcf43('0x40')]);_0x5c3bf8[_0xcf43('0x22')]=qs['offset'](_0x3ae004[_0xcf43('0x39')][_0xcf43('0x22')]);}_0x5c3bf8[_0xcf43('0x41')]=qs[_0xcf43('0x42')](_0x3ae004[_0xcf43('0x39')][_0xcf43('0x42')]);_0x5c3bf8[_0xcf43('0x43')]=qs[_0xcf43('0x3b')](_['pick'](_0x3ae004['query'],_0x5f5e35[_0xcf43('0x3b')]));var _0x1c6ad6=[];var _0x39ca91=squel[_0xcf43('0x44')]()[_0xcf43('0x45')]('id')[_0xcf43('0x45')]('name')[_0xcf43('0x45')](_0xcf43('0x46'))['from'](_0xcf43('0x47'));var _0x4e5462=squel[_0xcf43('0x44')]()[_0xcf43('0x45')](_0xcf43('0x48'))[_0xcf43('0x45')](_0xcf43('0x49'))['from']('user_has_sms_interactions','ui')[_0xcf43('0x4a')](_0xcf43('0x4b'),'u',_0xcf43('0x4c'));var _0x23d42f=squel[_0xcf43('0x44')]()['from'](_0xcf43('0x4d'),'i')[_0xcf43('0x4a')](_0xcf43('0x4e'),'c',_0xcf43('0x4f'))['left_join'](_0xcf43('0x4b'),'o',_0xcf43('0x50'))[_0xcf43('0x4a')](_0xcf43('0x51'),'a',_0xcf43('0x52'))['left_join'](_0xcf43('0x53'),'me',_0xcf43('0x54'))['left_join']('sms_interaction_has_tags','it',_0xcf43('0x55'))[_0xcf43('0x4a')](_0xcf43('0x47'),'t',_0xcf43('0x56'));var _0x50fdcd=squel[_0xcf43('0x57')]();var _0x2b0a9d=[];var _0x3e1d1b=squel[_0xcf43('0x57')]();var _0x26b2f3;if(_0x3ae004['query'][_0xcf43('0x58')]){_0x26b2f3=as[_0xcf43('0x59')](_0x3ae004[_0xcf43('0x39')][_0xcf43('0x58')]);var _0x58099=_0x26b2f3[_0xcf43('0x5a')];for(var _0x262e6f=0x0;_0x262e6f<_0x26b2f3[_0xcf43('0x5b')][_0xcf43('0x5c')];_0x262e6f++){var _0x33d7af=_0x26b2f3[_0xcf43('0x5b')][_0x262e6f];var _0x1ba918='i';var _0x5492c9=_[_0xcf43('0x5d')](_0x392390,[_0xcf43('0x2b'),_0x33d7af[_0xcf43('0x45')]]);if(!_0x5492c9){switch(_0x33d7af[_0xcf43('0x45')]){case'unreadMessages':if(_0x33d7af[_0xcf43('0x5e')]==0x1){_0x23d42f[_0xcf43('0x5f')]('`'+_0x33d7af[_0xcf43('0x45')]+_0xcf43('0x60'));}else{_0x23d42f[_0xcf43('0x5f')]('`'+_0x33d7af[_0xcf43('0x45')]+'`\x20>\x200');}break;case _0xcf43('0x61'):if(_0x33d7af[_0xcf43('0x62')]===_0xcf43('0x63')){if(_0x33d7af['value']['split']('\x20')[_0xcf43('0x5c')]>0x1){_0x50fdcd[_0x58099](_0xcf43('0x64'),qs[_0xcf43('0x65')](_0x33d7af[_0xcf43('0x5e')]),null);}else{var _0x5662a5='%'+_0x33d7af[_0xcf43('0x5e')]+'%';_0x50fdcd[_0x58099](_0xcf43('0x66'),_0x5662a5,_0x5662a5,_0x5662a5);}}else{_0x5492c9=_[_0xcf43('0x5d')](_0x392390,[_0xcf43('0x2b'),_0xcf43('0x67')]);_0x33d7af[_0xcf43('0x45')]='ContactId';_0x5dfe4b=as[_0xcf43('0x68')](_0x1ba918,_0x5492c9[_0xcf43('0x36')],_0x33d7af);_0x50fdcd[_0x58099](_0x5dfe4b[_0xcf43('0x69')],_0x5dfe4b[_0xcf43('0x5e')][_0xcf43('0x6a')],_0x5dfe4b[_0xcf43('0x5e')][_0xcf43('0x1f')]);}break;case _0xcf43('0x6b'):var _0x5f4a67=_0x33d7af[_0xcf43('0x5e')][_0xcf43('0x31')](',')[_0xcf43('0x2e')](function(_0x63232f){return Number(_0x63232f);});_0x5f4a67[_0xcf43('0x6c')](function(_0x25ff39){_0x3e1d1b['or'](_0xcf43('0x6d'),'%,'+_0x25ff39+',%');});_0x2b0a9d=_[_0xcf43('0x6e')](_0x2b0a9d,_0x5f4a67);break;case'User':if(_0x33d7af[_0xcf43('0x62')]==='$substring'){_0x50fdcd[_0x58099]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x33d7af[_0xcf43('0x5e')]+'%',null);}else{_0x5492c9=_[_0xcf43('0x5d')](_0x392390,['name',_0xcf43('0x6f')]);_0x33d7af[_0xcf43('0x45')]=_0xcf43('0x6f');_0x5dfe4b=as[_0xcf43('0x68')](_0x1ba918,_0x5492c9[_0xcf43('0x36')],_0x33d7af);_0x50fdcd[_0x58099](_0x5dfe4b[_0xcf43('0x69')],_0x5dfe4b[_0xcf43('0x5e')][_0xcf43('0x6a')],_0x5dfe4b[_0xcf43('0x5e')][_0xcf43('0x1f')]);}break;case _0xcf43('0x70'):_0x5dfe4b=as[_0xcf43('0x68')]('me',null,_0x33d7af);_0x50fdcd[_0x58099](_0x5dfe4b[_0xcf43('0x69')],_0x5dfe4b['value']['start'],_0x5dfe4b[_0xcf43('0x5e')][_0xcf43('0x1f')]);break;}}else{var _0x5dfe4b=as['buildExpression'](_0x1ba918,_0x5492c9[_0xcf43('0x36')],_0x33d7af);_0x50fdcd[_0x58099](_0x5dfe4b[_0xcf43('0x69')],_0x5dfe4b[_0xcf43('0x5e')][_0xcf43('0x6a')],_0x5dfe4b[_0xcf43('0x5e')]['end']);}}}else{var _0x19d585=_(_0x3ae004[_0xcf43('0x39')])['keys']()[_0xcf43('0x2e')](function(_0x330ee4){return _[_0xcf43('0x71')](_0x392390,[_0xcf43('0x2b'),_0x330ee4])?_0x330ee4:undefined;})[_0xcf43('0x72')]()[_0xcf43('0x5e')]();if(!_[_0xcf43('0x73')](_0x19d585)){_0x19d585[_0xcf43('0x6c')](function(_0x2bc70e){if(_0x2bc70e===_0xcf43('0x74')){_0x23d42f['where']('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x3ae004[_0xcf43('0x39')][_0x2bc70e]));}else if(_0x2bc70e===_0xcf43('0x75')){var _0x24eb2f=JSON[_0xcf43('0x76')](_0x3ae004[_0xcf43('0x39')][_0x2bc70e])['$gte'];var _0x2383e9=JSON[_0xcf43('0x76')](_0x3ae004['query'][_0x2bc70e])[_0xcf43('0x77')];_0x23d42f[_0xcf43('0x43')](_0xcf43('0x78'),_0x24eb2f,_0x2383e9);}else{if(_0x3ae004['query'][_0x2bc70e]===_0xcf43('0x79')){_0x23d42f[_0xcf43('0x43')]('i.'+_0x2bc70e+_0xcf43('0x7a'));}else{_0x23d42f['where']('i.'+_0x2bc70e+'\x20=\x20?',_0x3ae004['query'][_0x2bc70e]);}}});}if(_0x3ae004[_0xcf43('0x39')][_0xcf43('0x7b')]){if(_0x3ae004['query'][_0xcf43('0x7b')]==0x1){_0x23d42f[_0xcf43('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x23d42f[_0xcf43('0x5f')](_0xcf43('0x7c'));}}if(_0x3ae004[_0xcf43('0x39')][_0xcf43('0x7d')]){_0x2b0a9d=_[_0xcf43('0x7e')](_0x3ae004[_0xcf43('0x39')][_0xcf43('0x7d')])?_0x3ae004[_0xcf43('0x39')]['tag']:new Array(_0x3ae004['query'][_0xcf43('0x7d')]);_0x2b0a9d['forEach'](function(_0x219a2a){_0x3e1d1b['or'](_0xcf43('0x6d'),'%,'+_0x219a2a+',%');});}if(_0x3ae004[_0xcf43('0x39')][_0xcf43('0x7f')]){var _0x7f1735=_0x3ae004[_0xcf43('0x39')][_0xcf43('0x7f')][_0xcf43('0x80')]('\x5c','\x5c\x5c')[_0xcf43('0x80')]('\x27\x27',_0xcf43('0x81'));if(qs[_0xcf43('0x82')](_0x7f1735)){_0x50fdcd['or'](_0xcf43('0x83'),_0x7f1735+'%')['or'](_0xcf43('0x84'),_0x7f1735+'%');}else{_0x50fdcd['or'](_0xcf43('0x85'),qs[_0xcf43('0x65')](_0x7f1735))['or'](_0xcf43('0x86'),_0x7f1735+'%');}}}_0x23d42f[_0xcf43('0x43')](_0x50fdcd);_0x23d42f['group'](_0xcf43('0x87'));var _0xc6a349={'type':db[_0xcf43('0x88')][_0xcf43('0x89')]['SELECT'],'raw':!![]};var _0x28564f=_0x23d42f[_0xcf43('0x8a')]();_0x28564f['field'](_0xcf43('0x87'));_0x28564f['field'](_0xcf43('0x8b'),'unreadMessages');if(_0x5c3bf8[_0xcf43('0x41')]){_0x5c3bf8[_0xcf43('0x41')][_0xcf43('0x6c')](function(_0x2d551d){_0x23d42f['order']('i.'+_0x2d551d[0x0],_0x2d551d[0x1]==='DESC'?![]:!![]);});}if(!_[_0xcf43('0x73')](_0x2b0a9d)){_0x23d42f[_0xcf43('0x5f')](_0x3e1d1b);_0x28564f[_0xcf43('0x43')](_0xcf43('0x8c'),_0x2b0a9d);}BPromise[_0xcf43('0x8d')]()[_0xcf43('0x27')](function(){if(!_0x26b2f3&&_0x3ae004[_0xcf43('0x39')][_0xcf43('0x74')])return;return _0x3ae004['user'][_0xcf43('0x8e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x50b401){if(_[_0xcf43('0x73')](_0x50b401)){_0x28564f[_0xcf43('0x43')](_0xcf43('0x8f'));_0x23d42f[_0xcf43('0x43')](_0xcf43('0x8f'));}else{_0x28564f[_0xcf43('0x43')](_0xcf43('0x90'),_[_0xcf43('0x2e')](_0x50b401,'id'));_0x23d42f[_0xcf43('0x43')](_0xcf43('0x90'),_[_0xcf43('0x2e')](_0x50b401,'id'));}});})[_0xcf43('0x27')](function(){db[_0xcf43('0x91')][_0xcf43('0x39')](_0x28564f[_0xcf43('0x92')](),_0xc6a349)[_0xcf43('0x27')](function(_0x50920e){_0xfa8cc6['count']=_0x50920e['length'];if(_0xfa8cc6['count']===0x0)return[];return db['sequelize'][_0xcf43('0x39')](_0x39ca91[_0xcf43('0x92')](),_0xc6a349)[_0xcf43('0x27')](function(_0x36ef27){_0x1c6ad6=_[_0xcf43('0x93')](_0x36ef27,'id');_0xc6a349=_['merge'](_0xc6a349,{'model':db[_0xcf43('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ae004[_0xcf43('0x39')][_0xcf43('0x3e')]){_0x5c3bf8[_0xcf43('0x3d')]['forEach'](function(_0x1f63b3){_0x23d42f[_0xcf43('0x45')]('i.'+_0x1f63b3);});}else{_0x23d42f['field'](_0xcf43('0x8b'),_0xcf43('0x94'));_0x23d42f[_0xcf43('0x45')](_0xcf43('0x95'),_0xcf43('0x96'));_0x23d42f[_0xcf43('0x45')](_0xcf43('0x97'),_0xcf43('0x98'));_0x23d42f[_0xcf43('0x45')](_0xcf43('0x99'));_0x23d42f[_0xcf43('0x45')](_0xcf43('0x9a'),_0xcf43('0x9b'));_0x23d42f[_0xcf43('0x45')](_0xcf43('0x9c'),_0xcf43('0x9d'));_0x23d42f['field'](_0xcf43('0x9e'),'Contact.email');_0x23d42f[_0xcf43('0x45')](_0xcf43('0x9f'),_0xcf43('0xa0'));_0x23d42f[_0xcf43('0x45')](_0xcf43('0xa1'),_0xcf43('0xa2'));_0x23d42f[_0xcf43('0x45')](_0xcf43('0xa3'),_0xcf43('0xa4'));_0x23d42f[_0xcf43('0x45')](_0xcf43('0xa5'),'TagIds');}_0x23d42f[_0xcf43('0x40')](_0x5c3bf8['limit']);_0x23d42f['offset'](_0x5c3bf8[_0xcf43('0x22')]);return db['sequelize'][_0xcf43('0x39')](_0x23d42f[_0xcf43('0x92')](),_0xc6a349);})[_0xcf43('0x27')](function(_0x31a334){_0x4e5462['where'](_0xcf43('0xa6'),_[_0xcf43('0x2e')](_0x31a334,'id'));return db[_0xcf43('0x91')][_0xcf43('0x39')](_0x4e5462[_0xcf43('0x92')](),_0xc6a349)[_0xcf43('0x27')](function(_0x21b6ea){var _0x1923c1=_[_0xcf43('0xa7')](_0x21b6ea,'SmsInteractionId');var _0x1232ab=[];_0x31a334[_0xcf43('0x6c')](function(_0x7ac027){_0x1232ab[_0xcf43('0x32')](updateSmsInteraction(_0x7ac027,_0x1c6ad6,_0x1923c1));});return BPromise[_0xcf43('0xa8')](_0x1232ab);});});})[_0xcf43('0x27')](function(_0x7e52c){_0xfa8cc6[_0xcf43('0xa9')]=_0x7e52c;return _0xfa8cc6;})[_0xcf43('0x27')](respondWithFilteredResult(_0xae3f66,_0x5c3bf8));})[_0xcf43('0x33')](handleError(_0xae3f66,null));};exports[_0xcf43('0xaa')]=function(_0x1fb3ec,_0x394df9){var _0x295135={'raw':![],'where':{'id':_0x1fb3ec[_0xcf43('0xab')]['id']}},_0x7c6be4={};_0x7c6be4['model']=_['keys'](db[_0xcf43('0x35')][_0xcf43('0xac')]);_0x7c6be4[_0xcf43('0x39')]=_[_0xcf43('0x3a')](_0x1fb3ec[_0xcf43('0x39')]);_0x7c6be4[_0xcf43('0x3b')]=_[_0xcf43('0x3c')](_0x7c6be4[_0xcf43('0x38')],_0x7c6be4['query']);_0x295135[_0xcf43('0x3d')]=_[_0xcf43('0x3c')](_0x7c6be4[_0xcf43('0x38')],qs[_0xcf43('0x3e')](_0x1fb3ec[_0xcf43('0x39')][_0xcf43('0x3e')]));_0x295135[_0xcf43('0x3d')]=_0x295135['attributes'][_0xcf43('0x5c')]?_0x295135['attributes']:_0x7c6be4['model'];if(_0x1fb3ec['query'][_0xcf43('0xad')]){_0x295135[_0xcf43('0xae')]=[{'all':!![]}];}_0x295135=_['merge']({},_0x295135,_0x1fb3ec[_0xcf43('0xaf')]);return db[_0xcf43('0x35')][_0xcf43('0x5d')](_0x295135)[_0xcf43('0x27')](handleEntityNotFound(_0x394df9,null))[_0xcf43('0x27')](respondWithResult(_0x394df9,null))[_0xcf43('0x33')](handleError(_0x394df9,null));};exports[_0xcf43('0xb0')]=function(_0x1c4ed9,_0x59bfe8){return db[_0xcf43('0x35')][_0xcf43('0xb0')](_0x1c4ed9['body'],{})[_0xcf43('0x27')](respondWithResult(_0x59bfe8,0xc9))[_0xcf43('0x33')](handleError(_0x59bfe8,null));};exports[_0xcf43('0x26')]=function(_0x1fef2e,_0x5693e8){if(_0x1fef2e['body']['id']){delete _0x1fef2e[_0xcf43('0x70')]['id'];}return db[_0xcf43('0x35')][_0xcf43('0x5d')]({'where':{'id':_0x1fef2e['params']['id']}})[_0xcf43('0x27')](handleEntityNotFound(_0x5693e8,null))['then'](saveUpdates(_0x1fef2e[_0xcf43('0x70')],null))[_0xcf43('0x27')](respondWithResult(_0x5693e8,null))[_0xcf43('0x33')](handleError(_0x5693e8,null));};exports[_0xcf43('0x28')]=function(_0x1c7471,_0x10632c){return db['SmsInteraction'][_0xcf43('0x5d')]({'where':{'id':_0x1c7471[_0xcf43('0xab')]['id']}})[_0xcf43('0x27')](handleEntityNotFound(_0x10632c,null))['then'](removeEntity(_0x10632c,null))[_0xcf43('0x33')](handleError(_0x10632c,null));};exports['describe']=function(_0x31f573,_0x24adac){return db[_0xcf43('0x35')]['describe']()[_0xcf43('0x27')](respondWithResult(_0x24adac,null))[_0xcf43('0x33')](handleError(_0x24adac,null));};exports['addMessage']=function(_0xfe1b7b,_0x2ee48a,_0x124b6f){return db[_0xcf43('0xb1')][_0xcf43('0x5d')]({'where':{'id':_0xfe1b7b[_0xcf43('0xab')]['id']}})[_0xcf43('0x27')](handleEntityNotFound(_0x2ee48a,null))[_0xcf43('0x27')](function(_0x4e786e){if(_0x4e786e){return _0x4e786e[_0xcf43('0xb2')](_0xfe1b7b[_0xcf43('0x70')][_0xcf43('0xb3')],_[_0xcf43('0xb4')](_0xfe1b7b['body'],['ids','id'])||{});}})[_0xcf43('0x27')](respondWithResult(_0x2ee48a,null))[_0xcf43('0x33')](handleError(_0x2ee48a,null));};exports[_0xcf43('0xb5')]=function(_0x448a9a,_0x1ee419,_0x61fa92){var _0x432e24={'raw':![],'where':{}};var _0x5dbad2={};var _0x4d2d7f={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xcf43('0xb6')]({'where':{'id':_0x448a9a['params']['id']}})[_0xcf43('0x27')](handleEntityNotFound(_0x1ee419,null))[_0xcf43('0x27')](function(_0x21be13){if(_0x21be13){_0x5dbad2[_0xcf43('0x38')]=_['keys'](db[_0xcf43('0xb1')][_0xcf43('0xac')]);_0x5dbad2[_0xcf43('0x39')]=_['keys'](_0x448a9a['query']);_0x5dbad2[_0xcf43('0x3b')]=_[_0xcf43('0x3c')](_0x5dbad2['model'],_0x5dbad2[_0xcf43('0x39')]);_0x432e24[_0xcf43('0x3d')]=_[_0xcf43('0x3c')](_0x5dbad2[_0xcf43('0x38')],qs[_0xcf43('0x3e')](_0x448a9a[_0xcf43('0x39')]['fields']));_0x432e24[_0xcf43('0x3d')]=_0x432e24[_0xcf43('0x3d')][_0xcf43('0x5c')]?_0x432e24[_0xcf43('0x3d')]:_0x5dbad2[_0xcf43('0x38')];if(!_0x448a9a['query'][_0xcf43('0xb7')](_0xcf43('0x3f'))){_0x432e24[_0xcf43('0x40')]=qs[_0xcf43('0x40')](_0x448a9a['query'][_0xcf43('0x40')]);_0x432e24[_0xcf43('0x22')]=qs[_0xcf43('0x22')](_0x448a9a[_0xcf43('0x39')][_0xcf43('0x22')]);}_0x432e24[_0xcf43('0x41')]=qs[_0xcf43('0x42')](_0x448a9a[_0xcf43('0x39')][_0xcf43('0x42')]);_0x432e24[_0xcf43('0x43')]=qs[_0xcf43('0x3b')](_[_0xcf43('0xb8')](_0x448a9a[_0xcf43('0x39')],_0x5dbad2['filters']));_0x432e24[_0xcf43('0x43')][_0xcf43('0xb9')]=_0x21be13['id'];if(_0x448a9a[_0xcf43('0x39')]['filter']){_0x432e24[_0xcf43('0x43')]=_[_0xcf43('0xba')](_0x432e24[_0xcf43('0x43')],{'$or':_['map'](_0x432e24[_0xcf43('0x3d')],function(_0x135b07){var _0x3d95fc={};_0x3d95fc[_0x135b07]={'$like':'%'+_0x448a9a[_0xcf43('0x39')][_0xcf43('0x7f')]+'%'};return _0x3d95fc;})});}if(_0x448a9a[_0xcf43('0x39')][_0xcf43('0xbb')]){var _0x10ebb9=_0x448a9a[_0xcf43('0x39')]['$gte'][_0xcf43('0x31')](',');var _0x276c0c={};_0x276c0c[_0x10ebb9[0x0]]={'$gte':moment(_0x10ebb9[0x1])[_0xcf43('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x432e24['where']=_[_0xcf43('0xba')](_0x432e24[_0xcf43('0x43')],_0x276c0c);}_0x432e24=_[_0xcf43('0xba')]({},_0x432e24,_0x448a9a[_0xcf43('0xaf')]);return db[_0xcf43('0xb1')][_0xcf43('0x21')]({'where':_0x432e24[_0xcf43('0x43')]})['then'](function(_0x16f5ab){_0x4d2d7f['count']=_0x16f5ab;if(_0x448a9a['query']['includeAll']){_0x432e24[_0xcf43('0xae')]=[{'all':!![]}];}return db[_0xcf43('0xb1')][_0xcf43('0xbd')](_0x432e24);})[_0xcf43('0x27')](function(_0x1a4a03){_0x4d2d7f[_0xcf43('0xa9')]=_0x1a4a03;return _0x4d2d7f;});}})[_0xcf43('0x27')](respondWithFilteredResult(_0x1ee419,_0x432e24))[_0xcf43('0x33')](handleError(_0x1ee419,null));};exports[_0xcf43('0xbe')]=function(_0x18c5a6,_0x3b5ff9,_0x21b0ea){return db[_0xcf43('0x35')][_0xcf43('0x5d')]({'where':{'id':_0x18c5a6[_0xcf43('0xab')]['id']}})[_0xcf43('0x27')](handleEntityNotFound(_0x3b5ff9,null))[_0xcf43('0x27')](function(_0x57e37a){if(_0x57e37a){return _0x57e37a[_0xcf43('0xbf')](_0x18c5a6[_0xcf43('0x70')][_0xcf43('0xb3')],_[_0xcf43('0xb4')](_0x18c5a6[_0xcf43('0x70')],[_0xcf43('0xb3'),'id'])||{})['spread'](function(){return db['Tag'][_0xcf43('0xbd')]({'attributes':['id','name',_0xcf43('0x46')],'where':{'id':_0x18c5a6[_0xcf43('0x70')]['ids']}});})[_0xcf43('0x27')](function(_0x31e0e8){socket[_0xcf43('0xc0')](_0xcf43('0xc1'),{'id':Number(_0x18c5a6[_0xcf43('0xab')]['id']),'tags':_0x31e0e8||[]});return{'id':Number(_0x18c5a6[_0xcf43('0xab')]['id']),'tags':_0x31e0e8||[]};});}})[_0xcf43('0x27')](respondWithResult(_0x3b5ff9,null))['catch'](handleError(_0x3b5ff9,null));};exports[_0xcf43('0xc2')]=function(_0x5ea4b5,_0xdaffd7,_0x2c15cc){return db[_0xcf43('0x35')][_0xcf43('0x5d')]({'where':{'id':_0x5ea4b5[_0xcf43('0xab')]['id']}})[_0xcf43('0x27')](handleEntityNotFound(_0xdaffd7,null))['then'](function(_0x302fbc){if(_0x302fbc){return _0x302fbc['removeTags'](_0x5ea4b5['query']['ids']);}})[_0xcf43('0x27')](respondWithStatusCode(_0xdaffd7,null))[_0xcf43('0x33')](handleError(_0xdaffd7,null));};exports[_0xcf43('0xc3')]=function(_0x2d6678,_0x1fefb9){var _0x404d7c=moment()[_0xcf43('0xc4')]()[_0xcf43('0x92')]();var _0x314ccf=path['join'](config[_0xcf43('0xc5')],_0xcf43('0xc6'),_0xcf43('0xc7'),_0xcf43('0xc8'));var _0x7d690b=path['join'](config[_0xcf43('0xc5')],_0xcf43('0xc6'),_0xcf43('0xc7'),_0xcf43('0xc9'));var _0x448dbb=path[_0xcf43('0xca')](_0x314ccf,_0x404d7c);var _0x49f87a=util[_0xcf43('0xbc')](_0xcf43('0xcb'),_0x2d6678[_0xcf43('0xab')]['id'],_0x404d7c);var _0x3d04ab=path['join'](_0x314ccf,_0x49f87a);var _0x4502f4=![];return db[_0xcf43('0x35')]['find']({'where':{'id':_0x2d6678[_0xcf43('0xab')]['id']},'include':[{'model':db[_0xcf43('0xb1')],'as':_0xcf43('0xcc'),'attributes':['id',_0xcf43('0x70'),_0xcf43('0x75'),_0xcf43('0xcd'),_0xcf43('0xce'),_0xcf43('0x7b')],'include':[{'model':db[_0xcf43('0xcf')],'as':_0xcf43('0xcf'),'attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':'Contact','attributes':['id',_0xcf43('0xd0'),_0xcf43('0xd1')],'raw':!![]}]},{'model':db[_0xcf43('0xd2')],'as':_0xcf43('0xd3'),'attributes':['id',_0xcf43('0x2b')]},{'model':db[_0xcf43('0xcf')],'as':_0xcf43('0xd4'),'attributes':['id','fullname']}]})[_0xcf43('0x27')](handleEntityNotFound(_0x1fefb9,null))[_0xcf43('0x27')](function(_0x22c1c4){if(_0x22c1c4){var _0x1f35d2=_0x22c1c4[_0xcf43('0xd5')]({'plain':!![]});_0x4502f4=!![];var _0x813bbf={'format':'A4','border':'10px','header':{'height':_0xcf43('0xd6'),'contents':{'first':_0xcf43('0xd7')}},'footer':{'height':_0xcf43('0xd8'),'contents':{'default':util[_0xcf43('0xbc')](_0xcf43('0xd9'),util[_0xcf43('0xbc')](_0xcf43('0xda'),_0xcf43('0xdb'),_0x1f35d2['id']),moment()['format'](_0xcf43('0xdc'))['toString']())}}};fs['mkdirSync'](_0x448dbb);var _0x42fdae={'channel':_0xcf43('0xdb'),'account':_0x1f35d2[_0xcf43('0xd3')]['name'],'agent':_0x1f35d2[_0xcf43('0xd4')]?_0x1f35d2[_0xcf43('0xd4')][_0xcf43('0xdd')]:_0xcf43('0xde'),'createdAt':moment(_0x1f35d2[_0xcf43('0x75')])[_0xcf43('0xbc')](_0xcf43('0xdf'))[_0xcf43('0x92')](),'closedAt':_0x1f35d2[_0xcf43('0xe0')]?moment(_0x1f35d2['closedAt'])[_0xcf43('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcf43('0x92')]():'','disposition':_0x1f35d2[_0xcf43('0xe1')],'messages':_(_0x1f35d2['Messages'])[_0xcf43('0x7f')]({'secret':![]})[_0xcf43('0x2e')](function(_0x3a3569){return{'date':moment(_0x3a3569[_0xcf43('0x75')])['format'](_0xcf43('0xdf'))[_0xcf43('0x92')](),'sender':_0x3a3569[_0xcf43('0xcd')]==='out'?_0x3a3569[_0xcf43('0xcf')]?_0x3a3569['User']['fullname']:'System':_0x3a3569[_0xcf43('0x61')][_0xcf43('0xd0')]+(_0x3a3569['Contact']['lastName']?'\x20'+_0x3a3569[_0xcf43('0x61')][_0xcf43('0xd1')]:''),'body':_0x3a3569[_0xcf43('0x70')],'direction':_0x3a3569[_0xcf43('0xcd')]===_0xcf43('0xe2')?'A':'C','secret':_0x3a3569['secret'],'read':_0x3a3569[_0xcf43('0x7b')]};})[_0xcf43('0x5e')]()};return ejs['renderFile'](path[_0xcf43('0xca')](config[_0xcf43('0xc5')],_0xcf43('0xc6'),_0xcf43('0xe3'),_0xcf43('0xe4')),{'interaction':_0x42fdae})[_0xcf43('0x27')](function(_0x4acba5){return new BPromise(function(_0x395bad,_0x1eb384){pdf[_0xcf43('0xb0')](_0x4acba5,_0x813bbf)['toFile'](path[_0xcf43('0xca')](_0x448dbb,_0xcf43('0xe5')+_0x1f35d2['id']+'-'+_0x404d7c+'.pdf'),function(_0x19a599,_0x4b6ffc){if(_0x19a599)return _0x1eb384(_0x19a599);_0x395bad(_0x4b6ffc);});});});}})[_0xcf43('0x27')](function(){if(_0x4502f4){return new BPromise(function(_0x4eb7a0,_0x3960e9){zipdir(_0x448dbb,{'saveTo':_0x3d04ab},function(_0x4d65f8,_0x5dba97){if(_0x4d65f8)return _0x3960e9(_0x4d65f8);return _0x4eb7a0(_0x5dba97);});})[_0xcf43('0x27')](function(){return new BPromise(function(_0x3a8772,_0x54aa4f){rimraf(_0x448dbb,function(_0x3f34da){if(_0x3f34da)_0x54aa4f(_0x3f34da);return _0x3a8772();});});})[_0xcf43('0x27')](function(){return _0x1fefb9['download'](_0x3d04ab,_0x49f87a,function(_0x1ec4fb){if(_0x1ec4fb){console[_0xcf43('0xe6')]('err',_0x1ec4fb);}else{fs[_0xcf43('0xe7')](_0x3d04ab);}});});}else{return _0x1fefb9[_0xcf43('0x1d')](0xc8);}})[_0xcf43('0x33')](handleError(_0x1fefb9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index da16c26..e0bfe2e 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99c9=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove'];(function(_0x476b04,_0x49e9ea){var _0x3c993e=function(_0x375500){while(--_0x375500){_0x476b04['push'](_0x476b04['shift']());}};_0x3c993e(++_0x49e9ea);}(_0x99c9,0x13c));var _0x999c=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x99c9[_0x42bdad];return _0x122626;};'use strict';var EventEmitter=require(_0x999c('0x0'));var SmsInteraction=require(_0x999c('0x1'))['db'][_0x999c('0x2')];var SmsMessage=require(_0x999c('0x1'))['db'][_0x999c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x999c('0x4')](0x0);var events={'afterCreate':_0x999c('0x5'),'afterUpdate':'update','afterDestroy':_0x999c('0x6')};function emitEvent(_0x140cd5){return function(_0x2d4f2d,_0x347ee0,_0x2bdd73){_0x2d4f2d[_0x999c('0x7')]({'attributes':['id'],'raw':!![]})[_0x999c('0x8')](function(_0x651b7e){_0x2d4f2d[_0x999c('0x9')](_0x999c('0xa'),_0x651b7e[_0x999c('0xb')](function(_0x3c58ba){return{'id':_0x3c58ba['id']};}));return SmsMessage[_0x999c('0xc')]({'where':{'SmsInteractionId':_0x2d4f2d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x999c('0x8')](function(_0x4dd585){_0x2d4f2d[_0x999c('0x9')](_0x999c('0xd'),_0x4dd585['length']);SmsInteractionEvents[_0x999c('0xe')](_0x140cd5+':'+_0x2d4f2d['id'],_0x2d4f2d);SmsInteractionEvents[_0x999c('0xe')](_0x140cd5,_0x2d4f2d);_0x2bdd73(null);})[_0x999c('0xf')](_0x2bdd73(null));};}for(var e in events){if(events[_0x999c('0x10')](e)){var event=events[e];SmsInteraction[_0x999c('0x11')](e,emitEvent(event));}}module[_0x999c('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x4300=['update','remove','getUsers','setDataValue','Users','map','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4300,0x1a6));var _0x0430=function(_0x758790,_0x3fa355){_0x758790=_0x758790-0x0;var _0x4e58f5=_0x4300[_0x758790];return _0x4e58f5;};'use strict';var EventEmitter=require(_0x0430('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0430('0x1')](0x0);var events={'afterCreate':_0x0430('0x2'),'afterUpdate':_0x0430('0x3'),'afterDestroy':_0x0430('0x4')};function emitEvent(_0x1735aa){return function(_0x5d0aac,_0x46b412,_0x5943c0){_0x5d0aac[_0x0430('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2388b9){_0x5d0aac[_0x0430('0x6')](_0x0430('0x7'),_0x2388b9[_0x0430('0x8')](function(_0x1e8d93){return{'id':_0x1e8d93['id']};}));return SmsMessage[_0x0430('0x9')]({'where':{'SmsInteractionId':_0x5d0aac['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0430('0xa')](function(_0x3af75c){_0x5d0aac[_0x0430('0x6')]('unreadMessages',_0x3af75c[_0x0430('0xb')]);SmsInteractionEvents[_0x0430('0xc')](_0x1735aa+':'+_0x5d0aac['id'],_0x5d0aac);SmsInteractionEvents[_0x0430('0xc')](_0x1735aa,_0x5d0aac);_0x5943c0(null);})[_0x0430('0xd')](_0x5943c0(null));};}for(var e in events){if(events[_0x0430('0xe')](e)){var event=events[e];SmsInteraction[_0x0430('0xf')](e,emitEvent(event));}}module[_0x0430('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 407c21e..81c710f 100644 --- a/server/api/smsInteraction/smsInteraction.model.js +++ b/server/api/smsInteraction/smsInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0ab=['sms_interactions','changed','util','api','request-promise','path','rimraf','../../config/environment','exports','define','SmsInteraction'];(function(_0x772feb,_0x6ab709){var _0x457d03=function(_0x496275){while(--_0x496275){_0x772feb['push'](_0x772feb['shift']());}};_0x457d03(++_0x6ab709);}(_0xc0ab,0x1db));var _0xbc0a=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0xc0ab[_0x5e77db];return _0x34b675;};'use strict';var _=require('lodash');var util=require(_0xbc0a('0x0'));var logger=require('../../config/logger')(_0xbc0a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbc0a('0x2'));var fs=require('fs');var path=require(_0xbc0a('0x3'));var rimraf=require(_0xbc0a('0x4'));var config=require(_0xbc0a('0x5'));var attributes=require('./smsInteraction.attributes');module[_0xbc0a('0x6')]=function(_0x5a38a5,_0x23b3c7){return _0x5a38a5[_0xbc0a('0x7')](_0xbc0a('0x8'),attributes,{'tableName':_0xbc0a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x306761,_0x35bdeb,_0x494d5b){if(_0x306761[_0xbc0a('0xa')]('closed')){_0x306761['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x494d5b(null,_0x306761);}}});}; \ No newline at end of file +var _0x55ae=['./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0xb11bf1,_0x41cabc){var _0x31a74c=function(_0x30099f){while(--_0x30099f){_0xb11bf1['push'](_0xb11bf1['shift']());}};_0x31a74c(++_0x41cabc);}(_0x55ae,0x1d6));var _0xe55a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55ae[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe55a('0x0'));var util=require('util');var logger=require(_0xe55a('0x1'))('api');var moment=require(_0xe55a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe55a('0x3'));var rimraf=require(_0xe55a('0x4'));var config=require(_0xe55a('0x5'));var attributes=require(_0xe55a('0x6'));module[_0xe55a('0x7')]=function(_0x4938c8,_0x5ecfad){return _0x4938c8['define'](_0xe55a('0x8'),attributes,{'tableName':_0xe55a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x278707,_0x283ef0,_0x345cbb){if(_0x278707[_0xe55a('0xa')](_0xe55a('0xb'))){_0x278707[_0xe55a('0xc')]=moment()['format'](_0xe55a('0xd'));}_0x345cbb(null,_0x278707);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2b251d3..f679498 100644 --- a/server/api/smsInteraction/smsInteraction.rpc.js +++ b/server/api/smsInteraction/smsInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x942c=['./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0x942c,0xcb));var _0xc942=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x942c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc942('0x0'));var moment=require('moment');var BPromise=require(_0xc942('0x1'));var rs=require(_0xc942('0x2'));var fs=require('fs');var Redis=require(_0xc942('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc942('0x4'));var logger=require(_0xc942('0x5'))(_0xc942('0x6'));var config=require(_0xc942('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc942('0x8')][_0xc942('0x9')]({'port':0x232a});config[_0xc942('0xa')]=_['defaults'](config[_0xc942('0xa')],{'host':_0xc942('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc942('0xa')]));require(_0xc942('0xc'))[_0xc942('0xd')](socket);function respondWithRpcPromise(_0x2ce49b,_0x1dd9fa,_0xa02470){return new BPromise(function(_0x3a574c,_0x459bac){return client[_0xc942('0xe')](_0x2ce49b,_0xa02470)['then'](function(_0x5adfbf){logger[_0xc942('0xf')](_0xc942('0x10'),_0x1dd9fa,'request\x20sent');logger[_0xc942('0x11')](_0xc942('0x12'),_0x1dd9fa,_0xc942('0x13'),JSON[_0xc942('0x14')](_0x5adfbf));if(_0x5adfbf[_0xc942('0x15')]){if(_0x5adfbf[_0xc942('0x15')][_0xc942('0x16')]===0x1f4){logger[_0xc942('0x15')](_0xc942('0x10'),_0x1dd9fa,_0x5adfbf[_0xc942('0x15')][_0xc942('0x17')]);return _0x459bac(_0x5adfbf[_0xc942('0x15')]['message']);}logger[_0xc942('0x15')](_0xc942('0x10'),_0x1dd9fa,_0x5adfbf['error'][_0xc942('0x17')]);return _0x3a574c(_0x5adfbf['error'][_0xc942('0x17')]);}else{logger['info'](_0xc942('0x10'),_0x1dd9fa,_0xc942('0x13'));_0x3a574c(_0x5adfbf[_0xc942('0x18')][_0xc942('0x17')]);}})[_0xc942('0x19')](function(_0x387dcf){logger[_0xc942('0x15')](_0xc942('0x10'),_0x1dd9fa,_0x387dcf);_0x459bac(_0x387dcf);});});}exports[_0xc942('0x1a')]=function(_0x140e23){var _0x283c56=this;return new Promise(function(_0x350269,_0x55ebb3){return db[_0xc942('0x1b')][_0xc942('0x1c')](_0x140e23[_0xc942('0x1d')],{'raw':_0x140e23[_0xc942('0x1e')]?_0x140e23[_0xc942('0x1e')][_0xc942('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x140e23['options']?_0x140e23[_0xc942('0x1e')][_0xc942('0x20')]||null:null,'attributes':_0x140e23['options']?_0x140e23['options'][_0xc942('0x21')]||null:null,'limit':_0x140e23[_0xc942('0x1e')]?_0x140e23[_0xc942('0x1e')][_0xc942('0x22')]||null:null})[_0xc942('0x23')](function(_0x257d67){logger[_0xc942('0xf')](_0xc942('0x1a'),_0x140e23);logger[_0xc942('0x11')](_0xc942('0x1a'),_0x140e23,JSON[_0xc942('0x14')](_0x257d67));_0x350269(_0x257d67);})[_0xc942('0x19')](function(_0x4d102d){logger[_0xc942('0x15')](_0xc942('0x1a'),_0x4d102d[_0xc942('0x17')],_0x140e23);_0x55ebb3(_0x283c56[_0xc942('0x15')](0x1f4,_0x4d102d[_0xc942('0x17')]));});});};exports[_0xc942('0x24')]=function(_0x593b4c){return new Promise(function(_0x29bdac,_0x5e0cb5){return db[_0xc942('0x1b')][_0xc942('0x25')]({'where':_0x593b4c['options']?_0x593b4c[_0xc942('0x1e')][_0xc942('0x20')]||null:null})['then'](function(_0x48aab){if(_0x48aab){return _0x48aab[_0xc942('0x26')](_0x593b4c[_0xc942('0x1d')][_0xc942('0x27')],_[_0xc942('0x28')](_0x593b4c['body'],[_0xc942('0x27'),'id'])||{});}})[_0xc942('0x29')](function(_0x249208){logger[_0xc942('0xf')]('AddTags',_0x593b4c);logger[_0xc942('0x11')](_0xc942('0x2a'),_0x593b4c,JSON['stringify'](_0x249208));_0x29bdac(_0x249208);})[_0xc942('0x19')](function(_0x53da33){logger['error'](_0xc942('0x2a'),_0x53da33['message'],_0x593b4c);_0x5e0cb5(_this[_0xc942('0x15')](0x1f4,_0x53da33[_0xc942('0x17')]));});});}; \ No newline at end of file +var _0x04b6=['ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','AddTagsToSmsInteraction','find','addTags'];(function(_0x316bf2,_0x2aaddd){var _0xd7336=function(_0x465dc6){while(--_0x465dc6){_0x316bf2['push'](_0x316bf2['shift']());}};_0xd7336(++_0x2aaddd);}(_0x04b6,0x15a));var _0x604b=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0x04b6[_0x51bb38];return _0x51c09b;};'use strict';var _=require('lodash');var util=require(_0x604b('0x0'));var moment=require(_0x604b('0x1'));var BPromise=require(_0x604b('0x2'));var rs=require(_0x604b('0x3'));var fs=require('fs');var Redis=require(_0x604b('0x4'));var db=require(_0x604b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x604b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x604b('0x7')][_0x604b('0x8')]({'port':0x232a});config['redis']=_[_0x604b('0x9')](config['redis'],{'host':_0x604b('0xa'),'port':0x18eb});var socket=require(_0x604b('0xb'))(new Redis(config['redis']));require(_0x604b('0xc'))[_0x604b('0xd')](socket);function respondWithRpcPromise(_0x8bce49,_0x2d28af,_0xf0ba31){return new BPromise(function(_0x549e93,_0x3293ad){return client['request'](_0x8bce49,_0xf0ba31)[_0x604b('0xe')](function(_0x33105d){logger[_0x604b('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x2d28af,_0x604b('0x10'));logger[_0x604b('0x11')](_0x604b('0x12'),_0x2d28af,_0x604b('0x10'),JSON[_0x604b('0x13')](_0x33105d));if(_0x33105d[_0x604b('0x14')]){if(_0x33105d[_0x604b('0x14')]['code']===0x1f4){logger[_0x604b('0x14')](_0x604b('0x15'),_0x2d28af,_0x33105d[_0x604b('0x14')][_0x604b('0x16')]);return _0x3293ad(_0x33105d[_0x604b('0x14')][_0x604b('0x16')]);}logger[_0x604b('0x14')](_0x604b('0x15'),_0x2d28af,_0x33105d[_0x604b('0x14')]['message']);return _0x549e93(_0x33105d[_0x604b('0x14')][_0x604b('0x16')]);}else{logger[_0x604b('0xf')](_0x604b('0x15'),_0x2d28af,_0x604b('0x10'));_0x549e93(_0x33105d[_0x604b('0x17')][_0x604b('0x16')]);}})[_0x604b('0x18')](function(_0x460efb){logger[_0x604b('0x14')](_0x604b('0x15'),_0x2d28af,_0x460efb);_0x3293ad(_0x460efb);});});}exports[_0x604b('0x19')]=function(_0x4edf3c){var _0x589dcf=this;return new Promise(function(_0x4d128a,_0x3919db){return db[_0x604b('0x1a')]['update'](_0x4edf3c[_0x604b('0x1b')],{'raw':_0x4edf3c[_0x604b('0x1c')]?_0x4edf3c['options'][_0x604b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4edf3c[_0x604b('0x1c')]?_0x4edf3c[_0x604b('0x1c')][_0x604b('0x1e')]||null:null,'attributes':_0x4edf3c['options']?_0x4edf3c[_0x604b('0x1c')]['attributes']||null:null,'limit':_0x4edf3c['options']?_0x4edf3c[_0x604b('0x1c')]['limit']||null:null})['then'](function(_0x126782){logger[_0x604b('0xf')](_0x604b('0x19'),_0x4edf3c);logger[_0x604b('0x11')](_0x604b('0x19'),_0x4edf3c,JSON[_0x604b('0x13')](_0x126782));_0x4d128a(_0x126782);})[_0x604b('0x18')](function(_0x23f703){logger[_0x604b('0x14')](_0x604b('0x19'),_0x23f703[_0x604b('0x16')],_0x4edf3c);_0x3919db(_0x589dcf[_0x604b('0x14')](0x1f4,_0x23f703['message']));});});};exports[_0x604b('0x1f')]=function(_0x1cc531){return new Promise(function(_0x556acc,_0x56fe6b){return db[_0x604b('0x1a')][_0x604b('0x20')]({'where':_0x1cc531['options']?_0x1cc531[_0x604b('0x1c')]['where']||null:null})[_0x604b('0xe')](function(_0x36d7fc){if(_0x36d7fc){return _0x36d7fc[_0x604b('0x21')](_0x1cc531[_0x604b('0x1b')][_0x604b('0x22')],_[_0x604b('0x23')](_0x1cc531['body'],[_0x604b('0x22'),'id'])||{});}})[_0x604b('0x24')](function(_0x425ee9){logger[_0x604b('0xf')]('AddTags',_0x1cc531);logger['debug']('AddTags',_0x1cc531,JSON[_0x604b('0x13')](_0x425ee9));_0x556acc(_0x425ee9);})[_0x604b('0x18')](function(_0x29885b){logger[_0x604b('0x14')](_0x604b('0x25'),_0x29885b[_0x604b('0x16')],_0x1cc531);_0x56fe6b(_this[_0x604b('0x14')](0x1f4,_0x29885b[_0x604b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 7ce4497..472b4e8 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x1c245b,_0x1c60b1){var _0x3b86ad=function(_0x59666f){while(--_0x59666f){_0x1c245b['push'](_0x1c245b['shift']());}};_0x3b86ad(++_0x1c60b1);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}}; \ No newline at end of file +var _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0x1228b8,_0x1816fa){var _0x2438bd=function(_0x5272ae){while(--_0x5272ae){_0x1228b8['push'](_0x1228b8['shift']());}};_0x2438bd(++_0x1816fa);}(_0x757a,0xde));var _0xa757=function(_0x1b1c16,_0x26c83e){_0x1b1c16=_0x1b1c16-0x0;var _0x441b7a=_0x757a[_0x1b1c16];return _0x441b7a;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 0883f27..f3e5b9f 100644 --- a/server/api/smsMessage/index.js +++ b/server/api/smsMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0db0=['post','tracked','sms','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x500b8d,_0x5c1b71){var _0x294fce=function(_0x2add1f){while(--_0x2add1f){_0x500b8d['push'](_0x500b8d['shift']());}};_0x294fce(++_0x5c1b71);}(_0x0db0,0x19c));var _0x00db=function(_0x4360c4,_0x2f8209){_0x4360c4=_0x4360c4-0x0;var _0x3168c8=_0x0db0[_0x4360c4];return _0x3168c8;};'use strict';var multer=require(_0x00db('0x0'));var util=require('util');var path=require(_0x00db('0x1'));var timeout=require(_0x00db('0x2'));var express=require(_0x00db('0x3'));var router=express[_0x00db('0x4')]();var auth=require(_0x00db('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x00db('0x6'));var controller=require(_0x00db('0x7'));router[_0x00db('0x8')]('/',auth[_0x00db('0x9')](),controller['index']);router[_0x00db('0x8')](_0x00db('0xa'),auth[_0x00db('0x9')](),controller[_0x00db('0xb')]);router[_0x00db('0x8')](_0x00db('0xc'),auth[_0x00db('0x9')](),controller['show']);router[_0x00db('0xd')]('/',auth[_0x00db('0x9')](),interaction[_0x00db('0xe')](_0x00db('0xf'),'smsmessage:create'),controller['create']);router[_0x00db('0xd')]('/:id/status',controller[_0x00db('0x10')]);router[_0x00db('0x11')](_0x00db('0xc'),auth['isAuthenticated'](),controller[_0x00db('0x12')]);router[_0x00db('0x11')](_0x00db('0x13'),auth['isAuthenticated'](),controller[_0x00db('0x14')]);router['put'](_0x00db('0x15'),auth[_0x00db('0x9')](),controller[_0x00db('0x16')]);router[_0x00db('0x17')](_0x00db('0xc'),auth[_0x00db('0x9')](),controller[_0x00db('0x18')]);module['exports']=router; \ No newline at end of file +var _0x5c9a=['status','update','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','sms','smsmessage:create','create','post','/:id/status'];(function(_0x48ccf2,_0x54b755){var _0x89da2=function(_0x5b073e){while(--_0x5b073e){_0x48ccf2['push'](_0x48ccf2['shift']());}};_0x89da2(++_0x54b755);}(_0x5c9a,0x183));var _0xa5c9=function(_0x2fad8a,_0x26de69){_0x2fad8a=_0x2fad8a-0x0;var _0x494d7d=_0x5c9a[_0x2fad8a];return _0x494d7d;};'use strict';var multer=require(_0xa5c9('0x0'));var util=require(_0xa5c9('0x1'));var path=require(_0xa5c9('0x2'));var timeout=require(_0xa5c9('0x3'));var express=require(_0xa5c9('0x4'));var router=express[_0xa5c9('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5c9('0x6'));var controller=require('./smsMessage.controller');router[_0xa5c9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa5c9('0x8'),auth[_0xa5c9('0x9')](),controller[_0xa5c9('0xa')]);router[_0xa5c9('0x7')](_0xa5c9('0xb'),auth[_0xa5c9('0x9')](),controller[_0xa5c9('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xa5c9('0xd'),_0xa5c9('0xe')),controller[_0xa5c9('0xf')]);router[_0xa5c9('0x10')](_0xa5c9('0x11'),controller[_0xa5c9('0x12')]);router['put'](_0xa5c9('0xb'),auth[_0xa5c9('0x9')](),controller[_0xa5c9('0x13')]);router[_0xa5c9('0x14')](_0xa5c9('0x15'),auth[_0xa5c9('0x9')](),controller[_0xa5c9('0x16')]);router[_0xa5c9('0x14')]('/:id/reject',auth[_0xa5c9('0x9')](),controller[_0xa5c9('0x17')]);router[_0xa5c9('0x18')](_0xa5c9('0xb'),auth['isAuthenticated'](),controller[_0xa5c9('0x19')]);module[_0xa5c9('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index fca6610..f100534 100644 --- a/server/api/smsMessage/smsMessage.attributes.js +++ b/server/api/smsMessage/smsMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8653=['out','STRING','medium','BOOLEAN'];(function(_0x1d077c,_0x2bf77b){var _0x5ca1ef=function(_0x4c8b4c){while(--_0x4c8b4c){_0x1d077c['push'](_0x1d077c['shift']());}};_0x5ca1ef(++_0x2bf77b);}(_0x8653,0x17a));var _0x3865=function(_0x59ebc9,_0x96ad26){_0x59ebc9=_0x59ebc9-0x0;var _0x2ef708=_0x8653[_0x59ebc9];return _0x2ef708;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x3865('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x3865('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3865('0x2')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x3865('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x3865('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x6b1c=['medium','BOOLEAN','ENUM','out','STRING','sequelize','TEXT'];(function(_0x1c5037,_0x52e4d0){var _0x1e6ead=function(_0x24ed26){while(--_0x24ed26){_0x1c5037['push'](_0x1c5037['shift']());}};_0x1e6ead(++_0x52e4d0);}(_0x6b1c,0xf3));var _0xc6b1=function(_0x229103,_0x5b3760){_0x229103=_0x229103-0x0;var _0x88ea2f=_0x6b1c[_0x229103];return _0x88ea2f;};'use strict';var Sequelize=require(_0xc6b1('0x0'));module['exports']={'body':{'type':Sequelize[_0xc6b1('0x1')](_0xc6b1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc6b1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc6b1('0x4')]('in',_0xc6b1('0x5')),'defaultValue':_0xc6b1('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xc6b1('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xc6b1('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 435d040..130edf9 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c99=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','limit','set','Content-Range','apply','save','update','destroy','end','stack','name','send','map','SmsMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','UserId','Contact','get','SmsInteraction','isNil','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','manual','interface','channel','EventManager','acceptmessage','agent','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','event','reject','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','results','groupName','DELIVERED','infobip','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x4b57b1,_0x5c1714){var _0x49dd95=function(_0x2112dc){while(--_0x2112dc){_0x4b57b1['push'](_0x4b57b1['shift']());}};_0x49dd95(++_0x5c1714);}(_0x6c99,0x19b));var _0x96c9=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6c99[_0x5f0089];return _0x193892;};'use strict';var pdf=require(_0x96c9('0x0'));var emlformat=require(_0x96c9('0x1'));var rimraf=require(_0x96c9('0x2'));var zipdir=require(_0x96c9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96c9('0x4'));var moment=require('moment');var BPromise=require(_0x96c9('0x5'));var Mustache=require(_0x96c9('0x6'));var util=require(_0x96c9('0x7'));var path=require(_0x96c9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x96c9('0x9'));var fs=require('fs');var _=require(_0x96c9('0xa'));var squel=require(_0x96c9('0xb'));var crypto=require(_0x96c9('0xc'));var jsforce=require(_0x96c9('0xd'));var deskjs=require(_0x96c9('0xe'));var toCsv=require(_0x96c9('0xf'));var querystring=require(_0x96c9('0x10'));var Papa=require(_0x96c9('0x11'));var Redis=require(_0x96c9('0x12'));var authService=require(_0x96c9('0x13'));var qs=require(_0x96c9('0x14'));var as=require(_0x96c9('0x15'));var hardwareService=require(_0x96c9('0x16'));var logger=require(_0x96c9('0x17'))('api');var utils=require(_0x96c9('0x18'));var config=require(_0x96c9('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x96c9('0x1a')](config['redis'],{'host':_0x96c9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x96c9('0x1c'))[_0x96c9('0x1d')](socket);var jayson=require(_0x96c9('0x1e'));var client=jayson[_0x96c9('0x1f')][_0x96c9('0x20')]({'port':0x232c});var client9002=jayson[_0x96c9('0x1f')][_0x96c9('0x20')]({'port':0x232a});function checkPasswordPattern(_0x2ede0e,_0x434a00,_0x3808c1){if(_0x3808c1){var _0x29b420=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29b420[_0x96c9('0x21')](_0x434a00)){return _0x2ede0e;}else{throw new db[(_0x96c9('0x22'))][(_0x96c9('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2ede0e;}}function respondWithRpcPromise(_0x442332,_0x3fd489,_0x5aa89d,_0x472225){return new BPromise(function(_0x35dc59,_0x20a81a){var _0x56d57e=_0x472225||client;return _0x56d57e['request'](_0x442332,_0x5aa89d)[_0x96c9('0x24')](function(_0x457715){logger['info']('SmsMessage,\x20%s,\x20%s',_0x3fd489,_0x96c9('0x25'));logger[_0x96c9('0x26')](_0x96c9('0x27'),_0x3fd489,_0x96c9('0x25'),JSON[_0x96c9('0x28')](_0x457715));if(_0x457715['error']){if(_0x457715[_0x96c9('0x29')][_0x96c9('0x2a')]===0x1f4){logger[_0x96c9('0x29')]('SmsMessage,\x20%s,\x20%s',_0x3fd489,_0x457715[_0x96c9('0x29')]['message']);return _0x20a81a(_0x457715[_0x96c9('0x29')][_0x96c9('0x2b')]);}logger[_0x96c9('0x29')]('SmsMessage,\x20%s,\x20%s',_0x3fd489,_0x457715[_0x96c9('0x29')][_0x96c9('0x2b')]);return _0x35dc59(_0x457715[_0x96c9('0x29')][_0x96c9('0x2b')]);}else{logger[_0x96c9('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x3fd489,_0x96c9('0x25'));_0x35dc59(_0x457715[_0x96c9('0x2d')][_0x96c9('0x2b')]);}})[_0x96c9('0x2e')](function(_0x5cfcb1){logger['error']('SmsMessage,\x20%s,\x20%s',_0x3fd489,_0x5cfcb1);_0x20a81a(_0x5cfcb1);});});}function respondWithStatusCode(_0x2d352a,_0xfa1737){_0xfa1737=_0xfa1737||0xcc;return function(_0x426050){if(_0x426050){return _0x2d352a[_0x96c9('0x2f')](_0xfa1737);}return _0x2d352a[_0x96c9('0x30')](_0xfa1737)['end']();};}function respondWithResult(_0x126794,_0x575349){_0x575349=_0x575349||0xc8;return function(_0xb25d37){if(_0xb25d37){return _0x126794[_0x96c9('0x30')](_0x575349)[_0x96c9('0x31')](_0xb25d37);}};}function respondWithFilteredResult(_0x41760d,_0x5f228f){return function(_0x3e4b28){if(_0x3e4b28){var _0x3f2d27=_0x3e4b28[_0x96c9('0x32')],_0x2bc525=_0x5f228f['offset'],_0x5abfef=_0x5f228f['offset']+_0x5f228f[_0x96c9('0x33')],_0x1f0853;if(_0x5abfef>=_0x3f2d27){_0x5abfef=_0x3f2d27;_0x1f0853=0xc8;}else{_0x1f0853=0xce;}_0x41760d['status'](_0x1f0853);return _0x41760d[_0x96c9('0x34')](_0x96c9('0x35'),_0x2bc525+'-'+_0x5abfef+'/'+_0x3f2d27)[_0x96c9('0x31')](_0x3e4b28);}return null;};}function patchUpdates(_0x296364){return function(_0x213b2f){try{jsonpatch[_0x96c9('0x36')](_0x213b2f,_0x296364,!![]);}catch(_0xc38e3a){return BPromise['reject'](_0xc38e3a);}return _0x213b2f[_0x96c9('0x37')]();};}function saveUpdates(_0x584dc1,_0x46b2cb){return function(_0x1ab50d){if(_0x1ab50d){return _0x1ab50d[_0x96c9('0x38')](_0x584dc1)[_0x96c9('0x24')](function(_0x38eb6c){return _0x38eb6c;});}return null;};}function removeEntity(_0x5beefb,_0x1377cd){return function(_0x227ce5){if(_0x227ce5){return _0x227ce5[_0x96c9('0x39')]()[_0x96c9('0x24')](function(){_0x5beefb['status'](0xcc)[_0x96c9('0x3a')]();});}};}function handleEntityNotFound(_0x1e856d,_0x3989cc){return function(_0x1634c9){if(!_0x1634c9){_0x1e856d[_0x96c9('0x2f')](0x194);}return _0x1634c9;};}function handleError(_0x13da45,_0x48a3ab){_0x48a3ab=_0x48a3ab||0x1f4;return function(_0x1b7a26){logger[_0x96c9('0x29')](_0x1b7a26[_0x96c9('0x3b')]);if(_0x1b7a26['name']){delete _0x1b7a26[_0x96c9('0x3c')];}_0x13da45[_0x96c9('0x30')](_0x48a3ab)[_0x96c9('0x3d')](_0x1b7a26);};}exports['index']=function(_0x375309,_0x4561bf){var _0x34302b={},_0x52651e={},_0x1d2014={'count':0x0,'rows':[]};var _0x421c2a=_[_0x96c9('0x3e')](db[_0x96c9('0x3f')][_0x96c9('0x40')],function(_0x120f94){return{'name':_0x120f94['fieldName'],'type':_0x120f94[_0x96c9('0x41')][_0x96c9('0x42')]};});_0x52651e[_0x96c9('0x43')]=_[_0x96c9('0x3e')](_0x421c2a,_0x96c9('0x3c'));_0x52651e[_0x96c9('0x44')]=_[_0x96c9('0x45')](_0x375309[_0x96c9('0x44')]);_0x52651e[_0x96c9('0x46')]=_[_0x96c9('0x47')](_0x52651e[_0x96c9('0x43')],_0x52651e[_0x96c9('0x44')]);_0x34302b['attributes']=_[_0x96c9('0x47')](_0x52651e[_0x96c9('0x43')],qs[_0x96c9('0x48')](_0x375309[_0x96c9('0x44')]['fields']));_0x34302b[_0x96c9('0x49')]=_0x34302b[_0x96c9('0x49')][_0x96c9('0x4a')]?_0x34302b[_0x96c9('0x49')]:_0x52651e['model'];if(!_0x375309[_0x96c9('0x44')][_0x96c9('0x4b')](_0x96c9('0x4c'))){_0x34302b[_0x96c9('0x33')]=qs['limit'](_0x375309[_0x96c9('0x44')][_0x96c9('0x33')]);_0x34302b['offset']=qs[_0x96c9('0x4d')](_0x375309[_0x96c9('0x44')]['offset']);}_0x34302b[_0x96c9('0x4e')]=qs[_0x96c9('0x4f')](_0x375309[_0x96c9('0x44')][_0x96c9('0x4f')]);_0x34302b[_0x96c9('0x50')]=qs['filters'](_[_0x96c9('0x51')](_0x375309['query'],_0x52651e['filters']));if(_0x375309[_0x96c9('0x44')]['filter']){_0x34302b[_0x96c9('0x50')]=_[_0x96c9('0x52')](_0x34302b['where'],{'$or':_[_0x96c9('0x3e')](_0x421c2a,function(_0x51193b){if(_0x51193b[_0x96c9('0x41')]!==_0x96c9('0x53')){var _0x11375f={};_0x11375f[_0x51193b[_0x96c9('0x3c')]]={'$like':'%'+_0x375309[_0x96c9('0x44')]['filter']+'%'};return _0x11375f;}})});}_0x34302b=_[_0x96c9('0x52')]({},_0x34302b,_0x375309['options']);var _0x5708d6={'where':_0x34302b['where']};return db[_0x96c9('0x3f')][_0x96c9('0x32')](_0x5708d6)['then'](function(_0x1c77a3){_0x1d2014[_0x96c9('0x32')]=_0x1c77a3;if(_0x375309[_0x96c9('0x44')][_0x96c9('0x54')]){_0x34302b[_0x96c9('0x55')]=[{'all':!![]}];}return db[_0x96c9('0x3f')][_0x96c9('0x56')](_0x34302b);})[_0x96c9('0x24')](function(_0x5bc343){_0x1d2014[_0x96c9('0x57')]=_0x5bc343;return _0x1d2014;})[_0x96c9('0x24')](respondWithFilteredResult(_0x4561bf,_0x34302b))['catch'](handleError(_0x4561bf,null));};exports[_0x96c9('0x58')]=function(_0x47f0da,_0x37d900){var _0x576267={'raw':!![],'where':{'id':_0x47f0da[_0x96c9('0x59')]['id']}},_0x18e1f2={};_0x18e1f2[_0x96c9('0x43')]=_[_0x96c9('0x45')](db[_0x96c9('0x3f')][_0x96c9('0x40')]);_0x18e1f2[_0x96c9('0x44')]=_['keys'](_0x47f0da[_0x96c9('0x44')]);_0x18e1f2[_0x96c9('0x46')]=_[_0x96c9('0x47')](_0x18e1f2['model'],_0x18e1f2[_0x96c9('0x44')]);_0x576267['attributes']=_[_0x96c9('0x47')](_0x18e1f2[_0x96c9('0x43')],qs[_0x96c9('0x48')](_0x47f0da[_0x96c9('0x44')][_0x96c9('0x48')]));_0x576267[_0x96c9('0x49')]=_0x576267['attributes'][_0x96c9('0x4a')]?_0x576267[_0x96c9('0x49')]:_0x18e1f2[_0x96c9('0x43')];if(_0x47f0da['query'][_0x96c9('0x54')]){_0x576267[_0x96c9('0x55')]=[{'all':!![]}];}_0x576267=_[_0x96c9('0x52')]({},_0x576267,_0x47f0da[_0x96c9('0x5a')]);return db[_0x96c9('0x3f')][_0x96c9('0x5b')](_0x576267)[_0x96c9('0x24')](handleEntityNotFound(_0x37d900,null))[_0x96c9('0x24')](respondWithResult(_0x37d900,null))[_0x96c9('0x2e')](handleError(_0x37d900,null));};exports[_0x96c9('0x5c')]=function(_0x8ca36c,_0x25ef1e){return db[_0x96c9('0x3f')][_0x96c9('0x5c')](_0x8ca36c[_0x96c9('0x5d')],{})[_0x96c9('0x24')](respondWithResult(_0x25ef1e,0xc9))[_0x96c9('0x2e')](handleError(_0x25ef1e,null));};exports[_0x96c9('0x38')]=function(_0xf74490,_0x3eacff){if(_0xf74490[_0x96c9('0x5d')]['id']){delete _0xf74490['body']['id'];}return db[_0x96c9('0x3f')][_0x96c9('0x5b')]({'where':{'id':_0xf74490['params']['id']}})['then'](handleEntityNotFound(_0x3eacff,null))['then'](saveUpdates(_0xf74490['body'],null))['then'](respondWithResult(_0x3eacff,null))[_0x96c9('0x2e')](handleError(_0x3eacff,null));};exports['destroy']=function(_0x406217,_0x148c5e){return db[_0x96c9('0x3f')]['find']({'where':{'id':_0x406217[_0x96c9('0x59')]['id']}})[_0x96c9('0x24')](handleEntityNotFound(_0x148c5e,null))['then'](removeEntity(_0x148c5e,null))[_0x96c9('0x2e')](handleError(_0x148c5e,null));};exports[_0x96c9('0x5e')]=function(_0x20c403,_0xc7f0ac){return db[_0x96c9('0x3f')][_0x96c9('0x5e')]()[_0x96c9('0x24')](respondWithResult(_0xc7f0ac,null))[_0x96c9('0x2e')](handleError(_0xc7f0ac,null));};var interaction_log=require(_0x96c9('0x17'))(_0x96c9('0x5f'));exports[_0x96c9('0x60')]=function(_0x2ef1a2,_0x216590,_0x1b3689){var _0x109297={'channel':_0x96c9('0x61')};if(_0x2ef1a2[_0x96c9('0x5d')]['id']){delete _0x2ef1a2[_0x96c9('0x5d')]['id'];}_0x2ef1a2[_0x96c9('0x5d')][_0x96c9('0x62')]=!![];_0x2ef1a2[_0x96c9('0x5d')][_0x96c9('0x63')]=moment()[_0x96c9('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ef1a2[_0x96c9('0x5d')][_0x96c9('0x65')]=_0x2ef1a2[_0x96c9('0x5d')]['UserId']||_0x2ef1a2['user']['id'];return db[_0x96c9('0x3f')][_0x96c9('0x5b')]({'where':{'id':_0x2ef1a2[_0x96c9('0x59')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x96c9('0x66')}]})[_0x96c9('0x24')](handleEntityNotFound(_0x216590,null))[_0x96c9('0x24')](saveUpdates(_0x2ef1a2[_0x96c9('0x5d')],null))[_0x96c9('0x24')](function(_0x2751cf){if(_0x2751cf){_0x109297[_0x96c9('0x2b')]=_0x2751cf[_0x96c9('0x67')]({'plain':!![]});return db[_0x96c9('0x68')][_0x96c9('0x5b')]({'where':{'id':_0x2751cf['SmsInteractionId']}});}return null;})[_0x96c9('0x24')](handleEntityNotFound(_0x216590,null))['then'](function(_0x22efc1){if(_0x22efc1){return _0x22efc1['update']({'UserId':_0x2ef1a2[_0x96c9('0x5d')][_0x96c9('0x65')],'read1stAt':_[_0x96c9('0x69')](_0x22efc1['read1stAt'])?moment()[_0x96c9('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x218e30){if(_0x218e30){_0x109297['interaction']=_0x218e30[_0x96c9('0x67')]({'plain':!![]});interaction_log['info'](_0x96c9('0x6a'),_0x2ef1a2[_0x96c9('0x6b')]['id'],_0x2ef1a2[_0x96c9('0x6b')][_0x96c9('0x3c')],_0x2ef1a2[_0x96c9('0x6b')][_0x96c9('0x6c')],_0x109297[_0x96c9('0x6d')]['id'],_0x2ef1a2[_0x96c9('0x5d')]?JSON[_0x96c9('0x28')](_0x2ef1a2['body']):_0x96c9('0x6e'));return respondWithRpcPromise(_0x96c9('0x6f'),_0x96c9('0x70'),_0x109297);}return null;})['then'](function(_0x408426){if(_0x408426){if(_0x2ef1a2[_0x96c9('0x5d')][_0x96c9('0x71')]){_0x109297['message'][_0x96c9('0x72')]=util[_0x96c9('0x64')]('SIP/%s',_0x2ef1a2[_0x96c9('0x6b')][_0x96c9('0x3c')]);_0x109297['message'][_0x96c9('0x73')]=_0x109297[_0x96c9('0x73')];_0x109297[_0x96c9('0x2b')]['event']='accept';return respondWithRpcPromise(_0x96c9('0x74'),'EventManager',{'event':_0x96c9('0x75'),'message':_0x109297[_0x96c9('0x2b')]},client9002)[_0x96c9('0x24')](function(){return _0x109297;});}return _0x109297;}return null;})['then'](respondWithResult(_0x216590,null))[_0x96c9('0x2e')](handleError(_0x216590,null));};var interaction_log=require(_0x96c9('0x17'))('sms-interactions');exports['reject']=function(_0x12c2c8,_0x41a772,_0x1eaf1d){var _0x353cb2={'agent':{},'channel':_0x96c9('0x61')};if(_0x12c2c8[_0x96c9('0x5d')]['id']){delete _0x12c2c8['body']['id'];}_0x12c2c8[_0x96c9('0x5d')][_0x96c9('0x65')]=_0x12c2c8[_0x96c9('0x5d')][_0x96c9('0x65')]||_0x12c2c8[_0x96c9('0x6b')]['id'];_0x353cb2[_0x96c9('0x76')]['id']=_0x12c2c8[_0x96c9('0x5d')][_0x96c9('0x65')];return db[_0x96c9('0x3f')][_0x96c9('0x5b')]({'where':{'id':_0x12c2c8[_0x96c9('0x59')]['id'],'UserId':null}})[_0x96c9('0x24')](handleEntityNotFound(_0x41a772,null))['then'](function(_0x573f2e){if(_0x573f2e){_0x353cb2[_0x96c9('0x2b')]=_0x573f2e[_0x96c9('0x67')]({'plain':!![]});return db[_0x96c9('0x68')][_0x96c9('0x5b')]({'where':{'id':_0x573f2e[_0x96c9('0x77')]}});}return null;})[_0x96c9('0x24')](handleEntityNotFound(_0x41a772,null))['then'](function(_0x506bbe){if(_0x506bbe){_0x353cb2['interaction']=_0x506bbe[_0x96c9('0x67')]({'plain':!![]});interaction_log[_0x96c9('0x2c')](_0x96c9('0x78'),_0x12c2c8[_0x96c9('0x6b')]['id'],_0x12c2c8[_0x96c9('0x6b')][_0x96c9('0x3c')],_0x12c2c8[_0x96c9('0x6b')][_0x96c9('0x6c')],_0x353cb2[_0x96c9('0x6d')]['id'],_0x12c2c8[_0x96c9('0x5d')]?JSON[_0x96c9('0x28')](_0x12c2c8[_0x96c9('0x5d')]):_0x96c9('0x6e'));return respondWithRpcPromise(_0x96c9('0x79'),_0x96c9('0x7a'),_0x353cb2);}return null;})[_0x96c9('0x24')](function(_0x23f63e){if(_0x23f63e){_0x23f63e[_0x96c9('0x2b')][_0x96c9('0x72')]=util[_0x96c9('0x64')](_0x96c9('0x7b'),_0x12c2c8[_0x96c9('0x6b')][_0x96c9('0x3c')]);_0x23f63e['message'][_0x96c9('0x73')]=_0x353cb2[_0x96c9('0x73')];_0x23f63e[_0x96c9('0x2b')][_0x96c9('0x7c')]=_0x96c9('0x7d');respondWithRpcPromise('EventManager',_0x96c9('0x74'),{'event':'rejectmessage','message':_0x23f63e[_0x96c9('0x2b')]},client9002);return _0x353cb2;}return null;})[_0x96c9('0x24')](respondWithResult(_0x41a772,null))[_0x96c9('0x2e')](handleError(_0x41a772,null));};exports[_0x96c9('0x30')]=function(_0x4c5809,_0x76ad3b,_0x22d82b){if(_0x4c5809[_0x96c9('0x5d')]['id']){delete _0x4c5809[_0x96c9('0x5d')]['id'];}var _0x5a4a22;return db[_0x96c9('0x3f')][_0x96c9('0x5b')]({'where':{'id':_0x4c5809['params']['id']}})[_0x96c9('0x24')](handleEntityNotFound(_0x76ad3b,null))[_0x96c9('0x24')](function(_0xb7bb3f){if(_0xb7bb3f){_0x5a4a22=_0xb7bb3f;return db[_0x96c9('0x7e')][_0x96c9('0x5b')]({'where':{'id':_0xb7bb3f[_0x96c9('0x7f')]}});}})[_0x96c9('0x24')](handleEntityNotFound(_0x76ad3b,null))[_0x96c9('0x24')](function(_0x307ded){if(_0x307ded){logger['debug'](_0x96c9('0x27'),_0x96c9('0x30'),_0x96c9('0x80'),_0x307ded[_0x96c9('0x41')],util[_0x96c9('0x81')](_0x4c5809[_0x96c9('0x5d')],{'showHidden':![],'depth':null}));switch(_0x307ded['type']){case _0x96c9('0x82'):if(_0x4c5809[_0x96c9('0x5d')]['MessageSid']&&_0x4c5809['body'][_0x96c9('0x83')]===_0x5a4a22[_0x96c9('0x84')]){return _0x5a4a22[_0x96c9('0x38')]({'read':!![]});}else{logger[_0x96c9('0x29')](_0x96c9('0x85'),_0x96c9('0x30'),'twilio',util['inspect'](_0x4c5809[_0x96c9('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x96c9('0x86'):if(_0x4c5809[_0x96c9('0x5d')][_0x96c9('0x87')]&&_0x4c5809[_0x96c9('0x5d')][_0x96c9('0x87')]===_0x5a4a22[_0x96c9('0x84')]&&_['indexOf']([_0x96c9('0x88'),_0x96c9('0x89')],_0x4c5809['body'][_0x96c9('0x8a')])>=0x0){return _0x5a4a22[_0x96c9('0x38')]({'read':!![]});}else{logger['error'](_0x96c9('0x85'),_0x96c9('0x30'),'plivio',util[_0x96c9('0x81')](_0x4c5809[_0x96c9('0x5d')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5168aa=_0x4c5809[_0x96c9('0x5d')][_0x96c9('0x8b')][0x0];if(_0x5168aa['status'][_0x96c9('0x8c')]===_0x96c9('0x8d')){return _0x5a4a22[_0x96c9('0x38')]({'read':!![]});}else{logger[_0x96c9('0x29')](_0x96c9('0x85'),_0x96c9('0x30'),_0x96c9('0x8e'),util[_0x96c9('0x81')](_0x4c5809[_0x96c9('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x5a4a22;}})[_0x96c9('0x24')](respondWithResult(_0x76ad3b,null))[_0x96c9('0x2e')](handleError(_0x76ad3b,null));}; \ No newline at end of file +var _0xd9c4=['end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','index','map','SmsMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','count','includeAll','findAll','rows','catch','params','include','create','body','find','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','Status','plivio','infobip','groupName','DELIVERED','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status'];(function(_0xeb7786,_0x53a053){var _0x120bbc=function(_0x291f05){while(--_0x291f05){_0xeb7786['push'](_0xeb7786['shift']());}};_0x120bbc(++_0x53a053);}(_0xd9c4,0xee));var _0x4d9c=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xd9c4[_0x5c3c0b];return _0x52ecd2;};'use strict';var pdf=require(_0x4d9c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4d9c('0x1'));var jsonpatch=require(_0x4d9c('0x2'));var rp=require(_0x4d9c('0x3'));var moment=require(_0x4d9c('0x4'));var BPromise=require(_0x4d9c('0x5'));var Mustache=require(_0x4d9c('0x6'));var util=require(_0x4d9c('0x7'));var path=require(_0x4d9c('0x8'));var sox=require(_0x4d9c('0x9'));var csv=require(_0x4d9c('0xa'));var ejs=require(_0x4d9c('0xb'));var fs=require('fs');var _=require(_0x4d9c('0xc'));var squel=require('squel');var crypto=require(_0x4d9c('0xd'));var jsforce=require(_0x4d9c('0xe'));var deskjs=require(_0x4d9c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4d9c('0x10'));var Papa=require(_0x4d9c('0x11'));var Redis=require(_0x4d9c('0x12'));var authService=require(_0x4d9c('0x13'));var qs=require(_0x4d9c('0x14'));var as=require(_0x4d9c('0x15'));var hardwareService=require(_0x4d9c('0x16'));var logger=require(_0x4d9c('0x17'))(_0x4d9c('0x18'));var utils=require('../../config/utils');var config=require(_0x4d9c('0x19'));var db=require(_0x4d9c('0x1a'))['db'];config[_0x4d9c('0x1b')]=_['defaults'](config[_0x4d9c('0x1b')],{'host':_0x4d9c('0x1c'),'port':0x18eb});var socket=require(_0x4d9c('0x1d'))(new Redis(config[_0x4d9c('0x1b')]));require(_0x4d9c('0x1e'))['register'](socket);var jayson=require(_0x4d9c('0x1f'));var client=jayson[_0x4d9c('0x20')][_0x4d9c('0x21')]({'port':0x232c});var client9002=jayson[_0x4d9c('0x20')][_0x4d9c('0x21')]({'port':0x232a});function checkPasswordPattern(_0x1798d6,_0xe52c4b,_0x4cb24d){if(_0x4cb24d){var _0x560e3c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x560e3c[_0x4d9c('0x22')](_0xe52c4b)){return _0x1798d6;}else{throw new db[(_0x4d9c('0x23'))][(_0x4d9c('0x24'))](_0x4d9c('0x25'));}}else{return _0x1798d6;}}function respondWithRpcPromise(_0x5a4ab7,_0x3ec874,_0x50024a,_0x404cc6){return new BPromise(function(_0xe48bad,_0x7892a3){var _0x4ea95d=_0x404cc6||client;return _0x4ea95d[_0x4d9c('0x26')](_0x5a4ab7,_0x50024a)[_0x4d9c('0x27')](function(_0x470086){logger[_0x4d9c('0x28')](_0x4d9c('0x29'),_0x3ec874,'request\x20sent');logger[_0x4d9c('0x2a')](_0x4d9c('0x2b'),_0x3ec874,_0x4d9c('0x2c'),JSON[_0x4d9c('0x2d')](_0x470086));if(_0x470086[_0x4d9c('0x2e')]){if(_0x470086[_0x4d9c('0x2e')][_0x4d9c('0x2f')]===0x1f4){logger[_0x4d9c('0x2e')](_0x4d9c('0x29'),_0x3ec874,_0x470086[_0x4d9c('0x2e')]['message']);return _0x7892a3(_0x470086[_0x4d9c('0x2e')]['message']);}logger[_0x4d9c('0x2e')](_0x4d9c('0x29'),_0x3ec874,_0x470086[_0x4d9c('0x2e')][_0x4d9c('0x30')]);return _0xe48bad(_0x470086[_0x4d9c('0x2e')][_0x4d9c('0x30')]);}else{logger[_0x4d9c('0x28')](_0x4d9c('0x29'),_0x3ec874,_0x4d9c('0x2c'));_0xe48bad(_0x470086[_0x4d9c('0x31')][_0x4d9c('0x30')]);}})['catch'](function(_0x247aa1){logger[_0x4d9c('0x2e')](_0x4d9c('0x29'),_0x3ec874,_0x247aa1);_0x7892a3(_0x247aa1);});});}function respondWithStatusCode(_0x5ceef4,_0x493e31){_0x493e31=_0x493e31||0xcc;return function(_0x50672f){if(_0x50672f){return _0x5ceef4[_0x4d9c('0x32')](_0x493e31);}return _0x5ceef4[_0x4d9c('0x33')](_0x493e31)[_0x4d9c('0x34')]();};}function respondWithResult(_0xe59140,_0x1f5ca3){_0x1f5ca3=_0x1f5ca3||0xc8;return function(_0x23d264){if(_0x23d264){return _0xe59140[_0x4d9c('0x33')](_0x1f5ca3)['json'](_0x23d264);}};}function respondWithFilteredResult(_0x15ebf3,_0x4a5327){return function(_0x3b3bfe){if(_0x3b3bfe){var _0x1e624c=_0x3b3bfe['count'],_0x2f3259=_0x4a5327['offset'],_0x1c5fb3=_0x4a5327[_0x4d9c('0x35')]+_0x4a5327[_0x4d9c('0x36')],_0x3d8500;if(_0x1c5fb3>=_0x1e624c){_0x1c5fb3=_0x1e624c;_0x3d8500=0xc8;}else{_0x3d8500=0xce;}_0x15ebf3[_0x4d9c('0x33')](_0x3d8500);return _0x15ebf3[_0x4d9c('0x37')](_0x4d9c('0x38'),_0x2f3259+'-'+_0x1c5fb3+'/'+_0x1e624c)[_0x4d9c('0x39')](_0x3b3bfe);}return null;};}function patchUpdates(_0x5237b0){return function(_0x4e6d8a){try{jsonpatch[_0x4d9c('0x3a')](_0x4e6d8a,_0x5237b0,!![]);}catch(_0x49213d){return BPromise[_0x4d9c('0x3b')](_0x49213d);}return _0x4e6d8a[_0x4d9c('0x3c')]();};}function saveUpdates(_0x5aeb5f,_0x48be0d){return function(_0x31c5b2){if(_0x31c5b2){return _0x31c5b2[_0x4d9c('0x3d')](_0x5aeb5f)[_0x4d9c('0x27')](function(_0x12c45a){return _0x12c45a;});}return null;};}function removeEntity(_0x41df38,_0x4448b5){return function(_0x683423){if(_0x683423){return _0x683423[_0x4d9c('0x3e')]()[_0x4d9c('0x27')](function(){_0x41df38[_0x4d9c('0x33')](0xcc)[_0x4d9c('0x34')]();});}};}function handleEntityNotFound(_0x53ffb0,_0x1d3cb2){return function(_0x3d69d2){if(!_0x3d69d2){_0x53ffb0[_0x4d9c('0x32')](0x194);}return _0x3d69d2;};}function handleError(_0x2f5ff1,_0x4f94e3){_0x4f94e3=_0x4f94e3||0x1f4;return function(_0x1911a2){logger[_0x4d9c('0x2e')](_0x1911a2['stack']);if(_0x1911a2['name']){delete _0x1911a2[_0x4d9c('0x3f')];}_0x2f5ff1[_0x4d9c('0x33')](_0x4f94e3)['send'](_0x1911a2);};}exports[_0x4d9c('0x40')]=function(_0x1f7788,_0x16f7e7){var _0x2d5a9e={},_0xfbe3af={},_0x6dd8eb={'count':0x0,'rows':[]};var _0x578b0d=_[_0x4d9c('0x41')](db[_0x4d9c('0x42')][_0x4d9c('0x43')],function(_0x241b74){return{'name':_0x241b74['fieldName'],'type':_0x241b74[_0x4d9c('0x44')][_0x4d9c('0x45')]};});_0xfbe3af[_0x4d9c('0x46')]=_[_0x4d9c('0x41')](_0x578b0d,_0x4d9c('0x3f'));_0xfbe3af[_0x4d9c('0x47')]=_[_0x4d9c('0x48')](_0x1f7788[_0x4d9c('0x47')]);_0xfbe3af[_0x4d9c('0x49')]=_[_0x4d9c('0x4a')](_0xfbe3af[_0x4d9c('0x46')],_0xfbe3af[_0x4d9c('0x47')]);_0x2d5a9e[_0x4d9c('0x4b')]=_[_0x4d9c('0x4a')](_0xfbe3af[_0x4d9c('0x46')],qs[_0x4d9c('0x4c')](_0x1f7788[_0x4d9c('0x47')][_0x4d9c('0x4c')]));_0x2d5a9e['attributes']=_0x2d5a9e[_0x4d9c('0x4b')][_0x4d9c('0x4d')]?_0x2d5a9e[_0x4d9c('0x4b')]:_0xfbe3af[_0x4d9c('0x46')];if(!_0x1f7788[_0x4d9c('0x47')][_0x4d9c('0x4e')](_0x4d9c('0x4f'))){_0x2d5a9e[_0x4d9c('0x36')]=qs[_0x4d9c('0x36')](_0x1f7788[_0x4d9c('0x47')]['limit']);_0x2d5a9e[_0x4d9c('0x35')]=qs[_0x4d9c('0x35')](_0x1f7788[_0x4d9c('0x47')]['offset']);}_0x2d5a9e[_0x4d9c('0x50')]=qs[_0x4d9c('0x51')](_0x1f7788[_0x4d9c('0x47')][_0x4d9c('0x51')]);_0x2d5a9e['where']=qs[_0x4d9c('0x49')](_[_0x4d9c('0x52')](_0x1f7788['query'],_0xfbe3af['filters']));if(_0x1f7788[_0x4d9c('0x47')][_0x4d9c('0x53')]){_0x2d5a9e[_0x4d9c('0x54')]=_[_0x4d9c('0x55')](_0x2d5a9e['where'],{'$or':_['map'](_0x578b0d,function(_0x1f3add){if(_0x1f3add[_0x4d9c('0x44')]!=='VIRTUAL'){var _0x3d2788={};_0x3d2788[_0x1f3add[_0x4d9c('0x3f')]]={'$like':'%'+_0x1f7788[_0x4d9c('0x47')]['filter']+'%'};return _0x3d2788;}})});}_0x2d5a9e=_[_0x4d9c('0x55')]({},_0x2d5a9e,_0x1f7788[_0x4d9c('0x56')]);var _0x211cb5={'where':_0x2d5a9e[_0x4d9c('0x54')]};return db['SmsMessage'][_0x4d9c('0x57')](_0x211cb5)[_0x4d9c('0x27')](function(_0x245ed9){_0x6dd8eb[_0x4d9c('0x57')]=_0x245ed9;if(_0x1f7788[_0x4d9c('0x47')][_0x4d9c('0x58')]){_0x2d5a9e['include']=[{'all':!![]}];}return db[_0x4d9c('0x42')][_0x4d9c('0x59')](_0x2d5a9e);})[_0x4d9c('0x27')](function(_0x1173c6){_0x6dd8eb[_0x4d9c('0x5a')]=_0x1173c6;return _0x6dd8eb;})[_0x4d9c('0x27')](respondWithFilteredResult(_0x16f7e7,_0x2d5a9e))[_0x4d9c('0x5b')](handleError(_0x16f7e7,null));};exports['show']=function(_0x5af8dc,_0x4d0d5c){var _0x54fd8a={'raw':!![],'where':{'id':_0x5af8dc[_0x4d9c('0x5c')]['id']}},_0x3b01e7={};_0x3b01e7[_0x4d9c('0x46')]=_[_0x4d9c('0x48')](db[_0x4d9c('0x42')]['rawAttributes']);_0x3b01e7[_0x4d9c('0x47')]=_[_0x4d9c('0x48')](_0x5af8dc[_0x4d9c('0x47')]);_0x3b01e7['filters']=_[_0x4d9c('0x4a')](_0x3b01e7[_0x4d9c('0x46')],_0x3b01e7['query']);_0x54fd8a[_0x4d9c('0x4b')]=_[_0x4d9c('0x4a')](_0x3b01e7[_0x4d9c('0x46')],qs[_0x4d9c('0x4c')](_0x5af8dc['query'][_0x4d9c('0x4c')]));_0x54fd8a[_0x4d9c('0x4b')]=_0x54fd8a['attributes'][_0x4d9c('0x4d')]?_0x54fd8a[_0x4d9c('0x4b')]:_0x3b01e7['model'];if(_0x5af8dc[_0x4d9c('0x47')][_0x4d9c('0x58')]){_0x54fd8a[_0x4d9c('0x5d')]=[{'all':!![]}];}_0x54fd8a=_['merge']({},_0x54fd8a,_0x5af8dc[_0x4d9c('0x56')]);return db[_0x4d9c('0x42')]['find'](_0x54fd8a)[_0x4d9c('0x27')](handleEntityNotFound(_0x4d0d5c,null))[_0x4d9c('0x27')](respondWithResult(_0x4d0d5c,null))['catch'](handleError(_0x4d0d5c,null));};exports[_0x4d9c('0x5e')]=function(_0x384e04,_0x3bd86c){return db[_0x4d9c('0x42')][_0x4d9c('0x5e')](_0x384e04['body'],{})['then'](respondWithResult(_0x3bd86c,0xc9))['catch'](handleError(_0x3bd86c,null));};exports[_0x4d9c('0x3d')]=function(_0x50b463,_0x350799){if(_0x50b463[_0x4d9c('0x5f')]['id']){delete _0x50b463[_0x4d9c('0x5f')]['id'];}return db[_0x4d9c('0x42')][_0x4d9c('0x60')]({'where':{'id':_0x50b463[_0x4d9c('0x5c')]['id']}})[_0x4d9c('0x27')](handleEntityNotFound(_0x350799,null))[_0x4d9c('0x27')](saveUpdates(_0x50b463[_0x4d9c('0x5f')],null))['then'](respondWithResult(_0x350799,null))[_0x4d9c('0x5b')](handleError(_0x350799,null));};exports['destroy']=function(_0x115162,_0x30b3bd){return db[_0x4d9c('0x42')][_0x4d9c('0x60')]({'where':{'id':_0x115162['params']['id']}})['then'](handleEntityNotFound(_0x30b3bd,null))[_0x4d9c('0x27')](removeEntity(_0x30b3bd,null))[_0x4d9c('0x5b')](handleError(_0x30b3bd,null));};exports[_0x4d9c('0x61')]=function(_0x4c164c,_0x12984e){return db[_0x4d9c('0x42')]['describe']()[_0x4d9c('0x27')](respondWithResult(_0x12984e,null))[_0x4d9c('0x5b')](handleError(_0x12984e,null));};var interaction_log=require('../../config/logger')(_0x4d9c('0x62'));exports[_0x4d9c('0x63')]=function(_0x33dd0d,_0x23228a,_0xad78f0){var _0x4f2a10={'channel':_0x4d9c('0x64')};if(_0x33dd0d[_0x4d9c('0x5f')]['id']){delete _0x33dd0d['body']['id'];}_0x33dd0d[_0x4d9c('0x5f')][_0x4d9c('0x65')]=!![];_0x33dd0d['body']['readAt']=moment()[_0x4d9c('0x66')](_0x4d9c('0x67'));_0x33dd0d[_0x4d9c('0x5f')][_0x4d9c('0x68')]=_0x33dd0d[_0x4d9c('0x5f')][_0x4d9c('0x68')]||_0x33dd0d[_0x4d9c('0x69')]['id'];return db['SmsMessage'][_0x4d9c('0x60')]({'where':{'id':_0x33dd0d[_0x4d9c('0x5c')]['id'],'UserId':null},'include':[{'model':db[_0x4d9c('0x6a')],'as':_0x4d9c('0x6b')}]})[_0x4d9c('0x27')](handleEntityNotFound(_0x23228a,null))[_0x4d9c('0x27')](saveUpdates(_0x33dd0d[_0x4d9c('0x5f')],null))[_0x4d9c('0x27')](function(_0x368bfc){if(_0x368bfc){_0x4f2a10[_0x4d9c('0x30')]=_0x368bfc[_0x4d9c('0x6c')]({'plain':!![]});return db['SmsInteraction'][_0x4d9c('0x60')]({'where':{'id':_0x368bfc[_0x4d9c('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x23228a,null))[_0x4d9c('0x27')](function(_0x5b8d1e){if(_0x5b8d1e){return _0x5b8d1e[_0x4d9c('0x3d')]({'UserId':_0x33dd0d[_0x4d9c('0x5f')][_0x4d9c('0x68')],'read1stAt':_[_0x4d9c('0x6e')](_0x5b8d1e['read1stAt'])?moment()[_0x4d9c('0x66')](_0x4d9c('0x67')):undefined});}return null;})[_0x4d9c('0x27')](function(_0x16d4b1){if(_0x16d4b1){_0x4f2a10[_0x4d9c('0x6f')]=_0x16d4b1[_0x4d9c('0x6c')]({'plain':!![]});interaction_log['info'](_0x4d9c('0x70'),_0x33dd0d[_0x4d9c('0x69')]['id'],_0x33dd0d[_0x4d9c('0x69')][_0x4d9c('0x3f')],_0x33dd0d[_0x4d9c('0x69')][_0x4d9c('0x71')],_0x4f2a10[_0x4d9c('0x6f')]['id'],_0x33dd0d['body']?JSON[_0x4d9c('0x2d')](_0x33dd0d[_0x4d9c('0x5f')]):_0x4d9c('0x72'));return respondWithRpcPromise(_0x4d9c('0x73'),_0x4d9c('0x74'),_0x4f2a10);}return null;})['then'](function(_0x22ba43){if(_0x22ba43){if(_0x33dd0d[_0x4d9c('0x5f')][_0x4d9c('0x75')]){_0x4f2a10['message'][_0x4d9c('0x76')]=util['format'](_0x4d9c('0x77'),_0x33dd0d['user'][_0x4d9c('0x3f')]);_0x4f2a10[_0x4d9c('0x30')][_0x4d9c('0x78')]=_0x4f2a10[_0x4d9c('0x78')];_0x4f2a10['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x4d9c('0x79'),{'event':_0x4d9c('0x7a'),'message':_0x4f2a10['message']},client9002)['then'](function(){return _0x4f2a10;});}return _0x4f2a10;}return null;})[_0x4d9c('0x27')](respondWithResult(_0x23228a,null))['catch'](handleError(_0x23228a,null));};var interaction_log=require(_0x4d9c('0x17'))(_0x4d9c('0x62'));exports[_0x4d9c('0x3b')]=function(_0x480d0d,_0xeb6843,_0x2cbfb9){var _0x4de485={'agent':{},'channel':'sms'};if(_0x480d0d[_0x4d9c('0x5f')]['id']){delete _0x480d0d[_0x4d9c('0x5f')]['id'];}_0x480d0d['body']['UserId']=_0x480d0d[_0x4d9c('0x5f')]['UserId']||_0x480d0d[_0x4d9c('0x69')]['id'];_0x4de485[_0x4d9c('0x7b')]['id']=_0x480d0d[_0x4d9c('0x5f')][_0x4d9c('0x68')];return db[_0x4d9c('0x42')][_0x4d9c('0x60')]({'where':{'id':_0x480d0d['params']['id'],'UserId':null}})[_0x4d9c('0x27')](handleEntityNotFound(_0xeb6843,null))[_0x4d9c('0x27')](function(_0x4ca278){if(_0x4ca278){_0x4de485[_0x4d9c('0x30')]=_0x4ca278[_0x4d9c('0x6c')]({'plain':!![]});return db[_0x4d9c('0x7c')]['find']({'where':{'id':_0x4ca278['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xeb6843,null))[_0x4d9c('0x27')](function(_0x134b9d){if(_0x134b9d){_0x4de485[_0x4d9c('0x6f')]=_0x134b9d['get']({'plain':!![]});interaction_log['info'](_0x4d9c('0x7d'),_0x480d0d['user']['id'],_0x480d0d[_0x4d9c('0x69')]['name'],_0x480d0d[_0x4d9c('0x69')][_0x4d9c('0x71')],_0x4de485[_0x4d9c('0x6f')]['id'],_0x480d0d[_0x4d9c('0x5f')]?JSON[_0x4d9c('0x2d')](_0x480d0d[_0x4d9c('0x5f')]):_0x4d9c('0x72'));return respondWithRpcPromise(_0x4d9c('0x7e'),_0x4d9c('0x7f'),_0x4de485);}return null;})[_0x4d9c('0x27')](function(_0x34d0bd){if(_0x34d0bd){_0x34d0bd[_0x4d9c('0x30')]['interface']=util[_0x4d9c('0x66')](_0x4d9c('0x77'),_0x480d0d['user'][_0x4d9c('0x3f')]);_0x34d0bd[_0x4d9c('0x30')][_0x4d9c('0x78')]=_0x4de485[_0x4d9c('0x78')];_0x34d0bd[_0x4d9c('0x30')][_0x4d9c('0x80')]=_0x4d9c('0x3b');respondWithRpcPromise(_0x4d9c('0x79'),_0x4d9c('0x79'),{'event':_0x4d9c('0x81'),'message':_0x34d0bd[_0x4d9c('0x30')]},client9002);return _0x4de485;}return null;})[_0x4d9c('0x27')](respondWithResult(_0xeb6843,null))[_0x4d9c('0x5b')](handleError(_0xeb6843,null));};exports[_0x4d9c('0x33')]=function(_0x43756a,_0xdc188f,_0x1acde4){if(_0x43756a[_0x4d9c('0x5f')]['id']){delete _0x43756a['body']['id'];}var _0x2386be;return db[_0x4d9c('0x42')][_0x4d9c('0x60')]({'where':{'id':_0x43756a[_0x4d9c('0x5c')]['id']}})[_0x4d9c('0x27')](handleEntityNotFound(_0xdc188f,null))[_0x4d9c('0x27')](function(_0x3483de){if(_0x3483de){_0x2386be=_0x3483de;return db['SmsAccount'][_0x4d9c('0x60')]({'where':{'id':_0x3483de[_0x4d9c('0x82')]}});}})[_0x4d9c('0x27')](handleEntityNotFound(_0xdc188f,null))[_0x4d9c('0x27')](function(_0x47c511){if(_0x47c511){logger[_0x4d9c('0x2a')](_0x4d9c('0x2b'),_0x4d9c('0x33'),_0x4d9c('0x83'),_0x47c511[_0x4d9c('0x44')],util[_0x4d9c('0x84')](_0x43756a[_0x4d9c('0x5f')],{'showHidden':![],'depth':null}));switch(_0x47c511['type']){case _0x4d9c('0x85'):if(_0x43756a[_0x4d9c('0x5f')][_0x4d9c('0x86')]&&_0x43756a[_0x4d9c('0x5f')][_0x4d9c('0x86')]===_0x2386be[_0x4d9c('0x87')]){return _0x2386be[_0x4d9c('0x3d')]({'read':!![]});}else{logger['error'](_0x4d9c('0x88'),'status',_0x4d9c('0x85'),util[_0x4d9c('0x84')](_0x43756a[_0x4d9c('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x4d9c('0x89'):if(_0x43756a['body'][_0x4d9c('0x8a')]&&_0x43756a[_0x4d9c('0x5f')]['MessageUUID']===_0x2386be[_0x4d9c('0x87')]&&_['indexOf']([_0x4d9c('0x8b'),'delivered'],_0x43756a[_0x4d9c('0x5f')][_0x4d9c('0x8c')])>=0x0){return _0x2386be['update']({'read':!![]});}else{logger[_0x4d9c('0x2e')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4d9c('0x33'),_0x4d9c('0x8d'),util[_0x4d9c('0x84')](_0x43756a[_0x4d9c('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x4d9c('0x8e'):var _0x4b2a32=_0x43756a[_0x4d9c('0x5f')]['results'][0x0];if(_0x4b2a32['status'][_0x4d9c('0x8f')]===_0x4d9c('0x90')){return _0x2386be[_0x4d9c('0x3d')]({'read':!![]});}else{logger['error'](_0x4d9c('0x88'),_0x4d9c('0x33'),_0x4d9c('0x8e'),util[_0x4d9c('0x84')](_0x43756a[_0x4d9c('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x2386be;}})[_0x4d9c('0x27')](respondWithResult(_0xdc188f,null))[_0x4d9c('0x5b')](handleError(_0xdc188f,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index edf859c..84e7ae1 100644 --- a/server/api/smsMessage/smsMessage.events.js +++ b/server/api/smsMessage/smsMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d85=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','update'];(function(_0xb5647a,_0xc3f31){var _0x5088ab=function(_0x1caccd){while(--_0x1caccd){_0xb5647a['push'](_0xb5647a['shift']());}};_0x5088ab(++_0xc3f31);}(_0x8d85,0x18b));var _0x58d8=function(_0x18b5e0,_0x3e4c04){_0x18b5e0=_0x18b5e0-0x0;var _0x1862a1=_0x8d85[_0x18b5e0];return _0x1862a1;};'use strict';var EventEmitter=require(_0x58d8('0x0'));var SmsMessage=require(_0x58d8('0x1'))['db'][_0x58d8('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x58d8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x58d8('0x4'),'afterDestroy':_0x58d8('0x5')};function emitEvent(_0x1f10a5){return function(_0x134c5a,_0x13a16c,_0x9c4e2d){SmsMessageEvents[_0x58d8('0x6')](_0x1f10a5+':'+_0x134c5a['id'],_0x134c5a);SmsMessageEvents['emit'](_0x1f10a5,_0x134c5a);_0x9c4e2d(null);};}for(var e in events){if(events[_0x58d8('0x7')](e)){var event=events[e];SmsMessage[_0x58d8('0x8')](e,emitEvent(event));}}module[_0x58d8('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x9440=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x27605a,_0x2a9552){var _0x15ba14=function(_0x5dc7d9){while(--_0x5dc7d9){_0x27605a['push'](_0x27605a['shift']());}};_0x15ba14(++_0x2a9552);}(_0x9440,0x1d2));var _0x0944=function(_0x3ab2e9,_0x3ac015){_0x3ab2e9=_0x3ab2e9-0x0;var _0x26a52a=_0x9440[_0x3ab2e9];return _0x26a52a;};'use strict';var EventEmitter=require(_0x0944('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0944('0x1')](0x0);var events={'afterCreate':_0x0944('0x2'),'afterUpdate':_0x0944('0x3'),'afterDestroy':_0x0944('0x4')};function emitEvent(_0x5e75d0){return function(_0x25a401,_0x403fb7,_0x55c088){SmsMessageEvents[_0x0944('0x5')](_0x5e75d0+':'+_0x25a401['id'],_0x25a401);SmsMessageEvents[_0x0944('0x5')](_0x5e75d0,_0x25a401);_0x55c088(null);};}for(var e in events){if(events[_0x0944('0x6')](e)){var event=events[e];SmsMessage[_0x0944('0x7')](e,emitEvent(event));}}module[_0x0944('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 4027bb8..931e249 100644 --- a/server/api/smsMessage/smsMessage.model.js +++ b/server/api/smsMessage/smsMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dfc=['senderString','POST','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','queued_count','head','data','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','apiKey','login','timestamp','keys','sort','length','md5','digest','hex','GET','/external/get/send.php?','id_sms','csc','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','body','FULLTEXT','get','toLowerCase','direction','out','UserId','findOne','then','createdAt','catch','error','secret','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','phone','remote','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','split','sms','user_key','session_key','total_sent','internal_order_id','read','update','Missing\x20parameters:\x20username,\x20password','connectel'];(function(_0x52aff0,_0x362c31){var _0x309139=function(_0x5227f9){while(--_0x5227f9){_0x52aff0['push'](_0x52aff0['shift']());}};_0x309139(++_0x362c31);}(_0x6dfc,0x120));var _0xc6df=function(_0x4340e3,_0x364066){_0x4340e3=_0x4340e3-0x0;var _0xf5ff55=_0x6dfc[_0x4340e3];return _0xf5ff55;};'use strict';var _=require('lodash');var util=require(_0xc6df('0x0'));var logger=require('../../config/logger')(_0xc6df('0x1'));var moment=require(_0xc6df('0x2'));var BPromise=require(_0xc6df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6df('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc6df('0x5'));module[_0xc6df('0x6')]=function(_0x527545,_0x50fca1){return _0x527545['define'](_0xc6df('0x7'),attributes,{'tableName':_0xc6df('0x8'),'paranoid':![],'indexes':[{'name':_0xc6df('0x9'),'fields':[_0xc6df('0x9')]},{'name':'fti_sms_messages','fields':[_0xc6df('0xa')],'type':_0xc6df('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17c509,_0xf8870d,_0x553de9){var _0x5536d5=_0x527545['models'];var _0x3bde85=_0x17c509[_0xc6df('0xc')]({'plain':!![]});if(_0x3bde85['direction'][_0xc6df('0xd')]()==='in'||_0x3bde85[_0xc6df('0xe')]['toLowerCase']()===_0xc6df('0xf')&&!_0x3bde85['secret']&&!_['isNil'](_0x3bde85[_0xc6df('0x10')])){_0x5536d5['SmsInteraction'][_0xc6df('0x11')]({'where':{'id':_0x3bde85['SmsInteractionId']}})[_0xc6df('0x12')](function(_0x12942c){if(_0x12942c){_0x12942c['update']({'lastMsgAt':_0x3bde85[_0xc6df('0x13')],'lastMsgDirection':_0x3bde85[_0xc6df('0xe')][_0xc6df('0xd')]()});}})[_0xc6df('0x14')](function(_0x553491){console[_0xc6df('0x15')](_0x553491);});}if(_0x3bde85[_0xc6df('0xe')]===_0xc6df('0xf')&&!_0x3bde85[_0xc6df('0x16')]){var _0x399003;_0x5536d5[_0xc6df('0x17')]['find']({'where':{'id':_0x3bde85[_0xc6df('0x18')]},'raw':!![]})[_0xc6df('0x12')](function(_0x540188){_0x399003=_0x540188;if(_0x399003&&_0x399003[_0xc6df('0x19')]){switch(_0x399003[_0xc6df('0x19')]){case _0xc6df('0x1a'):var _0x15869c=require('twilio');if(_0x399003[_0xc6df('0x1b')]&&_0x399003[_0xc6df('0x1c')]&&_0x399003['phone']){var _0x1561f0=new _0x15869c(_0x399003[_0xc6df('0x1b')],_0x399003[_0xc6df('0x1c')]);_0x1561f0[_0xc6df('0x1d')]['create']({'body':_0x3bde85['body'],'to':_0x3bde85[_0xc6df('0x1e')],'from':_0x399003['phone'],'statusCallback':_0x399003[_0xc6df('0x1f')]+'/api/sms/messages/'+_0x3bde85['id']+'/status?token='+_0x399003[_0xc6df('0x20')]})['then'](function(_0x16a0df){if(_0x16a0df[_0xc6df('0x21')]){return _0x17c509['update']({'messageId':_0x16a0df['sid']});}})[_0xc6df('0x14')](function(_0x5ec181){logger[_0xc6df('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc6df('0x22'),_0xc6df('0x1a'),util[_0xc6df('0x23')](_0x5ec181,{'showHidden':![],'depth':null}));});}else{logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x1a'),_0xc6df('0x25'));}break;case _0xc6df('0x26'):var _0xb50312='https://api.skebby.it/API/v1.0/REST/';if(_0x399003[_0xc6df('0x27')]&&_0x399003[_0xc6df('0x28')]){var _0x3d81a6={'recipient':[_0x3bde85[_0xc6df('0x1e')]],'message':_0x3bde85[_0xc6df('0xa')],'message_type':_0x399003[_0xc6df('0x29')]};if(_0x399003[_0xc6df('0x29')]&&_0x399003[_0xc6df('0x29')]!=='SI'){_0x3d81a6[_0xc6df('0x2a')]=_0x399003[_0xc6df('0x1e')];}var _0xaf397c={'url':_0xb50312+_0xc6df('0x2b')+_0x399003[_0xc6df('0x27')]+'&password='+_0x399003['password'],'method':'GET'};rp(_0xaf397c)[_0xc6df('0x12')](function(_0x1a4b0f){var _0x343928=_0x1a4b0f[_0xc6df('0x2c')](';');var _0x316450={'user_key':_0x343928[0x0],'session_key':_0x343928[0x1]};_0xaf397c={'url':_0xb50312+_0xc6df('0x2d'),'method':'POST','headers':{'user_key':_0x316450[_0xc6df('0x2e')],'Session_key':_0x316450[_0xc6df('0x2f')]},'json':!![],'body':_0x3d81a6};return rp(_0xaf397c);})[_0xc6df('0x12')](function(_0x59938e){if(_0x59938e[_0xc6df('0x30')]>=0x1){var _0x2f3956={'messageId':_0x59938e[_0xc6df('0x31')]};if(_0x399003['smsMethod']!=='GP'||!_0x399003['deliveryReport']){_0x2f3956[_0xc6df('0x32')]=!![];}return _0x17c509[_0xc6df('0x33')](_0x2f3956);}else{return logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),'skebby',util[_0xc6df('0x23')](_0x59938e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1f320b){return logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x26'),util['inspect'](_0x1f320b,{'showHidden':![],'depth':null}));});}else{logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),'skebby',_0xc6df('0x34'));}break;case _0xc6df('0x35'):if(_0x399003['authToken']){var _0x4cfeed={'recipient':_0x3bde85[_0xc6df('0x1e')],'message':_0x3bde85[_0xc6df('0xa')],'sender':_0x399003[_0xc6df('0x36')]||_0x399003[_0xc6df('0x1e')],'authorization':_0x399003[_0xc6df('0x1c')]};var _0xf8870d={'method':_0xc6df('0x37'),'uri':_0xc6df('0x38'),'body':_0x4cfeed,'json':!![]};rp(_0xf8870d)['then'](function(_0x1cc820){var _0x5b59a9={'messageId':_0x1cc820[_0xc6df('0x39')]};if(!_0x399003[_0xc6df('0x3a')]){_0x5b59a9[_0xc6df('0x32')]=!![];}return _0x17c509[_0xc6df('0x33')](_0x5b59a9);})[_0xc6df('0x14')](function(_0x2d4f6d){logger[_0xc6df('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc6df('0x35'),util['inspect'](_0x2d4f6d,{'showHidden':![],'depth':null}));});}else{logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x35'),_0xc6df('0x3b'));}break;case _0xc6df('0x3c'):if(_0x399003['username']&&_0x399003[_0xc6df('0x28')]){var _0x4cfeed={'messages':[{'source':_0xc6df('0x3d'),'to':_0x3bde85[_0xc6df('0x1e')],'body':_0x3bde85[_0xc6df('0xa')],'from':_0x399003[_0xc6df('0x36')]||_0x399003[_0xc6df('0x1e')]}]};var _0x3e17da=util[_0xc6df('0x3e')](_0xc6df('0x3f'),_0x399003['username'],_0x399003[_0xc6df('0x28')]);var _0xf8870d={'method':_0xc6df('0x37'),'uri':_0xc6df('0x40'),'body':_0x4cfeed,'headers':{'Authorization':util[_0xc6df('0x3e')](_0xc6df('0x41'),new Buffer(_0x3e17da)[_0xc6df('0x42')]('base64'))},'json':!![]};rp(_0xf8870d)[_0xc6df('0x12')](function(_0x4c1c4f){if(_0x4c1c4f[_0xc6df('0x43')]>=0xc8&&_0x4c1c4f[_0xc6df('0x43')]<=0xce){if(_0x4c1c4f['data']&&_0x4c1c4f['data'][_0xc6df('0x44')]>0x0){var _0x3c2d13=_[_0xc6df('0x45')](_0x4c1c4f[_0xc6df('0x46')][_0xc6df('0x1d')]);var _0x4b1948={'messageId':_0x3c2d13[_0xc6df('0x47')]};if(!_0x399003[_0xc6df('0x3a')]){_0x4b1948[_0xc6df('0x32')]=!![];}return _0x17c509['update'](_0x4b1948);}else{logger['error'](_0xc6df('0x24'),'afterCreate',_0xc6df('0x48'),util[_0xc6df('0x23')](_0x4c1c4f,{'showHidden':![],'depth':null}));}}else{logger[_0xc6df('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc6df('0x22'),_0xc6df('0x48'),util['inspect'](_0x4c1c4f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x23843f){logger['error'](_0xc6df('0x24'),'afterCreate',_0xc6df('0x48'),util[_0xc6df('0x23')](_0x23843f,{'showHidden':![],'depth':null}));});}else{logger[_0xc6df('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc6df('0x22'),_0xc6df('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc6df('0x49'):if(_0x399003[_0xc6df('0x4a')]&&_0x399003[_0xc6df('0x1c')]){var _0x4cfeed={'dst':_0x3bde85[_0xc6df('0x1e')],'text':_0x3bde85[_0xc6df('0xa')],'src':_0x399003['senderString']||_0x399003[_0xc6df('0x1e')],'url':_0x399003['remote']+'/api/sms/messages/'+_0x3bde85['id']+'/status?token='+_0x399003[_0xc6df('0x20')]};var _0x3e17da=util[_0xc6df('0x3e')]('%s:%s',_0x399003[_0xc6df('0x4a')],_0x399003[_0xc6df('0x1c')]);var _0xf8870d={'method':_0xc6df('0x37'),'uri':util[_0xc6df('0x3e')](_0xc6df('0x4b'),_0x399003[_0xc6df('0x4a')]),'body':_0x4cfeed,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x3e17da)['toString'](_0xc6df('0x4c')))},'json':!![]};rp(_0xf8870d)[_0xc6df('0x12')](function(_0x2d5c61){var _0x42ebe8={'messageId':_0x2d5c61[_0xc6df('0x4d')][0x0]};return _0x17c509[_0xc6df('0x33')](_0x42ebe8);})['catch'](function(_0x1d0244){logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),'plivo',util['inspect'](_0x1d0244,{'showHidden':![],'depth':null}));});}else{logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x49'),_0xc6df('0x4e'));}break;case'infobip':if(_0x399003[_0xc6df('0x27')]&&_0x399003[_0xc6df('0x28')]){if(_0x399003[_0xc6df('0x4f')]){var _0x4d50de={'method':_0xc6df('0x37'),'uri':_0x399003[_0xc6df('0x4f')]+_0xc6df('0x50'),'body':{'username':_0x399003['username'],'password':_0x399003['password']},'json':!![]};return rp(_0x4d50de)[_0xc6df('0x12')](function(_0x340b50){var _0x14d32d={'method':'POST','uri':_0x399003[_0xc6df('0x4f')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x399003[_0xc6df('0x1e')],'destinations':[{'to':_0x3bde85[_0xc6df('0x1e')]}],'text':_0x3bde85['body'],'notifyUrl':_0x399003[_0xc6df('0x1f')]+'/api/sms/messages/'+_0x3bde85['id']+'/status?token='+_0x399003[_0xc6df('0x20')],'notifyContentType':_0xc6df('0x51'),'callbackData':_0x399003['phone']+';'+_0x3bde85[_0xc6df('0xa')]}]},'headers':{'Authorization':_0xc6df('0x52')+_0x340b50[_0xc6df('0x20')]},'json':!![]};return rp(_0x14d32d)[_0xc6df('0x12')](function(_0xc18e58){if(_0xc18e58['messages']){var _0x4a92b0={'messageId':_0xc18e58[_0xc6df('0x1d')][0x0][_0xc6df('0x9')]};if(!_0x399003[_0xc6df('0x3a')]){_0x4a92b0[_0xc6df('0x32')]=!![];}return _0x17c509[_0xc6df('0x33')](_0x4a92b0);}else{return logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x53'),util['inspect'](_0xc18e58,{'showHidden':![],'depth':null}));}});})[_0xc6df('0x14')](function(_0x3b31b8){return logger[_0xc6df('0x15')](_0xc6df('0x24'),'afterCreate',_0xc6df('0x53'),util['inspect'](_0x3b31b8,{'showHidden':![],'depth':null}));});}else{logger[_0xc6df('0x15')](_0xc6df('0x24'),'afterCreate',_0xc6df('0x53'),_0xc6df('0x54'));}}else{logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),'infobip',_0xc6df('0x34'));}break;case'csc':var _0x1890b3=require('crypto');if(_0x399003[_0xc6df('0x55')]){var _0x1c98c6={};_0x1c98c6[_0xc6df('0x56')]=_0x399003[_0xc6df('0x27')];_0x1c98c6[_0xc6df('0x1e')]=_0x3bde85[_0xc6df('0x1e')];_0x1c98c6[_0xc6df('0x2a')]=_0x399003[_0xc6df('0x1e')];_0x1c98c6['text']=_0x3bde85[_0xc6df('0xa')];_0x1c98c6[_0xc6df('0x57')]=+new Date();var _0x27c0ff='';var _0xf475b3='';var _0x1887fe=Object[_0xc6df('0x58')](_0x1c98c6);_0x1887fe[_0xc6df('0x59')]();for(var _0x19141d=0x0;_0x19141d<_0x1887fe[_0xc6df('0x5a')];_0x19141d++){if(_0x27c0ff!=''){_0x27c0ff+='&';}_0x27c0ff+=_0x1887fe[_0x19141d]+'='+encodeURIComponent(_0x1c98c6[_0x1887fe[_0x19141d]]);_0xf475b3+=_0x1c98c6[_0x1887fe[_0x19141d]];}_0xf475b3+=_0x399003['apiKey'];_0xf475b3=_0x1890b3['createHash'](_0xc6df('0x5b'))[_0xc6df('0x33')](_0xf475b3)[_0xc6df('0x5c')](_0xc6df('0x5d'));if(_0x27c0ff!==''){_0x27c0ff+='&';}_0x27c0ff+='signature='+_0xf475b3;var _0xaf397c={'method':_0xc6df('0x5e'),'uri':_0x399003['baseUrl']+_0xc6df('0x5f')+_0x27c0ff,'json':!![]};return rp(_0xaf397c)[_0xc6df('0x12')](function(_0x2d3942){var _0x2d3d8f=Object['keys'](_0x2d3942);if(_0x2d3942[_0x2d3d8f[0x0]][_0xc6df('0x15')]&&parseInt(_0x2d3942[_0x2d3d8f[0x0]][_0xc6df('0x15')])===0x0){var _0xd58ec8={'messageId':_0x2d3942[_0x2d3d8f[0x0]][_0xc6df('0x60')]};if(!_0x399003[_0xc6df('0x3a')]){_0xd58ec8[_0xc6df('0x32')]=!![];}return _0x17c509[_0xc6df('0x33')](_0xd58ec8);}else{return logger[_0xc6df('0x15')](_0xc6df('0x24'),'afterCreate',_0xc6df('0x61'),util[_0xc6df('0x23')](_0x2d3942[_0xc6df('0x15')],{'showHidden':![],'depth':null}));}})[_0xc6df('0x14')](function(_0x3cb226){return logger['error'](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x61'),util[_0xc6df('0x23')](_0x3cb226,{'showHidden':![],'depth':null}));});}else{logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x61'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x399003[_0xc6df('0x55')]){var _0x2eab91={'method':_0xc6df('0x37'),'uri':_0xc6df('0x62'),'headers':{'Authorization':_0x399003[_0xc6df('0x55')]},'body':{'content':_0x3bde85[_0xc6df('0xa')],'to':[_0x3bde85[_0xc6df('0x1e')]],'from':_0x399003[_0xc6df('0x1e')],'binary':![],'clientMessageId':_0xc6df('0x63'),'charset':_0xc6df('0x64')},'json':!![]};rp(_0x2eab91)['then'](function(_0x3f3f6e){if(!_0x3f3f6e[_0xc6df('0x15')]){var _0x1c6efc={'messageId':_0x3f3f6e[_0xc6df('0x1d')][0x0][_0xc6df('0x65')]};if(!_0x399003['deliveryReport']){_0x1c6efc['read']=!![];}return _0x17c509[_0xc6df('0x33')](_0x1c6efc);}else{return logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x66'),util[_0xc6df('0x23')](_0x3f3f6e[_0xc6df('0x15')],{'showHidden':![],'depth':null}));}})[_0xc6df('0x14')](function(_0xb6c7e3){return logger[_0xc6df('0x15')](_0xc6df('0x24'),_0xc6df('0x22'),_0xc6df('0x66'),util[_0xc6df('0x23')](_0xb6c7e3,{'showHidden':![],'depth':null}));});}else{logger[_0xc6df('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc6df('0x22'),_0xc6df('0x66'),_0xc6df('0x67'));}break;case _0xc6df('0x68'):if(_0x399003[_0xc6df('0x55')]){var _0x1229fe={};var _0xaf397c={'method':'POST','uri':_0xc6df('0x69'),'headers':{'Authorization':_0xc6df('0x6a')+_0x399003[_0xc6df('0x55')],'Content-Type':'application/json'},'body':{'from':_0x399003[_0xc6df('0x1e')],'to':_0x3bde85[_0xc6df('0x1e')],'text':_0x3bde85[_0xc6df('0xa')]},'json':!![]};return rp(_0xaf397c)['then'](function(_0x9733af){if(_0x9733af['code']==0xca){_0x1229fe[_0xc6df('0x6b')]=_0x9733af;var _0x45848c={'method':'POST','uri':_0xc6df('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x399003[_0xc6df('0x55')],'Content-Type':_0xc6df('0x51')},'body':{'refid':_0x1229fe[_0xc6df('0x6b')][_0xc6df('0x6d')]},'json':!![]};return rp(_0x45848c)[_0xc6df('0x12')](function(_0x47cdce){_0x1229fe[_0xc6df('0x6e')]=_0x47cdce;var _0x50d3fd={'messageId':_0x1229fe[_0xc6df('0x6b')]['refid'],'read':!![]};return _0x17c509[_0xc6df('0x33')](_0x50d3fd);});}else{return logger['error'](_0xc6df('0x24'),'afterCreate',_0xc6df('0x68'),util[_0xc6df('0x23')](_0x9733af,{'showHidden':![],'depth':null}));}})['catch'](function(_0x40b3e3){return logger[_0xc6df('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc6df('0x22'),'intelepeer',util['inspect'](_0x40b3e3,{'showHidden':![],'depth':null}));});}else{return logger[_0xc6df('0x15')](_0xc6df('0x24'),'afterCreate',_0xc6df('0x68'),_0xc6df('0x6f'));}break;}}})['finally'](function(){_0x553de9();});}else{_0x553de9();}}},'charset':_0xc6df('0x70'),'collate':_0xc6df('0x71')});}; \ No newline at end of file +var _0x2f24=['POST','user_key','session_key','internal_order_id','deliveryReport','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/send/','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','base64','http_code','data','head','messages','clickSend','plivo','token','%s:%s','authId','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','crypto','apiKey','text','keys','length','createHash','md5','digest','hex','GET','/external/get/send.php?','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','Missing\x20parameters:\x20apiKey','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','sms_messages','messageId','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','find','SmsAccountId','type','twilio','authToken','create','body','remote','/api/sms/messages/','/status?token=','update','sid','catch','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','phone','smsMethod','sender','&password=','split','sms'];(function(_0x2efb1a,_0x17b645){var _0x5cf9a9=function(_0x3bff68){while(--_0x3bff68){_0x2efb1a['push'](_0x2efb1a['shift']());}};_0x5cf9a9(++_0x17b645);}(_0x2f24,0x115));var _0x42f2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x2f24[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x42f2('0x0'));var util=require(_0x42f2('0x1'));var logger=require(_0x42f2('0x2'))(_0x42f2('0x3'));var moment=require(_0x42f2('0x4'));var BPromise=require(_0x42f2('0x5'));var rp=require(_0x42f2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42f2('0x7'));var config=require(_0x42f2('0x8'));var attributes=require(_0x42f2('0x9'));module[_0x42f2('0xa')]=function(_0x440903,_0x27a2a7){return _0x440903['define']('SmsMessage',attributes,{'tableName':_0x42f2('0xb'),'paranoid':![],'indexes':[{'name':_0x42f2('0xc'),'fields':[_0x42f2('0xc')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x42f2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x93cef8,_0x251f8f,_0x3e44a7){var _0x13bef0=_0x440903[_0x42f2('0xe')];var _0x300d44=_0x93cef8['get']({'plain':!![]});if(_0x300d44['direction'][_0x42f2('0xf')]()==='in'||_0x300d44[_0x42f2('0x10')][_0x42f2('0xf')]()===_0x42f2('0x11')&&!_0x300d44[_0x42f2('0x12')]&&!_[_0x42f2('0x13')](_0x300d44[_0x42f2('0x14')])){_0x13bef0[_0x42f2('0x15')]['findOne']({'where':{'id':_0x300d44[_0x42f2('0x16')]}})[_0x42f2('0x17')](function(_0x2efc90){if(_0x2efc90){_0x2efc90['update']({'lastMsgAt':_0x300d44['createdAt'],'lastMsgDirection':_0x300d44['direction'][_0x42f2('0xf')]()});}})['catch'](function(_0x117f04){console['error'](_0x117f04);});}if(_0x300d44[_0x42f2('0x10')]===_0x42f2('0x11')&&!_0x300d44['secret']){var _0x56b401;_0x13bef0['SmsAccount'][_0x42f2('0x18')]({'where':{'id':_0x300d44[_0x42f2('0x19')]},'raw':!![]})[_0x42f2('0x17')](function(_0x27ed39){_0x56b401=_0x27ed39;if(_0x56b401&&_0x56b401['type']){switch(_0x56b401[_0x42f2('0x1a')]){case _0x42f2('0x1b'):var _0x30c7ec=require(_0x42f2('0x1b'));if(_0x56b401['accountSid']&&_0x56b401['authToken']&&_0x56b401['phone']){var _0x136641=new _0x30c7ec(_0x56b401['accountSid'],_0x56b401[_0x42f2('0x1c')]);_0x136641['messages'][_0x42f2('0x1d')]({'body':_0x300d44[_0x42f2('0x1e')],'to':_0x300d44['phone'],'from':_0x56b401['phone'],'statusCallback':_0x56b401[_0x42f2('0x1f')]+_0x42f2('0x20')+_0x300d44['id']+_0x42f2('0x21')+_0x56b401['token']})[_0x42f2('0x17')](function(_0x310668){if(_0x310668['sid']){return _0x93cef8[_0x42f2('0x22')]({'messageId':_0x310668[_0x42f2('0x23')]});}})[_0x42f2('0x24')](function(_0x439542){logger[_0x42f2('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x42f2('0x1b'),util['inspect'](_0x439542,{'showHidden':![],'depth':null}));});}else{logger[_0x42f2('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x42f2('0x1b'),_0x42f2('0x26'));}break;case'skebby':var _0x25a314='https://api.skebby.it/API/v1.0/REST/';if(_0x56b401[_0x42f2('0x27')]&&_0x56b401[_0x42f2('0x28')]){var _0x50dd6c={'recipient':[_0x300d44[_0x42f2('0x29')]],'message':_0x300d44[_0x42f2('0x1e')],'message_type':_0x56b401['smsMethod']};if(_0x56b401['smsMethod']&&_0x56b401[_0x42f2('0x2a')]!=='SI'){_0x50dd6c[_0x42f2('0x2b')]=_0x56b401[_0x42f2('0x29')];}var _0x47bebf={'url':_0x25a314+'login?username='+_0x56b401['username']+_0x42f2('0x2c')+_0x56b401['password'],'method':'GET'};rp(_0x47bebf)[_0x42f2('0x17')](function(_0x33b286){var _0x118729=_0x33b286[_0x42f2('0x2d')](';');var _0x5d5520={'user_key':_0x118729[0x0],'session_key':_0x118729[0x1]};_0x47bebf={'url':_0x25a314+_0x42f2('0x2e'),'method':_0x42f2('0x2f'),'headers':{'user_key':_0x5d5520[_0x42f2('0x30')],'Session_key':_0x5d5520[_0x42f2('0x31')]},'json':!![],'body':_0x50dd6c};return rp(_0x47bebf);})[_0x42f2('0x17')](function(_0x1560d0){if(_0x1560d0['total_sent']>=0x1){var _0x288c02={'messageId':_0x1560d0[_0x42f2('0x32')]};if(_0x56b401[_0x42f2('0x2a')]!=='GP'||!_0x56b401[_0x42f2('0x33')]){_0x288c02['read']=!![];}return _0x93cef8[_0x42f2('0x22')](_0x288c02);}else{return logger[_0x42f2('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42f2('0x34'),'skebby',util[_0x42f2('0x35')](_0x1560d0,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3b1299){return logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),_0x42f2('0x37'),util[_0x42f2('0x35')](_0x3b1299,{'showHidden':![],'depth':null}));});}else{logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),_0x42f2('0x37'),_0x42f2('0x38'));}break;case _0x42f2('0x39'):if(_0x56b401[_0x42f2('0x1c')]){var _0x1528c9={'recipient':_0x300d44[_0x42f2('0x29')],'message':_0x300d44[_0x42f2('0x1e')],'sender':_0x56b401['senderString']||_0x56b401[_0x42f2('0x29')],'authorization':_0x56b401[_0x42f2('0x1c')]};var _0x251f8f={'method':_0x42f2('0x2f'),'uri':_0x42f2('0x3a'),'body':_0x1528c9,'json':!![]};rp(_0x251f8f)['then'](function(_0x57ea9b){var _0x5cc6c2={'messageId':_0x57ea9b['requestid']};if(!_0x56b401[_0x42f2('0x33')]){_0x5cc6c2[_0x42f2('0x3b')]=!![];}return _0x93cef8[_0x42f2('0x22')](_0x5cc6c2);})['catch'](function(_0x43f85b){logger[_0x42f2('0x25')](_0x42f2('0x36'),'afterCreate',_0x42f2('0x39'),util[_0x42f2('0x35')](_0x43f85b,{'showHidden':![],'depth':null}));});}else{logger[_0x42f2('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42f2('0x34'),'connectel',_0x42f2('0x3c'));}break;case'clicksend':if(_0x56b401[_0x42f2('0x27')]&&_0x56b401['password']){var _0x1528c9={'messages':[{'source':_0x42f2('0x3d'),'to':_0x300d44[_0x42f2('0x29')],'body':_0x300d44[_0x42f2('0x1e')],'from':_0x56b401['senderString']||_0x56b401[_0x42f2('0x29')]}]};var _0x151a5d=util[_0x42f2('0x3e')]('%s:%s',_0x56b401[_0x42f2('0x27')],_0x56b401[_0x42f2('0x28')]);var _0x251f8f={'method':_0x42f2('0x2f'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1528c9,'headers':{'Authorization':util[_0x42f2('0x3e')]('Basic\x20%s',new Buffer(_0x151a5d)['toString'](_0x42f2('0x3f')))},'json':!![]};rp(_0x251f8f)['then'](function(_0x110ff1){if(_0x110ff1[_0x42f2('0x40')]>=0xc8&&_0x110ff1[_0x42f2('0x40')]<=0xce){if(_0x110ff1[_0x42f2('0x41')]&&_0x110ff1['data']['queued_count']>0x0){var _0x87f84b=_[_0x42f2('0x42')](_0x110ff1['data'][_0x42f2('0x43')]);var _0x5d08af={'messageId':_0x87f84b['message_id']};if(!_0x56b401[_0x42f2('0x33')]){_0x5d08af['read']=!![];}return _0x93cef8[_0x42f2('0x22')](_0x5d08af);}else{logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),_0x42f2('0x44'),util[_0x42f2('0x35')](_0x110ff1,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42f2('0x34'),_0x42f2('0x44'),util[_0x42f2('0x35')](_0x110ff1,{'showHidden':![],'depth':null}));}})[_0x42f2('0x24')](function(_0x375502){logger[_0x42f2('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42f2('0x34'),'clickSend',util[_0x42f2('0x35')](_0x375502,{'showHidden':![],'depth':null}));});}else{logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),'clickSend',_0x42f2('0x38'));}break;case _0x42f2('0x45'):if(_0x56b401['authId']&&_0x56b401[_0x42f2('0x1c')]){var _0x1528c9={'dst':_0x300d44[_0x42f2('0x29')],'text':_0x300d44[_0x42f2('0x1e')],'src':_0x56b401['senderString']||_0x56b401['phone'],'url':_0x56b401[_0x42f2('0x1f')]+'/api/sms/messages/'+_0x300d44['id']+_0x42f2('0x21')+_0x56b401[_0x42f2('0x46')]};var _0x151a5d=util['format'](_0x42f2('0x47'),_0x56b401[_0x42f2('0x48')],_0x56b401[_0x42f2('0x1c')]);var _0x251f8f={'method':_0x42f2('0x2f'),'uri':util[_0x42f2('0x3e')]('https://api.plivo.com/v1/Account/%s/Message/',_0x56b401[_0x42f2('0x48')]),'body':_0x1528c9,'headers':{'Authorization':util[_0x42f2('0x3e')](_0x42f2('0x49'),new Buffer(_0x151a5d)['toString'](_0x42f2('0x3f')))},'json':!![]};rp(_0x251f8f)['then'](function(_0x1532b7){var _0x463850={'messageId':_0x1532b7[_0x42f2('0x4a')][0x0]};return _0x93cef8[_0x42f2('0x22')](_0x463850);})[_0x42f2('0x24')](function(_0x3fa55f){logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),'plivo',util[_0x42f2('0x35')](_0x3fa55f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x42f2('0x36'),_0x42f2('0x34'),_0x42f2('0x45'),_0x42f2('0x4b'));}break;case _0x42f2('0x4c'):if(_0x56b401[_0x42f2('0x27')]&&_0x56b401[_0x42f2('0x28')]){if(_0x56b401[_0x42f2('0x4d')]){var _0x20325e={'method':_0x42f2('0x2f'),'uri':_0x56b401[_0x42f2('0x4d')]+_0x42f2('0x4e'),'body':{'username':_0x56b401['username'],'password':_0x56b401[_0x42f2('0x28')]},'json':!![]};return rp(_0x20325e)[_0x42f2('0x17')](function(_0x449503){var _0x33e0a5={'method':_0x42f2('0x2f'),'uri':_0x56b401[_0x42f2('0x4d')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x56b401['phone'],'destinations':[{'to':_0x300d44['phone']}],'text':_0x300d44[_0x42f2('0x1e')],'notifyUrl':_0x56b401['remote']+_0x42f2('0x20')+_0x300d44['id']+_0x42f2('0x21')+_0x56b401[_0x42f2('0x46')],'notifyContentType':_0x42f2('0x4f'),'callbackData':_0x56b401['phone']+';'+_0x300d44['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x449503['token']},'json':!![]};return rp(_0x33e0a5)[_0x42f2('0x17')](function(_0x1f0c02){if(_0x1f0c02[_0x42f2('0x43')]){var _0x289779={'messageId':_0x1f0c02[_0x42f2('0x43')][0x0][_0x42f2('0xc')]};if(!_0x56b401[_0x42f2('0x33')]){_0x289779[_0x42f2('0x3b')]=!![];}return _0x93cef8['update'](_0x289779);}else{return logger[_0x42f2('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42f2('0x34'),_0x42f2('0x4c'),util[_0x42f2('0x35')](_0x1f0c02,{'showHidden':![],'depth':null}));}});})[_0x42f2('0x24')](function(_0x2bd59b){return logger[_0x42f2('0x25')](_0x42f2('0x36'),'afterCreate',_0x42f2('0x4c'),util['inspect'](_0x2bd59b,{'showHidden':![],'depth':null}));});}else{logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),'infobip',_0x42f2('0x50'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42f2('0x34'),_0x42f2('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x2b7aa5=require(_0x42f2('0x51'));if(_0x56b401[_0x42f2('0x52')]){var _0x1887c3={};_0x1887c3['login']=_0x56b401[_0x42f2('0x27')];_0x1887c3[_0x42f2('0x29')]=_0x300d44[_0x42f2('0x29')];_0x1887c3[_0x42f2('0x2b')]=_0x56b401[_0x42f2('0x29')];_0x1887c3[_0x42f2('0x53')]=_0x300d44[_0x42f2('0x1e')];_0x1887c3['timestamp']=+new Date();var _0x13e03e='';var _0x26b0ef='';var _0x4fb08d=Object[_0x42f2('0x54')](_0x1887c3);_0x4fb08d['sort']();for(var _0x1fd300=0x0;_0x1fd300<_0x4fb08d[_0x42f2('0x55')];_0x1fd300++){if(_0x13e03e!=''){_0x13e03e+='&';}_0x13e03e+=_0x4fb08d[_0x1fd300]+'='+encodeURIComponent(_0x1887c3[_0x4fb08d[_0x1fd300]]);_0x26b0ef+=_0x1887c3[_0x4fb08d[_0x1fd300]];}_0x26b0ef+=_0x56b401[_0x42f2('0x52')];_0x26b0ef=_0x2b7aa5[_0x42f2('0x56')](_0x42f2('0x57'))[_0x42f2('0x22')](_0x26b0ef)[_0x42f2('0x58')](_0x42f2('0x59'));if(_0x13e03e!==''){_0x13e03e+='&';}_0x13e03e+='signature='+_0x26b0ef;var _0x47bebf={'method':_0x42f2('0x5a'),'uri':_0x56b401[_0x42f2('0x4d')]+_0x42f2('0x5b')+_0x13e03e,'json':!![]};return rp(_0x47bebf)[_0x42f2('0x17')](function(_0x55c4e0){var _0x333ccd=Object[_0x42f2('0x54')](_0x55c4e0);if(_0x55c4e0[_0x333ccd[0x0]]['error']&&parseInt(_0x55c4e0[_0x333ccd[0x0]][_0x42f2('0x25')])===0x0){var _0x38a1f7={'messageId':_0x55c4e0[_0x333ccd[0x0]]['id_sms']};if(!_0x56b401[_0x42f2('0x33')]){_0x38a1f7[_0x42f2('0x3b')]=!![];}return _0x93cef8['update'](_0x38a1f7);}else{return logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),_0x42f2('0x5c'),util[_0x42f2('0x35')](_0x55c4e0[_0x42f2('0x25')],{'showHidden':![],'depth':null}));}})[_0x42f2('0x24')](function(_0x4e4503){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42f2('0x34'),_0x42f2('0x5c'),util['inspect'](_0x4e4503,{'showHidden':![],'depth':null}));});}else{logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),_0x42f2('0x5c'),'Missing\x20parameters:\x20apiKey');}break;case _0x42f2('0x5d'):if(_0x56b401['apiKey']){var _0x41aee9={'method':_0x42f2('0x2f'),'uri':_0x42f2('0x5e'),'headers':{'Authorization':_0x56b401['apiKey']},'body':{'content':_0x300d44[_0x42f2('0x1e')],'to':[_0x300d44[_0x42f2('0x29')]],'from':_0x56b401[_0x42f2('0x29')],'binary':![],'clientMessageId':_0x42f2('0x5f'),'charset':_0x42f2('0x60')},'json':!![]};rp(_0x41aee9)[_0x42f2('0x17')](function(_0x456d44){if(!_0x456d44[_0x42f2('0x25')]){var _0x22dba6={'messageId':_0x456d44[_0x42f2('0x43')][0x0]['apiMessageId']};if(!_0x56b401[_0x42f2('0x33')]){_0x22dba6[_0x42f2('0x3b')]=!![];}return _0x93cef8['update'](_0x22dba6);}else{return logger['error'](_0x42f2('0x36'),_0x42f2('0x34'),'clickatell',util[_0x42f2('0x35')](_0x456d44['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2f0e58){return logger[_0x42f2('0x25')](_0x42f2('0x36'),'afterCreate','clickatell',util['inspect'](_0x2f0e58,{'showHidden':![],'depth':null}));});}else{logger[_0x42f2('0x25')](_0x42f2('0x36'),'afterCreate',_0x42f2('0x5d'),_0x42f2('0x61'));}break;case _0x42f2('0x62'):if(_0x56b401[_0x42f2('0x52')]){var _0x217532={};var _0x47bebf={'method':'POST','uri':_0x42f2('0x63'),'headers':{'Authorization':'Bearer\x20'+_0x56b401[_0x42f2('0x52')],'Content-Type':_0x42f2('0x4f')},'body':{'from':_0x56b401[_0x42f2('0x29')],'to':_0x300d44['phone'],'text':_0x300d44['body']},'json':!![]};return rp(_0x47bebf)[_0x42f2('0x17')](function(_0x364819){if(_0x364819[_0x42f2('0x64')]==0xca){_0x217532[_0x42f2('0x65')]=_0x364819;var _0x1c1bda={'method':_0x42f2('0x2f'),'uri':_0x42f2('0x66'),'headers':{'Authorization':_0x42f2('0x67')+_0x56b401[_0x42f2('0x52')],'Content-Type':_0x42f2('0x4f')},'body':{'refid':_0x217532['message'][_0x42f2('0x68')]},'json':!![]};return rp(_0x1c1bda)['then'](function(_0x4c33f4){_0x217532['status']=_0x4c33f4;var _0x18e8ad={'messageId':_0x217532[_0x42f2('0x65')]['refid'],'read':!![]};return _0x93cef8[_0x42f2('0x22')](_0x18e8ad);});}else{return logger[_0x42f2('0x25')](_0x42f2('0x36'),'afterCreate','intelepeer',util[_0x42f2('0x35')](_0x364819,{'showHidden':![],'depth':null}));}})[_0x42f2('0x24')](function(_0x5a146b){return logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),_0x42f2('0x62'),util[_0x42f2('0x35')](_0x5a146b,{'showHidden':![],'depth':null}));});}else{return logger[_0x42f2('0x25')](_0x42f2('0x36'),_0x42f2('0x34'),_0x42f2('0x62'),_0x42f2('0x69'));}break;}}})['finally'](function(){_0x3e44a7();});}else{_0x3e44a7();}}},'charset':_0x42f2('0x6a'),'collate':_0x42f2('0x6b')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 342a870..f2fe2b8 100644 --- a/server/api/smsMessage/smsMessage.rpc.js +++ b/server/api/smsMessage/smsMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['stringify','error','code','message','info','result','SmsMessage','create','body','options','raw','CreateSmsMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','then','SmsMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x324c39,_0x15c048){var _0x4a0661=function(_0x18303e){while(--_0x18303e){_0x324c39['push'](_0x324c39['shift']());}};_0x4a0661(++_0x15c048);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('SmsMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('SmsMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateSmsMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateSmsMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x66fa=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','request','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify'];(function(_0x2c1b01,_0x391fa3){var _0x27cd47=function(_0x58935e){while(--_0x58935e){_0x2c1b01['push'](_0x2c1b01['shift']());}};_0x27cd47(++_0x391fa3);}(_0x66fa,0x117));var _0xa66f=function(_0x187efb,_0xcaa75){_0x187efb=_0x187efb-0x0;var _0x4d72f9=_0x66fa[_0x187efb];return _0x4d72f9;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});config[_0xa66f('0xb')]=_[_0xa66f('0xc')](config[_0xa66f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0xd'))(new Redis(config['redis']));require(_0xa66f('0xe'))['register'](socket);function respondWithRpcPromise(_0x101e10,_0x53ca76,_0x52d802){return new BPromise(function(_0x55e6dc,_0x1e1997){return client[_0xa66f('0xf')](_0x101e10,_0x52d802)['then'](function(_0x14d31e){logger['info'](_0xa66f('0x10'),_0x53ca76,'request\x20sent');logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x53ca76,_0xa66f('0x13'),JSON['stringify'](_0x14d31e));if(_0x14d31e['error']){if(_0x14d31e[_0xa66f('0x14')]['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);return _0x1e1997(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}logger[_0xa66f('0x14')]('SmsMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e['error'][_0xa66f('0x15')]);return _0x55e6dc(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}else{logger[_0xa66f('0x16')]('SmsMessage,\x20%s,\x20%s',_0x53ca76,_0xa66f('0x13'));_0x55e6dc(_0x14d31e['result']['message']);}})[_0xa66f('0x17')](function(_0x413e80){logger[_0xa66f('0x14')](_0xa66f('0x10'),_0x53ca76,_0x413e80);_0x1e1997(_0x413e80);});});}exports[_0xa66f('0x18')]=function(_0x408bc7){var _0x251f60=this;return new Promise(function(_0x150291,_0x2033a4){return db[_0xa66f('0x19')][_0xa66f('0x1a')](_0x408bc7[_0xa66f('0x1b')],{'raw':_0x408bc7[_0xa66f('0x1c')]?_0x408bc7[_0xa66f('0x1c')][_0xa66f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x27f570){logger[_0xa66f('0x16')](_0xa66f('0x18'),_0x408bc7);logger[_0xa66f('0x11')]('CreateSmsMessage',_0x408bc7,JSON[_0xa66f('0x1e')](_0x27f570));_0x150291(_0x27f570);})[_0xa66f('0x17')](function(_0x209f4d){logger[_0xa66f('0x14')]('CreateSmsMessage',_0x209f4d['message'],_0x408bc7);_0x2033a4(_0x251f60[_0xa66f('0x14')](0x1f4,_0x209f4d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index eed4219..f9aa95b 100644 --- a/server/api/smsMessage/smsMessage.socket.js +++ b/server/api/smsMessage/smsMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3858=['save','remove','update','emit','removeListener','register','smsMessage:'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x3858,0x1b2));var _0x8385=function(_0x275d64,_0x5e97de){_0x275d64=_0x275d64-0x0;var _0x3ed547=_0x3858[_0x275d64];return _0x3ed547;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x8385('0x0'),_0x8385('0x1'),_0x8385('0x2')];function createListener(_0x4adf13,_0x199856){return function(_0x3564f5){_0x199856[_0x8385('0x3')](_0x4adf13,_0x3564f5);};}function removeListener(_0x208915,_0xfc7f9c){return function(){SmsMessageEvents[_0x8385('0x4')](_0x208915,_0xfc7f9c);};}exports[_0x8385('0x5')]=function(_0x362465){for(var _0x2881fa=0x0,_0x3ac953=events['length'];_0x2881fa<_0x3ac953;_0x2881fa++){var _0x461976=events[_0x2881fa];var _0x19961b=createListener(_0x8385('0x6')+_0x461976,_0x362465);SmsMessageEvents['on'](_0x461976,_0x19961b);}}; \ No newline at end of file +var _0xd45c=['smsMessage:','./smsMessage.events','save','remove','emit','removeListener','length'];(function(_0xe9db30,_0x18008c){var _0x3daac0=function(_0xb8983f){while(--_0xb8983f){_0xe9db30['push'](_0xe9db30['shift']());}};_0x3daac0(++_0x18008c);}(_0xd45c,0xcc));var _0xcd45=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd45c[_0x2c91e9];return _0x13f0ff;};'use strict';var SmsMessageEvents=require(_0xcd45('0x0'));var events=[_0xcd45('0x1'),_0xcd45('0x2'),'update'];function createListener(_0x89d139,_0x2c73f0){return function(_0x1dcd7a){_0x2c73f0[_0xcd45('0x3')](_0x89d139,_0x1dcd7a);};}function removeListener(_0x1a00eb,_0x1ef457){return function(){SmsMessageEvents[_0xcd45('0x4')](_0x1a00eb,_0x1ef457);};}exports['register']=function(_0x4124a1){for(var _0x5ef05c=0x0,_0xc8412c=events[_0xcd45('0x5')];_0x5ef05c<_0xc8412c;_0x5ef05c++){var _0x80d8c=events[_0x5ef05c];var _0x5937b1=createListener(_0xcd45('0x6')+_0x80d8c,_0x4124a1);SmsMessageEvents['on'](_0x80d8c,_0x5937b1);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9b3f1c6..95d0e3b 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9c3=['post','addAgents','put','delete','removeTeams','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x22d8f6,_0x2b43e2){var _0x87413a=function(_0x24a352){while(--_0x24a352){_0x22d8f6['push'](_0x22d8f6['shift']());}};_0x87413a(++_0x2b43e2);}(_0xc9c3,0x96));var _0x3c9c=function(_0x37bf81,_0x1d05d5){_0x37bf81=_0x37bf81-0x0;var _0x4ae635=_0xc9c3[_0x37bf81];return _0x4ae635;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3c9c('0x0'));var timeout=require('connect-timeout');var express=require(_0x3c9c('0x1'));var router=express[_0x3c9c('0x2')]();var auth=require(_0x3c9c('0x3'));var interaction=require(_0x3c9c('0x4'));var config=require(_0x3c9c('0x5'));var controller=require(_0x3c9c('0x6'));router[_0x3c9c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3c9c('0x8'),auth[_0x3c9c('0x9')](),controller[_0x3c9c('0xa')]);router[_0x3c9c('0x7')](_0x3c9c('0xb'),auth[_0x3c9c('0x9')](),controller[_0x3c9c('0xc')]);router[_0x3c9c('0x7')](_0x3c9c('0xd'),auth[_0x3c9c('0x9')](),controller['getMembers']);router[_0x3c9c('0x7')](_0x3c9c('0xe'),auth['isAuthenticated'](),controller[_0x3c9c('0xf')]);router['get'](_0x3c9c('0x10'),auth[_0x3c9c('0x9')](),controller[_0x3c9c('0x11')]);router[_0x3c9c('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3c9c('0xe'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x3c9c('0x10'),auth['isAuthenticated'](),controller[_0x3c9c('0x13')]);router[_0x3c9c('0x14')](_0x3c9c('0xb'),auth[_0x3c9c('0x9')](),controller['update']);router[_0x3c9c('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3c9c('0x15')](_0x3c9c('0xe'),auth[_0x3c9c('0x9')](),controller[_0x3c9c('0x16')]);router[_0x3c9c('0x15')](_0x3c9c('0x10'),auth[_0x3c9c('0x9')](),controller['removeAgents']);module[_0x3c9c('0x17')]=router; \ No newline at end of file +var _0x0618=['getTeams','getAgents','post','create','/:id/teams','/:id/users','addAgents','update','delete','/:id','destroy','removeTeams','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0618,0x1c6));var _0x8061=function(_0x491e1a,_0x305a7c){_0x491e1a=_0x491e1a-0x0;var _0x142458=_0x0618[_0x491e1a];return _0x142458;};'use strict';var multer=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var path=require('path');var timeout=require(_0x8061('0x2'));var express=require(_0x8061('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8061('0x4'));var config=require(_0x8061('0x5'));var controller=require(_0x8061('0x6'));router[_0x8061('0x7')]('/',auth[_0x8061('0x8')](),controller[_0x8061('0x9')]);router[_0x8061('0x7')](_0x8061('0xa'),auth[_0x8061('0x8')](),controller[_0x8061('0xb')]);router[_0x8061('0x7')]('/:id',auth[_0x8061('0x8')](),controller['show']);router[_0x8061('0x7')](_0x8061('0xc'),auth[_0x8061('0x8')](),controller[_0x8061('0xd')]);router[_0x8061('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8061('0xe')]);router[_0x8061('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x8061('0xf')]);router[_0x8061('0x10')]('/',auth[_0x8061('0x8')](),controller[_0x8061('0x11')]);router[_0x8061('0x10')](_0x8061('0x12'),auth['isAuthenticated'](),controller['addTeams']);router[_0x8061('0x10')](_0x8061('0x13'),auth[_0x8061('0x8')](),controller[_0x8061('0x14')]);router['put']('/:id',auth[_0x8061('0x8')](),controller[_0x8061('0x15')]);router[_0x8061('0x16')](_0x8061('0x17'),auth[_0x8061('0x8')](),controller[_0x8061('0x18')]);router[_0x8061('0x16')](_0x8061('0x12'),auth[_0x8061('0x8')](),controller[_0x8061('0x19')]);router[_0x8061('0x16')](_0x8061('0x13'),auth[_0x8061('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 180be04..09557b2 100644 --- a/server/api/smsQueue/smsQueue.attributes.js +++ b/server/api/smsQueue/smsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07be=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x27aa5c,_0x18be92){var _0x200dce=function(_0xf70ab2){while(--_0xf70ab2){_0x27aa5c['push'](_0x27aa5c['shift']());}};_0x200dce(++_0x18be92);}(_0x07be,0xef));var _0xe07b=function(_0x21b986,_0x4ce148){_0x21b986=_0x21b986-0x0;var _0x4f2f29=_0x07be[_0x21b986];return _0x4f2f29;};'use strict';var Sequelize=require(_0xe07b('0x0'));module[_0xe07b('0x1')]={'name':{'type':Sequelize[_0xe07b('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe07b('0x2')]},'timeout':{'type':Sequelize[_0xe07b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe07b('0x4')](_0xe07b('0x5'),_0xe07b('0x6'),_0xe07b('0x7'))}}; \ No newline at end of file +var _0xe962=['sequelize','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe962,0xb6));var _0x2e96=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe962[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x2e96('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e96('0x1')],'unique':_0x2e96('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2e96('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e96('0x3')](_0x2e96('0x4'),_0x2e96('0x5'),_0x2e96('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index e5eef71..8e86585 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8603=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','SmsQueues','UserProfileResource','error','name','send','index','SmsQueue','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','then','includeAll','include','findAll','rows','show','keys','rawAttributes','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','SmsQueueId','UserSmsQueue','User','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','includes','all','compact','transaction','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','order','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse'];(function(_0x6c40ba,_0x5e39fa){var _0x7a54dd=function(_0x166452){while(--_0x166452){_0x6c40ba['push'](_0x6c40ba['shift']());}};_0x7a54dd(++_0x5e39fa);}(_0x8603,0x190));var _0x3860=function(_0x3209f2,_0x5c51e2){_0x3209f2=_0x3209f2-0x0;var _0x56aabc=_0x8603[_0x3209f2];return _0x56aabc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3860('0x0'));var rimraf=require(_0x3860('0x1'));var zipdir=require(_0x3860('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3860('0x3'));var BPromise=require(_0x3860('0x4'));var Mustache=require(_0x3860('0x5'));var util=require('util');var path=require(_0x3860('0x6'));var sox=require('sox');var csv=require(_0x3860('0x7'));var ejs=require(_0x3860('0x8'));var fs=require('fs');var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var db=require('../../mysqldb')['db'];config[_0x3860('0x14')]=_[_0x3860('0x15')](config[_0x3860('0x14')],{'host':_0x3860('0x16'),'port':0x18eb});var socket=require(_0x3860('0x17'))(new Redis(config[_0x3860('0x14')]));require(_0x3860('0x18'))[_0x3860('0x19')](socket);function respondWithStatusCode(_0x465d8d,_0x46264d){_0x46264d=_0x46264d||0xcc;return function(_0x54dbc3){if(_0x54dbc3){return _0x465d8d[_0x3860('0x1a')](_0x46264d);}return _0x465d8d[_0x3860('0x1b')](_0x46264d)[_0x3860('0x1c')]();};}function respondWithResult(_0x37d9ab,_0x1055b3){_0x1055b3=_0x1055b3||0xc8;return function(_0xfa0c9a){if(_0xfa0c9a){return _0x37d9ab[_0x3860('0x1b')](_0x1055b3)[_0x3860('0x1d')](_0xfa0c9a);}};}function respondWithFilteredResult(_0x311fdb,_0x3c0d91){return function(_0x3e51b4){if(_0x3e51b4){var _0x45b799=_0x3e51b4[_0x3860('0x1e')],_0x4b6b15=_0x3c0d91[_0x3860('0x1f')],_0x4863bd=_0x3c0d91['offset']+_0x3c0d91[_0x3860('0x20')],_0x373b06;if(_0x4863bd>=_0x45b799){_0x4863bd=_0x45b799;_0x373b06=0xc8;}else{_0x373b06=0xce;}_0x311fdb[_0x3860('0x1b')](_0x373b06);return _0x311fdb[_0x3860('0x21')](_0x3860('0x22'),_0x4b6b15+'-'+_0x4863bd+'/'+_0x45b799)[_0x3860('0x1d')](_0x3e51b4);}return null;};}function patchUpdates(_0x45081f){return function(_0xc06ba1){try{jsonpatch[_0x3860('0x23')](_0xc06ba1,_0x45081f,!![]);}catch(_0x21d179){return BPromise[_0x3860('0x24')](_0x21d179);}return _0xc06ba1[_0x3860('0x25')]();};}function saveUpdates(_0x2e0b6e,_0x280ea9){return function(_0x9eaaa1){if(_0x9eaaa1){return _0x9eaaa1[_0x3860('0x26')](_0x2e0b6e)['then'](function(_0xfc10a5){return _0xfc10a5;});}return null;};}function removeEntity(_0x133093,_0x2b91f2){return function(_0x301e03){if(_0x301e03){return _0x301e03[_0x3860('0x27')]()['then'](function(){var _0x29ea87=_0x301e03['get']({'plain':!![]});var _0x577750=_0x3860('0x28');return db[_0x3860('0x29')]['destroy']({'where':{'type':_0x577750,'resourceId':_0x29ea87['id']}})['then'](function(){return _0x301e03;});})['then'](function(){_0x133093[_0x3860('0x1b')](0xcc)[_0x3860('0x1c')]();});}};}function handleEntityNotFound(_0xb25cc2,_0x371f3a){return function(_0x9332a5){if(!_0x9332a5){_0xb25cc2[_0x3860('0x1a')](0x194);}return _0x9332a5;};}function handleError(_0x544b9a,_0x4c4314){_0x4c4314=_0x4c4314||0x1f4;return function(_0x389bd0){logger[_0x3860('0x2a')](_0x389bd0['stack']);if(_0x389bd0[_0x3860('0x2b')]){delete _0x389bd0[_0x3860('0x2b')];}_0x544b9a[_0x3860('0x1b')](_0x4c4314)[_0x3860('0x2c')](_0x389bd0);};}exports[_0x3860('0x2d')]=function(_0x4bbae9,_0x36ae2b){var _0xf624ba={},_0x367b14={},_0x4bd90c={'count':0x0,'rows':[]};var _0x45d24f=_['map'](db[_0x3860('0x2e')]['rawAttributes'],function(_0x1c498c){return{'name':_0x1c498c[_0x3860('0x2f')],'type':_0x1c498c[_0x3860('0x30')]['key']};});_0x367b14[_0x3860('0x31')]=_[_0x3860('0x32')](_0x45d24f,'name');_0x367b14[_0x3860('0x33')]=_['keys'](_0x4bbae9[_0x3860('0x33')]);_0x367b14[_0x3860('0x34')]=_[_0x3860('0x35')](_0x367b14[_0x3860('0x31')],_0x367b14[_0x3860('0x33')]);_0xf624ba[_0x3860('0x36')]=_[_0x3860('0x35')](_0x367b14['model'],qs[_0x3860('0x37')](_0x4bbae9[_0x3860('0x33')]['fields']));_0xf624ba[_0x3860('0x36')]=_0xf624ba[_0x3860('0x36')][_0x3860('0x38')]?_0xf624ba['attributes']:_0x367b14['model'];if(!_0x4bbae9[_0x3860('0x33')][_0x3860('0x39')](_0x3860('0x3a'))){_0xf624ba[_0x3860('0x20')]=qs['limit'](_0x4bbae9['query'][_0x3860('0x20')]);_0xf624ba[_0x3860('0x1f')]=qs[_0x3860('0x1f')](_0x4bbae9[_0x3860('0x33')][_0x3860('0x1f')]);}_0xf624ba['order']=qs[_0x3860('0x3b')](_0x4bbae9[_0x3860('0x33')]['sort']);_0xf624ba['where']=qs[_0x3860('0x34')](_[_0x3860('0x3c')](_0x4bbae9[_0x3860('0x33')],_0x367b14[_0x3860('0x34')]));if(_0x4bbae9[_0x3860('0x33')]['filter']){_0xf624ba[_0x3860('0x3d')]=_['merge'](_0xf624ba[_0x3860('0x3d')],{'$or':_[_0x3860('0x32')](_0x45d24f,function(_0x53d443){if(_0x53d443[_0x3860('0x30')]!==_0x3860('0x3e')){var _0x4f3303={};_0x4f3303[_0x53d443[_0x3860('0x2b')]]={'$like':'%'+_0x4bbae9[_0x3860('0x33')][_0x3860('0x3f')]+'%'};return _0x4f3303;}})});}_0xf624ba=_[_0x3860('0x40')]({},_0xf624ba,_0x4bbae9['options']);var _0x312ffc={'where':_0xf624ba[_0x3860('0x3d')]};return db[_0x3860('0x2e')]['count'](_0x312ffc)[_0x3860('0x41')](function(_0x4e27c4){_0x4bd90c[_0x3860('0x1e')]=_0x4e27c4;if(_0x4bbae9[_0x3860('0x33')][_0x3860('0x42')]){_0xf624ba[_0x3860('0x43')]=[{'all':!![]}];}return db[_0x3860('0x2e')][_0x3860('0x44')](_0xf624ba);})['then'](function(_0xbbbf01){_0x4bd90c[_0x3860('0x45')]=_0xbbbf01;return _0x4bd90c;})['then'](respondWithFilteredResult(_0x36ae2b,_0xf624ba))['catch'](handleError(_0x36ae2b,null));};exports[_0x3860('0x46')]=function(_0x5840f7,_0x4f2f53){var _0x164a77={'raw':!![],'where':{'id':_0x5840f7['params']['id']}},_0x30d8eb={};_0x30d8eb[_0x3860('0x31')]=_[_0x3860('0x47')](db[_0x3860('0x2e')][_0x3860('0x48')]);_0x30d8eb[_0x3860('0x33')]=_[_0x3860('0x47')](_0x5840f7[_0x3860('0x33')]);_0x30d8eb[_0x3860('0x34')]=_[_0x3860('0x35')](_0x30d8eb[_0x3860('0x31')],_0x30d8eb[_0x3860('0x33')]);_0x164a77[_0x3860('0x36')]=_[_0x3860('0x35')](_0x30d8eb['model'],qs[_0x3860('0x37')](_0x5840f7['query'][_0x3860('0x37')]));_0x164a77[_0x3860('0x36')]=_0x164a77[_0x3860('0x36')][_0x3860('0x38')]?_0x164a77[_0x3860('0x36')]:_0x30d8eb[_0x3860('0x31')];if(_0x5840f7[_0x3860('0x33')][_0x3860('0x42')]){_0x164a77['include']=[{'all':!![]}];}_0x164a77=_[_0x3860('0x40')]({},_0x164a77,_0x5840f7[_0x3860('0x49')]);return db[_0x3860('0x2e')]['find'](_0x164a77)[_0x3860('0x41')](handleEntityNotFound(_0x4f2f53,null))[_0x3860('0x41')](respondWithResult(_0x4f2f53,null))[_0x3860('0x4a')](handleError(_0x4f2f53,null));};exports[_0x3860('0x4b')]=function(_0x5ed2db,_0x5bb2d1){return db[_0x3860('0x2e')]['create'](_0x5ed2db[_0x3860('0x4c')],{})[_0x3860('0x41')](function(_0x410dab){var _0x52456e=_0x5ed2db[_0x3860('0x4d')]['get']({'plain':!![]});if(!_0x52456e)throw new Error(_0x3860('0x4e'));if(_0x52456e['role']===_0x3860('0x4d')){var _0x25d22f=_0x410dab[_0x3860('0x4f')]({'plain':!![]});var _0x4b5790='SmsQueues';return db[_0x3860('0x50')][_0x3860('0x51')]({'where':{'name':_0x4b5790,'userProfileId':_0x52456e['userProfileId']},'raw':!![]})[_0x3860('0x41')](function(_0x58237e){if(_0x58237e&&_0x58237e[_0x3860('0x52')]===0x0){return db[_0x3860('0x29')][_0x3860('0x4b')]({'name':_0x25d22f[_0x3860('0x2b')],'resourceId':_0x25d22f['id'],'type':_0x58237e[_0x3860('0x2b')],'sectionId':_0x58237e['id']},{})[_0x3860('0x41')](function(){return _0x410dab;});}else{return _0x410dab;}})[_0x3860('0x4a')](function(_0x5a9987){logger[_0x3860('0x2a')](_0x3860('0x53'),_0x5a9987);throw _0x5a9987;});}return _0x410dab;})[_0x3860('0x41')](respondWithResult(_0x5bb2d1,0xc9))[_0x3860('0x4a')](handleError(_0x5bb2d1,null));};exports[_0x3860('0x26')]=function(_0x447163,_0x47ff99){if(_0x447163[_0x3860('0x4c')]['id']){delete _0x447163[_0x3860('0x4c')]['id'];}return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x447163[_0x3860('0x54')]['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x47ff99,null))[_0x3860('0x41')](saveUpdates(_0x447163[_0x3860('0x4c')],null))['then'](respondWithResult(_0x47ff99,null))[_0x3860('0x4a')](handleError(_0x47ff99,null));};exports[_0x3860('0x27')]=function(_0x53a669,_0x1fe680){return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x53a669['params']['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x1fe680,null))['then'](removeEntity(_0x1fe680,null))[_0x3860('0x4a')](handleError(_0x1fe680,null));};exports[_0x3860('0x55')]=function(_0x13b978,_0x2cc119){return db[_0x3860('0x2e')][_0x3860('0x55')]()[_0x3860('0x41')](respondWithResult(_0x2cc119,null))[_0x3860('0x4a')](handleError(_0x2cc119,null));};exports[_0x3860('0x56')]=function(_0x151492,_0x3ba9a1,_0x2bac24){var _0x58147d={'raw':!![],'where':{}},_0x5ce9a4={},_0x5111e0;return db[_0x3860('0x2e')]['findOne']({'where':{'id':_0x151492['params']['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x3ba9a1,null))[_0x3860('0x41')](function(_0x2ff440){if(_0x2ff440){_0x5111e0=_0x2ff440[_0x3860('0x4f')]({'plain':!![]});_0x5ce9a4[_0x3860('0x31')]=_[_0x3860('0x47')](db['UserSmsQueue']['rawAttributes']);_0x5ce9a4['query']=_[_0x3860('0x47')](_0x151492[_0x3860('0x33')]);_0x5ce9a4[_0x3860('0x34')]=_['intersection'](_0x5ce9a4[_0x3860('0x31')],_0x5ce9a4['query']);_0x58147d[_0x3860('0x36')]=_[_0x3860('0x35')](_0x5ce9a4['model'],qs[_0x3860('0x37')](_0x151492[_0x3860('0x33')][_0x3860('0x37')]));_0x58147d[_0x3860('0x36')]=_0x58147d['attributes'][_0x3860('0x38')]?_0x58147d[_0x3860('0x36')]:_0x5ce9a4[_0x3860('0x31')];if(!_0x151492['query']['hasOwnProperty'](_0x3860('0x3a'))){_0x58147d[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x151492[_0x3860('0x33')][_0x3860('0x20')]);_0x58147d[_0x3860('0x1f')]=qs['offset'](_0x151492[_0x3860('0x33')][_0x3860('0x1f')]);}_0x58147d['order']=qs[_0x3860('0x3b')](_0x151492[_0x3860('0x33')][_0x3860('0x3b')]);_0x58147d[_0x3860('0x3d')]=qs[_0x3860('0x34')](_[_0x3860('0x3c')](_0x151492['query'],_0x5ce9a4[_0x3860('0x34')]));_0x58147d[_0x3860('0x3d')][_0x3860('0x57')]=_0x2ff440['id'];if(_0x151492[_0x3860('0x33')][_0x3860('0x3f')]){_0x58147d[_0x3860('0x3d')]=_['merge'](_0x58147d[_0x3860('0x3d')],{'$or':_[_0x3860('0x32')](_0x58147d[_0x3860('0x36')],function(_0x5ebf70){var _0x4e386e={};_0x4e386e[_0x5ebf70]={'$like':'%'+_0x151492[_0x3860('0x33')][_0x3860('0x3f')]+'%'};return _0x4e386e;})});}_0x58147d=_[_0x3860('0x40')]({},_0x58147d,_0x151492[_0x3860('0x49')]);return db[_0x3860('0x58')]['findAll'](_0x58147d);}})['then'](function(_0x2db53f){if(_0x2db53f){return db[_0x3860('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x2db53f,_0x3860('0x5a')),'role':_0x3860('0x5b')},'attributes':['id','name',_0x3860('0x5c'),_0x3860('0x5d'),_0x3860('0x5e')]});}})[_0x3860('0x41')](function(_0x495167){if(_0x495167){return{'count':_0x495167[_0x3860('0x1e')],'rows':_[_0x3860('0x32')](_0x495167['rows'],function(_0x57e944){return{'membername':_0x57e944[_0x3860('0x2b')],'UserId':_0x57e944['id'],'queue_name':_0x5111e0[_0x3860('0x2b')],'SmsQueueId':_0x5111e0['id'],'interface':util['format'](_0x3860('0x5f'),'SIP',_0x57e944[_0x3860('0x2b')]),'penalty':0x0,'paused':_0x57e944['smsPause'],'createdAt':_0x57e944['createdAt'],'updatedAt':_0x57e944[_0x3860('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3ba9a1,_0x58147d))[_0x3860('0x4a')](handleError(_0x3ba9a1,null));};exports[_0x3860('0x60')]=function(_0x29eb2c,_0x2fd2f4,_0x19f717){var _0x43c5a1={};var _0x4b3447={};var _0x3756b3;var _0x297321;return db[_0x3860('0x2e')]['findOne']({'where':{'id':_0x29eb2c[_0x3860('0x54')]['id']}})['then'](handleEntityNotFound(_0x2fd2f4,null))[_0x3860('0x41')](function(_0x3dc2c5){if(_0x3dc2c5){_0x3756b3=_0x3dc2c5;_0x4b3447['model']=_[_0x3860('0x47')](db[_0x3860('0x61')][_0x3860('0x48')]);_0x4b3447['query']=_['keys'](_0x29eb2c['query']);_0x4b3447['filters']=_[_0x3860('0x35')](_0x4b3447[_0x3860('0x31')],_0x4b3447[_0x3860('0x33')]);_0x43c5a1[_0x3860('0x36')]=_['intersection'](_0x4b3447['model'],qs[_0x3860('0x37')](_0x29eb2c[_0x3860('0x33')][_0x3860('0x37')]));_0x43c5a1[_0x3860('0x36')]=_0x43c5a1['attributes'][_0x3860('0x38')]?_0x43c5a1[_0x3860('0x36')]:_0x4b3447['model'];_0x43c5a1['order']=qs[_0x3860('0x3b')](_0x29eb2c[_0x3860('0x33')][_0x3860('0x3b')]);_0x43c5a1[_0x3860('0x3d')]=qs['filters'](_['pick'](_0x29eb2c[_0x3860('0x33')],_0x4b3447['filters']));if(_0x29eb2c[_0x3860('0x33')][_0x3860('0x3f')]){_0x43c5a1['where']=_['merge'](_0x43c5a1['where'],{'$or':_[_0x3860('0x32')](_0x43c5a1[_0x3860('0x36')],function(_0x507480){var _0x22177b={};_0x22177b[_0x507480]={'$like':'%'+_0x29eb2c[_0x3860('0x33')][_0x3860('0x3f')]+'%'};return _0x22177b;})});}_0x43c5a1=_[_0x3860('0x40')]({},_0x43c5a1,_0x29eb2c[_0x3860('0x49')]);return _0x3756b3['getTeams'](_0x43c5a1);}})[_0x3860('0x41')](function(_0x31e791){if(_0x31e791){_0x297321=_0x31e791[_0x3860('0x38')];if(!_0x29eb2c[_0x3860('0x33')][_0x3860('0x39')]('nolimit')){_0x43c5a1[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x29eb2c[_0x3860('0x33')][_0x3860('0x20')]);_0x43c5a1[_0x3860('0x1f')]=qs['offset'](_0x29eb2c['query'][_0x3860('0x1f')]);}return _0x3756b3[_0x3860('0x60')](_0x43c5a1);}})[_0x3860('0x41')](function(_0xf950d8){if(_0xf950d8){return _0xf950d8?{'count':_0x297321,'rows':_0xf950d8}:null;}})[_0x3860('0x41')](respondWithResult(_0x2fd2f4,null))[_0x3860('0x4a')](handleError(_0x2fd2f4,null));};exports[_0x3860('0x62')]=function(_0x532163,_0x458c1b,_0x3eb292){var _0x58eddd=_0x532163[_0x3860('0x4c')][_0x3860('0x63')];return db[_0x3860('0x61')]['findAll']({'where':{'id':_0x58eddd},'attributes':['id'],'include':[{'model':db[_0x3860('0x59')],'as':_0x3860('0x64'),'attributes':['id','name',_0x3860('0x65'),'voicePause',_0x3860('0x66')],'raw':!![]}]})[_0x3860('0x41')](function(_0x479d65){if(_0x479d65){var _0x330fd0=_[_0x3860('0x67')](_0x479d65,function(_0x361113){var _0x37b34a=_0x361113[_0x3860('0x4f')]({'plain':!![]});return _0x37b34a['Agents'];});return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x532163[_0x3860('0x54')]['id']}})[_0x3860('0x41')](function(_0x3c9837){return db['sequelize']['transaction'](function(_0x170554){return _0x3c9837[_0x3860('0x62')](_0x58eddd,{'transaction':_0x170554})['then'](function(){return BPromise[_0x3860('0x68')](_0x330fd0,function(_0x27ef52){return db[_0x3860('0x58')][_0x3860('0x69')]({'where':{'UserId':_0x27ef52['id'],'SmsQueueId':_0x532163['params']['id']},'transaction':_0x170554});});})[_0x3860('0x41')](function(){_0x330fd0['forEach'](function(_0x1a0768){socket[_0x3860('0x6a')](_0x3860('0x6b'),{'UserId':_0x1a0768['id'],'SmsQueueId':_0x3c9837['id']});});});});});}})[_0x3860('0x41')](respondWithStatusCode(_0x458c1b,null))[_0x3860('0x4a')](handleError(_0x458c1b,null));};exports[_0x3860('0x6c')]=function(_0x467b1b,_0x4936e7,_0x277aba){return db[_0x3860('0x61')]['findAll']({'where':{'id':_0x467b1b['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3860('0x64'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x41')](handleEntityNotFound(_0x4936e7,null))[_0x3860('0x41')](function(_0x1482cd){var _0x1d989c=_[_0x3860('0x32')](_0x1482cd,'id');var _0x51999d=[];var _0x204da6=[];var _0x5e2959=squel[_0x3860('0x6d')]();_0x5e2959[_0x3860('0x6e')](_0x3860('0x6f'))[_0x3860('0x70')](_0x3860('0x71'),'tq')[_0x3860('0x72')](_0x3860('0x73'),'ut',_0x3860('0x74'))[_0x3860('0x3d')](_0x3860('0x75'),_0x467b1b[_0x3860('0x54')]['id']);for(var _0x5bdd94=0x0;_0x5bdd94<_0x1482cd[_0x3860('0x38')];_0x5bdd94+=0x1){let _0x304c95=_0x1482cd[_0x5bdd94];for(var _0x1c87bd=0x0;_0x1c87bd<_0x304c95['Agents'][_0x3860('0x38')];_0x1c87bd+=0x1){let _0x2fb8fc=_0x304c95[_0x3860('0x64')][_0x1c87bd];var _0x3d4469=_0x5e2959['clone']();_0x3d4469[_0x3860('0x3d')](_0x3860('0x76'),_0x2fb8fc['id']);_0x204da6[_0x3860('0x77')](db['sequelize'][_0x3860('0x33')](_0x3d4469[_0x3860('0x78')](),{'type':db[_0x3860('0x79')]['QueryTypes'][_0x3860('0x7a')]})[_0x3860('0x41')](function(_0x171400){if(_0x171400['length']===0x1){return _0x2fb8fc['id'];}else{var _0x11d103=_[_0x3860('0x7b')](_[_0x3860('0x32')](_0x171400,'TeamId'),function(_0x3c6005){return _[_0x3860('0x7c')](_0x1d989c,_0x3c6005);});if(_0x11d103){return _0x2fb8fc['id'];}}}));}}return BPromise[_0x3860('0x7d')](_0x204da6)['then'](function(_0x213c8f){_0x51999d=_(_0x51999d)['union'](_0x213c8f)[_0x3860('0x7e')]()['value']();return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x467b1b[_0x3860('0x54')]['id']}})[_0x3860('0x41')](function(_0xcf291){return db[_0x3860('0x79')][_0x3860('0x7f')](function(_0x3c9ccc){return _0xcf291[_0x3860('0x6c')](_0x467b1b[_0x3860('0x33')][_0x3860('0x63')],{'transaction':_0x3c9ccc})[_0x3860('0x41')](function(){if(!_[_0x3860('0x80')](_0x51999d)){return _0xcf291[_0x3860('0x81')](_0x51999d,{'transaction':_0x3c9ccc});}})[_0x3860('0x41')](function(){_0x51999d[_0x3860('0x82')](function(_0x46661f){socket[_0x3860('0x6a')]('userSmsQueue:remove',{'UserId':_0x46661f,'SmsQueueId':_0xcf291['id']});});});});});});})[_0x3860('0x41')](respondWithStatusCode(_0x4936e7,null))[_0x3860('0x4a')](handleError(_0x4936e7,null));};exports[_0x3860('0x83')]=function(_0x28cf53,_0x3e6bf8,_0x27802b){return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x28cf53[_0x3860('0x54')]['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x3e6bf8,null))[_0x3860('0x41')](function(_0x50a18b){if(_0x50a18b){return _0x50a18b[_0x3860('0x83')](_0x28cf53[_0x3860('0x4c')][_0x3860('0x63')],_[_0x3860('0x84')](_0x28cf53['body'],[_0x3860('0x63'),'id'])||{})[_0x3860('0x85')](function(_0x2fcf2c){for(var _0x20d615=0x0;_0x20d615<_0x28cf53['body'][_0x3860('0x63')]['length'];_0x20d615+=0x1){socket['emit'](_0x3860('0x6b'),{'UserId':_0x28cf53[_0x3860('0x4c')][_0x3860('0x63')][_0x20d615],'SmsQueueId':_0x28cf53[_0x3860('0x54')]['id']});}return _0x2fcf2c;});}})[_0x3860('0x41')](respondWithResult(_0x3e6bf8,null))[_0x3860('0x4a')](handleError(_0x3e6bf8,null));};exports[_0x3860('0x81')]=function(_0x273fed,_0x3e4a88,_0x468e83){return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x273fed[_0x3860('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e4a88,null))[_0x3860('0x41')](function(_0x509122){if(_0x509122){return _0x509122[_0x3860('0x81')](_0x273fed[_0x3860('0x33')]['ids'])[_0x3860('0x41')](function(){if(_[_0x3860('0x86')](_0x273fed[_0x3860('0x33')][_0x3860('0x63')])){for(var _0x959e5b=0x0;_0x959e5b<_0x273fed[_0x3860('0x33')][_0x3860('0x63')]['length'];_0x959e5b+=0x1){socket[_0x3860('0x6a')](_0x3860('0x87'),{'UserId':Number(_0x273fed[_0x3860('0x33')][_0x3860('0x63')][_0x959e5b]),'SmsQueueId':Number(_0x273fed[_0x3860('0x54')]['id'])});}}else{socket['emit'](_0x3860('0x87'),{'UserId':Number(_0x273fed['query']['ids']),'SmsQueueId':Number(_0x273fed['params']['id'])});}});}})[_0x3860('0x41')](respondWithStatusCode(_0x3e4a88,null))[_0x3860('0x4a')](handleError(_0x3e4a88,null));};exports[_0x3860('0x88')]=function(_0x1558dc,_0x161efa,_0x276a75){var _0x270ca1={};var _0xe24a1d={};var _0x59c203;var _0x3c738a;return db[_0x3860('0x2e')]['findOne']({'where':{'id':_0x1558dc['params']['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x161efa,null))[_0x3860('0x41')](function(_0x1cf541){if(_0x1cf541){_0x59c203=_0x1cf541;_0xe24a1d['model']=_[_0x3860('0x47')](db['User'][_0x3860('0x48')]);_0xe24a1d['query']=_[_0x3860('0x47')](_0x1558dc[_0x3860('0x33')]);_0xe24a1d['filters']=_[_0x3860('0x35')](_0xe24a1d[_0x3860('0x31')],_0xe24a1d['query']);_0x270ca1[_0x3860('0x36')]=_[_0x3860('0x35')](_0xe24a1d[_0x3860('0x31')],qs['fields'](_0x1558dc[_0x3860('0x33')]['fields']));_0x270ca1[_0x3860('0x36')]=_0x270ca1[_0x3860('0x36')]['length']?_0x270ca1[_0x3860('0x36')]:_0xe24a1d[_0x3860('0x31')];_0x270ca1[_0x3860('0x89')]=qs[_0x3860('0x3b')](_0x1558dc[_0x3860('0x33')]['sort']);_0x270ca1[_0x3860('0x3d')]=qs[_0x3860('0x34')](_['pick'](_0x1558dc['query'],_0xe24a1d[_0x3860('0x34')]));if(_0x1558dc['query'][_0x3860('0x3f')]){_0x270ca1[_0x3860('0x3d')]=_['merge'](_0x270ca1[_0x3860('0x3d')],{'$or':_['map'](_0x270ca1[_0x3860('0x36')],function(_0x4b8128){var _0x10c82d={};_0x10c82d[_0x4b8128]={'$like':'%'+_0x1558dc[_0x3860('0x33')][_0x3860('0x3f')]+'%'};return _0x10c82d;})});}_0x270ca1=_[_0x3860('0x40')]({},_0x270ca1,_0x1558dc['options']);return _0x59c203[_0x3860('0x88')](_0x270ca1);}})[_0x3860('0x41')](function(_0x20071c){if(_0x20071c){_0x3c738a=_0x20071c[_0x3860('0x38')];if(!_0x1558dc['query'][_0x3860('0x39')](_0x3860('0x3a'))){_0x270ca1['limit']=qs[_0x3860('0x20')](_0x1558dc[_0x3860('0x33')][_0x3860('0x20')]);_0x270ca1[_0x3860('0x1f')]=qs['offset'](_0x1558dc[_0x3860('0x33')][_0x3860('0x1f')]);}return _0x59c203[_0x3860('0x88')](_0x270ca1);}})[_0x3860('0x41')](function(_0x48b8a8){if(_0x48b8a8){return _0x48b8a8?{'count':_0x3c738a,'rows':_0x48b8a8}:null;}})[_0x3860('0x41')](respondWithResult(_0x161efa,null))['catch'](handleError(_0x161efa,null));}; \ No newline at end of file +var _0xb10b=['push','QueryTypes','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:save','userSmsQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','UserProfileResource','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsQueue','findAll','rows','show','params','find','create','body','user','get','SmsQueues','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','nolimit','sort','SmsQueueId','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','hasOwnProperty','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?'];(function(_0xe10326,_0x5a8de6){var _0x433c15=function(_0x532385){while(--_0x532385){_0xe10326['push'](_0xe10326['shift']());}};_0x433c15(++_0x5a8de6);}(_0xb10b,0x12a));var _0xbb10=function(_0x583c95,_0x2caa4d){_0x583c95=_0x583c95-0x0;var _0x1cb317=_0xb10b[_0x583c95];return _0x1cb317;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./smsQueue.socket')[_0xbb10('0x1c')](socket);function respondWithStatusCode(_0x42d7e4,_0x45b9d6){_0x45b9d6=_0x45b9d6||0xcc;return function(_0x17fd46){if(_0x17fd46){return _0x42d7e4[_0xbb10('0x1d')](_0x45b9d6);}return _0x42d7e4[_0xbb10('0x1e')](_0x45b9d6)[_0xbb10('0x1f')]();};}function respondWithResult(_0x36b5e8,_0x3e26f4){_0x3e26f4=_0x3e26f4||0xc8;return function(_0x2b184e){if(_0x2b184e){return _0x36b5e8['status'](_0x3e26f4)[_0xbb10('0x20')](_0x2b184e);}};}function respondWithFilteredResult(_0x1145f1,_0x133ac2){return function(_0x42db98){if(_0x42db98){var _0x378da8=_0x42db98[_0xbb10('0x21')],_0x1682a4=_0x133ac2[_0xbb10('0x22')],_0x575cca=_0x133ac2['offset']+_0x133ac2[_0xbb10('0x23')],_0x30efc6;if(_0x575cca>=_0x378da8){_0x575cca=_0x378da8;_0x30efc6=0xc8;}else{_0x30efc6=0xce;}_0x1145f1[_0xbb10('0x1e')](_0x30efc6);return _0x1145f1[_0xbb10('0x24')](_0xbb10('0x25'),_0x1682a4+'-'+_0x575cca+'/'+_0x378da8)[_0xbb10('0x20')](_0x42db98);}return null;};}function patchUpdates(_0x44e563){return function(_0x4deb49){try{jsonpatch[_0xbb10('0x26')](_0x4deb49,_0x44e563,!![]);}catch(_0x12ef77){return BPromise['reject'](_0x12ef77);}return _0x4deb49['save']();};}function saveUpdates(_0x8e2b97,_0x311abe){return function(_0x2e911d){if(_0x2e911d){return _0x2e911d[_0xbb10('0x27')](_0x8e2b97)[_0xbb10('0x28')](function(_0x1824b7){return _0x1824b7;});}return null;};}function removeEntity(_0x407cb4,_0x436104){return function(_0x7f2377){if(_0x7f2377){return _0x7f2377[_0xbb10('0x29')]()[_0xbb10('0x28')](function(){var _0x26ad93=_0x7f2377['get']({'plain':!![]});var _0x4fedac='SmsQueues';return db[_0xbb10('0x2a')][_0xbb10('0x29')]({'where':{'type':_0x4fedac,'resourceId':_0x26ad93['id']}})[_0xbb10('0x28')](function(){return _0x7f2377;});})['then'](function(){_0x407cb4[_0xbb10('0x1e')](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x6ed43b,_0x1d5e95){return function(_0x1acce9){if(!_0x1acce9){_0x6ed43b[_0xbb10('0x1d')](0x194);}return _0x1acce9;};}function handleError(_0x2a0e8b,_0x4aabb9){_0x4aabb9=_0x4aabb9||0x1f4;return function(_0x3796c7){logger[_0xbb10('0x2b')](_0x3796c7[_0xbb10('0x2c')]);if(_0x3796c7[_0xbb10('0x2d')]){delete _0x3796c7[_0xbb10('0x2d')];}_0x2a0e8b[_0xbb10('0x1e')](_0x4aabb9)['send'](_0x3796c7);};}exports[_0xbb10('0x2e')]=function(_0x4ee02e,_0x448d5c){var _0x56f2da={},_0x16ad2a={},_0x1dcc9c={'count':0x0,'rows':[]};var _0x1b59f9=_['map'](db['SmsQueue'][_0xbb10('0x2f')],function(_0x34f65e){return{'name':_0x34f65e['fieldName'],'type':_0x34f65e[_0xbb10('0x30')][_0xbb10('0x31')]};});_0x16ad2a[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x1b59f9,_0xbb10('0x2d'));_0x16ad2a[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x4ee02e['query']);_0x16ad2a[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x16ad2a[_0xbb10('0x32')],_0x16ad2a[_0xbb10('0x34')]);_0x56f2da[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x16ad2a[_0xbb10('0x32')],qs[_0xbb10('0x39')](_0x4ee02e[_0xbb10('0x34')]['fields']));_0x56f2da[_0xbb10('0x38')]=_0x56f2da[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x56f2da[_0xbb10('0x38')]:_0x16ad2a['model'];if(!_0x4ee02e[_0xbb10('0x34')]['hasOwnProperty']('nolimit')){_0x56f2da[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x4ee02e[_0xbb10('0x34')][_0xbb10('0x23')]);_0x56f2da[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x4ee02e['query'][_0xbb10('0x22')]);}_0x56f2da[_0xbb10('0x3b')]=qs['sort'](_0x4ee02e['query']['sort']);_0x56f2da[_0xbb10('0x3c')]=qs[_0xbb10('0x36')](_[_0xbb10('0x3d')](_0x4ee02e['query'],_0x16ad2a[_0xbb10('0x36')]));if(_0x4ee02e[_0xbb10('0x34')][_0xbb10('0x3e')]){_0x56f2da['where']=_[_0xbb10('0x3f')](_0x56f2da[_0xbb10('0x3c')],{'$or':_[_0xbb10('0x33')](_0x1b59f9,function(_0x446f49){if(_0x446f49['type']!==_0xbb10('0x40')){var _0x110eb5={};_0x110eb5[_0x446f49['name']]={'$like':'%'+_0x4ee02e[_0xbb10('0x34')][_0xbb10('0x3e')]+'%'};return _0x110eb5;}})});}_0x56f2da=_[_0xbb10('0x3f')]({},_0x56f2da,_0x4ee02e[_0xbb10('0x41')]);var _0x2dd35a={'where':_0x56f2da[_0xbb10('0x3c')]};return db['SmsQueue'][_0xbb10('0x21')](_0x2dd35a)[_0xbb10('0x28')](function(_0x3e7b4c){_0x1dcc9c[_0xbb10('0x21')]=_0x3e7b4c;if(_0x4ee02e['query'][_0xbb10('0x42')]){_0x56f2da[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x44')][_0xbb10('0x45')](_0x56f2da);})['then'](function(_0x351484){_0x1dcc9c[_0xbb10('0x46')]=_0x351484;return _0x1dcc9c;})['then'](respondWithFilteredResult(_0x448d5c,_0x56f2da))['catch'](handleError(_0x448d5c,null));};exports[_0xbb10('0x47')]=function(_0x4a3ddf,_0x318984){var _0x180933={'raw':!![],'where':{'id':_0x4a3ddf[_0xbb10('0x48')]['id']}},_0x4c66d8={};_0x4c66d8[_0xbb10('0x32')]=_[_0xbb10('0x35')](db['SmsQueue'][_0xbb10('0x2f')]);_0x4c66d8[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x4a3ddf[_0xbb10('0x34')]);_0x4c66d8[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c66d8[_0xbb10('0x32')],_0x4c66d8[_0xbb10('0x34')]);_0x180933[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x4c66d8[_0xbb10('0x32')],qs[_0xbb10('0x39')](_0x4a3ddf['query'][_0xbb10('0x39')]));_0x180933[_0xbb10('0x38')]=_0x180933['attributes'][_0xbb10('0x3a')]?_0x180933[_0xbb10('0x38')]:_0x4c66d8[_0xbb10('0x32')];if(_0x4a3ddf[_0xbb10('0x34')][_0xbb10('0x42')]){_0x180933[_0xbb10('0x43')]=[{'all':!![]}];}_0x180933=_[_0xbb10('0x3f')]({},_0x180933,_0x4a3ddf['options']);return db['SmsQueue'][_0xbb10('0x49')](_0x180933)[_0xbb10('0x28')](handleEntityNotFound(_0x318984,null))[_0xbb10('0x28')](respondWithResult(_0x318984,null))['catch'](handleError(_0x318984,null));};exports['create']=function(_0x3cd6f3,_0x34cf4e){return db[_0xbb10('0x44')][_0xbb10('0x4a')](_0x3cd6f3[_0xbb10('0x4b')],{})[_0xbb10('0x28')](function(_0x2f2552){var _0x460788=_0x3cd6f3[_0xbb10('0x4c')][_0xbb10('0x4d')]({'plain':!![]});if(!_0x460788)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x460788['role']===_0xbb10('0x4c')){var _0x467dba=_0x2f2552[_0xbb10('0x4d')]({'plain':!![]});var _0xb014b0=_0xbb10('0x4e');return db[_0xbb10('0x4f')][_0xbb10('0x49')]({'where':{'name':_0xb014b0,'userProfileId':_0x460788[_0xbb10('0x50')]},'raw':!![]})[_0xbb10('0x28')](function(_0x1214f7){if(_0x1214f7&&_0x1214f7[_0xbb10('0x51')]===0x0){return db[_0xbb10('0x2a')][_0xbb10('0x4a')]({'name':_0x467dba[_0xbb10('0x2d')],'resourceId':_0x467dba['id'],'type':_0x1214f7[_0xbb10('0x2d')],'sectionId':_0x1214f7['id']},{})['then'](function(){return _0x2f2552;});}else{return _0x2f2552;}})[_0xbb10('0x52')](function(_0x5bd44d){logger[_0xbb10('0x2b')](_0xbb10('0x53'),_0x5bd44d);throw _0x5bd44d;});}return _0x2f2552;})[_0xbb10('0x28')](respondWithResult(_0x34cf4e,0xc9))[_0xbb10('0x52')](handleError(_0x34cf4e,null));};exports[_0xbb10('0x27')]=function(_0x32d8e9,_0x2e3326){if(_0x32d8e9[_0xbb10('0x4b')]['id']){delete _0x32d8e9[_0xbb10('0x4b')]['id'];}return db[_0xbb10('0x44')][_0xbb10('0x49')]({'where':{'id':_0x32d8e9[_0xbb10('0x48')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x2e3326,null))[_0xbb10('0x28')](saveUpdates(_0x32d8e9[_0xbb10('0x4b')],null))['then'](respondWithResult(_0x2e3326,null))[_0xbb10('0x52')](handleError(_0x2e3326,null));};exports[_0xbb10('0x29')]=function(_0x1b83a9,_0x4ce8e7){return db[_0xbb10('0x44')][_0xbb10('0x49')]({'where':{'id':_0x1b83a9['params']['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x4ce8e7,null))[_0xbb10('0x28')](removeEntity(_0x4ce8e7,null))[_0xbb10('0x52')](handleError(_0x4ce8e7,null));};exports[_0xbb10('0x54')]=function(_0x432728,_0x22de7f){return db[_0xbb10('0x44')][_0xbb10('0x54')]()[_0xbb10('0x28')](respondWithResult(_0x22de7f,null))[_0xbb10('0x52')](handleError(_0x22de7f,null));};exports[_0xbb10('0x55')]=function(_0x2a1ce1,_0x16932f,_0x4e7fac){var _0x4ea1a6={'raw':!![],'where':{}},_0x16272d={},_0x3e6338;return db[_0xbb10('0x44')][_0xbb10('0x56')]({'where':{'id':_0x2a1ce1['params']['id']}})['then'](handleEntityNotFound(_0x16932f,null))[_0xbb10('0x28')](function(_0xaf2cc3){if(_0xaf2cc3){_0x3e6338=_0xaf2cc3[_0xbb10('0x4d')]({'plain':!![]});_0x16272d[_0xbb10('0x32')]=_[_0xbb10('0x35')](db[_0xbb10('0x57')][_0xbb10('0x2f')]);_0x16272d['query']=_[_0xbb10('0x35')](_0x2a1ce1[_0xbb10('0x34')]);_0x16272d['filters']=_['intersection'](_0x16272d['model'],_0x16272d[_0xbb10('0x34')]);_0x4ea1a6[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x16272d['model'],qs['fields'](_0x2a1ce1['query'][_0xbb10('0x39')]));_0x4ea1a6[_0xbb10('0x38')]=_0x4ea1a6[_0xbb10('0x38')]['length']?_0x4ea1a6[_0xbb10('0x38')]:_0x16272d[_0xbb10('0x32')];if(!_0x2a1ce1['query']['hasOwnProperty'](_0xbb10('0x58'))){_0x4ea1a6[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x2a1ce1[_0xbb10('0x34')]['limit']);_0x4ea1a6[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x2a1ce1[_0xbb10('0x34')]['offset']);}_0x4ea1a6[_0xbb10('0x3b')]=qs[_0xbb10('0x59')](_0x2a1ce1[_0xbb10('0x34')]['sort']);_0x4ea1a6[_0xbb10('0x3c')]=qs[_0xbb10('0x36')](_[_0xbb10('0x3d')](_0x2a1ce1[_0xbb10('0x34')],_0x16272d['filters']));_0x4ea1a6[_0xbb10('0x3c')][_0xbb10('0x5a')]=_0xaf2cc3['id'];if(_0x2a1ce1[_0xbb10('0x34')][_0xbb10('0x3e')]){_0x4ea1a6['where']=_[_0xbb10('0x3f')](_0x4ea1a6[_0xbb10('0x3c')],{'$or':_[_0xbb10('0x33')](_0x4ea1a6[_0xbb10('0x38')],function(_0x12f750){var _0x17807e={};_0x17807e[_0x12f750]={'$like':'%'+_0x2a1ce1[_0xbb10('0x34')]['filter']+'%'};return _0x17807e;})});}_0x4ea1a6=_['merge']({},_0x4ea1a6,_0x2a1ce1['options']);return db[_0xbb10('0x57')][_0xbb10('0x45')](_0x4ea1a6);}})[_0xbb10('0x28')](function(_0x5c9afc){if(_0x5c9afc){return db['User'][_0xbb10('0x5b')]({'where':{'id':_[_0xbb10('0x33')](_0x5c9afc,_0xbb10('0x5c')),'role':_0xbb10('0x5d')},'attributes':['id',_0xbb10('0x2d'),_0xbb10('0x5e'),'updatedAt',_0xbb10('0x5f')]});}})[_0xbb10('0x28')](function(_0x270fdb){if(_0x270fdb){return{'count':_0x270fdb[_0xbb10('0x21')],'rows':_[_0xbb10('0x33')](_0x270fdb['rows'],function(_0x56094a){return{'membername':_0x56094a['name'],'UserId':_0x56094a['id'],'queue_name':_0x3e6338[_0xbb10('0x2d')],'SmsQueueId':_0x3e6338['id'],'interface':util[_0xbb10('0x60')](_0xbb10('0x61'),_0xbb10('0x62'),_0x56094a[_0xbb10('0x2d')]),'penalty':0x0,'paused':_0x56094a[_0xbb10('0x5e')],'createdAt':_0x56094a['createdAt'],'updatedAt':_0x56094a[_0xbb10('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x16932f,_0x4ea1a6))['catch'](handleError(_0x16932f,null));};exports['getTeams']=function(_0xdf634f,_0x13040d,_0x23b1d5){var _0x108f99={};var _0x5ce94f={};var _0x122d38;var _0x5c583b;return db['SmsQueue'][_0xbb10('0x56')]({'where':{'id':_0xdf634f[_0xbb10('0x48')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x13040d,null))[_0xbb10('0x28')](function(_0xfa3c7c){if(_0xfa3c7c){_0x122d38=_0xfa3c7c;_0x5ce94f['model']=_[_0xbb10('0x35')](db[_0xbb10('0x64')][_0xbb10('0x2f')]);_0x5ce94f[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0xdf634f[_0xbb10('0x34')]);_0x5ce94f[_0xbb10('0x36')]=_['intersection'](_0x5ce94f[_0xbb10('0x32')],_0x5ce94f[_0xbb10('0x34')]);_0x108f99[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x5ce94f[_0xbb10('0x32')],qs[_0xbb10('0x39')](_0xdf634f[_0xbb10('0x34')][_0xbb10('0x39')]));_0x108f99['attributes']=_0x108f99[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x108f99[_0xbb10('0x38')]:_0x5ce94f['model'];_0x108f99['order']=qs['sort'](_0xdf634f[_0xbb10('0x34')]['sort']);_0x108f99['where']=qs[_0xbb10('0x36')](_[_0xbb10('0x3d')](_0xdf634f[_0xbb10('0x34')],_0x5ce94f[_0xbb10('0x36')]));if(_0xdf634f[_0xbb10('0x34')][_0xbb10('0x3e')]){_0x108f99[_0xbb10('0x3c')]=_[_0xbb10('0x3f')](_0x108f99[_0xbb10('0x3c')],{'$or':_['map'](_0x108f99[_0xbb10('0x38')],function(_0x1351eb){var _0x46b6d2={};_0x46b6d2[_0x1351eb]={'$like':'%'+_0xdf634f[_0xbb10('0x34')]['filter']+'%'};return _0x46b6d2;})});}_0x108f99=_['merge']({},_0x108f99,_0xdf634f[_0xbb10('0x41')]);return _0x122d38[_0xbb10('0x65')](_0x108f99);}})[_0xbb10('0x28')](function(_0x32bb25){if(_0x32bb25){_0x5c583b=_0x32bb25['length'];if(!_0xdf634f[_0xbb10('0x34')][_0xbb10('0x66')](_0xbb10('0x58'))){_0x108f99[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0xdf634f['query']['limit']);_0x108f99[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0xdf634f[_0xbb10('0x34')]['offset']);}return _0x122d38[_0xbb10('0x65')](_0x108f99);}})[_0xbb10('0x28')](function(_0x50bcc9){if(_0x50bcc9){return _0x50bcc9?{'count':_0x5c583b,'rows':_0x50bcc9}:null;}})['then'](respondWithResult(_0x13040d,null))[_0xbb10('0x52')](handleError(_0x13040d,null));};exports[_0xbb10('0x67')]=function(_0x177f77,_0x4d64ff,_0x32d5a5){var _0x3a17fc=_0x177f77[_0xbb10('0x4b')][_0xbb10('0x68')];return db[_0xbb10('0x64')][_0xbb10('0x45')]({'where':{'id':_0x3a17fc},'attributes':['id'],'include':[{'model':db[_0xbb10('0x69')],'as':_0xbb10('0x6a'),'attributes':['id',_0xbb10('0x2d'),'online',_0xbb10('0x6b'),_0xbb10('0x6c')],'raw':!![]}]})[_0xbb10('0x28')](function(_0xdb7d3e){if(_0xdb7d3e){var _0x3e3083=_[_0xbb10('0x6d')](_0xdb7d3e,function(_0x33a6fc){var _0x305d52=_0x33a6fc[_0xbb10('0x4d')]({'plain':!![]});return _0x305d52[_0xbb10('0x6a')];});return db[_0xbb10('0x44')][_0xbb10('0x49')]({'where':{'id':_0x177f77['params']['id']}})['then'](function(_0xe1fc51){return db[_0xbb10('0x6e')][_0xbb10('0x6f')](function(_0x3fd367){return _0xe1fc51[_0xbb10('0x67')](_0x3a17fc,{'transaction':_0x3fd367})['then'](function(){return BPromise[_0xbb10('0x70')](_0x3e3083,function(_0x332fbe){return db[_0xbb10('0x57')][_0xbb10('0x71')]({'where':{'UserId':_0x332fbe['id'],'SmsQueueId':_0x177f77[_0xbb10('0x48')]['id']},'transaction':_0x3fd367});});})[_0xbb10('0x28')](function(){_0x3e3083['forEach'](function(_0xb25e71){socket[_0xbb10('0x72')]('userSmsQueue:save',{'UserId':_0xb25e71['id'],'SmsQueueId':_0xe1fc51['id']});});});});});}})[_0xbb10('0x28')](respondWithStatusCode(_0x4d64ff,null))['catch'](handleError(_0x4d64ff,null));};exports[_0xbb10('0x73')]=function(_0x28bd76,_0x2b473c,_0xa99bf5){return db[_0xbb10('0x64')]['findAll']({'where':{'id':_0x28bd76[_0xbb10('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbb10('0x69')],'as':_0xbb10('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2b473c,null))['then'](function(_0x415407){var _0x2b0d71=_[_0xbb10('0x33')](_0x415407,'id');var _0x283bab=[];var _0x18d18d=[];var _0x1cb22f=squel[_0xbb10('0x74')]();_0x1cb22f[_0xbb10('0x75')](_0xbb10('0x76'))[_0xbb10('0x77')](_0xbb10('0x78'),'tq')['join'](_0xbb10('0x79'),'ut',_0xbb10('0x7a'))[_0xbb10('0x3c')](_0xbb10('0x7b'),_0x28bd76[_0xbb10('0x48')]['id']);for(var _0x86a6ff=0x0;_0x86a6ff<_0x415407[_0xbb10('0x3a')];_0x86a6ff+=0x1){let _0x28bc95=_0x415407[_0x86a6ff];for(var _0x3e6fe2=0x0;_0x3e6fe2<_0x28bc95[_0xbb10('0x6a')][_0xbb10('0x3a')];_0x3e6fe2+=0x1){let _0x2d3e98=_0x28bc95['Agents'][_0x3e6fe2];var _0xe1d006=_0x1cb22f['clone']();_0xe1d006[_0xbb10('0x3c')](_0xbb10('0x7c'),_0x2d3e98['id']);_0x18d18d[_0xbb10('0x7d')](db[_0xbb10('0x6e')][_0xbb10('0x34')](_0xe1d006['toString'](),{'type':db[_0xbb10('0x6e')][_0xbb10('0x7e')][_0xbb10('0x7f')]})[_0xbb10('0x28')](function(_0x315b55){if(_0x315b55[_0xbb10('0x3a')]===0x1){return _0x2d3e98['id'];}else{var _0x4970fe=_['every'](_[_0xbb10('0x33')](_0x315b55,_0xbb10('0x80')),function(_0x41d4d0){return _['includes'](_0x2b0d71,_0x41d4d0);});if(_0x4970fe){return _0x2d3e98['id'];}}}));}}return BPromise[_0xbb10('0x81')](_0x18d18d)[_0xbb10('0x28')](function(_0x514fdf){_0x283bab=_(_0x283bab)[_0xbb10('0x82')](_0x514fdf)[_0xbb10('0x83')]()['value']();return db[_0xbb10('0x44')]['find']({'where':{'id':_0x28bd76[_0xbb10('0x48')]['id']}})[_0xbb10('0x28')](function(_0x5d82e4){return db[_0xbb10('0x6e')][_0xbb10('0x6f')](function(_0x4bac29){return _0x5d82e4['removeTeams'](_0x28bd76[_0xbb10('0x34')][_0xbb10('0x68')],{'transaction':_0x4bac29})[_0xbb10('0x28')](function(){if(!_[_0xbb10('0x84')](_0x283bab)){return _0x5d82e4[_0xbb10('0x85')](_0x283bab,{'transaction':_0x4bac29});}})['then'](function(){_0x283bab[_0xbb10('0x86')](function(_0x9f2e0f){socket[_0xbb10('0x72')]('userSmsQueue:remove',{'UserId':_0x9f2e0f,'SmsQueueId':_0x5d82e4['id']});});});});});});})[_0xbb10('0x28')](respondWithStatusCode(_0x2b473c,null))[_0xbb10('0x52')](handleError(_0x2b473c,null));};exports[_0xbb10('0x87')]=function(_0xa5391d,_0x44a3e1,_0xf5b08a){return db[_0xbb10('0x44')][_0xbb10('0x49')]({'where':{'id':_0xa5391d[_0xbb10('0x48')]['id']}})['then'](handleEntityNotFound(_0x44a3e1,null))['then'](function(_0x37e40c){if(_0x37e40c){return _0x37e40c[_0xbb10('0x87')](_0xa5391d[_0xbb10('0x4b')][_0xbb10('0x68')],_[_0xbb10('0x88')](_0xa5391d[_0xbb10('0x4b')],[_0xbb10('0x68'),'id'])||{})[_0xbb10('0x89')](function(_0x3ede66){for(var _0x471827=0x0;_0x471827<_0xa5391d[_0xbb10('0x4b')][_0xbb10('0x68')][_0xbb10('0x3a')];_0x471827+=0x1){socket['emit'](_0xbb10('0x8a'),{'UserId':_0xa5391d[_0xbb10('0x4b')][_0xbb10('0x68')][_0x471827],'SmsQueueId':_0xa5391d[_0xbb10('0x48')]['id']});}return _0x3ede66;});}})[_0xbb10('0x28')](respondWithResult(_0x44a3e1,null))[_0xbb10('0x52')](handleError(_0x44a3e1,null));};exports[_0xbb10('0x85')]=function(_0x1421e2,_0x3c6c45,_0x3c92f4){return db[_0xbb10('0x44')]['find']({'where':{'id':_0x1421e2[_0xbb10('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c6c45,null))[_0xbb10('0x28')](function(_0x22ae3c){if(_0x22ae3c){return _0x22ae3c[_0xbb10('0x85')](_0x1421e2[_0xbb10('0x34')][_0xbb10('0x68')])[_0xbb10('0x28')](function(){if(_['isArray'](_0x1421e2[_0xbb10('0x34')]['ids'])){for(var _0xd82ce1=0x0;_0xd82ce1<_0x1421e2[_0xbb10('0x34')][_0xbb10('0x68')][_0xbb10('0x3a')];_0xd82ce1+=0x1){socket[_0xbb10('0x72')](_0xbb10('0x8b'),{'UserId':Number(_0x1421e2[_0xbb10('0x34')][_0xbb10('0x68')][_0xd82ce1]),'SmsQueueId':Number(_0x1421e2[_0xbb10('0x48')]['id'])});}}else{socket[_0xbb10('0x72')](_0xbb10('0x8b'),{'UserId':Number(_0x1421e2[_0xbb10('0x34')]['ids']),'SmsQueueId':Number(_0x1421e2[_0xbb10('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c6c45,null))[_0xbb10('0x52')](handleError(_0x3c6c45,null));};exports[_0xbb10('0x8c')]=function(_0x418f63,_0x7673a0,_0x44c229){var _0x40271f={};var _0x185ec9={};var _0x5e9888;var _0x350657;return db['SmsQueue']['findOne']({'where':{'id':_0x418f63[_0xbb10('0x48')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x7673a0,null))[_0xbb10('0x28')](function(_0x1fd88a){if(_0x1fd88a){_0x5e9888=_0x1fd88a;_0x185ec9[_0xbb10('0x32')]=_[_0xbb10('0x35')](db['User'][_0xbb10('0x2f')]);_0x185ec9[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x418f63[_0xbb10('0x34')]);_0x185ec9[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x185ec9['model'],_0x185ec9[_0xbb10('0x34')]);_0x40271f[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x185ec9[_0xbb10('0x32')],qs[_0xbb10('0x39')](_0x418f63[_0xbb10('0x34')][_0xbb10('0x39')]));_0x40271f['attributes']=_0x40271f[_0xbb10('0x38')]['length']?_0x40271f[_0xbb10('0x38')]:_0x185ec9['model'];_0x40271f['order']=qs[_0xbb10('0x59')](_0x418f63[_0xbb10('0x34')][_0xbb10('0x59')]);_0x40271f[_0xbb10('0x3c')]=qs[_0xbb10('0x36')](_['pick'](_0x418f63[_0xbb10('0x34')],_0x185ec9['filters']));if(_0x418f63['query']['filter']){_0x40271f[_0xbb10('0x3c')]=_[_0xbb10('0x3f')](_0x40271f[_0xbb10('0x3c')],{'$or':_[_0xbb10('0x33')](_0x40271f[_0xbb10('0x38')],function(_0x5abedf){var _0x125bcf={};_0x125bcf[_0x5abedf]={'$like':'%'+_0x418f63[_0xbb10('0x34')][_0xbb10('0x3e')]+'%'};return _0x125bcf;})});}_0x40271f=_[_0xbb10('0x3f')]({},_0x40271f,_0x418f63[_0xbb10('0x41')]);return _0x5e9888[_0xbb10('0x8c')](_0x40271f);}})[_0xbb10('0x28')](function(_0x485c1a){if(_0x485c1a){_0x350657=_0x485c1a['length'];if(!_0x418f63['query'][_0xbb10('0x66')](_0xbb10('0x58'))){_0x40271f[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x418f63[_0xbb10('0x34')][_0xbb10('0x23')]);_0x40271f[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x418f63[_0xbb10('0x34')][_0xbb10('0x22')]);}return _0x5e9888['getAgents'](_0x40271f);}})['then'](function(_0x4dce53){if(_0x4dce53){return _0x4dce53?{'count':_0x350657,'rows':_0x4dce53}:null;}})[_0xbb10('0x28')](respondWithResult(_0x7673a0,null))[_0xbb10('0x52')](handleError(_0x7673a0,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index a195c9c..1ba2463 100644 --- a/server/api/smsQueue/smsQueue.events.js +++ b/server/api/smsQueue/smsQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe790=['exports','../../mysqldb','SmsQueue','emit','hasOwnProperty','hook'];(function(_0xb480f0,_0x20d9b4){var _0x58cf01=function(_0x3b6f7e){while(--_0x3b6f7e){_0xb480f0['push'](_0xb480f0['shift']());}};_0x58cf01(++_0x20d9b4);}(_0xe790,0x175));var _0x0e79=function(_0x18c9bf,_0x46c593){_0x18c9bf=_0x18c9bf-0x0;var _0x22faa0=_0xe790[_0x18c9bf];return _0x22faa0;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x0e79('0x0'))['db'][_0x0e79('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b31bf){return function(_0x409985,_0x2f9a76,_0x2d70f1){SmsQueueEvents[_0x0e79('0x2')](_0x5b31bf+':'+_0x409985['id'],_0x409985);SmsQueueEvents[_0x0e79('0x2')](_0x5b31bf,_0x409985);_0x2d70f1(null);};}for(var e in events){if(events[_0x0e79('0x3')](e)){var event=events[e];SmsQueue[_0x0e79('0x4')](e,emitEvent(event));}}module[_0x0e79('0x5')]=SmsQueueEvents; \ No newline at end of file +var _0x910b=['events','setMaxListeners','save','update','emit'];(function(_0x2f1c92,_0x57eb7a){var _0x1f155b=function(_0x2b51f0){while(--_0x2b51f0){_0x2f1c92['push'](_0x2f1c92['shift']());}};_0x1f155b(++_0x57eb7a);}(_0x910b,0xb9));var _0xb910=function(_0x3dacd2,_0x514c3a){_0x3dacd2=_0x3dacd2-0x0;var _0x4efe9e=_0x910b[_0x3dacd2];return _0x4efe9e;};'use strict';var EventEmitter=require(_0xb910('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb910('0x1')](0x0);var events={'afterCreate':_0xb910('0x2'),'afterUpdate':_0xb910('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3dbb09){return function(_0x468bdd,_0x2610ce,_0x1aff89){SmsQueueEvents[_0xb910('0x4')](_0x3dbb09+':'+_0x468bdd['id'],_0x468bdd);SmsQueueEvents[_0xb910('0x4')](_0x3dbb09,_0x468bdd);_0x1aff89(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 08b57fe..c2d3711 100644 --- a/server/api/smsQueue/smsQueue.model.js +++ b/server/api/smsQueue/smsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f27=['./smsQueue.attributes','exports','SmsQueue','api','path','rimraf','../../config/environment'];(function(_0x2850c0,_0x1363a7){var _0x21e830=function(_0x3ec70a){while(--_0x3ec70a){_0x2850c0['push'](_0x2850c0['shift']());}};_0x21e830(++_0x1363a7);}(_0x8f27,0x8f));var _0x78f2=function(_0x8e9597,_0x2aa555){_0x8e9597=_0x8e9597-0x0;var _0x3be06a=_0x8f27[_0x8e9597];return _0x3be06a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x78f2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78f2('0x1'));var rimraf=require(_0x78f2('0x2'));var config=require(_0x78f2('0x3'));var attributes=require(_0x78f2('0x4'));module[_0x78f2('0x5')]=function(_0x3b77e2,_0x44353c){return _0x3b77e2['define'](_0x78f2('0x6'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe446=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues'];(function(_0x3004f4,_0x50ddd8){var _0x3fc7ea=function(_0x23f073){while(--_0x23f073){_0x3004f4['push'](_0x3004f4['shift']());}};_0x3fc7ea(++_0x50ddd8);}(_0xe446,0xa9));var _0x6e44=function(_0x2c4e23,_0x5a6527){_0x2c4e23=_0x2c4e23-0x0;var _0x58fbbe=_0xe446[_0x2c4e23];return _0x58fbbe;};'use strict';var _=require(_0x6e44('0x0'));var util=require(_0x6e44('0x1'));var logger=require(_0x6e44('0x2'))(_0x6e44('0x3'));var moment=require(_0x6e44('0x4'));var BPromise=require(_0x6e44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e44('0x6'));var rimraf=require(_0x6e44('0x7'));var config=require('../../config/environment');var attributes=require(_0x6e44('0x8'));module[_0x6e44('0x9')]=function(_0x255c52,_0x1c8918){return _0x255c52[_0x6e44('0xa')](_0x6e44('0xb'),attributes,{'tableName':_0x6e44('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index d075b0d..3750c1a 100644 --- a/server/api/smsQueue/smsQueue.rpc.js +++ b/server/api/smsQueue/smsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe922=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','SmsQueue','findAll','options','where','attributes','limit','include','map','model','GetSmsQueue','catch','find','raw','ShowSmsQueue','lodash'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xe922,0xef));var _0x2e92=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0xe922[_0x171fdc];return _0x3782ea;};'use strict';var _=require(_0x2e92('0x0'));var util=require(_0x2e92('0x1'));var moment=require(_0x2e92('0x2'));var BPromise=require(_0x2e92('0x3'));var rs=require(_0x2e92('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e92('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e92('0x6'))(_0x2e92('0x7'));var config=require(_0x2e92('0x8'));var jayson=require(_0x2e92('0x9'));var client=jayson[_0x2e92('0xa')][_0x2e92('0xb')]({'port':0x232a});config['redis']=_[_0x2e92('0xc')](config['redis'],{'host':_0x2e92('0xd'),'port':0x18eb});var socket=require(_0x2e92('0xe'))(new Redis(config['redis']));require(_0x2e92('0xf'))[_0x2e92('0x10')](socket);function respondWithRpcPromise(_0x1e874c,_0xf2a0d0,_0x52510d){return new BPromise(function(_0xa3b20d,_0x48f96b){return client['request'](_0x1e874c,_0x52510d)[_0x2e92('0x11')](function(_0x40a4e1){logger['info'](_0x2e92('0x12'),_0xf2a0d0,_0x2e92('0x13'));logger[_0x2e92('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0xf2a0d0,_0x2e92('0x13'),JSON[_0x2e92('0x15')](_0x40a4e1));if(_0x40a4e1[_0x2e92('0x16')]){if(_0x40a4e1[_0x2e92('0x16')][_0x2e92('0x17')]===0x1f4){logger[_0x2e92('0x16')](_0x2e92('0x12'),_0xf2a0d0,_0x40a4e1[_0x2e92('0x16')][_0x2e92('0x18')]);return _0x48f96b(_0x40a4e1[_0x2e92('0x16')][_0x2e92('0x18')]);}logger[_0x2e92('0x16')](_0x2e92('0x12'),_0xf2a0d0,_0x40a4e1[_0x2e92('0x16')]['message']);return _0xa3b20d(_0x40a4e1[_0x2e92('0x16')][_0x2e92('0x18')]);}else{logger[_0x2e92('0x19')](_0x2e92('0x12'),_0xf2a0d0,_0x2e92('0x13'));_0xa3b20d(_0x40a4e1['result'][_0x2e92('0x18')]);}})['catch'](function(_0x38fd9a){logger['error'](_0x2e92('0x12'),_0xf2a0d0,_0x38fd9a);_0x48f96b(_0x38fd9a);});});}exports['GetSmsQueue']=function(_0x2dbe94){var _0x4a2441=this;return new Promise(function(_0x4fc5d8,_0x374ded){return db[_0x2e92('0x1a')][_0x2e92('0x1b')]({'raw':_0x2dbe94['options']?_0x2dbe94['options']['raw']===undefined?!![]:![]:!![],'where':_0x2dbe94[_0x2e92('0x1c')]?_0x2dbe94[_0x2e92('0x1c')][_0x2e92('0x1d')]||null:null,'attributes':_0x2dbe94[_0x2e92('0x1c')]?_0x2dbe94['options'][_0x2e92('0x1e')]||null:null,'limit':_0x2dbe94[_0x2e92('0x1c')]?_0x2dbe94['options'][_0x2e92('0x1f')]||null:null,'include':_0x2dbe94['options']?_0x2dbe94[_0x2e92('0x1c')][_0x2e92('0x20')]?_[_0x2e92('0x21')](_0x2dbe94[_0x2e92('0x1c')][_0x2e92('0x20')],function(_0x953b3c){return{'model':db[_0x953b3c[_0x2e92('0x22')]],'as':_0x953b3c['as'],'attributes':_0x953b3c[_0x2e92('0x1e')],'include':_0x953b3c[_0x2e92('0x20')]?_[_0x2e92('0x21')](_0x953b3c[_0x2e92('0x20')],function(_0x3527bb){return{'model':db[_0x3527bb[_0x2e92('0x22')]],'as':_0x3527bb['as'],'attributes':_0x3527bb[_0x2e92('0x1e')],'include':_0x3527bb[_0x2e92('0x20')]?_[_0x2e92('0x21')](_0x3527bb[_0x2e92('0x20')],function(_0x422447){return{'model':db[_0x422447[_0x2e92('0x22')]],'as':_0x422447['as'],'attributes':_0x422447[_0x2e92('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2e92('0x11')](function(_0x14b620){logger[_0x2e92('0x19')](_0x2e92('0x23'),_0x2dbe94);logger[_0x2e92('0x14')]('GetSmsQueue',_0x2dbe94,JSON[_0x2e92('0x15')](_0x14b620));_0x4fc5d8(_0x14b620);})[_0x2e92('0x24')](function(_0x1b6c2a){logger[_0x2e92('0x16')](_0x2e92('0x23'),_0x1b6c2a['message'],_0x2dbe94);_0x374ded(_0x4a2441[_0x2e92('0x16')](0x1f4,_0x1b6c2a[_0x2e92('0x18')]));});});};exports['ShowSmsQueue']=function(_0x21726f){var _0x2b36dd=this;return new Promise(function(_0x4d2872,_0x3a5df8){return db[_0x2e92('0x1a')][_0x2e92('0x25')]({'raw':_0x21726f[_0x2e92('0x1c')]?_0x21726f[_0x2e92('0x1c')][_0x2e92('0x26')]===undefined?!![]:![]:!![],'where':_0x21726f[_0x2e92('0x1c')]?_0x21726f['options']['where']||null:null,'attributes':_0x21726f[_0x2e92('0x1c')]?_0x21726f[_0x2e92('0x1c')][_0x2e92('0x1e')]||null:null,'include':_0x21726f[_0x2e92('0x1c')]?_0x21726f['options'][_0x2e92('0x20')]?_[_0x2e92('0x21')](_0x21726f['options'][_0x2e92('0x20')],function(_0x3bd9d3){return{'model':db[_0x3bd9d3['model']],'as':_0x3bd9d3['as'],'attributes':_0x3bd9d3['attributes'],'include':_0x3bd9d3['include']?_[_0x2e92('0x21')](_0x3bd9d3[_0x2e92('0x20')],function(_0x4c80e4){return{'model':db[_0x4c80e4[_0x2e92('0x22')]],'as':_0x4c80e4['as'],'attributes':_0x4c80e4[_0x2e92('0x1e')],'include':_0x4c80e4[_0x2e92('0x20')]?_[_0x2e92('0x21')](_0x4c80e4['include'],function(_0xeaf5e6){return{'model':db[_0xeaf5e6[_0x2e92('0x22')]],'as':_0xeaf5e6['as'],'attributes':_0xeaf5e6[_0x2e92('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2e92('0x11')](function(_0x4a248a){logger['info'](_0x2e92('0x27'),_0x21726f);logger[_0x2e92('0x14')](_0x2e92('0x27'),_0x21726f,JSON[_0x2e92('0x15')](_0x4a248a));_0x4d2872(_0x4a248a);})['catch'](function(_0xd159d0){logger[_0x2e92('0x16')](_0x2e92('0x27'),_0xd159d0[_0x2e92('0x18')],_0x21726f);_0x3a5df8(_0x2b36dd[_0x2e92('0x16')](0x1f4,_0xd159d0[_0x2e92('0x18')]));});});}; \ No newline at end of file +var _0xb765=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetSmsQueue','SmsQueue','options','raw','where','attributes','map','include','model','ShowSmsQueue','debug','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x40cea1,_0x104e97){var _0x321426=function(_0x4e0d0b){while(--_0x4e0d0b){_0x40cea1['push'](_0x40cea1['shift']());}};_0x321426(++_0x104e97);}(_0xb765,0xb2));var _0x5b76=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb765[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5b76('0x0'));var BPromise=require(_0x5b76('0x1'));var rs=require(_0x5b76('0x2'));var fs=require('fs');var Redis=require(_0x5b76('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b76('0x4'))(_0x5b76('0x5'));var config=require(_0x5b76('0x6'));var jayson=require(_0x5b76('0x7'));var client=jayson[_0x5b76('0x8')]['http']({'port':0x232a});config[_0x5b76('0x9')]=_[_0x5b76('0xa')](config['redis'],{'host':_0x5b76('0xb'),'port':0x18eb});var socket=require(_0x5b76('0xc'))(new Redis(config['redis']));require(_0x5b76('0xd'))[_0x5b76('0xe')](socket);function respondWithRpcPromise(_0x159c4c,_0x1742cc,_0x4838ba){return new BPromise(function(_0xace6a4,_0x18f51b){return client[_0x5b76('0xf')](_0x159c4c,_0x4838ba)[_0x5b76('0x10')](function(_0x419c57){logger[_0x5b76('0x11')](_0x5b76('0x12'),_0x1742cc,_0x5b76('0x13'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1742cc,_0x5b76('0x13'),JSON[_0x5b76('0x14')](_0x419c57));if(_0x419c57[_0x5b76('0x15')]){if(_0x419c57[_0x5b76('0x15')][_0x5b76('0x16')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x1742cc,_0x419c57[_0x5b76('0x15')][_0x5b76('0x17')]);return _0x18f51b(_0x419c57[_0x5b76('0x15')]['message']);}logger[_0x5b76('0x15')](_0x5b76('0x12'),_0x1742cc,_0x419c57[_0x5b76('0x15')][_0x5b76('0x17')]);return _0xace6a4(_0x419c57['error'][_0x5b76('0x17')]);}else{logger['info'](_0x5b76('0x12'),_0x1742cc,_0x5b76('0x13'));_0xace6a4(_0x419c57[_0x5b76('0x18')][_0x5b76('0x17')]);}})['catch'](function(_0xd523e7){logger[_0x5b76('0x15')](_0x5b76('0x12'),_0x1742cc,_0xd523e7);_0x18f51b(_0xd523e7);});});}exports[_0x5b76('0x19')]=function(_0x173f2c){var _0xfd2e2=this;return new Promise(function(_0x16ff21,_0x370896){return db[_0x5b76('0x1a')]['findAll']({'raw':_0x173f2c[_0x5b76('0x1b')]?_0x173f2c['options'][_0x5b76('0x1c')]===undefined?!![]:![]:!![],'where':_0x173f2c['options']?_0x173f2c[_0x5b76('0x1b')][_0x5b76('0x1d')]||null:null,'attributes':_0x173f2c[_0x5b76('0x1b')]?_0x173f2c['options'][_0x5b76('0x1e')]||null:null,'limit':_0x173f2c[_0x5b76('0x1b')]?_0x173f2c[_0x5b76('0x1b')]['limit']||null:null,'include':_0x173f2c[_0x5b76('0x1b')]?_0x173f2c[_0x5b76('0x1b')]['include']?_[_0x5b76('0x1f')](_0x173f2c[_0x5b76('0x1b')][_0x5b76('0x20')],function(_0x24f83c){return{'model':db[_0x24f83c[_0x5b76('0x21')]],'as':_0x24f83c['as'],'attributes':_0x24f83c['attributes'],'include':_0x24f83c['include']?_[_0x5b76('0x1f')](_0x24f83c['include'],function(_0x2ea2b2){return{'model':db[_0x2ea2b2[_0x5b76('0x21')]],'as':_0x2ea2b2['as'],'attributes':_0x2ea2b2[_0x5b76('0x1e')],'include':_0x2ea2b2[_0x5b76('0x20')]?_['map'](_0x2ea2b2['include'],function(_0x93bac6){return{'model':db[_0x93bac6[_0x5b76('0x21')]],'as':_0x93bac6['as'],'attributes':_0x93bac6[_0x5b76('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5b76('0x10')](function(_0x74e7be){logger[_0x5b76('0x11')](_0x5b76('0x19'),_0x173f2c);logger['debug']('GetSmsQueue',_0x173f2c,JSON[_0x5b76('0x14')](_0x74e7be));_0x16ff21(_0x74e7be);})['catch'](function(_0x46bc5b){logger[_0x5b76('0x15')](_0x5b76('0x19'),_0x46bc5b[_0x5b76('0x17')],_0x173f2c);_0x370896(_0xfd2e2[_0x5b76('0x15')](0x1f4,_0x46bc5b[_0x5b76('0x17')]));});});};exports[_0x5b76('0x22')]=function(_0x59d873){var _0x5a7f16=this;return new Promise(function(_0x3172eb,_0xf31825){return db[_0x5b76('0x1a')]['find']({'raw':_0x59d873[_0x5b76('0x1b')]?_0x59d873[_0x5b76('0x1b')][_0x5b76('0x1c')]===undefined?!![]:![]:!![],'where':_0x59d873['options']?_0x59d873[_0x5b76('0x1b')][_0x5b76('0x1d')]||null:null,'attributes':_0x59d873['options']?_0x59d873[_0x5b76('0x1b')]['attributes']||null:null,'include':_0x59d873[_0x5b76('0x1b')]?_0x59d873['options'][_0x5b76('0x20')]?_[_0x5b76('0x1f')](_0x59d873['options'][_0x5b76('0x20')],function(_0x35041b){return{'model':db[_0x35041b['model']],'as':_0x35041b['as'],'attributes':_0x35041b[_0x5b76('0x1e')],'include':_0x35041b['include']?_[_0x5b76('0x1f')](_0x35041b[_0x5b76('0x20')],function(_0x520aae){return{'model':db[_0x520aae[_0x5b76('0x21')]],'as':_0x520aae['as'],'attributes':_0x520aae[_0x5b76('0x1e')],'include':_0x520aae['include']?_[_0x5b76('0x1f')](_0x520aae[_0x5b76('0x20')],function(_0x3d7bb4){return{'model':db[_0x3d7bb4[_0x5b76('0x21')]],'as':_0x3d7bb4['as'],'attributes':_0x3d7bb4[_0x5b76('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x470c19){logger['info'](_0x5b76('0x22'),_0x59d873);logger[_0x5b76('0x23')](_0x5b76('0x22'),_0x59d873,JSON['stringify'](_0x470c19));_0x3172eb(_0x470c19);})[_0x5b76('0x24')](function(_0x175ef0){logger[_0x5b76('0x15')](_0x5b76('0x22'),_0x175ef0[_0x5b76('0x17')],_0x59d873);_0xf31825(_0x5a7f16[_0x5b76('0x15')](0x1f4,_0x175ef0[_0x5b76('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 20642e2..275e9f8 100644 --- a/server/api/smsQueue/smsQueue.socket.js +++ b/server/api/smsQueue/smsQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2e6=['smsQueue:','remove','emit','removeListener','register','length'];(function(_0x5f3905,_0x43a651){var _0x2923b1=function(_0x3c72d8){while(--_0x3c72d8){_0x5f3905['push'](_0x5f3905['shift']());}};_0x2923b1(++_0x43a651);}(_0xb2e6,0x109));var _0x6b2e=function(_0x41c36c,_0x5748fd){_0x41c36c=_0x41c36c-0x0;var _0x4a2314=_0xb2e6[_0x41c36c];return _0x4a2314;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x6b2e('0x0'),'update'];function createListener(_0x35e6a8,_0x179875){return function(_0x21cca0){_0x179875[_0x6b2e('0x1')](_0x35e6a8,_0x21cca0);};}function removeListener(_0x409a37,_0x5552f4){return function(){SmsQueueEvents[_0x6b2e('0x2')](_0x409a37,_0x5552f4);};}exports[_0x6b2e('0x3')]=function(_0x5100ae){for(var _0x2e5c1d=0x0,_0x6ecec0=events[_0x6b2e('0x4')];_0x2e5c1d<_0x6ecec0;_0x2e5c1d++){var _0x5e0d8e=events[_0x2e5c1d];var _0x596b75=createListener(_0x6b2e('0x5')+_0x5e0d8e,_0x5100ae);SmsQueueEvents['on'](_0x5e0d8e,_0x596b75);}}; \ No newline at end of file +var _0x7715=['remove','update','emit','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0xd2d531,_0x19de07){var _0x70346=function(_0x136e8b){while(--_0x136e8b){_0xd2d531['push'](_0xd2d531['shift']());}};_0x70346(++_0x19de07);}(_0x7715,0xb2));var _0x5771=function(_0x19dd85,_0x21aadc){_0x19dd85=_0x19dd85-0x0;var _0x269768=_0x7715[_0x19dd85];return _0x269768;};'use strict';var SmsQueueEvents=require(_0x5771('0x0'));var events=[_0x5771('0x1'),_0x5771('0x2'),_0x5771('0x3')];function createListener(_0x1946a5,_0x5f5ff){return function(_0x1d638a){_0x5f5ff[_0x5771('0x4')](_0x1946a5,_0x1d638a);};}function removeListener(_0x3b8db4,_0x2b99bf){return function(){SmsQueueEvents[_0x5771('0x5')](_0x3b8db4,_0x2b99bf);};}exports[_0x5771('0x6')]=function(_0xe302c7){for(var _0xb0ce5c=0x0,_0x143b05=events[_0x5771('0x7')];_0xb0ce5c<_0x143b05;_0xb0ce5c++){var _0x98db22=events[_0xb0ce5c];var _0x2806e0=createListener(_0x5771('0x8')+_0x98db22,_0xe302c7);SmsQueueEvents['on'](_0x98db22,_0x2806e0);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index cad0ce7..97dcd20 100644 --- a/server/api/smsQueueReport/index.js +++ b/server/api/smsQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9319=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','/describe','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x9319,0x97));var _0x9931=function(_0x483108,_0x110271){_0x483108=_0x483108-0x0;var _0x4eed0d=_0x9319[_0x483108];return _0x4eed0d;};'use strict';var multer=require(_0x9931('0x0'));var util=require(_0x9931('0x1'));var path=require(_0x9931('0x2'));var timeout=require('connect-timeout');var express=require(_0x9931('0x3'));var router=express[_0x9931('0x4')]();var auth=require(_0x9931('0x5'));var interaction=require(_0x9931('0x6'));var config=require(_0x9931('0x7'));var controller=require(_0x9931('0x8'));router[_0x9931('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9931('0xa'),auth[_0x9931('0xb')](),controller['describe']);router['get']('/:id',auth[_0x9931('0xb')](),controller['show']);router['post']('/',auth[_0x9931('0xb')](),controller[_0x9931('0xc')]);router[_0x9931('0xd')](_0x9931('0xe'),auth[_0x9931('0xb')](),controller[_0x9931('0xf')]);router[_0x9931('0x10')](_0x9931('0xe'),auth[_0x9931('0xb')](),controller[_0x9931('0x11')]);module[_0x9931('0x12')]=router; \ No newline at end of file +var _0xf045=['update','delete','destroy','exports','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x11f4f8,_0x55443d){var _0x441185=function(_0x3f30c8){while(--_0x3f30c8){_0x11f4f8['push'](_0x11f4f8['shift']());}};_0x441185(++_0x55443d);}(_0xf045,0x16c));var _0x5f04=function(_0x2b4f65,_0x28f11a){_0x2b4f65=_0x2b4f65-0x0;var _0x440da7=_0xf045[_0x2b4f65];return _0x440da7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5f04('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x5f04('0x1'));var interaction=require(_0x5f04('0x2'));var config=require(_0x5f04('0x3'));var controller=require(_0x5f04('0x4'));router[_0x5f04('0x5')]('/',auth[_0x5f04('0x6')](),controller[_0x5f04('0x7')]);router['get']('/describe',auth[_0x5f04('0x6')](),controller[_0x5f04('0x8')]);router[_0x5f04('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x5f04('0x9')]);router[_0x5f04('0xa')]('/',auth[_0x5f04('0x6')](),controller[_0x5f04('0xb')]);router[_0x5f04('0xc')](_0x5f04('0xd'),auth['isAuthenticated'](),controller[_0x5f04('0xe')]);router[_0x5f04('0xf')](_0x5f04('0xd'),auth[_0x5f04('0x6')](),controller[_0x5f04('0x10')]);module[_0x5f04('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 91f3dff..c5d8c32 100644 --- a/server/api/smsQueueReport/smsQueueReport.attributes.js +++ b/server/api/smsQueueReport/smsQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ee3=['sequelize','exports','STRING','DATE','moment'];(function(_0x2721b8,_0x1ceca1){var _0x8f1252=function(_0x21d7a4){while(--_0x21d7a4){_0x2721b8['push'](_0x2721b8['shift']());}};_0x8f1252(++_0x1ceca1);}(_0x7ee3,0x14e));var _0x37ee=function(_0x29ae46,_0x1dda5b){_0x29ae46=_0x29ae46-0x0;var _0x5c4d8b=_0x7ee3[_0x29ae46];return _0x5c4d8b;};'use strict';var moment=require(_0x37ee('0x0'));var Sequelize=require(_0x37ee('0x1'));module[_0x37ee('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x37ee('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x37ee('0x4')]},'acceptAt':{'type':Sequelize[_0x37ee('0x4')]},'exitAt':{'type':Sequelize[_0x37ee('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7218=['DATE','moment','sequelize','exports','STRING'];(function(_0x3272af,_0x581a73){var _0x3267c5=function(_0x5cb81c){while(--_0x5cb81c){_0x3272af['push'](_0x3272af['shift']());}};_0x3267c5(++_0x581a73);}(_0x7218,0x196));var _0x8721=function(_0x4787ce,_0x3f2423){_0x4787ce=_0x4787ce-0x0;var _0x19432e=_0x7218[_0x4787ce];return _0x19432e;};'use strict';var moment=require(_0x8721('0x0'));var Sequelize=require(_0x8721('0x1'));module[_0x8721('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8721('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8721('0x4')]},'acceptAt':{'type':Sequelize[_0x8721('0x4')]},'exitAt':{'type':Sequelize[_0x8721('0x4')]},'reason':{'type':Sequelize[_0x8721('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index a7f6d20..9b221d3 100644 --- a/server/api/smsQueueReport/smsQueueReport.controller.js +++ b/server/api/smsQueueReport/smsQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4082=['fieldName','model','name','query','keys','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','intersection','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','send','index','map','SmsQueueReport','rawAttributes'];(function(_0x28208f,_0x7f5ff2){var _0x16e45f=function(_0x303e15){while(--_0x303e15){_0x28208f['push'](_0x28208f['shift']());}};_0x16e45f(++_0x7f5ff2);}(_0x4082,0xf2));var _0x2408=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x4082[_0x376b45];return _0x2341b3;};'use strict';var pdf=require(_0x2408('0x0'));var emlformat=require(_0x2408('0x1'));var rimraf=require(_0x2408('0x2'));var zipdir=require(_0x2408('0x3'));var jsonpatch=require(_0x2408('0x4'));var rp=require('request-promise');var moment=require(_0x2408('0x5'));var BPromise=require(_0x2408('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2408('0x7'));var csv=require(_0x2408('0x8'));var ejs=require(_0x2408('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2408('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2408('0x8'));var querystring=require(_0x2408('0xb'));var Papa=require(_0x2408('0xc'));var Redis=require(_0x2408('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2408('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2408('0xf'));var logger=require(_0x2408('0x10'))(_0x2408('0x11'));var utils=require(_0x2408('0x12'));var config=require(_0x2408('0x13'));var db=require(_0x2408('0x14'))['db'];function respondWithStatusCode(_0x16c6ba,_0x2af6f9){_0x2af6f9=_0x2af6f9||0xcc;return function(_0x4c52b2){if(_0x4c52b2){return _0x16c6ba[_0x2408('0x15')](_0x2af6f9);}return _0x16c6ba[_0x2408('0x16')](_0x2af6f9)[_0x2408('0x17')]();};}function respondWithResult(_0xe47e17,_0x3086a1){_0x3086a1=_0x3086a1||0xc8;return function(_0x444218){if(_0x444218){return _0xe47e17[_0x2408('0x16')](_0x3086a1)[_0x2408('0x18')](_0x444218);}};}function respondWithFilteredResult(_0x2c68d4,_0x3981ec){return function(_0x530bd0){if(_0x530bd0){var _0x208371=_0x530bd0[_0x2408('0x19')],_0x9faa03=_0x3981ec[_0x2408('0x1a')],_0x43108d=_0x3981ec[_0x2408('0x1a')]+_0x3981ec[_0x2408('0x1b')],_0x4a8c72;if(_0x43108d>=_0x208371){_0x43108d=_0x208371;_0x4a8c72=0xc8;}else{_0x4a8c72=0xce;}_0x2c68d4[_0x2408('0x16')](_0x4a8c72);return _0x2c68d4[_0x2408('0x1c')]('Content-Range',_0x9faa03+'-'+_0x43108d+'/'+_0x208371)[_0x2408('0x18')](_0x530bd0);}return null;};}function patchUpdates(_0xaaf69f){return function(_0xc119cd){try{jsonpatch[_0x2408('0x1d')](_0xc119cd,_0xaaf69f,!![]);}catch(_0xd14ced){return BPromise[_0x2408('0x1e')](_0xd14ced);}return _0xc119cd[_0x2408('0x1f')]();};}function saveUpdates(_0x2a116e,_0x1d0e35){return function(_0x5bd05d){if(_0x5bd05d){return _0x5bd05d[_0x2408('0x20')](_0x2a116e)[_0x2408('0x21')](function(_0x2bc7c6){return _0x2bc7c6;});}return null;};}function removeEntity(_0x57693c,_0x46d1cf){return function(_0x19ee54){if(_0x19ee54){return _0x19ee54[_0x2408('0x22')]()[_0x2408('0x21')](function(){_0x57693c['status'](0xcc)[_0x2408('0x17')]();});}};}function handleEntityNotFound(_0x4b4e12,_0x296176){return function(_0x1f4b6d){if(!_0x1f4b6d){_0x4b4e12[_0x2408('0x15')](0x194);}return _0x1f4b6d;};}function handleError(_0x4dfb2b,_0x231816){_0x231816=_0x231816||0x1f4;return function(_0x5cca88){logger[_0x2408('0x23')](_0x5cca88[_0x2408('0x24')]);if(_0x5cca88['name']){delete _0x5cca88['name'];}_0x4dfb2b[_0x2408('0x16')](_0x231816)[_0x2408('0x25')](_0x5cca88);};}exports[_0x2408('0x26')]=function(_0x2c6fd1,_0x166d66){var _0x7ed6c1={},_0x28e4fe={},_0x1f1307={'count':0x0,'rows':[]};var _0x3cfa4e=_[_0x2408('0x27')](db[_0x2408('0x28')][_0x2408('0x29')],function(_0x27dc){return{'name':_0x27dc[_0x2408('0x2a')],'type':_0x27dc['type']['key']};});_0x28e4fe[_0x2408('0x2b')]=_[_0x2408('0x27')](_0x3cfa4e,_0x2408('0x2c'));_0x28e4fe[_0x2408('0x2d')]=_[_0x2408('0x2e')](_0x2c6fd1['query']);_0x28e4fe[_0x2408('0x2f')]=_['intersection'](_0x28e4fe[_0x2408('0x2b')],_0x28e4fe[_0x2408('0x2d')]);_0x7ed6c1['attributes']=_['intersection'](_0x28e4fe[_0x2408('0x2b')],qs[_0x2408('0x30')](_0x2c6fd1[_0x2408('0x2d')][_0x2408('0x30')]));_0x7ed6c1[_0x2408('0x31')]=_0x7ed6c1[_0x2408('0x31')][_0x2408('0x32')]?_0x7ed6c1[_0x2408('0x31')]:_0x28e4fe[_0x2408('0x2b')];if(!_0x2c6fd1[_0x2408('0x2d')]['hasOwnProperty'](_0x2408('0x33'))){_0x7ed6c1[_0x2408('0x1b')]=qs[_0x2408('0x1b')](_0x2c6fd1[_0x2408('0x2d')][_0x2408('0x1b')]);_0x7ed6c1[_0x2408('0x1a')]=qs['offset'](_0x2c6fd1[_0x2408('0x2d')][_0x2408('0x1a')]);}_0x7ed6c1[_0x2408('0x34')]=qs[_0x2408('0x35')](_0x2c6fd1['query'][_0x2408('0x35')]);_0x7ed6c1[_0x2408('0x36')]=qs['filters'](_[_0x2408('0x37')](_0x2c6fd1['query'],_0x28e4fe[_0x2408('0x2f')]));if(_0x2c6fd1['query'][_0x2408('0x38')]){_0x7ed6c1['where']=_[_0x2408('0x39')](_0x7ed6c1[_0x2408('0x36')],{'$or':_[_0x2408('0x27')](_0x3cfa4e,function(_0x1bb2dc){if(_0x1bb2dc['type']!==_0x2408('0x3a')){var _0x18b331={};_0x18b331[_0x1bb2dc['name']]={'$like':'%'+_0x2c6fd1[_0x2408('0x2d')][_0x2408('0x38')]+'%'};return _0x18b331;}})});}_0x7ed6c1=_['merge']({},_0x7ed6c1,_0x2c6fd1[_0x2408('0x3b')]);var _0x47b131={'where':_0x7ed6c1[_0x2408('0x36')]};return db[_0x2408('0x28')][_0x2408('0x19')](_0x47b131)[_0x2408('0x21')](function(_0x509781){_0x1f1307[_0x2408('0x19')]=_0x509781;if(_0x2c6fd1[_0x2408('0x2d')]['includeAll']){_0x7ed6c1[_0x2408('0x3c')]=[{'all':!![]}];}return db[_0x2408('0x28')]['findAll'](_0x7ed6c1);})['then'](function(_0x4024aa){_0x1f1307[_0x2408('0x3d')]=_0x4024aa;return _0x1f1307;})[_0x2408('0x21')](respondWithFilteredResult(_0x166d66,_0x7ed6c1))[_0x2408('0x3e')](handleError(_0x166d66,null));};exports[_0x2408('0x3f')]=function(_0x4b61a9,_0x504ced){var _0x592bc4={'raw':!![],'where':{'id':_0x4b61a9[_0x2408('0x40')]['id']}},_0x8834ee={};_0x8834ee[_0x2408('0x2b')]=_[_0x2408('0x2e')](db[_0x2408('0x28')][_0x2408('0x29')]);_0x8834ee[_0x2408('0x2d')]=_[_0x2408('0x2e')](_0x4b61a9[_0x2408('0x2d')]);_0x8834ee[_0x2408('0x2f')]=_[_0x2408('0x41')](_0x8834ee[_0x2408('0x2b')],_0x8834ee[_0x2408('0x2d')]);_0x592bc4[_0x2408('0x31')]=_['intersection'](_0x8834ee[_0x2408('0x2b')],qs['fields'](_0x4b61a9[_0x2408('0x2d')][_0x2408('0x30')]));_0x592bc4[_0x2408('0x31')]=_0x592bc4[_0x2408('0x31')]['length']?_0x592bc4[_0x2408('0x31')]:_0x8834ee[_0x2408('0x2b')];if(_0x4b61a9[_0x2408('0x2d')][_0x2408('0x42')]){_0x592bc4[_0x2408('0x3c')]=[{'all':!![]}];}_0x592bc4=_[_0x2408('0x39')]({},_0x592bc4,_0x4b61a9[_0x2408('0x3b')]);return db[_0x2408('0x28')][_0x2408('0x43')](_0x592bc4)['then'](handleEntityNotFound(_0x504ced,null))[_0x2408('0x21')](respondWithResult(_0x504ced,null))[_0x2408('0x3e')](handleError(_0x504ced,null));};exports[_0x2408('0x44')]=function(_0x52de03,_0x281762){return db[_0x2408('0x28')]['create'](_0x52de03['body'],{})[_0x2408('0x21')](respondWithResult(_0x281762,0xc9))[_0x2408('0x3e')](handleError(_0x281762,null));};exports[_0x2408('0x20')]=function(_0x5e707b,_0x37dee2){if(_0x5e707b[_0x2408('0x45')]['id']){delete _0x5e707b[_0x2408('0x45')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x5e707b['params']['id']}})['then'](handleEntityNotFound(_0x37dee2,null))['then'](saveUpdates(_0x5e707b[_0x2408('0x45')],null))[_0x2408('0x21')](respondWithResult(_0x37dee2,null))[_0x2408('0x3e')](handleError(_0x37dee2,null));};exports[_0x2408('0x22')]=function(_0x2f8aec,_0x16d37b){return db[_0x2408('0x28')][_0x2408('0x43')]({'where':{'id':_0x2f8aec['params']['id']}})[_0x2408('0x21')](handleEntityNotFound(_0x16d37b,null))[_0x2408('0x21')](removeEntity(_0x16d37b,null))[_0x2408('0x3e')](handleError(_0x16d37b,null));};exports[_0x2408('0x46')]=function(_0x117afc,_0x21c343){return db[_0x2408('0x28')][_0x2408('0x46')]()[_0x2408('0x21')](respondWithResult(_0x21c343,null))[_0x2408('0x3e')](handleError(_0x21c343,null));}; \ No newline at end of file +var _0x1c1f=['intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','rows','show','options','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes'];(function(_0x2a7812,_0x1ce83a){var _0x3e1342=function(_0x3ff9fb){while(--_0x3ff9fb){_0x2a7812['push'](_0x2a7812['shift']());}};_0x3e1342(++_0x1ce83a);}(_0x1c1f,0x1b7));var _0xf1c1=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1c1f[_0x465a0c];return _0x1e202e;};'use strict';var pdf=require(_0xf1c1('0x0'));var emlformat=require(_0xf1c1('0x1'));var rimraf=require(_0xf1c1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf1c1('0x3'));var moment=require(_0xf1c1('0x4'));var BPromise=require(_0xf1c1('0x5'));var Mustache=require(_0xf1c1('0x6'));var util=require(_0xf1c1('0x7'));var path=require(_0xf1c1('0x8'));var sox=require(_0xf1c1('0x9'));var csv=require(_0xf1c1('0xa'));var ejs=require(_0xf1c1('0xb'));var fs=require('fs');var _=require(_0xf1c1('0xc'));var squel=require(_0xf1c1('0xd'));var crypto=require(_0xf1c1('0xe'));var jsforce=require(_0xf1c1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf1c1('0x10'));var Papa=require(_0xf1c1('0x11'));var Redis=require('ioredis');var authService=require(_0xf1c1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1c1('0x13'));var logger=require(_0xf1c1('0x14'))(_0xf1c1('0x15'));var utils=require(_0xf1c1('0x16'));var config=require(_0xf1c1('0x17'));var db=require(_0xf1c1('0x18'))['db'];function respondWithStatusCode(_0x448f2f,_0x34ef19){_0x34ef19=_0x34ef19||0xcc;return function(_0x579f74){if(_0x579f74){return _0x448f2f[_0xf1c1('0x19')](_0x34ef19);}return _0x448f2f[_0xf1c1('0x1a')](_0x34ef19)[_0xf1c1('0x1b')]();};}function respondWithResult(_0x32f569,_0x5bede0){_0x5bede0=_0x5bede0||0xc8;return function(_0x225667){if(_0x225667){return _0x32f569[_0xf1c1('0x1a')](_0x5bede0)[_0xf1c1('0x1c')](_0x225667);}};}function respondWithFilteredResult(_0x172470,_0x452464){return function(_0x4f0208){if(_0x4f0208){var _0x18c4a3=_0x4f0208[_0xf1c1('0x1d')],_0xc44ee8=_0x452464[_0xf1c1('0x1e')],_0x599ce8=_0x452464[_0xf1c1('0x1e')]+_0x452464[_0xf1c1('0x1f')],_0x12856a;if(_0x599ce8>=_0x18c4a3){_0x599ce8=_0x18c4a3;_0x12856a=0xc8;}else{_0x12856a=0xce;}_0x172470[_0xf1c1('0x1a')](_0x12856a);return _0x172470['set'](_0xf1c1('0x20'),_0xc44ee8+'-'+_0x599ce8+'/'+_0x18c4a3)[_0xf1c1('0x1c')](_0x4f0208);}return null;};}function patchUpdates(_0x7bdfa4){return function(_0x1fff12){try{jsonpatch[_0xf1c1('0x21')](_0x1fff12,_0x7bdfa4,!![]);}catch(_0x4343fd){return BPromise[_0xf1c1('0x22')](_0x4343fd);}return _0x1fff12[_0xf1c1('0x23')]();};}function saveUpdates(_0x1a1c42,_0x2e2e5e){return function(_0x357d9a){if(_0x357d9a){return _0x357d9a[_0xf1c1('0x24')](_0x1a1c42)[_0xf1c1('0x25')](function(_0x1b083b){return _0x1b083b;});}return null;};}function removeEntity(_0x59db58,_0x841108){return function(_0x8caa53){if(_0x8caa53){return _0x8caa53[_0xf1c1('0x26')]()[_0xf1c1('0x25')](function(){_0x59db58['status'](0xcc)[_0xf1c1('0x1b')]();});}};}function handleEntityNotFound(_0x47ef55,_0x581915){return function(_0x7ff0dd){if(!_0x7ff0dd){_0x47ef55[_0xf1c1('0x19')](0x194);}return _0x7ff0dd;};}function handleError(_0x19af8b,_0x39a864){_0x39a864=_0x39a864||0x1f4;return function(_0x459c31){logger[_0xf1c1('0x27')](_0x459c31['stack']);if(_0x459c31[_0xf1c1('0x28')]){delete _0x459c31[_0xf1c1('0x28')];}_0x19af8b[_0xf1c1('0x1a')](_0x39a864)['send'](_0x459c31);};}exports['index']=function(_0x4cefa0,_0x3aed96){var _0x58e50c={},_0x899c3e={},_0x3ef459={'count':0x0,'rows':[]};var _0x9650ee=_[_0xf1c1('0x29')](db[_0xf1c1('0x2a')][_0xf1c1('0x2b')],function(_0x4fb152){return{'name':_0x4fb152[_0xf1c1('0x2c')],'type':_0x4fb152[_0xf1c1('0x2d')]['key']};});_0x899c3e[_0xf1c1('0x2e')]=_[_0xf1c1('0x29')](_0x9650ee,'name');_0x899c3e[_0xf1c1('0x2f')]=_[_0xf1c1('0x30')](_0x4cefa0[_0xf1c1('0x2f')]);_0x899c3e[_0xf1c1('0x31')]=_['intersection'](_0x899c3e[_0xf1c1('0x2e')],_0x899c3e[_0xf1c1('0x2f')]);_0x58e50c[_0xf1c1('0x32')]=_[_0xf1c1('0x33')](_0x899c3e[_0xf1c1('0x2e')],qs[_0xf1c1('0x34')](_0x4cefa0['query'][_0xf1c1('0x34')]));_0x58e50c[_0xf1c1('0x32')]=_0x58e50c[_0xf1c1('0x32')][_0xf1c1('0x35')]?_0x58e50c[_0xf1c1('0x32')]:_0x899c3e['model'];if(!_0x4cefa0[_0xf1c1('0x2f')]['hasOwnProperty']('nolimit')){_0x58e50c['limit']=qs[_0xf1c1('0x1f')](_0x4cefa0[_0xf1c1('0x2f')][_0xf1c1('0x1f')]);_0x58e50c[_0xf1c1('0x1e')]=qs[_0xf1c1('0x1e')](_0x4cefa0[_0xf1c1('0x2f')][_0xf1c1('0x1e')]);}_0x58e50c[_0xf1c1('0x36')]=qs['sort'](_0x4cefa0[_0xf1c1('0x2f')][_0xf1c1('0x37')]);_0x58e50c[_0xf1c1('0x38')]=qs[_0xf1c1('0x31')](_[_0xf1c1('0x39')](_0x4cefa0[_0xf1c1('0x2f')],_0x899c3e[_0xf1c1('0x31')]));if(_0x4cefa0[_0xf1c1('0x2f')]['filter']){_0x58e50c['where']=_[_0xf1c1('0x3a')](_0x58e50c['where'],{'$or':_[_0xf1c1('0x29')](_0x9650ee,function(_0x80f59d){if(_0x80f59d[_0xf1c1('0x2d')]!==_0xf1c1('0x3b')){var _0x25b5c7={};_0x25b5c7[_0x80f59d['name']]={'$like':'%'+_0x4cefa0[_0xf1c1('0x2f')][_0xf1c1('0x3c')]+'%'};return _0x25b5c7;}})});}_0x58e50c=_[_0xf1c1('0x3a')]({},_0x58e50c,_0x4cefa0['options']);var _0x54e2b7={'where':_0x58e50c[_0xf1c1('0x38')]};return db['SmsQueueReport'][_0xf1c1('0x1d')](_0x54e2b7)[_0xf1c1('0x25')](function(_0x2c72ff){_0x3ef459[_0xf1c1('0x1d')]=_0x2c72ff;if(_0x4cefa0['query']['includeAll']){_0x58e50c['include']=[{'all':!![]}];}return db[_0xf1c1('0x2a')]['findAll'](_0x58e50c);})[_0xf1c1('0x25')](function(_0xec20ca){_0x3ef459[_0xf1c1('0x3d')]=_0xec20ca;return _0x3ef459;})[_0xf1c1('0x25')](respondWithFilteredResult(_0x3aed96,_0x58e50c))['catch'](handleError(_0x3aed96,null));};exports[_0xf1c1('0x3e')]=function(_0x1e1ee6,_0x4e664c){var _0x28a356={'raw':!![],'where':{'id':_0x1e1ee6['params']['id']}},_0x83be6b={};_0x83be6b[_0xf1c1('0x2e')]=_[_0xf1c1('0x30')](db[_0xf1c1('0x2a')][_0xf1c1('0x2b')]);_0x83be6b['query']=_['keys'](_0x1e1ee6['query']);_0x83be6b[_0xf1c1('0x31')]=_[_0xf1c1('0x33')](_0x83be6b['model'],_0x83be6b[_0xf1c1('0x2f')]);_0x28a356['attributes']=_[_0xf1c1('0x33')](_0x83be6b[_0xf1c1('0x2e')],qs[_0xf1c1('0x34')](_0x1e1ee6['query'][_0xf1c1('0x34')]));_0x28a356['attributes']=_0x28a356[_0xf1c1('0x32')][_0xf1c1('0x35')]?_0x28a356[_0xf1c1('0x32')]:_0x83be6b['model'];if(_0x1e1ee6['query']['includeAll']){_0x28a356['include']=[{'all':!![]}];}_0x28a356=_[_0xf1c1('0x3a')]({},_0x28a356,_0x1e1ee6[_0xf1c1('0x3f')]);return db[_0xf1c1('0x2a')][_0xf1c1('0x40')](_0x28a356)['then'](handleEntityNotFound(_0x4e664c,null))[_0xf1c1('0x25')](respondWithResult(_0x4e664c,null))[_0xf1c1('0x41')](handleError(_0x4e664c,null));};exports[_0xf1c1('0x42')]=function(_0x4b52bd,_0x33b91f){return db['SmsQueueReport']['create'](_0x4b52bd[_0xf1c1('0x43')],{})[_0xf1c1('0x25')](respondWithResult(_0x33b91f,0xc9))[_0xf1c1('0x41')](handleError(_0x33b91f,null));};exports[_0xf1c1('0x24')]=function(_0x535ab3,_0x4b321b){if(_0x535ab3[_0xf1c1('0x43')]['id']){delete _0x535ab3[_0xf1c1('0x43')]['id'];}return db[_0xf1c1('0x2a')][_0xf1c1('0x40')]({'where':{'id':_0x535ab3[_0xf1c1('0x44')]['id']}})[_0xf1c1('0x25')](handleEntityNotFound(_0x4b321b,null))[_0xf1c1('0x25')](saveUpdates(_0x535ab3[_0xf1c1('0x43')],null))['then'](respondWithResult(_0x4b321b,null))['catch'](handleError(_0x4b321b,null));};exports[_0xf1c1('0x26')]=function(_0x2e96d1,_0x5efd35){return db['SmsQueueReport']['find']({'where':{'id':_0x2e96d1['params']['id']}})['then'](handleEntityNotFound(_0x5efd35,null))[_0xf1c1('0x25')](removeEntity(_0x5efd35,null))[_0xf1c1('0x41')](handleError(_0x5efd35,null));};exports[_0xf1c1('0x45')]=function(_0xe0de89,_0x2d380d){return db[_0xf1c1('0x2a')]['describe']()[_0xf1c1('0x25')](respondWithResult(_0x2d380d,null))[_0xf1c1('0x41')](handleError(_0x2d380d,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 25f4874..59cb7b8 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4c2=['bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','SmsQueueReport','uniqueid','util','../../config/logger','api','moment'];(function(_0xd75f7,_0x13b2d8){var _0x1bbbba=function(_0xe241a){while(--_0xe241a){_0xd75f7['push'](_0xd75f7['shift']());}};_0x1bbbba(++_0x13b2d8);}(_0xb4c2,0x19c));var _0x2b4c=function(_0x1e9a8d,_0x1e513d){_0x1e9a8d=_0x1e9a8d-0x0;var _0x460f01=_0xb4c2[_0x1e9a8d];return _0x460f01;};'use strict';var _=require('lodash');var util=require(_0x2b4c('0x0'));var logger=require(_0x2b4c('0x1'))(_0x2b4c('0x2'));var moment=require(_0x2b4c('0x3'));var BPromise=require(_0x2b4c('0x4'));var rp=require(_0x2b4c('0x5'));var fs=require('fs');var path=require(_0x2b4c('0x6'));var rimraf=require(_0x2b4c('0x7'));var config=require(_0x2b4c('0x8'));var attributes=require(_0x2b4c('0x9'));module[_0x2b4c('0xa')]=function(_0x537f4c,_0x178ca5){return _0x537f4c['define'](_0x2b4c('0xb'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x2b4c('0xc'),'fields':[_0x2b4c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c95=['request-promise','path','rimraf','../../config/environment','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3a0974,_0x232683){var _0x4463f4=function(_0x4ad98d){while(--_0x4ad98d){_0x3a0974['push'](_0x3a0974['shift']());}};_0x4463f4(++_0x232683);}(_0x4c95,0x180));var _0x54c9=function(_0x216f9a,_0x414301){_0x216f9a=_0x216f9a-0x0;var _0x36f8c4=_0x4c95[_0x216f9a];return _0x36f8c4;};'use strict';var _=require(_0x54c9('0x0'));var util=require(_0x54c9('0x1'));var logger=require(_0x54c9('0x2'))(_0x54c9('0x3'));var moment=require(_0x54c9('0x4'));var BPromise=require(_0x54c9('0x5'));var rp=require(_0x54c9('0x6'));var fs=require('fs');var path=require(_0x54c9('0x7'));var rimraf=require(_0x54c9('0x8'));var config=require(_0x54c9('0x9'));var attributes=require('./smsQueueReport.attributes');module[_0x54c9('0xa')]=function(_0x558793,_0x4fa817){return _0x558793[_0x54c9('0xb')](_0x54c9('0xc'),attributes,{'tableName':_0x54c9('0xd'),'paranoid':![],'indexes':[{'name':_0x54c9('0xe'),'fields':[_0x54c9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 791f000..028d621 100644 --- a/server/api/smsQueueReport/smsQueueReport.rpc.js +++ b/server/api/smsQueueReport/smsQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5edd=['moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','SmsQueueReport','create','options','raw','CreateSmsQueueReport','stringify','catch','update','body','attributes','limit','UpdateSmsQueueReport','lodash','util'];(function(_0x8e2d4d,_0x310930){var _0x5e3047=function(_0x4665e4){while(--_0x4665e4){_0x8e2d4d['push'](_0x8e2d4d['shift']());}};_0x5e3047(++_0x310930);}(_0x5edd,0xa3));var _0xd5ed=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x5edd[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xd5ed('0x0'));var util=require(_0xd5ed('0x1'));var moment=require(_0xd5ed('0x2'));var BPromise=require(_0xd5ed('0x3'));var rs=require(_0xd5ed('0x4'));var fs=require('fs');var Redis=require(_0xd5ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd5ed('0x6'))('rpc');var config=require(_0xd5ed('0x7'));var jayson=require(_0xd5ed('0x8'));var client=jayson['client'][_0xd5ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28ac1f,_0x549726,_0x4da0a4){return new BPromise(function(_0x418e3c,_0x55665d){return client[_0xd5ed('0xa')](_0x28ac1f,_0x4da0a4)[_0xd5ed('0xb')](function(_0x459346){logger['info'](_0xd5ed('0xc'),_0x549726,'request\x20sent');logger[_0xd5ed('0xd')](_0xd5ed('0xe'),_0x549726,_0xd5ed('0xf'),JSON['stringify'](_0x459346));if(_0x459346[_0xd5ed('0x10')]){if(_0x459346[_0xd5ed('0x10')][_0xd5ed('0x11')]===0x1f4){logger[_0xd5ed('0x10')](_0xd5ed('0xc'),_0x549726,_0x459346[_0xd5ed('0x10')][_0xd5ed('0x12')]);return _0x55665d(_0x459346[_0xd5ed('0x10')][_0xd5ed('0x12')]);}logger['error'](_0xd5ed('0xc'),_0x549726,_0x459346['error'][_0xd5ed('0x12')]);return _0x418e3c(_0x459346[_0xd5ed('0x10')]['message']);}else{logger[_0xd5ed('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x549726,_0xd5ed('0xf'));_0x418e3c(_0x459346[_0xd5ed('0x14')]['message']);}})['catch'](function(_0x2babb7){logger[_0xd5ed('0x10')](_0xd5ed('0xc'),_0x549726,_0x2babb7);_0x55665d(_0x2babb7);});});}exports['CreateSmsQueueReport']=function(_0x5598da){var _0x3496bd=this;return new Promise(function(_0xe0c2ea,_0x515a91){return db[_0xd5ed('0x15')][_0xd5ed('0x16')](_0x5598da['body'],{'raw':_0x5598da[_0xd5ed('0x17')]?_0x5598da[_0xd5ed('0x17')][_0xd5ed('0x18')]===undefined?!![]:![]:!![]})[_0xd5ed('0xb')](function(_0x586571){logger['info'](_0xd5ed('0x19'),_0x5598da);logger['debug']('CreateSmsQueueReport',_0x5598da,JSON[_0xd5ed('0x1a')](_0x586571));_0xe0c2ea(_0x586571);})[_0xd5ed('0x1b')](function(_0x1365b5){logger[_0xd5ed('0x10')](_0xd5ed('0x19'),_0x1365b5['message'],_0x5598da);_0x515a91(_0x3496bd[_0xd5ed('0x10')](0x1f4,_0x1365b5[_0xd5ed('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x1ac185){var _0x5a1c03=this;return new Promise(function(_0x58e5c3,_0x3667b7){return db[_0xd5ed('0x15')][_0xd5ed('0x1c')](_0x1ac185[_0xd5ed('0x1d')],{'raw':_0x1ac185[_0xd5ed('0x17')]?_0x1ac185[_0xd5ed('0x17')][_0xd5ed('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ac185[_0xd5ed('0x17')]?_0x1ac185[_0xd5ed('0x17')]['where']||null:null,'attributes':_0x1ac185[_0xd5ed('0x17')]?_0x1ac185[_0xd5ed('0x17')][_0xd5ed('0x1e')]||null:null,'limit':_0x1ac185[_0xd5ed('0x17')]?_0x1ac185[_0xd5ed('0x17')][_0xd5ed('0x1f')]||null:null})[_0xd5ed('0xb')](function(_0x5ab749){logger[_0xd5ed('0x13')](_0xd5ed('0x20'),_0x1ac185);logger[_0xd5ed('0xd')](_0xd5ed('0x20'),_0x1ac185,JSON['stringify'](_0x5ab749));_0x58e5c3(_0x5ab749);})[_0xd5ed('0x1b')](function(_0x54f0ae){logger[_0xd5ed('0x10')]('UpdateSmsQueueReport',_0x54f0ae[_0xd5ed('0x12')],_0x1ac185);_0x3667b7(_0x5a1c03['error'](0x1f4,_0x54f0ae[_0xd5ed('0x12')]));});});}; \ No newline at end of file +var _0x99c4=['../../config/utils','../../config/logger','rpc','jayson/promise','client','then','request\x20sent','debug','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','UpdateSmsQueueReport','update','attributes','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x99c4,0xdb));var _0x499c=function(_0x17a3b9,_0x3eaed6){_0x17a3b9=_0x17a3b9-0x0;var _0x58907c=_0x99c4[_0x17a3b9];return _0x58907c;};'use strict';var _=require(_0x499c('0x0'));var util=require(_0x499c('0x1'));var moment=require(_0x499c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x499c('0x3'));var db=require(_0x499c('0x4'))['db'];var utils=require(_0x499c('0x5'));var logger=require(_0x499c('0x6'))(_0x499c('0x7'));var config=require('../../config/environment');var jayson=require(_0x499c('0x8'));var client=jayson[_0x499c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28eca5,_0x1156bd,_0x517a44){return new BPromise(function(_0x5c951d,_0xfe66b1){return client['request'](_0x28eca5,_0x517a44)[_0x499c('0xa')](function(_0x5d87e6){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x1156bd,_0x499c('0xb'));logger[_0x499c('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1156bd,'request\x20sent',JSON[_0x499c('0xd')](_0x5d87e6));if(_0x5d87e6[_0x499c('0xe')]){if(_0x5d87e6[_0x499c('0xe')]['code']===0x1f4){logger[_0x499c('0xe')](_0x499c('0xf'),_0x1156bd,_0x5d87e6[_0x499c('0xe')][_0x499c('0x10')]);return _0xfe66b1(_0x5d87e6['error']['message']);}logger[_0x499c('0xe')](_0x499c('0xf'),_0x1156bd,_0x5d87e6['error'][_0x499c('0x10')]);return _0x5c951d(_0x5d87e6[_0x499c('0xe')][_0x499c('0x10')]);}else{logger[_0x499c('0x11')](_0x499c('0xf'),_0x1156bd,_0x499c('0xb'));_0x5c951d(_0x5d87e6[_0x499c('0x12')][_0x499c('0x10')]);}})[_0x499c('0x13')](function(_0x3c783a){logger[_0x499c('0xe')](_0x499c('0xf'),_0x1156bd,_0x3c783a);_0xfe66b1(_0x3c783a);});});}exports[_0x499c('0x14')]=function(_0x317e1a){var _0x21606f=this;return new Promise(function(_0x5a579a,_0x167bec){return db[_0x499c('0x15')]['create'](_0x317e1a[_0x499c('0x16')],{'raw':_0x317e1a[_0x499c('0x17')]?_0x317e1a[_0x499c('0x17')][_0x499c('0x18')]===undefined?!![]:![]:!![]})[_0x499c('0xa')](function(_0xabeddd){logger[_0x499c('0x11')]('CreateSmsQueueReport',_0x317e1a);logger['debug'](_0x499c('0x14'),_0x317e1a,JSON[_0x499c('0xd')](_0xabeddd));_0x5a579a(_0xabeddd);})[_0x499c('0x13')](function(_0x49f9b0){logger[_0x499c('0xe')](_0x499c('0x14'),_0x49f9b0[_0x499c('0x10')],_0x317e1a);_0x167bec(_0x21606f['error'](0x1f4,_0x49f9b0[_0x499c('0x10')]));});});};exports[_0x499c('0x19')]=function(_0x181b8d){var _0x5cccdd=this;return new Promise(function(_0x30d8a9,_0xb8b53e){return db[_0x499c('0x15')][_0x499c('0x1a')](_0x181b8d[_0x499c('0x16')],{'raw':_0x181b8d[_0x499c('0x17')]?_0x181b8d['options'][_0x499c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x181b8d[_0x499c('0x17')]?_0x181b8d[_0x499c('0x17')]['where']||null:null,'attributes':_0x181b8d[_0x499c('0x17')]?_0x181b8d[_0x499c('0x17')][_0x499c('0x1b')]||null:null,'limit':_0x181b8d[_0x499c('0x17')]?_0x181b8d['options']['limit']||null:null})['then'](function(_0x4741e6){logger[_0x499c('0x11')]('UpdateSmsQueueReport',_0x181b8d);logger[_0x499c('0xc')](_0x499c('0x19'),_0x181b8d,JSON['stringify'](_0x4741e6));_0x30d8a9(_0x4741e6);})['catch'](function(_0x1daffe){logger['error'](_0x499c('0x19'),_0x1daffe['message'],_0x181b8d);_0xb8b53e(_0x5cccdd['error'](0x1f4,_0x1daffe[_0x499c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index ff937e6..b146c5f 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0xd6a1c9,_0x203324){var _0x51ea29=function(_0x165a30){while(--_0x165a30){_0xd6a1c9['push'](_0xd6a1c9['shift']());}};_0x51ea29(++_0x203324);}(_0x5c00,0x17e));var _0x05c0=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0x5c00[_0x30f5bb];return _0x1cfc00;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x9')]);router[_0x05c0('0xa')](_0x05c0('0xb'),auth['isAuthenticated'](),controller[_0x05c0('0xc')]);router[_0x05c0('0xa')](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0xe')]);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')](_0x05c0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x05c0('0x12')]('/:id',auth[_0x05c0('0x8')](),controller[_0x05c0('0x13')]);module[_0x05c0('0x14')]=router; \ No newline at end of file +var _0xda3f=['../../components/auth/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','describe','get','/:id','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x4a1d9f,_0x53547f){var _0x347d7d=function(_0x4b2130){while(--_0x4b2130){_0x4a1d9f['push'](_0x4a1d9f['shift']());}};_0x347d7d(++_0x53547f);}(_0xda3f,0xec));var _0xfda3=function(_0x5e98d1,_0x5afddc){_0x5e98d1=_0x5e98d1-0x0;var _0x423245=_0xda3f[_0x5e98d1];return _0x423245;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xfda3('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xfda3('0x3'));var controller=require(_0xfda3('0x4'));router['get']('/',auth[_0xfda3('0x5')](),controller[_0xfda3('0x6')]);router['get']('/describe',auth[_0xfda3('0x5')](),controller[_0xfda3('0x7')]);router[_0xfda3('0x8')](_0xfda3('0x9'),auth[_0xfda3('0x5')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')]('/',auth[_0xfda3('0x5')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x9'),auth[_0xfda3('0x5')](),controller['update']);router[_0xfda3('0xe')](_0xfda3('0x9'),auth[_0xfda3('0x5')](),controller[_0xfda3('0xf')]);module[_0xfda3('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 4705c09..48f928d 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97ba=['agent','queue','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97ba,0x108));var _0xa97b=function(_0x314143,_0x1d17e0){_0x314143=_0x314143-0x0;var _0x59e670=_0x97ba[_0x314143];return _0x59e670;};'use strict';var moment=require(_0xa97b('0x0'));var Sequelize=require(_0xa97b('0x1'));module[_0xa97b('0x2')]={'uniqueid':{'type':Sequelize[_0xa97b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa97b('0x4')](_0xa97b('0x5'),_0xa97b('0x6'),_0xa97b('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xa97b('0x8')]}}; \ No newline at end of file +var _0x6673=['queue','DATE','NOW','moment','sequelize','exports','agent'];(function(_0x5bb281,_0x5a61d4){var _0x2e8bfd=function(_0x40eb1e){while(--_0x40eb1e){_0x5bb281['push'](_0x5bb281['shift']());}};_0x2e8bfd(++_0x5a61d4);}(_0x6673,0x199));var _0x3667=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x6673[_0x266618];return _0x54dbf5;};'use strict';var moment=require(_0x3667('0x0'));var Sequelize=require(_0x3667('0x1'));module[_0x3667('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x3667('0x3'),_0x3667('0x4')),'allowNull':![],'defaultValue':_0x3667('0x4')},'transferredAt':{'type':Sequelize[_0x3667('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x3667('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 90de422..9810204 100644 --- a/server/api/smsTransferReport/smsTransferReport.controller.js +++ b/server/api/smsTransferReport/smsTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfae=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','save','update','then','destroy','end','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','keys','length','create','body','find','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x10fb69,_0x4d044d){var _0x4a113d=function(_0x2147d3){while(--_0x2147d3){_0x10fb69['push'](_0x10fb69['shift']());}};_0x4a113d(++_0x4d044d);}(_0xdfae,0xbf));var _0xedfa=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0xdfae[_0xe1a3a5];return _0x362646;};'use strict';var pdf=require(_0xedfa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xedfa('0x1'));var zipdir=require(_0xedfa('0x2'));var jsonpatch=require(_0xedfa('0x3'));var rp=require(_0xedfa('0x4'));var moment=require(_0xedfa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xedfa('0x6'));var util=require(_0xedfa('0x7'));var path=require(_0xedfa('0x8'));var sox=require('sox');var csv=require(_0xedfa('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xedfa('0xa'));var crypto=require(_0xedfa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xedfa('0xc'));var toCsv=require(_0xedfa('0x9'));var querystring=require(_0xedfa('0xd'));var Papa=require(_0xedfa('0xe'));var Redis=require('ioredis');var authService=require(_0xedfa('0xf'));var qs=require(_0xedfa('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedfa('0x11'));var logger=require(_0xedfa('0x12'))(_0xedfa('0x13'));var utils=require(_0xedfa('0x14'));var config=require(_0xedfa('0x15'));var db=require(_0xedfa('0x16'))['db'];function respondWithStatusCode(_0x42d493,_0x8d8c1e){_0x8d8c1e=_0x8d8c1e||0xcc;return function(_0x1a952f){if(_0x1a952f){return _0x42d493[_0xedfa('0x17')](_0x8d8c1e);}return _0x42d493['status'](_0x8d8c1e)['end']();};}function respondWithResult(_0x61509e,_0x1f155){_0x1f155=_0x1f155||0xc8;return function(_0x6fcec4){if(_0x6fcec4){return _0x61509e[_0xedfa('0x18')](_0x1f155)[_0xedfa('0x19')](_0x6fcec4);}};}function respondWithFilteredResult(_0x5b4fac,_0x4ec98a){return function(_0x254336){if(_0x254336){var _0x130fb6=_0x254336[_0xedfa('0x1a')],_0x309e4a=_0x4ec98a[_0xedfa('0x1b')],_0x4e7635=_0x4ec98a[_0xedfa('0x1b')]+_0x4ec98a[_0xedfa('0x1c')],_0x5e4d04;if(_0x4e7635>=_0x130fb6){_0x4e7635=_0x130fb6;_0x5e4d04=0xc8;}else{_0x5e4d04=0xce;}_0x5b4fac[_0xedfa('0x18')](_0x5e4d04);return _0x5b4fac[_0xedfa('0x1d')]('Content-Range',_0x309e4a+'-'+_0x4e7635+'/'+_0x130fb6)[_0xedfa('0x19')](_0x254336);}return null;};}function patchUpdates(_0x2b64bc){return function(_0x2d8e05){try{jsonpatch['apply'](_0x2d8e05,_0x2b64bc,!![]);}catch(_0x3e4a4b){return BPromise['reject'](_0x3e4a4b);}return _0x2d8e05[_0xedfa('0x1e')]();};}function saveUpdates(_0x8a4447,_0x4c7e78){return function(_0x900337){if(_0x900337){return _0x900337[_0xedfa('0x1f')](_0x8a4447)[_0xedfa('0x20')](function(_0x5c2b30){return _0x5c2b30;});}return null;};}function removeEntity(_0xc98ae6,_0x437cb4){return function(_0x5111c5){if(_0x5111c5){return _0x5111c5[_0xedfa('0x21')]()[_0xedfa('0x20')](function(){_0xc98ae6['status'](0xcc)[_0xedfa('0x22')]();});}};}function handleEntityNotFound(_0x57eb2e,_0x5cd57b){return function(_0x56a2c2){if(!_0x56a2c2){_0x57eb2e[_0xedfa('0x17')](0x194);}return _0x56a2c2;};}function handleError(_0x41d801,_0x21a820){_0x21a820=_0x21a820||0x1f4;return function(_0x2c7f01){logger['error'](_0x2c7f01[_0xedfa('0x23')]);if(_0x2c7f01[_0xedfa('0x24')]){delete _0x2c7f01[_0xedfa('0x24')];}_0x41d801['status'](_0x21a820)['send'](_0x2c7f01);};}exports['index']=function(_0x53ebf4,_0x189b82){var _0x383f7b={},_0x4c7904={},_0x28cb34={'count':0x0,'rows':[]};var _0x148959=_[_0xedfa('0x25')](db[_0xedfa('0x26')][_0xedfa('0x27')],function(_0x3ea7c3){return{'name':_0x3ea7c3[_0xedfa('0x28')],'type':_0x3ea7c3[_0xedfa('0x29')][_0xedfa('0x2a')]};});_0x4c7904[_0xedfa('0x2b')]=_[_0xedfa('0x25')](_0x148959,_0xedfa('0x24'));_0x4c7904['query']=_['keys'](_0x53ebf4['query']);_0x4c7904['filters']=_[_0xedfa('0x2c')](_0x4c7904[_0xedfa('0x2b')],_0x4c7904[_0xedfa('0x2d')]);_0x383f7b[_0xedfa('0x2e')]=_['intersection'](_0x4c7904[_0xedfa('0x2b')],qs[_0xedfa('0x2f')](_0x53ebf4['query']['fields']));_0x383f7b[_0xedfa('0x2e')]=_0x383f7b['attributes']['length']?_0x383f7b[_0xedfa('0x2e')]:_0x4c7904[_0xedfa('0x2b')];if(!_0x53ebf4[_0xedfa('0x2d')]['hasOwnProperty']('nolimit')){_0x383f7b[_0xedfa('0x1c')]=qs['limit'](_0x53ebf4['query'][_0xedfa('0x1c')]);_0x383f7b['offset']=qs['offset'](_0x53ebf4[_0xedfa('0x2d')][_0xedfa('0x1b')]);}_0x383f7b[_0xedfa('0x30')]=qs['sort'](_0x53ebf4[_0xedfa('0x2d')][_0xedfa('0x31')]);_0x383f7b[_0xedfa('0x32')]=qs['filters'](_[_0xedfa('0x33')](_0x53ebf4[_0xedfa('0x2d')],_0x4c7904[_0xedfa('0x34')]));if(_0x53ebf4['query'][_0xedfa('0x35')]){_0x383f7b[_0xedfa('0x32')]=_['merge'](_0x383f7b['where'],{'$or':_[_0xedfa('0x25')](_0x148959,function(_0x37d849){if(_0x37d849['type']!==_0xedfa('0x36')){var _0xfe78fc={};_0xfe78fc[_0x37d849[_0xedfa('0x24')]]={'$like':'%'+_0x53ebf4['query']['filter']+'%'};return _0xfe78fc;}})});}_0x383f7b=_[_0xedfa('0x37')]({},_0x383f7b,_0x53ebf4[_0xedfa('0x38')]);var _0x309d57={'where':_0x383f7b[_0xedfa('0x32')]};return db[_0xedfa('0x26')][_0xedfa('0x1a')](_0x309d57)[_0xedfa('0x20')](function(_0x50a318){_0x28cb34['count']=_0x50a318;if(_0x53ebf4['query'][_0xedfa('0x39')]){_0x383f7b['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xedfa('0x3a')](_0x383f7b);})[_0xedfa('0x20')](function(_0x1da72a){_0x28cb34[_0xedfa('0x3b')]=_0x1da72a;return _0x28cb34;})[_0xedfa('0x20')](respondWithFilteredResult(_0x189b82,_0x383f7b))[_0xedfa('0x3c')](handleError(_0x189b82,null));};exports[_0xedfa('0x3d')]=function(_0x3180cb,_0x1ef4ef){var _0x47911a={'raw':!![],'where':{'id':_0x3180cb['params']['id']}},_0x4c202f={};_0x4c202f[_0xedfa('0x2b')]=_[_0xedfa('0x3e')](db[_0xedfa('0x26')][_0xedfa('0x27')]);_0x4c202f[_0xedfa('0x2d')]=_[_0xedfa('0x3e')](_0x3180cb[_0xedfa('0x2d')]);_0x4c202f[_0xedfa('0x34')]=_[_0xedfa('0x2c')](_0x4c202f[_0xedfa('0x2b')],_0x4c202f[_0xedfa('0x2d')]);_0x47911a['attributes']=_[_0xedfa('0x2c')](_0x4c202f[_0xedfa('0x2b')],qs[_0xedfa('0x2f')](_0x3180cb[_0xedfa('0x2d')][_0xedfa('0x2f')]));_0x47911a[_0xedfa('0x2e')]=_0x47911a['attributes'][_0xedfa('0x3f')]?_0x47911a[_0xedfa('0x2e')]:_0x4c202f[_0xedfa('0x2b')];if(_0x3180cb[_0xedfa('0x2d')][_0xedfa('0x39')]){_0x47911a['include']=[{'all':!![]}];}_0x47911a=_[_0xedfa('0x37')]({},_0x47911a,_0x3180cb[_0xedfa('0x38')]);return db[_0xedfa('0x26')]['find'](_0x47911a)[_0xedfa('0x20')](handleEntityNotFound(_0x1ef4ef,null))['then'](respondWithResult(_0x1ef4ef,null))['catch'](handleError(_0x1ef4ef,null));};exports['create']=function(_0x3b0ba7,_0x5af443){return db[_0xedfa('0x26')][_0xedfa('0x40')](_0x3b0ba7['body'],{})[_0xedfa('0x20')](respondWithResult(_0x5af443,0xc9))[_0xedfa('0x3c')](handleError(_0x5af443,null));};exports[_0xedfa('0x1f')]=function(_0x33b305,_0x482400){if(_0x33b305[_0xedfa('0x41')]['id']){delete _0x33b305[_0xedfa('0x41')]['id'];}return db[_0xedfa('0x26')][_0xedfa('0x42')]({'where':{'id':_0x33b305[_0xedfa('0x43')]['id']}})[_0xedfa('0x20')](handleEntityNotFound(_0x482400,null))['then'](saveUpdates(_0x33b305[_0xedfa('0x41')],null))[_0xedfa('0x20')](respondWithResult(_0x482400,null))[_0xedfa('0x3c')](handleError(_0x482400,null));};exports['destroy']=function(_0x546fd5,_0x57d189){return db[_0xedfa('0x26')][_0xedfa('0x42')]({'where':{'id':_0x546fd5[_0xedfa('0x43')]['id']}})[_0xedfa('0x20')](handleEntityNotFound(_0x57d189,null))[_0xedfa('0x20')](removeEntity(_0x57d189,null))['catch'](handleError(_0x57d189,null));};exports[_0xedfa('0x44')]=function(_0x2fac81,_0x2277d7){return db[_0xedfa('0x26')][_0xedfa('0x44')]()[_0xedfa('0x20')](respondWithResult(_0x2277d7,null))['catch'](handleError(_0x2277d7,null));}; \ No newline at end of file +var _0xc93a=['json','apply','reject','update','then','destroy','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','SmsTransferReport','rawAttributes','attributes','find','catch','create','body','params','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range'];(function(_0xcee548,_0x28f18a){var _0x329a2a=function(_0x197dc1){while(--_0x197dc1){_0xcee548['push'](_0xcee548['shift']());}};_0x329a2a(++_0x28f18a);}(_0xc93a,0x1db));var _0xac93=function(_0x5e803e,_0x2daf9c){_0x5e803e=_0x5e803e-0x0;var _0x4b09a0=_0xc93a[_0x5e803e];return _0x4b09a0;};'use strict';var pdf=require(_0xac93('0x0'));var emlformat=require(_0xac93('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xac93('0x2'));var rp=require(_0xac93('0x3'));var moment=require(_0xac93('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac93('0x5'));var util=require(_0xac93('0x6'));var path=require(_0xac93('0x7'));var sox=require(_0xac93('0x8'));var csv=require('to-csv');var ejs=require(_0xac93('0x9'));var fs=require('fs');var _=require(_0xac93('0xa'));var squel=require('squel');var crypto=require(_0xac93('0xb'));var jsforce=require(_0xac93('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xac93('0xd'));var Redis=require(_0xac93('0xe'));var authService=require(_0xac93('0xf'));var qs=require(_0xac93('0x10'));var as=require(_0xac93('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac93('0x12'))(_0xac93('0x13'));var utils=require(_0xac93('0x14'));var config=require('../../config/environment');var db=require(_0xac93('0x15'))['db'];function respondWithStatusCode(_0x2566fd,_0x2b2d77){_0x2b2d77=_0x2b2d77||0xcc;return function(_0x33ed8f){if(_0x33ed8f){return _0x2566fd[_0xac93('0x16')](_0x2b2d77);}return _0x2566fd[_0xac93('0x17')](_0x2b2d77)[_0xac93('0x18')]();};}function respondWithResult(_0x224bda,_0x5a762d){_0x5a762d=_0x5a762d||0xc8;return function(_0x327304){if(_0x327304){return _0x224bda['status'](_0x5a762d)['json'](_0x327304);}};}function respondWithFilteredResult(_0x420fa8,_0x43c17d){return function(_0x4ebc36){if(_0x4ebc36){var _0x4f22a5=_0x4ebc36['count'],_0x5632fb=_0x43c17d['offset'],_0x3f88a8=_0x43c17d[_0xac93('0x19')]+_0x43c17d[_0xac93('0x1a')],_0x1815e7;if(_0x3f88a8>=_0x4f22a5){_0x3f88a8=_0x4f22a5;_0x1815e7=0xc8;}else{_0x1815e7=0xce;}_0x420fa8[_0xac93('0x17')](_0x1815e7);return _0x420fa8[_0xac93('0x1b')](_0xac93('0x1c'),_0x5632fb+'-'+_0x3f88a8+'/'+_0x4f22a5)[_0xac93('0x1d')](_0x4ebc36);}return null;};}function patchUpdates(_0x5b621d){return function(_0x5ef365){try{jsonpatch[_0xac93('0x1e')](_0x5ef365,_0x5b621d,!![]);}catch(_0x1ac657){return BPromise[_0xac93('0x1f')](_0x1ac657);}return _0x5ef365['save']();};}function saveUpdates(_0x3d56e5,_0x4da671){return function(_0x37623c){if(_0x37623c){return _0x37623c[_0xac93('0x20')](_0x3d56e5)[_0xac93('0x21')](function(_0x1ba0fc){return _0x1ba0fc;});}return null;};}function removeEntity(_0x14a7cc,_0xd47937){return function(_0x36c768){if(_0x36c768){return _0x36c768[_0xac93('0x22')]()[_0xac93('0x21')](function(){_0x14a7cc[_0xac93('0x17')](0xcc)[_0xac93('0x18')]();});}};}function handleEntityNotFound(_0xb6eabe,_0x59b413){return function(_0x4d8f68){if(!_0x4d8f68){_0xb6eabe[_0xac93('0x16')](0x194);}return _0x4d8f68;};}function handleError(_0x4228c9,_0x5c2409){_0x5c2409=_0x5c2409||0x1f4;return function(_0x4e90e3){logger['error'](_0x4e90e3['stack']);if(_0x4e90e3[_0xac93('0x23')]){delete _0x4e90e3['name'];}_0x4228c9['status'](_0x5c2409)['send'](_0x4e90e3);};}exports[_0xac93('0x24')]=function(_0x1f06b9,_0x3e91e9){var _0x5d5f6c={},_0x12c341={},_0x48405d={'count':0x0,'rows':[]};var _0x2ed5e7=_[_0xac93('0x25')](db['SmsTransferReport']['rawAttributes'],function(_0x4881be){return{'name':_0x4881be[_0xac93('0x26')],'type':_0x4881be[_0xac93('0x27')][_0xac93('0x28')]};});_0x12c341[_0xac93('0x29')]=_[_0xac93('0x25')](_0x2ed5e7,_0xac93('0x23'));_0x12c341[_0xac93('0x2a')]=_[_0xac93('0x2b')](_0x1f06b9['query']);_0x12c341[_0xac93('0x2c')]=_[_0xac93('0x2d')](_0x12c341[_0xac93('0x29')],_0x12c341[_0xac93('0x2a')]);_0x5d5f6c['attributes']=_[_0xac93('0x2d')](_0x12c341[_0xac93('0x29')],qs[_0xac93('0x2e')](_0x1f06b9[_0xac93('0x2a')]['fields']));_0x5d5f6c['attributes']=_0x5d5f6c['attributes'][_0xac93('0x2f')]?_0x5d5f6c['attributes']:_0x12c341[_0xac93('0x29')];if(!_0x1f06b9[_0xac93('0x2a')]['hasOwnProperty'](_0xac93('0x30'))){_0x5d5f6c[_0xac93('0x1a')]=qs[_0xac93('0x1a')](_0x1f06b9[_0xac93('0x2a')][_0xac93('0x1a')]);_0x5d5f6c[_0xac93('0x19')]=qs[_0xac93('0x19')](_0x1f06b9[_0xac93('0x2a')][_0xac93('0x19')]);}_0x5d5f6c[_0xac93('0x31')]=qs['sort'](_0x1f06b9[_0xac93('0x2a')][_0xac93('0x32')]);_0x5d5f6c[_0xac93('0x33')]=qs[_0xac93('0x2c')](_[_0xac93('0x34')](_0x1f06b9[_0xac93('0x2a')],_0x12c341[_0xac93('0x2c')]));if(_0x1f06b9[_0xac93('0x2a')][_0xac93('0x35')]){_0x5d5f6c[_0xac93('0x33')]=_[_0xac93('0x36')](_0x5d5f6c[_0xac93('0x33')],{'$or':_[_0xac93('0x25')](_0x2ed5e7,function(_0x5502d0){if(_0x5502d0['type']!==_0xac93('0x37')){var _0x12877a={};_0x12877a[_0x5502d0[_0xac93('0x23')]]={'$like':'%'+_0x1f06b9[_0xac93('0x2a')][_0xac93('0x35')]+'%'};return _0x12877a;}})});}_0x5d5f6c=_[_0xac93('0x36')]({},_0x5d5f6c,_0x1f06b9[_0xac93('0x38')]);var _0x58ae42={'where':_0x5d5f6c[_0xac93('0x33')]};return db['SmsTransferReport'][_0xac93('0x39')](_0x58ae42)[_0xac93('0x21')](function(_0x4e2a79){_0x48405d[_0xac93('0x39')]=_0x4e2a79;if(_0x1f06b9[_0xac93('0x2a')][_0xac93('0x3a')]){_0x5d5f6c[_0xac93('0x3b')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xac93('0x3c')](_0x5d5f6c);})[_0xac93('0x21')](function(_0x51582f){_0x48405d[_0xac93('0x3d')]=_0x51582f;return _0x48405d;})[_0xac93('0x21')](respondWithFilteredResult(_0x3e91e9,_0x5d5f6c))['catch'](handleError(_0x3e91e9,null));};exports[_0xac93('0x3e')]=function(_0xe69247,_0x2d0b0f){var _0x184096={'raw':!![],'where':{'id':_0xe69247['params']['id']}},_0x38d5f4={};_0x38d5f4['model']=_[_0xac93('0x2b')](db[_0xac93('0x3f')][_0xac93('0x40')]);_0x38d5f4['query']=_[_0xac93('0x2b')](_0xe69247[_0xac93('0x2a')]);_0x38d5f4[_0xac93('0x2c')]=_[_0xac93('0x2d')](_0x38d5f4['model'],_0x38d5f4[_0xac93('0x2a')]);_0x184096[_0xac93('0x41')]=_[_0xac93('0x2d')](_0x38d5f4[_0xac93('0x29')],qs[_0xac93('0x2e')](_0xe69247[_0xac93('0x2a')][_0xac93('0x2e')]));_0x184096[_0xac93('0x41')]=_0x184096[_0xac93('0x41')][_0xac93('0x2f')]?_0x184096['attributes']:_0x38d5f4[_0xac93('0x29')];if(_0xe69247[_0xac93('0x2a')][_0xac93('0x3a')]){_0x184096['include']=[{'all':!![]}];}_0x184096=_[_0xac93('0x36')]({},_0x184096,_0xe69247[_0xac93('0x38')]);return db[_0xac93('0x3f')][_0xac93('0x42')](_0x184096)[_0xac93('0x21')](handleEntityNotFound(_0x2d0b0f,null))[_0xac93('0x21')](respondWithResult(_0x2d0b0f,null))[_0xac93('0x43')](handleError(_0x2d0b0f,null));};exports['create']=function(_0x3b928d,_0x10f56f){return db[_0xac93('0x3f')][_0xac93('0x44')](_0x3b928d[_0xac93('0x45')],{})[_0xac93('0x21')](respondWithResult(_0x10f56f,0xc9))[_0xac93('0x43')](handleError(_0x10f56f,null));};exports[_0xac93('0x20')]=function(_0x4c2c94,_0x370cbc){if(_0x4c2c94[_0xac93('0x45')]['id']){delete _0x4c2c94[_0xac93('0x45')]['id'];}return db['SmsTransferReport'][_0xac93('0x42')]({'where':{'id':_0x4c2c94[_0xac93('0x46')]['id']}})['then'](handleEntityNotFound(_0x370cbc,null))[_0xac93('0x21')](saveUpdates(_0x4c2c94['body'],null))['then'](respondWithResult(_0x370cbc,null))['catch'](handleError(_0x370cbc,null));};exports['destroy']=function(_0x20afbf,_0x3bae81){return db[_0xac93('0x3f')][_0xac93('0x42')]({'where':{'id':_0x20afbf[_0xac93('0x46')]['id']}})[_0xac93('0x21')](handleEntityNotFound(_0x3bae81,null))[_0xac93('0x21')](removeEntity(_0x3bae81,null))[_0xac93('0x43')](handleError(_0x3bae81,null));};exports[_0xac93('0x47')]=function(_0x2fc9b9,_0x394454){return db[_0xac93('0x3f')][_0xac93('0x47')]()[_0xac93('0x21')](respondWithResult(_0x394454,null))[_0xac93('0x43')](handleError(_0x394454,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 2b132c1..0ae2054 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71ab=['path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','api','bluebird','request-promise'];(function(_0x2bec98,_0x12ec93){var _0x28ed82=function(_0x124843){while(--_0x124843){_0x2bec98['push'](_0x2bec98['shift']());}};_0x28ed82(++_0x12ec93);}(_0x71ab,0x64));var _0xb71a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x71ab[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb65=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x7633c,_0x1e45bf){var _0x1b77e2=function(_0x4c3e7f){while(--_0x4c3e7f){_0x7633c['push'](_0x7633c['shift']());}};_0x1b77e2(++_0x1e45bf);}(_0xfb65,0x82));var _0x5fb6=function(_0x35b34c,_0x667a88){_0x35b34c=_0x35b34c-0x0;var _0x326697=_0xfb65[_0x35b34c];return _0x326697;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var logger=require(_0x5fb6('0x1'))('api');var moment=require(_0x5fb6('0x2'));var BPromise=require('bluebird');var rp=require(_0x5fb6('0x3'));var fs=require('fs');var path=require(_0x5fb6('0x4'));var rimraf=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var attributes=require(_0x5fb6('0x7'));module[_0x5fb6('0x8')]=function(_0x4dec8f,_0x50782b){return _0x4dec8f[_0x5fb6('0x9')](_0x5fb6('0xa'),attributes,{'tableName':_0x5fb6('0xb'),'paranoid':![],'indexes':[{'name':_0x5fb6('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 5c3354f..43fd473 100644 --- a/server/api/smsTransferReport/smsTransferReport.rpc.js +++ b/server/api/smsTransferReport/smsTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c2b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x3003dc,_0x354980){var _0x2fa1ab=function(_0x49b328){while(--_0x49b328){_0x3003dc['push'](_0x3003dc['shift']());}};_0x2fa1ab(++_0x354980);}(_0x4c2b,0x1f2));var _0xb4c2=function(_0x2d30b2,_0x1661c9){_0x2d30b2=_0x2d30b2-0x0;var _0x43bf56=_0x4c2b[_0x2d30b2];return _0x43bf56;};'use strict';var _=require(_0xb4c2('0x0'));var util=require(_0xb4c2('0x1'));var moment=require(_0xb4c2('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4c2('0x4'))['db'];var utils=require(_0xb4c2('0x5'));var logger=require('../../config/logger')(_0xb4c2('0x6'));var config=require(_0xb4c2('0x7'));var jayson=require(_0xb4c2('0x8'));var client=jayson[_0xb4c2('0x9')][_0xb4c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ffff3,_0x1b703b,_0x36b147){return new BPromise(function(_0x18e24e,_0x414ace){return client[_0xb4c2('0xb')](_0x2ffff3,_0x36b147)[_0xb4c2('0xc')](function(_0x54e786){logger[_0xb4c2('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x1b703b,_0xb4c2('0xe'));logger[_0xb4c2('0xf')](_0xb4c2('0x10'),_0x1b703b,_0xb4c2('0xe'),JSON[_0xb4c2('0x11')](_0x54e786));if(_0x54e786[_0xb4c2('0x12')]){if(_0x54e786[_0xb4c2('0x12')][_0xb4c2('0x13')]===0x1f4){logger[_0xb4c2('0x12')](_0xb4c2('0x14'),_0x1b703b,_0x54e786[_0xb4c2('0x12')]['message']);return _0x414ace(_0x54e786[_0xb4c2('0x12')][_0xb4c2('0x15')]);}logger[_0xb4c2('0x12')](_0xb4c2('0x14'),_0x1b703b,_0x54e786['error'][_0xb4c2('0x15')]);return _0x18e24e(_0x54e786[_0xb4c2('0x12')][_0xb4c2('0x15')]);}else{logger[_0xb4c2('0xd')](_0xb4c2('0x14'),_0x1b703b,_0xb4c2('0xe'));_0x18e24e(_0x54e786[_0xb4c2('0x16')][_0xb4c2('0x15')]);}})[_0xb4c2('0x17')](function(_0xeb0066){logger[_0xb4c2('0x12')](_0xb4c2('0x14'),_0x1b703b,_0xeb0066);_0x414ace(_0xeb0066);});});} \ No newline at end of file +var _0xd133=['../../config/environment','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x7d1b2c,_0x2d2bde){var _0x5a2136=function(_0x4fff78){while(--_0x4fff78){_0x7d1b2c['push'](_0x7d1b2c['shift']());}};_0x5a2136(++_0x2d2bde);}(_0xd133,0x19c));var _0x3d13=function(_0x37a3f3,_0x663b49){_0x37a3f3=_0x37a3f3-0x0;var _0x4da923=_0xd133[_0x37a3f3];return _0x4da923;};'use strict';var _=require('lodash');var util=require(_0x3d13('0x0'));var moment=require(_0x3d13('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d13('0x2'));var fs=require('fs');var Redis=require(_0x3d13('0x3'));var db=require(_0x3d13('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3d13('0x5'));var config=require(_0x3d13('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3d13('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11ad6f,_0x458463,_0x5b1d81){return new BPromise(function(_0x24cda4,_0x11ba55){return client[_0x3d13('0x8')](_0x11ad6f,_0x5b1d81)[_0x3d13('0x9')](function(_0x10d733){logger[_0x3d13('0xa')](_0x3d13('0xb'),_0x458463,'request\x20sent');logger[_0x3d13('0xc')](_0x3d13('0xd'),_0x458463,'request\x20sent',JSON[_0x3d13('0xe')](_0x10d733));if(_0x10d733[_0x3d13('0xf')]){if(_0x10d733[_0x3d13('0xf')]['code']===0x1f4){logger['error'](_0x3d13('0xb'),_0x458463,_0x10d733['error'][_0x3d13('0x10')]);return _0x11ba55(_0x10d733[_0x3d13('0xf')][_0x3d13('0x10')]);}logger[_0x3d13('0xf')](_0x3d13('0xb'),_0x458463,_0x10d733[_0x3d13('0xf')][_0x3d13('0x10')]);return _0x24cda4(_0x10d733['error']['message']);}else{logger[_0x3d13('0xa')](_0x3d13('0xb'),_0x458463,_0x3d13('0x11'));_0x24cda4(_0x10d733[_0x3d13('0x12')]['message']);}})['catch'](function(_0x5f4534){logger[_0x3d13('0xf')](_0x3d13('0xb'),_0x458463,_0x5f4534);_0x11ba55(_0x5f4534);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0fb8612..a15387c 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9a0=['format','%s-%s%s','basename','now','extname','file','create','put','/:id','update','delete','exports','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','index','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xa9a0,0x192));var _0x0a9a=function(_0x444d0f,_0x2a1b6f){_0x444d0f=_0x444d0f-0x0;var _0x5ea912=_0xa9a0[_0x444d0f];return _0x5ea912;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a9a('0x0'));var timeout=require(_0x0a9a('0x1'));var express=require(_0x0a9a('0x2'));var router=express[_0x0a9a('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0a9a('0x4'));var controller=require('./sound.controller');router['get']('/',auth[_0x0a9a('0x5')](),controller[_0x0a9a('0x6')]);router['get']('/:id',auth[_0x0a9a('0x5')](),controller[_0x0a9a('0x7')]);router['get'](_0x0a9a('0x8'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x0a9a('0x9')]({'destination':function(_0x4cd7da,_0x51c7b0,_0x3fddd9){_0x3fddd9(null,path[_0x0a9a('0xa')](config[_0x0a9a('0xb')],_0x0a9a('0xc')));},'filename':function(_0x59162f,_0x3663c0,_0x23c382){_0x3663c0[_0x0a9a('0xd')]=_0x3663c0[_0x0a9a('0xd')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23c382(null,util[_0x0a9a('0xe')](_0x0a9a('0xf'),path[_0x0a9a('0x10')](_0x3663c0['originalname'],path['extname'](_0x3663c0[_0x0a9a('0xd')])),Date[_0x0a9a('0x11')](),path[_0x0a9a('0x12')](_0x3663c0[_0x0a9a('0xd')])));}})});router['post']('/',upload['single'](_0x0a9a('0x13')),controller[_0x0a9a('0x14')]);router[_0x0a9a('0x15')](_0x0a9a('0x16'),auth[_0x0a9a('0x5')](),controller[_0x0a9a('0x17')]);router[_0x0a9a('0x18')]('/:id',auth[_0x0a9a('0x5')](),controller[_0x0a9a('0x18')]);module[_0x0a9a('0x19')]=router; \ No newline at end of file +var _0x91bf=['Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create','update','delete','multer','util','path','connect-timeout','express'];(function(_0x555c17,_0x2e6c2a){var _0x15a073=function(_0x411a4f){while(--_0x411a4f){_0x555c17['push'](_0x555c17['shift']());}};_0x15a073(++_0x2e6c2a);}(_0x91bf,0xe3));var _0xf91b=function(_0x42f7ef,_0x56ddbd){_0x42f7ef=_0x42f7ef-0x0;var _0x4933f8=_0x91bf[_0x42f7ef];return _0x4933f8;};'use strict';var multer=require(_0xf91b('0x0'));var util=require(_0xf91b('0x1'));var path=require(_0xf91b('0x2'));var timeout=require(_0xf91b('0x3'));var express=require(_0xf91b('0x4'));var router=express[_0xf91b('0x5')]();var auth=require(_0xf91b('0x6'));var interaction=require(_0xf91b('0x7'));var config=require('../../config/environment');var controller=require(_0xf91b('0x8'));router[_0xf91b('0x9')]('/',auth[_0xf91b('0xa')](),controller[_0xf91b('0xb')]);router[_0xf91b('0x9')](_0xf91b('0xc'),auth[_0xf91b('0xa')](),controller[_0xf91b('0xd')]);router[_0xf91b('0x9')]('/:id/download',auth[_0xf91b('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x463aec,_0x4aae33,_0x12117e){_0x12117e(null,path[_0xf91b('0xe')](config[_0xf91b('0xf')],_0xf91b('0x10')));},'filename':function(_0x464825,_0x45b7d8,_0x228c32){_0x45b7d8[_0xf91b('0x11')]=_0x45b7d8[_0xf91b('0x11')][_0xf91b('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x228c32(null,util[_0xf91b('0x13')](_0xf91b('0x14'),path[_0xf91b('0x15')](_0x45b7d8[_0xf91b('0x11')],path[_0xf91b('0x16')](_0x45b7d8[_0xf91b('0x11')])),Date[_0xf91b('0x17')](),path['extname'](_0x45b7d8[_0xf91b('0x11')])));}})});router['post']('/',upload[_0xf91b('0x18')](_0xf91b('0x19')),controller[_0xf91b('0x1a')]);router['put'](_0xf91b('0xc'),auth[_0xf91b('0xa')](),controller[_0xf91b('0x1b')]);router['delete'](_0xf91b('0xc'),auth['isAuthenticated'](),controller[_0xf91b('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index f14d5c1..e49deed 100644 --- a/server/api/sound/sound.attributes.js +++ b/server/api/sound/sound.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9733=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x9cdd9e,_0x17b471){var _0x9d61eb=function(_0x54d23a){while(--_0x54d23a){_0x9cdd9e['push'](_0x9cdd9e['shift']());}};_0x9d61eb(++_0x17b471);}(_0x9733,0x1b5));var _0x3973=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9733[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3973('0x0'));module[_0x3973('0x1')]={'name':{'type':Sequelize[_0x3973('0x2')],'unique':_0x3973('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x3973('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x3973('0x2')]},'original_duration':{'type':Sequelize[_0x3973('0x4')]},'original_sampleCount':{'type':Sequelize[_0x3973('0x5')]},'original_channelCount':{'type':Sequelize[_0x3973('0x6')]},'original_bitRate':{'type':Sequelize[_0x3973('0x5')]},'original_sampleRate':{'type':Sequelize[_0x3973('0x6')]},'converted_format':{'type':Sequelize[_0x3973('0x2')]},'converted_duration':{'type':Sequelize[_0x3973('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x3973('0x5')]},'converted_channelCount':{'type':Sequelize[_0x3973('0x6')]},'converted_bitRate':{'type':Sequelize[_0x3973('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x3973('0x6')]}}; \ No newline at end of file +var _0x0bfd=['STRING','name','FLOAT','INTEGER','BIGINT'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0bfd,0x16d));var _0xd0bf=function(_0xe16f3c,_0x2ee8c4){_0xe16f3c=_0xe16f3c-0x0;var _0x7df2cb=_0x0bfd[_0xe16f3c];return _0x7df2cb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd0bf('0x0')],'unique':_0xd0bf('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xd0bf('0x0')]},'original_format':{'type':Sequelize[_0xd0bf('0x0')]},'original_duration':{'type':Sequelize[_0xd0bf('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xd0bf('0x3')]},'original_bitRate':{'type':Sequelize[_0xd0bf('0x4')]},'original_sampleRate':{'type':Sequelize[_0xd0bf('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xd0bf('0x4')]},'converted_channelCount':{'type':Sequelize[_0xd0bf('0x3')]},'converted_bitRate':{'type':Sequelize[_0xd0bf('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xd0bf('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 9bb5715..132abf7 100644 --- a/server/api/sound/sound.controller.js +++ b/server/api/sound/sound.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7f9=['chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','user','UserProfileSection','Sounds','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','destroy','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','get','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','type','key','model','query','keys','attributes','fields','hasOwnProperty','order','filters','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','download','save_name','converted_format','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0xa7f9,0x1a1));var _0x9a7f=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xa7f9[_0x3ce2c4];return _0x4047c1;};'use strict';var pdf=require(_0x9a7f('0x0'));var emlformat=require(_0x9a7f('0x1'));var rimraf=require(_0x9a7f('0x2'));var zipdir=require(_0x9a7f('0x3'));var jsonpatch=require(_0x9a7f('0x4'));var rp=require(_0x9a7f('0x5'));var moment=require(_0x9a7f('0x6'));var BPromise=require(_0x9a7f('0x7'));var Mustache=require(_0x9a7f('0x8'));var util=require(_0x9a7f('0x9'));var path=require(_0x9a7f('0xa'));var sox=require(_0x9a7f('0xb'));var csv=require(_0x9a7f('0xc'));var ejs=require(_0x9a7f('0xd'));var fs=require('fs');var _=require(_0x9a7f('0xe'));var squel=require(_0x9a7f('0xf'));var crypto=require(_0x9a7f('0x10'));var jsforce=require(_0x9a7f('0x11'));var deskjs=require(_0x9a7f('0x12'));var toCsv=require(_0x9a7f('0xc'));var querystring=require('querystring');var Papa=require(_0x9a7f('0x13'));var Redis=require(_0x9a7f('0x14'));var authService=require(_0x9a7f('0x15'));var qs=require(_0x9a7f('0x16'));var as=require(_0x9a7f('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a7f('0x18'))('api');var utils=require(_0x9a7f('0x19'));var config=require(_0x9a7f('0x1a'));var db=require(_0x9a7f('0x1b'))['db'];function respondWithStatusCode(_0x26ae67,_0x14b4da){_0x14b4da=_0x14b4da||0xcc;return function(_0x399286){if(_0x399286){return _0x26ae67[_0x9a7f('0x1c')](_0x14b4da);}return _0x26ae67[_0x9a7f('0x1d')](_0x14b4da)[_0x9a7f('0x1e')]();};}function respondWithResult(_0x4457ce,_0xc76a29){_0xc76a29=_0xc76a29||0xc8;return function(_0x43e010){if(_0x43e010){return _0x4457ce['status'](_0xc76a29)[_0x9a7f('0x1f')](_0x43e010);}};}function respondWithFilteredResult(_0x149c98,_0xb63ac8){return function(_0x122213){if(_0x122213){var _0x49c965=_0x122213[_0x9a7f('0x20')],_0x42e8d6=_0xb63ac8['offset'],_0xc4301c=_0xb63ac8[_0x9a7f('0x21')]+_0xb63ac8[_0x9a7f('0x22')],_0xcf3599;if(_0xc4301c>=_0x49c965){_0xc4301c=_0x49c965;_0xcf3599=0xc8;}else{_0xcf3599=0xce;}_0x149c98['status'](_0xcf3599);return _0x149c98['set'](_0x9a7f('0x23'),_0x42e8d6+'-'+_0xc4301c+'/'+_0x49c965)['json'](_0x122213);}return null;};}function patchUpdates(_0x3a68cf){return function(_0x4856e9){try{jsonpatch['apply'](_0x4856e9,_0x3a68cf,!![]);}catch(_0x456cbb){return BPromise[_0x9a7f('0x24')](_0x456cbb);}return _0x4856e9[_0x9a7f('0x25')]();};}function saveUpdates(_0x58553c,_0x4d472d){return function(_0x5136c2){if(_0x5136c2){return _0x5136c2['update'](_0x58553c)[_0x9a7f('0x26')](function(_0x1d6db3){return _0x1d6db3;});}return null;};}function removeEntity(_0x233276,_0x590fb0){return function(_0xabd3d6){if(_0xabd3d6){return _0xabd3d6['destroy']()[_0x9a7f('0x26')](function(){var _0x25bcd5=_0xabd3d6[_0x9a7f('0x27')]({'plain':!![]});var _0x33d8ce='Sounds';return db[_0x9a7f('0x28')]['destroy']({'where':{'type':_0x33d8ce,'resourceId':_0x25bcd5['id']}})[_0x9a7f('0x26')](function(){return _0xabd3d6;});})[_0x9a7f('0x26')](function(){_0x233276[_0x9a7f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a79eb,_0x1f6f87){return function(_0x3f740a){if(!_0x3f740a){_0x5a79eb[_0x9a7f('0x1c')](0x194);}return _0x3f740a;};}function handleError(_0x600879,_0x150641){_0x150641=_0x150641||0x1f4;return function(_0x3c30d0){logger['error'](_0x3c30d0[_0x9a7f('0x29')]);if(_0x3c30d0[_0x9a7f('0x2a')]){delete _0x3c30d0[_0x9a7f('0x2a')];}_0x600879['status'](_0x150641)[_0x9a7f('0x2b')](_0x3c30d0);};}exports[_0x9a7f('0x2c')]=function(_0x7ab881,_0x4bcc3f){var _0x2b030f={},_0xc2eb6d={},_0x2366b1={'count':0x0,'rows':[]};var _0xcb8397=_[_0x9a7f('0x2d')](db[_0x9a7f('0x2e')][_0x9a7f('0x2f')],function(_0x256b4b){return{'name':_0x256b4b['fieldName'],'type':_0x256b4b[_0x9a7f('0x30')][_0x9a7f('0x31')]};});_0xc2eb6d[_0x9a7f('0x32')]=_[_0x9a7f('0x2d')](_0xcb8397,_0x9a7f('0x2a'));_0xc2eb6d[_0x9a7f('0x33')]=_[_0x9a7f('0x34')](_0x7ab881[_0x9a7f('0x33')]);_0xc2eb6d['filters']=_['intersection'](_0xc2eb6d[_0x9a7f('0x32')],_0xc2eb6d['query']);_0x2b030f[_0x9a7f('0x35')]=_['intersection'](_0xc2eb6d[_0x9a7f('0x32')],qs[_0x9a7f('0x36')](_0x7ab881[_0x9a7f('0x33')][_0x9a7f('0x36')]));_0x2b030f['attributes']=_0x2b030f['attributes']['length']?_0x2b030f[_0x9a7f('0x35')]:_0xc2eb6d[_0x9a7f('0x32')];if(!_0x7ab881[_0x9a7f('0x33')][_0x9a7f('0x37')]('nolimit')){_0x2b030f[_0x9a7f('0x22')]=qs[_0x9a7f('0x22')](_0x7ab881[_0x9a7f('0x33')]['limit']);_0x2b030f[_0x9a7f('0x21')]=qs[_0x9a7f('0x21')](_0x7ab881[_0x9a7f('0x33')]['offset']);}_0x2b030f[_0x9a7f('0x38')]=qs['sort'](_0x7ab881[_0x9a7f('0x33')]['sort']);_0x2b030f['where']=qs[_0x9a7f('0x39')](_['pick'](_0x7ab881[_0x9a7f('0x33')],_0xc2eb6d[_0x9a7f('0x39')]));if(_0x7ab881[_0x9a7f('0x33')][_0x9a7f('0x3a')]){_0x2b030f['where']=_['merge'](_0x2b030f['where'],{'$or':_[_0x9a7f('0x2d')](_0xcb8397,function(_0x4e6a32){if(_0x4e6a32['type']!==_0x9a7f('0x3b')){var _0x37c29d={};_0x37c29d[_0x4e6a32[_0x9a7f('0x2a')]]={'$like':'%'+_0x7ab881[_0x9a7f('0x33')][_0x9a7f('0x3a')]+'%'};return _0x37c29d;}})});}_0x2b030f=_[_0x9a7f('0x3c')]({},_0x2b030f,_0x7ab881[_0x9a7f('0x3d')]);var _0x30db6c={'where':_0x2b030f[_0x9a7f('0x3e')]};return db[_0x9a7f('0x2e')][_0x9a7f('0x20')](_0x30db6c)[_0x9a7f('0x26')](function(_0x45ead1){_0x2366b1[_0x9a7f('0x20')]=_0x45ead1;if(_0x7ab881['query'][_0x9a7f('0x3f')]){_0x2b030f[_0x9a7f('0x40')]=[{'all':!![]}];}return db['Sound'][_0x9a7f('0x41')](_0x2b030f);})[_0x9a7f('0x26')](function(_0x4c3c32){_0x2366b1[_0x9a7f('0x42')]=_0x4c3c32;return _0x2366b1;})[_0x9a7f('0x26')](respondWithFilteredResult(_0x4bcc3f,_0x2b030f))[_0x9a7f('0x43')](handleError(_0x4bcc3f,null));};exports[_0x9a7f('0x44')]=function(_0x51bb57,_0x5d4fd1){var _0xfba481={'raw':!![],'where':{'id':_0x51bb57[_0x9a7f('0x45')]['id']}},_0x1dc897={};_0x1dc897['model']=_[_0x9a7f('0x34')](db[_0x9a7f('0x2e')][_0x9a7f('0x2f')]);_0x1dc897[_0x9a7f('0x33')]=_[_0x9a7f('0x34')](_0x51bb57[_0x9a7f('0x33')]);_0x1dc897[_0x9a7f('0x39')]=_[_0x9a7f('0x46')](_0x1dc897[_0x9a7f('0x32')],_0x1dc897[_0x9a7f('0x33')]);_0xfba481[_0x9a7f('0x35')]=_['intersection'](_0x1dc897[_0x9a7f('0x32')],qs[_0x9a7f('0x36')](_0x51bb57[_0x9a7f('0x33')][_0x9a7f('0x36')]));_0xfba481['attributes']=_0xfba481['attributes'][_0x9a7f('0x47')]?_0xfba481[_0x9a7f('0x35')]:_0x1dc897[_0x9a7f('0x32')];if(_0x51bb57[_0x9a7f('0x33')][_0x9a7f('0x3f')]){_0xfba481[_0x9a7f('0x40')]=[{'all':!![]}];}_0xfba481=_['merge']({},_0xfba481,_0x51bb57[_0x9a7f('0x3d')]);return db[_0x9a7f('0x2e')][_0x9a7f('0x48')](_0xfba481)['then'](handleEntityNotFound(_0x5d4fd1,null))[_0x9a7f('0x26')](respondWithResult(_0x5d4fd1,null))[_0x9a7f('0x43')](handleError(_0x5d4fd1,null));};exports[_0x9a7f('0x49')]=function(_0x37ea12,_0x358015,_0xd35370){return db[_0x9a7f('0x2e')][_0x9a7f('0x48')]({'where':{'id':_0x37ea12['params']['id']},'attributes':[_0x9a7f('0x2a'),_0x9a7f('0x4a'),_0x9a7f('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x358015,null))['then'](function(_0xa7ed13){if(_0xa7ed13){if(!fs['existsSync'](path[_0x9a7f('0x4c')](config['root'],_0x9a7f('0x4d'),_0xa7ed13[_0x9a7f('0x4a')]+'.'+_0xa7ed13[_0x9a7f('0x4b')]))){throw new db[(_0x9a7f('0x4e'))][(_0x9a7f('0x4f'))](_0x9a7f('0x50'));}return _0x358015[_0x9a7f('0x49')](path[_0x9a7f('0x4c')](config[_0x9a7f('0x51')],'server/files/sounds/converted',util['format'](_0x9a7f('0x52'),_0xa7ed13[_0x9a7f('0x4a')],_0xa7ed13[_0x9a7f('0x4b')])),util[_0x9a7f('0x53')]('%s.%s',_0xa7ed13[_0x9a7f('0x2a')],_0xa7ed13['converted_format']));}return null;})['catch'](handleError(_0x358015,null));};exports[_0x9a7f('0x54')]=function(_0x44d2be,_0x420d64,_0x4b7b38){var _0x5e6f0d={'name':path[_0x9a7f('0x55')](_0x44d2be[_0x9a7f('0x56')][_0x9a7f('0x57')],path[_0x9a7f('0x58')](_0x44d2be[_0x9a7f('0x56')][_0x9a7f('0x57')])),'save_name':path[_0x9a7f('0x55')](_0x44d2be[_0x9a7f('0x56')][_0x9a7f('0x59')],path['extname'](_0x44d2be[_0x9a7f('0x56')][_0x9a7f('0x59')])),'original_format':path[_0x9a7f('0x58')](_0x44d2be[_0x9a7f('0x56')][_0x9a7f('0x57')])[_0x9a7f('0x5a')](0x1),'converted_format':_0x9a7f('0x5b')};var _0x3902c0=path[_0x9a7f('0x4c')](config[_0x9a7f('0x51')],_0x9a7f('0x5c'),_0x44d2be['file'][_0x9a7f('0x59')]);var _0x24bf2e=path[_0x9a7f('0x4c')](config['root'],_0x9a7f('0x4d'),util[_0x9a7f('0x53')](_0x9a7f('0x52'),path[_0x9a7f('0x55')](_0x44d2be[_0x9a7f('0x56')]['filename'],path[_0x9a7f('0x58')](_0x44d2be['file'][_0x9a7f('0x59')])),_0x5e6f0d[_0x9a7f('0x4b')]));logger[_0x9a7f('0x5d')](_0x9a7f('0x5e'),_0x3902c0);logger[_0x9a7f('0x5d')]('Sound\x20upload\x20destination:\x20%s',_0x24bf2e);try{fs[_0x9a7f('0x5f')](_0x3902c0,parseInt('0777',0x8));var _0xfcfe51=sox[_0x9a7f('0x60')](_0x3902c0,_0x24bf2e,{'sampleRate':0x1f40,'format':_0x9a7f('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xfcfe51['on']('error',function(_0x494578){fs[_0x9a7f('0x61')](_0x3902c0);_0x420d64[_0x9a7f('0x1d')](0x1f4)[_0x9a7f('0x2b')](_0x494578);});_0xfcfe51['on'](_0x9a7f('0x62'),function(_0x4e4296){_0x5e6f0d[_0x9a7f('0x63')]=isNaN(_0x4e4296[_0x9a7f('0x64')])?null:_0x4e4296[_0x9a7f('0x64')]*0x3e8;_0x5e6f0d[_0x9a7f('0x65')]=isNaN(_0x4e4296[_0x9a7f('0x66')])?null:_0x4e4296[_0x9a7f('0x66')];_0x5e6f0d['original_channelCount']=isNaN(_0x4e4296[_0x9a7f('0x67')])?null:_0x4e4296[_0x9a7f('0x67')];_0x5e6f0d[_0x9a7f('0x68')]=isNaN(_0x4e4296['bitRate'])?null:_0x4e4296[_0x9a7f('0x69')];_0x5e6f0d[_0x9a7f('0x6a')]=isNaN(_0x4e4296[_0x9a7f('0x6b')])?null:_0x4e4296[_0x9a7f('0x6b')];});_0xfcfe51['on'](_0x9a7f('0x6c'),function(_0x4d65a2){_0x5e6f0d['converted_duration']=isNaN(_0x4d65a2[_0x9a7f('0x64')])?null:_0x4d65a2[_0x9a7f('0x64')]*0x3e8;_0x5e6f0d['converted_sampleCount']=isNaN(_0x4d65a2[_0x9a7f('0x66')])?null:_0x4d65a2[_0x9a7f('0x66')];_0x5e6f0d[_0x9a7f('0x6d')]=isNaN(_0x4d65a2[_0x9a7f('0x67')])?null:_0x4d65a2[_0x9a7f('0x67')];_0x5e6f0d[_0x9a7f('0x6e')]=isNaN(_0x4d65a2[_0x9a7f('0x69')])?null:_0x4d65a2[_0x9a7f('0x69')];_0x5e6f0d[_0x9a7f('0x6f')]=isNaN(_0x4d65a2['sampleRate'])?null:_0x4d65a2['sampleRate'];});_0xfcfe51['on']('end',function(){fs[_0x9a7f('0x5f')](_0x24bf2e,parseInt(_0x9a7f('0x70'),0x8));return db[_0x9a7f('0x2e')][_0x9a7f('0x54')](_0x5e6f0d)[_0x9a7f('0x26')](function(_0x4289ff){var _0xcf833e={'role':_0x44d2be[_0x9a7f('0x71')][_0x9a7f('0x72')],'userProfileId':_0x44d2be[_0x9a7f('0x71')]['userProfileId']};if(!_0xcf833e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcf833e[_0x9a7f('0x72')]===_0x9a7f('0x73')){var _0x2befc5=_0x4289ff['get']({'plain':!![]});return db[_0x9a7f('0x74')]['find']({'where':{'name':_0x9a7f('0x75'),'userProfileId':_0xcf833e[_0x9a7f('0x76')]},'raw':!![]})['then'](function(_0x153b1d){if(_0x153b1d&&_0x153b1d[_0x9a7f('0x77')]===0x0){return db['UserProfileResource'][_0x9a7f('0x54')]({'name':_0x2befc5[_0x9a7f('0x2a')],'resourceId':_0x2befc5['id'],'type':_0x153b1d[_0x9a7f('0x2a')],'sectionId':_0x153b1d['id']},{})[_0x9a7f('0x26')](function(){return _0x4289ff;});}else{return _0x4289ff;}})[_0x9a7f('0x43')](function(_0x5dae08){logger[_0x9a7f('0x78')](_0x9a7f('0x79'),_0x5dae08);throw _0x5dae08;});}return _0x4289ff;})['then'](respondWithResult(_0x420d64,null))['catch'](handleError(_0x420d64,null));});_0xfcfe51[_0x9a7f('0x7a')]();}catch(_0x1ddb53){_0x420d64[_0x9a7f('0x1d')](0x1f4)[_0x9a7f('0x2b')](_0x1ddb53);}};exports[_0x9a7f('0x7b')]=function(_0x4fd363,_0x3c942f,_0x26652c){return db[_0x9a7f('0x2e')][_0x9a7f('0x48')]({'where':{'id':_0x4fd363[_0x9a7f('0x45')]['id']}})[_0x9a7f('0x26')](handleEntityNotFound(_0x3c942f,null))['then'](saveUpdates(_['pick'](_0x4fd363[_0x9a7f('0x71')],[_0x9a7f('0x2a'),_0x9a7f('0x7c')]),null))[_0x9a7f('0x26')](respondWithResult(_0x3c942f,null))[_0x9a7f('0x43')](handleError(_0x3c942f,null));};exports[_0x9a7f('0x7d')]=function(_0x50fea1,_0x3d289e,_0x14b6f3){return db[_0x9a7f('0x2e')][_0x9a7f('0x48')]({'where':{'id':_0x50fea1['params']['id']}})[_0x9a7f('0x26')](function(_0x2e66fe){if(_0x2e66fe){return _0x2e66fe[_0x9a7f('0x7e')]();}})['then'](function(_0xc71d0b){var _0xfb2e26=path['join'](config['root'],_0x9a7f('0x5c'),util[_0x9a7f('0x53')](_0x9a7f('0x52'),_0xc71d0b[_0x9a7f('0x4a')],_0xc71d0b[_0x9a7f('0x7f')]));var _0x1aef67=path[_0x9a7f('0x4c')](config['root'],_0x9a7f('0x4d'),util[_0x9a7f('0x53')](_0x9a7f('0x52'),_0xc71d0b['save_name'],_0xc71d0b[_0x9a7f('0x4b')]));fs[_0x9a7f('0x61')](_0xfb2e26);fs[_0x9a7f('0x61')](_0x1aef67);return _0xc71d0b;})[_0x9a7f('0x26')](function(_0x194b30){if(_0x194b30){return _0x3d289e[_0x9a7f('0x1d')](0xcc)[_0x9a7f('0x1e')]();}})[_0x9a7f('0x26')](handleEntityNotFound(_0x3d289e,null))[_0x9a7f('0x43')](handleError(_0x3d289e,null));}; \ No newline at end of file +var _0xa0f3=['eml-format','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','end','error','name','send','index','map','Sound','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','keys','length','find','catch','download','converted_format','existsSync','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','file','originalname','basename','filename','extname','wav','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','server/files/sounds/original','html-pdf'];(function(_0x39a203,_0x558953){var _0x1dc6d2=function(_0x55cda2){while(--_0x55cda2){_0x39a203['push'](_0x39a203['shift']());}};_0x1dc6d2(++_0x558953);}(_0xa0f3,0x1d3));var _0x3a0f=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa0f3[_0x40ac5e];return _0x2839d6;};'use strict';var pdf=require(_0x3a0f('0x0'));var emlformat=require(_0x3a0f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3a0f('0x2'));var moment=require('moment');var BPromise=require(_0x3a0f('0x3'));var Mustache=require(_0x3a0f('0x4'));var util=require('util');var path=require(_0x3a0f('0x5'));var sox=require('sox');var csv=require(_0x3a0f('0x6'));var ejs=require(_0x3a0f('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3a0f('0x8'));var crypto=require(_0x3a0f('0x9'));var jsforce=require(_0x3a0f('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3a0f('0xb'));var authService=require(_0x3a0f('0xc'));var qs=require(_0x3a0f('0xd'));var as=require(_0x3a0f('0xe'));var hardwareService=require(_0x3a0f('0xf'));var logger=require(_0x3a0f('0x10'))(_0x3a0f('0x11'));var utils=require('../../config/utils');var config=require(_0x3a0f('0x12'));var db=require(_0x3a0f('0x13'))['db'];function respondWithStatusCode(_0x3bcf6a,_0x474921){_0x474921=_0x474921||0xcc;return function(_0x4bacb4){if(_0x4bacb4){return _0x3bcf6a[_0x3a0f('0x14')](_0x474921);}return _0x3bcf6a[_0x3a0f('0x15')](_0x474921)['end']();};}function respondWithResult(_0x100fb6,_0x115ab1){_0x115ab1=_0x115ab1||0xc8;return function(_0x56340f){if(_0x56340f){return _0x100fb6['status'](_0x115ab1)[_0x3a0f('0x16')](_0x56340f);}};}function respondWithFilteredResult(_0x4df19d,_0x1531f6){return function(_0x427346){if(_0x427346){var _0x12d953=_0x427346[_0x3a0f('0x17')],_0x3508cd=_0x1531f6[_0x3a0f('0x18')],_0x3bbd7=_0x1531f6[_0x3a0f('0x18')]+_0x1531f6['limit'],_0x4ec8c4;if(_0x3bbd7>=_0x12d953){_0x3bbd7=_0x12d953;_0x4ec8c4=0xc8;}else{_0x4ec8c4=0xce;}_0x4df19d[_0x3a0f('0x15')](_0x4ec8c4);return _0x4df19d[_0x3a0f('0x19')](_0x3a0f('0x1a'),_0x3508cd+'-'+_0x3bbd7+'/'+_0x12d953)['json'](_0x427346);}return null;};}function patchUpdates(_0x4490a){return function(_0x324b92){try{jsonpatch[_0x3a0f('0x1b')](_0x324b92,_0x4490a,!![]);}catch(_0x3206c1){return BPromise[_0x3a0f('0x1c')](_0x3206c1);}return _0x324b92[_0x3a0f('0x1d')]();};}function saveUpdates(_0x1f1d16,_0x833449){return function(_0x59b95f){if(_0x59b95f){return _0x59b95f[_0x3a0f('0x1e')](_0x1f1d16)[_0x3a0f('0x1f')](function(_0x12303e){return _0x12303e;});}return null;};}function removeEntity(_0x2615cc,_0x4a76e9){return function(_0x44ec34){if(_0x44ec34){return _0x44ec34[_0x3a0f('0x20')]()['then'](function(){var _0x3f6414=_0x44ec34[_0x3a0f('0x21')]({'plain':!![]});var _0x1c21fe=_0x3a0f('0x22');return db[_0x3a0f('0x23')][_0x3a0f('0x20')]({'where':{'type':_0x1c21fe,'resourceId':_0x3f6414['id']}})[_0x3a0f('0x1f')](function(){return _0x44ec34;});})[_0x3a0f('0x1f')](function(){_0x2615cc[_0x3a0f('0x15')](0xcc)[_0x3a0f('0x24')]();});}};}function handleEntityNotFound(_0x336d72,_0x3c4eaa){return function(_0x4d5045){if(!_0x4d5045){_0x336d72[_0x3a0f('0x14')](0x194);}return _0x4d5045;};}function handleError(_0x52e700,_0x248fb5){_0x248fb5=_0x248fb5||0x1f4;return function(_0x4e5ead){logger[_0x3a0f('0x25')](_0x4e5ead['stack']);if(_0x4e5ead[_0x3a0f('0x26')]){delete _0x4e5ead[_0x3a0f('0x26')];}_0x52e700['status'](_0x248fb5)[_0x3a0f('0x27')](_0x4e5ead);};}exports[_0x3a0f('0x28')]=function(_0xc4fb71,_0x5f12b0){var _0x187fd3={},_0x2877ce={},_0x4d38c9={'count':0x0,'rows':[]};var _0x3ec8c2=_[_0x3a0f('0x29')](db[_0x3a0f('0x2a')]['rawAttributes'],function(_0x3652c3){return{'name':_0x3652c3[_0x3a0f('0x2b')],'type':_0x3652c3[_0x3a0f('0x2c')]['key']};});_0x2877ce[_0x3a0f('0x2d')]=_['map'](_0x3ec8c2,_0x3a0f('0x26'));_0x2877ce[_0x3a0f('0x2e')]=_['keys'](_0xc4fb71[_0x3a0f('0x2e')]);_0x2877ce[_0x3a0f('0x2f')]=_[_0x3a0f('0x30')](_0x2877ce['model'],_0x2877ce[_0x3a0f('0x2e')]);_0x187fd3[_0x3a0f('0x31')]=_['intersection'](_0x2877ce[_0x3a0f('0x2d')],qs[_0x3a0f('0x32')](_0xc4fb71[_0x3a0f('0x2e')]['fields']));_0x187fd3[_0x3a0f('0x31')]=_0x187fd3['attributes']['length']?_0x187fd3[_0x3a0f('0x31')]:_0x2877ce[_0x3a0f('0x2d')];if(!_0xc4fb71[_0x3a0f('0x2e')][_0x3a0f('0x33')](_0x3a0f('0x34'))){_0x187fd3[_0x3a0f('0x35')]=qs[_0x3a0f('0x35')](_0xc4fb71['query'][_0x3a0f('0x35')]);_0x187fd3['offset']=qs[_0x3a0f('0x18')](_0xc4fb71['query'][_0x3a0f('0x18')]);}_0x187fd3[_0x3a0f('0x36')]=qs[_0x3a0f('0x37')](_0xc4fb71[_0x3a0f('0x2e')]['sort']);_0x187fd3[_0x3a0f('0x38')]=qs[_0x3a0f('0x2f')](_[_0x3a0f('0x39')](_0xc4fb71[_0x3a0f('0x2e')],_0x2877ce[_0x3a0f('0x2f')]));if(_0xc4fb71[_0x3a0f('0x2e')][_0x3a0f('0x3a')]){_0x187fd3[_0x3a0f('0x38')]=_[_0x3a0f('0x3b')](_0x187fd3[_0x3a0f('0x38')],{'$or':_[_0x3a0f('0x29')](_0x3ec8c2,function(_0x45495b){if(_0x45495b[_0x3a0f('0x2c')]!==_0x3a0f('0x3c')){var _0x560323={};_0x560323[_0x45495b[_0x3a0f('0x26')]]={'$like':'%'+_0xc4fb71['query']['filter']+'%'};return _0x560323;}})});}_0x187fd3=_[_0x3a0f('0x3b')]({},_0x187fd3,_0xc4fb71[_0x3a0f('0x3d')]);var _0xa2b05b={'where':_0x187fd3[_0x3a0f('0x38')]};return db[_0x3a0f('0x2a')][_0x3a0f('0x17')](_0xa2b05b)[_0x3a0f('0x1f')](function(_0x144d43){_0x4d38c9[_0x3a0f('0x17')]=_0x144d43;if(_0xc4fb71[_0x3a0f('0x2e')][_0x3a0f('0x3e')]){_0x187fd3[_0x3a0f('0x3f')]=[{'all':!![]}];}return db[_0x3a0f('0x2a')][_0x3a0f('0x40')](_0x187fd3);})[_0x3a0f('0x1f')](function(_0x11e4d7){_0x4d38c9['rows']=_0x11e4d7;return _0x4d38c9;})['then'](respondWithFilteredResult(_0x5f12b0,_0x187fd3))['catch'](handleError(_0x5f12b0,null));};exports[_0x3a0f('0x41')]=function(_0x4016d4,_0x24f71a){var _0x4b6234={'raw':!![],'where':{'id':_0x4016d4[_0x3a0f('0x42')]['id']}},_0x24ce24={};_0x24ce24[_0x3a0f('0x2d')]=_['keys'](db[_0x3a0f('0x2a')][_0x3a0f('0x43')]);_0x24ce24['query']=_[_0x3a0f('0x44')](_0x4016d4[_0x3a0f('0x2e')]);_0x24ce24[_0x3a0f('0x2f')]=_[_0x3a0f('0x30')](_0x24ce24['model'],_0x24ce24[_0x3a0f('0x2e')]);_0x4b6234[_0x3a0f('0x31')]=_['intersection'](_0x24ce24[_0x3a0f('0x2d')],qs[_0x3a0f('0x32')](_0x4016d4[_0x3a0f('0x2e')][_0x3a0f('0x32')]));_0x4b6234[_0x3a0f('0x31')]=_0x4b6234[_0x3a0f('0x31')][_0x3a0f('0x45')]?_0x4b6234[_0x3a0f('0x31')]:_0x24ce24[_0x3a0f('0x2d')];if(_0x4016d4['query'][_0x3a0f('0x3e')]){_0x4b6234[_0x3a0f('0x3f')]=[{'all':!![]}];}_0x4b6234=_[_0x3a0f('0x3b')]({},_0x4b6234,_0x4016d4[_0x3a0f('0x3d')]);return db['Sound'][_0x3a0f('0x46')](_0x4b6234)[_0x3a0f('0x1f')](handleEntityNotFound(_0x24f71a,null))[_0x3a0f('0x1f')](respondWithResult(_0x24f71a,null))[_0x3a0f('0x47')](handleError(_0x24f71a,null));};exports[_0x3a0f('0x48')]=function(_0x18df5c,_0x5599c5,_0x4666d7){return db['Sound']['find']({'where':{'id':_0x18df5c[_0x3a0f('0x42')]['id']},'attributes':[_0x3a0f('0x26'),'save_name',_0x3a0f('0x49')],'raw':!![]})[_0x3a0f('0x1f')](handleEntityNotFound(_0x5599c5,null))['then'](function(_0xdb4e29){if(_0xdb4e29){if(!fs[_0x3a0f('0x4a')](path['join'](config[_0x3a0f('0x4b')],_0x3a0f('0x4c'),_0xdb4e29[_0x3a0f('0x4d')]+'.'+_0xdb4e29[_0x3a0f('0x49')]))){throw new db[(_0x3a0f('0x4e'))][(_0x3a0f('0x4f'))](_0x3a0f('0x50'));}return _0x5599c5['download'](path[_0x3a0f('0x51')](config[_0x3a0f('0x4b')],_0x3a0f('0x4c'),util[_0x3a0f('0x52')]('%s.%s',_0xdb4e29[_0x3a0f('0x4d')],_0xdb4e29[_0x3a0f('0x49')])),util[_0x3a0f('0x52')](_0x3a0f('0x53'),_0xdb4e29['name'],_0xdb4e29[_0x3a0f('0x49')]));}return null;})['catch'](handleError(_0x5599c5,null));};exports[_0x3a0f('0x54')]=function(_0x2d48e3,_0x2139ed,_0x4cec8f){var _0x4c8d5f={'name':path['basename'](_0x2d48e3[_0x3a0f('0x55')]['originalname'],path['extname'](_0x2d48e3[_0x3a0f('0x55')][_0x3a0f('0x56')])),'save_name':path[_0x3a0f('0x57')](_0x2d48e3[_0x3a0f('0x55')][_0x3a0f('0x58')],path['extname'](_0x2d48e3['file'][_0x3a0f('0x58')])),'original_format':path[_0x3a0f('0x59')](_0x2d48e3[_0x3a0f('0x55')][_0x3a0f('0x56')])['substring'](0x1),'converted_format':_0x3a0f('0x5a')};var _0x285e0d=path['join'](config['root'],'server/files/sounds/original',_0x2d48e3[_0x3a0f('0x55')][_0x3a0f('0x58')]);var _0x5525d5=path[_0x3a0f('0x51')](config[_0x3a0f('0x4b')],_0x3a0f('0x4c'),util[_0x3a0f('0x52')](_0x3a0f('0x53'),path[_0x3a0f('0x57')](_0x2d48e3['file'][_0x3a0f('0x58')],path[_0x3a0f('0x59')](_0x2d48e3[_0x3a0f('0x55')][_0x3a0f('0x58')])),_0x4c8d5f[_0x3a0f('0x49')]));logger[_0x3a0f('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x285e0d);logger[_0x3a0f('0x5b')](_0x3a0f('0x5c'),_0x5525d5);try{fs['chmodSync'](_0x285e0d,parseInt(_0x3a0f('0x5d'),0x8));var _0x4f4a86=sox[_0x3a0f('0x5e')](_0x285e0d,_0x5525d5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4f4a86['on'](_0x3a0f('0x25'),function(_0xaf101f){fs[_0x3a0f('0x5f')](_0x285e0d);_0x2139ed['status'](0x1f4)[_0x3a0f('0x27')](_0xaf101f);});_0x4f4a86['on']('src',function(_0x1985ef){_0x4c8d5f['original_duration']=isNaN(_0x1985ef['duration'])?null:_0x1985ef[_0x3a0f('0x60')]*0x3e8;_0x4c8d5f[_0x3a0f('0x61')]=isNaN(_0x1985ef[_0x3a0f('0x62')])?null:_0x1985ef[_0x3a0f('0x62')];_0x4c8d5f[_0x3a0f('0x63')]=isNaN(_0x1985ef[_0x3a0f('0x64')])?null:_0x1985ef[_0x3a0f('0x64')];_0x4c8d5f['original_bitRate']=isNaN(_0x1985ef[_0x3a0f('0x65')])?null:_0x1985ef[_0x3a0f('0x65')];_0x4c8d5f[_0x3a0f('0x66')]=isNaN(_0x1985ef[_0x3a0f('0x67')])?null:_0x1985ef[_0x3a0f('0x67')];});_0x4f4a86['on'](_0x3a0f('0x68'),function(_0x510910){_0x4c8d5f[_0x3a0f('0x69')]=isNaN(_0x510910[_0x3a0f('0x60')])?null:_0x510910[_0x3a0f('0x60')]*0x3e8;_0x4c8d5f['converted_sampleCount']=isNaN(_0x510910[_0x3a0f('0x62')])?null:_0x510910[_0x3a0f('0x62')];_0x4c8d5f[_0x3a0f('0x6a')]=isNaN(_0x510910[_0x3a0f('0x64')])?null:_0x510910[_0x3a0f('0x64')];_0x4c8d5f[_0x3a0f('0x6b')]=isNaN(_0x510910[_0x3a0f('0x65')])?null:_0x510910[_0x3a0f('0x65')];_0x4c8d5f[_0x3a0f('0x6c')]=isNaN(_0x510910[_0x3a0f('0x67')])?null:_0x510910[_0x3a0f('0x67')];});_0x4f4a86['on'](_0x3a0f('0x24'),function(){fs[_0x3a0f('0x6d')](_0x5525d5,parseInt(_0x3a0f('0x5d'),0x8));return db['Sound']['create'](_0x4c8d5f)['then'](function(_0x216869){var _0x5ddd3c={'role':_0x2d48e3['body'][_0x3a0f('0x6e')],'userProfileId':_0x2d48e3['body']['userProfileId']};if(!_0x5ddd3c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ddd3c[_0x3a0f('0x6e')]===_0x3a0f('0x6f')){var _0x39067b=_0x216869[_0x3a0f('0x21')]({'plain':!![]});return db[_0x3a0f('0x70')][_0x3a0f('0x46')]({'where':{'name':_0x3a0f('0x22'),'userProfileId':_0x5ddd3c[_0x3a0f('0x71')]},'raw':!![]})[_0x3a0f('0x1f')](function(_0x588131){if(_0x588131&&_0x588131['autoAssociation']===0x0){return db['UserProfileResource'][_0x3a0f('0x54')]({'name':_0x39067b[_0x3a0f('0x26')],'resourceId':_0x39067b['id'],'type':_0x588131[_0x3a0f('0x26')],'sectionId':_0x588131['id']},{})[_0x3a0f('0x1f')](function(){return _0x216869;});}else{return _0x216869;}})[_0x3a0f('0x47')](function(_0x5d429b){logger[_0x3a0f('0x25')](_0x3a0f('0x72'),_0x5d429b);throw _0x5d429b;});}return _0x216869;})[_0x3a0f('0x1f')](respondWithResult(_0x2139ed,null))[_0x3a0f('0x47')](handleError(_0x2139ed,null));});_0x4f4a86['start']();}catch(_0x42bc1c){_0x2139ed[_0x3a0f('0x15')](0x1f4)['send'](_0x42bc1c);}};exports[_0x3a0f('0x1e')]=function(_0x17bb0a,_0x5ee1d1,_0x40f214){return db[_0x3a0f('0x2a')][_0x3a0f('0x46')]({'where':{'id':_0x17bb0a[_0x3a0f('0x42')]['id']}})[_0x3a0f('0x1f')](handleEntityNotFound(_0x5ee1d1,null))[_0x3a0f('0x1f')](saveUpdates(_[_0x3a0f('0x39')](_0x17bb0a[_0x3a0f('0x73')],[_0x3a0f('0x26'),'description']),null))[_0x3a0f('0x1f')](respondWithResult(_0x5ee1d1,null))[_0x3a0f('0x47')](handleError(_0x5ee1d1,null));};exports['delete']=function(_0x270d5b,_0x143229,_0x583157){return db[_0x3a0f('0x2a')][_0x3a0f('0x46')]({'where':{'id':_0x270d5b['params']['id']}})[_0x3a0f('0x1f')](function(_0x3b09a0){if(_0x3b09a0){return _0x3b09a0[_0x3a0f('0x20')]();}})[_0x3a0f('0x1f')](function(_0x438ee8){var _0x4e419f=path[_0x3a0f('0x51')](config[_0x3a0f('0x4b')],_0x3a0f('0x74'),util['format'](_0x3a0f('0x53'),_0x438ee8['save_name'],_0x438ee8['original_format']));var _0x49431c=path['join'](config[_0x3a0f('0x4b')],'server/files/sounds/converted',util['format'](_0x3a0f('0x53'),_0x438ee8[_0x3a0f('0x4d')],_0x438ee8[_0x3a0f('0x49')]));fs[_0x3a0f('0x5f')](_0x4e419f);fs['unlinkSync'](_0x49431c);return _0x438ee8;})[_0x3a0f('0x1f')](function(_0x5c0632){if(_0x5c0632){return _0x143229[_0x3a0f('0x15')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x143229,null))['catch'](handleError(_0x143229,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index fe0550e..77b4e03 100644 --- a/server/api/sound/sound.model.js +++ b/server/api/sound/sound.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6830=['./sound.attributes','define','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0xd8827e,_0x7a1afc){var _0x59a8bd=function(_0xd4949a){while(--_0xd4949a){_0xd8827e['push'](_0xd8827e['shift']());}};_0x59a8bd(++_0x7a1afc);}(_0x6830,0xc9));var _0x0683=function(_0x29c8d2,_0x30dd23){_0x29c8d2=_0x29c8d2-0x0;var _0x449241=_0x6830[_0x29c8d2];return _0x449241;};'use strict';var _=require(_0x0683('0x0'));var util=require(_0x0683('0x1'));var logger=require(_0x0683('0x2'))(_0x0683('0x3'));var moment=require(_0x0683('0x4'));var BPromise=require(_0x0683('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0683('0x6'));var config=require(_0x0683('0x7'));var attributes=require(_0x0683('0x8'));module['exports']=function(_0x1455d1,_0x5174ad){return _0x1455d1[_0x0683('0x9')]('Sound',attributes,{'tableName':_0x0683('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4001=['path','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','../../config/logger','moment','bluebird','request-promise'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x4001,0x6a));var _0x1400=function(_0x58eb93,_0x3b8263){_0x58eb93=_0x58eb93-0x0;var _0xc0d5c0=_0x4001[_0x58eb93];return _0xc0d5c0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1400('0x0'))('api');var moment=require(_0x1400('0x1'));var BPromise=require(_0x1400('0x2'));var rp=require(_0x1400('0x3'));var fs=require('fs');var path=require(_0x1400('0x4'));var rimraf=require('rimraf');var config=require(_0x1400('0x5'));var attributes=require(_0x1400('0x6'));module[_0x1400('0x7')]=function(_0x53834f,_0x11ff9e){return _0x53834f[_0x1400('0x8')](_0x1400('0x9'),attributes,{'tableName':_0x1400('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 1424a13..43a7af7 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec4e=['jayson/promise','client','request','info','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message','result','ShowSound','Sound','find','options','raw','where','attributes','include','map','then','catch','lodash','moment','rpc','../../config/environment'];(function(_0x5ddd0c,_0x597631){var _0x367d32=function(_0x2bcc73){while(--_0x2bcc73){_0x5ddd0c['push'](_0x5ddd0c['shift']());}};_0x367d32(++_0x597631);}(_0xec4e,0xdc));var _0xeec4=function(_0x2fbd01,_0x120a32){_0x2fbd01=_0x2fbd01-0x0;var _0x1bb013=_0xec4e[_0x2fbd01];return _0x1bb013;};'use strict';var _=require(_0xeec4('0x0'));var util=require('util');var moment=require(_0xeec4('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeec4('0x2'));var config=require(_0xeec4('0x3'));var jayson=require(_0xeec4('0x4'));var client=jayson[_0xeec4('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x238cb7,_0x239870,_0x6250e7){return new BPromise(function(_0x5adb71,_0x4c5c75){return client[_0xeec4('0x6')](_0x238cb7,_0x6250e7)['then'](function(_0x24c2b6){logger[_0xeec4('0x7')]('Sound,\x20%s,\x20%s',_0x239870,'request\x20sent');logger[_0xeec4('0x8')](_0xeec4('0x9'),_0x239870,_0xeec4('0xa'),JSON[_0xeec4('0xb')](_0x24c2b6));if(_0x24c2b6[_0xeec4('0xc')]){if(_0x24c2b6[_0xeec4('0xc')][_0xeec4('0xd')]===0x1f4){logger['error'](_0xeec4('0xe'),_0x239870,_0x24c2b6[_0xeec4('0xc')][_0xeec4('0xf')]);return _0x4c5c75(_0x24c2b6[_0xeec4('0xc')]['message']);}logger[_0xeec4('0xc')](_0xeec4('0xe'),_0x239870,_0x24c2b6['error'][_0xeec4('0xf')]);return _0x5adb71(_0x24c2b6[_0xeec4('0xc')][_0xeec4('0xf')]);}else{logger[_0xeec4('0x7')](_0xeec4('0xe'),_0x239870,_0xeec4('0xa'));_0x5adb71(_0x24c2b6[_0xeec4('0x10')]['message']);}})['catch'](function(_0x364950){logger[_0xeec4('0xc')](_0xeec4('0xe'),_0x239870,_0x364950);_0x4c5c75(_0x364950);});});}exports[_0xeec4('0x11')]=function(_0x22d5bd){var _0xa40e9a=this;return new Promise(function(_0x76224d,_0x508910){return db[_0xeec4('0x12')][_0xeec4('0x13')]({'raw':_0x22d5bd[_0xeec4('0x14')]?_0x22d5bd[_0xeec4('0x14')][_0xeec4('0x15')]===undefined?!![]:![]:!![],'where':_0x22d5bd[_0xeec4('0x14')]?_0x22d5bd[_0xeec4('0x14')][_0xeec4('0x16')]||null:null,'attributes':_0x22d5bd[_0xeec4('0x14')]?_0x22d5bd['options'][_0xeec4('0x17')]||null:null,'include':_0x22d5bd['options']?_0x22d5bd[_0xeec4('0x14')][_0xeec4('0x18')]?_[_0xeec4('0x19')](_0x22d5bd[_0xeec4('0x14')][_0xeec4('0x18')],function(_0x208b22){return{'model':db[_0x208b22['model']],'as':_0x208b22['as'],'attributes':_0x208b22[_0xeec4('0x17')],'include':_0x208b22[_0xeec4('0x18')]?_[_0xeec4('0x19')](_0x208b22['include'],function(_0x2f2ec4){return{'model':db[_0x2f2ec4['model']],'as':_0x2f2ec4['as'],'attributes':_0x2f2ec4[_0xeec4('0x17')],'include':_0x2f2ec4['include']?_[_0xeec4('0x19')](_0x2f2ec4[_0xeec4('0x18')],function(_0x2657bc){return{'model':db[_0x2657bc['model']],'as':_0x2657bc['as'],'attributes':_0x2657bc[_0xeec4('0x17')]};}):[]};}):[]};}):[]:[]})[_0xeec4('0x1a')](function(_0xba3d19){logger[_0xeec4('0x7')](_0xeec4('0x11'),_0x22d5bd);logger[_0xeec4('0x8')](_0xeec4('0x11'),_0x22d5bd,JSON['stringify'](_0xba3d19));_0x76224d(_0xba3d19);})[_0xeec4('0x1b')](function(_0x5c2bae){logger[_0xeec4('0xc')](_0xeec4('0x11'),_0x5c2bae[_0xeec4('0xf')],_0x22d5bd);_0x508910(_0xa40e9a['error'](0x1f4,_0x5c2bae[_0xeec4('0xf')]));});});}; \ No newline at end of file +var _0x571b=['Sound,\x20%s,\x20%s','result','catch','ShowSound','Sound','find','options','attributes','map','model','include','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x571b,0x6b));var _0xb571=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x571b[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xb571('0x0'));var util=require(_0xb571('0x1'));var moment=require(_0xb571('0x2'));var BPromise=require(_0xb571('0x3'));var rs=require(_0xb571('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb571('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb571('0x6'))(_0xb571('0x7'));var config=require(_0xb571('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb571('0x9')][_0xb571('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dab2b,_0x5f2389,_0x57cebf){return new BPromise(function(_0x308b5b,_0x2d4896){return client[_0xb571('0xb')](_0x3dab2b,_0x57cebf)[_0xb571('0xc')](function(_0x249198){logger[_0xb571('0xd')]('Sound,\x20%s,\x20%s',_0x5f2389,_0xb571('0xe'));logger[_0xb571('0xf')](_0xb571('0x10'),_0x5f2389,_0xb571('0xe'),JSON[_0xb571('0x11')](_0x249198));if(_0x249198[_0xb571('0x12')]){if(_0x249198[_0xb571('0x12')][_0xb571('0x13')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x5f2389,_0x249198[_0xb571('0x12')][_0xb571('0x14')]);return _0x2d4896(_0x249198[_0xb571('0x12')][_0xb571('0x14')]);}logger[_0xb571('0x12')](_0xb571('0x15'),_0x5f2389,_0x249198[_0xb571('0x12')][_0xb571('0x14')]);return _0x308b5b(_0x249198[_0xb571('0x12')][_0xb571('0x14')]);}else{logger['info'](_0xb571('0x15'),_0x5f2389,_0xb571('0xe'));_0x308b5b(_0x249198[_0xb571('0x16')][_0xb571('0x14')]);}})[_0xb571('0x17')](function(_0x514965){logger[_0xb571('0x12')](_0xb571('0x15'),_0x5f2389,_0x514965);_0x2d4896(_0x514965);});});}exports[_0xb571('0x18')]=function(_0x198162){var _0x459ec6=this;return new Promise(function(_0x289e69,_0x197dda){return db[_0xb571('0x19')][_0xb571('0x1a')]({'raw':_0x198162['options']?_0x198162[_0xb571('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x198162['options']?_0x198162[_0xb571('0x1b')]['where']||null:null,'attributes':_0x198162['options']?_0x198162[_0xb571('0x1b')][_0xb571('0x1c')]||null:null,'include':_0x198162[_0xb571('0x1b')]?_0x198162[_0xb571('0x1b')]['include']?_[_0xb571('0x1d')](_0x198162['options']['include'],function(_0x27687b){return{'model':db[_0x27687b[_0xb571('0x1e')]],'as':_0x27687b['as'],'attributes':_0x27687b[_0xb571('0x1c')],'include':_0x27687b[_0xb571('0x1f')]?_[_0xb571('0x1d')](_0x27687b['include'],function(_0x24c71c){return{'model':db[_0x24c71c[_0xb571('0x1e')]],'as':_0x24c71c['as'],'attributes':_0x24c71c[_0xb571('0x1c')],'include':_0x24c71c['include']?_['map'](_0x24c71c[_0xb571('0x1f')],function(_0x4a82f2){return{'model':db[_0x4a82f2[_0xb571('0x1e')]],'as':_0x4a82f2['as'],'attributes':_0x4a82f2[_0xb571('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb571('0xc')](function(_0x222a93){logger[_0xb571('0xd')](_0xb571('0x18'),_0x198162);logger[_0xb571('0xf')]('ShowSound',_0x198162,JSON[_0xb571('0x11')](_0x222a93));_0x289e69(_0x222a93);})[_0xb571('0x17')](function(_0x2776c7){logger[_0xb571('0x12')](_0xb571('0x18'),_0x2776c7[_0xb571('0x14')],_0x198162);_0x197dda(_0x459ec6['error'](0x1f4,_0x2776c7[_0xb571('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 75efc71..d4a04ce 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7eb2=['update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x4749bc,_0xd777b9){var _0x4b5918=function(_0x3f5cf4){while(--_0x3f5cf4){_0x4749bc['push'](_0x4749bc['shift']());}};_0x4b5918(++_0xd777b9);}(_0x7eb2,0x7a));var _0x27eb=function(_0x4f579b,_0x1fc8a3){_0x4f579b=_0x4f579b-0x0;var _0x214452=_0x7eb2[_0x4f579b];return _0x214452;};'use strict';var multer=require(_0x27eb('0x0'));var util=require(_0x27eb('0x1'));var path=require(_0x27eb('0x2'));var timeout=require(_0x27eb('0x3'));var express=require(_0x27eb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x27eb('0x5'));var config=require('../../config/environment');var controller=require(_0x27eb('0x6'));router[_0x27eb('0x7')]('/',auth[_0x27eb('0x8')](),controller[_0x27eb('0x9')]);router[_0x27eb('0x7')](_0x27eb('0xa'),auth[_0x27eb('0x8')](),controller[_0x27eb('0xb')]);router[_0x27eb('0xc')]('/',auth[_0x27eb('0x8')](),controller['create']);router[_0x27eb('0xd')](_0x27eb('0xa'),auth['isAuthenticated'](),controller[_0x27eb('0xe')]);router['delete'](_0x27eb('0xa'),auth[_0x27eb('0x8')](),controller[_0x27eb('0xf')]);module[_0x27eb('0x10')]=router; \ No newline at end of file +var _0x8c37=['isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./squareMessage.controller','get'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x8c37,0x1e5));var _0x78c3=function(_0x320981,_0x2ed505){_0x320981=_0x320981-0x0;var _0x39e894=_0x8c37[_0x320981];return _0x39e894;};'use strict';var multer=require(_0x78c3('0x0'));var util=require(_0x78c3('0x1'));var path=require(_0x78c3('0x2'));var timeout=require(_0x78c3('0x3'));var express=require(_0x78c3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x78c3('0x5'));var controller=require(_0x78c3('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x78c3('0x7')]('/:id',auth[_0x78c3('0x8')](),controller['show']);router[_0x78c3('0x9')]('/',auth['isAuthenticated'](),controller[_0x78c3('0xa')]);router[_0x78c3('0xb')](_0x78c3('0xc'),auth[_0x78c3('0x8')](),controller[_0x78c3('0xd')]);router[_0x78c3('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x78c3('0xf')]);module[_0x78c3('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 8676f78..3334cd6 100644 --- a/server/api/squareMessage/squareMessage.attributes.js +++ b/server/api/squareMessage/squareMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f4d=['TEXT','ENUM','out','exports'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x2f4d,0x103));var _0xd2f4=function(_0x4a292b,_0x539e27){_0x4a292b=_0x4a292b-0x0;var _0x281fa7=_0x2f4d[_0x4a292b];return _0x281fa7;};'use strict';var Sequelize=require('sequelize');module[_0xd2f4('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xd2f4('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xd2f4('0x2')]('in',_0xd2f4('0x3')),'defaultValue':_0xd2f4('0x3'),'allowNull':![]}}; \ No newline at end of file +var _0xd337=['medium','out','sequelize','STRING','TEXT'];(function(_0x4141db,_0x32de2b){var _0x126a14=function(_0xb581da){while(--_0xb581da){_0x4141db['push'](_0x4141db['shift']());}};_0x126a14(++_0x32de2b);}(_0xd337,0x6b));var _0x7d33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd337[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7d33('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7d33('0x1')]},'body':{'type':Sequelize[_0x7d33('0x2')](_0x7d33('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x7d33('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index d7d4360..c7aaaf7 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94b8=['options','includeAll','include','params','length','find','catch','update','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','count','status','set','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','SquareMessage','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filter','type','VIRTUAL','merge'];(function(_0x1ac529,_0x519470){var _0x12b7af=function(_0x2244c2){while(--_0x2244c2){_0x1ac529['push'](_0x1ac529['shift']());}};_0x12b7af(++_0x519470);}(_0x94b8,0x111));var _0x894b=function(_0x1907c9,_0x477693){_0x1907c9=_0x1907c9-0x0;var _0x1b1bc2=_0x94b8[_0x1907c9];return _0x1b1bc2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x894b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x894b('0x1'));var rp=require(_0x894b('0x2'));var moment=require(_0x894b('0x3'));var BPromise=require(_0x894b('0x4'));var Mustache=require(_0x894b('0x5'));var util=require('util');var path=require(_0x894b('0x6'));var sox=require(_0x894b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x894b('0x8'));var crypto=require('crypto');var jsforce=require(_0x894b('0x9'));var deskjs=require(_0x894b('0xa'));var toCsv=require('to-csv');var querystring=require(_0x894b('0xb'));var Papa=require(_0x894b('0xc'));var Redis=require(_0x894b('0xd'));var authService=require(_0x894b('0xe'));var qs=require(_0x894b('0xf'));var as=require(_0x894b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x894b('0x11'))(_0x894b('0x12'));var utils=require('../../config/utils');var config=require(_0x894b('0x13'));var db=require(_0x894b('0x14'))['db'];function respondWithStatusCode(_0x4b0458,_0xb03e7f){_0xb03e7f=_0xb03e7f||0xcc;return function(_0x441816){if(_0x441816){return _0x4b0458['sendStatus'](_0xb03e7f);}return _0x4b0458['status'](_0xb03e7f)[_0x894b('0x15')]();};}function respondWithResult(_0x2f5dd7,_0x25c9a4){_0x25c9a4=_0x25c9a4||0xc8;return function(_0xac606a){if(_0xac606a){return _0x2f5dd7['status'](_0x25c9a4)['json'](_0xac606a);}};}function respondWithFilteredResult(_0x132451,_0x3bc899){return function(_0x258678){if(_0x258678){var _0x5130f2=_0x258678[_0x894b('0x16')],_0x1b676d=_0x3bc899['offset'],_0x283ef9=_0x3bc899['offset']+_0x3bc899['limit'],_0x505b8e;if(_0x283ef9>=_0x5130f2){_0x283ef9=_0x5130f2;_0x505b8e=0xc8;}else{_0x505b8e=0xce;}_0x132451[_0x894b('0x17')](_0x505b8e);return _0x132451[_0x894b('0x18')]('Content-Range',_0x1b676d+'-'+_0x283ef9+'/'+_0x5130f2)[_0x894b('0x19')](_0x258678);}return null;};}function patchUpdates(_0x3a32e5){return function(_0x286a6a){try{jsonpatch[_0x894b('0x1a')](_0x286a6a,_0x3a32e5,!![]);}catch(_0x3a6943){return BPromise[_0x894b('0x1b')](_0x3a6943);}return _0x286a6a['save']();};}function saveUpdates(_0x453fd4,_0x15511b){return function(_0x49fd48){if(_0x49fd48){return _0x49fd48['update'](_0x453fd4)[_0x894b('0x1c')](function(_0xee342a){return _0xee342a;});}return null;};}function removeEntity(_0x3f62fc,_0x192eb0){return function(_0x434474){if(_0x434474){return _0x434474[_0x894b('0x1d')]()['then'](function(){_0x3f62fc[_0x894b('0x17')](0xcc)[_0x894b('0x15')]();});}};}function handleEntityNotFound(_0x4d0b80,_0x59fde5){return function(_0x5bd261){if(!_0x5bd261){_0x4d0b80[_0x894b('0x1e')](0x194);}return _0x5bd261;};}function handleError(_0x52915e,_0x436422){_0x436422=_0x436422||0x1f4;return function(_0xdb375a){logger[_0x894b('0x1f')](_0xdb375a[_0x894b('0x20')]);if(_0xdb375a[_0x894b('0x21')]){delete _0xdb375a[_0x894b('0x21')];}_0x52915e[_0x894b('0x17')](_0x436422)[_0x894b('0x22')](_0xdb375a);};}exports[_0x894b('0x23')]=function(_0x1b2ac4,_0x2e319c){var _0x489b7d={},_0x242a4e={},_0x20cb0f={'count':0x0,'rows':[]};var _0x5b524f=_['map'](db[_0x894b('0x24')]['rawAttributes'],function(_0x22a8f6){return{'name':_0x22a8f6['fieldName'],'type':_0x22a8f6['type'][_0x894b('0x25')]};});_0x242a4e[_0x894b('0x26')]=_[_0x894b('0x27')](_0x5b524f,'name');_0x242a4e['query']=_[_0x894b('0x28')](_0x1b2ac4[_0x894b('0x29')]);_0x242a4e[_0x894b('0x2a')]=_['intersection'](_0x242a4e[_0x894b('0x26')],_0x242a4e[_0x894b('0x29')]);_0x489b7d['attributes']=_[_0x894b('0x2b')](_0x242a4e['model'],qs['fields'](_0x1b2ac4['query'][_0x894b('0x2c')]));_0x489b7d[_0x894b('0x2d')]=_0x489b7d['attributes']['length']?_0x489b7d[_0x894b('0x2d')]:_0x242a4e[_0x894b('0x26')];if(!_0x1b2ac4[_0x894b('0x29')][_0x894b('0x2e')](_0x894b('0x2f'))){_0x489b7d[_0x894b('0x30')]=qs['limit'](_0x1b2ac4['query'][_0x894b('0x30')]);_0x489b7d['offset']=qs[_0x894b('0x31')](_0x1b2ac4[_0x894b('0x29')]['offset']);}_0x489b7d['order']=qs[_0x894b('0x32')](_0x1b2ac4[_0x894b('0x29')][_0x894b('0x32')]);_0x489b7d[_0x894b('0x33')]=qs[_0x894b('0x2a')](_[_0x894b('0x34')](_0x1b2ac4['query'],_0x242a4e[_0x894b('0x2a')]));if(_0x1b2ac4[_0x894b('0x29')][_0x894b('0x35')]){_0x489b7d[_0x894b('0x33')]=_['merge'](_0x489b7d[_0x894b('0x33')],{'$or':_['map'](_0x5b524f,function(_0x4efc5e){if(_0x4efc5e[_0x894b('0x36')]!==_0x894b('0x37')){var _0x453ad9={};_0x453ad9[_0x4efc5e[_0x894b('0x21')]]={'$like':'%'+_0x1b2ac4[_0x894b('0x29')][_0x894b('0x35')]+'%'};return _0x453ad9;}})});}_0x489b7d=_[_0x894b('0x38')]({},_0x489b7d,_0x1b2ac4[_0x894b('0x39')]);var _0x1fb225={'where':_0x489b7d[_0x894b('0x33')]};return db[_0x894b('0x24')][_0x894b('0x16')](_0x1fb225)[_0x894b('0x1c')](function(_0x3c66e7){_0x20cb0f[_0x894b('0x16')]=_0x3c66e7;if(_0x1b2ac4[_0x894b('0x29')][_0x894b('0x3a')]){_0x489b7d[_0x894b('0x3b')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x489b7d);})[_0x894b('0x1c')](function(_0x1906a6){_0x20cb0f['rows']=_0x1906a6;return _0x20cb0f;})[_0x894b('0x1c')](respondWithFilteredResult(_0x2e319c,_0x489b7d))['catch'](handleError(_0x2e319c,null));};exports['show']=function(_0x21688e,_0x415038){var _0x4d020b={'raw':!![],'where':{'id':_0x21688e[_0x894b('0x3c')]['id']}},_0x30d79a={};_0x30d79a[_0x894b('0x26')]=_[_0x894b('0x28')](db[_0x894b('0x24')]['rawAttributes']);_0x30d79a[_0x894b('0x29')]=_[_0x894b('0x28')](_0x21688e['query']);_0x30d79a[_0x894b('0x2a')]=_[_0x894b('0x2b')](_0x30d79a[_0x894b('0x26')],_0x30d79a[_0x894b('0x29')]);_0x4d020b['attributes']=_[_0x894b('0x2b')](_0x30d79a['model'],qs[_0x894b('0x2c')](_0x21688e[_0x894b('0x29')][_0x894b('0x2c')]));_0x4d020b[_0x894b('0x2d')]=_0x4d020b[_0x894b('0x2d')][_0x894b('0x3d')]?_0x4d020b[_0x894b('0x2d')]:_0x30d79a[_0x894b('0x26')];if(_0x21688e['query']['includeAll']){_0x4d020b['include']=[{'all':!![]}];}_0x4d020b=_['merge']({},_0x4d020b,_0x21688e[_0x894b('0x39')]);return db[_0x894b('0x24')][_0x894b('0x3e')](_0x4d020b)[_0x894b('0x1c')](handleEntityNotFound(_0x415038,null))['then'](respondWithResult(_0x415038,null))[_0x894b('0x3f')](handleError(_0x415038,null));};exports['create']=function(_0x177ba7,_0x4a8ffa){return db['SquareMessage']['create'](_0x177ba7['body'],{})['then'](respondWithResult(_0x4a8ffa,0xc9))[_0x894b('0x3f')](handleError(_0x4a8ffa,null));};exports[_0x894b('0x40')]=function(_0x20957e,_0x316f05){if(_0x20957e[_0x894b('0x41')]['id']){delete _0x20957e[_0x894b('0x41')]['id'];}return db[_0x894b('0x24')][_0x894b('0x3e')]({'where':{'id':_0x20957e[_0x894b('0x3c')]['id']}})[_0x894b('0x1c')](handleEntityNotFound(_0x316f05,null))[_0x894b('0x1c')](saveUpdates(_0x20957e[_0x894b('0x41')],null))[_0x894b('0x1c')](respondWithResult(_0x316f05,null))[_0x894b('0x3f')](handleError(_0x316f05,null));};exports['destroy']=function(_0x2dfff0,_0x1239bf){return db[_0x894b('0x24')][_0x894b('0x3e')]({'where':{'id':_0x2dfff0[_0x894b('0x3c')]['id']}})[_0x894b('0x1c')](handleEntityNotFound(_0x1239bf,null))[_0x894b('0x1c')](removeEntity(_0x1239bf,null))[_0x894b('0x3f')](handleError(_0x1239bf,null));}; \ No newline at end of file +var _0x3f77=['merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','find','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5afaac,_0x3f5ad6){var _0x3c8082=function(_0x5ec13e){while(--_0x5ec13e){_0x5afaac['push'](_0x5afaac['shift']());}};_0x3c8082(++_0x3f5ad6);}(_0x3f77,0xa0));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x73f7('0x0'));var emlformat=require(_0x73f7('0x1'));var rimraf=require(_0x73f7('0x2'));var zipdir=require(_0x73f7('0x3'));var jsonpatch=require(_0x73f7('0x4'));var rp=require('request-promise');var moment=require(_0x73f7('0x5'));var BPromise=require(_0x73f7('0x6'));var Mustache=require(_0x73f7('0x7'));var util=require(_0x73f7('0x8'));var path=require('path');var sox=require(_0x73f7('0x9'));var csv=require(_0x73f7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x73f7('0xb'));var crypto=require(_0x73f7('0xc'));var jsforce=require(_0x73f7('0xd'));var deskjs=require(_0x73f7('0xe'));var toCsv=require(_0x73f7('0xa'));var querystring=require(_0x73f7('0xf'));var Papa=require('papaparse');var Redis=require(_0x73f7('0x10'));var authService=require(_0x73f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x73f7('0x12'));var hardwareService=require(_0x73f7('0x13'));var logger=require(_0x73f7('0x14'))(_0x73f7('0x15'));var utils=require(_0x73f7('0x16'));var config=require(_0x73f7('0x17'));var db=require(_0x73f7('0x18'))['db'];function respondWithStatusCode(_0x338f71,_0x586205){_0x586205=_0x586205||0xcc;return function(_0x3f9683){if(_0x3f9683){return _0x338f71[_0x73f7('0x19')](_0x586205);}return _0x338f71[_0x73f7('0x1a')](_0x586205)[_0x73f7('0x1b')]();};}function respondWithResult(_0x287ce7,_0x1ba096){_0x1ba096=_0x1ba096||0xc8;return function(_0x48b81c){if(_0x48b81c){return _0x287ce7['status'](_0x1ba096)[_0x73f7('0x1c')](_0x48b81c);}};}function respondWithFilteredResult(_0xae4592,_0x531125){return function(_0x457444){if(_0x457444){var _0x5f3d20=_0x457444['count'],_0x33add7=_0x531125[_0x73f7('0x1d')],_0xb9df44=_0x531125['offset']+_0x531125[_0x73f7('0x1e')],_0x24b7d8;if(_0xb9df44>=_0x5f3d20){_0xb9df44=_0x5f3d20;_0x24b7d8=0xc8;}else{_0x24b7d8=0xce;}_0xae4592[_0x73f7('0x1a')](_0x24b7d8);return _0xae4592[_0x73f7('0x1f')](_0x73f7('0x20'),_0x33add7+'-'+_0xb9df44+'/'+_0x5f3d20)['json'](_0x457444);}return null;};}function patchUpdates(_0x2922fa){return function(_0x1d4ea5){try{jsonpatch['apply'](_0x1d4ea5,_0x2922fa,!![]);}catch(_0x477279){return BPromise[_0x73f7('0x21')](_0x477279);}return _0x1d4ea5[_0x73f7('0x22')]();};}function saveUpdates(_0x43c2b7,_0x2642e5){return function(_0x395a47){if(_0x395a47){return _0x395a47[_0x73f7('0x23')](_0x43c2b7)[_0x73f7('0x24')](function(_0xc67c72){return _0xc67c72;});}return null;};}function removeEntity(_0x2ded95,_0x22741d){return function(_0x42508c){if(_0x42508c){return _0x42508c['destroy']()[_0x73f7('0x24')](function(){_0x2ded95['status'](0xcc)[_0x73f7('0x1b')]();});}};}function handleEntityNotFound(_0x33b38b,_0x181319){return function(_0x59622a){if(!_0x59622a){_0x33b38b[_0x73f7('0x19')](0x194);}return _0x59622a;};}function handleError(_0x2fe1ea,_0x5bccfb){_0x5bccfb=_0x5bccfb||0x1f4;return function(_0x38aa80){logger['error'](_0x38aa80[_0x73f7('0x25')]);if(_0x38aa80[_0x73f7('0x26')]){delete _0x38aa80[_0x73f7('0x26')];}_0x2fe1ea[_0x73f7('0x1a')](_0x5bccfb)[_0x73f7('0x27')](_0x38aa80);};}exports[_0x73f7('0x28')]=function(_0x22d87e,_0x1b0c07){var _0x50ad07={},_0x34265b={},_0xc43758={'count':0x0,'rows':[]};var _0x2247ff=_[_0x73f7('0x29')](db[_0x73f7('0x2a')][_0x73f7('0x2b')],function(_0x4a7517){return{'name':_0x4a7517[_0x73f7('0x2c')],'type':_0x4a7517[_0x73f7('0x2d')][_0x73f7('0x2e')]};});_0x34265b[_0x73f7('0x2f')]=_[_0x73f7('0x29')](_0x2247ff,'name');_0x34265b[_0x73f7('0x30')]=_[_0x73f7('0x31')](_0x22d87e[_0x73f7('0x30')]);_0x34265b[_0x73f7('0x32')]=_['intersection'](_0x34265b[_0x73f7('0x2f')],_0x34265b[_0x73f7('0x30')]);_0x50ad07[_0x73f7('0x33')]=_[_0x73f7('0x34')](_0x34265b[_0x73f7('0x2f')],qs[_0x73f7('0x35')](_0x22d87e[_0x73f7('0x30')][_0x73f7('0x35')]));_0x50ad07[_0x73f7('0x33')]=_0x50ad07[_0x73f7('0x33')][_0x73f7('0x36')]?_0x50ad07[_0x73f7('0x33')]:_0x34265b[_0x73f7('0x2f')];if(!_0x22d87e['query'][_0x73f7('0x37')](_0x73f7('0x38'))){_0x50ad07[_0x73f7('0x1e')]=qs[_0x73f7('0x1e')](_0x22d87e[_0x73f7('0x30')][_0x73f7('0x1e')]);_0x50ad07['offset']=qs[_0x73f7('0x1d')](_0x22d87e['query'][_0x73f7('0x1d')]);}_0x50ad07[_0x73f7('0x39')]=qs[_0x73f7('0x3a')](_0x22d87e['query'][_0x73f7('0x3a')]);_0x50ad07[_0x73f7('0x3b')]=qs['filters'](_[_0x73f7('0x3c')](_0x22d87e[_0x73f7('0x30')],_0x34265b['filters']));if(_0x22d87e['query'][_0x73f7('0x3d')]){_0x50ad07[_0x73f7('0x3b')]=_[_0x73f7('0x3e')](_0x50ad07[_0x73f7('0x3b')],{'$or':_['map'](_0x2247ff,function(_0x53d7e8){if(_0x53d7e8['type']!==_0x73f7('0x3f')){var _0x508e7e={};_0x508e7e[_0x53d7e8['name']]={'$like':'%'+_0x22d87e[_0x73f7('0x30')]['filter']+'%'};return _0x508e7e;}})});}_0x50ad07=_[_0x73f7('0x3e')]({},_0x50ad07,_0x22d87e[_0x73f7('0x40')]);var _0x51305e={'where':_0x50ad07[_0x73f7('0x3b')]};return db[_0x73f7('0x2a')][_0x73f7('0x41')](_0x51305e)[_0x73f7('0x24')](function(_0x45ef66){_0xc43758[_0x73f7('0x41')]=_0x45ef66;if(_0x22d87e[_0x73f7('0x30')][_0x73f7('0x42')]){_0x50ad07[_0x73f7('0x43')]=[{'all':!![]}];}return db['SquareMessage'][_0x73f7('0x44')](_0x50ad07);})[_0x73f7('0x24')](function(_0x4f8bc2){_0xc43758[_0x73f7('0x45')]=_0x4f8bc2;return _0xc43758;})[_0x73f7('0x24')](respondWithFilteredResult(_0x1b0c07,_0x50ad07))[_0x73f7('0x46')](handleError(_0x1b0c07,null));};exports['show']=function(_0x161fbb,_0x3cc8db){var _0xe6e888={'raw':!![],'where':{'id':_0x161fbb[_0x73f7('0x47')]['id']}},_0x53fe49={};_0x53fe49['model']=_[_0x73f7('0x31')](db[_0x73f7('0x2a')][_0x73f7('0x2b')]);_0x53fe49[_0x73f7('0x30')]=_[_0x73f7('0x31')](_0x161fbb[_0x73f7('0x30')]);_0x53fe49[_0x73f7('0x32')]=_[_0x73f7('0x34')](_0x53fe49[_0x73f7('0x2f')],_0x53fe49[_0x73f7('0x30')]);_0xe6e888[_0x73f7('0x33')]=_[_0x73f7('0x34')](_0x53fe49[_0x73f7('0x2f')],qs[_0x73f7('0x35')](_0x161fbb['query'][_0x73f7('0x35')]));_0xe6e888[_0x73f7('0x33')]=_0xe6e888['attributes'][_0x73f7('0x36')]?_0xe6e888['attributes']:_0x53fe49[_0x73f7('0x2f')];if(_0x161fbb[_0x73f7('0x30')]['includeAll']){_0xe6e888[_0x73f7('0x43')]=[{'all':!![]}];}_0xe6e888=_[_0x73f7('0x3e')]({},_0xe6e888,_0x161fbb[_0x73f7('0x40')]);return db[_0x73f7('0x2a')][_0x73f7('0x48')](_0xe6e888)['then'](handleEntityNotFound(_0x3cc8db,null))['then'](respondWithResult(_0x3cc8db,null))[_0x73f7('0x46')](handleError(_0x3cc8db,null));};exports['create']=function(_0x2c460c,_0x59c562){return db[_0x73f7('0x2a')]['create'](_0x2c460c[_0x73f7('0x49')],{})[_0x73f7('0x24')](respondWithResult(_0x59c562,0xc9))[_0x73f7('0x46')](handleError(_0x59c562,null));};exports[_0x73f7('0x23')]=function(_0x347382,_0x4d5f33){if(_0x347382[_0x73f7('0x49')]['id']){delete _0x347382[_0x73f7('0x49')]['id'];}return db[_0x73f7('0x2a')][_0x73f7('0x48')]({'where':{'id':_0x347382[_0x73f7('0x47')]['id']}})['then'](handleEntityNotFound(_0x4d5f33,null))[_0x73f7('0x24')](saveUpdates(_0x347382[_0x73f7('0x49')],null))[_0x73f7('0x24')](respondWithResult(_0x4d5f33,null))[_0x73f7('0x46')](handleError(_0x4d5f33,null));};exports['destroy']=function(_0x2cc60b,_0x41ac20){return db['SquareMessage'][_0x73f7('0x48')]({'where':{'id':_0x2cc60b[_0x73f7('0x47')]['id']}})['then'](handleEntityNotFound(_0x41ac20,null))['then'](removeEntity(_0x41ac20,null))[_0x73f7('0x46')](handleError(_0x41ac20,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index eaaa279..fc77394 100644 --- a/server/api/squareMessage/squareMessage.model.js +++ b/server/api/squareMessage/squareMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd53=['moment','bluebird','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','api'];(function(_0x524703,_0x37e098){var _0x22bb3b=function(_0x5789f4){while(--_0x5789f4){_0x524703['push'](_0x524703['shift']());}};_0x22bb3b(++_0x37e098);}(_0xfd53,0x166));var _0x3fd5=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xfd53[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0x3fd5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3fd5('0x1'));var moment=require(_0x3fd5('0x2'));var BPromise=require(_0x3fd5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3fd5('0x4'));var config=require(_0x3fd5('0x5'));var attributes=require(_0x3fd5('0x6'));module[_0x3fd5('0x7')]=function(_0x55739f,_0x4c3dad){return _0x55739f['define'](_0x3fd5('0x8'),attributes,{'tableName':_0x3fd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd943=['rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3550b4,_0x59b309){var _0x237bca=function(_0x9624f9){while(--_0x9624f9){_0x3550b4['push'](_0x3550b4['shift']());}};_0x237bca(++_0x59b309);}(_0xd943,0xe3));var _0x3d94=function(_0x16e854,_0x41fc20){_0x16e854=_0x16e854-0x0;var _0x141b48=_0xd943[_0x16e854];return _0x141b48;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))('api');var moment=require(_0x3d94('0x3'));var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d94('0x8'));module[_0x3d94('0x9')]=function(_0x2ab667,_0x3767e1){return _0x2ab667[_0x3d94('0xa')](_0x3d94('0xb'),attributes,{'tableName':_0x3d94('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 335128b..cad7d77 100644 --- a/server/api/squareMessage/squareMessage.rpc.js +++ b/server/api/squareMessage/squareMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf072=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareMessage','create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x529a0f,_0x328763){var _0x187a88=function(_0x1ea706){while(--_0x1ea706){_0x529a0f['push'](_0x529a0f['shift']());}};_0x187a88(++_0x328763);}(_0xf072,0x1cf));var _0x2f07=function(_0x3e4be7,_0x489186){_0x3e4be7=_0x3e4be7-0x0;var _0x4cb817=_0xf072[_0x3e4be7];return _0x4cb817;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f07('0x4'))['db'];var utils=require(_0x2f07('0x5'));var logger=require(_0x2f07('0x6'))('rpc');var config=require(_0x2f07('0x7'));var jayson=require(_0x2f07('0x8'));var client=jayson[_0x2f07('0x9')][_0x2f07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x235418,_0xf73d1a,_0x33b99c){return new BPromise(function(_0x379b2e,_0x4746c2){return client[_0x2f07('0xb')](_0x235418,_0x33b99c)[_0x2f07('0xc')](function(_0x2e372c){logger[_0x2f07('0xd')](_0x2f07('0xe'),_0xf73d1a,_0x2f07('0xf'));logger['debug'](_0x2f07('0x10'),_0xf73d1a,_0x2f07('0xf'),JSON[_0x2f07('0x11')](_0x2e372c));if(_0x2e372c[_0x2f07('0x12')]){if(_0x2e372c['error']['code']===0x1f4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x2e372c['error'][_0x2f07('0x13')]);return _0x4746c2(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}logger['error'](_0x2f07('0xe'),_0xf73d1a,_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);return _0x379b2e(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}else{logger[_0x2f07('0xd')]('SquareMessage,\x20%s,\x20%s',_0xf73d1a,_0x2f07('0xf'));_0x379b2e(_0x2e372c['result'][_0x2f07('0x13')]);}})[_0x2f07('0x14')](function(_0x1dace4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x1dace4);_0x4746c2(_0x1dace4);});});}exports[_0x2f07('0x15')]=function(_0x1a6135){var _0xe3ed0=this;return new Promise(function(_0x55bd60,_0x15c3dd){return db['SquareMessage'][_0x2f07('0x16')](_0x1a6135[_0x2f07('0x17')],{'raw':_0x1a6135[_0x2f07('0x18')]?_0x1a6135[_0x2f07('0x18')][_0x2f07('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x45df73){logger['info']('CreateSquareMessage',_0x1a6135);logger['debug'](_0x2f07('0x15'),_0x1a6135,JSON['stringify'](_0x45df73));_0x55bd60(_0x45df73);})[_0x2f07('0x14')](function(_0x5e6ac6){logger[_0x2f07('0x12')](_0x2f07('0x15'),_0x5e6ac6[_0x2f07('0x13')],_0x1a6135);_0x15c3dd(_0xe3ed0[_0x2f07('0x12')](0x1f4,_0x5e6ac6['message']));});});}; \ No newline at end of file +var _0x33af=['options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','body'];(function(_0x1b7161,_0x5e8a7c){var _0x183a17=function(_0x4ea1ed){while(--_0x4ea1ed){_0x1b7161['push'](_0x1b7161['shift']());}};_0x183a17(++_0x5e8a7c);}(_0x33af,0xec));var _0xf33a=function(_0x7a8365,_0x563ade){_0x7a8365=_0x7a8365-0x0;var _0x55359f=_0x33af[_0x7a8365];return _0x55359f;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('SquareMessage,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['create'](_0x524109[_0xf33a('0x17')],{'raw':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x19')]===undefined?!![]:![]:!![]})[_0xf33a('0xa')](function(_0x6cdf7b){logger[_0xf33a('0xb')](_0xf33a('0x15'),_0x524109);logger[_0xf33a('0xe')](_0xf33a('0x15'),_0x524109,JSON['stringify'](_0x6cdf7b));_0x23d9e2(_0x6cdf7b);})[_0xf33a('0x14')](function(_0x272e60){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x272e60[_0xf33a('0x12')],_0x524109);_0x38d69a(_0x2946ef['error'](0x1f4,_0x272e60[_0xf33a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 0c7bb38..24ebca1 100644 --- a/server/api/squareOdbc/index.js +++ b/server/api/squareOdbc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5ac=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','create','update','exports'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0xf5ac,0x98));var _0xcf5a=function(_0x48ed4d,_0x32900a){_0x48ed4d=_0x48ed4d-0x0;var _0x2e350d=_0xf5ac[_0x48ed4d];return _0x2e350d;};'use strict';var multer=require(_0xcf5a('0x0'));var util=require(_0xcf5a('0x1'));var path=require(_0xcf5a('0x2'));var timeout=require(_0xcf5a('0x3'));var express=require(_0xcf5a('0x4'));var router=express['Router']();var auth=require(_0xcf5a('0x5'));var interaction=require(_0xcf5a('0x6'));var config=require(_0xcf5a('0x7'));var controller=require(_0xcf5a('0x8'));router[_0xcf5a('0x9')]('/',auth[_0xcf5a('0xa')](),controller[_0xcf5a('0xb')]);router[_0xcf5a('0x9')](_0xcf5a('0xc'),auth[_0xcf5a('0xa')](),controller[_0xcf5a('0xd')]);router[_0xcf5a('0x9')](_0xcf5a('0xe'),auth[_0xcf5a('0xa')](),timeout('15s'),controller[_0xcf5a('0xf')]);router['post']('/',auth[_0xcf5a('0xa')](),controller[_0xcf5a('0x10')]);router['put'](_0xcf5a('0xc'),auth[_0xcf5a('0xa')](),controller[_0xcf5a('0x11')]);router['delete']('/:id',auth[_0xcf5a('0xa')](),controller['destroy']);module[_0xcf5a('0x12')]=router; \ No newline at end of file +var _0x4f28=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','/:id','/:id/test','15s','test','post','create','put','update','delete','destroy','exports'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x4f28,0x6e));var _0x84f2=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x4f28[_0x47e549];return _0x251374;};'use strict';var multer=require(_0x84f2('0x0'));var util=require(_0x84f2('0x1'));var path=require(_0x84f2('0x2'));var timeout=require(_0x84f2('0x3'));var express=require(_0x84f2('0x4'));var router=express[_0x84f2('0x5')]();var auth=require(_0x84f2('0x6'));var interaction=require(_0x84f2('0x7'));var config=require('../../config/environment');var controller=require(_0x84f2('0x8'));router[_0x84f2('0x9')]('/',auth[_0x84f2('0xa')](),controller['index']);router[_0x84f2('0x9')](_0x84f2('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x84f2('0x9')](_0x84f2('0xc'),auth['isAuthenticated'](),timeout(_0x84f2('0xd')),controller[_0x84f2('0xe')]);router[_0x84f2('0xf')]('/',auth[_0x84f2('0xa')](),controller[_0x84f2('0x10')]);router[_0x84f2('0x11')](_0x84f2('0xb'),auth[_0x84f2('0xa')](),controller[_0x84f2('0x12')]);router[_0x84f2('0x13')]('/:id',auth[_0x84f2('0xa')](),controller[_0x84f2('0x14')]);module[_0x84f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index ffe1f9b..5617a0f 100644 --- a/server/api/squareOdbc/squareOdbc.attributes.js +++ b/server/api/squareOdbc/squareOdbc.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d6d=['name','STRING','exports'];(function(_0x33d581,_0x2da6d0){var _0x3320da=function(_0x17d76a){while(--_0x17d76a){_0x33d581['push'](_0x33d581['shift']());}};_0x3320da(++_0x2da6d0);}(_0x7d6d,0x1c1));var _0xd7d6=function(_0x411ac5,_0x1869a3){_0x411ac5=_0x411ac5-0x0;var _0x4064cd=_0x7d6d[_0x411ac5];return _0x4064cd;};'use strict';var Sequelize=require('sequelize');module[_0xd7d6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd7d6('0x1'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd7d6('0x2')]}}; \ No newline at end of file +var _0xb3f8=['sequelize','exports','STRING','name'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0xb3f8,0x154));var _0x8b3f=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0xb3f8[_0x5465e6];return _0x10044e;};'use strict';var Sequelize=require(_0x8b3f('0x0'));module[_0x8b3f('0x1')]={'name':{'type':Sequelize[_0x8b3f('0x2')],'unique':_0x8b3f('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8b3f('0x2')]},'description':{'type':Sequelize[_0x8b3f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 13a4d42..a6993a6 100644 --- a/server/api/squareOdbc/squareOdbc.controller.js +++ b/server/api/squareOdbc/squareOdbc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc86c=['then','destroy','get','ODBC','UserProfileResource','end','error','stack','name','send','map','SquareOdbc','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','catch','show','params','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','dsn','html-pdf','eml-format','rimraf','zip-dir','moment','util','ejs','lodash','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update'];(function(_0x5f3200,_0x3de3de){var _0x4cef5e=function(_0x8ea3b7){while(--_0x8ea3b7){_0x5f3200['push'](_0x5f3200['shift']());}};_0x4cef5e(++_0x3de3de);}(_0xc86c,0x15f));var _0xcc86=function(_0x1d7bbd,_0x327073){_0x1d7bbd=_0x1d7bbd-0x0;var _0x520685=_0xc86c[_0x1d7bbd];return _0x520685;};'use strict';var pdf=require(_0xcc86('0x0'));var emlformat=require(_0xcc86('0x1'));var rimraf=require(_0xcc86('0x2'));var zipdir=require(_0xcc86('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcc86('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcc86('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcc86('0x6'));var fs=require('fs');var _=require(_0xcc86('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcc86('0x8'));var deskjs=require(_0xcc86('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc86('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcc86('0xb'));var as=require(_0xcc86('0xc'));var hardwareService=require(_0xcc86('0xd'));var logger=require(_0xcc86('0xe'))(_0xcc86('0xf'));var utils=require(_0xcc86('0x10'));var config=require('../../config/environment');var db=require(_0xcc86('0x11'))['db'];function respondWithStatusCode(_0x1907d7,_0x303dc3){_0x303dc3=_0x303dc3||0xcc;return function(_0x54cc35){if(_0x54cc35){return _0x1907d7[_0xcc86('0x12')](_0x303dc3);}return _0x1907d7['status'](_0x303dc3)['end']();};}function respondWithResult(_0xbf3c93,_0x306a19){_0x306a19=_0x306a19||0xc8;return function(_0x1e2cc5){if(_0x1e2cc5){return _0xbf3c93[_0xcc86('0x13')](_0x306a19)['json'](_0x1e2cc5);}};}function respondWithFilteredResult(_0x4c4c65,_0x310dfc){return function(_0x5798aa){if(_0x5798aa){var _0x1ee028=_0x5798aa[_0xcc86('0x14')],_0x480c1f=_0x310dfc[_0xcc86('0x15')],_0x5c6b88=_0x310dfc['offset']+_0x310dfc[_0xcc86('0x16')],_0x2f95b6;if(_0x5c6b88>=_0x1ee028){_0x5c6b88=_0x1ee028;_0x2f95b6=0xc8;}else{_0x2f95b6=0xce;}_0x4c4c65[_0xcc86('0x13')](_0x2f95b6);return _0x4c4c65[_0xcc86('0x17')]('Content-Range',_0x480c1f+'-'+_0x5c6b88+'/'+_0x1ee028)[_0xcc86('0x18')](_0x5798aa);}return null;};}function patchUpdates(_0xc0fec7){return function(_0x524182){try{jsonpatch[_0xcc86('0x19')](_0x524182,_0xc0fec7,!![]);}catch(_0x173f2f){return BPromise[_0xcc86('0x1a')](_0x173f2f);}return _0x524182[_0xcc86('0x1b')]();};}function saveUpdates(_0xbad5cc,_0x48cce4){return function(_0x4f9932){if(_0x4f9932){return _0x4f9932[_0xcc86('0x1c')](_0xbad5cc)[_0xcc86('0x1d')](function(_0x327fbc){return _0x327fbc;});}return null;};}function removeEntity(_0x14ff91,_0x2dadb4){return function(_0x95073){if(_0x95073){return _0x95073[_0xcc86('0x1e')]()[_0xcc86('0x1d')](function(){var _0x1b5416=_0x95073[_0xcc86('0x1f')]({'plain':!![]});var _0x3f4fc3=_0xcc86('0x20');return db[_0xcc86('0x21')][_0xcc86('0x1e')]({'where':{'type':_0x3f4fc3,'resourceId':_0x1b5416['id']}})[_0xcc86('0x1d')](function(){return _0x95073;});})['then'](function(){_0x14ff91[_0xcc86('0x13')](0xcc)[_0xcc86('0x22')]();});}};}function handleEntityNotFound(_0x216b02,_0x5daf2d){return function(_0x4024e9){if(!_0x4024e9){_0x216b02[_0xcc86('0x12')](0x194);}return _0x4024e9;};}function handleError(_0x1b3c9d,_0xa33206){_0xa33206=_0xa33206||0x1f4;return function(_0xd167e0){logger[_0xcc86('0x23')](_0xd167e0[_0xcc86('0x24')]);if(_0xd167e0['name']){delete _0xd167e0[_0xcc86('0x25')];}_0x1b3c9d[_0xcc86('0x13')](_0xa33206)[_0xcc86('0x26')](_0xd167e0);};}exports['index']=function(_0x681a07,_0x55dcc1){var _0x2ac270={},_0x259c2e={},_0x140c9e={'count':0x0,'rows':[]};var _0x1023a8=_[_0xcc86('0x27')](db[_0xcc86('0x28')][_0xcc86('0x29')],function(_0x27d1bb){return{'name':_0x27d1bb['fieldName'],'type':_0x27d1bb[_0xcc86('0x2a')][_0xcc86('0x2b')]};});_0x259c2e['model']=_['map'](_0x1023a8,_0xcc86('0x25'));_0x259c2e['query']=_['keys'](_0x681a07[_0xcc86('0x2c')]);_0x259c2e[_0xcc86('0x2d')]=_[_0xcc86('0x2e')](_0x259c2e[_0xcc86('0x2f')],_0x259c2e[_0xcc86('0x2c')]);_0x2ac270[_0xcc86('0x30')]=_[_0xcc86('0x2e')](_0x259c2e[_0xcc86('0x2f')],qs[_0xcc86('0x31')](_0x681a07[_0xcc86('0x2c')]['fields']));_0x2ac270[_0xcc86('0x30')]=_0x2ac270['attributes'][_0xcc86('0x32')]?_0x2ac270[_0xcc86('0x30')]:_0x259c2e[_0xcc86('0x2f')];if(!_0x681a07[_0xcc86('0x2c')]['hasOwnProperty'](_0xcc86('0x33'))){_0x2ac270[_0xcc86('0x16')]=qs[_0xcc86('0x16')](_0x681a07[_0xcc86('0x2c')][_0xcc86('0x16')]);_0x2ac270[_0xcc86('0x15')]=qs[_0xcc86('0x15')](_0x681a07[_0xcc86('0x2c')]['offset']);}_0x2ac270[_0xcc86('0x34')]=qs[_0xcc86('0x35')](_0x681a07[_0xcc86('0x2c')][_0xcc86('0x35')]);_0x2ac270[_0xcc86('0x36')]=qs[_0xcc86('0x2d')](_[_0xcc86('0x37')](_0x681a07[_0xcc86('0x2c')],_0x259c2e['filters']));if(_0x681a07[_0xcc86('0x2c')][_0xcc86('0x38')]){_0x2ac270[_0xcc86('0x36')]=_[_0xcc86('0x39')](_0x2ac270[_0xcc86('0x36')],{'$or':_[_0xcc86('0x27')](_0x1023a8,function(_0x50e319){if(_0x50e319[_0xcc86('0x2a')]!=='VIRTUAL'){var _0x461205={};_0x461205[_0x50e319[_0xcc86('0x25')]]={'$like':'%'+_0x681a07[_0xcc86('0x2c')][_0xcc86('0x38')]+'%'};return _0x461205;}})});}_0x2ac270=_['merge']({},_0x2ac270,_0x681a07['options']);var _0x2aaef3={'where':_0x2ac270[_0xcc86('0x36')]};return db[_0xcc86('0x28')][_0xcc86('0x14')](_0x2aaef3)['then'](function(_0x40f90e){_0x140c9e[_0xcc86('0x14')]=_0x40f90e;if(_0x681a07[_0xcc86('0x2c')][_0xcc86('0x3a')]){_0x2ac270['include']=[{'all':!![]}];}return db[_0xcc86('0x28')][_0xcc86('0x3b')](_0x2ac270);})['then'](function(_0x57e8b1){_0x140c9e['rows']=_0x57e8b1;return _0x140c9e;})[_0xcc86('0x1d')](respondWithFilteredResult(_0x55dcc1,_0x2ac270))[_0xcc86('0x3c')](handleError(_0x55dcc1,null));};exports[_0xcc86('0x3d')]=function(_0x34365b,_0x3bbe60){var _0x59374b={'raw':!![],'where':{'id':_0x34365b[_0xcc86('0x3e')]['id']}},_0x37822d={};_0x37822d['model']=_['keys'](db[_0xcc86('0x28')]['rawAttributes']);_0x37822d[_0xcc86('0x2c')]=_[_0xcc86('0x3f')](_0x34365b[_0xcc86('0x2c')]);_0x37822d[_0xcc86('0x2d')]=_['intersection'](_0x37822d[_0xcc86('0x2f')],_0x37822d[_0xcc86('0x2c')]);_0x59374b['attributes']=_[_0xcc86('0x2e')](_0x37822d[_0xcc86('0x2f')],qs['fields'](_0x34365b[_0xcc86('0x2c')][_0xcc86('0x31')]));_0x59374b[_0xcc86('0x30')]=_0x59374b['attributes'][_0xcc86('0x32')]?_0x59374b[_0xcc86('0x30')]:_0x37822d[_0xcc86('0x2f')];if(_0x34365b[_0xcc86('0x2c')][_0xcc86('0x3a')]){_0x59374b[_0xcc86('0x40')]=[{'all':!![]}];}_0x59374b=_['merge']({},_0x59374b,_0x34365b['options']);return db[_0xcc86('0x28')][_0xcc86('0x41')](_0x59374b)['then'](handleEntityNotFound(_0x3bbe60,null))[_0xcc86('0x1d')](respondWithResult(_0x3bbe60,null))[_0xcc86('0x3c')](handleError(_0x3bbe60,null));};exports['create']=function(_0x40b43c,_0x5561f6){return db[_0xcc86('0x28')][_0xcc86('0x42')](_0x40b43c['body'],{})[_0xcc86('0x1d')](function(_0x420ffc){var _0x1f3483=_0x40b43c[_0xcc86('0x43')][_0xcc86('0x1f')]({'plain':!![]});if(!_0x1f3483)throw new Error(_0xcc86('0x44'));if(_0x1f3483[_0xcc86('0x45')]===_0xcc86('0x43')){var _0x4c362b=_0x420ffc[_0xcc86('0x1f')]({'plain':!![]});var _0x2cd34c='ODBC';return db[_0xcc86('0x46')][_0xcc86('0x41')]({'where':{'name':_0x2cd34c,'userProfileId':_0x1f3483['userProfileId']},'raw':!![]})['then'](function(_0x473609){if(_0x473609&&_0x473609['autoAssociation']===0x0){return db[_0xcc86('0x21')][_0xcc86('0x42')]({'name':_0x4c362b['name'],'resourceId':_0x4c362b['id'],'type':_0x473609[_0xcc86('0x25')],'sectionId':_0x473609['id']},{})['then'](function(){return _0x420ffc;});}else{return _0x420ffc;}})[_0xcc86('0x3c')](function(_0x47c943){logger['error'](_0xcc86('0x47'),_0x47c943);throw _0x47c943;});}return _0x420ffc;})[_0xcc86('0x1d')](respondWithResult(_0x5561f6,0xc9))[_0xcc86('0x3c')](handleError(_0x5561f6,null));};exports[_0xcc86('0x1c')]=function(_0x15f063,_0x162d8e){if(_0x15f063[_0xcc86('0x48')]['id']){delete _0x15f063[_0xcc86('0x48')]['id'];}return db['SquareOdbc'][_0xcc86('0x41')]({'where':{'id':_0x15f063[_0xcc86('0x3e')]['id']}})['then'](handleEntityNotFound(_0x162d8e,null))[_0xcc86('0x1d')](saveUpdates(_0x15f063[_0xcc86('0x48')],null))['then'](respondWithResult(_0x162d8e,null))[_0xcc86('0x3c')](handleError(_0x162d8e,null));};exports[_0xcc86('0x1e')]=function(_0x3da021,_0x55f533){return db[_0xcc86('0x28')][_0xcc86('0x41')]({'where':{'id':_0x3da021[_0xcc86('0x3e')]['id']}})[_0xcc86('0x1d')](handleEntityNotFound(_0x55f533,null))[_0xcc86('0x1d')](removeEntity(_0x55f533,null))['catch'](handleError(_0x55f533,null));};exports[_0xcc86('0x49')]=function(_0x33a0cb,_0x546a9b,_0x585594){var _0x279ed7;return db[_0xcc86('0x28')]['find']({'where':{'id':_0x33a0cb['params']['id']},'attributes':['id','dsn']})[_0xcc86('0x1d')](handleEntityNotFound(_0x546a9b,null))[_0xcc86('0x1d')](function(_0x2ea4c1){if(_0x2ea4c1){var _0x34684b=require(_0xcc86('0x4a'))();_0x34684b['openSync'](_0x2ea4c1[_0xcc86('0x4b')]);_0x34684b['closeSync']();return _0x2ea4c1;}})[_0xcc86('0x1d')](respondWithResult(_0x546a9b,null))['catch'](handleError(_0x546a9b,null));}; \ No newline at end of file +var _0xe73a=['bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','then','destroy','ODBC','error','stack','name','send','index','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','odbc','dsn','closeSync','html-pdf','eml-format','fast-json-patch','request-promise','moment'];(function(_0xf6e75d,_0xc70967){var _0x27514d=function(_0xc2c6dd){while(--_0xc2c6dd){_0xf6e75d['push'](_0xf6e75d['shift']());}};_0x27514d(++_0xc70967);}(_0xe73a,0xaf));var _0xae73=function(_0x49df93,_0x2bb7ac){_0x49df93=_0x49df93-0x0;var _0x471bac=_0xe73a[_0x49df93];return _0x471bac;};'use strict';var pdf=require(_0xae73('0x0'));var emlformat=require(_0xae73('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xae73('0x2'));var rp=require(_0xae73('0x3'));var moment=require(_0xae73('0x4'));var BPromise=require(_0xae73('0x5'));var Mustache=require(_0xae73('0x6'));var util=require(_0xae73('0x7'));var path=require(_0xae73('0x8'));var sox=require('sox');var csv=require(_0xae73('0x9'));var ejs=require(_0xae73('0xa'));var fs=require('fs');var _=require(_0xae73('0xb'));var squel=require(_0xae73('0xc'));var crypto=require(_0xae73('0xd'));var jsforce=require(_0xae73('0xe'));var deskjs=require(_0xae73('0xf'));var toCsv=require(_0xae73('0x9'));var querystring=require(_0xae73('0x10'));var Papa=require(_0xae73('0x11'));var Redis=require('ioredis');var authService=require(_0xae73('0x12'));var qs=require(_0xae73('0x13'));var as=require(_0xae73('0x14'));var hardwareService=require(_0xae73('0x15'));var logger=require(_0xae73('0x16'))(_0xae73('0x17'));var utils=require(_0xae73('0x18'));var config=require(_0xae73('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22044f,_0x51906e){_0x51906e=_0x51906e||0xcc;return function(_0x6bbf2){if(_0x6bbf2){return _0x22044f[_0xae73('0x1a')](_0x51906e);}return _0x22044f[_0xae73('0x1b')](_0x51906e)[_0xae73('0x1c')]();};}function respondWithResult(_0x29ff96,_0x5d3e33){_0x5d3e33=_0x5d3e33||0xc8;return function(_0xae2b09){if(_0xae2b09){return _0x29ff96['status'](_0x5d3e33)[_0xae73('0x1d')](_0xae2b09);}};}function respondWithFilteredResult(_0x1cba0c,_0x3cc61e){return function(_0x5d8fbf){if(_0x5d8fbf){var _0xe6bbe6=_0x5d8fbf['count'],_0x3d174d=_0x3cc61e[_0xae73('0x1e')],_0x305f19=_0x3cc61e[_0xae73('0x1e')]+_0x3cc61e[_0xae73('0x1f')],_0x1fdbbd;if(_0x305f19>=_0xe6bbe6){_0x305f19=_0xe6bbe6;_0x1fdbbd=0xc8;}else{_0x1fdbbd=0xce;}_0x1cba0c[_0xae73('0x1b')](_0x1fdbbd);return _0x1cba0c[_0xae73('0x20')]('Content-Range',_0x3d174d+'-'+_0x305f19+'/'+_0xe6bbe6)[_0xae73('0x1d')](_0x5d8fbf);}return null;};}function patchUpdates(_0x72c502){return function(_0x1ec212){try{jsonpatch[_0xae73('0x21')](_0x1ec212,_0x72c502,!![]);}catch(_0x3ccc4e){return BPromise['reject'](_0x3ccc4e);}return _0x1ec212['save']();};}function saveUpdates(_0x5f1491,_0x1ac75d){return function(_0x1b5449){if(_0x1b5449){return _0x1b5449['update'](_0x5f1491)[_0xae73('0x22')](function(_0x45d86f){return _0x45d86f;});}return null;};}function removeEntity(_0x3fc294,_0x490f43){return function(_0xbe0c19){if(_0xbe0c19){return _0xbe0c19[_0xae73('0x23')]()[_0xae73('0x22')](function(){var _0xddaaf4=_0xbe0c19['get']({'plain':!![]});var _0x21d440=_0xae73('0x24');return db['UserProfileResource'][_0xae73('0x23')]({'where':{'type':_0x21d440,'resourceId':_0xddaaf4['id']}})[_0xae73('0x22')](function(){return _0xbe0c19;});})[_0xae73('0x22')](function(){_0x3fc294[_0xae73('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d58b3,_0xf4eea6){return function(_0xc7a33){if(!_0xc7a33){_0x1d58b3['sendStatus'](0x194);}return _0xc7a33;};}function handleError(_0x3a0699,_0x29b657){_0x29b657=_0x29b657||0x1f4;return function(_0x4582e4){logger[_0xae73('0x25')](_0x4582e4[_0xae73('0x26')]);if(_0x4582e4['name']){delete _0x4582e4[_0xae73('0x27')];}_0x3a0699[_0xae73('0x1b')](_0x29b657)[_0xae73('0x28')](_0x4582e4);};}exports[_0xae73('0x29')]=function(_0x4e2cdd,_0x586cc9){var _0x5d0e32={},_0x518316={},_0x32917e={'count':0x0,'rows':[]};var _0x1bbcfd=_['map'](db['SquareOdbc']['rawAttributes'],function(_0x1c863a){return{'name':_0x1c863a[_0xae73('0x2a')],'type':_0x1c863a[_0xae73('0x2b')][_0xae73('0x2c')]};});_0x518316['model']=_[_0xae73('0x2d')](_0x1bbcfd,_0xae73('0x27'));_0x518316[_0xae73('0x2e')]=_[_0xae73('0x2f')](_0x4e2cdd[_0xae73('0x2e')]);_0x518316[_0xae73('0x30')]=_[_0xae73('0x31')](_0x518316[_0xae73('0x32')],_0x518316[_0xae73('0x2e')]);_0x5d0e32['attributes']=_[_0xae73('0x31')](_0x518316['model'],qs[_0xae73('0x33')](_0x4e2cdd[_0xae73('0x2e')]['fields']));_0x5d0e32[_0xae73('0x34')]=_0x5d0e32[_0xae73('0x34')]['length']?_0x5d0e32[_0xae73('0x34')]:_0x518316[_0xae73('0x32')];if(!_0x4e2cdd['query'][_0xae73('0x35')](_0xae73('0x36'))){_0x5d0e32[_0xae73('0x1f')]=qs[_0xae73('0x1f')](_0x4e2cdd[_0xae73('0x2e')][_0xae73('0x1f')]);_0x5d0e32[_0xae73('0x1e')]=qs[_0xae73('0x1e')](_0x4e2cdd[_0xae73('0x2e')][_0xae73('0x1e')]);}_0x5d0e32[_0xae73('0x37')]=qs['sort'](_0x4e2cdd['query'][_0xae73('0x38')]);_0x5d0e32[_0xae73('0x39')]=qs[_0xae73('0x30')](_[_0xae73('0x3a')](_0x4e2cdd[_0xae73('0x2e')],_0x518316[_0xae73('0x30')]));if(_0x4e2cdd[_0xae73('0x2e')][_0xae73('0x3b')]){_0x5d0e32[_0xae73('0x39')]=_[_0xae73('0x3c')](_0x5d0e32[_0xae73('0x39')],{'$or':_['map'](_0x1bbcfd,function(_0x55ff1d){if(_0x55ff1d[_0xae73('0x2b')]!==_0xae73('0x3d')){var _0x39018d={};_0x39018d[_0x55ff1d[_0xae73('0x27')]]={'$like':'%'+_0x4e2cdd[_0xae73('0x2e')][_0xae73('0x3b')]+'%'};return _0x39018d;}})});}_0x5d0e32=_[_0xae73('0x3c')]({},_0x5d0e32,_0x4e2cdd[_0xae73('0x3e')]);var _0x3b2213={'where':_0x5d0e32[_0xae73('0x39')]};return db[_0xae73('0x3f')]['count'](_0x3b2213)[_0xae73('0x22')](function(_0x24cf8c){_0x32917e[_0xae73('0x40')]=_0x24cf8c;if(_0x4e2cdd[_0xae73('0x2e')]['includeAll']){_0x5d0e32[_0xae73('0x41')]=[{'all':!![]}];}return db[_0xae73('0x3f')][_0xae73('0x42')](_0x5d0e32);})[_0xae73('0x22')](function(_0x1af108){_0x32917e[_0xae73('0x43')]=_0x1af108;return _0x32917e;})[_0xae73('0x22')](respondWithFilteredResult(_0x586cc9,_0x5d0e32))[_0xae73('0x44')](handleError(_0x586cc9,null));};exports[_0xae73('0x45')]=function(_0x55fb5,_0x597c1e){var _0x59de4d={'raw':!![],'where':{'id':_0x55fb5[_0xae73('0x46')]['id']}},_0x5b5842={};_0x5b5842['model']=_[_0xae73('0x2f')](db[_0xae73('0x3f')][_0xae73('0x47')]);_0x5b5842['query']=_['keys'](_0x55fb5['query']);_0x5b5842[_0xae73('0x30')]=_[_0xae73('0x31')](_0x5b5842[_0xae73('0x32')],_0x5b5842['query']);_0x59de4d[_0xae73('0x34')]=_['intersection'](_0x5b5842[_0xae73('0x32')],qs[_0xae73('0x33')](_0x55fb5[_0xae73('0x2e')]['fields']));_0x59de4d['attributes']=_0x59de4d['attributes'][_0xae73('0x48')]?_0x59de4d['attributes']:_0x5b5842[_0xae73('0x32')];if(_0x55fb5[_0xae73('0x2e')][_0xae73('0x49')]){_0x59de4d[_0xae73('0x41')]=[{'all':!![]}];}_0x59de4d=_['merge']({},_0x59de4d,_0x55fb5[_0xae73('0x3e')]);return db[_0xae73('0x3f')][_0xae73('0x4a')](_0x59de4d)[_0xae73('0x22')](handleEntityNotFound(_0x597c1e,null))[_0xae73('0x22')](respondWithResult(_0x597c1e,null))[_0xae73('0x44')](handleError(_0x597c1e,null));};exports[_0xae73('0x4b')]=function(_0x299633,_0x1a49fe){return db['SquareOdbc'][_0xae73('0x4b')](_0x299633[_0xae73('0x4c')],{})[_0xae73('0x22')](function(_0x202727){var _0x1ca703=_0x299633[_0xae73('0x4d')]['get']({'plain':!![]});if(!_0x1ca703)throw new Error(_0xae73('0x4e'));if(_0x1ca703[_0xae73('0x4f')]===_0xae73('0x4d')){var _0x3787e3=_0x202727[_0xae73('0x50')]({'plain':!![]});var _0x2e4e55=_0xae73('0x24');return db[_0xae73('0x51')]['find']({'where':{'name':_0x2e4e55,'userProfileId':_0x1ca703[_0xae73('0x52')]},'raw':!![]})['then'](function(_0x5dfaa4){if(_0x5dfaa4&&_0x5dfaa4[_0xae73('0x53')]===0x0){return db['UserProfileResource'][_0xae73('0x4b')]({'name':_0x3787e3[_0xae73('0x27')],'resourceId':_0x3787e3['id'],'type':_0x5dfaa4[_0xae73('0x27')],'sectionId':_0x5dfaa4['id']},{})[_0xae73('0x22')](function(){return _0x202727;});}else{return _0x202727;}})[_0xae73('0x44')](function(_0x8b28b9){logger[_0xae73('0x25')](_0xae73('0x54'),_0x8b28b9);throw _0x8b28b9;});}return _0x202727;})[_0xae73('0x22')](respondWithResult(_0x1a49fe,0xc9))[_0xae73('0x44')](handleError(_0x1a49fe,null));};exports[_0xae73('0x55')]=function(_0x40dbca,_0x28c7e9){if(_0x40dbca[_0xae73('0x4c')]['id']){delete _0x40dbca[_0xae73('0x4c')]['id'];}return db['SquareOdbc'][_0xae73('0x4a')]({'where':{'id':_0x40dbca[_0xae73('0x46')]['id']}})[_0xae73('0x22')](handleEntityNotFound(_0x28c7e9,null))[_0xae73('0x22')](saveUpdates(_0x40dbca[_0xae73('0x4c')],null))[_0xae73('0x22')](respondWithResult(_0x28c7e9,null))[_0xae73('0x44')](handleError(_0x28c7e9,null));};exports[_0xae73('0x23')]=function(_0x6f4c90,_0x31c1fd){return db[_0xae73('0x3f')][_0xae73('0x4a')]({'where':{'id':_0x6f4c90[_0xae73('0x46')]['id']}})[_0xae73('0x22')](handleEntityNotFound(_0x31c1fd,null))[_0xae73('0x22')](removeEntity(_0x31c1fd,null))[_0xae73('0x44')](handleError(_0x31c1fd,null));};exports[_0xae73('0x56')]=function(_0x1386d0,_0x3bea67,_0x4f60a7){var _0x341839;return db['SquareOdbc'][_0xae73('0x4a')]({'where':{'id':_0x1386d0['params']['id']},'attributes':['id','dsn']})[_0xae73('0x22')](handleEntityNotFound(_0x3bea67,null))[_0xae73('0x22')](function(_0x38643b){if(_0x38643b){var _0x36f333=require(_0xae73('0x57'))();_0x36f333['openSync'](_0x38643b[_0xae73('0x58')]);_0x36f333[_0xae73('0x59')]();return _0x38643b;}})[_0xae73('0x22')](respondWithResult(_0x3bea67,null))[_0xae73('0x44')](handleError(_0x3bea67,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index b9df53b..75c6f71 100644 --- a/server/api/squareOdbc/squareOdbc.model.js +++ b/server/api/squareOdbc/squareOdbc.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf8=['../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c9c47,_0x30c60d){var _0x327405=function(_0x5aa795){while(--_0x5aa795){_0x3c9c47['push'](_0x3c9c47['shift']());}};_0x327405(++_0x30c60d);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x46884f,_0x2b5c5a){_0x46884f=_0x46884f-0x0;var _0x78c6c0=_0x4cf8[_0x46884f];return _0x78c6c0;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var logger=require(_0x84cf('0x2'))(_0x84cf('0x3'));var moment=require(_0x84cf('0x4'));var BPromise=require(_0x84cf('0x5'));var rp=require(_0x84cf('0x6'));var fs=require('fs');var path=require(_0x84cf('0x7'));var rimraf=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var attributes=require(_0x84cf('0xa'));module[_0x84cf('0xb')]=function(_0x50ade2,_0x4af3f1){return _0x50ade2[_0x84cf('0xc')]('SquareOdbc',attributes,{'tableName':_0x84cf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e1c=['path','./squareOdbc.attributes','exports','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x22ca23,_0x5bfe7d){var _0x1f1810=function(_0x28a1aa){while(--_0x28a1aa){_0x22ca23['push'](_0x22ca23['shift']());}};_0x1f1810(++_0x5bfe7d);}(_0x0e1c,0x101));var _0xc0e1=function(_0xdaf28a,_0x3cd264){_0xdaf28a=_0xdaf28a-0x0;var _0x4a026e=_0x0e1c[_0xdaf28a];return _0x4a026e;};'use strict';var _=require(_0xc0e1('0x0'));var util=require(_0xc0e1('0x1'));var logger=require(_0xc0e1('0x2'))(_0xc0e1('0x3'));var moment=require(_0xc0e1('0x4'));var BPromise=require(_0xc0e1('0x5'));var rp=require(_0xc0e1('0x6'));var fs=require('fs');var path=require(_0xc0e1('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc0e1('0x8'));module[_0xc0e1('0x9')]=function(_0x5595ab,_0x599e14){return _0x5595ab['define']('SquareOdbc',attributes,{'tableName':_0xc0e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index b6073bb..88b5167 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['where','attributes','map','include','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw'];(function(_0x3eff26,_0xe3b424){var _0x31b94f=function(_0x113aed){while(--_0x113aed){_0x3eff26['push'](_0x3eff26['shift']());}};_0x31b94f(++_0xe3b424);}(_0x7217,0x19e));var _0x7721=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x7217[_0x411add];return _0x238242;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowSquareOdbc']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowSquareOdbc',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x16e690,_0x5d4683){var _0x3beb56=function(_0x547cf5){while(--_0x547cf5){_0x16e690['push'](_0x16e690['shift']());}};_0x3beb56(++_0x5d4683);}(_0x55ca,0x126));var _0xa55c=function(_0x168c60,_0x539d96){_0x168c60=_0x168c60-0x0;var _0x29bea4=_0x55ca[_0x168c60];return _0x29bea4;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 1316f3f..4ed317f 100644 --- a/server/api/squareProject/index.js +++ b/server/api/squareProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd914=['delete','removeUsers','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/users','post','create','update'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0xd914,0x17f));var _0x4d91=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0xd914[_0x22377a];return _0x36f105;};'use strict';var multer=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var path=require('path');var timeout=require(_0x4d91('0x2'));var express=require(_0x4d91('0x3'));var router=express[_0x4d91('0x4')]();var auth=require(_0x4d91('0x5'));var interaction=require(_0x4d91('0x6'));var config=require(_0x4d91('0x7'));var controller=require('./squareProject.controller');router[_0x4d91('0x8')]('/',auth['isAuthenticated'](),controller[_0x4d91('0x9')]);router[_0x4d91('0x8')](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller[_0x4d91('0xc')]);router[_0x4d91('0x8')](_0x4d91('0xd'),auth[_0x4d91('0xb')](),controller['getUsers']);router[_0x4d91('0xe')]('/',auth[_0x4d91('0xb')](),controller[_0x4d91('0xf')]);router[_0x4d91('0xe')](_0x4d91('0xd'),auth[_0x4d91('0xb')](),controller['addUsers']);router['put'](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller[_0x4d91('0x10')]);router[_0x4d91('0x11')](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller['destroy']);router['delete'](_0x4d91('0xd'),auth[_0x4d91('0xb')](),controller[_0x4d91('0x12')]);module[_0x4d91('0x13')]=router; \ No newline at end of file +var _0xa902=['show','getUsers','post','create','/:id/users','addUsers','put','delete','multer','util','path','connect-timeout','express','../../components/auth/service','./squareProject.controller','get','isAuthenticated','index','/:id'];(function(_0x4618af,_0x15d4aa){var _0x232566=function(_0x3347b4){while(--_0x3347b4){_0x4618af['push'](_0x4618af['shift']());}};_0x232566(++_0x15d4aa);}(_0xa902,0x8d));var _0x2a90=function(_0x579180,_0x32ce21){_0x579180=_0x579180-0x0;var _0x4224f6=_0xa902[_0x579180];return _0x4224f6;};'use strict';var multer=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var path=require(_0x2a90('0x2'));var timeout=require(_0x2a90('0x3'));var express=require(_0x2a90('0x4'));var router=express['Router']();var auth=require(_0x2a90('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2a90('0x6'));router[_0x2a90('0x7')]('/',auth[_0x2a90('0x8')](),controller[_0x2a90('0x9')]);router[_0x2a90('0x7')](_0x2a90('0xa'),auth['isAuthenticated'](),controller[_0x2a90('0xb')]);router['get']('/:id/users',auth[_0x2a90('0x8')](),controller[_0x2a90('0xc')]);router[_0x2a90('0xd')]('/',auth[_0x2a90('0x8')](),controller[_0x2a90('0xe')]);router['post'](_0x2a90('0xf'),auth[_0x2a90('0x8')](),controller[_0x2a90('0x10')]);router[_0x2a90('0x11')]('/:id',auth[_0x2a90('0x8')](),controller['update']);router[_0x2a90('0x12')]('/:id',auth[_0x2a90('0x8')](),controller['destroy']);router[_0x2a90('0x12')](_0x2a90('0xf'),auth[_0x2a90('0x8')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2cf7a84..f7fb1b2 100644 --- a/server/api/squareProject/squareProject.attributes.js +++ b/server/api/squareProject/squareProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0580=['utf8','sequelize','exports','STRING','name','BLOB','long','getDataValue','preproduction','toString','production'];(function(_0x5641d9,_0x1de53b){var _0x1b1f89=function(_0x27b5b3){while(--_0x27b5b3){_0x5641d9['push'](_0x5641d9['shift']());}};_0x1b1f89(++_0x1de53b);}(_0x0580,0x140));var _0x0058=function(_0x347554,_0x1f98ed){_0x347554=_0x347554-0x0;var _0x3086e0=_0x0580[_0x347554];return _0x3086e0;};'use strict';var Sequelize=require(_0x0058('0x0'));module[_0x0058('0x1')]={'name':{'type':Sequelize[_0x0058('0x2')],'unique':_0x0058('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x0058('0x4')](_0x0058('0x5')),'get':function(){if(this[_0x0058('0x6')](_0x0058('0x7'))){return this[_0x0058('0x6')]('preproduction')[_0x0058('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x0058('0x4')](_0x0058('0x5')),'get':function(){if(this[_0x0058('0x6')](_0x0058('0x9'))){return this[_0x0058('0x6')](_0x0058('0x9'))[_0x0058('0x8')](_0x0058('0xa'));}}}}; \ No newline at end of file +var _0x0d0b=['long','getDataValue','preproduction','utf8','production','toString','sequelize','exports','name','TEXT','BLOB'];(function(_0x4fc2d7,_0x100212){var _0x50c79e=function(_0x473768){while(--_0x473768){_0x4fc2d7['push'](_0x4fc2d7['shift']());}};_0x50c79e(++_0x100212);}(_0x0d0b,0x7f));var _0xb0d0=function(_0x10c6a8,_0x5db43a){_0x10c6a8=_0x10c6a8-0x0;var _0x4f8341=_0x0d0b[_0x10c6a8];return _0x4f8341;};'use strict';var Sequelize=require(_0xb0d0('0x0'));module[_0xb0d0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb0d0('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xb0d0('0x3')]},'preproduction':{'type':Sequelize[_0xb0d0('0x4')](_0xb0d0('0x5')),'get':function(){if(this[_0xb0d0('0x6')]('preproduction')){return this[_0xb0d0('0x6')](_0xb0d0('0x7'))['toString'](_0xb0d0('0x8'));}}},'production':{'type':Sequelize[_0xb0d0('0x4')](_0xb0d0('0x5')),'get':function(){if(this['getDataValue'](_0xb0d0('0x9'))){return this[_0xb0d0('0x6')](_0xb0d0('0x9'))[_0xb0d0('0xa')](_0xb0d0('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 72d906e..6e5168e 100644 --- a/server/api/squareProject/squareProject.controller.js +++ b/server/api/squareProject/squareProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf72b=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SquareProject','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','pick','html-pdf','rimraf'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xf72b,0x1d9));var _0xbf72=function(_0x3947a5,_0x21357b){_0x3947a5=_0x3947a5-0x0;var _0x5dc686=_0xf72b[_0x3947a5];return _0x5dc686;};'use strict';var pdf=require(_0xbf72('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbf72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf72('0x2'));var rp=require(_0xbf72('0x3'));var moment=require('moment');var BPromise=require(_0xbf72('0x4'));var Mustache=require(_0xbf72('0x5'));var util=require(_0xbf72('0x6'));var path=require(_0xbf72('0x7'));var sox=require(_0xbf72('0x8'));var csv=require(_0xbf72('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbf72('0xa'));var squel=require(_0xbf72('0xb'));var crypto=require(_0xbf72('0xc'));var jsforce=require(_0xbf72('0xd'));var deskjs=require(_0xbf72('0xe'));var toCsv=require(_0xbf72('0x9'));var querystring=require('querystring');var Papa=require(_0xbf72('0xf'));var Redis=require('ioredis');var authService=require(_0xbf72('0x10'));var qs=require(_0xbf72('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf72('0x12'));var logger=require(_0xbf72('0x13'))(_0xbf72('0x14'));var utils=require(_0xbf72('0x15'));var config=require(_0xbf72('0x16'));var db=require(_0xbf72('0x17'))['db'];config[_0xbf72('0x18')]=_[_0xbf72('0x19')](config['redis'],{'host':_0xbf72('0x1a'),'port':0x18eb});var socket=require(_0xbf72('0x1b'))(new Redis(config[_0xbf72('0x18')]));require('./squareProject.socket')[_0xbf72('0x1c')](socket);function respondWithStatusCode(_0x4f4fa5,_0x5625b3){_0x5625b3=_0x5625b3||0xcc;return function(_0x4a79df){if(_0x4a79df){return _0x4f4fa5[_0xbf72('0x1d')](_0x5625b3);}return _0x4f4fa5[_0xbf72('0x1e')](_0x5625b3)[_0xbf72('0x1f')]();};}function respondWithResult(_0x723eb1,_0x39d0cd){_0x39d0cd=_0x39d0cd||0xc8;return function(_0x160d61){if(_0x160d61){return _0x723eb1['status'](_0x39d0cd)[_0xbf72('0x20')](_0x160d61);}};}function respondWithFilteredResult(_0xeb7183,_0x2a8609){return function(_0x3d4dea){if(_0x3d4dea){var _0x27dadc=_0x3d4dea[_0xbf72('0x21')],_0x5b5fc9=_0x2a8609[_0xbf72('0x22')],_0x51d4c9=_0x2a8609[_0xbf72('0x22')]+_0x2a8609[_0xbf72('0x23')],_0x1b8d73;if(_0x51d4c9>=_0x27dadc){_0x51d4c9=_0x27dadc;_0x1b8d73=0xc8;}else{_0x1b8d73=0xce;}_0xeb7183[_0xbf72('0x1e')](_0x1b8d73);return _0xeb7183[_0xbf72('0x24')]('Content-Range',_0x5b5fc9+'-'+_0x51d4c9+'/'+_0x27dadc)[_0xbf72('0x20')](_0x3d4dea);}return null;};}function patchUpdates(_0x42a193){return function(_0xcd9c0b){try{jsonpatch[_0xbf72('0x25')](_0xcd9c0b,_0x42a193,!![]);}catch(_0x3486f3){return BPromise['reject'](_0x3486f3);}return _0xcd9c0b[_0xbf72('0x26')]();};}function saveUpdates(_0x1de926,_0x536071){return function(_0x35c40f){if(_0x35c40f){return _0x35c40f[_0xbf72('0x27')](_0x1de926)[_0xbf72('0x28')](function(_0x4c7f3d){return _0x4c7f3d;});}return null;};}function removeEntity(_0x44f3f9,_0x428361){return function(_0x44d456){if(_0x44d456){return _0x44d456[_0xbf72('0x29')]()['then'](function(){var _0x1deea6=_0x44d456[_0xbf72('0x2a')]({'plain':!![]});var _0x1c8b8b='SquareProjects';return db[_0xbf72('0x2b')][_0xbf72('0x29')]({'where':{'type':_0x1c8b8b,'resourceId':_0x1deea6['id']}})[_0xbf72('0x28')](function(){return _0x44d456;});})[_0xbf72('0x28')](function(){_0x44f3f9[_0xbf72('0x1e')](0xcc)[_0xbf72('0x1f')]();});}};}function handleEntityNotFound(_0x182154,_0x25ecdf){return function(_0xd418a2){if(!_0xd418a2){_0x182154[_0xbf72('0x1d')](0x194);}return _0xd418a2;};}function handleError(_0x280d7a,_0x20e747){_0x20e747=_0x20e747||0x1f4;return function(_0x4a6ccf){logger[_0xbf72('0x2c')](_0x4a6ccf[_0xbf72('0x2d')]);if(_0x4a6ccf['name']){delete _0x4a6ccf[_0xbf72('0x2e')];}_0x280d7a[_0xbf72('0x1e')](_0x20e747)[_0xbf72('0x2f')](_0x4a6ccf);};}exports[_0xbf72('0x30')]=function(_0xb1ee4e,_0x82c0f0){var _0x35ecdc={},_0x209b2b={},_0x1be26a={'count':0x0,'rows':[]};var _0x534e38=_[_0xbf72('0x31')](db[_0xbf72('0x32')][_0xbf72('0x33')],function(_0x3ad363){return{'name':_0x3ad363['fieldName'],'type':_0x3ad363[_0xbf72('0x34')][_0xbf72('0x35')]};});_0x209b2b[_0xbf72('0x36')]=_['map'](_0x534e38,'name');_0x209b2b['query']=_[_0xbf72('0x37')](_0xb1ee4e[_0xbf72('0x38')]);_0x209b2b[_0xbf72('0x39')]=_['intersection'](_0x209b2b[_0xbf72('0x36')],_0x209b2b[_0xbf72('0x38')]);_0x35ecdc['attributes']=_[_0xbf72('0x3a')](_0x209b2b['model'],qs[_0xbf72('0x3b')](_0xb1ee4e[_0xbf72('0x38')]['fields']));_0x35ecdc['attributes']=_0x35ecdc[_0xbf72('0x3c')][_0xbf72('0x3d')]?_0x35ecdc[_0xbf72('0x3c')]:_0x209b2b[_0xbf72('0x36')];if(!_0xb1ee4e[_0xbf72('0x38')][_0xbf72('0x3e')](_0xbf72('0x3f'))){_0x35ecdc[_0xbf72('0x23')]=qs[_0xbf72('0x23')](_0xb1ee4e['query'][_0xbf72('0x23')]);_0x35ecdc[_0xbf72('0x22')]=qs[_0xbf72('0x22')](_0xb1ee4e[_0xbf72('0x38')]['offset']);}_0x35ecdc[_0xbf72('0x40')]=qs[_0xbf72('0x41')](_0xb1ee4e['query'][_0xbf72('0x41')]);_0x35ecdc['where']=qs['filters'](_['pick'](_0xb1ee4e['query'],_0x209b2b[_0xbf72('0x39')]));if(_0xb1ee4e['query']['filter']){_0x35ecdc[_0xbf72('0x42')]=_['merge'](_0x35ecdc[_0xbf72('0x42')],{'$or':_[_0xbf72('0x31')](_0x534e38,function(_0x4bc204){if(_0x4bc204[_0xbf72('0x34')]!=='VIRTUAL'){var _0x5c9edb={};_0x5c9edb[_0x4bc204[_0xbf72('0x2e')]]={'$like':'%'+_0xb1ee4e[_0xbf72('0x38')][_0xbf72('0x43')]+'%'};return _0x5c9edb;}})});}_0x35ecdc=_[_0xbf72('0x44')]({},_0x35ecdc,_0xb1ee4e[_0xbf72('0x45')]);var _0x3b3a58={'where':_0x35ecdc[_0xbf72('0x42')]};return db[_0xbf72('0x32')]['count'](_0x3b3a58)[_0xbf72('0x28')](function(_0x3831b9){_0x1be26a['count']=_0x3831b9;if(_0xb1ee4e[_0xbf72('0x38')]['includeAll']){_0x35ecdc['include']=[{'all':!![]}];}return db[_0xbf72('0x32')][_0xbf72('0x46')](_0x35ecdc);})[_0xbf72('0x28')](function(_0x34d014){_0x1be26a[_0xbf72('0x47')]=_0x34d014;return _0x1be26a;})['then'](respondWithFilteredResult(_0x82c0f0,_0x35ecdc))['catch'](handleError(_0x82c0f0,null));};exports['show']=function(_0x359c2b,_0x3a7828){var _0x3871d0={'raw':![],'where':{'id':_0x359c2b['params']['id']}},_0x2a679a={};_0x2a679a['model']=_[_0xbf72('0x37')](db['SquareProject'][_0xbf72('0x33')]);_0x2a679a[_0xbf72('0x38')]=_[_0xbf72('0x37')](_0x359c2b[_0xbf72('0x38')]);_0x2a679a['filters']=_[_0xbf72('0x3a')](_0x2a679a[_0xbf72('0x36')],_0x2a679a[_0xbf72('0x38')]);_0x3871d0[_0xbf72('0x3c')]=_['intersection'](_0x2a679a[_0xbf72('0x36')],qs[_0xbf72('0x3b')](_0x359c2b['query'][_0xbf72('0x3b')]));_0x3871d0[_0xbf72('0x3c')]=_0x3871d0[_0xbf72('0x3c')][_0xbf72('0x3d')]?_0x3871d0[_0xbf72('0x3c')]:_0x2a679a[_0xbf72('0x36')];if(_0x359c2b[_0xbf72('0x38')]['includeAll']){_0x3871d0['include']=[{'all':!![]}];}_0x3871d0=_['merge']({},_0x3871d0,_0x359c2b[_0xbf72('0x45')]);return db['SquareProject'][_0xbf72('0x48')](_0x3871d0)['then'](handleEntityNotFound(_0x3a7828,null))['then'](respondWithResult(_0x3a7828,null))['catch'](handleError(_0x3a7828,null));};exports[_0xbf72('0x49')]=function(_0x15a271,_0x15e94f){return db[_0xbf72('0x32')][_0xbf72('0x49')](_0x15a271[_0xbf72('0x4a')],{})['then'](function(_0x3ffa72){var _0x5e2dab=_0x15a271[_0xbf72('0x4b')]['get']({'plain':!![]});if(!_0x5e2dab)throw new Error(_0xbf72('0x4c'));if(_0x5e2dab[_0xbf72('0x4d')]===_0xbf72('0x4b')){var _0x1fd1f8=_0x3ffa72[_0xbf72('0x2a')]({'plain':!![]});var _0x75cf1=_0xbf72('0x4e');return db[_0xbf72('0x4f')][_0xbf72('0x48')]({'where':{'name':_0x75cf1,'userProfileId':_0x5e2dab['userProfileId']},'raw':!![]})[_0xbf72('0x28')](function(_0x2f9816){if(_0x2f9816&&_0x2f9816[_0xbf72('0x50')]===0x0){return db['UserProfileResource'][_0xbf72('0x49')]({'name':_0x1fd1f8[_0xbf72('0x2e')],'resourceId':_0x1fd1f8['id'],'type':_0x2f9816[_0xbf72('0x2e')],'sectionId':_0x2f9816['id']},{})[_0xbf72('0x28')](function(){return _0x3ffa72;});}else{return _0x3ffa72;}})[_0xbf72('0x51')](function(_0x53da82){logger[_0xbf72('0x2c')](_0xbf72('0x52'),_0x53da82);throw _0x53da82;});}return _0x3ffa72;})['then'](respondWithResult(_0x15e94f,0xc9))[_0xbf72('0x51')](handleError(_0x15e94f,null));};exports['update']=function(_0x58080b,_0xf00ac2){if(_0x58080b[_0xbf72('0x4a')]['id']){delete _0x58080b[_0xbf72('0x4a')]['id'];}return db[_0xbf72('0x32')][_0xbf72('0x48')]({'where':{'id':_0x58080b['params']['id']}})['then'](handleEntityNotFound(_0xf00ac2,null))['then'](saveUpdates(_0x58080b[_0xbf72('0x4a')],null))[_0xbf72('0x28')](respondWithResult(_0xf00ac2,null))[_0xbf72('0x51')](handleError(_0xf00ac2,null));};exports[_0xbf72('0x29')]=function(_0x5cfbc4,_0x5e2f01){return db[_0xbf72('0x32')][_0xbf72('0x48')]({'where':{'id':_0x5cfbc4[_0xbf72('0x53')]['id']}})['then'](handleEntityNotFound(_0x5e2f01,null))[_0xbf72('0x28')](removeEntity(_0x5e2f01,null))['catch'](handleError(_0x5e2f01,null));};exports[_0xbf72('0x54')]=function(_0x3da80c,_0x5718ab,_0x2b3c34){return db[_0xbf72('0x32')]['find']({'where':{'id':_0x3da80c[_0xbf72('0x53')]['id']}})[_0xbf72('0x28')](handleEntityNotFound(_0x5718ab,null))[_0xbf72('0x28')](function(_0x4ee0a8){if(_0x4ee0a8){return _0x4ee0a8['addUsers'](_0x3da80c['body'][_0xbf72('0x55')],_[_0xbf72('0x56')](_0x3da80c[_0xbf72('0x4a')],[_0xbf72('0x55'),'id'])||{});}})[_0xbf72('0x28')](respondWithResult(_0x5718ab,null))[_0xbf72('0x51')](handleError(_0x5718ab,null));};exports[_0xbf72('0x57')]=function(_0x201342,_0x3b0815,_0x56d6f2){return db[_0xbf72('0x32')][_0xbf72('0x48')]({'where':{'id':_0x201342['params']['id']}})[_0xbf72('0x28')](handleEntityNotFound(_0x3b0815,null))[_0xbf72('0x28')](function(_0xac1936){if(_0xac1936){return _0xac1936[_0xbf72('0x57')](_0x201342[_0xbf72('0x38')][_0xbf72('0x55')])[_0xbf72('0x28')](function(){if(_[_0xbf72('0x58')](_0x201342[_0xbf72('0x38')]['ids'])){for(var _0x56cfe1=0x0;_0x56cfe1<_0x201342[_0xbf72('0x38')][_0xbf72('0x55')][_0xbf72('0x3d')];_0x56cfe1+=0x1){socket[_0xbf72('0x59')](_0xbf72('0x5a'),{'UserId':Number(_0x201342[_0xbf72('0x38')][_0xbf72('0x55')][_0x56cfe1]),'SquareProjectId':Number(_0x201342[_0xbf72('0x53')]['id'])});}}else{socket['emit'](_0xbf72('0x5a'),{'UserId':Number(_0x201342[_0xbf72('0x38')][_0xbf72('0x55')]),'SquareProjectId':Number(_0x201342[_0xbf72('0x53')]['id'])});}});}})[_0xbf72('0x28')](respondWithStatusCode(_0x3b0815,null))[_0xbf72('0x51')](handleError(_0x3b0815,null));};exports[_0xbf72('0x5b')]=function(_0x59495b,_0x428902,_0xc3f0cc){var _0x23550f={};var _0x300516={};var _0x44e62f;var _0x107391;return db[_0xbf72('0x32')][_0xbf72('0x5c')]({'where':{'id':_0x59495b['params']['id']}})[_0xbf72('0x28')](handleEntityNotFound(_0x428902,null))[_0xbf72('0x28')](function(_0x17ab12){if(_0x17ab12){_0x44e62f=_0x17ab12;_0x300516['model']=_[_0xbf72('0x37')](db[_0xbf72('0x5d')]['rawAttributes']);_0x300516[_0xbf72('0x38')]=_[_0xbf72('0x37')](_0x59495b['query']);_0x300516[_0xbf72('0x39')]=_[_0xbf72('0x3a')](_0x300516['model'],_0x300516[_0xbf72('0x38')]);_0x23550f[_0xbf72('0x3c')]=_[_0xbf72('0x3a')](_0x300516[_0xbf72('0x36')],qs[_0xbf72('0x3b')](_0x59495b[_0xbf72('0x38')][_0xbf72('0x3b')]));_0x23550f['attributes']=_0x23550f[_0xbf72('0x3c')][_0xbf72('0x3d')]?_0x23550f['attributes']:_0x300516[_0xbf72('0x36')];_0x23550f['order']=qs['sort'](_0x59495b[_0xbf72('0x38')][_0xbf72('0x41')]);_0x23550f[_0xbf72('0x42')]=qs[_0xbf72('0x39')](_[_0xbf72('0x5e')](_0x59495b[_0xbf72('0x38')],_0x300516['filters']));if(_0x59495b[_0xbf72('0x38')][_0xbf72('0x43')]){_0x23550f[_0xbf72('0x42')]=_[_0xbf72('0x44')](_0x23550f['where'],{'$or':_[_0xbf72('0x31')](_0x23550f[_0xbf72('0x3c')],function(_0x44d3ea){var _0x320351={};_0x320351[_0x44d3ea]={'$like':'%'+_0x59495b['query'][_0xbf72('0x43')]+'%'};return _0x320351;})});}_0x23550f=_['merge']({},_0x23550f,_0x59495b[_0xbf72('0x45')]);return _0x44e62f[_0xbf72('0x5b')](_0x23550f);}})[_0xbf72('0x28')](function(_0x53bd1c){if(_0x53bd1c){_0x107391=_0x53bd1c[_0xbf72('0x3d')];if(!_0x59495b[_0xbf72('0x38')][_0xbf72('0x3e')](_0xbf72('0x3f'))){_0x23550f[_0xbf72('0x23')]=qs[_0xbf72('0x23')](_0x59495b[_0xbf72('0x38')][_0xbf72('0x23')]);_0x23550f[_0xbf72('0x22')]=qs[_0xbf72('0x22')](_0x59495b[_0xbf72('0x38')][_0xbf72('0x22')]);}return _0x44e62f['getUsers'](_0x23550f);}})[_0xbf72('0x28')](function(_0x172688){if(_0x172688){return _0x172688?{'count':_0x107391,'rows':_0x172688}:null;}})[_0xbf72('0x28')](respondWithResult(_0x428902,null))['catch'](handleError(_0x428902,null));}; \ No newline at end of file +var _0xe13a=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','sendStatus','status','end','json','count','offset','set','apply','reject','then','get','SquareProjects','destroy','error','stack','name','send','index','map','SquareProject','rawAttributes','key','model','query','keys','filters','intersection','attributes','nolimit','limit','sort','where','filter','type','options','includeAll','findAll','rows','catch','show','params','fields','length','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','pick','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe13a,0x178));var _0xae13=function(_0x34ac99,_0x2d1933){_0x34ac99=_0x34ac99-0x0;var _0xd3baae=_0xe13a[_0x34ac99];return _0xd3baae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xae13('0x0'));var rimraf=require(_0xae13('0x1'));var zipdir=require(_0xae13('0x2'));var jsonpatch=require(_0xae13('0x3'));var rp=require('request-promise');var moment=require(_0xae13('0x4'));var BPromise=require(_0xae13('0x5'));var Mustache=require(_0xae13('0x6'));var util=require(_0xae13('0x7'));var path=require(_0xae13('0x8'));var sox=require(_0xae13('0x9'));var csv=require(_0xae13('0xa'));var ejs=require(_0xae13('0xb'));var fs=require('fs');var _=require(_0xae13('0xc'));var squel=require('squel');var crypto=require(_0xae13('0xd'));var jsforce=require(_0xae13('0xe'));var deskjs=require(_0xae13('0xf'));var toCsv=require(_0xae13('0xa'));var querystring=require(_0xae13('0x10'));var Papa=require(_0xae13('0x11'));var Redis=require(_0xae13('0x12'));var authService=require(_0xae13('0x13'));var qs=require(_0xae13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae13('0x15'));var logger=require(_0xae13('0x16'))(_0xae13('0x17'));var utils=require(_0xae13('0x18'));var config=require(_0xae13('0x19'));var db=require(_0xae13('0x1a'))['db'];config[_0xae13('0x1b')]=_['defaults'](config[_0xae13('0x1b')],{'host':_0xae13('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x52484b,_0x26ff3e){_0x26ff3e=_0x26ff3e||0xcc;return function(_0x148186){if(_0x148186){return _0x52484b[_0xae13('0x1d')](_0x26ff3e);}return _0x52484b[_0xae13('0x1e')](_0x26ff3e)[_0xae13('0x1f')]();};}function respondWithResult(_0x2912a2,_0x5c25a4){_0x5c25a4=_0x5c25a4||0xc8;return function(_0x3c488f){if(_0x3c488f){return _0x2912a2['status'](_0x5c25a4)[_0xae13('0x20')](_0x3c488f);}};}function respondWithFilteredResult(_0x16764b,_0x207363){return function(_0x118e52){if(_0x118e52){var _0x1a9c07=_0x118e52[_0xae13('0x21')],_0x1b33b7=_0x207363['offset'],_0x32dcbe=_0x207363[_0xae13('0x22')]+_0x207363['limit'],_0x326471;if(_0x32dcbe>=_0x1a9c07){_0x32dcbe=_0x1a9c07;_0x326471=0xc8;}else{_0x326471=0xce;}_0x16764b[_0xae13('0x1e')](_0x326471);return _0x16764b[_0xae13('0x23')]('Content-Range',_0x1b33b7+'-'+_0x32dcbe+'/'+_0x1a9c07)[_0xae13('0x20')](_0x118e52);}return null;};}function patchUpdates(_0x39d41c){return function(_0x3e4bc8){try{jsonpatch[_0xae13('0x24')](_0x3e4bc8,_0x39d41c,!![]);}catch(_0x184375){return BPromise[_0xae13('0x25')](_0x184375);}return _0x3e4bc8['save']();};}function saveUpdates(_0x520692,_0x149eda){return function(_0x290fb9){if(_0x290fb9){return _0x290fb9['update'](_0x520692)[_0xae13('0x26')](function(_0x519a37){return _0x519a37;});}return null;};}function removeEntity(_0x13c2de,_0x194437){return function(_0x3f12b0){if(_0x3f12b0){return _0x3f12b0['destroy']()['then'](function(){var _0x4e38c3=_0x3f12b0[_0xae13('0x27')]({'plain':!![]});var _0xc5e6a7=_0xae13('0x28');return db['UserProfileResource'][_0xae13('0x29')]({'where':{'type':_0xc5e6a7,'resourceId':_0x4e38c3['id']}})['then'](function(){return _0x3f12b0;});})[_0xae13('0x26')](function(){_0x13c2de['status'](0xcc)[_0xae13('0x1f')]();});}};}function handleEntityNotFound(_0x3117c2,_0x526e4e){return function(_0xa98d6c){if(!_0xa98d6c){_0x3117c2[_0xae13('0x1d')](0x194);}return _0xa98d6c;};}function handleError(_0x64b40b,_0x306dfb){_0x306dfb=_0x306dfb||0x1f4;return function(_0x578e99){logger[_0xae13('0x2a')](_0x578e99[_0xae13('0x2b')]);if(_0x578e99[_0xae13('0x2c')]){delete _0x578e99[_0xae13('0x2c')];}_0x64b40b[_0xae13('0x1e')](_0x306dfb)[_0xae13('0x2d')](_0x578e99);};}exports[_0xae13('0x2e')]=function(_0x5bd0ee,_0x133481){var _0x591f94={},_0xf6289c={},_0x100df1={'count':0x0,'rows':[]};var _0x2dc2af=_[_0xae13('0x2f')](db[_0xae13('0x30')][_0xae13('0x31')],function(_0x11c2ba){return{'name':_0x11c2ba['fieldName'],'type':_0x11c2ba['type'][_0xae13('0x32')]};});_0xf6289c[_0xae13('0x33')]=_[_0xae13('0x2f')](_0x2dc2af,_0xae13('0x2c'));_0xf6289c[_0xae13('0x34')]=_[_0xae13('0x35')](_0x5bd0ee[_0xae13('0x34')]);_0xf6289c[_0xae13('0x36')]=_[_0xae13('0x37')](_0xf6289c[_0xae13('0x33')],_0xf6289c['query']);_0x591f94[_0xae13('0x38')]=_[_0xae13('0x37')](_0xf6289c[_0xae13('0x33')],qs['fields'](_0x5bd0ee['query']['fields']));_0x591f94['attributes']=_0x591f94['attributes']['length']?_0x591f94[_0xae13('0x38')]:_0xf6289c[_0xae13('0x33')];if(!_0x5bd0ee[_0xae13('0x34')]['hasOwnProperty'](_0xae13('0x39'))){_0x591f94[_0xae13('0x3a')]=qs[_0xae13('0x3a')](_0x5bd0ee[_0xae13('0x34')][_0xae13('0x3a')]);_0x591f94['offset']=qs[_0xae13('0x22')](_0x5bd0ee[_0xae13('0x34')][_0xae13('0x22')]);}_0x591f94['order']=qs['sort'](_0x5bd0ee[_0xae13('0x34')][_0xae13('0x3b')]);_0x591f94[_0xae13('0x3c')]=qs[_0xae13('0x36')](_['pick'](_0x5bd0ee[_0xae13('0x34')],_0xf6289c[_0xae13('0x36')]));if(_0x5bd0ee['query'][_0xae13('0x3d')]){_0x591f94[_0xae13('0x3c')]=_['merge'](_0x591f94[_0xae13('0x3c')],{'$or':_[_0xae13('0x2f')](_0x2dc2af,function(_0x3d3569){if(_0x3d3569[_0xae13('0x3e')]!=='VIRTUAL'){var _0x20e4ec={};_0x20e4ec[_0x3d3569[_0xae13('0x2c')]]={'$like':'%'+_0x5bd0ee[_0xae13('0x34')][_0xae13('0x3d')]+'%'};return _0x20e4ec;}})});}_0x591f94=_['merge']({},_0x591f94,_0x5bd0ee[_0xae13('0x3f')]);var _0x38b410={'where':_0x591f94[_0xae13('0x3c')]};return db[_0xae13('0x30')]['count'](_0x38b410)['then'](function(_0x34bf8b){_0x100df1[_0xae13('0x21')]=_0x34bf8b;if(_0x5bd0ee['query'][_0xae13('0x40')]){_0x591f94['include']=[{'all':!![]}];}return db[_0xae13('0x30')][_0xae13('0x41')](_0x591f94);})[_0xae13('0x26')](function(_0x4a08eb){_0x100df1[_0xae13('0x42')]=_0x4a08eb;return _0x100df1;})[_0xae13('0x26')](respondWithFilteredResult(_0x133481,_0x591f94))[_0xae13('0x43')](handleError(_0x133481,null));};exports[_0xae13('0x44')]=function(_0x5553e9,_0x3ac42d){var _0x36a3c4={'raw':![],'where':{'id':_0x5553e9[_0xae13('0x45')]['id']}},_0x133f00={};_0x133f00[_0xae13('0x33')]=_[_0xae13('0x35')](db[_0xae13('0x30')][_0xae13('0x31')]);_0x133f00['query']=_[_0xae13('0x35')](_0x5553e9['query']);_0x133f00[_0xae13('0x36')]=_[_0xae13('0x37')](_0x133f00[_0xae13('0x33')],_0x133f00[_0xae13('0x34')]);_0x36a3c4['attributes']=_[_0xae13('0x37')](_0x133f00['model'],qs[_0xae13('0x46')](_0x5553e9[_0xae13('0x34')]['fields']));_0x36a3c4[_0xae13('0x38')]=_0x36a3c4[_0xae13('0x38')][_0xae13('0x47')]?_0x36a3c4[_0xae13('0x38')]:_0x133f00[_0xae13('0x33')];if(_0x5553e9[_0xae13('0x34')]['includeAll']){_0x36a3c4[_0xae13('0x48')]=[{'all':!![]}];}_0x36a3c4=_[_0xae13('0x49')]({},_0x36a3c4,_0x5553e9[_0xae13('0x3f')]);return db[_0xae13('0x30')][_0xae13('0x4a')](_0x36a3c4)['then'](handleEntityNotFound(_0x3ac42d,null))[_0xae13('0x26')](respondWithResult(_0x3ac42d,null))[_0xae13('0x43')](handleError(_0x3ac42d,null));};exports[_0xae13('0x4b')]=function(_0x551ed6,_0x5a9743){return db['SquareProject']['create'](_0x551ed6[_0xae13('0x4c')],{})['then'](function(_0x2db53a){var _0x5554a6=_0x551ed6[_0xae13('0x4d')][_0xae13('0x27')]({'plain':!![]});if(!_0x5554a6)throw new Error(_0xae13('0x4e'));if(_0x5554a6[_0xae13('0x4f')]===_0xae13('0x4d')){var _0x53d341=_0x2db53a[_0xae13('0x27')]({'plain':!![]});var _0x2560f1='SquareProjects';return db[_0xae13('0x50')][_0xae13('0x4a')]({'where':{'name':_0x2560f1,'userProfileId':_0x5554a6['userProfileId']},'raw':!![]})['then'](function(_0x5b2125){if(_0x5b2125&&_0x5b2125['autoAssociation']===0x0){return db[_0xae13('0x51')][_0xae13('0x4b')]({'name':_0x53d341['name'],'resourceId':_0x53d341['id'],'type':_0x5b2125[_0xae13('0x2c')],'sectionId':_0x5b2125['id']},{})[_0xae13('0x26')](function(){return _0x2db53a;});}else{return _0x2db53a;}})['catch'](function(_0x378f66){logger[_0xae13('0x2a')](_0xae13('0x52'),_0x378f66);throw _0x378f66;});}return _0x2db53a;})[_0xae13('0x26')](respondWithResult(_0x5a9743,0xc9))[_0xae13('0x43')](handleError(_0x5a9743,null));};exports[_0xae13('0x53')]=function(_0x2ac400,_0x3d86ad){if(_0x2ac400[_0xae13('0x4c')]['id']){delete _0x2ac400[_0xae13('0x4c')]['id'];}return db['SquareProject'][_0xae13('0x4a')]({'where':{'id':_0x2ac400[_0xae13('0x45')]['id']}})[_0xae13('0x26')](handleEntityNotFound(_0x3d86ad,null))['then'](saveUpdates(_0x2ac400[_0xae13('0x4c')],null))['then'](respondWithResult(_0x3d86ad,null))[_0xae13('0x43')](handleError(_0x3d86ad,null));};exports[_0xae13('0x29')]=function(_0xd76dc7,_0x5b61e0){return db['SquareProject'][_0xae13('0x4a')]({'where':{'id':_0xd76dc7[_0xae13('0x45')]['id']}})[_0xae13('0x26')](handleEntityNotFound(_0x5b61e0,null))[_0xae13('0x26')](removeEntity(_0x5b61e0,null))[_0xae13('0x43')](handleError(_0x5b61e0,null));};exports[_0xae13('0x54')]=function(_0x3b9840,_0x4995d9,_0x1a653e){return db[_0xae13('0x30')][_0xae13('0x4a')]({'where':{'id':_0x3b9840[_0xae13('0x45')]['id']}})[_0xae13('0x26')](handleEntityNotFound(_0x4995d9,null))[_0xae13('0x26')](function(_0x14f543){if(_0x14f543){return _0x14f543['addUsers'](_0x3b9840[_0xae13('0x4c')][_0xae13('0x55')],_['omit'](_0x3b9840[_0xae13('0x4c')],[_0xae13('0x55'),'id'])||{});}})[_0xae13('0x26')](respondWithResult(_0x4995d9,null))['catch'](handleError(_0x4995d9,null));};exports[_0xae13('0x56')]=function(_0x7fa6c5,_0x50166a,_0x3ee96f){return db[_0xae13('0x30')][_0xae13('0x4a')]({'where':{'id':_0x7fa6c5[_0xae13('0x45')]['id']}})[_0xae13('0x26')](handleEntityNotFound(_0x50166a,null))[_0xae13('0x26')](function(_0x5309a3){if(_0x5309a3){return _0x5309a3['removeUsers'](_0x7fa6c5[_0xae13('0x34')][_0xae13('0x55')])[_0xae13('0x26')](function(){if(_[_0xae13('0x57')](_0x7fa6c5[_0xae13('0x34')][_0xae13('0x55')])){for(var _0x47d84e=0x0;_0x47d84e<_0x7fa6c5[_0xae13('0x34')][_0xae13('0x55')]['length'];_0x47d84e+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x7fa6c5[_0xae13('0x34')][_0xae13('0x55')][_0x47d84e]),'SquareProjectId':Number(_0x7fa6c5[_0xae13('0x45')]['id'])});}}else{socket[_0xae13('0x58')](_0xae13('0x59'),{'UserId':Number(_0x7fa6c5[_0xae13('0x34')][_0xae13('0x55')]),'SquareProjectId':Number(_0x7fa6c5[_0xae13('0x45')]['id'])});}});}})[_0xae13('0x26')](respondWithStatusCode(_0x50166a,null))[_0xae13('0x43')](handleError(_0x50166a,null));};exports[_0xae13('0x5a')]=function(_0x28bb14,_0x177e9e,_0x276be5){var _0xc3ef7d={};var _0x4e623b={};var _0x1522c6;var _0x259f12;return db['SquareProject'][_0xae13('0x5b')]({'where':{'id':_0x28bb14['params']['id']}})['then'](handleEntityNotFound(_0x177e9e,null))[_0xae13('0x26')](function(_0x25cc60){if(_0x25cc60){_0x1522c6=_0x25cc60;_0x4e623b[_0xae13('0x33')]=_[_0xae13('0x35')](db[_0xae13('0x5c')][_0xae13('0x31')]);_0x4e623b['query']=_['keys'](_0x28bb14[_0xae13('0x34')]);_0x4e623b[_0xae13('0x36')]=_[_0xae13('0x37')](_0x4e623b['model'],_0x4e623b[_0xae13('0x34')]);_0xc3ef7d['attributes']=_[_0xae13('0x37')](_0x4e623b[_0xae13('0x33')],qs[_0xae13('0x46')](_0x28bb14[_0xae13('0x34')][_0xae13('0x46')]));_0xc3ef7d['attributes']=_0xc3ef7d[_0xae13('0x38')][_0xae13('0x47')]?_0xc3ef7d['attributes']:_0x4e623b[_0xae13('0x33')];_0xc3ef7d[_0xae13('0x5d')]=qs[_0xae13('0x3b')](_0x28bb14[_0xae13('0x34')][_0xae13('0x3b')]);_0xc3ef7d[_0xae13('0x3c')]=qs['filters'](_[_0xae13('0x5e')](_0x28bb14['query'],_0x4e623b[_0xae13('0x36')]));if(_0x28bb14['query'][_0xae13('0x3d')]){_0xc3ef7d[_0xae13('0x3c')]=_['merge'](_0xc3ef7d[_0xae13('0x3c')],{'$or':_[_0xae13('0x2f')](_0xc3ef7d[_0xae13('0x38')],function(_0xb00dd6){var _0x1f4eeb={};_0x1f4eeb[_0xb00dd6]={'$like':'%'+_0x28bb14[_0xae13('0x34')][_0xae13('0x3d')]+'%'};return _0x1f4eeb;})});}_0xc3ef7d=_[_0xae13('0x49')]({},_0xc3ef7d,_0x28bb14['options']);return _0x1522c6[_0xae13('0x5a')](_0xc3ef7d);}})[_0xae13('0x26')](function(_0x3a67f5){if(_0x3a67f5){_0x259f12=_0x3a67f5[_0xae13('0x47')];if(!_0x28bb14[_0xae13('0x34')][_0xae13('0x5f')](_0xae13('0x39'))){_0xc3ef7d[_0xae13('0x3a')]=qs[_0xae13('0x3a')](_0x28bb14[_0xae13('0x34')]['limit']);_0xc3ef7d[_0xae13('0x22')]=qs['offset'](_0x28bb14['query'][_0xae13('0x22')]);}return _0x1522c6[_0xae13('0x5a')](_0xc3ef7d);}})[_0xae13('0x26')](function(_0x4842ab){if(_0x4842ab){return _0x4842ab?{'count':_0x259f12,'rows':_0x4842ab}:null;}})[_0xae13('0x26')](respondWithResult(_0x177e9e,null))['catch'](handleError(_0x177e9e,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index df4f851..a55e575 100644 --- a/server/api/squareProject/squareProject.events.js +++ b/server/api/squareProject/squareProject.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4b8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject'];(function(_0x51d22e,_0x276640){var _0x275be3=function(_0x52d368){while(--_0x52d368){_0x51d22e['push'](_0x51d22e['shift']());}};_0x275be3(++_0x276640);}(_0xe4b8,0x179));var _0x8e4b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe4b8[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require(_0x8e4b('0x0'));var SquareProject=require(_0x8e4b('0x1'))['db'][_0x8e4b('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8e4b('0x3')](0x0);var events={'afterCreate':_0x8e4b('0x4'),'afterUpdate':_0x8e4b('0x5'),'afterDestroy':_0x8e4b('0x6')};function emitEvent(_0x5c096e){return function(_0x4fa340,_0x35e679,_0x246bc5){SquareProjectEvents[_0x8e4b('0x7')](_0x5c096e+':'+_0x4fa340['id'],_0x4fa340);SquareProjectEvents['emit'](_0x5c096e,_0x4fa340);_0x246bc5(null);};}for(var e in events){if(events[_0x8e4b('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x8e4b('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xaec9=['remove','emit','hasOwnProperty','hook','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x4be9e2,_0x3946f9){var _0x5d84d8=function(_0x205e9a){while(--_0x205e9a){_0x4be9e2['push'](_0x4be9e2['shift']());}};_0x5d84d8(++_0x3946f9);}(_0xaec9,0x112));var _0x9aec=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xaec9[_0x3a6efd];return _0x487b9a;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x9aec('0x0'))['db'][_0x9aec('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x9aec('0x2')](0x0);var events={'afterCreate':_0x9aec('0x3'),'afterUpdate':_0x9aec('0x4'),'afterDestroy':_0x9aec('0x5')};function emitEvent(_0x1ce6c7){return function(_0x183073,_0x2534de,_0x40acad){SquareProjectEvents[_0x9aec('0x6')](_0x1ce6c7+':'+_0x183073['id'],_0x183073);SquareProjectEvents[_0x9aec('0x6')](_0x1ce6c7,_0x183073);_0x40acad(null);};}for(var e in events){if(events[_0x9aec('0x7')](e)){var event=events[e];SquareProject[_0x9aec('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 5d951dc..ac0f90c 100644 --- a/server/api/squareProject/squareProject.model.js +++ b/server/api/squareProject/squareProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0618=['moment','bluebird','request-promise','path','rimraf','define','SquareProject','square_projects','../../config/logger','api'];(function(_0x4339f5,_0x3f2791){var _0x45765a=function(_0x5bbc84){while(--_0x5bbc84){_0x4339f5['push'](_0x4339f5['shift']());}};_0x45765a(++_0x3f2791);}(_0x0618,0x170));var _0x8061=function(_0x2757fc,_0xfbd23){_0x2757fc=_0x2757fc-0x0;var _0x58efc4=_0x0618[_0x2757fc];return _0x58efc4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8061('0x0'))(_0x8061('0x1'));var moment=require(_0x8061('0x2'));var BPromise=require(_0x8061('0x3'));var rp=require(_0x8061('0x4'));var fs=require('fs');var path=require(_0x8061('0x5'));var rimraf=require(_0x8061('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0xb1e984,_0x2de686){return _0xb1e984[_0x8061('0x7')](_0x8061('0x8'),attributes,{'tableName':_0x8061('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ef4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','lodash'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0ef4,0x176));var _0x40ef=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x0ef4[_0x1abeb2];return _0x48da20;};'use strict';var _=require(_0x40ef('0x0'));var util=require(_0x40ef('0x1'));var logger=require(_0x40ef('0x2'))(_0x40ef('0x3'));var moment=require(_0x40ef('0x4'));var BPromise=require(_0x40ef('0x5'));var rp=require(_0x40ef('0x6'));var fs=require('fs');var path=require(_0x40ef('0x7'));var rimraf=require(_0x40ef('0x8'));var config=require(_0x40ef('0x9'));var attributes=require(_0x40ef('0xa'));module[_0x40ef('0xb')]=function(_0x53312d,_0x2b1aad){return _0x53312d[_0x40ef('0xc')](_0x40ef('0xd'),attributes,{'tableName':_0x40ef('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index a199741..1e0da64 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc38b=['localhost','socket.io-emitter','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSquareProject','SquareProject','find','options','where','attributes','include','map','model','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x1954f4,_0x178037){var _0x3a7343=function(_0x2f247d){while(--_0x2f247d){_0x1954f4['push'](_0x1954f4['shift']());}};_0x3a7343(++_0x178037);}(_0xc38b,0x64));var _0xbc38=function(_0x404588,_0x210cb4){_0x404588=_0x404588-0x0;var _0x17346e=_0xc38b[_0x404588];return _0x17346e;};'use strict';var _=require('lodash');var util=require(_0xbc38('0x0'));var moment=require(_0xbc38('0x1'));var BPromise=require(_0xbc38('0x2'));var rs=require(_0xbc38('0x3'));var fs=require('fs');var Redis=require(_0xbc38('0x4'));var db=require(_0xbc38('0x5'))['db'];var utils=require(_0xbc38('0x6'));var logger=require(_0xbc38('0x7'))('rpc');var config=require(_0xbc38('0x8'));var jayson=require(_0xbc38('0x9'));var client=jayson[_0xbc38('0xa')][_0xbc38('0xb')]({'port':0x232a});config[_0xbc38('0xc')]=_[_0xbc38('0xd')](config[_0xbc38('0xc')],{'host':_0xbc38('0xe'),'port':0x18eb});var socket=require(_0xbc38('0xf'))(new Redis(config[_0xbc38('0xc')]));require('./squareProject.socket')[_0xbc38('0x10')](socket);function respondWithRpcPromise(_0x4dc71a,_0x212597,_0x15b2e4){return new BPromise(function(_0x3042a6,_0x5b6d50){return client[_0xbc38('0x11')](_0x4dc71a,_0x15b2e4)[_0xbc38('0x12')](function(_0x291bbb){logger['info'](_0xbc38('0x13'),_0x212597,_0xbc38('0x14'));logger[_0xbc38('0x15')](_0xbc38('0x16'),_0x212597,_0xbc38('0x14'),JSON[_0xbc38('0x17')](_0x291bbb));if(_0x291bbb[_0xbc38('0x18')]){if(_0x291bbb[_0xbc38('0x18')]['code']===0x1f4){logger[_0xbc38('0x18')]('SquareProject,\x20%s,\x20%s',_0x212597,_0x291bbb['error'][_0xbc38('0x19')]);return _0x5b6d50(_0x291bbb[_0xbc38('0x18')][_0xbc38('0x19')]);}logger[_0xbc38('0x18')](_0xbc38('0x13'),_0x212597,_0x291bbb[_0xbc38('0x18')][_0xbc38('0x19')]);return _0x3042a6(_0x291bbb[_0xbc38('0x18')]['message']);}else{logger['info'](_0xbc38('0x13'),_0x212597,'request\x20sent');_0x3042a6(_0x291bbb[_0xbc38('0x1a')][_0xbc38('0x19')]);}})[_0xbc38('0x1b')](function(_0x5f56fa){logger['error'](_0xbc38('0x13'),_0x212597,_0x5f56fa);_0x5b6d50(_0x5f56fa);});});}exports[_0xbc38('0x1c')]=function(_0x3c5046){var _0x200453=this;return new Promise(function(_0x27d171,_0x45c7ca){return db[_0xbc38('0x1d')][_0xbc38('0x1e')]({'raw':_0x3c5046['options']?_0x3c5046[_0xbc38('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3c5046[_0xbc38('0x1f')]?_0x3c5046[_0xbc38('0x1f')][_0xbc38('0x20')]||null:null,'attributes':_0x3c5046[_0xbc38('0x1f')]?_0x3c5046[_0xbc38('0x1f')][_0xbc38('0x21')]||null:null,'include':_0x3c5046[_0xbc38('0x1f')]?_0x3c5046[_0xbc38('0x1f')][_0xbc38('0x22')]?_[_0xbc38('0x23')](_0x3c5046['options']['include'],function(_0x19d40b){return{'model':db[_0x19d40b[_0xbc38('0x24')]],'as':_0x19d40b['as'],'attributes':_0x19d40b[_0xbc38('0x21')],'include':_0x19d40b[_0xbc38('0x22')]?_[_0xbc38('0x23')](_0x19d40b['include'],function(_0x338ba1){return{'model':db[_0x338ba1[_0xbc38('0x24')]],'as':_0x338ba1['as'],'attributes':_0x338ba1['attributes'],'include':_0x338ba1[_0xbc38('0x22')]?_[_0xbc38('0x23')](_0x338ba1['include'],function(_0x298c13){return{'model':db[_0x298c13[_0xbc38('0x24')]],'as':_0x298c13['as'],'attributes':_0x298c13[_0xbc38('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbc38('0x12')](function(_0x424812){logger[_0xbc38('0x25')](_0xbc38('0x1c'),_0x3c5046);logger[_0xbc38('0x15')](_0xbc38('0x1c'),_0x3c5046,JSON[_0xbc38('0x17')](_0x424812));_0x27d171(_0x424812);})[_0xbc38('0x1b')](function(_0xde09d5){logger['error'](_0xbc38('0x1c'),_0xde09d5[_0xbc38('0x19')],_0x3c5046);_0x45c7ca(_0x200453[_0xbc38('0x18')](0x1f4,_0xde09d5['message']));});});}; \ No newline at end of file +var _0xd201=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','request','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','options','raw','attributes','include','model','map','then','info','debug','lodash','util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd201,0x1ae));var _0x1d20=function(_0x537044,_0x4de18f){_0x537044=_0x537044-0x0;var _0x5ba75e=_0xd201[_0x537044];return _0x5ba75e;};'use strict';var _=require(_0x1d20('0x0'));var util=require(_0x1d20('0x1'));var moment=require(_0x1d20('0x2'));var BPromise=require(_0x1d20('0x3'));var rs=require(_0x1d20('0x4'));var fs=require('fs');var Redis=require(_0x1d20('0x5'));var db=require(_0x1d20('0x6'))['db'];var utils=require(_0x1d20('0x7'));var logger=require(_0x1d20('0x8'))('rpc');var config=require(_0x1d20('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1d20('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1d20('0xb')](config[_0x1d20('0xc')],{'host':_0x1d20('0xd'),'port':0x18eb});var socket=require(_0x1d20('0xe'))(new Redis(config[_0x1d20('0xc')]));require('./squareProject.socket')[_0x1d20('0xf')](socket);function respondWithRpcPromise(_0x46defe,_0x3f75b2,_0x151ca6){return new BPromise(function(_0x1b20bf,_0x1078b6){return client[_0x1d20('0x10')](_0x46defe,_0x151ca6)['then'](function(_0x4f886c){logger['info'](_0x1d20('0x11'),_0x3f75b2,_0x1d20('0x12'));logger['debug'](_0x1d20('0x13'),_0x3f75b2,_0x1d20('0x12'),JSON[_0x1d20('0x14')](_0x4f886c));if(_0x4f886c[_0x1d20('0x15')]){if(_0x4f886c[_0x1d20('0x15')][_0x1d20('0x16')]===0x1f4){logger[_0x1d20('0x15')](_0x1d20('0x11'),_0x3f75b2,_0x4f886c[_0x1d20('0x15')][_0x1d20('0x17')]);return _0x1078b6(_0x4f886c[_0x1d20('0x15')][_0x1d20('0x17')]);}logger['error'](_0x1d20('0x11'),_0x3f75b2,_0x4f886c[_0x1d20('0x15')][_0x1d20('0x17')]);return _0x1b20bf(_0x4f886c[_0x1d20('0x15')][_0x1d20('0x17')]);}else{logger['info'](_0x1d20('0x11'),_0x3f75b2,_0x1d20('0x12'));_0x1b20bf(_0x4f886c[_0x1d20('0x18')][_0x1d20('0x17')]);}})[_0x1d20('0x19')](function(_0x4e1d34){logger[_0x1d20('0x15')](_0x1d20('0x11'),_0x3f75b2,_0x4e1d34);_0x1078b6(_0x4e1d34);});});}exports[_0x1d20('0x1a')]=function(_0x4ce9aa){var _0x90b101=this;return new Promise(function(_0x2a45d0,_0x1e8fef){return db['SquareProject']['find']({'raw':_0x4ce9aa[_0x1d20('0x1b')]?_0x4ce9aa['options'][_0x1d20('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ce9aa[_0x1d20('0x1b')]?_0x4ce9aa['options']['where']||null:null,'attributes':_0x4ce9aa['options']?_0x4ce9aa['options'][_0x1d20('0x1d')]||null:null,'include':_0x4ce9aa[_0x1d20('0x1b')]?_0x4ce9aa[_0x1d20('0x1b')][_0x1d20('0x1e')]?_['map'](_0x4ce9aa['options'][_0x1d20('0x1e')],function(_0x2a0db5){return{'model':db[_0x2a0db5[_0x1d20('0x1f')]],'as':_0x2a0db5['as'],'attributes':_0x2a0db5[_0x1d20('0x1d')],'include':_0x2a0db5[_0x1d20('0x1e')]?_[_0x1d20('0x20')](_0x2a0db5[_0x1d20('0x1e')],function(_0x5d26df){return{'model':db[_0x5d26df[_0x1d20('0x1f')]],'as':_0x5d26df['as'],'attributes':_0x5d26df[_0x1d20('0x1d')],'include':_0x5d26df[_0x1d20('0x1e')]?_[_0x1d20('0x20')](_0x5d26df[_0x1d20('0x1e')],function(_0x4a2105){return{'model':db[_0x4a2105[_0x1d20('0x1f')]],'as':_0x4a2105['as'],'attributes':_0x4a2105['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d20('0x21')](function(_0x4aaf83){logger[_0x1d20('0x22')]('ShowSquareProject',_0x4ce9aa);logger[_0x1d20('0x23')](_0x1d20('0x1a'),_0x4ce9aa,JSON[_0x1d20('0x14')](_0x4aaf83));_0x2a45d0(_0x4aaf83);})[_0x1d20('0x19')](function(_0x2a871e){logger[_0x1d20('0x15')](_0x1d20('0x1a'),_0x2a871e[_0x1d20('0x17')],_0x4ce9aa);_0x1e8fef(_0x90b101[_0x1d20('0x15')](0x1f4,_0x2a871e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index e6c175c..9f5825b 100644 --- a/server/api/squareProject/squareProject.socket.js +++ b/server/api/squareProject/squareProject.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['removeListener','register','length','./squareProject.events','save','remove','update','emit'];(function(_0x437a62,_0x4f9c0d){var _0x114e28=function(_0x37b981){while(--_0x37b981){_0x437a62['push'](_0x437a62['shift']());}};_0x114e28(++_0x4f9c0d);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x30107b,_0x473e70){_0x30107b=_0x30107b-0x0;var _0x35e036=_0xc6ac[_0x30107b];return _0x35e036;};'use strict';var SquareProjectEvents=require(_0xcc6a('0x0'));var events=[_0xcc6a('0x1'),_0xcc6a('0x2'),_0xcc6a('0x3')];function createListener(_0x276972,_0x279d85){return function(_0x17d786){_0x279d85[_0xcc6a('0x4')](_0x276972,_0x17d786);};}function removeListener(_0x297643,_0x22ee99){return function(){SquareProjectEvents[_0xcc6a('0x5')](_0x297643,_0x22ee99);};}exports[_0xcc6a('0x6')]=function(_0x12330e){for(var _0x197bd7=0x0,_0x5f3887=events[_0xcc6a('0x7')];_0x197bd7<_0x5f3887;_0x197bd7++){var _0x11b919=events[_0x197bd7];var _0xf02261=createListener('squareProject:'+_0x11b919,_0x12330e);SquareProjectEvents['on'](_0x11b919,_0xf02261);}}; \ No newline at end of file +var _0xd8fb=['./squareProject.events','save','remove','update','emit','removeListener','register','length','squareProject:'];(function(_0x29acf1,_0x3b336a){var _0x28ebfe=function(_0x4c16bd){while(--_0x4c16bd){_0x29acf1['push'](_0x29acf1['shift']());}};_0x28ebfe(++_0x3b336a);}(_0xd8fb,0x99));var _0xbd8f=function(_0x39ebc2,_0x2d7f13){_0x39ebc2=_0x39ebc2-0x0;var _0x16a48c=_0xd8fb[_0x39ebc2];return _0x16a48c;};'use strict';var SquareProjectEvents=require(_0xbd8f('0x0'));var events=[_0xbd8f('0x1'),_0xbd8f('0x2'),_0xbd8f('0x3')];function createListener(_0x52724c,_0x5ea933){return function(_0x4e9545){_0x5ea933[_0xbd8f('0x4')](_0x52724c,_0x4e9545);};}function removeListener(_0x43d177,_0x53cccc){return function(){SquareProjectEvents[_0xbd8f('0x5')](_0x43d177,_0x53cccc);};}exports[_0xbd8f('0x6')]=function(_0x5543b2){for(var _0x33d541=0x0,_0x4e97cf=events[_0xbd8f('0x7')];_0x33d541<_0x4e97cf;_0x33d541++){var _0x578499=events[_0x33d541];var _0x197827=createListener(_0xbd8f('0x8')+_0x578499,_0x5543b2);SquareProjectEvents['on'](_0x578499,_0x197827);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 33db49f..1d2f66a 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x14474a,_0x5be492){var _0x1f8b71=function(_0x4a7acd){while(--_0x4a7acd){_0x14474a['push'](_0x14474a['shift']());}};_0x1f8b71(++_0x5be492);}(_0xb10b,0x12a));var _0xbb10=function(_0x345c86,_0x2b12e0){_0x345c86=_0x345c86-0x0;var _0x41e895=_0xb10b[_0x345c86];return _0x41e895;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0x5f66=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','isAuthenticated','index','show','get','/:id/download','download','create','put','/:id'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/:id',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xf'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 8ed8206..04946e5 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6e7=['exports','STRING'];(function(_0x323aac,_0xb6b941){var _0x54368a=function(_0x976c74){while(--_0x976c74){_0x323aac['push'](_0x323aac['shift']());}};_0x54368a(++_0xb6b941);}(_0xc6e7,0xbe));var _0x7c6e=function(_0x52ea36,_0x2a2535){_0x52ea36=_0x52ea36-0x0;var _0x1b05f0=_0xc6e7[_0x52ea36];return _0x1b05f0;};'use strict';var Sequelize=require('sequelize');module[_0x7c6e('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7c6e('0x1')]},'calleridname':{'type':Sequelize[_0x7c6e('0x1')]},'context':{'type':Sequelize[_0x7c6e('0x1')]},'extension':{'type':Sequelize[_0x7c6e('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x7c6e('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x7c6e('0x1')]},'savePath':{'type':Sequelize[_0x7c6e('0x1')]}}; \ No newline at end of file +var _0xf744=['STRING','sequelize','exports'];(function(_0x1272d9,_0x10dd76){var _0x5c26d8=function(_0x6320bc){while(--_0x6320bc){_0x1272d9['push'](_0x1272d9['shift']());}};_0x5c26d8(++_0x10dd76);}(_0xf744,0xf1));var _0x4f74=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xf744[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0x4f74('0x0'));module[_0x4f74('0x1')]={'uniqueid':{'type':Sequelize[_0x4f74('0x2')]},'callerid':{'type':Sequelize[_0x4f74('0x2')]},'calleridname':{'type':Sequelize[_0x4f74('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4f74('0x2')]},'accountcode':{'type':Sequelize[_0x4f74('0x2')]},'dnid':{'type':Sequelize[_0x4f74('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x4f74('0x2')]},'filename':{'type':Sequelize[_0x4f74('0x2')]},'savePath':{'type':Sequelize[_0x4f74('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index f7d9928..7d9a08a 100644 --- a/server/api/squareRecording/squareRecording.controller.js +++ b/server/api/squareRecording/squareRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58d6=['uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','send','Not\x20found','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','index','map','SquareRecording','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','../../components/encryptor'];(function(_0x22ac70,_0x51fba1){var _0x5b4f67=function(_0x33697d){while(--_0x33697d){_0x22ac70['push'](_0x22ac70['shift']());}};_0x5b4f67(++_0x51fba1);}(_0x58d6,0x1d3));var _0x658d=function(_0x4a6953,_0x226a21){_0x4a6953=_0x4a6953-0x0;var _0x4c1f52=_0x58d6[_0x4a6953];return _0x4c1f52;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x658d('0x0'));var rimraf=require(_0x658d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x658d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x658d('0x3'));var Mustache=require(_0x658d('0x4'));var util=require(_0x658d('0x5'));var path=require(_0x658d('0x6'));var sox=require('sox');var csv=require(_0x658d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x658d('0x8'));var squel=require(_0x658d('0x9'));var crypto=require(_0x658d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x658d('0xb'));var toCsv=require(_0x658d('0x7'));var querystring=require(_0x658d('0xc'));var Papa=require('papaparse');var Redis=require(_0x658d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x658d('0xe'));var as=require(_0x658d('0xf'));var hardwareService=require(_0x658d('0x10'));var logger=require('../../config/logger')(_0x658d('0x11'));var utils=require(_0x658d('0x12'));var config=require(_0x658d('0x13'));var db=require(_0x658d('0x14'))['db'];function respondWithStatusCode(_0xbfd392,_0x2a266b){_0x2a266b=_0x2a266b||0xcc;return function(_0x9efc8c){if(_0x9efc8c){return _0xbfd392['sendStatus'](_0x2a266b);}return _0xbfd392[_0x658d('0x15')](_0x2a266b)[_0x658d('0x16')]();};}function respondWithResult(_0x3c7c6d,_0x47360e){_0x47360e=_0x47360e||0xc8;return function(_0x43de3d){if(_0x43de3d){return _0x3c7c6d[_0x658d('0x15')](_0x47360e)[_0x658d('0x17')](_0x43de3d);}};}function respondWithFilteredResult(_0x1dbdf9,_0x303606){return function(_0x17b20f){if(_0x17b20f){var _0x284431=_0x17b20f[_0x658d('0x18')],_0x42aae9=_0x303606[_0x658d('0x19')],_0x2d8968=_0x303606[_0x658d('0x19')]+_0x303606[_0x658d('0x1a')],_0x5c21aa;if(_0x2d8968>=_0x284431){_0x2d8968=_0x284431;_0x5c21aa=0xc8;}else{_0x5c21aa=0xce;}_0x1dbdf9[_0x658d('0x15')](_0x5c21aa);return _0x1dbdf9[_0x658d('0x1b')](_0x658d('0x1c'),_0x42aae9+'-'+_0x2d8968+'/'+_0x284431)[_0x658d('0x17')](_0x17b20f);}return null;};}function patchUpdates(_0x331750){return function(_0x50b4c3){try{jsonpatch['apply'](_0x50b4c3,_0x331750,!![]);}catch(_0x247ff7){return BPromise[_0x658d('0x1d')](_0x247ff7);}return _0x50b4c3[_0x658d('0x1e')]();};}function saveUpdates(_0x13442f,_0x2f1335){return function(_0x1c0271){if(_0x1c0271){return _0x1c0271[_0x658d('0x1f')](_0x13442f)[_0x658d('0x20')](function(_0x3b4a1f){return _0x3b4a1f;});}return null;};}function removeEntity(_0x558869,_0x559e74){return function(_0x408996){if(_0x408996){return _0x408996[_0x658d('0x21')]()['then'](function(){_0x558869[_0x658d('0x15')](0xcc)[_0x658d('0x16')]();});}};}function handleEntityNotFound(_0x3e95f5,_0x56dd20){return function(_0x4f9418){if(!_0x4f9418){_0x3e95f5[_0x658d('0x22')](0x194);}return _0x4f9418;};}function handleError(_0x2d13f6,_0x556ce9){_0x556ce9=_0x556ce9||0x1f4;return function(_0x43b7c2){logger[_0x658d('0x23')](_0x43b7c2['stack']);if(_0x43b7c2[_0x658d('0x24')]){delete _0x43b7c2[_0x658d('0x24')];}_0x2d13f6[_0x658d('0x15')](_0x556ce9)['send'](_0x43b7c2);};}exports[_0x658d('0x25')]=function(_0x12107d,_0x12fce9){var _0x18a265={},_0xb2f751={},_0x160d77={'count':0x0,'rows':[]};var _0x1924aa=_[_0x658d('0x26')](db[_0x658d('0x27')][_0x658d('0x28')],function(_0x38cd62){return{'name':_0x38cd62[_0x658d('0x29')],'type':_0x38cd62['type'][_0x658d('0x2a')]};});_0xb2f751[_0x658d('0x2b')]=_['map'](_0x1924aa,_0x658d('0x24'));_0xb2f751[_0x658d('0x2c')]=_[_0x658d('0x2d')](_0x12107d[_0x658d('0x2c')]);_0xb2f751[_0x658d('0x2e')]=_[_0x658d('0x2f')](_0xb2f751[_0x658d('0x2b')],_0xb2f751[_0x658d('0x2c')]);_0x18a265[_0x658d('0x30')]=_['intersection'](_0xb2f751[_0x658d('0x2b')],qs['fields'](_0x12107d[_0x658d('0x2c')][_0x658d('0x31')]));_0x18a265[_0x658d('0x30')]=_0x18a265[_0x658d('0x30')][_0x658d('0x32')]?_0x18a265[_0x658d('0x30')]:_0xb2f751[_0x658d('0x2b')];if(!_0x12107d[_0x658d('0x2c')][_0x658d('0x33')](_0x658d('0x34'))){_0x18a265[_0x658d('0x1a')]=qs[_0x658d('0x1a')](_0x12107d[_0x658d('0x2c')][_0x658d('0x1a')]);_0x18a265[_0x658d('0x19')]=qs[_0x658d('0x19')](_0x12107d['query']['offset']);}_0x18a265[_0x658d('0x35')]=qs['sort'](_0x12107d[_0x658d('0x2c')][_0x658d('0x36')]);_0x18a265[_0x658d('0x37')]=qs[_0x658d('0x2e')](_[_0x658d('0x38')](_0x12107d[_0x658d('0x2c')],_0xb2f751[_0x658d('0x2e')]));if(_0x12107d[_0x658d('0x2c')][_0x658d('0x39')]){_0x18a265['where']=_['merge'](_0x18a265[_0x658d('0x37')],{'$or':_[_0x658d('0x26')](_0x1924aa,function(_0x26407b){if(_0x26407b[_0x658d('0x3a')]!==_0x658d('0x3b')){var _0x13ad5e={};_0x13ad5e[_0x26407b[_0x658d('0x24')]]={'$like':'%'+_0x12107d[_0x658d('0x2c')][_0x658d('0x39')]+'%'};return _0x13ad5e;}})});}_0x18a265=_[_0x658d('0x3c')]({},_0x18a265,_0x12107d[_0x658d('0x3d')]);var _0x4df37a={'where':_0x18a265[_0x658d('0x37')]};return db[_0x658d('0x27')][_0x658d('0x18')](_0x4df37a)[_0x658d('0x20')](function(_0x1956cc){_0x160d77[_0x658d('0x18')]=_0x1956cc;if(_0x12107d[_0x658d('0x2c')][_0x658d('0x3e')]){_0x18a265[_0x658d('0x3f')]=[{'all':!![]}];}return db['SquareRecording'][_0x658d('0x40')](_0x18a265);})[_0x658d('0x20')](function(_0x1ce3f4){_0x160d77[_0x658d('0x41')]=_0x1ce3f4;return _0x160d77;})[_0x658d('0x20')](respondWithFilteredResult(_0x12fce9,_0x18a265))[_0x658d('0x42')](handleError(_0x12fce9,null));};exports[_0x658d('0x43')]=function(_0x4c1682,_0x11ca03){var _0xdd974f={'raw':!![],'where':{'id':_0x4c1682[_0x658d('0x44')]['id']}},_0x285283={};_0x285283[_0x658d('0x2b')]=_['keys'](db[_0x658d('0x27')]['rawAttributes']);_0x285283['query']=_[_0x658d('0x2d')](_0x4c1682[_0x658d('0x2c')]);_0x285283[_0x658d('0x2e')]=_['intersection'](_0x285283[_0x658d('0x2b')],_0x285283['query']);_0xdd974f[_0x658d('0x30')]=_[_0x658d('0x2f')](_0x285283[_0x658d('0x2b')],qs['fields'](_0x4c1682[_0x658d('0x2c')]['fields']));_0xdd974f[_0x658d('0x30')]=_0xdd974f[_0x658d('0x30')][_0x658d('0x32')]?_0xdd974f[_0x658d('0x30')]:_0x285283['model'];if(_0x4c1682[_0x658d('0x2c')]['includeAll']){_0xdd974f[_0x658d('0x3f')]=[{'all':!![]}];}_0xdd974f=_[_0x658d('0x3c')]({},_0xdd974f,_0x4c1682['options']);return db['SquareRecording'][_0x658d('0x45')](_0xdd974f)[_0x658d('0x20')](handleEntityNotFound(_0x11ca03,null))['then'](respondWithResult(_0x11ca03,null))[_0x658d('0x42')](handleError(_0x11ca03,null));};exports[_0x658d('0x46')]=function(_0x2b8dd8,_0x2ab35c){return db['SquareRecording']['create'](_0x2b8dd8[_0x658d('0x47')],{})[_0x658d('0x20')](respondWithResult(_0x2ab35c,0xc9))[_0x658d('0x42')](handleError(_0x2ab35c,null));};exports[_0x658d('0x1f')]=function(_0x39ae6a,_0xf0067){if(_0x39ae6a['body']['id']){delete _0x39ae6a['body']['id'];}return db[_0x658d('0x27')][_0x658d('0x45')]({'where':{'id':_0x39ae6a['params']['id']}})[_0x658d('0x20')](handleEntityNotFound(_0xf0067,null))[_0x658d('0x20')](saveUpdates(_0x39ae6a[_0x658d('0x47')],null))[_0x658d('0x20')](respondWithResult(_0xf0067,null))['catch'](handleError(_0xf0067,null));};exports['destroy']=function(_0xa188d1,_0x279443){return db[_0x658d('0x27')][_0x658d('0x45')]({'where':{'id':_0xa188d1[_0x658d('0x44')]['id']}})[_0x658d('0x20')](handleEntityNotFound(_0x279443,null))[_0x658d('0x20')](removeEntity(_0x279443,null))[_0x658d('0x42')](handleError(_0x279443,null));};exports['download']=function(_0x1b30b8,_0x510c44,_0xc9dd71){var _0x28b998=require(_0x658d('0x48'));var _0x1237c8=![];var _0x24cf3f={};if(_0x1b30b8[_0x658d('0x2c')][_0x658d('0x3a')]&&_0x1b30b8[_0x658d('0x2c')][_0x658d('0x3a')]===_0x658d('0x49')){_0x24cf3f[_0x658d('0x49')]=_0x1b30b8['params']['id'];}else{_0x24cf3f['id']=_0x1b30b8['params']['id'];}return db[_0x658d('0x27')][_0x658d('0x45')]({'where':_0x24cf3f,'attributes':['id','savePath',_0x658d('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x510c44,null))['then'](function(_0x2ad993){if(_0x2ad993){var _0x63457d=_0x2ad993[_0x658d('0x4b')];var _0x42e31a=util[_0x658d('0x4c')](_0x658d('0x4d'),_0x63457d);if(fs[_0x658d('0x4e')](_0x42e31a)){_0x1237c8=!![];return _0x28b998[_0x658d('0x4f')](_0x42e31a,_0x63457d,config[_0x658d('0x50')][_0x658d('0x51')])[_0x658d('0x20')](function(){return _0x2ad993;});}return _0x2ad993;}})[_0x658d('0x20')](function(_0x26d7e8){if(_0x26d7e8){var _0x13f55f=_0x26d7e8[_0x658d('0x4b')];if(!fs[_0x658d('0x4e')](_0x13f55f)){throw new db[(_0x658d('0x52'))][(_0x658d('0x53'))](_0x658d('0x54'));}if(_0x26d7e8[_0x658d('0x4a')]){return _0x510c44[_0x658d('0x55')](_0x13f55f,_0x26d7e8[_0x658d('0x4a')]+path[_0x658d('0x56')](_0x13f55f),function(){if(_0x1237c8){fs[_0x658d('0x57')](_0x13f55f);}});}else{return _0x510c44[_0x658d('0x55')](_0x13f55f,function(_0x47fd9c){if(_0x1237c8){fs['unlink'](_0x13f55f);}});}}})[_0x658d('0x42')](function(_0x30d8b9){if(_0x30d8b9['message']===_0x658d('0x54')){_0x510c44['status'](0x194)[_0x658d('0x58')](_0x658d('0x59'));}else{return handleError(_0x510c44,null);}});}; \ No newline at end of file +var _0x9ffd=['bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','SquareRecording','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','create','body','params','destroy','download','../../components/encryptor','uniqueid','savePath','format','existsSync','secrets','recording','ValidationError','SquareRecording\x20not\x20found','filename','unlink','message','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x2a5428,_0x15f53a){var _0x20500b=function(_0x527b30){while(--_0x527b30){_0x2a5428['push'](_0x2a5428['shift']());}};_0x20500b(++_0x15f53a);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x239fde,_0x25b3af){_0x239fde=_0x239fde-0x0;var _0x201965=_0x9ffd[_0x239fde];return _0x201965;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x11'));var hardwareService=require(_0xd9ff('0x12'));var logger=require(_0xd9ff('0x13'))(_0xd9ff('0x14'));var utils=require(_0xd9ff('0x15'));var config=require(_0xd9ff('0x16'));var db=require(_0xd9ff('0x17'))['db'];function respondWithStatusCode(_0x1c2a16,_0x47d842){_0x47d842=_0x47d842||0xcc;return function(_0x47b0d7){if(_0x47b0d7){return _0x1c2a16[_0xd9ff('0x18')](_0x47d842);}return _0x1c2a16[_0xd9ff('0x19')](_0x47d842)[_0xd9ff('0x1a')]();};}function respondWithResult(_0x350a5d,_0x12c39a){_0x12c39a=_0x12c39a||0xc8;return function(_0x556aa4){if(_0x556aa4){return _0x350a5d[_0xd9ff('0x19')](_0x12c39a)[_0xd9ff('0x1b')](_0x556aa4);}};}function respondWithFilteredResult(_0x5c1a28,_0xf14c9f){return function(_0x5db010){if(_0x5db010){var _0x4ffe54=_0x5db010['count'],_0x547e28=_0xf14c9f[_0xd9ff('0x1c')],_0x4c5718=_0xf14c9f[_0xd9ff('0x1c')]+_0xf14c9f[_0xd9ff('0x1d')],_0x271287;if(_0x4c5718>=_0x4ffe54){_0x4c5718=_0x4ffe54;_0x271287=0xc8;}else{_0x271287=0xce;}_0x5c1a28[_0xd9ff('0x19')](_0x271287);return _0x5c1a28[_0xd9ff('0x1e')](_0xd9ff('0x1f'),_0x547e28+'-'+_0x4c5718+'/'+_0x4ffe54)[_0xd9ff('0x1b')](_0x5db010);}return null;};}function patchUpdates(_0x128588){return function(_0x182775){try{jsonpatch[_0xd9ff('0x20')](_0x182775,_0x128588,!![]);}catch(_0x3ea97d){return BPromise[_0xd9ff('0x21')](_0x3ea97d);}return _0x182775[_0xd9ff('0x22')]();};}function saveUpdates(_0x4c8740,_0x4cf8ec){return function(_0x264a3d){if(_0x264a3d){return _0x264a3d[_0xd9ff('0x23')](_0x4c8740)['then'](function(_0x588151){return _0x588151;});}return null;};}function removeEntity(_0x5ab7b6,_0x4b1477){return function(_0x1f4d9e){if(_0x1f4d9e){return _0x1f4d9e['destroy']()[_0xd9ff('0x24')](function(){_0x5ab7b6[_0xd9ff('0x19')](0xcc)[_0xd9ff('0x1a')]();});}};}function handleEntityNotFound(_0x9f074e,_0x278b66){return function(_0x42a828){if(!_0x42a828){_0x9f074e['sendStatus'](0x194);}return _0x42a828;};}function handleError(_0x4fada1,_0x1136e9){_0x1136e9=_0x1136e9||0x1f4;return function(_0x599fec){logger[_0xd9ff('0x25')](_0x599fec['stack']);if(_0x599fec[_0xd9ff('0x26')]){delete _0x599fec['name'];}_0x4fada1[_0xd9ff('0x19')](_0x1136e9)[_0xd9ff('0x27')](_0x599fec);};}exports[_0xd9ff('0x28')]=function(_0x2970e8,_0x5d685e){var _0x11a17b={},_0xe11f88={},_0x1c78c4={'count':0x0,'rows':[]};var _0x4390f7=_['map'](db[_0xd9ff('0x29')][_0xd9ff('0x2a')],function(_0x44b5a7){return{'name':_0x44b5a7[_0xd9ff('0x2b')],'type':_0x44b5a7[_0xd9ff('0x2c')][_0xd9ff('0x2d')]};});_0xe11f88[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x4390f7,_0xd9ff('0x26'));_0xe11f88['query']=_[_0xd9ff('0x30')](_0x2970e8['query']);_0xe11f88[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0xe11f88[_0xd9ff('0x2e')],_0xe11f88['query']);_0x11a17b[_0xd9ff('0x33')]=_[_0xd9ff('0x32')](_0xe11f88[_0xd9ff('0x2e')],qs[_0xd9ff('0x34')](_0x2970e8['query'][_0xd9ff('0x34')]));_0x11a17b['attributes']=_0x11a17b[_0xd9ff('0x33')][_0xd9ff('0x35')]?_0x11a17b[_0xd9ff('0x33')]:_0xe11f88[_0xd9ff('0x2e')];if(!_0x2970e8[_0xd9ff('0x36')][_0xd9ff('0x37')](_0xd9ff('0x38'))){_0x11a17b[_0xd9ff('0x1d')]=qs[_0xd9ff('0x1d')](_0x2970e8[_0xd9ff('0x36')][_0xd9ff('0x1d')]);_0x11a17b[_0xd9ff('0x1c')]=qs[_0xd9ff('0x1c')](_0x2970e8[_0xd9ff('0x36')]['offset']);}_0x11a17b[_0xd9ff('0x39')]=qs[_0xd9ff('0x3a')](_0x2970e8[_0xd9ff('0x36')]['sort']);_0x11a17b[_0xd9ff('0x3b')]=qs['filters'](_[_0xd9ff('0x3c')](_0x2970e8['query'],_0xe11f88[_0xd9ff('0x31')]));if(_0x2970e8['query'][_0xd9ff('0x3d')]){_0x11a17b[_0xd9ff('0x3b')]=_[_0xd9ff('0x3e')](_0x11a17b['where'],{'$or':_['map'](_0x4390f7,function(_0x5dad16){if(_0x5dad16[_0xd9ff('0x2c')]!==_0xd9ff('0x3f')){var _0x405c3b={};_0x405c3b[_0x5dad16[_0xd9ff('0x26')]]={'$like':'%'+_0x2970e8[_0xd9ff('0x36')][_0xd9ff('0x3d')]+'%'};return _0x405c3b;}})});}_0x11a17b=_['merge']({},_0x11a17b,_0x2970e8['options']);var _0x4a9804={'where':_0x11a17b[_0xd9ff('0x3b')]};return db[_0xd9ff('0x29')][_0xd9ff('0x40')](_0x4a9804)[_0xd9ff('0x24')](function(_0x56b94d){_0x1c78c4[_0xd9ff('0x40')]=_0x56b94d;if(_0x2970e8['query'][_0xd9ff('0x41')]){_0x11a17b[_0xd9ff('0x42')]=[{'all':!![]}];}return db[_0xd9ff('0x29')][_0xd9ff('0x43')](_0x11a17b);})['then'](function(_0x1e34da){_0x1c78c4[_0xd9ff('0x44')]=_0x1e34da;return _0x1c78c4;})['then'](respondWithFilteredResult(_0x5d685e,_0x11a17b))[_0xd9ff('0x45')](handleError(_0x5d685e,null));};exports[_0xd9ff('0x46')]=function(_0x94dcd8,_0x3ba5ff){var _0x1fe44d={'raw':!![],'where':{'id':_0x94dcd8['params']['id']}},_0x1cc848={};_0x1cc848[_0xd9ff('0x2e')]=_[_0xd9ff('0x30')](db[_0xd9ff('0x29')][_0xd9ff('0x2a')]);_0x1cc848[_0xd9ff('0x36')]=_['keys'](_0x94dcd8[_0xd9ff('0x36')]);_0x1cc848[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0x1cc848['model'],_0x1cc848['query']);_0x1fe44d[_0xd9ff('0x33')]=_[_0xd9ff('0x32')](_0x1cc848[_0xd9ff('0x2e')],qs[_0xd9ff('0x34')](_0x94dcd8[_0xd9ff('0x36')][_0xd9ff('0x34')]));_0x1fe44d['attributes']=_0x1fe44d[_0xd9ff('0x33')][_0xd9ff('0x35')]?_0x1fe44d['attributes']:_0x1cc848[_0xd9ff('0x2e')];if(_0x94dcd8[_0xd9ff('0x36')][_0xd9ff('0x41')]){_0x1fe44d[_0xd9ff('0x42')]=[{'all':!![]}];}_0x1fe44d=_[_0xd9ff('0x3e')]({},_0x1fe44d,_0x94dcd8['options']);return db['SquareRecording']['find'](_0x1fe44d)[_0xd9ff('0x24')](handleEntityNotFound(_0x3ba5ff,null))['then'](respondWithResult(_0x3ba5ff,null))[_0xd9ff('0x45')](handleError(_0x3ba5ff,null));};exports[_0xd9ff('0x47')]=function(_0x19d473,_0x4cfba7){return db[_0xd9ff('0x29')][_0xd9ff('0x47')](_0x19d473['body'],{})[_0xd9ff('0x24')](respondWithResult(_0x4cfba7,0xc9))[_0xd9ff('0x45')](handleError(_0x4cfba7,null));};exports[_0xd9ff('0x23')]=function(_0x316854,_0x559101){if(_0x316854[_0xd9ff('0x48')]['id']){delete _0x316854['body']['id'];}return db[_0xd9ff('0x29')]['find']({'where':{'id':_0x316854[_0xd9ff('0x49')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x559101,null))[_0xd9ff('0x24')](saveUpdates(_0x316854[_0xd9ff('0x48')],null))[_0xd9ff('0x24')](respondWithResult(_0x559101,null))['catch'](handleError(_0x559101,null));};exports[_0xd9ff('0x4a')]=function(_0x3d6f11,_0x2fbe53){return db[_0xd9ff('0x29')]['find']({'where':{'id':_0x3d6f11['params']['id']}})['then'](handleEntityNotFound(_0x2fbe53,null))[_0xd9ff('0x24')](removeEntity(_0x2fbe53,null))[_0xd9ff('0x45')](handleError(_0x2fbe53,null));};exports[_0xd9ff('0x4b')]=function(_0x572618,_0x136bac,_0x61eec4){var _0x6d1082=require(_0xd9ff('0x4c'));var _0xfede73=![];var _0x40d391={};if(_0x572618[_0xd9ff('0x36')][_0xd9ff('0x2c')]&&_0x572618[_0xd9ff('0x36')][_0xd9ff('0x2c')]===_0xd9ff('0x4d')){_0x40d391[_0xd9ff('0x4d')]=_0x572618[_0xd9ff('0x49')]['id'];}else{_0x40d391['id']=_0x572618['params']['id'];}return db[_0xd9ff('0x29')]['find']({'where':_0x40d391,'attributes':['id',_0xd9ff('0x4e'),'filename'],'raw':!![]})[_0xd9ff('0x24')](handleEntityNotFound(_0x136bac,null))['then'](function(_0xc82610){if(_0xc82610){var _0x5624a0=_0xc82610[_0xd9ff('0x4e')];var _0x4a45d4=util[_0xd9ff('0x4f')]('%s.cypher',_0x5624a0);if(fs[_0xd9ff('0x50')](_0x4a45d4)){_0xfede73=!![];return _0x6d1082['decryptFile'](_0x4a45d4,_0x5624a0,config[_0xd9ff('0x51')][_0xd9ff('0x52')])[_0xd9ff('0x24')](function(){return _0xc82610;});}return _0xc82610;}})[_0xd9ff('0x24')](function(_0x4df17b){if(_0x4df17b){var _0x8c136b=_0x4df17b[_0xd9ff('0x4e')];if(!fs[_0xd9ff('0x50')](_0x8c136b)){throw new db['Sequelize'][(_0xd9ff('0x53'))](_0xd9ff('0x54'));}if(_0x4df17b[_0xd9ff('0x55')]){return _0x136bac[_0xd9ff('0x4b')](_0x8c136b,_0x4df17b[_0xd9ff('0x55')]+path['extname'](_0x8c136b),function(){if(_0xfede73){fs[_0xd9ff('0x56')](_0x8c136b);}});}else{return _0x136bac[_0xd9ff('0x4b')](_0x8c136b,function(_0x11b6c4){if(_0xfede73){fs[_0xd9ff('0x56')](_0x8c136b);}});}}})[_0xd9ff('0x45')](function(_0x2b36e8){if(_0x2b36e8[_0xd9ff('0x57')]==='SquareRecording\x20not\x20found'){_0x136bac[_0xd9ff('0x19')](0x194)[_0xd9ff('0x27')]('Not\x20found');}else{return handleError(_0x136bac,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 48dc27d..64b455d 100644 --- a/server/api/squareRecording/squareRecording.model.js +++ b/server/api/squareRecording/squareRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d11=['exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','moment','request-promise','path','./squareRecording.attributes'];(function(_0x2fc9ed,_0x36a910){var _0x2d6513=function(_0x190b7b){while(--_0x190b7b){_0x2fc9ed['push'](_0x2fc9ed['shift']());}};_0x2d6513(++_0x36a910);}(_0x6d11,0xbf));var _0x16d1=function(_0x58c23b,_0x4a77af){_0x58c23b=_0x58c23b-0x0;var _0x3d5f93=_0x6d11[_0x58c23b];return _0x3d5f93;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf567=['rimraf','../../config/environment','./squareRecording.attributes','define','square_recordings','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x2edeeb,_0x372ef3){var _0x402f5f=function(_0x1daf81){while(--_0x1daf81){_0x2edeeb['push'](_0x2edeeb['shift']());}};_0x402f5f(++_0x372ef3);}(_0xf567,0x118));var _0x7f56=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf567[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var logger=require(_0x7f56('0x2'))('api');var moment=require(_0x7f56('0x3'));var BPromise=require(_0x7f56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f56('0x5'));var rimraf=require(_0x7f56('0x6'));var config=require(_0x7f56('0x7'));var attributes=require(_0x7f56('0x8'));module['exports']=function(_0x444b66,_0x215ff1){return _0x444b66[_0x7f56('0x9')]('SquareRecording',attributes,{'tableName':_0x7f56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 1cf57c1..d6ed1a7 100644 --- a/server/api/squareRecording/squareRecording.rpc.js +++ b/server/api/squareRecording/squareRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cfe=['stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x271acd,_0x1271b3){var _0x5e0995=function(_0x462b48){while(--_0x462b48){_0x271acd['push'](_0x271acd['shift']());}};_0x5e0995(++_0x1271b3);}(_0x9cfe,0x1ce));var _0xe9cf=function(_0xb018c6,_0x195279){_0xb018c6=_0xb018c6-0x0;var _0x5f1dfd=_0x9cfe[_0xb018c6];return _0x5f1dfd;};'use strict';var _=require(_0xe9cf('0x0'));var util=require(_0xe9cf('0x1'));var moment=require(_0xe9cf('0x2'));var BPromise=require(_0xe9cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9cf('0x4'));var db=require(_0xe9cf('0x5'))['db'];var utils=require(_0xe9cf('0x6'));var logger=require(_0xe9cf('0x7'))(_0xe9cf('0x8'));var config=require(_0xe9cf('0x9'));var jayson=require(_0xe9cf('0xa'));var client=jayson[_0xe9cf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a756,_0x15401b,_0x46a59e){return new BPromise(function(_0x2a2c56,_0x21ea61){return client[_0xe9cf('0xc')](_0x12a756,_0x46a59e)[_0xe9cf('0xd')](function(_0x50e1c8){logger[_0xe9cf('0xe')](_0xe9cf('0xf'),_0x15401b,_0xe9cf('0x10'));logger['debug'](_0xe9cf('0x11'),_0x15401b,_0xe9cf('0x10'),JSON[_0xe9cf('0x12')](_0x50e1c8));if(_0x50e1c8[_0xe9cf('0x13')]){if(_0x50e1c8[_0xe9cf('0x13')][_0xe9cf('0x14')]===0x1f4){logger[_0xe9cf('0x13')](_0xe9cf('0xf'),_0x15401b,_0x50e1c8['error'][_0xe9cf('0x15')]);return _0x21ea61(_0x50e1c8[_0xe9cf('0x13')][_0xe9cf('0x15')]);}logger[_0xe9cf('0x13')]('SquareRecording,\x20%s,\x20%s',_0x15401b,_0x50e1c8[_0xe9cf('0x13')]['message']);return _0x2a2c56(_0x50e1c8[_0xe9cf('0x13')][_0xe9cf('0x15')]);}else{logger[_0xe9cf('0xe')](_0xe9cf('0xf'),_0x15401b,'request\x20sent');_0x2a2c56(_0x50e1c8[_0xe9cf('0x16')][_0xe9cf('0x15')]);}})[_0xe9cf('0x17')](function(_0x48e33a){logger[_0xe9cf('0x13')]('SquareRecording,\x20%s,\x20%s',_0x15401b,_0x48e33a);_0x21ea61(_0x48e33a);});});}exports[_0xe9cf('0x18')]=function(_0x1aaf16){var _0x346dcb=this;return new Promise(function(_0x487205,_0x215838){return db[_0xe9cf('0x19')][_0xe9cf('0x1a')](_0x1aaf16['body'],{'raw':_0x1aaf16['options']?_0x1aaf16[_0xe9cf('0x1b')][_0xe9cf('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2c55a6){logger[_0xe9cf('0xe')]('CreateSquareRecording',_0x1aaf16);logger[_0xe9cf('0x1d')](_0xe9cf('0x18'),_0x1aaf16,JSON[_0xe9cf('0x12')](_0x2c55a6));_0x487205(_0x2c55a6);})[_0xe9cf('0x17')](function(_0x52ac93){logger[_0xe9cf('0x13')](_0xe9cf('0x18'),_0x52ac93[_0xe9cf('0x15')],_0x1aaf16);_0x215838(_0x346dcb[_0xe9cf('0x13')](0x1f4,_0x52ac93[_0xe9cf('0x15')]));});});}; \ No newline at end of file +var _0xb18c=['SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','randomstring','../../mysqldb','../../config/utils','rpc','client','http','then'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0xb18c,0xb9));var _0xcb18=function(_0x78dd5f,_0x1dcea3){_0x78dd5f=_0x78dd5f-0x0;var _0x918e=_0xb18c[_0x78dd5f];return _0x918e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb18('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb18('0x1'))['db'];var utils=require(_0xcb18('0x2'));var logger=require('../../config/logger')(_0xcb18('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcb18('0x4')][_0xcb18('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3797f4,_0x392407,_0x4e4936){return new BPromise(function(_0x31103a,_0xdf4de1){return client['request'](_0x3797f4,_0x4e4936)[_0xcb18('0x6')](function(_0x4fe5a0){logger['info'](_0xcb18('0x7'),_0x392407,'request\x20sent');logger[_0xcb18('0x8')](_0xcb18('0x9'),_0x392407,_0xcb18('0xa'),JSON[_0xcb18('0xb')](_0x4fe5a0));if(_0x4fe5a0[_0xcb18('0xc')]){if(_0x4fe5a0[_0xcb18('0xc')][_0xcb18('0xd')]===0x1f4){logger[_0xcb18('0xc')](_0xcb18('0x7'),_0x392407,_0x4fe5a0[_0xcb18('0xc')][_0xcb18('0xe')]);return _0xdf4de1(_0x4fe5a0[_0xcb18('0xc')]['message']);}logger['error'](_0xcb18('0x7'),_0x392407,_0x4fe5a0[_0xcb18('0xc')]['message']);return _0x31103a(_0x4fe5a0[_0xcb18('0xc')]['message']);}else{logger[_0xcb18('0xf')](_0xcb18('0x7'),_0x392407,'request\x20sent');_0x31103a(_0x4fe5a0[_0xcb18('0x10')][_0xcb18('0xe')]);}})[_0xcb18('0x11')](function(_0x416850){logger[_0xcb18('0xc')]('SquareRecording,\x20%s,\x20%s',_0x392407,_0x416850);_0xdf4de1(_0x416850);});});}exports['CreateSquareRecording']=function(_0x5c545f){var _0x282834=this;return new Promise(function(_0x5829bb,_0x2020dc){return db[_0xcb18('0x12')][_0xcb18('0x13')](_0x5c545f[_0xcb18('0x14')],{'raw':_0x5c545f[_0xcb18('0x15')]?_0x5c545f[_0xcb18('0x15')][_0xcb18('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1bd33a){logger[_0xcb18('0xf')](_0xcb18('0x17'),_0x5c545f);logger[_0xcb18('0x8')](_0xcb18('0x17'),_0x5c545f,JSON[_0xcb18('0xb')](_0x1bd33a));_0x5829bb(_0x1bd33a);})[_0xcb18('0x11')](function(_0x2e30fc){logger[_0xcb18('0xc')](_0xcb18('0x17'),_0x2e30fc[_0xcb18('0xe')],_0x5c545f);_0x2020dc(_0x282834[_0xcb18('0xc')](0x1f4,_0x2e30fc[_0xcb18('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 52584c6..952e7bd 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd479=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','multer','util','path'];(function(_0x55b460,_0x497077){var _0x3ac537=function(_0xd709b3){while(--_0xd709b3){_0x55b460['push'](_0x55b460['shift']());}};_0x3ac537(++_0x497077);}(_0xd479,0x69));var _0x9d47=function(_0x2cf7cc,_0x347885){_0x2cf7cc=_0x2cf7cc-0x0;var _0x5bf1a9=_0xd479[_0x2cf7cc];return _0x5bf1a9;};'use strict';var multer=require(_0x9d47('0x0'));var util=require(_0x9d47('0x1'));var path=require(_0x9d47('0x2'));var timeout=require(_0x9d47('0x3'));var express=require('express');var router=express[_0x9d47('0x4')]();var auth=require(_0x9d47('0x5'));var interaction=require(_0x9d47('0x6'));var config=require(_0x9d47('0x7'));var controller=require(_0x9d47('0x8'));router[_0x9d47('0x9')]('/',auth[_0x9d47('0xa')](),controller[_0x9d47('0xb')]);router[_0x9d47('0x9')](_0x9d47('0xc'),auth[_0x9d47('0xa')](),controller[_0x9d47('0xd')]);router['get'](_0x9d47('0xe'),auth[_0x9d47('0xa')](),controller['show']);router['post']('/',auth[_0x9d47('0xa')](),controller[_0x9d47('0xf')]);router[_0x9d47('0x10')](_0x9d47('0xe'),auth[_0x9d47('0xa')](),controller[_0x9d47('0x11')]);router['delete'](_0x9d47('0xe'),auth[_0x9d47('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd85f=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x45e3c4,_0x45a9ec){var _0x50acc9=function(_0x596c9d){while(--_0x596c9d){_0x45e3c4['push'](_0x45e3c4['shift']());}};_0x50acc9(++_0x45a9ec);}(_0xd85f,0x18a));var _0xfd85=function(_0x29cbf4,_0x291869){_0x29cbf4=_0x29cbf4-0x0;var _0x3bb33f=_0xd85f[_0x29cbf4];return _0x3bb33f;};'use strict';var multer=require(_0xfd85('0x0'));var util=require(_0xfd85('0x1'));var path=require(_0xfd85('0x2'));var timeout=require(_0xfd85('0x3'));var express=require(_0xfd85('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfd85('0x5'));var config=require(_0xfd85('0x6'));var controller=require('./squareReport.controller');router[_0xfd85('0x7')]('/',auth[_0xfd85('0x8')](),controller[_0xfd85('0x9')]);router[_0xfd85('0x7')](_0xfd85('0xa'),auth[_0xfd85('0x8')](),controller['describe']);router[_0xfd85('0x7')](_0xfd85('0xb'),auth[_0xfd85('0x8')](),controller[_0xfd85('0xc')]);router[_0xfd85('0xd')]('/',auth['isAuthenticated'](),controller[_0xfd85('0xe')]);router[_0xfd85('0xf')](_0xfd85('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfd85('0x10')]('/:id',auth[_0xfd85('0x8')](),controller[_0xfd85('0x11')]);module[_0xfd85('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 1768e2a..648ba67 100644 --- a/server/api/squareReport/squareReport.attributes.js +++ b/server/api/squareReport/squareReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ed0=['BOOLEAN','exports','STRING','DATE'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x2ed0,0xc9));var _0x02ed=function(_0x1aa92e,_0x28ec12){_0x1aa92e=_0x1aa92e-0x0;var _0x5b6c77=_0x2ed0[_0x1aa92e];return _0x5b6c77;};'use strict';var Sequelize=require('sequelize');module[_0x02ed('0x0')]={'network':{'type':Sequelize[_0x02ed('0x1')]},'network_script':{'type':Sequelize[_0x02ed('0x1')]},'request':{'type':Sequelize[_0x02ed('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x02ed('0x1')]},'uniqueid':{'type':Sequelize[_0x02ed('0x1')]},'version':{'type':Sequelize[_0x02ed('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x02ed('0x1')]},'callingpres':{'type':Sequelize[_0x02ed('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x02ed('0x1')]},'dnid':{'type':Sequelize[_0x02ed('0x1')]},'rdnis':{'type':Sequelize[_0x02ed('0x1')]},'context':{'type':Sequelize[_0x02ed('0x1')]},'extension':{'type':Sequelize[_0x02ed('0x1')]},'priority':{'type':Sequelize[_0x02ed('0x1')]},'enhanced':{'type':Sequelize[_0x02ed('0x1')]},'accountcode':{'type':Sequelize[_0x02ed('0x1')]},'threadid':{'type':Sequelize[_0x02ed('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x02ed('0x2')]},'bot':{'type':Sequelize[_0x02ed('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0dd9=['exports','STRING','DATE','sequelize'];(function(_0x1910f2,_0x2eb708){var _0x25706a=function(_0x32f4b2){while(--_0x32f4b2){_0x1910f2['push'](_0x1910f2['shift']());}};_0x25706a(++_0x2eb708);}(_0x0dd9,0x1af));var _0x90dd=function(_0x292eec,_0x157803){_0x292eec=_0x292eec-0x0;var _0x291f26=_0x0dd9[_0x292eec];return _0x291f26;};'use strict';var Sequelize=require(_0x90dd('0x0'));module[_0x90dd('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x90dd('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x90dd('0x2')]},'type':{'type':Sequelize[_0x90dd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x90dd('0x2')]},'callerid':{'type':Sequelize[_0x90dd('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x90dd('0x2')]},'callingani2':{'type':Sequelize[_0x90dd('0x2')]},'callington':{'type':Sequelize[_0x90dd('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x90dd('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x90dd('0x2')]},'extension':{'type':Sequelize[_0x90dd('0x2')]},'priority':{'type':Sequelize[_0x90dd('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x90dd('0x2')]},'threadid':{'type':Sequelize[_0x90dd('0x2')]},'project_name':{'type':Sequelize[_0x90dd('0x2')]},'joinAt':{'type':Sequelize[_0x90dd('0x3')]},'leaveAt':{'type':Sequelize[_0x90dd('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 1e320f9..6b1aa65 100644 --- a/server/api/squareReport/squareReport.controller.js +++ b/server/api/squareReport/squareReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','type','filter','options','SquareReport','include','rows','catch','show','params','includeAll','create','body','update','find','describe','html-pdf','zip-dir','fast-json-patch','request-promise'];(function(_0x16ce08,_0x5eb4d2){var _0x5564e5=function(_0x390489){while(--_0x390489){_0x16ce08['push'](_0x16ce08['shift']());}};_0x5564e5(++_0x5eb4d2);}(_0x326f,0xd1));var _0xf326=function(_0x3b69eb,_0xced69f){_0x3b69eb=_0x3b69eb-0x0;var _0x1a18d6=_0x326f[_0x3b69eb];return _0x1a18d6;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];function respondWithStatusCode(_0x518ab5,_0x3162f9){_0x3162f9=_0x3162f9||0xcc;return function(_0x9ed463){if(_0x9ed463){return _0x518ab5['sendStatus'](_0x3162f9);}return _0x518ab5[_0xf326('0x17')](_0x3162f9)[_0xf326('0x18')]();};}function respondWithResult(_0x3504eb,_0x17a098){_0x17a098=_0x17a098||0xc8;return function(_0x5c8483){if(_0x5c8483){return _0x3504eb[_0xf326('0x17')](_0x17a098)['json'](_0x5c8483);}};}function respondWithFilteredResult(_0x54bd1a,_0xdf21d9){return function(_0x11f6d2){if(_0x11f6d2){var _0x1f2e5a=_0x11f6d2[_0xf326('0x19')],_0xa63d1a=_0xdf21d9[_0xf326('0x1a')],_0x292f4b=_0xdf21d9['offset']+_0xdf21d9[_0xf326('0x1b')],_0x287a2a;if(_0x292f4b>=_0x1f2e5a){_0x292f4b=_0x1f2e5a;_0x287a2a=0xc8;}else{_0x287a2a=0xce;}_0x54bd1a[_0xf326('0x17')](_0x287a2a);return _0x54bd1a[_0xf326('0x1c')](_0xf326('0x1d'),_0xa63d1a+'-'+_0x292f4b+'/'+_0x1f2e5a)[_0xf326('0x1e')](_0x11f6d2);}return null;};}function patchUpdates(_0x311af0){return function(_0x4d3d41){try{jsonpatch['apply'](_0x4d3d41,_0x311af0,!![]);}catch(_0x56ad41){return BPromise[_0xf326('0x1f')](_0x56ad41);}return _0x4d3d41[_0xf326('0x20')]();};}function saveUpdates(_0x484cbe,_0x4cabce){return function(_0x128c68){if(_0x128c68){return _0x128c68['update'](_0x484cbe)['then'](function(_0x448b92){return _0x448b92;});}return null;};}function removeEntity(_0x18ead3,_0x549b46){return function(_0x5aa184){if(_0x5aa184){return _0x5aa184[_0xf326('0x21')]()[_0xf326('0x22')](function(){_0x18ead3['status'](0xcc)[_0xf326('0x18')]();});}};}function handleEntityNotFound(_0x1b9039,_0x43c53e){return function(_0x295752){if(!_0x295752){_0x1b9039[_0xf326('0x23')](0x194);}return _0x295752;};}function handleError(_0x2049ec,_0x5ce532){_0x5ce532=_0x5ce532||0x1f4;return function(_0x55b9f4){logger['error'](_0x55b9f4[_0xf326('0x24')]);if(_0x55b9f4[_0xf326('0x25')]){delete _0x55b9f4[_0xf326('0x25')];}_0x2049ec[_0xf326('0x17')](_0x5ce532)[_0xf326('0x26')](_0x55b9f4);};}exports[_0xf326('0x27')]=function(_0x5217d4,_0x201d28){var _0xa3c0b={},_0x212d5d={},_0x581531={'count':0x0,'rows':[]};var _0x1617d2=_['map'](db['SquareReport'][_0xf326('0x28')],function(_0x1ae23a){return{'name':_0x1ae23a[_0xf326('0x29')],'type':_0x1ae23a['type'][_0xf326('0x2a')]};});_0x212d5d[_0xf326('0x2b')]=_['map'](_0x1617d2,_0xf326('0x25'));_0x212d5d[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5217d4[_0xf326('0x2c')]);_0x212d5d[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x212d5d[_0xf326('0x2b')],_0x212d5d[_0xf326('0x2c')]);_0xa3c0b[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x212d5d['model'],qs[_0xf326('0x31')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x31')]));_0xa3c0b['attributes']=_0xa3c0b[_0xf326('0x30')][_0xf326('0x32')]?_0xa3c0b[_0xf326('0x30')]:_0x212d5d['model'];if(!_0x5217d4['query'][_0xf326('0x33')](_0xf326('0x34'))){_0xa3c0b[_0xf326('0x1b')]=qs[_0xf326('0x1b')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x1b')]);_0xa3c0b[_0xf326('0x1a')]=qs[_0xf326('0x1a')](_0x5217d4['query'][_0xf326('0x1a')]);}_0xa3c0b[_0xf326('0x35')]=qs['sort'](_0x5217d4[_0xf326('0x2c')]['sort']);_0xa3c0b[_0xf326('0x36')]=qs['filters'](_['pick'](_0x5217d4[_0xf326('0x2c')],_0x212d5d['filters']));if(_0x5217d4[_0xf326('0x2c')]['filter']){_0xa3c0b[_0xf326('0x36')]=_[_0xf326('0x37')](_0xa3c0b[_0xf326('0x36')],{'$or':_['map'](_0x1617d2,function(_0x3dcc7e){if(_0x3dcc7e[_0xf326('0x38')]!=='VIRTUAL'){var _0x13932b={};_0x13932b[_0x3dcc7e[_0xf326('0x25')]]={'$like':'%'+_0x5217d4[_0xf326('0x2c')][_0xf326('0x39')]+'%'};return _0x13932b;}})});}_0xa3c0b=_['merge']({},_0xa3c0b,_0x5217d4[_0xf326('0x3a')]);var _0xb1ef35={'where':_0xa3c0b[_0xf326('0x36')]};return db[_0xf326('0x3b')][_0xf326('0x19')](_0xb1ef35)['then'](function(_0x3e830d){_0x581531[_0xf326('0x19')]=_0x3e830d;if(_0x5217d4['query']['includeAll']){_0xa3c0b[_0xf326('0x3c')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0xa3c0b);})[_0xf326('0x22')](function(_0x5d6ae2){_0x581531[_0xf326('0x3d')]=_0x5d6ae2;return _0x581531;})[_0xf326('0x22')](respondWithFilteredResult(_0x201d28,_0xa3c0b))[_0xf326('0x3e')](handleError(_0x201d28,null));};exports[_0xf326('0x3f')]=function(_0x49112d,_0x9dda89){var _0x45d344={'raw':!![],'where':{'id':_0x49112d[_0xf326('0x40')]['id']}},_0x347e7b={};_0x347e7b[_0xf326('0x2b')]=_[_0xf326('0x2d')](db[_0xf326('0x3b')][_0xf326('0x28')]);_0x347e7b[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x49112d[_0xf326('0x2c')]);_0x347e7b[_0xf326('0x2e')]=_['intersection'](_0x347e7b[_0xf326('0x2b')],_0x347e7b[_0xf326('0x2c')]);_0x45d344[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x347e7b[_0xf326('0x2b')],qs[_0xf326('0x31')](_0x49112d['query'][_0xf326('0x31')]));_0x45d344[_0xf326('0x30')]=_0x45d344['attributes'][_0xf326('0x32')]?_0x45d344[_0xf326('0x30')]:_0x347e7b[_0xf326('0x2b')];if(_0x49112d[_0xf326('0x2c')][_0xf326('0x41')]){_0x45d344['include']=[{'all':!![]}];}_0x45d344=_['merge']({},_0x45d344,_0x49112d[_0xf326('0x3a')]);return db[_0xf326('0x3b')]['find'](_0x45d344)['then'](handleEntityNotFound(_0x9dda89,null))[_0xf326('0x22')](respondWithResult(_0x9dda89,null))[_0xf326('0x3e')](handleError(_0x9dda89,null));};exports[_0xf326('0x42')]=function(_0x5b3705,_0x301e65){return db[_0xf326('0x3b')][_0xf326('0x42')](_0x5b3705[_0xf326('0x43')],{})[_0xf326('0x22')](respondWithResult(_0x301e65,0xc9))[_0xf326('0x3e')](handleError(_0x301e65,null));};exports[_0xf326('0x44')]=function(_0x3b90dc,_0x3df9a8){if(_0x3b90dc[_0xf326('0x43')]['id']){delete _0x3b90dc[_0xf326('0x43')]['id'];}return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x3b90dc[_0xf326('0x40')]['id']}})[_0xf326('0x22')](handleEntityNotFound(_0x3df9a8,null))['then'](saveUpdates(_0x3b90dc[_0xf326('0x43')],null))[_0xf326('0x22')](respondWithResult(_0x3df9a8,null))[_0xf326('0x3e')](handleError(_0x3df9a8,null));};exports[_0xf326('0x21')]=function(_0x5f1829,_0x10f437){return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x5f1829[_0xf326('0x40')]['id']}})['then'](handleEntityNotFound(_0x10f437,null))[_0xf326('0x22')](removeEntity(_0x10f437,null))[_0xf326('0x3e')](handleError(_0x10f437,null));};exports[_0xf326('0x46')]=function(_0x451ac7,_0x39ba25){return db['SquareReport']['describe']()[_0xf326('0x22')](respondWithResult(_0x39ba25,null))[_0xf326('0x3e')](handleError(_0x39ba25,null));}; \ No newline at end of file +var _0x1261=['model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','merge','options','includeAll','findAll','rows','show','params','keys','length','include','catch','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','error','stack','name','index','SquareReport','rawAttributes','fieldName','key','map','query','intersection'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x1261,0x144));var _0x1126=function(_0x39cbe4,_0x4a7958){_0x39cbe4=_0x39cbe4-0x0;var _0xe76ba7=_0x1261[_0x39cbe4];return _0xe76ba7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var db=require(_0x1126('0x16'))['db'];function respondWithStatusCode(_0x1b364a,_0xd26a32){_0xd26a32=_0xd26a32||0xcc;return function(_0x273896){if(_0x273896){return _0x1b364a[_0x1126('0x17')](_0xd26a32);}return _0x1b364a[_0x1126('0x18')](_0xd26a32)[_0x1126('0x19')]();};}function respondWithResult(_0x2048ad,_0x43850b){_0x43850b=_0x43850b||0xc8;return function(_0x53a8f0){if(_0x53a8f0){return _0x2048ad['status'](_0x43850b)[_0x1126('0x1a')](_0x53a8f0);}};}function respondWithFilteredResult(_0x154e20,_0x279455){return function(_0x4be0c6){if(_0x4be0c6){var _0x45149c=_0x4be0c6[_0x1126('0x1b')],_0x4794a7=_0x279455['offset'],_0x35fe9f=_0x279455[_0x1126('0x1c')]+_0x279455[_0x1126('0x1d')],_0x42f379;if(_0x35fe9f>=_0x45149c){_0x35fe9f=_0x45149c;_0x42f379=0xc8;}else{_0x42f379=0xce;}_0x154e20['status'](_0x42f379);return _0x154e20['set'](_0x1126('0x1e'),_0x4794a7+'-'+_0x35fe9f+'/'+_0x45149c)[_0x1126('0x1a')](_0x4be0c6);}return null;};}function patchUpdates(_0x58d11a){return function(_0x548359){try{jsonpatch[_0x1126('0x1f')](_0x548359,_0x58d11a,!![]);}catch(_0x58b109){return BPromise[_0x1126('0x20')](_0x58b109);}return _0x548359[_0x1126('0x21')]();};}function saveUpdates(_0x2f70ac,_0x54400a){return function(_0x2a08ba){if(_0x2a08ba){return _0x2a08ba['update'](_0x2f70ac)['then'](function(_0x30f6b3){return _0x30f6b3;});}return null;};}function removeEntity(_0x3a9bed,_0x25b24b){return function(_0x36d254){if(_0x36d254){return _0x36d254['destroy']()[_0x1126('0x22')](function(){_0x3a9bed[_0x1126('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(!_0x529dd9){_0x2175fa['sendStatus'](0x194);}return _0x529dd9;};}function handleError(_0x2199d9,_0x15bcc3){_0x15bcc3=_0x15bcc3||0x1f4;return function(_0x329914){logger[_0x1126('0x23')](_0x329914[_0x1126('0x24')]);if(_0x329914[_0x1126('0x25')]){delete _0x329914[_0x1126('0x25')];}_0x2199d9[_0x1126('0x18')](_0x15bcc3)['send'](_0x329914);};}exports[_0x1126('0x26')]=function(_0x375e59,_0xa293f4){var _0x5ddf63={},_0x541bc9={},_0xeb7d89={'count':0x0,'rows':[]};var _0x39bf0e=_['map'](db[_0x1126('0x27')][_0x1126('0x28')],function(_0x4a334a){return{'name':_0x4a334a[_0x1126('0x29')],'type':_0x4a334a['type'][_0x1126('0x2a')]};});_0x541bc9['model']=_[_0x1126('0x2b')](_0x39bf0e,'name');_0x541bc9[_0x1126('0x2c')]=_['keys'](_0x375e59['query']);_0x541bc9['filters']=_[_0x1126('0x2d')](_0x541bc9[_0x1126('0x2e')],_0x541bc9[_0x1126('0x2c')]);_0x5ddf63['attributes']=_[_0x1126('0x2d')](_0x541bc9[_0x1126('0x2e')],qs['fields'](_0x375e59[_0x1126('0x2c')][_0x1126('0x2f')]));_0x5ddf63[_0x1126('0x30')]=_0x5ddf63[_0x1126('0x30')]['length']?_0x5ddf63['attributes']:_0x541bc9[_0x1126('0x2e')];if(!_0x375e59[_0x1126('0x2c')][_0x1126('0x31')](_0x1126('0x32'))){_0x5ddf63['limit']=qs[_0x1126('0x1d')](_0x375e59[_0x1126('0x2c')][_0x1126('0x1d')]);_0x5ddf63[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x375e59['query'][_0x1126('0x1c')]);}_0x5ddf63[_0x1126('0x33')]=qs[_0x1126('0x34')](_0x375e59[_0x1126('0x2c')]['sort']);_0x5ddf63['where']=qs[_0x1126('0x35')](_[_0x1126('0x36')](_0x375e59['query'],_0x541bc9[_0x1126('0x35')]));if(_0x375e59[_0x1126('0x2c')][_0x1126('0x37')]){_0x5ddf63['where']=_['merge'](_0x5ddf63[_0x1126('0x38')],{'$or':_[_0x1126('0x2b')](_0x39bf0e,function(_0x3aa08f){if(_0x3aa08f[_0x1126('0x39')]!=='VIRTUAL'){var _0x428d3d={};_0x428d3d[_0x3aa08f['name']]={'$like':'%'+_0x375e59[_0x1126('0x2c')][_0x1126('0x37')]+'%'};return _0x428d3d;}})});}_0x5ddf63=_[_0x1126('0x3a')]({},_0x5ddf63,_0x375e59[_0x1126('0x3b')]);var _0x57e5d2={'where':_0x5ddf63['where']};return db[_0x1126('0x27')][_0x1126('0x1b')](_0x57e5d2)[_0x1126('0x22')](function(_0x397e3b){_0xeb7d89[_0x1126('0x1b')]=_0x397e3b;if(_0x375e59[_0x1126('0x2c')][_0x1126('0x3c')]){_0x5ddf63['include']=[{'all':!![]}];}return db[_0x1126('0x27')][_0x1126('0x3d')](_0x5ddf63);})[_0x1126('0x22')](function(_0xf3a0bd){_0xeb7d89[_0x1126('0x3e')]=_0xf3a0bd;return _0xeb7d89;})['then'](respondWithFilteredResult(_0xa293f4,_0x5ddf63))['catch'](handleError(_0xa293f4,null));};exports[_0x1126('0x3f')]=function(_0x219bcc,_0xcee9de){var _0x21c38e={'raw':!![],'where':{'id':_0x219bcc[_0x1126('0x40')]['id']}},_0x18b496={};_0x18b496['model']=_['keys'](db['SquareReport'][_0x1126('0x28')]);_0x18b496['query']=_[_0x1126('0x41')](_0x219bcc[_0x1126('0x2c')]);_0x18b496[_0x1126('0x35')]=_[_0x1126('0x2d')](_0x18b496['model'],_0x18b496['query']);_0x21c38e[_0x1126('0x30')]=_[_0x1126('0x2d')](_0x18b496[_0x1126('0x2e')],qs['fields'](_0x219bcc[_0x1126('0x2c')]['fields']));_0x21c38e[_0x1126('0x30')]=_0x21c38e['attributes'][_0x1126('0x42')]?_0x21c38e[_0x1126('0x30')]:_0x18b496[_0x1126('0x2e')];if(_0x219bcc['query'][_0x1126('0x3c')]){_0x21c38e[_0x1126('0x43')]=[{'all':!![]}];}_0x21c38e=_[_0x1126('0x3a')]({},_0x21c38e,_0x219bcc['options']);return db['SquareReport']['find'](_0x21c38e)[_0x1126('0x22')](handleEntityNotFound(_0xcee9de,null))['then'](respondWithResult(_0xcee9de,null))[_0x1126('0x44')](handleError(_0xcee9de,null));};exports['create']=function(_0x2f45b9,_0x323499){return db[_0x1126('0x27')][_0x1126('0x45')](_0x2f45b9[_0x1126('0x46')],{})['then'](respondWithResult(_0x323499,0xc9))[_0x1126('0x44')](handleError(_0x323499,null));};exports[_0x1126('0x47')]=function(_0x5111d3,_0x1a15f8){if(_0x5111d3[_0x1126('0x46')]['id']){delete _0x5111d3['body']['id'];}return db[_0x1126('0x27')][_0x1126('0x48')]({'where':{'id':_0x5111d3['params']['id']}})[_0x1126('0x22')](handleEntityNotFound(_0x1a15f8,null))[_0x1126('0x22')](saveUpdates(_0x5111d3[_0x1126('0x46')],null))['then'](respondWithResult(_0x1a15f8,null))[_0x1126('0x44')](handleError(_0x1a15f8,null));};exports[_0x1126('0x49')]=function(_0x411c89,_0x5878bb){return db[_0x1126('0x27')][_0x1126('0x48')]({'where':{'id':_0x411c89[_0x1126('0x40')]['id']}})[_0x1126('0x22')](handleEntityNotFound(_0x5878bb,null))['then'](removeEntity(_0x5878bb,null))[_0x1126('0x44')](handleError(_0x5878bb,null));};exports['describe']=function(_0x40168e,_0x2ad118){return db['SquareReport']['describe']()[_0x1126('0x22')](respondWithResult(_0x2ad118,null))[_0x1126('0x44')](handleError(_0x2ad118,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 0d20a45..fa5cb5c 100644 --- a/server/api/squareReport/squareReport.model.js +++ b/server/api/squareReport/squareReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf579=['uniqueid','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','SquareReport','report_square','uid_pname'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xf579,0x1e1));var _0x9f57=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xf579[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var util=require(_0x9f57('0x0'));var logger=require(_0x9f57('0x1'))('api');var moment=require(_0x9f57('0x2'));var BPromise=require('bluebird');var rp=require(_0x9f57('0x3'));var fs=require('fs');var path=require(_0x9f57('0x4'));var rimraf=require(_0x9f57('0x5'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x9f57('0x6')]=function(_0x4c3221,_0x5b51ca){return _0x4c3221[_0x9f57('0x7')](_0x9f57('0x8'),attributes,{'tableName':_0x9f57('0x9'),'paranoid':![],'indexes':[{'name':_0x9f57('0xa'),'fields':[_0x9f57('0xb'),'project_name']},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdae5=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','define','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x5bb930,_0x303834){var _0x5dabbf=function(_0x1581e1){while(--_0x1581e1){_0x5bb930['push'](_0x5bb930['shift']());}};_0x5dabbf(++_0x303834);}(_0xdae5,0x1c2));var _0x5dae=function(_0x5e1a9a,_0x1ff576){_0x5e1a9a=_0x5e1a9a-0x0;var _0x5859b4=_0xdae5[_0x5e1a9a];return _0x5859b4;};'use strict';var _=require(_0x5dae('0x0'));var util=require(_0x5dae('0x1'));var logger=require(_0x5dae('0x2'))(_0x5dae('0x3'));var moment=require(_0x5dae('0x4'));var BPromise=require(_0x5dae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5dae('0x6'));var rimraf=require(_0x5dae('0x7'));var config=require(_0x5dae('0x8'));var attributes=require(_0x5dae('0x9'));module['exports']=function(_0x23904e,_0x446b81){return _0x23904e[_0x5dae('0xa')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x5dae('0xb'),'fields':[_0x5dae('0xc'),_0x5dae('0xd')]},{'name':_0x5dae('0xe'),'fields':[_0x5dae('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 572c7aa..dcc3c03 100644 --- a/server/api/squareReport/squareReport.rpc.js +++ b/server/api/squareReport/squareReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cb7=['http','request','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','create','options','raw','then','CreateSquareReport','catch','UpdateSquareReport','body','where','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5e98d0,_0x227ea6){var _0xcf249d=function(_0x383782){while(--_0x383782){_0x5e98d0['push'](_0x5e98d0['shift']());}};_0xcf249d(++_0x227ea6);}(_0x5cb7,0x1d6));var _0x75cb=function(_0x1d524d,_0x3cdf11){_0x1d524d=_0x1d524d-0x0;var _0x552dfb=_0x5cb7[_0x1d524d];return _0x552dfb;};'use strict';var _=require(_0x75cb('0x0'));var util=require(_0x75cb('0x1'));var moment=require(_0x75cb('0x2'));var BPromise=require(_0x75cb('0x3'));var rs=require(_0x75cb('0x4'));var fs=require('fs');var Redis=require(_0x75cb('0x5'));var db=require(_0x75cb('0x6'))['db'];var utils=require(_0x75cb('0x7'));var logger=require('../../config/logger')(_0x75cb('0x8'));var config=require(_0x75cb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x75cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x465de7,_0x453aef,_0x42feed){return new BPromise(function(_0x5095ae,_0x497511){return client[_0x75cb('0xb')](_0x465de7,_0x42feed)['then'](function(_0x10b73e){logger['info'](_0x75cb('0xc'),_0x453aef,_0x75cb('0xd'));logger[_0x75cb('0xe')](_0x75cb('0xf'),_0x453aef,_0x75cb('0xd'),JSON['stringify'](_0x10b73e));if(_0x10b73e['error']){if(_0x10b73e[_0x75cb('0x10')][_0x75cb('0x11')]===0x1f4){logger['error'](_0x75cb('0xc'),_0x453aef,_0x10b73e['error'][_0x75cb('0x12')]);return _0x497511(_0x10b73e['error'][_0x75cb('0x12')]);}logger['error'](_0x75cb('0xc'),_0x453aef,_0x10b73e[_0x75cb('0x10')][_0x75cb('0x12')]);return _0x5095ae(_0x10b73e[_0x75cb('0x10')]['message']);}else{logger[_0x75cb('0x13')](_0x75cb('0xc'),_0x453aef,_0x75cb('0xd'));_0x5095ae(_0x10b73e[_0x75cb('0x14')]['message']);}})['catch'](function(_0x46d067){logger[_0x75cb('0x10')](_0x75cb('0xc'),_0x453aef,_0x46d067);_0x497511(_0x46d067);});});}exports['CreateSquareReport']=function(_0x37c806){var _0x53eca5=this;return new Promise(function(_0x1cce59,_0x505e71){return db['SquareReport'][_0x75cb('0x15')](_0x37c806['body'],{'raw':_0x37c806[_0x75cb('0x16')]?_0x37c806['options'][_0x75cb('0x17')]===undefined?!![]:![]:!![]})[_0x75cb('0x18')](function(_0x544dde){logger['info'](_0x75cb('0x19'),_0x37c806);logger[_0x75cb('0xe')](_0x75cb('0x19'),_0x37c806,JSON['stringify'](_0x544dde));_0x1cce59(_0x544dde);})[_0x75cb('0x1a')](function(_0x16862b){logger[_0x75cb('0x10')](_0x75cb('0x19'),_0x16862b[_0x75cb('0x12')],_0x37c806);_0x505e71(_0x53eca5['error'](0x1f4,_0x16862b[_0x75cb('0x12')]));});});};exports[_0x75cb('0x1b')]=function(_0x175dcf){var _0x527ef9=this;return new Promise(function(_0x586925,_0x1364ac){return db['SquareReport']['update'](_0x175dcf[_0x75cb('0x1c')],{'raw':_0x175dcf[_0x75cb('0x16')]?_0x175dcf[_0x75cb('0x16')][_0x75cb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x175dcf[_0x75cb('0x16')]?_0x175dcf[_0x75cb('0x16')][_0x75cb('0x1d')]||null:null,'attributes':_0x175dcf[_0x75cb('0x16')]?_0x175dcf['options']['attributes']||null:null,'limit':_0x175dcf[_0x75cb('0x16')]?_0x175dcf[_0x75cb('0x16')][_0x75cb('0x1e')]||null:null})[_0x75cb('0x18')](function(_0x1b6750){logger[_0x75cb('0x13')](_0x75cb('0x1b'),_0x175dcf);logger['debug'](_0x75cb('0x1b'),_0x175dcf,JSON[_0x75cb('0x1f')](_0x1b6750));_0x586925(_0x1b6750);})[_0x75cb('0x1a')](function(_0x1c86c0){logger[_0x75cb('0x10')](_0x75cb('0x1b'),_0x1c86c0[_0x75cb('0x12')],_0x175dcf);_0x1364ac(_0x527ef9[_0x75cb('0x10')](0x1f4,_0x1c86c0[_0x75cb('0x12')]));});});}; \ No newline at end of file +var _0x61e2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','options','raw','update','body','attributes','limit','UpdateSquareReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61e2,0x19e));var _0x261e=function(_0x2099c2,_0x2c5b95){_0x2099c2=_0x2099c2-0x0;var _0xbe537=_0x61e2[_0x2099c2];return _0xbe537;};'use strict';var _=require('lodash');var util=require(_0x261e('0x0'));var moment=require(_0x261e('0x1'));var BPromise=require(_0x261e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x261e('0x3'));var db=require(_0x261e('0x4'))['db'];var utils=require(_0x261e('0x5'));var logger=require(_0x261e('0x6'))(_0x261e('0x7'));var config=require(_0x261e('0x8'));var jayson=require(_0x261e('0x9'));var client=jayson[_0x261e('0xa')][_0x261e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe3570,_0x390fa6,_0x22316d){return new BPromise(function(_0x1df55b,_0x4c7f8b){return client[_0x261e('0xc')](_0xe3570,_0x22316d)[_0x261e('0xd')](function(_0x4a72fd){logger[_0x261e('0xe')](_0x261e('0xf'),_0x390fa6,_0x261e('0x10'));logger[_0x261e('0x11')](_0x261e('0x12'),_0x390fa6,_0x261e('0x10'),JSON[_0x261e('0x13')](_0x4a72fd));if(_0x4a72fd['error']){if(_0x4a72fd[_0x261e('0x14')][_0x261e('0x15')]===0x1f4){logger[_0x261e('0x14')](_0x261e('0xf'),_0x390fa6,_0x4a72fd[_0x261e('0x14')]['message']);return _0x4c7f8b(_0x4a72fd[_0x261e('0x14')][_0x261e('0x16')]);}logger[_0x261e('0x14')]('SquareReport,\x20%s,\x20%s',_0x390fa6,_0x4a72fd[_0x261e('0x14')][_0x261e('0x16')]);return _0x1df55b(_0x4a72fd[_0x261e('0x14')][_0x261e('0x16')]);}else{logger[_0x261e('0xe')](_0x261e('0xf'),_0x390fa6,_0x261e('0x10'));_0x1df55b(_0x4a72fd[_0x261e('0x17')]['message']);}})[_0x261e('0x18')](function(_0x57a59d){logger['error'](_0x261e('0xf'),_0x390fa6,_0x57a59d);_0x4c7f8b(_0x57a59d);});});}exports[_0x261e('0x19')]=function(_0x4f3256){var _0x1c2908=this;return new Promise(function(_0x4e94a9,_0x2de7fe){return db[_0x261e('0x1a')][_0x261e('0x1b')](_0x4f3256['body'],{'raw':_0x4f3256[_0x261e('0x1c')]?_0x4f3256[_0x261e('0x1c')][_0x261e('0x1d')]===undefined?!![]:![]:!![]})[_0x261e('0xd')](function(_0x235afe){logger[_0x261e('0xe')](_0x261e('0x19'),_0x4f3256);logger['debug']('CreateSquareReport',_0x4f3256,JSON[_0x261e('0x13')](_0x235afe));_0x4e94a9(_0x235afe);})['catch'](function(_0x342da4){logger['error'](_0x261e('0x19'),_0x342da4[_0x261e('0x16')],_0x4f3256);_0x2de7fe(_0x1c2908[_0x261e('0x14')](0x1f4,_0x342da4[_0x261e('0x16')]));});});};exports['UpdateSquareReport']=function(_0x587f93){var _0x975c91=this;return new Promise(function(_0x250db7,_0x2fa01a){return db[_0x261e('0x1a')][_0x261e('0x1e')](_0x587f93[_0x261e('0x1f')],{'raw':_0x587f93[_0x261e('0x1c')]?_0x587f93[_0x261e('0x1c')][_0x261e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x587f93[_0x261e('0x1c')]?_0x587f93['options']['where']||null:null,'attributes':_0x587f93[_0x261e('0x1c')]?_0x587f93[_0x261e('0x1c')][_0x261e('0x20')]||null:null,'limit':_0x587f93[_0x261e('0x1c')]?_0x587f93[_0x261e('0x1c')][_0x261e('0x21')]||null:null})[_0x261e('0xd')](function(_0x32cfe3){logger[_0x261e('0xe')]('UpdateSquareReport',_0x587f93);logger['debug'](_0x261e('0x22'),_0x587f93,JSON['stringify'](_0x32cfe3));_0x250db7(_0x32cfe3);})[_0x261e('0x18')](function(_0x597120){logger[_0x261e('0x14')](_0x261e('0x22'),_0x597120[_0x261e('0x16')],_0x587f93);_0x2fa01a(_0x975c91[_0x261e('0x14')](0x1f4,_0x597120[_0x261e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 63afbf2..a527149 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x814b,0x1a2));var _0xb814=function(_0x59eacf,_0x56ec4a){_0x59eacf=_0x59eacf-0x0;var _0x5d74f2=_0x814b[_0x59eacf];return _0x5d74f2;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file +var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x344f95,_0x1f4012){var _0x4d19d8=function(_0xfc8a5e){while(--_0xfc8a5e){_0x344f95['push'](_0x344f95['shift']());}};_0x4d19d8(++_0x1f4012);}(_0x7a54,0x106));var _0x47a5=function(_0x4dc8c6,_0x251d41){_0x4dc8c6=_0x4dc8c6-0x0;var _0x3abd55=_0x7a54[_0x4dc8c6];return _0x3abd55;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index fc7a1a0..c2830d7 100644 --- a/server/api/squareReportDetail/squareReportDetail.attributes.js +++ b/server/api/squareReportDetail/squareReportDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8fb=['STRING','TEXT','sequelize','exports'];(function(_0x3c007e,_0x2e6adc){var _0x851f31=function(_0x12bf84){while(--_0x12bf84){_0x3c007e['push'](_0x3c007e['shift']());}};_0x851f31(++_0x2e6adc);}(_0xc8fb,0xb2));var _0xbc8f=function(_0x147146,_0x577969){_0x147146=_0x147146-0x0;var _0xd518a0=_0xc8fb[_0x147146];return _0xd518a0;};'use strict';var Sequelize=require(_0xbc8f('0x0'));module[_0xbc8f('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xbc8f('0x2')]},'data':{'type':Sequelize[_0xbc8f('0x3')]},'project_name':{'type':Sequelize[_0xbc8f('0x2')]},'callerid':{'type':Sequelize[_0xbc8f('0x2')]}}; \ No newline at end of file +var _0x7de9=['TEXT','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7de9,0xa1));var _0x97de=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x7de9[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x97de('0x0'));module[_0x97de('0x1')]={'uniqueid':{'type':Sequelize[_0x97de('0x2')]},'node':{'type':Sequelize[_0x97de('0x2')]},'application':{'type':Sequelize[_0x97de('0x2')]},'data':{'type':Sequelize[_0x97de('0x3')]},'project_name':{'type':Sequelize[_0x97de('0x2')]},'callerid':{'type':Sequelize[_0x97de('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index d168292..88b52a4 100644 --- a/server/api/squareReportDetail/squareReportDetail.controller.js +++ b/server/api/squareReportDetail/squareReportDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf305=['fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','show','params','includeAll','find','catch','create','body','destroy','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','reject','save','update','then','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x550951,_0x3682b8){var _0x1664e6=function(_0x557432){while(--_0x557432){_0x550951['push'](_0x550951['shift']());}};_0x1664e6(++_0x3682b8);}(_0xf305,0xa0));var _0x5f30=function(_0x1d60d0,_0x2cfa88){_0x1d60d0=_0x1d60d0-0x0;var _0x1a0917=_0xf305[_0x1d60d0];return _0x1a0917;};'use strict';var pdf=require(_0x5f30('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5f30('0x1'));var jsonpatch=require(_0x5f30('0x2'));var rp=require(_0x5f30('0x3'));var moment=require(_0x5f30('0x4'));var BPromise=require(_0x5f30('0x5'));var Mustache=require(_0x5f30('0x6'));var util=require('util');var path=require(_0x5f30('0x7'));var sox=require(_0x5f30('0x8'));var csv=require(_0x5f30('0x9'));var ejs=require(_0x5f30('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5f30('0xb'));var deskjs=require(_0x5f30('0xc'));var toCsv=require(_0x5f30('0x9'));var querystring=require(_0x5f30('0xd'));var Papa=require(_0x5f30('0xe'));var Redis=require(_0x5f30('0xf'));var authService=require(_0x5f30('0x10'));var qs=require(_0x5f30('0x11'));var as=require(_0x5f30('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f30('0x13'))('api');var utils=require(_0x5f30('0x14'));var config=require('../../config/environment');var db=require(_0x5f30('0x15'))['db'];function respondWithStatusCode(_0x3f8b8e,_0x20e4e5){_0x20e4e5=_0x20e4e5||0xcc;return function(_0x8f7990){if(_0x8f7990){return _0x3f8b8e[_0x5f30('0x16')](_0x20e4e5);}return _0x3f8b8e[_0x5f30('0x17')](_0x20e4e5)['end']();};}function respondWithResult(_0x400ec6,_0x1f897a){_0x1f897a=_0x1f897a||0xc8;return function(_0x3694ba){if(_0x3694ba){return _0x400ec6[_0x5f30('0x17')](_0x1f897a)[_0x5f30('0x18')](_0x3694ba);}};}function respondWithFilteredResult(_0x3a8818,_0x4aed4d){return function(_0x3fe53e){if(_0x3fe53e){var _0x16f3f5=_0x3fe53e[_0x5f30('0x19')],_0x5335fd=_0x4aed4d[_0x5f30('0x1a')],_0x455cb8=_0x4aed4d[_0x5f30('0x1a')]+_0x4aed4d[_0x5f30('0x1b')],_0x3a6f14;if(_0x455cb8>=_0x16f3f5){_0x455cb8=_0x16f3f5;_0x3a6f14=0xc8;}else{_0x3a6f14=0xce;}_0x3a8818[_0x5f30('0x17')](_0x3a6f14);return _0x3a8818[_0x5f30('0x1c')]('Content-Range',_0x5335fd+'-'+_0x455cb8+'/'+_0x16f3f5)[_0x5f30('0x18')](_0x3fe53e);}return null;};}function patchUpdates(_0x5a79ae){return function(_0x2197e2){try{jsonpatch['apply'](_0x2197e2,_0x5a79ae,!![]);}catch(_0x8c601f){return BPromise[_0x5f30('0x1d')](_0x8c601f);}return _0x2197e2[_0x5f30('0x1e')]();};}function saveUpdates(_0x2bdf82,_0x5e261c){return function(_0x440db1){if(_0x440db1){return _0x440db1[_0x5f30('0x1f')](_0x2bdf82)[_0x5f30('0x20')](function(_0x52bcb2){return _0x52bcb2;});}return null;};}function removeEntity(_0x26c1c7,_0x26c997){return function(_0x59aa64){if(_0x59aa64){return _0x59aa64['destroy']()[_0x5f30('0x20')](function(){_0x26c1c7[_0x5f30('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2887ca,_0x5db242){return function(_0x1c3204){if(!_0x1c3204){_0x2887ca['sendStatus'](0x194);}return _0x1c3204;};}function handleError(_0x4dd6c,_0x5b93d7){_0x5b93d7=_0x5b93d7||0x1f4;return function(_0x6e9ced){logger['error'](_0x6e9ced['stack']);if(_0x6e9ced['name']){delete _0x6e9ced[_0x5f30('0x21')];}_0x4dd6c['status'](_0x5b93d7)[_0x5f30('0x22')](_0x6e9ced);};}exports[_0x5f30('0x23')]=function(_0x2d1544,_0x2a48d9){var _0x378bcd={},_0x5ba30d={},_0x46c643={'count':0x0,'rows':[]};var _0xef8139=_['map'](db[_0x5f30('0x24')][_0x5f30('0x25')],function(_0x4214c4){return{'name':_0x4214c4[_0x5f30('0x26')],'type':_0x4214c4[_0x5f30('0x27')][_0x5f30('0x28')]};});_0x5ba30d[_0x5f30('0x29')]=_[_0x5f30('0x2a')](_0xef8139,_0x5f30('0x21'));_0x5ba30d[_0x5f30('0x2b')]=_[_0x5f30('0x2c')](_0x2d1544[_0x5f30('0x2b')]);_0x5ba30d[_0x5f30('0x2d')]=_[_0x5f30('0x2e')](_0x5ba30d[_0x5f30('0x29')],_0x5ba30d[_0x5f30('0x2b')]);_0x378bcd['attributes']=_[_0x5f30('0x2e')](_0x5ba30d['model'],qs[_0x5f30('0x2f')](_0x2d1544['query'][_0x5f30('0x2f')]));_0x378bcd[_0x5f30('0x30')]=_0x378bcd[_0x5f30('0x30')][_0x5f30('0x31')]?_0x378bcd[_0x5f30('0x30')]:_0x5ba30d[_0x5f30('0x29')];if(!_0x2d1544['query']['hasOwnProperty'](_0x5f30('0x32'))){_0x378bcd[_0x5f30('0x1b')]=qs[_0x5f30('0x1b')](_0x2d1544[_0x5f30('0x2b')][_0x5f30('0x1b')]);_0x378bcd[_0x5f30('0x1a')]=qs[_0x5f30('0x1a')](_0x2d1544[_0x5f30('0x2b')]['offset']);}_0x378bcd[_0x5f30('0x33')]=qs[_0x5f30('0x34')](_0x2d1544[_0x5f30('0x2b')][_0x5f30('0x34')]);_0x378bcd[_0x5f30('0x35')]=qs[_0x5f30('0x2d')](_[_0x5f30('0x36')](_0x2d1544[_0x5f30('0x2b')],_0x5ba30d[_0x5f30('0x2d')]));if(_0x2d1544[_0x5f30('0x2b')][_0x5f30('0x37')]){_0x378bcd[_0x5f30('0x35')]=_[_0x5f30('0x38')](_0x378bcd[_0x5f30('0x35')],{'$or':_[_0x5f30('0x2a')](_0xef8139,function(_0x302c75){if(_0x302c75[_0x5f30('0x27')]!=='VIRTUAL'){var _0x5f246c={};_0x5f246c[_0x302c75[_0x5f30('0x21')]]={'$like':'%'+_0x2d1544[_0x5f30('0x2b')][_0x5f30('0x37')]+'%'};return _0x5f246c;}})});}_0x378bcd=_[_0x5f30('0x38')]({},_0x378bcd,_0x2d1544[_0x5f30('0x39')]);var _0x4165b5={'where':_0x378bcd[_0x5f30('0x35')]};return db['SquareDetailsReport']['count'](_0x4165b5)[_0x5f30('0x20')](function(_0x51a941){_0x46c643['count']=_0x51a941;if(_0x2d1544[_0x5f30('0x2b')]['includeAll']){_0x378bcd[_0x5f30('0x3a')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x378bcd);})[_0x5f30('0x20')](function(_0x49aa28){_0x46c643[_0x5f30('0x3b')]=_0x49aa28;return _0x46c643;})[_0x5f30('0x20')](respondWithFilteredResult(_0x2a48d9,_0x378bcd))['catch'](handleError(_0x2a48d9,null));};exports[_0x5f30('0x3c')]=function(_0x41df83,_0xd758bf){var _0x10f751={'raw':!![],'where':{'id':_0x41df83[_0x5f30('0x3d')]['id']}},_0x2e63fd={};_0x2e63fd[_0x5f30('0x29')]=_[_0x5f30('0x2c')](db[_0x5f30('0x24')]['rawAttributes']);_0x2e63fd['query']=_[_0x5f30('0x2c')](_0x41df83[_0x5f30('0x2b')]);_0x2e63fd[_0x5f30('0x2d')]=_[_0x5f30('0x2e')](_0x2e63fd[_0x5f30('0x29')],_0x2e63fd[_0x5f30('0x2b')]);_0x10f751[_0x5f30('0x30')]=_[_0x5f30('0x2e')](_0x2e63fd[_0x5f30('0x29')],qs[_0x5f30('0x2f')](_0x41df83[_0x5f30('0x2b')]['fields']));_0x10f751[_0x5f30('0x30')]=_0x10f751['attributes'][_0x5f30('0x31')]?_0x10f751[_0x5f30('0x30')]:_0x2e63fd[_0x5f30('0x29')];if(_0x41df83['query'][_0x5f30('0x3e')]){_0x10f751[_0x5f30('0x3a')]=[{'all':!![]}];}_0x10f751=_['merge']({},_0x10f751,_0x41df83[_0x5f30('0x39')]);return db['SquareDetailsReport'][_0x5f30('0x3f')](_0x10f751)[_0x5f30('0x20')](handleEntityNotFound(_0xd758bf,null))[_0x5f30('0x20')](respondWithResult(_0xd758bf,null))[_0x5f30('0x40')](handleError(_0xd758bf,null));};exports[_0x5f30('0x41')]=function(_0x22cd66,_0x5762a4){return db[_0x5f30('0x24')][_0x5f30('0x41')](_0x22cd66[_0x5f30('0x42')],{})[_0x5f30('0x20')](respondWithResult(_0x5762a4,0xc9))[_0x5f30('0x40')](handleError(_0x5762a4,null));};exports[_0x5f30('0x1f')]=function(_0x220414,_0xed0eb4){if(_0x220414[_0x5f30('0x42')]['id']){delete _0x220414[_0x5f30('0x42')]['id'];}return db[_0x5f30('0x24')][_0x5f30('0x3f')]({'where':{'id':_0x220414[_0x5f30('0x3d')]['id']}})['then'](handleEntityNotFound(_0xed0eb4,null))[_0x5f30('0x20')](saveUpdates(_0x220414[_0x5f30('0x42')],null))[_0x5f30('0x20')](respondWithResult(_0xed0eb4,null))['catch'](handleError(_0xed0eb4,null));};exports[_0x5f30('0x43')]=function(_0x29e8d1,_0x521869){return db[_0x5f30('0x24')][_0x5f30('0x3f')]({'where':{'id':_0x29e8d1[_0x5f30('0x3d')]['id']}})[_0x5f30('0x20')](handleEntityNotFound(_0x521869,null))[_0x5f30('0x20')](removeEntity(_0x521869,null))[_0x5f30('0x40')](handleError(_0x521869,null));};exports[_0x5f30('0x44')]=function(_0x5e978d,_0x2ffc4f){return db[_0x5f30('0x24')][_0x5f30('0x44')]()['then'](respondWithResult(_0x2ffc4f,null))['catch'](handleError(_0x2ffc4f,null));}; \ No newline at end of file +var _0x37c6=['fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','limit','Content-Range','json','apply','update','then','destroy','end','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','query','filters','attributes','intersection','model','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','params','keys','fields','catch','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0xfc5a04,_0xb77332){var _0x24b690=function(_0x544d54){while(--_0x544d54){_0xfc5a04['push'](_0xfc5a04['shift']());}};_0x24b690(++_0xb77332);}(_0x37c6,0x8d));var _0x637c=function(_0xd16ea7,_0x403ab5){_0xd16ea7=_0xd16ea7-0x0;var _0x593b0a=_0x37c6[_0xd16ea7];return _0x593b0a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x637c('0x0'));var rimraf=require(_0x637c('0x1'));var zipdir=require(_0x637c('0x2'));var jsonpatch=require(_0x637c('0x3'));var rp=require(_0x637c('0x4'));var moment=require('moment');var BPromise=require(_0x637c('0x5'));var Mustache=require(_0x637c('0x6'));var util=require(_0x637c('0x7'));var path=require('path');var sox=require(_0x637c('0x8'));var csv=require(_0x637c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x637c('0xa'));var squel=require(_0x637c('0xb'));var crypto=require(_0x637c('0xc'));var jsforce=require(_0x637c('0xd'));var deskjs=require(_0x637c('0xe'));var toCsv=require(_0x637c('0x9'));var querystring=require(_0x637c('0xf'));var Papa=require(_0x637c('0x10'));var Redis=require(_0x637c('0x11'));var authService=require(_0x637c('0x12'));var qs=require(_0x637c('0x13'));var as=require(_0x637c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x637c('0x15'))(_0x637c('0x16'));var utils=require(_0x637c('0x17'));var config=require(_0x637c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x99a5e4,_0x55fc7e){_0x55fc7e=_0x55fc7e||0xcc;return function(_0x5e5723){if(_0x5e5723){return _0x99a5e4[_0x637c('0x19')](_0x55fc7e);}return _0x99a5e4[_0x637c('0x1a')](_0x55fc7e)['end']();};}function respondWithResult(_0x9696e,_0x243f2b){_0x243f2b=_0x243f2b||0xc8;return function(_0x2131d8){if(_0x2131d8){return _0x9696e[_0x637c('0x1a')](_0x243f2b)['json'](_0x2131d8);}};}function respondWithFilteredResult(_0x45d263,_0x2bda17){return function(_0x1ac082){if(_0x1ac082){var _0x422a1f=_0x1ac082['count'],_0x5b88f0=_0x2bda17[_0x637c('0x1b')],_0x1cd5ab=_0x2bda17[_0x637c('0x1b')]+_0x2bda17[_0x637c('0x1c')],_0xbdb168;if(_0x1cd5ab>=_0x422a1f){_0x1cd5ab=_0x422a1f;_0xbdb168=0xc8;}else{_0xbdb168=0xce;}_0x45d263[_0x637c('0x1a')](_0xbdb168);return _0x45d263['set'](_0x637c('0x1d'),_0x5b88f0+'-'+_0x1cd5ab+'/'+_0x422a1f)[_0x637c('0x1e')](_0x1ac082);}return null;};}function patchUpdates(_0x597f2f){return function(_0x53f037){try{jsonpatch[_0x637c('0x1f')](_0x53f037,_0x597f2f,!![]);}catch(_0x2580c9){return BPromise['reject'](_0x2580c9);}return _0x53f037['save']();};}function saveUpdates(_0x49327f,_0x345be8){return function(_0x187cf0){if(_0x187cf0){return _0x187cf0[_0x637c('0x20')](_0x49327f)[_0x637c('0x21')](function(_0x854d44){return _0x854d44;});}return null;};}function removeEntity(_0x438fd1,_0x529b63){return function(_0x3ea90a){if(_0x3ea90a){return _0x3ea90a[_0x637c('0x22')]()[_0x637c('0x21')](function(){_0x438fd1[_0x637c('0x1a')](0xcc)[_0x637c('0x23')]();});}};}function handleEntityNotFound(_0x4d1627,_0x559918){return function(_0x5127ee){if(!_0x5127ee){_0x4d1627['sendStatus'](0x194);}return _0x5127ee;};}function handleError(_0x17d69d,_0x371041){_0x371041=_0x371041||0x1f4;return function(_0x48dc15){logger[_0x637c('0x24')](_0x48dc15[_0x637c('0x25')]);if(_0x48dc15['name']){delete _0x48dc15[_0x637c('0x26')];}_0x17d69d[_0x637c('0x1a')](_0x371041)[_0x637c('0x27')](_0x48dc15);};}exports[_0x637c('0x28')]=function(_0x45cdc0,_0x1b64d0){var _0x1a2a54={},_0x2abecf={},_0x304d82={'count':0x0,'rows':[]};var _0x4f1146=_[_0x637c('0x29')](db[_0x637c('0x2a')][_0x637c('0x2b')],function(_0x2c6db7){return{'name':_0x2c6db7['fieldName'],'type':_0x2c6db7[_0x637c('0x2c')][_0x637c('0x2d')]};});_0x2abecf['model']=_['map'](_0x4f1146,'name');_0x2abecf[_0x637c('0x2e')]=_['keys'](_0x45cdc0['query']);_0x2abecf[_0x637c('0x2f')]=_['intersection'](_0x2abecf['model'],_0x2abecf['query']);_0x1a2a54[_0x637c('0x30')]=_[_0x637c('0x31')](_0x2abecf[_0x637c('0x32')],qs['fields'](_0x45cdc0[_0x637c('0x2e')]['fields']));_0x1a2a54['attributes']=_0x1a2a54['attributes'][_0x637c('0x33')]?_0x1a2a54['attributes']:_0x2abecf[_0x637c('0x32')];if(!_0x45cdc0[_0x637c('0x2e')]['hasOwnProperty'](_0x637c('0x34'))){_0x1a2a54[_0x637c('0x1c')]=qs[_0x637c('0x1c')](_0x45cdc0[_0x637c('0x2e')]['limit']);_0x1a2a54['offset']=qs[_0x637c('0x1b')](_0x45cdc0['query'][_0x637c('0x1b')]);}_0x1a2a54['order']=qs['sort'](_0x45cdc0[_0x637c('0x2e')][_0x637c('0x35')]);_0x1a2a54['where']=qs[_0x637c('0x2f')](_[_0x637c('0x36')](_0x45cdc0['query'],_0x2abecf[_0x637c('0x2f')]));if(_0x45cdc0[_0x637c('0x2e')][_0x637c('0x37')]){_0x1a2a54[_0x637c('0x38')]=_[_0x637c('0x39')](_0x1a2a54['where'],{'$or':_[_0x637c('0x29')](_0x4f1146,function(_0x1fcb06){if(_0x1fcb06['type']!==_0x637c('0x3a')){var _0x39fe3e={};_0x39fe3e[_0x1fcb06[_0x637c('0x26')]]={'$like':'%'+_0x45cdc0[_0x637c('0x2e')]['filter']+'%'};return _0x39fe3e;}})});}_0x1a2a54=_['merge']({},_0x1a2a54,_0x45cdc0[_0x637c('0x3b')]);var _0x3c48bc={'where':_0x1a2a54['where']};return db['SquareDetailsReport'][_0x637c('0x3c')](_0x3c48bc)['then'](function(_0x18f3b7){_0x304d82['count']=_0x18f3b7;if(_0x45cdc0['query']['includeAll']){_0x1a2a54[_0x637c('0x3d')]=[{'all':!![]}];}return db[_0x637c('0x2a')][_0x637c('0x3e')](_0x1a2a54);})[_0x637c('0x21')](function(_0x402bdb){_0x304d82[_0x637c('0x3f')]=_0x402bdb;return _0x304d82;})['then'](respondWithFilteredResult(_0x1b64d0,_0x1a2a54))['catch'](handleError(_0x1b64d0,null));};exports['show']=function(_0x3f7a0c,_0x5aa700){var _0x47a311={'raw':!![],'where':{'id':_0x3f7a0c[_0x637c('0x40')]['id']}},_0x338aae={};_0x338aae[_0x637c('0x32')]=_['keys'](db[_0x637c('0x2a')][_0x637c('0x2b')]);_0x338aae[_0x637c('0x2e')]=_[_0x637c('0x41')](_0x3f7a0c[_0x637c('0x2e')]);_0x338aae[_0x637c('0x2f')]=_[_0x637c('0x31')](_0x338aae[_0x637c('0x32')],_0x338aae[_0x637c('0x2e')]);_0x47a311[_0x637c('0x30')]=_[_0x637c('0x31')](_0x338aae[_0x637c('0x32')],qs['fields'](_0x3f7a0c[_0x637c('0x2e')][_0x637c('0x42')]));_0x47a311[_0x637c('0x30')]=_0x47a311['attributes'][_0x637c('0x33')]?_0x47a311[_0x637c('0x30')]:_0x338aae[_0x637c('0x32')];if(_0x3f7a0c[_0x637c('0x2e')]['includeAll']){_0x47a311['include']=[{'all':!![]}];}_0x47a311=_[_0x637c('0x39')]({},_0x47a311,_0x3f7a0c['options']);return db[_0x637c('0x2a')]['find'](_0x47a311)[_0x637c('0x21')](handleEntityNotFound(_0x5aa700,null))[_0x637c('0x21')](respondWithResult(_0x5aa700,null))[_0x637c('0x43')](handleError(_0x5aa700,null));};exports[_0x637c('0x44')]=function(_0x141c84,_0x15d945){return db[_0x637c('0x2a')][_0x637c('0x44')](_0x141c84[_0x637c('0x45')],{})[_0x637c('0x21')](respondWithResult(_0x15d945,0xc9))['catch'](handleError(_0x15d945,null));};exports[_0x637c('0x20')]=function(_0x1f1a97,_0x460b3d){if(_0x1f1a97[_0x637c('0x45')]['id']){delete _0x1f1a97[_0x637c('0x45')]['id'];}return db[_0x637c('0x2a')][_0x637c('0x46')]({'where':{'id':_0x1f1a97[_0x637c('0x40')]['id']}})[_0x637c('0x21')](handleEntityNotFound(_0x460b3d,null))[_0x637c('0x21')](saveUpdates(_0x1f1a97[_0x637c('0x45')],null))[_0x637c('0x21')](respondWithResult(_0x460b3d,null))[_0x637c('0x43')](handleError(_0x460b3d,null));};exports[_0x637c('0x22')]=function(_0x52aed4,_0x1bc334){return db[_0x637c('0x2a')][_0x637c('0x46')]({'where':{'id':_0x52aed4['params']['id']}})[_0x637c('0x21')](handleEntityNotFound(_0x1bc334,null))[_0x637c('0x21')](removeEntity(_0x1bc334,null))[_0x637c('0x43')](handleError(_0x1bc334,null));};exports['describe']=function(_0x18dc14,_0x279b51){return db[_0x637c('0x2a')][_0x637c('0x47')]()[_0x637c('0x21')](respondWithResult(_0x279b51,null))[_0x637c('0x43')](handleError(_0x279b51,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 2a88491..3de56eb 100644 --- a/server/api/squareReportDetail/squareReportDetail.model.js +++ b/server/api/squareReportDetail/squareReportDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf10f=['request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird'];(function(_0x5027b1,_0x6c2346){var _0x5ef581=function(_0xb14398){while(--_0xb14398){_0x5027b1['push'](_0x5027b1['shift']());}};_0x5ef581(++_0x6c2346);}(_0xf10f,0x15a));var _0xff10=function(_0x3e9b5c,_0xc0b8d5){_0x3e9b5c=_0x3e9b5c-0x0;var _0x458ce0=_0xf10f[_0x3e9b5c];return _0x458ce0;};'use strict';var _=require(_0xff10('0x0'));var util=require(_0xff10('0x1'));var logger=require(_0xff10('0x2'))(_0xff10('0x3'));var moment=require('moment');var BPromise=require(_0xff10('0x4'));var rp=require(_0xff10('0x5'));var fs=require('fs');var path=require(_0xff10('0x6'));var rimraf=require('rimraf');var config=require(_0xff10('0x7'));var attributes=require(_0xff10('0x8'));module[_0xff10('0x9')]=function(_0x5d5912,_0x3c823b){return _0x5d5912[_0xff10('0xa')](_0xff10('0xb'),attributes,{'tableName':_0xff10('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96e8=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger'];(function(_0x212d36,_0x5a7fc7){var _0x1b3531=function(_0x3ccb0c){while(--_0x3ccb0c){_0x212d36['push'](_0x212d36['shift']());}};_0x1b3531(++_0x5a7fc7);}(_0x96e8,0x99));var _0x896e=function(_0xa57f04,_0x4d2384){_0xa57f04=_0xa57f04-0x0;var _0x331422=_0x96e8[_0xa57f04];return _0x331422;};'use strict';var _=require(_0x896e('0x0'));var util=require(_0x896e('0x1'));var logger=require(_0x896e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x896e('0x3'));var rp=require(_0x896e('0x4'));var fs=require('fs');var path=require(_0x896e('0x5'));var rimraf=require(_0x896e('0x6'));var config=require(_0x896e('0x7'));var attributes=require(_0x896e('0x8'));module[_0x896e('0x9')]=function(_0x38f8d3,_0x535783){return _0x38f8d3[_0x896e('0xa')](_0x896e('0xb'),attributes,{'tableName':_0x896e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index fcb7fd9..0dae584 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd65=['message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x453c87,_0x3edf3b){var _0x1dc930=function(_0x16f716){while(--_0x16f716){_0x453c87['push'](_0x453c87['shift']());}};_0x1dc930(++_0x3edf3b);}(_0xcd65,0x1aa));var _0x5cd6=function(_0x206338,_0x2d800b){_0x206338=_0x206338-0x0;var _0x2b87f2=_0xcd65[_0x206338];return _0x2b87f2;};'use strict';var _=require(_0x5cd6('0x0'));var util=require(_0x5cd6('0x1'));var moment=require(_0x5cd6('0x2'));var BPromise=require(_0x5cd6('0x3'));var rs=require(_0x5cd6('0x4'));var fs=require('fs');var Redis=require(_0x5cd6('0x5'));var db=require(_0x5cd6('0x6'))['db'];var utils=require(_0x5cd6('0x7'));var logger=require(_0x5cd6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5cd6('0x9')][_0x5cd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7c3a,_0x204062,_0x4f289c){return new BPromise(function(_0x114ee0,_0xfcec04){return client[_0x5cd6('0xb')](_0x3f7c3a,_0x4f289c)['then'](function(_0xce323c){logger['info'](_0x5cd6('0xc'),_0x204062,_0x5cd6('0xd'));logger['debug'](_0x5cd6('0xe'),_0x204062,_0x5cd6('0xd'),JSON['stringify'](_0xce323c));if(_0xce323c[_0x5cd6('0xf')]){if(_0xce323c[_0x5cd6('0xf')]['code']===0x1f4){logger['error'](_0x5cd6('0xc'),_0x204062,_0xce323c[_0x5cd6('0xf')]['message']);return _0xfcec04(_0xce323c['error'][_0x5cd6('0x10')]);}logger[_0x5cd6('0xf')](_0x5cd6('0xc'),_0x204062,_0xce323c[_0x5cd6('0xf')][_0x5cd6('0x10')]);return _0x114ee0(_0xce323c[_0x5cd6('0xf')]['message']);}else{logger[_0x5cd6('0x11')](_0x5cd6('0xc'),_0x204062,_0x5cd6('0xd'));_0x114ee0(_0xce323c[_0x5cd6('0x12')][_0x5cd6('0x10')]);}})[_0x5cd6('0x13')](function(_0x59b759){logger[_0x5cd6('0xf')](_0x5cd6('0xc'),_0x204062,_0x59b759);_0xfcec04(_0x59b759);});});}exports[_0x5cd6('0x14')]=function(_0x4d52e9){var _0x423e01=this;return new Promise(function(_0x3e8479,_0x36fe19){return db[_0x5cd6('0x15')][_0x5cd6('0x16')](_0x4d52e9['body'],{'raw':_0x4d52e9[_0x5cd6('0x17')]?_0x4d52e9['options']['raw']===undefined?!![]:![]:!![]})[_0x5cd6('0x18')](function(_0x3cae86){logger[_0x5cd6('0x11')](_0x5cd6('0x14'),_0x4d52e9);logger['debug']('CreateSquareDetailsReport',_0x4d52e9,JSON[_0x5cd6('0x19')](_0x3cae86));_0x3e8479(_0x3cae86);})[_0x5cd6('0x13')](function(_0x59f522){logger[_0x5cd6('0xf')]('CreateSquareDetailsReport',_0x59f522[_0x5cd6('0x10')],_0x4d52e9);_0x36fe19(_0x423e01['error'](0x1f4,_0x59f522['message']));});});}; \ No newline at end of file +var _0x37ce=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','catch','lodash'];(function(_0x5edbd5,_0x1557e6){var _0x489145=function(_0x3ae457){while(--_0x3ae457){_0x5edbd5['push'](_0x5edbd5['shift']());}};_0x489145(++_0x1557e6);}(_0x37ce,0x1df));var _0xe37c=function(_0x973376,_0x43e8db){_0x973376=_0x973376-0x0;var _0x4abe8d=_0x37ce[_0x973376];return _0x4abe8d;};'use strict';var _=require(_0xe37c('0x0'));var util=require('util');var moment=require(_0xe37c('0x1'));var BPromise=require(_0xe37c('0x2'));var rs=require(_0xe37c('0x3'));var fs=require('fs');var Redis=require(_0xe37c('0x4'));var db=require(_0xe37c('0x5'))['db'];var utils=require(_0xe37c('0x6'));var logger=require('../../config/logger')(_0xe37c('0x7'));var config=require(_0xe37c('0x8'));var jayson=require(_0xe37c('0x9'));var client=jayson[_0xe37c('0xa')][_0xe37c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf540d2,_0x5c242e,_0x4d3ad1){return new BPromise(function(_0x37d009,_0x5025c){return client[_0xe37c('0xc')](_0xf540d2,_0x4d3ad1)[_0xe37c('0xd')](function(_0x24c427){logger[_0xe37c('0xe')](_0xe37c('0xf'),_0x5c242e,_0xe37c('0x10'));logger[_0xe37c('0x11')](_0xe37c('0x12'),_0x5c242e,_0xe37c('0x10'),JSON[_0xe37c('0x13')](_0x24c427));if(_0x24c427[_0xe37c('0x14')]){if(_0x24c427['error'][_0xe37c('0x15')]===0x1f4){logger[_0xe37c('0x14')](_0xe37c('0xf'),_0x5c242e,_0x24c427[_0xe37c('0x14')][_0xe37c('0x16')]);return _0x5025c(_0x24c427[_0xe37c('0x14')][_0xe37c('0x16')]);}logger[_0xe37c('0x14')](_0xe37c('0xf'),_0x5c242e,_0x24c427['error'][_0xe37c('0x16')]);return _0x37d009(_0x24c427[_0xe37c('0x14')][_0xe37c('0x16')]);}else{logger[_0xe37c('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x5c242e,_0xe37c('0x10'));_0x37d009(_0x24c427[_0xe37c('0x17')][_0xe37c('0x16')]);}})['catch'](function(_0x2d9ac1){logger[_0xe37c('0x14')](_0xe37c('0xf'),_0x5c242e,_0x2d9ac1);_0x5025c(_0x2d9ac1);});});}exports[_0xe37c('0x18')]=function(_0x530a18){var _0x104047=this;return new Promise(function(_0x5d4a40,_0x211be1){return db[_0xe37c('0x19')]['create'](_0x530a18[_0xe37c('0x1a')],{'raw':_0x530a18[_0xe37c('0x1b')]?_0x530a18[_0xe37c('0x1b')][_0xe37c('0x1c')]===undefined?!![]:![]:!![]})[_0xe37c('0xd')](function(_0x3e6902){logger['info']('CreateSquareDetailsReport',_0x530a18);logger['debug']('CreateSquareDetailsReport',_0x530a18,JSON[_0xe37c('0x13')](_0x3e6902));_0x5d4a40(_0x3e6902);})[_0xe37c('0x1d')](function(_0x59309c){logger['error'](_0xe37c('0x18'),_0x59309c['message'],_0x530a18);_0x211be1(_0x104047['error'](0x1f4,_0x59309c[_0xe37c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c0e5138..58b497f 100644 --- a/server/api/system/index.js +++ b/server/api/system/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe852=['Router','../../components/auth/service','./system.controller','isAuthenticated','index','get','/process/:pid/kill','killProcess','exports'];(function(_0x21d6fa,_0x5e623a){var _0x405b62=function(_0x54f24a){while(--_0x54f24a){_0x21d6fa['push'](_0x21d6fa['shift']());}};_0x405b62(++_0x5e623a);}(_0xe852,0x99));var _0x2e85=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe852[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x2e85('0x0')]();var auth=require(_0x2e85('0x1'));var controller=require(_0x2e85('0x2'));router['get']('/',auth[_0x2e85('0x3')](),controller[_0x2e85('0x4')]);router[_0x2e85('0x5')](_0x2e85('0x6'),auth[_0x2e85('0x3')](),controller[_0x2e85('0x7')]);module[_0x2e85('0x8')]=router; \ No newline at end of file +var _0x7ac7=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','express','../../components/auth/service'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7ac7,0x12e));var _0x77ac=function(_0x1a8f3e,_0x527709){_0x1a8f3e=_0x1a8f3e-0x0;var _0x342fe1=_0x7ac7[_0x1a8f3e];return _0x342fe1;};'use strict';var express=require(_0x77ac('0x0'));var router=express['Router']();var auth=require(_0x77ac('0x1'));var controller=require(_0x77ac('0x2'));router[_0x77ac('0x3')]('/',auth[_0x77ac('0x4')](),controller[_0x77ac('0x5')]);router['get'](_0x77ac('0x6'),auth[_0x77ac('0x4')](),controller['killProcess']);module[_0x77ac('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 0d21cbf..2dcdeff 100644 --- a/server/api/system/system.controller.js +++ b/server/api/system/system.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa994=['api','util','error','inspect','name','status','send','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xa994,0x150));var _0x4a99=function(_0x3a1f76,_0x39fc11){_0x3a1f76=_0x3a1f76-0x0;var _0x53bc34=_0xa994[_0x3a1f76];return _0x53bc34;};'use strict';var info=require('systeminformation');var exec=require(_0x4a99('0x0'))['exec'];var logger=require(_0x4a99('0x1'))(_0x4a99('0x2'));var util=require(_0x4a99('0x3'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x13a49c,_0xe3731d,_0xbfb991){_0xe3731d=_0xe3731d||0x1f4;return function(_0x2786f8){logger[_0x4a99('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0xbfb991,_0xe3731d,util[_0x4a99('0x5')](_0x2786f8,{'showHidden':![],'depth':null}));delete _0x2786f8[_0x4a99('0x6')];_0x13a49c[_0x4a99('0x7')](_0xe3731d)[_0x4a99('0x8')](_0x2786f8);};}exports[_0x4a99('0x9')]=function(_0x5c135e,_0xc16cf8){return info[_0x4a99('0xa')]()['then'](function(_0xb9ae0b){return _0xc16cf8[_0x4a99('0x7')](0xc8)[_0x4a99('0xb')](_0xb9ae0b);})[_0x4a99('0xc')](function(_0x37ce9b){return _0xc16cf8[_0x4a99('0x7')](0x1f4)[_0x4a99('0xb')](_0x37ce9b);});};exports[_0x4a99('0xd')]=function(_0xf737c8,_0x2df341){var _0x440024=[_0x4a99('0xe')];return new BPromise(function(_0x2a1c53,_0x1cbd82){return exec(util[_0x4a99('0xf')](_0x4a99('0x10'),_0xf737c8[_0x4a99('0x11')][_0x4a99('0x12')]),function(_0x3712bd,_0x4668db,_0x225f5a){if(_0x3712bd){return _0x1cbd82(_0x3712bd);}return _0x2a1c53(_0x4668db);});})[_0x4a99('0x13')](function(_0x1d7861){var _0x257df7=![];var _0x816ef6=_0x1d7861['split'](/\n/);for(var _0x445733=0x0,_0x49090e=_0x440024[_0x4a99('0x14')];_0x445733<_0x49090e,_0x257df7===![];_0x445733+=0x1){if(_0x1d7861[_0x4a99('0x15')](_0x440024[_0x445733])>=0x0){_0x257df7=!![];}}if(!_0x257df7){throw new Error(util[_0x4a99('0xf')](_0x4a99('0x16'),_0xf737c8[_0x4a99('0x11')][_0x4a99('0x12')]));}process[_0x4a99('0x17')](_0xf737c8[_0x4a99('0x11')][_0x4a99('0x12')],_0x4a99('0x18'));return _0x2df341['status'](0xc8)[_0x4a99('0xb')]({'message':util[_0x4a99('0xf')](_0x4a99('0x19'),_0xf737c8[_0x4a99('0x11')]['pid'])});})[_0x4a99('0xc')](handleError(_0x2df341,null,_0x4a99('0xd')));}; \ No newline at end of file +var _0xc7dd=['catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','then','json'];(function(_0x44b1c8,_0x2e9965){var _0x2cc9b4=function(_0x174bcb){while(--_0x174bcb){_0x44b1c8['push'](_0x44b1c8['shift']());}};_0x2cc9b4(++_0x2e9965);}(_0xc7dd,0x15d));var _0xdc7d=function(_0x58a1ef,_0x4938cd){_0x58a1ef=_0x58a1ef-0x0;var _0x384e65=_0xc7dd[_0x58a1ef];return _0x384e65;};'use strict';var info=require(_0xdc7d('0x0'));var exec=require(_0xdc7d('0x1'))['exec'];var logger=require(_0xdc7d('0x2'))('api');var util=require('util');var BPromise=require(_0xdc7d('0x3'));var _=require(_0xdc7d('0x4'));function handleError(_0x4bc843,_0x24f3e7,_0x84a50){_0x24f3e7=_0x24f3e7||0x1f4;return function(_0x4899aa){logger['error'](_0xdc7d('0x5'),_0x84a50,_0x24f3e7,util['inspect'](_0x4899aa,{'showHidden':![],'depth':null}));delete _0x4899aa[_0xdc7d('0x6')];_0x4bc843[_0xdc7d('0x7')](_0x24f3e7)[_0xdc7d('0x8')](_0x4899aa);};}exports['index']=function(_0x344af3,_0x3ba1ea){return info['getAllData']()[_0xdc7d('0x9')](function(_0x24143d){return _0x3ba1ea['status'](0xc8)[_0xdc7d('0xa')](_0x24143d);})[_0xdc7d('0xb')](function(_0x57fb77){return _0x3ba1ea['status'](0x1f4)[_0xdc7d('0xa')](_0x57fb77);});};exports[_0xdc7d('0xc')]=function(_0x433ae9,_0x10cd67){var _0x5b44a5=[_0xdc7d('0xd')];return new BPromise(function(_0x2d0ee5,_0x30b3f7){return exec(util[_0xdc7d('0xe')](_0xdc7d('0xf'),_0x433ae9[_0xdc7d('0x10')]['pid']),function(_0x5af088,_0x15e2bf,_0x44ea9c){if(_0x5af088){return _0x30b3f7(_0x5af088);}return _0x2d0ee5(_0x15e2bf);});})[_0xdc7d('0x9')](function(_0x444b18){var _0x2ab485=![];var _0x3953b8=_0x444b18[_0xdc7d('0x11')](/\n/);for(var _0x2fb593=0x0,_0x9f8765=_0x5b44a5[_0xdc7d('0x12')];_0x2fb593<_0x9f8765,_0x2ab485===![];_0x2fb593+=0x1){if(_0x444b18[_0xdc7d('0x13')](_0x5b44a5[_0x2fb593])>=0x0){_0x2ab485=!![];}}if(!_0x2ab485){throw new Error(util[_0xdc7d('0xe')](_0xdc7d('0x14'),_0x433ae9[_0xdc7d('0x10')][_0xdc7d('0x15')]));}process['kill'](_0x433ae9[_0xdc7d('0x10')][_0xdc7d('0x15')],_0xdc7d('0x16'));return _0x10cd67[_0xdc7d('0x7')](0xc8)[_0xdc7d('0xa')]({'message':util[_0xdc7d('0xe')](_0xdc7d('0x17'),_0x433ae9['params']['pid'])});})['catch'](handleError(_0x10cd67,null,_0xdc7d('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 76b4e4a..8f729cf 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put','destroy'];(function(_0x49eba0,_0x5529f2){var _0x24ae08=function(_0x11237a){while(--_0x11237a){_0x49eba0['push'](_0x49eba0['shift']());}};_0x24ae08(++_0x5529f2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x238de2,_0x308e2a){_0x238de2=_0x238de2-0x0;var _0x3e5f59=_0x9bde[_0x238de2];return _0x3e5f59;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var auth=require(_0xe9bd('0x3'));var interaction=require(_0xe9bd('0x4'));var config=require(_0xe9bd('0x5'));var controller=require(_0xe9bd('0x6'));router[_0xe9bd('0x7')]('/',auth[_0xe9bd('0x8')](),controller['index']);router[_0xe9bd('0x7')](_0xe9bd('0x9'),auth[_0xe9bd('0x8')](),controller[_0xe9bd('0xa')]);router[_0xe9bd('0xb')]('/',auth[_0xe9bd('0x8')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0xd')](_0xe9bd('0x9'),auth[_0xe9bd('0x8')](),controller['update']);router['delete'](_0xe9bd('0x9'),auth[_0xe9bd('0x8')](),controller[_0xe9bd('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb821=['post','create','put','update','delete','destroy','exports','util','path','Router','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show'];(function(_0x3adf4e,_0x3b1265){var _0x272cb6=function(_0x34f0b7){while(--_0x34f0b7){_0x3adf4e['push'](_0x3adf4e['shift']());}};_0x272cb6(++_0x3b1265);}(_0xb821,0xa7));var _0x1b82=function(_0x1f20a7,_0x364afc){_0x1f20a7=_0x1f20a7-0x0;var _0x4c5300=_0xb821[_0x1f20a7];return _0x4c5300;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b82('0x3'));var controller=require(_0x1b82('0x4'));router[_0x1b82('0x5')]('/',auth[_0x1b82('0x6')](),controller['index']);router[_0x1b82('0x5')](_0x1b82('0x7'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x8')]);router[_0x1b82('0x9')]('/',auth[_0x1b82('0x6')](),controller[_0x1b82('0xa')]);router[_0x1b82('0xb')](_0x1b82('0x7'),auth['isAuthenticated'](),controller[_0x1b82('0xc')]);router[_0x1b82('0xd')](_0x1b82('0x7'),auth[_0x1b82('0x6')](),controller[_0x1b82('0xe')]);module[_0x1b82('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 8e48567..04a9364 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3423=['name','#0091EA','STRING'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3342('0x0')],'defaultValue':_0x3342('0x2')},'description':{'type':Sequelize[_0x3342('0x0')]}}; \ No newline at end of file +var _0xe5b5=['exports','STRING','name','#0091EA','sequelize'];(function(_0x25f805,_0x59caf3){var _0xf6628f=function(_0x3cb938){while(--_0x3cb938){_0x25f805['push'](_0x25f805['shift']());}};_0xf6628f(++_0x59caf3);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x2baca1,_0x2f3557){_0x2baca1=_0x2baca1-0x0;var _0x9aa62a=_0xe5b5[_0x2baca1];return _0x9aa62a;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'name':{'type':Sequelize[_0x5e5b('0x2')],'unique':_0x5e5b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':_0x5e5b('0x4')},'description':{'type':Sequelize[_0x5e5b('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index da738ed..2ee5a6d 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4030=['role','UserProfileSection','userProfileId','autoAssociation','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','destroy','get','Tags','UserProfileResource','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x9a07d5,_0xa155e1){var _0x414250=function(_0x43e666){while(--_0x43e666){_0x9a07d5['push'](_0x9a07d5['shift']());}};_0x414250(++_0xa155e1);}(_0x4030,0x159));var _0x0403=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x4030[_0x87239];return _0x53af1e;};'use strict';var pdf=require(_0x0403('0x0'));var emlformat=require(_0x0403('0x1'));var rimraf=require(_0x0403('0x2'));var zipdir=require(_0x0403('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0403('0x4'));var moment=require(_0x0403('0x5'));var BPromise=require(_0x0403('0x6'));var Mustache=require(_0x0403('0x7'));var util=require('util');var path=require(_0x0403('0x8'));var sox=require(_0x0403('0x9'));var csv=require(_0x0403('0xa'));var ejs=require(_0x0403('0xb'));var fs=require('fs');var _=require(_0x0403('0xc'));var squel=require('squel');var crypto=require(_0x0403('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0403('0xe'));var toCsv=require(_0x0403('0xa'));var querystring=require(_0x0403('0xf'));var Papa=require(_0x0403('0x10'));var Redis=require(_0x0403('0x11'));var authService=require(_0x0403('0x12'));var qs=require(_0x0403('0x13'));var as=require(_0x0403('0x14'));var hardwareService=require(_0x0403('0x15'));var logger=require(_0x0403('0x16'))('api');var utils=require(_0x0403('0x17'));var config=require('../../config/environment');var db=require(_0x0403('0x18'))['db'];function respondWithStatusCode(_0xb68360,_0x1d0368){_0x1d0368=_0x1d0368||0xcc;return function(_0x224318){if(_0x224318){return _0xb68360[_0x0403('0x19')](_0x1d0368);}return _0xb68360['status'](_0x1d0368)[_0x0403('0x1a')]();};}function respondWithResult(_0x3ad7b7,_0x3396a4){_0x3396a4=_0x3396a4||0xc8;return function(_0x4afee1){if(_0x4afee1){return _0x3ad7b7[_0x0403('0x1b')](_0x3396a4)[_0x0403('0x1c')](_0x4afee1);}};}function respondWithFilteredResult(_0x46048c,_0xbba6db){return function(_0x26bce5){if(_0x26bce5){var _0xecc918=_0x26bce5[_0x0403('0x1d')],_0x2fd5ac=_0xbba6db[_0x0403('0x1e')],_0x105632=_0xbba6db[_0x0403('0x1e')]+_0xbba6db[_0x0403('0x1f')],_0x4ded2b;if(_0x105632>=_0xecc918){_0x105632=_0xecc918;_0x4ded2b=0xc8;}else{_0x4ded2b=0xce;}_0x46048c[_0x0403('0x1b')](_0x4ded2b);return _0x46048c[_0x0403('0x20')]('Content-Range',_0x2fd5ac+'-'+_0x105632+'/'+_0xecc918)['json'](_0x26bce5);}return null;};}function patchUpdates(_0xb0e973){return function(_0x1fade9){try{jsonpatch[_0x0403('0x21')](_0x1fade9,_0xb0e973,!![]);}catch(_0x45115f){return BPromise[_0x0403('0x22')](_0x45115f);}return _0x1fade9[_0x0403('0x23')]();};}function saveUpdates(_0x3c6ac9,_0x210f79){return function(_0x4c4885){if(_0x4c4885){return _0x4c4885['update'](_0x3c6ac9)[_0x0403('0x24')](function(_0x2b68d1){return _0x2b68d1;});}return null;};}function removeEntity(_0x23d944,_0x4ead00){return function(_0xb929b7){if(_0xb929b7){return _0xb929b7[_0x0403('0x25')]()[_0x0403('0x24')](function(){var _0x418cfa=_0xb929b7[_0x0403('0x26')]({'plain':!![]});var _0x4012d5=_0x0403('0x27');return db[_0x0403('0x28')]['destroy']({'where':{'type':_0x4012d5,'resourceId':_0x418cfa['id']}})[_0x0403('0x24')](function(){return _0xb929b7;});})[_0x0403('0x24')](function(){_0x23d944['status'](0xcc)[_0x0403('0x1a')]();});}};}function handleEntityNotFound(_0x30e335,_0x56775e){return function(_0x27f9b5){if(!_0x27f9b5){_0x30e335[_0x0403('0x19')](0x194);}return _0x27f9b5;};}function handleError(_0xfb8bdc,_0x1f0133){_0x1f0133=_0x1f0133||0x1f4;return function(_0x5d651b){logger[_0x0403('0x29')](_0x5d651b[_0x0403('0x2a')]);if(_0x5d651b[_0x0403('0x2b')]){delete _0x5d651b['name'];}_0xfb8bdc['status'](_0x1f0133)['send'](_0x5d651b);};}exports[_0x0403('0x2c')]=function(_0xd39236,_0x63db5f){var _0x76873c={},_0x1ed003={},_0x54d7bd={'count':0x0,'rows':[]};var _0x54f14e=_[_0x0403('0x2d')](db[_0x0403('0x2e')][_0x0403('0x2f')],function(_0x21764e){return{'name':_0x21764e[_0x0403('0x30')],'type':_0x21764e[_0x0403('0x31')][_0x0403('0x32')]};});_0x1ed003[_0x0403('0x33')]=_[_0x0403('0x2d')](_0x54f14e,_0x0403('0x2b'));_0x1ed003[_0x0403('0x34')]=_[_0x0403('0x35')](_0xd39236[_0x0403('0x34')]);_0x1ed003[_0x0403('0x36')]=_[_0x0403('0x37')](_0x1ed003[_0x0403('0x33')],_0x1ed003[_0x0403('0x34')]);_0x76873c[_0x0403('0x38')]=_[_0x0403('0x37')](_0x1ed003['model'],qs[_0x0403('0x39')](_0xd39236[_0x0403('0x34')][_0x0403('0x39')]));_0x76873c[_0x0403('0x38')]=_0x76873c[_0x0403('0x38')][_0x0403('0x3a')]?_0x76873c[_0x0403('0x38')]:_0x1ed003[_0x0403('0x33')];if(!_0xd39236[_0x0403('0x34')][_0x0403('0x3b')](_0x0403('0x3c'))){_0x76873c[_0x0403('0x1f')]=qs[_0x0403('0x1f')](_0xd39236[_0x0403('0x34')]['limit']);_0x76873c['offset']=qs[_0x0403('0x1e')](_0xd39236[_0x0403('0x34')][_0x0403('0x1e')]);}_0x76873c[_0x0403('0x3d')]=qs[_0x0403('0x3e')](_0xd39236['query']['sort']);_0x76873c[_0x0403('0x3f')]=qs[_0x0403('0x36')](_[_0x0403('0x40')](_0xd39236[_0x0403('0x34')],_0x1ed003[_0x0403('0x36')]));if(_0xd39236['query'][_0x0403('0x41')]){_0x76873c[_0x0403('0x3f')]=_[_0x0403('0x42')](_0x76873c[_0x0403('0x3f')],{'$or':_[_0x0403('0x2d')](_0x54f14e,function(_0xcf9ea6){if(_0xcf9ea6[_0x0403('0x31')]!==_0x0403('0x43')){var _0x2b10e3={};_0x2b10e3[_0xcf9ea6[_0x0403('0x2b')]]={'$like':'%'+_0xd39236[_0x0403('0x34')]['filter']+'%'};return _0x2b10e3;}})});}_0x76873c=_[_0x0403('0x42')]({},_0x76873c,_0xd39236['options']);var _0x2cb140={'where':_0x76873c[_0x0403('0x3f')]};return db[_0x0403('0x2e')][_0x0403('0x1d')](_0x2cb140)[_0x0403('0x24')](function(_0x5b983a){_0x54d7bd[_0x0403('0x1d')]=_0x5b983a;if(_0xd39236[_0x0403('0x34')][_0x0403('0x44')]){_0x76873c[_0x0403('0x45')]=[{'all':!![]}];}return db[_0x0403('0x2e')][_0x0403('0x46')](_0x76873c);})[_0x0403('0x24')](function(_0x54bfcc){_0x54d7bd[_0x0403('0x47')]=_0x54bfcc;return _0x54d7bd;})['then'](respondWithFilteredResult(_0x63db5f,_0x76873c))[_0x0403('0x48')](handleError(_0x63db5f,null));};exports[_0x0403('0x49')]=function(_0x1e65da,_0x32fd45){var _0x5c795b={'raw':!![],'where':{'id':_0x1e65da[_0x0403('0x4a')]['id']}},_0x18b0a3={};_0x18b0a3[_0x0403('0x33')]=_[_0x0403('0x35')](db[_0x0403('0x2e')][_0x0403('0x2f')]);_0x18b0a3[_0x0403('0x34')]=_[_0x0403('0x35')](_0x1e65da[_0x0403('0x34')]);_0x18b0a3[_0x0403('0x36')]=_[_0x0403('0x37')](_0x18b0a3['model'],_0x18b0a3[_0x0403('0x34')]);_0x5c795b['attributes']=_[_0x0403('0x37')](_0x18b0a3[_0x0403('0x33')],qs['fields'](_0x1e65da[_0x0403('0x34')][_0x0403('0x39')]));_0x5c795b['attributes']=_0x5c795b[_0x0403('0x38')]['length']?_0x5c795b[_0x0403('0x38')]:_0x18b0a3[_0x0403('0x33')];if(_0x1e65da[_0x0403('0x34')][_0x0403('0x44')]){_0x5c795b['include']=[{'all':!![]}];}_0x5c795b=_[_0x0403('0x42')]({},_0x5c795b,_0x1e65da['options']);return db['Tag'][_0x0403('0x4b')](_0x5c795b)['then'](handleEntityNotFound(_0x32fd45,null))[_0x0403('0x24')](respondWithResult(_0x32fd45,null))[_0x0403('0x48')](handleError(_0x32fd45,null));};exports[_0x0403('0x4c')]=function(_0xd6f352,_0x542a69){return db[_0x0403('0x2e')][_0x0403('0x4c')](_0xd6f352[_0x0403('0x4d')],{})[_0x0403('0x24')](function(_0x589993){var _0x3792e6=_0xd6f352[_0x0403('0x4e')]['get']({'plain':!![]});if(!_0x3792e6)throw new Error(_0x0403('0x4f'));if(_0x3792e6[_0x0403('0x50')]==='user'){var _0x46425a=_0x589993[_0x0403('0x26')]({'plain':!![]});var _0x2e0ed8=_0x0403('0x27');return db[_0x0403('0x51')][_0x0403('0x4b')]({'where':{'name':_0x2e0ed8,'userProfileId':_0x3792e6[_0x0403('0x52')]},'raw':!![]})[_0x0403('0x24')](function(_0x3ab4c1){if(_0x3ab4c1&&_0x3ab4c1[_0x0403('0x53')]===0x0){return db['UserProfileResource'][_0x0403('0x4c')]({'name':_0x46425a[_0x0403('0x2b')],'resourceId':_0x46425a['id'],'type':_0x3ab4c1[_0x0403('0x2b')],'sectionId':_0x3ab4c1['id']},{})[_0x0403('0x24')](function(){return _0x589993;});}else{return _0x589993;}})[_0x0403('0x48')](function(_0x3af342){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3af342);throw _0x3af342;});}return _0x589993;})['then'](respondWithResult(_0x542a69,0xc9))[_0x0403('0x48')](handleError(_0x542a69,null));};exports[_0x0403('0x54')]=function(_0x321356,_0x3ad33f){if(_0x321356[_0x0403('0x4d')]['id']){delete _0x321356[_0x0403('0x4d')]['id'];}return db[_0x0403('0x2e')][_0x0403('0x4b')]({'where':{'id':_0x321356[_0x0403('0x4a')]['id']}})[_0x0403('0x24')](handleEntityNotFound(_0x3ad33f,null))[_0x0403('0x24')](saveUpdates(_0x321356['body'],null))[_0x0403('0x24')](respondWithResult(_0x3ad33f,null))[_0x0403('0x48')](handleError(_0x3ad33f,null));};exports[_0x0403('0x25')]=function(_0x293216,_0x3a89b0){return db[_0x0403('0x2e')]['find']({'where':{'id':_0x293216[_0x0403('0x4a')]['id']}})[_0x0403('0x24')](handleEntityNotFound(_0x3a89b0,null))[_0x0403('0x24')](removeEntity(_0x3a89b0,null))[_0x0403('0x48')](handleError(_0x3a89b0,null));}; \ No newline at end of file +var _0xd4f1=['end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','sendStatus','error','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','VIRTUAL','merge','options','where','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','status'];(function(_0x3295ce,_0x1411d1){var _0x4717bd=function(_0xcb5184){while(--_0xcb5184){_0x3295ce['push'](_0x3295ce['shift']());}};_0x4717bd(++_0x1411d1);}(_0xd4f1,0x8c));var _0x1d4f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4f1[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x1d4f('0x0'));var emlformat=require(_0x1d4f('0x1'));var rimraf=require(_0x1d4f('0x2'));var zipdir=require(_0x1d4f('0x3'));var jsonpatch=require(_0x1d4f('0x4'));var rp=require(_0x1d4f('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1d4f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1d4f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d4f('0x8'));var squel=require(_0x1d4f('0x9'));var crypto=require(_0x1d4f('0xa'));var jsforce=require(_0x1d4f('0xb'));var deskjs=require(_0x1d4f('0xc'));var toCsv=require(_0x1d4f('0xd'));var querystring=require(_0x1d4f('0xe'));var Papa=require(_0x1d4f('0xf'));var Redis=require(_0x1d4f('0x10'));var authService=require(_0x1d4f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d4f('0x12'));var logger=require(_0x1d4f('0x13'))('api');var utils=require(_0x1d4f('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15227c,_0x128270){_0x128270=_0x128270||0xcc;return function(_0x2a37a6){if(_0x2a37a6){return _0x15227c['sendStatus'](_0x128270);}return _0x15227c[_0x1d4f('0x15')](_0x128270)[_0x1d4f('0x16')]();};}function respondWithResult(_0x4eab82,_0x1d981e){_0x1d981e=_0x1d981e||0xc8;return function(_0x5b2f74){if(_0x5b2f74){return _0x4eab82[_0x1d4f('0x15')](_0x1d981e)[_0x1d4f('0x17')](_0x5b2f74);}};}function respondWithFilteredResult(_0xc5db78,_0xc8e422){return function(_0x3b377c){if(_0x3b377c){var _0x17e4ec=_0x3b377c['count'],_0x4378b2=_0xc8e422['offset'],_0x560068=_0xc8e422[_0x1d4f('0x18')]+_0xc8e422[_0x1d4f('0x19')],_0x540de9;if(_0x560068>=_0x17e4ec){_0x560068=_0x17e4ec;_0x540de9=0xc8;}else{_0x540de9=0xce;}_0xc5db78[_0x1d4f('0x15')](_0x540de9);return _0xc5db78[_0x1d4f('0x1a')](_0x1d4f('0x1b'),_0x4378b2+'-'+_0x560068+'/'+_0x17e4ec)[_0x1d4f('0x17')](_0x3b377c);}return null;};}function patchUpdates(_0x366679){return function(_0x1e525b){try{jsonpatch[_0x1d4f('0x1c')](_0x1e525b,_0x366679,!![]);}catch(_0x4bac0d){return BPromise[_0x1d4f('0x1d')](_0x4bac0d);}return _0x1e525b[_0x1d4f('0x1e')]();};}function saveUpdates(_0x34d736,_0x4e091c){return function(_0x176bb0){if(_0x176bb0){return _0x176bb0[_0x1d4f('0x1f')](_0x34d736)[_0x1d4f('0x20')](function(_0x583bfe){return _0x583bfe;});}return null;};}function removeEntity(_0x5dfdc0,_0x4e77b2){return function(_0x46672e){if(_0x46672e){return _0x46672e[_0x1d4f('0x21')]()['then'](function(){var _0x3a77a7=_0x46672e[_0x1d4f('0x22')]({'plain':!![]});var _0x1d7df3=_0x1d4f('0x23');return db['UserProfileResource'][_0x1d4f('0x21')]({'where':{'type':_0x1d7df3,'resourceId':_0x3a77a7['id']}})['then'](function(){return _0x46672e;});})['then'](function(){_0x5dfdc0[_0x1d4f('0x15')](0xcc)[_0x1d4f('0x16')]();});}};}function handleEntityNotFound(_0x2db751,_0x396b09){return function(_0x2bf548){if(!_0x2bf548){_0x2db751[_0x1d4f('0x24')](0x194);}return _0x2bf548;};}function handleError(_0x47ce4a,_0x15f0fc){_0x15f0fc=_0x15f0fc||0x1f4;return function(_0x10b28e){logger[_0x1d4f('0x25')](_0x10b28e[_0x1d4f('0x26')]);if(_0x10b28e[_0x1d4f('0x27')]){delete _0x10b28e[_0x1d4f('0x27')];}_0x47ce4a[_0x1d4f('0x15')](_0x15f0fc)[_0x1d4f('0x28')](_0x10b28e);};}exports['index']=function(_0x57e49b,_0x4ed194){var _0x4a6802={},_0x215bda={},_0x5cb2b1={'count':0x0,'rows':[]};var _0x359eb4=_[_0x1d4f('0x29')](db[_0x1d4f('0x2a')][_0x1d4f('0x2b')],function(_0x290531){return{'name':_0x290531[_0x1d4f('0x2c')],'type':_0x290531[_0x1d4f('0x2d')][_0x1d4f('0x2e')]};});_0x215bda[_0x1d4f('0x2f')]=_[_0x1d4f('0x29')](_0x359eb4,'name');_0x215bda[_0x1d4f('0x30')]=_[_0x1d4f('0x31')](_0x57e49b[_0x1d4f('0x30')]);_0x215bda[_0x1d4f('0x32')]=_[_0x1d4f('0x33')](_0x215bda[_0x1d4f('0x2f')],_0x215bda[_0x1d4f('0x30')]);_0x4a6802[_0x1d4f('0x34')]=_[_0x1d4f('0x33')](_0x215bda[_0x1d4f('0x2f')],qs[_0x1d4f('0x35')](_0x57e49b[_0x1d4f('0x30')][_0x1d4f('0x35')]));_0x4a6802['attributes']=_0x4a6802['attributes']['length']?_0x4a6802[_0x1d4f('0x34')]:_0x215bda[_0x1d4f('0x2f')];if(!_0x57e49b[_0x1d4f('0x30')][_0x1d4f('0x36')](_0x1d4f('0x37'))){_0x4a6802['limit']=qs[_0x1d4f('0x19')](_0x57e49b['query'][_0x1d4f('0x19')]);_0x4a6802['offset']=qs[_0x1d4f('0x18')](_0x57e49b[_0x1d4f('0x30')][_0x1d4f('0x18')]);}_0x4a6802[_0x1d4f('0x38')]=qs['sort'](_0x57e49b['query']['sort']);_0x4a6802['where']=qs['filters'](_[_0x1d4f('0x39')](_0x57e49b[_0x1d4f('0x30')],_0x215bda['filters']));if(_0x57e49b[_0x1d4f('0x30')][_0x1d4f('0x3a')]){_0x4a6802['where']=_['merge'](_0x4a6802['where'],{'$or':_[_0x1d4f('0x29')](_0x359eb4,function(_0x7ff56a){if(_0x7ff56a['type']!==_0x1d4f('0x3b')){var _0x31a47b={};_0x31a47b[_0x7ff56a[_0x1d4f('0x27')]]={'$like':'%'+_0x57e49b[_0x1d4f('0x30')]['filter']+'%'};return _0x31a47b;}})});}_0x4a6802=_[_0x1d4f('0x3c')]({},_0x4a6802,_0x57e49b[_0x1d4f('0x3d')]);var _0x373661={'where':_0x4a6802[_0x1d4f('0x3e')]};return db[_0x1d4f('0x2a')]['count'](_0x373661)[_0x1d4f('0x20')](function(_0x30bfcf){_0x5cb2b1[_0x1d4f('0x3f')]=_0x30bfcf;if(_0x57e49b[_0x1d4f('0x30')][_0x1d4f('0x40')]){_0x4a6802[_0x1d4f('0x41')]=[{'all':!![]}];}return db[_0x1d4f('0x2a')][_0x1d4f('0x42')](_0x4a6802);})['then'](function(_0x1e40ed){_0x5cb2b1[_0x1d4f('0x43')]=_0x1e40ed;return _0x5cb2b1;})[_0x1d4f('0x20')](respondWithFilteredResult(_0x4ed194,_0x4a6802))[_0x1d4f('0x44')](handleError(_0x4ed194,null));};exports[_0x1d4f('0x45')]=function(_0x1701c4,_0x50099b){var _0x6ac2a9={'raw':!![],'where':{'id':_0x1701c4[_0x1d4f('0x46')]['id']}},_0x4a7399={};_0x4a7399[_0x1d4f('0x2f')]=_[_0x1d4f('0x31')](db[_0x1d4f('0x2a')][_0x1d4f('0x2b')]);_0x4a7399['query']=_[_0x1d4f('0x31')](_0x1701c4[_0x1d4f('0x30')]);_0x4a7399[_0x1d4f('0x32')]=_[_0x1d4f('0x33')](_0x4a7399[_0x1d4f('0x2f')],_0x4a7399[_0x1d4f('0x30')]);_0x6ac2a9[_0x1d4f('0x34')]=_[_0x1d4f('0x33')](_0x4a7399[_0x1d4f('0x2f')],qs[_0x1d4f('0x35')](_0x1701c4[_0x1d4f('0x30')][_0x1d4f('0x35')]));_0x6ac2a9['attributes']=_0x6ac2a9['attributes'][_0x1d4f('0x47')]?_0x6ac2a9[_0x1d4f('0x34')]:_0x4a7399[_0x1d4f('0x2f')];if(_0x1701c4[_0x1d4f('0x30')][_0x1d4f('0x40')]){_0x6ac2a9['include']=[{'all':!![]}];}_0x6ac2a9=_[_0x1d4f('0x3c')]({},_0x6ac2a9,_0x1701c4[_0x1d4f('0x3d')]);return db[_0x1d4f('0x2a')][_0x1d4f('0x48')](_0x6ac2a9)[_0x1d4f('0x20')](handleEntityNotFound(_0x50099b,null))['then'](respondWithResult(_0x50099b,null))[_0x1d4f('0x44')](handleError(_0x50099b,null));};exports[_0x1d4f('0x49')]=function(_0x238f50,_0x4d93ae){return db[_0x1d4f('0x2a')][_0x1d4f('0x49')](_0x238f50[_0x1d4f('0x4a')],{})[_0x1d4f('0x20')](function(_0x882f9f){var _0x55d0e7=_0x238f50['user'][_0x1d4f('0x22')]({'plain':!![]});if(!_0x55d0e7)throw new Error(_0x1d4f('0x4b'));if(_0x55d0e7['role']===_0x1d4f('0x4c')){var _0x54909c=_0x882f9f[_0x1d4f('0x22')]({'plain':!![]});var _0x2a9529=_0x1d4f('0x23');return db[_0x1d4f('0x4d')][_0x1d4f('0x48')]({'where':{'name':_0x2a9529,'userProfileId':_0x55d0e7['userProfileId']},'raw':!![]})[_0x1d4f('0x20')](function(_0x583ad1){if(_0x583ad1&&_0x583ad1[_0x1d4f('0x4e')]===0x0){return db[_0x1d4f('0x4f')][_0x1d4f('0x49')]({'name':_0x54909c['name'],'resourceId':_0x54909c['id'],'type':_0x583ad1[_0x1d4f('0x27')],'sectionId':_0x583ad1['id']},{})[_0x1d4f('0x20')](function(){return _0x882f9f;});}else{return _0x882f9f;}})[_0x1d4f('0x44')](function(_0x27260e){logger[_0x1d4f('0x25')](_0x1d4f('0x50'),_0x27260e);throw _0x27260e;});}return _0x882f9f;})['then'](respondWithResult(_0x4d93ae,0xc9))[_0x1d4f('0x44')](handleError(_0x4d93ae,null));};exports[_0x1d4f('0x1f')]=function(_0x19cf32,_0x406a5e){if(_0x19cf32[_0x1d4f('0x4a')]['id']){delete _0x19cf32['body']['id'];}return db[_0x1d4f('0x2a')][_0x1d4f('0x48')]({'where':{'id':_0x19cf32[_0x1d4f('0x46')]['id']}})[_0x1d4f('0x20')](handleEntityNotFound(_0x406a5e,null))[_0x1d4f('0x20')](saveUpdates(_0x19cf32[_0x1d4f('0x4a')],null))[_0x1d4f('0x20')](respondWithResult(_0x406a5e,null))[_0x1d4f('0x44')](handleError(_0x406a5e,null));};exports[_0x1d4f('0x21')]=function(_0x44bddd,_0x25981f){return db[_0x1d4f('0x2a')]['find']({'where':{'id':_0x44bddd['params']['id']}})[_0x1d4f('0x20')](handleEntityNotFound(_0x25981f,null))[_0x1d4f('0x20')](removeEntity(_0x25981f,null))[_0x1d4f('0x44')](handleError(_0x25981f,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index eb037e5..78698a7 100644 --- a/server/api/tag/tag.model.js +++ b/server/api/tag/tag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b38=['path','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4e573a,_0x22ad19){var _0xa0d551=function(_0x1228b5){while(--_0x1228b5){_0x4e573a['push'](_0x4e573a['shift']());}};_0xa0d551(++_0x22ad19);}(_0x8b38,0x159));var _0x88b3=function(_0x3f4cd0,_0x303070){_0x3f4cd0=_0x3f4cd0-0x0;var _0x3f9f01=_0x8b38[_0x3f4cd0];return _0x3f9f01;};'use strict';var _=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var logger=require(_0x88b3('0x2'))(_0x88b3('0x3'));var moment=require(_0x88b3('0x4'));var BPromise=require('bluebird');var rp=require(_0x88b3('0x5'));var fs=require('fs');var path=require(_0x88b3('0x6'));var rimraf=require('rimraf');var config=require(_0x88b3('0x7'));var attributes=require(_0x88b3('0x8'));module[_0x88b3('0x9')]=function(_0x42f1ea,_0x47803c){return _0x42f1ea[_0x88b3('0xa')](_0x88b3('0xb'),attributes,{'tableName':_0x88b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6960=['./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x56c2d5,_0x3908fe){var _0x2e2133=function(_0x5d94e9){while(--_0x5d94e9){_0x56c2d5['push'](_0x56c2d5['shift']());}};_0x2e2133(++_0x3908fe);}(_0x6960,0xae));var _0x0696=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x6960[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0696('0x0'));var util=require(_0x0696('0x1'));var logger=require(_0x0696('0x2'))('api');var moment=require(_0x0696('0x3'));var BPromise=require(_0x0696('0x4'));var rp=require(_0x0696('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0696('0x6'));module['exports']=function(_0x4bb49e,_0x5c4e62){return _0x4bb49e[_0x0696('0x7')](_0x0696('0x8'),attributes,{'tableName':_0x0696('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 03d0668..e462744 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76dc=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x13d9f3,_0x22aacd){var _0x4dfc52=function(_0x1177f9){while(--_0x1177f9){_0x13d9f3['push'](_0x13d9f3['shift']());}};_0x4dfc52(++_0x22aacd);}(_0x76dc,0x1f2));var _0xc76d=function(_0x5370b0,_0x328e3b){_0x5370b0=_0x5370b0-0x0;var _0x431856=_0x76dc[_0x5370b0];return _0x431856;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('Tag,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});} \ No newline at end of file +var _0xd3d1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x44b318,_0x5664ee){var _0x58d2ef=function(_0x33e3d8){while(--_0x33e3d8){_0x44b318['push'](_0x44b318['shift']());}};_0x58d2ef(++_0x5664ee);}(_0xd3d1,0x172));var _0x1d3d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd3d1[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d3d('0x2'));var fs=require('fs');var Redis=require(_0x1d3d('0x3'));var db=require(_0x1d3d('0x4'))['db'];var utils=require(_0x1d3d('0x5'));var logger=require(_0x1d3d('0x6'))(_0x1d3d('0x7'));var config=require(_0x1d3d('0x8'));var jayson=require(_0x1d3d('0x9'));var client=jayson[_0x1d3d('0xa')][_0x1d3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3831ce,_0xb1b3c6,_0xe10bca){return new BPromise(function(_0x2c377c,_0xbea61e){return client[_0x1d3d('0xc')](_0x3831ce,_0xe10bca)[_0x1d3d('0xd')](function(_0x510a37){logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));logger[_0x1d3d('0x11')](_0x1d3d('0x12'),_0xb1b3c6,_0x1d3d('0x10'),JSON[_0x1d3d('0x13')](_0x510a37));if(_0x510a37[_0x1d3d('0x14')]){if(_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x15')]===0x1f4){logger[_0x1d3d('0x14')]('Tag,\x20%s,\x20%s',_0xb1b3c6,_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x16')]);return _0xbea61e(_0x510a37['error']['message']);}logger[_0x1d3d('0x14')](_0x1d3d('0xf'),_0xb1b3c6,_0x510a37[_0x1d3d('0x14')]['message']);return _0x2c377c(_0x510a37[_0x1d3d('0x14')]['message']);}else{logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));_0x2c377c(_0x510a37[_0x1d3d('0x17')][_0x1d3d('0x16')]);}})[_0x1d3d('0x18')](function(_0x3dcb67){logger['error']('Tag,\x20%s,\x20%s',_0xb1b3c6,_0x3dcb67);_0xbea61e(_0x3dcb67);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 07ec859..82214b8 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33c8=['Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','/:id/queues','isAuthenticated','/:id/users','getAgents','post','create','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x33c8,0x14b));var _0x833c=function(_0x25fbcf,_0x1b12cd){_0x25fbcf=_0x25fbcf-0x0;var _0x563652=_0x33c8[_0x25fbcf];return _0x563652;};'use strict';var multer=require(_0x833c('0x0'));var util=require(_0x833c('0x1'));var path=require(_0x833c('0x2'));var timeout=require(_0x833c('0x3'));var express=require(_0x833c('0x4'));var router=express[_0x833c('0x5')]();var auth=require(_0x833c('0x6'));var interaction=require(_0x833c('0x7'));var config=require('../../config/environment');var controller=require('./team.controller');router[_0x833c('0x8')]('/',auth['isAuthenticated'](),controller[_0x833c('0x9')]);router['get'](_0x833c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x833c('0x8')](_0x833c('0xb'),auth[_0x833c('0xc')](),controller['getQueues']);router[_0x833c('0x8')](_0x833c('0xd'),auth[_0x833c('0xc')](),controller[_0x833c('0xe')]);router[_0x833c('0xf')]('/',auth[_0x833c('0xc')](),controller[_0x833c('0x10')]);router['post'](_0x833c('0xb'),auth[_0x833c('0xc')](),controller['addQueues']);router['post']('/:id/users',auth[_0x833c('0xc')](),controller['addAgents']);router[_0x833c('0x11')](_0x833c('0xa'),auth[_0x833c('0xc')](),controller[_0x833c('0x12')]);router[_0x833c('0x13')](_0x833c('0xa'),auth['isAuthenticated'](),controller[_0x833c('0x14')]);router[_0x833c('0x13')]('/:id/queues',auth[_0x833c('0xc')](),controller[_0x833c('0x15')]);router[_0x833c('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x833c('0x16')]);module[_0x833c('0x17')]=router; \ No newline at end of file +var _0xbe33=['get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','put','delete','destroy','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','express','../../config/environment','./team.controller'];(function(_0x55b5a5,_0x223b44){var _0x42cbd5=function(_0x8be1a5){while(--_0x8be1a5){_0x55b5a5['push'](_0x55b5a5['shift']());}};_0x42cbd5(++_0x223b44);}(_0xbe33,0x17f));var _0x3be3=function(_0x387f01,_0x59628a){_0x387f01=_0x387f01-0x0;var _0x4214e5=_0xbe33[_0x387f01];return _0x4214e5;};'use strict';var multer=require(_0x3be3('0x0'));var util=require(_0x3be3('0x1'));var path=require(_0x3be3('0x2'));var timeout=require(_0x3be3('0x3'));var express=require(_0x3be3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3be3('0x5'));var controller=require(_0x3be3('0x6'));router[_0x3be3('0x7')]('/',auth[_0x3be3('0x8')](),controller[_0x3be3('0x9')]);router[_0x3be3('0x7')](_0x3be3('0xa'),auth[_0x3be3('0x8')](),controller[_0x3be3('0xb')]);router['get'](_0x3be3('0xc'),auth[_0x3be3('0x8')](),controller[_0x3be3('0xd')]);router[_0x3be3('0x7')](_0x3be3('0xe'),auth[_0x3be3('0x8')](),controller[_0x3be3('0xf')]);router[_0x3be3('0x10')]('/',auth[_0x3be3('0x8')](),controller[_0x3be3('0x11')]);router['post'](_0x3be3('0xc'),auth[_0x3be3('0x8')](),controller[_0x3be3('0x12')]);router[_0x3be3('0x10')](_0x3be3('0xe'),auth['isAuthenticated'](),controller[_0x3be3('0x13')]);router[_0x3be3('0x14')](_0x3be3('0xa'),auth[_0x3be3('0x8')](),controller['update']);router[_0x3be3('0x15')]('/:id',auth[_0x3be3('0x8')](),controller[_0x3be3('0x16')]);router['delete']('/:id/queues',auth[_0x3be3('0x8')](),controller[_0x3be3('0x17')]);router['delete'](_0x3be3('0xe'),auth[_0x3be3('0x8')](),controller[_0x3be3('0x18')]);module[_0x3be3('0x19')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index ee625c9..2b975e7 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabc3=['STRING','name','sequelize','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xabc3,0x6e));var _0x3abc=function(_0x5041be,_0x3e0264){_0x5041be=_0x5041be-0x0;var _0x428206=_0xabc3[_0x5041be];return _0x428206;};'use strict';var Sequelize=require(_0x3abc('0x0'));module[_0x3abc('0x1')]={'name':{'type':Sequelize[_0x3abc('0x2')],'allowNull':![],'unique':_0x3abc('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac11=['sequelize','exports','STRING'];(function(_0x79bfa9,_0x3514c2){var _0x2883c0=function(_0x473537){while(--_0x473537){_0x79bfa9['push'](_0x79bfa9['shift']());}};_0x2883c0(++_0x3514c2);}(_0xac11,0x117));var _0x1ac1=function(_0x54648c,_0xd35af9){_0x54648c=_0x54648c-0x0;var _0x5d4bda=_0xac11[_0x54648c];return _0x5d4bda;};'use strict';var Sequelize=require(_0x1ac1('0x0'));module[_0x1ac1('0x1')]={'name':{'type':Sequelize[_0x1ac1('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x1ac1('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 9b4f9b0..b407a69 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1267=['rows','catch','show','params','keys','rawAttributes','length','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','ids','removeQueues','addAgents','Chat','Sms','Fax','each','Voice','User','online','interface','UserVoiceQueueRt','upsert','SIP/%s','voicePause','omit','spread','emit','userTeam:save','mail','sms','fax','openchannel','removeAgents','voice','userTeam:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','end','status','offset','set','json','apply','reject','save','update','then','destroy','Teams','UserProfileResource','name','send','index','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','options','Team','count','includeAll','findAll'];(function(_0xa62357,_0x40d75d){var _0x18f7b5=function(_0x551f8b){while(--_0x551f8b){_0xa62357['push'](_0xa62357['shift']());}};_0x18f7b5(++_0x40d75d);}(_0x1267,0xb5));var _0x7126=function(_0x4dd689,_0x4433d0){_0x4dd689=_0x4dd689-0x0;var _0x562adf=_0x1267[_0x4dd689];return _0x562adf;};'use strict';var pdf=require(_0x7126('0x0'));var emlformat=require(_0x7126('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7126('0x2'));var rp=require(_0x7126('0x3'));var moment=require(_0x7126('0x4'));var BPromise=require(_0x7126('0x5'));var Mustache=require(_0x7126('0x6'));var util=require(_0x7126('0x7'));var path=require(_0x7126('0x8'));var sox=require('sox');var csv=require(_0x7126('0x9'));var ejs=require(_0x7126('0xa'));var fs=require('fs');var _=require(_0x7126('0xb'));var squel=require(_0x7126('0xc'));var crypto=require('crypto');var jsforce=require(_0x7126('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7126('0x9'));var querystring=require('querystring');var Papa=require(_0x7126('0xe'));var Redis=require(_0x7126('0xf'));var authService=require(_0x7126('0x10'));var qs=require(_0x7126('0x11'));var as=require(_0x7126('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7126('0x13'));var utils=require(_0x7126('0x14'));var config=require(_0x7126('0x15'));var db=require(_0x7126('0x16'))['db'];config[_0x7126('0x17')]=_[_0x7126('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7126('0x19'))(new Redis(config[_0x7126('0x17')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x33dc18,_0x4776b1){_0x4776b1=_0x4776b1||0xcc;return function(_0x5ca28a){if(_0x5ca28a){return _0x33dc18[_0x7126('0x1a')](_0x4776b1);}return _0x33dc18['status'](_0x4776b1)[_0x7126('0x1b')]();};}function respondWithResult(_0x18fc4a,_0x5ebe78){_0x5ebe78=_0x5ebe78||0xc8;return function(_0x4fd16d){if(_0x4fd16d){return _0x18fc4a[_0x7126('0x1c')](_0x5ebe78)['json'](_0x4fd16d);}};}function respondWithFilteredResult(_0xe8fe52,_0x24e14b){return function(_0x3de49a){if(_0x3de49a){var _0x2795e0=_0x3de49a['count'],_0xd98d0c=_0x24e14b[_0x7126('0x1d')],_0x68dbf2=_0x24e14b[_0x7126('0x1d')]+_0x24e14b['limit'],_0x21f020;if(_0x68dbf2>=_0x2795e0){_0x68dbf2=_0x2795e0;_0x21f020=0xc8;}else{_0x21f020=0xce;}_0xe8fe52[_0x7126('0x1c')](_0x21f020);return _0xe8fe52[_0x7126('0x1e')]('Content-Range',_0xd98d0c+'-'+_0x68dbf2+'/'+_0x2795e0)[_0x7126('0x1f')](_0x3de49a);}return null;};}function patchUpdates(_0x57e826){return function(_0x47bfe4){try{jsonpatch[_0x7126('0x20')](_0x47bfe4,_0x57e826,!![]);}catch(_0x378acd){return BPromise[_0x7126('0x21')](_0x378acd);}return _0x47bfe4[_0x7126('0x22')]();};}function saveUpdates(_0x10c648,_0x58ac80){return function(_0x4225bd){if(_0x4225bd){return _0x4225bd[_0x7126('0x23')](_0x10c648)[_0x7126('0x24')](function(_0x387133){return _0x387133;});}return null;};}function removeEntity(_0x39a51c,_0x37ce12){return function(_0x1c0dfa){if(_0x1c0dfa){return _0x1c0dfa[_0x7126('0x25')]()['then'](function(){var _0x564a8b=_0x1c0dfa['get']({'plain':!![]});var _0x382941=_0x7126('0x26');return db[_0x7126('0x27')][_0x7126('0x25')]({'where':{'type':_0x382941,'resourceId':_0x564a8b['id']}})[_0x7126('0x24')](function(){return _0x1c0dfa;});})[_0x7126('0x24')](function(){_0x39a51c['status'](0xcc)[_0x7126('0x1b')]();});}};}function handleEntityNotFound(_0x5acd75,_0x4426c0){return function(_0x5b01ab){if(!_0x5b01ab){_0x5acd75[_0x7126('0x1a')](0x194);}return _0x5b01ab;};}function handleError(_0x15b2bb,_0x5e954d){_0x5e954d=_0x5e954d||0x1f4;return function(_0x53624e){logger['error'](_0x53624e['stack']);if(_0x53624e[_0x7126('0x28')]){delete _0x53624e[_0x7126('0x28')];}_0x15b2bb['status'](_0x5e954d)[_0x7126('0x29')](_0x53624e);};}exports[_0x7126('0x2a')]=function(_0x8f0e73,_0xef1f31){var _0x70da80={},_0x17be15={},_0x2c0666={'count':0x0,'rows':[]};var _0x4ae537=_[_0x7126('0x2b')](db['Team']['rawAttributes'],function(_0x418d15){return{'name':_0x418d15[_0x7126('0x2c')],'type':_0x418d15[_0x7126('0x2d')][_0x7126('0x2e')]};});_0x17be15['model']=_[_0x7126('0x2b')](_0x4ae537,_0x7126('0x28'));_0x17be15[_0x7126('0x2f')]=_['keys'](_0x8f0e73['query']);_0x17be15[_0x7126('0x30')]=_[_0x7126('0x31')](_0x17be15[_0x7126('0x32')],_0x17be15[_0x7126('0x2f')]);_0x70da80[_0x7126('0x33')]=_['intersection'](_0x17be15[_0x7126('0x32')],qs[_0x7126('0x34')](_0x8f0e73[_0x7126('0x2f')][_0x7126('0x34')]));_0x70da80[_0x7126('0x33')]=_0x70da80['attributes']['length']?_0x70da80[_0x7126('0x33')]:_0x17be15[_0x7126('0x32')];if(!_0x8f0e73[_0x7126('0x2f')][_0x7126('0x35')](_0x7126('0x36'))){_0x70da80['limit']=qs[_0x7126('0x37')](_0x8f0e73['query'][_0x7126('0x37')]);_0x70da80[_0x7126('0x1d')]=qs['offset'](_0x8f0e73[_0x7126('0x2f')][_0x7126('0x1d')]);}_0x70da80[_0x7126('0x38')]=qs['sort'](_0x8f0e73[_0x7126('0x2f')][_0x7126('0x39')]);_0x70da80['where']=qs[_0x7126('0x30')](_[_0x7126('0x3a')](_0x8f0e73[_0x7126('0x2f')],_0x17be15['filters']));if(_0x8f0e73[_0x7126('0x2f')]['filter']){_0x70da80[_0x7126('0x3b')]=_[_0x7126('0x3c')](_0x70da80['where'],{'$or':_[_0x7126('0x2b')](_0x4ae537,function(_0x153c44){if(_0x153c44[_0x7126('0x2d')]!==_0x7126('0x3d')){var _0x3d46ae={};_0x3d46ae[_0x153c44[_0x7126('0x28')]]={'$like':'%'+_0x8f0e73[_0x7126('0x2f')]['filter']+'%'};return _0x3d46ae;}})});}_0x70da80=_[_0x7126('0x3c')]({},_0x70da80,_0x8f0e73[_0x7126('0x3e')]);var _0x3d35dd={'where':_0x70da80[_0x7126('0x3b')]};return db[_0x7126('0x3f')][_0x7126('0x40')](_0x3d35dd)[_0x7126('0x24')](function(_0x394d54){_0x2c0666[_0x7126('0x40')]=_0x394d54;if(_0x8f0e73[_0x7126('0x2f')][_0x7126('0x41')]){_0x70da80['include']=[{'all':!![]}];}return db[_0x7126('0x3f')][_0x7126('0x42')](_0x70da80);})[_0x7126('0x24')](function(_0x2b4d68){_0x2c0666[_0x7126('0x43')]=_0x2b4d68;return _0x2c0666;})[_0x7126('0x24')](respondWithFilteredResult(_0xef1f31,_0x70da80))[_0x7126('0x44')](handleError(_0xef1f31,null));};exports[_0x7126('0x45')]=function(_0x51f55e,_0x3258e0){var _0x5139aa={'raw':![],'where':{'id':_0x51f55e[_0x7126('0x46')]['id']}},_0x2e0c65={};_0x2e0c65[_0x7126('0x32')]=_[_0x7126('0x47')](db[_0x7126('0x3f')][_0x7126('0x48')]);_0x2e0c65[_0x7126('0x2f')]=_['keys'](_0x51f55e[_0x7126('0x2f')]);_0x2e0c65[_0x7126('0x30')]=_[_0x7126('0x31')](_0x2e0c65['model'],_0x2e0c65[_0x7126('0x2f')]);_0x5139aa[_0x7126('0x33')]=_['intersection'](_0x2e0c65[_0x7126('0x32')],qs[_0x7126('0x34')](_0x51f55e['query'][_0x7126('0x34')]));_0x5139aa[_0x7126('0x33')]=_0x5139aa[_0x7126('0x33')][_0x7126('0x49')]?_0x5139aa[_0x7126('0x33')]:_0x2e0c65[_0x7126('0x32')];if(_0x51f55e[_0x7126('0x2f')][_0x7126('0x41')]){_0x5139aa[_0x7126('0x4a')]=[{'all':!![]}];}_0x5139aa=_[_0x7126('0x3c')]({},_0x5139aa,_0x51f55e[_0x7126('0x3e')]);return db[_0x7126('0x3f')]['find'](_0x5139aa)[_0x7126('0x24')](handleEntityNotFound(_0x3258e0,null))[_0x7126('0x24')](respondWithResult(_0x3258e0,null))['catch'](handleError(_0x3258e0,null));};exports[_0x7126('0x4b')]=function(_0x498911,_0x13efb6){return db[_0x7126('0x3f')][_0x7126('0x4b')](_0x498911[_0x7126('0x4c')],{})[_0x7126('0x24')](function(_0x1fb578){var _0x411960=_0x498911[_0x7126('0x4d')][_0x7126('0x4e')]({'plain':!![]});if(!_0x411960)throw new Error(_0x7126('0x4f'));if(_0x411960[_0x7126('0x50')]===_0x7126('0x4d')){var _0x17e123=_0x1fb578[_0x7126('0x4e')]({'plain':!![]});var _0x26466d=_0x7126('0x26');return db[_0x7126('0x51')]['find']({'where':{'name':_0x26466d,'userProfileId':_0x411960['userProfileId']},'raw':!![]})[_0x7126('0x24')](function(_0x50b781){if(_0x50b781&&_0x50b781[_0x7126('0x52')]===0x0){return db[_0x7126('0x27')][_0x7126('0x4b')]({'name':_0x17e123['name'],'resourceId':_0x17e123['id'],'type':_0x50b781['name'],'sectionId':_0x50b781['id']},{})['then'](function(){return _0x1fb578;});}else{return _0x1fb578;}})['catch'](function(_0x17b4e2){logger[_0x7126('0x53')](_0x7126('0x54'),_0x17b4e2);throw _0x17b4e2;});}return _0x1fb578;})[_0x7126('0x24')](respondWithResult(_0x13efb6,0xc9))[_0x7126('0x44')](handleError(_0x13efb6,null));};exports[_0x7126('0x23')]=function(_0x229a77,_0x642999){if(_0x229a77[_0x7126('0x4c')]['id']){delete _0x229a77['body']['id'];}return db[_0x7126('0x3f')][_0x7126('0x55')]({'where':{'id':_0x229a77[_0x7126('0x46')]['id']}})[_0x7126('0x24')](handleEntityNotFound(_0x642999,null))[_0x7126('0x24')](saveUpdates(_0x229a77[_0x7126('0x4c')],null))[_0x7126('0x24')](respondWithResult(_0x642999,null))['catch'](handleError(_0x642999,null));};exports[_0x7126('0x25')]=function(_0x574356,_0x4c24e9){return db[_0x7126('0x3f')][_0x7126('0x55')]({'where':{'id':_0x574356[_0x7126('0x46')]['id']}})[_0x7126('0x24')](handleEntityNotFound(_0x4c24e9,null))[_0x7126('0x24')](removeEntity(_0x4c24e9,null))['catch'](handleError(_0x4c24e9,null));};exports[_0x7126('0x56')]=function(_0x330a28,_0x17aacc,_0x1f2f5a){return db[_0x7126('0x3f')][_0x7126('0x57')]({'where':{'id':_0x330a28['params']['id']}})[_0x7126('0x24')](handleEntityNotFound(_0x17aacc,null))[_0x7126('0x24')](function(_0x530934){if(!_0x330a28[_0x7126('0x2f')][_0x7126('0x58')]||!utils[_0x7126('0x59')](_0x330a28[_0x7126('0x2f')]['channel'])){throw new db[(_0x7126('0x5a'))][(_0x7126('0x5b'))](_0x7126('0x5c'));}var _0x165797={};var _0x5c62b6={};_0x5c62b6[_0x7126('0x32')]=_['keys'](db[_[_0x7126('0x5d')](_0x330a28[_0x7126('0x2f')][_0x7126('0x58')][_0x7126('0x5e')]())+_0x7126('0x5f')][_0x7126('0x48')]);_0x5c62b6[_0x7126('0x2f')]=_[_0x7126('0x47')](_0x330a28[_0x7126('0x2f')]);_0x5c62b6[_0x7126('0x30')]=_[_0x7126('0x31')](_0x5c62b6[_0x7126('0x32')],_0x5c62b6['query']);_0x165797['attributes']=_[_0x7126('0x31')](_0x5c62b6[_0x7126('0x32')],qs['fields'](_0x330a28[_0x7126('0x2f')]['fields']));_0x165797[_0x7126('0x33')]=_0x165797['attributes'][_0x7126('0x49')]?_0x165797[_0x7126('0x33')]:_0x5c62b6[_0x7126('0x32')];_0x165797[_0x7126('0x37')]=qs['limit'](_0x330a28[_0x7126('0x2f')][_0x7126('0x37')]);_0x165797['offset']=qs[_0x7126('0x1d')](_0x330a28[_0x7126('0x2f')]['offset']);_0x165797[_0x7126('0x38')]=qs[_0x7126('0x39')](_0x330a28[_0x7126('0x2f')][_0x7126('0x39')]);_0x165797[_0x7126('0x3b')]=qs['filters'](_['pick'](_0x330a28['query'],_0x5c62b6['filters']));_0x165797=_[_0x7126('0x3c')]({},_0x165797,_0x330a28[_0x7126('0x3e')]);return _0x530934[_0x7126('0x4e')+_['capitalize'](_0x330a28[_0x7126('0x2f')]['channel'][_0x7126('0x5e')]())+_0x7126('0x60')](_0x165797);})[_0x7126('0x24')](respondWithResult(_0x17aacc,null))[_0x7126('0x44')](handleError(_0x17aacc,null));};exports['addQueues']=function(_0x3182f9,_0x51faaf,_0x3554e1){return db[_0x7126('0x3f')][_0x7126('0x57')]({'where':{'id':_0x3182f9['params']['id']}})[_0x7126('0x24')](function(_0x1f5422){if(_0x1f5422){if(!_0x3182f9[_0x7126('0x4c')]['channel']||!utils[_0x7126('0x59')](_0x3182f9[_0x7126('0x4c')][_0x7126('0x58')])){throw new db[(_0x7126('0x5a'))]['ValidationError']('Unknown\x20channel');}return _0x1f5422['add'+_[_0x7126('0x5d')](_0x3182f9[_0x7126('0x4c')][_0x7126('0x58')][_0x7126('0x5e')]())+_0x7126('0x60')](_0x3182f9[_0x7126('0x4c')][_0x7126('0x61')]);}return null;})[_0x7126('0x24')](handleEntityNotFound(_0x51faaf,null))['then'](respondWithStatusCode(_0x51faaf,null))[_0x7126('0x44')](handleError(_0x51faaf,null));};exports[_0x7126('0x62')]=function(_0x381fa3,_0x48898a,_0x3b6836){return db[_0x7126('0x3f')][_0x7126('0x57')]({'where':{'id':_0x381fa3[_0x7126('0x46')]['id']}})[_0x7126('0x24')](function(_0x2ccab6){if(_0x2ccab6){if(!_0x381fa3[_0x7126('0x2f')][_0x7126('0x58')]||!utils['isValidChannel'](_0x381fa3['query'][_0x7126('0x58')])){throw new db[(_0x7126('0x5a'))][(_0x7126('0x5b'))]('Unknown\x20channel');}return _0x2ccab6['remove'+_[_0x7126('0x5d')](_0x381fa3[_0x7126('0x2f')]['channel'][_0x7126('0x5e')]())+_0x7126('0x60')](_0x381fa3['query']['ids']);}return null;})[_0x7126('0x24')](handleEntityNotFound(_0x48898a,null))['then'](respondWithStatusCode(_0x48898a,null))['catch'](handleError(_0x48898a,null));};exports[_0x7126('0x63')]=function(_0x55ae17,_0x238c30,_0x39e458){return db[_0x7126('0x3f')]['find']({'where':{'id':_0x55ae17[_0x7126('0x46')]['id']}})['then'](handleEntityNotFound(_0x238c30,null))[_0x7126('0x24')](function(_0x5d64f1){if(_0x5d64f1){var _0x3e61fc=['Voice',_0x7126('0x64'),'Mail',_0x7126('0x65'),_0x7126('0x66'),'Openchannel'];return BPromise[_0x7126('0x67')](_0x3e61fc,function(_0x1cb230){return _0x5d64f1['get'+_0x1cb230+_0x7126('0x60')]({'attributes':['id',_0x7126('0x28')]})[_0x7126('0x24')](function(_0x26c2ac){return BPromise['each'](_0x26c2ac,function(_0x2a3890){return _0x2a3890[_0x7126('0x63')](_0x55ae17[_0x7126('0x4c')][_0x7126('0x61')])['then'](function(){if(_0x1cb230===_0x7126('0x68')){return db[_0x7126('0x69')][_0x7126('0x42')]({'where':{'id':_0x55ae17[_0x7126('0x4c')][_0x7126('0x61')]},'attributes':['id',_0x7126('0x28'),_0x7126('0x6a'),'voicePause',_0x7126('0x6b')],'raw':!![]})[_0x7126('0x24')](function(_0x1c10d9){return BPromise['each'](_['filter'](_0x1c10d9,{'online':0x1}),function(_0x26b895){return db[_0x7126('0x6c')][_0x7126('0x6d')]({'membername':_0x26b895[_0x7126('0x28')],'UserId':_0x26b895['id'],'queue_name':_0x2a3890['name'],'VoiceQueueId':_0x2a3890['id'],'interface':_['isNil'](_0x26b895[_0x7126('0x6b')])?util['format'](_0x7126('0x6e'),_0x26b895[_0x7126('0x28')]):_0x26b895[_0x7126('0x6b')],'paused':_0x26b895[_0x7126('0x6f')]||![],'penalty':0x0});});});}});});})[_0x7126('0x24')](function(){return _0x5d64f1;});})['then'](function(){return _0x5d64f1;});}})[_0x7126('0x24')](function(_0x56bf84){if(_0x56bf84){return _0x56bf84[_0x7126('0x63')](_0x55ae17[_0x7126('0x4c')]['ids'],_[_0x7126('0x70')](_0x55ae17[_0x7126('0x4c')],['ids','id'])||{})[_0x7126('0x71')](function(_0x5bf374){for(var _0x33dd5c=0x0;_0x33dd5c<_0x55ae17[_0x7126('0x4c')]['ids'][_0x7126('0x49')];_0x33dd5c+=0x1){socket[_0x7126('0x72')](_0x7126('0x73'),{'UserId':_0x55ae17['body'][_0x7126('0x61')][_0x33dd5c],'TeamId':_0x55ae17[_0x7126('0x46')]['id']});}return _0x5bf374;});}})['then'](respondWithResult(_0x238c30,null))[_0x7126('0x44')](handleError(_0x238c30,null));};exports['removeAgents']=function(_0x1cbac8,_0x7f337a,_0xb3d9a7){return db['Team'][_0x7126('0x55')]({'where':{'id':_0x1cbac8[_0x7126('0x46')]['id']}})[_0x7126('0x24')](handleEntityNotFound(_0x7f337a,null))[_0x7126('0x24')](function(_0x42b192){if(_0x42b192){return BPromise[_0x7126('0x67')](['voice','chat',_0x7126('0x74'),_0x7126('0x75'),_0x7126('0x76'),_0x7126('0x77')],function(_0x1bb858){return _0x42b192[_0x7126('0x4e')+_['capitalize'](_0x1bb858)+_0x7126('0x60')]({'attributes':['id',_0x7126('0x28')]})[_0x7126('0x24')](function(_0xbfbcf7){return BPromise[_0x7126('0x67')](_0xbfbcf7,function(_0x2ae95d){return _0x2ae95d[_0x7126('0x78')](_0x1cbac8['query'][_0x7126('0x61')])[_0x7126('0x24')](function(){if(_0x1bb858===_0x7126('0x79')){return db[_0x7126('0x6c')][_0x7126('0x25')]({'where':{'VoiceQueueId':_0x2ae95d['id'],'UserId':_0x1cbac8[_0x7126('0x2f')][_0x7126('0x61')]}});}});});})[_0x7126('0x24')](function(){return _0x42b192;});})[_0x7126('0x24')](function(){return _0x42b192;});}})[_0x7126('0x24')](function(_0x287213){if(_0x287213){return _0x287213[_0x7126('0x78')](_0x1cbac8[_0x7126('0x2f')][_0x7126('0x61')])['then'](function(){if(_['isArray'](_0x1cbac8['query'][_0x7126('0x61')])){for(var _0x5ba14f=0x0;_0x5ba14f<_0x1cbac8['query']['ids'][_0x7126('0x49')];_0x5ba14f+=0x1){socket[_0x7126('0x72')](_0x7126('0x7a'),{'UserId':Number(_0x1cbac8[_0x7126('0x2f')][_0x7126('0x61')][_0x5ba14f]),'TeamId':Number(_0x1cbac8[_0x7126('0x46')]['id'])});}}else{socket[_0x7126('0x72')](_0x7126('0x7a'),{'UserId':Number(_0x1cbac8[_0x7126('0x2f')][_0x7126('0x61')]),'TeamId':Number(_0x1cbac8[_0x7126('0x46')]['id'])});}});}})[_0x7126('0x24')](respondWithStatusCode(_0x7f337a,null))[_0x7126('0x44')](handleError(_0x7f337a,null));};exports[_0x7126('0x7b')]=function(_0x31ff23,_0xf4347a,_0x1ef0ce){var _0x1bb5c8={};var _0x480a97={};var _0x229dfb;var _0x19e874;return db[_0x7126('0x3f')]['findOne']({'where':{'id':_0x31ff23['params']['id']}})[_0x7126('0x24')](handleEntityNotFound(_0xf4347a,null))['then'](function(_0x5dd0bf){if(_0x5dd0bf){_0x229dfb=_0x5dd0bf;_0x480a97[_0x7126('0x32')]=_[_0x7126('0x47')](db[_0x7126('0x69')][_0x7126('0x48')]);_0x480a97[_0x7126('0x2f')]=_[_0x7126('0x47')](_0x31ff23[_0x7126('0x2f')]);_0x480a97[_0x7126('0x30')]=_[_0x7126('0x31')](_0x480a97[_0x7126('0x32')],_0x480a97[_0x7126('0x2f')]);_0x1bb5c8[_0x7126('0x33')]=_[_0x7126('0x31')](_0x480a97[_0x7126('0x32')],qs[_0x7126('0x34')](_0x31ff23[_0x7126('0x2f')][_0x7126('0x34')]));_0x1bb5c8['attributes']=_0x1bb5c8[_0x7126('0x33')][_0x7126('0x49')]?_0x1bb5c8['attributes']:_0x480a97[_0x7126('0x32')];_0x1bb5c8['order']=qs[_0x7126('0x39')](_0x31ff23[_0x7126('0x2f')][_0x7126('0x39')]);_0x1bb5c8[_0x7126('0x3b')]=qs['filters'](_[_0x7126('0x3a')](_0x31ff23[_0x7126('0x2f')],_0x480a97[_0x7126('0x30')]));if(_0x31ff23[_0x7126('0x2f')]['filter']){_0x1bb5c8[_0x7126('0x3b')]=_['merge'](_0x1bb5c8[_0x7126('0x3b')],{'$or':_['map'](_0x1bb5c8['attributes'],function(_0x313d66){var _0x3d8af0={};_0x3d8af0[_0x313d66]={'$like':'%'+_0x31ff23[_0x7126('0x2f')]['filter']+'%'};return _0x3d8af0;})});}_0x1bb5c8=_[_0x7126('0x3c')]({},_0x1bb5c8,_0x31ff23[_0x7126('0x3e')]);return _0x229dfb['getAgents'](_0x1bb5c8);}})[_0x7126('0x24')](function(_0x3fe14d){if(_0x3fe14d){_0x19e874=_0x3fe14d[_0x7126('0x49')];if(!_0x31ff23[_0x7126('0x2f')][_0x7126('0x35')]('nolimit')){_0x1bb5c8[_0x7126('0x37')]=qs[_0x7126('0x37')](_0x31ff23[_0x7126('0x2f')]['limit']);_0x1bb5c8[_0x7126('0x1d')]=qs['offset'](_0x31ff23['query'][_0x7126('0x1d')]);}return _0x229dfb['getAgents'](_0x1bb5c8);}})['then'](function(_0x5934f0){if(_0x5934f0){return _0x5934f0?{'count':_0x19e874,'rows':_0x5934f0}:null;}})[_0x7126('0x24')](respondWithResult(_0xf4347a,null))[_0x7126('0x44')](handleError(_0xf4347a,null));}; \ No newline at end of file +var _0x09df=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','count','offset','Content-Range','apply','save','update','then','get','Teams','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','type','key','query','filters','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','include','findAll','rows','params','keys','intersection','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','Queue','length','toLowerCase','addQueues','add','Queues','ids','removeQueues','remove','Voice','Chat','Mail','Fax','Openchannel','each','addAgents','User','online','voicePause','interface','upsert','isNil','omit','emit','userTeam:save','removeAgents','voice','chat','mail','sms','openchannel','UserVoiceQueueRt','isArray','getAgents','html-pdf','eml-format','zip-dir','moment','util','path','lodash','crypto','jsforce','desk.js'];(function(_0x2ccf81,_0x4bbda0){var _0x2fdfe9=function(_0x4a6062){while(--_0x4a6062){_0x2ccf81['push'](_0x2ccf81['shift']());}};_0x2fdfe9(++_0x4bbda0);}(_0x09df,0x164));var _0xf09d=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x09df[_0x3e0b8f];return _0x22f742;};'use strict';var pdf=require(_0xf09d('0x0'));var emlformat=require(_0xf09d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf09d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf09d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf09d('0x4'));var path=require(_0xf09d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf09d('0x6'));var squel=require('squel');var crypto=require(_0xf09d('0x7'));var jsforce=require(_0xf09d('0x8'));var deskjs=require(_0xf09d('0x9'));var toCsv=require(_0xf09d('0xa'));var querystring=require(_0xf09d('0xb'));var Papa=require(_0xf09d('0xc'));var Redis=require(_0xf09d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf09d('0xe'));var as=require(_0xf09d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf09d('0x10'))('api');var utils=require(_0xf09d('0x11'));var config=require(_0xf09d('0x12'));var db=require(_0xf09d('0x13'))['db'];config[_0xf09d('0x14')]=_[_0xf09d('0x15')](config[_0xf09d('0x14')],{'host':_0xf09d('0x16'),'port':0x18eb});var socket=require(_0xf09d('0x17'))(new Redis(config[_0xf09d('0x14')]));require('./team.socket')[_0xf09d('0x18')](socket);function respondWithStatusCode(_0x1cbbdf,_0x6bb95b){_0x6bb95b=_0x6bb95b||0xcc;return function(_0x486d20){if(_0x486d20){return _0x1cbbdf['sendStatus'](_0x6bb95b);}return _0x1cbbdf[_0xf09d('0x19')](_0x6bb95b)[_0xf09d('0x1a')]();};}function respondWithResult(_0x2f06b9,_0x58ae3c){_0x58ae3c=_0x58ae3c||0xc8;return function(_0x12bdec){if(_0x12bdec){return _0x2f06b9['status'](_0x58ae3c)[_0xf09d('0x1b')](_0x12bdec);}};}function respondWithFilteredResult(_0x2c5dbd,_0x44d331){return function(_0x33202b){if(_0x33202b){var _0x57e3f8=_0x33202b[_0xf09d('0x1c')],_0x38083e=_0x44d331[_0xf09d('0x1d')],_0xc4b380=_0x44d331[_0xf09d('0x1d')]+_0x44d331['limit'],_0x106fb0;if(_0xc4b380>=_0x57e3f8){_0xc4b380=_0x57e3f8;_0x106fb0=0xc8;}else{_0x106fb0=0xce;}_0x2c5dbd[_0xf09d('0x19')](_0x106fb0);return _0x2c5dbd['set'](_0xf09d('0x1e'),_0x38083e+'-'+_0xc4b380+'/'+_0x57e3f8)[_0xf09d('0x1b')](_0x33202b);}return null;};}function patchUpdates(_0x408ede){return function(_0x236222){try{jsonpatch[_0xf09d('0x1f')](_0x236222,_0x408ede,!![]);}catch(_0x3478bf){return BPromise['reject'](_0x3478bf);}return _0x236222[_0xf09d('0x20')]();};}function saveUpdates(_0x2ab436,_0x2ab38c){return function(_0x1012dd){if(_0x1012dd){return _0x1012dd[_0xf09d('0x21')](_0x2ab436)[_0xf09d('0x22')](function(_0x15e861){return _0x15e861;});}return null;};}function removeEntity(_0x1affe3,_0x507484){return function(_0x394934){if(_0x394934){return _0x394934['destroy']()[_0xf09d('0x22')](function(){var _0x47c6c5=_0x394934[_0xf09d('0x23')]({'plain':!![]});var _0x1e4c35=_0xf09d('0x24');return db[_0xf09d('0x25')][_0xf09d('0x26')]({'where':{'type':_0x1e4c35,'resourceId':_0x47c6c5['id']}})[_0xf09d('0x22')](function(){return _0x394934;});})['then'](function(){_0x1affe3[_0xf09d('0x19')](0xcc)[_0xf09d('0x1a')]();});}};}function handleEntityNotFound(_0x30041c,_0x5818d4){return function(_0x5863d8){if(!_0x5863d8){_0x30041c['sendStatus'](0x194);}return _0x5863d8;};}function handleError(_0x2f3803,_0x2d1da5){_0x2d1da5=_0x2d1da5||0x1f4;return function(_0x28eb98){logger[_0xf09d('0x27')](_0x28eb98[_0xf09d('0x28')]);if(_0x28eb98[_0xf09d('0x29')]){delete _0x28eb98[_0xf09d('0x29')];}_0x2f3803['status'](_0x2d1da5)[_0xf09d('0x2a')](_0x28eb98);};}exports['index']=function(_0x4b7eed,_0x1c4b5){var _0x252cef={},_0x5a7cbe={},_0x460f76={'count':0x0,'rows':[]};var _0x1c2fab=_[_0xf09d('0x2b')](db['Team'][_0xf09d('0x2c')],function(_0x7697a){return{'name':_0x7697a['fieldName'],'type':_0x7697a[_0xf09d('0x2d')][_0xf09d('0x2e')]};});_0x5a7cbe['model']=_['map'](_0x1c2fab,_0xf09d('0x29'));_0x5a7cbe['query']=_['keys'](_0x4b7eed[_0xf09d('0x2f')]);_0x5a7cbe[_0xf09d('0x30')]=_['intersection'](_0x5a7cbe[_0xf09d('0x31')],_0x5a7cbe['query']);_0x252cef['attributes']=_['intersection'](_0x5a7cbe[_0xf09d('0x31')],qs[_0xf09d('0x32')](_0x4b7eed['query'][_0xf09d('0x32')]));_0x252cef[_0xf09d('0x33')]=_0x252cef[_0xf09d('0x33')]['length']?_0x252cef['attributes']:_0x5a7cbe[_0xf09d('0x31')];if(!_0x4b7eed[_0xf09d('0x2f')][_0xf09d('0x34')](_0xf09d('0x35'))){_0x252cef[_0xf09d('0x36')]=qs['limit'](_0x4b7eed['query'][_0xf09d('0x36')]);_0x252cef[_0xf09d('0x1d')]=qs[_0xf09d('0x1d')](_0x4b7eed[_0xf09d('0x2f')][_0xf09d('0x1d')]);}_0x252cef[_0xf09d('0x37')]=qs[_0xf09d('0x38')](_0x4b7eed[_0xf09d('0x2f')][_0xf09d('0x38')]);_0x252cef[_0xf09d('0x39')]=qs[_0xf09d('0x30')](_[_0xf09d('0x3a')](_0x4b7eed['query'],_0x5a7cbe[_0xf09d('0x30')]));if(_0x4b7eed['query'][_0xf09d('0x3b')]){_0x252cef['where']=_[_0xf09d('0x3c')](_0x252cef[_0xf09d('0x39')],{'$or':_[_0xf09d('0x2b')](_0x1c2fab,function(_0x3e2b69){if(_0x3e2b69[_0xf09d('0x2d')]!==_0xf09d('0x3d')){var _0x2e2554={};_0x2e2554[_0x3e2b69[_0xf09d('0x29')]]={'$like':'%'+_0x4b7eed[_0xf09d('0x2f')][_0xf09d('0x3b')]+'%'};return _0x2e2554;}})});}_0x252cef=_[_0xf09d('0x3c')]({},_0x252cef,_0x4b7eed[_0xf09d('0x3e')]);var _0xd0ca64={'where':_0x252cef[_0xf09d('0x39')]};return db[_0xf09d('0x3f')][_0xf09d('0x1c')](_0xd0ca64)[_0xf09d('0x22')](function(_0xda9554){_0x460f76[_0xf09d('0x1c')]=_0xda9554;if(_0x4b7eed[_0xf09d('0x2f')]['includeAll']){_0x252cef[_0xf09d('0x40')]=[{'all':!![]}];}return db[_0xf09d('0x3f')][_0xf09d('0x41')](_0x252cef);})[_0xf09d('0x22')](function(_0x38355a){_0x460f76[_0xf09d('0x42')]=_0x38355a;return _0x460f76;})[_0xf09d('0x22')](respondWithFilteredResult(_0x1c4b5,_0x252cef))['catch'](handleError(_0x1c4b5,null));};exports['show']=function(_0x4c2021,_0x245cc9){var _0x3ff192={'raw':![],'where':{'id':_0x4c2021[_0xf09d('0x43')]['id']}},_0x1c69e0={};_0x1c69e0['model']=_['keys'](db[_0xf09d('0x3f')][_0xf09d('0x2c')]);_0x1c69e0['query']=_[_0xf09d('0x44')](_0x4c2021[_0xf09d('0x2f')]);_0x1c69e0[_0xf09d('0x30')]=_[_0xf09d('0x45')](_0x1c69e0[_0xf09d('0x31')],_0x1c69e0[_0xf09d('0x2f')]);_0x3ff192['attributes']=_['intersection'](_0x1c69e0['model'],qs['fields'](_0x4c2021[_0xf09d('0x2f')][_0xf09d('0x32')]));_0x3ff192[_0xf09d('0x33')]=_0x3ff192['attributes']['length']?_0x3ff192[_0xf09d('0x33')]:_0x1c69e0[_0xf09d('0x31')];if(_0x4c2021[_0xf09d('0x2f')][_0xf09d('0x46')]){_0x3ff192[_0xf09d('0x40')]=[{'all':!![]}];}_0x3ff192=_[_0xf09d('0x3c')]({},_0x3ff192,_0x4c2021['options']);return db[_0xf09d('0x3f')]['find'](_0x3ff192)['then'](handleEntityNotFound(_0x245cc9,null))[_0xf09d('0x22')](respondWithResult(_0x245cc9,null))[_0xf09d('0x47')](handleError(_0x245cc9,null));};exports[_0xf09d('0x48')]=function(_0x576f26,_0x4d6e35){return db[_0xf09d('0x3f')][_0xf09d('0x48')](_0x576f26[_0xf09d('0x49')],{})[_0xf09d('0x22')](function(_0x54abb5){var _0x48a411=_0x576f26[_0xf09d('0x4a')][_0xf09d('0x23')]({'plain':!![]});if(!_0x48a411)throw new Error(_0xf09d('0x4b'));if(_0x48a411[_0xf09d('0x4c')]===_0xf09d('0x4a')){var _0x43421d=_0x54abb5[_0xf09d('0x23')]({'plain':!![]});var _0x25934a='Teams';return db[_0xf09d('0x4d')][_0xf09d('0x4e')]({'where':{'name':_0x25934a,'userProfileId':_0x48a411[_0xf09d('0x4f')]},'raw':!![]})[_0xf09d('0x22')](function(_0x2b6b6b){if(_0x2b6b6b&&_0x2b6b6b['autoAssociation']===0x0){return db['UserProfileResource'][_0xf09d('0x48')]({'name':_0x43421d['name'],'resourceId':_0x43421d['id'],'type':_0x2b6b6b[_0xf09d('0x29')],'sectionId':_0x2b6b6b['id']},{})[_0xf09d('0x22')](function(){return _0x54abb5;});}else{return _0x54abb5;}})[_0xf09d('0x47')](function(_0x832840){logger[_0xf09d('0x27')](_0xf09d('0x50'),_0x832840);throw _0x832840;});}return _0x54abb5;})[_0xf09d('0x22')](respondWithResult(_0x4d6e35,0xc9))['catch'](handleError(_0x4d6e35,null));};exports['update']=function(_0x22495b,_0x18c94a){if(_0x22495b['body']['id']){delete _0x22495b[_0xf09d('0x49')]['id'];}return db['Team']['find']({'where':{'id':_0x22495b[_0xf09d('0x43')]['id']}})[_0xf09d('0x22')](handleEntityNotFound(_0x18c94a,null))[_0xf09d('0x22')](saveUpdates(_0x22495b['body'],null))[_0xf09d('0x22')](respondWithResult(_0x18c94a,null))[_0xf09d('0x47')](handleError(_0x18c94a,null));};exports['destroy']=function(_0x207bc6,_0x2c88d6){return db['Team']['find']({'where':{'id':_0x207bc6[_0xf09d('0x43')]['id']}})[_0xf09d('0x22')](handleEntityNotFound(_0x2c88d6,null))[_0xf09d('0x22')](removeEntity(_0x2c88d6,null))[_0xf09d('0x47')](handleError(_0x2c88d6,null));};exports['getQueues']=function(_0x3eab92,_0x59117c,_0x47b26f){return db[_0xf09d('0x3f')][_0xf09d('0x51')]({'where':{'id':_0x3eab92[_0xf09d('0x43')]['id']}})[_0xf09d('0x22')](handleEntityNotFound(_0x59117c,null))[_0xf09d('0x22')](function(_0x1d1b01){if(!_0x3eab92[_0xf09d('0x2f')][_0xf09d('0x52')]||!utils[_0xf09d('0x53')](_0x3eab92[_0xf09d('0x2f')][_0xf09d('0x52')])){throw new db[(_0xf09d('0x54'))][(_0xf09d('0x55'))](_0xf09d('0x56'));}var _0x385094={};var _0x4891ae={};_0x4891ae['model']=_['keys'](db[_[_0xf09d('0x57')](_0x3eab92[_0xf09d('0x2f')][_0xf09d('0x52')]['toLowerCase']())+_0xf09d('0x58')][_0xf09d('0x2c')]);_0x4891ae['query']=_['keys'](_0x3eab92[_0xf09d('0x2f')]);_0x4891ae[_0xf09d('0x30')]=_[_0xf09d('0x45')](_0x4891ae['model'],_0x4891ae[_0xf09d('0x2f')]);_0x385094[_0xf09d('0x33')]=_['intersection'](_0x4891ae[_0xf09d('0x31')],qs['fields'](_0x3eab92[_0xf09d('0x2f')][_0xf09d('0x32')]));_0x385094[_0xf09d('0x33')]=_0x385094[_0xf09d('0x33')][_0xf09d('0x59')]?_0x385094['attributes']:_0x4891ae[_0xf09d('0x31')];_0x385094['limit']=qs[_0xf09d('0x36')](_0x3eab92[_0xf09d('0x2f')][_0xf09d('0x36')]);_0x385094['offset']=qs[_0xf09d('0x1d')](_0x3eab92[_0xf09d('0x2f')][_0xf09d('0x1d')]);_0x385094[_0xf09d('0x37')]=qs[_0xf09d('0x38')](_0x3eab92[_0xf09d('0x2f')][_0xf09d('0x38')]);_0x385094[_0xf09d('0x39')]=qs[_0xf09d('0x30')](_['pick'](_0x3eab92[_0xf09d('0x2f')],_0x4891ae[_0xf09d('0x30')]));_0x385094=_[_0xf09d('0x3c')]({},_0x385094,_0x3eab92[_0xf09d('0x3e')]);return _0x1d1b01[_0xf09d('0x23')+_[_0xf09d('0x57')](_0x3eab92[_0xf09d('0x2f')][_0xf09d('0x52')][_0xf09d('0x5a')]())+'Queues'](_0x385094);})[_0xf09d('0x22')](respondWithResult(_0x59117c,null))[_0xf09d('0x47')](handleError(_0x59117c,null));};exports[_0xf09d('0x5b')]=function(_0x39a5c2,_0x3e694b,_0x183fce){return db[_0xf09d('0x3f')][_0xf09d('0x51')]({'where':{'id':_0x39a5c2['params']['id']}})[_0xf09d('0x22')](function(_0x3a555f){if(_0x3a555f){if(!_0x39a5c2[_0xf09d('0x49')][_0xf09d('0x52')]||!utils[_0xf09d('0x53')](_0x39a5c2[_0xf09d('0x49')]['channel'])){throw new db[(_0xf09d('0x54'))][(_0xf09d('0x55'))](_0xf09d('0x56'));}return _0x3a555f[_0xf09d('0x5c')+_[_0xf09d('0x57')](_0x39a5c2[_0xf09d('0x49')]['channel']['toLowerCase']())+_0xf09d('0x5d')](_0x39a5c2['body'][_0xf09d('0x5e')]);}return null;})[_0xf09d('0x22')](handleEntityNotFound(_0x3e694b,null))[_0xf09d('0x22')](respondWithStatusCode(_0x3e694b,null))[_0xf09d('0x47')](handleError(_0x3e694b,null));};exports[_0xf09d('0x5f')]=function(_0x54f6d1,_0x3f5808,_0x179396){return db[_0xf09d('0x3f')][_0xf09d('0x51')]({'where':{'id':_0x54f6d1['params']['id']}})[_0xf09d('0x22')](function(_0x276a67){if(_0x276a67){if(!_0x54f6d1[_0xf09d('0x2f')][_0xf09d('0x52')]||!utils[_0xf09d('0x53')](_0x54f6d1[_0xf09d('0x2f')][_0xf09d('0x52')])){throw new db[(_0xf09d('0x54'))][(_0xf09d('0x55'))](_0xf09d('0x56'));}return _0x276a67[_0xf09d('0x60')+_['capitalize'](_0x54f6d1[_0xf09d('0x2f')]['channel'][_0xf09d('0x5a')]())+'Queues'](_0x54f6d1[_0xf09d('0x2f')][_0xf09d('0x5e')]);}return null;})[_0xf09d('0x22')](handleEntityNotFound(_0x3f5808,null))['then'](respondWithStatusCode(_0x3f5808,null))[_0xf09d('0x47')](handleError(_0x3f5808,null));};exports['addAgents']=function(_0x3d65cd,_0x101473,_0x4e473e){return db[_0xf09d('0x3f')]['find']({'where':{'id':_0x3d65cd[_0xf09d('0x43')]['id']}})['then'](handleEntityNotFound(_0x101473,null))[_0xf09d('0x22')](function(_0x34569b){if(_0x34569b){var _0x20e5bb=[_0xf09d('0x61'),_0xf09d('0x62'),_0xf09d('0x63'),'Sms',_0xf09d('0x64'),_0xf09d('0x65')];return BPromise[_0xf09d('0x66')](_0x20e5bb,function(_0x28b69b){return _0x34569b[_0xf09d('0x23')+_0x28b69b+_0xf09d('0x5d')]({'attributes':['id','name']})[_0xf09d('0x22')](function(_0x5748eb){return BPromise[_0xf09d('0x66')](_0x5748eb,function(_0x1eaac2){return _0x1eaac2[_0xf09d('0x67')](_0x3d65cd[_0xf09d('0x49')][_0xf09d('0x5e')])[_0xf09d('0x22')](function(){if(_0x28b69b===_0xf09d('0x61')){return db[_0xf09d('0x68')][_0xf09d('0x41')]({'where':{'id':_0x3d65cd[_0xf09d('0x49')]['ids']},'attributes':['id',_0xf09d('0x29'),_0xf09d('0x69'),_0xf09d('0x6a'),_0xf09d('0x6b')],'raw':!![]})[_0xf09d('0x22')](function(_0x8c7171){return BPromise[_0xf09d('0x66')](_['filter'](_0x8c7171,{'online':0x1}),function(_0x4148f1){return db['UserVoiceQueueRt'][_0xf09d('0x6c')]({'membername':_0x4148f1[_0xf09d('0x29')],'UserId':_0x4148f1['id'],'queue_name':_0x1eaac2[_0xf09d('0x29')],'VoiceQueueId':_0x1eaac2['id'],'interface':_[_0xf09d('0x6d')](_0x4148f1[_0xf09d('0x6b')])?util['format']('SIP/%s',_0x4148f1['name']):_0x4148f1[_0xf09d('0x6b')],'paused':_0x4148f1[_0xf09d('0x6a')]||![],'penalty':0x0});});});}});});})[_0xf09d('0x22')](function(){return _0x34569b;});})[_0xf09d('0x22')](function(){return _0x34569b;});}})['then'](function(_0x1ba02e){if(_0x1ba02e){return _0x1ba02e['addAgents'](_0x3d65cd[_0xf09d('0x49')]['ids'],_[_0xf09d('0x6e')](_0x3d65cd[_0xf09d('0x49')],['ids','id'])||{})['spread'](function(_0xc1f1b){for(var _0x39afd4=0x0;_0x39afd4<_0x3d65cd[_0xf09d('0x49')][_0xf09d('0x5e')][_0xf09d('0x59')];_0x39afd4+=0x1){socket[_0xf09d('0x6f')](_0xf09d('0x70'),{'UserId':_0x3d65cd[_0xf09d('0x49')][_0xf09d('0x5e')][_0x39afd4],'TeamId':_0x3d65cd[_0xf09d('0x43')]['id']});}return _0xc1f1b;});}})[_0xf09d('0x22')](respondWithResult(_0x101473,null))['catch'](handleError(_0x101473,null));};exports[_0xf09d('0x71')]=function(_0x4f1611,_0x441a96,_0x13242e){return db[_0xf09d('0x3f')][_0xf09d('0x4e')]({'where':{'id':_0x4f1611['params']['id']}})['then'](handleEntityNotFound(_0x441a96,null))[_0xf09d('0x22')](function(_0x4e4eec){if(_0x4e4eec){return BPromise[_0xf09d('0x66')]([_0xf09d('0x72'),_0xf09d('0x73'),_0xf09d('0x74'),_0xf09d('0x75'),'fax',_0xf09d('0x76')],function(_0x488243){return _0x4e4eec[_0xf09d('0x23')+_[_0xf09d('0x57')](_0x488243)+'Queues']({'attributes':['id','name']})['then'](function(_0x2a91bc){return BPromise[_0xf09d('0x66')](_0x2a91bc,function(_0x357692){return _0x357692[_0xf09d('0x71')](_0x4f1611[_0xf09d('0x2f')][_0xf09d('0x5e')])['then'](function(){if(_0x488243==='voice'){return db[_0xf09d('0x77')]['destroy']({'where':{'VoiceQueueId':_0x357692['id'],'UserId':_0x4f1611[_0xf09d('0x2f')][_0xf09d('0x5e')]}});}});});})['then'](function(){return _0x4e4eec;});})[_0xf09d('0x22')](function(){return _0x4e4eec;});}})['then'](function(_0xec4e59){if(_0xec4e59){return _0xec4e59[_0xf09d('0x71')](_0x4f1611[_0xf09d('0x2f')][_0xf09d('0x5e')])[_0xf09d('0x22')](function(){if(_[_0xf09d('0x78')](_0x4f1611[_0xf09d('0x2f')]['ids'])){for(var _0x5990a9=0x0;_0x5990a9<_0x4f1611[_0xf09d('0x2f')][_0xf09d('0x5e')]['length'];_0x5990a9+=0x1){socket[_0xf09d('0x6f')]('userTeam:remove',{'UserId':Number(_0x4f1611[_0xf09d('0x2f')][_0xf09d('0x5e')][_0x5990a9]),'TeamId':Number(_0x4f1611[_0xf09d('0x43')]['id'])});}}else{socket[_0xf09d('0x6f')]('userTeam:remove',{'UserId':Number(_0x4f1611[_0xf09d('0x2f')][_0xf09d('0x5e')]),'TeamId':Number(_0x4f1611['params']['id'])});}});}})[_0xf09d('0x22')](respondWithStatusCode(_0x441a96,null))[_0xf09d('0x47')](handleError(_0x441a96,null));};exports['getAgents']=function(_0x2b8422,_0x1d33ed,_0x3c2030){var _0x7947d2={};var _0x3d0125={};var _0x410550;var _0xacf62f;return db['Team'][_0xf09d('0x51')]({'where':{'id':_0x2b8422[_0xf09d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d33ed,null))[_0xf09d('0x22')](function(_0x47106b){if(_0x47106b){_0x410550=_0x47106b;_0x3d0125[_0xf09d('0x31')]=_[_0xf09d('0x44')](db[_0xf09d('0x68')]['rawAttributes']);_0x3d0125[_0xf09d('0x2f')]=_['keys'](_0x2b8422['query']);_0x3d0125[_0xf09d('0x30')]=_[_0xf09d('0x45')](_0x3d0125[_0xf09d('0x31')],_0x3d0125[_0xf09d('0x2f')]);_0x7947d2[_0xf09d('0x33')]=_[_0xf09d('0x45')](_0x3d0125['model'],qs[_0xf09d('0x32')](_0x2b8422['query']['fields']));_0x7947d2[_0xf09d('0x33')]=_0x7947d2[_0xf09d('0x33')][_0xf09d('0x59')]?_0x7947d2[_0xf09d('0x33')]:_0x3d0125[_0xf09d('0x31')];_0x7947d2[_0xf09d('0x37')]=qs[_0xf09d('0x38')](_0x2b8422[_0xf09d('0x2f')][_0xf09d('0x38')]);_0x7947d2[_0xf09d('0x39')]=qs[_0xf09d('0x30')](_[_0xf09d('0x3a')](_0x2b8422[_0xf09d('0x2f')],_0x3d0125[_0xf09d('0x30')]));if(_0x2b8422[_0xf09d('0x2f')][_0xf09d('0x3b')]){_0x7947d2['where']=_['merge'](_0x7947d2[_0xf09d('0x39')],{'$or':_[_0xf09d('0x2b')](_0x7947d2[_0xf09d('0x33')],function(_0x11ce4e){var _0x384a61={};_0x384a61[_0x11ce4e]={'$like':'%'+_0x2b8422[_0xf09d('0x2f')][_0xf09d('0x3b')]+'%'};return _0x384a61;})});}_0x7947d2=_[_0xf09d('0x3c')]({},_0x7947d2,_0x2b8422[_0xf09d('0x3e')]);return _0x410550['getAgents'](_0x7947d2);}})[_0xf09d('0x22')](function(_0x393d83){if(_0x393d83){_0xacf62f=_0x393d83[_0xf09d('0x59')];if(!_0x2b8422[_0xf09d('0x2f')]['hasOwnProperty'](_0xf09d('0x35'))){_0x7947d2[_0xf09d('0x36')]=qs[_0xf09d('0x36')](_0x2b8422[_0xf09d('0x2f')][_0xf09d('0x36')]);_0x7947d2['offset']=qs[_0xf09d('0x1d')](_0x2b8422[_0xf09d('0x2f')]['offset']);}return _0x410550[_0xf09d('0x79')](_0x7947d2);}})[_0xf09d('0x22')](function(_0x5059eb){if(_0x5059eb){return _0x5059eb?{'count':_0xacf62f,'rows':_0x5059eb}:null;}})[_0xf09d('0x22')](respondWithResult(_0x1d33ed,null))[_0xf09d('0x47')](handleError(_0x1d33ed,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 5965b8c..952cc3e 100644 --- a/server/api/team/team.events.js +++ b/server/api/team/team.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4958=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','save'];(function(_0x4d6769,_0x2cb9ea){var _0x4a81b3=function(_0x4048b0){while(--_0x4048b0){_0x4d6769['push'](_0x4d6769['shift']());}};_0x4a81b3(++_0x2cb9ea);}(_0x4958,0xb0));var _0x8495=function(_0x38a5a5,_0x4aa537){_0x38a5a5=_0x38a5a5-0x0;var _0x33f624=_0x4958[_0x38a5a5];return _0x33f624;};'use strict';var EventEmitter=require('events');var Team=require(_0x8495('0x0'))['db'][_0x8495('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x8495('0x2')](0x0);var events={'afterCreate':_0x8495('0x3'),'afterUpdate':_0x8495('0x4'),'afterDestroy':'remove'};function emitEvent(_0x43420f){return function(_0x14a665,_0x1be773,_0x99a75e){TeamEvents[_0x8495('0x5')](_0x43420f+':'+_0x14a665['id'],_0x14a665);TeamEvents[_0x8495('0x5')](_0x43420f,_0x14a665);_0x99a75e(null);};}for(var e in events){if(events[_0x8495('0x6')](e)){var event=events[e];Team[_0x8495('0x7')](e,emitEvent(event));}}module[_0x8495('0x8')]=TeamEvents; \ No newline at end of file +var _0x2b12=['../../mysqldb','Team','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x4445d9,_0x5de202){var _0x56c479=function(_0x1738aa){while(--_0x1738aa){_0x4445d9['push'](_0x4445d9['shift']());}};_0x56c479(++_0x5de202);}(_0x2b12,0xd7));var _0x22b1=function(_0x244dd4,_0x3d158f){_0x244dd4=_0x244dd4-0x0;var _0x465198=_0x2b12[_0x244dd4];return _0x465198;};'use strict';var EventEmitter=require(_0x22b1('0x0'));var Team=require(_0x22b1('0x1'))['db'][_0x22b1('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x22b1('0x3')](0x0);var events={'afterCreate':_0x22b1('0x4'),'afterUpdate':_0x22b1('0x5'),'afterDestroy':_0x22b1('0x6')};function emitEvent(_0xde3ffa){return function(_0x68bf46,_0x257a67,_0x3eb2bf){TeamEvents[_0x22b1('0x7')](_0xde3ffa+':'+_0x68bf46['id'],_0x68bf46);TeamEvents['emit'](_0xde3ffa,_0x68bf46);_0x3eb2bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x22b1('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 11879f4..06836bb 100644 --- a/server/api/team/team.model.js +++ b/server/api/team/team.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b9e=['teams','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','Team'];(function(_0x21b7f5,_0xfde77){var _0x5686f1=function(_0xfb397b){while(--_0xfb397b){_0x21b7f5['push'](_0x21b7f5['shift']());}};_0x5686f1(++_0xfde77);}(_0x8b9e,0x14b));var _0xe8b9=function(_0x3c9520,_0x949664){_0x3c9520=_0x3c9520-0x0;var _0x54ef84=_0x8b9e[_0x3c9520];return _0x54ef84;};'use strict';var _=require('lodash');var util=require(_0xe8b9('0x0'));var logger=require('../../config/logger')(_0xe8b9('0x1'));var moment=require('moment');var BPromise=require(_0xe8b9('0x2'));var rp=require(_0xe8b9('0x3'));var fs=require('fs');var path=require(_0xe8b9('0x4'));var rimraf=require(_0xe8b9('0x5'));var config=require(_0xe8b9('0x6'));var attributes=require(_0xe8b9('0x7'));module[_0xe8b9('0x8')]=function(_0x3fecb0,_0x45d377){return _0x3fecb0['define'](_0xe8b9('0x9'),attributes,{'tableName':_0xe8b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeba3=['path','rimraf','../../config/environment','./team.attributes','exports','define','Team','teams','lodash','util','api','bluebird','request-promise'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xeba3,0xb1));var _0x3eba=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xeba3[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x3eba('0x0'));var util=require(_0x3eba('0x1'));var logger=require('../../config/logger')(_0x3eba('0x2'));var moment=require('moment');var BPromise=require(_0x3eba('0x3'));var rp=require(_0x3eba('0x4'));var fs=require('fs');var path=require(_0x3eba('0x5'));var rimraf=require(_0x3eba('0x6'));var config=require(_0x3eba('0x7'));var attributes=require(_0x3eba('0x8'));module[_0x3eba('0x9')]=function(_0x16a9dc,_0x503b49){return _0x16a9dc[_0x3eba('0xa')](_0x3eba('0xb'),attributes,{'tableName':_0x3eba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 78926de..a91a322 100644 --- a/server/api/team/team.rpc.js +++ b/server/api/team/team.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ad9=['../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x439403,_0x2c9db9){var _0x5d4cab=function(_0x106579){while(--_0x106579){_0x439403['push'](_0x439403['shift']());}};_0x5d4cab(++_0x2c9db9);}(_0x4ad9,0x119));var _0x94ad=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4ad9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x94ad('0x0'));var moment=require(_0x94ad('0x1'));var BPromise=require(_0x94ad('0x2'));var rs=require(_0x94ad('0x3'));var fs=require('fs');var Redis=require(_0x94ad('0x4'));var db=require(_0x94ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x94ad('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x94ad('0x7'));var client=jayson[_0x94ad('0x8')][_0x94ad('0x9')]({'port':0x232a});config['redis']=_[_0x94ad('0xa')](config[_0x94ad('0xb')],{'host':_0x94ad('0xc'),'port':0x18eb});var socket=require(_0x94ad('0xd'))(new Redis(config[_0x94ad('0xb')]));require(_0x94ad('0xe'))[_0x94ad('0xf')](socket);function respondWithRpcPromise(_0x2fd17c,_0x6a3e65,_0x1fa74a){return new BPromise(function(_0x283ef7,_0x48ba0f){return client[_0x94ad('0x10')](_0x2fd17c,_0x1fa74a)['then'](function(_0x2ad158){logger[_0x94ad('0x11')](_0x94ad('0x12'),_0x6a3e65,_0x94ad('0x13'));logger[_0x94ad('0x14')](_0x94ad('0x15'),_0x6a3e65,_0x94ad('0x13'),JSON[_0x94ad('0x16')](_0x2ad158));if(_0x2ad158[_0x94ad('0x17')]){if(_0x2ad158['error']['code']===0x1f4){logger[_0x94ad('0x17')](_0x94ad('0x12'),_0x6a3e65,_0x2ad158[_0x94ad('0x17')][_0x94ad('0x18')]);return _0x48ba0f(_0x2ad158['error'][_0x94ad('0x18')]);}logger[_0x94ad('0x17')](_0x94ad('0x12'),_0x6a3e65,_0x2ad158[_0x94ad('0x17')]['message']);return _0x283ef7(_0x2ad158[_0x94ad('0x17')][_0x94ad('0x18')]);}else{logger[_0x94ad('0x11')](_0x94ad('0x12'),_0x6a3e65,_0x94ad('0x13'));_0x283ef7(_0x2ad158[_0x94ad('0x19')]['message']);}})['catch'](function(_0xc30eba){logger[_0x94ad('0x17')](_0x94ad('0x12'),_0x6a3e65,_0xc30eba);_0x48ba0f(_0xc30eba);});});} \ No newline at end of file +var _0x57c7=['socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','localhost'];(function(_0x44f781,_0x1b984e){var _0x1b0b31=function(_0x50819f){while(--_0x50819f){_0x44f781['push'](_0x44f781['shift']());}};_0x1b0b31(++_0x1b984e);}(_0x57c7,0x194));var _0x757c=function(_0x46ed0f,_0xab0142){_0x46ed0f=_0x46ed0f-0x0;var _0x4fcd95=_0x57c7[_0x46ed0f];return _0x4fcd95;};'use strict';var _=require('lodash');var util=require(_0x757c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x757c('0x1'));var fs=require('fs');var Redis=require(_0x757c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x757c('0x3'));var logger=require('../../config/logger')(_0x757c('0x4'));var config=require(_0x757c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x757c('0x6')][_0x757c('0x7')]({'port':0x232a});config[_0x757c('0x8')]=_['defaults'](config['redis'],{'host':_0x757c('0x9'),'port':0x18eb});var socket=require(_0x757c('0xa'))(new Redis(config[_0x757c('0x8')]));require(_0x757c('0xb'))[_0x757c('0xc')](socket);function respondWithRpcPromise(_0x16d944,_0x5b4a2a,_0x4ae562){return new BPromise(function(_0x19ed42,_0xce9560){return client[_0x757c('0xd')](_0x16d944,_0x4ae562)['then'](function(_0x3d5cad){logger[_0x757c('0xe')](_0x757c('0xf'),_0x5b4a2a,_0x757c('0x10'));logger[_0x757c('0x11')](_0x757c('0x12'),_0x5b4a2a,_0x757c('0x10'),JSON[_0x757c('0x13')](_0x3d5cad));if(_0x3d5cad[_0x757c('0x14')]){if(_0x3d5cad[_0x757c('0x14')]['code']===0x1f4){logger[_0x757c('0x14')](_0x757c('0xf'),_0x5b4a2a,_0x3d5cad[_0x757c('0x14')][_0x757c('0x15')]);return _0xce9560(_0x3d5cad[_0x757c('0x14')][_0x757c('0x15')]);}logger[_0x757c('0x14')]('Team,\x20%s,\x20%s',_0x5b4a2a,_0x3d5cad['error'][_0x757c('0x15')]);return _0x19ed42(_0x3d5cad['error']['message']);}else{logger[_0x757c('0xe')](_0x757c('0xf'),_0x5b4a2a,'request\x20sent');_0x19ed42(_0x3d5cad[_0x757c('0x16')]['message']);}})['catch'](function(_0x63a562){logger[_0x757c('0x14')](_0x757c('0xf'),_0x5b4a2a,_0x63a562);_0xce9560(_0x63a562);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 02be3ba..f4b540d 100644 --- a/server/api/team/team.socket.js +++ b/server/api/team/team.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf603=['removeListener','register','length','team:','./team.events','save','update','emit'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xf603,0x124));var _0x3f60=function(_0x42f68a,_0x14c516){_0x42f68a=_0x42f68a-0x0;var _0xf59a2d=_0xf603[_0x42f68a];return _0xf59a2d;};'use strict';var TeamEvents=require(_0x3f60('0x0'));var events=[_0x3f60('0x1'),'remove',_0x3f60('0x2')];function createListener(_0x23c3fb,_0x2f1d81){return function(_0x1b68aa){_0x2f1d81[_0x3f60('0x3')](_0x23c3fb,_0x1b68aa);};}function removeListener(_0x1403db,_0x21a566){return function(){TeamEvents[_0x3f60('0x4')](_0x1403db,_0x21a566);};}exports[_0x3f60('0x5')]=function(_0x49d1e0){for(var _0x59bc82=0x0,_0x49a08c=events[_0x3f60('0x6')];_0x59bc82<_0x49a08c;_0x59bc82++){var _0x43ec55=events[_0x59bc82];var _0x75bb34=createListener(_0x3f60('0x7')+_0x43ec55,_0x49d1e0);TeamEvents['on'](_0x43ec55,_0x75bb34);}}; \ No newline at end of file +var _0x46e1=['remove','update','emit','register','length','./team.events','save'];(function(_0x197d93,_0x2eba86){var _0x1ae0ca=function(_0x4d7ea8){while(--_0x4d7ea8){_0x197d93['push'](_0x197d93['shift']());}};_0x1ae0ca(++_0x2eba86);}(_0x46e1,0x155));var _0x146e=function(_0x5a2121,_0xefbef4){_0x5a2121=_0x5a2121-0x0;var _0x2195fe=_0x46e1[_0x5a2121];return _0x2195fe;};'use strict';var TeamEvents=require(_0x146e('0x0'));var events=[_0x146e('0x1'),_0x146e('0x2'),_0x146e('0x3')];function createListener(_0x155784,_0x1ff284){return function(_0x3708b1){_0x1ff284[_0x146e('0x4')](_0x155784,_0x3708b1);};}function removeListener(_0x18dab9,_0x3bbaec){return function(){TeamEvents['removeListener'](_0x18dab9,_0x3bbaec);};}exports[_0x146e('0x5')]=function(_0x1f1f15){for(var _0x3de564=0x0,_0x228fe7=events[_0x146e('0x6')];_0x3de564<_0x228fe7;_0x3de564++){var _0x35e40e=events[_0x3de564];var _0x1c1398=createListener('team:'+_0x35e40e,_0x1f1f15);TeamEvents['on'](_0x35e40e,_0x1c1398);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d7a5a32..a0a918c 100644 --- a/server/api/template/index.js +++ b/server/api/template/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62e9=['post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','isAuthenticated','index','get','/:id','show'];(function(_0x25d494,_0xad99ef){var _0x56b739=function(_0x435345){while(--_0x435345){_0x25d494['push'](_0x25d494['shift']());}};_0x56b739(++_0xad99ef);}(_0x62e9,0x1d6));var _0x962e=function(_0x2dc1ad,_0x313747){_0x2dc1ad=_0x2dc1ad-0x0;var _0x2d2b4f=_0x62e9[_0x2dc1ad];return _0x2d2b4f;};'use strict';var multer=require(_0x962e('0x0'));var util=require(_0x962e('0x1'));var path=require('path');var timeout=require(_0x962e('0x2'));var express=require(_0x962e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x962e('0x4'));var config=require('../../config/environment');var controller=require('./template.controller');router['get']('/',auth[_0x962e('0x5')](),controller[_0x962e('0x6')]);router[_0x962e('0x7')](_0x962e('0x8'),auth['isAuthenticated'](),controller[_0x962e('0x9')]);router[_0x962e('0xa')]('/',auth[_0x962e('0x5')](),controller['create']);router[_0x962e('0xb')](_0x962e('0x8'),auth[_0x962e('0x5')](),controller[_0x962e('0xc')]);router[_0x962e('0xd')]('/:id',auth[_0x962e('0x5')](),controller[_0x962e('0xe')]);module[_0x962e('0xf')]=router; \ No newline at end of file +var _0x9f45=['put','update','exports','util','path','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create'];(function(_0x2edec6,_0x2449bf){var _0x2fa6ab=function(_0x2bdf72){while(--_0x2bdf72){_0x2edec6['push'](_0x2edec6['shift']());}};_0x2fa6ab(++_0x2449bf);}(_0x9f45,0xd3));var _0x59f4=function(_0x2983af,_0x568be0){_0x2983af=_0x2983af-0x0;var _0x24e753=_0x9f45[_0x2983af];return _0x24e753;};'use strict';var multer=require('multer');var util=require(_0x59f4('0x0'));var path=require(_0x59f4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x59f4('0x2'));var config=require(_0x59f4('0x3'));var controller=require('./template.controller');router['get']('/',auth[_0x59f4('0x4')](),controller['index']);router[_0x59f4('0x5')](_0x59f4('0x6'),auth[_0x59f4('0x4')](),controller[_0x59f4('0x7')]);router[_0x59f4('0x8')]('/',auth['isAuthenticated'](),controller[_0x59f4('0x9')]);router[_0x59f4('0xa')](_0x59f4('0x6'),auth[_0x59f4('0x4')](),controller[_0x59f4('0xb')]);router['delete'](_0x59f4('0x6'),auth[_0x59f4('0x4')](),controller['destroy']);module[_0x59f4('0xc')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 5c77bc5..d386652 100644 --- a/server/api/template/template.attributes.js +++ b/server/api/template/template.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6fa=['sequelize','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xb6fa[_0x31a576];return _0x30b1d3;};'use strict';var Sequelize=require(_0xab6f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xab6f('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3fb2=['sequelize','STRING'];(function(_0x44718d,_0x2b7280){var _0x1232b0=function(_0x1ca2c4){while(--_0x1ca2c4){_0x44718d['push'](_0x44718d['shift']());}};_0x1232b0(++_0x2b7280);}(_0x3fb2,0x154));var _0x23fb=function(_0x38f20c,_0x325e31){_0x38f20c=_0x38f20c-0x0;var _0x232195=_0x3fb2[_0x38f20c];return _0x232195;};'use strict';var Sequelize=require(_0x23fb('0x0'));module['exports']={'name':{'type':Sequelize[_0x23fb('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 06d49b5..abc89be 100644 --- a/server/api/template/template.controller.js +++ b/server/api/template/template.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4389=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','reject','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','model','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x39c06f,_0x108593){var _0x55c5ed=function(_0x338bc0){while(--_0x338bc0){_0x39c06f['push'](_0x39c06f['shift']());}};_0x55c5ed(++_0x108593);}(_0x4389,0x18b));var _0x9438=function(_0x1c1ae6,_0x537703){_0x1c1ae6=_0x1c1ae6-0x0;var _0x3f6c88=_0x4389[_0x1c1ae6];return _0x3f6c88;};'use strict';var pdf=require(_0x9438('0x0'));var emlformat=require(_0x9438('0x1'));var rimraf=require(_0x9438('0x2'));var zipdir=require(_0x9438('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9438('0x4'));var moment=require(_0x9438('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9438('0x6'));var path=require(_0x9438('0x7'));var sox=require(_0x9438('0x8'));var csv=require(_0x9438('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9438('0xa'));var squel=require(_0x9438('0xb'));var crypto=require(_0x9438('0xc'));var jsforce=require(_0x9438('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9438('0x9'));var querystring=require('querystring');var Papa=require(_0x9438('0xe'));var Redis=require(_0x9438('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9438('0x10'));var hardwareService=require(_0x9438('0x11'));var logger=require(_0x9438('0x12'))('api');var utils=require(_0x9438('0x13'));var config=require('../../config/environment');var db=require(_0x9438('0x14'))['db'];function respondWithStatusCode(_0x453c42,_0x3e9741){_0x3e9741=_0x3e9741||0xcc;return function(_0x4a173e){if(_0x4a173e){return _0x453c42[_0x9438('0x15')](_0x3e9741);}return _0x453c42[_0x9438('0x16')](_0x3e9741)['end']();};}function respondWithResult(_0x77d4c3,_0x40212b){_0x40212b=_0x40212b||0xc8;return function(_0x288871){if(_0x288871){return _0x77d4c3['status'](_0x40212b)['json'](_0x288871);}};}function respondWithFilteredResult(_0x57ac7f,_0xf51c5a){return function(_0x10311e){if(_0x10311e){var _0x3db658=_0x10311e['count'],_0x5adb5b=_0xf51c5a[_0x9438('0x17')],_0x185c50=_0xf51c5a[_0x9438('0x17')]+_0xf51c5a[_0x9438('0x18')],_0x5989a7;if(_0x185c50>=_0x3db658){_0x185c50=_0x3db658;_0x5989a7=0xc8;}else{_0x5989a7=0xce;}_0x57ac7f[_0x9438('0x16')](_0x5989a7);return _0x57ac7f[_0x9438('0x19')](_0x9438('0x1a'),_0x5adb5b+'-'+_0x185c50+'/'+_0x3db658)['json'](_0x10311e);}return null;};}function patchUpdates(_0x57603f){return function(_0x492837){try{jsonpatch['apply'](_0x492837,_0x57603f,!![]);}catch(_0x493710){return BPromise[_0x9438('0x1b')](_0x493710);}return _0x492837['save']();};}function saveUpdates(_0x58f4df,_0x20bb5a){return function(_0x7f18c3){if(_0x7f18c3){return _0x7f18c3[_0x9438('0x1c')](_0x58f4df)[_0x9438('0x1d')](function(_0x4f5641){return _0x4f5641;});}return null;};}function removeEntity(_0x4c6129,_0x2d15a8){return function(_0x2085f5){if(_0x2085f5){return _0x2085f5['destroy']()[_0x9438('0x1d')](function(){var _0x5d6875=_0x2085f5['get']({'plain':!![]});var _0x16134e='Templates';return db[_0x9438('0x1e')][_0x9438('0x1f')]({'where':{'type':_0x16134e,'resourceId':_0x5d6875['id']}})['then'](function(){return _0x2085f5;});})['then'](function(){_0x4c6129[_0x9438('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23e015,_0x855965){return function(_0x3b19c3){if(!_0x3b19c3){_0x23e015['sendStatus'](0x194);}return _0x3b19c3;};}function handleError(_0x4d0780,_0x54be75){_0x54be75=_0x54be75||0x1f4;return function(_0x2dad21){logger[_0x9438('0x20')](_0x2dad21[_0x9438('0x21')]);if(_0x2dad21['name']){delete _0x2dad21[_0x9438('0x22')];}_0x4d0780[_0x9438('0x16')](_0x54be75)[_0x9438('0x23')](_0x2dad21);};}exports[_0x9438('0x24')]=function(_0x44b175,_0x904f00){var _0x5509f2={},_0x18f9f9={},_0xbb84af={'count':0x0,'rows':[]};var _0x188789=_[_0x9438('0x25')](db[_0x9438('0x26')][_0x9438('0x27')],function(_0xdf086c){return{'name':_0xdf086c[_0x9438('0x28')],'type':_0xdf086c[_0x9438('0x29')][_0x9438('0x2a')]};});_0x18f9f9['model']=_[_0x9438('0x25')](_0x188789,_0x9438('0x22'));_0x18f9f9[_0x9438('0x2b')]=_[_0x9438('0x2c')](_0x44b175[_0x9438('0x2b')]);_0x18f9f9['filters']=_['intersection'](_0x18f9f9['model'],_0x18f9f9[_0x9438('0x2b')]);_0x5509f2[_0x9438('0x2d')]=_[_0x9438('0x2e')](_0x18f9f9['model'],qs[_0x9438('0x2f')](_0x44b175[_0x9438('0x2b')][_0x9438('0x2f')]));_0x5509f2['attributes']=_0x5509f2[_0x9438('0x2d')]['length']?_0x5509f2[_0x9438('0x2d')]:_0x18f9f9['model'];if(!_0x44b175[_0x9438('0x2b')][_0x9438('0x30')](_0x9438('0x31'))){_0x5509f2[_0x9438('0x18')]=qs['limit'](_0x44b175[_0x9438('0x2b')][_0x9438('0x18')]);_0x5509f2[_0x9438('0x17')]=qs[_0x9438('0x17')](_0x44b175[_0x9438('0x2b')]['offset']);}_0x5509f2[_0x9438('0x32')]=qs['sort'](_0x44b175[_0x9438('0x2b')][_0x9438('0x33')]);_0x5509f2[_0x9438('0x34')]=qs['filters'](_['pick'](_0x44b175['query'],_0x18f9f9[_0x9438('0x35')]));if(_0x44b175[_0x9438('0x2b')][_0x9438('0x36')]){_0x5509f2[_0x9438('0x34')]=_['merge'](_0x5509f2[_0x9438('0x34')],{'$or':_[_0x9438('0x25')](_0x188789,function(_0x901d83){if(_0x901d83[_0x9438('0x29')]!==_0x9438('0x37')){var _0x2581a6={};_0x2581a6[_0x901d83[_0x9438('0x22')]]={'$like':'%'+_0x44b175['query'][_0x9438('0x36')]+'%'};return _0x2581a6;}})});}_0x5509f2=_['merge']({},_0x5509f2,_0x44b175[_0x9438('0x38')]);var _0x35ed4c={'where':_0x5509f2['where']};return db[_0x9438('0x26')][_0x9438('0x39')](_0x35ed4c)[_0x9438('0x1d')](function(_0x5ea26a){_0xbb84af[_0x9438('0x39')]=_0x5ea26a;if(_0x44b175[_0x9438('0x2b')][_0x9438('0x3a')]){_0x5509f2[_0x9438('0x3b')]=[{'all':!![]}];}return db[_0x9438('0x26')][_0x9438('0x3c')](_0x5509f2);})['then'](function(_0x4bd896){_0xbb84af[_0x9438('0x3d')]=_0x4bd896;return _0xbb84af;})[_0x9438('0x1d')](respondWithFilteredResult(_0x904f00,_0x5509f2))[_0x9438('0x3e')](handleError(_0x904f00,null));};exports[_0x9438('0x3f')]=function(_0x501809,_0x26571b){var _0x1ed130={'raw':!![],'where':{'id':_0x501809[_0x9438('0x40')]['id']}},_0x1b8627={};_0x1b8627[_0x9438('0x41')]=_[_0x9438('0x2c')](db[_0x9438('0x26')][_0x9438('0x27')]);_0x1b8627[_0x9438('0x2b')]=_[_0x9438('0x2c')](_0x501809[_0x9438('0x2b')]);_0x1b8627[_0x9438('0x35')]=_[_0x9438('0x2e')](_0x1b8627[_0x9438('0x41')],_0x1b8627[_0x9438('0x2b')]);_0x1ed130[_0x9438('0x2d')]=_[_0x9438('0x2e')](_0x1b8627[_0x9438('0x41')],qs['fields'](_0x501809[_0x9438('0x2b')][_0x9438('0x2f')]));_0x1ed130['attributes']=_0x1ed130[_0x9438('0x2d')][_0x9438('0x42')]?_0x1ed130[_0x9438('0x2d')]:_0x1b8627['model'];if(_0x501809['query'][_0x9438('0x3a')]){_0x1ed130[_0x9438('0x3b')]=[{'all':!![]}];}_0x1ed130=_[_0x9438('0x43')]({},_0x1ed130,_0x501809[_0x9438('0x38')]);return db[_0x9438('0x26')][_0x9438('0x44')](_0x1ed130)[_0x9438('0x1d')](handleEntityNotFound(_0x26571b,null))[_0x9438('0x1d')](respondWithResult(_0x26571b,null))[_0x9438('0x3e')](handleError(_0x26571b,null));};exports[_0x9438('0x45')]=function(_0x347ff6,_0x5d2503){return db[_0x9438('0x26')]['create'](_0x347ff6[_0x9438('0x46')],{})[_0x9438('0x1d')](function(_0x18ded4){var _0x567d9d=_0x347ff6[_0x9438('0x47')]['get']({'plain':!![]});if(!_0x567d9d)throw new Error(_0x9438('0x48'));if(_0x567d9d[_0x9438('0x49')]===_0x9438('0x47')){var _0x207fd7=_0x18ded4['get']({'plain':!![]});var _0x3fde34=_0x9438('0x4a');return db[_0x9438('0x4b')][_0x9438('0x44')]({'where':{'name':_0x3fde34,'userProfileId':_0x567d9d[_0x9438('0x4c')]},'raw':!![]})[_0x9438('0x1d')](function(_0x21cb69){if(_0x21cb69&&_0x21cb69[_0x9438('0x4d')]===0x0){return db['UserProfileResource'][_0x9438('0x45')]({'name':_0x207fd7[_0x9438('0x22')],'resourceId':_0x207fd7['id'],'type':_0x21cb69[_0x9438('0x22')],'sectionId':_0x21cb69['id']},{})['then'](function(){return _0x18ded4;});}else{return _0x18ded4;}})[_0x9438('0x3e')](function(_0x2dddc5){logger[_0x9438('0x20')](_0x9438('0x4e'),_0x2dddc5);throw _0x2dddc5;});}return _0x18ded4;})[_0x9438('0x1d')](respondWithResult(_0x5d2503,0xc9))[_0x9438('0x3e')](handleError(_0x5d2503,null));};exports['update']=function(_0x431ef7,_0x1e2a95){if(_0x431ef7[_0x9438('0x46')]['id']){delete _0x431ef7['body']['id'];}return db[_0x9438('0x26')][_0x9438('0x44')]({'where':{'id':_0x431ef7[_0x9438('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e2a95,null))[_0x9438('0x1d')](saveUpdates(_0x431ef7[_0x9438('0x46')],null))['then'](respondWithResult(_0x1e2a95,null))[_0x9438('0x3e')](handleError(_0x1e2a95,null));};exports[_0x9438('0x1f')]=function(_0x350d08,_0x13b708){return db[_0x9438('0x26')][_0x9438('0x44')]({'where':{'id':_0x350d08['params']['id']}})[_0x9438('0x1d')](handleEntityNotFound(_0x13b708,null))[_0x9438('0x1d')](removeEntity(_0x13b708,null))[_0x9438('0x3e')](handleError(_0x13b708,null));}; \ No newline at end of file +var _0x445a=['request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','get','Templates','then','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir'];(function(_0x39d0ed,_0x346a6c){var _0x3432de=function(_0x4d20ce){while(--_0x4d20ce){_0x39d0ed['push'](_0x39d0ed['shift']());}};_0x3432de(++_0x346a6c);}(_0x445a,0x9e));var _0xa445=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x445a[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0xa445('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa445('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa445('0x2'));var moment=require('moment');var BPromise=require(_0xa445('0x3'));var Mustache=require(_0xa445('0x4'));var util=require(_0xa445('0x5'));var path=require('path');var sox=require(_0xa445('0x6'));var csv=require(_0xa445('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa445('0x8'));var squel=require(_0xa445('0x9'));var crypto=require(_0xa445('0xa'));var jsforce=require(_0xa445('0xb'));var deskjs=require(_0xa445('0xc'));var toCsv=require(_0xa445('0x7'));var querystring=require(_0xa445('0xd'));var Papa=require(_0xa445('0xe'));var Redis=require(_0xa445('0xf'));var authService=require(_0xa445('0x10'));var qs=require(_0xa445('0x11'));var as=require(_0xa445('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa445('0x13'))(_0xa445('0x14'));var utils=require(_0xa445('0x15'));var config=require(_0xa445('0x16'));var db=require(_0xa445('0x17'))['db'];function respondWithStatusCode(_0x28bef3,_0x2ec345){_0x2ec345=_0x2ec345||0xcc;return function(_0x4feafd){if(_0x4feafd){return _0x28bef3[_0xa445('0x18')](_0x2ec345);}return _0x28bef3[_0xa445('0x19')](_0x2ec345)[_0xa445('0x1a')]();};}function respondWithResult(_0x4c306c,_0x598e62){_0x598e62=_0x598e62||0xc8;return function(_0x33bddb){if(_0x33bddb){return _0x4c306c['status'](_0x598e62)[_0xa445('0x1b')](_0x33bddb);}};}function respondWithFilteredResult(_0x3f3953,_0x5b970b){return function(_0x1afa5d){if(_0x1afa5d){var _0x383161=_0x1afa5d[_0xa445('0x1c')],_0x5d7bf5=_0x5b970b[_0xa445('0x1d')],_0x186ef2=_0x5b970b['offset']+_0x5b970b[_0xa445('0x1e')],_0x2d0140;if(_0x186ef2>=_0x383161){_0x186ef2=_0x383161;_0x2d0140=0xc8;}else{_0x2d0140=0xce;}_0x3f3953[_0xa445('0x19')](_0x2d0140);return _0x3f3953['set'](_0xa445('0x1f'),_0x5d7bf5+'-'+_0x186ef2+'/'+_0x383161)[_0xa445('0x1b')](_0x1afa5d);}return null;};}function patchUpdates(_0x3d3519){return function(_0x121d87){try{jsonpatch[_0xa445('0x20')](_0x121d87,_0x3d3519,!![]);}catch(_0x7c7c05){return BPromise[_0xa445('0x21')](_0x7c7c05);}return _0x121d87['save']();};}function saveUpdates(_0x54cff9,_0x170148){return function(_0x4cd13b){if(_0x4cd13b){return _0x4cd13b[_0xa445('0x22')](_0x54cff9)['then'](function(_0xc842b2){return _0xc842b2;});}return null;};}function removeEntity(_0x2dc19b,_0x15b4ac){return function(_0x166610){if(_0x166610){return _0x166610[_0xa445('0x23')]()['then'](function(){var _0x2df964=_0x166610[_0xa445('0x24')]({'plain':!![]});var _0x41852b=_0xa445('0x25');return db['UserProfileResource'][_0xa445('0x23')]({'where':{'type':_0x41852b,'resourceId':_0x2df964['id']}})[_0xa445('0x26')](function(){return _0x166610;});})['then'](function(){_0x2dc19b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29eaf0,_0x3079c6){return function(_0x1ff676){if(!_0x1ff676){_0x29eaf0['sendStatus'](0x194);}return _0x1ff676;};}function handleError(_0x4d5b64,_0x19b391){_0x19b391=_0x19b391||0x1f4;return function(_0x4a65b6){logger[_0xa445('0x27')](_0x4a65b6[_0xa445('0x28')]);if(_0x4a65b6[_0xa445('0x29')]){delete _0x4a65b6[_0xa445('0x29')];}_0x4d5b64[_0xa445('0x19')](_0x19b391)[_0xa445('0x2a')](_0x4a65b6);};}exports[_0xa445('0x2b')]=function(_0x3d462d,_0x48e8d0){var _0x33a590={},_0xde82c4={},_0x2aa32b={'count':0x0,'rows':[]};var _0x4e45e0=_[_0xa445('0x2c')](db[_0xa445('0x2d')][_0xa445('0x2e')],function(_0x2b6468){return{'name':_0x2b6468[_0xa445('0x2f')],'type':_0x2b6468[_0xa445('0x30')]['key']};});_0xde82c4[_0xa445('0x31')]=_[_0xa445('0x2c')](_0x4e45e0,'name');_0xde82c4[_0xa445('0x32')]=_[_0xa445('0x33')](_0x3d462d[_0xa445('0x32')]);_0xde82c4[_0xa445('0x34')]=_[_0xa445('0x35')](_0xde82c4[_0xa445('0x31')],_0xde82c4[_0xa445('0x32')]);_0x33a590[_0xa445('0x36')]=_[_0xa445('0x35')](_0xde82c4[_0xa445('0x31')],qs[_0xa445('0x37')](_0x3d462d['query'][_0xa445('0x37')]));_0x33a590['attributes']=_0x33a590['attributes'][_0xa445('0x38')]?_0x33a590[_0xa445('0x36')]:_0xde82c4[_0xa445('0x31')];if(!_0x3d462d[_0xa445('0x32')][_0xa445('0x39')](_0xa445('0x3a'))){_0x33a590[_0xa445('0x1e')]=qs[_0xa445('0x1e')](_0x3d462d[_0xa445('0x32')]['limit']);_0x33a590['offset']=qs['offset'](_0x3d462d[_0xa445('0x32')][_0xa445('0x1d')]);}_0x33a590[_0xa445('0x3b')]=qs[_0xa445('0x3c')](_0x3d462d[_0xa445('0x32')][_0xa445('0x3c')]);_0x33a590[_0xa445('0x3d')]=qs[_0xa445('0x34')](_[_0xa445('0x3e')](_0x3d462d[_0xa445('0x32')],_0xde82c4['filters']));if(_0x3d462d[_0xa445('0x32')][_0xa445('0x3f')]){_0x33a590[_0xa445('0x3d')]=_['merge'](_0x33a590[_0xa445('0x3d')],{'$or':_['map'](_0x4e45e0,function(_0x503ac5){if(_0x503ac5[_0xa445('0x30')]!==_0xa445('0x40')){var _0x927aed={};_0x927aed[_0x503ac5[_0xa445('0x29')]]={'$like':'%'+_0x3d462d[_0xa445('0x32')]['filter']+'%'};return _0x927aed;}})});}_0x33a590=_[_0xa445('0x41')]({},_0x33a590,_0x3d462d[_0xa445('0x42')]);var _0x3d6fdd={'where':_0x33a590[_0xa445('0x3d')]};return db[_0xa445('0x2d')][_0xa445('0x1c')](_0x3d6fdd)[_0xa445('0x26')](function(_0x17316b){_0x2aa32b['count']=_0x17316b;if(_0x3d462d[_0xa445('0x32')][_0xa445('0x43')]){_0x33a590[_0xa445('0x44')]=[{'all':!![]}];}return db[_0xa445('0x2d')][_0xa445('0x45')](_0x33a590);})[_0xa445('0x26')](function(_0x1605b1){_0x2aa32b['rows']=_0x1605b1;return _0x2aa32b;})['then'](respondWithFilteredResult(_0x48e8d0,_0x33a590))[_0xa445('0x46')](handleError(_0x48e8d0,null));};exports['show']=function(_0x519b10,_0x2fb660){var _0x296e57={'raw':!![],'where':{'id':_0x519b10[_0xa445('0x47')]['id']}},_0x4450e3={};_0x4450e3[_0xa445('0x31')]=_[_0xa445('0x33')](db[_0xa445('0x2d')][_0xa445('0x2e')]);_0x4450e3[_0xa445('0x32')]=_[_0xa445('0x33')](_0x519b10[_0xa445('0x32')]);_0x4450e3['filters']=_[_0xa445('0x35')](_0x4450e3[_0xa445('0x31')],_0x4450e3[_0xa445('0x32')]);_0x296e57[_0xa445('0x36')]=_[_0xa445('0x35')](_0x4450e3[_0xa445('0x31')],qs[_0xa445('0x37')](_0x519b10[_0xa445('0x32')]['fields']));_0x296e57[_0xa445('0x36')]=_0x296e57[_0xa445('0x36')][_0xa445('0x38')]?_0x296e57[_0xa445('0x36')]:_0x4450e3[_0xa445('0x31')];if(_0x519b10[_0xa445('0x32')][_0xa445('0x43')]){_0x296e57['include']=[{'all':!![]}];}_0x296e57=_['merge']({},_0x296e57,_0x519b10[_0xa445('0x42')]);return db[_0xa445('0x2d')][_0xa445('0x48')](_0x296e57)[_0xa445('0x26')](handleEntityNotFound(_0x2fb660,null))['then'](respondWithResult(_0x2fb660,null))['catch'](handleError(_0x2fb660,null));};exports['create']=function(_0x458697,_0x2885f2){return db[_0xa445('0x2d')][_0xa445('0x49')](_0x458697[_0xa445('0x4a')],{})[_0xa445('0x26')](function(_0x12466e){var _0x5abe83=_0x458697['user'][_0xa445('0x24')]({'plain':!![]});if(!_0x5abe83)throw new Error(_0xa445('0x4b'));if(_0x5abe83[_0xa445('0x4c')]==='user'){var _0x3cf620=_0x12466e[_0xa445('0x24')]({'plain':!![]});var _0x2c83b7=_0xa445('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x2c83b7,'userProfileId':_0x5abe83['userProfileId']},'raw':!![]})[_0xa445('0x26')](function(_0x240313){if(_0x240313&&_0x240313[_0xa445('0x4d')]===0x0){return db[_0xa445('0x4e')][_0xa445('0x49')]({'name':_0x3cf620['name'],'resourceId':_0x3cf620['id'],'type':_0x240313[_0xa445('0x29')],'sectionId':_0x240313['id']},{})[_0xa445('0x26')](function(){return _0x12466e;});}else{return _0x12466e;}})[_0xa445('0x46')](function(_0x1d071b){logger[_0xa445('0x27')](_0xa445('0x4f'),_0x1d071b);throw _0x1d071b;});}return _0x12466e;})['then'](respondWithResult(_0x2885f2,0xc9))['catch'](handleError(_0x2885f2,null));};exports[_0xa445('0x22')]=function(_0x56cffd,_0x25acff){if(_0x56cffd['body']['id']){delete _0x56cffd[_0xa445('0x4a')]['id'];}return db[_0xa445('0x2d')][_0xa445('0x48')]({'where':{'id':_0x56cffd[_0xa445('0x47')]['id']}})[_0xa445('0x26')](handleEntityNotFound(_0x25acff,null))['then'](saveUpdates(_0x56cffd[_0xa445('0x4a')],null))[_0xa445('0x26')](respondWithResult(_0x25acff,null))['catch'](handleError(_0x25acff,null));};exports['destroy']=function(_0x5c63d0,_0x42410f){return db[_0xa445('0x2d')][_0xa445('0x48')]({'where':{'id':_0x5c63d0[_0xa445('0x47')]['id']}})['then'](handleEntityNotFound(_0x42410f,null))[_0xa445('0x26')](removeEntity(_0x42410f,null))['catch'](handleError(_0x42410f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 3d834c2..d4e34d9 100644 --- a/server/api/template/template.model.js +++ b/server/api/template/template.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e77=['moment','bluebird','path','rimraf','./template.attributes','define','lodash','util','../../config/logger','api'];(function(_0xfb461f,_0x2cfbb6){var _0x4f5e8e=function(_0x9561c6){while(--_0x9561c6){_0xfb461f['push'](_0xfb461f['shift']());}};_0x4f5e8e(++_0x2cfbb6);}(_0x6e77,0x11e));var _0x76e7=function(_0x406ae7,_0x12181b){_0x406ae7=_0x406ae7-0x0;var _0x5a5b9d=_0x6e77[_0x406ae7];return _0x5a5b9d;};'use strict';var _=require(_0x76e7('0x0'));var util=require(_0x76e7('0x1'));var logger=require(_0x76e7('0x2'))(_0x76e7('0x3'));var moment=require(_0x76e7('0x4'));var BPromise=require(_0x76e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e7('0x6'));var rimraf=require(_0x76e7('0x7'));var config=require('../../config/environment');var attributes=require(_0x76e7('0x8'));module['exports']=function(_0x338b5a,_0x43fbbf){return _0x338b5a[_0x76e7('0x9')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e6b=['../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x48f6aa,_0x427778){var _0x3310cf=function(_0x82e3b7){while(--_0x82e3b7){_0x48f6aa['push'](_0x48f6aa['shift']());}};_0x3310cf(++_0x427778);}(_0x8e6b,0x75));var _0xb8e6=function(_0x54e4aa,_0xa2116b){_0x54e4aa=_0x54e4aa-0x0;var _0x395cd2=_0x8e6b[_0x54e4aa];return _0x395cd2;};'use strict';var _=require(_0xb8e6('0x0'));var util=require(_0xb8e6('0x1'));var logger=require(_0xb8e6('0x2'))(_0xb8e6('0x3'));var moment=require(_0xb8e6('0x4'));var BPromise=require(_0xb8e6('0x5'));var rp=require(_0xb8e6('0x6'));var fs=require('fs');var path=require(_0xb8e6('0x7'));var rimraf=require(_0xb8e6('0x8'));var config=require(_0xb8e6('0x9'));var attributes=require(_0xb8e6('0xa'));module[_0xb8e6('0xb')]=function(_0x4273c4,_0x2c7841){return _0x4273c4['define'](_0xb8e6('0xc'),attributes,{'tableName':_0xb8e6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 73d7844..b513017 100644 --- a/server/api/template/template.rpc.js +++ b/server/api/template/template.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79a3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','GetTemplate','Template','findAll','options','raw','where','limit','map','attributes','include','model','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x56761c,_0x1e068a){var _0x2cc51c=function(_0x571c8a){while(--_0x571c8a){_0x56761c['push'](_0x56761c['shift']());}};_0x2cc51c(++_0x1e068a);}(_0x79a3,0x1da));var _0x379a=function(_0x238b9d,_0xb5abce){_0x238b9d=_0x238b9d-0x0;var _0x236c97=_0x79a3[_0x238b9d];return _0x236c97;};'use strict';var _=require(_0x379a('0x0'));var util=require(_0x379a('0x1'));var moment=require(_0x379a('0x2'));var BPromise=require('bluebird');var rs=require(_0x379a('0x3'));var fs=require('fs');var Redis=require(_0x379a('0x4'));var db=require(_0x379a('0x5'))['db'];var utils=require(_0x379a('0x6'));var logger=require(_0x379a('0x7'))(_0x379a('0x8'));var config=require(_0x379a('0x9'));var jayson=require(_0x379a('0xa'));var client=jayson[_0x379a('0xb')][_0x379a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c0da0,_0x25cc10,_0x56946b){return new BPromise(function(_0xf4906f,_0x4fc21f){return client[_0x379a('0xd')](_0x1c0da0,_0x56946b)[_0x379a('0xe')](function(_0x158b6a){logger[_0x379a('0xf')]('Template,\x20%s,\x20%s',_0x25cc10,_0x379a('0x10'));logger[_0x379a('0x11')](_0x379a('0x12'),_0x25cc10,_0x379a('0x10'),JSON[_0x379a('0x13')](_0x158b6a));if(_0x158b6a['error']){if(_0x158b6a[_0x379a('0x14')][_0x379a('0x15')]===0x1f4){logger[_0x379a('0x14')](_0x379a('0x16'),_0x25cc10,_0x158b6a[_0x379a('0x14')][_0x379a('0x17')]);return _0x4fc21f(_0x158b6a['error'][_0x379a('0x17')]);}logger[_0x379a('0x14')](_0x379a('0x16'),_0x25cc10,_0x158b6a[_0x379a('0x14')][_0x379a('0x17')]);return _0xf4906f(_0x158b6a[_0x379a('0x14')][_0x379a('0x17')]);}else{logger[_0x379a('0xf')](_0x379a('0x16'),_0x25cc10,_0x379a('0x10'));_0xf4906f(_0x158b6a[_0x379a('0x18')][_0x379a('0x17')]);}})['catch'](function(_0x6f4ade){logger[_0x379a('0x14')]('Template,\x20%s,\x20%s',_0x25cc10,_0x6f4ade);_0x4fc21f(_0x6f4ade);});});}exports[_0x379a('0x19')]=function(_0x17782a){var _0x287ff8=this;return new Promise(function(_0x10de3f,_0x29a1b9){return db[_0x379a('0x1a')][_0x379a('0x1b')]({'raw':_0x17782a['options']?_0x17782a[_0x379a('0x1c')][_0x379a('0x1d')]===undefined?!![]:![]:!![],'where':_0x17782a[_0x379a('0x1c')]?_0x17782a['options'][_0x379a('0x1e')]||null:null,'attributes':_0x17782a[_0x379a('0x1c')]?_0x17782a[_0x379a('0x1c')]['attributes']||null:null,'limit':_0x17782a[_0x379a('0x1c')]?_0x17782a[_0x379a('0x1c')][_0x379a('0x1f')]||null:null,'include':_0x17782a[_0x379a('0x1c')]?_0x17782a['options']['include']?_[_0x379a('0x20')](_0x17782a['options']['include'],function(_0x7397af){return{'model':db[_0x7397af['model']],'as':_0x7397af['as'],'attributes':_0x7397af[_0x379a('0x21')],'include':_0x7397af[_0x379a('0x22')]?_[_0x379a('0x20')](_0x7397af['include'],function(_0xf9f12){return{'model':db[_0xf9f12[_0x379a('0x23')]],'as':_0xf9f12['as'],'attributes':_0xf9f12[_0x379a('0x21')],'include':_0xf9f12[_0x379a('0x22')]?_['map'](_0xf9f12[_0x379a('0x22')],function(_0x953533){return{'model':db[_0x953533[_0x379a('0x23')]],'as':_0x953533['as'],'attributes':_0x953533[_0x379a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x379a('0xe')](function(_0x1b6ef6){logger['info'](_0x379a('0x19'),_0x17782a);logger[_0x379a('0x11')](_0x379a('0x19'),_0x17782a,JSON['stringify'](_0x1b6ef6));_0x10de3f(_0x1b6ef6);})[_0x379a('0x24')](function(_0x14353a){logger[_0x379a('0x14')](_0x379a('0x19'),_0x14353a[_0x379a('0x17')],_0x17782a);_0x29a1b9(_0x287ff8[_0x379a('0x14')](0x1f4,_0x14353a[_0x379a('0x17')]));});});}; \ No newline at end of file +var _0x9ee0=['catch','GetTemplate','Template','findAll','options','raw','where','limit','include','map','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3cb724,_0x3d2994){var _0x5ca376=function(_0x56103c){while(--_0x56103c){_0x3cb724['push'](_0x3cb724['shift']());}};_0x5ca376(++_0x3d2994);}(_0x9ee0,0x1c7));var _0x09ee=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x9ee0[_0x175a55];return _0x167adf;};'use strict';var _=require(_0x09ee('0x0'));var util=require(_0x09ee('0x1'));var moment=require(_0x09ee('0x2'));var BPromise=require(_0x09ee('0x3'));var rs=require(_0x09ee('0x4'));var fs=require('fs');var Redis=require(_0x09ee('0x5'));var db=require(_0x09ee('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x09ee('0x7'))(_0x09ee('0x8'));var config=require(_0x09ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x09ee('0xa')][_0x09ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3776fd,_0x531944,_0xd3198e){return new BPromise(function(_0x5f58c0,_0x1a1162){return client['request'](_0x3776fd,_0xd3198e)[_0x09ee('0xc')](function(_0x19f427){logger[_0x09ee('0xd')](_0x09ee('0xe'),_0x531944,'request\x20sent');logger[_0x09ee('0xf')](_0x09ee('0x10'),_0x531944,_0x09ee('0x11'),JSON['stringify'](_0x19f427));if(_0x19f427['error']){if(_0x19f427[_0x09ee('0x12')][_0x09ee('0x13')]===0x1f4){logger[_0x09ee('0x12')](_0x09ee('0xe'),_0x531944,_0x19f427[_0x09ee('0x12')]['message']);return _0x1a1162(_0x19f427[_0x09ee('0x12')][_0x09ee('0x14')]);}logger[_0x09ee('0x12')](_0x09ee('0xe'),_0x531944,_0x19f427['error'][_0x09ee('0x14')]);return _0x5f58c0(_0x19f427[_0x09ee('0x12')][_0x09ee('0x14')]);}else{logger[_0x09ee('0xd')]('Template,\x20%s,\x20%s',_0x531944,_0x09ee('0x11'));_0x5f58c0(_0x19f427['result'][_0x09ee('0x14')]);}})[_0x09ee('0x15')](function(_0x91ada8){logger['error'](_0x09ee('0xe'),_0x531944,_0x91ada8);_0x1a1162(_0x91ada8);});});}exports[_0x09ee('0x16')]=function(_0x5a8796){var _0x49b2e7=this;return new Promise(function(_0x5d0266,_0x6a8443){return db[_0x09ee('0x17')][_0x09ee('0x18')]({'raw':_0x5a8796[_0x09ee('0x19')]?_0x5a8796[_0x09ee('0x19')][_0x09ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a8796[_0x09ee('0x19')]?_0x5a8796[_0x09ee('0x19')][_0x09ee('0x1b')]||null:null,'attributes':_0x5a8796[_0x09ee('0x19')]?_0x5a8796[_0x09ee('0x19')]['attributes']||null:null,'limit':_0x5a8796[_0x09ee('0x19')]?_0x5a8796['options'][_0x09ee('0x1c')]||null:null,'include':_0x5a8796['options']?_0x5a8796['options'][_0x09ee('0x1d')]?_[_0x09ee('0x1e')](_0x5a8796[_0x09ee('0x19')][_0x09ee('0x1d')],function(_0x32926e){return{'model':db[_0x32926e[_0x09ee('0x1f')]],'as':_0x32926e['as'],'attributes':_0x32926e['attributes'],'include':_0x32926e['include']?_['map'](_0x32926e[_0x09ee('0x1d')],function(_0x4b6f9d){return{'model':db[_0x4b6f9d[_0x09ee('0x1f')]],'as':_0x4b6f9d['as'],'attributes':_0x4b6f9d['attributes'],'include':_0x4b6f9d[_0x09ee('0x1d')]?_[_0x09ee('0x1e')](_0x4b6f9d[_0x09ee('0x1d')],function(_0x1a3e4a){return{'model':db[_0x1a3e4a[_0x09ee('0x1f')]],'as':_0x1a3e4a['as'],'attributes':_0x1a3e4a[_0x09ee('0x20')]};}):[]};}):[]};}):[]:[]})[_0x09ee('0xc')](function(_0x2731d7){logger[_0x09ee('0xd')]('GetTemplate',_0x5a8796);logger[_0x09ee('0xf')](_0x09ee('0x16'),_0x5a8796,JSON[_0x09ee('0x21')](_0x2731d7));_0x5d0266(_0x2731d7);})[_0x09ee('0x15')](function(_0x1ab2de){logger[_0x09ee('0x12')]('GetTemplate',_0x1ab2de['message'],_0x5a8796);_0x6a8443(_0x49b2e7[_0x09ee('0x12')](0x1f4,_0x1ab2de[_0x09ee('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index abd8be2..0d0aee9 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80c4=['index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','addAllCondition','/:id/any_conditions','post','addAction','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x80c4,0x13a));var _0x480c=function(_0x11dae7,_0xc5a4a9){_0x11dae7=_0x11dae7-0x0;var _0x35f704=_0x80c4[_0x11dae7];return _0x35f704;};'use strict';var multer=require(_0x480c('0x0'));var util=require(_0x480c('0x1'));var path=require(_0x480c('0x2'));var timeout=require('connect-timeout');var express=require(_0x480c('0x3'));var router=express[_0x480c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x480c('0x5'));var config=require(_0x480c('0x6'));var controller=require(_0x480c('0x7'));router[_0x480c('0x8')]('/',auth[_0x480c('0x9')](),controller[_0x480c('0xa')]);router['get'](_0x480c('0xb'),auth['isAuthenticated'](),controller[_0x480c('0xc')]);router['get'](_0x480c('0xd'),auth[_0x480c('0x9')](),controller[_0x480c('0xe')]);router[_0x480c('0x8')]('/:id/any_conditions',auth[_0x480c('0x9')](),controller[_0x480c('0xf')]);router[_0x480c('0x8')](_0x480c('0x10'),auth[_0x480c('0x9')](),controller[_0x480c('0x11')]);router['post']('/',auth[_0x480c('0x9')](),controller['create']);router['post'](_0x480c('0xd'),auth[_0x480c('0x9')](),controller[_0x480c('0x12')]);router['post'](_0x480c('0x13'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x480c('0x14')](_0x480c('0x10'),auth[_0x480c('0x9')](),controller[_0x480c('0x15')]);router[_0x480c('0x16')](_0x480c('0xb'),auth['isAuthenticated'](),controller[_0x480c('0x17')]);router[_0x480c('0x18')](_0x480c('0xb'),auth[_0x480c('0x9')](),controller[_0x480c('0x19')]);module[_0x480c('0x1a')]=router; \ No newline at end of file +var _0xa5e8=['/:id/any_conditions','getAnyConditions','/:id/actions','getActions','/:id/all_conditions','addAllCondition','post','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0xa5e8,0x1bb));var _0x8a5e=function(_0xdab082,_0x161b50){_0xdab082=_0xdab082-0x0;var _0x4c19f3=_0xa5e8[_0xdab082];return _0x4c19f3;};'use strict';var multer=require('multer');var util=require(_0x8a5e('0x0'));var path=require(_0x8a5e('0x1'));var timeout=require(_0x8a5e('0x2'));var express=require(_0x8a5e('0x3'));var router=express['Router']();var auth=require(_0x8a5e('0x4'));var interaction=require(_0x8a5e('0x5'));var config=require(_0x8a5e('0x6'));var controller=require(_0x8a5e('0x7'));router[_0x8a5e('0x8')]('/',auth[_0x8a5e('0x9')](),controller[_0x8a5e('0xa')]);router['get'](_0x8a5e('0xb'),auth[_0x8a5e('0x9')](),controller[_0x8a5e('0xc')]);router['get']('/:id/all_conditions',auth[_0x8a5e('0x9')](),controller['getAllConditions']);router[_0x8a5e('0x8')](_0x8a5e('0xd'),auth[_0x8a5e('0x9')](),controller[_0x8a5e('0xe')]);router[_0x8a5e('0x8')](_0x8a5e('0xf'),auth[_0x8a5e('0x9')](),controller[_0x8a5e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x8a5e('0x11'),auth[_0x8a5e('0x9')](),controller[_0x8a5e('0x12')]);router[_0x8a5e('0x13')](_0x8a5e('0xd'),auth[_0x8a5e('0x9')](),controller['addAnyCondition']);router[_0x8a5e('0x13')](_0x8a5e('0xf'),auth['isAuthenticated'](),controller['addAction']);router[_0x8a5e('0x14')](_0x8a5e('0xb'),auth[_0x8a5e('0x9')](),controller['update']);router[_0x8a5e('0x15')](_0x8a5e('0xb'),auth[_0x8a5e('0x9')](),controller[_0x8a5e('0x16')]);module[_0x8a5e('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 044e8bb..7baf8e8 100644 --- a/server/api/trigger/trigger.attributes.js +++ b/server/api/trigger/trigger.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c4=['BOOLEAN','exports','STRING'];(function(_0x5e3c09,_0x449f3d){var _0x2e1626=function(_0x36728b){while(--_0x36728b){_0x5e3c09['push'](_0x5e3c09['shift']());}};_0x2e1626(++_0x449f3d);}(_0x49c4,0xf7));var _0x449c=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x49c4[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require('sequelize');module[_0x449c('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x449c('0x1')]},'status':{'type':Sequelize[_0x449c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xab86=['STRING','BOOLEAN','sequelize'];(function(_0x5d7ebd,_0xe17072){var _0x4d64bb=function(_0x3da0fa){while(--_0x3da0fa){_0x5d7ebd['push'](_0x5d7ebd['shift']());}};_0x4d64bb(++_0xe17072);}(_0xab86,0x194));var _0x6ab8=function(_0x4276c1,_0x4e0272){_0x4276c1=_0x4276c1-0x0;var _0x285342=_0xab86[_0x4276c1];return _0x285342;};'use strict';var Sequelize=require(_0x6ab8('0x0'));module['exports']={'name':{'type':Sequelize[_0x6ab8('0x1')]},'channel':{'type':Sequelize[_0x6ab8('0x1')]},'description':{'type':Sequelize[_0x6ab8('0x1')]},'status':{'type':Sequelize[_0x6ab8('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index d21c722..b21a13f 100644 --- a/server/api/trigger/trigger.controller.js +++ b/server/api/trigger/trigger.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa50f=['model','keys','filters','intersection','query','attributes','fields','length','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','TriggerAllId','Condition','getAnyConditions','findOne','pick','hasOwnProperty','Action','getActions','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','status','json','count','limit','set','Content-Range','reject','save','update','then','destroy','get','Triggers','end','sendStatus','stack','name','index','map','Trigger','rawAttributes','fieldName','type'];(function(_0x4e8401,_0x51b328){var _0x17269f=function(_0x35ac65){while(--_0x35ac65){_0x4e8401['push'](_0x4e8401['shift']());}};_0x17269f(++_0x51b328);}(_0xa50f,0x7e));var _0xfa50=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa50f[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0xfa50('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa50('0x1'));var jsonpatch=require(_0xfa50('0x2'));var rp=require(_0xfa50('0x3'));var moment=require(_0xfa50('0x4'));var BPromise=require(_0xfa50('0x5'));var Mustache=require('mustache');var util=require(_0xfa50('0x6'));var path=require('path');var sox=require(_0xfa50('0x7'));var csv=require(_0xfa50('0x8'));var ejs=require(_0xfa50('0x9'));var fs=require('fs');var _=require(_0xfa50('0xa'));var squel=require(_0xfa50('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfa50('0xc'));var toCsv=require(_0xfa50('0x8'));var querystring=require(_0xfa50('0xd'));var Papa=require('papaparse');var Redis=require(_0xfa50('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfa50('0xf'));var as=require(_0xfa50('0x10'));var hardwareService=require(_0xfa50('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfa50('0x12'))['db'];function respondWithStatusCode(_0x117b0b,_0x57dd25){_0x57dd25=_0x57dd25||0xcc;return function(_0x9ba7bf){if(_0x9ba7bf){return _0x117b0b['sendStatus'](_0x57dd25);}return _0x117b0b['status'](_0x57dd25)['end']();};}function respondWithResult(_0x3a8470,_0x4c0cde){_0x4c0cde=_0x4c0cde||0xc8;return function(_0x3d65e4){if(_0x3d65e4){return _0x3a8470[_0xfa50('0x13')](_0x4c0cde)[_0xfa50('0x14')](_0x3d65e4);}};}function respondWithFilteredResult(_0x33a730,_0x5e0b87){return function(_0x11505a){if(_0x11505a){var _0x391a05=_0x11505a[_0xfa50('0x15')],_0x304b0a=_0x5e0b87['offset'],_0x2a76bb=_0x5e0b87['offset']+_0x5e0b87[_0xfa50('0x16')],_0x96b39e;if(_0x2a76bb>=_0x391a05){_0x2a76bb=_0x391a05;_0x96b39e=0xc8;}else{_0x96b39e=0xce;}_0x33a730[_0xfa50('0x13')](_0x96b39e);return _0x33a730[_0xfa50('0x17')](_0xfa50('0x18'),_0x304b0a+'-'+_0x2a76bb+'/'+_0x391a05)[_0xfa50('0x14')](_0x11505a);}return null;};}function patchUpdates(_0x4798da){return function(_0x5c61bf){try{jsonpatch['apply'](_0x5c61bf,_0x4798da,!![]);}catch(_0xef0b64){return BPromise[_0xfa50('0x19')](_0xef0b64);}return _0x5c61bf[_0xfa50('0x1a')]();};}function saveUpdates(_0x414c30,_0x4f132c){return function(_0x1ead69){if(_0x1ead69){return _0x1ead69[_0xfa50('0x1b')](_0x414c30)[_0xfa50('0x1c')](function(_0x2fdde1){return _0x2fdde1;});}return null;};}function removeEntity(_0x58ec30,_0xaceb08){return function(_0x4f3344){if(_0x4f3344){return _0x4f3344[_0xfa50('0x1d')]()[_0xfa50('0x1c')](function(){var _0x324df8=_0x4f3344[_0xfa50('0x1e')]({'plain':!![]});var _0x3b5623=_0xfa50('0x1f');return db['UserProfileResource'][_0xfa50('0x1d')]({'where':{'type':_0x3b5623,'resourceId':_0x324df8['id']}})[_0xfa50('0x1c')](function(){return _0x4f3344;});})[_0xfa50('0x1c')](function(){_0x58ec30[_0xfa50('0x13')](0xcc)[_0xfa50('0x20')]();});}};}function handleEntityNotFound(_0x2860eb,_0x19dbee){return function(_0x1f6427){if(!_0x1f6427){_0x2860eb[_0xfa50('0x21')](0x194);}return _0x1f6427;};}function handleError(_0x2803ca,_0x4eefa1){_0x4eefa1=_0x4eefa1||0x1f4;return function(_0x34493d){logger['error'](_0x34493d[_0xfa50('0x22')]);if(_0x34493d[_0xfa50('0x23')]){delete _0x34493d['name'];}_0x2803ca['status'](_0x4eefa1)['send'](_0x34493d);};}exports[_0xfa50('0x24')]=function(_0x5fb914,_0x274e9d){var _0x1f3376={},_0x1ec624={},_0x5361ea={'count':0x0,'rows':[]};var _0x434919=_[_0xfa50('0x25')](db[_0xfa50('0x26')][_0xfa50('0x27')],function(_0x259c32){return{'name':_0x259c32[_0xfa50('0x28')],'type':_0x259c32[_0xfa50('0x29')]['key']};});_0x1ec624[_0xfa50('0x2a')]=_[_0xfa50('0x25')](_0x434919,_0xfa50('0x23'));_0x1ec624['query']=_[_0xfa50('0x2b')](_0x5fb914['query']);_0x1ec624[_0xfa50('0x2c')]=_[_0xfa50('0x2d')](_0x1ec624[_0xfa50('0x2a')],_0x1ec624[_0xfa50('0x2e')]);_0x1f3376[_0xfa50('0x2f')]=_['intersection'](_0x1ec624[_0xfa50('0x2a')],qs['fields'](_0x5fb914[_0xfa50('0x2e')][_0xfa50('0x30')]));_0x1f3376[_0xfa50('0x2f')]=_0x1f3376['attributes'][_0xfa50('0x31')]?_0x1f3376['attributes']:_0x1ec624[_0xfa50('0x2a')];if(!_0x5fb914['query']['hasOwnProperty'](_0xfa50('0x32'))){_0x1f3376['limit']=qs[_0xfa50('0x16')](_0x5fb914[_0xfa50('0x2e')]['limit']);_0x1f3376[_0xfa50('0x33')]=qs[_0xfa50('0x33')](_0x5fb914[_0xfa50('0x2e')][_0xfa50('0x33')]);}_0x1f3376[_0xfa50('0x34')]=qs[_0xfa50('0x35')](_0x5fb914[_0xfa50('0x2e')]['sort']);_0x1f3376[_0xfa50('0x36')]=qs['filters'](_['pick'](_0x5fb914[_0xfa50('0x2e')],_0x1ec624[_0xfa50('0x2c')]));if(_0x5fb914[_0xfa50('0x2e')][_0xfa50('0x37')]){_0x1f3376[_0xfa50('0x36')]=_[_0xfa50('0x38')](_0x1f3376[_0xfa50('0x36')],{'$or':_[_0xfa50('0x25')](_0x434919,function(_0x3f55f6){if(_0x3f55f6[_0xfa50('0x29')]!==_0xfa50('0x39')){var _0x49d2d4={};_0x49d2d4[_0x3f55f6[_0xfa50('0x23')]]={'$like':'%'+_0x5fb914[_0xfa50('0x2e')][_0xfa50('0x37')]+'%'};return _0x49d2d4;}})});}_0x1f3376=_[_0xfa50('0x38')]({},_0x1f3376,_0x5fb914[_0xfa50('0x3a')]);var _0x16702b={'where':_0x1f3376['where']};return db[_0xfa50('0x26')]['count'](_0x16702b)[_0xfa50('0x1c')](function(_0x2cf190){_0x5361ea[_0xfa50('0x15')]=_0x2cf190;if(_0x5fb914['query'][_0xfa50('0x3b')]){_0x1f3376['include']=[{'all':!![]}];}return db[_0xfa50('0x26')][_0xfa50('0x3c')](_0x1f3376);})[_0xfa50('0x1c')](function(_0x260221){_0x5361ea[_0xfa50('0x3d')]=_0x260221;return _0x5361ea;})[_0xfa50('0x1c')](respondWithFilteredResult(_0x274e9d,_0x1f3376))[_0xfa50('0x3e')](handleError(_0x274e9d,null));};exports[_0xfa50('0x3f')]=function(_0x1cb246,_0x489ea2){var _0x254bef={'raw':![],'where':{'id':_0x1cb246['params']['id']}},_0x56732a={};_0x56732a['model']=_['keys'](db[_0xfa50('0x26')][_0xfa50('0x27')]);_0x56732a[_0xfa50('0x2e')]=_['keys'](_0x1cb246[_0xfa50('0x2e')]);_0x56732a[_0xfa50('0x2c')]=_[_0xfa50('0x2d')](_0x56732a[_0xfa50('0x2a')],_0x56732a[_0xfa50('0x2e')]);_0x254bef[_0xfa50('0x2f')]=_['intersection'](_0x56732a['model'],qs['fields'](_0x1cb246[_0xfa50('0x2e')][_0xfa50('0x30')]));_0x254bef['attributes']=_0x254bef['attributes']['length']?_0x254bef[_0xfa50('0x2f')]:_0x56732a[_0xfa50('0x2a')];if(_0x1cb246[_0xfa50('0x2e')][_0xfa50('0x3b')]){_0x254bef[_0xfa50('0x40')]=[{'all':!![]}];}_0x254bef=_[_0xfa50('0x38')]({},_0x254bef,_0x1cb246[_0xfa50('0x3a')]);return db[_0xfa50('0x26')][_0xfa50('0x41')](_0x254bef)[_0xfa50('0x1c')](handleEntityNotFound(_0x489ea2,null))[_0xfa50('0x1c')](respondWithResult(_0x489ea2,null))[_0xfa50('0x3e')](handleError(_0x489ea2,null));};exports[_0xfa50('0x42')]=function(_0x166310,_0xa62339){return db['Trigger'][_0xfa50('0x42')](_0x166310['body'],{})[_0xfa50('0x1c')](function(_0x3fe3e1){var _0x3edc66=_0x166310[_0xfa50('0x43')][_0xfa50('0x1e')]({'plain':!![]});if(!_0x3edc66)throw new Error(_0xfa50('0x44'));if(_0x3edc66['role']===_0xfa50('0x43')){var _0x302524=_0x3fe3e1['get']({'plain':!![]});var _0x23ae9f='Triggers';return db['UserProfileSection'][_0xfa50('0x41')]({'where':{'name':_0x23ae9f,'userProfileId':_0x3edc66['userProfileId']},'raw':!![]})[_0xfa50('0x1c')](function(_0x10ca32){if(_0x10ca32&&_0x10ca32[_0xfa50('0x45')]===0x0){return db[_0xfa50('0x46')][_0xfa50('0x42')]({'name':_0x302524[_0xfa50('0x23')],'resourceId':_0x302524['id'],'type':_0x10ca32['name'],'sectionId':_0x10ca32['id']},{})[_0xfa50('0x1c')](function(){return _0x3fe3e1;});}else{return _0x3fe3e1;}})[_0xfa50('0x3e')](function(_0x476fa0){logger[_0xfa50('0x47')](_0xfa50('0x48'),_0x476fa0);throw _0x476fa0;});}return _0x3fe3e1;})[_0xfa50('0x1c')](respondWithResult(_0xa62339,0xc9))[_0xfa50('0x3e')](handleError(_0xa62339,null));};exports['update']=function(_0x32bb30,_0x58a8f5){if(_0x32bb30['body']['id']){delete _0x32bb30[_0xfa50('0x49')]['id'];}return db[_0xfa50('0x26')][_0xfa50('0x41')]({'where':{'id':_0x32bb30['params']['id']}})[_0xfa50('0x1c')](handleEntityNotFound(_0x58a8f5,null))[_0xfa50('0x1c')](saveUpdates(_0x32bb30['body'],null))[_0xfa50('0x1c')](respondWithResult(_0x58a8f5,null))['catch'](handleError(_0x58a8f5,null));};exports[_0xfa50('0x1d')]=function(_0x15b187,_0x43fb54){return db[_0xfa50('0x26')]['find']({'where':{'id':_0x15b187[_0xfa50('0x4a')]['id']}})[_0xfa50('0x1c')](handleEntityNotFound(_0x43fb54,null))[_0xfa50('0x1c')](removeEntity(_0x43fb54,null))[_0xfa50('0x3e')](handleError(_0x43fb54,null));};exports[_0xfa50('0x4b')]=function(_0x130a88,_0x533cbe,_0x88b285){if(_0x130a88[_0xfa50('0x49')]['id']){delete _0x130a88[_0xfa50('0x49')]['id'];}return db[_0xfa50('0x26')]['find']({'where':{'id':_0x130a88['params']['id']}})['then'](handleEntityNotFound(_0x533cbe,null))[_0xfa50('0x1c')](function(_0x1bf78c){if(_0x1bf78c){_0x130a88[_0xfa50('0x49')][_0xfa50('0x4c')]=_0x1bf78c['id'];return db[_0xfa50('0x4d')][_0xfa50('0x42')](_0x130a88[_0xfa50('0x49')]);}})[_0xfa50('0x1c')](respondWithResult(_0x533cbe,null))[_0xfa50('0x3e')](handleError(_0x533cbe,null));};exports['addAnyCondition']=function(_0x4d5f1b,_0x24cc14,_0x377c1b){if(_0x4d5f1b[_0xfa50('0x49')]['id']){delete _0x4d5f1b[_0xfa50('0x49')]['id'];}return db[_0xfa50('0x26')]['find']({'where':{'id':_0x4d5f1b[_0xfa50('0x4a')]['id']}})[_0xfa50('0x1c')](handleEntityNotFound(_0x24cc14,null))['then'](function(_0x42eb8d){if(_0x42eb8d){_0x4d5f1b[_0xfa50('0x49')]['TriggerAnyId']=_0x42eb8d['id'];return db[_0xfa50('0x4d')][_0xfa50('0x42')](_0x4d5f1b[_0xfa50('0x49')]);}})[_0xfa50('0x1c')](respondWithResult(_0x24cc14,null))['catch'](handleError(_0x24cc14,null));};exports['getAllConditions']=function(_0x716920,_0x550586,_0x46201b){var _0x554b8c={};var _0x4f021b={};var _0x5acd41;var _0x41a992;return db[_0xfa50('0x26')]['findOne']({'where':{'id':_0x716920['params']['id']}})[_0xfa50('0x1c')](handleEntityNotFound(_0x550586,null))[_0xfa50('0x1c')](function(_0x59862d){if(_0x59862d){_0x5acd41=_0x59862d;_0x4f021b[_0xfa50('0x2a')]=_[_0xfa50('0x2b')](db[_0xfa50('0x4d')][_0xfa50('0x27')]);_0x4f021b[_0xfa50('0x2e')]=_[_0xfa50('0x2b')](_0x716920[_0xfa50('0x2e')]);_0x4f021b[_0xfa50('0x2c')]=_[_0xfa50('0x2d')](_0x4f021b[_0xfa50('0x2a')],_0x4f021b[_0xfa50('0x2e')]);_0x554b8c['attributes']=_[_0xfa50('0x2d')](_0x4f021b[_0xfa50('0x2a')],qs[_0xfa50('0x30')](_0x716920[_0xfa50('0x2e')]['fields']));_0x554b8c[_0xfa50('0x2f')]=_0x554b8c[_0xfa50('0x2f')][_0xfa50('0x31')]?_0x554b8c[_0xfa50('0x2f')]:_0x4f021b[_0xfa50('0x2a')];_0x554b8c['order']=qs['sort'](_0x716920['query'][_0xfa50('0x35')]);_0x554b8c[_0xfa50('0x36')]=qs[_0xfa50('0x2c')](_['pick'](_0x716920[_0xfa50('0x2e')],_0x4f021b[_0xfa50('0x2c')]));if(_0x716920['query'][_0xfa50('0x37')]){_0x554b8c['where']=_[_0xfa50('0x38')](_0x554b8c[_0xfa50('0x36')],{'$or':_[_0xfa50('0x25')](_0x554b8c[_0xfa50('0x2f')],function(_0x1461ba){var _0xea87e8={};_0xea87e8[_0x1461ba]={'$like':'%'+_0x716920[_0xfa50('0x2e')][_0xfa50('0x37')]+'%'};return _0xea87e8;})});}_0x554b8c=_[_0xfa50('0x38')]({},_0x554b8c,_0x716920[_0xfa50('0x3a')]);return _0x5acd41['getAllConditions'](_0x554b8c);}})[_0xfa50('0x1c')](function(_0x474dff){if(_0x474dff){_0x41a992=_0x474dff['length'];if(!_0x716920['query']['hasOwnProperty'](_0xfa50('0x32'))){_0x554b8c[_0xfa50('0x16')]=qs[_0xfa50('0x16')](_0x716920['query'][_0xfa50('0x16')]);_0x554b8c[_0xfa50('0x33')]=qs[_0xfa50('0x33')](_0x716920[_0xfa50('0x2e')][_0xfa50('0x33')]);}return _0x5acd41['getAllConditions'](_0x554b8c);}})[_0xfa50('0x1c')](function(_0x384841){if(_0x384841){return _0x384841?{'count':_0x41a992,'rows':_0x384841}:null;}})[_0xfa50('0x1c')](respondWithResult(_0x550586,null))[_0xfa50('0x3e')](handleError(_0x550586,null));};exports[_0xfa50('0x4e')]=function(_0x14a084,_0x3dc108,_0xcc5b7b){var _0x1de243={};var _0x2b76fd={};var _0x2d3197;var _0x108053;return db[_0xfa50('0x26')][_0xfa50('0x4f')]({'where':{'id':_0x14a084[_0xfa50('0x4a')]['id']}})[_0xfa50('0x1c')](handleEntityNotFound(_0x3dc108,null))[_0xfa50('0x1c')](function(_0x43932a){if(_0x43932a){_0x2d3197=_0x43932a;_0x2b76fd[_0xfa50('0x2a')]=_[_0xfa50('0x2b')](db[_0xfa50('0x4d')][_0xfa50('0x27')]);_0x2b76fd['query']=_[_0xfa50('0x2b')](_0x14a084[_0xfa50('0x2e')]);_0x2b76fd[_0xfa50('0x2c')]=_[_0xfa50('0x2d')](_0x2b76fd[_0xfa50('0x2a')],_0x2b76fd[_0xfa50('0x2e')]);_0x1de243[_0xfa50('0x2f')]=_[_0xfa50('0x2d')](_0x2b76fd[_0xfa50('0x2a')],qs[_0xfa50('0x30')](_0x14a084[_0xfa50('0x2e')][_0xfa50('0x30')]));_0x1de243['attributes']=_0x1de243[_0xfa50('0x2f')][_0xfa50('0x31')]?_0x1de243['attributes']:_0x2b76fd[_0xfa50('0x2a')];_0x1de243['order']=qs['sort'](_0x14a084[_0xfa50('0x2e')]['sort']);_0x1de243[_0xfa50('0x36')]=qs[_0xfa50('0x2c')](_[_0xfa50('0x50')](_0x14a084[_0xfa50('0x2e')],_0x2b76fd['filters']));if(_0x14a084[_0xfa50('0x2e')][_0xfa50('0x37')]){_0x1de243[_0xfa50('0x36')]=_['merge'](_0x1de243[_0xfa50('0x36')],{'$or':_[_0xfa50('0x25')](_0x1de243['attributes'],function(_0x175808){var _0x341b32={};_0x341b32[_0x175808]={'$like':'%'+_0x14a084['query'][_0xfa50('0x37')]+'%'};return _0x341b32;})});}_0x1de243=_[_0xfa50('0x38')]({},_0x1de243,_0x14a084[_0xfa50('0x3a')]);return _0x2d3197['getAnyConditions'](_0x1de243);}})[_0xfa50('0x1c')](function(_0xb2b988){if(_0xb2b988){_0x108053=_0xb2b988['length'];if(!_0x14a084[_0xfa50('0x2e')][_0xfa50('0x51')](_0xfa50('0x32'))){_0x1de243[_0xfa50('0x16')]=qs[_0xfa50('0x16')](_0x14a084[_0xfa50('0x2e')]['limit']);_0x1de243[_0xfa50('0x33')]=qs[_0xfa50('0x33')](_0x14a084[_0xfa50('0x2e')][_0xfa50('0x33')]);}return _0x2d3197['getAnyConditions'](_0x1de243);}})[_0xfa50('0x1c')](function(_0x25c9a0){if(_0x25c9a0){return _0x25c9a0?{'count':_0x108053,'rows':_0x25c9a0}:null;}})[_0xfa50('0x1c')](respondWithResult(_0x3dc108,null))['catch'](handleError(_0x3dc108,null));};exports['addAction']=function(_0x498b70,_0xde5fbc,_0x6da302){if(_0x498b70[_0xfa50('0x49')]['id']){delete _0x498b70['body']['id'];}return db[_0xfa50('0x26')][_0xfa50('0x41')]({'where':{'id':_0x498b70[_0xfa50('0x4a')]['id']}})[_0xfa50('0x1c')](handleEntityNotFound(_0xde5fbc,null))[_0xfa50('0x1c')](function(_0x33f7ee){if(_0x33f7ee){_0x498b70[_0xfa50('0x49')]['TriggerId']=_0x33f7ee['id'];return db[_0xfa50('0x52')][_0xfa50('0x42')](_0x498b70[_0xfa50('0x49')]);}})['then'](respondWithResult(_0xde5fbc,null))['catch'](handleError(_0xde5fbc,null));};exports[_0xfa50('0x53')]=function(_0x2a0deb,_0x7bd9c,_0x6d0f17){var _0x2c36fa={};var _0x53f9af={};var _0x2aeee6;var _0x12c842;return db['Trigger'][_0xfa50('0x4f')]({'where':{'id':_0x2a0deb[_0xfa50('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7bd9c,null))[_0xfa50('0x1c')](function(_0x5a1e69){if(_0x5a1e69){_0x2aeee6=_0x5a1e69;_0x53f9af[_0xfa50('0x2a')]=_[_0xfa50('0x2b')](db[_0xfa50('0x52')][_0xfa50('0x27')]);_0x53f9af[_0xfa50('0x2e')]=_[_0xfa50('0x2b')](_0x2a0deb['query']);_0x53f9af['filters']=_[_0xfa50('0x2d')](_0x53f9af[_0xfa50('0x2a')],_0x53f9af[_0xfa50('0x2e')]);_0x2c36fa['attributes']=_[_0xfa50('0x2d')](_0x53f9af[_0xfa50('0x2a')],qs[_0xfa50('0x30')](_0x2a0deb[_0xfa50('0x2e')][_0xfa50('0x30')]));_0x2c36fa['attributes']=_0x2c36fa[_0xfa50('0x2f')][_0xfa50('0x31')]?_0x2c36fa[_0xfa50('0x2f')]:_0x53f9af[_0xfa50('0x2a')];_0x2c36fa[_0xfa50('0x34')]=qs[_0xfa50('0x35')](_0x2a0deb[_0xfa50('0x2e')]['sort']);_0x2c36fa[_0xfa50('0x36')]=qs[_0xfa50('0x2c')](_['pick'](_0x2a0deb[_0xfa50('0x2e')],_0x53f9af['filters']));if(_0x2a0deb[_0xfa50('0x2e')][_0xfa50('0x37')]){_0x2c36fa[_0xfa50('0x36')]=_[_0xfa50('0x38')](_0x2c36fa[_0xfa50('0x36')],{'$or':_['map'](_0x2c36fa['attributes'],function(_0x451425){var _0x26077b={};_0x26077b[_0x451425]={'$like':'%'+_0x2a0deb['query'][_0xfa50('0x37')]+'%'};return _0x26077b;})});}_0x2c36fa=_['merge']({},_0x2c36fa,_0x2a0deb[_0xfa50('0x3a')]);return _0x2aeee6['getActions'](_0x2c36fa);}})['then'](function(_0xc8c33b){if(_0xc8c33b){_0x12c842=_0xc8c33b['length'];if(!_0x2a0deb['query'][_0xfa50('0x51')](_0xfa50('0x32'))){_0x2c36fa['limit']=qs[_0xfa50('0x16')](_0x2a0deb[_0xfa50('0x2e')][_0xfa50('0x16')]);_0x2c36fa['offset']=qs[_0xfa50('0x33')](_0x2a0deb[_0xfa50('0x2e')][_0xfa50('0x33')]);}return _0x2aeee6['getActions'](_0x2c36fa);}})[_0xfa50('0x1c')](function(_0x11da7e){if(_0x11da7e){return _0x11da7e?{'count':_0x12c842,'rows':_0x11da7e}:null;}})[_0xfa50('0x1c')](respondWithResult(_0x7bd9c,null))['catch'](handleError(_0x7bd9c,null));}; \ No newline at end of file +var _0xd6c6=['body','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','map','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','Triggers','UserProfileResource','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','pick','merge','filter','include','rows','catch','show','params','includeAll','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x19769a,_0x472d4b){var _0x1554ad=function(_0x1a931b){while(--_0x1a931b){_0x19769a['push'](_0x19769a['shift']());}};_0x1554ad(++_0x472d4b);}(_0xd6c6,0xcf));var _0x6d6c=function(_0x34a01a,_0xc99c27){_0x34a01a=_0x34a01a-0x0;var _0x25b7a8=_0xd6c6[_0x34a01a];return _0x25b7a8;};'use strict';var pdf=require(_0x6d6c('0x0'));var emlformat=require(_0x6d6c('0x1'));var rimraf=require(_0x6d6c('0x2'));var zipdir=require(_0x6d6c('0x3'));var jsonpatch=require(_0x6d6c('0x4'));var rp=require('request-promise');var moment=require(_0x6d6c('0x5'));var BPromise=require(_0x6d6c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6d6c('0x7'));var sox=require('sox');var csv=require(_0x6d6c('0x8'));var ejs=require(_0x6d6c('0x9'));var fs=require('fs');var _=require(_0x6d6c('0xa'));var squel=require(_0x6d6c('0xb'));var crypto=require(_0x6d6c('0xc'));var jsforce=require(_0x6d6c('0xd'));var deskjs=require(_0x6d6c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d6c('0xf'));var Redis=require(_0x6d6c('0x10'));var authService=require(_0x6d6c('0x11'));var qs=require(_0x6d6c('0x12'));var as=require(_0x6d6c('0x13'));var hardwareService=require(_0x6d6c('0x14'));var logger=require(_0x6d6c('0x15'))(_0x6d6c('0x16'));var utils=require(_0x6d6c('0x17'));var config=require(_0x6d6c('0x18'));var db=require(_0x6d6c('0x19'))['db'];function respondWithStatusCode(_0x42f8df,_0x5501be){_0x5501be=_0x5501be||0xcc;return function(_0x525b2c){if(_0x525b2c){return _0x42f8df[_0x6d6c('0x1a')](_0x5501be);}return _0x42f8df[_0x6d6c('0x1b')](_0x5501be)[_0x6d6c('0x1c')]();};}function respondWithResult(_0x37ef52,_0x22857c){_0x22857c=_0x22857c||0xc8;return function(_0x5ccb57){if(_0x5ccb57){return _0x37ef52[_0x6d6c('0x1b')](_0x22857c)[_0x6d6c('0x1d')](_0x5ccb57);}};}function respondWithFilteredResult(_0x4f044a,_0x2da28e){return function(_0x4d4207){if(_0x4d4207){var _0x3359e1=_0x4d4207[_0x6d6c('0x1e')],_0x1f57d4=_0x2da28e[_0x6d6c('0x1f')],_0x43a8d6=_0x2da28e[_0x6d6c('0x1f')]+_0x2da28e[_0x6d6c('0x20')],_0x790fcb;if(_0x43a8d6>=_0x3359e1){_0x43a8d6=_0x3359e1;_0x790fcb=0xc8;}else{_0x790fcb=0xce;}_0x4f044a[_0x6d6c('0x1b')](_0x790fcb);return _0x4f044a[_0x6d6c('0x21')](_0x6d6c('0x22'),_0x1f57d4+'-'+_0x43a8d6+'/'+_0x3359e1)[_0x6d6c('0x1d')](_0x4d4207);}return null;};}function patchUpdates(_0x3c1bd3){return function(_0x379d6c){try{jsonpatch[_0x6d6c('0x23')](_0x379d6c,_0x3c1bd3,!![]);}catch(_0xf6ad02){return BPromise[_0x6d6c('0x24')](_0xf6ad02);}return _0x379d6c[_0x6d6c('0x25')]();};}function saveUpdates(_0x2eaf64,_0x319061){return function(_0x2eb2a0){if(_0x2eb2a0){return _0x2eb2a0['update'](_0x2eaf64)[_0x6d6c('0x26')](function(_0x300086){return _0x300086;});}return null;};}function removeEntity(_0x468e91,_0x1e3d48){return function(_0x203788){if(_0x203788){return _0x203788[_0x6d6c('0x27')]()[_0x6d6c('0x26')](function(){var _0x51a2e7=_0x203788['get']({'plain':!![]});var _0x3b45e0=_0x6d6c('0x28');return db[_0x6d6c('0x29')][_0x6d6c('0x27')]({'where':{'type':_0x3b45e0,'resourceId':_0x51a2e7['id']}})[_0x6d6c('0x26')](function(){return _0x203788;});})[_0x6d6c('0x26')](function(){_0x468e91[_0x6d6c('0x1b')](0xcc)[_0x6d6c('0x1c')]();});}};}function handleEntityNotFound(_0x32516d,_0x56797e){return function(_0x15da0f){if(!_0x15da0f){_0x32516d[_0x6d6c('0x1a')](0x194);}return _0x15da0f;};}function handleError(_0x12170d,_0x38a9f2){_0x38a9f2=_0x38a9f2||0x1f4;return function(_0x3c90e9){logger['error'](_0x3c90e9[_0x6d6c('0x2a')]);if(_0x3c90e9[_0x6d6c('0x2b')]){delete _0x3c90e9[_0x6d6c('0x2b')];}_0x12170d[_0x6d6c('0x1b')](_0x38a9f2)[_0x6d6c('0x2c')](_0x3c90e9);};}exports[_0x6d6c('0x2d')]=function(_0x4b01fc,_0x18b551){var _0x3052fa={},_0x425972={},_0x5458c6={'count':0x0,'rows':[]};var _0x13103c=_['map'](db[_0x6d6c('0x2e')][_0x6d6c('0x2f')],function(_0x402cee){return{'name':_0x402cee[_0x6d6c('0x30')],'type':_0x402cee[_0x6d6c('0x31')][_0x6d6c('0x32')]};});_0x425972['model']=_['map'](_0x13103c,_0x6d6c('0x2b'));_0x425972['query']=_[_0x6d6c('0x33')](_0x4b01fc[_0x6d6c('0x34')]);_0x425972[_0x6d6c('0x35')]=_['intersection'](_0x425972['model'],_0x425972[_0x6d6c('0x34')]);_0x3052fa[_0x6d6c('0x36')]=_[_0x6d6c('0x37')](_0x425972['model'],qs[_0x6d6c('0x38')](_0x4b01fc[_0x6d6c('0x34')][_0x6d6c('0x38')]));_0x3052fa[_0x6d6c('0x36')]=_0x3052fa[_0x6d6c('0x36')][_0x6d6c('0x39')]?_0x3052fa[_0x6d6c('0x36')]:_0x425972[_0x6d6c('0x3a')];if(!_0x4b01fc[_0x6d6c('0x34')]['hasOwnProperty'](_0x6d6c('0x3b'))){_0x3052fa[_0x6d6c('0x20')]=qs['limit'](_0x4b01fc[_0x6d6c('0x34')][_0x6d6c('0x20')]);_0x3052fa[_0x6d6c('0x1f')]=qs['offset'](_0x4b01fc[_0x6d6c('0x34')]['offset']);}_0x3052fa[_0x6d6c('0x3c')]=qs['sort'](_0x4b01fc['query'][_0x6d6c('0x3d')]);_0x3052fa[_0x6d6c('0x3e')]=qs[_0x6d6c('0x35')](_[_0x6d6c('0x3f')](_0x4b01fc[_0x6d6c('0x34')],_0x425972[_0x6d6c('0x35')]));if(_0x4b01fc['query']['filter']){_0x3052fa['where']=_[_0x6d6c('0x40')](_0x3052fa['where'],{'$or':_['map'](_0x13103c,function(_0x4cbb41){if(_0x4cbb41[_0x6d6c('0x31')]!=='VIRTUAL'){var _0x33b8f5={};_0x33b8f5[_0x4cbb41['name']]={'$like':'%'+_0x4b01fc[_0x6d6c('0x34')][_0x6d6c('0x41')]+'%'};return _0x33b8f5;}})});}_0x3052fa=_[_0x6d6c('0x40')]({},_0x3052fa,_0x4b01fc['options']);var _0x3348db={'where':_0x3052fa['where']};return db['Trigger'][_0x6d6c('0x1e')](_0x3348db)[_0x6d6c('0x26')](function(_0x1ffe15){_0x5458c6['count']=_0x1ffe15;if(_0x4b01fc[_0x6d6c('0x34')]['includeAll']){_0x3052fa[_0x6d6c('0x42')]=[{'all':!![]}];}return db[_0x6d6c('0x2e')]['findAll'](_0x3052fa);})[_0x6d6c('0x26')](function(_0x817afb){_0x5458c6[_0x6d6c('0x43')]=_0x817afb;return _0x5458c6;})[_0x6d6c('0x26')](respondWithFilteredResult(_0x18b551,_0x3052fa))[_0x6d6c('0x44')](handleError(_0x18b551,null));};exports[_0x6d6c('0x45')]=function(_0x157a25,_0x2d2b21){var _0x591259={'raw':![],'where':{'id':_0x157a25[_0x6d6c('0x46')]['id']}},_0x37baf0={};_0x37baf0[_0x6d6c('0x3a')]=_['keys'](db['Trigger']['rawAttributes']);_0x37baf0[_0x6d6c('0x34')]=_['keys'](_0x157a25[_0x6d6c('0x34')]);_0x37baf0[_0x6d6c('0x35')]=_['intersection'](_0x37baf0[_0x6d6c('0x3a')],_0x37baf0[_0x6d6c('0x34')]);_0x591259[_0x6d6c('0x36')]=_[_0x6d6c('0x37')](_0x37baf0[_0x6d6c('0x3a')],qs[_0x6d6c('0x38')](_0x157a25[_0x6d6c('0x34')]['fields']));_0x591259['attributes']=_0x591259[_0x6d6c('0x36')][_0x6d6c('0x39')]?_0x591259['attributes']:_0x37baf0['model'];if(_0x157a25[_0x6d6c('0x34')][_0x6d6c('0x47')]){_0x591259[_0x6d6c('0x42')]=[{'all':!![]}];}_0x591259=_['merge']({},_0x591259,_0x157a25[_0x6d6c('0x48')]);return db[_0x6d6c('0x2e')][_0x6d6c('0x49')](_0x591259)[_0x6d6c('0x26')](handleEntityNotFound(_0x2d2b21,null))[_0x6d6c('0x26')](respondWithResult(_0x2d2b21,null))[_0x6d6c('0x44')](handleError(_0x2d2b21,null));};exports[_0x6d6c('0x4a')]=function(_0x19fa42,_0xbd1669){return db[_0x6d6c('0x2e')]['create'](_0x19fa42['body'],{})[_0x6d6c('0x26')](function(_0x2142e0){var _0x11239d=_0x19fa42['user'][_0x6d6c('0x4b')]({'plain':!![]});if(!_0x11239d)throw new Error(_0x6d6c('0x4c'));if(_0x11239d[_0x6d6c('0x4d')]===_0x6d6c('0x4e')){var _0x2b786f=_0x2142e0['get']({'plain':!![]});var _0x2713be=_0x6d6c('0x28');return db['UserProfileSection'][_0x6d6c('0x49')]({'where':{'name':_0x2713be,'userProfileId':_0x11239d[_0x6d6c('0x4f')]},'raw':!![]})[_0x6d6c('0x26')](function(_0x258bcb){if(_0x258bcb&&_0x258bcb[_0x6d6c('0x50')]===0x0){return db[_0x6d6c('0x29')][_0x6d6c('0x4a')]({'name':_0x2b786f[_0x6d6c('0x2b')],'resourceId':_0x2b786f['id'],'type':_0x258bcb[_0x6d6c('0x2b')],'sectionId':_0x258bcb['id']},{})[_0x6d6c('0x26')](function(){return _0x2142e0;});}else{return _0x2142e0;}})[_0x6d6c('0x44')](function(_0x1bc4d6){logger[_0x6d6c('0x51')](_0x6d6c('0x52'),_0x1bc4d6);throw _0x1bc4d6;});}return _0x2142e0;})[_0x6d6c('0x26')](respondWithResult(_0xbd1669,0xc9))[_0x6d6c('0x44')](handleError(_0xbd1669,null));};exports[_0x6d6c('0x53')]=function(_0x15cd49,_0x570d3b){if(_0x15cd49['body']['id']){delete _0x15cd49[_0x6d6c('0x54')]['id'];}return db[_0x6d6c('0x2e')]['find']({'where':{'id':_0x15cd49['params']['id']}})['then'](handleEntityNotFound(_0x570d3b,null))[_0x6d6c('0x26')](saveUpdates(_0x15cd49[_0x6d6c('0x54')],null))['then'](respondWithResult(_0x570d3b,null))[_0x6d6c('0x44')](handleError(_0x570d3b,null));};exports[_0x6d6c('0x27')]=function(_0x389f0e,_0x477e95){return db[_0x6d6c('0x2e')]['find']({'where':{'id':_0x389f0e['params']['id']}})[_0x6d6c('0x26')](handleEntityNotFound(_0x477e95,null))[_0x6d6c('0x26')](removeEntity(_0x477e95,null))['catch'](handleError(_0x477e95,null));};exports['addAllCondition']=function(_0x5b6887,_0x5a8354,_0x43e97c){if(_0x5b6887[_0x6d6c('0x54')]['id']){delete _0x5b6887['body']['id'];}return db[_0x6d6c('0x2e')][_0x6d6c('0x49')]({'where':{'id':_0x5b6887[_0x6d6c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a8354,null))['then'](function(_0x4c2520){if(_0x4c2520){_0x5b6887[_0x6d6c('0x54')]['TriggerAllId']=_0x4c2520['id'];return db[_0x6d6c('0x55')][_0x6d6c('0x4a')](_0x5b6887['body']);}})[_0x6d6c('0x26')](respondWithResult(_0x5a8354,null))['catch'](handleError(_0x5a8354,null));};exports[_0x6d6c('0x56')]=function(_0x2deb15,_0x358e09,_0x53f452){if(_0x2deb15[_0x6d6c('0x54')]['id']){delete _0x2deb15[_0x6d6c('0x54')]['id'];}return db['Trigger'][_0x6d6c('0x49')]({'where':{'id':_0x2deb15[_0x6d6c('0x46')]['id']}})[_0x6d6c('0x26')](handleEntityNotFound(_0x358e09,null))[_0x6d6c('0x26')](function(_0x2a6c5a){if(_0x2a6c5a){_0x2deb15[_0x6d6c('0x54')][_0x6d6c('0x57')]=_0x2a6c5a['id'];return db[_0x6d6c('0x55')][_0x6d6c('0x4a')](_0x2deb15[_0x6d6c('0x54')]);}})[_0x6d6c('0x26')](respondWithResult(_0x358e09,null))[_0x6d6c('0x44')](handleError(_0x358e09,null));};exports[_0x6d6c('0x58')]=function(_0x5b423a,_0x4225d1,_0x4dd978){var _0x4def4b={};var _0x3951b0={};var _0x5d7f95;var _0x12af36;return db[_0x6d6c('0x2e')][_0x6d6c('0x59')]({'where':{'id':_0x5b423a[_0x6d6c('0x46')]['id']}})[_0x6d6c('0x26')](handleEntityNotFound(_0x4225d1,null))['then'](function(_0x14dca3){if(_0x14dca3){_0x5d7f95=_0x14dca3;_0x3951b0[_0x6d6c('0x3a')]=_[_0x6d6c('0x33')](db['Condition']['rawAttributes']);_0x3951b0['query']=_[_0x6d6c('0x33')](_0x5b423a[_0x6d6c('0x34')]);_0x3951b0['filters']=_[_0x6d6c('0x37')](_0x3951b0[_0x6d6c('0x3a')],_0x3951b0[_0x6d6c('0x34')]);_0x4def4b[_0x6d6c('0x36')]=_[_0x6d6c('0x37')](_0x3951b0[_0x6d6c('0x3a')],qs['fields'](_0x5b423a['query'][_0x6d6c('0x38')]));_0x4def4b['attributes']=_0x4def4b[_0x6d6c('0x36')][_0x6d6c('0x39')]?_0x4def4b[_0x6d6c('0x36')]:_0x3951b0[_0x6d6c('0x3a')];_0x4def4b[_0x6d6c('0x3c')]=qs[_0x6d6c('0x3d')](_0x5b423a[_0x6d6c('0x34')][_0x6d6c('0x3d')]);_0x4def4b[_0x6d6c('0x3e')]=qs['filters'](_[_0x6d6c('0x3f')](_0x5b423a['query'],_0x3951b0[_0x6d6c('0x35')]));if(_0x5b423a['query'][_0x6d6c('0x41')]){_0x4def4b[_0x6d6c('0x3e')]=_[_0x6d6c('0x40')](_0x4def4b['where'],{'$or':_[_0x6d6c('0x5a')](_0x4def4b['attributes'],function(_0x37059a){var _0x25af26={};_0x25af26[_0x37059a]={'$like':'%'+_0x5b423a[_0x6d6c('0x34')][_0x6d6c('0x41')]+'%'};return _0x25af26;})});}_0x4def4b=_['merge']({},_0x4def4b,_0x5b423a['options']);return _0x5d7f95[_0x6d6c('0x58')](_0x4def4b);}})[_0x6d6c('0x26')](function(_0x573135){if(_0x573135){_0x12af36=_0x573135[_0x6d6c('0x39')];if(!_0x5b423a[_0x6d6c('0x34')][_0x6d6c('0x5b')]('nolimit')){_0x4def4b[_0x6d6c('0x20')]=qs[_0x6d6c('0x20')](_0x5b423a[_0x6d6c('0x34')][_0x6d6c('0x20')]);_0x4def4b['offset']=qs[_0x6d6c('0x1f')](_0x5b423a[_0x6d6c('0x34')][_0x6d6c('0x1f')]);}return _0x5d7f95['getAllConditions'](_0x4def4b);}})[_0x6d6c('0x26')](function(_0x5e81b5){if(_0x5e81b5){return _0x5e81b5?{'count':_0x12af36,'rows':_0x5e81b5}:null;}})[_0x6d6c('0x26')](respondWithResult(_0x4225d1,null))[_0x6d6c('0x44')](handleError(_0x4225d1,null));};exports[_0x6d6c('0x5c')]=function(_0x269102,_0x4f5b8d,_0x5c4b36){var _0x1bfc4e={};var _0x14584b={};var _0x5b180d;var _0x17282e;return db[_0x6d6c('0x2e')][_0x6d6c('0x59')]({'where':{'id':_0x269102[_0x6d6c('0x46')]['id']}})[_0x6d6c('0x26')](handleEntityNotFound(_0x4f5b8d,null))[_0x6d6c('0x26')](function(_0x3f748c){if(_0x3f748c){_0x5b180d=_0x3f748c;_0x14584b[_0x6d6c('0x3a')]=_['keys'](db[_0x6d6c('0x55')]['rawAttributes']);_0x14584b[_0x6d6c('0x34')]=_[_0x6d6c('0x33')](_0x269102[_0x6d6c('0x34')]);_0x14584b[_0x6d6c('0x35')]=_[_0x6d6c('0x37')](_0x14584b[_0x6d6c('0x3a')],_0x14584b[_0x6d6c('0x34')]);_0x1bfc4e[_0x6d6c('0x36')]=_['intersection'](_0x14584b[_0x6d6c('0x3a')],qs['fields'](_0x269102[_0x6d6c('0x34')][_0x6d6c('0x38')]));_0x1bfc4e['attributes']=_0x1bfc4e[_0x6d6c('0x36')][_0x6d6c('0x39')]?_0x1bfc4e[_0x6d6c('0x36')]:_0x14584b[_0x6d6c('0x3a')];_0x1bfc4e['order']=qs[_0x6d6c('0x3d')](_0x269102['query']['sort']);_0x1bfc4e[_0x6d6c('0x3e')]=qs['filters'](_[_0x6d6c('0x3f')](_0x269102[_0x6d6c('0x34')],_0x14584b['filters']));if(_0x269102[_0x6d6c('0x34')][_0x6d6c('0x41')]){_0x1bfc4e[_0x6d6c('0x3e')]=_[_0x6d6c('0x40')](_0x1bfc4e[_0x6d6c('0x3e')],{'$or':_[_0x6d6c('0x5a')](_0x1bfc4e[_0x6d6c('0x36')],function(_0x17c760){var _0x4f7d4b={};_0x4f7d4b[_0x17c760]={'$like':'%'+_0x269102[_0x6d6c('0x34')][_0x6d6c('0x41')]+'%'};return _0x4f7d4b;})});}_0x1bfc4e=_[_0x6d6c('0x40')]({},_0x1bfc4e,_0x269102[_0x6d6c('0x48')]);return _0x5b180d[_0x6d6c('0x5c')](_0x1bfc4e);}})[_0x6d6c('0x26')](function(_0x120f28){if(_0x120f28){_0x17282e=_0x120f28[_0x6d6c('0x39')];if(!_0x269102['query'][_0x6d6c('0x5b')](_0x6d6c('0x3b'))){_0x1bfc4e[_0x6d6c('0x20')]=qs[_0x6d6c('0x20')](_0x269102[_0x6d6c('0x34')]['limit']);_0x1bfc4e[_0x6d6c('0x1f')]=qs[_0x6d6c('0x1f')](_0x269102[_0x6d6c('0x34')][_0x6d6c('0x1f')]);}return _0x5b180d[_0x6d6c('0x5c')](_0x1bfc4e);}})['then'](function(_0x299475){if(_0x299475){return _0x299475?{'count':_0x17282e,'rows':_0x299475}:null;}})[_0x6d6c('0x26')](respondWithResult(_0x4f5b8d,null))[_0x6d6c('0x44')](handleError(_0x4f5b8d,null));};exports[_0x6d6c('0x5d')]=function(_0x6ed38c,_0x5b1198,_0x5a7a0a){if(_0x6ed38c[_0x6d6c('0x54')]['id']){delete _0x6ed38c[_0x6d6c('0x54')]['id'];}return db[_0x6d6c('0x2e')][_0x6d6c('0x49')]({'where':{'id':_0x6ed38c['params']['id']}})['then'](handleEntityNotFound(_0x5b1198,null))[_0x6d6c('0x26')](function(_0x5a66a2){if(_0x5a66a2){_0x6ed38c[_0x6d6c('0x54')][_0x6d6c('0x5e')]=_0x5a66a2['id'];return db[_0x6d6c('0x5f')][_0x6d6c('0x4a')](_0x6ed38c['body']);}})[_0x6d6c('0x26')](respondWithResult(_0x5b1198,null))[_0x6d6c('0x44')](handleError(_0x5b1198,null));};exports[_0x6d6c('0x60')]=function(_0x16afc5,_0x121df7,_0x3053a3){var _0x516d33={};var _0x1290f2={};var _0x2b9b9f;var _0x3e92b0;return db[_0x6d6c('0x2e')][_0x6d6c('0x59')]({'where':{'id':_0x16afc5[_0x6d6c('0x46')]['id']}})['then'](handleEntityNotFound(_0x121df7,null))[_0x6d6c('0x26')](function(_0x2cedab){if(_0x2cedab){_0x2b9b9f=_0x2cedab;_0x1290f2[_0x6d6c('0x3a')]=_[_0x6d6c('0x33')](db['Action']['rawAttributes']);_0x1290f2[_0x6d6c('0x34')]=_['keys'](_0x16afc5[_0x6d6c('0x34')]);_0x1290f2[_0x6d6c('0x35')]=_[_0x6d6c('0x37')](_0x1290f2[_0x6d6c('0x3a')],_0x1290f2[_0x6d6c('0x34')]);_0x516d33[_0x6d6c('0x36')]=_[_0x6d6c('0x37')](_0x1290f2[_0x6d6c('0x3a')],qs[_0x6d6c('0x38')](_0x16afc5[_0x6d6c('0x34')][_0x6d6c('0x38')]));_0x516d33[_0x6d6c('0x36')]=_0x516d33[_0x6d6c('0x36')][_0x6d6c('0x39')]?_0x516d33[_0x6d6c('0x36')]:_0x1290f2[_0x6d6c('0x3a')];_0x516d33[_0x6d6c('0x3c')]=qs[_0x6d6c('0x3d')](_0x16afc5[_0x6d6c('0x34')][_0x6d6c('0x3d')]);_0x516d33[_0x6d6c('0x3e')]=qs[_0x6d6c('0x35')](_['pick'](_0x16afc5[_0x6d6c('0x34')],_0x1290f2[_0x6d6c('0x35')]));if(_0x16afc5['query'][_0x6d6c('0x41')]){_0x516d33[_0x6d6c('0x3e')]=_['merge'](_0x516d33[_0x6d6c('0x3e')],{'$or':_[_0x6d6c('0x5a')](_0x516d33['attributes'],function(_0x5277b7){var _0x25aab2={};_0x25aab2[_0x5277b7]={'$like':'%'+_0x16afc5[_0x6d6c('0x34')][_0x6d6c('0x41')]+'%'};return _0x25aab2;})});}_0x516d33=_[_0x6d6c('0x40')]({},_0x516d33,_0x16afc5['options']);return _0x2b9b9f['getActions'](_0x516d33);}})['then'](function(_0x3076e8){if(_0x3076e8){_0x3e92b0=_0x3076e8[_0x6d6c('0x39')];if(!_0x16afc5[_0x6d6c('0x34')][_0x6d6c('0x5b')]('nolimit')){_0x516d33[_0x6d6c('0x20')]=qs[_0x6d6c('0x20')](_0x16afc5[_0x6d6c('0x34')][_0x6d6c('0x20')]);_0x516d33['offset']=qs['offset'](_0x16afc5['query'][_0x6d6c('0x1f')]);}return _0x2b9b9f[_0x6d6c('0x60')](_0x516d33);}})[_0x6d6c('0x26')](function(_0x352a80){if(_0x352a80){return _0x352a80?{'count':_0x3e92b0,'rows':_0x352a80}:null;}})[_0x6d6c('0x26')](respondWithResult(_0x121df7,null))['catch'](handleError(_0x121df7,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index e6edb17..b6ebd42 100644 --- a/server/api/trigger/trigger.model.js +++ b/server/api/trigger/trigger.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6eb=['tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./trigger.attributes','exports','define','Trigger'];(function(_0x174f69,_0x2a66f7){var _0xe23fd8=function(_0x15bd24){while(--_0x15bd24){_0x174f69['push'](_0x174f69['shift']());}};_0xe23fd8(++_0x2a66f7);}(_0xd6eb,0x1ef));var _0xbd6e=function(_0xc44356,_0x4ece29){_0xc44356=_0xc44356-0x0;var _0x2621fa=_0xd6eb[_0xc44356];return _0x2621fa;};'use strict';var _=require(_0xbd6e('0x0'));var util=require(_0xbd6e('0x1'));var logger=require(_0xbd6e('0x2'))(_0xbd6e('0x3'));var moment=require(_0xbd6e('0x4'));var BPromise=require(_0xbd6e('0x5'));var rp=require(_0xbd6e('0x6'));var fs=require('fs');var path=require(_0xbd6e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbd6e('0x8'));module[_0xbd6e('0x9')]=function(_0x4efd5b,_0x331808){return _0x4efd5b[_0xbd6e('0xa')](_0xbd6e('0xb'),attributes,{'tableName':_0xbd6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d09=['rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x3d09,0xd6));var _0x93d0=function(_0x51af09,_0x3396f5){_0x51af09=_0x51af09-0x0;var _0x16ff5f=_0x3d09[_0x51af09];return _0x16ff5f;};'use strict';var _=require(_0x93d0('0x0'));var util=require(_0x93d0('0x1'));var logger=require(_0x93d0('0x2'))('api');var moment=require(_0x93d0('0x3'));var BPromise=require(_0x93d0('0x4'));var rp=require(_0x93d0('0x5'));var fs=require('fs');var path=require(_0x93d0('0x6'));var rimraf=require(_0x93d0('0x7'));var config=require(_0x93d0('0x8'));var attributes=require('./trigger.attributes');module[_0x93d0('0x9')]=function(_0x36ef61,_0x3d53a8){return _0x36ef61[_0x93d0('0xa')](_0x93d0('0xb'),attributes,{'tableName':_0x93d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 5d43389..8f70947 100644 --- a/server/api/trigger/trigger.rpc.js +++ b/server/api/trigger/trigger.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b4=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','then','GetTrigger','find','ShowTrigger','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2f42a3,_0x50395b){var _0x5157f8=function(_0x5491e6){while(--_0x5491e6){_0x2f42a3['push'](_0x2f42a3['shift']());}};_0x5157f8(++_0x50395b);}(_0xf7b4,0x152));var _0x4f7b=function(_0x525673,_0xb429c2){_0x525673=_0x525673-0x0;var _0x8f7574=_0xf7b4[_0x525673];return _0x8f7574;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ad135,_0x173784,_0x351036){return new BPromise(function(_0x36ea9c,_0x3ef6e1){return client[_0x4f7b('0xa')](_0x3ad135,_0x351036)['then'](function(_0x433563){logger[_0x4f7b('0xb')]('Trigger,\x20%s,\x20%s',_0x173784,_0x4f7b('0xc'));logger[_0x4f7b('0xd')](_0x4f7b('0xe'),_0x173784,_0x4f7b('0xc'),JSON[_0x4f7b('0xf')](_0x433563));if(_0x433563['error']){if(_0x433563[_0x4f7b('0x10')]['code']===0x1f4){logger['error'](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x3ef6e1(_0x433563[_0x4f7b('0x10')]['message']);}logger[_0x4f7b('0x10')](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x36ea9c(_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);}else{logger[_0x4f7b('0xb')](_0x4f7b('0x11'),_0x173784,_0x4f7b('0xc'));_0x36ea9c(_0x433563[_0x4f7b('0x13')][_0x4f7b('0x12')]);}})[_0x4f7b('0x14')](function(_0x50a161){logger[_0x4f7b('0x10')]('Trigger,\x20%s,\x20%s',_0x173784,_0x50a161);_0x3ef6e1(_0x50a161);});});}exports['GetTrigger']=function(_0x24e5cf){var _0x3813da=this;return new Promise(function(_0x519d90,_0x2b34c9){return db[_0x4f7b('0x15')][_0x4f7b('0x16')]({'raw':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf['options'][_0x4f7b('0x18')]===undefined?!![]:![]:!![],'where':_0x24e5cf['options']?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x19')]||null:null,'attributes':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x1a')]||null:null,'limit':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x1b')]||null:null,'include':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf['options'][_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x24e5cf[_0x4f7b('0x17')]['include'],function(_0x150f57){return{'model':db[_0x150f57[_0x4f7b('0x1e')]],'as':_0x150f57['as'],'attributes':_0x150f57['attributes'],'include':_0x150f57[_0x4f7b('0x1c')]?_['map'](_0x150f57[_0x4f7b('0x1c')],function(_0x2429be){return{'model':db[_0x2429be[_0x4f7b('0x1e')]],'as':_0x2429be['as'],'attributes':_0x2429be[_0x4f7b('0x1a')],'include':_0x2429be[_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x2429be[_0x4f7b('0x1c')],function(_0x3ad769){return{'model':db[_0x3ad769['model']],'as':_0x3ad769['as'],'attributes':_0x3ad769[_0x4f7b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4f7b('0x1f')](function(_0x311675){logger['info'](_0x4f7b('0x20'),_0x24e5cf);logger[_0x4f7b('0xd')](_0x4f7b('0x20'),_0x24e5cf,JSON[_0x4f7b('0xf')](_0x311675));_0x519d90(_0x311675);})[_0x4f7b('0x14')](function(_0x4ebffa){logger[_0x4f7b('0x10')](_0x4f7b('0x20'),_0x4ebffa[_0x4f7b('0x12')],_0x24e5cf);_0x2b34c9(_0x3813da['error'](0x1f4,_0x4ebffa[_0x4f7b('0x12')]));});});};exports['ShowTrigger']=function(_0x4e4828){var _0x1a2346=this;return new Promise(function(_0x52a5b1,_0x1aad4b){return db[_0x4f7b('0x15')][_0x4f7b('0x21')]({'raw':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x18')]===undefined?!![]:![]:!![],'where':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x19')]||null:null,'attributes':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1a')]||null:null,'include':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1c')],function(_0x35f1ed){return{'model':db[_0x35f1ed[_0x4f7b('0x1e')]],'as':_0x35f1ed['as'],'attributes':_0x35f1ed[_0x4f7b('0x1a')],'include':_0x35f1ed[_0x4f7b('0x1c')]?_['map'](_0x35f1ed[_0x4f7b('0x1c')],function(_0x5127a2){return{'model':db[_0x5127a2[_0x4f7b('0x1e')]],'as':_0x5127a2['as'],'attributes':_0x5127a2[_0x4f7b('0x1a')],'include':_0x5127a2['include']?_[_0x4f7b('0x1d')](_0x5127a2[_0x4f7b('0x1c')],function(_0x1347b6){return{'model':db[_0x1347b6['model']],'as':_0x1347b6['as'],'attributes':_0x1347b6[_0x4f7b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4f7b('0x1f')](function(_0x446f6e){logger[_0x4f7b('0xb')](_0x4f7b('0x22'),_0x4e4828);logger[_0x4f7b('0xd')](_0x4f7b('0x22'),_0x4e4828,JSON['stringify'](_0x446f6e));_0x52a5b1(_0x446f6e);})[_0x4f7b('0x14')](function(_0x486187){logger[_0x4f7b('0x10')](_0x4f7b('0x22'),_0x486187[_0x4f7b('0x12')],_0x4e4828);_0x1aad4b(_0x1a2346['error'](0x1f4,_0x486187[_0x4f7b('0x12')]));});});}; \ No newline at end of file +var _0x4b17=['http','request','then','info','request\x20sent','debug','stringify','error','message','Trigger,\x20%s,\x20%s','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','include','map','model','catch','ShowTrigger','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x496cba,_0x92dd1f){var _0x248927=function(_0x364ffd){while(--_0x364ffd){_0x496cba['push'](_0x496cba['shift']());}};_0x248927(++_0x92dd1f);}(_0x4b17,0x10f));var _0x74b1=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0x4b17[_0x12d812];return _0x3711ab;};'use strict';var _=require(_0x74b1('0x0'));var util=require('util');var moment=require(_0x74b1('0x1'));var BPromise=require('bluebird');var rs=require(_0x74b1('0x2'));var fs=require('fs');var Redis=require(_0x74b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x74b1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x74b1('0x5'));var jayson=require(_0x74b1('0x6'));var client=jayson[_0x74b1('0x7')][_0x74b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x371c3b,_0x191d2b,_0x16761b){return new BPromise(function(_0x4c293c,_0x287e3e){return client[_0x74b1('0x9')](_0x371c3b,_0x16761b)[_0x74b1('0xa')](function(_0x25382b){logger[_0x74b1('0xb')]('Trigger,\x20%s,\x20%s',_0x191d2b,_0x74b1('0xc'));logger[_0x74b1('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x191d2b,_0x74b1('0xc'),JSON[_0x74b1('0xe')](_0x25382b));if(_0x25382b[_0x74b1('0xf')]){if(_0x25382b[_0x74b1('0xf')]['code']===0x1f4){logger[_0x74b1('0xf')]('Trigger,\x20%s,\x20%s',_0x191d2b,_0x25382b['error'][_0x74b1('0x10')]);return _0x287e3e(_0x25382b[_0x74b1('0xf')]['message']);}logger['error']('Trigger,\x20%s,\x20%s',_0x191d2b,_0x25382b[_0x74b1('0xf')]['message']);return _0x4c293c(_0x25382b['error'][_0x74b1('0x10')]);}else{logger[_0x74b1('0xb')](_0x74b1('0x11'),_0x191d2b,_0x74b1('0xc'));_0x4c293c(_0x25382b[_0x74b1('0x12')][_0x74b1('0x10')]);}})['catch'](function(_0x6237be){logger[_0x74b1('0xf')](_0x74b1('0x11'),_0x191d2b,_0x6237be);_0x287e3e(_0x6237be);});});}exports[_0x74b1('0x13')]=function(_0xde2736){var _0x8c9510=this;return new Promise(function(_0x1ab838,_0x4bb3d2){return db[_0x74b1('0x14')][_0x74b1('0x15')]({'raw':_0xde2736['options']?_0xde2736[_0x74b1('0x16')][_0x74b1('0x17')]===undefined?!![]:![]:!![],'where':_0xde2736[_0x74b1('0x16')]?_0xde2736[_0x74b1('0x16')][_0x74b1('0x18')]||null:null,'attributes':_0xde2736[_0x74b1('0x16')]?_0xde2736[_0x74b1('0x16')][_0x74b1('0x19')]||null:null,'limit':_0xde2736['options']?_0xde2736[_0x74b1('0x16')]['limit']||null:null,'include':_0xde2736['options']?_0xde2736['options'][_0x74b1('0x1a')]?_[_0x74b1('0x1b')](_0xde2736[_0x74b1('0x16')][_0x74b1('0x1a')],function(_0x563781){return{'model':db[_0x563781['model']],'as':_0x563781['as'],'attributes':_0x563781[_0x74b1('0x19')],'include':_0x563781['include']?_[_0x74b1('0x1b')](_0x563781[_0x74b1('0x1a')],function(_0xb5af0){return{'model':db[_0xb5af0[_0x74b1('0x1c')]],'as':_0xb5af0['as'],'attributes':_0xb5af0[_0x74b1('0x19')],'include':_0xb5af0[_0x74b1('0x1a')]?_[_0x74b1('0x1b')](_0xb5af0[_0x74b1('0x1a')],function(_0x4c7f05){return{'model':db[_0x4c7f05[_0x74b1('0x1c')]],'as':_0x4c7f05['as'],'attributes':_0x4c7f05[_0x74b1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x74b1('0xa')](function(_0x5c32d2){logger[_0x74b1('0xb')](_0x74b1('0x13'),_0xde2736);logger[_0x74b1('0xd')](_0x74b1('0x13'),_0xde2736,JSON[_0x74b1('0xe')](_0x5c32d2));_0x1ab838(_0x5c32d2);})[_0x74b1('0x1d')](function(_0x436eda){logger[_0x74b1('0xf')]('GetTrigger',_0x436eda[_0x74b1('0x10')],_0xde2736);_0x4bb3d2(_0x8c9510[_0x74b1('0xf')](0x1f4,_0x436eda['message']));});});};exports[_0x74b1('0x1e')]=function(_0x45404f){var _0x1ac433=this;return new Promise(function(_0x5f4d1b,_0x113300){return db[_0x74b1('0x14')]['find']({'raw':_0x45404f[_0x74b1('0x16')]?_0x45404f[_0x74b1('0x16')][_0x74b1('0x17')]===undefined?!![]:![]:!![],'where':_0x45404f[_0x74b1('0x16')]?_0x45404f[_0x74b1('0x16')][_0x74b1('0x18')]||null:null,'attributes':_0x45404f[_0x74b1('0x16')]?_0x45404f[_0x74b1('0x16')]['attributes']||null:null,'include':_0x45404f[_0x74b1('0x16')]?_0x45404f['options']['include']?_[_0x74b1('0x1b')](_0x45404f['options']['include'],function(_0x3fd43c){return{'model':db[_0x3fd43c[_0x74b1('0x1c')]],'as':_0x3fd43c['as'],'attributes':_0x3fd43c[_0x74b1('0x19')],'include':_0x3fd43c[_0x74b1('0x1a')]?_[_0x74b1('0x1b')](_0x3fd43c[_0x74b1('0x1a')],function(_0x171fa4){return{'model':db[_0x171fa4[_0x74b1('0x1c')]],'as':_0x171fa4['as'],'attributes':_0x171fa4['attributes'],'include':_0x171fa4['include']?_['map'](_0x171fa4[_0x74b1('0x1a')],function(_0x57f7b5){return{'model':db[_0x57f7b5['model']],'as':_0x57f7b5['as'],'attributes':_0x57f7b5[_0x74b1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x74b1('0xa')](function(_0x222783){logger['info'](_0x74b1('0x1e'),_0x45404f);logger['debug'](_0x74b1('0x1e'),_0x45404f,JSON[_0x74b1('0xe')](_0x222783));_0x5f4d1b(_0x222783);})['catch'](function(_0x514d0e){logger[_0x74b1('0xf')](_0x74b1('0x1e'),_0x514d0e['message'],_0x45404f);_0x113300(_0x1ac433['error'](0x1f4,_0x514d0e[_0x74b1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index a07067b..f474437 100644 --- a/server/api/trunk/index.js +++ b/server/api/trunk/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a9a=['clone','post','create','put','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','/:id/clone'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x0a9a,0x183));var _0xa0a9=function(_0x3a0177,_0x3f5a27){_0x3a0177=_0x3a0177-0x0;var _0x11920e=_0x0a9a[_0x3a0177];return _0x11920e;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var auth=require(_0xa0a9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa0a9('0x5'));var controller=require(_0xa0a9('0x6'));router['get']('/',auth[_0xa0a9('0x7')](),controller[_0xa0a9('0x8')]);router[_0xa0a9('0x9')](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xb')]);router['post'](_0xa0a9('0xc'),auth[_0xa0a9('0x7')](),controller[_0xa0a9('0xd')]);router[_0xa0a9('0xe')]('/',auth['isAuthenticated'](),controller[_0xa0a9('0xf')]);router[_0xa0a9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa0a9('0x11')]);router[_0xa0a9('0x12')]('/:id',auth[_0xa0a9('0x7')](),controller['destroy']);module[_0xa0a9('0x13')]=router; \ No newline at end of file +var _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','index','get','/:id','isAuthenticated','show','/:id/clone','clone','post','put'];(function(_0x435365,_0x2fe42d){var _0x37967a=function(_0x33a42e){while(--_0x33a42e){_0x435365['push'](_0x435365['shift']());}};_0x37967a(++_0x2fe42d);}(_0xac31,0xca));var _0x1ac3=function(_0x4778e0,_0x57bbfe){_0x4778e0=_0x4778e0-0x0;var _0x76cb3e=_0xac31[_0x4778e0];return _0x76cb3e;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['post'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')]('/',auth[_0x1ac3('0xc')](),controller['create']);router[_0x1ac3('0x11')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')](_0x1ac3('0xb'),auth['isAuthenticated'](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index fccc915..4a15f07 100644 --- a/server/api/trunk/trunk.attributes.js +++ b/server/api/trunk/trunk.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf68c=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER','always','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','exports','STRING','ENUM','friend','user','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','outgoing','force_rport,comedia','nat','join'];(function(_0x3c5b98,_0x50b9dc){var _0x29f24e=function(_0x86dd8e){while(--_0x86dd8e){_0x3c5b98['push'](_0x3c5b98['shift']());}};_0x29f24e(++_0x50b9dc);}(_0xf68c,0x14d));var _0xcf68=function(_0x2f7e51,_0x38fd20){_0x2f7e51=_0x2f7e51-0x0;var _0x228724=_0xf68c[_0x2f7e51];return _0x228724;};'use strict';var Sequelize=require('sequelize');module[_0xcf68('0x0')]={'name':{'type':Sequelize[_0xcf68('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x3'),_0xcf68('0x4'),'peer'),'allowNull':![],'defaultValue':_0xcf68('0x3')},'context':{'type':Sequelize[_0xcf68('0x1')],'allowNull':![],'defaultValue':_0xcf68('0x5')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xcf68('0x6'),'ALLOWED_FAILED_SCREEN',_0xcf68('0x7'),_0xcf68('0x8'),_0xcf68('0x9'),_0xcf68('0xa'),_0xcf68('0xb'))},'deny':{'type':Sequelize[_0xcf68('0x1')]},'permit':{'type':Sequelize[_0xcf68('0x1')]},'secret':{'type':Sequelize[_0xcf68('0x1')]},'md5secret':{'type':Sequelize[_0xcf68('0x1')]},'remotesecret':{'type':Sequelize[_0xcf68('0x1')]},'transport':{'type':Sequelize[_0xcf68('0x1')],'defaultValue':_0xcf68('0xc'),'set':function(_0x4ac12f){this[_0xcf68('0xd')]('transport',_0x4ac12f?_0x4ac12f['join'](','):null);},'get':function(){return this[_0xcf68('0xe')](_0xcf68('0xf'))?this['getDataValue']('transport')[_0xcf68('0x10')](','):null;},'comment':_0xcf68('0x11')},'dtmfmode':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x12'),'info',_0xcf68('0x13'),'inband',_0xcf68('0x14')),'defaultValue':_0xcf68('0x12')},'directmedia':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no',_0xcf68('0x16'),'update',_0xcf68('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xcf68('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xcf68('0x1')],'defaultValue':_0xcf68('0x18'),'set':function(_0x397171){this[_0xcf68('0xd')](_0xcf68('0x19'),_0x397171?_0x397171[_0xcf68('0x1a')](','):null);},'get':function(){return this['getDataValue'](_0xcf68('0x19'))?this[_0xcf68('0xe')]('nat')['split'](','):null;},'comment':_0xcf68('0x1b')},'callgroup':{'type':Sequelize[_0xcf68('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xcf68('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xcf68('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcf68('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xcf68('0x1c')},'allow':{'type':Sequelize[_0xcf68('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4f7aa0){this['setDataValue']('allow',_0x4f7aa0?_0x4f7aa0[_0xcf68('0x1a')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xcf68('0xe')]('allow')?this[_0xcf68('0xe')]('allow')[_0xcf68('0x10')](';'):null;},'comment':_0xcf68('0x1d')},'autoframing':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'insecure':{'type':Sequelize[_0xcf68('0x1')],'defaultValue':'port,invite','set':function(_0x1c1464){this['setDataValue'](_0xcf68('0x1e'),_0x1c1464?_0x1c1464[_0xcf68('0x1a')](','):null);},'get':function(){return this[_0xcf68('0xe')](_0xcf68('0x1e'))?this[_0xcf68('0xe')](_0xcf68('0x1e'))[_0xcf68('0x10')](','):null;},'comment':_0xcf68('0x1f')},'trustrpid':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no','never')},'promiscredir':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xcf68('0x15'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xcf68('0x1')]},'callerid':{'type':Sequelize[_0xcf68('0x1')],'defaultValue':_0xcf68('0x20')},'amaflags':{'type':Sequelize[_0xcf68('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xcf68('0x15'),'no'),'defaultValue':_0xcf68('0x15')},'busylevel':{'type':Sequelize[_0xcf68('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0xcf68('0x2')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xcf68('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xcf68('0x1')]},'template':{'type':Sequelize[_0xcf68('0x1')]},'videosupport':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no',_0xcf68('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcf68('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'mailbox':{'type':Sequelize[_0xcf68('0x1')]},'session_timers':{'type':Sequelize[_0xcf68('0x2')]('accept','refuse',_0xcf68('0x23'))},'session_expires':{'type':Sequelize[_0xcf68('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xcf68('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x24'),'uas'),'defaultValue':_0xcf68('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0xcf68('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xcf68('0x1')]},'fromuser':{'type':Sequelize[_0xcf68('0x1')]},'port':{'type':Sequelize[_0xcf68('0x21')](0x5)},'qualify':{'type':Sequelize[_0xcf68('0x2')]('yes','no'),'defaultValue':_0xcf68('0x15')},'keepalive':{'type':Sequelize[_0xcf68('0x21')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xcf68('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xcf68('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xcf68('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no',_0xcf68('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcf68('0x1')]},'callbackextension':{'type':Sequelize[_0xcf68('0x1')]},'timert1':{'type':Sequelize[_0xcf68('0x21')](0xb)},'timerb':{'type':Sequelize[_0xcf68('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xcf68('0x1')]},'contactdeny':{'type':Sequelize[_0xcf68('0x1')]},'contactacl':{'type':Sequelize[_0xcf68('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xcf68('0x21')](0xb)},'encryption':{'type':Sequelize[_0xcf68('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'force_avp':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'icesupport':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no',_0xcf68('0x27'),_0xcf68('0x28'))},'dtlsrekey':{'type':Sequelize[_0xcf68('0x21')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xcf68('0x1')]},'dtlscipher':{'type':Sequelize[_0xcf68('0x1')]},'dtlscafile':{'type':Sequelize[_0xcf68('0x1')]},'dtlscapath':{'type':Sequelize[_0xcf68('0x1')]},'dtlssetup':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x29'),_0xcf68('0x2a'),_0xcf68('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xcf68('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xcf68('0x1')]},'recordofffeature':{'type':Sequelize[_0xcf68('0x1')]},'call_limit':{'type':Sequelize[_0xcf68('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0xcf68('0x2')](_0xcf68('0x15'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xcf68('0x1')]},'mohsuggest':{'type':Sequelize[_0xcf68('0x1')]},'parkinglot':{'type':Sequelize[_0xcf68('0x1')]},'description':{'type':Sequelize[_0xcf68('0x1')]},'host':{'type':Sequelize[_0xcf68('0x1')],'defaultValue':_0xcf68('0x2c')},'canreinvite':{'type':Sequelize['ENUM'](_0xcf68('0x15'),'no',_0xcf68('0x16'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xcf68('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x8f28=['uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','friend','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate'];(function(_0x13a38e,_0xdd146c){var _0x37befb=function(_0xad35e3){while(--_0xad35e3){_0x13a38e['push'](_0x13a38e['shift']());}};_0x37befb(++_0xdd146c);}(_0x8f28,0x73));var _0x88f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x88f2('0x0'));module['exports']={'name':{'type':Sequelize[_0x88f2('0x1')],'allowNull':![],'unique':_0x88f2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x88f2('0x3'),'user','peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x88f2('0x1')],'allowNull':![],'defaultValue':_0x88f2('0x4')},'callingpres':{'type':Sequelize[_0x88f2('0x5')]('ALLOWED_NOT_SCREENED',_0x88f2('0x6'),_0x88f2('0x7'),_0x88f2('0x8'),_0x88f2('0x9'),_0x88f2('0xa'),_0x88f2('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x88f2('0x1')]},'secret':{'type':Sequelize[_0x88f2('0x1')]},'md5secret':{'type':Sequelize[_0x88f2('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x88f2('0xc'),'set':function(_0x4544cc){this[_0x88f2('0xd')](_0x88f2('0xe'),_0x4544cc?_0x4544cc[_0x88f2('0xf')](','):null);},'get':function(){return this[_0x88f2('0x10')](_0x88f2('0xe'))?this[_0x88f2('0x10')](_0x88f2('0xe'))[_0x88f2('0x11')](','):null;},'comment':_0x88f2('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0x88f2('0x13'),'info',_0x88f2('0x14'),'inband','auto'),'defaultValue':_0x88f2('0x13')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x88f2('0x15'),_0x88f2('0x16'),_0x88f2('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x88f2('0x1')]},'directmediadeny':{'type':Sequelize[_0x88f2('0x1')]},'nat':{'type':Sequelize[_0x88f2('0x1')],'defaultValue':_0x88f2('0x19'),'set':function(_0x10b523){this[_0x88f2('0xd')](_0x88f2('0x1a'),_0x10b523?_0x10b523[_0x88f2('0xf')](','):null);},'get':function(){return this[_0x88f2('0x10')](_0x88f2('0x1a'))?this['getDataValue'](_0x88f2('0x1a'))[_0x88f2('0x11')](','):null;},'comment':_0x88f2('0x1b')},'callgroup':{'type':Sequelize[_0x88f2('0x1')]},'namedcallgroup':{'type':Sequelize[_0x88f2('0x1')]},'pickupgroup':{'type':Sequelize[_0x88f2('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x88f2('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x88f2('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x88f2('0x1')],'defaultValue':_0x88f2('0x1c')},'allow':{'type':Sequelize[_0x88f2('0x1')],'allowNull':![],'defaultValue':_0x88f2('0x1d'),'set':function(_0x4905ac){this[_0x88f2('0xd')](_0x88f2('0x1e'),_0x4905ac?_0x4905ac['join'](';'):_0x88f2('0x1d'));},'get':function(){return this[_0x88f2('0x10')](_0x88f2('0x1e'))?this['getDataValue']('allow')[_0x88f2('0x11')](';'):null;},'comment':_0x88f2('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x88f2('0x18'),'no')},'insecure':{'type':Sequelize[_0x88f2('0x1')],'defaultValue':_0x88f2('0x20'),'set':function(_0x541544){this[_0x88f2('0xd')](_0x88f2('0x21'),_0x541544?_0x541544[_0x88f2('0xf')](','):null);},'get':function(){return this[_0x88f2('0x10')](_0x88f2('0x21'))?this[_0x88f2('0x10')]('insecure')[_0x88f2('0x11')](','):null;},'comment':_0x88f2('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x88f2('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no',_0x88f2('0x23'))},'promiscredir':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x88f2('0x24')](0xb)},'setvar':{'type':Sequelize[_0x88f2('0x1')]},'callerid':{'type':Sequelize[_0x88f2('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x88f2('0x1')]},'callcounter':{'type':Sequelize[_0x88f2('0x5')]('yes','no'),'defaultValue':_0x88f2('0x18')},'busylevel':{'type':Sequelize[_0x88f2('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no',_0x88f2('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x88f2('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'mailbox':{'type':Sequelize[_0x88f2('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x88f2('0x26'),_0x88f2('0x27'),_0x88f2('0x28'))},'session_expires':{'type':Sequelize[_0x88f2('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x88f2('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x29'),_0x88f2('0x2a')),'defaultValue':_0x88f2('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x88f2('0x1')]},'regexten':{'type':Sequelize[_0x88f2('0x1')]},'fromdomain':{'type':Sequelize[_0x88f2('0x1')]},'fromuser':{'type':Sequelize[_0x88f2('0x1')]},'port':{'type':Sequelize[_0x88f2('0x24')](0x5)},'qualify':{'type':Sequelize[_0x88f2('0x5')]('yes','no'),'defaultValue':_0x88f2('0x18')},'keepalive':{'type':Sequelize[_0x88f2('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x88f2('0x1')]},'rtptimeout':{'type':Sequelize[_0x88f2('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x88f2('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x88f2('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no',_0x88f2('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x88f2('0x1')]},'callbackextension':{'type':Sequelize[_0x88f2('0x1')]},'timert1':{'type':Sequelize[_0x88f2('0x24')](0xb)},'timerb':{'type':Sequelize[_0x88f2('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x88f2('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x88f2('0x1')]},'contactdeny':{'type':Sequelize[_0x88f2('0x1')]},'contactacl':{'type':Sequelize[_0x88f2('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x88f2('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x88f2('0x18'),'no')},'force_avp':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'icesupport':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x88f2('0x5')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no',_0x88f2('0x2c'),_0x88f2('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x88f2('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x88f2('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x88f2('0x1')]},'dtlscipher':{'type':Sequelize[_0x88f2('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x88f2('0x1')]},'dtlssetup':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x2e'),_0x88f2('0x2f'),_0x88f2('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x88f2('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x88f2('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x88f2('0x5')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no')},'vmexten':{'type':Sequelize[_0x88f2('0x1')]},'mohinterpret':{'type':Sequelize[_0x88f2('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x88f2('0x1')]},'description':{'type':Sequelize[_0x88f2('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x88f2('0x31')},'canreinvite':{'type':Sequelize[_0x88f2('0x5')](_0x88f2('0x18'),'no',_0x88f2('0x15'),_0x88f2('0x16'),_0x88f2('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x88f2('0x1')]},'otherFields':{'type':Sequelize[_0x88f2('0x1')]},'active':{'type':Sequelize[_0x88f2('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x88f2('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index fe645f6..d499933 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc464=['http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','set','save','update','destroy','then','get','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','utf8','join','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','server/files/templates/registry.ejs','chan_sip.so','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client'];(function(_0x34f95b,_0x2ff1be){var _0x160fa7=function(_0x5b5aea){while(--_0x5b5aea){_0x34f95b['push'](_0x34f95b['shift']());}};_0x160fa7(++_0x2ff1be);}(_0xc464,0xc5));var _0x4c46=function(_0x517add,_0x443bad){_0x517add=_0x517add-0x0;var _0x1e96c2=_0xc464[_0x517add];return _0x1e96c2;};'use strict';var pdf=require(_0x4c46('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4c46('0x1'));var zipdir=require(_0x4c46('0x2'));var jsonpatch=require(_0x4c46('0x3'));var rp=require(_0x4c46('0x4'));var moment=require(_0x4c46('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4c46('0x6'));var util=require('util');var path=require(_0x4c46('0x7'));var sox=require(_0x4c46('0x8'));var csv=require(_0x4c46('0x9'));var ejs=require(_0x4c46('0xa'));var fs=require('fs');var _=require(_0x4c46('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4c46('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4c46('0x9'));var querystring=require('querystring');var Papa=require(_0x4c46('0xd'));var Redis=require(_0x4c46('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4c46('0xf'));var as=require(_0x4c46('0x10'));var hardwareService=require(_0x4c46('0x11'));var logger=require(_0x4c46('0x12'))(_0x4c46('0x13'));var utils=require('../../config/utils');var config=require(_0x4c46('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4c46('0x15'));var client=jayson[_0x4c46('0x16')][_0x4c46('0x17')]({'port':0x232a});function checkPasswordPattern(_0x96db9f,_0x31d523,_0x2527cc){if(_0x2527cc){var _0x1d1f03=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d1f03[_0x4c46('0x18')](_0x31d523)){return _0x96db9f;}else{throw new db['Sequelize']['ValidationError'](_0x4c46('0x19'));}}else{return _0x96db9f;}}function respondWithRpcPromise(_0x4e5022,_0x10943a,_0x152ef7,_0x4ad799){return new BPromise(function(_0x1c0218,_0xfa6c3e){var _0x43e56c=_0x4ad799||client;return _0x43e56c[_0x4c46('0x1a')](_0x4e5022,_0x152ef7)['then'](function(_0x195658){logger[_0x4c46('0x1b')]('Trunk,\x20%s,\x20%s',_0x10943a,'request\x20sent');logger[_0x4c46('0x1c')](_0x4c46('0x1d'),_0x10943a,_0x4c46('0x1e'),JSON[_0x4c46('0x1f')](_0x195658));if(_0x195658[_0x4c46('0x20')]){if(_0x195658[_0x4c46('0x20')][_0x4c46('0x21')]===0x1f4){logger[_0x4c46('0x20')]('Trunk,\x20%s,\x20%s',_0x10943a,_0x195658[_0x4c46('0x20')][_0x4c46('0x22')]);return _0xfa6c3e(_0x195658[_0x4c46('0x20')]['message']);}logger[_0x4c46('0x20')](_0x4c46('0x23'),_0x10943a,_0x195658['error']['message']);return _0x1c0218(_0x195658[_0x4c46('0x20')][_0x4c46('0x22')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x10943a,'request\x20sent');_0x1c0218(_0x195658[_0x4c46('0x24')][_0x4c46('0x22')]);}})[_0x4c46('0x25')](function(_0x4c0196){logger[_0x4c46('0x20')](_0x4c46('0x23'),_0x10943a,_0x4c0196);_0xfa6c3e(_0x4c0196);});});}function respondWithStatusCode(_0x136246,_0x5ad728){_0x5ad728=_0x5ad728||0xcc;return function(_0x5aa097){if(_0x5aa097){return _0x136246[_0x4c46('0x26')](_0x5ad728);}return _0x136246[_0x4c46('0x27')](_0x5ad728)[_0x4c46('0x28')]();};}function respondWithResult(_0x57a321,_0x1ae2ca){_0x1ae2ca=_0x1ae2ca||0xc8;return function(_0x2b3165){if(_0x2b3165){return _0x57a321[_0x4c46('0x27')](_0x1ae2ca)[_0x4c46('0x29')](_0x2b3165);}};}function respondWithFilteredResult(_0x2f4ded,_0x113c39){return function(_0x56c2d0){if(_0x56c2d0){var _0x2837e6=_0x56c2d0[_0x4c46('0x2a')],_0x4ff5fa=_0x113c39[_0x4c46('0x2b')],_0x228a5a=_0x113c39[_0x4c46('0x2b')]+_0x113c39['limit'],_0x5cccdb;if(_0x228a5a>=_0x2837e6){_0x228a5a=_0x2837e6;_0x5cccdb=0xc8;}else{_0x5cccdb=0xce;}_0x2f4ded[_0x4c46('0x27')](_0x5cccdb);return _0x2f4ded[_0x4c46('0x2c')]('Content-Range',_0x4ff5fa+'-'+_0x228a5a+'/'+_0x2837e6)[_0x4c46('0x29')](_0x56c2d0);}return null;};}function patchUpdates(_0xee17f2){return function(_0x507fe0){try{jsonpatch['apply'](_0x507fe0,_0xee17f2,!![]);}catch(_0x1e8862){return BPromise['reject'](_0x1e8862);}return _0x507fe0[_0x4c46('0x2d')]();};}function saveUpdates(_0x2e0eaa,_0x261a0a){return function(_0x59a507){if(_0x59a507){return _0x59a507[_0x4c46('0x2e')](_0x2e0eaa)['then'](function(_0x5b1d1d){return _0x5b1d1d;});}return null;};}function removeEntity(_0x4ff0db,_0x28841b){return function(_0x3cef39){if(_0x3cef39){return _0x3cef39[_0x4c46('0x2f')]()[_0x4c46('0x30')](function(){var _0x55c488=_0x3cef39[_0x4c46('0x31')]({'plain':!![]});var _0x5dbd4f='Trunks';return db[_0x4c46('0x32')][_0x4c46('0x2f')]({'where':{'type':_0x5dbd4f,'resourceId':_0x55c488['id']}})['then'](function(){return _0x3cef39;});})[_0x4c46('0x30')](function(){_0x4ff0db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x546ded,_0x2dab1b){return function(_0x1a5dbd){if(!_0x1a5dbd){_0x546ded['sendStatus'](0x194);}return _0x1a5dbd;};}function handleError(_0x1d6eac,_0x5b03c0){_0x5b03c0=_0x5b03c0||0x1f4;return function(_0x133b81){logger[_0x4c46('0x20')](_0x133b81[_0x4c46('0x33')]);if(_0x133b81[_0x4c46('0x34')]){delete _0x133b81[_0x4c46('0x34')];}_0x1d6eac[_0x4c46('0x27')](_0x5b03c0)['send'](_0x133b81);};}exports[_0x4c46('0x35')]=function(_0x259601,_0x411b77){var _0x3dc4e1={},_0x3fde12={},_0x4bb2f9={'count':0x0,'rows':[]};var _0x4ebfef=_[_0x4c46('0x36')](db[_0x4c46('0x37')][_0x4c46('0x38')],function(_0x46951e){return{'name':_0x46951e['fieldName'],'type':_0x46951e[_0x4c46('0x39')]['key']};});_0x3fde12[_0x4c46('0x3a')]=_[_0x4c46('0x36')](_0x4ebfef,_0x4c46('0x34'));_0x3fde12['query']=_[_0x4c46('0x3b')](_0x259601[_0x4c46('0x3c')]);_0x3fde12[_0x4c46('0x3d')]=_['intersection'](_0x3fde12[_0x4c46('0x3a')],_0x3fde12[_0x4c46('0x3c')]);_0x3dc4e1['attributes']=_[_0x4c46('0x3e')](_0x3fde12['model'],qs['fields'](_0x259601[_0x4c46('0x3c')][_0x4c46('0x3f')]));_0x3dc4e1[_0x4c46('0x40')]=_0x3dc4e1[_0x4c46('0x40')][_0x4c46('0x41')]?_0x3dc4e1[_0x4c46('0x40')]:_0x3fde12[_0x4c46('0x3a')];if(!_0x259601[_0x4c46('0x3c')][_0x4c46('0x42')](_0x4c46('0x43'))){_0x3dc4e1[_0x4c46('0x44')]=qs[_0x4c46('0x44')](_0x259601[_0x4c46('0x3c')][_0x4c46('0x44')]);_0x3dc4e1[_0x4c46('0x2b')]=qs[_0x4c46('0x2b')](_0x259601[_0x4c46('0x3c')][_0x4c46('0x2b')]);}_0x3dc4e1[_0x4c46('0x45')]=qs[_0x4c46('0x46')](_0x259601[_0x4c46('0x3c')][_0x4c46('0x46')]);_0x3dc4e1[_0x4c46('0x47')]=qs[_0x4c46('0x3d')](_[_0x4c46('0x48')](_0x259601[_0x4c46('0x3c')],_0x3fde12['filters']));if(_0x259601[_0x4c46('0x3c')][_0x4c46('0x49')]){_0x3dc4e1[_0x4c46('0x47')]=_[_0x4c46('0x4a')](_0x3dc4e1[_0x4c46('0x47')],{'$or':_['map'](_0x4ebfef,function(_0x15a96a){if(_0x15a96a[_0x4c46('0x39')]!==_0x4c46('0x4b')){var _0x2c9d4c={};_0x2c9d4c[_0x15a96a['name']]={'$like':'%'+_0x259601[_0x4c46('0x3c')]['filter']+'%'};return _0x2c9d4c;}})});}_0x3dc4e1=_[_0x4c46('0x4a')]({},_0x3dc4e1,_0x259601[_0x4c46('0x4c')]);var _0xd39156={'where':_0x3dc4e1[_0x4c46('0x47')]};return db[_0x4c46('0x37')][_0x4c46('0x2a')](_0xd39156)[_0x4c46('0x30')](function(_0x90ed4d){_0x4bb2f9[_0x4c46('0x2a')]=_0x90ed4d;if(_0x259601[_0x4c46('0x3c')][_0x4c46('0x4d')]){_0x3dc4e1[_0x4c46('0x4e')]=[{'all':!![]}];}return db[_0x4c46('0x37')][_0x4c46('0x4f')](_0x3dc4e1);})[_0x4c46('0x30')](function(_0x281ddc){_0x4bb2f9[_0x4c46('0x50')]=_0x281ddc;return _0x4bb2f9;})['then'](respondWithFilteredResult(_0x411b77,_0x3dc4e1))[_0x4c46('0x25')](handleError(_0x411b77,null));};exports[_0x4c46('0x51')]=function(_0xf92fdb,_0x3995e3){var _0xf47993={'raw':![],'where':{'id':_0xf92fdb[_0x4c46('0x52')]['id']}},_0x464547={};_0x464547['model']=_[_0x4c46('0x3b')](db[_0x4c46('0x37')][_0x4c46('0x38')]);_0x464547[_0x4c46('0x3c')]=_[_0x4c46('0x3b')](_0xf92fdb[_0x4c46('0x3c')]);_0x464547['filters']=_[_0x4c46('0x3e')](_0x464547['model'],_0x464547[_0x4c46('0x3c')]);_0xf47993[_0x4c46('0x40')]=_[_0x4c46('0x3e')](_0x464547[_0x4c46('0x3a')],qs['fields'](_0xf92fdb['query'][_0x4c46('0x3f')]));_0xf47993[_0x4c46('0x40')]=_0xf47993[_0x4c46('0x40')]['length']?_0xf47993[_0x4c46('0x40')]:_0x464547[_0x4c46('0x3a')];if(_0xf92fdb[_0x4c46('0x3c')][_0x4c46('0x4d')]){_0xf47993[_0x4c46('0x4e')]=[{'all':!![]}];}_0xf47993=_['merge']({},_0xf47993,_0xf92fdb['options']);return db['Trunk'][_0x4c46('0x53')](_0xf47993)['then'](handleEntityNotFound(_0x3995e3,null))[_0x4c46('0x30')](respondWithResult(_0x3995e3,null))[_0x4c46('0x25')](handleError(_0x3995e3,null));};exports[_0x4c46('0x54')]=function(_0x17438f,_0x639f72){var _0x52c32b={'where':{'id':_0x17438f['params']['id']}},_0x356492={};_0x356492[_0x4c46('0x3a')]=_[_0x4c46('0x3b')](db[_0x4c46('0x37')][_0x4c46('0x38')]);_0x52c32b[_0x4c46('0x40')]=_[_0x4c46('0x3e')](_0x356492[_0x4c46('0x3a')],qs[_0x4c46('0x3f')](_0x17438f[_0x4c46('0x3c')][_0x4c46('0x3f')]));_0x52c32b[_0x4c46('0x40')]=_0x52c32b[_0x4c46('0x40')][_0x4c46('0x41')]?_0x52c32b[_0x4c46('0x40')]:_0x356492[_0x4c46('0x3a')];if(_0x17438f[_0x4c46('0x3c')][_0x4c46('0x4d')]){_0x52c32b['include']=[{'all':!![]}];}_0x52c32b=_[_0x4c46('0x4a')]({},_0x52c32b,_0x17438f[_0x4c46('0x4c')]);return db[_0x4c46('0x37')][_0x4c46('0x53')](_0x52c32b)['then'](handleEntityNotFound(_0x639f72,null))[_0x4c46('0x30')](function(_0x40e10b){if(_0x40e10b){var _0x366d8d=_0x40e10b[_0x4c46('0x31')]({'plain':!![]});_0x366d8d=qs['omit'](_0x366d8d,['id',_0x4c46('0x55'),_0x4c46('0x56')]);_0x17438f['body']=_[_0x4c46('0x57')](_0x17438f['body'],['id',_0x4c46('0x55'),_0x4c46('0x56')]);return db[_0x4c46('0x37')][_0x4c46('0x58')](_['merge'](_0x366d8d,_0x17438f[_0x4c46('0x59')]),{'include':_0x17438f['query'][_0x4c46('0x4d')]?[{'all':!![]}]:undefined})[_0x4c46('0x30')](function(_0x33161c){var _0x306c3b=_0x17438f[_0x4c46('0x5a')][_0x4c46('0x31')]({'plain':!![]});if(!_0x306c3b)throw new Error(_0x4c46('0x5b'));if(_0x306c3b[_0x4c46('0x5c')]===_0x4c46('0x5a')){var _0x688c00=_0x33161c[_0x4c46('0x31')]({'plain':!![]});var _0x28101b=_0x4c46('0x5d');return db['UserProfileSection'][_0x4c46('0x53')]({'where':{'name':_0x28101b,'userProfileId':_0x306c3b[_0x4c46('0x5e')]},'raw':!![]})[_0x4c46('0x30')](function(_0x27cb79){if(_0x27cb79&&_0x27cb79[_0x4c46('0x5f')]===0x0){return db[_0x4c46('0x32')][_0x4c46('0x58')]({'name':_0x688c00[_0x4c46('0x34')],'resourceId':_0x688c00['id'],'type':_0x27cb79[_0x4c46('0x34')],'sectionId':_0x27cb79['id']},{})['then'](function(){return _0x33161c;});}else{return _0x33161c;}})[_0x4c46('0x25')](function(_0x11e62e){logger[_0x4c46('0x20')](_0x4c46('0x60'),_0x11e62e);throw _0x11e62e;});}return _0x33161c;});}})[_0x4c46('0x30')](respondWithResult(_0x639f72,0xc9))['catch'](handleError(_0x639f72,null));};exports[_0x4c46('0x58')]=function(_0x1f192d,_0x1131e7,_0x4039f1){var _0x24b0f7;return db[_0x4c46('0x37')][_0x4c46('0x58')](_0x1f192d[_0x4c46('0x59')],{'raw':!![]})[_0x4c46('0x30')](function(_0x452bd4){_0x24b0f7=_0x452bd4;return db[_0x4c46('0x37')][_0x4c46('0x4f')]({'raw':!![]});})[_0x4c46('0x30')](function(_0x3364d8){var _0x2f70d5=fs[_0x4c46('0x61')](path['join'](config[_0x4c46('0x62')],_0x4c46('0x63')),_0x4c46('0x64'));var _0x307552=fs[_0x4c46('0x61')](path[_0x4c46('0x65')](config[_0x4c46('0x62')],'server/files/templates/registry.ejs'),_0x4c46('0x64'));var _0x4a67cb=ejs[_0x4c46('0x66')](_0x2f70d5,{'trunks':_0x3364d8||[]});fs[_0x4c46('0x67')](_0x4c46('0x68'),_0x4a67cb);if(_0x24b0f7[_0x4c46('0x69')]){var _0x5b1bc1=ejs[_0x4c46('0x66')](_0x307552,{'trunks':_0x3364d8||[]});fs[_0x4c46('0x67')](_0x4c46('0x6a'),_0x5b1bc1);}})['then'](function(){return respondWithRpcPromise(_0x4c46('0x6b'),_0x4c46('0x58'),{'module':'chan_sip.so'});})[_0x4c46('0x30')](function(){var _0x515c05=_0x1f192d[_0x4c46('0x5a')][_0x4c46('0x31')]({'plain':!![]});if(!_0x515c05)throw new Error(_0x4c46('0x5b'));if(_0x515c05[_0x4c46('0x5c')]==='user'){var _0x222073=_0x24b0f7[_0x4c46('0x31')]({'plain':!![]});return db['UserProfileSection'][_0x4c46('0x53')]({'where':{'name':_0x4c46('0x5d'),'userProfileId':_0x515c05[_0x4c46('0x5e')]},'raw':!![]})[_0x4c46('0x30')](function(_0x5bd4b7){if(_0x5bd4b7&&_0x5bd4b7[_0x4c46('0x5f')]===0x0){return db[_0x4c46('0x32')]['create']({'name':_0x222073['name'],'resourceId':_0x222073['id'],'type':_0x5bd4b7[_0x4c46('0x34')],'sectionId':_0x5bd4b7['id']},{})[_0x4c46('0x30')](function(){return _0x24b0f7;});}else{return _0x24b0f7;}})[_0x4c46('0x25')](function(_0x2b8624){logger[_0x4c46('0x20')](_0x4c46('0x60'),_0x2b8624);throw _0x2b8624;});}return _0x24b0f7;})[_0x4c46('0x30')](respondWithResult(_0x1131e7,0xc9))[_0x4c46('0x25')](handleError(_0x1131e7,null));};exports[_0x4c46('0x2e')]=function(_0x4be83f,_0x308a03,_0x42e1e3){var _0x4c6d7f;return db[_0x4c46('0x37')]['find']({'where':{'id':_0x4be83f[_0x4c46('0x52')]['id']}})[_0x4c46('0x30')](handleEntityNotFound(_0x308a03,null))['then'](saveUpdates(_0x4be83f[_0x4c46('0x59')],null))[_0x4c46('0x30')](function(_0x45a94d){if(_0x45a94d){_0x4c6d7f=_0x45a94d;return db['Trunk'][_0x4c46('0x4f')]({'raw':!![]});}})[_0x4c46('0x30')](function(_0x2af71d){if(_0x2af71d){var _0xbead47=fs[_0x4c46('0x61')](path[_0x4c46('0x65')](config['root'],_0x4c46('0x63')),_0x4c46('0x64'));var _0x8be139=fs[_0x4c46('0x61')](path[_0x4c46('0x65')](config[_0x4c46('0x62')],_0x4c46('0x6c')),_0x4c46('0x64'));var _0xb2af6c=ejs[_0x4c46('0x66')](_0xbead47,{'trunks':_0x2af71d||[]});fs[_0x4c46('0x67')](_0x4c46('0x68'),_0xb2af6c);var _0x54b4f9=ejs[_0x4c46('0x66')](_0x8be139,{'trunks':_0x2af71d||[]});fs[_0x4c46('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x54b4f9);return respondWithRpcPromise('Reload',_0x4c46('0x2e'),{'module':'chan_sip.so'});}return null;})[_0x4c46('0x30')](function(_0x30315d){if(_0x30315d){return _0x4c6d7f;}})[_0x4c46('0x30')](respondWithResult(_0x308a03,null))[_0x4c46('0x25')](handleError(_0x308a03,null));};exports[_0x4c46('0x2f')]=function(_0x27ae2b,_0x443c7d,_0x1c4b63){var _0x314d87;return db[_0x4c46('0x37')][_0x4c46('0x53')]({'where':{'id':_0x27ae2b['params']['id']}})['then'](handleEntityNotFound(_0x443c7d,null))[_0x4c46('0x30')](removeEntity(_0x443c7d,null))[_0x4c46('0x30')](function(){return db[_0x4c46('0x37')][_0x4c46('0x4f')]({'raw':!![]});})['then'](function(_0x5a7866){var _0x3c927c=fs[_0x4c46('0x61')](path[_0x4c46('0x65')](config[_0x4c46('0x62')],_0x4c46('0x63')),_0x4c46('0x64'));var _0x1ff0c6=fs[_0x4c46('0x61')](path[_0x4c46('0x65')](config[_0x4c46('0x62')],_0x4c46('0x6c')),'utf8');var _0x1f8667=ejs[_0x4c46('0x66')](_0x3c927c,{'trunks':_0x5a7866});var _0x562125=ejs[_0x4c46('0x66')](_0x1ff0c6,{'trunks':_0x5a7866});fs[_0x4c46('0x67')](_0x4c46('0x68'),_0x1f8667);fs[_0x4c46('0x67')](_0x4c46('0x6a'),_0x562125);return respondWithRpcPromise('Reload',_0x4c46('0x2f'),{'module':_0x4c46('0x6d')});})[_0x4c46('0x25')](handleError(_0x443c7d,null));}; \ No newline at end of file +var _0x09b4=['writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','update','find','server/files/templates/trunk.ejs','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','end','json','count','offset','set','Content-Range','apply','reject','destroy','get','Trunks','stack','name','send','index','Trunk','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','type','VIRTUAL','findAll','params','includeAll','include','options','clone','omit','updatedAt','body','createdAt','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','utf8','server/files/templates/registry.ejs'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x09b4,0xea));var _0x409b=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x09b4[_0x38ced4];return _0x547c07;};'use strict';var pdf=require(_0x409b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x409b('0x1'));var zipdir=require(_0x409b('0x2'));var jsonpatch=require(_0x409b('0x3'));var rp=require(_0x409b('0x4'));var moment=require(_0x409b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x409b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x409b('0x7'));var fs=require('fs');var _=require(_0x409b('0x8'));var squel=require(_0x409b('0x9'));var crypto=require(_0x409b('0xa'));var jsforce=require(_0x409b('0xb'));var deskjs=require(_0x409b('0xc'));var toCsv=require(_0x409b('0xd'));var querystring=require(_0x409b('0xe'));var Papa=require(_0x409b('0xf'));var Redis=require(_0x409b('0x10'));var authService=require(_0x409b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x409b('0x12'));var hardwareService=require(_0x409b('0x13'));var logger=require(_0x409b('0x14'))(_0x409b('0x15'));var utils=require('../../config/utils');var config=require(_0x409b('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x409b('0x17'));var client=jayson[_0x409b('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x13d54c,_0x1b00f9,_0x4660b3){if(_0x4660b3){var _0x1d7ce7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d7ce7[_0x409b('0x19')](_0x1b00f9)){return _0x13d54c;}else{throw new db['Sequelize'][(_0x409b('0x1a'))](_0x409b('0x1b'));}}else{return _0x13d54c;}}function respondWithRpcPromise(_0x5f5062,_0x11201f,_0x57a106,_0x4485c8){return new BPromise(function(_0x1f3392,_0x1cb676){var _0x7137b4=_0x4485c8||client;return _0x7137b4[_0x409b('0x1c')](_0x5f5062,_0x57a106)[_0x409b('0x1d')](function(_0x20a847){logger['info'](_0x409b('0x1e'),_0x11201f,_0x409b('0x1f'));logger[_0x409b('0x20')](_0x409b('0x21'),_0x11201f,'request\x20sent',JSON['stringify'](_0x20a847));if(_0x20a847[_0x409b('0x22')]){if(_0x20a847[_0x409b('0x22')]['code']===0x1f4){logger['error'](_0x409b('0x1e'),_0x11201f,_0x20a847[_0x409b('0x22')][_0x409b('0x23')]);return _0x1cb676(_0x20a847[_0x409b('0x22')][_0x409b('0x23')]);}logger['error'](_0x409b('0x1e'),_0x11201f,_0x20a847[_0x409b('0x22')][_0x409b('0x23')]);return _0x1f3392(_0x20a847[_0x409b('0x22')][_0x409b('0x23')]);}else{logger[_0x409b('0x24')](_0x409b('0x1e'),_0x11201f,'request\x20sent');_0x1f3392(_0x20a847[_0x409b('0x25')][_0x409b('0x23')]);}})[_0x409b('0x26')](function(_0x3f4cc0){logger[_0x409b('0x22')](_0x409b('0x1e'),_0x11201f,_0x3f4cc0);_0x1cb676(_0x3f4cc0);});});}function respondWithStatusCode(_0x240ec2,_0x3061cd){_0x3061cd=_0x3061cd||0xcc;return function(_0x2e25a6){if(_0x2e25a6){return _0x240ec2['sendStatus'](_0x3061cd);}return _0x240ec2[_0x409b('0x27')](_0x3061cd)[_0x409b('0x28')]();};}function respondWithResult(_0x1497e4,_0x33df72){_0x33df72=_0x33df72||0xc8;return function(_0x2b99d7){if(_0x2b99d7){return _0x1497e4[_0x409b('0x27')](_0x33df72)[_0x409b('0x29')](_0x2b99d7);}};}function respondWithFilteredResult(_0xa38db0,_0x1dfa53){return function(_0xfd0386){if(_0xfd0386){var _0x13406b=_0xfd0386[_0x409b('0x2a')],_0x9455ab=_0x1dfa53[_0x409b('0x2b')],_0x2c292f=_0x1dfa53[_0x409b('0x2b')]+_0x1dfa53['limit'],_0x5a7e4f;if(_0x2c292f>=_0x13406b){_0x2c292f=_0x13406b;_0x5a7e4f=0xc8;}else{_0x5a7e4f=0xce;}_0xa38db0[_0x409b('0x27')](_0x5a7e4f);return _0xa38db0[_0x409b('0x2c')](_0x409b('0x2d'),_0x9455ab+'-'+_0x2c292f+'/'+_0x13406b)['json'](_0xfd0386);}return null;};}function patchUpdates(_0x3d243c){return function(_0x4256b5){try{jsonpatch[_0x409b('0x2e')](_0x4256b5,_0x3d243c,!![]);}catch(_0x27c699){return BPromise[_0x409b('0x2f')](_0x27c699);}return _0x4256b5['save']();};}function saveUpdates(_0x5127b9,_0x5e76f0){return function(_0x562f89){if(_0x562f89){return _0x562f89['update'](_0x5127b9)[_0x409b('0x1d')](function(_0x3eff1b){return _0x3eff1b;});}return null;};}function removeEntity(_0x5a092b,_0x3f59f0){return function(_0x583bc4){if(_0x583bc4){return _0x583bc4[_0x409b('0x30')]()[_0x409b('0x1d')](function(){var _0x47a3fb=_0x583bc4[_0x409b('0x31')]({'plain':!![]});var _0x1d8741=_0x409b('0x32');return db['UserProfileResource'][_0x409b('0x30')]({'where':{'type':_0x1d8741,'resourceId':_0x47a3fb['id']}})[_0x409b('0x1d')](function(){return _0x583bc4;});})[_0x409b('0x1d')](function(){_0x5a092b[_0x409b('0x27')](0xcc)[_0x409b('0x28')]();});}};}function handleEntityNotFound(_0x2ba679,_0x424b69){return function(_0x5924c1){if(!_0x5924c1){_0x2ba679['sendStatus'](0x194);}return _0x5924c1;};}function handleError(_0x2d0368,_0xf8554d){_0xf8554d=_0xf8554d||0x1f4;return function(_0x4d8ee4){logger[_0x409b('0x22')](_0x4d8ee4[_0x409b('0x33')]);if(_0x4d8ee4[_0x409b('0x34')]){delete _0x4d8ee4[_0x409b('0x34')];}_0x2d0368[_0x409b('0x27')](_0xf8554d)[_0x409b('0x35')](_0x4d8ee4);};}exports[_0x409b('0x36')]=function(_0xc46382,_0xe952d6){var _0x38d540={},_0x276baf={},_0x413511={'count':0x0,'rows':[]};var _0x49198f=_['map'](db[_0x409b('0x37')][_0x409b('0x38')],function(_0x29008d){return{'name':_0x29008d[_0x409b('0x39')],'type':_0x29008d['type'][_0x409b('0x3a')]};});_0x276baf['model']=_[_0x409b('0x3b')](_0x49198f,_0x409b('0x34'));_0x276baf[_0x409b('0x3c')]=_[_0x409b('0x3d')](_0xc46382[_0x409b('0x3c')]);_0x276baf['filters']=_[_0x409b('0x3e')](_0x276baf[_0x409b('0x3f')],_0x276baf[_0x409b('0x3c')]);_0x38d540[_0x409b('0x40')]=_[_0x409b('0x3e')](_0x276baf[_0x409b('0x3f')],qs[_0x409b('0x41')](_0xc46382[_0x409b('0x3c')][_0x409b('0x41')]));_0x38d540[_0x409b('0x40')]=_0x38d540[_0x409b('0x40')][_0x409b('0x42')]?_0x38d540[_0x409b('0x40')]:_0x276baf[_0x409b('0x3f')];if(!_0xc46382[_0x409b('0x3c')][_0x409b('0x43')](_0x409b('0x44'))){_0x38d540['limit']=qs[_0x409b('0x45')](_0xc46382[_0x409b('0x3c')][_0x409b('0x45')]);_0x38d540['offset']=qs[_0x409b('0x2b')](_0xc46382[_0x409b('0x3c')][_0x409b('0x2b')]);}_0x38d540['order']=qs[_0x409b('0x46')](_0xc46382[_0x409b('0x3c')][_0x409b('0x46')]);_0x38d540['where']=qs[_0x409b('0x47')](_[_0x409b('0x48')](_0xc46382[_0x409b('0x3c')],_0x276baf[_0x409b('0x47')]));if(_0xc46382[_0x409b('0x3c')][_0x409b('0x49')]){_0x38d540[_0x409b('0x4a')]=_[_0x409b('0x4b')](_0x38d540[_0x409b('0x4a')],{'$or':_[_0x409b('0x3b')](_0x49198f,function(_0x4f2bd5){if(_0x4f2bd5[_0x409b('0x4c')]!==_0x409b('0x4d')){var _0x2c8676={};_0x2c8676[_0x4f2bd5['name']]={'$like':'%'+_0xc46382[_0x409b('0x3c')][_0x409b('0x49')]+'%'};return _0x2c8676;}})});}_0x38d540=_[_0x409b('0x4b')]({},_0x38d540,_0xc46382['options']);var _0x18a0be={'where':_0x38d540[_0x409b('0x4a')]};return db[_0x409b('0x37')]['count'](_0x18a0be)['then'](function(_0x5e1af4){_0x413511[_0x409b('0x2a')]=_0x5e1af4;if(_0xc46382[_0x409b('0x3c')]['includeAll']){_0x38d540['include']=[{'all':!![]}];}return db['Trunk'][_0x409b('0x4e')](_0x38d540);})[_0x409b('0x1d')](function(_0x51b397){_0x413511['rows']=_0x51b397;return _0x413511;})['then'](respondWithFilteredResult(_0xe952d6,_0x38d540))['catch'](handleError(_0xe952d6,null));};exports['show']=function(_0x74f7c7,_0x4d8b91){var _0x4b1bf9={'raw':![],'where':{'id':_0x74f7c7[_0x409b('0x4f')]['id']}},_0x2212cc={};_0x2212cc['model']=_[_0x409b('0x3d')](db[_0x409b('0x37')][_0x409b('0x38')]);_0x2212cc['query']=_[_0x409b('0x3d')](_0x74f7c7[_0x409b('0x3c')]);_0x2212cc['filters']=_[_0x409b('0x3e')](_0x2212cc['model'],_0x2212cc[_0x409b('0x3c')]);_0x4b1bf9[_0x409b('0x40')]=_[_0x409b('0x3e')](_0x2212cc[_0x409b('0x3f')],qs[_0x409b('0x41')](_0x74f7c7[_0x409b('0x3c')][_0x409b('0x41')]));_0x4b1bf9[_0x409b('0x40')]=_0x4b1bf9['attributes']['length']?_0x4b1bf9[_0x409b('0x40')]:_0x2212cc[_0x409b('0x3f')];if(_0x74f7c7['query'][_0x409b('0x50')]){_0x4b1bf9[_0x409b('0x51')]=[{'all':!![]}];}_0x4b1bf9=_[_0x409b('0x4b')]({},_0x4b1bf9,_0x74f7c7[_0x409b('0x52')]);return db[_0x409b('0x37')]['find'](_0x4b1bf9)['then'](handleEntityNotFound(_0x4d8b91,null))['then'](respondWithResult(_0x4d8b91,null))[_0x409b('0x26')](handleError(_0x4d8b91,null));};exports[_0x409b('0x53')]=function(_0x49f1bb,_0x256bb2){var _0x22eac2={'where':{'id':_0x49f1bb[_0x409b('0x4f')]['id']}},_0x4c4bbd={};_0x4c4bbd[_0x409b('0x3f')]=_[_0x409b('0x3d')](db[_0x409b('0x37')][_0x409b('0x38')]);_0x22eac2[_0x409b('0x40')]=_[_0x409b('0x3e')](_0x4c4bbd['model'],qs[_0x409b('0x41')](_0x49f1bb[_0x409b('0x3c')]['fields']));_0x22eac2[_0x409b('0x40')]=_0x22eac2[_0x409b('0x40')][_0x409b('0x42')]?_0x22eac2[_0x409b('0x40')]:_0x4c4bbd[_0x409b('0x3f')];if(_0x49f1bb[_0x409b('0x3c')][_0x409b('0x50')]){_0x22eac2[_0x409b('0x51')]=[{'all':!![]}];}_0x22eac2=_['merge']({},_0x22eac2,_0x49f1bb[_0x409b('0x52')]);return db['Trunk']['find'](_0x22eac2)[_0x409b('0x1d')](handleEntityNotFound(_0x256bb2,null))['then'](function(_0x4d1df0){if(_0x4d1df0){var _0x6fd811=_0x4d1df0[_0x409b('0x31')]({'plain':!![]});_0x6fd811=qs[_0x409b('0x54')](_0x6fd811,['id','createdAt',_0x409b('0x55')]);_0x49f1bb[_0x409b('0x56')]=_['omit'](_0x49f1bb[_0x409b('0x56')],['id',_0x409b('0x57'),'updatedAt']);return db['Trunk'][_0x409b('0x58')](_[_0x409b('0x4b')](_0x6fd811,_0x49f1bb['body']),{'include':_0x49f1bb[_0x409b('0x3c')][_0x409b('0x50')]?[{'all':!![]}]:undefined})[_0x409b('0x1d')](function(_0x4d63ab){var _0x3eb458=_0x49f1bb['user'][_0x409b('0x31')]({'plain':!![]});if(!_0x3eb458)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3eb458[_0x409b('0x59')]===_0x409b('0x5a')){var _0x6dd53b=_0x4d63ab['get']({'plain':!![]});var _0x1382e3=_0x409b('0x32');return db[_0x409b('0x5b')]['find']({'where':{'name':_0x1382e3,'userProfileId':_0x3eb458['userProfileId']},'raw':!![]})[_0x409b('0x1d')](function(_0x2dffad){if(_0x2dffad&&_0x2dffad[_0x409b('0x5c')]===0x0){return db['UserProfileResource'][_0x409b('0x58')]({'name':_0x6dd53b[_0x409b('0x34')],'resourceId':_0x6dd53b['id'],'type':_0x2dffad[_0x409b('0x34')],'sectionId':_0x2dffad['id']},{})[_0x409b('0x1d')](function(){return _0x4d63ab;});}else{return _0x4d63ab;}})[_0x409b('0x26')](function(_0x9890e2){logger[_0x409b('0x22')](_0x409b('0x5d'),_0x9890e2);throw _0x9890e2;});}return _0x4d63ab;});}})[_0x409b('0x1d')](respondWithResult(_0x256bb2,0xc9))[_0x409b('0x26')](handleError(_0x256bb2,null));};exports[_0x409b('0x58')]=function(_0xa54547,_0x1cf324,_0x58e704){var _0x11b23c;return db[_0x409b('0x37')][_0x409b('0x58')](_0xa54547[_0x409b('0x56')],{'raw':!![]})[_0x409b('0x1d')](function(_0x225dc6){_0x11b23c=_0x225dc6;return db[_0x409b('0x37')][_0x409b('0x4e')]({'raw':!![]});})[_0x409b('0x1d')](function(_0x185582){var _0x53d406=fs[_0x409b('0x5e')](path[_0x409b('0x5f')](config[_0x409b('0x60')],'server/files/templates/trunk.ejs'),_0x409b('0x61'));var _0x1eb040=fs[_0x409b('0x5e')](path[_0x409b('0x5f')](config['root'],_0x409b('0x62')),_0x409b('0x61'));var _0xcdeb8=ejs['render'](_0x53d406,{'trunks':_0x185582||[]});fs[_0x409b('0x63')](_0x409b('0x64'),_0xcdeb8);if(_0x11b23c[_0x409b('0x65')]){var _0x3909b3=ejs[_0x409b('0x66')](_0x1eb040,{'trunks':_0x185582||[]});fs[_0x409b('0x63')](_0x409b('0x67'),_0x3909b3);}})[_0x409b('0x1d')](function(){return respondWithRpcPromise(_0x409b('0x68'),_0x409b('0x58'),{'module':_0x409b('0x69')});})[_0x409b('0x1d')](function(){var _0x350bba=_0xa54547['user'][_0x409b('0x31')]({'plain':!![]});if(!_0x350bba)throw new Error(_0x409b('0x6a'));if(_0x350bba[_0x409b('0x59')]===_0x409b('0x5a')){var _0x62d2ee=_0x11b23c[_0x409b('0x31')]({'plain':!![]});return db[_0x409b('0x5b')]['find']({'where':{'name':_0x409b('0x32'),'userProfileId':_0x350bba[_0x409b('0x6b')]},'raw':!![]})['then'](function(_0x157a8d){if(_0x157a8d&&_0x157a8d[_0x409b('0x5c')]===0x0){return db['UserProfileResource'][_0x409b('0x58')]({'name':_0x62d2ee['name'],'resourceId':_0x62d2ee['id'],'type':_0x157a8d[_0x409b('0x34')],'sectionId':_0x157a8d['id']},{})['then'](function(){return _0x11b23c;});}else{return _0x11b23c;}})[_0x409b('0x26')](function(_0x429572){logger['error'](_0x409b('0x5d'),_0x429572);throw _0x429572;});}return _0x11b23c;})[_0x409b('0x1d')](respondWithResult(_0x1cf324,0xc9))[_0x409b('0x26')](handleError(_0x1cf324,null));};exports[_0x409b('0x6c')]=function(_0x229e2a,_0x57a211,_0xa36148){var _0x22c752;return db[_0x409b('0x37')][_0x409b('0x6d')]({'where':{'id':_0x229e2a[_0x409b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57a211,null))[_0x409b('0x1d')](saveUpdates(_0x229e2a[_0x409b('0x56')],null))['then'](function(_0x2a3651){if(_0x2a3651){_0x22c752=_0x2a3651;return db[_0x409b('0x37')][_0x409b('0x4e')]({'raw':!![]});}})[_0x409b('0x1d')](function(_0x4146b5){if(_0x4146b5){var _0x597f1d=fs[_0x409b('0x5e')](path[_0x409b('0x5f')](config[_0x409b('0x60')],_0x409b('0x6e')),_0x409b('0x61'));var _0x410606=fs['readFileSync'](path[_0x409b('0x5f')](config[_0x409b('0x60')],'server/files/templates/registry.ejs'),_0x409b('0x61'));var _0x2fb168=ejs['render'](_0x597f1d,{'trunks':_0x4146b5||[]});fs[_0x409b('0x63')](_0x409b('0x64'),_0x2fb168);var _0x44096f=ejs[_0x409b('0x66')](_0x410606,{'trunks':_0x4146b5||[]});fs[_0x409b('0x63')]('/etc/asterisk/sip_xcally_registers.conf',_0x44096f);return respondWithRpcPromise(_0x409b('0x68'),_0x409b('0x6c'),{'module':_0x409b('0x69')});}return null;})[_0x409b('0x1d')](function(_0x46782c){if(_0x46782c){return _0x22c752;}})[_0x409b('0x1d')](respondWithResult(_0x57a211,null))[_0x409b('0x26')](handleError(_0x57a211,null));};exports[_0x409b('0x30')]=function(_0xefa3c4,_0x2d349d,_0x41e4d1){var _0x3f1b5c;return db[_0x409b('0x37')][_0x409b('0x6d')]({'where':{'id':_0xefa3c4[_0x409b('0x4f')]['id']}})[_0x409b('0x1d')](handleEntityNotFound(_0x2d349d,null))[_0x409b('0x1d')](removeEntity(_0x2d349d,null))[_0x409b('0x1d')](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x5a1f1f){var _0x27a22b=fs['readFileSync'](path[_0x409b('0x5f')](config['root'],_0x409b('0x6e')),_0x409b('0x61'));var _0x641a5b=fs[_0x409b('0x5e')](path[_0x409b('0x5f')](config['root'],_0x409b('0x62')),_0x409b('0x61'));var _0x15bd04=ejs[_0x409b('0x66')](_0x27a22b,{'trunks':_0x5a1f1f});var _0x101588=ejs[_0x409b('0x66')](_0x641a5b,{'trunks':_0x5a1f1f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x15bd04);fs[_0x409b('0x63')]('/etc/asterisk/sip_xcally_registers.conf',_0x101588);return respondWithRpcPromise(_0x409b('0x68'),_0x409b('0x30'),{'module':_0x409b('0x69')});})[_0x409b('0x26')](handleError(_0x2d349d,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 65250de..8ab19bf 100644 --- a/server/api/trunk/trunk.model.js +++ b/server/api/trunk/trunk.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f0a=['./trunk.attributes','exports','define','tools_trunks','lodash','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xecff3b,_0x4f6184){var _0x501dcb=function(_0x3b0fa2){while(--_0x3b0fa2){_0xecff3b['push'](_0xecff3b['shift']());}};_0x501dcb(++_0x4f6184);}(_0x3f0a,0x7c));var _0xa3f0=function(_0x4e8280,_0x240de2){_0x4e8280=_0x4e8280-0x0;var _0x19b7d2=_0x3f0a[_0x4e8280];return _0x19b7d2;};'use strict';var _=require(_0xa3f0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa3f0('0x1'));var BPromise=require('bluebird');var rp=require(_0xa3f0('0x2'));var fs=require('fs');var path=require(_0xa3f0('0x3'));var rimraf=require(_0xa3f0('0x4'));var config=require(_0xa3f0('0x5'));var attributes=require(_0xa3f0('0x6'));module[_0xa3f0('0x7')]=function(_0xbc7490,_0x1a1016){return _0xbc7490[_0xa3f0('0x8')]('Trunk',attributes,{'tableName':_0xa3f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e09=['rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e09,0x1e6));var _0x92e0=function(_0x29e33a,_0x486946){_0x29e33a=_0x29e33a-0x0;var _0xd8f682=_0x2e09[_0x29e33a];return _0xd8f682;};'use strict';var _=require(_0x92e0('0x0'));var util=require(_0x92e0('0x1'));var logger=require(_0x92e0('0x2'))(_0x92e0('0x3'));var moment=require(_0x92e0('0x4'));var BPromise=require('bluebird');var rp=require(_0x92e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92e0('0x6'));var config=require(_0x92e0('0x7'));var attributes=require(_0x92e0('0x8'));module[_0x92e0('0x9')]=function(_0x1fde63,_0x59c53d){return _0x1fde63[_0x92e0('0xa')](_0x92e0('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 7afe50f..cca95fb 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb8=['where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','catch','Trunk','findAll','options','raw','limit','include','model','attributes','map','then','GetTrunk','stringify','ShowTrunk'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x5eb8,0xb0));var _0x85eb=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0x5eb8[_0x35b2a1];return _0x6023da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['GetTrunk']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')]({'raw':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8['options'][_0x85eb('0x18')]===undefined?!![]:![]:!![],'where':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')]['where']||null:null,'attributes':_0x50d2a8['options']?_0x50d2a8['options']['attributes']||null:null,'limit':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x19')]||null:null,'include':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x1a')]?_['map'](_0x50d2a8['options']['include'],function(_0x298e84){return{'model':db[_0x298e84[_0x85eb('0x1b')]],'as':_0x298e84['as'],'attributes':_0x298e84[_0x85eb('0x1c')],'include':_0x298e84[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x298e84[_0x85eb('0x1a')],function(_0x5dfc96){return{'model':db[_0x5dfc96[_0x85eb('0x1b')]],'as':_0x5dfc96['as'],'attributes':_0x5dfc96[_0x85eb('0x1c')],'include':_0x5dfc96[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x5dfc96[_0x85eb('0x1a')],function(_0x57a03c){return{'model':db[_0x57a03c[_0x85eb('0x1b')]],'as':_0x57a03c['as'],'attributes':_0x57a03c[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x3e7eb9){logger[_0x85eb('0xd')](_0x85eb('0x1f'),_0x50d2a8);logger['debug']('GetTrunk',_0x50d2a8,JSON[_0x85eb('0x20')](_0x3e7eb9));_0x39ca96(_0x3e7eb9);})['catch'](function(_0xa9b14f){logger['error'](_0x85eb('0x1f'),_0xa9b14f[_0x85eb('0x13')],_0x50d2a8);_0x10cf2f(_0xe198ca[_0x85eb('0x12')](0x1f4,_0xa9b14f[_0x85eb('0x13')]));});});};exports[_0x85eb('0x21')]=function(_0xf4ac13){var _0x41ed76=this;return new Promise(function(_0x5decd5,_0x237f19){return db[_0x85eb('0x15')]['find']({'raw':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13['options']['raw']===undefined?!![]:![]:!![],'where':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x22')]||null:null,'attributes':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1c')]||null:null,'include':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0xf4ac13['options'][_0x85eb('0x1a')],function(_0x3a5b87){return{'model':db[_0x3a5b87['model']],'as':_0x3a5b87['as'],'attributes':_0x3a5b87['attributes'],'include':_0x3a5b87[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x3a5b87[_0x85eb('0x1a')],function(_0x12cb4c){return{'model':db[_0x12cb4c[_0x85eb('0x1b')]],'as':_0x12cb4c['as'],'attributes':_0x12cb4c[_0x85eb('0x1c')],'include':_0x12cb4c[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x12cb4c[_0x85eb('0x1a')],function(_0x373e5f){return{'model':db[_0x373e5f[_0x85eb('0x1b')]],'as':_0x373e5f['as'],'attributes':_0x373e5f[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x33605a){logger['info'](_0x85eb('0x21'),_0xf4ac13);logger[_0x85eb('0x10')]('ShowTrunk',_0xf4ac13,JSON['stringify'](_0x33605a));_0x5decd5(_0x33605a);})[_0x85eb('0x14')](function(_0xe22d16){logger['error'](_0x85eb('0x21'),_0xe22d16['message'],_0xf4ac13);_0x237f19(_0x41ed76[_0x85eb('0x12')](0x1f4,_0xe22d16['message']));});});}; \ No newline at end of file +var _0x5f2f=['map','include','model','attributes','then','ShowTrunk','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','raw','limit'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3e3510,_0x5a7953){_0x3e3510=_0x3e3510-0x0;var _0x50e052=_0x5f2f[_0x3e3510];return _0x50e052;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetTrunk',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetTrunk',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowTrunk',_0x153924);logger[_0xf5f2('0xf')]('ShowTrunk',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowTrunk',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 4871f37..589b7a5 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','/create_many','bulkCreate','create','join','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/whoami','whoami','/:id','/:id/avatar'];(function(_0x3f1e02,_0x226e16){var _0x21a4d4=function(_0x4244ca){while(--_0x4244ca){_0x3f1e02['push'](_0x3f1e02['shift']());}};_0x21a4d4(++_0x226e16);}(_0x2ef3,0xba));var _0x32ef=function(_0x3bdbe6,_0x340e99){_0x3bdbe6=_0x3bdbe6-0x0;var _0x27d83c=_0x2ef3[_0x3bdbe6];return _0x27d83c;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./user.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['show']);router['get'](_0x32ef('0xf'),controller[_0x32ef('0x10')]);router[_0x32ef('0x8')](_0x32ef('0x11'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router['get'](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x14')]);router[_0x32ef('0x8')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x32ef('0x15')]);router['get'](_0x32ef('0x16'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x17')]);router[_0x32ef('0x8')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x32ef('0x8')](_0x32ef('0x18'),auth[_0x32ef('0x9')](),controller['getScreenRecordings']);router['get'](_0x32ef('0x19'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1a')]);router['get'](_0x32ef('0x1b'),auth[_0x32ef('0x9')](),controller['getOpenchannelInteractions']);router[_0x32ef('0x8')](_0x32ef('0x1c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1d')]);router[_0x32ef('0x8')](_0x32ef('0x1e'),auth['isAuthenticated'](),controller[_0x32ef('0x1f')]);router['get'](_0x32ef('0x20'),auth[_0x32ef('0x9')](),controller['getFaxInteractions']);router[_0x32ef('0x8')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['getTeams']);router['get'](_0x32ef('0x22'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x23')]);router['get']('/:id/agents',auth[_0x32ef('0x9')](),controller['getAgents']);router['get'](_0x32ef('0x24'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x25')]);router[_0x32ef('0x8')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x27')]);router[_0x32ef('0x8')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x29')]);router[_0x32ef('0x8')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2a')]);router['get'](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2c')]);router[_0x32ef('0x8')]('/:id/chat_websites',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2d')]);router[_0x32ef('0x8')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2f')]);router[_0x32ef('0x8')]('/:id/scheduled_calls',auth[_0x32ef('0x9')](),controller['getScheduledCalls']);router[_0x32ef('0x8')](_0x32ef('0x30'),auth['isAuthenticated'](),controller[_0x32ef('0x31')]);router[_0x32ef('0x32')](_0x32ef('0x33'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x34')]);router['post']('/:id/contacts',auth[_0x32ef('0x9')](),controller['addContacts']);router[_0x32ef('0x32')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0x35')]);router[_0x32ef('0x32')](_0x32ef('0x13'),auth[_0x32ef('0x9')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x484ad7,_0x2261a6,_0x3c4651){_0x3c4651(null,path[_0x32ef('0x36')](config['root'],'server/files/images/'));},'filename':function(_0x1c3633,_0x2bd8a9,_0x410334){_0x410334(null,util['format']('%s-%s',Date[_0x32ef('0x37')](),_0x2bd8a9[_0x32ef('0x38')]));}})});router[_0x32ef('0x32')](_0x32ef('0xf'),upload[_0x32ef('0x39')](_0x32ef('0x3a')),controller[_0x32ef('0x3b')]);router[_0x32ef('0x32')](_0x32ef('0x3c'),auth['isAuthenticated'](),controller[_0x32ef('0x3d')]);router[_0x32ef('0x32')](_0x32ef('0x3e'),auth['isAuthenticated'](),controller[_0x32ef('0x3f')]);router[_0x32ef('0x32')](_0x32ef('0x40'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x41')]);router[_0x32ef('0x32')](_0x32ef('0x42'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x43')]);router[_0x32ef('0x32')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['addTeams']);router[_0x32ef('0x32')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x45')]);router[_0x32ef('0x32')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller['addMailInteractions']);router['post'](_0x32ef('0x47'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x48')]);router[_0x32ef('0x32')]('/:id/sms_interactions',auth[_0x32ef('0x9')](),controller[_0x32ef('0x49')]);router['post'](_0x32ef('0x4a'),auth['isAuthenticated'](),controller[_0x32ef('0x4b')]);router[_0x32ef('0x32')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4c')]);router[_0x32ef('0x32')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4d')]);router[_0x32ef('0x32')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller['addOpenchannelAccounts']);router[_0x32ef('0x32')](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller['addSmsAccounts']);router[_0x32ef('0x32')](_0x32ef('0x4e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4f')]);router[_0x32ef('0x32')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller['addSquareProjects']);router['post'](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x50')]);router[_0x32ef('0x51')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x52')]);router[_0x32ef('0x51')](_0x32ef('0x53'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x54')]);router[_0x32ef('0x55')](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x56')]);router[_0x32ef('0x55')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x57')]);router[_0x32ef('0x55')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x58')]);router[_0x32ef('0x55')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x59')]);router[_0x32ef('0x55')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5a')]);router[_0x32ef('0x55')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x32ef('0x5b')]);router[_0x32ef('0x55')](_0x32ef('0x5c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5d')]);router[_0x32ef('0x55')](_0x32ef('0x4a'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5e')]);router[_0x32ef('0x55')](_0x32ef('0x26'),auth['isAuthenticated'](),controller[_0x32ef('0x5f')]);router[_0x32ef('0x55')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x60')]);router[_0x32ef('0x55')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x61')]);router[_0x32ef('0x55')]('/:id/sms_accounts',auth[_0x32ef('0x9')](),controller['removeSmsAccounts']);router[_0x32ef('0x55')](_0x32ef('0x4e'),auth['isAuthenticated'](),controller[_0x32ef('0x62')]);router['delete'](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x63')]);router[_0x32ef('0x55')](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x64')]);module['exports']=router; \ No newline at end of file +var _0xadb5=['/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/create_many','bulkCreate','addContacts','addQueues','diskStorage','join','root','server/files/images/','format','now','single','addAvatar','/:id/logout','/:id/pause','pause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','removeQueues','delete','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x39c384,_0x4979b8){var _0x440397=function(_0x1bdbe2){while(--_0x1bdbe2){_0x39c384['push'](_0x39c384['shift']());}};_0x440397(++_0x4979b8);}(_0xadb5,0xad));var _0x5adb=function(_0x4a49b3,_0x2e1b8d){_0x4a49b3=_0x4a49b3-0x0;var _0x5e5e79=_0xadb5[_0x4a49b3];return _0x5e5e79;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x9')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router['get']('/:id/avatar',controller[_0x5adb('0x10')]);router[_0x5adb('0x9')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth['isAuthenticated'](),controller[_0x5adb('0x14')]);router[_0x5adb('0x9')](_0x5adb('0x15'),auth['isAuthenticated'](),controller[_0x5adb('0x16')]);router[_0x5adb('0x9')](_0x5adb('0x17'),auth['isAuthenticated'](),controller[_0x5adb('0x18')]);router['get'](_0x5adb('0x19'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x9')](_0x5adb('0x1b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1c')]);router[_0x5adb('0x9')](_0x5adb('0x1d'),auth['isAuthenticated'](),controller[_0x5adb('0x1e')]);router['get'](_0x5adb('0x1f'),auth['isAuthenticated'](),controller[_0x5adb('0x20')]);router['get']('/:id/mail/interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x21')]);router[_0x5adb('0x9')](_0x5adb('0x22'),auth[_0x5adb('0x7')](),controller['getSmsInteractions']);router[_0x5adb('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x5adb('0x23')]);router[_0x5adb('0x9')](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x25')]);router[_0x5adb('0x9')](_0x5adb('0x26'),auth['isAuthenticated'](),controller[_0x5adb('0x27')]);router[_0x5adb('0x9')](_0x5adb('0x28'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x29')]);router['get'](_0x5adb('0x2a'),auth[_0x5adb('0x7')](),controller['getVoicePrefixes']);router[_0x5adb('0x9')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller['getFaxAccounts']);router[_0x5adb('0x9')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x2d')]);router[_0x5adb('0x9')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x5adb('0x2f'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x30')]);router[_0x5adb('0x9')](_0x5adb('0x31'),auth['isAuthenticated'](),controller[_0x5adb('0x32')]);router[_0x5adb('0x9')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x34')]);router[_0x5adb('0x9')](_0x5adb('0x35'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x36')]);router[_0x5adb('0x9')]('/:id/api_key',auth[_0x5adb('0x7')](),controller['getApiKey']);router[_0x5adb('0x37')](_0x5adb('0x38'),auth['isAuthenticated'](),controller[_0x5adb('0x39')]);router[_0x5adb('0x37')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x3a')]);router[_0x5adb('0x37')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5adb('0x37')]('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x3b')]);var upload=multer({'storage':multer[_0x5adb('0x3c')]({'destination':function(_0x2da912,_0x9bdece,_0x5ece39){_0x5ece39(null,path[_0x5adb('0x3d')](config[_0x5adb('0x3e')],_0x5adb('0x3f')));},'filename':function(_0x54851b,_0x4c8870,_0x32eb69){_0x32eb69(null,util[_0x5adb('0x40')]('%s-%s',Date[_0x5adb('0x41')](),_0x4c8870['originalname']));}})});router[_0x5adb('0x37')]('/:id/avatar',upload[_0x5adb('0x42')]('file'),controller[_0x5adb('0x43')]);router[_0x5adb('0x37')]('/:id/login',auth[_0x5adb('0x7')](),controller['login']);router[_0x5adb('0x37')](_0x5adb('0x44'),auth[_0x5adb('0x7')](),controller['logout']);router[_0x5adb('0x37')](_0x5adb('0x45'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x46')]);router[_0x5adb('0x37')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router['post'](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x47')]);router[_0x5adb('0x37')](_0x5adb('0x48'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x49')]);router[_0x5adb('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x5adb('0x4a')]);router['post'](_0x5adb('0x4b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x4c')]);router[_0x5adb('0x37')](_0x5adb('0x4d'),auth['isAuthenticated'](),controller[_0x5adb('0x4e')]);router[_0x5adb('0x37')]('/:id/openchannel_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x4f')]);router['post'](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x50')]);router[_0x5adb('0x37')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x51')]);router['post']('/:id/openchannel_accounts',auth[_0x5adb('0x7')](),controller[_0x5adb('0x52')]);router[_0x5adb('0x37')](_0x5adb('0x2f'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x5adb('0x37')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x53')]);router[_0x5adb('0x37')]('/:id/square_projects',auth[_0x5adb('0x7')](),controller[_0x5adb('0x54')]);router['post'](_0x5adb('0x55'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x56')]);router[_0x5adb('0x57')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x58')]);router[_0x5adb('0x57')]('/:id/password',auth[_0x5adb('0x7')](),controller['changePassword']);router['delete']('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x59')]);router[_0x5adb('0x5a')]('/:id/teams',auth[_0x5adb('0x7')](),controller['removeTeams']);router[_0x5adb('0x5a')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller['destroy']);router[_0x5adb('0x5a')]('/:id/chat_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x5b')]);router['delete'](_0x5adb('0x5c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x5d')]);router[_0x5adb('0x5a')](_0x5adb('0x4b'),auth['isAuthenticated'](),controller[_0x5adb('0x5e')]);router[_0x5adb('0x5a')](_0x5adb('0x4d'),auth[_0x5adb('0x7')](),controller['removeSmsInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x5f'),auth[_0x5adb('0x7')](),controller['removeOpenchannelInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x60')]);router['delete'](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x61')]);router[_0x5adb('0x5a')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller[_0x5adb('0x62')]);router['delete'](_0x5adb('0x2f'),auth['isAuthenticated'](),controller[_0x5adb('0x63')]);router[_0x5adb('0x5a')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller['removeChatWebsites']);router[_0x5adb('0x5a')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x5adb('0x7')](),controller[_0x5adb('0x64')]);module[_0x5adb('0x65')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 34c5892..42b04c4 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x4549b0,_0x132a66){var _0x95552a=function(_0x2b0707){while(--_0x2b0707){_0x4549b0['push'](_0x4549b0['shift']());}};_0x95552a(++_0x132a66);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x5ae88c,_0x13bbd6){var _0x2d0667=function(_0x3c2585){while(--_0x3c2585){_0x5ae88c['push'](_0x5ae88c['shift']());}};_0x2d0667(++_0x13bbd6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b070666..97729ed 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['destroy','get','Users','user','agent','filter','ignore','map','value','role','name','UserProfileResource','send','index','User','rawAttributes','fieldName','key','model','salt','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','type','sequelize','lower','col','options','includeAll','include','findAll','rows','show','params','differenceBy','keys','find','bulkCreate','body','addContacts','ids','omit','telephone','admin','../../config/license/util','getLicense','telephones','users','isNil','License\x20limit\x20reached','count\x20%s:\x20%s','internal','findById','password','min_internal','max','SELECT','from','voicemail','mailbox','fullname','permissions','101','102','103','110','104','105','106','108','109','100','111','create','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','Telephones','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','Setting','findOne','securePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','VoiceQueue','voice','push','format','SIP/%s','voicePause','each','UserVoiceQueueRt','upsert','Queues','Queue:remove','addAvatar','userpic','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','join','server/files/images/','getContacts','CmContact','order','pick','List','Tag','Tags','color','tag','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','concat','isMiddleware','logout','pause','PAUSE','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','smsPause','pauseType','lastPauseAt','QueuePause','manual','mail','chat','fax','sms','%s%s','all','getTeams','addTeams','Team','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','Sms','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','getDataValue','getChatQueues','transaction','CmList','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','removeChatWebsites','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gt','$lt','$lte','$ne','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$any','firstName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0x1f555a,_0x571ef7){var _0x2c6996=function(_0x57b99c){while(--_0x57b99c){_0x1f555a['push'](_0x1f555a['shift']());}};_0x2c6996(++_0x571ef7);}(_0xb10b,0x12a));var _0xbb10=function(_0x34e481,_0x1f0d05){_0x34e481=_0x34e481-0x0;var _0x195d01=_0xb10b[_0x34e481];return _0x195d01;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./user.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x3df17b,_0x2f2ebf,_0x24a57b){if(_0x24a57b){var _0x36b5e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36b5e8[_0xbb10('0x20')](_0x2f2ebf)){return _0x3df17b;}else{throw new db[(_0xbb10('0x21'))]['ValidationError'](_0xbb10('0x22'));}}else{return _0x3df17b;}}function respondWithRpcPromise(_0x1145f1,_0x133ac2,_0x42db98,_0x378da8){return new BPromise(function(_0x1682a4,_0x575cca){var _0x30efc6=_0x378da8||client;return _0x30efc6[_0xbb10('0x23')](_0x1145f1,_0x42db98)[_0xbb10('0x24')](function(_0x48b6e9){logger[_0xbb10('0x25')](_0xbb10('0x26'),_0x133ac2,_0xbb10('0x27'));logger[_0xbb10('0x28')](_0xbb10('0x29'),_0x133ac2,_0xbb10('0x27'),JSON['stringify'](_0x48b6e9));if(_0x48b6e9[_0xbb10('0x2a')]){if(_0x48b6e9[_0xbb10('0x2a')]['code']===0x1f4){logger['error'](_0xbb10('0x26'),_0x133ac2,_0x48b6e9[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x575cca(_0x48b6e9[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x26'),_0x133ac2,_0x48b6e9[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x1682a4(_0x48b6e9[_0xbb10('0x2a')][_0xbb10('0x2b')]);}else{logger[_0xbb10('0x25')]('User,\x20%s,\x20%s',_0x133ac2,'request\x20sent');_0x1682a4(_0x48b6e9['result'][_0xbb10('0x2b')]);}})[_0xbb10('0x2c')](function(_0x2c89b9){logger['error'](_0xbb10('0x26'),_0x133ac2,_0x2c89b9);_0x575cca(_0x2c89b9);});});}function respondWithStatusCode(_0x24d586,_0x6ed43b){_0x6ed43b=_0x6ed43b||0xcc;return function(_0x1d5e95){if(_0x1d5e95){return _0x24d586[_0xbb10('0x2d')](_0x6ed43b);}return _0x24d586[_0xbb10('0x2e')](_0x6ed43b)[_0xbb10('0x2f')]();};}function respondWithResult(_0x4aabb9,_0x3796c7){_0x3796c7=_0x3796c7||0xc8;return function(_0x21ac54){if(_0x21ac54){return _0x4aabb9[_0xbb10('0x2e')](_0x3796c7)[_0xbb10('0x30')](_0x21ac54);}};}function respondWithFilteredResult(_0x1d30aa,_0x2ff4c1){return function(_0x5d5c80){if(_0x5d5c80){var _0x221624=_0x5d5c80[_0xbb10('0x31')],_0x4ee02e=_0x2ff4c1[_0xbb10('0x32')],_0x448d5c=_0x2ff4c1[_0xbb10('0x32')]+_0x2ff4c1['limit'],_0x56f2da;if(_0x448d5c>=_0x221624){_0x448d5c=_0x221624;_0x56f2da=0xc8;}else{_0x56f2da=0xce;}_0x1d30aa['status'](_0x56f2da);return _0x1d30aa[_0xbb10('0x33')](_0xbb10('0x34'),_0x4ee02e+'-'+_0x448d5c+'/'+_0x221624)['json'](_0x5d5c80);}return null;};}function patchUpdates(_0x359ad4){return function(_0x37dde7){try{jsonpatch[_0xbb10('0x35')](_0x37dde7,_0x359ad4,!![]);}catch(_0x1c0b57){return BPromise[_0xbb10('0x36')](_0x1c0b57);}return _0x37dde7[_0xbb10('0x37')]();};}function saveUpdates(_0xf85197,_0x4975f5){return function(_0x25acb3){if(_0x25acb3){return _0x25acb3[_0xbb10('0x38')](_0xf85197)[_0xbb10('0x24')](function(_0x8c1ce6){return _0x8c1ce6;});}return null;};}function removeEntity(_0xfb2c5e,_0x9de708){return function(_0x188cbd){if(_0x188cbd){return _0x188cbd[_0xbb10('0x39')]()[_0xbb10('0x24')](function(){var _0x56943c=_0x188cbd[_0xbb10('0x3a')]({'plain':!![]});var _0x150107=[{'name':_0xbb10('0x3b'),'value':_0xbb10('0x3c'),'ignore':!![]},{'name':'Agents','value':_0xbb10('0x3d'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x3eb3cc=_(_0x150107)[_0xbb10('0x3e')](_0xbb10('0x3f'))[_0xbb10('0x40')](_0xbb10('0x41'))[_0xbb10('0x41')]();if(_['includes'](_0x3eb3cc,_0x56943c[_0xbb10('0x42')])){return;}var _0x25d72f=_['find'](_0x150107,['value',_0x56943c['role']])[_0xbb10('0x43')];return db[_0xbb10('0x44')][_0xbb10('0x39')]({'where':{'type':_0x25d72f,'resourceId':_0x56943c['id']}})['then'](function(){return _0x188cbd;});})[_0xbb10('0x24')](function(){_0xfb2c5e[_0xbb10('0x2e')](0xcc)[_0xbb10('0x2f')]();});}};}function handleEntityNotFound(_0x4d1a83,_0x17b6c5){return function(_0x12238a){if(!_0x12238a){_0x4d1a83[_0xbb10('0x2d')](0x194);}return _0x12238a;};}function handleError(_0x446f49,_0x4f1cdd){_0x4f1cdd=_0x4f1cdd||0x1f4;return function(_0xd238e9){logger[_0xbb10('0x2a')](_0xd238e9['stack']);if(_0xd238e9[_0xbb10('0x43')]){delete _0xd238e9[_0xbb10('0x43')];}_0x446f49[_0xbb10('0x2e')](_0x4f1cdd)[_0xbb10('0x45')](_0xd238e9);};}exports[_0xbb10('0x46')]=function(_0x185a52,_0x5f3d67){var _0x1e8f79={},_0x1c7fae={},_0x3e7b4c={'count':0x0,'rows':[]};var _0x3d3c41=_['map'](db[_0xbb10('0x47')][_0xbb10('0x48')],function(_0x23dc18){return{'name':_0x23dc18[_0xbb10('0x49')],'type':_0x23dc18['type'][_0xbb10('0x4a')]};});_0x1c7fae[_0xbb10('0x4b')]=_['differenceBy'](_['map'](_0x3d3c41,_0xbb10('0x43')),['password',_0xbb10('0x4c')]);_0x1c7fae[_0xbb10('0x4d')]=_['keys'](_0x185a52[_0xbb10('0x4d')]);_0x1c7fae[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1c7fae['model'],_0x1c7fae[_0xbb10('0x4d')]);_0x1e8f79[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x1c7fae[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x1e8f79[_0xbb10('0x50')]=_0x1e8f79[_0xbb10('0x50')][_0xbb10('0x52')]?_0x1e8f79[_0xbb10('0x50')]:_0x1c7fae[_0xbb10('0x4b')];if(!_0x185a52['query'][_0xbb10('0x53')](_0xbb10('0x54'))){_0x1e8f79['limit']=qs[_0xbb10('0x55')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1e8f79[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x1e8f79['order']=qs['sort'](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1e8f79[_0xbb10('0x57')]=qs['filters'](_['pick'](_0x185a52[_0xbb10('0x4d')],_0x1c7fae[_0xbb10('0x4e')]));if(_0x185a52[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x1e8f79[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x1e8f79[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x3d3c41,function(_0x2626d8){if(_0x2626d8[_0xbb10('0x59')]!=='VIRTUAL'){return db['sequelize'][_0xbb10('0x57')](db[_0xbb10('0x5a')]['fn'](_0xbb10('0x5b'),db[_0xbb10('0x5a')][_0xbb10('0x5c')](_0x2626d8[_0xbb10('0x43')])),{'$like':db[_0xbb10('0x5a')]['fn'](_0xbb10('0x5b'),'%'+_0x185a52[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%')});}})});}_0x1e8f79=_[_0xbb10('0x58')]({},_0x1e8f79,_0x185a52[_0xbb10('0x5d')]);var _0x61e689={'where':_0x1e8f79[_0xbb10('0x57')]};return db[_0xbb10('0x47')]['count'](_0x61e689)[_0xbb10('0x24')](function(_0x5bd44d){_0x3e7b4c[_0xbb10('0x31')]=_0x5bd44d;if(_0x185a52[_0xbb10('0x4d')][_0xbb10('0x5e')]){_0x1e8f79[_0xbb10('0x5f')]=[{'all':!![]}];}return db[_0xbb10('0x47')][_0xbb10('0x60')](_0x1e8f79);})[_0xbb10('0x24')](function(_0x44eec1){_0x3e7b4c[_0xbb10('0x61')]=_0x44eec1;return _0x3e7b4c;})[_0xbb10('0x24')](respondWithFilteredResult(_0x5f3d67,_0x1e8f79))[_0xbb10('0x2c')](handleError(_0x5f3d67,null));};exports[_0xbb10('0x62')]=function(_0x1d49e1,_0x3d7e17){var _0x4475e1={'raw':![],'where':{'id':_0x1d49e1[_0xbb10('0x63')]['id']}},_0x5de0cc={};_0x5de0cc[_0xbb10('0x4b')]=_[_0xbb10('0x64')](_[_0xbb10('0x65')](db[_0xbb10('0x47')][_0xbb10('0x48')]),['password',_0xbb10('0x4c')]);_0x5de0cc[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x1d49e1[_0xbb10('0x4d')]);_0x5de0cc[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x5de0cc[_0xbb10('0x4b')],_0x5de0cc[_0xbb10('0x4d')]);_0x4475e1[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x5de0cc[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x1d49e1[_0xbb10('0x4d')]['fields']));_0x4475e1['attributes']=_0x4475e1[_0xbb10('0x50')][_0xbb10('0x52')]?_0x4475e1[_0xbb10('0x50')]:_0x5de0cc[_0xbb10('0x4b')];if(_0x1d49e1['query']['includeAll']){_0x4475e1[_0xbb10('0x5f')]=[{'all':!![]}];}_0x4475e1=_[_0xbb10('0x58')]({},_0x4475e1,_0x1d49e1[_0xbb10('0x5d')]);return db[_0xbb10('0x47')][_0xbb10('0x66')](_0x4475e1)[_0xbb10('0x24')](handleEntityNotFound(_0x3d7e17,null))[_0xbb10('0x24')](respondWithResult(_0x3d7e17,null))['catch'](handleError(_0x3d7e17,null));};exports[_0xbb10('0x67')]=function(_0x216cff,_0x4917a5){return db['User']['bulkCreate'](_0x216cff[_0xbb10('0x68')],{'raw':![],'individualHooks':!![]})[_0xbb10('0x24')](respondWithResult(_0x4917a5,0xc9))[_0xbb10('0x2c')](handleError(_0x4917a5,null));};exports['update']=function(_0x4e6e7c,_0x5846d1){if(_0x4e6e7c[_0xbb10('0x68')]['id']){delete _0x4e6e7c[_0xbb10('0x68')]['id'];}delete _0x4e6e7c[_0xbb10('0x68')]['role'];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x4e6e7c['params']['id']}})['then'](handleEntityNotFound(_0x5846d1,null))[_0xbb10('0x24')](saveUpdates(_0x4e6e7c[_0xbb10('0x68')],null))[_0xbb10('0x24')](respondWithResult(_0x5846d1,null))[_0xbb10('0x2c')](handleError(_0x5846d1,null));};exports['describe']=function(_0x43eaec,_0xec48ac){return db[_0xbb10('0x47')]['describe']()[_0xbb10('0x24')](respondWithResult(_0xec48ac,null))[_0xbb10('0x2c')](handleError(_0xec48ac,null));};exports[_0xbb10('0x69')]=function(_0x5b2bd4,_0x2ca491,_0x31e85e){return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x5b2bd4['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x2ca491,null))[_0xbb10('0x24')](function(_0x108e5b){if(_0x108e5b){return _0x108e5b[_0xbb10('0x69')](_0x5b2bd4['body'][_0xbb10('0x6a')],_[_0xbb10('0x6b')](_0x5b2bd4[_0xbb10('0x68')],[_0xbb10('0x6a'),'id'])||{});}})[_0xbb10('0x24')](respondWithResult(_0x2ca491,null))[_0xbb10('0x2c')](handleError(_0x2ca491,null));};var getLicense=function(_0x1e4694){return new BPromise(function(_0x4a30c5,_0x4a13d7){var _0x5acd5e=0x0;_0x1e4694[_0xbb10('0x68')][_0xbb10('0x42')]===_0xbb10('0x3d')&&_0x4a30c5('agent\x20role');return db['User'][_0xbb10('0x31')]({'where':{'$or':[{'role':_0x1e4694[_0xbb10('0x68')][_0xbb10('0x42')]===_0xbb10('0x6c')?_0xbb10('0x6c'):[_0xbb10('0x6d'),'user']}]}})[_0xbb10('0x24')](function(_0x15fae2){_0x5acd5e=_0x15fae2;return require(_0xbb10('0x6e'))[_0xbb10('0x6f')]();})[_0xbb10('0x24')](function(_0x5bfc68){var _0x56094a=_0x1e4694['body'][_0xbb10('0x42')]===_0xbb10('0x6c')?_0xbb10('0x70'):_0xbb10('0x71');if(!_[_0xbb10('0x72')](_0x5bfc68[_0x56094a])&&_0x5acd5e>=_0x5bfc68[_0x56094a]){return _0x4a13d7({'message':_0xbb10('0x73')});}return _0x4a30c5(util['format'](_0xbb10('0x74'),_0x56094a,_0x5acd5e));})['catch'](function(_0x4fe3b5){return _0x4a13d7(_0x4fe3b5);});});};exports['create']=function(_0xdf634f,_0x13040d){return getLicense(_0xdf634f)[_0xbb10('0x24')](function(_0x108f99){if(!_0xdf634f['body'][_0xbb10('0x75')]){var _0x5c583b;return db['Setting'][_0xbb10('0x76')](0x1)[_0xbb10('0x24')](function(_0x29529c){return checkPasswordPattern(_0x29529c,_0xdf634f[_0xbb10('0x68')][_0xbb10('0x77')],_0x29529c['securePassword']);})[_0xbb10('0x24')](function(_0x19fcec){_0x5c583b=_0x19fcec[_0xbb10('0x78')];return db[_0xbb10('0x47')][_0xbb10('0x79')](_0xbb10('0x75'));})[_0xbb10('0x24')](function(_0x53fa98){if(_[_0xbb10('0x72')](_0x53fa98)){if(_0x5c583b){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x5c583b;}else{_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=0x1;}}else{if(_[_0xbb10('0x72')](_0x5c583b)||_0x5c583b==_0x53fa98){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x53fa98+0x1;}else if(_0x5c583b>_0x53fa98){_0xdf634f['body'][_0xbb10('0x75')]=_0x5c583b;}else{return db[_0xbb10('0x5a')][_0xbb10('0x4d')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize']['QueryTypes'][_0xbb10('0x7a')]})['then'](function(_0x4e3d6a){if(_0x4e3d6a&&_0x4e3d6a[_0xbb10('0x52')]){for(var _0x3ee56b=0x0,_0x33ff06=_0x4e3d6a[_0xbb10('0x52')];_0x3ee56b<_0x33ff06&&_[_0xbb10('0x72')](_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]);_0x3ee56b++){if(_0x5c583b<=_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')]){_0xdf634f[_0xbb10('0x68')]['internal']=_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')];}else if(_0x5c583b>_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')]&&_0x5c583b<=_0x4e3d6a[_0x3ee56b]['to']){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x5c583b;}}}if(_['isNil'](_0xdf634f['body'][_0xbb10('0x75')])){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x53fa98+0x1;}});}}});}})[_0xbb10('0x24')](function(){if(_0xdf634f['body'][_0xbb10('0x7c')]){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7d')]=_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')];_0xdf634f['body']['VoiceMail']={'mailbox':_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')],'password':_0xdf634f[_0xbb10('0x68')]['password'],'fullname':_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7e')],'email':_0xdf634f['body']['email']};}if(_0xdf634f[_0xbb10('0x68')]&&_0xdf634f[_0xbb10('0x68')][_0xbb10('0x42')]==='agent'){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7f')]=[_0xbb10('0x80'),_0xbb10('0x81'),_0xbb10('0x82'),_0xbb10('0x83'),_0xbb10('0x84'),_0xbb10('0x85'),_0xbb10('0x86'),'107',_0xbb10('0x87'),_0xbb10('0x88'),_0xbb10('0x89'),_0xbb10('0x8a')];}return db[_0xbb10('0x47')][_0xbb10('0x8b')](_0xdf634f[_0xbb10('0x68')],{'include':[{'model':db[_0xbb10('0x8c')],'as':_0xbb10('0x8c')}]});})[_0xbb10('0x24')](function(_0x15e043){if(_0xdf634f[_0xbb10('0x68')]['role']==='user')return _0x15e043;var _0xe1fc51=_0xdf634f[_0xbb10('0x3c')][_0xbb10('0x3a')]({'plain':!![]});if(!_0xe1fc51)throw new Error(_0xbb10('0x8d'));if(_0xe1fc51[_0xbb10('0x42')]==='user'){var _0x2749a7=_0x15e043[_0xbb10('0x3a')]({'plain':!![]});var _0x3b4d0b=[{'name':_0xbb10('0x8e'),'value':_0xbb10('0x3d')},{'name':_0xbb10('0x8f'),'value':'telephone'}];var _0xb25e71=_[_0xbb10('0x66')](_0x3b4d0b,['value',_0x2749a7[_0xbb10('0x42')]])['name'];return db[_0xbb10('0x90')][_0xbb10('0x66')]({'where':{'name':_0xb25e71,'userProfileId':_0xe1fc51[_0xbb10('0x91')]},'raw':!![]})[_0xbb10('0x24')](function(_0x3a4a6e){if(_0x3a4a6e&&_0x3a4a6e['autoAssociation']===0x0){return db[_0xbb10('0x44')]['create']({'name':_0x2749a7[_0xbb10('0x43')],'resourceId':_0x2749a7['id'],'type':_0x3a4a6e[_0xbb10('0x43')],'sectionId':_0x3a4a6e['id']},{})['then'](function(){return _0x15e043;});}else{return _0x15e043;}})['catch'](function(_0x415407){logger[_0xbb10('0x2a')](_0xbb10('0x92'),_0x415407);throw _0x415407;});}return _0x15e043;})[_0xbb10('0x24')](respondWithResult(_0x13040d,0xc9))[_0xbb10('0x2c')](handleError(_0x13040d,null));};exports[_0xbb10('0x93')]=function(_0x1b6ebc,_0x25b4ef,_0x252ab8){var _0xbccd46=![];if(_0x1b6ebc[_0xbb10('0x68')]['id']){delete _0x1b6ebc['body']['id'];}return db[_0xbb10('0x94')][_0xbb10('0x95')]({'attributes':['id',_0xbb10('0x96')]})[_0xbb10('0x24')](function(_0xfe02f5){_0xbccd46=_0xfe02f5[_0xbb10('0x96')];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x1b6ebc[_0xbb10('0x63')]['id']}});})[_0xbb10('0x24')](function(_0x1c4235){if(_0x1c4235){if(_0x1c4235['id']==_0x1b6ebc[_0xbb10('0x3c')]['id']){if(!_0x1b6ebc['body'][_0xbb10('0x97')]||!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9a'));}if(!_0x1c4235[_0xbb10('0x9b')](_0x1b6ebc['body'][_0xbb10('0x97')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9c'));}if(_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x97')]==_0x1b6ebc['body']['newPassword']){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9d'));}return _0x1c4235;}else if(_0x1b6ebc['user'][_0xbb10('0x42')]==_0xbb10('0x6d')){if(!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))]['ValidationError'](_0xbb10('0x9e'));}return _0x1c4235;}else if(_0x1b6ebc['user'][_0xbb10('0x42')]==_0xbb10('0x3c')){if(!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1c4235[_0xbb10('0x42')]!=_0xbb10('0x3d')){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9f'));}return _0x1c4235;}else{throw new db['Sequelize'][(_0xbb10('0x99'))](_0xbb10('0x9f'));}}return null;})[_0xbb10('0x24')](handleEntityNotFound(_0x25b4ef,null))['then'](function(_0xd68afa){return checkPasswordPattern(_0xd68afa,_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x98')],_0xbccd46);})[_0xbb10('0x24')](saveUpdates({'password':_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x98')],'passwordResetAt':_0x1b6ebc[_0xbb10('0x3c')]['id']==_0x1b6ebc[_0xbb10('0x63')]['id']?moment():null},null))[_0xbb10('0x24')](respondWithResult(_0x25b4ef,null))['catch'](handleError(_0x25b4ef,null));};exports['addQueues']=function(_0x37e40c,_0xe7238b,_0x293f3f){var _0x44f097=_0x37e40c[_0xbb10('0x68')][_0xbb10('0xa0')];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x37e40c[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42'),_0xbb10('0xa1'),_0xbb10('0xa2'),'voicePause',_0xbb10('0xa3')]})[_0xbb10('0x24')](handleEntityNotFound(_0xe7238b,null))[_0xbb10('0x24')](function(_0x1222eb){if(_0x1222eb){if(!utils[_0xbb10('0xa4')](_0x44f097)){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}return _0x1222eb[_0xbb10('0xa6')+_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+'Queues'](_0x37e40c[_0xbb10('0x68')]['ids'],{'penalty':_0x37e40c[_0xbb10('0x68')][_0xbb10('0xa9')]||0x0})[_0xbb10('0xaa')](function(_0x112261){for(var _0x2b6e27=0x0;_0x2b6e27<_0x37e40c[_0xbb10('0x68')]['ids'][_0xbb10('0x52')];_0x2b6e27+=0x1){var _0x5c484c={'UserId':_0x37e40c[_0xbb10('0x63')]['id']};_0x5c484c[_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+_0xbb10('0xab')]=_0x37e40c[_0xbb10('0x68')][_0xbb10('0x6a')][_0x2b6e27];socket[_0xbb10('0xac')](_0xbb10('0x3c')+_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+_0xbb10('0xad'),_0x5c484c);}return _0x112261;})[_0xbb10('0x24')](function(){if(_0x44f097==='voice'){return db[_0xbb10('0xae')]['findAll']({'where':{'id':_0x37e40c[_0xbb10('0x68')][_0xbb10('0x6a')]||[]},'raw':!![],'attributes':['id',_0xbb10('0x43')]});}})[_0xbb10('0x24')](function(_0x44c229){var _0x40271f=_0x1222eb[_0xbb10('0x3a')]({'plain':!![]});var _0x5e9888=[];if(_0x44f097===_0xbb10('0xaf')&&_0x40271f['role']==='agent'&&_0x40271f[_0xbb10('0xa1')]){for(var _0x35cbb9=0x0;_0x35cbb9<_0x44c229[_0xbb10('0x52')];_0x35cbb9+=0x1){_0x5e9888[_0xbb10('0xb0')]({'membername':_0x40271f[_0xbb10('0x43')],'UserId':_0x40271f['id'],'queue_name':_0x44c229[_0x35cbb9][_0xbb10('0x43')],'VoiceQueueId':_0x44c229[_0x35cbb9]['id'],'interface':_['isNil'](_0x40271f[_0xbb10('0xa3')])?util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x40271f[_0xbb10('0x43')]):_0x40271f[_0xbb10('0xa3')],'paused':_0x40271f[_0xbb10('0xb3')]||![],'penalty':_0x37e40c['body'][_0xbb10('0xa9')]||0x0});}return BPromise[_0xbb10('0xb4')](_0x5e9888,function(_0xb7c454){return db[_0xbb10('0xb5')][_0xbb10('0xb6')](_0xb7c454);});}return _0x1222eb;});}})[_0xbb10('0x24')](respondWithStatusCode(_0xe7238b,null))[_0xbb10('0x2c')](handleError(_0xe7238b,null));};exports['removeQueues']=function(_0x33a43e,_0x5e4ae9,_0x3afbcf){var _0x4a6660;return db['User'][_0xbb10('0x66')]({'where':{'id':_0x33a43e[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42')]})[_0xbb10('0x24')](handleEntityNotFound(_0x5e4ae9,null))['then'](function(_0xa42b80){if(_0xa42b80){_0x4a6660=_0xa42b80;if(!_0x33a43e['query']['channel']||!utils['isValidChannel'](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}return _0xa42b80['remove'+_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')][_0xbb10('0xa8')]())+_0xbb10('0xb7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0x6a')]);}})['then'](function(_0x4c95c2){for(var _0x584a62=0x0;_0x584a62<_0x33a43e[_0xbb10('0x4d')][_0xbb10('0x6a')][_0xbb10('0x52')];_0x584a62+=0x1){var _0x3125c3={'UserId':_0x33a43e[_0xbb10('0x63')]['id']};_0x3125c3[_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')][_0xbb10('0xa8')]())+_0xbb10('0xab')]=_0x33a43e['query']['ids'][_0x584a62];socket['emit'](_0xbb10('0x3c')+_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')]['channel'][_0xbb10('0xa8')]())+_0xbb10('0xb8'),_0x3125c3);}return _0x4c95c2;})[_0xbb10('0x24')](function(){if(_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')]===_0xbb10('0xaf')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x33a43e[_0xbb10('0x63')]['id'],'VoiceQueueId':_0x33a43e['query'][_0xbb10('0x6a')]},'individualHooks':!![]})[_0xbb10('0x24')](function(){return _0x4a6660;});}return _0x4a6660;})[_0xbb10('0x24')](respondWithStatusCode(_0x5e4ae9,null))[_0xbb10('0x2c')](handleError(_0x5e4ae9,null));};exports[_0xbb10('0xb9')]=function(_0x2dfa04,_0x13a29e,_0x1388f6){_0x2dfa04[_0xbb10('0x68')][_0xbb10('0xba')]=_0x2dfa04['file'][_0xbb10('0xbb')];return db['User'][_0xbb10('0x66')]({'where':{'id':_0x2dfa04['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x13a29e,null))[_0xbb10('0x24')](saveUpdates(_0x2dfa04[_0xbb10('0x68')],null))[_0xbb10('0x24')](respondWithResult(_0x13a29e,null))['catch'](handleError(_0x13a29e,null));};exports[_0xbb10('0xbc')]=function(_0x4960b1,_0xfe1154,_0x1b6b9f){var _0xcdaf04=path['join'](config[_0xbb10('0xbd')],_0xbb10('0xbe'));return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x4960b1[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0xba')],'raw':!![]})['then'](handleEntityNotFound(_0xfe1154,null))['then'](function(_0x522a88){if(_0x522a88){if(_[_0xbb10('0x72')](_0x522a88['userpic'])){return _0xfe1154[_0xbb10('0xbf')](_0xcdaf04);}else{if(!fs['existsSync'](path[_0xbb10('0xc0')](config[_0xbb10('0xbd')],_0xbb10('0xc1'),_0x522a88['userpic']))){return _0xfe1154['download'](_0xcdaf04);}return _0xfe1154[_0xbb10('0xbf')](path[_0xbb10('0xc0')](config[_0xbb10('0xbd')],'server/files/images/',_0x522a88[_0xbb10('0xba')]));}}})[_0xbb10('0x2c')](handleError(_0xfe1154,null));};exports[_0xbb10('0xc2')]=function(_0x4848b9,_0x47d144,_0x5a685d){var _0x2980b7={};var _0x55aa03={};var _0x3dfbcd;var _0x1c2c95;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x4848b9[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x47d144,null))[_0xbb10('0x24')](function(_0x20a2c4){if(_0x20a2c4){_0x3dfbcd=_0x20a2c4;_0x55aa03[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xc3')]['rawAttributes']);_0x55aa03[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x4848b9['query']);_0x55aa03[_0xbb10('0x4e')]=_['intersection'](_0x55aa03['model'],_0x55aa03[_0xbb10('0x4d')]);_0x2980b7[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x55aa03[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x4848b9['query'][_0xbb10('0x51')]));_0x2980b7[_0xbb10('0x50')]=_0x2980b7['attributes'][_0xbb10('0x52')]?_0x2980b7[_0xbb10('0x50')]:_0x55aa03['model'];_0x2980b7[_0xbb10('0xc4')]=qs['sort'](_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x2980b7[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x4848b9[_0xbb10('0x4d')],_0x55aa03[_0xbb10('0x4e')]));if(_0x4848b9['query'][_0xbb10('0x3e')]){_0x2980b7[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x2980b7[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x2980b7[_0xbb10('0x50')],function(_0x518990){var _0x550301={};_0x550301[_0x518990]={'$like':'%'+_0x4848b9['query'][_0xbb10('0x3e')]+'%'};return _0x550301;})});}_0x2980b7=_[_0xbb10('0x58')]({},_0x2980b7,_0x4848b9[_0xbb10('0x5d')]);return _0x3dfbcd[_0xbb10('0xc2')](_0x2980b7);}})['then'](function(_0x3b01a3){if(_0x3b01a3){_0x1c2c95=_0x3b01a3[_0xbb10('0x52')];if(_0x4848b9[_0xbb10('0x4d')]['hasOwnProperty']('includeAll')){_0x2980b7[_0xbb10('0x5f')]=[{'model':db['CmList'],'as':_0xbb10('0xc6'),'required':![]},{'model':db[_0xbb10('0xc7')],'as':_0xbb10('0xc8'),'attributes':['id',_0xbb10('0x43'),_0xbb10('0xc9')],'where':_0x4848b9[_0xbb10('0x4d')][_0xbb10('0xca')]?{'id':_0x4848b9['query'][_0xbb10('0xca')]}:undefined,'required':_0x4848b9[_0xbb10('0x4d')]['tag']?!![]:![]}];}if(!_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x2980b7['limit']=qs['limit'](_0x4848b9['query'][_0xbb10('0x55')]);_0x2980b7[_0xbb10('0x32')]=qs['offset'](_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x3dfbcd[_0xbb10('0xc2')](_0x2980b7);}})[_0xbb10('0x24')](function(_0x3d6b3b){if(_0x3d6b3b){return _0x3d6b3b?{'count':_0x1c2c95,'rows':_0x3d6b3b}:null;}})[_0xbb10('0x24')](respondWithResult(_0x47d144,null))[_0xbb10('0x2c')](handleError(_0x47d144,null));};exports['getQueues']=function(_0x304603,_0x4fe7e4,_0x5a7c4e){var _0x4aa0d7;var _0x142b84;var _0x572d73={};var _0x5bd1f0;return db[_0xbb10('0x47')]['findOne']({'where':{'id':_0x304603[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42')]})['then'](handleEntityNotFound(_0x4fe7e4,null))['then'](function(_0x447c0d){if(!utils['isValidChannel'](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])){throw new db['Sequelize']['ValidationError'](_0xbb10('0xa5'));}_0x4aa0d7=_0x447c0d;var _0x385bab={};_0x385bab[_0xbb10('0x4b')]=_['keys'](db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+'Queue'][_0xbb10('0x48')]);_0x385bab[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x304603[_0xbb10('0x4d')]);_0x385bab[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x385bab[_0xbb10('0x4b')],_0x385bab[_0xbb10('0x4d')]);_0x572d73[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x385bab[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x304603[_0xbb10('0x4d')]['fields']));_0x572d73['attributes']=_0x572d73[_0xbb10('0x50')]['length']?_0x572d73[_0xbb10('0x50')]:_0x385bab[_0xbb10('0x4b')];_0x572d73[_0xbb10('0xc4')]=qs['sort'](_0x304603[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x572d73[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x304603['query'],_0x385bab[_0xbb10('0x4e')]));if(_0x304603[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x572d73[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x572d73[_0xbb10('0x57')],{'$or':_['map'](_0x572d73[_0xbb10('0x50')],function(_0x2f0262){var _0x5d013c={};_0x5d013c[_0x2f0262]={'$like':'%'+_0x304603[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x5d013c;})});}_0x572d73=_[_0xbb10('0x58')]({},_0x572d73,_0x304603[_0xbb10('0x5d')]);switch(_0x4aa0d7[_0xbb10('0x42')]){case _0xbb10('0x6d'):return db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+_0xbb10('0xcb')][_0xbb10('0x60')](_0x572d73);case _0xbb10('0x3c'):case _0xbb10('0x3d'):return _0x4aa0d7[_0xbb10('0x3a')+_[_0xbb10('0xa7')](_0x304603['query'][_0xbb10('0xa0')])+_0xbb10('0xb7')](_0x572d73);default:throw new db['Sequelize']['ValidationError'](_0xbb10('0xcc'));}})[_0xbb10('0x24')](function(_0x24810b){_0x5bd1f0=_0x24810b[_0xbb10('0x52')];if(!_0x304603[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x572d73[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x304603['query']['limit']);_0x572d73['offset']=qs['offset'](_0x304603['query']['offset']);}switch(_0x4aa0d7[_0xbb10('0x42')]){case _0xbb10('0x6d'):return db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')]['channel'])+_0xbb10('0xcb')][_0xbb10('0x60')](_0x572d73);case _0xbb10('0x3c'):case _0xbb10('0x3d'):return _0x4aa0d7['get'+_['capitalize'](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+'Queues'](_0x572d73);}})['then'](function(_0x154a91){return{'count':_0x5bd1f0,'rows':_0x154a91};})[_0xbb10('0x24')](respondWithResult(_0x4fe7e4,null))[_0xbb10('0x2c')](handleError(_0x4fe7e4,null));};exports[_0xbb10('0xcd')]=function(_0x18cda3,_0x564dc6,_0x4744f4){var _0x5382e9={};var _0x4c97b9={};var _0x9d96e2;var _0x27f277;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x18cda3[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x564dc6,null))['then'](function(_0x9c1581){if(_0x9c1581){_0x9d96e2=_0x9c1581;_0x4c97b9[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xb5')][_0xbb10('0x48')]);_0x4c97b9[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x18cda3[_0xbb10('0x4d')]);_0x4c97b9[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x4c97b9[_0xbb10('0x4b')],_0x4c97b9[_0xbb10('0x4d')]);_0x5382e9[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x4c97b9[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x5382e9[_0xbb10('0x50')]=_0x5382e9[_0xbb10('0x50')][_0xbb10('0x52')]?_0x5382e9[_0xbb10('0x50')]:_0x4c97b9['model'];_0x5382e9[_0xbb10('0xc4')]=qs['sort'](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x5382e9[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x18cda3['query'],_0x4c97b9['filters']));if(_0x18cda3['query'][_0xbb10('0x3e')]){_0x5382e9[_0xbb10('0x57')]=_['merge'](_0x5382e9[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x5382e9[_0xbb10('0x50')],function(_0x4c7c62){var _0xae8e0a={};_0xae8e0a[_0x4c7c62]={'$like':'%'+_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0xae8e0a;})});}_0x5382e9=_['merge']({},_0x5382e9,_0x18cda3[_0xbb10('0x5d')]);return _0x9d96e2['getVoiceQueuesRt'](_0x5382e9);}})[_0xbb10('0x24')](function(_0x50fe23){if(_0x50fe23){_0x27f277=_0x50fe23['length'];if(!_0x18cda3['query']['hasOwnProperty']('nolimit')){_0x5382e9['limit']=qs[_0xbb10('0x55')](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x5382e9[_0xbb10('0x32')]=qs['offset'](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x9d96e2[_0xbb10('0xcd')](_0x5382e9);}})[_0xbb10('0x24')](function(_0x466e6e){if(_0x466e6e){return _0x466e6e?{'count':_0x27f277,'rows':_0x466e6e}:null;}})[_0xbb10('0x24')](respondWithResult(_0x564dc6,null))[_0xbb10('0x2c')](handleError(_0x564dc6,null));};exports[_0xbb10('0xce')]=function(_0x419085,_0x9e7ed6,_0x4c9378){var _0x1e4ed3={};var _0x1ffc94={};var _0x288ccc;var _0x5c5ecc;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x419085[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x9e7ed6,null))['then'](function(_0x370460){if(_0x370460){_0x288ccc=_0x370460;_0x1ffc94[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xcf')][_0xbb10('0x48')]);_0x1ffc94[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x419085[_0xbb10('0x4d')]);_0x1ffc94[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1ffc94[_0xbb10('0x4b')],_0x1ffc94['query']);_0x1e4ed3[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x1ffc94['model'],qs['fields'](_0x419085[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x1e4ed3['attributes']=_0x1e4ed3[_0xbb10('0x50')][_0xbb10('0x52')]?_0x1e4ed3['attributes']:_0x1ffc94[_0xbb10('0x4b')];_0x1e4ed3[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x419085[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1e4ed3['where']=qs['filters'](_['pick'](_0x419085[_0xbb10('0x4d')],_0x1ffc94['filters']));if(_0x419085[_0xbb10('0x4d')]['filter']){_0x1e4ed3['where']=_[_0xbb10('0x58')](_0x1e4ed3[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x1e4ed3[_0xbb10('0x50')],function(_0x2527f4){var _0x189054={};_0x189054[_0x2527f4]={'$like':'%'+_0x419085['query']['filter']+'%'};return _0x189054;})});}_0x1e4ed3=_['merge']({},_0x1e4ed3,_0x419085[_0xbb10('0x5d')]);return _0x288ccc[_0xbb10('0xce')](_0x1e4ed3);}})[_0xbb10('0x24')](function(_0x2991a9){if(_0x2991a9){_0x5c5ecc=_0x2991a9[_0xbb10('0x52')];if(!_0x419085[_0xbb10('0x4d')][_0xbb10('0x53')]('nolimit')){_0x1e4ed3[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x419085[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1e4ed3['offset']=qs[_0xbb10('0x32')](_0x419085['query']['offset']);}return _0x288ccc[_0xbb10('0xce')](_0x1e4ed3);}})[_0xbb10('0x24')](function(_0x449e7e){if(_0x449e7e){return _0x449e7e?{'count':_0x5c5ecc,'rows':_0x449e7e}:null;}})[_0xbb10('0x24')](respondWithResult(_0x9e7ed6,null))[_0xbb10('0x2c')](handleError(_0x9e7ed6,null));};exports[_0xbb10('0xd0')]=function(_0x4b7bf8,_0x39fdd3,_0x1bba7c){var _0x374dd9={'raw':!![],'where':{}};var _0x276a5c={};var _0x3ccc6c={'count':0x0,'rows':[]};return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x4b7bf8['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x39fdd3,null))[_0xbb10('0x24')](function(_0x391bce){if(_0x391bce){_0x276a5c['model']=_['keys'](db[_0xbb10('0xd1')][_0xbb10('0x48')]);_0x276a5c[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x4b7bf8[_0xbb10('0x4d')]);_0x276a5c[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x276a5c['model'],_0x276a5c[_0xbb10('0x4d')]);_0x374dd9[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x276a5c['model'],qs['fields'](_0x4b7bf8['query']['fields']));_0x374dd9[_0xbb10('0x50')]=_0x374dd9[_0xbb10('0x50')][_0xbb10('0x52')]?_0x374dd9[_0xbb10('0x50')]:_0x276a5c['model'];if(!_0x4b7bf8[_0xbb10('0x4d')]['hasOwnProperty'](_0xbb10('0x54'))){_0x374dd9[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x374dd9[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x374dd9[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x4b7bf8[_0xbb10('0x4d')]['sort']);_0x374dd9[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x4b7bf8['query'],_0x276a5c[_0xbb10('0x4e')]));_0x374dd9['where'][_0xbb10('0xd2')]=_0x391bce['id'];if(_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x374dd9[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x374dd9['where'],{'$or':_['map'](_0x374dd9[_0xbb10('0x50')],function(_0x4cf5cc){var _0x553bb8={};_0x553bb8[_0x4cf5cc]={'$like':'%'+_0x4b7bf8[_0xbb10('0x4d')]['filter']+'%'};return _0x553bb8;})});}_0x374dd9=_[_0xbb10('0x58')]({},_0x374dd9,_0x4b7bf8[_0xbb10('0x5d')]);return db[_0xbb10('0xd1')][_0xbb10('0x31')]({'where':_0x374dd9[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x3a0940){_0x3ccc6c[_0xbb10('0x31')]=_0x3a0940;if(_0x4b7bf8['query'][_0xbb10('0x5e')]){_0x374dd9['include']=[{'all':!![]}];}return db[_0xbb10('0xd1')]['findAll'](_0x374dd9);})[_0xbb10('0x24')](function(_0x10cc4c){_0x3ccc6c['rows']=_0x10cc4c;return _0x3ccc6c;});}})[_0xbb10('0x24')](respondWithFilteredResult(_0x39fdd3,_0x374dd9))[_0xbb10('0x2c')](handleError(_0x39fdd3,null));};exports[_0xbb10('0xd3')]=function(_0x5ef974,_0x17b086,_0x1a8503){var _0x327b64={'raw':!![],'where':{}};var _0x4df6c0={};var _0x100e82={'count':0x0,'rows':[]};return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x5ef974['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x17b086,null))['then'](function(_0x399ec4){if(_0x399ec4){_0x4df6c0[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd4')][_0xbb10('0x48')]);_0x4df6c0[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x5ef974[_0xbb10('0x4d')]);_0x4df6c0[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x4df6c0['model'],_0x4df6c0['query']);_0x327b64[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x4df6c0[_0xbb10('0x4b')],qs['fields'](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x327b64[_0xbb10('0x50')]=_0x327b64[_0xbb10('0x50')][_0xbb10('0x52')]?_0x327b64[_0xbb10('0x50')]:_0x4df6c0[_0xbb10('0x4b')];if(!_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x53')]('nolimit')){_0x327b64[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x327b64['offset']=qs[_0xbb10('0x32')](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x327b64['order']=qs['sort'](_0x5ef974[_0xbb10('0x4d')]['sort']);_0x327b64[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x5ef974[_0xbb10('0x4d')],_0x4df6c0[_0xbb10('0x4e')]));_0x327b64[_0xbb10('0x57')][_0xbb10('0xd2')]=_0x399ec4['id'];if(_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x327b64['where']=_[_0xbb10('0x58')](_0x327b64[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x327b64[_0xbb10('0x50')],function(_0x2f0a58){var _0xfe1846={};_0xfe1846[_0x2f0a58]={'$like':'%'+_0x5ef974['query'][_0xbb10('0x3e')]+'%'};return _0xfe1846;})});}_0x327b64=_[_0xbb10('0x58')]({},_0x327b64,_0x5ef974[_0xbb10('0x5d')]);return db[_0xbb10('0xd4')][_0xbb10('0x31')]({'where':_0x327b64[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x4f3f44){_0x100e82[_0xbb10('0x31')]=_0x4f3f44;if(_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x5e')]){_0x327b64['include']=[{'all':!![]}];}return db[_0xbb10('0xd4')]['findAll'](_0x327b64);})[_0xbb10('0x24')](function(_0x33fb06){_0x100e82[_0xbb10('0x61')]=_0x33fb06;return _0x100e82;});}})['then'](respondWithFilteredResult(_0x17b086,_0x327b64))['catch'](handleError(_0x17b086,null));};exports[_0xbb10('0xd5')]=function(_0x3ba356,_0xbb410e,_0x27ea82){var _0x8ef7c1={};var _0x34dddb={};var _0x4602f4;var _0x440af2;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x3ba356[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0xbb410e,null))['then'](function(_0x3fd42f){if(_0x3fd42f){_0x4602f4=_0x3fd42f;_0x34dddb[_0xbb10('0x4b')]=_['keys'](db['ChatInteraction'][_0xbb10('0x48')]);_0x34dddb[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x3ba356['query']);_0x34dddb[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x34dddb['model'],_0x34dddb[_0xbb10('0x4d')]);_0x8ef7c1[_0xbb10('0x50')]=_['intersection'](_0x34dddb['model'],qs[_0xbb10('0x51')](_0x3ba356[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x8ef7c1['attributes']=_0x8ef7c1['attributes'][_0xbb10('0x52')]?_0x8ef7c1[_0xbb10('0x50')]:_0x34dddb['model'];_0x8ef7c1[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x3ba356['query'][_0xbb10('0x56')]);_0x8ef7c1[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x3ba356['query'],_0x34dddb[_0xbb10('0x4e')]));if(_0x3ba356['query'][_0xbb10('0x3e')]){_0x8ef7c1[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x8ef7c1[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x8ef7c1[_0xbb10('0x50')],function(_0x3fcdc3){var _0x4533e2={};_0x4533e2[_0x3fcdc3]={'$like':'%'+_0x3ba356['query'][_0xbb10('0x3e')]+'%'};return _0x4533e2;})});}_0x8ef7c1=_[_0xbb10('0x58')]({},_0x8ef7c1,_0x3ba356[_0xbb10('0x5d')]);return _0x4602f4[_0xbb10('0xd5')](_0x8ef7c1);}})['then'](function(_0x4bdabe){if(_0x4bdabe){_0x440af2=_0x4bdabe[_0xbb10('0x52')];if(!_0x3ba356[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x8ef7c1['limit']=qs[_0xbb10('0x55')](_0x3ba356[_0xbb10('0x4d')]['limit']);_0x8ef7c1[_0xbb10('0x32')]=qs['offset'](_0x3ba356['query'][_0xbb10('0x32')]);}return _0x4602f4[_0xbb10('0xd5')](_0x8ef7c1);}})[_0xbb10('0x24')](function(_0x193d45){if(_0x193d45){return _0x193d45?{'count':_0x440af2,'rows':_0x193d45}:null;}})[_0xbb10('0x24')](respondWithResult(_0xbb410e,null))['catch'](handleError(_0xbb410e,null));};exports[_0xbb10('0xd6')]=function(_0x262078,_0x356601,_0x24acce){var _0x1b7274={};var _0x344089={};var _0xb90ba5;var _0x1f80ce;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x262078[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x356601,null))[_0xbb10('0x24')](function(_0x9fcc26){if(_0x9fcc26){_0xb90ba5=_0x9fcc26;_0x344089[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd7')][_0xbb10('0x48')]);_0x344089[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x262078[_0xbb10('0x4d')]);_0x344089[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x344089[_0xbb10('0x4b')],_0x344089[_0xbb10('0x4d')]);_0x1b7274[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x344089['model'],qs[_0xbb10('0x51')](_0x262078[_0xbb10('0x4d')]['fields']));_0x1b7274[_0xbb10('0x50')]=_0x1b7274[_0xbb10('0x50')]['length']?_0x1b7274[_0xbb10('0x50')]:_0x344089[_0xbb10('0x4b')];_0x1b7274['order']=qs[_0xbb10('0x56')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1b7274[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x262078[_0xbb10('0x4d')],_0x344089[_0xbb10('0x4e')]));if(_0x262078[_0xbb10('0x4d')]['filter']){_0x1b7274[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x1b7274[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x1b7274[_0xbb10('0x50')],function(_0x3045ff){var _0x2f626b={};_0x2f626b[_0x3045ff]={'$like':'%'+_0x262078[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x2f626b;})});}_0x1b7274=_[_0xbb10('0x58')]({},_0x1b7274,_0x262078[_0xbb10('0x5d')]);return _0xb90ba5['getOpenchannelInteractions'](_0x1b7274);}})[_0xbb10('0x24')](function(_0x2c19cb){if(_0x2c19cb){_0x1f80ce=_0x2c19cb[_0xbb10('0x52')];if(!_0x262078[_0xbb10('0x4d')]['hasOwnProperty']('nolimit')){_0x1b7274[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1b7274['offset']=qs[_0xbb10('0x32')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0xb90ba5['getOpenchannelInteractions'](_0x1b7274);}})['then'](function(_0x4206bf){if(_0x4206bf){return _0x4206bf?{'count':_0x1f80ce,'rows':_0x4206bf}:null;}})[_0xbb10('0x24')](respondWithResult(_0x356601,null))['catch'](handleError(_0x356601,null));};exports['getMailInteractions']=function(_0x424bb1,_0x615606,_0xbda10){var _0x45cd03={'raw':!![],'where':{}};var _0xc6af40={};var _0x338080={'count':0x0,'rows':[]};return db['User'][_0xbb10('0x95')]({'where':{'id':_0x424bb1[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x615606,null))[_0xbb10('0x24')](function(_0xb4d322){if(_0xb4d322){_0xc6af40[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd8')][_0xbb10('0x48')]);_0xc6af40[_0xbb10('0x4d')]=_['keys'](_0x424bb1[_0xbb10('0x4d')]);_0xc6af40[_0xbb10('0x4e')]=_['intersection'](_0xc6af40['model'],_0xc6af40['query']);_0x45cd03['attributes']=_['intersection'](_0xc6af40['model'],qs['fields'](_0x424bb1['query'][_0xbb10('0x51')]));_0x45cd03[_0xbb10('0x50')]=_0x45cd03['attributes'][_0xbb10('0x52')]?_0x45cd03[_0xbb10('0x50')]:_0xc6af40[_0xbb10('0x4b')];if(!_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x45cd03[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x45cd03[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x424bb1['query'][_0xbb10('0x32')]);}_0x45cd03[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x45cd03['where']=qs[_0xbb10('0x4e')](_['pick'](_0x424bb1['query'],_0xc6af40[_0xbb10('0x4e')]));_0x45cd03[_0xbb10('0x57')]['UserId']=_0xb4d322['id'];if(_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x45cd03[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x45cd03[_0xbb10('0x57')],{'$or':_['map'](_0x45cd03['attributes'],function(_0x44bf0a){var _0x118b63={};_0x118b63[_0x44bf0a]={'$like':'%'+_0x424bb1['query'][_0xbb10('0x3e')]+'%'};return _0x118b63;})});}_0x45cd03=_[_0xbb10('0x58')]({},_0x45cd03,_0x424bb1[_0xbb10('0x5d')]);return db[_0xbb10('0xd8')][_0xbb10('0x31')]({'where':_0x45cd03[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x3be6ec){_0x338080[_0xbb10('0x31')]=_0x3be6ec;if(_0x424bb1['query'][_0xbb10('0x5e')]){_0x45cd03[_0xbb10('0x5f')]=[{'all':!![]}];}return db[_0xbb10('0xd8')][_0xbb10('0x60')](_0x45cd03);})['then'](function(_0x20347b){_0x338080[_0xbb10('0x61')]=_0x20347b;return _0x338080;});}})['then'](respondWithFilteredResult(_0x615606,_0x45cd03))['catch'](handleError(_0x615606,null));};exports[_0xbb10('0xd9')]=function(_0x5a4de3,_0x40ff8e,_0x30ffca){var _0x214dcb={};var _0x3e19f4={};var _0x56e3d0;var _0x90ab9f;return db['User'][_0xbb10('0x95')]({'where':{'id':_0x5a4de3[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x40ff8e,null))[_0xbb10('0x24')](function(_0xa5cb35){if(_0xa5cb35){_0x56e3d0=_0xa5cb35;_0x3e19f4[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xda')][_0xbb10('0x48')]);_0x3e19f4['query']=_[_0xbb10('0x65')](_0x5a4de3[_0xbb10('0x4d')]);_0x3e19f4[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x3e19f4[_0xbb10('0x4b')],_0x3e19f4['query']);_0x214dcb[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x3e19f4[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x5a4de3[_0xbb10('0x4d')]['fields']));_0x214dcb['attributes']=_0x214dcb['attributes'][_0xbb10('0x52')]?_0x214dcb['attributes']:_0x3e19f4['model'];_0x214dcb[_0xbb10('0xc4')]=qs['sort'](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x214dcb['where']=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x5a4de3[_0xbb10('0x4d')],_0x3e19f4[_0xbb10('0x4e')]));if(_0x5a4de3['query']['filter']){_0x214dcb['where']=_[_0xbb10('0x58')](_0x214dcb[_0xbb10('0x57')],{'$or':_['map'](_0x214dcb[_0xbb10('0x50')],function(_0x3fd91c){var _0x3d2e5f={};_0x3d2e5f[_0x3fd91c]={'$like':'%'+_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x3d2e5f;})});}_0x214dcb=_['merge']({},_0x214dcb,_0x5a4de3[_0xbb10('0x5d')]);return _0x56e3d0[_0xbb10('0xd9')](_0x214dcb);}})[_0xbb10('0x24')](function(_0x4aa311){if(_0x4aa311){_0x90ab9f=_0x4aa311[_0xbb10('0x52')];if(!_0x5a4de3['query'][_0xbb10('0x53')](_0xbb10('0x54'))){_0x214dcb[_0xbb10('0x55')]=qs['limit'](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x214dcb['offset']=qs[_0xbb10('0x32')](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x56e3d0[_0xbb10('0xd9')](_0x214dcb);}})[_0xbb10('0x24')](function(_0x589c18){if(_0x589c18){return _0x589c18?{'count':_0x90ab9f,'rows':_0x589c18}:null;}})['then'](respondWithResult(_0x40ff8e,null))[_0xbb10('0x2c')](handleError(_0x40ff8e,null));};exports[_0xbb10('0xdb')]=function(_0x22dd3d,_0x1b0734,_0x1aaedc){var _0x55fd95={};var _0x173721={};var _0x33481b;var _0x42ff51;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x22dd3d['params']['id']}})['then'](handleEntityNotFound(_0x1b0734,null))[_0xbb10('0x24')](function(_0x18f6b1){if(_0x18f6b1){_0x33481b=_0x18f6b1;_0x173721[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db['FaxInteraction']['rawAttributes']);_0x173721[_0xbb10('0x4d')]=_['keys'](_0x22dd3d['query']);_0x173721['filters']=_['intersection'](_0x173721[_0xbb10('0x4b')],_0x173721[_0xbb10('0x4d')]);_0x55fd95[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x173721[_0xbb10('0x4b')],qs['fields'](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x55fd95[_0xbb10('0x50')]=_0x55fd95['attributes'][_0xbb10('0x52')]?_0x55fd95[_0xbb10('0x50')]:_0x173721[_0xbb10('0x4b')];_0x55fd95[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x55fd95[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x22dd3d[_0xbb10('0x4d')],_0x173721[_0xbb10('0x4e')]));if(_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x55fd95[_0xbb10('0x57')]=_['merge'](_0x55fd95['where'],{'$or':_['map'](_0x55fd95[_0xbb10('0x50')],function(_0x58fbef){var _0x1ae32c={};_0x1ae32c[_0x58fbef]={'$like':'%'+_0x22dd3d['query'][_0xbb10('0x3e')]+'%'};return _0x1ae32c;})});}_0x55fd95=_['merge']({},_0x55fd95,_0x22dd3d['options']);return _0x33481b[_0xbb10('0xdb')](_0x55fd95);}})[_0xbb10('0x24')](function(_0x49670b){if(_0x49670b){_0x42ff51=_0x49670b[_0xbb10('0x52')];if(!_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x55fd95['limit']=qs['limit'](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x55fd95[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x33481b[_0xbb10('0xdb')](_0x55fd95);}})['then'](function(_0x5414f9){if(_0x5414f9){return _0x5414f9?{'count':_0x42ff51,'rows':_0x5414f9}:null;}})['then'](respondWithResult(_0x1b0734,null))['catch'](handleError(_0x1b0734,null));};exports[_0xbb10('0xdc')]=function(_0x592a30,_0x1d6630,_0x2e512a){var _0x177bd9;var _0x20305b;var _0x3ba9cc;var _0x57a6bc=!_[_0xbb10('0x72')](_0x592a30[_0xbb10('0x63')]['id'])?_0x592a30[_0xbb10('0x63')]['id']:!_[_0xbb10('0x72')](_0x592a30[_0xbb10('0x3c')]['id'])?_0x592a30[_0xbb10('0x3c')]['id']:null;return db['User']['find']({'where':{'id':_0x57a6bc,'role':{'$or':[_0xbb10('0x6d'),_0xbb10('0x3c'),_0xbb10('0x3d')]}},'attributes':['id',_0xbb10('0x43'),_0xbb10('0xdd'),'mobile','role',_0xbb10('0x75'),_0xbb10('0xa2')]})['then'](function(_0x50dde9){if(_0x50dde9){if(_0x50dde9[_0xbb10('0x42')]===_0xbb10('0x3d')){_0x177bd9=_0x50dde9;if(_0x592a30[_0xbb10('0x68')][_0xbb10('0xa3')]){_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xde'),_0x177bd9[_0x592a30['body'][_0xbb10('0xa3')]]);}else if(_0x592a30[_0xbb10('0x68')][_0xbb10('0xdf')]){_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x592a30[_0xbb10('0x68')][_0xbb10('0xdf')]);}else{_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x177bd9['name']);}socket['to'](util['format']('user:%s',_0x177bd9[_0xbb10('0x43')]))[_0xbb10('0xac')](_0xbb10('0xe0'),{'ip':_0x592a30[_0xbb10('0xe1')]['x-forwarded-for']||_0x592a30['connection']['remoteAddress']||_0x592a30[_0xbb10('0xe2')][_0xbb10('0xe3')]||_0x592a30[_0xbb10('0xe4')][_0xbb10('0xe2')][_0xbb10('0xe3')]});return db[_0xbb10('0xb5')][_0xbb10('0x39')]({'where':{'membername':_0x177bd9[_0xbb10('0x43')]},'individualHooks':!![]});}}else{throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xe5'));}})[_0xbb10('0x24')](function(){if(_0x177bd9){return _0x177bd9[_0xbb10('0xe6')]({'raw':!![]});}})[_0xbb10('0x24')](function(_0x5f074d){if(_0x177bd9){var _0x33f424=[];if(_0x5f074d){_0x20305b=_0x5f074d;if(_0x20305b[_0xbb10('0x52')]){for(var _0x2a73f5=0x0;_0x2a73f5<_0x20305b[_0xbb10('0x52')];_0x2a73f5++){_0x33f424[_0xbb10('0xb0')]({'membername':_0x177bd9[_0xbb10('0x43')],'UserId':_0x177bd9['id'],'queue_name':_0x20305b[_0x2a73f5]['name'],'VoiceQueueId':_0x20305b[_0x2a73f5]['id'],'interface':_0x3ba9cc,'paused':_0x177bd9[_0xbb10('0xa2')]||![],'penalty':_0x20305b[_0x2a73f5][_0xbb10('0xe7')]||0x0});}return BPromise[_0xbb10('0xb4')](_0x33f424,function(_0x2de756){return db[_0xbb10('0xb5')][_0xbb10('0xb6')](_0x2de756);});}}}})[_0xbb10('0x24')](function(){if(_0x177bd9){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x177bd9['name'],'exitAt':null}});}})[_0xbb10('0x24')](function(_0x1085c3){if(_0x177bd9){var _0x2ebd37=[];_0x1085c3[_0xbb10('0xe9')](function(_0x3f33de){_0x2ebd37[_0xbb10('0xb0')](_0x3f33de[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea'))}));});return BPromise['all'](_0x2ebd37);}})[_0xbb10('0x24')](function(){if(_0x177bd9){var _0x4fac24=[];var _0x15c71d=[];var _0x2cd1b0=utils['getChannels']();var _0x57b52d={'membername':_0x177bd9[_0xbb10('0x43')],'interface':_0x3ba9cc,'enterAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'role':_0x177bd9[_0xbb10('0x42')],'internal':_0x177bd9[_0xbb10('0x75')]};_0x2cd1b0[_0xbb10('0xe9')](function(_0x2b69f9){_0x4fac24[_0xbb10('0xb0')](_[_0xbb10('0x58')]({'channel':_0x2b69f9,'type':_0xbb10('0xeb'),'data1':_0x592a30[_0xbb10('0x68')][_0xbb10('0xec')],'data2':_0x3ba9cc},_0x57b52d));if(_0x177bd9[_0xbb10('0xa2')]){_0x15c71d[_0xbb10('0xb0')](_[_0xbb10('0x58')]({'channel':_0x2b69f9,'type':'PAUSE','data1':_0xbb10('0xed')},_0x57b52d));}});return db['MemberReport'][_0xbb10('0x67')](_0x4fac24[_0xbb10('0xee')](_0x15c71d),{'individualHooks':!![]});}})[_0xbb10('0x24')](function(){if(_0x177bd9){return _0x177bd9[_0xbb10('0x38')]({'online':!![],'lastLoginAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'voicePause':_0x177bd9[_0xbb10('0xa2')]||![],'mailPause':_0x177bd9[_0xbb10('0xa2')]||![],'chatPause':_0x177bd9[_0xbb10('0xa2')]||![],'faxPause':_0x177bd9['loginInPause']||![],'smsPause':_0x177bd9['loginInPause']||![],'openchannelPause':_0x177bd9[_0xbb10('0xa2')]||![],'pauseType':_0x177bd9[_0xbb10('0xa2')]?_0xbb10('0xed'):null,'interface':_0x3ba9cc,'lastPauseAt':moment()['format'](_0xbb10('0xea'))});}})['then'](function(_0x283310){if(_0x592a30[_0xbb10('0xef')]){return _0x2e512a();}else{return BPromise['resolve'](_0x283310)[_0xbb10('0x24')](respondWithResult(_0x1d6630,null));}})[_0xbb10('0x2c')](handleError(_0x1d6630,null));};exports[_0xbb10('0xf0')]=function(_0xc1691,_0xff4c3b,_0x5dccd7){var _0x1821fc;return db[_0xbb10('0x47')]['find']({'where':{'id':_0xc1691[_0xbb10('0x63')]['id'],'role':_0xbb10('0x3d')},'attributes':['id','name',_0xbb10('0x42')]})[_0xbb10('0x24')](handleEntityNotFound(_0xff4c3b,null))[_0xbb10('0x24')](function(_0x24f1d2){if(_0x24f1d2){_0x1821fc=_0x24f1d2;return db['UserVoiceQueueRt'][_0xbb10('0x39')]({'where':{'membername':_0x1821fc[_0xbb10('0x43')]},'individualHooks':!![]});}})[_0xbb10('0x24')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x1821fc[_0xbb10('0x43')],'exitAt':null}});})[_0xbb10('0x24')](function(_0x29d8d7){var _0x2a13d7=[];_0x29d8d7['forEach'](function(_0x9f8b04){_0x2a13d7[_0xbb10('0xb0')](_0x9f8b04[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea'))}));});return BPromise['all'](_0x2a13d7);})['then'](function(){return _0x1821fc[_0xbb10('0x38')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xbb10('0x24')](respondWithResult(_0xff4c3b,null))['catch'](handleError(_0xff4c3b,null));};exports['pause']=function(_0x1536d1,_0x2eeb15,_0x4c75ae){var _0x3a25fe;return db[_0xbb10('0xb5')][_0xbb10('0x38')]({'paused':0x1},{'where':{'UserId':_0x1536d1['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x1536d1[_0xbb10('0x63')]['id'],'role':_0xbb10('0x3d')},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42'),'internal',_0xbb10('0xa3')]});})[_0xbb10('0x24')](handleEntityNotFound(_0x2eeb15,null))[_0xbb10('0x24')](function(_0x218f91){if(_0x218f91){_0x3a25fe=_0x218f91;return respondWithRpcPromise('QueuePause',_0xbb10('0xf1'),{'id':_0x3a25fe['id'],'name':_0x3a25fe[_0xbb10('0x43')],'pause':!![]});}})[_0xbb10('0x24')](function(){if(_0x3a25fe){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x3a25fe[_0xbb10('0x43')],'type':_0xbb10('0xf2'),'exitAt':null}});}})[_0xbb10('0x24')](function(_0x2b363c){if(_0x2b363c[_0xbb10('0x52')]){var _0x296bba=moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3201e2=0x0,_0xb4d550=_0x2b363c['length'];_0x3201e2<_0xb4d550;_0x3201e2++){_0x2b363c[_0x3201e2][_0xbb10('0xf3')]({'exitAt':_0x296bba});}}})[_0xbb10('0x24')](function(){var _0x1ccc9a=[];var _0x5daba5=utils[_0xbb10('0xf4')]();_0x5daba5[_0xbb10('0xe9')](function(_0x124fbe){_0x1ccc9a[_0xbb10('0xb0')]({'channel':_0x124fbe,'membername':_0x3a25fe[_0xbb10('0x43')],'interface':_[_0xbb10('0x72')](_0x3a25fe['interface'])?util[_0xbb10('0xb1')]('SIP/%s',_0x3a25fe[_0xbb10('0x43')]):_0x3a25fe[_0xbb10('0xa3')],'type':_0xbb10('0xf2'),'enterAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1536d1[_0xbb10('0x68')][_0xbb10('0x59')]||'DEFAULT\x20PAUSE','role':_0x3a25fe[_0xbb10('0x42')],'internal':_0x3a25fe['internal']});});return db[_0xbb10('0xe8')][_0xbb10('0x67')](_0x1ccc9a,{'individualHooks':!![]});})[_0xbb10('0x24')](function(){return _0x3a25fe[_0xbb10('0x38')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1536d1[_0xbb10('0x68')][_0xbb10('0x59')]||_0xbb10('0xf5'),'lastPauseAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x2eeb15,null))[_0xbb10('0x2c')](handleError(_0x2eeb15,null));};exports[_0xbb10('0xf6')]=function(_0x8133bb,_0x2b8f7c,_0x6f428e){var _0x3c5e1e;return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x8133bb[_0xbb10('0x63')]['id']},'attributes':['id','name',_0xbb10('0x42'),'voicePause',_0xbb10('0xf7'),_0xbb10('0xf8'),'faxPause',_0xbb10('0xf9'),_0xbb10('0xfa'),_0xbb10('0xfb'),_0xbb10('0xfc')]})[_0xbb10('0x24')](handleEntityNotFound(_0x2b8f7c,null))[_0xbb10('0x24')](function(_0x2d453f){if(_0x2d453f){_0x3c5e1e=_0x2d453f;if(_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')]&&!utils[_0xbb10('0xa4')](_0x8133bb['body'][_0xbb10('0xa0')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}switch(_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')]){case _0xbb10('0xaf'):return respondWithRpcPromise(_0xbb10('0xfd'),_0xbb10('0xf6'),{'id':_0x3c5e1e['id'],'name':_0x3c5e1e[_0xbb10('0x43')],'pause':![]})[_0xbb10('0x24')](function(){return db['UserVoiceQueueRt'][_0xbb10('0x38')]({'paused':0x0},{'where':{'UserId':_0x3c5e1e['id']},'individualHooks':!![]});})[_0xbb10('0x24')](function(){return db[_0xbb10('0xe8')]['find']({'where':{'channel':_0x8133bb['body'][_0xbb10('0xa0')],'membername':_0x3c5e1e['name'],'type':_0xbb10('0xf2'),'exitAt':null}});})[_0xbb10('0x24')](function(_0x291ff2){if(_0x291ff2){return _0x291ff2[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0xfe')},{'individualHooks':!![]});}return null;})[_0xbb10('0x24')](function(){return _0x3c5e1e[_0xbb10('0x38')]({'voicePause':![]});});case _0xbb10('0xff'):case _0xbb10('0x100'):case _0xbb10('0x101'):case _0xbb10('0x102'):case'openchannel':return db[_0xbb10('0xe8')][_0xbb10('0x66')]({'where':{'channel':_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')],'membername':_0x3c5e1e[_0xbb10('0x43')],'type':'PAUSE','exitAt':null}})[_0xbb10('0x24')](function(_0x3b73d4){if(_0x3b73d4){return _0x3b73d4[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xbb10('0x24')](function(){var _0x39b9f0={};_[_0xbb10('0x33')](_0x39b9f0,util[_0xbb10('0xb1')](_0xbb10('0x103'),_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')],'Pause'),![]);return _0x3c5e1e['update'](_0x39b9f0);});default:return respondWithRpcPromise(_0xbb10('0xfd'),_0xbb10('0xf6'),{'id':_0x3c5e1e['id'],'name':_0x3c5e1e['name'],'pause':![]})[_0xbb10('0x24')](function(){return db[_0xbb10('0xb5')][_0xbb10('0x38')]({'paused':0x0},{'where':{'UserId':_0x3c5e1e['id']}});})[_0xbb10('0x24')](function(){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x3c5e1e['name'],'type':_0xbb10('0xf2'),'exitAt':null}});})[_0xbb10('0x24')](function(_0x2d4461){var _0x6a9308=[];_0x2d4461['forEach'](function(_0x5dc194){_0x6a9308[_0xbb10('0xb0')](_0x5dc194[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'data2':_0xbb10('0xfe')}));});return BPromise[_0xbb10('0x104')](_0x6a9308);})[_0xbb10('0x24')](function(){return _0x3c5e1e[_0xbb10('0x38')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xbb10('0x24')](respondWithResult(_0x2b8f7c,null))[_0xbb10('0x2c')](handleError(_0x2b8f7c,null));};exports[_0xbb10('0x105')]=function(_0x3d8001,_0x9b1170,_0x178c61){var _0x5db2de={};var _0x84ad00={};var _0xa3da;var _0x45e0ab;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x3d8001[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x9b1170,null))[_0xbb10('0x24')](function(_0x813a33){if(_0x813a33){_0xa3da=_0x813a33;_0x84ad00[_0xbb10('0x4b')]=_['keys'](db['Team'][_0xbb10('0x48')]);_0x84ad00['query']=_[_0xbb10('0x65')](_0x3d8001[_0xbb10('0x4d')]);_0x84ad00['filters']=_['intersection'](_0x84ad00[_0xbb10('0x4b')],_0x84ad00[_0xbb10('0x4d')]);_0x5db2de['attributes']=_[_0xbb10('0x4f')](_0x84ad00[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x3d8001['query'][_0xbb10('0x51')]));_0x5db2de[_0xbb10('0x50')]=_0x5db2de[_0xbb10('0x50')]['length']?_0x5db2de[_0xbb10('0x50')]:_0x84ad00['model'];_0x5db2de[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x3d8001['query'][_0xbb10('0x56')]);_0x5db2de[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x3d8001[_0xbb10('0x4d')],_0x84ad00[_0xbb10('0x4e')]));if(_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x5db2de[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x5db2de[_0xbb10('0x57')],{'$or':_['map'](_0x5db2de[_0xbb10('0x50')],function(_0x229c31){var _0x2ff1a2={};_0x2ff1a2[_0x229c31]={'$like':'%'+_0x3d8001['query'][_0xbb10('0x3e')]+'%'};return _0x2ff1a2;})});}_0x5db2de=_[_0xbb10('0x58')]({},_0x5db2de,_0x3d8001[_0xbb10('0x5d')]);return _0xa3da[_0xbb10('0x105')](_0x5db2de);}})['then'](function(_0x347d0d){if(_0x347d0d){_0x45e0ab=_0x347d0d[_0xbb10('0x52')];if(!_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x5db2de[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x5db2de[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0xa3da[_0xbb10('0x105')](_0x5db2de);}})[_0xbb10('0x24')](function(_0x5a99ca){if(_0x5a99ca){return _0x5a99ca?{'count':_0x45e0ab,'rows':_0x5a99ca}:null;}})[_0xbb10('0x24')](respondWithResult(_0x9b1170,null))['catch'](handleError(_0x9b1170,null));};exports['addTeams']=function(_0x553054,_0x2f3e26){return db['User'][_0xbb10('0x66')]({'where':{'id':_0x553054['params']['id']}})['then'](handleEntityNotFound(_0x2f3e26,null))[_0xbb10('0x24')](function(_0x5278d0){if(_0x5278d0){var _0x2dcc71=_0x5278d0[_0xbb10('0x3a')]({'plain':!![]});return _0x5278d0[_0xbb10('0x106')](_0x553054[_0xbb10('0x68')]['ids'],_[_0xbb10('0x6b')](_0x553054[_0xbb10('0x68')],[_0xbb10('0x6a'),'id'])||{})[_0xbb10('0x24')](function(){for(var _0x281873=0x0;_0x281873<_0x553054[_0xbb10('0x68')]['ids'][_0xbb10('0x52')];_0x281873++){var _0x2fefd2=[];db[_0xbb10('0x107')][_0xbb10('0x95')]({'where':{'id':_0x553054[_0xbb10('0x68')][_0xbb10('0x6a')][_0x281873]}})[_0xbb10('0x24')](function(_0x20f65c){_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0xe6')]()['then'](function(_0x5b8ffd){for(var _0x5cf145=0x0;_0x5cf145<_0x5b8ffd[_0xbb10('0x52')];_0x5cf145++){_0x5b8ffd[_0x5cf145][_0xbb10('0x108')]('channel',_0xbb10('0x109'));}return _0x5b8ffd;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c['getChatQueues']()[_0xbb10('0x24')](function(_0x836686){for(var _0x3a3d86=0x0;_0x3a3d86<_0x836686[_0xbb10('0x52')];_0x3a3d86++){_0x836686[_0x3a3d86][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x10a'));}return _0x836686;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x10b')]()['then'](function(_0x15fce2){for(var _0x3301f8=0x0;_0x3301f8<_0x15fce2[_0xbb10('0x52')];_0x3301f8++){_0x15fce2[_0x3301f8][_0xbb10('0x108')]('channel',_0xbb10('0x10c'));}return _0x15fce2;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x10d')]()[_0xbb10('0x24')](function(_0xcb30de){for(var _0x46eaab=0x0;_0x46eaab<_0xcb30de[_0xbb10('0x52')];_0x46eaab++){_0xcb30de[_0x46eaab][_0xbb10('0x108')]('channel',_0xbb10('0x10e'));}return _0xcb30de;}));_0x2fefd2['push'](_0x20f65c[_0xbb10('0x10f')]()[_0xbb10('0x24')](function(_0x106a6a){for(var _0x5a9680=0x0;_0x5a9680<_0x106a6a[_0xbb10('0x52')];_0x5a9680++){_0x106a6a[_0x5a9680][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x110'));}return _0x106a6a;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x111')]()[_0xbb10('0x24')](function(_0x36a05f){for(var _0x258add=0x0;_0x258add<_0x36a05f['length'];_0x258add++){_0x36a05f[_0x258add][_0xbb10('0x108')]('channel',_0xbb10('0x112'));}return _0x36a05f;}));return BPromise[_0xbb10('0x104')](_0x2fefd2);})[_0xbb10('0x24')](function(_0x2fc812){var _0x5de09a=_[_0xbb10('0x113')](_0x2fc812);_0x2fefd2=[];return db[_0xbb10('0x5a')]['transaction'](function(_0x220d39){for(var _0xf8b732=0x0;_0xf8b732<_0x5de09a[_0xbb10('0x52')];_0xf8b732++){_0x2fefd2[_0xbb10('0xb0')](_0x5de09a[_0xf8b732]['addAgent'](_0x2dcc71['id']),{'transaction':_0x220d39});}return BPromise[_0xbb10('0x104')](_0x2fefd2)['then'](function(){if(_0x2dcc71[_0xbb10('0xa1')]){return BPromise['each'](_[_0xbb10('0x3e')](_0x5de09a,function(_0x2fe77a){return _0x2fe77a[_0xbb10('0x114')](_0xbb10('0xa0'))===_0xbb10('0x109');}),function(_0x1ba03d){return db[_0xbb10('0xb5')][_0xbb10('0xb6')]({'membername':_0x2dcc71[_0xbb10('0x43')],'UserId':_0x2dcc71['id'],'queue_name':_0x1ba03d[_0xbb10('0x43')],'VoiceQueueId':_0x1ba03d['id'],'interface':_[_0xbb10('0x72')](_0x2dcc71[_0xbb10('0xa3')])?util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x2dcc71['name']):_0x2dcc71[_0xbb10('0xa3')],'paused':_0x2dcc71['voicePause']||![],'penalty':_0x2dcc71[_0xbb10('0xa9')]},{'transaction':_0x220d39});});}else{return;}})[_0xbb10('0x24')](function(){for(var _0x71e092=0x0;_0x71e092<_0x5de09a['length'];_0x71e092++){var _0x3c1c6c=_0x5de09a[_0x71e092][_0xbb10('0x114')](_0xbb10('0xa0'));var _0x188a4a=_0x3c1c6c+'QueueId';socket['emit'](_0xbb10('0x3c')+_0x3c1c6c+_0xbb10('0xad'),{'UserId':_0x2dcc71['id'],['queueField']:_0x5de09a[_0x71e092]['id']});}});});});}});}})[_0xbb10('0x24')](respondWithStatusCode(_0x2f3e26,null))[_0xbb10('0x2c')](handleError(_0x2f3e26,null));};exports['removeTeams']=function(_0x2ee6af,_0x3f881c){return db[_0xbb10('0x47')]['findOne']({'where':{'id':_0x2ee6af['params']['id']}})['then'](handleEntityNotFound(_0x3f881c,null))['then'](function(_0x2bb476){if(_0x2bb476){var _0x2e1fdb=_0x2bb476['get']({'plain':!![]});var _0x4092d8=_0x2ee6af[_0xbb10('0x4d')][_0xbb10('0x6a')];return _0x2bb476['removeTeams'](_0x4092d8)['then'](function(){for(var _0x51179e=0x0;_0x51179e<_0x4092d8[_0xbb10('0x52')];_0x51179e++){var _0x382702=[];db['Team'][_0xbb10('0x95')]({'where':{'id':_0x4092d8[_0x51179e]}})[_0xbb10('0x24')](function(_0x77e6a2){_0x382702[_0xbb10('0xb0')](_0x77e6a2['getVoiceQueues']()[_0xbb10('0x24')](function(_0x45f333){for(var _0x1588f6=0x0;_0x1588f6<_0x45f333['length'];_0x1588f6++){_0x45f333[_0x1588f6][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x109'));}return _0x45f333;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x115')]()[_0xbb10('0x24')](function(_0x5d6665){for(var _0x4be971=0x0;_0x4be971<_0x5d6665[_0xbb10('0x52')];_0x4be971++){_0x5d6665[_0x4be971]['setDataValue']('channel',_0xbb10('0x10a'));}return _0x5d6665;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x10b')]()[_0xbb10('0x24')](function(_0x301bc6){for(var _0xda32a7=0x0;_0xda32a7<_0x301bc6[_0xbb10('0x52')];_0xda32a7++){_0x301bc6[_0xda32a7]['setDataValue'](_0xbb10('0xa0'),_0xbb10('0x10c'));}return _0x301bc6;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x10d')]()[_0xbb10('0x24')](function(_0x4e621c){for(var _0x5a5f1b=0x0;_0x5a5f1b<_0x4e621c[_0xbb10('0x52')];_0x5a5f1b++){_0x4e621c[_0x5a5f1b][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x10e'));}return _0x4e621c;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2['getFaxQueues']()['then'](function(_0x3e47ec){for(var _0x5c8df0=0x0;_0x5c8df0<_0x3e47ec[_0xbb10('0x52')];_0x5c8df0++){_0x3e47ec[_0x5c8df0][_0xbb10('0x108')]('channel','Fax');}return _0x3e47ec;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x111')]()[_0xbb10('0x24')](function(_0x245cc2){for(var _0x362eae=0x0;_0x362eae<_0x245cc2[_0xbb10('0x52')];_0x362eae++){_0x245cc2[_0x362eae]['setDataValue'](_0xbb10('0xa0'),_0xbb10('0x112'));}return _0x245cc2;}));return BPromise[_0xbb10('0x104')](_0x382702);})[_0xbb10('0x24')](function(_0x5c472e){var _0x5bc002=_[_0xbb10('0x113')](_0x5c472e);_0x382702=[];return db[_0xbb10('0x5a')][_0xbb10('0x116')](function(_0x1ba68f){for(var _0xb86419=0x0;_0xb86419<_0x5bc002[_0xbb10('0x52')];_0xb86419++){_0x382702['push'](_0x5bc002[_0xb86419]['removeAgent'](_0x2e1fdb['id']),{'transaction':_0x1ba68f});}return BPromise[_0xbb10('0x104')](_0x382702)[_0xbb10('0x24')](function(){if(_0x2e1fdb[_0xbb10('0xa1')]){return BPromise[_0xbb10('0xb4')](_['filter'](_0x5bc002,function(_0x463d0f){return _0x463d0f[_0xbb10('0x114')](_0xbb10('0xa0'))===_0xbb10('0x109');}),function(_0x3fa317){return db[_0xbb10('0xb5')][_0xbb10('0x39')]({'where':{'VoiceQueueId':_0x3fa317['id'],'UserId':_0x2e1fdb['id']},'transaction':_0x1ba68f});});}else{return;}})['then'](function(){for(var _0x3b0322=0x0;_0x3b0322<_0x5bc002[_0xbb10('0x52')];_0x3b0322++){var _0x26f413=_0x5bc002[_0x3b0322][_0xbb10('0x114')](_0xbb10('0xa0'));var _0x460157=_0x26f413+_0xbb10('0xab');socket[_0xbb10('0xac')]('user'+_0x26f413+_0xbb10('0xb8'),{'UserId':_0x2e1fdb['id'],['queueField']:_0x5bc002[_0x3b0322]['id']});}});});});}});}})[_0xbb10('0x24')](respondWithStatusCode(_0x3f881c,null))[_0xbb10('0x2c')](handleError(_0x3f881c,null));};exports['getLists']=function(_0x5457ed,_0x152c97,_0x2d81db){var _0x28ee28={};var _0x195a5b={};var _0x5db829;var _0x3053d2;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x5457ed[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x152c97,null))[_0xbb10('0x24')](function(_0x267335){if(_0x267335){_0x5db829=_0x267335;_0x195a5b[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0x117')]['rawAttributes']);_0x195a5b[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x5457ed[_0xbb10('0x4d')]);_0x195a5b['filters']=_['intersection'](_0x195a5b[_0xbb10('0x4b')],_0x195a5b['query']);_0x28ee28[_0xbb10('0x50')]=_['intersection'](_0x195a5b[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x5457ed[_0xbb10('0x4d')]['fields']));_0x28ee28[_0xbb10('0x50')]=_0x28ee28[_0xbb10('0x50')]['length']?_0x28ee28[_0xbb10('0x50')]:_0x195a5b[_0xbb10('0x4b')];_0x28ee28[_0xbb10('0xc4')]=qs['sort'](_0x5457ed[_0xbb10('0x4d')]['sort']);_0x28ee28[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x5457ed['query'],_0x195a5b['filters']));if(_0x5457ed['query'][_0xbb10('0x3e')]){_0x28ee28['where']=_[_0xbb10('0x58')](_0x28ee28['where'],{'$or':_[_0xbb10('0x40')](_0x28ee28[_0xbb10('0x50')],function(_0x4e63e1){var _0x4bfc39={};_0x4bfc39[_0x4e63e1]={'$like':'%'+_0x5457ed[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x4bfc39;})});}_0x28ee28=_['merge']({},_0x28ee28,_0x5457ed[_0xbb10('0x5d')]);return _0x5db829[_0xbb10('0x118')](_0x28ee28);}})[_0xbb10('0x24')](function(_0x4dd5da){if(_0x4dd5da){_0x3053d2=_0x4dd5da[_0xbb10('0x52')];if(!_0x5457ed[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x28ee28[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x5457ed[_0xbb10('0x4d')]['limit']);_0x28ee28[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x5457ed[_0xbb10('0x4d')]['offset']);}return _0x5db829[_0xbb10('0x118')](_0x28ee28);}})[_0xbb10('0x24')](function(_0x521aa3){if(_0x521aa3){return _0x521aa3?{'count':_0x3053d2,'rows':_0x521aa3}:null;}})[_0xbb10('0x24')](respondWithResult(_0x152c97,null))[_0xbb10('0x2c')](handleError(_0x152c97,null));};exports[_0xbb10('0x119')]=function(_0x347821,_0x28a567,_0x2a7921){var _0x12be2f={};var _0x302201={};var _0x256a13;var _0xf47d92;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x347821[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x28a567,null))[_0xbb10('0x24')](function(_0x11ae04){if(_0x11ae04){_0x256a13=_0x11ae04;_0x302201['model']=_['keys'](db[_0xbb10('0x47')][_0xbb10('0x48')]);_0x302201[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x347821['query']);_0x302201[_0xbb10('0x4e')]=_['intersection'](_0x302201['model'],_0x302201['query']);_0x12be2f[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x302201[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x347821['query'][_0xbb10('0x51')]));_0x12be2f['attributes']=_0x12be2f[_0xbb10('0x50')][_0xbb10('0x52')]?_0x12be2f[_0xbb10('0x50')]:_0x302201[_0xbb10('0x4b')];_0x12be2f[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x347821['query']['sort']);_0x12be2f[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x347821[_0xbb10('0x4d')],_0x302201[_0xbb10('0x4e')]));if(_0x347821['query'][_0xbb10('0x3e')]){_0x12be2f[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x12be2f[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x12be2f[_0xbb10('0x50')],function(_0x347199){var _0x4e366d={};_0x4e366d[_0x347199]={'$like':'%'+_0x347821[_0xbb10('0x4d')]['filter']+'%'};return _0x4e366d;})});}_0x12be2f[_0xbb10('0x4b')]=db[_0xbb10('0x47')];_0x12be2f['as']=_0xbb10('0x8e');_0x12be2f=_[_0xbb10('0x58')]({},_0x12be2f,_0x347821[_0xbb10('0x5d')]);return _0x256a13[_0xbb10('0xe6')]({'include':[_0x12be2f]});}})['then'](function(_0x2ddf65){if(_0x2ddf65){var _0x31d564={},_0x117375=[],_0x5e5dd0=0x0;for(var _0x4a7cf9=0x0;_0x4a7cf9<_0x2ddf65[_0xbb10('0x52')];_0x4a7cf9+=0x1){for(var _0x3134a6=0x0,_0x579c96;_0x3134a6<_0x2ddf65[_0x4a7cf9]['Agents'][_0xbb10('0x52')];_0x3134a6+=0x1){_0x579c96=_0x2ddf65[_0x4a7cf9][_0xbb10('0x8e')][_0x3134a6][_0xbb10('0x3a')]({'plain':!![]});_0x31d564[_0x579c96['id']]=_0x579c96;}}_0x31d564=_[_0xbb10('0x11a')](_0x31d564);for(var _0x528223=qs[_0xbb10('0x32')](_0x347821[_0xbb10('0x4d')][_0xbb10('0x32')]);_0x528223<_0x31d564[_0xbb10('0x52')]&&_0x117375['length']=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086=[{'name':'Users','value':_0x47a5('0x33'),'ignore':!![]},{'name':'Agents','value':_0x47a5('0x34'),'ignore':![]},{'name':'Telephones','value':_0x47a5('0x35'),'ignore':![]}];var _0x3534cb=_(_0x50c086)[_0x47a5('0x36')](_0x47a5('0x37'))[_0x47a5('0x38')](_0x47a5('0x39'))[_0x47a5('0x39')]();if(_[_0x47a5('0x3a')](_0x3534cb,_0x52749b[_0x47a5('0x3b')])){return;}var _0x4caed5=_[_0x47a5('0x3c')](_0x50c086,[_0x47a5('0x39'),_0x52749b['role']])[_0x47a5('0x3d')];return db[_0x47a5('0x3e')][_0x47a5('0x31')]({'where':{'type':_0x4caed5,'resourceId':_0x52749b['id']}})['then'](function(){return _0x403028;});})[_0x47a5('0x21')](function(){_0x274e34[_0x47a5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ebba0,_0x19218a){return function(_0x54ae35){if(!_0x54ae35){_0x2ebba0['sendStatus'](0x194);}return _0x54ae35;};}function handleError(_0x5ebd8c,_0x12d9f2){_0x12d9f2=_0x12d9f2||0x1f4;return function(_0x5c569e){logger[_0x47a5('0x26')](_0x5c569e[_0x47a5('0x3f')]);if(_0x5c569e[_0x47a5('0x3d')]){delete _0x5c569e[_0x47a5('0x3d')];}_0x5ebd8c[_0x47a5('0x2a')](_0x12d9f2)[_0x47a5('0x40')](_0x5c569e);};}exports[_0x47a5('0x41')]=function(_0x1f3d01,_0x3fa2a8){var _0x36a24e={},_0x280500={},_0x1658e8={'count':0x0,'rows':[]};var _0x23d6d8=_['map'](db[_0x47a5('0x42')][_0x47a5('0x43')],function(_0x331474){return{'name':_0x331474[_0x47a5('0x44')],'type':_0x331474['type'][_0x47a5('0x45')]};});_0x280500['model']=_['differenceBy'](_['map'](_0x23d6d8,'name'),[_0x47a5('0x46'),'salt']);_0x280500[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x1f3d01[_0x47a5('0x47')]);_0x280500['filters']=_[_0x47a5('0x49')](_0x280500[_0x47a5('0x4a')],_0x280500['query']);_0x36a24e['attributes']=_[_0x47a5('0x49')](_0x280500['model'],qs[_0x47a5('0x4b')](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x36a24e[_0x47a5('0x4c')]=_0x36a24e[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x36a24e[_0x47a5('0x4c')]:_0x280500[_0x47a5('0x4a')];if(!_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x36a24e[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x36a24e[_0x47a5('0x2d')]=qs['offset'](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x36a24e['order']=qs['sort'](_0x1f3d01[_0x47a5('0x47')]['sort']);_0x36a24e[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_['pick'](_0x1f3d01['query'],_0x280500[_0x47a5('0x51')]));if(_0x1f3d01['query'][_0x47a5('0x36')]){_0x36a24e[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x36a24e[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x23d6d8,function(_0x26acd2){if(_0x26acd2[_0x47a5('0x53')]!=='VIRTUAL'){return db['sequelize'][_0x47a5('0x50')](db[_0x47a5('0x54')]['fn'](_0x47a5('0x55'),db[_0x47a5('0x54')][_0x47a5('0x56')](_0x26acd2[_0x47a5('0x3d')])),{'$like':db[_0x47a5('0x54')]['fn']('lower','%'+_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x36')]+'%')});}})});}_0x36a24e=_[_0x47a5('0x52')]({},_0x36a24e,_0x1f3d01['options']);var _0x12ca40={'where':_0x36a24e['where']};return db[_0x47a5('0x42')][_0x47a5('0x57')](_0x12ca40)[_0x47a5('0x21')](function(_0xf03bd5){_0x1658e8['count']=_0xf03bd5;if(_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x58')]){_0x36a24e[_0x47a5('0x59')]=[{'all':!![]}];}return db[_0x47a5('0x42')][_0x47a5('0x5a')](_0x36a24e);})[_0x47a5('0x21')](function(_0x24e9f4){_0x1658e8['rows']=_0x24e9f4;return _0x1658e8;})[_0x47a5('0x21')](respondWithFilteredResult(_0x3fa2a8,_0x36a24e))[_0x47a5('0x5b')](handleError(_0x3fa2a8,null));};exports[_0x47a5('0x5c')]=function(_0x8da9fb,_0x3329aa){var _0x1ab0bf={'raw':![],'where':{'id':_0x8da9fb[_0x47a5('0x5d')]['id']}},_0x572233={};_0x572233[_0x47a5('0x4a')]=_[_0x47a5('0x5e')](_['keys'](db[_0x47a5('0x42')][_0x47a5('0x43')]),[_0x47a5('0x46'),'salt']);_0x572233['query']=_[_0x47a5('0x48')](_0x8da9fb[_0x47a5('0x47')]);_0x572233['filters']=_['intersection'](_0x572233[_0x47a5('0x4a')],_0x572233['query']);_0x1ab0bf[_0x47a5('0x4c')]=_['intersection'](_0x572233['model'],qs[_0x47a5('0x4b')](_0x8da9fb[_0x47a5('0x47')]['fields']));_0x1ab0bf[_0x47a5('0x4c')]=_0x1ab0bf[_0x47a5('0x4c')]['length']?_0x1ab0bf['attributes']:_0x572233[_0x47a5('0x4a')];if(_0x8da9fb[_0x47a5('0x47')][_0x47a5('0x58')]){_0x1ab0bf[_0x47a5('0x59')]=[{'all':!![]}];}_0x1ab0bf=_['merge']({},_0x1ab0bf,_0x8da9fb[_0x47a5('0x5f')]);return db[_0x47a5('0x42')][_0x47a5('0x3c')](_0x1ab0bf)['then'](handleEntityNotFound(_0x3329aa,null))[_0x47a5('0x21')](respondWithResult(_0x3329aa,null))['catch'](handleError(_0x3329aa,null));};exports[_0x47a5('0x60')]=function(_0x470da6,_0x943a15){return db[_0x47a5('0x42')][_0x47a5('0x60')](_0x470da6['body'],{'raw':![],'individualHooks':!![]})[_0x47a5('0x21')](respondWithResult(_0x943a15,0xc9))['catch'](handleError(_0x943a15,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}delete _0x5eb150[_0x47a5('0x61')]['role'];return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x5eb150[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x5b')](handleError(_0x4f8564,null));};exports['describe']=function(_0x22c886,_0x274d31){return db['User'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x274d31,null))[_0x47a5('0x5b')](handleError(_0x274d31,null));};exports[_0x47a5('0x63')]=function(_0x2d6494,_0x215634,_0x35cca8){return db[_0x47a5('0x42')]['find']({'where':{'id':_0x2d6494[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x215634,null))[_0x47a5('0x21')](function(_0x26e7fc){if(_0x26e7fc){return _0x26e7fc[_0x47a5('0x63')](_0x2d6494['body'][_0x47a5('0x64')],_[_0x47a5('0x65')](_0x2d6494[_0x47a5('0x61')],[_0x47a5('0x64'),'id'])||{});}})[_0x47a5('0x21')](respondWithResult(_0x215634,null))[_0x47a5('0x5b')](handleError(_0x215634,null));};var getLicense=function(_0x453191){return new BPromise(function(_0x149d34,_0x350af8){var _0x44cb90=0x0;_0x453191[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x34')&&_0x149d34(_0x47a5('0x66'));return db[_0x47a5('0x42')]['count']({'where':{'$or':[{'role':_0x453191[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x35')?'telephone':[_0x47a5('0x67'),_0x47a5('0x33')]}]}})[_0x47a5('0x21')](function(_0x26f1ac){_0x44cb90=_0x26f1ac;return require('../../config/license/util')[_0x47a5('0x68')]();})['then'](function(_0x2d5ee6){var _0x487e21=_0x453191[_0x47a5('0x61')]['role']===_0x47a5('0x35')?_0x47a5('0x69'):_0x47a5('0x6a');if(!_['isNil'](_0x2d5ee6[_0x487e21])&&_0x44cb90>=_0x2d5ee6[_0x487e21]){return _0x350af8({'message':'License\x20limit\x20reached'});}return _0x149d34(util['format'](_0x47a5('0x6b'),_0x487e21,_0x44cb90));})[_0x47a5('0x5b')](function(_0xe3c0a7){return _0x350af8(_0xe3c0a7);});});};exports[_0x47a5('0x6c')]=function(_0x525055,_0x6c0f0){return getLicense(_0x525055)[_0x47a5('0x21')](function(_0x390bc0){if(!_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]){var _0xb9f589;return db[_0x47a5('0x6e')][_0x47a5('0x6f')](0x1)[_0x47a5('0x21')](function(_0xc69a68){return checkPasswordPattern(_0xc69a68,_0x525055[_0x47a5('0x61')][_0x47a5('0x46')],_0xc69a68['securePassword']);})[_0x47a5('0x21')](function(_0x4833be){_0xb9f589=_0x4833be[_0x47a5('0x70')];return db[_0x47a5('0x42')][_0x47a5('0x71')](_0x47a5('0x6d'));})[_0x47a5('0x21')](function(_0xa9c853){if(_[_0x47a5('0x72')](_0xa9c853)){if(_0xb9f589){_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=_0xb9f589;}else{_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=0x1;}}else{if(_[_0x47a5('0x72')](_0xb9f589)||_0xb9f589==_0xa9c853){_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=_0xa9c853+0x1;}else if(_0xb9f589>_0xa9c853){_0x525055[_0x47a5('0x61')]['internal']=_0xb9f589;}else{return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x47a5('0x54')][_0x47a5('0x73')]['SELECT']})[_0x47a5('0x21')](function(_0x44dda2){if(_0x44dda2&&_0x44dda2[_0x47a5('0x4d')]){for(var _0x396102=0x0,_0x3cd335=_0x44dda2[_0x47a5('0x4d')];_0x396102<_0x3cd335&&_[_0x47a5('0x72')](_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]);_0x396102++){if(_0xb9f589<=_0x44dda2[_0x396102][_0x47a5('0x74')]){_0x525055[_0x47a5('0x61')]['internal']=_0x44dda2[_0x396102][_0x47a5('0x74')];}else if(_0xb9f589>_0x44dda2[_0x396102][_0x47a5('0x74')]&&_0xb9f589<=_0x44dda2[_0x396102]['to']){_0x525055[_0x47a5('0x61')]['internal']=_0xb9f589;}}}if(_[_0x47a5('0x72')](_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')])){_0x525055['body'][_0x47a5('0x6d')]=_0xa9c853+0x1;}});}}});}})['then'](function(){if(_0x525055['body'][_0x47a5('0x75')]){_0x525055[_0x47a5('0x61')][_0x47a5('0x76')]=_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')];_0x525055[_0x47a5('0x61')]['VoiceMail']={'mailbox':_0x525055['body'][_0x47a5('0x6d')],'password':_0x525055['body'][_0x47a5('0x46')],'fullname':_0x525055[_0x47a5('0x61')][_0x47a5('0x77')],'email':_0x525055[_0x47a5('0x61')]['email']};}if(_0x525055[_0x47a5('0x61')]&&_0x525055['body']['role']===_0x47a5('0x34')){_0x525055[_0x47a5('0x61')]['permissions']=[_0x47a5('0x78'),_0x47a5('0x79'),_0x47a5('0x7a'),'110',_0x47a5('0x7b'),'105',_0x47a5('0x7c'),_0x47a5('0x7d'),_0x47a5('0x7e'),'109',_0x47a5('0x7f'),_0x47a5('0x80')];}return db[_0x47a5('0x42')]['create'](_0x525055[_0x47a5('0x61')],{'include':[{'model':db['VoiceMail'],'as':_0x47a5('0x81')}]});})['then'](function(_0x135d2e){if(_0x525055[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x33'))return _0x135d2e;var _0x51738b=_0x525055[_0x47a5('0x33')][_0x47a5('0x32')]({'plain':!![]});if(!_0x51738b)throw new Error(_0x47a5('0x82'));if(_0x51738b[_0x47a5('0x3b')]===_0x47a5('0x33')){var _0x57ac25=_0x135d2e['get']({'plain':!![]});var _0x569550=[{'name':'Agents','value':_0x47a5('0x34')},{'name':_0x47a5('0x83'),'value':_0x47a5('0x35')}];var _0x5018e9=_[_0x47a5('0x3c')](_0x569550,[_0x47a5('0x39'),_0x57ac25['role']])[_0x47a5('0x3d')];return db[_0x47a5('0x84')][_0x47a5('0x3c')]({'where':{'name':_0x5018e9,'userProfileId':_0x51738b[_0x47a5('0x85')]},'raw':!![]})['then'](function(_0x4b5353){if(_0x4b5353&&_0x4b5353[_0x47a5('0x86')]===0x0){return db[_0x47a5('0x3e')]['create']({'name':_0x57ac25[_0x47a5('0x3d')],'resourceId':_0x57ac25['id'],'type':_0x4b5353[_0x47a5('0x3d')],'sectionId':_0x4b5353['id']},{})['then'](function(){return _0x135d2e;});}else{return _0x135d2e;}})[_0x47a5('0x5b')](function(_0x2a02cd){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a02cd);throw _0x2a02cd;});}return _0x135d2e;})[_0x47a5('0x21')](respondWithResult(_0x6c0f0,0xc9))['catch'](handleError(_0x6c0f0,null));};exports[_0x47a5('0x87')]=function(_0x5e2946,_0x243c8b,_0x3c620e){var _0x4995be=![];if(_0x5e2946[_0x47a5('0x61')]['id']){delete _0x5e2946['body']['id'];}return db[_0x47a5('0x6e')][_0x47a5('0x88')]({'attributes':['id',_0x47a5('0x89')]})[_0x47a5('0x21')](function(_0x49b76a){_0x4995be=_0x49b76a[_0x47a5('0x89')];return db['User']['find']({'where':{'id':_0x5e2946[_0x47a5('0x5d')]['id']}});})[_0x47a5('0x21')](function(_0x352238){if(_0x352238){if(_0x352238['id']==_0x5e2946[_0x47a5('0x33')]['id']){if(!_0x5e2946[_0x47a5('0x61')]['oldPassword']||!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x352238[_0x47a5('0x8b')](_0x5e2946['body'][_0x47a5('0x8c')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8c')]==_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x8e'));}return _0x352238;}else if(_0x5e2946[_0x47a5('0x33')]['role']==_0x47a5('0x67')){if(!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db['Sequelize']['ValidationError'](_0x47a5('0x8f'));}return _0x352238;}else if(_0x5e2946[_0x47a5('0x33')]['role']=='user'){if(!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db['Sequelize'][(_0x47a5('0x1f'))](_0x47a5('0x8f'));}if(_0x352238['role']!=_0x47a5('0x34')){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x90'));}return _0x352238;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unauthorized');}}return null;})['then'](handleEntityNotFound(_0x243c8b,null))['then'](function(_0x133b7a){return checkPasswordPattern(_0x133b7a,_0x5e2946[_0x47a5('0x61')]['newPassword'],_0x4995be);})[_0x47a5('0x21')](saveUpdates({'password':_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')],'passwordResetAt':_0x5e2946[_0x47a5('0x33')]['id']==_0x5e2946[_0x47a5('0x5d')]['id']?moment():null},null))['then'](respondWithResult(_0x243c8b,null))[_0x47a5('0x5b')](handleError(_0x243c8b,null));};exports['addQueues']=function(_0x4eb534,_0x5db0ed,_0x21cb5f){var _0x4d23c8=_0x4eb534[_0x47a5('0x61')][_0x47a5('0x91')];return db[_0x47a5('0x42')]['find']({'where':{'id':_0x4eb534[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b'),_0x47a5('0x92'),_0x47a5('0x93'),'voicePause',_0x47a5('0x94')]})[_0x47a5('0x21')](handleEntityNotFound(_0x5db0ed,null))['then'](function(_0x42ba59){if(_0x42ba59){if(!utils[_0x47a5('0x95')](_0x4d23c8)){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x96'));}return _0x42ba59[_0x47a5('0x97')+_['capitalize'](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x99')](_0x4eb534['body'][_0x47a5('0x64')],{'penalty':_0x4eb534[_0x47a5('0x61')][_0x47a5('0x9a')]||0x0})[_0x47a5('0x9b')](function(_0x4ce0ac){for(var _0x4a68b0=0x0;_0x4a68b0<_0x4eb534['body']['ids'][_0x47a5('0x4d')];_0x4a68b0+=0x1){var _0x27793e={'UserId':_0x4eb534[_0x47a5('0x5d')]['id']};_0x27793e[_[_0x47a5('0x9c')](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x9d')]=_0x4eb534[_0x47a5('0x61')][_0x47a5('0x64')][_0x4a68b0];socket['emit'](_0x47a5('0x33')+_[_0x47a5('0x9c')](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x9e'),_0x27793e);}return _0x4ce0ac;})['then'](function(){if(_0x4d23c8==='voice'){return db[_0x47a5('0x9f')]['findAll']({'where':{'id':_0x4eb534['body'][_0x47a5('0x64')]||[]},'raw':!![],'attributes':['id',_0x47a5('0x3d')]});}})['then'](function(_0x148742){var _0x476991=_0x42ba59[_0x47a5('0x32')]({'plain':!![]});var _0x48835f=[];if(_0x4d23c8===_0x47a5('0xa0')&&_0x476991[_0x47a5('0x3b')]==='agent'&&_0x476991[_0x47a5('0x92')]){for(var _0x280b7b=0x0;_0x280b7b<_0x148742[_0x47a5('0x4d')];_0x280b7b+=0x1){_0x48835f[_0x47a5('0xa1')]({'membername':_0x476991[_0x47a5('0x3d')],'UserId':_0x476991['id'],'queue_name':_0x148742[_0x280b7b][_0x47a5('0x3d')],'VoiceQueueId':_0x148742[_0x280b7b]['id'],'interface':_['isNil'](_0x476991[_0x47a5('0x94')])?util['format'](_0x47a5('0xa2'),_0x476991[_0x47a5('0x3d')]):_0x476991[_0x47a5('0x94')],'paused':_0x476991[_0x47a5('0xa3')]||![],'penalty':_0x4eb534['body'][_0x47a5('0x9a')]||0x0});}return BPromise[_0x47a5('0xa4')](_0x48835f,function(_0x151540){return db[_0x47a5('0xa5')][_0x47a5('0xa6')](_0x151540);});}return _0x42ba59;});}})[_0x47a5('0x21')](respondWithStatusCode(_0x5db0ed,null))[_0x47a5('0x5b')](handleError(_0x5db0ed,null));};exports[_0x47a5('0xa7')]=function(_0x1b3e82,_0xa2045c,_0x109738){var _0x301031;return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x1b3e82[_0x47a5('0x5d')]['id']},'attributes':['id','name',_0x47a5('0x3b')]})[_0x47a5('0x21')](handleEntityNotFound(_0xa2045c,null))[_0x47a5('0x21')](function(_0x2ccf21){if(_0x2ccf21){_0x301031=_0x2ccf21;if(!_0x1b3e82[_0x47a5('0x47')]['channel']||!utils[_0x47a5('0x95')](_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x91')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x96'));}return _0x2ccf21[_0x47a5('0xa8')+_['capitalize'](_0x1b3e82['query'][_0x47a5('0x91')]['toLowerCase']())+_0x47a5('0x99')](_0x1b3e82['query'][_0x47a5('0x64')]);}})[_0x47a5('0x21')](function(_0x134c1a){for(var _0x2bc7ae=0x0;_0x2bc7ae<_0x1b3e82['query'][_0x47a5('0x64')][_0x47a5('0x4d')];_0x2bc7ae+=0x1){var _0xaca12c={'UserId':_0x1b3e82['params']['id']};_0xaca12c[_['capitalize'](_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x91')][_0x47a5('0x98')]())+_0x47a5('0x9d')]=_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x64')][_0x2bc7ae];socket[_0x47a5('0xa9')](_0x47a5('0x33')+_['capitalize'](_0x1b3e82[_0x47a5('0x47')]['channel'][_0x47a5('0x98')]())+_0x47a5('0xaa'),_0xaca12c);}return _0x134c1a;})['then'](function(){if(_0x1b3e82['query'][_0x47a5('0x91')]===_0x47a5('0xa0')){return db['UserVoiceQueueRt'][_0x47a5('0x31')]({'where':{'UserId':_0x1b3e82[_0x47a5('0x5d')]['id'],'VoiceQueueId':_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x64')]},'individualHooks':!![]})['then'](function(){return _0x301031;});}return _0x301031;})[_0x47a5('0x21')](respondWithStatusCode(_0xa2045c,null))['catch'](handleError(_0xa2045c,null));};exports['addAvatar']=function(_0x4c3ebb,_0x1e0171,_0x5a975d){_0x4c3ebb[_0x47a5('0x61')][_0x47a5('0xab')]=_0x4c3ebb[_0x47a5('0xac')][_0x47a5('0xad')];return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x4c3ebb[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1e0171,null))[_0x47a5('0x21')](saveUpdates(_0x4c3ebb[_0x47a5('0x61')],null))[_0x47a5('0x21')](respondWithResult(_0x1e0171,null))[_0x47a5('0x5b')](handleError(_0x1e0171,null));};exports[_0x47a5('0xae')]=function(_0x1bfa3b,_0xff64fb,_0x5e17cb){var _0xdd95c8=path[_0x47a5('0xaf')](config[_0x47a5('0xb0')],_0x47a5('0xb1'));return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x1bfa3b['params']['id']},'attributes':['id',_0x47a5('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0xff64fb,null))[_0x47a5('0x21')](function(_0x468b96){if(_0x468b96){if(_[_0x47a5('0x72')](_0x468b96['userpic'])){return _0xff64fb[_0x47a5('0xb2')](_0xdd95c8);}else{if(!fs[_0x47a5('0xb3')](path[_0x47a5('0xaf')](config['root'],'server/files/images/',_0x468b96[_0x47a5('0xab')]))){return _0xff64fb[_0x47a5('0xb2')](_0xdd95c8);}return _0xff64fb[_0x47a5('0xb2')](path[_0x47a5('0xaf')](config[_0x47a5('0xb0')],'server/files/images/',_0x468b96[_0x47a5('0xab')]));}}})['catch'](handleError(_0xff64fb,null));};exports[_0x47a5('0xb4')]=function(_0xdeaf4e,_0x46647f,_0x2d6ae7){var _0x5b18a2={};var _0x4dc67c={};var _0x1a054e;var _0x20034a;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0xdeaf4e[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46647f,null))[_0x47a5('0x21')](function(_0x3ae5b5){if(_0x3ae5b5){_0x1a054e=_0x3ae5b5;_0x4dc67c[_0x47a5('0x4a')]=_['keys'](db['CmContact'][_0x47a5('0x43')]);_0x4dc67c['query']=_[_0x47a5('0x48')](_0xdeaf4e[_0x47a5('0x47')]);_0x4dc67c[_0x47a5('0x51')]=_['intersection'](_0x4dc67c[_0x47a5('0x4a')],_0x4dc67c[_0x47a5('0x47')]);_0x5b18a2['attributes']=_[_0x47a5('0x49')](_0x4dc67c['model'],qs[_0x47a5('0x4b')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x5b18a2['attributes']=_0x5b18a2['attributes']['length']?_0x5b18a2['attributes']:_0x4dc67c['model'];_0x5b18a2[_0x47a5('0xb5')]=qs['sort'](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x5b18a2['where']=qs['filters'](_['pick'](_0xdeaf4e[_0x47a5('0x47')],_0x4dc67c['filters']));if(_0xdeaf4e['query']['filter']){_0x5b18a2[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5b18a2[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x5b18a2['attributes'],function(_0xdda046){var _0x559943={};_0x559943[_0xdda046]={'$like':'%'+_0xdeaf4e[_0x47a5('0x47')]['filter']+'%'};return _0x559943;})});}_0x5b18a2=_[_0x47a5('0x52')]({},_0x5b18a2,_0xdeaf4e[_0x47a5('0x5f')]);return _0x1a054e[_0x47a5('0xb4')](_0x5b18a2);}})['then'](function(_0x106bbe){if(_0x106bbe){_0x20034a=_0x106bbe[_0x47a5('0x4d')];if(_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4e')]('includeAll')){_0x5b18a2[_0x47a5('0x59')]=[{'model':db[_0x47a5('0xb7')],'as':_0x47a5('0xb8'),'required':![]},{'model':db[_0x47a5('0xb9')],'as':_0x47a5('0xba'),'attributes':['id',_0x47a5('0x3d'),'color'],'where':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]?{'id':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]}:undefined,'required':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]?!![]:![]}];}if(!_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x5b18a2[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5b18a2[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x1a054e['getContacts'](_0x5b18a2);}})[_0x47a5('0x21')](function(_0x5ee5c5){if(_0x5ee5c5){return _0x5ee5c5?{'count':_0x20034a,'rows':_0x5ee5c5}:null;}})['then'](respondWithResult(_0x46647f,null))[_0x47a5('0x5b')](handleError(_0x46647f,null));};exports[_0x47a5('0xbc')]=function(_0x36f910,_0x4d4039,_0x1f8e28){var _0xd8381b;var _0x101459;var _0x3e8fce={};var _0x30e5fb;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x36f910[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b')]})[_0x47a5('0x21')](handleEntityNotFound(_0x4d4039,null))[_0x47a5('0x21')](function(_0x203bc9){if(!utils['isValidChannel'](_0x36f910['query'][_0x47a5('0x91')])){throw new db['Sequelize'][(_0x47a5('0x1f'))](_0x47a5('0x96'));}_0xd8381b=_0x203bc9;var _0x1f776e={};_0x1f776e[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0xbd')][_0x47a5('0x43')]);_0x1f776e['query']=_[_0x47a5('0x48')](_0x36f910[_0x47a5('0x47')]);_0x1f776e[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x1f776e[_0x47a5('0x4a')],_0x1f776e[_0x47a5('0x47')]);_0x3e8fce[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x1f776e[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x36f910[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x3e8fce[_0x47a5('0x4c')]=_0x3e8fce[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x3e8fce[_0x47a5('0x4c')]:_0x1f776e[_0x47a5('0x4a')];_0x3e8fce[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x36f910[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x3e8fce[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x36f910['query'],_0x1f776e[_0x47a5('0x51')]));if(_0x36f910[_0x47a5('0x47')][_0x47a5('0x36')]){_0x3e8fce[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3e8fce[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x3e8fce[_0x47a5('0x4c')],function(_0x478e46){var _0x25fdca={};_0x25fdca[_0x478e46]={'$like':'%'+_0x36f910[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x25fdca;})});}_0x3e8fce=_['merge']({},_0x3e8fce,_0x36f910[_0x47a5('0x5f')]);switch(_0xd8381b[_0x47a5('0x3b')]){case _0x47a5('0x67'):return db[_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0xbd')][_0x47a5('0x5a')](_0x3e8fce);case _0x47a5('0x33'):case'agent':return _0xd8381b[_0x47a5('0x32')+_['capitalize'](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0x99')](_0x3e8fce);default:throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unknown\x20role');}})[_0x47a5('0x21')](function(_0xe3f0d7){_0x30e5fb=_0xe3f0d7[_0x47a5('0x4d')];if(!_0x36f910[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x3e8fce['limit']=qs[_0x47a5('0x2e')](_0x36f910[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x3e8fce[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x36f910['query'][_0x47a5('0x2d')]);}switch(_0xd8381b['role']){case _0x47a5('0x67'):return db[_['capitalize'](_0x36f910[_0x47a5('0x47')]['channel'])+'Queue'][_0x47a5('0x5a')](_0x3e8fce);case _0x47a5('0x33'):case'agent':return _0xd8381b[_0x47a5('0x32')+_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0x99')](_0x3e8fce);}})[_0x47a5('0x21')](function(_0x508622){return{'count':_0x30e5fb,'rows':_0x508622};})[_0x47a5('0x21')](respondWithResult(_0x4d4039,null))[_0x47a5('0x5b')](handleError(_0x4d4039,null));};exports[_0x47a5('0xbf')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={};var _0x2678cb={};var _0x56808d;var _0x13449b;return db[_0x47a5('0x42')]['findOne']({'where':{'id':_0x30b0f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x37721c,null))['then'](function(_0x1e38ce){if(_0x1e38ce){_0x56808d=_0x1e38ce;_0x2678cb[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_0x47a5('0xa5')][_0x47a5('0x43')]);_0x2678cb[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x30b0f9['query']);_0x2678cb[_0x47a5('0x51')]=_['intersection'](_0x2678cb[_0x47a5('0x4a')],_0x2678cb[_0x47a5('0x47')]);_0x5973d4[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x2678cb[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x5973d4[_0x47a5('0x4c')]=_0x5973d4[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x5973d4[_0x47a5('0x4c')]:_0x2678cb['model'];_0x5973d4[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x30b0f9[_0x47a5('0x47')]['sort']);_0x5973d4[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x30b0f9[_0x47a5('0x47')],_0x2678cb[_0x47a5('0x51')]));if(_0x30b0f9[_0x47a5('0x47')]['filter']){_0x5973d4[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5973d4[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x5973d4[_0x47a5('0x4c')],function(_0x3c80d7){var _0x42a384={};_0x42a384[_0x3c80d7]={'$like':'%'+_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x42a384;})});}_0x5973d4=_[_0x47a5('0x52')]({},_0x5973d4,_0x30b0f9['options']);return _0x56808d['getVoiceQueuesRt'](_0x5973d4);}})[_0x47a5('0x21')](function(_0x144524){if(_0x144524){_0x13449b=_0x144524[_0x47a5('0x4d')];if(!_0x30b0f9['query'][_0x47a5('0x4e')]('nolimit')){_0x5973d4['limit']=qs[_0x47a5('0x2e')](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs['offset'](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x56808d['getVoiceQueuesRt'](_0x5973d4);}})['then'](function(_0x50a2e4){if(_0x50a2e4){return _0x50a2e4?{'count':_0x13449b,'rows':_0x50a2e4}:null;}})[_0x47a5('0x21')](respondWithResult(_0x37721c,null))[_0x47a5('0x5b')](handleError(_0x37721c,null));};exports[_0x47a5('0xc0')]=function(_0x3c1a63,_0x1d2a59,_0x4c555c){var _0x5391aa={};var _0x362e82={};var _0x1b0fd4;var _0x3a0c7b;return db[_0x47a5('0x42')]['findOne']({'where':{'id':_0x3c1a63[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1d2a59,null))[_0x47a5('0x21')](function(_0x57a70d){if(_0x57a70d){_0x1b0fd4=_0x57a70d;_0x362e82['model']=_['keys'](db['ChatGroup'][_0x47a5('0x43')]);_0x362e82[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x3c1a63[_0x47a5('0x47')]);_0x362e82[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x362e82[_0x47a5('0x4a')],_0x362e82[_0x47a5('0x47')]);_0x5391aa[_0x47a5('0x4c')]=_['intersection'](_0x362e82[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x3c1a63['query'][_0x47a5('0x4b')]));_0x5391aa[_0x47a5('0x4c')]=_0x5391aa[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x5391aa['attributes']:_0x362e82[_0x47a5('0x4a')];_0x5391aa[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x3c1a63['query']['sort']);_0x5391aa[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x3c1a63['query'],_0x362e82[_0x47a5('0x51')]));if(_0x3c1a63[_0x47a5('0x47')][_0x47a5('0x36')]){_0x5391aa[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5391aa['where'],{'$or':_['map'](_0x5391aa[_0x47a5('0x4c')],function(_0x2797b9){var _0x9e8f05={};_0x9e8f05[_0x2797b9]={'$like':'%'+_0x3c1a63[_0x47a5('0x47')]['filter']+'%'};return _0x9e8f05;})});}_0x5391aa=_['merge']({},_0x5391aa,_0x3c1a63[_0x47a5('0x5f')]);return _0x1b0fd4['getGroups'](_0x5391aa);}})[_0x47a5('0x21')](function(_0x5c9ddd){if(_0x5c9ddd){_0x3a0c7b=_0x5c9ddd[_0x47a5('0x4d')];if(!_0x3c1a63['query'][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x5391aa[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3c1a63[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5391aa[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x3c1a63['query'][_0x47a5('0x2d')]);}return _0x1b0fd4[_0x47a5('0xc0')](_0x5391aa);}})['then'](function(_0x34f93d){if(_0x34f93d){return _0x34f93d?{'count':_0x3a0c7b,'rows':_0x34f93d}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1d2a59,null))['catch'](handleError(_0x1d2a59,null));};exports['getRecordings']=function(_0x330065,_0x55c4ae,_0x457634){var _0x181b57={'raw':!![],'where':{}};var _0x268c9c={};var _0x4f8b87={'count':0x0,'rows':[]};return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x330065[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x55c4ae,null))[_0x47a5('0x21')](function(_0x454609){if(_0x454609){_0x268c9c[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0xc1')][_0x47a5('0x43')]);_0x268c9c[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x330065[_0x47a5('0x47')]);_0x268c9c[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x268c9c['model'],_0x268c9c['query']);_0x181b57[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x268c9c[_0x47a5('0x4a')],qs['fields'](_0x330065['query'][_0x47a5('0x4b')]));_0x181b57[_0x47a5('0x4c')]=_0x181b57[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x181b57[_0x47a5('0x4c')]:_0x268c9c[_0x47a5('0x4a')];if(!_0x330065[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x181b57[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x330065['query'][_0x47a5('0x2e')]);_0x181b57[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x330065[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x181b57[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x330065[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x181b57[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x330065[_0x47a5('0x47')],_0x268c9c['filters']));_0x181b57[_0x47a5('0x50')]['UserId']=_0x454609['id'];if(_0x330065[_0x47a5('0x47')]['filter']){_0x181b57[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x181b57[_0x47a5('0x50')],{'$or':_['map'](_0x181b57[_0x47a5('0x4c')],function(_0x4aba8c){var _0x23667e={};_0x23667e[_0x4aba8c]={'$like':'%'+_0x330065[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x23667e;})});}_0x181b57=_[_0x47a5('0x52')]({},_0x181b57,_0x330065['options']);return db[_0x47a5('0xc1')]['count']({'where':_0x181b57['where']})[_0x47a5('0x21')](function(_0x15e970){_0x4f8b87[_0x47a5('0x57')]=_0x15e970;if(_0x330065[_0x47a5('0x47')][_0x47a5('0x58')]){_0x181b57[_0x47a5('0x59')]=[{'all':!![]}];}return db[_0x47a5('0xc1')][_0x47a5('0x5a')](_0x181b57);})[_0x47a5('0x21')](function(_0x598c19){_0x4f8b87['rows']=_0x598c19;return _0x4f8b87;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x55c4ae,_0x181b57))[_0x47a5('0x5b')](handleError(_0x55c4ae,null));};exports[_0x47a5('0xc2')]=function(_0x349166,_0x616b88,_0x4da0df){var _0x3cfa62={'raw':!![],'where':{}};var _0x3dbd9a={};var _0x16bcec={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x349166[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x616b88,null))['then'](function(_0x145286){if(_0x145286){_0x3dbd9a[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db['ScreenRecording'][_0x47a5('0x43')]);_0x3dbd9a[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x349166[_0x47a5('0x47')]);_0x3dbd9a[_0x47a5('0x51')]=_['intersection'](_0x3dbd9a[_0x47a5('0x4a')],_0x3dbd9a[_0x47a5('0x47')]);_0x3cfa62[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x3dbd9a['model'],qs['fields'](_0x349166[_0x47a5('0x47')]['fields']));_0x3cfa62[_0x47a5('0x4c')]=_0x3cfa62[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x3cfa62[_0x47a5('0x4c')]:_0x3dbd9a[_0x47a5('0x4a')];if(!_0x349166[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x3cfa62[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x349166['query']['limit']);_0x3cfa62[_0x47a5('0x2d')]=qs['offset'](_0x349166[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x3cfa62[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x349166[_0x47a5('0x47')]['sort']);_0x3cfa62['where']=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x349166[_0x47a5('0x47')],_0x3dbd9a[_0x47a5('0x51')]));_0x3cfa62[_0x47a5('0x50')]['UserId']=_0x145286['id'];if(_0x349166[_0x47a5('0x47')][_0x47a5('0x36')]){_0x3cfa62[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3cfa62[_0x47a5('0x50')],{'$or':_['map'](_0x3cfa62[_0x47a5('0x4c')],function(_0x171b0a){var _0xed859f={};_0xed859f[_0x171b0a]={'$like':'%'+_0x349166[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0xed859f;})});}_0x3cfa62=_[_0x47a5('0x52')]({},_0x3cfa62,_0x349166[_0x47a5('0x5f')]);return db[_0x47a5('0xc3')][_0x47a5('0x57')]({'where':_0x3cfa62[_0x47a5('0x50')]})[_0x47a5('0x21')](function(_0x5a6f09){_0x16bcec[_0x47a5('0x57')]=_0x5a6f09;if(_0x349166[_0x47a5('0x47')][_0x47a5('0x58')]){_0x3cfa62[_0x47a5('0x59')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x3cfa62);})['then'](function(_0x269086){_0x16bcec['rows']=_0x269086;return _0x16bcec;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x616b88,_0x3cfa62))[_0x47a5('0x5b')](handleError(_0x616b88,null));};exports['getChatInteractions']=function(_0x10c01f,_0x1d8538,_0x1ec47a){var _0x58bef7={};var _0x457398={};var _0x515ef0;var _0x2beef2;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x10c01f[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1d8538,null))[_0x47a5('0x21')](function(_0x4adfda){if(_0x4adfda){_0x515ef0=_0x4adfda;_0x457398['model']=_['keys'](db[_0x47a5('0xc4')][_0x47a5('0x43')]);_0x457398[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x10c01f[_0x47a5('0x47')]);_0x457398[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x457398[_0x47a5('0x4a')],_0x457398[_0x47a5('0x47')]);_0x58bef7[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x457398[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x10c01f[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x58bef7[_0x47a5('0x4c')]=_0x58bef7['attributes'][_0x47a5('0x4d')]?_0x58bef7[_0x47a5('0x4c')]:_0x457398[_0x47a5('0x4a')];_0x58bef7[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x10c01f[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x58bef7[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x10c01f['query'],_0x457398[_0x47a5('0x51')]));if(_0x10c01f[_0x47a5('0x47')]['filter']){_0x58bef7[_0x47a5('0x50')]=_['merge'](_0x58bef7[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x58bef7[_0x47a5('0x4c')],function(_0x27834d){var _0x374a81={};_0x374a81[_0x27834d]={'$like':'%'+_0x10c01f['query'][_0x47a5('0x36')]+'%'};return _0x374a81;})});}_0x58bef7=_[_0x47a5('0x52')]({},_0x58bef7,_0x10c01f[_0x47a5('0x5f')]);return _0x515ef0['getChatInteractions'](_0x58bef7);}})['then'](function(_0x1e75b9){if(_0x1e75b9){_0x2beef2=_0x1e75b9[_0x47a5('0x4d')];if(!_0x10c01f[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x58bef7[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x10c01f['query'][_0x47a5('0x2e')]);_0x58bef7[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x10c01f[_0x47a5('0x47')]['offset']);}return _0x515ef0[_0x47a5('0xc5')](_0x58bef7);}})['then'](function(_0x1a1570){if(_0x1a1570){return _0x1a1570?{'count':_0x2beef2,'rows':_0x1a1570}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1d8538,null))[_0x47a5('0x5b')](handleError(_0x1d8538,null));};exports[_0x47a5('0xc6')]=function(_0x5b7656,_0x1203f9,_0x147d77){var _0x402eb6={};var _0xed80c4={};var _0x46a2bd;var _0x4c2b0c;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x5b7656[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1203f9,null))[_0x47a5('0x21')](function(_0x3d4398){if(_0x3d4398){_0x46a2bd=_0x3d4398;_0xed80c4['model']=_[_0x47a5('0x48')](db[_0x47a5('0xc7')]['rawAttributes']);_0xed80c4['query']=_[_0x47a5('0x48')](_0x5b7656[_0x47a5('0x47')]);_0xed80c4[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0xed80c4[_0x47a5('0x4a')],_0xed80c4[_0x47a5('0x47')]);_0x402eb6['attributes']=_['intersection'](_0xed80c4[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x5b7656['query'][_0x47a5('0x4b')]));_0x402eb6[_0x47a5('0x4c')]=_0x402eb6['attributes'][_0x47a5('0x4d')]?_0x402eb6['attributes']:_0xed80c4['model'];_0x402eb6['order']=qs[_0x47a5('0xb6')](_0x5b7656[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x402eb6['where']=qs[_0x47a5('0x51')](_['pick'](_0x5b7656[_0x47a5('0x47')],_0xed80c4['filters']));if(_0x5b7656[_0x47a5('0x47')][_0x47a5('0x36')]){_0x402eb6[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x402eb6[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x402eb6[_0x47a5('0x4c')],function(_0x15d573){var _0x1396c2={};_0x1396c2[_0x15d573]={'$like':'%'+_0x5b7656['query'][_0x47a5('0x36')]+'%'};return _0x1396c2;})});}_0x402eb6=_[_0x47a5('0x52')]({},_0x402eb6,_0x5b7656[_0x47a5('0x5f')]);return _0x46a2bd['getOpenchannelInteractions'](_0x402eb6);}})[_0x47a5('0x21')](function(_0x1bd422){if(_0x1bd422){_0x4c2b0c=_0x1bd422[_0x47a5('0x4d')];if(!_0x5b7656[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x402eb6[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x5b7656[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x402eb6['offset']=qs['offset'](_0x5b7656['query']['offset']);}return _0x46a2bd[_0x47a5('0xc6')](_0x402eb6);}})['then'](function(_0x2330ae){if(_0x2330ae){return _0x2330ae?{'count':_0x4c2b0c,'rows':_0x2330ae}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1203f9,null))['catch'](handleError(_0x1203f9,null));};exports[_0x47a5('0xc8')]=function(_0x157ca3,_0x41ee22,_0x375c67){var _0x2cbf08={'raw':!![],'where':{}};var _0x1b3a60={};var _0x4a759c={'count':0x0,'rows':[]};return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x157ca3['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x41ee22,null))['then'](function(_0x412f6a){if(_0x412f6a){_0x1b3a60[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_0x47a5('0xc9')][_0x47a5('0x43')]);_0x1b3a60[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x157ca3['query']);_0x1b3a60[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x1b3a60['model'],_0x1b3a60[_0x47a5('0x47')]);_0x2cbf08[_0x47a5('0x4c')]=_['intersection'](_0x1b3a60[_0x47a5('0x4a')],qs['fields'](_0x157ca3[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x2cbf08[_0x47a5('0x4c')]=_0x2cbf08[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x2cbf08['attributes']:_0x1b3a60['model'];if(!_0x157ca3[_0x47a5('0x47')]['hasOwnProperty']('nolimit')){_0x2cbf08['limit']=qs[_0x47a5('0x2e')](_0x157ca3['query'][_0x47a5('0x2e')]);_0x2cbf08[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x157ca3['query']['offset']);}_0x2cbf08[_0x47a5('0xb5')]=qs['sort'](_0x157ca3['query'][_0x47a5('0xb6')]);_0x2cbf08['where']=qs['filters'](_[_0x47a5('0xbe')](_0x157ca3[_0x47a5('0x47')],_0x1b3a60['filters']));_0x2cbf08[_0x47a5('0x50')][_0x47a5('0xca')]=_0x412f6a['id'];if(_0x157ca3[_0x47a5('0x47')][_0x47a5('0x36')]){_0x2cbf08[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x2cbf08['where'],{'$or':_[_0x47a5('0x38')](_0x2cbf08[_0x47a5('0x4c')],function(_0x4641b1){var _0x26a3ad={};_0x26a3ad[_0x4641b1]={'$like':'%'+_0x157ca3['query'][_0x47a5('0x36')]+'%'};return _0x26a3ad;})});}_0x2cbf08=_[_0x47a5('0x52')]({},_0x2cbf08,_0x157ca3[_0x47a5('0x5f')]);return db['MailInteraction'][_0x47a5('0x57')]({'where':_0x2cbf08['where']})['then'](function(_0x187de4){_0x4a759c[_0x47a5('0x57')]=_0x187de4;if(_0x157ca3['query']['includeAll']){_0x2cbf08['include']=[{'all':!![]}];}return db[_0x47a5('0xc9')][_0x47a5('0x5a')](_0x2cbf08);})['then'](function(_0x462ac5){_0x4a759c['rows']=_0x462ac5;return _0x4a759c;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x41ee22,_0x2cbf08))[_0x47a5('0x5b')](handleError(_0x41ee22,null));};exports['getSmsInteractions']=function(_0x1528d2,_0x307d7f,_0x5f2507){var _0x3fbd67={};var _0x5bca81={};var _0x447c32;var _0x46ae21;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x1528d2[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x307d7f,null))[_0x47a5('0x21')](function(_0x1ebfcd){if(_0x1ebfcd){_0x447c32=_0x1ebfcd;_0x5bca81['model']=_[_0x47a5('0x48')](db[_0x47a5('0xcb')][_0x47a5('0x43')]);_0x5bca81[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x1528d2['query']);_0x5bca81[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x5bca81['model'],_0x5bca81[_0x47a5('0x47')]);_0x3fbd67[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x5bca81[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x1528d2['query'][_0x47a5('0x4b')]));_0x3fbd67['attributes']=_0x3fbd67['attributes'][_0x47a5('0x4d')]?_0x3fbd67['attributes']:_0x5bca81[_0x47a5('0x4a')];_0x3fbd67[_0x47a5('0xb5')]=qs['sort'](_0x1528d2[_0x47a5('0x47')]['sort']);_0x3fbd67[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x1528d2[_0x47a5('0x47')],_0x5bca81[_0x47a5('0x51')]));if(_0x1528d2[_0x47a5('0x47')]['filter']){_0x3fbd67[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3fbd67[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x3fbd67[_0x47a5('0x4c')],function(_0x1c0230){var _0x69b145={};_0x69b145[_0x1c0230]={'$like':'%'+_0x1528d2[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x69b145;})});}_0x3fbd67=_[_0x47a5('0x52')]({},_0x3fbd67,_0x1528d2[_0x47a5('0x5f')]);return _0x447c32[_0x47a5('0xcc')](_0x3fbd67);}})[_0x47a5('0x21')](function(_0x3f5f4c){if(_0x3f5f4c){_0x46ae21=_0x3f5f4c[_0x47a5('0x4d')];if(!_0x1528d2[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x3fbd67['limit']=qs[_0x47a5('0x2e')](_0x1528d2[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x3fbd67[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x1528d2[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x447c32[_0x47a5('0xcc')](_0x3fbd67);}})['then'](function(_0x247099){if(_0x247099){return _0x247099?{'count':_0x46ae21,'rows':_0x247099}:null;}})['then'](respondWithResult(_0x307d7f,null))[_0x47a5('0x5b')](handleError(_0x307d7f,null));};exports[_0x47a5('0xcd')]=function(_0x22bc01,_0x15245f,_0x7d41dd){var _0x58edf5={};var _0x7eed9d={};var _0x1faf8f;var _0x2668fb;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x22bc01[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x15245f,null))[_0x47a5('0x21')](function(_0x4123ca){if(_0x4123ca){_0x1faf8f=_0x4123ca;_0x7eed9d[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0xce')][_0x47a5('0x43')]);_0x7eed9d['query']=_[_0x47a5('0x48')](_0x22bc01[_0x47a5('0x47')]);_0x7eed9d[_0x47a5('0x51')]=_['intersection'](_0x7eed9d['model'],_0x7eed9d[_0x47a5('0x47')]);_0x58edf5[_0x47a5('0x4c')]=_['intersection'](_0x7eed9d[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x22bc01[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x58edf5[_0x47a5('0x4c')]=_0x58edf5[_0x47a5('0x4c')]['length']?_0x58edf5[_0x47a5('0x4c')]:_0x7eed9d['model'];_0x58edf5[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x22bc01[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x58edf5[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x22bc01[_0x47a5('0x47')],_0x7eed9d['filters']));if(_0x22bc01[_0x47a5('0x47')]['filter']){_0x58edf5[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x58edf5[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x58edf5[_0x47a5('0x4c')],function(_0x225aff){var _0x17e8fd={};_0x17e8fd[_0x225aff]={'$like':'%'+_0x22bc01['query'][_0x47a5('0x36')]+'%'};return _0x17e8fd;})});}_0x58edf5=_[_0x47a5('0x52')]({},_0x58edf5,_0x22bc01[_0x47a5('0x5f')]);return _0x1faf8f[_0x47a5('0xcd')](_0x58edf5);}})[_0x47a5('0x21')](function(_0x38ac56){if(_0x38ac56){_0x2668fb=_0x38ac56[_0x47a5('0x4d')];if(!_0x22bc01['query'][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x58edf5[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x22bc01['query']['limit']);_0x58edf5[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x22bc01[_0x47a5('0x47')]['offset']);}return _0x1faf8f[_0x47a5('0xcd')](_0x58edf5);}})[_0x47a5('0x21')](function(_0x5173c4){if(_0x5173c4){return _0x5173c4?{'count':_0x2668fb,'rows':_0x5173c4}:null;}})['then'](respondWithResult(_0x15245f,null))[_0x47a5('0x5b')](handleError(_0x15245f,null));};exports[_0x47a5('0xcf')]=function(_0x3a01a8,_0x58767a,_0x4b3955){var _0xbe4d48;var _0x3f93f6;var _0x394c88;var _0x509b44=!_[_0x47a5('0x72')](_0x3a01a8[_0x47a5('0x5d')]['id'])?_0x3a01a8[_0x47a5('0x5d')]['id']:!_['isNil'](_0x3a01a8[_0x47a5('0x33')]['id'])?_0x3a01a8['user']['id']:null;return db[_0x47a5('0x42')]['find']({'where':{'id':_0x509b44,'role':{'$or':[_0x47a5('0x67'),_0x47a5('0x33'),_0x47a5('0x34')]}},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0xd0'),_0x47a5('0xd1'),_0x47a5('0x3b'),_0x47a5('0x6d'),_0x47a5('0x93')]})[_0x47a5('0x21')](function(_0x5822a1){if(_0x5822a1){if(_0x5822a1[_0x47a5('0x3b')]===_0x47a5('0x34')){_0xbe4d48=_0x5822a1;if(_0x3a01a8[_0x47a5('0x61')][_0x47a5('0x94')]){_0x394c88=util[_0x47a5('0xd2')](_0x47a5('0xd3'),_0xbe4d48[_0x3a01a8[_0x47a5('0x61')][_0x47a5('0x94')]]);}else if(_0x3a01a8[_0x47a5('0x61')]['intrf']){_0x394c88=util[_0x47a5('0xd2')]('SIP/%s',_0x3a01a8[_0x47a5('0x61')]['intrf']);}else{_0x394c88=util[_0x47a5('0xd2')]('SIP/%s',_0xbe4d48['name']);}socket['to'](util[_0x47a5('0xd2')]('user:%s',_0xbe4d48['name']))[_0x47a5('0xa9')](_0x47a5('0xd4'),{'ip':_0x3a01a8[_0x47a5('0xd5')]['x-forwarded-for']||_0x3a01a8[_0x47a5('0xd6')]['remoteAddress']||_0x3a01a8[_0x47a5('0xd7')]['remoteAddress']||_0x3a01a8[_0x47a5('0xd6')][_0x47a5('0xd7')]['remoteAddress']});return db[_0x47a5('0xa5')][_0x47a5('0x31')]({'where':{'membername':_0xbe4d48['name']},'individualHooks':!![]});}}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0xbe4d48){return _0xbe4d48[_0x47a5('0xd8')]({'raw':!![]});}})[_0x47a5('0x21')](function(_0x219fad){if(_0xbe4d48){var _0x3d3ecc=[];if(_0x219fad){_0x3f93f6=_0x219fad;if(_0x3f93f6[_0x47a5('0x4d')]){for(var _0x58c85c=0x0;_0x58c85c<_0x3f93f6[_0x47a5('0x4d')];_0x58c85c++){_0x3d3ecc[_0x47a5('0xa1')]({'membername':_0xbe4d48[_0x47a5('0x3d')],'UserId':_0xbe4d48['id'],'queue_name':_0x3f93f6[_0x58c85c][_0x47a5('0x3d')],'VoiceQueueId':_0x3f93f6[_0x58c85c]['id'],'interface':_0x394c88,'paused':_0xbe4d48[_0x47a5('0x93')]||![],'penalty':_0x3f93f6[_0x58c85c][_0x47a5('0xd9')]||0x0});}return BPromise[_0x47a5('0xa4')](_0x3d3ecc,function(_0x2cb7bc){return db['UserVoiceQueueRt']['upsert'](_0x2cb7bc);});}}}})[_0x47a5('0x21')](function(){if(_0xbe4d48){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0xbe4d48[_0x47a5('0x3d')],'exitAt':null}});}})['then'](function(_0x26fa54){if(_0xbe4d48){var _0x597b10=[];_0x26fa54[_0x47a5('0xdb')](function(_0x4e2798){_0x597b10['push'](_0x4e2798[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))}));});return BPromise['all'](_0x597b10);}})[_0x47a5('0x21')](function(){if(_0xbe4d48){var _0x2f35d7=[];var _0x4eee42=[];var _0x293db4=utils[_0x47a5('0xdd')]();var _0x1ce2ab={'membername':_0xbe4d48[_0x47a5('0x3d')],'interface':_0x394c88,'enterAt':moment()['format'](_0x47a5('0xdc')),'role':_0xbe4d48['role'],'internal':_0xbe4d48[_0x47a5('0x6d')]};_0x293db4['forEach'](function(_0x272d3f){_0x2f35d7[_0x47a5('0xa1')](_[_0x47a5('0x52')]({'channel':_0x272d3f,'type':'LOGIN','data1':_0x3a01a8[_0x47a5('0x61')][_0x47a5('0xde')],'data2':_0x394c88},_0x1ce2ab));if(_0xbe4d48[_0x47a5('0x93')]){_0x4eee42['push'](_[_0x47a5('0x52')]({'channel':_0x272d3f,'type':_0x47a5('0xdf'),'data1':_0x47a5('0xe0')},_0x1ce2ab));}});return db[_0x47a5('0xda')]['bulkCreate'](_0x2f35d7['concat'](_0x4eee42),{'individualHooks':!![]});}})[_0x47a5('0x21')](function(){if(_0xbe4d48){return _0xbe4d48[_0x47a5('0x30')]({'online':!![],'lastLoginAt':moment()['format'](_0x47a5('0xdc')),'voicePause':_0xbe4d48['loginInPause']||![],'mailPause':_0xbe4d48[_0x47a5('0x93')]||![],'chatPause':_0xbe4d48[_0x47a5('0x93')]||![],'faxPause':_0xbe4d48[_0x47a5('0x93')]||![],'smsPause':_0xbe4d48[_0x47a5('0x93')]||![],'openchannelPause':_0xbe4d48[_0x47a5('0x93')]||![],'pauseType':_0xbe4d48[_0x47a5('0x93')]?'LOGININPAUSE':null,'interface':_0x394c88,'lastPauseAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))});}})[_0x47a5('0x21')](function(_0x4c4887){if(_0x3a01a8[_0x47a5('0xe1')]){return _0x4b3955();}else{return BPromise[_0x47a5('0xe2')](_0x4c4887)[_0x47a5('0x21')](respondWithResult(_0x58767a,null));}})[_0x47a5('0x5b')](handleError(_0x58767a,null));};exports[_0x47a5('0xe3')]=function(_0x45f55f,_0x1fa671,_0x52c4b0){var _0x214b20;return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x45f55f[_0x47a5('0x5d')]['id'],'role':'agent'},'attributes':['id','name','role']})[_0x47a5('0x21')](handleEntityNotFound(_0x1fa671,null))[_0x47a5('0x21')](function(_0x3a4ed1){if(_0x3a4ed1){_0x214b20=_0x3a4ed1;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x214b20[_0x47a5('0x3d')]},'individualHooks':!![]});}})[_0x47a5('0x21')](function(){return db[_0x47a5('0xda')][_0x47a5('0x5a')]({'where':{'membername':_0x214b20[_0x47a5('0x3d')],'exitAt':null}});})['then'](function(_0x24e2db){var _0x401fa2=[];_0x24e2db[_0x47a5('0xdb')](function(_0x1afd4f){_0x401fa2[_0x47a5('0xa1')](_0x1afd4f[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))}));});return BPromise[_0x47a5('0xe4')](_0x401fa2);})['then'](function(){return _0x214b20[_0x47a5('0x30')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x47a5('0x21')](respondWithResult(_0x1fa671,null))[_0x47a5('0x5b')](handleError(_0x1fa671,null));};exports[_0x47a5('0xe5')]=function(_0xc91abd,_0x5411d9,_0x13fbff){var _0x4691da;return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x1},{'where':{'UserId':_0xc91abd['params']['id']},'individualHooks':!![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0x42')]['find']({'where':{'id':_0xc91abd[_0x47a5('0x5d')]['id'],'role':_0x47a5('0x34')},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b'),_0x47a5('0x6d'),_0x47a5('0x94')]});})['then'](handleEntityNotFound(_0x5411d9,null))[_0x47a5('0x21')](function(_0x7a562d){if(_0x7a562d){_0x4691da=_0x7a562d;return respondWithRpcPromise('QueuePause','pause',{'id':_0x4691da['id'],'name':_0x4691da['name'],'pause':!![]});}})[_0x47a5('0x21')](function(){if(_0x4691da){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0x4691da[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}});}})['then'](function(_0x1d50e6){if(_0x1d50e6[_0x47a5('0x4d')]){var _0x10b205=moment()[_0x47a5('0xd2')](_0x47a5('0xdc'));for(var _0x5eb17b=0x0,_0x3886ef=_0x1d50e6['length'];_0x5eb17b<_0x3886ef;_0x5eb17b++){_0x1d50e6[_0x5eb17b][_0x47a5('0xe6')]({'exitAt':_0x10b205});}}})['then'](function(){var _0x2e392c=[];var _0x20a276=utils['getChannels']();_0x20a276['forEach'](function(_0x4c271d){_0x2e392c[_0x47a5('0xa1')]({'channel':_0x4c271d,'membername':_0x4691da[_0x47a5('0x3d')],'interface':_[_0x47a5('0x72')](_0x4691da['interface'])?util[_0x47a5('0xd2')](_0x47a5('0xa2'),_0x4691da[_0x47a5('0x3d')]):_0x4691da[_0x47a5('0x94')],'type':_0x47a5('0xdf'),'enterAt':moment()[_0x47a5('0xd2')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xc91abd[_0x47a5('0x61')]['type']||_0x47a5('0xe7'),'role':_0x4691da[_0x47a5('0x3b')],'internal':_0x4691da[_0x47a5('0x6d')]});});return db['MemberReport'][_0x47a5('0x60')](_0x2e392c,{'individualHooks':!![]});})[_0x47a5('0x21')](function(){return _0x4691da[_0x47a5('0x30')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xc91abd[_0x47a5('0x61')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))});})[_0x47a5('0x21')](respondWithResult(_0x5411d9,null))[_0x47a5('0x5b')](handleError(_0x5411d9,null));};exports['unpause']=function(_0x3d67f2,_0xc1fbd,_0x1b8fe1){var _0x477b0a;return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x3d67f2[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),'role',_0x47a5('0xa3'),'mailPause',_0x47a5('0xe8'),'faxPause',_0x47a5('0xe9'),_0x47a5('0xea'),_0x47a5('0xeb'),_0x47a5('0xec')]})[_0x47a5('0x21')](handleEntityNotFound(_0xc1fbd,null))[_0x47a5('0x21')](function(_0x332861){if(_0x332861){_0x477b0a=_0x332861;if(_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')]&&!utils[_0x47a5('0x95')](_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unknown\x20channel');}switch(_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')]){case _0x47a5('0xa0'):return respondWithRpcPromise(_0x47a5('0xed'),_0x47a5('0xee'),{'id':_0x477b0a['id'],'name':_0x477b0a['name'],'pause':![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x0},{'where':{'UserId':_0x477b0a['id']},'individualHooks':!![]});})[_0x47a5('0x21')](function(){return db['MemberReport'][_0x47a5('0x3c')]({'where':{'channel':_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')],'membername':_0x477b0a['name'],'type':_0x47a5('0xdf'),'exitAt':null}});})[_0x47a5('0x21')](function(_0x220bbc){if(_0x220bbc){return _0x220bbc[_0x47a5('0x30')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x47a5('0xef')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x477b0a[_0x47a5('0x30')]({'voicePause':![]});});case _0x47a5('0xf0'):case _0x47a5('0xf1'):case _0x47a5('0xf2'):case'sms':case _0x47a5('0xf3'):return db['MemberReport'][_0x47a5('0x3c')]({'where':{'channel':_0x3d67f2['body'][_0x47a5('0x91')],'membername':_0x477b0a[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}})[_0x47a5('0x21')](function(_0x28b7c5){if(_0x28b7c5){return _0x28b7c5[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x47a5('0xef')},{'individualHooks':!![]});}return null;})[_0x47a5('0x21')](function(){var _0x34827f={};_[_0x47a5('0xf4')](_0x34827f,util[_0x47a5('0xd2')](_0x47a5('0xf5'),_0x3d67f2['body'][_0x47a5('0x91')],_0x47a5('0xf6')),![]);return _0x477b0a[_0x47a5('0x30')](_0x34827f);});default:return respondWithRpcPromise(_0x47a5('0xed'),'unpause',{'id':_0x477b0a['id'],'name':_0x477b0a[_0x47a5('0x3d')],'pause':![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x0},{'where':{'UserId':_0x477b0a['id']}});})[_0x47a5('0x21')](function(){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0x477b0a[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}});})['then'](function(_0xf49931){var _0x3fdc24=[];_0xf49931[_0x47a5('0xdb')](function(_0x4aaac3){_0x3fdc24[_0x47a5('0xa1')](_0x4aaac3['update']({'exitAt':moment()['format'](_0x47a5('0xdc')),'data2':_0x47a5('0xef')}));});return BPromise[_0x47a5('0xe4')](_0x3fdc24);})[_0x47a5('0x21')](function(){return _0x477b0a['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0xc1fbd,null))[_0x47a5('0x5b')](handleError(_0xc1fbd,null));};exports[_0x47a5('0xf7')]=function(_0x110692,_0x542be5,_0x2273ad){var _0x540856={};var _0x266b23={};var _0x37ee58;var _0x5f4c9b;return db['User'][_0x47a5('0x88')]({'where':{'id':_0x110692['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x542be5,null))[_0x47a5('0x21')](function(_0xb112ff){if(_0xb112ff){_0x37ee58=_0xb112ff;_0x266b23['model']=_[_0x47a5('0x48')](db['Team'][_0x47a5('0x43')]);_0x266b23[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x110692[_0x47a5('0x47')]);_0x266b23[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x266b23[_0x47a5('0x4a')],_0x266b23[_0x47a5('0x47')]);_0x540856['attributes']=_[_0x47a5('0x49')](_0x266b23[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x110692[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x540856[_0x47a5('0x4c')]=_0x540856[_0x47a5('0x4c')]['length']?_0x540856[_0x47a5('0x4c')]:_0x266b23[_0x47a5('0x4a')];_0x540856[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x110692[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x540856[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x110692[_0x47a5('0x47')],_0x266b23[_0x47a5('0x51')]));if(_0x110692[_0x47a5('0x47')][_0x47a5('0x36')]){_0x540856[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x540856[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x540856[_0x47a5('0x4c')],function(_0x221166){var _0x4a91f3={};_0x4a91f3[_0x221166]={'$like':'%'+_0x110692['query']['filter']+'%'};return _0x4a91f3;})});}_0x540856=_[_0x47a5('0x52')]({},_0x540856,_0x110692[_0x47a5('0x5f')]);return _0x37ee58[_0x47a5('0xf7')](_0x540856);}})['then'](function(_0x5bc8ec){if(_0x5bc8ec){_0x5f4c9b=_0x5bc8ec[_0x47a5('0x4d')];if(!_0x110692[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x540856[_0x47a5('0x2e')]=qs['limit'](_0x110692[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x540856[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x110692[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x37ee58[_0x47a5('0xf7')](_0x540856);}})[_0x47a5('0x21')](function(_0x3bd433){if(_0x3bd433){return _0x3bd433?{'count':_0x5f4c9b,'rows':_0x3bd433}:null;}})[_0x47a5('0x21')](respondWithResult(_0x542be5,null))[_0x47a5('0x5b')](handleError(_0x542be5,null));};exports['addTeams']=function(_0x51d725,_0x56ae6a){return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x51d725[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x56ae6a,null))[_0x47a5('0x21')](function(_0x3e80b7){if(_0x3e80b7){var _0x2e7341=_0x3e80b7['get']({'plain':!![]});return _0x3e80b7[_0x47a5('0xf8')](_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')],_[_0x47a5('0x65')](_0x51d725[_0x47a5('0x61')],['ids','id'])||{})[_0x47a5('0x21')](function(){for(var _0x4456b2=0x0;_0x4456b2<_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')][_0x47a5('0x4d')];_0x4456b2++){var _0x4013b0=[];db['Team'][_0x47a5('0x88')]({'where':{'id':_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')][_0x4456b2]}})[_0x47a5('0x21')](function(_0x5ed8b7){_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xd8')]()[_0x47a5('0x21')](function(_0x4cedc2){for(var _0x5b62ef=0x0;_0x5b62ef<_0x4cedc2[_0x47a5('0x4d')];_0x5b62ef++){_0x4cedc2[_0x5b62ef]['setDataValue'](_0x47a5('0x91'),_0x47a5('0xf9'));}return _0x4cedc2;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfa')]()[_0x47a5('0x21')](function(_0x2ff028){for(var _0x375f3d=0x0;_0x375f3d<_0x2ff028[_0x47a5('0x4d')];_0x375f3d++){_0x2ff028[_0x375f3d][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xfc'));}return _0x2ff028;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfd')]()['then'](function(_0x42e9ac){for(var _0x3a4c03=0x0;_0x3a4c03<_0x42e9ac[_0x47a5('0x4d')];_0x3a4c03++){_0x42e9ac[_0x3a4c03][_0x47a5('0xfb')](_0x47a5('0x91'),'Mail');}return _0x42e9ac;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfe')]()['then'](function(_0x397a3a){for(var _0x389d99=0x0;_0x389d99<_0x397a3a[_0x47a5('0x4d')];_0x389d99++){_0x397a3a[_0x389d99]['setDataValue'](_0x47a5('0x91'),_0x47a5('0xff'));}return _0x397a3a;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0x100')]()[_0x47a5('0x21')](function(_0x3673d9){for(var _0x347777=0x0;_0x347777<_0x3673d9['length'];_0x347777++){_0x3673d9[_0x347777][_0x47a5('0xfb')]('channel',_0x47a5('0x101'));}return _0x3673d9;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0x102')]()[_0x47a5('0x21')](function(_0x4233b4){for(var _0x33b9a8=0x0;_0x33b9a8<_0x4233b4[_0x47a5('0x4d')];_0x33b9a8++){_0x4233b4[_0x33b9a8][_0x47a5('0xfb')]('channel','Openchannel');}return _0x4233b4;}));return BPromise['all'](_0x4013b0);})[_0x47a5('0x21')](function(_0x157b95){var _0x55d2fe=_['flatten'](_0x157b95);_0x4013b0=[];return db[_0x47a5('0x54')][_0x47a5('0x103')](function(_0x96a85e){for(var _0x43ad6f=0x0;_0x43ad6f<_0x55d2fe['length'];_0x43ad6f++){_0x4013b0['push'](_0x55d2fe[_0x43ad6f]['addAgent'](_0x2e7341['id']),{'transaction':_0x96a85e});}return BPromise[_0x47a5('0xe4')](_0x4013b0)[_0x47a5('0x21')](function(){if(_0x2e7341[_0x47a5('0x92')]){return BPromise['each'](_[_0x47a5('0x36')](_0x55d2fe,function(_0x40c37a){return _0x40c37a[_0x47a5('0x104')]('channel')===_0x47a5('0xf9');}),function(_0x2cd01e){return db[_0x47a5('0xa5')][_0x47a5('0xa6')]({'membername':_0x2e7341['name'],'UserId':_0x2e7341['id'],'queue_name':_0x2cd01e['name'],'VoiceQueueId':_0x2cd01e['id'],'interface':_['isNil'](_0x2e7341[_0x47a5('0x94')])?util[_0x47a5('0xd2')](_0x47a5('0xa2'),_0x2e7341[_0x47a5('0x3d')]):_0x2e7341['interface'],'paused':_0x2e7341[_0x47a5('0xa3')]||![],'penalty':_0x2e7341[_0x47a5('0x9a')]},{'transaction':_0x96a85e});});}else{return;}})[_0x47a5('0x21')](function(){for(var _0x174e97=0x0;_0x174e97<_0x55d2fe[_0x47a5('0x4d')];_0x174e97++){var _0x59e7ac=_0x55d2fe[_0x174e97][_0x47a5('0x104')](_0x47a5('0x91'));var _0x3067a6=_0x59e7ac+_0x47a5('0x9d');socket[_0x47a5('0xa9')]('user'+_0x59e7ac+_0x47a5('0x9e'),{'UserId':_0x2e7341['id'],['queueField']:_0x55d2fe[_0x174e97]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x56ae6a,null))[_0x47a5('0x5b')](handleError(_0x56ae6a,null));};exports[_0x47a5('0x105')]=function(_0x2a6f95,_0x1cd13){return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x2a6f95['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1cd13,null))['then'](function(_0x539be9){if(_0x539be9){var _0x78040f=_0x539be9['get']({'plain':!![]});var _0x52b7ac=_0x2a6f95[_0x47a5('0x47')][_0x47a5('0x64')];return _0x539be9[_0x47a5('0x105')](_0x52b7ac)['then'](function(){for(var _0x5177ec=0x0;_0x5177ec<_0x52b7ac[_0x47a5('0x4d')];_0x5177ec++){var _0x21f34f=[];db[_0x47a5('0x106')]['findOne']({'where':{'id':_0x52b7ac[_0x5177ec]}})[_0x47a5('0x21')](function(_0x502d6a){_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xd8')]()[_0x47a5('0x21')](function(_0x45d525){for(var _0x4f3d20=0x0;_0x4f3d20<_0x45d525[_0x47a5('0x4d')];_0x4f3d20++){_0x45d525[_0x4f3d20][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xf9'));}return _0x45d525;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xfa')]()[_0x47a5('0x21')](function(_0xc787a6){for(var _0x148464=0x0;_0x148464<_0xc787a6[_0x47a5('0x4d')];_0x148464++){_0xc787a6[_0x148464]['setDataValue']('channel',_0x47a5('0xfc'));}return _0xc787a6;}));_0x21f34f['push'](_0x502d6a[_0x47a5('0xfd')]()[_0x47a5('0x21')](function(_0x16cfed){for(var _0x5630d2=0x0;_0x5630d2<_0x16cfed[_0x47a5('0x4d')];_0x5630d2++){_0x16cfed[_0x5630d2][_0x47a5('0xfb')]('channel','Mail');}return _0x16cfed;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xfe')]()['then'](function(_0x164ceb){for(var _0x16f7d6=0x0;_0x16f7d6<_0x164ceb['length'];_0x16f7d6++){_0x164ceb[_0x16f7d6][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xff'));}return _0x164ceb;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0x100')]()[_0x47a5('0x21')](function(_0x44bab7){for(var _0x5e6a83=0x0;_0x5e6a83<_0x44bab7[_0x47a5('0x4d')];_0x5e6a83++){_0x44bab7[_0x5e6a83][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0x101'));}return _0x44bab7;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a['getOpenchannelQueues']()['then'](function(_0x3a0c77){for(var _0x53f771=0x0;_0x53f771<_0x3a0c77[_0x47a5('0x4d')];_0x53f771++){_0x3a0c77[_0x53f771][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0x107'));}return _0x3a0c77;}));return BPromise[_0x47a5('0xe4')](_0x21f34f);})[_0x47a5('0x21')](function(_0x5d6bd9){var _0x40bee3=_[_0x47a5('0x108')](_0x5d6bd9);_0x21f34f=[];return db[_0x47a5('0x54')][_0x47a5('0x103')](function(_0x27d543){for(var _0x28c8b2=0x0;_0x28c8b2<_0x40bee3[_0x47a5('0x4d')];_0x28c8b2++){_0x21f34f[_0x47a5('0xa1')](_0x40bee3[_0x28c8b2][_0x47a5('0x109')](_0x78040f['id']),{'transaction':_0x27d543});}return BPromise['all'](_0x21f34f)[_0x47a5('0x21')](function(){if(_0x78040f[_0x47a5('0x92')]){return BPromise[_0x47a5('0xa4')](_[_0x47a5('0x36')](_0x40bee3,function(_0xf2a1f6){return _0xf2a1f6[_0x47a5('0x104')](_0x47a5('0x91'))==='Voice';}),function(_0x181b62){return db[_0x47a5('0xa5')][_0x47a5('0x31')]({'where':{'VoiceQueueId':_0x181b62['id'],'UserId':_0x78040f['id']},'transaction':_0x27d543});});}else{return;}})[_0x47a5('0x21')](function(){for(var _0x8b0c50=0x0;_0x8b0c50<_0x40bee3[_0x47a5('0x4d')];_0x8b0c50++){var _0x4b3dee=_0x40bee3[_0x8b0c50][_0x47a5('0x104')](_0x47a5('0x91'));var _0x1911a8=_0x4b3dee+_0x47a5('0x9d');socket['emit']('user'+_0x4b3dee+'Queue:remove',{'UserId':_0x78040f['id'],['queueField']:_0x40bee3[_0x8b0c50]['id']});}});});});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x1cd13,null))[_0x47a5('0x5b')](handleError(_0x1cd13,null));};exports[_0x47a5('0x10a')]=function(_0x140311,_0x55a2e3,_0x44da0c){var _0x557632={};var _0x44d91e={};var _0x5b133e;var _0x154e18;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x140311['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x55a2e3,null))[_0x47a5('0x21')](function(_0x2b919b){if(_0x2b919b){_0x5b133e=_0x2b919b;_0x44d91e[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db['CmList'][_0x47a5('0x43')]);_0x44d91e[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x140311['query']);_0x44d91e[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x44d91e[_0x47a5('0x4a')],_0x44d91e[_0x47a5('0x47')]);_0x557632['attributes']=_['intersection'](_0x44d91e[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x140311[_0x47a5('0x47')]['fields']));_0x557632[_0x47a5('0x4c')]=_0x557632[_0x47a5('0x4c')]['length']?_0x557632[_0x47a5('0x4c')]:_0x44d91e['model'];_0x557632[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x140311[_0x47a5('0x47')]['sort']);_0x557632[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x140311[_0x47a5('0x47')],_0x44d91e['filters']));if(_0x140311[_0x47a5('0x47')]['filter']){_0x557632[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x557632[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x557632[_0x47a5('0x4c')],function(_0x327287){var _0x105bf4={};_0x105bf4[_0x327287]={'$like':'%'+_0x140311['query'][_0x47a5('0x36')]+'%'};return _0x105bf4;})});}_0x557632=_[_0x47a5('0x52')]({},_0x557632,_0x140311[_0x47a5('0x5f')]);return _0x5b133e['getLists'](_0x557632);}})['then'](function(_0x244ad1){if(_0x244ad1){_0x154e18=_0x244ad1[_0x47a5('0x4d')];if(!_0x140311[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x557632[_0x47a5('0x2e')]=qs['limit'](_0x140311[_0x47a5('0x47')]['limit']);_0x557632[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x140311['query'][_0x47a5('0x2d')]);}return _0x5b133e[_0x47a5('0x10a')](_0x557632);}})[_0x47a5('0x21')](function(_0xf33ce7){if(_0xf33ce7){return _0xf33ce7?{'count':_0x154e18,'rows':_0xf33ce7}:null;}})['then'](respondWithResult(_0x55a2e3,null))['catch'](handleError(_0x55a2e3,null));};exports[_0x47a5('0x10b')]=function(_0x5d4843,_0x1f5f9a,_0x5b52ef){var _0x13d821={};var _0x5035d9={};var _0x314d50;var _0x2780a9;return db['User'][_0x47a5('0x88')]({'where':{'id':_0x5d4843[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1f5f9a,null))[_0x47a5('0x21')](function(_0x4410c4){if(_0x4410c4){_0x314d50=_0x4410c4;_0x5035d9[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0x42')][_0x47a5('0x43')]);_0x5035d9[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x5d4843[_0x47a5('0x47')]);_0x5035d9[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x5035d9[_0x47a5('0x4a')],_0x5035d9['query']);_0x13d821['attributes']=_[_0x47a5('0x49')](_0x5035d9[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x5d4843['query'][_0x47a5('0x4b')]));_0x13d821[_0x47a5('0x4c')]=_0x13d821[_0x47a5('0x4c')]['length']?_0x13d821[_0x47a5('0x4c')]:_0x5035d9[_0x47a5('0x4a')];_0x13d821[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x5d4843['query'][_0x47a5('0xb6')]);_0x13d821[_0x47a5('0x50')]=qs['filters'](_['pick'](_0x5d4843[_0x47a5('0x47')],_0x5035d9['filters']));if(_0x5d4843[_0x47a5('0x47')][_0x47a5('0x36')]){_0x13d821[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x13d821['where'],{'$or':_[_0x47a5('0x38')](_0x13d821[_0x47a5('0x4c')],function(_0x3c6d55){var _0x2022cf={};_0x2022cf[_0x3c6d55]={'$like':'%'+_0x5d4843[_0x47a5('0x47')]['filter']+'%'};return _0x2022cf;})});}_0x13d821[_0x47a5('0x4a')]=db[_0x47a5('0x42')];_0x13d821['as']='Agents';_0x13d821=_[_0x47a5('0x52')]({},_0x13d821,_0x5d4843[_0x47a5('0x5f')]);return _0x314d50['getVoiceQueues']({'include':[_0x13d821]});}})[_0x47a5('0x21')](function(_0x20d637){if(_0x20d637){var _0x3d67f8={},_0x53f444=[],_0x4e558d=0x0;for(var _0x13e1da=0x0;_0x13e1da<_0x20d637[_0x47a5('0x4d')];_0x13e1da+=0x1){for(var _0xf6f823=0x0,_0x162fc1;_0xf6f823<_0x20d637[_0x13e1da][_0x47a5('0x10c')][_0x47a5('0x4d')];_0xf6f823+=0x1){_0x162fc1=_0x20d637[_0x13e1da][_0x47a5('0x10c')][_0xf6f823][_0x47a5('0x32')]({'plain':!![]});_0x3d67f8[_0x162fc1['id']]=_0x162fc1;}}_0x3d67f8=_[_0x47a5('0x10d')](_0x3d67f8);for(var _0x3122b5=qs[_0x47a5('0x2d')](_0x5d4843[_0x47a5('0x47')]['offset']);_0x3122b5<_0x3d67f8[_0x47a5('0x4d')]&&_0x53f444['length']=_0x36e7b8['agents']){throw new Error(_0xe46a('0x4e'));}})[_0xe46a('0x1d')](function(){if(_0x154ac4){return db[_0xe46a('0x3a')][_0xe46a('0x44')]({'where':{'membername':_0x154ac4['name']},'individualHooks':!![]});}})[_0xe46a('0x1d')](function(){if(_0x154ac4){return _0x154ac4['getVoiceQueues']({'raw':!![]});}})[_0xe46a('0x1d')](function(_0x465725){if(_0x154ac4){if(_0x465725){var _0x5ea16e=[];_0x255f9a=_0x465725;if(_0x255f9a[_0xe46a('0x2b')]){for(var _0x58b793=0x0;_0x58b793<_0x255f9a['length'];_0x58b793++){_0x5ea16e[_0xe46a('0x30')](db[_0xe46a('0x3a')][_0xe46a('0x4f')]({'membername':_0x154ac4[_0xe46a('0x29')],'UserId':_0x154ac4['id'],'queue_name':_0x255f9a[_0x58b793][_0xe46a('0x29')],'VoiceQueueId':_0x255f9a[_0x58b793]['id'],'interface':_0x323d53,'paused':_0x154ac4[_0xe46a('0x48')]||![],'penalty':_0x255f9a[_0x58b793][_0xe46a('0x50')]||0x0}));}return BPromise[_0xe46a('0x45')](_0x5ea16e);}}}})['then'](function(){if(_0x154ac4){return db['MemberReport']['findAll']({'where':{'membername':_0x154ac4[_0xe46a('0x29')],'exitAt':null}});}})[_0xe46a('0x1d')](function(_0x5836a7){if(_0x154ac4){if(_0x5836a7&&_0x5836a7['length']){var _0xfae7dc=[];_0x5836a7[_0xe46a('0x2f')](function(_0x354c34){_0xfae7dc[_0xe46a('0x30')](_0x354c34[_0xe46a('0x27')]({'exitAt':moment()[_0xe46a('0x2c')](_0xe46a('0x2d'))}));});return BPromise[_0xe46a('0x45')](_0xfae7dc);}}})[_0xe46a('0x1d')](function(_0x5185a2){if(_0x154ac4){var _0x295940=[];var _0x3f0021=[];var _0x316c4b=utils[_0xe46a('0x51')]();var _0x310c31={'membername':_0x154ac4[_0xe46a('0x29')],'interface':_0x323d53,'enterAt':moment()[_0xe46a('0x2c')](_0xe46a('0x2d')),'role':_0x154ac4[_0xe46a('0x34')],'internal':_0x154ac4[_0xe46a('0x25')]};_0x316c4b[_0xe46a('0x2f')](function(_0x2ac3d6){_0x295940[_0xe46a('0x30')](_[_0xe46a('0x52')]({'channel':_0x2ac3d6,'type':_0xe46a('0x53'),'data1':_0xe46a('0x54'),'data2':_0x323d53},_0x310c31));if(_0x154ac4[_0xe46a('0x48')]){_0x3f0021[_0xe46a('0x30')](_[_0xe46a('0x52')]({'channel':_0x2ac3d6,'type':_0xe46a('0x2a'),'data1':'LOGININPAUSE'},_0x310c31));}});return db[_0xe46a('0x28')][_0xe46a('0x36')](_0x295940[_0xe46a('0x55')](_0x3f0021),{'individualHooks':!![]});}})['then'](function(){if(_0x154ac4){return _0x154ac4[_0xe46a('0x27')]({'online':!![],'lastLoginAt':moment()[_0xe46a('0x2c')](_0xe46a('0x2d')),'voicePause':_0x154ac4['loginInPause']||![],'mailPause':_0x154ac4[_0xe46a('0x48')]||![],'chatPause':_0x154ac4[_0xe46a('0x48')]||![],'faxPause':_0x154ac4[_0xe46a('0x48')]||![],'smsPause':_0x154ac4[_0xe46a('0x48')]||![],'openchannelPause':_0x154ac4[_0xe46a('0x48')]||![],'pauseType':_0x154ac4['loginInPause']?_0xe46a('0x56'):null,'lastPauseAt':moment()['format'](_0xe46a('0x2d')),'interface':_0x323d53});}})[_0xe46a('0x1d')](function(_0x1845da){_0x18d9a9(_0x1845da);})[_0xe46a('0x15')](function(_0x3bcdcb){_0x27171c(_0x5a71f4['error'](0x1f4,_0x3bcdcb[_0xe46a('0x13')]));});});}; \ No newline at end of file +var _0xbddc=['register','request','then','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','result','catch','User','findAll','options','raw','where','attributes','limit','include','map','model','info','GetUser','stringify','find','ShowUser','PauseUser','name','role','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','push','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','channel','isValidChannel','Unknown\x20channel','system','chat','fax','sms','%s%s','Pause','LogoutUser','destroy','forEach','all','LoginUser','findOne','mobile','phone','internal','loginInPause','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueue.penalty','getChannels','merge','LOGIN','concat','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./user.socket'];(function(_0x3c4b15,_0x445e23){var _0x588d94=function(_0x198541){while(--_0x198541){_0x3c4b15['push'](_0x3c4b15['shift']());}};_0x588d94(++_0x445e23);}(_0xbddc,0x102));var _0xcbdd=function(_0x127efc,_0x1fce2b){_0x127efc=_0x127efc-0x0;var _0xb324e4=_0xbddc[_0x127efc];return _0xb324e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcbdd('0x0'));var BPromise=require(_0xcbdd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbdd('0x2'));var db=require(_0xcbdd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbdd('0x4'))(_0xcbdd('0x5'));var config=require(_0xcbdd('0x6'));var jayson=require(_0xcbdd('0x7'));var client=jayson[_0xcbdd('0x8')][_0xcbdd('0x9')]({'port':0x232a});config['redis']=_[_0xcbdd('0xa')](config[_0xcbdd('0xb')],{'host':_0xcbdd('0xc'),'port':0x18eb});var socket=require(_0xcbdd('0xd'))(new Redis(config['redis']));require(_0xcbdd('0xe'))[_0xcbdd('0xf')](socket);function respondWithRpcPromise(_0x38a87f,_0x3d2385,_0x34e17){return new BPromise(function(_0xd16215,_0x3ffbe9){return client[_0xcbdd('0x10')](_0x38a87f,_0x34e17)[_0xcbdd('0x11')](function(_0x2008be){logger['info']('User,\x20%s,\x20%s',_0x3d2385,_0xcbdd('0x12'));logger[_0xcbdd('0x13')](_0xcbdd('0x14'),_0x3d2385,_0xcbdd('0x12'),JSON['stringify'](_0x2008be));if(_0x2008be[_0xcbdd('0x15')]){if(_0x2008be[_0xcbdd('0x15')][_0xcbdd('0x16')]===0x1f4){logger['error'](_0xcbdd('0x17'),_0x3d2385,_0x2008be[_0xcbdd('0x15')][_0xcbdd('0x18')]);return _0x3ffbe9(_0x2008be[_0xcbdd('0x15')][_0xcbdd('0x18')]);}logger[_0xcbdd('0x15')](_0xcbdd('0x17'),_0x3d2385,_0x2008be[_0xcbdd('0x15')]['message']);return _0xd16215(_0x2008be[_0xcbdd('0x15')][_0xcbdd('0x18')]);}else{logger['info'](_0xcbdd('0x17'),_0x3d2385,_0xcbdd('0x12'));_0xd16215(_0x2008be[_0xcbdd('0x19')][_0xcbdd('0x18')]);}})[_0xcbdd('0x1a')](function(_0xdde449){logger[_0xcbdd('0x15')](_0xcbdd('0x17'),_0x3d2385,_0xdde449);_0x3ffbe9(_0xdde449);});});}exports['GetUser']=function(_0x2708f6){var _0x5cab49=this;return new Promise(function(_0x47c6c8,_0x36defc){return db[_0xcbdd('0x1b')][_0xcbdd('0x1c')]({'raw':_0x2708f6[_0xcbdd('0x1d')]?_0x2708f6[_0xcbdd('0x1d')][_0xcbdd('0x1e')]===undefined?!![]:![]:!![],'where':_0x2708f6[_0xcbdd('0x1d')]?_0x2708f6['options'][_0xcbdd('0x1f')]||null:null,'attributes':_0x2708f6[_0xcbdd('0x1d')]?_0x2708f6[_0xcbdd('0x1d')][_0xcbdd('0x20')]||null:null,'limit':_0x2708f6[_0xcbdd('0x1d')]?_0x2708f6['options'][_0xcbdd('0x21')]||null:null,'include':_0x2708f6[_0xcbdd('0x1d')]?_0x2708f6[_0xcbdd('0x1d')][_0xcbdd('0x22')]?_[_0xcbdd('0x23')](_0x2708f6[_0xcbdd('0x1d')][_0xcbdd('0x22')],function(_0x1d589d){return{'model':db[_0x1d589d[_0xcbdd('0x24')]],'as':_0x1d589d['as'],'attributes':_0x1d589d[_0xcbdd('0x20')],'include':_0x1d589d[_0xcbdd('0x22')]?_[_0xcbdd('0x23')](_0x1d589d[_0xcbdd('0x22')],function(_0x5a6f56){return{'model':db[_0x5a6f56[_0xcbdd('0x24')]],'as':_0x5a6f56['as'],'attributes':_0x5a6f56[_0xcbdd('0x20')],'include':_0x5a6f56[_0xcbdd('0x22')]?_[_0xcbdd('0x23')](_0x5a6f56['include'],function(_0xcc5911){return{'model':db[_0xcc5911[_0xcbdd('0x24')]],'as':_0xcc5911['as'],'attributes':_0xcc5911[_0xcbdd('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x565558){logger[_0xcbdd('0x25')](_0xcbdd('0x26'),_0x2708f6);logger['debug'](_0xcbdd('0x26'),_0x2708f6,JSON[_0xcbdd('0x27')](_0x565558));_0x47c6c8(_0x565558);})[_0xcbdd('0x1a')](function(_0x2d5f82){logger[_0xcbdd('0x15')](_0xcbdd('0x26'),_0x2d5f82['message'],_0x2708f6);_0x36defc(_0x5cab49[_0xcbdd('0x15')](0x1f4,_0x2d5f82[_0xcbdd('0x18')]));});});};exports['ShowUser']=function(_0x2df1a6){var _0x1b1d22=this;return new Promise(function(_0x17bda8,_0x1fe08f){return db['User'][_0xcbdd('0x28')]({'raw':_0x2df1a6[_0xcbdd('0x1d')]?_0x2df1a6[_0xcbdd('0x1d')][_0xcbdd('0x1e')]===undefined?!![]:![]:!![],'where':_0x2df1a6['options']?_0x2df1a6[_0xcbdd('0x1d')][_0xcbdd('0x1f')]||null:null,'attributes':_0x2df1a6[_0xcbdd('0x1d')]?_0x2df1a6['options'][_0xcbdd('0x20')]||null:null,'include':_0x2df1a6['options']?_0x2df1a6['options'][_0xcbdd('0x22')]?_[_0xcbdd('0x23')](_0x2df1a6[_0xcbdd('0x1d')][_0xcbdd('0x22')],function(_0x2e4763){return{'model':db[_0x2e4763[_0xcbdd('0x24')]],'as':_0x2e4763['as'],'attributes':_0x2e4763[_0xcbdd('0x20')],'include':_0x2e4763[_0xcbdd('0x22')]?_['map'](_0x2e4763['include'],function(_0x1ad9dc){return{'model':db[_0x1ad9dc[_0xcbdd('0x24')]],'as':_0x1ad9dc['as'],'attributes':_0x1ad9dc[_0xcbdd('0x20')],'include':_0x1ad9dc[_0xcbdd('0x22')]?_[_0xcbdd('0x23')](_0x1ad9dc[_0xcbdd('0x22')],function(_0x20b43c){return{'model':db[_0x20b43c[_0xcbdd('0x24')]],'as':_0x20b43c['as'],'attributes':_0x20b43c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xa4d9fb){logger['info']('ShowUser',_0x2df1a6);logger[_0xcbdd('0x13')]('ShowUser',_0x2df1a6,JSON[_0xcbdd('0x27')](_0xa4d9fb));_0x17bda8(_0xa4d9fb);})[_0xcbdd('0x1a')](function(_0x4fc251){logger[_0xcbdd('0x15')](_0xcbdd('0x29'),_0x4fc251['message'],_0x2df1a6);_0x1fe08f(_0x1b1d22[_0xcbdd('0x15')](0x1f4,_0x4fc251[_0xcbdd('0x18')]));});});};exports[_0xcbdd('0x2a')]=function(_0x48bf45){var _0x5a4db9=this;return new Promise(function(_0x464ca8,_0x2b1d7d){var _0x4964b7;return db[_0xcbdd('0x1b')]['find']({'where':_0x48bf45[_0xcbdd('0x1d')]['where']||{},'attributes':['id',_0xcbdd('0x2b'),_0xcbdd('0x2c'),'internal','interface']})[_0xcbdd('0x11')](function(_0x4008b6){if(_0x4008b6){_0x4964b7=_0x4008b6;return db[_0xcbdd('0x2d')][_0xcbdd('0x2e')]({'paused':0x1},{'where':{'UserId':_0x4964b7['id']},'individualHooks':!![]});}})['then'](function(){if(_0x4964b7){return db[_0xcbdd('0x2f')][_0xcbdd('0x1c')]({'where':{'membername':_0x4964b7[_0xcbdd('0x2b')],'type':_0xcbdd('0x30'),'exitAt':null}});}})[_0xcbdd('0x11')](function(_0x5de4cb){if(_0x4964b7){if(_0x5de4cb&&_0x5de4cb[_0xcbdd('0x31')]){var _0x1ed185=moment()[_0xcbdd('0x32')](_0xcbdd('0x33'));for(var _0x5b6065=0x0,_0xfc2b80=_0x5de4cb[_0xcbdd('0x31')];_0x5b6065<_0xfc2b80;_0x5b6065++){_0x5de4cb[_0x5b6065][_0xcbdd('0x34')]({'exitAt':_0x1ed185});}}}})[_0xcbdd('0x11')](function(){if(_0x4964b7){var _0x2cc2fb=[];var _0x1a0bb7=utils['getChannels']();_0x1a0bb7['forEach'](function(_0x4921be){_0x2cc2fb[_0xcbdd('0x35')]({'channel':_0x4921be,'membername':_0x4964b7['name'],'interface':_[_0xcbdd('0x36')](_0x4964b7[_0xcbdd('0x37')])?util[_0xcbdd('0x32')](_0xcbdd('0x38'),_0x4964b7[_0xcbdd('0x2b')]):_0x4964b7['interface'],'type':_0xcbdd('0x30'),'enterAt':moment()[_0xcbdd('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x48bf45[_0xcbdd('0x39')][_0xcbdd('0x3a')]||_0xcbdd('0x3b'),'role':_0x4964b7[_0xcbdd('0x2c')],'internal':_0x4964b7['internal'],'uniqueid':_0x48bf45[_0xcbdd('0x39')][_0xcbdd('0x3c')]||null});});return db[_0xcbdd('0x2f')][_0xcbdd('0x3d')](_0x2cc2fb,{'individualHooks':!![]});}})[_0xcbdd('0x11')](function(){if(_0x4964b7){return _0x4964b7[_0xcbdd('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x48bf45[_0xcbdd('0x39')]['type']||_0xcbdd('0x3b'),'lastPauseAt':moment()[_0xcbdd('0x32')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xcbdd('0x11')](function(_0xbdcaab){_0x464ca8(_0xbdcaab);})[_0xcbdd('0x1a')](function(_0x430806){_0x2b1d7d(_0x5a4db9[_0xcbdd('0x15')](0x1f4,_0x430806[_0xcbdd('0x18')]));});});};exports[_0xcbdd('0x3e')]=function(_0x1775e4){var _0x20df0d=this;return new Promise(function(_0x17983f,_0x3e1b04){var _0x34075a;return db['User']['findOne']({'where':_0x1775e4[_0xcbdd('0x1d')][_0xcbdd('0x1f')]||{},'attributes':['id','name']})[_0xcbdd('0x11')](function(_0x1567e7){if(_0x1567e7){_0x34075a=_0x1567e7;if(_0x1775e4['body'][_0xcbdd('0x3f')]&&!utils[_0xcbdd('0x40')](_0x1775e4[_0xcbdd('0x39')][_0xcbdd('0x3f')])){throw new Error(_0xcbdd('0x41'));}switch(_0x1775e4[_0xcbdd('0x39')]['channel']){case'voice':return db[_0xcbdd('0x2d')][_0xcbdd('0x2e')]({'paused':0x0},{'where':{'UserId':_0x34075a['id']}})[_0xcbdd('0x11')](function(){return db[_0xcbdd('0x2f')][_0xcbdd('0x28')]({'where':{'channel':_0x1775e4['body'][_0xcbdd('0x3f')],'membername':_0x34075a[_0xcbdd('0x2b')],'type':_0xcbdd('0x30'),'exitAt':null}});})[_0xcbdd('0x11')](function(_0x977aff){if(_0x977aff){return _0x977aff['update']({'exitAt':moment()[_0xcbdd('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xcbdd('0x42')},{'individualHooks':!![]});}return null;})[_0xcbdd('0x11')](function(){return _0x34075a[_0xcbdd('0x2e')]({'voicePause':![]});});case'mail':case _0xcbdd('0x43'):case _0xcbdd('0x44'):case _0xcbdd('0x45'):case'openchannel':return db[_0xcbdd('0x2f')][_0xcbdd('0x28')]({'where':{'channel':_0x1775e4[_0xcbdd('0x39')][_0xcbdd('0x3f')],'membername':_0x34075a['name'],'type':_0xcbdd('0x30'),'exitAt':null}})[_0xcbdd('0x11')](function(_0x3f7408){return _0x3f7408[_0xcbdd('0x2e')]({'exitAt':moment()[_0xcbdd('0x32')](_0xcbdd('0x33')),'data2':_0xcbdd('0x42')},{'individualHooks':!![]});})['then'](function(){var _0x104337={};_['set'](_0x104337,util[_0xcbdd('0x32')](_0xcbdd('0x46'),_0x1775e4[_0xcbdd('0x39')][_0xcbdd('0x3f')],_0xcbdd('0x47')),![]);return _0x34075a['update'](_0x104337);});default:return db[_0xcbdd('0x2d')][_0xcbdd('0x2e')]({'paused':0x0},{'where':{'UserId':_0x34075a['id']}})[_0xcbdd('0x11')](function(){return db[_0xcbdd('0x2f')]['findAll']({'where':{'membername':_0x34075a[_0xcbdd('0x2b')],'type':_0xcbdd('0x30'),'exitAt':null}});})[_0xcbdd('0x11')](function(_0x2659e3){var _0x507947=[];_0x2659e3['forEach'](function(_0x4407f6){_0x507947[_0xcbdd('0x35')](_0x4407f6[_0xcbdd('0x2e')]({'exitAt':moment()[_0xcbdd('0x32')](_0xcbdd('0x33')),'data2':_0xcbdd('0x42')}));});return BPromise['all'](_0x507947);})[_0xcbdd('0x11')](function(){return _0x34075a[_0xcbdd('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xcbdd('0x11')](function(_0x5428c8){_0x17983f(_0x5428c8);})[_0xcbdd('0x1a')](function(_0xee9e89){_0x3e1b04(_0x20df0d[_0xcbdd('0x15')](0x1f4,_0xee9e89[_0xcbdd('0x18')]));});});};exports[_0xcbdd('0x48')]=function(_0x1cf75d){var _0x5e7971=this;return new Promise(function(_0x3e53b9,_0x36e907){var _0x40f14f;return db['User']['findOne']({'where':_0x1cf75d['options']['where']||{},'attributes':['id','name']})[_0xcbdd('0x11')](function(_0x3b1495){if(_0x3b1495){_0x40f14f=_0x3b1495;return db[_0xcbdd('0x2d')][_0xcbdd('0x49')]({'where':{'membername':_0x40f14f[_0xcbdd('0x2b')]},'individualHooks':!![]});}})[_0xcbdd('0x11')](function(){if(_0x40f14f){return db['MemberReport'][_0xcbdd('0x1c')]({'where':{'membername':_0x40f14f[_0xcbdd('0x2b')],'exitAt':null}});}})['then'](function(_0x31316e){if(_0x40f14f){if(_0x31316e&&_0x31316e['length']){var _0x25e6a8=[];_0x31316e[_0xcbdd('0x4a')](function(_0x2698d0){_0x25e6a8['push'](_0x2698d0[_0xcbdd('0x2e')]({'exitAt':moment()[_0xcbdd('0x32')](_0xcbdd('0x33'))}));});return BPromise[_0xcbdd('0x4b')](_0x25e6a8);}}})[_0xcbdd('0x11')](function(){if(_0x40f14f){return _0x40f14f[_0xcbdd('0x2e')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x22838b){_0x3e53b9(_0x22838b);})[_0xcbdd('0x1a')](function(_0x1b3692){_0x36e907(_0x5e7971[_0xcbdd('0x15')](0x1f4,_0x1b3692[_0xcbdd('0x18')]));});});};exports[_0xcbdd('0x4c')]=function(_0x42f5d4){var _0xf92238=this;return new Promise(function(_0x8a0435,_0x58c12d){var _0x361c9a;var _0xc5b0bc;var _0xee4f9d;var _0x4c848d;return db[_0xcbdd('0x1b')][_0xcbdd('0x4d')]({'where':_0x42f5d4['options'][_0xcbdd('0x1f')]||{},'attributes':['id',_0xcbdd('0x2b'),_0xcbdd('0x2c'),_0xcbdd('0x4e'),_0xcbdd('0x4f'),_0xcbdd('0x50'),_0xcbdd('0x51'),_0xcbdd('0x37')]})[_0xcbdd('0x11')](function(_0x84100){if(_0x84100){_0x361c9a=_0x84100;_0x4c848d=_0x42f5d4[_0xcbdd('0x39')][_0xcbdd('0x37')]?_0x42f5d4[_0xcbdd('0x39')][_0xcbdd('0x37')]:util[_0xcbdd('0x32')](_0xcbdd('0x38'),_0x361c9a[_0xcbdd('0x2b')]);return db[_0xcbdd('0x1b')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x361c9a['id']}}});}})['then'](function(_0x1793a2){if(_0x1793a2){_0xee4f9d=_0x1793a2;return require(_0xcbdd('0x52'))[_0xcbdd('0x53')]();}})[_0xcbdd('0x11')](function(_0x505edc){if(_0x505edc&&_0x505edc['agents']&&_0xee4f9d>=_0x505edc[_0xcbdd('0x54')]){throw new Error(_0xcbdd('0x55'));}})[_0xcbdd('0x11')](function(){if(_0x361c9a){return db[_0xcbdd('0x2d')][_0xcbdd('0x49')]({'where':{'membername':_0x361c9a['name']},'individualHooks':!![]});}})['then'](function(){if(_0x361c9a){return _0x361c9a['getVoiceQueues']({'raw':!![]});}})[_0xcbdd('0x11')](function(_0x5ddb3f){if(_0x361c9a){if(_0x5ddb3f){var _0x54f211=[];_0xc5b0bc=_0x5ddb3f;if(_0xc5b0bc['length']){for(var _0x172547=0x0;_0x172547<_0xc5b0bc[_0xcbdd('0x31')];_0x172547++){_0x54f211[_0xcbdd('0x35')](db['UserVoiceQueueRt']['upsert']({'membername':_0x361c9a['name'],'UserId':_0x361c9a['id'],'queue_name':_0xc5b0bc[_0x172547][_0xcbdd('0x2b')],'VoiceQueueId':_0xc5b0bc[_0x172547]['id'],'interface':_0x4c848d,'paused':_0x361c9a['loginInPause']||![],'penalty':_0xc5b0bc[_0x172547][_0xcbdd('0x56')]||0x0}));}return BPromise[_0xcbdd('0x4b')](_0x54f211);}}}})[_0xcbdd('0x11')](function(){if(_0x361c9a){return db['MemberReport'][_0xcbdd('0x1c')]({'where':{'membername':_0x361c9a[_0xcbdd('0x2b')],'exitAt':null}});}})[_0xcbdd('0x11')](function(_0xffee7a){if(_0x361c9a){if(_0xffee7a&&_0xffee7a[_0xcbdd('0x31')]){var _0x406ff5=[];_0xffee7a[_0xcbdd('0x4a')](function(_0x25c7da){_0x406ff5[_0xcbdd('0x35')](_0x25c7da[_0xcbdd('0x2e')]({'exitAt':moment()['format'](_0xcbdd('0x33'))}));});return BPromise['all'](_0x406ff5);}}})[_0xcbdd('0x11')](function(_0x10e8a5){if(_0x361c9a){var _0x56567a=[];var _0x1dd3d4=[];var _0x5b72f0=utils[_0xcbdd('0x57')]();var _0x14319e={'membername':_0x361c9a[_0xcbdd('0x2b')],'interface':_0x4c848d,'enterAt':moment()[_0xcbdd('0x32')](_0xcbdd('0x33')),'role':_0x361c9a[_0xcbdd('0x2c')],'internal':_0x361c9a[_0xcbdd('0x50')]};_0x5b72f0[_0xcbdd('0x4a')](function(_0x3536c5){_0x56567a[_0xcbdd('0x35')](_[_0xcbdd('0x58')]({'channel':_0x3536c5,'type':_0xcbdd('0x59'),'data1':'callysquare','data2':_0x4c848d},_0x14319e));if(_0x361c9a[_0xcbdd('0x51')]){_0x1dd3d4[_0xcbdd('0x35')](_[_0xcbdd('0x58')]({'channel':_0x3536c5,'type':_0xcbdd('0x30'),'data1':'LOGININPAUSE'},_0x14319e));}});return db[_0xcbdd('0x2f')][_0xcbdd('0x3d')](_0x56567a[_0xcbdd('0x5a')](_0x1dd3d4),{'individualHooks':!![]});}})[_0xcbdd('0x11')](function(){if(_0x361c9a){return _0x361c9a['update']({'online':!![],'lastLoginAt':moment()[_0xcbdd('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x361c9a[_0xcbdd('0x51')]||![],'mailPause':_0x361c9a[_0xcbdd('0x51')]||![],'chatPause':_0x361c9a[_0xcbdd('0x51')]||![],'faxPause':_0x361c9a['loginInPause']||![],'smsPause':_0x361c9a[_0xcbdd('0x51')]||![],'openchannelPause':_0x361c9a[_0xcbdd('0x51')]||![],'pauseType':_0x361c9a['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x4c848d});}})[_0xcbdd('0x11')](function(_0x556aea){_0x8a0435(_0x556aea);})[_0xcbdd('0x1a')](function(_0x3b8cf1){_0x58c12d(_0xf92238['error'](0x1f4,_0x3b8cf1[_0xcbdd('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 3d278ab..48c790b 100644 --- a/server/api/user/user.socket.js +++ b/server/api/user/user.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3e3=['length','./user.events','save','update','emit','removeListener'];(function(_0x23a042,_0x169361){var _0x57543a=function(_0x1fccec){while(--_0x1fccec){_0x23a042['push'](_0x23a042['shift']());}};_0x57543a(++_0x169361);}(_0xa3e3,0xdf));var _0x3a3e=function(_0x345aea,_0x583599){_0x345aea=_0x345aea-0x0;var _0x2bd7a8=_0xa3e3[_0x345aea];return _0x2bd7a8;};'use strict';var UserEvents=require(_0x3a3e('0x0'));var events=[_0x3a3e('0x1'),'remove',_0x3a3e('0x2')];function createListener(_0x2c2d72,_0xd90586){return function(_0x2c0abc){_0xd90586[_0x3a3e('0x3')](_0x2c2d72,_0x2c0abc);};}function removeListener(_0x13bddc,_0x543c62){return function(){UserEvents[_0x3a3e('0x4')](_0x13bddc,_0x543c62);};}exports['register']=function(_0xd946e){for(var _0x2796fe=0x0,_0x3b8c25=events[_0x3a3e('0x5')];_0x2796fe<_0x3b8c25;_0x2796fe++){var _0x5941f0=events[_0x2796fe];var _0x338393=createListener('user:'+_0x5941f0,_0xd946e);UserEvents['on'](_0x5941f0,_0x338393);}}; \ No newline at end of file +var _0xdab6=['update','emit','register','length','user:','./user.events','save'];(function(_0x3dc77d,_0x54f74d){var _0x55bb68=function(_0xb3a92a){while(--_0xb3a92a){_0x3dc77d['push'](_0x3dc77d['shift']());}};_0x55bb68(++_0x54f74d);}(_0xdab6,0xc9));var _0x6dab=function(_0x3e86e2,_0xbdc053){_0x3e86e2=_0x3e86e2-0x0;var _0x3ff730=_0xdab6[_0x3e86e2];return _0x3ff730;};'use strict';var UserEvents=require(_0x6dab('0x0'));var events=[_0x6dab('0x1'),'remove',_0x6dab('0x2')];function createListener(_0x5c07df,_0x2b5a69){return function(_0x74390b){_0x2b5a69[_0x6dab('0x3')](_0x5c07df,_0x74390b);};}function removeListener(_0x44189a,_0x435df8){return function(){UserEvents['removeListener'](_0x44189a,_0x435df8);};}exports[_0x6dab('0x4')]=function(_0x5a98b6){for(var _0xc38d1=0x0,_0x3e9942=events[_0x6dab('0x5')];_0xc38d1<_0x3e9942;_0xc38d1++){var _0x334b84=events[_0xc38d1];var _0x955b5d=createListener(_0x6dab('0x6')+_0x334b84,_0x5a98b6);UserEvents['on'](_0x334b84,_0x955b5d);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 80ce67f..4759359 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf98d=['connect-timeout','express','Router','../../components/auth/service','exports','multer','path'];(function(_0x192e75,_0x163130){var _0x4d348c=function(_0x541c28){while(--_0x541c28){_0x192e75['push'](_0x192e75['shift']());}};_0x4d348c(++_0x163130);}(_0xf98d,0x124));var _0xdf98=function(_0x10b835,_0x38b5ee){_0x10b835=_0x10b835-0x0;var _0x275784=_0xf98d[_0x10b835];return _0x275784;};'use strict';var multer=require(_0xdf98('0x0'));var util=require('util');var path=require(_0xdf98('0x1'));var timeout=require(_0xdf98('0x2'));var express=require(_0xdf98('0x3'));var router=express[_0xdf98('0x4')]();var auth=require(_0xdf98('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xdf98('0x6')]=router; \ No newline at end of file +var _0x4745=['connect-timeout','express','Router','../../components/auth/service','exports','multer'];(function(_0x428197,_0x15daa3){var _0x13fc6f=function(_0x42d1af){while(--_0x42d1af){_0x428197['push'](_0x428197['shift']());}};_0x13fc6f(++_0x15daa3);}(_0x4745,0x179));var _0x5474=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x4745[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x5474('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5474('0x1'));var express=require(_0x5474('0x2'));var router=express[_0x5474('0x3')]();var auth=require(_0x5474('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x5474('0x5')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 41007cb..3045fc4 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x1c4b46,_0x26ba44){var _0x32f50c=function(_0x4593f0){while(--_0x4593f0){_0x1c4b46['push'](_0x1c4b46['shift']());}};_0x32f50c(++_0x26ba44);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x5239f6,_0x3bc30a){var _0xb66a8b=function(_0x3573ac){while(--_0x3573ac){_0x5239f6['push'](_0x5239f6['shift']());}};_0xb66a8b(++_0x3bc30a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 5819bca..1adb535 100644 --- a/server/api/userChatQueue/userChatQueue.model.js +++ b/server/api/userChatQueue/userChatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0137=['./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0x0137,0x1d8));var _0x7013=function(_0x2b3d1f,_0x40c8b6){_0x2b3d1f=_0x2b3d1f-0x0;var _0x187469=_0x0137[_0x2b3d1f];return _0x187469;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require('bluebird');var rp=require(_0x7013('0x5'));var fs=require('fs');var path=require(_0x7013('0x6'));var rimraf=require(_0x7013('0x7'));var config=require(_0x7013('0x8'));var attributes=require(_0x7013('0x9'));module[_0x7013('0xa')]=function(_0x50b822,_0x24cb85){return _0x50b822[_0x7013('0xb')]('UserChatQueue',attributes,{'tableName':_0x7013('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde3a=['user_has_chat_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x27e0ce,_0x23f264){var _0x3696d3=function(_0x29573b){while(--_0x29573b){_0x27e0ce['push'](_0x27e0ce['shift']());}};_0x3696d3(++_0x23f264);}(_0xde3a,0x140));var _0xade3=function(_0xd7c8c9,_0x4254f9){_0xd7c8c9=_0xd7c8c9-0x0;var _0x1bc2fa=_0xde3a[_0xd7c8c9];return _0x1bc2fa;};'use strict';var _=require(_0xade3('0x0'));var util=require(_0xade3('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xade3('0x2'));var rp=require(_0xade3('0x3'));var fs=require('fs');var path=require(_0xade3('0x4'));var rimraf=require(_0xade3('0x5'));var config=require(_0xade3('0x6'));var attributes=require(_0xade3('0x7'));module[_0xade3('0x8')]=function(_0x3c5d92,_0x3a3078){return _0x3c5d92['define'](_0xade3('0x9'),attributes,{'tableName':_0xade3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 0fee9cd..59a958a 100644 --- a/server/api/userChatQueue/userChatQueue.rpc.js +++ b/server/api/userChatQueue/userChatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcaa=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x164d70,_0x520b64){var _0x1b2c9f=function(_0x556fea){while(--_0x556fea){_0x164d70['push'](_0x164d70['shift']());}};_0x1b2c9f(++_0x520b64);}(_0xbcaa,0x6d));var _0xabca=function(_0x184bcc,_0x51c3e4){_0x184bcc=_0x184bcc-0x0;var _0x7807b3=_0xbcaa[_0x184bcc];return _0x7807b3;};'use strict';var _=require(_0xabca('0x0'));var util=require(_0xabca('0x1'));var moment=require(_0xabca('0x2'));var BPromise=require(_0xabca('0x3'));var rs=require(_0xabca('0x4'));var fs=require('fs');var Redis=require(_0xabca('0x5'));var db=require(_0xabca('0x6'))['db'];var utils=require(_0xabca('0x7'));var logger=require(_0xabca('0x8'))('rpc');var config=require(_0xabca('0x9'));var jayson=require(_0xabca('0xa'));var client=jayson[_0xabca('0xb')][_0xabca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x121c34,_0x54eaee,_0x4d61f4){return new BPromise(function(_0x46e774,_0x1ecd58){return client[_0xabca('0xd')](_0x121c34,_0x4d61f4)[_0xabca('0xe')](function(_0x919406){logger[_0xabca('0xf')](_0xabca('0x10'),_0x54eaee,_0xabca('0x11'));logger[_0xabca('0x12')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x54eaee,_0xabca('0x11'),JSON[_0xabca('0x13')](_0x919406));if(_0x919406[_0xabca('0x14')]){if(_0x919406[_0xabca('0x14')]['code']===0x1f4){logger[_0xabca('0x14')](_0xabca('0x10'),_0x54eaee,_0x919406[_0xabca('0x14')]['message']);return _0x1ecd58(_0x919406[_0xabca('0x14')]['message']);}logger[_0xabca('0x14')](_0xabca('0x10'),_0x54eaee,_0x919406[_0xabca('0x14')][_0xabca('0x15')]);return _0x46e774(_0x919406['error'][_0xabca('0x15')]);}else{logger[_0xabca('0xf')](_0xabca('0x10'),_0x54eaee,'request\x20sent');_0x46e774(_0x919406[_0xabca('0x16')][_0xabca('0x15')]);}})['catch'](function(_0x33dfc2){logger[_0xabca('0x14')](_0xabca('0x10'),_0x54eaee,_0x33dfc2);_0x1ecd58(_0x33dfc2);});});} \ No newline at end of file +var _0x05b3=['UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0x05b3,0xe3));var _0x305b=function(_0x1d3892,_0x47d5fe){_0x1d3892=_0x1d3892-0x0;var _0x574ff2=_0x05b3[_0x1d3892];return _0x574ff2;};'use strict';var _=require('lodash');var util=require(_0x305b('0x0'));var moment=require(_0x305b('0x1'));var BPromise=require(_0x305b('0x2'));var rs=require(_0x305b('0x3'));var fs=require('fs');var Redis=require(_0x305b('0x4'));var db=require(_0x305b('0x5'))['db'];var utils=require(_0x305b('0x6'));var logger=require(_0x305b('0x7'))(_0x305b('0x8'));var config=require(_0x305b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x305b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x263879,_0x2e5fd4,_0x53ad81){return new BPromise(function(_0x17f7c6,_0x546f4e){return client[_0x305b('0xb')](_0x263879,_0x53ad81)['then'](function(_0x8a03c4){logger['info'](_0x305b('0xc'),_0x2e5fd4,_0x305b('0xd'));logger[_0x305b('0xe')](_0x305b('0xf'),_0x2e5fd4,'request\x20sent',JSON['stringify'](_0x8a03c4));if(_0x8a03c4[_0x305b('0x10')]){if(_0x8a03c4['error'][_0x305b('0x11')]===0x1f4){logger['error'](_0x305b('0xc'),_0x2e5fd4,_0x8a03c4[_0x305b('0x10')][_0x305b('0x12')]);return _0x546f4e(_0x8a03c4[_0x305b('0x10')][_0x305b('0x12')]);}logger[_0x305b('0x10')](_0x305b('0xc'),_0x2e5fd4,_0x8a03c4['error']['message']);return _0x17f7c6(_0x8a03c4[_0x305b('0x10')][_0x305b('0x12')]);}else{logger[_0x305b('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x2e5fd4,_0x305b('0xd'));_0x17f7c6(_0x8a03c4[_0x305b('0x14')][_0x305b('0x12')]);}})[_0x305b('0x15')](function(_0x347382){logger[_0x305b('0x10')](_0x305b('0xc'),_0x2e5fd4,_0x347382);_0x546f4e(_0x347382);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index f3e8f9c..3f0293f 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x165a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x5e941f,_0x41d741){var _0x5b52c4=function(_0x35dee7){while(--_0x35dee7){_0x5e941f['push'](_0x5e941f['shift']());}};_0x5b52c4(++_0x41d741);}(_0x165a,0x9c));var _0xa165=function(_0x2913b5,_0x1f9d11){_0x2913b5=_0x2913b5-0x0;var _0x4eec34=_0x165a[_0x2913b5];return _0x4eec34;};'use strict';var multer=require(_0xa165('0x0'));var util=require(_0xa165('0x1'));var path=require(_0xa165('0x2'));var timeout=require(_0xa165('0x3'));var express=require(_0xa165('0x4'));var router=express[_0xa165('0x5')]();var auth=require(_0xa165('0x6'));var interaction=require(_0xa165('0x7'));var config=require(_0xa165('0x8'));module[_0xa165('0x9')]=router; \ No newline at end of file +var _0xc749=['../../components/auth/service','../../components/interaction/service','../../config/environment','util','path','connect-timeout'];(function(_0x1bbc8b,_0x1f4cd2){var _0x37cfb2=function(_0x19c3c0){while(--_0x19c3c0){_0x1bbc8b['push'](_0x1bbc8b['shift']());}};_0x37cfb2(++_0x1f4cd2);}(_0xc749,0xf3));var _0x9c74=function(_0x5652bd,_0x40cbe7){_0x5652bd=_0x5652bd-0x0;var _0x23c243=_0xc749[_0x5652bd];return _0x23c243;};'use strict';var multer=require('multer');var util=require(_0x9c74('0x0'));var path=require(_0x9c74('0x1'));var timeout=require(_0x9c74('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x9c74('0x3'));var interaction=require(_0x9c74('0x4'));var config=require(_0x9c74('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index c2605f2..e1e9f88 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['INTEGER','sequelize','exports'];(function(_0x36e334,_0x39bd51){var _0x5279d8=function(_0x5e551b){while(--_0x5e551b){_0x36e334['push'](_0x36e334['shift']());}};_0x5279d8(++_0x39bd51);}(_0xe511,0x16f));var _0x1e51=function(_0x38995a,_0x3565b2){_0x38995a=_0x38995a-0x0;var _0x5da3d2=_0xe511[_0x38995a];return _0x5da3d2;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1e51('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x14a0=['STRING','exports','INTEGER'];(function(_0x3edc92,_0x3f53d0){var _0x3d283c=function(_0x253904){while(--_0x253904){_0x3edc92['push'](_0x3edc92['shift']());}};_0x3d283c(++_0x3f53d0);}(_0x14a0,0x8e));var _0x014a=function(_0x5c51b8,_0x439411){_0x5c51b8=_0x5c51b8-0x0;var _0x488eb0=_0x14a0[_0x5c51b8];return _0x488eb0;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'penalty':{'type':Sequelize[_0x014a('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x014a('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x014a('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a5ae23a..85e1fa3 100644 --- a/server/api/userFaxQueue/userFaxQueue.model.js +++ b/server/api/userFaxQueue/userFaxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c80=['../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x57c09e,_0x5da5d2){var _0x49d316=function(_0x631e3d){while(--_0x631e3d){_0x57c09e['push'](_0x57c09e['shift']());}};_0x49d316(++_0x5da5d2);}(_0x7c80,0xa4));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x07c8('0x0'));var util=require(_0x07c8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x07c8('0x2'));var BPromise=require(_0x07c8('0x3'));var rp=require(_0x07c8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07c8('0x5'));var config=require(_0x07c8('0x6'));var attributes=require(_0x07c8('0x7'));module['exports']=function(_0xfe1ead,_0x56b8ca){return _0xfe1ead['define'](_0x07c8('0x8'),attributes,{'tableName':_0x07c8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0efb=['request-promise','path','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x490b77,_0x495c97){var _0x3d633a=function(_0x43f183){while(--_0x43f183){_0x490b77['push'](_0x490b77['shift']());}};_0x3d633a(++_0x495c97);}(_0x0efb,0x163));var _0xb0ef=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x0efb[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0xb0ef('0x0'));var util=require(_0xb0ef('0x1'));var logger=require(_0xb0ef('0x2'))(_0xb0ef('0x3'));var moment=require(_0xb0ef('0x4'));var BPromise=require('bluebird');var rp=require(_0xb0ef('0x5'));var fs=require('fs');var path=require(_0xb0ef('0x6'));var rimraf=require('rimraf');var config=require(_0xb0ef('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xb0ef('0x8')]=function(_0x4ad968,_0x13a2ac){return _0x4ad968[_0xb0ef('0x9')](_0xb0ef('0xa'),attributes,{'tableName':_0xb0ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 78201f5..bdd168d 100644 --- a/server/api/userFaxQueue/userFaxQueue.rpc.js +++ b/server/api/userFaxQueue/userFaxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0837=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x25212e,_0x35c573){var _0xa65397=function(_0x351170){while(--_0x351170){_0x25212e['push'](_0x25212e['shift']());}};_0xa65397(++_0x35c573);}(_0x0837,0x1db));var _0x7083=function(_0x399f49,_0xd34edd){_0x399f49=_0x399f49-0x0;var _0x5d4dc2=_0x0837[_0x399f49];return _0x5d4dc2;};'use strict';var _=require(_0x7083('0x0'));var util=require(_0x7083('0x1'));var moment=require(_0x7083('0x2'));var BPromise=require('bluebird');var rs=require(_0x7083('0x3'));var fs=require('fs');var Redis=require(_0x7083('0x4'));var db=require(_0x7083('0x5'))['db'];var utils=require(_0x7083('0x6'));var logger=require(_0x7083('0x7'))(_0x7083('0x8'));var config=require(_0x7083('0x9'));var jayson=require(_0x7083('0xa'));var client=jayson[_0x7083('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x339bbe,_0x6bff72,_0x12ccdd){return new BPromise(function(_0x859a99,_0x3137dc){return client[_0x7083('0xc')](_0x339bbe,_0x12ccdd)[_0x7083('0xd')](function(_0x2ca4b4){logger[_0x7083('0xe')](_0x7083('0xf'),_0x6bff72,'request\x20sent');logger['debug'](_0x7083('0x10'),_0x6bff72,'request\x20sent',JSON[_0x7083('0x11')](_0x2ca4b4));if(_0x2ca4b4['error']){if(_0x2ca4b4[_0x7083('0x12')][_0x7083('0x13')]===0x1f4){logger[_0x7083('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x6bff72,_0x2ca4b4['error'][_0x7083('0x14')]);return _0x3137dc(_0x2ca4b4['error'][_0x7083('0x14')]);}logger[_0x7083('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x6bff72,_0x2ca4b4[_0x7083('0x12')][_0x7083('0x14')]);return _0x859a99(_0x2ca4b4[_0x7083('0x12')]['message']);}else{logger[_0x7083('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x6bff72,_0x7083('0x15'));_0x859a99(_0x2ca4b4[_0x7083('0x16')][_0x7083('0x14')]);}})[_0x7083('0x17')](function(_0x219737){logger[_0x7083('0x12')](_0x7083('0xf'),_0x6bff72,_0x219737);_0x3137dc(_0x219737);});});} \ No newline at end of file +var _0xb664=['rpc','client','request','then','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','UserFaxQueue,\x20%s,\x20%s','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb664,0x163));var _0x4b66=function(_0x59ae61,_0x578d91){_0x59ae61=_0x59ae61-0x0;var _0x51549d=_0xb664[_0x59ae61];return _0x51549d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b66('0x0'));var BPromise=require('bluebird');var rs=require(_0x4b66('0x1'));var fs=require('fs');var Redis=require(_0x4b66('0x2'));var db=require(_0x4b66('0x3'))['db'];var utils=require(_0x4b66('0x4'));var logger=require(_0x4b66('0x5'))(_0x4b66('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4b66('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4716f8,_0x47431c,_0xc232cf){return new BPromise(function(_0xa5c6e2,_0x26f6cb){return client[_0x4b66('0x8')](_0x4716f8,_0xc232cf)[_0x4b66('0x9')](function(_0x27cb09){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x47431c,_0x4b66('0xa'));logger[_0x4b66('0xb')](_0x4b66('0xc'),_0x47431c,'request\x20sent',JSON[_0x4b66('0xd')](_0x27cb09));if(_0x27cb09[_0x4b66('0xe')]){if(_0x27cb09[_0x4b66('0xe')]['code']===0x1f4){logger[_0x4b66('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x47431c,_0x27cb09[_0x4b66('0xe')][_0x4b66('0xf')]);return _0x26f6cb(_0x27cb09[_0x4b66('0xe')][_0x4b66('0xf')]);}logger[_0x4b66('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x47431c,_0x27cb09[_0x4b66('0xe')][_0x4b66('0xf')]);return _0xa5c6e2(_0x27cb09['error'][_0x4b66('0xf')]);}else{logger[_0x4b66('0x10')](_0x4b66('0x11'),_0x47431c,_0x4b66('0xa'));_0xa5c6e2(_0x27cb09[_0x4b66('0x12')][_0x4b66('0xf')]);}})['catch'](function(_0x210b00){logger[_0x4b66('0xe')](_0x4b66('0x11'),_0x47431c,_0x210b00);_0x26f6cb(_0x210b00);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e7401f9..f23609b 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ead=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0ead,0x1a7));var _0xd0ea=function(_0x5667cc,_0x39656a){_0x5667cc=_0x5667cc-0x0;var _0x3bb426=_0x0ead[_0x5667cc];return _0x3bb426;};'use strict';var multer=require(_0xd0ea('0x0'));var util=require(_0xd0ea('0x1'));var path=require(_0xd0ea('0x2'));var timeout=require(_0xd0ea('0x3'));var express=require(_0xd0ea('0x4'));var router=express[_0xd0ea('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd0ea('0x6'));var config=require(_0xd0ea('0x7'));module[_0xd0ea('0x8')]=router; \ No newline at end of file +var _0x6d1f=['connect-timeout','Router','../../components/auth/service','../../config/environment','exports','multer','util','path'];(function(_0xdc0e64,_0x38bf67){var _0xb04e82=function(_0x638bea){while(--_0x638bea){_0xdc0e64['push'](_0xdc0e64['shift']());}};_0xb04e82(++_0x38bf67);}(_0x6d1f,0xd5));var _0xf6d1=function(_0x438086,_0xf40efd){_0x438086=_0x438086-0x0;var _0x4d55e7=_0x6d1f[_0x438086];return _0x4d55e7;};'use strict';var multer=require(_0xf6d1('0x0'));var util=require(_0xf6d1('0x1'));var path=require(_0xf6d1('0x2'));var timeout=require(_0xf6d1('0x3'));var express=require('express');var router=express[_0xf6d1('0x4')]();var auth=require(_0xf6d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf6d1('0x6'));module[_0xf6d1('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index d7c40ff..c589735 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x5046f0,_0x143f3c){var _0x423c81=function(_0xb2bc31){while(--_0xb2bc31){_0x5046f0['push'](_0x5046f0['shift']());}};_0x423c81(++_0x143f3c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb10b=['sequelize','INTEGER'];(function(_0x3300b9,_0x22cec3){var _0x4cd1fd=function(_0x19d26b){while(--_0x19d26b){_0x3300b9['push'](_0x3300b9['shift']());}};_0x4cd1fd(++_0x22cec3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e028c,_0x2bd5b0){_0x1e028c=_0x1e028c-0x0;var _0x336831=_0xb10b[_0x1e028c];return _0x336831;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index f2e0b83..5998fbf 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b5e26,_0x453ef6){_0x1b5e26=_0x1b5e26-0x0;var _0x246191=_0xb10b[_0x1b5e26];return _0x246191;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('UserMailQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['define','user_has_mail_queues','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x2a1465,_0x8bf785){var _0x128933=function(_0x4f2a1f){while(--_0x4f2a1f){_0x2a1465['push'](_0x2a1465['shift']());}};_0x128933(++_0x8bf785);}(_0x757a,0xde));var _0xa757=function(_0x351999,_0x59a183){_0x351999=_0x351999-0x0;var _0x2beb70=_0x757a[_0x351999];return _0x2beb70;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('UserMailQueue',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 79f47f0..303ec63 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b47=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x279f7c,_0x50b35e){var _0x34f43c=function(_0x57fe25){while(--_0x57fe25){_0x279f7c['push'](_0x279f7c['shift']());}};_0x34f43c(++_0x50b35e);}(_0x4b47,0x1b4));var _0x74b4=function(_0xac05bc,_0x372f15){_0xac05bc=_0xac05bc-0x0;var _0x329556=_0x4b47[_0xac05bc];return _0x329556;};'use strict';var _=require(_0x74b4('0x0'));var util=require('util');var moment=require(_0x74b4('0x1'));var BPromise=require(_0x74b4('0x2'));var rs=require(_0x74b4('0x3'));var fs=require('fs');var Redis=require(_0x74b4('0x4'));var db=require(_0x74b4('0x5'))['db'];var utils=require(_0x74b4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x74b4('0x7'));var jayson=require(_0x74b4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x482278,_0x43b434,_0x75ea22){return new BPromise(function(_0x1ebbb8,_0x318a0a){return client[_0x74b4('0x9')](_0x482278,_0x75ea22)['then'](function(_0x531be6){logger[_0x74b4('0xa')](_0x74b4('0xb'),_0x43b434,'request\x20sent');logger['debug']('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x43b434,_0x74b4('0xc'),JSON[_0x74b4('0xd')](_0x531be6));if(_0x531be6[_0x74b4('0xe')]){if(_0x531be6[_0x74b4('0xe')]['code']===0x1f4){logger[_0x74b4('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x43b434,_0x531be6[_0x74b4('0xe')]['message']);return _0x318a0a(_0x531be6[_0x74b4('0xe')][_0x74b4('0xf')]);}logger[_0x74b4('0xe')](_0x74b4('0xb'),_0x43b434,_0x531be6['error'][_0x74b4('0xf')]);return _0x1ebbb8(_0x531be6[_0x74b4('0xe')]['message']);}else{logger[_0x74b4('0xa')](_0x74b4('0xb'),_0x43b434,_0x74b4('0xc'));_0x1ebbb8(_0x531be6[_0x74b4('0x10')]['message']);}})[_0x74b4('0x11')](function(_0x3906ad){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x43b434,_0x3906ad);_0x318a0a(_0x3906ad);});});} \ No newline at end of file +var _0xf350=['request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','UserMailQueue,\x20%s,\x20%s'];(function(_0x21d465,_0x4a7052){var _0x2731f0=function(_0x23ea77){while(--_0x23ea77){_0x21d465['push'](_0x21d465['shift']());}};_0x2731f0(++_0x4a7052);}(_0xf350,0x105));var _0x0f35=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf350[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0f35('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0f35('0x1'));var rs=require(_0x0f35('0x2'));var fs=require('fs');var Redis=require(_0x0f35('0x3'));var db=require(_0x0f35('0x4'))['db'];var utils=require(_0x0f35('0x5'));var logger=require(_0x0f35('0x6'))(_0x0f35('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0f35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c61c4,_0x481712,_0x544342){return new BPromise(function(_0x2c716b,_0x49c0fe){return client[_0x0f35('0x9')](_0x2c61c4,_0x544342)['then'](function(_0x3d928d){logger[_0x0f35('0xa')](_0x0f35('0xb'),_0x481712,_0x0f35('0xc'));logger[_0x0f35('0xd')](_0x0f35('0xe'),_0x481712,_0x0f35('0xc'),JSON[_0x0f35('0xf')](_0x3d928d));if(_0x3d928d[_0x0f35('0x10')]){if(_0x3d928d['error'][_0x0f35('0x11')]===0x1f4){logger[_0x0f35('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x481712,_0x3d928d[_0x0f35('0x10')]['message']);return _0x49c0fe(_0x3d928d[_0x0f35('0x10')]['message']);}logger['error'](_0x0f35('0xb'),_0x481712,_0x3d928d[_0x0f35('0x10')][_0x0f35('0x12')]);return _0x2c716b(_0x3d928d['error'][_0x0f35('0x12')]);}else{logger[_0x0f35('0xa')](_0x0f35('0xb'),_0x481712,_0x0f35('0xc'));_0x2c716b(_0x3d928d[_0x0f35('0x13')][_0x0f35('0x12')]);}})[_0x0f35('0x14')](function(_0x1a2ffc){logger[_0x0f35('0x10')](_0x0f35('0xb'),_0x481712,_0x1a2ffc);_0x49c0fe(_0x1a2ffc);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 4836c0d..527210e 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabc0=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5b8915,_0x39a5fa){var _0x433457=function(_0x26d63f){while(--_0x26d63f){_0x5b8915['push'](_0x5b8915['shift']());}};_0x433457(++_0x39a5fa);}(_0xabc0,0x17b));var _0x0abc=function(_0x42ce19,_0x2753aa){_0x42ce19=_0x42ce19-0x0;var _0x347c8b=_0xabc0[_0x42ce19];return _0x347c8b;};'use strict';var multer=require(_0x0abc('0x0'));var util=require(_0x0abc('0x1'));var path=require(_0x0abc('0x2'));var timeout=require('connect-timeout');var express=require(_0x0abc('0x3'));var router=express[_0x0abc('0x4')]();var auth=require(_0x0abc('0x5'));var interaction=require(_0x0abc('0x6'));var config=require(_0x0abc('0x7'));module[_0x0abc('0x8')]=router; \ No newline at end of file +var _0x85d9=['multer','util','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x5ce3c1,_0x2ab59b){var _0x585640=function(_0x44bacb){while(--_0x44bacb){_0x5ce3c1['push'](_0x5ce3c1['shift']());}};_0x585640(++_0x2ab59b);}(_0x85d9,0x1bc));var _0x985d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x85d9[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x985d('0x0'));var util=require(_0x985d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x985d('0x2'));var router=express[_0x985d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x985d('0x4'));var config=require(_0x985d('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 4be6356..5e9ab22 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x31be28,_0x598de7){var _0x4d23f2=function(_0x53828e){while(--_0x53828e){_0x31be28['push'](_0x31be28['shift']());}};_0x4d23f2(++_0x598de7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x1520c1,_0x56f2a2){var _0x4be1d6=function(_0x3b4077){while(--_0x3b4077){_0x1520c1['push'](_0x1520c1['shift']());}};_0x4be1d6(++_0x56f2a2);}(_0xe706,0xa3));var _0x6e70=function(_0x456904,_0x4cb25c){_0x456904=_0x456904-0x0;var _0x4b0063=_0xe706[_0x456904];return _0x4b0063;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 0e17015..353412e 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4236=['../../config/environment','exports','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x830ddf,_0x53d983){var _0x151e6b=function(_0x2a4ff6){while(--_0x2a4ff6){_0x830ddf['push'](_0x830ddf['shift']());}};_0x151e6b(++_0x53d983);}(_0x4236,0x64));var _0x6423=function(_0x11f62c,_0x4f9215){_0x11f62c=_0x11f62c-0x0;var _0x2e8373=_0x4236[_0x11f62c];return _0x2e8373;};'use strict';var _=require(_0x6423('0x0'));var util=require(_0x6423('0x1'));var logger=require(_0x6423('0x2'))(_0x6423('0x3'));var moment=require('moment');var BPromise=require(_0x6423('0x4'));var rp=require(_0x6423('0x5'));var fs=require('fs');var path=require(_0x6423('0x6'));var rimraf=require(_0x6423('0x7'));var config=require(_0x6423('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x6423('0x9')]=function(_0x41585a,_0x38be5c){return _0x41585a[_0x6423('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0x6423('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3034=['../../config/environment','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x311825,_0x40d25f){var _0x178115=function(_0x42b995){while(--_0x42b995){_0x311825['push'](_0x311825['shift']());}};_0x178115(++_0x40d25f);}(_0x3034,0x124));var _0x4303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3034[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4303('0x0'));var util=require(_0x4303('0x1'));var logger=require(_0x4303('0x2'))(_0x4303('0x3'));var moment=require('moment');var BPromise=require(_0x4303('0x4'));var rp=require(_0x4303('0x5'));var fs=require('fs');var path=require(_0x4303('0x6'));var rimraf=require(_0x4303('0x7'));var config=require(_0x4303('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x4303('0x9')]=function(_0x3caa6e,_0x4ad800){return _0x3caa6e[_0x4303('0xa')](_0x4303('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 050c463..3b4c81d 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b20=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x2a7bae,_0x5a74be){var _0x1259c4=function(_0x24a3a8){while(--_0x24a3a8){_0x2a7bae['push'](_0x2a7bae['shift']());}};_0x1259c4(++_0x5a74be);}(_0x8b20,0x1b0));var _0x08b2=function(_0x3212cc,_0x3bfe46){_0x3212cc=_0x3212cc-0x0;var _0x3ecd2c=_0x8b20[_0x3212cc];return _0x3ecd2c;};'use strict';var _=require(_0x08b2('0x0'));var util=require(_0x08b2('0x1'));var moment=require(_0x08b2('0x2'));var BPromise=require(_0x08b2('0x3'));var rs=require(_0x08b2('0x4'));var fs=require('fs');var Redis=require(_0x08b2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x08b2('0x6'));var logger=require(_0x08b2('0x7'))('rpc');var config=require(_0x08b2('0x8'));var jayson=require(_0x08b2('0x9'));var client=jayson[_0x08b2('0xa')][_0x08b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c04cd,_0x4a06b2,_0x4fba95){return new BPromise(function(_0x194621,_0x39ab8b){return client[_0x08b2('0xc')](_0x1c04cd,_0x4fba95)[_0x08b2('0xd')](function(_0x33667e){logger[_0x08b2('0xe')](_0x08b2('0xf'),_0x4a06b2,_0x08b2('0x10'));logger[_0x08b2('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4a06b2,'request\x20sent',JSON[_0x08b2('0x12')](_0x33667e));if(_0x33667e['error']){if(_0x33667e[_0x08b2('0x13')][_0x08b2('0x14')]===0x1f4){logger[_0x08b2('0x13')](_0x08b2('0xf'),_0x4a06b2,_0x33667e[_0x08b2('0x13')][_0x08b2('0x15')]);return _0x39ab8b(_0x33667e[_0x08b2('0x13')][_0x08b2('0x15')]);}logger['error'](_0x08b2('0xf'),_0x4a06b2,_0x33667e[_0x08b2('0x13')][_0x08b2('0x15')]);return _0x194621(_0x33667e[_0x08b2('0x13')][_0x08b2('0x15')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4a06b2,_0x08b2('0x10'));_0x194621(_0x33667e[_0x08b2('0x16')][_0x08b2('0x15')]);}})['catch'](function(_0x35a05a){logger[_0x08b2('0x13')](_0x08b2('0xf'),_0x4a06b2,_0x35a05a);_0x39ab8b(_0x35a05a);});});} \ No newline at end of file +var _0xf0bf=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf0bf,0xc7));var _0xff0b=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xf0bf[_0x5627e1];return _0x2f013f;};'use strict';var _=require(_0xff0b('0x0'));var util=require(_0xff0b('0x1'));var moment=require('moment');var BPromise=require(_0xff0b('0x2'));var rs=require(_0xff0b('0x3'));var fs=require('fs');var Redis=require(_0xff0b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xff0b('0x5'));var logger=require(_0xff0b('0x6'))(_0xff0b('0x7'));var config=require('../../config/environment');var jayson=require(_0xff0b('0x8'));var client=jayson[_0xff0b('0x9')][_0xff0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1372f7,_0x4f643c,_0xb057da){return new BPromise(function(_0x35ee63,_0x1650d0){return client[_0xff0b('0xb')](_0x1372f7,_0xb057da)[_0xff0b('0xc')](function(_0x5ef511){logger[_0xff0b('0xd')](_0xff0b('0xe'),_0x4f643c,_0xff0b('0xf'));logger[_0xff0b('0x10')](_0xff0b('0x11'),_0x4f643c,_0xff0b('0xf'),JSON[_0xff0b('0x12')](_0x5ef511));if(_0x5ef511[_0xff0b('0x13')]){if(_0x5ef511[_0xff0b('0x13')][_0xff0b('0x14')]===0x1f4){logger['error'](_0xff0b('0xe'),_0x4f643c,_0x5ef511[_0xff0b('0x13')]['message']);return _0x1650d0(_0x5ef511['error'][_0xff0b('0x15')]);}logger['error'](_0xff0b('0xe'),_0x4f643c,_0x5ef511[_0xff0b('0x13')][_0xff0b('0x15')]);return _0x35ee63(_0x5ef511[_0xff0b('0x13')][_0xff0b('0x15')]);}else{logger['info'](_0xff0b('0xe'),_0x4f643c,_0xff0b('0xf'));_0x35ee63(_0x5ef511[_0xff0b('0x16')][_0xff0b('0x15')]);}})[_0xff0b('0x17')](function(_0x4ea0aa){logger[_0xff0b('0x13')](_0xff0b('0xe'),_0x4f643c,_0x4ea0aa);_0x1650d0(_0x4ea0aa);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index a5d67a1..73e7182 100644 --- a/server/api/userProfile/index.js +++ b/server/api/userProfile/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47e8=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','/:id/sections','getSections','getResources','post','/:id/clone','clone','/:id/resources','put','/:id','update','delete','removeSections','removeResources','exports','multer'];(function(_0x2b3de5,_0x2c0f91){var _0x267746=function(_0x47e9fc){while(--_0x47e9fc){_0x2b3de5['push'](_0x2b3de5['shift']());}};_0x267746(++_0x2c0f91);}(_0x47e8,0x144));var _0x847e=function(_0x26a1dc,_0x380fb3){_0x26a1dc=_0x26a1dc-0x0;var _0x529678=_0x47e8[_0x26a1dc];return _0x529678;};'use strict';var multer=require(_0x847e('0x0'));var util=require(_0x847e('0x1'));var path=require(_0x847e('0x2'));var timeout=require(_0x847e('0x3'));var express=require('express');var router=express[_0x847e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x847e('0x5'));var config=require(_0x847e('0x6'));var controller=require(_0x847e('0x7'));router[_0x847e('0x8')]('/',auth[_0x847e('0x9')](),controller['index']);router[_0x847e('0x8')](_0x847e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x847e('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x847e('0x8')](_0x847e('0xb'),auth[_0x847e('0x9')](),controller[_0x847e('0xc')]);router[_0x847e('0x8')]('/:id/resources',auth['isAuthenticated'](),controller[_0x847e('0xd')]);router[_0x847e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x847e('0xe')](_0x847e('0xf'),auth[_0x847e('0x9')](),controller[_0x847e('0x10')]);router[_0x847e('0xe')](_0x847e('0xb'),auth['isAuthenticated'](),controller['addSections']);router['post'](_0x847e('0x11'),auth[_0x847e('0x9')](),controller['addResources']);router[_0x847e('0x12')](_0x847e('0x13'),auth[_0x847e('0x9')](),controller[_0x847e('0x14')]);router['delete'](_0x847e('0x13'),auth[_0x847e('0x9')](),controller['destroy']);router[_0x847e('0x15')]('/:id/sections',auth['isAuthenticated'](),controller[_0x847e('0x16')]);router[_0x847e('0x15')](_0x847e('0x11'),auth[_0x847e('0x9')](),controller[_0x847e('0x17')]);module[_0x847e('0x18')]=router; \ No newline at end of file +var _0x8992=['destroy','removeResources','multer','util','connect-timeout','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','delete'];(function(_0x4e7b97,_0x273f7c){var _0x305695=function(_0x5ce464){while(--_0x5ce464){_0x4e7b97['push'](_0x4e7b97['shift']());}};_0x305695(++_0x273f7c);}(_0x8992,0x16a));var _0x2899=function(_0x2eb8eb,_0x3b203d){_0x2eb8eb=_0x2eb8eb-0x0;var _0x3ad863=_0x8992[_0x2eb8eb];return _0x3ad863;};'use strict';var multer=require(_0x2899('0x0'));var util=require(_0x2899('0x1'));var path=require('path');var timeout=require(_0x2899('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2899('0x3'));var config=require('../../config/environment');var controller=require(_0x2899('0x4'));router[_0x2899('0x5')]('/',auth[_0x2899('0x6')](),controller[_0x2899('0x7')]);router['get'](_0x2899('0x8'),auth[_0x2899('0x6')](),controller[_0x2899('0x9')]);router[_0x2899('0x5')](_0x2899('0xa'),auth['isAuthenticated'](),controller[_0x2899('0xb')]);router[_0x2899('0x5')](_0x2899('0xc'),auth[_0x2899('0x6')](),controller[_0x2899('0xd')]);router[_0x2899('0x5')](_0x2899('0xe'),auth[_0x2899('0x6')](),controller[_0x2899('0xf')]);router[_0x2899('0x10')]('/',auth[_0x2899('0x6')](),controller[_0x2899('0x11')]);router[_0x2899('0x10')](_0x2899('0x12'),auth[_0x2899('0x6')](),controller['clone']);router['post'](_0x2899('0xc'),auth['isAuthenticated'](),controller[_0x2899('0x13')]);router['post']('/:id/resources',auth['isAuthenticated'](),controller[_0x2899('0x14')]);router['put'](_0x2899('0xa'),auth[_0x2899('0x6')](),controller['update']);router[_0x2899('0x15')](_0x2899('0xa'),auth[_0x2899('0x6')](),controller[_0x2899('0x16')]);router[_0x2899('0x15')](_0x2899('0xc'),auth[_0x2899('0x6')](),controller['removeSections']);router[_0x2899('0x15')](_0x2899('0xe'),auth[_0x2899('0x6')](),controller[_0x2899('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 6c66d17..be0835f 100644 --- a/server/api/userProfile/userProfile.attributes.js +++ b/server/api/userProfile/userProfile.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x940d=['name','STRING','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports'];(function(_0x4c2530,_0x2c8a6b){var _0xf3931b=function(_0x2fe35d){while(--_0x2fe35d){_0x4c2530['push'](_0x4c2530['shift']());}};_0xf3931b(++_0x2c8a6b);}(_0x940d,0x181));var _0xd940=function(_0x3337e3,_0x21efa9){_0x3337e3=_0x3337e3-0x0;var _0x290800=_0x940d[_0x3337e3];return _0x290800;};'use strict';var Sequelize=require(_0xd940('0x0'));module[_0xd940('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd940('0x2')},'crudPermissions':{'type':Sequelize[_0xd940('0x3')],'set':function(_0x11ef34){this[_0xd940('0x4')](_0xd940('0x5'),_0x11ef34?_0x11ef34[_0xd940('0x6')](''):[]);},'get':function(){return this[_0xd940('0x7')](_0xd940('0x5'))?this['getDataValue'](_0xd940('0x5'))[_0xd940('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd940('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x1fc2=['getDataValue','split','STRING','sequelize','exports','name','crudPermissions','join'];(function(_0x2061e3,_0x43565a){var _0x362275=function(_0x1b80f5){while(--_0x1b80f5){_0x2061e3['push'](_0x2061e3['shift']());}};_0x362275(++_0x43565a);}(_0x1fc2,0x123));var _0x21fc=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x1fc2[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0x21fc('0x0'));module[_0x21fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x21fc('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5f2045){this['setDataValue'](_0x21fc('0x3'),_0x5f2045?_0x5f2045[_0x21fc('0x4')](''):[]);},'get':function(){return this[_0x21fc('0x5')]('crudPermissions')?this[_0x21fc('0x5')](_0x21fc('0x3'))[_0x21fc('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x21fc('0x7')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 368d155..8250e3a 100644 --- a/server/api/userProfile/userProfile.controller.js +++ b/server/api/userProfile/userProfile.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ba5=['VIRTUAL','merge','options','count','include','catch','show','params','rawAttributes','includeAll','find','create','body','clone','omit','createdAt','crudPermissions','sequelize','transaction','get','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','updatedAt','sectionId','userProfileId','Resources','update','describe','addSections','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','some','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','undefined','Invalid\x20section\x20\x27','parentSections','all','ignore','union','hasOwnProperty','nolimit','field','foreignKey','associatedResources','AnalyticExtractedReport','reportType','default','reportId','DefaultReports','CustomReports','rows','CmContact','Tags','color','tag','value','toLowerCase','squareprojects','SquareProject','odbc','SquareRecording','JscriptyProject','lists','CmList','ChatQueue','chatwebsites','FaxQueue','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','role','agent','Telephones','User','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoicePrefix','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','SmsQueue','SmsAccount','teams','Team','voicequeues','users','agents','telephones','Users','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','pauses','Pause','scheduler','sounds','Sound','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','set','Content-Range','apply','save','destroy','then','end','error','stack','name','map','UserProfile','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','limit','order','sort','pick','filter','where'];(function(_0x5c44f1,_0x39b647){var _0x1c297d=function(_0xa17433){while(--_0xa17433){_0x5c44f1['push'](_0x5c44f1['shift']());}};_0x1c297d(++_0x39b647);}(_0x7ba5,0x185));var _0x57ba=function(_0x48702c,_0x119674){_0x48702c=_0x48702c-0x0;var _0x409ac0=_0x7ba5[_0x48702c];return _0x409ac0;};'use strict';var pdf=require(_0x57ba('0x0'));var emlformat=require(_0x57ba('0x1'));var rimraf=require(_0x57ba('0x2'));var zipdir=require(_0x57ba('0x3'));var jsonpatch=require(_0x57ba('0x4'));var rp=require(_0x57ba('0x5'));var moment=require(_0x57ba('0x6'));var BPromise=require(_0x57ba('0x7'));var Mustache=require(_0x57ba('0x8'));var util=require(_0x57ba('0x9'));var path=require(_0x57ba('0xa'));var sox=require(_0x57ba('0xb'));var csv=require('to-csv');var ejs=require(_0x57ba('0xc'));var fs=require('fs');var _=require(_0x57ba('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x57ba('0xe'));var deskjs=require(_0x57ba('0xf'));var toCsv=require(_0x57ba('0x10'));var querystring=require(_0x57ba('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x57ba('0x12'));var as=require(_0x57ba('0x13'));var hardwareService=require(_0x57ba('0x14'));var logger=require(_0x57ba('0x15'))(_0x57ba('0x16'));var utils=require(_0x57ba('0x17'));var config=require(_0x57ba('0x18'));var db=require(_0x57ba('0x19'))['db'];config[_0x57ba('0x1a')]=_[_0x57ba('0x1b')](config['redis'],{'host':_0x57ba('0x1c'),'port':0x18eb});var socket=require(_0x57ba('0x1d'))(new Redis(config['redis']));require('./userProfile.socket')[_0x57ba('0x1e')](socket);function respondWithStatusCode(_0x58fc1e,_0xb99e5c){_0xb99e5c=_0xb99e5c||0xcc;return function(_0x2bf14b){if(_0x2bf14b){return _0x58fc1e['sendStatus'](_0xb99e5c);}return _0x58fc1e['status'](_0xb99e5c)['end']();};}function respondWithResult(_0x5066e3,_0x216707){_0x216707=_0x216707||0xc8;return function(_0x5a68df){if(_0x5a68df){return _0x5066e3[_0x57ba('0x1f')](_0x216707)[_0x57ba('0x20')](_0x5a68df);}};}function respondWithFilteredResult(_0x5aac7b,_0x90ee5e){return function(_0x3d27c4){if(_0x3d27c4){var _0x446be9=_0x3d27c4['count'],_0x494abb=_0x90ee5e['offset'],_0x447af2=_0x90ee5e[_0x57ba('0x21')]+_0x90ee5e['limit'],_0x2a7b8a;if(_0x447af2>=_0x446be9){_0x447af2=_0x446be9;_0x2a7b8a=0xc8;}else{_0x2a7b8a=0xce;}_0x5aac7b['status'](_0x2a7b8a);return _0x5aac7b[_0x57ba('0x22')](_0x57ba('0x23'),_0x494abb+'-'+_0x447af2+'/'+_0x446be9)[_0x57ba('0x20')](_0x3d27c4);}return null;};}function patchUpdates(_0x4649cd){return function(_0x3fbf2f){try{jsonpatch[_0x57ba('0x24')](_0x3fbf2f,_0x4649cd,!![]);}catch(_0x2f31b1){return BPromise['reject'](_0x2f31b1);}return _0x3fbf2f[_0x57ba('0x25')]();};}function saveUpdates(_0x3e6141,_0xb0824e){return function(_0x4bc3b2){if(_0x4bc3b2){return _0x4bc3b2['update'](_0x3e6141)['then'](function(_0x55c8a1){return _0x55c8a1;});}return null;};}function removeEntity(_0x3bdb9c,_0x5d06a0){return function(_0x27c5ce){if(_0x27c5ce){return _0x27c5ce[_0x57ba('0x26')]()[_0x57ba('0x27')](function(){_0x3bdb9c['status'](0xcc)[_0x57ba('0x28')]();});}};}function handleEntityNotFound(_0x310c84,_0x4333d8){return function(_0xab77e3){if(!_0xab77e3){_0x310c84['sendStatus'](0x194);}return _0xab77e3;};}function handleError(_0x191885,_0x3eb3ed){_0x3eb3ed=_0x3eb3ed||0x1f4;return function(_0x261be2){logger[_0x57ba('0x29')](_0x261be2[_0x57ba('0x2a')]);if(_0x261be2['name']){delete _0x261be2[_0x57ba('0x2b')];}_0x191885[_0x57ba('0x1f')](_0x3eb3ed)['send'](_0x261be2);};}exports['index']=function(_0x11d55f,_0x2e176d){var _0x326709={},_0x24a1fb={},_0x592157={'count':0x0,'rows':[]};var _0x254b83=_[_0x57ba('0x2c')](db[_0x57ba('0x2d')]['rawAttributes'],function(_0x329961){return{'name':_0x329961[_0x57ba('0x2e')],'type':_0x329961[_0x57ba('0x2f')][_0x57ba('0x30')]};});_0x24a1fb[_0x57ba('0x31')]=_['map'](_0x254b83,_0x57ba('0x2b'));_0x24a1fb['query']=_[_0x57ba('0x32')](_0x11d55f['query']);_0x24a1fb[_0x57ba('0x33')]=_['intersection'](_0x24a1fb['model'],_0x24a1fb[_0x57ba('0x34')]);_0x326709[_0x57ba('0x35')]=_[_0x57ba('0x36')](_0x24a1fb[_0x57ba('0x31')],qs[_0x57ba('0x37')](_0x11d55f[_0x57ba('0x34')][_0x57ba('0x37')]));_0x326709[_0x57ba('0x35')]=_0x326709[_0x57ba('0x35')][_0x57ba('0x38')]?_0x326709[_0x57ba('0x35')]:_0x24a1fb[_0x57ba('0x31')];if(!_0x11d55f['query']['hasOwnProperty']('nolimit')){_0x326709['limit']=qs[_0x57ba('0x39')](_0x11d55f[_0x57ba('0x34')]['limit']);_0x326709[_0x57ba('0x21')]=qs[_0x57ba('0x21')](_0x11d55f[_0x57ba('0x34')][_0x57ba('0x21')]);}_0x326709[_0x57ba('0x3a')]=qs[_0x57ba('0x3b')](_0x11d55f['query']['sort']);_0x326709['where']=qs[_0x57ba('0x33')](_[_0x57ba('0x3c')](_0x11d55f[_0x57ba('0x34')],_0x24a1fb[_0x57ba('0x33')]));if(_0x11d55f['query'][_0x57ba('0x3d')]){_0x326709['where']=_['merge'](_0x326709[_0x57ba('0x3e')],{'$or':_[_0x57ba('0x2c')](_0x254b83,function(_0x29c015){if(_0x29c015[_0x57ba('0x2f')]!==_0x57ba('0x3f')){var _0x2900d3={};_0x2900d3[_0x29c015[_0x57ba('0x2b')]]={'$like':'%'+_0x11d55f['query'][_0x57ba('0x3d')]+'%'};return _0x2900d3;}})});}_0x326709=_[_0x57ba('0x40')]({},_0x326709,_0x11d55f[_0x57ba('0x41')]);var _0x8cb9a9={'where':_0x326709['where']};return db['UserProfile'][_0x57ba('0x42')](_0x8cb9a9)[_0x57ba('0x27')](function(_0x56c0f3){_0x592157[_0x57ba('0x42')]=_0x56c0f3;if(_0x11d55f['query']['includeAll']){_0x326709[_0x57ba('0x43')]=[{'all':!![]}];}return db[_0x57ba('0x2d')]['findAll'](_0x326709);})[_0x57ba('0x27')](function(_0x4a00e7){_0x592157['rows']=_0x4a00e7;return _0x592157;})['then'](respondWithFilteredResult(_0x2e176d,_0x326709))[_0x57ba('0x44')](handleError(_0x2e176d,null));};exports[_0x57ba('0x45')]=function(_0x51d258,_0x1f9270){var _0x3ebb48={'raw':![],'where':{'id':_0x51d258[_0x57ba('0x46')]['id']}},_0x34f69f={};_0x34f69f[_0x57ba('0x31')]=_['keys'](db[_0x57ba('0x2d')][_0x57ba('0x47')]);_0x34f69f[_0x57ba('0x34')]=_['keys'](_0x51d258[_0x57ba('0x34')]);_0x34f69f[_0x57ba('0x33')]=_[_0x57ba('0x36')](_0x34f69f[_0x57ba('0x31')],_0x34f69f[_0x57ba('0x34')]);_0x3ebb48[_0x57ba('0x35')]=_[_0x57ba('0x36')](_0x34f69f[_0x57ba('0x31')],qs[_0x57ba('0x37')](_0x51d258[_0x57ba('0x34')][_0x57ba('0x37')]));_0x3ebb48[_0x57ba('0x35')]=_0x3ebb48[_0x57ba('0x35')][_0x57ba('0x38')]?_0x3ebb48[_0x57ba('0x35')]:_0x34f69f[_0x57ba('0x31')];if(_0x51d258[_0x57ba('0x34')][_0x57ba('0x48')]){_0x3ebb48[_0x57ba('0x43')]=[{'all':!![]}];}_0x3ebb48=_[_0x57ba('0x40')]({},_0x3ebb48,_0x51d258[_0x57ba('0x41')]);return db['UserProfile'][_0x57ba('0x49')](_0x3ebb48)[_0x57ba('0x27')](handleEntityNotFound(_0x1f9270,null))[_0x57ba('0x27')](respondWithResult(_0x1f9270,null))[_0x57ba('0x44')](handleError(_0x1f9270,null));};exports[_0x57ba('0x4a')]=function(_0x2c26bf,_0x4a54ff){return db['UserProfile'][_0x57ba('0x4a')](_0x2c26bf[_0x57ba('0x4b')],{})['then'](respondWithResult(_0x4a54ff,0xc9))['catch'](handleError(_0x4a54ff,null));};exports[_0x57ba('0x4c')]=function(_0xb154b9,_0x2dcc21){var _0x224f85={'where':{'id':_0xb154b9['params']['id']}},_0x4e5c03={};_0x4e5c03[_0x57ba('0x31')]=_['keys'](db['UserProfile']['rawAttributes']);_0x224f85['attributes']=_[_0x57ba('0x36')](_0x4e5c03[_0x57ba('0x31')],qs['fields'](_0xb154b9[_0x57ba('0x34')][_0x57ba('0x37')]));_0x224f85[_0x57ba('0x35')]=_0x224f85[_0x57ba('0x35')]['length']?_0x224f85['attributes']:_0x4e5c03['model'];if(_0xb154b9[_0x57ba('0x34')][_0x57ba('0x48')]){_0x224f85['include']=[{'all':!![]}];}_0x224f85=_['merge']({},_0x224f85,_0xb154b9[_0x57ba('0x41')]);return db[_0x57ba('0x2d')]['find'](_0x224f85)[_0x57ba('0x27')](handleEntityNotFound(_0x2dcc21,null))['then'](function(_0x14d259){if(_0x14d259){var _0x4dac2b=_0x14d259['get']({'plain':!![]});_0x4dac2b=qs[_0x57ba('0x4d')](_0x4dac2b,['id',_0x57ba('0x4e'),'updatedAt',_0x57ba('0x4f')]);_0xb154b9[_0x57ba('0x4b')]=_['omit'](_0xb154b9['body'],['id',_0x57ba('0x4e'),'updatedAt']);return db[_0x57ba('0x50')][_0x57ba('0x51')](function(_0x3a68f4){return db[_0x57ba('0x2d')][_0x57ba('0x4a')](_[_0x57ba('0x40')](_0x4dac2b,_0xb154b9[_0x57ba('0x4b')]),{'include':_0xb154b9[_0x57ba('0x34')][_0x57ba('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x3a68f4})[_0x57ba('0x27')](function(_0x102907){var _0x256680=_0x102907[_0x57ba('0x52')]({'plain':!![]});return db[_0x57ba('0x53')][_0x57ba('0x54')]({'where':{'userProfileId':_0xb154b9[_0x57ba('0x46')]['id']},'raw':!![]})[_0x57ba('0x27')](function(_0x191c95){if(_0x191c95){return BPromise[_0x57ba('0x55')](_0x191c95,function(_0x171e85){return new BPromise(function(_0x1b25e4,_0x50b109){if(_0x171e85[_0x57ba('0x56')]===null||_0x171e85[_0x57ba('0x56')]===0x1)_0x1b25e4(null);return db[_0x57ba('0x57')][_0x57ba('0x54')]({'where':{'sectionId':_0x171e85['id']},'raw':!![]})['then'](function(_0x37fc41){var _0x4142eb=_[_0x57ba('0x2c')](_0x37fc41,function(_0x5cf13a){return qs[_0x57ba('0x4d')](_0x5cf13a,['id',_0x57ba('0x4e'),_0x57ba('0x58'),_0x57ba('0x59')]);});_0x1b25e4(_0x4142eb);})[_0x57ba('0x44')](function(_0xcd0a66){_0x50b109(_0xcd0a66);});})[_0x57ba('0x27')](function(_0x5be1b2){var _0x2550ca=qs[_0x57ba('0x4d')](_0x171e85,['id',_0x57ba('0x4e'),_0x57ba('0x58')]);_0x2550ca[_0x57ba('0x5a')]=_0x256680['id'];if(_0x5be1b2)_0x2550ca[_0x57ba('0x5b')]=_0x5be1b2;return _0x2550ca;})['then'](function(_0x359c08){return db[_0x57ba('0x53')][_0x57ba('0x4a')](_0x359c08,{'include':[{'model':db[_0x57ba('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x3a68f4});});})[_0x57ba('0x27')](function(){return _0x256680;});}});});});}})[_0x57ba('0x27')](respondWithResult(_0x2dcc21,0xc9))[_0x57ba('0x44')](handleError(_0x2dcc21,null));};exports[_0x57ba('0x5c')]=function(_0x131c8f,_0x269f87){if(_0x131c8f['body']['id']){delete _0x131c8f[_0x57ba('0x4b')]['id'];}return db['UserProfile'][_0x57ba('0x49')]({'where':{'id':_0x131c8f[_0x57ba('0x46')]['id']}})[_0x57ba('0x27')](handleEntityNotFound(_0x269f87,null))[_0x57ba('0x27')](saveUpdates(_0x131c8f['body'],null))[_0x57ba('0x27')](respondWithResult(_0x269f87,null))[_0x57ba('0x44')](handleError(_0x269f87,null));};exports[_0x57ba('0x26')]=function(_0x1f395c,_0x2439bb){return db[_0x57ba('0x2d')]['find']({'where':{'id':_0x1f395c['params']['id']}})['then'](handleEntityNotFound(_0x2439bb,null))[_0x57ba('0x27')](removeEntity(_0x2439bb,null))[_0x57ba('0x44')](handleError(_0x2439bb,null));};exports[_0x57ba('0x5d')]=function(_0x3b84e6,_0x3a75d3){return db[_0x57ba('0x2d')][_0x57ba('0x5d')]()[_0x57ba('0x27')](respondWithResult(_0x3a75d3,null))[_0x57ba('0x44')](handleError(_0x3a75d3,null));};exports[_0x57ba('0x5e')]=function(_0x980cd0,_0x4f4a34){var _0x488bbb=_0x980cd0[_0x57ba('0x4b')];return db[_0x57ba('0x2d')]['find']({'where':{'id':_0x980cd0[_0x57ba('0x46')]['id']}})[_0x57ba('0x27')](handleEntityNotFound(_0x4f4a34,null))[_0x57ba('0x27')](function(_0x5138e0){if(_0x5138e0){return db['sequelize'][_0x57ba('0x51')](function(_0x2d7979){return db['UserProfileSection'][_0x57ba('0x26')]({'where':{'userProfileId':_0x980cd0[_0x57ba('0x46')]['id'],'sectionId':_['map'](_0x488bbb,function(_0x16866f){return _0x16866f['sectionId'];})},'transaction':_0x2d7979})['then'](function(){var _0x343d20=_[_0x57ba('0x2c')](_0x488bbb,function(_0x14ef0e){_0x14ef0e[_0x57ba('0x5a')]=_0x980cd0[_0x57ba('0x46')]['id'];return _0x14ef0e;});var _0x176470=[];return BPromise['each'](_0x343d20,function(_0x20b79d){return db[_0x57ba('0x53')][_0x57ba('0x4a')](_0x20b79d,{'include':[{'model':db[_0x57ba('0x57')],'as':_0x57ba('0x5b')}],'raw':!![],'transaction':_0x2d7979})[_0x57ba('0x27')](function(_0x5a33f2){_0x176470[_0x57ba('0x5f')](_0x5a33f2[_0x57ba('0x52')]({'plain':!![]}));});})[_0x57ba('0x27')](function(){return _0x176470;});});});}})['then'](function(_0x49d11c){return _0x49d11c;})['then'](respondWithResult(_0x4f4a34,null))[_0x57ba('0x44')](handleError(_0x4f4a34,null));};exports[_0x57ba('0x60')]=function(_0x35488f,_0x20ea08){var _0x39a661;return db[_0x57ba('0x2d')]['find']({'where':{'id':_0x35488f[_0x57ba('0x46')]['id']},'attributes':['id','name']})[_0x57ba('0x27')](handleEntityNotFound(_0x20ea08,null))['then'](function(_0x5ed815){if(_0x5ed815){_0x39a661=_0x5ed815;return db[_0x57ba('0x53')]['destroy']({'where':{'userProfileId':_0x35488f[_0x57ba('0x46')]['id'],'sectionId':_0x35488f[_0x57ba('0x34')][_0x57ba('0x61')]}});}})[_0x57ba('0x27')](function(){return _0x39a661;})[_0x57ba('0x27')](respondWithStatusCode(_0x20ea08,null))[_0x57ba('0x44')](handleError(_0x20ea08,null));};exports[_0x57ba('0x62')]=function(_0x6ec1af,_0x43d3cc){var _0x427cc5=[];var _0x5c8370=[];return db[_0x57ba('0x53')]['findAll']({'where':{'userProfileId':_0x6ec1af['params']['id']},'raw':!![]})[_0x57ba('0x27')](function(_0x8e3cc2){_0x427cc5=_['filter'](_0x8e3cc2,function(_0x33514f){return _0x33514f[_0x57ba('0x63')]===0x1;});if(!_[_0x57ba('0x64')](_0x427cc5)){return _[_0x57ba('0x2c')](_0x427cc5,function(_0x937ceb){return _0x937ceb[_0x57ba('0x59')];});}else{return;}})['then'](function(_0x445d90){if(_0x445d90)_0x5c8370=_0x445d90;if(_[_0x57ba('0x65')](_0x5c8370,0x64)){var _0x24a9ab=_[_0x57ba('0x49')](_0x427cc5,{'sectionId':0x64});return hasDefaultDashboard(_0x24a9ab)[_0x57ba('0x27')](function(_0x4aaba4){return _[_0x57ba('0x2c')](_0x427cc5,function(_0x489e1d){if(_0x489e1d[_0x57ba('0x59')]===0x64){_0x489e1d[_0x57ba('0x66')]=_0x4aaba4;}return _0x489e1d;});});}else{return;}})[_0x57ba('0x27')](function(_0x210c25){if(_0x210c25)_0x427cc5=_0x210c25;if(_[_0x57ba('0x65')](_0x5c8370,0x3eb)||_[_0x57ba('0x67')](_0x427cc5,{'enabled':![],'sectionId':0x3eb})){var _0x1f9796=_[_0x57ba('0x49')](_0x427cc5,{'sectionId':0x3eb});return getCustomDashboards(_0x1f9796)['then'](function(_0x56b201){return _[_0x57ba('0x2c')](_0x427cc5,function(_0xf9e6ec){if(_0xf9e6ec[_0x57ba('0x59')]===0x3eb){_0xf9e6ec['subsections']=_0x56b201;}return _0xf9e6ec;});});}else{return;}})['then'](function(_0xaf8827){if(_0xaf8827)_0x427cc5=_0xaf8827;if(_[_0x57ba('0x65')](_0x5c8370,0x709)||_[_0x57ba('0x67')](_0x427cc5,{'enabled':![],'sectionId':0x709})){var _0x138076=_[_0x57ba('0x49')](_0x427cc5,{'sectionId':0x709});return getPlugins(_0x138076)[_0x57ba('0x27')](function(_0x4475cb){return _['map'](_0x427cc5,function(_0x4bbbe4){if(_0x4bbbe4[_0x57ba('0x59')]===0x709){_0x4bbbe4[_0x57ba('0x66')]=_0x4475cb;}return _0x4bbbe4;});});}else{return;}})[_0x57ba('0x27')](function(_0x399441){if(_0x399441)_0x427cc5=_0x399441;return _0x427cc5;})['then'](respondWithResult(_0x43d3cc,null))[_0x57ba('0x44')](handleError(_0x43d3cc,null));};function hasDefaultDashboard(_0x89e03d){var _0x2a64a6=[0x65];return new BPromise(function(_0x52d2b7,_0x533a38){try{if(_0x89e03d[_0x57ba('0x56')]){_0x52d2b7(_0x2a64a6);}else{return db[_0x57ba('0x57')][_0x57ba('0x68')]({'where':{'sectionId':_0x89e03d['id']},'raw':!![]})[_0x57ba('0x27')](function(_0x7a33a0){if(_0x7a33a0){_0x52d2b7(_0x2a64a6);}});}}catch(_0x19e0fe){_0x533a38(_0x19e0fe);}});}function getCustomDashboards(_0x2f8686){var _0x5cef0f=[];return new BPromise(function(_0x2ba904,_0x312e3a){try{if(_0x2f8686[_0x57ba('0x56')]){return db[_0x57ba('0x69')]['findAll']({'raw':!![]})[_0x57ba('0x27')](function(_0x383652){_0x383652[_0x57ba('0x6a')](function(_0x47c6bb){_0x5cef0f[_0x57ba('0x5f')](_0x47c6bb['id']+0x1869f);});_0x2ba904(_0x5cef0f);});}else{return db[_0x57ba('0x57')]['findAll']({'where':{'sectionId':_0x2f8686['id']},'raw':!![]})['then'](function(_0x6c387a){_0x6c387a['forEach'](function(_0x42194b){_0x5cef0f[_0x57ba('0x5f')](_0x42194b['resourceId']+0x1869f);});_0x2ba904(_0x5cef0f);});}}catch(_0x54cec6){_0x312e3a(_0x54cec6);}});}function getPlugins(_0x253bc3){var _0x283e95=[];return new BPromise(function(_0x297b78,_0x14b4de){try{if(_0x253bc3[_0x57ba('0x56')]){return db[_0x57ba('0x6b')]['findAll']({'raw':!![]})['then'](function(_0x77d484){_0x77d484[_0x57ba('0x6a')](function(_0x3afdd5){_0x283e95[_0x57ba('0x5f')](_0x3afdd5['id']+0x15b38);});_0x297b78(_0x283e95);});}else{return db[_0x57ba('0x57')]['findAll']({'where':{'sectionId':_0x253bc3['id']},'raw':!![]})[_0x57ba('0x27')](function(_0x1e732e){_0x1e732e[_0x57ba('0x6a')](function(_0x10a118){_0x283e95[_0x57ba('0x5f')](_0x10a118[_0x57ba('0x6c')]+0x15b38);});_0x297b78(_0x283e95);});}}catch(_0x2e1502){_0x14b4de(_0x2e1502);}});}exports[_0x57ba('0x6d')]=function(_0x4737f1,_0x35a21c){return db['UserProfile']['find']({'where':{'id':_0x4737f1[_0x57ba('0x46')]['id']}})[_0x57ba('0x27')](handleEntityNotFound(_0x35a21c,null))[_0x57ba('0x27')](function(_0x2b0b5c){if(_0x2b0b5c){return db[_0x57ba('0x50')][_0x57ba('0x51')](function(_0x21fb66){return db[_0x57ba('0x53')]['findAll']({'where':{'userProfileId':_0x4737f1[_0x57ba('0x46')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x334bf5){if(_0x334bf5){return db[_0x57ba('0x53')]['destroy']({'where':{'userProfileId':_0x4737f1['params']['id'],'id':_[_0x57ba('0x2c')](_0x334bf5,function(_0x238f00){return _0x238f00['id'];})},'transaction':_0x21fb66});}})[_0x57ba('0x27')](function(_0x3ce228){var _0x5c9818=_[_0x57ba('0x2c')](_0x4737f1[_0x57ba('0x4b')],function(_0x3ef136){_0x3ef136[_0x57ba('0x5a')]=_0x4737f1[_0x57ba('0x46')]['id'];return _0x3ef136;});return db['UserProfileSection'][_0x57ba('0x6e')](_0x5c9818,{'raw':!![],'transaction':_0x21fb66});})['then'](function(_0x5bcbec){var _0x30752d=_[_0x57ba('0x3d')](_[_0x57ba('0x2c')](_0x5bcbec,function(_0x46ee1e){return _0x46ee1e[_0x57ba('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x30752d){return db[_0x57ba('0x53')]['findAll']({'where':{'userProfileId':_0x4737f1['params']['id'],'sectionId':_[_0x57ba('0x2c')](_0x30752d,function(_0xeb12c8){return _0xeb12c8[_0x57ba('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x57ba('0x27')](function(_0x40579a){var _0x3a4add=_[_0x57ba('0x2c')](_0x4737f1[_0x57ba('0x4b')],function(_0x224930){_0x224930[_0x57ba('0x5a')]=_0x4737f1[_0x57ba('0x46')]['id'];return _0x224930;});return db['UserProfileResource']['bulkCreate'](_0x3a4add,{'raw':!![],'transaction':_0x21fb66});});}})[_0x57ba('0x44')](handleError(_0x35a21c,null));});}})[_0x57ba('0x27')](function(_0x4cfd62){var _0x23523d=_[_0x57ba('0x2c')](_0x4cfd62,function(_0x1408f2){return _0x1408f2[_0x57ba('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0x35a21c,null))[_0x57ba('0x44')](handleError(_0x35a21c,null));};exports['removeResources']=function(_0x25dbe0,_0x14e049,_0x43e66d){return db[_0x57ba('0x2d')][_0x57ba('0x49')]({'where':{'id':_0x25dbe0[_0x57ba('0x46')]['id']}})[_0x57ba('0x27')](handleEntityNotFound(_0x14e049,null))['then'](function(_0x1fbf84){if(_0x1fbf84){return _0x1fbf84[_0x57ba('0x6f')](_0x25dbe0[_0x57ba('0x34')]['ids']);}})[_0x57ba('0x27')](respondWithStatusCode(_0x14e049,null))['catch'](handleError(_0x14e049,null));};exports[_0x57ba('0x70')]=function(_0x5db3bc,_0x3e54a3){var _0x4820e3={'raw':![],'where':{}};var _0x586e78={};var _0xe5fa84={'count':0x0,'rows':[]};var _0x5e8b2e=_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x71')];if(typeof _0x5e8b2e==='undefined'){throw new db[(_0x57ba('0x72'))][(_0x57ba('0x73'))](_0x57ba('0x74'));}var _0x19986e=_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x75')]||![];var _0x579dae=getQueryModels(_0x5e8b2e,_0x19986e);if(typeof _0x579dae[_0x57ba('0x76')]===_0x57ba('0x77')){throw new db[(_0x57ba('0x72'))][(_0x57ba('0x73'))](_0x57ba('0x78')+_0x5e8b2e+'\x27');}var _0x110129=[];if(!_[_0x57ba('0x64')](_0x579dae[_0x57ba('0x79')])){_0x110129=_0x579dae[_0x57ba('0x79')];}else{_0x110129=[{'name':_0x5e8b2e}];}return db[_0x57ba('0x2d')][_0x57ba('0x68')]({'where':{'id':_0x5db3bc[_0x57ba('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e54a3,null))['then'](function(_0x308ce7){if(_0x308ce7){var _0x9e299c=[];for(var _0x5b1467=0x0;_0x5b1467<_0x110129['length'];_0x5b1467++){_0x9e299c[_0x57ba('0x5f')](db[_0x57ba('0x53')]['findOne']({'where':{'userProfileId':_0x308ce7['id'],'name':_0x110129[_0x5b1467][_0x57ba('0x2b')]},'raw':!![]}));}return BPromise[_0x57ba('0x7a')](_0x9e299c);}})[_0x57ba('0x27')](function(_0x2503a9){var _0x17bd8a=_['filter'](_0x2503a9,function(_0x230af8){return _0x230af8?_0x230af8:undefined;});var _0x27ed82=_[_0x57ba('0x3d')](_0x110129,[_0x57ba('0x7b'),!![]]);var _0x2de77c=_['isEmpty'](_0x17bd8a)&&_[_0x57ba('0x64')](_0x27ed82)?null:_[_0x57ba('0x7c')](_0x27ed82,_0x17bd8a);if(_0x2de77c){var _0xda3d51=[];for(var _0x1fab65=0x0;_0x1fab65<_0x2de77c[_0x57ba('0x38')];_0x1fab65++){var _0x52d248=_[_0x57ba('0x49')](_0x110129,function(_0x39f651){return _0x2de77c[_0x1fab65]?_0x39f651[_0x57ba('0x2b')]===_0x2de77c[_0x1fab65][_0x57ba('0x2b')]:null;});if(_0x52d248){if(_0x2de77c[_0x1fab65][_0x57ba('0x7b')]){_0xda3d51['push'](getAllResources(_0x579dae[_0x57ba('0x76')],_0x2de77c[_0x1fab65]));}else{if(!_0x2de77c[_0x1fab65][_0x57ba('0x56')]){_0xda3d51[_0x57ba('0x5f')](getAllowedResources(_0x52d248,_0x2de77c[_0x1fab65],_0x579dae[_0x57ba('0x76')]));}else{if(_0x52d248[_0x57ba('0x31')]){_0xda3d51[_0x57ba('0x5f')](getAllFilteredResources(_0x52d248,_0x2de77c[_0x1fab65]));}}}}}return BPromise[_0x57ba('0x7a')](_0xda3d51);}else{return null;}})[_0x57ba('0x27')](function(_0x2f308b){var _0x4196c2=_0x2f308b;var _0x2dae80=null;if(_0x4196c2){_0x2dae80=_0x4196c2[_0x57ba('0x38')]===0x1?_0x4196c2[0x0]:null;}if(_0x2dae80||_0x4196c2){var _0x5334d6=db[_0x579dae[_0x57ba('0x76')]][_0x57ba('0x47')];_0x586e78[_0x57ba('0x31')]=_[_0x57ba('0x32')](_0x5334d6);_0x586e78[_0x57ba('0x34')]=_[_0x57ba('0x32')](_0x5db3bc[_0x57ba('0x34')]);_0x586e78[_0x57ba('0x33')]=_[_0x57ba('0x36')](_0x586e78[_0x57ba('0x31')],_0x586e78[_0x57ba('0x34')]);_0x4820e3[_0x57ba('0x35')]=_[_0x57ba('0x36')](_0x586e78['model'],qs['fields'](_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x37')]));_0x4820e3['attributes']=_0x4820e3[_0x57ba('0x35')]['length']?_0x4820e3['attributes']:_0x586e78['model'];if(!_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x7d')](_0x57ba('0x7e'))){_0x4820e3[_0x57ba('0x39')]=qs[_0x57ba('0x39')](_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x39')]);_0x4820e3[_0x57ba('0x21')]=qs[_0x57ba('0x21')](_0x5db3bc['query'][_0x57ba('0x21')]);}_0x4820e3[_0x57ba('0x3a')]=qs[_0x57ba('0x3b')](_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x3b')]);_0x4820e3['where']=qs[_0x57ba('0x33')](_['pick'](_0x5db3bc['query'],_0x586e78[_0x57ba('0x33')]));if(_0x5db3bc['query'][_0x57ba('0x3d')]){_0x4820e3['where']=_[_0x57ba('0x40')](_0x4820e3[_0x57ba('0x3e')],{'$or':_['map'](_0x5334d6,function(_0x5714a9){if(_0x5714a9['type']['key']!==_0x57ba('0x3f')){var _0x328c99={};_0x328c99[_0x5714a9['field']]={'$like':'%'+_0x5db3bc['query'][_0x57ba('0x3d')]+'%'};return _0x328c99;}})});}var _0x24e612=[];if(_0x2dae80){var _0x2207e0=_[_0x57ba('0x49')](_0x110129,[_0x57ba('0x2b'),_0x2dae80[_0x57ba('0x2b')]]);if(_0x2207e0[_0x57ba('0x7f')]){var _0x1d4b5c={};if(_0x579dae['childModel']==='AnalyticExtractedReport'){_0x1d4b5c[_0x2207e0[_0x57ba('0x80')]]=_['map'](_0x2dae80[_0x57ba('0x81')],'id');}else{_0x1d4b5c[_0x2207e0['foreignKey']]=_0x2dae80[_0x57ba('0x81')];}_0x24e612[_0x57ba('0x5f')](_0x1d4b5c);}else{_0x4820e3['where']['id']=_0x2dae80['associatedResources'];}}else{for(var _0xa6a82e=0x0;_0xa6a82e<_0x4196c2['length'];_0xa6a82e++){var _0x2207e0=_['find'](_0x110129,[_0x57ba('0x2b'),_0x4196c2[_0xa6a82e][_0x57ba('0x2b')]]);if(_0x2207e0[_0x57ba('0x7f')]){var _0x1d4b5c={};_0x1d4b5c[_0x2207e0['foreignKey']]=_0x4196c2[_0xa6a82e][_0x57ba('0x81')];_0x24e612[_0x57ba('0x5f')](_0x1d4b5c);}else{if(!_0x4820e3['where']['id'])_0x4820e3[_0x57ba('0x3e')]['id']=[];_0x4196c2[_0xa6a82e]['associatedResources'][_0x57ba('0x6a')](function(_0x373e3b){_0x4820e3[_0x57ba('0x3e')]['id'][_0x57ba('0x5f')](_0x373e3b);});}}}if(!_[_0x57ba('0x64')](_0x24e612)){_0x4820e3['where']=_[_0x57ba('0x40')](_0x4820e3[_0x57ba('0x3e')],{'$and':{'$or':_0x24e612}});}_0x4820e3=_[_0x57ba('0x40')]({},_0x4820e3,_0x5db3bc['options']);if(_0x2dae80&&!_0x2dae80[_0x57ba('0x56')]&&_0x579dae[_0x57ba('0x76')]===_0x57ba('0x82')){if(_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x48')]){_0x4820e3[_0x57ba('0x43')]=[{'all':!![]}];}return db[_0x579dae[_0x57ba('0x76')]][_0x57ba('0x54')](_0x4820e3)[_0x57ba('0x27')](function(_0x4cf555){var _0x3e686f=[];_0x4cf555['forEach'](function(_0x1eb819){var _0x132567;switch(_0x1eb819[_0x57ba('0x83')]){case _0x57ba('0x84'):_0x132567=_[_0x57ba('0x49')](_0x2dae80[_0x57ba('0x81')],function(_0x45de76){return _0x45de76['id']===_0x1eb819[_0x57ba('0x85')]&&_0x45de76[_0x57ba('0x2f')]===_0x57ba('0x86');});break;case'custom':_0x132567=_['find'](_0x2dae80['associatedResources'],function(_0x51b0d1){return _0x51b0d1['id']===_0x1eb819[_0x57ba('0x85')]&&_0x51b0d1['type']===_0x57ba('0x87');});break;}if(_0x132567)_0x3e686f[_0x57ba('0x5f')](_0x1eb819);});_0xe5fa84[_0x57ba('0x42')]=_0x3e686f[_0x57ba('0x38')];_0xe5fa84[_0x57ba('0x88')]=_0x3e686f;return _0xe5fa84;});}else{return db[_0x579dae['childModel']][_0x57ba('0x42')]({'where':_0x4820e3[_0x57ba('0x3e')]})[_0x57ba('0x27')](function(_0x3fbc6b){_0xe5fa84[_0x57ba('0x42')]=_0x3fbc6b;if(_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x48')]){if(_0x579dae[_0x57ba('0x76')]===_0x57ba('0x89')){_0x4820e3[_0x57ba('0x43')]=[{'model':db['Tag'],'as':_0x57ba('0x8a'),'attributes':['id',_0x57ba('0x2b'),_0x57ba('0x8b')],'required':_0x5db3bc['query'][_0x57ba('0x8c')]?!![]:![]},{'model':db['Tag'],'as':'ThroughTags','attributes':['id',_0x57ba('0x2b'),_0x57ba('0x8b')],'through':_0x5db3bc['query'][_0x57ba('0x8c')]?{'attributes':[],'where':{'TagId':_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x8c')]||undefined}}:{},'required':_0x5db3bc[_0x57ba('0x34')][_0x57ba('0x8c')]?!![]:![]}];}else{_0x4820e3[_0x57ba('0x43')]=[{'all':!![]}];}}return db[_0x579dae[_0x57ba('0x76')]][_0x57ba('0x54')](_0x4820e3);})['then'](function(_0x3f1b44){_0xe5fa84[_0x57ba('0x88')]=_0x3f1b44;return _0xe5fa84;});}}else{return _0xe5fa84;}})[_0x57ba('0x27')](respondWithFilteredResult(_0x3e54a3,_0x4820e3))[_0x57ba('0x44')](handleError(_0x3e54a3,null));};function getAllResources(_0x2a7afa,_0x4bdfec){return new BPromise(function(_0x5268b1,_0x575ba6){if(_0x4bdfec){var _0x5352b8=_0x4bdfec[_0x57ba('0x3d')]?{[_0x4bdfec[_0x57ba('0x3d')][_0x57ba('0x7f')]]:_0x4bdfec['filter']['value']}:undefined;return db[_0x2a7afa][_0x57ba('0x54')]({'where':_0x5352b8,'raw':!![]})[_0x57ba('0x27')](function(_0x14c178){_0x4bdfec[_0x57ba('0x81')]=_[_0x57ba('0x2c')](_0x14c178,'id');_0x5268b1(_0x4bdfec);})[_0x57ba('0x44')](function(_0x1510eb){_0x575ba6(_0x1510eb);});}else{_0x5268b1(null);}});}function getAllFilteredResources(_0xbb60e5,_0x39374d){return new BPromise(function(_0x4112cb,_0x95f846){var _0x32be8c=_0xbb60e5[_0x57ba('0x3d')]?{[_0xbb60e5['filter'][_0x57ba('0x7f')]]:_0xbb60e5[_0x57ba('0x3d')][_0x57ba('0x8d')]}:undefined;return db[_0xbb60e5[_0x57ba('0x31')]][_0x57ba('0x54')]({'where':_0x32be8c,'raw':!![]})[_0x57ba('0x27')](function(_0x1a1be3){_0x39374d[_0x57ba('0x81')]=_[_0x57ba('0x2c')](_0x1a1be3,function(_0x4b06b6){return _0x4b06b6[_0x57ba('0x2b')];});_0x4112cb(_0x39374d);})[_0x57ba('0x44')](function(_0x54db94){_0x95f846(_0x54db94);});});}function getAllowedResources(_0x57f0da,_0x41e0bd,_0x5356c7){return new BPromise(function(_0x1b3433,_0x298397){if(_0x41e0bd){return db[_0x57ba('0x57')]['findAll']({'where':{'sectionId':_0x41e0bd['id']},'raw':!![]})[_0x57ba('0x27')](function(_0x52a865){if(_0x57f0da[_0x57ba('0x7f')]&&_0x57f0da[_0x57ba('0x7f')]!=='id'){_0x41e0bd[_0x57ba('0x81')]=_[_0x57ba('0x2c')](_0x52a865,function(_0x3f7d06){return _0x3f7d06[_0x57f0da['field']];});}else{if(_0x5356c7===_0x57ba('0x82')){_0x41e0bd[_0x57ba('0x81')]=_[_0x57ba('0x2c')](_0x52a865,function(_0x1db312){return{'id':_0x1db312[_0x57ba('0x6c')],'type':_0x1db312[_0x57ba('0x2f')]};});}else{_0x41e0bd[_0x57ba('0x81')]=_[_0x57ba('0x2c')](_0x52a865,function(_0x98e8d5){return _0x98e8d5['resourceId'];});}}_0x1b3433(_0x41e0bd);})['catch'](function(_0x2b037f){_0x298397(_0x2b037f);});}else{_0x1b3433(null);}});}function getQueryModels(_0x3fd9ca,_0x39e57e){var _0x171c71=_0x3fd9ca[_0x57ba('0x8e')]();var _0x2b87d5={'childModel':undefined,'parentSections':[]};switch(_0x171c71){case _0x57ba('0x8f'):_0x2b87d5['childModel']=_0x57ba('0x90');break;case _0x57ba('0x91'):_0x2b87d5[_0x57ba('0x76')]='SquareOdbc';break;case'squarerecordings':_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0x92');_0x2b87d5[_0x57ba('0x79')]=[{'name':'SquareProjects','field':_0x57ba('0x2b'),'foreignKey':'projectName'}];break;case'projects':_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0x93');break;case'contacts':_0x2b87d5[_0x57ba('0x76')]='CmContact';_0x2b87d5[_0x57ba('0x79')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x57ba('0x94'):_0x2b87d5['childModel']=_0x57ba('0x95');break;case'companies':_0x2b87d5[_0x57ba('0x76')]='CmCompany';break;case'globalcustomfields':_0x2b87d5[_0x57ba('0x76')]='CmCustomField';break;case'chatqueues':_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0x96');break;case _0x57ba('0x97'):_0x2b87d5['childModel']='ChatWebsite';break;case'faxqueues':_0x2b87d5['childModel']=_0x57ba('0x98');break;case'faxaccounts':_0x2b87d5[_0x57ba('0x76')]='FaxAccount';break;case'inboundroutes':case _0x57ba('0x99'):case _0x57ba('0x9a'):_0x2b87d5[_0x57ba('0x76')]='VoiceExtension';break;case _0x57ba('0x9b'):_0x2b87d5['childModel']=_0x57ba('0x9c');break;case _0x57ba('0x9d'):_0x2b87d5['childModel']=_0x57ba('0x9e');break;case'voicerecordings':_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0x9f');_0x2b87d5[_0x57ba('0x79')]=[{'name':_0x57ba('0xa0'),'field':_0x57ba('0x2b'),'foreignKey':_0x57ba('0xa1'),'model':'User','filter':{'field':_0x57ba('0xa2'),'value':[_0x57ba('0xa3')]}},{'name':_0x57ba('0xa4'),'field':_0x57ba('0x2b'),'foreignKey':'membername','model':_0x57ba('0xa5'),'filter':{'field':'role','value':['telephone']}},{'name':_0x57ba('0xa6'),'field':_0x57ba('0x2b'),'foreignKey':_0x57ba('0xa7'),'model':_0x57ba('0xa8'),'filter':{'field':_0x57ba('0x2f'),'value':[_0x57ba('0xa9')]}},{'name':_0x57ba('0xaa'),'field':'name','foreignKey':_0x57ba('0xa7'),'model':_0x57ba('0xa8'),'filter':{'field':_0x57ba('0x2f'),'value':[_0x57ba('0xab')]}}];break;case _0x57ba('0xac'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xad');break;case _0x57ba('0xae'):_0x2b87d5[_0x57ba('0x76')]='VoiceChanSpy';break;case'voiceprefixes':_0x2b87d5['childModel']=_0x57ba('0xaf');break;case'ivrcampaigns':_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xb0');break;case'mailqueues':_0x2b87d5['childModel']=_0x57ba('0xb1');break;case _0x57ba('0xb2'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xb3');break;case _0x57ba('0xb4'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xb5');break;case _0x57ba('0xb6'):_0x2b87d5[_0x57ba('0x76')]='OpenchannelQueue';break;case _0x57ba('0xb7'):_0x2b87d5['childModel']=_0x57ba('0xb8');break;case'smsqueues':_0x2b87d5['childModel']=_0x57ba('0xb9');break;case'smsaccounts':_0x2b87d5['childModel']=_0x57ba('0xba');break;case _0x57ba('0xbb'):_0x2b87d5['childModel']=_0x57ba('0xbc');break;case _0x57ba('0xbd'):case'queuecampaigns':_0x2b87d5[_0x57ba('0x76')]='VoiceQueue';if(_0x39e57e){_0x2b87d5[_0x57ba('0x79')]=[{'name':_0x57ba('0xa6')},{'name':_0x57ba('0xaa')}];}break;case _0x57ba('0xbe'):case _0x57ba('0xbf'):case _0x57ba('0xc0'):_0x2b87d5['childModel']='User';if(_0x39e57e){_0x2b87d5[_0x57ba('0x79')]=[{'name':_0x57ba('0xc1'),'filter':{'field':'role','value':['admin',_0x57ba('0xc2')]},'ignore':!![]},{'name':_0x57ba('0xa0')},{'name':_0x57ba('0xa4')}];}break;case _0x57ba('0xc3'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xc4');break;case'salesforceaccounts':_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xc5');break;case _0x57ba('0xc6'):_0x2b87d5['childModel']='FreshdeskAccount';break;case _0x57ba('0xc7'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xc8');break;case'deskaccounts':_0x2b87d5['childModel']=_0x57ba('0xc9');break;case _0x57ba('0xca'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xcb');break;case'vtigeraccounts':_0x2b87d5[_0x57ba('0x76')]='User';break;case _0x57ba('0xcc'):_0x2b87d5['childModel']=_0x57ba('0xcd');break;case _0x57ba('0xce'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xcf');break;case _0x57ba('0xd0'):_0x2b87d5[_0x57ba('0x76')]='Dashboard';break;case'intervals':_0x2b87d5['childModel']='Interval';break;case _0x57ba('0xd1'):_0x2b87d5['childModel']=_0x57ba('0xd2');break;case _0x57ba('0xd3'):_0x2b87d5[_0x57ba('0x76')]='Schedule';break;case _0x57ba('0xd4'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xd5');break;case'tags':_0x2b87d5[_0x57ba('0x76')]='Tag';break;case _0x57ba('0xd6'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xd7');break;case _0x57ba('0xd8'):_0x2b87d5['childModel']=_0x57ba('0xd9');break;case'trunks':_0x2b87d5['childModel']=_0x57ba('0xda');break;case _0x57ba('0xdb'):_0x2b87d5['childModel']=_0x57ba('0xdc');break;case _0x57ba('0xdd'):_0x2b87d5['childModel']=_0x57ba('0x6b');break;case _0x57ba('0xde'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0x82');_0x2b87d5[_0x57ba('0x79')]=[{'name':_0x57ba('0xdf'),'field':'id','foreignKey':_0x57ba('0x85')}];break;case _0x57ba('0xe0'):_0x2b87d5[_0x57ba('0x76')]=_0x57ba('0xe1');break;default:return _0x2b87d5;}return _0x2b87d5;} \ No newline at end of file +var _0xe96a=['sequelize','UserProfileSection','each','autoAssociation','findAll','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','transaction','push','removeSections','ids','isEmpty','includes','subsections','some','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','Invalid\x20section\x20\x27','parentSections','all','ignore','union','order','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','squareprojects','SquareProject','odbc','SquareRecording','projects','JscriptyProject','contacts','ListId','lists','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','role','agent','Telephones','membername','User','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','users','telephones','Users','user','zendeskaccounts','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','extractedreports','metrics','AnalyticMetric','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','register','sendStatus','end','status','count','offset','limit','json','apply','reject','update','destroy','error','stack','name','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','then','includeAll','include','rows','catch','show','length','options','find','create','body','clone','params','get','omit','createdAt','updatedAt'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xe96a,0x92));var _0xae96=function(_0x697a85,_0x238db2){_0x697a85=_0x697a85-0x0;var _0x4a6ba9=_0xe96a[_0x697a85];return _0x4a6ba9;};'use strict';var pdf=require(_0xae96('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xae96('0x1'));var zipdir=require(_0xae96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xae96('0x3'));var BPromise=require(_0xae96('0x4'));var Mustache=require(_0xae96('0x5'));var util=require(_0xae96('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xae96('0x7'));var squel=require(_0xae96('0x8'));var crypto=require('crypto');var jsforce=require(_0xae96('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xae96('0xa'));var querystring=require(_0xae96('0xb'));var Papa=require(_0xae96('0xc'));var Redis=require(_0xae96('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xae96('0xe'));var as=require(_0xae96('0xf'));var hardwareService=require(_0xae96('0x10'));var logger=require(_0xae96('0x11'))(_0xae96('0x12'));var utils=require(_0xae96('0x13'));var config=require(_0xae96('0x14'));var db=require(_0xae96('0x15'))['db'];config[_0xae96('0x16')]=_['defaults'](config[_0xae96('0x16')],{'host':_0xae96('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xae96('0x18'))[_0xae96('0x19')](socket);function respondWithStatusCode(_0x406e55,_0x1ce31e){_0x1ce31e=_0x1ce31e||0xcc;return function(_0x315f0a){if(_0x315f0a){return _0x406e55[_0xae96('0x1a')](_0x1ce31e);}return _0x406e55['status'](_0x1ce31e)[_0xae96('0x1b')]();};}function respondWithResult(_0x250eb4,_0x8ed148){_0x8ed148=_0x8ed148||0xc8;return function(_0x4c9d09){if(_0x4c9d09){return _0x250eb4[_0xae96('0x1c')](_0x8ed148)['json'](_0x4c9d09);}};}function respondWithFilteredResult(_0x241341,_0x1c039e){return function(_0x3f03af){if(_0x3f03af){var _0xac3e26=_0x3f03af[_0xae96('0x1d')],_0x4af1c5=_0x1c039e[_0xae96('0x1e')],_0x59cef1=_0x1c039e['offset']+_0x1c039e[_0xae96('0x1f')],_0x32ff2d;if(_0x59cef1>=_0xac3e26){_0x59cef1=_0xac3e26;_0x32ff2d=0xc8;}else{_0x32ff2d=0xce;}_0x241341[_0xae96('0x1c')](_0x32ff2d);return _0x241341['set']('Content-Range',_0x4af1c5+'-'+_0x59cef1+'/'+_0xac3e26)[_0xae96('0x20')](_0x3f03af);}return null;};}function patchUpdates(_0xb871bf){return function(_0xad4d7d){try{jsonpatch[_0xae96('0x21')](_0xad4d7d,_0xb871bf,!![]);}catch(_0x3349f2){return BPromise[_0xae96('0x22')](_0x3349f2);}return _0xad4d7d['save']();};}function saveUpdates(_0x6be734,_0x5564e8){return function(_0x1641a9){if(_0x1641a9){return _0x1641a9[_0xae96('0x23')](_0x6be734)['then'](function(_0x40e2e5){return _0x40e2e5;});}return null;};}function removeEntity(_0x1e3f25,_0x5d2765){return function(_0x16d6f6){if(_0x16d6f6){return _0x16d6f6[_0xae96('0x24')]()['then'](function(){_0x1e3f25[_0xae96('0x1c')](0xcc)[_0xae96('0x1b')]();});}};}function handleEntityNotFound(_0x48ea47,_0x34b8f9){return function(_0x5cba31){if(!_0x5cba31){_0x48ea47[_0xae96('0x1a')](0x194);}return _0x5cba31;};}function handleError(_0x176df2,_0x55a88b){_0x55a88b=_0x55a88b||0x1f4;return function(_0x38fb23){logger[_0xae96('0x25')](_0x38fb23[_0xae96('0x26')]);if(_0x38fb23['name']){delete _0x38fb23[_0xae96('0x27')];}_0x176df2[_0xae96('0x1c')](_0x55a88b)['send'](_0x38fb23);};}exports['index']=function(_0x10f551,_0x1a3109){var _0x1ef322={},_0x543dae={},_0x3e9922={'count':0x0,'rows':[]};var _0x4140ff=_[_0xae96('0x28')](db[_0xae96('0x29')][_0xae96('0x2a')],function(_0x22e51b){return{'name':_0x22e51b[_0xae96('0x2b')],'type':_0x22e51b[_0xae96('0x2c')][_0xae96('0x2d')]};});_0x543dae[_0xae96('0x2e')]=_[_0xae96('0x28')](_0x4140ff,_0xae96('0x27'));_0x543dae[_0xae96('0x2f')]=_[_0xae96('0x30')](_0x10f551[_0xae96('0x2f')]);_0x543dae[_0xae96('0x31')]=_[_0xae96('0x32')](_0x543dae[_0xae96('0x2e')],_0x543dae[_0xae96('0x2f')]);_0x1ef322[_0xae96('0x33')]=_[_0xae96('0x32')](_0x543dae[_0xae96('0x2e')],qs[_0xae96('0x34')](_0x10f551[_0xae96('0x2f')][_0xae96('0x34')]));_0x1ef322['attributes']=_0x1ef322[_0xae96('0x33')]['length']?_0x1ef322[_0xae96('0x33')]:_0x543dae['model'];if(!_0x10f551[_0xae96('0x2f')][_0xae96('0x35')](_0xae96('0x36'))){_0x1ef322[_0xae96('0x1f')]=qs[_0xae96('0x1f')](_0x10f551[_0xae96('0x2f')][_0xae96('0x1f')]);_0x1ef322['offset']=qs[_0xae96('0x1e')](_0x10f551['query'][_0xae96('0x1e')]);}_0x1ef322['order']=qs[_0xae96('0x37')](_0x10f551[_0xae96('0x2f')][_0xae96('0x37')]);_0x1ef322['where']=qs[_0xae96('0x31')](_[_0xae96('0x38')](_0x10f551['query'],_0x543dae[_0xae96('0x31')]));if(_0x10f551[_0xae96('0x2f')]['filter']){_0x1ef322[_0xae96('0x39')]=_[_0xae96('0x3a')](_0x1ef322[_0xae96('0x39')],{'$or':_[_0xae96('0x28')](_0x4140ff,function(_0x3e22d0){if(_0x3e22d0[_0xae96('0x2c')]!==_0xae96('0x3b')){var _0x2989f9={};_0x2989f9[_0x3e22d0[_0xae96('0x27')]]={'$like':'%'+_0x10f551['query'][_0xae96('0x3c')]+'%'};return _0x2989f9;}})});}_0x1ef322=_['merge']({},_0x1ef322,_0x10f551['options']);var _0x3e6c69={'where':_0x1ef322['where']};return db[_0xae96('0x29')][_0xae96('0x1d')](_0x3e6c69)[_0xae96('0x3d')](function(_0x1306a5){_0x3e9922[_0xae96('0x1d')]=_0x1306a5;if(_0x10f551[_0xae96('0x2f')][_0xae96('0x3e')]){_0x1ef322[_0xae96('0x3f')]=[{'all':!![]}];}return db[_0xae96('0x29')]['findAll'](_0x1ef322);})[_0xae96('0x3d')](function(_0x5f36da){_0x3e9922[_0xae96('0x40')]=_0x5f36da;return _0x3e9922;})[_0xae96('0x3d')](respondWithFilteredResult(_0x1a3109,_0x1ef322))[_0xae96('0x41')](handleError(_0x1a3109,null));};exports[_0xae96('0x42')]=function(_0x3a8fc4,_0x296971){var _0x8fe5a8={'raw':![],'where':{'id':_0x3a8fc4['params']['id']}},_0x35f90f={};_0x35f90f['model']=_['keys'](db[_0xae96('0x29')][_0xae96('0x2a')]);_0x35f90f['query']=_[_0xae96('0x30')](_0x3a8fc4[_0xae96('0x2f')]);_0x35f90f[_0xae96('0x31')]=_[_0xae96('0x32')](_0x35f90f[_0xae96('0x2e')],_0x35f90f['query']);_0x8fe5a8['attributes']=_[_0xae96('0x32')](_0x35f90f[_0xae96('0x2e')],qs[_0xae96('0x34')](_0x3a8fc4['query'][_0xae96('0x34')]));_0x8fe5a8[_0xae96('0x33')]=_0x8fe5a8[_0xae96('0x33')][_0xae96('0x43')]?_0x8fe5a8['attributes']:_0x35f90f[_0xae96('0x2e')];if(_0x3a8fc4[_0xae96('0x2f')]['includeAll']){_0x8fe5a8[_0xae96('0x3f')]=[{'all':!![]}];}_0x8fe5a8=_[_0xae96('0x3a')]({},_0x8fe5a8,_0x3a8fc4[_0xae96('0x44')]);return db[_0xae96('0x29')][_0xae96('0x45')](_0x8fe5a8)['then'](handleEntityNotFound(_0x296971,null))['then'](respondWithResult(_0x296971,null))['catch'](handleError(_0x296971,null));};exports[_0xae96('0x46')]=function(_0x45f8f7,_0xf2c387){return db[_0xae96('0x29')][_0xae96('0x46')](_0x45f8f7[_0xae96('0x47')],{})[_0xae96('0x3d')](respondWithResult(_0xf2c387,0xc9))[_0xae96('0x41')](handleError(_0xf2c387,null));};exports[_0xae96('0x48')]=function(_0x2a728d,_0x509a2e){var _0x564e63={'where':{'id':_0x2a728d[_0xae96('0x49')]['id']}},_0x1ae508={};_0x1ae508['model']=_[_0xae96('0x30')](db['UserProfile'][_0xae96('0x2a')]);_0x564e63[_0xae96('0x33')]=_[_0xae96('0x32')](_0x1ae508[_0xae96('0x2e')],qs[_0xae96('0x34')](_0x2a728d[_0xae96('0x2f')][_0xae96('0x34')]));_0x564e63[_0xae96('0x33')]=_0x564e63['attributes'][_0xae96('0x43')]?_0x564e63[_0xae96('0x33')]:_0x1ae508[_0xae96('0x2e')];if(_0x2a728d[_0xae96('0x2f')][_0xae96('0x3e')]){_0x564e63['include']=[{'all':!![]}];}_0x564e63=_[_0xae96('0x3a')]({},_0x564e63,_0x2a728d['options']);return db[_0xae96('0x29')][_0xae96('0x45')](_0x564e63)[_0xae96('0x3d')](handleEntityNotFound(_0x509a2e,null))[_0xae96('0x3d')](function(_0x14445a){if(_0x14445a){var _0x4ac438=_0x14445a[_0xae96('0x4a')]({'plain':!![]});_0x4ac438=qs[_0xae96('0x4b')](_0x4ac438,['id',_0xae96('0x4c'),'updatedAt','crudPermissions']);_0x2a728d[_0xae96('0x47')]=_[_0xae96('0x4b')](_0x2a728d[_0xae96('0x47')],['id',_0xae96('0x4c'),_0xae96('0x4d')]);return db[_0xae96('0x4e')]['transaction'](function(_0x2cde55){return db[_0xae96('0x29')][_0xae96('0x46')](_['merge'](_0x4ac438,_0x2a728d[_0xae96('0x47')]),{'include':_0x2a728d[_0xae96('0x2f')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x2cde55})['then'](function(_0x3e38fd){var _0x243b5b=_0x3e38fd[_0xae96('0x4a')]({'plain':!![]});return db[_0xae96('0x4f')]['findAll']({'where':{'userProfileId':_0x2a728d[_0xae96('0x49')]['id']},'raw':!![]})[_0xae96('0x3d')](function(_0x2ecdeb){if(_0x2ecdeb){return BPromise[_0xae96('0x50')](_0x2ecdeb,function(_0x262a1d){return new BPromise(function(_0x49811b,_0x4e7047){if(_0x262a1d[_0xae96('0x51')]===null||_0x262a1d[_0xae96('0x51')]===0x1)_0x49811b(null);return db['UserProfileResource'][_0xae96('0x52')]({'where':{'sectionId':_0x262a1d['id']},'raw':!![]})[_0xae96('0x3d')](function(_0x3e88d5){var _0x424eac=_[_0xae96('0x28')](_0x3e88d5,function(_0x58d88c){return qs[_0xae96('0x4b')](_0x58d88c,['id',_0xae96('0x4c'),'updatedAt',_0xae96('0x53')]);});_0x49811b(_0x424eac);})['catch'](function(_0x4d2c96){_0x4e7047(_0x4d2c96);});})['then'](function(_0x13ecd6){var _0x4253a5=qs[_0xae96('0x4b')](_0x262a1d,['id','createdAt',_0xae96('0x4d')]);_0x4253a5[_0xae96('0x54')]=_0x243b5b['id'];if(_0x13ecd6)_0x4253a5[_0xae96('0x55')]=_0x13ecd6;return _0x4253a5;})[_0xae96('0x3d')](function(_0x244374){return db['UserProfileSection']['create'](_0x244374,{'include':[{'model':db[_0xae96('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x2cde55});});})[_0xae96('0x3d')](function(){return _0x243b5b;});}});});});}})[_0xae96('0x3d')](respondWithResult(_0x509a2e,0xc9))[_0xae96('0x41')](handleError(_0x509a2e,null));};exports[_0xae96('0x23')]=function(_0x26c722,_0x283c36){if(_0x26c722[_0xae96('0x47')]['id']){delete _0x26c722[_0xae96('0x47')]['id'];}return db[_0xae96('0x29')]['find']({'where':{'id':_0x26c722[_0xae96('0x49')]['id']}})[_0xae96('0x3d')](handleEntityNotFound(_0x283c36,null))[_0xae96('0x3d')](saveUpdates(_0x26c722[_0xae96('0x47')],null))[_0xae96('0x3d')](respondWithResult(_0x283c36,null))[_0xae96('0x41')](handleError(_0x283c36,null));};exports[_0xae96('0x24')]=function(_0x1927b8,_0x10e8f3){return db[_0xae96('0x29')][_0xae96('0x45')]({'where':{'id':_0x1927b8[_0xae96('0x49')]['id']}})[_0xae96('0x3d')](handleEntityNotFound(_0x10e8f3,null))[_0xae96('0x3d')](removeEntity(_0x10e8f3,null))[_0xae96('0x41')](handleError(_0x10e8f3,null));};exports[_0xae96('0x57')]=function(_0x4d9f6d,_0x76d0f6){return db[_0xae96('0x29')][_0xae96('0x57')]()[_0xae96('0x3d')](respondWithResult(_0x76d0f6,null))[_0xae96('0x41')](handleError(_0x76d0f6,null));};exports[_0xae96('0x58')]=function(_0x200514,_0xcac3a6){var _0xad5930=_0x200514[_0xae96('0x47')];return db[_0xae96('0x29')][_0xae96('0x45')]({'where':{'id':_0x200514[_0xae96('0x49')]['id']}})[_0xae96('0x3d')](handleEntityNotFound(_0xcac3a6,null))[_0xae96('0x3d')](function(_0x5e7f59){if(_0x5e7f59){return db[_0xae96('0x4e')][_0xae96('0x59')](function(_0x52eccf){return db[_0xae96('0x4f')]['destroy']({'where':{'userProfileId':_0x200514[_0xae96('0x49')]['id'],'sectionId':_['map'](_0xad5930,function(_0x4ae509){return _0x4ae509['sectionId'];})},'transaction':_0x52eccf})[_0xae96('0x3d')](function(){var _0x412e94=_[_0xae96('0x28')](_0xad5930,function(_0x11a83d){_0x11a83d[_0xae96('0x54')]=_0x200514[_0xae96('0x49')]['id'];return _0x11a83d;});var _0x54739a=[];return BPromise[_0xae96('0x50')](_0x412e94,function(_0x46061a){return db[_0xae96('0x4f')][_0xae96('0x46')](_0x46061a,{'include':[{'model':db[_0xae96('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x52eccf})[_0xae96('0x3d')](function(_0x5f217b){_0x54739a[_0xae96('0x5a')](_0x5f217b['get']({'plain':!![]}));});})[_0xae96('0x3d')](function(){return _0x54739a;});});});}})[_0xae96('0x3d')](function(_0x5781ec){return _0x5781ec;})[_0xae96('0x3d')](respondWithResult(_0xcac3a6,null))[_0xae96('0x41')](handleError(_0xcac3a6,null));};exports[_0xae96('0x5b')]=function(_0x33fbd1,_0x1bb3af){var _0x585171;return db['UserProfile'][_0xae96('0x45')]({'where':{'id':_0x33fbd1['params']['id']},'attributes':['id',_0xae96('0x27')]})[_0xae96('0x3d')](handleEntityNotFound(_0x1bb3af,null))['then'](function(_0x9b5be3){if(_0x9b5be3){_0x585171=_0x9b5be3;return db[_0xae96('0x4f')][_0xae96('0x24')]({'where':{'userProfileId':_0x33fbd1[_0xae96('0x49')]['id'],'sectionId':_0x33fbd1['query'][_0xae96('0x5c')]}});}})['then'](function(){return _0x585171;})['then'](respondWithStatusCode(_0x1bb3af,null))['catch'](handleError(_0x1bb3af,null));};exports['getSections']=function(_0x8a2e33,_0x218831){var _0xc8dcb4=[];var _0x29c47f=[];return db[_0xae96('0x4f')][_0xae96('0x52')]({'where':{'userProfileId':_0x8a2e33[_0xae96('0x49')]['id']},'raw':!![]})[_0xae96('0x3d')](function(_0x46ab57){_0xc8dcb4=_[_0xae96('0x3c')](_0x46ab57,function(_0x349849){return _0x349849['enabled']===0x1;});if(!_[_0xae96('0x5d')](_0xc8dcb4)){return _[_0xae96('0x28')](_0xc8dcb4,function(_0x461c4b){return _0x461c4b[_0xae96('0x53')];});}else{return;}})[_0xae96('0x3d')](function(_0x235ced){if(_0x235ced)_0x29c47f=_0x235ced;if(_[_0xae96('0x5e')](_0x29c47f,0x64)){var _0xa5e06=_[_0xae96('0x45')](_0xc8dcb4,{'sectionId':0x64});return hasDefaultDashboard(_0xa5e06)[_0xae96('0x3d')](function(_0x236ed8){return _[_0xae96('0x28')](_0xc8dcb4,function(_0x37e342){if(_0x37e342['sectionId']===0x64){_0x37e342[_0xae96('0x5f')]=_0x236ed8;}return _0x37e342;});});}else{return;}})[_0xae96('0x3d')](function(_0x3a9c3f){if(_0x3a9c3f)_0xc8dcb4=_0x3a9c3f;if(_['includes'](_0x29c47f,0x3eb)||_[_0xae96('0x60')](_0xc8dcb4,{'enabled':![],'sectionId':0x3eb})){var _0x2e8d7b=_['find'](_0xc8dcb4,{'sectionId':0x3eb});return getCustomDashboards(_0x2e8d7b)[_0xae96('0x3d')](function(_0x5bcb4e){return _[_0xae96('0x28')](_0xc8dcb4,function(_0x1dd18e){if(_0x1dd18e['sectionId']===0x3eb){_0x1dd18e[_0xae96('0x5f')]=_0x5bcb4e;}return _0x1dd18e;});});}else{return;}})['then'](function(_0x385f88){if(_0x385f88)_0xc8dcb4=_0x385f88;if(_['includes'](_0x29c47f,0x709)||_[_0xae96('0x60')](_0xc8dcb4,{'enabled':![],'sectionId':0x709})){var _0x29f7b3=_[_0xae96('0x45')](_0xc8dcb4,{'sectionId':0x709});return getPlugins(_0x29f7b3)[_0xae96('0x3d')](function(_0x117cdc){return _[_0xae96('0x28')](_0xc8dcb4,function(_0x31503e){if(_0x31503e['sectionId']===0x709){_0x31503e[_0xae96('0x5f')]=_0x117cdc;}return _0x31503e;});});}else{return;}})[_0xae96('0x3d')](function(_0x1cbbb1){if(_0x1cbbb1)_0xc8dcb4=_0x1cbbb1;return _0xc8dcb4;})[_0xae96('0x3d')](respondWithResult(_0x218831,null))[_0xae96('0x41')](handleError(_0x218831,null));};function hasDefaultDashboard(_0x4c7da6){var _0x41a74c=[0x65];return new BPromise(function(_0x2c3675,_0x2dc6b0){try{if(_0x4c7da6['autoAssociation']){_0x2c3675(_0x41a74c);}else{return db[_0xae96('0x56')][_0xae96('0x61')]({'where':{'sectionId':_0x4c7da6['id']},'raw':!![]})[_0xae96('0x3d')](function(_0x377543){if(_0x377543){_0x2c3675(_0x41a74c);}});}}catch(_0xd7f46c){_0x2dc6b0(_0xd7f46c);}});}function getCustomDashboards(_0x1a6dfd){var _0x2d4b72=[];return new BPromise(function(_0x335aa1,_0x50b1dd){try{if(_0x1a6dfd['autoAssociation']){return db[_0xae96('0x62')]['findAll']({'raw':!![]})['then'](function(_0x3bf650){_0x3bf650[_0xae96('0x63')](function(_0x553951){_0x2d4b72['push'](_0x553951['id']+0x1869f);});_0x335aa1(_0x2d4b72);});}else{return db[_0xae96('0x56')][_0xae96('0x52')]({'where':{'sectionId':_0x1a6dfd['id']},'raw':!![]})[_0xae96('0x3d')](function(_0x1d994e){_0x1d994e[_0xae96('0x63')](function(_0x19ed53){_0x2d4b72[_0xae96('0x5a')](_0x19ed53['resourceId']+0x1869f);});_0x335aa1(_0x2d4b72);});}}catch(_0x3de297){_0x50b1dd(_0x3de297);}});}function getPlugins(_0x3f0ceb){var _0x15d8ff=[];return new BPromise(function(_0x5edfd2,_0x3c9ae0){try{if(_0x3f0ceb[_0xae96('0x51')]){return db[_0xae96('0x64')][_0xae96('0x52')]({'raw':!![]})[_0xae96('0x3d')](function(_0x1b4312){_0x1b4312['forEach'](function(_0x59b2ec){_0x15d8ff[_0xae96('0x5a')](_0x59b2ec['id']+0x15b38);});_0x5edfd2(_0x15d8ff);});}else{return db[_0xae96('0x56')]['findAll']({'where':{'sectionId':_0x3f0ceb['id']},'raw':!![]})[_0xae96('0x3d')](function(_0x137335){_0x137335[_0xae96('0x63')](function(_0x2f075c){_0x15d8ff[_0xae96('0x5a')](_0x2f075c[_0xae96('0x65')]+0x15b38);});_0x5edfd2(_0x15d8ff);});}}catch(_0x2e050b){_0x3c9ae0(_0x2e050b);}});}exports[_0xae96('0x66')]=function(_0x51e98f,_0x4bd070){return db[_0xae96('0x29')][_0xae96('0x45')]({'where':{'id':_0x51e98f[_0xae96('0x49')]['id']}})[_0xae96('0x3d')](handleEntityNotFound(_0x4bd070,null))[_0xae96('0x3d')](function(_0x2af60a){if(_0x2af60a){return db[_0xae96('0x4e')][_0xae96('0x59')](function(_0x5d6767){return db[_0xae96('0x4f')][_0xae96('0x52')]({'where':{'userProfileId':_0x51e98f[_0xae96('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0xae96('0x3d')](function(_0x18dbaf){if(_0x18dbaf){return db[_0xae96('0x4f')][_0xae96('0x24')]({'where':{'userProfileId':_0x51e98f['params']['id'],'id':_[_0xae96('0x28')](_0x18dbaf,function(_0x178364){return _0x178364['id'];})},'transaction':_0x5d6767});}})[_0xae96('0x3d')](function(_0x4f9bfa){var _0x21088d=_[_0xae96('0x28')](_0x51e98f[_0xae96('0x47')],function(_0x5e6781){_0x5e6781[_0xae96('0x54')]=_0x51e98f['params']['id'];return _0x5e6781;});return db[_0xae96('0x4f')][_0xae96('0x67')](_0x21088d,{'raw':!![],'transaction':_0x5d6767});})[_0xae96('0x3d')](function(_0x3fa038){var _0x1a8917=_[_0xae96('0x3c')](_[_0xae96('0x28')](_0x3fa038,function(_0x30ce7a){return _0x30ce7a[_0xae96('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x1a8917){return db[_0xae96('0x4f')]['findAll']({'where':{'userProfileId':_0x51e98f[_0xae96('0x49')]['id'],'sectionId':_[_0xae96('0x28')](_0x1a8917,function(_0x21ce64){return _0x21ce64[_0xae96('0x53')];})},'attributes':['id',_0xae96('0x53')],'raw':!![]})[_0xae96('0x3d')](function(_0x4f0d54){var _0x5812e3=_[_0xae96('0x28')](_0x51e98f['body'],function(_0x249fc4){_0x249fc4[_0xae96('0x54')]=_0x51e98f[_0xae96('0x49')]['id'];return _0x249fc4;});return db['UserProfileResource']['bulkCreate'](_0x5812e3,{'raw':!![],'transaction':_0x5d6767});});}})['catch'](handleError(_0x4bd070,null));});}})[_0xae96('0x3d')](function(_0x4a81bd){var _0xa2299d=_[_0xae96('0x28')](_0x4a81bd,function(_0x10a7b2){return _0x10a7b2['get']({'plain':!![]});});})[_0xae96('0x3d')](respondWithResult(_0x4bd070,null))[_0xae96('0x41')](handleError(_0x4bd070,null));};exports[_0xae96('0x68')]=function(_0x255c59,_0x420284,_0x2513c0){return db[_0xae96('0x29')][_0xae96('0x45')]({'where':{'id':_0x255c59[_0xae96('0x49')]['id']}})[_0xae96('0x3d')](handleEntityNotFound(_0x420284,null))[_0xae96('0x3d')](function(_0x1cd4e6){if(_0x1cd4e6){return _0x1cd4e6[_0xae96('0x68')](_0x255c59['query'][_0xae96('0x5c')]);}})[_0xae96('0x3d')](respondWithStatusCode(_0x420284,null))[_0xae96('0x41')](handleError(_0x420284,null));};exports['getResources']=function(_0x23b6be,_0x9dbe3f){var _0x2a1ee1={'raw':![],'where':{}};var _0xe7837={};var _0x5deba8={'count':0x0,'rows':[]};var _0x2e73c8=_0x23b6be[_0xae96('0x2f')][_0xae96('0x69')];if(typeof _0x2e73c8===_0xae96('0x6a')){throw new db[(_0xae96('0x6b'))][(_0xae96('0x6c'))](_0xae96('0x6d'));}var _0x139f2a=_0x23b6be['query']['mergeResources']||![];var _0x27afa3=getQueryModels(_0x2e73c8,_0x139f2a);if(typeof _0x27afa3[_0xae96('0x6e')]==='undefined'){throw new db[(_0xae96('0x6b'))]['ValidationError'](_0xae96('0x6f')+_0x2e73c8+'\x27');}var _0x1c11c8=[];if(!_[_0xae96('0x5d')](_0x27afa3['parentSections'])){_0x1c11c8=_0x27afa3[_0xae96('0x70')];}else{_0x1c11c8=[{'name':_0x2e73c8}];}return db[_0xae96('0x29')][_0xae96('0x61')]({'where':{'id':_0x23b6be[_0xae96('0x49')]['id']}})[_0xae96('0x3d')](handleEntityNotFound(_0x9dbe3f,null))['then'](function(_0x55a3da){if(_0x55a3da){var _0x154faa=[];for(var _0x8e270a=0x0;_0x8e270a<_0x1c11c8['length'];_0x8e270a++){_0x154faa['push'](db[_0xae96('0x4f')][_0xae96('0x61')]({'where':{'userProfileId':_0x55a3da['id'],'name':_0x1c11c8[_0x8e270a][_0xae96('0x27')]},'raw':!![]}));}return BPromise[_0xae96('0x71')](_0x154faa);}})['then'](function(_0x19d0d9){var _0x3b6d1d=_[_0xae96('0x3c')](_0x19d0d9,function(_0x194e30){return _0x194e30?_0x194e30:undefined;});var _0x34652f=_[_0xae96('0x3c')](_0x1c11c8,[_0xae96('0x72'),!![]]);var _0x432b4a=_[_0xae96('0x5d')](_0x3b6d1d)&&_[_0xae96('0x5d')](_0x34652f)?null:_[_0xae96('0x73')](_0x34652f,_0x3b6d1d);if(_0x432b4a){var _0x144a6f=[];for(var _0x1dab51=0x0;_0x1dab51<_0x432b4a[_0xae96('0x43')];_0x1dab51++){var _0x35fd88=_[_0xae96('0x45')](_0x1c11c8,function(_0x352fb0){return _0x432b4a[_0x1dab51]?_0x352fb0[_0xae96('0x27')]===_0x432b4a[_0x1dab51][_0xae96('0x27')]:null;});if(_0x35fd88){if(_0x432b4a[_0x1dab51][_0xae96('0x72')]){_0x144a6f[_0xae96('0x5a')](getAllResources(_0x27afa3[_0xae96('0x6e')],_0x432b4a[_0x1dab51]));}else{if(!_0x432b4a[_0x1dab51][_0xae96('0x51')]){_0x144a6f[_0xae96('0x5a')](getAllowedResources(_0x35fd88,_0x432b4a[_0x1dab51],_0x27afa3[_0xae96('0x6e')]));}else{if(_0x35fd88[_0xae96('0x2e')]){_0x144a6f[_0xae96('0x5a')](getAllFilteredResources(_0x35fd88,_0x432b4a[_0x1dab51]));}}}}}return BPromise[_0xae96('0x71')](_0x144a6f);}else{return null;}})['then'](function(_0x457ba9){var _0x146ff=_0x457ba9;var _0x3d7778=null;if(_0x146ff){_0x3d7778=_0x146ff[_0xae96('0x43')]===0x1?_0x146ff[0x0]:null;}if(_0x3d7778||_0x146ff){var _0x4fe240=db[_0x27afa3[_0xae96('0x6e')]][_0xae96('0x2a')];_0xe7837[_0xae96('0x2e')]=_[_0xae96('0x30')](_0x4fe240);_0xe7837[_0xae96('0x2f')]=_[_0xae96('0x30')](_0x23b6be[_0xae96('0x2f')]);_0xe7837[_0xae96('0x31')]=_[_0xae96('0x32')](_0xe7837[_0xae96('0x2e')],_0xe7837['query']);_0x2a1ee1[_0xae96('0x33')]=_[_0xae96('0x32')](_0xe7837[_0xae96('0x2e')],qs[_0xae96('0x34')](_0x23b6be[_0xae96('0x2f')][_0xae96('0x34')]));_0x2a1ee1[_0xae96('0x33')]=_0x2a1ee1[_0xae96('0x33')][_0xae96('0x43')]?_0x2a1ee1[_0xae96('0x33')]:_0xe7837[_0xae96('0x2e')];if(!_0x23b6be[_0xae96('0x2f')]['hasOwnProperty']('nolimit')){_0x2a1ee1[_0xae96('0x1f')]=qs['limit'](_0x23b6be[_0xae96('0x2f')]['limit']);_0x2a1ee1[_0xae96('0x1e')]=qs[_0xae96('0x1e')](_0x23b6be['query'][_0xae96('0x1e')]);}_0x2a1ee1[_0xae96('0x74')]=qs['sort'](_0x23b6be[_0xae96('0x2f')][_0xae96('0x37')]);_0x2a1ee1['where']=qs['filters'](_[_0xae96('0x38')](_0x23b6be[_0xae96('0x2f')],_0xe7837[_0xae96('0x31')]));if(_0x23b6be[_0xae96('0x2f')][_0xae96('0x3c')]){_0x2a1ee1['where']=_[_0xae96('0x3a')](_0x2a1ee1[_0xae96('0x39')],{'$or':_[_0xae96('0x28')](_0x4fe240,function(_0x9318b8){if(_0x9318b8[_0xae96('0x2c')]['key']!==_0xae96('0x3b')){var _0x302670={};_0x302670[_0x9318b8['field']]={'$like':'%'+_0x23b6be[_0xae96('0x2f')][_0xae96('0x3c')]+'%'};return _0x302670;}})});}var _0x321ba7=[];if(_0x3d7778){var _0x474dd5=_[_0xae96('0x45')](_0x1c11c8,[_0xae96('0x27'),_0x3d7778[_0xae96('0x27')]]);if(_0x474dd5[_0xae96('0x75')]){var _0x452e07={};if(_0x27afa3['childModel']===_0xae96('0x76')){_0x452e07[_0x474dd5[_0xae96('0x77')]]=_['map'](_0x3d7778[_0xae96('0x78')],'id');}else{_0x452e07[_0x474dd5[_0xae96('0x77')]]=_0x3d7778[_0xae96('0x78')];}_0x321ba7[_0xae96('0x5a')](_0x452e07);}else{_0x2a1ee1[_0xae96('0x39')]['id']=_0x3d7778[_0xae96('0x78')];}}else{for(var _0xdc8f2e=0x0;_0xdc8f2e<_0x146ff['length'];_0xdc8f2e++){var _0x474dd5=_['find'](_0x1c11c8,['name',_0x146ff[_0xdc8f2e][_0xae96('0x27')]]);if(_0x474dd5[_0xae96('0x75')]){var _0x452e07={};_0x452e07[_0x474dd5[_0xae96('0x77')]]=_0x146ff[_0xdc8f2e]['associatedResources'];_0x321ba7['push'](_0x452e07);}else{if(!_0x2a1ee1['where']['id'])_0x2a1ee1['where']['id']=[];_0x146ff[_0xdc8f2e]['associatedResources'][_0xae96('0x63')](function(_0x199706){_0x2a1ee1[_0xae96('0x39')]['id']['push'](_0x199706);});}}}if(!_['isEmpty'](_0x321ba7)){_0x2a1ee1[_0xae96('0x39')]=_[_0xae96('0x3a')](_0x2a1ee1[_0xae96('0x39')],{'$and':{'$or':_0x321ba7}});}_0x2a1ee1=_[_0xae96('0x3a')]({},_0x2a1ee1,_0x23b6be['options']);if(_0x3d7778&&!_0x3d7778[_0xae96('0x51')]&&_0x27afa3['childModel']===_0xae96('0x76')){if(_0x23b6be[_0xae96('0x2f')][_0xae96('0x3e')]){_0x2a1ee1[_0xae96('0x3f')]=[{'all':!![]}];}return db[_0x27afa3['childModel']][_0xae96('0x52')](_0x2a1ee1)[_0xae96('0x3d')](function(_0x383e9c){var _0x443a02=[];_0x383e9c[_0xae96('0x63')](function(_0x68e68b){var _0x31f2ae;switch(_0x68e68b[_0xae96('0x79')]){case _0xae96('0x7a'):_0x31f2ae=_[_0xae96('0x45')](_0x3d7778['associatedResources'],function(_0x788a4f){return _0x788a4f['id']===_0x68e68b[_0xae96('0x7b')]&&_0x788a4f[_0xae96('0x2c')]==='DefaultReports';});break;case _0xae96('0x7c'):_0x31f2ae=_[_0xae96('0x45')](_0x3d7778['associatedResources'],function(_0x36677f){return _0x36677f['id']===_0x68e68b[_0xae96('0x7b')]&&_0x36677f[_0xae96('0x2c')]===_0xae96('0x7d');});break;}if(_0x31f2ae)_0x443a02['push'](_0x68e68b);});_0x5deba8[_0xae96('0x1d')]=_0x443a02['length'];_0x5deba8['rows']=_0x443a02;return _0x5deba8;});}else{return db[_0x27afa3[_0xae96('0x6e')]][_0xae96('0x1d')]({'where':_0x2a1ee1['where']})[_0xae96('0x3d')](function(_0x353923){_0x5deba8['count']=_0x353923;if(_0x23b6be[_0xae96('0x2f')][_0xae96('0x3e')]){if(_0x27afa3['childModel']===_0xae96('0x7e')){_0x2a1ee1[_0xae96('0x3f')]=[{'model':db[_0xae96('0x7f')],'as':_0xae96('0x80'),'attributes':['id',_0xae96('0x27'),_0xae96('0x81')],'required':_0x23b6be[_0xae96('0x2f')][_0xae96('0x82')]?!![]:![]},{'model':db[_0xae96('0x7f')],'as':_0xae96('0x83'),'attributes':['id',_0xae96('0x27'),_0xae96('0x81')],'through':_0x23b6be['query']['tag']?{'attributes':[],'where':{'TagId':_0x23b6be[_0xae96('0x2f')][_0xae96('0x82')]||undefined}}:{},'required':_0x23b6be['query'][_0xae96('0x82')]?!![]:![]}];}else{_0x2a1ee1[_0xae96('0x3f')]=[{'all':!![]}];}}return db[_0x27afa3['childModel']]['findAll'](_0x2a1ee1);})[_0xae96('0x3d')](function(_0x331e0f){_0x5deba8[_0xae96('0x40')]=_0x331e0f;return _0x5deba8;});}}else{return _0x5deba8;}})[_0xae96('0x3d')](respondWithFilteredResult(_0x9dbe3f,_0x2a1ee1))[_0xae96('0x41')](handleError(_0x9dbe3f,null));};function getAllResources(_0x53fba4,_0x204d70){return new BPromise(function(_0x3d89f4,_0x216362){if(_0x204d70){var _0x5ad803=_0x204d70[_0xae96('0x3c')]?{[_0x204d70[_0xae96('0x3c')][_0xae96('0x75')]]:_0x204d70['filter']['value']}:undefined;return db[_0x53fba4]['findAll']({'where':_0x5ad803,'raw':!![]})[_0xae96('0x3d')](function(_0x2ec9c6){_0x204d70[_0xae96('0x78')]=_[_0xae96('0x28')](_0x2ec9c6,'id');_0x3d89f4(_0x204d70);})[_0xae96('0x41')](function(_0x18132c){_0x216362(_0x18132c);});}else{_0x3d89f4(null);}});}function getAllFilteredResources(_0x58e879,_0x6187ed){return new BPromise(function(_0x272cd8,_0x1cef5d){var _0x29921b=_0x58e879[_0xae96('0x3c')]?{[_0x58e879[_0xae96('0x3c')][_0xae96('0x75')]]:_0x58e879['filter'][_0xae96('0x84')]}:undefined;return db[_0x58e879['model']]['findAll']({'where':_0x29921b,'raw':!![]})[_0xae96('0x3d')](function(_0x49fcc2){_0x6187ed[_0xae96('0x78')]=_['map'](_0x49fcc2,function(_0x369888){return _0x369888['name'];});_0x272cd8(_0x6187ed);})['catch'](function(_0x4dc9f0){_0x1cef5d(_0x4dc9f0);});});}function getAllowedResources(_0x39c431,_0x3998fe,_0x199969){return new BPromise(function(_0x2b9beb,_0x13646c){if(_0x3998fe){return db[_0xae96('0x56')][_0xae96('0x52')]({'where':{'sectionId':_0x3998fe['id']},'raw':!![]})[_0xae96('0x3d')](function(_0x4d5b01){if(_0x39c431['field']&&_0x39c431[_0xae96('0x75')]!=='id'){_0x3998fe[_0xae96('0x78')]=_['map'](_0x4d5b01,function(_0x40e753){return _0x40e753[_0x39c431[_0xae96('0x75')]];});}else{if(_0x199969===_0xae96('0x76')){_0x3998fe[_0xae96('0x78')]=_['map'](_0x4d5b01,function(_0x5944d4){return{'id':_0x5944d4[_0xae96('0x65')],'type':_0x5944d4[_0xae96('0x2c')]};});}else{_0x3998fe[_0xae96('0x78')]=_[_0xae96('0x28')](_0x4d5b01,function(_0x58011f){return _0x58011f[_0xae96('0x65')];});}}_0x2b9beb(_0x3998fe);})[_0xae96('0x41')](function(_0x40c4bd){_0x13646c(_0x40c4bd);});}else{_0x2b9beb(null);}});}function getQueryModels(_0x3c0e1f,_0xcd9bd1){var _0x3c876d=_0x3c0e1f['toLowerCase']();var _0x407442={'childModel':undefined,'parentSections':[]};switch(_0x3c876d){case _0xae96('0x85'):_0x407442['childModel']=_0xae96('0x86');break;case _0xae96('0x87'):_0x407442['childModel']='SquareOdbc';break;case'squarerecordings':_0x407442[_0xae96('0x6e')]=_0xae96('0x88');_0x407442['parentSections']=[{'name':'SquareProjects','field':'name','foreignKey':'projectName'}];break;case _0xae96('0x89'):_0x407442[_0xae96('0x6e')]=_0xae96('0x8a');break;case _0xae96('0x8b'):_0x407442[_0xae96('0x6e')]=_0xae96('0x7e');_0x407442['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0xae96('0x8c')}];break;case _0xae96('0x8d'):_0x407442[_0xae96('0x6e')]='CmList';break;case _0xae96('0x8e'):_0x407442[_0xae96('0x6e')]='CmCompany';break;case _0xae96('0x8f'):_0x407442['childModel']=_0xae96('0x90');break;case'chatqueues':_0x407442[_0xae96('0x6e')]=_0xae96('0x91');break;case _0xae96('0x92'):_0x407442[_0xae96('0x6e')]='ChatWebsite';break;case'faxqueues':_0x407442[_0xae96('0x6e')]=_0xae96('0x93');break;case'faxaccounts':_0x407442['childModel']=_0xae96('0x94');break;case _0xae96('0x95'):case'internalroutes':case _0xae96('0x96'):_0x407442[_0xae96('0x6e')]=_0xae96('0x97');break;case'contexts':_0x407442[_0xae96('0x6e')]=_0xae96('0x98');break;case _0xae96('0x99'):_0x407442[_0xae96('0x6e')]='VoiceMail';break;case _0xae96('0x9a'):_0x407442[_0xae96('0x6e')]=_0xae96('0x9b');_0x407442[_0xae96('0x70')]=[{'name':_0xae96('0x9c'),'field':_0xae96('0x27'),'foreignKey':'membername','model':'User','filter':{'field':_0xae96('0x9d'),'value':[_0xae96('0x9e')]}},{'name':_0xae96('0x9f'),'field':_0xae96('0x27'),'foreignKey':_0xae96('0xa0'),'model':_0xae96('0xa1'),'filter':{'field':_0xae96('0x9d'),'value':['telephone']}},{'name':_0xae96('0xa2'),'field':_0xae96('0x27'),'foreignKey':_0xae96('0xa3'),'model':_0xae96('0xa4'),'filter':{'field':_0xae96('0x2c'),'value':[_0xae96('0xa5')]}},{'name':_0xae96('0xa6'),'field':_0xae96('0x27'),'foreignKey':_0xae96('0xa3'),'model':_0xae96('0xa4'),'filter':{'field':_0xae96('0x2c'),'value':[_0xae96('0xa7')]}}];break;case _0xae96('0xa8'):_0x407442[_0xae96('0x6e')]=_0xae96('0xa9');break;case _0xae96('0xaa'):_0x407442['childModel']=_0xae96('0xab');break;case _0xae96('0xac'):_0x407442['childModel']=_0xae96('0xad');break;case _0xae96('0xae'):_0x407442[_0xae96('0x6e')]='Campaign';break;case _0xae96('0xaf'):_0x407442['childModel']=_0xae96('0xb0');break;case _0xae96('0xb1'):_0x407442[_0xae96('0x6e')]=_0xae96('0xb2');break;case _0xae96('0xb3'):_0x407442[_0xae96('0x6e')]=_0xae96('0xb4');break;case'openchannelqueues':_0x407442[_0xae96('0x6e')]=_0xae96('0xb5');break;case'openchannelaccounts':_0x407442[_0xae96('0x6e')]=_0xae96('0xb6');break;case _0xae96('0xb7'):_0x407442['childModel']=_0xae96('0xb8');break;case _0xae96('0xb9'):_0x407442[_0xae96('0x6e')]=_0xae96('0xba');break;case _0xae96('0xbb'):_0x407442[_0xae96('0x6e')]='Team';break;case'voicequeues':case'queuecampaigns':_0x407442[_0xae96('0x6e')]='VoiceQueue';if(_0xcd9bd1){_0x407442[_0xae96('0x70')]=[{'name':'VoiceQueues'},{'name':_0xae96('0xa6')}];}break;case _0xae96('0xbc'):case'agents':case _0xae96('0xbd'):_0x407442[_0xae96('0x6e')]=_0xae96('0xa1');if(_0xcd9bd1){_0x407442[_0xae96('0x70')]=[{'name':_0xae96('0xbe'),'filter':{'field':_0xae96('0x9d'),'value':['admin',_0xae96('0xbf')]},'ignore':!![]},{'name':_0xae96('0x9c')},{'name':_0xae96('0x9f')}];}break;case _0xae96('0xc0'):_0x407442[_0xae96('0x6e')]='ZendeskAccount';break;case _0xae96('0xc1'):_0x407442[_0xae96('0x6e')]='SalesforceAccount';break;case _0xae96('0xc2'):_0x407442['childModel']=_0xae96('0xc3');break;case _0xae96('0xc4'):_0x407442[_0xae96('0x6e')]='SugarcrmAccount';break;case _0xae96('0xc5'):_0x407442['childModel']=_0xae96('0xc6');break;case _0xae96('0xc7'):_0x407442[_0xae96('0x6e')]=_0xae96('0xc8');break;case _0xae96('0xc9'):_0x407442[_0xae96('0x6e')]=_0xae96('0xa1');break;case'cannedanswers':_0x407442['childModel']=_0xae96('0xca');break;case _0xae96('0xcb'):_0x407442[_0xae96('0x6e')]=_0xae96('0xcc');break;case _0xae96('0xcd'):_0x407442[_0xae96('0x6e')]='Dashboard';break;case _0xae96('0xce'):_0x407442[_0xae96('0x6e')]=_0xae96('0xcf');break;case _0xae96('0xd0'):_0x407442[_0xae96('0x6e')]='Pause';break;case _0xae96('0xd1'):_0x407442['childModel']=_0xae96('0xd2');break;case _0xae96('0xd3'):_0x407442[_0xae96('0x6e')]=_0xae96('0xd4');break;case'tags':_0x407442['childModel']=_0xae96('0x7f');break;case _0xae96('0xd5'):_0x407442['childModel']=_0xae96('0xd6');break;case _0xae96('0xd7'):_0x407442['childModel']=_0xae96('0xd8');break;case _0xae96('0xd9'):_0x407442[_0xae96('0x6e')]='Trunk';break;case _0xae96('0xda'):_0x407442[_0xae96('0x6e')]=_0xae96('0xdb');break;case _0xae96('0xdc'):_0x407442[_0xae96('0x6e')]=_0xae96('0x64');break;case _0xae96('0xdd'):_0x407442[_0xae96('0x6e')]=_0xae96('0x76');_0x407442[_0xae96('0x70')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xae96('0xde'):_0x407442[_0xae96('0x6e')]=_0xae96('0xdf');break;default:return _0x407442;}return _0x407442;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 586091f..e21c6d0 100644 --- a/server/api/userProfile/userProfile.events.js +++ b/server/api/userProfile/userProfile.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb76=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','save','update'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0xfb76,0x11d));var _0x6fb7=function(_0x304789,_0x51626b){_0x304789=_0x304789-0x0;var _0x5607a6=_0xfb76[_0x304789];return _0x5607a6;};'use strict';var EventEmitter=require(_0x6fb7('0x0'));var UserProfile=require(_0x6fb7('0x1'))['db'][_0x6fb7('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6fb7('0x3'),'afterUpdate':_0x6fb7('0x4'),'afterDestroy':_0x6fb7('0x5')};function emitEvent(_0x57d239){return function(_0x4d9813,_0x1d41b1,_0x5e12d0){UserProfileEvents['emit'](_0x57d239+':'+_0x4d9813['id'],_0x4d9813);UserProfileEvents[_0x6fb7('0x6')](_0x57d239,_0x4d9813);_0x5e12d0(null);};}for(var e in events){if(events[_0x6fb7('0x7')](e)){var event=events[e];UserProfile[_0x6fb7('0x8')](e,emitEvent(event));}}module[_0x6fb7('0x9')]=UserProfileEvents; \ No newline at end of file +var _0xb138=['hook','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x58910b,_0x540685){var _0xfe1259=function(_0x41e447){while(--_0x41e447){_0x58910b['push'](_0x58910b['shift']());}};_0xfe1259(++_0x540685);}(_0xb138,0x12e));var _0x8b13=function(_0x16292c,_0x451724){_0x16292c=_0x16292c-0x0;var _0xfb49b3=_0xb138[_0x16292c];return _0xfb49b3;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x8b13('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8b13('0x1')](0x0);var events={'afterCreate':_0x8b13('0x2'),'afterUpdate':_0x8b13('0x3'),'afterDestroy':_0x8b13('0x4')};function emitEvent(_0x320176){return function(_0x5ee9bc,_0x3a3b58,_0x59a9d1){UserProfileEvents[_0x8b13('0x5')](_0x320176+':'+_0x5ee9bc['id'],_0x5ee9bc);UserProfileEvents[_0x8b13('0x5')](_0x320176,_0x5ee9bc);_0x59a9d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x8b13('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 80ce019..ef7549b 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7be7=['exports','define','UserProfile','user_profiles','lodash','util','api','moment','bluebird','request-promise','./userProfile.attributes'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x7be7,0x1bc));var _0x77be=function(_0x4f944b,_0x108984){_0x4f944b=_0x4f944b-0x0;var _0x3e3ea0=_0x7be7[_0x4f944b];return _0x3e3ea0;};'use strict';var _=require(_0x77be('0x0'));var util=require(_0x77be('0x1'));var logger=require('../../config/logger')(_0x77be('0x2'));var moment=require(_0x77be('0x3'));var BPromise=require(_0x77be('0x4'));var rp=require(_0x77be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x77be('0x6'));module[_0x77be('0x7')]=function(_0x322ec7,_0xadf4dd){return _0x322ec7[_0x77be('0x8')](_0x77be('0x9'),attributes,{'tableName':_0x77be('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfece=['define','UserProfile','user_profiles','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./userProfile.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfece,0xfd));var _0xefec=function(_0x42a209,_0x521c51){_0x42a209=_0x42a209-0x0;var _0xf54c5b=_0xfece[_0x42a209];return _0xf54c5b;};'use strict';var _=require(_0xefec('0x0'));var util=require('util');var logger=require(_0xefec('0x1'))('api');var moment=require(_0xefec('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xefec('0x3'));var rimraf=require(_0xefec('0x4'));var config=require(_0xefec('0x5'));var attributes=require(_0xefec('0x6'));module['exports']=function(_0x9d6f1b,_0x21800b){return _0x9d6f1b[_0xefec('0x7')](_0xefec('0x8'),attributes,{'tableName':_0xefec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 686097f..e79e925 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc97=['redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserProfile,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x289274,_0x3695d5){var _0x5c82da=function(_0x4883f3){while(--_0x4883f3){_0x289274['push'](_0x289274['shift']());}};_0x5c82da(++_0x3695d5);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4614bf,_0x5c437d){_0x4614bf=_0x4614bf-0x0;var _0x1e2ee9=_0xdc97[_0x4614bf];return _0x1e2ee9;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});config[_0x7dc9('0xa')]=_['defaults'](config['redis'],{'host':_0x7dc9('0xb'),'port':0x18eb});var socket=require(_0x7dc9('0xc'))(new Redis(config[_0x7dc9('0xa')]));require(_0x7dc9('0xd'))[_0x7dc9('0xe')](socket);function respondWithRpcPromise(_0x5ca05b,_0xb2fa2a,_0x44fe24){return new BPromise(function(_0x37dfc,_0x1dc3f7){return client[_0x7dc9('0xf')](_0x5ca05b,_0x44fe24)[_0x7dc9('0x10')](function(_0x1e336a){logger['info']('UserProfile,\x20%s,\x20%s',_0xb2fa2a,'request\x20sent');logger['debug'](_0x7dc9('0x11'),_0xb2fa2a,_0x7dc9('0x12'),JSON['stringify'](_0x1e336a));if(_0x1e336a[_0x7dc9('0x13')]){if(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x14')]===0x1f4){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')]['message']);return _0x1dc3f7(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);return _0x37dfc(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}else{logger[_0x7dc9('0x17')]('UserProfile,\x20%s,\x20%s',_0xb2fa2a,_0x7dc9('0x12'));_0x37dfc(_0x1e336a['result'][_0x7dc9('0x16')]);}})[_0x7dc9('0x18')](function(_0x5d61d7){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x5d61d7);_0x1dc3f7(_0x5d61d7);});});} \ No newline at end of file +var _0x31f0=['debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0xe93d9a,_0xb780c7){var _0x2d0df8=function(_0x3ed09e){while(--_0x3ed09e){_0xe93d9a['push'](_0xe93d9a['shift']());}};_0x2d0df8(++_0xb780c7);}(_0x31f0,0xb7));var _0x031f=function(_0x211c01,_0x12c1f6){_0x211c01=_0x211c01-0x0;var _0x2f7b59=_0x31f0[_0x211c01];return _0x2f7b59;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x031f('0x8')]=_['defaults'](config[_0x031f('0x8')],{'host':_0x031f('0x9'),'port':0x18eb});var socket=require(_0x031f('0xa'))(new Redis(config[_0x031f('0x8')]));require('./userProfile.socket')[_0x031f('0xb')](socket);function respondWithRpcPromise(_0x24145f,_0x327f11,_0x439940){return new BPromise(function(_0x3dd729,_0x3b0a17){return client[_0x031f('0xc')](_0x24145f,_0x439940)[_0x031f('0xd')](function(_0x4df318){logger[_0x031f('0xe')](_0x031f('0xf'),_0x327f11,_0x031f('0x10'));logger[_0x031f('0x11')](_0x031f('0x12'),_0x327f11,_0x031f('0x10'),JSON[_0x031f('0x13')](_0x4df318));if(_0x4df318['error']){if(_0x4df318[_0x031f('0x14')][_0x031f('0x15')]===0x1f4){logger[_0x031f('0x14')](_0x031f('0xf'),_0x327f11,_0x4df318[_0x031f('0x14')]['message']);return _0x3b0a17(_0x4df318['error'][_0x031f('0x16')]);}logger[_0x031f('0x14')](_0x031f('0xf'),_0x327f11,_0x4df318[_0x031f('0x14')]['message']);return _0x3dd729(_0x4df318[_0x031f('0x14')][_0x031f('0x16')]);}else{logger['info'](_0x031f('0xf'),_0x327f11,'request\x20sent');_0x3dd729(_0x4df318[_0x031f('0x17')][_0x031f('0x16')]);}})[_0x031f('0x18')](function(_0xaa155){logger[_0x031f('0x14')](_0x031f('0xf'),_0x327f11,_0xaa155);_0x3b0a17(_0xaa155);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 1cca288..9f3c975 100644 --- a/server/api/userProfile/userProfile.socket.js +++ b/server/api/userProfile/userProfile.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27e9=['./userProfile.events','save','removeListener','register'];(function(_0xbae6dc,_0xc33a93){var _0x1e99f8=function(_0x3bdda1){while(--_0x3bdda1){_0xbae6dc['push'](_0xbae6dc['shift']());}};_0x1e99f8(++_0xc33a93);}(_0x27e9,0x114));var _0x927e=function(_0x278e5f,_0x2c013f){_0x278e5f=_0x278e5f-0x0;var _0x53ac8=_0x27e9[_0x278e5f];return _0x53ac8;};'use strict';var UserProfileEvents=require(_0x927e('0x0'));var events=[_0x927e('0x1'),'remove','update'];function createListener(_0xfaa386,_0xde96cf){return function(_0x246b03){_0xde96cf['emit'](_0xfaa386,_0x246b03);};}function removeListener(_0x4c6661,_0x5010f3){return function(){UserProfileEvents[_0x927e('0x2')](_0x4c6661,_0x5010f3);};}exports[_0x927e('0x3')]=function(_0x470b71){for(var _0x45c553=0x0,_0x442c62=events['length'];_0x45c553<_0x442c62;_0x45c553++){var _0x11821b=events[_0x45c553];var _0x55700f=createListener('userProfile:'+_0x11821b,_0x470b71);UserProfileEvents['on'](_0x11821b,_0x55700f);}}; \ No newline at end of file +var _0x14a6=['save','remove','emit','removeListener','register','length','userProfile:','./userProfile.events'];(function(_0x2ad1c4,_0x26926f){var _0x298fbc=function(_0x3e0228){while(--_0x3e0228){_0x2ad1c4['push'](_0x2ad1c4['shift']());}};_0x298fbc(++_0x26926f);}(_0x14a6,0x187));var _0x614a=function(_0x3810f6,_0x41f38f){_0x3810f6=_0x3810f6-0x0;var _0x442125=_0x14a6[_0x3810f6];return _0x442125;};'use strict';var UserProfileEvents=require(_0x614a('0x0'));var events=[_0x614a('0x1'),_0x614a('0x2'),'update'];function createListener(_0x290fc6,_0x46d12e){return function(_0x4c76bc){_0x46d12e[_0x614a('0x3')](_0x290fc6,_0x4c76bc);};}function removeListener(_0x49bc45,_0xeb69d0){return function(){UserProfileEvents[_0x614a('0x4')](_0x49bc45,_0xeb69d0);};}exports[_0x614a('0x5')]=function(_0x126c3f){for(var _0x3b43bf=0x0,_0x5a09fb=events[_0x614a('0x6')];_0x3b43bf<_0x5a09fb;_0x3b43bf++){var _0x5ceb0f=events[_0x3b43bf];var _0x46a9ba=createListener(_0x614a('0x7')+_0x5ceb0f,_0x126c3f);UserProfileEvents['on'](_0x5ceb0f,_0x46a9ba);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index dd0d39f..e9887c6 100644 --- a/server/api/userProfileResource/index.js +++ b/server/api/userProfileResource/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e1=['./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xa9e1[_0x2211ed];return _0x4d78cc;};'use strict';var multer=require(_0x1a9e('0x0'));var util=require(_0x1a9e('0x1'));var path=require('path');var timeout=require(_0x1a9e('0x2'));var express=require(_0x1a9e('0x3'));var router=express[_0x1a9e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1a9e('0x5'));var config=require('../../config/environment');var controller=require(_0x1a9e('0x6'));router['get']('/',auth[_0x1a9e('0x7')](),controller[_0x1a9e('0x8')]);router[_0x1a9e('0x9')](_0x1a9e('0xa'),auth[_0x1a9e('0x7')](),controller[_0x1a9e('0xb')]);router[_0x1a9e('0x9')](_0x1a9e('0xc'),auth[_0x1a9e('0x7')](),controller[_0x1a9e('0xd')]);router['post']('/',auth[_0x1a9e('0x7')](),controller['create']);router['put']('/:id',auth[_0x1a9e('0x7')](),controller['update']);router[_0x1a9e('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1a9e('0xf')]);module['exports']=router; \ No newline at end of file +var _0xbc35=['../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','path','express'];(function(_0x109d0e,_0x306576){var _0x24166b=function(_0x57a917){while(--_0x57a917){_0x109d0e['push'](_0x109d0e['shift']());}};_0x24166b(++_0x306576);}(_0xbc35,0x69));var _0x5bc3=function(_0x534e9a,_0x5bd217){_0x534e9a=_0x534e9a-0x0;var _0x4628fc=_0xbc35[_0x534e9a];return _0x4628fc;};'use strict';var multer=require(_0x5bc3('0x0'));var util=require('util');var path=require(_0x5bc3('0x1'));var timeout=require('connect-timeout');var express=require(_0x5bc3('0x2'));var router=express['Router']();var auth=require(_0x5bc3('0x3'));var interaction=require(_0x5bc3('0x4'));var config=require('../../config/environment');var controller=require(_0x5bc3('0x5'));router[_0x5bc3('0x6')]('/',auth['isAuthenticated'](),controller[_0x5bc3('0x7')]);router[_0x5bc3('0x6')](_0x5bc3('0x8'),auth[_0x5bc3('0x9')](),controller['describe']);router[_0x5bc3('0x6')](_0x5bc3('0xa'),auth[_0x5bc3('0x9')](),controller[_0x5bc3('0xb')]);router[_0x5bc3('0xc')]('/',auth['isAuthenticated'](),controller[_0x5bc3('0xd')]);router[_0x5bc3('0xe')](_0x5bc3('0xa'),auth[_0x5bc3('0x9')](),controller[_0x5bc3('0xf')]);router[_0x5bc3('0x10')](_0x5bc3('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5bc3('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 1540d3d..dbe9ecb 100644 --- a/server/api/userProfileResource/userProfileResource.attributes.js +++ b/server/api/userProfileResource/userProfileResource.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdde8=['STRING','INTEGER','sequelize','exports'];(function(_0x3f45a4,_0x329147){var _0x19e0f4=function(_0x3c6cfe){while(--_0x3c6cfe){_0x3f45a4['push'](_0x3f45a4['shift']());}};_0x19e0f4(++_0x329147);}(_0xdde8,0x11e));var _0x8dde=function(_0x120363,_0x16428f){_0x120363=_0x120363-0x0;var _0x12e665=_0xdde8[_0x120363];return _0x12e665;};'use strict';var Sequelize=require(_0x8dde('0x0'));module[_0x8dde('0x1')]={'name':{'type':Sequelize[_0x8dde('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8dde('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8dde('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x77ed=['STRING','INTEGER'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x77ed,0x1ea));var _0xd77e=function(_0x16e847,_0x2e220c){_0x16e847=_0x16e847-0x0;var _0x17a906=_0x77ed[_0x16e847];return _0x17a906;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd77e('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd77e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd77e('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 85dedeb..08a36c0 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb907=['merge','options','includeAll','include','findAll','rows','params','length','catch','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','then','destroy','end','stack','name','index','map','UserProfileResource','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x3400e1,_0x2c5012){var _0x59ae06=function(_0x1d301e){while(--_0x1d301e){_0x3400e1['push'](_0x3400e1['shift']());}};_0x59ae06(++_0x2c5012);}(_0xb907,0x136));var _0x7b90=function(_0x5aa4ce,_0x1278e2){_0x5aa4ce=_0x5aa4ce-0x0;var _0x3d155b=_0xb907[_0x5aa4ce];return _0x3d155b;};'use strict';var pdf=require(_0x7b90('0x0'));var emlformat=require(_0x7b90('0x1'));var rimraf=require(_0x7b90('0x2'));var zipdir=require(_0x7b90('0x3'));var jsonpatch=require(_0x7b90('0x4'));var rp=require(_0x7b90('0x5'));var moment=require('moment');var BPromise=require(_0x7b90('0x6'));var Mustache=require('mustache');var util=require(_0x7b90('0x7'));var path=require(_0x7b90('0x8'));var sox=require(_0x7b90('0x9'));var csv=require(_0x7b90('0xa'));var ejs=require(_0x7b90('0xb'));var fs=require('fs');var _=require(_0x7b90('0xc'));var squel=require(_0x7b90('0xd'));var crypto=require(_0x7b90('0xe'));var jsforce=require(_0x7b90('0xf'));var deskjs=require(_0x7b90('0x10'));var toCsv=require(_0x7b90('0xa'));var querystring=require(_0x7b90('0x11'));var Papa=require(_0x7b90('0x12'));var Redis=require(_0x7b90('0x13'));var authService=require(_0x7b90('0x14'));var qs=require(_0x7b90('0x15'));var as=require(_0x7b90('0x16'));var hardwareService=require(_0x7b90('0x17'));var logger=require(_0x7b90('0x18'))(_0x7b90('0x19'));var utils=require(_0x7b90('0x1a'));var config=require(_0x7b90('0x1b'));var db=require(_0x7b90('0x1c'))['db'];function respondWithStatusCode(_0x236143,_0x4d3d82){_0x4d3d82=_0x4d3d82||0xcc;return function(_0x2ce680){if(_0x2ce680){return _0x236143[_0x7b90('0x1d')](_0x4d3d82);}return _0x236143[_0x7b90('0x1e')](_0x4d3d82)['end']();};}function respondWithResult(_0x14da5e,_0x17d29b){_0x17d29b=_0x17d29b||0xc8;return function(_0x2c23d0){if(_0x2c23d0){return _0x14da5e[_0x7b90('0x1e')](_0x17d29b)[_0x7b90('0x1f')](_0x2c23d0);}};}function respondWithFilteredResult(_0x6daf48,_0x429928){return function(_0x55a4c5){if(_0x55a4c5){var _0x123fed=_0x55a4c5[_0x7b90('0x20')],_0x54b337=_0x429928[_0x7b90('0x21')],_0x3b52ae=_0x429928[_0x7b90('0x21')]+_0x429928[_0x7b90('0x22')],_0x37089a;if(_0x3b52ae>=_0x123fed){_0x3b52ae=_0x123fed;_0x37089a=0xc8;}else{_0x37089a=0xce;}_0x6daf48[_0x7b90('0x1e')](_0x37089a);return _0x6daf48['set'](_0x7b90('0x23'),_0x54b337+'-'+_0x3b52ae+'/'+_0x123fed)[_0x7b90('0x1f')](_0x55a4c5);}return null;};}function patchUpdates(_0x57e45b){return function(_0x33675c){try{jsonpatch['apply'](_0x33675c,_0x57e45b,!![]);}catch(_0x1d222e){return BPromise[_0x7b90('0x24')](_0x1d222e);}return _0x33675c['save']();};}function saveUpdates(_0x483a87,_0xf4e6c3){return function(_0x2f00fc){if(_0x2f00fc){return _0x2f00fc['update'](_0x483a87)[_0x7b90('0x25')](function(_0x1a1bd1){return _0x1a1bd1;});}return null;};}function removeEntity(_0x20fb30,_0x16c95c){return function(_0x15c381){if(_0x15c381){return _0x15c381[_0x7b90('0x26')]()[_0x7b90('0x25')](function(){_0x20fb30[_0x7b90('0x1e')](0xcc)[_0x7b90('0x27')]();});}};}function handleEntityNotFound(_0xc5fa2d,_0x1d6d54){return function(_0x1ac95e){if(!_0x1ac95e){_0xc5fa2d[_0x7b90('0x1d')](0x194);}return _0x1ac95e;};}function handleError(_0x26fbe2,_0x4da2d5){_0x4da2d5=_0x4da2d5||0x1f4;return function(_0x1b75d9){logger['error'](_0x1b75d9[_0x7b90('0x28')]);if(_0x1b75d9[_0x7b90('0x29')]){delete _0x1b75d9[_0x7b90('0x29')];}_0x26fbe2[_0x7b90('0x1e')](_0x4da2d5)['send'](_0x1b75d9);};}exports[_0x7b90('0x2a')]=function(_0x25cfa6,_0x304aa2){var _0x1102c2={},_0x4c8065={},_0x3bbf10={'count':0x0,'rows':[]};var _0xef2a1=_[_0x7b90('0x2b')](db[_0x7b90('0x2c')][_0x7b90('0x2d')],function(_0x368121){return{'name':_0x368121['fieldName'],'type':_0x368121[_0x7b90('0x2e')]['key']};});_0x4c8065[_0x7b90('0x2f')]=_[_0x7b90('0x2b')](_0xef2a1,'name');_0x4c8065[_0x7b90('0x30')]=_[_0x7b90('0x31')](_0x25cfa6[_0x7b90('0x30')]);_0x4c8065[_0x7b90('0x32')]=_['intersection'](_0x4c8065['model'],_0x4c8065['query']);_0x1102c2[_0x7b90('0x33')]=_[_0x7b90('0x34')](_0x4c8065[_0x7b90('0x2f')],qs[_0x7b90('0x35')](_0x25cfa6['query'][_0x7b90('0x35')]));_0x1102c2[_0x7b90('0x33')]=_0x1102c2[_0x7b90('0x33')]['length']?_0x1102c2['attributes']:_0x4c8065[_0x7b90('0x2f')];if(!_0x25cfa6[_0x7b90('0x30')][_0x7b90('0x36')]('nolimit')){_0x1102c2['limit']=qs['limit'](_0x25cfa6[_0x7b90('0x30')][_0x7b90('0x22')]);_0x1102c2[_0x7b90('0x21')]=qs[_0x7b90('0x21')](_0x25cfa6[_0x7b90('0x30')][_0x7b90('0x21')]);}_0x1102c2[_0x7b90('0x37')]=qs[_0x7b90('0x38')](_0x25cfa6[_0x7b90('0x30')][_0x7b90('0x38')]);_0x1102c2['where']=qs['filters'](_[_0x7b90('0x39')](_0x25cfa6['query'],_0x4c8065[_0x7b90('0x32')]));if(_0x25cfa6[_0x7b90('0x30')][_0x7b90('0x3a')]){_0x1102c2[_0x7b90('0x3b')]=_[_0x7b90('0x3c')](_0x1102c2[_0x7b90('0x3b')],{'$or':_['map'](_0xef2a1,function(_0x118a09){if(_0x118a09[_0x7b90('0x2e')]!=='VIRTUAL'){var _0x354f7f={};_0x354f7f[_0x118a09[_0x7b90('0x29')]]={'$like':'%'+_0x25cfa6[_0x7b90('0x30')][_0x7b90('0x3a')]+'%'};return _0x354f7f;}})});}_0x1102c2=_['merge']({},_0x1102c2,_0x25cfa6[_0x7b90('0x3d')]);var _0x303f3d={'where':_0x1102c2[_0x7b90('0x3b')]};return db[_0x7b90('0x2c')][_0x7b90('0x20')](_0x303f3d)[_0x7b90('0x25')](function(_0x2290f5){_0x3bbf10[_0x7b90('0x20')]=_0x2290f5;if(_0x25cfa6[_0x7b90('0x30')][_0x7b90('0x3e')]){_0x1102c2[_0x7b90('0x3f')]=[{'all':!![]}];}return db[_0x7b90('0x2c')][_0x7b90('0x40')](_0x1102c2);})[_0x7b90('0x25')](function(_0x3e1130){_0x3bbf10[_0x7b90('0x41')]=_0x3e1130;return _0x3bbf10;})[_0x7b90('0x25')](respondWithFilteredResult(_0x304aa2,_0x1102c2))['catch'](handleError(_0x304aa2,null));};exports['show']=function(_0x19e982,_0x4dcb2a){var _0x4c9a3c={'raw':![],'where':{'id':_0x19e982[_0x7b90('0x42')]['id']}},_0x252888={};_0x252888[_0x7b90('0x2f')]=_['keys'](db[_0x7b90('0x2c')][_0x7b90('0x2d')]);_0x252888[_0x7b90('0x30')]=_['keys'](_0x19e982[_0x7b90('0x30')]);_0x252888[_0x7b90('0x32')]=_[_0x7b90('0x34')](_0x252888[_0x7b90('0x2f')],_0x252888[_0x7b90('0x30')]);_0x4c9a3c[_0x7b90('0x33')]=_[_0x7b90('0x34')](_0x252888[_0x7b90('0x2f')],qs[_0x7b90('0x35')](_0x19e982['query']['fields']));_0x4c9a3c[_0x7b90('0x33')]=_0x4c9a3c['attributes'][_0x7b90('0x43')]?_0x4c9a3c[_0x7b90('0x33')]:_0x252888[_0x7b90('0x2f')];if(_0x19e982[_0x7b90('0x30')][_0x7b90('0x3e')]){_0x4c9a3c[_0x7b90('0x3f')]=[{'all':!![]}];}_0x4c9a3c=_[_0x7b90('0x3c')]({},_0x4c9a3c,_0x19e982[_0x7b90('0x3d')]);return db['UserProfileResource']['find'](_0x4c9a3c)[_0x7b90('0x25')](handleEntityNotFound(_0x4dcb2a,null))['then'](respondWithResult(_0x4dcb2a,null))[_0x7b90('0x44')](handleError(_0x4dcb2a,null));};exports[_0x7b90('0x45')]=function(_0x2c2d2b,_0x2b229e){return db['UserProfileResource'][_0x7b90('0x45')](_0x2c2d2b[_0x7b90('0x46')],{})[_0x7b90('0x25')](respondWithResult(_0x2b229e,0xc9))[_0x7b90('0x44')](handleError(_0x2b229e,null));};exports[_0x7b90('0x47')]=function(_0x21dea9,_0x239435){if(_0x21dea9['body']['id']){delete _0x21dea9[_0x7b90('0x46')]['id'];}return db[_0x7b90('0x2c')][_0x7b90('0x48')]({'where':{'id':_0x21dea9[_0x7b90('0x42')]['id']}})['then'](handleEntityNotFound(_0x239435,null))['then'](saveUpdates(_0x21dea9[_0x7b90('0x46')],null))[_0x7b90('0x25')](respondWithResult(_0x239435,null))[_0x7b90('0x44')](handleError(_0x239435,null));};exports[_0x7b90('0x26')]=function(_0x6cd4e5,_0xdd8ad5){return db[_0x7b90('0x2c')]['find']({'where':{'id':_0x6cd4e5[_0x7b90('0x42')]['id']}})[_0x7b90('0x25')](handleEntityNotFound(_0xdd8ad5,null))[_0x7b90('0x25')](removeEntity(_0xdd8ad5,null))[_0x7b90('0x44')](handleError(_0xdd8ad5,null));};exports[_0x7b90('0x49')]=function(_0x7630e8,_0x578ca4){return db['UserProfileResource'][_0x7b90('0x49')]()[_0x7b90('0x25')](respondWithResult(_0x578ca4,null))[_0x7b90('0x44')](handleError(_0x578ca4,null));}; \ No newline at end of file +var _0x1fd1=['sort','where','pick','filter','merge','VIRTUAL','UserProfileResource','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x1fd1,0xb3));var _0x11fd=function(_0x1e1e60,_0x3afda8){_0x1e1e60=_0x1e1e60-0x0;var _0x42fdeb=_0x1fd1[_0x1e1e60];return _0x42fdeb;};'use strict';var pdf=require(_0x11fd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x11fd('0x1'));var zipdir=require(_0x11fd('0x2'));var jsonpatch=require(_0x11fd('0x3'));var rp=require(_0x11fd('0x4'));var moment=require(_0x11fd('0x5'));var BPromise=require(_0x11fd('0x6'));var Mustache=require('mustache');var util=require(_0x11fd('0x7'));var path=require(_0x11fd('0x8'));var sox=require(_0x11fd('0x9'));var csv=require(_0x11fd('0xa'));var ejs=require(_0x11fd('0xb'));var fs=require('fs');var _=require(_0x11fd('0xc'));var squel=require(_0x11fd('0xd'));var crypto=require(_0x11fd('0xe'));var jsforce=require(_0x11fd('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x11fd('0x10'));var Redis=require('ioredis');var authService=require(_0x11fd('0x11'));var qs=require(_0x11fd('0x12'));var as=require(_0x11fd('0x13'));var hardwareService=require(_0x11fd('0x14'));var logger=require(_0x11fd('0x15'))(_0x11fd('0x16'));var utils=require(_0x11fd('0x17'));var config=require(_0x11fd('0x18'));var db=require(_0x11fd('0x19'))['db'];function respondWithStatusCode(_0x129d54,_0x12e272){_0x12e272=_0x12e272||0xcc;return function(_0x480154){if(_0x480154){return _0x129d54[_0x11fd('0x1a')](_0x12e272);}return _0x129d54[_0x11fd('0x1b')](_0x12e272)['end']();};}function respondWithResult(_0x5e337,_0x521ee7){_0x521ee7=_0x521ee7||0xc8;return function(_0x323930){if(_0x323930){return _0x5e337['status'](_0x521ee7)[_0x11fd('0x1c')](_0x323930);}};}function respondWithFilteredResult(_0x42d1c6,_0x157e67){return function(_0x49fc8f){if(_0x49fc8f){var _0x1e4399=_0x49fc8f[_0x11fd('0x1d')],_0x439ade=_0x157e67[_0x11fd('0x1e')],_0x2f8433=_0x157e67[_0x11fd('0x1e')]+_0x157e67[_0x11fd('0x1f')],_0x2f083e;if(_0x2f8433>=_0x1e4399){_0x2f8433=_0x1e4399;_0x2f083e=0xc8;}else{_0x2f083e=0xce;}_0x42d1c6[_0x11fd('0x1b')](_0x2f083e);return _0x42d1c6[_0x11fd('0x20')](_0x11fd('0x21'),_0x439ade+'-'+_0x2f8433+'/'+_0x1e4399)[_0x11fd('0x1c')](_0x49fc8f);}return null;};}function patchUpdates(_0x3171f9){return function(_0xd5f315){try{jsonpatch[_0x11fd('0x22')](_0xd5f315,_0x3171f9,!![]);}catch(_0x1b28f7){return BPromise['reject'](_0x1b28f7);}return _0xd5f315[_0x11fd('0x23')]();};}function saveUpdates(_0x3de6f3,_0xf12fc4){return function(_0x135151){if(_0x135151){return _0x135151[_0x11fd('0x24')](_0x3de6f3)[_0x11fd('0x25')](function(_0x55ccdb){return _0x55ccdb;});}return null;};}function removeEntity(_0x9cae1a,_0x3a518c){return function(_0x3ecbd8){if(_0x3ecbd8){return _0x3ecbd8[_0x11fd('0x26')]()[_0x11fd('0x25')](function(){_0x9cae1a[_0x11fd('0x1b')](0xcc)[_0x11fd('0x27')]();});}};}function handleEntityNotFound(_0x4496cd,_0x26a42b){return function(_0x4af55f){if(!_0x4af55f){_0x4496cd[_0x11fd('0x1a')](0x194);}return _0x4af55f;};}function handleError(_0x54a0e0,_0x564bf8){_0x564bf8=_0x564bf8||0x1f4;return function(_0x3ae44e){logger[_0x11fd('0x28')](_0x3ae44e[_0x11fd('0x29')]);if(_0x3ae44e[_0x11fd('0x2a')]){delete _0x3ae44e[_0x11fd('0x2a')];}_0x54a0e0[_0x11fd('0x1b')](_0x564bf8)[_0x11fd('0x2b')](_0x3ae44e);};}exports[_0x11fd('0x2c')]=function(_0x53ba21,_0x3289e9){var _0x546ffe={},_0x3fb95a={},_0x54cd14={'count':0x0,'rows':[]};var _0x223fc0=_[_0x11fd('0x2d')](db['UserProfileResource'][_0x11fd('0x2e')],function(_0x41a68d){return{'name':_0x41a68d[_0x11fd('0x2f')],'type':_0x41a68d[_0x11fd('0x30')][_0x11fd('0x31')]};});_0x3fb95a[_0x11fd('0x32')]=_['map'](_0x223fc0,_0x11fd('0x2a'));_0x3fb95a[_0x11fd('0x33')]=_[_0x11fd('0x34')](_0x53ba21[_0x11fd('0x33')]);_0x3fb95a[_0x11fd('0x35')]=_['intersection'](_0x3fb95a[_0x11fd('0x32')],_0x3fb95a[_0x11fd('0x33')]);_0x546ffe[_0x11fd('0x36')]=_[_0x11fd('0x37')](_0x3fb95a[_0x11fd('0x32')],qs[_0x11fd('0x38')](_0x53ba21[_0x11fd('0x33')][_0x11fd('0x38')]));_0x546ffe[_0x11fd('0x36')]=_0x546ffe[_0x11fd('0x36')][_0x11fd('0x39')]?_0x546ffe[_0x11fd('0x36')]:_0x3fb95a[_0x11fd('0x32')];if(!_0x53ba21[_0x11fd('0x33')][_0x11fd('0x3a')](_0x11fd('0x3b'))){_0x546ffe[_0x11fd('0x1f')]=qs['limit'](_0x53ba21['query'][_0x11fd('0x1f')]);_0x546ffe[_0x11fd('0x1e')]=qs[_0x11fd('0x1e')](_0x53ba21[_0x11fd('0x33')][_0x11fd('0x1e')]);}_0x546ffe[_0x11fd('0x3c')]=qs[_0x11fd('0x3d')](_0x53ba21[_0x11fd('0x33')][_0x11fd('0x3d')]);_0x546ffe[_0x11fd('0x3e')]=qs[_0x11fd('0x35')](_[_0x11fd('0x3f')](_0x53ba21['query'],_0x3fb95a[_0x11fd('0x35')]));if(_0x53ba21['query'][_0x11fd('0x40')]){_0x546ffe['where']=_[_0x11fd('0x41')](_0x546ffe['where'],{'$or':_[_0x11fd('0x2d')](_0x223fc0,function(_0x564a78){if(_0x564a78[_0x11fd('0x30')]!==_0x11fd('0x42')){var _0xfc6612={};_0xfc6612[_0x564a78[_0x11fd('0x2a')]]={'$like':'%'+_0x53ba21['query'][_0x11fd('0x40')]+'%'};return _0xfc6612;}})});}_0x546ffe=_[_0x11fd('0x41')]({},_0x546ffe,_0x53ba21['options']);var _0x492d70={'where':_0x546ffe[_0x11fd('0x3e')]};return db[_0x11fd('0x43')][_0x11fd('0x1d')](_0x492d70)[_0x11fd('0x25')](function(_0x394da5){_0x54cd14['count']=_0x394da5;if(_0x53ba21['query'][_0x11fd('0x44')]){_0x546ffe[_0x11fd('0x45')]=[{'all':!![]}];}return db['UserProfileResource'][_0x11fd('0x46')](_0x546ffe);})[_0x11fd('0x25')](function(_0x41481e){_0x54cd14[_0x11fd('0x47')]=_0x41481e;return _0x54cd14;})[_0x11fd('0x25')](respondWithFilteredResult(_0x3289e9,_0x546ffe))[_0x11fd('0x48')](handleError(_0x3289e9,null));};exports[_0x11fd('0x49')]=function(_0x4eabd2,_0x5f07f8){var _0x5458c6={'raw':![],'where':{'id':_0x4eabd2[_0x11fd('0x4a')]['id']}},_0x4639ea={};_0x4639ea['model']=_[_0x11fd('0x34')](db[_0x11fd('0x43')][_0x11fd('0x2e')]);_0x4639ea[_0x11fd('0x33')]=_[_0x11fd('0x34')](_0x4eabd2[_0x11fd('0x33')]);_0x4639ea['filters']=_[_0x11fd('0x37')](_0x4639ea[_0x11fd('0x32')],_0x4639ea['query']);_0x5458c6['attributes']=_[_0x11fd('0x37')](_0x4639ea[_0x11fd('0x32')],qs[_0x11fd('0x38')](_0x4eabd2[_0x11fd('0x33')][_0x11fd('0x38')]));_0x5458c6[_0x11fd('0x36')]=_0x5458c6[_0x11fd('0x36')][_0x11fd('0x39')]?_0x5458c6[_0x11fd('0x36')]:_0x4639ea[_0x11fd('0x32')];if(_0x4eabd2[_0x11fd('0x33')]['includeAll']){_0x5458c6[_0x11fd('0x45')]=[{'all':!![]}];}_0x5458c6=_[_0x11fd('0x41')]({},_0x5458c6,_0x4eabd2[_0x11fd('0x4b')]);return db[_0x11fd('0x43')][_0x11fd('0x4c')](_0x5458c6)[_0x11fd('0x25')](handleEntityNotFound(_0x5f07f8,null))[_0x11fd('0x25')](respondWithResult(_0x5f07f8,null))[_0x11fd('0x48')](handleError(_0x5f07f8,null));};exports['create']=function(_0x234ba1,_0x5b5edf){return db[_0x11fd('0x43')][_0x11fd('0x4d')](_0x234ba1[_0x11fd('0x4e')],{})[_0x11fd('0x25')](respondWithResult(_0x5b5edf,0xc9))['catch'](handleError(_0x5b5edf,null));};exports['update']=function(_0x45ad53,_0x5b2b38){if(_0x45ad53[_0x11fd('0x4e')]['id']){delete _0x45ad53[_0x11fd('0x4e')]['id'];}return db[_0x11fd('0x43')]['find']({'where':{'id':_0x45ad53[_0x11fd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b2b38,null))[_0x11fd('0x25')](saveUpdates(_0x45ad53[_0x11fd('0x4e')],null))['then'](respondWithResult(_0x5b2b38,null))[_0x11fd('0x48')](handleError(_0x5b2b38,null));};exports['destroy']=function(_0x3edb79,_0x437158){return db[_0x11fd('0x43')][_0x11fd('0x4c')]({'where':{'id':_0x3edb79[_0x11fd('0x4a')]['id']}})[_0x11fd('0x25')](handleEntityNotFound(_0x437158,null))[_0x11fd('0x25')](removeEntity(_0x437158,null))[_0x11fd('0x48')](handleError(_0x437158,null));};exports[_0x11fd('0x4f')]=function(_0x5d477c,_0x30e0b2){return db[_0x11fd('0x43')]['describe']()[_0x11fd('0x25')](respondWithResult(_0x30e0b2,null))[_0x11fd('0x48')](handleError(_0x30e0b2,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index e3058f9..9f9c38c 100644 --- a/server/api/userProfileResource/userProfileResource.model.js +++ b/server/api/userProfileResource/userProfileResource.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04a2=['util','api','moment','path','../../config/environment','./userProfileResource.attributes','UserProfileResource','compositeIndex','resourceId','sectionId'];(function(_0x565d42,_0x91f71a){var _0x184420=function(_0x1b50be){while(--_0x1b50be){_0x565d42['push'](_0x565d42['shift']());}};_0x184420(++_0x91f71a);}(_0x04a2,0x1ea));var _0x204a=function(_0x4f8192,_0x5346b0){_0x4f8192=_0x4f8192-0x0;var _0x61dddd=_0x04a2[_0x4f8192];return _0x61dddd;};'use strict';var _=require('lodash');var util=require(_0x204a('0x0'));var logger=require('../../config/logger')(_0x204a('0x1'));var moment=require(_0x204a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x204a('0x3'));var rimraf=require('rimraf');var config=require(_0x204a('0x4'));var attributes=require(_0x204a('0x5'));module['exports']=function(_0x7223c2,_0x5d198d){return _0x7223c2['define'](_0x204a('0x6'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x204a('0x7'),'fields':[_0x204a('0x8'),_0x204a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5da9=['bluebird','request-promise','path','./userProfileResource.attributes','exports','define','user_profile_has_resources','sectionId','lodash','util','../../config/logger','api'];(function(_0x194a1a,_0x56843e){var _0x100d36=function(_0x4c0ae2){while(--_0x4c0ae2){_0x194a1a['push'](_0x194a1a['shift']());}};_0x100d36(++_0x56843e);}(_0x5da9,0x170));var _0x95da=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x5da9[_0x18d631];return _0x50d708;};'use strict';var _=require(_0x95da('0x0'));var util=require(_0x95da('0x1'));var logger=require(_0x95da('0x2'))(_0x95da('0x3'));var moment=require('moment');var BPromise=require(_0x95da('0x4'));var rp=require(_0x95da('0x5'));var fs=require('fs');var path=require(_0x95da('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95da('0x7'));module[_0x95da('0x8')]=function(_0x79f0d4,_0x119a8d){return _0x79f0d4[_0x95da('0x9')]('UserProfileResource',attributes,{'tableName':_0x95da('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x95da('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 060e105..7cc3a0c 100644 --- a/server/api/userProfileResource/userProfileResource.rpc.js +++ b/server/api/userProfileResource/userProfileResource.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8208=['then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8208,0xc2));var _0x8820=function(_0x135439,_0x4d49c0){_0x135439=_0x135439-0x0;var _0x2e3a7=_0x8208[_0x135439];return _0x2e3a7;};'use strict';var _=require(_0x8820('0x0'));var util=require(_0x8820('0x1'));var moment=require(_0x8820('0x2'));var BPromise=require(_0x8820('0x3'));var rs=require(_0x8820('0x4'));var fs=require('fs');var Redis=require(_0x8820('0x5'));var db=require(_0x8820('0x6'))['db'];var utils=require(_0x8820('0x7'));var logger=require(_0x8820('0x8'))(_0x8820('0x9'));var config=require(_0x8820('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8820('0xb')][_0x8820('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bffeb,_0x48ae07,_0x54250f){return new BPromise(function(_0x24af33,_0x2141b0){return client[_0x8820('0xd')](_0x3bffeb,_0x54250f)[_0x8820('0xe')](function(_0x4f303d){logger[_0x8820('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x48ae07,_0x8820('0x10'));logger[_0x8820('0x11')](_0x8820('0x12'),_0x48ae07,_0x8820('0x10'),JSON[_0x8820('0x13')](_0x4f303d));if(_0x4f303d[_0x8820('0x14')]){if(_0x4f303d['error'][_0x8820('0x15')]===0x1f4){logger[_0x8820('0x14')](_0x8820('0x16'),_0x48ae07,_0x4f303d[_0x8820('0x14')]['message']);return _0x2141b0(_0x4f303d[_0x8820('0x14')][_0x8820('0x17')]);}logger['error'](_0x8820('0x16'),_0x48ae07,_0x4f303d[_0x8820('0x14')][_0x8820('0x17')]);return _0x24af33(_0x4f303d[_0x8820('0x14')][_0x8820('0x17')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x48ae07,_0x8820('0x10'));_0x24af33(_0x4f303d[_0x8820('0x18')][_0x8820('0x17')]);}})[_0x8820('0x19')](function(_0x4a4353){logger[_0x8820('0x14')](_0x8820('0x16'),_0x48ae07,_0x4a4353);_0x2141b0(_0x4a4353);});});} \ No newline at end of file +var _0x455d=['request\x20sent','debug','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x56d20e,_0x217c31){var _0x18b27a=function(_0x5d68bb){while(--_0x5d68bb){_0x56d20e['push'](_0x56d20e['shift']());}};_0x18b27a(++_0x217c31);}(_0x455d,0x190));var _0xd455=function(_0x2babcc,_0x2b59c5){_0x2babcc=_0x2babcc-0x0;var _0x34a237=_0x455d[_0x2babcc];return _0x34a237;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd455('0x0'));var BPromise=require(_0xd455('0x1'));var rs=require(_0xd455('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd455('0x3'))['db'];var utils=require(_0xd455('0x4'));var logger=require(_0xd455('0x5'))(_0xd455('0x6'));var config=require(_0xd455('0x7'));var jayson=require(_0xd455('0x8'));var client=jayson[_0xd455('0x9')][_0xd455('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b373c,_0x5a5ed7,_0x2bbebf){return new BPromise(function(_0x2e530a,_0x4ef696){return client[_0xd455('0xb')](_0x3b373c,_0x2bbebf)[_0xd455('0xc')](function(_0xed6c5f){logger[_0xd455('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x5a5ed7,_0xd455('0xe'));logger[_0xd455('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x5a5ed7,_0xd455('0xe'),JSON[_0xd455('0x10')](_0xed6c5f));if(_0xed6c5f[_0xd455('0x11')]){if(_0xed6c5f[_0xd455('0x11')][_0xd455('0x12')]===0x1f4){logger[_0xd455('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x5a5ed7,_0xed6c5f['error'][_0xd455('0x13')]);return _0x4ef696(_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);}logger['error'](_0xd455('0x14'),_0x5a5ed7,_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);return _0x2e530a(_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);}else{logger[_0xd455('0xd')](_0xd455('0x14'),_0x5a5ed7,_0xd455('0xe'));_0x2e530a(_0xed6c5f[_0xd455('0x15')]['message']);}})[_0xd455('0x16')](function(_0x35a9fc){logger[_0xd455('0x11')](_0xd455('0x14'),_0x5a5ed7,_0x35a9fc);_0x4ef696(_0x35a9fc);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index a7e72de..54fab95 100644 --- a/server/api/userProfileSection/index.js +++ b/server/api/userProfileSection/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f6b=['../../config/environment','./userProfileSection.controller','isAuthenticated','index','/describe','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x296435,_0x9593de){var _0x3f4b67=function(_0x28ebe9){while(--_0x28ebe9){_0x296435['push'](_0x296435['shift']());}};_0x3f4b67(++_0x9593de);}(_0x6f6b,0x77));var _0xb6f6=function(_0x12723c,_0x148a5a){_0x12723c=_0x12723c-0x0;var _0x3fc804=_0x6f6b[_0x12723c];return _0x3fc804;};'use strict';var multer=require(_0xb6f6('0x0'));var util=require(_0xb6f6('0x1'));var path=require('path');var timeout=require(_0xb6f6('0x2'));var express=require(_0xb6f6('0x3'));var router=express[_0xb6f6('0x4')]();var auth=require(_0xb6f6('0x5'));var interaction=require(_0xb6f6('0x6'));var config=require(_0xb6f6('0x7'));var controller=require(_0xb6f6('0x8'));router['get']('/',auth[_0xb6f6('0x9')](),controller[_0xb6f6('0xa')]);router['get'](_0xb6f6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb6f6('0xc')](_0xb6f6('0xd'),auth[_0xb6f6('0x9')](),controller['show']);router[_0xb6f6('0xe')]('/',auth[_0xb6f6('0x9')](),controller[_0xb6f6('0xf')]);router[_0xb6f6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb6f6('0x11')]);router[_0xb6f6('0x12')](_0xb6f6('0xd'),auth[_0xb6f6('0x9')](),controller[_0xb6f6('0x13')]);module[_0xb6f6('0x14')]=router; \ No newline at end of file +var _0x11cf=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update'];(function(_0x3620cd,_0x4145c5){var _0x3b1f6a=function(_0x2ada81){while(--_0x2ada81){_0x3620cd['push'](_0x3620cd['shift']());}};_0x3b1f6a(++_0x4145c5);}(_0x11cf,0x10b));var _0xf11c=function(_0x20e929,_0x5260d7){_0x20e929=_0x20e929-0x0;var _0x1a6042=_0x11cf[_0x20e929];return _0x1a6042;};'use strict';var multer=require(_0xf11c('0x0'));var util=require(_0xf11c('0x1'));var path=require(_0xf11c('0x2'));var timeout=require(_0xf11c('0x3'));var express=require(_0xf11c('0x4'));var router=express[_0xf11c('0x5')]();var auth=require(_0xf11c('0x6'));var interaction=require(_0xf11c('0x7'));var config=require(_0xf11c('0x8'));var controller=require(_0xf11c('0x9'));router[_0xf11c('0xa')]('/',auth[_0xf11c('0xb')](),controller[_0xf11c('0xc')]);router[_0xf11c('0xa')](_0xf11c('0xd'),auth['isAuthenticated'](),controller[_0xf11c('0xe')]);router['get'](_0xf11c('0xf'),auth[_0xf11c('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf11c('0x10')]);router[_0xf11c('0x11')](_0xf11c('0xf'),auth[_0xf11c('0xb')](),controller[_0xf11c('0x12')]);router[_0xf11c('0x13')](_0xf11c('0xf'),auth[_0xf11c('0xb')](),controller[_0xf11c('0x14')]);module[_0xf11c('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 924e57b..29acd76 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x897d=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports'];(function(_0x51d33f,_0x737ddf){var _0x3d1fe6=function(_0xea5a7a){while(--_0xea5a7a){_0x51d33f['push'](_0x51d33f['shift']());}};_0x3d1fe6(++_0x737ddf);}(_0x897d,0x80));var _0xd897=function(_0x54a6d0,_0x5ecb3e){_0x54a6d0=_0x54a6d0-0x0;var _0x5918d1=_0x897d[_0x54a6d0];return _0x5918d1;};'use strict';var Sequelize=require(_0xd897('0x0'));module[_0xd897('0x1')]={'name':{'type':Sequelize[_0xd897('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xd897('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd897('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd897('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd897('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd897('0x2')],'set':function(_0x407c5c){this[_0xd897('0x5')](_0xd897('0x6'),_0x407c5c?_0x407c5c[_0xd897('0x7')](''):[]);},'get':function(){return this[_0xd897('0x8')](_0xd897('0x6'))?this[_0xd897('0x8')](_0xd897('0x6'))[_0xd897('0x9')](''):[];}}}; \ No newline at end of file +var _0xc9b7=['crudPermissions','join','getDataValue','split','sequelize','exports','STRING','BOOLEAN','setDataValue'];(function(_0x409615,_0x76cccb){var _0x1c51f8=function(_0x3b4014){while(--_0x3b4014){_0x409615['push'](_0x409615['shift']());}};_0x1c51f8(++_0x76cccb);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x26d4ca,_0xa2b4a0){_0x26d4ca=_0x26d4ca-0x0;var _0x5583f9=_0xc9b7[_0x26d4ca];return _0x5583f9;};'use strict';var Sequelize=require(_0x7c9b('0x0'));module[_0x7c9b('0x1')]={'name':{'type':Sequelize[_0x7c9b('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x7c9b('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x7c9b('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x7c9b('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x474486){this[_0x7c9b('0x4')](_0x7c9b('0x5'),_0x474486?_0x474486[_0x7c9b('0x6')](''):[]);},'get':function(){return this[_0x7c9b('0x7')](_0x7c9b('0x5'))?this[_0x7c9b('0x7')](_0x7c9b('0x5'))[_0x7c9b('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 1ca7ad8..17a6c1e 100644 --- a/server/api/userProfileSection/userProfileSection.controller.js +++ b/server/api/userProfileSection/userProfileSection.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14f6=['mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0xdd408a,_0x18b604){var _0x507988=function(_0x3f7a3c){while(--_0x3f7a3c){_0xdd408a['push'](_0xdd408a['shift']());}};_0x507988(++_0x18b604);}(_0x14f6,0x1b6));var _0x614f=function(_0x5f2951,_0x41cd8b){_0x5f2951=_0x5f2951-0x0;var _0x53a919=_0x14f6[_0x5f2951];return _0x53a919;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x614f('0x0'));var rimraf=require(_0x614f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x614f('0x2'));var rp=require(_0x614f('0x3'));var moment=require(_0x614f('0x4'));var BPromise=require(_0x614f('0x5'));var Mustache=require(_0x614f('0x6'));var util=require(_0x614f('0x7'));var path=require('path');var sox=require(_0x614f('0x8'));var csv=require(_0x614f('0x9'));var ejs=require(_0x614f('0xa'));var fs=require('fs');var _=require(_0x614f('0xb'));var squel=require('squel');var crypto=require(_0x614f('0xc'));var jsforce=require(_0x614f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x614f('0x9'));var querystring=require(_0x614f('0xe'));var Papa=require(_0x614f('0xf'));var Redis=require('ioredis');var authService=require(_0x614f('0x10'));var qs=require(_0x614f('0x11'));var as=require(_0x614f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x614f('0x13'))(_0x614f('0x14'));var utils=require(_0x614f('0x15'));var config=require(_0x614f('0x16'));var db=require(_0x614f('0x17'))['db'];function respondWithStatusCode(_0x2fdb6d,_0x8be412){_0x8be412=_0x8be412||0xcc;return function(_0x3063b5){if(_0x3063b5){return _0x2fdb6d[_0x614f('0x18')](_0x8be412);}return _0x2fdb6d[_0x614f('0x19')](_0x8be412)['end']();};}function respondWithResult(_0x6a2a13,_0x3942ee){_0x3942ee=_0x3942ee||0xc8;return function(_0x2bc9dc){if(_0x2bc9dc){return _0x6a2a13[_0x614f('0x19')](_0x3942ee)['json'](_0x2bc9dc);}};}function respondWithFilteredResult(_0x55b479,_0xf22d16){return function(_0x46d7d1){if(_0x46d7d1){var _0x53d97a=_0x46d7d1[_0x614f('0x1a')],_0x477d4e=_0xf22d16[_0x614f('0x1b')],_0x128864=_0xf22d16[_0x614f('0x1b')]+_0xf22d16[_0x614f('0x1c')],_0x4703d7;if(_0x128864>=_0x53d97a){_0x128864=_0x53d97a;_0x4703d7=0xc8;}else{_0x4703d7=0xce;}_0x55b479[_0x614f('0x19')](_0x4703d7);return _0x55b479[_0x614f('0x1d')](_0x614f('0x1e'),_0x477d4e+'-'+_0x128864+'/'+_0x53d97a)[_0x614f('0x1f')](_0x46d7d1);}return null;};}function patchUpdates(_0x1f4495){return function(_0x2c5e44){try{jsonpatch[_0x614f('0x20')](_0x2c5e44,_0x1f4495,!![]);}catch(_0xa72411){return BPromise[_0x614f('0x21')](_0xa72411);}return _0x2c5e44[_0x614f('0x22')]();};}function saveUpdates(_0x6a73dc,_0x118cc1){return function(_0x89d23e){if(_0x89d23e){return _0x89d23e['update'](_0x6a73dc)[_0x614f('0x23')](function(_0x3ddcaf){return _0x3ddcaf;});}return null;};}function removeEntity(_0x355a39,_0x38d9be){return function(_0x1c4b5c){if(_0x1c4b5c){return _0x1c4b5c[_0x614f('0x24')]()[_0x614f('0x23')](function(){_0x355a39[_0x614f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4569d7,_0x17581f){return function(_0x3727b8){if(!_0x3727b8){_0x4569d7[_0x614f('0x18')](0x194);}return _0x3727b8;};}function handleError(_0x1a9cdc,_0x183505){_0x183505=_0x183505||0x1f4;return function(_0x1c1332){logger[_0x614f('0x25')](_0x1c1332[_0x614f('0x26')]);if(_0x1c1332[_0x614f('0x27')]){delete _0x1c1332[_0x614f('0x27')];}_0x1a9cdc[_0x614f('0x19')](_0x183505)[_0x614f('0x28')](_0x1c1332);};}exports[_0x614f('0x29')]=function(_0x420938,_0x20d426){var _0x3d31bf={},_0x47f7f4={},_0x4e0235={'count':0x0,'rows':[]};var _0x1b16ab=_[_0x614f('0x2a')](db[_0x614f('0x2b')][_0x614f('0x2c')],function(_0x337e8d){return{'name':_0x337e8d[_0x614f('0x2d')],'type':_0x337e8d['type'][_0x614f('0x2e')]};});_0x47f7f4[_0x614f('0x2f')]=_[_0x614f('0x2a')](_0x1b16ab,'name');_0x47f7f4['query']=_[_0x614f('0x30')](_0x420938[_0x614f('0x31')]);_0x47f7f4[_0x614f('0x32')]=_[_0x614f('0x33')](_0x47f7f4['model'],_0x47f7f4['query']);_0x3d31bf[_0x614f('0x34')]=_[_0x614f('0x33')](_0x47f7f4[_0x614f('0x2f')],qs[_0x614f('0x35')](_0x420938[_0x614f('0x31')][_0x614f('0x35')]));_0x3d31bf[_0x614f('0x34')]=_0x3d31bf[_0x614f('0x34')][_0x614f('0x36')]?_0x3d31bf[_0x614f('0x34')]:_0x47f7f4['model'];if(!_0x420938[_0x614f('0x31')]['hasOwnProperty'](_0x614f('0x37'))){_0x3d31bf[_0x614f('0x1c')]=qs[_0x614f('0x1c')](_0x420938[_0x614f('0x31')][_0x614f('0x1c')]);_0x3d31bf[_0x614f('0x1b')]=qs[_0x614f('0x1b')](_0x420938[_0x614f('0x31')][_0x614f('0x1b')]);}_0x3d31bf[_0x614f('0x38')]=qs[_0x614f('0x39')](_0x420938[_0x614f('0x31')][_0x614f('0x39')]);_0x3d31bf[_0x614f('0x3a')]=qs[_0x614f('0x32')](_[_0x614f('0x3b')](_0x420938['query'],_0x47f7f4[_0x614f('0x32')]));if(_0x420938['query'][_0x614f('0x3c')]){_0x3d31bf[_0x614f('0x3a')]=_[_0x614f('0x3d')](_0x3d31bf[_0x614f('0x3a')],{'$or':_['map'](_0x1b16ab,function(_0x242751){if(_0x242751[_0x614f('0x3e')]!==_0x614f('0x3f')){var _0x244a50={};_0x244a50[_0x242751['name']]={'$like':'%'+_0x420938[_0x614f('0x31')][_0x614f('0x3c')]+'%'};return _0x244a50;}})});}_0x3d31bf=_[_0x614f('0x3d')]({},_0x3d31bf,_0x420938[_0x614f('0x40')]);var _0x119c99={'where':_0x3d31bf[_0x614f('0x3a')]};return db['UserProfileSection'][_0x614f('0x1a')](_0x119c99)[_0x614f('0x23')](function(_0x547c6d){_0x4e0235[_0x614f('0x1a')]=_0x547c6d;if(_0x420938['query']['includeAll']){_0x3d31bf[_0x614f('0x41')]=[{'all':!![]}];}return db[_0x614f('0x2b')]['findAll'](_0x3d31bf);})[_0x614f('0x23')](function(_0x12da5f){_0x4e0235[_0x614f('0x42')]=_0x12da5f;return _0x4e0235;})['then'](respondWithFilteredResult(_0x20d426,_0x3d31bf))['catch'](handleError(_0x20d426,null));};exports[_0x614f('0x43')]=function(_0x1ce8d5,_0x2f6937){var _0x51b56d={'raw':![],'where':{'id':_0x1ce8d5[_0x614f('0x44')]['id']}},_0x2da067={};_0x2da067['model']=_[_0x614f('0x30')](db[_0x614f('0x2b')][_0x614f('0x2c')]);_0x2da067[_0x614f('0x31')]=_[_0x614f('0x30')](_0x1ce8d5['query']);_0x2da067['filters']=_[_0x614f('0x33')](_0x2da067['model'],_0x2da067['query']);_0x51b56d[_0x614f('0x34')]=_[_0x614f('0x33')](_0x2da067[_0x614f('0x2f')],qs[_0x614f('0x35')](_0x1ce8d5['query'][_0x614f('0x35')]));_0x51b56d[_0x614f('0x34')]=_0x51b56d[_0x614f('0x34')][_0x614f('0x36')]?_0x51b56d['attributes']:_0x2da067['model'];if(_0x1ce8d5[_0x614f('0x31')][_0x614f('0x45')]){_0x51b56d[_0x614f('0x41')]=[{'all':!![]}];}_0x51b56d=_[_0x614f('0x3d')]({},_0x51b56d,_0x1ce8d5['options']);return db[_0x614f('0x2b')][_0x614f('0x46')](_0x51b56d)['then'](handleEntityNotFound(_0x2f6937,null))[_0x614f('0x23')](respondWithResult(_0x2f6937,null))[_0x614f('0x47')](handleError(_0x2f6937,null));};exports['create']=function(_0x1173e6,_0xff9501){return db[_0x614f('0x2b')]['create'](_0x1173e6['body'],{})[_0x614f('0x23')](respondWithResult(_0xff9501,0xc9))[_0x614f('0x47')](handleError(_0xff9501,null));};exports['update']=function(_0x2fecd0,_0x5d2bfa){if(_0x2fecd0[_0x614f('0x48')]['id']){delete _0x2fecd0[_0x614f('0x48')]['id'];}return db[_0x614f('0x2b')][_0x614f('0x46')]({'where':{'id':_0x2fecd0[_0x614f('0x44')]['id']}})[_0x614f('0x23')](handleEntityNotFound(_0x5d2bfa,null))[_0x614f('0x23')](saveUpdates(_0x2fecd0[_0x614f('0x48')],null))[_0x614f('0x23')](respondWithResult(_0x5d2bfa,null))[_0x614f('0x47')](handleError(_0x5d2bfa,null));};exports['destroy']=function(_0x41716c,_0x69e880){return db[_0x614f('0x2b')][_0x614f('0x46')]({'where':{'id':_0x41716c[_0x614f('0x44')]['id']}})[_0x614f('0x23')](handleEntityNotFound(_0x69e880,null))[_0x614f('0x23')](removeEntity(_0x69e880,null))[_0x614f('0x47')](handleError(_0x69e880,null));};exports[_0x614f('0x49')]=function(_0x1499f9,_0x84592a){return db['UserProfileSection']['describe']()[_0x614f('0x23')](respondWithResult(_0x84592a,null))[_0x614f('0x47')](handleError(_0x84592a,null));}; \ No newline at end of file +var _0xe0db=['intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','filters','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe0db,0x65));var _0xbe0d=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xe0db[_0x4bb66f];return _0xf2772f;};'use strict';var pdf=require(_0xbe0d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbe0d('0x1'));var zipdir=require(_0xbe0d('0x2'));var jsonpatch=require(_0xbe0d('0x3'));var rp=require(_0xbe0d('0x4'));var moment=require(_0xbe0d('0x5'));var BPromise=require(_0xbe0d('0x6'));var Mustache=require('mustache');var util=require(_0xbe0d('0x7'));var path=require(_0xbe0d('0x8'));var sox=require(_0xbe0d('0x9'));var csv=require(_0xbe0d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbe0d('0xb'));var squel=require(_0xbe0d('0xc'));var crypto=require(_0xbe0d('0xd'));var jsforce=require(_0xbe0d('0xe'));var deskjs=require(_0xbe0d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbe0d('0x10'));var Papa=require(_0xbe0d('0x11'));var Redis=require(_0xbe0d('0x12'));var authService=require(_0xbe0d('0x13'));var qs=require(_0xbe0d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe0d('0x15'));var logger=require(_0xbe0d('0x16'))('api');var utils=require(_0xbe0d('0x17'));var config=require(_0xbe0d('0x18'));var db=require(_0xbe0d('0x19'))['db'];function respondWithStatusCode(_0x26464e,_0x84fb75){_0x84fb75=_0x84fb75||0xcc;return function(_0x1c2867){if(_0x1c2867){return _0x26464e[_0xbe0d('0x1a')](_0x84fb75);}return _0x26464e[_0xbe0d('0x1b')](_0x84fb75)[_0xbe0d('0x1c')]();};}function respondWithResult(_0x1c0b43,_0x55a5b8){_0x55a5b8=_0x55a5b8||0xc8;return function(_0x2aa49e){if(_0x2aa49e){return _0x1c0b43[_0xbe0d('0x1b')](_0x55a5b8)[_0xbe0d('0x1d')](_0x2aa49e);}};}function respondWithFilteredResult(_0x57eb17,_0x2b8b44){return function(_0x3dae6b){if(_0x3dae6b){var _0x2ddd72=_0x3dae6b[_0xbe0d('0x1e')],_0x2dacf8=_0x2b8b44[_0xbe0d('0x1f')],_0x18e904=_0x2b8b44[_0xbe0d('0x1f')]+_0x2b8b44[_0xbe0d('0x20')],_0x436de8;if(_0x18e904>=_0x2ddd72){_0x18e904=_0x2ddd72;_0x436de8=0xc8;}else{_0x436de8=0xce;}_0x57eb17['status'](_0x436de8);return _0x57eb17[_0xbe0d('0x21')](_0xbe0d('0x22'),_0x2dacf8+'-'+_0x18e904+'/'+_0x2ddd72)[_0xbe0d('0x1d')](_0x3dae6b);}return null;};}function patchUpdates(_0x243ea5){return function(_0xb63c4f){try{jsonpatch[_0xbe0d('0x23')](_0xb63c4f,_0x243ea5,!![]);}catch(_0x4948df){return BPromise[_0xbe0d('0x24')](_0x4948df);}return _0xb63c4f[_0xbe0d('0x25')]();};}function saveUpdates(_0xd9b3b6,_0x48d06a){return function(_0xe710e2){if(_0xe710e2){return _0xe710e2[_0xbe0d('0x26')](_0xd9b3b6)['then'](function(_0x521dae){return _0x521dae;});}return null;};}function removeEntity(_0x57c332,_0x35c18a){return function(_0x61e705){if(_0x61e705){return _0x61e705[_0xbe0d('0x27')]()[_0xbe0d('0x28')](function(){_0x57c332[_0xbe0d('0x1b')](0xcc)[_0xbe0d('0x1c')]();});}};}function handleEntityNotFound(_0x29afb5,_0x45021a){return function(_0x1b1d30){if(!_0x1b1d30){_0x29afb5[_0xbe0d('0x1a')](0x194);}return _0x1b1d30;};}function handleError(_0x2f49f5,_0x498fa0){_0x498fa0=_0x498fa0||0x1f4;return function(_0x492f21){logger['error'](_0x492f21[_0xbe0d('0x29')]);if(_0x492f21[_0xbe0d('0x2a')]){delete _0x492f21['name'];}_0x2f49f5['status'](_0x498fa0)[_0xbe0d('0x2b')](_0x492f21);};}exports[_0xbe0d('0x2c')]=function(_0x4392d6,_0x5a1d44){var _0x6095ff={},_0x3b981d={},_0x33621d={'count':0x0,'rows':[]};var _0x2b9f8a=_[_0xbe0d('0x2d')](db[_0xbe0d('0x2e')][_0xbe0d('0x2f')],function(_0x4a5ab9){return{'name':_0x4a5ab9[_0xbe0d('0x30')],'type':_0x4a5ab9[_0xbe0d('0x31')]['key']};});_0x3b981d[_0xbe0d('0x32')]=_[_0xbe0d('0x2d')](_0x2b9f8a,_0xbe0d('0x2a'));_0x3b981d['query']=_['keys'](_0x4392d6['query']);_0x3b981d['filters']=_[_0xbe0d('0x33')](_0x3b981d[_0xbe0d('0x32')],_0x3b981d[_0xbe0d('0x34')]);_0x6095ff[_0xbe0d('0x35')]=_['intersection'](_0x3b981d[_0xbe0d('0x32')],qs[_0xbe0d('0x36')](_0x4392d6[_0xbe0d('0x34')][_0xbe0d('0x36')]));_0x6095ff[_0xbe0d('0x35')]=_0x6095ff[_0xbe0d('0x35')][_0xbe0d('0x37')]?_0x6095ff[_0xbe0d('0x35')]:_0x3b981d[_0xbe0d('0x32')];if(!_0x4392d6['query'][_0xbe0d('0x38')](_0xbe0d('0x39'))){_0x6095ff[_0xbe0d('0x20')]=qs[_0xbe0d('0x20')](_0x4392d6['query'][_0xbe0d('0x20')]);_0x6095ff[_0xbe0d('0x1f')]=qs['offset'](_0x4392d6[_0xbe0d('0x34')][_0xbe0d('0x1f')]);}_0x6095ff[_0xbe0d('0x3a')]=qs[_0xbe0d('0x3b')](_0x4392d6[_0xbe0d('0x34')][_0xbe0d('0x3b')]);_0x6095ff[_0xbe0d('0x3c')]=qs['filters'](_['pick'](_0x4392d6[_0xbe0d('0x34')],_0x3b981d['filters']));if(_0x4392d6[_0xbe0d('0x34')]['filter']){_0x6095ff[_0xbe0d('0x3c')]=_[_0xbe0d('0x3d')](_0x6095ff[_0xbe0d('0x3c')],{'$or':_[_0xbe0d('0x2d')](_0x2b9f8a,function(_0x4acd58){if(_0x4acd58[_0xbe0d('0x31')]!=='VIRTUAL'){var _0x18e7b0={};_0x18e7b0[_0x4acd58[_0xbe0d('0x2a')]]={'$like':'%'+_0x4392d6['query']['filter']+'%'};return _0x18e7b0;}})});}_0x6095ff=_['merge']({},_0x6095ff,_0x4392d6[_0xbe0d('0x3e')]);var _0x122209={'where':_0x6095ff['where']};return db[_0xbe0d('0x2e')]['count'](_0x122209)['then'](function(_0x558350){_0x33621d['count']=_0x558350;if(_0x4392d6[_0xbe0d('0x34')][_0xbe0d('0x3f')]){_0x6095ff[_0xbe0d('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0xbe0d('0x41')](_0x6095ff);})[_0xbe0d('0x28')](function(_0xbcbdf1){_0x33621d[_0xbe0d('0x42')]=_0xbcbdf1;return _0x33621d;})[_0xbe0d('0x28')](respondWithFilteredResult(_0x5a1d44,_0x6095ff))[_0xbe0d('0x43')](handleError(_0x5a1d44,null));};exports[_0xbe0d('0x44')]=function(_0x5638be,_0x419f9b){var _0x43629e={'raw':![],'where':{'id':_0x5638be['params']['id']}},_0x57761a={};_0x57761a[_0xbe0d('0x32')]=_[_0xbe0d('0x45')](db['UserProfileSection'][_0xbe0d('0x2f')]);_0x57761a['query']=_['keys'](_0x5638be[_0xbe0d('0x34')]);_0x57761a[_0xbe0d('0x46')]=_[_0xbe0d('0x33')](_0x57761a[_0xbe0d('0x32')],_0x57761a[_0xbe0d('0x34')]);_0x43629e['attributes']=_[_0xbe0d('0x33')](_0x57761a[_0xbe0d('0x32')],qs['fields'](_0x5638be[_0xbe0d('0x34')]['fields']));_0x43629e['attributes']=_0x43629e[_0xbe0d('0x35')]['length']?_0x43629e[_0xbe0d('0x35')]:_0x57761a[_0xbe0d('0x32')];if(_0x5638be['query'][_0xbe0d('0x3f')]){_0x43629e[_0xbe0d('0x40')]=[{'all':!![]}];}_0x43629e=_[_0xbe0d('0x3d')]({},_0x43629e,_0x5638be[_0xbe0d('0x3e')]);return db['UserProfileSection'][_0xbe0d('0x47')](_0x43629e)[_0xbe0d('0x28')](handleEntityNotFound(_0x419f9b,null))[_0xbe0d('0x28')](respondWithResult(_0x419f9b,null))['catch'](handleError(_0x419f9b,null));};exports['create']=function(_0x3b70a2,_0x5e4635){return db[_0xbe0d('0x2e')][_0xbe0d('0x48')](_0x3b70a2[_0xbe0d('0x49')],{})[_0xbe0d('0x28')](respondWithResult(_0x5e4635,0xc9))[_0xbe0d('0x43')](handleError(_0x5e4635,null));};exports[_0xbe0d('0x26')]=function(_0xfe35cd,_0x257ec9){if(_0xfe35cd[_0xbe0d('0x49')]['id']){delete _0xfe35cd[_0xbe0d('0x49')]['id'];}return db['UserProfileSection'][_0xbe0d('0x47')]({'where':{'id':_0xfe35cd[_0xbe0d('0x4a')]['id']}})[_0xbe0d('0x28')](handleEntityNotFound(_0x257ec9,null))['then'](saveUpdates(_0xfe35cd[_0xbe0d('0x49')],null))[_0xbe0d('0x28')](respondWithResult(_0x257ec9,null))[_0xbe0d('0x43')](handleError(_0x257ec9,null));};exports[_0xbe0d('0x27')]=function(_0x539c18,_0x1bbbf7){return db[_0xbe0d('0x2e')][_0xbe0d('0x47')]({'where':{'id':_0x539c18[_0xbe0d('0x4a')]['id']}})[_0xbe0d('0x28')](handleEntityNotFound(_0x1bbbf7,null))[_0xbe0d('0x28')](removeEntity(_0x1bbbf7,null))[_0xbe0d('0x43')](handleError(_0x1bbbf7,null));};exports[_0xbe0d('0x4b')]=function(_0x16650a,_0xc973c3){return db['UserProfileSection'][_0xbe0d('0x4b')]()['then'](respondWithResult(_0xc973c3,null))[_0xbe0d('0x43')](handleError(_0xc973c3,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index a92306c..b425e24 100644 --- a/server/api/userProfileSection/userProfileSection.model.js +++ b/server/api/userProfileSection/userProfileSection.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7aab=['compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','UserProfileSection','user_profile_has_sections'];(function(_0x4112b8,_0x49748b){var _0x51c576=function(_0x2b5128){while(--_0x2b5128){_0x4112b8['push'](_0x4112b8['shift']());}};_0x51c576(++_0x49748b);}(_0x7aab,0x15c));var _0xb7aa=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7aab[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xb7aa('0x0'));var util=require(_0xb7aa('0x1'));var logger=require(_0xb7aa('0x2'))(_0xb7aa('0x3'));var moment=require(_0xb7aa('0x4'));var BPromise=require(_0xb7aa('0x5'));var rp=require(_0xb7aa('0x6'));var fs=require('fs');var path=require(_0xb7aa('0x7'));var rimraf=require(_0xb7aa('0x8'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x20e303,_0x1fec19){return _0x20e303[_0xb7aa('0x9')](_0xb7aa('0xa'),attributes,{'tableName':_0xb7aa('0xb'),'paranoid':![],'indexes':[{'name':_0xb7aa('0xc'),'fields':[_0xb7aa('0xd'),_0xb7aa('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55a3=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x300fac,_0x27bd1d){var _0x387f53=function(_0x4cdf59){while(--_0x4cdf59){_0x300fac['push'](_0x300fac['shift']());}};_0x387f53(++_0x27bd1d);}(_0x55a3,0x8c));var _0x355a=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x55a3[_0x44dba1];return _0x2fbd3f;};'use strict';var _=require(_0x355a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x355a('0x1'));var moment=require(_0x355a('0x2'));var BPromise=require(_0x355a('0x3'));var rp=require(_0x355a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x355a('0x5'));var config=require(_0x355a('0x6'));var attributes=require(_0x355a('0x7'));module[_0x355a('0x8')]=function(_0x21ca04,_0x13eb71){return _0x21ca04[_0x355a('0x9')](_0x355a('0xa'),attributes,{'tableName':_0x355a('0xb'),'paranoid':![],'indexes':[{'name':_0x355a('0xc'),'fields':[_0x355a('0xd'),_0x355a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index f9100dc..3601104 100644 --- a/server/api/userProfileSection/userProfileSection.rpc.js +++ b/server/api/userProfileSection/userProfileSection.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d7b=['error','code','UserProfileSection,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x51f5c5,_0xcc986a){var _0x5d5363=function(_0x107528){while(--_0x107528){_0x51f5c5['push'](_0x51f5c5['shift']());}};_0x5d5363(++_0xcc986a);}(_0x0d7b,0x125));var _0xb0d7=function(_0x572563,_0x2466eb){_0x572563=_0x572563-0x0;var _0x3457e9=_0x0d7b[_0x572563];return _0x3457e9;};'use strict';var _=require(_0xb0d7('0x0'));var util=require(_0xb0d7('0x1'));var moment=require(_0xb0d7('0x2'));var BPromise=require(_0xb0d7('0x3'));var rs=require(_0xb0d7('0x4'));var fs=require('fs');var Redis=require(_0xb0d7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0d7('0x6'));var logger=require(_0xb0d7('0x7'))(_0xb0d7('0x8'));var config=require(_0xb0d7('0x9'));var jayson=require(_0xb0d7('0xa'));var client=jayson[_0xb0d7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b870a,_0x19ff69,_0x22e496){return new BPromise(function(_0x455a85,_0x4a8b30){return client[_0xb0d7('0xc')](_0x5b870a,_0x22e496)[_0xb0d7('0xd')](function(_0x304057){logger[_0xb0d7('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x19ff69,'request\x20sent');logger[_0xb0d7('0xf')](_0xb0d7('0x10'),_0x19ff69,_0xb0d7('0x11'),JSON[_0xb0d7('0x12')](_0x304057));if(_0x304057['error']){if(_0x304057[_0xb0d7('0x13')][_0xb0d7('0x14')]===0x1f4){logger[_0xb0d7('0x13')](_0xb0d7('0x15'),_0x19ff69,_0x304057['error']['message']);return _0x4a8b30(_0x304057[_0xb0d7('0x13')][_0xb0d7('0x16')]);}logger[_0xb0d7('0x13')](_0xb0d7('0x15'),_0x19ff69,_0x304057['error'][_0xb0d7('0x16')]);return _0x455a85(_0x304057[_0xb0d7('0x13')][_0xb0d7('0x16')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x19ff69,_0xb0d7('0x11'));_0x455a85(_0x304057[_0xb0d7('0x17')][_0xb0d7('0x16')]);}})['catch'](function(_0x404d86){logger[_0xb0d7('0x13')](_0xb0d7('0x15'),_0x19ff69,_0x404d86);_0x4a8b30(_0x404d86);});});} \ No newline at end of file +var _0xf65f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x236998,_0xf1c670){var _0x263fc8=function(_0x4b1c01){while(--_0x4b1c01){_0x236998['push'](_0x236998['shift']());}};_0x263fc8(++_0xf1c670);}(_0xf65f,0xf8));var _0xff65=function(_0xbf722c,_0x48d1da){_0xbf722c=_0xbf722c-0x0;var _0x3cec15=_0xf65f[_0xbf722c];return _0x3cec15;};'use strict';var _=require('lodash');var util=require(_0xff65('0x0'));var moment=require(_0xff65('0x1'));var BPromise=require(_0xff65('0x2'));var rs=require(_0xff65('0x3'));var fs=require('fs');var Redis=require(_0xff65('0x4'));var db=require(_0xff65('0x5'))['db'];var utils=require(_0xff65('0x6'));var logger=require(_0xff65('0x7'))(_0xff65('0x8'));var config=require('../../config/environment');var jayson=require(_0xff65('0x9'));var client=jayson[_0xff65('0xa')][_0xff65('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52e931,_0x2ec1cd,_0x188f8c){return new BPromise(function(_0x5d8953,_0x3c2331){return client['request'](_0x52e931,_0x188f8c)[_0xff65('0xc')](function(_0xed9eb1){logger[_0xff65('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x2ec1cd,_0xff65('0xe'));logger[_0xff65('0xf')](_0xff65('0x10'),_0x2ec1cd,_0xff65('0xe'),JSON[_0xff65('0x11')](_0xed9eb1));if(_0xed9eb1[_0xff65('0x12')]){if(_0xed9eb1['error'][_0xff65('0x13')]===0x1f4){logger['error'](_0xff65('0x14'),_0x2ec1cd,_0xed9eb1[_0xff65('0x12')][_0xff65('0x15')]);return _0x3c2331(_0xed9eb1[_0xff65('0x12')]['message']);}logger[_0xff65('0x12')](_0xff65('0x14'),_0x2ec1cd,_0xed9eb1[_0xff65('0x12')][_0xff65('0x15')]);return _0x5d8953(_0xed9eb1[_0xff65('0x12')][_0xff65('0x15')]);}else{logger[_0xff65('0xd')](_0xff65('0x14'),_0x2ec1cd,_0xff65('0xe'));_0x5d8953(_0xed9eb1[_0xff65('0x16')][_0xff65('0x15')]);}})['catch'](function(_0x1fbb4a){logger[_0xff65('0x12')](_0xff65('0x14'),_0x2ec1cd,_0x1fbb4a);_0x3c2331(_0x1fbb4a);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c40be51..50eede8 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6ad=['express','Router','../../components/auth/service','../../config/environment','multer','util','connect-timeout'];(function(_0x1f7a55,_0x352d22){var _0x2a291b=function(_0xc9d9f6){while(--_0xc9d9f6){_0x1f7a55['push'](_0x1f7a55['shift']());}};_0x2a291b(++_0x352d22);}(_0xf6ad,0x89));var _0xdf6a=function(_0x154984,_0x3ea6b7){_0x154984=_0x154984-0x0;var _0xfa689f=_0xf6ad[_0x154984];return _0xfa689f;};'use strict';var multer=require(_0xdf6a('0x0'));var util=require(_0xdf6a('0x1'));var path=require('path');var timeout=require(_0xdf6a('0x2'));var express=require(_0xdf6a('0x3'));var router=express[_0xdf6a('0x4')]();var auth=require(_0xdf6a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdf6a('0x6'));module['exports']=router; \ No newline at end of file +var _0xcdd2=['Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path','connect-timeout','express'];(function(_0x56e128,_0x11eea1){var _0x5dc821=function(_0x3cdfd3){while(--_0x3cdfd3){_0x56e128['push'](_0x56e128['shift']());}};_0x5dc821(++_0x11eea1);}(_0xcdd2,0xa6));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var path=require(_0x2cdd('0x2'));var timeout=require(_0x2cdd('0x3'));var express=require(_0x2cdd('0x4'));var router=express[_0x2cdd('0x5')]();var auth=require(_0x2cdd('0x6'));var interaction=require(_0x2cdd('0x7'));var config=require('../../config/environment');module[_0x2cdd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4fa70dc..ca21fcb 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x3b925e,_0x4ace63){var _0x1e16c4=function(_0x4c9f7e){while(--_0x4c9f7e){_0x3b925e['push'](_0x3b925e['shift']());}};_0x1e16c4(++_0x4ace63);}(_0xe706,0xa3));var _0x6e70=function(_0x5e76c6,_0xf16290){_0x5e76c6=_0x5e76c6-0x0;var _0x43fb22=_0xe706[_0x5e76c6];return _0x43fb22;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x3c6198,_0x19f82e){var _0x4ec979=function(_0x4ffca2){while(--_0x4ffca2){_0x3c6198['push'](_0x3c6198['shift']());}};_0x4ec979(++_0x19f82e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 90b6f0f..eff8ad3 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb886=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports'];(function(_0xdd036a,_0x4e3718){var _0x33072d=function(_0x3c22bc){while(--_0x3c22bc){_0xdd036a['push'](_0xdd036a['shift']());}};_0x33072d(++_0x4e3718);}(_0xb886,0x1f1));var _0x6b88=function(_0x1f46f7,_0x17c1ff){_0x1f46f7=_0x1f46f7-0x0;var _0x1693bb=_0xb886[_0x1f46f7];return _0x1693bb;};'use strict';var _=require(_0x6b88('0x0'));var util=require('util');var logger=require(_0x6b88('0x1'))(_0x6b88('0x2'));var moment=require(_0x6b88('0x3'));var BPromise=require(_0x6b88('0x4'));var rp=require(_0x6b88('0x5'));var fs=require('fs');var path=require(_0x6b88('0x6'));var rimraf=require(_0x6b88('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b88('0x8'));module[_0x6b88('0x9')]=function(_0x111732,_0x536c20){return _0x111732[_0x6b88('0xa')](_0x6b88('0xb'),attributes,{'tableName':_0x6b88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbee8=['UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d52ac,_0x329c0f){var _0x1df9ed=function(_0x41c436){while(--_0x41c436){_0x3d52ac['push'](_0x3d52ac['shift']());}};_0x1df9ed(++_0x329c0f);}(_0xbee8,0x1e2));var _0x8bee=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0xbee8[_0x2e41e2];return _0x2844d6;};'use strict';var _=require(_0x8bee('0x0'));var util=require(_0x8bee('0x1'));var logger=require(_0x8bee('0x2'))(_0x8bee('0x3'));var moment=require(_0x8bee('0x4'));var BPromise=require(_0x8bee('0x5'));var rp=require(_0x8bee('0x6'));var fs=require('fs');var path=require(_0x8bee('0x7'));var rimraf=require(_0x8bee('0x8'));var config=require(_0x8bee('0x9'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x4459d2,_0xbba8c4){return _0x4459d2['define'](_0x8bee('0xa'),attributes,{'tableName':_0x8bee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index bccc8d7..59c72d9 100644 --- a/server/api/userSmsQueue/userSmsQueue.rpc.js +++ b/server/api/userSmsQueue/userSmsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bb7=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0x155a6c,_0x48b201){var _0x6497d=function(_0x11a6c9){while(--_0x11a6c9){_0x155a6c['push'](_0x155a6c['shift']());}};_0x6497d(++_0x48b201);}(_0x7bb7,0xb8));var _0x77bb=function(_0xa6a88e,_0x594e81){_0xa6a88e=_0xa6a88e-0x0;var _0x307f66=_0x7bb7[_0xa6a88e];return _0x307f66;};'use strict';var _=require(_0x77bb('0x0'));var util=require('util');var moment=require(_0x77bb('0x1'));var BPromise=require(_0x77bb('0x2'));var rs=require(_0x77bb('0x3'));var fs=require('fs');var Redis=require(_0x77bb('0x4'));var db=require(_0x77bb('0x5'))['db'];var utils=require(_0x77bb('0x6'));var logger=require(_0x77bb('0x7'))(_0x77bb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77bb('0x9')][_0x77bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cbc5c,_0x13a389,_0x2e6601){return new BPromise(function(_0x523499,_0x2ce71d){return client['request'](_0x3cbc5c,_0x2e6601)[_0x77bb('0xb')](function(_0x44c5bd){logger['info'](_0x77bb('0xc'),_0x13a389,'request\x20sent');logger[_0x77bb('0xd')](_0x77bb('0xe'),_0x13a389,'request\x20sent',JSON[_0x77bb('0xf')](_0x44c5bd));if(_0x44c5bd['error']){if(_0x44c5bd[_0x77bb('0x10')][_0x77bb('0x11')]===0x1f4){logger[_0x77bb('0x10')](_0x77bb('0xc'),_0x13a389,_0x44c5bd[_0x77bb('0x10')][_0x77bb('0x12')]);return _0x2ce71d(_0x44c5bd[_0x77bb('0x10')]['message']);}logger[_0x77bb('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x13a389,_0x44c5bd[_0x77bb('0x10')][_0x77bb('0x12')]);return _0x523499(_0x44c5bd['error'][_0x77bb('0x12')]);}else{logger[_0x77bb('0x13')](_0x77bb('0xc'),_0x13a389,_0x77bb('0x14'));_0x523499(_0x44c5bd[_0x77bb('0x15')][_0x77bb('0x12')]);}})[_0x77bb('0x16')](function(_0x104b0e){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x13a389,_0x104b0e);_0x2ce71d(_0x104b0e);});});} \ No newline at end of file +var _0x0475=['client','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x367816,_0x35633c){var _0x2cdde2=function(_0x153253){while(--_0x153253){_0x367816['push'](_0x367816['shift']());}};_0x2cdde2(++_0x35633c);}(_0x0475,0x165));var _0x5047=function(_0x4fecb6,_0x45ed64){_0x4fecb6=_0x4fecb6-0x0;var _0xa9a47=_0x0475[_0x4fecb6];return _0xa9a47;};'use strict';var _=require(_0x5047('0x0'));var util=require(_0x5047('0x1'));var moment=require(_0x5047('0x2'));var BPromise=require(_0x5047('0x3'));var rs=require(_0x5047('0x4'));var fs=require('fs');var Redis=require(_0x5047('0x5'));var db=require(_0x5047('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5047('0x7'))(_0x5047('0x8'));var config=require(_0x5047('0x9'));var jayson=require(_0x5047('0xa'));var client=jayson[_0x5047('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x378db6,_0x19273d,_0xbf3313){return new BPromise(function(_0x3f8652,_0x3d5cc5){return client['request'](_0x378db6,_0xbf3313)[_0x5047('0xc')](function(_0x4689){logger[_0x5047('0xd')](_0x5047('0xe'),_0x19273d,'request\x20sent');logger[_0x5047('0xf')](_0x5047('0x10'),_0x19273d,_0x5047('0x11'),JSON[_0x5047('0x12')](_0x4689));if(_0x4689[_0x5047('0x13')]){if(_0x4689['error']['code']===0x1f4){logger[_0x5047('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x19273d,_0x4689[_0x5047('0x13')][_0x5047('0x14')]);return _0x3d5cc5(_0x4689[_0x5047('0x13')][_0x5047('0x14')]);}logger['error'](_0x5047('0xe'),_0x19273d,_0x4689[_0x5047('0x13')][_0x5047('0x14')]);return _0x3f8652(_0x4689[_0x5047('0x13')][_0x5047('0x14')]);}else{logger[_0x5047('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x19273d,_0x5047('0x11'));_0x3f8652(_0x4689[_0x5047('0x15')][_0x5047('0x14')]);}})[_0x5047('0x16')](function(_0x201d7c){logger[_0x5047('0x13')](_0x5047('0xe'),_0x19273d,_0x201d7c);_0x3d5cc5(_0x201d7c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 358748c..2884caf 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0d0=['../../components/interaction/service','../../config/environment','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xc0d0,0x80));var _0x0c0d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc0d0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0c0d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0c0d('0x1'));var express=require(_0x0c0d('0x2'));var router=express[_0x0c0d('0x3')]();var auth=require(_0x0c0d('0x4'));var interaction=require(_0x0c0d('0x5'));var config=require(_0x0c0d('0x6'));module['exports']=router; \ No newline at end of file +var _0x3c75=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x1a89a8,_0x5bbce9){var _0x56ee75=function(_0x293394){while(--_0x293394){_0x1a89a8['push'](_0x1a89a8['shift']());}};_0x56ee75(++_0x5bbce9);}(_0x3c75,0x8f));var _0x53c7=function(_0x58353d,_0x31f429){_0x58353d=_0x58353d-0x0;var _0x23c01c=_0x3c75[_0x58353d];return _0x23c01c;};'use strict';var multer=require(_0x53c7('0x0'));var util=require('util');var path=require(_0x53c7('0x1'));var timeout=require(_0x53c7('0x2'));var express=require(_0x53c7('0x3'));var router=express[_0x53c7('0x4')]();var auth=require(_0x53c7('0x5'));var interaction=require(_0x53c7('0x6'));var config=require('../../config/environment');module[_0x53c7('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 2bb55ab..6685b43 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x51eb1b,_0x3f0f18){var _0x125309=function(_0x56e9b4){while(--_0x56e9b4){_0x51eb1b['push'](_0x51eb1b['shift']());}};_0x125309(++_0x3f0f18);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x2f4d41,_0x525047){var _0x3b0bb2=function(_0x19960d){while(--_0x19960d){_0x2f4d41['push'](_0x2f4d41['shift']());}};_0x3b0bb2(++_0x525047);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 5c9ab2f..4e2810c 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.model.js +++ b/server/api/userVoiceQueue/userVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2ea=['user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x575a31,_0x56336f){var _0x5d7dad=function(_0x2c8c09){while(--_0x2c8c09){_0x575a31['push'](_0x575a31['shift']());}};_0x5d7dad(++_0x56336f);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4717b0,_0x52619b){_0x4717b0=_0x4717b0-0x0;var _0x3ff995=_0xd2ea[_0x4717b0];return _0x3ff995;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x826a=['request-promise','path','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util','api','bluebird'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x826a,0x1aa));var _0xa826=function(_0x3d909a,_0x3a0fa2){_0x3d909a=_0x3d909a-0x0;var _0x83b49f=_0x826a[_0x3d909a];return _0x83b49f;};'use strict';var _=require('lodash');var util=require(_0xa826('0x0'));var logger=require('../../config/logger')(_0xa826('0x1'));var moment=require('moment');var BPromise=require(_0xa826('0x2'));var rp=require(_0xa826('0x3'));var fs=require('fs');var path=require(_0xa826('0x4'));var rimraf=require(_0xa826('0x5'));var config=require('../../config/environment');var attributes=require(_0xa826('0x6'));module[_0xa826('0x7')]=function(_0x3929d4,_0x34327b){return _0x3929d4[_0xa826('0x8')](_0xa826('0x9'),attributes,{'tableName':_0xa826('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 67e42d0..0e43e00 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js +++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11d7=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x8b8788,_0xd86da1){var _0x2a3faa=function(_0x51827d){while(--_0x51827d){_0x8b8788['push'](_0x8b8788['shift']());}};_0x2a3faa(++_0xd86da1);}(_0x11d7,0xe7));var _0x711d=function(_0x1c461e,_0x1b98ff){_0x1c461e=_0x1c461e-0x0;var _0x1dce4f=_0x11d7[_0x1c461e];return _0x1dce4f;};'use strict';var _=require(_0x711d('0x0'));var util=require(_0x711d('0x1'));var moment=require('moment');var BPromise=require(_0x711d('0x2'));var rs=require(_0x711d('0x3'));var fs=require('fs');var Redis=require(_0x711d('0x4'));var db=require(_0x711d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x711d('0x6'))('rpc');var config=require(_0x711d('0x7'));var jayson=require(_0x711d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd3d151,_0x3a05c4,_0x574714){return new BPromise(function(_0x1dd6ba,_0x450efb){return client['request'](_0xd3d151,_0x574714)['then'](function(_0x1d314d){logger[_0x711d('0x9')](_0x711d('0xa'),_0x3a05c4,_0x711d('0xb'));logger['debug'](_0x711d('0xc'),_0x3a05c4,_0x711d('0xb'),JSON[_0x711d('0xd')](_0x1d314d));if(_0x1d314d[_0x711d('0xe')]){if(_0x1d314d['error'][_0x711d('0xf')]===0x1f4){logger[_0x711d('0xe')](_0x711d('0xa'),_0x3a05c4,_0x1d314d[_0x711d('0xe')][_0x711d('0x10')]);return _0x450efb(_0x1d314d[_0x711d('0xe')][_0x711d('0x10')]);}logger[_0x711d('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x3a05c4,_0x1d314d['error'][_0x711d('0x10')]);return _0x1dd6ba(_0x1d314d[_0x711d('0xe')][_0x711d('0x10')]);}else{logger[_0x711d('0x9')](_0x711d('0xa'),_0x3a05c4,_0x711d('0xb'));_0x1dd6ba(_0x1d314d[_0x711d('0x11')][_0x711d('0x10')]);}})['catch'](function(_0x3dce7b){logger[_0x711d('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x3a05c4,_0x3dce7b);_0x450efb(_0x3dce7b);});});} \ No newline at end of file +var _0xc4fb=['request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client'];(function(_0x2b8a31,_0x4457a4){var _0x117ee4=function(_0x13c9dd){while(--_0x13c9dd){_0x2b8a31['push'](_0x2b8a31['shift']());}};_0x117ee4(++_0x4457a4);}(_0xc4fb,0xbe));var _0xbc4f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc4fb[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xbc4f('0x0'));var util=require(_0xbc4f('0x1'));var moment=require('moment');var BPromise=require(_0xbc4f('0x2'));var rs=require(_0xbc4f('0x3'));var fs=require('fs');var Redis=require(_0xbc4f('0x4'));var db=require(_0xbc4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc4f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc4f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2101a9,_0x5205f5,_0x581234){return new BPromise(function(_0x21e7f5,_0xa41d4c){return client[_0xbc4f('0x8')](_0x2101a9,_0x581234)['then'](function(_0x1738e5){logger['info'](_0xbc4f('0x9'),_0x5205f5,_0xbc4f('0xa'));logger[_0xbc4f('0xb')](_0xbc4f('0xc'),_0x5205f5,_0xbc4f('0xa'),JSON[_0xbc4f('0xd')](_0x1738e5));if(_0x1738e5['error']){if(_0x1738e5['error']['code']===0x1f4){logger['error'](_0xbc4f('0x9'),_0x5205f5,_0x1738e5[_0xbc4f('0xe')]['message']);return _0xa41d4c(_0x1738e5[_0xbc4f('0xe')][_0xbc4f('0xf')]);}logger[_0xbc4f('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x5205f5,_0x1738e5['error'][_0xbc4f('0xf')]);return _0x21e7f5(_0x1738e5[_0xbc4f('0xe')][_0xbc4f('0xf')]);}else{logger[_0xbc4f('0x10')](_0xbc4f('0x9'),_0x5205f5,_0xbc4f('0xa'));_0x21e7f5(_0x1738e5[_0xbc4f('0x11')][_0xbc4f('0xf')]);}})['catch'](function(_0x31f320){logger['error'](_0xbc4f('0x9'),_0x5205f5,_0x31f320);_0xa41d4c(_0x31f320);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b2eeae8..5ceb6ee 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6acb=['../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x6acb,0xb7));var _0xb6ac=function(_0x2b18d8,_0x21778e){_0x2b18d8=_0x2b18d8-0x0;var _0x2bcce2=_0x6acb[_0x2b18d8];return _0x2bcce2;};'use strict';var multer=require(_0xb6ac('0x0'));var util=require('util');var path=require(_0xb6ac('0x1'));var timeout=require(_0xb6ac('0x2'));var express=require(_0xb6ac('0x3'));var router=express[_0xb6ac('0x4')]();var auth=require(_0xb6ac('0x5'));var interaction=require(_0xb6ac('0x6'));var config=require(_0xb6ac('0x7'));module[_0xb6ac('0x8')]=router; \ No newline at end of file +var _0xc0d5=['../../config/environment','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc0d5,0x13f));var _0x5c0d=function(_0x41f250,_0x372f3c){_0x41f250=_0x41f250-0x0;var _0x17e382=_0xc0d5[_0x41f250];return _0x17e382;};'use strict';var multer=require(_0x5c0d('0x0'));var util=require(_0x5c0d('0x1'));var path=require(_0x5c0d('0x2'));var timeout=require(_0x5c0d('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x5c0d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5c0d('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index f0e91f4..381dc6d 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e46=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x48a836,_0xa1d010){var _0x249dc8=function(_0x2a95a0){while(--_0x2a95a0){_0x48a836['push'](_0x48a836['shift']());}};_0x249dc8(++_0xa1d010);}(_0x3e46,0x10a));var _0x63e4=function(_0xd1e8fd,_0x2d772d){_0xd1e8fd=_0xd1e8fd-0x0;var _0x7aca26=_0x3e46[_0xd1e8fd];return _0x7aca26;};'use strict';var Sequelize=require(_0x63e4('0x0'));module[_0x63e4('0x1')]={'uniqueid':{'type':Sequelize[_0x63e4('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x63e4('0x3')},'membername':{'type':Sequelize[_0x63e4('0x4')],'allowNull':![],'comment':_0x63e4('0x3')},'UserId':{'type':Sequelize[_0x63e4('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x63e4('0x4')],'allowNull':![],'unique':_0x63e4('0x5'),'comment':_0x63e4('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x63e4('0x4')],'allowNull':![],'unique':_0x63e4('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x63e4('0x2')](0xb),'defaultValue':0x0,'comment':_0x63e4('0x3')},'paused':{'type':Sequelize[_0x63e4('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xfd56=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfd56,0x153));var _0x6fd5=function(_0x9fad3a,_0x257f06){_0x9fad3a=_0x9fad3a-0x0;var _0x1bc9e7=_0xfd56[_0x9fad3a];return _0x1bc9e7;};'use strict';var Sequelize=require(_0x6fd5('0x0'));module[_0x6fd5('0x1')]={'uniqueid':{'type':Sequelize[_0x6fd5('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6fd5('0x3')},'membername':{'type':Sequelize[_0x6fd5('0x4')],'allowNull':![],'comment':_0x6fd5('0x3')},'UserId':{'type':Sequelize[_0x6fd5('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x6fd5('0x3')},'VoiceQueueId':{'type':Sequelize[_0x6fd5('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x6fd5('0x4')],'allowNull':![],'unique':_0x6fd5('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x6fd5('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 67b9b4f..ad9773a 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bd2=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x138668,_0x4ac059){var _0x4ac27d=function(_0x4d479b){while(--_0x4d479b){_0x138668['push'](_0x138668['shift']());}};_0x4ac27d(++_0x4ac059);}(_0x8bd2,0x1af));var _0x28bd=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0x8bd2[_0x1d5ba8];return _0x1022a2;};'use strict';var EventEmitter=require(_0x28bd('0x0'));var UserVoiceQueueRt=require(_0x28bd('0x1'))['db'][_0x28bd('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x28bd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x28bd('0x4'),'afterDestroy':_0x28bd('0x5')};function emitEvent(_0x2a9978){return function(_0x384ea3,_0x45b216,_0x8ae22){UserVoiceQueueRtEvents[_0x28bd('0x6')](_0x2a9978+':'+_0x384ea3['id'],_0x384ea3);UserVoiceQueueRtEvents['emit'](_0x2a9978,_0x384ea3);_0x8ae22(null);};}for(var e in events){if(events[_0x28bd('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x28bd('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xa4e7=['update','emit','../../mysqldb','setMaxListeners','save'];(function(_0x3340b2,_0x5525df){var _0x399b07=function(_0x52050f){while(--_0x52050f){_0x3340b2['push'](_0x3340b2['shift']());}};_0x399b07(++_0x5525df);}(_0xa4e7,0x16f));var _0x7a4e=function(_0x329e86,_0x26c12e){_0x329e86=_0x329e86-0x0;var _0x49f51c=_0xa4e7[_0x329e86];return _0x49f51c;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x7a4e('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x7a4e('0x1')](0x0);var events={'afterCreate':_0x7a4e('0x2'),'afterUpdate':_0x7a4e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x39623c){return function(_0x497619,_0x365525,_0x25f963){UserVoiceQueueRtEvents[_0x7a4e('0x4')](_0x39623c+':'+_0x497619['id'],_0x497619);UserVoiceQueueRtEvents[_0x7a4e('0x4')](_0x39623c,_0x497619);_0x25f963(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 0263ecc..8a1702b 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x154f=['path','../../config/environment','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x9995fb,_0x45bab5){var _0x1ae1cd=function(_0x496b13){while(--_0x496b13){_0x9995fb['push'](_0x9995fb['shift']());}};_0x1ae1cd(++_0x45bab5);}(_0x154f,0x73));var _0xf154=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x154f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf154('0x0'));var util=require(_0xf154('0x1'));var logger=require(_0xf154('0x2'))(_0xf154('0x3'));var moment=require('moment');var BPromise=require(_0xf154('0x4'));var rp=require(_0xf154('0x5'));var fs=require('fs');var path=require(_0xf154('0x6'));var rimraf=require('rimraf');var config=require(_0xf154('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x525b48,_0x5e4575){return _0x525b48[_0xf154('0x8')](_0xf154('0x9'),attributes,{'tableName':_0xf154('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3572=['./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1e0525,_0x3a7f29){var _0x10ffb7=function(_0x3fdbb8){while(--_0x3fdbb8){_0x1e0525['push'](_0x1e0525['shift']());}};_0x10ffb7(++_0x3a7f29);}(_0x3572,0x1dd));var _0x2357=function(_0x11fb55,_0x3cb463){_0x11fb55=_0x11fb55-0x0;var _0x55c1ff=_0x3572[_0x11fb55];return _0x55c1ff;};'use strict';var _=require(_0x2357('0x0'));var util=require(_0x2357('0x1'));var logger=require(_0x2357('0x2'))(_0x2357('0x3'));var moment=require(_0x2357('0x4'));var BPromise=require('bluebird');var rp=require(_0x2357('0x5'));var fs=require('fs');var path=require(_0x2357('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2357('0x7'));module[_0x2357('0x8')]=function(_0x4d5f3,_0x4fa0e9){return _0x4d5f3[_0x2357('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0x2357('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 4c34028..3452e2c 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34c9=['defaults','redis','localhost','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2e8660,_0x5ca0c2){var _0x3dc331=function(_0x20f7c1){while(--_0x20f7c1){_0x2e8660['push'](_0x2e8660['shift']());}};_0x3dc331(++_0x5ca0c2);}(_0x34c9,0x1df));var _0x934c=function(_0x24f145,_0x6e27d6){_0x24f145=_0x24f145-0x0;var _0x3708d8=_0x34c9[_0x24f145];return _0x3708d8;};'use strict';var _=require(_0x934c('0x0'));var util=require(_0x934c('0x1'));var moment=require(_0x934c('0x2'));var BPromise=require(_0x934c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x934c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x934c('0x5'));var logger=require(_0x934c('0x6'))(_0x934c('0x7'));var config=require('../../config/environment');var jayson=require(_0x934c('0x8'));var client=jayson[_0x934c('0x9')][_0x934c('0xa')]({'port':0x232a});config['redis']=_[_0x934c('0xb')](config[_0x934c('0xc')],{'host':_0x934c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x934c('0xc')]));require('./userVoiceQueueRt.socket')[_0x934c('0xe')](socket);function respondWithRpcPromise(_0x28e76d,_0x536ab4,_0x3ea53d){return new BPromise(function(_0x4775fd,_0x2ffd19){return client[_0x934c('0xf')](_0x28e76d,_0x3ea53d)[_0x934c('0x10')](function(_0x1f74bf){logger[_0x934c('0x11')](_0x934c('0x12'),_0x536ab4,_0x934c('0x13'));logger[_0x934c('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x536ab4,_0x934c('0x13'),JSON[_0x934c('0x15')](_0x1f74bf));if(_0x1f74bf[_0x934c('0x16')]){if(_0x1f74bf[_0x934c('0x16')]['code']===0x1f4){logger['error'](_0x934c('0x12'),_0x536ab4,_0x1f74bf[_0x934c('0x16')][_0x934c('0x17')]);return _0x2ffd19(_0x1f74bf[_0x934c('0x16')][_0x934c('0x17')]);}logger[_0x934c('0x16')](_0x934c('0x12'),_0x536ab4,_0x1f74bf[_0x934c('0x16')][_0x934c('0x17')]);return _0x4775fd(_0x1f74bf[_0x934c('0x16')]['message']);}else{logger[_0x934c('0x11')](_0x934c('0x12'),_0x536ab4,'request\x20sent');_0x4775fd(_0x1f74bf['result'][_0x934c('0x17')]);}})[_0x934c('0x18')](function(_0x41599c){logger[_0x934c('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x536ab4,_0x41599c);_0x2ffd19(_0x41599c);});});}exports[_0x934c('0x19')]=function(_0x24aaac){var _0x7660ac=this;return new Promise(function(_0x54d491,_0x2e748a){return db['UserVoiceQueueRt'][_0x934c('0x1a')]({'raw':_0x24aaac['options']?_0x24aaac[_0x934c('0x1b')][_0x934c('0x1c')]===undefined?!![]:![]:!![],'where':_0x24aaac[_0x934c('0x1b')]?_0x24aaac[_0x934c('0x1b')][_0x934c('0x1d')]||null:null,'attributes':[[db[_0x934c('0x1e')]['fn'](_0x934c('0x1f'),db[_0x934c('0x1e')]['fn']('IF',db['sequelize'][_0x934c('0x20')](_0x934c('0x21')))),_0x934c('0x22')]]})[_0x934c('0x10')](function(_0x85d4cd){logger[_0x934c('0x11')]('GetVoiceQueueRtPauses',_0x24aaac);logger[_0x934c('0x14')](_0x934c('0x19'),_0x24aaac,JSON[_0x934c('0x15')](_0x85d4cd));_0x54d491(_0x85d4cd);})[_0x934c('0x18')](function(_0x4b31a5){logger['error'](_0x934c('0x19'),_0x4b31a5[_0x934c('0x17')],_0x24aaac);_0x2e748a(_0x7660ac[_0x934c('0x16')](0x1f4,_0x4b31a5[_0x934c('0x17')]));});});}; \ No newline at end of file +var _0x376e=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','raw','options','where','sequelize','COUNT','outboundQueuePauses','debug','lodash','util','moment','bluebird','ioredis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x376e,0x12d));var _0xe376=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x376e[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xe376('0x0'));var util=require(_0xe376('0x1'));var moment=require(_0xe376('0x2'));var BPromise=require(_0xe376('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe376('0x4'));var db=require(_0xe376('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe376('0x6'))('rpc');var config=require(_0xe376('0x7'));var jayson=require(_0xe376('0x8'));var client=jayson['client'][_0xe376('0x9')]({'port':0x232a});config[_0xe376('0xa')]=_['defaults'](config['redis'],{'host':_0xe376('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe376('0xa')]));require(_0xe376('0xc'))[_0xe376('0xd')](socket);function respondWithRpcPromise(_0x205178,_0x2d184f,_0x3e438d){return new BPromise(function(_0x473ab1,_0x18afd0){return client[_0xe376('0xe')](_0x205178,_0x3e438d)[_0xe376('0xf')](function(_0x30473d){logger[_0xe376('0x10')](_0xe376('0x11'),_0x2d184f,'request\x20sent');logger['debug'](_0xe376('0x12'),_0x2d184f,_0xe376('0x13'),JSON[_0xe376('0x14')](_0x30473d));if(_0x30473d[_0xe376('0x15')]){if(_0x30473d[_0xe376('0x15')]['code']===0x1f4){logger[_0xe376('0x15')](_0xe376('0x11'),_0x2d184f,_0x30473d[_0xe376('0x15')][_0xe376('0x16')]);return _0x18afd0(_0x30473d[_0xe376('0x15')][_0xe376('0x16')]);}logger[_0xe376('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d184f,_0x30473d[_0xe376('0x15')][_0xe376('0x16')]);return _0x473ab1(_0x30473d['error']['message']);}else{logger['info'](_0xe376('0x11'),_0x2d184f,_0xe376('0x13'));_0x473ab1(_0x30473d[_0xe376('0x17')][_0xe376('0x16')]);}})[_0xe376('0x18')](function(_0x3ff5b5){logger[_0xe376('0x15')](_0xe376('0x11'),_0x2d184f,_0x3ff5b5);_0x18afd0(_0x3ff5b5);});});}exports[_0xe376('0x19')]=function(_0x4877e8){var _0x4c8a74=this;return new Promise(function(_0x27e51f,_0x1aedda){return db[_0xe376('0x1a')]['findAll']({'raw':_0x4877e8['options']?_0x4877e8['options'][_0xe376('0x1b')]===undefined?!![]:![]:!![],'where':_0x4877e8[_0xe376('0x1c')]?_0x4877e8[_0xe376('0x1c')][_0xe376('0x1d')]||null:null,'attributes':[[db[_0xe376('0x1e')]['fn'](_0xe376('0x1f'),db[_0xe376('0x1e')]['fn']('IF',db[_0xe376('0x1e')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0xe376('0x20')]]})[_0xe376('0xf')](function(_0x233cc9){logger[_0xe376('0x10')]('GetVoiceQueueRtPauses',_0x4877e8);logger[_0xe376('0x21')](_0xe376('0x19'),_0x4877e8,JSON[_0xe376('0x14')](_0x233cc9));_0x27e51f(_0x233cc9);})[_0xe376('0x18')](function(_0x2a06e7){logger[_0xe376('0x15')](_0xe376('0x19'),_0x2a06e7[_0xe376('0x16')],_0x4877e8);_0x1aedda(_0x4c8a74[_0xe376('0x15')](0x1f4,_0x2a06e7['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index ab0e84a..0ad5399 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4ed=['update','emit','removeListener','length','userVoiceQueueRt:','save','remove'];(function(_0x314e22,_0x891517){var _0x4ac0f5=function(_0x43aa65){while(--_0x43aa65){_0x314e22['push'](_0x314e22['shift']());}};_0x4ac0f5(++_0x891517);}(_0xf4ed,0x1a2));var _0xdf4e=function(_0x16dd98,_0x11d346){_0x16dd98=_0x16dd98-0x0;var _0xfc7fb3=_0xf4ed[_0x16dd98];return _0xfc7fb3;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xdf4e('0x0'),_0xdf4e('0x1'),_0xdf4e('0x2')];function createListener(_0x34143a,_0x1315b8){return function(_0xc73741){_0x1315b8[_0xdf4e('0x3')](_0x34143a,_0xc73741);};}function removeListener(_0x7df53c,_0x50e1b9){return function(){UserVoiceQueueRtEvents[_0xdf4e('0x4')](_0x7df53c,_0x50e1b9);};}exports['register']=function(_0x47cdde){for(var _0x8439ff=0x0,_0x1fdb6b=events[_0xdf4e('0x5')];_0x8439ff<_0x1fdb6b;_0x8439ff++){var _0xa5b401=events[_0x8439ff];var _0x2f0418=createListener(_0xdf4e('0x6')+_0xa5b401,_0x47cdde);UserVoiceQueueRtEvents['on'](_0xa5b401,_0x2f0418);}}; \ No newline at end of file +var _0x7ba3=['userVoiceQueueRt:','save','remove','emit','removeListener','register','length'];(function(_0x2a34d5,_0x5b3582){var _0xb0f25=function(_0x465b8e){while(--_0x465b8e){_0x2a34d5['push'](_0x2a34d5['shift']());}};_0xb0f25(++_0x5b3582);}(_0x7ba3,0xe1));var _0x37ba=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x7ba3[_0x2b9b7f];return _0x4ed19a;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x37ba('0x0'),_0x37ba('0x1'),'update'];function createListener(_0x13ff22,_0x517459){return function(_0x469885){_0x517459[_0x37ba('0x2')](_0x13ff22,_0x469885);};}function removeListener(_0x422e0f,_0x32a0be){return function(){UserVoiceQueueRtEvents[_0x37ba('0x3')](_0x422e0f,_0x32a0be);};}exports[_0x37ba('0x4')]=function(_0x61e1e5){for(var _0x323866=0x0,_0x134617=events[_0x37ba('0x5')];_0x323866<_0x134617;_0x323866++){var _0x4a4ce6=events[_0x323866];var _0x54fa7f=createListener(_0x37ba('0x6')+_0x4a4ce6,_0x61e1e5);UserVoiceQueueRtEvents['on'](_0x4a4ce6,_0x54fa7f);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 068fd10..b00f788 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90c4=['index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./variable.controller','get'];(function(_0xb85a1b,_0x2e6ad2){var _0x4a5187=function(_0x3529d7){while(--_0x3529d7){_0xb85a1b['push'](_0xb85a1b['shift']());}};_0x4a5187(++_0x2e6ad2);}(_0x90c4,0x172));var _0x490c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x90c4[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x490c('0x0'));var util=require(_0x490c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x490c('0x2'));var router=express[_0x490c('0x3')]();var auth=require(_0x490c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x490c('0x5'));var controller=require(_0x490c('0x6'));router[_0x490c('0x7')]('/',auth['isAuthenticated'](),controller[_0x490c('0x8')]);router[_0x490c('0x7')](_0x490c('0x9'),auth[_0x490c('0xa')](),controller[_0x490c('0xb')]);router[_0x490c('0xc')]('/',auth[_0x490c('0xa')](),controller[_0x490c('0xd')]);router[_0x490c('0xe')](_0x490c('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x490c('0xf')](_0x490c('0x9'),auth[_0x490c('0xa')](),controller[_0x490c('0x10')]);module[_0x490c('0x11')]=router; \ No newline at end of file +var _0x7f1f=['index','/:id','show','post','create','put','update','delete','destroy','exports','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0x567d04,_0x3d13a1){var _0x58ee79=function(_0x4c5548){while(--_0x4c5548){_0x567d04['push'](_0x567d04['shift']());}};_0x58ee79(++_0x3d13a1);}(_0x7f1f,0xe2));var _0xf7f1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7f1f[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf7f1('0x0'));var timeout=require('connect-timeout');var express=require(_0xf7f1('0x1'));var router=express['Router']();var auth=require(_0xf7f1('0x2'));var interaction=require(_0xf7f1('0x3'));var config=require(_0xf7f1('0x4'));var controller=require(_0xf7f1('0x5'));router[_0xf7f1('0x6')]('/',auth[_0xf7f1('0x7')](),controller[_0xf7f1('0x8')]);router[_0xf7f1('0x6')](_0xf7f1('0x9'),auth[_0xf7f1('0x7')](),controller[_0xf7f1('0xa')]);router[_0xf7f1('0xb')]('/',auth[_0xf7f1('0x7')](),controller[_0xf7f1('0xc')]);router[_0xf7f1('0xd')](_0xf7f1('0x9'),auth[_0xf7f1('0x7')](),controller[_0xf7f1('0xe')]);router[_0xf7f1('0xf')]('/:id',auth[_0xf7f1('0x7')](),controller[_0xf7f1('0x10')]);module[_0xf7f1('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index db54ca0..eba61b3 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25be=['sequelize','exports','STRING'];(function(_0x220f64,_0x22cea4){var _0x21913b=function(_0x397639){while(--_0x397639){_0x220f64['push'](_0x220f64['shift']());}};_0x21913b(++_0x22cea4);}(_0x25be,0x132));var _0xe25b=function(_0x2c5b35,_0x3a938d){_0x2c5b35=_0x2c5b35-0x0;var _0x1c5bb2=_0x25be[_0x2c5b35];return _0x1c5bb2;};'use strict';var Sequelize=require(_0xe25b('0x0'));module[_0xe25b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe25b('0x2')]}}; \ No newline at end of file +var _0xd5e8=['exports','STRING','name','sequelize'];(function(_0x582df7,_0x3d02cf){var _0x5081fd=function(_0x3f197c){while(--_0x3f197c){_0x582df7['push'](_0x582df7['shift']());}};_0x5081fd(++_0x3d02cf);}(_0xd5e8,0x16b));var _0x8d5e=function(_0x377844,_0x904528){_0x377844=_0x377844-0x0;var _0x308415=_0xd5e8[_0x377844];return _0x308415;};'use strict';var Sequelize=require(_0x8d5e('0x0'));module[_0x8d5e('0x1')]={'name':{'type':Sequelize[_0x8d5e('0x2')],'unique':_0x8d5e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8d5e('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c72dadf..5a349b2 100644 --- a/server/api/variable/variable.controller.js +++ b/server/api/variable/variable.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ba1=['rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Variable','includeAll','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','save','destroy','then','get','Variables','UserProfileResource','end','error','stack','name','send'];(function(_0x49639b,_0x16a95b){var _0x361647=function(_0x3f7652){while(--_0x3f7652){_0x49639b['push'](_0x49639b['shift']());}};_0x361647(++_0x16a95b);}(_0x4ba1,0x79));var _0x14ba=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4ba1[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x14ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x14ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14ba('0x2'));var BPromise=require(_0x14ba('0x3'));var Mustache=require(_0x14ba('0x4'));var util=require('util');var path=require(_0x14ba('0x5'));var sox=require(_0x14ba('0x6'));var csv=require(_0x14ba('0x7'));var ejs=require(_0x14ba('0x8'));var fs=require('fs');var _=require(_0x14ba('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x14ba('0xa'));var deskjs=require(_0x14ba('0xb'));var toCsv=require(_0x14ba('0x7'));var querystring=require(_0x14ba('0xc'));var Papa=require(_0x14ba('0xd'));var Redis=require(_0x14ba('0xe'));var authService=require(_0x14ba('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x14ba('0x10'));var hardwareService=require(_0x14ba('0x11'));var logger=require(_0x14ba('0x12'))(_0x14ba('0x13'));var utils=require(_0x14ba('0x14'));var config=require(_0x14ba('0x15'));var db=require(_0x14ba('0x16'))['db'];function respondWithStatusCode(_0x1d2815,_0x48bc2b){_0x48bc2b=_0x48bc2b||0xcc;return function(_0xda6f89){if(_0xda6f89){return _0x1d2815[_0x14ba('0x17')](_0x48bc2b);}return _0x1d2815[_0x14ba('0x18')](_0x48bc2b)['end']();};}function respondWithResult(_0x8eef,_0x1d2b8c){_0x1d2b8c=_0x1d2b8c||0xc8;return function(_0x62b3fd){if(_0x62b3fd){return _0x8eef['status'](_0x1d2b8c)['json'](_0x62b3fd);}};}function respondWithFilteredResult(_0x390059,_0x18fd8d){return function(_0x9f8091){if(_0x9f8091){var _0x20a48e=_0x9f8091[_0x14ba('0x19')],_0x36ba2b=_0x18fd8d[_0x14ba('0x1a')],_0x4f13d9=_0x18fd8d['offset']+_0x18fd8d[_0x14ba('0x1b')],_0x175f1f;if(_0x4f13d9>=_0x20a48e){_0x4f13d9=_0x20a48e;_0x175f1f=0xc8;}else{_0x175f1f=0xce;}_0x390059[_0x14ba('0x18')](_0x175f1f);return _0x390059['set'](_0x14ba('0x1c'),_0x36ba2b+'-'+_0x4f13d9+'/'+_0x20a48e)[_0x14ba('0x1d')](_0x9f8091);}return null;};}function patchUpdates(_0x5daa48){return function(_0x2e4b3a){try{jsonpatch[_0x14ba('0x1e')](_0x2e4b3a,_0x5daa48,!![]);}catch(_0x36a96f){return BPromise[_0x14ba('0x1f')](_0x36a96f);}return _0x2e4b3a[_0x14ba('0x20')]();};}function saveUpdates(_0x38e75d,_0x3ab5a8){return function(_0x46580a){if(_0x46580a){return _0x46580a['update'](_0x38e75d)['then'](function(_0x2dd354){return _0x2dd354;});}return null;};}function removeEntity(_0xd797d3,_0x4331e5){return function(_0x2e9eff){if(_0x2e9eff){return _0x2e9eff[_0x14ba('0x21')]()[_0x14ba('0x22')](function(){var _0x514649=_0x2e9eff[_0x14ba('0x23')]({'plain':!![]});var _0x3f60bb=_0x14ba('0x24');return db[_0x14ba('0x25')][_0x14ba('0x21')]({'where':{'type':_0x3f60bb,'resourceId':_0x514649['id']}})[_0x14ba('0x22')](function(){return _0x2e9eff;});})[_0x14ba('0x22')](function(){_0xd797d3[_0x14ba('0x18')](0xcc)[_0x14ba('0x26')]();});}};}function handleEntityNotFound(_0x4bbeff,_0x1a8d1f){return function(_0x57dbc3){if(!_0x57dbc3){_0x4bbeff[_0x14ba('0x17')](0x194);}return _0x57dbc3;};}function handleError(_0x2a7813,_0x1ed15b){_0x1ed15b=_0x1ed15b||0x1f4;return function(_0x512ef7){logger[_0x14ba('0x27')](_0x512ef7[_0x14ba('0x28')]);if(_0x512ef7['name']){delete _0x512ef7[_0x14ba('0x29')];}_0x2a7813['status'](_0x1ed15b)[_0x14ba('0x2a')](_0x512ef7);};}exports['index']=function(_0x5741ba,_0x8714ce){var _0x10dc24={},_0x337b6b={},_0x3d666a={'count':0x0,'rows':[]};var _0x5cc181=_['map'](db['Variable'][_0x14ba('0x2b')],function(_0x40d0ea){return{'name':_0x40d0ea[_0x14ba('0x2c')],'type':_0x40d0ea[_0x14ba('0x2d')][_0x14ba('0x2e')]};});_0x337b6b[_0x14ba('0x2f')]=_[_0x14ba('0x30')](_0x5cc181,'name');_0x337b6b['query']=_[_0x14ba('0x31')](_0x5741ba['query']);_0x337b6b['filters']=_[_0x14ba('0x32')](_0x337b6b[_0x14ba('0x2f')],_0x337b6b[_0x14ba('0x33')]);_0x10dc24[_0x14ba('0x34')]=_[_0x14ba('0x32')](_0x337b6b[_0x14ba('0x2f')],qs[_0x14ba('0x35')](_0x5741ba[_0x14ba('0x33')][_0x14ba('0x35')]));_0x10dc24[_0x14ba('0x34')]=_0x10dc24[_0x14ba('0x34')][_0x14ba('0x36')]?_0x10dc24[_0x14ba('0x34')]:_0x337b6b[_0x14ba('0x2f')];if(!_0x5741ba[_0x14ba('0x33')][_0x14ba('0x37')](_0x14ba('0x38'))){_0x10dc24['limit']=qs[_0x14ba('0x1b')](_0x5741ba[_0x14ba('0x33')]['limit']);_0x10dc24['offset']=qs[_0x14ba('0x1a')](_0x5741ba['query'][_0x14ba('0x1a')]);}_0x10dc24[_0x14ba('0x39')]=qs[_0x14ba('0x3a')](_0x5741ba[_0x14ba('0x33')]['sort']);_0x10dc24[_0x14ba('0x3b')]=qs[_0x14ba('0x3c')](_[_0x14ba('0x3d')](_0x5741ba['query'],_0x337b6b[_0x14ba('0x3c')]));if(_0x5741ba[_0x14ba('0x33')][_0x14ba('0x3e')]){_0x10dc24['where']=_[_0x14ba('0x3f')](_0x10dc24[_0x14ba('0x3b')],{'$or':_['map'](_0x5cc181,function(_0x26ccc0){if(_0x26ccc0['type']!==_0x14ba('0x40')){var _0x7106cb={};_0x7106cb[_0x26ccc0[_0x14ba('0x29')]]={'$like':'%'+_0x5741ba['query'][_0x14ba('0x3e')]+'%'};return _0x7106cb;}})});}_0x10dc24=_[_0x14ba('0x3f')]({},_0x10dc24,_0x5741ba[_0x14ba('0x41')]);var _0x403bc2={'where':_0x10dc24[_0x14ba('0x3b')]};return db[_0x14ba('0x42')]['count'](_0x403bc2)[_0x14ba('0x22')](function(_0x296286){_0x3d666a[_0x14ba('0x19')]=_0x296286;if(_0x5741ba[_0x14ba('0x33')][_0x14ba('0x43')]){_0x10dc24['include']=[{'all':!![]}];}return db[_0x14ba('0x42')]['findAll'](_0x10dc24);})[_0x14ba('0x22')](function(_0x1811d1){_0x3d666a[_0x14ba('0x44')]=_0x1811d1;return _0x3d666a;})[_0x14ba('0x22')](respondWithFilteredResult(_0x8714ce,_0x10dc24))[_0x14ba('0x45')](handleError(_0x8714ce,null));};exports[_0x14ba('0x46')]=function(_0x167f25,_0x308706){var _0x43ee35={'raw':!![],'where':{'id':_0x167f25[_0x14ba('0x47')]['id']}},_0x4ff493={};_0x4ff493[_0x14ba('0x2f')]=_['keys'](db[_0x14ba('0x42')][_0x14ba('0x2b')]);_0x4ff493['query']=_[_0x14ba('0x31')](_0x167f25['query']);_0x4ff493['filters']=_[_0x14ba('0x32')](_0x4ff493[_0x14ba('0x2f')],_0x4ff493[_0x14ba('0x33')]);_0x43ee35[_0x14ba('0x34')]=_[_0x14ba('0x32')](_0x4ff493[_0x14ba('0x2f')],qs[_0x14ba('0x35')](_0x167f25[_0x14ba('0x33')]['fields']));_0x43ee35[_0x14ba('0x34')]=_0x43ee35['attributes'][_0x14ba('0x36')]?_0x43ee35[_0x14ba('0x34')]:_0x4ff493[_0x14ba('0x2f')];if(_0x167f25[_0x14ba('0x33')][_0x14ba('0x43')]){_0x43ee35['include']=[{'all':!![]}];}_0x43ee35=_[_0x14ba('0x3f')]({},_0x43ee35,_0x167f25[_0x14ba('0x41')]);return db[_0x14ba('0x42')][_0x14ba('0x48')](_0x43ee35)[_0x14ba('0x22')](handleEntityNotFound(_0x308706,null))[_0x14ba('0x22')](respondWithResult(_0x308706,null))[_0x14ba('0x45')](handleError(_0x308706,null));};exports['create']=function(_0x27757f,_0x58c775){return db[_0x14ba('0x42')]['create'](_0x27757f[_0x14ba('0x49')],{})['then'](function(_0x324750){var _0x358d42=_0x27757f[_0x14ba('0x4a')]['get']({'plain':!![]});if(!_0x358d42)throw new Error(_0x14ba('0x4b'));if(_0x358d42['role']===_0x14ba('0x4a')){var _0x15a307=_0x324750['get']({'plain':!![]});var _0x142df4=_0x14ba('0x24');return db[_0x14ba('0x4c')]['find']({'where':{'name':_0x142df4,'userProfileId':_0x358d42[_0x14ba('0x4d')]},'raw':!![]})[_0x14ba('0x22')](function(_0x16cc67){if(_0x16cc67&&_0x16cc67[_0x14ba('0x4e')]===0x0){return db[_0x14ba('0x25')][_0x14ba('0x4f')]({'name':_0x15a307[_0x14ba('0x29')],'resourceId':_0x15a307['id'],'type':_0x16cc67[_0x14ba('0x29')],'sectionId':_0x16cc67['id']},{})[_0x14ba('0x22')](function(){return _0x324750;});}else{return _0x324750;}})['catch'](function(_0x34a4bc){logger[_0x14ba('0x27')](_0x14ba('0x50'),_0x34a4bc);throw _0x34a4bc;});}return _0x324750;})[_0x14ba('0x22')](respondWithResult(_0x58c775,0xc9))[_0x14ba('0x45')](handleError(_0x58c775,null));};exports[_0x14ba('0x51')]=function(_0x154697,_0x3f7cb4){if(_0x154697[_0x14ba('0x49')]['id']){delete _0x154697[_0x14ba('0x49')]['id'];}return db['Variable']['find']({'where':{'id':_0x154697[_0x14ba('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f7cb4,null))[_0x14ba('0x22')](saveUpdates(_0x154697['body'],null))[_0x14ba('0x22')](respondWithResult(_0x3f7cb4,null))[_0x14ba('0x45')](handleError(_0x3f7cb4,null));};exports[_0x14ba('0x21')]=function(_0x3e5ec1,_0x533328){return db[_0x14ba('0x42')][_0x14ba('0x48')]({'where':{'id':_0x3e5ec1['params']['id']}})[_0x14ba('0x22')](handleEntityNotFound(_0x533328,null))[_0x14ba('0x22')](removeEntity(_0x533328,null))[_0x14ba('0x45')](handleError(_0x533328,null));}; \ No newline at end of file +var _0xb0b4=['merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','userProfileId','autoAssociation','params','html-pdf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Variable','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL'];(function(_0x4cd684,_0x5bd5fc){var _0x5c2dd9=function(_0x5179e6){while(--_0x5179e6){_0x4cd684['push'](_0x4cd684['shift']());}};_0x5c2dd9(++_0x5bd5fc);}(_0xb0b4,0xb6));var _0x4b0b=function(_0x24f6b8,_0x11fe6d){_0x24f6b8=_0x24f6b8-0x0;var _0x511323=_0xb0b4[_0x24f6b8];return _0x511323;};'use strict';var pdf=require(_0x4b0b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4b0b('0x1'));var jsonpatch=require(_0x4b0b('0x2'));var rp=require('request-promise');var moment=require(_0x4b0b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4b0b('0x4'));var util=require(_0x4b0b('0x5'));var path=require(_0x4b0b('0x6'));var sox=require(_0x4b0b('0x7'));var csv=require(_0x4b0b('0x8'));var ejs=require(_0x4b0b('0x9'));var fs=require('fs');var _=require(_0x4b0b('0xa'));var squel=require(_0x4b0b('0xb'));var crypto=require(_0x4b0b('0xc'));var jsforce=require(_0x4b0b('0xd'));var deskjs=require(_0x4b0b('0xe'));var toCsv=require(_0x4b0b('0x8'));var querystring=require(_0x4b0b('0xf'));var Papa=require(_0x4b0b('0x10'));var Redis=require(_0x4b0b('0x11'));var authService=require(_0x4b0b('0x12'));var qs=require(_0x4b0b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b0b('0x14'));var logger=require('../../config/logger')(_0x4b0b('0x15'));var utils=require(_0x4b0b('0x16'));var config=require('../../config/environment');var db=require(_0x4b0b('0x17'))['db'];function respondWithStatusCode(_0xaa922a,_0xc962dd){_0xc962dd=_0xc962dd||0xcc;return function(_0x1ced06){if(_0x1ced06){return _0xaa922a[_0x4b0b('0x18')](_0xc962dd);}return _0xaa922a[_0x4b0b('0x19')](_0xc962dd)['end']();};}function respondWithResult(_0x30eb05,_0x30de88){_0x30de88=_0x30de88||0xc8;return function(_0x3d8dad){if(_0x3d8dad){return _0x30eb05[_0x4b0b('0x19')](_0x30de88)[_0x4b0b('0x1a')](_0x3d8dad);}};}function respondWithFilteredResult(_0x227f96,_0x4c3f15){return function(_0x30e5c9){if(_0x30e5c9){var _0x195081=_0x30e5c9[_0x4b0b('0x1b')],_0x4ebe1f=_0x4c3f15['offset'],_0x48d117=_0x4c3f15[_0x4b0b('0x1c')]+_0x4c3f15['limit'],_0x184b96;if(_0x48d117>=_0x195081){_0x48d117=_0x195081;_0x184b96=0xc8;}else{_0x184b96=0xce;}_0x227f96['status'](_0x184b96);return _0x227f96[_0x4b0b('0x1d')]('Content-Range',_0x4ebe1f+'-'+_0x48d117+'/'+_0x195081)[_0x4b0b('0x1a')](_0x30e5c9);}return null;};}function patchUpdates(_0x1676bb){return function(_0x3f25cc){try{jsonpatch[_0x4b0b('0x1e')](_0x3f25cc,_0x1676bb,!![]);}catch(_0x5adac5){return BPromise[_0x4b0b('0x1f')](_0x5adac5);}return _0x3f25cc[_0x4b0b('0x20')]();};}function saveUpdates(_0x41ec85,_0x40f6aa){return function(_0x2df32d){if(_0x2df32d){return _0x2df32d[_0x4b0b('0x21')](_0x41ec85)[_0x4b0b('0x22')](function(_0x304e38){return _0x304e38;});}return null;};}function removeEntity(_0xdd1482,_0x660d70){return function(_0x1ee48e){if(_0x1ee48e){return _0x1ee48e[_0x4b0b('0x23')]()[_0x4b0b('0x22')](function(){var _0x36633a=_0x1ee48e[_0x4b0b('0x24')]({'plain':!![]});var _0x8fb089='Variables';return db[_0x4b0b('0x25')][_0x4b0b('0x23')]({'where':{'type':_0x8fb089,'resourceId':_0x36633a['id']}})['then'](function(){return _0x1ee48e;});})[_0x4b0b('0x22')](function(){_0xdd1482[_0x4b0b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33dd5a,_0x3d1fd3){return function(_0x4cf633){if(!_0x4cf633){_0x33dd5a[_0x4b0b('0x18')](0x194);}return _0x4cf633;};}function handleError(_0x33f3ac,_0x4be3df){_0x4be3df=_0x4be3df||0x1f4;return function(_0x450ca6){logger[_0x4b0b('0x26')](_0x450ca6[_0x4b0b('0x27')]);if(_0x450ca6[_0x4b0b('0x28')]){delete _0x450ca6[_0x4b0b('0x28')];}_0x33f3ac[_0x4b0b('0x19')](_0x4be3df)[_0x4b0b('0x29')](_0x450ca6);};}exports[_0x4b0b('0x2a')]=function(_0x4af6dc,_0x2d093c){var _0x3ea16c={},_0x46714a={},_0x25b551={'count':0x0,'rows':[]};var _0x1f1f90=_[_0x4b0b('0x2b')](db[_0x4b0b('0x2c')]['rawAttributes'],function(_0x5f3e20){return{'name':_0x5f3e20['fieldName'],'type':_0x5f3e20[_0x4b0b('0x2d')][_0x4b0b('0x2e')]};});_0x46714a['model']=_[_0x4b0b('0x2b')](_0x1f1f90,_0x4b0b('0x28'));_0x46714a[_0x4b0b('0x2f')]=_[_0x4b0b('0x30')](_0x4af6dc['query']);_0x46714a[_0x4b0b('0x31')]=_[_0x4b0b('0x32')](_0x46714a[_0x4b0b('0x33')],_0x46714a[_0x4b0b('0x2f')]);_0x3ea16c[_0x4b0b('0x34')]=_[_0x4b0b('0x32')](_0x46714a[_0x4b0b('0x33')],qs[_0x4b0b('0x35')](_0x4af6dc[_0x4b0b('0x2f')][_0x4b0b('0x35')]));_0x3ea16c[_0x4b0b('0x34')]=_0x3ea16c[_0x4b0b('0x34')]['length']?_0x3ea16c[_0x4b0b('0x34')]:_0x46714a[_0x4b0b('0x33')];if(!_0x4af6dc[_0x4b0b('0x2f')][_0x4b0b('0x36')]('nolimit')){_0x3ea16c[_0x4b0b('0x37')]=qs[_0x4b0b('0x37')](_0x4af6dc[_0x4b0b('0x2f')][_0x4b0b('0x37')]);_0x3ea16c['offset']=qs[_0x4b0b('0x1c')](_0x4af6dc['query'][_0x4b0b('0x1c')]);}_0x3ea16c[_0x4b0b('0x38')]=qs[_0x4b0b('0x39')](_0x4af6dc[_0x4b0b('0x2f')]['sort']);_0x3ea16c[_0x4b0b('0x3a')]=qs[_0x4b0b('0x31')](_['pick'](_0x4af6dc[_0x4b0b('0x2f')],_0x46714a[_0x4b0b('0x31')]));if(_0x4af6dc[_0x4b0b('0x2f')][_0x4b0b('0x3b')]){_0x3ea16c[_0x4b0b('0x3a')]=_['merge'](_0x3ea16c[_0x4b0b('0x3a')],{'$or':_[_0x4b0b('0x2b')](_0x1f1f90,function(_0x127764){if(_0x127764['type']!==_0x4b0b('0x3c')){var _0x352e35={};_0x352e35[_0x127764['name']]={'$like':'%'+_0x4af6dc[_0x4b0b('0x2f')][_0x4b0b('0x3b')]+'%'};return _0x352e35;}})});}_0x3ea16c=_[_0x4b0b('0x3d')]({},_0x3ea16c,_0x4af6dc[_0x4b0b('0x3e')]);var _0x95d604={'where':_0x3ea16c[_0x4b0b('0x3a')]};return db['Variable'][_0x4b0b('0x1b')](_0x95d604)['then'](function(_0x5791b1){_0x25b551['count']=_0x5791b1;if(_0x4af6dc[_0x4b0b('0x2f')][_0x4b0b('0x3f')]){_0x3ea16c[_0x4b0b('0x40')]=[{'all':!![]}];}return db[_0x4b0b('0x2c')][_0x4b0b('0x41')](_0x3ea16c);})[_0x4b0b('0x22')](function(_0x2a1f23){_0x25b551[_0x4b0b('0x42')]=_0x2a1f23;return _0x25b551;})[_0x4b0b('0x22')](respondWithFilteredResult(_0x2d093c,_0x3ea16c))[_0x4b0b('0x43')](handleError(_0x2d093c,null));};exports[_0x4b0b('0x44')]=function(_0x348722,_0x460b52){var _0x2b63dd={'raw':!![],'where':{'id':_0x348722['params']['id']}},_0xa859a7={};_0xa859a7['model']=_[_0x4b0b('0x30')](db[_0x4b0b('0x2c')][_0x4b0b('0x45')]);_0xa859a7[_0x4b0b('0x2f')]=_['keys'](_0x348722[_0x4b0b('0x2f')]);_0xa859a7[_0x4b0b('0x31')]=_[_0x4b0b('0x32')](_0xa859a7['model'],_0xa859a7[_0x4b0b('0x2f')]);_0x2b63dd[_0x4b0b('0x34')]=_[_0x4b0b('0x32')](_0xa859a7[_0x4b0b('0x33')],qs[_0x4b0b('0x35')](_0x348722['query'][_0x4b0b('0x35')]));_0x2b63dd[_0x4b0b('0x34')]=_0x2b63dd[_0x4b0b('0x34')][_0x4b0b('0x46')]?_0x2b63dd['attributes']:_0xa859a7[_0x4b0b('0x33')];if(_0x348722[_0x4b0b('0x2f')][_0x4b0b('0x3f')]){_0x2b63dd['include']=[{'all':!![]}];}_0x2b63dd=_[_0x4b0b('0x3d')]({},_0x2b63dd,_0x348722[_0x4b0b('0x3e')]);return db[_0x4b0b('0x2c')][_0x4b0b('0x47')](_0x2b63dd)[_0x4b0b('0x22')](handleEntityNotFound(_0x460b52,null))['then'](respondWithResult(_0x460b52,null))[_0x4b0b('0x43')](handleError(_0x460b52,null));};exports[_0x4b0b('0x48')]=function(_0x13799a,_0x5ee8a8){return db[_0x4b0b('0x2c')][_0x4b0b('0x48')](_0x13799a[_0x4b0b('0x49')],{})[_0x4b0b('0x22')](function(_0x8b7f6b){var _0x5ad447=_0x13799a[_0x4b0b('0x4a')][_0x4b0b('0x24')]({'plain':!![]});if(!_0x5ad447)throw new Error(_0x4b0b('0x4b'));if(_0x5ad447['role']===_0x4b0b('0x4a')){var _0x468f3e=_0x8b7f6b[_0x4b0b('0x24')]({'plain':!![]});var _0x356dd1=_0x4b0b('0x4c');return db[_0x4b0b('0x4d')][_0x4b0b('0x47')]({'where':{'name':_0x356dd1,'userProfileId':_0x5ad447[_0x4b0b('0x4e')]},'raw':!![]})[_0x4b0b('0x22')](function(_0x2d6b6a){if(_0x2d6b6a&&_0x2d6b6a[_0x4b0b('0x4f')]===0x0){return db[_0x4b0b('0x25')][_0x4b0b('0x48')]({'name':_0x468f3e[_0x4b0b('0x28')],'resourceId':_0x468f3e['id'],'type':_0x2d6b6a[_0x4b0b('0x28')],'sectionId':_0x2d6b6a['id']},{})[_0x4b0b('0x22')](function(){return _0x8b7f6b;});}else{return _0x8b7f6b;}})[_0x4b0b('0x43')](function(_0x3ccb8b){logger[_0x4b0b('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ccb8b);throw _0x3ccb8b;});}return _0x8b7f6b;})[_0x4b0b('0x22')](respondWithResult(_0x5ee8a8,0xc9))[_0x4b0b('0x43')](handleError(_0x5ee8a8,null));};exports['update']=function(_0x5d091f,_0x5e7ddd){if(_0x5d091f['body']['id']){delete _0x5d091f[_0x4b0b('0x49')]['id'];}return db[_0x4b0b('0x2c')][_0x4b0b('0x47')]({'where':{'id':_0x5d091f[_0x4b0b('0x50')]['id']}})['then'](handleEntityNotFound(_0x5e7ddd,null))[_0x4b0b('0x22')](saveUpdates(_0x5d091f[_0x4b0b('0x49')],null))[_0x4b0b('0x22')](respondWithResult(_0x5e7ddd,null))[_0x4b0b('0x43')](handleError(_0x5e7ddd,null));};exports['destroy']=function(_0x354255,_0x40a0bb){return db[_0x4b0b('0x2c')][_0x4b0b('0x47')]({'where':{'id':_0x354255['params']['id']}})[_0x4b0b('0x22')](handleEntityNotFound(_0x40a0bb,null))[_0x4b0b('0x22')](removeEntity(_0x40a0bb,null))[_0x4b0b('0x43')](handleError(_0x40a0bb,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ba96c44..5116f80 100644 --- a/server/api/variable/variable.model.js +++ b/server/api/variable/variable.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8a8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util'];(function(_0x356a4d,_0x55bac2){var _0x33940f=function(_0xe8a205){while(--_0xe8a205){_0x356a4d['push'](_0x356a4d['shift']());}};_0x33940f(++_0x55bac2);}(_0xa8a8,0xec));var _0x8a8a=function(_0x23693f,_0xa75e01){_0x23693f=_0x23693f-0x0;var _0x45b390=_0xa8a8[_0x23693f];return _0x45b390;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1948=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables'];(function(_0xa90e10,_0x377ff7){var _0xe61724=function(_0x3695b4){while(--_0x3695b4){_0xa90e10['push'](_0xa90e10['shift']());}};_0xe61724(++_0x377ff7);}(_0x1948,0x145));var _0x8194=function(_0x52a454,_0x5476f6){_0x52a454=_0x52a454-0x0;var _0x547723=_0x1948[_0x52a454];return _0x547723;};'use strict';var _=require(_0x8194('0x0'));var util=require(_0x8194('0x1'));var logger=require(_0x8194('0x2'))(_0x8194('0x3'));var moment=require(_0x8194('0x4'));var BPromise=require('bluebird');var rp=require(_0x8194('0x5'));var fs=require('fs');var path=require(_0x8194('0x6'));var rimraf=require(_0x8194('0x7'));var config=require(_0x8194('0x8'));var attributes=require(_0x8194('0x9'));module[_0x8194('0xa')]=function(_0x2a3372,_0x23f556){return _0x2a3372['define'](_0x8194('0xb'),attributes,{'tableName':_0x8194('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 2b04227..3239d4c 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcd2=['find','options','raw','where','attributes','include','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','Variable'];(function(_0x5a6e32,_0x573b46){var _0x168e07=function(_0x427e62){while(--_0x427e62){_0x5a6e32['push'](_0x5a6e32['shift']());}};_0x168e07(++_0x573b46);}(_0xfcd2,0x180));var _0x2fcd=function(_0x2e4e2a,_0x176038){_0x2e4e2a=_0x2e4e2a-0x0;var _0xb173f6=_0xfcd2[_0x2e4e2a];return _0xb173f6;};'use strict';var _=require(_0x2fcd('0x0'));var util=require(_0x2fcd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fcd('0x2'));var db=require(_0x2fcd('0x3'))['db'];var utils=require(_0x2fcd('0x4'));var logger=require(_0x2fcd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2fcd('0x6'));var client=jayson[_0x2fcd('0x7')][_0x2fcd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x464968,_0x4ca9e2,_0x47aa97){return new BPromise(function(_0x434d74,_0x499410){return client['request'](_0x464968,_0x47aa97)[_0x2fcd('0x9')](function(_0x4a9071){logger[_0x2fcd('0xa')](_0x2fcd('0xb'),_0x4ca9e2,_0x2fcd('0xc'));logger['debug'](_0x2fcd('0xd'),_0x4ca9e2,'request\x20sent',JSON[_0x2fcd('0xe')](_0x4a9071));if(_0x4a9071[_0x2fcd('0xf')]){if(_0x4a9071[_0x2fcd('0xf')][_0x2fcd('0x10')]===0x1f4){logger[_0x2fcd('0xf')](_0x2fcd('0xb'),_0x4ca9e2,_0x4a9071[_0x2fcd('0xf')][_0x2fcd('0x11')]);return _0x499410(_0x4a9071['error']['message']);}logger['error']('Variable,\x20%s,\x20%s',_0x4ca9e2,_0x4a9071[_0x2fcd('0xf')][_0x2fcd('0x11')]);return _0x434d74(_0x4a9071[_0x2fcd('0xf')]['message']);}else{logger[_0x2fcd('0xa')](_0x2fcd('0xb'),_0x4ca9e2,_0x2fcd('0xc'));_0x434d74(_0x4a9071[_0x2fcd('0x12')][_0x2fcd('0x11')]);}})[_0x2fcd('0x13')](function(_0x36cf83){logger['error']('Variable,\x20%s,\x20%s',_0x4ca9e2,_0x36cf83);_0x499410(_0x36cf83);});});}exports[_0x2fcd('0x14')]=function(_0x4fb58c){var _0xf6901b=this;return new Promise(function(_0x11def1,_0x18bf12){return db[_0x2fcd('0x15')][_0x2fcd('0x16')]({'raw':_0x4fb58c[_0x2fcd('0x17')]?_0x4fb58c[_0x2fcd('0x17')][_0x2fcd('0x18')]===undefined?!![]:![]:!![],'where':_0x4fb58c[_0x2fcd('0x17')]?_0x4fb58c[_0x2fcd('0x17')][_0x2fcd('0x19')]||null:null,'attributes':_0x4fb58c[_0x2fcd('0x17')]?_0x4fb58c['options'][_0x2fcd('0x1a')]||null:null,'include':_0x4fb58c['options']?_0x4fb58c[_0x2fcd('0x17')][_0x2fcd('0x1b')]?_[_0x2fcd('0x1c')](_0x4fb58c[_0x2fcd('0x17')][_0x2fcd('0x1b')],function(_0x291fe7){return{'model':db[_0x291fe7['model']],'as':_0x291fe7['as'],'attributes':_0x291fe7[_0x2fcd('0x1a')],'include':_0x291fe7['include']?_[_0x2fcd('0x1c')](_0x291fe7['include'],function(_0x35c174){return{'model':db[_0x35c174['model']],'as':_0x35c174['as'],'attributes':_0x35c174[_0x2fcd('0x1a')],'include':_0x35c174[_0x2fcd('0x1b')]?_[_0x2fcd('0x1c')](_0x35c174[_0x2fcd('0x1b')],function(_0x5c6e65){return{'model':db[_0x5c6e65['model']],'as':_0x5c6e65['as'],'attributes':_0x5c6e65[_0x2fcd('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x245fce){logger[_0x2fcd('0xa')](_0x2fcd('0x14'),_0x4fb58c);logger['debug'](_0x2fcd('0x14'),_0x4fb58c,JSON[_0x2fcd('0xe')](_0x245fce));_0x11def1(_0x245fce);})[_0x2fcd('0x13')](function(_0x5673cb){logger[_0x2fcd('0xf')]('ShowVariable',_0x5673cb[_0x2fcd('0x11')],_0x4fb58c);_0x18bf12(_0xf6901b['error'](0x1f4,_0x5673cb[_0x2fcd('0x11')]));});});}; \ No newline at end of file +var _0xc771=['model','map','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','include'];(function(_0x63086e,_0x3bd3a0){var _0x2909d5=function(_0x42ab78){while(--_0x42ab78){_0x63086e['push'](_0x63086e['shift']());}};_0x2909d5(++_0x3bd3a0);}(_0xc771,0x12e));var _0x1c77=function(_0x1cd2f7,_0xd344a8){_0x1cd2f7=_0x1cd2f7-0x0;var _0x48accb=_0xc771[_0x1cd2f7];return _0x48accb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1c77('0x0'));var BPromise=require(_0x1c77('0x1'));var rs=require(_0x1c77('0x2'));var fs=require('fs');var Redis=require(_0x1c77('0x3'));var db=require(_0x1c77('0x4'))['db'];var utils=require(_0x1c77('0x5'));var logger=require(_0x1c77('0x6'))(_0x1c77('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c77('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x420d90,_0x137c88,_0x5d99b4){return new BPromise(function(_0x3d6d97,_0x2ef071){return client[_0x1c77('0x9')](_0x420d90,_0x5d99b4)[_0x1c77('0xa')](function(_0x5505a7){logger[_0x1c77('0xb')](_0x1c77('0xc'),_0x137c88,_0x1c77('0xd'));logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x137c88,'request\x20sent',JSON[_0x1c77('0xe')](_0x5505a7));if(_0x5505a7[_0x1c77('0xf')]){if(_0x5505a7[_0x1c77('0xf')][_0x1c77('0x10')]===0x1f4){logger[_0x1c77('0xf')](_0x1c77('0xc'),_0x137c88,_0x5505a7[_0x1c77('0xf')][_0x1c77('0x11')]);return _0x2ef071(_0x5505a7[_0x1c77('0xf')][_0x1c77('0x11')]);}logger['error'](_0x1c77('0xc'),_0x137c88,_0x5505a7[_0x1c77('0xf')]['message']);return _0x3d6d97(_0x5505a7[_0x1c77('0xf')][_0x1c77('0x11')]);}else{logger[_0x1c77('0xb')]('Variable,\x20%s,\x20%s',_0x137c88,_0x1c77('0xd'));_0x3d6d97(_0x5505a7[_0x1c77('0x12')][_0x1c77('0x11')]);}})[_0x1c77('0x13')](function(_0x5720c9){logger[_0x1c77('0xf')](_0x1c77('0xc'),_0x137c88,_0x5720c9);_0x2ef071(_0x5720c9);});});}exports[_0x1c77('0x14')]=function(_0x2b904b){var _0x4e063b=this;return new Promise(function(_0x2c5172,_0x48e6b8){return db[_0x1c77('0x15')][_0x1c77('0x16')]({'raw':_0x2b904b[_0x1c77('0x17')]?_0x2b904b[_0x1c77('0x17')][_0x1c77('0x18')]===undefined?!![]:![]:!![],'where':_0x2b904b['options']?_0x2b904b[_0x1c77('0x17')][_0x1c77('0x19')]||null:null,'attributes':_0x2b904b['options']?_0x2b904b[_0x1c77('0x17')][_0x1c77('0x1a')]||null:null,'include':_0x2b904b[_0x1c77('0x17')]?_0x2b904b[_0x1c77('0x17')]['include']?_['map'](_0x2b904b[_0x1c77('0x17')][_0x1c77('0x1b')],function(_0x18987a){return{'model':db[_0x18987a[_0x1c77('0x1c')]],'as':_0x18987a['as'],'attributes':_0x18987a[_0x1c77('0x1a')],'include':_0x18987a[_0x1c77('0x1b')]?_[_0x1c77('0x1d')](_0x18987a[_0x1c77('0x1b')],function(_0x400ac5){return{'model':db[_0x400ac5['model']],'as':_0x400ac5['as'],'attributes':_0x400ac5[_0x1c77('0x1a')],'include':_0x400ac5['include']?_[_0x1c77('0x1d')](_0x400ac5['include'],function(_0x549bde){return{'model':db[_0x549bde[_0x1c77('0x1c')]],'as':_0x549bde['as'],'attributes':_0x549bde[_0x1c77('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1c77('0xa')](function(_0x236ac6){logger[_0x1c77('0xb')](_0x1c77('0x14'),_0x2b904b);logger['debug'](_0x1c77('0x14'),_0x2b904b,JSON[_0x1c77('0xe')](_0x236ac6));_0x2c5172(_0x236ac6);})[_0x1c77('0x13')](function(_0x38575a){logger[_0x1c77('0xf')]('ShowVariable',_0x38575a['message'],_0x2b904b);_0x48e6b8(_0x4e063b[_0x1c77('0xf')](0x1f4,_0x38575a['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 8895f0a..c30e968 100644 --- a/server/api/version/index.js +++ b/server/api/version/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd41=['fetch','reset','/pull','pull','/restart','/migrations','exports','Router','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated','canUpdate'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xcd41,0x142));var _0x1cd4=function(_0x35f8a1,_0x1da5e9){_0x35f8a1=_0x35f8a1-0x0;var _0x3ea167=_0xcd41[_0x35f8a1];return _0x3ea167;};'use strict';var express=require('express');var router=express[_0x1cd4('0x0')]();var auth=require(_0x1cd4('0x1'));var controller=require(_0x1cd4('0x2'));router['get']('/',controller[_0x1cd4('0x3')]);router[_0x1cd4('0x4')](_0x1cd4('0x5'),auth[_0x1cd4('0x6')](),auth[_0x1cd4('0x7')](),controller[_0x1cd4('0x8')]);router[_0x1cd4('0x4')]('/reset',auth[_0x1cd4('0x6')](),auth[_0x1cd4('0x7')](),controller[_0x1cd4('0x9')]);router['get'](_0x1cd4('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x1cd4('0xb')]);router[_0x1cd4('0x4')](_0x1cd4('0xc'),auth['isAuthenticated'](),controller['restart']);router[_0x1cd4('0x4')](_0x1cd4('0xd'),controller['migrations']);module[_0x1cd4('0xe')]=router; \ No newline at end of file +var _0xaeff=['exports','express','Router','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull','restart','/migrations','migrations'];(function(_0x78fca,_0x273c69){var _0x517bfd=function(_0x15bfa4){while(--_0x15bfa4){_0x78fca['push'](_0x78fca['shift']());}};_0x517bfd(++_0x273c69);}(_0xaeff,0x88));var _0xfaef=function(_0x5b0e8c,_0xaf239a){_0x5b0e8c=_0x5b0e8c-0x0;var _0x571ea2=_0xaeff[_0x5b0e8c];return _0x571ea2;};'use strict';var express=require(_0xfaef('0x0'));var router=express[_0xfaef('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xfaef('0x2')]('/',controller[_0xfaef('0x3')]);router['get'](_0xfaef('0x4'),auth[_0xfaef('0x5')](),auth[_0xfaef('0x6')](),controller['fetch']);router[_0xfaef('0x2')](_0xfaef('0x7'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfaef('0x8')]);router['get'](_0xfaef('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfaef('0xa')]);router['get']('/restart',auth[_0xfaef('0x5')](),controller[_0xfaef('0xb')]);router[_0xfaef('0x2')](_0xfaef('0xc'),controller[_0xfaef('0xd')]);module[_0xfaef('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 4b38784..71e9bdb 100644 --- a/server/api/version/version.controller.js +++ b/server/api/version/version.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x414f=['constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','index','version','query','latest','fetch','tags','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','migrations','replace','exports','push','length','sort','Migration','sequelize','getQueryInterface'];(function(_0x266d38,_0x3305d9){var _0x1c5b72=function(_0x1f6555){while(--_0x1f6555){_0x266d38['push'](_0x266d38['shift']());}};_0x1c5b72(++_0x3305d9);}(_0x414f,0x13f));var _0xf414=function(_0x29c2bb,_0x1bde54){_0x29c2bb=_0x29c2bb-0x0;var _0x5446f1=_0x414f[_0x29c2bb];return _0x5446f1;};'use strict';var Umzug=require(_0xf414('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xf414('0x1'));var pkginfo=require(_0xf414('0x2'))(module,'version');var compareVersions=require(_0xf414('0x3'));var exec=require(_0xf414('0x4'))[_0xf414('0x5')];var db=require(_0xf414('0x6'))['db'];var config=require(_0xf414('0x7'));var pm2=require(_0xf414('0x8'));var logger=require(_0xf414('0x9'))('update');var git=require(_0xf414('0xa'))(config['root']);exports[_0xf414('0xb')]=function(_0x2306e5,_0xad732){var _0x5194e5={'current':module['exports'][_0xf414('0xc')],'phonebar':0x2};if(_0x2306e5[_0xf414('0xd')]&&_0x2306e5[_0xf414('0xd')][_0xf414('0xe')]){return git[_0xf414('0xf')]()[_0xf414('0x10')](function(_0x192c0a,_0x37edf9){_0x5194e5['latest']=(_0x192c0a?module['exports'][_0xf414('0xc')]:_0x37edf9[_0xf414('0xe')])||_0xf414('0x11');return _0xad732[_0xf414('0x12')](0xc8)[_0xf414('0x13')](_0x5194e5);});}else{return _0xad732['status'](0xc8)[_0xf414('0x13')](_0x5194e5);}};exports[_0xf414('0xf')]=function(_0x3ca9e7,_0x46d679){return git[_0xf414('0xf')](['origin',_0xf414('0x14')],function(_0x107a83){if(_0x107a83){logger[_0xf414('0x15')](_0x107a83);return _0x46d679[_0xf414('0x12')](0x1f4)[_0xf414('0x13')](_0x107a83);}logger[_0xf414('0x16')](_0xf414('0x17'));return _0x46d679[_0xf414('0x12')](0xc8)['json']({'output':_0xf414('0x18')});});};exports[_0xf414('0x19')]=function(_0x400210,_0x32e970){return git[_0xf414('0x19')](['--hard',_0xf414('0x1a')],function(_0x4b813f){if(_0x4b813f){logger['error'](_0x4b813f);return _0x32e970[_0xf414('0x12')](0x1f4)[_0xf414('0x13')](_0x4b813f);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x32e970['status'](0xc8)[_0xf414('0x13')]({'output':_0xf414('0x1b')});});};exports[_0xf414('0x1c')]=function(_0x417af1,_0x367227){exec(_0xf414('0x1d'),function(_0x3bbbe8,_0x1e116c,_0x1dbfa9){logger['info'](_0x1e116c);logger[_0xf414('0x16')](_0x1dbfa9);if(_0x3bbbe8){logger[_0xf414('0x15')](_0x3bbbe8);return _0x367227[_0xf414('0x12')](0x1f4)['json'](_0x3bbbe8);}return _0x367227[_0xf414('0x12')](0xc8)[_0xf414('0x13')]({'output':_0x1e116c});});};exports[_0xf414('0x1e')]=function(_0x40e93e,_0x473685){return pm2[_0xf414('0x1e')](_0xf414('0x1f'))[_0xf414('0x20')](function(_0x5378ca){logger[_0xf414('0x16')]('pm2\x20restart\x20motion\x20%s',_0x5378ca);return _0x473685['status'](0xc8)[_0xf414('0x13')]({'output':_0xf414('0x21')});})[_0xf414('0x22')](function(_0x3e443d){logger[_0xf414('0x15')](_0x3e443d);return _0x473685[_0xf414('0x12')](0x1f4)['json'](_0x3e443d);});};exports['migrations']=function(_0x306a1c,_0x25b40f){var _0x209790=fs['readdirSync'](path[_0xf414('0x23')](config['root'],'server',_0xf414('0x24')));var _0x8cf16c=[];for(var _0x388c24=0x0;_0x388c24<_0x209790['length'];_0x388c24++){var _0x578019=_0x209790[_0x388c24][_0xf414('0x25')]('.js','');if(compareVersions(module[_0xf414('0x26')][_0xf414('0xc')],_0x578019)===-0x1){_0x8cf16c[_0xf414('0x27')](_0x578019);}}if(_0x8cf16c[_0xf414('0x28')]){var _0x5e66c0=_0x8cf16c[_0xf414('0x29')](compareVersions);var _0x5d934c=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xf414('0x2a')],'modelName':_0xf414('0x2a'),'columnName':_0xf414('0xc')},'migrations':{'params':[db[_0xf414('0x2b')][_0xf414('0x2c')](),db[_0xf414('0x2b')][_0xf414('0x2d')],function(){throw new Error(_0xf414('0x2e'));}],'path':path['join'](config['root'],_0xf414('0x2f'),_0xf414('0x24')),'pattern':/\.js$/}});_0x5d934c['up']({'migrations':_[_0xf414('0x30')](_0x5e66c0,function(_0x5264c9){return _0x5264c9+'.js';})})[_0xf414('0x20')](function(){return _0x25b40f['status'](0xc8)[_0xf414('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xf414('0x26')][_0xf414('0xc')]+'\x20to\x20'+_[_0xf414('0x31')](_0x5e66c0),'migrations':_[_0xf414('0x23')](_0x5e66c0)});})[_0xf414('0x22')](function(_0x5ac36c){if(_0x5ac36c instanceof db[_0xf414('0x2b')][_0xf414('0x32')]){return _0x25b40f[_0xf414('0x12')](0xc8)[_0xf414('0x13')]({'output':_0xf414('0x33')});}else{return _0x25b40f[_0xf414('0x12')](0x1f4)['json'](_0x5ac36c);}});}else{return _0x25b40f[_0xf414('0x12')](0xc8)[_0xf414('0x13')]({'output':_0xf414('0x33')});}}; \ No newline at end of file +var _0x57ca=['.js','\x20to\x20','last','Database\x20already\x20up-to-date','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','fetch','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','server','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','map'];(function(_0x41a96e,_0x36bf41){var _0x2b7b54=function(_0x65f3f0){while(--_0x65f3f0){_0x41a96e['push'](_0x41a96e['shift']());}};_0x2b7b54(++_0x36bf41);}(_0x57ca,0x108));var _0xa57c=function(_0xa48e45,_0x3eab73){_0xa48e45=_0xa48e45-0x0;var _0x30c9b3=_0x57ca[_0xa48e45];return _0x30c9b3;};'use strict';var Umzug=require('umzug');var path=require(_0xa57c('0x0'));var fs=require('fs');var _=require(_0xa57c('0x1'));var pkginfo=require('pkginfo')(module,_0xa57c('0x2'));var compareVersions=require(_0xa57c('0x3'));var exec=require(_0xa57c('0x4'))[_0xa57c('0x5')];var db=require(_0xa57c('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xa57c('0x7'));var logger=require(_0xa57c('0x8'))(_0xa57c('0x9'));var git=require(_0xa57c('0xa'))(config[_0xa57c('0xb')]);exports[_0xa57c('0xc')]=function(_0x19e28e,_0x271ccc){var _0x5e3962={'current':module[_0xa57c('0xd')]['version'],'phonebar':0x2};if(_0x19e28e[_0xa57c('0xe')]&&_0x19e28e[_0xa57c('0xe')]['latest']){return git[_0xa57c('0xf')]()['tags'](function(_0x554101,_0x44b221){_0x5e3962['latest']=(_0x554101?module[_0xa57c('0xd')]['version']:_0x44b221[_0xa57c('0x10')])||_0xa57c('0x11');return _0x271ccc[_0xa57c('0x12')](0xc8)[_0xa57c('0x13')](_0x5e3962);});}else{return _0x271ccc[_0xa57c('0x12')](0xc8)['json'](_0x5e3962);}};exports[_0xa57c('0xf')]=function(_0x546cde,_0x30d23d){return git[_0xa57c('0xf')]([_0xa57c('0x14'),_0xa57c('0x15')],function(_0x3238ff){if(_0x3238ff){logger[_0xa57c('0x16')](_0x3238ff);return _0x30d23d[_0xa57c('0x12')](0x1f4)['json'](_0x3238ff);}logger[_0xa57c('0x17')](_0xa57c('0x18'));return _0x30d23d[_0xa57c('0x12')](0xc8)['json']({'output':_0xa57c('0x19')});});};exports['reset']=function(_0x3e7afa,_0x3d781d){return git[_0xa57c('0x1a')]([_0xa57c('0x1b'),_0xa57c('0x1c')],function(_0x4728f9){if(_0x4728f9){logger[_0xa57c('0x16')](_0x4728f9);return _0x3d781d[_0xa57c('0x12')](0x1f4)['json'](_0x4728f9);}logger[_0xa57c('0x17')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x3d781d['status'](0xc8)[_0xa57c('0x13')]({'output':_0xa57c('0x1d')});});};exports[_0xa57c('0x1e')]=function(_0x23bec0,_0x49242c){exec(_0xa57c('0x1f'),function(_0x25715f,_0x34d1bc,_0x2213b2){logger[_0xa57c('0x17')](_0x34d1bc);logger[_0xa57c('0x17')](_0x2213b2);if(_0x25715f){logger[_0xa57c('0x16')](_0x25715f);return _0x49242c[_0xa57c('0x12')](0x1f4)[_0xa57c('0x13')](_0x25715f);}return _0x49242c[_0xa57c('0x12')](0xc8)[_0xa57c('0x13')]({'output':_0x34d1bc});});};exports[_0xa57c('0x20')]=function(_0x241dcc,_0x10a33d){return pm2[_0xa57c('0x20')]('motion2')[_0xa57c('0x21')](function(_0x5226d0){logger[_0xa57c('0x17')](_0xa57c('0x22'),_0x5226d0);return _0x10a33d[_0xa57c('0x12')](0xc8)[_0xa57c('0x13')]({'output':_0xa57c('0x23')});})[_0xa57c('0x24')](function(_0x337f97){logger[_0xa57c('0x16')](_0x337f97);return _0x10a33d['status'](0x1f4)[_0xa57c('0x13')](_0x337f97);});};exports['migrations']=function(_0x54a18b,_0x257661){var _0x7d10ec=fs['readdirSync'](path[_0xa57c('0x25')](config[_0xa57c('0xb')],_0xa57c('0x26'),'migrations'));var _0xd779f1=[];for(var _0x58d46f=0x0;_0x58d46f<_0x7d10ec[_0xa57c('0x27')];_0x58d46f++){var _0x5464f2=_0x7d10ec[_0x58d46f][_0xa57c('0x28')]('.js','');if(compareVersions(module[_0xa57c('0xd')]['version'],_0x5464f2)===-0x1){_0xd779f1[_0xa57c('0x29')](_0x5464f2);}}if(_0xd779f1[_0xa57c('0x27')]){var _0x43c8f3=_0xd779f1[_0xa57c('0x2a')](compareVersions);var _0xfd0f66=new Umzug({'storage':_0xa57c('0x2b'),'storageOptions':{'model':db[_0xa57c('0x2c')],'modelName':'Migration','columnName':_0xa57c('0x2')},'migrations':{'params':[db['sequelize'][_0xa57c('0x2d')](),db[_0xa57c('0x2b')][_0xa57c('0x2e')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xa57c('0x25')](config['root'],_0xa57c('0x26'),'migrations'),'pattern':/\.js$/}});_0xfd0f66['up']({'migrations':_[_0xa57c('0x2f')](_0x43c8f3,function(_0x494b8a){return _0x494b8a+_0xa57c('0x30');})})[_0xa57c('0x21')](function(){return _0x257661['status'](0xc8)[_0xa57c('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xa57c('0xd')]['version']+_0xa57c('0x31')+_[_0xa57c('0x32')](_0x43c8f3),'migrations':_[_0xa57c('0x25')](_0x43c8f3)});})[_0xa57c('0x24')](function(_0x2c224c){if(_0x2c224c instanceof db[_0xa57c('0x2b')]['UniqueConstraintError']){return _0x257661['status'](0xc8)[_0xa57c('0x13')]({'output':_0xa57c('0x33')});}else{return _0x257661[_0xa57c('0x12')](0x1f4)['json'](_0x2c224c);}});}else{return _0x257661[_0xa57c('0x12')](0xc8)['json']({'output':_0xa57c('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index b7d7a32..1be28a2 100644 --- a/server/api/voiceAgentReport/index.js +++ b/server/api/voiceAgentReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f60=['../../config/environment','/describe','describe','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x95bf62,_0x2c483c){var _0x529b1e=function(_0x2dcf94){while(--_0x2dcf94){_0x95bf62['push'](_0x95bf62['shift']());}};_0x529b1e(++_0x2c483c);}(_0x3f60,0xad));var _0x03f6=function(_0x47604d,_0x15a014){_0x47604d=_0x47604d-0x0;var _0x388e4c=_0x3f60[_0x47604d];return _0x388e4c;};'use strict';var multer=require('multer');var util=require(_0x03f6('0x0'));var path=require(_0x03f6('0x1'));var timeout=require(_0x03f6('0x2'));var express=require(_0x03f6('0x3'));var router=express[_0x03f6('0x4')]();var auth=require(_0x03f6('0x5'));var interaction=require(_0x03f6('0x6'));var config=require(_0x03f6('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x03f6('0x8'),auth['isAuthenticated'](),controller[_0x03f6('0x9')]);router[_0x03f6('0xa')]('/:id',auth[_0x03f6('0xb')](),controller[_0x03f6('0xc')]);router[_0x03f6('0xd')]('/',auth[_0x03f6('0xb')](),controller[_0x03f6('0xe')]);router['put'](_0x03f6('0xf'),auth[_0x03f6('0xb')](),controller[_0x03f6('0x10')]);router[_0x03f6('0x11')](_0x03f6('0xf'),auth[_0x03f6('0xb')](),controller[_0x03f6('0x12')]);module[_0x03f6('0x13')]=router; \ No newline at end of file +var _0xd605=['create','put','destroy','exports','util','path','express','Router','../../components/auth/service','./voiceAgentReport.controller','isAuthenticated','get','/describe','describe','/:id','post'];(function(_0x3a20b2,_0x2f3309){var _0x44f850=function(_0x3e115b){while(--_0x3e115b){_0x3a20b2['push'](_0x3a20b2['shift']());}};_0x44f850(++_0x2f3309);}(_0xd605,0xd4));var _0x5d60=function(_0x126d2d,_0x11e5ff){_0x126d2d=_0x126d2d-0x0;var _0x329769=_0xd605[_0x126d2d];return _0x329769;};'use strict';var multer=require('multer');var util=require(_0x5d60('0x0'));var path=require(_0x5d60('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d60('0x2'));var router=express[_0x5d60('0x3')]();var auth=require(_0x5d60('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5d60('0x5'));router['get']('/',auth[_0x5d60('0x6')](),controller['index']);router[_0x5d60('0x7')](_0x5d60('0x8'),auth[_0x5d60('0x6')](),controller[_0x5d60('0x9')]);router['get'](_0x5d60('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x5d60('0xb')]('/',auth['isAuthenticated'](),controller[_0x5d60('0xc')]);router[_0x5d60('0xd')](_0x5d60('0xa'),auth[_0x5d60('0x6')](),controller['update']);router['delete'](_0x5d60('0xa'),auth['isAuthenticated'](),controller[_0x5d60('0xe')]);module[_0x5d60('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 079a376..8245aa6 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x5c151d,_0x5c603b){var _0x53e0fc=function(_0x3602fd){while(--_0x3602fd){_0x5c151d['push'](_0x5c151d['shift']());}};_0x53e0fc(++_0x5c603b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x5fc3[_0x3b2244];return _0x2dcc14;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x35fc('0x2')]},'calleridnum':{'type':Sequelize[_0x35fc('0x2')]},'calleridname':{'type':Sequelize[_0x35fc('0x2')]},'queue':{'type':Sequelize[_0x35fc('0x2')]},'interface':{'type':Sequelize[_0x35fc('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x35fc('0x3')]},'agentconnectAt':{'type':Sequelize[_0x35fc('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x35fc('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x35fc('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x35fc('0x4')]},'agentacw':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x35fc('0x4')]},'reason':{'type':Sequelize[_0x35fc('0x2')]},'lastevent':{'type':Sequelize[_0x35fc('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x35fc('0x4')]},'channelstatedesc':{'type':Sequelize[_0x35fc('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x35fc('0x2')]},'language':{'type':Sequelize[_0x35fc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x35fc('0x2')]},'exten':{'type':Sequelize[_0x35fc('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x35fc('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x35fc('0x2')]},'destcalleridname':{'type':Sequelize[_0x35fc('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x35fc('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x35fc('0x2')]},'destlanguage':{'type':Sequelize[_0x35fc('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x35fc('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x35fc('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x35fc('0x2')]},'transfer':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x35fc('0x2')],'comment':_0x35fc('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x35fc('0x2')]},'agententerreason':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2675=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x5869ba,_0x437aee){var _0x16651b=function(_0x4dcea7){while(--_0x4dcea7){_0x5869ba['push'](_0x5869ba['shift']());}};_0x16651b(++_0x437aee);}(_0x2675,0x75));var _0x5267=function(_0x3fe661,_0x13f35f){_0x3fe661=_0x3fe661-0x0;var _0x12fed5=_0x2675[_0x3fe661];return _0x12fed5;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5267('0x1')]},'calleridname':{'type':Sequelize[_0x5267('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5267('0x1')]},'membername':{'type':Sequelize[_0x5267('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x5267('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x5267('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x5267('0x2')]},'agentdumpAt':{'type':Sequelize[_0x5267('0x2')]},'holdtime':{'type':Sequelize[_0x5267('0x3')]},'agentcomplete':{'type':Sequelize[_0x5267('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5267('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5267('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5267('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x5267('0x1')]},'channel':{'type':Sequelize[_0x5267('0x1')]},'channelstate':{'type':Sequelize[_0x5267('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5267('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5267('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5267('0x1')]},'exten':{'type':Sequelize[_0x5267('0x1')]},'priority':{'type':Sequelize[_0x5267('0x1')]},'destchannel':{'type':Sequelize[_0x5267('0x1')]},'destchannelstate':{'type':Sequelize[_0x5267('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5267('0x1')]},'destcalleridnum':{'type':Sequelize[_0x5267('0x1')]},'destcalleridname':{'type':Sequelize[_0x5267('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x5267('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x5267('0x1')]},'destlanguage':{'type':Sequelize[_0x5267('0x1')]},'destaccountcode':{'type':Sequelize[_0x5267('0x1')]},'destcontext':{'type':Sequelize[_0x5267('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x5267('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x5267('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x5267('0x1')]},'transfer':{'type':Sequelize[_0x5267('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5267('0x1')],'comment':_0x5267('0x5')},'transferexten':{'type':Sequelize[_0x5267('0x1')]},'transferuniqueid':{'type':Sequelize[_0x5267('0x1')]},'agententerreason':{'type':Sequelize[_0x5267('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 6c05a6b..d05ac99 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ed7=['../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','VoiceAgentReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','create','body','find','catch','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2d7905,_0x9af3eb){var _0x12aac4=function(_0x50e233){while(--_0x50e233){_0x2d7905['push'](_0x2d7905['shift']());}};_0x12aac4(++_0x9af3eb);}(_0x2ed7,0x7a));var _0x72ed=function(_0x56cf8e,_0x3aef99){_0x56cf8e=_0x56cf8e-0x0;var _0x1dfdbd=_0x2ed7[_0x56cf8e];return _0x1dfdbd;};'use strict';var pdf=require(_0x72ed('0x0'));var emlformat=require(_0x72ed('0x1'));var rimraf=require(_0x72ed('0x2'));var zipdir=require(_0x72ed('0x3'));var jsonpatch=require(_0x72ed('0x4'));var rp=require('request-promise');var moment=require(_0x72ed('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x72ed('0x6'));var util=require('util');var path=require(_0x72ed('0x7'));var sox=require(_0x72ed('0x8'));var csv=require(_0x72ed('0x9'));var ejs=require(_0x72ed('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x72ed('0xb'));var deskjs=require(_0x72ed('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x72ed('0xd'));var Redis=require(_0x72ed('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x72ed('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x72ed('0x10'))(_0x72ed('0x11'));var utils=require(_0x72ed('0x12'));var config=require(_0x72ed('0x13'));var db=require(_0x72ed('0x14'))['db'];function respondWithStatusCode(_0x2ef746,_0x5d1666){_0x5d1666=_0x5d1666||0xcc;return function(_0x4c1079){if(_0x4c1079){return _0x2ef746['sendStatus'](_0x5d1666);}return _0x2ef746['status'](_0x5d1666)[_0x72ed('0x15')]();};}function respondWithResult(_0x49ad77,_0x4a067a){_0x4a067a=_0x4a067a||0xc8;return function(_0x39181a){if(_0x39181a){return _0x49ad77[_0x72ed('0x16')](_0x4a067a)[_0x72ed('0x17')](_0x39181a);}};}function respondWithFilteredResult(_0x16f41b,_0x74a978){return function(_0x372d57){if(_0x372d57){var _0x246603=_0x372d57[_0x72ed('0x18')],_0xdf91e2=_0x74a978[_0x72ed('0x19')],_0x36dfba=_0x74a978[_0x72ed('0x19')]+_0x74a978[_0x72ed('0x1a')],_0xf57b65;if(_0x36dfba>=_0x246603){_0x36dfba=_0x246603;_0xf57b65=0xc8;}else{_0xf57b65=0xce;}_0x16f41b[_0x72ed('0x16')](_0xf57b65);return _0x16f41b[_0x72ed('0x1b')](_0x72ed('0x1c'),_0xdf91e2+'-'+_0x36dfba+'/'+_0x246603)[_0x72ed('0x17')](_0x372d57);}return null;};}function patchUpdates(_0x491e1e){return function(_0x110a60){try{jsonpatch[_0x72ed('0x1d')](_0x110a60,_0x491e1e,!![]);}catch(_0x52e94a){return BPromise['reject'](_0x52e94a);}return _0x110a60[_0x72ed('0x1e')]();};}function saveUpdates(_0x515239,_0x37a9da){return function(_0x2c3c09){if(_0x2c3c09){return _0x2c3c09[_0x72ed('0x1f')](_0x515239)[_0x72ed('0x20')](function(_0x28cbee){return _0x28cbee;});}return null;};}function removeEntity(_0x137fe2,_0x4eb7b8){return function(_0x1c5d16){if(_0x1c5d16){return _0x1c5d16[_0x72ed('0x21')]()[_0x72ed('0x20')](function(){_0x137fe2[_0x72ed('0x16')](0xcc)[_0x72ed('0x15')]();});}};}function handleEntityNotFound(_0x5d52a4,_0x43916e){return function(_0x3402a0){if(!_0x3402a0){_0x5d52a4[_0x72ed('0x22')](0x194);}return _0x3402a0;};}function handleError(_0xb1ace7,_0x2b1cae){_0x2b1cae=_0x2b1cae||0x1f4;return function(_0xe756ff){logger[_0x72ed('0x23')](_0xe756ff['stack']);if(_0xe756ff[_0x72ed('0x24')]){delete _0xe756ff[_0x72ed('0x24')];}_0xb1ace7[_0x72ed('0x16')](_0x2b1cae)[_0x72ed('0x25')](_0xe756ff);};}exports[_0x72ed('0x26')]=function(_0x2248bb,_0x5d01ad){var _0x492748={},_0x819d8a={},_0x26e577={'count':0x0,'rows':[]};var _0xa8cb04=_[_0x72ed('0x27')](db[_0x72ed('0x28')][_0x72ed('0x29')],function(_0xd3435a){return{'name':_0xd3435a[_0x72ed('0x2a')],'type':_0xd3435a[_0x72ed('0x2b')]['key']};});_0x819d8a[_0x72ed('0x2c')]=_['map'](_0xa8cb04,'name');_0x819d8a[_0x72ed('0x2d')]=_[_0x72ed('0x2e')](_0x2248bb[_0x72ed('0x2d')]);_0x819d8a['filters']=_[_0x72ed('0x2f')](_0x819d8a[_0x72ed('0x2c')],_0x819d8a['query']);_0x492748['attributes']=_['intersection'](_0x819d8a[_0x72ed('0x2c')],qs[_0x72ed('0x30')](_0x2248bb['query'][_0x72ed('0x30')]));_0x492748[_0x72ed('0x31')]=_0x492748[_0x72ed('0x31')][_0x72ed('0x32')]?_0x492748[_0x72ed('0x31')]:_0x819d8a[_0x72ed('0x2c')];if(!_0x2248bb[_0x72ed('0x2d')]['hasOwnProperty'](_0x72ed('0x33'))){_0x492748[_0x72ed('0x1a')]=qs[_0x72ed('0x1a')](_0x2248bb[_0x72ed('0x2d')][_0x72ed('0x1a')]);_0x492748[_0x72ed('0x19')]=qs[_0x72ed('0x19')](_0x2248bb[_0x72ed('0x2d')]['offset']);}_0x492748[_0x72ed('0x34')]=qs[_0x72ed('0x35')](_0x2248bb['query'][_0x72ed('0x35')]);_0x492748[_0x72ed('0x36')]=qs[_0x72ed('0x37')](_[_0x72ed('0x38')](_0x2248bb[_0x72ed('0x2d')],_0x819d8a[_0x72ed('0x37')]));if(_0x2248bb[_0x72ed('0x2d')][_0x72ed('0x39')]){_0x492748[_0x72ed('0x36')]=_[_0x72ed('0x3a')](_0x492748[_0x72ed('0x36')],{'$or':_[_0x72ed('0x27')](_0xa8cb04,function(_0x188989){if(_0x188989[_0x72ed('0x2b')]!=='VIRTUAL'){var _0x16302c={};_0x16302c[_0x188989[_0x72ed('0x24')]]={'$like':'%'+_0x2248bb[_0x72ed('0x2d')][_0x72ed('0x39')]+'%'};return _0x16302c;}})});}_0x492748=_[_0x72ed('0x3a')]({},_0x492748,_0x2248bb[_0x72ed('0x3b')]);var _0x517d83={'where':_0x492748[_0x72ed('0x36')]};return db[_0x72ed('0x28')][_0x72ed('0x18')](_0x517d83)[_0x72ed('0x20')](function(_0x23db0b){_0x26e577[_0x72ed('0x18')]=_0x23db0b;if(_0x2248bb[_0x72ed('0x2d')][_0x72ed('0x3c')]){_0x492748[_0x72ed('0x3d')]=[{'all':!![]}];}return db[_0x72ed('0x28')][_0x72ed('0x3e')](_0x492748);})[_0x72ed('0x20')](function(_0x330947){_0x26e577[_0x72ed('0x3f')]=_0x330947;return _0x26e577;})['then'](respondWithFilteredResult(_0x5d01ad,_0x492748))['catch'](handleError(_0x5d01ad,null));};exports[_0x72ed('0x40')]=function(_0x113690,_0x13cac6){var _0x496b62={'raw':![],'where':{'id':_0x113690[_0x72ed('0x41')]['id']}},_0x310094={};_0x310094[_0x72ed('0x2c')]=_[_0x72ed('0x2e')](db['VoiceAgentReport'][_0x72ed('0x29')]);_0x310094[_0x72ed('0x2d')]=_[_0x72ed('0x2e')](_0x113690[_0x72ed('0x2d')]);_0x310094[_0x72ed('0x37')]=_[_0x72ed('0x2f')](_0x310094['model'],_0x310094['query']);_0x496b62[_0x72ed('0x31')]=_[_0x72ed('0x2f')](_0x310094[_0x72ed('0x2c')],qs[_0x72ed('0x30')](_0x113690['query'][_0x72ed('0x30')]));_0x496b62[_0x72ed('0x31')]=_0x496b62[_0x72ed('0x31')][_0x72ed('0x32')]?_0x496b62[_0x72ed('0x31')]:_0x310094[_0x72ed('0x2c')];if(_0x113690[_0x72ed('0x2d')][_0x72ed('0x3c')]){_0x496b62[_0x72ed('0x3d')]=[{'all':!![]}];}_0x496b62=_[_0x72ed('0x3a')]({},_0x496b62,_0x113690['options']);return db['VoiceAgentReport']['find'](_0x496b62)[_0x72ed('0x20')](handleEntityNotFound(_0x13cac6,null))['then'](respondWithResult(_0x13cac6,null))['catch'](handleError(_0x13cac6,null));};exports[_0x72ed('0x42')]=function(_0x4fecb7,_0x43802c){return db[_0x72ed('0x28')][_0x72ed('0x42')](_0x4fecb7[_0x72ed('0x43')],{})[_0x72ed('0x20')](respondWithResult(_0x43802c,0xc9))['catch'](handleError(_0x43802c,null));};exports['update']=function(_0x440ac3,_0x3dd6a9){if(_0x440ac3[_0x72ed('0x43')]['id']){delete _0x440ac3[_0x72ed('0x43')]['id'];}return db['VoiceAgentReport'][_0x72ed('0x44')]({'where':{'id':_0x440ac3[_0x72ed('0x41')]['id']}})[_0x72ed('0x20')](handleEntityNotFound(_0x3dd6a9,null))[_0x72ed('0x20')](saveUpdates(_0x440ac3['body'],null))[_0x72ed('0x20')](respondWithResult(_0x3dd6a9,null))[_0x72ed('0x45')](handleError(_0x3dd6a9,null));};exports[_0x72ed('0x21')]=function(_0x377c81,_0x417270){return db[_0x72ed('0x28')][_0x72ed('0x44')]({'where':{'id':_0x377c81[_0x72ed('0x41')]['id']}})[_0x72ed('0x20')](handleEntityNotFound(_0x417270,null))[_0x72ed('0x20')](removeEntity(_0x417270,null))[_0x72ed('0x45')](handleError(_0x417270,null));};exports[_0x72ed('0x46')]=function(_0x2f9dc8,_0x109ae1){return db['VoiceAgentReport'][_0x72ed('0x46')]()[_0x72ed('0x20')](respondWithResult(_0x109ae1,null))[_0x72ed('0x45')](handleError(_0x109ae1,null));}; \ No newline at end of file +var _0x5ad9=['api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','VoiceAgentReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x429f2f,_0x8c7732){var _0x105d17=function(_0x109253){while(--_0x109253){_0x429f2f['push'](_0x429f2f['shift']());}};_0x105d17(++_0x8c7732);}(_0x5ad9,0x196));var _0x95ad=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5ad9[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0x95ad('0x0'));var emlformat=require(_0x95ad('0x1'));var rimraf=require(_0x95ad('0x2'));var zipdir=require(_0x95ad('0x3'));var jsonpatch=require(_0x95ad('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95ad('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x95ad('0x6'));var csv=require('to-csv');var ejs=require(_0x95ad('0x7'));var fs=require('fs');var _=require(_0x95ad('0x8'));var squel=require('squel');var crypto=require(_0x95ad('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x95ad('0xa'));var toCsv=require(_0x95ad('0xb'));var querystring=require(_0x95ad('0xc'));var Papa=require(_0x95ad('0xd'));var Redis=require(_0x95ad('0xe'));var authService=require(_0x95ad('0xf'));var qs=require(_0x95ad('0x10'));var as=require(_0x95ad('0x11'));var hardwareService=require(_0x95ad('0x12'));var logger=require(_0x95ad('0x13'))(_0x95ad('0x14'));var utils=require(_0x95ad('0x15'));var config=require('../../config/environment');var db=require(_0x95ad('0x16'))['db'];function respondWithStatusCode(_0x4b8ada,_0x5a6ab6){_0x5a6ab6=_0x5a6ab6||0xcc;return function(_0x39c29c){if(_0x39c29c){return _0x4b8ada[_0x95ad('0x17')](_0x5a6ab6);}return _0x4b8ada[_0x95ad('0x18')](_0x5a6ab6)[_0x95ad('0x19')]();};}function respondWithResult(_0xe4a4ba,_0x23fdc9){_0x23fdc9=_0x23fdc9||0xc8;return function(_0x1c86bb){if(_0x1c86bb){return _0xe4a4ba[_0x95ad('0x18')](_0x23fdc9)['json'](_0x1c86bb);}};}function respondWithFilteredResult(_0x37f2de,_0x3dfad8){return function(_0x44457e){if(_0x44457e){var _0x2d32dd=_0x44457e[_0x95ad('0x1a')],_0xea4dcf=_0x3dfad8[_0x95ad('0x1b')],_0x12edf8=_0x3dfad8[_0x95ad('0x1b')]+_0x3dfad8[_0x95ad('0x1c')],_0x19849e;if(_0x12edf8>=_0x2d32dd){_0x12edf8=_0x2d32dd;_0x19849e=0xc8;}else{_0x19849e=0xce;}_0x37f2de[_0x95ad('0x18')](_0x19849e);return _0x37f2de[_0x95ad('0x1d')](_0x95ad('0x1e'),_0xea4dcf+'-'+_0x12edf8+'/'+_0x2d32dd)[_0x95ad('0x1f')](_0x44457e);}return null;};}function patchUpdates(_0x227a46){return function(_0x358154){try{jsonpatch[_0x95ad('0x20')](_0x358154,_0x227a46,!![]);}catch(_0x41593b){return BPromise[_0x95ad('0x21')](_0x41593b);}return _0x358154[_0x95ad('0x22')]();};}function saveUpdates(_0x11dd94,_0x142f7f){return function(_0x1ab82b){if(_0x1ab82b){return _0x1ab82b[_0x95ad('0x23')](_0x11dd94)[_0x95ad('0x24')](function(_0x6c7136){return _0x6c7136;});}return null;};}function removeEntity(_0x3d00ac,_0x4c2f16){return function(_0x25bbba){if(_0x25bbba){return _0x25bbba[_0x95ad('0x25')]()[_0x95ad('0x24')](function(){_0x3d00ac[_0x95ad('0x18')](0xcc)[_0x95ad('0x19')]();});}};}function handleEntityNotFound(_0x5f145a,_0x116db7){return function(_0x42bec2){if(!_0x42bec2){_0x5f145a[_0x95ad('0x17')](0x194);}return _0x42bec2;};}function handleError(_0x4c0027,_0x47540d){_0x47540d=_0x47540d||0x1f4;return function(_0x2a40c9){logger['error'](_0x2a40c9[_0x95ad('0x26')]);if(_0x2a40c9['name']){delete _0x2a40c9[_0x95ad('0x27')];}_0x4c0027[_0x95ad('0x18')](_0x47540d)['send'](_0x2a40c9);};}exports['index']=function(_0xe819e5,_0x22b874){var _0x2eb228={},_0x32adae={},_0x1d0c27={'count':0x0,'rows':[]};var _0x47bfbe=_[_0x95ad('0x28')](db[_0x95ad('0x29')][_0x95ad('0x2a')],function(_0x3b2fc0){return{'name':_0x3b2fc0[_0x95ad('0x2b')],'type':_0x3b2fc0['type'][_0x95ad('0x2c')]};});_0x32adae[_0x95ad('0x2d')]=_[_0x95ad('0x28')](_0x47bfbe,'name');_0x32adae[_0x95ad('0x2e')]=_[_0x95ad('0x2f')](_0xe819e5[_0x95ad('0x2e')]);_0x32adae[_0x95ad('0x30')]=_[_0x95ad('0x31')](_0x32adae[_0x95ad('0x2d')],_0x32adae['query']);_0x2eb228[_0x95ad('0x32')]=_['intersection'](_0x32adae['model'],qs['fields'](_0xe819e5['query'][_0x95ad('0x33')]));_0x2eb228[_0x95ad('0x32')]=_0x2eb228['attributes'][_0x95ad('0x34')]?_0x2eb228[_0x95ad('0x32')]:_0x32adae[_0x95ad('0x2d')];if(!_0xe819e5[_0x95ad('0x2e')][_0x95ad('0x35')](_0x95ad('0x36'))){_0x2eb228['limit']=qs[_0x95ad('0x1c')](_0xe819e5[_0x95ad('0x2e')][_0x95ad('0x1c')]);_0x2eb228['offset']=qs[_0x95ad('0x1b')](_0xe819e5[_0x95ad('0x2e')][_0x95ad('0x1b')]);}_0x2eb228['order']=qs[_0x95ad('0x37')](_0xe819e5[_0x95ad('0x2e')][_0x95ad('0x37')]);_0x2eb228[_0x95ad('0x38')]=qs[_0x95ad('0x30')](_[_0x95ad('0x39')](_0xe819e5[_0x95ad('0x2e')],_0x32adae[_0x95ad('0x30')]));if(_0xe819e5[_0x95ad('0x2e')]['filter']){_0x2eb228[_0x95ad('0x38')]=_[_0x95ad('0x3a')](_0x2eb228[_0x95ad('0x38')],{'$or':_[_0x95ad('0x28')](_0x47bfbe,function(_0x5ef9a3){if(_0x5ef9a3[_0x95ad('0x3b')]!=='VIRTUAL'){var _0x32c322={};_0x32c322[_0x5ef9a3[_0x95ad('0x27')]]={'$like':'%'+_0xe819e5[_0x95ad('0x2e')]['filter']+'%'};return _0x32c322;}})});}_0x2eb228=_[_0x95ad('0x3a')]({},_0x2eb228,_0xe819e5[_0x95ad('0x3c')]);var _0x5ca351={'where':_0x2eb228[_0x95ad('0x38')]};return db[_0x95ad('0x29')]['count'](_0x5ca351)[_0x95ad('0x24')](function(_0x1c83ad){_0x1d0c27['count']=_0x1c83ad;if(_0xe819e5[_0x95ad('0x2e')][_0x95ad('0x3d')]){_0x2eb228['include']=[{'all':!![]}];}return db[_0x95ad('0x29')][_0x95ad('0x3e')](_0x2eb228);})[_0x95ad('0x24')](function(_0x49d5c9){_0x1d0c27['rows']=_0x49d5c9;return _0x1d0c27;})['then'](respondWithFilteredResult(_0x22b874,_0x2eb228))[_0x95ad('0x3f')](handleError(_0x22b874,null));};exports[_0x95ad('0x40')]=function(_0x465e36,_0x45816f){var _0x277432={'raw':![],'where':{'id':_0x465e36[_0x95ad('0x41')]['id']}},_0x4b046c={};_0x4b046c[_0x95ad('0x2d')]=_[_0x95ad('0x2f')](db[_0x95ad('0x29')]['rawAttributes']);_0x4b046c['query']=_[_0x95ad('0x2f')](_0x465e36['query']);_0x4b046c[_0x95ad('0x30')]=_[_0x95ad('0x31')](_0x4b046c[_0x95ad('0x2d')],_0x4b046c[_0x95ad('0x2e')]);_0x277432['attributes']=_[_0x95ad('0x31')](_0x4b046c[_0x95ad('0x2d')],qs[_0x95ad('0x33')](_0x465e36[_0x95ad('0x2e')]['fields']));_0x277432[_0x95ad('0x32')]=_0x277432[_0x95ad('0x32')][_0x95ad('0x34')]?_0x277432[_0x95ad('0x32')]:_0x4b046c[_0x95ad('0x2d')];if(_0x465e36[_0x95ad('0x2e')][_0x95ad('0x3d')]){_0x277432[_0x95ad('0x42')]=[{'all':!![]}];}_0x277432=_[_0x95ad('0x3a')]({},_0x277432,_0x465e36[_0x95ad('0x3c')]);return db[_0x95ad('0x29')][_0x95ad('0x43')](_0x277432)[_0x95ad('0x24')](handleEntityNotFound(_0x45816f,null))['then'](respondWithResult(_0x45816f,null))['catch'](handleError(_0x45816f,null));};exports[_0x95ad('0x44')]=function(_0x578c0d,_0x23c776){return db[_0x95ad('0x29')][_0x95ad('0x44')](_0x578c0d[_0x95ad('0x45')],{})['then'](respondWithResult(_0x23c776,0xc9))[_0x95ad('0x3f')](handleError(_0x23c776,null));};exports[_0x95ad('0x23')]=function(_0x249c77,_0x312182){if(_0x249c77[_0x95ad('0x45')]['id']){delete _0x249c77[_0x95ad('0x45')]['id'];}return db[_0x95ad('0x29')]['find']({'where':{'id':_0x249c77['params']['id']}})[_0x95ad('0x24')](handleEntityNotFound(_0x312182,null))[_0x95ad('0x24')](saveUpdates(_0x249c77[_0x95ad('0x45')],null))[_0x95ad('0x24')](respondWithResult(_0x312182,null))[_0x95ad('0x3f')](handleError(_0x312182,null));};exports[_0x95ad('0x25')]=function(_0x927ff1,_0x1c499b){return db[_0x95ad('0x29')][_0x95ad('0x43')]({'where':{'id':_0x927ff1[_0x95ad('0x41')]['id']}})[_0x95ad('0x24')](handleEntityNotFound(_0x1c499b,null))[_0x95ad('0x24')](removeEntity(_0x1c499b,null))[_0x95ad('0x3f')](handleError(_0x1c499b,null));};exports[_0x95ad('0x46')]=function(_0x255ecf,_0x458e5d){return db[_0x95ad('0x29')]['describe']()[_0x95ad('0x24')](respondWithResult(_0x458e5d,null))['catch'](handleError(_0x458e5d,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 1982870..74ecea8 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.model.js +++ b/server/api/voiceAgentReport/voiceAgentReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f0a=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util'];(function(_0x14d7c2,_0x1c32c6){var _0x3faacf=function(_0x196b30){while(--_0x196b30){_0x14d7c2['push'](_0x14d7c2['shift']());}};_0x3faacf(++_0x1c32c6);}(_0x9f0a,0x9b));var _0xa9f0=function(_0x3cba7f,_0x2595df){_0x3cba7f=_0x3cba7f-0x0;var _0x55ed0d=_0x9f0a[_0x3cba7f];return _0x55ed0d;};'use strict';var _=require('lodash');var util=require(_0xa9f0('0x0'));var logger=require(_0xa9f0('0x1'))('api');var moment=require(_0xa9f0('0x2'));var BPromise=require(_0xa9f0('0x3'));var rp=require(_0xa9f0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9f0('0x5'));var config=require(_0xa9f0('0x6'));var attributes=require(_0xa9f0('0x7'));module['exports']=function(_0x4e5e14,_0x188d3c){return _0x4e5e14[_0xa9f0('0x8')](_0xa9f0('0x9'),attributes,{'tableName':_0xa9f0('0xa'),'paranoid':![],'indexes':[{'fields':[_0xa9f0('0xb'),_0xa9f0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2364=['destuniqueid','../../config/logger','api','bluebird','path','./voiceAgentReport.attributes','define','report_agent','uniqueid'];(function(_0x2972d8,_0x248bb0){var _0x1bf426=function(_0x46b300){while(--_0x46b300){_0x2972d8['push'](_0x2972d8['shift']());}};_0x1bf426(++_0x248bb0);}(_0x2364,0x169));var _0x4236=function(_0x9b9b8c,_0x553069){_0x9b9b8c=_0x9b9b8c-0x0;var _0x3e554a=_0x2364[_0x9b9b8c];return _0x3e554a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4236('0x0'))(_0x4236('0x1'));var moment=require('moment');var BPromise=require(_0x4236('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4236('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4236('0x4'));module['exports']=function(_0xe2c636,_0x5a403e){return _0xe2c636[_0x4236('0x5')]('VoiceAgentReport',attributes,{'tableName':_0x4236('0x6'),'paranoid':![],'indexes':[{'fields':[_0x4236('0x7'),_0x4236('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 6f14566..dfbf762 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88a9=['message','result','VoiceAgentReport','create','options','raw','then','debug','CreateVoiceAgentReport','catch','UpdateVoiceAgentReport','body','where','attributes','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x350b79,_0x6d7182){var _0x395e4=function(_0x552c20){while(--_0x552c20){_0x350b79['push'](_0x350b79['shift']());}};_0x395e4(++_0x6d7182);}(_0x88a9,0x9f));var _0x988a=function(_0x50f7e7,_0x3ab60e){_0x50f7e7=_0x50f7e7-0x0;var _0x28d054=_0x88a9[_0x50f7e7];return _0x28d054;};'use strict';var _=require('lodash');var util=require(_0x988a('0x0'));var moment=require(_0x988a('0x1'));var BPromise=require('bluebird');var rs=require(_0x988a('0x2'));var fs=require('fs');var Redis=require(_0x988a('0x3'));var db=require(_0x988a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x988a('0x5'))(_0x988a('0x6'));var config=require(_0x988a('0x7'));var jayson=require(_0x988a('0x8'));var client=jayson[_0x988a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1853a4,_0x5dcc08,_0x503407){return new BPromise(function(_0x3573d6,_0x46963d){return client['request'](_0x1853a4,_0x503407)['then'](function(_0x164681){logger[_0x988a('0xa')](_0x988a('0xb'),_0x5dcc08,_0x988a('0xc'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x5dcc08,_0x988a('0xc'),JSON[_0x988a('0xd')](_0x164681));if(_0x164681[_0x988a('0xe')]){if(_0x164681[_0x988a('0xe')]['code']===0x1f4){logger[_0x988a('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x5dcc08,_0x164681[_0x988a('0xe')][_0x988a('0xf')]);return _0x46963d(_0x164681[_0x988a('0xe')]['message']);}logger[_0x988a('0xe')](_0x988a('0xb'),_0x5dcc08,_0x164681['error']['message']);return _0x3573d6(_0x164681[_0x988a('0xe')]['message']);}else{logger[_0x988a('0xa')](_0x988a('0xb'),_0x5dcc08,_0x988a('0xc'));_0x3573d6(_0x164681[_0x988a('0x10')]['message']);}})['catch'](function(_0x443588){logger[_0x988a('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x5dcc08,_0x443588);_0x46963d(_0x443588);});});}exports['CreateVoiceAgentReport']=function(_0x2bc483){var _0x188c15=this;return new Promise(function(_0x394c99,_0x41fd54){return db[_0x988a('0x11')][_0x988a('0x12')](_0x2bc483['body'],{'raw':_0x2bc483[_0x988a('0x13')]?_0x2bc483[_0x988a('0x13')][_0x988a('0x14')]===undefined?!![]:![]:!![]})[_0x988a('0x15')](function(_0x479115){logger[_0x988a('0xa')]('CreateVoiceAgentReport',_0x2bc483);logger[_0x988a('0x16')](_0x988a('0x17'),_0x2bc483,JSON['stringify'](_0x479115));_0x394c99(_0x479115);})[_0x988a('0x18')](function(_0x3de140){logger['error'](_0x988a('0x17'),_0x3de140[_0x988a('0xf')],_0x2bc483);_0x41fd54(_0x188c15[_0x988a('0xe')](0x1f4,_0x3de140[_0x988a('0xf')]));});});};exports[_0x988a('0x19')]=function(_0x2f541b){var _0x1fa261=this;return new Promise(function(_0x4fe0f7,_0x384465){return db[_0x988a('0x11')]['update'](_0x2f541b[_0x988a('0x1a')],{'raw':_0x2f541b['options']?_0x2f541b['options'][_0x988a('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f541b['options']?_0x2f541b[_0x988a('0x13')][_0x988a('0x1b')]||null:null,'attributes':_0x2f541b[_0x988a('0x13')]?_0x2f541b[_0x988a('0x13')][_0x988a('0x1c')]||null:null,'limit':_0x2f541b[_0x988a('0x13')]?_0x2f541b['options']['limit']||null:null})['then'](function(_0x469e31){logger[_0x988a('0xa')]('UpdateVoiceAgentReport',_0x2f541b);logger[_0x988a('0x16')](_0x988a('0x19'),_0x2f541b,JSON[_0x988a('0xd')](_0x469e31));_0x4fe0f7(_0x469e31);})['catch'](function(_0x5518c1){logger[_0x988a('0xe')]('UpdateVoiceAgentReport',_0x5518c1[_0x988a('0xf')],_0x2f541b);_0x384465(_0x1fa261[_0x988a('0xe')](0x1f4,_0x5518c1[_0x988a('0xf')]));});});}; \ No newline at end of file +var _0x206f=['update','body','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','VoiceAgentReport'];(function(_0x39a5c0,_0x168549){var _0x42405e=function(_0x30ee0b){while(--_0x30ee0b){_0x39a5c0['push'](_0x39a5c0['shift']());}};_0x42405e(++_0x168549);}(_0x206f,0x64));var _0xf206=function(_0x5444f7,_0xa8e023){_0x5444f7=_0x5444f7-0x0;var _0xfef522=_0x206f[_0x5444f7];return _0xfef522;};'use strict';var _=require('lodash');var util=require(_0xf206('0x0'));var moment=require(_0xf206('0x1'));var BPromise=require(_0xf206('0x2'));var rs=require(_0xf206('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf206('0x4'))['db'];var utils=require(_0xf206('0x5'));var logger=require(_0xf206('0x6'))(_0xf206('0x7'));var config=require('../../config/environment');var jayson=require(_0xf206('0x8'));var client=jayson[_0xf206('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1af882,_0x52ab22,_0x54da12){return new BPromise(function(_0x2d9fe6,_0x368854){return client[_0xf206('0xa')](_0x1af882,_0x54da12)[_0xf206('0xb')](function(_0x2a4465){logger[_0xf206('0xc')](_0xf206('0xd'),_0x52ab22,_0xf206('0xe'));logger[_0xf206('0xf')](_0xf206('0x10'),_0x52ab22,_0xf206('0xe'),JSON[_0xf206('0x11')](_0x2a4465));if(_0x2a4465[_0xf206('0x12')]){if(_0x2a4465['error'][_0xf206('0x13')]===0x1f4){logger['error'](_0xf206('0xd'),_0x52ab22,_0x2a4465[_0xf206('0x12')]['message']);return _0x368854(_0x2a4465[_0xf206('0x12')][_0xf206('0x14')]);}logger[_0xf206('0x12')](_0xf206('0xd'),_0x52ab22,_0x2a4465['error']['message']);return _0x2d9fe6(_0x2a4465[_0xf206('0x12')][_0xf206('0x14')]);}else{logger['info'](_0xf206('0xd'),_0x52ab22,'request\x20sent');_0x2d9fe6(_0x2a4465[_0xf206('0x15')]['message']);}})[_0xf206('0x16')](function(_0x24032a){logger[_0xf206('0x12')](_0xf206('0xd'),_0x52ab22,_0x24032a);_0x368854(_0x24032a);});});}exports['CreateVoiceAgentReport']=function(_0x31d3ce){var _0x2657cc=this;return new Promise(function(_0x47720e,_0x99acac){return db['VoiceAgentReport']['create'](_0x31d3ce['body'],{'raw':_0x31d3ce[_0xf206('0x17')]?_0x31d3ce['options'][_0xf206('0x18')]===undefined?!![]:![]:!![]})[_0xf206('0xb')](function(_0x4acb81){logger['info'](_0xf206('0x19'),_0x31d3ce);logger['debug'](_0xf206('0x19'),_0x31d3ce,JSON['stringify'](_0x4acb81));_0x47720e(_0x4acb81);})[_0xf206('0x16')](function(_0x2f89c0){logger[_0xf206('0x12')](_0xf206('0x19'),_0x2f89c0[_0xf206('0x14')],_0x31d3ce);_0x99acac(_0x2657cc[_0xf206('0x12')](0x1f4,_0x2f89c0[_0xf206('0x14')]));});});};exports[_0xf206('0x1a')]=function(_0x43216b){var _0x1d8586=this;return new Promise(function(_0x3e398b,_0x129ea9){return db[_0xf206('0x1b')][_0xf206('0x1c')](_0x43216b[_0xf206('0x1d')],{'raw':_0x43216b[_0xf206('0x17')]?_0x43216b[_0xf206('0x17')][_0xf206('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43216b['options']?_0x43216b['options']['where']||null:null,'attributes':_0x43216b['options']?_0x43216b['options'][_0xf206('0x1e')]||null:null,'limit':_0x43216b[_0xf206('0x17')]?_0x43216b[_0xf206('0x17')][_0xf206('0x1f')]||null:null})[_0xf206('0xb')](function(_0x1630a2){logger[_0xf206('0xc')](_0xf206('0x1a'),_0x43216b);logger[_0xf206('0xf')]('UpdateVoiceAgentReport',_0x43216b,JSON[_0xf206('0x11')](_0x1630a2));_0x3e398b(_0x1630a2);})['catch'](function(_0x22b6c7){logger[_0xf206('0x12')](_0xf206('0x1a'),_0x22b6c7['message'],_0x43216b);_0x129ea9(_0x1d8586[_0xf206('0x12')](0x1f4,_0x22b6c7[_0xf206('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 2c97561..522de50 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02b4=['delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update'];(function(_0xe56dfa,_0x5aecb5){var _0x49999e=function(_0x3c2e5c){while(--_0x3c2e5c){_0xe56dfa['push'](_0xe56dfa['shift']());}};_0x49999e(++_0x5aecb5);}(_0x02b4,0x1a7));var _0x402b=function(_0x10d1ec,_0x2904a4){_0x10d1ec=_0x10d1ec-0x0;var _0x5f39c4=_0x02b4[_0x10d1ec];return _0x5f39c4;};'use strict';var multer=require('multer');var util=require(_0x402b('0x0'));var path=require('path');var timeout=require(_0x402b('0x1'));var express=require(_0x402b('0x2'));var router=express[_0x402b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x402b('0x4'));var config=require('../../config/environment');var controller=require(_0x402b('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x402b('0x6')]);router[_0x402b('0x7')](_0x402b('0x8'),auth['isAuthenticated'](),controller[_0x402b('0x9')]);router[_0x402b('0x7')](_0x402b('0xa'),auth[_0x402b('0xb')](),controller[_0x402b('0xc')]);router[_0x402b('0xd')]('/',auth[_0x402b('0xb')](),controller[_0x402b('0xe')]);router[_0x402b('0xf')](_0x402b('0xa'),auth[_0x402b('0xb')](),controller[_0x402b('0x10')]);router[_0x402b('0x11')]('/:id',auth[_0x402b('0xb')](),controller[_0x402b('0x12')]);module[_0x402b('0x13')]=router; \ No newline at end of file +var _0x9c0c=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id','post','create'];(function(_0x156280,_0x2a78e2){var _0x374498=function(_0x44fea0){while(--_0x44fea0){_0x156280['push'](_0x156280['shift']());}};_0x374498(++_0x2a78e2);}(_0x9c0c,0x193));var _0xc9c0=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0x9c0c[_0x1a87b3];return _0x37e84d;};'use strict';var multer=require(_0xc9c0('0x0'));var util=require('util');var path=require(_0xc9c0('0x1'));var timeout=require(_0xc9c0('0x2'));var express=require(_0xc9c0('0x3'));var router=express[_0xc9c0('0x4')]();var auth=require(_0xc9c0('0x5'));var interaction=require(_0xc9c0('0x6'));var config=require('../../config/environment');var controller=require(_0xc9c0('0x7'));router[_0xc9c0('0x8')]('/',auth['isAuthenticated'](),controller[_0xc9c0('0x9')]);router[_0xc9c0('0x8')](_0xc9c0('0xa'),auth[_0xc9c0('0xb')](),controller['describe']);router[_0xc9c0('0x8')](_0xc9c0('0xc'),auth[_0xc9c0('0xb')](),controller['show']);router[_0xc9c0('0xd')]('/',auth[_0xc9c0('0xb')](),controller[_0xc9c0('0xe')]);router[_0xc9c0('0xf')](_0xc9c0('0xc'),auth[_0xc9c0('0xb')](),controller['update']);router[_0xc9c0('0x10')]('/:id',auth[_0xc9c0('0xb')](),controller[_0xc9c0('0x11')]);module[_0xc9c0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 16c5a21..9ca9019 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x4d404d,_0x338fe1){var _0x555738=function(_0x48dbcc){while(--_0x48dbcc){_0x4d404d['push'](_0x4d404d['shift']());}};_0x555738(++_0x338fe1);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x24cb14,_0x2accaf){var _0x572260=function(_0x306d64){while(--_0x306d64){_0x24cb14['push'](_0x24cb14['shift']());}};_0x572260(++_0x2accaf);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index f296843..e644084 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6328=['intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','include','fullname','User','findAll','then','catch','show','keys','fields','includeAll','create','body','find','describe','uniqueid','user','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','update','destroy','error','name','index','map','VoiceCallReport','fieldName','type','key','model','query','filters'];(function(_0x13161e,_0x3de369){var _0x2ed165=function(_0x38445e){while(--_0x38445e){_0x13161e['push'](_0x13161e['shift']());}};_0x2ed165(++_0x3de369);}(_0x6328,0x199));var _0x8632=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x6328[_0x43b08];return _0x5e05f4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8632('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8632('0x1'));var jsonpatch=require(_0x8632('0x2'));var rp=require(_0x8632('0x3'));var moment=require(_0x8632('0x4'));var BPromise=require(_0x8632('0x5'));var Mustache=require('mustache');var util=require(_0x8632('0x6'));var path=require(_0x8632('0x7'));var sox=require(_0x8632('0x8'));var csv=require(_0x8632('0x9'));var ejs=require(_0x8632('0xa'));var fs=require('fs');var _=require(_0x8632('0xb'));var squel=require('squel');var crypto=require(_0x8632('0xc'));var jsforce=require(_0x8632('0xd'));var deskjs=require(_0x8632('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8632('0xf'));var Papa=require(_0x8632('0x10'));var Redis=require(_0x8632('0x11'));var authService=require(_0x8632('0x12'));var qs=require(_0x8632('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8632('0x14'));var logger=require(_0x8632('0x15'))('api');var utils=require(_0x8632('0x16'));var config=require(_0x8632('0x17'));var db=require(_0x8632('0x18'))['db'];function respondWithStatusCode(_0x41c6ea,_0x19e7fb){_0x19e7fb=_0x19e7fb||0xcc;return function(_0x2309a9){if(_0x2309a9){return _0x41c6ea[_0x8632('0x19')](_0x19e7fb);}return _0x41c6ea[_0x8632('0x1a')](_0x19e7fb)[_0x8632('0x1b')]();};}function respondWithResult(_0x461d58,_0x29b9d9){_0x29b9d9=_0x29b9d9||0xc8;return function(_0x1a4d89){if(_0x1a4d89){return _0x461d58[_0x8632('0x1a')](_0x29b9d9)[_0x8632('0x1c')](_0x1a4d89);}};}function respondWithFilteredResult(_0x36acd1,_0xd9b88b){return function(_0x13899d){if(_0x13899d){var _0x780ac7=_0x13899d[_0x8632('0x1d')],_0x26dcde=_0xd9b88b[_0x8632('0x1e')],_0x589a5b=_0xd9b88b[_0x8632('0x1e')]+_0xd9b88b['limit'],_0x370174;if(_0x589a5b>=_0x780ac7){_0x589a5b=_0x780ac7;_0x370174=0xc8;}else{_0x370174=0xce;}_0x36acd1[_0x8632('0x1a')](_0x370174);return _0x36acd1['set'](_0x8632('0x1f'),_0x26dcde+'-'+_0x589a5b+'/'+_0x780ac7)[_0x8632('0x1c')](_0x13899d);}return null;};}function patchUpdates(_0x44024b){return function(_0x4e74ac){try{jsonpatch[_0x8632('0x20')](_0x4e74ac,_0x44024b,!![]);}catch(_0xf9e591){return BPromise[_0x8632('0x21')](_0xf9e591);}return _0x4e74ac['save']();};}function saveUpdates(_0x3fd17d,_0x6b12ef){return function(_0x3b5ec4){if(_0x3b5ec4){return _0x3b5ec4[_0x8632('0x22')](_0x3fd17d)['then'](function(_0x384adb){return _0x384adb;});}return null;};}function removeEntity(_0x4b560a,_0x1e36ae){return function(_0x43fe10){if(_0x43fe10){return _0x43fe10[_0x8632('0x23')]()['then'](function(){_0x4b560a[_0x8632('0x1a')](0xcc)[_0x8632('0x1b')]();});}};}function handleEntityNotFound(_0x59a4a8,_0x599fc4){return function(_0xd6a7ea){if(!_0xd6a7ea){_0x59a4a8[_0x8632('0x19')](0x194);}return _0xd6a7ea;};}function handleError(_0x2bf92b,_0x11c98b){_0x11c98b=_0x11c98b||0x1f4;return function(_0x344d7c){logger[_0x8632('0x24')](_0x344d7c['stack']);if(_0x344d7c[_0x8632('0x25')]){delete _0x344d7c[_0x8632('0x25')];}_0x2bf92b[_0x8632('0x1a')](_0x11c98b)['send'](_0x344d7c);};}exports[_0x8632('0x26')]=function(_0x533f14,_0x35bda5){var _0x3c52c8={},_0x5544ed={},_0x5480e9={'count':0x0,'rows':[]};var _0x5233fd=_[_0x8632('0x27')](db[_0x8632('0x28')]['rawAttributes'],function(_0x4dcf29){return{'name':_0x4dcf29[_0x8632('0x29')],'type':_0x4dcf29[_0x8632('0x2a')][_0x8632('0x2b')]};});_0x5544ed[_0x8632('0x2c')]=_[_0x8632('0x27')](_0x5233fd,'name');_0x5544ed[_0x8632('0x2d')]=_['keys'](_0x533f14[_0x8632('0x2d')]);_0x5544ed[_0x8632('0x2e')]=_[_0x8632('0x2f')](_0x5544ed[_0x8632('0x2c')],_0x5544ed[_0x8632('0x2d')]);_0x3c52c8['attributes']=_[_0x8632('0x2f')](_0x5544ed[_0x8632('0x2c')],qs['fields'](_0x533f14['query']['fields']));_0x3c52c8['attributes']=_0x3c52c8[_0x8632('0x30')][_0x8632('0x31')]?_0x3c52c8[_0x8632('0x30')]:_0x5544ed['model'];if(!_0x533f14[_0x8632('0x2d')][_0x8632('0x32')](_0x8632('0x33'))){_0x3c52c8[_0x8632('0x34')]=qs[_0x8632('0x34')](_0x533f14[_0x8632('0x2d')][_0x8632('0x34')]);_0x3c52c8['offset']=qs[_0x8632('0x1e')](_0x533f14[_0x8632('0x2d')][_0x8632('0x1e')]);}_0x3c52c8[_0x8632('0x35')]=qs['sort'](_0x533f14[_0x8632('0x2d')][_0x8632('0x36')]);_0x3c52c8['where']=qs[_0x8632('0x2e')](_[_0x8632('0x37')](_0x533f14[_0x8632('0x2d')],_0x5544ed['filters']));if(_0x533f14[_0x8632('0x2d')][_0x8632('0x38')]){_0x3c52c8[_0x8632('0x39')]=_[_0x8632('0x3a')](_0x3c52c8['where'],{'$or':_[_0x8632('0x27')](_0x5233fd,function(_0x1a6374){if(_0x1a6374['type']!=='VIRTUAL'){var _0x43a620={};_0x43a620[_0x1a6374[_0x8632('0x25')]]={'$like':'%'+_0x533f14['query']['filter']+'%'};return _0x43a620;}})});}_0x3c52c8=_[_0x8632('0x3a')]({},_0x3c52c8,_0x533f14[_0x8632('0x3b')]);var _0x3e84a6={'where':_0x3c52c8['where']};return db[_0x8632('0x28')][_0x8632('0x1d')](_0x3e84a6)['then'](function(_0x4c4361){_0x5480e9[_0x8632('0x1d')]=_0x4c4361;if(_0x533f14['query']['includeAll']){_0x3c52c8[_0x8632('0x3c')]=[{'attributes':['id',_0x8632('0x25'),_0x8632('0x3d'),'alias'],'model':db['User'],'as':_0x8632('0x3e')}];}return db[_0x8632('0x28')][_0x8632('0x3f')](_0x3c52c8);})[_0x8632('0x40')](function(_0x3314de){_0x5480e9['rows']=_0x3314de;return _0x5480e9;})[_0x8632('0x40')](respondWithFilteredResult(_0x35bda5,_0x3c52c8))[_0x8632('0x41')](handleError(_0x35bda5,null));};exports[_0x8632('0x42')]=function(_0x3eb7fb,_0x3fe4ea){var _0x3b748e={'raw':!![],'where':{'id':_0x3eb7fb['params']['id']}},_0x40731a={};_0x40731a[_0x8632('0x2c')]=_['keys'](db[_0x8632('0x28')]['rawAttributes']);_0x40731a['query']=_[_0x8632('0x43')](_0x3eb7fb['query']);_0x40731a[_0x8632('0x2e')]=_[_0x8632('0x2f')](_0x40731a['model'],_0x40731a[_0x8632('0x2d')]);_0x3b748e[_0x8632('0x30')]=_[_0x8632('0x2f')](_0x40731a[_0x8632('0x2c')],qs[_0x8632('0x44')](_0x3eb7fb['query'][_0x8632('0x44')]));_0x3b748e['attributes']=_0x3b748e[_0x8632('0x30')][_0x8632('0x31')]?_0x3b748e[_0x8632('0x30')]:_0x40731a[_0x8632('0x2c')];if(_0x3eb7fb[_0x8632('0x2d')][_0x8632('0x45')]){_0x3b748e[_0x8632('0x3c')]=[{'all':!![]}];}_0x3b748e=_[_0x8632('0x3a')]({},_0x3b748e,_0x3eb7fb[_0x8632('0x3b')]);return db[_0x8632('0x28')]['find'](_0x3b748e)[_0x8632('0x40')](handleEntityNotFound(_0x3fe4ea,null))[_0x8632('0x40')](respondWithResult(_0x3fe4ea,null))[_0x8632('0x41')](handleError(_0x3fe4ea,null));};exports[_0x8632('0x46')]=function(_0x33a20b,_0x381ad4){return db[_0x8632('0x28')][_0x8632('0x46')](_0x33a20b[_0x8632('0x47')],{})[_0x8632('0x40')](respondWithResult(_0x381ad4,0xc9))[_0x8632('0x41')](handleError(_0x381ad4,null));};exports['destroy']=function(_0x2f244b,_0x257d5b){return db[_0x8632('0x28')][_0x8632('0x48')]({'where':{'id':_0x2f244b['params']['id']}})['then'](handleEntityNotFound(_0x257d5b,null))[_0x8632('0x40')](removeEntity(_0x257d5b,null))[_0x8632('0x41')](handleError(_0x257d5b,null));};exports[_0x8632('0x49')]=function(_0x264bf6,_0x1f6bfe){return db[_0x8632('0x28')][_0x8632('0x49')]()['then'](respondWithResult(_0x1f6bfe,null))[_0x8632('0x41')](handleError(_0x1f6bfe,null));};exports[_0x8632('0x22')]=function(_0x2157cc,_0x208b04){if(_0x2157cc[_0x8632('0x47')][_0x8632('0x4a')]){delete _0x2157cc['body'][_0x8632('0x4a')];}return db[_0x8632('0x28')][_0x8632('0x48')]({'where':{'uniqueid':_0x2157cc['params']['id'],'UserId':{'$or':[null,_0x2157cc[_0x8632('0x4b')]['id']]}}})['then'](handleEntityNotFound(_0x208b04,null))[_0x8632('0x40')](saveUpdates(_0x2157cc[_0x8632('0x47')],null))[_0x8632('0x40')](respondWithResult(_0x208b04,null))[_0x8632('0x41')](handleError(_0x208b04,null));}; \ No newline at end of file +var _0xc783=['name','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','offset','order','sort','filters','pick','where','merge','type','filter','options','VoiceCallReport','includeAll','include','fullname','alias','User','findAll','rows','catch','show','find','create','body','params','describe','uniqueid','user','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','rawAttributes','fieldName','key'];(function(_0x598cac,_0x26acbd){var _0x4039f2=function(_0x36bfb8){while(--_0x36bfb8){_0x598cac['push'](_0x598cac['shift']());}};_0x4039f2(++_0x26acbd);}(_0xc783,0x11d));var _0x3c78=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc783[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3c78('0x0'));var rimraf=require(_0x3c78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c78('0x2'));var rp=require(_0x3c78('0x3'));var moment=require(_0x3c78('0x4'));var BPromise=require(_0x3c78('0x5'));var Mustache=require('mustache');var util=require(_0x3c78('0x6'));var path=require(_0x3c78('0x7'));var sox=require(_0x3c78('0x8'));var csv=require(_0x3c78('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c78('0xa'));var squel=require(_0x3c78('0xb'));var crypto=require(_0x3c78('0xc'));var jsforce=require(_0x3c78('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3c78('0x9'));var querystring=require(_0x3c78('0xe'));var Papa=require(_0x3c78('0xf'));var Redis=require('ioredis');var authService=require(_0x3c78('0x10'));var qs=require(_0x3c78('0x11'));var as=require(_0x3c78('0x12'));var hardwareService=require(_0x3c78('0x13'));var logger=require(_0x3c78('0x14'))(_0x3c78('0x15'));var utils=require(_0x3c78('0x16'));var config=require(_0x3c78('0x17'));var db=require(_0x3c78('0x18'))['db'];function respondWithStatusCode(_0x3b9b40,_0x540526){_0x540526=_0x540526||0xcc;return function(_0x3e3b0c){if(_0x3e3b0c){return _0x3b9b40[_0x3c78('0x19')](_0x540526);}return _0x3b9b40[_0x3c78('0x1a')](_0x540526)[_0x3c78('0x1b')]();};}function respondWithResult(_0x47a36c,_0x351f79){_0x351f79=_0x351f79||0xc8;return function(_0x552b26){if(_0x552b26){return _0x47a36c['status'](_0x351f79)[_0x3c78('0x1c')](_0x552b26);}};}function respondWithFilteredResult(_0x5e0452,_0x3caf10){return function(_0x4052e1){if(_0x4052e1){var _0x130358=_0x4052e1[_0x3c78('0x1d')],_0x4cad69=_0x3caf10['offset'],_0x1ed1e7=_0x3caf10['offset']+_0x3caf10[_0x3c78('0x1e')],_0xd893b0;if(_0x1ed1e7>=_0x130358){_0x1ed1e7=_0x130358;_0xd893b0=0xc8;}else{_0xd893b0=0xce;}_0x5e0452['status'](_0xd893b0);return _0x5e0452[_0x3c78('0x1f')](_0x3c78('0x20'),_0x4cad69+'-'+_0x1ed1e7+'/'+_0x130358)[_0x3c78('0x1c')](_0x4052e1);}return null;};}function patchUpdates(_0xf47b72){return function(_0x126fe9){try{jsonpatch[_0x3c78('0x21')](_0x126fe9,_0xf47b72,!![]);}catch(_0xfc6992){return BPromise[_0x3c78('0x22')](_0xfc6992);}return _0x126fe9[_0x3c78('0x23')]();};}function saveUpdates(_0x1c40e7,_0x1abc8e){return function(_0x33a7f2){if(_0x33a7f2){return _0x33a7f2[_0x3c78('0x24')](_0x1c40e7)['then'](function(_0x448d57){return _0x448d57;});}return null;};}function removeEntity(_0x893598,_0x150f58){return function(_0x4de275){if(_0x4de275){return _0x4de275[_0x3c78('0x25')]()[_0x3c78('0x26')](function(){_0x893598['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e93a1,_0x520af9){return function(_0x143f8f){if(!_0x143f8f){_0x1e93a1[_0x3c78('0x19')](0x194);}return _0x143f8f;};}function handleError(_0x20d6f9,_0x460849){_0x460849=_0x460849||0x1f4;return function(_0x40003c){logger[_0x3c78('0x27')](_0x40003c[_0x3c78('0x28')]);if(_0x40003c['name']){delete _0x40003c['name'];}_0x20d6f9[_0x3c78('0x1a')](_0x460849)[_0x3c78('0x29')](_0x40003c);};}exports[_0x3c78('0x2a')]=function(_0x407958,_0x36cf6e){var _0x2a3e0c={},_0xbd5237={},_0x5097a7={'count':0x0,'rows':[]};var _0x4b4ee6=_[_0x3c78('0x2b')](db['VoiceCallReport'][_0x3c78('0x2c')],function(_0x45b3ce){return{'name':_0x45b3ce[_0x3c78('0x2d')],'type':_0x45b3ce['type'][_0x3c78('0x2e')]};});_0xbd5237['model']=_['map'](_0x4b4ee6,_0x3c78('0x2f'));_0xbd5237['query']=_[_0x3c78('0x30')](_0x407958[_0x3c78('0x31')]);_0xbd5237['filters']=_[_0x3c78('0x32')](_0xbd5237[_0x3c78('0x33')],_0xbd5237[_0x3c78('0x31')]);_0x2a3e0c['attributes']=_[_0x3c78('0x32')](_0xbd5237[_0x3c78('0x33')],qs['fields'](_0x407958['query'][_0x3c78('0x34')]));_0x2a3e0c[_0x3c78('0x35')]=_0x2a3e0c['attributes'][_0x3c78('0x36')]?_0x2a3e0c[_0x3c78('0x35')]:_0xbd5237[_0x3c78('0x33')];if(!_0x407958[_0x3c78('0x31')][_0x3c78('0x37')]('nolimit')){_0x2a3e0c[_0x3c78('0x1e')]=qs[_0x3c78('0x1e')](_0x407958[_0x3c78('0x31')][_0x3c78('0x1e')]);_0x2a3e0c['offset']=qs[_0x3c78('0x38')](_0x407958[_0x3c78('0x31')]['offset']);}_0x2a3e0c[_0x3c78('0x39')]=qs[_0x3c78('0x3a')](_0x407958[_0x3c78('0x31')][_0x3c78('0x3a')]);_0x2a3e0c['where']=qs[_0x3c78('0x3b')](_[_0x3c78('0x3c')](_0x407958[_0x3c78('0x31')],_0xbd5237[_0x3c78('0x3b')]));if(_0x407958[_0x3c78('0x31')]['filter']){_0x2a3e0c[_0x3c78('0x3d')]=_[_0x3c78('0x3e')](_0x2a3e0c[_0x3c78('0x3d')],{'$or':_[_0x3c78('0x2b')](_0x4b4ee6,function(_0x394808){if(_0x394808[_0x3c78('0x3f')]!=='VIRTUAL'){var _0x198dba={};_0x198dba[_0x394808[_0x3c78('0x2f')]]={'$like':'%'+_0x407958['query'][_0x3c78('0x40')]+'%'};return _0x198dba;}})});}_0x2a3e0c=_['merge']({},_0x2a3e0c,_0x407958[_0x3c78('0x41')]);var _0x5b3b02={'where':_0x2a3e0c[_0x3c78('0x3d')]};return db[_0x3c78('0x42')][_0x3c78('0x1d')](_0x5b3b02)[_0x3c78('0x26')](function(_0x25bbd5){_0x5097a7['count']=_0x25bbd5;if(_0x407958['query'][_0x3c78('0x43')]){_0x2a3e0c[_0x3c78('0x44')]=[{'attributes':['id','name',_0x3c78('0x45'),_0x3c78('0x46')],'model':db[_0x3c78('0x47')],'as':'User'}];}return db['VoiceCallReport'][_0x3c78('0x48')](_0x2a3e0c);})[_0x3c78('0x26')](function(_0x2c6f65){_0x5097a7[_0x3c78('0x49')]=_0x2c6f65;return _0x5097a7;})['then'](respondWithFilteredResult(_0x36cf6e,_0x2a3e0c))[_0x3c78('0x4a')](handleError(_0x36cf6e,null));};exports[_0x3c78('0x4b')]=function(_0x273bc4,_0x1a2926){var _0x51d7ca={'raw':!![],'where':{'id':_0x273bc4['params']['id']}},_0x287e37={};_0x287e37[_0x3c78('0x33')]=_[_0x3c78('0x30')](db['VoiceCallReport'][_0x3c78('0x2c')]);_0x287e37[_0x3c78('0x31')]=_['keys'](_0x273bc4['query']);_0x287e37[_0x3c78('0x3b')]=_[_0x3c78('0x32')](_0x287e37[_0x3c78('0x33')],_0x287e37['query']);_0x51d7ca[_0x3c78('0x35')]=_['intersection'](_0x287e37[_0x3c78('0x33')],qs[_0x3c78('0x34')](_0x273bc4[_0x3c78('0x31')]['fields']));_0x51d7ca[_0x3c78('0x35')]=_0x51d7ca[_0x3c78('0x35')][_0x3c78('0x36')]?_0x51d7ca[_0x3c78('0x35')]:_0x287e37['model'];if(_0x273bc4[_0x3c78('0x31')][_0x3c78('0x43')]){_0x51d7ca['include']=[{'all':!![]}];}_0x51d7ca=_[_0x3c78('0x3e')]({},_0x51d7ca,_0x273bc4['options']);return db[_0x3c78('0x42')][_0x3c78('0x4c')](_0x51d7ca)[_0x3c78('0x26')](handleEntityNotFound(_0x1a2926,null))[_0x3c78('0x26')](respondWithResult(_0x1a2926,null))[_0x3c78('0x4a')](handleError(_0x1a2926,null));};exports[_0x3c78('0x4d')]=function(_0x190907,_0x20c192){return db[_0x3c78('0x42')][_0x3c78('0x4d')](_0x190907[_0x3c78('0x4e')],{})[_0x3c78('0x26')](respondWithResult(_0x20c192,0xc9))[_0x3c78('0x4a')](handleError(_0x20c192,null));};exports[_0x3c78('0x25')]=function(_0x5106e0,_0x16139c){return db[_0x3c78('0x42')][_0x3c78('0x4c')]({'where':{'id':_0x5106e0[_0x3c78('0x4f')]['id']}})[_0x3c78('0x26')](handleEntityNotFound(_0x16139c,null))['then'](removeEntity(_0x16139c,null))[_0x3c78('0x4a')](handleError(_0x16139c,null));};exports[_0x3c78('0x50')]=function(_0xadf522,_0x17a343){return db[_0x3c78('0x42')][_0x3c78('0x50')]()[_0x3c78('0x26')](respondWithResult(_0x17a343,null))['catch'](handleError(_0x17a343,null));};exports['update']=function(_0x5b4e47,_0x41aaca){if(_0x5b4e47[_0x3c78('0x4e')][_0x3c78('0x51')]){delete _0x5b4e47[_0x3c78('0x4e')][_0x3c78('0x51')];}return db[_0x3c78('0x42')][_0x3c78('0x4c')]({'where':{'uniqueid':_0x5b4e47['params']['id'],'UserId':{'$or':[null,_0x5b4e47[_0x3c78('0x52')]['id']]}}})[_0x3c78('0x26')](handleEntityNotFound(_0x41aaca,null))['then'](saveUpdates(_0x5b4e47[_0x3c78('0x4e')],null))[_0x3c78('0x26')](respondWithResult(_0x41aaca,null))[_0x3c78('0x4a')](handleError(_0x41aaca,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ac8e978..b0c2882 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ada=['lodash','util','api','moment','bluebird','rimraf','report_call','uniqueid'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x6ada,0x1d0));var _0xa6ad=function(_0x599c78,_0x4ca386){_0x599c78=_0x599c78-0x0;var _0x4af3cc=_0x6ada[_0x599c78];return _0x4af3cc;};'use strict';var _=require(_0xa6ad('0x0'));var util=require(_0xa6ad('0x1'));var logger=require('../../config/logger')(_0xa6ad('0x2'));var moment=require(_0xa6ad('0x3'));var BPromise=require(_0xa6ad('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa6ad('0x5'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x33d046,_0x516ea3){return _0x33d046['define']('VoiceCallReport',attributes,{'tableName':_0xa6ad('0x6'),'paranoid':![],'indexes':[{'fields':[_0xa6ad('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x92e5=['request-promise','path','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x59e9ff,_0x5080c3){var _0xa71d5e=function(_0x7d1718){while(--_0x7d1718){_0x59e9ff['push'](_0x59e9ff['shift']());}};_0xa71d5e(++_0x5080c3);}(_0x92e5,0x67));var _0x592e=function(_0x14ef3b,_0x8fc8df){_0x14ef3b=_0x14ef3b-0x0;var _0x3828e3=_0x92e5[_0x14ef3b];return _0x3828e3;};'use strict';var _=require('lodash');var util=require(_0x592e('0x0'));var logger=require(_0x592e('0x1'))(_0x592e('0x2'));var moment=require(_0x592e('0x3'));var BPromise=require(_0x592e('0x4'));var rp=require(_0x592e('0x5'));var fs=require('fs');var path=require(_0x592e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x592e('0x7'));module[_0x592e('0x8')]=function(_0x4f2500,_0x572c7f){return _0x4f2500[_0x592e('0x9')](_0x592e('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x592e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 66337e3..e29df94 100644 --- a/server/api/voiceCallReport/voiceCallReport.rpc.js +++ b/server/api/voiceCallReport/voiceCallReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x505e=['options','raw','where','attributes','limit','include','model','map','stringify','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetVoiceCallReport','VoiceCallReport'];(function(_0xa0de0d,_0xb04226){var _0x50cc4c=function(_0xe9b8c7){while(--_0xe9b8c7){_0xa0de0d['push'](_0xa0de0d['shift']());}};_0x50cc4c(++_0xb04226);}(_0x505e,0xd2));var _0xe505=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x505e[_0x1064bc];return _0x5edc45;};'use strict';var _=require('lodash');var util=require(_0xe505('0x0'));var moment=require(_0xe505('0x1'));var BPromise=require(_0xe505('0x2'));var rs=require(_0xe505('0x3'));var fs=require('fs');var Redis=require(_0xe505('0x4'));var db=require(_0xe505('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe505('0x6'))(_0xe505('0x7'));var config=require(_0xe505('0x8'));var jayson=require(_0xe505('0x9'));var client=jayson[_0xe505('0xa')][_0xe505('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47a4ec,_0xfc73ca,_0x12754a){return new BPromise(function(_0x3d5da7,_0x766bdb){return client[_0xe505('0xc')](_0x47a4ec,_0x12754a)[_0xe505('0xd')](function(_0x1e9f58){logger[_0xe505('0xe')](_0xe505('0xf'),_0xfc73ca,_0xe505('0x10'));logger[_0xe505('0x11')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0xfc73ca,'request\x20sent',JSON['stringify'](_0x1e9f58));if(_0x1e9f58['error']){if(_0x1e9f58[_0xe505('0x12')][_0xe505('0x13')]===0x1f4){logger['error'](_0xe505('0xf'),_0xfc73ca,_0x1e9f58['error'][_0xe505('0x14')]);return _0x766bdb(_0x1e9f58[_0xe505('0x12')][_0xe505('0x14')]);}logger[_0xe505('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0xfc73ca,_0x1e9f58[_0xe505('0x12')][_0xe505('0x14')]);return _0x3d5da7(_0x1e9f58['error']['message']);}else{logger[_0xe505('0xe')](_0xe505('0xf'),_0xfc73ca,_0xe505('0x10'));_0x3d5da7(_0x1e9f58[_0xe505('0x15')]['message']);}})['catch'](function(_0x3e1c3b){logger[_0xe505('0x12')](_0xe505('0xf'),_0xfc73ca,_0x3e1c3b);_0x766bdb(_0x3e1c3b);});});}exports[_0xe505('0x16')]=function(_0x23f969){var _0x63eb63=this;return new Promise(function(_0x182049,_0x4e1558){return db[_0xe505('0x17')]['findAll']({'raw':_0x23f969['options']?_0x23f969[_0xe505('0x18')][_0xe505('0x19')]===undefined?!![]:![]:!![],'where':_0x23f969[_0xe505('0x18')]?_0x23f969['options'][_0xe505('0x1a')]||null:null,'attributes':_0x23f969[_0xe505('0x18')]?_0x23f969[_0xe505('0x18')][_0xe505('0x1b')]||null:null,'limit':_0x23f969['options']?_0x23f969[_0xe505('0x18')][_0xe505('0x1c')]||null:null,'include':_0x23f969[_0xe505('0x18')]?_0x23f969[_0xe505('0x18')][_0xe505('0x1d')]?_['map'](_0x23f969['options'][_0xe505('0x1d')],function(_0x1584c5){return{'model':db[_0x1584c5[_0xe505('0x1e')]],'as':_0x1584c5['as'],'attributes':_0x1584c5[_0xe505('0x1b')],'include':_0x1584c5['include']?_[_0xe505('0x1f')](_0x1584c5[_0xe505('0x1d')],function(_0x18c748){return{'model':db[_0x18c748[_0xe505('0x1e')]],'as':_0x18c748['as'],'attributes':_0x18c748[_0xe505('0x1b')],'include':_0x18c748[_0xe505('0x1d')]?_[_0xe505('0x1f')](_0x18c748[_0xe505('0x1d')],function(_0x46abb1){return{'model':db[_0x46abb1[_0xe505('0x1e')]],'as':_0x46abb1['as'],'attributes':_0x46abb1[_0xe505('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe505('0xd')](function(_0x2ba1c5){logger[_0xe505('0xe')](_0xe505('0x16'),_0x23f969);logger[_0xe505('0x11')](_0xe505('0x16'),_0x23f969,JSON[_0xe505('0x20')](_0x2ba1c5));_0x182049(_0x2ba1c5);})[_0xe505('0x21')](function(_0x5eb8dc){logger[_0xe505('0x12')]('GetVoiceCallReport',_0x5eb8dc['message'],_0x23f969);_0x4e1558(_0x63eb63[_0xe505('0x12')](0x1f4,_0x5eb8dc[_0xe505('0x14')]));});});};exports[_0xe505('0x22')]=function(_0x51e870){var _0x8eff33=this;return new Promise(function(_0x345c4f,_0x11ffd4){return db[_0xe505('0x17')][_0xe505('0x23')](_0x51e870[_0xe505('0x24')],{'raw':_0x51e870[_0xe505('0x18')]?_0x51e870['options']['raw']===undefined?!![]:![]:!![]})[_0xe505('0xd')](function(_0x3fd0a5){logger['info']('CreateVoiceCallReport',_0x51e870);logger[_0xe505('0x11')](_0xe505('0x22'),_0x51e870,JSON[_0xe505('0x20')](_0x3fd0a5));_0x345c4f(_0x3fd0a5);})[_0xe505('0x21')](function(_0xd48229){logger[_0xe505('0x12')](_0xe505('0x22'),_0xd48229[_0xe505('0x14')],_0x51e870);_0x11ffd4(_0x8eff33[_0xe505('0x12')](0x1f4,_0xd48229['message']));});});};exports[_0xe505('0x25')]=function(_0x186115){var _0x4d2269=this;return new Promise(function(_0xb6187c,_0x53623c){return db[_0xe505('0x17')][_0xe505('0x26')](_0x186115['body'],{'raw':_0x186115['options']?_0x186115['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x186115['options']?_0x186115[_0xe505('0x18')][_0xe505('0x1a')]||null:null,'attributes':_0x186115[_0xe505('0x18')]?_0x186115[_0xe505('0x18')][_0xe505('0x1b')]||null:null,'limit':_0x186115[_0xe505('0x18')]?_0x186115[_0xe505('0x18')][_0xe505('0x1c')]||null:null})['then'](function(_0x454473){logger[_0xe505('0xe')](_0xe505('0x25'),_0x186115);logger[_0xe505('0x11')]('UpdateVoiceCallReport',_0x186115,JSON[_0xe505('0x20')](_0x454473));_0xb6187c(_0x454473);})['catch'](function(_0x17bb99){logger[_0xe505('0x12')](_0xe505('0x25'),_0x17bb99[_0xe505('0x14')],_0x186115);_0x53623c(_0x4d2269['error'](0x1f4,_0x17bb99[_0xe505('0x14')]));});});}; \ No newline at end of file +var _0x33c5=['include','model','map','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','options','raw','where','attributes','limit'];(function(_0x1fce28,_0x88727d){var _0x276ec8=function(_0x5b8f60){while(--_0x5b8f60){_0x1fce28['push'](_0x1fce28['shift']());}};_0x276ec8(++_0x88727d);}(_0x33c5,0x1ab));var _0x533c=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0x33c5[_0x1d3791];return _0x40fbf5;};'use strict';var _=require(_0x533c('0x0'));var util=require(_0x533c('0x1'));var moment=require(_0x533c('0x2'));var BPromise=require('bluebird');var rs=require(_0x533c('0x3'));var fs=require('fs');var Redis=require(_0x533c('0x4'));var db=require(_0x533c('0x5'))['db'];var utils=require(_0x533c('0x6'));var logger=require(_0x533c('0x7'))('rpc');var config=require(_0x533c('0x8'));var jayson=require(_0x533c('0x9'));var client=jayson[_0x533c('0xa')][_0x533c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x248f80,_0x1bd7b4,_0x3c9d21){return new BPromise(function(_0x523739,_0x14d824){return client['request'](_0x248f80,_0x3c9d21)[_0x533c('0xc')](function(_0x50bd29){logger[_0x533c('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x1bd7b4,_0x533c('0xe'));logger[_0x533c('0xf')](_0x533c('0x10'),_0x1bd7b4,_0x533c('0xe'),JSON[_0x533c('0x11')](_0x50bd29));if(_0x50bd29['error']){if(_0x50bd29[_0x533c('0x12')]['code']===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x1bd7b4,_0x50bd29[_0x533c('0x12')]['message']);return _0x14d824(_0x50bd29[_0x533c('0x12')]['message']);}logger[_0x533c('0x12')](_0x533c('0x13'),_0x1bd7b4,_0x50bd29[_0x533c('0x12')][_0x533c('0x14')]);return _0x523739(_0x50bd29['error']['message']);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x1bd7b4,'request\x20sent');_0x523739(_0x50bd29[_0x533c('0x15')]['message']);}})[_0x533c('0x16')](function(_0x1ed519){logger[_0x533c('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x1bd7b4,_0x1ed519);_0x14d824(_0x1ed519);});});}exports[_0x533c('0x17')]=function(_0x3d2fde){var _0x303a6d=this;return new Promise(function(_0x5f3d67,_0xedbf78){return db['VoiceCallReport']['findAll']({'raw':_0x3d2fde['options']?_0x3d2fde[_0x533c('0x18')][_0x533c('0x19')]===undefined?!![]:![]:!![],'where':_0x3d2fde[_0x533c('0x18')]?_0x3d2fde[_0x533c('0x18')][_0x533c('0x1a')]||null:null,'attributes':_0x3d2fde['options']?_0x3d2fde['options'][_0x533c('0x1b')]||null:null,'limit':_0x3d2fde[_0x533c('0x18')]?_0x3d2fde['options'][_0x533c('0x1c')]||null:null,'include':_0x3d2fde[_0x533c('0x18')]?_0x3d2fde[_0x533c('0x18')]['include']?_['map'](_0x3d2fde['options'][_0x533c('0x1d')],function(_0x56bbee){return{'model':db[_0x56bbee[_0x533c('0x1e')]],'as':_0x56bbee['as'],'attributes':_0x56bbee[_0x533c('0x1b')],'include':_0x56bbee[_0x533c('0x1d')]?_[_0x533c('0x1f')](_0x56bbee[_0x533c('0x1d')],function(_0x31ff0f){return{'model':db[_0x31ff0f[_0x533c('0x1e')]],'as':_0x31ff0f['as'],'attributes':_0x31ff0f[_0x533c('0x1b')],'include':_0x31ff0f[_0x533c('0x1d')]?_[_0x533c('0x1f')](_0x31ff0f[_0x533c('0x1d')],function(_0x2ffedc){return{'model':db[_0x2ffedc[_0x533c('0x1e')]],'as':_0x2ffedc['as'],'attributes':_0x2ffedc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5419c6){logger[_0x533c('0xd')](_0x533c('0x17'),_0x3d2fde);logger[_0x533c('0xf')]('GetVoiceCallReport',_0x3d2fde,JSON[_0x533c('0x11')](_0x5419c6));_0x5f3d67(_0x5419c6);})[_0x533c('0x16')](function(_0x2d7b8e){logger[_0x533c('0x12')](_0x533c('0x17'),_0x2d7b8e['message'],_0x3d2fde);_0xedbf78(_0x303a6d['error'](0x1f4,_0x2d7b8e['message']));});});};exports[_0x533c('0x20')]=function(_0x6e1da4){var _0x4f25f2=this;return new Promise(function(_0x2753b4,_0x313f7e){return db[_0x533c('0x21')][_0x533c('0x22')](_0x6e1da4[_0x533c('0x23')],{'raw':_0x6e1da4[_0x533c('0x18')]?_0x6e1da4[_0x533c('0x18')][_0x533c('0x19')]===undefined?!![]:![]:!![]})[_0x533c('0xc')](function(_0x458cc5){logger['info'](_0x533c('0x20'),_0x6e1da4);logger[_0x533c('0xf')]('CreateVoiceCallReport',_0x6e1da4,JSON[_0x533c('0x11')](_0x458cc5));_0x2753b4(_0x458cc5);})[_0x533c('0x16')](function(_0x54ee01){logger[_0x533c('0x12')](_0x533c('0x20'),_0x54ee01[_0x533c('0x14')],_0x6e1da4);_0x313f7e(_0x4f25f2[_0x533c('0x12')](0x1f4,_0x54ee01[_0x533c('0x14')]));});});};exports[_0x533c('0x24')]=function(_0x271ea2){var _0x28f4b8=this;return new Promise(function(_0x2342e2,_0x5b63bc){return db[_0x533c('0x21')][_0x533c('0x25')](_0x271ea2['body'],{'raw':_0x271ea2[_0x533c('0x18')]?_0x271ea2['options'][_0x533c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x271ea2[_0x533c('0x18')]?_0x271ea2[_0x533c('0x18')][_0x533c('0x1a')]||null:null,'attributes':_0x271ea2[_0x533c('0x18')]?_0x271ea2[_0x533c('0x18')][_0x533c('0x1b')]||null:null,'limit':_0x271ea2[_0x533c('0x18')]?_0x271ea2[_0x533c('0x18')][_0x533c('0x1c')]||null:null})[_0x533c('0xc')](function(_0x55b576){logger[_0x533c('0xd')]('UpdateVoiceCallReport',_0x271ea2);logger[_0x533c('0xf')](_0x533c('0x24'),_0x271ea2,JSON[_0x533c('0x11')](_0x55b576));_0x2342e2(_0x55b576);})[_0x533c('0x16')](function(_0x4c2647){logger[_0x533c('0x12')](_0x533c('0x24'),_0x4c2647[_0x533c('0x14')],_0x271ea2);_0x5b63bc(_0x28f4b8[_0x533c('0x12')](0x1f4,_0x4c2647['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index c043d8b..b73b55a 100644 --- a/server/api/voiceChanSpy/index.js +++ b/server/api/voiceChanSpy/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4fd=['isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports','path','express','Router','../../config/environment'];(function(_0xcc89cb,_0x5e8890){var _0x2d72fb=function(_0x4f3781){while(--_0x4f3781){_0xcc89cb['push'](_0xcc89cb['shift']());}};_0x2d72fb(++_0x5e8890);}(_0xb4fd,0x130));var _0xdb4f=function(_0x3b260d,_0x3f95d9){_0x3b260d=_0x3b260d-0x0;var _0x1a9b7c=_0xb4fd[_0x3b260d];return _0x1a9b7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdb4f('0x0'));var timeout=require('connect-timeout');var express=require(_0xdb4f('0x1'));var router=express[_0xdb4f('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdb4f('0x3'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0xdb4f('0x4')](),controller[_0xdb4f('0x5')]);router[_0xdb4f('0x6')](_0xdb4f('0x7'),auth[_0xdb4f('0x4')](),controller[_0xdb4f('0x8')]);router[_0xdb4f('0x9')]('/',auth[_0xdb4f('0x4')](),controller['create']);router['put'](_0xdb4f('0x7'),auth[_0xdb4f('0x4')](),controller[_0xdb4f('0xa')]);router[_0xdb4f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdb4f('0xc')]);module[_0xdb4f('0xd')]=router; \ No newline at end of file +var _0x6c21=['../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x3fe30d,_0x469e48){var _0x37b3e1=function(_0x5f1a27){while(--_0x5f1a27){_0x3fe30d['push'](_0x3fe30d['shift']());}};_0x37b3e1(++_0x469e48);}(_0x6c21,0x1b2));var _0x16c2=function(_0x2c1de0,_0x4fc4e3){_0x2c1de0=_0x2c1de0-0x0;var _0x208965=_0x6c21[_0x2c1de0];return _0x208965;};'use strict';var multer=require(_0x16c2('0x0'));var util=require(_0x16c2('0x1'));var path=require(_0x16c2('0x2'));var timeout=require(_0x16c2('0x3'));var express=require('express');var router=express[_0x16c2('0x4')]();var auth=require(_0x16c2('0x5'));var interaction=require(_0x16c2('0x6'));var config=require(_0x16c2('0x7'));var controller=require(_0x16c2('0x8'));router['get']('/',auth[_0x16c2('0x9')](),controller[_0x16c2('0xa')]);router[_0x16c2('0xb')](_0x16c2('0xc'),auth[_0x16c2('0x9')](),controller[_0x16c2('0xd')]);router[_0x16c2('0xe')]('/',auth[_0x16c2('0x9')](),controller[_0x16c2('0xf')]);router[_0x16c2('0x10')](_0x16c2('0xc'),auth[_0x16c2('0x9')](),controller['update']);router[_0x16c2('0x11')](_0x16c2('0xc'),auth['isAuthenticated'](),controller[_0x16c2('0x12')]);module[_0x16c2('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index a1677f7..35fd200 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js +++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc290=['getDataValue','split','BOOLEAN','sequelize','STRING','setDataValue','options','join'];(function(_0x22e7cb,_0x14e7b4){var _0x55e509=function(_0x204599){while(--_0x204599){_0x22e7cb['push'](_0x22e7cb['shift']());}};_0x55e509(++_0x14e7b4);}(_0xc290,0x16b));var _0x0c29=function(_0x3ddd61,_0x2e79e9){_0x3ddd61=_0x3ddd61-0x0;var _0x49712d=_0xc290[_0x3ddd61];return _0x49712d;};'use strict';var Sequelize=require(_0x0c29('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0c29('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x0c29('0x1')],'set':function(_0x410479){this[_0x0c29('0x2')](_0x0c29('0x3'),_0x410479?_0x410479[_0x0c29('0x4')](''):[]);},'get':function(){return this[_0x0c29('0x5')](_0x0c29('0x3'))?this['getDataValue']('options')[_0x0c29('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x0c29('0x1')]},'record':{'type':Sequelize[_0x0c29('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0c29('0x1')]},'description':{'type':Sequelize[_0x0c29('0x1')]}}; \ No newline at end of file +var _0xc025=['setDataValue','options','join','getDataValue','BOOLEAN','sequelize','STRING'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xc025,0x1be));var _0x5c02=function(_0x1c6ec8,_0x2df418){_0x1c6ec8=_0x1c6ec8-0x0;var _0x312f14=_0xc025[_0x1c6ec8];return _0x312f14;};'use strict';var Sequelize=require(_0x5c02('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c02('0x1')]},'prefix':{'type':Sequelize[_0x5c02('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x5c02('0x1')],'set':function(_0x2b9a23){this[_0x5c02('0x2')](_0x5c02('0x3'),_0x2b9a23?_0x2b9a23[_0x5c02('0x4')](''):[]);},'get':function(){return this[_0x5c02('0x5')]('options')?this['getDataValue'](_0x5c02('0x3'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x5c02('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5c02('0x1')]},'description':{'type':Sequelize[_0x5c02('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 6b98b6e..1c2d663 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.controller.js +++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x652a=['findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','error','params','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','update','then','destroy','get','ChanSpies','UserProfileResource','end','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include'];(function(_0x2c2020,_0x17679e){var _0x2b3d93=function(_0xd0fd2c){while(--_0xd0fd2c){_0x2c2020['push'](_0x2c2020['shift']());}};_0x2b3d93(++_0x17679e);}(_0x652a,0x1ae));var _0xa652=function(_0x2ae47a,_0x323954){_0x2ae47a=_0x2ae47a-0x0;var _0x4960cd=_0x652a[_0x2ae47a];return _0x4960cd;};'use strict';var pdf=require(_0xa652('0x0'));var emlformat=require(_0xa652('0x1'));var rimraf=require(_0xa652('0x2'));var zipdir=require(_0xa652('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa652('0x4'));var BPromise=require(_0xa652('0x5'));var Mustache=require(_0xa652('0x6'));var util=require(_0xa652('0x7'));var path=require(_0xa652('0x8'));var sox=require('sox');var csv=require(_0xa652('0x9'));var ejs=require(_0xa652('0xa'));var fs=require('fs');var _=require(_0xa652('0xb'));var squel=require(_0xa652('0xc'));var crypto=require(_0xa652('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa652('0x9'));var querystring=require(_0xa652('0xe'));var Papa=require(_0xa652('0xf'));var Redis=require(_0xa652('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa652('0x11'));var hardwareService=require(_0xa652('0x12'));var logger=require(_0xa652('0x13'))(_0xa652('0x14'));var utils=require(_0xa652('0x15'));var config=require(_0xa652('0x16'));var db=require(_0xa652('0x17'))['db'];function respondWithStatusCode(_0x30c51d,_0x229735){_0x229735=_0x229735||0xcc;return function(_0x2aba11){if(_0x2aba11){return _0x30c51d[_0xa652('0x18')](_0x229735);}return _0x30c51d[_0xa652('0x19')](_0x229735)['end']();};}function respondWithResult(_0xfc407b,_0x537c68){_0x537c68=_0x537c68||0xc8;return function(_0x13cfd4){if(_0x13cfd4){return _0xfc407b[_0xa652('0x19')](_0x537c68)[_0xa652('0x1a')](_0x13cfd4);}};}function respondWithFilteredResult(_0xaec170,_0x3509d8){return function(_0x507a8a){if(_0x507a8a){var _0x144b37=_0x507a8a[_0xa652('0x1b')],_0x1d7c4c=_0x3509d8[_0xa652('0x1c')],_0x334bc4=_0x3509d8[_0xa652('0x1c')]+_0x3509d8['limit'],_0x46d9b7;if(_0x334bc4>=_0x144b37){_0x334bc4=_0x144b37;_0x46d9b7=0xc8;}else{_0x46d9b7=0xce;}_0xaec170[_0xa652('0x19')](_0x46d9b7);return _0xaec170[_0xa652('0x1d')](_0xa652('0x1e'),_0x1d7c4c+'-'+_0x334bc4+'/'+_0x144b37)[_0xa652('0x1a')](_0x507a8a);}return null;};}function patchUpdates(_0x265be9){return function(_0x51c9b8){try{jsonpatch['apply'](_0x51c9b8,_0x265be9,!![]);}catch(_0x766b59){return BPromise[_0xa652('0x1f')](_0x766b59);}return _0x51c9b8['save']();};}function saveUpdates(_0x31bd18,_0x2360f8){return function(_0x3a6323){if(_0x3a6323){return _0x3a6323[_0xa652('0x20')](_0x31bd18)[_0xa652('0x21')](function(_0x19bb05){return _0x19bb05;});}return null;};}function removeEntity(_0x572bcb,_0x369700){return function(_0x298d87){if(_0x298d87){return _0x298d87[_0xa652('0x22')]()['then'](function(){var _0x47e74b=_0x298d87[_0xa652('0x23')]({'plain':!![]});var _0x18d09b=_0xa652('0x24');return db[_0xa652('0x25')][_0xa652('0x22')]({'where':{'type':_0x18d09b,'resourceId':_0x47e74b['id']}})['then'](function(){return _0x298d87;});})[_0xa652('0x21')](function(){_0x572bcb[_0xa652('0x19')](0xcc)[_0xa652('0x26')]();});}};}function handleEntityNotFound(_0x5d647e,_0x4fe328){return function(_0x593883){if(!_0x593883){_0x5d647e['sendStatus'](0x194);}return _0x593883;};}function handleError(_0x5071da,_0x4e908f){_0x4e908f=_0x4e908f||0x1f4;return function(_0x3a856b){logger['error'](_0x3a856b[_0xa652('0x27')]);if(_0x3a856b[_0xa652('0x28')]){delete _0x3a856b['name'];}_0x5071da[_0xa652('0x19')](_0x4e908f)[_0xa652('0x29')](_0x3a856b);};}exports[_0xa652('0x2a')]=function(_0x21d6e3,_0xe9931){var _0x18e9cf={},_0x1fd1c7={},_0x2da108={'count':0x0,'rows':[]};var _0x44c308=_[_0xa652('0x2b')](db[_0xa652('0x2c')]['rawAttributes'],function(_0x17a99e){return{'name':_0x17a99e[_0xa652('0x2d')],'type':_0x17a99e[_0xa652('0x2e')][_0xa652('0x2f')]};});_0x1fd1c7['model']=_[_0xa652('0x2b')](_0x44c308,'name');_0x1fd1c7[_0xa652('0x30')]=_[_0xa652('0x31')](_0x21d6e3[_0xa652('0x30')]);_0x1fd1c7[_0xa652('0x32')]=_[_0xa652('0x33')](_0x1fd1c7['model'],_0x1fd1c7[_0xa652('0x30')]);_0x18e9cf[_0xa652('0x34')]=_[_0xa652('0x33')](_0x1fd1c7['model'],qs[_0xa652('0x35')](_0x21d6e3[_0xa652('0x30')]['fields']));_0x18e9cf[_0xa652('0x34')]=_0x18e9cf[_0xa652('0x34')][_0xa652('0x36')]?_0x18e9cf[_0xa652('0x34')]:_0x1fd1c7[_0xa652('0x37')];if(!_0x21d6e3[_0xa652('0x30')][_0xa652('0x38')](_0xa652('0x39'))){_0x18e9cf[_0xa652('0x3a')]=qs['limit'](_0x21d6e3[_0xa652('0x30')]['limit']);_0x18e9cf[_0xa652('0x1c')]=qs[_0xa652('0x1c')](_0x21d6e3[_0xa652('0x30')][_0xa652('0x1c')]);}_0x18e9cf[_0xa652('0x3b')]=qs['sort'](_0x21d6e3[_0xa652('0x30')][_0xa652('0x3c')]);_0x18e9cf[_0xa652('0x3d')]=qs[_0xa652('0x32')](_[_0xa652('0x3e')](_0x21d6e3[_0xa652('0x30')],_0x1fd1c7[_0xa652('0x32')]));if(_0x21d6e3[_0xa652('0x30')][_0xa652('0x3f')]){_0x18e9cf[_0xa652('0x3d')]=_[_0xa652('0x40')](_0x18e9cf['where'],{'$or':_[_0xa652('0x2b')](_0x44c308,function(_0x16a6b5){if(_0x16a6b5['type']!==_0xa652('0x41')){var _0x448470={};_0x448470[_0x16a6b5[_0xa652('0x28')]]={'$like':'%'+_0x21d6e3[_0xa652('0x30')]['filter']+'%'};return _0x448470;}})});}_0x18e9cf=_[_0xa652('0x40')]({},_0x18e9cf,_0x21d6e3[_0xa652('0x42')]);var _0x38e324={'where':_0x18e9cf['where']};return db[_0xa652('0x2c')]['count'](_0x38e324)[_0xa652('0x21')](function(_0x33c051){_0x2da108[_0xa652('0x1b')]=_0x33c051;if(_0x21d6e3[_0xa652('0x30')]['includeAll']){_0x18e9cf[_0xa652('0x43')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xa652('0x44')](_0x18e9cf);})[_0xa652('0x21')](function(_0x4a5f05){_0x2da108[_0xa652('0x45')]=_0x4a5f05;return _0x2da108;})[_0xa652('0x21')](respondWithFilteredResult(_0xe9931,_0x18e9cf))[_0xa652('0x46')](handleError(_0xe9931,null));};exports[_0xa652('0x47')]=function(_0x329b8d,_0x1cc822){var _0x22b01c={'raw':![],'where':{'id':_0x329b8d['params']['id']}},_0x1e0243={};_0x1e0243[_0xa652('0x37')]=_[_0xa652('0x31')](db[_0xa652('0x2c')][_0xa652('0x48')]);_0x1e0243[_0xa652('0x30')]=_[_0xa652('0x31')](_0x329b8d[_0xa652('0x30')]);_0x1e0243['filters']=_[_0xa652('0x33')](_0x1e0243[_0xa652('0x37')],_0x1e0243[_0xa652('0x30')]);_0x22b01c[_0xa652('0x34')]=_[_0xa652('0x33')](_0x1e0243[_0xa652('0x37')],qs[_0xa652('0x35')](_0x329b8d[_0xa652('0x30')][_0xa652('0x35')]));_0x22b01c[_0xa652('0x34')]=_0x22b01c[_0xa652('0x34')][_0xa652('0x36')]?_0x22b01c[_0xa652('0x34')]:_0x1e0243['model'];if(_0x329b8d[_0xa652('0x30')][_0xa652('0x49')]){_0x22b01c['include']=[{'all':!![]}];}_0x22b01c=_['merge']({},_0x22b01c,_0x329b8d[_0xa652('0x42')]);return db[_0xa652('0x2c')][_0xa652('0x4a')](_0x22b01c)['then'](handleEntityNotFound(_0x1cc822,null))[_0xa652('0x21')](respondWithResult(_0x1cc822,null))[_0xa652('0x46')](handleError(_0x1cc822,null));};exports[_0xa652('0x4b')]=function(_0x189dd2,_0x426a9b){return db[_0xa652('0x2c')][_0xa652('0x4b')](_0x189dd2[_0xa652('0x4c')],{})[_0xa652('0x21')](function(_0x2c046e){var _0x39bd2e=_0x189dd2['user'][_0xa652('0x23')]({'plain':!![]});if(!_0x39bd2e)throw new Error(_0xa652('0x4d'));if(_0x39bd2e['role']===_0xa652('0x4e')){var _0x1ed71f=_0x2c046e[_0xa652('0x23')]({'plain':!![]});var _0x4e13c8='ChanSpies';return db[_0xa652('0x4f')][_0xa652('0x4a')]({'where':{'name':_0x4e13c8,'userProfileId':_0x39bd2e['userProfileId']},'raw':!![]})[_0xa652('0x21')](function(_0x245ecb){if(_0x245ecb&&_0x245ecb[_0xa652('0x50')]===0x0){return db[_0xa652('0x25')][_0xa652('0x4b')]({'name':_0x1ed71f[_0xa652('0x28')],'resourceId':_0x1ed71f['id'],'type':_0x245ecb[_0xa652('0x28')],'sectionId':_0x245ecb['id']},{})['then'](function(){return _0x2c046e;});}else{return _0x2c046e;}})['catch'](function(_0x1d4706){logger[_0xa652('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d4706);throw _0x1d4706;});}return _0x2c046e;})[_0xa652('0x21')](respondWithResult(_0x426a9b,0xc9))[_0xa652('0x46')](handleError(_0x426a9b,null));};exports[_0xa652('0x20')]=function(_0x210d02,_0x55c5b5){if(_0x210d02[_0xa652('0x4c')]['id']){delete _0x210d02[_0xa652('0x4c')]['id'];}return db[_0xa652('0x2c')]['find']({'where':{'id':_0x210d02[_0xa652('0x52')]['id']}})[_0xa652('0x21')](handleEntityNotFound(_0x55c5b5,null))[_0xa652('0x21')](saveUpdates(_0x210d02['body'],null))[_0xa652('0x21')](respondWithResult(_0x55c5b5,null))[_0xa652('0x46')](handleError(_0x55c5b5,null));};exports[_0xa652('0x22')]=function(_0x884c1a,_0x27d47d){return db[_0xa652('0x2c')]['find']({'where':{'id':_0x884c1a[_0xa652('0x52')]['id']}})[_0xa652('0x21')](handleEntityNotFound(_0x27d47d,null))[_0xa652('0x21')](removeEntity(_0x27d47d,null))[_0xa652('0x46')](handleError(_0x27d47d,null));}; \ No newline at end of file +var _0x66e8=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','pick','filter','where','merge','options','includeAll','include','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','jsforce','desk.js'];(function(_0x37be14,_0x3d78de){var _0x4a089e=function(_0x4d3c88){while(--_0x4d3c88){_0x37be14['push'](_0x37be14['shift']());}};_0x4a089e(++_0x3d78de);}(_0x66e8,0x129));var _0x866e=function(_0x8ad31b,_0x339d77){_0x8ad31b=_0x8ad31b-0x0;var _0x5f1545=_0x66e8[_0x8ad31b];return _0x5f1545;};'use strict';var pdf=require(_0x866e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x866e('0x1'));var jsonpatch=require(_0x866e('0x2'));var rp=require(_0x866e('0x3'));var moment=require(_0x866e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x866e('0x5'));var util=require(_0x866e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x866e('0x7'));var fs=require('fs');var _=require(_0x866e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x866e('0x9'));var deskjs=require(_0x866e('0xa'));var toCsv=require(_0x866e('0xb'));var querystring=require(_0x866e('0xc'));var Papa=require(_0x866e('0xd'));var Redis=require(_0x866e('0xe'));var authService=require(_0x866e('0xf'));var qs=require(_0x866e('0x10'));var as=require(_0x866e('0x11'));var hardwareService=require(_0x866e('0x12'));var logger=require(_0x866e('0x13'))(_0x866e('0x14'));var utils=require(_0x866e('0x15'));var config=require(_0x866e('0x16'));var db=require(_0x866e('0x17'))['db'];function respondWithStatusCode(_0x26a796,_0x5b659e){_0x5b659e=_0x5b659e||0xcc;return function(_0x51881c){if(_0x51881c){return _0x26a796['sendStatus'](_0x5b659e);}return _0x26a796[_0x866e('0x18')](_0x5b659e)[_0x866e('0x19')]();};}function respondWithResult(_0x25c65e,_0x312942){_0x312942=_0x312942||0xc8;return function(_0x3fd366){if(_0x3fd366){return _0x25c65e[_0x866e('0x18')](_0x312942)[_0x866e('0x1a')](_0x3fd366);}};}function respondWithFilteredResult(_0x547c1e,_0x525b28){return function(_0x232762){if(_0x232762){var _0x69ee91=_0x232762['count'],_0x2ae6aa=_0x525b28[_0x866e('0x1b')],_0x3f3ecb=_0x525b28[_0x866e('0x1b')]+_0x525b28['limit'],_0xf563ef;if(_0x3f3ecb>=_0x69ee91){_0x3f3ecb=_0x69ee91;_0xf563ef=0xc8;}else{_0xf563ef=0xce;}_0x547c1e[_0x866e('0x18')](_0xf563ef);return _0x547c1e[_0x866e('0x1c')]('Content-Range',_0x2ae6aa+'-'+_0x3f3ecb+'/'+_0x69ee91)[_0x866e('0x1a')](_0x232762);}return null;};}function patchUpdates(_0xd787fc){return function(_0x392f53){try{jsonpatch[_0x866e('0x1d')](_0x392f53,_0xd787fc,!![]);}catch(_0x5e3c7a){return BPromise[_0x866e('0x1e')](_0x5e3c7a);}return _0x392f53[_0x866e('0x1f')]();};}function saveUpdates(_0x4329e0,_0xc23f26){return function(_0x1d6ade){if(_0x1d6ade){return _0x1d6ade[_0x866e('0x20')](_0x4329e0)[_0x866e('0x21')](function(_0xc7e350){return _0xc7e350;});}return null;};}function removeEntity(_0x4822db,_0x56098e){return function(_0x1f7f1e){if(_0x1f7f1e){return _0x1f7f1e[_0x866e('0x22')]()[_0x866e('0x21')](function(){var _0x1312fd=_0x1f7f1e[_0x866e('0x23')]({'plain':!![]});var _0x800319='ChanSpies';return db[_0x866e('0x24')][_0x866e('0x22')]({'where':{'type':_0x800319,'resourceId':_0x1312fd['id']}})[_0x866e('0x21')](function(){return _0x1f7f1e;});})[_0x866e('0x21')](function(){_0x4822db[_0x866e('0x18')](0xcc)[_0x866e('0x19')]();});}};}function handleEntityNotFound(_0x319ad4,_0x132518){return function(_0x9dfc18){if(!_0x9dfc18){_0x319ad4[_0x866e('0x25')](0x194);}return _0x9dfc18;};}function handleError(_0x4ebe81,_0x20cdc9){_0x20cdc9=_0x20cdc9||0x1f4;return function(_0x16e302){logger[_0x866e('0x26')](_0x16e302[_0x866e('0x27')]);if(_0x16e302[_0x866e('0x28')]){delete _0x16e302[_0x866e('0x28')];}_0x4ebe81['status'](_0x20cdc9)[_0x866e('0x29')](_0x16e302);};}exports[_0x866e('0x2a')]=function(_0x52ec11,_0x598b0b){var _0xfb0b47={},_0x597a69={},_0x443781={'count':0x0,'rows':[]};var _0x5cf79f=_['map'](db[_0x866e('0x2b')][_0x866e('0x2c')],function(_0x5e0817){return{'name':_0x5e0817[_0x866e('0x2d')],'type':_0x5e0817[_0x866e('0x2e')][_0x866e('0x2f')]};});_0x597a69[_0x866e('0x30')]=_[_0x866e('0x31')](_0x5cf79f,'name');_0x597a69[_0x866e('0x32')]=_[_0x866e('0x33')](_0x52ec11['query']);_0x597a69[_0x866e('0x34')]=_[_0x866e('0x35')](_0x597a69[_0x866e('0x30')],_0x597a69[_0x866e('0x32')]);_0xfb0b47[_0x866e('0x36')]=_[_0x866e('0x35')](_0x597a69[_0x866e('0x30')],qs[_0x866e('0x37')](_0x52ec11['query'][_0x866e('0x37')]));_0xfb0b47[_0x866e('0x36')]=_0xfb0b47[_0x866e('0x36')][_0x866e('0x38')]?_0xfb0b47['attributes']:_0x597a69[_0x866e('0x30')];if(!_0x52ec11[_0x866e('0x32')]['hasOwnProperty']('nolimit')){_0xfb0b47['limit']=qs[_0x866e('0x39')](_0x52ec11[_0x866e('0x32')][_0x866e('0x39')]);_0xfb0b47[_0x866e('0x1b')]=qs['offset'](_0x52ec11[_0x866e('0x32')][_0x866e('0x1b')]);}_0xfb0b47[_0x866e('0x3a')]=qs[_0x866e('0x3b')](_0x52ec11[_0x866e('0x32')][_0x866e('0x3b')]);_0xfb0b47['where']=qs['filters'](_[_0x866e('0x3c')](_0x52ec11['query'],_0x597a69[_0x866e('0x34')]));if(_0x52ec11[_0x866e('0x32')][_0x866e('0x3d')]){_0xfb0b47[_0x866e('0x3e')]=_[_0x866e('0x3f')](_0xfb0b47[_0x866e('0x3e')],{'$or':_[_0x866e('0x31')](_0x5cf79f,function(_0x179027){if(_0x179027[_0x866e('0x2e')]!=='VIRTUAL'){var _0xc8d009={};_0xc8d009[_0x179027[_0x866e('0x28')]]={'$like':'%'+_0x52ec11[_0x866e('0x32')]['filter']+'%'};return _0xc8d009;}})});}_0xfb0b47=_[_0x866e('0x3f')]({},_0xfb0b47,_0x52ec11[_0x866e('0x40')]);var _0x4de04e={'where':_0xfb0b47[_0x866e('0x3e')]};return db[_0x866e('0x2b')]['count'](_0x4de04e)[_0x866e('0x21')](function(_0x362bcd){_0x443781['count']=_0x362bcd;if(_0x52ec11[_0x866e('0x32')][_0x866e('0x41')]){_0xfb0b47[_0x866e('0x42')]=[{'all':!![]}];}return db[_0x866e('0x2b')]['findAll'](_0xfb0b47);})['then'](function(_0x200887){_0x443781['rows']=_0x200887;return _0x443781;})[_0x866e('0x21')](respondWithFilteredResult(_0x598b0b,_0xfb0b47))['catch'](handleError(_0x598b0b,null));};exports['show']=function(_0x3001a2,_0x1ad0a4){var _0x2dbf3f={'raw':![],'where':{'id':_0x3001a2[_0x866e('0x43')]['id']}},_0x26d734={};_0x26d734[_0x866e('0x30')]=_[_0x866e('0x33')](db[_0x866e('0x2b')][_0x866e('0x2c')]);_0x26d734['query']=_[_0x866e('0x33')](_0x3001a2['query']);_0x26d734[_0x866e('0x34')]=_[_0x866e('0x35')](_0x26d734[_0x866e('0x30')],_0x26d734['query']);_0x2dbf3f[_0x866e('0x36')]=_[_0x866e('0x35')](_0x26d734[_0x866e('0x30')],qs['fields'](_0x3001a2['query'][_0x866e('0x37')]));_0x2dbf3f['attributes']=_0x2dbf3f[_0x866e('0x36')]['length']?_0x2dbf3f['attributes']:_0x26d734['model'];if(_0x3001a2['query'][_0x866e('0x41')]){_0x2dbf3f[_0x866e('0x42')]=[{'all':!![]}];}_0x2dbf3f=_[_0x866e('0x3f')]({},_0x2dbf3f,_0x3001a2[_0x866e('0x40')]);return db[_0x866e('0x2b')][_0x866e('0x44')](_0x2dbf3f)[_0x866e('0x21')](handleEntityNotFound(_0x1ad0a4,null))[_0x866e('0x21')](respondWithResult(_0x1ad0a4,null))[_0x866e('0x45')](handleError(_0x1ad0a4,null));};exports[_0x866e('0x46')]=function(_0x32e649,_0x29dd6b){return db[_0x866e('0x2b')][_0x866e('0x46')](_0x32e649[_0x866e('0x47')],{})[_0x866e('0x21')](function(_0x4940be){var _0x266ed9=_0x32e649[_0x866e('0x48')][_0x866e('0x23')]({'plain':!![]});if(!_0x266ed9)throw new Error(_0x866e('0x49'));if(_0x266ed9['role']===_0x866e('0x48')){var _0x4d6afc=_0x4940be['get']({'plain':!![]});var _0x5b7eee=_0x866e('0x4a');return db[_0x866e('0x4b')]['find']({'where':{'name':_0x5b7eee,'userProfileId':_0x266ed9['userProfileId']},'raw':!![]})['then'](function(_0x263bb5){if(_0x263bb5&&_0x263bb5['autoAssociation']===0x0){return db[_0x866e('0x24')][_0x866e('0x46')]({'name':_0x4d6afc[_0x866e('0x28')],'resourceId':_0x4d6afc['id'],'type':_0x263bb5[_0x866e('0x28')],'sectionId':_0x263bb5['id']},{})[_0x866e('0x21')](function(){return _0x4940be;});}else{return _0x4940be;}})[_0x866e('0x45')](function(_0xaab8ce){logger[_0x866e('0x26')](_0x866e('0x4c'),_0xaab8ce);throw _0xaab8ce;});}return _0x4940be;})[_0x866e('0x21')](respondWithResult(_0x29dd6b,0xc9))[_0x866e('0x45')](handleError(_0x29dd6b,null));};exports[_0x866e('0x20')]=function(_0x377b32,_0x121656){if(_0x377b32['body']['id']){delete _0x377b32[_0x866e('0x47')]['id'];}return db[_0x866e('0x2b')][_0x866e('0x44')]({'where':{'id':_0x377b32[_0x866e('0x43')]['id']}})['then'](handleEntityNotFound(_0x121656,null))[_0x866e('0x21')](saveUpdates(_0x377b32[_0x866e('0x47')],null))[_0x866e('0x21')](respondWithResult(_0x121656,null))[_0x866e('0x45')](handleError(_0x121656,null));};exports[_0x866e('0x22')]=function(_0x45c7d9,_0x9d297e){return db[_0x866e('0x2b')][_0x866e('0x44')]({'where':{'id':_0x45c7d9[_0x866e('0x43')]['id']}})[_0x866e('0x21')](handleEntityNotFound(_0x9d297e,null))[_0x866e('0x21')](removeEntity(_0x9d297e,null))[_0x866e('0x45')](handleError(_0x9d297e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 70da71b..4b88893 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.model.js +++ b/server/api/voiceChanSpy/voiceChanSpy.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41f3=['models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','format','record','merge','MixMonitor','recordingFormat','auth','ChanSpy','SIP/%s,%s','name','StopMixMonitor','length','concat','User','findAll','internal','agent','then','catch','exports'];(function(_0x242a13,_0x16e0be){var _0x29bd71=function(_0x538af3){while(--_0x538af3){_0x242a13['push'](_0x242a13['shift']());}};_0x29bd71(++_0x16e0be);}(_0x41f3,0x15a));var _0x341f=function(_0x18ac27,_0x3a695b){_0x18ac27=_0x18ac27-0x0;var _0x288194=_0x41f3[_0x18ac27];return _0x288194;};'use strict';var _=require(_0x341f('0x0'));var util=require(_0x341f('0x1'));var BPromise=require('bluebird');var attributes=require(_0x341f('0x2'));var getUserApplications=function(_0x22a913,_0x1cb90a,_0x51150f){var _0x3c1451=0x1;var _0x16d426=[];var _0x2af122={'context':_0x1cb90a[_0x341f('0x3')]||_0x341f('0x4'),'exten':util['format'](_0x341f('0x5'),_0x22a913[_0x341f('0x6')],_0x51150f),'type':_0x341f('0x7'),'isApp':![],'ChanSpyId':_0x22a913['id'],'UserId':_0x1cb90a['id']};_0x16d426[_0x341f('0x8')](_['merge']({'app':'Set','appdata':util[_0x341f('0x9')]('CDR(type)=%s','chanspy'),'priority':_0x3c1451++},_0x2af122));if(_0x22a913[_0x341f('0xa')]){_0x16d426[_0x341f('0x8')](_[_0x341f('0xb')]({'app':_0x341f('0xc'),'appdata':util[_0x341f('0x9')]('${UNIQUEID}.%s,ab',_0x22a913[_0x341f('0xd')]),'priority':_0x3c1451++},_0x2af122));}if(_0x22a913[_0x341f('0xe')]){_0x16d426[_0x341f('0x8')](_[_0x341f('0xb')]({'app':'Authenticate','appdata':_0x22a913['password'],'priority':_0x3c1451++},_0x2af122));}_0x16d426['push'](_[_0x341f('0xb')]({'app':_0x341f('0xf'),'appdata':util[_0x341f('0x9')](_0x341f('0x10'),_0x1cb90a[_0x341f('0x11')],_0x22a913['options']?_0x22a913['options']['join'](''):''),'priority':_0x3c1451++},_0x2af122));if(_0x22a913[_0x341f('0xa')]){_0x16d426[_0x341f('0x8')](_[_0x341f('0xb')]({'app':_0x341f('0x12'),'priority':_0x3c1451++},_0x2af122));}return _0x16d426;};var getChanSpyApplications=function(_0x5090df,_0x28993e){var _0x14570c=[];for(var _0x4dcfb9=0x0,_0x1636b8=0x1;_0x4dcfb9<_0x28993e[_0x341f('0x13')];_0x4dcfb9++,_0x1636b8=0x1){_0x14570c=_0x14570c['concat'](getUserApplications(_0x5090df,_0x28993e[_0x4dcfb9],_0x28993e[_0x4dcfb9]['internal']));if(_0x28993e[_0x4dcfb9]['internal']!=_0x28993e[_0x4dcfb9][_0x341f('0x11')]){_0x14570c=_0x14570c[_0x341f('0x14')](getUserApplications(_0x5090df,_0x28993e[_0x4dcfb9],_0x28993e[_0x4dcfb9]['name']));}}return _0x14570c;};var getChanSpyPromise=function(_0x1f0f9b,_0x336e82){return new BPromise(function(_0x38c4c5,_0x1dab21){return _0x1f0f9b[_0x341f('0x15')][_0x341f('0x16')]({'attributes':['id','name',_0x341f('0x17')],'where':{'role':_0x341f('0x18'),'chanspy':!![]},'raw':!![]})[_0x341f('0x19')](function(_0x5c9772){if(_0x5c9772){return _0x38c4c5(getChanSpyApplications(_0x336e82,_0x5c9772));}return _0x38c4c5([]);})[_0x341f('0x1a')](function(_0xe7a261){_0x1dab21(_0xe7a261);});});};module[_0x341f('0x1b')]=function(_0x35e9ca,_0xfa3680){var _0x53b553=_0x35e9ca[_0x341f('0x1c')];return _0x35e9ca[_0x341f('0x1d')](_0x341f('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f16ea,_0x4aaf73,_0x1676e5){return getChanSpyPromise(_0x53b553,_0x1f16ea)[_0x341f('0x19')](function(_0x4c71a5){if(_0x4c71a5&&_0x4c71a5['length']){return _0x53b553[_0x341f('0x1f')][_0x341f('0x20')](_0x4c71a5);}})['then'](function(){_0x1676e5();})[_0x341f('0x1a')](function(_0x922b9a){_0x1676e5(_0x922b9a);});},'afterUpdate':function(_0x242e75,_0x539244,_0x3af16d){return _0x53b553['VoiceExtension'][_0x341f('0x21')]({'where':{'ChanSpyId':_0x242e75['id']}})[_0x341f('0x19')](function(){return getChanSpyPromise(_0x53b553,_0x242e75);})[_0x341f('0x19')](function(_0x3ec3d5){if(_0x3ec3d5&&_0x3ec3d5[_0x341f('0x13')]){return _0x53b553['VoiceExtension'][_0x341f('0x20')](_0x3ec3d5);}})[_0x341f('0x19')](function(){_0x3af16d();})[_0x341f('0x1a')](function(_0x12c8c0){_0x3af16d(_0x12c8c0);});},'afterDestroy':function(_0x5a11f7,_0x30c76a,_0x315ffa){return _0x53b553[_0x341f('0x1f')][_0x341f('0x21')]({'where':{'ChanSpyId':_0x5a11f7['id']}})[_0x341f('0x19')](function(){_0x315ffa();})[_0x341f('0x1a')](function(_0x441f29){_0x315ffa(_0x441f29);});}}});}; \ No newline at end of file +var _0x8963=['define','VoiceChanSpy','voice_chanspy','then','length','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','internal','concat','findAll','agent','catch','exports','models'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x8963,0x1dc));var _0x3896=function(_0x58d84c,_0x3653e1){_0x58d84c=_0x58d84c-0x0;var _0x4499f2=_0x8963[_0x58d84c];return _0x4499f2;};'use strict';var _=require(_0x3896('0x0'));var util=require('util');var BPromise=require(_0x3896('0x1'));var attributes=require(_0x3896('0x2'));var getUserApplications=function(_0x39627d,_0x183b91,_0x25ab31){var _0x541e8f=0x1;var _0x4823f5=[];var _0x38d48b={'context':_0x183b91[_0x3896('0x3')]||_0x3896('0x4'),'exten':util[_0x3896('0x5')](_0x3896('0x6'),_0x39627d['prefix'],_0x25ab31),'type':_0x3896('0x7'),'isApp':![],'ChanSpyId':_0x39627d['id'],'UserId':_0x183b91['id']};_0x4823f5[_0x3896('0x8')](_[_0x3896('0x9')]({'app':'Set','appdata':util['format'](_0x3896('0xa'),_0x3896('0xb')),'priority':_0x541e8f++},_0x38d48b));if(_0x39627d[_0x3896('0xc')]){_0x4823f5[_0x3896('0x8')](_[_0x3896('0x9')]({'app':_0x3896('0xd'),'appdata':util[_0x3896('0x5')](_0x3896('0xe'),_0x39627d[_0x3896('0xf')]),'priority':_0x541e8f++},_0x38d48b));}if(_0x39627d[_0x3896('0x10')]){_0x4823f5[_0x3896('0x8')](_[_0x3896('0x9')]({'app':_0x3896('0x11'),'appdata':_0x39627d[_0x3896('0x12')],'priority':_0x541e8f++},_0x38d48b));}_0x4823f5[_0x3896('0x8')](_[_0x3896('0x9')]({'app':_0x3896('0x13'),'appdata':util['format'](_0x3896('0x14'),_0x183b91[_0x3896('0x15')],_0x39627d[_0x3896('0x16')]?_0x39627d['options'][_0x3896('0x17')](''):''),'priority':_0x541e8f++},_0x38d48b));if(_0x39627d['record']){_0x4823f5['push'](_[_0x3896('0x9')]({'app':'StopMixMonitor','priority':_0x541e8f++},_0x38d48b));}return _0x4823f5;};var getChanSpyApplications=function(_0x31a01c,_0x2258e7){var _0x8a5849=[];for(var _0x534990=0x0,_0x151f6e=0x1;_0x534990<_0x2258e7['length'];_0x534990++,_0x151f6e=0x1){_0x8a5849=_0x8a5849['concat'](getUserApplications(_0x31a01c,_0x2258e7[_0x534990],_0x2258e7[_0x534990]['internal']));if(_0x2258e7[_0x534990][_0x3896('0x18')]!=_0x2258e7[_0x534990][_0x3896('0x15')]){_0x8a5849=_0x8a5849[_0x3896('0x19')](getUserApplications(_0x31a01c,_0x2258e7[_0x534990],_0x2258e7[_0x534990]['name']));}}return _0x8a5849;};var getChanSpyPromise=function(_0x15e00a,_0xd5d87){return new BPromise(function(_0x304d75,_0x121886){return _0x15e00a['User'][_0x3896('0x1a')]({'attributes':['id',_0x3896('0x15'),_0x3896('0x18')],'where':{'role':_0x3896('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x471cd4){if(_0x471cd4){return _0x304d75(getChanSpyApplications(_0xd5d87,_0x471cd4));}return _0x304d75([]);})[_0x3896('0x1c')](function(_0x2ef314){_0x121886(_0x2ef314);});});};module[_0x3896('0x1d')]=function(_0x1289cd,_0x11e037){var _0x17f38a=_0x1289cd[_0x3896('0x1e')];return _0x1289cd[_0x3896('0x1f')](_0x3896('0x20'),attributes,{'tableName':_0x3896('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x231659,_0x1cb887,_0x147366){return getChanSpyPromise(_0x17f38a,_0x231659)[_0x3896('0x22')](function(_0x296765){if(_0x296765&&_0x296765[_0x3896('0x23')]){return _0x17f38a[_0x3896('0x24')]['bulkCreate'](_0x296765);}})[_0x3896('0x22')](function(){_0x147366();})['catch'](function(_0x5b3a97){_0x147366(_0x5b3a97);});},'afterUpdate':function(_0x2e4115,_0x1ebf73,_0x266b8a){return _0x17f38a[_0x3896('0x24')]['destroy']({'where':{'ChanSpyId':_0x2e4115['id']}})[_0x3896('0x22')](function(){return getChanSpyPromise(_0x17f38a,_0x2e4115);})[_0x3896('0x22')](function(_0x5eff76){if(_0x5eff76&&_0x5eff76[_0x3896('0x23')]){return _0x17f38a[_0x3896('0x24')][_0x3896('0x25')](_0x5eff76);}})[_0x3896('0x22')](function(){_0x266b8a();})[_0x3896('0x1c')](function(_0x40cda4){_0x266b8a(_0x40cda4);});},'afterDestroy':function(_0x424e3b,_0x1c522f,_0x182fc6){return _0x17f38a[_0x3896('0x24')][_0x3896('0x26')]({'where':{'ChanSpyId':_0x424e3b['id']}})[_0x3896('0x22')](function(){_0x182fc6();})[_0x3896('0x1c')](function(_0x470a0b){_0x182fc6(_0x470a0b);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b00e473..83f6070 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff83=['request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s'];(function(_0xa38cf2,_0x13e769){var _0x1c9a57=function(_0x3fdbd5){while(--_0x3fdbd5){_0xa38cf2['push'](_0xa38cf2['shift']());}};_0x1c9a57(++_0x13e769);}(_0xff83,0x127));var _0x3ff8=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xff83[_0x521929];return _0x632436;};'use strict';var _=require(_0x3ff8('0x0'));var util=require(_0x3ff8('0x1'));var moment=require(_0x3ff8('0x2'));var BPromise=require(_0x3ff8('0x3'));var rs=require(_0x3ff8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ff8('0x5'))['db'];var utils=require(_0x3ff8('0x6'));var logger=require(_0x3ff8('0x7'))(_0x3ff8('0x8'));var config=require(_0x3ff8('0x9'));var jayson=require(_0x3ff8('0xa'));var client=jayson[_0x3ff8('0xb')][_0x3ff8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ef81d,_0x1565bf,_0x26fd8f){return new BPromise(function(_0xe91acd,_0x116f63){return client[_0x3ff8('0xd')](_0x2ef81d,_0x26fd8f)[_0x3ff8('0xe')](function(_0x533c46){logger[_0x3ff8('0xf')](_0x3ff8('0x10'),_0x1565bf,_0x3ff8('0x11'));logger['debug'](_0x3ff8('0x12'),_0x1565bf,_0x3ff8('0x11'),JSON['stringify'](_0x533c46));if(_0x533c46[_0x3ff8('0x13')]){if(_0x533c46[_0x3ff8('0x13')][_0x3ff8('0x14')]===0x1f4){logger[_0x3ff8('0x13')](_0x3ff8('0x10'),_0x1565bf,_0x533c46[_0x3ff8('0x13')][_0x3ff8('0x15')]);return _0x116f63(_0x533c46[_0x3ff8('0x13')]['message']);}logger[_0x3ff8('0x13')](_0x3ff8('0x10'),_0x1565bf,_0x533c46['error'][_0x3ff8('0x15')]);return _0xe91acd(_0x533c46[_0x3ff8('0x13')]['message']);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x1565bf,_0x3ff8('0x11'));_0xe91acd(_0x533c46[_0x3ff8('0x16')][_0x3ff8('0x15')]);}})[_0x3ff8('0x17')](function(_0x57b84d){logger[_0x3ff8('0x13')](_0x3ff8('0x10'),_0x1565bf,_0x57b84d);_0x116f63(_0x57b84d);});});} \ No newline at end of file +var _0xb2a1=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4d2c26,_0x2701f9){var _0x5bf9b4=function(_0x52edc6){while(--_0x52edc6){_0x4d2c26['push'](_0x4d2c26['shift']());}};_0x5bf9b4(++_0x2701f9);}(_0xb2a1,0x8f));var _0x1b2a=function(_0x21f106,_0x4ca67f){_0x21f106=_0x21f106-0x0;var _0x34cbaf=_0xb2a1[_0x21f106];return _0x34cbaf;};'use strict';var _=require(_0x1b2a('0x0'));var util=require(_0x1b2a('0x1'));var moment=require(_0x1b2a('0x2'));var BPromise=require(_0x1b2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b2a('0x4'));var db=require(_0x1b2a('0x5'))['db'];var utils=require(_0x1b2a('0x6'));var logger=require(_0x1b2a('0x7'))(_0x1b2a('0x8'));var config=require(_0x1b2a('0x9'));var jayson=require(_0x1b2a('0xa'));var client=jayson[_0x1b2a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4da745,_0x9ccb91,_0x580a37){return new BPromise(function(_0x4444fa,_0x5c30df){return client[_0x1b2a('0xc')](_0x4da745,_0x580a37)[_0x1b2a('0xd')](function(_0x4040d0){logger[_0x1b2a('0xe')](_0x1b2a('0xf'),_0x9ccb91,_0x1b2a('0x10'));logger[_0x1b2a('0x11')](_0x1b2a('0x12'),_0x9ccb91,_0x1b2a('0x10'),JSON[_0x1b2a('0x13')](_0x4040d0));if(_0x4040d0[_0x1b2a('0x14')]){if(_0x4040d0[_0x1b2a('0x14')]['code']===0x1f4){logger[_0x1b2a('0x14')](_0x1b2a('0xf'),_0x9ccb91,_0x4040d0[_0x1b2a('0x14')]['message']);return _0x5c30df(_0x4040d0[_0x1b2a('0x14')][_0x1b2a('0x15')]);}logger[_0x1b2a('0x14')](_0x1b2a('0xf'),_0x9ccb91,_0x4040d0[_0x1b2a('0x14')]['message']);return _0x4444fa(_0x4040d0['error'][_0x1b2a('0x15')]);}else{logger[_0x1b2a('0xe')](_0x1b2a('0xf'),_0x9ccb91,'request\x20sent');_0x4444fa(_0x4040d0['result'][_0x1b2a('0x15')]);}})[_0x1b2a('0x16')](function(_0x32dbb3){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x9ccb91,_0x32dbb3);_0x5c30df(_0x32dbb3);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 0c8fa8e..053bcf0 100644 --- a/server/api/voiceContext/index.js +++ b/server/api/voiceContext/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcffa=['put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','post','create'];(function(_0x4578e7,_0x1c72a2){var _0x3db768=function(_0x58a4ed){while(--_0x58a4ed){_0x4578e7['push'](_0x4578e7['shift']());}};_0x3db768(++_0x1c72a2);}(_0xcffa,0x189));var _0xacff=function(_0x2a3c94,_0x2060bf){_0x2a3c94=_0x2a3c94-0x0;var _0x546fd0=_0xcffa[_0x2a3c94];return _0x546fd0;};'use strict';var multer=require('multer');var util=require(_0xacff('0x0'));var path=require('path');var timeout=require(_0xacff('0x1'));var express=require(_0xacff('0x2'));var router=express[_0xacff('0x3')]();var auth=require(_0xacff('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xacff('0x5'));var controller=require(_0xacff('0x6'));router[_0xacff('0x7')]('/',auth[_0xacff('0x8')](),controller[_0xacff('0x9')]);router[_0xacff('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xacff('0xa')]('/',auth[_0xacff('0x8')](),controller[_0xacff('0xb')]);router[_0xacff('0xc')]('/:id',auth[_0xacff('0x8')](),controller['update']);router[_0xacff('0xd')]('/:id',auth[_0xacff('0x8')](),controller['destroy']);module[_0xacff('0xe')]=router; \ No newline at end of file +var _0x57a4=['post','create','put','/:id','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show'];(function(_0x28bd75,_0x59feb3){var _0x3e5d8d=function(_0x12929a){while(--_0x12929a){_0x28bd75['push'](_0x28bd75['shift']());}};_0x3e5d8d(++_0x59feb3);}(_0x57a4,0x1f2));var _0x457a=function(_0x3e85e7,_0x47810e){_0x3e85e7=_0x3e85e7-0x0;var _0x5a0c08=_0x57a4[_0x3e85e7];return _0x5a0c08;};'use strict';var multer=require(_0x457a('0x0'));var util=require(_0x457a('0x1'));var path=require('path');var timeout=require(_0x457a('0x2'));var express=require(_0x457a('0x3'));var router=express[_0x457a('0x4')]();var auth=require(_0x457a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x457a('0x6'));var controller=require(_0x457a('0x7'));router[_0x457a('0x8')]('/',auth[_0x457a('0x9')](),controller[_0x457a('0xa')]);router[_0x457a('0x8')]('/:id',auth[_0x457a('0x9')](),controller[_0x457a('0xb')]);router[_0x457a('0xc')]('/',auth[_0x457a('0x9')](),controller[_0x457a('0xd')]);router[_0x457a('0xe')](_0x457a('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x457a('0x10')](_0x457a('0xf'),auth[_0x457a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index f659f7d..9dc8c2a 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['name','sequelize','STRING'];(function(_0x130039,_0x2e15db){var _0x13ce4b=function(_0x1f999a){while(--_0x1f999a){_0x130039['push'](_0x130039['shift']());}};_0x13ce4b(++_0x2e15db);}(_0x3e74,0x175));var _0x43e7=function(_0x5e693a,_0xdd067e){_0x5e693a=_0x5e693a-0x0;var _0x93bd28=_0x3e74[_0x5e693a];return _0x93bd28;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x43a54c,_0x113ed3){var _0x5dd703=function(_0x3b57fb){while(--_0x3b57fb){_0x43a54c['push'](_0x43a54c['shift']());}};_0x5dd703(++_0x113ed3);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 6f4679c..47405eb 100644 --- a/server/api/voiceContext/voiceContext.controller.js +++ b/server/api/voiceContext/voiceContext.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fb1=['send','map','VoiceContext','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readFileSync','chan_sip.so','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','code','error','message','result','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','get','Contexts','UserProfileResource','stack','name'];(function(_0x1a809b,_0x4c15e3){var _0x5d90e6=function(_0x5dd2e1){while(--_0x5dd2e1){_0x1a809b['push'](_0x1a809b['shift']());}};_0x5d90e6(++_0x4c15e3);}(_0x7fb1,0x9a));var _0x17fb=function(_0x5b14d7,_0x10b373){_0x5b14d7=_0x5b14d7-0x0;var _0x1eb341=_0x7fb1[_0x5b14d7];return _0x1eb341;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x17fb('0x0'));var rimraf=require(_0x17fb('0x1'));var zipdir=require(_0x17fb('0x2'));var jsonpatch=require(_0x17fb('0x3'));var rp=require(_0x17fb('0x4'));var moment=require(_0x17fb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x17fb('0x6'));var util=require(_0x17fb('0x7'));var path=require(_0x17fb('0x8'));var sox=require('sox');var csv=require(_0x17fb('0x9'));var ejs=require(_0x17fb('0xa'));var fs=require('fs');var _=require(_0x17fb('0xb'));var squel=require('squel');var crypto=require(_0x17fb('0xc'));var jsforce=require(_0x17fb('0xd'));var deskjs=require(_0x17fb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x17fb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x17fb('0x10'));var hardwareService=require(_0x17fb('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x17fb('0x12'));var config=require(_0x17fb('0x13'));var db=require(_0x17fb('0x14'))['db'];var jayson=require(_0x17fb('0x15'));var client=jayson[_0x17fb('0x16')][_0x17fb('0x17')]({'port':0x232a});function checkPasswordPattern(_0x30a8af,_0x58aa72,_0x52c046){if(_0x52c046){var _0x6101bb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6101bb[_0x17fb('0x18')](_0x58aa72)){return _0x30a8af;}else{throw new db[(_0x17fb('0x19'))]['ValidationError'](_0x17fb('0x1a'));}}else{return _0x30a8af;}}function respondWithRpcPromise(_0x294469,_0x2027cc,_0x3484d8,_0x53cda6){return new BPromise(function(_0x64aced,_0x435f66){var _0x3e933f=_0x53cda6||client;return _0x3e933f[_0x17fb('0x1b')](_0x294469,_0x3484d8)[_0x17fb('0x1c')](function(_0x4a17b0){logger[_0x17fb('0x1d')](_0x17fb('0x1e'),_0x2027cc,_0x17fb('0x1f'));logger['debug'](_0x17fb('0x20'),_0x2027cc,_0x17fb('0x1f'),JSON['stringify'](_0x4a17b0));if(_0x4a17b0['error']){if(_0x4a17b0['error'][_0x17fb('0x21')]===0x1f4){logger[_0x17fb('0x22')](_0x17fb('0x1e'),_0x2027cc,_0x4a17b0[_0x17fb('0x22')][_0x17fb('0x23')]);return _0x435f66(_0x4a17b0[_0x17fb('0x22')][_0x17fb('0x23')]);}logger[_0x17fb('0x22')]('VoiceContext,\x20%s,\x20%s',_0x2027cc,_0x4a17b0[_0x17fb('0x22')][_0x17fb('0x23')]);return _0x64aced(_0x4a17b0[_0x17fb('0x22')][_0x17fb('0x23')]);}else{logger['info'](_0x17fb('0x1e'),_0x2027cc,'request\x20sent');_0x64aced(_0x4a17b0[_0x17fb('0x24')]['message']);}})['catch'](function(_0x1abbcb){logger[_0x17fb('0x22')](_0x17fb('0x1e'),_0x2027cc,_0x1abbcb);_0x435f66(_0x1abbcb);});});}function respondWithStatusCode(_0x13e03f,_0x9d8ed8){_0x9d8ed8=_0x9d8ed8||0xcc;return function(_0x1446b8){if(_0x1446b8){return _0x13e03f[_0x17fb('0x25')](_0x9d8ed8);}return _0x13e03f[_0x17fb('0x26')](_0x9d8ed8)[_0x17fb('0x27')]();};}function respondWithResult(_0x48b2cb,_0x55aa4c){_0x55aa4c=_0x55aa4c||0xc8;return function(_0x4c8f51){if(_0x4c8f51){return _0x48b2cb[_0x17fb('0x26')](_0x55aa4c)[_0x17fb('0x28')](_0x4c8f51);}};}function respondWithFilteredResult(_0x51997a,_0x5ba9a2){return function(_0x26324b){if(_0x26324b){var _0xc651b2=_0x26324b[_0x17fb('0x29')],_0x215f42=_0x5ba9a2[_0x17fb('0x2a')],_0x334d73=_0x5ba9a2[_0x17fb('0x2a')]+_0x5ba9a2['limit'],_0x2db69e;if(_0x334d73>=_0xc651b2){_0x334d73=_0xc651b2;_0x2db69e=0xc8;}else{_0x2db69e=0xce;}_0x51997a[_0x17fb('0x26')](_0x2db69e);return _0x51997a['set'](_0x17fb('0x2b'),_0x215f42+'-'+_0x334d73+'/'+_0xc651b2)['json'](_0x26324b);}return null;};}function patchUpdates(_0xecbb1c){return function(_0x2b554e){try{jsonpatch['apply'](_0x2b554e,_0xecbb1c,!![]);}catch(_0x221e49){return BPromise[_0x17fb('0x2c')](_0x221e49);}return _0x2b554e[_0x17fb('0x2d')]();};}function saveUpdates(_0x2243ae,_0x20ea7a){return function(_0x4f04f2){if(_0x4f04f2){return _0x4f04f2[_0x17fb('0x2e')](_0x2243ae)[_0x17fb('0x1c')](function(_0x200f40){return _0x200f40;});}return null;};}function removeEntity(_0x4d952f,_0x278fb7){return function(_0x1211a4){if(_0x1211a4){return _0x1211a4['destroy']()[_0x17fb('0x1c')](function(){var _0x39531e=_0x1211a4[_0x17fb('0x2f')]({'plain':!![]});var _0x596076=_0x17fb('0x30');return db[_0x17fb('0x31')]['destroy']({'where':{'type':_0x596076,'resourceId':_0x39531e['id']}})[_0x17fb('0x1c')](function(){return _0x1211a4;});})['then'](function(){_0x4d952f['status'](0xcc)[_0x17fb('0x27')]();});}};}function handleEntityNotFound(_0x241655,_0x3b00f2){return function(_0x4d6e02){if(!_0x4d6e02){_0x241655[_0x17fb('0x25')](0x194);}return _0x4d6e02;};}function handleError(_0x476ff2,_0x57d331){_0x57d331=_0x57d331||0x1f4;return function(_0x2633d6){logger['error'](_0x2633d6[_0x17fb('0x32')]);if(_0x2633d6[_0x17fb('0x33')]){delete _0x2633d6[_0x17fb('0x33')];}_0x476ff2[_0x17fb('0x26')](_0x57d331)[_0x17fb('0x34')](_0x2633d6);};}exports['index']=function(_0x452638,_0x9b8374){var _0x549b25={},_0x397788={},_0x199034={'count':0x0,'rows':[]};var _0x5270f1=_[_0x17fb('0x35')](db[_0x17fb('0x36')]['rawAttributes'],function(_0x2e3a97){return{'name':_0x2e3a97[_0x17fb('0x37')],'type':_0x2e3a97[_0x17fb('0x38')]['key']};});_0x397788[_0x17fb('0x39')]=_[_0x17fb('0x35')](_0x5270f1,_0x17fb('0x33'));_0x397788[_0x17fb('0x3a')]=_[_0x17fb('0x3b')](_0x452638[_0x17fb('0x3a')]);_0x397788[_0x17fb('0x3c')]=_[_0x17fb('0x3d')](_0x397788[_0x17fb('0x39')],_0x397788['query']);_0x549b25[_0x17fb('0x3e')]=_[_0x17fb('0x3d')](_0x397788['model'],qs[_0x17fb('0x3f')](_0x452638[_0x17fb('0x3a')][_0x17fb('0x3f')]));_0x549b25['attributes']=_0x549b25[_0x17fb('0x3e')][_0x17fb('0x40')]?_0x549b25[_0x17fb('0x3e')]:_0x397788[_0x17fb('0x39')];if(!_0x452638['query'][_0x17fb('0x41')](_0x17fb('0x42'))){_0x549b25['limit']=qs[_0x17fb('0x43')](_0x452638[_0x17fb('0x3a')]['limit']);_0x549b25['offset']=qs[_0x17fb('0x2a')](_0x452638[_0x17fb('0x3a')][_0x17fb('0x2a')]);}_0x549b25[_0x17fb('0x44')]=qs[_0x17fb('0x45')](_0x452638[_0x17fb('0x3a')][_0x17fb('0x45')]);_0x549b25[_0x17fb('0x46')]=qs[_0x17fb('0x3c')](_['pick'](_0x452638[_0x17fb('0x3a')],_0x397788[_0x17fb('0x3c')]));if(_0x452638[_0x17fb('0x3a')][_0x17fb('0x47')]){_0x549b25[_0x17fb('0x46')]=_[_0x17fb('0x48')](_0x549b25[_0x17fb('0x46')],{'$or':_[_0x17fb('0x35')](_0x5270f1,function(_0x5369fd){if(_0x5369fd['type']!==_0x17fb('0x49')){var _0x533ddc={};_0x533ddc[_0x5369fd[_0x17fb('0x33')]]={'$like':'%'+_0x452638[_0x17fb('0x3a')]['filter']+'%'};return _0x533ddc;}})});}_0x549b25=_['merge']({},_0x549b25,_0x452638[_0x17fb('0x4a')]);var _0x5b5258={'where':_0x549b25[_0x17fb('0x46')]};return db['VoiceContext'][_0x17fb('0x29')](_0x5b5258)[_0x17fb('0x1c')](function(_0x385b15){_0x199034[_0x17fb('0x29')]=_0x385b15;if(_0x452638[_0x17fb('0x3a')][_0x17fb('0x4b')]){_0x549b25[_0x17fb('0x4c')]=[{'all':!![]}];}return db[_0x17fb('0x36')][_0x17fb('0x4d')](_0x549b25);})[_0x17fb('0x1c')](function(_0x5a68ca){_0x199034[_0x17fb('0x4e')]=_0x5a68ca;return _0x199034;})[_0x17fb('0x1c')](respondWithFilteredResult(_0x9b8374,_0x549b25))[_0x17fb('0x4f')](handleError(_0x9b8374,null));};exports[_0x17fb('0x50')]=function(_0x44dc50,_0xe0a668){var _0x3270f1={'raw':![],'where':{'id':_0x44dc50['params']['id']}},_0x10fb82={};_0x10fb82[_0x17fb('0x39')]=_[_0x17fb('0x3b')](db[_0x17fb('0x36')][_0x17fb('0x51')]);_0x10fb82[_0x17fb('0x3a')]=_[_0x17fb('0x3b')](_0x44dc50[_0x17fb('0x3a')]);_0x10fb82[_0x17fb('0x3c')]=_[_0x17fb('0x3d')](_0x10fb82[_0x17fb('0x39')],_0x10fb82[_0x17fb('0x3a')]);_0x3270f1[_0x17fb('0x3e')]=_[_0x17fb('0x3d')](_0x10fb82[_0x17fb('0x39')],qs[_0x17fb('0x3f')](_0x44dc50['query'][_0x17fb('0x3f')]));_0x3270f1[_0x17fb('0x3e')]=_0x3270f1['attributes']['length']?_0x3270f1[_0x17fb('0x3e')]:_0x10fb82[_0x17fb('0x39')];if(_0x44dc50[_0x17fb('0x3a')][_0x17fb('0x4b')]){_0x3270f1[_0x17fb('0x4c')]=[{'all':!![]}];}_0x3270f1=_[_0x17fb('0x48')]({},_0x3270f1,_0x44dc50[_0x17fb('0x4a')]);return db[_0x17fb('0x36')][_0x17fb('0x52')](_0x3270f1)[_0x17fb('0x1c')](handleEntityNotFound(_0xe0a668,null))[_0x17fb('0x1c')](respondWithResult(_0xe0a668,null))[_0x17fb('0x4f')](handleError(_0xe0a668,null));};exports[_0x17fb('0x53')]=function(_0x4fab01,_0x17fe90,_0x4fb15c){var _0x465a80;return db[_0x17fb('0x36')][_0x17fb('0x53')](_0x4fab01[_0x17fb('0x54')],{'raw':!![]})[_0x17fb('0x1c')](function(_0x2cd26a){_0x465a80=_0x2cd26a;return db[_0x17fb('0x36')][_0x17fb('0x4d')]({'raw':!![]});})[_0x17fb('0x1c')](function(_0x5646d3){var _0x177843=fs['readFileSync'](path[_0x17fb('0x55')](config[_0x17fb('0x56')],_0x17fb('0x57')),_0x17fb('0x58'));var _0x28dbed=ejs[_0x17fb('0x59')](_0x177843,{'contexts':_0x5646d3||[]});fs[_0x17fb('0x5a')](_0x17fb('0x5b'),_0x28dbed);})[_0x17fb('0x1c')](function(){return respondWithRpcPromise(_0x17fb('0x5c'),'create',{'module':'chan_sip.so'});})['then'](function(){var _0x4cd3f9=_0x4fab01[_0x17fb('0x5d')]['get']({'plain':!![]});if(!_0x4cd3f9)throw new Error(_0x17fb('0x5e'));if(_0x4cd3f9[_0x17fb('0x5f')]===_0x17fb('0x5d')){var _0x420ad5=_0x465a80[_0x17fb('0x2f')]({'plain':!![]});return db[_0x17fb('0x60')]['find']({'where':{'name':_0x17fb('0x30'),'userProfileId':_0x4cd3f9[_0x17fb('0x61')]},'raw':!![]})[_0x17fb('0x1c')](function(_0x1a717e){if(_0x1a717e&&_0x1a717e['autoAssociation']===0x0){return db[_0x17fb('0x31')][_0x17fb('0x53')]({'name':_0x420ad5[_0x17fb('0x33')],'resourceId':_0x420ad5['id'],'type':_0x1a717e[_0x17fb('0x33')],'sectionId':_0x1a717e['id']},{})[_0x17fb('0x1c')](function(){return _0x465a80;});}else{return _0x465a80;}})[_0x17fb('0x4f')](function(_0x20b34d){logger['error'](_0x17fb('0x62'),_0x20b34d);throw _0x20b34d;});}return _0x465a80;})[_0x17fb('0x1c')](respondWithResult(_0x17fe90,0xc9))[_0x17fb('0x4f')](handleError(_0x17fe90,null));};exports['update']=function(_0x3d4c79,_0x4f7efd,_0x145898){var _0x2c8a41;return db['VoiceContext']['find']({'where':{'id':_0x3d4c79[_0x17fb('0x63')]['id']}})[_0x17fb('0x1c')](handleEntityNotFound(_0x4f7efd,null))[_0x17fb('0x1c')](saveUpdates(_0x3d4c79['body'],null))[_0x17fb('0x1c')](function(_0x2c6cd2){if(_0x2c6cd2){_0x2c8a41=_0x2c6cd2;return db[_0x17fb('0x36')][_0x17fb('0x4d')]({'raw':!![]});}})[_0x17fb('0x1c')](function(_0x4c9390){var _0x2b3189=fs[_0x17fb('0x64')](path[_0x17fb('0x55')](config[_0x17fb('0x56')],_0x17fb('0x57')),_0x17fb('0x58'));var _0x190236=ejs[_0x17fb('0x59')](_0x2b3189,{'contexts':_0x4c9390||[]});fs[_0x17fb('0x5a')](_0x17fb('0x5b'),_0x190236);})[_0x17fb('0x1c')](function(){return respondWithRpcPromise(_0x17fb('0x5c'),_0x17fb('0x2e'),{'module':_0x17fb('0x65')});})[_0x17fb('0x1c')](function(){return _0x2c8a41;})[_0x17fb('0x1c')](respondWithResult(_0x4f7efd,null))[_0x17fb('0x4f')](handleError(_0x4f7efd,null));};exports['destroy']=function(_0x23ba40,_0x57d22f,_0x5209ba){var _0x4e355f;return db['VoiceContext'][_0x17fb('0x52')]({'where':{'id':_0x23ba40[_0x17fb('0x63')]['id']}})[_0x17fb('0x1c')](handleEntityNotFound(_0x57d22f,null))[_0x17fb('0x1c')](removeEntity(_0x57d22f,null))['then'](function(){return db['VoiceContext'][_0x17fb('0x4d')]({'raw':!![]});})[_0x17fb('0x1c')](function(_0x3be871){var _0x9ae109=fs[_0x17fb('0x64')](path[_0x17fb('0x55')](config['root'],'server/files/templates/context.ejs'),_0x17fb('0x58'));var _0x254495=ejs[_0x17fb('0x59')](_0x9ae109,{'contexts':_0x3be871});fs[_0x17fb('0x5a')](_0x17fb('0x5b'),_0x254495);return respondWithRpcPromise('Reload',_0x17fb('0x66'),{'module':_0x17fb('0x65')});})[_0x17fb('0x4f')](handleError(_0x57d22f,null));}; \ No newline at end of file +var _0xf6dd=['Content-Range','apply','reject','update','destroy','get','Contexts','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','show','create','body','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readFileSync','join','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','json','count','limit','status','set'];(function(_0x2368d8,_0x148a42){var _0x2f87cb=function(_0x52d774){while(--_0x52d774){_0x2368d8['push'](_0x2368d8['shift']());}};_0x2f87cb(++_0x148a42);}(_0xf6dd,0xa6));var _0xdf6d=function(_0x584451,_0x1c812){_0x584451=_0x584451-0x0;var _0x94f0b9=_0xf6dd[_0x584451];return _0x94f0b9;};'use strict';var pdf=require(_0xdf6d('0x0'));var emlformat=require(_0xdf6d('0x1'));var rimraf=require(_0xdf6d('0x2'));var zipdir=require(_0xdf6d('0x3'));var jsonpatch=require(_0xdf6d('0x4'));var rp=require(_0xdf6d('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdf6d('0x6'));var path=require(_0xdf6d('0x7'));var sox=require(_0xdf6d('0x8'));var csv=require('to-csv');var ejs=require(_0xdf6d('0x9'));var fs=require('fs');var _=require(_0xdf6d('0xa'));var squel=require(_0xdf6d('0xb'));var crypto=require('crypto');var jsforce=require(_0xdf6d('0xc'));var deskjs=require(_0xdf6d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdf6d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdf6d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdf6d('0x10'));var hardwareService=require(_0xdf6d('0x11'));var logger=require('../../config/logger')(_0xdf6d('0x12'));var utils=require(_0xdf6d('0x13'));var config=require(_0xdf6d('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf6d('0x15'));var client=jayson['client'][_0xdf6d('0x16')]({'port':0x232a});function checkPasswordPattern(_0x168c8c,_0x239444,_0x387c6c){if(_0x387c6c){var _0x33a937=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33a937[_0xdf6d('0x17')](_0x239444)){return _0x168c8c;}else{throw new db[(_0xdf6d('0x18'))][(_0xdf6d('0x19'))](_0xdf6d('0x1a'));}}else{return _0x168c8c;}}function respondWithRpcPromise(_0x156fcf,_0x5b9e24,_0x55cfad,_0x311a2e){return new BPromise(function(_0xd9471f,_0x3ec3ed){var _0x357a42=_0x311a2e||client;return _0x357a42[_0xdf6d('0x1b')](_0x156fcf,_0x55cfad)[_0xdf6d('0x1c')](function(_0x446351){logger[_0xdf6d('0x1d')](_0xdf6d('0x1e'),_0x5b9e24,'request\x20sent');logger[_0xdf6d('0x1f')](_0xdf6d('0x20'),_0x5b9e24,_0xdf6d('0x21'),JSON[_0xdf6d('0x22')](_0x446351));if(_0x446351['error']){if(_0x446351[_0xdf6d('0x23')][_0xdf6d('0x24')]===0x1f4){logger[_0xdf6d('0x23')]('VoiceContext,\x20%s,\x20%s',_0x5b9e24,_0x446351['error'][_0xdf6d('0x25')]);return _0x3ec3ed(_0x446351[_0xdf6d('0x23')][_0xdf6d('0x25')]);}logger[_0xdf6d('0x23')](_0xdf6d('0x1e'),_0x5b9e24,_0x446351['error'][_0xdf6d('0x25')]);return _0xd9471f(_0x446351[_0xdf6d('0x23')][_0xdf6d('0x25')]);}else{logger[_0xdf6d('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x5b9e24,_0xdf6d('0x21'));_0xd9471f(_0x446351[_0xdf6d('0x26')]['message']);}})[_0xdf6d('0x27')](function(_0x10c86c){logger[_0xdf6d('0x23')]('VoiceContext,\x20%s,\x20%s',_0x5b9e24,_0x10c86c);_0x3ec3ed(_0x10c86c);});});}function respondWithStatusCode(_0xb87a0f,_0x3f03da){_0x3f03da=_0x3f03da||0xcc;return function(_0x2a2adb){if(_0x2a2adb){return _0xb87a0f['sendStatus'](_0x3f03da);}return _0xb87a0f['status'](_0x3f03da)[_0xdf6d('0x28')]();};}function respondWithResult(_0xe6d5fb,_0x46d925){_0x46d925=_0x46d925||0xc8;return function(_0x38e542){if(_0x38e542){return _0xe6d5fb['status'](_0x46d925)[_0xdf6d('0x29')](_0x38e542);}};}function respondWithFilteredResult(_0x55429c,_0x402860){return function(_0x3cf4da){if(_0x3cf4da){var _0x1402a5=_0x3cf4da[_0xdf6d('0x2a')],_0x448155=_0x402860['offset'],_0x2f23ca=_0x402860['offset']+_0x402860[_0xdf6d('0x2b')],_0x5b6375;if(_0x2f23ca>=_0x1402a5){_0x2f23ca=_0x1402a5;_0x5b6375=0xc8;}else{_0x5b6375=0xce;}_0x55429c[_0xdf6d('0x2c')](_0x5b6375);return _0x55429c[_0xdf6d('0x2d')](_0xdf6d('0x2e'),_0x448155+'-'+_0x2f23ca+'/'+_0x1402a5)[_0xdf6d('0x29')](_0x3cf4da);}return null;};}function patchUpdates(_0x3a5534){return function(_0x4ac6ae){try{jsonpatch[_0xdf6d('0x2f')](_0x4ac6ae,_0x3a5534,!![]);}catch(_0x4a4a04){return BPromise[_0xdf6d('0x30')](_0x4a4a04);}return _0x4ac6ae['save']();};}function saveUpdates(_0x6aa581,_0x3da789){return function(_0x9ea101){if(_0x9ea101){return _0x9ea101[_0xdf6d('0x31')](_0x6aa581)[_0xdf6d('0x1c')](function(_0x13ff6e){return _0x13ff6e;});}return null;};}function removeEntity(_0x4204c9,_0x2ca0bc){return function(_0x262f3a){if(_0x262f3a){return _0x262f3a[_0xdf6d('0x32')]()['then'](function(){var _0x52a562=_0x262f3a[_0xdf6d('0x33')]({'plain':!![]});var _0x572c2b=_0xdf6d('0x34');return db['UserProfileResource']['destroy']({'where':{'type':_0x572c2b,'resourceId':_0x52a562['id']}})['then'](function(){return _0x262f3a;});})[_0xdf6d('0x1c')](function(){_0x4204c9[_0xdf6d('0x2c')](0xcc)[_0xdf6d('0x28')]();});}};}function handleEntityNotFound(_0x31b401,_0x1c783e){return function(_0x69cc60){if(!_0x69cc60){_0x31b401[_0xdf6d('0x35')](0x194);}return _0x69cc60;};}function handleError(_0x2fa23a,_0x5574f2){_0x5574f2=_0x5574f2||0x1f4;return function(_0x51cfe7){logger[_0xdf6d('0x23')](_0x51cfe7[_0xdf6d('0x36')]);if(_0x51cfe7[_0xdf6d('0x37')]){delete _0x51cfe7[_0xdf6d('0x37')];}_0x2fa23a['status'](_0x5574f2)[_0xdf6d('0x38')](_0x51cfe7);};}exports[_0xdf6d('0x39')]=function(_0x379e40,_0x16fdbd){var _0x174dde={},_0x37ff84={},_0x598c36={'count':0x0,'rows':[]};var _0x60b837=_[_0xdf6d('0x3a')](db['VoiceContext'][_0xdf6d('0x3b')],function(_0x6d9a79){return{'name':_0x6d9a79[_0xdf6d('0x3c')],'type':_0x6d9a79[_0xdf6d('0x3d')][_0xdf6d('0x3e')]};});_0x37ff84[_0xdf6d('0x3f')]=_[_0xdf6d('0x3a')](_0x60b837,_0xdf6d('0x37'));_0x37ff84[_0xdf6d('0x40')]=_[_0xdf6d('0x41')](_0x379e40[_0xdf6d('0x40')]);_0x37ff84['filters']=_['intersection'](_0x37ff84[_0xdf6d('0x3f')],_0x37ff84[_0xdf6d('0x40')]);_0x174dde[_0xdf6d('0x42')]=_[_0xdf6d('0x43')](_0x37ff84[_0xdf6d('0x3f')],qs['fields'](_0x379e40[_0xdf6d('0x40')][_0xdf6d('0x44')]));_0x174dde[_0xdf6d('0x42')]=_0x174dde[_0xdf6d('0x42')][_0xdf6d('0x45')]?_0x174dde[_0xdf6d('0x42')]:_0x37ff84[_0xdf6d('0x3f')];if(!_0x379e40[_0xdf6d('0x40')][_0xdf6d('0x46')](_0xdf6d('0x47'))){_0x174dde['limit']=qs[_0xdf6d('0x2b')](_0x379e40[_0xdf6d('0x40')][_0xdf6d('0x2b')]);_0x174dde['offset']=qs['offset'](_0x379e40[_0xdf6d('0x40')]['offset']);}_0x174dde['order']=qs[_0xdf6d('0x48')](_0x379e40[_0xdf6d('0x40')][_0xdf6d('0x48')]);_0x174dde[_0xdf6d('0x49')]=qs[_0xdf6d('0x4a')](_['pick'](_0x379e40[_0xdf6d('0x40')],_0x37ff84[_0xdf6d('0x4a')]));if(_0x379e40['query'][_0xdf6d('0x4b')]){_0x174dde[_0xdf6d('0x49')]=_[_0xdf6d('0x4c')](_0x174dde[_0xdf6d('0x49')],{'$or':_[_0xdf6d('0x3a')](_0x60b837,function(_0x28298d){if(_0x28298d['type']!==_0xdf6d('0x4d')){var _0x58e685={};_0x58e685[_0x28298d[_0xdf6d('0x37')]]={'$like':'%'+_0x379e40['query']['filter']+'%'};return _0x58e685;}})});}_0x174dde=_[_0xdf6d('0x4c')]({},_0x174dde,_0x379e40[_0xdf6d('0x4e')]);var _0xced98f={'where':_0x174dde[_0xdf6d('0x49')]};return db[_0xdf6d('0x4f')]['count'](_0xced98f)[_0xdf6d('0x1c')](function(_0x4f385e){_0x598c36[_0xdf6d('0x2a')]=_0x4f385e;if(_0x379e40['query'][_0xdf6d('0x50')]){_0x174dde[_0xdf6d('0x51')]=[{'all':!![]}];}return db['VoiceContext'][_0xdf6d('0x52')](_0x174dde);})[_0xdf6d('0x1c')](function(_0x18a238){_0x598c36[_0xdf6d('0x53')]=_0x18a238;return _0x598c36;})['then'](respondWithFilteredResult(_0x16fdbd,_0x174dde))[_0xdf6d('0x27')](handleError(_0x16fdbd,null));};exports[_0xdf6d('0x54')]=function(_0x54cc24,_0x2e0a5e){var _0x2efdfd={'raw':![],'where':{'id':_0x54cc24['params']['id']}},_0x44cc7b={};_0x44cc7b[_0xdf6d('0x3f')]=_[_0xdf6d('0x41')](db[_0xdf6d('0x4f')][_0xdf6d('0x3b')]);_0x44cc7b[_0xdf6d('0x40')]=_['keys'](_0x54cc24[_0xdf6d('0x40')]);_0x44cc7b[_0xdf6d('0x4a')]=_[_0xdf6d('0x43')](_0x44cc7b['model'],_0x44cc7b['query']);_0x2efdfd[_0xdf6d('0x42')]=_[_0xdf6d('0x43')](_0x44cc7b[_0xdf6d('0x3f')],qs[_0xdf6d('0x44')](_0x54cc24[_0xdf6d('0x40')][_0xdf6d('0x44')]));_0x2efdfd[_0xdf6d('0x42')]=_0x2efdfd[_0xdf6d('0x42')]['length']?_0x2efdfd['attributes']:_0x44cc7b['model'];if(_0x54cc24[_0xdf6d('0x40')][_0xdf6d('0x50')]){_0x2efdfd[_0xdf6d('0x51')]=[{'all':!![]}];}_0x2efdfd=_[_0xdf6d('0x4c')]({},_0x2efdfd,_0x54cc24['options']);return db['VoiceContext']['find'](_0x2efdfd)[_0xdf6d('0x1c')](handleEntityNotFound(_0x2e0a5e,null))[_0xdf6d('0x1c')](respondWithResult(_0x2e0a5e,null))[_0xdf6d('0x27')](handleError(_0x2e0a5e,null));};exports[_0xdf6d('0x55')]=function(_0x867ec5,_0x2ee664,_0x53a3f7){var _0x4c83e4;return db[_0xdf6d('0x4f')][_0xdf6d('0x55')](_0x867ec5[_0xdf6d('0x56')],{'raw':!![]})['then'](function(_0x184e22){_0x4c83e4=_0x184e22;return db[_0xdf6d('0x4f')][_0xdf6d('0x52')]({'raw':!![]});})[_0xdf6d('0x1c')](function(_0x2281a7){var _0x1403f9=fs['readFileSync'](path['join'](config[_0xdf6d('0x57')],_0xdf6d('0x58')),_0xdf6d('0x59'));var _0x5e0980=ejs[_0xdf6d('0x5a')](_0x1403f9,{'contexts':_0x2281a7||[]});fs[_0xdf6d('0x5b')](_0xdf6d('0x5c'),_0x5e0980);})[_0xdf6d('0x1c')](function(){return respondWithRpcPromise(_0xdf6d('0x5d'),_0xdf6d('0x55'),{'module':_0xdf6d('0x5e')});})[_0xdf6d('0x1c')](function(){var _0x425d4f=_0x867ec5['user'][_0xdf6d('0x33')]({'plain':!![]});if(!_0x425d4f)throw new Error(_0xdf6d('0x5f'));if(_0x425d4f[_0xdf6d('0x60')]==='user'){var _0xc3032=_0x4c83e4[_0xdf6d('0x33')]({'plain':!![]});return db[_0xdf6d('0x61')][_0xdf6d('0x62')]({'where':{'name':_0xdf6d('0x34'),'userProfileId':_0x425d4f[_0xdf6d('0x63')]},'raw':!![]})['then'](function(_0x2b8db7){if(_0x2b8db7&&_0x2b8db7[_0xdf6d('0x64')]===0x0){return db[_0xdf6d('0x65')]['create']({'name':_0xc3032[_0xdf6d('0x37')],'resourceId':_0xc3032['id'],'type':_0x2b8db7[_0xdf6d('0x37')],'sectionId':_0x2b8db7['id']},{})[_0xdf6d('0x1c')](function(){return _0x4c83e4;});}else{return _0x4c83e4;}})[_0xdf6d('0x27')](function(_0x35d56c){logger[_0xdf6d('0x23')](_0xdf6d('0x66'),_0x35d56c);throw _0x35d56c;});}return _0x4c83e4;})['then'](respondWithResult(_0x2ee664,0xc9))[_0xdf6d('0x27')](handleError(_0x2ee664,null));};exports[_0xdf6d('0x31')]=function(_0x4c0bfa,_0x208dd1,_0x1c548e){var _0x2e2674;return db[_0xdf6d('0x4f')][_0xdf6d('0x62')]({'where':{'id':_0x4c0bfa[_0xdf6d('0x67')]['id']}})[_0xdf6d('0x1c')](handleEntityNotFound(_0x208dd1,null))[_0xdf6d('0x1c')](saveUpdates(_0x4c0bfa['body'],null))['then'](function(_0x3c2bc3){if(_0x3c2bc3){_0x2e2674=_0x3c2bc3;return db[_0xdf6d('0x4f')][_0xdf6d('0x52')]({'raw':!![]});}})['then'](function(_0x5119c6){var _0x2a71ec=fs[_0xdf6d('0x68')](path[_0xdf6d('0x69')](config['root'],_0xdf6d('0x58')),_0xdf6d('0x59'));var _0x48852f=ejs[_0xdf6d('0x5a')](_0x2a71ec,{'contexts':_0x5119c6||[]});fs[_0xdf6d('0x5b')](_0xdf6d('0x5c'),_0x48852f);})['then'](function(){return respondWithRpcPromise('Reload',_0xdf6d('0x31'),{'module':'chan_sip.so'});})[_0xdf6d('0x1c')](function(){return _0x2e2674;})[_0xdf6d('0x1c')](respondWithResult(_0x208dd1,null))['catch'](handleError(_0x208dd1,null));};exports[_0xdf6d('0x32')]=function(_0x246b7b,_0x288081,_0x1c7b76){var _0x57006e;return db[_0xdf6d('0x4f')]['find']({'where':{'id':_0x246b7b[_0xdf6d('0x67')]['id']}})[_0xdf6d('0x1c')](handleEntityNotFound(_0x288081,null))['then'](removeEntity(_0x288081,null))['then'](function(){return db['VoiceContext'][_0xdf6d('0x52')]({'raw':!![]});})[_0xdf6d('0x1c')](function(_0x399593){var _0xd9ff21=fs['readFileSync'](path[_0xdf6d('0x69')](config[_0xdf6d('0x57')],_0xdf6d('0x58')),_0xdf6d('0x59'));var _0x551024=ejs[_0xdf6d('0x5a')](_0xd9ff21,{'contexts':_0x399593});fs[_0xdf6d('0x5b')](_0xdf6d('0x5c'),_0x551024);return respondWithRpcPromise(_0xdf6d('0x5d'),_0xdf6d('0x32'),{'module':_0xdf6d('0x5e')});})[_0xdf6d('0x27')](handleError(_0x288081,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 128798f..5189c2c 100644 --- a/server/api/voiceContext/voiceContext.model.js +++ b/server/api/voiceContext/voiceContext.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a0f=['./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash','moment','bluebird','path'];(function(_0x166e88,_0x1bae10){var _0x43ec68=function(_0x2924a5){while(--_0x2924a5){_0x166e88['push'](_0x166e88['shift']());}};_0x43ec68(++_0x1bae10);}(_0x1a0f,0x64));var _0xf1a0=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x1a0f[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xf1a0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf1a0('0x1'));var BPromise=require(_0xf1a0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1a0('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf1a0('0x4'));module[_0xf1a0('0x5')]=function(_0x2347db,_0x2e743f){return _0x2347db['define'](_0xf1a0('0x6'),attributes,{'tableName':_0xf1a0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb115=['request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','moment','bluebird'];(function(_0x1966f3,_0x210ea3){var _0x17575f=function(_0x7b18fb){while(--_0x7b18fb){_0x1966f3['push'](_0x1966f3['shift']());}};_0x17575f(++_0x210ea3);}(_0xb115,0x14d));var _0x5b11=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb115[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x5b11('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5b11('0x1'));var BPromise=require(_0x5b11('0x2'));var rp=require(_0x5b11('0x3'));var fs=require('fs');var path=require(_0x5b11('0x4'));var rimraf=require(_0x5b11('0x5'));var config=require(_0x5b11('0x6'));var attributes=require(_0x5b11('0x7'));module[_0x5b11('0x8')]=function(_0x10475d,_0x15a420){return _0x10475d[_0x5b11('0x9')](_0x5b11('0xa'),attributes,{'tableName':_0x5b11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index bd23e50..5286ec6 100644 --- a/server/api/voiceContext/voiceContext.rpc.js +++ b/server/api/voiceContext/voiceContext.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd816=['error','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','VoiceContext,\x20%s,\x20%s'];(function(_0xfada3f,_0x1ad0a2){var _0x45c36b=function(_0x4b9ad4){while(--_0x4b9ad4){_0xfada3f['push'](_0xfada3f['shift']());}};_0x45c36b(++_0x1ad0a2);}(_0xd816,0xd5));var _0x6d81=function(_0x2a9d7a,_0x53feaf){_0x2a9d7a=_0x2a9d7a-0x0;var _0x33c7fa=_0xd816[_0x2a9d7a];return _0x33c7fa;};'use strict';var _=require(_0x6d81('0x0'));var util=require(_0x6d81('0x1'));var moment=require('moment');var BPromise=require(_0x6d81('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6d81('0x3'));var logger=require(_0x6d81('0x4'))(_0x6d81('0x5'));var config=require(_0x6d81('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6d81('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10f1a7,_0x522603,_0x96d1ac){return new BPromise(function(_0x15d634,_0x4e77e8){return client[_0x6d81('0x8')](_0x10f1a7,_0x96d1ac)[_0x6d81('0x9')](function(_0x8612be){logger[_0x6d81('0xa')]('VoiceContext,\x20%s,\x20%s',_0x522603,_0x6d81('0xb'));logger['debug'](_0x6d81('0xc'),_0x522603,_0x6d81('0xb'),JSON[_0x6d81('0xd')](_0x8612be));if(_0x8612be['error']){if(_0x8612be['error']['code']===0x1f4){logger['error'](_0x6d81('0xe'),_0x522603,_0x8612be[_0x6d81('0xf')][_0x6d81('0x10')]);return _0x4e77e8(_0x8612be[_0x6d81('0xf')]['message']);}logger[_0x6d81('0xf')](_0x6d81('0xe'),_0x522603,_0x8612be[_0x6d81('0xf')][_0x6d81('0x10')]);return _0x15d634(_0x8612be['error'][_0x6d81('0x10')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x522603,_0x6d81('0xb'));_0x15d634(_0x8612be[_0x6d81('0x11')][_0x6d81('0x10')]);}})[_0x6d81('0x12')](function(_0x219f73){logger[_0x6d81('0xf')](_0x6d81('0xe'),_0x522603,_0x219f73);_0x4e77e8(_0x219f73);});});} \ No newline at end of file +var _0xc8de=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xc8de,0x167));var _0xec8d=function(_0x1f2fc2,_0x411410){_0x1f2fc2=_0x1f2fc2-0x0;var _0x1b5bb7=_0xc8de[_0x1f2fc2];return _0x1b5bb7;};'use strict';var _=require('lodash');var util=require(_0xec8d('0x0'));var moment=require(_0xec8d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec8d('0x2'));var db=require(_0xec8d('0x3'))['db'];var utils=require(_0xec8d('0x4'));var logger=require(_0xec8d('0x5'))(_0xec8d('0x6'));var config=require(_0xec8d('0x7'));var jayson=require(_0xec8d('0x8'));var client=jayson['client'][_0xec8d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55e36c,_0x11308b,_0x596921){return new BPromise(function(_0x37de69,_0x597c70){return client[_0xec8d('0xa')](_0x55e36c,_0x596921)['then'](function(_0x2e028d){logger[_0xec8d('0xb')](_0xec8d('0xc'),_0x11308b,_0xec8d('0xd'));logger[_0xec8d('0xe')](_0xec8d('0xf'),_0x11308b,_0xec8d('0xd'),JSON[_0xec8d('0x10')](_0x2e028d));if(_0x2e028d[_0xec8d('0x11')]){if(_0x2e028d[_0xec8d('0x11')]['code']===0x1f4){logger[_0xec8d('0x11')](_0xec8d('0xc'),_0x11308b,_0x2e028d[_0xec8d('0x11')][_0xec8d('0x12')]);return _0x597c70(_0x2e028d[_0xec8d('0x11')][_0xec8d('0x12')]);}logger[_0xec8d('0x11')](_0xec8d('0xc'),_0x11308b,_0x2e028d[_0xec8d('0x11')][_0xec8d('0x12')]);return _0x37de69(_0x2e028d[_0xec8d('0x11')][_0xec8d('0x12')]);}else{logger['info'](_0xec8d('0xc'),_0x11308b,_0xec8d('0xd'));_0x37de69(_0x2e028d[_0xec8d('0x13')][_0xec8d('0x12')]);}})['catch'](function(_0x2fb24f){logger['error']('VoiceContext,\x20%s,\x20%s',_0x11308b,_0x2fb24f);_0x597c70(_0x2fb24f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 99a8d0e..a7e9fb1 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf295=['multer','util','express','Router','../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy'];(function(_0x222335,_0x4d952f){var _0x5870b8=function(_0x312a5d){while(--_0x312a5d){_0x222335['push'](_0x222335['shift']());}};_0x5870b8(++_0x4d952f);}(_0xf295,0x1db));var _0x5f29=function(_0xbac1c3,_0x705df0){_0xbac1c3=_0xbac1c3-0x0;var _0x32423f=_0xf295[_0xbac1c3];return _0x32423f;};'use strict';var multer=require(_0x5f29('0x0'));var util=require(_0x5f29('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f29('0x2'));var router=express[_0x5f29('0x3')]();var auth=require(_0x5f29('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5f29('0x5'));var controller=require(_0x5f29('0x6'));router['get']('/',auth[_0x5f29('0x7')](),controller[_0x5f29('0x8')]);router['get'](_0x5f29('0x9'),auth['isAuthenticated'](),controller[_0x5f29('0xa')]);router['get']('/:id',auth[_0x5f29('0x7')](),controller[_0x5f29('0xb')]);router[_0x5f29('0xc')]('/',auth['isAuthenticated'](),controller[_0x5f29('0xd')]);router[_0x5f29('0xe')](_0x5f29('0xf'),auth[_0x5f29('0x7')](),controller[_0x5f29('0x10')]);router[_0x5f29('0x11')](_0x5f29('0xf'),auth['isAuthenticated'](),controller[_0x5f29('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc80c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0xc80c,0xcd));var _0xcc80=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xc80c[_0x4ed520];return _0x4415a6;};'use strict';var multer=require(_0xcc80('0x0'));var util=require(_0xcc80('0x1'));var path=require(_0xcc80('0x2'));var timeout=require(_0xcc80('0x3'));var express=require('express');var router=express[_0xcc80('0x4')]();var auth=require(_0xcc80('0x5'));var interaction=require(_0xcc80('0x6'));var config=require(_0xcc80('0x7'));var controller=require('./voiceDialReport.controller');router[_0xcc80('0x8')]('/',auth[_0xcc80('0x9')](),controller['index']);router[_0xcc80('0x8')]('/describe',auth[_0xcc80('0x9')](),controller[_0xcc80('0xa')]);router[_0xcc80('0x8')](_0xcc80('0xb'),auth[_0xcc80('0x9')](),controller[_0xcc80('0xc')]);router[_0xcc80('0xd')]('/',auth['isAuthenticated'](),controller[_0xcc80('0xe')]);router[_0xcc80('0xf')](_0xcc80('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xcc80('0x10')](_0xcc80('0xb'),auth[_0xcc80('0x9')](),controller[_0xcc80('0x11')]);module[_0xcc80('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index ddc7bc4..9552185 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc72f=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x24e5b6,_0x5e07d0){var _0x422ad9=function(_0x55801d){while(--_0x55801d){_0x24e5b6['push'](_0x24e5b6['shift']());}};_0x422ad9(++_0x5e07d0);}(_0xc72f,0x1d8));var _0xfc72=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xc72f[_0x1a7846];return _0x48049;};'use strict';var Sequelize=require(_0xfc72('0x0'));module[_0xfc72('0x1')]={'privilege':{'type':Sequelize[_0xfc72('0x2')]},'channel':{'type':Sequelize[_0xfc72('0x2')]},'channelstate':{'type':Sequelize[_0xfc72('0x3')]},'channelstatedesc':{'type':Sequelize[_0xfc72('0x2')]},'calleridnum':{'type':Sequelize[_0xfc72('0x2')]},'calleridname':{'type':Sequelize[_0xfc72('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfc72('0x2')]},'connectedlinename':{'type':Sequelize[_0xfc72('0x2')]},'language':{'type':Sequelize[_0xfc72('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xfc72('0x2')]},'exten':{'type':Sequelize[_0xfc72('0x2')]},'priority':{'type':Sequelize[_0xfc72('0x3')]},'uniqueid':{'type':Sequelize[_0xfc72('0x2')]},'linkedid':{'type':Sequelize[_0xfc72('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xfc72('0x2')]},'destcalleridnum':{'type':Sequelize[_0xfc72('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xfc72('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfc72('0x2')]},'destexten':{'type':Sequelize[_0xfc72('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xfc72('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xfc72('0x2')]},'starttime':{'type':Sequelize[_0xfc72('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfc72('0x4')]},'lastevent':{'type':Sequelize[_0xfc72('0x2')],'comment':_0xfc72('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xfc72('0x3')]}}; \ No newline at end of file +var _0x7868=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x5e94a8,_0x522d86){var _0x1a1fe6=function(_0x3bab14){while(--_0x3bab14){_0x5e94a8['push'](_0x5e94a8['shift']());}};_0x1a1fe6(++_0x522d86);}(_0x7868,0x81));var _0x8786=function(_0x528e64,_0x1e94fc){_0x528e64=_0x528e64-0x0;var _0x582907=_0x7868[_0x528e64];return _0x582907;};'use strict';var Sequelize=require(_0x8786('0x0'));module[_0x8786('0x1')]={'privilege':{'type':Sequelize[_0x8786('0x2')]},'channel':{'type':Sequelize[_0x8786('0x2')]},'channelstate':{'type':Sequelize[_0x8786('0x3')]},'channelstatedesc':{'type':Sequelize[_0x8786('0x2')]},'calleridnum':{'type':Sequelize[_0x8786('0x2')]},'calleridname':{'type':Sequelize[_0x8786('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8786('0x2')]},'connectedlinename':{'type':Sequelize[_0x8786('0x2')]},'language':{'type':Sequelize[_0x8786('0x2')]},'accountcode':{'type':Sequelize[_0x8786('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x8786('0x2')]},'priority':{'type':Sequelize[_0x8786('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x8786('0x2')]},'destchannel':{'type':Sequelize[_0x8786('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8786('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8786('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x8786('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8786('0x2')]},'destlanguage':{'type':Sequelize[_0x8786('0x2')]},'destaccountcode':{'type':Sequelize[_0x8786('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x8786('0x2')]},'destpriority':{'type':Sequelize[_0x8786('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x8786('0x2')]},'dialstring':{'type':Sequelize[_0x8786('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8786('0x4')]},'answertime':{'type':Sequelize[_0x8786('0x4')]},'endtime':{'type':Sequelize[_0x8786('0x4')]},'lastevent':{'type':Sequelize[_0x8786('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x8786('0x3')]},'duration':{'type':Sequelize[_0x8786('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x8786('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ebf8bef..e7bee29 100644 --- a/server/api/voiceDialReport/voiceDialReport.controller.js +++ b/server/api/voiceDialReport/voiceDialReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ef4=['fields','catch','create','body','update','find','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','limit','sort','where','filters','filter','merge','options','includeAll','include','rows','show'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6ef4,0x120));var _0x46ef=function(_0x243c5c,_0x3dd30c){_0x243c5c=_0x243c5c-0x0;var _0x486e0f=_0x6ef4[_0x243c5c];return _0x486e0f;};'use strict';var pdf=require(_0x46ef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x46ef('0x1'));var zipdir=require(_0x46ef('0x2'));var jsonpatch=require(_0x46ef('0x3'));var rp=require(_0x46ef('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x46ef('0x5'));var util=require(_0x46ef('0x6'));var path=require(_0x46ef('0x7'));var sox=require(_0x46ef('0x8'));var csv=require(_0x46ef('0x9'));var ejs=require(_0x46ef('0xa'));var fs=require('fs');var _=require(_0x46ef('0xb'));var squel=require(_0x46ef('0xc'));var crypto=require(_0x46ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x46ef('0xe'));var toCsv=require(_0x46ef('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x46ef('0xf'));var authService=require(_0x46ef('0x10'));var qs=require(_0x46ef('0x11'));var as=require(_0x46ef('0x12'));var hardwareService=require(_0x46ef('0x13'));var logger=require(_0x46ef('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x46ef('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d10f3,_0x3122bc){_0x3122bc=_0x3122bc||0xcc;return function(_0x2d3cce){if(_0x2d3cce){return _0x1d10f3[_0x46ef('0x16')](_0x3122bc);}return _0x1d10f3[_0x46ef('0x17')](_0x3122bc)[_0x46ef('0x18')]();};}function respondWithResult(_0x137193,_0x39ee78){_0x39ee78=_0x39ee78||0xc8;return function(_0xff50d2){if(_0xff50d2){return _0x137193[_0x46ef('0x17')](_0x39ee78)[_0x46ef('0x19')](_0xff50d2);}};}function respondWithFilteredResult(_0x173e34,_0x556432){return function(_0x5186cc){if(_0x5186cc){var _0x1eb61c=_0x5186cc[_0x46ef('0x1a')],_0x588260=_0x556432[_0x46ef('0x1b')],_0x256d87=_0x556432[_0x46ef('0x1b')]+_0x556432['limit'],_0x39961e;if(_0x256d87>=_0x1eb61c){_0x256d87=_0x1eb61c;_0x39961e=0xc8;}else{_0x39961e=0xce;}_0x173e34[_0x46ef('0x17')](_0x39961e);return _0x173e34[_0x46ef('0x1c')](_0x46ef('0x1d'),_0x588260+'-'+_0x256d87+'/'+_0x1eb61c)[_0x46ef('0x19')](_0x5186cc);}return null;};}function patchUpdates(_0x5e0d47){return function(_0x3e25e2){try{jsonpatch[_0x46ef('0x1e')](_0x3e25e2,_0x5e0d47,!![]);}catch(_0x531e16){return BPromise['reject'](_0x531e16);}return _0x3e25e2[_0x46ef('0x1f')]();};}function saveUpdates(_0x2bcea2,_0x148f55){return function(_0x53df2c){if(_0x53df2c){return _0x53df2c['update'](_0x2bcea2)[_0x46ef('0x20')](function(_0x4d594d){return _0x4d594d;});}return null;};}function removeEntity(_0x1fb001,_0x5a9ed7){return function(_0x4ed25f){if(_0x4ed25f){return _0x4ed25f[_0x46ef('0x21')]()[_0x46ef('0x20')](function(){_0x1fb001['status'](0xcc)[_0x46ef('0x18')]();});}};}function handleEntityNotFound(_0x52ecd6,_0xfe93fe){return function(_0x53cff7){if(!_0x53cff7){_0x52ecd6['sendStatus'](0x194);}return _0x53cff7;};}function handleError(_0x30b990,_0x5a03ce){_0x5a03ce=_0x5a03ce||0x1f4;return function(_0x149c35){logger[_0x46ef('0x22')](_0x149c35['stack']);if(_0x149c35[_0x46ef('0x23')]){delete _0x149c35[_0x46ef('0x23')];}_0x30b990[_0x46ef('0x17')](_0x5a03ce)[_0x46ef('0x24')](_0x149c35);};}exports[_0x46ef('0x25')]=function(_0x476681,_0x1f57a9){var _0x10027d={},_0x4d666e={},_0x3f809e={'count':0x0,'rows':[]};var _0x5a5b5d=_[_0x46ef('0x26')](db[_0x46ef('0x27')][_0x46ef('0x28')],function(_0x2d539d){return{'name':_0x2d539d[_0x46ef('0x29')],'type':_0x2d539d[_0x46ef('0x2a')][_0x46ef('0x2b')]};});_0x4d666e[_0x46ef('0x2c')]=_[_0x46ef('0x26')](_0x5a5b5d,_0x46ef('0x23'));_0x4d666e[_0x46ef('0x2d')]=_[_0x46ef('0x2e')](_0x476681[_0x46ef('0x2d')]);_0x4d666e['filters']=_[_0x46ef('0x2f')](_0x4d666e[_0x46ef('0x2c')],_0x4d666e[_0x46ef('0x2d')]);_0x10027d[_0x46ef('0x30')]=_[_0x46ef('0x2f')](_0x4d666e[_0x46ef('0x2c')],qs['fields'](_0x476681['query']['fields']));_0x10027d[_0x46ef('0x30')]=_0x10027d[_0x46ef('0x30')][_0x46ef('0x31')]?_0x10027d[_0x46ef('0x30')]:_0x4d666e[_0x46ef('0x2c')];if(!_0x476681[_0x46ef('0x2d')]['hasOwnProperty'](_0x46ef('0x32'))){_0x10027d[_0x46ef('0x33')]=qs[_0x46ef('0x33')](_0x476681[_0x46ef('0x2d')][_0x46ef('0x33')]);_0x10027d[_0x46ef('0x1b')]=qs[_0x46ef('0x1b')](_0x476681[_0x46ef('0x2d')]['offset']);}_0x10027d['order']=qs[_0x46ef('0x34')](_0x476681[_0x46ef('0x2d')]['sort']);_0x10027d[_0x46ef('0x35')]=qs['filters'](_['pick'](_0x476681[_0x46ef('0x2d')],_0x4d666e[_0x46ef('0x36')]));if(_0x476681[_0x46ef('0x2d')][_0x46ef('0x37')]){_0x10027d[_0x46ef('0x35')]=_[_0x46ef('0x38')](_0x10027d[_0x46ef('0x35')],{'$or':_[_0x46ef('0x26')](_0x5a5b5d,function(_0x2fe15e){if(_0x2fe15e[_0x46ef('0x2a')]!=='VIRTUAL'){var _0x12f687={};_0x12f687[_0x2fe15e[_0x46ef('0x23')]]={'$like':'%'+_0x476681['query'][_0x46ef('0x37')]+'%'};return _0x12f687;}})});}_0x10027d=_[_0x46ef('0x38')]({},_0x10027d,_0x476681[_0x46ef('0x39')]);var _0x43581f={'where':_0x10027d[_0x46ef('0x35')]};return db[_0x46ef('0x27')][_0x46ef('0x1a')](_0x43581f)[_0x46ef('0x20')](function(_0x4e2a8c){_0x3f809e[_0x46ef('0x1a')]=_0x4e2a8c;if(_0x476681[_0x46ef('0x2d')][_0x46ef('0x3a')]){_0x10027d[_0x46ef('0x3b')]=[{'all':!![]}];}return db[_0x46ef('0x27')]['findAll'](_0x10027d);})[_0x46ef('0x20')](function(_0x563365){_0x3f809e[_0x46ef('0x3c')]=_0x563365;return _0x3f809e;})[_0x46ef('0x20')](respondWithFilteredResult(_0x1f57a9,_0x10027d))['catch'](handleError(_0x1f57a9,null));};exports[_0x46ef('0x3d')]=function(_0x4dc561,_0x41e4c8){var _0xe7af8e={'raw':!![],'where':{'id':_0x4dc561['params']['id']}},_0x10c154={};_0x10c154[_0x46ef('0x2c')]=_[_0x46ef('0x2e')](db[_0x46ef('0x27')][_0x46ef('0x28')]);_0x10c154['query']=_[_0x46ef('0x2e')](_0x4dc561[_0x46ef('0x2d')]);_0x10c154[_0x46ef('0x36')]=_[_0x46ef('0x2f')](_0x10c154[_0x46ef('0x2c')],_0x10c154[_0x46ef('0x2d')]);_0xe7af8e[_0x46ef('0x30')]=_[_0x46ef('0x2f')](_0x10c154[_0x46ef('0x2c')],qs[_0x46ef('0x3e')](_0x4dc561[_0x46ef('0x2d')][_0x46ef('0x3e')]));_0xe7af8e[_0x46ef('0x30')]=_0xe7af8e['attributes']['length']?_0xe7af8e[_0x46ef('0x30')]:_0x10c154[_0x46ef('0x2c')];if(_0x4dc561[_0x46ef('0x2d')]['includeAll']){_0xe7af8e[_0x46ef('0x3b')]=[{'all':!![]}];}_0xe7af8e=_['merge']({},_0xe7af8e,_0x4dc561['options']);return db['VoiceDialReport']['find'](_0xe7af8e)[_0x46ef('0x20')](handleEntityNotFound(_0x41e4c8,null))['then'](respondWithResult(_0x41e4c8,null))[_0x46ef('0x3f')](handleError(_0x41e4c8,null));};exports[_0x46ef('0x40')]=function(_0x1b2586,_0x2bb7c2){return db[_0x46ef('0x27')][_0x46ef('0x40')](_0x1b2586[_0x46ef('0x41')],{})[_0x46ef('0x20')](respondWithResult(_0x2bb7c2,0xc9))[_0x46ef('0x3f')](handleError(_0x2bb7c2,null));};exports[_0x46ef('0x42')]=function(_0x4ef225,_0x49ffec){if(_0x4ef225[_0x46ef('0x41')]['id']){delete _0x4ef225['body']['id'];}return db[_0x46ef('0x27')][_0x46ef('0x43')]({'where':{'id':_0x4ef225[_0x46ef('0x44')]['id']}})[_0x46ef('0x20')](handleEntityNotFound(_0x49ffec,null))[_0x46ef('0x20')](saveUpdates(_0x4ef225[_0x46ef('0x41')],null))[_0x46ef('0x20')](respondWithResult(_0x49ffec,null))[_0x46ef('0x3f')](handleError(_0x49ffec,null));};exports[_0x46ef('0x21')]=function(_0x501711,_0x3c71ad){return db[_0x46ef('0x27')][_0x46ef('0x43')]({'where':{'id':_0x501711[_0x46ef('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c71ad,null))['then'](removeEntity(_0x3c71ad,null))[_0x46ef('0x3f')](handleError(_0x3c71ad,null));};exports['describe']=function(_0x4e78cb,_0xf464bd){return db[_0x46ef('0x27')][_0x46ef('0x45')]()['then'](respondWithResult(_0xf464bd,null))[_0x46ef('0x3f')](handleError(_0xf464bd,null));}; \ No newline at end of file +var _0xb08c=['set','apply','reject','save','error','name','send','index','map','VoiceDialReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','rawAttributes','length','merge','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb08c,0x77));var _0xcb08=function(_0x30d010,_0x216998){_0x30d010=_0x30d010-0x0;var _0x3db5cd=_0xb08c[_0x30d010];return _0x3db5cd;};'use strict';var pdf=require(_0xcb08('0x0'));var emlformat=require(_0xcb08('0x1'));var rimraf=require(_0xcb08('0x2'));var zipdir=require(_0xcb08('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb08('0x4'));var moment=require(_0xcb08('0x5'));var BPromise=require(_0xcb08('0x6'));var Mustache=require('mustache');var util=require(_0xcb08('0x7'));var path=require(_0xcb08('0x8'));var sox=require(_0xcb08('0x9'));var csv=require(_0xcb08('0xa'));var ejs=require(_0xcb08('0xb'));var fs=require('fs');var _=require(_0xcb08('0xc'));var squel=require(_0xcb08('0xd'));var crypto=require(_0xcb08('0xe'));var jsforce=require(_0xcb08('0xf'));var deskjs=require(_0xcb08('0x10'));var toCsv=require(_0xcb08('0xa'));var querystring=require(_0xcb08('0x11'));var Papa=require(_0xcb08('0x12'));var Redis=require(_0xcb08('0x13'));var authService=require(_0xcb08('0x14'));var qs=require(_0xcb08('0x15'));var as=require(_0xcb08('0x16'));var hardwareService=require(_0xcb08('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xcb08('0x18'));var config=require(_0xcb08('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22386e,_0x2cbe08){_0x2cbe08=_0x2cbe08||0xcc;return function(_0x1e5d70){if(_0x1e5d70){return _0x22386e[_0xcb08('0x1a')](_0x2cbe08);}return _0x22386e[_0xcb08('0x1b')](_0x2cbe08)[_0xcb08('0x1c')]();};}function respondWithResult(_0x8b231b,_0x4e59c2){_0x4e59c2=_0x4e59c2||0xc8;return function(_0x6b53e0){if(_0x6b53e0){return _0x8b231b['status'](_0x4e59c2)[_0xcb08('0x1d')](_0x6b53e0);}};}function respondWithFilteredResult(_0x30a652,_0xe6da0f){return function(_0x237532){if(_0x237532){var _0x6f1c83=_0x237532[_0xcb08('0x1e')],_0x35e9b6=_0xe6da0f[_0xcb08('0x1f')],_0x32934e=_0xe6da0f['offset']+_0xe6da0f[_0xcb08('0x20')],_0xd265c7;if(_0x32934e>=_0x6f1c83){_0x32934e=_0x6f1c83;_0xd265c7=0xc8;}else{_0xd265c7=0xce;}_0x30a652[_0xcb08('0x1b')](_0xd265c7);return _0x30a652[_0xcb08('0x21')]('Content-Range',_0x35e9b6+'-'+_0x32934e+'/'+_0x6f1c83)[_0xcb08('0x1d')](_0x237532);}return null;};}function patchUpdates(_0x240dfb){return function(_0x26365f){try{jsonpatch[_0xcb08('0x22')](_0x26365f,_0x240dfb,!![]);}catch(_0x1e954b){return BPromise[_0xcb08('0x23')](_0x1e954b);}return _0x26365f[_0xcb08('0x24')]();};}function saveUpdates(_0x3b6818,_0x2844bb){return function(_0x5df684){if(_0x5df684){return _0x5df684['update'](_0x3b6818)['then'](function(_0x55ee13){return _0x55ee13;});}return null;};}function removeEntity(_0x171911,_0x4794e6){return function(_0x2cb347){if(_0x2cb347){return _0x2cb347['destroy']()['then'](function(){_0x171911[_0xcb08('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eccd4,_0xfcc3d9){return function(_0x30f318){if(!_0x30f318){_0x4eccd4[_0xcb08('0x1a')](0x194);}return _0x30f318;};}function handleError(_0x135b7e,_0x471bc6){_0x471bc6=_0x471bc6||0x1f4;return function(_0x43d55d){logger[_0xcb08('0x25')](_0x43d55d['stack']);if(_0x43d55d[_0xcb08('0x26')]){delete _0x43d55d[_0xcb08('0x26')];}_0x135b7e['status'](_0x471bc6)[_0xcb08('0x27')](_0x43d55d);};}exports[_0xcb08('0x28')]=function(_0x89ce08,_0x2eaca2){var _0x32a73f={},_0x3dcde5={},_0x570b3c={'count':0x0,'rows':[]};var _0x592f08=_[_0xcb08('0x29')](db[_0xcb08('0x2a')]['rawAttributes'],function(_0x45c262){return{'name':_0x45c262[_0xcb08('0x2b')],'type':_0x45c262[_0xcb08('0x2c')][_0xcb08('0x2d')]};});_0x3dcde5[_0xcb08('0x2e')]=_[_0xcb08('0x29')](_0x592f08,_0xcb08('0x26'));_0x3dcde5[_0xcb08('0x2f')]=_[_0xcb08('0x30')](_0x89ce08[_0xcb08('0x2f')]);_0x3dcde5['filters']=_[_0xcb08('0x31')](_0x3dcde5[_0xcb08('0x2e')],_0x3dcde5['query']);_0x32a73f[_0xcb08('0x32')]=_['intersection'](_0x3dcde5[_0xcb08('0x2e')],qs[_0xcb08('0x33')](_0x89ce08['query'][_0xcb08('0x33')]));_0x32a73f['attributes']=_0x32a73f[_0xcb08('0x32')]['length']?_0x32a73f[_0xcb08('0x32')]:_0x3dcde5[_0xcb08('0x2e')];if(!_0x89ce08[_0xcb08('0x2f')][_0xcb08('0x34')](_0xcb08('0x35'))){_0x32a73f['limit']=qs['limit'](_0x89ce08[_0xcb08('0x2f')][_0xcb08('0x20')]);_0x32a73f['offset']=qs[_0xcb08('0x1f')](_0x89ce08[_0xcb08('0x2f')][_0xcb08('0x1f')]);}_0x32a73f[_0xcb08('0x36')]=qs[_0xcb08('0x37')](_0x89ce08['query']['sort']);_0x32a73f[_0xcb08('0x38')]=qs[_0xcb08('0x39')](_['pick'](_0x89ce08[_0xcb08('0x2f')],_0x3dcde5[_0xcb08('0x39')]));if(_0x89ce08['query'][_0xcb08('0x3a')]){_0x32a73f[_0xcb08('0x38')]=_['merge'](_0x32a73f['where'],{'$or':_['map'](_0x592f08,function(_0x4ed5a0){if(_0x4ed5a0[_0xcb08('0x2c')]!==_0xcb08('0x3b')){var _0x564e3a={};_0x564e3a[_0x4ed5a0[_0xcb08('0x26')]]={'$like':'%'+_0x89ce08[_0xcb08('0x2f')][_0xcb08('0x3a')]+'%'};return _0x564e3a;}})});}_0x32a73f=_['merge']({},_0x32a73f,_0x89ce08[_0xcb08('0x3c')]);var _0x64f6a={'where':_0x32a73f[_0xcb08('0x38')]};return db[_0xcb08('0x2a')]['count'](_0x64f6a)[_0xcb08('0x3d')](function(_0x1ab866){_0x570b3c[_0xcb08('0x1e')]=_0x1ab866;if(_0x89ce08[_0xcb08('0x2f')][_0xcb08('0x3e')]){_0x32a73f[_0xcb08('0x3f')]=[{'all':!![]}];}return db[_0xcb08('0x2a')]['findAll'](_0x32a73f);})[_0xcb08('0x3d')](function(_0x34ba51){_0x570b3c[_0xcb08('0x40')]=_0x34ba51;return _0x570b3c;})[_0xcb08('0x3d')](respondWithFilteredResult(_0x2eaca2,_0x32a73f))[_0xcb08('0x41')](handleError(_0x2eaca2,null));};exports[_0xcb08('0x42')]=function(_0x18f373,_0x59895f){var _0x4076a2={'raw':!![],'where':{'id':_0x18f373[_0xcb08('0x43')]['id']}},_0x1b1d4b={};_0x1b1d4b[_0xcb08('0x2e')]=_[_0xcb08('0x30')](db[_0xcb08('0x2a')][_0xcb08('0x44')]);_0x1b1d4b[_0xcb08('0x2f')]=_[_0xcb08('0x30')](_0x18f373[_0xcb08('0x2f')]);_0x1b1d4b[_0xcb08('0x39')]=_['intersection'](_0x1b1d4b['model'],_0x1b1d4b['query']);_0x4076a2[_0xcb08('0x32')]=_[_0xcb08('0x31')](_0x1b1d4b[_0xcb08('0x2e')],qs['fields'](_0x18f373[_0xcb08('0x2f')][_0xcb08('0x33')]));_0x4076a2[_0xcb08('0x32')]=_0x4076a2['attributes'][_0xcb08('0x45')]?_0x4076a2[_0xcb08('0x32')]:_0x1b1d4b[_0xcb08('0x2e')];if(_0x18f373[_0xcb08('0x2f')]['includeAll']){_0x4076a2[_0xcb08('0x3f')]=[{'all':!![]}];}_0x4076a2=_[_0xcb08('0x46')]({},_0x4076a2,_0x18f373[_0xcb08('0x3c')]);return db[_0xcb08('0x2a')][_0xcb08('0x47')](_0x4076a2)[_0xcb08('0x3d')](handleEntityNotFound(_0x59895f,null))[_0xcb08('0x3d')](respondWithResult(_0x59895f,null))[_0xcb08('0x41')](handleError(_0x59895f,null));};exports[_0xcb08('0x48')]=function(_0x382c28,_0x46921a){return db['VoiceDialReport']['create'](_0x382c28[_0xcb08('0x49')],{})[_0xcb08('0x3d')](respondWithResult(_0x46921a,0xc9))[_0xcb08('0x41')](handleError(_0x46921a,null));};exports['update']=function(_0x457fa7,_0x303750){if(_0x457fa7[_0xcb08('0x49')]['id']){delete _0x457fa7['body']['id'];}return db[_0xcb08('0x2a')]['find']({'where':{'id':_0x457fa7[_0xcb08('0x43')]['id']}})[_0xcb08('0x3d')](handleEntityNotFound(_0x303750,null))[_0xcb08('0x3d')](saveUpdates(_0x457fa7[_0xcb08('0x49')],null))['then'](respondWithResult(_0x303750,null))[_0xcb08('0x41')](handleError(_0x303750,null));};exports[_0xcb08('0x4a')]=function(_0xb90c88,_0x3f38fb){return db[_0xcb08('0x2a')][_0xcb08('0x47')]({'where':{'id':_0xb90c88['params']['id']}})[_0xcb08('0x3d')](handleEntityNotFound(_0x3f38fb,null))[_0xcb08('0x3d')](removeEntity(_0x3f38fb,null))[_0xcb08('0x41')](handleError(_0x3f38fb,null));};exports['describe']=function(_0x2e9401,_0x2c55a3){return db['VoiceDialReport'][_0xcb08('0x4b')]()[_0xcb08('0x3d')](respondWithResult(_0x2c55a3,null))[_0xcb08('0x41')](handleError(_0x2c55a3,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 17c13da..19fa778 100644 --- a/server/api/voiceDialReport/voiceDialReport.model.js +++ b/server/api/voiceDialReport/voiceDialReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x368f=['exports','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x368f,0xd6));var _0xf368=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x368f[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xf368('0x0'));var logger=require(_0xf368('0x1'))(_0xf368('0x2'));var moment=require('moment');var BPromise=require(_0xf368('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf368('0x4'));var rimraf=require(_0xf368('0x5'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xf368('0x6')]=function(_0x3893fb,_0x32cc25){return _0x3893fb['define'](_0xf368('0x7'),attributes,{'tableName':_0xf368('0x8'),'paranoid':![],'indexes':[{'fields':[_0xf368('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25e4=['../../config/logger','api','moment','bluebird','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util'];(function(_0x35064d,_0x27affa){var _0x345fb3=function(_0x12d2e9){while(--_0x12d2e9){_0x35064d['push'](_0x35064d['shift']());}};_0x345fb3(++_0x27affa);}(_0x25e4,0xde));var _0x425e=function(_0x44d6ee,_0x1f38f4){_0x44d6ee=_0x44d6ee-0x0;var _0x4aa180=_0x25e4[_0x44d6ee];return _0x4aa180;};'use strict';var _=require(_0x425e('0x0'));var util=require(_0x425e('0x1'));var logger=require(_0x425e('0x2'))(_0x425e('0x3'));var moment=require(_0x425e('0x4'));var BPromise=require(_0x425e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x425e('0x6'));var rimraf=require(_0x425e('0x7'));var config=require('../../config/environment');var attributes=require(_0x425e('0x8'));module[_0x425e('0x9')]=function(_0x59d851,_0x106713){return _0x59d851[_0x425e('0xa')](_0x425e('0xb'),attributes,{'tableName':_0x425e('0xc'),'paranoid':![],'indexes':[{'fields':[_0x425e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index f2b5a72..adb7f9e 100644 --- a/server/api/voiceDialReport/voiceDialReport.rpc.js +++ b/server/api/voiceDialReport/voiceDialReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45c8=['ioredis','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','attributes','limit','lodash','moment','bluebird','randomstring'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x45c8,0xef));var _0x845c=function(_0x662168,_0xf079fd){_0x662168=_0x662168-0x0;var _0x3c4968=_0x45c8[_0x662168];return _0x3c4968;};'use strict';var _=require(_0x845c('0x0'));var util=require('util');var moment=require(_0x845c('0x1'));var BPromise=require(_0x845c('0x2'));var rs=require(_0x845c('0x3'));var fs=require('fs');var Redis=require(_0x845c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x845c('0x5'));var jayson=require(_0x845c('0x6'));var client=jayson[_0x845c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335f38,_0x4a1a42,_0x42b569){return new BPromise(function(_0x4648e1,_0x3075cd){return client[_0x845c('0x8')](_0x335f38,_0x42b569)[_0x845c('0x9')](function(_0x34a8ae){logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));logger[_0x845c('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4a1a42,'request\x20sent',JSON[_0x845c('0xe')](_0x34a8ae));if(_0x34a8ae[_0x845c('0xf')]){if(_0x34a8ae['error'][_0x845c('0x10')]===0x1f4){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);return _0x3075cd(_0x34a8ae[_0x845c('0xf')]['message']);}logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae['error'][_0x845c('0x11')]);return _0x4648e1(_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);}else{logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));_0x4648e1(_0x34a8ae[_0x845c('0x12')]['message']);}})['catch'](function(_0x3b1ff9){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x3b1ff9);_0x3075cd(_0x3b1ff9);});});}exports['CreateVoiceDialReport']=function(_0x1f9bed){var _0x104314=this;return new Promise(function(_0x452b54,_0x48e7d4){return db['VoiceDialReport']['create'](_0x1f9bed[_0x845c('0x13')],{'raw':_0x1f9bed['options']?_0x1f9bed[_0x845c('0x14')][_0x845c('0x15')]===undefined?!![]:![]:!![]})[_0x845c('0x9')](function(_0x3a8f19){logger[_0x845c('0xa')]('CreateVoiceDialReport',_0x1f9bed);logger[_0x845c('0xd')]('CreateVoiceDialReport',_0x1f9bed,JSON[_0x845c('0xe')](_0x3a8f19));_0x452b54(_0x3a8f19);})['catch'](function(_0x2c6bc8){logger['error'](_0x845c('0x16'),_0x2c6bc8['message'],_0x1f9bed);_0x48e7d4(_0x104314[_0x845c('0xf')](0x1f4,_0x2c6bc8[_0x845c('0x11')]));});});};exports[_0x845c('0x17')]=function(_0x129b6e){var _0x132516=this;return new Promise(function(_0x1d323c,_0x4efe76){return db[_0x845c('0x18')]['update'](_0x129b6e[_0x845c('0x13')],{'raw':_0x129b6e[_0x845c('0x14')]?_0x129b6e['options'][_0x845c('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x129b6e[_0x845c('0x14')]?_0x129b6e[_0x845c('0x14')]['where']||null:null,'attributes':_0x129b6e['options']?_0x129b6e[_0x845c('0x14')][_0x845c('0x19')]||null:null,'limit':_0x129b6e[_0x845c('0x14')]?_0x129b6e['options'][_0x845c('0x1a')]||null:null})[_0x845c('0x9')](function(_0x447d69){logger[_0x845c('0xa')]('UpdateVoiceDialReport',_0x129b6e);logger[_0x845c('0xd')](_0x845c('0x17'),_0x129b6e,JSON[_0x845c('0xe')](_0x447d69));_0x1d323c(_0x447d69);})['catch'](function(_0x27f470){logger[_0x845c('0xf')]('UpdateVoiceDialReport',_0x27f470[_0x845c('0x11')],_0x129b6e);_0x4efe76(_0x132516[_0x845c('0xf')](0x1f4,_0x27f470[_0x845c('0x11')]));});});}; \ No newline at end of file +var _0x03ce=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','VoiceDialReport','create','body','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','options','where','attributes','limit','catch','lodash','util','moment'];(function(_0x5a1b48,_0x314dbe){var _0x3173e4=function(_0x3a161d){while(--_0x3a161d){_0x5a1b48['push'](_0x5a1b48['shift']());}};_0x3173e4(++_0x314dbe);}(_0x03ce,0x1a1));var _0xe03c=function(_0xd6177c,_0xcf82d9){_0xd6177c=_0xd6177c-0x0;var _0x453bd7=_0x03ce[_0xd6177c];return _0x453bd7;};'use strict';var _=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var moment=require(_0xe03c('0x2'));var BPromise=require(_0xe03c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe03c('0x4'));var db=require(_0xe03c('0x5'))['db'];var utils=require(_0xe03c('0x6'));var logger=require('../../config/logger')(_0xe03c('0x7'));var config=require(_0xe03c('0x8'));var jayson=require(_0xe03c('0x9'));var client=jayson[_0xe03c('0xa')][_0xe03c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c54f,_0x89f039,_0x52dda4){return new BPromise(function(_0x53c2b0,_0x3bca56){return client[_0xe03c('0xc')](_0x44c54f,_0x52dda4)[_0xe03c('0xd')](function(_0x267044){logger[_0xe03c('0xe')](_0xe03c('0xf'),_0x89f039,_0xe03c('0x10'));logger[_0xe03c('0x11')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x89f039,_0xe03c('0x10'),JSON[_0xe03c('0x12')](_0x267044));if(_0x267044[_0xe03c('0x13')]){if(_0x267044['error'][_0xe03c('0x14')]===0x1f4){logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x267044[_0xe03c('0x13')][_0xe03c('0x15')]);return _0x3bca56(_0x267044['error'][_0xe03c('0x15')]);}logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x267044['error'][_0xe03c('0x15')]);return _0x53c2b0(_0x267044[_0xe03c('0x13')][_0xe03c('0x15')]);}else{logger[_0xe03c('0xe')](_0xe03c('0xf'),_0x89f039,'request\x20sent');_0x53c2b0(_0x267044[_0xe03c('0x16')][_0xe03c('0x15')]);}})['catch'](function(_0x7160ac){logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x7160ac);_0x3bca56(_0x7160ac);});});}exports['CreateVoiceDialReport']=function(_0x56ec58){var _0x23080a=this;return new Promise(function(_0x386cb7,_0x47da2a){return db[_0xe03c('0x17')][_0xe03c('0x18')](_0x56ec58[_0xe03c('0x19')],{'raw':_0x56ec58['options']?_0x56ec58['options'][_0xe03c('0x1a')]===undefined?!![]:![]:!![]})[_0xe03c('0xd')](function(_0x3bf505){logger[_0xe03c('0xe')](_0xe03c('0x1b'),_0x56ec58);logger[_0xe03c('0x11')](_0xe03c('0x1b'),_0x56ec58,JSON[_0xe03c('0x12')](_0x3bf505));_0x386cb7(_0x3bf505);})['catch'](function(_0x1cbf9f){logger['error'](_0xe03c('0x1b'),_0x1cbf9f[_0xe03c('0x15')],_0x56ec58);_0x47da2a(_0x23080a[_0xe03c('0x13')](0x1f4,_0x1cbf9f[_0xe03c('0x15')]));});});};exports[_0xe03c('0x1c')]=function(_0x95a4b3){var _0x37f5ff=this;return new Promise(function(_0x55605d,_0x37c3cb){return db[_0xe03c('0x17')][_0xe03c('0x1d')](_0x95a4b3[_0xe03c('0x19')],{'raw':_0x95a4b3[_0xe03c('0x1e')]?_0x95a4b3[_0xe03c('0x1e')][_0xe03c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x95a4b3[_0xe03c('0x1e')]?_0x95a4b3[_0xe03c('0x1e')][_0xe03c('0x1f')]||null:null,'attributes':_0x95a4b3[_0xe03c('0x1e')]?_0x95a4b3[_0xe03c('0x1e')][_0xe03c('0x20')]||null:null,'limit':_0x95a4b3[_0xe03c('0x1e')]?_0x95a4b3[_0xe03c('0x1e')][_0xe03c('0x21')]||null:null})['then'](function(_0x590d3c){logger['info'](_0xe03c('0x1c'),_0x95a4b3);logger[_0xe03c('0x11')](_0xe03c('0x1c'),_0x95a4b3,JSON[_0xe03c('0x12')](_0x590d3c));_0x55605d(_0x590d3c);})[_0xe03c('0x22')](function(_0x46fb63){logger[_0xe03c('0x13')](_0xe03c('0x1c'),_0x46fb63['message'],_0x95a4b3);_0x37c3cb(_0x37f5ff[_0xe03c('0x13')](0x1f4,_0x46fb63[_0xe03c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a68fe5a..ff797b2 100644 --- a/server/api/voiceExtension/index.js +++ b/server/api/voiceExtension/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x318f=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','/:id/applications','addApplications','put','update','delete'];(function(_0x3a6310,_0x10728e){var _0x1ec8e8=function(_0x47fc5e){while(--_0x47fc5e){_0x3a6310['push'](_0x3a6310['shift']());}};_0x1ec8e8(++_0x10728e);}(_0x318f,0x191));var _0xf318=function(_0x215bd6,_0x23f3fc){_0x215bd6=_0x215bd6-0x0;var _0x15a638=_0x318f[_0x215bd6];return _0x15a638;};'use strict';var multer=require(_0xf318('0x0'));var util=require(_0xf318('0x1'));var path=require(_0xf318('0x2'));var timeout=require(_0xf318('0x3'));var express=require('express');var router=express[_0xf318('0x4')]();var auth=require(_0xf318('0x5'));var interaction=require(_0xf318('0x6'));var config=require('../../config/environment');var controller=require(_0xf318('0x7'));router[_0xf318('0x8')]('/',auth[_0xf318('0x9')](),controller[_0xf318('0xa')]);router[_0xf318('0x8')](_0xf318('0xb'),auth[_0xf318('0x9')](),controller[_0xf318('0xc')]);router['post']('/',auth[_0xf318('0x9')](),controller[_0xf318('0xd')]);router['post'](_0xf318('0xe'),auth[_0xf318('0x9')](),controller[_0xf318('0xf')]);router[_0xf318('0x10')](_0xf318('0xb'),auth[_0xf318('0x9')](),controller[_0xf318('0x11')]);router[_0xf318('0x12')](_0xf318('0xb'),auth[_0xf318('0x9')](),controller[_0xf318('0x13')]);module[_0xf318('0x14')]=router; \ No newline at end of file +var _0x1c90=['/:id/applications','addApplications','put','update','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','index','/:id','isAuthenticated','show','post'];(function(_0x97d3ab,_0x4fe603){var _0x1ea3ed=function(_0x12b507){while(--_0x12b507){_0x97d3ab['push'](_0x97d3ab['shift']());}};_0x1ea3ed(++_0x4fe603);}(_0x1c90,0x135));var _0x01c9=function(_0x3ef3a4,_0x2f0e47){_0x3ef3a4=_0x3ef3a4-0x0;var _0x4d7d57=_0x1c90[_0x3ef3a4];return _0x4d7d57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x01c9('0x0'));var timeout=require(_0x01c9('0x1'));var express=require('express');var router=express[_0x01c9('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x01c9('0x3'));var config=require(_0x01c9('0x4'));var controller=require(_0x01c9('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x01c9('0x6')]);router['get'](_0x01c9('0x7'),auth[_0x01c9('0x8')](),controller[_0x01c9('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x01c9('0xa')](_0x01c9('0xb'),auth[_0x01c9('0x8')](),controller[_0x01c9('0xc')]);router[_0x01c9('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x01c9('0xe')]);router['delete']('/:id',auth[_0x01c9('0x8')](),controller['destroy']);module[_0x01c9('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 8472711..5797cf5 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x53d03f,_0x3bab8f){var _0x4fd204=function(_0x2fccd3){while(--_0x2fccd3){_0x53d03f['push'](_0x53d03f['shift']());}};_0x4fd204(++_0x3bab8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x29e6fc,_0x37548a){var _0x43194b=function(_0x1b1ce0){while(--_0x1b1ce0){_0x29e6fc['push'](_0x29e6fc['shift']());}};_0x43194b(++_0x37548a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 527ec80..c5025b0 100644 --- a/server/api/voiceExtension/voiceExtension.controller.js +++ b/server/api/voiceExtension/voiceExtension.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2929=['addApplications','findOne','sequelize','transaction','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','count','offset','set','apply','update','destroy','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','ignore','map','includes','find','value','name','UserProfileResource','then','error','send','index','VoiceExtension','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','params','keys','rawAttributes','length','includeAll','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition'];(function(_0x47dbb7,_0x3008ac){var _0x2f53dc=function(_0x19ee10){while(--_0x19ee10){_0x47dbb7['push'](_0x47dbb7['shift']());}};_0x2f53dc(++_0x3008ac);}(_0x2929,0x77));var _0x9292=function(_0x42b852,_0x1b41b0){_0x42b852=_0x42b852-0x0;var _0x17ce29=_0x2929[_0x42b852];return _0x17ce29;};'use strict';var pdf=require(_0x9292('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9292('0x1'));var jsonpatch=require(_0x9292('0x2'));var rp=require(_0x9292('0x3'));var moment=require(_0x9292('0x4'));var BPromise=require(_0x9292('0x5'));var Mustache=require(_0x9292('0x6'));var util=require(_0x9292('0x7'));var path=require(_0x9292('0x8'));var sox=require(_0x9292('0x9'));var csv=require(_0x9292('0xa'));var ejs=require(_0x9292('0xb'));var fs=require('fs');var _=require(_0x9292('0xc'));var squel=require('squel');var crypto=require(_0x9292('0xd'));var jsforce=require(_0x9292('0xe'));var deskjs=require(_0x9292('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9292('0x10'));var Papa=require(_0x9292('0x11'));var Redis=require('ioredis');var authService=require(_0x9292('0x12'));var qs=require(_0x9292('0x13'));var as=require(_0x9292('0x14'));var hardwareService=require(_0x9292('0x15'));var logger=require(_0x9292('0x16'))(_0x9292('0x17'));var utils=require(_0x9292('0x18'));var config=require(_0x9292('0x19'));var db=require(_0x9292('0x1a'))['db'];config[_0x9292('0x1b')]=_[_0x9292('0x1c')](config[_0x9292('0x1b')],{'host':_0x9292('0x1d'),'port':0x18eb});var socket=require(_0x9292('0x1e'))(new Redis(config['redis']));require(_0x9292('0x1f'))[_0x9292('0x20')](socket);function respondWithStatusCode(_0x1d359c,_0x5e325e){_0x5e325e=_0x5e325e||0xcc;return function(_0x1fe2a6){if(_0x1fe2a6){return _0x1d359c[_0x9292('0x21')](_0x5e325e);}return _0x1d359c[_0x9292('0x22')](_0x5e325e)[_0x9292('0x23')]();};}function respondWithResult(_0xbbd90,_0x46b920){_0x46b920=_0x46b920||0xc8;return function(_0x1b445b){if(_0x1b445b){return _0xbbd90[_0x9292('0x22')](_0x46b920)[_0x9292('0x24')](_0x1b445b);}};}function respondWithFilteredResult(_0x2ef1f7,_0x5322f7){return function(_0x5ea88f){if(_0x5ea88f){var _0x2143bd=_0x5ea88f[_0x9292('0x25')],_0x8ed424=_0x5322f7[_0x9292('0x26')],_0x1a1957=_0x5322f7[_0x9292('0x26')]+_0x5322f7['limit'],_0x40f65c;if(_0x1a1957>=_0x2143bd){_0x1a1957=_0x2143bd;_0x40f65c=0xc8;}else{_0x40f65c=0xce;}_0x2ef1f7[_0x9292('0x22')](_0x40f65c);return _0x2ef1f7[_0x9292('0x27')]('Content-Range',_0x8ed424+'-'+_0x1a1957+'/'+_0x2143bd)[_0x9292('0x24')](_0x5ea88f);}return null;};}function patchUpdates(_0x2b9166){return function(_0x4078b6){try{jsonpatch[_0x9292('0x28')](_0x4078b6,_0x2b9166,!![]);}catch(_0x7f6d22){return BPromise['reject'](_0x7f6d22);}return _0x4078b6['save']();};}function saveUpdates(_0x20256d,_0x29c63e){return function(_0x5d8ee8){if(_0x5d8ee8){return _0x5d8ee8[_0x9292('0x29')](_0x20256d)['then'](function(_0x27a9a1){return _0x27a9a1;});}return null;};}function removeEntity(_0x1eb7d4,_0x5904a8){return function(_0x74039){if(_0x74039){return _0x74039[_0x9292('0x2a')]()['then'](function(){var _0x100503=_0x74039[_0x9292('0x2b')]({'plain':!![]});var _0x35c815=[{'name':_0x9292('0x2c'),'value':_0x9292('0x2d'),'ignore':![]},{'name':'OutboundRoutes','value':_0x9292('0x2e'),'ignore':![]},{'name':_0x9292('0x2f'),'value':_0x9292('0x30'),'ignore':![]}];var _0x1af15b=_(_0x35c815)['filter'](_0x9292('0x31'))[_0x9292('0x32')]('value')['value']();if(_[_0x9292('0x33')](_0x1af15b,_0x100503['type'])){return;}var _0x55de72=_[_0x9292('0x34')](_0x35c815,[_0x9292('0x35'),_0x100503['type']])[_0x9292('0x36')];return db[_0x9292('0x37')][_0x9292('0x2a')]({'where':{'type':_0x55de72,'resourceId':_0x100503['id']}})[_0x9292('0x38')](function(){return _0x74039;});})[_0x9292('0x38')](function(){_0x1eb7d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56e067,_0x3ac69b){return function(_0x12afa4){if(!_0x12afa4){_0x56e067[_0x9292('0x21')](0x194);}return _0x12afa4;};}function handleError(_0x24d455,_0x4fd976){_0x4fd976=_0x4fd976||0x1f4;return function(_0xd2469){logger[_0x9292('0x39')](_0xd2469['stack']);if(_0xd2469['name']){delete _0xd2469['name'];}_0x24d455[_0x9292('0x22')](_0x4fd976)[_0x9292('0x3a')](_0xd2469);};}exports[_0x9292('0x3b')]=function(_0x3561e3,_0xb67186){var _0x44dae7={},_0x327def={},_0x308acd={'count':0x0,'rows':[]};var _0x500fee=_[_0x9292('0x32')](db[_0x9292('0x3c')]['rawAttributes'],function(_0x5f522c){return{'name':_0x5f522c['fieldName'],'type':_0x5f522c[_0x9292('0x3d')][_0x9292('0x3e')]};});_0x327def[_0x9292('0x3f')]=_[_0x9292('0x32')](_0x500fee,_0x9292('0x36'));_0x327def['query']=_['keys'](_0x3561e3[_0x9292('0x40')]);_0x327def[_0x9292('0x41')]=_[_0x9292('0x42')](_0x327def[_0x9292('0x3f')],_0x327def['query']);_0x44dae7[_0x9292('0x43')]=_[_0x9292('0x42')](_0x327def[_0x9292('0x3f')],qs['fields'](_0x3561e3[_0x9292('0x40')][_0x9292('0x44')]));_0x44dae7[_0x9292('0x43')]=_0x44dae7[_0x9292('0x43')]['length']?_0x44dae7[_0x9292('0x43')]:_0x327def['model'];if(!_0x3561e3[_0x9292('0x40')][_0x9292('0x45')](_0x9292('0x46'))){_0x44dae7[_0x9292('0x47')]=qs[_0x9292('0x47')](_0x3561e3['query'][_0x9292('0x47')]);_0x44dae7[_0x9292('0x26')]=qs['offset'](_0x3561e3['query'][_0x9292('0x26')]);}_0x44dae7[_0x9292('0x48')]=qs[_0x9292('0x49')](_0x3561e3[_0x9292('0x40')][_0x9292('0x49')]);_0x44dae7[_0x9292('0x4a')]=qs['filters'](_[_0x9292('0x4b')](_0x3561e3[_0x9292('0x40')],_0x327def['filters']));if(_0x3561e3[_0x9292('0x40')]['filter']){_0x44dae7[_0x9292('0x4a')]=_[_0x9292('0x4c')](_0x44dae7['where'],{'$or':_[_0x9292('0x32')](_0x500fee,function(_0x33fc28){if(_0x33fc28[_0x9292('0x3d')]!==_0x9292('0x4d')){var _0x46bf61={};_0x46bf61[_0x33fc28[_0x9292('0x36')]]={'$like':'%'+_0x3561e3[_0x9292('0x40')][_0x9292('0x4e')]+'%'};return _0x46bf61;}})});}_0x44dae7=_[_0x9292('0x4c')]({},_0x44dae7,_0x3561e3[_0x9292('0x4f')]);var _0x11860f={'where':_0x44dae7[_0x9292('0x4a')]};return db[_0x9292('0x3c')][_0x9292('0x25')](_0x11860f)[_0x9292('0x38')](function(_0x910830){_0x308acd[_0x9292('0x25')]=_0x910830;if(_0x3561e3[_0x9292('0x40')]['includeAll']){_0x44dae7[_0x9292('0x50')]=[{'all':!![]}];}return db['VoiceExtension'][_0x9292('0x51')](_0x44dae7);})[_0x9292('0x38')](function(_0x115928){_0x308acd['rows']=_0x115928;return _0x308acd;})[_0x9292('0x38')](respondWithFilteredResult(_0xb67186,_0x44dae7))[_0x9292('0x52')](handleError(_0xb67186,null));};exports['show']=function(_0x5f397a,_0x312fee){var _0x5669cd={'raw':![],'where':{'id':_0x5f397a[_0x9292('0x53')]['id']}},_0x53d44d={};_0x53d44d[_0x9292('0x3f')]=_[_0x9292('0x54')](db[_0x9292('0x3c')][_0x9292('0x55')]);_0x53d44d[_0x9292('0x40')]=_['keys'](_0x5f397a[_0x9292('0x40')]);_0x53d44d[_0x9292('0x41')]=_[_0x9292('0x42')](_0x53d44d['model'],_0x53d44d['query']);_0x5669cd['attributes']=_['intersection'](_0x53d44d[_0x9292('0x3f')],qs[_0x9292('0x44')](_0x5f397a[_0x9292('0x40')]['fields']));_0x5669cd[_0x9292('0x43')]=_0x5669cd[_0x9292('0x43')][_0x9292('0x56')]?_0x5669cd[_0x9292('0x43')]:_0x53d44d[_0x9292('0x3f')];if(_0x5f397a[_0x9292('0x40')][_0x9292('0x57')]){_0x5669cd[_0x9292('0x50')]=[{'all':!![]}];}_0x5669cd=_[_0x9292('0x4c')]({},_0x5669cd,_0x5f397a['options']);return db[_0x9292('0x3c')]['find'](_0x5669cd)[_0x9292('0x38')](handleEntityNotFound(_0x312fee,null))[_0x9292('0x38')](respondWithResult(_0x312fee,null))[_0x9292('0x52')](handleError(_0x312fee,null));};exports[_0x9292('0x2a')]=function(_0x5a8e7c,_0x155a9e){return db[_0x9292('0x3c')][_0x9292('0x34')]({'where':{'id':_0x5a8e7c[_0x9292('0x53')]['id']}})[_0x9292('0x38')](handleEntityNotFound(_0x155a9e,null))[_0x9292('0x38')](removeEntity(_0x155a9e,null))['catch'](handleError(_0x155a9e,null));};exports[_0x9292('0x58')]=function(_0x2b09c6,_0x3dd77c){if(_0x2b09c6[_0x9292('0x59')][_0x9292('0x3d')]===_0x9292('0x2e')&&!_[_0x9292('0x5a')](_0x2b09c6[_0x9292('0x59')]['exten'],'_')){_0x2b09c6[_0x9292('0x59')][_0x9292('0x5b')]='_'[_0x9292('0x5c')](_0x2b09c6['body']['exten']);}return db[_0x9292('0x3c')][_0x9292('0x58')](_0x2b09c6[_0x9292('0x59')],{'raw':![]})[_0x9292('0x38')](function(_0x2fe6a7){var _0x1eb92f=_0x2b09c6[_0x9292('0x5d')]['get']({'plain':!![]});if(!_0x1eb92f)throw new Error(_0x9292('0x5e'));if(_0x1eb92f[_0x9292('0x5f')]==='user'){var _0x118855=_0x2fe6a7[_0x9292('0x2b')]({'plain':!![]});var _0x18867a=[{'name':_0x9292('0x2c'),'value':'inbound'},{'name':_0x9292('0x60'),'value':_0x9292('0x2e')},{'name':'InternalRoutes','value':_0x9292('0x30')}];var _0x288fb7=_[_0x9292('0x34')](_0x18867a,[_0x9292('0x35'),_0x118855[_0x9292('0x3d')]])[_0x9292('0x36')];return db[_0x9292('0x61')]['find']({'where':{'name':_0x288fb7,'userProfileId':_0x1eb92f['userProfileId']},'raw':!![]})['then'](function(_0x39c225){if(_0x39c225&&_0x39c225[_0x9292('0x62')]===0x0){return db['UserProfileResource'][_0x9292('0x58')]({'name':_0x118855[_0x9292('0x36')],'resourceId':_0x118855['id'],'type':_0x39c225['name'],'sectionId':_0x39c225['id']},{})[_0x9292('0x38')](function(){return _0x2fe6a7;});}else{return _0x2fe6a7;}})[_0x9292('0x52')](function(_0x415065){logger[_0x9292('0x39')](_0x9292('0x63'),_0x415065);throw _0x415065;});}return _0x2fe6a7;})[_0x9292('0x38')](respondWithResult(_0x3dd77c,0xc9))[_0x9292('0x52')](handleError(_0x3dd77c,null));};exports[_0x9292('0x29')]=function(_0xa32990,_0x18111d){if(_0xa32990[_0x9292('0x59')]['id']){delete _0xa32990[_0x9292('0x59')]['id'];}return db[_0x9292('0x3c')]['find']({'where':{'id':_0xa32990[_0x9292('0x53')]['id']}})[_0x9292('0x38')](handleEntityNotFound(_0x18111d,null))[_0x9292('0x38')](function(_0x432a77){if(_0x432a77){return db[_0x9292('0x3c')][_0x9292('0x29')](_[_0x9292('0x4b')](_0xa32990['body'],[_0x9292('0x5b'),_0x9292('0x64'),_0x9292('0x65'),_0x9292('0x66'),_0x9292('0x67'),_0x9292('0x68')]),{'where':{'context':_0x432a77[_0x9292('0x64')],'exten':_0x432a77[_0x9292('0x5b')]},'individualHooks':!![]})[_0x9292('0x38')](function(_0xe125c8){return _0xe125c8;});}return null;})[_0x9292('0x38')](respondWithStatusCode(_0x18111d,null))[_0x9292('0x52')](handleError(_0x18111d,null));};exports[_0x9292('0x69')]=function(_0x24a9a3,_0x2902f0,_0x4c55f5){return db['VoiceExtension'][_0x9292('0x6a')]({'where':{'id':_0x24a9a3[_0x9292('0x53')]['id']}})[_0x9292('0x38')](handleEntityNotFound(_0x2902f0,null))[_0x9292('0x38')](function(_0x24d623){if(_0x24d623){return db[_0x9292('0x6b')][_0x9292('0x6c')](function(_0x2d358d){return db[_0x9292('0x3c')][_0x9292('0x2a')]({'where':{'VoiceExtensionId':_0x24a9a3[_0x9292('0x53')]['id']},'transaction':_0x2d358d})[_0x9292('0x38')](function(_0x34de47){var _0x5bcc1b=_['map'](_0x24a9a3['body'],function(_0x5d6ce1){_0x5d6ce1['VoiceExtensionId']=_0x24a9a3[_0x9292('0x53')]['id'];return _0x5d6ce1;});return db[_0x9292('0x3c')][_0x9292('0x6d')](_0x5bcc1b,{'transaction':_0x2d358d});});})[_0x9292('0x38')](function(){return db['VoiceExtension'][_0x9292('0x6e')]({'where':{'isApp':!![],'VoiceExtensionId':_0x24a9a3['params']['id']},'order':_0x9292('0x6f')});});}})[_0x9292('0x38')](respondWithResult(_0x2902f0,null))[_0x9292('0x52')](handleError(_0x2902f0,null));}; \ No newline at end of file +var _0xab95=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','count','offset','set','apply','save','update','then','destroy','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','type','find','name','end','stack','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','limit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','params','fields','catch','create','startsWith','body','exten','concat','user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','mandatoryDisposition','addApplications','sequelize','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2a0e05,_0x39bf1c){var _0x486d00=function(_0x4525c1){while(--_0x4525c1){_0x2a0e05['push'](_0x2a0e05['shift']());}};_0x486d00(++_0x39bf1c);}(_0xab95,0x118));var _0x5ab9=function(_0x136acf,_0x45fa0b){_0x136acf=_0x136acf-0x0;var _0x36a6cd=_0xab95[_0x136acf];return _0x36a6cd;};'use strict';var pdf=require(_0x5ab9('0x0'));var emlformat=require(_0x5ab9('0x1'));var rimraf=require(_0x5ab9('0x2'));var zipdir=require(_0x5ab9('0x3'));var jsonpatch=require(_0x5ab9('0x4'));var rp=require(_0x5ab9('0x5'));var moment=require(_0x5ab9('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5ab9('0x7'));var util=require(_0x5ab9('0x8'));var path=require('path');var sox=require(_0x5ab9('0x9'));var csv=require(_0x5ab9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5ab9('0xb'));var squel=require(_0x5ab9('0xc'));var crypto=require(_0x5ab9('0xd'));var jsforce=require(_0x5ab9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5ab9('0xa'));var querystring=require(_0x5ab9('0xf'));var Papa=require(_0x5ab9('0x10'));var Redis=require('ioredis');var authService=require(_0x5ab9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5ab9('0x12'));var hardwareService=require(_0x5ab9('0x13'));var logger=require(_0x5ab9('0x14'))('api');var utils=require(_0x5ab9('0x15'));var config=require(_0x5ab9('0x16'));var db=require(_0x5ab9('0x17'))['db'];config[_0x5ab9('0x18')]=_['defaults'](config['redis'],{'host':_0x5ab9('0x19'),'port':0x18eb});var socket=require(_0x5ab9('0x1a'))(new Redis(config[_0x5ab9('0x18')]));require(_0x5ab9('0x1b'))[_0x5ab9('0x1c')](socket);function respondWithStatusCode(_0xe4c783,_0x6fc108){_0x6fc108=_0x6fc108||0xcc;return function(_0x516f5a){if(_0x516f5a){return _0xe4c783[_0x5ab9('0x1d')](_0x6fc108);}return _0xe4c783[_0x5ab9('0x1e')](_0x6fc108)['end']();};}function respondWithResult(_0xbc8fec,_0x32d16a){_0x32d16a=_0x32d16a||0xc8;return function(_0x3d8d0f){if(_0x3d8d0f){return _0xbc8fec['status'](_0x32d16a)['json'](_0x3d8d0f);}};}function respondWithFilteredResult(_0x1a0228,_0x4272e6){return function(_0x45be4a){if(_0x45be4a){var _0x8971d3=_0x45be4a[_0x5ab9('0x1f')],_0x445577=_0x4272e6['offset'],_0x5e2650=_0x4272e6[_0x5ab9('0x20')]+_0x4272e6['limit'],_0x23fc9e;if(_0x5e2650>=_0x8971d3){_0x5e2650=_0x8971d3;_0x23fc9e=0xc8;}else{_0x23fc9e=0xce;}_0x1a0228[_0x5ab9('0x1e')](_0x23fc9e);return _0x1a0228[_0x5ab9('0x21')]('Content-Range',_0x445577+'-'+_0x5e2650+'/'+_0x8971d3)['json'](_0x45be4a);}return null;};}function patchUpdates(_0x303586){return function(_0x16c1d3){try{jsonpatch[_0x5ab9('0x22')](_0x16c1d3,_0x303586,!![]);}catch(_0x50d757){return BPromise['reject'](_0x50d757);}return _0x16c1d3[_0x5ab9('0x23')]();};}function saveUpdates(_0x3f0afb,_0x551803){return function(_0x48373f){if(_0x48373f){return _0x48373f[_0x5ab9('0x24')](_0x3f0afb)[_0x5ab9('0x25')](function(_0x4b44f9){return _0x4b44f9;});}return null;};}function removeEntity(_0x53e64c,_0x55a4f9){return function(_0x2ed5ee){if(_0x2ed5ee){return _0x2ed5ee[_0x5ab9('0x26')]()['then'](function(){var _0x4ca7e4=_0x2ed5ee[_0x5ab9('0x27')]({'plain':!![]});var _0x306b3a=[{'name':_0x5ab9('0x28'),'value':_0x5ab9('0x29'),'ignore':![]},{'name':'OutboundRoutes','value':_0x5ab9('0x2a'),'ignore':![]},{'name':_0x5ab9('0x2b'),'value':_0x5ab9('0x2c'),'ignore':![]}];var _0x1b73bb=_(_0x306b3a)[_0x5ab9('0x2d')](_0x5ab9('0x2e'))[_0x5ab9('0x2f')](_0x5ab9('0x30'))[_0x5ab9('0x30')]();if(_['includes'](_0x1b73bb,_0x4ca7e4[_0x5ab9('0x31')])){return;}var _0x5afc52=_[_0x5ab9('0x32')](_0x306b3a,[_0x5ab9('0x30'),_0x4ca7e4[_0x5ab9('0x31')]])[_0x5ab9('0x33')];return db['UserProfileResource']['destroy']({'where':{'type':_0x5afc52,'resourceId':_0x4ca7e4['id']}})['then'](function(){return _0x2ed5ee;});})['then'](function(){_0x53e64c['status'](0xcc)[_0x5ab9('0x34')]();});}};}function handleEntityNotFound(_0x3bb295,_0x2b8d52){return function(_0x18b397){if(!_0x18b397){_0x3bb295[_0x5ab9('0x1d')](0x194);}return _0x18b397;};}function handleError(_0x12f8d6,_0x1fece9){_0x1fece9=_0x1fece9||0x1f4;return function(_0x3bb061){logger['error'](_0x3bb061[_0x5ab9('0x35')]);if(_0x3bb061[_0x5ab9('0x33')]){delete _0x3bb061[_0x5ab9('0x33')];}_0x12f8d6[_0x5ab9('0x1e')](_0x1fece9)['send'](_0x3bb061);};}exports['index']=function(_0x33758d,_0xafbcc6){var _0x5edfb4={},_0x14e6d0={},_0x4eb7a3={'count':0x0,'rows':[]};var _0x19ba43=_[_0x5ab9('0x2f')](db[_0x5ab9('0x36')][_0x5ab9('0x37')],function(_0x28c4a7){return{'name':_0x28c4a7[_0x5ab9('0x38')],'type':_0x28c4a7[_0x5ab9('0x31')][_0x5ab9('0x39')]};});_0x14e6d0[_0x5ab9('0x3a')]=_[_0x5ab9('0x2f')](_0x19ba43,_0x5ab9('0x33'));_0x14e6d0['query']=_[_0x5ab9('0x3b')](_0x33758d[_0x5ab9('0x3c')]);_0x14e6d0[_0x5ab9('0x3d')]=_[_0x5ab9('0x3e')](_0x14e6d0['model'],_0x14e6d0['query']);_0x5edfb4['attributes']=_[_0x5ab9('0x3e')](_0x14e6d0[_0x5ab9('0x3a')],qs['fields'](_0x33758d[_0x5ab9('0x3c')]['fields']));_0x5edfb4[_0x5ab9('0x3f')]=_0x5edfb4[_0x5ab9('0x3f')][_0x5ab9('0x40')]?_0x5edfb4[_0x5ab9('0x3f')]:_0x14e6d0[_0x5ab9('0x3a')];if(!_0x33758d[_0x5ab9('0x3c')]['hasOwnProperty']('nolimit')){_0x5edfb4['limit']=qs['limit'](_0x33758d[_0x5ab9('0x3c')][_0x5ab9('0x41')]);_0x5edfb4[_0x5ab9('0x20')]=qs['offset'](_0x33758d[_0x5ab9('0x3c')][_0x5ab9('0x20')]);}_0x5edfb4[_0x5ab9('0x42')]=qs['sort'](_0x33758d[_0x5ab9('0x3c')][_0x5ab9('0x43')]);_0x5edfb4[_0x5ab9('0x44')]=qs[_0x5ab9('0x3d')](_[_0x5ab9('0x45')](_0x33758d[_0x5ab9('0x3c')],_0x14e6d0['filters']));if(_0x33758d[_0x5ab9('0x3c')][_0x5ab9('0x2d')]){_0x5edfb4[_0x5ab9('0x44')]=_[_0x5ab9('0x46')](_0x5edfb4['where'],{'$or':_['map'](_0x19ba43,function(_0x5a9bb0){if(_0x5a9bb0['type']!=='VIRTUAL'){var _0x3e546e={};_0x3e546e[_0x5a9bb0[_0x5ab9('0x33')]]={'$like':'%'+_0x33758d['query'][_0x5ab9('0x2d')]+'%'};return _0x3e546e;}})});}_0x5edfb4=_['merge']({},_0x5edfb4,_0x33758d[_0x5ab9('0x47')]);var _0x5b9277={'where':_0x5edfb4[_0x5ab9('0x44')]};return db[_0x5ab9('0x36')]['count'](_0x5b9277)[_0x5ab9('0x25')](function(_0x586776){_0x4eb7a3[_0x5ab9('0x1f')]=_0x586776;if(_0x33758d[_0x5ab9('0x3c')][_0x5ab9('0x48')]){_0x5edfb4[_0x5ab9('0x49')]=[{'all':!![]}];}return db[_0x5ab9('0x36')][_0x5ab9('0x4a')](_0x5edfb4);})[_0x5ab9('0x25')](function(_0x15bada){_0x4eb7a3[_0x5ab9('0x4b')]=_0x15bada;return _0x4eb7a3;})['then'](respondWithFilteredResult(_0xafbcc6,_0x5edfb4))['catch'](handleError(_0xafbcc6,null));};exports['show']=function(_0x2a8972,_0x46e096){var _0x26e9ca={'raw':![],'where':{'id':_0x2a8972[_0x5ab9('0x4c')]['id']}},_0x402936={};_0x402936['model']=_[_0x5ab9('0x3b')](db[_0x5ab9('0x36')][_0x5ab9('0x37')]);_0x402936[_0x5ab9('0x3c')]=_[_0x5ab9('0x3b')](_0x2a8972[_0x5ab9('0x3c')]);_0x402936[_0x5ab9('0x3d')]=_[_0x5ab9('0x3e')](_0x402936[_0x5ab9('0x3a')],_0x402936[_0x5ab9('0x3c')]);_0x26e9ca[_0x5ab9('0x3f')]=_[_0x5ab9('0x3e')](_0x402936['model'],qs['fields'](_0x2a8972[_0x5ab9('0x3c')][_0x5ab9('0x4d')]));_0x26e9ca[_0x5ab9('0x3f')]=_0x26e9ca[_0x5ab9('0x3f')][_0x5ab9('0x40')]?_0x26e9ca[_0x5ab9('0x3f')]:_0x402936['model'];if(_0x2a8972[_0x5ab9('0x3c')][_0x5ab9('0x48')]){_0x26e9ca[_0x5ab9('0x49')]=[{'all':!![]}];}_0x26e9ca=_[_0x5ab9('0x46')]({},_0x26e9ca,_0x2a8972[_0x5ab9('0x47')]);return db[_0x5ab9('0x36')][_0x5ab9('0x32')](_0x26e9ca)[_0x5ab9('0x25')](handleEntityNotFound(_0x46e096,null))[_0x5ab9('0x25')](respondWithResult(_0x46e096,null))[_0x5ab9('0x4e')](handleError(_0x46e096,null));};exports['destroy']=function(_0x3967cf,_0x2c16ca){return db[_0x5ab9('0x36')][_0x5ab9('0x32')]({'where':{'id':_0x3967cf[_0x5ab9('0x4c')]['id']}})[_0x5ab9('0x25')](handleEntityNotFound(_0x2c16ca,null))[_0x5ab9('0x25')](removeEntity(_0x2c16ca,null))[_0x5ab9('0x4e')](handleError(_0x2c16ca,null));};exports[_0x5ab9('0x4f')]=function(_0x55e84a,_0x5d1840){if(_0x55e84a['body'][_0x5ab9('0x31')]===_0x5ab9('0x2a')&&!_[_0x5ab9('0x50')](_0x55e84a[_0x5ab9('0x51')]['exten'],'_')){_0x55e84a[_0x5ab9('0x51')][_0x5ab9('0x52')]='_'[_0x5ab9('0x53')](_0x55e84a[_0x5ab9('0x51')][_0x5ab9('0x52')]);}return db['VoiceExtension'][_0x5ab9('0x4f')](_0x55e84a['body'],{'raw':![]})[_0x5ab9('0x25')](function(_0x5ad360){var _0x1d67c6=_0x55e84a[_0x5ab9('0x54')][_0x5ab9('0x27')]({'plain':!![]});if(!_0x1d67c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d67c6[_0x5ab9('0x55')]===_0x5ab9('0x54')){var _0x6d5d5=_0x5ad360[_0x5ab9('0x27')]({'plain':!![]});var _0x4b2cb7=[{'name':_0x5ab9('0x28'),'value':_0x5ab9('0x29')},{'name':'OutboundRoutes','value':_0x5ab9('0x2a')},{'name':_0x5ab9('0x2b'),'value':_0x5ab9('0x2c')}];var _0x7e2f33=_[_0x5ab9('0x32')](_0x4b2cb7,[_0x5ab9('0x30'),_0x6d5d5[_0x5ab9('0x31')]])[_0x5ab9('0x33')];return db[_0x5ab9('0x56')][_0x5ab9('0x32')]({'where':{'name':_0x7e2f33,'userProfileId':_0x1d67c6['userProfileId']},'raw':!![]})[_0x5ab9('0x25')](function(_0x263fc2){if(_0x263fc2&&_0x263fc2[_0x5ab9('0x57')]===0x0){return db[_0x5ab9('0x58')][_0x5ab9('0x4f')]({'name':_0x6d5d5[_0x5ab9('0x33')],'resourceId':_0x6d5d5['id'],'type':_0x263fc2[_0x5ab9('0x33')],'sectionId':_0x263fc2['id']},{})[_0x5ab9('0x25')](function(){return _0x5ad360;});}else{return _0x5ad360;}})[_0x5ab9('0x4e')](function(_0x11efdf){logger[_0x5ab9('0x59')](_0x5ab9('0x5a'),_0x11efdf);throw _0x11efdf;});}return _0x5ad360;})['then'](respondWithResult(_0x5d1840,0xc9))['catch'](handleError(_0x5d1840,null));};exports['update']=function(_0x2bfb62,_0x591103){if(_0x2bfb62[_0x5ab9('0x51')]['id']){delete _0x2bfb62[_0x5ab9('0x51')]['id'];}return db[_0x5ab9('0x36')][_0x5ab9('0x32')]({'where':{'id':_0x2bfb62[_0x5ab9('0x4c')]['id']}})[_0x5ab9('0x25')](handleEntityNotFound(_0x591103,null))[_0x5ab9('0x25')](function(_0x4bd378){if(_0x4bd378){return db[_0x5ab9('0x36')][_0x5ab9('0x24')](_[_0x5ab9('0x45')](_0x2bfb62[_0x5ab9('0x51')],[_0x5ab9('0x52'),_0x5ab9('0x5b'),'description',_0x5ab9('0x5c'),'cutdigits',_0x5ab9('0x5d')]),{'where':{'context':_0x4bd378['context'],'exten':_0x4bd378['exten']},'individualHooks':!![]})[_0x5ab9('0x25')](function(_0x5962a2){return _0x5962a2;});}return null;})[_0x5ab9('0x25')](respondWithStatusCode(_0x591103,null))['catch'](handleError(_0x591103,null));};exports[_0x5ab9('0x5e')]=function(_0x20a8db,_0x22decb,_0x64deb0){return db[_0x5ab9('0x36')]['findOne']({'where':{'id':_0x20a8db['params']['id']}})[_0x5ab9('0x25')](handleEntityNotFound(_0x22decb,null))['then'](function(_0x30c5d8){if(_0x30c5d8){return db[_0x5ab9('0x5f')][_0x5ab9('0x60')](function(_0x110e19){return db[_0x5ab9('0x36')]['destroy']({'where':{'VoiceExtensionId':_0x20a8db[_0x5ab9('0x4c')]['id']},'transaction':_0x110e19})[_0x5ab9('0x25')](function(_0x5c78ee){var _0x31aedd=_['map'](_0x20a8db[_0x5ab9('0x51')],function(_0x56e824){_0x56e824[_0x5ab9('0x61')]=_0x20a8db[_0x5ab9('0x4c')]['id'];return _0x56e824;});return db[_0x5ab9('0x36')][_0x5ab9('0x62')](_0x31aedd,{'transaction':_0x110e19});});})[_0x5ab9('0x25')](function(){return db[_0x5ab9('0x36')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x20a8db['params']['id']},'order':_0x5ab9('0x63')});});}})[_0x5ab9('0x25')](respondWithResult(_0x22decb,null))[_0x5ab9('0x4e')](handleError(_0x22decb,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index b7e52a2..8cfd3f7 100644 --- a/server/api/voiceExtension/voiceExtension.events.js +++ b/server/api/voiceExtension/voiceExtension.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbb1=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0xfbb1,0x1e3));var _0x1fbb=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xfbb1[_0x2742db];return _0x18659e;};'use strict';var EventEmitter=require(_0x1fbb('0x0'));var VoiceExtension=require(_0x1fbb('0x1'))['db'][_0x1fbb('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x1fbb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fbb('0x4'),'afterDestroy':_0x1fbb('0x5')};function emitEvent(_0x5babb8){return function(_0x5dd6fb,_0x48ec11,_0x142e3a){VoiceExtensionEvents[_0x1fbb('0x6')](_0x5babb8+':'+_0x5dd6fb['id'],_0x5dd6fb);VoiceExtensionEvents['emit'](_0x5babb8,_0x5dd6fb);_0x142e3a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x1fbb('0x7')](e,emitEvent(event));}}module[_0x1fbb('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x7886=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x46f5f7,_0x1ff6af){var _0x239aed=function(_0x4e73af){while(--_0x4e73af){_0x46f5f7['push'](_0x46f5f7['shift']());}};_0x239aed(++_0x1ff6af);}(_0x7886,0xc4));var _0x6788=function(_0x373dd6,_0x28a9e4){_0x373dd6=_0x373dd6-0x0;var _0x229d2f=_0x7886[_0x373dd6];return _0x229d2f;};'use strict';var EventEmitter=require(_0x6788('0x0'));var VoiceExtension=require(_0x6788('0x1'))['db'][_0x6788('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6788('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6788('0x4'),'afterDestroy':_0x6788('0x5')};function emitEvent(_0x3de92b){return function(_0x4eddaa,_0x4aa323,_0x80577){VoiceExtensionEvents[_0x6788('0x6')](_0x3de92b+':'+_0x4eddaa['id'],_0x4eddaa);VoiceExtensionEvents[_0x6788('0x6')](_0x3de92b,_0x4eddaa);_0x80577(null);};}for(var e in events){if(events[_0x6788('0x7')](e)){var event=events[e];VoiceExtension[_0x6788('0x8')](e,emitEvent(event));}}module[_0x6788('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 064950a..e580042 100644 --- a/server/api/voiceExtension/voiceExtension.model.js +++ b/server/api/voiceExtension/voiceExtension.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda08=['./voiceExtension.attributes','exports','define','voice_extensions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x502408,_0x2352c8){var _0x154aa8=function(_0x1f5dd8){while(--_0x1f5dd8){_0x502408['push'](_0x502408['shift']());}};_0x154aa8(++_0x2352c8);}(_0xda08,0xd0));var _0x8da0=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xda08[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x8da0('0x0'));var util=require(_0x8da0('0x1'));var logger=require(_0x8da0('0x2'))(_0x8da0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8da0('0x4'));var fs=require('fs');var path=require(_0x8da0('0x5'));var rimraf=require(_0x8da0('0x6'));var config=require(_0x8da0('0x7'));var attributes=require(_0x8da0('0x8'));module[_0x8da0('0x9')]=function(_0x3934ab,_0x4c9a44){return _0x3934ab[_0x8da0('0xa')]('VoiceExtension',attributes,{'tableName':_0x8da0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fd6=['request-promise','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger','moment'];(function(_0x33397a,_0x23bad3){var _0x45574b=function(_0x40360b){while(--_0x40360b){_0x33397a['push'](_0x33397a['shift']());}};_0x45574b(++_0x23bad3);}(_0x2fd6,0xf8));var _0x62fd=function(_0x451004,_0x222026){_0x451004=_0x451004-0x0;var _0x48f7cf=_0x2fd6[_0x451004];return _0x48f7cf;};'use strict';var _=require(_0x62fd('0x0'));var util=require(_0x62fd('0x1'));var logger=require(_0x62fd('0x2'))('api');var moment=require(_0x62fd('0x3'));var BPromise=require('bluebird');var rp=require(_0x62fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x62fd('0x5'));var config=require(_0x62fd('0x6'));var attributes=require(_0x62fd('0x7'));module[_0x62fd('0x8')]=function(_0x3d2894,_0x2b9e3b){return _0x3d2894[_0x62fd('0x9')](_0x62fd('0xa'),attributes,{'tableName':_0x62fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index d379a31..2718d9c 100644 --- a/server/api/voiceExtension/voiceExtension.rpc.js +++ b/server/api/voiceExtension/voiceExtension.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfac=['VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceExtension','options','raw','where','attributes','map','model','include','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','then','info'];(function(_0x3ac491,_0x758a1){var _0x4dac52=function(_0x8c87c8){while(--_0x8c87c8){_0x3ac491['push'](_0x3ac491['shift']());}};_0x4dac52(++_0x758a1);}(_0xdfac,0x129));var _0xcdfa=function(_0xdf5462,_0x66522a){_0xdf5462=_0xdf5462-0x0;var _0x12bcb0=_0xdfac[_0xdf5462];return _0x12bcb0;};'use strict';var _=require(_0xcdfa('0x0'));var util=require(_0xcdfa('0x1'));var moment=require(_0xcdfa('0x2'));var BPromise=require(_0xcdfa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdfa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdfa('0x5'));var logger=require('../../config/logger')(_0xcdfa('0x6'));var config=require(_0xcdfa('0x7'));var jayson=require(_0xcdfa('0x8'));var client=jayson[_0xcdfa('0x9')][_0xcdfa('0xa')]({'port':0x232a});config[_0xcdfa('0xb')]=_[_0xcdfa('0xc')](config[_0xcdfa('0xb')],{'host':_0xcdfa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcdfa('0xb')]));require(_0xcdfa('0xe'))[_0xcdfa('0xf')](socket);function respondWithRpcPromise(_0x61ae74,_0x4aff7b,_0xf747e9){return new BPromise(function(_0x2a52ba,_0x1f36c2){return client['request'](_0x61ae74,_0xf747e9)[_0xcdfa('0x10')](function(_0x218103){logger[_0xcdfa('0x11')](_0xcdfa('0x12'),_0x4aff7b,_0xcdfa('0x13'));logger['debug'](_0xcdfa('0x14'),_0x4aff7b,_0xcdfa('0x13'),JSON[_0xcdfa('0x15')](_0x218103));if(_0x218103['error']){if(_0x218103[_0xcdfa('0x16')][_0xcdfa('0x17')]===0x1f4){logger[_0xcdfa('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x4aff7b,_0x218103[_0xcdfa('0x16')][_0xcdfa('0x18')]);return _0x1f36c2(_0x218103['error'][_0xcdfa('0x18')]);}logger[_0xcdfa('0x16')](_0xcdfa('0x12'),_0x4aff7b,_0x218103[_0xcdfa('0x16')][_0xcdfa('0x18')]);return _0x2a52ba(_0x218103['error'][_0xcdfa('0x18')]);}else{logger['info'](_0xcdfa('0x12'),_0x4aff7b,'request\x20sent');_0x2a52ba(_0x218103['result'][_0xcdfa('0x18')]);}})[_0xcdfa('0x19')](function(_0x2c02ad){logger[_0xcdfa('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x4aff7b,_0x2c02ad);_0x1f36c2(_0x2c02ad);});});}exports[_0xcdfa('0x1a')]=function(_0x3342e6){var _0x1c5759=this;return new Promise(function(_0x29fcc7,_0x295894){return db['VoiceExtension']['findAll']({'raw':_0x3342e6[_0xcdfa('0x1b')]?_0x3342e6[_0xcdfa('0x1b')][_0xcdfa('0x1c')]===undefined?!![]:![]:!![],'where':_0x3342e6[_0xcdfa('0x1b')]?_0x3342e6[_0xcdfa('0x1b')][_0xcdfa('0x1d')]||null:null,'attributes':_0x3342e6[_0xcdfa('0x1b')]?_0x3342e6[_0xcdfa('0x1b')][_0xcdfa('0x1e')]||null:null,'limit':_0x3342e6[_0xcdfa('0x1b')]?_0x3342e6[_0xcdfa('0x1b')]['limit']||null:null,'include':_0x3342e6[_0xcdfa('0x1b')]?_0x3342e6[_0xcdfa('0x1b')]['include']?_[_0xcdfa('0x1f')](_0x3342e6[_0xcdfa('0x1b')]['include'],function(_0x315109){return{'model':db[_0x315109[_0xcdfa('0x20')]],'as':_0x315109['as'],'attributes':_0x315109[_0xcdfa('0x1e')],'include':_0x315109[_0xcdfa('0x21')]?_[_0xcdfa('0x1f')](_0x315109[_0xcdfa('0x21')],function(_0x36b215){return{'model':db[_0x36b215[_0xcdfa('0x20')]],'as':_0x36b215['as'],'attributes':_0x36b215[_0xcdfa('0x1e')],'include':_0x36b215[_0xcdfa('0x21')]?_['map'](_0x36b215[_0xcdfa('0x21')],function(_0x8dad20){return{'model':db[_0x8dad20[_0xcdfa('0x20')]],'as':_0x8dad20['as'],'attributes':_0x8dad20[_0xcdfa('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33c94b){logger[_0xcdfa('0x11')](_0xcdfa('0x1a'),_0x3342e6);logger[_0xcdfa('0x22')](_0xcdfa('0x1a'),_0x3342e6,JSON[_0xcdfa('0x15')](_0x33c94b));_0x29fcc7(_0x33c94b);})['catch'](function(_0x27737c){logger[_0xcdfa('0x16')](_0xcdfa('0x1a'),_0x27737c[_0xcdfa('0x18')],_0x3342e6);_0x295894(_0x1c5759[_0xcdfa('0x16')](0x1f4,_0x27737c['message']));});});}; \ No newline at end of file +var _0x8d3e=['result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','map','model','stringify','catch','lodash','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','./voiceExtension.socket','register','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','info'];(function(_0x191f9d,_0x21976f){var _0x58e60d=function(_0x598c0d){while(--_0x598c0d){_0x191f9d['push'](_0x191f9d['shift']());}};_0x58e60d(++_0x21976f);}(_0x8d3e,0x1a5));var _0xe8d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d3e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8d3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8d3('0x1'));var db=require(_0xe8d3('0x2'))['db'];var utils=require(_0xe8d3('0x3'));var logger=require('../../config/logger')(_0xe8d3('0x4'));var config=require('../../config/environment');var jayson=require(_0xe8d3('0x5'));var client=jayson['client'][_0xe8d3('0x6')]({'port':0x232a});config['redis']=_[_0xe8d3('0x7')](config[_0xe8d3('0x8')],{'host':_0xe8d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe8d3('0x8')]));require(_0xe8d3('0xa'))[_0xe8d3('0xb')](socket);function respondWithRpcPromise(_0x3cb544,_0x557bcd,_0x185f91){return new BPromise(function(_0x22e90e,_0x1a6380){return client['request'](_0x3cb544,_0x185f91)[_0xe8d3('0xc')](function(_0x160d5b){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x557bcd,_0xe8d3('0xd'));logger[_0xe8d3('0xe')](_0xe8d3('0xf'),_0x557bcd,'request\x20sent',JSON['stringify'](_0x160d5b));if(_0x160d5b[_0xe8d3('0x10')]){if(_0x160d5b['error'][_0xe8d3('0x11')]===0x1f4){logger[_0xe8d3('0x10')](_0xe8d3('0x12'),_0x557bcd,_0x160d5b[_0xe8d3('0x10')]['message']);return _0x1a6380(_0x160d5b[_0xe8d3('0x10')]['message']);}logger[_0xe8d3('0x10')](_0xe8d3('0x12'),_0x557bcd,_0x160d5b[_0xe8d3('0x10')][_0xe8d3('0x13')]);return _0x22e90e(_0x160d5b[_0xe8d3('0x10')][_0xe8d3('0x13')]);}else{logger[_0xe8d3('0x14')](_0xe8d3('0x12'),_0x557bcd,'request\x20sent');_0x22e90e(_0x160d5b[_0xe8d3('0x15')][_0xe8d3('0x13')]);}})['catch'](function(_0x347b01){logger[_0xe8d3('0x10')](_0xe8d3('0x12'),_0x557bcd,_0x347b01);_0x1a6380(_0x347b01);});});}exports[_0xe8d3('0x16')]=function(_0x1ff04f){var _0x3218be=this;return new Promise(function(_0x3767d7,_0x3db2f2){return db[_0xe8d3('0x17')][_0xe8d3('0x18')]({'raw':_0x1ff04f['options']?_0x1ff04f[_0xe8d3('0x19')][_0xe8d3('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ff04f[_0xe8d3('0x19')]?_0x1ff04f[_0xe8d3('0x19')][_0xe8d3('0x1b')]||null:null,'attributes':_0x1ff04f[_0xe8d3('0x19')]?_0x1ff04f[_0xe8d3('0x19')][_0xe8d3('0x1c')]||null:null,'limit':_0x1ff04f[_0xe8d3('0x19')]?_0x1ff04f[_0xe8d3('0x19')]['limit']||null:null,'include':_0x1ff04f[_0xe8d3('0x19')]?_0x1ff04f[_0xe8d3('0x19')][_0xe8d3('0x1d')]?_[_0xe8d3('0x1e')](_0x1ff04f[_0xe8d3('0x19')][_0xe8d3('0x1d')],function(_0x32310f){return{'model':db[_0x32310f[_0xe8d3('0x1f')]],'as':_0x32310f['as'],'attributes':_0x32310f[_0xe8d3('0x1c')],'include':_0x32310f['include']?_[_0xe8d3('0x1e')](_0x32310f[_0xe8d3('0x1d')],function(_0x5203e9){return{'model':db[_0x5203e9[_0xe8d3('0x1f')]],'as':_0x5203e9['as'],'attributes':_0x5203e9[_0xe8d3('0x1c')],'include':_0x5203e9['include']?_[_0xe8d3('0x1e')](_0x5203e9[_0xe8d3('0x1d')],function(_0x5f3480){return{'model':db[_0x5f3480[_0xe8d3('0x1f')]],'as':_0x5f3480['as'],'attributes':_0x5f3480[_0xe8d3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe8d3('0xc')](function(_0x23706b){logger[_0xe8d3('0x14')](_0xe8d3('0x16'),_0x1ff04f);logger[_0xe8d3('0xe')](_0xe8d3('0x16'),_0x1ff04f,JSON[_0xe8d3('0x20')](_0x23706b));_0x3767d7(_0x23706b);})[_0xe8d3('0x21')](function(_0x438760){logger[_0xe8d3('0x10')](_0xe8d3('0x16'),_0x438760['message'],_0x1ff04f);_0x3db2f2(_0x3218be[_0xe8d3('0x10')](0x1f4,_0x438760['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index bf1f38c..0757d2b 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f57=['removeListener','register','./voiceExtension.events','remove','emit'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9f57,0x16a));var _0x79f5=function(_0x3966c2,_0x5d5681){_0x3966c2=_0x3966c2-0x0;var _0x1e0775=_0x9f57[_0x3966c2];return _0x1e0775;};'use strict';var VoiceExtensionEvents=require(_0x79f5('0x0'));var events=['save',_0x79f5('0x1'),'update'];function createListener(_0x453a1b,_0x597ab6){return function(_0xf8378b){_0x597ab6[_0x79f5('0x2')](_0x453a1b,_0xf8378b);};}function removeListener(_0x1b0d25,_0xc3ea58){return function(){VoiceExtensionEvents[_0x79f5('0x3')](_0x1b0d25,_0xc3ea58);};}exports[_0x79f5('0x4')]=function(_0x123756){for(var _0x3d3d86=0x0,_0x214a77=events['length'];_0x3d3d86<_0x214a77;_0x3d3d86++){var _0x3ea959=events[_0x3d3d86];var _0x259f05=createListener('voiceExtension:'+_0x3ea959,_0x123756);VoiceExtensionEvents['on'](_0x3ea959,_0x259f05);}}; \ No newline at end of file +var _0x33e0=['voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener','register'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x33e0,0x179));var _0x033e=function(_0x7eaf8d,_0x42cc5c){_0x7eaf8d=_0x7eaf8d-0x0;var _0x593c01=_0x33e0[_0x7eaf8d];return _0x593c01;};'use strict';var VoiceExtensionEvents=require(_0x033e('0x0'));var events=[_0x033e('0x1'),_0x033e('0x2'),_0x033e('0x3')];function createListener(_0x297649,_0x470a36){return function(_0x48fd83){_0x470a36[_0x033e('0x4')](_0x297649,_0x48fd83);};}function removeListener(_0x3c46da,_0x69b1cb){return function(){VoiceExtensionEvents[_0x033e('0x5')](_0x3c46da,_0x69b1cb);};}exports[_0x033e('0x6')]=function(_0xd48653){for(var _0x5b82c7=0x0,_0x17e4c4=events['length'];_0x5b82c7<_0x17e4c4;_0x5b82c7++){var _0x19d5e8=events[_0x5b82c7];var _0x1f0136=createListener(_0x033e('0x7')+_0x19d5e8,_0xd48653);VoiceExtensionEvents['on'](_0x19d5e8,_0x1f0136);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index b4c6e97..3cda5b6 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6383=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/messages','getMessages','create','put','update','multer','util','path','connect-timeout'];(function(_0x455053,_0x563172){var _0x3e47b2=function(_0x4050a4){while(--_0x4050a4){_0x455053['push'](_0x455053['shift']());}};_0x3e47b2(++_0x563172);}(_0x6383,0x1c7));var _0x3638=function(_0x4282f0,_0x56c1e8){_0x4282f0=_0x4282f0-0x0;var _0x273fcf=_0x6383[_0x4282f0];return _0x273fcf;};'use strict';var multer=require(_0x3638('0x0'));var util=require(_0x3638('0x1'));var path=require(_0x3638('0x2'));var timeout=require(_0x3638('0x3'));var express=require(_0x3638('0x4'));var router=express[_0x3638('0x5')]();var auth=require(_0x3638('0x6'));var interaction=require(_0x3638('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x3638('0x8')]('/',auth[_0x3638('0x9')](),controller['index']);router[_0x3638('0x8')](_0x3638('0xa'),auth[_0x3638('0x9')](),controller[_0x3638('0xb')]);router[_0x3638('0x8')](_0x3638('0xc'),auth[_0x3638('0x9')](),controller[_0x3638('0xd')]);router['post']('/',auth[_0x3638('0x9')](),controller[_0x3638('0xe')]);router[_0x3638('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3638('0x10')]);router['delete'](_0x3638('0xa'),auth[_0x3638('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0861=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','/:id','/:id/messages','put','update','delete'];(function(_0x5b32a4,_0x2eea7f){var _0x4844ed=function(_0x4e5d7d){while(--_0x4e5d7d){_0x5b32a4['push'](_0x5b32a4['shift']());}};_0x4844ed(++_0x2eea7f);}(_0x0861,0xd1));var _0x1086=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0861[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x1086('0x0'));var util=require(_0x1086('0x1'));var path=require(_0x1086('0x2'));var timeout=require(_0x1086('0x3'));var express=require('express');var router=express[_0x1086('0x4')]();var auth=require(_0x1086('0x5'));var interaction=require(_0x1086('0x6'));var config=require('../../config/environment');var controller=require(_0x1086('0x7'));router[_0x1086('0x8')]('/',auth[_0x1086('0x9')](),controller['index']);router[_0x1086('0x8')](_0x1086('0xa'),auth[_0x1086('0x9')](),controller['show']);router[_0x1086('0x8')](_0x1086('0xb'),auth[_0x1086('0x9')](),controller['getMessages']);router['post']('/',auth[_0x1086('0x9')](),controller['create']);router[_0x1086('0xc')](_0x1086('0xa'),auth['isAuthenticated'](),controller[_0x1086('0xd')]);router[_0x1086('0xe')](_0x1086('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1086('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 66f8533..1e73ec0 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34b7=['TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','yes','ENUM','TINYINT(4)'];(function(_0x449f06,_0x56a32c){var _0x179378=function(_0x4e0a39){while(--_0x4e0a39){_0x449f06['push'](_0x449f06['shift']());}};_0x179378(++_0x56a32c);}(_0x34b7,0x196));var _0x734b=function(_0x31f6d2,_0x49129c){_0x31f6d2=_0x31f6d2-0x0;var _0xd9d2ba=_0x34b7[_0x31f6d2];return _0xd9d2ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x734b('0x0')]},'context':{'type':Sequelize[_0x734b('0x0')],'defaultValue':_0x734b('0x1'),'unique':_0x734b('0x2')},'mailbox':{'type':Sequelize[_0x734b('0x0')],'defaultValue':'','allowNull':![],'unique':_0x734b('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x734b('0x0')],'validate':{'isEmail':!![]},'set':function(_0x2fde69){this[_0x734b('0x3')](_0x734b('0x4'),typeof _0x2fde69===_0x734b('0x5')&&_0x2fde69[_0x734b('0x6')]()?_0x2fde69['trim']():null);}},'pager':{'type':Sequelize[_0x734b('0x0')]},'tz':{'type':Sequelize[_0x734b('0x0')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x734b('0x7'),'no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x734b('0x0')]},'callback':{'type':Sequelize[_0x734b('0x0')]},'review':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x734b('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x734b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x734b('0xa')},'emailsubject':{'type':Sequelize[_0x734b('0x0')]},'emailbody':{'type':Sequelize[_0x734b('0x0')]},'maxsecs':{'type':Sequelize[_0x734b('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x734b('0xc')](_0x734b('0xd'))+_0x734b('0xe')+this[_0x734b('0xc')](_0x734b('0xf'));}}}; \ No newline at end of file +var _0x93e9=['setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox'];(function(_0x3f3f1f,_0x28b7ea){var _0x16872b=function(_0xb81b23){while(--_0xb81b23){_0x3f3f1f['push'](_0x3f3f1f['shift']());}};_0x16872b(++_0x28b7ea);}(_0x93e9,0xcc));var _0x993e=function(_0x5f124a,_0x34e5d2){_0x5f124a=_0x5f124a-0x0;var _0x3717c1=_0x93e9[_0x5f124a];return _0x3717c1;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'customer_id':{'type':Sequelize[_0x993e('0x2')]},'context':{'type':Sequelize[_0x993e('0x2')],'defaultValue':_0x993e('0x3'),'unique':_0x993e('0x4')},'mailbox':{'type':Sequelize[_0x993e('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x993e('0x2')]},'email':{'type':Sequelize[_0x993e('0x2')],'validate':{'isEmail':!![]},'set':function(_0x15ce9b){this[_0x993e('0x5')](_0x993e('0x6'),typeof _0x15ce9b===_0x993e('0x7')&&_0x15ce9b[_0x993e('0x8')]()?_0x15ce9b[_0x993e('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x993e('0x2')],'defaultValue':_0x993e('0x9')},'attach':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':_0x993e('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x993e('0x2')]},'callback':{'type':Sequelize[_0x993e('0x2')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x993e('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x993e('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x993e('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':_0x993e('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':_0x993e('0xb'),'allowNull':![]},'stamp':{'type':_0x993e('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x993e('0x2')]},'maxsecs':{'type':Sequelize[_0x993e('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x993e('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x993e('0xf')],'get':function(){return this[_0x993e('0x10')](_0x993e('0x11'))+'\x20-\x20'+this[_0x993e('0x10')](_0x993e('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 26ca9ef..66da67c 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2071=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','intersection','length','sort','filters','filter','where','VIRTUAL','merge','count','includeAll','include','VoiceMail','findAll','rows','show','rawAttributes','fields','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','findOne','VoiceMailMessage','hasOwnProperty','nolimit','pick','mailbox','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel'];(function(_0xdcea81,_0x5e6a14){var _0x44228b=function(_0x1f09c0){while(--_0x1f09c0){_0xdcea81['push'](_0xdcea81['shift']());}};_0x44228b(++_0x5e6a14);}(_0x2071,0xa2));var _0x1207=function(_0x2c753c,_0x3378e7){_0x2c753c=_0x2c753c-0x0;var _0x23ba20=_0x2071[_0x2c753c];return _0x23ba20;};'use strict';var pdf=require(_0x1207('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1207('0x1'));var zipdir=require(_0x1207('0x2'));var jsonpatch=require(_0x1207('0x3'));var rp=require('request-promise');var moment=require(_0x1207('0x4'));var BPromise=require(_0x1207('0x5'));var Mustache=require(_0x1207('0x6'));var util=require(_0x1207('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1207('0x8'));var ejs=require(_0x1207('0x9'));var fs=require('fs');var _=require(_0x1207('0xa'));var squel=require(_0x1207('0xb'));var crypto=require(_0x1207('0xc'));var jsforce=require(_0x1207('0xd'));var deskjs=require(_0x1207('0xe'));var toCsv=require(_0x1207('0x8'));var querystring=require(_0x1207('0xf'));var Papa=require(_0x1207('0x10'));var Redis=require(_0x1207('0x11'));var authService=require(_0x1207('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1207('0x13'));var hardwareService=require(_0x1207('0x14'));var logger=require(_0x1207('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1207('0x16'))['db'];function respondWithStatusCode(_0x49108a,_0x14c3e3){_0x14c3e3=_0x14c3e3||0xcc;return function(_0x41f9f6){if(_0x41f9f6){return _0x49108a[_0x1207('0x17')](_0x14c3e3);}return _0x49108a[_0x1207('0x18')](_0x14c3e3)[_0x1207('0x19')]();};}function respondWithResult(_0xd7a260,_0x20ad58){_0x20ad58=_0x20ad58||0xc8;return function(_0x33b35c){if(_0x33b35c){return _0xd7a260[_0x1207('0x18')](_0x20ad58)[_0x1207('0x1a')](_0x33b35c);}};}function respondWithFilteredResult(_0x4838a8,_0x52de0d){return function(_0x20290b){if(_0x20290b){var _0x29f7df=_0x20290b['count'],_0x557bbf=_0x52de0d[_0x1207('0x1b')],_0x1bcd82=_0x52de0d[_0x1207('0x1b')]+_0x52de0d[_0x1207('0x1c')],_0x1cdd16;if(_0x1bcd82>=_0x29f7df){_0x1bcd82=_0x29f7df;_0x1cdd16=0xc8;}else{_0x1cdd16=0xce;}_0x4838a8['status'](_0x1cdd16);return _0x4838a8[_0x1207('0x1d')](_0x1207('0x1e'),_0x557bbf+'-'+_0x1bcd82+'/'+_0x29f7df)['json'](_0x20290b);}return null;};}function patchUpdates(_0x58b085){return function(_0x2e8217){try{jsonpatch[_0x1207('0x1f')](_0x2e8217,_0x58b085,!![]);}catch(_0xf6048c){return BPromise[_0x1207('0x20')](_0xf6048c);}return _0x2e8217[_0x1207('0x21')]();};}function saveUpdates(_0x3395f0,_0x45945f){return function(_0x26cbef){if(_0x26cbef){return _0x26cbef['update'](_0x3395f0)[_0x1207('0x22')](function(_0x170023){return _0x170023;});}return null;};}function removeEntity(_0x11f1de,_0x1a95a2){return function(_0x40be56){if(_0x40be56){return _0x40be56[_0x1207('0x23')]()[_0x1207('0x22')](function(){var _0x128474=_0x40be56[_0x1207('0x24')]({'plain':!![]});var _0x222271=_0x1207('0x25');return db[_0x1207('0x26')][_0x1207('0x23')]({'where':{'type':_0x222271,'resourceId':_0x128474['id']}})['then'](function(){return _0x40be56;});})[_0x1207('0x22')](function(){_0x11f1de[_0x1207('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b4547,_0x4fbf7a){return function(_0x3adba9){if(!_0x3adba9){_0x1b4547[_0x1207('0x17')](0x194);}return _0x3adba9;};}function handleError(_0x5a4b9f,_0x423c78){_0x423c78=_0x423c78||0x1f4;return function(_0xbafdf6){logger[_0x1207('0x27')](_0xbafdf6[_0x1207('0x28')]);if(_0xbafdf6['name']){delete _0xbafdf6[_0x1207('0x29')];}_0x5a4b9f['status'](_0x423c78)[_0x1207('0x2a')](_0xbafdf6);};}exports[_0x1207('0x2b')]=function(_0x72599b,_0x1df07c){var _0x190625={},_0x473d90={},_0x4c2108={'count':0x0,'rows':[]};var _0x4f9b1a=_[_0x1207('0x2c')](db['VoiceMail']['rawAttributes'],function(_0x5145f0){return{'name':_0x5145f0[_0x1207('0x2d')],'type':_0x5145f0[_0x1207('0x2e')]['key']};});_0x473d90['model']=_[_0x1207('0x2c')](_0x4f9b1a,'name');_0x473d90[_0x1207('0x2f')]=_[_0x1207('0x30')](_0x72599b[_0x1207('0x2f')]);_0x473d90['filters']=_['intersection'](_0x473d90[_0x1207('0x31')],_0x473d90[_0x1207('0x2f')]);_0x190625[_0x1207('0x32')]=_[_0x1207('0x33')](_0x473d90[_0x1207('0x31')],qs['fields'](_0x72599b[_0x1207('0x2f')]['fields']));_0x190625[_0x1207('0x32')]=_0x190625[_0x1207('0x32')][_0x1207('0x34')]?_0x190625['attributes']:_0x473d90[_0x1207('0x31')];if(!_0x72599b[_0x1207('0x2f')]['hasOwnProperty']('nolimit')){_0x190625[_0x1207('0x1c')]=qs['limit'](_0x72599b['query']['limit']);_0x190625[_0x1207('0x1b')]=qs['offset'](_0x72599b[_0x1207('0x2f')]['offset']);}_0x190625['order']=qs[_0x1207('0x35')](_0x72599b['query']['sort']);_0x190625['where']=qs[_0x1207('0x36')](_['pick'](_0x72599b[_0x1207('0x2f')],_0x473d90[_0x1207('0x36')]));if(_0x72599b[_0x1207('0x2f')][_0x1207('0x37')]){_0x190625[_0x1207('0x38')]=_['merge'](_0x190625[_0x1207('0x38')],{'$or':_[_0x1207('0x2c')](_0x4f9b1a,function(_0x1dd49d){if(_0x1dd49d['type']!==_0x1207('0x39')){var _0x260905={};_0x260905[_0x1dd49d[_0x1207('0x29')]]={'$like':'%'+_0x72599b['query']['filter']+'%'};return _0x260905;}})});}_0x190625=_[_0x1207('0x3a')]({},_0x190625,_0x72599b['options']);var _0x5c3533={'where':_0x190625[_0x1207('0x38')]};return db['VoiceMail'][_0x1207('0x3b')](_0x5c3533)['then'](function(_0x5a99f5){_0x4c2108[_0x1207('0x3b')]=_0x5a99f5;if(_0x72599b[_0x1207('0x2f')][_0x1207('0x3c')]){_0x190625[_0x1207('0x3d')]=[{'all':!![]}];}return db[_0x1207('0x3e')][_0x1207('0x3f')](_0x190625);})[_0x1207('0x22')](function(_0x2124e8){_0x4c2108[_0x1207('0x40')]=_0x2124e8;return _0x4c2108;})[_0x1207('0x22')](respondWithFilteredResult(_0x1df07c,_0x190625))['catch'](handleError(_0x1df07c,null));};exports[_0x1207('0x41')]=function(_0x33cdd1,_0x461977){var _0x53570c={'raw':!![],'where':{'id':_0x33cdd1['params']['id']}},_0x945567={};_0x945567['model']=_[_0x1207('0x30')](db[_0x1207('0x3e')][_0x1207('0x42')]);_0x945567[_0x1207('0x2f')]=_[_0x1207('0x30')](_0x33cdd1[_0x1207('0x2f')]);_0x945567[_0x1207('0x36')]=_[_0x1207('0x33')](_0x945567[_0x1207('0x31')],_0x945567[_0x1207('0x2f')]);_0x53570c[_0x1207('0x32')]=_[_0x1207('0x33')](_0x945567[_0x1207('0x31')],qs[_0x1207('0x43')](_0x33cdd1['query']['fields']));_0x53570c[_0x1207('0x32')]=_0x53570c[_0x1207('0x32')][_0x1207('0x34')]?_0x53570c['attributes']:_0x945567['model'];if(_0x33cdd1['query']['includeAll']){_0x53570c[_0x1207('0x3d')]=[{'all':!![]}];}_0x53570c=_[_0x1207('0x3a')]({},_0x53570c,_0x33cdd1[_0x1207('0x44')]);return db[_0x1207('0x3e')]['find'](_0x53570c)['then'](handleEntityNotFound(_0x461977,null))[_0x1207('0x22')](respondWithResult(_0x461977,null))[_0x1207('0x45')](handleError(_0x461977,null));};exports[_0x1207('0x46')]=function(_0x334bbb,_0x1d8a1c){return db['VoiceMail'][_0x1207('0x46')](_0x334bbb[_0x1207('0x47')],{})[_0x1207('0x22')](function(_0x50195f){var _0x5242de=_0x334bbb['user'][_0x1207('0x24')]({'plain':!![]});if(!_0x5242de)throw new Error(_0x1207('0x48'));if(_0x5242de[_0x1207('0x49')]===_0x1207('0x4a')){var _0x503820=_0x50195f[_0x1207('0x24')]({'plain':!![]});var _0x3cad61=_0x1207('0x25');return db[_0x1207('0x4b')][_0x1207('0x4c')]({'where':{'name':_0x3cad61,'userProfileId':_0x5242de[_0x1207('0x4d')]},'raw':!![]})[_0x1207('0x22')](function(_0x5817d8){if(_0x5817d8&&_0x5817d8['autoAssociation']===0x0){return db[_0x1207('0x26')][_0x1207('0x46')]({'name':_0x503820[_0x1207('0x29')],'resourceId':_0x503820['id'],'type':_0x5817d8[_0x1207('0x29')],'sectionId':_0x5817d8['id']},{})['then'](function(){return _0x50195f;});}else{return _0x50195f;}})['catch'](function(_0x544c81){logger[_0x1207('0x27')](_0x1207('0x4e'),_0x544c81);throw _0x544c81;});}return _0x50195f;})[_0x1207('0x22')](respondWithResult(_0x1d8a1c,0xc9))[_0x1207('0x45')](handleError(_0x1d8a1c,null));};exports[_0x1207('0x4f')]=function(_0x1e1567,_0x4ceb5c){if(_0x1e1567['body']['id']){delete _0x1e1567[_0x1207('0x47')]['id'];}return db[_0x1207('0x3e')]['find']({'where':{'id':_0x1e1567['params']['id']}})[_0x1207('0x22')](handleEntityNotFound(_0x4ceb5c,null))[_0x1207('0x22')](saveUpdates(_0x1e1567[_0x1207('0x47')],null))[_0x1207('0x22')](respondWithResult(_0x4ceb5c,null))[_0x1207('0x45')](handleError(_0x4ceb5c,null));};exports[_0x1207('0x23')]=function(_0x7b5a1a,_0x3a4ea8){return db['VoiceMail'][_0x1207('0x4c')]({'where':{'id':_0x7b5a1a[_0x1207('0x50')]['id']}})[_0x1207('0x22')](handleEntityNotFound(_0x3a4ea8,null))['then'](removeEntity(_0x3a4ea8,null))['catch'](handleError(_0x3a4ea8,null));};exports['getMessages']=function(_0x43a8f8,_0x12e74c,_0x77d2f2){return db[_0x1207('0x3e')][_0x1207('0x51')]({'where':{'id':_0x43a8f8[_0x1207('0x50')]['id']}})[_0x1207('0x22')](handleEntityNotFound(_0x12e74c,null))[_0x1207('0x22')](function(_0x5a0485){var _0x34247d;var _0x4ea384={},_0x306360={};_0x306360[_0x1207('0x31')]=_[_0x1207('0x30')](db[_0x1207('0x52')][_0x1207('0x42')]);_0x306360[_0x1207('0x2f')]=_[_0x1207('0x30')](_0x43a8f8[_0x1207('0x2f')]);_0x306360[_0x1207('0x36')]=_[_0x1207('0x33')](_0x306360[_0x1207('0x31')],_0x306360[_0x1207('0x2f')]);_0x4ea384[_0x1207('0x32')]=_['intersection'](_0x306360[_0x1207('0x31')],qs[_0x1207('0x43')](_0x43a8f8[_0x1207('0x2f')][_0x1207('0x43')]));_0x4ea384[_0x1207('0x32')]=_0x4ea384[_0x1207('0x32')][_0x1207('0x34')]?_0x4ea384[_0x1207('0x32')]:_0x306360[_0x1207('0x31')];if(!_0x43a8f8[_0x1207('0x2f')][_0x1207('0x53')](_0x1207('0x54'))){_0x4ea384[_0x1207('0x1c')]=qs[_0x1207('0x1c')](_0x43a8f8['query']['limit']);_0x4ea384[_0x1207('0x1b')]=qs[_0x1207('0x1b')](_0x43a8f8[_0x1207('0x2f')]['offset']);}_0x4ea384['order']=qs[_0x1207('0x35')](_0x43a8f8['query'][_0x1207('0x35')]);_0x4ea384[_0x1207('0x38')]=qs[_0x1207('0x36')](_[_0x1207('0x55')](_0x43a8f8[_0x1207('0x2f')],_0x306360[_0x1207('0x36')]));if(_0x43a8f8[_0x1207('0x2f')][_0x1207('0x37')]){_0x4ea384['where']=_[_0x1207('0x3a')](_0x4ea384['where'],{'$or':_[_0x1207('0x2c')](_0x4ea384[_0x1207('0x32')],function(_0x128c10){var _0x2306ce={};_0x2306ce[_0x128c10]={'$like':'%'+_0x43a8f8['query'][_0x1207('0x37')]+'%'};return _0x2306ce;})});}_0x4ea384[_0x1207('0x38')]=_[_0x1207('0x3a')](_0x4ea384[_0x1207('0x38')],{'mailboxuser':_0x5a0485[_0x1207('0x56')]});_0x4ea384=_['merge']({},_0x4ea384,_0x43a8f8[_0x1207('0x44')]);return db[_0x1207('0x52')]['findAndCountAll'](_0x4ea384)[_0x1207('0x22')](respondWithFilteredResult(_0x12e74c,_0x4ea384));})['catch'](handleError(_0x12e74c,null));}; \ No newline at end of file +var _0x5656=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','include','findAll','rows','catch','show','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','VoiceMailMessage','rawAttributes','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','get','UserProfileResource','destroy','error','name','send','index','VoiceMail','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x5656,0x1d5));var _0x6565=function(_0x595406,_0x1fc25b){_0x595406=_0x595406-0x0;var _0x4bc4c4=_0x5656[_0x595406];return _0x4bc4c4;};'use strict';var pdf=require(_0x6565('0x0'));var emlformat=require(_0x6565('0x1'));var rimraf=require(_0x6565('0x2'));var zipdir=require(_0x6565('0x3'));var jsonpatch=require(_0x6565('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6565('0x5'));var Mustache=require(_0x6565('0x6'));var util=require(_0x6565('0x7'));var path=require('path');var sox=require(_0x6565('0x8'));var csv=require(_0x6565('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6565('0xa'));var squel=require(_0x6565('0xb'));var crypto=require('crypto');var jsforce=require(_0x6565('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6565('0xd'));var Papa=require(_0x6565('0xe'));var Redis=require(_0x6565('0xf'));var authService=require(_0x6565('0x10'));var qs=require(_0x6565('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6565('0x12'));var logger=require('../../config/logger')(_0x6565('0x13'));var utils=require(_0x6565('0x14'));var config=require(_0x6565('0x15'));var db=require(_0x6565('0x16'))['db'];function respondWithStatusCode(_0x4def1b,_0xaebdea){_0xaebdea=_0xaebdea||0xcc;return function(_0x4cc262){if(_0x4cc262){return _0x4def1b[_0x6565('0x17')](_0xaebdea);}return _0x4def1b[_0x6565('0x18')](_0xaebdea)[_0x6565('0x19')]();};}function respondWithResult(_0x3ce1b8,_0x8bbc96){_0x8bbc96=_0x8bbc96||0xc8;return function(_0x414301){if(_0x414301){return _0x3ce1b8[_0x6565('0x18')](_0x8bbc96)['json'](_0x414301);}};}function respondWithFilteredResult(_0x295aef,_0x2ac16c){return function(_0x6ce2a3){if(_0x6ce2a3){var _0xea944c=_0x6ce2a3[_0x6565('0x1a')],_0x5be26a=_0x2ac16c[_0x6565('0x1b')],_0x2012cb=_0x2ac16c['offset']+_0x2ac16c[_0x6565('0x1c')],_0x5dd923;if(_0x2012cb>=_0xea944c){_0x2012cb=_0xea944c;_0x5dd923=0xc8;}else{_0x5dd923=0xce;}_0x295aef[_0x6565('0x18')](_0x5dd923);return _0x295aef[_0x6565('0x1d')](_0x6565('0x1e'),_0x5be26a+'-'+_0x2012cb+'/'+_0xea944c)[_0x6565('0x1f')](_0x6ce2a3);}return null;};}function patchUpdates(_0x3b653c){return function(_0x84be0){try{jsonpatch[_0x6565('0x20')](_0x84be0,_0x3b653c,!![]);}catch(_0x434fc2){return BPromise[_0x6565('0x21')](_0x434fc2);}return _0x84be0[_0x6565('0x22')]();};}function saveUpdates(_0x46098c,_0x17542f){return function(_0xced9a1){if(_0xced9a1){return _0xced9a1['update'](_0x46098c)[_0x6565('0x23')](function(_0x1098f3){return _0x1098f3;});}return null;};}function removeEntity(_0x3ead0,_0x49ec60){return function(_0x21aa8b){if(_0x21aa8b){return _0x21aa8b['destroy']()[_0x6565('0x23')](function(){var _0x1799a7=_0x21aa8b[_0x6565('0x24')]({'plain':!![]});var _0xe45cb8='Voicemails';return db[_0x6565('0x25')][_0x6565('0x26')]({'where':{'type':_0xe45cb8,'resourceId':_0x1799a7['id']}})[_0x6565('0x23')](function(){return _0x21aa8b;});})['then'](function(){_0x3ead0[_0x6565('0x18')](0xcc)[_0x6565('0x19')]();});}};}function handleEntityNotFound(_0xc5249b,_0x37a227){return function(_0x25831d){if(!_0x25831d){_0xc5249b[_0x6565('0x17')](0x194);}return _0x25831d;};}function handleError(_0x52361a,_0x28439d){_0x28439d=_0x28439d||0x1f4;return function(_0x3db3a0){logger[_0x6565('0x27')](_0x3db3a0['stack']);if(_0x3db3a0[_0x6565('0x28')]){delete _0x3db3a0[_0x6565('0x28')];}_0x52361a['status'](_0x28439d)[_0x6565('0x29')](_0x3db3a0);};}exports[_0x6565('0x2a')]=function(_0x2c8aad,_0xc1ed8a){var _0x3e3885={},_0x404464={},_0x34e4b1={'count':0x0,'rows':[]};var _0x1f4368=_['map'](db[_0x6565('0x2b')]['rawAttributes'],function(_0x59c414){return{'name':_0x59c414[_0x6565('0x2c')],'type':_0x59c414[_0x6565('0x2d')][_0x6565('0x2e')]};});_0x404464[_0x6565('0x2f')]=_['map'](_0x1f4368,_0x6565('0x28'));_0x404464[_0x6565('0x30')]=_[_0x6565('0x31')](_0x2c8aad[_0x6565('0x30')]);_0x404464[_0x6565('0x32')]=_[_0x6565('0x33')](_0x404464['model'],_0x404464[_0x6565('0x30')]);_0x3e3885[_0x6565('0x34')]=_[_0x6565('0x33')](_0x404464[_0x6565('0x2f')],qs['fields'](_0x2c8aad['query'][_0x6565('0x35')]));_0x3e3885[_0x6565('0x34')]=_0x3e3885[_0x6565('0x34')][_0x6565('0x36')]?_0x3e3885['attributes']:_0x404464[_0x6565('0x2f')];if(!_0x2c8aad[_0x6565('0x30')][_0x6565('0x37')](_0x6565('0x38'))){_0x3e3885[_0x6565('0x1c')]=qs[_0x6565('0x1c')](_0x2c8aad[_0x6565('0x30')][_0x6565('0x1c')]);_0x3e3885[_0x6565('0x1b')]=qs[_0x6565('0x1b')](_0x2c8aad[_0x6565('0x30')]['offset']);}_0x3e3885[_0x6565('0x39')]=qs[_0x6565('0x3a')](_0x2c8aad[_0x6565('0x30')][_0x6565('0x3a')]);_0x3e3885['where']=qs['filters'](_[_0x6565('0x3b')](_0x2c8aad[_0x6565('0x30')],_0x404464[_0x6565('0x32')]));if(_0x2c8aad[_0x6565('0x30')][_0x6565('0x3c')]){_0x3e3885[_0x6565('0x3d')]=_['merge'](_0x3e3885[_0x6565('0x3d')],{'$or':_[_0x6565('0x3e')](_0x1f4368,function(_0x3f56dc){if(_0x3f56dc[_0x6565('0x2d')]!==_0x6565('0x3f')){var _0x1911c9={};_0x1911c9[_0x3f56dc[_0x6565('0x28')]]={'$like':'%'+_0x2c8aad[_0x6565('0x30')][_0x6565('0x3c')]+'%'};return _0x1911c9;}})});}_0x3e3885=_[_0x6565('0x40')]({},_0x3e3885,_0x2c8aad['options']);var _0x2fe595={'where':_0x3e3885[_0x6565('0x3d')]};return db['VoiceMail']['count'](_0x2fe595)[_0x6565('0x23')](function(_0xdb1c00){_0x34e4b1[_0x6565('0x1a')]=_0xdb1c00;if(_0x2c8aad[_0x6565('0x30')]['includeAll']){_0x3e3885[_0x6565('0x41')]=[{'all':!![]}];}return db[_0x6565('0x2b')][_0x6565('0x42')](_0x3e3885);})[_0x6565('0x23')](function(_0xab4326){_0x34e4b1[_0x6565('0x43')]=_0xab4326;return _0x34e4b1;})[_0x6565('0x23')](respondWithFilteredResult(_0xc1ed8a,_0x3e3885))[_0x6565('0x44')](handleError(_0xc1ed8a,null));};exports[_0x6565('0x45')]=function(_0x26c060,_0x2b369b){var _0x3b02e4={'raw':!![],'where':{'id':_0x26c060['params']['id']}},_0x529acc={};_0x529acc[_0x6565('0x2f')]=_[_0x6565('0x31')](db['VoiceMail']['rawAttributes']);_0x529acc[_0x6565('0x30')]=_[_0x6565('0x31')](_0x26c060[_0x6565('0x30')]);_0x529acc[_0x6565('0x32')]=_[_0x6565('0x33')](_0x529acc[_0x6565('0x2f')],_0x529acc[_0x6565('0x30')]);_0x3b02e4[_0x6565('0x34')]=_['intersection'](_0x529acc[_0x6565('0x2f')],qs[_0x6565('0x35')](_0x26c060['query'][_0x6565('0x35')]));_0x3b02e4[_0x6565('0x34')]=_0x3b02e4[_0x6565('0x34')][_0x6565('0x36')]?_0x3b02e4[_0x6565('0x34')]:_0x529acc[_0x6565('0x2f')];if(_0x26c060[_0x6565('0x30')][_0x6565('0x46')]){_0x3b02e4[_0x6565('0x41')]=[{'all':!![]}];}_0x3b02e4=_[_0x6565('0x40')]({},_0x3b02e4,_0x26c060[_0x6565('0x47')]);return db[_0x6565('0x2b')][_0x6565('0x48')](_0x3b02e4)['then'](handleEntityNotFound(_0x2b369b,null))[_0x6565('0x23')](respondWithResult(_0x2b369b,null))[_0x6565('0x44')](handleError(_0x2b369b,null));};exports[_0x6565('0x49')]=function(_0x4d1d16,_0x27c3f3){return db[_0x6565('0x2b')]['create'](_0x4d1d16[_0x6565('0x4a')],{})[_0x6565('0x23')](function(_0x3d3c80){var _0x414122=_0x4d1d16[_0x6565('0x4b')][_0x6565('0x24')]({'plain':!![]});if(!_0x414122)throw new Error(_0x6565('0x4c'));if(_0x414122[_0x6565('0x4d')]===_0x6565('0x4b')){var _0x43bc8a=_0x3d3c80[_0x6565('0x24')]({'plain':!![]});var _0x536b0d='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x536b0d,'userProfileId':_0x414122[_0x6565('0x4e')]},'raw':!![]})[_0x6565('0x23')](function(_0x4abdc1){if(_0x4abdc1&&_0x4abdc1[_0x6565('0x4f')]===0x0){return db['UserProfileResource'][_0x6565('0x49')]({'name':_0x43bc8a[_0x6565('0x28')],'resourceId':_0x43bc8a['id'],'type':_0x4abdc1[_0x6565('0x28')],'sectionId':_0x4abdc1['id']},{})[_0x6565('0x23')](function(){return _0x3d3c80;});}else{return _0x3d3c80;}})['catch'](function(_0x1e4a04){logger[_0x6565('0x27')](_0x6565('0x50'),_0x1e4a04);throw _0x1e4a04;});}return _0x3d3c80;})[_0x6565('0x23')](respondWithResult(_0x27c3f3,0xc9))[_0x6565('0x44')](handleError(_0x27c3f3,null));};exports['update']=function(_0x820772,_0x1695f2){if(_0x820772['body']['id']){delete _0x820772[_0x6565('0x4a')]['id'];}return db[_0x6565('0x2b')]['find']({'where':{'id':_0x820772[_0x6565('0x51')]['id']}})['then'](handleEntityNotFound(_0x1695f2,null))[_0x6565('0x23')](saveUpdates(_0x820772[_0x6565('0x4a')],null))[_0x6565('0x23')](respondWithResult(_0x1695f2,null))[_0x6565('0x44')](handleError(_0x1695f2,null));};exports['destroy']=function(_0x543400,_0x237bab){return db[_0x6565('0x2b')][_0x6565('0x48')]({'where':{'id':_0x543400[_0x6565('0x51')]['id']}})[_0x6565('0x23')](handleEntityNotFound(_0x237bab,null))[_0x6565('0x23')](removeEntity(_0x237bab,null))['catch'](handleError(_0x237bab,null));};exports[_0x6565('0x52')]=function(_0xbe80ef,_0x4098dc,_0x57cdfe){return db[_0x6565('0x2b')]['findOne']({'where':{'id':_0xbe80ef[_0x6565('0x51')]['id']}})[_0x6565('0x23')](handleEntityNotFound(_0x4098dc,null))[_0x6565('0x23')](function(_0x4c9ddd){var _0x3e52ee;var _0x57d886={},_0x4b8325={};_0x4b8325[_0x6565('0x2f')]=_[_0x6565('0x31')](db[_0x6565('0x53')][_0x6565('0x54')]);_0x4b8325[_0x6565('0x30')]=_[_0x6565('0x31')](_0xbe80ef[_0x6565('0x30')]);_0x4b8325[_0x6565('0x32')]=_['intersection'](_0x4b8325[_0x6565('0x2f')],_0x4b8325[_0x6565('0x30')]);_0x57d886[_0x6565('0x34')]=_['intersection'](_0x4b8325[_0x6565('0x2f')],qs[_0x6565('0x35')](_0xbe80ef[_0x6565('0x30')][_0x6565('0x35')]));_0x57d886['attributes']=_0x57d886['attributes']['length']?_0x57d886[_0x6565('0x34')]:_0x4b8325[_0x6565('0x2f')];if(!_0xbe80ef[_0x6565('0x30')][_0x6565('0x37')](_0x6565('0x38'))){_0x57d886[_0x6565('0x1c')]=qs['limit'](_0xbe80ef['query']['limit']);_0x57d886['offset']=qs[_0x6565('0x1b')](_0xbe80ef['query'][_0x6565('0x1b')]);}_0x57d886[_0x6565('0x39')]=qs[_0x6565('0x3a')](_0xbe80ef[_0x6565('0x30')][_0x6565('0x3a')]);_0x57d886[_0x6565('0x3d')]=qs[_0x6565('0x32')](_[_0x6565('0x3b')](_0xbe80ef['query'],_0x4b8325[_0x6565('0x32')]));if(_0xbe80ef['query'][_0x6565('0x3c')]){_0x57d886[_0x6565('0x3d')]=_[_0x6565('0x40')](_0x57d886[_0x6565('0x3d')],{'$or':_[_0x6565('0x3e')](_0x57d886[_0x6565('0x34')],function(_0x327951){var _0x4d4d07={};_0x4d4d07[_0x327951]={'$like':'%'+_0xbe80ef[_0x6565('0x30')][_0x6565('0x3c')]+'%'};return _0x4d4d07;})});}_0x57d886['where']=_[_0x6565('0x40')](_0x57d886[_0x6565('0x3d')],{'mailboxuser':_0x4c9ddd[_0x6565('0x55')]});_0x57d886=_[_0x6565('0x40')]({},_0x57d886,_0xbe80ef[_0x6565('0x47')]);return db[_0x6565('0x53')][_0x6565('0x56')](_0x57d886)['then'](respondWithFilteredResult(_0x4098dc,_0x57d886));})[_0x6565('0x44')](handleError(_0x4098dc,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f29c662..00fb4bb 100644 --- a/server/api/voiceMail/voiceMail.model.js +++ b/server/api/voiceMail/voiceMail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32bb=['request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','context','util','../../config/logger','api','moment','bluebird'];(function(_0x4313d2,_0x3dc89e){var _0x4b449f=function(_0x30dc97){while(--_0x30dc97){_0x4313d2['push'](_0x4313d2['shift']());}};_0x4b449f(++_0x3dc89e);}(_0x32bb,0x87));var _0xb32b=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x32bb[_0x4e55a9];return _0x4a9b67;};'use strict';var _=require('lodash');var util=require(_0xb32b('0x0'));var logger=require(_0xb32b('0x1'))(_0xb32b('0x2'));var moment=require(_0xb32b('0x3'));var BPromise=require(_0xb32b('0x4'));var rp=require(_0xb32b('0x5'));var fs=require('fs');var path=require(_0xb32b('0x6'));var rimraf=require(_0xb32b('0x7'));var config=require(_0xb32b('0x8'));var attributes=require(_0xb32b('0x9'));module['exports']=function(_0x33e1f5,_0x42788b){return _0x33e1f5[_0xb32b('0xa')](_0xb32b('0xb'),attributes,{'tableName':_0xb32b('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xb32b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa217=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','util'];(function(_0x428800,_0x4ae1b5){var _0x2c614c=function(_0x324212){while(--_0x324212){_0x428800['push'](_0x428800['shift']());}};_0x2c614c(++_0x4ae1b5);}(_0xa217,0x1b2));var _0x7a21=function(_0x571f2e,_0x53f476){_0x571f2e=_0x571f2e-0x0;var _0x540a52=_0xa217[_0x571f2e];return _0x540a52;};'use strict';var _=require('lodash');var util=require(_0x7a21('0x0'));var logger=require('../../config/logger')(_0x7a21('0x1'));var moment=require(_0x7a21('0x2'));var BPromise=require(_0x7a21('0x3'));var rp=require(_0x7a21('0x4'));var fs=require('fs');var path=require(_0x7a21('0x5'));var rimraf=require(_0x7a21('0x6'));var config=require(_0x7a21('0x7'));var attributes=require(_0x7a21('0x8'));module[_0x7a21('0x9')]=function(_0x2afe38,_0x47f54b){return _0x2afe38[_0x7a21('0xa')](_0x7a21('0xb'),attributes,{'tableName':_0x7a21('0xc'),'paranoid':![],'indexes':[{'name':_0x7a21('0xd'),'fields':['mailbox',_0x7a21('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 59e74ec..4f1dd05 100644 --- a/server/api/voiceMail/voiceMail.rpc.js +++ b/server/api/voiceMail/voiceMail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4f0=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4fb7d2,_0x1f3f2d){var _0x5a0e1a=function(_0x386085){while(--_0x386085){_0x4fb7d2['push'](_0x4fb7d2['shift']());}};_0x5a0e1a(++_0x1f3f2d);}(_0xe4f0,0x1e5));var _0x0e4f=function(_0x39acfb,_0x2701c8){_0x39acfb=_0x39acfb-0x0;var _0x4e60af=_0xe4f0[_0x39acfb];return _0x4e60af;};'use strict';var _=require(_0x0e4f('0x0'));var util=require(_0x0e4f('0x1'));var moment=require('moment');var BPromise=require(_0x0e4f('0x2'));var rs=require(_0x0e4f('0x3'));var fs=require('fs');var Redis=require(_0x0e4f('0x4'));var db=require(_0x0e4f('0x5'))['db'];var utils=require(_0x0e4f('0x6'));var logger=require(_0x0e4f('0x7'))(_0x0e4f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0e4f('0x9')][_0x0e4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d75b8,_0x3e2608,_0x1bfba7){return new BPromise(function(_0x591c40,_0x5b56d0){return client[_0x0e4f('0xb')](_0x3d75b8,_0x1bfba7)['then'](function(_0x5e8e70){logger[_0x0e4f('0xc')](_0x0e4f('0xd'),_0x3e2608,_0x0e4f('0xe'));logger[_0x0e4f('0xf')](_0x0e4f('0x10'),_0x3e2608,_0x0e4f('0xe'),JSON['stringify'](_0x5e8e70));if(_0x5e8e70[_0x0e4f('0x11')]){if(_0x5e8e70[_0x0e4f('0x11')][_0x0e4f('0x12')]===0x1f4){logger[_0x0e4f('0x11')]('VoiceMail,\x20%s,\x20%s',_0x3e2608,_0x5e8e70[_0x0e4f('0x11')][_0x0e4f('0x13')]);return _0x5b56d0(_0x5e8e70[_0x0e4f('0x11')][_0x0e4f('0x13')]);}logger[_0x0e4f('0x11')](_0x0e4f('0xd'),_0x3e2608,_0x5e8e70[_0x0e4f('0x11')]['message']);return _0x591c40(_0x5e8e70[_0x0e4f('0x11')][_0x0e4f('0x13')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x3e2608,_0x0e4f('0xe'));_0x591c40(_0x5e8e70[_0x0e4f('0x14')][_0x0e4f('0x13')]);}})[_0x0e4f('0x15')](function(_0x38cc00){logger[_0x0e4f('0x11')]('VoiceMail,\x20%s,\x20%s',_0x3e2608,_0x38cc00);_0x5b56d0(_0x38cc00);});});} \ No newline at end of file +var _0x5592=['../../config/utils','../../config/environment','jayson/promise','client','http','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VoiceMail,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring'];(function(_0x5e2b37,_0xb6d949){var _0x48400f=function(_0x203529){while(--_0x203529){_0x5e2b37['push'](_0x5e2b37['shift']());}};_0x48400f(++_0xb6d949);}(_0x5592,0xd7));var _0x2559=function(_0x37b219,_0x3cbd3c){_0x37b219=_0x37b219-0x0;var _0x395c79=_0x5592[_0x37b219];return _0x395c79;};'use strict';var _=require(_0x2559('0x0'));var util=require(_0x2559('0x1'));var moment=require(_0x2559('0x2'));var BPromise=require(_0x2559('0x3'));var rs=require(_0x2559('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2559('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2559('0x6'));var jayson=require(_0x2559('0x7'));var client=jayson[_0x2559('0x8')][_0x2559('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1582d3,_0x8e41d5,_0xf80e95){return new BPromise(function(_0x24fee0,_0x4ec5ae){return client['request'](_0x1582d3,_0xf80e95)['then'](function(_0x2767f3){logger['info']('VoiceMail,\x20%s,\x20%s',_0x8e41d5,_0x2559('0xa'));logger[_0x2559('0xb')](_0x2559('0xc'),_0x8e41d5,_0x2559('0xa'),JSON['stringify'](_0x2767f3));if(_0x2767f3[_0x2559('0xd')]){if(_0x2767f3[_0x2559('0xd')][_0x2559('0xe')]===0x1f4){logger[_0x2559('0xd')]('VoiceMail,\x20%s,\x20%s',_0x8e41d5,_0x2767f3[_0x2559('0xd')][_0x2559('0xf')]);return _0x4ec5ae(_0x2767f3['error'][_0x2559('0xf')]);}logger[_0x2559('0xd')]('VoiceMail,\x20%s,\x20%s',_0x8e41d5,_0x2767f3[_0x2559('0xd')][_0x2559('0xf')]);return _0x24fee0(_0x2767f3['error'][_0x2559('0xf')]);}else{logger[_0x2559('0x10')]('VoiceMail,\x20%s,\x20%s',_0x8e41d5,'request\x20sent');_0x24fee0(_0x2767f3[_0x2559('0x11')][_0x2559('0xf')]);}})[_0x2559('0x12')](function(_0x5aa8c3){logger[_0x2559('0xd')](_0x2559('0x13'),_0x8e41d5,_0x5aa8c3);_0x4ec5ae(_0x5aa8c3);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ce881f0..52df381 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','put','delete'];(function(_0x1bbf71,_0x141944){var _0x1939f7=function(_0x8b85d8){while(--_0x8b85d8){_0x1bbf71['push'](_0x1bbf71['shift']());}};_0x1939f7(++_0x141944);}(_0x0295,0x1f0));var _0x5029=function(_0x31f5ce,_0x379d01){_0x31f5ce=_0x31f5ce-0x0;var _0x156662=_0x0295[_0x31f5ce];return _0x156662;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5029('0x2'));var interaction=require(_0x5029('0x3'));var config=require(_0x5029('0x4'));var controller=require(_0x5029('0x5'));router[_0x5029('0x6')]('/',auth[_0x5029('0x7')](),controller[_0x5029('0x8')]);router[_0x5029('0x6')](_0x5029('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x5029('0xa'),auth['isAuthenticated'](),controller[_0x5029('0xb')]);router['post']('/',auth[_0x5029('0x7')](),controller['create']);router[_0x5029('0xc')](_0x5029('0x9'),auth[_0x5029('0x7')](),controller['update']);router[_0x5029('0xd')](_0x5029('0x9'),auth[_0x5029('0x7')](),controller['destroy']);module[_0x5029('0xe')]=router; \ No newline at end of file +var _0xdc97=['index','/:id','/:id/download','download','post','create','put','update','delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x982941,_0x5c642c){_0x982941=_0x982941-0x0;var _0x209818=_0xdc97[_0x982941];return _0x209818;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var auth=require(_0x7dc9('0x4'));var interaction=require(_0x7dc9('0x5'));var config=require('../../config/environment');var controller=require(_0x7dc9('0x6'));router[_0x7dc9('0x7')]('/',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x9')]);router['get'](_0x7dc9('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7dc9('0x7')](_0x7dc9('0xb'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0xc')]);router[_0x7dc9('0xd')]('/',auth['isAuthenticated'](),controller[_0x7dc9('0xe')]);router[_0x7dc9('0xf')](_0x7dc9('0xa'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x10')]);router[_0x7dc9('0x11')](_0x7dc9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index fc2d9ff..d285ce0 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js +++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4df9=['BLOB','long','TIMESTAMP','exports','VIRTUAL','STRING'];(function(_0x1c4399,_0x2bdc91){var _0x401459=function(_0x3f1f5e){while(--_0x3f1f5e){_0x1c4399['push'](_0x1c4399['shift']());}};_0x401459(++_0x2bdc91);}(_0x4df9,0x87));var _0x94df=function(_0x2d9615,_0x8d1b0c){_0x2d9615=_0x2d9615-0x0;var _0x3a69da=_0x4df9[_0x2d9615];return _0x3a69da;};'use strict';var Sequelize=require('sequelize');module[_0x94df('0x0')]={'name':{'type':Sequelize[_0x94df('0x1')],'get':function(_0x1d6b52){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'recording':{'type':Sequelize[_0x94df('0x3')](_0x94df('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x94df('0x2')],'defaultValue':''},'stamp':{'type':_0x94df('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x25e4=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x25e4,0x6b));var _0x425e=function(_0x4f0a74,_0x4e8aa2){_0x4f0a74=_0x4f0a74-0x0;var _0x628da3=_0x25e4[_0x4f0a74];return _0x628da3;};'use strict';var Sequelize=require(_0x425e('0x0'));module[_0x425e('0x1')]={'name':{'type':Sequelize[_0x425e('0x2')],'get':function(_0x156acb){return this[_0x425e('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x425e('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x425e('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x425e('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x425e('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x425e('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x425e('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x425e('0x6')](_0x425e('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x425e('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x425e('0x5')],'defaultValue':''},'stamp':{'type':_0x425e('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index ce5b4ba..7655f55 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.controller.js +++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3435=['create','body','params','destroy','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','msg_id','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','end','error','stack','index','rawAttributes','fieldName','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','filter','where','type','VIRTUAL','merge','VoiceMailMessage','includeAll','rows','catch','show','include','options','find'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3435,0xfa));var _0x5343=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x3435[_0x391c55];return _0xa434e0;};'use strict';var pdf=require(_0x5343('0x0'));var emlformat=require(_0x5343('0x1'));var rimraf=require(_0x5343('0x2'));var zipdir=require(_0x5343('0x3'));var jsonpatch=require(_0x5343('0x4'));var rp=require(_0x5343('0x5'));var moment=require('moment');var BPromise=require(_0x5343('0x6'));var Mustache=require(_0x5343('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5343('0x8'));var csv=require(_0x5343('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x9'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var db=require(_0x5343('0x16'))['db'];function respondWithStatusCode(_0x5f1724,_0x2ddeb7){_0x2ddeb7=_0x2ddeb7||0xcc;return function(_0x5f473f){if(_0x5f473f){return _0x5f1724[_0x5343('0x17')](_0x2ddeb7);}return _0x5f1724[_0x5343('0x18')](_0x2ddeb7)['end']();};}function respondWithResult(_0x392797,_0x4cdfae){_0x4cdfae=_0x4cdfae||0xc8;return function(_0x13066f){if(_0x13066f){return _0x392797[_0x5343('0x18')](_0x4cdfae)[_0x5343('0x19')](_0x13066f);}};}function respondWithFilteredResult(_0x65e827,_0x4dbff1){return function(_0x446e90){if(_0x446e90){var _0x588a96=_0x446e90[_0x5343('0x1a')],_0x1df724=_0x4dbff1[_0x5343('0x1b')],_0x3f27fb=_0x4dbff1[_0x5343('0x1b')]+_0x4dbff1['limit'],_0x45cade;if(_0x3f27fb>=_0x588a96){_0x3f27fb=_0x588a96;_0x45cade=0xc8;}else{_0x45cade=0xce;}_0x65e827[_0x5343('0x18')](_0x45cade);return _0x65e827[_0x5343('0x1c')](_0x5343('0x1d'),_0x1df724+'-'+_0x3f27fb+'/'+_0x588a96)['json'](_0x446e90);}return null;};}function patchUpdates(_0x1eb3bd){return function(_0x399eec){try{jsonpatch[_0x5343('0x1e')](_0x399eec,_0x1eb3bd,!![]);}catch(_0x2f1b48){return BPromise[_0x5343('0x1f')](_0x2f1b48);}return _0x399eec[_0x5343('0x20')]();};}function saveUpdates(_0x132505,_0x40ba38){return function(_0x35d41d){if(_0x35d41d){return _0x35d41d['update'](_0x132505)[_0x5343('0x21')](function(_0x3da777){return _0x3da777;});}return null;};}function removeEntity(_0x5c2d6f,_0x42f92d){return function(_0xd95a5b){if(_0xd95a5b){return _0xd95a5b['destroy']()[_0x5343('0x21')](function(){_0x5c2d6f[_0x5343('0x18')](0xcc)[_0x5343('0x22')]();});}};}function handleEntityNotFound(_0x380aae,_0x290ce8){return function(_0x486597){if(!_0x486597){_0x380aae[_0x5343('0x17')](0x194);}return _0x486597;};}function handleError(_0x17b88a,_0x584034){_0x584034=_0x584034||0x1f4;return function(_0x3072ad){logger[_0x5343('0x23')](_0x3072ad[_0x5343('0x24')]);if(_0x3072ad['name']){delete _0x3072ad['name'];}_0x17b88a[_0x5343('0x18')](_0x584034)['send'](_0x3072ad);};}exports[_0x5343('0x25')]=function(_0x5e4b38,_0x1bf35f){var _0x55ab94={},_0x50c584={},_0xd6c267={'count':0x0,'rows':[]};var _0x4cb858=_['map'](db['VoiceMailMessage'][_0x5343('0x26')],function(_0x5d0853){return{'name':_0x5d0853[_0x5343('0x27')],'type':_0x5d0853['type']['key']};});_0x50c584[_0x5343('0x28')]=_['differenceBy'](_['map'](_0x4cb858,_0x5343('0x29')),[_0x5343('0x29')]);_0x50c584[_0x5343('0x2a')]=_[_0x5343('0x2b')](_0x5e4b38['query']);_0x50c584['filters']=_[_0x5343('0x2c')](_0x50c584[_0x5343('0x28')],_0x50c584[_0x5343('0x2a')]);_0x55ab94[_0x5343('0x2d')]=_[_0x5343('0x2c')](_0x50c584[_0x5343('0x28')],qs[_0x5343('0x2e')](_0x5e4b38[_0x5343('0x2a')][_0x5343('0x2e')]));_0x55ab94[_0x5343('0x2d')]=_0x55ab94[_0x5343('0x2d')][_0x5343('0x2f')]?_0x55ab94['attributes']:_0x50c584['model'];if(!_0x5e4b38[_0x5343('0x2a')][_0x5343('0x30')]('nolimit')){_0x55ab94[_0x5343('0x31')]=qs['limit'](_0x5e4b38[_0x5343('0x2a')][_0x5343('0x31')]);_0x55ab94[_0x5343('0x1b')]=qs[_0x5343('0x1b')](_0x5e4b38['query']['offset']);}_0x55ab94[_0x5343('0x32')]=qs['sort'](_0x5e4b38[_0x5343('0x2a')][_0x5343('0x33')]);_0x55ab94['where']=qs[_0x5343('0x34')](_['pick'](_0x5e4b38['query'],_0x50c584[_0x5343('0x34')]));if(_0x5e4b38[_0x5343('0x2a')][_0x5343('0x35')]){_0x55ab94[_0x5343('0x36')]=_['merge'](_0x55ab94['where'],{'$or':_['map'](_0x4cb858,function(_0x4f8f41){if(_0x4f8f41[_0x5343('0x37')]!==_0x5343('0x38')){var _0xbd6cfc={};_0xbd6cfc[_0x4f8f41[_0x5343('0x29')]]={'$like':'%'+_0x5e4b38[_0x5343('0x2a')][_0x5343('0x35')]+'%'};return _0xbd6cfc;}})});}_0x55ab94=_[_0x5343('0x39')]({},_0x55ab94,_0x5e4b38['options']);var _0x42c8a5={'where':_0x55ab94['where']};return db[_0x5343('0x3a')][_0x5343('0x1a')](_0x42c8a5)[_0x5343('0x21')](function(_0x2f004a){_0xd6c267[_0x5343('0x1a')]=_0x2f004a;if(_0x5e4b38[_0x5343('0x2a')][_0x5343('0x3b')]){_0x55ab94['include']=[{'all':!![]}];}return db[_0x5343('0x3a')]['findAll'](_0x55ab94);})[_0x5343('0x21')](function(_0x46f97d){_0xd6c267[_0x5343('0x3c')]=_0x46f97d;return _0xd6c267;})[_0x5343('0x21')](respondWithFilteredResult(_0x1bf35f,_0x55ab94))[_0x5343('0x3d')](handleError(_0x1bf35f,null));};exports[_0x5343('0x3e')]=function(_0x2c75bd,_0x4fcbd8){var _0x22ef23={'raw':!![],'where':{'id':_0x2c75bd['params']['id']}},_0x3d9066={};_0x3d9066[_0x5343('0x28')]=_[_0x5343('0x2b')](db['VoiceMailMessage']['rawAttributes']);_0x3d9066[_0x5343('0x2a')]=_[_0x5343('0x2b')](_0x2c75bd[_0x5343('0x2a')]);_0x3d9066['filters']=_[_0x5343('0x2c')](_0x3d9066[_0x5343('0x28')],_0x3d9066[_0x5343('0x2a')]);_0x22ef23[_0x5343('0x2d')]=_[_0x5343('0x2c')](_0x3d9066[_0x5343('0x28')],qs[_0x5343('0x2e')](_0x2c75bd['query'][_0x5343('0x2e')]));_0x22ef23[_0x5343('0x2d')]=_0x22ef23[_0x5343('0x2d')][_0x5343('0x2f')]?_0x22ef23[_0x5343('0x2d')]:_0x3d9066[_0x5343('0x28')];if(_0x2c75bd[_0x5343('0x2a')][_0x5343('0x3b')]){_0x22ef23[_0x5343('0x3f')]=[{'all':!![]}];}_0x22ef23=_[_0x5343('0x39')]({},_0x22ef23,_0x2c75bd[_0x5343('0x40')]);return db[_0x5343('0x3a')][_0x5343('0x41')](_0x22ef23)[_0x5343('0x21')](handleEntityNotFound(_0x4fcbd8,null))[_0x5343('0x21')](respondWithResult(_0x4fcbd8,null))['catch'](handleError(_0x4fcbd8,null));};exports[_0x5343('0x42')]=function(_0x29addd,_0x548cdb){return db[_0x5343('0x3a')][_0x5343('0x42')](_0x29addd[_0x5343('0x43')],{})[_0x5343('0x21')](respondWithResult(_0x548cdb,0xc9))[_0x5343('0x3d')](handleError(_0x548cdb,null));};exports['update']=function(_0x2f3b5b,_0x572916){if(_0x2f3b5b['body']['id']){delete _0x2f3b5b[_0x5343('0x43')]['id'];}return db[_0x5343('0x3a')][_0x5343('0x41')]({'where':{'id':_0x2f3b5b[_0x5343('0x44')]['id']}})['then'](handleEntityNotFound(_0x572916,null))[_0x5343('0x21')](saveUpdates(_0x2f3b5b[_0x5343('0x43')],null))[_0x5343('0x21')](respondWithResult(_0x572916,null))[_0x5343('0x3d')](handleError(_0x572916,null));};exports[_0x5343('0x45')]=function(_0x43a792,_0xb135b2){return db[_0x5343('0x3a')][_0x5343('0x41')]({'where':{'id':_0x43a792[_0x5343('0x44')]['id']}})['then'](handleEntityNotFound(_0xb135b2,null))[_0x5343('0x21')](removeEntity(_0xb135b2,null))[_0x5343('0x3d')](handleError(_0xb135b2,null));};exports[_0x5343('0x46')]=function(_0xdd461d,_0x429f2c,_0x1e1d24){return db[_0x5343('0x3a')][_0x5343('0x41')]({'where':{'id':_0xdd461d[_0x5343('0x44')]['id']},'attributes':['id',_0x5343('0x47'),'msg_id']})[_0x5343('0x21')](handleEntityNotFound(_0x429f2c,null))['then'](function(_0x50cd81){if(_0x50cd81){if(!_0x50cd81[_0x5343('0x47')]){throw new db[(_0x5343('0x48'))][(_0x5343('0x49'))](_0x5343('0x4a'));}var _0x2bf61b={'Content-Type':'audio/wav','Content-Disposition':_0x5343('0x4b')};if(_0x50cd81['msg_id']){_0x2bf61b[_0x5343('0x4c')]='attachment;\x20filename=\x22'+_0x50cd81[_0x5343('0x4d')]+'.wav\x22';}_0x429f2c[_0x5343('0x1c')](_0x2bf61b);return _0x429f2c[_0x5343('0x4e')](new Buffer(_0x50cd81[_0x5343('0x47')]));}})[_0x5343('0x3d')](handleError(_0x429f2c,null));}; \ No newline at end of file +var _0x1cc7=['set','Content-Range','reject','save','update','then','error','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','filter','count','includeAll','include','findAll','catch','params','length','find','create','body','destroy','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','.wav\x22','html-pdf','eml-format','rimraf','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cc7,0x15a));var _0x71cc=function(_0x242031,_0x900e35){_0x242031=_0x242031-0x0;var _0x22a914=_0x1cc7[_0x242031];return _0x22a914;};'use strict';var pdf=require(_0x71cc('0x0'));var emlformat=require(_0x71cc('0x1'));var rimraf=require(_0x71cc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71cc('0x3'));var BPromise=require(_0x71cc('0x4'));var Mustache=require(_0x71cc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x71cc('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71cc('0x7'));var squel=require(_0x71cc('0x8'));var crypto=require(_0x71cc('0x9'));var jsforce=require(_0x71cc('0xa'));var deskjs=require(_0x71cc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x71cc('0xc'));var Papa=require(_0x71cc('0xd'));var Redis=require(_0x71cc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x71cc('0xf'))(_0x71cc('0x10'));var utils=require(_0x71cc('0x11'));var config=require('../../config/environment');var db=require(_0x71cc('0x12'))['db'];function respondWithStatusCode(_0x550b3c,_0x1aad83){_0x1aad83=_0x1aad83||0xcc;return function(_0x4f9c5c){if(_0x4f9c5c){return _0x550b3c[_0x71cc('0x13')](_0x1aad83);}return _0x550b3c['status'](_0x1aad83)[_0x71cc('0x14')]();};}function respondWithResult(_0x1f478c,_0x3cee23){_0x3cee23=_0x3cee23||0xc8;return function(_0xd16032){if(_0xd16032){return _0x1f478c[_0x71cc('0x15')](_0x3cee23)['json'](_0xd16032);}};}function respondWithFilteredResult(_0x4495fd,_0x292d0c){return function(_0x3b26d1){if(_0x3b26d1){var _0x14d5ab=_0x3b26d1['count'],_0x3875b8=_0x292d0c[_0x71cc('0x16')],_0x14087c=_0x292d0c[_0x71cc('0x16')]+_0x292d0c[_0x71cc('0x17')],_0x1e359d;if(_0x14087c>=_0x14d5ab){_0x14087c=_0x14d5ab;_0x1e359d=0xc8;}else{_0x1e359d=0xce;}_0x4495fd[_0x71cc('0x15')](_0x1e359d);return _0x4495fd[_0x71cc('0x18')](_0x71cc('0x19'),_0x3875b8+'-'+_0x14087c+'/'+_0x14d5ab)['json'](_0x3b26d1);}return null;};}function patchUpdates(_0x366690){return function(_0x71f927){try{jsonpatch['apply'](_0x71f927,_0x366690,!![]);}catch(_0x550ce7){return BPromise[_0x71cc('0x1a')](_0x550ce7);}return _0x71f927[_0x71cc('0x1b')]();};}function saveUpdates(_0x1612f1,_0x11299c){return function(_0x258d30){if(_0x258d30){return _0x258d30[_0x71cc('0x1c')](_0x1612f1)[_0x71cc('0x1d')](function(_0x18683d){return _0x18683d;});}return null;};}function removeEntity(_0x4cfba0,_0x1442ef){return function(_0x109239){if(_0x109239){return _0x109239['destroy']()[_0x71cc('0x1d')](function(){_0x4cfba0[_0x71cc('0x15')](0xcc)[_0x71cc('0x14')]();});}};}function handleEntityNotFound(_0x1a9b4f,_0x1bc67c){return function(_0x887399){if(!_0x887399){_0x1a9b4f['sendStatus'](0x194);}return _0x887399;};}function handleError(_0x4225af,_0x4147dc){_0x4147dc=_0x4147dc||0x1f4;return function(_0x446580){logger[_0x71cc('0x1e')](_0x446580[_0x71cc('0x1f')]);if(_0x446580[_0x71cc('0x20')]){delete _0x446580[_0x71cc('0x20')];}_0x4225af[_0x71cc('0x15')](_0x4147dc)[_0x71cc('0x21')](_0x446580);};}exports['index']=function(_0x26065a,_0x43c155){var _0x28e095={},_0x26becf={},_0x20b093={'count':0x0,'rows':[]};var _0x1fa9c1=_[_0x71cc('0x22')](db[_0x71cc('0x23')][_0x71cc('0x24')],function(_0x1fc046){return{'name':_0x1fc046[_0x71cc('0x25')],'type':_0x1fc046[_0x71cc('0x26')][_0x71cc('0x27')]};});_0x26becf[_0x71cc('0x28')]=_[_0x71cc('0x29')](_[_0x71cc('0x22')](_0x1fa9c1,'name'),[_0x71cc('0x20')]);_0x26becf[_0x71cc('0x2a')]=_[_0x71cc('0x2b')](_0x26065a[_0x71cc('0x2a')]);_0x26becf[_0x71cc('0x2c')]=_[_0x71cc('0x2d')](_0x26becf['model'],_0x26becf[_0x71cc('0x2a')]);_0x28e095[_0x71cc('0x2e')]=_[_0x71cc('0x2d')](_0x26becf[_0x71cc('0x28')],qs[_0x71cc('0x2f')](_0x26065a[_0x71cc('0x2a')][_0x71cc('0x2f')]));_0x28e095['attributes']=_0x28e095[_0x71cc('0x2e')]['length']?_0x28e095['attributes']:_0x26becf[_0x71cc('0x28')];if(!_0x26065a['query']['hasOwnProperty'](_0x71cc('0x30'))){_0x28e095['limit']=qs[_0x71cc('0x17')](_0x26065a['query'][_0x71cc('0x17')]);_0x28e095[_0x71cc('0x16')]=qs['offset'](_0x26065a[_0x71cc('0x2a')][_0x71cc('0x16')]);}_0x28e095[_0x71cc('0x31')]=qs[_0x71cc('0x32')](_0x26065a[_0x71cc('0x2a')][_0x71cc('0x32')]);_0x28e095[_0x71cc('0x33')]=qs[_0x71cc('0x2c')](_[_0x71cc('0x34')](_0x26065a[_0x71cc('0x2a')],_0x26becf['filters']));if(_0x26065a[_0x71cc('0x2a')]['filter']){_0x28e095[_0x71cc('0x33')]=_[_0x71cc('0x35')](_0x28e095[_0x71cc('0x33')],{'$or':_[_0x71cc('0x22')](_0x1fa9c1,function(_0x27eb3c){if(_0x27eb3c[_0x71cc('0x26')]!=='VIRTUAL'){var _0x38a701={};_0x38a701[_0x27eb3c['name']]={'$like':'%'+_0x26065a[_0x71cc('0x2a')][_0x71cc('0x36')]+'%'};return _0x38a701;}})});}_0x28e095=_[_0x71cc('0x35')]({},_0x28e095,_0x26065a['options']);var _0x588748={'where':_0x28e095['where']};return db[_0x71cc('0x23')][_0x71cc('0x37')](_0x588748)[_0x71cc('0x1d')](function(_0x92389){_0x20b093[_0x71cc('0x37')]=_0x92389;if(_0x26065a[_0x71cc('0x2a')][_0x71cc('0x38')]){_0x28e095[_0x71cc('0x39')]=[{'all':!![]}];}return db[_0x71cc('0x23')][_0x71cc('0x3a')](_0x28e095);})[_0x71cc('0x1d')](function(_0x12bf49){_0x20b093['rows']=_0x12bf49;return _0x20b093;})[_0x71cc('0x1d')](respondWithFilteredResult(_0x43c155,_0x28e095))[_0x71cc('0x3b')](handleError(_0x43c155,null));};exports['show']=function(_0x54fc85,_0x463cdd){var _0x21492b={'raw':!![],'where':{'id':_0x54fc85[_0x71cc('0x3c')]['id']}},_0x490b46={};_0x490b46[_0x71cc('0x28')]=_[_0x71cc('0x2b')](db[_0x71cc('0x23')][_0x71cc('0x24')]);_0x490b46['query']=_['keys'](_0x54fc85['query']);_0x490b46[_0x71cc('0x2c')]=_['intersection'](_0x490b46[_0x71cc('0x28')],_0x490b46[_0x71cc('0x2a')]);_0x21492b[_0x71cc('0x2e')]=_[_0x71cc('0x2d')](_0x490b46[_0x71cc('0x28')],qs[_0x71cc('0x2f')](_0x54fc85[_0x71cc('0x2a')][_0x71cc('0x2f')]));_0x21492b[_0x71cc('0x2e')]=_0x21492b[_0x71cc('0x2e')][_0x71cc('0x3d')]?_0x21492b[_0x71cc('0x2e')]:_0x490b46[_0x71cc('0x28')];if(_0x54fc85['query'][_0x71cc('0x38')]){_0x21492b[_0x71cc('0x39')]=[{'all':!![]}];}_0x21492b=_[_0x71cc('0x35')]({},_0x21492b,_0x54fc85['options']);return db[_0x71cc('0x23')][_0x71cc('0x3e')](_0x21492b)[_0x71cc('0x1d')](handleEntityNotFound(_0x463cdd,null))[_0x71cc('0x1d')](respondWithResult(_0x463cdd,null))[_0x71cc('0x3b')](handleError(_0x463cdd,null));};exports[_0x71cc('0x3f')]=function(_0x14f645,_0x3fe5f3){return db[_0x71cc('0x23')][_0x71cc('0x3f')](_0x14f645[_0x71cc('0x40')],{})[_0x71cc('0x1d')](respondWithResult(_0x3fe5f3,0xc9))['catch'](handleError(_0x3fe5f3,null));};exports[_0x71cc('0x1c')]=function(_0x3b9751,_0x3050c6){if(_0x3b9751[_0x71cc('0x40')]['id']){delete _0x3b9751[_0x71cc('0x40')]['id'];}return db[_0x71cc('0x23')][_0x71cc('0x3e')]({'where':{'id':_0x3b9751['params']['id']}})[_0x71cc('0x1d')](handleEntityNotFound(_0x3050c6,null))[_0x71cc('0x1d')](saveUpdates(_0x3b9751['body'],null))[_0x71cc('0x1d')](respondWithResult(_0x3050c6,null))[_0x71cc('0x3b')](handleError(_0x3050c6,null));};exports[_0x71cc('0x41')]=function(_0xe6b3db,_0x15baf1){return db[_0x71cc('0x23')][_0x71cc('0x3e')]({'where':{'id':_0xe6b3db[_0x71cc('0x3c')]['id']}})[_0x71cc('0x1d')](handleEntityNotFound(_0x15baf1,null))[_0x71cc('0x1d')](removeEntity(_0x15baf1,null))[_0x71cc('0x3b')](handleError(_0x15baf1,null));};exports['download']=function(_0x296109,_0x4e5bba,_0x23c6e7){return db['VoiceMailMessage'][_0x71cc('0x3e')]({'where':{'id':_0x296109[_0x71cc('0x3c')]['id']},'attributes':['id','recording',_0x71cc('0x42')]})[_0x71cc('0x1d')](handleEntityNotFound(_0x4e5bba,null))['then'](function(_0x3edacf){if(_0x3edacf){if(!_0x3edacf[_0x71cc('0x43')]){throw new db[(_0x71cc('0x44'))][(_0x71cc('0x45'))](_0x71cc('0x46'));}var _0x4354dd={'Content-Type':_0x71cc('0x47'),'Content-Disposition':'attachment'};if(_0x3edacf[_0x71cc('0x42')]){_0x4354dd[_0x71cc('0x48')]='attachment;\x20filename=\x22'+_0x3edacf['msg_id']+_0x71cc('0x49');}_0x4e5bba[_0x71cc('0x18')](_0x4354dd);return _0x4e5bba['send'](new Buffer(_0x3edacf[_0x71cc('0x43')]));}})[_0x71cc('0x3b')](handleError(_0x4e5bba,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 9606ff7..76c12ad 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.model.js +++ b/server/api/voiceMailMessage/voiceMailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fae=['lodash','util','api','moment','request-promise','path','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x3bab9e,_0x3bbd29){var _0x3b9a1a=function(_0x528107){while(--_0x528107){_0x3bab9e['push'](_0x3bab9e['shift']());}};_0x3b9a1a(++_0x3bbd29);}(_0x9fae,0x114));var _0xe9fa=function(_0x131615,_0x1c3343){_0x131615=_0x131615-0x0;var _0x4d10ec=_0x9fae[_0x131615];return _0x4d10ec;};'use strict';var _=require(_0xe9fa('0x0'));var util=require(_0xe9fa('0x1'));var logger=require('../../config/logger')(_0xe9fa('0x2'));var moment=require(_0xe9fa('0x3'));var BPromise=require('bluebird');var rp=require(_0xe9fa('0x4'));var fs=require('fs');var path=require(_0xe9fa('0x5'));var rimraf=require('rimraf');var config=require(_0xe9fa('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0xe9fa('0x7')]=function(_0x1e6b30,_0x905806){return _0x1e6b30[_0xe9fa('0x8')](_0xe9fa('0x9'),attributes,{'tableName':_0xe9fa('0xa'),'paranoid':![],'indexes':[{'name':_0xe9fa('0xb'),'fields':[_0xe9fa('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2cfc=['../../config/logger','bluebird','request-promise','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util'];(function(_0x46c1d5,_0x5ca335){var _0x40fe7b=function(_0x34cb99){while(--_0x34cb99){_0x46c1d5['push'](_0x46c1d5['shift']());}};_0x40fe7b(++_0x5ca335);}(_0x2cfc,0x77));var _0xc2cf=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x2cfc[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xc2cf('0x0'));var util=require(_0xc2cf('0x1'));var logger=require(_0xc2cf('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc2cf('0x3'));var rp=require(_0xc2cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2cf('0x5'));var config=require('../../config/environment');var attributes=require(_0xc2cf('0x6'));module[_0xc2cf('0x7')]=function(_0x35ec6e,_0x9f232b){return _0x35ec6e[_0xc2cf('0x8')](_0xc2cf('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xc2cf('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 0019559..fcd2823 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['client','http','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x81a552,_0x424920){var _0x259e19=function(_0xc77c44){while(--_0xc77c44){_0x81a552['push'](_0x81a552['shift']());}};_0x259e19(++_0x424920);}(_0x57ca,0x108));var _0xa57c=function(_0x6a1821,_0x956ace){_0x6a1821=_0x6a1821-0x0;var _0x480fd4=_0x57ca[_0x6a1821];return _0x480fd4;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x39c19c,_0x53553a){var _0x18a5ca=function(_0x509964){while(--_0x509964){_0x39c19c['push'](_0x39c19c['shift']());}};_0x18a5ca(++_0x53553a);}(_0x57ca,0x108));var _0xa57c=function(_0x1c903d,_0x52700b){_0x1c903d=_0x1c903d-0x0;var _0x50342d=_0x57ca[_0x1c903d];return _0x50342d;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 188b769..986e5eb 100644 --- a/server/api/voiceMusicOnHold/index.js +++ b/server/api/voiceMusicOnHold/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3708=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','show','/:id/sounds','post','create','addSound','put','update','delete','/:id','destroy','/:id/sounds/:id2','removeSound','exports','path'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x3708,0x1cb));var _0x8370=function(_0x2afe8b,_0x2407d2){_0x2afe8b=_0x2afe8b-0x0;var _0x57039e=_0x3708[_0x2afe8b];return _0x57039e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8370('0x0'));var timeout=require(_0x8370('0x1'));var express=require(_0x8370('0x2'));var router=express[_0x8370('0x3')]();var auth=require(_0x8370('0x4'));var interaction=require(_0x8370('0x5'));var config=require(_0x8370('0x6'));var controller=require(_0x8370('0x7'));router[_0x8370('0x8')]('/',auth[_0x8370('0x9')](),controller['index']);router[_0x8370('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8370('0xa')]);router[_0x8370('0x8')](_0x8370('0xb'),auth[_0x8370('0x9')](),controller['getSounds']);router[_0x8370('0xc')]('/',auth['isAuthenticated'](),controller[_0x8370('0xd')]);router[_0x8370('0xc')](_0x8370('0xb'),auth[_0x8370('0x9')](),controller[_0x8370('0xe')]);router[_0x8370('0xf')]('/:id',auth[_0x8370('0x9')](),controller[_0x8370('0x10')]);router[_0x8370('0x11')](_0x8370('0x12'),auth['isAuthenticated'](),controller[_0x8370('0x13')]);router[_0x8370('0x11')](_0x8370('0x14'),auth[_0x8370('0x9')](),controller[_0x8370('0x15')]);module[_0x8370('0x16')]=router; \ No newline at end of file +var _0x3a14=['/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','post','create','addSound','put','update','delete','destroy'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x3a14,0x1a1));var _0x43a1=function(_0x1e5c24,_0x2f7a8f){_0x1e5c24=_0x1e5c24-0x0;var _0x851348=_0x3a14[_0x1e5c24];return _0x851348;};'use strict';var multer=require(_0x43a1('0x0'));var util=require(_0x43a1('0x1'));var path=require('path');var timeout=require(_0x43a1('0x2'));var express=require('express');var router=express[_0x43a1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x43a1('0x4'));var config=require(_0x43a1('0x5'));var controller=require(_0x43a1('0x6'));router['get']('/',auth[_0x43a1('0x7')](),controller[_0x43a1('0x8')]);router[_0x43a1('0x9')](_0x43a1('0xa'),auth[_0x43a1('0x7')](),controller[_0x43a1('0xb')]);router['get'](_0x43a1('0xc'),auth[_0x43a1('0x7')](),controller['getSounds']);router[_0x43a1('0xd')]('/',auth[_0x43a1('0x7')](),controller[_0x43a1('0xe')]);router[_0x43a1('0xd')](_0x43a1('0xc'),auth[_0x43a1('0x7')](),controller[_0x43a1('0xf')]);router[_0x43a1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x43a1('0x11')]);router[_0x43a1('0x12')]('/:id',auth[_0x43a1('0x7')](),controller[_0x43a1('0x13')]);router[_0x43a1('0x12')](_0x43a1('0x14'),auth[_0x43a1('0x7')](),controller[_0x43a1('0x15')]);module[_0x43a1('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index d59edd7..b778b2e 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb274=['alpha','TIMESTAMP','BOOLEAN','exports','STRING','name','custom','mp3nb','quietmp3nb','quietmp3','mp3','files'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xb274,0x1cb));var _0x4b27=function(_0x56ab11,_0x14cba4){_0x56ab11=_0x56ab11-0x0;var _0x5f3bba=_0xb274[_0x56ab11];return _0x5f3bba;};'use strict';var Sequelize=require('sequelize');module[_0x4b27('0x0')]={'name':{'type':Sequelize[_0x4b27('0x1')],'allowNull':![],'unique':_0x4b27('0x2')},'mode':{'type':Sequelize['ENUM'](_0x4b27('0x3'),'files',_0x4b27('0x4'),_0x4b27('0x5'),_0x4b27('0x6'),_0x4b27('0x7')),'allowNull':!![],'defaultValue':_0x4b27('0x8')},'directory':{'type':Sequelize[_0x4b27('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x4b27('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4b27('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4b27('0x9')},'format':{'type':Sequelize[_0x4b27('0x1')],'allowNull':!![]},'stamp':{'type':_0x4b27('0xa')},'defaultEntry':{'type':Sequelize[_0x4b27('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2ab9=['alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x149ab3,_0x8284d0){var _0x4ec294=function(_0xd4468e){while(--_0xd4468e){_0x149ab3['push'](_0x149ab3['shift']());}};_0x4ec294(++_0x8284d0);}(_0x2ab9,0x155));var _0x92ab=function(_0x240cbe,_0x4af9ac){_0x240cbe=_0x240cbe-0x0;var _0x20833c=_0x2ab9[_0x240cbe];return _0x20833c;};'use strict';var Sequelize=require(_0x92ab('0x0'));module['exports']={'name':{'type':Sequelize[_0x92ab('0x1')],'allowNull':![],'unique':_0x92ab('0x2')},'mode':{'type':Sequelize[_0x92ab('0x3')](_0x92ab('0x4'),_0x92ab('0x5'),_0x92ab('0x6'),_0x92ab('0x7'),_0x92ab('0x8'),_0x92ab('0x9')),'allowNull':!![],'defaultValue':_0x92ab('0x5')},'directory':{'type':Sequelize[_0x92ab('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x92ab('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x92ab('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x92ab('0xa')},'format':{'type':Sequelize[_0x92ab('0x1')],'allowNull':!![]},'stamp':{'type':_0x92ab('0xb')},'defaultEntry':{'type':Sequelize[_0x92ab('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index b29603b..436e237 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4772=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','error','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','keys','filters','query','attributes','fields','length','model','sort','pick','where','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','intersection','body','find','sequelize','mode','files','directory','join','server/files/moh','create','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','message','addSound','Sound','findOne','save_name','converted_format','createdAt','root','format','%s.%s','basename','extname','Sequelize','ValidationError','removeSound','id2','order','merge','hasOwnProperty','nolimit','getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto'];(function(_0x30a974,_0x5a6460){var _0x23e72a=function(_0x27dce8){while(--_0x27dce8){_0x30a974['push'](_0x30a974['shift']());}};_0x23e72a(++_0x5a6460);}(_0x4772,0x1a6));var _0x2477=function(_0x98abe7,_0x4f71c8){_0x98abe7=_0x98abe7-0x0;var _0x4bf08d=_0x4772[_0x98abe7];return _0x4bf08d;};'use strict';var pdf=require(_0x2477('0x0'));var emlformat=require(_0x2477('0x1'));var rimraf=require(_0x2477('0x2'));var zipdir=require(_0x2477('0x3'));var jsonpatch=require(_0x2477('0x4'));var rp=require(_0x2477('0x5'));var moment=require('moment');var BPromise=require(_0x2477('0x6'));var Mustache=require(_0x2477('0x7'));var util=require(_0x2477('0x8'));var path=require(_0x2477('0x9'));var sox=require(_0x2477('0xa'));var csv=require(_0x2477('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2477('0xc'));var crypto=require(_0x2477('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2477('0xb'));var querystring=require(_0x2477('0xe'));var Papa=require(_0x2477('0xf'));var Redis=require(_0x2477('0x10'));var authService=require(_0x2477('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2477('0x12'));var hardwareService=require(_0x2477('0x13'));var logger=require(_0x2477('0x14'))(_0x2477('0x15'));var utils=require(_0x2477('0x16'));var config=require('../../config/environment');var db=require(_0x2477('0x17'))['db'];function respondWithStatusCode(_0x9c2663,_0x2e5b58){_0x2e5b58=_0x2e5b58||0xcc;return function(_0x2ae1db){if(_0x2ae1db){return _0x9c2663['sendStatus'](_0x2e5b58);}return _0x9c2663[_0x2477('0x18')](_0x2e5b58)['end']();};}function respondWithResult(_0x2224b1,_0x53a681){_0x53a681=_0x53a681||0xc8;return function(_0x3a4d88){if(_0x3a4d88){return _0x2224b1[_0x2477('0x18')](_0x53a681)[_0x2477('0x19')](_0x3a4d88);}};}function respondWithFilteredResult(_0x4dca89,_0x5b43f3){return function(_0x5690c6){if(_0x5690c6){var _0x577ce6=_0x5690c6['count'],_0x5bbefa=_0x5b43f3[_0x2477('0x1a')],_0x3ffc4b=_0x5b43f3[_0x2477('0x1a')]+_0x5b43f3[_0x2477('0x1b')],_0x1c5af3;if(_0x3ffc4b>=_0x577ce6){_0x3ffc4b=_0x577ce6;_0x1c5af3=0xc8;}else{_0x1c5af3=0xce;}_0x4dca89[_0x2477('0x18')](_0x1c5af3);return _0x4dca89['set'](_0x2477('0x1c'),_0x5bbefa+'-'+_0x3ffc4b+'/'+_0x577ce6)[_0x2477('0x19')](_0x5690c6);}return null;};}function patchUpdates(_0x294df0){return function(_0x236bf7){try{jsonpatch[_0x2477('0x1d')](_0x236bf7,_0x294df0,!![]);}catch(_0x41d380){return BPromise[_0x2477('0x1e')](_0x41d380);}return _0x236bf7[_0x2477('0x1f')]();};}function saveUpdates(_0x997175,_0x58b927){return function(_0x399955){if(_0x399955){return _0x399955[_0x2477('0x20')](_0x997175)['then'](function(_0x112ba5){return _0x112ba5;});}return null;};}function removeEntity(_0x5c2c08,_0x5d1c33){return function(_0x364f18){if(_0x364f18){return _0x364f18[_0x2477('0x21')]()['then'](function(){var _0x57c7c8=_0x364f18[_0x2477('0x22')]({'plain':!![]});var _0x47196c='MusicOnHolds';return db[_0x2477('0x23')][_0x2477('0x21')]({'where':{'type':_0x47196c,'resourceId':_0x57c7c8['id']}})[_0x2477('0x24')](function(){return _0x364f18;});})['then'](function(){_0x5c2c08[_0x2477('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dcef0,_0x5e924e){return function(_0x5098f1){if(!_0x5098f1){_0x5dcef0[_0x2477('0x25')](0x194);}return _0x5098f1;};}function handleError(_0x2141e6,_0x21fb33){_0x21fb33=_0x21fb33||0x1f4;return function(_0x3e53cd){logger[_0x2477('0x26')](_0x3e53cd['stack']);if(_0x3e53cd[_0x2477('0x27')]){delete _0x3e53cd[_0x2477('0x27')];}_0x2141e6[_0x2477('0x18')](_0x21fb33)[_0x2477('0x28')](_0x3e53cd);};}exports[_0x2477('0x29')]=function(_0x48a293,_0xa06880){var _0x5e74e1={},_0x26719f={},_0x2e42d7={'count':0x0,'rows':[]};var _0x3c2185=_[_0x2477('0x2a')](db[_0x2477('0x2b')][_0x2477('0x2c')],function(_0x1866e2){return{'name':_0x1866e2[_0x2477('0x2d')],'type':_0x1866e2[_0x2477('0x2e')]['key']};});_0x26719f['model']=_[_0x2477('0x2a')](_0x3c2185,_0x2477('0x27'));_0x26719f['query']=_[_0x2477('0x2f')](_0x48a293['query']);_0x26719f[_0x2477('0x30')]=_['intersection'](_0x26719f['model'],_0x26719f[_0x2477('0x31')]);_0x5e74e1[_0x2477('0x32')]=_['intersection'](_0x26719f['model'],qs[_0x2477('0x33')](_0x48a293['query'][_0x2477('0x33')]));_0x5e74e1[_0x2477('0x32')]=_0x5e74e1[_0x2477('0x32')][_0x2477('0x34')]?_0x5e74e1[_0x2477('0x32')]:_0x26719f[_0x2477('0x35')];if(!_0x48a293[_0x2477('0x31')]['hasOwnProperty']('nolimit')){_0x5e74e1['limit']=qs['limit'](_0x48a293['query']['limit']);_0x5e74e1[_0x2477('0x1a')]=qs[_0x2477('0x1a')](_0x48a293[_0x2477('0x31')]['offset']);}_0x5e74e1['order']=qs[_0x2477('0x36')](_0x48a293[_0x2477('0x31')][_0x2477('0x36')]);_0x5e74e1['where']=qs[_0x2477('0x30')](_[_0x2477('0x37')](_0x48a293['query'],_0x26719f['filters']));if(_0x48a293[_0x2477('0x31')]['filter']){_0x5e74e1[_0x2477('0x38')]=_['merge'](_0x5e74e1[_0x2477('0x38')],{'$or':_[_0x2477('0x2a')](_0x3c2185,function(_0x326724){if(_0x326724['type']!==_0x2477('0x39')){var _0x4c3dcf={};_0x4c3dcf[_0x326724['name']]={'$like':'%'+_0x48a293[_0x2477('0x31')][_0x2477('0x3a')]+'%'};return _0x4c3dcf;}})});}_0x5e74e1=_['merge']({},_0x5e74e1,_0x48a293[_0x2477('0x3b')]);var _0x151e81={'where':_0x5e74e1[_0x2477('0x38')]};return db[_0x2477('0x2b')]['count'](_0x151e81)[_0x2477('0x24')](function(_0x58c946){_0x2e42d7[_0x2477('0x3c')]=_0x58c946;if(_0x48a293['query'][_0x2477('0x3d')]){_0x5e74e1[_0x2477('0x3e')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x2477('0x3f')](_0x5e74e1);})[_0x2477('0x24')](function(_0x194bfe){_0x2e42d7[_0x2477('0x40')]=_0x194bfe;return _0x2e42d7;})[_0x2477('0x24')](respondWithFilteredResult(_0xa06880,_0x5e74e1))[_0x2477('0x41')](handleError(_0xa06880,null));};exports[_0x2477('0x42')]=function(_0x3db86c,_0x31fa3f){var _0x15f2bf={'raw':![],'where':{'id':_0x3db86c[_0x2477('0x43')]['id']}},_0x5aa5b7={};_0x5aa5b7[_0x2477('0x35')]=_[_0x2477('0x2f')](db[_0x2477('0x2b')][_0x2477('0x2c')]);_0x5aa5b7[_0x2477('0x31')]=_[_0x2477('0x2f')](_0x3db86c[_0x2477('0x31')]);_0x5aa5b7[_0x2477('0x30')]=_[_0x2477('0x44')](_0x5aa5b7[_0x2477('0x35')],_0x5aa5b7['query']);_0x15f2bf[_0x2477('0x32')]=_[_0x2477('0x44')](_0x5aa5b7[_0x2477('0x35')],qs[_0x2477('0x33')](_0x3db86c[_0x2477('0x31')]['fields']));_0x15f2bf[_0x2477('0x32')]=_0x15f2bf['attributes'][_0x2477('0x34')]?_0x15f2bf[_0x2477('0x32')]:_0x5aa5b7['model'];if(_0x3db86c['query']['includeAll']){_0x15f2bf[_0x2477('0x3e')]=[{'all':!![]}];}_0x15f2bf=_['merge']({},_0x15f2bf,_0x3db86c[_0x2477('0x3b')]);return db[_0x2477('0x2b')]['find'](_0x15f2bf)[_0x2477('0x24')](handleEntityNotFound(_0x31fa3f,null))['then'](respondWithResult(_0x31fa3f,null))[_0x2477('0x41')](handleError(_0x31fa3f,null));};exports[_0x2477('0x20')]=function(_0x468d33,_0x48ef11){if(_0x468d33[_0x2477('0x45')]['id']){delete _0x468d33['body']['id'];}return db[_0x2477('0x2b')][_0x2477('0x46')]({'where':{'id':_0x468d33[_0x2477('0x43')]['id']}})[_0x2477('0x24')](handleEntityNotFound(_0x48ef11,null))[_0x2477('0x24')](saveUpdates(_0x468d33['body'],null))[_0x2477('0x24')](respondWithResult(_0x48ef11,null))[_0x2477('0x41')](handleError(_0x48ef11,null));};exports['create']=function(_0x1e3d01,_0x427ec0,_0x324f64){return db[_0x2477('0x47')]['transaction'](function(_0xb3a5b3){if(_0x1e3d01[_0x2477('0x45')][_0x2477('0x48')]===_0x2477('0x49')){_0x1e3d01[_0x2477('0x45')][_0x2477('0x4a')]=path[_0x2477('0x4b')](config['root'],_0x2477('0x4c'),_0x1e3d01['body']['name']);}return db['VoiceMusicOnHold'][_0x2477('0x4d')](_0x1e3d01[_0x2477('0x45')],{'transaction':_0xb3a5b3})['then'](function(_0x1be729){if(_0x1e3d01['body'][_0x2477('0x48')]===_0x2477('0x49')){fs['mkdirSync'](_0x1be729['directory'],parseInt(_0x2477('0x4e'),0x8));}var _0xb8805=_0x1e3d01['user'][_0x2477('0x22')]({'plain':!![]});if(!_0xb8805)throw new Error(_0x2477('0x4f'));if(_0xb8805[_0x2477('0x50')]===_0x2477('0x51')){var _0x841c23=_0x1be729['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x2477('0x52'),'userProfileId':_0xb8805[_0x2477('0x53')]},'raw':!![]})[_0x2477('0x24')](function(_0x5ebd41){if(_0x5ebd41&&_0x5ebd41['autoAssociation']===0x0){return db[_0x2477('0x23')][_0x2477('0x4d')]({'name':_0x841c23[_0x2477('0x27')],'resourceId':_0x841c23['id'],'type':_0x5ebd41[_0x2477('0x27')],'sectionId':_0x5ebd41['id']},{})[_0x2477('0x24')](function(){return _0x1be729;});}else{return _0x1be729;}})[_0x2477('0x41')](function(_0x29db21){logger[_0x2477('0x26')](_0x2477('0x54'),_0x29db21);});}return _0x1be729;});})['then'](respondWithResult(_0x427ec0,0xc9))['catch'](handleError(_0x427ec0,null));};exports[_0x2477('0x21')]=function(_0x4352b1,_0x7ac958,_0x4b074b){var _0x1d7d47;return db[_0x2477('0x2b')][_0x2477('0x46')]({'where':{'id':_0x4352b1[_0x2477('0x43')]['id']}})[_0x2477('0x24')](function(_0x3a339e){if(_0x3a339e){return db[_0x2477('0x47')]['transaction'](function(_0x1dc9f2){return _0x3a339e[_0x2477('0x21')]({'transaction':_0x1dc9f2,'raw':!![]})[_0x2477('0x24')](function(_0x5444d7){if(_0x5444d7[_0x2477('0x4a')]){fs[_0x2477('0x55')](_0x5444d7[_0x2477('0x4a')])[_0x2477('0x56')](function(_0x233b53){fs[_0x2477('0x57')](path['join'](_0x5444d7[_0x2477('0x4a')],_0x233b53));});fs['rmdirSync'](_0x5444d7['directory']);}return _0x5444d7;});})[_0x2477('0x41')](function(_0x4fb2a6){throw new db['Sequelize']['ValidationError'](_0x4fb2a6[_0x2477('0x58')]);});}})['then'](handleEntityNotFound(_0x7ac958,null))[_0x2477('0x24')](removeEntity(_0x7ac958,null))[_0x2477('0x41')](handleError(_0x7ac958,null));};exports[_0x2477('0x59')]=function(_0x792c42,_0x202ce7,_0xa0a36b){return db[_0x2477('0x47')]['transaction'](function(_0x3d7bfa){var _0x51ad20;return db['VoiceMusicOnHold'][_0x2477('0x46')]({'where':{'id':_0x792c42[_0x2477('0x43')]['id']}})[_0x2477('0x24')](function(_0x138795){if(_0x138795){_0x51ad20=_0x138795;return _0x138795['addSound'](_0x792c42[_0x2477('0x45')]['id'],{'transaction':_0x3d7bfa});}})['then'](function(_0x464f41){if(_0x464f41){return db[_0x2477('0x5a')][_0x2477('0x5b')]({'where':{'id':_0x792c42[_0x2477('0x45')]['id']},'attributes':['id',_0x2477('0x27'),_0x2477('0x5c'),_0x2477('0x5d'),_0x2477('0x5e')],'raw':!![]});}})[_0x2477('0x24')](function(_0x1f0651){if(_0x1f0651){var _0x2df6db=path['join'](config[_0x2477('0x5f')],'server/files/sounds/converted',util[_0x2477('0x60')](_0x2477('0x61'),path[_0x2477('0x62')](_0x1f0651[_0x2477('0x5c')],path[_0x2477('0x63')](_0x1f0651[_0x2477('0x5c')])),_0x1f0651[_0x2477('0x5d')]));var _0x4f5834=path[_0x2477('0x4b')](config['root'],_0x2477('0x4c'),_0x51ad20[_0x2477('0x27')],util[_0x2477('0x60')]('%s.%s',_0x1f0651['name'],_0x1f0651['converted_format']));fs['symlinkSync'](_0x2df6db,_0x4f5834);return _0x1f0651;}})['catch'](function(_0x226572){throw new db[(_0x2477('0x64'))][(_0x2477('0x65'))](_0x226572[_0x2477('0x58')]);});})['then'](handleEntityNotFound(_0x202ce7,null))[_0x2477('0x24')](respondWithResult(_0x202ce7,0xc9))['catch'](handleError(_0x202ce7,null));};exports[_0x2477('0x66')]=function(_0x2732be,_0x3e06cc,_0x422386){return db[_0x2477('0x47')]['transaction'](function(_0x2eea47){var _0x1b070d;return db[_0x2477('0x2b')]['findOne']({'where':{'id':_0x2732be['params']['id']}})[_0x2477('0x24')](handleEntityNotFound(_0x3e06cc,null))[_0x2477('0x24')](function(_0x5d9dfd){if(_0x5d9dfd){_0x1b070d=_0x5d9dfd;return _0x5d9dfd[_0x2477('0x66')](_0x2732be[_0x2477('0x43')]['id2']);}})[_0x2477('0x24')](function(_0x201980){if(_0x201980){return db['Sound'][_0x2477('0x5b')]({'where':{'id':_0x2732be[_0x2477('0x43')][_0x2477('0x67')]},'attributes':['id',_0x2477('0x27'),_0x2477('0x5c'),_0x2477('0x5d'),_0x2477('0x5e')],'raw':!![]});}})[_0x2477('0x24')](function(_0x30cd6c){if(_0x30cd6c){fs[_0x2477('0x57')](path[_0x2477('0x4b')](_0x1b070d[_0x2477('0x4a')],util[_0x2477('0x60')](_0x2477('0x61'),_0x30cd6c[_0x2477('0x27')],_0x30cd6c[_0x2477('0x5d')])));return _0x30cd6c;}})[_0x2477('0x41')](function(_0x4ca09d){throw new db[(_0x2477('0x64'))][(_0x2477('0x65'))](_0x4ca09d[_0x2477('0x58')]);});})[_0x2477('0x24')](handleEntityNotFound(_0x3e06cc,null))[_0x2477('0x24')](respondWithStatusCode(_0x3e06cc,0xcc))[_0x2477('0x41')](handleError(_0x3e06cc,null));};exports['getSounds']=function(_0x262e18,_0x3f8daf,_0x3e8ae3){var _0x48abe5={};var _0x5c1c5c={};var _0x3086f6;var _0x1a687d;return db[_0x2477('0x2b')][_0x2477('0x5b')]({'where':{'id':_0x262e18[_0x2477('0x43')]['id']}})[_0x2477('0x24')](handleEntityNotFound(_0x3f8daf,null))[_0x2477('0x24')](function(_0x5a2799){if(_0x5a2799){_0x3086f6=_0x5a2799;_0x5c1c5c['model']=_['keys'](db[_0x2477('0x5a')][_0x2477('0x2c')]);_0x5c1c5c[_0x2477('0x31')]=_[_0x2477('0x2f')](_0x262e18[_0x2477('0x31')]);_0x5c1c5c[_0x2477('0x30')]=_['intersection'](_0x5c1c5c[_0x2477('0x35')],_0x5c1c5c[_0x2477('0x31')]);_0x48abe5['attributes']=_[_0x2477('0x44')](_0x5c1c5c[_0x2477('0x35')],qs[_0x2477('0x33')](_0x262e18['query'][_0x2477('0x33')]));_0x48abe5[_0x2477('0x32')]=_0x48abe5['attributes'][_0x2477('0x34')]?_0x48abe5['attributes']:_0x5c1c5c[_0x2477('0x35')];_0x48abe5[_0x2477('0x68')]=qs[_0x2477('0x36')](_0x262e18[_0x2477('0x31')][_0x2477('0x36')]);_0x48abe5[_0x2477('0x38')]=qs[_0x2477('0x30')](_[_0x2477('0x37')](_0x262e18[_0x2477('0x31')],_0x5c1c5c[_0x2477('0x30')]));if(_0x262e18[_0x2477('0x31')][_0x2477('0x3a')]){_0x48abe5[_0x2477('0x38')]=_[_0x2477('0x69')](_0x48abe5[_0x2477('0x38')],{'$or':_[_0x2477('0x2a')](_0x48abe5[_0x2477('0x32')],function(_0x291c37){var _0x524354={};_0x524354[_0x291c37]={'$like':'%'+_0x262e18[_0x2477('0x31')][_0x2477('0x3a')]+'%'};return _0x524354;})});}_0x48abe5=_[_0x2477('0x69')]({},_0x48abe5,_0x262e18['options']);return _0x3086f6['getSounds'](_0x48abe5);}})[_0x2477('0x24')](function(_0x1c61b8){if(_0x1c61b8){_0x1a687d=_0x1c61b8[_0x2477('0x34')];if(!_0x262e18[_0x2477('0x31')][_0x2477('0x6a')](_0x2477('0x6b'))){_0x48abe5['limit']=qs[_0x2477('0x1b')](_0x262e18[_0x2477('0x31')][_0x2477('0x1b')]);_0x48abe5[_0x2477('0x1a')]=qs[_0x2477('0x1a')](_0x262e18[_0x2477('0x31')][_0x2477('0x1a')]);}return _0x3086f6[_0x2477('0x6c')](_0x48abe5);}})[_0x2477('0x24')](function(_0x31ccf3){if(_0x31ccf3){return _0x31ccf3?{'count':_0x1a687d,'rows':_0x31ccf3}:null;}})[_0x2477('0x24')](respondWithResult(_0x3f8daf,null))[_0x2477('0x41')](handleError(_0x3f8daf,null));}; \ No newline at end of file +var _0x56f7=['root','server/files/moh','directory','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','MusicOnHolds','userProfileId','autoAssociation','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','save_name','extname','format','symlinkSync','message','removeSound','findOne','id2','getSounds','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','UserProfileResource','destroy','end','error','stack','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','name','filter','includeAll','include','findAll','rows','catch','params','options','body','create','sequelize','transaction','mode','files','join'];(function(_0x409c32,_0x50266a){var _0x1944b6=function(_0x3bf23f){while(--_0x3bf23f){_0x409c32['push'](_0x409c32['shift']());}};_0x1944b6(++_0x50266a);}(_0x56f7,0xfb));var _0x756f=function(_0x22bf49,_0x14c5e3){_0x22bf49=_0x22bf49-0x0;var _0xea63b0=_0x56f7[_0x22bf49];return _0xea63b0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x756f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x756f('0x1'));var jsonpatch=require(_0x756f('0x2'));var rp=require(_0x756f('0x3'));var moment=require(_0x756f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x756f('0x5'));var util=require(_0x756f('0x6'));var path=require('path');var sox=require(_0x756f('0x7'));var csv=require(_0x756f('0x8'));var ejs=require(_0x756f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x756f('0xa'));var crypto=require(_0x756f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x756f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x756f('0xd'));var Papa=require('papaparse');var Redis=require(_0x756f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x756f('0xf'));var as=require(_0x756f('0x10'));var hardwareService=require(_0x756f('0x11'));var logger=require(_0x756f('0x12'))(_0x756f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x756f('0x14'))['db'];function respondWithStatusCode(_0x379ed2,_0x12061c){_0x12061c=_0x12061c||0xcc;return function(_0x4b0c01){if(_0x4b0c01){return _0x379ed2[_0x756f('0x15')](_0x12061c);}return _0x379ed2[_0x756f('0x16')](_0x12061c)['end']();};}function respondWithResult(_0x1874f7,_0x71096a){_0x71096a=_0x71096a||0xc8;return function(_0xf94b2e){if(_0xf94b2e){return _0x1874f7[_0x756f('0x16')](_0x71096a)[_0x756f('0x17')](_0xf94b2e);}};}function respondWithFilteredResult(_0x4d7fbf,_0x455cba){return function(_0x42a8b8){if(_0x42a8b8){var _0x150c30=_0x42a8b8[_0x756f('0x18')],_0x1e850a=_0x455cba['offset'],_0x470672=_0x455cba[_0x756f('0x19')]+_0x455cba[_0x756f('0x1a')],_0x5cdfad;if(_0x470672>=_0x150c30){_0x470672=_0x150c30;_0x5cdfad=0xc8;}else{_0x5cdfad=0xce;}_0x4d7fbf[_0x756f('0x16')](_0x5cdfad);return _0x4d7fbf[_0x756f('0x1b')]('Content-Range',_0x1e850a+'-'+_0x470672+'/'+_0x150c30)['json'](_0x42a8b8);}return null;};}function patchUpdates(_0x26af23){return function(_0xfdc051){try{jsonpatch[_0x756f('0x1c')](_0xfdc051,_0x26af23,!![]);}catch(_0x3ca45d){return BPromise[_0x756f('0x1d')](_0x3ca45d);}return _0xfdc051['save']();};}function saveUpdates(_0x3cf3eb,_0x2ee8ec){return function(_0x18adb4){if(_0x18adb4){return _0x18adb4[_0x756f('0x1e')](_0x3cf3eb)[_0x756f('0x1f')](function(_0x1845d6){return _0x1845d6;});}return null;};}function removeEntity(_0x4ffc86,_0x1fce1b){return function(_0x1a7420){if(_0x1a7420){return _0x1a7420['destroy']()[_0x756f('0x1f')](function(){var _0x195fbd=_0x1a7420['get']({'plain':!![]});var _0x5beb7d='MusicOnHolds';return db[_0x756f('0x20')][_0x756f('0x21')]({'where':{'type':_0x5beb7d,'resourceId':_0x195fbd['id']}})['then'](function(){return _0x1a7420;});})['then'](function(){_0x4ffc86['status'](0xcc)[_0x756f('0x22')]();});}};}function handleEntityNotFound(_0x5e86c0,_0x5b9de0){return function(_0x18dab8){if(!_0x18dab8){_0x5e86c0[_0x756f('0x15')](0x194);}return _0x18dab8;};}function handleError(_0x22f0cd,_0x2289d5){_0x2289d5=_0x2289d5||0x1f4;return function(_0x43b555){logger[_0x756f('0x23')](_0x43b555[_0x756f('0x24')]);if(_0x43b555['name']){delete _0x43b555['name'];}_0x22f0cd['status'](_0x2289d5)[_0x756f('0x25')](_0x43b555);};}exports['index']=function(_0x32ec1b,_0x1c5be4){var _0x2335bc={},_0xcb50b7={},_0x19e062={'count':0x0,'rows':[]};var _0x3e7841=_['map'](db[_0x756f('0x26')][_0x756f('0x27')],function(_0x3c1c4a){return{'name':_0x3c1c4a[_0x756f('0x28')],'type':_0x3c1c4a[_0x756f('0x29')][_0x756f('0x2a')]};});_0xcb50b7[_0x756f('0x2b')]=_[_0x756f('0x2c')](_0x3e7841,'name');_0xcb50b7[_0x756f('0x2d')]=_[_0x756f('0x2e')](_0x32ec1b[_0x756f('0x2d')]);_0xcb50b7['filters']=_[_0x756f('0x2f')](_0xcb50b7[_0x756f('0x2b')],_0xcb50b7[_0x756f('0x2d')]);_0x2335bc[_0x756f('0x30')]=_[_0x756f('0x2f')](_0xcb50b7[_0x756f('0x2b')],qs['fields'](_0x32ec1b[_0x756f('0x2d')][_0x756f('0x31')]));_0x2335bc[_0x756f('0x30')]=_0x2335bc[_0x756f('0x30')][_0x756f('0x32')]?_0x2335bc[_0x756f('0x30')]:_0xcb50b7[_0x756f('0x2b')];if(!_0x32ec1b[_0x756f('0x2d')][_0x756f('0x33')](_0x756f('0x34'))){_0x2335bc[_0x756f('0x1a')]=qs[_0x756f('0x1a')](_0x32ec1b[_0x756f('0x2d')]['limit']);_0x2335bc['offset']=qs['offset'](_0x32ec1b[_0x756f('0x2d')][_0x756f('0x19')]);}_0x2335bc[_0x756f('0x35')]=qs[_0x756f('0x36')](_0x32ec1b[_0x756f('0x2d')][_0x756f('0x36')]);_0x2335bc[_0x756f('0x37')]=qs[_0x756f('0x38')](_[_0x756f('0x39')](_0x32ec1b[_0x756f('0x2d')],_0xcb50b7[_0x756f('0x38')]));if(_0x32ec1b['query']['filter']){_0x2335bc[_0x756f('0x37')]=_[_0x756f('0x3a')](_0x2335bc['where'],{'$or':_[_0x756f('0x2c')](_0x3e7841,function(_0x33c26e){if(_0x33c26e[_0x756f('0x29')]!==_0x756f('0x3b')){var _0x4249e1={};_0x4249e1[_0x33c26e[_0x756f('0x3c')]]={'$like':'%'+_0x32ec1b['query'][_0x756f('0x3d')]+'%'};return _0x4249e1;}})});}_0x2335bc=_[_0x756f('0x3a')]({},_0x2335bc,_0x32ec1b['options']);var _0x21dff0={'where':_0x2335bc[_0x756f('0x37')]};return db[_0x756f('0x26')][_0x756f('0x18')](_0x21dff0)[_0x756f('0x1f')](function(_0x254e05){_0x19e062[_0x756f('0x18')]=_0x254e05;if(_0x32ec1b[_0x756f('0x2d')][_0x756f('0x3e')]){_0x2335bc[_0x756f('0x3f')]=[{'all':!![]}];}return db[_0x756f('0x26')][_0x756f('0x40')](_0x2335bc);})[_0x756f('0x1f')](function(_0x2ab0ac){_0x19e062[_0x756f('0x41')]=_0x2ab0ac;return _0x19e062;})[_0x756f('0x1f')](respondWithFilteredResult(_0x1c5be4,_0x2335bc))[_0x756f('0x42')](handleError(_0x1c5be4,null));};exports['show']=function(_0x39bc15,_0x2dc2af){var _0x555af6={'raw':![],'where':{'id':_0x39bc15[_0x756f('0x43')]['id']}},_0x4feeb4={};_0x4feeb4['model']=_[_0x756f('0x2e')](db[_0x756f('0x26')]['rawAttributes']);_0x4feeb4[_0x756f('0x2d')]=_['keys'](_0x39bc15['query']);_0x4feeb4[_0x756f('0x38')]=_[_0x756f('0x2f')](_0x4feeb4[_0x756f('0x2b')],_0x4feeb4[_0x756f('0x2d')]);_0x555af6[_0x756f('0x30')]=_[_0x756f('0x2f')](_0x4feeb4['model'],qs[_0x756f('0x31')](_0x39bc15[_0x756f('0x2d')][_0x756f('0x31')]));_0x555af6[_0x756f('0x30')]=_0x555af6['attributes'][_0x756f('0x32')]?_0x555af6[_0x756f('0x30')]:_0x4feeb4['model'];if(_0x39bc15[_0x756f('0x2d')][_0x756f('0x3e')]){_0x555af6[_0x756f('0x3f')]=[{'all':!![]}];}_0x555af6=_['merge']({},_0x555af6,_0x39bc15[_0x756f('0x44')]);return db['VoiceMusicOnHold']['find'](_0x555af6)['then'](handleEntityNotFound(_0x2dc2af,null))['then'](respondWithResult(_0x2dc2af,null))[_0x756f('0x42')](handleError(_0x2dc2af,null));};exports[_0x756f('0x1e')]=function(_0xbdac04,_0x3de027){if(_0xbdac04[_0x756f('0x45')]['id']){delete _0xbdac04[_0x756f('0x45')]['id'];}return db[_0x756f('0x26')]['find']({'where':{'id':_0xbdac04[_0x756f('0x43')]['id']}})[_0x756f('0x1f')](handleEntityNotFound(_0x3de027,null))[_0x756f('0x1f')](saveUpdates(_0xbdac04[_0x756f('0x45')],null))[_0x756f('0x1f')](respondWithResult(_0x3de027,null))[_0x756f('0x42')](handleError(_0x3de027,null));};exports[_0x756f('0x46')]=function(_0x309ab8,_0x2a559a,_0x118028){return db[_0x756f('0x47')][_0x756f('0x48')](function(_0x22ca6d){if(_0x309ab8[_0x756f('0x45')][_0x756f('0x49')]===_0x756f('0x4a')){_0x309ab8[_0x756f('0x45')]['directory']=path[_0x756f('0x4b')](config[_0x756f('0x4c')],_0x756f('0x4d'),_0x309ab8['body']['name']);}return db['VoiceMusicOnHold'][_0x756f('0x46')](_0x309ab8[_0x756f('0x45')],{'transaction':_0x22ca6d})['then'](function(_0x338dce){if(_0x309ab8[_0x756f('0x45')][_0x756f('0x49')]==='files'){fs['mkdirSync'](_0x338dce[_0x756f('0x4e')],parseInt('0777',0x8));}var _0x15b79a=_0x309ab8[_0x756f('0x4f')][_0x756f('0x50')]({'plain':!![]});if(!_0x15b79a)throw new Error(_0x756f('0x51'));if(_0x15b79a[_0x756f('0x52')]===_0x756f('0x4f')){var _0x99c83a=_0x338dce[_0x756f('0x50')]({'plain':!![]});return db[_0x756f('0x53')][_0x756f('0x54')]({'where':{'name':_0x756f('0x55'),'userProfileId':_0x15b79a[_0x756f('0x56')]},'raw':!![]})[_0x756f('0x1f')](function(_0x2a3254){if(_0x2a3254&&_0x2a3254[_0x756f('0x57')]===0x0){return db[_0x756f('0x20')]['create']({'name':_0x99c83a['name'],'resourceId':_0x99c83a['id'],'type':_0x2a3254['name'],'sectionId':_0x2a3254['id']},{})[_0x756f('0x1f')](function(){return _0x338dce;});}else{return _0x338dce;}})['catch'](function(_0x2ab68b){logger[_0x756f('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ab68b);});}return _0x338dce;});})[_0x756f('0x1f')](respondWithResult(_0x2a559a,0xc9))['catch'](handleError(_0x2a559a,null));};exports['destroy']=function(_0x10f5b6,_0x39b614,_0x58764f){var _0x2617c9;return db['VoiceMusicOnHold'][_0x756f('0x54')]({'where':{'id':_0x10f5b6[_0x756f('0x43')]['id']}})['then'](function(_0x225be4){if(_0x225be4){return db['sequelize'][_0x756f('0x48')](function(_0x51f158){return _0x225be4['destroy']({'transaction':_0x51f158,'raw':!![]})[_0x756f('0x1f')](function(_0x4dd7d6){if(_0x4dd7d6[_0x756f('0x4e')]){fs[_0x756f('0x58')](_0x4dd7d6['directory'])['forEach'](function(_0x5f44e2){fs[_0x756f('0x59')](path[_0x756f('0x4b')](_0x4dd7d6[_0x756f('0x4e')],_0x5f44e2));});fs[_0x756f('0x5a')](_0x4dd7d6[_0x756f('0x4e')]);}return _0x4dd7d6;});})[_0x756f('0x42')](function(_0xf0fbee){throw new db[(_0x756f('0x5b'))][(_0x756f('0x5c'))](_0xf0fbee['message']);});}})[_0x756f('0x1f')](handleEntityNotFound(_0x39b614,null))['then'](removeEntity(_0x39b614,null))[_0x756f('0x42')](handleError(_0x39b614,null));};exports[_0x756f('0x5d')]=function(_0x4001f4,_0x4e196f,_0x203784){return db[_0x756f('0x47')][_0x756f('0x48')](function(_0x230775){var _0x1a3abe;return db[_0x756f('0x26')][_0x756f('0x54')]({'where':{'id':_0x4001f4['params']['id']}})[_0x756f('0x1f')](function(_0x47b6d6){if(_0x47b6d6){_0x1a3abe=_0x47b6d6;return _0x47b6d6['addSound'](_0x4001f4[_0x756f('0x45')]['id'],{'transaction':_0x230775});}})[_0x756f('0x1f')](function(_0x59e60d){if(_0x59e60d){return db[_0x756f('0x5e')]['findOne']({'where':{'id':_0x4001f4['body']['id']},'attributes':['id',_0x756f('0x3c'),'save_name',_0x756f('0x5f'),_0x756f('0x60')],'raw':!![]});}})['then'](function(_0x3d3480){if(_0x3d3480){var _0x14a321=path[_0x756f('0x4b')](config[_0x756f('0x4c')],_0x756f('0x61'),util['format'](_0x756f('0x62'),path[_0x756f('0x63')](_0x3d3480[_0x756f('0x64')],path[_0x756f('0x65')](_0x3d3480['save_name'])),_0x3d3480[_0x756f('0x5f')]));var _0x33b53f=path[_0x756f('0x4b')](config['root'],_0x756f('0x4d'),_0x1a3abe['name'],util[_0x756f('0x66')](_0x756f('0x62'),_0x3d3480[_0x756f('0x3c')],_0x3d3480[_0x756f('0x5f')]));fs[_0x756f('0x67')](_0x14a321,_0x33b53f);return _0x3d3480;}})[_0x756f('0x42')](function(_0x114ba3){throw new db[(_0x756f('0x5b'))]['ValidationError'](_0x114ba3[_0x756f('0x68')]);});})[_0x756f('0x1f')](handleEntityNotFound(_0x4e196f,null))[_0x756f('0x1f')](respondWithResult(_0x4e196f,0xc9))[_0x756f('0x42')](handleError(_0x4e196f,null));};exports[_0x756f('0x69')]=function(_0x2244d0,_0x8aa7f7,_0x1ea77b){return db[_0x756f('0x47')]['transaction'](function(_0x346221){var _0x3e3be5;return db[_0x756f('0x26')][_0x756f('0x6a')]({'where':{'id':_0x2244d0['params']['id']}})[_0x756f('0x1f')](handleEntityNotFound(_0x8aa7f7,null))['then'](function(_0x75ad8f){if(_0x75ad8f){_0x3e3be5=_0x75ad8f;return _0x75ad8f[_0x756f('0x69')](_0x2244d0[_0x756f('0x43')][_0x756f('0x6b')]);}})[_0x756f('0x1f')](function(_0x30dcec){if(_0x30dcec){return db[_0x756f('0x5e')][_0x756f('0x6a')]({'where':{'id':_0x2244d0[_0x756f('0x43')]['id2']},'attributes':['id',_0x756f('0x3c'),_0x756f('0x64'),_0x756f('0x5f'),_0x756f('0x60')],'raw':!![]});}})[_0x756f('0x1f')](function(_0x219285){if(_0x219285){fs[_0x756f('0x59')](path[_0x756f('0x4b')](_0x3e3be5['directory'],util[_0x756f('0x66')](_0x756f('0x62'),_0x219285['name'],_0x219285[_0x756f('0x5f')])));return _0x219285;}})[_0x756f('0x42')](function(_0x3e9d0d){throw new db['Sequelize'][(_0x756f('0x5c'))](_0x3e9d0d[_0x756f('0x68')]);});})[_0x756f('0x1f')](handleEntityNotFound(_0x8aa7f7,null))[_0x756f('0x1f')](respondWithStatusCode(_0x8aa7f7,0xcc))['catch'](handleError(_0x8aa7f7,null));};exports['getSounds']=function(_0x5ad99b,_0x480b69,_0x1b4861){var _0x4908f7={};var _0x3457e2={};var _0x384cdd;var _0x2e9641;return db[_0x756f('0x26')][_0x756f('0x6a')]({'where':{'id':_0x5ad99b[_0x756f('0x43')]['id']}})[_0x756f('0x1f')](handleEntityNotFound(_0x480b69,null))[_0x756f('0x1f')](function(_0x3d380f){if(_0x3d380f){_0x384cdd=_0x3d380f;_0x3457e2[_0x756f('0x2b')]=_['keys'](db[_0x756f('0x5e')]['rawAttributes']);_0x3457e2['query']=_[_0x756f('0x2e')](_0x5ad99b[_0x756f('0x2d')]);_0x3457e2[_0x756f('0x38')]=_[_0x756f('0x2f')](_0x3457e2['model'],_0x3457e2[_0x756f('0x2d')]);_0x4908f7[_0x756f('0x30')]=_[_0x756f('0x2f')](_0x3457e2[_0x756f('0x2b')],qs['fields'](_0x5ad99b[_0x756f('0x2d')][_0x756f('0x31')]));_0x4908f7[_0x756f('0x30')]=_0x4908f7[_0x756f('0x30')][_0x756f('0x32')]?_0x4908f7[_0x756f('0x30')]:_0x3457e2['model'];_0x4908f7[_0x756f('0x35')]=qs['sort'](_0x5ad99b['query'][_0x756f('0x36')]);_0x4908f7[_0x756f('0x37')]=qs[_0x756f('0x38')](_['pick'](_0x5ad99b[_0x756f('0x2d')],_0x3457e2['filters']));if(_0x5ad99b[_0x756f('0x2d')][_0x756f('0x3d')]){_0x4908f7[_0x756f('0x37')]=_['merge'](_0x4908f7[_0x756f('0x37')],{'$or':_[_0x756f('0x2c')](_0x4908f7['attributes'],function(_0x66de49){var _0x209f0d={};_0x209f0d[_0x66de49]={'$like':'%'+_0x5ad99b[_0x756f('0x2d')]['filter']+'%'};return _0x209f0d;})});}_0x4908f7=_['merge']({},_0x4908f7,_0x5ad99b[_0x756f('0x44')]);return _0x384cdd[_0x756f('0x6c')](_0x4908f7);}})[_0x756f('0x1f')](function(_0x1adeb4){if(_0x1adeb4){_0x2e9641=_0x1adeb4[_0x756f('0x32')];if(!_0x5ad99b['query'][_0x756f('0x33')](_0x756f('0x34'))){_0x4908f7[_0x756f('0x1a')]=qs['limit'](_0x5ad99b[_0x756f('0x2d')][_0x756f('0x1a')]);_0x4908f7[_0x756f('0x19')]=qs[_0x756f('0x19')](_0x5ad99b[_0x756f('0x2d')][_0x756f('0x19')]);}return _0x384cdd[_0x756f('0x6c')](_0x4908f7);}})[_0x756f('0x1f')](function(_0x4463c8){if(_0x4463c8){return _0x4463c8?{'count':_0x2e9641,'rows':_0x4463c8}:null;}})[_0x756f('0x1f')](respondWithResult(_0x480b69,null))['catch'](handleError(_0x480b69,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e3d0d2e..da530ed 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x357a=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','lodash','util','bluebird'];(function(_0x1e5b8b,_0x4937be){var _0x59393f=function(_0x14dc81){while(--_0x14dc81){_0x1e5b8b['push'](_0x1e5b8b['shift']());}};_0x59393f(++_0x4937be);}(_0x357a,0x16f));var _0xa357=function(_0x383812,_0x22703d){_0x383812=_0x383812-0x0;var _0x2ba305=_0x357a[_0x383812];return _0x2ba305;};'use strict';var _=require(_0xa357('0x0'));var util=require(_0xa357('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa357('0x2'));var rp=require(_0xa357('0x3'));var fs=require('fs');var path=require(_0xa357('0x4'));var rimraf=require(_0xa357('0x5'));var config=require(_0xa357('0x6'));var attributes=require(_0xa357('0x7'));module['exports']=function(_0x522785,_0x1e4a3d){return _0x522785[_0xa357('0x8')](_0xa357('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2f5=['bluebird','request-promise','path','../../config/environment','exports','define','VoiceMusicOnHold','util','../../config/logger','api','moment'];(function(_0x1ca815,_0x4f701a){var _0x595706=function(_0x520a6c){while(--_0x520a6c){_0x1ca815['push'](_0x1ca815['shift']());}};_0x595706(++_0x4f701a);}(_0xa2f5,0x6a));var _0x5a2f=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa2f5[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0x5a2f('0x0'));var logger=require(_0x5a2f('0x1'))(_0x5a2f('0x2'));var moment=require(_0x5a2f('0x3'));var BPromise=require(_0x5a2f('0x4'));var rp=require(_0x5a2f('0x5'));var fs=require('fs');var path=require(_0x5a2f('0x6'));var rimraf=require('rimraf');var config=require(_0x5a2f('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x5a2f('0x8')]=function(_0x1048fe,_0x556287){return _0x1048fe[_0x5a2f('0x9')](_0x5a2f('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index f6e7c46..78571ca 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa17a=['error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xa17a,0x153));var _0xaa17=function(_0x103466,_0x190bb5){_0x103466=_0x103466-0x0;var _0x416ba8=_0xa17a[_0x103466];return _0x416ba8;};'use strict';var _=require('lodash');var util=require(_0xaa17('0x0'));var moment=require(_0xaa17('0x1'));var BPromise=require(_0xaa17('0x2'));var rs=require(_0xaa17('0x3'));var fs=require('fs');var Redis=require(_0xaa17('0x4'));var db=require(_0xaa17('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaa17('0x6'));var config=require(_0xaa17('0x7'));var jayson=require(_0xaa17('0x8'));var client=jayson[_0xaa17('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd465,_0x7ccbda,_0x125338){return new BPromise(function(_0x55fa2e,_0x26574f){return client[_0xaa17('0xa')](_0x1cd465,_0x125338)[_0xaa17('0xb')](function(_0x13488e){logger[_0xaa17('0xc')](_0xaa17('0xd'),_0x7ccbda,_0xaa17('0xe'));logger[_0xaa17('0xf')](_0xaa17('0x10'),_0x7ccbda,_0xaa17('0xe'),JSON[_0xaa17('0x11')](_0x13488e));if(_0x13488e[_0xaa17('0x12')]){if(_0x13488e[_0xaa17('0x12')]['code']===0x1f4){logger[_0xaa17('0x12')](_0xaa17('0xd'),_0x7ccbda,_0x13488e[_0xaa17('0x12')][_0xaa17('0x13')]);return _0x26574f(_0x13488e[_0xaa17('0x12')]['message']);}logger[_0xaa17('0x12')](_0xaa17('0xd'),_0x7ccbda,_0x13488e['error'][_0xaa17('0x13')]);return _0x55fa2e(_0x13488e[_0xaa17('0x12')][_0xaa17('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x7ccbda,_0xaa17('0xe'));_0x55fa2e(_0x13488e['result']['message']);}})[_0xaa17('0x14')](function(_0xe5b5ec){logger[_0xaa17('0x12')](_0xaa17('0xd'),_0x7ccbda,_0xe5b5ec);_0x26574f(_0xe5b5ec);});});} \ No newline at end of file +var _0xccd1=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xcec545,_0x58fd44){var _0x401d72=function(_0x27dcfe){while(--_0x27dcfe){_0xcec545['push'](_0xcec545['shift']());}};_0x401d72(++_0x58fd44);}(_0xccd1,0x1bc));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1ccd('0x0'));var util=require(_0x1ccd('0x1'));var moment=require(_0x1ccd('0x2'));var BPromise=require(_0x1ccd('0x3'));var rs=require(_0x1ccd('0x4'));var fs=require('fs');var Redis=require(_0x1ccd('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1ccd('0x6'))(_0x1ccd('0x7'));var config=require(_0x1ccd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ccd('0x9')][_0x1ccd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ac14,_0x18c921,_0x341bbc){return new BPromise(function(_0x5dad99,_0x542cb1){return client['request'](_0x56ac14,_0x341bbc)[_0x1ccd('0xb')](function(_0x32c8cf){logger[_0x1ccd('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x18c921,_0x1ccd('0xd'));logger[_0x1ccd('0xe')](_0x1ccd('0xf'),_0x18c921,_0x1ccd('0xd'),JSON[_0x1ccd('0x10')](_0x32c8cf));if(_0x32c8cf['error']){if(_0x32c8cf[_0x1ccd('0x11')][_0x1ccd('0x12')]===0x1f4){logger['error'](_0x1ccd('0x13'),_0x18c921,_0x32c8cf['error'][_0x1ccd('0x14')]);return _0x542cb1(_0x32c8cf[_0x1ccd('0x11')]['message']);}logger['error'](_0x1ccd('0x13'),_0x18c921,_0x32c8cf[_0x1ccd('0x11')][_0x1ccd('0x14')]);return _0x5dad99(_0x32c8cf[_0x1ccd('0x11')][_0x1ccd('0x14')]);}else{logger[_0x1ccd('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x18c921,_0x1ccd('0xd'));_0x5dad99(_0x32c8cf['result']['message']);}})[_0x1ccd('0x15')](function(_0x110435){logger[_0x1ccd('0x11')](_0x1ccd('0x13'),_0x18c921,_0x110435);_0x542cb1(_0x110435);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index dc50c8b..f361ac0 100644 --- a/server/api/voicePrefix/index.js +++ b/server/api/voicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5238=['describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','destroy','delete','removeAgents','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x1a41c6,_0xcc315b){var _0x3c147e=function(_0x2ef300){while(--_0x2ef300){_0x1a41c6['push'](_0x1a41c6['shift']());}};_0x3c147e(++_0xcc315b);}(_0x5238,0x198));var _0x8523=function(_0x295d1e,_0x1a1604){_0x295d1e=_0x295d1e-0x0;var _0x4b98cd=_0x5238[_0x295d1e];return _0x4b98cd;};'use strict';var multer=require('multer');var util=require(_0x8523('0x0'));var path=require(_0x8523('0x1'));var timeout=require(_0x8523('0x2'));var express=require(_0x8523('0x3'));var router=express[_0x8523('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8523('0x5'));var config=require(_0x8523('0x6'));var controller=require('./voicePrefix.controller');router[_0x8523('0x7')]('/',auth[_0x8523('0x8')](),controller['index']);router[_0x8523('0x7')](_0x8523('0x9'),auth[_0x8523('0x8')](),controller[_0x8523('0xa')]);router[_0x8523('0x7')](_0x8523('0xb'),auth[_0x8523('0x8')](),controller[_0x8523('0xc')]);router[_0x8523('0x7')](_0x8523('0xd'),auth[_0x8523('0x8')](),controller[_0x8523('0xe')]);router[_0x8523('0xf')]('/',auth['isAuthenticated'](),controller[_0x8523('0x10')]);router['post'](_0x8523('0xd'),auth['isAuthenticated'](),controller[_0x8523('0x11')]);router[_0x8523('0x12')]('/:id',auth[_0x8523('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8523('0x13')]);router[_0x8523('0x14')](_0x8523('0xd'),auth['isAuthenticated'](),controller[_0x8523('0x15')]);module['exports']=router; \ No newline at end of file +var _0xb91e=['addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getAgents','post','create'];(function(_0x3dbcc2,_0x9e4c3b){var _0x443068=function(_0x4dd4c3){while(--_0x4dd4c3){_0x3dbcc2['push'](_0x3dbcc2['shift']());}};_0x443068(++_0x9e4c3b);}(_0xb91e,0x181));var _0xeb91=function(_0x3bc6f2,_0x5e6ddf){_0x3bc6f2=_0x3bc6f2-0x0;var _0x5922da=_0xb91e[_0x3bc6f2];return _0x5922da;};'use strict';var multer=require(_0xeb91('0x0'));var util=require(_0xeb91('0x1'));var path=require(_0xeb91('0x2'));var timeout=require(_0xeb91('0x3'));var express=require(_0xeb91('0x4'));var router=express[_0xeb91('0x5')]();var auth=require(_0xeb91('0x6'));var interaction=require(_0xeb91('0x7'));var config=require(_0xeb91('0x8'));var controller=require(_0xeb91('0x9'));router[_0xeb91('0xa')]('/',auth[_0xeb91('0xb')](),controller[_0xeb91('0xc')]);router[_0xeb91('0xa')](_0xeb91('0xd'),auth[_0xeb91('0xb')](),controller[_0xeb91('0xe')]);router[_0xeb91('0xa')](_0xeb91('0xf'),auth[_0xeb91('0xb')](),controller['show']);router[_0xeb91('0xa')](_0xeb91('0x10'),auth[_0xeb91('0xb')](),controller[_0xeb91('0x11')]);router[_0xeb91('0x12')]('/',auth['isAuthenticated'](),controller[_0xeb91('0x13')]);router[_0xeb91('0x12')]('/:id/users',auth[_0xeb91('0xb')](),controller[_0xeb91('0x14')]);router[_0xeb91('0x15')](_0xeb91('0xf'),auth['isAuthenticated'](),controller[_0xeb91('0x16')]);router[_0xeb91('0x17')]('/:id',auth[_0xeb91('0xb')](),controller[_0xeb91('0x18')]);router[_0xeb91('0x17')](_0xeb91('0x10'),auth['isAuthenticated'](),controller[_0xeb91('0x19')]);module[_0xeb91('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index edf5570..16561bf 100644 --- a/server/api/voicePrefix/voicePrefix.attributes.js +++ b/server/api/voicePrefix/voicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffaa=['getDataValue','name','INTEGER','sequelize','exports','STRING','system-'];(function(_0x46a5e0,_0x403221){var _0x13a3bd=function(_0x1059dc){while(--_0x1059dc){_0x46a5e0['push'](_0x46a5e0['shift']());}};_0x13a3bd(++_0x403221);}(_0xffaa,0x130));var _0xaffa=function(_0x12e349,_0x2c2d35){_0x12e349=_0x12e349-0x0;var _0x2eefc1=_0xffaa[_0x12e349];return _0x2eefc1;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'name':{'type':Sequelize[_0xaffa('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x124832){return _0xaffa('0x3')+this[_0xaffa('0x4')](_0xaffa('0x5'))+'-';}},'description':{'type':Sequelize[_0xaffa('0x2')]},'callerIdAll':{'type':Sequelize[_0xaffa('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xaffa('0x6')]}}; \ No newline at end of file +var _0xb49e=['system-','getDataValue','name','INTEGER','sequelize','exports','STRING','VIRTUAL'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0xb49e,0x84));var _0xeb49=function(_0x4b96f1,_0x5ca52f){_0x4b96f1=_0x4b96f1-0x0;var _0x48abd9=_0xb49e[_0x4b96f1];return _0x48abd9;};'use strict';var Sequelize=require(_0xeb49('0x0'));module[_0xeb49('0x1')]={'name':{'type':Sequelize[_0xeb49('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xeb49('0x3')],'get':function(_0x258440){return _0xeb49('0x4')+this[_0xeb49('0x5')](_0xeb49('0x6'))+'-';}},'description':{'type':Sequelize[_0xeb49('0x2')]},'callerIdAll':{'type':Sequelize[_0xeb49('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xeb49('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 5ede977..fba7fbf 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc828=['name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','params','length','includeAll','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','addAgents','ids','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack'];(function(_0xa7db78,_0x117e58){var _0x554301=function(_0x54ae66){while(--_0x54ae66){_0xa7db78['push'](_0xa7db78['shift']());}};_0x554301(++_0x117e58);}(_0xc828,0xc6));var _0x8c82=function(_0x45f786,_0x608fde){_0x45f786=_0x45f786-0x0;var _0x164ced=_0xc828[_0x45f786];return _0x164ced;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8c82('0x0'));var rimraf=require(_0x8c82('0x1'));var zipdir=require(_0x8c82('0x2'));var jsonpatch=require(_0x8c82('0x3'));var rp=require(_0x8c82('0x4'));var moment=require(_0x8c82('0x5'));var BPromise=require(_0x8c82('0x6'));var Mustache=require(_0x8c82('0x7'));var util=require(_0x8c82('0x8'));var path=require(_0x8c82('0x9'));var sox=require(_0x8c82('0xa'));var csv=require(_0x8c82('0xb'));var ejs=require(_0x8c82('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c82('0xd'));var crypto=require(_0x8c82('0xe'));var jsforce=require(_0x8c82('0xf'));var deskjs=require(_0x8c82('0x10'));var toCsv=require(_0x8c82('0xb'));var querystring=require(_0x8c82('0x11'));var Papa=require(_0x8c82('0x12'));var Redis=require(_0x8c82('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8c82('0x14'));var as=require(_0x8c82('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c82('0x16'))('api');var utils=require(_0x8c82('0x17'));var config=require(_0x8c82('0x18'));var db=require('../../mysqldb')['db'];config[_0x8c82('0x19')]=_[_0x8c82('0x1a')](config[_0x8c82('0x19')],{'host':_0x8c82('0x1b'),'port':0x18eb});var socket=require(_0x8c82('0x1c'))(new Redis(config['redis']));require(_0x8c82('0x1d'))[_0x8c82('0x1e')](socket);function respondWithStatusCode(_0x46ea90,_0x3410c0){_0x3410c0=_0x3410c0||0xcc;return function(_0x107c71){if(_0x107c71){return _0x46ea90[_0x8c82('0x1f')](_0x3410c0);}return _0x46ea90[_0x8c82('0x20')](_0x3410c0)[_0x8c82('0x21')]();};}function respondWithResult(_0x10ced4,_0x1a1f00){_0x1a1f00=_0x1a1f00||0xc8;return function(_0x17b6a0){if(_0x17b6a0){return _0x10ced4['status'](_0x1a1f00)[_0x8c82('0x22')](_0x17b6a0);}};}function respondWithFilteredResult(_0x48fba3,_0x56179c){return function(_0x89eea0){if(_0x89eea0){var _0x5dc6b0=_0x89eea0['count'],_0x4721cb=_0x56179c[_0x8c82('0x23')],_0x272957=_0x56179c['offset']+_0x56179c[_0x8c82('0x24')],_0x197c77;if(_0x272957>=_0x5dc6b0){_0x272957=_0x5dc6b0;_0x197c77=0xc8;}else{_0x197c77=0xce;}_0x48fba3[_0x8c82('0x20')](_0x197c77);return _0x48fba3['set'](_0x8c82('0x25'),_0x4721cb+'-'+_0x272957+'/'+_0x5dc6b0)[_0x8c82('0x22')](_0x89eea0);}return null;};}function patchUpdates(_0xe771b4){return function(_0x446d26){try{jsonpatch[_0x8c82('0x26')](_0x446d26,_0xe771b4,!![]);}catch(_0x45e3d4){return BPromise[_0x8c82('0x27')](_0x45e3d4);}return _0x446d26[_0x8c82('0x28')]();};}function saveUpdates(_0xa69b46,_0x2f4308){return function(_0x44ec16){if(_0x44ec16){return _0x44ec16[_0x8c82('0x29')](_0xa69b46)[_0x8c82('0x2a')](function(_0x5ecda4){return _0x5ecda4;});}return null;};}function removeEntity(_0xa642e0,_0x517319){return function(_0x580273){if(_0x580273){return _0x580273[_0x8c82('0x2b')]()[_0x8c82('0x2a')](function(){var _0x3bb271=_0x580273[_0x8c82('0x2c')]({'plain':!![]});var _0xa29c9f=_0x8c82('0x2d');return db[_0x8c82('0x2e')][_0x8c82('0x2b')]({'where':{'type':_0xa29c9f,'resourceId':_0x3bb271['id']}})[_0x8c82('0x2a')](function(){return _0x580273;});})[_0x8c82('0x2a')](function(){_0xa642e0[_0x8c82('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d2052,_0x11b0f0){return function(_0x15359c){if(!_0x15359c){_0x3d2052[_0x8c82('0x1f')](0x194);}return _0x15359c;};}function handleError(_0x58a6a9,_0x4ae85f){_0x4ae85f=_0x4ae85f||0x1f4;return function(_0x591376){logger['error'](_0x591376[_0x8c82('0x2f')]);if(_0x591376[_0x8c82('0x30')]){delete _0x591376[_0x8c82('0x30')];}_0x58a6a9[_0x8c82('0x20')](_0x4ae85f)[_0x8c82('0x31')](_0x591376);};}exports[_0x8c82('0x32')]=function(_0x2d8150,_0x1eb288){var _0x10cafc={},_0x83f568={},_0x3b5cb0={'count':0x0,'rows':[]};var _0x4aa0da=_[_0x8c82('0x33')](db[_0x8c82('0x34')][_0x8c82('0x35')],function(_0x4a70b7){return{'name':_0x4a70b7['fieldName'],'type':_0x4a70b7[_0x8c82('0x36')][_0x8c82('0x37')]};});_0x83f568[_0x8c82('0x38')]=_[_0x8c82('0x33')](_0x4aa0da,'name');_0x83f568[_0x8c82('0x39')]=_[_0x8c82('0x3a')](_0x2d8150[_0x8c82('0x39')]);_0x83f568[_0x8c82('0x3b')]=_[_0x8c82('0x3c')](_0x83f568['model'],_0x83f568[_0x8c82('0x39')]);_0x10cafc[_0x8c82('0x3d')]=_[_0x8c82('0x3c')](_0x83f568[_0x8c82('0x38')],qs[_0x8c82('0x3e')](_0x2d8150['query'][_0x8c82('0x3e')]));_0x10cafc[_0x8c82('0x3d')]=_0x10cafc[_0x8c82('0x3d')]['length']?_0x10cafc[_0x8c82('0x3d')]:_0x83f568['model'];if(!_0x2d8150['query'][_0x8c82('0x3f')](_0x8c82('0x40'))){_0x10cafc[_0x8c82('0x24')]=qs['limit'](_0x2d8150['query'][_0x8c82('0x24')]);_0x10cafc[_0x8c82('0x23')]=qs[_0x8c82('0x23')](_0x2d8150[_0x8c82('0x39')][_0x8c82('0x23')]);}_0x10cafc[_0x8c82('0x41')]=qs[_0x8c82('0x42')](_0x2d8150[_0x8c82('0x39')][_0x8c82('0x42')]);_0x10cafc[_0x8c82('0x43')]=qs[_0x8c82('0x3b')](_[_0x8c82('0x44')](_0x2d8150[_0x8c82('0x39')],_0x83f568[_0x8c82('0x3b')]));if(_0x2d8150['query'][_0x8c82('0x45')]){_0x10cafc['where']=_[_0x8c82('0x46')](_0x10cafc[_0x8c82('0x43')],{'$or':_[_0x8c82('0x33')](_0x4aa0da,function(_0x3879c3){if(_0x3879c3[_0x8c82('0x36')]!==_0x8c82('0x47')){var _0x3b91fe={};_0x3b91fe[_0x3879c3[_0x8c82('0x30')]]={'$like':'%'+_0x2d8150[_0x8c82('0x39')]['filter']+'%'};return _0x3b91fe;}})});}_0x10cafc=_[_0x8c82('0x46')]({},_0x10cafc,_0x2d8150[_0x8c82('0x48')]);var _0x47594d={'where':_0x10cafc[_0x8c82('0x43')]};return db[_0x8c82('0x34')][_0x8c82('0x49')](_0x47594d)[_0x8c82('0x2a')](function(_0x21fd87){_0x3b5cb0[_0x8c82('0x49')]=_0x21fd87;if(_0x2d8150['query']['includeAll']){_0x10cafc[_0x8c82('0x4a')]=[{'all':!![]}];}return db[_0x8c82('0x34')][_0x8c82('0x4b')](_0x10cafc);})[_0x8c82('0x2a')](function(_0x2ab593){_0x3b5cb0[_0x8c82('0x4c')]=_0x2ab593;return _0x3b5cb0;})['then'](respondWithFilteredResult(_0x1eb288,_0x10cafc))[_0x8c82('0x4d')](handleError(_0x1eb288,null));};exports['show']=function(_0x1ff519,_0x3d3826){var _0x174265={'raw':![],'where':{'id':_0x1ff519[_0x8c82('0x4e')]['id']}},_0x280bba={};_0x280bba[_0x8c82('0x38')]=_[_0x8c82('0x3a')](db[_0x8c82('0x34')][_0x8c82('0x35')]);_0x280bba[_0x8c82('0x39')]=_['keys'](_0x1ff519[_0x8c82('0x39')]);_0x280bba[_0x8c82('0x3b')]=_['intersection'](_0x280bba['model'],_0x280bba[_0x8c82('0x39')]);_0x174265[_0x8c82('0x3d')]=_[_0x8c82('0x3c')](_0x280bba[_0x8c82('0x38')],qs['fields'](_0x1ff519[_0x8c82('0x39')][_0x8c82('0x3e')]));_0x174265[_0x8c82('0x3d')]=_0x174265[_0x8c82('0x3d')][_0x8c82('0x4f')]?_0x174265[_0x8c82('0x3d')]:_0x280bba[_0x8c82('0x38')];if(_0x1ff519[_0x8c82('0x39')][_0x8c82('0x50')]){_0x174265[_0x8c82('0x4a')]=[{'all':!![]}];}_0x174265=_[_0x8c82('0x46')]({},_0x174265,_0x1ff519['options']);return db['VoicePrefix'][_0x8c82('0x51')](_0x174265)[_0x8c82('0x2a')](handleEntityNotFound(_0x3d3826,null))[_0x8c82('0x2a')](respondWithResult(_0x3d3826,null))[_0x8c82('0x4d')](handleError(_0x3d3826,null));};exports[_0x8c82('0x2b')]=function(_0xda04e7,_0x476cdd){return db[_0x8c82('0x34')][_0x8c82('0x51')]({'where':{'id':_0xda04e7[_0x8c82('0x4e')]['id']}})[_0x8c82('0x2a')](handleEntityNotFound(_0x476cdd,null))[_0x8c82('0x2a')](removeEntity(_0x476cdd,null))[_0x8c82('0x4d')](handleError(_0x476cdd,null));};exports[_0x8c82('0x52')]=function(_0x47936e,_0x556d18){return db['VoicePrefix'][_0x8c82('0x52')]()[_0x8c82('0x2a')](respondWithResult(_0x556d18,null))[_0x8c82('0x4d')](handleError(_0x556d18,null));};exports[_0x8c82('0x53')]=function(_0x26e48a,_0x4137fd){var _0x4b7595;return db[_0x8c82('0x54')][_0x8c82('0x55')](function(_0x1f6ad9){return db['VoicePrefix'][_0x8c82('0x53')](_0x26e48a['body'],{'transaction':_0x1f6ad9})['then'](function(_0xefee2e){_0x4b7595=_0xefee2e[_0x8c82('0x2c')]({'plain':!![]});return db[_0x8c82('0x56')][_0x8c82('0x51')]({'where':{'id':_0x4b7595[_0x8c82('0x57')]},'raw':!![]})[_0x8c82('0x2a')](function(_0x29bc12){return createVoicePrefixExtensions(_0x4b7595,_0x29bc12,_0x1f6ad9);});});})[_0x8c82('0x2a')](function(){var _0xffc5=_0x26e48a[_0x8c82('0x58')][_0x8c82('0x2c')]({'plain':!![]});if(!_0xffc5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffc5[_0x8c82('0x59')]===_0x8c82('0x58')){var _0x257607=_0x4b7595;return db[_0x8c82('0x5a')][_0x8c82('0x51')]({'where':{'name':_0x8c82('0x2d'),'userProfileId':_0xffc5[_0x8c82('0x5b')]},'raw':!![]})[_0x8c82('0x2a')](function(_0x347429){if(_0x347429&&_0x347429['autoAssociation']===0x0){return db[_0x8c82('0x2e')][_0x8c82('0x53')]({'name':_0x257607[_0x8c82('0x30')],'resourceId':_0x257607['id'],'type':_0x347429['name'],'sectionId':_0x347429['id']},{})['then'](function(){return _0x4b7595;});}else{return _0x4b7595;}})['catch'](function(_0x3c82cc){logger['error'](_0x8c82('0x5c'),_0x3c82cc);throw _0x3c82cc;});}return _0x4b7595;})[_0x8c82('0x2a')](respondWithResult(_0x4137fd,null))[_0x8c82('0x4d')](handleError(_0x4137fd,null));};function Extension(_0x38e176,_0x14e653,_0x172310,_0x4a389a){this[_0x8c82('0x5d')]=_0x8c82('0x5e');this[_0x8c82('0x5f')]=_0x38e176;this[_0x8c82('0x60')]=_0x172310;this[_0x8c82('0x36')]='system';this['description']=_0x8c82('0x61');this['priority']=_0x14e653;this[_0x8c82('0x62')]=_0x4a389a;}function createVoicePrefixExtensions(_0x178a74,_0xd9a42,_0x28c970){return new BPromise(function(_0x2e2c30,_0xf36d0e){var _0x564bd1=new Extension(formatPrefixName(_0x178a74[_0x8c82('0x63')]),0x1,_0x8c82('0x64'),'Voice\x20Prefix');_0x564bd1[_0x8c82('0x65')]=_0x178a74['id'];return db[_0x8c82('0x56')][_0x8c82('0x53')](_0x564bd1,{'transaction':_0x28c970})[_0x8c82('0x2a')](function(_0x5556f4){var _0x38492a=_0x5556f4['get']({'plain':!![]});var _0x39dce5=_['map'](addVoicePrefixExtensions(_0x178a74,_0xd9a42),function(_0x11dca9){_0x11dca9[_0x8c82('0x57')]=_0x38492a['id'];_0x11dca9[_0x8c82('0x65')]=_0x178a74['id'];return _0x11dca9;});return db[_0x8c82('0x56')][_0x8c82('0x66')](_0x39dce5,{'transaction':_0x28c970})[_0x8c82('0x2a')](function(_0x5e3a62){if(!_0x5e3a62){return _0xf36d0e('Extensions\x20creation\x20failed');}else{return _0x2e2c30(_0x5e3a62);}})['catch'](function(_0x43f262){return _0xf36d0e(_0x43f262);});});;});};function addVoicePrefixExtensions(_0x4f8e36,_0x54b391){var _0xa0ac5a=[];var _0x1b5281=formatPrefixName(_0x4f8e36['prefix']);_0xa0ac5a[_0x8c82('0x67')](new Extension(_0x1b5281,0x2,_0x8c82('0x68'),_0x8c82('0x69')+_0x4f8e36['name']));if(_0x4f8e36['callerIdAll']){_0xa0ac5a[_0x8c82('0x67')](new Extension(_0x1b5281,0x3,'Set',_0x8c82('0x6a')+_0x4f8e36[_0x8c82('0x6b')]));}else{_0xa0ac5a[_0x8c82('0x67')](new Extension(_0x1b5281,0x3,_0x8c82('0x64'),_0x8c82('0x6c')));}_0xa0ac5a['push'](new Extension(_0x1b5281,0x4,_0x8c82('0x6d'),_0x54b391[_0x8c82('0x5d')]+','+_0x8c82('0x6e')+(0x8+_0x4f8e36[_0x8c82('0x30')][_0x8c82('0x4f')])+'}'+','+0x1));return _0xa0ac5a;}function formatPrefixName(_0x5d0ecc){var _0x1df8a2='_';for(var _0x41bee4=0x0;_0x41bee4<_0x5d0ecc[_0x8c82('0x4f')];_0x41bee4++){if(_0x5d0ecc['charAt'](_0x41bee4)=='-'){_0x1df8a2+=_0x5d0ecc[_0x8c82('0x6f')](_0x41bee4);}else{_0x1df8a2+='['+_0x5d0ecc['charAt'](_0x41bee4)+']';}}_0x1df8a2+='.';return _0x1df8a2;}exports[_0x8c82('0x29')]=function(_0x3e3aeb,_0x3e0afb,_0x3ec362){var _0x16ded3=_0x3e3aeb[_0x8c82('0x70')];_0x16ded3[_0x8c82('0x63')]=_0x8c82('0x71')+_0x16ded3[_0x8c82('0x30')]+'-';return db[_0x8c82('0x54')][_0x8c82('0x55')](function(_0x40ee03){return db['VoicePrefix'][_0x8c82('0x29')](_0x16ded3,{'where':{'id':_0x16ded3['id']},'transaction':_0x40ee03})[_0x8c82('0x2a')](function(){return db[_0x8c82('0x56')][_0x8c82('0x2b')]({'where':{'VoicePrefixId':_0x16ded3['id']},'transaction':_0x40ee03})['then'](function(){return db[_0x8c82('0x56')][_0x8c82('0x51')]({'where':{'id':_0x16ded3[_0x8c82('0x57')]},'raw':!![]})['then'](function(_0x44848c){return createVoicePrefixExtensions(_0x16ded3,_0x44848c,_0x40ee03);});});});})[_0x8c82('0x2a')](function(){return db['VoicePrefix']['findById'](_0x16ded3['id']);})['then'](respondWithResult(_0x3e0afb,null))[_0x8c82('0x4d')](handleError(_0x3e0afb,null));};exports[_0x8c82('0x72')]=function(_0x1a8505,_0x452569,_0xfa2cf5){return db[_0x8c82('0x34')][_0x8c82('0x51')]({'where':{'id':_0x1a8505[_0x8c82('0x4e')]['id']}})[_0x8c82('0x2a')](handleEntityNotFound(_0x452569,null))[_0x8c82('0x2a')](function(_0x126777){if(_0x126777){return _0x126777[_0x8c82('0x72')](_0x1a8505[_0x8c82('0x70')]['ids'],_['omit'](_0x1a8505['body'],[_0x8c82('0x73'),'id'])||{})[_0x8c82('0x74')](function(_0x1e8b6e){for(var _0x53ac4e=0x0;_0x53ac4e<_0x1a8505['body'][_0x8c82('0x73')]['length'];_0x53ac4e+=0x1){socket[_0x8c82('0x75')]('userVoicePrefix:save',{'UserId':_0x1a8505['body'][_0x8c82('0x73')][_0x53ac4e],'VoicePrefixId':_0x1a8505[_0x8c82('0x4e')]['id']});}return _0x1e8b6e;});}})['then'](respondWithResult(_0x452569,null))[_0x8c82('0x4d')](handleError(_0x452569,null));};exports[_0x8c82('0x76')]=function(_0x563bca,_0xb69fb2,_0x30f32f){return db[_0x8c82('0x34')]['find']({'where':{'id':_0x563bca[_0x8c82('0x4e')]['id']}})[_0x8c82('0x2a')](handleEntityNotFound(_0xb69fb2,null))[_0x8c82('0x2a')](function(_0x5a0d6d){if(_0x5a0d6d){return _0x5a0d6d[_0x8c82('0x76')](_0x563bca[_0x8c82('0x39')][_0x8c82('0x73')])['then'](function(){if(_[_0x8c82('0x77')](_0x563bca[_0x8c82('0x39')]['ids'])){for(var _0x213538=0x0;_0x213538<_0x563bca[_0x8c82('0x39')][_0x8c82('0x73')][_0x8c82('0x4f')];_0x213538+=0x1){socket['emit'](_0x8c82('0x78'),{'UserId':Number(_0x563bca['query'][_0x8c82('0x73')][_0x213538]),'VoicePrefixId':Number(_0x563bca[_0x8c82('0x4e')]['id'])});}}else{socket['emit'](_0x8c82('0x78'),{'UserId':Number(_0x563bca[_0x8c82('0x39')][_0x8c82('0x73')]),'VoicePrefixId':Number(_0x563bca[_0x8c82('0x4e')]['id'])});}});}})[_0x8c82('0x2a')](respondWithStatusCode(_0xb69fb2,null))[_0x8c82('0x4d')](handleError(_0xb69fb2,null));};exports[_0x8c82('0x79')]=function(_0x2aa5ea,_0x87e8f3,_0x4d0f62){var _0x232075={};var _0x2fb114={};var _0x25f067;var _0x48848c;return db[_0x8c82('0x34')][_0x8c82('0x7a')]({'where':{'id':_0x2aa5ea[_0x8c82('0x4e')]['id']}})[_0x8c82('0x2a')](handleEntityNotFound(_0x87e8f3,null))[_0x8c82('0x2a')](function(_0x5211f9){if(_0x5211f9){_0x25f067=_0x5211f9;_0x2fb114[_0x8c82('0x38')]=_['keys'](db['User'][_0x8c82('0x35')]);_0x2fb114[_0x8c82('0x39')]=_[_0x8c82('0x3a')](_0x2aa5ea[_0x8c82('0x39')]);_0x2fb114[_0x8c82('0x3b')]=_['intersection'](_0x2fb114['model'],_0x2fb114[_0x8c82('0x39')]);_0x232075[_0x8c82('0x3d')]=_['intersection'](_0x2fb114[_0x8c82('0x38')],qs['fields'](_0x2aa5ea[_0x8c82('0x39')]['fields']));_0x232075[_0x8c82('0x3d')]=_0x232075[_0x8c82('0x3d')]['length']?_0x232075[_0x8c82('0x3d')]:_0x2fb114['model'];_0x232075[_0x8c82('0x41')]=qs[_0x8c82('0x42')](_0x2aa5ea[_0x8c82('0x39')][_0x8c82('0x42')]);_0x232075['where']=qs[_0x8c82('0x3b')](_[_0x8c82('0x44')](_0x2aa5ea[_0x8c82('0x39')],_0x2fb114[_0x8c82('0x3b')]));if(_0x2aa5ea[_0x8c82('0x39')][_0x8c82('0x45')]){_0x232075[_0x8c82('0x43')]=_['merge'](_0x232075[_0x8c82('0x43')],{'$or':_['map'](_0x232075['attributes'],function(_0x10bbaa){var _0x34cb94={};_0x34cb94[_0x10bbaa]={'$like':'%'+_0x2aa5ea['query'][_0x8c82('0x45')]+'%'};return _0x34cb94;})});}_0x232075=_['merge']({},_0x232075,_0x2aa5ea[_0x8c82('0x48')]);return _0x25f067[_0x8c82('0x79')](_0x232075);}})[_0x8c82('0x2a')](function(_0x15e50b){if(_0x15e50b){_0x48848c=_0x15e50b['length'];if(!_0x2aa5ea[_0x8c82('0x39')][_0x8c82('0x3f')](_0x8c82('0x40'))){_0x232075[_0x8c82('0x24')]=qs[_0x8c82('0x24')](_0x2aa5ea[_0x8c82('0x39')][_0x8c82('0x24')]);_0x232075[_0x8c82('0x23')]=qs[_0x8c82('0x23')](_0x2aa5ea[_0x8c82('0x39')][_0x8c82('0x23')]);}return _0x25f067['getAgents'](_0x232075);}})['then'](function(_0x38a24c){if(_0x38a24c){return _0x38a24c?{'count':_0x48848c,'rows':_0x38a24c}:null;}})[_0x8c82('0x2a')](respondWithResult(_0x87e8f3,null))[_0x8c82('0x4d')](handleError(_0x87e8f3,null));}; \ No newline at end of file +var _0x3cdd=['NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','destroy','get','VoicePrefixes','then','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','params','intersection','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','appdata'];(function(_0x4e4435,_0x2a53ea){var _0x4dd213=function(_0x26aa61){while(--_0x26aa61){_0x4e4435['push'](_0x4e4435['shift']());}};_0x4dd213(++_0x2a53ea);}(_0x3cdd,0x118));var _0xd3cd=function(_0xc3423a,_0x57ee22){_0xc3423a=_0xc3423a-0x0;var _0x575dca=_0x3cdd[_0xc3423a];return _0x575dca;};'use strict';var pdf=require(_0xd3cd('0x0'));var emlformat=require(_0xd3cd('0x1'));var rimraf=require(_0xd3cd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3cd('0x3'));var rp=require('request-promise');var moment=require(_0xd3cd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd3cd('0x5'));var util=require(_0xd3cd('0x6'));var path=require(_0xd3cd('0x7'));var sox=require(_0xd3cd('0x8'));var csv=require(_0xd3cd('0x9'));var ejs=require(_0xd3cd('0xa'));var fs=require('fs');var _=require(_0xd3cd('0xb'));var squel=require(_0xd3cd('0xc'));var crypto=require(_0xd3cd('0xd'));var jsforce=require(_0xd3cd('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd3cd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd3cd('0x10'));var qs=require(_0xd3cd('0x11'));var as=require(_0xd3cd('0x12'));var hardwareService=require(_0xd3cd('0x13'));var logger=require(_0xd3cd('0x14'))(_0xd3cd('0x15'));var utils=require(_0xd3cd('0x16'));var config=require(_0xd3cd('0x17'));var db=require('../../mysqldb')['db'];config[_0xd3cd('0x18')]=_['defaults'](config[_0xd3cd('0x18')],{'host':_0xd3cd('0x19'),'port':0x18eb});var socket=require(_0xd3cd('0x1a'))(new Redis(config[_0xd3cd('0x18')]));require(_0xd3cd('0x1b'))[_0xd3cd('0x1c')](socket);function respondWithStatusCode(_0x492c6c,_0x5d68ec){_0x5d68ec=_0x5d68ec||0xcc;return function(_0x2f6446){if(_0x2f6446){return _0x492c6c[_0xd3cd('0x1d')](_0x5d68ec);}return _0x492c6c[_0xd3cd('0x1e')](_0x5d68ec)[_0xd3cd('0x1f')]();};}function respondWithResult(_0x4266bf,_0x19d1ec){_0x19d1ec=_0x19d1ec||0xc8;return function(_0x289888){if(_0x289888){return _0x4266bf[_0xd3cd('0x1e')](_0x19d1ec)[_0xd3cd('0x20')](_0x289888);}};}function respondWithFilteredResult(_0x509d8e,_0x4a2333){return function(_0x304a27){if(_0x304a27){var _0xa24fc7=_0x304a27[_0xd3cd('0x21')],_0x5014c5=_0x4a2333[_0xd3cd('0x22')],_0x7adc19=_0x4a2333[_0xd3cd('0x22')]+_0x4a2333[_0xd3cd('0x23')],_0x5c76d0;if(_0x7adc19>=_0xa24fc7){_0x7adc19=_0xa24fc7;_0x5c76d0=0xc8;}else{_0x5c76d0=0xce;}_0x509d8e[_0xd3cd('0x1e')](_0x5c76d0);return _0x509d8e['set'](_0xd3cd('0x24'),_0x5014c5+'-'+_0x7adc19+'/'+_0xa24fc7)['json'](_0x304a27);}return null;};}function patchUpdates(_0x34face){return function(_0x5470fa){try{jsonpatch[_0xd3cd('0x25')](_0x5470fa,_0x34face,!![]);}catch(_0x4a4775){return BPromise['reject'](_0x4a4775);}return _0x5470fa['save']();};}function saveUpdates(_0x3d2420,_0x5d4b5e){return function(_0x104577){if(_0x104577){return _0x104577[_0xd3cd('0x26')](_0x3d2420)['then'](function(_0x6b4a6b){return _0x6b4a6b;});}return null;};}function removeEntity(_0x564a57,_0x2fd324){return function(_0x1d611c){if(_0x1d611c){return _0x1d611c[_0xd3cd('0x27')]()['then'](function(){var _0x237c3b=_0x1d611c[_0xd3cd('0x28')]({'plain':!![]});var _0x3811a0=_0xd3cd('0x29');return db['UserProfileResource'][_0xd3cd('0x27')]({'where':{'type':_0x3811a0,'resourceId':_0x237c3b['id']}})[_0xd3cd('0x2a')](function(){return _0x1d611c;});})[_0xd3cd('0x2a')](function(){_0x564a57['status'](0xcc)[_0xd3cd('0x1f')]();});}};}function handleEntityNotFound(_0x5e9604,_0x178002){return function(_0x41a007){if(!_0x41a007){_0x5e9604[_0xd3cd('0x1d')](0x194);}return _0x41a007;};}function handleError(_0x22bf97,_0x46bdcc){_0x46bdcc=_0x46bdcc||0x1f4;return function(_0x1c646e){logger[_0xd3cd('0x2b')](_0x1c646e[_0xd3cd('0x2c')]);if(_0x1c646e[_0xd3cd('0x2d')]){delete _0x1c646e[_0xd3cd('0x2d')];}_0x22bf97[_0xd3cd('0x1e')](_0x46bdcc)[_0xd3cd('0x2e')](_0x1c646e);};}exports[_0xd3cd('0x2f')]=function(_0x164c82,_0x4e6930){var _0x353ab7={},_0x116630={},_0x3e19b5={'count':0x0,'rows':[]};var _0x4b0d4b=_[_0xd3cd('0x30')](db['VoicePrefix'][_0xd3cd('0x31')],function(_0x2e85db){return{'name':_0x2e85db['fieldName'],'type':_0x2e85db[_0xd3cd('0x32')][_0xd3cd('0x33')]};});_0x116630['model']=_[_0xd3cd('0x30')](_0x4b0d4b,'name');_0x116630[_0xd3cd('0x34')]=_[_0xd3cd('0x35')](_0x164c82['query']);_0x116630[_0xd3cd('0x36')]=_['intersection'](_0x116630[_0xd3cd('0x37')],_0x116630[_0xd3cd('0x34')]);_0x353ab7[_0xd3cd('0x38')]=_['intersection'](_0x116630['model'],qs[_0xd3cd('0x39')](_0x164c82['query'][_0xd3cd('0x39')]));_0x353ab7[_0xd3cd('0x38')]=_0x353ab7['attributes'][_0xd3cd('0x3a')]?_0x353ab7['attributes']:_0x116630[_0xd3cd('0x37')];if(!_0x164c82[_0xd3cd('0x34')][_0xd3cd('0x3b')](_0xd3cd('0x3c'))){_0x353ab7[_0xd3cd('0x23')]=qs['limit'](_0x164c82[_0xd3cd('0x34')][_0xd3cd('0x23')]);_0x353ab7[_0xd3cd('0x22')]=qs[_0xd3cd('0x22')](_0x164c82[_0xd3cd('0x34')][_0xd3cd('0x22')]);}_0x353ab7['order']=qs[_0xd3cd('0x3d')](_0x164c82[_0xd3cd('0x34')][_0xd3cd('0x3d')]);_0x353ab7[_0xd3cd('0x3e')]=qs[_0xd3cd('0x36')](_[_0xd3cd('0x3f')](_0x164c82[_0xd3cd('0x34')],_0x116630[_0xd3cd('0x36')]));if(_0x164c82[_0xd3cd('0x34')][_0xd3cd('0x40')]){_0x353ab7['where']=_[_0xd3cd('0x41')](_0x353ab7['where'],{'$or':_[_0xd3cd('0x30')](_0x4b0d4b,function(_0x35cf00){if(_0x35cf00['type']!=='VIRTUAL'){var _0x251bef={};_0x251bef[_0x35cf00['name']]={'$like':'%'+_0x164c82[_0xd3cd('0x34')]['filter']+'%'};return _0x251bef;}})});}_0x353ab7=_['merge']({},_0x353ab7,_0x164c82[_0xd3cd('0x42')]);var _0x1ed760={'where':_0x353ab7[_0xd3cd('0x3e')]};return db[_0xd3cd('0x43')]['count'](_0x1ed760)[_0xd3cd('0x2a')](function(_0x6ffcb3){_0x3e19b5['count']=_0x6ffcb3;if(_0x164c82[_0xd3cd('0x34')][_0xd3cd('0x44')]){_0x353ab7[_0xd3cd('0x45')]=[{'all':!![]}];}return db[_0xd3cd('0x43')][_0xd3cd('0x46')](_0x353ab7);})[_0xd3cd('0x2a')](function(_0x1d7a46){_0x3e19b5[_0xd3cd('0x47')]=_0x1d7a46;return _0x3e19b5;})[_0xd3cd('0x2a')](respondWithFilteredResult(_0x4e6930,_0x353ab7))[_0xd3cd('0x48')](handleError(_0x4e6930,null));};exports[_0xd3cd('0x49')]=function(_0x2a2ca8,_0x282c88){var _0x1b3ec9={'raw':![],'where':{'id':_0x2a2ca8[_0xd3cd('0x4a')]['id']}},_0x46b888={};_0x46b888[_0xd3cd('0x37')]=_[_0xd3cd('0x35')](db[_0xd3cd('0x43')][_0xd3cd('0x31')]);_0x46b888[_0xd3cd('0x34')]=_[_0xd3cd('0x35')](_0x2a2ca8[_0xd3cd('0x34')]);_0x46b888[_0xd3cd('0x36')]=_[_0xd3cd('0x4b')](_0x46b888[_0xd3cd('0x37')],_0x46b888['query']);_0x1b3ec9[_0xd3cd('0x38')]=_[_0xd3cd('0x4b')](_0x46b888['model'],qs[_0xd3cd('0x39')](_0x2a2ca8[_0xd3cd('0x34')]['fields']));_0x1b3ec9[_0xd3cd('0x38')]=_0x1b3ec9[_0xd3cd('0x38')][_0xd3cd('0x3a')]?_0x1b3ec9[_0xd3cd('0x38')]:_0x46b888[_0xd3cd('0x37')];if(_0x2a2ca8[_0xd3cd('0x34')][_0xd3cd('0x44')]){_0x1b3ec9[_0xd3cd('0x45')]=[{'all':!![]}];}_0x1b3ec9=_[_0xd3cd('0x41')]({},_0x1b3ec9,_0x2a2ca8['options']);return db['VoicePrefix'][_0xd3cd('0x4c')](_0x1b3ec9)[_0xd3cd('0x2a')](handleEntityNotFound(_0x282c88,null))['then'](respondWithResult(_0x282c88,null))[_0xd3cd('0x48')](handleError(_0x282c88,null));};exports[_0xd3cd('0x27')]=function(_0x5f0eb5,_0x5007ba){return db['VoicePrefix']['find']({'where':{'id':_0x5f0eb5[_0xd3cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5007ba,null))[_0xd3cd('0x2a')](removeEntity(_0x5007ba,null))['catch'](handleError(_0x5007ba,null));};exports[_0xd3cd('0x4d')]=function(_0x10cf35,_0x42c99b){return db[_0xd3cd('0x43')]['describe']()[_0xd3cd('0x2a')](respondWithResult(_0x42c99b,null))['catch'](handleError(_0x42c99b,null));};exports[_0xd3cd('0x4e')]=function(_0x3f4539,_0x1de1ba){var _0x3ba752;return db[_0xd3cd('0x4f')][_0xd3cd('0x50')](function(_0x1d6c5b){return db['VoicePrefix'][_0xd3cd('0x4e')](_0x3f4539[_0xd3cd('0x51')],{'transaction':_0x1d6c5b})['then'](function(_0xb888c6){_0x3ba752=_0xb888c6[_0xd3cd('0x28')]({'plain':!![]});return db[_0xd3cd('0x52')][_0xd3cd('0x4c')]({'where':{'id':_0x3ba752[_0xd3cd('0x53')]},'raw':!![]})[_0xd3cd('0x2a')](function(_0x16f37e){return createVoicePrefixExtensions(_0x3ba752,_0x16f37e,_0x1d6c5b);});});})[_0xd3cd('0x2a')](function(){var _0xdad9f0=_0x3f4539[_0xd3cd('0x54')][_0xd3cd('0x28')]({'plain':!![]});if(!_0xdad9f0)throw new Error(_0xd3cd('0x55'));if(_0xdad9f0[_0xd3cd('0x56')]===_0xd3cd('0x54')){var _0x514a95=_0x3ba752;return db[_0xd3cd('0x57')][_0xd3cd('0x4c')]({'where':{'name':_0xd3cd('0x29'),'userProfileId':_0xdad9f0['userProfileId']},'raw':!![]})[_0xd3cd('0x2a')](function(_0x5662f5){if(_0x5662f5&&_0x5662f5[_0xd3cd('0x58')]===0x0){return db[_0xd3cd('0x59')]['create']({'name':_0x514a95[_0xd3cd('0x2d')],'resourceId':_0x514a95['id'],'type':_0x5662f5['name'],'sectionId':_0x5662f5['id']},{})[_0xd3cd('0x2a')](function(){return _0x3ba752;});}else{return _0x3ba752;}})['catch'](function(_0x32fbb0){logger['error'](_0xd3cd('0x5a'),_0x32fbb0);throw _0x32fbb0;});}return _0x3ba752;})[_0xd3cd('0x2a')](respondWithResult(_0x1de1ba,null))[_0xd3cd('0x48')](handleError(_0x1de1ba,null));};function Extension(_0xff7b89,_0x412bfa,_0x4bdc1a,_0x171d1f){this[_0xd3cd('0x5b')]=_0xd3cd('0x5c');this[_0xd3cd('0x5d')]=_0xff7b89;this[_0xd3cd('0x5e')]=_0x4bdc1a;this[_0xd3cd('0x32')]=_0xd3cd('0x5f');this['description']=_0xd3cd('0x60');this['priority']=_0x412bfa;this[_0xd3cd('0x61')]=_0x171d1f;}function createVoicePrefixExtensions(_0x99921,_0x754ed9,_0x1f84c2){return new BPromise(function(_0x223fc0,_0x185d2c){var _0x22057e=new Extension(formatPrefixName(_0x99921['prefix']),0x1,_0xd3cd('0x62'),_0xd3cd('0x63'));_0x22057e[_0xd3cd('0x64')]=_0x99921['id'];return db[_0xd3cd('0x52')][_0xd3cd('0x4e')](_0x22057e,{'transaction':_0x1f84c2})[_0xd3cd('0x2a')](function(_0x43f690){var _0x31f193=_0x43f690[_0xd3cd('0x28')]({'plain':!![]});var _0x188c64=_[_0xd3cd('0x30')](addVoicePrefixExtensions(_0x99921,_0x754ed9),function(_0x2ddbec){_0x2ddbec[_0xd3cd('0x53')]=_0x31f193['id'];_0x2ddbec[_0xd3cd('0x64')]=_0x99921['id'];return _0x2ddbec;});return db[_0xd3cd('0x52')]['bulkCreate'](_0x188c64,{'transaction':_0x1f84c2})[_0xd3cd('0x2a')](function(_0x276c6e){if(!_0x276c6e){return _0x185d2c(_0xd3cd('0x65'));}else{return _0x223fc0(_0x276c6e);}})['catch'](function(_0x12340b){return _0x185d2c(_0x12340b);});});;});};function addVoicePrefixExtensions(_0x2c38eb,_0x13a2bb){var _0x435f27=[];var _0x2c5566=formatPrefixName(_0x2c38eb[_0xd3cd('0x66')]);_0x435f27[_0xd3cd('0x67')](new Extension(_0x2c5566,0x2,_0xd3cd('0x68'),_0xd3cd('0x69')+_0x2c38eb[_0xd3cd('0x2d')]));if(_0x2c38eb[_0xd3cd('0x6a')]){_0x435f27[_0xd3cd('0x67')](new Extension(_0x2c5566,0x3,_0xd3cd('0x68'),_0xd3cd('0x6b')+_0x2c38eb[_0xd3cd('0x6a')]));}else{_0x435f27[_0xd3cd('0x67')](new Extension(_0x2c5566,0x3,_0xd3cd('0x62'),_0xd3cd('0x6c')));}_0x435f27[_0xd3cd('0x67')](new Extension(_0x2c5566,0x4,_0xd3cd('0x6d'),_0x13a2bb[_0xd3cd('0x5b')]+','+_0xd3cd('0x6e')+(0x8+_0x2c38eb[_0xd3cd('0x2d')][_0xd3cd('0x3a')])+'}'+','+0x1));return _0x435f27;}function formatPrefixName(_0xaeb2be){var _0x6eb486='_';for(var _0x166464=0x0;_0x166464<_0xaeb2be['length'];_0x166464++){if(_0xaeb2be[_0xd3cd('0x6f')](_0x166464)=='-'){_0x6eb486+=_0xaeb2be['charAt'](_0x166464);}else{_0x6eb486+='['+_0xaeb2be[_0xd3cd('0x6f')](_0x166464)+']';}}_0x6eb486+='.';return _0x6eb486;}exports[_0xd3cd('0x26')]=function(_0x4d22e3,_0x45cc42,_0x330d67){var _0x5e4f7b=_0x4d22e3[_0xd3cd('0x51')];_0x5e4f7b[_0xd3cd('0x66')]=_0xd3cd('0x70')+_0x5e4f7b['name']+'-';return db['sequelize'][_0xd3cd('0x50')](function(_0x531f15){return db[_0xd3cd('0x43')][_0xd3cd('0x26')](_0x5e4f7b,{'where':{'id':_0x5e4f7b['id']},'transaction':_0x531f15})[_0xd3cd('0x2a')](function(){return db[_0xd3cd('0x52')][_0xd3cd('0x27')]({'where':{'VoicePrefixId':_0x5e4f7b['id']},'transaction':_0x531f15})[_0xd3cd('0x2a')](function(){return db['VoiceExtension'][_0xd3cd('0x4c')]({'where':{'id':_0x5e4f7b['VoiceExtensionId']},'raw':!![]})['then'](function(_0x52ff9e){return createVoicePrefixExtensions(_0x5e4f7b,_0x52ff9e,_0x531f15);});});});})[_0xd3cd('0x2a')](function(){return db[_0xd3cd('0x43')][_0xd3cd('0x71')](_0x5e4f7b['id']);})['then'](respondWithResult(_0x45cc42,null))[_0xd3cd('0x48')](handleError(_0x45cc42,null));};exports[_0xd3cd('0x72')]=function(_0x34c46b,_0x411fca,_0x2bc58c){return db[_0xd3cd('0x43')][_0xd3cd('0x4c')]({'where':{'id':_0x34c46b[_0xd3cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x411fca,null))[_0xd3cd('0x2a')](function(_0x219d78){if(_0x219d78){return _0x219d78[_0xd3cd('0x72')](_0x34c46b[_0xd3cd('0x51')][_0xd3cd('0x73')],_['omit'](_0x34c46b[_0xd3cd('0x51')],[_0xd3cd('0x73'),'id'])||{})[_0xd3cd('0x74')](function(_0x13692b){for(var _0x52694c=0x0;_0x52694c<_0x34c46b[_0xd3cd('0x51')]['ids']['length'];_0x52694c+=0x1){socket[_0xd3cd('0x75')](_0xd3cd('0x76'),{'UserId':_0x34c46b['body'][_0xd3cd('0x73')][_0x52694c],'VoicePrefixId':_0x34c46b['params']['id']});}return _0x13692b;});}})['then'](respondWithResult(_0x411fca,null))[_0xd3cd('0x48')](handleError(_0x411fca,null));};exports[_0xd3cd('0x77')]=function(_0x23d9a0,_0x1e0b37,_0x25cd92){return db[_0xd3cd('0x43')][_0xd3cd('0x4c')]({'where':{'id':_0x23d9a0[_0xd3cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1e0b37,null))['then'](function(_0x239169){if(_0x239169){return _0x239169[_0xd3cd('0x77')](_0x23d9a0[_0xd3cd('0x34')][_0xd3cd('0x73')])[_0xd3cd('0x2a')](function(){if(_[_0xd3cd('0x78')](_0x23d9a0['query'][_0xd3cd('0x73')])){for(var _0x606558=0x0;_0x606558<_0x23d9a0['query'][_0xd3cd('0x73')][_0xd3cd('0x3a')];_0x606558+=0x1){socket['emit'](_0xd3cd('0x79'),{'UserId':Number(_0x23d9a0[_0xd3cd('0x34')][_0xd3cd('0x73')][_0x606558]),'VoicePrefixId':Number(_0x23d9a0[_0xd3cd('0x4a')]['id'])});}}else{socket[_0xd3cd('0x75')](_0xd3cd('0x79'),{'UserId':Number(_0x23d9a0[_0xd3cd('0x34')]['ids']),'VoicePrefixId':Number(_0x23d9a0[_0xd3cd('0x4a')]['id'])});}});}})[_0xd3cd('0x2a')](respondWithStatusCode(_0x1e0b37,null))[_0xd3cd('0x48')](handleError(_0x1e0b37,null));};exports[_0xd3cd('0x7a')]=function(_0x234cdc,_0x37f6d1,_0x127ed6){var _0x2bbb90={};var _0x381ef3={};var _0x253cfd;var _0x42cc54;return db['VoicePrefix'][_0xd3cd('0x7b')]({'where':{'id':_0x234cdc['params']['id']}})[_0xd3cd('0x2a')](handleEntityNotFound(_0x37f6d1,null))[_0xd3cd('0x2a')](function(_0x3f45f7){if(_0x3f45f7){_0x253cfd=_0x3f45f7;_0x381ef3[_0xd3cd('0x37')]=_[_0xd3cd('0x35')](db[_0xd3cd('0x7c')][_0xd3cd('0x31')]);_0x381ef3[_0xd3cd('0x34')]=_['keys'](_0x234cdc[_0xd3cd('0x34')]);_0x381ef3['filters']=_['intersection'](_0x381ef3[_0xd3cd('0x37')],_0x381ef3['query']);_0x2bbb90['attributes']=_['intersection'](_0x381ef3[_0xd3cd('0x37')],qs[_0xd3cd('0x39')](_0x234cdc[_0xd3cd('0x34')][_0xd3cd('0x39')]));_0x2bbb90['attributes']=_0x2bbb90['attributes']['length']?_0x2bbb90['attributes']:_0x381ef3[_0xd3cd('0x37')];_0x2bbb90[_0xd3cd('0x7d')]=qs[_0xd3cd('0x3d')](_0x234cdc[_0xd3cd('0x34')][_0xd3cd('0x3d')]);_0x2bbb90['where']=qs['filters'](_[_0xd3cd('0x3f')](_0x234cdc[_0xd3cd('0x34')],_0x381ef3[_0xd3cd('0x36')]));if(_0x234cdc['query']['filter']){_0x2bbb90['where']=_['merge'](_0x2bbb90[_0xd3cd('0x3e')],{'$or':_[_0xd3cd('0x30')](_0x2bbb90[_0xd3cd('0x38')],function(_0x3ea269){var _0x5396dd={};_0x5396dd[_0x3ea269]={'$like':'%'+_0x234cdc[_0xd3cd('0x34')]['filter']+'%'};return _0x5396dd;})});}_0x2bbb90=_[_0xd3cd('0x41')]({},_0x2bbb90,_0x234cdc[_0xd3cd('0x42')]);return _0x253cfd[_0xd3cd('0x7a')](_0x2bbb90);}})[_0xd3cd('0x2a')](function(_0x4b7f1f){if(_0x4b7f1f){_0x42cc54=_0x4b7f1f[_0xd3cd('0x3a')];if(!_0x234cdc[_0xd3cd('0x34')]['hasOwnProperty'](_0xd3cd('0x3c'))){_0x2bbb90[_0xd3cd('0x23')]=qs['limit'](_0x234cdc[_0xd3cd('0x34')][_0xd3cd('0x23')]);_0x2bbb90['offset']=qs['offset'](_0x234cdc[_0xd3cd('0x34')][_0xd3cd('0x22')]);}return _0x253cfd[_0xd3cd('0x7a')](_0x2bbb90);}})[_0xd3cd('0x2a')](function(_0x44a4ca){if(_0x44a4ca){return _0x44a4ca?{'count':_0x42cc54,'rows':_0x44a4ca}:null;}})[_0xd3cd('0x2a')](respondWithResult(_0x37f6d1,null))[_0xd3cd('0x48')](handleError(_0x37f6d1,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 3c05626..ab7cab8 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x15dc8b,_0x1fe622){var _0x22eca9=function(_0x431cf3){while(--_0x431cf3){_0x15dc8b['push'](_0x15dc8b['shift']());}};_0x22eca9(++_0x1fe622);}(_0x008c,0x188));var _0xc008=function(_0x1fbdd1,_0x17323f){_0x1fbdd1=_0x1fbdd1-0x0;var _0x3319a2=_0x008c[_0x1fbdd1];return _0x3319a2;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xcb91=['save','update','emit','hasOwnProperty','hook','VoicePrefix','setMaxListeners'];(function(_0x167d9a,_0x322325){var _0x18c6c2=function(_0x47b241){while(--_0x47b241){_0x167d9a['push'](_0x167d9a['shift']());}};_0x18c6c2(++_0x322325);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0xcb91[_0x2caaef];return _0xd011f8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x1cb9('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){VoicePrefixEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);VoicePrefixEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];VoicePrefix[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 3aaf564..9f3fdea 100644 --- a/server/api/voicePrefix/voicePrefix.model.js +++ b/server/api/voicePrefix/voicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8c2=['exports','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa8c2,0x1f2));var _0x2a8c=function(_0x2c31c6,_0xeab1d2){_0x2c31c6=_0x2c31c6-0x0;var _0x538b0b=_0xa8c2[_0x2c31c6];return _0x538b0b;};'use strict';var _=require('lodash');var util=require(_0x2a8c('0x0'));var logger=require(_0x2a8c('0x1'))(_0x2a8c('0x2'));var moment=require(_0x2a8c('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a8c('0x4'));var fs=require('fs');var path=require(_0x2a8c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x2a8c('0x6')]=function(_0x348461,_0x4afea2){return _0x348461['define'](_0x2a8c('0x7'),attributes,{'tableName':_0x2a8c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe0e=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','VoicePrefix','voice_prefixes','util'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xfe0e,0x18f));var _0xefe0=function(_0x16af01,_0x9c623c){_0x16af01=_0x16af01-0x0;var _0x4d4b9a=_0xfe0e[_0x16af01];return _0x4d4b9a;};'use strict';var _=require('lodash');var util=require(_0xefe0('0x0'));var logger=require(_0xefe0('0x1'))(_0xefe0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xefe0('0x3'));var fs=require('fs');var path=require(_0xefe0('0x4'));var rimraf=require(_0xefe0('0x5'));var config=require(_0xefe0('0x6'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x4da8e4,_0x3187b5){return _0x4da8e4[_0xefe0('0x7')](_0xefe0('0x8'),attributes,{'tableName':_0xefe0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index b6ea5b2..7222634 100644 --- a/server/api/voicePrefix/voicePrefix.rpc.js +++ b/server/api/voicePrefix/voicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe130=['client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xe130,0x18a));var _0x0e13=function(_0x481a6c,_0x39a197){_0x481a6c=_0x481a6c-0x0;var _0x1d5474=_0xe130[_0x481a6c];return _0x1d5474;};'use strict';var _=require('lodash');var util=require(_0x0e13('0x0'));var moment=require('moment');var BPromise=require(_0x0e13('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e13('0x2'));var logger=require(_0x0e13('0x3'))('rpc');var config=require(_0x0e13('0x4'));var jayson=require(_0x0e13('0x5'));var client=jayson[_0x0e13('0x6')][_0x0e13('0x7')]({'port':0x232a});config[_0x0e13('0x8')]=_[_0x0e13('0x9')](config[_0x0e13('0x8')],{'host':_0x0e13('0xa'),'port':0x18eb});var socket=require(_0x0e13('0xb'))(new Redis(config['redis']));require(_0x0e13('0xc'))[_0x0e13('0xd')](socket);function respondWithRpcPromise(_0x5eee71,_0x5da2f6,_0x54fdd8){return new BPromise(function(_0x18b8a9,_0x4d821d){return client[_0x0e13('0xe')](_0x5eee71,_0x54fdd8)['then'](function(_0x20c3d3){logger[_0x0e13('0xf')](_0x0e13('0x10'),_0x5da2f6,'request\x20sent');logger[_0x0e13('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5da2f6,_0x0e13('0x12'),JSON[_0x0e13('0x13')](_0x20c3d3));if(_0x20c3d3[_0x0e13('0x14')]){if(_0x20c3d3[_0x0e13('0x14')][_0x0e13('0x15')]===0x1f4){logger[_0x0e13('0x14')](_0x0e13('0x10'),_0x5da2f6,_0x20c3d3[_0x0e13('0x14')]['message']);return _0x4d821d(_0x20c3d3['error'][_0x0e13('0x16')]);}logger[_0x0e13('0x14')](_0x0e13('0x10'),_0x5da2f6,_0x20c3d3[_0x0e13('0x14')][_0x0e13('0x16')]);return _0x18b8a9(_0x20c3d3[_0x0e13('0x14')][_0x0e13('0x16')]);}else{logger[_0x0e13('0xf')](_0x0e13('0x10'),_0x5da2f6,'request\x20sent');_0x18b8a9(_0x20c3d3[_0x0e13('0x17')][_0x0e13('0x16')]);}})[_0x0e13('0x18')](function(_0x171f8a){logger[_0x0e13('0x14')](_0x0e13('0x10'),_0x5da2f6,_0x171f8a);_0x4d821d(_0x171f8a);});});} \ No newline at end of file +var _0xe91b=['util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x263fa9,_0x5d3c80){var _0x3b12ec=function(_0x4e4ef2){while(--_0x4e4ef2){_0x263fa9['push'](_0x263fa9['shift']());}};_0x3b12ec(++_0x5d3c80);}(_0xe91b,0x15b));var _0xbe91=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xe91b[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0xbe91('0x0'));var util=require(_0xbe91('0x1'));var moment=require(_0xbe91('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe91('0x4'))(_0xbe91('0x5'));var config=require(_0xbe91('0x6'));var jayson=require(_0xbe91('0x7'));var client=jayson[_0xbe91('0x8')][_0xbe91('0x9')]({'port':0x232a});config[_0xbe91('0xa')]=_[_0xbe91('0xb')](config[_0xbe91('0xa')],{'host':_0xbe91('0xc'),'port':0x18eb});var socket=require(_0xbe91('0xd'))(new Redis(config[_0xbe91('0xa')]));require(_0xbe91('0xe'))[_0xbe91('0xf')](socket);function respondWithRpcPromise(_0x2040cc,_0x2f96f0,_0x3c9007){return new BPromise(function(_0x45eb74,_0x302f3d){return client[_0xbe91('0x10')](_0x2040cc,_0x3c9007)[_0xbe91('0x11')](function(_0x25c724){logger['info'](_0xbe91('0x12'),_0x2f96f0,_0xbe91('0x13'));logger[_0xbe91('0x14')](_0xbe91('0x15'),_0x2f96f0,'request\x20sent',JSON[_0xbe91('0x16')](_0x25c724));if(_0x25c724['error']){if(_0x25c724[_0xbe91('0x17')][_0xbe91('0x18')]===0x1f4){logger[_0xbe91('0x17')](_0xbe91('0x12'),_0x2f96f0,_0x25c724[_0xbe91('0x17')][_0xbe91('0x19')]);return _0x302f3d(_0x25c724[_0xbe91('0x17')][_0xbe91('0x19')]);}logger[_0xbe91('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x2f96f0,_0x25c724['error'][_0xbe91('0x19')]);return _0x45eb74(_0x25c724['error'][_0xbe91('0x19')]);}else{logger[_0xbe91('0x1a')](_0xbe91('0x12'),_0x2f96f0,_0xbe91('0x13'));_0x45eb74(_0x25c724[_0xbe91('0x1b')][_0xbe91('0x19')]);}})[_0xbe91('0x1c')](function(_0x1326c1){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x2f96f0,_0x1326c1);_0x302f3d(_0x1326c1);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 993142a..a0257d0 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0775=['update','length','voicePrefix:','save','remove'];(function(_0x18bc18,_0x363086){var _0x10c0f6=function(_0x7b260){while(--_0x7b260){_0x18bc18['push'](_0x18bc18['shift']());}};_0x10c0f6(++_0x363086);}(_0x0775,0x14d));var _0x5077=function(_0xc8f160,_0x251c85){_0xc8f160=_0xc8f160-0x0;var _0x550f88=_0x0775[_0xc8f160];return _0x550f88;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x5077('0x0'),_0x5077('0x1'),_0x5077('0x2')];function createListener(_0x440a63,_0x65bee2){return function(_0x24c46c){_0x65bee2['emit'](_0x440a63,_0x24c46c);};}function removeListener(_0x12adf8,_0x4dec99){return function(){VoicePrefixEvents['removeListener'](_0x12adf8,_0x4dec99);};}exports['register']=function(_0xd1480f){for(var _0xe6f99b=0x0,_0x2648f4=events[_0x5077('0x3')];_0xe6f99b<_0x2648f4;_0xe6f99b++){var _0x5c5301=events[_0xe6f99b];var _0xef84f7=createListener(_0x5077('0x4')+_0x5c5301,_0xd1480f);VoicePrefixEvents['on'](_0x5c5301,_0xef84f7);}}; \ No newline at end of file +var _0xb12b=['remove','update','emit','register','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb12b,0x196));var _0xbb12=function(_0x41810b,_0x41571a){_0x41810b=_0x41810b-0x0;var _0x273cec=_0xb12b[_0x41810b];return _0x273cec;};'use strict';var VoicePrefixEvents=require(_0xbb12('0x0'));var events=[_0xbb12('0x1'),_0xbb12('0x2'),_0xbb12('0x3')];function createListener(_0x2b12c4,_0x3631ed){return function(_0xbad8dd){_0x3631ed[_0xbb12('0x4')](_0x2b12c4,_0xbad8dd);};}function removeListener(_0x514e2d,_0x508274){return function(){VoicePrefixEvents['removeListener'](_0x514e2d,_0x508274);};}exports[_0xbb12('0x5')]=function(_0x3d0c2a){for(var _0x3c1e47=0x0,_0x278165=events[_0xbb12('0x6')];_0x3c1e47<_0x278165;_0x3c1e47++){var _0x5b2797=events[_0x3c1e47];var _0x573a0f=createListener(_0xbb12('0x7')+_0x5b2797,_0x3d0c2a);VoicePrefixEvents['on'](_0x5b2797,_0x573a0f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index a4b4405..4b74989 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bf9=['get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','put','delete','destroy','removeTeams','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./voiceQueue.controller'];(function(_0x33396b,_0x38e90c){var _0x24ca65=function(_0x2b54cd){while(--_0x2b54cd){_0x33396b['push'](_0x33396b['shift']());}};_0x24ca65(++_0x38e90c);}(_0x9bf9,0x89));var _0x99bf=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x9bf9[_0xf48cce];return _0x2a5c38;};'use strict';var multer=require(_0x99bf('0x0'));var util=require(_0x99bf('0x1'));var path=require('path');var timeout=require(_0x99bf('0x2'));var express=require(_0x99bf('0x3'));var router=express[_0x99bf('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x99bf('0x5'));var config=require('../../config/environment');var controller=require(_0x99bf('0x6'));router[_0x99bf('0x7')]('/',auth[_0x99bf('0x8')](),controller[_0x99bf('0x9')]);router[_0x99bf('0x7')](_0x99bf('0xa'),auth[_0x99bf('0x8')](),controller['show']);router[_0x99bf('0x7')](_0x99bf('0xb'),auth[_0x99bf('0x8')](),controller[_0x99bf('0xc')]);router[_0x99bf('0x7')]('/:id/hopper_histories',auth[_0x99bf('0x8')](),controller[_0x99bf('0xd')]);router[_0x99bf('0x7')]('/:id/hopper_finals',auth[_0x99bf('0x8')](),controller[_0x99bf('0xe')]);router[_0x99bf('0x7')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x99bf('0xf')]);router[_0x99bf('0x7')](_0x99bf('0x10'),auth['isAuthenticated'](),controller[_0x99bf('0x11')]);router[_0x99bf('0x7')](_0x99bf('0x12'),auth[_0x99bf('0x8')](),controller[_0x99bf('0x13')]);router[_0x99bf('0x7')]('/:id/members',auth[_0x99bf('0x8')](),controller['getMembers']);router[_0x99bf('0x7')](_0x99bf('0x14'),auth[_0x99bf('0x8')](),controller['getLists']);router[_0x99bf('0x7')](_0x99bf('0x15'),auth[_0x99bf('0x8')](),controller[_0x99bf('0x16')]);router[_0x99bf('0x17')]('/',auth[_0x99bf('0x8')](),controller['create']);router['post'](_0x99bf('0x18'),auth[_0x99bf('0x8')](),controller[_0x99bf('0x19')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x99bf('0x1a')]);router[_0x99bf('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x99bf('0x1b')]);router[_0x99bf('0x17')]('/:id/lists',auth[_0x99bf('0x8')](),controller[_0x99bf('0x1c')]);router['post'](_0x99bf('0x15'),auth[_0x99bf('0x8')](),controller[_0x99bf('0x1d')]);router[_0x99bf('0x1e')](_0x99bf('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x99bf('0x1f')](_0x99bf('0xa'),auth[_0x99bf('0x8')](),controller[_0x99bf('0x20')]);router[_0x99bf('0x1f')]('/:id/teams',auth[_0x99bf('0x8')](),controller[_0x99bf('0x21')]);router[_0x99bf('0x1f')](_0x99bf('0x12'),auth[_0x99bf('0x8')](),controller['removeAgents']);router['delete']('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0x99bf('0x15'),auth[_0x99bf('0x8')](),controller[_0x99bf('0x22')]);module[_0x99bf('0x23')]=router; \ No newline at end of file +var _0xdaed=['create','/:id/clone','clone','/:id/teams','addAgents','/:id/lists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/users','/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','post'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xdaed,0x13c));var _0xddae=function(_0x4795bc,_0x4a5f81){_0x4795bc=_0x4795bc-0x0;var _0x52a5a1=_0xdaed[_0x4795bc];return _0x52a5a1;};'use strict';var multer=require(_0xddae('0x0'));var util=require(_0xddae('0x1'));var path=require(_0xddae('0x2'));var timeout=require(_0xddae('0x3'));var express=require(_0xddae('0x4'));var router=express['Router']();var auth=require(_0xddae('0x5'));var interaction=require(_0xddae('0x6'));var config=require(_0xddae('0x7'));var controller=require(_0xddae('0x8'));router[_0xddae('0x9')]('/',auth['isAuthenticated'](),controller[_0xddae('0xa')]);router['get'](_0xddae('0xb'),auth[_0xddae('0xc')](),controller[_0xddae('0xd')]);router['get'](_0xddae('0xe'),auth['isAuthenticated'](),controller[_0xddae('0xf')]);router[_0xddae('0x9')](_0xddae('0x10'),auth[_0xddae('0xc')](),controller[_0xddae('0x11')]);router[_0xddae('0x9')](_0xddae('0x12'),auth[_0xddae('0xc')](),controller['getHopperFinals']);router['get'](_0xddae('0x13'),auth[_0xddae('0xc')](),controller[_0xddae('0x14')]);router[_0xddae('0x9')]('/:id/teams',auth[_0xddae('0xc')](),controller['getTeams']);router[_0xddae('0x9')](_0xddae('0x15'),auth['isAuthenticated'](),controller['getAgents']);router[_0xddae('0x9')](_0xddae('0x16'),auth[_0xddae('0xc')](),controller[_0xddae('0x17')]);router[_0xddae('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0xddae('0x18')]);router[_0xddae('0x9')](_0xddae('0x19'),auth[_0xddae('0xc')](),controller[_0xddae('0x1a')]);router[_0xddae('0x1b')]('/',auth[_0xddae('0xc')](),controller[_0xddae('0x1c')]);router[_0xddae('0x1b')](_0xddae('0x1d'),auth[_0xddae('0xc')](),controller[_0xddae('0x1e')]);router['post'](_0xddae('0x1f'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xddae('0x15'),auth['isAuthenticated'](),controller[_0xddae('0x20')]);router[_0xddae('0x1b')](_0xddae('0x21'),auth[_0xddae('0xc')](),controller['addLists']);router[_0xddae('0x1b')](_0xddae('0x19'),auth[_0xddae('0xc')](),controller['addBlackLists']);router[_0xddae('0x22')]('/:id',auth[_0xddae('0xc')](),controller[_0xddae('0x23')]);router[_0xddae('0x24')]('/:id',auth[_0xddae('0xc')](),controller[_0xddae('0x25')]);router['delete']('/:id/teams',auth[_0xddae('0xc')](),controller[_0xddae('0x26')]);router['delete'](_0xddae('0x15'),auth['isAuthenticated'](),controller[_0xddae('0x27')]);router[_0xddae('0x24')](_0xddae('0x21'),auth[_0xddae('0xc')](),controller[_0xddae('0x28')]);router[_0xddae('0x24')](_0xddae('0x19'),auth[_0xddae('0xc')](),controller[_0xddae('0x29')]);module[_0xddae('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index d619e1c..444aa5c 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a52=['BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','rrmemory','type','dialMethod','getDataValue','strategy','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','TEXT','periodic_announce','split','join','joinempty','leavewhenempty'];(function(_0x67eba5,_0x27a5e7){var _0x3aae33=function(_0x5e9a53){while(--_0x5e9a53){_0x67eba5['push'](_0x67eba5['shift']());}};_0x3aae33(++_0x27a5e7);}(_0x4a52,0xc8));var _0x24a5=function(_0x1fdd3e,_0x22735b){_0x1fdd3e=_0x1fdd3e-0x0;var _0x2da065=_0x4a52[_0x1fdd3e];return _0x2da065;};'use strict';var Sequelize=require(_0x24a5('0x0'));module[_0x24a5('0x1')]={'name':{'type':Sequelize[_0x24a5('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x4'),_0x24a5('0x5')),'allowNull':![],'defaultValue':_0x24a5('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x24a5('0x6')},'announce':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x24a5('0x3')]('rr',_0x24a5('0x7'),_0x24a5('0x8'),_0x24a5('0x9'),_0x24a5('0xa'),'rrmemory',_0x24a5('0xb'),_0x24a5('0xc'),_0x24a5('0xd')),'allowNull':![],'defaultValue':_0x24a5('0x7'),'set':function(_0xc588ed){this[_0x24a5('0xe')]('strategy',_0xc588ed?_0xc588ed:_0x24a5('0xf'));},'get':function(){var _0x3b5185=this['getDataValue'](_0x24a5('0x10'));var _0x74bbb3=this['getDataValue'](_0x24a5('0x11'));var _0xee79ad=this[_0x24a5('0x12')](_0x24a5('0x13'));if(_0x3b5185===_0x24a5('0x4')){return _0xee79ad;}if(_0x74bbb3===_0x24a5('0x14')&&_0xee79ad===_0x24a5('0xf')||_0x74bbb3==='booked'&&_0xee79ad===_0x24a5('0x15')){return _0xee79ad;}if(_0x74bbb3===_0x24a5('0x16')||_0x74bbb3===_0x24a5('0x17')||_0x74bbb3===_0x24a5('0x18')){return _0xee79ad;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x24a5('0x19')](0xb)},'timeout':{'type':Sequelize[_0x24a5('0x19')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x24a5('0x19')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x24a5('0x2')]},'weight':{'type':Sequelize[_0x24a5('0x19')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x24a5('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x24a5('0x1a'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no',_0x24a5('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x24a5('0x19')](0xb)},'autopausebusy':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x24a5('0x19')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x24a5('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x24a5('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x24a5('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x24a5('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x24a5('0x19')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x24a5('0x1a'),'no'),'defaultValue':_0x24a5('0x1a')},'announce_holdtime':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x24a5('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x24a5('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x24a5('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x24a5('0x2')]},'queue_quantity2':{'type':Sequelize[_0x24a5('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x24a5('0x2')]},'periodic_announce':{'type':Sequelize[_0x24a5('0x1c')],'set':function(_0x169832){this[_0x24a5('0xe')](_0x24a5('0x1d'),_0x169832?_0x169832['join'](','):[]);},'get':function(){return this[_0x24a5('0x12')](_0x24a5('0x1d'))?this[_0x24a5('0x12')]('periodic_announce')[_0x24a5('0x1e')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x24a5('0x1a'),'set':function(_0x48b66c){this[_0x24a5('0xe')]('joinempty',_0x48b66c?_0x48b66c[_0x24a5('0x1f')](','):[]);},'get':function(){return this[_0x24a5('0x12')](_0x24a5('0x20'))?this[_0x24a5('0x12')](_0x24a5('0x20'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':'no','set':function(_0x1d3458){this[_0x24a5('0xe')](_0x24a5('0x21'),_0x1d3458?_0x1d3458[_0x24a5('0x1f')](','):[]);},'get':function(){return this['getDataValue'](_0x24a5('0x21'))?this[_0x24a5('0x12')](_0x24a5('0x21'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x24a5('0x19')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x24a5('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x24a5('0x22')],'defaultValue':0x0,'set':function(_0x2aaf3e){this[_0x24a5('0xe')](_0x24a5('0x23'),_0x2aaf3e);if(_0x2aaf3e){if(this[_0x24a5('0x12')]('wrapuptime')<0x2){this[_0x24a5('0xe')](_0x24a5('0x24'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x24a5('0x22')],'defaultValue':0x0,'comment':_0x24a5('0x25')},'dialMethod':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x26'),_0x24a5('0x16'),'power',_0x24a5('0x17'),_0x24a5('0x14')),'defaultValue':_0x24a5('0x16'),'comment':_0x24a5('0x27')},'dialLimitChannel':{'type':Sequelize[_0x24a5('0x19')](0x4)[_0x24a5('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x24a5('0x29')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x24a5('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x24a5('0x2a')},'dialPowerLevel':{'type':Sequelize[_0x24a5('0x2b')](0x2)[_0x24a5('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x24a5('0x2c')},'dialPredictiveOptimization':{'type':Sequelize[_0x24a5('0x3')]('agentBusyFactor',_0x24a5('0x2d')),'defaultValue':'dropRate','comment':_0x24a5('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x24a5('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x24a5('0x2f')},'dialPredictiveInterval':{'type':Sequelize[_0x24a5('0x19')](0x3)[_0x24a5('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x24a5('0x30')},'dialOriginateCallerIdName':{'type':Sequelize[_0x24a5('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x24a5('0x19')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x24a5('0x31')},'dialQueueOptions':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':_0x24a5('0x32'),'comment':_0x24a5('0x33')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x24a5('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x24a5('0x34')},'dialQueueProject':{'type':Sequelize[_0x24a5('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x24a5('0x19')](0x3)[_0x24a5('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x24a5('0x35')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x24a5('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x24a5('0x36')},'dialBusyMaxRetry':{'type':Sequelize[_0x24a5('0x19')](0x3)[_0x24a5('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x24a5('0x37')},'dialBusyRetryFrequency':{'type':Sequelize[_0x24a5('0x19')](0x5)[_0x24a5('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x24a5('0x38')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x24a5('0x19')](0x3)[_0x24a5('0x28')],'defaultValue':0x3,'comment':_0x24a5('0x39')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x24a5('0x19')](0x5)[_0x24a5('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x24a5('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x24a5('0x3a')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x24a5('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x24a5('0x3b'),_0x24a5('0x3c'),'onlyIfOpen'),'defaultValue':_0x24a5('0x3b')},'dialAMDActive':{'type':Sequelize[_0x24a5('0x22')],'defaultValue':0x0,'comment':_0x24a5('0x3d')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x24a5('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x24a5('0x3e')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x24a5('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x24a5('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x24a5('0x19')](0x9)[_0x24a5('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x24a5('0x41')},'dialAMDMinWordLength':{'type':Sequelize[_0x24a5('0x19')](0x9)[_0x24a5('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x24a5('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x24a5('0x19')](0x9)[_0x24a5('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x24a5('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x24a5('0x19')](0x5)[_0x24a5('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x24a5('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x24a5('0x19')](0x9)[_0x24a5('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x24a5('0x44')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x24a5('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x24a5('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x24a5('0x3')](_0x24a5('0x46'),_0x24a5('0x47')),'defaultValue':_0x24a5('0x46')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x24a5('0x48')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x24a5('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x24a5('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x24a5('0x19')](0x3)[_0x24a5('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x24a5('0x49')},'dialCutDigit':{'type':Sequelize[_0x24a5('0x19')](0x3)[_0x24a5('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x24a5('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x24a5('0x19')],'allowNull':!![],'comment':_0x24a5('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x24a5('0x22')],'defaultValue':![],'comment':_0x24a5('0x4c'),'set':function(_0x1081a1){if(!_0x1081a1)this[_0x24a5('0xe')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x24a5('0x4d'),_0x1081a1);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x24a5('0x19')](0x3)[_0x24a5('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x24a5('0x19')](0x3)[_0x24a5('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x8d74=['https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','default','ringall','fewestcalls','random','rrmemory','rrordered','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','setDataValue','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX'];(function(_0x885f2d,_0x5c0945){var _0xe49b0b=function(_0xfb8cea){while(--_0xfb8cea){_0x885f2d['push'](_0x885f2d['shift']());}};_0xe49b0b(++_0x5c0945);}(_0x8d74,0x1eb));var _0x48d7=function(_0x29db8a,_0x53356a){_0x29db8a=_0x29db8a-0x0;var _0x4b5cbb=_0x8d74[_0x29db8a];return _0x4b5cbb;};'use strict';var Sequelize=require(_0x48d7('0x0'));module[_0x48d7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x48d7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x4'),_0x48d7('0x5')),'allowNull':![],'defaultValue':_0x48d7('0x4')},'musiconhold':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':_0x48d7('0x7')},'announce':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x48d7('0x3')]('rr',_0x48d7('0x8'),'leastrecent',_0x48d7('0x9'),_0x48d7('0xa'),_0x48d7('0xb'),'linear','wrandom',_0x48d7('0xc')),'allowNull':![],'defaultValue':_0x48d7('0x8'),'set':function(_0x23f168){this['setDataValue'](_0x48d7('0xd'),_0x23f168?_0x23f168:'rrmemory');},'get':function(){var _0x419d07=this[_0x48d7('0xe')](_0x48d7('0xf'));var _0x1acca8=this[_0x48d7('0xe')](_0x48d7('0x10'));var _0x3f8692=this[_0x48d7('0xe')](_0x48d7('0xd'));if(_0x419d07===_0x48d7('0x4')){return _0x3f8692;}if(_0x1acca8==='booked'&&_0x3f8692===_0x48d7('0xb')||_0x1acca8===_0x48d7('0x11')&&_0x3f8692===_0x48d7('0x12')){return _0x3f8692;}if(_0x1acca8===_0x48d7('0x13')||_0x1acca8===_0x48d7('0x14')||_0x1acca8===_0x48d7('0x15')){return _0x3f8692;}return null;}},'servicelevel':{'type':Sequelize[_0x48d7('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x48d7('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x48d7('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x48d7('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x48d7('0x17')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x48d7('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x48d7('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x48d7('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x48d7('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x48d7('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x48d7('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x48d7('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x48d7('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x48d7('0x17'),'no'),'defaultValue':_0x48d7('0x17')},'announce_holdtime':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x17'),'no',_0x48d7('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x48d7('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x48d7('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x48d7('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x48d7('0x6')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x48d7('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x48d7('0x6')]},'queue_less_than':{'type':Sequelize[_0x48d7('0x6')]},'periodic_announce':{'type':Sequelize[_0x48d7('0x1a')],'set':function(_0x3c6bbb){this['setDataValue'](_0x48d7('0x1b'),_0x3c6bbb?_0x3c6bbb['join'](','):[]);},'get':function(){return this[_0x48d7('0xe')]('periodic_announce')?this[_0x48d7('0xe')](_0x48d7('0x1b'))[_0x48d7('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':_0x48d7('0x17'),'set':function(_0x53bee6){this[_0x48d7('0x1d')]('joinempty',_0x53bee6?_0x53bee6[_0x48d7('0x1e')](','):[]);},'get':function(){return this[_0x48d7('0xe')]('joinempty')?this['getDataValue'](_0x48d7('0x1f'))[_0x48d7('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5ae22e){this[_0x48d7('0x1d')](_0x48d7('0x20'),_0x5ae22e?_0x5ae22e[_0x48d7('0x1e')](','):[]);},'get':function(){return this[_0x48d7('0xe')](_0x48d7('0x20'))?this[_0x48d7('0xe')](_0x48d7('0x20'))[_0x48d7('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x48d7('0x21')],'defaultValue':0x0,'set':function(_0x306087){this[_0x48d7('0x1d')](_0x48d7('0x22'),_0x306087);if(_0x306087){if(this[_0x48d7('0xe')](_0x48d7('0x23'))<0x2){this[_0x48d7('0x1d')](_0x48d7('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x48d7('0x21')],'defaultValue':0x0,'comment':_0x48d7('0x24')},'dialMethod':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x25'),'progressive','power',_0x48d7('0x14'),_0x48d7('0x11')),'defaultValue':_0x48d7('0x13'),'comment':_0x48d7('0x26')},'dialLimitChannel':{'type':Sequelize[_0x48d7('0x16')](0x4)[_0x48d7('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x48d7('0x16')](0x4)[_0x48d7('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x48d7('0x28')},'dialPowerLevel':{'type':Sequelize[_0x48d7('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x48d7('0x2a')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x48d7('0x2b')),'defaultValue':_0x48d7('0x2b'),'comment':_0x48d7('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x48d7('0x29')](0x2)[_0x48d7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x48d7('0x16')](0x3)[_0x48d7('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x48d7('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x48d7('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x48d7('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0x48d7('0x16')](0x3)[_0x48d7('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48d7('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':_0x48d7('0x2f'),'comment':_0x48d7('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x48d7('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48d7('0x31')},'dialQueueProject':{'type':Sequelize[_0x48d7('0x6')],'comment':_0x48d7('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x48d7('0x16')](0x3)[_0x48d7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48d7('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x48d7('0x16')](0x5)[_0x48d7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48d7('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x48d7('0x16')](0x3)[_0x48d7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48d7('0x35')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x48d7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48d7('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x48d7('0x16')](0x3)[_0x48d7('0x27')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x48d7('0x16')](0x5)[_0x48d7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48d7('0x37')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x48d7('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x48d7('0x38')},'dialTimezone':{'type':Sequelize[_0x48d7('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x48d7('0x39')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x48d7('0x3')](_0x48d7('0x3a'),_0x48d7('0x3b'),_0x48d7('0x3c')),'defaultValue':_0x48d7('0x3a')},'dialAMDActive':{'type':Sequelize[_0x48d7('0x21')],'defaultValue':0x0,'comment':_0x48d7('0x3d')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x48d7('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x48d7('0x16')](0x9)[_0x48d7('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x48d7('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x48d7('0x16')](0x9)[_0x48d7('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x48d7('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x48d7('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x48d7('0x40')},'dialAMDMinWordLength':{'type':Sequelize[_0x48d7('0x16')](0x9)[_0x48d7('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x48d7('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x48d7('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x48d7('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x48d7('0x16')](0x9)[_0x48d7('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x48d7('0x16')](0x5)[_0x48d7('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x48d7('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x48d7('0x16')](0x9)[_0x48d7('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x48d7('0x16')](0x5)[_0x48d7('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x48d7('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x48d7('0x21')],'defaultValue':0x0,'comment':_0x48d7('0x45')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x48d7('0x46'),_0x48d7('0x47')),'defaultValue':_0x48d7('0x46')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x48d7('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x48d7('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x48d7('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x48d7('0x48')},'dialCutDigit':{'type':Sequelize[_0x48d7('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x48d7('0x16')],'allowNull':!![],'comment':_0x48d7('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x48d7('0x4a'),'set':function(_0x1fc68b){if(!_0x1fc68b)this[_0x48d7('0x1d')](_0x48d7('0x4b'),null);this[_0x48d7('0x1d')](_0x48d7('0x4c'),_0x1fc68b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x48d7('0x16')](0x3)[_0x48d7('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x48d7('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index ace02e0..5f49dc3 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd00c=['QueryTypes','every','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','online','UserVoiceQueueRt','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','fromQuery','phone\x20IS\x20NOT\x20NULL','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','type','UserProfileResource','end','sendStatus','error','name','send','VoiceQueue','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','count','include','findAll','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','clone','includeAll','omit','updatedAt','createdAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','CmHopper','hasOwnProperty','order','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','voicePause','interface','flatMap','Agents','forEach','penalty','UserVoiceQueue','findOrCreate','each','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','sequelize'];(function(_0x4a16f6,_0x5f55fb){var _0x4a7a36=function(_0x2d4919){while(--_0x2d4919){_0x4a16f6['push'](_0x4a16f6['shift']());}};_0x4a7a36(++_0x5f55fb);}(_0xd00c,0x195));var _0xcd00=function(_0x3a3df7,_0x2575c1){_0x3a3df7=_0x3a3df7-0x0;var _0x36e5b0=_0xd00c[_0x3a3df7];return _0x36e5b0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xcd00('0x0'));var zipdir=require(_0xcd00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcd00('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcd00('0x3'));var util=require(_0xcd00('0x4'));var path=require(_0xcd00('0x5'));var sox=require(_0xcd00('0x6'));var csv=require('to-csv');var ejs=require(_0xcd00('0x7'));var fs=require('fs');var _=require(_0xcd00('0x8'));var squel=require(_0xcd00('0x9'));var crypto=require(_0xcd00('0xa'));var jsforce=require(_0xcd00('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcd00('0xc'));var querystring=require(_0xcd00('0xd'));var Papa=require(_0xcd00('0xe'));var Redis=require(_0xcd00('0xf'));var authService=require(_0xcd00('0x10'));var qs=require(_0xcd00('0x11'));var as=require(_0xcd00('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcd00('0x13'));var config=require(_0xcd00('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcd00('0x15')](config[_0xcd00('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd00('0x17'))(new Redis(config[_0xcd00('0x16')]));require(_0xcd00('0x18'))[_0xcd00('0x19')](socket);function respondWithStatusCode(_0x34d40e,_0x150dab){_0x150dab=_0x150dab||0xcc;return function(_0x41066a){if(_0x41066a){return _0x34d40e['sendStatus'](_0x150dab);}return _0x34d40e[_0xcd00('0x1a')](_0x150dab)['end']();};}function respondWithResult(_0x5abd40,_0x223430){_0x223430=_0x223430||0xc8;return function(_0x3f7a5a){if(_0x3f7a5a){return _0x5abd40[_0xcd00('0x1a')](_0x223430)[_0xcd00('0x1b')](_0x3f7a5a);}};}function respondWithFilteredResult(_0x1a0fd5,_0x3e4a3d){return function(_0x28cc3){if(_0x28cc3){var _0x4572e0=_0x28cc3['count'],_0x29368a=_0x3e4a3d[_0xcd00('0x1c')],_0x2572e2=_0x3e4a3d[_0xcd00('0x1c')]+_0x3e4a3d[_0xcd00('0x1d')],_0xd6dc0e;if(_0x2572e2>=_0x4572e0){_0x2572e2=_0x4572e0;_0xd6dc0e=0xc8;}else{_0xd6dc0e=0xce;}_0x1a0fd5[_0xcd00('0x1a')](_0xd6dc0e);return _0x1a0fd5['set'](_0xcd00('0x1e'),_0x29368a+'-'+_0x2572e2+'/'+_0x4572e0)['json'](_0x28cc3);}return null;};}function patchUpdates(_0x1d0102){return function(_0x1138c8){try{jsonpatch[_0xcd00('0x1f')](_0x1138c8,_0x1d0102,!![]);}catch(_0x2a649f){return BPromise[_0xcd00('0x20')](_0x2a649f);}return _0x1138c8[_0xcd00('0x21')]();};}function saveUpdates(_0x5c89e7,_0x43c451){return function(_0x549e04){if(_0x549e04){return _0x549e04[_0xcd00('0x22')](_0x5c89e7)[_0xcd00('0x23')](function(_0xcd4d11){return _0xcd4d11;});}return null;};}function removeEntity(_0x5bcec3,_0x37a98b){return function(_0x336668){if(_0x336668){return _0x336668[_0xcd00('0x24')]()['then'](function(){var _0x24b1bd=_0x336668[_0xcd00('0x25')]({'plain':!![]});var _0x347c29=[{'name':_0xcd00('0x26'),'value':_0xcd00('0x27'),'ignore':![]},{'name':_0xcd00('0x28'),'value':_0xcd00('0x29'),'ignore':![]}];var _0xf0ee2a=_(_0x347c29)['filter'](_0xcd00('0x2a'))[_0xcd00('0x2b')](_0xcd00('0x2c'))['value']();if(_['includes'](_0xf0ee2a,_0x24b1bd[_0xcd00('0x2d')])){return;}var _0x48e98d=_['find'](_0x347c29,[_0xcd00('0x2c'),_0x24b1bd[_0xcd00('0x2d')]])['name'];return db[_0xcd00('0x2e')]['destroy']({'where':{'type':_0x48e98d,'resourceId':_0x24b1bd['id']}})['then'](function(){return _0x336668;});})[_0xcd00('0x23')](function(){_0x5bcec3[_0xcd00('0x1a')](0xcc)[_0xcd00('0x2f')]();});}};}function handleEntityNotFound(_0x4caf8c,_0x2505a0){return function(_0x21c4bf){if(!_0x21c4bf){_0x4caf8c[_0xcd00('0x30')](0x194);}return _0x21c4bf;};}function handleError(_0x481c2b,_0x40d008){_0x40d008=_0x40d008||0x1f4;return function(_0x4a61d2){logger[_0xcd00('0x31')](_0x4a61d2['stack']);if(_0x4a61d2[_0xcd00('0x32')]){delete _0x4a61d2['name'];}_0x481c2b[_0xcd00('0x1a')](_0x40d008)[_0xcd00('0x33')](_0x4a61d2);};}exports['index']=function(_0x5291df,_0x506b6d){var _0xaed373={},_0x5dbcda={},_0x54d210={'count':0x0,'rows':[]};var _0x5bc35f=_[_0xcd00('0x2b')](db[_0xcd00('0x34')][_0xcd00('0x35')],function(_0x451479){return{'name':_0x451479[_0xcd00('0x36')],'type':_0x451479['type'][_0xcd00('0x37')]};});_0x5dbcda[_0xcd00('0x38')]=_[_0xcd00('0x2b')](_0x5bc35f,_0xcd00('0x32'));_0x5dbcda[_0xcd00('0x39')]=_['keys'](_0x5291df[_0xcd00('0x39')]);_0x5dbcda['filters']=_[_0xcd00('0x3a')](_0x5dbcda[_0xcd00('0x38')],_0x5dbcda[_0xcd00('0x39')]);_0xaed373[_0xcd00('0x3b')]=_['intersection'](_0x5dbcda[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x5291df[_0xcd00('0x39')][_0xcd00('0x3c')]));_0xaed373[_0xcd00('0x3b')]=_0xaed373[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0xaed373[_0xcd00('0x3b')]:_0x5dbcda[_0xcd00('0x38')];if(!_0x5291df[_0xcd00('0x39')]['hasOwnProperty'](_0xcd00('0x3e'))){_0xaed373[_0xcd00('0x1d')]=qs['limit'](_0x5291df['query'][_0xcd00('0x1d')]);_0xaed373['offset']=qs[_0xcd00('0x1c')](_0x5291df[_0xcd00('0x39')][_0xcd00('0x1c')]);}_0xaed373['order']=qs['sort'](_0x5291df[_0xcd00('0x39')][_0xcd00('0x3f')]);_0xaed373[_0xcd00('0x40')]=qs[_0xcd00('0x41')](_[_0xcd00('0x42')](_0x5291df[_0xcd00('0x39')],_0x5dbcda[_0xcd00('0x41')]));if(_0x5291df[_0xcd00('0x39')][_0xcd00('0x43')]){_0xaed373[_0xcd00('0x40')]=_['merge'](_0xaed373[_0xcd00('0x40')],{'$or':_[_0xcd00('0x2b')](_0x5bc35f,function(_0x4f94b0){if(_0x4f94b0[_0xcd00('0x2d')]!=='VIRTUAL'){var _0x40d533={};_0x40d533[_0x4f94b0[_0xcd00('0x32')]]={'$like':'%'+_0x5291df[_0xcd00('0x39')]['filter']+'%'};return _0x40d533;}})});}_0xaed373=_[_0xcd00('0x44')]({},_0xaed373,_0x5291df[_0xcd00('0x45')]);var _0x4203ae={'where':_0xaed373[_0xcd00('0x40')]};return db[_0xcd00('0x34')][_0xcd00('0x46')](_0x4203ae)[_0xcd00('0x23')](function(_0x2a40ef){_0x54d210[_0xcd00('0x46')]=_0x2a40ef;if(_0x5291df[_0xcd00('0x39')]['includeAll']){_0xaed373[_0xcd00('0x47')]=[{'all':!![]}];}return db[_0xcd00('0x34')][_0xcd00('0x48')](_0xaed373);})[_0xcd00('0x23')](function(_0xeaf8aa){_0x54d210['rows']=_0xeaf8aa;return _0x54d210;})[_0xcd00('0x23')](respondWithFilteredResult(_0x506b6d,_0xaed373))[_0xcd00('0x49')](handleError(_0x506b6d,null));};exports[_0xcd00('0x4a')]=function(_0x24d3c2,_0x1bba1c){var _0x552c5b={'raw':![],'where':{'id':_0x24d3c2['params']['id']}},_0x23bbdd={};_0x23bbdd['model']=_[_0xcd00('0x4b')](db[_0xcd00('0x34')][_0xcd00('0x35')]);_0x23bbdd['query']=_[_0xcd00('0x4b')](_0x24d3c2['query']);_0x23bbdd[_0xcd00('0x41')]=_[_0xcd00('0x3a')](_0x23bbdd[_0xcd00('0x38')],_0x23bbdd[_0xcd00('0x39')]);_0x552c5b['attributes']=_[_0xcd00('0x3a')](_0x23bbdd[_0xcd00('0x38')],qs['fields'](_0x24d3c2['query']['fields']));_0x552c5b['attributes']=_0x552c5b[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0x552c5b[_0xcd00('0x3b')]:_0x23bbdd[_0xcd00('0x38')];if(_0x24d3c2[_0xcd00('0x39')]['includeAll']){_0x552c5b[_0xcd00('0x47')]=[{'all':!![]}];}_0x552c5b=_[_0xcd00('0x44')]({},_0x552c5b,_0x24d3c2[_0xcd00('0x45')]);return db['VoiceQueue'][_0xcd00('0x4c')](_0x552c5b)['then'](handleEntityNotFound(_0x1bba1c,null))[_0xcd00('0x23')](respondWithResult(_0x1bba1c,null))[_0xcd00('0x49')](handleError(_0x1bba1c,null));};exports[_0xcd00('0x4d')]=function(_0x1331cd,_0x22357a){return db[_0xcd00('0x34')]['create'](_0x1331cd[_0xcd00('0x4e')],{})['then'](function(_0x2de295){var _0x57eb0a=_0x1331cd['user']['get']({'plain':!![]});if(!_0x57eb0a)throw new Error(_0xcd00('0x4f'));if(_0x57eb0a['role']===_0xcd00('0x50')){var _0x10c313=_0x2de295[_0xcd00('0x25')]({'plain':!![]});var _0x400786=[{'name':_0xcd00('0x26'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xcd00('0x29')}];var _0x4263ff=_[_0xcd00('0x4c')](_0x400786,['value',_0x10c313['type']])[_0xcd00('0x32')];return db[_0xcd00('0x51')]['find']({'where':{'name':_0x4263ff,'userProfileId':_0x57eb0a[_0xcd00('0x52')]},'raw':!![]})['then'](function(_0x47f970){if(_0x47f970&&_0x47f970['autoAssociation']===0x0){return db[_0xcd00('0x2e')][_0xcd00('0x4d')]({'name':_0x10c313['name'],'resourceId':_0x10c313['id'],'type':_0x47f970[_0xcd00('0x32')],'sectionId':_0x47f970['id']},{})[_0xcd00('0x23')](function(){return _0x2de295;});}else{return _0x2de295;}})[_0xcd00('0x49')](function(_0xa004fc){logger[_0xcd00('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa004fc);throw _0xa004fc;});}return _0x2de295;})[_0xcd00('0x23')](respondWithResult(_0x22357a,0xc9))[_0xcd00('0x49')](handleError(_0x22357a,null));};exports[_0xcd00('0x53')]=function(_0x3f2f33,_0x30d642){var _0x235a49={'where':{'id':_0x3f2f33['params']['id']}},_0xdffd3f={};_0xdffd3f['model']=_[_0xcd00('0x4b')](db['VoiceQueue']['rawAttributes']);_0x235a49[_0xcd00('0x3b')]=_[_0xcd00('0x3a')](_0xdffd3f[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x3f2f33[_0xcd00('0x39')][_0xcd00('0x3c')]));_0x235a49[_0xcd00('0x3b')]=_0x235a49['attributes']['length']?_0x235a49[_0xcd00('0x3b')]:_0xdffd3f[_0xcd00('0x38')];if(_0x3f2f33[_0xcd00('0x39')][_0xcd00('0x54')]){_0x235a49[_0xcd00('0x47')]=[{'all':!![]}];}_0x235a49=_[_0xcd00('0x44')]({},_0x235a49,_0x3f2f33[_0xcd00('0x45')]);return db[_0xcd00('0x34')]['find'](_0x235a49)[_0xcd00('0x23')](handleEntityNotFound(_0x30d642,null))[_0xcd00('0x23')](function(_0x472b89){if(_0x472b89){var _0x2eae6f=_0x472b89[_0xcd00('0x25')]({'plain':!![]});_0x2eae6f=qs[_0xcd00('0x55')](_0x2eae6f,['id','createdAt',_0xcd00('0x56')]);_0x3f2f33[_0xcd00('0x4e')]=_[_0xcd00('0x55')](_0x3f2f33[_0xcd00('0x4e')],['id',_0xcd00('0x57'),_0xcd00('0x56')]);return db[_0xcd00('0x34')][_0xcd00('0x4d')](_['merge'](_0x2eae6f,_0x3f2f33[_0xcd00('0x4e')]),{'include':_0x3f2f33[_0xcd00('0x39')][_0xcd00('0x54')]?[{'all':!![]}]:undefined})[_0xcd00('0x23')](function(_0x125c8f){var _0x1056a1=_0x3f2f33[_0xcd00('0x50')][_0xcd00('0x25')]({'plain':!![]});if(!_0x1056a1)throw new Error(_0xcd00('0x4f'));if(_0x1056a1[_0xcd00('0x58')]===_0xcd00('0x50')){var _0x1312b8=_0x125c8f[_0xcd00('0x25')]({'plain':!![]});var _0x445114=[{'name':_0xcd00('0x26'),'value':_0xcd00('0x27')},{'name':'QueueCampaigns','value':'outbound'}];var _0x31cc14=_[_0xcd00('0x4c')](_0x445114,[_0xcd00('0x2c'),_0x1312b8['type']])['name'];return db['UserProfileSection'][_0xcd00('0x4c')]({'where':{'name':_0x31cc14,'userProfileId':_0x1056a1[_0xcd00('0x52')]},'raw':!![]})[_0xcd00('0x23')](function(_0x5922ba){if(_0x5922ba&&_0x5922ba['autoAssociation']===0x0){return db[_0xcd00('0x2e')]['create']({'name':_0x1312b8[_0xcd00('0x32')],'resourceId':_0x1312b8['id'],'type':_0x5922ba[_0xcd00('0x32')],'sectionId':_0x5922ba['id']},{})[_0xcd00('0x23')](function(){return _0x125c8f;});}else{return _0x125c8f;}})[_0xcd00('0x49')](function(_0x1ad721){logger[_0xcd00('0x31')](_0xcd00('0x59'),_0x1ad721);throw _0x1ad721;});}return _0x125c8f;});}})[_0xcd00('0x23')](respondWithResult(_0x30d642,0xc9))[_0xcd00('0x49')](handleError(_0x30d642,null));};exports['update']=function(_0x3f3f94,_0x25ef78){if(_0x3f3f94[_0xcd00('0x4e')]['id']){delete _0x3f3f94['body']['id'];}return db[_0xcd00('0x34')][_0xcd00('0x4c')]({'where':{'id':_0x3f3f94[_0xcd00('0x5a')]['id']}})['then'](handleEntityNotFound(_0x25ef78,null))[_0xcd00('0x23')](saveUpdates(_0x3f3f94['body'],null))[_0xcd00('0x23')](respondWithResult(_0x25ef78,null))[_0xcd00('0x49')](handleError(_0x25ef78,null));};exports[_0xcd00('0x24')]=function(_0x214475,_0x2105fb){return db['VoiceQueue'][_0xcd00('0x4c')]({'where':{'id':_0x214475[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x2105fb,null))['then'](removeEntity(_0x2105fb,null))[_0xcd00('0x49')](handleError(_0x2105fb,null));};exports['getHoppers']=function(_0x1132b9,_0x2204bf,_0xf6613a){var _0x399343={'raw':![],'where':{}};var _0x5db5f9={};var _0x4e79bb={'count':0x0,'rows':[]};return db[_0xcd00('0x34')][_0xcd00('0x5b')]({'where':{'id':_0x1132b9['params']['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x2204bf,null))[_0xcd00('0x23')](function(_0x5904d7){if(_0x5904d7){_0x5db5f9[_0xcd00('0x38')]=_['keys'](db[_0xcd00('0x5c')][_0xcd00('0x35')]);_0x5db5f9[_0xcd00('0x39')]=_[_0xcd00('0x4b')](_0x1132b9[_0xcd00('0x39')]);_0x5db5f9[_0xcd00('0x41')]=_[_0xcd00('0x3a')](_0x5db5f9[_0xcd00('0x38')],_0x5db5f9['query']);_0x399343['attributes']=_[_0xcd00('0x3a')](_0x5db5f9[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x1132b9['query'][_0xcd00('0x3c')]));_0x399343[_0xcd00('0x3b')]=_0x399343[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0x399343[_0xcd00('0x3b')]:_0x5db5f9['model'];if(!_0x1132b9[_0xcd00('0x39')][_0xcd00('0x5d')](_0xcd00('0x3e'))){_0x399343[_0xcd00('0x1d')]=qs[_0xcd00('0x1d')](_0x1132b9[_0xcd00('0x39')][_0xcd00('0x1d')]);_0x399343[_0xcd00('0x1c')]=qs['offset'](_0x1132b9[_0xcd00('0x39')]['offset']);}_0x399343[_0xcd00('0x5e')]=qs[_0xcd00('0x3f')](_0x1132b9[_0xcd00('0x39')]['sort']);_0x399343[_0xcd00('0x40')]=qs[_0xcd00('0x41')](_[_0xcd00('0x42')](_0x1132b9[_0xcd00('0x39')],_0x5db5f9[_0xcd00('0x41')]));_0x399343[_0xcd00('0x40')][_0xcd00('0x5f')]=_0x5904d7['id'];if(_0x1132b9[_0xcd00('0x39')]['filter']){_0x399343[_0xcd00('0x40')]=_[_0xcd00('0x44')](_0x399343[_0xcd00('0x40')],{'$or':_[_0xcd00('0x2b')](_0x399343['attributes'],function(_0x20cfbe){var _0x34790d={};_0x34790d[_0x20cfbe]={'$like':'%'+_0x1132b9[_0xcd00('0x39')][_0xcd00('0x43')]+'%'};return _0x34790d;})});}_0x399343=_['merge']({},_0x399343,_0x1132b9[_0xcd00('0x45')]);return db[_0xcd00('0x5c')][_0xcd00('0x46')]({'where':_0x399343[_0xcd00('0x40')]})[_0xcd00('0x23')](function(_0x1712b9){_0x4e79bb['count']=_0x1712b9;if(_0x1132b9[_0xcd00('0x39')][_0xcd00('0x54')]){_0x399343[_0xcd00('0x47')]=[{'all':!![]}];}return db[_0xcd00('0x5c')][_0xcd00('0x48')](_0x399343);})[_0xcd00('0x23')](function(_0x2120e0){_0x4e79bb[_0xcd00('0x60')]=_0x2120e0;return _0x4e79bb;});}})[_0xcd00('0x23')](respondWithFilteredResult(_0x2204bf,_0x399343))[_0xcd00('0x49')](handleError(_0x2204bf,null));};exports[_0xcd00('0x61')]=function(_0x5a1d12,_0x2f09fe,_0x4245e4){var _0x10add4={'raw':!![],'where':{}};var _0x491f7f={};var _0x4ad398={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5a1d12['params']['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x2f09fe,null))[_0xcd00('0x23')](function(_0x456264){if(_0x456264){_0x491f7f[_0xcd00('0x38')]=_[_0xcd00('0x4b')](db[_0xcd00('0x62')][_0xcd00('0x35')]);_0x491f7f[_0xcd00('0x39')]=_['keys'](_0x5a1d12[_0xcd00('0x39')]);_0x491f7f[_0xcd00('0x41')]=_['intersection'](_0x491f7f['model'],_0x491f7f['query']);_0x10add4[_0xcd00('0x3b')]=_[_0xcd00('0x3a')](_0x491f7f[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x5a1d12['query'][_0xcd00('0x3c')]));_0x10add4['attributes']=_0x10add4[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0x10add4[_0xcd00('0x3b')]:_0x491f7f[_0xcd00('0x38')];if(!_0x5a1d12[_0xcd00('0x39')]['hasOwnProperty']('nolimit')){_0x10add4['limit']=qs['limit'](_0x5a1d12[_0xcd00('0x39')][_0xcd00('0x1d')]);_0x10add4['offset']=qs[_0xcd00('0x1c')](_0x5a1d12[_0xcd00('0x39')][_0xcd00('0x1c')]);}_0x10add4[_0xcd00('0x5e')]=qs['sort'](_0x5a1d12[_0xcd00('0x39')][_0xcd00('0x3f')]);_0x10add4[_0xcd00('0x40')]=qs[_0xcd00('0x41')](_[_0xcd00('0x42')](_0x5a1d12[_0xcd00('0x39')],_0x491f7f[_0xcd00('0x41')]));_0x10add4[_0xcd00('0x40')][_0xcd00('0x5f')]=_0x456264['id'];if(_0x5a1d12[_0xcd00('0x39')][_0xcd00('0x43')]){_0x10add4[_0xcd00('0x40')]=_[_0xcd00('0x44')](_0x10add4[_0xcd00('0x40')],{'$or':_[_0xcd00('0x2b')](_0x10add4[_0xcd00('0x3b')],function(_0x78c8c){var _0x46f415={};_0x46f415[_0x78c8c]={'$like':'%'+_0x5a1d12[_0xcd00('0x39')][_0xcd00('0x43')]+'%'};return _0x46f415;})});}_0x10add4=_[_0xcd00('0x44')]({},_0x10add4,_0x5a1d12[_0xcd00('0x45')]);return db['CmHopperHistory'][_0xcd00('0x46')]({'where':_0x10add4[_0xcd00('0x40')]})['then'](function(_0x579e16){_0x4ad398['count']=_0x579e16;if(_0x5a1d12['query'][_0xcd00('0x54')]){_0x10add4['include']=[{'all':!![]}];}return db[_0xcd00('0x62')][_0xcd00('0x48')](_0x10add4);})[_0xcd00('0x23')](function(_0x500060){_0x4ad398['rows']=_0x500060;return _0x4ad398;});}})['then'](respondWithFilteredResult(_0x2f09fe,_0x10add4))[_0xcd00('0x49')](handleError(_0x2f09fe,null));};exports[_0xcd00('0x63')]=function(_0x40e2e9,_0x2be093,_0x19deb2){var _0x4f316c={'raw':!![],'where':{}};var _0x42b269={};var _0x52f8a4={'count':0x0,'rows':[]};return db[_0xcd00('0x34')][_0xcd00('0x5b')]({'where':{'id':_0x40e2e9[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x2be093,null))['then'](function(_0x44559b){if(_0x44559b){_0x42b269[_0xcd00('0x38')]=_[_0xcd00('0x4b')](db[_0xcd00('0x64')]['rawAttributes']);_0x42b269[_0xcd00('0x39')]=_[_0xcd00('0x4b')](_0x40e2e9['query']);_0x42b269['filters']=_['intersection'](_0x42b269[_0xcd00('0x38')],_0x42b269[_0xcd00('0x39')]);_0x4f316c[_0xcd00('0x3b')]=_[_0xcd00('0x3a')](_0x42b269[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x40e2e9[_0xcd00('0x39')][_0xcd00('0x3c')]));_0x4f316c[_0xcd00('0x3b')]=_0x4f316c[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0x4f316c['attributes']:_0x42b269[_0xcd00('0x38')];if(!_0x40e2e9[_0xcd00('0x39')]['hasOwnProperty']('nolimit')){_0x4f316c[_0xcd00('0x1d')]=qs[_0xcd00('0x1d')](_0x40e2e9['query']['limit']);_0x4f316c[_0xcd00('0x1c')]=qs[_0xcd00('0x1c')](_0x40e2e9[_0xcd00('0x39')]['offset']);}_0x4f316c[_0xcd00('0x5e')]=qs[_0xcd00('0x3f')](_0x40e2e9[_0xcd00('0x39')]['sort']);_0x4f316c['where']=qs[_0xcd00('0x41')](_[_0xcd00('0x42')](_0x40e2e9['query'],_0x42b269[_0xcd00('0x41')]));_0x4f316c[_0xcd00('0x40')][_0xcd00('0x5f')]=_0x44559b['id'];if(_0x40e2e9[_0xcd00('0x39')][_0xcd00('0x43')]){_0x4f316c[_0xcd00('0x40')]=_['merge'](_0x4f316c[_0xcd00('0x40')],{'$or':_[_0xcd00('0x2b')](_0x4f316c['attributes'],function(_0x4a50bb){var _0x580c71={};_0x580c71[_0x4a50bb]={'$like':'%'+_0x40e2e9[_0xcd00('0x39')][_0xcd00('0x43')]+'%'};return _0x580c71;})});}_0x4f316c=_['merge']({},_0x4f316c,_0x40e2e9[_0xcd00('0x45')]);return db[_0xcd00('0x64')][_0xcd00('0x46')]({'where':_0x4f316c[_0xcd00('0x40')]})[_0xcd00('0x23')](function(_0xbead33){_0x52f8a4[_0xcd00('0x46')]=_0xbead33;if(_0x40e2e9[_0xcd00('0x39')][_0xcd00('0x54')]){_0x4f316c['include']=[{'all':!![]}];}return db[_0xcd00('0x64')][_0xcd00('0x48')](_0x4f316c);})[_0xcd00('0x23')](function(_0xc40e98){_0x52f8a4[_0xcd00('0x60')]=_0xc40e98;return _0x52f8a4;});}})[_0xcd00('0x23')](respondWithFilteredResult(_0x2be093,_0x4f316c))['catch'](handleError(_0x2be093,null));};exports[_0xcd00('0x65')]=function(_0xc16ab9,_0x4a5a05,_0x55987c){var _0x5a0e0c={'raw':!![],'where':{}};var _0x1d2c45={};var _0x4aa19c={'count':0x0,'rows':[]};return db[_0xcd00('0x34')][_0xcd00('0x5b')]({'where':{'id':_0xc16ab9[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x4a5a05,null))[_0xcd00('0x23')](function(_0x2c450e){if(_0x2c450e){_0x1d2c45[_0xcd00('0x38')]=_[_0xcd00('0x4b')](db['CmHopperBlack'][_0xcd00('0x35')]);_0x1d2c45[_0xcd00('0x39')]=_[_0xcd00('0x4b')](_0xc16ab9[_0xcd00('0x39')]);_0x1d2c45[_0xcd00('0x41')]=_[_0xcd00('0x3a')](_0x1d2c45[_0xcd00('0x38')],_0x1d2c45['query']);_0x5a0e0c[_0xcd00('0x3b')]=_[_0xcd00('0x3a')](_0x1d2c45[_0xcd00('0x38')],qs['fields'](_0xc16ab9[_0xcd00('0x39')][_0xcd00('0x3c')]));_0x5a0e0c[_0xcd00('0x3b')]=_0x5a0e0c[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0x5a0e0c['attributes']:_0x1d2c45[_0xcd00('0x38')];if(!_0xc16ab9[_0xcd00('0x39')][_0xcd00('0x5d')](_0xcd00('0x3e'))){_0x5a0e0c['limit']=qs[_0xcd00('0x1d')](_0xc16ab9[_0xcd00('0x39')]['limit']);_0x5a0e0c[_0xcd00('0x1c')]=qs['offset'](_0xc16ab9[_0xcd00('0x39')][_0xcd00('0x1c')]);}_0x5a0e0c[_0xcd00('0x5e')]=qs[_0xcd00('0x3f')](_0xc16ab9[_0xcd00('0x39')]['sort']);_0x5a0e0c['where']=qs['filters'](_[_0xcd00('0x42')](_0xc16ab9[_0xcd00('0x39')],_0x1d2c45[_0xcd00('0x41')]));_0x5a0e0c['where']['VoiceQueueId']=_0x2c450e['id'];if(_0xc16ab9[_0xcd00('0x39')][_0xcd00('0x43')]){_0x5a0e0c[_0xcd00('0x40')]=_['merge'](_0x5a0e0c[_0xcd00('0x40')],{'$or':_['map'](_0x5a0e0c[_0xcd00('0x3b')],function(_0x4f153a){var _0x2dc815={};_0x2dc815[_0x4f153a]={'$like':'%'+_0xc16ab9[_0xcd00('0x39')][_0xcd00('0x43')]+'%'};return _0x2dc815;})});}_0x5a0e0c=_['merge']({},_0x5a0e0c,_0xc16ab9['options']);return db[_0xcd00('0x66')][_0xcd00('0x46')]({'where':_0x5a0e0c[_0xcd00('0x40')]})['then'](function(_0x2ff217){_0x4aa19c[_0xcd00('0x46')]=_0x2ff217;if(_0xc16ab9[_0xcd00('0x39')][_0xcd00('0x54')]){_0x5a0e0c[_0xcd00('0x47')]=[{'all':!![]}];}return db[_0xcd00('0x66')][_0xcd00('0x48')](_0x5a0e0c);})['then'](function(_0x5ac5f8){_0x4aa19c['rows']=_0x5ac5f8;return _0x4aa19c;});}})[_0xcd00('0x23')](respondWithFilteredResult(_0x4a5a05,_0x5a0e0c))[_0xcd00('0x49')](handleError(_0x4a5a05,null));};exports[_0xcd00('0x67')]=function(_0x1eb1cd,_0x33f294,_0x4c2732){var _0x48b54c={};var _0x434a43={};var _0x5943ae;var _0x5c2c05;return db[_0xcd00('0x34')]['findOne']({'where':{'id':_0x1eb1cd['params']['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x33f294,null))[_0xcd00('0x23')](function(_0x2ae65a){if(_0x2ae65a){_0x5943ae=_0x2ae65a;_0x434a43['model']=_['keys'](db[_0xcd00('0x68')][_0xcd00('0x35')]);_0x434a43[_0xcd00('0x39')]=_[_0xcd00('0x4b')](_0x1eb1cd[_0xcd00('0x39')]);_0x434a43[_0xcd00('0x41')]=_[_0xcd00('0x3a')](_0x434a43['model'],_0x434a43['query']);_0x48b54c[_0xcd00('0x3b')]=_[_0xcd00('0x3a')](_0x434a43[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x1eb1cd[_0xcd00('0x39')][_0xcd00('0x3c')]));_0x48b54c[_0xcd00('0x3b')]=_0x48b54c['attributes']['length']?_0x48b54c[_0xcd00('0x3b')]:_0x434a43[_0xcd00('0x38')];_0x48b54c[_0xcd00('0x5e')]=qs['sort'](_0x1eb1cd['query'][_0xcd00('0x3f')]);_0x48b54c[_0xcd00('0x40')]=qs['filters'](_[_0xcd00('0x42')](_0x1eb1cd[_0xcd00('0x39')],_0x434a43[_0xcd00('0x41')]));if(_0x1eb1cd[_0xcd00('0x39')][_0xcd00('0x43')]){_0x48b54c[_0xcd00('0x40')]=_[_0xcd00('0x44')](_0x48b54c['where'],{'$or':_[_0xcd00('0x2b')](_0x48b54c['attributes'],function(_0xfabfb0){var _0x2a24b0={};_0x2a24b0[_0xfabfb0]={'$like':'%'+_0x1eb1cd['query'][_0xcd00('0x43')]+'%'};return _0x2a24b0;})});}_0x48b54c=_['merge']({},_0x48b54c,_0x1eb1cd[_0xcd00('0x45')]);return _0x5943ae['getTeams'](_0x48b54c);}})[_0xcd00('0x23')](function(_0x31c7ba){if(_0x31c7ba){_0x5c2c05=_0x31c7ba[_0xcd00('0x3d')];if(!_0x1eb1cd['query']['hasOwnProperty'](_0xcd00('0x3e'))){_0x48b54c[_0xcd00('0x1d')]=qs[_0xcd00('0x1d')](_0x1eb1cd[_0xcd00('0x39')]['limit']);_0x48b54c['offset']=qs[_0xcd00('0x1c')](_0x1eb1cd[_0xcd00('0x39')]['offset']);}return _0x5943ae['getTeams'](_0x48b54c);}})[_0xcd00('0x23')](function(_0x5f52d1){if(_0x5f52d1){return _0x5f52d1?{'count':_0x5c2c05,'rows':_0x5f52d1}:null;}})[_0xcd00('0x23')](respondWithResult(_0x33f294,null))[_0xcd00('0x49')](handleError(_0x33f294,null));};exports[_0xcd00('0x69')]=function(_0x3b4ba1,_0x1cd2f2,_0x279e2e){var _0xd5a4f9=_0x3b4ba1[_0xcd00('0x4e')][_0xcd00('0x6a')];var _0x1c4010=_[_0xcd00('0x2b')](_0xd5a4f9,'id');return db[_0xcd00('0x68')][_0xcd00('0x48')]({'where':{'id':_0x1c4010},'attributes':['id'],'include':[{'model':db[_0xcd00('0x6b')],'as':'Agents','attributes':['id',_0xcd00('0x32'),'online',_0xcd00('0x6c'),_0xcd00('0x6d')],'raw':!![]}]})[_0xcd00('0x23')](function(_0x5d2795){if(_0x5d2795){var _0x34acd3=_[_0xcd00('0x6e')](_0x5d2795,function(_0x14d42f){var _0xa786e9=_0x14d42f[_0xcd00('0x25')]({'plain':!![]});_0xa786e9[_0xcd00('0x6f')][_0xcd00('0x70')](function(_0x40e6a5){_0x40e6a5[_0xcd00('0x71')]=_[_0xcd00('0x4c')](_0xd5a4f9,{'id':_0xa786e9['id']})['penalty'];});return _0xa786e9[_0xcd00('0x6f')];});return db[_0xcd00('0x34')]['find']({'where':{'id':_0x3b4ba1[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](function(_0x2518ef){return db['sequelize']['transaction'](function(_0x53f51e){return _0x2518ef[_0xcd00('0x69')](_0x1c4010,{'transaction':_0x53f51e})['then'](function(){return BPromise['each'](_0x34acd3,function(_0x47ee54){return db[_0xcd00('0x72')][_0xcd00('0x73')]({'where':{'UserId':_0x47ee54['id'],'VoiceQueueId':_0x3b4ba1[_0xcd00('0x5a')]['id']},'defaults':{'penalty':_0x47ee54[_0xcd00('0x71')]},'transaction':_0x53f51e});});})[_0xcd00('0x23')](function(){return BPromise[_0xcd00('0x74')](_[_0xcd00('0x43')](_0x34acd3,{'online':!![]}),function(_0x32bf52){return db['UserVoiceQueueRt'][_0xcd00('0x75')]({'membername':_0x32bf52[_0xcd00('0x32')],'UserId':_0x32bf52['id'],'queue_name':_0x2518ef['name'],'VoiceQueueId':_0x2518ef['id'],'interface':_[_0xcd00('0x76')](_0x32bf52[_0xcd00('0x6d')])?util[_0xcd00('0x77')](_0xcd00('0x78'),_0x32bf52['name']):_0x32bf52[_0xcd00('0x6d')],'paused':_0x32bf52[_0xcd00('0x6c')]||![],'penalty':_0x32bf52[_0xcd00('0x71')]},{'transaction':_0x53f51e});});})[_0xcd00('0x23')](function(){_0x34acd3[_0xcd00('0x70')](function(_0x277705){socket[_0xcd00('0x79')](_0xcd00('0x7a'),{'UserId':_0x277705['id'],'VoiceQueueId':_0x2518ef['id']});});});});});}})[_0xcd00('0x23')](respondWithStatusCode(_0x1cd2f2,null))[_0xcd00('0x49')](handleError(_0x1cd2f2,null));};exports['removeTeams']=function(_0x22dc0f,_0x34c7fa,_0xe1fa42){return db[_0xcd00('0x68')][_0xcd00('0x48')]({'where':{'id':_0x22dc0f[_0xcd00('0x39')][_0xcd00('0x7b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcd00('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x34c7fa,null))['then'](function(_0x5460c1){var _0x3d7e48=_[_0xcd00('0x2b')](_0x5460c1,'id');var _0x548664=[];var _0x404703=[];var _0x2289e0=squel[_0xcd00('0x7c')]();_0x2289e0[_0xcd00('0x7d')](_0xcd00('0x7e'))[_0xcd00('0x7f')](_0xcd00('0x80'),'tq')['join'](_0xcd00('0x81'),'ut',_0xcd00('0x82'))[_0xcd00('0x40')](_0xcd00('0x83'),_0x22dc0f[_0xcd00('0x5a')]['id']);for(var _0x3ad5b9=0x0;_0x3ad5b9<_0x5460c1[_0xcd00('0x3d')];_0x3ad5b9+=0x1){let _0x44af7b=_0x5460c1[_0x3ad5b9];for(var _0x21145a=0x0;_0x21145a<_0x44af7b[_0xcd00('0x6f')][_0xcd00('0x3d')];_0x21145a+=0x1){let _0x5e491e=_0x44af7b[_0xcd00('0x6f')][_0x21145a];var _0x3a58fb=_0x2289e0[_0xcd00('0x53')]();_0x3a58fb[_0xcd00('0x40')](_0xcd00('0x84'),_0x5e491e['id']);_0x404703['push'](db['sequelize'][_0xcd00('0x39')](_0x3a58fb[_0xcd00('0x85')](),{'type':db[_0xcd00('0x86')][_0xcd00('0x87')]['SELECT']})['then'](function(_0x4a059c){if(_0x4a059c[_0xcd00('0x3d')]===0x1){return _0x5e491e['id'];}else{var _0x52e820=_[_0xcd00('0x88')](_[_0xcd00('0x2b')](_0x4a059c,'TeamId'),function(_0x1860f5){return _[_0xcd00('0x89')](_0x3d7e48,_0x1860f5);});if(_0x52e820){return _0x5e491e['id'];}}}));}}return BPromise[_0xcd00('0x8a')](_0x404703)[_0xcd00('0x23')](function(_0x20abb1){_0x548664=_(_0x548664)[_0xcd00('0x8b')](_0x20abb1)[_0xcd00('0x8c')]()[_0xcd00('0x2c')]();return db[_0xcd00('0x34')][_0xcd00('0x4c')]({'where':{'id':_0x22dc0f[_0xcd00('0x5a')]['id']}})['then'](function(_0x59b4ba){return db[_0xcd00('0x86')]['transaction'](function(_0x3de273){return _0x59b4ba[_0xcd00('0x8d')](_0x22dc0f[_0xcd00('0x39')][_0xcd00('0x7b')],{'transaction':_0x3de273})[_0xcd00('0x23')](function(){if(!_[_0xcd00('0x8e')](_0x548664)){return _0x59b4ba[_0xcd00('0x8f')](_0x548664,{'transaction':_0x3de273})[_0xcd00('0x23')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x22dc0f[_0xcd00('0x5a')]['id'],'UserId':_0x548664},'transaction':_0x3de273});});}})['then'](function(){_0x548664[_0xcd00('0x70')](function(_0x28fecd){socket[_0xcd00('0x79')](_0xcd00('0x90'),{'UserId':_0x28fecd,'VoiceQueueId':_0x59b4ba['id']});});});});});});})['then'](respondWithStatusCode(_0x34c7fa,null))[_0xcd00('0x49')](handleError(_0x34c7fa,null));};exports[_0xcd00('0x91')]=function(_0x46e3f2,_0x317b9c,_0x484e4f){var _0x40259c,_0xacc6aa;return db[_0xcd00('0x34')][_0xcd00('0x4c')]({'where':{'id':_0x46e3f2[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x317b9c,null))[_0xcd00('0x23')](function(_0x5e35fb){if(_0x5e35fb){_0xacc6aa=_0x5e35fb;return _0x5e35fb[_0xcd00('0x91')](_0x46e3f2['body'][_0xcd00('0x7b')],_['omit'](_0x46e3f2[_0xcd00('0x4e')],[_0xcd00('0x7b'),'id'])||{})[_0xcd00('0x92')](function(_0x593b9c){for(var _0x4b5351=0x0;_0x4b5351<_0x46e3f2[_0xcd00('0x4e')][_0xcd00('0x7b')]['length'];_0x4b5351+=0x1){socket[_0xcd00('0x79')](_0xcd00('0x7a'),{'UserId':_0x46e3f2[_0xcd00('0x4e')][_0xcd00('0x7b')][_0x4b5351],'VoiceQueueId':_0x46e3f2['params']['id']});}return _0x593b9c;});}})[_0xcd00('0x23')](function(_0x3bb044){_0x40259c=_0x3bb044||[];if(_0xacc6aa){return db[_0xcd00('0x6b')][_0xcd00('0x48')]({'where':{'id':_0x46e3f2[_0xcd00('0x4e')][_0xcd00('0x7b')]},'attributes':['id',_0xcd00('0x32'),_0xcd00('0x93'),'voicePause',_0xcd00('0x6d')],'raw':!![]});}})[_0xcd00('0x23')](function(_0x25564b){if(!_[_0xcd00('0x8e')](_0x25564b)){var _0x455bec=[];for(var _0x4ff2d7=0x0;_0x4ff2d7<_0x25564b[_0xcd00('0x3d')];_0x4ff2d7++){if(_0x25564b[_0x4ff2d7][_0xcd00('0x93')]){_0x455bec['push'](db[_0xcd00('0x94')][_0xcd00('0x75')]({'membername':_0x25564b[_0x4ff2d7][_0xcd00('0x32')],'UserId':_0x25564b[_0x4ff2d7]['id'],'queue_name':_0xacc6aa[_0xcd00('0x32')],'VoiceQueueId':_0xacc6aa['id'],'interface':_[_0xcd00('0x76')](_0x25564b[_0x4ff2d7][_0xcd00('0x6d')])?util[_0xcd00('0x77')](_0xcd00('0x78'),_0x25564b[_0x4ff2d7][_0xcd00('0x32')]):_0x25564b[_0x4ff2d7][_0xcd00('0x6d')],'paused':_0x25564b[_0x4ff2d7][_0xcd00('0x6c')]||![],'penalty':_0x46e3f2['body'][_0xcd00('0x71')]||0x0}));}}return BPromise[_0xcd00('0x8a')](_0x455bec);}})[_0xcd00('0x23')](function(){return _0x40259c;})[_0xcd00('0x23')](respondWithResult(_0x317b9c,null))[_0xcd00('0x49')](handleError(_0x317b9c,null));};exports[_0xcd00('0x8f')]=function(_0x211e41,_0x4d9ada,_0x3fae14){return db['VoiceQueue'][_0xcd00('0x4c')]({'where':{'id':_0x211e41['params']['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x4d9ada,null))[_0xcd00('0x23')](function(_0x2ebd3b){if(_0x2ebd3b){return _0x2ebd3b[_0xcd00('0x8f')](_0x211e41['query'][_0xcd00('0x7b')])[_0xcd00('0x23')](function(){if(_['isArray'](_0x211e41[_0xcd00('0x39')][_0xcd00('0x7b')])){for(var _0x492416=0x0;_0x492416<_0x211e41[_0xcd00('0x39')][_0xcd00('0x7b')][_0xcd00('0x3d')];_0x492416+=0x1){socket['emit'](_0xcd00('0x90'),{'UserId':Number(_0x211e41['query'][_0xcd00('0x7b')][_0x492416]),'VoiceQueueId':Number(_0x211e41[_0xcd00('0x5a')]['id'])});}}else{socket[_0xcd00('0x79')]('userVoiceQueue:remove',{'UserId':Number(_0x211e41[_0xcd00('0x39')]['ids']),'VoiceQueueId':Number(_0x211e41[_0xcd00('0x5a')]['id'])});}});}})[_0xcd00('0x23')](function(_0x5cdc69){return db['UserVoiceQueueRt'][_0xcd00('0x24')]({'where':{'VoiceQueueId':_0x211e41[_0xcd00('0x5a')]['id'],'UserId':_0x211e41[_0xcd00('0x39')][_0xcd00('0x7b')]}})[_0xcd00('0x23')](function(){return _0x5cdc69;});})['then'](respondWithStatusCode(_0x4d9ada,null))[_0xcd00('0x49')](handleError(_0x4d9ada,null));};exports['getAgents']=function(_0x469a22,_0x11c985,_0x44117b){var _0xcdd466={};var _0x436ead={};var _0x566caf;var _0x1e6b67;return db[_0xcd00('0x34')][_0xcd00('0x5b')]({'where':{'id':_0x469a22[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x11c985,null))[_0xcd00('0x23')](function(_0xdcb0e0){if(_0xdcb0e0){_0x566caf=_0xdcb0e0;_0x436ead[_0xcd00('0x38')]=_[_0xcd00('0x4b')](db[_0xcd00('0x6b')][_0xcd00('0x35')]);_0x436ead['query']=_[_0xcd00('0x4b')](_0x469a22[_0xcd00('0x39')]);_0x436ead[_0xcd00('0x41')]=_[_0xcd00('0x3a')](_0x436ead[_0xcd00('0x38')],_0x436ead[_0xcd00('0x39')]);_0xcdd466['attributes']=_[_0xcd00('0x3a')](_0x436ead[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x469a22[_0xcd00('0x39')][_0xcd00('0x3c')]));_0xcdd466[_0xcd00('0x3b')]=_0xcdd466[_0xcd00('0x3b')]['length']?_0xcdd466[_0xcd00('0x3b')]:_0x436ead[_0xcd00('0x38')];_0xcdd466[_0xcd00('0x5e')]=qs[_0xcd00('0x3f')](_0x469a22[_0xcd00('0x39')][_0xcd00('0x3f')]);_0xcdd466['where']=qs[_0xcd00('0x41')](_['pick'](_0x469a22[_0xcd00('0x39')],_0x436ead[_0xcd00('0x41')]));if(_0x469a22['query'][_0xcd00('0x43')]){_0xcdd466[_0xcd00('0x40')]=_[_0xcd00('0x44')](_0xcdd466['where'],{'$or':_[_0xcd00('0x2b')](_0xcdd466['attributes'],function(_0x56e131){var _0x3053d2={};_0x3053d2[_0x56e131]={'$like':'%'+_0x469a22[_0xcd00('0x39')][_0xcd00('0x43')]+'%'};return _0x3053d2;})});}_0xcdd466=_[_0xcd00('0x44')]({},_0xcdd466,_0x469a22[_0xcd00('0x45')]);return _0x566caf['getAgents'](_0xcdd466);}})[_0xcd00('0x23')](function(_0x2dd254){if(_0x2dd254){_0x1e6b67=_0x2dd254[_0xcd00('0x3d')];if(!_0x469a22['query'][_0xcd00('0x5d')](_0xcd00('0x3e'))){_0xcdd466['limit']=qs[_0xcd00('0x1d')](_0x469a22[_0xcd00('0x39')][_0xcd00('0x1d')]);_0xcdd466[_0xcd00('0x1c')]=qs['offset'](_0x469a22[_0xcd00('0x39')]['offset']);}return _0x566caf[_0xcd00('0x95')](_0xcdd466);}})['then'](function(_0x1c925f){if(_0x1c925f){return _0x1c925f?{'count':_0x1e6b67,'rows':_0x1c925f}:null;}})['then'](respondWithResult(_0x11c985,null))['catch'](handleError(_0x11c985,null));};exports[_0xcd00('0x96')]=function(_0x2acc3c,_0x3f617b,_0x5e15de){var _0x1dd4a9={};var _0x172b11={};var _0x3e3718;var _0x42cf96;return db[_0xcd00('0x34')][_0xcd00('0x5b')]({'where':{'id':_0x2acc3c[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x3f617b,null))[_0xcd00('0x23')](function(_0x28ef0b){if(_0x28ef0b){_0x3e3718=_0x28ef0b;_0x172b11[_0xcd00('0x38')]=_[_0xcd00('0x4b')](db[_0xcd00('0x94')][_0xcd00('0x35')]);_0x172b11[_0xcd00('0x39')]=_[_0xcd00('0x4b')](_0x2acc3c[_0xcd00('0x39')]);_0x172b11[_0xcd00('0x41')]=_[_0xcd00('0x3a')](_0x172b11[_0xcd00('0x38')],_0x172b11[_0xcd00('0x39')]);_0x1dd4a9[_0xcd00('0x3b')]=_[_0xcd00('0x3a')](_0x172b11[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x2acc3c[_0xcd00('0x39')][_0xcd00('0x3c')]));_0x1dd4a9[_0xcd00('0x3b')]=_0x1dd4a9[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0x1dd4a9[_0xcd00('0x3b')]:_0x172b11['model'];_0x1dd4a9['order']=qs['sort'](_0x2acc3c[_0xcd00('0x39')][_0xcd00('0x3f')]);_0x1dd4a9[_0xcd00('0x40')]=qs[_0xcd00('0x41')](_[_0xcd00('0x42')](_0x2acc3c[_0xcd00('0x39')],_0x172b11[_0xcd00('0x41')]));if(_0x2acc3c[_0xcd00('0x39')][_0xcd00('0x43')]){_0x1dd4a9[_0xcd00('0x40')]=_[_0xcd00('0x44')](_0x1dd4a9[_0xcd00('0x40')],{'$or':_[_0xcd00('0x2b')](_0x1dd4a9[_0xcd00('0x3b')],function(_0x11b507){var _0x794755={};_0x794755[_0x11b507]={'$like':'%'+_0x2acc3c[_0xcd00('0x39')][_0xcd00('0x43')]+'%'};return _0x794755;})});}_0x1dd4a9=_[_0xcd00('0x44')]({},_0x1dd4a9,_0x2acc3c[_0xcd00('0x45')]);return _0x3e3718[_0xcd00('0x96')](_0x1dd4a9);}})[_0xcd00('0x23')](function(_0x448f7d){if(_0x448f7d){_0x42cf96=_0x448f7d[_0xcd00('0x3d')];if(!_0x2acc3c[_0xcd00('0x39')][_0xcd00('0x5d')]('nolimit')){_0x1dd4a9[_0xcd00('0x1d')]=qs[_0xcd00('0x1d')](_0x2acc3c['query'][_0xcd00('0x1d')]);_0x1dd4a9[_0xcd00('0x1c')]=qs[_0xcd00('0x1c')](_0x2acc3c[_0xcd00('0x39')]['offset']);}return _0x3e3718[_0xcd00('0x96')](_0x1dd4a9);}})[_0xcd00('0x23')](function(_0x519be7){return _0x519be7?{'count':_0x42cf96,'rows':_0x519be7}:null;})['then'](respondWithResult(_0x3f617b,null))['catch'](handleError(_0x3f617b,null));};exports['getLists']=function(_0x5a09ef,_0x1c6ca5,_0x185a05){var _0x27baf4={};var _0x1bad23={};var _0x152144;var _0x458171;return db[_0xcd00('0x34')]['findOne']({'where':{'id':_0x5a09ef['params']['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x1c6ca5,null))['then'](function(_0x18698a){if(_0x18698a){_0x152144=_0x18698a;_0x1bad23[_0xcd00('0x38')]=_[_0xcd00('0x4b')](db[_0xcd00('0x97')][_0xcd00('0x35')]);_0x1bad23['query']=_[_0xcd00('0x4b')](_0x5a09ef[_0xcd00('0x39')]);_0x1bad23['filters']=_['intersection'](_0x1bad23['model'],_0x1bad23[_0xcd00('0x39')]);_0x27baf4['attributes']=_[_0xcd00('0x3a')](_0x1bad23[_0xcd00('0x38')],qs[_0xcd00('0x3c')](_0x5a09ef['query'][_0xcd00('0x3c')]));_0x27baf4['attributes']=_0x27baf4[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0x27baf4[_0xcd00('0x3b')]:_0x1bad23[_0xcd00('0x38')];_0x27baf4[_0xcd00('0x5e')]=qs[_0xcd00('0x3f')](_0x5a09ef[_0xcd00('0x39')][_0xcd00('0x3f')]);_0x27baf4[_0xcd00('0x40')]=qs[_0xcd00('0x41')](_[_0xcd00('0x42')](_0x5a09ef[_0xcd00('0x39')],_0x1bad23[_0xcd00('0x41')]));if(_0x5a09ef[_0xcd00('0x39')][_0xcd00('0x43')]){_0x27baf4['where']=_[_0xcd00('0x44')](_0x27baf4[_0xcd00('0x40')],{'$or':_[_0xcd00('0x2b')](_0x27baf4[_0xcd00('0x3b')],function(_0x43b383){var _0x3374fb={};_0x3374fb[_0x43b383]={'$like':'%'+_0x5a09ef[_0xcd00('0x39')][_0xcd00('0x43')]+'%'};return _0x3374fb;})});}_0x27baf4=_['merge']({},_0x27baf4,_0x5a09ef['options']);return _0x152144['getLists'](_0x27baf4);}})[_0xcd00('0x23')](function(_0x42d271){if(_0x42d271){_0x458171=_0x42d271[_0xcd00('0x3d')];if(!_0x5a09ef['query']['hasOwnProperty'](_0xcd00('0x3e'))){_0x27baf4[_0xcd00('0x1d')]=qs[_0xcd00('0x1d')](_0x5a09ef[_0xcd00('0x39')][_0xcd00('0x1d')]);_0x27baf4[_0xcd00('0x1c')]=qs['offset'](_0x5a09ef['query']['offset']);}return _0x152144[_0xcd00('0x98')](_0x27baf4);}})[_0xcd00('0x23')](function(_0x5c3817){if(_0x5c3817){return _0x5c3817?{'count':_0x458171,'rows':_0x5c3817}:null;}})[_0xcd00('0x23')](respondWithResult(_0x1c6ca5,null))[_0xcd00('0x49')](handleError(_0x1c6ca5,null));};exports[_0xcd00('0x99')]=function(_0xc4903d,_0x58cd3e,_0xd28871){var _0x3a3fee,_0x2c1bbe;return db[_0xcd00('0x34')]['find']({'where':{'id':_0xc4903d[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x58cd3e,null))[_0xcd00('0x23')](function(_0x15896f){if(_0x15896f){_0x2c1bbe=_0x15896f;return _0x15896f[_0xcd00('0x99')](_0xc4903d['body'][_0xcd00('0x7b')],_[_0xcd00('0x55')](_0xc4903d[_0xcd00('0x4e')],[_0xcd00('0x7b'),'id'])||{});}return null;})['spread'](function(_0x5c451e){var _0x33ad27;_0x3a3fee=_0x5c451e||[];var _0x3d14e7=[];if(_0x5c451e){for(var _0x4e416b=0x0;_0x4e416b<_0x5c451e[_0xcd00('0x3d')];_0x4e416b+=0x1){var _0x24b83a=_0x5c451e[_0x4e416b]['get']({'plain':!![]});_0x2c1bbe[_0xcd00('0x9a')]=_0xc4903d[_0xcd00('0x4e')][_0xcd00('0x9a')]?_0xc4903d[_0xcd00('0x4e')]['dialCheckDuplicateType']:_0x2c1bbe[_0xcd00('0x9a')];switch(_0x2c1bbe[_0xcd00('0x9a')]){case _0xcd00('0x9b'):_0x33ad27=squel[_0xcd00('0x9c')]()[_0xcd00('0x9d')](_0xcd00('0x9e'))['fromQuery']([_0xcd00('0x9f'),_0xcd00('0xa0'),_0xcd00('0xa1'),_0xcd00('0xa2'),_0xcd00('0x5f'),_0xcd00('0x57'),_0xcd00('0x56')],squel['select']()[_0xcd00('0x7d')](_0xcd00('0x9f'),_0xcd00('0x9f'))[_0xcd00('0x7d')]('NOW()',_0xcd00('0xa0'))[_0xcd00('0x7d')]('id',_0xcd00('0xa1'))[_0xcd00('0x7d')](_0x24b83a[_0xcd00('0xa3')][_0xcd00('0x85')](),_0xcd00('0xa2'))[_0xcd00('0x7d')](_0xc4903d[_0xcd00('0x5a')]['id'][_0xcd00('0x85')](),'VoiceQueueId')[_0xcd00('0x7d')](_0xcd00('0xa4'),_0xcd00('0x57'))['field'](_0xcd00('0xa4'),_0xcd00('0x56'))['from'](_0xcd00('0xa5'))['where'](_0xcd00('0xa6'))[_0xcd00('0x40')](_0xcd00('0xa7'),_0x24b83a['CmListId'][_0xcd00('0x85')]())[_0xcd00('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0xcd00('0x40')](_0xcd00('0xa8'),squel[_0xcd00('0x7c')]()['field'](_0xcd00('0xa9'))[_0xcd00('0x7f')](_0xcd00('0xaa'))[_0xcd00('0x40')](_0xcd00('0x83'),_0xc4903d[_0xcd00('0x5a')]['id'][_0xcd00('0x85')]()))[_0xcd00('0x40')](_0xcd00('0xa8'),squel['select']()[_0xcd00('0x7d')](_0xcd00('0xab'))[_0xcd00('0x7f')](_0xcd00('0x9e'))[_0xcd00('0x40')]('VoiceQueueId\x20=\x20?',_0xc4903d[_0xcd00('0x5a')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x33ad27=squel[_0xcd00('0x9c')]()[_0xcd00('0x9d')](_0xcd00('0x9e'))[_0xcd00('0xac')]([_0xcd00('0x9f'),'scheduledAt',_0xcd00('0xa1'),_0xcd00('0xa2'),'VoiceQueueId',_0xcd00('0x57'),_0xcd00('0x56')],squel['select']()[_0xcd00('0x7d')](_0xcd00('0x9f'),_0xcd00('0x9f'))[_0xcd00('0x7d')](_0xcd00('0xa4'),_0xcd00('0xa0'))[_0xcd00('0x7d')]('id','ContactId')['field'](_0x24b83a[_0xcd00('0xa3')][_0xcd00('0x85')](),_0xcd00('0xa2'))[_0xcd00('0x7d')](_0xc4903d[_0xcd00('0x5a')]['id'][_0xcd00('0x85')](),_0xcd00('0x5f'))[_0xcd00('0x7d')](_0xcd00('0xa4'),_0xcd00('0x57'))['field'](_0xcd00('0xa4'),_0xcd00('0x56'))['from']('cm_contacts')[_0xcd00('0x40')](_0xcd00('0xa6'))[_0xcd00('0x40')]('ListId\x20=\x20?',_0x24b83a['CmListId'][_0xcd00('0x85')]())[_0xcd00('0x40')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xcd00('0xa8'),squel['select']()[_0xcd00('0x7d')](_0xcd00('0xab'))[_0xcd00('0x7f')](_0xcd00('0x9e'))['where'](_0xcd00('0x83'),_0xc4903d[_0xcd00('0x5a')]['id'][_0xcd00('0x85')]())))[_0xcd00('0x85')]();break;default:_0x33ad27=squel[_0xcd00('0x9c')]()[_0xcd00('0x9d')](_0xcd00('0x9e'))[_0xcd00('0xac')](['phone',_0xcd00('0xa0'),_0xcd00('0xa1'),_0xcd00('0xa2'),'VoiceQueueId',_0xcd00('0x57'),_0xcd00('0x56')],squel['select']()[_0xcd00('0x7d')](_0xcd00('0x9f'),_0xcd00('0x9f'))[_0xcd00('0x7d')](_0xcd00('0xa4'),'scheduledAt')[_0xcd00('0x7d')]('id','ContactId')['field'](_0x24b83a[_0xcd00('0xa3')][_0xcd00('0x85')](),_0xcd00('0xa2'))['field'](_0xc4903d[_0xcd00('0x5a')]['id']['toString'](),'VoiceQueueId')[_0xcd00('0x7d')](_0xcd00('0xa4'),_0xcd00('0x57'))[_0xcd00('0x7d')](_0xcd00('0xa4'),_0xcd00('0x56'))['from']('cm_contacts')['where'](_0xcd00('0xa6'))[_0xcd00('0x40')]('ListId\x20=\x20?',_0x24b83a['CmListId'][_0xcd00('0x85')]())['where'](_0xcd00('0xad')))[_0xcd00('0x85')]();}_0x3d14e7[_0xcd00('0xae')](db[_0xcd00('0x86')][_0xcd00('0x39')](_0x33ad27));}return BPromise[_0xcd00('0x8a')](_0x3d14e7);}})[_0xcd00('0x23')](function(){return _0x3a3fee;})['then'](respondWithResult(_0x58cd3e,null))['catch'](handleError(_0x58cd3e,null));};exports[_0xcd00('0xaf')]=function(_0x37a6d1,_0x2f63da,_0x5ec18){return db[_0xcd00('0x34')][_0xcd00('0x4c')]({'where':{'id':_0x37a6d1['params']['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x2f63da,null))[_0xcd00('0x23')](function(_0x4a98c7){if(_0x4a98c7){return _0x4a98c7[_0xcd00('0xaf')](_0x37a6d1[_0xcd00('0x39')]['ids']);}})[_0xcd00('0x23')](function(_0x3f14e0){if(_0x3f14e0){return db['CmHopper'][_0xcd00('0x24')]({'where':{'ListId':_0x37a6d1['query'][_0xcd00('0x7b')],'VoiceQueueId':_0x37a6d1[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](function(){return _0x3f14e0;});}})[_0xcd00('0x23')](respondWithStatusCode(_0x2f63da,null))[_0xcd00('0x49')](handleError(_0x2f63da,null));};exports[_0xcd00('0xb0')]=function(_0xbec7a,_0x427c36,_0x40a2bd){var _0x116dec={};var _0x50050e={};var _0x57d734;var _0x48af97;return db[_0xcd00('0x34')][_0xcd00('0x5b')]({'where':{'id':_0xbec7a['params']['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x427c36,null))[_0xcd00('0x23')](function(_0x38d351){if(_0x38d351){_0x57d734=_0x38d351;_0x50050e[_0xcd00('0x38')]=_[_0xcd00('0x4b')](db[_0xcd00('0x97')][_0xcd00('0x35')]);_0x50050e['query']=_['keys'](_0xbec7a[_0xcd00('0x39')]);_0x50050e[_0xcd00('0x41')]=_['intersection'](_0x50050e[_0xcd00('0x38')],_0x50050e[_0xcd00('0x39')]);_0x116dec[_0xcd00('0x3b')]=_[_0xcd00('0x3a')](_0x50050e[_0xcd00('0x38')],qs['fields'](_0xbec7a[_0xcd00('0x39')][_0xcd00('0x3c')]));_0x116dec[_0xcd00('0x3b')]=_0x116dec[_0xcd00('0x3b')][_0xcd00('0x3d')]?_0x116dec['attributes']:_0x50050e[_0xcd00('0x38')];_0x116dec['order']=qs[_0xcd00('0x3f')](_0xbec7a[_0xcd00('0x39')][_0xcd00('0x3f')]);_0x116dec[_0xcd00('0x40')]=qs['filters'](_[_0xcd00('0x42')](_0xbec7a[_0xcd00('0x39')],_0x50050e[_0xcd00('0x41')]));if(_0xbec7a[_0xcd00('0x39')][_0xcd00('0x43')]){_0x116dec[_0xcd00('0x40')]=_[_0xcd00('0x44')](_0x116dec[_0xcd00('0x40')],{'$or':_[_0xcd00('0x2b')](_0x116dec[_0xcd00('0x3b')],function(_0x53c2e5){var _0x5805c3={};_0x5805c3[_0x53c2e5]={'$like':'%'+_0xbec7a[_0xcd00('0x39')][_0xcd00('0x43')]+'%'};return _0x5805c3;})});}_0x116dec=_[_0xcd00('0x44')]({},_0x116dec,_0xbec7a[_0xcd00('0x45')]);return _0x57d734[_0xcd00('0xb0')](_0x116dec);}})[_0xcd00('0x23')](function(_0x5aeae4){if(_0x5aeae4){_0x48af97=_0x5aeae4[_0xcd00('0x3d')];if(!_0xbec7a['query']['hasOwnProperty'](_0xcd00('0x3e'))){_0x116dec[_0xcd00('0x1d')]=qs[_0xcd00('0x1d')](_0xbec7a[_0xcd00('0x39')][_0xcd00('0x1d')]);_0x116dec[_0xcd00('0x1c')]=qs[_0xcd00('0x1c')](_0xbec7a[_0xcd00('0x39')][_0xcd00('0x1c')]);}return _0x57d734[_0xcd00('0xb0')](_0x116dec);}})[_0xcd00('0x23')](function(_0xed3ab2){if(_0xed3ab2){return _0xed3ab2?{'count':_0x48af97,'rows':_0xed3ab2}:null;}})[_0xcd00('0x23')](respondWithResult(_0x427c36,null))[_0xcd00('0x49')](handleError(_0x427c36,null));};exports[_0xcd00('0xb1')]=function(_0xaadb0d,_0x491e95,_0x165f82){var _0x2ab4e7,_0x15d1c8;return db[_0xcd00('0x34')]['find']({'where':{'id':_0xaadb0d[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x491e95,null))[_0xcd00('0x23')](function(_0x2e81c7){if(_0x2e81c7){_0x15d1c8=_0x2e81c7;return _0x2e81c7[_0xcd00('0xb1')](_0xaadb0d['body'][_0xcd00('0x7b')],_[_0xcd00('0x55')](_0xaadb0d['body'],[_0xcd00('0x7b'),'id'])||{});}return null;})[_0xcd00('0x92')](function(_0x29b7e3){var _0x31bd66;_0x2ab4e7=_0x29b7e3||[];var _0x12a02c=[];if(_0x29b7e3){for(var _0x451241=0x0;_0x451241<_0x29b7e3[_0xcd00('0x3d')];_0x451241+=0x1){var _0x2b23cf=_0x29b7e3[_0x451241]['get']({'plain':!![]});_0x31bd66=squel[_0xcd00('0x9c')]()[_0xcd00('0x9d')](_0xcd00('0xb2'))[_0xcd00('0xac')]([_0xcd00('0x9f'),_0xcd00('0xa1'),_0xcd00('0xa2'),'VoiceQueueId','createdAt','updatedAt'],squel[_0xcd00('0x7c')]()[_0xcd00('0x7d')](_0xcd00('0x9f'),_0xcd00('0x9f'))[_0xcd00('0x7d')]('id','ContactId')[_0xcd00('0x7d')](_0x2b23cf[_0xcd00('0xa3')][_0xcd00('0x85')](),_0xcd00('0xa2'))[_0xcd00('0x7d')](_0xaadb0d[_0xcd00('0x5a')]['id'][_0xcd00('0x85')](),_0xcd00('0x5f'))['field'](_0xcd00('0xa4'),_0xcd00('0x57'))[_0xcd00('0x7d')]('NOW()','updatedAt')['from']('cm_contacts')[_0xcd00('0x40')](_0xcd00('0xa6'))[_0xcd00('0x40')](_0xcd00('0xa7'),_0x2b23cf[_0xcd00('0xa3')][_0xcd00('0x85')]())[_0xcd00('0x40')](_0xcd00('0xad')))[_0xcd00('0x85')]();_0x12a02c['push'](db['sequelize'][_0xcd00('0x39')](_0x31bd66));}return BPromise['all'](_0x12a02c);}})['then'](function(){return _0x2ab4e7;})['then'](respondWithResult(_0x491e95,null))['catch'](handleError(_0x491e95,null));};exports[_0xcd00('0xb3')]=function(_0x248b0a,_0x2645a8,_0x523b19){return db['VoiceQueue'][_0xcd00('0x4c')]({'where':{'id':_0x248b0a[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](handleEntityNotFound(_0x2645a8,null))[_0xcd00('0x23')](function(_0x37949b){if(_0x37949b){return _0x37949b[_0xcd00('0xb3')](_0x248b0a[_0xcd00('0x39')][_0xcd00('0x7b')]);}})[_0xcd00('0x23')](function(_0x262842){if(_0x262842){return db[_0xcd00('0x66')]['destroy']({'where':{'ListId':_0x248b0a[_0xcd00('0x39')][_0xcd00('0x7b')],'VoiceQueueId':_0x248b0a[_0xcd00('0x5a')]['id']}})[_0xcd00('0x23')](function(){return _0x262842;});}})[_0xcd00('0x23')](respondWithStatusCode(_0x2645a8,null))[_0xcd00('0x49')](handleError(_0x2645a8,null));}; \ No newline at end of file +var _0xef96=['bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','value','includes','type','find','name','UserProfileResource','error','stack','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','omit','createdAt','updatedAt','params','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','penalty','sequelize','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','fromQuery','scheduledAt','ContactId','phone','NOW()','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','into','cm_hopper','CmListId','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0xef96,0x168));var _0x6ef9=function(_0x42d40d,_0x31b3c5){_0x42d40d=_0x42d40d-0x0;var _0x1654ec=_0xef96[_0x42d40d];return _0x1654ec;};'use strict';var pdf=require(_0x6ef9('0x0'));var emlformat=require(_0x6ef9('0x1'));var rimraf=require(_0x6ef9('0x2'));var zipdir=require(_0x6ef9('0x3'));var jsonpatch=require(_0x6ef9('0x4'));var rp=require('request-promise');var moment=require(_0x6ef9('0x5'));var BPromise=require(_0x6ef9('0x6'));var Mustache=require(_0x6ef9('0x7'));var util=require(_0x6ef9('0x8'));var path=require(_0x6ef9('0x9'));var sox=require(_0x6ef9('0xa'));var csv=require(_0x6ef9('0xb'));var ejs=require(_0x6ef9('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6ef9('0xd'));var jsforce=require(_0x6ef9('0xe'));var deskjs=require(_0x6ef9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6ef9('0x10'));var Papa=require(_0x6ef9('0x11'));var Redis=require(_0x6ef9('0x12'));var authService=require(_0x6ef9('0x13'));var qs=require(_0x6ef9('0x14'));var as=require(_0x6ef9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef9('0x16'))(_0x6ef9('0x17'));var utils=require(_0x6ef9('0x18'));var config=require(_0x6ef9('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x6ef9('0x1a'),'port':0x18eb});var socket=require(_0x6ef9('0x1b'))(new Redis(config[_0x6ef9('0x1c')]));require(_0x6ef9('0x1d'))[_0x6ef9('0x1e')](socket);function respondWithStatusCode(_0x509fd4,_0x3d642d){_0x3d642d=_0x3d642d||0xcc;return function(_0x3904be){if(_0x3904be){return _0x509fd4[_0x6ef9('0x1f')](_0x3d642d);}return _0x509fd4[_0x6ef9('0x20')](_0x3d642d)[_0x6ef9('0x21')]();};}function respondWithResult(_0x2b04db,_0x19401e){_0x19401e=_0x19401e||0xc8;return function(_0x294ebd){if(_0x294ebd){return _0x2b04db[_0x6ef9('0x20')](_0x19401e)[_0x6ef9('0x22')](_0x294ebd);}};}function respondWithFilteredResult(_0x2dc12d,_0x18ca3b){return function(_0x33d397){if(_0x33d397){var _0x5390b9=_0x33d397[_0x6ef9('0x23')],_0x11cb93=_0x18ca3b[_0x6ef9('0x24')],_0x48ae76=_0x18ca3b[_0x6ef9('0x24')]+_0x18ca3b[_0x6ef9('0x25')],_0x4372db;if(_0x48ae76>=_0x5390b9){_0x48ae76=_0x5390b9;_0x4372db=0xc8;}else{_0x4372db=0xce;}_0x2dc12d[_0x6ef9('0x20')](_0x4372db);return _0x2dc12d[_0x6ef9('0x26')](_0x6ef9('0x27'),_0x11cb93+'-'+_0x48ae76+'/'+_0x5390b9)[_0x6ef9('0x22')](_0x33d397);}return null;};}function patchUpdates(_0x2a839e){return function(_0x2b1fb9){try{jsonpatch['apply'](_0x2b1fb9,_0x2a839e,!![]);}catch(_0x2ccee4){return BPromise['reject'](_0x2ccee4);}return _0x2b1fb9[_0x6ef9('0x28')]();};}function saveUpdates(_0x3c3cc1,_0x29436d){return function(_0x3d3eae){if(_0x3d3eae){return _0x3d3eae[_0x6ef9('0x29')](_0x3c3cc1)[_0x6ef9('0x2a')](function(_0x3b645f){return _0x3b645f;});}return null;};}function removeEntity(_0x2d933f,_0xc55b3c){return function(_0x244460){if(_0x244460){return _0x244460[_0x6ef9('0x2b')]()['then'](function(){var _0x54c3da=_0x244460[_0x6ef9('0x2c')]({'plain':!![]});var _0x1109e4=[{'name':_0x6ef9('0x2d'),'value':_0x6ef9('0x2e'),'ignore':![]},{'name':_0x6ef9('0x2f'),'value':_0x6ef9('0x30'),'ignore':![]}];var _0x246a64=_(_0x1109e4)[_0x6ef9('0x31')]('ignore')['map'](_0x6ef9('0x32'))[_0x6ef9('0x32')]();if(_[_0x6ef9('0x33')](_0x246a64,_0x54c3da[_0x6ef9('0x34')])){return;}var _0x4b42bc=_[_0x6ef9('0x35')](_0x1109e4,[_0x6ef9('0x32'),_0x54c3da[_0x6ef9('0x34')]])[_0x6ef9('0x36')];return db[_0x6ef9('0x37')][_0x6ef9('0x2b')]({'where':{'type':_0x4b42bc,'resourceId':_0x54c3da['id']}})['then'](function(){return _0x244460;});})[_0x6ef9('0x2a')](function(){_0x2d933f[_0x6ef9('0x20')](0xcc)[_0x6ef9('0x21')]();});}};}function handleEntityNotFound(_0x4a13fe,_0x1512dd){return function(_0x3f33ea){if(!_0x3f33ea){_0x4a13fe['sendStatus'](0x194);}return _0x3f33ea;};}function handleError(_0x2ab640,_0x43778a){_0x43778a=_0x43778a||0x1f4;return function(_0x592fdc){logger[_0x6ef9('0x38')](_0x592fdc[_0x6ef9('0x39')]);if(_0x592fdc[_0x6ef9('0x36')]){delete _0x592fdc[_0x6ef9('0x36')];}_0x2ab640[_0x6ef9('0x20')](_0x43778a)['send'](_0x592fdc);};}exports[_0x6ef9('0x3a')]=function(_0x34f791,_0x7f3504){var _0x5be027={},_0x257f6f={},_0x16a583={'count':0x0,'rows':[]};var _0x558bec=_[_0x6ef9('0x3b')](db['VoiceQueue'][_0x6ef9('0x3c')],function(_0x252aa9){return{'name':_0x252aa9[_0x6ef9('0x3d')],'type':_0x252aa9[_0x6ef9('0x34')]['key']};});_0x257f6f[_0x6ef9('0x3e')]=_[_0x6ef9('0x3b')](_0x558bec,_0x6ef9('0x36'));_0x257f6f[_0x6ef9('0x3f')]=_[_0x6ef9('0x40')](_0x34f791[_0x6ef9('0x3f')]);_0x257f6f['filters']=_[_0x6ef9('0x41')](_0x257f6f[_0x6ef9('0x3e')],_0x257f6f[_0x6ef9('0x3f')]);_0x5be027[_0x6ef9('0x42')]=_[_0x6ef9('0x41')](_0x257f6f[_0x6ef9('0x3e')],qs[_0x6ef9('0x43')](_0x34f791[_0x6ef9('0x3f')][_0x6ef9('0x43')]));_0x5be027['attributes']=_0x5be027[_0x6ef9('0x42')][_0x6ef9('0x44')]?_0x5be027['attributes']:_0x257f6f['model'];if(!_0x34f791['query'][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x5be027[_0x6ef9('0x25')]=qs[_0x6ef9('0x25')](_0x34f791[_0x6ef9('0x3f')]['limit']);_0x5be027[_0x6ef9('0x24')]=qs[_0x6ef9('0x24')](_0x34f791[_0x6ef9('0x3f')][_0x6ef9('0x24')]);}_0x5be027[_0x6ef9('0x47')]=qs['sort'](_0x34f791[_0x6ef9('0x3f')][_0x6ef9('0x48')]);_0x5be027['where']=qs['filters'](_[_0x6ef9('0x49')](_0x34f791['query'],_0x257f6f[_0x6ef9('0x4a')]));if(_0x34f791[_0x6ef9('0x3f')]['filter']){_0x5be027[_0x6ef9('0x4b')]=_[_0x6ef9('0x4c')](_0x5be027[_0x6ef9('0x4b')],{'$or':_[_0x6ef9('0x3b')](_0x558bec,function(_0x112148){if(_0x112148[_0x6ef9('0x34')]!==_0x6ef9('0x4d')){var _0x355583={};_0x355583[_0x112148['name']]={'$like':'%'+_0x34f791[_0x6ef9('0x3f')][_0x6ef9('0x31')]+'%'};return _0x355583;}})});}_0x5be027=_[_0x6ef9('0x4c')]({},_0x5be027,_0x34f791[_0x6ef9('0x4e')]);var _0x3bb972={'where':_0x5be027['where']};return db[_0x6ef9('0x4f')][_0x6ef9('0x23')](_0x3bb972)[_0x6ef9('0x2a')](function(_0x5e0e59){_0x16a583[_0x6ef9('0x23')]=_0x5e0e59;if(_0x34f791[_0x6ef9('0x3f')][_0x6ef9('0x50')]){_0x5be027[_0x6ef9('0x51')]=[{'all':!![]}];}return db[_0x6ef9('0x4f')][_0x6ef9('0x52')](_0x5be027);})[_0x6ef9('0x2a')](function(_0x204728){_0x16a583[_0x6ef9('0x53')]=_0x204728;return _0x16a583;})[_0x6ef9('0x2a')](respondWithFilteredResult(_0x7f3504,_0x5be027))['catch'](handleError(_0x7f3504,null));};exports[_0x6ef9('0x54')]=function(_0x19ef6a,_0x53f7b6){var _0x23daff={'raw':![],'where':{'id':_0x19ef6a['params']['id']}},_0x1d79f5={};_0x1d79f5[_0x6ef9('0x3e')]=_['keys'](db[_0x6ef9('0x4f')][_0x6ef9('0x3c')]);_0x1d79f5['query']=_[_0x6ef9('0x40')](_0x19ef6a[_0x6ef9('0x3f')]);_0x1d79f5[_0x6ef9('0x4a')]=_['intersection'](_0x1d79f5[_0x6ef9('0x3e')],_0x1d79f5[_0x6ef9('0x3f')]);_0x23daff['attributes']=_['intersection'](_0x1d79f5[_0x6ef9('0x3e')],qs[_0x6ef9('0x43')](_0x19ef6a[_0x6ef9('0x3f')][_0x6ef9('0x43')]));_0x23daff['attributes']=_0x23daff[_0x6ef9('0x42')][_0x6ef9('0x44')]?_0x23daff[_0x6ef9('0x42')]:_0x1d79f5[_0x6ef9('0x3e')];if(_0x19ef6a[_0x6ef9('0x3f')][_0x6ef9('0x50')]){_0x23daff['include']=[{'all':!![]}];}_0x23daff=_['merge']({},_0x23daff,_0x19ef6a[_0x6ef9('0x4e')]);return db[_0x6ef9('0x4f')]['find'](_0x23daff)['then'](handleEntityNotFound(_0x53f7b6,null))[_0x6ef9('0x2a')](respondWithResult(_0x53f7b6,null))['catch'](handleError(_0x53f7b6,null));};exports[_0x6ef9('0x55')]=function(_0x418ddf,_0x23bacd){return db[_0x6ef9('0x4f')][_0x6ef9('0x55')](_0x418ddf[_0x6ef9('0x56')],{})[_0x6ef9('0x2a')](function(_0xa78490){var _0x18bda3=_0x418ddf[_0x6ef9('0x57')][_0x6ef9('0x2c')]({'plain':!![]});if(!_0x18bda3)throw new Error(_0x6ef9('0x58'));if(_0x18bda3['role']==='user'){var _0x4e3346=_0xa78490[_0x6ef9('0x2c')]({'plain':!![]});var _0x389d13=[{'name':_0x6ef9('0x2d'),'value':_0x6ef9('0x2e')},{'name':_0x6ef9('0x2f'),'value':_0x6ef9('0x30')}];var _0x4c8d42=_[_0x6ef9('0x35')](_0x389d13,[_0x6ef9('0x32'),_0x4e3346['type']])['name'];return db[_0x6ef9('0x59')][_0x6ef9('0x35')]({'where':{'name':_0x4c8d42,'userProfileId':_0x18bda3[_0x6ef9('0x5a')]},'raw':!![]})['then'](function(_0x275d28){if(_0x275d28&&_0x275d28[_0x6ef9('0x5b')]===0x0){return db[_0x6ef9('0x37')][_0x6ef9('0x55')]({'name':_0x4e3346[_0x6ef9('0x36')],'resourceId':_0x4e3346['id'],'type':_0x275d28[_0x6ef9('0x36')],'sectionId':_0x275d28['id']},{})[_0x6ef9('0x2a')](function(){return _0xa78490;});}else{return _0xa78490;}})[_0x6ef9('0x5c')](function(_0x1749e5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1749e5);throw _0x1749e5;});}return _0xa78490;})[_0x6ef9('0x2a')](respondWithResult(_0x23bacd,0xc9))[_0x6ef9('0x5c')](handleError(_0x23bacd,null));};exports['clone']=function(_0x57a9a1,_0x4757bd){var _0x4fa979={'where':{'id':_0x57a9a1['params']['id']}},_0x1c60ca={};_0x1c60ca[_0x6ef9('0x3e')]=_['keys'](db[_0x6ef9('0x4f')]['rawAttributes']);_0x4fa979['attributes']=_[_0x6ef9('0x41')](_0x1c60ca[_0x6ef9('0x3e')],qs[_0x6ef9('0x43')](_0x57a9a1['query'][_0x6ef9('0x43')]));_0x4fa979['attributes']=_0x4fa979[_0x6ef9('0x42')][_0x6ef9('0x44')]?_0x4fa979[_0x6ef9('0x42')]:_0x1c60ca[_0x6ef9('0x3e')];if(_0x57a9a1[_0x6ef9('0x3f')][_0x6ef9('0x50')]){_0x4fa979['include']=[{'all':!![]}];}_0x4fa979=_['merge']({},_0x4fa979,_0x57a9a1['options']);return db[_0x6ef9('0x4f')][_0x6ef9('0x35')](_0x4fa979)[_0x6ef9('0x2a')](handleEntityNotFound(_0x4757bd,null))['then'](function(_0x405915){if(_0x405915){var _0x3caef1=_0x405915[_0x6ef9('0x2c')]({'plain':!![]});_0x3caef1=qs[_0x6ef9('0x5d')](_0x3caef1,['id',_0x6ef9('0x5e'),_0x6ef9('0x5f')]);_0x57a9a1[_0x6ef9('0x56')]=_[_0x6ef9('0x5d')](_0x57a9a1[_0x6ef9('0x56')],['id','createdAt',_0x6ef9('0x5f')]);return db[_0x6ef9('0x4f')]['create'](_[_0x6ef9('0x4c')](_0x3caef1,_0x57a9a1[_0x6ef9('0x56')]),{'include':_0x57a9a1[_0x6ef9('0x3f')][_0x6ef9('0x50')]?[{'all':!![]}]:undefined})[_0x6ef9('0x2a')](function(_0x3c40bc){var _0x2364bb=_0x57a9a1[_0x6ef9('0x57')]['get']({'plain':!![]});if(!_0x2364bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2364bb['role']===_0x6ef9('0x57')){var _0x3a3234=_0x3c40bc[_0x6ef9('0x2c')]({'plain':!![]});var _0x31e6a2=[{'name':'VoiceQueues','value':_0x6ef9('0x2e')},{'name':'QueueCampaigns','value':_0x6ef9('0x30')}];var _0x57d656=_[_0x6ef9('0x35')](_0x31e6a2,[_0x6ef9('0x32'),_0x3a3234[_0x6ef9('0x34')]])['name'];return db['UserProfileSection'][_0x6ef9('0x35')]({'where':{'name':_0x57d656,'userProfileId':_0x2364bb[_0x6ef9('0x5a')]},'raw':!![]})[_0x6ef9('0x2a')](function(_0x351ceb){if(_0x351ceb&&_0x351ceb['autoAssociation']===0x0){return db['UserProfileResource'][_0x6ef9('0x55')]({'name':_0x3a3234[_0x6ef9('0x36')],'resourceId':_0x3a3234['id'],'type':_0x351ceb[_0x6ef9('0x36')],'sectionId':_0x351ceb['id']},{})[_0x6ef9('0x2a')](function(){return _0x3c40bc;});}else{return _0x3c40bc;}})[_0x6ef9('0x5c')](function(_0x49d97c){logger[_0x6ef9('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49d97c);throw _0x49d97c;});}return _0x3c40bc;});}})['then'](respondWithResult(_0x4757bd,0xc9))[_0x6ef9('0x5c')](handleError(_0x4757bd,null));};exports[_0x6ef9('0x29')]=function(_0x3b44b4,_0x460b78){if(_0x3b44b4['body']['id']){delete _0x3b44b4[_0x6ef9('0x56')]['id'];}return db[_0x6ef9('0x4f')][_0x6ef9('0x35')]({'where':{'id':_0x3b44b4[_0x6ef9('0x60')]['id']}})['then'](handleEntityNotFound(_0x460b78,null))[_0x6ef9('0x2a')](saveUpdates(_0x3b44b4[_0x6ef9('0x56')],null))[_0x6ef9('0x2a')](respondWithResult(_0x460b78,null))[_0x6ef9('0x5c')](handleError(_0x460b78,null));};exports['destroy']=function(_0x931728,_0x2fb419){return db['VoiceQueue'][_0x6ef9('0x35')]({'where':{'id':_0x931728['params']['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x2fb419,null))['then'](removeEntity(_0x2fb419,null))['catch'](handleError(_0x2fb419,null));};exports['getHoppers']=function(_0xff24a2,_0x37a5fb,_0x541233){var _0x38749={'raw':![],'where':{}};var _0x2e39dc={};var _0x1e93ec={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x6ef9('0x61')]({'where':{'id':_0xff24a2[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x37a5fb,null))[_0x6ef9('0x2a')](function(_0x5dec13){if(_0x5dec13){_0x2e39dc['model']=_['keys'](db[_0x6ef9('0x62')][_0x6ef9('0x3c')]);_0x2e39dc[_0x6ef9('0x3f')]=_[_0x6ef9('0x40')](_0xff24a2[_0x6ef9('0x3f')]);_0x2e39dc['filters']=_['intersection'](_0x2e39dc[_0x6ef9('0x3e')],_0x2e39dc['query']);_0x38749[_0x6ef9('0x42')]=_[_0x6ef9('0x41')](_0x2e39dc[_0x6ef9('0x3e')],qs[_0x6ef9('0x43')](_0xff24a2[_0x6ef9('0x3f')][_0x6ef9('0x43')]));_0x38749[_0x6ef9('0x42')]=_0x38749['attributes'][_0x6ef9('0x44')]?_0x38749[_0x6ef9('0x42')]:_0x2e39dc[_0x6ef9('0x3e')];if(!_0xff24a2[_0x6ef9('0x3f')][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x38749['limit']=qs[_0x6ef9('0x25')](_0xff24a2[_0x6ef9('0x3f')][_0x6ef9('0x25')]);_0x38749['offset']=qs['offset'](_0xff24a2[_0x6ef9('0x3f')][_0x6ef9('0x24')]);}_0x38749['order']=qs[_0x6ef9('0x48')](_0xff24a2['query'][_0x6ef9('0x48')]);_0x38749['where']=qs[_0x6ef9('0x4a')](_[_0x6ef9('0x49')](_0xff24a2[_0x6ef9('0x3f')],_0x2e39dc['filters']));_0x38749['where'][_0x6ef9('0x63')]=_0x5dec13['id'];if(_0xff24a2[_0x6ef9('0x3f')]['filter']){_0x38749[_0x6ef9('0x4b')]=_[_0x6ef9('0x4c')](_0x38749[_0x6ef9('0x4b')],{'$or':_[_0x6ef9('0x3b')](_0x38749[_0x6ef9('0x42')],function(_0x1d2ffa){var _0x3a65fe={};_0x3a65fe[_0x1d2ffa]={'$like':'%'+_0xff24a2[_0x6ef9('0x3f')]['filter']+'%'};return _0x3a65fe;})});}_0x38749=_[_0x6ef9('0x4c')]({},_0x38749,_0xff24a2[_0x6ef9('0x4e')]);return db[_0x6ef9('0x62')]['count']({'where':_0x38749['where']})[_0x6ef9('0x2a')](function(_0x437818){_0x1e93ec[_0x6ef9('0x23')]=_0x437818;if(_0xff24a2['query'][_0x6ef9('0x50')]){_0x38749[_0x6ef9('0x51')]=[{'all':!![]}];}return db[_0x6ef9('0x62')][_0x6ef9('0x52')](_0x38749);})[_0x6ef9('0x2a')](function(_0x182d9c){_0x1e93ec[_0x6ef9('0x53')]=_0x182d9c;return _0x1e93ec;});}})[_0x6ef9('0x2a')](respondWithFilteredResult(_0x37a5fb,_0x38749))[_0x6ef9('0x5c')](handleError(_0x37a5fb,null));};exports[_0x6ef9('0x64')]=function(_0x393ad1,_0x358b6a,_0x1efaba){var _0x2842ab={'raw':!![],'where':{}};var _0x6a434={};var _0x1f293e={'count':0x0,'rows':[]};return db[_0x6ef9('0x4f')][_0x6ef9('0x61')]({'where':{'id':_0x393ad1['params']['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x358b6a,null))[_0x6ef9('0x2a')](function(_0x41dec0){if(_0x41dec0){_0x6a434[_0x6ef9('0x3e')]=_[_0x6ef9('0x40')](db[_0x6ef9('0x65')]['rawAttributes']);_0x6a434[_0x6ef9('0x3f')]=_[_0x6ef9('0x40')](_0x393ad1[_0x6ef9('0x3f')]);_0x6a434[_0x6ef9('0x4a')]=_[_0x6ef9('0x41')](_0x6a434[_0x6ef9('0x3e')],_0x6a434[_0x6ef9('0x3f')]);_0x2842ab[_0x6ef9('0x42')]=_[_0x6ef9('0x41')](_0x6a434['model'],qs[_0x6ef9('0x43')](_0x393ad1[_0x6ef9('0x3f')]['fields']));_0x2842ab[_0x6ef9('0x42')]=_0x2842ab['attributes'][_0x6ef9('0x44')]?_0x2842ab[_0x6ef9('0x42')]:_0x6a434[_0x6ef9('0x3e')];if(!_0x393ad1['query'][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x2842ab['limit']=qs[_0x6ef9('0x25')](_0x393ad1['query'][_0x6ef9('0x25')]);_0x2842ab[_0x6ef9('0x24')]=qs[_0x6ef9('0x24')](_0x393ad1[_0x6ef9('0x3f')][_0x6ef9('0x24')]);}_0x2842ab['order']=qs['sort'](_0x393ad1[_0x6ef9('0x3f')][_0x6ef9('0x48')]);_0x2842ab[_0x6ef9('0x4b')]=qs[_0x6ef9('0x4a')](_[_0x6ef9('0x49')](_0x393ad1['query'],_0x6a434[_0x6ef9('0x4a')]));_0x2842ab[_0x6ef9('0x4b')][_0x6ef9('0x63')]=_0x41dec0['id'];if(_0x393ad1[_0x6ef9('0x3f')][_0x6ef9('0x31')]){_0x2842ab[_0x6ef9('0x4b')]=_[_0x6ef9('0x4c')](_0x2842ab[_0x6ef9('0x4b')],{'$or':_[_0x6ef9('0x3b')](_0x2842ab[_0x6ef9('0x42')],function(_0x3c59d9){var _0x1b3686={};_0x1b3686[_0x3c59d9]={'$like':'%'+_0x393ad1['query'][_0x6ef9('0x31')]+'%'};return _0x1b3686;})});}_0x2842ab=_[_0x6ef9('0x4c')]({},_0x2842ab,_0x393ad1['options']);return db[_0x6ef9('0x65')]['count']({'where':_0x2842ab[_0x6ef9('0x4b')]})['then'](function(_0x183f94){_0x1f293e[_0x6ef9('0x23')]=_0x183f94;if(_0x393ad1[_0x6ef9('0x3f')][_0x6ef9('0x50')]){_0x2842ab[_0x6ef9('0x51')]=[{'all':!![]}];}return db[_0x6ef9('0x65')]['findAll'](_0x2842ab);})[_0x6ef9('0x2a')](function(_0x39591d){_0x1f293e[_0x6ef9('0x53')]=_0x39591d;return _0x1f293e;});}})[_0x6ef9('0x2a')](respondWithFilteredResult(_0x358b6a,_0x2842ab))[_0x6ef9('0x5c')](handleError(_0x358b6a,null));};exports[_0x6ef9('0x66')]=function(_0x54d840,_0x89d815,_0x1b42c4){var _0x1b31db={'raw':!![],'where':{}};var _0x1da61c={};var _0x303bd2={'count':0x0,'rows':[]};return db[_0x6ef9('0x4f')][_0x6ef9('0x61')]({'where':{'id':_0x54d840[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x89d815,null))[_0x6ef9('0x2a')](function(_0x519645){if(_0x519645){_0x1da61c[_0x6ef9('0x3e')]=_['keys'](db[_0x6ef9('0x67')][_0x6ef9('0x3c')]);_0x1da61c['query']=_[_0x6ef9('0x40')](_0x54d840['query']);_0x1da61c['filters']=_[_0x6ef9('0x41')](_0x1da61c[_0x6ef9('0x3e')],_0x1da61c[_0x6ef9('0x3f')]);_0x1b31db[_0x6ef9('0x42')]=_[_0x6ef9('0x41')](_0x1da61c['model'],qs['fields'](_0x54d840[_0x6ef9('0x3f')]['fields']));_0x1b31db[_0x6ef9('0x42')]=_0x1b31db[_0x6ef9('0x42')][_0x6ef9('0x44')]?_0x1b31db[_0x6ef9('0x42')]:_0x1da61c['model'];if(!_0x54d840[_0x6ef9('0x3f')][_0x6ef9('0x45')]('nolimit')){_0x1b31db['limit']=qs[_0x6ef9('0x25')](_0x54d840[_0x6ef9('0x3f')][_0x6ef9('0x25')]);_0x1b31db['offset']=qs['offset'](_0x54d840['query'][_0x6ef9('0x24')]);}_0x1b31db[_0x6ef9('0x47')]=qs[_0x6ef9('0x48')](_0x54d840[_0x6ef9('0x3f')][_0x6ef9('0x48')]);_0x1b31db[_0x6ef9('0x4b')]=qs['filters'](_['pick'](_0x54d840[_0x6ef9('0x3f')],_0x1da61c['filters']));_0x1b31db[_0x6ef9('0x4b')][_0x6ef9('0x63')]=_0x519645['id'];if(_0x54d840[_0x6ef9('0x3f')][_0x6ef9('0x31')]){_0x1b31db[_0x6ef9('0x4b')]=_[_0x6ef9('0x4c')](_0x1b31db[_0x6ef9('0x4b')],{'$or':_[_0x6ef9('0x3b')](_0x1b31db[_0x6ef9('0x42')],function(_0x53360f){var _0x330fe7={};_0x330fe7[_0x53360f]={'$like':'%'+_0x54d840[_0x6ef9('0x3f')][_0x6ef9('0x31')]+'%'};return _0x330fe7;})});}_0x1b31db=_[_0x6ef9('0x4c')]({},_0x1b31db,_0x54d840[_0x6ef9('0x4e')]);return db[_0x6ef9('0x67')][_0x6ef9('0x23')]({'where':_0x1b31db['where']})[_0x6ef9('0x2a')](function(_0x129cde){_0x303bd2[_0x6ef9('0x23')]=_0x129cde;if(_0x54d840[_0x6ef9('0x3f')][_0x6ef9('0x50')]){_0x1b31db[_0x6ef9('0x51')]=[{'all':!![]}];}return db[_0x6ef9('0x67')][_0x6ef9('0x52')](_0x1b31db);})['then'](function(_0x1ad31c){_0x303bd2['rows']=_0x1ad31c;return _0x303bd2;});}})['then'](respondWithFilteredResult(_0x89d815,_0x1b31db))[_0x6ef9('0x5c')](handleError(_0x89d815,null));};exports[_0x6ef9('0x68')]=function(_0x327863,_0x2e7e94,_0x1fd79d){var _0x377484={'raw':!![],'where':{}};var _0x3670c8={};var _0x31ce5e={'count':0x0,'rows':[]};return db[_0x6ef9('0x4f')][_0x6ef9('0x61')]({'where':{'id':_0x327863[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x2e7e94,null))[_0x6ef9('0x2a')](function(_0x822726){if(_0x822726){_0x3670c8[_0x6ef9('0x3e')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x3670c8[_0x6ef9('0x3f')]=_['keys'](_0x327863[_0x6ef9('0x3f')]);_0x3670c8[_0x6ef9('0x4a')]=_[_0x6ef9('0x41')](_0x3670c8['model'],_0x3670c8['query']);_0x377484[_0x6ef9('0x42')]=_[_0x6ef9('0x41')](_0x3670c8[_0x6ef9('0x3e')],qs[_0x6ef9('0x43')](_0x327863[_0x6ef9('0x3f')][_0x6ef9('0x43')]));_0x377484[_0x6ef9('0x42')]=_0x377484['attributes'][_0x6ef9('0x44')]?_0x377484['attributes']:_0x3670c8['model'];if(!_0x327863['query'][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x377484[_0x6ef9('0x25')]=qs[_0x6ef9('0x25')](_0x327863['query'][_0x6ef9('0x25')]);_0x377484['offset']=qs[_0x6ef9('0x24')](_0x327863[_0x6ef9('0x3f')][_0x6ef9('0x24')]);}_0x377484[_0x6ef9('0x47')]=qs['sort'](_0x327863[_0x6ef9('0x3f')]['sort']);_0x377484[_0x6ef9('0x4b')]=qs[_0x6ef9('0x4a')](_[_0x6ef9('0x49')](_0x327863[_0x6ef9('0x3f')],_0x3670c8['filters']));_0x377484[_0x6ef9('0x4b')][_0x6ef9('0x63')]=_0x822726['id'];if(_0x327863[_0x6ef9('0x3f')]['filter']){_0x377484[_0x6ef9('0x4b')]=_['merge'](_0x377484[_0x6ef9('0x4b')],{'$or':_['map'](_0x377484[_0x6ef9('0x42')],function(_0x3f8586){var _0x28dc29={};_0x28dc29[_0x3f8586]={'$like':'%'+_0x327863[_0x6ef9('0x3f')][_0x6ef9('0x31')]+'%'};return _0x28dc29;})});}_0x377484=_[_0x6ef9('0x4c')]({},_0x377484,_0x327863['options']);return db[_0x6ef9('0x69')][_0x6ef9('0x23')]({'where':_0x377484[_0x6ef9('0x4b')]})[_0x6ef9('0x2a')](function(_0x2efe7a){_0x31ce5e['count']=_0x2efe7a;if(_0x327863['query'][_0x6ef9('0x50')]){_0x377484[_0x6ef9('0x51')]=[{'all':!![]}];}return db[_0x6ef9('0x69')][_0x6ef9('0x52')](_0x377484);})[_0x6ef9('0x2a')](function(_0x6a517){_0x31ce5e[_0x6ef9('0x53')]=_0x6a517;return _0x31ce5e;});}})['then'](respondWithFilteredResult(_0x2e7e94,_0x377484))[_0x6ef9('0x5c')](handleError(_0x2e7e94,null));};exports[_0x6ef9('0x6a')]=function(_0x3b8884,_0x53c3af,_0x2b50f3){var _0x1c30a1={};var _0x335d72={};var _0x3f534c;var _0x3ff2f1;return db[_0x6ef9('0x4f')]['findOne']({'where':{'id':_0x3b8884[_0x6ef9('0x60')]['id']}})['then'](handleEntityNotFound(_0x53c3af,null))[_0x6ef9('0x2a')](function(_0x12f91e){if(_0x12f91e){_0x3f534c=_0x12f91e;_0x335d72[_0x6ef9('0x3e')]=_['keys'](db[_0x6ef9('0x6b')][_0x6ef9('0x3c')]);_0x335d72['query']=_[_0x6ef9('0x40')](_0x3b8884[_0x6ef9('0x3f')]);_0x335d72[_0x6ef9('0x4a')]=_['intersection'](_0x335d72[_0x6ef9('0x3e')],_0x335d72['query']);_0x1c30a1[_0x6ef9('0x42')]=_[_0x6ef9('0x41')](_0x335d72['model'],qs[_0x6ef9('0x43')](_0x3b8884[_0x6ef9('0x3f')]['fields']));_0x1c30a1[_0x6ef9('0x42')]=_0x1c30a1[_0x6ef9('0x42')]['length']?_0x1c30a1[_0x6ef9('0x42')]:_0x335d72[_0x6ef9('0x3e')];_0x1c30a1[_0x6ef9('0x47')]=qs[_0x6ef9('0x48')](_0x3b8884[_0x6ef9('0x3f')][_0x6ef9('0x48')]);_0x1c30a1['where']=qs[_0x6ef9('0x4a')](_[_0x6ef9('0x49')](_0x3b8884[_0x6ef9('0x3f')],_0x335d72[_0x6ef9('0x4a')]));if(_0x3b8884[_0x6ef9('0x3f')][_0x6ef9('0x31')]){_0x1c30a1['where']=_[_0x6ef9('0x4c')](_0x1c30a1[_0x6ef9('0x4b')],{'$or':_[_0x6ef9('0x3b')](_0x1c30a1['attributes'],function(_0x510a75){var _0x234e37={};_0x234e37[_0x510a75]={'$like':'%'+_0x3b8884[_0x6ef9('0x3f')][_0x6ef9('0x31')]+'%'};return _0x234e37;})});}_0x1c30a1=_[_0x6ef9('0x4c')]({},_0x1c30a1,_0x3b8884[_0x6ef9('0x4e')]);return _0x3f534c[_0x6ef9('0x6a')](_0x1c30a1);}})['then'](function(_0x169b39){if(_0x169b39){_0x3ff2f1=_0x169b39[_0x6ef9('0x44')];if(!_0x3b8884[_0x6ef9('0x3f')][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x1c30a1['limit']=qs['limit'](_0x3b8884[_0x6ef9('0x3f')][_0x6ef9('0x25')]);_0x1c30a1[_0x6ef9('0x24')]=qs[_0x6ef9('0x24')](_0x3b8884[_0x6ef9('0x3f')][_0x6ef9('0x24')]);}return _0x3f534c[_0x6ef9('0x6a')](_0x1c30a1);}})['then'](function(_0xc8686b){if(_0xc8686b){return _0xc8686b?{'count':_0x3ff2f1,'rows':_0xc8686b}:null;}})[_0x6ef9('0x2a')](respondWithResult(_0x53c3af,null))[_0x6ef9('0x5c')](handleError(_0x53c3af,null));};exports[_0x6ef9('0x6c')]=function(_0x55c17d,_0x21387a,_0x49d7e6){var _0xd19c58=_0x55c17d[_0x6ef9('0x56')][_0x6ef9('0x6d')];var _0xa0677e=_[_0x6ef9('0x3b')](_0xd19c58,'id');return db[_0x6ef9('0x6b')][_0x6ef9('0x52')]({'where':{'id':_0xa0677e},'attributes':['id'],'include':[{'model':db[_0x6ef9('0x6e')],'as':'Agents','attributes':['id','name',_0x6ef9('0x6f'),_0x6ef9('0x70'),_0x6ef9('0x71')],'raw':!![]}]})[_0x6ef9('0x2a')](function(_0x1f5f56){if(_0x1f5f56){var _0x2da7f1=_[_0x6ef9('0x72')](_0x1f5f56,function(_0x77aa0e){var _0x185158=_0x77aa0e['get']({'plain':!![]});_0x185158[_0x6ef9('0x73')]['forEach'](function(_0x578c88){_0x578c88[_0x6ef9('0x74')]=_[_0x6ef9('0x35')](_0xd19c58,{'id':_0x185158['id']})[_0x6ef9('0x74')];});return _0x185158[_0x6ef9('0x73')];});return db[_0x6ef9('0x4f')][_0x6ef9('0x35')]({'where':{'id':_0x55c17d['params']['id']}})[_0x6ef9('0x2a')](function(_0x4c586d){return db[_0x6ef9('0x75')]['transaction'](function(_0x54c6ac){return _0x4c586d['addTeams'](_0xa0677e,{'transaction':_0x54c6ac})[_0x6ef9('0x2a')](function(){return BPromise[_0x6ef9('0x76')](_0x2da7f1,function(_0x1f636f){return db[_0x6ef9('0x77')]['findOrCreate']({'where':{'UserId':_0x1f636f['id'],'VoiceQueueId':_0x55c17d[_0x6ef9('0x60')]['id']},'defaults':{'penalty':_0x1f636f[_0x6ef9('0x74')]},'transaction':_0x54c6ac});});})[_0x6ef9('0x2a')](function(){return BPromise[_0x6ef9('0x76')](_[_0x6ef9('0x31')](_0x2da7f1,{'online':!![]}),function(_0x19cd94){return db[_0x6ef9('0x78')][_0x6ef9('0x79')]({'membername':_0x19cd94[_0x6ef9('0x36')],'UserId':_0x19cd94['id'],'queue_name':_0x4c586d['name'],'VoiceQueueId':_0x4c586d['id'],'interface':_[_0x6ef9('0x7a')](_0x19cd94['interface'])?util[_0x6ef9('0x7b')](_0x6ef9('0x7c'),_0x19cd94['name']):_0x19cd94[_0x6ef9('0x71')],'paused':_0x19cd94['voicePause']||![],'penalty':_0x19cd94[_0x6ef9('0x74')]},{'transaction':_0x54c6ac});});})[_0x6ef9('0x2a')](function(){_0x2da7f1[_0x6ef9('0x7d')](function(_0x2d4205){socket[_0x6ef9('0x7e')]('userVoiceQueue:save',{'UserId':_0x2d4205['id'],'VoiceQueueId':_0x4c586d['id']});});});});});}})[_0x6ef9('0x2a')](respondWithStatusCode(_0x21387a,null))[_0x6ef9('0x5c')](handleError(_0x21387a,null));};exports[_0x6ef9('0x7f')]=function(_0x3dd414,_0x14292f,_0x371252){return db[_0x6ef9('0x6b')]['findAll']({'where':{'id':_0x3dd414[_0x6ef9('0x3f')][_0x6ef9('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x14292f,null))[_0x6ef9('0x2a')](function(_0x484436){var _0x133617=_[_0x6ef9('0x3b')](_0x484436,'id');var _0x1ca7e4=[];var _0x3bd3a7=[];var _0x372051=squel[_0x6ef9('0x81')]();_0x372051[_0x6ef9('0x82')](_0x6ef9('0x83'))[_0x6ef9('0x84')]('team_has_voice_queues','tq')[_0x6ef9('0x85')]('user_has_teams','ut',_0x6ef9('0x86'))[_0x6ef9('0x4b')]('VoiceQueueId\x20=\x20?',_0x3dd414['params']['id']);for(var _0x587b5f=0x0;_0x587b5f<_0x484436['length'];_0x587b5f+=0x1){let _0x6b12c0=_0x484436[_0x587b5f];for(var _0x16c006=0x0;_0x16c006<_0x6b12c0[_0x6ef9('0x73')][_0x6ef9('0x44')];_0x16c006+=0x1){let _0x47ff66=_0x6b12c0[_0x6ef9('0x73')][_0x16c006];var _0x315a33=_0x372051['clone']();_0x315a33[_0x6ef9('0x4b')]('ut.UserId\x20=\x20?',_0x47ff66['id']);_0x3bd3a7[_0x6ef9('0x87')](db[_0x6ef9('0x75')][_0x6ef9('0x3f')](_0x315a33[_0x6ef9('0x88')](),{'type':db[_0x6ef9('0x75')][_0x6ef9('0x89')][_0x6ef9('0x8a')]})[_0x6ef9('0x2a')](function(_0x12f1d4){if(_0x12f1d4[_0x6ef9('0x44')]===0x1){return _0x47ff66['id'];}else{var _0x9a6296=_[_0x6ef9('0x8b')](_[_0x6ef9('0x3b')](_0x12f1d4,_0x6ef9('0x8c')),function(_0x548797){return _[_0x6ef9('0x33')](_0x133617,_0x548797);});if(_0x9a6296){return _0x47ff66['id'];}}}));}}return BPromise[_0x6ef9('0x8d')](_0x3bd3a7)[_0x6ef9('0x2a')](function(_0x39870d){_0x1ca7e4=_(_0x1ca7e4)[_0x6ef9('0x8e')](_0x39870d)[_0x6ef9('0x8f')]()[_0x6ef9('0x32')]();return db['VoiceQueue']['find']({'where':{'id':_0x3dd414[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](function(_0x30f8a2){return db[_0x6ef9('0x75')]['transaction'](function(_0x48649d){return _0x30f8a2[_0x6ef9('0x7f')](_0x3dd414[_0x6ef9('0x3f')][_0x6ef9('0x80')],{'transaction':_0x48649d})[_0x6ef9('0x2a')](function(){if(!_[_0x6ef9('0x90')](_0x1ca7e4)){return _0x30f8a2[_0x6ef9('0x91')](_0x1ca7e4,{'transaction':_0x48649d})['then'](function(){return db[_0x6ef9('0x78')][_0x6ef9('0x2b')]({'where':{'VoiceQueueId':_0x3dd414[_0x6ef9('0x60')]['id'],'UserId':_0x1ca7e4},'transaction':_0x48649d});});}})[_0x6ef9('0x2a')](function(){_0x1ca7e4[_0x6ef9('0x7d')](function(_0x19969b){socket[_0x6ef9('0x7e')](_0x6ef9('0x92'),{'UserId':_0x19969b,'VoiceQueueId':_0x30f8a2['id']});});});});});});})['then'](respondWithStatusCode(_0x14292f,null))[_0x6ef9('0x5c')](handleError(_0x14292f,null));};exports[_0x6ef9('0x93')]=function(_0x5ddd6f,_0x3c632c,_0x180042){var _0x317089,_0x104484;return db['VoiceQueue'][_0x6ef9('0x35')]({'where':{'id':_0x5ddd6f[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x3c632c,null))[_0x6ef9('0x2a')](function(_0x428c73){if(_0x428c73){_0x104484=_0x428c73;return _0x428c73[_0x6ef9('0x93')](_0x5ddd6f[_0x6ef9('0x56')][_0x6ef9('0x80')],_['omit'](_0x5ddd6f[_0x6ef9('0x56')],[_0x6ef9('0x80'),'id'])||{})[_0x6ef9('0x94')](function(_0x1272f1){for(var _0x51f5c6=0x0;_0x51f5c6<_0x5ddd6f['body'][_0x6ef9('0x80')][_0x6ef9('0x44')];_0x51f5c6+=0x1){socket[_0x6ef9('0x7e')](_0x6ef9('0x95'),{'UserId':_0x5ddd6f['body'][_0x6ef9('0x80')][_0x51f5c6],'VoiceQueueId':_0x5ddd6f[_0x6ef9('0x60')]['id']});}return _0x1272f1;});}})[_0x6ef9('0x2a')](function(_0xb5d636){_0x317089=_0xb5d636||[];if(_0x104484){return db[_0x6ef9('0x6e')][_0x6ef9('0x52')]({'where':{'id':_0x5ddd6f['body'][_0x6ef9('0x80')]},'attributes':['id','name','online',_0x6ef9('0x70'),'interface'],'raw':!![]});}})[_0x6ef9('0x2a')](function(_0x58b83c){if(!_[_0x6ef9('0x90')](_0x58b83c)){var _0x5e46a4=[];for(var _0x123ac5=0x0;_0x123ac5<_0x58b83c[_0x6ef9('0x44')];_0x123ac5++){if(_0x58b83c[_0x123ac5]['online']){_0x5e46a4[_0x6ef9('0x87')](db[_0x6ef9('0x78')]['upsert']({'membername':_0x58b83c[_0x123ac5][_0x6ef9('0x36')],'UserId':_0x58b83c[_0x123ac5]['id'],'queue_name':_0x104484['name'],'VoiceQueueId':_0x104484['id'],'interface':_[_0x6ef9('0x7a')](_0x58b83c[_0x123ac5][_0x6ef9('0x71')])?util[_0x6ef9('0x7b')]('SIP/%s',_0x58b83c[_0x123ac5][_0x6ef9('0x36')]):_0x58b83c[_0x123ac5][_0x6ef9('0x71')],'paused':_0x58b83c[_0x123ac5][_0x6ef9('0x70')]||![],'penalty':_0x5ddd6f[_0x6ef9('0x56')][_0x6ef9('0x74')]||0x0}));}}return BPromise[_0x6ef9('0x8d')](_0x5e46a4);}})['then'](function(){return _0x317089;})[_0x6ef9('0x2a')](respondWithResult(_0x3c632c,null))['catch'](handleError(_0x3c632c,null));};exports[_0x6ef9('0x91')]=function(_0x44f86a,_0x449ce8,_0x2dcfb9){return db['VoiceQueue'][_0x6ef9('0x35')]({'where':{'id':_0x44f86a['params']['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x449ce8,null))[_0x6ef9('0x2a')](function(_0x44dd13){if(_0x44dd13){return _0x44dd13[_0x6ef9('0x91')](_0x44f86a['query'][_0x6ef9('0x80')])[_0x6ef9('0x2a')](function(){if(_[_0x6ef9('0x96')](_0x44f86a['query']['ids'])){for(var _0x319ed4=0x0;_0x319ed4<_0x44f86a[_0x6ef9('0x3f')][_0x6ef9('0x80')][_0x6ef9('0x44')];_0x319ed4+=0x1){socket[_0x6ef9('0x7e')](_0x6ef9('0x92'),{'UserId':Number(_0x44f86a['query'][_0x6ef9('0x80')][_0x319ed4]),'VoiceQueueId':Number(_0x44f86a['params']['id'])});}}else{socket['emit'](_0x6ef9('0x92'),{'UserId':Number(_0x44f86a[_0x6ef9('0x3f')][_0x6ef9('0x80')]),'VoiceQueueId':Number(_0x44f86a[_0x6ef9('0x60')]['id'])});}});}})['then'](function(_0x241a5e){return db[_0x6ef9('0x78')]['destroy']({'where':{'VoiceQueueId':_0x44f86a['params']['id'],'UserId':_0x44f86a[_0x6ef9('0x3f')][_0x6ef9('0x80')]}})[_0x6ef9('0x2a')](function(){return _0x241a5e;});})[_0x6ef9('0x2a')](respondWithStatusCode(_0x449ce8,null))[_0x6ef9('0x5c')](handleError(_0x449ce8,null));};exports[_0x6ef9('0x97')]=function(_0x479f14,_0x249592,_0x4598c0){var _0x32a7cb={};var _0x49f2ad={};var _0x4de410;var _0x5dfa85;return db['VoiceQueue']['findOne']({'where':{'id':_0x479f14['params']['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x249592,null))[_0x6ef9('0x2a')](function(_0x2f809e){if(_0x2f809e){_0x4de410=_0x2f809e;_0x49f2ad[_0x6ef9('0x3e')]=_['keys'](db[_0x6ef9('0x6e')][_0x6ef9('0x3c')]);_0x49f2ad[_0x6ef9('0x3f')]=_['keys'](_0x479f14[_0x6ef9('0x3f')]);_0x49f2ad[_0x6ef9('0x4a')]=_[_0x6ef9('0x41')](_0x49f2ad[_0x6ef9('0x3e')],_0x49f2ad[_0x6ef9('0x3f')]);_0x32a7cb[_0x6ef9('0x42')]=_['intersection'](_0x49f2ad[_0x6ef9('0x3e')],qs['fields'](_0x479f14[_0x6ef9('0x3f')]['fields']));_0x32a7cb[_0x6ef9('0x42')]=_0x32a7cb['attributes'][_0x6ef9('0x44')]?_0x32a7cb[_0x6ef9('0x42')]:_0x49f2ad[_0x6ef9('0x3e')];_0x32a7cb[_0x6ef9('0x47')]=qs[_0x6ef9('0x48')](_0x479f14[_0x6ef9('0x3f')][_0x6ef9('0x48')]);_0x32a7cb[_0x6ef9('0x4b')]=qs[_0x6ef9('0x4a')](_[_0x6ef9('0x49')](_0x479f14['query'],_0x49f2ad[_0x6ef9('0x4a')]));if(_0x479f14[_0x6ef9('0x3f')]['filter']){_0x32a7cb[_0x6ef9('0x4b')]=_['merge'](_0x32a7cb[_0x6ef9('0x4b')],{'$or':_[_0x6ef9('0x3b')](_0x32a7cb[_0x6ef9('0x42')],function(_0x2638ca){var _0x5066d3={};_0x5066d3[_0x2638ca]={'$like':'%'+_0x479f14['query']['filter']+'%'};return _0x5066d3;})});}_0x32a7cb=_[_0x6ef9('0x4c')]({},_0x32a7cb,_0x479f14[_0x6ef9('0x4e')]);return _0x4de410[_0x6ef9('0x97')](_0x32a7cb);}})[_0x6ef9('0x2a')](function(_0x230063){if(_0x230063){_0x5dfa85=_0x230063['length'];if(!_0x479f14[_0x6ef9('0x3f')][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x32a7cb['limit']=qs[_0x6ef9('0x25')](_0x479f14['query'][_0x6ef9('0x25')]);_0x32a7cb[_0x6ef9('0x24')]=qs[_0x6ef9('0x24')](_0x479f14[_0x6ef9('0x3f')][_0x6ef9('0x24')]);}return _0x4de410[_0x6ef9('0x97')](_0x32a7cb);}})[_0x6ef9('0x2a')](function(_0x58d20a){if(_0x58d20a){return _0x58d20a?{'count':_0x5dfa85,'rows':_0x58d20a}:null;}})[_0x6ef9('0x2a')](respondWithResult(_0x249592,null))[_0x6ef9('0x5c')](handleError(_0x249592,null));};exports['getMembers']=function(_0x500493,_0x28cbe9,_0x3646f0){var _0x3d2b63={};var _0x5effde={};var _0x10bbae;var _0x261b9c;return db['VoiceQueue'][_0x6ef9('0x61')]({'where':{'id':_0x500493['params']['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x28cbe9,null))['then'](function(_0x2fed29){if(_0x2fed29){_0x10bbae=_0x2fed29;_0x5effde['model']=_[_0x6ef9('0x40')](db['UserVoiceQueueRt'][_0x6ef9('0x3c')]);_0x5effde[_0x6ef9('0x3f')]=_[_0x6ef9('0x40')](_0x500493[_0x6ef9('0x3f')]);_0x5effde[_0x6ef9('0x4a')]=_[_0x6ef9('0x41')](_0x5effde[_0x6ef9('0x3e')],_0x5effde[_0x6ef9('0x3f')]);_0x3d2b63['attributes']=_[_0x6ef9('0x41')](_0x5effde['model'],qs[_0x6ef9('0x43')](_0x500493[_0x6ef9('0x3f')][_0x6ef9('0x43')]));_0x3d2b63[_0x6ef9('0x42')]=_0x3d2b63[_0x6ef9('0x42')][_0x6ef9('0x44')]?_0x3d2b63[_0x6ef9('0x42')]:_0x5effde[_0x6ef9('0x3e')];_0x3d2b63[_0x6ef9('0x47')]=qs[_0x6ef9('0x48')](_0x500493['query'][_0x6ef9('0x48')]);_0x3d2b63[_0x6ef9('0x4b')]=qs['filters'](_[_0x6ef9('0x49')](_0x500493[_0x6ef9('0x3f')],_0x5effde[_0x6ef9('0x4a')]));if(_0x500493[_0x6ef9('0x3f')][_0x6ef9('0x31')]){_0x3d2b63['where']=_['merge'](_0x3d2b63['where'],{'$or':_[_0x6ef9('0x3b')](_0x3d2b63[_0x6ef9('0x42')],function(_0x32a8dd){var _0x120679={};_0x120679[_0x32a8dd]={'$like':'%'+_0x500493[_0x6ef9('0x3f')][_0x6ef9('0x31')]+'%'};return _0x120679;})});}_0x3d2b63=_[_0x6ef9('0x4c')]({},_0x3d2b63,_0x500493[_0x6ef9('0x4e')]);return _0x10bbae[_0x6ef9('0x98')](_0x3d2b63);}})[_0x6ef9('0x2a')](function(_0x1d1139){if(_0x1d1139){_0x261b9c=_0x1d1139['length'];if(!_0x500493[_0x6ef9('0x3f')][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x3d2b63['limit']=qs[_0x6ef9('0x25')](_0x500493[_0x6ef9('0x3f')][_0x6ef9('0x25')]);_0x3d2b63[_0x6ef9('0x24')]=qs['offset'](_0x500493['query'][_0x6ef9('0x24')]);}return _0x10bbae['getMembers'](_0x3d2b63);}})[_0x6ef9('0x2a')](function(_0x4ba340){return _0x4ba340?{'count':_0x261b9c,'rows':_0x4ba340}:null;})['then'](respondWithResult(_0x28cbe9,null))['catch'](handleError(_0x28cbe9,null));};exports[_0x6ef9('0x99')]=function(_0x36c4a8,_0x55f145,_0x10e7b0){var _0x95cef4={};var _0x38014a={};var _0x5bd2e3;var _0x106f6a;return db[_0x6ef9('0x4f')][_0x6ef9('0x61')]({'where':{'id':_0x36c4a8[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x55f145,null))[_0x6ef9('0x2a')](function(_0x5ab67b){if(_0x5ab67b){_0x5bd2e3=_0x5ab67b;_0x38014a['model']=_[_0x6ef9('0x40')](db[_0x6ef9('0x9a')][_0x6ef9('0x3c')]);_0x38014a['query']=_[_0x6ef9('0x40')](_0x36c4a8['query']);_0x38014a[_0x6ef9('0x4a')]=_['intersection'](_0x38014a[_0x6ef9('0x3e')],_0x38014a[_0x6ef9('0x3f')]);_0x95cef4[_0x6ef9('0x42')]=_[_0x6ef9('0x41')](_0x38014a[_0x6ef9('0x3e')],qs[_0x6ef9('0x43')](_0x36c4a8['query']['fields']));_0x95cef4['attributes']=_0x95cef4['attributes'][_0x6ef9('0x44')]?_0x95cef4[_0x6ef9('0x42')]:_0x38014a[_0x6ef9('0x3e')];_0x95cef4[_0x6ef9('0x47')]=qs['sort'](_0x36c4a8[_0x6ef9('0x3f')][_0x6ef9('0x48')]);_0x95cef4[_0x6ef9('0x4b')]=qs[_0x6ef9('0x4a')](_[_0x6ef9('0x49')](_0x36c4a8[_0x6ef9('0x3f')],_0x38014a['filters']));if(_0x36c4a8[_0x6ef9('0x3f')][_0x6ef9('0x31')]){_0x95cef4[_0x6ef9('0x4b')]=_[_0x6ef9('0x4c')](_0x95cef4[_0x6ef9('0x4b')],{'$or':_[_0x6ef9('0x3b')](_0x95cef4[_0x6ef9('0x42')],function(_0x319e2d){var _0x324379={};_0x324379[_0x319e2d]={'$like':'%'+_0x36c4a8['query'][_0x6ef9('0x31')]+'%'};return _0x324379;})});}_0x95cef4=_[_0x6ef9('0x4c')]({},_0x95cef4,_0x36c4a8[_0x6ef9('0x4e')]);return _0x5bd2e3[_0x6ef9('0x99')](_0x95cef4);}})[_0x6ef9('0x2a')](function(_0x3c8b82){if(_0x3c8b82){_0x106f6a=_0x3c8b82[_0x6ef9('0x44')];if(!_0x36c4a8['query'][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x95cef4['limit']=qs['limit'](_0x36c4a8[_0x6ef9('0x3f')]['limit']);_0x95cef4[_0x6ef9('0x24')]=qs[_0x6ef9('0x24')](_0x36c4a8[_0x6ef9('0x3f')][_0x6ef9('0x24')]);}return _0x5bd2e3['getLists'](_0x95cef4);}})['then'](function(_0x54823c){if(_0x54823c){return _0x54823c?{'count':_0x106f6a,'rows':_0x54823c}:null;}})['then'](respondWithResult(_0x55f145,null))[_0x6ef9('0x5c')](handleError(_0x55f145,null));};exports[_0x6ef9('0x9b')]=function(_0x2c5e81,_0xb71240,_0x3f5f98){var _0x2c11f5,_0x539c46;return db['VoiceQueue'][_0x6ef9('0x35')]({'where':{'id':_0x2c5e81[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0xb71240,null))['then'](function(_0x3166d2){if(_0x3166d2){_0x539c46=_0x3166d2;return _0x3166d2[_0x6ef9('0x9b')](_0x2c5e81[_0x6ef9('0x56')][_0x6ef9('0x80')],_[_0x6ef9('0x5d')](_0x2c5e81['body'],[_0x6ef9('0x80'),'id'])||{});}return null;})[_0x6ef9('0x94')](function(_0x3f6463){var _0x398f25;_0x2c11f5=_0x3f6463||[];var _0x22c00d=[];if(_0x3f6463){for(var _0x3c922e=0x0;_0x3c922e<_0x3f6463[_0x6ef9('0x44')];_0x3c922e+=0x1){var _0x4f096e=_0x3f6463[_0x3c922e][_0x6ef9('0x2c')]({'plain':!![]});_0x539c46[_0x6ef9('0x9c')]=_0x2c5e81[_0x6ef9('0x56')]['dialCheckDuplicateType']?_0x2c5e81[_0x6ef9('0x56')]['dialCheckDuplicateType']:_0x539c46['dialCheckDuplicateType'];switch(_0x539c46[_0x6ef9('0x9c')]){case _0x6ef9('0x9d'):_0x398f25=squel[_0x6ef9('0x9e')]()['into']('cm_hopper')[_0x6ef9('0x9f')](['phone',_0x6ef9('0xa0'),_0x6ef9('0xa1'),'ListId','VoiceQueueId',_0x6ef9('0x5e'),_0x6ef9('0x5f')],squel[_0x6ef9('0x81')]()[_0x6ef9('0x82')]('phone',_0x6ef9('0xa2'))[_0x6ef9('0x82')](_0x6ef9('0xa3'),'scheduledAt')[_0x6ef9('0x82')]('id',_0x6ef9('0xa1'))['field'](_0x4f096e['CmListId']['toString'](),_0x6ef9('0xa4'))[_0x6ef9('0x82')](_0x2c5e81['params']['id']['toString'](),_0x6ef9('0x63'))[_0x6ef9('0x82')](_0x6ef9('0xa3'),'createdAt')[_0x6ef9('0x82')](_0x6ef9('0xa3'),_0x6ef9('0x5f'))['from'](_0x6ef9('0xa5'))[_0x6ef9('0x4b')](_0x6ef9('0xa6'))[_0x6ef9('0x4b')](_0x6ef9('0xa7'),_0x4f096e['CmListId'][_0x6ef9('0x88')]())[_0x6ef9('0x4b')](_0x6ef9('0xa8'))[_0x6ef9('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6ef9('0x81')]()[_0x6ef9('0x82')](_0x6ef9('0xa9'))[_0x6ef9('0x84')](_0x6ef9('0xaa'))[_0x6ef9('0x4b')]('VoiceQueueId\x20=\x20?',_0x2c5e81['params']['id'][_0x6ef9('0x88')]()))['where'](_0x6ef9('0xab'),squel[_0x6ef9('0x81')]()[_0x6ef9('0x82')](_0x6ef9('0xac'))['from']('cm_hopper')[_0x6ef9('0x4b')](_0x6ef9('0xad'),_0x2c5e81['params']['id'][_0x6ef9('0x88')]())))['toString']();break;case _0x6ef9('0xae'):_0x398f25=squel['insert']()[_0x6ef9('0xaf')](_0x6ef9('0xb0'))['fromQuery']([_0x6ef9('0xa2'),_0x6ef9('0xa0'),_0x6ef9('0xa1'),'ListId',_0x6ef9('0x63'),'createdAt',_0x6ef9('0x5f')],squel['select']()['field'](_0x6ef9('0xa2'),'phone')[_0x6ef9('0x82')](_0x6ef9('0xa3'),_0x6ef9('0xa0'))['field']('id',_0x6ef9('0xa1'))[_0x6ef9('0x82')](_0x4f096e['CmListId'][_0x6ef9('0x88')](),_0x6ef9('0xa4'))[_0x6ef9('0x82')](_0x2c5e81[_0x6ef9('0x60')]['id']['toString'](),_0x6ef9('0x63'))['field'](_0x6ef9('0xa3'),_0x6ef9('0x5e'))['field'](_0x6ef9('0xa3'),_0x6ef9('0x5f'))['from'](_0x6ef9('0xa5'))[_0x6ef9('0x4b')]('deletedAt\x20IS\x20NULL')[_0x6ef9('0x4b')](_0x6ef9('0xa7'),_0x4f096e['CmListId'][_0x6ef9('0x88')]())[_0x6ef9('0x4b')](_0x6ef9('0xa8'))[_0x6ef9('0x4b')](_0x6ef9('0xab'),squel['select']()[_0x6ef9('0x82')](_0x6ef9('0xac'))['from'](_0x6ef9('0xb0'))['where'](_0x6ef9('0xad'),_0x2c5e81[_0x6ef9('0x60')]['id'][_0x6ef9('0x88')]())))[_0x6ef9('0x88')]();break;default:_0x398f25=squel[_0x6ef9('0x9e')]()[_0x6ef9('0xaf')]('cm_hopper')[_0x6ef9('0x9f')]([_0x6ef9('0xa2'),_0x6ef9('0xa0'),_0x6ef9('0xa1'),_0x6ef9('0xa4'),'VoiceQueueId',_0x6ef9('0x5e'),'updatedAt'],squel[_0x6ef9('0x81')]()['field']('phone',_0x6ef9('0xa2'))['field'](_0x6ef9('0xa3'),'scheduledAt')['field']('id',_0x6ef9('0xa1'))[_0x6ef9('0x82')](_0x4f096e['CmListId'][_0x6ef9('0x88')](),_0x6ef9('0xa4'))[_0x6ef9('0x82')](_0x2c5e81[_0x6ef9('0x60')]['id'][_0x6ef9('0x88')](),_0x6ef9('0x63'))[_0x6ef9('0x82')](_0x6ef9('0xa3'),_0x6ef9('0x5e'))['field'](_0x6ef9('0xa3'),_0x6ef9('0x5f'))[_0x6ef9('0x84')](_0x6ef9('0xa5'))[_0x6ef9('0x4b')](_0x6ef9('0xa6'))[_0x6ef9('0x4b')](_0x6ef9('0xa7'),_0x4f096e[_0x6ef9('0xb1')][_0x6ef9('0x88')]())[_0x6ef9('0x4b')](_0x6ef9('0xa8')))[_0x6ef9('0x88')]();}_0x22c00d['push'](db['sequelize'][_0x6ef9('0x3f')](_0x398f25));}return BPromise[_0x6ef9('0x8d')](_0x22c00d);}})['then'](function(){return _0x2c11f5;})['then'](respondWithResult(_0xb71240,null))[_0x6ef9('0x5c')](handleError(_0xb71240,null));};exports[_0x6ef9('0xb2')]=function(_0x321cd1,_0x41c2bc,_0x2b37a5){return db[_0x6ef9('0x4f')][_0x6ef9('0x35')]({'where':{'id':_0x321cd1[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x41c2bc,null))[_0x6ef9('0x2a')](function(_0x20ea8b){if(_0x20ea8b){return _0x20ea8b[_0x6ef9('0xb2')](_0x321cd1[_0x6ef9('0x3f')][_0x6ef9('0x80')]);}})[_0x6ef9('0x2a')](function(_0x8747dd){if(_0x8747dd){return db[_0x6ef9('0x62')][_0x6ef9('0x2b')]({'where':{'ListId':_0x321cd1[_0x6ef9('0x3f')][_0x6ef9('0x80')],'VoiceQueueId':_0x321cd1['params']['id']}})[_0x6ef9('0x2a')](function(){return _0x8747dd;});}})[_0x6ef9('0x2a')](respondWithStatusCode(_0x41c2bc,null))[_0x6ef9('0x5c')](handleError(_0x41c2bc,null));};exports[_0x6ef9('0xb3')]=function(_0x56a48b,_0x2578dc,_0x3e82a5){var _0x546a0e={};var _0x30e033={};var _0x56934f;var _0x7b11f4;return db[_0x6ef9('0x4f')][_0x6ef9('0x61')]({'where':{'id':_0x56a48b[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x2578dc,null))[_0x6ef9('0x2a')](function(_0x3732fd){if(_0x3732fd){_0x56934f=_0x3732fd;_0x30e033['model']=_[_0x6ef9('0x40')](db[_0x6ef9('0x9a')][_0x6ef9('0x3c')]);_0x30e033[_0x6ef9('0x3f')]=_[_0x6ef9('0x40')](_0x56a48b[_0x6ef9('0x3f')]);_0x30e033[_0x6ef9('0x4a')]=_[_0x6ef9('0x41')](_0x30e033[_0x6ef9('0x3e')],_0x30e033[_0x6ef9('0x3f')]);_0x546a0e[_0x6ef9('0x42')]=_[_0x6ef9('0x41')](_0x30e033['model'],qs['fields'](_0x56a48b[_0x6ef9('0x3f')][_0x6ef9('0x43')]));_0x546a0e[_0x6ef9('0x42')]=_0x546a0e[_0x6ef9('0x42')][_0x6ef9('0x44')]?_0x546a0e[_0x6ef9('0x42')]:_0x30e033['model'];_0x546a0e[_0x6ef9('0x47')]=qs['sort'](_0x56a48b[_0x6ef9('0x3f')][_0x6ef9('0x48')]);_0x546a0e[_0x6ef9('0x4b')]=qs['filters'](_[_0x6ef9('0x49')](_0x56a48b[_0x6ef9('0x3f')],_0x30e033['filters']));if(_0x56a48b[_0x6ef9('0x3f')][_0x6ef9('0x31')]){_0x546a0e[_0x6ef9('0x4b')]=_['merge'](_0x546a0e[_0x6ef9('0x4b')],{'$or':_['map'](_0x546a0e['attributes'],function(_0x593e64){var _0x2f6a2c={};_0x2f6a2c[_0x593e64]={'$like':'%'+_0x56a48b[_0x6ef9('0x3f')][_0x6ef9('0x31')]+'%'};return _0x2f6a2c;})});}_0x546a0e=_[_0x6ef9('0x4c')]({},_0x546a0e,_0x56a48b['options']);return _0x56934f[_0x6ef9('0xb3')](_0x546a0e);}})[_0x6ef9('0x2a')](function(_0x305177){if(_0x305177){_0x7b11f4=_0x305177[_0x6ef9('0x44')];if(!_0x56a48b[_0x6ef9('0x3f')][_0x6ef9('0x45')](_0x6ef9('0x46'))){_0x546a0e[_0x6ef9('0x25')]=qs['limit'](_0x56a48b[_0x6ef9('0x3f')]['limit']);_0x546a0e[_0x6ef9('0x24')]=qs[_0x6ef9('0x24')](_0x56a48b['query'][_0x6ef9('0x24')]);}return _0x56934f['getBlackLists'](_0x546a0e);}})[_0x6ef9('0x2a')](function(_0x397a0c){if(_0x397a0c){return _0x397a0c?{'count':_0x7b11f4,'rows':_0x397a0c}:null;}})[_0x6ef9('0x2a')](respondWithResult(_0x2578dc,null))[_0x6ef9('0x5c')](handleError(_0x2578dc,null));};exports['addBlackLists']=function(_0x1b23e4,_0x8ea566,_0x37c348){var _0x28634e,_0x4aa1fc;return db[_0x6ef9('0x4f')][_0x6ef9('0x35')]({'where':{'id':_0x1b23e4[_0x6ef9('0x60')]['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x8ea566,null))['then'](function(_0x5a44ab){if(_0x5a44ab){_0x4aa1fc=_0x5a44ab;return _0x5a44ab[_0x6ef9('0xb4')](_0x1b23e4[_0x6ef9('0x56')]['ids'],_[_0x6ef9('0x5d')](_0x1b23e4[_0x6ef9('0x56')],[_0x6ef9('0x80'),'id'])||{});}return null;})['spread'](function(_0x47d6a6){var _0x5b92dc;_0x28634e=_0x47d6a6||[];var _0x52d21d=[];if(_0x47d6a6){for(var _0x2028d2=0x0;_0x2028d2<_0x47d6a6['length'];_0x2028d2+=0x1){var _0xb13a20=_0x47d6a6[_0x2028d2]['get']({'plain':!![]});_0x5b92dc=squel[_0x6ef9('0x9e')]()[_0x6ef9('0xaf')](_0x6ef9('0xb5'))['fromQuery']([_0x6ef9('0xa2'),_0x6ef9('0xa1'),'ListId',_0x6ef9('0x63'),_0x6ef9('0x5e'),_0x6ef9('0x5f')],squel[_0x6ef9('0x81')]()['field'](_0x6ef9('0xa2'),_0x6ef9('0xa2'))[_0x6ef9('0x82')]('id',_0x6ef9('0xa1'))['field'](_0xb13a20[_0x6ef9('0xb1')]['toString'](),_0x6ef9('0xa4'))[_0x6ef9('0x82')](_0x1b23e4['params']['id'][_0x6ef9('0x88')](),_0x6ef9('0x63'))['field'](_0x6ef9('0xa3'),_0x6ef9('0x5e'))[_0x6ef9('0x82')](_0x6ef9('0xa3'),'updatedAt')[_0x6ef9('0x84')](_0x6ef9('0xa5'))['where']('deletedAt\x20IS\x20NULL')[_0x6ef9('0x4b')](_0x6ef9('0xa7'),_0xb13a20[_0x6ef9('0xb1')][_0x6ef9('0x88')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x6ef9('0x88')]();_0x52d21d[_0x6ef9('0x87')](db[_0x6ef9('0x75')]['query'](_0x5b92dc));}return BPromise['all'](_0x52d21d);}})['then'](function(){return _0x28634e;})['then'](respondWithResult(_0x8ea566,null))[_0x6ef9('0x5c')](handleError(_0x8ea566,null));};exports['removeBlackLists']=function(_0x55f5ce,_0x165839,_0x220a8d){return db[_0x6ef9('0x4f')][_0x6ef9('0x35')]({'where':{'id':_0x55f5ce['params']['id']}})[_0x6ef9('0x2a')](handleEntityNotFound(_0x165839,null))[_0x6ef9('0x2a')](function(_0x5e29ee){if(_0x5e29ee){return _0x5e29ee[_0x6ef9('0xb6')](_0x55f5ce[_0x6ef9('0x3f')][_0x6ef9('0x80')]);}})['then'](function(_0xcd5c3a){if(_0xcd5c3a){return db['CmHopperBlack'][_0x6ef9('0x2b')]({'where':{'ListId':_0x55f5ce[_0x6ef9('0x3f')][_0x6ef9('0x80')],'VoiceQueueId':_0x55f5ce['params']['id']}})[_0x6ef9('0x2a')](function(){return _0xcd5c3a;});}})['then'](respondWithStatusCode(_0x165839,null))[_0x6ef9('0x5c')](handleError(_0x165839,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index ffedfe6..24c7fc6 100644 --- a/server/api/voiceQueue/voiceQueue.events.js +++ b/server/api/voiceQueue/voiceQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2df=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xf2df,0x167));var _0xff2d=function(_0x475cb3,_0x36d9c3){_0x475cb3=_0x475cb3-0x0;var _0x368ee2=_0xf2df[_0x475cb3];return _0x368ee2;};'use strict';var EventEmitter=require(_0xff2d('0x0'));var VoiceQueue=require(_0xff2d('0x1'))['db'][_0xff2d('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xff2d('0x3')](0x0);var events={'afterCreate':_0xff2d('0x4'),'afterUpdate':_0xff2d('0x5'),'afterDestroy':_0xff2d('0x6')};function emitEvent(_0x3923a8){return function(_0x3ea18b,_0x164ac7,_0x286aa8){VoiceQueueEvents[_0xff2d('0x7')](_0x3923a8+':'+_0x3ea18b['id'],_0x3ea18b);VoiceQueueEvents[_0xff2d('0x7')](_0x3923a8,_0x3ea18b);_0x286aa8(null);};}for(var e in events){if(events[_0xff2d('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xff2d('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xee91=['emit','hasOwnProperty','hook','exports','../../mysqldb','update','remove'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xee91,0x13f));var _0x1ee9=function(_0x30093f,_0x170ac7){_0x30093f=_0x30093f-0x0;var _0x328fb6=_0xee91[_0x30093f];return _0x328fb6;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x1ee9('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ee9('0x1'),'afterDestroy':_0x1ee9('0x2')};function emitEvent(_0x5ec9ab){return function(_0x5b860a,_0x235dd0,_0x4d3512){VoiceQueueEvents[_0x1ee9('0x3')](_0x5ec9ab+':'+_0x5b860a['id'],_0x5b860a);VoiceQueueEvents['emit'](_0x5ec9ab,_0x5b860a);_0x4d3512(null);};}for(var e in events){if(events[_0x1ee9('0x4')](e)){var event=events[e];VoiceQueue[_0x1ee9('0x5')](e,emitEvent(event));}}module[_0x1ee9('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 8b2d815..fe8ebe5 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b1b=['moment','request-promise','path','rimraf','./voiceQueue.attributes','exports','define','voice_queues','../../config/logger','api'];(function(_0x274878,_0x322224){var _0x10c5ff=function(_0x19292a){while(--_0x19292a){_0x274878['push'](_0x274878['shift']());}};_0x10c5ff(++_0x322224);}(_0x4b1b,0x1ac));var _0xb4b1=function(_0x658464,_0x266565){_0x658464=_0x658464-0x0;var _0x588558=_0x4b1b[_0x658464];return _0x588558;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb4b1('0x0'))(_0xb4b1('0x1'));var moment=require(_0xb4b1('0x2'));var BPromise=require('bluebird');var rp=require(_0xb4b1('0x3'));var fs=require('fs');var path=require(_0xb4b1('0x4'));var rimraf=require(_0xb4b1('0x5'));var config=require('../../config/environment');var attributes=require(_0xb4b1('0x6'));module[_0xb4b1('0x7')]=function(_0x11ec04,_0xf3b8fb){return _0x11ec04[_0xb4b1('0x8')]('VoiceQueue',attributes,{'tableName':_0xb4b1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4c7=['exports','define','voice_queues','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceQueue.attributes'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xd4c7,0xb3));var _0x7d4c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd4c7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x7d4c('0x0'));var logger=require(_0x7d4c('0x1'))(_0x7d4c('0x2'));var moment=require(_0x7d4c('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d4c('0x4'));var fs=require('fs');var path=require(_0x7d4c('0x5'));var rimraf=require('rimraf');var config=require(_0x7d4c('0x6'));var attributes=require(_0x7d4c('0x7'));module[_0x7d4c('0x8')]=function(_0x4255e0,_0x1de77f){return _0x4255e0[_0x7d4c('0x9')]('VoiceQueue',attributes,{'tableName':_0x7d4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index a39ece1..94359be 100644 --- a/server/api/voiceQueue/voiceQueue.rpc.js +++ b/server/api/voiceQueue/voiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa012=['redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceQueue','VoiceQueue','findAll','raw','options','where','attributes','include','map','model','catch','find','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x49c9b7,_0x11e7ef){var _0x376f75=function(_0x2e9ce4){while(--_0x2e9ce4){_0x49c9b7['push'](_0x49c9b7['shift']());}};_0x376f75(++_0x11e7ef);}(_0xa012,0x134));var _0x2a01=function(_0x5b4972,_0x464200){_0x5b4972=_0x5b4972-0x0;var _0x6df520=_0xa012[_0x5b4972];return _0x6df520;};'use strict';var _=require('lodash');var util=require(_0x2a01('0x0'));var moment=require(_0x2a01('0x1'));var BPromise=require(_0x2a01('0x2'));var rs=require(_0x2a01('0x3'));var fs=require('fs');var Redis=require(_0x2a01('0x4'));var db=require(_0x2a01('0x5'))['db'];var utils=require(_0x2a01('0x6'));var logger=require(_0x2a01('0x7'))(_0x2a01('0x8'));var config=require(_0x2a01('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2a01('0xa')][_0x2a01('0xb')]({'port':0x232a});config[_0x2a01('0xc')]=_['defaults'](config[_0x2a01('0xc')],{'host':_0x2a01('0xd'),'port':0x18eb});var socket=require(_0x2a01('0xe'))(new Redis(config['redis']));require(_0x2a01('0xf'))[_0x2a01('0x10')](socket);function respondWithRpcPromise(_0x5038a4,_0x263e0,_0x3a4e4a){return new BPromise(function(_0x2843c6,_0x5028f0){return client['request'](_0x5038a4,_0x3a4e4a)[_0x2a01('0x11')](function(_0x27587a){logger[_0x2a01('0x12')](_0x2a01('0x13'),_0x263e0,_0x2a01('0x14'));logger[_0x2a01('0x15')](_0x2a01('0x16'),_0x263e0,_0x2a01('0x14'),JSON[_0x2a01('0x17')](_0x27587a));if(_0x27587a[_0x2a01('0x18')]){if(_0x27587a[_0x2a01('0x18')][_0x2a01('0x19')]===0x1f4){logger[_0x2a01('0x18')](_0x2a01('0x13'),_0x263e0,_0x27587a['error'][_0x2a01('0x1a')]);return _0x5028f0(_0x27587a[_0x2a01('0x18')]['message']);}logger[_0x2a01('0x18')](_0x2a01('0x13'),_0x263e0,_0x27587a[_0x2a01('0x18')]['message']);return _0x2843c6(_0x27587a[_0x2a01('0x18')]['message']);}else{logger[_0x2a01('0x12')](_0x2a01('0x13'),_0x263e0,_0x2a01('0x14'));_0x2843c6(_0x27587a['result'][_0x2a01('0x1a')]);}})['catch'](function(_0x29c0ac){logger[_0x2a01('0x18')](_0x2a01('0x13'),_0x263e0,_0x29c0ac);_0x5028f0(_0x29c0ac);});});}exports[_0x2a01('0x1b')]=function(_0x2ce779){var _0x45ff03=this;return new Promise(function(_0x50eed6,_0x262452){return db[_0x2a01('0x1c')][_0x2a01('0x1d')]({'raw':_0x2ce779['options']?_0x2ce779['options'][_0x2a01('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ce779[_0x2a01('0x1f')]?_0x2ce779[_0x2a01('0x1f')][_0x2a01('0x20')]||null:null,'attributes':_0x2ce779[_0x2a01('0x1f')]?_0x2ce779[_0x2a01('0x1f')][_0x2a01('0x21')]||null:null,'limit':_0x2ce779['options']?_0x2ce779[_0x2a01('0x1f')]['limit']||null:null,'include':_0x2ce779[_0x2a01('0x1f')]?_0x2ce779[_0x2a01('0x1f')][_0x2a01('0x22')]?_[_0x2a01('0x23')](_0x2ce779[_0x2a01('0x1f')][_0x2a01('0x22')],function(_0x2b84ab){return{'model':db[_0x2b84ab['model']],'as':_0x2b84ab['as'],'attributes':_0x2b84ab[_0x2a01('0x21')],'include':_0x2b84ab[_0x2a01('0x22')]?_[_0x2a01('0x23')](_0x2b84ab[_0x2a01('0x22')],function(_0x503ea7){return{'model':db[_0x503ea7[_0x2a01('0x24')]],'as':_0x503ea7['as'],'attributes':_0x503ea7[_0x2a01('0x21')],'include':_0x503ea7[_0x2a01('0x22')]?_[_0x2a01('0x23')](_0x503ea7[_0x2a01('0x22')],function(_0x3457c7){return{'model':db[_0x3457c7['model']],'as':_0x3457c7['as'],'attributes':_0x3457c7[_0x2a01('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2a01('0x11')](function(_0x300ae9){logger[_0x2a01('0x12')]('GetVoiceQueue',_0x2ce779);logger[_0x2a01('0x15')]('GetVoiceQueue',_0x2ce779,JSON['stringify'](_0x300ae9));_0x50eed6(_0x300ae9);})[_0x2a01('0x25')](function(_0x2beff6){logger[_0x2a01('0x18')](_0x2a01('0x1b'),_0x2beff6[_0x2a01('0x1a')],_0x2ce779);_0x262452(_0x45ff03[_0x2a01('0x18')](0x1f4,_0x2beff6[_0x2a01('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x1e6678){var _0x99207b=this;return new Promise(function(_0x25033d,_0x5cf19a){return db[_0x2a01('0x1c')][_0x2a01('0x26')]({'raw':_0x1e6678[_0x2a01('0x1f')]?_0x1e6678[_0x2a01('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1e6678[_0x2a01('0x1f')]?_0x1e6678[_0x2a01('0x1f')][_0x2a01('0x20')]||null:null,'attributes':_0x1e6678[_0x2a01('0x1f')]?_0x1e6678[_0x2a01('0x1f')][_0x2a01('0x21')]||null:null,'include':_0x1e6678['options']?_0x1e6678['options'][_0x2a01('0x22')]?_[_0x2a01('0x23')](_0x1e6678['options'][_0x2a01('0x22')],function(_0x1a3e76){return{'model':db[_0x1a3e76[_0x2a01('0x24')]],'as':_0x1a3e76['as'],'attributes':_0x1a3e76[_0x2a01('0x21')],'include':_0x1a3e76[_0x2a01('0x22')]?_[_0x2a01('0x23')](_0x1a3e76[_0x2a01('0x22')],function(_0x1616e8){return{'model':db[_0x1616e8[_0x2a01('0x24')]],'as':_0x1616e8['as'],'attributes':_0x1616e8['attributes'],'include':_0x1616e8['include']?_['map'](_0x1616e8[_0x2a01('0x22')],function(_0x5ae762){return{'model':db[_0x5ae762[_0x2a01('0x24')]],'as':_0x5ae762['as'],'attributes':_0x5ae762['attributes']};}):[]};}):[]};}):[]:[]})[_0x2a01('0x11')](function(_0x5daf99){logger[_0x2a01('0x12')](_0x2a01('0x27'),_0x1e6678);logger['debug'](_0x2a01('0x27'),_0x1e6678,JSON['stringify'](_0x5daf99));_0x25033d(_0x5daf99);})[_0x2a01('0x25')](function(_0x341b35){logger['error'](_0x2a01('0x27'),_0x341b35[_0x2a01('0x1a')],_0x1e6678);_0x5cf19a(_0x99207b[_0x2a01('0x18')](0x1f4,_0x341b35[_0x2a01('0x1a')]));});});}; \ No newline at end of file +var _0xf36f=['VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','attributes','limit','include','map','info','ShowVoiceQueue','where','model','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug'];(function(_0x2d953a,_0x4d762c){var _0x8e49c5=function(_0x41eaa0){while(--_0x41eaa0){_0x2d953a['push'](_0x2d953a['shift']());}};_0x8e49c5(++_0x4d762c);}(_0xf36f,0x190));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xff36('0x0'));var util=require('util');var moment=require(_0xff36('0x1'));var BPromise=require(_0xff36('0x2'));var rs=require(_0xff36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff36('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xff36('0x5'))(_0xff36('0x6'));var config=require(_0xff36('0x7'));var jayson=require(_0xff36('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xff36('0x9')],{'host':_0xff36('0xa'),'port':0x18eb});var socket=require(_0xff36('0xb'))(new Redis(config[_0xff36('0x9')]));require(_0xff36('0xc'))[_0xff36('0xd')](socket);function respondWithRpcPromise(_0xb974c5,_0x423213,_0x205b05){return new BPromise(function(_0x9f84d,_0x467a32){return client[_0xff36('0xe')](_0xb974c5,_0x205b05)[_0xff36('0xf')](function(_0x5ebd66){logger['info'](_0xff36('0x10'),_0x423213,'request\x20sent');logger[_0xff36('0x11')](_0xff36('0x12'),_0x423213,_0xff36('0x13'),JSON[_0xff36('0x14')](_0x5ebd66));if(_0x5ebd66['error']){if(_0x5ebd66[_0xff36('0x15')][_0xff36('0x16')]===0x1f4){logger[_0xff36('0x15')](_0xff36('0x10'),_0x423213,_0x5ebd66[_0xff36('0x15')][_0xff36('0x17')]);return _0x467a32(_0x5ebd66[_0xff36('0x15')]['message']);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x423213,_0x5ebd66['error']['message']);return _0x9f84d(_0x5ebd66[_0xff36('0x15')]['message']);}else{logger['info'](_0xff36('0x10'),_0x423213,'request\x20sent');_0x9f84d(_0x5ebd66[_0xff36('0x18')][_0xff36('0x17')]);}})[_0xff36('0x19')](function(_0x5e3388){logger['error'](_0xff36('0x10'),_0x423213,_0x5e3388);_0x467a32(_0x5e3388);});});}exports[_0xff36('0x1a')]=function(_0x35f10e){var _0x1ff226=this;return new Promise(function(_0x473466,_0x1fa14a){return db[_0xff36('0x1b')][_0xff36('0x1c')]({'raw':_0x35f10e[_0xff36('0x1d')]?_0x35f10e[_0xff36('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x35f10e['options']?_0x35f10e[_0xff36('0x1d')]['where']||null:null,'attributes':_0x35f10e[_0xff36('0x1d')]?_0x35f10e[_0xff36('0x1d')][_0xff36('0x1e')]||null:null,'limit':_0x35f10e[_0xff36('0x1d')]?_0x35f10e[_0xff36('0x1d')][_0xff36('0x1f')]||null:null,'include':_0x35f10e[_0xff36('0x1d')]?_0x35f10e[_0xff36('0x1d')]['include']?_['map'](_0x35f10e['options'][_0xff36('0x20')],function(_0x49a2c0){return{'model':db[_0x49a2c0['model']],'as':_0x49a2c0['as'],'attributes':_0x49a2c0['attributes'],'include':_0x49a2c0['include']?_[_0xff36('0x21')](_0x49a2c0[_0xff36('0x20')],function(_0x4329e0){return{'model':db[_0x4329e0['model']],'as':_0x4329e0['as'],'attributes':_0x4329e0['attributes'],'include':_0x4329e0['include']?_[_0xff36('0x21')](_0x4329e0['include'],function(_0x195d0){return{'model':db[_0x195d0['model']],'as':_0x195d0['as'],'attributes':_0x195d0[_0xff36('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19952a){logger[_0xff36('0x22')]('GetVoiceQueue',_0x35f10e);logger[_0xff36('0x11')](_0xff36('0x1a'),_0x35f10e,JSON[_0xff36('0x14')](_0x19952a));_0x473466(_0x19952a);})['catch'](function(_0x2b1189){logger[_0xff36('0x15')](_0xff36('0x1a'),_0x2b1189[_0xff36('0x17')],_0x35f10e);_0x1fa14a(_0x1ff226[_0xff36('0x15')](0x1f4,_0x2b1189[_0xff36('0x17')]));});});};exports[_0xff36('0x23')]=function(_0x12aa58){var _0xd60c94=this;return new Promise(function(_0x3810c7,_0x18d7b1){return db['VoiceQueue']['find']({'raw':_0x12aa58[_0xff36('0x1d')]?_0x12aa58['options']['raw']===undefined?!![]:![]:!![],'where':_0x12aa58[_0xff36('0x1d')]?_0x12aa58[_0xff36('0x1d')][_0xff36('0x24')]||null:null,'attributes':_0x12aa58[_0xff36('0x1d')]?_0x12aa58['options'][_0xff36('0x1e')]||null:null,'include':_0x12aa58[_0xff36('0x1d')]?_0x12aa58[_0xff36('0x1d')][_0xff36('0x20')]?_[_0xff36('0x21')](_0x12aa58[_0xff36('0x1d')][_0xff36('0x20')],function(_0x42d59e){return{'model':db[_0x42d59e[_0xff36('0x25')]],'as':_0x42d59e['as'],'attributes':_0x42d59e[_0xff36('0x1e')],'include':_0x42d59e[_0xff36('0x20')]?_[_0xff36('0x21')](_0x42d59e[_0xff36('0x20')],function(_0x3af2d0){return{'model':db[_0x3af2d0[_0xff36('0x25')]],'as':_0x3af2d0['as'],'attributes':_0x3af2d0[_0xff36('0x1e')],'include':_0x3af2d0[_0xff36('0x20')]?_['map'](_0x3af2d0['include'],function(_0x1c428a){return{'model':db[_0x1c428a['model']],'as':_0x1c428a['as'],'attributes':_0x1c428a['attributes']};}):[]};}):[]};}):[]:[]})[_0xff36('0xf')](function(_0x414b49){logger['info']('ShowVoiceQueue',_0x12aa58);logger[_0xff36('0x11')](_0xff36('0x23'),_0x12aa58,JSON['stringify'](_0x414b49));_0x3810c7(_0x414b49);})['catch'](function(_0x3a9fc5){logger['error'](_0xff36('0x23'),_0x3a9fc5['message'],_0x12aa58);_0x18d7b1(_0xd60c94['error'](0x1f4,_0x3a9fc5[_0xff36('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index aeccfd1..bfba050 100644 --- a/server/api/voiceQueue/voiceQueue.socket.js +++ b/server/api/voiceQueue/voiceQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd138=['./voiceQueue.events','save','remove','length'];(function(_0x3a2504,_0x3497e7){var _0x57eadf=function(_0x51b217){while(--_0x51b217){_0x3a2504['push'](_0x3a2504['shift']());}};_0x57eadf(++_0x3497e7);}(_0xd138,0x1dc));var _0x8d13=function(_0x3453bd,_0x1bfbd1){_0x3453bd=_0x3453bd-0x0;var _0x4f4ea9=_0xd138[_0x3453bd];return _0x4f4ea9;};'use strict';var VoiceQueueEvents=require(_0x8d13('0x0'));var events=[_0x8d13('0x1'),_0x8d13('0x2'),'update'];function createListener(_0x590fee,_0x4ce918){return function(_0x13e640){_0x4ce918['emit'](_0x590fee,_0x13e640);};}function removeListener(_0x498167,_0x5f7cd3){return function(){VoiceQueueEvents['removeListener'](_0x498167,_0x5f7cd3);};}exports['register']=function(_0x5c1a82){for(var _0x5a1efe=0x0,_0x57ca7f=events[_0x8d13('0x3')];_0x5a1efe<_0x57ca7f;_0x5a1efe++){var _0x296da6=events[_0x5a1efe];var _0x1ab1f6=createListener('voiceQueue:'+_0x296da6,_0x5c1a82);VoiceQueueEvents['on'](_0x296da6,_0x1ab1f6);}}; \ No newline at end of file +var _0xdeab=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','emit'];(function(_0x4512a9,_0x4057a9){var _0x3a8687=function(_0x3c1712){while(--_0x3c1712){_0x4512a9['push'](_0x4512a9['shift']());}};_0x3a8687(++_0x4057a9);}(_0xdeab,0x154));var _0xbdea=function(_0x44c99e,_0x21c373){_0x44c99e=_0x44c99e-0x0;var _0x4746c2=_0xdeab[_0x44c99e];return _0x4746c2;};'use strict';var VoiceQueueEvents=require(_0xbdea('0x0'));var events=[_0xbdea('0x1'),_0xbdea('0x2'),'update'];function createListener(_0x4c99eb,_0x4f2c7c){return function(_0x2dc537){_0x4f2c7c[_0xbdea('0x3')](_0x4c99eb,_0x2dc537);};}function removeListener(_0x2f206,_0x17c45e){return function(){VoiceQueueEvents[_0xbdea('0x4')](_0x2f206,_0x17c45e);};}exports[_0xbdea('0x5')]=function(_0x2b3012){for(var _0x3e8716=0x0,_0x215449=events[_0xbdea('0x6')];_0x3e8716<_0x215449;_0x3e8716++){var _0x127f18=events[_0x3e8716];var _0x3a93e6=createListener(_0xbdea('0x7')+_0x127f18,_0x2b3012);VoiceQueueEvents['on'](_0x127f18,_0x3a93e6);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 7db364d..71240c5 100644 --- a/server/api/voiceQueueReport/index.js +++ b/server/api/voiceQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8506=['/:id','update','delete','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','/index','getVoiceQueuesReport','show','post','create'];(function(_0x286907,_0x52ef7a){var _0x8b184d=function(_0x3de799){while(--_0x3de799){_0x286907['push'](_0x286907['shift']());}};_0x8b184d(++_0x52ef7a);}(_0x8506,0xe8));var _0x6850=function(_0x41e9ca,_0x130c2d){_0x41e9ca=_0x41e9ca-0x0;var _0x5eb563=_0x8506[_0x41e9ca];return _0x5eb563;};'use strict';var multer=require('multer');var util=require(_0x6850('0x0'));var path=require('path');var timeout=require(_0x6850('0x1'));var express=require('express');var router=express[_0x6850('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x6850('0x3'));var config=require(_0x6850('0x4'));var controller=require(_0x6850('0x5'));router['get']('/',auth[_0x6850('0x6')](),controller[_0x6850('0x7')]);router[_0x6850('0x8')](_0x6850('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6850('0xa'),auth[_0x6850('0x6')](),controller[_0x6850('0xb')]);router['get']('/:id',auth[_0x6850('0x6')](),controller[_0x6850('0xc')]);router[_0x6850('0xd')]('/',auth[_0x6850('0x6')](),controller[_0x6850('0xe')]);router['put'](_0x6850('0xf'),auth[_0x6850('0x6')](),controller[_0x6850('0x10')]);router[_0x6850('0x11')](_0x6850('0xf'),auth[_0x6850('0x6')](),controller['destroy']);module[_0x6850('0x12')]=router; \ No newline at end of file +var _0x553a=['delete','destroy','exports','util','connect-timeout','express','Router','../../config/environment','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','get','/:id','post','create','put','update'];(function(_0x318b23,_0x40870f){var _0x2c6029=function(_0x488b1d){while(--_0x488b1d){_0x318b23['push'](_0x318b23['shift']());}};_0x2c6029(++_0x40870f);}(_0x553a,0x192));var _0xa553=function(_0x340907,_0x4a9781){_0x340907=_0x340907-0x0;var _0x1cd555=_0x553a[_0x340907];return _0x1cd555;};'use strict';var multer=require('multer');var util=require(_0xa553('0x0'));var path=require('path');var timeout=require(_0xa553('0x1'));var express=require(_0xa553('0x2'));var router=express[_0xa553('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa553('0x4'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0xa553('0x5')](),controller['index']);router['get'](_0xa553('0x6'),auth[_0xa553('0x5')](),controller[_0xa553('0x7')]);router['get'](_0xa553('0x8'),auth['isAuthenticated'](),controller[_0xa553('0x9')]);router[_0xa553('0xa')](_0xa553('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa553('0xc')]('/',auth['isAuthenticated'](),controller[_0xa553('0xd')]);router[_0xa553('0xe')](_0xa553('0xb'),auth['isAuthenticated'](),controller[_0xa553('0xf')]);router[_0xa553('0x10')](_0xa553('0xb'),auth['isAuthenticated'](),controller[_0xa553('0x11')]);module[_0xa553('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 581adba..ddae9f6 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js +++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbf7=['FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xfbf7,0x14b));var _0x7fbf=function(_0x456a62,_0x2d3c91){_0x456a62=_0x456a62-0x0;var _0x2f78a4=_0xfbf7[_0x456a62];return _0x2f78a4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7fbf('0x0'));module[_0x7fbf('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7fbf('0x2')]},'calleridnum':{'type':Sequelize[_0x7fbf('0x2')]},'calleridname':{'type':Sequelize[_0x7fbf('0x2')]},'queue':{'type':Sequelize[_0x7fbf('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x7fbf('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0xbf991c){var _0x46838d=moment(_0xbf991c);var _0x12d9cb=moment(this[_0x7fbf('0x4')](_0x7fbf('0x5')))['format'](_0x7fbf('0x6'));var _0x58a9c6=_0x46838d[_0x7fbf('0x7')](_0x12d9cb,_0x7fbf('0x8'));this[_0x7fbf('0x9')](_0x7fbf('0xa'),_0xbf991c);this['setDataValue'](_0x7fbf('0xb'),_0x58a9c6||null);}},'position':{'type':Sequelize[_0x7fbf('0xc')]},'count':{'type':Sequelize[_0x7fbf('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x7fbf('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7fbf('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x7fbf('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7fbf('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x7fbf('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x7fbf('0xc')]},'channel':{'type':Sequelize[_0x7fbf('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x7fbf('0x2')]},'accountcode':{'type':Sequelize[_0x7fbf('0x2')]},'context':{'type':Sequelize[_0x7fbf('0x2')]},'exten':{'type':Sequelize[_0x7fbf('0x2')]},'priority':{'type':Sequelize[_0x7fbf('0x2')]},'holdtime':{'type':Sequelize[_0x7fbf('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7fbf('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7fbf('0x2')],'comment':_0x7fbf('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x7fbf('0x2')]},'disposition':{'type':Sequelize[_0x7fbf('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x7fbf('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8893=['queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x8893,0x1ae));var _0x3889=function(_0x1a2f65,_0x59ee22){_0x1a2f65=_0x1a2f65-0x0;var _0x1fd04d=_0x8893[_0x1a2f65];return _0x1fd04d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3889('0x0'));module[_0x3889('0x1')]={'type':{'type':Sequelize[_0x3889('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3889('0x2')]},'calleridname':{'type':Sequelize[_0x3889('0x2')]},'queue':{'type':Sequelize[_0x3889('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3889('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2c3b10){var _0x815be4=moment(_0x2c3b10);var _0x4c7e84=moment(this['getDataValue'](_0x3889('0x4')))['format'](_0x3889('0x5'));var _0x35360b=_0x815be4[_0x3889('0x6')](_0x4c7e84,_0x3889('0x7'));this['setDataValue'](_0x3889('0x8'),_0x2c3b10);this[_0x3889('0x9')]('holdtime',_0x35360b||null);}},'position':{'type':Sequelize[_0x3889('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x3889('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3889('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x3889('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3889('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3889('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x3889('0xc')},'originalposition':{'type':Sequelize[_0x3889('0xa')]},'channel':{'type':Sequelize[_0x3889('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3889('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3889('0x2')]},'context':{'type':Sequelize[_0x3889('0x2')]},'exten':{'type':Sequelize[_0x3889('0x2')]},'priority':{'type':Sequelize[_0x3889('0x2')]},'holdtime':{'type':Sequelize[_0x3889('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3889('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3889('0x2')]},'transfer':{'type':Sequelize[_0x3889('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3889('0xd')},'transferexten':{'type':Sequelize[_0x3889('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3889('0x2')]},'disposition':{'type':Sequelize[_0x3889('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 75e8143..cb74b69 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.controller.js +++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['offset','Content-Range','reject','update','then','error','stack','name','send','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','pick','options','getVoiceQueuesReport','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','./voiceQueueReport.socket','register','sendStatus','status','end','json','count'];(function(_0x2dacfd,_0x1cb6bc){var _0x30a2ef=function(_0x2681b4){while(--_0x2681b4){_0x2dacfd['push'](_0x2dacfd['shift']());}};_0x30a2ef(++_0x1cb6bc);}(_0x0295,0x1f0));var _0x5029=function(_0x4d7c86,_0x9b62a6){_0x4d7c86=_0x4d7c86-0x0;var _0x59443d=_0x0295[_0x4d7c86];return _0x59443d;};'use strict';var pdf=require(_0x5029('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5029('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5029('0x2'));var BPromise=require(_0x5029('0x3'));var Mustache=require(_0x5029('0x4'));var util=require(_0x5029('0x5'));var path=require(_0x5029('0x6'));var sox=require(_0x5029('0x7'));var csv=require(_0x5029('0x8'));var ejs=require(_0x5029('0x9'));var fs=require('fs');var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var db=require('../../mysqldb')['db'];config[_0x5029('0x14')]=_[_0x5029('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5029('0x16'))[_0x5029('0x17')](socket);function respondWithStatusCode(_0x12c237,_0x434630){_0x434630=_0x434630||0xcc;return function(_0x2c0b33){if(_0x2c0b33){return _0x12c237[_0x5029('0x18')](_0x434630);}return _0x12c237[_0x5029('0x19')](_0x434630)[_0x5029('0x1a')]();};}function respondWithResult(_0x10bf55,_0x326923){_0x326923=_0x326923||0xc8;return function(_0x457c73){if(_0x457c73){return _0x10bf55[_0x5029('0x19')](_0x326923)[_0x5029('0x1b')](_0x457c73);}};}function respondWithFilteredResult(_0x2c273c,_0x343918){return function(_0x4f7ab4){if(_0x4f7ab4){var _0x1ed567=_0x4f7ab4[_0x5029('0x1c')],_0x31a155=_0x343918[_0x5029('0x1d')],_0x35de81=_0x343918[_0x5029('0x1d')]+_0x343918['limit'],_0x4902f3;if(_0x35de81>=_0x1ed567){_0x35de81=_0x1ed567;_0x4902f3=0xc8;}else{_0x4902f3=0xce;}_0x2c273c[_0x5029('0x19')](_0x4902f3);return _0x2c273c['set'](_0x5029('0x1e'),_0x31a155+'-'+_0x35de81+'/'+_0x1ed567)[_0x5029('0x1b')](_0x4f7ab4);}return null;};}function patchUpdates(_0x2710aa){return function(_0x3cf0fb){try{jsonpatch['apply'](_0x3cf0fb,_0x2710aa,!![]);}catch(_0x47ecca){return BPromise[_0x5029('0x1f')](_0x47ecca);}return _0x3cf0fb['save']();};}function saveUpdates(_0x3f657d,_0x853a34){return function(_0x1eb228){if(_0x1eb228){return _0x1eb228[_0x5029('0x20')](_0x3f657d)[_0x5029('0x21')](function(_0x3a3e52){return _0x3a3e52;});}return null;};}function removeEntity(_0x125c26,_0x356dac){return function(_0x3e857d){if(_0x3e857d){return _0x3e857d['destroy']()['then'](function(){_0x125c26['status'](0xcc)[_0x5029('0x1a')]();});}};}function handleEntityNotFound(_0x45666c,_0x51093c){return function(_0x5727e9){if(!_0x5727e9){_0x45666c[_0x5029('0x18')](0x194);}return _0x5727e9;};}function handleError(_0x1e7e61,_0x36d810){_0x36d810=_0x36d810||0x1f4;return function(_0x5527fc){logger[_0x5029('0x22')](_0x5527fc[_0x5029('0x23')]);if(_0x5527fc['name']){delete _0x5527fc[_0x5029('0x24')];}_0x1e7e61[_0x5029('0x19')](_0x36d810)[_0x5029('0x25')](_0x5527fc);};}exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={},_0x4b6f92={},_0x2cedf6={'count':0x0,'rows':[]};var _0x2bb398=_['map'](db[_0x5029('0x26')][_0x5029('0x27')],function(_0x4434ff){return{'name':_0x4434ff[_0x5029('0x28')],'type':_0x4434ff[_0x5029('0x29')][_0x5029('0x2a')]};});_0x4b6f92[_0x5029('0x2b')]=_[_0x5029('0x2c')](_0x2bb398,_0x5029('0x24'));_0x4b6f92[_0x5029('0x2d')]=_[_0x5029('0x2e')](_0x32da06[_0x5029('0x2d')]);_0x4b6f92['filters']=_[_0x5029('0x2f')](_0x4b6f92['model'],_0x4b6f92[_0x5029('0x2d')]);_0xe5313e['attributes']=_['intersection'](_0x4b6f92[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x32da06[_0x5029('0x2d')]['fields']));_0xe5313e[_0x5029('0x31')]=_0xe5313e[_0x5029('0x31')][_0x5029('0x32')]?_0xe5313e[_0x5029('0x31')]:_0x4b6f92[_0x5029('0x2b')];if(!_0x32da06[_0x5029('0x2d')][_0x5029('0x33')](_0x5029('0x34'))){_0xe5313e[_0x5029('0x35')]=qs['limit'](_0x32da06[_0x5029('0x2d')][_0x5029('0x35')]);_0xe5313e[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x32da06['query'][_0x5029('0x1d')]);}_0xe5313e[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x32da06['query']['sort']);_0xe5313e[_0x5029('0x38')]=qs[_0x5029('0x39')](_['pick'](_0x32da06['query'],_0x4b6f92[_0x5029('0x39')]));if(_0x32da06[_0x5029('0x2d')][_0x5029('0x3a')]){_0xe5313e[_0x5029('0x38')]=_[_0x5029('0x3b')](_0xe5313e[_0x5029('0x38')],{'$or':_[_0x5029('0x2c')](_0x2bb398,function(_0x2f13b1){if(_0x2f13b1[_0x5029('0x29')]!==_0x5029('0x3c')){var _0x3e5b67={};_0x3e5b67[_0x2f13b1[_0x5029('0x24')]]={'$like':'%'+_0x32da06[_0x5029('0x2d')][_0x5029('0x3a')]+'%'};return _0x3e5b67;}})});}_0xe5313e=_['merge']({},_0xe5313e,_0x32da06['options']);var _0x73797c={'where':_0xe5313e[_0x5029('0x38')]};return db[_0x5029('0x26')]['count'](_0x73797c)[_0x5029('0x21')](function(_0x39b216){_0x2cedf6['count']=_0x39b216;if(_0x32da06[_0x5029('0x2d')]['includeAll']){_0xe5313e[_0x5029('0x3d')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5029('0x3e')](_0xe5313e);})[_0x5029('0x21')](function(_0x24a18d){_0x2cedf6[_0x5029('0x3f')]=_0x24a18d;return _0x2cedf6;})[_0x5029('0x21')](respondWithFilteredResult(_0x251f99,_0xe5313e))[_0x5029('0x40')](handleError(_0x251f99,null));};exports[_0x5029('0x41')]=function(_0x1021ea,_0x2ae047){var _0x5a3e4d={'raw':![],'where':{'id':_0x1021ea[_0x5029('0x42')]['id']}},_0x103dfb={};_0x103dfb[_0x5029('0x2b')]=_[_0x5029('0x2e')](db[_0x5029('0x26')][_0x5029('0x27')]);_0x103dfb['query']=_[_0x5029('0x2e')](_0x1021ea[_0x5029('0x2d')]);_0x103dfb[_0x5029('0x39')]=_[_0x5029('0x2f')](_0x103dfb[_0x5029('0x2b')],_0x103dfb['query']);_0x5a3e4d[_0x5029('0x31')]=_[_0x5029('0x2f')](_0x103dfb[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x1021ea[_0x5029('0x2d')][_0x5029('0x30')]));_0x5a3e4d[_0x5029('0x31')]=_0x5a3e4d[_0x5029('0x31')][_0x5029('0x32')]?_0x5a3e4d['attributes']:_0x103dfb[_0x5029('0x2b')];if(_0x1021ea[_0x5029('0x2d')][_0x5029('0x43')]){_0x5a3e4d[_0x5029('0x3d')]=[{'all':!![]}];}_0x5a3e4d=_['merge']({},_0x5a3e4d,_0x1021ea['options']);return db[_0x5029('0x26')][_0x5029('0x44')](_0x5a3e4d)[_0x5029('0x21')](handleEntityNotFound(_0x2ae047,null))[_0x5029('0x21')](respondWithResult(_0x2ae047,null))[_0x5029('0x40')](handleError(_0x2ae047,null));};exports[_0x5029('0x45')]=function(_0x2bb7fc,_0x19a6ca){return db[_0x5029('0x26')][_0x5029('0x45')](_0x2bb7fc[_0x5029('0x46')],{})[_0x5029('0x21')](respondWithResult(_0x19a6ca,0xc9))[_0x5029('0x40')](handleError(_0x19a6ca,null));};exports[_0x5029('0x20')]=function(_0x3168bd,_0x175cc0){if(_0x3168bd[_0x5029('0x46')]['id']){delete _0x3168bd[_0x5029('0x46')]['id'];}return db[_0x5029('0x26')][_0x5029('0x44')]({'where':{'id':_0x3168bd[_0x5029('0x42')]['id']}})['then'](handleEntityNotFound(_0x175cc0,null))[_0x5029('0x21')](saveUpdates(_0x3168bd['body'],null))[_0x5029('0x21')](respondWithResult(_0x175cc0,null))[_0x5029('0x40')](handleError(_0x175cc0,null));};exports['destroy']=function(_0x5343c6,_0x319bff){return db['VoiceQueueReport']['find']({'where':{'id':_0x5343c6[_0x5029('0x42')]['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x319bff,null))[_0x5029('0x21')](removeEntity(_0x319bff,null))['catch'](handleError(_0x319bff,null));};exports['describe']=function(_0x1510bb,_0x3d4e9a){return db['VoiceQueueReport'][_0x5029('0x47')]()['then'](respondWithResult(_0x3d4e9a,null))[_0x5029('0x40')](handleError(_0x3d4e9a,null));};exports['getVoiceQueuesReport']=function(_0x2340b0,_0x27e1c0){var _0x358c8a={},_0x6d03b2={},_0x42609={'count':0x0,'rows':[]};_0x6d03b2[_0x5029('0x2b')]=_[_0x5029('0x2e')](db[_0x5029('0x26')]['rawAttributes']);_0x6d03b2[_0x5029('0x2d')]=_['keys'](_0x2340b0[_0x5029('0x2d')]);_0x6d03b2[_0x5029('0x39')]=_['intersection'](_0x6d03b2[_0x5029('0x2b')],_0x6d03b2['query']);_0x358c8a['attributes']=_['intersection'](_0x6d03b2[_0x5029('0x2b')],qs['fields'](_0x2340b0[_0x5029('0x2d')][_0x5029('0x30')]));_0x358c8a[_0x5029('0x31')]=_0x358c8a['attributes'][_0x5029('0x32')]?_0x358c8a['attributes']:_0x6d03b2['model'];if(!_0x2340b0[_0x5029('0x2d')][_0x5029('0x33')](_0x5029('0x34'))){_0x358c8a[_0x5029('0x35')]=qs[_0x5029('0x35')](_0x2340b0['query'][_0x5029('0x35')]);_0x358c8a[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x2340b0[_0x5029('0x2d')]['offset']);}_0x358c8a[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x2340b0['query']['sort']);_0x358c8a[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x48')](_0x2340b0[_0x5029('0x2d')],_0x6d03b2['filters']));if(_0x2340b0[_0x5029('0x2d')][_0x5029('0x3a')]){_0x358c8a[_0x5029('0x38')]=_[_0x5029('0x3b')](_0x358c8a[_0x5029('0x38')],{'$or':_[_0x5029('0x2c')](_0x358c8a['attributes'],function(_0x560324){var _0x4314c0={};_0x4314c0[_0x560324]={'$like':'%'+_0x2340b0[_0x5029('0x2d')][_0x5029('0x3a')]+'%'};return _0x4314c0;})});}_0x358c8a=_['merge']({},_0x358c8a,_0x2340b0[_0x5029('0x49')]);var _0x2d439a={'where':_0x358c8a[_0x5029('0x38')]};return db[_0x5029('0x26')][_0x5029('0x1c')](_0x2d439a)['then'](function(_0x2ec5d0){_0x42609[_0x5029('0x1c')]=_0x2ec5d0;if(_0x2340b0[_0x5029('0x2d')]['includeAll']){_0x358c8a[_0x5029('0x3d')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5029('0x3e')](_0x358c8a);})['then'](function(_0xff558b){_0x42609[_0x5029('0x3f')]=_0xff558b;return _0x42609;})[_0x5029('0x21')](respondWithFilteredResult(_0x27e1c0,_0x358c8a,_0x5029('0x4a')))[_0x5029('0x40')](handleError(_0x27e1c0,null,_0x5029('0x4a')));}; \ No newline at end of file +var _0x2ef3=['intersection','attributes','length','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','fields','find','create','body','update','params','destroy','describe','getVoiceQueuesReport','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','error','stack','name','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x5f1a39,_0x95f50b){var _0x1c1de8=function(_0x2c347b){while(--_0x2c347b){_0x5f1a39['push'](_0x5f1a39['shift']());}};_0x1c1de8(++_0x95f50b);}(_0x2ef3,0xba));var _0x32ef=function(_0x4e3c1f,_0x15d0e1){_0x4e3c1f=_0x4e3c1f-0x0;var _0x5c61b5=_0x2ef3[_0x4e3c1f];return _0x5c61b5;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];config['redis']=_[_0x32ef('0x19')](config['redis'],{'host':_0x32ef('0x1a'),'port':0x18eb});var socket=require(_0x32ef('0x1b'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x32ef('0x1c')](socket);function respondWithStatusCode(_0x4d8009,_0x326fce){_0x326fce=_0x326fce||0xcc;return function(_0x40a6e6){if(_0x40a6e6){return _0x4d8009[_0x32ef('0x1d')](_0x326fce);}return _0x4d8009[_0x32ef('0x1e')](_0x326fce)['end']();};}function respondWithResult(_0x55bf0b,_0x531e30){_0x531e30=_0x531e30||0xc8;return function(_0x13db1a){if(_0x13db1a){return _0x55bf0b[_0x32ef('0x1e')](_0x531e30)[_0x32ef('0x1f')](_0x13db1a);}};}function respondWithFilteredResult(_0x53a5ca,_0x5d559b){return function(_0x1eb468){if(_0x1eb468){var _0x1a9476=_0x1eb468[_0x32ef('0x20')],_0x286bfb=_0x5d559b['offset'],_0x57863c=_0x5d559b[_0x32ef('0x21')]+_0x5d559b[_0x32ef('0x22')],_0xbe37f6;if(_0x57863c>=_0x1a9476){_0x57863c=_0x1a9476;_0xbe37f6=0xc8;}else{_0xbe37f6=0xce;}_0x53a5ca[_0x32ef('0x1e')](_0xbe37f6);return _0x53a5ca[_0x32ef('0x23')](_0x32ef('0x24'),_0x286bfb+'-'+_0x57863c+'/'+_0x1a9476)[_0x32ef('0x1f')](_0x1eb468);}return null;};}function patchUpdates(_0x4de441){return function(_0x3c5b78){try{jsonpatch['apply'](_0x3c5b78,_0x4de441,!![]);}catch(_0x309866){return BPromise[_0x32ef('0x25')](_0x309866);}return _0x3c5b78['save']();};}function saveUpdates(_0x1af371,_0x97780){return function(_0x5e8898){if(_0x5e8898){return _0x5e8898['update'](_0x1af371)['then'](function(_0x22f2d7){return _0x22f2d7;});}return null;};}function removeEntity(_0xb30fab,_0x225feb){return function(_0x478bef){if(_0x478bef){return _0x478bef['destroy']()[_0x32ef('0x26')](function(){_0xb30fab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x278495,_0x14d4b3){return function(_0x371540){if(!_0x371540){_0x278495[_0x32ef('0x1d')](0x194);}return _0x371540;};}function handleError(_0x15ce54,_0x234175){_0x234175=_0x234175||0x1f4;return function(_0x1874ea){logger[_0x32ef('0x27')](_0x1874ea[_0x32ef('0x28')]);if(_0x1874ea[_0x32ef('0x29')]){delete _0x1874ea[_0x32ef('0x29')];}_0x15ce54[_0x32ef('0x1e')](_0x234175)['send'](_0x1874ea);};}exports[_0x32ef('0x2a')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={},_0x3c569d={},_0x30b250={'count':0x0,'rows':[]};var _0x26e207=_['map'](db[_0x32ef('0x2b')][_0x32ef('0x2c')],function(_0x31dbc3){return{'name':_0x31dbc3[_0x32ef('0x2d')],'type':_0x31dbc3[_0x32ef('0x2e')][_0x32ef('0x2f')]};});_0x3c569d[_0x32ef('0x30')]=_['map'](_0x26e207,_0x32ef('0x29'));_0x3c569d['query']=_[_0x32ef('0x31')](_0x2f5d06[_0x32ef('0x32')]);_0x3c569d['filters']=_[_0x32ef('0x33')](_0x3c569d[_0x32ef('0x30')],_0x3c569d[_0x32ef('0x32')]);_0x12de1a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x3c569d['model'],qs['fields'](_0x2f5d06[_0x32ef('0x32')]['fields']));_0x12de1a[_0x32ef('0x34')]=_0x12de1a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x12de1a[_0x32ef('0x34')]:_0x3c569d[_0x32ef('0x30')];if(!_0x2f5d06[_0x32ef('0x32')]['hasOwnProperty']('nolimit')){_0x12de1a['limit']=qs[_0x32ef('0x22')](_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x22')]);_0x12de1a['offset']=qs['offset'](_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x21')]);}_0x12de1a[_0x32ef('0x36')]=qs['sort'](_0x2f5d06['query'][_0x32ef('0x37')]);_0x12de1a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_[_0x32ef('0x3a')](_0x2f5d06[_0x32ef('0x32')],_0x3c569d[_0x32ef('0x39')]));if(_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x3b')]){_0x12de1a[_0x32ef('0x38')]=_['merge'](_0x12de1a[_0x32ef('0x38')],{'$or':_[_0x32ef('0x3c')](_0x26e207,function(_0x14b54f){if(_0x14b54f['type']!==_0x32ef('0x3d')){var _0x17e489={};_0x17e489[_0x14b54f[_0x32ef('0x29')]]={'$like':'%'+_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x3b')]+'%'};return _0x17e489;}})});}_0x12de1a=_[_0x32ef('0x3e')]({},_0x12de1a,_0x2f5d06[_0x32ef('0x3f')]);var _0x1cebed={'where':_0x12de1a[_0x32ef('0x38')]};return db[_0x32ef('0x2b')][_0x32ef('0x20')](_0x1cebed)[_0x32ef('0x26')](function(_0x48e071){_0x30b250[_0x32ef('0x20')]=_0x48e071;if(_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x40')]){_0x12de1a[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x2b')][_0x32ef('0x42')](_0x12de1a);})[_0x32ef('0x26')](function(_0x596d5a){_0x30b250['rows']=_0x596d5a;return _0x30b250;})[_0x32ef('0x26')](respondWithFilteredResult(_0x5a04cd,_0x12de1a))[_0x32ef('0x43')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x44')]=function(_0x765c63,_0x5dca14){var _0x2901a1={'raw':![],'where':{'id':_0x765c63['params']['id']}},_0x1f323a={};_0x1f323a[_0x32ef('0x30')]=_['keys'](db[_0x32ef('0x2b')][_0x32ef('0x2c')]);_0x1f323a[_0x32ef('0x32')]=_[_0x32ef('0x31')](_0x765c63[_0x32ef('0x32')]);_0x1f323a[_0x32ef('0x39')]=_[_0x32ef('0x33')](_0x1f323a[_0x32ef('0x30')],_0x1f323a[_0x32ef('0x32')]);_0x2901a1[_0x32ef('0x34')]=_['intersection'](_0x1f323a[_0x32ef('0x30')],qs['fields'](_0x765c63[_0x32ef('0x32')][_0x32ef('0x45')]));_0x2901a1[_0x32ef('0x34')]=_0x2901a1['attributes'][_0x32ef('0x35')]?_0x2901a1[_0x32ef('0x34')]:_0x1f323a[_0x32ef('0x30')];if(_0x765c63[_0x32ef('0x32')][_0x32ef('0x40')]){_0x2901a1[_0x32ef('0x41')]=[{'all':!![]}];}_0x2901a1=_[_0x32ef('0x3e')]({},_0x2901a1,_0x765c63['options']);return db['VoiceQueueReport'][_0x32ef('0x46')](_0x2901a1)[_0x32ef('0x26')](handleEntityNotFound(_0x5dca14,null))[_0x32ef('0x26')](respondWithResult(_0x5dca14,null))[_0x32ef('0x43')](handleError(_0x5dca14,null));};exports[_0x32ef('0x47')]=function(_0xd67dc9,_0x44ad11){return db[_0x32ef('0x2b')][_0x32ef('0x47')](_0xd67dc9[_0x32ef('0x48')],{})[_0x32ef('0x26')](respondWithResult(_0x44ad11,0xc9))[_0x32ef('0x43')](handleError(_0x44ad11,null));};exports[_0x32ef('0x49')]=function(_0x4c2534,_0x420f00){if(_0x4c2534[_0x32ef('0x48')]['id']){delete _0x4c2534[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x2b')][_0x32ef('0x46')]({'where':{'id':_0x4c2534[_0x32ef('0x4a')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x420f00,null))[_0x32ef('0x26')](saveUpdates(_0x4c2534[_0x32ef('0x48')],null))[_0x32ef('0x26')](respondWithResult(_0x420f00,null))[_0x32ef('0x43')](handleError(_0x420f00,null));};exports[_0x32ef('0x4b')]=function(_0x272377,_0x326445){return db[_0x32ef('0x2b')][_0x32ef('0x46')]({'where':{'id':_0x272377[_0x32ef('0x4a')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x326445,null))['then'](removeEntity(_0x326445,null))['catch'](handleError(_0x326445,null));};exports[_0x32ef('0x4c')]=function(_0x259c32,_0xa9bf19){return db[_0x32ef('0x2b')][_0x32ef('0x4c')]()[_0x32ef('0x26')](respondWithResult(_0xa9bf19,null))[_0x32ef('0x43')](handleError(_0xa9bf19,null));};exports[_0x32ef('0x4d')]=function(_0x15b640,_0x368bf1){var _0x3697a7={},_0x4a6fd2={},_0x21216d={'count':0x0,'rows':[]};_0x4a6fd2[_0x32ef('0x30')]=_[_0x32ef('0x31')](db[_0x32ef('0x2b')][_0x32ef('0x2c')]);_0x4a6fd2[_0x32ef('0x32')]=_['keys'](_0x15b640[_0x32ef('0x32')]);_0x4a6fd2[_0x32ef('0x39')]=_[_0x32ef('0x33')](_0x4a6fd2['model'],_0x4a6fd2[_0x32ef('0x32')]);_0x3697a7['attributes']=_[_0x32ef('0x33')](_0x4a6fd2[_0x32ef('0x30')],qs['fields'](_0x15b640[_0x32ef('0x32')]['fields']));_0x3697a7[_0x32ef('0x34')]=_0x3697a7[_0x32ef('0x34')][_0x32ef('0x35')]?_0x3697a7[_0x32ef('0x34')]:_0x4a6fd2[_0x32ef('0x30')];if(!_0x15b640[_0x32ef('0x32')][_0x32ef('0x4e')]('nolimit')){_0x3697a7['limit']=qs[_0x32ef('0x22')](_0x15b640['query']['limit']);_0x3697a7[_0x32ef('0x21')]=qs[_0x32ef('0x21')](_0x15b640[_0x32ef('0x32')][_0x32ef('0x21')]);}_0x3697a7[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0x15b640[_0x32ef('0x32')][_0x32ef('0x37')]);_0x3697a7[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_['pick'](_0x15b640['query'],_0x4a6fd2[_0x32ef('0x39')]));if(_0x15b640[_0x32ef('0x32')]['filter']){_0x3697a7[_0x32ef('0x38')]=_[_0x32ef('0x3e')](_0x3697a7[_0x32ef('0x38')],{'$or':_['map'](_0x3697a7[_0x32ef('0x34')],function(_0x3c31d0){var _0x20dcc5={};_0x20dcc5[_0x3c31d0]={'$like':'%'+_0x15b640['query']['filter']+'%'};return _0x20dcc5;})});}_0x3697a7=_[_0x32ef('0x3e')]({},_0x3697a7,_0x15b640['options']);var _0x17f447={'where':_0x3697a7['where']};return db['VoiceQueueReport'][_0x32ef('0x20')](_0x17f447)[_0x32ef('0x26')](function(_0x10cb37){_0x21216d['count']=_0x10cb37;if(_0x15b640[_0x32ef('0x32')][_0x32ef('0x40')]){_0x3697a7[_0x32ef('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x32ef('0x42')](_0x3697a7);})[_0x32ef('0x26')](function(_0x4c3bab){_0x21216d['rows']=_0x4c3bab;return _0x21216d;})[_0x32ef('0x26')](respondWithFilteredResult(_0x368bf1,_0x3697a7,_0x32ef('0x4d')))[_0x32ef('0x43')](handleError(_0x368bf1,null,_0x32ef('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 8005d27..f260dc5 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.events.js +++ b/server/api/voiceQueueReport/voiceQueueReport.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb63=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x3b43f0,_0x1d3519){var _0x5ea4f1=function(_0x2f27ff){while(--_0x2f27ff){_0x3b43f0['push'](_0x3b43f0['shift']());}};_0x5ea4f1(++_0x1d3519);}(_0xcb63,0xf5));var _0x3cb6=function(_0x3bace0,_0x137a97){_0x3bace0=_0x3bace0-0x0;var _0x2b3539=_0xcb63[_0x3bace0];return _0x2b3539;};'use strict';var EventEmitter=require(_0x3cb6('0x0'));var VoiceQueueReport=require(_0x3cb6('0x1'))['db'][_0x3cb6('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3cb6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3cb6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x55a7cf){return function(_0x2df6cf,_0x20eb46,_0x2f738c){VoiceQueueReportEvents[_0x3cb6('0x5')](_0x55a7cf+':'+_0x2df6cf['id'],_0x2df6cf);VoiceQueueReportEvents[_0x3cb6('0x5')](_0x55a7cf,_0x2df6cf);_0x2f738c(null);};}for(var e in events){if(events[_0x3cb6('0x6')](e)){var event=events[e];VoiceQueueReport[_0x3cb6('0x7')](e,emitEvent(event));}}module[_0x3cb6('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xd574=['remove','emit','hook','exports','update'];(function(_0x651909,_0x15c6b4){var _0x572299=function(_0x5e8a48){while(--_0x5e8a48){_0x651909['push'](_0x651909['shift']());}};_0x572299(++_0x15c6b4);}(_0xd574,0x144));var _0x4d57=function(_0x528778,_0x4d07eb){_0x528778=_0x528778-0x0;var _0x389672=_0xd574[_0x528778];return _0x389672;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d57('0x0'),'afterDestroy':_0x4d57('0x1')};function emitEvent(_0x5c292a){return function(_0x54bcda,_0x14b900,_0x38a5ee){VoiceQueueReportEvents[_0x4d57('0x2')](_0x5c292a+':'+_0x54bcda['id'],_0x54bcda);VoiceQueueReportEvents[_0x4d57('0x2')](_0x5c292a,_0x54bcda);_0x38a5ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x4d57('0x3')](e,emitEvent(event));}}module[_0x4d57('0x4')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 69ad3b2..7a3a0c3 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x2a99f1,_0x198fd7){var _0x6948e5=function(_0x2ae413){while(--_0x2ae413){_0x2a99f1['push'](_0x2a99f1['shift']());}};_0x6948e5(++_0x198fd7);}(_0xdb28,0x106));var _0x8db2=function(_0x167cf9,_0x23af81){_0x167cf9=_0x167cf9-0x0;var _0xbff135=_0xdb28[_0x167cf9];return _0xbff135;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8db2('0xc')]},{'fields':[_0x8db2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x552f9d,_0x3b3808){var _0x3c13e8=function(_0x22fcfa){while(--_0x22fcfa){_0x552f9d['push'](_0x552f9d['shift']());}};_0x3c13e8(++_0x3b3808);}(_0x757a,0xde));var _0xa757=function(_0x1b386e,_0x261880){_0x1b386e=_0x1b386e-0x0;var _0x552bb6=_0x757a[_0x1b386e];return _0x552bb6;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('VoiceQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa757('0xa')]},{'fields':[_0xa757('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index f74d7d2..aedf1d3 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js +++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7887=['UpdateVoiceQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','info','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','model','include','map','then','debug','catch','create','body','raw','CreateVoiceQueueReport','update','where','limit'];(function(_0x33a4c7,_0x2c48fc){var _0x495c6b=function(_0x4e29c1){while(--_0x4e29c1){_0x33a4c7['push'](_0x33a4c7['shift']());}};_0x495c6b(++_0x2c48fc);}(_0x7887,0x1c4));var _0x7788=function(_0x41fb78,_0xb5f43d){_0x41fb78=_0x41fb78-0x0;var _0x7b64a4=_0x7887[_0x41fb78];return _0x7b64a4;};'use strict';var _=require(_0x7788('0x0'));var util=require(_0x7788('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7788('0x2'));var fs=require('fs');var Redis=require(_0x7788('0x3'));var db=require(_0x7788('0x4'))['db'];var utils=require(_0x7788('0x5'));var logger=require(_0x7788('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7788('0x7'));var client=jayson['client'][_0x7788('0x8')]({'port':0x232a});config['redis']=_[_0x7788('0x9')](config[_0x7788('0xa')],{'host':_0x7788('0xb'),'port':0x18eb});var socket=require(_0x7788('0xc'))(new Redis(config['redis']));require(_0x7788('0xd'))['register'](socket);function respondWithRpcPromise(_0x5a3336,_0x300b8e,_0x54eee){return new BPromise(function(_0x3e68bb,_0x431593){return client['request'](_0x5a3336,_0x54eee)['then'](function(_0x31da87){logger[_0x7788('0xe')](_0x7788('0xf'),_0x300b8e,'request\x20sent');logger['debug'](_0x7788('0x10'),_0x300b8e,_0x7788('0x11'),JSON[_0x7788('0x12')](_0x31da87));if(_0x31da87[_0x7788('0x13')]){if(_0x31da87[_0x7788('0x13')]['code']===0x1f4){logger[_0x7788('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x300b8e,_0x31da87[_0x7788('0x13')]['message']);return _0x431593(_0x31da87[_0x7788('0x13')][_0x7788('0x14')]);}logger[_0x7788('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x300b8e,_0x31da87[_0x7788('0x13')][_0x7788('0x14')]);return _0x3e68bb(_0x31da87[_0x7788('0x13')]['message']);}else{logger[_0x7788('0xe')](_0x7788('0xf'),_0x300b8e,_0x7788('0x11'));_0x3e68bb(_0x31da87[_0x7788('0x15')][_0x7788('0x14')]);}})['catch'](function(_0x5702e6){logger[_0x7788('0x13')](_0x7788('0xf'),_0x300b8e,_0x5702e6);_0x431593(_0x5702e6);});});}exports[_0x7788('0x16')]=function(_0x726d6){var _0xfb88ba=this;return new Promise(function(_0xc2cbd1,_0x3090cc){return db[_0x7788('0x17')][_0x7788('0x18')]({'raw':_0x726d6['options']?_0x726d6[_0x7788('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x726d6[_0x7788('0x19')]?_0x726d6[_0x7788('0x19')]['where']||null:null,'attributes':_0x726d6[_0x7788('0x19')]?_0x726d6[_0x7788('0x19')][_0x7788('0x1a')]||null:null,'limit':_0x726d6[_0x7788('0x19')]?_0x726d6[_0x7788('0x19')]['limit']||null:null,'include':_0x726d6['options']?_0x726d6[_0x7788('0x19')]['include']?_['map'](_0x726d6['options']['include'],function(_0x807148){return{'model':db[_0x807148[_0x7788('0x1b')]],'as':_0x807148['as'],'attributes':_0x807148['attributes'],'include':_0x807148[_0x7788('0x1c')]?_[_0x7788('0x1d')](_0x807148[_0x7788('0x1c')],function(_0x549799){return{'model':db[_0x549799['model']],'as':_0x549799['as'],'attributes':_0x549799[_0x7788('0x1a')],'include':_0x549799[_0x7788('0x1c')]?_['map'](_0x549799[_0x7788('0x1c')],function(_0x47ba59){return{'model':db[_0x47ba59[_0x7788('0x1b')]],'as':_0x47ba59['as'],'attributes':_0x47ba59[_0x7788('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7788('0x1e')](function(_0x29b219){logger[_0x7788('0xe')]('GetVoiceQueueReport',_0x726d6);logger[_0x7788('0x1f')](_0x7788('0x16'),_0x726d6,JSON[_0x7788('0x12')](_0x29b219));_0xc2cbd1(_0x29b219);})[_0x7788('0x20')](function(_0x4d8a54){logger[_0x7788('0x13')](_0x7788('0x16'),_0x4d8a54[_0x7788('0x14')],_0x726d6);_0x3090cc(_0xfb88ba[_0x7788('0x13')](0x1f4,_0x4d8a54[_0x7788('0x14')]));});});};exports['CreateVoiceQueueReport']=function(_0x1ac778){var _0x3bd8d2=this;return new Promise(function(_0x376740,_0x27642a){return db[_0x7788('0x17')][_0x7788('0x21')](_0x1ac778[_0x7788('0x22')],{'raw':_0x1ac778['options']?_0x1ac778[_0x7788('0x19')][_0x7788('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x50cf30){logger[_0x7788('0xe')](_0x7788('0x24'),_0x1ac778);logger['debug']('CreateVoiceQueueReport',_0x1ac778,JSON[_0x7788('0x12')](_0x50cf30));_0x376740(_0x50cf30);})[_0x7788('0x20')](function(_0x23e65b){logger[_0x7788('0x13')]('CreateVoiceQueueReport',_0x23e65b['message'],_0x1ac778);_0x27642a(_0x3bd8d2[_0x7788('0x13')](0x1f4,_0x23e65b[_0x7788('0x14')]));});});};exports['UpdateVoiceQueueReport']=function(_0x31babb){var _0x380c2c=this;return new Promise(function(_0x245dc9,_0x2aafaf){return db[_0x7788('0x17')][_0x7788('0x25')](_0x31babb[_0x7788('0x22')],{'raw':_0x31babb['options']?_0x31babb[_0x7788('0x19')][_0x7788('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31babb[_0x7788('0x19')]?_0x31babb[_0x7788('0x19')][_0x7788('0x26')]||null:null,'attributes':_0x31babb['options']?_0x31babb['options'][_0x7788('0x1a')]||null:null,'limit':_0x31babb['options']?_0x31babb['options'][_0x7788('0x27')]||null:null})[_0x7788('0x1e')](function(_0x7c9101){logger['info'](_0x7788('0x28'),_0x31babb);logger[_0x7788('0x1f')](_0x7788('0x28'),_0x31babb,JSON[_0x7788('0x12')](_0x7c9101));_0x245dc9(_0x7c9101);})['catch'](function(_0x348846){logger['error'](_0x7788('0x28'),_0x348846[_0x7788('0x14')],_0x31babb);_0x2aafaf(_0x380c2c[_0x7788('0x13')](0x1f4,_0x348846['message']));});});}; \ No newline at end of file +var _0xbeb4=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','model','include','map','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3caeb5,_0x219363){var _0x5eca7e=function(_0x4cae6b){while(--_0x4cae6b){_0x3caeb5['push'](_0x3caeb5['shift']());}};_0x5eca7e(++_0x219363);}(_0xbeb4,0x18d));var _0x4beb=function(_0x1d4bae,_0x4feb95){_0x1d4bae=_0x1d4bae-0x0;var _0x28c8b5=_0xbeb4[_0x1d4bae];return _0x28c8b5;};'use strict';var _=require(_0x4beb('0x0'));var util=require(_0x4beb('0x1'));var moment=require('moment');var BPromise=require(_0x4beb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4beb('0x3'));var db=require(_0x4beb('0x4'))['db'];var utils=require(_0x4beb('0x5'));var logger=require(_0x4beb('0x6'))(_0x4beb('0x7'));var config=require(_0x4beb('0x8'));var jayson=require(_0x4beb('0x9'));var client=jayson[_0x4beb('0xa')][_0x4beb('0xb')]({'port':0x232a});config['redis']=_[_0x4beb('0xc')](config[_0x4beb('0xd')],{'host':_0x4beb('0xe'),'port':0x18eb});var socket=require(_0x4beb('0xf'))(new Redis(config[_0x4beb('0xd')]));require(_0x4beb('0x10'))[_0x4beb('0x11')](socket);function respondWithRpcPromise(_0x127813,_0x4bc705,_0xc6b4ca){return new BPromise(function(_0x5cbc76,_0xcf8cde){return client[_0x4beb('0x12')](_0x127813,_0xc6b4ca)[_0x4beb('0x13')](function(_0x288abf){logger[_0x4beb('0x14')](_0x4beb('0x15'),_0x4bc705,_0x4beb('0x16'));logger[_0x4beb('0x17')](_0x4beb('0x18'),_0x4bc705,_0x4beb('0x16'),JSON[_0x4beb('0x19')](_0x288abf));if(_0x288abf[_0x4beb('0x1a')]){if(_0x288abf['error']['code']===0x1f4){logger[_0x4beb('0x1a')](_0x4beb('0x15'),_0x4bc705,_0x288abf[_0x4beb('0x1a')][_0x4beb('0x1b')]);return _0xcf8cde(_0x288abf[_0x4beb('0x1a')][_0x4beb('0x1b')]);}logger[_0x4beb('0x1a')](_0x4beb('0x15'),_0x4bc705,_0x288abf[_0x4beb('0x1a')]['message']);return _0x5cbc76(_0x288abf[_0x4beb('0x1a')]['message']);}else{logger[_0x4beb('0x14')](_0x4beb('0x15'),_0x4bc705,'request\x20sent');_0x5cbc76(_0x288abf[_0x4beb('0x1c')][_0x4beb('0x1b')]);}})[_0x4beb('0x1d')](function(_0x319fca){logger['error'](_0x4beb('0x15'),_0x4bc705,_0x319fca);_0xcf8cde(_0x319fca);});});}exports[_0x4beb('0x1e')]=function(_0x3a695e){var _0x16684a=this;return new Promise(function(_0x4da8dd,_0x5bedb9){return db[_0x4beb('0x1f')][_0x4beb('0x20')]({'raw':_0x3a695e[_0x4beb('0x21')]?_0x3a695e[_0x4beb('0x21')][_0x4beb('0x22')]===undefined?!![]:![]:!![],'where':_0x3a695e[_0x4beb('0x21')]?_0x3a695e[_0x4beb('0x21')][_0x4beb('0x23')]||null:null,'attributes':_0x3a695e[_0x4beb('0x21')]?_0x3a695e[_0x4beb('0x21')][_0x4beb('0x24')]||null:null,'limit':_0x3a695e[_0x4beb('0x21')]?_0x3a695e['options'][_0x4beb('0x25')]||null:null,'include':_0x3a695e[_0x4beb('0x21')]?_0x3a695e['options']['include']?_['map'](_0x3a695e[_0x4beb('0x21')]['include'],function(_0x5c7f68){return{'model':db[_0x5c7f68[_0x4beb('0x26')]],'as':_0x5c7f68['as'],'attributes':_0x5c7f68[_0x4beb('0x24')],'include':_0x5c7f68[_0x4beb('0x27')]?_[_0x4beb('0x28')](_0x5c7f68['include'],function(_0x1979c2){return{'model':db[_0x1979c2[_0x4beb('0x26')]],'as':_0x1979c2['as'],'attributes':_0x1979c2[_0x4beb('0x24')],'include':_0x1979c2[_0x4beb('0x27')]?_[_0x4beb('0x28')](_0x1979c2[_0x4beb('0x27')],function(_0x322b06){return{'model':db[_0x322b06[_0x4beb('0x26')]],'as':_0x322b06['as'],'attributes':_0x322b06[_0x4beb('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4beb('0x13')](function(_0x55db1b){logger['info'](_0x4beb('0x1e'),_0x3a695e);logger[_0x4beb('0x17')]('GetVoiceQueueReport',_0x3a695e,JSON[_0x4beb('0x19')](_0x55db1b));_0x4da8dd(_0x55db1b);})[_0x4beb('0x1d')](function(_0x815c33){logger['error']('GetVoiceQueueReport',_0x815c33['message'],_0x3a695e);_0x5bedb9(_0x16684a['error'](0x1f4,_0x815c33['message']));});});};exports[_0x4beb('0x29')]=function(_0x3bc303){var _0x26108c=this;return new Promise(function(_0x5604dc,_0x5971e2){return db[_0x4beb('0x1f')]['create'](_0x3bc303['body'],{'raw':_0x3bc303[_0x4beb('0x21')]?_0x3bc303[_0x4beb('0x21')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53d51c){logger[_0x4beb('0x14')](_0x4beb('0x29'),_0x3bc303);logger[_0x4beb('0x17')](_0x4beb('0x29'),_0x3bc303,JSON[_0x4beb('0x19')](_0x53d51c));_0x5604dc(_0x53d51c);})[_0x4beb('0x1d')](function(_0x49e3e3){logger[_0x4beb('0x1a')](_0x4beb('0x29'),_0x49e3e3[_0x4beb('0x1b')],_0x3bc303);_0x5971e2(_0x26108c['error'](0x1f4,_0x49e3e3['message']));});});};exports[_0x4beb('0x2a')]=function(_0xedd081){var _0x169c19=this;return new Promise(function(_0x361163,_0x285832){return db[_0x4beb('0x1f')][_0x4beb('0x2b')](_0xedd081[_0x4beb('0x2c')],{'raw':_0xedd081[_0x4beb('0x21')]?_0xedd081['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xedd081[_0x4beb('0x21')]?_0xedd081[_0x4beb('0x21')]['where']||null:null,'attributes':_0xedd081[_0x4beb('0x21')]?_0xedd081[_0x4beb('0x21')][_0x4beb('0x24')]||null:null,'limit':_0xedd081[_0x4beb('0x21')]?_0xedd081[_0x4beb('0x21')][_0x4beb('0x25')]||null:null})[_0x4beb('0x13')](function(_0x559012){logger[_0x4beb('0x14')]('UpdateVoiceQueueReport',_0xedd081);logger['debug']('UpdateVoiceQueueReport',_0xedd081,JSON[_0x4beb('0x19')](_0x559012));_0x361163(_0x559012);})['catch'](function(_0x4d718a){logger['error'](_0x4beb('0x2a'),_0x4d718a[_0x4beb('0x1b')],_0xedd081);_0x285832(_0x169c19[_0x4beb('0x1a')](0x1f4,_0x4d718a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index b0b86ba..0b41861 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.socket.js +++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f5e=['removeListener','register','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7f5e,0x160));var _0xe7f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f5e[_0x20a584];return _0x4b41a8;};'use strict';var VoiceQueueReportEvents=require(_0xe7f5('0x0'));var events=[_0xe7f5('0x1'),_0xe7f5('0x2'),_0xe7f5('0x3')];function createListener(_0x2338f1,_0x45e6a3){return function(_0x11c66b){_0x45e6a3[_0xe7f5('0x4')](_0x2338f1,_0x11c66b);};}function removeListener(_0x32a1f2,_0xb7ed7b){return function(){VoiceQueueReportEvents[_0xe7f5('0x5')](_0x32a1f2,_0xb7ed7b);};}exports[_0xe7f5('0x6')]=function(_0x2dca85){for(var _0x4ce158=0x0,_0x8c926e=events['length'];_0x4ce158<_0x8c926e;_0x4ce158++){var _0x7bb35=events[_0x4ce158];var _0x17b6bc=createListener('voiceQueueReport:'+_0x7bb35,_0x2dca85);VoiceQueueReportEvents['on'](_0x7bb35,_0x17b6bc);}}; \ No newline at end of file +var _0x42f2=['removeListener','voiceQueueReport:','./voiceQueueReport.events','save','remove','emit'];(function(_0x237cd7,_0x4f0d74){var _0xfba6f=function(_0x55aea6){while(--_0x55aea6){_0x237cd7['push'](_0x237cd7['shift']());}};_0xfba6f(++_0x4f0d74);}(_0x42f2,0x146));var _0x242f=function(_0xbac1ec,_0x2f59dc){_0xbac1ec=_0xbac1ec-0x0;var _0x1d5ce9=_0x42f2[_0xbac1ec];return _0x1d5ce9;};'use strict';var VoiceQueueReportEvents=require(_0x242f('0x0'));var events=[_0x242f('0x1'),_0x242f('0x2'),'update'];function createListener(_0x39f50f,_0x5dd888){return function(_0xa3bc16){_0x5dd888[_0x242f('0x3')](_0x39f50f,_0xa3bc16);};}function removeListener(_0x11f021,_0x291ebc){return function(){VoiceQueueReportEvents[_0x242f('0x4')](_0x11f021,_0x291ebc);};}exports['register']=function(_0x43e6e1){for(var _0x2e7c8b=0x0,_0x37ebe9=events['length'];_0x2e7c8b<_0x37ebe9;_0x2e7c8b++){var _0x3a04d6=events[_0x2e7c8b];var _0xdbb650=createListener(_0x242f('0x5')+_0x3a04d6,_0x43e6e1);VoiceQueueReportEvents['on'](_0x3a04d6,_0xdbb650);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 65ef02e..44155c1 100644 --- a/server/api/voiceQueuesLog/index.js +++ b/server/api/voiceQueuesLog/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf068=['update','delete','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0xf068,0x8b));var _0x8f06=function(_0x5264b4,_0x1994cd){_0x5264b4=_0x5264b4-0x0;var _0x516e2a=_0xf068[_0x5264b4];return _0x516e2a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8f06('0x0'));var timeout=require(_0x8f06('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x8f06('0x2'));var interaction=require(_0x8f06('0x3'));var config=require(_0x8f06('0x4'));var controller=require(_0x8f06('0x5'));router[_0x8f06('0x6')]('/',auth[_0x8f06('0x7')](),controller[_0x8f06('0x8')]);router[_0x8f06('0x6')](_0x8f06('0x9'),auth[_0x8f06('0x7')](),controller[_0x8f06('0xa')]);router[_0x8f06('0xb')]('/',auth['isAuthenticated'](),controller[_0x8f06('0xc')]);router[_0x8f06('0xd')](_0x8f06('0x9'),auth[_0x8f06('0x7')](),controller[_0x8f06('0xe')]);router[_0x8f06('0xf')](_0x8f06('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x8f06('0x10')]=router; \ No newline at end of file +var _0xadbd=['../../config/environment','./voiceQueuesLog.controller','index','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xadbd,0x150));var _0xdadb=function(_0xfd8c91,_0x334c35){_0xfd8c91=_0xfd8c91-0x0;var _0x236e82=_0xadbd[_0xfd8c91];return _0x236e82;};'use strict';var multer=require(_0xdadb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdadb('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xdadb('0x2'));var interaction=require(_0xdadb('0x3'));var config=require(_0xdadb('0x4'));var controller=require(_0xdadb('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xdadb('0x6')]);router[_0xdadb('0x7')](_0xdadb('0x8'),auth[_0xdadb('0x9')](),controller[_0xdadb('0xa')]);router[_0xdadb('0xb')]('/',auth[_0xdadb('0x9')](),controller[_0xdadb('0xc')]);router['put'](_0xdadb('0x8'),auth['isAuthenticated'](),controller[_0xdadb('0xd')]);router[_0xdadb('0xe')](_0xdadb('0x8'),auth[_0xdadb('0x9')](),controller[_0xdadb('0xf')]);module[_0xdadb('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 328e22e..71adf48 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc08c=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x1cac95,_0x2a65e7){var _0x5a9a17=function(_0x4ec950){while(--_0x4ec950){_0x1cac95['push'](_0x1cac95['shift']());}};_0x5a9a17(++_0x2a65e7);}(_0xc08c,0x176));var _0xcc08=function(_0x37eca7,_0x3e016e){_0x37eca7=_0x37eca7-0x0;var _0x222bce=_0xc08c[_0x37eca7];return _0x222bce;};'use strict';var Sequelize=require(_0xcc08('0x0'));var moment=require(_0xcc08('0x1'));module[_0xcc08('0x2')]={'time':{'type':Sequelize[_0xcc08('0x3')]},'callid':{'type':Sequelize[_0xcc08('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xcc08('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xcc08('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xcc08('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xcc08('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xcc08('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xcc08('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xcc08('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xcc08('0x4')],'allowNull':![],'defaultValue':moment()[_0xcc08('0x5')](_0xcc08('0x6'))}}; \ No newline at end of file +var _0xf53d=['moment','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x5d5ad9,_0x9fe65c){var _0x461f64=function(_0x97c064){while(--_0x97c064){_0x5d5ad9['push'](_0x5d5ad9['shift']());}};_0x461f64(++_0x9fe65c);}(_0xf53d,0x1c1));var _0xdf53=function(_0x1723c5,_0x47ac7e){_0x1723c5=_0x1723c5-0x0;var _0x7e1dc3=_0xf53d[_0x1723c5];return _0x7e1dc3;};'use strict';var Sequelize=require(_0xdf53('0x0'));var moment=require(_0xdf53('0x1'));module['exports']={'time':{'type':Sequelize[_0xdf53('0x2')]},'callid':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xdf53('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xdf53('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0xdf53('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 1ba410b..d0e6ea4 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa56f=['jsforce','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','Content-Range','apply','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','offset','order','sort','filter','where','merge','VIRTUAL','VoiceQueuesLog','count','include','findAll','rows','catch','show','params','length','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto'];(function(_0x5e2be0,_0x51090e){var _0x23d711=function(_0x397316){while(--_0x397316){_0x5e2be0['push'](_0x5e2be0['shift']());}};_0x23d711(++_0x51090e);}(_0xa56f,0xc2));var _0xfa56=function(_0x17cf1f,_0x4b07d8){_0x17cf1f=_0x17cf1f-0x0;var _0x4acd47=_0xa56f[_0x17cf1f];return _0x4acd47;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfa56('0x0'));var rimraf=require(_0xfa56('0x1'));var zipdir=require(_0xfa56('0x2'));var jsonpatch=require(_0xfa56('0x3'));var rp=require(_0xfa56('0x4'));var moment=require(_0xfa56('0x5'));var BPromise=require(_0xfa56('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa56('0x7'));var sox=require(_0xfa56('0x8'));var csv=require('to-csv');var ejs=require(_0xfa56('0x9'));var fs=require('fs');var _=require(_0xfa56('0xa'));var squel=require(_0xfa56('0xb'));var crypto=require(_0xfa56('0xc'));var jsforce=require(_0xfa56('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfa56('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfa56('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa56('0x10'));var hardwareService=require(_0xfa56('0x11'));var logger=require('../../config/logger')(_0xfa56('0x12'));var utils=require(_0xfa56('0x13'));var config=require(_0xfa56('0x14'));var db=require(_0xfa56('0x15'))['db'];function respondWithStatusCode(_0x5194b2,_0x5b05b0){_0x5b05b0=_0x5b05b0||0xcc;return function(_0x456ed2){if(_0x456ed2){return _0x5194b2[_0xfa56('0x16')](_0x5b05b0);}return _0x5194b2[_0xfa56('0x17')](_0x5b05b0)[_0xfa56('0x18')]();};}function respondWithResult(_0x338a0f,_0xbca52e){_0xbca52e=_0xbca52e||0xc8;return function(_0x470aa9){if(_0x470aa9){return _0x338a0f[_0xfa56('0x17')](_0xbca52e)[_0xfa56('0x19')](_0x470aa9);}};}function respondWithFilteredResult(_0x1de622,_0x16957b){return function(_0x560343){if(_0x560343){var _0x2478fb=_0x560343['count'],_0x9e0a20=_0x16957b['offset'],_0x5c701d=_0x16957b['offset']+_0x16957b['limit'],_0x26db10;if(_0x5c701d>=_0x2478fb){_0x5c701d=_0x2478fb;_0x26db10=0xc8;}else{_0x26db10=0xce;}_0x1de622[_0xfa56('0x17')](_0x26db10);return _0x1de622['set'](_0xfa56('0x1a'),_0x9e0a20+'-'+_0x5c701d+'/'+_0x2478fb)['json'](_0x560343);}return null;};}function patchUpdates(_0x260497){return function(_0x3b9aa0){try{jsonpatch[_0xfa56('0x1b')](_0x3b9aa0,_0x260497,!![]);}catch(_0x1b4c70){return BPromise[_0xfa56('0x1c')](_0x1b4c70);}return _0x3b9aa0['save']();};}function saveUpdates(_0x3461fa,_0x935f1f){return function(_0x244b36){if(_0x244b36){return _0x244b36[_0xfa56('0x1d')](_0x3461fa)[_0xfa56('0x1e')](function(_0x470fb1){return _0x470fb1;});}return null;};}function removeEntity(_0x374824,_0x4d1d60){return function(_0x4f91ad){if(_0x4f91ad){return _0x4f91ad['destroy']()[_0xfa56('0x1e')](function(){_0x374824['status'](0xcc)[_0xfa56('0x18')]();});}};}function handleEntityNotFound(_0x3a15ac,_0x100f84){return function(_0x3ab59e){if(!_0x3ab59e){_0x3a15ac['sendStatus'](0x194);}return _0x3ab59e;};}function handleError(_0x306a90,_0x365f98){_0x365f98=_0x365f98||0x1f4;return function(_0x1f51ef){logger[_0xfa56('0x1f')](_0x1f51ef[_0xfa56('0x20')]);if(_0x1f51ef[_0xfa56('0x21')]){delete _0x1f51ef['name'];}_0x306a90[_0xfa56('0x17')](_0x365f98)[_0xfa56('0x22')](_0x1f51ef);};}exports['index']=function(_0x415fd9,_0x4615e1){var _0x55e6c7={},_0x104996={},_0x5d3711={'count':0x0,'rows':[]};var _0x1c89e4=_[_0xfa56('0x23')](db['VoiceQueuesLog'][_0xfa56('0x24')],function(_0x1c68a4){return{'name':_0x1c68a4[_0xfa56('0x25')],'type':_0x1c68a4[_0xfa56('0x26')][_0xfa56('0x27')]};});_0x104996['model']=_['map'](_0x1c89e4,_0xfa56('0x21'));_0x104996[_0xfa56('0x28')]=_[_0xfa56('0x29')](_0x415fd9[_0xfa56('0x28')]);_0x104996[_0xfa56('0x2a')]=_[_0xfa56('0x2b')](_0x104996[_0xfa56('0x2c')],_0x104996[_0xfa56('0x28')]);_0x55e6c7[_0xfa56('0x2d')]=_[_0xfa56('0x2b')](_0x104996[_0xfa56('0x2c')],qs[_0xfa56('0x2e')](_0x415fd9[_0xfa56('0x28')]['fields']));_0x55e6c7[_0xfa56('0x2d')]=_0x55e6c7[_0xfa56('0x2d')]['length']?_0x55e6c7[_0xfa56('0x2d')]:_0x104996[_0xfa56('0x2c')];if(!_0x415fd9['query'][_0xfa56('0x2f')]('nolimit')){_0x55e6c7[_0xfa56('0x30')]=qs[_0xfa56('0x30')](_0x415fd9['query']['limit']);_0x55e6c7[_0xfa56('0x31')]=qs[_0xfa56('0x31')](_0x415fd9[_0xfa56('0x28')][_0xfa56('0x31')]);}_0x55e6c7[_0xfa56('0x32')]=qs['sort'](_0x415fd9[_0xfa56('0x28')][_0xfa56('0x33')]);_0x55e6c7['where']=qs[_0xfa56('0x2a')](_['pick'](_0x415fd9['query'],_0x104996[_0xfa56('0x2a')]));if(_0x415fd9[_0xfa56('0x28')][_0xfa56('0x34')]){_0x55e6c7[_0xfa56('0x35')]=_[_0xfa56('0x36')](_0x55e6c7['where'],{'$or':_[_0xfa56('0x23')](_0x1c89e4,function(_0x435cd7){if(_0x435cd7[_0xfa56('0x26')]!==_0xfa56('0x37')){var _0x2c95cd={};_0x2c95cd[_0x435cd7[_0xfa56('0x21')]]={'$like':'%'+_0x415fd9[_0xfa56('0x28')][_0xfa56('0x34')]+'%'};return _0x2c95cd;}})});}_0x55e6c7=_['merge']({},_0x55e6c7,_0x415fd9['options']);var _0x2bd493={'where':_0x55e6c7[_0xfa56('0x35')]};return db[_0xfa56('0x38')][_0xfa56('0x39')](_0x2bd493)[_0xfa56('0x1e')](function(_0x37fbd5){_0x5d3711[_0xfa56('0x39')]=_0x37fbd5;if(_0x415fd9[_0xfa56('0x28')]['includeAll']){_0x55e6c7[_0xfa56('0x3a')]=[{'all':!![]}];}return db[_0xfa56('0x38')][_0xfa56('0x3b')](_0x55e6c7);})[_0xfa56('0x1e')](function(_0x1d9e65){_0x5d3711[_0xfa56('0x3c')]=_0x1d9e65;return _0x5d3711;})[_0xfa56('0x1e')](respondWithFilteredResult(_0x4615e1,_0x55e6c7))[_0xfa56('0x3d')](handleError(_0x4615e1,null));};exports[_0xfa56('0x3e')]=function(_0x450407,_0x49f109){var _0x1ed2ab={'raw':!![],'where':{'id':_0x450407[_0xfa56('0x3f')]['id']}},_0x50a4bc={};_0x50a4bc[_0xfa56('0x2c')]=_[_0xfa56('0x29')](db[_0xfa56('0x38')][_0xfa56('0x24')]);_0x50a4bc['query']=_[_0xfa56('0x29')](_0x450407['query']);_0x50a4bc[_0xfa56('0x2a')]=_[_0xfa56('0x2b')](_0x50a4bc[_0xfa56('0x2c')],_0x50a4bc[_0xfa56('0x28')]);_0x1ed2ab[_0xfa56('0x2d')]=_[_0xfa56('0x2b')](_0x50a4bc['model'],qs[_0xfa56('0x2e')](_0x450407['query'][_0xfa56('0x2e')]));_0x1ed2ab[_0xfa56('0x2d')]=_0x1ed2ab[_0xfa56('0x2d')][_0xfa56('0x40')]?_0x1ed2ab[_0xfa56('0x2d')]:_0x50a4bc[_0xfa56('0x2c')];if(_0x450407[_0xfa56('0x28')]['includeAll']){_0x1ed2ab[_0xfa56('0x3a')]=[{'all':!![]}];}_0x1ed2ab=_[_0xfa56('0x36')]({},_0x1ed2ab,_0x450407[_0xfa56('0x41')]);return db[_0xfa56('0x38')]['find'](_0x1ed2ab)[_0xfa56('0x1e')](handleEntityNotFound(_0x49f109,null))[_0xfa56('0x1e')](respondWithResult(_0x49f109,null))[_0xfa56('0x3d')](handleError(_0x49f109,null));};exports[_0xfa56('0x42')]=function(_0xa0f92c,_0x473e15){return db[_0xfa56('0x38')][_0xfa56('0x42')](_0xa0f92c['body'],{})[_0xfa56('0x1e')](respondWithResult(_0x473e15,0xc9))[_0xfa56('0x3d')](handleError(_0x473e15,null));};exports['update']=function(_0x30beb7,_0x137577){if(_0x30beb7[_0xfa56('0x43')]['id']){delete _0x30beb7[_0xfa56('0x43')]['id'];}return db[_0xfa56('0x38')][_0xfa56('0x44')]({'where':{'id':_0x30beb7[_0xfa56('0x3f')]['id']}})[_0xfa56('0x1e')](handleEntityNotFound(_0x137577,null))[_0xfa56('0x1e')](saveUpdates(_0x30beb7[_0xfa56('0x43')],null))[_0xfa56('0x1e')](respondWithResult(_0x137577,null))['catch'](handleError(_0x137577,null));};exports['destroy']=function(_0x16b7d4,_0x406c0e){return db[_0xfa56('0x38')][_0xfa56('0x44')]({'where':{'id':_0x16b7d4['params']['id']}})[_0xfa56('0x1e')](handleEntityNotFound(_0x406c0e,null))[_0xfa56('0x1e')](removeEntity(_0x406c0e,null))[_0xfa56('0x3d')](handleError(_0x406c0e,null));}; \ No newline at end of file +var _0x5651=['then','destroy','end','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','show','params','rawAttributes','includeAll','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0xe2e5a7,_0x213d71){var _0x1658e5=function(_0x12eb35){while(--_0x12eb35){_0xe2e5a7['push'](_0xe2e5a7['shift']());}};_0x1658e5(++_0x213d71);}(_0x5651,0xbe));var _0x1565=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0x5651[_0x1bc762];return _0x40f70c;};'use strict';var pdf=require(_0x1565('0x0'));var emlformat=require(_0x1565('0x1'));var rimraf=require(_0x1565('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1565('0x3'));var moment=require(_0x1565('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1565('0x5'));var util=require(_0x1565('0x6'));var path=require(_0x1565('0x7'));var sox=require(_0x1565('0x8'));var csv=require(_0x1565('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1565('0xa'));var crypto=require(_0x1565('0xb'));var jsforce=require(_0x1565('0xc'));var deskjs=require(_0x1565('0xd'));var toCsv=require(_0x1565('0x9'));var querystring=require(_0x1565('0xe'));var Papa=require(_0x1565('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1565('0x10'));var as=require(_0x1565('0x11'));var hardwareService=require(_0x1565('0x12'));var logger=require(_0x1565('0x13'))(_0x1565('0x14'));var utils=require(_0x1565('0x15'));var config=require('../../config/environment');var db=require(_0x1565('0x16'))['db'];function respondWithStatusCode(_0x17fe71,_0x5e003f){_0x5e003f=_0x5e003f||0xcc;return function(_0x11b5c1){if(_0x11b5c1){return _0x17fe71[_0x1565('0x17')](_0x5e003f);}return _0x17fe71[_0x1565('0x18')](_0x5e003f)['end']();};}function respondWithResult(_0x39963a,_0x4e9543){_0x4e9543=_0x4e9543||0xc8;return function(_0x3feb73){if(_0x3feb73){return _0x39963a[_0x1565('0x18')](_0x4e9543)[_0x1565('0x19')](_0x3feb73);}};}function respondWithFilteredResult(_0x236dd2,_0x218433){return function(_0x94cebd){if(_0x94cebd){var _0x36da90=_0x94cebd[_0x1565('0x1a')],_0x58237f=_0x218433[_0x1565('0x1b')],_0x161879=_0x218433[_0x1565('0x1b')]+_0x218433[_0x1565('0x1c')],_0x213367;if(_0x161879>=_0x36da90){_0x161879=_0x36da90;_0x213367=0xc8;}else{_0x213367=0xce;}_0x236dd2[_0x1565('0x18')](_0x213367);return _0x236dd2[_0x1565('0x1d')](_0x1565('0x1e'),_0x58237f+'-'+_0x161879+'/'+_0x36da90)['json'](_0x94cebd);}return null;};}function patchUpdates(_0xbb70a2){return function(_0x83ab62){try{jsonpatch[_0x1565('0x1f')](_0x83ab62,_0xbb70a2,!![]);}catch(_0x5d0aed){return BPromise[_0x1565('0x20')](_0x5d0aed);}return _0x83ab62[_0x1565('0x21')]();};}function saveUpdates(_0x4045f3,_0x33fee0){return function(_0x3f3f1c){if(_0x3f3f1c){return _0x3f3f1c[_0x1565('0x22')](_0x4045f3)[_0x1565('0x23')](function(_0x189e81){return _0x189e81;});}return null;};}function removeEntity(_0x4e619e,_0xf048d){return function(_0x208dcf){if(_0x208dcf){return _0x208dcf[_0x1565('0x24')]()[_0x1565('0x23')](function(){_0x4e619e[_0x1565('0x18')](0xcc)[_0x1565('0x25')]();});}};}function handleEntityNotFound(_0x2f52f3,_0x2daf2b){return function(_0x5cf1d7){if(!_0x5cf1d7){_0x2f52f3[_0x1565('0x17')](0x194);}return _0x5cf1d7;};}function handleError(_0x2742fa,_0x36e2e0){_0x36e2e0=_0x36e2e0||0x1f4;return function(_0x5a55cc){logger[_0x1565('0x26')](_0x5a55cc[_0x1565('0x27')]);if(_0x5a55cc[_0x1565('0x28')]){delete _0x5a55cc[_0x1565('0x28')];}_0x2742fa[_0x1565('0x18')](_0x36e2e0)[_0x1565('0x29')](_0x5a55cc);};}exports[_0x1565('0x2a')]=function(_0x40e955,_0x3e55fa){var _0x344488={},_0x4de093={},_0x26e2ae={'count':0x0,'rows':[]};var _0x49c352=_[_0x1565('0x2b')](db[_0x1565('0x2c')]['rawAttributes'],function(_0x17bf2d){return{'name':_0x17bf2d[_0x1565('0x2d')],'type':_0x17bf2d[_0x1565('0x2e')][_0x1565('0x2f')]};});_0x4de093[_0x1565('0x30')]=_[_0x1565('0x2b')](_0x49c352,_0x1565('0x28'));_0x4de093[_0x1565('0x31')]=_[_0x1565('0x32')](_0x40e955['query']);_0x4de093[_0x1565('0x33')]=_[_0x1565('0x34')](_0x4de093[_0x1565('0x30')],_0x4de093[_0x1565('0x31')]);_0x344488[_0x1565('0x35')]=_['intersection'](_0x4de093['model'],qs[_0x1565('0x36')](_0x40e955[_0x1565('0x31')]['fields']));_0x344488['attributes']=_0x344488[_0x1565('0x35')][_0x1565('0x37')]?_0x344488['attributes']:_0x4de093[_0x1565('0x30')];if(!_0x40e955['query'][_0x1565('0x38')](_0x1565('0x39'))){_0x344488[_0x1565('0x1c')]=qs[_0x1565('0x1c')](_0x40e955[_0x1565('0x31')][_0x1565('0x1c')]);_0x344488[_0x1565('0x1b')]=qs[_0x1565('0x1b')](_0x40e955[_0x1565('0x31')][_0x1565('0x1b')]);}_0x344488[_0x1565('0x3a')]=qs['sort'](_0x40e955[_0x1565('0x31')][_0x1565('0x3b')]);_0x344488[_0x1565('0x3c')]=qs['filters'](_[_0x1565('0x3d')](_0x40e955[_0x1565('0x31')],_0x4de093['filters']));if(_0x40e955['query'][_0x1565('0x3e')]){_0x344488[_0x1565('0x3c')]=_[_0x1565('0x3f')](_0x344488[_0x1565('0x3c')],{'$or':_[_0x1565('0x2b')](_0x49c352,function(_0x54efe4){if(_0x54efe4[_0x1565('0x2e')]!==_0x1565('0x40')){var _0x1ccfd4={};_0x1ccfd4[_0x54efe4[_0x1565('0x28')]]={'$like':'%'+_0x40e955['query'][_0x1565('0x3e')]+'%'};return _0x1ccfd4;}})});}_0x344488=_['merge']({},_0x344488,_0x40e955[_0x1565('0x41')]);var _0x1c7482={'where':_0x344488[_0x1565('0x3c')]};return db[_0x1565('0x2c')][_0x1565('0x1a')](_0x1c7482)['then'](function(_0x5d8d62){_0x26e2ae[_0x1565('0x1a')]=_0x5d8d62;if(_0x40e955[_0x1565('0x31')]['includeAll']){_0x344488[_0x1565('0x42')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x344488);})[_0x1565('0x23')](function(_0x1c6605){_0x26e2ae['rows']=_0x1c6605;return _0x26e2ae;})[_0x1565('0x23')](respondWithFilteredResult(_0x3e55fa,_0x344488))['catch'](handleError(_0x3e55fa,null));};exports[_0x1565('0x43')]=function(_0x883a30,_0x447a2){var _0x3a6b64={'raw':!![],'where':{'id':_0x883a30[_0x1565('0x44')]['id']}},_0x3b910c={};_0x3b910c[_0x1565('0x30')]=_[_0x1565('0x32')](db[_0x1565('0x2c')][_0x1565('0x45')]);_0x3b910c[_0x1565('0x31')]=_['keys'](_0x883a30[_0x1565('0x31')]);_0x3b910c['filters']=_[_0x1565('0x34')](_0x3b910c[_0x1565('0x30')],_0x3b910c[_0x1565('0x31')]);_0x3a6b64[_0x1565('0x35')]=_['intersection'](_0x3b910c[_0x1565('0x30')],qs[_0x1565('0x36')](_0x883a30[_0x1565('0x31')][_0x1565('0x36')]));_0x3a6b64[_0x1565('0x35')]=_0x3a6b64[_0x1565('0x35')][_0x1565('0x37')]?_0x3a6b64[_0x1565('0x35')]:_0x3b910c[_0x1565('0x30')];if(_0x883a30['query'][_0x1565('0x46')]){_0x3a6b64['include']=[{'all':!![]}];}_0x3a6b64=_[_0x1565('0x3f')]({},_0x3a6b64,_0x883a30['options']);return db['VoiceQueuesLog']['find'](_0x3a6b64)[_0x1565('0x23')](handleEntityNotFound(_0x447a2,null))[_0x1565('0x23')](respondWithResult(_0x447a2,null))[_0x1565('0x47')](handleError(_0x447a2,null));};exports['create']=function(_0x1488e8,_0x177a91){return db[_0x1565('0x2c')][_0x1565('0x48')](_0x1488e8[_0x1565('0x49')],{})[_0x1565('0x23')](respondWithResult(_0x177a91,0xc9))[_0x1565('0x47')](handleError(_0x177a91,null));};exports[_0x1565('0x22')]=function(_0x3fd176,_0x2dc112){if(_0x3fd176[_0x1565('0x49')]['id']){delete _0x3fd176[_0x1565('0x49')]['id'];}return db[_0x1565('0x2c')]['find']({'where':{'id':_0x3fd176['params']['id']}})[_0x1565('0x23')](handleEntityNotFound(_0x2dc112,null))[_0x1565('0x23')](saveUpdates(_0x3fd176['body'],null))[_0x1565('0x23')](respondWithResult(_0x2dc112,null))[_0x1565('0x47')](handleError(_0x2dc112,null));};exports[_0x1565('0x24')]=function(_0x2249f7,_0x1f9dda){return db[_0x1565('0x2c')][_0x1565('0x4a')]({'where':{'id':_0x2249f7['params']['id']}})[_0x1565('0x23')](handleEntityNotFound(_0x1f9dda,null))['then'](removeEntity(_0x1f9dda,null))['catch'](handleError(_0x1f9dda,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index dc173c5..9e2a96b 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce42=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm'];(function(_0x3b8a0c,_0x32a917){var _0x1cc213=function(_0x5d0c24){while(--_0x5d0c24){_0x3b8a0c['push'](_0x3b8a0c['shift']());}};_0x1cc213(++_0x32a917);}(_0xce42,0x160));var _0x2ce4=function(_0x56ec52,_0x35e3c3){_0x56ec52=_0x56ec52-0x0;var _0x324eb2=_0xce42[_0x56ec52];return _0x324eb2;};'use strict';var _=require('lodash');var util=require(_0x2ce4('0x0'));var logger=require(_0x2ce4('0x1'))(_0x2ce4('0x2'));var moment=require(_0x2ce4('0x3'));var BPromise=require(_0x2ce4('0x4'));var rp=require(_0x2ce4('0x5'));var fs=require('fs');var path=require(_0x2ce4('0x6'));var rimraf=require(_0x2ce4('0x7'));var config=require(_0x2ce4('0x8'));var attributes=require(_0x2ce4('0x9'));module[_0x2ce4('0xa')]=function(_0x1b5d3f,_0x1b2bd3){return _0x1b5d3f[_0x2ce4('0xb')](_0x2ce4('0xc'),attributes,{'tableName':_0x2ce4('0xd'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x2ce4('0xe'),_0x2ce4('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc0a3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','dtm','util','../../config/logger','api'];(function(_0x6006e1,_0x324850){var _0x578df7=function(_0x5ed909){while(--_0x5ed909){_0x6006e1['push'](_0x6006e1['shift']());}};_0x578df7(++_0x324850);}(_0xc0a3,0x1ec));var _0x3c0a=function(_0x428dc0,_0x5e9164){_0x428dc0=_0x428dc0-0x0;var _0x6574a2=_0xc0a3[_0x428dc0];return _0x6574a2;};'use strict';var _=require('lodash');var util=require(_0x3c0a('0x0'));var logger=require(_0x3c0a('0x1'))(_0x3c0a('0x2'));var moment=require(_0x3c0a('0x3'));var BPromise=require(_0x3c0a('0x4'));var rp=require(_0x3c0a('0x5'));var fs=require('fs');var path=require(_0x3c0a('0x6'));var rimraf=require(_0x3c0a('0x7'));var config=require(_0x3c0a('0x8'));var attributes=require(_0x3c0a('0x9'));module[_0x3c0a('0xa')]=function(_0x2f6255,_0xcac1cd){return _0x2f6255[_0x3c0a('0xb')]('VoiceQueuesLog',attributes,{'tableName':_0x3c0a('0xc'),'paranoid':![],'indexes':[{'name':_0x3c0a('0xd'),'fields':['event',_0x3c0a('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index be1308a..f0dc3c1 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0xe820=['message','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0xe820,0xd2));var _0x0e82=function(_0x4e6ba6,_0x5e8a91){_0x4e6ba6=_0x4e6ba6-0x0;var _0x2f4249=_0xe820[_0x4e6ba6];return _0x2f4249;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 675c2d4..a11f8e0 100644 --- a/server/api/voiceRecording/index.js +++ b/server/api/voiceRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5327=['multer','util','connect-timeout','express','Router','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id/download','download','downloads','create','/:id','update','exports'];(function(_0x2aca63,_0x2d410f){var _0x433cb3=function(_0x58f069){while(--_0x58f069){_0x2aca63['push'](_0x2aca63['shift']());}};_0x433cb3(++_0x2d410f);}(_0x5327,0xab));var _0x7532=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5327[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7532('0x0'));var util=require(_0x7532('0x1'));var path=require('path');var timeout=require(_0x7532('0x2'));var express=require(_0x7532('0x3'));var router=express[_0x7532('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7532('0x5'));var controller=require(_0x7532('0x6'));router[_0x7532('0x7')]('/',auth[_0x7532('0x8')](),controller[_0x7532('0x9')]);router[_0x7532('0x7')](_0x7532('0xa'),auth[_0x7532('0x8')](),controller[_0x7532('0xb')]);router[_0x7532('0x7')]('/:id',auth[_0x7532('0x8')](),controller['show']);router[_0x7532('0x7')](_0x7532('0xc'),auth[_0x7532('0x8')](),controller[_0x7532('0xd')]);router['get']('/:id/downloads',controller[_0x7532('0xe')]);router['post']('/',auth[_0x7532('0x8')](),controller[_0x7532('0xf')]);router['put'](_0x7532('0x10'),auth[_0x7532('0x8')](),controller[_0x7532('0x11')]);router['delete'](_0x7532('0x10'),auth[_0x7532('0x8')](),controller['destroy']);module[_0x7532('0x12')]=router; \ No newline at end of file +var _0x7220=['../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','show','download','/:id/downloads','post','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0x7220,0x143));var _0x0722=function(_0x3dd7a7,_0x5dce98){_0x3dd7a7=_0x3dd7a7-0x0;var _0x397574=_0x7220[_0x3dd7a7];return _0x397574;};'use strict';var multer=require(_0x0722('0x0'));var util=require(_0x0722('0x1'));var path=require(_0x0722('0x2'));var timeout=require('connect-timeout');var express=require(_0x0722('0x3'));var router=express[_0x0722('0x4')]();var auth=require(_0x0722('0x5'));var interaction=require(_0x0722('0x6'));var config=require(_0x0722('0x7'));var controller=require(_0x0722('0x8'));router[_0x0722('0x9')]('/',auth['isAuthenticated'](),controller[_0x0722('0xa')]);router[_0x0722('0x9')](_0x0722('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0722('0x9')]('/:id',auth[_0x0722('0xc')](),controller[_0x0722('0xd')]);router[_0x0722('0x9')]('/:id/download',auth[_0x0722('0xc')](),controller[_0x0722('0xe')]);router[_0x0722('0x9')](_0x0722('0xf'),controller['downloads']);router[_0x0722('0x10')]('/',auth[_0x0722('0xc')](),controller['create']);router[_0x0722('0x11')](_0x0722('0x12'),auth[_0x0722('0xc')](),controller['update']);router[_0x0722('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x0722('0x14')]);module[_0x0722('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 6de0675..75c3e6a 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0ca=['setDataValue','channel','split','STRING','INTEGER','createdAt','MM-DD-YYYY\x20HH:mm','DATE','updatedAt','toString','moment','path','exports','VIRTUAL','getDataValue','value'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf0ca,0xea));var _0xaf0c=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0xf0ca[_0x680821];return _0x3f132c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaf0c('0x0'));var path=require(_0xaf0c('0x1'));module[_0xaf0c('0x2')]={'format':{'type':Sequelize[_0xaf0c('0x3')],'get':function(){return this[_0xaf0c('0x4')](_0xaf0c('0x5'))?path['extname'](this[_0xaf0c('0x4')](_0xaf0c('0x5'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING'],'set':function(_0x331dac){if(_0x331dac){this[_0xaf0c('0x6')](_0xaf0c('0x7'),_0x331dac);this['setDataValue']('membername',_0x331dac[_0xaf0c('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xaf0c('0x9')]},'calleridnum':{'type':Sequelize[_0xaf0c('0x9')]},'calleridname':{'type':Sequelize[_0xaf0c('0x9')]},'connectedlinenum':{'type':Sequelize[_0xaf0c('0x9')]},'connectedlinename':{'type':Sequelize[_0xaf0c('0x9')]},'accountcode':{'type':Sequelize[_0xaf0c('0x9')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xaf0c('0x9')]},'value':{'type':Sequelize[_0xaf0c('0x9')]},'type':{'type':Sequelize[_0xaf0c('0x9')]},'rating':{'type':Sequelize[_0xaf0c('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xaf0c('0x9')]},'userDisposition':{'type':Sequelize[_0xaf0c('0x9')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xaf0c('0x4')](_0xaf0c('0xb')))['format'](_0xaf0c('0xc'))['toString']();}},'updatedAt':{'type':Sequelize[_0xaf0c('0xd')],'get':function(){return moment(this[_0xaf0c('0x4')](_0xaf0c('0xe')))['format'](_0xaf0c('0xc'))[_0xaf0c('0xf')]();}}}; \ No newline at end of file +var _0x1b2c=['setDataValue','membername','INTEGER','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','sequelize','moment','exports','VIRTUAL','getDataValue','extname','value','STRING','channel'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x1b2c,0x1e4));var _0xc1b2=function(_0x3146e5,_0xa9e41){_0x3146e5=_0x3146e5-0x0;var _0x3bbd69=_0x1b2c[_0x3146e5];return _0x3bbd69;};'use strict';var Sequelize=require(_0xc1b2('0x0'));var moment=require(_0xc1b2('0x1'));var path=require('path');module[_0xc1b2('0x2')]={'format':{'type':Sequelize[_0xc1b2('0x3')],'get':function(){return this[_0xc1b2('0x4')]('value')?path[_0xc1b2('0x5')](this[_0xc1b2('0x4')](_0xc1b2('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0xc1b2('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x2e1f21){if(_0x2e1f21){this['setDataValue'](_0xc1b2('0x8'),_0x2e1f21);this[_0xc1b2('0x9')](_0xc1b2('0xa'),_0x2e1f21['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xc1b2('0x7')]},'calleridnum':{'type':Sequelize[_0xc1b2('0x7')]},'calleridname':{'type':Sequelize[_0xc1b2('0x7')]},'connectedlinenum':{'type':Sequelize[_0xc1b2('0x7')]},'connectedlinename':{'type':Sequelize[_0xc1b2('0x7')]},'accountcode':{'type':Sequelize[_0xc1b2('0x7')]},'context':{'type':Sequelize[_0xc1b2('0x7')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xc1b2('0x7')]},'type':{'type':Sequelize[_0xc1b2('0x7')]},'rating':{'type':Sequelize[_0xc1b2('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xc1b2('0x7')]},'userDisposition':{'type':Sequelize[_0xc1b2('0x7')]},'createdAt':{'type':Sequelize[_0xc1b2('0xc')],'get':function(){return moment(this[_0xc1b2('0x4')](_0xc1b2('0xd')))[_0xc1b2('0xe')](_0xc1b2('0xf'))[_0xc1b2('0x10')]();}},'updatedAt':{'type':Sequelize[_0xc1b2('0xc')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xc1b2('0xe')](_0xc1b2('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 93e4a0d..cc56e43 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3423=['desk.js','querystring','../../components/auth/service','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','sendStatus','stack','index','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','map','name','format','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','count','include','show','params','keys','includeAll','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','downloads','sequelize','MD5','col','token','$and','%s.cypher','decryptFile','recording','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','error','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x423562,_0x4f74af){var _0x141574=function(_0x4ae02a){while(--_0x4ae02a){_0x423562['push'](_0x423562['shift']());}};_0x141574(++_0x4f74af);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3342('0x0'));var zipdir=require(_0x3342('0x1'));var jsonpatch=require(_0x3342('0x2'));var rp=require(_0x3342('0x3'));var moment=require(_0x3342('0x4'));var BPromise=require(_0x3342('0x5'));var Mustache=require(_0x3342('0x6'));var util=require(_0x3342('0x7'));var path=require(_0x3342('0x8'));var sox=require(_0x3342('0x9'));var csv=require(_0x3342('0xa'));var ejs=require(_0x3342('0xb'));var fs=require('fs');var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0xa'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3342('0x13'));var utils=require(_0x3342('0x14'));var config=require('../../config/environment');var db=require(_0x3342('0x15'))['db'];function respondWithStatusCode(_0x5a3cb1,_0x716d80){_0x716d80=_0x716d80||0xcc;return function(_0x36e1f4){if(_0x36e1f4){return _0x5a3cb1['sendStatus'](_0x716d80);}return _0x5a3cb1[_0x3342('0x16')](_0x716d80)[_0x3342('0x17')]();};}function respondWithResult(_0x38e3f7,_0xe4689e){_0xe4689e=_0xe4689e||0xc8;return function(_0x61fcc0){if(_0x61fcc0){return _0x38e3f7[_0x3342('0x16')](_0xe4689e)[_0x3342('0x18')](_0x61fcc0);}};}function respondWithFilteredResult(_0x59be1d,_0x3e44f3){return function(_0x19bd71){if(_0x19bd71){var _0x49afe3=_0x19bd71['count'],_0x40d609=_0x3e44f3[_0x3342('0x19')],_0x2c9df0=_0x3e44f3[_0x3342('0x19')]+_0x3e44f3[_0x3342('0x1a')],_0x51ef91;if(_0x2c9df0>=_0x49afe3){_0x2c9df0=_0x49afe3;_0x51ef91=0xc8;}else{_0x51ef91=0xce;}_0x59be1d[_0x3342('0x16')](_0x51ef91);return _0x59be1d[_0x3342('0x1b')](_0x3342('0x1c'),_0x40d609+'-'+_0x2c9df0+'/'+_0x49afe3)[_0x3342('0x18')](_0x19bd71);}return null;};}function patchUpdates(_0x3ebf6b){return function(_0x2c90c8){try{jsonpatch['apply'](_0x2c90c8,_0x3ebf6b,!![]);}catch(_0x283fc1){return BPromise[_0x3342('0x1d')](_0x283fc1);}return _0x2c90c8[_0x3342('0x1e')]();};}function saveUpdates(_0x5e05f5,_0x3cb86f){return function(_0x463324){if(_0x463324){return _0x463324['update'](_0x5e05f5)[_0x3342('0x1f')](function(_0x28528b){return _0x28528b;});}return null;};}function removeEntity(_0x4b765d,_0x4e1b19){return function(_0x5a0658){if(_0x5a0658){return _0x5a0658[_0x3342('0x20')]()[_0x3342('0x1f')](function(){_0x4b765d[_0x3342('0x16')](0xcc)[_0x3342('0x17')]();});}};}function handleEntityNotFound(_0xd2b87d,_0x2925a2){return function(_0x26eb87){if(!_0x26eb87){_0xd2b87d[_0x3342('0x21')](0x194);}return _0x26eb87;};}function handleError(_0x5d4f14,_0x30ffc9){_0x30ffc9=_0x30ffc9||0x1f4;return function(_0x517db5){logger['error'](_0x517db5[_0x3342('0x22')]);if(_0x517db5['name']){delete _0x517db5['name'];}_0x5d4f14[_0x3342('0x16')](_0x30ffc9)['send'](_0x517db5);};}exports[_0x3342('0x23')]=function(_0x543ec3,_0x524286){var _0x55cddd={},_0x1497d9={},_0x286c42={'count':0x0,'rows':[]};var _0x1dd607=_['map'](db[_0x3342('0x24')][_0x3342('0x25')],function(_0x1cc542){return{'name':_0x1cc542[_0x3342('0x26')],'type':_0x1cc542['type'][_0x3342('0x27')]};});_0x1497d9[_0x3342('0x28')]=_[_0x3342('0x29')](_[_0x3342('0x2a')](_0x1dd607,_0x3342('0x2b')),[_0x3342('0x2c')]);_0x1497d9[_0x3342('0x2d')]=_['keys'](_0x543ec3[_0x3342('0x2d')]);_0x1497d9['filters']=_[_0x3342('0x2e')](_0x1497d9[_0x3342('0x28')],_0x1497d9['query']);_0x55cddd[_0x3342('0x2f')]=_[_0x3342('0x2e')](_0x1497d9[_0x3342('0x28')],qs[_0x3342('0x30')](_0x543ec3['query'][_0x3342('0x30')]));_0x55cddd[_0x3342('0x2f')]=_0x55cddd[_0x3342('0x2f')][_0x3342('0x31')]?_0x55cddd[_0x3342('0x2f')]:_0x1497d9[_0x3342('0x28')];if(!_0x543ec3[_0x3342('0x2d')][_0x3342('0x32')](_0x3342('0x33'))){_0x55cddd[_0x3342('0x1a')]=qs[_0x3342('0x1a')](_0x543ec3[_0x3342('0x2d')]['limit']);_0x55cddd['offset']=qs[_0x3342('0x19')](_0x543ec3['query'][_0x3342('0x19')]);}_0x55cddd[_0x3342('0x34')]=qs[_0x3342('0x35')](_0x543ec3[_0x3342('0x2d')][_0x3342('0x35')]);_0x55cddd[_0x3342('0x36')]=qs[_0x3342('0x37')](_['pick'](_0x543ec3[_0x3342('0x2d')],_0x1497d9[_0x3342('0x37')]));if(_0x543ec3[_0x3342('0x2d')][_0x3342('0x38')]){_0x55cddd[_0x3342('0x36')]=_['merge'](_0x55cddd[_0x3342('0x36')],{'$or':_['map'](_0x1dd607,function(_0x22ca76){if(_0x22ca76[_0x3342('0x39')]!==_0x3342('0x3a')){var _0x2e57a0={};_0x2e57a0[_0x22ca76['name']]={'$like':'%'+_0x543ec3[_0x3342('0x2d')]['filter']+'%'};return _0x2e57a0;}})});}_0x55cddd=_[_0x3342('0x3b')]({},_0x55cddd,_0x543ec3[_0x3342('0x3c')]);var _0x2e815e={'where':_0x55cddd[_0x3342('0x36')]};return db[_0x3342('0x24')][_0x3342('0x3d')](_0x2e815e)[_0x3342('0x1f')](function(_0x52cdc0){_0x286c42[_0x3342('0x3d')]=_0x52cdc0;if(_0x543ec3[_0x3342('0x2d')]['includeAll']){_0x55cddd[_0x3342('0x3e')]=[{'all':!![]}];}return db[_0x3342('0x24')]['findAll'](_0x55cddd);})[_0x3342('0x1f')](function(_0x29f0a0){_0x286c42['rows']=_0x29f0a0;return _0x286c42;})['then'](respondWithFilteredResult(_0x524286,_0x55cddd))['catch'](handleError(_0x524286,null));};exports[_0x3342('0x3f')]=function(_0x41e727,_0x594285){var _0x40af89={'raw':![],'where':{'id':_0x41e727[_0x3342('0x40')]['id']}},_0x2a1f7e={};_0x2a1f7e[_0x3342('0x28')]=_[_0x3342('0x41')](db[_0x3342('0x24')][_0x3342('0x25')]);_0x2a1f7e[_0x3342('0x2d')]=_['keys'](_0x41e727['query']);_0x2a1f7e[_0x3342('0x37')]=_[_0x3342('0x2e')](_0x2a1f7e[_0x3342('0x28')],_0x2a1f7e[_0x3342('0x2d')]);_0x40af89[_0x3342('0x2f')]=_[_0x3342('0x2e')](_0x2a1f7e['model'],qs[_0x3342('0x30')](_0x41e727[_0x3342('0x2d')][_0x3342('0x30')]));_0x40af89[_0x3342('0x2f')]=_0x40af89[_0x3342('0x2f')][_0x3342('0x31')]?_0x40af89['attributes']:_0x2a1f7e[_0x3342('0x28')];if(_0x41e727['query'][_0x3342('0x42')]){_0x40af89[_0x3342('0x3e')]=[{'all':!![]}];}_0x40af89=_[_0x3342('0x3b')]({},_0x40af89,_0x41e727[_0x3342('0x3c')]);return db['VoiceRecording'][_0x3342('0x43')](_0x40af89)[_0x3342('0x1f')](handleEntityNotFound(_0x594285,null))['then'](respondWithResult(_0x594285,null))[_0x3342('0x44')](handleError(_0x594285,null));};exports[_0x3342('0x45')]=function(_0x169549,_0x16cebb){return db['VoiceRecording'][_0x3342('0x45')](_0x169549[_0x3342('0x46')],{})['then'](respondWithResult(_0x16cebb,0xc9))[_0x3342('0x44')](handleError(_0x16cebb,null));};exports['update']=function(_0x5683e0,_0x31aeaf){if(_0x5683e0[_0x3342('0x46')]['id']){delete _0x5683e0[_0x3342('0x46')]['id'];}return db[_0x3342('0x24')][_0x3342('0x43')]({'where':{'id':_0x5683e0[_0x3342('0x40')]['id']}})[_0x3342('0x1f')](handleEntityNotFound(_0x31aeaf,null))['then'](saveUpdates(_0x5683e0['body'],null))[_0x3342('0x1f')](respondWithResult(_0x31aeaf,null))['catch'](handleError(_0x31aeaf,null));};exports[_0x3342('0x47')]=function(_0x5e1202,_0x4c9214){return db['VoiceRecording'][_0x3342('0x47')]()[_0x3342('0x1f')](respondWithResult(_0x4c9214,null))[_0x3342('0x44')](handleError(_0x4c9214,null));};exports[_0x3342('0x48')]=function(_0x5176d7,_0x3eff37,_0x3a6597){var _0x4ce271=require(_0x3342('0x49'));var _0x24d543=![];var _0x43c27a={};if(_0x5176d7['query'][_0x3342('0x39')]&&_0x5176d7[_0x3342('0x2d')][_0x3342('0x39')]===_0x3342('0x4a')){_0x43c27a[_0x3342('0x4a')]=_0x5176d7['params']['id'];}else{_0x43c27a['id']=_0x5176d7[_0x3342('0x40')]['id'];}return db[_0x3342('0x24')][_0x3342('0x43')]({'where':_0x43c27a,'attributes':['id',_0x3342('0x4b')],'raw':!![]})[_0x3342('0x1f')](handleEntityNotFound(_0x3eff37,null))[_0x3342('0x1f')](function(_0x3db07c){if(_0x3db07c){var _0x47cf76=_0x3db07c[_0x3342('0x4b')];var _0x542181=util[_0x3342('0x2c')]('%s.cypher',_0x47cf76);if(fs[_0x3342('0x4c')](_0x542181)){_0x24d543=!![];return _0x4ce271['decryptFile'](_0x542181,_0x47cf76,config['secrets']['recording'])['then'](function(){return _0x3db07c;});}return _0x3db07c;}})[_0x3342('0x1f')](function(_0xdaabb4){if(_0xdaabb4){var _0x3cd098=_0xdaabb4[_0x3342('0x4b')];if(!fs[_0x3342('0x4c')](_0x3cd098)){throw new db[(_0x3342('0x4d'))][(_0x3342('0x4e'))](_0x3342('0x4f'));}if(_0xdaabb4[_0x3342('0x50')]){return _0x3eff37[_0x3342('0x48')](_0x3cd098,_0xdaabb4[_0x3342('0x50')]+path['extname'](_0x3cd098),function(){if(_0x24d543){fs['unlink'](_0x3cd098);}});}else{return _0x3eff37[_0x3342('0x48')](_0x3cd098,function(_0x53e54b){if(_0x24d543){fs[_0x3342('0x51')](_0x3cd098);}});}}})['catch'](function(_0x4c777e){if(_0x4c777e[_0x3342('0x52')]===_0x3342('0x4f')){_0x3eff37[_0x3342('0x16')](0x194)['send']('Not\x20found');}else{return handleError(_0x3eff37,null);}});};exports[_0x3342('0x53')]=function(_0x3cc92a,_0x5e9161,_0x2da4b7){var _0x219a17=require(_0x3342('0x49'));var _0x4d3660=![];var _0x23c186={'$and':[db[_0x3342('0x54')][_0x3342('0x36')](db[_0x3342('0x54')]['fn'](_0x3342('0x55'),db[_0x3342('0x54')][_0x3342('0x56')]('uniqueid')),_0x3cc92a['query'][_0x3342('0x57')])]};if(_0x3cc92a['query'][_0x3342('0x39')]&&_0x3cc92a[_0x3342('0x2d')][_0x3342('0x39')]===_0x3342('0x4a')){_0x23c186[_0x3342('0x58')]['push']({'uniqueid':_0x3cc92a[_0x3342('0x40')]['id']});}else{_0x23c186[_0x3342('0x58')]['push']({'id':_0x3cc92a[_0x3342('0x40')]['id']});}return db[_0x3342('0x24')][_0x3342('0x43')]({'where':_0x23c186,'attributes':['id',_0x3342('0x4b')],'raw':!![]})[_0x3342('0x1f')](handleEntityNotFound(_0x5e9161,null))[_0x3342('0x1f')](function(_0x19fcc5){if(_0x19fcc5){var _0x2f6a48=util[_0x3342('0x2c')](_0x3342('0x59'),_0x19fcc5[_0x3342('0x4b')]);if(fs[_0x3342('0x4c')](_0x2f6a48)){_0x4d3660=!![];return _0x219a17[_0x3342('0x5a')](_0x2f6a48,_0x19fcc5['value'],config['secrets'][_0x3342('0x5b')])[_0x3342('0x1f')](function(){return _0x19fcc5;});}return _0x19fcc5;}})[_0x3342('0x1f')](function(_0x3cd93a){if(_0x3cd93a){if(!fs['existsSync'](_0x3cd93a['value'])){throw new db[(_0x3342('0x4d'))][(_0x3342('0x4e'))](_0x3342('0x4f'));}if(_0x3cd93a[_0x3342('0x50')]){return _0x5e9161[_0x3342('0x48')](_0x3cd93a[_0x3342('0x4b')],_0x3cd93a[_0x3342('0x50')]+path[_0x3342('0x5c')](_0x3cd93a[_0x3342('0x4b')]),function(){if(_0x4d3660){fs[_0x3342('0x51')](_0x3cd93a['value']);}});}else{return _0x5e9161[_0x3342('0x48')](_0x3cd93a['value'],function(_0x1c5d7d){if(_0x4d3660){fs[_0x3342('0x51')](_0x3cd93a['value']);}});}}})[_0x3342('0x44')](handleError(_0x5e9161,null));};exports[_0x3342('0x20')]=function(_0x5c9720,_0x317836){return db[_0x3342('0x24')][_0x3342('0x43')]({'where':{'id':_0x5c9720[_0x3342('0x40')]['id']}})[_0x3342('0x1f')](function(_0x42bc3b){if(!_0x42bc3b)throw new ReferenceError(_0x3342('0x5d'));return _0x42bc3b;})['then'](function(_0x100553){var _0x58facc=_0x100553['value'];logger[_0x3342('0x5e')](_0x3342('0x5f'),_0x58facc);if(!_[_0x3342('0x60')](_0x100553[_0x3342('0x4b')])&&fs[_0x3342('0x4c')](_0x58facc)){logger[_0x3342('0x5e')](_0x3342('0x61')+_0x58facc+_0x3342('0x62'));fs['unlinkSync'](_0x58facc);}_0x58facc=_0x58facc+_0x3342('0x63');if(!_[_0x3342('0x60')](_0x100553[_0x3342('0x4b')])&&fs[_0x3342('0x4c')](_0x58facc)){logger[_0x3342('0x5e')](_0x3342('0x61')+_0x58facc+_0x3342('0x62'));fs['unlinkSync'](_0x58facc);}return _0x100553;})[_0x3342('0x1f')](function(_0x1929c2){if(!_0x1929c2)throw new InternalError();return _0x1929c2[_0x3342('0x20')]();})[_0x3342('0x1f')](function(){_0x317836[_0x3342('0x16')](0xcc)[_0x3342('0x17')]();})['catch'](function(_0x59ac64){var _0x585b5e=0x1f4;if(e instanceof ReferenceError){_0x585b5e=0x194;}else if(e instanceof InternalError){_0x585b5e=0x1f4;}logger[_0x3342('0x64')](_0x59ac64[_0x3342('0x22')]);if(_0x59ac64[_0x3342('0x2b')]){delete _0x59ac64[_0x3342('0x2b')];}_0x317836[_0x3342('0x16')](_0x585b5e)[_0x3342('0x65')](_0x59ac64);});}; \ No newline at end of file +var _0xd7d1=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','VoiceRecording','includeAll','findAll','show','include','find','create','body','catch','params','describe','download','../../components/encryptor','type','uniqueid','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','value','ValidationError','VoiceRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','stack','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4beb16,_0x30248d){var _0x41d5ed=function(_0x759f9e){while(--_0x759f9e){_0x4beb16['push'](_0x4beb16['shift']());}};_0x41d5ed(++_0x30248d);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x552f35,_0x1b1f33){_0x552f35=_0x552f35-0x0;var _0x3bed12=_0xd7d1[_0x552f35];return _0x3bed12;};'use strict';var pdf=require(_0x1d7d('0x0'));var emlformat=require(_0x1d7d('0x1'));var rimraf=require(_0x1d7d('0x2'));var zipdir=require(_0x1d7d('0x3'));var jsonpatch=require(_0x1d7d('0x4'));var rp=require(_0x1d7d('0x5'));var moment=require(_0x1d7d('0x6'));var BPromise=require(_0x1d7d('0x7'));var Mustache=require(_0x1d7d('0x8'));var util=require(_0x1d7d('0x9'));var path=require(_0x1d7d('0xa'));var sox=require(_0x1d7d('0xb'));var csv=require(_0x1d7d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xc'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var db=require(_0x1d7d('0x1b'))['db'];function respondWithStatusCode(_0x5c7445,_0x11b83f){_0x11b83f=_0x11b83f||0xcc;return function(_0x5ae1c9){if(_0x5ae1c9){return _0x5c7445['sendStatus'](_0x11b83f);}return _0x5c7445[_0x1d7d('0x1c')](_0x11b83f)[_0x1d7d('0x1d')]();};}function respondWithResult(_0x5dd438,_0x55dba7){_0x55dba7=_0x55dba7||0xc8;return function(_0x1d3822){if(_0x1d3822){return _0x5dd438[_0x1d7d('0x1c')](_0x55dba7)[_0x1d7d('0x1e')](_0x1d3822);}};}function respondWithFilteredResult(_0x183fc6,_0xeb05b3){return function(_0x53423f){if(_0x53423f){var _0x28adf3=_0x53423f[_0x1d7d('0x1f')],_0x1de6cc=_0xeb05b3[_0x1d7d('0x20')],_0x51cbca=_0xeb05b3[_0x1d7d('0x20')]+_0xeb05b3[_0x1d7d('0x21')],_0xb90a8c;if(_0x51cbca>=_0x28adf3){_0x51cbca=_0x28adf3;_0xb90a8c=0xc8;}else{_0xb90a8c=0xce;}_0x183fc6['status'](_0xb90a8c);return _0x183fc6[_0x1d7d('0x22')](_0x1d7d('0x23'),_0x1de6cc+'-'+_0x51cbca+'/'+_0x28adf3)['json'](_0x53423f);}return null;};}function patchUpdates(_0x495212){return function(_0x2406dd){try{jsonpatch[_0x1d7d('0x24')](_0x2406dd,_0x495212,!![]);}catch(_0x2a9f2b){return BPromise[_0x1d7d('0x25')](_0x2a9f2b);}return _0x2406dd[_0x1d7d('0x26')]();};}function saveUpdates(_0x275d3c,_0x54d401){return function(_0x225f85){if(_0x225f85){return _0x225f85[_0x1d7d('0x27')](_0x275d3c)[_0x1d7d('0x28')](function(_0x5692d9){return _0x5692d9;});}return null;};}function removeEntity(_0x29caf4,_0x12c54b){return function(_0x4a1cdc){if(_0x4a1cdc){return _0x4a1cdc['destroy']()[_0x1d7d('0x28')](function(){_0x29caf4[_0x1d7d('0x1c')](0xcc)[_0x1d7d('0x1d')]();});}};}function handleEntityNotFound(_0x5097b8,_0x377653){return function(_0x106376){if(!_0x106376){_0x5097b8[_0x1d7d('0x29')](0x194);}return _0x106376;};}function handleError(_0x21e59,_0x4fa346){_0x4fa346=_0x4fa346||0x1f4;return function(_0x233463){logger[_0x1d7d('0x2a')](_0x233463['stack']);if(_0x233463['name']){delete _0x233463[_0x1d7d('0x2b')];}_0x21e59['status'](_0x4fa346)[_0x1d7d('0x2c')](_0x233463);};}exports[_0x1d7d('0x2d')]=function(_0x3bc6e8,_0x22c40d){var _0x465938={},_0x59f827={},_0x1c2616={'count':0x0,'rows':[]};var _0x98c1ad=_[_0x1d7d('0x2e')](db['VoiceRecording'][_0x1d7d('0x2f')],function(_0x1a935a){return{'name':_0x1a935a[_0x1d7d('0x30')],'type':_0x1a935a['type']['key']};});_0x59f827['model']=_[_0x1d7d('0x31')](_[_0x1d7d('0x2e')](_0x98c1ad,'name'),[_0x1d7d('0x32')]);_0x59f827[_0x1d7d('0x33')]=_[_0x1d7d('0x34')](_0x3bc6e8[_0x1d7d('0x33')]);_0x59f827[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x59f827[_0x1d7d('0x37')],_0x59f827[_0x1d7d('0x33')]);_0x465938[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0x59f827['model'],qs['fields'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x39')]));_0x465938[_0x1d7d('0x38')]=_0x465938[_0x1d7d('0x38')][_0x1d7d('0x3a')]?_0x465938[_0x1d7d('0x38')]:_0x59f827[_0x1d7d('0x37')];if(!_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3b')]('nolimit')){_0x465938[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x21')]);_0x465938['offset']=qs['offset'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x20')]);}_0x465938['order']=qs[_0x1d7d('0x3c')](_0x3bc6e8[_0x1d7d('0x33')]['sort']);_0x465938['where']=qs[_0x1d7d('0x35')](_[_0x1d7d('0x3d')](_0x3bc6e8[_0x1d7d('0x33')],_0x59f827[_0x1d7d('0x35')]));if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3e')]){_0x465938[_0x1d7d('0x3f')]=_[_0x1d7d('0x40')](_0x465938[_0x1d7d('0x3f')],{'$or':_[_0x1d7d('0x2e')](_0x98c1ad,function(_0x4fcdcc){if(_0x4fcdcc['type']!=='VIRTUAL'){var _0x5cab41={};_0x5cab41[_0x4fcdcc[_0x1d7d('0x2b')]]={'$like':'%'+_0x3bc6e8['query'][_0x1d7d('0x3e')]+'%'};return _0x5cab41;}})});}_0x465938=_[_0x1d7d('0x40')]({},_0x465938,_0x3bc6e8[_0x1d7d('0x41')]);var _0x515199={'where':_0x465938[_0x1d7d('0x3f')]};return db[_0x1d7d('0x42')][_0x1d7d('0x1f')](_0x515199)['then'](function(_0x1a6a8c){_0x1c2616[_0x1d7d('0x1f')]=_0x1a6a8c;if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x465938['include']=[{'all':!![]}];}return db[_0x1d7d('0x42')][_0x1d7d('0x44')](_0x465938);})[_0x1d7d('0x28')](function(_0x456d51){_0x1c2616['rows']=_0x456d51;return _0x1c2616;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x22c40d,_0x465938))['catch'](handleError(_0x22c40d,null));};exports[_0x1d7d('0x45')]=function(_0x31b850,_0x671580){var _0x1106d1={'raw':![],'where':{'id':_0x31b850['params']['id']}},_0xf667a1={};_0xf667a1['model']=_[_0x1d7d('0x34')](db[_0x1d7d('0x42')][_0x1d7d('0x2f')]);_0xf667a1['query']=_['keys'](_0x31b850[_0x1d7d('0x33')]);_0xf667a1['filters']=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],_0xf667a1[_0x1d7d('0x33')]);_0x1106d1[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],qs[_0x1d7d('0x39')](_0x31b850['query'][_0x1d7d('0x39')]));_0x1106d1[_0x1d7d('0x38')]=_0x1106d1['attributes'][_0x1d7d('0x3a')]?_0x1106d1[_0x1d7d('0x38')]:_0xf667a1[_0x1d7d('0x37')];if(_0x31b850[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x1106d1[_0x1d7d('0x46')]=[{'all':!![]}];}_0x1106d1=_[_0x1d7d('0x40')]({},_0x1106d1,_0x31b850[_0x1d7d('0x41')]);return db[_0x1d7d('0x42')][_0x1d7d('0x47')](_0x1106d1)[_0x1d7d('0x28')](handleEntityNotFound(_0x671580,null))[_0x1d7d('0x28')](respondWithResult(_0x671580,null))['catch'](handleError(_0x671580,null));};exports[_0x1d7d('0x48')]=function(_0x5904e0,_0xbfe60){return db['VoiceRecording'][_0x1d7d('0x48')](_0x5904e0[_0x1d7d('0x49')],{})[_0x1d7d('0x28')](respondWithResult(_0xbfe60,0xc9))[_0x1d7d('0x4a')](handleError(_0xbfe60,null));};exports['update']=function(_0x2dbb61,_0x5535d4){if(_0x2dbb61['body']['id']){delete _0x2dbb61[_0x1d7d('0x49')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x2dbb61[_0x1d7d('0x4b')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x5535d4,null))['then'](saveUpdates(_0x2dbb61[_0x1d7d('0x49')],null))[_0x1d7d('0x28')](respondWithResult(_0x5535d4,null))['catch'](handleError(_0x5535d4,null));};exports[_0x1d7d('0x4c')]=function(_0x2b9faa,_0xa64dbe){return db[_0x1d7d('0x42')]['describe']()['then'](respondWithResult(_0xa64dbe,null))[_0x1d7d('0x4a')](handleError(_0xa64dbe,null));};exports[_0x1d7d('0x4d')]=function(_0x35ff5d,_0x3938d0,_0x3cc5b7){var _0x550c9f=require(_0x1d7d('0x4e'));var _0x24e0b7=![];var _0x344b66={};if(_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]===_0x1d7d('0x50')){_0x344b66[_0x1d7d('0x50')]=_0x35ff5d['params']['id'];}else{_0x344b66['id']=_0x35ff5d[_0x1d7d('0x4b')]['id'];}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x344b66,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3938d0,null))[_0x1d7d('0x28')](function(_0x2d4cc3){if(_0x2d4cc3){var _0x3f5434=_0x2d4cc3['value'];var _0x7f41e=util[_0x1d7d('0x32')]('%s.cypher',_0x3f5434);if(fs[_0x1d7d('0x51')](_0x7f41e)){_0x24e0b7=!![];return _0x550c9f[_0x1d7d('0x52')](_0x7f41e,_0x3f5434,config[_0x1d7d('0x53')][_0x1d7d('0x54')])['then'](function(){return _0x2d4cc3;});}return _0x2d4cc3;}})[_0x1d7d('0x28')](function(_0x202af4){if(_0x202af4){var _0x4ba6ec=_0x202af4['value'];if(!fs[_0x1d7d('0x51')](_0x4ba6ec)){throw new db[(_0x1d7d('0x55'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x202af4[_0x1d7d('0x56')]){return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,_0x202af4[_0x1d7d('0x56')]+path[_0x1d7d('0x57')](_0x4ba6ec),function(){if(_0x24e0b7){fs['unlink'](_0x4ba6ec);}});}else{return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,function(_0x4b7a81){if(_0x24e0b7){fs[_0x1d7d('0x58')](_0x4ba6ec);}});}}})[_0x1d7d('0x4a')](function(_0x14078d){if(_0x14078d[_0x1d7d('0x59')]==='VoiceRecording\x20not\x20found'){_0x3938d0[_0x1d7d('0x1c')](0x194)[_0x1d7d('0x2c')](_0x1d7d('0x5a'));}else{return handleError(_0x3938d0,null);}});};exports[_0x1d7d('0x5b')]=function(_0x28ec14,_0x1cafd4,_0x17a365){var _0x2bd2a0=require(_0x1d7d('0x4e'));var _0x17c967=![];var _0x44a187={'$and':[db[_0x1d7d('0x5c')][_0x1d7d('0x3f')](db[_0x1d7d('0x5c')]['fn'](_0x1d7d('0x5d'),db['sequelize'][_0x1d7d('0x5e')]('uniqueid')),_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x5f')])]};if(_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]==='uniqueid'){_0x44a187[_0x1d7d('0x60')][_0x1d7d('0x61')]({'uniqueid':_0x28ec14['params']['id']});}else{_0x44a187[_0x1d7d('0x60')]['push']({'id':_0x28ec14[_0x1d7d('0x4b')]['id']});}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x44a187,'attributes':['id',_0x1d7d('0x62')],'raw':!![]})[_0x1d7d('0x28')](handleEntityNotFound(_0x1cafd4,null))[_0x1d7d('0x28')](function(_0x516aa0){if(_0x516aa0){var _0x3768a7=util[_0x1d7d('0x32')]('%s.cypher',_0x516aa0[_0x1d7d('0x62')]);if(fs[_0x1d7d('0x51')](_0x3768a7)){_0x17c967=!![];return _0x2bd2a0[_0x1d7d('0x52')](_0x3768a7,_0x516aa0['value'],config[_0x1d7d('0x53')][_0x1d7d('0x54')])[_0x1d7d('0x28')](function(){return _0x516aa0;});}return _0x516aa0;}})[_0x1d7d('0x28')](function(_0x5f15b7){if(_0x5f15b7){if(!fs[_0x1d7d('0x51')](_0x5f15b7[_0x1d7d('0x62')])){throw new db[(_0x1d7d('0x55'))][(_0x1d7d('0x63'))](_0x1d7d('0x64'));}if(_0x5f15b7['filename']){return _0x1cafd4[_0x1d7d('0x4d')](_0x5f15b7[_0x1d7d('0x62')],_0x5f15b7['filename']+path[_0x1d7d('0x57')](_0x5f15b7[_0x1d7d('0x62')]),function(){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}else{return _0x1cafd4['download'](_0x5f15b7[_0x1d7d('0x62')],function(_0x4a3159){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}}})[_0x1d7d('0x4a')](handleError(_0x1cafd4,null));};exports['destroy']=function(_0x4de5ee,_0x3818f4){return db[_0x1d7d('0x42')]['find']({'where':{'id':_0x4de5ee[_0x1d7d('0x4b')]['id']}})['then'](function(_0x6e9ee6){if(!_0x6e9ee6)throw new ReferenceError(_0x1d7d('0x65'));return _0x6e9ee6;})[_0x1d7d('0x28')](function(_0x446d39){var _0x30cf98=_0x446d39[_0x1d7d('0x62')];logger[_0x1d7d('0x66')](_0x1d7d('0x67'),_0x30cf98);if(!_[_0x1d7d('0x68')](_0x446d39[_0x1d7d('0x62')])&&fs[_0x1d7d('0x51')](_0x30cf98)){logger['info']('File:\x20\x22'+_0x30cf98+_0x1d7d('0x69'));fs[_0x1d7d('0x6a')](_0x30cf98);}_0x30cf98=_0x30cf98+_0x1d7d('0x6b');if(!_['isNil'](_0x446d39[_0x1d7d('0x62')])&&fs['existsSync'](_0x30cf98)){logger[_0x1d7d('0x66')](_0x1d7d('0x6c')+_0x30cf98+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1d7d('0x6a')](_0x30cf98);}return _0x446d39;})[_0x1d7d('0x28')](function(_0x4a8f1f){if(!_0x4a8f1f)throw new InternalError();return _0x4a8f1f[_0x1d7d('0x6d')]();})[_0x1d7d('0x28')](function(){_0x3818f4[_0x1d7d('0x1c')](0xcc)['end']();})['catch'](function(_0x2f774f){var _0x87e6aa=0x1f4;if(e instanceof ReferenceError){_0x87e6aa=0x194;}else if(e instanceof InternalError){_0x87e6aa=0x1f4;}logger['error'](_0x2f774f[_0x1d7d('0x6e')]);if(_0x2f774f[_0x1d7d('0x2b')]){delete _0x2f774f[_0x1d7d('0x2b')];}_0x3818f4[_0x1d7d('0x1c')](_0x87e6aa)['send'](_0x2f774f);});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 0f19776..bcb3d85 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3681=['VoiceRecording','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports'];(function(_0xb755a1,_0x400bad){var _0x312ada=function(_0x43796c){while(--_0x43796c){_0xb755a1['push'](_0xb755a1['shift']());}};_0x312ada(++_0x400bad);}(_0x3681,0x1ba));var _0x1368=function(_0x2d4125,_0x156ec6){_0x2d4125=_0x2d4125-0x0;var _0x10a9ba=_0x3681[_0x2d4125];return _0x10a9ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1368('0x0'))(_0x1368('0x1'));var moment=require(_0x1368('0x2'));var BPromise=require(_0x1368('0x3'));var rp=require(_0x1368('0x4'));var fs=require('fs');var path=require(_0x1368('0x5'));var rimraf=require(_0x1368('0x6'));var config=require('../../config/environment');var attributes=require(_0x1368('0x7'));module[_0x1368('0x8')]=function(_0x22b873,_0x3f7849){return _0x22b873['define'](_0x1368('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x1368('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d2b=['voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9d2b,0x1c9));var _0xb9d2=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0x9d2b[_0x3124f8];return _0x5bab5f;};'use strict';var _=require(_0xb9d2('0x0'));var util=require(_0xb9d2('0x1'));var logger=require(_0xb9d2('0x2'))(_0xb9d2('0x3'));var moment=require(_0xb9d2('0x4'));var BPromise=require('bluebird');var rp=require(_0xb9d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9d2('0x6'));var config=require(_0xb9d2('0x7'));var attributes=require(_0xb9d2('0x8'));module[_0xb9d2('0x9')]=function(_0x2051e4,_0x2196e5){return _0x2051e4[_0xb9d2('0xa')]('VoiceRecording',attributes,{'tableName':_0xb9d2('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb9d2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index ade718c..f6c0ca9 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x27a399,_0x5860a8){var _0x5cfafc=function(_0x595a58){while(--_0x595a58){_0x27a399['push'](_0x27a399['shift']());}};_0x5cfafc(++_0x5860a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x1bb0b6,_0x1734b7){var _0x45f16b=function(_0x15823d){while(--_0x15823d){_0x1bb0b6['push'](_0x1bb0b6['shift']());}};_0x45f16b(++_0x1734b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 4d71d41..8f5f0d2 100644 --- a/server/api/voiceTransferReport/index.js +++ b/server/api/voiceTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d9=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var auth=require(_0x901d('0x5'));var interaction=require(_0x901d('0x6'));var config=require(_0x901d('0x7'));var controller=require(_0x901d('0x8'));router[_0x901d('0x9')]('/',auth[_0x901d('0xa')](),controller['index']);router[_0x901d('0x9')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0xc')]);router[_0x901d('0xd')]('/',auth[_0x901d('0xa')](),controller[_0x901d('0xe')]);router[_0x901d('0xf')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xb'),auth['isAuthenticated'](),controller[_0x901d('0x12')]);module['exports']=router; \ No newline at end of file +var _0xfcf0=['/:id','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index'];(function(_0x452c35,_0x1a3e82){var _0x16301b=function(_0x1428c7){while(--_0x1428c7){_0x452c35['push'](_0x452c35['shift']());}};_0x16301b(++_0x1a3e82);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0xfcf0[_0x2c7b86];return _0x256735;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var auth=require(_0x0fcf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0fcf('0x6'));var controller=require(_0x0fcf('0x7'));router[_0x0fcf('0x8')]('/',auth[_0x0fcf('0x9')](),controller[_0x0fcf('0xa')]);router[_0x0fcf('0x8')](_0x0fcf('0xb'),auth[_0x0fcf('0x9')](),controller['show']);router[_0x0fcf('0xc')]('/',auth[_0x0fcf('0x9')](),controller[_0x0fcf('0xd')]);router['put'](_0x0fcf('0xb'),auth[_0x0fcf('0x9')](),controller[_0x0fcf('0xe')]);router['delete'](_0x0fcf('0xb'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);module[_0x0fcf('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 0e47aa3..5478bb4 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js +++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1b5=['Yes','exports','ENUM','blind','STRING'];(function(_0x241245,_0x3e7b30){var _0x4546b7=function(_0x1d6de7){while(--_0x1d6de7){_0x241245['push'](_0x241245['shift']());}};_0x4546b7(++_0x3e7b30);}(_0xc1b5,0x1c3));var _0x5c1b=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xc1b5[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5c1b('0x0')]={'type':{'type':Sequelize[_0x5c1b('0x1')](_0x5c1b('0x2'),'attended')},'result':{'type':Sequelize[_0x5c1b('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x5c1b('0x3')]},'transferercalleridname':{'type':Sequelize[_0x5c1b('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5c1b('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x5c1b('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x5c1b('0x3')]},'transferercontext':{'type':Sequelize[_0x5c1b('0x3')]},'transfererexten':{'type':Sequelize[_0x5c1b('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x5c1b('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5c1b('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5c1b('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x5c1b('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x5c1b('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x5c1b('0x3')]},'isexternal':{'type':Sequelize[_0x5c1b('0x1')](_0x5c1b('0x4'),'No')},'context':{'type':Sequelize[_0x5c1b('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8c2c=['attended','STRING','moment','exports','ENUM','blind'];(function(_0x4eb41e,_0x334340){var _0x2488d0=function(_0x3eccc8){while(--_0x3eccc8){_0x4eb41e['push'](_0x4eb41e['shift']());}};_0x2488d0(++_0x334340);}(_0x8c2c,0x92));var _0xc8c2=function(_0x532184,_0x4b1625){_0x532184=_0x532184-0x0;var _0x5444ae=_0x8c2c[_0x532184];return _0x5444ae;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc8c2('0x0'));module[_0xc8c2('0x1')]={'type':{'type':Sequelize[_0xc8c2('0x2')](_0xc8c2('0x3'),_0xc8c2('0x4'))},'result':{'type':Sequelize[_0xc8c2('0x5')]},'transfererchannel':{'type':Sequelize[_0xc8c2('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xc8c2('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xc8c2('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xc8c2('0x5')]},'transferercontext':{'type':Sequelize[_0xc8c2('0x5')]},'transfererexten':{'type':Sequelize[_0xc8c2('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xc8c2('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xc8c2('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xc8c2('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xc8c2('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xc8c2('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xc8c2('0x2')]('Yes','No')},'context':{'type':Sequelize[_0xc8c2('0x5')]},'extension':{'type':Sequelize[_0xc8c2('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c6dc7a2..094444f 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x4675b0,_0x52a7ab){var _0x2e0390=function(_0x4bbbc7){while(--_0x4bbbc7){_0x4675b0['push'](_0x4675b0['shift']());}};_0x2e0390(++_0x52a7ab);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={},_0x163604={},_0x950fde={'count':0x0,'rows':[]};var _0x3fa3b8=_[_0x3071('0x2d')](db[_0x3071('0x2e')][_0x3071('0x2f')],function(_0x32f1b4){return{'name':_0x32f1b4[_0x3071('0x30')],'type':_0x32f1b4[_0x3071('0x31')]['key']};});_0x163604['model']=_[_0x3071('0x2d')](_0x3fa3b8,_0x3071('0x2a'));_0x163604[_0x3071('0x32')]=_[_0x3071('0x33')](_0x4d5c4b[_0x3071('0x32')]);_0x163604[_0x3071('0x34')]=_[_0x3071('0x35')](_0x163604[_0x3071('0x36')],_0x163604['query']);_0x28792d['attributes']=_['intersection'](_0x163604[_0x3071('0x36')],qs[_0x3071('0x37')](_0x4d5c4b['query'][_0x3071('0x37')]));_0x28792d[_0x3071('0x38')]=_0x28792d[_0x3071('0x38')][_0x3071('0x39')]?_0x28792d['attributes']:_0x163604[_0x3071('0x36')];if(!_0x4d5c4b[_0x3071('0x32')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x28792d[_0x3071('0x1f')]=qs[_0x3071('0x1f')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x1f')]);_0x28792d['offset']=qs[_0x3071('0x1e')](_0x4d5c4b['query']['offset']);}_0x28792d[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x4d5c4b['query'][_0x3071('0x3d')]);_0x28792d[_0x3071('0x3e')]=qs[_0x3071('0x34')](_[_0x3071('0x3f')](_0x4d5c4b[_0x3071('0x32')],_0x163604[_0x3071('0x34')]));if(_0x4d5c4b['query'][_0x3071('0x40')]){_0x28792d[_0x3071('0x3e')]=_['merge'](_0x28792d[_0x3071('0x3e')],{'$or':_['map'](_0x3fa3b8,function(_0x28f855){if(_0x28f855[_0x3071('0x31')]!=='VIRTUAL'){var _0x593c99={};_0x593c99[_0x28f855[_0x3071('0x2a')]]={'$like':'%'+_0x4d5c4b[_0x3071('0x32')][_0x3071('0x40')]+'%'};return _0x593c99;}})});}_0x28792d=_['merge']({},_0x28792d,_0x4d5c4b[_0x3071('0x41')]);var _0x534a77={'where':_0x28792d[_0x3071('0x3e')]};return db['VoiceTransferReport'][_0x3071('0x1d')](_0x534a77)[_0x3071('0x26')](function(_0x1fcc52){_0x950fde[_0x3071('0x1d')]=_0x1fcc52;if(_0x4d5c4b[_0x3071('0x32')]['includeAll']){_0x28792d['include']=[{'all':!![]}];}return db[_0x3071('0x2e')][_0x3071('0x42')](_0x28792d);})[_0x3071('0x26')](function(_0x1f69a6){_0x950fde['rows']=_0x1f69a6;return _0x950fde;})[_0x3071('0x26')](respondWithFilteredResult(_0x4fb1ca,_0x28792d))[_0x3071('0x43')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x44')]=function(_0x25c29f,_0x277104){var _0xb9a4b8={'raw':!![],'where':{'id':_0x25c29f[_0x3071('0x45')]['id']}},_0x56a9d8={};_0x56a9d8['model']=_['keys'](db['VoiceTransferReport']['rawAttributes']);_0x56a9d8[_0x3071('0x32')]=_[_0x3071('0x33')](_0x25c29f[_0x3071('0x32')]);_0x56a9d8[_0x3071('0x34')]=_[_0x3071('0x35')](_0x56a9d8[_0x3071('0x36')],_0x56a9d8[_0x3071('0x32')]);_0xb9a4b8[_0x3071('0x38')]=_['intersection'](_0x56a9d8[_0x3071('0x36')],qs[_0x3071('0x37')](_0x25c29f[_0x3071('0x32')][_0x3071('0x37')]));_0xb9a4b8[_0x3071('0x38')]=_0xb9a4b8['attributes']['length']?_0xb9a4b8[_0x3071('0x38')]:_0x56a9d8[_0x3071('0x36')];if(_0x25c29f[_0x3071('0x32')][_0x3071('0x46')]){_0xb9a4b8[_0x3071('0x47')]=[{'all':!![]}];}_0xb9a4b8=_['merge']({},_0xb9a4b8,_0x25c29f[_0x3071('0x41')]);return db['VoiceTransferReport'][_0x3071('0x48')](_0xb9a4b8)['then'](handleEntityNotFound(_0x277104,null))['then'](respondWithResult(_0x277104,null))[_0x3071('0x43')](handleError(_0x277104,null));};exports['create']=function(_0x1862ea,_0x5a0a69){return db[_0x3071('0x2e')][_0x3071('0x49')](_0x1862ea[_0x3071('0x4a')],{})[_0x3071('0x26')](respondWithResult(_0x5a0a69,0xc9))['catch'](handleError(_0x5a0a69,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){if(_0x575c12['body']['id']){delete _0x575c12[_0x3071('0x4a')]['id'];}return db[_0x3071('0x2e')]['find']({'where':{'id':_0x575c12[_0x3071('0x45')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0xd273ec,null))[_0x3071('0x26')](saveUpdates(_0x575c12[_0x3071('0x4a')],null))[_0x3071('0x26')](respondWithResult(_0xd273ec,null))[_0x3071('0x43')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x577060,_0x2c6e4c){return db[_0x3071('0x2e')][_0x3071('0x48')]({'where':{'id':_0x577060[_0x3071('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c6e4c,null))[_0x3071('0x26')](removeEntity(_0x2c6e4c,null))[_0x3071('0x43')](handleError(_0x2c6e4c,null));}; \ No newline at end of file +var _0x4483=['key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type'];(function(_0x342258,_0x270fe2){var _0x593c71=function(_0x504803){while(--_0x504803){_0x342258['push'](_0x342258['shift']());}};_0x593c71(++_0x270fe2);}(_0x4483,0x1a3));var _0x3448=function(_0x178291,_0x37a26e){_0x178291=_0x178291-0x0;var _0x1c5b12=_0x4483[_0x178291];return _0x1c5b12;};'use strict';var pdf=require(_0x3448('0x0'));var emlformat=require(_0x3448('0x1'));var rimraf=require(_0x3448('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3448('0x3'));var rp=require(_0x3448('0x4'));var moment=require(_0x3448('0x5'));var BPromise=require(_0x3448('0x6'));var Mustache=require(_0x3448('0x7'));var util=require('util');var path=require(_0x3448('0x8'));var sox=require(_0x3448('0x9'));var csv=require(_0x3448('0xa'));var ejs=require(_0x3448('0xb'));var fs=require('fs');var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bf09e,_0x298ae6){_0x298ae6=_0x298ae6||0xcc;return function(_0x38fbb1){if(_0x38fbb1){return _0x5bf09e['sendStatus'](_0x298ae6);}return _0x5bf09e[_0x3448('0x1b')](_0x298ae6)[_0x3448('0x1c')]();};}function respondWithResult(_0x587db9,_0x549306){_0x549306=_0x549306||0xc8;return function(_0x14104c){if(_0x14104c){return _0x587db9[_0x3448('0x1b')](_0x549306)['json'](_0x14104c);}};}function respondWithFilteredResult(_0x2387a3,_0x2c2da6){return function(_0x46784f){if(_0x46784f){var _0x4fc70f=_0x46784f[_0x3448('0x1d')],_0x472518=_0x2c2da6[_0x3448('0x1e')],_0x28f5b9=_0x2c2da6[_0x3448('0x1e')]+_0x2c2da6[_0x3448('0x1f')],_0x13610a;if(_0x28f5b9>=_0x4fc70f){_0x28f5b9=_0x4fc70f;_0x13610a=0xc8;}else{_0x13610a=0xce;}_0x2387a3[_0x3448('0x1b')](_0x13610a);return _0x2387a3['set'](_0x3448('0x20'),_0x472518+'-'+_0x28f5b9+'/'+_0x4fc70f)['json'](_0x46784f);}return null;};}function patchUpdates(_0x48f94a){return function(_0x53f8e7){try{jsonpatch[_0x3448('0x21')](_0x53f8e7,_0x48f94a,!![]);}catch(_0x278736){return BPromise[_0x3448('0x22')](_0x278736);}return _0x53f8e7['save']();};}function saveUpdates(_0x3df082,_0x392c8d){return function(_0x317de6){if(_0x317de6){return _0x317de6[_0x3448('0x23')](_0x3df082)[_0x3448('0x24')](function(_0x715c3){return _0x715c3;});}return null;};}function removeEntity(_0x5db78f,_0x54c7ee){return function(_0x4e6716){if(_0x4e6716){return _0x4e6716[_0x3448('0x25')]()[_0x3448('0x24')](function(){_0x5db78f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dcd40,_0x4371d6){return function(_0x22ad5c){if(!_0x22ad5c){_0x2dcd40[_0x3448('0x26')](0x194);}return _0x22ad5c;};}function handleError(_0xbf2237,_0x566ff5){_0x566ff5=_0x566ff5||0x1f4;return function(_0x229ce7){logger[_0x3448('0x27')](_0x229ce7[_0x3448('0x28')]);if(_0x229ce7[_0x3448('0x29')]){delete _0x229ce7[_0x3448('0x29')];}_0xbf2237['status'](_0x566ff5)[_0x3448('0x2a')](_0x229ce7);};}exports[_0x3448('0x2b')]=function(_0x52c163,_0x19a479){var _0x12c22d={},_0x310912={},_0x1bd34c={'count':0x0,'rows':[]};var _0x38fab2=_[_0x3448('0x2c')](db[_0x3448('0x2d')][_0x3448('0x2e')],function(_0x5911b8){return{'name':_0x5911b8[_0x3448('0x2f')],'type':_0x5911b8[_0x3448('0x30')][_0x3448('0x31')]};});_0x310912['model']=_[_0x3448('0x2c')](_0x38fab2,'name');_0x310912['query']=_['keys'](_0x52c163[_0x3448('0x32')]);_0x310912[_0x3448('0x33')]=_['intersection'](_0x310912['model'],_0x310912[_0x3448('0x32')]);_0x12c22d[_0x3448('0x34')]=_[_0x3448('0x35')](_0x310912[_0x3448('0x36')],qs['fields'](_0x52c163[_0x3448('0x32')][_0x3448('0x37')]));_0x12c22d[_0x3448('0x34')]=_0x12c22d['attributes'][_0x3448('0x38')]?_0x12c22d[_0x3448('0x34')]:_0x310912['model'];if(!_0x52c163['query'][_0x3448('0x39')](_0x3448('0x3a'))){_0x12c22d[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x52c163['query'][_0x3448('0x1f')]);_0x12c22d[_0x3448('0x1e')]=qs[_0x3448('0x1e')](_0x52c163[_0x3448('0x32')]['offset']);}_0x12c22d[_0x3448('0x3b')]=qs[_0x3448('0x3c')](_0x52c163['query'][_0x3448('0x3c')]);_0x12c22d[_0x3448('0x3d')]=qs[_0x3448('0x33')](_[_0x3448('0x3e')](_0x52c163[_0x3448('0x32')],_0x310912[_0x3448('0x33')]));if(_0x52c163[_0x3448('0x32')][_0x3448('0x3f')]){_0x12c22d[_0x3448('0x3d')]=_['merge'](_0x12c22d['where'],{'$or':_[_0x3448('0x2c')](_0x38fab2,function(_0x579eac){if(_0x579eac[_0x3448('0x30')]!==_0x3448('0x40')){var _0x12f678={};_0x12f678[_0x579eac[_0x3448('0x29')]]={'$like':'%'+_0x52c163['query'][_0x3448('0x3f')]+'%'};return _0x12f678;}})});}_0x12c22d=_[_0x3448('0x41')]({},_0x12c22d,_0x52c163[_0x3448('0x42')]);var _0x201979={'where':_0x12c22d[_0x3448('0x3d')]};return db[_0x3448('0x2d')][_0x3448('0x1d')](_0x201979)[_0x3448('0x24')](function(_0x124296){_0x1bd34c['count']=_0x124296;if(_0x52c163[_0x3448('0x32')][_0x3448('0x43')]){_0x12c22d[_0x3448('0x44')]=[{'all':!![]}];}return db[_0x3448('0x2d')][_0x3448('0x45')](_0x12c22d);})['then'](function(_0x18b297){_0x1bd34c[_0x3448('0x46')]=_0x18b297;return _0x1bd34c;})[_0x3448('0x24')](respondWithFilteredResult(_0x19a479,_0x12c22d))[_0x3448('0x47')](handleError(_0x19a479,null));};exports[_0x3448('0x48')]=function(_0x2077c1,_0x415985){var _0x3db5f1={'raw':!![],'where':{'id':_0x2077c1[_0x3448('0x49')]['id']}},_0x4a8f80={};_0x4a8f80[_0x3448('0x36')]=_[_0x3448('0x4a')](db['VoiceTransferReport'][_0x3448('0x2e')]);_0x4a8f80[_0x3448('0x32')]=_[_0x3448('0x4a')](_0x2077c1[_0x3448('0x32')]);_0x4a8f80[_0x3448('0x33')]=_[_0x3448('0x35')](_0x4a8f80[_0x3448('0x36')],_0x4a8f80['query']);_0x3db5f1[_0x3448('0x34')]=_[_0x3448('0x35')](_0x4a8f80[_0x3448('0x36')],qs[_0x3448('0x37')](_0x2077c1[_0x3448('0x32')][_0x3448('0x37')]));_0x3db5f1['attributes']=_0x3db5f1[_0x3448('0x34')]['length']?_0x3db5f1['attributes']:_0x4a8f80[_0x3448('0x36')];if(_0x2077c1[_0x3448('0x32')]['includeAll']){_0x3db5f1[_0x3448('0x44')]=[{'all':!![]}];}_0x3db5f1=_[_0x3448('0x41')]({},_0x3db5f1,_0x2077c1['options']);return db[_0x3448('0x2d')][_0x3448('0x4b')](_0x3db5f1)['then'](handleEntityNotFound(_0x415985,null))[_0x3448('0x24')](respondWithResult(_0x415985,null))[_0x3448('0x47')](handleError(_0x415985,null));};exports[_0x3448('0x4c')]=function(_0x2be597,_0x34d19e){return db[_0x3448('0x2d')][_0x3448('0x4c')](_0x2be597['body'],{})['then'](respondWithResult(_0x34d19e,0xc9))[_0x3448('0x47')](handleError(_0x34d19e,null));};exports[_0x3448('0x23')]=function(_0x1b82e7,_0x3f48e3){if(_0x1b82e7['body']['id']){delete _0x1b82e7[_0x3448('0x4d')]['id'];}return db[_0x3448('0x2d')][_0x3448('0x4b')]({'where':{'id':_0x1b82e7[_0x3448('0x49')]['id']}})[_0x3448('0x24')](handleEntityNotFound(_0x3f48e3,null))['then'](saveUpdates(_0x1b82e7[_0x3448('0x4d')],null))['then'](respondWithResult(_0x3f48e3,null))[_0x3448('0x47')](handleError(_0x3f48e3,null));};exports[_0x3448('0x25')]=function(_0x5c8e42,_0x479b79){return db[_0x3448('0x2d')][_0x3448('0x4b')]({'where':{'id':_0x5c8e42[_0x3448('0x49')]['id']}})[_0x3448('0x24')](handleEntityNotFound(_0x479b79,null))[_0x3448('0x24')](removeEntity(_0x479b79,null))[_0x3448('0x47')](handleError(_0x479b79,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 90186b8..16e3fc1 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.model.js +++ b/server/api/voiceTransferReport/voiceTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d90=['exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x59dc02,_0x120477){var _0x556178=function(_0x583273){while(--_0x583273){_0x59dc02['push'](_0x59dc02['shift']());}};_0x556178(++_0x120477);}(_0x0d90,0xa0));var _0x00d9=function(_0x319c83,_0x3b28c4){_0x319c83=_0x319c83-0x0;var _0x5e94bf=_0x0d90[_0x319c83];return _0x5e94bf;};'use strict';var _=require(_0x00d9('0x0'));var util=require(_0x00d9('0x1'));var logger=require(_0x00d9('0x2'))('api');var moment=require(_0x00d9('0x3'));var BPromise=require(_0x00d9('0x4'));var rp=require(_0x00d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00d9('0x6'));var config=require(_0x00d9('0x7'));var attributes=require(_0x00d9('0x8'));module[_0x00d9('0x9')]=function(_0xf76e6a,_0x5768fb){return _0xf76e6a[_0x00d9('0xa')](_0x00d9('0xb'),attributes,{'tableName':_0x00d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf92=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','api','moment','bluebird','request-promise'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xdf92,0x10c));var _0x2df9=function(_0x294996,_0x2c2fdb){_0x294996=_0x294996-0x0;var _0x31f2b5=_0xdf92[_0x294996];return _0x31f2b5;};'use strict';var _=require(_0x2df9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2df9('0x1'));var moment=require(_0x2df9('0x2'));var BPromise=require(_0x2df9('0x3'));var rp=require(_0x2df9('0x4'));var fs=require('fs');var path=require(_0x2df9('0x5'));var rimraf=require(_0x2df9('0x6'));var config=require(_0x2df9('0x7'));var attributes=require(_0x2df9('0x8'));module[_0x2df9('0x9')]=function(_0x125317,_0x5b6e79){return _0x125317[_0x2df9('0xa')](_0x2df9('0xb'),attributes,{'tableName':_0x2df9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 2ca7470..dbc538e 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js +++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc95e=['stringify','error','message','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','raw','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x215797,_0x49d505){var _0x4a3697=function(_0x23a93a){while(--_0x23a93a){_0x215797['push'](_0x215797['shift']());}};_0x4a3697(++_0x49d505);}(_0xc95e,0x151));var _0xec95=function(_0x1e1dc7,_0x4baa6b){_0x1e1dc7=_0x1e1dc7-0x0;var _0x3f23af=_0xc95e[_0x1e1dc7];return _0x3f23af;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xec95('0x0'));var BPromise=require(_0xec95('0x1'));var rs=require(_0xec95('0x2'));var fs=require('fs');var Redis=require(_0xec95('0x3'));var db=require(_0xec95('0x4'))['db'];var utils=require(_0xec95('0x5'));var logger=require('../../config/logger')(_0xec95('0x6'));var config=require('../../config/environment');var jayson=require(_0xec95('0x7'));var client=jayson[_0xec95('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x586e06,_0x39fefc,_0x7ae31e){return new BPromise(function(_0x3b7fbc,_0x4ef005){return client[_0xec95('0x9')](_0x586e06,_0x7ae31e)[_0xec95('0xa')](function(_0x56cb05){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x39fefc,'request\x20sent');logger[_0xec95('0xb')](_0xec95('0xc'),_0x39fefc,'request\x20sent',JSON[_0xec95('0xd')](_0x56cb05));if(_0x56cb05[_0xec95('0xe')]){if(_0x56cb05['error']['code']===0x1f4){logger[_0xec95('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x39fefc,_0x56cb05['error']['message']);return _0x4ef005(_0x56cb05[_0xec95('0xe')][_0xec95('0xf')]);}logger[_0xec95('0xe')](_0xec95('0x10'),_0x39fefc,_0x56cb05[_0xec95('0xe')][_0xec95('0xf')]);return _0x3b7fbc(_0x56cb05[_0xec95('0xe')][_0xec95('0xf')]);}else{logger['info'](_0xec95('0x10'),_0x39fefc,_0xec95('0x11'));_0x3b7fbc(_0x56cb05[_0xec95('0x12')][_0xec95('0xf')]);}})['catch'](function(_0x4a340c){logger['error'](_0xec95('0x10'),_0x39fefc,_0x4a340c);_0x4ef005(_0x4a340c);});});}exports[_0xec95('0x13')]=function(_0x52df31){var _0x5418a7=this;return new Promise(function(_0x47076e,_0x218770){return db[_0xec95('0x14')][_0xec95('0x15')](_0x52df31[_0xec95('0x16')],{'raw':_0x52df31['options']?_0x52df31['options'][_0xec95('0x17')]===undefined?!![]:![]:!![]})[_0xec95('0xa')](function(_0x5e4592){logger['info'](_0xec95('0x13'),_0x52df31);logger[_0xec95('0xb')](_0xec95('0x13'),_0x52df31,JSON['stringify'](_0x5e4592));_0x47076e(_0x5e4592);})[_0xec95('0x18')](function(_0x1220d6){logger['error'](_0xec95('0x13'),_0x1220d6[_0xec95('0xf')],_0x52df31);_0x218770(_0x5418a7[_0xec95('0xe')](0x1f4,_0x1220d6['message']));});});}; \ No newline at end of file +var _0x76ba=['request\x20sent','error','message','result','CreateVoiceTransferReport','body','options','raw','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x158033,_0x50acd6){var _0x530e88=function(_0x531d00){while(--_0x531d00){_0x158033['push'](_0x158033['shift']());}};_0x530e88(++_0x50acd6);}(_0x76ba,0x1c2));var _0xa76b=function(_0x482939,_0x29caea){_0x482939=_0x482939-0x0;var _0x4567b0=_0x76ba[_0x482939];return _0x4567b0;};'use strict';var _=require(_0xa76b('0x0'));var util=require(_0xa76b('0x1'));var moment=require(_0xa76b('0x2'));var BPromise=require(_0xa76b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa76b('0x4'));var db=require(_0xa76b('0x5'))['db'];var utils=require(_0xa76b('0x6'));var logger=require(_0xa76b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa76b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x268600,_0x3726a5,_0x1ddd83){return new BPromise(function(_0x328367,_0x2a75b6){return client[_0xa76b('0x9')](_0x268600,_0x1ddd83)['then'](function(_0x216ceb){logger[_0xa76b('0xa')](_0xa76b('0xb'),_0x3726a5,_0xa76b('0xc'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3726a5,_0xa76b('0xc'),JSON['stringify'](_0x216ceb));if(_0x216ceb[_0xa76b('0xd')]){if(_0x216ceb[_0xa76b('0xd')]['code']===0x1f4){logger[_0xa76b('0xd')](_0xa76b('0xb'),_0x3726a5,_0x216ceb[_0xa76b('0xd')]['message']);return _0x2a75b6(_0x216ceb[_0xa76b('0xd')][_0xa76b('0xe')]);}logger[_0xa76b('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x3726a5,_0x216ceb['error'][_0xa76b('0xe')]);return _0x328367(_0x216ceb[_0xa76b('0xd')][_0xa76b('0xe')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x3726a5,'request\x20sent');_0x328367(_0x216ceb[_0xa76b('0xf')][_0xa76b('0xe')]);}})['catch'](function(_0x45c7b2){logger[_0xa76b('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x3726a5,_0x45c7b2);_0x2a75b6(_0x45c7b2);});});}exports[_0xa76b('0x10')]=function(_0xff91ce){var _0x27c210=this;return new Promise(function(_0x5e94d4,_0x420b6b){return db['VoiceTransferReport']['create'](_0xff91ce[_0xa76b('0x11')],{'raw':_0xff91ce[_0xa76b('0x12')]?_0xff91ce[_0xa76b('0x12')][_0xa76b('0x13')]===undefined?!![]:![]:!![]})[_0xa76b('0x14')](function(_0x142d35){logger['info'](_0xa76b('0x10'),_0xff91ce);logger['debug'](_0xa76b('0x10'),_0xff91ce,JSON['stringify'](_0x142d35));_0x5e94d4(_0x142d35);})[_0xa76b('0x15')](function(_0x2a73a6){logger[_0xa76b('0xd')]('CreateVoiceTransferReport',_0x2a73a6['message'],_0xff91ce);_0x420b6b(_0x27c210[_0xa76b('0xd')](0x1f4,_0x2a73a6['message']));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 69809b1..bc9c575 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf143=['info','start','map','online','name','Offline\x20apps:','status','join','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then'];(function(_0x3e2e40,_0x5e42ed){var _0x3cdf0a=function(_0x5ad21e){while(--_0x5ad21e){_0x3e2e40['push'](_0x3e2e40['shift']());}};_0x3cdf0a(++_0x5e42ed);}(_0xf143,0x11e));var _0x3f14=function(_0x260d3f,_0x5c0c51){_0x260d3f=_0x260d3f-0x0;var _0x1bbb43=_0xf143[_0x260d3f];return _0x1bbb43;};'use strict';var _=require('lodash');var mysqldb=require(_0x3f14('0x0'));var rpc=require(_0x3f14('0x1'));var config=require('./config/environment');var logger=require(_0x3f14('0x2'))(_0x3f14('0x3'));var pm2=require(_0x3f14('0x4'));var pm2Config=require(_0x3f14('0x5'));var schedule=require(_0x3f14('0x6'));var chat=require(_0x3f14('0x7'));function main(){return mysqldb['db'][_0x3f14('0x8')][_0x3f14('0x9')]()['then'](function(){return rpc['listen']();})[_0x3f14('0xa')](function(_0x293f46){logger[_0x3f14('0xb')](_0x293f46);return chat[_0x3f14('0xc')]();})[_0x3f14('0xa')](function(){return schedule['start']();})[_0x3f14('0xa')](function(_0xf1310a){logger[_0x3f14('0xb')](_0xf1310a);return pm2[_0x3f14('0xc')](pm2Config);})[_0x3f14('0xa')](function(_0x5202fc){logger['info']('Online\x20apps:',_[_0x3f14('0xd')](_['filter'](_0x5202fc,{'status':_0x3f14('0xe')}),_0x3f14('0xf'))['join']());logger['info'](_0x3f14('0x10'),_[_0x3f14('0xd')](_['filter'](_0x5202fc,function(_0x575df1){return _0x575df1[_0x3f14('0x11')]!==_0x3f14('0xe');}),_0x3f14('0xf'))[_0x3f14('0x12')]()||_0x3f14('0x13'));config[_0x3f14('0x14')]&&require(_0x3f14('0x15'))[_0x3f14('0x16')]();require(_0x3f14('0x17'))['default']();})[_0x3f14('0x18')](function(_0x57aa65){logger['error'](_0x3f14('0x19'),_0x57aa65);process[_0x3f14('0x1a')](0x1);});}main(); \ No newline at end of file +var _0xc0b6=['./config/license','catch','error','exit','lodash','./mysqldb','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','map','online','Offline\x20apps:','filter','status','name','join','None','seedDB','./config/seedDB','default'];(function(_0x56418c,_0xd90668){var _0x1c838d=function(_0x222bb8){while(--_0x222bb8){_0x56418c['push'](_0x56418c['shift']());}};_0x1c838d(++_0xd90668);}(_0xc0b6,0xac));var _0x6c0b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc0b6[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x6c0b('0x0'));var mysqldb=require(_0x6c0b('0x1'));var rpc=require('./rpc');var config=require(_0x6c0b('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0x6c0b('0x3'));var pm2Config=require(_0x6c0b('0x4'));var schedule=require(_0x6c0b('0x5'));var chat=require(_0x6c0b('0x6'));function main(){return mysqldb['db'][_0x6c0b('0x7')][_0x6c0b('0x8')]()[_0x6c0b('0x9')](function(){return rpc[_0x6c0b('0xa')]();})['then'](function(_0x19c405){logger[_0x6c0b('0xb')](_0x19c405);return chat['start']();})[_0x6c0b('0x9')](function(){return schedule[_0x6c0b('0xc')]();})['then'](function(_0x37c57e){logger['info'](_0x37c57e);return pm2[_0x6c0b('0xc')](pm2Config);})['then'](function(_0x112eed){logger[_0x6c0b('0xb')]('Online\x20apps:',_[_0x6c0b('0xd')](_['filter'](_0x112eed,{'status':_0x6c0b('0xe')}),'name')['join']());logger[_0x6c0b('0xb')](_0x6c0b('0xf'),_[_0x6c0b('0xd')](_[_0x6c0b('0x10')](_0x112eed,function(_0x2e5b13){return _0x2e5b13[_0x6c0b('0x11')]!==_0x6c0b('0xe');}),_0x6c0b('0x12'))[_0x6c0b('0x13')]()||_0x6c0b('0x14'));config[_0x6c0b('0x15')]&&require(_0x6c0b('0x16'))[_0x6c0b('0x17')]();require(_0x6c0b('0x18'))[_0x6c0b('0x17')]();})[_0x6c0b('0x19')](function(_0x504a85){logger[_0x6c0b('0x1a')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x504a85);process[_0x6c0b('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 0bc5944..bb12415 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02a7=['User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','motion.token','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','session','payload','options','verify','randomBytes','hex','floor','now','toString','HS512','../../config/environment','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','role','name','internal','email','userpic','permissions','md5secret','voicePause','mailPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarExpires','userProfileId','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','use','headers','authorization','startsWith','Basic','find','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','nonce','User'];(function(_0x2cad29,_0x3c1fbd){var _0x211b25=function(_0x467a5b){while(--_0x467a5b){_0x2cad29['push'](_0x2cad29['shift']());}};_0x211b25(++_0x3c1fbd);}(_0x02a7,0x7a));var _0x702a=function(_0x1c8207,_0x43128c){_0x1c8207=_0x1c8207-0x0;var _0x368a2c=_0x02a7[_0x1c8207];return _0x368a2c;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x702a('0x0'));var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0x702a('0x1'));var expressJwt=require(_0x702a('0x2'));var compose=require(_0x702a('0x3'));var basicAuth=require(_0x702a('0x4'));var crypto=require(_0x702a('0x5'));var BPromise=require(_0x702a('0x6'));var validateJwt=expressJwt({'secret':config[_0x702a('0x7')]['session']});var userAttributes=['id',_0x702a('0x8'),'fullname',_0x702a('0x9'),_0x702a('0xa'),_0x702a('0xb'),_0x702a('0xc'),_0x702a('0xd'),_0x702a('0xe'),_0x702a('0xf'),'chatPause',_0x702a('0x10'),'faxPause','smsPause',_0x702a('0x11'),_0x702a('0x12'),_0x702a('0x13'),_0x702a('0x14'),'lastPauseAt',_0x702a('0x15'),_0x702a('0x16'),_0x702a('0x17'),_0x702a('0x18'),_0x702a('0x19'),_0x702a('0x1a'),_0x702a('0x1b'),'phoneBarEnableDtmfTone','phoneBarEnableSettings',_0x702a('0x1c'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface',_0x702a('0x1d')];exports[_0x702a('0x1e')]=function(){return this[_0x702a('0x1f')](!![])['use'](function(_0x532cb1,_0x506772,_0x369179){if(_0x532cb1[_0x702a('0x20')]){_0x369179();}else{return db[_0x702a('0x21')]['findOne']({'where':{'id':_0x532cb1[_0x702a('0x22')]['id']},'attributes':['id','closed',_0x702a('0x23')],'raw':!![]})[_0x702a('0x24')](function(_0x4f55ca){if(_0x4f55ca&&_0x4f55ca['closed']){return _0x506772[_0x702a('0x25')](_0x4f55ca[_0x702a('0x23')]===_0x702a('0x26')?0x195:0x193)[_0x702a('0x27')]({'message':_0x4f55ca[_0x702a('0x23')]===_0x702a('0x26')?_0x702a('0x28'):_0x702a('0x29')});}else{_0x369179();}})[_0x702a('0x2a')](function(_0xd5ac07){_0x369179(_0xd5ac07);});}});};exports['isAuthenticated']=function isAuthenticated(_0x1ecd28){return compose()[_0x702a('0x2b')](function(_0x2671d1,_0xd5b93a,_0x1d6dae){if(_0x2671d1[_0x702a('0x2c')][_0x702a('0x2d')]){if(_[_0x702a('0x2e')](_0x2671d1[_0x702a('0x2c')]['authorization'],_0x702a('0x2f'))){var _0x27b11b=basicAuth(_0x2671d1);db['User'][_0x702a('0x30')]({'where':{'name':_0x27b11b[_0x702a('0x9')]}})[_0x702a('0x24')](function(_0xf6b463){if(!_0xf6b463||!_0xf6b463[_0x702a('0x31')](_0x27b11b[_0x702a('0x32')])){return _0xd5b93a['status'](0x191)[_0x702a('0x27')]({'message':_0x702a('0x33')});}_0x2671d1['user']={'id':_0xf6b463['id']};_0x1d6dae();})[_0x702a('0x2a')](function(_0x854763){_0x1d6dae(_0x854763);});}else if(_[_0x702a('0x2e')](_0x2671d1[_0x702a('0x2c')][_0x702a('0x2d')],_0x702a('0x34'))){validateJwt(_0x2671d1,_0xd5b93a,_0x1d6dae);}else{if(_0x1ecd28){_0x1d6dae();}else{return _0xd5b93a[_0x702a('0x25')](0x193)['json']({'message':_0x702a('0x35')});}}}else if(_0x2671d1[_0x702a('0x36')][_0x702a('0x37')]){var _0x91aa5={'audience':hardwareConf[_0x702a('0x38')](),'issuer':hardwareConf[_0x702a('0x38')]()};verifyJwt(_0x2671d1['query'][_0x702a('0x37')],_0x91aa5)[_0x702a('0x24')](function(_0x5b81b5){return db['User'][_0x702a('0x30')]({'where':{'id':_0x5b81b5[_0x702a('0x39')]}})['then'](function(_0x2a9f4c){if(!_0x2a9f4c||!_['isEqual'](_0x2a9f4c['apiKeyNonce'],_0x5b81b5[_0x702a('0x3a')])){return _0xd5b93a[_0x702a('0x25')](0x193)[_0x702a('0x27')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x2671d1[_0x702a('0x20')]={'id':_0x2a9f4c['id']};_0x1d6dae();});})[_0x702a('0x2a')](function(_0x1f97a7){_0x1d6dae(_0x1f97a7);});}else if(_0x1ecd28){_0x1d6dae();}else{return _0xd5b93a[_0x702a('0x25')](0x193)[_0x702a('0x27')]({'message':_0x702a('0x35')});}})[_0x702a('0x2b')](function(_0x2bba27,_0x1d25d7,_0x24d243){if(_0x2bba27[_0x702a('0x20')]){db[_0x702a('0x3b')][_0x702a('0x30')]({'where':{'id':_0x2bba27[_0x702a('0x20')]['id']},'attributes':userAttributes})[_0x702a('0x24')](function(_0x127257){if(!_0x127257){return _0x1d25d7[_0x702a('0x25')](0x194)[_0x702a('0x27')]({'message':'User\x20not\x20found.'});}_0x2bba27[_0x702a('0x20')]=_0x127257;_0x24d243();})[_0x702a('0x2a')](function(_0x32e995){_0x24d243(_0x32e995);});}else if(_0x1ecd28){_0x24d243();}else{return _0x1d25d7[_0x702a('0x25')](0x194)[_0x702a('0x27')]({'message':_0x702a('0x3c')});}});};exports[_0x702a('0x3d')]=function canUpdate(){return compose()[_0x702a('0x2b')](function(_0x5e69d0,_0x1f544d,_0x194754){return require(_0x702a('0x3e'))[_0x702a('0x3f')]()[_0x702a('0x24')](function(_0x1b65bf){if(_0x1b65bf[_0x702a('0x40')]){_0x194754();}else{return _0x1f544d[_0x702a('0x25')](0x193)[_0x702a('0x27')]({'message':_0x702a('0x41')});}})[_0x702a('0x2a')](function(_0x1bee96){_0x194754(_0x1bee96);});});};exports[_0x702a('0x42')]=function(_0xe542be,_0x55f71b,_0x252b54){_0xe542be[_0x702a('0x42')]=!![];return _0x252b54();};exports[_0x702a('0x43')]=function signToken(_0x4c096f){return signJwt(_0x4c096f);};exports[_0x702a('0x44')]=function(_0x202425,_0xc4914c){if(!_0x202425[_0x702a('0x20')]){return _0xc4914c[_0x702a('0x25')](0x194)[_0x702a('0x27')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x28a74b={'payload':{'id':_0x202425[_0x702a('0x20')]['id'],'role':_0x202425[_0x702a('0x20')][_0x702a('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x28a74b)[_0x702a('0x24')](function(_0x1a7afc){_0xc4914c[_0x702a('0x45')](_0x702a('0x46'),_0x1a7afc);_0xc4914c['redirect'](_0x702a('0x47'));})['catch'](function(_0x3db209){return _0xc4914c[_0x702a('0x25')](0x1f4)[_0x702a('0x48')](_0x3db209);});};exports['retrieveApiKey']=function(_0x2d5d81){if(_[_0x702a('0x49')](_0x2d5d81[_0x702a('0x4a')])||_[_0x702a('0x49')](_0x2d5d81[_0x702a('0x4b')])){return null;}else{return createJwt(_0x2d5d81);}};exports[_0x702a('0x4c')]=function(_0x18e811){_0x18e811['apiKeyNonce']=generateNonce();_0x18e811['apiKeyIat']=generateIssuedAt();return createJwt(_0x18e811);};exports[_0x702a('0x4d')]=function(_0x2caa38,_0x509f43){var _0x558c4c=_0x2caa38['query'][_0x702a('0x37')];if(_0x558c4c){var _0x25e011={'nonce':_0x509f43[_0x702a('0x4a')],'iat':_0x509f43[_0x702a('0x4b')],'audience':hardwareConf[_0x702a('0x38')](),'issuer':hardwareConf[_0x702a('0x38')]()};return verifyJwt(_0x558c4c,_0x25e011)[_0x702a('0x24')](function(){return generateApiKey(_0x509f43);});}else{throw{'message':_0x702a('0x4e')};}};function signJwt(_0x41f2be){var _0x414cca=BPromise[_0x702a('0x4f')](jwt[_0x702a('0x50')],{'context':jwt});var _0x13e8d5=_0x41f2be['secret']||config['secrets'][_0x702a('0x51')];return new BPromise(function(_0x919678,_0x5a1cdf){_0x414cca(_0x41f2be[_0x702a('0x52')],_0x13e8d5,_0x41f2be[_0x702a('0x53')])['then'](function(_0x17c437){_0x919678(_0x17c437);})[_0x702a('0x2a')](function(_0x2cd891){_0x5a1cdf(_0x2cd891);});});}function verifyJwt(_0x55e380,_0x3b1bba,_0x18a107){var _0x59b1a0=BPromise[_0x702a('0x4f')](jwt[_0x702a('0x54')],{'context':jwt});var _0x5a5655=_0x18a107||config[_0x702a('0x7')][_0x702a('0x51')];return new BPromise(function(_0x1479c7,_0xf3dc32){_0x59b1a0(_0x55e380,_0x5a5655,_0x3b1bba)[_0x702a('0x24')](function(_0xd26197){_0x1479c7(_0xd26197);})[_0x702a('0x2a')](function(_0xbf2b99){_0xf3dc32(_0xbf2b99);});});}function generateNonce(){return crypto[_0x702a('0x55')](0x10)['toString'](_0x702a('0x56'));}function generateIssuedAt(){return Math[_0x702a('0x57')](Date[_0x702a('0x58')]()/0x3e8)[_0x702a('0x59')]();}function createJwt(_0x538b92){var _0x859fe6={'payload':{'iat':_0x538b92[_0x702a('0x4b')],'nonce':_0x538b92[_0x702a('0x4a')]},'options':{'algorithm':_0x702a('0x5a'),'subject':_0x538b92['id'][_0x702a('0x59')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x702a('0x38')]()}};return signJwt(_0x859fe6)[_0x702a('0x24')](function(_0x448fa9){return{'iat':_0x538b92[_0x702a('0x4b')],'nonce':_0x538b92[_0x702a('0x4a')],'token':_0x448fa9};});} \ No newline at end of file +var _0x98a8=['then','sub','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','../../config/license/util','getLicense','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','promisify','sign','secret','payload','options','verify','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','secrets','session','role','name','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','isAuthenticated','ChatInteraction','findOne','params','disposition','closed','status','json','unmanaged','Unmanaged.','Forbidden.','catch','use','headers','startsWith','authorization','Basic','User','pass','Wrong\x20credentials.','user','Unknown\x20authorization\x20format','query','apikey','getUuid'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x98a8,0x12c));var _0x898a=function(_0x468f2a,_0x3baa98){_0x468f2a=_0x468f2a-0x0;var _0xcb3402=_0x98a8[_0x468f2a];return _0xcb3402;};'use strict';var db=require(_0x898a('0x0'))['db'];var config=require(_0x898a('0x1'));var hardwareConf=require(_0x898a('0x2'));var _=require(_0x898a('0x3'));var jwt=require(_0x898a('0x4'));var expressJwt=require(_0x898a('0x5'));var compose=require(_0x898a('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x898a('0x7'));var BPromise=require(_0x898a('0x8'));var validateJwt=expressJwt({'secret':config[_0x898a('0x9')][_0x898a('0xa')]});var userAttributes=['id',_0x898a('0xb'),'fullname',_0x898a('0xc'),'internal',_0x898a('0xd'),'userpic',_0x898a('0xe'),_0x898a('0xf'),_0x898a('0x10'),_0x898a('0x11'),_0x898a('0x12'),_0x898a('0x13'),_0x898a('0x14'),_0x898a('0x15'),_0x898a('0x16'),'showWebBar',_0x898a('0x17'),'lastPauseAt',_0x898a('0x18'),'allowmessenger',_0x898a('0x19'),_0x898a('0x1a'),_0x898a('0x1b'),'phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x898a('0x1c'),_0x898a('0x1d'),_0x898a('0x1e'),_0x898a('0x1f'),_0x898a('0x20'),_0x898a('0x21'),'interface',_0x898a('0x22')];exports['isChatInteractionAuthorized']=function(){return this[_0x898a('0x23')](!![])['use'](function(_0x303321,_0x4fb05b,_0x18d167){if(_0x303321['user']){_0x18d167();}else{return db[_0x898a('0x24')][_0x898a('0x25')]({'where':{'id':_0x303321[_0x898a('0x26')]['id']},'attributes':['id','closed',_0x898a('0x27')],'raw':!![]})['then'](function(_0x54c8f3){if(_0x54c8f3&&_0x54c8f3[_0x898a('0x28')]){return _0x4fb05b[_0x898a('0x29')](_0x54c8f3['disposition']==='unmanaged'?0x195:0x193)[_0x898a('0x2a')]({'message':_0x54c8f3[_0x898a('0x27')]===_0x898a('0x2b')?_0x898a('0x2c'):_0x898a('0x2d')});}else{_0x18d167();}})[_0x898a('0x2e')](function(_0x259541){_0x18d167(_0x259541);});}});};exports['isAuthenticated']=function isAuthenticated(_0x247cfc){return compose()[_0x898a('0x2f')](function(_0x11cae2,_0x3cfd9c,_0x30495a){if(_0x11cae2[_0x898a('0x30')]['authorization']){if(_[_0x898a('0x31')](_0x11cae2[_0x898a('0x30')][_0x898a('0x32')],_0x898a('0x33'))){var _0x3901ab=basicAuth(_0x11cae2);db[_0x898a('0x34')]['find']({'where':{'name':_0x3901ab[_0x898a('0xc')]}})['then'](function(_0x513c6b){if(!_0x513c6b||!_0x513c6b['authenticate'](_0x3901ab[_0x898a('0x35')])){return _0x3cfd9c[_0x898a('0x29')](0x191)[_0x898a('0x2a')]({'message':_0x898a('0x36')});}_0x11cae2[_0x898a('0x37')]={'id':_0x513c6b['id']};_0x30495a();})[_0x898a('0x2e')](function(_0x398e98){_0x30495a(_0x398e98);});}else if(_[_0x898a('0x31')](_0x11cae2[_0x898a('0x30')]['authorization'],'Bearer')){validateJwt(_0x11cae2,_0x3cfd9c,_0x30495a);}else{if(_0x247cfc){_0x30495a();}else{return _0x3cfd9c['status'](0x193)[_0x898a('0x2a')]({'message':_0x898a('0x38')});}}}else if(_0x11cae2[_0x898a('0x39')][_0x898a('0x3a')]){var _0x34f447={'audience':hardwareConf[_0x898a('0x3b')](),'issuer':hardwareConf[_0x898a('0x3b')]()};verifyJwt(_0x11cae2[_0x898a('0x39')][_0x898a('0x3a')],_0x34f447)[_0x898a('0x3c')](function(_0x44c5d2){return db[_0x898a('0x34')]['find']({'where':{'id':_0x44c5d2[_0x898a('0x3d')]}})[_0x898a('0x3c')](function(_0x26eead){if(!_0x26eead||!_[_0x898a('0x3e')](_0x26eead[_0x898a('0x3f')],_0x44c5d2['nonce'])){return _0x3cfd9c['status'](0x193)[_0x898a('0x2a')]({'message':_0x898a('0x40')});}_0x11cae2[_0x898a('0x37')]={'id':_0x26eead['id']};_0x30495a();});})['catch'](function(_0x105477){_0x30495a(_0x105477);});}else if(_0x247cfc){_0x30495a();}else{return _0x3cfd9c[_0x898a('0x29')](0x193)[_0x898a('0x2a')]({'message':_0x898a('0x38')});}})[_0x898a('0x2f')](function(_0x3c43b7,_0x45d854,_0x146f32){if(_0x3c43b7['user']){db[_0x898a('0x34')]['find']({'where':{'id':_0x3c43b7['user']['id']},'attributes':userAttributes})[_0x898a('0x3c')](function(_0x58d997){if(!_0x58d997){return _0x45d854[_0x898a('0x29')](0x194)['json']({'message':_0x898a('0x41')});}_0x3c43b7['user']=_0x58d997;_0x146f32();})[_0x898a('0x2e')](function(_0x354703){_0x146f32(_0x354703);});}else if(_0x247cfc){_0x146f32();}else{return _0x45d854[_0x898a('0x29')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x898a('0x2f')](function(_0x429c32,_0x5a228f,_0xdd019d){return require(_0x898a('0x42'))[_0x898a('0x43')]()[_0x898a('0x3c')](function(_0x487093){if(_0x487093['update']){_0xdd019d();}else{return _0x5a228f[_0x898a('0x29')](0x193)[_0x898a('0x2a')]({'message':'Forbidden'});}})['catch'](function(_0x168f92){_0xdd019d(_0x168f92);});});};exports[_0x898a('0x44')]=function(_0x181cc8,_0xa45405,_0x51681f){_0x181cc8[_0x898a('0x44')]=!![];return _0x51681f();};exports[_0x898a('0x45')]=function signToken(_0x5a5bb5){return signJwt(_0x5a5bb5);};exports['setTokenCookie']=function(_0x48cc85,_0x2a69b9){if(!_0x48cc85[_0x898a('0x37')]){return _0x2a69b9[_0x898a('0x29')](0x194)[_0x898a('0x2a')]({'message':_0x898a('0x46')});}var _0x42ca36={'payload':{'id':_0x48cc85[_0x898a('0x37')]['id'],'role':_0x48cc85[_0x898a('0x37')][_0x898a('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x42ca36)[_0x898a('0x3c')](function(_0x246048){_0x2a69b9[_0x898a('0x47')](_0x898a('0x48'),_0x246048);_0x2a69b9[_0x898a('0x49')](_0x898a('0x4a'));})['catch'](function(_0x26ad34){return _0x2a69b9[_0x898a('0x29')](0x1f4)[_0x898a('0x4b')](_0x26ad34);});};exports['retrieveApiKey']=function(_0x34029e){if(_[_0x898a('0x4c')](_0x34029e[_0x898a('0x3f')])||_[_0x898a('0x4c')](_0x34029e[_0x898a('0x4d')])){return null;}else{return createJwt(_0x34029e);}};exports[_0x898a('0x4e')]=function(_0x2d1323){_0x2d1323[_0x898a('0x3f')]=generateNonce();_0x2d1323['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d1323);};exports[_0x898a('0x4f')]=function(_0x1a874a,_0x3d4aa3){var _0x21a990=_0x1a874a['query'][_0x898a('0x3a')];if(_0x21a990){var _0x152060={'nonce':_0x3d4aa3['apiKeyNonce'],'iat':_0x3d4aa3[_0x898a('0x4d')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x898a('0x3b')]()};return verifyJwt(_0x21a990,_0x152060)['then'](function(){return generateApiKey(_0x3d4aa3);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x322ecc){var _0x49e603=BPromise[_0x898a('0x50')](jwt[_0x898a('0x51')],{'context':jwt});var _0x4d6ac0=_0x322ecc[_0x898a('0x52')]||config[_0x898a('0x9')]['session'];return new BPromise(function(_0x2cf8a6,_0x199437){_0x49e603(_0x322ecc[_0x898a('0x53')],_0x4d6ac0,_0x322ecc[_0x898a('0x54')])['then'](function(_0x110a4f){_0x2cf8a6(_0x110a4f);})[_0x898a('0x2e')](function(_0x5674e5){_0x199437(_0x5674e5);});});}function verifyJwt(_0x25adcc,_0x1d8c16,_0x4ab441){var _0x28525b=BPromise['promisify'](jwt[_0x898a('0x55')],{'context':jwt});var _0x41f291=_0x4ab441||config[_0x898a('0x9')]['session'];return new BPromise(function(_0x2f6cb3,_0x1b09da){_0x28525b(_0x25adcc,_0x41f291,_0x1d8c16)[_0x898a('0x3c')](function(_0x3ff7be){_0x2f6cb3(_0x3ff7be);})['catch'](function(_0x2a21ad){_0x1b09da(_0x2a21ad);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x898a('0x56')](_0x898a('0x57'));}function generateIssuedAt(){return Math[_0x898a('0x58')](Date['now']()/0x3e8)[_0x898a('0x56')]();}function createJwt(_0x3c4db0){var _0x195ac2={'payload':{'iat':_0x3c4db0['apiKeyIat'],'nonce':_0x3c4db0['apiKeyNonce']},'options':{'algorithm':_0x898a('0x59'),'subject':_0x3c4db0['id'][_0x898a('0x56')](),'issuer':hardwareConf[_0x898a('0x3b')](),'audience':hardwareConf[_0x898a('0x3b')]()}};return signJwt(_0x195ac2)[_0x898a('0x3c')](function(_0x36b63a){return{'iat':_0x3c4db0[_0x898a('0x4d')],'nonce':_0x3c4db0[_0x898a('0x3f')],'token':_0x36b63a};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 0cad2ee..90f9046 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','end','final','binary','write','close','createDecipher'];(function(_0x5a18ed,_0x9936d2){var _0x12d357=function(_0x1bfa4c){while(--_0x1bfa4c){_0x5a18ed['push'](_0x5a18ed['shift']());}};_0x12d357(++_0x9936d2);}(_0xe706,0xa3));var _0x6e70=function(_0x24930c,_0xf01ff1){_0x24930c=_0x24930c-0x0;var _0x3ff362=_0xe706[_0x24930c];return _0x3ff362;};'use strict';var crypto=require(_0x6e70('0x0'));var fs=require('fs');var BPromise=require(_0x6e70('0x1'));var defaultOptions={'algorithm':_0x6e70('0x2')};function combineOptions(_0x5e8446){var _0x2cae77={};for(var _0x315629 in defaultOptions){if(defaultOptions[_0x6e70('0x3')](_0x315629)){_0x2cae77[_0x315629]=defaultOptions[_0x315629];}}if(_0x5e8446){for(var _0x7dfbc3 in _0x5e8446){if(_0x5e8446[_0x6e70('0x3')](_0x7dfbc3)){_0x2cae77[_0x7dfbc3]=_0x5e8446[_0x7dfbc3];}}}return _0x2cae77;}exports[_0x6e70('0x4')]=function(_0x376a8d,_0x506db9,_0x1b0389,_0x4381d1){return new BPromise(function(_0x36357b,_0x293ce7){_0x4381d1=combineOptions(_0x4381d1);var _0x45a2d4=new Buffer(_0x1b0389);var _0x188ed3=fs[_0x6e70('0x5')](_0x376a8d);var _0x449b48=fs[_0x6e70('0x6')](_0x506db9);var _0x25e61c=crypto[_0x6e70('0x7')](_0x4381d1[_0x6e70('0x8')],_0x45a2d4);_0x188ed3['on'](_0x6e70('0x9'),function(_0x3f474a){var _0x37b3e0=new Buffer(_0x25e61c[_0x6e70('0xa')](_0x3f474a),'binary');_0x449b48['write'](_0x37b3e0);});_0x188ed3['on'](_0x6e70('0xb'),function(){try{var _0x15a1a5=new Buffer(_0x25e61c[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x449b48[_0x6e70('0xe')](_0x15a1a5);_0x449b48[_0x6e70('0xb')]();_0x449b48['on'](_0x6e70('0xf'),function(){return _0x36357b(_0x506db9);});}catch(_0x5dfbaa){fs['unlink'](_0x506db9);return _0x293ce7(_0x5dfbaa);}});});};exports['decryptFile']=function(_0x257e81,_0x5a37a6,_0x53aed0,_0x304716){return new BPromise(function(_0x22c50c,_0x5d9263){_0x304716=combineOptions(_0x304716);var _0x24f3ac=new Buffer(_0x53aed0);var _0x5c3fe7=fs[_0x6e70('0x5')](_0x257e81);var _0x161f23=fs['createWriteStream'](_0x5a37a6);var _0x49029f=crypto[_0x6e70('0x10')](_0x304716['algorithm'],_0x24f3ac);_0x5c3fe7['on'](_0x6e70('0x9'),function(_0x173afe){var _0x53acdc=new Buffer(_0x49029f['update'](_0x173afe),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x53acdc);});_0x5c3fe7['on'](_0x6e70('0xb'),function(){try{var _0x3a9978=new Buffer(_0x49029f[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x3a9978);_0x161f23[_0x6e70('0xb')]();_0x161f23['on'](_0x6e70('0xf'),function(){return _0x22c50c(_0x5a37a6);});}catch(_0x4a0cfe){fs[_0x6e70('0x11')](_0x5a37a6);return _0x5d9263(_0x4a0cfe);}});});}; \ No newline at end of file +var _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0x121c57,_0x37d536){var _0x1d8eae=function(_0x13a505){while(--_0x13a505){_0x121c57['push'](_0x121c57['shift']());}};_0x1d8eae(++_0x37d536);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 199bd86..3e28451 100644 --- a/server/components/export/csv.js +++ b/server/components/export/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55e0=['util','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x55e0,0xdc));var _0x055e=function(_0xdaa17d,_0xde8c37){_0xdaa17d=_0xdaa17d-0x0;var _0x25e332=_0x55e0[_0xdaa17d];return _0x25e332;};'use strict';var util=require(_0x055e('0x0'));var path=require(_0x055e('0x1'));var _=require(_0x055e('0x2'));var csv=require(_0x055e('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x055e('0x4'));var db=require(_0x055e('0x5'))['db'];var dbH=require(_0x055e('0x5'))[_0x055e('0x6')];var logger=require(_0x055e('0x7'))(_0x055e('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x055e('0x9')][0x4];function analyticExtractedReport(_0x4a442e,_0x8e7824){var _0x3c4cf={'status':_0x4a442e};var _0x376618={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8e7824){_0x3c4cf[_0x055e('0xa')]=_0x8e7824;}return db[_0x055e('0xb')]['update'](_0x3c4cf,_0x376618);}function main(){var _0x40779c=0x1388;var _0xd67814;logger[_0x055e('0xc')](util[_0x055e('0xd')](_0x055e('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x055e('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x055e('0x10')]})[_0x055e('0x11')](function(_0x72d424){if(_0x72d424){_0xd67814=_0x72d424;_0x40779c=_0xd67814[_0x055e('0x10')]||0x1388;}})[_0x055e('0x11')](function(){return dbH[_0x055e('0x12')][_0x055e('0x13')](util['format'](_0x055e('0x14'),QUERY),{'type':dbH[_0x055e('0x12')][_0x055e('0x15')][_0x055e('0x16')]});})[_0x055e('0x11')](function(_0x56af18){if(!_0x56af18[0x0][_0x055e('0x17')]){return analyticExtractedReport(_0x055e('0x18'));}var _0x111cdb=[];var _0x599533=0x0;var _0x3f2d0e=!![];if(_0x56af18&&_0x56af18[_0x055e('0x19')]){var _0xb4e6ca=_0x56af18[0x0][_0x055e('0x17')]%(_0x599533+_0x40779c);if(_0xd67814[_0x055e('0x1a')]){for(;_0x3f2d0e;_0x599533+=_0x40779c,_0xb4e6ca=_0x56af18[0x0]['num']%(_0x599533+_0x40779c)){if(_0xb4e6ca==0x0||_0xb4e6ca==_0x56af18[0x0][_0x055e('0x17')]){_0x3f2d0e=![];}_0x111cdb[_0x055e('0x1b')](dbH[_0x055e('0x12')][_0x055e('0x13')](util['format'](_0x055e('0x1c'),QUERY,_0x40779c,_0x599533),{'type':dbH[_0x055e('0x12')]['QueryTypes'][_0x055e('0x16')]}));}}else{_0x111cdb[_0x055e('0x1b')](dbH[_0x055e('0x12')][_0x055e('0x13')](QUERY,{'type':dbH[_0x055e('0x12')][_0x055e('0x15')]['SELECT']}));}}var _0x31c355=path[_0x055e('0x1d')](PATH);var _0x211594=path['basename'](PATH,_0x055e('0x1e'));var _0x2da6b=_0xd67814[_0x055e('0x1a')]&&_0x111cdb[_0x055e('0x19')]>0x1;var _0x51df23=[];if(!fs[_0x055e('0x1f')](path['join'](_0x31c355,_0x211594))&&_0x2da6b){fs[_0x055e('0x20')](path[_0x055e('0x21')](_0x31c355,_0x211594));}return BPromise[_0x055e('0x22')](_0x111cdb,function(_0x1a76c6){_0x51df23[_0x055e('0x1b')](_0x1a76c6);})[_0x055e('0x11')](function(){for(var _0x58caf9=0x0;_0x58caf9<_0x51df23[_0x055e('0x19')];_0x58caf9+=0x1){var _0x1f90a9;var _0x2a82f8=_0x51df23[_0x58caf9];if(_0x2da6b){_0x1f90a9=path['join'](_0x31c355,_0x211594,util[_0x055e('0xd')](_0x055e('0x23'),_0x211594,_0x58caf9,_0x055e('0x24')));}else{_0x1f90a9=path[_0x055e('0x21')](_0x31c355,util['format'](_0x055e('0x25'),_0x211594,'csv'));}fs[_0x055e('0x26')](_0x1f90a9,csv(_0x2a82f8));}})[_0x055e('0x11')](function(){if(_0x2da6b){zipdir(path[_0x055e('0x21')](_0x31c355,_0x211594),{'saveTo':path[_0x055e('0x21')](_0x31c355,util[_0x055e('0xd')]('%s.%s',_0x211594,_0x055e('0x27')))},function(_0x453e5e,_0x293062){});rimraf(path[_0x055e('0x21')](_0x31c355,_0x211594),function(){});}})[_0x055e('0x11')](function(){logger[_0x055e('0xc')](util[_0x055e('0xd')](_0x055e('0x28'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x055e('0x29'),_0x2da6b?util[_0x055e('0xd')]('%s.%s',_0x211594,_0x2da6b?_0x055e('0x27'):_0x055e('0x24')):null);});})[_0x055e('0x2a')](function(_0x20717b){logger[_0x055e('0xc')](util[_0x055e('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x055e('0x2b')](_0x20717b,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x84ab=['inspect','Failed','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','AnalyticExtractedReport','info','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','%s.%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x84ab,0x12f));var _0xb84a=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x84ab[_0x41d432];return _0x1650f9;};'use strict';var util=require(_0xb84a('0x0'));var path=require(_0xb84a('0x1'));var _=require(_0xb84a('0x2'));var csv=require(_0xb84a('0x3'));var fs=require('fs');var BPromise=require(_0xb84a('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xb84a('0x5'));var db=require(_0xb84a('0x6'))['db'];var dbH=require('../../mysqldb')[_0xb84a('0x7')];var logger=require(_0xb84a('0x8'))(_0xb84a('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0xd445b5,_0x4fac4d){var _0x3e9086={'status':_0xd445b5};var _0x8d9dbe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4fac4d){_0x3e9086['savename']=_0x4fac4d;}return db[_0xb84a('0xa')]['update'](_0x3e9086,_0x8d9dbe);}function main(){var _0x2e6a71=0x1388;var _0x1886e0;logger[_0xb84a('0xb')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xb84a('0xc')][_0xb84a('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb84a('0xe'),_0xb84a('0xf')]})[_0xb84a('0x10')](function(_0x4d3758){if(_0x4d3758){_0x1886e0=_0x4d3758;_0x2e6a71=_0x1886e0[_0xb84a('0xf')]||0x1388;}})[_0xb84a('0x10')](function(){return dbH[_0xb84a('0x11')][_0xb84a('0x12')](util[_0xb84a('0x13')](_0xb84a('0x14'),QUERY),{'type':dbH[_0xb84a('0x11')][_0xb84a('0x15')][_0xb84a('0x16')]});})[_0xb84a('0x10')](function(_0xc0b2e0){if(!_0xc0b2e0[0x0][_0xb84a('0x17')]){return analyticExtractedReport('Empty');}var _0x11dd4d=[];var _0x4a691d=0x0;var _0xb65e5a=!![];if(_0xc0b2e0&&_0xc0b2e0[_0xb84a('0x18')]){var _0x1c7378=_0xc0b2e0[0x0][_0xb84a('0x17')]%(_0x4a691d+_0x2e6a71);if(_0x1886e0[_0xb84a('0xe')]){for(;_0xb65e5a;_0x4a691d+=_0x2e6a71,_0x1c7378=_0xc0b2e0[0x0][_0xb84a('0x17')]%(_0x4a691d+_0x2e6a71)){if(_0x1c7378==0x0||_0x1c7378==_0xc0b2e0[0x0][_0xb84a('0x17')]){_0xb65e5a=![];}_0x11dd4d[_0xb84a('0x19')](dbH[_0xb84a('0x11')][_0xb84a('0x12')](util[_0xb84a('0x13')](_0xb84a('0x1a'),QUERY,_0x2e6a71,_0x4a691d),{'type':dbH['sequelize'][_0xb84a('0x15')][_0xb84a('0x16')]}));}}else{_0x11dd4d['push'](dbH[_0xb84a('0x11')][_0xb84a('0x12')](QUERY,{'type':dbH[_0xb84a('0x11')][_0xb84a('0x15')]['SELECT']}));}}var _0x4ac5f8=path[_0xb84a('0x1b')](PATH);var _0x19097d=path[_0xb84a('0x1c')](PATH,_0xb84a('0x1d'));var _0x1e2fd4=_0x1886e0[_0xb84a('0xe')]&&_0x11dd4d[_0xb84a('0x18')]>0x1;var _0x21d0d3=[];if(!fs[_0xb84a('0x1e')](path[_0xb84a('0x1f')](_0x4ac5f8,_0x19097d))&&_0x1e2fd4){fs[_0xb84a('0x20')](path[_0xb84a('0x1f')](_0x4ac5f8,_0x19097d));}return BPromise[_0xb84a('0x21')](_0x11dd4d,function(_0x409df0){_0x21d0d3[_0xb84a('0x19')](_0x409df0);})[_0xb84a('0x10')](function(){for(var _0x378ce1=0x0;_0x378ce1<_0x21d0d3[_0xb84a('0x18')];_0x378ce1+=0x1){var _0x3b6805;var _0xd468c3=_0x21d0d3[_0x378ce1];if(_0x1e2fd4){_0x3b6805=path[_0xb84a('0x1f')](_0x4ac5f8,_0x19097d,util[_0xb84a('0x13')](_0xb84a('0x22'),_0x19097d,_0x378ce1,_0xb84a('0x23')));}else{_0x3b6805=path[_0xb84a('0x1f')](_0x4ac5f8,util[_0xb84a('0x13')]('%s.%s',_0x19097d,'csv'));}fs[_0xb84a('0x24')](_0x3b6805,csv(_0xd468c3));}})[_0xb84a('0x10')](function(){if(_0x1e2fd4){zipdir(path['join'](_0x4ac5f8,_0x19097d),{'saveTo':path[_0xb84a('0x1f')](_0x4ac5f8,util[_0xb84a('0x13')]('%s.%s',_0x19097d,'zip'))},function(_0x28f2e7,_0x8e9319){});rimraf(path['join'](_0x4ac5f8,_0x19097d),function(){});}})[_0xb84a('0x10')](function(){logger[_0xb84a('0xb')](util[_0xb84a('0x13')](_0xb84a('0x25'),EXTRACTED_REPORT_ID,_0xb84a('0x26')));return analyticExtractedReport(_0xb84a('0x27'),_0x1e2fd4?util[_0xb84a('0x13')](_0xb84a('0x28'),_0x19097d,_0x1e2fd4?'zip':_0xb84a('0x23')):null);});})['catch'](function(_0x4bca85){logger[_0xb84a('0xb')](util[_0xb84a('0x13')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0xb84a('0x29')](_0x4bca85,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xb84a('0x2a'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index fdefd1d..2316c83 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x35d881,_0x36e1a8){var _0x1facdc=function(_0x55ef7f){while(--_0x55ef7f){_0x35d881['push'](_0x35d881['shift']());}};_0x1facdc(++_0x36e1a8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file +var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x32e24b,_0x31224e){var _0x31f1e3=function(_0x277c3f){while(--_0x277c3f){_0x32e24b['push'](_0x32e24b['shift']());}};_0x31f1e3(++_0x31224e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index cb167c9..d981bae 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf56c=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.xlsx','length','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','push'];(function(_0x240c67,_0xa173b6){var _0x5e1692=function(_0x19658f){while(--_0x19658f){_0x240c67['push'](_0x240c67['shift']());}};_0x5e1692(++_0xa173b6);}(_0xf56c,0x67));var _0xcf56=function(_0x28d73e,_0x127d7b){_0x28d73e=_0x28d73e-0x0;var _0x646529=_0xf56c[_0x28d73e];return _0x646529;};'use strict';var util=require('util');var path=require(_0xcf56('0x0'));var _=require(_0xcf56('0x1'));var fs=require('fs');var json2xls=require(_0xcf56('0x2'));var BPromise=require(_0xcf56('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xcf56('0x4'));var db=require(_0xcf56('0x5'))['db'];var dbH=require(_0xcf56('0x5'))[_0xcf56('0x6')];var logger=require(_0xcf56('0x7'))(_0xcf56('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xcf56('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xcf56('0x9')][0x4];function analyticExtractedReport(_0x4869bb,_0xa9011c){var _0x27032f={'status':_0x4869bb};var _0x2bfc1f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa9011c){_0x27032f[_0xcf56('0xa')]=_0xa9011c;}return db[_0xcf56('0xb')]['update'](_0x27032f,_0x2bfc1f);}function main(){var _0x26fcd2=0x1388;var _0x127347;logger[_0xcf56('0xc')](util[_0xcf56('0xd')](_0xcf56('0xe'),EXTRACTED_REPORT_ID,_0xcf56('0xf')));return db[_0xcf56('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcf56('0x11'),_0xcf56('0x12')]})['then'](function(_0x1baa30){if(_0x1baa30){_0x127347=_0x1baa30;_0x26fcd2=_0x127347[_0xcf56('0x12')]||0x1388;}})[_0xcf56('0x13')](function(){return dbH['sequelize'][_0xcf56('0x14')](util[_0xcf56('0xd')](_0xcf56('0x15'),QUERY),{'type':dbH[_0xcf56('0x16')]['QueryTypes'][_0xcf56('0x17')]});})['then'](function(_0x3ace8f){if(!_0x3ace8f[0x0][_0xcf56('0x18')]){return analyticExtractedReport('Empty');}var _0x136eaf=[];var _0x25573e=0x0;var _0x3014cc=!![];if(_0x127347[_0xcf56('0x11')]){if(_0x3ace8f&&_0x3ace8f['length']){var _0x168a05=_0x3ace8f[0x0][_0xcf56('0x18')]%(_0x25573e+_0x26fcd2);for(;_0x3014cc;_0x25573e+=_0x26fcd2,_0x168a05=_0x3ace8f[0x0][_0xcf56('0x18')]%(_0x25573e+_0x26fcd2)){if(_0x168a05==0x0||_0x168a05==_0x3ace8f[0x0][_0xcf56('0x18')]){_0x3014cc=![];}_0x136eaf[_0xcf56('0x19')](dbH['sequelize']['query'](util['format'](_0xcf56('0x1a'),QUERY,_0x26fcd2,_0x25573e),{'type':dbH['sequelize'][_0xcf56('0x1b')][_0xcf56('0x17')]}));}}}else{_0x136eaf[_0xcf56('0x19')](dbH[_0xcf56('0x16')]['query'](QUERY,{'type':dbH['sequelize'][_0xcf56('0x1b')][_0xcf56('0x17')]}));}var _0x2287cf=path[_0xcf56('0x1c')](PATH);var _0x4a75a3=path['basename'](PATH,_0xcf56('0x1d'));var _0x76f174=_0x127347[_0xcf56('0x11')]&&_0x136eaf[_0xcf56('0x1e')]>0x1;var _0x2cb514=[];if(!fs['existsSync'](path[_0xcf56('0x1f')](_0x2287cf,_0x4a75a3))&&_0x76f174){fs[_0xcf56('0x20')](path[_0xcf56('0x1f')](_0x2287cf,_0x4a75a3));}return BPromise['each'](_0x136eaf,function(_0x37b942){_0x2cb514['push'](_0x37b942);})[_0xcf56('0x13')](function(){for(var _0x2fb88b=0x0;_0x2fb88b<_0x2cb514[_0xcf56('0x1e')];_0x2fb88b+=0x1){var _0x299812;var _0x1ddd87=_0x2cb514[_0x2fb88b];if(_0x76f174){_0x299812=path['join'](_0x2287cf,_0x4a75a3,util[_0xcf56('0xd')](_0xcf56('0x21'),_0x4a75a3,_0x2fb88b,_0xcf56('0x22')));}else{_0x299812=path[_0xcf56('0x1f')](_0x2287cf,util[_0xcf56('0xd')](_0xcf56('0x23'),_0x4a75a3,_0xcf56('0x22')));}fs[_0xcf56('0x24')](_0x299812,json2xls(_0x1ddd87),'binary');}})[_0xcf56('0x13')](function(){if(_0x76f174){zipdir(path[_0xcf56('0x1f')](_0x2287cf,_0x4a75a3),{'saveTo':path['join'](_0x2287cf,util[_0xcf56('0xd')](_0xcf56('0x23'),_0x4a75a3,_0xcf56('0x25')))},function(_0x1c23b9,_0x4dd997){});rimraf(path['join'](_0x2287cf,_0x4a75a3),function(){});}})['then'](function(){logger[_0xcf56('0xc')](util[_0xcf56('0xd')](_0xcf56('0x26'),EXTRACTED_REPORT_ID,_0xcf56('0xf')));return analyticExtractedReport(_0xcf56('0x27'),_0x76f174?util[_0xcf56('0xd')](_0xcf56('0x23'),_0x4a75a3,_0x76f174?'zip':_0xcf56('0x22')):null);});})[_0xcf56('0x28')](function(_0x56301e){logger[_0xcf56('0xc')](util[_0xcf56('0xd')](_0xcf56('0x29'),EXTRACTED_REPORT_ID,_0xcf56('0xf')),util[_0xcf56('0x2a')](_0x56301e,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x64b8=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','mkdirSync','each','%s.%s','xlsx','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','format'];(function(_0xac9943,_0xcb12fb){var _0x261f1b=function(_0x5376f){while(--_0x5376f){_0xac9943['push'](_0xac9943['shift']());}};_0x261f1b(++_0xcb12fb);}(_0x64b8,0x14b));var _0x864b=function(_0x16dab5,_0x3f6751){_0x16dab5=_0x16dab5-0x0;var _0x4e75c1=_0x64b8[_0x16dab5];return _0x4e75c1;};'use strict';var util=require('util');var path=require(_0x864b('0x0'));var _=require(_0x864b('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x864b('0x2'));var zipdir=require(_0x864b('0x3'));var rimraf=require(_0x864b('0x4'));var db=require(_0x864b('0x5'))['db'];var dbH=require(_0x864b('0x5'))[_0x864b('0x6')];var logger=require(_0x864b('0x7'))(_0x864b('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x864b('0x9')][0x2]);var QUERY=process[_0x864b('0x9')][0x3];var PATH=process[_0x864b('0x9')][0x4];function analyticExtractedReport(_0x255923,_0x2a124b){var _0x28242e={'status':_0x255923};var _0x316ecf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2a124b){_0x28242e[_0x864b('0xa')]=_0x2a124b;}return db['AnalyticExtractedReport']['update'](_0x28242e,_0x316ecf);}function main(){var _0x20e028=0x1388;var _0x5ef911;logger[_0x864b('0xb')](util[_0x864b('0xc')](_0x864b('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x864b('0xe')][_0x864b('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x864b('0x10'),_0x864b('0x11')]})[_0x864b('0x12')](function(_0x2f3f5c){if(_0x2f3f5c){_0x5ef911=_0x2f3f5c;_0x20e028=_0x5ef911[_0x864b('0x11')]||0x1388;}})[_0x864b('0x12')](function(){return dbH[_0x864b('0x13')]['query'](util[_0x864b('0xc')](_0x864b('0x14'),QUERY),{'type':dbH[_0x864b('0x13')][_0x864b('0x15')][_0x864b('0x16')]});})[_0x864b('0x12')](function(_0x4c2118){if(!_0x4c2118[0x0][_0x864b('0x17')]){return analyticExtractedReport(_0x864b('0x18'));}var _0x154a27=[];var _0xaf2a77=0x0;var _0xf0196b=!![];if(_0x5ef911[_0x864b('0x10')]){if(_0x4c2118&&_0x4c2118[_0x864b('0x19')]){var _0x3240d6=_0x4c2118[0x0][_0x864b('0x17')]%(_0xaf2a77+_0x20e028);for(;_0xf0196b;_0xaf2a77+=_0x20e028,_0x3240d6=_0x4c2118[0x0][_0x864b('0x17')]%(_0xaf2a77+_0x20e028)){if(_0x3240d6==0x0||_0x3240d6==_0x4c2118[0x0][_0x864b('0x17')]){_0xf0196b=![];}_0x154a27[_0x864b('0x1a')](dbH[_0x864b('0x13')][_0x864b('0x1b')](util[_0x864b('0xc')](_0x864b('0x1c'),QUERY,_0x20e028,_0xaf2a77),{'type':dbH[_0x864b('0x13')][_0x864b('0x15')][_0x864b('0x16')]}));}}}else{_0x154a27[_0x864b('0x1a')](dbH[_0x864b('0x13')][_0x864b('0x1b')](QUERY,{'type':dbH[_0x864b('0x13')][_0x864b('0x15')][_0x864b('0x16')]}));}var _0x2bb470=path[_0x864b('0x1d')](PATH);var _0x1dec91=path[_0x864b('0x1e')](PATH,_0x864b('0x1f'));var _0x443dd5=_0x5ef911[_0x864b('0x10')]&&_0x154a27[_0x864b('0x19')]>0x1;var _0x1eff9b=[];if(!fs['existsSync'](path[_0x864b('0x20')](_0x2bb470,_0x1dec91))&&_0x443dd5){fs[_0x864b('0x21')](path['join'](_0x2bb470,_0x1dec91));}return BPromise[_0x864b('0x22')](_0x154a27,function(_0x3476ec){_0x1eff9b[_0x864b('0x1a')](_0x3476ec);})[_0x864b('0x12')](function(){for(var _0x540aad=0x0;_0x540aad<_0x1eff9b['length'];_0x540aad+=0x1){var _0x464dcf;var _0x2dec87=_0x1eff9b[_0x540aad];if(_0x443dd5){_0x464dcf=path[_0x864b('0x20')](_0x2bb470,_0x1dec91,util[_0x864b('0xc')]('%s%d.%s',_0x1dec91,_0x540aad,'xlsx'));}else{_0x464dcf=path[_0x864b('0x20')](_0x2bb470,util['format'](_0x864b('0x23'),_0x1dec91,_0x864b('0x24')));}fs[_0x864b('0x25')](_0x464dcf,json2xls(_0x2dec87),'binary');}})[_0x864b('0x12')](function(){if(_0x443dd5){zipdir(path[_0x864b('0x20')](_0x2bb470,_0x1dec91),{'saveTo':path[_0x864b('0x20')](_0x2bb470,util['format'](_0x864b('0x23'),_0x1dec91,_0x864b('0x26')))},function(_0x2c15bb,_0x138c81){});rimraf(path[_0x864b('0x20')](_0x2bb470,_0x1dec91),function(){});}})['then'](function(){logger['info'](util['format'](_0x864b('0x27'),EXTRACTED_REPORT_ID,_0x864b('0x28')));return analyticExtractedReport('Completed',_0x443dd5?util[_0x864b('0xc')](_0x864b('0x23'),_0x1dec91,_0x443dd5?_0x864b('0x26'):_0x864b('0x24')):null);});})[_0x864b('0x29')](function(_0x696aac){logger[_0x864b('0xb')](util[_0x864b('0xc')](_0x864b('0x2a'),EXTRACTED_REPORT_ID,_0x864b('0x28')),util['inspect'](_0x696aac,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 5b1f822..d6d3485 100644 --- a/server/components/extensions/rewrite.js +++ b/server/components/extensions/rewrite.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x082b=['filter','groupBy','queue','playback','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','outbound','cutdigits','${EXTEN:','${EXTEN}','VoiceExtensionId','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','sortBy','error','rewrite','lodash','util','models','Interval','then','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0xc8f5a3,_0x4a02a5){var _0x55041a=function(_0x43fe7d){while(--_0x43fe7d){_0xc8f5a3['push'](_0xc8f5a3['shift']());}};_0x55041a(++_0x4a02a5);}(_0x082b,0x1ec));var _0xb082=function(_0x3e6d04,_0x954446){_0x3e6d04=_0x3e6d04-0x0;var _0x208489=_0x082b[_0x3e6d04];return _0x208489;};'use strict';var _=require(_0xb082('0x0'));var util=require(_0xb082('0x1'));function rewrite(_0x15109a,_0x106d1c){var _0x5af526=this;return _0x15109a[_0xb082('0x2')][_0xb082('0x3')]['findAll']({'raw':!![]})[_0xb082('0x4')](function(_0xa5485f){_0x5af526['intervals']=_0xa5485f;return _0x15109a[_0xb082('0x2')][_0xb082('0x5')][_0xb082('0x6')]({'where':{'IntervalId':_0x106d1c[_0xb082('0x7')]},'raw':!![]});})['then'](function(_0x3c4a19){return _0x15109a[_0xb082('0x2')][_0xb082('0x5')]['findAll']({'where':{'exten':{'$in':_[_0xb082('0x8')](_[_0xb082('0x9')](_0x3c4a19,_0xb082('0xa')))}},'order':[{'raw':_0xb082('0xb')}],'raw':!![]});})['then'](function(_0x3b87d9){var _0x4d95a4=_[_0xb082('0xc')](_0x3b87d9,{'priority':'1'});var _0x2e79c0=_[_0xb082('0xc')](_0x3b87d9,{'isApp':0x1});var _0x496b7f=_[_0xb082('0xd')](_0x2e79c0,_0xb082('0xa'));var _0x8b9bdb=[_0xb082('0xe'),_0xb082('0xf')];var _0xe23a4c=[];var _0x3b3816=[];for(var _0x295748 in _0x496b7f){if(_0x496b7f['hasOwnProperty'](_0x295748)){_0x5af526[_0xb082('0x10')]=0x2;_0x5af526[_0xb082('0x11')]=[];_0x5af526[_0xb082('0x12')]=_[_0xb082('0x13')](_0x4d95a4,{'exten':_0x496b7f[_0x295748][0x0][_0xb082('0xa')]});_0x5af526['extensions'][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':util[_0xb082('0x17')](_0xb082('0x18'),_0x496b7f[_0x295748][0x0][_0xb082('0x15')]),'context':_0x496b7f[_0x295748][0x0][_0xb082('0x19')],'exten':_0x496b7f[_0x295748][0x0]['exten'],'priority':_0x5af526['priority']++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0]['VoiceExtensionId']});if(_0x496b7f[_0x295748][0x0][_0xb082('0x15')]===_0xb082('0x1a')){if(_0x5af526['extension']){_0x5af526[_0xb082('0x11')][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':'CDR(destination)='+(_0x5af526[_0xb082('0x12')][_0xb082('0x1b')]?_0xb082('0x1c')+_0x5af526[_0xb082('0x12')]['cutdigits']+'}':_0xb082('0x1d')),'context':_0x496b7f[_0x295748][0x0]['context'],'exten':_0x496b7f[_0x295748][0x0][_0xb082('0xa')],'priority':_0x5af526[_0xb082('0x10')]++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});}_0x5af526[_0xb082('0x11')][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0]['type'],'app':_0xb082('0x16'),'appdata':_0xb082('0x1f')+_0x496b7f[_0x295748][0x0][_0xb082('0x1e')],'context':_0x496b7f[_0x295748][0x0]['context'],'exten':_0x496b7f[_0x295748][0x0][_0xb082('0xa')],'priority':_0x5af526[_0xb082('0x10')]++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});var _0x2a5102=_0x5af526['priority']++;_0x5af526['extensions']['push']({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':_0xb082('0x20'),'appdata':_0xb082('0x21')+(_0x2a5102+0x2)+_0xb082('0x22')+(_0x2a5102+0x1)+')','context':_0x496b7f[_0x295748][0x0]['context'],'exten':_0x496b7f[_0x295748][0x0][_0xb082('0xa')],'priority':_0x2a5102,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});if(_0x5af526[_0xb082('0x12')]){_0x5af526[_0xb082('0x11')][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':'Set','appdata':_0x5af526[_0xb082('0x12')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x5af526['extension'][_0xb082('0x1b')]+'}':_0xb082('0x23'),'context':_0x496b7f[_0x295748][0x0][_0xb082('0x19')],'exten':_0x496b7f[_0x295748][0x0]['exten'],'priority':_0x5af526[_0xb082('0x10')]++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});}_0x5af526[_0xb082('0x11')][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':_0xb082('0x24')+_0x496b7f[_0x295748][0x0][_0xb082('0x1e')],'context':_0x496b7f[_0x295748][0x0]['context'],'exten':_0x496b7f[_0x295748][0x0][_0xb082('0xa')],'priority':_0x5af526[_0xb082('0x10')]++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});if(_0x5af526[_0xb082('0x12')]&&_0x5af526[_0xb082('0x12')][_0xb082('0x25')](_0xb082('0x26'))&&_0x5af526[_0xb082('0x12')][_0xb082('0x26')]!==_0xb082('0x27')){_0x5af526[_0xb082('0x11')][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':_0xb082('0x28'),'context':_0x496b7f[_0x295748][0x0][_0xb082('0x19')],'exten':_0x496b7f[_0x295748][0x0]['exten'],'priority':_0x5af526['priority']++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});_0x5af526[_0xb082('0x11')][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5af526['extension'][_0xb082('0x26')]||_0xb082('0x29'),'context':_0x496b7f[_0x295748][0x0][_0xb082('0x19')],'exten':_0x496b7f[_0x295748][0x0]['exten'],'priority':_0x5af526[_0xb082('0x10')]++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0]['VoiceExtensionId']});}}_0x5af526[_0xb082('0x11')]['push']({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':_0xb082('0x2a'),'context':_0x496b7f[_0x295748][0x0][_0xb082('0x19')],'exten':_0x496b7f[_0x295748][0x0]['exten'],'priority':_0x5af526[_0xb082('0x10')]++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});_0x5af526[_0xb082('0x11')][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0]['type'],'app':'Set','appdata':_0xb082('0x2b'),'context':_0x496b7f[_0x295748][0x0]['context'],'exten':_0x496b7f[_0x295748][0x0][_0xb082('0xa')],'priority':_0x5af526[_0xb082('0x10')]++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});_0x5af526[_0xb082('0x11')]['push']({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':'MONITOR_OPTIONS=ab','context':_0x496b7f[_0x295748][0x0][_0xb082('0x19')],'exten':_0x496b7f[_0x295748][0x0][_0xb082('0xa')],'priority':_0x5af526[_0xb082('0x10')]++,'VoiceExtensionId':_0x496b7f[_0x295748][0x0]['VoiceExtensionId']});for(var _0x1a4c5e=0x0,_0x2b4e42=0x0;_0x1a4c5e<_0x496b7f[_0x295748][_0xb082('0x2c')];_0x1a4c5e+=0x1,_0x2b4e42=0x0){var _0x42a685=_0x496b7f[_0x295748][_0x1a4c5e];if(_0x42a685[_0xb082('0x15')]){_0x42a685['type']=_0x42a685[_0xb082('0x15')][_0xb082('0x2d')]();}var _0xa19d6f=[];var _0xf27b2f=[];delete _0x42a685['id'];delete _0x42a685[_0xb082('0x2e')];delete _0x42a685[_0xb082('0x2f')];var _0x23d000=_0x42a685[_0xb082('0x30')]!==_0xb082('0x31')?[_0x42a685[_0xb082('0x30')]]:_0x42a685['IntervalId']?_[_0xb082('0x9')](_[_0xb082('0xc')](_0x5af526[_0xb082('0x32')],{'IntervalId':_0x42a685[_0xb082('0x7')]}),_0xb082('0x30')):[];if(_0x42a685[_0xb082('0x25')](_0xb082('0x33'))){if(_0x42a685[_0xb082('0x33')]&&_0x42a685[_0xb082('0x33')]!=='--'){_0xa19d6f[_0xb082('0x14')]({'type':_0x42a685[_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':_0xb082('0x34')+_0x42a685[_0xb082('0x33')],'context':_0x42a685[_0xb082('0x19')],'exten':_0x42a685[_0xb082('0xa')],'priority':_0x23d000[_0xb082('0x2c')]+_0x5af526[_0xb082('0x10')]+_0x2b4e42++,'VoiceExtensionId':_0x42a685[_0xb082('0x1e')]});}}if(_0x42a685[_0xb082('0x15')]===_0xb082('0x1a')&&_0x42a685[_0xb082('0x25')](_0xb082('0x35'))){if(_0x42a685[_0xb082('0x35')]){_0xa19d6f[_0xb082('0x14')]({'type':_0x42a685[_0xb082('0x15')],'app':_0xb082('0x20'),'appdata':_0xb082('0x36')+_0x42a685[_0xb082('0x35')]+')','context':_0x42a685[_0xb082('0x19')],'exten':_0x42a685['exten'],'priority':_0x23d000[_0xb082('0x2c')]+_0x5af526['priority']+_0x2b4e42++,'VoiceExtensionId':_0x42a685[_0xb082('0x1e')]});}else{_0xa19d6f['push']({'type':_0x42a685[_0xb082('0x15')],'app':_0xb082('0x20'),'appdata':_0xb082('0x37'),'context':_0x42a685[_0xb082('0x19')],'exten':_0x42a685[_0xb082('0xa')],'priority':_0x23d000[_0xb082('0x2c')]+_0x5af526['priority']+_0x2b4e42++,'VoiceExtensionId':_0x42a685['VoiceExtensionId']});}}if(_0x42a685[_0xb082('0x25')](_0xb082('0x38'))){if(_0x8b9bdb[_0xb082('0x39')](_0x42a685[_0xb082('0x3a')]['toLowerCase']())>=0x0&&_0x42a685[_0xb082('0x3b')]!=='custom'){if(_0x42a685[_0xb082('0x38')]){_0xa19d6f[_0xb082('0x14')]({'type':_0x42a685['type'],'app':_0xb082('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x42a685[_0xb082('0x19')],'exten':_0x42a685['exten'],'priority':_0x23d000[_0xb082('0x2c')]+_0x5af526[_0xb082('0x10')]+_0x2b4e42++,'VoiceExtensionId':_0x42a685[_0xb082('0x1e')]});_0xa19d6f[_0xb082('0x14')]({'type':_0x42a685[_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x42a685[_0xb082('0x19')],'exten':_0x42a685['exten'],'priority':_0x23d000[_0xb082('0x2c')]+_0x5af526[_0xb082('0x10')]+_0x2b4e42++,'VoiceExtensionId':_0x42a685[_0xb082('0x1e')]});}else{_0xa19d6f[_0xb082('0x14')]({'type':_0x42a685[_0xb082('0x15')],'app':_0xb082('0x20'),'appdata':_0xb082('0x3c'),'context':_0x42a685['context'],'exten':_0x42a685[_0xb082('0xa')],'priority':_0x23d000[_0xb082('0x2c')]+_0x5af526[_0xb082('0x10')]+_0x2b4e42++,'VoiceExtensionId':_0x42a685[_0xb082('0x1e')]});_0xa19d6f['push']({'type':_0x42a685[_0xb082('0x15')],'app':_0xb082('0x16'),'appdata':_0xb082('0x3d'),'context':_0x42a685[_0xb082('0x19')],'exten':_0x42a685[_0xb082('0xa')],'priority':_0x23d000[_0xb082('0x2c')]+_0x5af526[_0xb082('0x10')]+_0x2b4e42++,'VoiceExtensionId':_0x42a685[_0xb082('0x1e')]});}}}for(var _0x34c5ea=0x0;_0x34c5ea<_0x23d000[_0xb082('0x2c')];_0x34c5ea+=0x1){var _0x487d0b=_0x5af526[_0xb082('0x10')]+_0x23d000['length'];var _0x51c902=_0x34c5ea===_0x23d000[_0xb082('0x2c')]-0x1?_0x5af526[_0xb082('0x10')]+_0xa19d6f[_0xb082('0x2c')]+_0xf27b2f[_0xb082('0x2c')]+0x2:_0x5af526[_0xb082('0x10')]+_0x34c5ea+0x1;_0xa19d6f[_0xb082('0x3e')](_0x34c5ea,0x0,{'type':_0x42a685[_0xb082('0x15')],'app':_0xb082('0x3f'),'appdata':_0x23d000[_0x34c5ea]+'?'+_0x42a685[_0xb082('0x19')]+_0xb082('0x40')+_0x487d0b+':'+_0x42a685[_0xb082('0x19')]+_0xb082('0x40')+_0x51c902,'exten':_0x42a685[_0xb082('0xa')],'context':_0x42a685[_0xb082('0x19')],'priority':_0x5af526[_0xb082('0x10')]+_0x34c5ea,'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});}_0x42a685[_0xb082('0x10')]=_0xa19d6f['length']?_[_0xb082('0x41')](_0xa19d6f)[_0xb082('0x10')]+0x1:_0x5af526[_0xb082('0x10')];_0x5af526['priority']=(_0xf27b2f[_0xb082('0x2c')]?_[_0xb082('0x41')](_0xf27b2f)[_0xb082('0x10')]:_0x42a685[_0xb082('0x10')])+0x1;_0x5af526[_0xb082('0x11')]=_[_0xb082('0x42')](_0x5af526[_0xb082('0x11')],_0xa19d6f,[_0x42a685],_0xf27b2f);}_0x5af526[_0xb082('0x11')][_0xb082('0x14')]({'type':_0x496b7f[_0x295748][0x0][_0xb082('0x15')],'app':_0xb082('0x43'),'exten':_0x496b7f[_0x295748][0x0][_0xb082('0xa')],'context':_0x496b7f[_0x295748][0x0]['context'],'priority':_0x5af526[_0xb082('0x10')],'VoiceExtensionId':_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]});_0xe23a4c['push'](_0x496b7f[_0x295748][0x0][_0xb082('0x1e')]);_0x3b3816=_[_0xb082('0x42')](_0x3b3816,_0x5af526[_0xb082('0x11')]);}}return _0x15109a['transaction'](function(_0x5b4d7a){return _0x15109a[_0xb082('0x2')][_0xb082('0x5')][_0xb082('0x44')]({'where':{'VoiceExtensionId':{'$in':_0xe23a4c}},'transaction':_0x5b4d7a})[_0xb082('0x4')](function(_0x44047c){return _0x15109a[_0xb082('0x2')][_0xb082('0x5')]['bulkCreate'](_[_0xb082('0x45')](_0x3b3816,_0xb082('0x10')),{'transaction':_0x5b4d7a});});});})['catch'](function(_0xc5d629){console[_0xb082('0x46')](_0xc5d629);});}exports[_0xb082('0x47')]=rewrite; \ No newline at end of file +var _0xd433=['filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','push','CDR(type)=%s','type','context','outbound','extension','${EXTEN:','cutdigits','${EXTEN}','VoiceExtensionId','Set','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','indexOf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x5b1beb,_0x543c6c){var _0x426f05=function(_0x117daa){while(--_0x117daa){_0x5b1beb['push'](_0x5b1beb['shift']());}};_0x426f05(++_0x543c6c);}(_0xd433,0x1c8));var _0x3d43=function(_0x2a382c,_0x3c7413){_0x2a382c=_0x2a382c-0x0;var _0x102430=_0xd433[_0x2a382c];return _0x102430;};'use strict';var _=require(_0x3d43('0x0'));var util=require(_0x3d43('0x1'));function rewrite(_0x57fbed,_0x23a6c4){var _0x2078ef=this;return _0x57fbed[_0x3d43('0x2')][_0x3d43('0x3')][_0x3d43('0x4')]({'raw':!![]})[_0x3d43('0x5')](function(_0x6ce384){_0x2078ef[_0x3d43('0x6')]=_0x6ce384;return _0x57fbed[_0x3d43('0x2')][_0x3d43('0x7')]['findAll']({'where':{'IntervalId':_0x23a6c4[_0x3d43('0x8')]},'raw':!![]});})[_0x3d43('0x5')](function(_0x41ecb8){return _0x57fbed[_0x3d43('0x2')]['VoiceExtension'][_0x3d43('0x4')]({'where':{'exten':{'$in':_[_0x3d43('0x9')](_[_0x3d43('0xa')](_0x41ecb8,_0x3d43('0xb')))}},'order':[{'raw':_0x3d43('0xc')}],'raw':!![]});})[_0x3d43('0x5')](function(_0x2ab71e){var _0x4bbfa1=_['filter'](_0x2ab71e,{'priority':'1'});var _0x547cd7=_[_0x3d43('0xd')](_0x2ab71e,{'isApp':0x1});var _0x12fc91=_[_0x3d43('0xe')](_0x547cd7,'exten');var _0x294dbf=[_0x3d43('0xf'),_0x3d43('0x10')];var _0x3818ca=[];var _0x10fb12=[];for(var _0x24ade1 in _0x12fc91){if(_0x12fc91[_0x3d43('0x11')](_0x24ade1)){_0x2078ef[_0x3d43('0x12')]=0x2;_0x2078ef[_0x3d43('0x13')]=[];_0x2078ef['extension']=_[_0x3d43('0x14')](_0x4bbfa1,{'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')]});_0x2078ef[_0x3d43('0x13')][_0x3d43('0x15')]({'type':_0x12fc91[_0x24ade1][0x0]['type'],'app':'Set','appdata':util['format'](_0x3d43('0x16'),_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')]),'context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0]['VoiceExtensionId']});if(_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')]===_0x3d43('0x19')){if(_0x2078ef['extension']){_0x2078ef[_0x3d43('0x13')]['push']({'type':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')],'app':'Set','appdata':'CDR(destination)='+(_0x2078ef[_0x3d43('0x1a')]['cutdigits']?_0x3d43('0x1b')+_0x2078ef[_0x3d43('0x1a')][_0x3d43('0x1c')]+'}':_0x3d43('0x1d')),'context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')]});}_0x2078ef[_0x3d43('0x13')][_0x3d43('0x15')]({'type':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')],'app':_0x3d43('0x1f'),'appdata':_0x3d43('0x20')+_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')],'context':_0x12fc91[_0x24ade1][0x0]['context'],'exten':_0x12fc91[_0x24ade1][0x0]['exten'],'priority':_0x2078ef['priority']++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')]});var _0x4c605a=_0x2078ef[_0x3d43('0x12')]++;_0x2078ef[_0x3d43('0x13')][_0x3d43('0x15')]({'type':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')],'app':_0x3d43('0x21'),'appdata':_0x3d43('0x22')+(_0x4c605a+0x2)+_0x3d43('0x23')+(_0x4c605a+0x1)+')','context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x4c605a,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0]['VoiceExtensionId']});if(_0x2078ef[_0x3d43('0x1a')]){_0x2078ef[_0x3d43('0x13')]['push']({'type':_0x12fc91[_0x24ade1][0x0]['type'],'app':_0x3d43('0x1f'),'appdata':_0x2078ef['extension'][_0x3d43('0x1c')]?_0x3d43('0x24')+_0x2078ef['extension']['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x12fc91[_0x24ade1][0x0]['context'],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')]});}_0x2078ef['extensions']['push']({'type':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')],'app':'Set','appdata':'outboundrouteid='+_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')],'context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')]});if(_0x2078ef[_0x3d43('0x1a')]&&_0x2078ef['extension'][_0x3d43('0x11')](_0x3d43('0x25'))&&_0x2078ef[_0x3d43('0x1a')][_0x3d43('0x25')]!==_0x3d43('0x26')){_0x2078ef['extensions'][_0x3d43('0x15')]({'type':_0x12fc91[_0x24ade1][0x0]['type'],'app':'Set','appdata':_0x3d43('0x27'),'context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')]});_0x2078ef[_0x3d43('0x13')][_0x3d43('0x15')]({'type':_0x12fc91[_0x24ade1][0x0]['type'],'app':_0x3d43('0x1f'),'appdata':_0x3d43('0x28')+_0x2078ef[_0x3d43('0x1a')][_0x3d43('0x25')]||_0x3d43('0x29'),'context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'exten':_0x12fc91[_0x24ade1][0x0]['exten'],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0]['VoiceExtensionId']});}}_0x2078ef[_0x3d43('0x13')]['push']({'type':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')],'app':_0x3d43('0x1f'),'appdata':_0x3d43('0x2a'),'context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0]['VoiceExtensionId']});_0x2078ef[_0x3d43('0x13')][_0x3d43('0x15')]({'type':_0x12fc91[_0x24ade1][0x0]['type'],'app':_0x3d43('0x1f'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')]});_0x2078ef['extensions'][_0x3d43('0x15')]({'type':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')],'app':_0x3d43('0x1f'),'appdata':_0x3d43('0x2b'),'context':_0x12fc91[_0x24ade1][0x0]['context'],'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'priority':_0x2078ef[_0x3d43('0x12')]++,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0]['VoiceExtensionId']});for(var _0x3e14f5=0x0,_0x1e789e=0x0;_0x3e14f5<_0x12fc91[_0x24ade1][_0x3d43('0x2c')];_0x3e14f5+=0x1,_0x1e789e=0x0){var _0xc063f0=_0x12fc91[_0x24ade1][_0x3e14f5];if(_0xc063f0[_0x3d43('0x17')]){_0xc063f0[_0x3d43('0x17')]=_0xc063f0[_0x3d43('0x17')][_0x3d43('0x2d')]();}var _0x4aeae7=[];var _0x47d907=[];delete _0xc063f0['id'];delete _0xc063f0[_0x3d43('0x2e')];delete _0xc063f0['updatedAt'];var _0x539152=_0xc063f0[_0x3d43('0x2f')]!==_0x3d43('0x30')?[_0xc063f0[_0x3d43('0x2f')]]:_0xc063f0['IntervalId']?_[_0x3d43('0xa')](_[_0x3d43('0xd')](_0x2078ef[_0x3d43('0x6')],{'IntervalId':_0xc063f0[_0x3d43('0x8')]}),_0x3d43('0x2f')):[];if(_0xc063f0[_0x3d43('0x11')](_0x3d43('0x31'))){if(_0xc063f0['tag']&&_0xc063f0[_0x3d43('0x31')]!=='--'){_0x4aeae7[_0x3d43('0x15')]({'type':_0xc063f0[_0x3d43('0x17')],'app':_0x3d43('0x1f'),'appdata':_0x3d43('0x32')+_0xc063f0[_0x3d43('0x31')],'context':_0xc063f0['context'],'exten':_0xc063f0[_0x3d43('0xb')],'priority':_0x539152[_0x3d43('0x2c')]+_0x2078ef[_0x3d43('0x12')]+_0x1e789e++,'VoiceExtensionId':_0xc063f0['VoiceExtensionId']});}}if(_0xc063f0[_0x3d43('0x17')]===_0x3d43('0x19')&&_0xc063f0[_0x3d43('0x11')]('callerID')){if(_0xc063f0[_0x3d43('0x33')]){_0x4aeae7[_0x3d43('0x15')]({'type':_0xc063f0[_0x3d43('0x17')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0xc063f0[_0x3d43('0x33')]+')','context':_0xc063f0[_0x3d43('0x18')],'exten':_0xc063f0[_0x3d43('0xb')],'priority':_0x539152[_0x3d43('0x2c')]+_0x2078ef[_0x3d43('0x12')]+_0x1e789e++,'VoiceExtensionId':_0xc063f0['VoiceExtensionId']});}else{_0x4aeae7[_0x3d43('0x15')]({'type':_0xc063f0[_0x3d43('0x17')],'app':_0x3d43('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0xc063f0[_0x3d43('0x18')],'exten':_0xc063f0[_0x3d43('0xb')],'priority':_0x539152[_0x3d43('0x2c')]+_0x2078ef[_0x3d43('0x12')]+_0x1e789e++,'VoiceExtensionId':_0xc063f0[_0x3d43('0x1e')]});}}if(_0xc063f0[_0x3d43('0x11')]('answer')){if(_0x294dbf[_0x3d43('0x34')](_0xc063f0['app'][_0x3d43('0x2d')]())>=0x0&&_0xc063f0['appType']!=='custom'){if(_0xc063f0['answer']){_0x4aeae7['push']({'type':_0xc063f0[_0x3d43('0x17')],'app':_0x3d43('0x21'),'appdata':_0x3d43('0x35'),'context':_0xc063f0[_0x3d43('0x18')],'exten':_0xc063f0[_0x3d43('0xb')],'priority':_0x539152[_0x3d43('0x2c')]+_0x2078ef['priority']+_0x1e789e++,'VoiceExtensionId':_0xc063f0['VoiceExtensionId']});_0x4aeae7[_0x3d43('0x15')]({'type':_0xc063f0['type'],'app':_0x3d43('0x1f'),'appdata':_0x3d43('0x36'),'context':_0xc063f0[_0x3d43('0x18')],'exten':_0xc063f0[_0x3d43('0xb')],'priority':_0x539152['length']+_0x2078ef[_0x3d43('0x12')]+_0x1e789e++,'VoiceExtensionId':_0xc063f0[_0x3d43('0x1e')]});}else{_0x4aeae7[_0x3d43('0x15')]({'type':_0xc063f0[_0x3d43('0x17')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xc063f0['context'],'exten':_0xc063f0['exten'],'priority':_0x539152[_0x3d43('0x2c')]+_0x2078ef[_0x3d43('0x12')]+_0x1e789e++,'VoiceExtensionId':_0xc063f0[_0x3d43('0x1e')]});_0x4aeae7[_0x3d43('0x15')]({'type':_0xc063f0[_0x3d43('0x17')],'app':_0x3d43('0x1f'),'appdata':_0x3d43('0x37'),'context':_0xc063f0['context'],'exten':_0xc063f0[_0x3d43('0xb')],'priority':_0x539152['length']+_0x2078ef[_0x3d43('0x12')]+_0x1e789e++,'VoiceExtensionId':_0xc063f0[_0x3d43('0x1e')]});}}}for(var _0x10a0d3=0x0;_0x10a0d3<_0x539152[_0x3d43('0x2c')];_0x10a0d3+=0x1){var _0x1082a7=_0x2078ef[_0x3d43('0x12')]+_0x539152[_0x3d43('0x2c')];var _0x3e8705=_0x10a0d3===_0x539152['length']-0x1?_0x2078ef[_0x3d43('0x12')]+_0x4aeae7[_0x3d43('0x2c')]+_0x47d907[_0x3d43('0x2c')]+0x2:_0x2078ef[_0x3d43('0x12')]+_0x10a0d3+0x1;_0x4aeae7[_0x3d43('0x38')](_0x10a0d3,0x0,{'type':_0xc063f0[_0x3d43('0x17')],'app':_0x3d43('0x39'),'appdata':_0x539152[_0x10a0d3]+'?'+_0xc063f0[_0x3d43('0x18')]+_0x3d43('0x3a')+_0x1082a7+':'+_0xc063f0[_0x3d43('0x18')]+_0x3d43('0x3a')+_0x3e8705,'exten':_0xc063f0[_0x3d43('0xb')],'context':_0xc063f0[_0x3d43('0x18')],'priority':_0x2078ef['priority']+_0x10a0d3,'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0]['VoiceExtensionId']});}_0xc063f0[_0x3d43('0x12')]=_0x4aeae7['length']?_[_0x3d43('0x3b')](_0x4aeae7)['priority']+0x1:_0x2078ef[_0x3d43('0x12')];_0x2078ef[_0x3d43('0x12')]=(_0x47d907[_0x3d43('0x2c')]?_[_0x3d43('0x3b')](_0x47d907)[_0x3d43('0x12')]:_0xc063f0[_0x3d43('0x12')])+0x1;_0x2078ef[_0x3d43('0x13')]=_[_0x3d43('0x3c')](_0x2078ef[_0x3d43('0x13')],_0x4aeae7,[_0xc063f0],_0x47d907);}_0x2078ef['extensions'][_0x3d43('0x15')]({'type':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x17')],'app':_0x3d43('0x3d'),'exten':_0x12fc91[_0x24ade1][0x0][_0x3d43('0xb')],'context':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x18')],'priority':_0x2078ef[_0x3d43('0x12')],'VoiceExtensionId':_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')]});_0x3818ca['push'](_0x12fc91[_0x24ade1][0x0][_0x3d43('0x1e')]);_0x10fb12=_['concat'](_0x10fb12,_0x2078ef[_0x3d43('0x13')]);}}return _0x57fbed[_0x3d43('0x3e')](function(_0x54dcde){return _0x57fbed[_0x3d43('0x2')][_0x3d43('0x7')][_0x3d43('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x3818ca}},'transaction':_0x54dcde})[_0x3d43('0x5')](function(_0x23abfa){return _0x57fbed['models'][_0x3d43('0x7')][_0x3d43('0x40')](_[_0x3d43('0x41')](_0x10fb12,_0x3d43('0x12')),{'transaction':_0x54dcde});});});})['catch'](function(_0x9c624a){console['error'](_0x9c624a);});}exports[_0x3d43('0x42')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 172f906..6f33de8 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','fromQuery','cm_contacts','str','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','duplicate','pause','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate'];(function(_0x422eae,_0x2bbd48){var _0x442cca=function(_0x23a141){while(--_0x23a141){_0x422eae['push'](_0x422eae['shift']());}};_0x442cca(++_0x2bbd48);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require('bluebird');var util=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var fs=require('fs');var squel=require(_0x0baf('0x2'));var Papa=require(_0x0baf('0x3'));var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));config[_0x0baf('0x8')]=_[_0x0baf('0x9')](config[_0x0baf('0x8')],{'host':_0x0baf('0xa'),'port':0x18eb});var socket=require(_0x0baf('0xb'))(new Redis(config[_0x0baf('0x8')]));require(_0x0baf('0xc'))['register'](socket);try{if(!process[_0x0baf('0xd')][0x2]||process['argv'][0x2]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x2]===_0x0baf('0xf')){throw new Error(_0x0baf('0x10'));}var FILEPATH=process[_0x0baf('0xd')][0x2];if(!process[_0x0baf('0xd')][0x3]||process[_0x0baf('0xd')][0x3]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x3]===_0x0baf('0xf')||!process[_0x0baf('0xd')][0x4]||process['argv'][0x4]==='undefined'||process[_0x0baf('0xd')][0x4]===_0x0baf('0xf')){throw new Error(_0x0baf('0x11'));}var FIELDS=_[_0x0baf('0x12')](process['argv'][0x3][_0x0baf('0x13')](','),process['argv'][0x4][_0x0baf('0x13')](','));if(!process[_0x0baf('0xd')][0x5]||process[_0x0baf('0xd')][0x5]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x5]===_0x0baf('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x0baf('0xd')][0x6]&&process[_0x0baf('0xd')][0x6]!==_0x0baf('0xe')&&process[_0x0baf('0xd')][0x6]!==_0x0baf('0xf')?process[_0x0baf('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x0baf('0xd')][0x7]!==_0x0baf('0xe')&&process[_0x0baf('0xd')][0x7]!==_0x0baf('0xf')?process[_0x0baf('0xd')][0x7]:null;if(!process[_0x0baf('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0x0baf('0xd')][0x8]===_0x0baf('0xf')){throw new Error(_0x0baf('0x14'));}var SOCKET_TIMESTAMP=process[_0x0baf('0xd')][0x8];}catch(_0x1fa92b){logger[_0x0baf('0x15')](_0x1fa92b);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x210cd8,_0x636a13,_0x2c42e2,_0x15a2c3){var _0x54f2fa={'message':_0x636a13};_0x54f2fa[_0x210cd8]=!![];if(_0x2c42e2){_0x54f2fa[_0x0baf('0x16')]=_0x2c42e2;}if(_0x15a2c3){_0x54f2fa['index']=_0x15a2c3;}return _0x54f2fa;}function isEmail(_0xf6c158){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0xf6c158);}function checkRow(_0x4de74c,_0x2ef0aa,_0x48a0e9){return new BPromise(function(_0x4be1b9,_0x47c4b){if(_[_0x0baf('0x17')](_0x4de74c)){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x18'),null,_0x48a0e9));}if(_0x4de74c[_0x0baf('0x19')]&&_0x4de74c['errors'][_0x0baf('0x1a')]){var _0x4681c5=_[_0x0baf('0x1b')](_0x4de74c[_0x0baf('0x19')],_0x0baf('0x1c'))[_0x0baf('0x1d')](';');return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x4681c5,null,_0x48a0e9));}var _0x549fd0={};for(var _0x1590b4 in FIELDS){if(FIELDS[_0x0baf('0x1e')](_0x1590b4)&&FIELDS[_0x1590b4]){_0x549fd0[_0x1590b4]=_0x4de74c[_0x0baf('0x1f')][0x0][FIELDS[_0x1590b4]]||_0x4de74c[_0x0baf('0x1f')][0x0]['\ufeff'+FIELDS[_0x1590b4]];}}if(!_0x549fd0['firstName']){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x20'),null,_0x48a0e9));}if(!_0x549fd0['phone']){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x21'),null,_0x48a0e9));}if(_0x549fd0[_0x0baf('0x22')]){var _0xb4dbb1=moment(_0x549fd0[_0x0baf('0x22')],_0x0baf('0x23'));if(!_0xb4dbb1[_0x0baf('0x24')]()){return _0x47c4b(handleCheckRowError('error',_0x0baf('0x25'),null,_0x48a0e9));}}if(_0x549fd0[_0x0baf('0x26')]){if(!isEmail(_0x549fd0[_0x0baf('0x26')])){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x27'),null,_0x48a0e9));}}_0x549fd0[_0x0baf('0x28')]=LISTID;_0x549fd0[_0x0baf('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0baf('0x1a')]&&_0x2ef0aa){var _0x59431b={};for(var _0x3ded64=0x0,_0x2adfd7=DUPLICATES[_0x0baf('0x1a')];_0x3ded64<_0x2adfd7;_0x3ded64+=0x1){_0x59431b[DUPLICATES[_0x3ded64]]=_0x549fd0[DUPLICATES[_0x3ded64]];}var _0x45294a=_[_0x0baf('0x2a')](_0x2ef0aa,_0x59431b);if(_0x45294a){return _0x47c4b(handleCheckRowError('duplicate',_0x0baf('0x2b'),_0x45294a,_0x48a0e9));}}return db['CmContact'][_0x0baf('0x2c')](_0x549fd0,{'raw':!![],'hooks':![],'fields':_[_0x0baf('0x2d')](_0x549fd0)})[_0x0baf('0x2e')](function(_0x3d65f2){if(DUPLICATES&&DUPLICATES['length']&&_0x2ef0aa){_0x2ef0aa[_0x0baf('0x2f')](_[_0x0baf('0x30')](_0x549fd0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3d65f2['id'];return _0x4be1b9();})['catch'](function(_0x23d890){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x31')+(_0x23d890[_0x0baf('0x1c')]||JSON[_0x0baf('0x32')](_0x23d890)),null,_0x48a0e9));});});}function checkHopper(){function _0x1b0991(){return function(_0xe03d82){logger[_0x0baf('0x15')]('cmContact',_0x0baf('0x33'),util[_0x0baf('0x34')](_0xe03d82,{'showHidden':![],'depth':null}));};}var _0x5b991f=function(_0x32c022,_0x57783c){var _0x5c545f=squel[_0x0baf('0x35')]()[_0x0baf('0x36')]('cm_hopper')['fromQuery']([_0x0baf('0x37'),_0x0baf('0x38'),_0x0baf('0x39'),_0x0baf('0x28'),_0x57783c,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),_0x0baf('0x37'))[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x38'))[_0x0baf('0x3d')]('id','ContactId')[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),'ListId')[_0x0baf('0x3d')](_0x32c022['id'][_0x0baf('0x3f')](),_0x57783c)[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3a'))[_0x0baf('0x3d')]('NOW()',_0x0baf('0x3b'))[_0x0baf('0x40')]('cm_contacts')[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')](_0x0baf('0x43'),LISTID['toString']())[_0x0baf('0x41')](_0x0baf('0x44'))[_0x0baf('0x41')](_0x0baf('0x45'),squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'))[_0x0baf('0x40')](_0x0baf('0x46'))[_0x0baf('0x41')](_0x57783c+'\x20=\x20?',_0x32c022['id'][_0x0baf('0x3f')]())))[_0x0baf('0x3f')]();return _0x5c545f;};var _0x1daf1d=function(_0x339aff,_0x22207a){var _0x55f4f8=squel[_0x0baf('0x35')]()[_0x0baf('0x36')](_0x0baf('0x46'))[_0x0baf('0x47')]([_0x0baf('0x37'),'scheduledAt',_0x0baf('0x39'),_0x0baf('0x28'),_0x22207a,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),'phone')[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x38'))['field']('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),_0x0baf('0x28'))[_0x0baf('0x3d')](_0x339aff['id'][_0x0baf('0x3f')](),_0x22207a)[_0x0baf('0x3d')]('NOW()',_0x0baf('0x3a'))[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')](_0x0baf('0x43'),LISTID[_0x0baf('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44'))[_0x0baf('0x41')](_0x0baf('0x45'),squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')]('calleridnum')[_0x0baf('0x40')](_0x0baf('0x4a'))[_0x0baf('0x41')](_0x22207a+_0x0baf('0x4b'),_0x339aff['id'][_0x0baf('0x3f')]()))[_0x0baf('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0baf('0x3c')]()['field'](_0x0baf('0x37'))['from'](_0x0baf('0x46'))['where'](_0x22207a+_0x0baf('0x4b'),_0x339aff['id']['toString']())))[_0x0baf('0x3f')]();return _0x55f4f8;};function _0xcf7b8d(_0x411c1f,_0x4520d1){var _0x42a68b=squel['insert']()[_0x0baf('0x36')](_0x0baf('0x46'))[_0x0baf('0x47')]([_0x0baf('0x37'),_0x0baf('0x38'),_0x0baf('0x39'),'ListId',_0x4520d1,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),_0x0baf('0x37'))[_0x0baf('0x3d')]('NOW()','scheduledAt')[_0x0baf('0x3d')]('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),_0x0baf('0x28'))[_0x0baf('0x3d')](_0x411c1f['id'][_0x0baf('0x3f')](),_0x4520d1)[_0x0baf('0x3d')](_0x0baf('0x3e'),'createdAt')[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))['where'](_0x0baf('0x43'),LISTID[_0x0baf('0x3f')]())[_0x0baf('0x41')](_0x0baf('0x4c'),squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44')))[_0x0baf('0x3f')]();return _0x42a68b;}function _0x498405(_0x178495,_0x5dc434){var _0x3c00e7=squel['insert']()['into'](_0x0baf('0x4d'))['fromQuery']([_0x0baf('0x37'),_0x0baf('0x39'),'ListId',_0x5dc434,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()['field']('phone',_0x0baf('0x37'))[_0x0baf('0x3d')]('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),'ListId')[_0x0baf('0x3d')](_0x178495['id']['toString'](),_0x5dc434)['field']('NOW()',_0x0baf('0x3a'))['field']('NOW()',_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')]('ListId\x20=\x20?',LISTID[_0x0baf('0x3f')]())[_0x0baf('0x41')](_0x0baf('0x4c'),squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44')))['toString']();return _0x3c00e7;}return db[_0x0baf('0x4e')][_0x0baf('0x4f')]({'where':{'type':_0x0baf('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x0baf('0x51')],'as':_0x0baf('0x52'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x2c20fe){var _0x125906=[];if(_0x2c20fe){var _0x27a959;for(var _0x4cc046=0x0,_0x5874cc;_0x4cc046<_0x2c20fe['length'];_0x4cc046+=0x1){_0x5874cc=_0x2c20fe[_0x4cc046]['get']({'plain':!![]});switch(_0x5874cc[_0x0baf('0x53')]){case _0x0baf('0x54'):_0x125906[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x1daf1d(_0x5874cc,_0x0baf('0x57')))['then'](function(){})['catch'](_0x1b0991()));break;case _0x0baf('0x58'):_0x125906['push'](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x5b991f(_0x5874cc,'VoiceQueueId'))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));break;default:_0x125906[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0xcf7b8d(_0x5874cc,_0x0baf('0x57')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}}return _0x125906;})[_0x0baf('0x5a')]()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0baf('0x5b'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x333b07){var _0x20a514=[];if(_0x333b07){var _0x5093f5;for(var _0x1be7f2=0x0,_0x410f6c;_0x1be7f2<_0x333b07['length'];_0x1be7f2+=0x1){_0x410f6c=_0x333b07[_0x1be7f2]['get']({'plain':!![]});_0x20a514[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x498405(_0x410f6c,_0x0baf('0x57')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}return _0x20a514;})[_0x0baf('0x5a')]();})[_0x0baf('0x2e')](function(){return db['Campaign'][_0x0baf('0x4f')]({'attributes':['id',_0x0baf('0x53')],'include':[{'model':db['CmList'],'as':_0x0baf('0x52'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x538f24){var _0x97d385=[];if(_0x538f24){for(var _0x4043d5=0x0,_0x421ca0;_0x4043d5<_0x538f24[_0x0baf('0x1a')];_0x4043d5+=0x1){_0x421ca0=_0x538f24[_0x4043d5][_0x0baf('0x5c')]({'plain':!![]});switch(_0x421ca0['dialCheckDuplicateType']){case'always':_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')]['query'](_0x1daf1d(_0x421ca0,_0x0baf('0x5d')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));break;case'onlyIfOpen':_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x5b991f(_0x421ca0,'CampaignId'))[_0x0baf('0x2e')](function(){})['catch'](_0x1b0991()));break;default:_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0xcf7b8d(_0x421ca0,_0x0baf('0x5d')))[_0x0baf('0x2e')](function(){})['catch'](_0x1b0991()));}}}return _0x97d385;})[_0x0baf('0x5a')]();})[_0x0baf('0x2e')](function(){return db['Campaign'][_0x0baf('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x0baf('0x51')],'as':_0x0baf('0x5b'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x1cbbcc){var _0x250df2=[];if(_0x1cbbcc){for(var _0xa4fd1b=0x0,_0x1cda78;_0xa4fd1b<_0x1cbbcc[_0x0baf('0x1a')];_0xa4fd1b+=0x1){_0x1cda78=_0x1cbbcc[_0xa4fd1b][_0x0baf('0x5c')]({'plain':!![]});_0x250df2[_0x0baf('0x2f')](db[_0x0baf('0x55')]['query'](_0x498405(_0x1cda78,'CampaignId'))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}return _0x250df2;})[_0x0baf('0x5a')]();})['catch'](function(_0x507783){logger[_0x0baf('0x15')](_0x0baf('0x5e'),_0x0baf('0x5f'),_0x507783[_0x0baf('0x1c')]);});}var processPromises=function(_0x2dcdfe){return BPromise[_0x0baf('0x5a')](promises)[_0x0baf('0x2e')](function(_0xa2d315){})[_0x0baf('0x59')](function(_0x4e8e85){logger[_0x0baf('0x15')](_0x0baf('0x60'),JSON[_0x0baf('0x32')](_0x4e8e85));})[_0x0baf('0x61')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2dcdfe){return _0x2dcdfe['resume']();}});};var endCsv=function(){return BPromise[_0x0baf('0x62')]()[_0x0baf('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x0baf('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0baf('0x64')](FILEPATH);}catch(_0x52e0c4){logger[_0x0baf('0x15')](_0x0baf('0x65'),JSON[_0x0baf('0x32')](_0x52e0c4));}finally{process[_0x0baf('0x66')](0x0);}});};process['on'](_0x0baf('0x67'),function(){logger[_0x0baf('0x68')](_0x0baf('0x69'));endCsv();});function main(){return BPromise[_0x0baf('0x62')]()[_0x0baf('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0baf('0x13')](',');return db[_0x0baf('0x6a')][_0x0baf('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1ed607){var _0xd0f63b=fs[_0x0baf('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0baf('0x6c')](_0xd0f63b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c37b4,_0x195303){total+=0x1;var _0x49d411=total;promises[_0x0baf('0x2f')](checkRow(_0x3c37b4,_0x1ed607,_0x49d411)[_0x0baf('0x2e')](function(){success+=0x1;})[_0x0baf('0x59')](function(_0x457ae8){if(_0x457ae8[_0x0baf('0x15')]){errors+=0x1;delete _0x457ae8['error'];}else if(_0x457ae8[_0x0baf('0x6d')]){duplicates+=0x1;delete _0x457ae8[_0x0baf('0x6d')];}rows[_0x0baf('0x2f')](_0x457ae8);}));if(total%0xc8===0x0){_0x195303[_0x0baf('0x6e')]();return processPromises(_0x195303);}},'complete':function(){return processPromises()[_0x0baf('0x2e')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xb5f4e5,_0x5a2454){logger[_0x0baf('0x68')]('CSV\x20parse\x20error',JSON[_0x0baf('0x32')](_0xb5f4e5));endCsv();}});})[_0x0baf('0x59')](function(_0x1ce7bb){logger[_0x0baf('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0baf('0x32')](_0x1ce7bb));});}main(); \ No newline at end of file +var _0xe706=['toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','insert','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()'];(function(_0x266ff3,_0xb6e146){var _0x2a8de3=function(_0x1e2a9d){while(--_0x1e2a9d){_0x266ff3['push'](_0x266ff3['shift']());}};_0x2a8de3(++_0xb6e146);}(_0xe706,0xa3));var _0x6e70=function(_0xf382e5,_0x4c8690){_0xf382e5=_0xf382e5-0x0;var _0x3272b6=_0xe706[_0xf382e5];return _0x3272b6;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var socket=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));require(_0x6e70('0xd'))[_0x6e70('0xe')](socket);try{if(!process[_0x6e70('0xf')][0x2]||process[_0x6e70('0xf')][0x2]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x2]===_0x6e70('0x11')){throw new Error(_0x6e70('0x12'));}var FILEPATH=process[_0x6e70('0xf')][0x2];if(!process[_0x6e70('0xf')][0x3]||process[_0x6e70('0xf')][0x3]===_0x6e70('0x10')||process['argv'][0x3]==='null'||!process[_0x6e70('0xf')][0x4]||process[_0x6e70('0xf')][0x4]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x4]===_0x6e70('0x11')){throw new Error(_0x6e70('0x13'));}var FIELDS=_[_0x6e70('0x14')](process[_0x6e70('0xf')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x6e70('0xf')][0x5]||process['argv'][0x5]==='undefined'||process[_0x6e70('0xf')][0x5]===_0x6e70('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6e70('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6e70('0xf')][0x6]!==_0x6e70('0x10')&&process['argv'][0x6]!=='null'?process[_0x6e70('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6e70('0xf')][0x7]!==_0x6e70('0x10')&&process['argv'][0x7]!=='null'?process[_0x6e70('0xf')][0x7]:null;if(!process[_0x6e70('0xf')][0x8]||process[_0x6e70('0xf')][0x8]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x8]===_0x6e70('0x11')){throw new Error(_0x6e70('0x15'));}var SOCKET_TIMESTAMP=process[_0x6e70('0xf')][0x8];}catch(_0x29326f){logger[_0x6e70('0x16')](_0x29326f);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x4a0cfe,_0x228350,_0x344b65,_0x27b294){var _0x502b2d={'message':_0x228350};_0x502b2d[_0x4a0cfe]=!![];if(_0x344b65){_0x502b2d[_0x6e70('0x17')]=_0x344b65;}if(_0x27b294){_0x502b2d[_0x6e70('0x18')]=_0x27b294;}return _0x502b2d;}function isEmail(_0x3337a6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3337a6);}function checkRow(_0x10fc91,_0x538b9c,_0x50aec2){return new BPromise(function(_0x4e97c7,_0x41e352){if(_[_0x6e70('0x19')](_0x10fc91)){return _0x41e352(handleCheckRowError('error',_0x6e70('0x1a'),null,_0x50aec2));}if(_0x10fc91[_0x6e70('0x1b')]&&_0x10fc91['errors'][_0x6e70('0x1c')]){var _0x67fb43=_[_0x6e70('0x1d')](_0x10fc91['errors'],'message')[_0x6e70('0x1e')](';');return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x67fb43,null,_0x50aec2));}var _0x83c836={};for(var _0x114344 in FIELDS){if(FIELDS[_0x6e70('0x1f')](_0x114344)&&FIELDS[_0x114344]){_0x83c836[_0x114344]=_0x10fc91['data'][0x0][FIELDS[_0x114344]]||_0x10fc91[_0x6e70('0x20')][0x0]['\ufeff'+FIELDS[_0x114344]];}}if(!_0x83c836[_0x6e70('0x21')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x22'),null,_0x50aec2));}if(!_0x83c836[_0x6e70('0x23')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x24'),null,_0x50aec2));}if(_0x83c836[_0x6e70('0x25')]){var _0x3a0821=moment(_0x83c836[_0x6e70('0x25')],'YYYY-MM-DD');if(!_0x3a0821[_0x6e70('0x26')]()){return _0x41e352(handleCheckRowError('error',_0x6e70('0x27'),null,_0x50aec2));}}if(_0x83c836['email']){if(!isEmail(_0x83c836[_0x6e70('0x28')])){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x29'),null,_0x50aec2));}}_0x83c836['ListId']=LISTID;_0x83c836[_0x6e70('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){var _0x5780a1={};for(var _0x13d673=0x0,_0x154925=DUPLICATES['length'];_0x13d673<_0x154925;_0x13d673+=0x1){_0x5780a1[DUPLICATES[_0x13d673]]=_0x83c836[DUPLICATES[_0x13d673]];}var _0x10d8f6=_[_0x6e70('0x2b')](_0x538b9c,_0x5780a1);if(_0x10d8f6){return _0x41e352(handleCheckRowError(_0x6e70('0x2c'),_0x6e70('0x2d'),_0x10d8f6,_0x50aec2));}}return db[_0x6e70('0x2e')][_0x6e70('0x2f')](_0x83c836,{'raw':!![],'hooks':![],'fields':_[_0x6e70('0x30')](_0x83c836)})[_0x6e70('0x31')](function(_0xf146fd){if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){_0x538b9c['push'](_[_0x6e70('0x32')](_0x83c836,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf146fd['id'];return _0x4e97c7();})['catch'](function(_0x23cd1a){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x33')+(_0x23cd1a[_0x6e70('0x34')]||JSON[_0x6e70('0x35')](_0x23cd1a)),null,_0x50aec2));});});}function checkHopper(){function _0x989b80(){return function(_0x2440be){logger[_0x6e70('0x16')](_0x6e70('0x36'),_0x6e70('0x37'),util[_0x6e70('0x38')](_0x2440be,{'showHidden':![],'depth':null}));};}var _0x23d5e2=function(_0x5594d3,_0x501b53){var _0x5446a2=squel['insert']()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),'ListId',_0x501b53,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x5594d3['id'][_0x6e70('0x43')](),_0x501b53)['field']('NOW()','createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6e70('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x501b53+'\x20=\x20?',_0x5594d3['id'][_0x6e70('0x43')]())))[_0x6e70('0x43')]();return _0x5446a2;};var _0x2dafb5=function(_0x3478e2,_0x5bbc3a){var _0x291de6=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),'ContactId',_0x6e70('0x44'),_0x5bbc3a,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))['field'](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))['field'](LISTID['toString'](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x3478e2['id'][_0x6e70('0x43')](),_0x5bbc3a)['field']('NOW()',_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b'))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()['field'](_0x6e70('0x4d'))[_0x6e70('0x45')](_0x6e70('0x4e'))[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']()))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']())))[_0x6e70('0x43')]();return _0x291de6;};function _0xebe5f7(_0x54efdf,_0x3cfaa9){var _0xb3f06c=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))['fromQuery']([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),_0x6e70('0x44'),_0x3cfaa9,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3c'))[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x54efdf['id'][_0x6e70('0x43')](),_0x3cfaa9)['field'](_0x6e70('0x42'),_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')]('cm_contacts')[_0x6e70('0x48')](_0x6e70('0x47'))['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0xb3f06c;}function _0x41a861(_0x10d299,_0x739946){var _0x30cd88=squel['insert']()['into'](_0x6e70('0x50'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3d'),'ListId',_0x739946,'createdAt',_0x6e70('0x3f')],squel[_0x6e70('0x40')]()['field']('phone',_0x6e70('0x23'))['field']('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x10d299['id'][_0x6e70('0x43')](),_0x739946)[_0x6e70('0x41')](_0x6e70('0x42'),'createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0x30cd88;}return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x55'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x82a9a){var _0x515c0c=[];if(_0x82a9a){var _0xce964b;for(var _0x531097=0x0,_0x5b4046;_0x531097<_0x82a9a[_0x6e70('0x1c')];_0x531097+=0x1){_0x5b4046=_0x82a9a[_0x531097][_0x6e70('0x56')]({'plain':!![]});switch(_0x5b4046[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')]['query'](_0x2dafb5(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;default:_0x515c0c['push'](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x5b4046,_0x6e70('0x5b')))['then'](function(){})['catch'](_0x989b80()));}}}return _0x515c0c;})[_0x6e70('0x5f')]()[_0x6e70('0x31')](function(){return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x241a21){var _0x56d4d9=[];if(_0x241a21){var _0x58666a;for(var _0x1c7c5f=0x0,_0xf7a034;_0x1c7c5f<_0x241a21[_0x6e70('0x1c')];_0x1c7c5f+=0x1){_0xf7a034=_0x241a21[_0x1c7c5f][_0x6e70('0x56')]({'plain':!![]});_0x56d4d9[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x41a861(_0xf7a034,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}return _0x56d4d9;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x4b2d40){var _0x5b5471=[];if(_0x4b2d40){for(var _0x402f6f=0x0,_0x48e04b;_0x402f6f<_0x4b2d40['length'];_0x402f6f+=0x1){_0x48e04b=_0x4b2d40[_0x402f6f][_0x6e70('0x56')]({'plain':!![]});switch(_0x48e04b[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x5b5471['push'](db['sequelize']['query'](_0x2dafb5(_0x48e04b,_0x6e70('0x61')))['then'](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x48e04b,_0x6e70('0x61')))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));break;default:_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x48e04b,'CampaignId'))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}}return _0x5b5471;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')][_0x6e70('0x52')]({'attributes':['id'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x62'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x48f6fd){var _0x463eed=[];if(_0x48f6fd){for(var _0x39e6db=0x0,_0x53acc8;_0x39e6db<_0x48f6fd[_0x6e70('0x1c')];_0x39e6db+=0x1){_0x53acc8=_0x48f6fd[_0x39e6db][_0x6e70('0x56')]({'plain':!![]});_0x463eed['push'](db['sequelize'][_0x6e70('0x5e')](_0x41a861(_0x53acc8,'CampaignId'))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));}}return _0x463eed;})[_0x6e70('0x5f')]();})[_0x6e70('0x5c')](function(_0x106f32){logger[_0x6e70('0x16')](_0x6e70('0x63'),_0x6e70('0x64'),_0x106f32[_0x6e70('0x34')]);});}var processPromises=function(_0x5afbf5){return BPromise['all'](promises)[_0x6e70('0x31')](function(_0x4bf451){})[_0x6e70('0x5c')](function(_0xa2a4d5){logger[_0x6e70('0x16')](_0x6e70('0x65'),JSON['stringify'](_0xa2a4d5));})[_0x6e70('0x66')](function(){socket['emit'](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5afbf5){return _0x5afbf5[_0x6e70('0x68')]();}});};var endCsv=function(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x6e70('0x31')](function(){socket[_0x6e70('0x6a')](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d6acf){logger['error'](_0x6e70('0x6b'),JSON['stringify'](_0x1d6acf));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x6e70('0x6c')](_0x6e70('0x6d'));endCsv();});function main(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e70('0x6e')](',');return db['CmContact'][_0x6e70('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6e70('0x31')](function(_0x48c30c){var _0x3c2d33=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6e70('0x6f')](_0x3c2d33,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d0585,_0x4a87e2){total+=0x1;var _0x25f60c=total;promises[_0x6e70('0x59')](checkRow(_0x5d0585,_0x48c30c,_0x25f60c)[_0x6e70('0x31')](function(){success+=0x1;})[_0x6e70('0x5c')](function(_0x3e6661){if(_0x3e6661[_0x6e70('0x16')]){errors+=0x1;delete _0x3e6661[_0x6e70('0x16')];}else if(_0x3e6661['duplicate']){duplicates+=0x1;delete _0x3e6661[_0x6e70('0x2c')];}rows['push'](_0x3e6661);}));if(total%0xc8===0x0){_0x4a87e2[_0x6e70('0x70')]();return processPromises(_0x4a87e2);}},'complete':function(){return processPromises()[_0x6e70('0x31')](function(){logger[_0x6e70('0x6c')](_0x6e70('0x71'));endCsv();});},'error':function(_0x4764d5,_0x41b7de){logger[_0x6e70('0x6c')]('CSV\x20parse\x20error',JSON[_0x6e70('0x35')](_0x4764d5));endCsv();}});})['catch'](function(_0x27bdf2){logger[_0x6e70('0x16')](_0x6e70('0x72'),JSON[_0x6e70('0x35')](_0x27bdf2));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index ca449fd..5688e53 100644 --- a/server/components/import/cm/csv2.js +++ b/server/components/import/cm/csv2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeabb=['includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','rows','contact:import:','Abort\x20parser','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','scheduledat',',\x20scheduledAt\x20=\x20NOW()','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','campaigns','CampaignId','each','then','finish','affectedRows','emit','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','parse','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','moment','squel','ioredis','../../../mysqldb','redis','defaults','socket.io-emitter','format','test','select','phone','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','ContactId','ListId','createdAt','priority','UserId','fields','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper','toString','cm_hopper_black','fromQuery','updatedAt','from','cm_contacts','cm_contacts.ListId\x20=\x20','field','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','message','exit','push','catch','error','main','stringify','start','binding','server/files/tmp','.csv','writeFileSync','data','length','errors','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xeabb,0x12a));var _0xbeab=function(_0x21bad5,_0x23a39d){_0x21bad5=_0x21bad5-0x0;var _0x235106=_0xeabb[_0x21bad5];return _0x235106;};'use strict';var fs=require('fs');var path=require(_0xbeab('0x0'));var _=require(_0xbeab('0x1'));var Papa=require('papaparse');var util=require(_0xbeab('0x2'));var BPromise=require('bluebird');var moment=require(_0xbeab('0x3'));var squel=require(_0xbeab('0x4'));var Redis=require(_0xbeab('0x5'));var db=require(_0xbeab('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0xbeab('0x7')]=_[_0xbeab('0x8')](config[_0xbeab('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xbeab('0x9'))(new Redis(config[_0xbeab('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xbeab('0xa')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x6c2780){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xbeab('0xb')](_0x6c2780);}function selectNotIn(_0x1a415d,_0x1c8fa4,_0x4701e2,_0x3d33e9,_0x53a653){return squel[_0xbeab('0xc')]()['field'](_0xbeab('0xd'))['from'](_0x3d33e9)[_0xbeab('0xe')](_0x1c8fa4,null,_0x1c8fa4+_0xbeab('0xf')+_0x3d33e9+'.'+_0x4701e2)['where'](_0x3d33e9+'.'+_0x4701e2+_0xbeab('0x10')+_0x1a415d+'.'+_0x4701e2)[_0xbeab('0x11')](_0x1c8fa4+_0xbeab('0x12')+_0x53a653[_0xbeab('0xe')]()+')');}function insertCmHopper(_0x31bc8a,_0x57020d,_0x14f34f,_0x4ca033,_0x2a455f){var _0x37bc07=[_0xbeab('0x13'),_0xbeab('0x14'),_0xbeab('0x15'),_0xbeab('0x16'),_0x57020d+'.'+_0x4ca033,_0xbeab('0x17'),_0xbeab('0x18'),_0xbeab('0x19'),_0xbeab('0x1a'),'\x22'+_0x2a455f+'\x22'];return squel[_0xbeab('0x1b')]()[_0xbeab('0x1c')]('cm_hopper')['fromQuery']([_0xbeab('0xd'),'scheduledat',_0xbeab('0x1d'),_0xbeab('0x1e'),_0x4ca033,_0xbeab('0x1f'),'updatedAt',_0xbeab('0x20'),_0xbeab('0x21'),'recallme'],squel[_0xbeab('0xc')]()[_0xbeab('0x22')](_0x37bc07)['from'](_0x57020d)[_0xbeab('0xe')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x57020d+_0xbeab('0x23'))[_0xbeab('0xe')](_0x14f34f,null,_0x14f34f+'.id\x20=\x20'+_0x57020d+'.'+_0x4ca033)[_0xbeab('0x11')](_0x57020d+_0xbeab('0x24'),_0x31bc8a)[_0xbeab('0x11')](_0xbeab('0x25'),NOW)['where'](_0xbeab('0x26'),selectNotIn(_0x57020d,_0x14f34f,_0x4ca033,'cm_hopper',[_0xbeab('0x27'),_0xbeab('0x28')]))[_0xbeab('0x11')](_0xbeab('0x26'),selectNotIn(_0x57020d,_0x14f34f,_0x4ca033,_0xbeab('0x29'),['\x22always\x22'])))[_0xbeab('0x2a')]();}function insertCmHopperBlack(_0x1315d4,_0x4a12c2,_0x880a85,_0xc5c29){var _0x55fa8b=[_0xbeab('0x13'),_0xbeab('0x15'),'cm_contacts.ListId',_0x4a12c2+'.'+_0xc5c29,_0xbeab('0x17'),_0xbeab('0x18')];return squel['insert']()[_0xbeab('0x1c')](_0xbeab('0x2b'))[_0xbeab('0x2c')]([_0xbeab('0xd'),'ContactId',_0xbeab('0x1e'),_0xc5c29,_0xbeab('0x1f'),_0xbeab('0x2d')],squel[_0xbeab('0xc')]()[_0xbeab('0x22')](_0x55fa8b)[_0xbeab('0x2e')](_0x4a12c2)[_0xbeab('0xe')](_0xbeab('0x2f'),null,_0xbeab('0x30')+_0x4a12c2+_0xbeab('0x23'))['join'](_0x880a85,null,_0x880a85+'.id\x20=\x20'+_0x4a12c2+'.'+_0xc5c29)['where'](_0x4a12c2+_0xbeab('0x24'),_0x1315d4)[_0xbeab('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xbeab('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xbeab('0x31')]('phone')[_0xbeab('0x2e')](_0xbeab('0x2b'))[_0xbeab('0x11')](_0xbeab('0x32'),_0x1315d4)['where'](_0xc5c29+_0xbeab('0x33'),_0x4a12c2+'.'+_0xc5c29)))['toString']();}function insertCmContact(_0x253e75,_0x3e1cd3,_0x5fc62a,_0x34f196){var _0x500658=_[_0xbeab('0x34')](_[_0xbeab('0x35')](_0x34f196),[_0xbeab('0x1e'),_0xbeab('0x36'),_0xbeab('0x1f'),'updatedAt']);return squel[_0xbeab('0x1b')]()[_0xbeab('0x1c')](_0xbeab('0x2f'))['fromQuery'](_0x500658,squel['select']()[_0xbeab('0x22')](_0x500658)[_0xbeab('0x2e')](_0x3e1cd3)['where']('('+_0x5fc62a[_0xbeab('0xe')](',')+_0xbeab('0x37'),squel[_0xbeab('0xc')]()[_0xbeab('0x22')](_0x5fc62a)[_0xbeab('0x2e')](_0xbeab('0x2f'))[_0xbeab('0x11')](_0xbeab('0x32'),_0x253e75))['where'](_0xbeab('0x38'),squel['select']()[_0xbeab('0x31')](_0xbeab('0x39'),_0xbeab('0x3a'))['from'](_0x3e1cd3)['group'](_0x5fc62a['join'](','))))[_0xbeab('0x2a')]();}function handleStop(){logger[_0xbeab('0x3b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x14be0e){logger['error'](_0x14be0e[_0xbeab('0x3c')]);process[_0xbeab('0x3d')](0x1);}function handleError(_0x464248,_0x58fde9){stats['errors'][_0xbeab('0x3e')]({'name':_0x58fde9['code'],'message':_0x58fde9[_0xbeab('0x3c')],'row':_0x464248});}function handleQuery(_0x54f743){logger[_0xbeab('0x3b')](_0x54f743);return db['sequelize']['query'](_0x54f743)['spread'](function(_0x22f50d){results[_0xbeab('0x3e')](_0x22f50d);})[_0xbeab('0x3f')](function(_0x5dc8ab){logger[_0xbeab('0x40')](_0x5dc8ab[_0xbeab('0x3c')]);});}function main(_0x477e3e,_0x2ea616,_0x2ce28b,_0x27364b){logger['info'](_0xbeab('0x41'),_0x477e3e,JSON[_0xbeab('0x42')](_0x2ea616));process['send'](_0xbeab('0x43'));var _0x28424e=_0x2ea616[_0xbeab('0x44')];var _0x1f8537=_0x2ea616['socket_timestamp'];var _0x265184=path[_0xbeab('0xe')](config['root'],_0xbeab('0x45'),_0x1f8537+_0xbeab('0x46'));var _0x430552=_[_0xbeab('0x35')](_0x28424e)[_0xbeab('0xe')]();logger[_0xbeab('0x3b')]('header',_0x430552);fs[_0xbeab('0x47')](_0x265184,_0x430552+'\x0a');Papa['parse'](fs['createReadStream'](_0x477e3e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x194d04,_0x147737){try{for(var _0x44efa6=0x0,_0x41dd13=[];_0x44efa6<_0x194d04[_0xbeab('0x48')][_0xbeab('0x49')];_0x44efa6++){stats['rows']+=0x1;if(_0x194d04[_0xbeab('0x4a')][_0x44efa6]){handleError(_0x194d04[_0xbeab('0x48')][_0x44efa6],_0x194d04[_0xbeab('0x4a')][_0x44efa6]);}else{var _0x10794a=[];for(var _0x5f1312 in _0x28424e){if(_0x28424e[_0xbeab('0x4b')](_0x5f1312)){if(_0x194d04[_0xbeab('0x48')][_0x44efa6][_0x28424e[_0x5f1312]]){var _0x5bc92c=_[_0xbeab('0x4c')](_0x194d04[_0xbeab('0x48')][_0x44efa6][_0x28424e[_0x5f1312]]['replace'](/"/g,'\x27'));switch(_0x5f1312){case'scheduledat':var _0x37a10d=moment(_0x5bc92c,_0xbeab('0x4d'),!![]);if(_0x37a10d['isValid']()){_0x41dd13[_0xbeab('0x3e')]('\x22'+_0x5bc92c+'\x22');}else{_0x10794a[_0xbeab('0x3e')](_0xbeab('0x4e'));}break;case _0xbeab('0x20'):var _0x42a897=parseInt(_0x5bc92c);_0x5bc92c=_[_0xbeab('0x4f')](_0x42a897)||_0x42a897<0x0||_0x42a897>0x4?_0x27364b?0x3:0x2:_0x42a897;_0x41dd13[_0xbeab('0x3e')]('\x22'+_0x5bc92c+'\x22');break;case _0xbeab('0x21'):var _0xc9a9b0=parseInt(_0x5bc92c);if(_['isNumber'](_0xc9a9b0)&&_[_0xbeab('0x50')](_0x2ce28b,_0xc9a9b0)){_0x41dd13['push']('\x22'+_0xc9a9b0+'\x22');}else{_0x10794a[_0xbeab('0x3e')](_0xbeab('0x51'));}break;case _0xbeab('0x52'):if(isEmail(_0x5bc92c)){_0x41dd13[_0xbeab('0x3e')]('\x22'+_0x5bc92c+'\x22');}else{_0x10794a['push'](_0xbeab('0x53'));}break;case _0xbeab('0x54'):var _0x49d9c1=moment(_0x5bc92c,'YYYY-MM-DD',!![]);if(_0x49d9c1[_0xbeab('0x55')]()){_0x41dd13[_0xbeab('0x3e')]('\x22'+_0x5bc92c+'\x22');}else{_0x10794a[_0xbeab('0x3e')](_0xbeab('0x56'));}break;default:_0x41dd13[_0xbeab('0x3e')]('\x22'+_0x5bc92c+'\x22');}}else{switch(_0x5f1312){case _0xbeab('0x57'):case _0xbeab('0xd'):_0x10794a[_0xbeab('0x3e')](_0x5f1312+_0xbeab('0x58'));break;default:_0x41dd13[_0xbeab('0x3e')]('\x22\x22');}}}}if(_0x10794a[_0xbeab('0x49')]){handleError(_0x194d04[_0xbeab('0x48')][_0x44efa6],{'code':_0xbeab('0x59'),'message':_0x10794a[_0xbeab('0xe')]()});}else{fs['appendFileSync'](_0x265184,_0x41dd13[_0xbeab('0xe')]()+'\x0a');}_0x41dd13=[];}if(!(stats[_0xbeab('0x5a')]%0xc8)){socket['emit'](_0xbeab('0x5b')+_0x1f8537,stats);stats[_0xbeab('0x4a')]=[];}}if(stopped){logger[_0xbeab('0x3b')](_0xbeab('0x5c'));_0x147737['abort']();}}catch(_0x11b316){handleError(_0x194d04['data'][_0x44efa6],{'code':_0xbeab('0x5d'),'message':_0x11b316['message']});logger[_0xbeab('0x40')]('step',_0x11b316[_0xbeab('0x3c')]);}},'complete':function(){try{var _0x4791c0=[];var _0x296678=_0xbeab('0x2f');if(_0x2ea616['duplicates']&&_0x2ea616[_0xbeab('0x5e')][_0xbeab('0x49')]){_0x296678=_0xbeab('0x5f')+_0x1f8537;_0x4791c0[_0xbeab('0x3e')](_0xbeab('0x60')+_0x296678+_0xbeab('0x61'));}var _0x537c07=util[_0xbeab('0xa')](_0xbeab('0x62'),_0x265184,_0x296678,_0x430552,_0x2ea616['ListId'],_0x2ea616[_0xbeab('0x36')]||null,NOW,NOW);if(_[_0xbeab('0x63')](_0x28424e[_0xbeab('0x64')])){_0x537c07+=_0xbeab('0x65');}_0x4791c0[_0xbeab('0x3e')](_0x537c07);if(_0x2ea616[_0xbeab('0x5e')]&&_0x2ea616[_0xbeab('0x5e')][_0xbeab('0x49')]){_0x4791c0[_0xbeab('0x3e')](insertCmContact(_0x2ea616['ListId'],_0x296678,_0x2ea616['duplicates'],_0x28424e));_0x4791c0['push']('DROP\x20TABLE\x20'+_0x296678+';');}_0x4791c0[_0xbeab('0x3e')](insertCmHopper(_0x2ea616[_0xbeab('0x1e')],'voice_queues_has_cm_lists',_0xbeab('0x66'),'VoiceQueueId',_0x27364b));_0x4791c0[_0xbeab('0x3e')](insertCmHopperBlack(_0x2ea616[_0xbeab('0x1e')],_0xbeab('0x67'),_0xbeab('0x66'),_0xbeab('0x68')));_0x4791c0['push'](insertCmHopper(_0x2ea616[_0xbeab('0x1e')],_0xbeab('0x69'),'campaigns','CampaignId',_0x27364b));_0x4791c0[_0xbeab('0x3e')](insertCmHopperBlack(_0x2ea616['ListId'],_0xbeab('0x6a'),_0xbeab('0x6b'),_0xbeab('0x6c')));BPromise[_0xbeab('0x6d')](_0x4791c0,handleQuery)[_0xbeab('0x6e')](function(_0x23a493){stats[_0xbeab('0x6f')]=!![];stats[_0xbeab('0x70')]=_0x2ea616[_0xbeab('0x5e')]&&_0x2ea616[_0xbeab('0x5e')][_0xbeab('0x49')]?results[0x2][_0xbeab('0x70')]:results[0x0][_0xbeab('0x70')];socket[_0xbeab('0x71')](_0xbeab('0x5b')+_0x1f8537,stats);fs[_0xbeab('0x72')](_0x477e3e);fs[_0xbeab('0x72')](_0x265184);process[_0xbeab('0x3d')](0x0);})['catch'](function(_0x57d105){logger[_0xbeab('0x40')](_0x57d105[_0xbeab('0x3c')]);process[_0xbeab('0x3d')](0x1);});}catch(_0x7169c1){logger[_0xbeab('0x40')](_0xbeab('0x73'),_0x7169c1['message']);process[_0xbeab('0x3d')](0x1);}},'error':function(_0x57bf25,_0x367ddb,_0x27e6be,_0xc32e8d){throw new Error(_0xc32e8d);}});}function validate(){if(process[_0xbeab('0x74')]&&process[_0xbeab('0x74')][_0xbeab('0x49')]<0x4){throw new Error(_0xbeab('0x75'));}var _0x5e2bb7=path[_0xbeab('0xe')](config[_0xbeab('0x76')],_0xbeab('0x45'),process[_0xbeab('0x74')][0x2]);if(!fs[_0xbeab('0x77')](_0x5e2bb7)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2f19e3={};try{_0x2f19e3=JSON[_0xbeab('0x78')](process[_0xbeab('0x74')][0x3]);if(!_0x2f19e3[_0xbeab('0x44')]){throw new Error(_0xbeab('0x79'));}if(!_0x2f19e3[_0xbeab('0x44')][_0xbeab('0xd')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x2f19e3['binding']['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x3f4377=0x0;if(_0x2f19e3['binding'][_0xbeab('0x21')]){_0x3f4377=0x1;}if(!_0x2f19e3[_0xbeab('0x1e')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x35f4d2){throw new Error(_0xbeab('0x7a'));}var _0x345fc7=[];try{_0x345fc7=_['map'](JSON[_0xbeab('0x78')](process['argv'][0x4]),'id');}catch(_0x570518){logger[_0xbeab('0x3b')](_0xbeab('0x7b'));}main(_0x5e2bb7,_0x2f19e3,_0x345fc7,_0x3f4377);}validate();process['on'](_0xbeab('0x7c'),handleStop);process['on'](_0xbeab('0x7d'),handleUncaughtException); \ No newline at end of file +var _0xb239=['insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.ListId','cm_hopper_black','phone','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','CompanyId','id\x20IN\x20?','min_id','group','Received\x20SIGINT','error','exit','errors','push','code','info','sequelize','query','spread','catch','stringify','send','start','binding','socket_timestamp','root','.csv','header','writeFileSync','createReadStream','data','length','trim','replace','isValid','isNaN','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','step','message','duplicates','CREATE\x20TABLE\x20','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId'];(function(_0x3fe06a,_0x5820bd){var _0x22690f=function(_0x422d7b){while(--_0x422d7b){_0x3fe06a['push'](_0x3fe06a['shift']());}};_0x22690f(++_0x5820bd);}(_0xb239,0x175));var _0x9b23=function(_0x3bc6dd,_0x1a2105){_0x3bc6dd=_0x3bc6dd-0x0;var _0x3c6b22=_0xb239[_0x3bc6dd];return _0x3c6b22;};'use strict';var fs=require('fs');var path=require(_0x9b23('0x0'));var _=require(_0x9b23('0x1'));var Papa=require(_0x9b23('0x2'));var util=require(_0x9b23('0x3'));var BPromise=require(_0x9b23('0x4'));var moment=require(_0x9b23('0x5'));var squel=require(_0x9b23('0x6'));var Redis=require('ioredis');var db=require(_0x9b23('0x7'))['db'];var config=require(_0x9b23('0x8'));var logger=require(_0x9b23('0x9'))(_0x9b23('0xa'));config[_0x9b23('0xb')]=_[_0x9b23('0xc')](config[_0x9b23('0xb')],{'host':_0x9b23('0xd'),'port':0x18eb});var socket=require(_0x9b23('0xe'))(new Redis(config[_0x9b23('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9b23('0xf')](_0x9b23('0x10'));function isEmail(_0x5b7ae9){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x5b7ae9);}function selectNotIn(_0x458037,_0x13737f,_0x563dfc,_0xc9d655,_0x590d04){return squel['select']()['field']('phone')['from'](_0xc9d655)[_0x9b23('0x11')](_0x13737f,null,_0x13737f+_0x9b23('0x12')+_0xc9d655+'.'+_0x563dfc)[_0x9b23('0x13')](_0xc9d655+'.'+_0x563dfc+'\x20=\x20'+_0x458037+'.'+_0x563dfc)[_0x9b23('0x13')](_0x13737f+_0x9b23('0x14')+_0x590d04[_0x9b23('0x11')]()+')');}function insertCmHopper(_0x209338,_0x54e00d,_0x415742,_0x252ca1,_0xb445b){var _0x401f31=['cm_contacts.phone',_0x9b23('0x15'),'cm_contacts.id','cm_contacts.ListId',_0x54e00d+'.'+_0x252ca1,_0x9b23('0x16'),_0x9b23('0x17'),_0x9b23('0x18'),_0x9b23('0x19'),'\x22'+_0xb445b+'\x22'];return squel[_0x9b23('0x1a')]()[_0x9b23('0x1b')]('cm_hopper')[_0x9b23('0x1c')](['phone',_0x9b23('0x1d'),_0x9b23('0x1e'),_0x9b23('0x1f'),_0x252ca1,_0x9b23('0x20'),_0x9b23('0x21'),_0x9b23('0x22'),_0x9b23('0x23'),_0x9b23('0x24')],squel[_0x9b23('0x25')]()[_0x9b23('0x26')](_0x401f31)[_0x9b23('0x27')](_0x54e00d)[_0x9b23('0x11')](_0x9b23('0x28'),null,_0x9b23('0x29')+_0x54e00d+_0x9b23('0x2a'))[_0x9b23('0x11')](_0x415742,null,_0x415742+_0x9b23('0x12')+_0x54e00d+'.'+_0x252ca1)['where'](_0x54e00d+'.CmListId\x20=\x20?',_0x209338)[_0x9b23('0x13')](_0x9b23('0x2b'),NOW)[_0x9b23('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x54e00d,_0x415742,_0x252ca1,_0x9b23('0x2c'),[_0x9b23('0x2d'),'\x22onlyIfOpen\x22']))[_0x9b23('0x13')](_0x9b23('0x2e'),selectNotIn(_0x54e00d,_0x415742,_0x252ca1,'cm_hopper',[_0x9b23('0x2d')])))['toString']();}function insertCmHopperBlack(_0x7f541f,_0x42b631,_0x478ffa,_0x53b623){var _0x2974b4=['cm_contacts.phone','cm_contacts.id',_0x9b23('0x2f'),_0x42b631+'.'+_0x53b623,_0x9b23('0x16'),_0x9b23('0x17')];return squel[_0x9b23('0x1a')]()['into'](_0x9b23('0x30'))[_0x9b23('0x1c')]([_0x9b23('0x31'),_0x9b23('0x1e'),'ListId',_0x53b623,_0x9b23('0x20'),_0x9b23('0x21')],squel[_0x9b23('0x25')]()[_0x9b23('0x26')](_0x2974b4)[_0x9b23('0x27')](_0x42b631)['join']('cm_contacts',null,_0x9b23('0x29')+_0x42b631+'.CmListId')[_0x9b23('0x11')](_0x478ffa,null,_0x478ffa+_0x9b23('0x12')+_0x42b631+'.'+_0x53b623)[_0x9b23('0x13')](_0x42b631+_0x9b23('0x32'),_0x7f541f)[_0x9b23('0x13')](_0x9b23('0x2b'),NOW)[_0x9b23('0x13')](_0x9b23('0x2e'),squel[_0x9b23('0x25')]()['field']('phone')[_0x9b23('0x27')](_0x9b23('0x30'))['where'](_0x9b23('0x33'),_0x7f541f)[_0x9b23('0x13')](_0x53b623+_0x9b23('0x34'),_0x42b631+'.'+_0x53b623)))[_0x9b23('0x35')]();}function insertCmContact(_0xc91aa7,_0x18885a,_0x191e99,_0x5daf01){var _0x2c49d5=_[_0x9b23('0x36')](_[_0x9b23('0x37')](_0x5daf01),['ListId',_0x9b23('0x38'),'createdAt','updatedAt']);return squel['insert']()[_0x9b23('0x1b')](_0x9b23('0x28'))[_0x9b23('0x1c')](_0x2c49d5,squel[_0x9b23('0x25')]()['fields'](_0x2c49d5)[_0x9b23('0x27')](_0x18885a)[_0x9b23('0x13')]('('+_0x191e99[_0x9b23('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x9b23('0x25')]()[_0x9b23('0x26')](_0x191e99)[_0x9b23('0x27')](_0x9b23('0x28'))[_0x9b23('0x13')](_0x9b23('0x33'),_0xc91aa7))['where'](_0x9b23('0x39'),squel[_0x9b23('0x25')]()['field']('MIN(id)',_0x9b23('0x3a'))[_0x9b23('0x27')](_0x18885a)[_0x9b23('0x3b')](_0x191e99[_0x9b23('0x11')](','))))['toString']();}function handleStop(){logger['info'](_0x9b23('0x3c'));stopped=!![];}function handleUncaughtException(_0x48c868){logger[_0x9b23('0x3d')](_0x48c868['message']);process[_0x9b23('0x3e')](0x1);}function handleError(_0x45853d,_0x712b49){stats[_0x9b23('0x3f')][_0x9b23('0x40')]({'name':_0x712b49[_0x9b23('0x41')],'message':_0x712b49['message'],'row':_0x45853d});}function handleQuery(_0x4a4f0e){logger[_0x9b23('0x42')](_0x4a4f0e);return db[_0x9b23('0x43')][_0x9b23('0x44')](_0x4a4f0e)[_0x9b23('0x45')](function(_0x22d8d1){results[_0x9b23('0x40')](_0x22d8d1);})[_0x9b23('0x46')](function(_0x4bf5e7){logger['error'](_0x4bf5e7['message']);});}function main(_0x4b3c07,_0x643b09,_0x4820c2,_0x1a90be){logger[_0x9b23('0x42')]('main',_0x4b3c07,JSON[_0x9b23('0x47')](_0x643b09));process[_0x9b23('0x48')](_0x9b23('0x49'));var _0x550e2b=_0x643b09[_0x9b23('0x4a')];var _0x416e94=_0x643b09[_0x9b23('0x4b')];var _0x4e5462=path[_0x9b23('0x11')](config[_0x9b23('0x4c')],'server/files/tmp',_0x416e94+_0x9b23('0x4d'));var _0x4c8f30=_['keys'](_0x550e2b)[_0x9b23('0x11')]();logger['info'](_0x9b23('0x4e'),_0x4c8f30);fs[_0x9b23('0x4f')](_0x4e5462,_0x4c8f30+'\x0a');Papa['parse'](fs[_0x9b23('0x50')](_0x4b3c07),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4b625c,_0x368f4a){try{for(var _0x585c54=0x0,_0x5dd878=[];_0x585c54<_0x4b625c[_0x9b23('0x51')][_0x9b23('0x52')];_0x585c54++){stats['rows']+=0x1;if(_0x4b625c[_0x9b23('0x3f')][_0x585c54]){handleError(_0x4b625c[_0x9b23('0x51')][_0x585c54],_0x4b625c[_0x9b23('0x3f')][_0x585c54]);}else{var _0x336b8e=[];for(var _0x549340 in _0x550e2b){if(_0x550e2b['hasOwnProperty'](_0x549340)){if(_0x4b625c[_0x9b23('0x51')][_0x585c54][_0x550e2b[_0x549340]]){var _0x3b8f61=_[_0x9b23('0x53')](_0x4b625c[_0x9b23('0x51')][_0x585c54][_0x550e2b[_0x549340]][_0x9b23('0x54')](/"/g,'\x27'));switch(_0x549340){case _0x9b23('0x1d'):var _0x56091f=moment(_0x3b8f61,_0x9b23('0x10'),!![]);if(_0x56091f[_0x9b23('0x55')]()){_0x5dd878[_0x9b23('0x40')]('\x22'+_0x3b8f61+'\x22');}else{_0x336b8e['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x227e95=parseInt(_0x3b8f61);_0x3b8f61=_[_0x9b23('0x56')](_0x227e95)||_0x227e95<0x0||_0x227e95>0x4?_0x1a90be?0x3:0x2:_0x227e95;_0x5dd878[_0x9b23('0x40')]('\x22'+_0x3b8f61+'\x22');break;case _0x9b23('0x23'):var _0x32755a=parseInt(_0x3b8f61);if(_['isNumber'](_0x32755a)&&_[_0x9b23('0x57')](_0x4820c2,_0x32755a)){_0x5dd878[_0x9b23('0x40')]('\x22'+_0x32755a+'\x22');}else{_0x336b8e['push'](_0x9b23('0x58'));}break;case'email':if(isEmail(_0x3b8f61)){_0x5dd878['push']('\x22'+_0x3b8f61+'\x22');}else{_0x336b8e['push'](_0x9b23('0x59'));}break;case _0x9b23('0x5a'):var _0x457382=moment(_0x3b8f61,_0x9b23('0x5b'),!![]);if(_0x457382[_0x9b23('0x55')]()){_0x5dd878[_0x9b23('0x40')]('\x22'+_0x3b8f61+'\x22');}else{_0x336b8e['push'](_0x9b23('0x5c'));}break;default:_0x5dd878[_0x9b23('0x40')]('\x22'+_0x3b8f61+'\x22');}}else{switch(_0x549340){case _0x9b23('0x5d'):case _0x9b23('0x31'):_0x336b8e[_0x9b23('0x40')](_0x549340+'\x20not\x20specified');break;default:_0x5dd878['push']('\x22\x22');}}}}if(_0x336b8e[_0x9b23('0x52')]){handleError(_0x4b625c['data'][_0x585c54],{'code':_0x9b23('0x5e'),'message':_0x336b8e['join']()});}else{fs[_0x9b23('0x5f')](_0x4e5462,_0x5dd878['join']()+'\x0a');}_0x5dd878=[];}if(!(stats[_0x9b23('0x60')]%0xc8)){socket[_0x9b23('0x61')](_0x9b23('0x62')+_0x416e94,stats);stats[_0x9b23('0x3f')]=[];}}if(stopped){logger[_0x9b23('0x42')](_0x9b23('0x63'));_0x368f4a['abort']();}}catch(_0x4da7c6){handleError(_0x4b625c[_0x9b23('0x51')][_0x585c54],{'code':'SystemError','message':_0x4da7c6['message']});logger['error'](_0x9b23('0x64'),_0x4da7c6[_0x9b23('0x65')]);}},'complete':function(){try{var _0x4169e4=[];var _0x92eafc=_0x9b23('0x28');if(_0x643b09['duplicates']&&_0x643b09[_0x9b23('0x66')][_0x9b23('0x52')]){_0x92eafc='cm_contacts_'+_0x416e94;_0x4169e4[_0x9b23('0x40')](_0x9b23('0x67')+_0x92eafc+'\x20LIKE\x20cm_contacts;');}var _0x3b586a=util[_0x9b23('0xf')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x4e5462,_0x92eafc,_0x4c8f30,_0x643b09[_0x9b23('0x1f')],_0x643b09[_0x9b23('0x38')]||null,NOW,NOW);if(_[_0x9b23('0x68')](_0x550e2b[_0x9b23('0x1d')])){_0x3b586a+=_0x9b23('0x69');}_0x4169e4[_0x9b23('0x40')](_0x3b586a);if(_0x643b09[_0x9b23('0x66')]&&_0x643b09[_0x9b23('0x66')][_0x9b23('0x52')]){_0x4169e4[_0x9b23('0x40')](insertCmContact(_0x643b09[_0x9b23('0x1f')],_0x92eafc,_0x643b09[_0x9b23('0x66')],_0x550e2b));_0x4169e4[_0x9b23('0x40')](_0x9b23('0x6a')+_0x92eafc+';');}_0x4169e4[_0x9b23('0x40')](insertCmHopper(_0x643b09[_0x9b23('0x1f')],_0x9b23('0x6b'),_0x9b23('0x6c'),_0x9b23('0x6d'),_0x1a90be));_0x4169e4[_0x9b23('0x40')](insertCmHopperBlack(_0x643b09['ListId'],_0x9b23('0x6e'),_0x9b23('0x6c'),'VoiceQueueId'));_0x4169e4['push'](insertCmHopper(_0x643b09[_0x9b23('0x1f')],_0x9b23('0x6f'),'campaigns',_0x9b23('0x70'),_0x1a90be));_0x4169e4[_0x9b23('0x40')](insertCmHopperBlack(_0x643b09[_0x9b23('0x1f')],_0x9b23('0x71'),_0x9b23('0x72'),_0x9b23('0x70')));BPromise[_0x9b23('0x73')](_0x4169e4,handleQuery)['then'](function(_0x75e0a1){stats[_0x9b23('0x74')]=!![];stats[_0x9b23('0x75')]=_0x643b09[_0x9b23('0x66')]&&_0x643b09[_0x9b23('0x66')][_0x9b23('0x52')]?results[0x2]['affectedRows']:results[0x0][_0x9b23('0x75')];socket[_0x9b23('0x61')]('contact:import:'+_0x416e94,stats);fs['unlink'](_0x4b3c07);fs[_0x9b23('0x76')](_0x4e5462);process[_0x9b23('0x3e')](0x0);})[_0x9b23('0x46')](function(_0x2f2ed4){logger[_0x9b23('0x3d')](_0x2f2ed4[_0x9b23('0x65')]);process['exit'](0x1);});}catch(_0x11c45d){logger[_0x9b23('0x3d')](_0x9b23('0x77'),_0x11c45d[_0x9b23('0x65')]);process[_0x9b23('0x3e')](0x1);}},'error':function(_0x4d0a00,_0xe40116,_0x4aff97,_0x87a5b1){throw new Error(_0x87a5b1);}});}function validate(){if(process[_0x9b23('0x78')]&&process[_0x9b23('0x78')][_0x9b23('0x52')]<0x4){throw new Error(_0x9b23('0x79'));}var _0x76b2ff=path[_0x9b23('0x11')](config[_0x9b23('0x4c')],_0x9b23('0x7a'),process[_0x9b23('0x78')][0x2]);if(!fs[_0x9b23('0x7b')](_0x76b2ff)){throw new Error(_0x9b23('0x7c'));}var _0x3ae680={};try{_0x3ae680=JSON[_0x9b23('0x7d')](process[_0x9b23('0x78')][0x3]);if(!_0x3ae680['binding']){throw new Error(_0x9b23('0x7e'));}if(!_0x3ae680[_0x9b23('0x4a')][_0x9b23('0x31')]){throw new Error(_0x9b23('0x7f'));}if(!_0x3ae680['binding'][_0x9b23('0x5d')]){throw new Error('firstName\x20is\x20mandatory');}var _0x3f8185=0x0;if(_0x3ae680[_0x9b23('0x4a')][_0x9b23('0x23')]){_0x3f8185=0x1;}if(!_0x3ae680[_0x9b23('0x1f')]){throw new Error(_0x9b23('0x80'));}}catch(_0x591979){throw new Error('body\x20id\x20mandatory');}var _0x4f72ca=[];try{_0x4f72ca=_[_0x9b23('0x81')](JSON[_0x9b23('0x7d')](process[_0x9b23('0x78')][0x4]),'id');}catch(_0x28a165){logger[_0x9b23('0x42')](_0x9b23('0x82'));}main(_0x76b2ff,_0x3ae680,_0x4f72ca,_0x3f8185);}validate();process['on'](_0x9b23('0x83'),handleStop);process['on'](_0x9b23('0x84'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 2596ec2..2db05cf 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55f1=['Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','Complete\x20Time','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','variable','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','queue','UniqueId','uniqueid'];(function(_0x514b96,_0x4e1edd){var _0x44364e=function(_0x3410b1){while(--_0x3410b1){_0x514b96['push'](_0x514b96['shift']());}};_0x44364e(++_0x4e1edd);}(_0x55f1,0x9b));var _0x155f=function(_0x21000f,_0x13fa34){_0x21000f=_0x21000f-0x0;var _0x207b3f=_0x55f1[_0x21000f];return _0x207b3f;};'use strict';exports[_0x155f('0x0')]=function(_0x581101,_0x9fa58a){var _0x476580=[{'type':_0x155f('0x1'),'content':_0x155f('0x2'),'variableName':null}];switch(_0x581101[_0x155f('0x3')]()){case _0x155f('0x4'):switch(_0x9fa58a[_0x155f('0x3')]()){case'inbound':_0x476580['push']({'type':_0x155f('0x5'),'content':'','variableName':'queue'});_0x476580[_0x155f('0x6')]({'type':_0x155f('0x5'),'content':'','variableName':_0x155f('0x7')});break;case _0x155f('0x8'):_0x476580[_0x155f('0x6')]({'type':_0x155f('0x1'),'content':_0x155f('0x9'),'variableName':null});_0x476580[_0x155f('0x6')]({'type':_0x155f('0x5'),'content':'','variableName':_0x155f('0xa')});break;}}return _0x476580;};exports[_0x155f('0xb')]=function(_0x39d85a,_0x5b9e3b){var _0x9fb9a=[];switch(_0x39d85a[_0x155f('0x3')]()){case _0x155f('0x4'):switch(_0x5b9e3b[_0x155f('0x3')]()){case'inbound':_0x9fb9a=[{'type':_0x155f('0x1'),'content':_0x155f('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x155f('0xd'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x155f('0x7')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0xe'),'keyType':_0x155f('0x5'),'variableName':_0x155f('0xf')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x10'),'keyType':'variable','variableName':_0x155f('0x11')},{'type':_0x155f('0xd'),'content':'','key':'Queue','keyType':_0x155f('0x5'),'variableName':_0x155f('0x12')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x13'),'keyType':_0x155f('0x5'),'variableName':_0x155f('0x14')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x15'),'keyType':_0x155f('0x5'),'variableName':_0x155f('0x16')},{'type':_0x155f('0x1'),'content':_0x155f('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x18'),'keyType':_0x155f('0x5'),'variableName':_0x155f('0x19')},{'type':'keyValue','content':'','key':_0x155f('0x1a'),'keyType':_0x155f('0x5'),'variableName':_0x155f('0xa')},{'type':_0x155f('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x155f('0x5'),'variableName':_0x155f('0x16')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x1b'),'keyType':_0x155f('0x5'),'variableName':'agentconnectAt'},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x1c'),'keyType':_0x155f('0x5'),'variableName':_0x155f('0x1d')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x1e'),'keyType':_0x155f('0x5'),'variableName':_0x155f('0x1f')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x20'),'keyType':_0x155f('0x5'),'variableName':_0x155f('0x21')}];break;case'outbound':_0x9fb9a=[{'type':'string','content':_0x155f('0xc'),'variableName':null},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x22'),'keyType':_0x155f('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x23'),'keyType':_0x155f('0x5'),'keyContent':'','variableName':_0x155f('0x24')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x13'),'keyType':_0x155f('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x15'),'keyType':_0x155f('0x5'),'keyContent':'','variableName':_0x155f('0x25')},{'type':_0x155f('0x1'),'content':_0x155f('0x26')},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x27'),'keyType':_0x155f('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x28'),'keyType':_0x155f('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x155f('0xd'),'content':'','key':_0x155f('0x29'),'keyType':'variable','keyContent':'','variableName':_0x155f('0x2a')},{'type':'keyValue','content':'','key':_0x155f('0x2b'),'keyType':_0x155f('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x9fb9a;}; \ No newline at end of file +var _0xf7b4=['destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','uniqueid','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','voice','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','Date','***\x20Agent\x20Info\x20***','Agent\x20Name'];(function(_0xf15014,_0x29a98f){var _0x5a9b96=function(_0x2e323c){while(--_0x2e323c){_0xf15014['push'](_0xf15014['shift']());}};_0x5a9b96(++_0x29a98f);}(_0xf7b4,0x152));var _0x4f7b=function(_0x4db1fc,_0x423f55){_0x4db1fc=_0x4db1fc-0x0;var _0xab4a0a=_0xf7b4[_0x4db1fc];return _0xab4a0a;};'use strict';exports[_0x4f7b('0x0')]=function(_0x5579ed,_0x581bb0){var _0x5ccf30=[{'type':_0x4f7b('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x5579ed['toLowerCase']()){case _0x4f7b('0x2'):switch(_0x581bb0[_0x4f7b('0x3')]()){case _0x4f7b('0x4'):_0x5ccf30[_0x4f7b('0x5')]({'type':_0x4f7b('0x6'),'content':'','variableName':_0x4f7b('0x7')});_0x5ccf30[_0x4f7b('0x5')]({'type':_0x4f7b('0x6'),'content':'','variableName':_0x4f7b('0x8')});break;case _0x4f7b('0x9'):_0x5ccf30[_0x4f7b('0x5')]({'type':_0x4f7b('0x1'),'content':_0x4f7b('0xa'),'variableName':null});_0x5ccf30['push']({'type':_0x4f7b('0x6'),'content':'','variableName':_0x4f7b('0xb')});break;}}return _0x5ccf30;};exports['getDescriptions']=function(_0xdd1aab,_0x3a3d6c){var _0x408e01=[];switch(_0xdd1aab[_0x4f7b('0x3')]()){case _0x4f7b('0x2'):switch(_0x3a3d6c['toLowerCase']()){case _0x4f7b('0x4'):_0x408e01=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0xd'),'keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0x8')},{'type':'keyValue','content':'','key':_0x4f7b('0xe'),'keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0xf')},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x10'),'keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0x11')},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x12'),'keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0x7')},{'type':_0x4f7b('0xc'),'content':'','key':'UniqueId','keyType':_0x4f7b('0x6'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x4f7b('0x13'),'keyType':_0x4f7b('0x6'),'variableName':'agentcalledAt'},{'type':_0x4f7b('0x1'),'content':_0x4f7b('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x15'),'keyType':'variable','variableName':_0x4f7b('0x16')},{'type':'keyValue','content':'','key':_0x4f7b('0x17'),'keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0xb')},{'type':_0x4f7b('0x1'),'content':_0x4f7b('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x19'),'keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0x1a')},{'type':'keyValue','content':'','key':_0x4f7b('0x1b'),'keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0x1c')},{'type':'keyValue','content':'','key':_0x4f7b('0x1d'),'keyType':_0x4f7b('0x6'),'variableName':'agentcompleteAt'},{'type':_0x4f7b('0xc'),'content':'','key':'Hold\x20Time','keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0x1e')},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x1f'),'keyType':_0x4f7b('0x6'),'variableName':_0x4f7b('0x20')}];break;case _0x4f7b('0x9'):_0x408e01=[{'type':_0x4f7b('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x21'),'keyType':_0x4f7b('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x22'),'keyType':_0x4f7b('0x6'),'keyContent':'','variableName':_0x4f7b('0x23')},{'type':_0x4f7b('0xc'),'content':'','key':'UniqueId','keyType':_0x4f7b('0x6'),'keyContent':'','variableName':_0x4f7b('0x24')},{'type':_0x4f7b('0xc'),'content':'','key':'Date','keyType':_0x4f7b('0x6'),'keyContent':'','variableName':'starttime'},{'type':'string','content':_0x4f7b('0x18')},{'type':'keyValue','content':'','key':_0x4f7b('0x25'),'keyType':_0x4f7b('0x6'),'keyContent':'','variableName':_0x4f7b('0x26')},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x27'),'keyType':_0x4f7b('0x6'),'keyContent':'','variableName':_0x4f7b('0x28')},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x29'),'keyType':_0x4f7b('0x6'),'keyContent':'','variableName':_0x4f7b('0x2a')},{'type':_0x4f7b('0xc'),'content':'','key':_0x4f7b('0x2b'),'keyType':_0x4f7b('0x6'),'keyContent':'','variableName':_0x4f7b('0x2c')}];break;}}return _0x408e01;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 092d016..4a043ea 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd9f=['openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','toLowerCase','role','stringify','null','Interaction','findOne','then','update','catch','error','user','query','clone','omit','body','phone','fax','mobile','lodash','../../mysqldb','../../config/logger'];(function(_0x513038,_0x4e2e89){var _0x1f40d6=function(_0xc76437){while(--_0xc76437){_0x513038['push'](_0x513038['shift']());}};_0x1f40d6(++_0x4e2e89);}(_0xcd9f,0xba));var _0xfcd9=function(_0x117289,_0x44a47a){_0x117289=_0x117289-0x0;var _0x48405f=_0xcd9f[_0x117289];return _0x48405f;};'use strict';var _=require(_0xfcd9('0x0'));var db=require(_0xfcd9('0x1'))['db'];var loggers={'openchannel':require(_0xfcd9('0x2'))(_0xfcd9('0x3')),'mail':require(_0xfcd9('0x2'))(_0xfcd9('0x4')),'fax':require(_0xfcd9('0x2'))(_0xfcd9('0x5')),'sms':require('../../config/logger')(_0xfcd9('0x6')),'chat':require(_0xfcd9('0x2'))('chat-interactions')};function getInteractionId(_0x4912f4,_0x1afcb9,_0x5d1eb6){if(_0x4912f4&&_0x4912f4[_[_0xfcd9('0x7')](_0x5d1eb6)+'InteractionId']){return _0x4912f4[_['upperFirst'](_0x5d1eb6)+_0xfcd9('0x8')];}else if(_0x4912f4&&_0x4912f4['id']){return _0x4912f4['id'];}else if(_0x1afcb9&&_0x1afcb9['id']){return _0x1afcb9['id'];}else{return'unknown';}}function log(_0x308c50,_0x443e80,_0x24e37b,_0x448379,_0x1c36b2,_0x5882a4){loggers[_0x1c36b2[_0xfcd9('0x9')]()][_0x308c50]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5882a4['toUpperCase'](),_0x443e80?_0x443e80['id']:null,_0x443e80?_0x443e80['name']:null,_0x443e80?_0x443e80[_0xfcd9('0xa')]:null,getInteractionId(_0x24e37b,_0x448379,_0x1c36b2),_0x24e37b?JSON[_0xfcd9('0xb')](_0x24e37b):_0xfcd9('0xc'));}function updateUser(_0x4e1844,_0x7010c2,_0x59675f,_0x26e3e6,_0xa47d0e){db[_['upperFirst'](_0x26e3e6)+_0xfcd9('0xd')][_0xfcd9('0xe')]({'where':{'id':getInteractionId(_0x7010c2,_0x59675f,_0x26e3e6)}})[_0xfcd9('0xf')](function(_0x5541c9){if(_0x5541c9){return _0x5541c9[_0xfcd9('0x10')]({'UserId':_0x4e1844?_0x4e1844['id']:null});}})[_0xfcd9('0xf')](function(_0x420ecb){if(_0x420ecb){log('info',_0x4e1844,_0x7010c2,_0x59675f,_0x26e3e6,_0xa47d0e);}})[_0xfcd9('0x11')](function(){log(_0xfcd9('0x12'),_0x4e1844,_0x7010c2,_0x59675f,_0x26e3e6,_0xa47d0e);});}exports['tracked']=function(_0x6996d6,_0x1d0e49){return function(_0x31a150,_0x21a780,_0x22a6d6){var _0x4e1224=_0x31a150[_0xfcd9('0x13')];var _0x1d057c={};var _0x37b672=_0x31a150[_0xfcd9('0x14')];if(_0x1d057c){_0x1d057c=_[_0xfcd9('0x15')](_0x31a150['body']);_0x1d057c=_[_0xfcd9('0x16')](_0x1d057c,[_0xfcd9('0x17'),'html',_0xfcd9('0x18'),_0xfcd9('0x19'),_0xfcd9('0x1a')]);}updateUser(_0x4e1224,_0x1d057c,_0x37b672,_0x6996d6,_0x1d0e49);_0x22a6d6(null);};}; \ No newline at end of file +var _0x720a=['fax','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','findOne','then','update','info','catch','error','user','query','body','omit','html','phone'];(function(_0x160b51,_0x432b32){var _0x2a3698=function(_0x14cb73){while(--_0x14cb73){_0x160b51['push'](_0x160b51['shift']());}};_0x2a3698(++_0x432b32);}(_0x720a,0x97));var _0xa720=function(_0x69ee2b,_0x2efd11){_0x69ee2b=_0x69ee2b-0x0;var _0x551e19=_0x720a[_0x69ee2b];return _0x551e19;};'use strict';var _=require(_0xa720('0x0'));var db=require(_0xa720('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xa720('0x2')),'mail':require(_0xa720('0x3'))(_0xa720('0x4')),'fax':require(_0xa720('0x3'))(_0xa720('0x5')),'sms':require(_0xa720('0x3'))(_0xa720('0x6')),'chat':require(_0xa720('0x3'))(_0xa720('0x7'))};function getInteractionId(_0x3cce80,_0x1436ed,_0x33e667){if(_0x3cce80&&_0x3cce80[_[_0xa720('0x8')](_0x33e667)+_0xa720('0x9')]){return _0x3cce80[_[_0xa720('0x8')](_0x33e667)+_0xa720('0x9')];}else if(_0x3cce80&&_0x3cce80['id']){return _0x3cce80['id'];}else if(_0x1436ed&&_0x1436ed['id']){return _0x1436ed['id'];}else{return _0xa720('0xa');}}function log(_0x260be0,_0x4f1f45,_0x1bb0cd,_0x336d6c,_0x9cb0b,_0x2b8b1b){loggers[_0x9cb0b[_0xa720('0xb')]()][_0x260be0](_0xa720('0xc'),_0x2b8b1b[_0xa720('0xd')](),_0x4f1f45?_0x4f1f45['id']:null,_0x4f1f45?_0x4f1f45[_0xa720('0xe')]:null,_0x4f1f45?_0x4f1f45[_0xa720('0xf')]:null,getInteractionId(_0x1bb0cd,_0x336d6c,_0x9cb0b),_0x1bb0cd?JSON[_0xa720('0x10')](_0x1bb0cd):'null');}function updateUser(_0x598ba4,_0x5f0828,_0x249ebb,_0x1b2545,_0x55313c){db[_[_0xa720('0x8')](_0x1b2545)+'Interaction'][_0xa720('0x11')]({'where':{'id':getInteractionId(_0x5f0828,_0x249ebb,_0x1b2545)}})[_0xa720('0x12')](function(_0x1caf2d){if(_0x1caf2d){return _0x1caf2d[_0xa720('0x13')]({'UserId':_0x598ba4?_0x598ba4['id']:null});}})[_0xa720('0x12')](function(_0x586de9){if(_0x586de9){log(_0xa720('0x14'),_0x598ba4,_0x5f0828,_0x249ebb,_0x1b2545,_0x55313c);}})[_0xa720('0x15')](function(){log(_0xa720('0x16'),_0x598ba4,_0x5f0828,_0x249ebb,_0x1b2545,_0x55313c);});}exports['tracked']=function(_0x262ec5,_0x32ce38){return function(_0xb9501e,_0xc4d6a0,_0x3aaafd){var _0x4733b7=_0xb9501e[_0xa720('0x17')];var _0x11a2a9={};var _0x560b16=_0xb9501e[_0xa720('0x18')];if(_0x11a2a9){_0x11a2a9=_['clone'](_0xb9501e[_0xa720('0x19')]);_0x11a2a9=_[_0xa720('0x1a')](_0x11a2a9,[_0xa720('0x19'),_0xa720('0x1b'),_0xa720('0x1c'),_0xa720('0x1d'),'mobile']);}updateUser(_0x4733b7,_0x11a2a9,_0x560b16,_0x262ec5,_0x32ce38);_0x3aaafd(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index cc26c95..9f01deb 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6179=['findOne','then','count','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','hasOwnProperty','use','License'];(function(_0x4b256a,_0x154505){var _0x14ca6f=function(_0x3c9f41){while(--_0x3c9f41){_0x4b256a['push'](_0x4b256a['shift']());}};_0x14ca6f(++_0x154505);}(_0x6179,0x180));var _0x9617=function(_0x3f96f0,_0xa755cc){_0x3f96f0=_0x3f96f0-0x0;var _0x338019=_0x6179[_0x3f96f0];return _0x338019;};'use strict';var crypto=require('crypto');var util=require(_0x9617('0x0'));var compose=require(_0x9617('0x1'));var db=require(_0x9617('0x2'))['db'];var config=require(_0x9617('0x3'));function getValueFromLicense(_0xd468b1,_0x2f7a4f){if(_0xd468b1&&_0x2f7a4f){if(_0x2f7a4f['data1']&&_0x2f7a4f['license']){var _0x287c6a=_0x2f7a4f[_0x9617('0x4')];var _0x1a1db1=_0x2f7a4f['license'];var _0x4311fb=_0x287c6a[_0x9617('0x5')]('-')[0x4];var _0x2ed5cb=_0x287c6a[_0x9617('0x5')]('-')[0x0];var _0x457d92=crypto[_0x9617('0x6')](_0x9617('0x7'),util[_0x9617('0x8')](_0x9617('0x9'),_0x4311fb,_0x287c6a,_0x2ed5cb));var _0x1383eb=_0x457d92[_0x9617('0xa')](_0x1a1db1,_0x9617('0xb'),'utf8');_0x1383eb+=_0x457d92['final'](_0x9617('0xc'));var _0x170ad6=JSON['parse'](_0x1383eb);return _0x170ad6[_0x9617('0xd')](_0xd468b1)?_0x170ad6[_0xd468b1]:null;}}return null;}function isLimit(_0x39f78a,_0x405958,_0x556e64,_0xa8023){var _0x5e8a0f=_0x405958;return compose()[_0x9617('0xe')](function(_0x25681b,_0x9d8779,_0x925951){return db[_0x9617('0xf')][_0x9617('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x23e79e){var _0x59f16b=getValueFromLicense(_0x39f78a,_0x23e79e);return _0x59f16b?_0x59f16b:_0x5e8a0f;})[_0x9617('0x11')](function(_0x3d8046){_0x5e8a0f=_0x3d8046;return _0x556e64[_0x9617('0x12')](_0xa8023);})[_0x9617('0x11')](function(_0x444503){if(_0x444503>=_0x5e8a0f){return _0x9d8779['status'](0x193)['json']({'message':util[_0x9617('0x8')](_0x9617('0x13'),_0x39f78a)});}_0x925951();})[_0x9617('0x14')](function(_0x51c725){_0x925951(_0x51c725);});});}function isUserLimit(){return isLimit(_0x9617('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x9617('0x16')},{'role':_0x9617('0x17')}]}});}exports[_0x9617('0x18')]=isUserLimit; \ No newline at end of file +var _0x34b1=['findOne','then','status','json','catch','users','User','admin','user','isUserLimit','crypto','util','../../config/environment','data1','license','split','createDecipher','format','base64','utf8','final','parse','hasOwnProperty','License'];(function(_0x416d75,_0x2c8e81){var _0x10af66=function(_0x48f136){while(--_0x48f136){_0x416d75['push'](_0x416d75['shift']());}};_0x10af66(++_0x2c8e81);}(_0x34b1,0x172));var _0x134b=function(_0x251fde,_0x384469){_0x251fde=_0x251fde-0x0;var _0x350af6=_0x34b1[_0x251fde];return _0x350af6;};'use strict';var crypto=require(_0x134b('0x0'));var util=require(_0x134b('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x134b('0x2'));function getValueFromLicense(_0x2cb791,_0x42542f){if(_0x2cb791&&_0x42542f){if(_0x42542f[_0x134b('0x3')]&&_0x42542f['license']){var _0x58ba5c=_0x42542f['data1'];var _0x70ed1c=_0x42542f[_0x134b('0x4')];var _0xd7ce01=_0x58ba5c['split']('-')[0x4];var _0x4eec41=_0x58ba5c[_0x134b('0x5')]('-')[0x0];var _0x51a06c=crypto[_0x134b('0x6')]('aes-256-ctr',util[_0x134b('0x7')]('%s:%s:%s',_0xd7ce01,_0x58ba5c,_0x4eec41));var _0xe99508=_0x51a06c['update'](_0x70ed1c,_0x134b('0x8'),_0x134b('0x9'));_0xe99508+=_0x51a06c[_0x134b('0xa')](_0x134b('0x9'));var _0x16f53a=JSON[_0x134b('0xb')](_0xe99508);return _0x16f53a[_0x134b('0xc')](_0x2cb791)?_0x16f53a[_0x2cb791]:null;}}return null;}function isLimit(_0x5b724d,_0x266768,_0x528ab3,_0xb94ece){var _0x3b1023=_0x266768;return compose()['use'](function(_0x16a6c1,_0x3fdd73,_0x3fcd2e){return db[_0x134b('0xd')][_0x134b('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x17f518){var _0x3554bd=getValueFromLicense(_0x5b724d,_0x17f518);return _0x3554bd?_0x3554bd:_0x3b1023;})[_0x134b('0xf')](function(_0x4ae39d){_0x3b1023=_0x4ae39d;return _0x528ab3['count'](_0xb94ece);})[_0x134b('0xf')](function(_0x4d6690){if(_0x4d6690>=_0x3b1023){return _0x3fdd73[_0x134b('0x10')](0x193)[_0x134b('0x11')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x5b724d)});}_0x3fcd2e();})[_0x134b('0x12')](function(_0x24787c){_0x3fcd2e(_0x24787c);});});}function isUserLimit(){return isLimit(_0x134b('0x13'),0x1,db[_0x134b('0x14')],{'where':{'$or':[{'role':_0x134b('0x15')},{'role':_0x134b('0x16')}]}});}exports[_0x134b('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 015e83c..993c935 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78aa=['days','format','YYYY-MM-DD','castTo','CAST(','\x20AS\x20','text','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$substring','start','shift','pop','DATE','utcOffset','add','hours','minutes','lodash','moment','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','match','filter','map','conditions','push','buildExpression','operator','$eq','$between','value','includes','$gt','$lte'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x78aa,0x98));var _0xa78a=function(_0x16bb74,_0x5d2b05){_0x16bb74=_0x16bb74-0x0;var _0x5244a8=_0x78aa[_0x16bb74];return _0x5244a8;};'use strict';var _=require(_0xa78a('0x0'));var moment=require(_0xa78a('0x1'));exports['parseSearch']=function(_0x28d745){var _0x172234={'conditions':[]};_0x172234[_0xa78a('0x2')]=_[_0xa78a('0x3')](_0x28d745,_0xa78a('0x4'))?'or':_0xa78a('0x5');var _0x3fc816=_0x28d745[_0xa78a('0x6')](_0xa78a('0x7'),'')[_0xa78a('0x6')]('[$or]','')[_0xa78a('0x8')]('||');for(var _0x4e262e=0x0;_0x4e262e<_0x3fc816[_0xa78a('0x9')];_0x4e262e++){var _0x2d4c17=_0x3fc816[_0x4e262e][_0xa78a('0x8')](':=');var _0x590aa2=_0x2d4c17[0x0];var _0x58e78a=_0x2d4c17[_0xa78a('0xa')](0x1);_0x58e78a[_0xa78a('0xb')](function(_0x34b5f8){var _0x801bef=_0x34b5f8['split']('[')['shift']();var _0x535618=_0x34b5f8[_0xa78a('0xc')](/\[(.*?)\]/g);_0x535618[_0xa78a('0xb')](function(_0x2df91d){var _0x6c4d8d=_0x2df91d['split']('[')[_0xa78a('0xd')](function(_0x4a421a){return _0x4a421a['indexOf'](']')>-0x1;})[_0xa78a('0xe')](function(_0x10eb40){return _0x10eb40['split'](']')[0x0];})[0x0];_0x172234[_0xa78a('0xf')][_0xa78a('0x10')]({'field':_0x590aa2,'operator':_0x801bef,'value':_0x6c4d8d});});});}return _0x172234;};exports[_0xa78a('0x11')]=function(_0x182e05,_0x2c4240,_0x389b64){var _0x6f27b7={};if(_0x2c4240==='DATE'){if(_0x389b64[_0xa78a('0x12')]===_0xa78a('0x13')){_0x389b64[_0xa78a('0x12')]=_0xa78a('0x14');_0x389b64[_0xa78a('0x15')]+=','+_0x389b64[_0xa78a('0x15')];}else if(_[_0xa78a('0x16')]([_0xa78a('0x17'),_0xa78a('0x18')],_0x389b64[_0xa78a('0x12')])){_0x389b64[_0xa78a('0x15')]=moment(_0x389b64[_0xa78a('0x15')])['add'](0x1,_0xa78a('0x19'))[_0xa78a('0x1a')](_0xa78a('0x1b'));}}if(_0x389b64[_0xa78a('0x1c')]){_0x2c4240=_0x389b64[_0xa78a('0x1c')];_0x6f27b7['text']=_0xa78a('0x1d')+_0x182e05+'.'+_0x389b64['field']+_0xa78a('0x1e')+_0x389b64['castTo']+')\x20'+parseOperator(_0x389b64[_0xa78a('0x12')]);}else{_0x6f27b7[_0xa78a('0x1f')]=_0x182e05+'.'+_0x389b64[_0xa78a('0x20')]+'\x20'+parseOperator(_0x389b64[_0xa78a('0x12')]);}if(_[_0xa78a('0x16')]([_0xa78a('0x21'),_0xa78a('0x22')],_0x389b64[_0xa78a('0x12')]))_0x6f27b7['text']='('+_0x6f27b7[_0xa78a('0x1f')]+_0xa78a('0x23')+_0x182e05+'.'+_0x389b64[_0xa78a('0x20')]+_0xa78a('0x24');_0x6f27b7['value']=parseValue(_0x2c4240,_0x389b64[_0xa78a('0x12')],_0x389b64[_0xa78a('0x15')]);return _0x6f27b7;};function parseOperator(_0x355c2c){var _0x1118ad;switch(_0x355c2c){case _0xa78a('0x25'):_0x1118ad=_0xa78a('0x26');break;case'$notIn':_0x1118ad=_0xa78a('0x27');break;case'$eq':_0x1118ad=_0xa78a('0x28');break;case'$ne':_0x1118ad='<>\x20?';break;case'$substring':case'$startsWith':case _0xa78a('0x29'):_0x1118ad=_0xa78a('0x2a');break;case _0xa78a('0x2b'):_0x1118ad=_0xa78a('0x2c');break;case _0xa78a('0x17'):_0x1118ad=_0xa78a('0x2d');break;case _0xa78a('0x18'):_0x1118ad=_0xa78a('0x2e');break;case _0xa78a('0x2f'):_0x1118ad=_0xa78a('0x30');break;case _0xa78a('0x14'):_0x1118ad=_0xa78a('0x31');break;}return _0x1118ad;}function parseValue(_0x298076,_0x5b2c4c,_0x34151a){var _0x2691fa={'start':undefined,'end':undefined};switch(_0x5b2c4c){case'$in':case _0xa78a('0x22'):_0x2691fa['start']=_0x34151a[_0xa78a('0x8')](',');break;case _0xa78a('0x32'):_0x2691fa[_0xa78a('0x33')]='%'+_0x34151a+'%';break;case'$startsWith':_0x2691fa[_0xa78a('0x33')]=_0x34151a+'%';break;case _0xa78a('0x29'):_0x2691fa[_0xa78a('0x33')]='%'+_0x34151a;break;case _0xa78a('0x14'):var _0x35c136=_0x34151a[_0xa78a('0x8')](',');var _0x34151a=_0x35c136[_0xa78a('0x34')]();var _0xb9230a=_0x35c136[_0xa78a('0x35')]();if(_0x298076===_0xa78a('0x36')){_0x34151a=moment(_0x34151a)['utcOffset'](0x0,!![])[_0xa78a('0x1a')]();_0xb9230a=moment(_0xb9230a)[_0xa78a('0x37')](0x0,!![])[_0xa78a('0x38')](0x17,_0xa78a('0x39'))['add'](0x3b,_0xa78a('0x3a'))[_0xa78a('0x38')](0x3b,'seconds')[_0xa78a('0x1a')]();}_0x2691fa={'start':_0x34151a,'end':_0xb9230a};break;default:_0x2691fa[_0xa78a('0x33')]=_0x34151a;break;}return _0x2691fa;} \ No newline at end of file +var _0xc4aa=['>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$substring','utcOffset','hours','minutes','seconds','format','lodash','moment','parseSearch','[$or]','and','replace','[$and]','split','slice','shift','match','forEach','filter','indexOf','map','conditions','push','DATE','operator','$eq','$between','value','includes','$lte','add','days','YYYY-MM-DD','castTo','CAST(','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt'];(function(_0x26f580,_0x1c357e){var _0xba7ae9=function(_0x1f2610){while(--_0x1f2610){_0x26f580['push'](_0x26f580['shift']());}};_0xba7ae9(++_0x1c357e);}(_0xc4aa,0xb8));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xac4a('0x0'));var moment=require(_0xac4a('0x1'));exports[_0xac4a('0x2')]=function(_0x4e5006){var _0x53d281={'conditions':[]};_0x53d281['sqlOperator']=_['startsWith'](_0x4e5006,_0xac4a('0x3'))?'or':_0xac4a('0x4');var _0x4fb52c=_0x4e5006[_0xac4a('0x5')](_0xac4a('0x6'),'')[_0xac4a('0x5')](_0xac4a('0x3'),'')['split']('||');for(var _0x53b877=0x0;_0x53b877<_0x4fb52c['length'];_0x53b877++){var _0x4a5515=_0x4fb52c[_0x53b877][_0xac4a('0x7')](':=');var _0x3d687e=_0x4a5515[0x0];var _0x2ccf51=_0x4a5515[_0xac4a('0x8')](0x1);_0x2ccf51['forEach'](function(_0x2df143){var _0x42f69a=_0x2df143['split']('[')[_0xac4a('0x9')]();var _0x9c84d4=_0x2df143[_0xac4a('0xa')](/\[(.*?)\]/g);_0x9c84d4[_0xac4a('0xb')](function(_0x568e50){var _0x4a47cb=_0x568e50[_0xac4a('0x7')]('[')[_0xac4a('0xc')](function(_0x3eff73){return _0x3eff73[_0xac4a('0xd')](']')>-0x1;})[_0xac4a('0xe')](function(_0x174a23){return _0x174a23[_0xac4a('0x7')](']')[0x0];})[0x0];_0x53d281[_0xac4a('0xf')][_0xac4a('0x10')]({'field':_0x3d687e,'operator':_0x42f69a,'value':_0x4a47cb});});});}return _0x53d281;};exports['buildExpression']=function(_0x1f5cbc,_0x522c64,_0x474d59){var _0x2d1bb7={};if(_0x522c64===_0xac4a('0x11')){if(_0x474d59[_0xac4a('0x12')]===_0xac4a('0x13')){_0x474d59['operator']=_0xac4a('0x14');_0x474d59['value']+=','+_0x474d59[_0xac4a('0x15')];}else if(_[_0xac4a('0x16')](['$gt',_0xac4a('0x17')],_0x474d59[_0xac4a('0x12')])){_0x474d59[_0xac4a('0x15')]=moment(_0x474d59[_0xac4a('0x15')])[_0xac4a('0x18')](0x1,_0xac4a('0x19'))['format'](_0xac4a('0x1a'));}}if(_0x474d59['castTo']){_0x522c64=_0x474d59[_0xac4a('0x1b')];_0x2d1bb7['text']=_0xac4a('0x1c')+_0x1f5cbc+'.'+_0x474d59['field']+_0xac4a('0x1d')+_0x474d59[_0xac4a('0x1b')]+')\x20'+parseOperator(_0x474d59[_0xac4a('0x12')]);}else{_0x2d1bb7[_0xac4a('0x1e')]=_0x1f5cbc+'.'+_0x474d59['field']+'\x20'+parseOperator(_0x474d59[_0xac4a('0x12')]);}if(_[_0xac4a('0x16')]([_0xac4a('0x1f'),_0xac4a('0x20')],_0x474d59[_0xac4a('0x12')]))_0x2d1bb7['text']='('+_0x2d1bb7[_0xac4a('0x1e')]+_0xac4a('0x21')+_0x1f5cbc+'.'+_0x474d59['field']+'\x20IS\x20NULL)';_0x2d1bb7[_0xac4a('0x15')]=parseValue(_0x522c64,_0x474d59[_0xac4a('0x12')],_0x474d59[_0xac4a('0x15')]);return _0x2d1bb7;};function parseOperator(_0x994f88){var _0xebc1a2;switch(_0x994f88){case'$in':_0xebc1a2=_0xac4a('0x22');break;case _0xac4a('0x20'):_0xebc1a2=_0xac4a('0x23');break;case _0xac4a('0x13'):_0xebc1a2=_0xac4a('0x24');break;case _0xac4a('0x1f'):_0xebc1a2=_0xac4a('0x25');break;case'$substring':case _0xac4a('0x26'):case _0xac4a('0x27'):_0xebc1a2=_0xac4a('0x28');break;case _0xac4a('0x29'):_0xebc1a2=_0xac4a('0x2a');break;case _0xac4a('0x2b'):_0xebc1a2=_0xac4a('0x2c');break;case _0xac4a('0x17'):_0xebc1a2=_0xac4a('0x2d');break;case _0xac4a('0x2e'):_0xebc1a2=_0xac4a('0x2f');break;case _0xac4a('0x14'):_0xebc1a2=_0xac4a('0x30');break;}return _0xebc1a2;}function parseValue(_0x275a95,_0x14e734,_0x44056b){var _0xcc30d5={'start':undefined,'end':undefined};switch(_0x14e734){case _0xac4a('0x31'):case _0xac4a('0x20'):_0xcc30d5[_0xac4a('0x32')]=_0x44056b[_0xac4a('0x7')](',');break;case _0xac4a('0x33'):_0xcc30d5[_0xac4a('0x32')]='%'+_0x44056b+'%';break;case _0xac4a('0x26'):_0xcc30d5[_0xac4a('0x32')]=_0x44056b+'%';break;case'$endsWith':_0xcc30d5['start']='%'+_0x44056b;break;case _0xac4a('0x14'):var _0x501eac=_0x44056b['split'](',');var _0x44056b=_0x501eac[_0xac4a('0x9')]();var _0x109a8b=_0x501eac['pop']();if(_0x275a95===_0xac4a('0x11')){_0x44056b=moment(_0x44056b)['utcOffset'](0x0,!![])['format']();_0x109a8b=moment(_0x109a8b)[_0xac4a('0x34')](0x0,!![])[_0xac4a('0x18')](0x17,_0xac4a('0x35'))[_0xac4a('0x18')](0x3b,_0xac4a('0x36'))[_0xac4a('0x18')](0x3b,_0xac4a('0x37'))[_0xac4a('0x38')]();}_0xcc30d5={'start':_0x44056b,'end':_0x109a8b};break;default:_0xcc30d5[_0xac4a('0x32')]=_0x44056b;break;}return _0xcc30d5;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 1d8a01d..cdc5d7e 100644 --- a/server/components/parsers/qs.js +++ b/server/components/parsers/qs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1e9=['toString','join','sequelize','fields','split','filters','forOwn','parse','limit','sort','map','indexOf','priority','cast','col','DESC','unsigned','ASC','omit','isEmpty','length','isObject','isString','isArray','unset','hasOwnProperty','match','^[0-9]*$','isEmail','getFullTextValue','push'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc1e9,0x157));var _0x9c1e=function(_0x262755,_0x538779){_0x262755=_0x262755-0x0;var _0x5425ff=_0xc1e9[_0x262755];return _0x5425ff;};'use strict';var _=require('lodash');var sequelize=require(_0x9c1e('0x0'));var LIMIT_VALUE=0xfa;exports[_0x9c1e('0x1')]=function(_0x13b86e){var _0x47c236=null;if(_0x13b86e){_0x47c236=_0x13b86e[_0x9c1e('0x2')](',');}return _0x47c236;};exports[_0x9c1e('0x3')]=function(_0x36c8db){var _0x1e563d={};if(!_['isEmpty'](_0x36c8db)){_0x1e563d={};_[_0x9c1e('0x4')](_0x36c8db,function(_0x4dddea,_0x34034f){try{_0x1e563d[_0x34034f]=_['isArray'](_0x4dddea)?_0x4dddea:JSON[_0x9c1e('0x5')](_0x4dddea);}catch(_0xb47241){_0x1e563d[_0x34034f]=_0x4dddea[_0x9c1e('0x2')](',');}});}return _0x1e563d;};exports[_0x9c1e('0x6')]=function(_0x3fb9c8){_0x3fb9c8=parseInt(_0x3fb9c8,0xa);if(!_0x3fb9c8||_0x3fb9c8<0x0){_0x3fb9c8=LIMIT_VALUE;}return _0x3fb9c8;};exports['offset']=function(_0x30eda7){_0x30eda7=parseInt(_0x30eda7,0xa);if(!_0x30eda7||_0x30eda7<0x0){_0x30eda7=0x0;}return _0x30eda7;};exports[_0x9c1e('0x7')]=function(_0x35e08d){var _0x1a1d9c,_0x5bbe05=null;if(_0x35e08d){_0x1a1d9c=_0x35e08d[_0x9c1e('0x2')](',');_0x5bbe05=_[_0x9c1e('0x8')](_0x1a1d9c,function(_0x55894f){if(_0x55894f[_0x9c1e('0x9')]('-')===0x0){return[_0x55894f===_0x9c1e('0xa')?sequelize[_0x9c1e('0xb')](sequelize[_0x9c1e('0xc')](_0x9c1e('0xa')),'unsigned'):_0x55894f['substr'](0x1),_0x9c1e('0xd')];}else{return[_0x55894f===_0x9c1e('0xa')?sequelize[_0x9c1e('0xb')](sequelize[_0x9c1e('0xc')]('priority'),_0x9c1e('0xe')):_0x55894f,_0x9c1e('0xf')];}});}return _0x5bbe05;};exports[_0x9c1e('0x10')]=function(_0x15dd32,_0x9610dc){if(_[_0x9c1e('0x11')](_0x15dd32)){return _0x15dd32;}if(_['isArray'](_0x15dd32)){for(var _0x419b6f=0x0;_0x419b6f<_0x15dd32[_0x9c1e('0x12')];_0x419b6f+=0x1){_0x15dd32[_0x419b6f]=this[_0x9c1e('0x10')](_0x15dd32[_0x419b6f],_0x9610dc);}return _0x15dd32;}if(!_[_0x9c1e('0x13')](_0x15dd32)){return _0x15dd32;}if(_[_0x9c1e('0x14')](_0x9610dc)){_0x9610dc=[_0x9610dc];}if(!_[_0x9c1e('0x15')](_0x9610dc)){return _0x15dd32;}for(var _0x1015de=0x0;_0x1015de<_0x9610dc[_0x9c1e('0x12')];_0x1015de+=0x1){_[_0x9c1e('0x16')](_0x15dd32,_0x9610dc[_0x1015de]);}for(var _0x3c039a in _0x15dd32){if(_0x15dd32[_0x9c1e('0x17')](_0x3c039a)){_0x15dd32[_0x3c039a]=this['omit'](_0x15dd32[_0x3c039a],_0x9610dc);}}return _0x15dd32;};exports['isNumeric']=function(_0x3ef5f5){return _0x3ef5f5[_0x9c1e('0x18')](RegExp(_0x9c1e('0x19')))?!![]:![];};exports[_0x9c1e('0x1a')]=function(_0x47b798){return _0x47b798[_0x9c1e('0x18')](/^\S+@\S+$/)?!![]:![];};exports[_0x9c1e('0x1b')]=function(_0x289d66){var _0x2eed36=[];_0x289d66[_0x9c1e('0x2')]('\x20')['forEach'](function(_0xfb9190){_0x2eed36[_0x9c1e('0x1c')]('+'+_0xfb9190[_0x9c1e('0x1d')]()+'*');});return _0x2eed36[_0x9c1e('0x1e')]('\x20');}; \ No newline at end of file +var _0x37ad=['length','omit','isObject','isString','unset','hasOwnProperty','match','^[0-9]*$','isEmail','getFullTextValue','forEach','toString','sequelize','fields','split','filters','isEmpty','forOwn','isArray','parse','limit','offset','map','priority','cast','col','unsigned','DESC'];(function(_0x27842c,_0x324fcb){var _0x493de8=function(_0x1f6c85){while(--_0x1f6c85){_0x27842c['push'](_0x27842c['shift']());}};_0x493de8(++_0x324fcb);}(_0x37ad,0x1b0));var _0xd37a=function(_0x18f869,_0x694862){_0x18f869=_0x18f869-0x0;var _0x1c6ca4=_0x37ad[_0x18f869];return _0x1c6ca4;};'use strict';var _=require('lodash');var sequelize=require(_0xd37a('0x0'));var LIMIT_VALUE=0xfa;exports[_0xd37a('0x1')]=function(_0x590c59){var _0x30de7c=null;if(_0x590c59){_0x30de7c=_0x590c59[_0xd37a('0x2')](',');}return _0x30de7c;};exports[_0xd37a('0x3')]=function(_0x406fad){var _0x130058={};if(!_[_0xd37a('0x4')](_0x406fad)){_0x130058={};_[_0xd37a('0x5')](_0x406fad,function(_0x3f0011,_0x96c633){try{_0x130058[_0x96c633]=_[_0xd37a('0x6')](_0x3f0011)?_0x3f0011:JSON[_0xd37a('0x7')](_0x3f0011);}catch(_0x2b38e7){_0x130058[_0x96c633]=_0x3f0011[_0xd37a('0x2')](',');}});}return _0x130058;};exports[_0xd37a('0x8')]=function(_0x2e4e3c){_0x2e4e3c=parseInt(_0x2e4e3c,0xa);if(!_0x2e4e3c||_0x2e4e3c<0x0){_0x2e4e3c=LIMIT_VALUE;}return _0x2e4e3c;};exports[_0xd37a('0x9')]=function(_0x4e4bc9){_0x4e4bc9=parseInt(_0x4e4bc9,0xa);if(!_0x4e4bc9||_0x4e4bc9<0x0){_0x4e4bc9=0x0;}return _0x4e4bc9;};exports['sort']=function(_0x424ba9){var _0x5bea63,_0x5b7b7e=null;if(_0x424ba9){_0x5bea63=_0x424ba9['split'](',');_0x5b7b7e=_[_0xd37a('0xa')](_0x5bea63,function(_0x284ad6){if(_0x284ad6['indexOf']('-')===0x0){return[_0x284ad6===_0xd37a('0xb')?sequelize[_0xd37a('0xc')](sequelize[_0xd37a('0xd')]('priority'),_0xd37a('0xe')):_0x284ad6['substr'](0x1),_0xd37a('0xf')];}else{return[_0x284ad6===_0xd37a('0xb')?sequelize['cast'](sequelize[_0xd37a('0xd')]('priority'),_0xd37a('0xe')):_0x284ad6,'ASC'];}});}return _0x5b7b7e;};exports['omit']=function(_0x49cfa1,_0x5bb72a){if(_[_0xd37a('0x4')](_0x49cfa1)){return _0x49cfa1;}if(_[_0xd37a('0x6')](_0x49cfa1)){for(var _0x3b2bd8=0x0;_0x3b2bd8<_0x49cfa1[_0xd37a('0x10')];_0x3b2bd8+=0x1){_0x49cfa1[_0x3b2bd8]=this[_0xd37a('0x11')](_0x49cfa1[_0x3b2bd8],_0x5bb72a);}return _0x49cfa1;}if(!_[_0xd37a('0x12')](_0x49cfa1)){return _0x49cfa1;}if(_[_0xd37a('0x13')](_0x5bb72a)){_0x5bb72a=[_0x5bb72a];}if(!_[_0xd37a('0x6')](_0x5bb72a)){return _0x49cfa1;}for(var _0x410d75=0x0;_0x410d75<_0x5bb72a[_0xd37a('0x10')];_0x410d75+=0x1){_[_0xd37a('0x14')](_0x49cfa1,_0x5bb72a[_0x410d75]);}for(var _0x2aa290 in _0x49cfa1){if(_0x49cfa1[_0xd37a('0x15')](_0x2aa290)){_0x49cfa1[_0x2aa290]=this[_0xd37a('0x11')](_0x49cfa1[_0x2aa290],_0x5bb72a);}}return _0x49cfa1;};exports['isNumeric']=function(_0x49479d){return _0x49479d[_0xd37a('0x16')](RegExp(_0xd37a('0x17')))?!![]:![];};exports[_0xd37a('0x18')]=function(_0x1487b2){return _0x1487b2[_0xd37a('0x16')](/^\S+@\S+$/)?!![]:![];};exports[_0xd37a('0x19')]=function(_0x599ca0){var _0x1e59b8=[];_0x599ca0[_0xd37a('0x2')]('\x20')[_0xd37a('0x1a')](function(_0x938c4c){_0x1e59b8['push']('+'+_0x938c4c[_0xd37a('0x1b')]()+'*');});return _0x1e59b8['join']('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 8f95d8a..f159cfa 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x207f=['test','join','client','json\x20replacer','toISOString','split','use','get','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment','../mysqldb','env','production','set','root','public'];(function(_0x21a112,_0x55e83d){var _0x50fa1b=function(_0x4fd6aa){while(--_0x4fd6aa){_0x21a112['push'](_0x21a112['shift']());}};_0x50fa1b(++_0x55e83d);}(_0x207f,0x15c));var _0xf207=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x207f[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0xf207('0x0'));var favicon=require(_0xf207('0x1'));var bodyParser=require(_0xf207('0x2'));var methodOverride=require(_0xf207('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xf207('0x4'));var path=require(_0xf207('0x5'));var passport=require(_0xf207('0x6'));var cors=require(_0xf207('0x7'));var moment=require(_0xf207('0x8'));var config=require('./environment');var db=require(_0xf207('0x9'))['db'];exports['default']=function(_0x563313){var _0x29c430=_0x563313['get'](_0xf207('0xa'));if(_0x29c430===_0xf207('0xb')){_0x563313[_0xf207('0xc')]('appPath',path['join'](config[_0xf207('0xd')],_0xf207('0xe')));}if(_0x29c430==='development'||_0x29c430===_0xf207('0xf')){_0x563313[_0xf207('0xc')]('appPath',path[_0xf207('0x10')](config[_0xf207('0xd')],_0xf207('0x11')));_0x563313['use'](errorHandler());}_0x563313[_0xf207('0xc')](_0xf207('0x12'),function(_0x3d7bd5,_0x86bb8a){if(this[_0x3d7bd5]instanceof Date){_0x86bb8a=this[_0x3d7bd5][_0xf207('0x13')]()[_0xf207('0x14')]('.')[0x0]+'Z';}return _0x86bb8a;});_0x563313[_0xf207('0x15')](express['static'](_0x563313[_0xf207('0x16')]('appPath')));_0x563313[_0xf207('0xc')]('views',config[_0xf207('0xd')]+_0xf207('0x17'));_0x563313[_0xf207('0x18')](_0xf207('0x19'),require(_0xf207('0x1a'))[_0xf207('0x1b')]);_0x563313[_0xf207('0xc')](_0xf207('0x1c'),_0xf207('0x19'));_0x563313['use'](bodyParser[_0xf207('0x1d')]({'limit':_0xf207('0x1e'),'extended':!![]}));_0x563313[_0xf207('0x15')](bodyParser[_0xf207('0x1f')]({'limit':_0xf207('0x1e')}));_0x563313[_0xf207('0x15')](cors());_0x563313[_0xf207('0x15')](methodOverride());_0x563313[_0xf207('0x15')](cookieParser());_0x563313[_0xf207('0x15')](passport[_0xf207('0x20')]());}; \ No newline at end of file +var _0x4db7=['urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','moment','../mysqldb','default','env','production','set','appPath','root','public','development','test','join','client','use','json\x20replacer','toISOString','split','get','views','/server/views','engine','ejs','renderFile','view\x20engine','html'];(function(_0x263204,_0x19286b){var _0xed3987=function(_0x282bf1){while(--_0x282bf1){_0x263204['push'](_0x263204['shift']());}};_0xed3987(++_0x19286b);}(_0x4db7,0x88));var _0x74db=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x4db7[_0x7e2eb0];return _0xd92de4;};'use strict';var express=require(_0x74db('0x0'));var favicon=require(_0x74db('0x1'));var bodyParser=require(_0x74db('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x74db('0x3'));var errorHandler=require('errorhandler');var path=require('path');var passport=require('passport');var cors=require('cors');var moment=require(_0x74db('0x4'));var config=require('./environment');var db=require(_0x74db('0x5'))['db'];exports[_0x74db('0x6')]=function(_0x18e880){var _0x2303cd=_0x18e880['get'](_0x74db('0x7'));if(_0x2303cd===_0x74db('0x8')){_0x18e880[_0x74db('0x9')](_0x74db('0xa'),path['join'](config[_0x74db('0xb')],_0x74db('0xc')));}if(_0x2303cd===_0x74db('0xd')||_0x2303cd===_0x74db('0xe')){_0x18e880['set'](_0x74db('0xa'),path[_0x74db('0xf')](config['root'],_0x74db('0x10')));_0x18e880[_0x74db('0x11')](errorHandler());}_0x18e880[_0x74db('0x9')](_0x74db('0x12'),function(_0x2502c0,_0x16127c){if(this[_0x2502c0]instanceof Date){_0x16127c=this[_0x2502c0][_0x74db('0x13')]()[_0x74db('0x14')]('.')[0x0]+'Z';}return _0x16127c;});_0x18e880[_0x74db('0x11')](express['static'](_0x18e880[_0x74db('0x15')](_0x74db('0xa'))));_0x18e880[_0x74db('0x9')](_0x74db('0x16'),config[_0x74db('0xb')]+_0x74db('0x17'));_0x18e880[_0x74db('0x18')]('html',require(_0x74db('0x19'))[_0x74db('0x1a')]);_0x18e880[_0x74db('0x9')](_0x74db('0x1b'),_0x74db('0x1c'));_0x18e880[_0x74db('0x11')](bodyParser[_0x74db('0x1d')]({'limit':_0x74db('0x1e'),'extended':!![]}));_0x18e880[_0x74db('0x11')](bodyParser[_0x74db('0x1f')]({'limit':_0x74db('0x1e')}));_0x18e880[_0x74db('0x11')](cors());_0x18e880[_0x74db('0x11')](methodOverride());_0x18e880['use'](cookieParser());_0x18e880[_0x74db('0x11')](passport[_0x74db('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index bd58eb2..4685b55 100644 --- a/server/config/license/hardware.js +++ b/server/config/license/hardware.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7da7=['crypto','bimedia-machine-uuid','orderBy','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','createHash','md5','digest','hex','getUuid','platform','dmidecode\x20--string\x20system-uuid','replace','update','substring','lodash'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x7da7,0x10d));var _0x77da=function(_0x3be7ff,_0x12e714){_0x3be7ff=_0x3be7ff-0x0;var _0x186721=_0x7da7[_0x3be7ff];return _0x186721;};'use strict';var _=require(_0x77da('0x0'));var os=require('os');var crypto=require(_0x77da('0x1'));var machine=require(_0x77da('0x2'));var exec=require('child_process')['execSync'];function getInterfaces(){var _0x37667b=[];var _0xaaefb1=os['networkInterfaces']();var _0x3a9fa6=_[_0x77da('0x3')](_['keys'](_0xaaefb1));for(var _0x19331c=0x0;_0x19331c<_0x3a9fa6[_0x77da('0x4')];_0x19331c++){var _0x47da81=_0xaaefb1[_0x3a9fa6[_0x19331c]][_0x77da('0x5')](function(_0x47cf1d){return _0x47cf1d[_0x77da('0x6')]===_0x77da('0x7')&&_0x47cf1d[_0x77da('0x8')]===![];});_0x37667b=_0x37667b[_0x77da('0x9')](_0x47da81);}return _0x37667b;}function getFirstInterface(){var _0x252128=_['head'](getInterfaces());return{'macAddress':_0x252128&&_0x252128[_0x77da('0xa')]?_0x252128[_0x77da('0xa')]:_0x77da('0xb'),'ipAddress':_0x252128&&_0x252128['address']?_0x252128[_0x77da('0xc')]:_0x77da('0xd')};}exports[_0x77da('0xe')]=getFirstInterface;function getCPUhash(){var _0x2a675a=_['orderBy'](os[_0x77da('0xf')]()[_0x77da('0x10')](function(_0x2acc65){return _0x2acc65['model'];}))['join'](':');return crypto[_0x77da('0x11')](_0x77da('0x12'))['update'](_0x2a675a)[_0x77da('0x13')](_0x77da('0x14'));}exports[_0x77da('0x15')]=function(){switch(os[_0x77da('0x16')]()){case'win32':return exec(_0x77da('0x17'),{'encoding':'utf8'})[_0x77da('0x18')]('\x0d\x0a','');default:var _0x366443=getFirstInterface();var _0x1b0e17=getCPUhash();var _0x4500c4=_0x1b0e17+'|'+os['hostname']()+'|'+_0x366443['macAddress']+'|'+_0x366443['ipAddress'];var _0x482b87=crypto[_0x77da('0x11')](_0x77da('0x12'))[_0x77da('0x19')](_0x4500c4)[_0x77da('0x13')](_0x77da('0x14'));return _0x482b87[_0x77da('0x1a')](0x0,0x8)+'-'+_0x482b87[_0x77da('0x1a')](0x8,0xc)+'-'+_0x482b87[_0x77da('0x1a')](0xc,0x10)+'-'+_0x482b87['substring'](0x10,0x14)+'-'+_0x482b87['substring'](0x14);}}; \ No newline at end of file +var _0x207c=['macAddress','substring','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','map','join','createHash','md5','update','digest','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','hostname'];(function(_0x5bb7d1,_0x4c675b){var _0x181584=function(_0x509068){while(--_0x509068){_0x5bb7d1['push'](_0x5bb7d1['shift']());}};_0x181584(++_0x4c675b);}(_0x207c,0x1e8));var _0xc207=function(_0x229764,_0x3687f1){_0x229764=_0x229764-0x0;var _0x143dea=_0x207c[_0x229764];return _0x143dea;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xc207('0x0'));var machine=require(_0xc207('0x1'));var exec=require(_0xc207('0x2'))[_0xc207('0x3')];function getInterfaces(){var _0x2b40be=[];var _0x12f1f2=os[_0xc207('0x4')]();var _0x4b9daa=_[_0xc207('0x5')](_['keys'](_0x12f1f2));for(var _0x5a727b=0x0;_0x5a727b<_0x4b9daa['length'];_0x5a727b++){var _0xc88789=_0x12f1f2[_0x4b9daa[_0x5a727b]][_0xc207('0x6')](function(_0x3395e4){return _0x3395e4['family']===_0xc207('0x7')&&_0x3395e4[_0xc207('0x8')]===![];});_0x2b40be=_0x2b40be[_0xc207('0x9')](_0xc88789);}return _0x2b40be;}function getFirstInterface(){var _0x4e10e8=_[_0xc207('0xa')](getInterfaces());return{'macAddress':_0x4e10e8&&_0x4e10e8[_0xc207('0xb')]?_0x4e10e8[_0xc207('0xb')]:_0xc207('0xc'),'ipAddress':_0x4e10e8&&_0x4e10e8[_0xc207('0xd')]?_0x4e10e8[_0xc207('0xd')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x5b556f=_[_0xc207('0x5')](os['cpus']()[_0xc207('0xe')](function(_0x2782ce){return _0x2782ce['model'];}))[_0xc207('0xf')](':');return crypto[_0xc207('0x10')](_0xc207('0x11'))[_0xc207('0x12')](_0x5b556f)[_0xc207('0x13')]('hex');}exports[_0xc207('0x14')]=function(){switch(os[_0xc207('0x15')]()){case _0xc207('0x16'):return exec(_0xc207('0x17'),{'encoding':'utf8'})['replace']('\x0d\x0a','');default:var _0x554e5c=getFirstInterface();var _0x1cebfa=getCPUhash();var _0x6e793d=_0x1cebfa+'|'+os[_0xc207('0x18')]()+'|'+_0x554e5c[_0xc207('0x19')]+'|'+_0x554e5c['ipAddress'];var _0x1bc70c=crypto[_0xc207('0x10')](_0xc207('0x11'))['update'](_0x6e793d)[_0xc207('0x13')]('hex');return _0x1bc70c[_0xc207('0x1a')](0x0,0x8)+'-'+_0x1bc70c[_0xc207('0x1a')](0x8,0xc)+'-'+_0x1bc70c[_0xc207('0x1a')](0xc,0x10)+'-'+_0x1bc70c[_0xc207('0x1a')](0x10,0x14)+'-'+_0x1bc70c[_0xc207('0x1a')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index fee9c59..3dfae92 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07a2=['license','format','%s/api/servers/%s/check?version=%s','then','catch','createCipher','secrets','session','update','utf8','final','createDecipher','aes-256-ctr','base64','||FIELD||VALUE||\x0a','User','findOne','fullname','email','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','crypto','request-promise','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../logger'];(function(_0x21e036,_0x1e27f5){var _0x3d27b2=function(_0x4146da){while(--_0x4146da){_0x21e036['push'](_0x21e036['shift']());}};_0x3d27b2(++_0x1e27f5);}(_0x07a2,0x12c));var _0x207a=function(_0x2b9dcd,_0x3ec18c){_0x2b9dcd=_0x2b9dcd-0x0;var _0x4adb32=_0x07a2[_0x2b9dcd];return _0x4adb32;};'use strict';var util=require(_0x207a('0x0'));var crypto=require(_0x207a('0x1'));var moment=require('moment');var rp=require(_0x207a('0x2'));var BPromise=require(_0x207a('0x3'));var pkginfo=require(_0x207a('0x4'))(module,_0x207a('0x5'));var db=require(_0x207a('0x6'))['db'];var config=require(_0x207a('0x7'));var hardware=require(_0x207a('0x8'));var logger=require(_0x207a('0x9'))(_0x207a('0xa'));var jira=require('../../api/jira/jira.controller');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x18dddc){return new BPromise(function(_0x15d085,_0x7be81c){var _0x2a0b70=util[_0x207a('0xb')](_0x207a('0xc'),HOST,_0x18dddc,module['exports']['version']);if(oldToken){_0x2a0b70=util[_0x207a('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x18dddc,module['exports'][_0x207a('0x5')],oldToken);}var _0x5a7d85={'uri':_0x2a0b70,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5a7d85)[_0x207a('0xd')](function(_0x39950f){_0x15d085(_0x39950f);})[_0x207a('0xe')](function(_0x4da269){_0x7be81c(_0x4da269);});});}function encryptDate(_0x18d39f){var _0x20ce67=crypto[_0x207a('0xf')]('aes-256-ctr',config[_0x207a('0x10')][_0x207a('0x11')]);var _0xae35ec=_0x20ce67[_0x207a('0x12')](_0x18d39f,_0x207a('0x13'),'base64');_0xae35ec+=_0x20ce67[_0x207a('0x14')]('base64');return _0xae35ec;}function decryptDate(_0x201f87){var _0x2fbafd=crypto[_0x207a('0x15')](_0x207a('0x16'),config[_0x207a('0x10')][_0x207a('0x11')]);var _0xd60aa3=_0x2fbafd[_0x207a('0x12')](_0x201f87,_0x207a('0x17'),_0x207a('0x13'));_0xd60aa3+=_0x2fbafd['final'](_0x207a('0x13'));return _0xd60aa3;}function sendJiraAlert(_0x5f575a,_0x3c99fd,_0x28246e){var _0x108c0c=_0x207a('0x18');return db[_0x207a('0x19')][_0x207a('0x1a')]({'where':{'role':'admin'},'attributes':[_0x207a('0x1b'),_0x207a('0x1c')],'raw':!![]})['then'](function(_0xb1171c){ADMIN=_0xb1171c;_0x108c0c+=_0x207a('0x1d')+_0x28246e+'|\x0a';_0x108c0c+=_0x207a('0x1e')+_0x5f575a+'|\x0a';_0x108c0c+=_0x207a('0x1f')+_0x3c99fd+'|\x0a';_0x108c0c+=_0x207a('0x20')+ADMIN[_0x207a('0x1b')]+'|\x0a';_0x108c0c+=_0x207a('0x21')+ADMIN[_0x207a('0x1c')]+'|\x0a';return _0x108c0c;})[_0x207a('0xd')](function(_0x40e812){var _0x391cff=hardware[_0x207a('0x22')]()[_0x207a('0x23')];return jira['openIssue']({'key':_0x207a('0x24'),'summary':_0x207a('0x25'),'description':_0x40e812,'issuetype':_0x207a('0x26'),'oldToken':_0x5f575a,'newToken':_0x3c99fd,'email':ADMIN[_0x207a('0x1c')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x391cff});});}function manageLicense(_0x1bf684,_0x9cae85){var _0x489753=_0x9cae85[_0x207a('0x27')]({'plain':!![]});httpRequest(_0x1bf684)['then'](function(_0x4f09c1){if(oldToken){oldToken=undefined;}if(_0x4f09c1[_0x207a('0x28')]){if(!_0x489753['license']&&_0x489753[_0x207a('0xa')]!=_0x4f09c1[_0x207a('0xa')]||_0x489753['license']&&_0x489753['data2']){logger[_0x207a('0x29')](_0x207a('0x2a'));}if(_0x489753['license']&&!_0x489753['data2']&&_0x489753[_0x207a('0xa')]!=_0x4f09c1[_0x207a('0xa')]){logger[_0x207a('0x29')](_0x207a('0x2b'));}if(_0x489753[_0x207a('0xa')]&&!_0x489753[_0x207a('0x2c')]&&_0x489753[_0x207a('0xa')]==_0x4f09c1['license']){return _0x9cae85;}return _0x9cae85[_0x207a('0x12')]({'data1':_0x1bf684,'data2':null,'license':_0x4f09c1[_0x207a('0xa')]});}else{if(_0x4f09c1[_0x207a('0xa')]||_0x489753['license']){if(!_0x489753['data2']){if(_0x489753['data1']==_0x1bf684){GRAY_PERIOD_REASON='Disabled';logger[_0x207a('0x29')](_0x207a('0x2d'));}else{GRAY_PERIOD_REASON=_0x207a('0x2e');oldToken=_0x489753[_0x207a('0x2f')];logger[_0x207a('0x29')](_0x207a('0x30'),_0x489753[_0x207a('0x2f')],_0x1bf684);}sendJiraAlert(_0x489753[_0x207a('0x2f')],_0x4f09c1[_0x207a('0x31')],GRAY_PERIOD_REASON);logger[_0x207a('0x29')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x207a('0x32')](),moment()[_0x207a('0xb')](_0x207a('0x33')));return _0x9cae85['update']({'data2':encryptDate(moment()['format'](_0x207a('0x33')))});}else{if(moment()[_0x207a('0x34')](decryptDate(_0x489753['data2']),_0x207a('0x35'))>DAYS){logger[_0x207a('0x29')]('DEMO\x20START\x20AT\x20%s',moment()[_0x207a('0xb')](_0x207a('0x33')));return _0x9cae85[_0x207a('0x12')]({'data1':_0x1bf684,'data2':null,'license':null});}}}else{if(_0x489753['data1']!=_0x1bf684){logger[_0x207a('0x29')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x489753['data1'],_0x1bf684);return _0x9cae85[_0x207a('0x12')]({'data1':_0x1bf684,'data2':null,'license':null});}}}return _0x9cae85;})[_0x207a('0xd')](function(_0x4c0137){_0x9cae85=_0x4c0137;})[_0x207a('0xe')](function(_0x35ad58){logger['error'](_0x35ad58[_0x207a('0x36')]);})[_0x207a('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0x207a('0x38')](),_0x9cae85);},TIME);});}function defaultLicense(){var _0x3dc349=hardware[_0x207a('0x38')]();if(_0x3dc349){return db['License'][_0x207a('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x3dc349}})[_0x207a('0x3a')](function(_0xd24dc6,_0xb3ca34){logger[_0x207a('0x29')](_0x207a('0x3b'),_0x3dc349);manageLicense(_0x3dc349,_0xd24dc6);})[_0x207a('0xe')](function(_0x54b21c){logger[_0x207a('0x3c')](_0x54b21c['message']);});}}exports[_0x207a('0x3d')]=defaultLicense; \ No newline at end of file +var _0x9134=['License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','message','default','crypto','moment','request-promise','bluebird','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','then','aes-256-ctr','secrets','session','update','utf8','base64','createDecipher','final','||FIELD||VALUE||\x0a','admin','email','|reason|','|uuid|','|machineUuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data2','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid'];(function(_0x8bc276,_0x33ce4e){var _0x12d273=function(_0x3c6df9){while(--_0x3c6df9){_0x8bc276['push'](_0x8bc276['shift']());}};_0x12d273(++_0x33ce4e);}(_0x9134,0x87));var _0x4913=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9134[_0x2dafbe];return _0x58a45a;};'use strict';var util=require('util');var crypto=require(_0x4913('0x0'));var moment=require(_0x4913('0x1'));var rp=require(_0x4913('0x2'));var BPromise=require(_0x4913('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x4913('0x4'))['db'];var config=require(_0x4913('0x5'));var hardware=require(_0x4913('0x6'));var logger=require(_0x4913('0x7'))(_0x4913('0x8'));var jira=require(_0x4913('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x46e307){return new BPromise(function(_0x177977,_0x16ab4f){var _0x5b3acd=util[_0x4913('0xa')](_0x4913('0xb'),HOST,_0x46e307,module['exports']['version']);if(oldToken){_0x5b3acd=util[_0x4913('0xa')](_0x4913('0xc'),HOST,_0x46e307,module['exports'][_0x4913('0xd')],oldToken);}var _0x1c08ac={'uri':_0x5b3acd,'method':_0x4913('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x1c08ac)[_0x4913('0xf')](function(_0x3c3272){_0x177977(_0x3c3272);})['catch'](function(_0x43fc62){_0x16ab4f(_0x43fc62);});});}function encryptDate(_0x5db460){var _0x23b04f=crypto['createCipher'](_0x4913('0x10'),config[_0x4913('0x11')][_0x4913('0x12')]);var _0x58d537=_0x23b04f[_0x4913('0x13')](_0x5db460,_0x4913('0x14'),'base64');_0x58d537+=_0x23b04f['final'](_0x4913('0x15'));return _0x58d537;}function decryptDate(_0xa6bd33){var _0x270802=crypto[_0x4913('0x16')]('aes-256-ctr',config[_0x4913('0x11')][_0x4913('0x12')]);var _0x59615c=_0x270802[_0x4913('0x13')](_0xa6bd33,'base64',_0x4913('0x14'));_0x59615c+=_0x270802[_0x4913('0x17')]('utf8');return _0x59615c;}function sendJiraAlert(_0x366045,_0x589f35,_0x50584a){var _0x1371fc=_0x4913('0x18');return db['User']['findOne']({'where':{'role':_0x4913('0x19')},'attributes':['fullname',_0x4913('0x1a')],'raw':!![]})[_0x4913('0xf')](function(_0x574b09){ADMIN=_0x574b09;_0x1371fc+=_0x4913('0x1b')+_0x50584a+'|\x0a';_0x1371fc+=_0x4913('0x1c')+_0x366045+'|\x0a';_0x1371fc+=_0x4913('0x1d')+_0x589f35+'|\x0a';_0x1371fc+=_0x4913('0x1e')+ADMIN[_0x4913('0x1f')]+'|\x0a';_0x1371fc+=_0x4913('0x20')+ADMIN[_0x4913('0x1a')]+'|\x0a';return _0x1371fc;})['then'](function(_0x262cab){var _0x53cf21=hardware[_0x4913('0x21')]()[_0x4913('0x22')];return jira[_0x4913('0x23')]({'key':_0x4913('0x24'),'summary':_0x4913('0x25'),'description':_0x262cab,'issuetype':_0x4913('0x26'),'oldToken':_0x366045,'newToken':_0x589f35,'email':ADMIN[_0x4913('0x1a')],'name':ADMIN[_0x4913('0x1f')],'reason':GRAY_PERIOD_REASON,'ip':_0x53cf21});});}function manageLicense(_0x203ba7,_0x40a8b2){var _0x3bb9cd=_0x40a8b2[_0x4913('0x27')]({'plain':!![]});httpRequest(_0x203ba7)['then'](function(_0x412942){if(oldToken){oldToken=undefined;}if(_0x412942[_0x4913('0x28')]){if(!_0x3bb9cd['license']&&_0x3bb9cd[_0x4913('0x8')]!=_0x412942[_0x4913('0x8')]||_0x3bb9cd['license']&&_0x3bb9cd['data2']){logger[_0x4913('0x29')](_0x4913('0x2a'));}if(_0x3bb9cd[_0x4913('0x8')]&&!_0x3bb9cd['data2']&&_0x3bb9cd[_0x4913('0x8')]!=_0x412942[_0x4913('0x8')]){logger[_0x4913('0x29')](_0x4913('0x2b'));}if(_0x3bb9cd[_0x4913('0x8')]&&!_0x3bb9cd[_0x4913('0x2c')]&&_0x3bb9cd[_0x4913('0x8')]==_0x412942[_0x4913('0x8')]){return _0x40a8b2;}return _0x40a8b2[_0x4913('0x13')]({'data1':_0x203ba7,'data2':null,'license':_0x412942[_0x4913('0x8')]});}else{if(_0x412942[_0x4913('0x8')]||_0x3bb9cd[_0x4913('0x8')]){if(!_0x3bb9cd[_0x4913('0x2c')]){if(_0x3bb9cd[_0x4913('0x2d')]==_0x203ba7){GRAY_PERIOD_REASON='Disabled';logger[_0x4913('0x29')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x3bb9cd[_0x4913('0x2d')];logger[_0x4913('0x29')](_0x4913('0x2e'),_0x3bb9cd[_0x4913('0x2d')],_0x203ba7);}sendJiraAlert(_0x3bb9cd[_0x4913('0x2d')],_0x412942[_0x4913('0x2f')],GRAY_PERIOD_REASON);logger[_0x4913('0x29')](_0x4913('0x30'),GRAY_PERIOD_REASON[_0x4913('0x31')](),moment()[_0x4913('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x40a8b2[_0x4913('0x13')]({'data2':encryptDate(moment()['format'](_0x4913('0x32')))});}else{if(moment()[_0x4913('0x33')](decryptDate(_0x3bb9cd['data2']),_0x4913('0x34'))>DAYS){logger[_0x4913('0x29')](_0x4913('0x35'),moment()[_0x4913('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x40a8b2[_0x4913('0x13')]({'data1':_0x203ba7,'data2':null,'license':null});}}}else{if(_0x3bb9cd[_0x4913('0x2d')]!=_0x203ba7){logger['info'](_0x4913('0x2e'),_0x3bb9cd['data1'],_0x203ba7);return _0x40a8b2[_0x4913('0x13')]({'data1':_0x203ba7,'data2':null,'license':null});}}}return _0x40a8b2;})['then'](function(_0x522c0d){_0x40a8b2=_0x522c0d;})['catch'](function(_0x389909){logger[_0x4913('0x36')](_0x389909['message']);})[_0x4913('0x37')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x40a8b2);},TIME);});}function defaultLicense(){var _0x46351e=hardware[_0x4913('0x38')]();if(_0x46351e){return db[_0x4913('0x39')][_0x4913('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x46351e}})[_0x4913('0x3b')](function(_0x328815,_0x166b23){logger[_0x4913('0x29')](_0x4913('0x3c'),_0x46351e);manageLicense(_0x46351e,_0x328815);})[_0x4913('0x3d')](function(_0x46f786){logger['error'](_0x46f786[_0x4913('0x3e')]);});}}exports[_0x4913('0x3f')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 0f2c842..0243cc4 100644 --- a/server/config/license/util.js +++ b/server/config/license/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a7=['util','lodash','./hardware','../environment','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','parse','uuid','machineUuid','getUuid','session','gray','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getLicense','License','find','then'];(function(_0x53aecd,_0x3d159f){var _0x13992c=function(_0x17ebc5){while(--_0x17ebc5){_0x53aecd['push'](_0x53aecd['shift']());}};_0x13992c(++_0x3d159f);}(_0xd4a7,0xb9));var _0x7d4a=function(_0x4acf24,_0xa8fa27){_0x4acf24=_0x4acf24-0x0;var _0x141f73=_0xd4a7[_0x4acf24];return _0x141f73;};'use strict';var crypto=require('crypto');var util=require(_0x7d4a('0x0'));var _=require(_0x7d4a('0x1'));var moment=require('moment');var hardware=require(_0x7d4a('0x2'));var config=require(_0x7d4a('0x3'));var db=require(_0x7d4a('0x4'))['db'];function checkLicense(_0x4ef8c3,_0x50f33a){if(_0x4ef8c3){try{var _0x137580=_0x50f33a||_0x4ef8c3['license'];if(_[_0x7d4a('0x5')](_0x137580)){throw new Error(_0x7d4a('0x6'));}var _0x2d234d=_0x4ef8c3[_0x7d4a('0x7')];var _0x520907=_0x4ef8c3[_0x7d4a('0x8')];var _0x4ffbda=_0x2d234d['split']('-')[0x4];var _0x2a3211=_0x2d234d[_0x7d4a('0x9')]('-')[0x0];var _0x32cb59=crypto[_0x7d4a('0xa')](_0x7d4a('0xb'),util['format'](_0x7d4a('0xc'),_0x4ffbda,_0x2d234d,_0x2a3211));var _0xd1c7c8=_0x32cb59[_0x7d4a('0xd')](_0x137580,_0x7d4a('0xe'),_0x7d4a('0xf'));_0xd1c7c8+=_0x32cb59[_0x7d4a('0x10')](_0x7d4a('0xf'));var _0x102c7d=JSON[_0x7d4a('0x11')](_0xd1c7c8);_0x102c7d['demo']=![];_0x102c7d[_0x7d4a('0x12')]=_0x2d234d;_0x102c7d[_0x7d4a('0x13')]=hardware[_0x7d4a('0x14')]();if(_0x520907){var _0x578009=crypto[_0x7d4a('0xa')](_0x7d4a('0xb'),config['secrets'][_0x7d4a('0x15')]);var _0x4f6b10=_0x578009[_0x7d4a('0xd')](_0x520907,'base64',_0x7d4a('0xf'));_0x4f6b10+=_0x578009[_0x7d4a('0x10')](_0x7d4a('0xf'));_0x102c7d[_0x7d4a('0x16')]=_0x4f6b10;_0x102c7d[_0x7d4a('0x17')]=moment(_0x4f6b10)[_0x7d4a('0x18')](0x7,_0x7d4a('0x19'))['format']();_0x102c7d[_0x7d4a('0x1a')]=_0x102c7d[_0x7d4a('0x12')]!=_0x102c7d[_0x7d4a('0x13')]?_0x7d4a('0x1b'):_0x7d4a('0x1c');}return _0x102c7d;}catch(_0x321105){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7d4a('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7d4a('0x1e'),'uuid':_0x4ef8c3[_0x7d4a('0x7')],'machineUuid':hardware[_0x7d4a('0x14')](),'message':_0x321105[_0x7d4a('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7d4a('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7d4a('0x20'),'uuid':_0x4ef8c3[_0x7d4a('0x7')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x7d4a('0x21')]=function(_0x4ce96d){return db[_0x7d4a('0x22')][_0x7d4a('0x23')](_['defaults'](_0x4ce96d,{'raw':!![],'where':{'id':0x1}}))[_0x7d4a('0x24')](function(_0x34e2da){return checkLicense(_0x34e2da,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0x4a2f=['checkLicense','crypto','util','moment','./hardware','../environment','license','License\x20key\x20value\x20not\x20found','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','demo','uuid','getUuid','createDecipher','secrets','session','deadline','add','changed','disabled','2027-01-01T00:00:00.000Z','message','Demo\x20license','find','then'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x4a2f,0x1c1));var _0xf4a2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4a2f[_0xfae23b];return _0x200640;};'use strict';var crypto=require(_0xf4a2('0x0'));var util=require(_0xf4a2('0x1'));var _=require('lodash');var moment=require(_0xf4a2('0x2'));var hardware=require(_0xf4a2('0x3'));var config=require(_0xf4a2('0x4'));var db=require('../../mysqldb')['db'];function checkLicense(_0x5e17af,_0x562a90){if(_0x5e17af){try{var _0x31c993=_0x562a90||_0x5e17af[_0xf4a2('0x5')];if(_['isEmpty'](_0x31c993)){throw new Error(_0xf4a2('0x6'));}var _0x59296b=_0x5e17af[_0xf4a2('0x7')];var _0x4c565a=_0x5e17af['data2'];var _0x3a061c=_0x59296b[_0xf4a2('0x8')]('-')[0x4];var _0x2cd3d9=_0x59296b[_0xf4a2('0x8')]('-')[0x0];var _0x52f369=crypto['createDecipher'](_0xf4a2('0x9'),util[_0xf4a2('0xa')](_0xf4a2('0xb'),_0x3a061c,_0x59296b,_0x2cd3d9));var _0xab2c77=_0x52f369[_0xf4a2('0xc')](_0x31c993,_0xf4a2('0xd'),_0xf4a2('0xe'));_0xab2c77+=_0x52f369[_0xf4a2('0xf')]('utf8');var _0x4b6b0e=JSON['parse'](_0xab2c77);_0x4b6b0e[_0xf4a2('0x10')]=![];_0x4b6b0e[_0xf4a2('0x11')]=_0x59296b;_0x4b6b0e['machineUuid']=hardware[_0xf4a2('0x12')]();if(_0x4c565a){var _0x4f8c16=crypto[_0xf4a2('0x13')](_0xf4a2('0x9'),config[_0xf4a2('0x14')][_0xf4a2('0x15')]);var _0xae7fac=_0x4f8c16[_0xf4a2('0xc')](_0x4c565a,_0xf4a2('0xd'),_0xf4a2('0xe'));_0xae7fac+=_0x4f8c16['final']('utf8');_0x4b6b0e['gray']=_0xae7fac;_0x4b6b0e[_0xf4a2('0x16')]=moment(_0xae7fac)[_0xf4a2('0x17')](0x7,'days')['format']();_0x4b6b0e['grayReason']=_0x4b6b0e[_0xf4a2('0x11')]!=_0x4b6b0e['machineUuid']?_0xf4a2('0x18'):_0xf4a2('0x19');}return _0x4b6b0e;}catch(_0xa1a70f){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf4a2('0x1a'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x5e17af['data1'],'machineUuid':hardware[_0xf4a2('0x12')](),'message':_0xa1a70f[_0xf4a2('0x1b')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf4a2('0x1a'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xf4a2('0x1c'),'uuid':_0x5e17af['data1'],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x54f7bf){return db['License'][_0xf4a2('0x1d')](_['defaults'](_0x54f7bf,{'raw':!![],'where':{'id':0x1}}))[_0xf4a2('0x1e')](function(_0x2d835d){return checkLicense(_0x2d835d,null);});};exports[_0xf4a2('0x1f')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 4b49d9f..1efb48c 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ae2=['http://localhost:9000','app-id','exports'];(function(_0x2629e2,_0x2281fb){var _0xd2aec6=function(_0xbf9069){while(--_0xbf9069){_0x2629e2['push'](_0x2629e2['shift']());}};_0xd2aec6(++_0x2281fb);}(_0x8ae2,0x143));var _0x28ae=function(_0x34534b,_0x3fcc62){_0x34534b=_0x34534b-0x0;var _0x5e0cd4=_0x8ae2[_0x34534b];return _0x5e0cd4;};'use strict';module[_0x28ae('0x0')]={'DOMAIN':_0x28ae('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x28ae('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x5f83=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x2ece62,_0x5ef756){var _0x1bd554=function(_0x3dc8e0){while(--_0x3dc8e0){_0x2ece62['push'](_0x2ece62['shift']());}};_0x1bd554(++_0x5ef756);}(_0x5f83,0x120));var _0x35f8=function(_0x308643,_0x584512){_0x308643=_0x308643-0x0;var _0x2fc6d9=_0x5f83[_0x308643];return _0x2fc6d9;};'use strict';module[_0x35f8('0x0')]={'DOMAIN':_0x35f8('0x1'),'SESSION_SECRET':_0x35f8('0x2'),'GOOGLE_ID':_0x35f8('0x3'),'GOOGLE_SECRET':_0x35f8('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 1017cd3..dbb682d 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd76=['level','toUpperCase','transports','File','%s-%s','error','info','debugLevel','moment','winston','util','path','INFO','/var','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x22c8b1,_0x9915be){var _0x31360c=function(_0x45f740){while(--_0x45f740){_0x22c8b1['push'](_0x22c8b1['shift']());}};_0x31360c(++_0x9915be);}(_0xbd76,0x138));var _0x6bd7=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xbd76[_0x413feb];return _0x40ee88;};'use strict';var moment=require(_0x6bd7('0x0'));var winston=require(_0x6bd7('0x1'));var util=require(_0x6bd7('0x2'));var path=require(_0x6bd7('0x3'));var debugLevel=_0x6bd7('0x4');function filename(_0x5df539,_0x212385){return path['join'](_0x6bd7('0x5'),'log',_0x6bd7('0x6'),util[_0x6bd7('0x7')](_0x6bd7('0x8'),_0x5df539,_0x212385));}function formatter(_0x33e9c5,_0x33e6d8){return util[_0x6bd7('0x7')](_0x6bd7('0x9'),moment()[_0x6bd7('0x7')](_0x6bd7('0xa')),_0x33e6d8[_0x6bd7('0xb')][_0x6bd7('0xc')](),_0x33e9c5,_0x33e6d8['message']);}module['exports']=function(_0x1286bf){return new winston['Logger']({'transports':[new winston[(_0x6bd7('0xd'))][(_0x6bd7('0xe'))]({'name':util['format'](_0x6bd7('0xf'),_0x1286bf,_0x6bd7('0x10')),'filename':filename(_0x1286bf,_0x6bd7('0x10')),'level':_0x6bd7('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x50190d){return formatter(_0x1286bf,_0x50190d);}}),new winston[(_0x6bd7('0xd'))][(_0x6bd7('0xe'))]({'name':util[_0x6bd7('0x7')]('%s-%s',_0x1286bf,_0x6bd7('0x11')),'filename':filename(_0x1286bf,_0x6bd7('0x11')),'level':_0x6bd7('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x27aa30){return formatter(_0x1286bf,_0x27aa30);}}),new winston[(_0x6bd7('0xd'))]['Console']({'level':process['env'][_0x6bd7('0x12')]||debugLevel,'json':![],'formatter':function(_0x2b93c7){return formatter(_0x1286bf,_0x2b93c7);}})]});}; \ No newline at end of file +var _0x8211=['util','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','message','Logger','transports','File','%s-%s','error','info','env','debugLevel','moment','winston'];(function(_0x3ca8f4,_0x246978){var _0x31e746=function(_0x169aff){while(--_0x169aff){_0x3ca8f4['push'](_0x3ca8f4['shift']());}};_0x31e746(++_0x246978);}(_0x8211,0x17a));var _0x1821=function(_0x2ec006,_0x1c44b9){_0x2ec006=_0x2ec006-0x0;var _0x1606ed=_0x8211[_0x2ec006];return _0x1606ed;};'use strict';var moment=require(_0x1821('0x0'));var winston=require(_0x1821('0x1'));var util=require(_0x1821('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x13e6d9,_0x57ac80){return path['join'](_0x1821('0x3'),_0x1821('0x4'),_0x1821('0x5'),util[_0x1821('0x6')](_0x1821('0x7'),_0x13e6d9,_0x57ac80));}function formatter(_0x37311c,_0x361039){return util[_0x1821('0x6')](_0x1821('0x8'),moment()[_0x1821('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x361039['level'][_0x1821('0x9')](),_0x37311c,_0x361039[_0x1821('0xa')]);}module['exports']=function(_0xe14fe2){return new winston[(_0x1821('0xb'))]({'transports':[new winston[(_0x1821('0xc'))][(_0x1821('0xd'))]({'name':util[_0x1821('0x6')](_0x1821('0xe'),_0xe14fe2,_0x1821('0xf')),'filename':filename(_0xe14fe2,_0x1821('0xf')),'level':_0x1821('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1a95bd){return formatter(_0xe14fe2,_0x1a95bd);}}),new winston[(_0x1821('0xc'))][(_0x1821('0xd'))]({'name':util[_0x1821('0x6')](_0x1821('0xe'),_0xe14fe2,'info'),'filename':filename(_0xe14fe2,_0x1821('0x10')),'level':_0x1821('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x52721a){return formatter(_0xe14fe2,_0x52721a);}}),new winston['transports']['Console']({'level':process[_0x1821('0x11')][_0x1821('0x12')]||debugLevel,'json':![],'formatter':function(_0x3a4878){return formatter(_0xe14fe2,_0x3a4878);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d520a53..332eb93 100644 --- a/server/config/pm2/config.js +++ b/server/config/pm2/config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x928d=['join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x928d,0x1cd));var _0xd928=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x928d[_0x27af45];return _0x18df21;};'use strict';var path=require(_0xd928('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xd928('0x1')](__dirname,_0xd928('0x2'))},{'name':_0xd928('0x3'),'script':path['join'](__dirname,_0xd928('0x4'))},{'name':_0xd928('0x5'),'script':path[_0xd928('0x1')](__dirname,_0xd928('0x6'))},{'name':'email','script':path['join'](__dirname,_0xd928('0x7'))},{'name':_0xd928('0x8'),'script':path[_0xd928('0x1')](__dirname,'../../services/routing/index.js')},{'name':_0xd928('0x9'),'script':path['join'](__dirname,_0xd928('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0x5580=['email','../../services/email/index.js','path','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5580,0x102));var _0x0558=function(_0x48e9a6,_0x18db74){_0x48e9a6=_0x48e9a6-0x0;var _0x594305=_0x5580[_0x48e9a6];return _0x594305;};'use strict';var path=require(_0x0558('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x0558('0x1')](__dirname,_0x0558('0x2'))},{'name':_0x0558('0x3'),'script':path['join'](__dirname,_0x0558('0x4'))},{'name':'agi','script':path[_0x0558('0x1')](__dirname,_0x0558('0x5'))},{'name':_0x0558('0x6'),'script':path[_0x0558('0x1')](__dirname,_0x0558('0x7'))},{'name':'routing','script':path['join'](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0x0558('0x1')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8a12334..9edaa2e 100644 --- a/server/config/pm2/index.js +++ b/server/config/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61b8=['connected','start','disconnect','stop','then','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x61b8,0x169));var _0x861b=function(_0x19166f,_0x3454a1){_0x19166f=_0x19166f-0x0;var _0x1c6b34=_0x61b8[_0x19166f];return _0x1c6b34;};'use strict';var pm2=require(_0x861b('0x0'));var BPromise=require(_0x861b('0x1'));var config=require(_0x861b('0x2'));function connect(){return new BPromise(function(_0x5da6a0,_0x2dc7a0){return pm2['connect'](function(_0x542fea){if(_0x542fea){return _0x2dc7a0(_0x542fea);}return _0x5da6a0(_0x861b('0x3'));});});};exports[_0x861b('0x4')]=function(_0x4b139c){return connect()['then'](function(){return new BPromise(function(_0x160455,_0x422a5f){return pm2[_0x861b('0x4')](_0x4b139c,function(_0x143f58,_0x186952){if(_0x143f58){return _0x422a5f(_0x143f58);}pm2[_0x861b('0x5')]();return _0x160455(_0x186952);});});});};exports[_0x861b('0x6')]=function(_0x41a4c5){return connect()[_0x861b('0x7')](function(){return new BPromise(function(_0x421d4f,_0x45c39d){return pm2['stop'](_0x41a4c5,function(_0xdc4df8,_0x23a689){if(_0xdc4df8){return _0x45c39d(_0xdc4df8);}pm2[_0x861b('0x5')]();return _0x421d4f(_0x23a689);});});});};exports['restart']=function(_0x1e1eec){return connect()['then'](function(){return new BPromise(function(_0x3450f6,_0xd7656){return pm2['restart'](_0x1e1eec,function(_0x3edc30,_0x16eb59){if(_0x3edc30){return _0xd7656(_0x3edc30);}pm2[_0x861b('0x5')]();return _0x3450f6(_0x16eb59);});});});};exports[_0x861b('0x8')]=function(){return connect()[_0x861b('0x7')](function(){return new BPromise(function(_0xff4c8c,_0x245c41){return pm2[_0x861b('0x8')](function(_0x44b444,_0x226ee9){if(_0x44b444){return _0x245c41(_0x44b444);}pm2[_0x861b('0x5')]();return _0xff4c8c(_0x226ee9);});});});};exports[_0x861b('0x9')]=function(_0x264ba1){return connect()[_0x861b('0x7')](function(){return new BPromise(function(_0x437bbd,_0x3dbd5e){return pm2['describe'](_0x264ba1,function(_0x18b1d7,_0x5a4542){if(_0x18b1d7){return _0x3dbd5e(_0x18b1d7);}pm2['disconnect']();return _0x437bbd(_0x5a4542);});});});};exports[_0x861b('0xa')]=function(_0x496221){return connect()[_0x861b('0x7')](function(){return new BPromise(function(_0x189813,_0x4aafa8){return pm2[_0x861b('0xa')](_0x496221,function(_0x276493,_0x3b9740){if(_0x276493){return _0x4aafa8(_0x276493);}pm2[_0x861b('0x5')]();return _0x189813(_0x3b9740);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x156d25,_0x426a99){return pm2[_0x861b('0xb')](function(_0x4e76a3){if(_0x4e76a3){return _0x426a99(_0x4e76a3);}return _0x156d25(_0x861b('0xc'));});});});}; \ No newline at end of file +var _0xaeba=['saved','pm2','bluebird','./config','connect','connected','then','start','stop','restart','list','describe','disconnect','dump'];(function(_0x330bb0,_0x4f695f){var _0x442278=function(_0x52d830){while(--_0x52d830){_0x330bb0['push'](_0x330bb0['shift']());}};_0x442278(++_0x4f695f);}(_0xaeba,0x1cf));var _0xaaeb=function(_0x7a3b85,_0x11cb4a){_0x7a3b85=_0x7a3b85-0x0;var _0xad122b=_0xaeba[_0x7a3b85];return _0xad122b;};'use strict';var pm2=require(_0xaaeb('0x0'));var BPromise=require(_0xaaeb('0x1'));var config=require(_0xaaeb('0x2'));function connect(){return new BPromise(function(_0x57e8fd,_0x4915df){return pm2[_0xaaeb('0x3')](function(_0x3fa49d){if(_0x3fa49d){return _0x4915df(_0x3fa49d);}return _0x57e8fd(_0xaaeb('0x4'));});});};exports['start']=function(_0x3132df){return connect()[_0xaaeb('0x5')](function(){return new BPromise(function(_0x53b0a5,_0x2f7c85){return pm2[_0xaaeb('0x6')](_0x3132df,function(_0x187c3f,_0x14c398){if(_0x187c3f){return _0x2f7c85(_0x187c3f);}pm2['disconnect']();return _0x53b0a5(_0x14c398);});});});};exports['stop']=function(_0x5c3021){return connect()[_0xaaeb('0x5')](function(){return new BPromise(function(_0x4661ad,_0x430d59){return pm2[_0xaaeb('0x7')](_0x5c3021,function(_0x3cb604,_0x4fdf35){if(_0x3cb604){return _0x430d59(_0x3cb604);}pm2['disconnect']();return _0x4661ad(_0x4fdf35);});});});};exports[_0xaaeb('0x8')]=function(_0x35594a){return connect()['then'](function(){return new BPromise(function(_0x25df86,_0xfdb926){return pm2[_0xaaeb('0x8')](_0x35594a,function(_0x37d942,_0x132881){if(_0x37d942){return _0xfdb926(_0x37d942);}pm2['disconnect']();return _0x25df86(_0x132881);});});});};exports[_0xaaeb('0x9')]=function(){return connect()[_0xaaeb('0x5')](function(){return new BPromise(function(_0x26e08a,_0x225d1d){return pm2[_0xaaeb('0x9')](function(_0x3981d0,_0x3e32ed){if(_0x3981d0){return _0x225d1d(_0x3981d0);}pm2['disconnect']();return _0x26e08a(_0x3e32ed);});});});};exports[_0xaaeb('0xa')]=function(_0x550f63){return connect()[_0xaaeb('0x5')](function(){return new BPromise(function(_0xeae02a,_0x9a805b){return pm2['describe'](_0x550f63,function(_0x529207,_0x4add51){if(_0x529207){return _0x9a805b(_0x529207);}pm2[_0xaaeb('0xb')]();return _0xeae02a(_0x4add51);});});});};exports['delete']=function(_0xd43a3){return connect()[_0xaaeb('0x5')](function(){return new BPromise(function(_0x4ae16c,_0x3c4433){return pm2['delete'](_0xd43a3,function(_0x131cce,_0x37ce29){if(_0x131cce){return _0x3c4433(_0x131cce);}pm2['disconnect']();return _0x4ae16c(_0x37ce29);});});});};exports[_0xaaeb('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x41391e,_0xe69893){return pm2['dump'](function(_0xf67866){if(_0xf67866){return _0xe69893(_0xf67866);}return _0x41391e(_0xaaeb('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 4680de8..2b1b01d 100644 --- a/server/config/schedule/chat.js +++ b/server/config/schedule/chat.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27fe=['../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','start','lodash','moment','ioredis'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0x27fe,0x1c9));var _0xe27f=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x27fe[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0xe27f('0x0'));var moment=require(_0xe27f('0x1'));var Redis=require(_0xe27f('0x2'));var db=require(_0xe27f('0x3'))['db'];var config=require(_0xe27f('0x4'));config[_0xe27f('0x5')]=_[_0xe27f('0x6')](config[_0xe27f('0x5')],{'host':_0xe27f('0x7'),'port':0x18eb});var io=require(_0xe27f('0x8'))(new Redis(config[_0xe27f('0x5')]));function closeInteractions(){var _0x517ff4=0x0;var _0x51e13b=[];return db['Setting'][_0xe27f('0x9')]({'raw':!![],'attributes':['id',_0xe27f('0xa')],'where':{'id':0x1}})[_0xe27f('0xb')](function(_0x3a7379){_0x517ff4=_0x3a7379['chatTimeout'];if(_0x517ff4){return db[_0xe27f('0xc')][_0xe27f('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe27f('0xe')](_0x3a7379[_0xe27f('0xa')],_0xe27f('0xf'))}}});}else{return[];}})[_0xe27f('0xb')](function(_0x3a7ce2){_0x51e13b=_0x3a7ce2;if(_0x517ff4){return db[_0xe27f('0xc')][_0xe27f('0x10')]({'closeReason':_0xe27f('0x11'),'disposition':_0xe27f('0x12'),'closed':!![],'closedAt':moment()[_0xe27f('0x13')](_0xe27f('0x14'))},{'where':{'id':_['map'](_0x51e13b||[],'id')}});}})[_0xe27f('0xb')](function(_0x5dac25){for(var _0x120fe7=0x0;_0x120fe7<_0x51e13b['length'];_0x120fe7++){io['emit'](_0xe27f('0x15'),{'id':_0x51e13b[_0x120fe7]['id'],'closed':!![]});}})['catch'](function(_0x3b91d2){console['error'](_0x3b91d2);});}exports[_0xe27f('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x046b=['findAll','lastMsgAt','subtract','ChatInteraction','update','system','timeout','format','map','length','chatInteraction:update','catch','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','defaults','redis','localhost','socket.io-emitter','Setting','find','then','chatTimeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x046b,0x8f));var _0xb046=function(_0x22b9b7,_0x203492){_0x22b9b7=_0x22b9b7-0x0;var _0xbd7673=_0x046b[_0x22b9b7];return _0xbd7673;};'use strict';var _=require(_0xb046('0x0'));var moment=require(_0xb046('0x1'));var Redis=require(_0xb046('0x2'));var db=require(_0xb046('0x3'))['db'];var config=require(_0xb046('0x4'));config['redis']=_[_0xb046('0x5')](config[_0xb046('0x6')],{'host':_0xb046('0x7'),'port':0x18eb});var io=require(_0xb046('0x8'))(new Redis(config[_0xb046('0x6')]));function closeInteractions(){var _0x536b19=0x0;var _0x2418be=[];return db[_0xb046('0x9')][_0xb046('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xb046('0xb')](function(_0x332db5){_0x536b19=_0x332db5[_0xb046('0xc')];if(_0x536b19){return db['ChatInteraction'][_0xb046('0xd')]({'raw':!![],'attributes':['id',_0xb046('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb046('0xf')](_0x332db5[_0xb046('0xc')],'minutes')}}});}else{return[];}})['then'](function(_0x217c86){_0x2418be=_0x217c86;if(_0x536b19){return db[_0xb046('0x10')][_0xb046('0x11')]({'closeReason':_0xb046('0x12'),'disposition':_0xb046('0x13'),'closed':!![],'closedAt':moment()[_0xb046('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0xb046('0x15')](_0x2418be||[],'id')}});}})[_0xb046('0xb')](function(_0x158e3f){for(var _0x4de076=0x0;_0x4de076<_0x2418be[_0xb046('0x16')];_0x4de076++){io['emit'](_0xb046('0x17'),{'id':_0x2418be[_0x4de076]['id'],'closed':!![]});}})[_0xb046('0x18')](function(_0x23dc62){console['error'](_0x23dc62);});}exports[_0xb046('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 3d49ba8..b50143d 100644 --- a/server/config/schedule/index.js +++ b/server/config/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcdc=['stop','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','deleteJob','update','update\x20cron','stop\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','email','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','format','basename','savename','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','error\x20mail','email\x20sent','error','data','subtractNumber','isNil','subtractUnit\x20null\x20or\x20undefined','scheduled','output','DefaultReportId','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','keyBy','toString','difference','intersection','length','exists'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdcdc,0x17a));var _0xcdcd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdcdc[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var util=require(_0xcdcd('0x0'));var path=require(_0xcdcd('0x1'));var _=require(_0xcdcd('0x2'));var moment=require(_0xcdcd('0x3'));var CronJobManager=require(_0xcdcd('0x4'));var jayson=require(_0xcdcd('0x5'));var BPromise=require('bluebird');var logger=require(_0xcdcd('0x6'))(_0xcdcd('0x7'));var db=require(_0xcdcd('0x8'))['db'];var analyticCustomReportController=require(_0xcdcd('0x9'));var analyticDefaultReportController=require(_0xcdcd('0xa'));var client=jayson['client'][_0xcdcd('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x6cc54,_0xe0cc74){return function(){logger['info'](_0xcdcd('0xc'),_0x6cc54['email']);var _0x3d87ed=!![];var _0x1d83e4={'tls':{'rejectUnauthorized':![]}};if(_0x6cc54[_0xcdcd('0xd')][_0xcdcd('0xe')][_0xcdcd('0xf')]){_0x1d83e4[_0xcdcd('0xf')]=_0x6cc54['MailAccount'][_0xcdcd('0xe')]['service'];}else{_0x1d83e4['host']=_0x6cc54[_0xcdcd('0xd')][_0xcdcd('0xe')][_0xcdcd('0x10')];_0x1d83e4[_0xcdcd('0x11')]=_0x6cc54[_0xcdcd('0xd')][_0xcdcd('0xe')]['port'];_0x1d83e4['secure']=_0x6cc54[_0xcdcd('0xd')][_0xcdcd('0xe')][_0xcdcd('0x12')];}if(_0x6cc54[_0xcdcd('0xd')][_0xcdcd('0xe')][_0xcdcd('0x13')]){_0x1d83e4[_0xcdcd('0x14')]={'user':_0x6cc54['MailAccount'][_0xcdcd('0xe')][_0xcdcd('0x15')],'pass':_0x6cc54[_0xcdcd('0xd')]['Smtp'][_0xcdcd('0x16')]};}var _0x93aa22={'account':_0x1d83e4,'message':{'from':util['format'](_0xcdcd('0x17'),_0x6cc54[_0xcdcd('0xd')][_0xcdcd('0x18')],_0x6cc54[_0xcdcd('0xd')]['email']||_0x6cc54[_0xcdcd('0xd')][_0xcdcd('0xe')][_0xcdcd('0x15')]),'to':_0x6cc54[_0xcdcd('0x19')],'cc':_0x6cc54['cc'],'bcc':_0x6cc54['bcc'],'subject':util['format'](_0xcdcd('0x1a'),_0xe0cc74['name'],_0x6cc54['subtractNumber'],_0x6cc54[_0xcdcd('0x1b')])}};var _0x5b1335=path[_0xcdcd('0x1c')](__dirname,_0xcdcd('0x1d'));var _0x23845b=_0xe0cc74['savename'];var _0x27bdf4=util[_0xcdcd('0x1e')]('%s.%s',path[_0xcdcd('0x1f')](_0xe0cc74[_0xcdcd('0x20')],path['extname'](_0xe0cc74[_0xcdcd('0x20')])),'zip');var _0x4dc391=path[_0xcdcd('0x1c')](_0x5b1335,_0x23845b);var _0x534ed4=path[_0xcdcd('0x1c')](_0x5b1335,_0x27bdf4);if(fs['existsSync'](_0x4dc391)){_0xe0cc74[_0xcdcd('0x21')]='Sent';_0x93aa22[_0xcdcd('0x22')][_0xcdcd('0x23')]=[{'filename':_0x23845b,'path':_0x4dc391}];_0x93aa22[_0xcdcd('0x22')][_0xcdcd('0x24')]=util[_0xcdcd('0x1e')](_0xcdcd('0x25'),JSON[_0xcdcd('0x26')](_0xe0cc74,null,0x2));}else if(fs[_0xcdcd('0x27')](_0x534ed4)){_0xe0cc74['status']=_0xcdcd('0x28');_0x93aa22['message']['attachments']=[{'filename':_0x27bdf4,'path':_0x534ed4}];}else{_0x93aa22[_0xcdcd('0x22')][_0xcdcd('0x24')]=_0xcdcd('0x29');if(!_0x6cc54[_0xcdcd('0x2a')]){_0x3d87ed=![];logger[_0xcdcd('0x2b')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3d87ed){return client[_0xcdcd('0x2c')](_0xcdcd('0x2d'),_0x93aa22)['then'](function(_0x414274){if(_0x414274['error']){return logger['error'](_0xcdcd('0x2e'),JSON[_0xcdcd('0x26')](_0x414274));}return logger[_0xcdcd('0x2b')](_0xcdcd('0x2f'));})['catch'](function(_0x8d3393){return logger[_0xcdcd('0x30')](_0xcdcd('0x2e'),JSON[_0xcdcd('0x26')](_0x8d3393));});}};}function handleError(){return function(_0x13c3ad){return logger['error'](JSON[_0xcdcd('0x26')](_0x13c3ad));};}function handleResult(_0x57541a){return function(_0x3c4fce){logger[_0xcdcd('0x2b')](_0xcdcd('0x31'),JSON[_0xcdcd('0x26')](_0x3c4fce));if(_0x57541a[_0xcdcd('0xd')]&&_0x57541a[_0xcdcd('0xd')][_0xcdcd('0xe')]&&!_['isNil'](_0x57541a[_0xcdcd('0x19')])){setTimeout(handleSendEmail(_0x57541a,_0x3c4fce),0x3c*0x3e8);}};}function handleJob(_0x3675f8){return function(){try{if(_['isNil'](_0x3675f8[_0xcdcd('0x32')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xcdcd('0x33')](_0x3675f8[_0xcdcd('0x1b')])){return logger[_0xcdcd('0x2b')](_0xcdcd('0x34'));}var _0x13ce2f={'startDate':moment()['subtract'](_0x3675f8[_0xcdcd('0x32')],_0x3675f8['subtractUnit'])[_0xcdcd('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xcdcd('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xcdcd('0x35'),'output':_0x3675f8[_0xcdcd('0x36')],'name':_0x3675f8['name']};if(!_[_0xcdcd('0x33')](_0x3675f8[_0xcdcd('0x37')])){logger[_0xcdcd('0x2b')]('exec\x20defaul\x20report\x20id:%s',_0x3675f8[_0xcdcd('0x37')]);return analyticDefaultReportController['runReport']({'id':_0x3675f8['DefaultReportId']},_0x13ce2f)[_0xcdcd('0x38')](handleResult(_0x3675f8))[_0xcdcd('0x39')](handleError());}if(!_[_0xcdcd('0x33')](_0x3675f8[_0xcdcd('0x3a')])){logger[_0xcdcd('0x2b')](_0xcdcd('0x3b'),_0x3675f8['CustomReportId']);return analyticCustomReportController[_0xcdcd('0x3c')]({'id':_0x3675f8[_0xcdcd('0x3a')]},_0x13ce2f)['then'](handleResult(_0x3675f8))[_0xcdcd('0x39')](handleError());}}catch(_0x296ac8){logger[_0xcdcd('0x30')](JSON[_0xcdcd('0x26')](_0x296ac8));}return logger[_0xcdcd('0x2b')](_0xcdcd('0x3d'));};}function getJobs(_0x32a019){var _0x3c60bd={};if(_0x32a019){_0x3c60bd['id']=_0x32a019;}return db[_0xcdcd('0x3e')]['findAll']({'where':_0x3c60bd,'include':[{'model':db[_0xcdcd('0xd')],'attributes':['id','name',_0xcdcd('0x19')],'include':[{'model':db[_0xcdcd('0x3f')],'as':_0xcdcd('0xe')}]}]})[_0xcdcd('0x38')](function(_0x1d85cb){var _0x55a635=_[_0xcdcd('0x40')](manager[_0xcdcd('0x41')]);var _0x3b9b20=_['map'](_0x1d85cb,function(_0x639aa9){return _0x639aa9['id']['toString']();});var _0xa99331=_[_0xcdcd('0x42')](_0x1d85cb,function(_0x1ac4a9){return _0x1ac4a9['id'][_0xcdcd('0x43')]();});var _0x599f51=_0x32a019?_0x3b9b20:_[_0xcdcd('0x44')](_0x3b9b20,_0x55a635);var _0x996ac6=_[_0xcdcd('0x45')](_0x3b9b20,_0x55a635);var _0x1852b2=_[_0xcdcd('0x44')](_0x55a635,_0x3b9b20);var _0x41e0e0;var _0x33fd43;for(_0x41e0e0=0x0;_0x41e0e0<_0x1852b2[_0xcdcd('0x46')]&&!_0x32a019;_0x41e0e0+=0x1){_0x33fd43=_0x1852b2[_0x41e0e0]['toString']();if(manager[_0xcdcd('0x47')](_0x33fd43)){manager[_0xcdcd('0x48')](_0x33fd43);manager['deleteJob'](_0x33fd43);logger['info']('delete\x20cron',_0x33fd43);}}logger[_0xcdcd('0x2b')]('toRun',JSON[_0xcdcd('0x26')](_0x599f51));for(_0x41e0e0=0x0;_0x41e0e0<_0x599f51[_0xcdcd('0x46')];_0x41e0e0+=0x1){_0x33fd43=_0x599f51[_0x41e0e0][_0xcdcd('0x43')]();logger[_0xcdcd('0x2b')](_0xcdcd('0x49'),_0x33fd43);if(_0x32a019){logger[_0xcdcd('0x2b')](_0xcdcd('0x4a'),_0x32a019);logger[_0xcdcd('0x2b')](JSON[_0xcdcd('0x26')](_0xa99331[_0x33fd43]));BPromise[_0xcdcd('0x4b')]()[_0xcdcd('0x38')](handleJob(_0xa99331[_0x33fd43]));logger[_0xcdcd('0x2b')](_0xcdcd('0x4c'),_0xa99331[_0x33fd43][_0xcdcd('0x18')],_0xa99331[_0x33fd43][_0xcdcd('0x4d')]);}else if(_0xa99331[_0x33fd43]['cron']&&_0xa99331[_0x33fd43][_0xcdcd('0x4e')]&&moment()[_0xcdcd('0x4f')](_0xa99331[_0x33fd43][_0xcdcd('0x50')],_0xa99331[_0x33fd43][_0xcdcd('0x51')])){manager[_0xcdcd('0x52')](_0x33fd43,_0xa99331[_0x33fd43][_0xcdcd('0x4d')],handleJob(_0xa99331[_0x33fd43]));manager['start'](_0x33fd43);logger['info'](_0xcdcd('0x53'),_0xa99331[_0x33fd43][_0xcdcd('0x18')],_0xa99331[_0x33fd43]['cron']);}else if(manager[_0xcdcd('0x47')](_0x33fd43)){manager[_0xcdcd('0x48')](_0x33fd43);manager[_0xcdcd('0x54')](_0x33fd43);logger[_0xcdcd('0x2b')]('stop\x20cron',_0xa99331[_0x33fd43][_0xcdcd('0x18')],_0xa99331[_0x33fd43]['cron']);}}for(_0x41e0e0=0x0,_0x33fd43;_0x41e0e0<_0x996ac6[_0xcdcd('0x46')]&&!_0x32a019;_0x41e0e0+=0x1){_0x33fd43=_0x996ac6[_0x41e0e0]['toString']();if(manager[_0xcdcd('0x47')](_0x33fd43)){if(_0xa99331[_0x33fd43][_0xcdcd('0x4d')]&&_0xa99331[_0x33fd43][_0xcdcd('0x4e')]&&moment()['isBetween'](_0xa99331[_0x33fd43]['startAt'],_0xa99331[_0x33fd43][_0xcdcd('0x51')])){manager[_0xcdcd('0x55')](_0x33fd43,_0xa99331[_0x33fd43][_0xcdcd('0x4d')],handleJob(_0xa99331[_0x33fd43]));logger[_0xcdcd('0x2b')](_0xcdcd('0x56'),_0xa99331[_0x33fd43][_0xcdcd('0x18')],_0xa99331[_0x33fd43][_0xcdcd('0x4d')]);}else{manager[_0xcdcd('0x48')](_0x33fd43);manager[_0xcdcd('0x54')](_0x33fd43);logger[_0xcdcd('0x2b')](_0xcdcd('0x57'),_0xa99331[_0x33fd43][_0xcdcd('0x18')],_0xa99331[_0x33fd43]['cron']);}}}})['catch'](function(_0x1115ea){logger[_0xcdcd('0x30')](JSON[_0xcdcd('0x26')](_0x1115ea));});}exports[_0xcdcd('0x58')]=function(_0x5eaa02){return getJobs(_0x5eaa02);};exports[_0xcdcd('0x59')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0437=['resolve','cron','active','isBetween','endAt','add','add\x20cron','stop\x20cron','startAt','update','update\x20cron','run','start','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','user','bcc','name','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','message','attachments','text','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','stringify','email\x20sent','error\x20mail','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x0437,0x18d));var _0x7043=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x0437[_0x45d55e];return _0x29812a;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x7043('0x0'));var _=require(_0x7043('0x1'));var moment=require('moment');var CronJobManager=require(_0x7043('0x2'));var jayson=require(_0x7043('0x3'));var BPromise=require(_0x7043('0x4'));var logger=require(_0x7043('0x5'))('schedule');var db=require(_0x7043('0x6'))['db'];var analyticCustomReportController=require(_0x7043('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x7043('0x8')][_0x7043('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2935da,_0x3182b6){return function(){logger[_0x7043('0xa')](_0x7043('0xb'),_0x2935da[_0x7043('0xc')]);var _0x2b742c=!![];var _0x404dcb={'tls':{'rejectUnauthorized':![]}};if(_0x2935da[_0x7043('0xd')][_0x7043('0xe')]['service']){_0x404dcb[_0x7043('0xf')]=_0x2935da[_0x7043('0xd')]['Smtp'][_0x7043('0xf')];}else{_0x404dcb[_0x7043('0x10')]=_0x2935da[_0x7043('0xd')][_0x7043('0xe')][_0x7043('0x10')];_0x404dcb[_0x7043('0x11')]=_0x2935da['MailAccount']['Smtp'][_0x7043('0x11')];_0x404dcb['secure']=_0x2935da[_0x7043('0xd')][_0x7043('0xe')][_0x7043('0x12')];}if(_0x2935da['MailAccount']['Smtp'][_0x7043('0x13')]){_0x404dcb[_0x7043('0x14')]={'user':_0x2935da[_0x7043('0xd')][_0x7043('0xe')]['user'],'pass':_0x2935da['MailAccount'][_0x7043('0xe')][_0x7043('0x15')]};}var _0x1de21b={'account':_0x404dcb,'message':{'from':util[_0x7043('0x16')](_0x7043('0x17'),_0x2935da[_0x7043('0xd')]['name'],_0x2935da['MailAccount'][_0x7043('0xc')]||_0x2935da[_0x7043('0xd')]['Smtp'][_0x7043('0x18')]),'to':_0x2935da[_0x7043('0xc')],'cc':_0x2935da['cc'],'bcc':_0x2935da[_0x7043('0x19')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x3182b6[_0x7043('0x1a')],_0x2935da['subtractNumber'],_0x2935da['subtractUnit'])}};var _0x35f530=path['join'](__dirname,_0x7043('0x1b'));var _0x3e8c38=_0x3182b6[_0x7043('0x1c')];var _0xba23ee=util[_0x7043('0x16')](_0x7043('0x1d'),path[_0x7043('0x1e')](_0x3182b6[_0x7043('0x1c')],path[_0x7043('0x1f')](_0x3182b6[_0x7043('0x1c')])),_0x7043('0x20'));var _0x5da0bb=path[_0x7043('0x21')](_0x35f530,_0x3e8c38);var _0x4bea70=path[_0x7043('0x21')](_0x35f530,_0xba23ee);if(fs[_0x7043('0x22')](_0x5da0bb)){_0x3182b6[_0x7043('0x23')]='Sent';_0x1de21b[_0x7043('0x24')][_0x7043('0x25')]=[{'filename':_0x3e8c38,'path':_0x5da0bb}];_0x1de21b[_0x7043('0x24')][_0x7043('0x26')]=util[_0x7043('0x16')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x3182b6,null,0x2));}else if(fs[_0x7043('0x22')](_0x4bea70)){_0x3182b6[_0x7043('0x23')]=_0x7043('0x27');_0x1de21b['message'][_0x7043('0x25')]=[{'filename':_0xba23ee,'path':_0x4bea70}];}else{_0x1de21b[_0x7043('0x24')][_0x7043('0x26')]=_0x7043('0x28');if(!_0x2935da[_0x7043('0x29')]){_0x2b742c=![];logger[_0x7043('0xa')](_0x7043('0x2a'));}}if(_0x2b742c){return client[_0x7043('0x2b')](_0x7043('0x2c'),_0x1de21b)['then'](function(_0x2f4a44){if(_0x2f4a44[_0x7043('0x2d')]){return logger['error']('error\x20mail',JSON[_0x7043('0x2e')](_0x2f4a44));}return logger['info'](_0x7043('0x2f'));})['catch'](function(_0x159698){return logger[_0x7043('0x2d')](_0x7043('0x30'),JSON['stringify'](_0x159698));});}};}function handleError(){return function(_0x1d8a9b){return logger[_0x7043('0x2d')](JSON[_0x7043('0x2e')](_0x1d8a9b));};}function handleResult(_0x1fd4c5){return function(_0x323de4){logger[_0x7043('0xa')](_0x7043('0x31'),JSON[_0x7043('0x2e')](_0x323de4));if(_0x1fd4c5[_0x7043('0xd')]&&_0x1fd4c5[_0x7043('0xd')][_0x7043('0xe')]&&!_[_0x7043('0x32')](_0x1fd4c5[_0x7043('0xc')])){setTimeout(handleSendEmail(_0x1fd4c5,_0x323de4),0x3c*0x3e8);}};}function handleJob(_0x4d56ce){return function(){try{if(_[_0x7043('0x32')](_0x4d56ce[_0x7043('0x33')])){return logger['info'](_0x7043('0x34'));}if(_['isNil'](_0x4d56ce[_0x7043('0x35')])){return logger[_0x7043('0xa')](_0x7043('0x36'));}var _0x20c835={'startDate':moment()[_0x7043('0x37')](_0x4d56ce['subtractNumber'],_0x4d56ce[_0x7043('0x35')])[_0x7043('0x16')](_0x7043('0x38')),'endDate':moment()[_0x7043('0x16')](_0x7043('0x38')),'type':_0x7043('0x39'),'output':_0x4d56ce[_0x7043('0x3a')],'name':_0x4d56ce[_0x7043('0x1a')]};if(!_[_0x7043('0x32')](_0x4d56ce[_0x7043('0x3b')])){logger[_0x7043('0xa')](_0x7043('0x3c'),_0x4d56ce[_0x7043('0x3b')]);return analyticDefaultReportController[_0x7043('0x3d')]({'id':_0x4d56ce[_0x7043('0x3b')]},_0x20c835)[_0x7043('0x3e')](handleResult(_0x4d56ce))[_0x7043('0x3f')](handleError());}if(!_[_0x7043('0x32')](_0x4d56ce[_0x7043('0x40')])){logger[_0x7043('0xa')](_0x7043('0x41'),_0x4d56ce['CustomReportId']);return analyticCustomReportController[_0x7043('0x3d')]({'id':_0x4d56ce[_0x7043('0x40')]},_0x20c835)[_0x7043('0x3e')](handleResult(_0x4d56ce))[_0x7043('0x3f')](handleError());}}catch(_0x29b9ea){logger[_0x7043('0x2d')](JSON[_0x7043('0x2e')](_0x29b9ea));}return logger['info'](_0x7043('0x42'));};}function getJobs(_0x89cde9){var _0x409d8f={};if(_0x89cde9){_0x409d8f['id']=_0x89cde9;}return db[_0x7043('0x43')][_0x7043('0x44')]({'where':_0x409d8f,'include':[{'model':db[_0x7043('0xd')],'attributes':['id',_0x7043('0x1a'),_0x7043('0xc')],'include':[{'model':db[_0x7043('0x45')],'as':_0x7043('0xe')}]}]})[_0x7043('0x3e')](function(_0x222858){var _0x533bc9=_['keys'](manager[_0x7043('0x46')]);var _0x3914f1=_['map'](_0x222858,function(_0x2aedb7){return _0x2aedb7['id'][_0x7043('0x47')]();});var _0x4adc9f=_[_0x7043('0x48')](_0x222858,function(_0x58bf8f){return _0x58bf8f['id'][_0x7043('0x47')]();});var _0xedace0=_0x89cde9?_0x3914f1:_[_0x7043('0x49')](_0x3914f1,_0x533bc9);var _0xaf7229=_[_0x7043('0x4a')](_0x3914f1,_0x533bc9);var _0x101419=_[_0x7043('0x49')](_0x533bc9,_0x3914f1);var _0x37e8bb;var _0x2a9619;for(_0x37e8bb=0x0;_0x37e8bb<_0x101419[_0x7043('0x4b')]&&!_0x89cde9;_0x37e8bb+=0x1){_0x2a9619=_0x101419[_0x37e8bb][_0x7043('0x47')]();if(manager[_0x7043('0x4c')](_0x2a9619)){manager[_0x7043('0x4d')](_0x2a9619);manager[_0x7043('0x4e')](_0x2a9619);logger[_0x7043('0xa')](_0x7043('0x4f'),_0x2a9619);}}logger['info'](_0x7043('0x50'),JSON['stringify'](_0xedace0));for(_0x37e8bb=0x0;_0x37e8bb<_0xedace0[_0x7043('0x4b')];_0x37e8bb+=0x1){_0x2a9619=_0xedace0[_0x37e8bb][_0x7043('0x47')]();logger[_0x7043('0xa')](_0x7043('0x51'),_0x2a9619);if(_0x89cde9){logger[_0x7043('0xa')](_0x7043('0x52'),_0x89cde9);logger[_0x7043('0xa')](JSON[_0x7043('0x2e')](_0x4adc9f[_0x2a9619]));BPromise[_0x7043('0x53')]()[_0x7043('0x3e')](handleJob(_0x4adc9f[_0x2a9619]));logger[_0x7043('0xa')]('run\x20job',_0x4adc9f[_0x2a9619][_0x7043('0x1a')],_0x4adc9f[_0x2a9619]['cron']);}else if(_0x4adc9f[_0x2a9619][_0x7043('0x54')]&&_0x4adc9f[_0x2a9619][_0x7043('0x55')]&&moment()[_0x7043('0x56')](_0x4adc9f[_0x2a9619]['startAt'],_0x4adc9f[_0x2a9619][_0x7043('0x57')])){manager[_0x7043('0x58')](_0x2a9619,_0x4adc9f[_0x2a9619]['cron'],handleJob(_0x4adc9f[_0x2a9619]));manager['start'](_0x2a9619);logger[_0x7043('0xa')](_0x7043('0x59'),_0x4adc9f[_0x2a9619][_0x7043('0x1a')],_0x4adc9f[_0x2a9619][_0x7043('0x54')]);}else if(manager[_0x7043('0x4c')](_0x2a9619)){manager['stop'](_0x2a9619);manager[_0x7043('0x4e')](_0x2a9619);logger[_0x7043('0xa')](_0x7043('0x5a'),_0x4adc9f[_0x2a9619][_0x7043('0x1a')],_0x4adc9f[_0x2a9619][_0x7043('0x54')]);}}for(_0x37e8bb=0x0,_0x2a9619;_0x37e8bb<_0xaf7229[_0x7043('0x4b')]&&!_0x89cde9;_0x37e8bb+=0x1){_0x2a9619=_0xaf7229[_0x37e8bb][_0x7043('0x47')]();if(manager[_0x7043('0x4c')](_0x2a9619)){if(_0x4adc9f[_0x2a9619][_0x7043('0x54')]&&_0x4adc9f[_0x2a9619][_0x7043('0x55')]&&moment()[_0x7043('0x56')](_0x4adc9f[_0x2a9619][_0x7043('0x5b')],_0x4adc9f[_0x2a9619][_0x7043('0x57')])){manager[_0x7043('0x5c')](_0x2a9619,_0x4adc9f[_0x2a9619][_0x7043('0x54')],handleJob(_0x4adc9f[_0x2a9619]));logger[_0x7043('0xa')](_0x7043('0x5d'),_0x4adc9f[_0x2a9619][_0x7043('0x1a')],_0x4adc9f[_0x2a9619]['cron']);}else{manager[_0x7043('0x4d')](_0x2a9619);manager[_0x7043('0x4e')](_0x2a9619);logger[_0x7043('0xa')](_0x7043('0x5a'),_0x4adc9f[_0x2a9619][_0x7043('0x1a')],_0x4adc9f[_0x2a9619]['cron']);}}}})[_0x7043('0x3f')](function(_0x22c1f6){logger[_0x7043('0x2d')](JSON[_0x7043('0x2e')](_0x22c1f6));});}exports[_0x7043('0x5e')]=function(_0x281631){return getJobs(_0x281631);};exports[_0x7043('0x5f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 06bd6f0..e323c4c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddc6=['contacts2','hopper2','catch','Innocenzo','Biondo','@xcally.com','push','now','CmContact','destroy','bulkCreate','then','CmHopper','log','finished\x20populating','hopper1'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xddc6,0x163));var _0x6ddc=function(_0xbdc67d,_0x9794e9){_0xbdc67d=_0xbdc67d-0x0;var _0xa07bca=_0xddc6[_0xbdc67d];return _0xa07bca;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x6ddc('0x0')+i,'lastName':_0x6ddc('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6ddc('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6ddc('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x6ddc('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6ddc('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6ddc('0x3')]({'id':i,'firstName':_0x6ddc('0x0')+i,'lastName':_0x6ddc('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6ddc('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x6ddc('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6ddc('0x4')]()});}db[_0x6ddc('0x5')][_0x6ddc('0x6')]({'where':{}})['then'](function(){return db[_0x6ddc('0x5')][_0x6ddc('0x7')](contacts);})[_0x6ddc('0x8')](function(){console['log']('finished\x20populating','contacts1');return db[_0x6ddc('0x9')][_0x6ddc('0x6')]({'where':{}});})[_0x6ddc('0x8')](function(){return db[_0x6ddc('0x9')][_0x6ddc('0x7')](hopper);})[_0x6ddc('0x8')](function(){console[_0x6ddc('0xa')](_0x6ddc('0xb'),_0x6ddc('0xc'));return db[_0x6ddc('0x5')][_0x6ddc('0x7')](contacts2);})[_0x6ddc('0x8')](function(){console[_0x6ddc('0xa')](_0x6ddc('0xb'),_0x6ddc('0xd'));return db[_0x6ddc('0x9')][_0x6ddc('0x7')](hopper2);})[_0x6ddc('0x8')](function(){console['log'](_0x6ddc('0xb'),_0x6ddc('0xe'));})[_0x6ddc('0xf')](function(_0x11c186){console[_0x6ddc('0xa')](_0x11c186);}); \ No newline at end of file +var _0x59e2=['@xcally.com','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push','now'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x59e2,0x1bb));var _0x259e=function(_0x3998bf,_0x3d379c){_0x3998bf=_0x3998bf-0x0;var _0x2e31a7=_0x59e2[_0x3998bf];return _0x2e31a7;};'use strict';var util=require(_0x259e('0x0'));var db=require(_0x259e('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x259e('0x2')+i,'lastName':_0x259e('0x3')+i,'phone':0xf879fb460+i,'email':_0x259e('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x259e('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x259e('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x259e('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x259e('0x2')+i,'lastName':_0x259e('0x3')+i,'phone':0xf879fb460+i,'email':_0x259e('0x4')+i+_0x259e('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x259e('0x6')](),'updatedAt':Date['now']()});}db[_0x259e('0x8')][_0x259e('0x9')]({'where':{}})[_0x259e('0xa')](function(){return db[_0x259e('0x8')]['bulkCreate'](contacts);})[_0x259e('0xa')](function(){console[_0x259e('0xb')](_0x259e('0xc'),_0x259e('0xd'));return db[_0x259e('0xe')][_0x259e('0x9')]({'where':{}});})[_0x259e('0xa')](function(){return db[_0x259e('0xe')]['bulkCreate'](hopper);})['then'](function(){console[_0x259e('0xb')](_0x259e('0xc'),_0x259e('0xf'));return db[_0x259e('0x8')]['bulkCreate'](contacts2);})['then'](function(){console[_0x259e('0xb')]('finished\x20populating',_0x259e('0x10'));return db[_0x259e('0xe')]['bulkCreate'](hopper2);})[_0x259e('0xa')](function(){console[_0x259e('0xb')]('finished\x20populating','hopper2');})[_0x259e('0x11')](function(_0x162843){console[_0x259e('0xb')](_0x162843);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 8cdad86..ffd764f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26ed=['password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','then','log','catch','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com'];(function(_0x2194ef,_0x3a5404){var _0x5b677f=function(_0x1cf32b){while(--_0x1cf32b){_0x2194ef['push'](_0x2194ef['shift']());}};_0x5b677f(++_0x3a5404);}(_0x26ed,0x12a));var _0xd26e=function(_0xd206ce,_0x3031d2){_0xd206ce=_0xd206ce-0x0;var _0x5b3ec6=_0x26ed[_0xd206ce];return _0x5b3ec6;};'use strict';var util=require('util');var db=require(_0xd26e('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd26e('0x1')]({'name':util['format'](_0xd26e('0x2'),_0xd26e('0x3'),i),'fullname':util[_0xd26e('0x4')](_0xd26e('0x2'),_0xd26e('0x3'),i),'email':util[_0xd26e('0x4')](_0xd26e('0x5'),_0xd26e('0x3'),i),'role':_0xd26e('0x3'),'password':_0xd26e('0x6'),'internal':0xfa0+i,'type':_0xd26e('0x7'),'transport':[_0xd26e('0x8'),'ws',_0xd26e('0x9')],'disallow':[_0xd26e('0xa')],'allow':['ulaw'],'defaultuser':util[_0xd26e('0x4')](_0xd26e('0x2'),_0xd26e('0x3'),i),'encryption':_0xd26e('0xb'),'avpf':_0xd26e('0xb'),'force_avp':_0xd26e('0xb'),'icesupport':_0xd26e('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xd26e('0xc'),'dtlsprivatekey':_0xd26e('0xd'),'dtlssetup':_0xd26e('0xe'),'callerid':util[_0xd26e('0x4')]('\x22%s\x22\x20<%s>',util[_0xd26e('0x4')]('%s%s',_0xd26e('0x3'),i),0xfa0+i)});}db[_0xd26e('0xf')]['bulkCreate'](users)[_0xd26e('0x10')](function(){console[_0xd26e('0x11')]('add\x20user');})[_0xd26e('0x12')](function(_0x8b51d3){console[_0xd26e('0x11')](_0x8b51d3);}); \ No newline at end of file +var _0xa22c=['\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','push','format','%s%s','%s%s@xcally.com','agent','password','all','yes','/etc/pki/tls/certs/motion.crt','actpass'];(function(_0x21050e,_0x35f814){var _0x3afaff=function(_0x3f32fc){while(--_0x3f32fc){_0x21050e['push'](_0x21050e['shift']());}};_0x3afaff(++_0x35f814);}(_0xa22c,0x85));var _0xca22=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa22c[_0x3947c9];return _0x2e7871;};'use strict';var util=require('util');var db=require(_0xca22('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xca22('0x1')]({'name':util[_0xca22('0x2')](_0xca22('0x3'),'agent',i),'fullname':util[_0xca22('0x2')](_0xca22('0x3'),'agent',i),'email':util[_0xca22('0x2')](_0xca22('0x4'),_0xca22('0x5'),i),'role':_0xca22('0x5'),'password':_0xca22('0x6'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws','wss'],'disallow':[_0xca22('0x7')],'allow':['ulaw'],'defaultuser':util['format']('%s%s',_0xca22('0x5'),i),'encryption':_0xca22('0x8'),'avpf':_0xca22('0x8'),'force_avp':_0xca22('0x8'),'icesupport':_0xca22('0x8'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xca22('0x9'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xca22('0xa'),'callerid':util[_0xca22('0x2')](_0xca22('0xb'),util['format'](_0xca22('0x3'),'agent',i),0xfa0+i)});}db[_0xca22('0xc')][_0xca22('0xd')](users)[_0xca22('0xe')](function(){console[_0xca22('0xf')](_0xca22('0x10'));})[_0xca22('0x11')](function(_0x175db9){console[_0xca22('0xf')](_0x175db9);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 7242cdb..7f72701 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8ac=['find','userProfileId','handshake','ChatInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','voice:outbound','VoiceQueues','ChatQueues','ChatQueue','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','all','length','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','catch','log','join','default','setMaxListeners','address','connection','remoteAddress','request','remotePort','connectedAt','nsp','CONNECTED','lodash','bluebird','../mysqldb','name','Agents','User','role','agent','telephone','UserProfileSection','findOne','then','autoAssociation','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','type','ivr','format','%s:queue:%s','user:%s','query'];(function(_0x571b02,_0x3f969d){var _0x347b73=function(_0x42ac1d){while(--_0x42ac1d){_0x571b02['push'](_0x571b02['shift']());}};_0x347b73(++_0x3f969d);}(_0xc8ac,0x102));var _0xcc8a=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xc8ac[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xcc8a('0x0'));var util=require('util');var BPromise=require(_0xcc8a('0x1'));var db=require(_0xcc8a('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xcc8a('0x3')],'include':[{'as':_0xcc8a('0x4'),'model':db[_0xcc8a('0x5')],'attributes':['id',_0xcc8a('0x3'),_0xcc8a('0x6')],'raw':!![],'where':{'role':_0xcc8a('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xcc8a('0x3')],'where':{'role':_0xcc8a('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xcc8a('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xcc8a('0x3')],'where':{'role':_0xcc8a('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xcc8a('0x3'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x2ff73b,_0x3bb504,_0x12ac85){return db[_0xcc8a('0x9')][_0xcc8a('0xa')]({'where':{'name':_0x2ff73b,'userProfileId':_0x3bb504},'raw':!![]})[_0xcc8a('0xb')](function(_0xec961b){if(_0xec961b){if(_0xec961b[_0xcc8a('0xc')]){switch(_0x2ff73b){case'VoiceQueues':case'ChatQueues':case _0xcc8a('0xd'):case _0xcc8a('0xe'):case _0xcc8a('0xf'):case _0xcc8a('0x10'):return db[_0x12ac85][_0xcc8a('0x11')](queryQueues);case _0xcc8a('0x12'):return db[_0x12ac85][_0xcc8a('0x11')](queryTelephones);case _0xcc8a('0x13'):return db[_0x12ac85][_0xcc8a('0x11')](queryTrunks);case _0xcc8a('0x14'):return db[_0x12ac85]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0xcc8a('0x11')]({'attributes':[_0xcc8a('0x15')],'where':{'sectionId':_0xec961b['id']},'raw':!![]})[_0xcc8a('0xb')](function(_0x408281){if(_0x408281){var _0x2c980f={'where':{'id':_[_0xcc8a('0x16')](_0x408281,_0xcc8a('0x15'))},'raw':!![]};switch(_0x12ac85){case _0xcc8a('0x5'):_0x2c980f[_0xcc8a('0x17')][_0xcc8a('0x6')]=_0xcc8a('0x8');break;case'Campaign':_0x2c980f[_0xcc8a('0x17')][_0xcc8a('0x18')]=_0xcc8a('0x19');break;}return db[_0x12ac85]['findAll'](_0x2c980f);}else{return[];}});}}else{return[];}})[_0xcc8a('0xb')](function(_0x5043e6){return _0x5043e6;});}function joinOrLeaveQueues(_0x5054e4,_0x32a7cd,_0x311123,_0x4763cc){_0x5054e4[_0x32a7cd](util[_0xcc8a('0x1a')](_0xcc8a('0x1b'),_0x311123,_0x4763cc[_0xcc8a('0x3')]));if(_0x4763cc[_0xcc8a('0x4')]){for(var _0x32d81a=0x0;_0x32d81a<_0x4763cc[_0xcc8a('0x4')]['length'];_0x32d81a+=0x1){_0x5054e4[_0x32a7cd](util['format'](_0xcc8a('0x1c'),_0x4763cc['Agents'][_0x32d81a][_0xcc8a('0x3')]));}}}function joinOrLeave(_0x37a7a7,_0x2b7288,_0x4017be){var _0x15732c;if(_0x37a7a7['handshake'][_0xcc8a('0x1d')]['id']){db[_0xcc8a('0x5')][_0xcc8a('0x1e')]({'attributes':['id','name',_0xcc8a('0x6'),_0xcc8a('0x1f')],'where':{'id':_0x37a7a7[_0xcc8a('0x20')][_0xcc8a('0x1d')]['id']},'include':[{'model':db[_0xcc8a('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xcc8a('0x22')],'as':_0xcc8a('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xcc8a('0x24')],'as':_0xcc8a('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xcc8a('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x30c37c){if(_0x30c37c){_0x15732c=_0x30c37c;_0x37a7a7[_0x2b7288](util['format'](_0xcc8a('0x1c'),_0x30c37c[_0xcc8a('0x3')]));var _0xeaffda=[];switch(_0x30c37c[_0xcc8a('0x6')]){case _0xcc8a('0x27'):_0x37a7a7[_0x2b7288](_0xcc8a('0x28'));_0x37a7a7[_0x2b7288]('voice:outbound');if(queryQueues[_0xcc8a('0x29')](_0xcc8a('0x2a'))){delete queryQueues['include'];}_0xeaffda[_0xcc8a('0x2b')](db[_0xcc8a('0x2c')]['findAll'](queryQueues));_0xeaffda[_0xcc8a('0x2b')](db['ChatQueue'][_0xcc8a('0x11')](queryQueues));_0xeaffda['push'](db[_0xcc8a('0x2d')]['findAll'](queryQueues));_0xeaffda[_0xcc8a('0x2b')](db[_0xcc8a('0x2e')][_0xcc8a('0x11')](queryQueues));_0xeaffda['push'](db[_0xcc8a('0x2f')]['findAll'](queryQueues));_0xeaffda['push'](db[_0xcc8a('0x30')][_0xcc8a('0x11')](queryQueues));_0xeaffda[_0xcc8a('0x2b')](db['User'][_0xcc8a('0x11')](queryTelephones));_0xeaffda[_0xcc8a('0x2b')](db[_0xcc8a('0x31')][_0xcc8a('0x11')](queryTrunks));_0xeaffda[_0xcc8a('0x2b')](db[_0xcc8a('0x32')][_0xcc8a('0x11')](queryCampaigns));_0xeaffda[_0xcc8a('0x2b')](db['User'][_0xcc8a('0x11')](queryAgents));break;case _0xcc8a('0x33'):_0x37a7a7[_0x2b7288](_0xcc8a('0x28'));_0x37a7a7[_0x2b7288](_0xcc8a('0x34'));_0xeaffda[_0xcc8a('0x2b')](getAssociatedResources(_0xcc8a('0x35'),_0x30c37c[_0xcc8a('0x1f')],_0xcc8a('0x2c')));_0xeaffda['push'](getAssociatedResources(_0xcc8a('0x36'),_0x30c37c[_0xcc8a('0x1f')],_0xcc8a('0x37')));_0xeaffda[_0xcc8a('0x2b')](getAssociatedResources('FaxQueues',_0x30c37c[_0xcc8a('0x1f')],_0xcc8a('0x2d')));_0xeaffda[_0xcc8a('0x2b')](getAssociatedResources('SmsQueues',_0x30c37c[_0xcc8a('0x1f')],'SmsQueue'));_0xeaffda[_0xcc8a('0x2b')](getAssociatedResources('MailQueues',_0x30c37c[_0xcc8a('0x1f')],'MailQueue'));_0xeaffda[_0xcc8a('0x2b')](getAssociatedResources(_0xcc8a('0x10'),_0x30c37c['userProfileId'],_0xcc8a('0x30')));_0xeaffda[_0xcc8a('0x2b')](getAssociatedResources(_0xcc8a('0x12'),_0x30c37c['userProfileId'],_0xcc8a('0x5')));_0xeaffda['push'](getAssociatedResources(_0xcc8a('0x13'),_0x30c37c[_0xcc8a('0x1f')],_0xcc8a('0x31')));_0xeaffda['push'](getAssociatedResources(_0xcc8a('0x14'),_0x30c37c[_0xcc8a('0x1f')],_0xcc8a('0x32')));_0xeaffda[_0xcc8a('0x2b')](db[_0xcc8a('0x5')][_0xcc8a('0x11')](queryAgents));break;case _0xcc8a('0x7'):_0x37a7a7[_0x2b7288](_0xcc8a('0x28'));_0x37a7a7[_0x2b7288](_0xcc8a('0x34'));_0xeaffda['push'](_0x30c37c[_0xcc8a('0x38')]({'attributes':['id',_0xcc8a('0x3')]}));_0xeaffda[_0xcc8a('0x2b')](_0x30c37c['getChatQueues']({'attributes':['id',_0xcc8a('0x3')]}));_0xeaffda[_0xcc8a('0x2b')](_0x30c37c[_0xcc8a('0x39')]({'attributes':['id',_0xcc8a('0x3')]}));_0xeaffda[_0xcc8a('0x2b')](_0x30c37c[_0xcc8a('0x3a')]({'attributes':['id',_0xcc8a('0x3')]}));_0xeaffda[_0xcc8a('0x2b')](_0x30c37c[_0xcc8a('0x3b')]({'attributes':['id',_0xcc8a('0x3')]}));_0xeaffda[_0xcc8a('0x2b')](_0x30c37c['getOpenchannelQueues']({'attributes':['id',_0xcc8a('0x3')]}));break;}return BPromise[_0xcc8a('0x3c')](_0xeaffda);}})[_0xcc8a('0xb')](function(_0x403075){if(_0x403075&&_0x403075[_0xcc8a('0x3d')]){for(var _0x477a5e=0x0;_0x477a5e<_0x403075[_0xcc8a('0x3d')];_0x477a5e+=0x1){for(var _0x1a97c7=0x0;_0x1a97c7<_0x403075[_0x477a5e][_0xcc8a('0x3d')];_0x1a97c7+=0x1){switch(_0x477a5e){case 0x0:joinOrLeaveQueues(_0x37a7a7,_0x2b7288,'voice',_0x403075[_0x477a5e][_0x1a97c7]);break;case 0x1:joinOrLeaveQueues(_0x37a7a7,_0x2b7288,_0xcc8a('0x3e'),_0x403075[_0x477a5e][_0x1a97c7]);break;case 0x2:joinOrLeaveQueues(_0x37a7a7,_0x2b7288,_0xcc8a('0x3f'),_0x403075[_0x477a5e][_0x1a97c7]);break;case 0x3:joinOrLeaveQueues(_0x37a7a7,_0x2b7288,_0xcc8a('0x40'),_0x403075[_0x477a5e][_0x1a97c7]);break;case 0x4:joinOrLeaveQueues(_0x37a7a7,_0x2b7288,_0xcc8a('0x41'),_0x403075[_0x477a5e][_0x1a97c7]);break;case 0x5:joinOrLeaveQueues(_0x37a7a7,_0x2b7288,_0xcc8a('0x42'),_0x403075[_0x477a5e][_0x1a97c7]);break;case 0x6:_0x37a7a7[_0x2b7288](util[_0xcc8a('0x1a')](_0xcc8a('0x43'),_0x403075[_0x477a5e][_0x1a97c7][_0xcc8a('0x3')]));break;case 0x7:_0x37a7a7[_0x2b7288](util['format'](_0xcc8a('0x44'),_0x403075[_0x477a5e][_0x1a97c7][_0xcc8a('0x3')]));break;case 0x8:_0x37a7a7[_0x2b7288](util[_0xcc8a('0x1a')](_0xcc8a('0x45'),_0x403075[_0x477a5e][_0x1a97c7][_0xcc8a('0x18')],_0x403075[_0x477a5e][_0x1a97c7][_0xcc8a('0x3')]));break;case 0x9:_0x37a7a7[_0x2b7288](util[_0xcc8a('0x1a')](_0xcc8a('0x1c'),_0x403075[_0x477a5e][_0x1a97c7][_0xcc8a('0x3')]));break;}}}}})[_0xcc8a('0xb')](function(){if(_0x2b7288===_0xcc8a('0x46')){var _0x5bfbb2=_[_0xcc8a('0x16')](_0x15732c[_0xcc8a('0x47')],'id');return _0x15732c[_0xcc8a('0x48')](_0x5bfbb2)[_0xcc8a('0xb')](function(){for(var _0x4134c4=0x0;_0x4134c4<_0x5bfbb2[_0xcc8a('0x3d')];_0x4134c4+=0x1){_0x4017be[_0xcc8a('0x49')](_0xcc8a('0x4a'),{'ChatInteractionId':Number(_0x5bfbb2[_0x4134c4]),'UserId':Number(_0x15732c['id'])});}});}})[_0xcc8a('0xb')](function(){if(_0x2b7288===_0xcc8a('0x46')){var _0x5fac48=_['map'](_0x15732c[_0xcc8a('0x4b')],'id');return _0x15732c[_0xcc8a('0x4c')](_0x5fac48)['then'](function(){for(var _0x4f5dcb=0x0;_0x4f5dcb<_0x5fac48['length'];_0x4f5dcb+=0x1){_0x4017be['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x5fac48[_0x4f5dcb]),'UserId':Number(_0x15732c['id'])});}});}})[_0xcc8a('0xb')](function(){if(_0x2b7288===_0xcc8a('0x46')){var _0x1fe651=_[_0xcc8a('0x16')](_0x15732c[_0xcc8a('0x23')],'id');return _0x15732c[_0xcc8a('0x4d')](_0x1fe651)[_0xcc8a('0xb')](function(){for(var _0x1bebf2=0x0;_0x1bebf2<_0x1fe651[_0xcc8a('0x3d')];_0x1bebf2+=0x1){_0x4017be[_0xcc8a('0x49')](_0xcc8a('0x4e'),{'FaxInteractionId':Number(_0x1fe651[_0x1bebf2]),'UserId':Number(_0x15732c['id'])});}});}})[_0xcc8a('0xb')](function(){if(_0x2b7288===_0xcc8a('0x46')){var _0x2b0210=_['map'](_0x15732c[_0xcc8a('0x25')],'id');return _0x15732c[_0xcc8a('0x4f')](_0x2b0210)[_0xcc8a('0xb')](function(){for(var _0x383f3a=0x0;_0x383f3a<_0x2b0210[_0xcc8a('0x3d')];_0x383f3a+=0x1){_0x4017be['emit'](_0xcc8a('0x50'),{'SmsInteractionId':Number(_0x2b0210[_0x383f3a]),'UserId':Number(_0x15732c['id'])});}});}})[_0xcc8a('0xb')](function(){if(_0x2b7288===_0xcc8a('0x46')){var _0xe340b2=_[_0xcc8a('0x16')](_0x15732c[_0xcc8a('0x51')],'id');return _0x15732c[_0xcc8a('0x52')](_0xe340b2)[_0xcc8a('0xb')](function(){for(var _0x32716a=0x0;_0x32716a<_0xe340b2[_0xcc8a('0x3d')];_0x32716a+=0x1){_0x4017be[_0xcc8a('0x49')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xe340b2[_0x32716a]),'UserId':Number(_0x15732c['id'])});}});}})[_0xcc8a('0x53')](function(_0x184c01){_0x37a7a7[_0xcc8a('0x54')](_0x184c01);});}}function onDisconnect(_0x222fd9,_0x4bb4fd){joinOrLeave(_0x222fd9,_0xcc8a('0x46'),_0x4bb4fd);}function onConnect(_0x378e91){joinOrLeave(_0x378e91,_0xcc8a('0x55'));}exports[_0xcc8a('0x56')]=function(_0x50b432){_0x50b432['on']('connection',function(_0x77f75b){_0x77f75b[_0xcc8a('0x57')](0x0);_0x77f75b[_0xcc8a('0x58')]=_0x77f75b['request'][_0xcc8a('0x59')][_0xcc8a('0x5a')]+':'+_0x77f75b[_0xcc8a('0x5b')][_0xcc8a('0x59')][_0xcc8a('0x5c')];_0x77f75b[_0xcc8a('0x5d')]=new Date();_0x77f75b[_0xcc8a('0x54')]=function(_0x2c0d0c){console['log']('SocketIO\x20'+_0x77f75b[_0xcc8a('0x5e')]['name']+'['+_0x77f75b[_0xcc8a('0x58')]+']',_0x2c0d0c);};_0x77f75b['on']('disconnect',function(){onDisconnect(_0x77f75b,_0x50b432);_0x77f75b[_0xcc8a('0x54')]('DISCONNECTED');});onConnect(_0x77f75b);_0x77f75b[_0xcc8a('0x54')](_0xcc8a('0x5f'));});}; \ No newline at end of file +var _0x0fbf=['chat','fax','sms','mail','openchannel','campaign:%s:%s','leave','map','user_has_chat_interactions:remove','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','connection','setMaxListeners','address','request','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','./environment','name','Agents','User','telephone','agent','type','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','Telephones','findAll','Trunks','IvrCampaigns','resourceId','then','where','Campaign','format','%s:queue:%s','handshake','query','find','role','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','user:%s','voice:inbound','voice:outbound','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','user','OpenchannelQueues','OpenchannelQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','length','voice'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x0fbf,0x78));var _0xf0fb=function(_0x4ea25f,_0x10b40a){_0x4ea25f=_0x4ea25f-0x0;var _0x3d469b=_0x0fbf[_0x4ea25f];return _0x3d469b;};'use strict';var _=require(_0xf0fb('0x0'));var util=require('util');var BPromise=require(_0xf0fb('0x1'));var db=require('../mysqldb')['db'];var config=require(_0xf0fb('0x2'));var queryQueues={'attributes':['id',_0xf0fb('0x3')],'include':[{'as':_0xf0fb('0x4'),'model':db[_0xf0fb('0x5')],'attributes':['id','name','role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf0fb('0x3')],'where':{'role':_0xf0fb('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xf0fb('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xf0fb('0x3')],'where':{'role':_0xf0fb('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xf0fb('0x3'),_0xf0fb('0x8')],'where':{'type':_0xf0fb('0x9')}};function getAssociatedResources(_0x202a8e,_0xa5763,_0x2dc008){return db['UserProfileSection'][_0xf0fb('0xa')]({'where':{'name':_0x202a8e,'userProfileId':_0xa5763},'raw':!![]})['then'](function(_0x2ea2a0){if(_0x2ea2a0){if(_0x2ea2a0[_0xf0fb('0xb')]){switch(_0x202a8e){case _0xf0fb('0xc'):case _0xf0fb('0xd'):case _0xf0fb('0xe'):case _0xf0fb('0xf'):case'MailQueues':case'OpenchannelQueues':return db[_0x2dc008]['findAll'](queryQueues);case _0xf0fb('0x10'):return db[_0x2dc008][_0xf0fb('0x11')](queryTelephones);case _0xf0fb('0x12'):return db[_0x2dc008][_0xf0fb('0x11')](queryTrunks);case _0xf0fb('0x13'):return db[_0x2dc008][_0xf0fb('0x11')](queryCampaigns);}}else{return db['UserProfileResource'][_0xf0fb('0x11')]({'attributes':[_0xf0fb('0x14')],'where':{'sectionId':_0x2ea2a0['id']},'raw':!![]})[_0xf0fb('0x15')](function(_0x52b1a7){if(_0x52b1a7){var _0x947b36={'where':{'id':_['map'](_0x52b1a7,_0xf0fb('0x14'))},'raw':!![]};switch(_0x2dc008){case _0xf0fb('0x5'):_0x947b36[_0xf0fb('0x16')]['role']=_0xf0fb('0x6');break;case _0xf0fb('0x17'):_0x947b36[_0xf0fb('0x16')][_0xf0fb('0x8')]=_0xf0fb('0x9');break;}return db[_0x2dc008][_0xf0fb('0x11')](_0x947b36);}else{return[];}});}}else{return[];}})[_0xf0fb('0x15')](function(_0x2c861b){return _0x2c861b;});}function joinOrLeaveQueues(_0x1e5860,_0x1871a7,_0x5938fb,_0x550546){_0x1e5860[_0x1871a7](util[_0xf0fb('0x18')](_0xf0fb('0x19'),_0x5938fb,_0x550546[_0xf0fb('0x3')]));if(_0x550546['Agents']){for(var _0x35bd1c=0x0;_0x35bd1c<_0x550546[_0xf0fb('0x4')]['length'];_0x35bd1c+=0x1){_0x1e5860[_0x1871a7](util[_0xf0fb('0x18')]('user:%s',_0x550546[_0xf0fb('0x4')][_0x35bd1c]['name']));}}}function joinOrLeave(_0x328e56,_0x350764,_0x180b5c){var _0x598701;if(_0x328e56[_0xf0fb('0x1a')][_0xf0fb('0x1b')]['id']){db[_0xf0fb('0x5')][_0xf0fb('0x1c')]({'attributes':['id',_0xf0fb('0x3'),_0xf0fb('0x1d'),_0xf0fb('0x1e')],'where':{'id':_0x328e56[_0xf0fb('0x1a')][_0xf0fb('0x1b')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xf0fb('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0xf0fb('0x20')],'as':_0xf0fb('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xf0fb('0x22')],'as':_0xf0fb('0x23'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf0fb('0x24')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x60d274){if(_0x60d274){_0x598701=_0x60d274;_0x328e56[_0x350764](util['format'](_0xf0fb('0x25'),_0x60d274[_0xf0fb('0x3')]));var _0x185ef2=[];switch(_0x60d274[_0xf0fb('0x1d')]){case'admin':_0x328e56[_0x350764](_0xf0fb('0x26'));_0x328e56[_0x350764](_0xf0fb('0x27'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues['include'];}_0x185ef2[_0xf0fb('0x28')](db[_0xf0fb('0x29')][_0xf0fb('0x11')](queryQueues));_0x185ef2['push'](db[_0xf0fb('0x2a')][_0xf0fb('0x11')](queryQueues));_0x185ef2[_0xf0fb('0x28')](db[_0xf0fb('0x2b')][_0xf0fb('0x11')](queryQueues));_0x185ef2[_0xf0fb('0x28')](db[_0xf0fb('0x2c')][_0xf0fb('0x11')](queryQueues));_0x185ef2[_0xf0fb('0x28')](db[_0xf0fb('0x2d')][_0xf0fb('0x11')](queryQueues));_0x185ef2[_0xf0fb('0x28')](db['OpenchannelQueue'][_0xf0fb('0x11')](queryQueues));_0x185ef2[_0xf0fb('0x28')](db[_0xf0fb('0x5')]['findAll'](queryTelephones));_0x185ef2['push'](db['Trunk'][_0xf0fb('0x11')](queryTrunks));_0x185ef2['push'](db['Campaign'][_0xf0fb('0x11')](queryCampaigns));_0x185ef2['push'](db[_0xf0fb('0x5')][_0xf0fb('0x11')](queryAgents));break;case _0xf0fb('0x2e'):_0x328e56[_0x350764](_0xf0fb('0x26'));_0x328e56[_0x350764](_0xf0fb('0x27'));_0x185ef2[_0xf0fb('0x28')](getAssociatedResources(_0xf0fb('0xc'),_0x60d274[_0xf0fb('0x1e')],_0xf0fb('0x29')));_0x185ef2[_0xf0fb('0x28')](getAssociatedResources(_0xf0fb('0xd'),_0x60d274['userProfileId'],_0xf0fb('0x2a')));_0x185ef2[_0xf0fb('0x28')](getAssociatedResources(_0xf0fb('0xe'),_0x60d274[_0xf0fb('0x1e')],_0xf0fb('0x2b')));_0x185ef2[_0xf0fb('0x28')](getAssociatedResources(_0xf0fb('0xf'),_0x60d274['userProfileId'],_0xf0fb('0x2c')));_0x185ef2[_0xf0fb('0x28')](getAssociatedResources('MailQueues',_0x60d274[_0xf0fb('0x1e')],_0xf0fb('0x2d')));_0x185ef2['push'](getAssociatedResources(_0xf0fb('0x2f'),_0x60d274[_0xf0fb('0x1e')],_0xf0fb('0x30')));_0x185ef2[_0xf0fb('0x28')](getAssociatedResources(_0xf0fb('0x10'),_0x60d274[_0xf0fb('0x1e')],_0xf0fb('0x5')));_0x185ef2['push'](getAssociatedResources(_0xf0fb('0x12'),_0x60d274['userProfileId'],_0xf0fb('0x31')));_0x185ef2[_0xf0fb('0x28')](getAssociatedResources(_0xf0fb('0x13'),_0x60d274[_0xf0fb('0x1e')],_0xf0fb('0x17')));_0x185ef2[_0xf0fb('0x28')](db[_0xf0fb('0x5')][_0xf0fb('0x11')](queryAgents));break;case _0xf0fb('0x7'):_0x328e56[_0x350764](_0xf0fb('0x26'));_0x328e56[_0x350764](_0xf0fb('0x27'));_0x185ef2[_0xf0fb('0x28')](_0x60d274[_0xf0fb('0x32')]({'attributes':['id',_0xf0fb('0x3')]}));_0x185ef2[_0xf0fb('0x28')](_0x60d274[_0xf0fb('0x33')]({'attributes':['id','name']}));_0x185ef2[_0xf0fb('0x28')](_0x60d274[_0xf0fb('0x34')]({'attributes':['id',_0xf0fb('0x3')]}));_0x185ef2[_0xf0fb('0x28')](_0x60d274[_0xf0fb('0x35')]({'attributes':['id',_0xf0fb('0x3')]}));_0x185ef2['push'](_0x60d274[_0xf0fb('0x36')]({'attributes':['id',_0xf0fb('0x3')]}));_0x185ef2['push'](_0x60d274[_0xf0fb('0x37')]({'attributes':['id',_0xf0fb('0x3')]}));break;}return BPromise['all'](_0x185ef2);}})[_0xf0fb('0x15')](function(_0x287749){if(_0x287749&&_0x287749[_0xf0fb('0x38')]){for(var _0x416b5a=0x0;_0x416b5a<_0x287749['length'];_0x416b5a+=0x1){for(var _0x20a76e=0x0;_0x20a76e<_0x287749[_0x416b5a]['length'];_0x20a76e+=0x1){switch(_0x416b5a){case 0x0:joinOrLeaveQueues(_0x328e56,_0x350764,_0xf0fb('0x39'),_0x287749[_0x416b5a][_0x20a76e]);break;case 0x1:joinOrLeaveQueues(_0x328e56,_0x350764,_0xf0fb('0x3a'),_0x287749[_0x416b5a][_0x20a76e]);break;case 0x2:joinOrLeaveQueues(_0x328e56,_0x350764,_0xf0fb('0x3b'),_0x287749[_0x416b5a][_0x20a76e]);break;case 0x3:joinOrLeaveQueues(_0x328e56,_0x350764,_0xf0fb('0x3c'),_0x287749[_0x416b5a][_0x20a76e]);break;case 0x4:joinOrLeaveQueues(_0x328e56,_0x350764,_0xf0fb('0x3d'),_0x287749[_0x416b5a][_0x20a76e]);break;case 0x5:joinOrLeaveQueues(_0x328e56,_0x350764,_0xf0fb('0x3e'),_0x287749[_0x416b5a][_0x20a76e]);break;case 0x6:_0x328e56[_0x350764](util[_0xf0fb('0x18')]('telephone:%s',_0x287749[_0x416b5a][_0x20a76e]['name']));break;case 0x7:_0x328e56[_0x350764](util['format']('trunk:%s',_0x287749[_0x416b5a][_0x20a76e][_0xf0fb('0x3')]));break;case 0x8:_0x328e56[_0x350764](util[_0xf0fb('0x18')](_0xf0fb('0x3f'),_0x287749[_0x416b5a][_0x20a76e]['type'],_0x287749[_0x416b5a][_0x20a76e][_0xf0fb('0x3')]));break;case 0x9:_0x328e56[_0x350764](util['format'](_0xf0fb('0x25'),_0x287749[_0x416b5a][_0x20a76e][_0xf0fb('0x3')]));break;}}}}})[_0xf0fb('0x15')](function(){if(_0x350764===_0xf0fb('0x40')){var _0x151f68=_[_0xf0fb('0x41')](_0x598701[_0xf0fb('0x1f')],'id');return _0x598701['removeChatInteractions'](_0x151f68)[_0xf0fb('0x15')](function(){for(var _0x1471c9=0x0;_0x1471c9<_0x151f68['length'];_0x1471c9+=0x1){_0x180b5c['emit'](_0xf0fb('0x42'),{'ChatInteractionId':Number(_0x151f68[_0x1471c9]),'UserId':Number(_0x598701['id'])});}});}})[_0xf0fb('0x15')](function(){if(_0x350764===_0xf0fb('0x40')){var _0x226ef4=_['map'](_0x598701[_0xf0fb('0x21')],'id');return _0x598701[_0xf0fb('0x43')](_0x226ef4)[_0xf0fb('0x15')](function(){for(var _0x2a11e9=0x0;_0x2a11e9<_0x226ef4[_0xf0fb('0x38')];_0x2a11e9+=0x1){_0x180b5c[_0xf0fb('0x44')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x226ef4[_0x2a11e9]),'UserId':Number(_0x598701['id'])});}});}})[_0xf0fb('0x15')](function(){if(_0x350764==='leave'){var _0x2a6d39=_['map'](_0x598701['FaxInteractions'],'id');return _0x598701[_0xf0fb('0x45')](_0x2a6d39)[_0xf0fb('0x15')](function(){for(var _0x46eb99=0x0;_0x46eb99<_0x2a6d39[_0xf0fb('0x38')];_0x46eb99+=0x1){_0x180b5c[_0xf0fb('0x44')](_0xf0fb('0x46'),{'FaxInteractionId':Number(_0x2a6d39[_0x46eb99]),'UserId':Number(_0x598701['id'])});}});}})[_0xf0fb('0x15')](function(){if(_0x350764===_0xf0fb('0x40')){var _0x5ad1bf=_[_0xf0fb('0x41')](_0x598701['SmsInteractions'],'id');return _0x598701[_0xf0fb('0x47')](_0x5ad1bf)[_0xf0fb('0x15')](function(){for(var _0x170127=0x0;_0x170127<_0x5ad1bf[_0xf0fb('0x38')];_0x170127+=0x1){_0x180b5c['emit'](_0xf0fb('0x48'),{'SmsInteractionId':Number(_0x5ad1bf[_0x170127]),'UserId':Number(_0x598701['id'])});}});}})['then'](function(){if(_0x350764===_0xf0fb('0x40')){var _0x2a6f53=_['map'](_0x598701[_0xf0fb('0x49')],'id');return _0x598701[_0xf0fb('0x4a')](_0x2a6f53)['then'](function(){for(var _0x2bdf4c=0x0;_0x2bdf4c<_0x2a6f53[_0xf0fb('0x38')];_0x2bdf4c+=0x1){_0x180b5c[_0xf0fb('0x44')](_0xf0fb('0x4b'),{'OpenchannelInteractionId':Number(_0x2a6f53[_0x2bdf4c]),'UserId':Number(_0x598701['id'])});}});}})[_0xf0fb('0x4c')](function(_0x30ea55){_0x328e56[_0xf0fb('0x4d')](_0x30ea55);});}}function onDisconnect(_0x6c7f28,_0x3dfd78){joinOrLeave(_0x6c7f28,'leave',_0x3dfd78);}function onConnect(_0x4c1a22){joinOrLeave(_0x4c1a22,_0xf0fb('0x4e'));}exports['default']=function(_0x402d40){_0x402d40['on'](_0xf0fb('0x4f'),function(_0x226f3d){_0x226f3d[_0xf0fb('0x50')](0x0);_0x226f3d[_0xf0fb('0x51')]=_0x226f3d[_0xf0fb('0x52')]['connection']['remoteAddress']+':'+_0x226f3d[_0xf0fb('0x52')][_0xf0fb('0x4f')]['remotePort'];_0x226f3d[_0xf0fb('0x53')]=new Date();_0x226f3d['log']=function(_0x16e856){console[_0xf0fb('0x4d')](_0xf0fb('0x54')+_0x226f3d[_0xf0fb('0x55')][_0xf0fb('0x3')]+'['+_0x226f3d[_0xf0fb('0x51')]+']',_0x16e856);};_0x226f3d['on'](_0xf0fb('0x56'),function(){onDisconnect(_0x226f3d,_0x402d40);_0x226f3d[_0xf0fb('0x4d')](_0xf0fb('0x57'));});onConnect(_0x226f3d);_0x226f3d[_0xf0fb('0x4d')](_0xf0fb('0x58'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7beb895..887ccd9 100644 --- a/server/config/triggers/index.js +++ b/server/config/triggers/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf37=['newmessage','Sms','SmsInteraction','newinteraction','SmsMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch','direction','UserId','User','find','name','format','SIP/%s','channel','outgoingmessage','get','event','changed','closed','default','length','model','hook','callback','toLowerCase','../../mysqldb','../logger','client','http','Chat','ChatInteraction','afterUpdate','closedinteraction','afterCreate'];(function(_0x5bc95c,_0xfed759){var _0x3721fc=function(_0x49fca7){while(--_0x49fca7){_0x5bc95c['push'](_0x5bc95c['shift']());}};_0x3721fc(++_0xfed759);}(_0xdf37,0x1d7));var _0x7df3=function(_0x5a8984,_0x6aa4b6){_0x5a8984=_0x5a8984-0x0;var _0x16b1c4=_0xdf37[_0x5a8984];return _0x16b1c4;};'use strict';var util=require('util');var db=require(_0x7df3('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x7df3('0x1'))('triggers');var client=jayson[_0x7df3('0x2')][_0x7df3('0x3')]({'port':0x232a});var triggers=[{'channel':_0x7df3('0x4'),'model':'ChatInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x7df3('0x4'),'model':_0x7df3('0x5'),'event':_0x7df3('0x6'),'condition':_0x7df3('0x7'),'callback':afterUpdate},{'channel':_0x7df3('0x4'),'model':'ChatMessage','event':_0x7df3('0x8'),'condition':_0x7df3('0x9'),'callback':afterCreateMessage},{'channel':_0x7df3('0xa'),'model':_0x7df3('0xb'),'event':_0x7df3('0x8'),'condition':_0x7df3('0xc'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x7df3('0x6'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7df3('0xa'),'model':_0x7df3('0xd'),'event':_0x7df3('0x8'),'condition':_0x7df3('0x9'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x7df3('0xe'),'event':_0x7df3('0x8'),'condition':_0x7df3('0xc'),'callback':afterCreate},{'channel':_0x7df3('0xf'),'model':_0x7df3('0xe'),'event':_0x7df3('0x6'),'condition':_0x7df3('0x7'),'callback':afterUpdate},{'channel':'Fax','model':_0x7df3('0x10'),'event':_0x7df3('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x7df3('0x11'),'model':_0x7df3('0x12'),'event':_0x7df3('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7df3('0x11'),'model':_0x7df3('0x12'),'event':_0x7df3('0x6'),'condition':_0x7df3('0x7'),'callback':afterUpdate},{'channel':_0x7df3('0x11'),'model':_0x7df3('0x13'),'event':_0x7df3('0x8'),'condition':_0x7df3('0x9'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x7df3('0x14'),'event':'afterCreate','condition':_0x7df3('0xc'),'callback':afterCreate},{'channel':'Openchannel','model':_0x7df3('0x14'),'event':'afterUpdate','condition':_0x7df3('0x7'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x7df3('0x15'),'event':_0x7df3('0x8'),'condition':_0x7df3('0x9'),'callback':afterCreateMessage}];function request(_0x3a227c){return client['request'](_0x7df3('0x16'),_0x3a227c)[_0x7df3('0x17')](function(_0x40f473){logger[_0x7df3('0x18')](_0x7df3('0x19'),_0x7df3('0x16'),_0x40f473);if(_0x40f473[_0x7df3('0x1a')]){if(_0x40f473[_0x7df3('0x1a')][_0x7df3('0x1b')]===0x1f4){logger[_0x7df3('0x1a')](_0x7df3('0x19'),_0x7df3('0x16'),_0x40f473[_0x7df3('0x1a')]);}}})[_0x7df3('0x1c')](function(_0x3fec48){logger[_0x7df3('0x1a')](_0x7df3('0x19'),_0x7df3('0x16'),_0x3fec48);});}function afterCreateMessage(_0x47f307,_0x1e5f59){return function(_0x3d576f,_0x41b5e2){_0x3d576f=_0x3d576f['get']({'plain':!![]});_0x3d576f['channel']=_0x47f307;_0x3d576f['event']=_0x3d576f[_0x7df3('0x1d')];if(_0x3d576f[_0x7df3('0x1e')]){return db[_0x7df3('0x1f')][_0x7df3('0x20')]({'where':{'id':_0x3d576f[_0x7df3('0x1e')]},'attributes':['id',_0x7df3('0x21')],'raw':!![]})[_0x7df3('0x17')](function(_0x17a22b){_0x3d576f['interface']=util[_0x7df3('0x22')](_0x7df3('0x23'),_0x17a22b[_0x7df3('0x21')]);_0x3d576f[_0x7df3('0x24')]=_0x47f307;return request({'event':'incomingmessage','message':_0x3d576f});})['catch'](function(_0x522e25){console[_0x7df3('0x1a')](_0x522e25);});}else{return request({'event':_0x7df3('0x25'),'message':_0x3d576f});}};}function afterCreate(_0x24c076,_0x53dc58){return function(_0x39dc66,_0x2beadd){_0x39dc66=_0x39dc66[_0x7df3('0x26')]({'plain':!![]});_0x39dc66[_0x7df3('0x24')]=_0x24c076;_0x39dc66[_0x7df3('0x27')]='opened';return request({'event':_0x53dc58,'message':_0x39dc66});};}function afterUpdate(_0x39a292,_0xd62f4a){return function(_0x4b8b7d,_0x283ef2){if(_0x4b8b7d[_0x7df3('0x28')](_0x7df3('0x29'))&&_0x4b8b7d[_0x7df3('0x29')]){_0x4b8b7d=_0x4b8b7d['get']({'plain':!![]});_0x4b8b7d[_0x7df3('0x24')]=_0x39a292;_0x4b8b7d[_0x7df3('0x27')]=_0x7df3('0x29');if(_0x4b8b7d[_0x7df3('0x1e')]){return db['User'][_0x7df3('0x20')]({'where':{'id':_0x4b8b7d['UserId']},'attributes':['id',_0x7df3('0x21')],'raw':!![]})[_0x7df3('0x17')](function(_0x42bfb1){_0x4b8b7d['interface']=util[_0x7df3('0x22')](_0x7df3('0x23'),_0x42bfb1[_0x7df3('0x21')]);return request({'event':_0xd62f4a,'message':_0x4b8b7d});})[_0x7df3('0x1c')](function(_0x249ddc){console[_0x7df3('0x1a')](_0x249ddc);});}else{return request({'event':_0xd62f4a,'message':_0x4b8b7d});}}};}exports[_0x7df3('0x2a')]=function(){for(var _0x472c22=0x0;_0x472c22=_0x4e28ef[_0x5079('0x16')]){throw Error(_0x5079('0x17'));}_0x332770(_0x55285d);})['catch'](function(_0x4b51b5){_0xd555db(_0x4b51b5);});});}; \ No newline at end of file +var _0xf192=['sms','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','updateAttributes','getLicense','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','mail','fax'];(function(_0xf02353,_0x5d599b){var _0x59f7df=function(_0x2c7eb0){while(--_0x2c7eb0){_0xf02353['push'](_0xf02353['shift']());}};_0x59f7df(++_0x5d599b);}(_0xf192,0x113));var _0x2f19=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf192[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x2f19('0x0'));var BPromise=require('bluebird');var db=require(_0x2f19('0x1'))['db'];var util=require(_0x2f19('0x2'));var channels=['voice',_0x2f19('0x3'),'chat',_0x2f19('0x4'),_0x2f19('0x5'),_0x2f19('0x6')];exports['getChannels']=function(){return channels;};exports[_0x2f19('0x7')]=function(_0x4917c9){_0x4917c9=_0x4917c9[_0x2f19('0x8')]();return _[_0x2f19('0x9')](channels,_0x4917c9);};exports[_0x2f19('0xa')]=function(_0x106cc,_0x3a171e,_0x486571,_0x412139){var _0x599476={'loginAttempts':_0x3a171e,'blocked':_0x486571};if(!_['isUndefined'](_0x412139)){_0x599476['blockedAt']=_0x412139;}return _0x106cc[_0x2f19('0xb')](_0x599476);};exports[_0x2f19('0xc')]=function(_0x1299a3){return new BPromise(function(_0x31db81,_0x87250a){var _0x595f58=0x0;if(_0x1299a3['role']!=='agent'){_0x31db81(_0x1299a3);}db[_0x2f19('0xd')][_0x2f19('0xe')]({'where':{'role':_0x2f19('0xf'),'online':!![],'id':{'$ne':_0x1299a3['id']}}})[_0x2f19('0x10')](function(_0x4a85ab){_0x595f58=_0x4a85ab;return util[_0x2f19('0xc')]();})[_0x2f19('0x10')](function(_0x55463f){if(_0x55463f&&_0x55463f[_0x2f19('0x11')]&&_0x595f58>=_0x55463f[_0x2f19('0x11')]){throw Error(_0x2f19('0x12'));}_0x31db81(_0x1299a3);})[_0x2f19('0x13')](function(_0x1acc8b){_0x87250a(_0x1acc8b);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 32902ed..d015ad4 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4b8=['render','json','send','exports','404','status'];(function(_0x10d6f5,_0x140245){var _0x484db4=function(_0x2f7ec4){while(--_0x2f7ec4){_0x10d6f5['push'](_0x10d6f5['shift']());}};_0x484db4(++_0x140245);}(_0xf4b8,0x195));var _0x8f4b=function(_0x2268a1,_0x711ed8){_0x2268a1=_0x2268a1-0x0;var _0x4c11ca=_0xf4b8[_0x2268a1];return _0x4c11ca;};'use strict';module[_0x8f4b('0x0')][0x194]=function pageNotFound(_0x20c0ed,_0xa8973f){var _0x3b562a=_0x8f4b('0x1');var _0x1354c3=0x194;var _0x10c72c={'status':_0x1354c3};_0xa8973f[_0x8f4b('0x2')](_0x10c72c[_0x8f4b('0x2')]);_0xa8973f[_0x8f4b('0x3')](_0x3b562a,{},function(_0x23a390,_0x40a405){if(_0x23a390){return _0xa8973f[_0x8f4b('0x2')](_0x10c72c[_0x8f4b('0x2')])[_0x8f4b('0x4')](_0x10c72c);}_0xa8973f[_0x8f4b('0x5')](_0x40a405);});}; \ No newline at end of file +var _0x82a4=['404','status','json','exports'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x82a4,0x177));var _0x482a=function(_0x5f542d,_0x388718){_0x5f542d=_0x5f542d-0x0;var _0x4c7d46=_0x82a4[_0x5f542d];return _0x4c7d46;};'use strict';module[_0x482a('0x0')][0x194]=function pageNotFound(_0x38e98e,_0x4a3762){var _0x51db2a=_0x482a('0x1');var _0x49dae3=0x194;var _0x432bcf={'status':_0x49dae3};_0x4a3762['status'](_0x432bcf[_0x482a('0x2')]);_0x4a3762['render'](_0x51db2a,{},function(_0x4ede8c,_0x53d3f1){if(_0x4ede8c){return _0x4a3762[_0x482a('0x2')](_0x432bcf['status'])[_0x482a('0x3')](_0x432bcf);}_0x4a3762['send'](_0x53d3f1);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8a64b33..8943b20 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f03=['MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','Schedule','../api/sound/sound.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileResource/userProfileResource.model','hasOne','hasMany','Recordings','UserId','Extensions','cascade','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','SmsQueue','SmsQueues','UserSmsQueue','OpenchannelQueue','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','Sound','Sounds','moh_has_sounds','Members','Hoppers','HopperFinals','VoiceQueueId','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkBackup','Pause','mandatoryDispositionPause','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccount','MailAccountId','MailServerOut','Imap','Smtp','Dispositions','Answers','Interactions','Applications','List','ListId','TemplateId','mandatoryDispositionPauseId','Agents','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','Users','user_has_mail_interactions','Interaction','restrict','IntervalId','Items','FaxAccountId','Exntensions','TagId','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','ThroughTags','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','openchannel_interaction_has_tags','OpenchannelInteractionId','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','AllConditions','AnyConditions','TriggerAnyId','Actions','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmField','Descriptions','DeskField','int_desk_configuration_has_tags','ZohoAccount','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','Dynamics365Account','Dynamics365Field','ChatQueueReport','FromId','SessionId','ProjectId','user_has_teams','team_has_mail_queues','team_has_chat_queues','FaxQueues','TrunkId','TrunkBackupId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileSections','UserProfileResource','sectionId','../config/environment','sequelize','jstz','determine','motion2','xC@LL1234','127.0.0.1','mysql','name','utf8','sequelizeHistory','defaultsDeep','xcall','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model'];(function(_0x550b2d,_0x595767){var _0x580d3f=function(_0x115225){while(--_0x115225){_0x550b2d['push'](_0x550b2d['shift']());}};_0x580d3f(++_0x595767);}(_0x0f03,0x18e));var _0x30f0=function(_0x203849,_0x5d540f){_0x203849=_0x203849-0x0;var _0x538eda=_0x0f03[_0x203849];return _0x538eda;};'use strict';var path=require('path');var config=require(_0x30f0('0x0'));var Sequelize=require(_0x30f0('0x1'));var _=require('lodash');var jstz=require(_0x30f0('0x2'));var timezone=jstz[_0x30f0('0x3')]();config[_0x30f0('0x1')]=_['defaultsDeep'](config[_0x30f0('0x1')],{'database':_0x30f0('0x4'),'username':'xcall','password':_0x30f0('0x5'),'options':{'host':_0x30f0('0x6'),'port':0xcea,'dialect':_0x30f0('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x30f0('0x8')](),'define':{'charset':_0x30f0('0x9'),'collate':'utf8_general_ci'}}});config[_0x30f0('0xa')]=_[_0x30f0('0xb')](config[_0x30f0('0xa')],{'database':_0x30f0('0x4'),'username':_0x30f0('0xc'),'password':_0x30f0('0x5'),'options':{'host':_0x30f0('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x30f0('0x8')](),'define':{'charset':_0x30f0('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x30f0('0x1')][_0x30f0('0xd')],config[_0x30f0('0x1')][_0x30f0('0xe')],config[_0x30f0('0x1')][_0x30f0('0xf')],config[_0x30f0('0x1')][_0x30f0('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x30f0('0xa')][_0x30f0('0xd')],config[_0x30f0('0xa')][_0x30f0('0xe')],config[_0x30f0('0xa')][_0x30f0('0xf')],config['sequelizeHistory'][_0x30f0('0x10')])};db[_0x30f0('0x11')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x13'));db['VoiceChanSpy']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x14'));db[_0x30f0('0x15')]=db['sequelize'][_0x30f0('0x12')]('../api/voiceContext/voiceContext.model');db[_0x30f0('0x16')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/voiceExtension/voiceExtension.model');db[_0x30f0('0x17')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x18'));db[_0x30f0('0x19')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x1a'));db['VoiceRecording']=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x1b'));db[_0x30f0('0x1c')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x1d'));db[_0x30f0('0x1e')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x1f'));db[_0x30f0('0x20')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x30f0('0x21')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x22'));db['VoiceDialReport']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x23'));db[_0x30f0('0x24')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x25'));db['VoiceQueueReport']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x26'));db[_0x30f0('0x27')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x28'));db[_0x30f0('0x29')]=db['sequelize']['import'](_0x30f0('0x2a'));db[_0x30f0('0x2b')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x2c'));db[_0x30f0('0x2d')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x2e'));db[_0x30f0('0x2f')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x30'));db[_0x30f0('0x31')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x32'));db[_0x30f0('0x33')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x34'));db[_0x30f0('0x35')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x36'));db['UserSmsQueue']=db[_0x30f0('0x1')]['import'](_0x30f0('0x37'));db[_0x30f0('0x38')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x39'));db[_0x30f0('0x3a')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x30f0('0x1')]['import'](_0x30f0('0x3b'));db['MailAccount']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x3c'));db[_0x30f0('0x3d')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x3e'));db['MailSubstatus']=db[_0x30f0('0x1')]['import'](_0x30f0('0x3f'));db[_0x30f0('0x40')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x41'));db[_0x30f0('0x42')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x43'));db[_0x30f0('0x44')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x45'));db[_0x30f0('0x46')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x47'));db[_0x30f0('0x48')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x49'));db[_0x30f0('0x4a')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x4b'));db[_0x30f0('0x4c')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x4d'));db[_0x30f0('0x4e')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x4f'));db[_0x30f0('0x50')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/faxInteraction/faxInteraction.model');db[_0x30f0('0x51')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x52'));db[_0x30f0('0x53')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x54'));db[_0x30f0('0x55')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x56'));db[_0x30f0('0x57')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x58'));db[_0x30f0('0x59')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x5a'));db[_0x30f0('0x5b')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x5c'));db['SmsMessage']=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x5d'));db['SmsQueue']=db['sequelize']['import'](_0x30f0('0x5e'));db[_0x30f0('0x5f')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x60'));db[_0x30f0('0x61')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x62'));db[_0x30f0('0x63')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x64'));db['OpenchannelMessage']=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db['sequelize']['import'](_0x30f0('0x65'));db[_0x30f0('0x66')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x67'));db[_0x30f0('0x68')]=db['sequelize'][_0x30f0('0x12')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x30f0('0x69')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x6a'));db[_0x30f0('0x6b')]=db['sequelize'][_0x30f0('0x12')]('../api/chatInteraction/chatInteraction.model');db[_0x30f0('0x6c')]=db['sequelize']['import'](_0x30f0('0x6d'));db[_0x30f0('0x6e')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x6f'));db[_0x30f0('0x70')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x71'));db[_0x30f0('0x72')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x73'));db['ChatProactiveAction']=db[_0x30f0('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x30f0('0x74')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x75'));db[_0x30f0('0x76')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x77'));db[_0x30f0('0x78')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x79'));db['CmHopperBlack']=db['sequelize']['import'](_0x30f0('0x7a'));db[_0x30f0('0x7b')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x30f0('0x7c')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x30f0('0x7d')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x7e'));db[_0x30f0('0x7f')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x30f0('0x80')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/action/action.model');db[_0x30f0('0x81')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x82'));db[_0x30f0('0x83')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x84'));db[_0x30f0('0x85')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x86'));db[_0x30f0('0x87')]=db['sequelize']['import'](_0x30f0('0x88'));db[_0x30f0('0x89')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x8a'));db['Pause']=db['sequelize'][_0x30f0('0x12')]('../api/pause/pause.model');db[_0x30f0('0x8b')]=db[_0x30f0('0x1')]['import'](_0x30f0('0x8c'));db['VoiceQueuesLog']=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x30f0('0x8d')]=db['sequelize'][_0x30f0('0x12')]('../api/schedule/schedule.model');db['Sound']=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x8e'));db['Tag']=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/tag/tag.model');db[_0x30f0('0x8f')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x90'));db[_0x30f0('0x91')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x92'));db[_0x30f0('0x93')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x94'));db[_0x30f0('0x95')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x96'));db[_0x30f0('0x97')]=db['sequelize']['import'](_0x30f0('0x98'));db[_0x30f0('0x99')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x9a'));db[_0x30f0('0x9b')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0x9c'));db[_0x30f0('0x9d')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x9e'));db[_0x30f0('0x9f')]=db[_0x30f0('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x30f0('0xa0')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xa1'));db[_0x30f0('0xa2')]=db[_0x30f0('0x1')]['import'](_0x30f0('0xa3'));db[_0x30f0('0xa4')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x30f0('0xa5')]=db[_0x30f0('0x1')]['import'](_0x30f0('0xa6'));db[_0x30f0('0xa7')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x30f0('0xa8')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x30f0('0xa9')]=db[_0x30f0('0x1')]['import'](_0x30f0('0xaa'));db['SugarcrmField']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xab'));db[_0x30f0('0xac')]=db['sequelize'][_0x30f0('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0x30f0('0xad')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0x30f0('0x1')]['import'](_0x30f0('0xae'));db['ZohoAccount']=db['sequelize']['import'](_0x30f0('0xaf'));db[_0x30f0('0xb0')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xb1'));db[_0x30f0('0xb2')]=db['sequelize']['import'](_0x30f0('0xb3'));db[_0x30f0('0xb4')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xb5'));db[_0x30f0('0xb6')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xb7'));db['ZendeskField']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xb8'));db[_0x30f0('0xb9')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xba'));db['FreshdeskConfiguration']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xbb'));db[_0x30f0('0xbc')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x30f0('0xbd')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xbe'));db[_0x30f0('0xbf')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xc0'));db[_0x30f0('0xc1')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xc2'));db[_0x30f0('0xc3')]=db['sequelize']['import'](_0x30f0('0xc4'));db[_0x30f0('0xc5')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xc6'));db[_0x30f0('0xc7')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xc8'));db['Dynamics365Account']=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xc9'));db[_0x30f0('0xca')]=db['sequelize']['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db['sequelize'][_0x30f0('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x30f0('0xcb')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xcc'));db[_0x30f0('0xcd')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xce'));db[_0x30f0('0xcf')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x30f0('0x95')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0x96'));db['Network']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xd0'));db['ChatQueueReport']=db['sequelize']['import'](_0x30f0('0xd1'));db[_0x30f0('0xd2')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x30f0('0xd3')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xd4'));db[_0x30f0('0xd5')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xd6'));db[_0x30f0('0xd7')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xd8'));db[_0x30f0('0xd9')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xda'));db[_0x30f0('0xdb')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/squareReport/squareReport.model');db[_0x30f0('0xdc')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xdd'));db[_0x30f0('0xde')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/jscriptyProject/jscriptyProject.model');db[_0x30f0('0xdf')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/setting/setting.model');db[_0x30f0('0xe0')]=db['sequelize']['import'](_0x30f0('0xe1'));db[_0x30f0('0xe2')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xe3'));db[_0x30f0('0xe4')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xe5'));db['SquareMessage']=db['sequelize'][_0x30f0('0x12')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xe6'));db['License']=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xe7'));db[_0x30f0('0xe8')]=db[_0x30f0('0x1')]['import'](_0x30f0('0xe9'));db[_0x30f0('0xea')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xeb'));db[_0x30f0('0xec')]=db[_0x30f0('0x1')]['import']('../api/attachment/attachment.model');db['Plugin']=db['sequelize']['import']('../api/plugin/plugin.model');db[_0x30f0('0xed')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xee'));db[_0x30f0('0xef')]=db[_0x30f0('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x30f0('0xf0')]=db['sequelize']['import'](_0x30f0('0xf1'));db['OpenchannelTransferReport']=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xf2'));db[_0x30f0('0xf3')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/smsTransferReport/smsTransferReport.model');db[_0x30f0('0xf4')]=db['sequelize']['import'](_0x30f0('0xf5'));db[_0x30f0('0xf6')]=db[_0x30f0('0x1')][_0x30f0('0x12')](_0x30f0('0xf7'));db[_0x30f0('0xf8')]=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xf9'));db[_0x30f0('0xfa')]=db[_0x30f0('0x1')][_0x30f0('0x12')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db['sequelize'][_0x30f0('0x12')](_0x30f0('0xfb'));db[_0x30f0('0x11')][_0x30f0('0xfc')](db[_0x30f0('0x1e')],{'as':_0x30f0('0x1e'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x30f0('0x11')][_0x30f0('0xfd')](db['VoiceRecording'],{'as':_0x30f0('0xfe'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x11')]['hasMany'](db[_0x30f0('0x2d')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x30f0('0x11')][_0x30f0('0xfd')](db[_0x30f0('0x16')],{'as':_0x30f0('0x100'),'onDelete':_0x30f0('0x101'),'hooks':!![]});db['User']['hasMany'](db[_0x30f0('0x7b')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x30f0('0x11')]['hasMany'](db[_0x30f0('0x7c')],{'as':_0x30f0('0x102'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x11')][_0x30f0('0xfd')](db[_0x30f0('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0x30f0('0xff')});db[_0x30f0('0x11')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x30f0('0x103'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x11')][_0x30f0('0xfd')](db[_0x30f0('0x6b')],{'as':_0x30f0('0x104'),'foreignKey':'UserId'});db['User'][_0x30f0('0xfd')](db[_0x30f0('0x5b')],{'as':_0x30f0('0x105'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x11')][_0x30f0('0xfd')](db['FaxInteraction'],{'as':_0x30f0('0x106'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x11')]['hasMany'](db[_0x30f0('0x40')],{'as':_0x30f0('0x107'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x11')][_0x30f0('0x108')](db[_0x30f0('0xf8')],{'as':_0x30f0('0xf8'),'foreignKey':'userProfileId'});db[_0x30f0('0x11')]['belongsToMany'](db[_0x30f0('0x72')],{'as':_0x30f0('0x109'),'through':_0x30f0('0x10a')});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x76')],{'as':_0x30f0('0x10c'),'through':_0x30f0('0x10d')});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0xf4')],{'as':_0x30f0('0x10e'),'through':_0x30f0('0x10f')});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x110')],{'through':'user_has_teams'});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x40')],{'as':_0x30f0('0x107'),'through':'user_has_mail_interactions'});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x6b')],{'as':'ChatInteractions','through':_0x30f0('0x111')});db['User']['belongsToMany'](db[_0x30f0('0x50')],{'as':_0x30f0('0x106'),'through':_0x30f0('0x112')});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x5b')],{'as':_0x30f0('0x105'),'through':_0x30f0('0x113')});db['User'][_0x30f0('0x10b')](db['OpenchannelInteraction'],{'as':_0x30f0('0x103'),'through':_0x30f0('0x114')});db['User']['belongsToMany'](db[_0x30f0('0x19')],{'as':_0x30f0('0x115'),'through':_0x30f0('0x2f'),'required':![]});db[_0x30f0('0x11')]['belongsToMany'](db['MailQueue'],{'as':_0x30f0('0x116'),'through':'UserMailQueue','required':![]});db['User']['belongsToMany'](db['ChatQueue'],{'as':'ChatQueues','through':_0x30f0('0x31'),'required':![],'hooks':!![]});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x53')],{'as':'FaxQueues','through':_0x30f0('0x35'),'required':![]});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x117')],{'as':_0x30f0('0x118'),'through':_0x30f0('0x119'),'required':![]});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x11a')],{'as':_0x30f0('0x11b'),'through':_0x30f0('0x38'),'required':![]});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0xf4')],{'through':'cm_user_has_lists'});db[_0x30f0('0x11')]['belongsToMany'](db[_0x30f0('0xf6')],{'as':_0x30f0('0x11c'),'through':_0x30f0('0x11d'),'required':![]});db[_0x30f0('0x11')]['belongsToMany'](db[_0x30f0('0x66')],{'as':_0x30f0('0x11e'),'through':_0x30f0('0x11f')});db[_0x30f0('0x11')]['belongsToMany'](db['FaxAccount'],{'as':_0x30f0('0x120'),'through':_0x30f0('0x121')});db[_0x30f0('0x11')][_0x30f0('0x10b')](db['MailAccount'],{'as':_0x30f0('0x122'),'through':_0x30f0('0x123')});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x5f')],{'as':_0x30f0('0x124'),'through':_0x30f0('0x125')});db[_0x30f0('0x11')][_0x30f0('0x10b')](db[_0x30f0('0x57')],{'as':_0x30f0('0x126'),'through':_0x30f0('0x127')});db['User'][_0x30f0('0x10b')](db[_0x30f0('0xe2')],{'as':_0x30f0('0x128'),'through':_0x30f0('0x129')});db[_0x30f0('0x12a')][_0x30f0('0xfd')](db[_0x30f0('0x16')],{'as':_0x30f0('0x12b'),'onDelete':_0x30f0('0x101'),'foreignKey':'ChanSpyId'});db[_0x30f0('0x15')][_0x30f0('0xfd')](db[_0x30f0('0x16')],{'onDelete':_0x30f0('0x101')});db[_0x30f0('0x16')][_0x30f0('0xfd')](db[_0x30f0('0x16')],{'as':'Applications','onDelete':_0x30f0('0x101')});db['VoiceMusicOnHold']['belongsToMany'](db[_0x30f0('0x12c')],{'as':_0x30f0('0x12d'),'through':_0x30f0('0x12e')});db[_0x30f0('0x19')][_0x30f0('0xfd')](db[_0x30f0('0x2d')],{'as':_0x30f0('0x12f'),'foreignKey':'VoiceQueueId'});db[_0x30f0('0x19')][_0x30f0('0xfd')](db[_0x30f0('0x78')],{'as':_0x30f0('0x130'),'foreignKey':'VoiceQueueId'});db[_0x30f0('0x19')]['hasMany'](db['CmHopperFinal'],{'as':_0x30f0('0x131'),'foreignKey':_0x30f0('0x132')});db[_0x30f0('0x19')][_0x30f0('0xfd')](db[_0x30f0('0x7c')],{'as':_0x30f0('0x133'),'foreignKey':_0x30f0('0x132')});db[_0x30f0('0x19')]['hasMany'](db[_0x30f0('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0x30f0('0x132')});db['VoiceQueue'][_0x30f0('0xfd')](db[_0x30f0('0x134')],{'as':_0x30f0('0x135'),'foreignKey':'VoiceQueueId'});db[_0x30f0('0x19')]['hasMany'](db[_0x30f0('0xd7')],{'as':_0x30f0('0x136'),'foreignKey':_0x30f0('0x132')});db[_0x30f0('0x19')][_0x30f0('0x108')](db[_0x30f0('0x29')],{'as':_0x30f0('0x29'),'foreignKey':'TrunkId'});db[_0x30f0('0x19')][_0x30f0('0x108')](db['Trunk'],{'as':_0x30f0('0x137'),'foreignKey':'TrunkBackupId'});db[_0x30f0('0x19')][_0x30f0('0x108')](db[_0x30f0('0x89')],{'as':_0x30f0('0x89'),'foreignKey':'IntervalId'});db[_0x30f0('0x19')][_0x30f0('0x108')](db[_0x30f0('0x138')],{'as':_0x30f0('0x139'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x30f0('0x19')][_0x30f0('0x10b')](db['CmList'],{'as':_0x30f0('0x10e'),'through':'voice_queues_has_cm_lists'});db[_0x30f0('0x19')]['belongsToMany'](db[_0x30f0('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x30f0('0x19')][_0x30f0('0x10b')](db[_0x30f0('0x110')],{'as':'Teams','through':_0x30f0('0x13a')});db['VoiceQueue']['belongsToMany'](db[_0x30f0('0xf4')],{'as':_0x30f0('0x13b'),'through':_0x30f0('0x13c')});db[_0x30f0('0x13d')]['belongsTo'](db[_0x30f0('0x11')],{'as':'User','foreignKey':_0x30f0('0xff')});db[_0x30f0('0x1c')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'as':_0x30f0('0x11'),'foreignKey':'UserId'});db[_0x30f0('0x1e')]['hasMany'](db[_0x30f0('0x20')],{'as':_0x30f0('0x13e'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x13f'),'sourceKey':_0x30f0('0x140')});db['VoiceMailMessage'][_0x30f0('0x108')](db[_0x30f0('0x1e')],{'foreignKey':_0x30f0('0x13f'),'targetKey':_0x30f0('0x140')});db['VoiceCallReport']['hasMany'](db['VoiceQueueReport'],{'as':_0x30f0('0x141'),'foreignKey':_0x30f0('0x142'),'constraints':![]});db[_0x30f0('0x21')][_0x30f0('0xfd')](db[_0x30f0('0x24')],{'as':_0x30f0('0x143'),'foreignKey':_0x30f0('0x142'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x30f0('0x11')],{'as':_0x30f0('0x11'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x21')][_0x30f0('0x108')](db[_0x30f0('0x76')],{'as':_0x30f0('0x144'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x3a')][_0x30f0('0x108')](db[_0x30f0('0x146')],{'as':_0x30f0('0x146'),'foreignKey':_0x30f0('0x147')});db[_0x30f0('0x148')]['belongsTo'](db['MailAccount'],{'as':_0x30f0('0x146'),'foreignKey':_0x30f0('0x147')});db[_0x30f0('0x146')]['hasOne'](db[_0x30f0('0x3a')],{'as':_0x30f0('0x149'),'onDelete':_0x30f0('0x101')});db[_0x30f0('0x146')]['hasOne'](db[_0x30f0('0x148')],{'as':_0x30f0('0x14a'),'onDelete':_0x30f0('0x101')});db[_0x30f0('0x146')]['hasMany'](db[_0x30f0('0x85')],{'as':_0x30f0('0x14b'),'foreignKey':'MailAccountId'});db[_0x30f0('0x146')]['hasMany'](db[_0x30f0('0x83')],{'as':_0x30f0('0x14c'),'foreignKey':_0x30f0('0x147')});db[_0x30f0('0x146')][_0x30f0('0xfd')](db['MailMessage'],{'as':_0x30f0('0x13e'),'foreignKey':_0x30f0('0x147')});db[_0x30f0('0x146')][_0x30f0('0xfd')](db[_0x30f0('0x40')],{'as':_0x30f0('0x14d')});db['MailAccount'][_0x30f0('0xfd')](db[_0x30f0('0x44')],{'as':_0x30f0('0x14e')});db[_0x30f0('0x146')][_0x30f0('0x108')](db[_0x30f0('0xf4')],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150')});db[_0x30f0('0x146')]['belongsTo'](db[_0x30f0('0x8f')],{'as':_0x30f0('0x8f'),'foreignKey':_0x30f0('0x151')});db[_0x30f0('0x146')][_0x30f0('0x108')](db[_0x30f0('0x138')],{'as':_0x30f0('0x139'),'foreignKey':_0x30f0('0x152')});db[_0x30f0('0x146')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x153'),'through':_0x30f0('0x123')});db['MailQueue'][_0x30f0('0x10b')](db['User'],{'as':_0x30f0('0x153'),'through':_0x30f0('0x33')});db[_0x30f0('0x3d')][_0x30f0('0x10b')](db['Team'],{'through':'team_has_mail_queues','as':_0x30f0('0x154')});db['MailInteraction'][_0x30f0('0xfd')](db[_0x30f0('0x42')],{'as':_0x30f0('0x13e'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x155')});db[_0x30f0('0x40')]['belongsTo'](db['MailAccount'],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x147')});db[_0x30f0('0x40')][_0x30f0('0x108')](db['CmContact'],{'as':_0x30f0('0x144'),'foreignKey':'ContactId'});db[_0x30f0('0x40')][_0x30f0('0x108')](db['User'],{'as':_0x30f0('0x157'),'foreignKey':_0x30f0('0xff')});db['MailInteraction'][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x159'),'as':_0x30f0('0x15a')});db['MailInteraction'][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x159'),'as':'ThroughTags'});db[_0x30f0('0x40')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x15b'),'through':_0x30f0('0x15c'),'foreignKey':'MailInteractionId'});db[_0x30f0('0x42')]['hasMany'](db[_0x30f0('0xec')],{'as':'Attachments','onDelete':_0x30f0('0x101')});db[_0x30f0('0x42')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'as':_0x30f0('0x11')});db[_0x30f0('0x42')]['belongsTo'](db[_0x30f0('0x76')],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x144')});db[_0x30f0('0x42')]['belongsTo'](db[_0x30f0('0x40')],{'as':_0x30f0('0x15d'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x30f0('0x108')](db[_0x30f0('0x146')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x147')});db[_0x30f0('0x44')]['belongsTo'](db[_0x30f0('0x11')],{'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x44')]['belongsTo'](db[_0x30f0('0x3d')],{'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x44')][_0x30f0('0x108')](db[_0x30f0('0x146')],{'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x44')][_0x30f0('0x108')](db[_0x30f0('0x89')],{'onDelete':_0x30f0('0x15e'),'foreignKey':_0x30f0('0x15f')});db[_0x30f0('0x44')]['belongsTo'](db[_0x30f0('0x158')],{'onDelete':_0x30f0('0x15e'),'foreignKey':'TagId'});db[_0x30f0('0x46')][_0x30f0('0x108')](db[_0x30f0('0x146')],{});db[_0x30f0('0x46')][_0x30f0('0x108')](db[_0x30f0('0xf4')],{'as':'List','foreignKey':_0x30f0('0x150')});db['MailQueueReport'][_0x30f0('0x108')](db[_0x30f0('0x76')],{'as':_0x30f0('0x144'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x46')][_0x30f0('0x108')](db[_0x30f0('0x40')],{});db[_0x30f0('0x46')][_0x30f0('0x108')](db['MailMessage'],{});db[_0x30f0('0x46')]['belongsTo'](db[_0x30f0('0x11')],{});db[_0x30f0('0x46')][_0x30f0('0x108')](db[_0x30f0('0x3d')],{});db[_0x30f0('0x48')]['hasMany'](db['DashboardItem'],{'as':_0x30f0('0x160'),'onDelete':_0x30f0('0x101')});db[_0x30f0('0x4c')][_0x30f0('0xfd')](db[_0x30f0('0x85')],{'as':_0x30f0('0x14b'),'foreignKey':_0x30f0('0x161')});db['FaxAccount'][_0x30f0('0xfd')](db[_0x30f0('0x83')],{'as':_0x30f0('0x14c'),'foreignKey':_0x30f0('0x161')});db[_0x30f0('0x4c')]['hasMany'](db[_0x30f0('0x50')],{'as':_0x30f0('0x14d')});db[_0x30f0('0x4c')][_0x30f0('0xfd')](db['FaxApplication'],{'as':_0x30f0('0x14e')});db['FaxAccount'][_0x30f0('0xfd')](db[_0x30f0('0x16')],{'as':_0x30f0('0x162'),'onDelete':_0x30f0('0x101')});db['FaxAccount'][_0x30f0('0xfd')](db[_0x30f0('0x51')],{'as':_0x30f0('0x13e')});db[_0x30f0('0x4c')][_0x30f0('0x108')](db[_0x30f0('0x29')],{'as':_0x30f0('0x29')});db['FaxAccount']['belongsTo'](db[_0x30f0('0xf4')],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150')});db[_0x30f0('0x4c')][_0x30f0('0x108')](db[_0x30f0('0x138')],{'as':_0x30f0('0x139'),'foreignKey':_0x30f0('0x152')});db[_0x30f0('0x4c')]['belongsToMany'](db[_0x30f0('0x11')],{'as':'Agents','through':_0x30f0('0x121')});db[_0x30f0('0x4e')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'onDelete':'restrict'});db[_0x30f0('0x4e')][_0x30f0('0x108')](db[_0x30f0('0x53')],{'onDelete':_0x30f0('0x15e')});db['FaxApplication'][_0x30f0('0x108')](db[_0x30f0('0x4c')],{'onDelete':_0x30f0('0x15e')});db['FaxApplication']['belongsTo'](db[_0x30f0('0x158')],{'onDelete':_0x30f0('0x15e'),'foreignKey':_0x30f0('0x163')});db[_0x30f0('0x50')][_0x30f0('0xfd')](db[_0x30f0('0x51')],{'as':_0x30f0('0x13e'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x164')});db['FaxInteraction'][_0x30f0('0x108')](db['FaxAccount'],{'as':'Account','foreignKey':_0x30f0('0x161')});db[_0x30f0('0x50')]['belongsTo'](db[_0x30f0('0x76')],{'as':'Contact','foreignKey':'ContactId'});db[_0x30f0('0x50')][_0x30f0('0x108')](db['User'],{'as':'Owner','foreignKey':_0x30f0('0xff')});db[_0x30f0('0x50')][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x165'),'as':_0x30f0('0x15a')});db['FaxInteraction'][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db['FaxInteraction'][_0x30f0('0x10b')](db['User'],{'as':'Users','through':_0x30f0('0x112'),'foreignKey':_0x30f0('0x164')});db[_0x30f0('0x51')]['belongsTo'](db[_0x30f0('0x11')],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x11')});db[_0x30f0('0x51')][_0x30f0('0x108')](db['FaxInteraction'],{'as':_0x30f0('0x15d'),'foreignKey':_0x30f0('0x164')});db[_0x30f0('0x51')][_0x30f0('0x108')](db[_0x30f0('0x76')],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x144')});db[_0x30f0('0x51')][_0x30f0('0x108')](db[_0x30f0('0xec')],{'as':_0x30f0('0xec'),'foreignKey':'AttachmentId'});db[_0x30f0('0x51')][_0x30f0('0x108')](db[_0x30f0('0x4c')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x161')});db[_0x30f0('0x53')][_0x30f0('0x10b')](db['User'],{'as':_0x30f0('0x153'),'through':_0x30f0('0x35')});db[_0x30f0('0x53')][_0x30f0('0x10b')](db[_0x30f0('0x110')],{'through':_0x30f0('0x166'),'as':_0x30f0('0x154')});db['FaxQueueReport']['belongsTo'](db[_0x30f0('0x4c')],{});db['FaxQueueReport']['belongsTo'](db[_0x30f0('0xf4')],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150')});db['FaxQueueReport'][_0x30f0('0x108')](db['CmContact'],{'as':_0x30f0('0x144'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x55')][_0x30f0('0x108')](db[_0x30f0('0x50')],{});db['FaxQueueReport']['belongsTo'](db['FaxMessage'],{});db[_0x30f0('0x55')][_0x30f0('0x108')](db[_0x30f0('0x11')],{});db[_0x30f0('0x55')][_0x30f0('0x108')](db[_0x30f0('0x53')],{});db['SmsAccount'][_0x30f0('0xfd')](db[_0x30f0('0x85')],{'as':_0x30f0('0x14b'),'foreignKey':'SmsAccountId'});db[_0x30f0('0x57')][_0x30f0('0xfd')](db['CannedAnswer'],{'as':_0x30f0('0x14c'),'foreignKey':_0x30f0('0x167')});db['SmsAccount']['hasMany'](db[_0x30f0('0x168')],{'as':_0x30f0('0x13e'),'foreignKey':_0x30f0('0x167')});db[_0x30f0('0x57')]['hasMany'](db['SmsInteraction'],{'as':_0x30f0('0x14d')});db[_0x30f0('0x57')][_0x30f0('0xfd')](db['SmsApplication'],{'as':_0x30f0('0x14e')});db[_0x30f0('0x57')][_0x30f0('0x108')](db[_0x30f0('0xf4')],{'as':_0x30f0('0x14f'),'foreignKey':'ListId'});db[_0x30f0('0x57')][_0x30f0('0x108')](db[_0x30f0('0x138')],{'as':_0x30f0('0x139'),'foreignKey':_0x30f0('0x152')});db[_0x30f0('0x57')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':'Agents','through':_0x30f0('0x127')});db[_0x30f0('0x59')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x59')][_0x30f0('0x108')](db[_0x30f0('0x117')],{'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x59')]['belongsTo'](db[_0x30f0('0x57')],{'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x59')]['belongsTo'](db['Interval'],{'onDelete':_0x30f0('0x15e'),'foreignKey':_0x30f0('0x15f')});db[_0x30f0('0x59')][_0x30f0('0x108')](db[_0x30f0('0x158')],{'onDelete':_0x30f0('0x15e'),'foreignKey':_0x30f0('0x163')});db['SmsInteraction'][_0x30f0('0xfd')](db[_0x30f0('0x168')],{'as':_0x30f0('0x13e'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x169')});db[_0x30f0('0x5b')]['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0x30f0('0x167')});db[_0x30f0('0x5b')][_0x30f0('0x108')](db[_0x30f0('0x76')],{'as':_0x30f0('0x144'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x5b')]['belongsTo'](db['User'],{'as':_0x30f0('0x157'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x5b')]['belongsToMany'](db[_0x30f0('0x158')],{'through':_0x30f0('0x16a'),'as':_0x30f0('0x15a')});db['SmsInteraction'][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x16a'),'as':_0x30f0('0x16b')});db[_0x30f0('0x5b')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x15b'),'through':'user_has_sms_interactions','foreignKey':_0x30f0('0x169')});db['SmsMessage'][_0x30f0('0x108')](db['User'],{'as':'User'});db['SmsMessage'][_0x30f0('0x108')](db[_0x30f0('0x76')],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x144')});db[_0x30f0('0x168')][_0x30f0('0x108')](db[_0x30f0('0x5b')],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x15d'),'foreignKey':_0x30f0('0x169')});db['SmsMessage'][_0x30f0('0x108')](db[_0x30f0('0x57')],{'as':'Account','foreignKey':_0x30f0('0x167')});db[_0x30f0('0x117')]['belongsToMany'](db[_0x30f0('0x11')],{'as':'Agents','through':_0x30f0('0x119'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0x30f0('0x10b')](db['Team'],{'through':_0x30f0('0x16c'),'as':_0x30f0('0x154')});db[_0x30f0('0x5f')][_0x30f0('0xfd')](db['Disposition'],{'as':_0x30f0('0x14b'),'foreignKey':_0x30f0('0x16d')});db[_0x30f0('0x5f')][_0x30f0('0xfd')](db[_0x30f0('0x83')],{'as':_0x30f0('0x14c'),'foreignKey':_0x30f0('0x16d')});db['OpenchannelAccount'][_0x30f0('0xfd')](db[_0x30f0('0x63')],{'as':_0x30f0('0x14d'),'foreignKey':'OpenchannelAccountId'});db[_0x30f0('0x5f')][_0x30f0('0xfd')](db[_0x30f0('0x16e')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x30f0('0x5f')]['hasMany'](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x30f0('0x16d')});db[_0x30f0('0x5f')][_0x30f0('0x108')](db[_0x30f0('0xf4')],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150')});db[_0x30f0('0x5f')][_0x30f0('0x108')](db[_0x30f0('0x138')],{'as':'mandatoryDispositionPause','foreignKey':_0x30f0('0x152')});db['OpenchannelAccount'][_0x30f0('0x10b')](db['User'],{'as':_0x30f0('0x153'),'through':'user_has_openchannel_accounts'});db[_0x30f0('0x61')][_0x30f0('0x108')](db['User'],{'onDelete':'restrict'});db[_0x30f0('0x61')][_0x30f0('0x108')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x30f0('0x61')][_0x30f0('0x108')](db[_0x30f0('0x5f')],{'onDelete':_0x30f0('0x15e'),'foreignKey':_0x30f0('0x16d')});db[_0x30f0('0x61')][_0x30f0('0x108')](db[_0x30f0('0x89')],{'onDelete':_0x30f0('0x15e'),'foreignKey':_0x30f0('0x15f')});db['OpenchannelApplication'][_0x30f0('0x108')](db[_0x30f0('0x158')],{'onDelete':_0x30f0('0x15e'),'foreignKey':'TagId'});db[_0x30f0('0x63')][_0x30f0('0xfd')](db[_0x30f0('0x16e')],{'as':_0x30f0('0x13e'),'onDelete':_0x30f0('0x101'),'foreignKey':'OpenchannelInteractionId'});db[_0x30f0('0x63')][_0x30f0('0x108')](db[_0x30f0('0x5f')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x16d')});db[_0x30f0('0x63')]['belongsTo'](db[_0x30f0('0x76')],{'as':'Contact','foreignKey':_0x30f0('0x145')});db[_0x30f0('0x63')]['belongsTo'](db['User'],{'as':_0x30f0('0x157'),'foreignKey':_0x30f0('0xff')});db['OpenchannelInteraction'][_0x30f0('0x10b')](db['Tag'],{'through':_0x30f0('0x16f'),'as':_0x30f0('0x15a')});db[_0x30f0('0x63')]['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x30f0('0x16b')});db[_0x30f0('0x63')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':'Users','through':_0x30f0('0x114'),'foreignKey':_0x30f0('0x170')});db[_0x30f0('0x16e')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x11')});db[_0x30f0('0x16e')]['belongsTo'](db[_0x30f0('0x76')],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x144')});db[_0x30f0('0x16e')][_0x30f0('0x108')](db[_0x30f0('0x63')],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x15d'),'foreignKey':_0x30f0('0x170')});db['OpenchannelMessage']['belongsTo'](db[_0x30f0('0xec')],{'as':'Attachment','foreignKey':_0x30f0('0x171')});db['OpenchannelMessage']['belongsTo'](db[_0x30f0('0x5f')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x16d')});db[_0x30f0('0x11a')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x153'),'through':'UserOpenchannelQueue','foreignKey':_0x30f0('0x172')});db[_0x30f0('0x11a')][_0x30f0('0x10b')](db[_0x30f0('0x110')],{'through':_0x30f0('0x173'),'as':_0x30f0('0x154')});db['ChatWebsite'][_0x30f0('0xfd')](db['Disposition'],{'as':_0x30f0('0x14b'),'foreignKey':_0x30f0('0x174')});db['ChatWebsite']['hasMany'](db[_0x30f0('0x83')],{'as':'Answers','foreignKey':_0x30f0('0x174')});db[_0x30f0('0x66')]['hasMany'](db[_0x30f0('0x175')],{'as':'ProactiveActions'});db[_0x30f0('0x66')][_0x30f0('0xfd')](db[_0x30f0('0x6b')],{'as':_0x30f0('0x14d')});db['ChatWebsite'][_0x30f0('0xfd')](db[_0x30f0('0x69')],{'as':'Applications'});db[_0x30f0('0x66')][_0x30f0('0xfd')](db['ChatMessage'],{'as':_0x30f0('0x13e')});db[_0x30f0('0x66')][_0x30f0('0x108')](db['CmList'],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150')});db[_0x30f0('0x66')]['belongsTo'](db[_0x30f0('0x89')],{'as':_0x30f0('0x89'),'foreignKey':_0x30f0('0x15f')});db[_0x30f0('0x66')][_0x30f0('0x108')](db[_0x30f0('0x138')],{'as':'mandatoryDispositionPause','foreignKey':_0x30f0('0x152')});db[_0x30f0('0x66')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x153'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x30f0('0x108')](db[_0x30f0('0x5f')],{});db['OpenchannelQueueReport'][_0x30f0('0x108')](db[_0x30f0('0xf4')],{'as':'List','foreignKey':_0x30f0('0x150')});db[_0x30f0('0x68')][_0x30f0('0x108')](db['CmContact'],{'as':_0x30f0('0x144'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x68')][_0x30f0('0x108')](db[_0x30f0('0x63')],{});db[_0x30f0('0x68')][_0x30f0('0x108')](db['OpenchannelMessage'],{});db[_0x30f0('0x68')]['belongsTo'](db[_0x30f0('0x11')],{});db[_0x30f0('0x68')][_0x30f0('0x108')](db[_0x30f0('0x11a')],{});db[_0x30f0('0x69')][_0x30f0('0x108')](db['User'],{'as':_0x30f0('0x176'),'foreignKey':_0x30f0('0xff'),'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x69')]['belongsTo'](db[_0x30f0('0x70')],{'as':_0x30f0('0x177'),'foreignKey':_0x30f0('0x178'),'onDelete':'restrict'});db['ChatApplication'][_0x30f0('0x108')](db[_0x30f0('0x66')],{'as':_0x30f0('0x179'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x30f0('0x69')][_0x30f0('0x108')](db[_0x30f0('0x158')],{'onDelete':_0x30f0('0x15e'),'foreignKey':_0x30f0('0x163')});db['ChatInteraction'][_0x30f0('0xfd')](db[_0x30f0('0x6c')],{'as':_0x30f0('0x13e'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x17a')});db['ChatInteraction']['belongsTo'](db[_0x30f0('0x66')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x174')});db[_0x30f0('0x6b')][_0x30f0('0x108')](db[_0x30f0('0x76')],{'as':_0x30f0('0x144'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x6b')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'as':_0x30f0('0x157'),'foreignKey':_0x30f0('0xff')});db[_0x30f0('0x6b')][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x17b'),'as':'Tags'});db[_0x30f0('0x6b')][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x17b'),'as':_0x30f0('0x16b')});db[_0x30f0('0x6b')][_0x30f0('0x10b')](db['User'],{'as':_0x30f0('0x15b'),'through':_0x30f0('0x111'),'foreignKey':_0x30f0('0x17a')});db[_0x30f0('0x6c')][_0x30f0('0x108')](db['User'],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x11')});db[_0x30f0('0x6c')][_0x30f0('0x108')](db['CmContact'],{'onDelete':_0x30f0('0x101'),'as':'Contact','foreignKey':_0x30f0('0x145')});db['ChatMessage'][_0x30f0('0x108')](db['ChatInteraction'],{'onDelete':_0x30f0('0x101'),'as':_0x30f0('0x15d'),'foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db[_0x30f0('0xec')],{'as':_0x30f0('0xec'),'foreignKey':_0x30f0('0x171')});db[_0x30f0('0x6c')][_0x30f0('0x108')](db['ChatWebsite'],{'as':_0x30f0('0x156'),'foreignKey':'ChatWebsiteId'});db[_0x30f0('0x6e')][_0x30f0('0x108')](db['CmContact'],{'onDelete':_0x30f0('0x101'),'as':'Contact','foreignKey':_0x30f0('0x145')});db['ChatOfflineMessage'][_0x30f0('0x108')](db['ChatWebsite'],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x174')});db[_0x30f0('0x70')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x153'),'through':'UserChatQueue','hooks':!![]});db[_0x30f0('0x70')][_0x30f0('0x10b')](db['Team'],{'through':'team_has_chat_queues','as':_0x30f0('0x154')});db[_0x30f0('0x72')]['hasMany'](db['ChatInternalMessage'],{'as':_0x30f0('0x13e'),'foreignKey':'ChatGroupId','onDelete':_0x30f0('0x101')});db[_0x30f0('0x72')][_0x30f0('0x10b')](db['User'],{'as':_0x30f0('0x12f'),'through':_0x30f0('0x10a')});db[_0x30f0('0x175')]['belongsTo'](db['ChatWebsite'],{'as':_0x30f0('0x179'),'foreignKey':'ChatWebsiteId'});db[_0x30f0('0x74')]['hasMany'](db[_0x30f0('0x76')],{'as':_0x30f0('0x10c'),'foreignKey':_0x30f0('0x17c')});db[_0x30f0('0x76')]['hasMany'](db[_0x30f0('0x78')],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0x30f0('0xfd')](db[_0x30f0('0x7b')],{'as':_0x30f0('0x131'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x76')]['hasMany'](db['CmHopperHistory'],{'as':_0x30f0('0x133'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x76')][_0x30f0('0xfd')](db[_0x30f0('0x7d')],{'as':_0x30f0('0x7d'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x76')][_0x30f0('0xfd')](db[_0x30f0('0xd7')],{'as':_0x30f0('0x136'),'foreignKey':_0x30f0('0x145')});db[_0x30f0('0x76')][_0x30f0('0xfd')](db[_0x30f0('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0x30f0('0x145'),'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x76')][_0x30f0('0xfd')](db['ChatInteraction'],{'as':_0x30f0('0x104'),'foreignKey':_0x30f0('0x145'),'onDelete':'restrict'});db[_0x30f0('0x76')]['hasMany'](db[_0x30f0('0x5b')],{'as':_0x30f0('0x105'),'foreignKey':_0x30f0('0x145'),'onDelete':'restrict'});db[_0x30f0('0x76')]['hasMany'](db[_0x30f0('0x50')],{'as':_0x30f0('0x106'),'foreignKey':'ContactId','onDelete':_0x30f0('0x15e')});db['CmContact'][_0x30f0('0xfd')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x30f0('0x145'),'onDelete':_0x30f0('0x15e')});db['CmContact'][_0x30f0('0x108')](db['CmCompany'],{'as':'Company','foreignKey':_0x30f0('0x17c')});db[_0x30f0('0x76')][_0x30f0('0x108')](db['CmList'],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150'),'onDelete':_0x30f0('0x101')});db[_0x30f0('0x76')][_0x30f0('0x10b')](db['User'],{'as':'Users','through':_0x30f0('0x10d')});db['CmContact'][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'as':_0x30f0('0x15a'),'through':_0x30f0('0x17d')});db[_0x30f0('0x76')][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x17d'),'as':'ThroughTags'});db[_0x30f0('0x78')][_0x30f0('0x108')](db['CmContact'],{'as':_0x30f0('0x144'),'foreignKey':_0x30f0('0x145'),'onDelete':_0x30f0('0x101')});db[_0x30f0('0x78')][_0x30f0('0x108')](db[_0x30f0('0xf4')],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150'),'onDelete':_0x30f0('0x101')});db[_0x30f0('0x78')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'as':_0x30f0('0x176'),'foreignKey':'UserId'});db[_0x30f0('0x78')][_0x30f0('0x108')](db[_0x30f0('0x19')],{'as':'Queue','foreignKey':_0x30f0('0x132'),'onDelete':_0x30f0('0x101')});db[_0x30f0('0x78')][_0x30f0('0x108')](db[_0x30f0('0xe8')],{'as':_0x30f0('0xe8'),'foreignKey':_0x30f0('0x17e'),'onDelete':_0x30f0('0x101')});db[_0x30f0('0x78')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'as':'Owner','foreignKey':_0x30f0('0x17f')});db[_0x30f0('0x134')][_0x30f0('0x108')](db['CmContact'],{'as':_0x30f0('0x144'),'foreignKey':_0x30f0('0x145'),'onDelete':'cascade'});db[_0x30f0('0x134')]['belongsTo'](db[_0x30f0('0xf4')],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150'),'onDelete':_0x30f0('0x101')});db['CmHopperBlack'][_0x30f0('0x108')](db[_0x30f0('0x19')],{'as':_0x30f0('0x177'),'foreignKey':_0x30f0('0x132'),'onDelete':'cascade'});db[_0x30f0('0x134')][_0x30f0('0x108')](db[_0x30f0('0xe8')],{'as':_0x30f0('0xe8'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x30f0('0x81')][_0x30f0('0xfd')](db[_0x30f0('0x87')],{'as':{'plural':_0x30f0('0x180'),'singular':_0x30f0('0x181')},'foreignKey':_0x30f0('0x182'),'onDelete':_0x30f0('0x101'),'hooks':!![]});db[_0x30f0('0x81')]['hasMany'](db[_0x30f0('0x87')],{'as':{'plural':_0x30f0('0x183'),'singular':_0x30f0('0x184')},'foreignKey':_0x30f0('0x185'),'onDelete':_0x30f0('0x101'),'hooks':!![]});db[_0x30f0('0x81')][_0x30f0('0xfd')](db[_0x30f0('0x80')],{'as':'Actions','foreignKey':_0x30f0('0x186'),'onDelete':_0x30f0('0x101'),'hooks':!![]});db[_0x30f0('0x89')][_0x30f0('0xfd')](db['Interval'],{'as':'Intervals','foreignKey':_0x30f0('0x15f'),'onDelete':_0x30f0('0x101'),'hooks':!![],'required':![]});db['Interval'][_0x30f0('0xfd')](db[_0x30f0('0x16')],{'as':_0x30f0('0x100'),'foreignKey':_0x30f0('0x15f'),'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x89')][_0x30f0('0xfd')](db[_0x30f0('0x44')],{'as':_0x30f0('0x187'),'foreignKey':_0x30f0('0x15f')});db[_0x30f0('0x89')][_0x30f0('0xfd')](db[_0x30f0('0x69')],{'as':_0x30f0('0x188'),'foreignKey':_0x30f0('0x15f')});db[_0x30f0('0x89')]['hasMany'](db[_0x30f0('0x4e')],{'as':'FaxApplications','foreignKey':_0x30f0('0x15f')});db[_0x30f0('0x89')][_0x30f0('0xfd')](db[_0x30f0('0x59')],{'as':_0x30f0('0x189'),'foreignKey':'IntervalId'});db[_0x30f0('0x8d')][_0x30f0('0x108')](db['MailAccount'],{});db[_0x30f0('0x8d')][_0x30f0('0x108')](db['AnalyticDefaultReport'],{'foreignKey':_0x30f0('0x18a')});db['Schedule'][_0x30f0('0x108')](db[_0x30f0('0x99')],{'foreignKey':_0x30f0('0x18b')});db[_0x30f0('0x12c')][_0x30f0('0x10b')](db['VoiceMusicOnHold'],{'as':_0x30f0('0x18c'),'through':_0x30f0('0x12e'),'onDelete':_0x30f0('0x15e')});db[_0x30f0('0x158')]['belongsToMany'](db[_0x30f0('0x76')],{'through':_0x30f0('0x17d')});db[_0x30f0('0x158')][_0x30f0('0x10b')](db[_0x30f0('0x6b')],{'through':_0x30f0('0x17b')});db['Tag'][_0x30f0('0x10b')](db[_0x30f0('0x40')],{'through':'mail_interaction_has_tags'});db[_0x30f0('0x158')]['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x30f0('0x158')][_0x30f0('0x10b')](db[_0x30f0('0x50')],{'through':_0x30f0('0x165')});db['Tag'][_0x30f0('0x10b')](db[_0x30f0('0x63')],{'through':_0x30f0('0x16f')});db[_0x30f0('0x91')][_0x30f0('0xfd')](db['Condition'],{'as':{'plural':_0x30f0('0x18d'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x30f0('0x101'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x30f0('0x87')],{'as':{'plural':_0x30f0('0x18e'),'singular':'AnyCondition'},'foreignKey':_0x30f0('0x18f'),'onDelete':'cascade','hooks':!![]});db[_0x30f0('0x91')][_0x30f0('0xfd')](db['Action'],{'as':_0x30f0('0x190'),'foreignKey':'TriggerId','onDelete':_0x30f0('0x101'),'hooks':!![]});db[_0x30f0('0x99')]['hasMany'](db[_0x30f0('0xa0')],{'as':_0x30f0('0x191'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x18b'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x30f0('0xa0')],{'as':_0x30f0('0x191'),'onDelete':'cascade','foreignKey':_0x30f0('0x18a')});db[_0x30f0('0x9f')][_0x30f0('0xfd')](db[_0x30f0('0xa0')],{'as':_0x30f0('0x191'),'onDelete':'cascade','foreignKey':_0x30f0('0x192')});db['AnalyticFieldReport'][_0x30f0('0x108')](db[_0x30f0('0x9f')],{'foreignKey':_0x30f0('0x192')});db['SalesforceAccount'][_0x30f0('0xfd')](db[_0x30f0('0xa5')],{'as':_0x30f0('0x193'),'onDelete':'cascade','foreignKey':_0x30f0('0x194')});db[_0x30f0('0xa5')][_0x30f0('0xfd')](db[_0x30f0('0xa7')],{'as':_0x30f0('0x195'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x196')});db[_0x30f0('0xa5')][_0x30f0('0xfd')](db[_0x30f0('0xa7')],{'as':'Descriptions','onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0xa5')][_0x30f0('0xfd')](db['SalesforceField'],{'as':_0x30f0('0x191'),'onDelete':'cascade','foreignKey':_0x30f0('0x198')});db[_0x30f0('0xa5')][_0x30f0('0x108')](db[_0x30f0('0xa4')],{'as':_0x30f0('0x156'),'foreignKey':'AccountId'});db[_0x30f0('0xa7')][_0x30f0('0xfd')](db[_0x30f0('0xa7')],{'as':_0x30f0('0x199'),'foreignKey':'SubjectId'});db[_0x30f0('0xa7')][_0x30f0('0xfd')](db[_0x30f0('0xa7')],{'as':_0x30f0('0x19a'),'foreignKey':_0x30f0('0x197')});db['SalesforceField']['hasMany'](db[_0x30f0('0xa7')],{'as':_0x30f0('0x19b'),'foreignKey':_0x30f0('0x198')});db[_0x30f0('0xa7')][_0x30f0('0x108')](db['Variable'],{'as':_0x30f0('0x93'),'foreignKey':_0x30f0('0x19c')});db[_0x30f0('0xa8')][_0x30f0('0xfd')](db[_0x30f0('0xa9')],{'as':_0x30f0('0x193'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x194')});db['SugarcrmConfiguration'][_0x30f0('0xfd')](db[_0x30f0('0x19d')],{'as':_0x30f0('0x195'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x196')});db['SugarcrmConfiguration'][_0x30f0('0xfd')](db[_0x30f0('0x19d')],{'as':_0x30f0('0x19e'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0xa9')][_0x30f0('0xfd')](db[_0x30f0('0x19d')],{'as':_0x30f0('0x191'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x198')});db['SugarcrmConfiguration'][_0x30f0('0x108')](db[_0x30f0('0xa8')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0x19d')][_0x30f0('0xfd')](db['SugarcrmField'],{'as':_0x30f0('0x199'),'foreignKey':_0x30f0('0x196')});db['SugarcrmField']['hasMany'](db[_0x30f0('0x19d')],{'as':_0x30f0('0x19a'),'foreignKey':_0x30f0('0x197')});db['SugarcrmField'][_0x30f0('0xfd')](db[_0x30f0('0x19d')],{'as':_0x30f0('0x19b'),'foreignKey':_0x30f0('0x198')});db['SugarcrmField'][_0x30f0('0x108')](db[_0x30f0('0x93')],{'as':_0x30f0('0x93'),'foreignKey':_0x30f0('0x19c')});db[_0x30f0('0xac')][_0x30f0('0xfd')](db[_0x30f0('0xad')],{'as':_0x30f0('0x193'),'onDelete':'cascade','foreignKey':_0x30f0('0x194')});db['DeskConfiguration'][_0x30f0('0xfd')](db[_0x30f0('0x19f')],{'as':_0x30f0('0x195'),'onDelete':'cascade','foreignKey':_0x30f0('0x196')});db[_0x30f0('0xad')]['hasMany'](db[_0x30f0('0x19f')],{'as':_0x30f0('0x19e'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0xad')]['hasMany'](db[_0x30f0('0x19f')],{'as':_0x30f0('0x191'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x198')});db[_0x30f0('0xad')][_0x30f0('0x108')](db[_0x30f0('0xac')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0xad')][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x1a0')});db['DeskField'][_0x30f0('0xfd')](db[_0x30f0('0x19f')],{'as':_0x30f0('0x199'),'foreignKey':_0x30f0('0x196')});db['DeskField']['hasMany'](db[_0x30f0('0x19f')],{'as':_0x30f0('0x19a'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0x19f')][_0x30f0('0xfd')](db['DeskField'],{'as':_0x30f0('0x19b'),'foreignKey':_0x30f0('0x198')});db[_0x30f0('0x19f')][_0x30f0('0x108')](db[_0x30f0('0x93')],{'as':'Variable','foreignKey':_0x30f0('0x19c')});db['ZohoAccount'][_0x30f0('0xfd')](db[_0x30f0('0xb0')],{'as':_0x30f0('0x193'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x30f0('0xb0')][_0x30f0('0xfd')](db[_0x30f0('0xb2')],{'as':_0x30f0('0x195'),'onDelete':'cascade','foreignKey':_0x30f0('0x196')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0x30f0('0x19e'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0xb0')][_0x30f0('0xfd')](db[_0x30f0('0xb2')],{'as':'Fields','onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x198')});db[_0x30f0('0xb0')][_0x30f0('0x108')](db[_0x30f0('0x1a1')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0xb2')][_0x30f0('0xfd')](db['ZohoField'],{'as':_0x30f0('0x199'),'foreignKey':'SubjectId'});db['ZohoField'][_0x30f0('0xfd')](db[_0x30f0('0xb2')],{'as':_0x30f0('0x19a'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0xb2')][_0x30f0('0xfd')](db['ZohoField'],{'as':'Field','foreignKey':_0x30f0('0x198')});db[_0x30f0('0xb2')]['belongsTo'](db[_0x30f0('0x93')],{'as':_0x30f0('0x93'),'foreignKey':_0x30f0('0x19c')});db[_0x30f0('0xb4')][_0x30f0('0xfd')](db[_0x30f0('0xb6')],{'as':_0x30f0('0x193'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0xb6')][_0x30f0('0xfd')](db['ZendeskField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x30f0('0xb6')][_0x30f0('0xfd')](db[_0x30f0('0x1a2')],{'as':_0x30f0('0x19e'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0xb6')][_0x30f0('0xfd')](db[_0x30f0('0x1a2')],{'as':_0x30f0('0x191'),'foreignKey':_0x30f0('0x198')});db['ZendeskConfiguration'][_0x30f0('0x108')](db[_0x30f0('0xb4')],{'as':'Account','foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0x30f0('0x1a3')});db['ZendeskField'][_0x30f0('0xfd')](db[_0x30f0('0x1a2')],{'as':'Subject','foreignKey':_0x30f0('0x196')});db[_0x30f0('0x1a2')][_0x30f0('0xfd')](db[_0x30f0('0x1a2')],{'as':_0x30f0('0x19a'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0x1a2')][_0x30f0('0xfd')](db['ZendeskField'],{'as':_0x30f0('0x19b'),'foreignKey':_0x30f0('0x198')});db[_0x30f0('0x1a2')][_0x30f0('0x108')](db[_0x30f0('0x93')],{'as':'Variable','foreignKey':_0x30f0('0x19c')});db[_0x30f0('0xb9')][_0x30f0('0xfd')](db[_0x30f0('0x1a4')],{'as':_0x30f0('0x193'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0x1a4')][_0x30f0('0xfd')](db['FreshdeskField'],{'as':_0x30f0('0x195'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x196')});db[_0x30f0('0x1a4')][_0x30f0('0xfd')](db[_0x30f0('0xbc')],{'as':_0x30f0('0x19e'),'onDelete':'cascade','foreignKey':_0x30f0('0x197')});db[_0x30f0('0x1a4')][_0x30f0('0xfd')](db[_0x30f0('0xbc')],{'as':_0x30f0('0x191'),'onDelete':'cascade','foreignKey':_0x30f0('0x198')});db[_0x30f0('0x1a4')][_0x30f0('0x108')](db[_0x30f0('0xb9')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0x1a4')][_0x30f0('0x10b')](db[_0x30f0('0x158')],{'through':_0x30f0('0x1a5')});db[_0x30f0('0xbc')][_0x30f0('0xfd')](db[_0x30f0('0xbc')],{'as':_0x30f0('0x199'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0x30f0('0xfd')](db[_0x30f0('0xbc')],{'as':'Description','foreignKey':_0x30f0('0x197')});db[_0x30f0('0xbc')]['hasMany'](db['FreshdeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x30f0('0xbc')][_0x30f0('0x108')](db[_0x30f0('0x93')],{'as':_0x30f0('0x93'),'foreignKey':_0x30f0('0x19c')});db[_0x30f0('0xbd')][_0x30f0('0xfd')](db['VtigerConfiguration'],{'as':_0x30f0('0x193'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0xbf')][_0x30f0('0xfd')](db[_0x30f0('0xc1')],{'as':_0x30f0('0x195'),'foreignKey':_0x30f0('0x196')});db[_0x30f0('0xbf')][_0x30f0('0xfd')](db[_0x30f0('0xc1')],{'as':_0x30f0('0x19e'),'foreignKey':_0x30f0('0x197')});db['VtigerConfiguration'][_0x30f0('0xfd')](db[_0x30f0('0xc1')],{'as':_0x30f0('0x191'),'foreignKey':'FieldId'});db[_0x30f0('0xbf')][_0x30f0('0x108')](db[_0x30f0('0xbd')],{'as':'Account','foreignKey':_0x30f0('0x194')});db['VtigerField'][_0x30f0('0xfd')](db[_0x30f0('0xc1')],{'as':_0x30f0('0x199'),'foreignKey':_0x30f0('0x196')});db['VtigerField'][_0x30f0('0xfd')](db[_0x30f0('0xc1')],{'as':_0x30f0('0x19a'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0xc1')][_0x30f0('0xfd')](db[_0x30f0('0xc1')],{'as':'Field','foreignKey':_0x30f0('0x198')});db[_0x30f0('0xc1')][_0x30f0('0x108')](db[_0x30f0('0x93')],{'as':_0x30f0('0x93'),'foreignKey':_0x30f0('0x19c')});db[_0x30f0('0xc3')][_0x30f0('0xfd')](db[_0x30f0('0xc5')],{'as':_0x30f0('0x193'),'onDelete':_0x30f0('0x101'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x30f0('0xfd')](db['ServicenowField'],{'as':_0x30f0('0x195'),'foreignKey':_0x30f0('0x196')});db[_0x30f0('0xc5')]['hasMany'](db['ServicenowField'],{'as':_0x30f0('0x19e'),'foreignKey':_0x30f0('0x197')});db[_0x30f0('0xc5')][_0x30f0('0xfd')](db['ServicenowField'],{'as':_0x30f0('0x191'),'foreignKey':_0x30f0('0x198')});db['ServicenowConfiguration'][_0x30f0('0x108')](db[_0x30f0('0xc3')],{'as':_0x30f0('0x156'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0xc7')][_0x30f0('0xfd')](db[_0x30f0('0xc7')],{'as':_0x30f0('0x199'),'foreignKey':'SubjectId'});db['ServicenowField'][_0x30f0('0xfd')](db[_0x30f0('0xc7')],{'as':_0x30f0('0x19a'),'foreignKey':_0x30f0('0x197')});db['ServicenowField'][_0x30f0('0xfd')](db[_0x30f0('0xc7')],{'as':_0x30f0('0x19b'),'foreignKey':_0x30f0('0x198')});db[_0x30f0('0xc7')][_0x30f0('0x108')](db[_0x30f0('0x93')],{'as':'Variable','foreignKey':_0x30f0('0x19c')});db[_0x30f0('0x1a6')][_0x30f0('0xfd')](db[_0x30f0('0xca')],{'as':_0x30f0('0x193'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x194')});db['Dynamics365Configuration'][_0x30f0('0xfd')](db[_0x30f0('0x1a7')],{'as':_0x30f0('0x195'),'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x196')});db[_0x30f0('0xca')]['hasMany'](db[_0x30f0('0x1a7')],{'as':'Descriptions','onDelete':_0x30f0('0x101'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration']['hasMany'](db[_0x30f0('0x1a7')],{'as':_0x30f0('0x191'),'onDelete':'cascade','foreignKey':_0x30f0('0x198')});db[_0x30f0('0xca')]['belongsTo'](db['Dynamics365Account'],{'as':_0x30f0('0x156'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0x30f0('0xfd')](db[_0x30f0('0x1a7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x30f0('0x1a7')][_0x30f0('0xfd')](db[_0x30f0('0x1a7')],{'as':_0x30f0('0x19a'),'foreignKey':'DescriptionId'});db[_0x30f0('0x1a7')][_0x30f0('0xfd')](db[_0x30f0('0x1a7')],{'as':'Field','foreignKey':'FieldId'});db[_0x30f0('0x1a7')]['belongsTo'](db['Variable'],{'as':_0x30f0('0x93'),'foreignKey':'VariableId'});db[_0x30f0('0xcb')][_0x30f0('0xfd')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x194')});db[_0x30f0('0xcd')]['hasMany'](db[_0x30f0('0xcf')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x30f0('0xcd')][_0x30f0('0xfd')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x30f0('0x197')});db['FreshsalesConfiguration'][_0x30f0('0xfd')](db[_0x30f0('0xcf')],{'as':_0x30f0('0x191'),'foreignKey':_0x30f0('0x198')});db[_0x30f0('0xcd')][_0x30f0('0x108')](db['FreshsalesAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x30f0('0xcf')][_0x30f0('0xfd')](db[_0x30f0('0xcf')],{'as':_0x30f0('0x199'),'foreignKey':_0x30f0('0x196')});db[_0x30f0('0xcf')][_0x30f0('0xfd')](db[_0x30f0('0xcf')],{'as':_0x30f0('0x19a'),'foreignKey':'DescriptionId'});db['FreshsalesField']['hasMany'](db[_0x30f0('0xcf')],{'as':_0x30f0('0x19b'),'foreignKey':_0x30f0('0x198')});db[_0x30f0('0xcf')][_0x30f0('0x108')](db[_0x30f0('0x93')],{'as':_0x30f0('0x93'),'foreignKey':_0x30f0('0x19c')});db[_0x30f0('0x1a8')][_0x30f0('0x108')](db[_0x30f0('0x66')],{});db['ChatQueueReport'][_0x30f0('0x108')](db['CmList'],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150')});db['ChatQueueReport'][_0x30f0('0x108')](db[_0x30f0('0x76')],{'as':'Contact','foreignKey':_0x30f0('0x145')});db[_0x30f0('0x1a8')]['belongsTo'](db[_0x30f0('0x6b')],{});db[_0x30f0('0x1a8')]['belongsTo'](db[_0x30f0('0x6c')],{});db[_0x30f0('0x1a8')][_0x30f0('0x108')](db['User'],{});db['ChatQueueReport']['belongsTo'](db[_0x30f0('0x70')],{});db['ChatInternalMessage'][_0x30f0('0x108')](db[_0x30f0('0x11')],{'onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x1a9')});db['ChatInternalMessage']['belongsTo'](db[_0x30f0('0x11')],{'onDelete':_0x30f0('0x101'),'foreignKey':'ToId'});db[_0x30f0('0xd7')][_0x30f0('0xfd')](db[_0x30f0('0xd5')],{'foreignKey':_0x30f0('0x1aa'),'onDelete':_0x30f0('0x101')});db['JscriptySessionReport']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x30f0('0x101')});db[_0x30f0('0xd9')][_0x30f0('0x108')](db[_0x30f0('0x57')],{});db[_0x30f0('0xd9')][_0x30f0('0x108')](db[_0x30f0('0xf4')],{'as':_0x30f0('0x14f'),'foreignKey':_0x30f0('0x150')});db['SmsQueueReport'][_0x30f0('0x108')](db[_0x30f0('0x76')],{'as':'Contact','foreignKey':_0x30f0('0x145')});db['SmsQueueReport'][_0x30f0('0x108')](db[_0x30f0('0x5b')],{});db['SmsQueueReport']['belongsTo'](db[_0x30f0('0x168')],{});db[_0x30f0('0xd9')][_0x30f0('0x108')](db[_0x30f0('0x11')],{});db['SmsQueueReport'][_0x30f0('0x108')](db['SmsQueue'],{});db['JscriptyProject'][_0x30f0('0xfd')](db['JscriptySessionReport'],{'foreignKey':_0x30f0('0x1ab')});db[_0x30f0('0xde')][_0x30f0('0xfd')](db[_0x30f0('0xd5')],{'foreignKey':_0x30f0('0x1ab')});db['JscriptyProject'][_0x30f0('0xfd')](db[_0x30f0('0xd3')],{'foreignKey':_0x30f0('0x1ab')});db[_0x30f0('0xe2')]['belongsToMany'](db['User'],{'as':_0x30f0('0x15b'),'through':_0x30f0('0x129')});db['Team'][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x153'),'through':_0x30f0('0x1ac')});db['Team']['belongsToMany'](db[_0x30f0('0x19')],{'through':_0x30f0('0x13a'),'as':_0x30f0('0x115')});db[_0x30f0('0x110')][_0x30f0('0x10b')](db[_0x30f0('0x3d')],{'through':_0x30f0('0x1ad'),'as':_0x30f0('0x116')});db[_0x30f0('0x110')]['belongsToMany'](db['ChatQueue'],{'through':_0x30f0('0x1ae'),'as':'ChatQueues'});db['Team'][_0x30f0('0x10b')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0x30f0('0x1af')});db[_0x30f0('0x110')]['belongsToMany'](db[_0x30f0('0x117')],{'through':_0x30f0('0x16c'),'as':'SmsQueues'});db['Team'][_0x30f0('0x10b')](db[_0x30f0('0x11a')],{'through':_0x30f0('0x173'),'as':_0x30f0('0x11b')});db['Campaign'][_0x30f0('0xfd')](db[_0x30f0('0x78')],{'as':'Hoppers','foreignKey':'CampaignId'});db['Campaign'][_0x30f0('0xfd')](db[_0x30f0('0x7b')],{'as':_0x30f0('0x131'),'foreignKey':_0x30f0('0x17e')});db[_0x30f0('0xe8')][_0x30f0('0xfd')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x30f0('0x17e')});db[_0x30f0('0xe8')][_0x30f0('0xfd')](db[_0x30f0('0x134')],{'as':_0x30f0('0x135'),'foreignKey':_0x30f0('0x17e')});db[_0x30f0('0xe8')][_0x30f0('0x108')](db['Trunk'],{'as':_0x30f0('0x29'),'foreignKey':_0x30f0('0x1b0')});db[_0x30f0('0xe8')]['belongsTo'](db[_0x30f0('0x29')],{'as':_0x30f0('0x137'),'foreignKey':_0x30f0('0x1b1')});db[_0x30f0('0xe8')][_0x30f0('0x108')](db[_0x30f0('0x89')],{'as':_0x30f0('0x89'),'foreignKey':'IntervalId'});db[_0x30f0('0xe8')][_0x30f0('0x108')](db[_0x30f0('0xe2')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x30f0('0xe8')][_0x30f0('0x10b')](db[_0x30f0('0xf4')],{'as':_0x30f0('0x10e'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x30f0('0x10b')](db[_0x30f0('0xf4')],{'as':_0x30f0('0x13b'),'through':_0x30f0('0x1b2')});db[_0x30f0('0xed')][_0x30f0('0x108')](db[_0x30f0('0x42')],{});db[_0x30f0('0xed')]['belongsTo'](db[_0x30f0('0x40')],{});db[_0x30f0('0xed')]['belongsTo'](db[_0x30f0('0x146')],{'foreignKey':_0x30f0('0x1b3'),'as':_0x30f0('0x1b4')});db[_0x30f0('0xed')][_0x30f0('0x108')](db['User'],{'foreignKey':_0x30f0('0x1b5'),'as':_0x30f0('0x1b6')});db[_0x30f0('0xed')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'foreignKey':'ToUserId','as':_0x30f0('0x1b7')});db[_0x30f0('0xed')][_0x30f0('0x108')](db['MailQueue'],{'foreignKey':_0x30f0('0x1b8'),'as':'ToQueue'});db[_0x30f0('0xed')][_0x30f0('0x108')](db[_0x30f0('0x146')],{'foreignKey':_0x30f0('0x1b9'),'as':_0x30f0('0x1ba')});db[_0x30f0('0xef')][_0x30f0('0x108')](db[_0x30f0('0x6c')],{});db[_0x30f0('0xef')]['belongsTo'](db[_0x30f0('0x6b')],{});db['ChatTransferReport'][_0x30f0('0x108')](db['ChatWebsite'],{'foreignKey':_0x30f0('0x1bb'),'as':_0x30f0('0x1b4')});db[_0x30f0('0xef')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'foreignKey':_0x30f0('0x1b5'),'as':_0x30f0('0x1b6')});db['ChatTransferReport'][_0x30f0('0x108')](db[_0x30f0('0x11')],{'foreignKey':_0x30f0('0x1bc'),'as':_0x30f0('0x1b7')});db[_0x30f0('0xef')][_0x30f0('0x108')](db[_0x30f0('0x70')],{'foreignKey':_0x30f0('0x1bd'),'as':_0x30f0('0x1be')});db[_0x30f0('0xef')][_0x30f0('0x108')](db[_0x30f0('0x66')],{'foreignKey':_0x30f0('0x1bf'),'as':_0x30f0('0x1ba')});db[_0x30f0('0xf0')][_0x30f0('0x108')](db[_0x30f0('0x51')],{});db[_0x30f0('0xf0')][_0x30f0('0x108')](db[_0x30f0('0x50')],{});db['FaxTransferReport'][_0x30f0('0x108')](db[_0x30f0('0x4c')],{'foreignKey':_0x30f0('0x1c0'),'as':_0x30f0('0x1b4')});db['FaxTransferReport'][_0x30f0('0x108')](db[_0x30f0('0x11')],{'foreignKey':_0x30f0('0x1b5'),'as':_0x30f0('0x1b6')});db[_0x30f0('0xf0')]['belongsTo'](db[_0x30f0('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x30f0('0xf0')]['belongsTo'](db[_0x30f0('0x53')],{'foreignKey':_0x30f0('0x1c1'),'as':_0x30f0('0x1be')});db[_0x30f0('0xf0')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x30f0('0x1c2'),'as':'ToAccount'});db[_0x30f0('0x1c3')][_0x30f0('0x108')](db[_0x30f0('0x16e')],{});db[_0x30f0('0x1c3')][_0x30f0('0x108')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x30f0('0x108')](db[_0x30f0('0x5f')],{'foreignKey':_0x30f0('0x1c4'),'as':'FromAccount'});db[_0x30f0('0x1c3')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'foreignKey':_0x30f0('0x1b5'),'as':'FromAgent'});db[_0x30f0('0x1c3')][_0x30f0('0x108')](db[_0x30f0('0x11')],{'foreignKey':_0x30f0('0x1bc'),'as':_0x30f0('0x1b7')});db[_0x30f0('0x1c3')][_0x30f0('0x108')](db[_0x30f0('0x11a')],{'foreignKey':_0x30f0('0x1c5'),'as':_0x30f0('0x1be')});db['OpenchannelTransferReport'][_0x30f0('0x108')](db[_0x30f0('0x5f')],{'foreignKey':'ToOpenchannelAccountId','as':_0x30f0('0x1ba')});db['SmsTransferReport'][_0x30f0('0x108')](db[_0x30f0('0x168')],{});db[_0x30f0('0xf3')][_0x30f0('0x108')](db[_0x30f0('0x5b')],{});db[_0x30f0('0xf3')][_0x30f0('0x108')](db['SmsAccount'],{'foreignKey':_0x30f0('0x1c6'),'as':_0x30f0('0x1b4')});db[_0x30f0('0xf3')][_0x30f0('0x108')](db['User'],{'foreignKey':_0x30f0('0x1b5'),'as':_0x30f0('0x1b6')});db['SmsTransferReport']['belongsTo'](db[_0x30f0('0x11')],{'foreignKey':_0x30f0('0x1bc'),'as':_0x30f0('0x1b7')});db[_0x30f0('0xf3')][_0x30f0('0x108')](db[_0x30f0('0x117')],{'foreignKey':_0x30f0('0x1c7'),'as':_0x30f0('0x1be')});db[_0x30f0('0xf3')][_0x30f0('0x108')](db['SmsAccount'],{'foreignKey':_0x30f0('0x1c8'),'as':_0x30f0('0x1ba')});db['CmList'][_0x30f0('0xfd')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x30f0('0x150')});db[_0x30f0('0xf4')][_0x30f0('0xfd')](db[_0x30f0('0x7f')],{'as':_0x30f0('0x1c9'),'foreignKey':_0x30f0('0x150')});db[_0x30f0('0xf4')][_0x30f0('0xfd')](db['CmContact'],{'as':'Contacts','onDelete':_0x30f0('0x101'),'foreignKey':_0x30f0('0x150')});db[_0x30f0('0xf4')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x30f0('0x150')});db['CmList'][_0x30f0('0xfd')](db[_0x30f0('0x7c')],{'as':_0x30f0('0x102'),'foreignKey':'ListId'});db[_0x30f0('0xf4')][_0x30f0('0xfd')](db[_0x30f0('0x7d')],{'as':_0x30f0('0x7d'),'foreignKey':_0x30f0('0x150')});db[_0x30f0('0xf4')][_0x30f0('0x10b')](db['VoiceQueue'],{'as':_0x30f0('0x1ca'),'through':_0x30f0('0x1cb')});db[_0x30f0('0xf4')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x153'),'through':_0x30f0('0x10f')});db[_0x30f0('0xf6')][_0x30f0('0xfd')](db[_0x30f0('0x16')],{'as':_0x30f0('0x100'),'onDelete':_0x30f0('0x15e')});db[_0x30f0('0xf6')][_0x30f0('0x10b')](db[_0x30f0('0x11')],{'as':_0x30f0('0x153'),'through':_0x30f0('0x11d')});db[_0x30f0('0xf8')][_0x30f0('0xfd')](db['User'],{'as':'Users','foreignKey':_0x30f0('0x1cc')});db[_0x30f0('0xf8')][_0x30f0('0xfd')](db[_0x30f0('0xfa')],{'as':_0x30f0('0x1cd'),'foreignKey':_0x30f0('0x1cc'),'onDelete':_0x30f0('0x101')});db['UserProfileSection'][_0x30f0('0xfd')](db[_0x30f0('0x1ce')],{'as':'Resources','foreignKey':_0x30f0('0x1cf'),'onDelete':_0x30f0('0x101')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb673=['user_has_sms_accounts','SquareProject','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','belongsTo','TrunkId','TrunkBackup','Interval','Lists','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','AgentReports','ContactId','MailAccountId','hasOne','Imap','Dispositions','List','Template','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','user_has_mail_accounts','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachments','restrict','IntervalId','TagId','ListId','Exntensions','user_has_fax_accounts','FaxInteractionId','FaxAccountId','fax_interaction_has_tags','Tags','Interaction','AttachmentId','Answers','SmsAccountId','SmsMessage','Interactions','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ChatMessage','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatGroupId','Members','CmCompany','Contacts','CompanyId','Company','cm_contact_has_tags','OwnerId','CampaignId','All','OneAll','Any','OneAny','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Condition','AllCondition','AnyConditions','AnyCondition','TriggerId','Fields','CustomReportId','MetricId','Configurations','AccountId','Subjects','DescriptionId','FieldId','Subject','SubjectId','Description','VariableId','SugarcrmField','Descriptions','Field','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','ServicenowConfiguration','FromId','JscriptySessionReport','SessionId','SmsQueueReport','ProjectId','user_has_square_projects','team_has_mail_queues','ChatQueues','team_has_fax_queues','FaxQueues','OpenchannelQueues','TrunkBackupId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','FromAccount','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSections','Resources','sectionId','exports','path','../config/environment','lodash','jstz','determine','defaultsDeep','sequelize','motion2','xC@LL1234','mysql','utf8mb4','name','utf8','username','options','database','sequelizeHistory','password','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','User','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','HopperFinals','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','userProfileId','belongsToMany','chat_group_has_users','CmContact','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteraction','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueues','UserVoiceQueue','MailQueues','UserMailQueue','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts'];(function(_0x4b47eb,_0x3c9321){var _0x3bb8d9=function(_0x5682ca){while(--_0x5682ca){_0x4b47eb['push'](_0x4b47eb['shift']());}};_0x3bb8d9(++_0x3c9321);}(_0xb673,0xa5));var _0x3b67=function(_0x46473c,_0x2ae179){_0x46473c=_0x46473c-0x0;var _0x1124ce=_0xb673[_0x46473c];return _0x1124ce;};'use strict';var path=require(_0x3b67('0x0'));var config=require(_0x3b67('0x1'));var Sequelize=require('sequelize');var _=require(_0x3b67('0x2'));var jstz=require(_0x3b67('0x3'));var timezone=jstz[_0x3b67('0x4')]();config['sequelize']=_[_0x3b67('0x5')](config[_0x3b67('0x6')],{'database':_0x3b67('0x7'),'username':'xcall','password':_0x3b67('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x3b67('0x9'),'dialectOptions':{'charset':_0x3b67('0xa')},'logging':![],'timezone':timezone[_0x3b67('0xb')](),'define':{'charset':_0x3b67('0xc'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x3b67('0x7'),'username':'xcall','password':_0x3b67('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x3b67('0x9'),'dialectOptions':{'charset':_0x3b67('0xa')},'logging':![],'timezone':timezone[_0x3b67('0xb')](),'define':{'charset':_0x3b67('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config['sequelize'][_0x3b67('0xd')],config[_0x3b67('0x6')]['password'],config[_0x3b67('0x6')][_0x3b67('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x3b67('0xf')],config[_0x3b67('0x10')][_0x3b67('0xd')],config[_0x3b67('0x10')][_0x3b67('0x11')],config[_0x3b67('0x10')]['options'])};db['User']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x13'));db[_0x3b67('0x14')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x15'));db['VoiceContext']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x16'));db[_0x3b67('0x17')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x18'));db[_0x3b67('0x19')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x1a'));db[_0x3b67('0x1b')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x1c'));db[_0x3b67('0x1d')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x1e'));db[_0x3b67('0x1f')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x20'));db[_0x3b67('0x21')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x22'));db[_0x3b67('0x23')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x24'));db[_0x3b67('0x25')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x26'));db[_0x3b67('0x27')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/voiceDialReport/voiceDialReport.model');db[_0x3b67('0x28')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x29'));db[_0x3b67('0x2a')]=db['sequelize']['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x3b67('0x2b')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x2c'));db[_0x3b67('0x2d')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/trunk/trunk.model');db[_0x3b67('0x2e')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x2f'));db['UserVoiceQueueRt']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x30'));db['UserVoiceQueue']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x31'));db[_0x3b67('0x32')]=db[_0x3b67('0x6')]['import']('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x33'));db[_0x3b67('0x34')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0x3b67('0x35')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x36'));db[_0x3b67('0x37')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x38'));db[_0x3b67('0x39')]=db['sequelize']['import'](_0x3b67('0x3a'));db[_0x3b67('0x3b')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x3c'));db[_0x3b67('0x3d')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x3e'));db[_0x3b67('0x3f')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x40'));db[_0x3b67('0x41')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x42'));db['MailInteraction']=db['sequelize']['import'](_0x3b67('0x43'));db[_0x3b67('0x44')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/mailMessage/mailMessage.model');db[_0x3b67('0x45')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x46'));db[_0x3b67('0x47')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x48'));db[_0x3b67('0x49')]=db['sequelize'][_0x3b67('0x12')]('../api/dashboard/dashboard.model');db[_0x3b67('0x4a')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/faxAccount/faxAccount.model');db[_0x3b67('0x4b')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x4c'));db[_0x3b67('0x4d')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x4e'));db[_0x3b67('0x4f')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x50'));db[_0x3b67('0x51')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x52'));db[_0x3b67('0x53')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x54'));db['SmsAccount']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x55'));db[_0x3b67('0x56')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x57'));db['SmsInteraction']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x58'));db['SmsMessage']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x59'));db[_0x3b67('0x5a')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x5b'));db[_0x3b67('0x5c')]=db['sequelize'][_0x3b67('0x12')]('../api/openchannelAccount/openchannelAccount.model');db[_0x3b67('0x5d')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x5e'));db[_0x3b67('0x5f')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x3b67('0x60')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/openchannelMessage/openchannelMessage.model');db[_0x3b67('0x61')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x62'));db['ChatWebsite']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x63'));db[_0x3b67('0x64')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x65'));db[_0x3b67('0x66')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x67'));db[_0x3b67('0x68')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x69'));db['ChatMessage']=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/chatMessage/chatMessage.model');db[_0x3b67('0x6a')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x6b'));db[_0x3b67('0x6c')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x6d'));db[_0x3b67('0x6e')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x6f'));db[_0x3b67('0x70')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x71'));db['CmContact']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x72'));db[_0x3b67('0x73')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x74'));db[_0x3b67('0x75')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x76'));db[_0x3b67('0x77')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x78'));db[_0x3b67('0x79')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x7a'));db[_0x3b67('0x7b')]=db['sequelize']['import'](_0x3b67('0x7c'));db[_0x3b67('0x7d')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x7e'));db[_0x3b67('0x7f')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x80'));db[_0x3b67('0x81')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x82'));db[_0x3b67('0x83')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x84'));db[_0x3b67('0x85')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x86'));db['Condition']=db['sequelize'][_0x3b67('0x12')]('../api/condition/condition.model');db['Interval']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x87'));db[_0x3b67('0x88')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x89'));db[_0x3b67('0x8a')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x8b'));db[_0x3b67('0x8c')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x8d'));db[_0x3b67('0x8e')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x8f'));db[_0x3b67('0x90')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x91'));db[_0x3b67('0x92')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x93'));db['Template']=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x94'));db[_0x3b67('0x95')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x96'));db[_0x3b67('0x97')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x98'));db[_0x3b67('0x99')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x9a'));db[_0x3b67('0x9b')]=db['sequelize'][_0x3b67('0x12')]('../api/integrationReport/integrationReport.model');db[_0x3b67('0x9c')]=db[_0x3b67('0x6')]['import'](_0x3b67('0x9d'));db[_0x3b67('0x9e')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x9f'));db[_0x3b67('0xa0')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x3b67('0xa1')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x3b67('0xa2')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xa3'));db[_0x3b67('0xa4')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xa5'));db[_0x3b67('0xa6')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x3b67('0xa7')]=db['sequelize']['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x3b67('0xa8')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xa9'));db[_0x3b67('0xaa')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xab'));db[_0x3b67('0xac')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xad'));db['SugarcrmField']=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x3b67('0xae')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xaf'));db[_0x3b67('0xb0')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x3b67('0xb1')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xb2'));db[_0x3b67('0xb3')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xb4'));db['ZohoConfiguration']=db[_0x3b67('0x6')]['import'](_0x3b67('0xb5'));db[_0x3b67('0xb6')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xb7'));db[_0x3b67('0xb8')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xb9'));db['ZendeskConfiguration']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xba'));db[_0x3b67('0xbb')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xbc'));db[_0x3b67('0xbd')]=db['sequelize']['import'](_0x3b67('0xbe'));db['FreshdeskConfiguration']=db[_0x3b67('0x6')]['import'](_0x3b67('0xbf'));db[_0x3b67('0xc0')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xc1'));db[_0x3b67('0xc2')]=db['sequelize']['import'](_0x3b67('0xc3'));db[_0x3b67('0xc4')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x3b67('0xc5')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xc6'));db['ServicenowConfiguration']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xc7'));db[_0x3b67('0xc8')]=db[_0x3b67('0x6')]['import'](_0x3b67('0xc9'));db[_0x3b67('0xca')]=db[_0x3b67('0x6')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0x3b67('0xcb')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xcc'));db[_0x3b67('0xcd')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x3b67('0xce')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xcf'));db[_0x3b67('0xd0')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xd1'));db[_0x3b67('0xd2')]=db['sequelize']['import'](_0x3b67('0xd3'));db[_0x3b67('0x99')]=db['sequelize'][_0x3b67('0x12')]('../api/integration/integration.model');db[_0x3b67('0xd4')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xd5'));db[_0x3b67('0xd6')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xd7'));db[_0x3b67('0xd8')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xd9'));db[_0x3b67('0xda')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x3b67('0xdb')]=db[_0x3b67('0x6')]['import'](_0x3b67('0xdc'));db['JscriptySessionReport']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xdd'));db['SmsQueueReport']=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0x3b67('0xde')]=db['sequelize']['import'](_0x3b67('0xdf'));db[_0x3b67('0xe0')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xe1'));db[_0x3b67('0xe2')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xe3'));db[_0x3b67('0xe4')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xe5'));db[_0x3b67('0xe6')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xe7'));db['SquareProject']=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/squareProject/squareProject.model');db[_0x3b67('0xe8')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/squareRecording/squareRecording.model');db[_0x3b67('0xe9')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xea'));db[_0x3b67('0xeb')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xec'));db[_0x3b67('0xed')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xee'));db[_0x3b67('0xef')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/campaign/campaign.model');db['Migration']=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xf0'));db[_0x3b67('0xf1')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/attachment/attachment.model');db[_0x3b67('0xf2')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xf3'));db[_0x3b67('0xf4')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x3b67('0xf5')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0xf6'));db[_0x3b67('0xf7')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0x3b67('0x6')]['import'](_0x3b67('0xf8'));db[_0x3b67('0xf9')]=db[_0x3b67('0x6')]['import'](_0x3b67('0xfa'));db[_0x3b67('0xfb')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0xfc'));db[_0x3b67('0xfd')]=db[_0x3b67('0x6')]['import'](_0x3b67('0xfe'));db[_0x3b67('0xff')]=db[_0x3b67('0x6')][_0x3b67('0x12')]('../api/userProfile/userProfile.model');db[_0x3b67('0x100')]=db['sequelize'][_0x3b67('0x12')](_0x3b67('0x101'));db[_0x3b67('0x102')]=db[_0x3b67('0x6')][_0x3b67('0x12')](_0x3b67('0x103'));db[_0x3b67('0x104')]['hasOne'](db[_0x3b67('0x21')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x3b67('0x105')});db[_0x3b67('0x104')][_0x3b67('0x106')](db['VoiceRecording'],{'as':_0x3b67('0x107'),'foreignKey':_0x3b67('0x105')});db['User'][_0x3b67('0x106')](db[_0x3b67('0x108')],{'as':_0x3b67('0x109'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x104')][_0x3b67('0x106')](db[_0x3b67('0x17')],{'as':_0x3b67('0x10a'),'onDelete':_0x3b67('0x10b'),'hooks':!![]});db['User'][_0x3b67('0x106')](db[_0x3b67('0x77')],{'as':_0x3b67('0x10c'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x104')][_0x3b67('0x106')](db[_0x3b67('0x79')],{'as':'HopperHistory','foreignKey':_0x3b67('0x105')});db[_0x3b67('0x104')]['hasMany'](db['ReportAgentPreview'],{'as':_0x3b67('0x7b'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x104')]['hasMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db['User'][_0x3b67('0x106')](db[_0x3b67('0x68')],{'as':_0x3b67('0x10d'),'foreignKey':'UserId'});db[_0x3b67('0x104')][_0x3b67('0x106')](db[_0x3b67('0x10e')],{'as':_0x3b67('0x10f'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x104')][_0x3b67('0x106')](db[_0x3b67('0x4d')],{'as':_0x3b67('0x110'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x104')][_0x3b67('0x106')](db['MailInteraction'],{'as':_0x3b67('0x111'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x104')]['belongsTo'](db[_0x3b67('0xff')],{'as':_0x3b67('0xff'),'foreignKey':_0x3b67('0x112')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x6e')],{'as':'Groups','through':_0x3b67('0x114')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x115')],{'as':'Contacts','through':_0x3b67('0x116')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0xfb')],{'as':'Lists','through':_0x3b67('0x117')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0xeb')],{'through':_0x3b67('0x118')});db[_0x3b67('0x104')]['belongsToMany'](db[_0x3b67('0x119')],{'as':_0x3b67('0x111'),'through':_0x3b67('0x11a')});db[_0x3b67('0x104')][_0x3b67('0x113')](db['ChatInteraction'],{'as':_0x3b67('0x10d'),'through':'user_has_chat_interactions'});db[_0x3b67('0x104')][_0x3b67('0x113')](db['FaxInteraction'],{'as':_0x3b67('0x110'),'through':_0x3b67('0x11b')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x10e')],{'as':'SmsInteractions','through':_0x3b67('0x11c')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x5f')],{'as':_0x3b67('0x11d'),'through':_0x3b67('0x11e')});db[_0x3b67('0x104')]['belongsToMany'](db[_0x3b67('0x1b')],{'as':_0x3b67('0x11f'),'through':_0x3b67('0x120'),'required':![]});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x3f')],{'as':_0x3b67('0x121'),'through':_0x3b67('0x122'),'required':![]});db[_0x3b67('0x104')][_0x3b67('0x113')](db['ChatQueue'],{'as':'ChatQueues','through':_0x3b67('0x32'),'required':![],'hooks':!![]});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x51')],{'as':'FaxQueues','through':_0x3b67('0x34'),'required':![]});db[_0x3b67('0x104')]['belongsToMany'](db[_0x3b67('0x5a')],{'as':'SmsQueues','through':_0x3b67('0x35'),'required':![]});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x61')],{'as':'OpenchannelQueues','through':_0x3b67('0x37'),'required':![]});db[_0x3b67('0x104')]['belongsToMany'](db[_0x3b67('0xfb')],{'through':_0x3b67('0x117')});db[_0x3b67('0x104')]['belongsToMany'](db[_0x3b67('0xfd')],{'as':'VoicePrefixes','through':_0x3b67('0x123'),'required':![]});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x124')],{'as':_0x3b67('0x125'),'through':_0x3b67('0x126')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x127')],{'as':_0x3b67('0x128'),'through':'user_has_fax_accounts'});db['User'][_0x3b67('0x113')](db[_0x3b67('0x3d')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x5c')],{'as':'OpenchannelAccounts','through':_0x3b67('0x129')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x12a')],{'as':_0x3b67('0x12b'),'through':_0x3b67('0x12c')});db[_0x3b67('0x104')][_0x3b67('0x113')](db[_0x3b67('0x12d')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0x3b67('0x14')]['hasMany'](db[_0x3b67('0x17')],{'as':_0x3b67('0x12e'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x12f')});db['VoiceContext'][_0x3b67('0x106')](db[_0x3b67('0x17')],{'onDelete':'cascade'});db['VoiceExtension']['hasMany'](db[_0x3b67('0x17')],{'as':_0x3b67('0x130'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x19')][_0x3b67('0x113')](db[_0x3b67('0x90')],{'as':'Sounds','through':_0x3b67('0x131')});db[_0x3b67('0x1b')][_0x3b67('0x106')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x3b67('0x132')});db[_0x3b67('0x1b')][_0x3b67('0x106')](db['CmHopper'],{'as':_0x3b67('0x133'),'foreignKey':_0x3b67('0x132')});db[_0x3b67('0x1b')][_0x3b67('0x106')](db[_0x3b67('0x77')],{'as':'HopperFinals','foreignKey':_0x3b67('0x132')});db[_0x3b67('0x1b')][_0x3b67('0x106')](db[_0x3b67('0x79')],{'as':_0x3b67('0x134'),'foreignKey':_0x3b67('0x132')});db[_0x3b67('0x1b')][_0x3b67('0x106')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x3b67('0x132')});db[_0x3b67('0x1b')]['hasMany'](db['CmHopperBlack'],{'as':_0x3b67('0x135'),'foreignKey':_0x3b67('0x132')});db[_0x3b67('0x1b')][_0x3b67('0x106')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x3b67('0x132')});db[_0x3b67('0x1b')][_0x3b67('0x136')](db[_0x3b67('0x2d')],{'as':'Trunk','foreignKey':_0x3b67('0x137')});db[_0x3b67('0x1b')][_0x3b67('0x136')](db[_0x3b67('0x2d')],{'as':_0x3b67('0x138'),'foreignKey':'TrunkBackupId'});db[_0x3b67('0x1b')][_0x3b67('0x136')](db[_0x3b67('0x139')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x3b67('0x1b')][_0x3b67('0x136')](db[_0x3b67('0x88')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x3b67('0x113')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x13a'),'through':_0x3b67('0x13b')});db[_0x3b67('0x1b')]['belongsToMany'](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x120')});db[_0x3b67('0x1b')]['belongsToMany'](db['Team'],{'as':_0x3b67('0x13d'),'through':_0x3b67('0x13e')});db[_0x3b67('0x1b')][_0x3b67('0x113')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x13f'),'through':_0x3b67('0x140')});db['VoiceRecording'][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':_0x3b67('0x104'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x1f')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':_0x3b67('0x104'),'foreignKey':_0x3b67('0x105')});db['VoiceMail']['hasMany'](db[_0x3b67('0x23')],{'as':_0x3b67('0x141'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x142'),'sourceKey':_0x3b67('0x143')});db[_0x3b67('0x23')][_0x3b67('0x136')](db[_0x3b67('0x21')],{'foreignKey':_0x3b67('0x142'),'targetKey':_0x3b67('0x143')});db[_0x3b67('0x25')][_0x3b67('0x106')](db[_0x3b67('0x2a')],{'as':'QueueCalls','foreignKey':_0x3b67('0x144'),'constraints':![]});db[_0x3b67('0x25')][_0x3b67('0x106')](db[_0x3b67('0x28')],{'as':_0x3b67('0x145'),'foreignKey':_0x3b67('0x144'),'constraints':![]});db[_0x3b67('0x25')][_0x3b67('0x136')](db['User'],{'as':_0x3b67('0x104'),'foreignKey':'UserId'});db['VoiceCallReport'][_0x3b67('0x136')](db['CmContact'],{'as':'Contact','foreignKey':_0x3b67('0x146')});db[_0x3b67('0x39')][_0x3b67('0x136')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x3b67('0x147')});db[_0x3b67('0x3b')]['belongsTo'](db[_0x3b67('0x3d')],{'as':_0x3b67('0x3d'),'foreignKey':'MailAccountId'});db[_0x3b67('0x3d')][_0x3b67('0x148')](db['MailServerIn'],{'as':_0x3b67('0x149'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x3d')][_0x3b67('0x148')](db[_0x3b67('0x3b')],{'as':'Smtp','onDelete':_0x3b67('0x10b')});db['MailAccount'][_0x3b67('0x106')](db['Disposition'],{'as':_0x3b67('0x14a'),'foreignKey':_0x3b67('0x147')});db[_0x3b67('0x3d')][_0x3b67('0x106')](db[_0x3b67('0x83')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x3b67('0x3d')][_0x3b67('0x106')](db[_0x3b67('0x44')],{'as':_0x3b67('0x141'),'foreignKey':'MailAccountId'});db[_0x3b67('0x3d')]['hasMany'](db['MailInteraction'],{'as':'Interactions'});db[_0x3b67('0x3d')][_0x3b67('0x106')](db[_0x3b67('0x45')],{'as':_0x3b67('0x130')});db[_0x3b67('0x3d')][_0x3b67('0x136')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x14b'),'foreignKey':'ListId'});db[_0x3b67('0x3d')]['belongsTo'](db['Template'],{'as':_0x3b67('0x14c'),'foreignKey':_0x3b67('0x14d')});db[_0x3b67('0x3d')][_0x3b67('0x136')](db[_0x3b67('0x88')],{'as':_0x3b67('0x14e'),'foreignKey':_0x3b67('0x14f')});db['MailAccount']['belongsToMany'](db[_0x3b67('0x104')],{'as':'Agents','through':_0x3b67('0x150')});db[_0x3b67('0x3f')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x122')});db[_0x3b67('0x3f')]['belongsToMany'](db[_0x3b67('0xeb')],{'through':'team_has_mail_queues','as':'Teams'});db['MailInteraction']['hasMany'](db[_0x3b67('0x44')],{'as':_0x3b67('0x141'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x151')});db[_0x3b67('0x119')]['belongsTo'](db[_0x3b67('0x3d')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x147')});db['MailInteraction'][_0x3b67('0x136')](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db['MailInteraction']['belongsTo'](db[_0x3b67('0x104')],{'as':_0x3b67('0x154'),'foreignKey':'UserId'});db[_0x3b67('0x119')][_0x3b67('0x113')](db[_0x3b67('0x92')],{'through':_0x3b67('0x155'),'as':'Tags'});db[_0x3b67('0x119')]['belongsToMany'](db['Tag'],{'through':_0x3b67('0x155'),'as':_0x3b67('0x156')});db[_0x3b67('0x119')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x157'),'through':_0x3b67('0x11a'),'foreignKey':_0x3b67('0x151')});db[_0x3b67('0x44')][_0x3b67('0x106')](db[_0x3b67('0xf1')],{'as':_0x3b67('0x158'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x44')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':'User'});db[_0x3b67('0x44')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'onDelete':_0x3b67('0x10b'),'as':_0x3b67('0x153')});db[_0x3b67('0x44')][_0x3b67('0x136')](db[_0x3b67('0x119')],{'as':'Interaction','foreignKey':_0x3b67('0x151')});db[_0x3b67('0x44')][_0x3b67('0x136')](db[_0x3b67('0x3d')],{'as':'Account','foreignKey':_0x3b67('0x147')});db['MailApplication'][_0x3b67('0x136')](db[_0x3b67('0x104')],{'onDelete':_0x3b67('0x159')});db[_0x3b67('0x45')][_0x3b67('0x136')](db[_0x3b67('0x3f')],{'onDelete':_0x3b67('0x159')});db['MailApplication'][_0x3b67('0x136')](db[_0x3b67('0x3d')],{'onDelete':_0x3b67('0x159')});db[_0x3b67('0x45')]['belongsTo'](db[_0x3b67('0x139')],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x15a')});db[_0x3b67('0x45')][_0x3b67('0x136')](db[_0x3b67('0x92')],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x15b')});db['MailQueueReport'][_0x3b67('0x136')](db['MailAccount'],{});db[_0x3b67('0x47')][_0x3b67('0x136')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x14b'),'foreignKey':_0x3b67('0x15c')});db[_0x3b67('0x47')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x47')][_0x3b67('0x136')](db['MailInteraction'],{});db[_0x3b67('0x47')][_0x3b67('0x136')](db[_0x3b67('0x44')],{});db[_0x3b67('0x47')][_0x3b67('0x136')](db[_0x3b67('0x104')],{});db[_0x3b67('0x47')][_0x3b67('0x136')](db[_0x3b67('0x3f')],{});db[_0x3b67('0x49')][_0x3b67('0x106')](db['DashboardItem'],{'as':'Items','onDelete':_0x3b67('0x10b')});db[_0x3b67('0x127')]['hasMany'](db[_0x3b67('0x85')],{'as':_0x3b67('0x14a'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0x3b67('0x106')](db[_0x3b67('0x83')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0x3b67('0x127')][_0x3b67('0x106')](db[_0x3b67('0x4d')],{'as':'Interactions'});db['FaxAccount'][_0x3b67('0x106')](db[_0x3b67('0x4b')],{'as':_0x3b67('0x130')});db['FaxAccount']['hasMany'](db[_0x3b67('0x17')],{'as':_0x3b67('0x15d'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x127')][_0x3b67('0x106')](db[_0x3b67('0x4f')],{'as':_0x3b67('0x141')});db[_0x3b67('0x127')][_0x3b67('0x136')](db[_0x3b67('0x2d')],{'as':_0x3b67('0x2d')});db[_0x3b67('0x127')][_0x3b67('0x136')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x14b'),'foreignKey':'ListId'});db['FaxAccount']['belongsTo'](db[_0x3b67('0x88')],{'as':_0x3b67('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3b67('0x127')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x15e')});db[_0x3b67('0x4b')]['belongsTo'](db[_0x3b67('0x104')],{'onDelete':_0x3b67('0x159')});db[_0x3b67('0x4b')]['belongsTo'](db['FaxQueue'],{'onDelete':_0x3b67('0x159')});db[_0x3b67('0x4b')][_0x3b67('0x136')](db[_0x3b67('0x127')],{'onDelete':_0x3b67('0x159')});db[_0x3b67('0x4b')][_0x3b67('0x136')](db[_0x3b67('0x92')],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x15b')});db[_0x3b67('0x4d')]['hasMany'](db[_0x3b67('0x4f')],{'as':_0x3b67('0x141'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x15f')});db[_0x3b67('0x4d')]['belongsTo'](db[_0x3b67('0x127')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x160')});db[_0x3b67('0x4d')]['belongsTo'](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x4d')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':'Owner','foreignKey':_0x3b67('0x105')});db[_0x3b67('0x4d')]['belongsToMany'](db['Tag'],{'through':_0x3b67('0x161'),'as':_0x3b67('0x162')});db[_0x3b67('0x4d')]['belongsToMany'](db[_0x3b67('0x92')],{'through':_0x3b67('0x161'),'as':'ThroughTags'});db[_0x3b67('0x4d')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x157'),'through':_0x3b67('0x11b'),'foreignKey':_0x3b67('0x15f')});db[_0x3b67('0x4f')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'onDelete':_0x3b67('0x10b'),'as':_0x3b67('0x104')});db[_0x3b67('0x4f')][_0x3b67('0x136')](db['FaxInteraction'],{'as':_0x3b67('0x163'),'foreignKey':'FaxInteractionId'});db[_0x3b67('0x4f')][_0x3b67('0x136')](db['CmContact'],{'onDelete':'cascade','as':_0x3b67('0x153')});db[_0x3b67('0x4f')][_0x3b67('0x136')](db['Attachment'],{'as':'Attachment','foreignKey':_0x3b67('0x164')});db[_0x3b67('0x4f')][_0x3b67('0x136')](db['FaxAccount'],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x160')});db[_0x3b67('0x51')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':'UserFaxQueue'});db[_0x3b67('0x51')][_0x3b67('0x113')](db['Team'],{'through':'team_has_fax_queues','as':_0x3b67('0x13d')});db['FaxQueueReport'][_0x3b67('0x136')](db[_0x3b67('0x127')],{});db[_0x3b67('0x53')][_0x3b67('0x136')](db['CmList'],{'as':'List','foreignKey':_0x3b67('0x15c')});db['FaxQueueReport']['belongsTo'](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x53')]['belongsTo'](db[_0x3b67('0x4d')],{});db[_0x3b67('0x53')][_0x3b67('0x136')](db[_0x3b67('0x4f')],{});db[_0x3b67('0x53')][_0x3b67('0x136')](db[_0x3b67('0x104')],{});db[_0x3b67('0x53')][_0x3b67('0x136')](db[_0x3b67('0x51')],{});db[_0x3b67('0x12a')]['hasMany'](db['Disposition'],{'as':_0x3b67('0x14a'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x3b67('0x106')](db[_0x3b67('0x83')],{'as':_0x3b67('0x165'),'foreignKey':_0x3b67('0x166')});db[_0x3b67('0x12a')][_0x3b67('0x106')](db[_0x3b67('0x167')],{'as':_0x3b67('0x141'),'foreignKey':_0x3b67('0x166')});db[_0x3b67('0x12a')][_0x3b67('0x106')](db[_0x3b67('0x10e')],{'as':_0x3b67('0x168')});db[_0x3b67('0x12a')][_0x3b67('0x106')](db[_0x3b67('0x56')],{'as':_0x3b67('0x130')});db[_0x3b67('0x12a')]['belongsTo'](db['CmList'],{'as':_0x3b67('0x14b'),'foreignKey':_0x3b67('0x15c')});db[_0x3b67('0x12a')]['belongsTo'](db[_0x3b67('0x88')],{'as':_0x3b67('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3b67('0x12a')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x12c')});db[_0x3b67('0x56')][_0x3b67('0x136')](db['User'],{'onDelete':_0x3b67('0x159')});db[_0x3b67('0x56')][_0x3b67('0x136')](db[_0x3b67('0x5a')],{'onDelete':'restrict'});db[_0x3b67('0x56')][_0x3b67('0x136')](db['SmsAccount'],{'onDelete':_0x3b67('0x159')});db[_0x3b67('0x56')][_0x3b67('0x136')](db[_0x3b67('0x139')],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x15a')});db[_0x3b67('0x56')][_0x3b67('0x136')](db[_0x3b67('0x92')],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x15b')});db[_0x3b67('0x10e')]['hasMany'](db['SmsMessage'],{'as':_0x3b67('0x141'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x169')});db[_0x3b67('0x10e')][_0x3b67('0x136')](db[_0x3b67('0x12a')],{'as':_0x3b67('0x152'),'foreignKey':'SmsAccountId'});db[_0x3b67('0x10e')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x10e')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':'Owner','foreignKey':_0x3b67('0x105')});db['SmsInteraction'][_0x3b67('0x113')](db[_0x3b67('0x92')],{'through':_0x3b67('0x16a'),'as':_0x3b67('0x162')});db[_0x3b67('0x10e')]['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x3b67('0x156')});db['SmsInteraction'][_0x3b67('0x113')](db['User'],{'as':_0x3b67('0x157'),'through':'user_has_sms_interactions','foreignKey':_0x3b67('0x169')});db['SmsMessage'][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':_0x3b67('0x104')});db[_0x3b67('0x167')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'onDelete':_0x3b67('0x10b'),'as':_0x3b67('0x153')});db[_0x3b67('0x167')][_0x3b67('0x136')](db[_0x3b67('0x10e')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x3b67('0x169')});db['SmsMessage'][_0x3b67('0x136')](db[_0x3b67('0x12a')],{'as':_0x3b67('0x152'),'foreignKey':'SmsAccountId'});db[_0x3b67('0x5a')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x35'),'foreignKey':'SmsQueueId'});db[_0x3b67('0x5a')]['belongsToMany'](db[_0x3b67('0xeb')],{'through':_0x3b67('0x16b'),'as':_0x3b67('0x13d')});db[_0x3b67('0x5c')][_0x3b67('0x106')](db[_0x3b67('0x85')],{'as':_0x3b67('0x14a'),'foreignKey':_0x3b67('0x16c')});db[_0x3b67('0x5c')][_0x3b67('0x106')](db[_0x3b67('0x83')],{'as':'Answers','foreignKey':_0x3b67('0x16c')});db[_0x3b67('0x5c')][_0x3b67('0x106')](db['OpenchannelInteraction'],{'as':_0x3b67('0x168'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x3b67('0x106')](db['OpenchannelMessage'],{'as':_0x3b67('0x141'),'foreignKey':_0x3b67('0x16c')});db[_0x3b67('0x5c')]['hasMany'](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x3b67('0x16c')});db[_0x3b67('0x5c')][_0x3b67('0x136')](db['CmList'],{'as':_0x3b67('0x14b'),'foreignKey':_0x3b67('0x15c')});db[_0x3b67('0x5c')]['belongsTo'](db[_0x3b67('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0x3b67('0x14f')});db[_0x3b67('0x5c')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x129')});db[_0x3b67('0x5d')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'onDelete':_0x3b67('0x159')});db[_0x3b67('0x5d')][_0x3b67('0x136')](db[_0x3b67('0x61')],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x16d')});db[_0x3b67('0x5d')][_0x3b67('0x136')](db['OpenchannelAccount'],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x16c')});db['OpenchannelApplication'][_0x3b67('0x136')](db[_0x3b67('0x139')],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x15a')});db[_0x3b67('0x5d')][_0x3b67('0x136')](db[_0x3b67('0x92')],{'onDelete':'restrict','foreignKey':_0x3b67('0x15b')});db[_0x3b67('0x5f')][_0x3b67('0x106')](db[_0x3b67('0x60')],{'as':'Messages','onDelete':_0x3b67('0x10b'),'foreignKey':'OpenchannelInteractionId'});db[_0x3b67('0x5f')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x3b67('0x16c')});db[_0x3b67('0x5f')]['belongsTo'](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db['OpenchannelInteraction'][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':_0x3b67('0x154'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x5f')]['belongsToMany'](db[_0x3b67('0x92')],{'through':_0x3b67('0x16e'),'as':'Tags'});db['OpenchannelInteraction'][_0x3b67('0x113')](db['Tag'],{'through':_0x3b67('0x16e'),'as':'ThroughTags'});db[_0x3b67('0x5f')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x157'),'through':_0x3b67('0x11e'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage']['belongsTo'](db['User'],{'onDelete':_0x3b67('0x10b'),'as':'User'});db[_0x3b67('0x60')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'onDelete':_0x3b67('0x10b'),'as':'Contact'});db[_0x3b67('0x60')][_0x3b67('0x136')](db[_0x3b67('0x5f')],{'onDelete':_0x3b67('0x10b'),'as':'Interaction','foreignKey':_0x3b67('0x16f')});db[_0x3b67('0x60')][_0x3b67('0x136')](db[_0x3b67('0xf1')],{'as':'Attachment','foreignKey':_0x3b67('0x164')});db[_0x3b67('0x60')][_0x3b67('0x136')](db[_0x3b67('0x5c')],{'as':_0x3b67('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0x3b67('0x61')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x37'),'foreignKey':_0x3b67('0x16d')});db['OpenchannelQueue']['belongsToMany'](db[_0x3b67('0xeb')],{'through':_0x3b67('0x170'),'as':'Teams'});db[_0x3b67('0x124')][_0x3b67('0x106')](db['Disposition'],{'as':_0x3b67('0x14a'),'foreignKey':'ChatWebsiteId'});db[_0x3b67('0x124')][_0x3b67('0x106')](db['CannedAnswer'],{'as':_0x3b67('0x165'),'foreignKey':_0x3b67('0x171')});db[_0x3b67('0x124')][_0x3b67('0x106')](db[_0x3b67('0x70')],{'as':'ProactiveActions'});db[_0x3b67('0x124')][_0x3b67('0x106')](db['ChatInteraction'],{'as':'Interactions'});db['ChatWebsite'][_0x3b67('0x106')](db[_0x3b67('0x66')],{'as':_0x3b67('0x130')});db[_0x3b67('0x124')][_0x3b67('0x106')](db[_0x3b67('0x172')],{'as':_0x3b67('0x141')});db['ChatWebsite'][_0x3b67('0x136')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x14b'),'foreignKey':_0x3b67('0x15c')});db['ChatWebsite']['belongsTo'](db[_0x3b67('0x139')],{'as':'Interval','foreignKey':_0x3b67('0x15a')});db['ChatWebsite'][_0x3b67('0x136')](db['Pause'],{'as':_0x3b67('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3b67('0x124')][_0x3b67('0x113')](db['User'],{'as':_0x3b67('0x13c'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x3b67('0x136')](db[_0x3b67('0x5c')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x3b67('0xfb')],{'as':_0x3b67('0x14b'),'foreignKey':'ListId'});db[_0x3b67('0x64')]['belongsTo'](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db['OpenchannelQueueReport']['belongsTo'](db[_0x3b67('0x5f')],{});db[_0x3b67('0x64')][_0x3b67('0x136')](db[_0x3b67('0x60')],{});db[_0x3b67('0x64')][_0x3b67('0x136')](db['User'],{});db['OpenchannelQueueReport'][_0x3b67('0x136')](db[_0x3b67('0x61')],{});db[_0x3b67('0x66')]['belongsTo'](db[_0x3b67('0x104')],{'as':_0x3b67('0x173'),'foreignKey':'UserId','onDelete':_0x3b67('0x159')});db[_0x3b67('0x66')][_0x3b67('0x136')](db[_0x3b67('0x6c')],{'as':_0x3b67('0x174'),'foreignKey':_0x3b67('0x175'),'onDelete':_0x3b67('0x159')});db[_0x3b67('0x66')][_0x3b67('0x136')](db[_0x3b67('0x124')],{'as':_0x3b67('0x176'),'foreignKey':_0x3b67('0x171'),'onDelete':_0x3b67('0x159')});db[_0x3b67('0x66')][_0x3b67('0x136')](db[_0x3b67('0x92')],{'onDelete':_0x3b67('0x159'),'foreignKey':_0x3b67('0x15b')});db[_0x3b67('0x68')][_0x3b67('0x106')](db[_0x3b67('0x172')],{'as':_0x3b67('0x141'),'onDelete':'cascade','foreignKey':_0x3b67('0x177')});db[_0x3b67('0x68')][_0x3b67('0x136')](db['ChatWebsite'],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x171')});db['ChatInteraction'][_0x3b67('0x136')](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x68')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':_0x3b67('0x154'),'foreignKey':_0x3b67('0x105')});db[_0x3b67('0x68')][_0x3b67('0x113')](db[_0x3b67('0x92')],{'through':_0x3b67('0x178'),'as':'Tags'});db[_0x3b67('0x68')][_0x3b67('0x113')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x3b67('0x156')});db[_0x3b67('0x68')]['belongsToMany'](db[_0x3b67('0x104')],{'as':_0x3b67('0x157'),'through':_0x3b67('0x179'),'foreignKey':_0x3b67('0x177')});db[_0x3b67('0x172')]['belongsTo'](db[_0x3b67('0x104')],{'onDelete':'cascade','as':_0x3b67('0x104')});db[_0x3b67('0x172')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'onDelete':_0x3b67('0x10b'),'as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x172')][_0x3b67('0x136')](db[_0x3b67('0x68')],{'onDelete':_0x3b67('0x10b'),'as':_0x3b67('0x163'),'foreignKey':_0x3b67('0x177')});db[_0x3b67('0x172')][_0x3b67('0x136')](db[_0x3b67('0xf1')],{'as':_0x3b67('0xf1'),'foreignKey':'AttachmentId'});db[_0x3b67('0x172')][_0x3b67('0x136')](db[_0x3b67('0x124')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x171')});db[_0x3b67('0x6a')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'onDelete':'cascade','as':_0x3b67('0x153'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x6a')][_0x3b67('0x136')](db[_0x3b67('0x124')],{'as':'Account','foreignKey':_0x3b67('0x171')});db[_0x3b67('0x6c')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x32'),'hooks':!![]});db[_0x3b67('0x6c')][_0x3b67('0x113')](db['Team'],{'through':'team_has_chat_queues','as':_0x3b67('0x13d')});db[_0x3b67('0x6e')][_0x3b67('0x106')](db[_0x3b67('0xd8')],{'as':_0x3b67('0x141'),'foreignKey':_0x3b67('0x17a'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x6e')][_0x3b67('0x113')](db['User'],{'as':_0x3b67('0x17b'),'through':_0x3b67('0x114')});db[_0x3b67('0x70')][_0x3b67('0x136')](db['ChatWebsite'],{'as':_0x3b67('0x176'),'foreignKey':'ChatWebsiteId'});db[_0x3b67('0x17c')][_0x3b67('0x106')](db[_0x3b67('0x115')],{'as':_0x3b67('0x17d'),'foreignKey':_0x3b67('0x17e')});db[_0x3b67('0x115')][_0x3b67('0x106')](db['CmHopper'],{'as':_0x3b67('0x133'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x115')][_0x3b67('0x106')](db[_0x3b67('0x77')],{'as':_0x3b67('0x10c'),'foreignKey':_0x3b67('0x146')});db['CmContact']['hasMany'](db[_0x3b67('0x79')],{'as':_0x3b67('0x134'),'foreignKey':_0x3b67('0x146')});db[_0x3b67('0x115')][_0x3b67('0x106')](db['ReportAgentPreview'],{'as':_0x3b67('0x7b'),'foreignKey':_0x3b67('0x146')});db['CmContact'][_0x3b67('0x106')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x3b67('0x146')});db[_0x3b67('0x115')][_0x3b67('0x106')](db[_0x3b67('0x5f')],{'as':_0x3b67('0x11d'),'foreignKey':_0x3b67('0x146'),'onDelete':_0x3b67('0x159')});db['CmContact'][_0x3b67('0x106')](db[_0x3b67('0x68')],{'as':_0x3b67('0x10d'),'foreignKey':'ContactId','onDelete':_0x3b67('0x159')});db[_0x3b67('0x115')][_0x3b67('0x106')](db[_0x3b67('0x10e')],{'as':_0x3b67('0x10f'),'foreignKey':_0x3b67('0x146'),'onDelete':_0x3b67('0x159')});db['CmContact'][_0x3b67('0x106')](db[_0x3b67('0x4d')],{'as':'FaxInteractions','foreignKey':_0x3b67('0x146'),'onDelete':'restrict'});db[_0x3b67('0x115')][_0x3b67('0x106')](db[_0x3b67('0x119')],{'as':_0x3b67('0x111'),'foreignKey':_0x3b67('0x146'),'onDelete':_0x3b67('0x159')});db[_0x3b67('0x115')][_0x3b67('0x136')](db['CmCompany'],{'as':_0x3b67('0x17f'),'foreignKey':_0x3b67('0x17e')});db[_0x3b67('0x115')][_0x3b67('0x136')](db['CmList'],{'as':'List','foreignKey':_0x3b67('0x15c'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x115')]['belongsToMany'](db['User'],{'as':_0x3b67('0x157'),'through':_0x3b67('0x116')});db[_0x3b67('0x115')][_0x3b67('0x113')](db[_0x3b67('0x92')],{'as':_0x3b67('0x162'),'through':_0x3b67('0x180')});db[_0x3b67('0x115')]['belongsToMany'](db['Tag'],{'through':_0x3b67('0x180'),'as':_0x3b67('0x156')});db[_0x3b67('0x73')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':'ContactId','onDelete':_0x3b67('0x10b')});db[_0x3b67('0x73')][_0x3b67('0x136')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x14b'),'foreignKey':_0x3b67('0x15c'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x73')]['belongsTo'](db[_0x3b67('0x104')],{'as':_0x3b67('0x173'),'foreignKey':'UserId'});db[_0x3b67('0x73')]['belongsTo'](db[_0x3b67('0x1b')],{'as':'Queue','foreignKey':_0x3b67('0x132'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x73')]['belongsTo'](db[_0x3b67('0xef')],{'as':_0x3b67('0xef'),'foreignKey':'CampaignId','onDelete':_0x3b67('0x10b')});db[_0x3b67('0x73')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'as':_0x3b67('0x154'),'foreignKey':_0x3b67('0x181')});db['CmHopperBlack'][_0x3b67('0x136')](db[_0x3b67('0x115')],{'as':'Contact','foreignKey':_0x3b67('0x146'),'onDelete':_0x3b67('0x10b')});db['CmHopperBlack'][_0x3b67('0x136')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x14b'),'foreignKey':_0x3b67('0x15c'),'onDelete':_0x3b67('0x10b')});db['CmHopperBlack']['belongsTo'](db[_0x3b67('0x1b')],{'as':_0x3b67('0x174'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x3b67('0x75')][_0x3b67('0x136')](db[_0x3b67('0xef')],{'as':_0x3b67('0xef'),'foreignKey':_0x3b67('0x182'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x81')]['hasMany'](db['Condition'],{'as':{'plural':_0x3b67('0x183'),'singular':_0x3b67('0x184')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x3b67('0x81')][_0x3b67('0x106')](db['Condition'],{'as':{'plural':_0x3b67('0x185'),'singular':_0x3b67('0x186')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0x3b67('0x81')][_0x3b67('0x106')](db[_0x3b67('0x7f')],{'as':_0x3b67('0x187'),'foreignKey':_0x3b67('0x188'),'onDelete':_0x3b67('0x10b'),'hooks':!![]});db[_0x3b67('0x139')]['hasMany'](db[_0x3b67('0x139')],{'as':_0x3b67('0x189'),'foreignKey':_0x3b67('0x15a'),'onDelete':_0x3b67('0x10b'),'hooks':!![],'required':![]});db[_0x3b67('0x139')][_0x3b67('0x106')](db['VoiceExtension'],{'as':_0x3b67('0x10a'),'foreignKey':_0x3b67('0x15a'),'onDelete':_0x3b67('0x159')});db['Interval'][_0x3b67('0x106')](db[_0x3b67('0x45')],{'as':'MailApplications','foreignKey':_0x3b67('0x15a')});db['Interval'][_0x3b67('0x106')](db[_0x3b67('0x66')],{'as':_0x3b67('0x18a'),'foreignKey':'IntervalId'});db[_0x3b67('0x139')]['hasMany'](db['FaxApplication'],{'as':_0x3b67('0x18b'),'foreignKey':_0x3b67('0x15a')});db[_0x3b67('0x139')][_0x3b67('0x106')](db['SmsApplication'],{'as':_0x3b67('0x18c'),'foreignKey':'IntervalId'});db[_0x3b67('0x8e')]['belongsTo'](db[_0x3b67('0x3d')],{});db[_0x3b67('0x8e')][_0x3b67('0x136')](db[_0x3b67('0x9e')],{'foreignKey':_0x3b67('0x18d')});db[_0x3b67('0x8e')][_0x3b67('0x136')](db[_0x3b67('0x9c')],{'foreignKey':'CustomReportId'});db[_0x3b67('0x90')][_0x3b67('0x113')](db[_0x3b67('0x19')],{'as':'Mohs','through':_0x3b67('0x131'),'onDelete':_0x3b67('0x159')});db[_0x3b67('0x92')][_0x3b67('0x113')](db[_0x3b67('0x115')],{'through':_0x3b67('0x180')});db[_0x3b67('0x92')][_0x3b67('0x113')](db[_0x3b67('0x68')],{'through':_0x3b67('0x178')});db['Tag'][_0x3b67('0x113')](db[_0x3b67('0x119')],{'through':_0x3b67('0x155')});db[_0x3b67('0x92')]['belongsToMany'](db[_0x3b67('0x10e')],{'through':_0x3b67('0x16a')});db[_0x3b67('0x92')]['belongsToMany'](db[_0x3b67('0x4d')],{'through':_0x3b67('0x161')});db[_0x3b67('0x92')][_0x3b67('0x113')](db[_0x3b67('0x5f')],{'through':_0x3b67('0x16e')});db['Trigger'][_0x3b67('0x106')](db[_0x3b67('0x18e')],{'as':{'plural':'AllConditions','singular':_0x3b67('0x18f')},'foreignKey':'TriggerAllId','onDelete':_0x3b67('0x10b'),'hooks':!![]});db[_0x3b67('0x95')][_0x3b67('0x106')](db['Condition'],{'as':{'plural':_0x3b67('0x190'),'singular':_0x3b67('0x191')},'foreignKey':'TriggerAnyId','onDelete':_0x3b67('0x10b'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':_0x3b67('0x187'),'foreignKey':_0x3b67('0x192'),'onDelete':_0x3b67('0x10b'),'hooks':!![]});db[_0x3b67('0x9c')][_0x3b67('0x106')](db[_0x3b67('0xa2')],{'as':_0x3b67('0x193'),'onDelete':'cascade','foreignKey':_0x3b67('0x194'),'hooks':!![]});db[_0x3b67('0x9e')][_0x3b67('0x106')](db[_0x3b67('0xa2')],{'as':_0x3b67('0x193'),'onDelete':'cascade','foreignKey':_0x3b67('0x18d')});db['AnalyticMetric'][_0x3b67('0x106')](db[_0x3b67('0xa2')],{'as':_0x3b67('0x193'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x195')});db[_0x3b67('0xa2')][_0x3b67('0x136')](db[_0x3b67('0xa1')],{'foreignKey':'MetricId'});db[_0x3b67('0xa6')][_0x3b67('0x106')](db[_0x3b67('0xa7')],{'as':_0x3b67('0x196'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x197')});db['SalesforceConfiguration']['hasMany'](db[_0x3b67('0xa8')],{'as':_0x3b67('0x198'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x3b67('0xa7')][_0x3b67('0x106')](db[_0x3b67('0xa8')],{'as':'Descriptions','onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0xa7')]['hasMany'](db[_0x3b67('0xa8')],{'as':_0x3b67('0x193'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xa7')][_0x3b67('0x136')](db[_0x3b67('0xa6')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db[_0x3b67('0xa8')]['hasMany'](db[_0x3b67('0xa8')],{'as':_0x3b67('0x19b'),'foreignKey':_0x3b67('0x19c')});db['SalesforceField']['hasMany'](db[_0x3b67('0xa8')],{'as':_0x3b67('0x19d'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0xa8')]['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xa8')][_0x3b67('0x136')](db[_0x3b67('0x97')],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db['SugarcrmAccount'][_0x3b67('0x106')](db[_0x3b67('0xac')],{'as':'Configurations','onDelete':_0x3b67('0x10b'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0x3b67('0x106')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0xac')][_0x3b67('0x106')](db[_0x3b67('0x19f')],{'as':_0x3b67('0x1a0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3b67('0xac')][_0x3b67('0x106')](db[_0x3b67('0x19f')],{'as':_0x3b67('0x193'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xac')][_0x3b67('0x136')](db[_0x3b67('0xaa')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db[_0x3b67('0x19f')]['hasMany'](db['SugarcrmField'],{'as':_0x3b67('0x19b'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0x19f')]['hasMany'](db[_0x3b67('0x19f')],{'as':_0x3b67('0x19d'),'foreignKey':'DescriptionId'});db[_0x3b67('0x19f')][_0x3b67('0x106')](db[_0x3b67('0x19f')],{'as':_0x3b67('0x1a1'),'foreignKey':_0x3b67('0x19a')});db['SugarcrmField'][_0x3b67('0x136')](db[_0x3b67('0x97')],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db[_0x3b67('0xae')]['hasMany'](db[_0x3b67('0xb0')],{'as':_0x3b67('0x196'),'onDelete':'cascade','foreignKey':_0x3b67('0x197')});db['DeskConfiguration'][_0x3b67('0x106')](db['DeskField'],{'as':_0x3b67('0x198'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x19c')});db['DeskConfiguration'][_0x3b67('0x106')](db[_0x3b67('0xb1')],{'as':'Descriptions','onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0xb0')][_0x3b67('0x106')](db[_0x3b67('0xb1')],{'as':_0x3b67('0x193'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xb0')][_0x3b67('0x136')](db[_0x3b67('0xae')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db[_0x3b67('0xb0')][_0x3b67('0x113')](db['Tag'],{'through':_0x3b67('0x1a2')});db[_0x3b67('0xb1')][_0x3b67('0x106')](db[_0x3b67('0xb1')],{'as':_0x3b67('0x19b'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0xb1')]['hasMany'](db[_0x3b67('0xb1')],{'as':_0x3b67('0x19d'),'foreignKey':'DescriptionId'});db[_0x3b67('0xb1')][_0x3b67('0x106')](db[_0x3b67('0xb1')],{'as':_0x3b67('0x1a1'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xb1')][_0x3b67('0x136')](db[_0x3b67('0x97')],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db['ZohoAccount'][_0x3b67('0x106')](db[_0x3b67('0x1a3')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x3b67('0x197')});db[_0x3b67('0x1a3')]['hasMany'](db['ZohoField'],{'as':'Subjects','onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0x1a3')][_0x3b67('0x106')](db[_0x3b67('0xb6')],{'as':_0x3b67('0x1a0'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0x1a3')][_0x3b67('0x106')](db[_0x3b67('0xb6')],{'as':_0x3b67('0x193'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0x1a3')]['belongsTo'](db['ZohoAccount'],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db[_0x3b67('0xb6')]['hasMany'](db[_0x3b67('0xb6')],{'as':_0x3b67('0x19b'),'foreignKey':'SubjectId'});db[_0x3b67('0xb6')][_0x3b67('0x106')](db['ZohoField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3b67('0xb6')][_0x3b67('0x106')](db[_0x3b67('0xb6')],{'as':_0x3b67('0x1a1'),'foreignKey':'FieldId'});db[_0x3b67('0xb6')]['belongsTo'](db[_0x3b67('0x97')],{'as':'Variable','foreignKey':_0x3b67('0x19e')});db['ZendeskAccount'][_0x3b67('0x106')](db[_0x3b67('0x1a4')],{'as':'Configurations','onDelete':_0x3b67('0x10b'),'foreignKey':'AccountId'});db[_0x3b67('0x1a4')][_0x3b67('0x106')](db[_0x3b67('0xbb')],{'as':'Subjects','foreignKey':_0x3b67('0x19c')});db[_0x3b67('0x1a4')]['hasMany'](db['ZendeskField'],{'as':_0x3b67('0x1a0'),'foreignKey':_0x3b67('0x199')});db['ZendeskConfiguration']['hasMany'](db[_0x3b67('0xbb')],{'as':_0x3b67('0x193'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0x1a4')][_0x3b67('0x136')](db[_0x3b67('0xb8')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db[_0x3b67('0x1a4')][_0x3b67('0x113')](db['Tag'],{'through':_0x3b67('0x1a5')});db['ZendeskField'][_0x3b67('0x106')](db[_0x3b67('0xbb')],{'as':_0x3b67('0x19b'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0xbb')][_0x3b67('0x106')](db[_0x3b67('0xbb')],{'as':'Description','foreignKey':_0x3b67('0x199')});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':'Field','foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xbb')][_0x3b67('0x136')](db[_0x3b67('0x97')],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db[_0x3b67('0xbd')][_0x3b67('0x106')](db['FreshdeskConfiguration'],{'as':_0x3b67('0x196'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x197')});db[_0x3b67('0x1a6')][_0x3b67('0x106')](db[_0x3b67('0xc0')],{'as':'Subjects','onDelete':_0x3b67('0x10b'),'foreignKey':'SubjectId'});db[_0x3b67('0x1a6')][_0x3b67('0x106')](db['FreshdeskField'],{'as':_0x3b67('0x1a0'),'onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x199')});db['FreshdeskConfiguration'][_0x3b67('0x106')](db['FreshdeskField'],{'as':_0x3b67('0x193'),'onDelete':'cascade','foreignKey':_0x3b67('0x19a')});db[_0x3b67('0x1a6')][_0x3b67('0x136')](db[_0x3b67('0xbd')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db[_0x3b67('0x1a6')][_0x3b67('0x113')](db[_0x3b67('0x92')],{'through':_0x3b67('0x1a7')});db['FreshdeskField'][_0x3b67('0x106')](db[_0x3b67('0xc0')],{'as':_0x3b67('0x19b'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0xc0')][_0x3b67('0x106')](db[_0x3b67('0xc0')],{'as':_0x3b67('0x19d'),'foreignKey':_0x3b67('0x199')});db['FreshdeskField'][_0x3b67('0x106')](db['FreshdeskField'],{'as':'Field','foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xc0')][_0x3b67('0x136')](db['Variable'],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db[_0x3b67('0xc2')][_0x3b67('0x106')](db['VtigerConfiguration'],{'as':_0x3b67('0x196'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x3b67('0xc4')]['hasMany'](db[_0x3b67('0x1a8')],{'as':'Subjects','foreignKey':_0x3b67('0x19c')});db[_0x3b67('0xc4')][_0x3b67('0x106')](db[_0x3b67('0x1a8')],{'as':_0x3b67('0x1a0'),'foreignKey':_0x3b67('0x199')});db['VtigerConfiguration'][_0x3b67('0x106')](db[_0x3b67('0x1a8')],{'as':_0x3b67('0x193'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xc4')][_0x3b67('0x136')](db[_0x3b67('0xc2')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0x3b67('0x19b'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0x1a8')][_0x3b67('0x106')](db['VtigerField'],{'as':_0x3b67('0x19d'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0x1a8')][_0x3b67('0x106')](db[_0x3b67('0x1a8')],{'as':_0x3b67('0x1a1'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0x1a8')]['belongsTo'](db[_0x3b67('0x97')],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db[_0x3b67('0xc5')][_0x3b67('0x106')](db[_0x3b67('0x1a9')],{'as':'Configurations','onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x197')});db['ServicenowConfiguration']['hasMany'](db[_0x3b67('0xc8')],{'as':_0x3b67('0x198'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0x1a9')]['hasMany'](db[_0x3b67('0xc8')],{'as':_0x3b67('0x1a0'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0x1a9')]['hasMany'](db['ServicenowField'],{'as':_0x3b67('0x193'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0x1a9')][_0x3b67('0x136')](db[_0x3b67('0xc5')],{'as':'Account','foreignKey':'AccountId'});db[_0x3b67('0xc8')][_0x3b67('0x106')](db[_0x3b67('0xc8')],{'as':_0x3b67('0x19b'),'foreignKey':_0x3b67('0x19c')});db['ServicenowField'][_0x3b67('0x106')](db[_0x3b67('0xc8')],{'as':_0x3b67('0x19d'),'foreignKey':'DescriptionId'});db[_0x3b67('0xc8')]['hasMany'](db[_0x3b67('0xc8')],{'as':_0x3b67('0x1a1'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xc8')][_0x3b67('0x136')](db[_0x3b67('0x97')],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db['Dynamics365Account'][_0x3b67('0x106')](db[_0x3b67('0xcb')],{'as':_0x3b67('0x196'),'onDelete':'cascade','foreignKey':_0x3b67('0x197')});db[_0x3b67('0xcb')]['hasMany'](db[_0x3b67('0xcd')],{'as':_0x3b67('0x198'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x3b67('0xcb')][_0x3b67('0x106')](db['Dynamics365Field'],{'as':_0x3b67('0x1a0'),'onDelete':_0x3b67('0x10b'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x3b67('0x106')](db['Dynamics365Field'],{'as':_0x3b67('0x193'),'onDelete':_0x3b67('0x10b'),'foreignKey':'FieldId'});db[_0x3b67('0xcb')]['belongsTo'](db[_0x3b67('0xca')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db[_0x3b67('0xcd')][_0x3b67('0x106')](db[_0x3b67('0xcd')],{'as':_0x3b67('0x19b'),'foreignKey':'SubjectId'});db[_0x3b67('0xcd')][_0x3b67('0x106')](db[_0x3b67('0xcd')],{'as':_0x3b67('0x19d'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0xcd')]['hasMany'](db[_0x3b67('0xcd')],{'as':_0x3b67('0x1a1'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0x3b67('0x136')](db[_0x3b67('0x97')],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db['FreshsalesAccount'][_0x3b67('0x106')](db[_0x3b67('0xd0')],{'as':_0x3b67('0x196'),'onDelete':_0x3b67('0x10b'),'foreignKey':'AccountId'});db[_0x3b67('0xd0')][_0x3b67('0x106')](db[_0x3b67('0xd2')],{'as':_0x3b67('0x198'),'foreignKey':_0x3b67('0x19c')});db[_0x3b67('0xd0')][_0x3b67('0x106')](db['FreshsalesField'],{'as':_0x3b67('0x1a0'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0xd0')][_0x3b67('0x106')](db[_0x3b67('0xd2')],{'as':'Fields','foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xd0')][_0x3b67('0x136')](db[_0x3b67('0xce')],{'as':_0x3b67('0x152'),'foreignKey':_0x3b67('0x197')});db['FreshsalesField'][_0x3b67('0x106')](db['FreshsalesField'],{'as':_0x3b67('0x19b'),'foreignKey':'SubjectId'});db[_0x3b67('0xd2')]['hasMany'](db['FreshsalesField'],{'as':_0x3b67('0x19d'),'foreignKey':_0x3b67('0x199')});db[_0x3b67('0xd2')]['hasMany'](db['FreshsalesField'],{'as':_0x3b67('0x1a1'),'foreignKey':_0x3b67('0x19a')});db[_0x3b67('0xd2')][_0x3b67('0x136')](db[_0x3b67('0x97')],{'as':_0x3b67('0x97'),'foreignKey':_0x3b67('0x19e')});db[_0x3b67('0xd6')][_0x3b67('0x136')](db['ChatWebsite'],{});db[_0x3b67('0xd6')][_0x3b67('0x136')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x14b'),'foreignKey':_0x3b67('0x15c')});db[_0x3b67('0xd6')][_0x3b67('0x136')](db['CmContact'],{'as':'Contact','foreignKey':_0x3b67('0x146')});db['ChatQueueReport'][_0x3b67('0x136')](db['ChatInteraction'],{});db[_0x3b67('0xd6')][_0x3b67('0x136')](db['ChatMessage'],{});db['ChatQueueReport'][_0x3b67('0x136')](db[_0x3b67('0x104')],{});db[_0x3b67('0xd6')]['belongsTo'](db[_0x3b67('0x6c')],{});db[_0x3b67('0xd8')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'onDelete':'cascade','foreignKey':_0x3b67('0x1aa')});db[_0x3b67('0xd8')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'onDelete':_0x3b67('0x10b'),'foreignKey':'ToId'});db[_0x3b67('0x1ab')][_0x3b67('0x106')](db['JscriptyQuestionReport'],{'foreignKey':_0x3b67('0x1ac'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x1ab')][_0x3b67('0x106')](db['JscriptyAnswerReport'],{'foreignKey':_0x3b67('0x1ac'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x1ad')][_0x3b67('0x136')](db[_0x3b67('0x12a')],{});db[_0x3b67('0x1ad')][_0x3b67('0x136')](db['CmList'],{'as':_0x3b67('0x14b'),'foreignKey':_0x3b67('0x15c')});db[_0x3b67('0x1ad')][_0x3b67('0x136')](db[_0x3b67('0x115')],{'as':_0x3b67('0x153'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0x3b67('0x136')](db['SmsInteraction'],{});db[_0x3b67('0x1ad')]['belongsTo'](db[_0x3b67('0x167')],{});db[_0x3b67('0x1ad')][_0x3b67('0x136')](db[_0x3b67('0x104')],{});db[_0x3b67('0x1ad')][_0x3b67('0x136')](db[_0x3b67('0x5a')],{});db['JscriptyProject'][_0x3b67('0x106')](db[_0x3b67('0x1ab')],{'foreignKey':_0x3b67('0x1ae')});db[_0x3b67('0xe2')]['hasMany'](db[_0x3b67('0xdb')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x3b67('0x106')](db[_0x3b67('0xda')],{'foreignKey':_0x3b67('0x1ae')});db[_0x3b67('0x12d')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x157'),'through':_0x3b67('0x1af')});db[_0x3b67('0xeb')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':'Agents','through':_0x3b67('0x118')});db['Team'][_0x3b67('0x113')](db[_0x3b67('0x1b')],{'through':_0x3b67('0x13e'),'as':'VoiceQueues'});db['Team'][_0x3b67('0x113')](db['MailQueue'],{'through':_0x3b67('0x1b0'),'as':_0x3b67('0x121')});db['Team'][_0x3b67('0x113')](db[_0x3b67('0x6c')],{'through':'team_has_chat_queues','as':_0x3b67('0x1b1')});db[_0x3b67('0xeb')]['belongsToMany'](db[_0x3b67('0x51')],{'through':_0x3b67('0x1b2'),'as':_0x3b67('0x1b3')});db[_0x3b67('0xeb')][_0x3b67('0x113')](db[_0x3b67('0x5a')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0x3b67('0xeb')][_0x3b67('0x113')](db['OpenchannelQueue'],{'through':_0x3b67('0x170'),'as':_0x3b67('0x1b4')});db[_0x3b67('0xef')][_0x3b67('0x106')](db[_0x3b67('0x73')],{'as':_0x3b67('0x133'),'foreignKey':_0x3b67('0x182')});db[_0x3b67('0xef')][_0x3b67('0x106')](db[_0x3b67('0x77')],{'as':_0x3b67('0x10c'),'foreignKey':_0x3b67('0x182')});db[_0x3b67('0xef')][_0x3b67('0x106')](db[_0x3b67('0x79')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0x3b67('0xef')][_0x3b67('0x106')](db[_0x3b67('0x75')],{'as':_0x3b67('0x135'),'foreignKey':_0x3b67('0x182')});db[_0x3b67('0xef')][_0x3b67('0x136')](db[_0x3b67('0x2d')],{'as':_0x3b67('0x2d'),'foreignKey':_0x3b67('0x137')});db[_0x3b67('0xef')][_0x3b67('0x136')](db[_0x3b67('0x2d')],{'as':'TrunkBackup','foreignKey':_0x3b67('0x1b5')});db[_0x3b67('0xef')][_0x3b67('0x136')](db[_0x3b67('0x139')],{'as':_0x3b67('0x139'),'foreignKey':_0x3b67('0x15a')});db[_0x3b67('0xef')][_0x3b67('0x136')](db[_0x3b67('0x12d')],{'as':_0x3b67('0x12d'),'foreignKey':'SquareProjectId'});db[_0x3b67('0xef')][_0x3b67('0x113')](db[_0x3b67('0xfb')],{'as':_0x3b67('0x13a'),'through':'campaigns_has_cm_lists'});db[_0x3b67('0xef')]['belongsToMany'](db[_0x3b67('0xfb')],{'as':'BlackLists','through':_0x3b67('0x1b6')});db[_0x3b67('0xf4')][_0x3b67('0x136')](db['MailMessage'],{});db[_0x3b67('0xf4')][_0x3b67('0x136')](db['MailInteraction'],{});db[_0x3b67('0xf4')][_0x3b67('0x136')](db[_0x3b67('0x3d')],{'foreignKey':_0x3b67('0x1b7'),'as':'FromAccount'});db['MailTransferReport'][_0x3b67('0x136')](db[_0x3b67('0x104')],{'foreignKey':_0x3b67('0x1b8'),'as':_0x3b67('0x1b9')});db[_0x3b67('0xf4')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'foreignKey':_0x3b67('0x1ba'),'as':_0x3b67('0x1bb')});db[_0x3b67('0xf4')]['belongsTo'](db[_0x3b67('0x3f')],{'foreignKey':'ToMailQueueId','as':_0x3b67('0x1bc')});db[_0x3b67('0xf4')][_0x3b67('0x136')](db[_0x3b67('0x3d')],{'foreignKey':'ToMailAccountId','as':_0x3b67('0x1bd')});db[_0x3b67('0xf5')][_0x3b67('0x136')](db['ChatMessage'],{});db[_0x3b67('0xf5')]['belongsTo'](db[_0x3b67('0x68')],{});db[_0x3b67('0xf5')]['belongsTo'](db[_0x3b67('0x124')],{'foreignKey':_0x3b67('0x1be'),'as':_0x3b67('0x1bf')});db[_0x3b67('0xf5')][_0x3b67('0x136')](db['User'],{'foreignKey':_0x3b67('0x1b8'),'as':_0x3b67('0x1b9')});db[_0x3b67('0xf5')]['belongsTo'](db[_0x3b67('0x104')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x3b67('0xf5')]['belongsTo'](db[_0x3b67('0x6c')],{'foreignKey':_0x3b67('0x1c0'),'as':'ToQueue'});db[_0x3b67('0xf5')][_0x3b67('0x136')](db[_0x3b67('0x124')],{'foreignKey':_0x3b67('0x1c1'),'as':'ToAccount'});db[_0x3b67('0xf7')][_0x3b67('0x136')](db[_0x3b67('0x4f')],{});db[_0x3b67('0xf7')][_0x3b67('0x136')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x3b67('0x136')](db[_0x3b67('0x127')],{'foreignKey':_0x3b67('0x1c2'),'as':_0x3b67('0x1bf')});db['FaxTransferReport'][_0x3b67('0x136')](db['User'],{'foreignKey':'FromUserId','as':_0x3b67('0x1b9')});db[_0x3b67('0xf7')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'foreignKey':_0x3b67('0x1ba'),'as':_0x3b67('0x1bb')});db[_0x3b67('0xf7')][_0x3b67('0x136')](db[_0x3b67('0x51')],{'foreignKey':_0x3b67('0x1c3'),'as':'ToQueue'});db[_0x3b67('0xf7')]['belongsTo'](db[_0x3b67('0x127')],{'foreignKey':'ToFaxAccountId','as':_0x3b67('0x1bd')});db['OpenchannelTransferReport'][_0x3b67('0x136')](db[_0x3b67('0x60')],{});db[_0x3b67('0x1c4')][_0x3b67('0x136')](db[_0x3b67('0x5f')],{});db[_0x3b67('0x1c4')][_0x3b67('0x136')](db[_0x3b67('0x5c')],{'foreignKey':'FromOpenchannelAccountId','as':_0x3b67('0x1bf')});db['OpenchannelTransferReport'][_0x3b67('0x136')](db['User'],{'foreignKey':_0x3b67('0x1b8'),'as':'FromAgent'});db[_0x3b67('0x1c4')][_0x3b67('0x136')](db[_0x3b67('0x104')],{'foreignKey':_0x3b67('0x1ba'),'as':_0x3b67('0x1bb')});db[_0x3b67('0x1c4')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x3b67('0x1c5'),'as':_0x3b67('0x1bc')});db[_0x3b67('0x1c4')][_0x3b67('0x136')](db[_0x3b67('0x5c')],{'foreignKey':_0x3b67('0x1c6'),'as':_0x3b67('0x1bd')});db[_0x3b67('0xf9')][_0x3b67('0x136')](db[_0x3b67('0x167')],{});db[_0x3b67('0xf9')][_0x3b67('0x136')](db[_0x3b67('0x10e')],{});db[_0x3b67('0xf9')][_0x3b67('0x136')](db['SmsAccount'],{'foreignKey':_0x3b67('0x1c7'),'as':_0x3b67('0x1bf')});db['SmsTransferReport']['belongsTo'](db[_0x3b67('0x104')],{'foreignKey':_0x3b67('0x1b8'),'as':_0x3b67('0x1b9')});db[_0x3b67('0xf9')]['belongsTo'](db['User'],{'foreignKey':_0x3b67('0x1ba'),'as':_0x3b67('0x1bb')});db[_0x3b67('0xf9')]['belongsTo'](db[_0x3b67('0x5a')],{'foreignKey':_0x3b67('0x1c8'),'as':_0x3b67('0x1bc')});db[_0x3b67('0xf9')][_0x3b67('0x136')](db[_0x3b67('0x12a')],{'foreignKey':_0x3b67('0x1c9'),'as':'ToAccount'});db[_0x3b67('0xfb')][_0x3b67('0x106')](db['Disposition'],{'as':_0x3b67('0x14a'),'foreignKey':'ListId'});db['CmList'][_0x3b67('0x106')](db[_0x3b67('0x7d')],{'as':_0x3b67('0x1ca'),'foreignKey':_0x3b67('0x15c')});db['CmList'][_0x3b67('0x106')](db[_0x3b67('0x115')],{'as':'Contacts','onDelete':_0x3b67('0x10b'),'foreignKey':_0x3b67('0x15c')});db[_0x3b67('0xfb')]['hasMany'](db[_0x3b67('0x77')],{'as':_0x3b67('0x10c'),'foreignKey':_0x3b67('0x15c')});db[_0x3b67('0xfb')][_0x3b67('0x106')](db[_0x3b67('0x79')],{'as':_0x3b67('0x1cb'),'foreignKey':_0x3b67('0x15c')});db[_0x3b67('0xfb')][_0x3b67('0x106')](db[_0x3b67('0x7b')],{'as':'ReportAgentPreview','foreignKey':_0x3b67('0x15c')});db['CmList'][_0x3b67('0x113')](db['VoiceQueue'],{'as':_0x3b67('0x1cc'),'through':'voice_queues_has_cm_lists'});db[_0x3b67('0xfb')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':'Agents','through':_0x3b67('0x117')});db['VoicePrefix']['hasMany'](db[_0x3b67('0x17')],{'as':_0x3b67('0x10a'),'onDelete':_0x3b67('0x159')});db[_0x3b67('0xfd')][_0x3b67('0x113')](db[_0x3b67('0x104')],{'as':_0x3b67('0x13c'),'through':_0x3b67('0x123')});db['UserProfile'][_0x3b67('0x106')](db[_0x3b67('0x104')],{'as':_0x3b67('0x157'),'foreignKey':'userProfileId'});db[_0x3b67('0xff')][_0x3b67('0x106')](db[_0x3b67('0x100')],{'as':_0x3b67('0x1cd'),'foreignKey':_0x3b67('0x112'),'onDelete':_0x3b67('0x10b')});db[_0x3b67('0x100')][_0x3b67('0x106')](db['UserProfileResource'],{'as':_0x3b67('0x1ce'),'foreignKey':_0x3b67('0x1cf'),'onDelete':_0x3b67('0x10b')});module[_0x3b67('0x1d0')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8e47afc..abac7d7 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3776=['/api/mail/interactions','/api/mail/messages','/api/mail/applications','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/triggers','/api/variables','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','snippet','1.0.15','/plugins','/server/files/plugins','route','get','resolve','appPath','/index.html','path','express','util','./errors','./config/environment','./config/logger','api','auth','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','headers','connection','remoteAddress','url','statusCode','user','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','x-forwarded-for','responseTime','name','role','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus'];(function(_0x312874,_0x20dce3){var _0x4aa982=function(_0xca4d4d){while(--_0xca4d4d){_0x312874['push'](_0x312874['shift']());}};_0x4aa982(++_0x20dce3);}(_0x3776,0x1ee));var _0x6377=function(_0x16270b,_0x4ff120){_0x16270b=_0x16270b-0x0;var _0x2cd122=_0x3776[_0x16270b];return _0x2cd122;};'use strict';var path=require(_0x6377('0x0'));var express=require(_0x6377('0x1'));var ewinston=require('express-winston');var util=require(_0x6377('0x2'));var errors=require(_0x6377('0x3'));var config=require(_0x6377('0x4'));var logger=require(_0x6377('0x5'))(_0x6377('0x6'));var authLogger=require(_0x6377('0x5'))(_0x6377('0x7'));exports['default']=function(_0x2eec52){_0x2eec52[_0x6377('0x8')](ewinston[_0x6377('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x7afb73,_0x46b703){return util[_0x6377('0xa')](_0x6377('0xb'),_0x7afb73['method'],_0x7afb73[_0x6377('0xc')]['x-forwarded-for']?_0x7afb73[_0x6377('0xc')]['x-forwarded-for']:_0x7afb73[_0x6377('0xd')][_0x6377('0xe')]||_0x7afb73['ip'],_0x7afb73[_0x6377('0xf')],_0x46b703[_0x6377('0x10')],_0x46b703['responseTime'],_0x7afb73['user']?_0x7afb73[_0x6377('0x11')]['id']:null,_0x7afb73[_0x6377('0x11')]?_0x7afb73['user']['name']:null,_0x7afb73[_0x6377('0x11')]?_0x7afb73[_0x6377('0x11')]['role']:null);}}));_0x2eec52[_0x6377('0x8')](ewinston[_0x6377('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3ca647,_0x6beb94){var _0x5a02ab=_0x6377('0x12');if(_0x3ca647[_0x6377('0x13')]&&_0x3ca647[_0x6377('0x13')][_0x6377('0x14')]&&_0x3ca647[_0x6377('0x13')][_0x6377('0x15')]){_0x5a02ab=_0x6377('0x16');}return util[_0x6377('0xa')](_0x5a02ab,_0x3ca647[_0x6377('0x17')],_0x3ca647[_0x6377('0xc')][_0x6377('0x18')]?_0x3ca647[_0x6377('0xc')][_0x6377('0x18')]:_0x3ca647['connection']['remoteAddress']||_0x3ca647['ip'],_0x3ca647[_0x6377('0xf')],_0x6beb94[_0x6377('0x10')],_0x6beb94[_0x6377('0x19')],_0x3ca647[_0x6377('0x11')]?_0x3ca647[_0x6377('0x11')]['id']:null,_0x3ca647[_0x6377('0x11')]?_0x3ca647['user'][_0x6377('0x1a')]:null,_0x3ca647[_0x6377('0x11')]?_0x3ca647[_0x6377('0x11')][_0x6377('0x1b')]:null,_0x3ca647[_0x6377('0x13')]&&_0x3ca647[_0x6377('0x13')][_0x6377('0x14')]?_0x3ca647['body'][_0x6377('0x14')]:_0x6377('0x1c'),_0x3ca647[_0x6377('0x13')]&&_0x3ca647[_0x6377('0x13')]['agent_id']?_0x3ca647['body'][_0x6377('0x15')]:'',_0x3ca647[_0x6377('0x13')]&&_0x3ca647[_0x6377('0x13')][_0x6377('0x1d')]?_0x3ca647['body'][_0x6377('0x1d')]:'');},'ignoreRoute':function(_0x564820){var _0x158e02=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x158e02[_0x6377('0x1e')](_0x564820[_0x6377('0xf')]);}}));_0x2eec52['use'](_0x6377('0x1f'),require(_0x6377('0x20')));_0x2eec52[_0x6377('0x8')](_0x6377('0x21'),require(_0x6377('0x22')));_0x2eec52['use'](_0x6377('0x23'),require(_0x6377('0x24')));_0x2eec52[_0x6377('0x8')](_0x6377('0x25'),require(_0x6377('0x26')));_0x2eec52['use'](_0x6377('0x27'),require(_0x6377('0x28')));_0x2eec52[_0x6377('0x8')]('/api/voice/queues',require(_0x6377('0x29')));_0x2eec52[_0x6377('0x8')](_0x6377('0x2a'),require(_0x6377('0x2b')));_0x2eec52['use'](_0x6377('0x2c'),require(_0x6377('0x2d')));_0x2eec52[_0x6377('0x8')](_0x6377('0x2e'),require('./api/voiceMail'));_0x2eec52[_0x6377('0x8')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x2eec52[_0x6377('0x8')](_0x6377('0x2f'),require(_0x6377('0x30')));_0x2eec52[_0x6377('0x8')]('/api/voice/dials/reports',require(_0x6377('0x31')));_0x2eec52[_0x6377('0x8')]('/api/voice/agents/reports',require(_0x6377('0x32')));_0x2eec52[_0x6377('0x8')](_0x6377('0x33'),require('./api/voiceQueueReport'));_0x2eec52[_0x6377('0x8')](_0x6377('0x34'),require(_0x6377('0x35')));_0x2eec52[_0x6377('0x8')](_0x6377('0x36'),require(_0x6377('0x37')));_0x2eec52['use'](_0x6377('0x38'),require(_0x6377('0x39')));_0x2eec52[_0x6377('0x8')](_0x6377('0x3a'),require(_0x6377('0x3b')));_0x2eec52[_0x6377('0x8')](_0x6377('0x3c'),require('./api/mailAccount'));_0x2eec52[_0x6377('0x8')](_0x6377('0x3d'),require('./api/mailQueue'));_0x2eec52[_0x6377('0x8')](_0x6377('0x3e'),require(_0x6377('0x3f')));_0x2eec52[_0x6377('0x8')](_0x6377('0x40'),require('./api/mailInteraction'));_0x2eec52[_0x6377('0x8')](_0x6377('0x41'),require('./api/mailMessage'));_0x2eec52[_0x6377('0x8')](_0x6377('0x42'),require('./api/mailApplication'));_0x2eec52[_0x6377('0x8')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x2eec52[_0x6377('0x8')](_0x6377('0x43'),require(_0x6377('0x44')));_0x2eec52[_0x6377('0x8')](_0x6377('0x45'),require(_0x6377('0x46')));_0x2eec52[_0x6377('0x8')](_0x6377('0x47'),require(_0x6377('0x48')));_0x2eec52[_0x6377('0x8')](_0x6377('0x49'),require('./api/faxApplication'));_0x2eec52['use']('/api/fax/interactions',require(_0x6377('0x4a')));_0x2eec52['use']('/api/fax/messages',require('./api/faxMessage'));_0x2eec52['use'](_0x6377('0x4b'),require(_0x6377('0x4c')));_0x2eec52['use'](_0x6377('0x4d'),require('./api/faxQueueReport'));_0x2eec52[_0x6377('0x8')](_0x6377('0x4e'),require(_0x6377('0x4f')));_0x2eec52[_0x6377('0x8')](_0x6377('0x50'),require(_0x6377('0x51')));_0x2eec52[_0x6377('0x8')]('/api/sms/interactions',require(_0x6377('0x52')));_0x2eec52[_0x6377('0x8')](_0x6377('0x53'),require('./api/smsMessage'));_0x2eec52['use'](_0x6377('0x54'),require(_0x6377('0x55')));_0x2eec52['use'](_0x6377('0x56'),require(_0x6377('0x57')));_0x2eec52[_0x6377('0x8')](_0x6377('0x58'),require(_0x6377('0x59')));_0x2eec52[_0x6377('0x8')](_0x6377('0x5a'),require(_0x6377('0x5b')));_0x2eec52[_0x6377('0x8')](_0x6377('0x5c'),require(_0x6377('0x5d')));_0x2eec52[_0x6377('0x8')](_0x6377('0x5e'),require(_0x6377('0x5f')));_0x2eec52['use']('/api/chat/websites',require(_0x6377('0x60')));_0x2eec52[_0x6377('0x8')](_0x6377('0x61'),require(_0x6377('0x62')));_0x2eec52[_0x6377('0x8')]('/api/chat/applications',require('./api/chatApplication'));_0x2eec52[_0x6377('0x8')](_0x6377('0x63'),require(_0x6377('0x64')));_0x2eec52[_0x6377('0x8')](_0x6377('0x65'),require(_0x6377('0x66')));_0x2eec52[_0x6377('0x8')](_0x6377('0x67'),require(_0x6377('0x68')));_0x2eec52['use']('/api/chat/queues',require(_0x6377('0x69')));_0x2eec52[_0x6377('0x8')](_0x6377('0x6a'),require(_0x6377('0x6b')));_0x2eec52[_0x6377('0x8')]('/api/chat/proactive_actions',require(_0x6377('0x6c')));_0x2eec52[_0x6377('0x8')](_0x6377('0x6d'),require(_0x6377('0x6e')));_0x2eec52['use'](_0x6377('0x6f'),require(_0x6377('0x70')));_0x2eec52[_0x6377('0x8')](_0x6377('0x71'),require('./api/cmHopper'));_0x2eec52['use'](_0x6377('0x72'),require(_0x6377('0x73')));_0x2eec52[_0x6377('0x8')](_0x6377('0x74'),require(_0x6377('0x75')));_0x2eec52[_0x6377('0x8')](_0x6377('0x76'),require(_0x6377('0x77')));_0x2eec52[_0x6377('0x8')](_0x6377('0x78'),require(_0x6377('0x79')));_0x2eec52[_0x6377('0x8')]('/api/actions',require(_0x6377('0x7a')));_0x2eec52['use'](_0x6377('0x7b'),require('./api/automation'));_0x2eec52['use'](_0x6377('0x7c'),require(_0x6377('0x7d')));_0x2eec52[_0x6377('0x8')](_0x6377('0x7e'),require(_0x6377('0x7f')));_0x2eec52['use'](_0x6377('0x80'),require(_0x6377('0x81')));_0x2eec52[_0x6377('0x8')](_0x6377('0x82'),require(_0x6377('0x83')));_0x2eec52[_0x6377('0x8')](_0x6377('0x84'),require(_0x6377('0x85')));_0x2eec52[_0x6377('0x8')](_0x6377('0x86'),require(_0x6377('0x87')));_0x2eec52[_0x6377('0x8')]('/api/voiceQueuesLog',require(_0x6377('0x88')));_0x2eec52[_0x6377('0x8')](_0x6377('0x89'),require(_0x6377('0x8a')));_0x2eec52[_0x6377('0x8')](_0x6377('0x8b'),require(_0x6377('0x8c')));_0x2eec52[_0x6377('0x8')](_0x6377('0x8d'),require(_0x6377('0x8e')));_0x2eec52[_0x6377('0x8')]('/api/templates',require('./api/template'));_0x2eec52[_0x6377('0x8')](_0x6377('0x8f'),require('./api/trigger'));_0x2eec52[_0x6377('0x8')](_0x6377('0x90'),require(_0x6377('0x91')));_0x2eec52[_0x6377('0x8')]('/api/integrations',require(_0x6377('0x92')));_0x2eec52[_0x6377('0x8')](_0x6377('0x93'),require('./api/integrationReport'));_0x2eec52[_0x6377('0x8')](_0x6377('0x94'),require(_0x6377('0x95')));_0x2eec52[_0x6377('0x8')](_0x6377('0x96'),require(_0x6377('0x97')));_0x2eec52['use'](_0x6377('0x98'),require(_0x6377('0x99')));_0x2eec52['use'](_0x6377('0x9a'),require(_0x6377('0x9b')));_0x2eec52[_0x6377('0x8')]('/api/analytics/field_reports',require(_0x6377('0x9c')));_0x2eec52[_0x6377('0x8')](_0x6377('0x9d'),require(_0x6377('0x9e')));_0x2eec52['use'](_0x6377('0x9f'),require('./api/intSalesforceAccount'));_0x2eec52[_0x6377('0x8')](_0x6377('0xa0'),require(_0x6377('0xa1')));_0x2eec52[_0x6377('0x8')]('/api/integrations/salesforce/fields',require(_0x6377('0xa2')));_0x2eec52['use'](_0x6377('0xa3'),require(_0x6377('0xa4')));_0x2eec52[_0x6377('0x8')](_0x6377('0xa5'),require('./api/intSugarcrmConfiguration'));_0x2eec52[_0x6377('0x8')](_0x6377('0xa6'),require(_0x6377('0xa7')));_0x2eec52['use'](_0x6377('0xa8'),require(_0x6377('0xa9')));_0x2eec52[_0x6377('0x8')]('/api/integrations/desk/configurations',require(_0x6377('0xaa')));_0x2eec52[_0x6377('0x8')](_0x6377('0xab'),require(_0x6377('0xac')));_0x2eec52['use']('/api/integrations/zoho/accounts',require(_0x6377('0xad')));_0x2eec52[_0x6377('0x8')](_0x6377('0xae'),require(_0x6377('0xaf')));_0x2eec52[_0x6377('0x8')](_0x6377('0xb0'),require('./api/intZohoField'));_0x2eec52['use'](_0x6377('0xb1'),require('./api/intZendeskAccount'));_0x2eec52[_0x6377('0x8')](_0x6377('0xb2'),require(_0x6377('0xb3')));_0x2eec52['use'](_0x6377('0xb4'),require(_0x6377('0xb5')));_0x2eec52['use'](_0x6377('0xb6'),require(_0x6377('0xb7')));_0x2eec52[_0x6377('0x8')]('/api/integrations/freshdesk/configurations',require(_0x6377('0xb8')));_0x2eec52[_0x6377('0x8')]('/api/integrations/freshdesk/fields',require(_0x6377('0xb9')));_0x2eec52[_0x6377('0x8')](_0x6377('0xba'),require(_0x6377('0xbb')));_0x2eec52[_0x6377('0x8')](_0x6377('0xbc'),require(_0x6377('0xbd')));_0x2eec52[_0x6377('0x8')](_0x6377('0xbe'),require(_0x6377('0xbf')));_0x2eec52['use']('/api/integrations/servicenow/accounts',require(_0x6377('0xc0')));_0x2eec52[_0x6377('0x8')](_0x6377('0xc1'),require('./api/intServicenowConfiguration'));_0x2eec52['use'](_0x6377('0xc2'),require(_0x6377('0xc3')));_0x2eec52[_0x6377('0x8')](_0x6377('0xc4'),require(_0x6377('0xc5')));_0x2eec52[_0x6377('0x8')](_0x6377('0xc6'),require(_0x6377('0xc7')));_0x2eec52[_0x6377('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x2eec52[_0x6377('0x8')](_0x6377('0xc8'),require('./api/intFreshsalesAccount'));_0x2eec52[_0x6377('0x8')](_0x6377('0xc9'),require(_0x6377('0xca')));_0x2eec52[_0x6377('0x8')](_0x6377('0xcb'),require(_0x6377('0xcc')));_0x2eec52[_0x6377('0x8')]('/api/networks',require(_0x6377('0xcd')));_0x2eec52['use'](_0x6377('0xce'),require(_0x6377('0xcf')));_0x2eec52['use'](_0x6377('0xd0'),require('./api/chatInternalMessage'));_0x2eec52[_0x6377('0x8')](_0x6377('0xd1'),require(_0x6377('0xd2')));_0x2eec52[_0x6377('0x8')](_0x6377('0xd3'),require('./api/jscriptyQuestionReport'));_0x2eec52['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x2eec52['use'](_0x6377('0xd4'),require(_0x6377('0xd5')));_0x2eec52['use'](_0x6377('0xd6'),require(_0x6377('0xd7')));_0x2eec52['use']('/api/square/details/reports',require(_0x6377('0xd8')));_0x2eec52[_0x6377('0x8')](_0x6377('0xd9'),require(_0x6377('0xda')));_0x2eec52['use'](_0x6377('0xdb'),require(_0x6377('0xdc')));_0x2eec52[_0x6377('0x8')](_0x6377('0xdd'),require(_0x6377('0xde')));_0x2eec52[_0x6377('0x8')](_0x6377('0xdf'),require(_0x6377('0xe0')));_0x2eec52[_0x6377('0x8')]('/api/square/recordings',require(_0x6377('0xe1')));_0x2eec52['use'](_0x6377('0xe2'),require('./api/squareMessage'));_0x2eec52[_0x6377('0x8')]('/api/teams',require('./api/team'));_0x2eec52[_0x6377('0x8')](_0x6377('0xe3'),require(_0x6377('0xe4')));_0x2eec52[_0x6377('0x8')](_0x6377('0xe5'),require(_0x6377('0xe6')));_0x2eec52[_0x6377('0x8')](_0x6377('0xe7'),require(_0x6377('0xe8')));_0x2eec52[_0x6377('0x8')]('/api/attachments',require(_0x6377('0xe9')));_0x2eec52[_0x6377('0x8')](_0x6377('0xea'),require(_0x6377('0xeb')));_0x2eec52[_0x6377('0x8')](_0x6377('0xec'),require('./api/mailTransferReport'));_0x2eec52[_0x6377('0x8')](_0x6377('0xed'),require(_0x6377('0xee')));_0x2eec52['use'](_0x6377('0xef'),require(_0x6377('0xf0')));_0x2eec52[_0x6377('0x8')](_0x6377('0xf1'),require(_0x6377('0xf2')));_0x2eec52[_0x6377('0x8')](_0x6377('0xf3'),require(_0x6377('0xf4')));_0x2eec52[_0x6377('0x8')]('/api/cm/lists',require(_0x6377('0xf5')));_0x2eec52[_0x6377('0x8')](_0x6377('0xf6'),require(_0x6377('0xf7')));_0x2eec52[_0x6377('0x8')](_0x6377('0xf8'),require(_0x6377('0xf9')));_0x2eec52[_0x6377('0x8')](_0x6377('0xfa'),require('./api/userProfileSection'));_0x2eec52[_0x6377('0x8')](_0x6377('0xfb'),require(_0x6377('0xfc')));_0x2eec52[_0x6377('0x8')](_0x6377('0xfd'),require(_0x6377('0xfe')));_0x2eec52['use']('/api/auth/google',require('./api/authGoogle'));_0x2eec52[_0x6377('0x8')](_0x6377('0xff'),require(_0x6377('0x100')));_0x2eec52[_0x6377('0x8')](_0x6377('0x101'),require('./api/rpc'));_0x2eec52[_0x6377('0x8')](_0x6377('0x102'),require(_0x6377('0x103')));_0x2eec52['use'](_0x6377('0x104'),require(_0x6377('0x105')));_0x2eec52['use'](_0x6377('0x106'),require(_0x6377('0x107')));_0x2eec52[_0x6377('0x8')](_0x6377('0x108'),express[_0x6377('0x109')](path[_0x6377('0x10a')](config[_0x6377('0x10b')],_0x6377('0x108'))));_0x2eec52[_0x6377('0x8')](_0x6377('0x10c'),express[_0x6377('0x109')](path[_0x6377('0x10a')](config[_0x6377('0x10b')],_0x6377('0x10c'))));_0x2eec52[_0x6377('0x8')](_0x6377('0x10d'),express[_0x6377('0x109')](path[_0x6377('0x10a')](config['root'],_0x6377('0x10d'))));_0x2eec52[_0x6377('0x8')]('/snippet',express[_0x6377('0x109')](path[_0x6377('0x10a')](config[_0x6377('0x10b')],_0x6377('0x10e'),_0x6377('0x10f'))));_0x2eec52['use'](_0x6377('0x110'),express[_0x6377('0x109')](path[_0x6377('0x10a')](config[_0x6377('0x10b')],_0x6377('0x111'))));_0x2eec52[_0x6377('0x112')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x6377('0x113')](errors[0x194]);_0x2eec52[_0x6377('0x112')]('/*')[_0x6377('0x113')](function(_0x366872,_0x55c78c){_0x55c78c['sendFile'](path[_0x6377('0x114')](_0x2eec52[_0x6377('0x113')](_0x6377('0x115'))+_0x6377('0x116')));});}; \ No newline at end of file +var _0xf729=['/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','root','static','join','/demo','/snippet','snippet','1.0.15','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','appPath','/index.html','express-winston','./config/environment','./config/logger','api','auth','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','agent_name','test','url','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport'];(function(_0x160248,_0x2a57e6){var _0x4e589d=function(_0x1ba722){while(--_0x1ba722){_0x160248['push'](_0x160248['shift']());}};_0x4e589d(++_0x2a57e6);}(_0xf729,0xe0));var _0x9f72=function(_0x1df775,_0x5eab46){_0x1df775=_0x1df775-0x0;var _0x361d06=_0xf729[_0x1df775];return _0x361d06;};'use strict';var path=require('path');var express=require('express');var ewinston=require(_0x9f72('0x0'));var util=require('util');var errors=require('./errors');var config=require(_0x9f72('0x1'));var logger=require(_0x9f72('0x2'))(_0x9f72('0x3'));var authLogger=require(_0x9f72('0x2'))(_0x9f72('0x4'));exports[_0x9f72('0x5')]=function(_0x28fcb1){_0x28fcb1[_0x9f72('0x6')](ewinston[_0x9f72('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2aa4ba,_0x3bf419){return util[_0x9f72('0x8')](_0x9f72('0x9'),_0x2aa4ba[_0x9f72('0xa')],_0x2aa4ba[_0x9f72('0xb')][_0x9f72('0xc')]?_0x2aa4ba[_0x9f72('0xb')][_0x9f72('0xc')]:_0x2aa4ba[_0x9f72('0xd')][_0x9f72('0xe')]||_0x2aa4ba['ip'],_0x2aa4ba['url'],_0x3bf419[_0x9f72('0xf')],_0x3bf419[_0x9f72('0x10')],_0x2aa4ba[_0x9f72('0x11')]?_0x2aa4ba[_0x9f72('0x11')]['id']:null,_0x2aa4ba[_0x9f72('0x11')]?_0x2aa4ba[_0x9f72('0x11')][_0x9f72('0x12')]:null,_0x2aa4ba[_0x9f72('0x11')]?_0x2aa4ba['user'][_0x9f72('0x13')]:null);}}));_0x28fcb1['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x543dc0,_0x5da278){var _0x5c36f6=_0x9f72('0x14');if(_0x543dc0[_0x9f72('0x15')]&&_0x543dc0[_0x9f72('0x15')][_0x9f72('0x16')]&&_0x543dc0[_0x9f72('0x15')][_0x9f72('0x17')]){_0x5c36f6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x9f72('0x8')](_0x5c36f6,_0x543dc0[_0x9f72('0xa')],_0x543dc0[_0x9f72('0xb')][_0x9f72('0xc')]?_0x543dc0[_0x9f72('0xb')][_0x9f72('0xc')]:_0x543dc0[_0x9f72('0xd')]['remoteAddress']||_0x543dc0['ip'],_0x543dc0['url'],_0x5da278[_0x9f72('0xf')],_0x5da278[_0x9f72('0x10')],_0x543dc0[_0x9f72('0x11')]?_0x543dc0[_0x9f72('0x11')]['id']:null,_0x543dc0[_0x9f72('0x11')]?_0x543dc0[_0x9f72('0x11')]['name']:null,_0x543dc0[_0x9f72('0x11')]?_0x543dc0['user'][_0x9f72('0x13')]:null,_0x543dc0[_0x9f72('0x15')]&&_0x543dc0[_0x9f72('0x15')][_0x9f72('0x16')]?_0x543dc0[_0x9f72('0x15')]['device']:'other',_0x543dc0[_0x9f72('0x15')]&&_0x543dc0['body'][_0x9f72('0x17')]?_0x543dc0[_0x9f72('0x15')][_0x9f72('0x17')]:'',_0x543dc0[_0x9f72('0x15')]&&_0x543dc0['body'][_0x9f72('0x18')]?_0x543dc0[_0x9f72('0x15')][_0x9f72('0x18')]:'');},'ignoreRoute':function(_0x28551f){var _0x2ca5cc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2ca5cc[_0x9f72('0x19')](_0x28551f[_0x9f72('0x1a')]);}}));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x1b'),require(_0x9f72('0x1c')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x1d'),require(_0x9f72('0x1e')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x1f'),require(_0x9f72('0x20')));_0x28fcb1[_0x9f72('0x6')]('/api/voice/extensions',require(_0x9f72('0x21')));_0x28fcb1[_0x9f72('0x6')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x22'),require(_0x9f72('0x23')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x24'),require(_0x9f72('0x25')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x26'),require(_0x9f72('0x27')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x28'),require(_0x9f72('0x29')));_0x28fcb1['use']('/api/voice/mails/messages',require(_0x9f72('0x2a')));_0x28fcb1[_0x9f72('0x6')]('/api/voice/calls/reports',require(_0x9f72('0x2b')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x2c'),require(_0x9f72('0x2d')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x2e'),require('./api/voiceAgentReport'));_0x28fcb1['use'](_0x9f72('0x2f'),require(_0x9f72('0x30')));_0x28fcb1[_0x9f72('0x6')]('/api/members/reports',require(_0x9f72('0x31')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x32'),require(_0x9f72('0x33')));_0x28fcb1['use'](_0x9f72('0x34'),require(_0x9f72('0x35')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x36'),require(_0x9f72('0x37')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x38'),require(_0x9f72('0x39')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x3a'),require(_0x9f72('0x3b')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x3c'),require('./api/mailSubstatus'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x3d'),require(_0x9f72('0x3e')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x3f'),require(_0x9f72('0x40')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x41'),require(_0x9f72('0x42')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x43'),require(_0x9f72('0x44')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x45'),require('./api/dashboard'));_0x28fcb1[_0x9f72('0x6')]('/api/dashboards/items',require('./api/dashboardItem'));_0x28fcb1['use'](_0x9f72('0x46'),require('./api/faxAccount'));_0x28fcb1[_0x9f72('0x6')]('/api/fax/applications',require('./api/faxApplication'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x47'),require(_0x9f72('0x48')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x49'),require(_0x9f72('0x4a')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x4b'),require(_0x9f72('0x4c')));_0x28fcb1['use'](_0x9f72('0x4d'),require(_0x9f72('0x4e')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x4f'),require('./api/smsAccount'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x50'),require(_0x9f72('0x51')));_0x28fcb1[_0x9f72('0x6')]('/api/sms/interactions',require(_0x9f72('0x52')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x53'),require(_0x9f72('0x54')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x55'),require(_0x9f72('0x56')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x57'),require(_0x9f72('0x58')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x59'),require(_0x9f72('0x5a')));_0x28fcb1['use'](_0x9f72('0x5b'),require(_0x9f72('0x5c')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x5d'),require(_0x9f72('0x5e')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x5f'),require(_0x9f72('0x60')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x61'),require(_0x9f72('0x62')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x63'),require('./api/openchannelQueueReport'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x64'),require('./api/chatApplication'));_0x28fcb1['use'](_0x9f72('0x65'),require(_0x9f72('0x66')));_0x28fcb1['use'](_0x9f72('0x67'),require(_0x9f72('0x68')));_0x28fcb1['use'](_0x9f72('0x69'),require(_0x9f72('0x6a')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x6b'),require(_0x9f72('0x6c')));_0x28fcb1['use'](_0x9f72('0x6d'),require(_0x9f72('0x6e')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x6f'),require(_0x9f72('0x70')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x71'),require('./api/cmCompany'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x72'),require(_0x9f72('0x73')));_0x28fcb1['use'](_0x9f72('0x74'),require(_0x9f72('0x75')));_0x28fcb1[_0x9f72('0x6')]('/api/cm/hopper_black',require(_0x9f72('0x76')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x77'),require('./api/cmHopperFinal'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x78'),require('./api/cmHopperHistory'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x79'),require(_0x9f72('0x7a')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x7b'),require('./api/action'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x7c'),require(_0x9f72('0x7d')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x7e'),require(_0x9f72('0x7f')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x80'),require(_0x9f72('0x81')));_0x28fcb1[_0x9f72('0x6')]('/api/conditions',require(_0x9f72('0x82')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x83'),require('./api/interval'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x84'),require(_0x9f72('0x85')));_0x28fcb1[_0x9f72('0x6')]('/api/cdr',require(_0x9f72('0x86')));_0x28fcb1['use'](_0x9f72('0x87'),require(_0x9f72('0x88')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x89'),require(_0x9f72('0x8a')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x8b'),require('./api/sound'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x8c'),require('./api/tag'));_0x28fcb1['use'](_0x9f72('0x8d'),require(_0x9f72('0x8e')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x8f'),require(_0x9f72('0x90')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x91'),require('./api/variable'));_0x28fcb1[_0x9f72('0x6')]('/api/integrations',require(_0x9f72('0x92')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x93'),require(_0x9f72('0x94')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x95'),require(_0x9f72('0x96')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x97'),require(_0x9f72('0x98')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x99'),require(_0x9f72('0x9a')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x9b'),require(_0x9f72('0x9c')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x9d'),require(_0x9f72('0x9e')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x9f'),require(_0x9f72('0xa0')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xa1'),require(_0x9f72('0xa2')));_0x28fcb1[_0x9f72('0x6')]('/api/integrations/salesforce/configurations',require(_0x9f72('0xa3')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xa4'),require(_0x9f72('0xa5')));_0x28fcb1['use'](_0x9f72('0xa6'),require(_0x9f72('0xa7')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xa8'),require('./api/intSugarcrmConfiguration'));_0x28fcb1['use']('/api/integrations/sugarcrm/fields',require(_0x9f72('0xa9')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xaa'),require('./api/intDeskAccount'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xab'),require('./api/intDeskConfiguration'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xac'),require(_0x9f72('0xad')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xae'),require('./api/intZohoAccount'));_0x28fcb1['use'](_0x9f72('0xaf'),require('./api/intZohoConfiguration'));_0x28fcb1['use'](_0x9f72('0xb0'),require('./api/intZohoField'));_0x28fcb1[_0x9f72('0x6')]('/api/integrations/zendesk/accounts',require(_0x9f72('0xb1')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xb2'),require(_0x9f72('0xb3')));_0x28fcb1[_0x9f72('0x6')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x28fcb1['use'](_0x9f72('0xb4'),require(_0x9f72('0xb5')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xb6'),require(_0x9f72('0xb7')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xb8'),require(_0x9f72('0xb9')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xba'),require(_0x9f72('0xbb')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xbc'),require(_0x9f72('0xbd')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xbe'),require('./api/intVtigerField'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xbf'),require('./api/intServicenowAccount'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xc0'),require(_0x9f72('0xc1')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xc2'),require(_0x9f72('0xc3')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xc4'),require(_0x9f72('0xc5')));_0x28fcb1['use'](_0x9f72('0xc6'),require('./api/intDynamics365Configuration'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xc7'),require('./api/intDynamics365Field'));_0x28fcb1['use'](_0x9f72('0xc8'),require(_0x9f72('0xc9')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xca'),require(_0x9f72('0xcb')));_0x28fcb1[_0x9f72('0x6')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xcc'),require(_0x9f72('0xcd')));_0x28fcb1['use']('/api/chat/reports/queue',require(_0x9f72('0xce')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xcf'),require('./api/chatInternalMessage'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xd0'),require('./api/jscriptyAnswerReport'));_0x28fcb1['use'](_0x9f72('0xd1'),require(_0x9f72('0xd2')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xd3'),require(_0x9f72('0xd4')));_0x28fcb1['use']('/api/sms/reports/queue',require(_0x9f72('0xd5')));_0x28fcb1[_0x9f72('0x6')]('/api/square/reports',require(_0x9f72('0xd6')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xd7'),require('./api/squareReportDetail'));_0x28fcb1[_0x9f72('0x6')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xd8'),require(_0x9f72('0xd9')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xda'),require(_0x9f72('0xdb')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xdc'),require(_0x9f72('0xdd')));_0x28fcb1[_0x9f72('0x6')]('/api/square/recordings',require(_0x9f72('0xde')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xdf'),require(_0x9f72('0xe0')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xe1'),require(_0x9f72('0xe2')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xe3'),require('./api/license'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xe4'),require(_0x9f72('0xe5')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xe6'),require('./api/migration'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xe7'),require('./api/attachment'));_0x28fcb1['use'](_0x9f72('0xe8'),require(_0x9f72('0xe9')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xea'),require('./api/mailTransferReport'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xeb'),require(_0x9f72('0xec')));_0x28fcb1['use'](_0x9f72('0xed'),require('./api/faxTransferReport'));_0x28fcb1['use']('/api/openchannel/reports/transfer',require(_0x9f72('0xee')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xef'),require(_0x9f72('0xf0')));_0x28fcb1['use'](_0x9f72('0xf1'),require('./api/cmList'));_0x28fcb1[_0x9f72('0x6')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xf2'),require(_0x9f72('0xf3')));_0x28fcb1[_0x9f72('0x6')]('/api/userProfile/sections',require(_0x9f72('0xf4')));_0x28fcb1['use'](_0x9f72('0xf5'),require(_0x9f72('0xf6')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xf7'),require(_0x9f72('0xf8')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xf9'),require(_0x9f72('0xfa')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xfb'),require(_0x9f72('0xfc')));_0x28fcb1['use']('/api/rpc',require('./api/rpc'));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xfd'),require(_0x9f72('0xfe')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0xff'),require(_0x9f72('0x100')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x101'),require(_0x9f72('0x102')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x103'),express['static'](path['join'](config[_0x9f72('0x104')],_0x9f72('0x103'))));_0x28fcb1[_0x9f72('0x6')]('/www',express[_0x9f72('0x105')](path[_0x9f72('0x106')](config[_0x9f72('0x104')],'/www')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x107'),express[_0x9f72('0x105')](path['join'](config[_0x9f72('0x104')],'/demo')));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x108'),express[_0x9f72('0x105')](path['join'](config[_0x9f72('0x104')],_0x9f72('0x109'),_0x9f72('0x10a'))));_0x28fcb1[_0x9f72('0x6')](_0x9f72('0x10b'),express[_0x9f72('0x105')](path[_0x9f72('0x106')](config[_0x9f72('0x104')],_0x9f72('0x10c'))));_0x28fcb1[_0x9f72('0x10d')](_0x9f72('0x10e'))['get'](errors[0x194]);_0x28fcb1['route']('/*')[_0x9f72('0x10f')](function(_0x1f1613,_0x296333){_0x296333['sendFile'](path['resolve'](_0x28fcb1[_0x9f72('0x10f')](_0x9f72('0x110'))+_0x9f72('0x111')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 5b7d18c..c3b7cb1 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x949b=['../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/attachment/attachment.rpc','server','http','rpc','port','localhost','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','bluebird','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc'];(function(_0x170941,_0x38d105){var _0x50e48d=function(_0x1eb49a){while(--_0x1eb49a){_0x170941['push'](_0x170941['shift']());}};_0x50e48d(++_0x38d105);}(_0x949b,0x17b));var _0xb949=function(_0x280590,_0x477388){_0x280590=_0x280590-0x0;var _0x2e6fda=_0x949b[_0x280590];return _0x2e6fda;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb949('0x0'));var _=require('lodash');var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x2580c7,_0x5dc2c2){var _0x31374f={};_0x31374f=_['merge'](_0x31374f,require('../api/user/user.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x2')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x3')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x4')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x5')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x6')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x7')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x8')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x9')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0xa')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0xb')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/mailServerIn/mailServerIn.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0xc')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0xd')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0xe')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0xf')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x10')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x11')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x12')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x13')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x14')));_0x31374f=_['merge'](_0x31374f,require('../api/faxMessage/faxMessage.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x15')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x16')));_0x31374f=_['merge'](_0x31374f,require('../api/smsInteraction/smsInteraction.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x17')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x18')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x19')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x1a')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x1b')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x1c')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x1d')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/chatInteraction/chatInteraction.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x1e')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x1f')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x20')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x21')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x22')));_0x31374f=_['merge'](_0x31374f,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x23')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x24')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x25')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x26')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x27')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x28')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x29')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/variable/variable.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x2a')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x2b')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x2c')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x2d')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x2e')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x2f')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x30')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x31')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x32')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x33')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/squareReport/squareReport.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x34')));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x35')));_0x31374f=_[_0xb949('0x1')](_0x31374f,require(_0xb949('0x36')));_0x31374f=_['merge'](_0x31374f,require('../api/squareRecording/squareRecording.rpc'));_0x31374f=_[_0xb949('0x1')](_0x31374f,require('../api/squareMessage/squareMessage.rpc'));_0x31374f=_['merge'](_0x31374f,require('../api/campaign/campaign.rpc'));_0x31374f=_['merge'](_0x31374f,require(_0xb949('0x37')));_0x31374f=_['merge'](_0x31374f,require('../api/plugin/plugin.rpc'));var _0x4b2c23=jayson[_0xb949('0x38')](_0x31374f)[_0xb949('0x39')]();var _0x49e319=config[_0xb949('0x3a')][_0xb949('0x3b')]||config['port']+0x1;var _0x261291=config['rpc']['ip']||_0xb949('0x3c');_0x4b2c23['on']('error',function(_0xa006c9){return _0x5dc2c2(_0xa006c9);});_0x4b2c23[_0xb949('0x3d')](_0x49e319,_0x261291,function(){console[_0xb949('0x3e')](_0xb949('0x3f'),_0x261291,_0x49e319);require(_0xb949('0x40'))['default']();return _0x2580c7(_0xb949('0x41')+_0x261291+':'+_0x49e319);});});}; \ No newline at end of file +var _0x3b92=['../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc'];(function(_0x19096e,_0x308b73){var _0x4a7de0=function(_0x547817){while(--_0x547817){_0x19096e['push'](_0x19096e['shift']());}};_0x4a7de0(++_0x308b73);}(_0x3b92,0x166));var _0x23b9=function(_0x3ee361,_0x244c67){_0x3ee361=_0x3ee361-0x0;var _0x32a3d0=_0x3b92[_0x3ee361];return _0x32a3d0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x23b9('0x0'));var _=require(_0x23b9('0x1'));var config=require(_0x23b9('0x2'));exports[_0x23b9('0x3')]=function(){return new BPromise(function(_0x2392dd,_0x117bb0){var _0x2b3f84={};_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x4')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x6')));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x7')));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x8')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x9')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0xa')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0xb')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0xc')));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0xd')));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0xe')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0xf')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x10')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x11')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x12')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/mailMessage/mailMessage.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x13')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x14')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/faxApplication/faxApplication.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x15')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x16')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x17')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x18')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x19')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x1a')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x1b')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x1c')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x1d')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x1e')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x1f')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x20')));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x21')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x22')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/cmContact/cmContact.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x23')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x24')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x25')));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x26')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/pause/pause.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x27')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x28')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x29')));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x2a')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x2b')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x2c')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x2d')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x2e')));_0x2b3f84=_['merge'](_0x2b3f84,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x2f')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x30')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x31')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x32')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x33')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/squareReport/squareReport.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x34')));_0x2b3f84=_['merge'](_0x2b3f84,require(_0x23b9('0x35')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require('../api/squareProject/squareProject.rpc'));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x36')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x37')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x38')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x39')));_0x2b3f84=_[_0x23b9('0x5')](_0x2b3f84,require(_0x23b9('0x3a')));var _0x55bfa9=jayson['server'](_0x2b3f84)['http']();var _0x53d294=config[_0x23b9('0x3b')][_0x23b9('0x3c')]||config[_0x23b9('0x3c')]+0x1;var _0x40352a=config[_0x23b9('0x3b')]['ip']||_0x23b9('0x3d');_0x55bfa9['on'](_0x23b9('0x3e'),function(_0xd1c7e7){return _0x117bb0(_0xd1c7e7);});_0x55bfa9[_0x23b9('0x3')](_0x53d294,_0x40352a,function(){console[_0x23b9('0x3f')](_0x23b9('0x40'),_0x40352a,_0x53d294);require(_0x23b9('0x41'))[_0x23b9('0x42')]();return _0x2392dd(_0x23b9('0x43')+_0x40352a+':'+_0x53d294);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index f9634ff..c2fc426 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42a0=['setPriority','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','lodash','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','result=','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','setExtension'];(function(_0x2608cf,_0x4c87b0){var _0x3b6247=function(_0x21473b){while(--_0x21473b){_0x2608cf['push'](_0x2608cf['shift']());}};_0x3b6247(++_0x4c87b0);}(_0x42a0,0x1e8));var _0x042a=function(_0x50fa83,_0x2b6eff){_0x50fa83=_0x50fa83-0x0;var _0x3d9f22=_0x42a0[_0x50fa83];return _0x3d9f22;};'use strict';var util=require('util');var _=require(_0x042a('0x0'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x042a('0x1'));var AGIError=require(_0x042a('0x2'));function AGIChannel(_0x12819e){var _0x41699b=this,_0x1a1e0b=new AGIReply(),_0x3653de=![],_0xc7b342={};EventEmitter[_0x042a('0x3')](_0x41699b);_0x12819e[_0x042a('0x4')](_0x042a('0x5'));_0x12819e[_0x042a('0x6')](0x8*0x3c*0x3c*0x3e8);_0x1a1e0b[_0x042a('0x4')]('utf8');_0x1a1e0b['on']('headers',function(_0x1e1374){for(var _0x146348 in _0x1e1374){_0x41699b[_0x146348]=_0x1e1374[_0x146348];}_0x41699b[_0x042a('0x7')](_0x042a('0x8'));});_0x1a1e0b['on'](_0x042a('0x9'),function(_0x3bee1e){if(_0x3bee1e[_0x042a('0xa')]()=='hangup'){_0x41699b[_0x042a('0x7')](_0x042a('0xb'));return;}if(_0x3bee1e[_0x042a('0xc')](0x0,0xb)==_0x042a('0xd')){_0x3653de=!![];}if(_0x3653de){_0xc7b342['rx']+=_0x3bee1e+'\x0a';if(_0x3bee1e['search'](_0x042a('0xe'))!=-0x1){_0x3653de=![];}}else{_0xc7b342['rx']=_0x3bee1e;}if(_0x3653de){return;}if(typeof _0xc7b342['cb']==_0x042a('0xf')){var _0x3b7ba6=_0xc7b342['rx'][_0x042a('0xc')](0x0,0x3),_0x46ac2b=null,_0x79c20a=null;_0x3b7ba6=parseInt(_0x3b7ba6);if(isNaN(_0x3b7ba6)){_0xc7b342['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x3b7ba6!=0xc8){_0xc7b342['cb'](null,{'code':_0x3b7ba6,'result':-0x1,'extra':'KO'});return;}_0x46ac2b=_0xc7b342['rx'][_0x042a('0xc')](0x4)['replace'](_0x042a('0x10'),'');if(_0x46ac2b[_0x042a('0x11')]('\x20')!=-0x1){_0x46ac2b=_0x46ac2b['substr'](0x0,_0x46ac2b[_0x042a('0x11')]('\x20'));}if(_['startsWith'](_0x46ac2b,'-1')){_0x46ac2b=parseInt(_0x46ac2b);}_0x79c20a=_0xc7b342['rx'][_0x042a('0x12')]('\x20');if(_0x79c20a['length']==0x3){_0x79c20a=_0x79c20a[0x2]['substring'](0x1,_0x79c20a[0x2][_0x042a('0x13')]-0x1);}else if(_0x79c20a['length']>0x3){var _0x5bc5c1=/\((.+)\)/;var _0x159896=_0xc7b342['rx'][_0x042a('0x14')](_0x5bc5c1);if(_0x159896){_0x79c20a=_0x159896[0x1];}else{_0x79c20a=null;}}else{_0x79c20a=null;}_0xc7b342['cb'](null,{'code':_0x3b7ba6,'result':_0x46ac2b,'extra':_0x79c20a});}});_0x12819e['on'](_0x042a('0x15'),function(_0x105922){_0x41699b['emit'](_0x042a('0x15'),new AGIError(_0x042a('0x16'),_0x105922[_0x042a('0x17')]));});_0x12819e['on'](_0x042a('0x18'),function(){_0x41699b['emit'](_0x042a('0x18'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x12819e['on'](_0x042a('0x19'),function(){_0x41699b[_0x042a('0x7')](_0x042a('0x19'),new AGIError(_0x042a('0x1a')));_0x12819e[_0x042a('0x1b')]();});_0x12819e[_0x042a('0x1c')](_0x1a1e0b);this[_0x042a('0x1d')]=function(_0x39509d,_0x1f2e30){var _0x39509d=_0x39509d||'',_0x1f2e30=typeof _0x1f2e30==_0x042a('0xf')?_0x1f2e30:new Function();_0xc7b342={'tx':_0x39509d,'rx':'','cb':_0x1f2e30};_0x12819e[_0x042a('0x1e')](_0x39509d+'\x0a');},this[_0x042a('0x18')]=function(){_0x12819e[_0x042a('0x1b')]();};}util[_0x042a('0x1f')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x042a('0x20')]=function(_0x11f02b){return this[_0x042a('0x1d')][_0x042a('0x21')](this,_0x11f02b);};AGIChannel[_0x042a('0x22')]['answer']=function(){return this[_0x042a('0x20')](_0x042a('0x23'));};AGIChannel['prototype'][_0x042a('0x24')]=function(_0x463c9e,_0x78cdae,_0x4c30f6){_0x463c9e=_0x463c9e===undefined?'beep':_0x463c9e;_0x78cdae=_0x78cdae===undefined?'5':_0x78cdae;_0x4c30f6=_0x4c30f6===undefined?'1':_0x4c30f6;return this[_0x042a('0x20')](util[_0x042a('0x25')](_0x042a('0x26'),_0x463c9e,_0x78cdae*0x3e8,_0x4c30f6));};AGIChannel['prototype'][_0x042a('0x27')]=function(_0xfbcfc8){_0xfbcfc8=_0xfbcfc8||_0x042a('0x28');return this['sendRequest'](util[_0x042a('0x25')](_0x042a('0x29'),_0xfbcfc8));};AGIChannel[_0x042a('0x22')]['exec']=function(_0x1bcc44,_0x3ffd9e){if(_['isArray'](_0x3ffd9e)){return this[_0x042a('0x20')](util['format'](_0x042a('0x2a'),_0x1bcc44,_0x3ffd9e[_0x042a('0x2b')](',')));}return this[_0x042a('0x20')](util['format']('EXEC\x20%s\x20%s',_0x1bcc44,_0x3ffd9e));};AGIChannel[_0x042a('0x22')][_0x042a('0x2c')]=function(_0x1e4cf1){return this[_0x042a('0x20')](util[_0x042a('0x25')](_0x042a('0x2d'),_0x1e4cf1));};AGIChannel[_0x042a('0x22')]['setExtension']=function(_0x10d309){return this[_0x042a('0x20')](util['format'](_0x042a('0x2e'),_0x10d309));};AGIChannel[_0x042a('0x22')]['setPriority']=function(_0xe3043){return this['sendRequest'](util['format'](_0x042a('0x2f'),_0xe3043));};AGIChannel[_0x042a('0x22')]['hangup']=function(){return this[_0x042a('0x20')]('HANGUP');};AGIChannel['prototype']['setVariable']=function(_0x213d10,_0x3dec60){return this[_0x042a('0x20')](util[_0x042a('0x25')](_0x042a('0x30'),_0x213d10,_0x3dec60?_0x3dec60[_0x042a('0x31')]()[_0x042a('0x32')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x042a('0x22')][_0x042a('0x33')]=function(_0x30cca3,_0xcbd23){return this[_0x042a('0x20')](util[_0x042a('0x25')]('SAY\x20NUMBER\x20%s\x20%s',_0x30cca3,_0xcbd23));};AGIChannel[_0x042a('0x22')][_0x042a('0x34')]=function(_0xdf0696,_0x48efc5){return this[_0x042a('0x20')](util[_0x042a('0x25')]('SAY\x20DIGITS\x20%s\x20%s',_0xdf0696,_0x48efc5));};AGIChannel[_0x042a('0x22')][_0x042a('0x35')]=function(_0x46b24c,_0x945c75){return this['sendRequest'](util[_0x042a('0x25')](_0x042a('0x36'),_0x46b24c,_0x945c75));};AGIChannel[_0x042a('0x22')]['continueAt']=function(_0x48c84a,_0x435358,_0x393fef){_0x435358=_0x435358||this['extension'];_0x393fef=_0x393fef||0x1;this[_0x042a('0x2c')](_0x48c84a);this[_0x042a('0x37')](_0x435358);this[_0x042a('0x38')](_0x393fef);return this[_0x042a('0x27')](util[_0x042a('0x25')]('GOTO\x20%s\x20%s\x20%s',_0x48c84a,_0x435358,_0x393fef));};AGIChannel[_0x042a('0x22')]['getVariable']=function(_0x46e192){return this[_0x042a('0x20')](util[_0x042a('0x25')](_0x042a('0x39'),_0x46e192));};AGIChannel[_0x042a('0x22')][_0x042a('0x3a')]=function(_0x4f87da,_0x276431,_0x35dadb,_0x21307c,_0x7fe630,_0x57c5e5){_0x276431=_0x276431||_0x042a('0x3b');_0x35dadb=_0x35dadb||'';_0x21307c=_0x21307c===undefined?-0x1:_0x21307c==='-1'?-0x1:_0x21307c*0x3e8;_0x7fe630=_0x7fe630===undefined?'':'s='+_0x7fe630;_0x57c5e5=_0x57c5e5?_0x042a('0x3c'):'';return this[_0x042a('0x20')](util[_0x042a('0x25')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x4f87da,_0x276431,_0x35dadb,_0x21307c,_0x57c5e5,_0x7fe630));};AGIChannel['prototype'][_0x042a('0x3d')]=function(_0x38b1af,_0x3bda44){_0x3bda44=_0x3bda44||'';return this[_0x042a('0x20')](util[_0x042a('0x25')](_0x042a('0x3e'),_0x38b1af,_0x3bda44));};AGIChannel[_0x042a('0x22')][_0x042a('0x3f')]=function(_0x4bf366){return this[_0x042a('0x40')]('AGI',_0x4bf366);};AGIChannel[_0x042a('0x22')]['wait']=function(_0x100fd5){return this[_0x042a('0x40')](_0x042a('0x41'),_0x100fd5);};AGIChannel[_0x042a('0x22')][_0x042a('0x15')]=function(_0x52252a,_0x4f331b){this[_0x042a('0x27')](util[_0x042a('0x25')](_0x042a('0x42'),_0x52252a['id'],_0x52252a['label'],_0x4f331b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x042a('0x43')]=AGIChannel; \ No newline at end of file +var _0xdc0f=['./error','call','setEncoding','headers','emit','ready','line','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','startsWith','split','length','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setPriority','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','setContext','setExtension','GOTO\x20%s\x20%s\x20%s','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','label','exports','lodash','events','EventEmitter'];(function(_0x36147b,_0x57f40b){var _0x141351=function(_0x219aa1){while(--_0x219aa1){_0x36147b['push'](_0x36147b['shift']());}};_0x141351(++_0x57f40b);}(_0xdc0f,0x1e7));var _0xfdc0=function(_0x24c564,_0x49afff){_0x24c564=_0x24c564-0x0;var _0x3a5538=_0xdc0f[_0x24c564];return _0x3a5538;};'use strict';var util=require('util');var _=require(_0xfdc0('0x0'));var EventEmitter=require(_0xfdc0('0x1'))[_0xfdc0('0x2')];var AGIReply=require('./reply');var AGIError=require(_0xfdc0('0x3'));function AGIChannel(_0x47870c){var _0xd486b8=this,_0x128727=new AGIReply(),_0x1fdf8b=![],_0x9dd92a={};EventEmitter[_0xfdc0('0x4')](_0xd486b8);_0x47870c[_0xfdc0('0x5')]('utf8');_0x47870c['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x128727[_0xfdc0('0x5')]('utf8');_0x128727['on'](_0xfdc0('0x6'),function(_0x5a6197){for(var _0x4c6ca2 in _0x5a6197){_0xd486b8[_0x4c6ca2]=_0x5a6197[_0x4c6ca2];}_0xd486b8[_0xfdc0('0x7')](_0xfdc0('0x8'));});_0x128727['on'](_0xfdc0('0x9'),function(_0x3ca97f){if(_0x3ca97f['toLowerCase']()=='hangup'){_0xd486b8[_0xfdc0('0x7')](_0xfdc0('0xa'));return;}if(_0x3ca97f[_0xfdc0('0xb')](0x0,0xb)==_0xfdc0('0xc')){_0x1fdf8b=!![];}if(_0x1fdf8b){_0x9dd92a['rx']+=_0x3ca97f+'\x0a';if(_0x3ca97f['search'](_0xfdc0('0xd'))!=-0x1){_0x1fdf8b=![];}}else{_0x9dd92a['rx']=_0x3ca97f;}if(_0x1fdf8b){return;}if(typeof _0x9dd92a['cb']=='function'){var _0xd28cc0=_0x9dd92a['rx'][_0xfdc0('0xb')](0x0,0x3),_0x2b29cf=null,_0x331049=null;_0xd28cc0=parseInt(_0xd28cc0);if(isNaN(_0xd28cc0)){_0x9dd92a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xfdc0('0xe')});return;}if(_0xd28cc0!=0xc8){_0x9dd92a['cb'](null,{'code':_0xd28cc0,'result':-0x1,'extra':'KO'});return;}_0x2b29cf=_0x9dd92a['rx'][_0xfdc0('0xb')](0x4)[_0xfdc0('0xf')](_0xfdc0('0x10'),'');if(_0x2b29cf[_0xfdc0('0x11')]('\x20')!=-0x1){_0x2b29cf=_0x2b29cf['substr'](0x0,_0x2b29cf[_0xfdc0('0x11')]('\x20'));}if(_[_0xfdc0('0x12')](_0x2b29cf,'-1')){_0x2b29cf=parseInt(_0x2b29cf);}_0x331049=_0x9dd92a['rx'][_0xfdc0('0x13')]('\x20');if(_0x331049[_0xfdc0('0x14')]==0x3){_0x331049=_0x331049[0x2]['substring'](0x1,_0x331049[0x2][_0xfdc0('0x14')]-0x1);}else if(_0x331049[_0xfdc0('0x14')]>0x3){var _0x36b88f=/\((.+)\)/;var _0xe43e5b=_0x9dd92a['rx']['match'](_0x36b88f);if(_0xe43e5b){_0x331049=_0xe43e5b[0x1];}else{_0x331049=null;}}else{_0x331049=null;}_0x9dd92a['cb'](null,{'code':_0xd28cc0,'result':_0x2b29cf,'extra':_0x331049});}});_0x47870c['on'](_0xfdc0('0x15'),function(_0x30ab81){_0xd486b8[_0xfdc0('0x7')](_0xfdc0('0x15'),new AGIError('E_AGI_SOCKET_ERROR',_0x30ab81[_0xfdc0('0x16')]));});_0x47870c['on'](_0xfdc0('0x17'),function(){_0xd486b8[_0xfdc0('0x7')](_0xfdc0('0x17'),new AGIError(_0xfdc0('0x18')));});_0x47870c['on'](_0xfdc0('0x19'),function(){_0xd486b8[_0xfdc0('0x7')](_0xfdc0('0x19'),new AGIError(_0xfdc0('0x1a')));_0x47870c[_0xfdc0('0x1b')]();});_0x47870c[_0xfdc0('0x1c')](_0x128727);this[_0xfdc0('0x1d')]=function(_0x217d26,_0x169dde){var _0x217d26=_0x217d26||'',_0x169dde=typeof _0x169dde=='function'?_0x169dde:new Function();_0x9dd92a={'tx':_0x217d26,'rx':'','cb':_0x169dde};_0x47870c[_0xfdc0('0x1e')](_0x217d26+'\x0a');},this[_0xfdc0('0x17')]=function(){_0x47870c[_0xfdc0('0x1b')]();};}util[_0xfdc0('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x21')]=function(_0x34669d){return this['command'][_0xfdc0('0x22')](this,_0x34669d);};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x23')]=function(){return this[_0xfdc0('0x21')](_0xfdc0('0x24'));};AGIChannel[_0xfdc0('0x20')]['getData']=function(_0x539107,_0x55c03d,_0x25cc56){_0x539107=_0x539107===undefined?_0xfdc0('0x25'):_0x539107;_0x55c03d=_0x55c03d===undefined?'5':_0x55c03d;_0x25cc56=_0x25cc56===undefined?'1':_0x25cc56;return this[_0xfdc0('0x21')](util['format'](_0xfdc0('0x26'),_0x539107,_0x55c03d*0x3e8,_0x25cc56));};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x27')]=function(_0x582622){_0x582622=_0x582622||_0xfdc0('0x28');return this[_0xfdc0('0x21')](util[_0xfdc0('0x29')](_0xfdc0('0x2a'),_0x582622));};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x2b')]=function(_0x41d736,_0xc6f04c){if(_[_0xfdc0('0x2c')](_0xc6f04c)){return this['sendRequest'](util['format'](_0xfdc0('0x2d'),_0x41d736,_0xc6f04c[_0xfdc0('0x2e')](',')));}return this[_0xfdc0('0x21')](util[_0xfdc0('0x29')](_0xfdc0('0x2d'),_0x41d736,_0xc6f04c));};AGIChannel['prototype']['setContext']=function(_0x115b10){return this['sendRequest'](util['format'](_0xfdc0('0x2f'),_0x115b10));};AGIChannel[_0xfdc0('0x20')]['setExtension']=function(_0x52f8a4){return this['sendRequest'](util[_0xfdc0('0x29')]('SET\x20EXTENSION\x20%s',_0x52f8a4));};AGIChannel['prototype'][_0xfdc0('0x30')]=function(_0xf5a1a5){return this[_0xfdc0('0x21')](util[_0xfdc0('0x29')]('SET\x20PRIORITY\x20%s',_0xf5a1a5));};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0xa')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x31')]=function(_0x227106,_0x12ecae){return this[_0xfdc0('0x21')](util[_0xfdc0('0x29')](_0xfdc0('0x32'),_0x227106,_0x12ecae?_0x12ecae['toString']()[_0xfdc0('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x33')]=function(_0x1b3ec2,_0x28f1ff){return this['sendRequest'](util[_0xfdc0('0x29')]('SAY\x20NUMBER\x20%s\x20%s',_0x1b3ec2,_0x28f1ff));};AGIChannel['prototype'][_0xfdc0('0x34')]=function(_0x5beb75,_0x5c0864){return this[_0xfdc0('0x21')](util[_0xfdc0('0x29')](_0xfdc0('0x35'),_0x5beb75,_0x5c0864));};AGIChannel[_0xfdc0('0x20')]['sayPhonetic']=function(_0x4ec40d,_0x52f5d2){return this['sendRequest'](util[_0xfdc0('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x4ec40d,_0x52f5d2));};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x36')]=function(_0x4a3049,_0x4c07c5,_0x1bff9c){_0x4c07c5=_0x4c07c5||this[_0xfdc0('0x37')];_0x1bff9c=_0x1bff9c||0x1;this[_0xfdc0('0x38')](_0x4a3049);this[_0xfdc0('0x39')](_0x4c07c5);this[_0xfdc0('0x30')](_0x1bff9c);return this[_0xfdc0('0x27')](util[_0xfdc0('0x29')](_0xfdc0('0x3a'),_0x4a3049,_0x4c07c5,_0x1bff9c));};AGIChannel['prototype']['getVariable']=function(_0x48859c){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x48859c));};AGIChannel['prototype'][_0xfdc0('0x3b')]=function(_0x435466,_0x380cac,_0xca2a4f,_0x140147,_0x2423dd,_0x36a65b){_0x380cac=_0x380cac||_0xfdc0('0x3c');_0xca2a4f=_0xca2a4f||'';_0x140147=_0x140147===undefined?-0x1:_0x140147==='-1'?-0x1:_0x140147*0x3e8;_0x2423dd=_0x2423dd===undefined?'':'s='+_0x2423dd;_0x36a65b=_0x36a65b?_0xfdc0('0x3d'):'';return this['sendRequest'](util[_0xfdc0('0x29')](_0xfdc0('0x3e'),_0x435466,_0x380cac,_0xca2a4f,_0x140147,_0x36a65b,_0x2423dd));};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x3f')]=function(_0x2eae94,_0xed41fa){_0xed41fa=_0xed41fa||'';return this[_0xfdc0('0x21')](util[_0xfdc0('0x29')](_0xfdc0('0x40'),_0x2eae94,_0xed41fa));};AGIChannel['prototype']['agi']=function(_0x4fe50f){return this[_0xfdc0('0x2b')](_0xfdc0('0x41'),_0x4fe50f);};AGIChannel[_0xfdc0('0x20')][_0xfdc0('0x42')]=function(_0xab6e06){return this[_0xfdc0('0x2b')](_0xfdc0('0x43'),_0xab6e06);};AGIChannel['prototype'][_0xfdc0('0x15')]=function(_0x303856,_0xb8f9a5){this['noop'](util[_0xfdc0('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x303856['id'],_0x303856[_0xfdc0('0x44')],_0xb8f9a5));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xfdc0('0x45')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 0d62aaa..73a85c5 100644 --- a/server/services/agi/error.js +++ b/server/services/agi/error.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d5d=['push','format','apply','name','exports','util','Undefined\x20error.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x3d5d,0x104));var _0xd3d5=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x3d5d[_0x330723];return _0x60c546;};'use strict';var util=require(_0xd3d5('0x0'));var error={'E_AGI_UNDEFINED':_0xd3d5('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xd3d5('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xd3d5('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xd3d5('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xd3d5('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xd3d5('0x6'),'E_AGI_COMMAND_EMPTY':_0xd3d5('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd3d5('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3b857d){var _0x3b857d=_0x3b857d||null,_0x174d5f=_0x174d5f||[],_0x4423f5=0x1,_0x267d52='';if(!error[_0x3b857d]){_0x3b857d=_0xd3d5('0x9');}_0x174d5f['push'](error[_0x3b857d]);while(arguments[_0x4423f5]){_0x174d5f[_0xd3d5('0xa')](arguments[_0x4423f5]);_0x4423f5++;}_0x267d52=util[_0xd3d5('0xb')][_0xd3d5('0xc')](util,_0x174d5f);this['message']=_0x267d52;this[_0xd3d5('0xd')]=_0x3b857d;}module[_0xd3d5('0xe')]=AGIError; \ No newline at end of file +var _0x2e35=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','message','exports','util'];(function(_0x3fa37f,_0x397f16){var _0x5a01d5=function(_0xa23c65){while(--_0xa23c65){_0x3fa37f['push'](_0x3fa37f['shift']());}};_0x5a01d5(++_0x397f16);}(_0x2e35,0x1d0));var _0x52e3=function(_0x3f4a75,_0x6f43b0){_0x3f4a75=_0x3f4a75-0x0;var _0x46ef8f=_0x2e35[_0x3f4a75];return _0x46ef8f;};'use strict';var util=require(_0x52e3('0x0'));var error={'E_AGI_UNDEFINED':_0x52e3('0x1'),'E_AGI_ARGUMENT_PORT':_0x52e3('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x52e3('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x52e3('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x52e3('0x5'),'E_AGI_SOCKET_ERROR':_0x52e3('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x52e3('0x7'),'E_AGI_COMMAND_EMPTY':_0x52e3('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x52e3('0x9'),'E_AGI_IVR_ENTRY':_0x52e3('0xa')};function AGIError(_0x5f117a){var _0x5f117a=_0x5f117a||null,_0x507a6c=_0x507a6c||[],_0x21ae13=0x1,_0x4d77a0='';if(!error[_0x5f117a]){_0x5f117a='E_AGI_UNDEFINED';}_0x507a6c[_0x52e3('0xb')](error[_0x5f117a]);while(arguments[_0x21ae13]){_0x507a6c[_0x52e3('0xb')](arguments[_0x21ae13]);_0x21ae13++;}_0x4d77a0=util['format'][_0x52e3('0xc')](util,_0x507a6c);this[_0x52e3('0xd')]=_0x4d77a0;this['name']=_0x5f117a;}module[_0x52e3('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 4f1f69c..20ea9ae 100644 --- a/server/services/agi/graph/index.js +++ b/server/services/agi/graph/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','lodash','../../../config/logger','menu','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','size','getVertex','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','condition','split','vswitch','target','agicommand','invalid','traverseBFS','length'];(function(_0x2d4ae0,_0x1eea59){var _0x12881c=function(_0x5562c2){while(--_0x5562c2){_0x2d4ae0['push'](_0x2d4ae0['shift']());}};_0x12881c(++_0x1eea59);}(_0xe511,0x16f));var _0x1e51=function(_0x19b7f4,_0x1a65f3){_0x19b7f4=_0x19b7f4-0x0;var _0x6ac888=_0xe511[_0x19b7f4];return _0x6ac888;};'use strict';var _=require(_0x1e51('0x0'));var logger=require(_0x1e51('0x1'))('agi');var verticesWithRetry=[_0x1e51('0x2'),'getdigits',_0x1e51('0x3')];var Graph=function(){this[_0x1e51('0x4')]={};this['edges']={};this[_0x1e51('0x5')]=0x0;};Graph[_0x1e51('0x6')][_0x1e51('0x7')]=function(_0x16ec99){this['vertices'][_0x16ec99['id']]=_0x16ec99;this[_0x1e51('0x8')][_0x16ec99['id']]=[];};Graph[_0x1e51('0x6')]['addEdge']=function(_0x4fa2ba,_0x394ad8,_0x133021){this['edges'][_0x4fa2ba]['push']({'target':_0x394ad8,'condition':_0x133021});this[_0x1e51('0x5')]+=0x1;};Graph[_0x1e51('0x6')][_0x1e51('0x9')]=function(){return _[_0x1e51('0x9')](this[_0x1e51('0x4')]);};Graph[_0x1e51('0x6')]['relations']=function(){return this[_0x1e51('0x5')];};Graph[_0x1e51('0x6')][_0x1e51('0xa')]=function(_0x2ea35d){return this[_0x1e51('0x4')][_0x2ea35d];};Graph[_0x1e51('0x6')]['traverseBFS']=function(_0x408a77,_0x102f01){if(!this[_0x1e51('0x4')][_0x408a77]){return logger[_0x1e51('0xb')](_0x1e51('0xc'));}var _0x32945d=_0x102f01(this[_0x1e51('0x4')][_0x408a77]);if(!_0x32945d){return logger[_0x1e51('0xb')](_0x1e51('0xd'));}if(this[_0x1e51('0x8')][_0x408a77]['length']===0x0){return logger[_0x1e51('0xb')](_0x1e51('0xe'));}for(var _0x4526b4=0x0,_0x5857e2=[],_0xa3b410=![];_0x4526b4\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./vertices','defaults','127.0.0.1','nextTick','error','log','port','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','format','[%s]\x20%s','stack','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x136539,_0x574f0b){var _0x44f04b=function(_0x109b9a){while(--_0x109b9a){_0x136539['push'](_0x136539['shift']());}};_0x44f04b(++_0x574f0b);}(_0x4f17,0x9e));var _0x74f1=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x4f17[_0x149083];return _0x4dc74e;};'use strict';var parser=require(_0x74f1('0x0'));var _=require('lodash');var syncho=require(_0x74f1('0x1'));var util=require(_0x74f1('0x2'));var moment=require('moment');var config=require(_0x74f1('0x3'));var logger=require(_0x74f1('0x4'))(_0x74f1('0x5'));var utilLicense=require(_0x74f1('0x6'));var rpc=require(_0x74f1('0x7'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0x74f1('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x74f1('0x9')](config['agi'],{'ip':_0x74f1('0xa'),'port':0x11dd});function connectionHandler(_0x339d55){process[_0x74f1('0xb')](function(){syncho(function(){try{setChannelVariables(_0x339d55);agiHandler(_0x339d55);}catch(_0x5377d3){logger[_0x74f1('0xc')](_0x5377d3['stack']);}});});}function listeningHandler(){console[_0x74f1('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x74f1('0x5')][_0x74f1('0xe')]);logger['info'](util['format'](_0x74f1('0xf'),config[_0x74f1('0x5')]['ip'],config[_0x74f1('0x5')][_0x74f1('0xe')]));}function errorHandler(_0x2e78b8){if(_0x2e78b8&&_0x2e78b8[_0x74f1('0x10')]&&_0x2e78b8[_0x74f1('0x11')]){logger[_0x74f1('0xc')](util[_0x74f1('0x12')](_0x74f1('0x13'),_0x2e78b8['name'],_0x2e78b8[_0x74f1('0x11')]));}else{logger['error'](util[_0x74f1('0x12')]('[ERROR]\x20%s',_0x2e78b8[_0x74f1('0x14')]));}}function closeHandler(){logger[_0x74f1('0x15')](util[_0x74f1('0x12')](_0x74f1('0x16'),this[_0x74f1('0x17')],this['calleridname'],this[_0x74f1('0x18')],this[_0x74f1('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x387937){logger[_0x74f1('0xc')](_0x387937['stack']);}}function timeoutHandler(){logger[_0x74f1('0x15')](util[_0x74f1('0x12')](_0x74f1('0x1a'),this[_0x74f1('0x17')],this[_0x74f1('0x1b')],this['callerid'],this[_0x74f1('0x19')],this[_0x74f1('0x1c')]));}function hangupHandler(){logger[_0x74f1('0x15')](util[_0x74f1('0x12')](_0x74f1('0x1d'),this[_0x74f1('0x17')],this['calleridname'],this['callerid'],this['dnid'],this[_0x74f1('0x1c')]));this[_0x74f1('0x1e')]=!![];}function getRoot(_0x3d4c18){return parser[_0x74f1('0x1f')](_0x3d4c18,{'object':!![]})[_0x74f1('0x20')][_0x74f1('0x21')];}function addVertex(_0x34701f,_0x26cba4,_0x2c336b){_0x26cba4[_0x74f1('0x22')]=_0x2c336b;if(_0x26cba4[_0x74f1('0x23')]('retry')){_0x26cba4['maxRetry']=parseInt(_0x26cba4[_0x74f1('0x24')],0xa);}_0x34701f[_0x74f1('0x25')](_[_0x74f1('0x26')](_0x26cba4,_0x74f1('0x27')));}function initGraph(_0x458194,_0xddbb89){var _0xd079b5=new Graph();for(var _0x5c1fa0 in _0x458194){if(_0x458194[_0x74f1('0x23')](_0x5c1fa0)){if(_[_0x74f1('0x28')](_0x458194[_0x5c1fa0])){for(var _0x59a7ac=0x0;_0x59a7ac<_0x458194[_0x5c1fa0][_0x74f1('0x29')];_0x59a7ac+=0x1){addVertex(_0xd079b5,_0x458194[_0x5c1fa0][_0x59a7ac],_0x5c1fa0);}}else{addVertex(_0xd079b5,_0x458194[_0x5c1fa0],_0x5c1fa0);}}}for(var _0x58d6d8=0x0;_0x58d6d8<_0xddbb89['length'];_0x58d6d8+=0x1){if(_0xddbb89[_0x58d6d8][_0x74f1('0x2a')]&&_0xddbb89[_0x58d6d8][_0x74f1('0x2b')]){_0xd079b5[_0x74f1('0x2c')](_0xddbb89[_0x58d6d8][_0x74f1('0x2a')],_0xddbb89[_0x58d6d8][_0x74f1('0x2b')],_0xddbb89[_0x58d6d8][_0x74f1('0x2d')]);}}return _0xd079b5;}function getSquareProject(_0x19390c,_0x237fcf){rpc[_0x74f1('0x2e')](_0x19390c)[_0x74f1('0x2f')](function(_0xd226be){_0x237fcf(null,_0xd226be);})[_0x74f1('0x30')](function(_0x2a0a17){_0x237fcf(null,_0x2a0a17);});}function createSquareReport(_0x4bd1a0,_0x11cfe4){rpc[_0x74f1('0x31')](_0x4bd1a0)[_0x74f1('0x2f')](function(_0xa191b1){if(_0x11cfe4){_0x11cfe4(null,_0xa191b1);}})['catch'](function(_0x181201){if(_0x11cfe4){_0x11cfe4(null,_0x181201);}});}function setChannelVariables(_0x48f7e8){for(var _0x45c49c in _0x48f7e8){if(_0x48f7e8[_0x74f1('0x23')](_0x45c49c)){if(_0x45c49c[_0x74f1('0x32')](_0x74f1('0x33'))===0x0){_0x48f7e8[_0x45c49c['substring'](0x4)]=_0x48f7e8[_0x45c49c];delete _0x48f7e8[_0x45c49c];}}}}function getLogFromObject(_0x1435fc){return util['inspect'](_0x1435fc,{'showHidden':![],'depth':null});}function agiHandler(_0x28ac8a){var _0x7cdfb7,_0x1a34fd,_0x158516,_0x119d07,_0x366472;logger[_0x74f1('0x34')](_0x74f1('0x35'),JSON[_0x74f1('0x36')](_0x28ac8a,null,0x2));logger['info'](util[_0x74f1('0x12')](_0x74f1('0x37'),_0x28ac8a['arg_1'],_0x28ac8a[_0x74f1('0x1b')],_0x28ac8a[_0x74f1('0x18')],_0x28ac8a[_0x74f1('0x19')],_0x28ac8a[_0x74f1('0x1c')]));_0x28ac8a['on'](_0x74f1('0xc'),errorHandler);_0x28ac8a['on'](_0x74f1('0x38'),closeHandler);_0x28ac8a['on']('timeout',timeoutHandler);_0x28ac8a[_0x74f1('0x1e')]=![];_0x28ac8a['on'](_0x74f1('0x39'),hangupHandler);var _0x120939=getSquareProject[_0x74f1('0x3a')](null,_0x28ac8a[_0x74f1('0x17')]);if(_0x120939){if(_0x120939[_0x74f1('0x3b')]){_0x7cdfb7=getRoot(_0x120939[_0x74f1('0x3b')]);if(_0x7cdfb7&&_0x7cdfb7[_0x74f1('0x3c')]){logger[_0x74f1('0x34')](_0x74f1('0x21'),JSON['stringify'](_0x7cdfb7,null,0x2));_0x28ac8a[_0x74f1('0x3d')]=moment()['format'](_0x74f1('0x3e'));_0x1a34fd=initGraph(_[_0x74f1('0x26')](_0x7cdfb7,'mxCell'),_0x7cdfb7[_0x74f1('0x27')]);_0x158516=new Vertices(_0x28ac8a,rpc,mailRpc);logger[_0x74f1('0x15')](util['format'](_0x74f1('0x3f'),_0x28ac8a[_0x74f1('0x17')],_0x28ac8a['calleridname'],_0x28ac8a[_0x74f1('0x18')],_0x28ac8a[_0x74f1('0x19')],_0x28ac8a[_0x74f1('0x1c')]));_0x1a34fd[_0x74f1('0x40')](_0x7cdfb7[_0x74f1('0x3c')]['id'],function(_0x42c0b2){try{_0x42c0b2=_0x158516['clear'](_0x42c0b2);logger['debug'](_0x74f1('0x41'),JSON[_0x74f1('0x36')](_0x42c0b2,null,0x2));if(_0x42c0b2[_0x74f1('0x22')]===_0x74f1('0x42')){logger[_0x74f1('0x15')](_0x74f1('0x43'));_0x28ac8a[_0x74f1('0x44')]=_0x42c0b2[_0x74f1('0x44')]||_0x28ac8a[_0x74f1('0x44')];_0x28ac8a[_0x74f1('0x45')]=_0x42c0b2['extension'];_0x28ac8a['priority']=_0x42c0b2[_0x74f1('0x46')]?_0x42c0b2['priority']-0x1:0x1;return null;}else if(_0x42c0b2&&_0x158516[_0x42c0b2[_0x74f1('0x22')]]){_0x366472=_0x158516[_0x42c0b2[_0x74f1('0x22')]](_0x42c0b2);logger[_0x74f1('0x15')]('response',JSON[_0x74f1('0x36')](_0x366472,null,0x2));if(_0x366472&&_0x366472[_0x74f1('0x47')]===AGI_CODE_SUCCESS&&_0x366472[_0x74f1('0x48')]!==AGI_RESULT_ERROR&&!_0x28ac8a[_0x74f1('0x1e')]){logger[_0x74f1('0x34')](_0x74f1('0x49'),getLogFromObject(_0x366472));return _[_0x74f1('0x4a')](_0x366472[_0x74f1('0x48')])?null:_0x366472['result']['toString']();}else{logger[_0x74f1('0xc')]('response',getLogFromObject(_0x366472));return null;}}else{logger[_0x74f1('0xc')](_0x74f1('0x4b'));return null;}}catch(_0x420235){logger[_0x74f1('0xc')](_0x420235[_0x74f1('0x14')]);return null;}});if(_0x7cdfb7[_0x74f1('0x4c')]){logger[_0x74f1('0x15')](util['format'](_0x74f1('0x4d'),_0x28ac8a[_0x74f1('0x17')],_0x28ac8a[_0x74f1('0x1b')],_0x28ac8a[_0x74f1('0x18')],_0x28ac8a[_0x74f1('0x19')],_0x28ac8a['uniqueid']));_0x1a34fd[_0x74f1('0x40')](_0x7cdfb7[_0x74f1('0x4c')]['id'],function(_0x3a8d80){try{_0x3a8d80=_0x158516[_0x74f1('0x4e')](_0x3a8d80);logger[_0x74f1('0x34')](_0x74f1('0x41'),JSON[_0x74f1('0x36')](_0x3a8d80,null,0x2));if(_0x3a8d80&&_0x158516[_0x3a8d80[_0x74f1('0x22')]]){_0x366472=_0x158516[_0x3a8d80[_0x74f1('0x22')]](_0x3a8d80);if(_0x366472){logger['debug'](_0x74f1('0x49'),getLogFromObject(_0x366472));return _[_0x74f1('0x4a')](_0x366472[_0x74f1('0x48')])?null:_0x366472['result']['toString']();}else{logger[_0x74f1('0xc')](_0x74f1('0x49'),getLogFromObject(_0x366472));return null;}}else{logger[_0x74f1('0xc')](_0x74f1('0x4b'));return null;}}catch(_0x3f1a61){logger[_0x74f1('0xc')](_0x3f1a61[_0x74f1('0x14')]);return null;}});}logger[_0x74f1('0x15')](util['format'](_0x74f1('0x4f'),_0x28ac8a[_0x74f1('0x17')],_0x28ac8a[_0x74f1('0x1b')],_0x28ac8a[_0x74f1('0x18')],_0x28ac8a[_0x74f1('0x19')],_0x28ac8a[_0x74f1('0x1c')]));logger['info'](util[_0x74f1('0x12')](_0x74f1('0x50'),_0x28ac8a['context'],_0x28ac8a[_0x74f1('0x45')],parseInt(_0x28ac8a[_0x74f1('0x46')],0xa)+0x1));_0x28ac8a[_0x74f1('0x51')](_0x28ac8a[_0x74f1('0x44')],_0x28ac8a[_0x74f1('0x45')],parseInt(_0x28ac8a[_0x74f1('0x46')],0xa)+0x1);_0x28ac8a[_0x74f1('0x38')]();}}else{logger[_0x74f1('0xc')](util[_0x74f1('0x12')](_0x74f1('0x52'),_0x28ac8a[_0x74f1('0x17')]));_0x28ac8a[_0x74f1('0x51')](_0x28ac8a[_0x74f1('0x44')],_0x28ac8a[_0x74f1('0x45')],parseInt(_0x28ac8a[_0x74f1('0x46')],0xa)+0x1);_0x28ac8a[_0x74f1('0x38')]();}}else{logger[_0x74f1('0xc')](util[_0x74f1('0x12')](_0x74f1('0x53'),_0x28ac8a[_0x74f1('0x17')]));_0x28ac8a[_0x74f1('0x51')](_0x28ac8a[_0x74f1('0x44')],_0x28ac8a[_0x74f1('0x45')],parseInt(_0x28ac8a[_0x74f1('0x46')],0xa)+0x1);_0x28ac8a[_0x74f1('0x38')]();}}function main(){var _0x1c5e3d;return utilLicense[_0x74f1('0x54')]()[_0x74f1('0x2f')](function(_0x55b919){if(_0x55b919){if(_0x55b919[_0x74f1('0x55')]){if(_0x55b919[_0x74f1('0x56')]&&_0x55b919[_0x74f1('0x56')]>0x0){logger[_0x74f1('0x15')](util[_0x74f1('0x12')](_0x74f1('0x57'),_0x55b919['callysquare']));_0x1c5e3d=_0x55b919[_0x74f1('0x56')];}else{logger[_0x74f1('0x15')](_0x74f1('0x58'));}}else{logger[_0x74f1('0x15')](_0x74f1('0x59'));_0x1c5e3d=-0x1;}}})[_0x74f1('0x30')](function(_0x15e336){logger['error'](_0x74f1('0x5a'),_0x15e336[_0x74f1('0x14')]);})['finally'](function(){var _0x24c4c0=require(_0x74f1('0x5b'))(config['agi'][_0x74f1('0xe')],config[_0x74f1('0x5')]['ip'],_0x1c5e3d);_0x24c4c0['on'](_0x74f1('0xc'),errorHandler);_0x24c4c0['on'](_0x74f1('0x5c'),listeningHandler);_0x24c4c0['on'](_0x74f1('0x5d'),connectionHandler);_0x24c4c0['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x8375=['./rpc','./graph','./vertices','defaults','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','evtHangup','toJson','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','close','timeout','production','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','connection','xml2json','lodash','syncho','moment','../../config/environment','../../config/logger','agi','../../config/license/util'];(function(_0x4bfbe5,_0x9f4f19){var _0x3247d5=function(_0x2d9b1a){while(--_0x2d9b1a){_0x4bfbe5['push'](_0x4bfbe5['shift']());}};_0x3247d5(++_0x9f4f19);}(_0x8375,0xa8));var _0x5837=function(_0x1ce1c6,_0x1256a4){_0x1ce1c6=_0x1ce1c6-0x0;var _0x636ef8=_0x8375[_0x1ce1c6];return _0x636ef8;};'use strict';var parser=require(_0x5837('0x0'));var _=require(_0x5837('0x1'));var syncho=require(_0x5837('0x2'));var util=require('util');var moment=require(_0x5837('0x3'));var config=require(_0x5837('0x4'));var logger=require(_0x5837('0x5'))(_0x5837('0x6'));var utilLicense=require(_0x5837('0x7'));var rpc=require(_0x5837('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x5837('0x9'));var Vertices=require(_0x5837('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5837('0x6')]=_[_0x5837('0xb')](config[_0x5837('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x508caf){process[_0x5837('0xc')](function(){syncho(function(){try{setChannelVariables(_0x508caf);agiHandler(_0x508caf);}catch(_0x6c5828){logger['error'](_0x6c5828[_0x5837('0xd')]);}});});}function listeningHandler(){console['log'](_0x5837('0xe'),config[_0x5837('0x6')][_0x5837('0xf')]);logger[_0x5837('0x10')](util[_0x5837('0x11')](_0x5837('0x12'),config['agi']['ip'],config[_0x5837('0x6')][_0x5837('0xf')]));}function errorHandler(_0x1b0a4d){if(_0x1b0a4d&&_0x1b0a4d[_0x5837('0x13')]&&_0x1b0a4d[_0x5837('0x14')]){logger['error'](util['format']('[%s]\x20%s',_0x1b0a4d[_0x5837('0x13')],_0x1b0a4d[_0x5837('0x14')]));}else{logger[_0x5837('0x15')](util[_0x5837('0x11')](_0x5837('0x16'),_0x1b0a4d[_0x5837('0xd')]));}}function closeHandler(){logger[_0x5837('0x10')](util[_0x5837('0x11')](_0x5837('0x17'),this['arg_1'],this[_0x5837('0x18')],this[_0x5837('0x19')],this['dnid'],this[_0x5837('0x1a')]));try{createSquareReport(this);}catch(_0x2297b4){logger[_0x5837('0x15')](_0x2297b4['stack']);}}function timeoutHandler(){logger['info'](util['format'](_0x5837('0x1b'),this[_0x5837('0x1c')],this[_0x5837('0x18')],this['callerid'],this[_0x5837('0x1d')],this[_0x5837('0x1a')]));}function hangupHandler(){logger[_0x5837('0x10')](util[_0x5837('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x5837('0x19')],this['dnid'],this[_0x5837('0x1a')]));this[_0x5837('0x1e')]=!![];}function getRoot(_0x32733a){return parser[_0x5837('0x1f')](_0x32733a,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x1b80db,_0x2262b9,_0x406506){_0x2262b9['agicommand']=_0x406506;if(_0x2262b9[_0x5837('0x20')](_0x5837('0x21'))){_0x2262b9[_0x5837('0x22')]=parseInt(_0x2262b9['retry'],0xa);}_0x1b80db[_0x5837('0x23')](_[_0x5837('0x24')](_0x2262b9,_0x5837('0x25')));}function initGraph(_0x58905c,_0x57baed){var _0x1d545c=new Graph();for(var _0x15655e in _0x58905c){if(_0x58905c[_0x5837('0x20')](_0x15655e)){if(_[_0x5837('0x26')](_0x58905c[_0x15655e])){for(var _0x2d5c00=0x0;_0x2d5c00<_0x58905c[_0x15655e][_0x5837('0x27')];_0x2d5c00+=0x1){addVertex(_0x1d545c,_0x58905c[_0x15655e][_0x2d5c00],_0x15655e);}}else{addVertex(_0x1d545c,_0x58905c[_0x15655e],_0x15655e);}}}for(var _0x2baf9b=0x0;_0x2baf9b<_0x57baed[_0x5837('0x27')];_0x2baf9b+=0x1){if(_0x57baed[_0x2baf9b]['source']&&_0x57baed[_0x2baf9b][_0x5837('0x28')]){_0x1d545c[_0x5837('0x29')](_0x57baed[_0x2baf9b][_0x5837('0x2a')],_0x57baed[_0x2baf9b][_0x5837('0x28')],_0x57baed[_0x2baf9b][_0x5837('0x2b')]);}}return _0x1d545c;}function getSquareProject(_0x228f1,_0x1761c1){rpc[_0x5837('0x2c')](_0x228f1)['then'](function(_0x4f7502){_0x1761c1(null,_0x4f7502);})[_0x5837('0x2d')](function(_0x2496ab){_0x1761c1(null,_0x2496ab);});}function createSquareReport(_0x5ab246,_0x298ea1){rpc[_0x5837('0x2e')](_0x5ab246)['then'](function(_0xb3a22e){if(_0x298ea1){_0x298ea1(null,_0xb3a22e);}})[_0x5837('0x2d')](function(_0x34ab9c){if(_0x298ea1){_0x298ea1(null,_0x34ab9c);}});}function setChannelVariables(_0x4c540a){for(var _0x522124 in _0x4c540a){if(_0x4c540a['hasOwnProperty'](_0x522124)){if(_0x522124[_0x5837('0x2f')](_0x5837('0x30'))===0x0){_0x4c540a[_0x522124[_0x5837('0x31')](0x4)]=_0x4c540a[_0x522124];delete _0x4c540a[_0x522124];}}}}function getLogFromObject(_0x1902a4){return util[_0x5837('0x32')](_0x1902a4,{'showHidden':![],'depth':null});}function agiHandler(_0x4d2a08){var _0x4bf885,_0x157107,_0x3bb513,_0x4e8d89,_0x532760;logger[_0x5837('0x33')]('variables',JSON['stringify'](_0x4d2a08,null,0x2));logger[_0x5837('0x10')](util[_0x5837('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4d2a08[_0x5837('0x1c')],_0x4d2a08[_0x5837('0x18')],_0x4d2a08[_0x5837('0x19')],_0x4d2a08['dnid'],_0x4d2a08[_0x5837('0x1a')]));_0x4d2a08['on'](_0x5837('0x15'),errorHandler);_0x4d2a08['on'](_0x5837('0x34'),closeHandler);_0x4d2a08['on'](_0x5837('0x35'),timeoutHandler);_0x4d2a08[_0x5837('0x1e')]=![];_0x4d2a08['on']('hangup',hangupHandler);var _0x1d48c8=getSquareProject['sync'](null,_0x4d2a08['arg_1']);if(_0x1d48c8){if(_0x1d48c8[_0x5837('0x36')]){_0x4bf885=getRoot(_0x1d48c8[_0x5837('0x36')]);if(_0x4bf885&&_0x4bf885['start']){logger[_0x5837('0x33')](_0x5837('0x37'),JSON[_0x5837('0x38')](_0x4bf885,null,0x2));_0x4d2a08[_0x5837('0x39')]=moment()['format'](_0x5837('0x3a'));_0x157107=initGraph(_[_0x5837('0x24')](_0x4bf885,_0x5837('0x25')),_0x4bf885['mxCell']);_0x3bb513=new Vertices(_0x4d2a08,rpc,mailRpc);logger[_0x5837('0x10')](util[_0x5837('0x11')](_0x5837('0x3b'),_0x4d2a08[_0x5837('0x1c')],_0x4d2a08[_0x5837('0x18')],_0x4d2a08[_0x5837('0x19')],_0x4d2a08[_0x5837('0x1d')],_0x4d2a08[_0x5837('0x1a')]));_0x157107[_0x5837('0x3c')](_0x4bf885[_0x5837('0x3d')]['id'],function(_0x1a5e2d){try{_0x1a5e2d=_0x3bb513[_0x5837('0x3e')](_0x1a5e2d);logger['debug']('vertex',JSON[_0x5837('0x38')](_0x1a5e2d,null,0x2));if(_0x1a5e2d[_0x5837('0x3f')]==='gotoc'){logger[_0x5837('0x10')](_0x5837('0x40'));_0x4d2a08[_0x5837('0x41')]=_0x1a5e2d['context']||_0x4d2a08[_0x5837('0x41')];_0x4d2a08[_0x5837('0x42')]=_0x1a5e2d[_0x5837('0x42')];_0x4d2a08[_0x5837('0x43')]=_0x1a5e2d[_0x5837('0x43')]?_0x1a5e2d[_0x5837('0x43')]-0x1:0x1;return null;}else if(_0x1a5e2d&&_0x3bb513[_0x1a5e2d[_0x5837('0x3f')]]){_0x532760=_0x3bb513[_0x1a5e2d[_0x5837('0x3f')]](_0x1a5e2d);logger[_0x5837('0x10')]('response',JSON[_0x5837('0x38')](_0x532760,null,0x2));if(_0x532760&&_0x532760[_0x5837('0x44')]===AGI_CODE_SUCCESS&&_0x532760[_0x5837('0x45')]!==AGI_RESULT_ERROR&&!_0x4d2a08['evtHangup']){logger['debug'](_0x5837('0x46'),getLogFromObject(_0x532760));return _[_0x5837('0x47')](_0x532760[_0x5837('0x45')])?null:_0x532760[_0x5837('0x45')][_0x5837('0x48')]();}else{logger[_0x5837('0x15')](_0x5837('0x46'),getLogFromObject(_0x532760));return null;}}else{logger[_0x5837('0x15')](_0x5837('0x49'));return null;}}catch(_0x3aaa7b){logger[_0x5837('0x15')](_0x3aaa7b[_0x5837('0xd')]);return null;}});if(_0x4bf885['finally']){logger[_0x5837('0x10')](util['format'](_0x5837('0x4a'),_0x4d2a08[_0x5837('0x1c')],_0x4d2a08['calleridname'],_0x4d2a08[_0x5837('0x19')],_0x4d2a08[_0x5837('0x1d')],_0x4d2a08['uniqueid']));_0x157107[_0x5837('0x3c')](_0x4bf885[_0x5837('0x4b')]['id'],function(_0x30a389){try{_0x30a389=_0x3bb513[_0x5837('0x3e')](_0x30a389);logger['debug']('vertex',JSON[_0x5837('0x38')](_0x30a389,null,0x2));if(_0x30a389&&_0x3bb513[_0x30a389[_0x5837('0x3f')]]){_0x532760=_0x3bb513[_0x30a389['agicommand']](_0x30a389);if(_0x532760){logger['debug']('response',getLogFromObject(_0x532760));return _['isUndefined'](_0x532760[_0x5837('0x45')])?null:_0x532760[_0x5837('0x45')][_0x5837('0x48')]();}else{logger['error']('response',getLogFromObject(_0x532760));return null;}}else{logger[_0x5837('0x15')](_0x5837('0x49'));return null;}}catch(_0xb3cdef){logger[_0x5837('0x15')](_0xb3cdef[_0x5837('0xd')]);return null;}});}logger[_0x5837('0x10')](util[_0x5837('0x11')](_0x5837('0x4c'),_0x4d2a08[_0x5837('0x1c')],_0x4d2a08[_0x5837('0x18')],_0x4d2a08['callerid'],_0x4d2a08[_0x5837('0x1d')],_0x4d2a08[_0x5837('0x1a')]));logger['info'](util[_0x5837('0x11')](_0x5837('0x4d'),_0x4d2a08[_0x5837('0x41')],_0x4d2a08[_0x5837('0x42')],parseInt(_0x4d2a08[_0x5837('0x43')],0xa)+0x1));_0x4d2a08['continueAt'](_0x4d2a08[_0x5837('0x41')],_0x4d2a08[_0x5837('0x42')],parseInt(_0x4d2a08[_0x5837('0x43')],0xa)+0x1);_0x4d2a08[_0x5837('0x34')]();}}else{logger[_0x5837('0x15')](util[_0x5837('0x11')]('Project\x20%s\x20not\x20published',_0x4d2a08[_0x5837('0x1c')]));_0x4d2a08['continueAt'](_0x4d2a08['context'],_0x4d2a08[_0x5837('0x42')],parseInt(_0x4d2a08['priority'],0xa)+0x1);_0x4d2a08[_0x5837('0x34')]();}}else{logger[_0x5837('0x15')](util[_0x5837('0x11')]('Project\x20%s\x20not\x20found',_0x4d2a08[_0x5837('0x1c')]));_0x4d2a08[_0x5837('0x4e')](_0x4d2a08[_0x5837('0x41')],_0x4d2a08['extension'],parseInt(_0x4d2a08[_0x5837('0x43')],0xa)+0x1);_0x4d2a08['close']();}}function main(){var _0xfe420d;return utilLicense[_0x5837('0x4f')]()[_0x5837('0x50')](function(_0x43703a){if(_0x43703a){if(_0x43703a[_0x5837('0x51')]){if(_0x43703a['callysquare']&&_0x43703a[_0x5837('0x52')]>0x0){logger[_0x5837('0x10')](util['format'](_0x5837('0x53'),_0x43703a[_0x5837('0x52')]));_0xfe420d=_0x43703a[_0x5837('0x52')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x5837('0x10')](_0x5837('0x54'));_0xfe420d=-0x1;}}})[_0x5837('0x2d')](function(_0x4f8957){logger[_0x5837('0x15')](_0x5837('0x55'),_0x4f8957['stack']);})[_0x5837('0x4b')](function(){var _0x56e08c=require('./server')(config[_0x5837('0x6')][_0x5837('0xf')],config['agi']['ip'],_0xfe420d);_0x56e08c['on'](_0x5837('0x15'),errorHandler);_0x56e08c['on'](_0x5837('0x56'),listeningHandler);_0x56e08c['on'](_0x5837('0x57'),connectionHandler);_0x56e08c['on'](_0x5837('0x34'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 3d7d97d..2031da4 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x138a1c,_0x499356){var _0x430977=function(_0x1c7630){while(--_0x1c7630){_0x138a1c['push'](_0x138a1c['shift']());}};_0x430977(++_0x499356);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x55b999,_0x152dc2){var _0xc2bd93=function(_0x119726){while(--_0x119726){_0x55b999['push'](_0x55b999['shift']());}};_0xc2bd93(++_0x152dc2);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index cde8ae5..0b7320b 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x16960e,_0x169c9f){var _0x1c24ce=function(_0x58c97){while(--_0x58c97){_0x16960e['push'](_0x16960e['shift']());}};_0x1c24ce(++_0x169c9f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x356025,_0x424a32){_0x356025=_0x356025-0x0;var _0x2272ad=_0x5f2f[_0x356025];return _0x2272ad;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x352421,_0x5dc5d9){_0x352421=_0x352421-0x0;var _0x10e7fd=_0x5f2f[_0x352421];return _0x10e7fd;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 9f2d960..d6cd4b1 100644 --- a/server/services/agi/rpc/index.js +++ b/server/services/agi/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16bf=['agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment','util','client','http','request','then','error','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareReport','CreateSquareReport','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','getPauseById','agentLogin','LoginUser'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x16bf,0x178));var _0xf16b=function(_0x41cf7e,_0x27d0f1){_0x41cf7e=_0x41cf7e-0x0;var _0x514aa5=_0x16bf[_0x41cf7e];return _0x514aa5;};'use strict';var BPromise=require('bluebird');var moment=require(_0xf16b('0x0'));var _=require('lodash');var util=require(_0xf16b('0x1'));var jayson=require('jayson/promise');var client=jayson[_0xf16b('0x2')][_0xf16b('0x3')]({'port':0x2329});function request(_0x57ab6b,_0x1cc7b5){return new BPromise(function(_0x2c4838,_0x1cb7b6){return client[_0xf16b('0x4')](_0x57ab6b,_0x1cc7b5)[_0xf16b('0x5')](function(_0x5e5802){if(_0x5e5802[_0xf16b('0x6')]){return _0x1cb7b6(_0x5e5802[_0xf16b('0x6')]['message']);}else{return _0x2c4838(_0x5e5802[_0xf16b('0x7')]);}})[_0xf16b('0x8')](function(_0x2cff6f){return _0x1cb7b6(_0x2cff6f);});});}exports[_0xf16b('0x9')]=function(_0x1293f3){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x1293f3},'attributes':[_0xf16b('0xa')]}});};exports[_0xf16b('0xb')]=function(_0x42ddec){return request(_0xf16b('0xc'),{'options':{'raw':![],'where':{'id':_0x42ddec},'include':[{'model':'MailServerOut','as':_0xf16b('0xd')}],'attributes':['id',_0xf16b('0xe'),_0xf16b('0xf')]}});};exports[_0xf16b('0x10')]=function(_0x25a640){return request(_0xf16b('0x11'),{'options':{'where':{'id':_0x25a640},'attributes':[_0xf16b('0xe')]}});};exports['getVoiceQueueById']=function(_0xd34098){return request(_0xf16b('0x12'),{'options':{'where':{'id':_0xd34098},'attributes':['name']}});};exports[_0xf16b('0x13')]=function(_0xb0e83b){return request('ShowVariable',{'options':{'where':{'id':_0xb0e83b},'attributes':['name']}});};exports[_0xf16b('0x14')]=function(_0x57512e){return request(_0xf16b('0x15'),{'options':{'where':{'id':_0x57512e},'attributes':[_0xf16b('0x16')]}});};exports[_0xf16b('0x17')]=function(_0x2a3bf2){return request(_0xf16b('0x18'),{'options':{'where':{'id':_0x2a3bf2},'attributes':['name']}});};exports['getTrunkById']=function(_0x55e672){return request(_0xf16b('0x19'),{'options':{'where':{'id':_0x55e672},'attributes':[_0xf16b('0xe')]}});};exports[_0xf16b('0x1a')]=function(_0x23e985){return request(_0xf16b('0x1b'),{'options':{'where':{'id':_0x23e985},'attributes':[_0xf16b('0x1c')]}});};exports['getIntervalById']=function(_0x5f2f74){return request(_0xf16b('0x1d'),{'options':{'raw':![],'where':{'id':_0x5f2f74},'include':[{'model':'Interval','as':_0xf16b('0x1e')}]}});};exports[_0xf16b('0x1f')]=function(_0x349f22){return request('ShowSmsAccount',{'options':{'where':{'id':_0x349f22},'attributes':['id',_0xf16b('0xe')]}});};exports[_0xf16b('0x20')]=function(_0x5bb500){return request(_0xf16b('0x21'),{'body':_0x5bb500});};exports['createSquareDetailsReport']=function(_0x43a488){return request('CreateSquareDetailsReport',{'body':_0x43a488});};exports[_0xf16b('0x22')]=function(_0x249db3){return request(_0xf16b('0x23'),{'body':_['merge'](_0x249db3,{'project_name':_0x249db3['arg_1'],'prev_project_name':_0x249db3[_0xf16b('0x24')]||'','is_subproject':_0x249db3[_0xf16b('0x24')]?!![]:![],'leaveAt':moment()[_0xf16b('0x25')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xf16b('0x26')]=function(_0x217eed){return request(_0xf16b('0x27'),{'body':_0x217eed});};exports[_0xf16b('0x28')]=function(_0x35b0fa){return request(_0xf16b('0x29'),{'body':_0x35b0fa});};exports['createCmContact']=function(_0x5b87a8){return request(_0xf16b('0x2a'),{'options':{'raw':![],'where':{'phone':_0x5b87a8[_0xf16b('0x2b')],'ListId':_0x5b87a8[_0xf16b('0x2c')]}}})[_0xf16b('0x5')](function(_0x171ea9){if(_0x171ea9){return _0x171ea9;}return request('CreateCmContact',{'body':_0x5b87a8});});};exports[_0xf16b('0x2d')]=function(_0x138d1a){return request('ShowPause',{'options':{'where':{'id':_0x138d1a},'attributes':[_0xf16b('0xe')]}});};exports[_0xf16b('0x2e')]=function(_0x54b4d7,_0x325205){return request(_0xf16b('0x2f'),{'body':{'interface':_0x325205},'options':{'where':_0x54b4d7}});};exports[_0xf16b('0x30')]=function(_0xcfca56,_0x290627,_0x18eb13){return request(_0xf16b('0x31'),{'body':{'type':_0x290627,'uniqueid':_0x18eb13},'options':{'where':_0xcfca56}});};exports['agentUnpause']=function(_0x16a1ea){return request(_0xf16b('0x32'),{'body':{},'options':{'where':_0x16a1ea}});};exports[_0xf16b('0x33')]=function(_0x4514c7){return request(_0xf16b('0x34'),{'body':{},'options':{'where':_0x4514c7}});}; \ No newline at end of file +var _0xab06=['util','jayson/promise','client','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','name','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentLogout','LogoutUser','moment'];(function(_0x33feca,_0x2bd9ae){var _0x3c558f=function(_0x11bede){while(--_0x11bede){_0x33feca['push'](_0x33feca['shift']());}};_0x3c558f(++_0x2bd9ae);}(_0xab06,0x1e7));var _0x6ab0=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xab06[_0x15c421];return _0x5e5ed5;};'use strict';var BPromise=require('bluebird');var moment=require(_0x6ab0('0x0'));var _=require('lodash');var util=require(_0x6ab0('0x1'));var jayson=require(_0x6ab0('0x2'));var client=jayson[_0x6ab0('0x3')]['http']({'port':0x2329});function request(_0x48cfcd,_0x330d7d){return new BPromise(function(_0x36604c,_0x35ada1){return client[_0x6ab0('0x4')](_0x48cfcd,_0x330d7d)[_0x6ab0('0x5')](function(_0x5e569f){if(_0x5e569f[_0x6ab0('0x6')]){return _0x35ada1(_0x5e569f[_0x6ab0('0x6')][_0x6ab0('0x7')]);}else{return _0x36604c(_0x5e569f[_0x6ab0('0x8')]);}})[_0x6ab0('0x9')](function(_0x174457){return _0x35ada1(_0x174457);});});}exports[_0x6ab0('0xa')]=function(_0x4ec2db){return request(_0x6ab0('0xb'),{'options':{'raw':![],'where':{'name':_0x4ec2db},'attributes':[_0x6ab0('0xc')]}});};exports[_0x6ab0('0xd')]=function(_0x1ab0e8){return request(_0x6ab0('0xe'),{'options':{'raw':![],'where':{'id':_0x1ab0e8},'include':[{'model':'MailServerOut','as':_0x6ab0('0xf')}],'attributes':['id','name',_0x6ab0('0x10')]}});};exports[_0x6ab0('0x11')]=function(_0x39c52f){return request(_0x6ab0('0xb'),{'options':{'where':{'id':_0x39c52f},'attributes':['name']}});};exports[_0x6ab0('0x12')]=function(_0x321e32){return request(_0x6ab0('0x13'),{'options':{'where':{'id':_0x321e32},'attributes':[_0x6ab0('0x14')]}});};exports[_0x6ab0('0x15')]=function(_0x51ba7d){return request(_0x6ab0('0x16'),{'options':{'where':{'id':_0x51ba7d},'attributes':[_0x6ab0('0x14')]}});};exports[_0x6ab0('0x17')]=function(_0x1547d1){return request(_0x6ab0('0x18'),{'options':{'where':{'id':_0x1547d1},'attributes':['dsn']}});};exports[_0x6ab0('0x19')]=function(_0x4af500){return request(_0x6ab0('0x1a'),{'options':{'where':{'id':_0x4af500},'attributes':[_0x6ab0('0x14')]}});};exports[_0x6ab0('0x1b')]=function(_0x345a07){return request(_0x6ab0('0x1c'),{'options':{'where':{'id':_0x345a07},'attributes':['name']}});};exports['getSoundById']=function(_0x47e35b){return request(_0x6ab0('0x1d'),{'options':{'where':{'id':_0x47e35b},'attributes':[_0x6ab0('0x1e')]}});};exports[_0x6ab0('0x1f')]=function(_0xd33834){return request(_0x6ab0('0x20'),{'options':{'raw':![],'where':{'id':_0xd33834},'include':[{'model':_0x6ab0('0x21'),'as':_0x6ab0('0x22')}]}});};exports[_0x6ab0('0x23')]=function(_0x5cfd18){return request(_0x6ab0('0x24'),{'options':{'where':{'id':_0x5cfd18},'attributes':['id',_0x6ab0('0x14')]}});};exports[_0x6ab0('0x25')]=function(_0x26a88d){return request(_0x6ab0('0x26'),{'body':_0x26a88d});};exports[_0x6ab0('0x27')]=function(_0x1e3115){return request(_0x6ab0('0x28'),{'body':_0x1e3115});};exports[_0x6ab0('0x29')]=function(_0x127a7f){return request(_0x6ab0('0x2a'),{'body':_[_0x6ab0('0x2b')](_0x127a7f,{'project_name':_0x127a7f['arg_1'],'prev_project_name':_0x127a7f[_0x6ab0('0x2c')]||'','is_subproject':_0x127a7f['arg_2']?!![]:![],'leaveAt':moment()[_0x6ab0('0x2d')](_0x6ab0('0x2e'))})});};exports[_0x6ab0('0x2f')]=function(_0x41b955){return request(_0x6ab0('0x30'),{'body':_0x41b955});};exports['createSquareMessage']=function(_0x27dc6a){return request(_0x6ab0('0x31'),{'body':_0x27dc6a});};exports[_0x6ab0('0x32')]=function(_0x40e6a3){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x40e6a3[_0x6ab0('0x33')],'ListId':_0x40e6a3[_0x6ab0('0x34')]}}})[_0x6ab0('0x5')](function(_0x3c8d37){if(_0x3c8d37){return _0x3c8d37;}return request(_0x6ab0('0x35'),{'body':_0x40e6a3});});};exports['getPauseById']=function(_0x5c800a){return request(_0x6ab0('0x36'),{'options':{'where':{'id':_0x5c800a},'attributes':[_0x6ab0('0x14')]}});};exports[_0x6ab0('0x37')]=function(_0x5e1bde,_0x415b5e){return request(_0x6ab0('0x38'),{'body':{'interface':_0x415b5e},'options':{'where':_0x5e1bde}});};exports[_0x6ab0('0x39')]=function(_0xb5270a,_0x4c6a5b,_0x91593a){return request(_0x6ab0('0x3a'),{'body':{'type':_0x4c6a5b,'uniqueid':_0x91593a},'options':{'where':_0xb5270a}});};exports['agentUnpause']=function(_0x3ff901){return request('UnpauseUser',{'body':{},'options':{'where':_0x3ff901}});};exports[_0x6ab0('0x3b')]=function(_0x28ca51){return request(_0x6ab0('0x3c'),{'body':{},'options':{'where':_0x28ca51}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index 484ce4f..136120e 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72b1=['./polly','exports'];(function(_0x778a34,_0xb4f3d3){var _0x4b956f=function(_0x33410e){while(--_0x33410e){_0x778a34['push'](_0x778a34['shift']());}};_0x4b956f(++_0xb4f3d3);}(_0x72b1,0x16e));var _0x172b=function(_0x498c15,_0xce08c4){_0x498c15=_0x498c15-0x0;var _0x36849c=_0x72b1[_0x498c15];return _0x36849c;};var polly=require(_0x172b('0x0'));var lex=require('./lex');module[_0x172b('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xb66c=['exports','./polly'];(function(_0x51bccf,_0xb9e7d4){var _0x1c373f=function(_0x809e6f){while(--_0x809e6f){_0x51bccf['push'](_0x51bccf['shift']());}};_0x1c373f(++_0xb9e7d4);}(_0xb66c,0x175));var _0xcb66=function(_0x393aa4,_0x4277cd){_0x393aa4=_0x393aa4-0x0;var _0x3b1cfb=_0xb66c[_0x393aa4];return _0x3b1cfb;};var polly=require(_0xcb66('0x0'));var lex=require('./lex');module[_0xcb66('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 2fe422d..b68c974 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2333=['./lib/api','exports'];(function(_0x3b2f18,_0x247d53){var _0x54d69f=function(_0x44455d){while(--_0x44455d){_0x3b2f18['push'](_0x3b2f18['shift']());}};_0x54d69f(++_0x247d53);}(_0x2333,0x11a));var _0x3233=function(_0x921591,_0x99b2a6){_0x921591=_0x921591-0x0;var _0x42c53c=_0x2333[_0x921591];return _0x42c53c;};'use strict';var lex=require(_0x3233('0x0'));module[_0x3233('0x1')]=function(_0x4c4ec0,_0x50fe9b,_0x170ef4,_0x42ef73,_0x5a8145,_0x8fdc58){return lex(_0x4c4ec0,_0x50fe9b,_0x170ef4,_0x42ef73,_0x5a8145,_0x8fdc58);}; \ No newline at end of file +var _0xee39=['./lib/api','exports'];(function(_0x5f1e9b,_0x779430){var _0x954e8c=function(_0x127e49){while(--_0x127e49){_0x5f1e9b['push'](_0x5f1e9b['shift']());}};_0x954e8c(++_0x779430);}(_0xee39,0x1e6));var _0x9ee3=function(_0x267403,_0x2d2010){_0x267403=_0x267403-0x0;var _0x459319=_0xee39[_0x267403];return _0x459319;};'use strict';var lex=require(_0x9ee3('0x0'));module[_0x9ee3('0x1')]=function(_0xe604cf,_0x58cf62,_0x39e617,_0x64784f,_0x18357f,_0x3cdeaf){return lex(_0xe604cf,_0x58cf62,_0x39e617,_0x64784f,_0x18357f,_0x3cdeaf);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index da38b11..648e49c 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca1c=['exports','LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xca1c,0x186));var _0xcca1=function(_0x49bff5,_0x548582){_0x49bff5=_0x49bff5-0x0;var _0x2411cc=_0xca1c[_0x49bff5];return _0x2411cc;};'use strict';var BPromise=require(_0xcca1('0x0'));var AWS=require(_0xcca1('0x1'));function lexResult(_0x3a978f,_0x18f201){return new BPromise(function(_0x3d3f01,_0x3f4c05){_0x3a978f[_0xcca1('0x2')](_0x18f201,function(_0x5b61af,_0x49a078){if(_0x5b61af){_0x3f4c05(_0x5b61af);}if(_0x49a078[_0xcca1('0x3')]){for(const _0x2d22b8 in _0x49a078['slots']){if(_0x49a078[_0xcca1('0x3')][_0xcca1('0x4')](_0x2d22b8)){var _0x2baf96=_0x49a078[_0xcca1('0x3')][_0x2d22b8];_0x49a078[_0xcca1('0x5')+_0x2d22b8]=_0x2baf96;}}}_0x3d3f01(_0x49a078);});});}module[_0xcca1('0x6')]=function(_0xb01d98,_0x4544ae,_0x37b7a2,_0x520f0e,_0x41e56f,_0x341397){var _0x2cd0d9=new AWS[(_0xcca1('0x7'))]({'accessKeyId':_0x4544ae,'secretAccessKey':_0x37b7a2,'region':_0x520f0e});var _0x26bc72={'botAlias':_0xcca1('0x8'),'botName':_0x341397,'inputText':_0x41e56f,'userId':_0xb01d98};return lexResult(_0x2cd0d9,_0x26bc72);}; \ No newline at end of file +var _0x5268=['slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','aws-sdk','postText'];(function(_0x25db8c,_0x1e873e){var _0x383de0=function(_0x487208){while(--_0x487208){_0x25db8c['push'](_0x25db8c['shift']());}};_0x383de0(++_0x1e873e);}(_0x5268,0xbe));var _0x8526=function(_0x592bb8,_0x46ae06){_0x592bb8=_0x592bb8-0x0;var _0x4cb2d0=_0x5268[_0x592bb8];return _0x4cb2d0;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x8526('0x0'));function lexResult(_0x1945b8,_0xbde3dc){return new BPromise(function(_0x43bf7d,_0x4e2c04){_0x1945b8[_0x8526('0x1')](_0xbde3dc,function(_0x244a2b,_0x1d9f87){if(_0x244a2b){_0x4e2c04(_0x244a2b);}if(_0x1d9f87[_0x8526('0x2')]){for(const _0x3d21a4 in _0x1d9f87[_0x8526('0x2')]){if(_0x1d9f87[_0x8526('0x2')][_0x8526('0x3')](_0x3d21a4)){var _0x44cfe1=_0x1d9f87['slots'][_0x3d21a4];_0x1d9f87[_0x8526('0x4')+_0x3d21a4]=_0x44cfe1;}}}_0x43bf7d(_0x1d9f87);});});}module[_0x8526('0x5')]=function(_0x1b5add,_0x27eaf3,_0x2ad4cb,_0x2fc478,_0x151de7,_0x4da318){var _0x579d0a=new AWS[(_0x8526('0x6'))]({'accessKeyId':_0x27eaf3,'secretAccessKey':_0x2ad4cb,'region':_0x2fc478});var _0x14b332={'botAlias':_0x8526('0x7'),'botName':_0x4da318,'inputText':_0x151de7,'userId':_0x1b5add};return lexResult(_0x579d0a,_0x14b332);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index e796244..e0a2680 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0dd=['./lib/api'];(function(_0x4e6677,_0x54dc14){var _0x3a1ee3=function(_0x44b24d){while(--_0x44b24d){_0x4e6677['push'](_0x4e6677['shift']());}};_0x3a1ee3(++_0x54dc14);}(_0xf0dd,0x84));var _0xdf0d=function(_0x561d9f,_0x447dea){_0x561d9f=_0x561d9f-0x0;var _0x4ecca0=_0xf0dd[_0x561d9f];return _0x4ecca0;};'use strict';var polly=require(_0xdf0d('0x0'));module['exports']=function(_0x354ac4,_0x1786d4,_0x4f80f4,_0x249ce3,_0x4e5302,_0x1064e9,_0x3f5427){return polly(_0x354ac4,_0x1786d4,_0x4f80f4,_0x249ce3,_0x4e5302,_0x1064e9,_0x3f5427);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x12c02b,_0x32f041,_0x18714b,_0x46db7d,_0x359f01,_0x3fe215,_0x3052ca){return polly(_0x12c02b,_0x32f041,_0x18714b,_0x46db7d,_0x359f01,_0x3fe215,_0x3052ca);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index 122cc8e..748e88c 100644 --- a/server/services/agi/scripts/aws/polly/lib/api.js +++ b/server/services/agi/scripts/aws/polly/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2251=['text','mp3','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x87d5af,_0x1c6fef){var _0xb4cc04=function(_0x1b7bd8){while(--_0x1b7bd8){_0x87d5af['push'](_0x87d5af['shift']());}};_0xb4cc04(++_0x1c6fef);}(_0x2251,0x1ce));var _0x1225=function(_0x26a6f6,_0x2d91f2){_0x26a6f6=_0x26a6f6-0x0;var _0x9a6a4f=_0x2251[_0x26a6f6];return _0x9a6a4f;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x1225('0x0'));var rs=require(_0x1225('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x4f199a,_0xdf19e9,_0x478967){return new BPromise(function(_0x50efd0,_0x169b95){_0x4f199a[_0x1225('0x2')](_0xdf19e9,function(_0x17d964,_0x391d42){if(_0x17d964){_0x169b95(_0x17d964);}else if(_0x391d42){if(_0x391d42[_0x1225('0x3')]instanceof Buffer){fs[_0x1225('0x4')](_0x478967,_0x391d42['AudioStream'],function(_0x309be5){if(_0x309be5){_0x169b95(_0x309be5);}else{_0x50efd0();}});}else{_0x169b95(new Error(_0x1225('0x5')));}}else{_0x169b95(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x1225('0x6')]=function(_0x38a4c3,_0x25c9fe,_0x581b4c,_0x14f8ed,_0x466f0a,_0xe61d0c,_0x598c4f){var _0x16b011=new AWS[(_0x1225('0x7'))]({'accessKeyId':_0x38a4c3,'secretAccessKey':_0x25c9fe,'region':_0x581b4c});var _0x3c4796={'Text':_0x466f0a,'TextType':_0xe61d0c||_0x1225('0x8'),'OutputFormat':_0x1225('0x9'),'VoiceId':_0x14f8ed};return pollyResult(_0x16b011,_0x3c4796,_0x598c4f);}; \ No newline at end of file +var _0x9afa=['path','bluebird','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x9afa,0x140));var _0xa9af=function(_0x3f5152,_0xd0d0da){_0x3f5152=_0x3f5152-0x0;var _0x545570=_0x9afa[_0x3f5152];return _0x545570;};'use strict';var fs=require('fs');var path=require(_0xa9af('0x0'));var BPromise=require(_0xa9af('0x1'));var rs=require('randomstring');var AWS=require(_0xa9af('0x2'));function pollyResult(_0x2f1e31,_0x1eaae1,_0x365240){return new BPromise(function(_0x5cbbbf,_0x4c3a74){_0x2f1e31['synthesizeSpeech'](_0x1eaae1,function(_0xc7d3ee,_0x5f23db){if(_0xc7d3ee){_0x4c3a74(_0xc7d3ee);}else if(_0x5f23db){if(_0x5f23db['AudioStream']instanceof Buffer){fs['writeFile'](_0x365240,_0x5f23db[_0xa9af('0x3')],function(_0x25acc0){if(_0x25acc0){_0x4c3a74(_0x25acc0);}else{_0x5cbbbf();}});}else{_0x4c3a74(new Error(_0xa9af('0x4')));}}else{_0x4c3a74(new Error(_0xa9af('0x5')));}});});}module[_0xa9af('0x6')]=function(_0x3dec3b,_0x29f2fc,_0x58473f,_0x4dad67,_0x5db2ce,_0x2d367a,_0x579ca6){var _0x3257c5=new AWS[(_0xa9af('0x7'))]({'accessKeyId':_0x3dec3b,'secretAccessKey':_0x29f2fc,'region':_0x58473f});var _0x51b5f3={'Text':_0x5db2ce,'TextType':_0x2d367a||_0xa9af('0x8'),'OutputFormat':_0xa9af('0x9'),'VoiceId':_0x4dad67};return pollyResult(_0x3257c5,_0x51b5f3,_0x579ca6);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index aebb5a2..4219019 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa801=['exports','./lib/api'];(function(_0xe1269d,_0x57b7c3){var _0x261ca1=function(_0x13b234){while(--_0x13b234){_0xe1269d['push'](_0xe1269d['shift']());}};_0x261ca1(++_0x57b7c3);}(_0xa801,0x95));var _0x1a80=function(_0x103c33,_0x4d425a){_0x103c33=_0x103c33-0x0;var _0x35ee6e=_0xa801[_0x103c33];return _0x35ee6e;};'use strict';var asr=require(_0x1a80('0x0'));module[_0x1a80('0x1')]=function(_0xf2109d,_0x1ff74a,_0x5f17ca,_0x50dd2f){return asr(_0xf2109d,_0x1ff74a,_0x5f17ca);}; \ No newline at end of file +var _0xcc93=['exports','./lib/api'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xcc93,0x1bd));var _0x3cc9=function(_0x161713,_0x5e6507){_0x161713=_0x161713-0x0;var _0x33c142=_0xcc93[_0x161713];return _0x33c142;};'use strict';var asr=require(_0x3cc9('0x0'));module[_0x3cc9('0x1')]=function(_0x388fd7,_0x5344d8,_0x5e5bd7,_0x183d20){return asr(_0x388fd7,_0x5344d8,_0x5e5bd7);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index b1e17b5..b40f39f 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x626e=['exports','string','length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com'];(function(_0x1a02f2,_0x15c282){var _0x45eaa2=function(_0x3c0821){while(--_0x3c0821){_0x1a02f2['push'](_0x1a02f2['shift']());}};_0x45eaa2(++_0x15c282);}(_0x626e,0x1a2));var _0xe626=function(_0x38f5f3,_0x16d6d1){_0x38f5f3=_0x38f5f3-0x0;var _0x19a716=_0x626e[_0x38f5f3];return _0x19a716;};'use strict';var url=require('url');var BPromise=require(_0xe626('0x0'));var fs=require('fs');var host=_0xe626('0x1');module[_0xe626('0x2')]=function(_0x592aa0,_0x2dab22,_0x104eec){return new BPromise(function(_0x2218c7,_0x2a7fa9){var _0x2f8b1d;if(typeof _0x592aa0!==_0xe626('0x3')||_0x592aa0[_0xe626('0x4')]===0x0){return _0x2a7fa9('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2dab22!==_0xe626('0x3')||_0x2dab22['length']===0x0){return _0x2a7fa9(_0xe626('0x5'));}if(typeof _0x104eec!==_0xe626('0x6')&&(typeof _0x104eec!==_0xe626('0x3')||_0x104eec[_0xe626('0x4')]===0x0)){return _0x2a7fa9('lang\x20should\x20be\x20a\x20string');}try{_0x2f8b1d=fs[_0xe626('0x7')](_0x592aa0)[_0xe626('0x8')]('base64');}catch(_0x3a156d){return _0x2a7fa9(_0x3a156d);}return _0x2218c7({'method':'POST','uri':host+_0xe626('0x9')+_0x2dab22,'body':{'config':{'encoding':_0xe626('0xa'),'sampleRateHertz':_0xe626('0xb'),'languageCode':_0x104eec},'audio':{'content':_0x2f8b1d}},'json':!![]});});}; \ No newline at end of file +var _0xab58=['filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x31283a,_0x26fee3){var _0x17aa2a=function(_0x3e50cf){while(--_0x3e50cf){_0x31283a['push'](_0x31283a['shift']());}};_0x17aa2a(++_0x26fee3);}(_0xab58,0xec));var _0x8ab5=function(_0x478e59,_0x5b3e60){_0x478e59=_0x478e59-0x0;var _0x1362fc=_0xab58[_0x478e59];return _0x1362fc;};'use strict';var url=require(_0x8ab5('0x0'));var BPromise=require(_0x8ab5('0x1'));var fs=require('fs');var host=_0x8ab5('0x2');module[_0x8ab5('0x3')]=function(_0x23420b,_0x2e2b98,_0x5d6761){return new BPromise(function(_0x598ccb,_0x3ecf82){var _0x27058b;if(typeof _0x23420b!=='string'||_0x23420b['length']===0x0){return _0x3ecf82(_0x8ab5('0x4'));}if(typeof _0x2e2b98!==_0x8ab5('0x5')||_0x2e2b98[_0x8ab5('0x6')]===0x0){return _0x3ecf82(_0x8ab5('0x7'));}if(typeof _0x5d6761!==_0x8ab5('0x8')&&(typeof _0x5d6761!=='string'||_0x5d6761['length']===0x0)){return _0x3ecf82(_0x8ab5('0x9'));}try{_0x27058b=fs[_0x8ab5('0xa')](_0x23420b)[_0x8ab5('0xb')](_0x8ab5('0xc'));}catch(_0x2fd168){return _0x3ecf82(_0x2fd168);}return _0x598ccb({'method':'POST','uri':host+_0x8ab5('0xd')+_0x2e2b98,'body':{'config':{'encoding':_0x8ab5('0xe'),'sampleRateHertz':_0x8ab5('0xf'),'languageCode':_0x5d6761},'audio':{'content':_0x27058b}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 67e18ec..10cb4be 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68fb=['exports'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x68fb,0x1d1));var _0xb68f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68fb[_0x3dd15e];return _0x231fd0;};var asr=require('./asr');module[_0xb68f('0x0')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 12e56c3..f435f55 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb764=['chmodSync','googleCloudTTS\x20path','.mp3','goggleTTS\x20path','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','speech','code','metadata','isFallbackIntent','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','https','url','parse','bluebird','randomstring','sox','request-promise','querystring','google-tts-api','md5','./google','./sestek','../../../config/logger','agi','protocol','https:','host','path','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','info','download\x20error','pipe','end','WHAT_EVER','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','base64','then','unlink','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','generate','from','audioContent','writeFile'];(function(_0x35a708,_0x514413){var _0x1dce9d=function(_0x5ebd35){while(--_0x5ebd35){_0x35a708['push'](_0x35a708['shift']());}};_0x1dce9d(++_0x514413);}(_0xb764,0x1c2));var _0x4b76=function(_0x5b11bb,_0x33bd53){_0x5b11bb=_0x5b11bb-0x0;var _0x1c105f=_0xb764[_0x5b11bb];return _0x1c105f;};'use strict';var fs=require('fs');var path=require('path');var http=require('http');var https=require(_0x4b76('0x0'));var urlParse=require(_0x4b76('0x1'))[_0x4b76('0x2')];var BPromise=require(_0x4b76('0x3'));var rs=require(_0x4b76('0x4'));var sox=require(_0x4b76('0x5'));var rp=require(_0x4b76('0x6'));var util=require('util');var querystring=require(_0x4b76('0x7'));var tts=require(_0x4b76('0x8'));var apiai=require('apiai-promise');var md5=require(_0x4b76('0x9'));var google=require(_0x4b76('0xa'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x4b76('0xb'));var logger=require(_0x4b76('0xc'))(_0x4b76('0xd'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x3678dc,_0x5bfe2b){return new BPromise(function(_0x59060e,_0x557656){var _0x4b4f4d=urlParse(_0x3678dc);var _0x54624f=_0x4b4f4d[_0x4b76('0xe')]===_0x4b76('0xf')?https:http;var _0x51702f={'host':_0x4b4f4d[_0x4b76('0x10')],'path':_0x4b4f4d[_0x4b76('0x11')],'headers':{'user-agent':'WHAT_EVER'}};_0x54624f[_0x4b76('0x12')](_0x51702f,function(_0x47628c){if(_0x47628c[_0x4b76('0x13')]!==0xc8){logger[_0x4b76('0x14')](_0x4b76('0x15')+_0x3678dc+_0x4b76('0x16')+_0x47628c['statusCode']+'\x20('+_0x47628c[_0x4b76('0x17')]+')');_0x557656(new Error('request\x20to\x20'+_0x3678dc+_0x4b76('0x16')+_0x47628c[_0x4b76('0x13')]+'\x20('+_0x47628c['statusMessage']+')'));return;}var _0x3c76bc=fs['createWriteStream'](_0x5bfe2b);_0x3c76bc['on']('finish',function(){logger[_0x4b76('0x18')]('finish\x20download\x20file');_0x3c76bc['close'](_0x59060e);});_0x3c76bc['on'](_0x4b76('0x14'),function(_0x152b73){fs['unlink'](_0x5bfe2b);logger[_0x4b76('0x14')](_0x4b76('0x19'),_0x152b73);_0x557656(_0x152b73);});_0x47628c[_0x4b76('0x1a')](_0x3c76bc);})['on'](_0x4b76('0x14'),function(_0xc631fe){logger[_0x4b76('0x14')](_0xc631fe);_0x557656(_0xc631fe);})[_0x4b76('0x1b')]();});}function uploadFile(_0x178fb5){return new BPromise(function(_0x2d4213,_0x3f581c){var _0x576a8b=urlParse(_0x178fb5);var _0x5372ff=_0x576a8b[_0x4b76('0xe')]===_0x4b76('0xf')?https:http;var _0x2234b9={'host':_0x576a8b['host'],'path':_0x576a8b['path'],'headers':{'user-agent':_0x4b76('0x1c')}};_0x5372ff[_0x4b76('0x12')](_0x2234b9,function(_0x3c629a){if(_0x3c629a[_0x4b76('0x13')]!==0xc8){_0x3f581c(new Error(_0x4b76('0x15')+_0x178fb5+'\x20failed,\x20status\x20code\x20=\x20'+_0x3c629a['statusCode']+'\x20('+_0x3c629a[_0x4b76('0x17')]+')'));return;}var _0x48e243='';_0x3c629a['on']('data',function(_0x46846a){_0x48e243+=_0x46846a;});_0x3c629a['on'](_0x4b76('0x1b'),function(){_0x2d4213(_0x48e243);});})['on'](_0x4b76('0x14'),function(_0x305536){_0x3f581c(_0x305536);})[_0x4b76('0x1b')]();});}function convertFile(_0x46d459,_0x3062ec){return new BPromise(function(_0x451900,_0x57c448){var _0xb7677a=sox['transcode'](_0x46d459,_0x3062ec,{'sampleRate':0x1f40,'format':_0x4b76('0x1d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xb7677a['on']('error',function(_0x13aa1a){logger[_0x4b76('0x14')](_0x4b76('0x1e'),_0x13aa1a);_0x57c448(_0x13aa1a);});_0xb7677a['on']('end',function(){logger[_0x4b76('0x18')](_0x4b76('0x1f'));_0x451900();});_0xb7677a[_0x4b76('0x20')]();});}function base64Decode(_0x4de587,_0x4dda52){var _0x416c84=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs['generate'](0x4)+_0x4b76('0x23'));fs['writeFileSync'](_0x416c84,_0x4de587,_0x4b76('0x24'));return convertFile(_0x416c84,_0x4dda52)[_0x4b76('0x25')](function(){try{fs[_0x4b76('0x26')](_0x416c84);fs['chmodSync'](_0x4dda52,_0x4b76('0x27'));}catch(_0x4e5826){logger[_0x4b76('0x14')](_0x4e5826);}return _0x4dda52[_0x4b76('0x28')]('.')[0x0];});}function base64Encode(_0x171271){var _0x10e10e=fs[_0x4b76('0x29')](_0x171271);return new Buffer(_0x10e10e)[_0x4b76('0x2a')](_0x4b76('0x24'));}exports[_0x4b76('0x2b')]=function(_0x35827d,_0x254106,_0x838e35,_0x56a72b,_0x1154aa,_0x5018d4){var _0x4ab9a,_0x450c51;var _0xae1c2d=_0x4b76('0x2c');var _0x5a3a77=_0x4b76('0x2d')+_0x35827d;var _0xc680cb={};if(_0x254106===_0x4b76('0x2e')){_0xc680cb['input']={'ssml':_0x838e35};}else{_0xc680cb[_0x4b76('0x2f')]={'text':_0x838e35};};_0xc680cb['voice']={'languageCode':_0x56a72b,'ssmlGender':_0x1154aa};_0xc680cb[_0x4b76('0x30')]={'audioEncoding':_0x4b76('0x31'),'sampleRateHertz':0x1f40};var _0xaadc27={'url':_0xae1c2d+_0x4b76('0x32')+_0x5a3a77,'method':'POST','json':!![],'body':_0xc680cb};return rp(_0xaadc27)[_0x4b76('0x25')](function(_0x14f6c3){return new BPromise(function(_0xc256f2,_0x5be49d){_0x4ab9a=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs[_0x4b76('0x33')](0x4)+'.mp3');var _0x260f27=Buffer[_0x4b76('0x34')](_0x14f6c3[_0x4b76('0x35')],'base64');return fs[_0x4b76('0x36')](_0x4ab9a,_0x260f27,function(_0x178be8){_0x5be49d(_0x178be8);},function(_0x91ea06){fs[_0x4b76('0x37')](_0x4ab9a,'777');_0xc256f2(_0x91ea06);});});})[_0x4b76('0x25')](function(_0x2d0fae){_0x450c51=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs['generate'](0x4)+_0x4b76('0x23'));return convertFile(_0x4ab9a,_0x450c51);})[_0x4b76('0x25')](function(){try{fs[_0x4b76('0x26')](_0x4ab9a);fs[_0x4b76('0x37')](_0x450c51,_0x4b76('0x27'));}catch(_0x3d8dad){logger[_0x4b76('0x14')](_0x3d8dad);}logger[_0x4b76('0x18')](_0x4b76('0x38'),_0x450c51[_0x4b76('0x28')]('.')[0x0]);return _0x450c51[_0x4b76('0x28')]('.')[0x0];});};exports['googleTTS']=function(_0x3657c6,_0x411dda){var _0x7287d5,_0x401218;return tts(_0x3657c6,_0x411dda||'en',0x1)['then'](function(_0x465e0b){logger[_0x4b76('0x18')](_0x465e0b);_0x7287d5=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs['generate'](0x4)+_0x4b76('0x39'));return downloadFile(_0x465e0b,_0x7287d5);})[_0x4b76('0x25')](function(){_0x401218=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs['generate'](0x4)+_0x4b76('0x23'));return convertFile(_0x7287d5,_0x401218);})[_0x4b76('0x25')](function(){try{fs['unlink'](_0x7287d5);fs['chmodSync'](_0x401218,_0x4b76('0x27'));}catch(_0x4654e4){logger[_0x4b76('0x14')](_0x4654e4);}logger['info'](_0x4b76('0x3a'),_0x401218[_0x4b76('0x28')]('.')[0x0]);return _0x401218[_0x4b76('0x28')]('.')[0x0];});};exports['googleASR']=function(_0x42ba14,_0x35b147,_0x2be535){return google['asr'](_0x42ba14,_0x35b147,_0x2be535)['then'](function(_0x44f2c0){logger['info'](_0x44f2c0[_0x4b76('0x3b')]);return rp(_0x44f2c0);})['then'](function(_0x5f12fa){var _0x15d270='';var _0x4c85b2=0x0;try{fs[_0x4b76('0x26')](_0x42ba14);}catch(_0x42232b){logger['error'](_0x42232b);}if(_0x5f12fa&&_0x5f12fa[_0x4b76('0x3c')]){_0x15d270=_0x5f12fa[_0x4b76('0x3c')]['map'](function(_0x2d9254){return _0x2d9254&&_0x2d9254['alternatives'][0x0]&&_0x2d9254[_0x4b76('0x3d')][0x0][_0x4b76('0x3e')]?_0x2d9254[_0x4b76('0x3d')][0x0][_0x4b76('0x3e')]:'';})[_0x4b76('0x3f')]('\x0a');_0x4c85b2=_0x5f12fa[_0x4b76('0x3c')]['map'](function(_0x565b2c){return _0x565b2c&&_0x565b2c['alternatives'][0x0]&&_0x565b2c[_0x4b76('0x3d')][0x0][_0x4b76('0x40')]?_0x565b2c['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x4b76('0x18')](_0x4b76('0x41'),_0x15d270);logger[_0x4b76('0x18')]('googleASR\x20confidence',_0x4c85b2);return{'transcript':_0x15d270,'confidence':_0x4c85b2};})[_0x4b76('0x42')](function(_0x58733a){logger[_0x4b76('0x14')](_0x4b76('0x43'),_0x58733a['statusCode'],_0x58733a['name'],_0x58733a[_0x4b76('0x44')]);});};exports[_0x4b76('0x45')]=function(_0x2b55e4,_0x7bc113,_0x2ffacd,_0x267fcc){var _0x469555=apiai(_0x7bc113,{'language':_0x267fcc||'en'});return _0x469555[_0x4b76('0x46')](_0x2ffacd,{'sessionId':md5(_0x2b55e4)})[_0x4b76('0x25')](function(_0x4a38c4){logger[_0x4b76('0x18')](JSON[_0x4b76('0x47')](_0x4a38c4));return{'source':_0x4a38c4[_0x4b76('0x48')][_0x4b76('0x49')],'resolvedQuery':_0x4a38c4[_0x4b76('0x48')][_0x4b76('0x4a')],'action':_0x4a38c4['result'][_0x4b76('0x4b')],'actionIncomplete':_0x4a38c4[_0x4b76('0x48')]['actionIncomplete'],'speech':_0x4a38c4[_0x4b76('0x48')]['fulfillment'][_0x4b76('0x4c')],'score':_0x4a38c4[_0x4b76('0x48')]['score'],'statusCode':_0x4a38c4['status'][_0x4b76('0x4d')],'endConversation':_0x4a38c4['result'][_0x4b76('0x4e')]['endConversation']||![],'isFallbackIntent':_0x4a38c4[_0x4b76('0x48')]['metadata'][_0x4b76('0x4f')]};});};exports['tildeASR']=function(_0x50a455,_0x5dfef7,_0x234591,_0xda522a){return tilde[_0x4b76('0x50')](_0x50a455,_0x5dfef7,_0x234591,_0xda522a)['then'](function(_0x324252){try{fs[_0x4b76('0x26')](_0x50a455);}catch(_0xd5d4c9){logger[_0x4b76('0x14')](_0xd5d4c9);}logger[_0x4b76('0x18')](_0x4b76('0x51'),_0x324252[_0x4b76('0x3e')]);logger['info']('Tilde\x20ASR\x20confidence',_0x324252[_0x4b76('0x40')]);return _0x324252;});};exports[_0x4b76('0x52')]=function(_0x20987c,_0x12db62,_0x276071,_0x35f38d,_0x589f0f,_0xd26d7a){var _0x126415=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs[_0x4b76('0x33')](0x4)+_0x4b76('0x39'));var _0x564e94;return aws[_0x4b76('0x53')](_0x20987c,_0x12db62,_0x276071,_0x35f38d,_0x589f0f,_0xd26d7a,_0x126415)[_0x4b76('0x25')](function(){_0x564e94=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs[_0x4b76('0x33')](0x4)+_0x4b76('0x23'));return convertFile(_0x126415,_0x564e94);})[_0x4b76('0x25')](function(){try{fs[_0x4b76('0x26')](_0x126415);fs[_0x4b76('0x37')](_0x564e94,_0x4b76('0x27'));}catch(_0x3eb04d){logger[_0x4b76('0x14')](_0x3eb04d);}return _0x564e94[_0x4b76('0x28')]('.')[0x0];});};exports[_0x4b76('0x54')]=function(_0xa3fcbf,_0x331de8,_0x37bf44,_0x4fe05a,_0x4f2513,_0x472152){return aws[_0x4b76('0x55')](_0xa3fcbf,_0x331de8,_0x37bf44,_0x4fe05a,_0x4f2513,_0x472152)[_0x4b76('0x25')](function(_0x23f32b){logger['info'](JSON[_0x4b76('0x47')](_0x23f32b));return _0x23f32b;});};exports[_0x4b76('0x56')]=function(_0xf4191d,_0x2fe99c,_0x3803cb,_0x273399){var _0x4e8a2e=util[_0x4b76('0x57')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0xf4191d,encodeURIComponent(_0x2fe99c),_0x3803cb,_0x273399);var _0x55b166=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs[_0x4b76('0x33')](0x4)+_0x4b76('0x39'));var _0x13674a;return downloadFile(_0x4e8a2e,_0x55b166)['then'](function(){_0x13674a=path[_0x4b76('0x21')](__dirname,_0x4b76('0x22'),rs[_0x4b76('0x33')](0x4)+_0x4b76('0x23'));return convertFile(_0x55b166,_0x13674a);})[_0x4b76('0x25')](function(){try{fs[_0x4b76('0x26')](_0x55b166);fs[_0x4b76('0x37')](_0x13674a,_0x4b76('0x27'));}catch(_0xbe247c){logger[_0x4b76('0x14')](_0xbe247c);}return _0x13674a[_0x4b76('0x28')]('.')[0x0];});};exports[_0x4b76('0x58')]=function(_0x2da9b2,_0x1187e1,_0xb62fb4,_0x4c760f){var _0x419bc9=util[_0x4b76('0x57')](_0x4b76('0x59'),ISPEECH_API,_0x1187e1,_0xb62fb4,base64Encode(_0x2da9b2),_0x4c760f?util[_0x4b76('0x57')](_0x4b76('0x5a'),encodeURIComponent(_0x4c760f)):_0x4b76('0x5b'));return uploadFile(_0x419bc9)[_0x4b76('0x25')](function(_0x5092ee){return querystring[_0x4b76('0x2')](_0x5092ee);});};exports[_0x4b76('0x5c')]=function(_0x2396e8,_0x2d6172){return sestek[_0x4b76('0x5d')](_0x2396e8,_0x2d6172)[_0x4b76('0x25')](function(_0x565706){logger['info'](JSON[_0x4b76('0x47')](_0x565706));var _0x1a15c3={'speech':_0x565706['text'],'action':_0x565706[_0x4b76('0x5e')]?_0x565706[_0x4b76('0x5e')][_0x4b76('0x5f')]:undefined,'actiondata':_0x565706['channelData']?_0x565706['channelData'][_0x4b76('0x60')]:undefined};if(_0x565706[_0x4b76('0x5e')]&&_0x565706[_0x4b76('0x5e')][_0x4b76('0x61')]){return base64Decode(_0x565706[_0x4b76('0x5e')][_0x4b76('0x61')][_0x4b76('0x62')],path['resolve'](__dirname,'tmp',rs[_0x4b76('0x33')](0x4)+'.wav'))['then'](function(_0x24c1f4){_0x1a15c3[_0x4b76('0x63')]=_0x24c1f4;return _0x1a15c3;});}return _0x1a15c3;});};exports[_0x4b76('0x64')]=function(){return __dirname;}; \ No newline at end of file +var _0x38a7=['then','chmodSync','777','split','toString','googleCloudTTS','?key=','ssml','input','voice','MP3','text:synthesize','POST','resolve','tmp','.mp3','from','writeFile','googleCloudTTS\x20path','googleTTS','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','textRequest','stringify','result','source','action','fulfillment','score','status','code','metadata','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','path','http','https','bluebird','randomstring','sox','request-promise','querystring','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','protocol','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','end','https:','get','data','transcode','error\x20convert','finish\x20to\x20convert','start','generate','.wav','writeFileSync','base64'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x38a7,0xaa));var _0x738a=function(_0x1349a3,_0x4cbfce){_0x1349a3=_0x1349a3-0x0;var _0xbf5007=_0x38a7[_0x1349a3];return _0xbf5007;};'use strict';var fs=require('fs');var path=require(_0x738a('0x0'));var http=require(_0x738a('0x1'));var https=require(_0x738a('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x738a('0x3'));var rs=require(_0x738a('0x4'));var sox=require(_0x738a('0x5'));var rp=require(_0x738a('0x6'));var util=require('util');var querystring=require(_0x738a('0x7'));var tts=require('google-tts-api');var apiai=require('apiai-promise');var md5=require(_0x738a('0x8'));var google=require(_0x738a('0x9'));var aws=require(_0x738a('0xa'));var tilde=require(_0x738a('0xb'));var sestek=require(_0x738a('0xc'));var logger=require(_0x738a('0xd'))(_0x738a('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0xf3a6a8,_0x55008b){return new BPromise(function(_0xa05239,_0x19b1fc){var _0x5bdb4e=urlParse(_0xf3a6a8);var _0x72d8af=_0x5bdb4e[_0x738a('0xf')]==='https:'?https:http;var _0x77cf51={'host':_0x5bdb4e[_0x738a('0x10')],'path':_0x5bdb4e['path'],'headers':{'user-agent':_0x738a('0x11')}};_0x72d8af['get'](_0x77cf51,function(_0x595862){if(_0x595862[_0x738a('0x12')]!==0xc8){logger[_0x738a('0x13')](_0x738a('0x14')+_0xf3a6a8+_0x738a('0x15')+_0x595862[_0x738a('0x12')]+'\x20('+_0x595862[_0x738a('0x16')]+')');_0x19b1fc(new Error(_0x738a('0x14')+_0xf3a6a8+'\x20failed,\x20status\x20code\x20=\x20'+_0x595862[_0x738a('0x12')]+'\x20('+_0x595862[_0x738a('0x16')]+')'));return;}var _0x3d3619=fs['createWriteStream'](_0x55008b);_0x3d3619['on'](_0x738a('0x17'),function(){logger[_0x738a('0x18')](_0x738a('0x19'));_0x3d3619[_0x738a('0x1a')](_0xa05239);});_0x3d3619['on'](_0x738a('0x13'),function(_0x3d8c47){fs[_0x738a('0x1b')](_0x55008b);logger[_0x738a('0x13')]('download\x20error',_0x3d8c47);_0x19b1fc(_0x3d8c47);});_0x595862['pipe'](_0x3d3619);})['on']('error',function(_0x3761b8){logger[_0x738a('0x13')](_0x3761b8);_0x19b1fc(_0x3761b8);})[_0x738a('0x1c')]();});}function uploadFile(_0x2664f0){return new BPromise(function(_0x576fc7,_0x499d5b){var _0xb46e99=urlParse(_0x2664f0);var _0x247167=_0xb46e99[_0x738a('0xf')]===_0x738a('0x1d')?https:http;var _0x2aa1b9={'host':_0xb46e99[_0x738a('0x10')],'path':_0xb46e99[_0x738a('0x0')],'headers':{'user-agent':_0x738a('0x11')}};_0x247167[_0x738a('0x1e')](_0x2aa1b9,function(_0x2fa9f0){if(_0x2fa9f0[_0x738a('0x12')]!==0xc8){_0x499d5b(new Error(_0x738a('0x14')+_0x2664f0+_0x738a('0x15')+_0x2fa9f0['statusCode']+'\x20('+_0x2fa9f0[_0x738a('0x16')]+')'));return;}var _0xc94faf='';_0x2fa9f0['on'](_0x738a('0x1f'),function(_0x4ef085){_0xc94faf+=_0x4ef085;});_0x2fa9f0['on'](_0x738a('0x1c'),function(){_0x576fc7(_0xc94faf);});})['on'](_0x738a('0x13'),function(_0x58d306){_0x499d5b(_0x58d306);})[_0x738a('0x1c')]();});}function convertFile(_0x3fd040,_0x1ff3d9){return new BPromise(function(_0x477039,_0x19ba1a){var _0x475e41=sox[_0x738a('0x20')](_0x3fd040,_0x1ff3d9,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x475e41['on'](_0x738a('0x13'),function(_0x5cd839){logger[_0x738a('0x13')](_0x738a('0x21'),_0x5cd839);_0x19ba1a(_0x5cd839);});_0x475e41['on'](_0x738a('0x1c'),function(){logger[_0x738a('0x18')](_0x738a('0x22'));_0x477039();});_0x475e41[_0x738a('0x23')]();});}function base64Decode(_0x2fa4a0,_0x265cfe){var _0x57f3c3=path['resolve'](__dirname,'tmp',rs[_0x738a('0x24')](0x4)+_0x738a('0x25'));fs[_0x738a('0x26')](_0x57f3c3,_0x2fa4a0,_0x738a('0x27'));return convertFile(_0x57f3c3,_0x265cfe)[_0x738a('0x28')](function(){try{fs['unlink'](_0x57f3c3);fs[_0x738a('0x29')](_0x265cfe,_0x738a('0x2a'));}catch(_0x76122){logger[_0x738a('0x13')](_0x76122);}return _0x265cfe[_0x738a('0x2b')]('.')[0x0];});}function base64Encode(_0x59c387){var _0x27e352=fs['readFileSync'](_0x59c387);return new Buffer(_0x27e352)[_0x738a('0x2c')](_0x738a('0x27'));}exports[_0x738a('0x2d')]=function(_0x25f03b,_0x2a1405,_0x2b1e7c,_0x48c4fe,_0x18172a,_0x59f584){var _0x38a82e,_0x59150d;var _0xb11cc0='https://texttospeech.googleapis.com/v1/';var _0x40d0c7=_0x738a('0x2e')+_0x25f03b;var _0x4b5133={};if(_0x2a1405===_0x738a('0x2f')){_0x4b5133[_0x738a('0x30')]={'ssml':_0x2b1e7c};}else{_0x4b5133['input']={'text':_0x2b1e7c};};_0x4b5133[_0x738a('0x31')]={'languageCode':_0x48c4fe,'ssmlGender':_0x18172a};_0x4b5133['audioConfig']={'audioEncoding':_0x738a('0x32'),'sampleRateHertz':0x1f40};var _0xc33d8c={'url':_0xb11cc0+_0x738a('0x33')+_0x40d0c7,'method':_0x738a('0x34'),'json':!![],'body':_0x4b5133};return rp(_0xc33d8c)[_0x738a('0x28')](function(_0x4a3cb8){return new BPromise(function(_0xadb696,_0x15dc63){_0x38a82e=path[_0x738a('0x35')](__dirname,_0x738a('0x36'),rs[_0x738a('0x24')](0x4)+_0x738a('0x37'));var _0x487746=Buffer[_0x738a('0x38')](_0x4a3cb8['audioContent'],_0x738a('0x27'));return fs[_0x738a('0x39')](_0x38a82e,_0x487746,function(_0x18ce4a){_0x15dc63(_0x18ce4a);},function(_0x134ce4){fs['chmodSync'](_0x38a82e,_0x738a('0x2a'));_0xadb696(_0x134ce4);});});})[_0x738a('0x28')](function(_0x2c0991){_0x59150d=path[_0x738a('0x35')](__dirname,'tmp',rs[_0x738a('0x24')](0x4)+'.wav');return convertFile(_0x38a82e,_0x59150d);})[_0x738a('0x28')](function(){try{fs['unlink'](_0x38a82e);fs['chmodSync'](_0x59150d,_0x738a('0x2a'));}catch(_0x59787c){logger[_0x738a('0x13')](_0x59787c);}logger[_0x738a('0x18')](_0x738a('0x3a'),_0x59150d[_0x738a('0x2b')]('.')[0x0]);return _0x59150d[_0x738a('0x2b')]('.')[0x0];});};exports[_0x738a('0x3b')]=function(_0x21981c,_0x51af59){var _0x232504,_0x2fb1a5;return tts(_0x21981c,_0x51af59||'en',0x1)[_0x738a('0x28')](function(_0x50722d){logger[_0x738a('0x18')](_0x50722d);_0x232504=path[_0x738a('0x35')](__dirname,_0x738a('0x36'),rs[_0x738a('0x24')](0x4)+'.mp3');return downloadFile(_0x50722d,_0x232504);})[_0x738a('0x28')](function(){_0x2fb1a5=path['resolve'](__dirname,_0x738a('0x36'),rs[_0x738a('0x24')](0x4)+_0x738a('0x25'));return convertFile(_0x232504,_0x2fb1a5);})['then'](function(){try{fs[_0x738a('0x1b')](_0x232504);fs[_0x738a('0x29')](_0x2fb1a5,_0x738a('0x2a'));}catch(_0x25cfb7){logger[_0x738a('0x13')](_0x25cfb7);}logger[_0x738a('0x18')](_0x738a('0x3c'),_0x2fb1a5['split']('.')[0x0]);return _0x2fb1a5[_0x738a('0x2b')]('.')[0x0];});};exports[_0x738a('0x3d')]=function(_0x1718b7,_0x235622,_0x80a97c){return google[_0x738a('0x3e')](_0x1718b7,_0x235622,_0x80a97c)[_0x738a('0x28')](function(_0x28c75d){logger[_0x738a('0x18')](_0x28c75d['uri']);return rp(_0x28c75d);})[_0x738a('0x28')](function(_0x558166){var _0x482f74='';var _0x9862bc=0x0;try{fs[_0x738a('0x1b')](_0x1718b7);}catch(_0x4648cb){logger['error'](_0x4648cb);}if(_0x558166&&_0x558166['results']){_0x482f74=_0x558166[_0x738a('0x3f')][_0x738a('0x40')](function(_0x2401da){return _0x2401da&&_0x2401da[_0x738a('0x41')][0x0]&&_0x2401da[_0x738a('0x41')][0x0][_0x738a('0x42')]?_0x2401da[_0x738a('0x41')][0x0][_0x738a('0x42')]:'';})[_0x738a('0x43')]('\x0a');_0x9862bc=_0x558166[_0x738a('0x3f')][_0x738a('0x40')](function(_0x4d7eb4){return _0x4d7eb4&&_0x4d7eb4[_0x738a('0x41')][0x0]&&_0x4d7eb4[_0x738a('0x41')][0x0][_0x738a('0x44')]?_0x4d7eb4['alternatives'][0x0]['confidence']:0x0;})[_0x738a('0x43')]('\x0a');}logger[_0x738a('0x18')](_0x738a('0x45'),_0x482f74);logger[_0x738a('0x18')](_0x738a('0x46'),_0x9862bc);return{'transcript':_0x482f74,'confidence':_0x9862bc};})['catch'](function(_0x376b97){logger['error'](_0x738a('0x47'),_0x376b97[_0x738a('0x12')],_0x376b97[_0x738a('0x48')],_0x376b97['message']);});};exports['googleDialogflow']=function(_0x1f864b,_0x123fc3,_0x362728,_0x520b0e){var _0x223647=apiai(_0x123fc3,{'language':_0x520b0e||'en'});return _0x223647[_0x738a('0x49')](_0x362728,{'sessionId':md5(_0x1f864b)})[_0x738a('0x28')](function(_0x2b6232){logger['info'](JSON[_0x738a('0x4a')](_0x2b6232));return{'source':_0x2b6232[_0x738a('0x4b')][_0x738a('0x4c')],'resolvedQuery':_0x2b6232[_0x738a('0x4b')]['resolvedQuery'],'action':_0x2b6232['result'][_0x738a('0x4d')],'actionIncomplete':_0x2b6232[_0x738a('0x4b')]['actionIncomplete'],'speech':_0x2b6232[_0x738a('0x4b')][_0x738a('0x4e')]['speech'],'score':_0x2b6232[_0x738a('0x4b')][_0x738a('0x4f')],'statusCode':_0x2b6232[_0x738a('0x50')][_0x738a('0x51')],'endConversation':_0x2b6232[_0x738a('0x4b')][_0x738a('0x52')]['endConversation']||![],'isFallbackIntent':_0x2b6232['result'][_0x738a('0x52')][_0x738a('0x53')]};});};exports[_0x738a('0x54')]=function(_0x655a1c,_0x28bd3e,_0x551427,_0x279628){return tilde['asr'](_0x655a1c,_0x28bd3e,_0x551427,_0x279628)['then'](function(_0x4951b1){try{fs[_0x738a('0x1b')](_0x655a1c);}catch(_0x2dfe5c){logger[_0x738a('0x13')](_0x2dfe5c);}logger[_0x738a('0x18')](_0x738a('0x55'),_0x4951b1['transcript']);logger[_0x738a('0x18')](_0x738a('0x56'),_0x4951b1['confidence']);return _0x4951b1;});};exports[_0x738a('0x57')]=function(_0x1a8dcc,_0x147dac,_0x19d8fc,_0x862ebf,_0x5a46a2,_0x3d7f3e){var _0x1b2b61=path[_0x738a('0x35')](__dirname,_0x738a('0x36'),rs[_0x738a('0x24')](0x4)+_0x738a('0x37'));var _0x1bf3b0;return aws[_0x738a('0x58')](_0x1a8dcc,_0x147dac,_0x19d8fc,_0x862ebf,_0x5a46a2,_0x3d7f3e,_0x1b2b61)[_0x738a('0x28')](function(){_0x1bf3b0=path[_0x738a('0x35')](__dirname,_0x738a('0x36'),rs[_0x738a('0x24')](0x4)+_0x738a('0x25'));return convertFile(_0x1b2b61,_0x1bf3b0);})[_0x738a('0x28')](function(){try{fs[_0x738a('0x1b')](_0x1b2b61);fs[_0x738a('0x29')](_0x1bf3b0,_0x738a('0x2a'));}catch(_0x2a0973){logger[_0x738a('0x13')](_0x2a0973);}return _0x1bf3b0[_0x738a('0x2b')]('.')[0x0];});};exports[_0x738a('0x59')]=function(_0x34beb8,_0x488820,_0x2e7536,_0x4a22be,_0x53c866,_0x4d6fdc){return aws['lex'](_0x34beb8,_0x488820,_0x2e7536,_0x4a22be,_0x53c866,_0x4d6fdc)[_0x738a('0x28')](function(_0x37aef5){logger[_0x738a('0x18')](JSON['stringify'](_0x37aef5));return _0x37aef5;});};exports[_0x738a('0x5a')]=function(_0x54bfc0,_0xbad084,_0x570d05,_0x513df2){var _0x21160a=util['format'](_0x738a('0x5b'),ISPEECH_API,_0x54bfc0,encodeURIComponent(_0xbad084),_0x570d05,_0x513df2);var _0xe6c038=path[_0x738a('0x35')](__dirname,_0x738a('0x36'),rs[_0x738a('0x24')](0x4)+_0x738a('0x37'));var _0xacc08a;return downloadFile(_0x21160a,_0xe6c038)[_0x738a('0x28')](function(){_0xacc08a=path['resolve'](__dirname,_0x738a('0x36'),rs[_0x738a('0x24')](0x4)+_0x738a('0x25'));return convertFile(_0xe6c038,_0xacc08a);})[_0x738a('0x28')](function(){try{fs[_0x738a('0x1b')](_0xe6c038);fs[_0x738a('0x29')](_0xacc08a,'777');}catch(_0x516f2d){logger[_0x738a('0x13')](_0x516f2d);}return _0xacc08a[_0x738a('0x2b')]('.')[0x0];});};exports[_0x738a('0x5c')]=function(_0xa8f0eb,_0x23103b,_0x30c51b,_0xce9a62){var _0x4782ea=util[_0x738a('0x5d')](_0x738a('0x5e'),ISPEECH_API,_0x23103b,_0x30c51b,base64Encode(_0xa8f0eb),_0xce9a62?util[_0x738a('0x5d')](_0x738a('0x5f'),encodeURIComponent(_0xce9a62)):_0x738a('0x60'));return uploadFile(_0x4782ea)[_0x738a('0x28')](function(_0x37400d){return querystring['parse'](_0x37400d);});};exports[_0x738a('0x61')]=function(_0x270bfb,_0x16bc7d){return sestek[_0x738a('0x62')](_0x270bfb,_0x16bc7d)['then'](function(_0x1dab99){logger[_0x738a('0x18')](JSON[_0x738a('0x4a')](_0x1dab99));var _0x3feaca={'speech':_0x1dab99['text'],'action':_0x1dab99[_0x738a('0x63')]?_0x1dab99[_0x738a('0x63')][_0x738a('0x64')]:undefined,'actiondata':_0x1dab99[_0x738a('0x63')]?_0x1dab99[_0x738a('0x63')][_0x738a('0x65')]:undefined};if(_0x1dab99['channelData']&&_0x1dab99[_0x738a('0x63')]['AudioFromTts']){return base64Decode(_0x1dab99[_0x738a('0x63')][_0x738a('0x66')][_0x738a('0x67')],path[_0x738a('0x35')](__dirname,'tmp',rs[_0x738a('0x24')](0x4)+_0x738a('0x25')))['then'](function(_0x356df0){_0x3feaca['audiofile']=_0x356df0;return _0x3feaca;});}return _0x3feaca;});};exports[_0x738a('0x68')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 8f34e03..89f59f7 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x1bf2=['./nda','exports'];(function(_0x3abad6,_0x188df0){var _0x403898=function(_0x49ead1){while(--_0x49ead1){_0x3abad6['push'](_0x3abad6['shift']());}};_0x403898(++_0x188df0);}(_0x1bf2,0x148));var _0x21bf=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x1bf2[_0x243b2f];return _0xcb3c2d;};var nda=require(_0x21bf('0x0'));module[_0x21bf('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 635e6d9..80fb1cc 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa37e=['password','then','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','body','ProjectName','channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','ndauth_url','/token'];(function(_0x54a159,_0x2a11db){var _0x58c0a8=function(_0x2f4d5d){while(--_0x2f4d5d){_0x54a159['push'](_0x54a159['shift']());}};_0x58c0a8(++_0x2a11db);}(_0xa37e,0xe2));var _0xea37=function(_0x5db359,_0x4f5363){_0x5db359=_0x5db359-0x0;var _0x151843=_0xa37e[_0x5db359];return _0x151843;};'use strict';var rp=require(_0xea37('0x0'));var url=require(_0xea37('0x1'));var logger=require(_0xea37('0x2'))(_0xea37('0x3'));module['exports']=function(_0x28eaf9,_0x249df1){var _0x47f8c1={'method':'POST','uri':url['resolve'](_0x249df1[_0xea37('0x4')],_0xea37('0x5')),'form':{'grant_type':_0xea37('0x6'),'username':_0x249df1['username'],'password':_0x249df1[_0xea37('0x6')]},'json':!![]};return rp(_0x47f8c1)[_0xea37('0x7')](function(_0x205252){var _0x43d489={'method':_0xea37('0x8'),'uri':url[_0xea37('0x9')](_0x249df1[_0xea37('0xa')],_0xea37('0xb')),'body':{'type':_0x249df1[_0xea37('0xc')]||_0xea37('0xd'),'channelId':_0xea37('0xe'),'conversation':{'id':_0x28eaf9['uniqueid']},'from':{'id':_0x28eaf9[_0xea37('0xf')],'name':_0x28eaf9[_0xea37('0x10')]},'recipient':{'id':_0x28eaf9[_0xea37('0x11')],'name':_0x28eaf9[_0xea37('0x12')]},'text':_0x249df1[_0xea37('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x205252['access_token']},'json':!![]};if(_0x249df1['project']){_0x43d489[_0xea37('0x14')]['channelData'][_0xea37('0x15')]=_0x249df1['project'];}if(_0x249df1['ndagenerate_audio']=='1'){_0x43d489[_0xea37('0x14')][_0xea37('0x16')][_0xea37('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xea37('0x18')};}if(_0x249df1[_0xea37('0x19')]){_0x43d489[_0xea37('0x14')]['channelData']['CustomAction']=_0x249df1[_0xea37('0x19')];if(_0x249df1[_0xea37('0x1a')]){_0x43d489[_0xea37('0x14')][_0xea37('0x16')][_0xea37('0x1b')]=_0x249df1['custom_action_data'];}}logger[_0xea37('0x1c')](JSON['stringify'](_0x43d489));return rp(_0x43d489);});}; \ No newline at end of file +var _0xbd05=['ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','message','Nda','callerid','extension','text','access_token','project','body','channelData'];(function(_0x475deb,_0x321dd7){var _0x20fd15=function(_0x2b1de7){while(--_0x2b1de7){_0x475deb['push'](_0x475deb['shift']());}};_0x20fd15(++_0x321dd7);}(_0xbd05,0xe0));var _0x5bd0=function(_0x39ff5c,_0x3de001){_0x39ff5c=_0x39ff5c-0x0;var _0x1eba54=_0xbd05[_0x39ff5c];return _0x1eba54;};'use strict';var rp=require(_0x5bd0('0x0'));var url=require('url');var logger=require(_0x5bd0('0x1'))('agi');module[_0x5bd0('0x2')]=function(_0x52ad24,_0x4d6d27){var _0x27f239={'method':_0x5bd0('0x3'),'uri':url[_0x5bd0('0x4')](_0x4d6d27[_0x5bd0('0x5')],_0x5bd0('0x6')),'form':{'grant_type':_0x5bd0('0x7'),'username':_0x4d6d27[_0x5bd0('0x8')],'password':_0x4d6d27[_0x5bd0('0x7')]},'json':!![]};return rp(_0x27f239)['then'](function(_0x554675){var _0x14c7d2={'method':'POST','uri':url['resolve'](_0x4d6d27[_0x5bd0('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x4d6d27['ndaactivity_type']||_0x5bd0('0xa'),'channelId':_0x5bd0('0xb'),'conversation':{'id':_0x52ad24['uniqueid']},'from':{'id':_0x52ad24[_0x5bd0('0xc')],'name':_0x52ad24['calleridname']},'recipient':{'id':_0x52ad24['dnid'],'name':_0x52ad24[_0x5bd0('0xd')]},'text':_0x4d6d27[_0x5bd0('0xe')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x554675[_0x5bd0('0xf')]},'json':!![]};if(_0x4d6d27[_0x5bd0('0x10')]){_0x14c7d2[_0x5bd0('0x11')][_0x5bd0('0x12')][_0x5bd0('0x13')]=_0x4d6d27['project'];}if(_0x4d6d27[_0x5bd0('0x14')]=='1'){_0x14c7d2[_0x5bd0('0x11')][_0x5bd0('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5bd0('0x15')};}if(_0x4d6d27[_0x5bd0('0x16')]){_0x14c7d2[_0x5bd0('0x11')][_0x5bd0('0x12')]['CustomAction']=_0x4d6d27[_0x5bd0('0x16')];if(_0x4d6d27['custom_action_data']){_0x14c7d2[_0x5bd0('0x11')][_0x5bd0('0x12')][_0x5bd0('0x17')]=_0x4d6d27[_0x5bd0('0x18')];}}logger[_0x5bd0('0x19')](JSON[_0x5bd0('0x1a')](_0x14c7d2));return rp(_0x14c7d2);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index 874191f..7c3c9f4 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa606=['exports','./lib/api'];(function(_0x455b35,_0x5d2b5e){var _0x1fc095=function(_0x52bfe4){while(--_0x52bfe4){_0x455b35['push'](_0x455b35['shift']());}};_0x1fc095(++_0x5d2b5e);}(_0xa606,0x12d));var _0x6a60=function(_0x47df02,_0x50acc4){_0x47df02=_0x47df02-0x0;var _0x4f1dd3=_0xa606[_0x47df02];return _0x4f1dd3;};'use strict';var asr=require(_0x6a60('0x0'));module[_0x6a60('0x1')]=function(_0x5f3628,_0x1bf71a,_0x1e7e19,_0x275b9f){return asr(_0x5f3628,_0x1bf71a,_0x1e7e19,_0x275b9f);}; \ No newline at end of file +var _0x4893=['./lib/api','exports'];(function(_0x4d7707,_0x9784ca){var _0x5d3421=function(_0x57dd26){while(--_0x57dd26){_0x4d7707['push'](_0x4d7707['shift']());}};_0x5d3421(++_0x9784ca);}(_0x4893,0x10a));var _0x3489=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0x4893[_0x5976f8];return _0x179715;};'use strict';var asr=require(_0x3489('0x0'));module[_0x3489('0x1')]=function(_0x47a88b,_0x5bb9a8,_0x4f7ec9,_0x135977){return asr(_0x47a88b,_0x5bb9a8,_0x4f7ec9,_0x135977);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index bd70286..60fd186 100644 --- a/server/services/agi/scripts/tilde/asr/lib/api.js +++ b/server/services/agi/scripts/tilde/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34a8=['status','result','Tilde\x20ASR\x20hypoteses','transcript','hypotheses','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','close','crypto','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse'];(function(_0x444e8c,_0x148138){var _0x260a4b=function(_0x4f6798){while(--_0x4f6798){_0x444e8c['push'](_0x444e8c['shift']());}};_0x260a4b(++_0x148138);}(_0x34a8,0xa4));var _0x834a=function(_0x4036d2,_0xc5022e){_0x4036d2=_0x4036d2-0x0;var _0x27e572=_0x34a8[_0x4036d2];return _0x27e572;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x834a('0x0'));var logger=require('../../../../../../config/logger')(_0x834a('0x1'));module[_0x834a('0x2')]=function(_0x113fd9,_0x3c1389,_0x238455,_0x1ef5bd){return new BPromise(function(_0x20af86,_0x13b8e9){logger['info'](_0x834a('0x3'),_0x1ef5bd||_0x834a('0x4'));var _0x43231a=new WebSocket(_0x1ef5bd||_0x834a('0x4'),{'perMessageDeflate':![]});var _0x42eea3='';var _0x373566='0';var _0x146457='1';var _0x442a3c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x31824d(_0x59f196){var _0x43a20d=crypto[_0x834a('0x5')](_0x834a('0x6'));_0x43a20d[_0x834a('0x7')](_0x59f196);return _0x43a20d['digest'](_0x834a('0x8'));}function _0x1931cd(){try{logger[_0x834a('0x9')](_0x834a('0xa'));var _0x45ca93=moment()[_0x834a('0xb')]();var _0x5f48cc=_0x31824d(_0x45ca93+_0x3c1389+_0x238455);_0x43231a[_0x834a('0xc')](JSON[_0x834a('0xd')]({'appID':_0x3c1389,'timestamp':_0x45ca93,'appKey':_0x5f48cc}));var _0x3c34eb=fs[_0x834a('0xe')](_0x113fd9);_0x3c34eb['on'](_0x834a('0xf'),function(_0x2fea2d){_0x43231a[_0x834a('0xc')](_0x2fea2d);});_0x3c34eb['on']('close',function(){_0x43231a['send'](_0x834a('0x10'));});}catch(_0x12b6f7){logger[_0x834a('0x11')](_0x834a('0x12'),JSON['stringify'](_0x12b6f7));_0x43231a[_0x834a('0x13')]();}}function _0x3e3cf1(_0x3e7605){try{if(_0x3e7605){var _0x5dd076=JSON[_0x834a('0x14')](_0x3e7605);switch(_0x5dd076[_0x834a('0x15')]){case 0x0:if(_0x5dd076[_0x834a('0x16')]){if(_0x5dd076[_0x834a('0x16')]['final']){logger[_0x834a('0x9')](_0x834a('0x17'),JSON[_0x834a('0xd')](_0x5dd076[_0x834a('0x16')]['hypotheses']));_0x42eea3=_0x5dd076[_0x834a('0x16')]['hypotheses'][0x0][_0x834a('0x18')];_0x373566=_0x5dd076[_0x834a('0x16')][_0x834a('0x19')][0x0][_0x834a('0x1a')];_0x146457='0';_0x442a3c='Success.';_0x43231a['terminate']();}}break;case 0x1:logger[_0x834a('0x9')](_0x834a('0x1b'));_0x146457='1';_0x442a3c=_0x834a('0x1b');break;case 0x2:logger[_0x834a('0x9')](_0x834a('0x1c'));_0x146457='2';_0x442a3c='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x834a('0x9')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x146457='9';_0x442a3c=_0x834a('0x1d');break;case 0xa:logger[_0x834a('0x9')](_0x834a('0x1e'));_0x146457='10';_0x442a3c=_0x834a('0x1e');break;case 0xb:logger[_0x834a('0x9')](_0x834a('0x1f'));_0x146457='11';_0x442a3c='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5c2a4f){logger[_0x834a('0x11')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x5c2a4f));_0x43231a[_0x834a('0x13')]();}}function _0x2dba37(){logger[_0x834a('0x9')]('Close\x20Tilde\x20ASR\x20socket');_0x20af86({'transcript':_0x42eea3,'confidence':_0x373566,'status':_0x146457,'status_message':_0x442a3c});}function _0x1fe01a(_0x10e1b4){logger[_0x834a('0x11')](_0x834a('0x20'));if(!_['isNil'](_0x10e1b4)){logger[_0x834a('0x11')](_[_0x834a('0x21')](_0x10e1b4)?JSON['stringify'](_0x10e1b4):_0x10e1b4);}}_0x43231a['on'](_0x834a('0x22'),_0x1931cd);_0x43231a['on'](_0x834a('0x23'),_0x3e3cf1);_0x43231a['on'](_0x834a('0x24'),_0x2dba37);_0x43231a['on'](_0x834a('0x11'),_0x1fe01a);});}; \ No newline at end of file +var _0x0603=['digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','EOS','error','terminate','status','result','transcript','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','crypto','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update'];(function(_0x1cc2f8,_0x4cfe13){var _0x1e93d5=function(_0x428f31){while(--_0x428f31){_0x1cc2f8['push'](_0x1cc2f8['shift']());}};_0x1e93d5(++_0x4cfe13);}(_0x0603,0x1cb));var _0x3060=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x0603[_0x4063a4];return _0x17908d;};'use strict';var BPromise=require('bluebird');var _=require(_0x3060('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3060('0x1'));var crypto=require(_0x3060('0x2'));var logger=require('../../../../../../config/logger')(_0x3060('0x3'));module[_0x3060('0x4')]=function(_0x46127b,_0x4211af,_0x476299,_0x3136eb){return new BPromise(function(_0x1afa1e,_0x12cf75){logger[_0x3060('0x5')]('Tilde\x20URI',_0x3136eb||_0x3060('0x6'));var _0x122dae=new WebSocket(_0x3136eb||_0x3060('0x6'),{'perMessageDeflate':![]});var _0x3bf574='';var _0x13ac28='0';var _0x410374='1';var _0x1c15f0=_0x3060('0x7');function _0xf84e96(_0xe5af4f){var _0x53f863=crypto['createHash']('sha1');_0x53f863[_0x3060('0x8')](_0xe5af4f);return _0x53f863[_0x3060('0x9')](_0x3060('0xa'));}function _0x340ab2(){try{logger['info'](_0x3060('0xb'));var _0x5b1e0d=moment()[_0x3060('0xc')]();var _0x3cee17=_0xf84e96(_0x5b1e0d+_0x4211af+_0x476299);_0x122dae['send'](JSON[_0x3060('0xd')]({'appID':_0x4211af,'timestamp':_0x5b1e0d,'appKey':_0x3cee17}));var _0x218830=fs[_0x3060('0xe')](_0x46127b);_0x218830['on'](_0x3060('0xf'),function(_0x951062){_0x122dae[_0x3060('0x10')](_0x951062);});_0x218830['on']('close',function(){_0x122dae[_0x3060('0x10')](_0x3060('0x11'));});}catch(_0x5be196){logger[_0x3060('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x5be196));_0x122dae[_0x3060('0x13')]();}}function _0x4c9944(_0x43b4ed){try{if(_0x43b4ed){var _0x30f308=JSON['parse'](_0x43b4ed);switch(_0x30f308[_0x3060('0x14')]){case 0x0:if(_0x30f308[_0x3060('0x15')]){if(_0x30f308[_0x3060('0x15')]['final']){logger[_0x3060('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x3060('0xd')](_0x30f308[_0x3060('0x15')]['hypotheses']));_0x3bf574=_0x30f308[_0x3060('0x15')]['hypotheses'][0x0][_0x3060('0x16')];_0x13ac28=_0x30f308['result'][_0x3060('0x17')][0x0][_0x3060('0x18')];_0x410374='0';_0x1c15f0=_0x3060('0x19');_0x122dae[_0x3060('0x13')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x410374='1';_0x1c15f0=_0x3060('0x7');break;case 0x2:logger['info'](_0x3060('0x1a'));_0x410374='2';_0x1c15f0=_0x3060('0x1a');break;case 0x9:logger[_0x3060('0x5')](_0x3060('0x1b'));_0x410374='9';_0x1c15f0=_0x3060('0x1b');break;case 0xa:logger['info']('Authentication\x20failed.');_0x410374='10';_0x1c15f0=_0x3060('0x1c');break;case 0xb:logger[_0x3060('0x5')](_0x3060('0x1d'));_0x410374='11';_0x1c15f0='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0xf6fa3c){logger[_0x3060('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x3060('0xd')](_0xf6fa3c));_0x122dae[_0x3060('0x13')]();}}function _0x1228de(){logger['info'](_0x3060('0x1e'));_0x1afa1e({'transcript':_0x3bf574,'confidence':_0x13ac28,'status':_0x410374,'status_message':_0x1c15f0});}function _0x5e8483(_0x211102){logger[_0x3060('0x12')](_0x3060('0x1f'));if(!_[_0x3060('0x20')](_0x211102)){logger[_0x3060('0x12')](_[_0x3060('0x21')](_0x211102)?JSON[_0x3060('0xd')](_0x211102):_0x211102);}}_0x122dae['on'](_0x3060('0x22'),_0x340ab2);_0x122dae['on'](_0x3060('0x23'),_0x4c9944);_0x122dae['on']('close',_0x1228de);_0x122dae['on'](_0x3060('0x12'),_0x5e8483);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 8a28430..65313b7 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62b8=['./asr','exports'];(function(_0x1d2ca4,_0x469af6){var _0x35398a=function(_0x3638f6){while(--_0x3638f6){_0x1d2ca4['push'](_0x1d2ca4['shift']());}};_0x35398a(++_0x469af6);}(_0x62b8,0x142));var _0x862b=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x62b8[_0x189305];return _0xea3406;};var asr=require(_0x862b('0x0'));module[_0x862b('0x1')]={'asr':asr}; \ No newline at end of file +var _0xcc85=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcc85,0x121));var _0x5cc8=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xcc85[_0x18d631];return _0x50d708;};var asr=require('./asr');module[_0x5cc8('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 442b740..eb1fd18 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf1a=['E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','call','emit','error'];(function(_0x418ca0,_0x2a51cf){var _0x366e80=function(_0x19b9f0){while(--_0x19b9f0){_0x418ca0['push'](_0x418ca0['shift']());}};_0x366e80(++_0x2a51cf);}(_0xbf1a,0x7c));var _0xabf1=function(_0x5115d5,_0x144390){_0x5115d5=_0x5115d5-0x0;var _0x17a012=_0xbf1a[_0x5115d5];return _0x17a012;};'use strict';var util=require(_0xabf1('0x0'));var net=require(_0xabf1('0x1'));var EventEmitter=require(_0xabf1('0x2'))[_0xabf1('0x3')];var AGIError=require(_0xabf1('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x132189,_0x4e92c6,_0x1b5f1a){var _0x288b6c=this,_0x132189=_0x132189||0x11dd,_0x4e92c6=_0x4e92c6||'127.0.0.1',_0x5a477e=null,_0x2a4ebd=0x0;EventEmitter[_0xabf1('0x5')](_0x288b6c);function _0x1cc1f6(){if(!_0x132189){_0x288b6c[_0xabf1('0x6')](_0xabf1('0x7'),new AGIError(_0xabf1('0x8')));return![];}_0x5a477e=net[_0xabf1('0x9')]();_0x5a477e['listen'](_0x132189,_0x4e92c6);_0x5a477e['on'](_0xabf1('0xa'),function(){_0x288b6c[_0xabf1('0x6')](_0xabf1('0xa'));});_0x5a477e['on'](_0xabf1('0xb'),function(_0x43c278){_0x5a477e[_0xabf1('0xc')](function(_0x5e04e0,_0x3a58a2){if(_0x5e04e0){_0x288b6c[_0xabf1('0x6')](_0xabf1('0x7'),new AGIError(_0xabf1('0xd'),_0x5e04e0));}else if(_0x1b5f1a&&_0x1b5f1a<0x0){_0x288b6c[_0xabf1('0x6')](_0xabf1('0x7'),new AGIError(_0xabf1('0xe')));_0x43c278[_0xabf1('0xf')]();}else if(_0x1b5f1a&&_0x1b5f1a>0x0&&_0x1b5f1a<_0x3a58a2){_0x2a4ebd+=0x1;_0x288b6c[_0xabf1('0x6')](_0xabf1('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x2a4ebd));_0x43c278[_0xabf1('0xf')]();}else{var _0xcbe7da=new AGIChannel(_0x43c278);_0xcbe7da['on'](_0xabf1('0x10'),function(){_0x288b6c['emit'](_0xabf1('0xb'),_0xcbe7da);});}});});_0x5a477e['on'](_0xabf1('0x7'),function(_0x719d3e){_0x288b6c[_0xabf1('0x6')]('error',new AGIError(_0xabf1('0xd'),_0x719d3e['code']));});_0x5a477e['on'](_0xabf1('0x11'),function(){_0x288b6c[_0xabf1('0x6')](_0xabf1('0x11'),new AGIError(_0xabf1('0x12')));});}process[_0xabf1('0x13')](function(){_0x1cc1f6();});};util[_0xabf1('0x14')](AGIServer,EventEmitter);module[_0xabf1('0x15')]=function(_0x2d8fac,_0x8a5df5,_0x18f315){return new AGIServer(_0x2d8fac,_0x8a5df5,_0x18f315);}; \ No newline at end of file +var _0x25a3=['close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','./error','call','emit','error','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code'];(function(_0x39e2d7,_0x1b15f6){var _0x413d0d=function(_0x3af71d){while(--_0x3af71d){_0x39e2d7['push'](_0x39e2d7['shift']());}};_0x413d0d(++_0x1b15f6);}(_0x25a3,0x121));var _0x325a=function(_0x53361f,_0x3b2cb6){_0x53361f=_0x53361f-0x0;var _0x279237=_0x25a3[_0x53361f];return _0x279237;};'use strict';var util=require(_0x325a('0x0'));var net=require(_0x325a('0x1'));var EventEmitter=require(_0x325a('0x2'))['EventEmitter'];var AGIError=require(_0x325a('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x46df7b,_0x3b887a,_0x1f6e3d){var _0x5d829e=this,_0x46df7b=_0x46df7b||0x11dd,_0x3b887a=_0x3b887a||'127.0.0.1',_0x272122=null,_0x56e8fb=0x0;EventEmitter[_0x325a('0x4')](_0x5d829e);function _0x209f5e(){if(!_0x46df7b){_0x5d829e[_0x325a('0x5')](_0x325a('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x272122=net['createServer']();_0x272122[_0x325a('0x7')](_0x46df7b,_0x3b887a);_0x272122['on'](_0x325a('0x8'),function(){_0x5d829e[_0x325a('0x5')](_0x325a('0x8'));});_0x272122['on'](_0x325a('0x9'),function(_0x478156){_0x272122['getConnections'](function(_0xaeca66,_0x9b3011){if(_0xaeca66){_0x5d829e['emit'](_0x325a('0x6'),new AGIError(_0x325a('0xa'),_0xaeca66));}else if(_0x1f6e3d&&_0x1f6e3d<0x0){_0x5d829e[_0x325a('0x5')](_0x325a('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x478156['destroy']();}else if(_0x1f6e3d&&_0x1f6e3d>0x0&&_0x1f6e3d<_0x9b3011){_0x56e8fb+=0x1;_0x5d829e[_0x325a('0x5')]('error',new AGIError(_0x325a('0xb'),_0x56e8fb));_0x478156[_0x325a('0xc')]();}else{var _0x3db556=new AGIChannel(_0x478156);_0x3db556['on'](_0x325a('0xd'),function(){_0x5d829e[_0x325a('0x5')](_0x325a('0x9'),_0x3db556);});}});});_0x272122['on'](_0x325a('0x6'),function(_0x4412ba){_0x5d829e[_0x325a('0x5')](_0x325a('0x6'),new AGIError(_0x325a('0xa'),_0x4412ba[_0x325a('0xe')]));});_0x272122['on'](_0x325a('0xf'),function(){_0x5d829e[_0x325a('0x5')]('close',new AGIError(_0x325a('0x10')));});}process[_0x325a('0x11')](function(){_0x209f5e();});};util['inherits'](AGIServer,EventEmitter);module[_0x325a('0x12')]=function(_0x192aa2,_0xdba744,_0x297599){return new AGIServer(_0x192aa2,_0xdba744,_0x297599);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 08e6e19..1d2b121 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','extra','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','position','record','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','%s_STATUS_CODE','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','Smtp','service','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','moment','request-promise','../../config/logger','../../config/environment','./scripts','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','sendMailMessage','getIntervals','IntervalId','map','Intervals','interval','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','callerid','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appsecret','clear','agicommand','clone','hasOwnProperty','isString','recursiveNodeIndex','replaceAllVariables','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','length','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result'];(function(_0x426840,_0x12557c){var _0x433782=function(_0x25f224){while(--_0x25f224){_0x426840['push'](_0x426840['shift']());}};_0x433782(++_0x12557c);}(_0xda3f,0xec));var _0xfda3=function(_0x4e55b7,_0x1eaf47){_0x4e55b7=_0x4e55b7-0x0;var _0x8bf3c3=_0xda3f[_0x4e55b7];return _0x8bf3c3;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xfda3('0x0'));var _=require(_0xfda3('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0xfda3('0x2'));var Mustache=require('mustache');var rp=require(_0xfda3('0x3'));var logger=require(_0xfda3('0x4'))('agi');var config=require(_0xfda3('0x5'));var scripts=require(_0xfda3('0x6'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0xfda3('0x7')];var verticesWithRetry=[_0xfda3('0x8'),_0xfda3('0x9'),_0xfda3('0xa')];var AGIVertices=function(_0x7bb490,_0x20e790,_0x46655c){this[_0xfda3('0xb')]=_0x7bb490;this[_0xfda3('0xc')]=_0x20e790;this[_0xfda3('0xd')]=_0x46655c;};AGIVertices[_0xfda3('0xe')][_0xfda3('0xf')]=function(_0x4d7841,_0xe933f5){this[_0xfda3('0xc')][_0xfda3('0x10')](_0x4d7841)[_0xfda3('0x11')](function(_0x1443f4){_0xe933f5(null,_0x1443f4?_0x1443f4['name']:![]);})[_0xfda3('0x12')](function(_0x5d7d5b){_0xe933f5(_0x5d7d5b);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x13')]=function(_0x4929fa,_0x501588){this['rpc'][_0xfda3('0x14')](_0x4929fa)[_0xfda3('0x11')](function(_0x5ea793){_0x501588(null,_0x5ea793?_0x5ea793['name']:![]);})['catch'](function(_0x80ea80){_0x501588(_0x80ea80);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x15')]=function(_0x3d8bcd,_0x34900d){this[_0xfda3('0xc')][_0xfda3('0x16')](_0x3d8bcd)[_0xfda3('0x11')](function(_0x4680bf){_0x34900d(null,_0x4680bf?_0x4680bf[_0xfda3('0x17')]:![]);})['catch'](function(_0x15ddb9){_0x34900d(_0x15ddb9);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x18')]=function(_0x32855a,_0x59a887){this[_0xfda3('0xc')][_0xfda3('0x19')](_0x32855a)[_0xfda3('0x11')](function(_0x51e731){_0x59a887(null,_0x51e731?_0x51e731['dsn']:![]);})[_0xfda3('0x12')](function(_0x38d428){_0x59a887(_0x38d428);});};AGIVertices[_0xfda3('0xe')]['getUser']=function(_0x3cf5a9,_0xef2535){this[_0xfda3('0xc')][_0xfda3('0x1a')](_0x3cf5a9)[_0xfda3('0x11')](function(_0x2b84b7){_0xef2535(null,_0x2b84b7?_0x2b84b7[_0xfda3('0x17')]:![]);})[_0xfda3('0x12')](function(_0x16eaa6){_0xef2535(_0x16eaa6);});};AGIVertices['prototype'][_0xfda3('0x1b')]=function(_0x2d5b44,_0x2e8bf8){this['rpc'][_0xfda3('0x1c')](_0x2d5b44)[_0xfda3('0x11')](function(_0x172cfb){_0x2e8bf8(null,_0x172cfb?_0x172cfb[_0xfda3('0x17')]:![]);})[_0xfda3('0x12')](function(_0xad9f7b){_0x2e8bf8(_0xad9f7b);});};AGIVertices['prototype'][_0xfda3('0x1d')]=function(_0x1e87fe,_0x2bef2b){var _0x1f2884=this;this[_0xfda3('0xc')]['getSoundById'](_0x1e87fe)[_0xfda3('0x11')](function(_0x4101b1){_0x2bef2b(null,_0x4101b1?_0x1f2884[_0xfda3('0x1e')](_0x4101b1[_0xfda3('0x1f')]):![]);})[_0xfda3('0x12')](function(_0x3cfeb2){_0x2bef2b(_0x3cfeb2);});};AGIVertices[_0xfda3('0xe')]['getMailAccount']=function(_0x56ca3a,_0x3aef3c){this['rpc']['getMailAccountById'](_0x56ca3a)[_0xfda3('0x11')](function(_0x2a5971){_0x3aef3c(null,_0x2a5971?_0x2a5971:![]);})[_0xfda3('0x12')](function(_0xd7e1d6){_0x3aef3c(_0xd7e1d6);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x20')]=function(_0x404531,_0xd6b6d7,_0x261a81){this['mailRpc'][_0xfda3('0x20')](_0x404531,_0xd6b6d7)[_0xfda3('0x11')](function(){_0x261a81(null);})[_0xfda3('0x12')](function(_0x227357){_0x261a81(_0x227357);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x21')]=function(_0x2b3afb,_0x210763){this[_0xfda3('0xc')]['getIntervalById'](_0x2b3afb)['then'](function(_0x30e63e){if(_0x30e63e){if(_0x30e63e[_0xfda3('0x22')]){_0x210763(null,[_0x30e63e['interval']]);}else{_0x210763(null,_[_0xfda3('0x23')](_0x30e63e[_0xfda3('0x24')],_0xfda3('0x25')));}}else{_0x210763(null,![]);}})['catch'](function(_0x1d92a9){_0x210763(_0x1d92a9);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x1e')]=function(_0x3151e6){return util[_0xfda3('0x26')]('%s/sounds/converted/%s',FILES_PATH,_0x3151e6);};AGIVertices[_0xfda3('0xe')][_0xfda3('0x27')]=function(_0x33bdfb,_0x56bed2,_0x373c96){odbc['open'](_0x33bdfb,function(_0x2d9a3f){if(_0x2d9a3f){logger[_0xfda3('0x28')](_0xfda3('0x29'),_0x2d9a3f);_0x373c96(_0x2d9a3f);}else{logger[_0xfda3('0x2a')](_0xfda3('0x2b'));odbc[_0xfda3('0x2c')](_0x56bed2,function(_0x151f32,_0x3d1cb2){if(_0x151f32){logger['info'](_0xfda3('0x2d'),_0x56bed2);_0x373c96(_0x151f32);}else{logger[_0xfda3('0x2a')](_0xfda3('0x2e'),_0x56bed2);odbc[_0xfda3('0x2f')](function(_0x5cf8c0){if(_0x5cf8c0){logger[_0xfda3('0x28')](_0xfda3('0x30'),_0x5cf8c0);}_0x373c96(null,_0x3d1cb2);});}});}});};AGIVertices[_0xfda3('0xe')]['getSmsAccount']=function(_0x5ac61e,_0x31b173){this[_0xfda3('0xc')][_0xfda3('0x31')](_0x5ac61e)[_0xfda3('0x11')](function(_0x2b415d){_0x31b173(null,_0x2b415d?_0x2b415d:![]);})[_0xfda3('0x12')](function(_0x40b814){_0x31b173(_0x40b814);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x32')]=function(_0x272d65,_0x4d3b1c){this[_0xfda3('0xc')][_0xfda3('0x32')](_0x272d65)['then'](function(_0x1cfa17){_0x4d3b1c(null,_0x1cfa17);})['catch'](function(_0x51a314){_0x4d3b1c(_0x51a314);});};AGIVertices['prototype'][_0xfda3('0x33')]=function(_0x107fb1,_0x260977,_0x209918){this['rpc'][_0xfda3('0x33')]({'uniqueid':this[_0xfda3('0xb')][_0xfda3('0x34')],'node':_0x107fb1[_0xfda3('0x35')],'application':_0x107fb1['agicommand'],'data':_0x260977||null,'project_name':this[_0xfda3('0xb')][_0xfda3('0x36')],'callerid':this[_0xfda3('0xb')]['callerid']})['then'](function(_0x1849fe){if(_0x209918){_0x209918(null,_0x1849fe);}})[_0xfda3('0x12')](function(_0x1eea02){if(_0x209918){_0x209918(_0x1eea02);}});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x37')]=function(_0x73e8e4,_0xc9b167,_0x1bd0d8,_0x12b533){this[_0xfda3('0xc')][_0xfda3('0x37')]({'uniqueid':this[_0xfda3('0xb')][_0xfda3('0x34')],'callerid':this[_0xfda3('0xb')]['callerid'],'calleridname':this['channel'][_0xfda3('0x38')],'context':this[_0xfda3('0xb')][_0xfda3('0x39')],'extension':this[_0xfda3('0xb')][_0xfda3('0x3a')],'priority':this[_0xfda3('0xb')][_0xfda3('0x3b')],'accountcode':this[_0xfda3('0xb')][_0xfda3('0x3c')],'dnid':this[_0xfda3('0xb')]['dnid'],'projectName':this[_0xfda3('0xb')][_0xfda3('0x36')],'saveName':_0xc9b167,'filename':_0x73e8e4[_0xfda3('0x3d')]||_0xc9b167,'savePath':_0x1bd0d8})[_0xfda3('0x11')](function(_0x26496a){_0x12b533(null,_0x26496a);})['catch'](function(_0x2105dc){_0x12b533(_0x2105dc);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x3e')]=function(_0x4bcd2b,_0x187402,_0x39c96f){this[_0xfda3('0xc')]['createSquareMessage']({'uniqueid':this[_0xfda3('0xb')][_0xfda3('0x34')],'body':_0x4bcd2b,'direction':_0x187402})[_0xfda3('0x11')](function(_0x2f6e62){if(_0x39c96f){_0x39c96f(null,_0x2f6e62);}})[_0xfda3('0x12')](function(_0x49662b){if(_0x39c96f){_0x39c96f(_0x49662b);}});};AGIVertices[_0xfda3('0xe')]['createCmContact']=function(_0x17fe20,_0x587eef){this[_0xfda3('0xc')][_0xfda3('0x3f')]({'firstName':_[_0xfda3('0x40')](_0x17fe20[_0xfda3('0x17')])||_['isNil'](_0x17fe20[_0xfda3('0x17')])?_0xfda3('0x41')+Math[_0xfda3('0x42')]():_0x17fe20[_0xfda3('0x17')],'lastName':_[_0xfda3('0x40')](_0x17fe20[_0xfda3('0x43')])||_[_0xfda3('0x44')](_0x17fe20['lastName'])?null:_0x17fe20['lastName'],'phone':_0x17fe20[_0xfda3('0x45')],'ListId':_0x17fe20[_0xfda3('0x46')],'scheduledAt':_0x17fe20[_0xfda3('0x47')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xfda3('0x48'),'description':_0xfda3('0x49')+_0x17fe20[_0xfda3('0x47')][_0xfda3('0x4a')](),'priority':_0x17fe20[_0xfda3('0x4b')]})['then'](function(_0xb3353b){_0x587eef(null,_0xb3353b);})[_0xfda3('0x12')](function(_0x167424){_0x587eef(_0x167424);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x4c')]=function(_0x2f52e2,_0x360653){this[_0xfda3('0xc')][_0xfda3('0x4d')](_0x2f52e2)[_0xfda3('0x11')](function(_0x3ed7c1){_0x360653(null,_0x3ed7c1?_0x3ed7c1[_0xfda3('0x17')]:![]);})['catch'](function(_0x28c8a9){_0x360653(_0x28c8a9);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x4e')]=function(_0x32c835,_0x3e674e,_0x405d7e){var _0x42c7a1={'role':'agent'};_0x42c7a1[_0x32c835]=this['channel'][_0xfda3('0x4f')];this[_0xfda3('0xc')]['agentPause'](_0x42c7a1,_0x3e674e,this[_0xfda3('0xb')][_0xfda3('0x34')])[_0xfda3('0x11')](function(_0x38dbc7){_0x405d7e(null,_['isNil'](_0x38dbc7)?![]:!![]);})['catch'](function(_0xb61f7c){logger[_0xfda3('0x28')](_0xb61f7c);_0x405d7e(null,![]);});};AGIVertices[_0xfda3('0xe')]['agentUnpause']=function(_0x23fd20,_0x4b1216){var _0x3452cf={'role':_0xfda3('0x50')};_0x3452cf[_0x23fd20]=this[_0xfda3('0xb')][_0xfda3('0x4f')];this[_0xfda3('0xc')][_0xfda3('0x51')](_0x3452cf)['then'](function(_0x1447d3){_0x4b1216(null,_[_0xfda3('0x44')](_0x1447d3)?![]:!![]);})[_0xfda3('0x12')](function(_0x1816e5){logger[_0xfda3('0x28')](_0x1816e5);_0x4b1216(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x285459,_0x18ab57){var _0x5afcf5={'role':'agent'};_0x5afcf5[_0x285459]=this['channel'][_0xfda3('0x4f')];this[_0xfda3('0xc')]['agentLogout'](_0x5afcf5)[_0xfda3('0x11')](function(_0x6eb00d){_0x18ab57(null,_[_0xfda3('0x44')](_0x6eb00d)?![]:!![]);})[_0xfda3('0x12')](function(_0x51e463){logger[_0xfda3('0x28')](_0x51e463);_0x18ab57(null,![]);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x52')]=function(_0x449d42,_0x44e59e){var _0xf252ce={'role':'agent'};_0xf252ce[_0x449d42]=this['channel'][_0xfda3('0x4f')];var _0x5856fa=_0x449d42!=_0xfda3('0x53')?util[_0xfda3('0x26')](_0xfda3('0x54'),_0xfda3('0x55'),this[_0xfda3('0xb')][_0xfda3('0x4f')]):undefined;this[_0xfda3('0xc')][_0xfda3('0x52')](_0xf252ce,_0x5856fa)[_0xfda3('0x11')](function(_0x1eb4dc){_0x44e59e(null,_['isNil'](_0x1eb4dc)?![]:!![]);})[_0xfda3('0x12')](function(_0x49f04a){logger['error'](_0x49f04a);_0x44e59e(null,![]);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x56')]=function(_0x531874,_0xa3b2e0){sh[_0xfda3('0x57')](_[_0xfda3('0x58')](_0x531874),function(_0x589c7a,_0x1a825c){var _0x3fe104=_0x1a825c[_0xfda3('0x59')](/(\r\n|\n|\r)/gm,'');_0xa3b2e0(null,_0x3fe104);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x5a')]=function(_0x4c7435,_0x5b06a5){scripts['googleCloudTTS'](_0x4c7435[_0xfda3('0x5b')],_0x4c7435[_0xfda3('0x5c')]||_0xfda3('0x5d'),_0x4c7435[_0xfda3('0x5d')],_0x4c7435[_0xfda3('0x5e')]||_0xfda3('0x5f'),_0x4c7435['ssmlGender']||_0xfda3('0x60'),_0x4c7435[_0xfda3('0x61')]||_0xfda3('0x62'))[_0xfda3('0x11')](function(_0x502603){_0x5b06a5(null,_0x502603);})[_0xfda3('0x12')](function(_0x50c744){_0x5b06a5(_0x50c744);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x63')]=function(_0x223350,_0x16e8f0){scripts[_0xfda3('0x63')](_0x223350[_0xfda3('0x5d')],_0x223350[_0xfda3('0x64')]||'en',0x1)['then'](function(_0x31f143){_0x16e8f0(null,_0x31f143);})[_0xfda3('0x12')](function(_0x33535d){_0x16e8f0(_0x33535d);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x65')]=function(_0x119564,_0x5a44ce){var _0x2e47af={'uri':_0x119564[_0xfda3('0x66')],'method':_0x119564[_0xfda3('0x67')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x119564[_0xfda3('0x68')])===_0xfda3('0x69')&&parseInt(_0x119564['timeout'])>=0x1?parseInt(_0x119564[_0xfda3('0x68')])*0x3e8:0x5*0x3e8};if(_[_0xfda3('0x6a')]([_0xfda3('0x6b'),_0xfda3('0x6c')],_0x2e47af[_0xfda3('0x67')][_0xfda3('0x6d')]())){try{_0x2e47af[_0xfda3('0x6e')]=_0x119564[_0xfda3('0x7')]?JSON[_0xfda3('0x6f')](_0x119564[_0xfda3('0x7')]):{};}catch(_0x505f45){logger[_0xfda3('0x28')](_0xfda3('0x70'),_0x505f45);}}try{_0x2e47af[_0xfda3('0x71')]=_0x119564[_0xfda3('0x72')]?JSON[_0xfda3('0x6f')](_0x119564['rawHeaders']):{};}catch(_0x5e54e5){logger[_0xfda3('0x28')](_0xfda3('0x73'),_0x5e54e5);}if(_0x119564[_0xfda3('0x74')]){try{var _0x17a13c=require(_0x119564[_0xfda3('0x74')])[_0xfda3('0x75')](this,_0x2e47af);_0x2e47af[_0xfda3('0x76')]=Mustache[_0xfda3('0x77')](_0x119564[_0xfda3('0x66')],_0x17a13c,{},['$$','$$']);if(_0x2e47af[_0xfda3('0x71')]){_0x2e47af[_0xfda3('0x71')]=JSON['parse'](Mustache[_0xfda3('0x77')](JSON['stringify'](_0x2e47af['headers']),_0x17a13c,{},['$$','$$']));}if(_0x2e47af['body']){_0x2e47af[_0xfda3('0x6e')]=JSON['parse'](Mustache[_0xfda3('0x77')](JSON[_0xfda3('0x78')](_0x2e47af['body']),_0x17a13c,{},['$$','$$']));}}catch(_0x2821c1){logger[_0xfda3('0x28')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2821c1);}}rp(_0x2e47af)[_0xfda3('0x11')](function(_0x54fcfc){var _0x35e986={'statusCode':_0x54fcfc[_0xfda3('0x79')]||0xc8,'statusMessage':_0x54fcfc['statusMessage']||'OK','headers':_0x54fcfc[_0xfda3('0x71')]||{},'body':_0x54fcfc[_0xfda3('0x6e')]||{}};_0x5a44ce(null,_0x35e986);})[_0xfda3('0x12')](function(_0x276d6d){var _0x11d159={'statusCode':_0x276d6d['statusCode']||0x1f4,'statusMessage':_0x276d6d[_0xfda3('0x7a')]||_0xfda3('0x7b'),'headers':_0x276d6d[_0xfda3('0x7c')][_0xfda3('0x71')]||{},'body':_0x276d6d[_0xfda3('0x7c')]['body']||{}};_0x5a44ce(null,_0x11d159);});};AGIVertices['prototype']['googleDialogflow']=function(_0x165c7e,_0x3158a7){scripts[_0xfda3('0x7d')](this[_0xfda3('0xb')][_0xfda3('0x34')],_0x165c7e[_0xfda3('0x7e')],_0x165c7e[_0xfda3('0x5d')],_0x165c7e[_0xfda3('0x7f')]||'en')['then'](function(_0xbf1fa2){_0x3158a7(null,_0xbf1fa2);})[_0xfda3('0x12')](function(_0x4bca42){_0x3158a7(_0x4bca42);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x80')]=function(_0x481606,_0x4cd3bd){scripts[_0xfda3('0x80')](this[_0xfda3('0xb')],_0x481606)[_0xfda3('0x11')](function(_0x4106f0){_0x4cd3bd(null,_0x4106f0);})['catch'](function(_0x2fa142){_0x4cd3bd(_0x2fa142);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x81')]=function(_0x42057b,_0x575b8e){scripts[_0xfda3('0x81')](_0x42057b[_0xfda3('0x7e')],_0x42057b[_0xfda3('0x5d')],_0x42057b[_0xfda3('0x82')]||_0xfda3('0x5f'),_0x42057b[_0xfda3('0x83')])[_0xfda3('0x11')](function(_0x86e9b2){_0x575b8e(null,_0x86e9b2);})[_0xfda3('0x12')](function(_0x1f0d33){_0x575b8e(_0x1f0d33);});};AGIVertices[_0xfda3('0xe')]['ispeechASR']=function(_0x4912a5,_0x44d6d7,_0x5d211d){scripts[_0xfda3('0x84')](_0x44d6d7,_0x4912a5['key'],_0x4912a5['ispeech_asr_language']||'en-US',this[_0xfda3('0x85')](_0x4912a5[_0xfda3('0x86')])?_0x4912a5['model']:undefined)['then'](function(_0x54f6b3){_0x5d211d(null,_0x54f6b3);})['catch'](function(_0x4e46ef){_0x5d211d(_0x4e46ef);});};AGIVertices['prototype'][_0xfda3('0x87')]=function(_0x4e0f58,_0x5b9421){scripts[_0xfda3('0x87')](_0x4e0f58['aws_access_key_id'],_0x4e0f58['aws_secret_access_key'],_0x4e0f58[_0xfda3('0x88')],_0x4e0f58[_0xfda3('0x89')]||_0xfda3('0x8a'),_0x4e0f58['text'],_0x4e0f58[_0xfda3('0x8b')]||_0xfda3('0x5d'))[_0xfda3('0x11')](function(_0x2c6f86){_0x5b9421(null,_0x2c6f86);})['catch'](function(_0x3a10a2){_0x5b9421(_0x3a10a2);});};AGIVertices[_0xfda3('0xe')]['awsLex']=function(_0x345ccf,_0x271ccc){scripts[_0xfda3('0x8c')](this[_0xfda3('0xb')][_0xfda3('0x34')],_0x345ccf['aws_access_key_id'],_0x345ccf[_0xfda3('0x8d')],_0x345ccf[_0xfda3('0x8e')],_0x345ccf['text'],_0x345ccf[_0xfda3('0x8f')])[_0xfda3('0x11')](function(_0x57af40){_0x271ccc(null,_0x57af40);})[_0xfda3('0x12')](function(_0xb43cdb){_0x271ccc(_0xb43cdb);});};AGIVertices['prototype']['googleASR']=function(_0x32f3b0,_0x45b6a5,_0x232125){scripts[_0xfda3('0x90')](_0x45b6a5,_0x32f3b0[_0xfda3('0x7e')],_0x32f3b0[_0xfda3('0x91')]||_0xfda3('0x5f'))['then'](function(_0x4ba522){_0x232125(null,_0x4ba522);})[_0xfda3('0x12')](function(_0x18408a){_0x232125(_0x18408a);});};AGIVertices[_0xfda3('0xe')]['tildeASR']=function(_0x14ba5f,_0x162183,_0xd23ce1){scripts['tildeASR'](_0x162183,_0x14ba5f['appid'],_0x14ba5f[_0xfda3('0x92')],_0x14ba5f[_0xfda3('0x76')])[_0xfda3('0x11')](function(_0x4e2d0d){_0xd23ce1(null,_0x4e2d0d);})[_0xfda3('0x12')](function(_0x1695ba){_0xd23ce1(_0x1695ba);});};AGIVertices['prototype'][_0xfda3('0x93')]=function(_0x3c22ac){var _0x5284a7=_[_0xfda3('0x6a')](verticesWithRetry,_0x3c22ac[_0xfda3('0x94')])?_0x3c22ac:_[_0xfda3('0x95')](_0x3c22ac);for(var _0x5e3151 in _0x5284a7){if(_0x5284a7[_0xfda3('0x96')](_0x5e3151)){if(_0x5284a7[_0x5e3151]&&_[_0xfda3('0x97')](_0x5284a7[_0x5e3151])){if(_[_0xfda3('0x6a')](recursiveMapAttributes,_0x5e3151)){_0x5284a7[_0x5e3151]=this['replaceObjectAllVariables'](_0x5284a7[_0x5e3151]);}else{_0x5284a7[_0x5e3151]=this['replaceAllVariables'](_0x5284a7[_0x5e3151]);}}}}return _0x5284a7;};AGIVertices[_0xfda3('0xe')][_0xfda3('0x98')]=function(_0x3e19e0){for(var _0x5ef8a8 in _0x3e19e0){if(_0x3e19e0[_0xfda3('0x96')](_0x5ef8a8)){if(_['isPlainObject'](_0x3e19e0[_0x5ef8a8])){return this['recursiveNodeIndex'](_0x3e19e0[_0x5ef8a8]);}_0x3e19e0[_0x5ef8a8]=this[_0xfda3('0x99')](_0x3e19e0[_0x5ef8a8]);}}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x9a')]=function(_0x2b5bc4,_0x538948){for(var _0x23cc67 in _0x2b5bc4){if(_0x2b5bc4[_0xfda3('0x96')](_0x23cc67)){if(_[_0xfda3('0x9b')](_0x2b5bc4[_0x23cc67])){if(!_[_0xfda3('0x40')](_0x2b5bc4[_0x23cc67])){this['saveRestApiResult'](_0x2b5bc4[_0x23cc67],util['format'](_0xfda3('0x9c'),_0x538948,_0x23cc67));}}else{if(_0x2b5bc4[_0x23cc67]){this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0x9c'),_0x538948,_0x23cc67),_0x2b5bc4[_0x23cc67]);}}}}};AGIVertices[_0xfda3('0xe')]['replaceObjectAllVariables']=function(_0x240046){try{var _0x118adf=JSON[_0xfda3('0x6f')](_0x240046);this[_0xfda3('0x98')](_0x118adf);return JSON[_0xfda3('0x78')](_0x118adf);}catch(_0x2d1911){return this[_0xfda3('0x99')](_0x240046);}};AGIVertices['prototype'][_0xfda3('0x99')]=function(_0x204e00){var _0x3a4afc=_0x204e00[_0xfda3('0x9e')]('{');for(var _0x33429d=0x1;_0x33429d<_0x3a4afc[_0xfda3('0x9f')];_0x33429d+=0x1){var _0x6bbb24=_0x3a4afc[_0x33429d][_0xfda3('0x9e')]('}');if(_0x6bbb24['length']>0x1){_0x204e00=_0x204e00[_0xfda3('0xa0')]('{'+_0x6bbb24[0x0]+'}',this[_0xfda3('0xb')][_0xfda3('0xf')](_0x6bbb24[0x0])['extra']||_0x6bbb24[0x0]);}}if(_0x3a4afc[_0xfda3('0x9f')]===0x1){return _0x204e00[_0xfda3('0x4a')]();}return this[_0xfda3('0x99')](_0x204e00);};AGIVertices[_0xfda3('0xe')][_0xfda3('0xa1')]=function(_0xcd9f53,_0x2229b8){var _0x4e4ab1=this['channel'][_0xfda3('0xf')](_0xcd9f53);if(_0x4e4ab1[_0xfda3('0xa2')]===-0x1){return _0x4e4ab1;}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0xa3'),_0x2229b8,_0x4e4ab1['extra']));return this['channel'][_0xfda3('0x9d')](_0x2229b8,_0x4e4ab1['extra']);};AGIVertices[_0xfda3('0xe')][_0xfda3('0x85')]=function(_0x2cec11){return _0x2cec11&&_0x2cec11!=='0'&&_0x2cec11!=='-1'&&_0x2cec11!=='';};AGIVertices[_0xfda3('0xe')][_0xfda3('0xa4')]=function(_0x340b30){this['createSquareDetailsReport']['sync'](this,_0x340b30,'-');_0x340b30[_0xfda3('0xa5')]=_0x340b30[_0xfda3('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xfda3('0xa6')]=function(_0x30332b){logger['info'](util[_0xfda3('0x26')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x30332b[_0xfda3('0x35')]));return this[_0xfda3('0xb')]['agi']([_0x30332b[_0xfda3('0xa7')],_0x30332b[_0xfda3('0xa8')]]);};AGIVertices['prototype'][_0xfda3('0xa9')]=function(_0x42b2de){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xaa'),_0x42b2de[_0xfda3('0x35')]));if(this[_0xfda3('0x85')](_0x42b2de[_0xfda3('0x68')])){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0xab'),_0x42b2de[_0xfda3('0x68')]));var _0x54d75b=this['channel'][_0xfda3('0xac')](_0x42b2de['timeout']);if(_0x54d75b['result']===-0x1){return _0x54d75b;}}return this[_0xfda3('0xb')]['answer']();};AGIVertices[_0xfda3('0xe')][_0xfda3('0x48')]=function(_0x30f340){logger['info'](util[_0xfda3('0x26')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x30f340['label']));if(!this[_0xfda3('0x85')](_0x30f340[_0xfda3('0x46')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x30f340,_0xfda3('0xad'));}_0x30f340['scheduledAt']=moment();if(this[_0xfda3('0x85')](_0x30f340[_0xfda3('0xae')])){_0x30f340['scheduledAt']=moment()[_0xfda3('0xaf')](_0x30f340['delay'],_0xfda3('0xb0'));}if(!this[_0xfda3('0x85')](_0x30f340[_0xfda3('0x4b')])){_0x30f340['callback_priority']=0x2;}this[_0xfda3('0x3f')]['sync'](this,_0x30f340);return this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xb2'),_0x30f340['phone'],_0x30f340[_0xfda3('0x46')],_0x30f340[_0xfda3('0x47')]));};AGIVertices[_0xfda3('0xe')]['custom_app']=function(_0xca27e3){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xb3'),_0xca27e3[_0xfda3('0x35')]));var _0x1ad1f9=this['channel'][_0xfda3('0x57')](_0xca27e3['application'],_0xca27e3[_0xfda3('0x7c')]);if(_0x1ad1f9[_0xfda3('0xa2')]===-0x1){return _0x1ad1f9;}return this[_0xfda3('0xb')]['noop'](util['format'](_0xfda3('0xb4'),_0xca27e3[_0xfda3('0xb5')],_0xca27e3[_0xfda3('0x7c')]));};AGIVertices[_0xfda3('0xe')][_0xfda3('0xb6')]=function(_0x5191af){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xb7'),_0x5191af['label']));if(!this[_0xfda3('0x85')](_0x5191af[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}var _0x447be3='\x22'+_0x5191af[_0xfda3('0x5d')]+'\x22';if(this[_0xfda3('0x85')](_0x5191af[_0xfda3('0x7c')])){_0x447be3+=','+_0x5191af['options'];}var _0xf843df=this[_0xfda3('0xb')][_0xfda3('0x57')]('MRCPSynth',_0x447be3);if(_0xf843df[_0xfda3('0xa2')]===-0x1){return _0xf843df;}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x447be3));};AGIVertices['prototype']['sestektts']=function(_0x2086e6){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0xb9'),_0x2086e6[_0xfda3('0x35')]));if(!this['isConfigured'](_0x2086e6['text'])){return this['channel'][_0xfda3('0xb1')](_0xfda3('0xb8'));}var _0x1f5ba7='\x22'+_0x2086e6[_0xfda3('0x5d')]+'\x22';if(this[_0xfda3('0x85')](_0x2086e6[_0xfda3('0x7c')])){_0x1f5ba7+=','+_0x2086e6[_0xfda3('0x7c')];}var _0x13aade=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0xba'),_0x1f5ba7);if(_0x13aade['result']===-0x1){return _0x13aade;}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1f5ba7));};AGIVertices['prototype'][_0xfda3('0xbb')]=function(_0x123363){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0xbc'),_0x123363[_0xfda3('0x35')]));if(!this['isConfigured'](_0x123363['grammar'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20grammar\x20configured');}var _0xd391f6=_0x123363[_0xfda3('0xbd')];if(this[_0xfda3('0x85')](_0x123363['options'])){_0xd391f6+=','+_0x123363[_0xfda3('0x7c')];}var _0x266ba1=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0xbe'),_0xd391f6);if(_0x266ba1[_0xfda3('0xa2')]===-0x1){return _0x266ba1;}var _0x46e53a=this['getAndSetVariable'](_0xfda3('0xbf'),_0xfda3('0xc0'));if(_0x46e53a[_0xfda3('0xa2')]===-0x1){return _0x46e53a;}var _0x22b05a=this['getAndSetVariable'](_0xfda3('0xc1'),_0xfda3('0xc2'));if(_0x22b05a['result']===-0x1){return _0x22b05a;}var _0x5c89d5=this[_0xfda3('0xa1')](_0xfda3('0xc3'),_0xfda3('0xc4'));if(_0x5c89d5['result']===-0x1){return _0x5c89d5;}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0xd391f6));};AGIVertices[_0xfda3('0xe')]['sestekasr']=function(_0x4f22f3){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xc5'),_0x4f22f3[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x4f22f3['grammar'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20grammar\x20configured');}var _0x132c7b=_0x4f22f3['grammar'];if(this[_0xfda3('0x85')](_0x4f22f3[_0xfda3('0x7c')])){_0x132c7b+=','+_0x4f22f3[_0xfda3('0x7c')];}var _0x22809d=this[_0xfda3('0xb')]['exec'](_0xfda3('0xbe'),_0x132c7b);if(_0x22809d[_0xfda3('0xa2')]===-0x1){return _0x22809d;}var _0x310dbc=this[_0xfda3('0xa1')]('RECOG_CONFIDENCE()',_0xfda3('0xc6'));if(_0x310dbc[_0xfda3('0xa2')]===-0x1){return _0x310dbc;}var _0x44bcb8=this[_0xfda3('0xa1')](_0xfda3('0xc1'),'SESTEK_ASR_TRANSCRIPT');if(_0x44bcb8[_0xfda3('0xa2')]===-0x1){return _0x44bcb8;}var _0x1c9917=this[_0xfda3('0xa1')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x1c9917[_0xfda3('0xa2')]===-0x1){return _0x1c9917;}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x132c7b));};AGIVertices[_0xfda3('0xe')][_0xfda3('0xc7')]=function(_0x5cca1){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0xc8'),_0x5cca1['label']));if(!this['isConfigured'](_0x5cca1[_0xfda3('0xc9')])){return this[_0xfda3('0xb')]['error'](_0x5cca1,_0xfda3('0xca'));}var _0x3c9654=this[_0xfda3('0x18')][_0xfda3('0x75')](this,_0x5cca1[_0xfda3('0xc9')]);if(!_0x3c9654){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5cca1,_0xfda3('0xcb'));}if(!this['isConfigured'](_0x5cca1[_0xfda3('0x2c')])){return this[_0xfda3('0xb')]['error'](_0x5cca1,'no\x20query\x20configured');}var _0x30125d=_0x5cca1[_0xfda3('0x2c')][_0xfda3('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0xcc'),_0x30125d));var _0x1c51d6=this['getQueryOdbc']['sync'](this,_0x3c9654,_0x30125d);this[_0xfda3('0x33')]['sync'](this,_0x5cca1,_0x30125d);if(!this['isConfigured'](_0x5cca1[_0xfda3('0xcd')])){return this['channel']['noop'](_0xfda3('0xce'));}var _0x24e9ea=this[_0xfda3('0xf')]['sync'](this,_0x5cca1['variable_id']);if(!_0x24e9ea){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5cca1,'no\x20variable\x20found');}var _0x2f307e=this;_0x1c51d6[_0xfda3('0xcf')](function(_0xbca34c,_0x131c42){Object[_0xfda3('0xd0')](_0xbca34c)[_0xfda3('0xcf')](function(_0x49e3db){_0x2f307e[_0xfda3('0xb')]['setVariable'](util[_0xfda3('0x26')](_0xfda3('0xd1'),_0x24e9ea,_0x131c42,_0x49e3db),_0xbca34c[_0x49e3db]);});});this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0xd2'),_0x24e9ea),_0x1c51d6['length']);return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xd3'),_0x24e9ea));};AGIVertices[_0xfda3('0xe')][_0xfda3('0xd4')]=function(_0x2e3604){logger[_0xfda3('0xd5')](util[_0xfda3('0x26')](_0xfda3('0xd6'),_0x2e3604[_0xfda3('0x35')]));if(!this['isConfigured'](_0x2e3604[_0xfda3('0xd7')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x2e3604,_0xfda3('0xd8'));}var _0x74ef1b=this[_0xfda3('0xd9')]['sync'](this,_0x2e3604[_0xfda3('0xd7')]);if(!_0x74ef1b){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x2e3604,_0xfda3('0xda'));}var _0x3a914e=this['channel']['exec']('DIAL',[util['format']('SIP/%s',_0x74ef1b),_0x2e3604[_0xfda3('0x68')],_0x2e3604['opts'],_0x2e3604[_0xfda3('0x66')]]);if(_0x3a914e['result']===-0x1){return _0x3a914e;}return this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xdb'),_0xfda3('0xdc')));};AGIVertices[_0xfda3('0xe')][_0xfda3('0xdd')]=function(_0xd24edc){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0xde'),_0xd24edc['label']));if(!this[_0xfda3('0x85')](_0xd24edc[_0xfda3('0x7e')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20key\x20configured');}if(!this[_0xfda3('0x85')](_0xd24edc[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}this[_0xfda3('0xb')][_0xfda3('0xdf')]=!![];this['createSquareDetailsReport'](_0xd24edc);this[_0xfda3('0x3e')](_0xd24edc[_0xfda3('0x5d')],'in');this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xe0'),_0xd24edc[_0xfda3('0x5d')]));var _0x34ada9=this[_0xfda3('0x7d')][_0xfda3('0x75')](this,_0xd24edc);if(_0x34ada9){for(var _0x721dfa in _0x34ada9){if(_0x34ada9['hasOwnProperty'](_0x721dfa)){this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0xe1'),_0x721dfa[_0xfda3('0x6d')]()),_0x34ada9[_0x721dfa]);}}this['createSquareMessage'](_0x34ada9[_0xfda3('0xe2')],'out');return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Dialogflow\x20Result\x20%s',_0x34ada9['speech']));}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0xd24edc,_0xfda3('0xe3'));};AGIVertices[_0xfda3('0xe')]['sesteknda']=function(_0x1c50fb){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xe4'),_0x1c50fb[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x1c50fb['ndauth_url'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xe5'));}if(!this[_0xfda3('0x85')](_0x1c50fb[_0xfda3('0xe6')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xe7'));}if(!this[_0xfda3('0x85')](_0x1c50fb[_0xfda3('0xe8')])){return this['channel']['noop'](_0xfda3('0xe9'));}if(!this['isConfigured'](_0x1c50fb['ndassistant_url'])){return this[_0xfda3('0xb')]['noop'](_0xfda3('0xb8'));}this['channel'][_0xfda3('0xdf')]=!![];this['createSquareDetailsReport'](_0x1c50fb);this[_0xfda3('0x3e')](_0x1c50fb['text'],'in');this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xea'),_0x1c50fb[_0xfda3('0x5d')]));var _0xf3655f=this[_0xfda3('0x80')][_0xfda3('0x75')](this,_0x1c50fb);if(_0xf3655f){for(var _0xbc5ae0 in _0xf3655f){if(_0xf3655f[_0xfda3('0x96')](_0xbc5ae0)){this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')]('SESTEK_NDA_%s',_0xbc5ae0[_0xfda3('0x6d')]()),_0xf3655f[_0xbc5ae0]);}}this[_0xfda3('0x3e')](_0xf3655f[_0xfda3('0xe2')],_0xfda3('0xeb'));if(_0xf3655f[_0xfda3('0xec')]){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xed'),_0xf3655f[_0xfda3('0xec')]));var _0x2472bf=this[_0xfda3('0xb')][_0xfda3('0xee')](_0xf3655f['audiofile']);try{fs[_0xfda3('0xef')](_0xf3655f['audiofile']+'.wav');}catch(_0x3c0618){logger['error'](_0x3c0618);}return _0x2472bf;}else{return this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')]('SestekNDA\x20Result\x20%s',_0xf3655f[_0xfda3('0xe2')]));}}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x1c50fb,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xfda3('0xe')][_0xfda3('0xf0')]=function(_0x4a791e){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xf1'),_0x4a791e[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xf0'));};AGIVertices[_0xfda3('0xe')]['ext_dial']=function(_0x91ac56){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0xf2'),_0x91ac56[_0xfda3('0x35')]));var _0x2bb244='';if(_0x91ac56[_0xfda3('0xf3')]){if(!this[_0xfda3('0x85')](_0x91ac56[_0xfda3('0xf3')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x91ac56,_0xfda3('0xf4'));}else{var _0x2e16f4=parseInt(_0x91ac56[_0xfda3('0xf3')],0xa);if(isNaN(_0x2e16f4)){_0x2bb244=_0x91ac56[_0xfda3('0xf3')];}else{_0x2bb244=this[_0xfda3('0x1b')]['sync'](this,_0x91ac56[_0xfda3('0xf3')]);if(!_0x2bb244){return this[_0xfda3('0xb')]['error'](_0x91ac56,_0xfda3('0xf5'));}}}}else if(_0x91ac56[_0xfda3('0xf6')]){_0x2bb244=_0x91ac56[_0xfda3('0xf6')];}else{return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x91ac56,'no\x20trunk\x20selected');}var _0x531a10=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0xdc'),[util['format']('SIP/%s/%s',_0x2bb244,_0x91ac56[_0xfda3('0x45')]),_0x91ac56[_0xfda3('0x68')],_0x91ac56[_0xfda3('0xf7')],_0x91ac56[_0xfda3('0x66')]]);if(_0x531a10[_0xfda3('0xa2')]===-0x1){return _0x531a10;}return this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')](_0xfda3('0xdb'),_0xfda3('0xdc')));};AGIVertices['prototype'][_0xfda3('0xf8')]=function(_0x4a2808){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0xf9'),_0x4a2808[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xf8'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x9')]=function(_0x20a69f){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x20a69f[_0xfda3('0x35')]));if(_0x20a69f[_0xfda3('0xa5')]===0x0){return this[_0xfda3('0xa4')](_0x20a69f);}_0x20a69f[_0xfda3('0xa5')]-=0x1;if(!this[_0xfda3('0x85')](_0x20a69f[_0xfda3('0xfa')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x20a69f,'no\x20file\x20audio\x20selected');}var _0x24030e=this[_0xfda3('0x1d')][_0xfda3('0x75')](this,_0x20a69f[_0xfda3('0xfa')]);if(!_0x24030e){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x20a69f,'no\x20file\x20audio\x20found');}if(!this[_0xfda3('0x85')](_0x20a69f[_0xfda3('0xcd')])){return this['channel'][_0xfda3('0x28')](_0xfda3('0xce'));}var _0x493003=this['channel'][_0xfda3('0xfb')](_0x24030e,_0x20a69f[_0xfda3('0xfc')],_0x20a69f[_0xfda3('0xfd')]);var _0x53de0b=_0x493003['result']?_0x493003[_0xfda3('0xa2')][_0xfda3('0x4a')]():'';logger[_0xfda3('0x2a')](_0xfda3('0xfe'),JSON['stringify'](_0x493003));if(_0x493003[_0xfda3('0xa2')]===-0x1){this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x20a69f,_0x53de0b);return _0x493003;}else if(_0x493003['extra']===_0xfda3('0x68')){_0x493003[_0xfda3('0xa2')]=_0x53de0b[_0xfda3('0x9f')]>=parseInt(_0x20a69f[_0xfda3('0xff')])?'x':'i';}else{_0x493003[_0xfda3('0xa2')]=_0x53de0b[_0xfda3('0x9f')]>=parseInt(_0x20a69f['mindigit'])&&_0x53de0b[_0xfda3('0x9f')]<=parseInt(_0x20a69f[_0xfda3('0xfd')])?'x':'i';}var _0x5332d9=this['getVariable'][_0xfda3('0x75')](this,_0x20a69f[_0xfda3('0xcd')]);if(!_0x5332d9){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x20a69f,_0xfda3('0x100'));}this[_0xfda3('0xb')][_0xfda3('0x9d')](_0x5332d9,_0x53de0b);if(this[_0xfda3('0x85')](_0x20a69f['hiddendigitsnum'])){var _0x1ffcdc=parseInt(_0x20a69f['hiddendigitsnum'],0xa);var _0x20bfc7=rs[_0xfda3('0x101')]({'charset':'*','length':_0x1ffcdc});var _0x55b55f=_0x53de0b[_0xfda3('0x9f')];if(_0x55b55f>0x0){if(_0x55b55f>_0x1ffcdc){this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x20a69f,_0x20a69f[_0xfda3('0x102')]===_0xfda3('0x103')?_0x20bfc7+_0x53de0b['substr'](_0x1ffcdc):_0x53de0b[_0xfda3('0x104')](0x0,_0x55b55f-_0x1ffcdc)+_0x20bfc7);}else{this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x20a69f,rs['generate']({'charset':'*','length':_0x55b55f}));}}else{this['createSquareDetailsReport'][_0xfda3('0x75')](this,_0x20a69f,'');}}else{this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x20a69f,_0x53de0b);}return _0x493003;};AGIVertices['prototype'][_0xfda3('0xa')]=function(_0x130f49){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x105'),_0x130f49['label']));return this[_0xfda3('0x9')](_0x130f49);};AGIVertices['prototype']['goal']=function(_0x2a41eb){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x106'),_0x2a41eb['label']));this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x2a41eb,_0x2a41eb[_0xfda3('0x107')]);return this['channel']['noop'](util[_0xfda3('0x26')](_0xfda3('0x108'),_0x2a41eb[_0xfda3('0x107')]));};AGIVertices['prototype'][_0xfda3('0x109')]=function(_0x49fafe){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x10a'),_0x49fafe['label']));if(!this[_0xfda3('0x85')](_0x49fafe[_0xfda3('0x10b')])||!this['isConfigured'](_0x49fafe[_0xfda3('0x8d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x10c'));}if(!this[_0xfda3('0x85')](_0x49fafe[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20text\x20configured');}this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x10d'),_0x49fafe[_0xfda3('0x5d')]));var _0x3bcf74=this[_0xfda3('0x87')]['sync'](this,_0x49fafe);if(_0x3bcf74){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('aws\x20Polly\x20%s\x20file\x20created',_0x3bcf74));var _0x5c912f=this[_0xfda3('0xb')][_0xfda3('0xee')](_0x3bcf74);try{fs[_0xfda3('0xef')](_0x3bcf74+_0xfda3('0x10e'));}catch(_0x69746f){logger['error'](_0x69746f);}return _0x5c912f;}return this['channel'][_0xfda3('0x28')](_0x49fafe,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0xfda3('0x10f')]=function(_0x54a408){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x110'),_0x54a408[_0xfda3('0x35')]));if(!this['isConfigured'](_0x54a408['aws_access_key_id'])||!this['isConfigured'](_0x54a408[_0xfda3('0x8d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x10c'));}if(!this[_0xfda3('0x85')](_0x54a408[_0xfda3('0x8f')])){return this['channel'][_0xfda3('0xb1')](_0xfda3('0x111'));}if(!this[_0xfda3('0x85')](_0x54a408[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}this[_0xfda3('0xb')][_0xfda3('0xdf')]=!![];this['createSquareDetailsReport'](_0x54a408);this[_0xfda3('0x3e')](_0x54a408[_0xfda3('0x5d')],'in');this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x112'),_0x54a408[_0xfda3('0x5d')]));var _0xaae0c3=this['awsLex']['sync'](this,_0x54a408);if(_0xaae0c3){for(var _0x457d2e in _0xaae0c3){if(_0xaae0c3['hasOwnProperty'](_0x457d2e)&&_[_0xfda3('0x97')](_0xaae0c3[_0x457d2e])){this['channel'][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0x113'),_0x457d2e['toUpperCase']()),_0xaae0c3[_0x457d2e]);}}if(_[_0xfda3('0x44')](_0xaae0c3['message'])){return this['channel']['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xfda3('0x3e')](_0xaae0c3[_0xfda3('0x7a')],_0xfda3('0xeb'));return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0xaae0c3[_0xfda3('0x7a')]));}}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x54a408,_0xfda3('0x114'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x115')]=function(_0xac443b){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0xac443b[_0xfda3('0x35')],_0xac443b[_0xfda3('0x68')]));if(!this[_0xfda3('0x85')](_0xac443b[_0xfda3('0x7e')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x116'));}var _0x393726=_0xfda3('0x117');var _0x3d1e83=util[_0xfda3('0x26')](_0xfda3('0x118'),FILES_PATH,rs[_0xfda3('0x101')](0x4));var _0x2c8de7=util[_0xfda3('0x26')]('%s.%s',_0x3d1e83,_0x393726);var _0x7e7c02=!![];if(_0xac443b[_0xfda3('0x119')]===_0xfda3('0x11a')){_0x7e7c02=![];}var _0x5f1012=this[_0xfda3('0xb')][_0xfda3('0x11b')](_0x3d1e83,_0x393726,_0xac443b['intKey'],_0xac443b[_0xfda3('0x68')],undefined,_0x7e7c02);if(_0x5f1012[_0xfda3('0xa2')]!==-0x1){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('google\x20%s\x20file\x20created',_0x2c8de7));var _0x936155=this[_0xfda3('0x90')][_0xfda3('0x75')](this,_0xac443b,_0x2c8de7);if(_0x936155){for(var _0x3dd3fa in _0x936155){if(_0x936155[_0xfda3('0x96')](_0x3dd3fa)){this['channel'][_0xfda3('0x9d')](util['format'](_0xfda3('0x11c'),_0x3dd3fa['toUpperCase']()),_0x936155[_0x3dd3fa]);}}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xfda3('0x78')](_0x936155)));}}return _0x5f1012;};AGIVertices[_0xfda3('0xe')][_0xfda3('0x11d')]=function(_0x386c11){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x11e'),_0x386c11[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x386c11['appid'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x11f'));}if(!this['isConfigured'](_0x386c11[_0xfda3('0x92')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x120'));}var _0x45aefd='wav';var _0xb44448=util[_0xfda3('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0xfda3('0x101')](0x4));var _0x5357ae=util['format'](_0xfda3('0x9c'),_0xb44448,_0x45aefd);var _0x1dd02d=!![];if(_0x386c11[_0xfda3('0x119')]===_0xfda3('0x11a')){_0x1dd02d=![];}var _0x5212c0=this['channel'][_0xfda3('0x11b')](_0xb44448,_0x45aefd,_0x386c11[_0xfda3('0x121')],_0x386c11['timeout'],undefined,_0x1dd02d);if(_0x5212c0['result']!==-0x1){this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')](_0xfda3('0x122'),_0x5357ae));var _0x537ee=this[_0xfda3('0x123')]['sync'](this,_0x386c11,_0x5357ae);if(_0x537ee){for(var _0x421654 in _0x537ee){if(_0x537ee[_0xfda3('0x96')](_0x421654)){this['channel'][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0x124'),_0x421654['toUpperCase']()),_0x537ee[_0x421654]);}}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0x125'),JSON[_0xfda3('0x78')](_0x537ee)));}}return _0x5212c0;};AGIVertices['prototype'][_0xfda3('0x126')]=function(_0x54101f){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x127'),_0x54101f[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0x128')](_0x54101f['context'],_0x54101f[_0xfda3('0x3a')],_0x54101f[_0xfda3('0x3b')]);};AGIVertices[_0xfda3('0xe')]['gotoif']=function(_0x514ce1){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x129'),_0x514ce1['label']));if(!this[_0xfda3('0x85')](_0x514ce1[_0xfda3('0x12a')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x514ce1,'no\x20condition\x20configured');}try{var _0x2663ac=eval(_0x514ce1[_0xfda3('0x12a')])?_0xfda3('0x12b'):_0xfda3('0x12c');this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0x12d'),_0x514ce1[_0xfda3('0x12a')],_0x2663ac));return{'code':0xc8,'result':_0x2663ac};}catch(_0x581715){return{'code':0xc8,'result':_0xfda3('0x12c')};}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x12e')]=function(_0x5a924d){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x12f'),_0x5a924d[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x5a924d['interval_id'])){return this[_0xfda3('0xb')]['error'](_0x5a924d,'no\x20interval\x20configured');}var _0xbb557b=this[_0xfda3('0x21')]['sync'](this,_0x5a924d[_0xfda3('0x130')]);if(!_0xbb557b){return this['channel'][_0xfda3('0x28')](_0x5a924d,_0xfda3('0x131'));}for(var _0x19f659=0x0;_0x19f659<_0xbb557b[_0xfda3('0x9f')];_0x19f659+=0x1){var _0x117020=this[_0xfda3('0xb')]['getVariable'](util['format'](_0xfda3('0x132'),_0xbb557b[_0x19f659]));if(_0x117020[_0xfda3('0xa2')]===-0x1){return _0x117020;}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x133'),_0xbb557b[_0x19f659],_0x117020[_0xfda3('0x134')]));if(_0x117020[_0xfda3('0x134')]===_0xfda3('0x12b')){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x133'),_0xbb557b[_0x19f659],_0xfda3('0x12b')));this['channel']['noop'](util['format']('IFTIME\x20%s\x20%s',_0xbb557b[_0x19f659],_0xfda3('0x12b')));return{'code':0xc8,'result':'true'};}else{logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x133'),_0xbb557b[_0x19f659],_0xfda3('0x12c')));this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('IFTIME\x20%s\x20%s',_0xbb557b[_0x19f659],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0xfda3('0x135')]=function(_0x388be6){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x136'),_0x388be6['label']));return this[_0xfda3('0xb')][_0xfda3('0x135')]();};AGIVertices[_0xfda3('0xe')][_0xfda3('0x137')]=function(_0x3ba56c){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x138'),_0x3ba56c[_0xfda3('0x35')]));if(!this['isConfigured'](_0x3ba56c[_0xfda3('0x7e')])){return this[_0xfda3('0xb')]['noop'](_0xfda3('0x116'));}var _0x3dfbf6='wav';var _0xb1dfed=util[_0xfda3('0x26')](_0xfda3('0x118'),FILES_PATH,rs['generate'](0x4));var _0x2e730d=util[_0xfda3('0x26')]('%s.%s',_0xb1dfed,_0x3dfbf6);var _0x3732ef=!![];if(_0x3ba56c[_0xfda3('0x119')]==='NOBEEP'){_0x3732ef=![];}var _0x29a966=this['channel'][_0xfda3('0x11b')](_0xb1dfed,_0x3dfbf6,_0x3ba56c['intKey'],_0x3ba56c['timeout'],undefined,_0x3732ef);if(_0x29a966[_0xfda3('0xa2')]!==-0x1){this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')](_0xfda3('0x139'),_0x2e730d));var _0x1b69a7=this[_0xfda3('0x84')][_0xfda3('0x75')](this,_0x3ba56c,_0x2e730d);if(_0x1b69a7){for(var _0x56c2f1 in _0x1b69a7){if(_0x1b69a7['hasOwnProperty'](_0x56c2f1)){this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')]('ISPEECH_ASR_%s',_0x56c2f1['toUpperCase']()),_0x1b69a7[_0x56c2f1]);}}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('IspeechASR\x20Result\x20%s',JSON[_0xfda3('0x78')](_0x1b69a7)));}}return _0x29a966;};AGIVertices['prototype'][_0xfda3('0x13a')]=function(_0x270626){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x13b'),_0x270626['label']));if(!this[_0xfda3('0x85')](_0x270626['key'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x270626[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20text\x20configured');}this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x13c'),_0x270626['text']));var _0x5becbf=this[_0xfda3('0x81')][_0xfda3('0x75')](this,_0x270626);if(_0x5becbf){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x139'),_0x5becbf));var _0x4bcdc0=this[_0xfda3('0xb')][_0xfda3('0xee')](_0x5becbf,_0x270626[_0xfda3('0x121')]);try{fs[_0xfda3('0xef')](_0x5becbf+_0xfda3('0x10e'));}catch(_0x55eba1){logger[_0xfda3('0x28')](_0x55eba1);}return _0x4bcdc0;}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x270626,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfda3('0xe')]['login']=function(_0x5f4bac){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x13d'),_0x5f4bac[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x5f4bac[_0xfda3('0x13e')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5f4bac,_0xfda3('0x13f'));}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x140'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac['findBy']));var _0x4d1985=this[_0xfda3('0x52')][_0xfda3('0x75')](this,_0x5f4bac[_0xfda3('0x13e')]);if(_0x4d1985){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac[_0xfda3('0x13e')]));this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x142')};}else{logger['info'](util[_0xfda3('0x26')](_0xfda3('0x143'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac[_0xfda3('0x13e')]));this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x144')};}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x145')]=function(_0x84b4ef){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x146'),_0x84b4ef[_0xfda3('0x35')]));if(!this['isConfigured'](_0x84b4ef[_0xfda3('0x13e')])){return this[_0xfda3('0xb')]['error'](_0x84b4ef,_0xfda3('0x13f'));}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x140'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x84b4ef[_0xfda3('0x13e')]));var _0x5f260a=this[_0xfda3('0x147')][_0xfda3('0x75')](this,_0x84b4ef[_0xfda3('0x13e')]);if(_0x5f260a){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x84b4ef['findBy']));this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x84b4ef['findBy']));return{'code':0xc8,'result':_0xfda3('0x142')};}else{logger[_0xfda3('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xfda3('0x4f')],_0x84b4ef[_0xfda3('0x13e')]));this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')](_0xfda3('0x143'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x84b4ef[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x144')};}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x148')]=function(_0xc63d3f){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x149'),_0xc63d3f[_0xfda3('0x35')]));if(!this['isConfigured'](_0xc63d3f[_0xfda3('0x14a')])){return this[_0xfda3('0xb')]['error'](_0xc63d3f,'no\x20operation\x20configured');}this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x14b'),_0xc63d3f['operation']));var _0x5676c2=eval(_0xc63d3f[_0xfda3('0x14a')]);if(!this[_0xfda3('0x85')](_0xc63d3f['variable_id'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xce'));}var _0x3fa048=this[_0xfda3('0xf')][_0xfda3('0x75')](this,_0xc63d3f[_0xfda3('0xcd')]);if(!_0x3fa048){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0xc63d3f,_0xfda3('0x100'));}if(_[_0xfda3('0x14c')](_0x5676c2)){var _0x43d183=this;_0x5676c2[_0xfda3('0xcf')](function(_0x1bde0c,_0x4d1810){_0x43d183[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0x14d'),_0x3fa048,_0x4d1810),_0x1bde0c);});return this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0x14e'),_0x3fa048));}else{return this[_0xfda3('0xb')][_0xfda3('0x9d')](_0x3fa048,_0x5676c2);}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x8')]=function(_0x396b5a){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x14f'),_0x396b5a[_0xfda3('0x35')]));if(_0x396b5a[_0xfda3('0xa5')]===0x0){return this['maxRetry'](_0x396b5a);}_0x396b5a[_0xfda3('0xa5')]-=0x1;if(!this['isConfigured'](_0x396b5a[_0xfda3('0xfa')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x396b5a,_0xfda3('0x150'));}var _0x5806b6=this[_0xfda3('0x1d')][_0xfda3('0x75')](this,_0x396b5a[_0xfda3('0xfa')]);if(!_0x5806b6){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x396b5a,_0xfda3('0x151'));}var _0x2cc67d=this['channel'][_0xfda3('0xfb')](_0x5806b6,_0x396b5a[_0xfda3('0xfc')],_0x396b5a['digit']);var _0xb863e1=_0x2cc67d[_0xfda3('0xa2')];if(_0x2cc67d[_0xfda3('0xa2')]===-0x1){this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x396b5a,'-1');return _0x2cc67d;}else if(_0x2cc67d['extra']===_0xfda3('0x68')){_0x2cc67d['result']=_0x2cc67d[_0xfda3('0xa2')][_0xfda3('0x9f')]>0x0?_0x2cc67d[_0xfda3('0xa2')]:'t';}else if(_[_0xfda3('0x40')](_0x2cc67d[_0xfda3('0xa2')])){_0x2cc67d[_0xfda3('0xa2')]='#';_0xb863e1='#';}if(!this['isConfigured'](_0x396b5a[_0xfda3('0xcd')])){this[_0xfda3('0xb')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x5f152b=this[_0xfda3('0xf')][_0xfda3('0x75')](this,_0x396b5a[_0xfda3('0xcd')]);if(!_0x5f152b){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x396b5a,_0xfda3('0x100'));}this[_0xfda3('0xb')][_0xfda3('0x9d')](_0x5f152b,_0xb863e1);}this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x396b5a,_0xb863e1);return _0x2cc67d;};AGIVertices[_0xfda3('0xe')][_0xfda3('0xb1')]=function(_0x160cd5){logger['info'](util['format'](_0xfda3('0x152'),_0x160cd5[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0x160cd5[_0xfda3('0x153')]||_0x160cd5[_0xfda3('0x35')]);};AGIVertices[_0xfda3('0xe')][_0xfda3('0x154')]=function(_0xfc6b3f){logger['info'](util['format'](_0xfda3('0x155'),_0xfc6b3f[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0xfc6b3f[_0xfda3('0x13e')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0xfc6b3f,_0xfda3('0x13f'));}logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x140'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0xfc6b3f[_0xfda3('0x13e')]));var _0x1a904e=this['getPause'][_0xfda3('0x75')](this,_0xfc6b3f[_0xfda3('0x156')]);var _0x25eb46=this['agentPause'][_0xfda3('0x75')](this,_0xfc6b3f[_0xfda3('0x13e')],_0x1a904e);if(_0x25eb46){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0xfc6b3f['findBy']));this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xfda3('0xb')][_0xfda3('0x4f')],_0xfc6b3f['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xfda3('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfda3('0xb')][_0xfda3('0x4f')],_0xfc6b3f[_0xfda3('0x13e')]));this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x141'),this['channel']['callerid'],_0xfc6b3f[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x144')};}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x157')]=function(_0x5882fd){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x158'),_0x5882fd['label']));if(!this['isConfigured'](_0x5882fd['file_id'])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5882fd,_0xfda3('0x150'));}var _0x5340d7=this['getSound']['sync'](this,_0x5882fd[_0xfda3('0xfa')]);if(!_0x5340d7){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5882fd,'no\x20file\x20audio\x20found');}var _0x35ee1b=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0x159'),[_0x5340d7,_0x5882fd[_0xfda3('0xf7')]]);if(_0x35ee1b[_0xfda3('0xa2')]===-0x1){return _0x35ee1b;}return this[_0xfda3('0xb')]['noop'](util['format'](_0xfda3('0xb4'),_0xfda3('0x159'),_0x5340d7));};AGIVertices['prototype']['queue']=function(_0x35ea8d){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x15a'),_0x35ea8d['label']));if(!this[_0xfda3('0x85')](_0x35ea8d[_0xfda3('0x15b')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x35ea8d,_0xfda3('0x15c'));}var _0xf6c4ce='';var _0x3db281=parseInt(_0x35ea8d['queue_id'],0xa);if(isNaN(_0x3db281)){_0xf6c4ce=_0x35ea8d[_0xfda3('0x15b')];}else{_0xf6c4ce=this[_0xfda3('0x13')][_0xfda3('0x75')](this,_0x35ea8d['queue_id']);if(!_0xf6c4ce){return this['channel']['error'](_0x35ea8d,_0xfda3('0x15d'));}}var _0x59e99b='';if(this['isConfigured'](_0x35ea8d[_0xfda3('0xfa')])){var _0x55a114=this[_0xfda3('0x1d')][_0xfda3('0x75')](this,_0x35ea8d['file_id']);if(_0x55a114){_0x59e99b=_0x55a114;}}this['createSquareDetailsReport'][_0xfda3('0x75')](this,_0x35ea8d,_0xf6c4ce);if(_0x35ea8d['opts'][_0xfda3('0x15e')]('x')<0x0){_0x35ea8d[_0xfda3('0xf7')]+='x';}if(_0x35ea8d['opts'][_0xfda3('0x15e')]('X')<0x0){_0x35ea8d[_0xfda3('0xf7')]+='X';}this[_0xfda3('0xb')][_0xfda3('0x9d')]('XMCS-QUEUE',_0xf6c4ce?_0xf6c4ce[_0xfda3('0x15f')]():'');var _0x3941fe=this['channel'][_0xfda3('0x57')](_0xfda3('0x160'),[_0xf6c4ce,_0x35ea8d[_0xfda3('0xf7')],_0x35ea8d['url'],_0x59e99b,_0x35ea8d[_0xfda3('0x68')],_0x35ea8d[_0xfda3('0xa6')],_0x35ea8d['macro'],_0x35ea8d['gosub'],'',_0x35ea8d[_0xfda3('0x161')]]);if(_0x3941fe[_0xfda3('0xa2')]===-0x1){return _0x3941fe;}return this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xb4'),'QUEUE',_0xf6c4ce));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x162')]=function(_0x390140){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x390140['label']));var _0x506ff1=_0x390140['recordingFormat']||_0xfda3('0x117');var _0x1fbdc3=util[_0xfda3('0x26')](_0xfda3('0x163'),this[_0xfda3('0xb')][_0xfda3('0x34')],rs['generate'](0x5));var _0x2079fb=util['format'](_0xfda3('0x164'),FILES_PATH,_0x1fbdc3,_0x506ff1);var _0x1cc293=util[_0xfda3('0x26')](_0xfda3('0x118'),FILES_PATH,_0x1fbdc3);this['createSquareRecording'][_0xfda3('0x75')](this,_0x390140,_0x1fbdc3,_0x2079fb);this[_0xfda3('0xb')][_0xfda3('0x9d')]('RECORDING_SAVENAME',_0x1fbdc3);logger[_0xfda3('0x2a')](_0xfda3('0x165'),_0x1cc293,_0x506ff1,_0x390140['escape_digits'],_0x390140['timeout']);return this[_0xfda3('0xb')][_0xfda3('0x11b')](_0x1cc293,_0x506ff1,_0x390140['escape_digits'],_0x390140[_0xfda3('0x68')],undefined,!![]);};AGIVertices['prototype'][_0xfda3('0x166')]=function(_0x23c7f7){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x167'),_0x23c7f7[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x23c7f7['url'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20url\x20configured');}var _0x489faf=this[_0xfda3('0x65')][_0xfda3('0x75')](this,_0x23c7f7);logger['info'](util['format'](_0xfda3('0x168'),util[_0xfda3('0x169')](_0x489faf,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x23c7f7[_0xfda3('0xcd')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x4aaf9b=this['getVariable'][_0xfda3('0x75')](this,_0x23c7f7[_0xfda3('0xcd')]);if(!_0x4aaf9b){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x23c7f7,_0xfda3('0x100'));}this[_0xfda3('0xb')][_0xfda3('0x9d')](util['format'](_0xfda3('0x16a'),_0x4aaf9b),_0x489faf['statusCode']?_0x489faf[_0xfda3('0x79')]:_0xfda3('0x16b'));this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')]('%s_STATUS_MESSAGE',_0x4aaf9b),_0x489faf['statusMessage']?_0x489faf[_0xfda3('0x16c')]:'OK');if(_0x489faf[_0xfda3('0x6e')]){try{this[_0xfda3('0x9a')](_0x489faf[_0xfda3('0x6e')],_0x4aaf9b);}catch(_0x2bb516){logger['error'](util['format'](_0xfda3('0x16d'),_0x4aaf9b));}}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xd3'),_0x4aaf9b));};AGIVertices['prototype'][_0xfda3('0x16e')]=function(_0x2d7737){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x16f'),_0x2d7737[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0x170')](_0x2d7737[_0xfda3('0x171')][_0xfda3('0x59')](/\s+/g,''),_0x2d7737[_0xfda3('0x172')]);};AGIVertices['prototype']['saynumber']=function(_0x480b90){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x173'),_0x480b90[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0x174')](_0x480b90[_0xfda3('0x69')][_0xfda3('0x59')](/\s+/g,''),_0x480b90[_0xfda3('0x172')]);};AGIVertices['prototype'][_0xfda3('0x175')]=function(_0x3f795f){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x176'),_0x3f795f[_0xfda3('0x35')]));return this['channel'][_0xfda3('0x177')](_0x3f795f['text'],_0x3f795f[_0xfda3('0x172')]);};AGIVertices[_0xfda3('0xe')]['sendMail']=function(_0x23bee5){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x178'),_0x23bee5[_0xfda3('0x35')]));if(!this['isConfigured'](_0x23bee5[_0xfda3('0x179')])){return this['channel'][_0xfda3('0xb1')](_0xfda3('0x17a'));}var _0x1245d8=this[_0xfda3('0x17b')][_0xfda3('0x75')](this,_0x23bee5[_0xfda3('0x179')]);if(!_0x1245d8||!_0x1245d8['Smtp']){return this['channel']['error'](_0x23bee5,_0xfda3('0x17c'));}var _0x71a192={'from':util['format'](_0xfda3('0x17d'),_0x1245d8[_0xfda3('0x17')],_0x1245d8[_0xfda3('0x17e')]||_0x1245d8['Smtp'][_0xfda3('0x17f')]),'to':_0x23bee5['to']||'','cc':_0x23bee5['cc']||'','bcc':_0x23bee5[_0xfda3('0x180')]||'','subject':_0x23bee5[_0xfda3('0x181')],'html':_0x23bee5[_0xfda3('0x5d')],'text':_0x23bee5['text']};var _0x2e2440={'tls':{'rejectUnauthorized':![]}};if(_0x1245d8[_0xfda3('0x182')][_0xfda3('0x183')]){_0x2e2440[_0xfda3('0x183')]=_0x1245d8['Smtp']['service'];}else{_0x2e2440['host']=_0x1245d8[_0xfda3('0x182')]['host'];_0x2e2440[_0xfda3('0x184')]=_0x1245d8[_0xfda3('0x182')][_0xfda3('0x184')];_0x2e2440[_0xfda3('0x185')]=_0x1245d8['Smtp'][_0xfda3('0x185')];}if(_0x1245d8[_0xfda3('0x182')][_0xfda3('0x186')]){_0x2e2440[_0xfda3('0x187')]={'user':_0x1245d8[_0xfda3('0x182')][_0xfda3('0x17f')],'pass':_0x1245d8[_0xfda3('0x182')][_0xfda3('0x188')]};}if(this['isConfigured'](_0x23bee5[_0xfda3('0x189')])){}logger['debug'](_0xfda3('0x18a'),JSON['stringify'](_0x71a192));this['createSquareDetailsReport']['sync'](this,_0x23bee5,_0x23bee5[_0xfda3('0x179')]);this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x1245d8[_0xfda3('0x17')]));this[_0xfda3('0x20')][_0xfda3('0x75')](this,_0x2e2440,_0x71a192);return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x18b'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x18c')]=function(_0x3e2b79){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x18d'),_0x3e2b79[_0xfda3('0x35')]));return this['channel']['noop'](_0xfda3('0x18e'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x18f')]=function(_0x2c9abc){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x190'),_0x2c9abc[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x2c9abc[_0xfda3('0x191')])){return this[_0xfda3('0xb')]['noop']('no\x20sms\x20account\x20configured');}var _0x2e9559=this[_0xfda3('0x192')]['sync'](this,_0x2c9abc[_0xfda3('0x191')]);if(!_0x2e9559){return this[_0xfda3('0xb')]['error'](_0x2c9abc,_0xfda3('0x193'));}var _0x3e50d2={'body':_0x2c9abc[_0xfda3('0x194')],'phone':_0x2c9abc['to']||'','SmsAccountId':_0x2e9559['id']};logger['debug'](_0xfda3('0x195'),JSON[_0xfda3('0x78')](_0x3e50d2));this[_0xfda3('0x33')]['sync'](this,_0x2c9abc,_0x2c9abc['sms_account_id']);this[_0xfda3('0xb')]['noop'](util['format'](_0xfda3('0x196'),_0x2e9559[_0xfda3('0x17')]));this[_0xfda3('0x32')][_0xfda3('0x75')](this,_0x3e50d2);return this[_0xfda3('0xb')][_0xfda3('0xb1')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xfda3('0x197')]=function(_0x372330){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x198'),_0x372330[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x372330['variable_id'])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x372330,_0xfda3('0x199'));}var _0x34d5c4=this['getVariable']['sync'](this,_0x372330['variable_id']);if(!_0x34d5c4){return this[_0xfda3('0xb')]['error'](_0x372330,'no\x20variable\x20found');}return this['channel'][_0xfda3('0x9d')](_0x34d5c4,_0x372330[_0xfda3('0x19a')]);};AGIVertices[_0xfda3('0xe')][_0xfda3('0x19b')]=function(_0x271742){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x19c'),_0x271742[_0xfda3('0x35')]));this[_0xfda3('0xb')][_0xfda3('0xb1')]('START\x20CALLY\x20SQUARE');if(_0x271742[_0xfda3('0xa9')]===_0xfda3('0x19d')){this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x19e'));return this[_0xfda3('0xb')][_0xfda3('0xa9')]();}return this[_0xfda3('0xb')]['noop']('Skipped\x20Answer');};AGIVertices[_0xfda3('0xe')]['subproject']=function(_0x3a4d8c){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x19f'),_0x3a4d8c['label']));if(!this['isConfigured'](_0x3a4d8c[_0xfda3('0x1a0')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x3a4d8c,'no\x20subproject\x20selected');}var _0x3f4b70=this[_0xfda3('0x15')][_0xfda3('0x75')](this,_0x3a4d8c[_0xfda3('0x1a0')]);if(!this[_0xfda3('0x85')](_0x3f4b70)){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x3a4d8c,util[_0xfda3('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3a4d8c['project_id']));}if(_0x3f4b70===this[_0xfda3('0xb')][_0xfda3('0x36')]){return this['channel'][_0xfda3('0x28')](_0x3a4d8c,_0xfda3('0x1a1'));}this['createSquareDetailsReport']['sync'](this,_0x3a4d8c,_0x3f4b70);var _0x527180=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0x1a2'),util[_0xfda3('0x26')](_0xfda3('0x1a3'),config['agi'][_0xfda3('0x1a4')]||_0xfda3('0x1a5'),_0x3f4b70,this['channel'][_0xfda3('0x36')]));if(_0x527180[_0xfda3('0xa2')]===-0x1){return _0x527180;}return this['channel']['noop'](util[_0xfda3('0x26')](_0xfda3('0xb4'),_0xfda3('0x1a2'),_0x3f4b70));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x1a6')]=function(_0xcea587){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x1a7'),_0xcea587[_0xfda3('0x35')]));var _0x5361aa=this[_0xfda3('0x56')][_0xfda3('0x75')](this,_0xcea587[_0xfda3('0xa7')]);this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0xcea587,_0xcea587[_0xfda3('0xa7')]);if(this[_0xfda3('0x85')](_0xcea587['variable_id'])){var _0x4d61b6=this['getVariable']['sync'](this,_0xcea587[_0xfda3('0xcd')]);if(_0x4d61b6){this[_0xfda3('0xb')][_0xfda3('0x9d')](_0x4d61b6,_0x5361aa);return this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0x1a8'),_0xcea587['command'],_0x4d61b6));}}return this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x1a9'),_0xcea587[_0xfda3('0xa7')]));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x1aa')]=function(_0x4f1603){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x1ab'),_0x4f1603[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x4f1603[_0xfda3('0x5b')])){return this['channel'][_0xfda3('0xb1')]('no\x20apiKey\x20configured');}if(!this[_0xfda3('0x85')](_0x4f1603[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x4f1603[_0xfda3('0x5d')]));var _0x50540c=this[_0xfda3('0x5a')][_0xfda3('0x75')](this,_0x4f1603);if(_0x50540c){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x1ac'),_0x50540c));var _0x407307=this['channel'][_0xfda3('0xee')](_0x50540c);try{fs['unlink'](_0x50540c+'.wav');}catch(_0x3e1873){logger[_0xfda3('0x28')](_0x3e1873);}return _0x407307;}return this[_0xfda3('0xb')]['error'](_0x4f1603,_0xfda3('0x1ad'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x1ae')]=function(_0x1351b9){logger['info'](util[_0xfda3('0x26')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1351b9[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x1351b9[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x1af'),_0x1351b9[_0xfda3('0x5d')]));var _0x2b9998=this[_0xfda3('0x63')]['sync'](this,_0x1351b9);if(_0x2b9998){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x1b0'),_0x2b9998));var _0xd9f5e7=this[_0xfda3('0xb')][_0xfda3('0xee')](_0x2b9998);try{fs[_0xfda3('0xef')](_0x2b9998+_0xfda3('0x10e'));}catch(_0x584f10){logger[_0xfda3('0x28')](_0x584f10);}return _0xd9f5e7;}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x1351b9,_0xfda3('0x1b1'));};AGIVertices[_0xfda3('0xe')]['unpause']=function(_0x892c0e){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x1b2'),_0x892c0e[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x892c0e[_0xfda3('0x13e')])){return this['channel']['error'](_0x892c0e,_0xfda3('0x13f'));}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x140'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x892c0e['findBy']));var _0x51a76e=this[_0xfda3('0x51')][_0xfda3('0x75')](this,_0x892c0e['findBy']);if(_0x51a76e){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x141'),this['channel'][_0xfda3('0x4f')],_0x892c0e[_0xfda3('0x13e')]));this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x892c0e[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x142')};}else{logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x143'),this['channel'][_0xfda3('0x4f')],_0x892c0e[_0xfda3('0x13e')]));this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x892c0e[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x144')};}};AGIVertices['prototype'][_0xfda3('0x1b3')]=function(_0x5646f5){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x1b4'),_0x5646f5['label']));var _0x4d21f9=this['channel']['exec'](_0xfda3('0x1b5'),[_0x5646f5[_0xfda3('0x1b6')],_0x5646f5[_0xfda3('0x7c')]]);if(_0x4d21f9['result']===-0x1){return _0x4d21f9;}return this['channel']['noop'](util['format'](_0xfda3('0xb4'),_0xfda3('0x1b5'),_0x5646f5[_0xfda3('0x1b6')]));};AGIVertices['prototype'][_0xfda3('0x1b7')]=function(_0x295ede){logger['info'](util['format'](_0xfda3('0x1b8'),_0x295ede[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x295ede[_0xfda3('0xcd')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x295ede,'no\x20variable\x20selected');}var _0x5659fa=this[_0xfda3('0xf')][_0xfda3('0x75')](this,_0x295ede['variable_id']);if(!_0x5659fa){return this['channel'][_0xfda3('0x28')](_0x295ede,'no\x20variable\x20found');}var _0x4236ad=this[_0xfda3('0xb')][_0xfda3('0xf')](_0x5659fa);return{'code':0xc8,'result':_0x4236ad['extra']?_0x4236ad['extra']:'-'};};String[_0xfda3('0xe')][_0xfda3('0xa0')]=function(_0x3c0a45,_0x1cc2ad){return this[_0xfda3('0x9e')](_0x3c0a45)[_0xfda3('0x1b9')](_0x1cc2ad);};module[_0xfda3('0x1ba')]=AGIVertices; \ No newline at end of file +var _0x9bde=['dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','audiofile','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','operation','math\x20%s','isArray','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','maxRetry','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','shellCommand','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','split','length','replaceAll','getAndSetVariable','result','extra','setVariable','isConfigured','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set'];(function(_0x2c4ee6,_0x28e23c){var _0x47d770=function(_0x444c63){while(--_0x444c63){_0x2c4ee6['push'](_0x2c4ee6['shift']());}};_0x47d770(++_0x28e23c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1195dd,_0x231bd1){_0x1195dd=_0x1195dd-0x0;var _0x1cdd7d=_0x9bde[_0x1195dd];return _0x1cdd7d;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xe9bd('0x0'));var _=require('lodash');var sh=require(_0xe9bd('0x1'));var odbc=require('odbc')();var rs=require(_0xe9bd('0x2'));var moment=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var rp=require(_0xe9bd('0x5'));var logger=require(_0xe9bd('0x6'))(_0xe9bd('0x7'));var config=require(_0xe9bd('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xe9bd('0x9');var recursiveMapAttributes=[_0xe9bd('0xa'),_0xe9bd('0xb')];var verticesWithRetry=[_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe')];var AGIVertices=function(_0x29bc2b,_0xbefddb,_0x439abc){this[_0xe9bd('0xf')]=_0x29bc2b;this['rpc']=_0xbefddb;this['mailRpc']=_0x439abc;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x11')]=function(_0x2601ac,_0x581ab9){this[_0xe9bd('0x12')][_0xe9bd('0x13')](_0x2601ac)[_0xe9bd('0x14')](function(_0x141587){_0x581ab9(null,_0x141587?_0x141587['name']:![]);})[_0xe9bd('0x15')](function(_0x4ac319){_0x581ab9(_0x4ac319);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16')]=function(_0x3435b4,_0x51109f){this['rpc'][_0xe9bd('0x17')](_0x3435b4)[_0xe9bd('0x14')](function(_0x3a9e5f){_0x51109f(null,_0x3a9e5f?_0x3a9e5f[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x389e7b){_0x51109f(_0x389e7b);});};AGIVertices[_0xe9bd('0x10')]['getSquareProject']=function(_0x1d11a0,_0x464a1b){this[_0xe9bd('0x12')]['getSquareProjectById'](_0x1d11a0)[_0xe9bd('0x14')](function(_0x3bae08){_0x464a1b(null,_0x3bae08?_0x3bae08[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x5cf674){_0x464a1b(_0x5cf674);});};AGIVertices[_0xe9bd('0x10')]['getSquareOdbc']=function(_0xc6b661,_0x55b869){this[_0xe9bd('0x12')][_0xe9bd('0x19')](_0xc6b661)[_0xe9bd('0x14')](function(_0x3dda13){_0x55b869(null,_0x3dda13?_0x3dda13[_0xe9bd('0x1a')]:![]);})[_0xe9bd('0x15')](function(_0x6593ce){_0x55b869(_0x6593ce);});};AGIVertices['prototype'][_0xe9bd('0x1b')]=function(_0x28cd17,_0x4ecaf5){this[_0xe9bd('0x12')]['getUserById'](_0x28cd17)[_0xe9bd('0x14')](function(_0x1b9cc9){_0x4ecaf5(null,_0x1b9cc9?_0x1b9cc9[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x5bc4bf){_0x4ecaf5(_0x5bc4bf);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1c')]=function(_0x2c9a57,_0x39b206){this[_0xe9bd('0x12')][_0xe9bd('0x1d')](_0x2c9a57)[_0xe9bd('0x14')](function(_0x43ea90){_0x39b206(null,_0x43ea90?_0x43ea90[_0xe9bd('0x18')]:![]);})['catch'](function(_0x3c211a){_0x39b206(_0x3c211a);});};AGIVertices[_0xe9bd('0x10')]['getSound']=function(_0x3b13b7,_0xc25248){var _0x119672=this;this[_0xe9bd('0x12')][_0xe9bd('0x1e')](_0x3b13b7)[_0xe9bd('0x14')](function(_0x519f48){_0xc25248(null,_0x519f48?_0x119672['getSoundPath'](_0x519f48[_0xe9bd('0x1f')]):![]);})['catch'](function(_0xa45eb0){_0xc25248(_0xa45eb0);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x20')]=function(_0x36aa80,_0x4057df){this['rpc']['getMailAccountById'](_0x36aa80)[_0xe9bd('0x14')](function(_0x3b6682){_0x4057df(null,_0x3b6682?_0x3b6682:![]);})[_0xe9bd('0x15')](function(_0x3081f3){_0x4057df(_0x3081f3);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x21')]=function(_0x3c31ee,_0x66213a,_0x45703e){this['mailRpc'][_0xe9bd('0x21')](_0x3c31ee,_0x66213a)[_0xe9bd('0x14')](function(){_0x45703e(null);})[_0xe9bd('0x15')](function(_0x5117bc){_0x45703e(_0x5117bc);});};AGIVertices['prototype'][_0xe9bd('0x22')]=function(_0x2e9593,_0x601649){this[_0xe9bd('0x12')][_0xe9bd('0x23')](_0x2e9593)[_0xe9bd('0x14')](function(_0x1e50ac){if(_0x1e50ac){if(_0x1e50ac[_0xe9bd('0x24')]){_0x601649(null,[_0x1e50ac[_0xe9bd('0x25')]]);}else{_0x601649(null,_[_0xe9bd('0x26')](_0x1e50ac[_0xe9bd('0x27')],_0xe9bd('0x25')));}}else{_0x601649(null,![]);}})[_0xe9bd('0x15')](function(_0x199477){_0x601649(_0x199477);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x28')]=function(_0x264ba0){return util[_0xe9bd('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x264ba0);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x2a')]=function(_0x56b4a5,_0x404a7d,_0x264c87){odbc['open'](_0x56b4a5,function(_0x4b1da0){if(_0x4b1da0){logger[_0xe9bd('0x2b')](_0xe9bd('0x2c'),_0x4b1da0);_0x264c87(_0x4b1da0);}else{logger['info'](_0xe9bd('0x2d'));odbc[_0xe9bd('0x2e')](_0x404a7d,function(_0x14927c,_0x5b894a){if(_0x14927c){logger[_0xe9bd('0x2f')]('Error\x20executing\x20query\x20%s',_0x404a7d);_0x264c87(_0x14927c);}else{logger[_0xe9bd('0x2f')](_0xe9bd('0x30'),_0x404a7d);odbc[_0xe9bd('0x31')](function(_0x1366f2){if(_0x1366f2){logger['error'](_0xe9bd('0x32'),_0x1366f2);}_0x264c87(null,_0x5b894a);});}});}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x33')]=function(_0x3f1212,_0x253359){this[_0xe9bd('0x12')][_0xe9bd('0x34')](_0x3f1212)[_0xe9bd('0x14')](function(_0x2b5a71){_0x253359(null,_0x2b5a71?_0x2b5a71:![]);})[_0xe9bd('0x15')](function(_0x4e8565){_0x253359(_0x4e8565);});};AGIVertices['prototype'][_0xe9bd('0x35')]=function(_0x499e13,_0x4608a0){this[_0xe9bd('0x12')][_0xe9bd('0x35')](_0x499e13)['then'](function(_0x1ba613){_0x4608a0(null,_0x1ba613);})[_0xe9bd('0x15')](function(_0x1a2d94){_0x4608a0(_0x1a2d94);});};AGIVertices['prototype'][_0xe9bd('0x36')]=function(_0x3a5703,_0x2b3cd7,_0x388132){this[_0xe9bd('0x12')][_0xe9bd('0x36')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'node':_0x3a5703[_0xe9bd('0x38')],'application':_0x3a5703[_0xe9bd('0x39')],'data':_0x2b3cd7||null,'project_name':this[_0xe9bd('0xf')][_0xe9bd('0x3a')],'callerid':this[_0xe9bd('0xf')][_0xe9bd('0x3b')]})[_0xe9bd('0x14')](function(_0x5b70d3){if(_0x388132){_0x388132(null,_0x5b70d3);}})['catch'](function(_0x283e67){if(_0x388132){_0x388132(_0x283e67);}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x3c')]=function(_0x58828b,_0x594e80,_0x43cf7d,_0x3f6f22){this[_0xe9bd('0x12')][_0xe9bd('0x3c')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'callerid':this[_0xe9bd('0xf')]['callerid'],'calleridname':this[_0xe9bd('0xf')]['calleridname'],'context':this[_0xe9bd('0xf')][_0xe9bd('0x3d')],'extension':this[_0xe9bd('0xf')][_0xe9bd('0x3e')],'priority':this[_0xe9bd('0xf')]['priority'],'accountcode':this[_0xe9bd('0xf')][_0xe9bd('0x3f')],'dnid':this[_0xe9bd('0xf')]['dnid'],'projectName':this[_0xe9bd('0xf')][_0xe9bd('0x3a')],'saveName':_0x594e80,'filename':_0x58828b[_0xe9bd('0x40')]||_0x594e80,'savePath':_0x43cf7d})['then'](function(_0x28d2ea){_0x3f6f22(null,_0x28d2ea);})[_0xe9bd('0x15')](function(_0x2e634d){_0x3f6f22(_0x2e634d);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x41')]=function(_0x579d26,_0x3f4833,_0x4b8ff9){this[_0xe9bd('0x12')][_0xe9bd('0x41')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'body':_0x579d26,'direction':_0x3f4833})[_0xe9bd('0x14')](function(_0x4944e3){if(_0x4b8ff9){_0x4b8ff9(null,_0x4944e3);}})[_0xe9bd('0x15')](function(_0x485e95){if(_0x4b8ff9){_0x4b8ff9(_0x485e95);}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x42')]=function(_0x5e08ae,_0x59d5cb){this[_0xe9bd('0x12')]['createCmContact']({'firstName':_[_0xe9bd('0x43')](_0x5e08ae['name'])||_[_0xe9bd('0x44')](_0x5e08ae[_0xe9bd('0x18')])?'callback_'+Math[_0xe9bd('0x45')]():_0x5e08ae['name'],'lastName':_[_0xe9bd('0x43')](_0x5e08ae[_0xe9bd('0x46')])||_[_0xe9bd('0x44')](_0x5e08ae['lastName'])?null:_0x5e08ae[_0xe9bd('0x46')],'phone':_0x5e08ae[_0xe9bd('0x47')],'ListId':_0x5e08ae[_0xe9bd('0x48')],'scheduledAt':_0x5e08ae[_0xe9bd('0x49')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xe9bd('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x5e08ae[_0xe9bd('0x49')][_0xe9bd('0x4b')](),'priority':_0x5e08ae[_0xe9bd('0x4c')]})[_0xe9bd('0x14')](function(_0x159f68){_0x59d5cb(null,_0x159f68);})[_0xe9bd('0x15')](function(_0x373057){_0x59d5cb(_0x373057);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x4d')]=function(_0x3be526,_0x1fd5bf){this[_0xe9bd('0x12')]['getPauseById'](_0x3be526)['then'](function(_0x566dd8){_0x1fd5bf(null,_0x566dd8?_0x566dd8[_0xe9bd('0x18')]:![]);})['catch'](function(_0x2c4ca7){_0x1fd5bf(_0x2c4ca7);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x4e')]=function(_0x6232e5,_0x1c9328,_0xaf6ffd){var _0x3bb2ba={'role':_0xe9bd('0x4f')};_0x3bb2ba[_0x6232e5]=this[_0xe9bd('0xf')]['callerid'];this[_0xe9bd('0x12')][_0xe9bd('0x4e')](_0x3bb2ba,_0x1c9328,this[_0xe9bd('0xf')][_0xe9bd('0x37')])['then'](function(_0x1c8765){_0xaf6ffd(null,_[_0xe9bd('0x44')](_0x1c8765)?![]:!![]);})[_0xe9bd('0x15')](function(_0x4e05f0){logger[_0xe9bd('0x2b')](_0x4e05f0);_0xaf6ffd(null,![]);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x50')]=function(_0xfe82f7,_0x4ee26a){var _0x4b3447={'role':_0xe9bd('0x4f')};_0x4b3447[_0xfe82f7]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];this[_0xe9bd('0x12')]['agentUnpause'](_0x4b3447)['then'](function(_0x305efa){_0x4ee26a(null,_[_0xe9bd('0x44')](_0x305efa)?![]:!![]);})[_0xe9bd('0x15')](function(_0x3ba881){logger[_0xe9bd('0x2b')](_0x3ba881);_0x4ee26a(null,![]);});};AGIVertices[_0xe9bd('0x10')]['agentLogout']=function(_0x179c8d,_0x5681ab){var _0x27e07c={'role':_0xe9bd('0x4f')};_0x27e07c[_0x179c8d]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];this['rpc'][_0xe9bd('0x51')](_0x27e07c)[_0xe9bd('0x14')](function(_0x3b0190){_0x5681ab(null,_['isNil'](_0x3b0190)?![]:!![]);})[_0xe9bd('0x15')](function(_0x1a9d0c){logger[_0xe9bd('0x2b')](_0x1a9d0c);_0x5681ab(null,![]);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x52')]=function(_0x16b66c,_0x3a626d){var _0x336222={'role':_0xe9bd('0x4f')};_0x336222[_0x16b66c]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];var _0x37d07a=_0x16b66c!='internal'?util[_0xe9bd('0x29')](_0xe9bd('0x53'),'LOCAL',this[_0xe9bd('0xf')][_0xe9bd('0x3b')]):undefined;this['rpc']['agentLogin'](_0x336222,_0x37d07a)[_0xe9bd('0x14')](function(_0x4190f0){_0x3a626d(null,_['isNil'](_0x4190f0)?![]:!![]);})['catch'](function(_0x4a6422){logger[_0xe9bd('0x2b')](_0x4a6422);_0x3a626d(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x4b5bfb,_0x4bcf2b){sh[_0xe9bd('0x54')](_[_0xe9bd('0x55')](_0x4b5bfb),function(_0x2ed5f2,_0x4947b0){var _0x3d4dd1=_0x4947b0[_0xe9bd('0x56')](/(\r\n|\n|\r)/gm,'');_0x4bcf2b(null,_0x3d4dd1);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x57')]=function(_0x5dc598,_0x2656e9){scripts[_0xe9bd('0x57')](_0x5dc598[_0xe9bd('0x58')],_0x5dc598['google_cloud_tts_text_type']||'text',_0x5dc598[_0xe9bd('0x59')],_0x5dc598[_0xe9bd('0x5a')]||_0xe9bd('0x5b'),_0x5dc598[_0xe9bd('0x5c')]||_0xe9bd('0x5d'),_0x5dc598[_0xe9bd('0x5e')]||_0xe9bd('0x5f'))[_0xe9bd('0x14')](function(_0x578e85){_0x2656e9(null,_0x578e85);})[_0xe9bd('0x15')](function(_0x35e0ca){_0x2656e9(_0x35e0ca);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x60')]=function(_0x2364fc,_0x5d7257){scripts[_0xe9bd('0x60')](_0x2364fc['text'],_0x2364fc['google_tts_language']||'en',0x1)[_0xe9bd('0x14')](function(_0x4496e3){_0x5d7257(null,_0x4496e3);})['catch'](function(_0x1a6bf9){_0x5d7257(_0x1a6bf9);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x61')]=function(_0x292faf,_0x582cf3){var _0x3c1ab9={'uri':_0x292faf[_0xe9bd('0x62')],'method':_0x292faf['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x292faf[_0xe9bd('0x63')])===_0xe9bd('0x64')&&parseInt(_0x292faf[_0xe9bd('0x63')])>=0x1?parseInt(_0x292faf[_0xe9bd('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xe9bd('0x65')]([_0xe9bd('0x66'),_0xe9bd('0x67')],_0x3c1ab9['method'][_0xe9bd('0x68')]())){try{_0x3c1ab9[_0xe9bd('0x69')]=_0x292faf[_0xe9bd('0xb')]?JSON[_0xe9bd('0x6a')](_0x292faf[_0xe9bd('0xb')]):{};}catch(_0x8f51aa){logger[_0xe9bd('0x2b')](_0xe9bd('0x6b'),_0x8f51aa);}}try{_0x3c1ab9[_0xe9bd('0x6c')]=_0x292faf['rawHeaders']?JSON[_0xe9bd('0x6a')](_0x292faf[_0xe9bd('0xa')]):{};}catch(_0x256890){logger[_0xe9bd('0x2b')](_0xe9bd('0x6d'),_0x256890);}if(_0x292faf[_0xe9bd('0x6e')]){try{var _0x1bad42=require(_0x292faf['computedVariables'])[_0xe9bd('0x6f')](this,_0x3c1ab9);_0x3c1ab9[_0xe9bd('0x70')]=Mustache['render'](_0x292faf[_0xe9bd('0x62')],_0x1bad42,{},['$$','$$']);if(_0x3c1ab9[_0xe9bd('0x6c')]){_0x3c1ab9[_0xe9bd('0x6c')]=JSON[_0xe9bd('0x6a')](Mustache[_0xe9bd('0x71')](JSON[_0xe9bd('0x72')](_0x3c1ab9[_0xe9bd('0x6c')]),_0x1bad42,{},['$$','$$']));}if(_0x3c1ab9['body']){_0x3c1ab9['body']=JSON[_0xe9bd('0x6a')](Mustache[_0xe9bd('0x71')](JSON[_0xe9bd('0x72')](_0x3c1ab9[_0xe9bd('0x69')]),_0x1bad42,{},['$$','$$']));}}catch(_0x449175){logger[_0xe9bd('0x2b')](_0xe9bd('0x73'),_0x449175);}}rp(_0x3c1ab9)['then'](function(_0x35390a){var _0x44f47e={'statusCode':_0x35390a[_0xe9bd('0x74')]||0xc8,'statusMessage':_0x35390a[_0xe9bd('0x75')]||'OK','headers':_0x35390a[_0xe9bd('0x6c')]||{},'body':_0x35390a[_0xe9bd('0x69')]||{}};_0x582cf3(null,_0x44f47e);})[_0xe9bd('0x15')](function(_0x4bbeef){var _0x55aacf={'statusCode':_0x4bbeef['statusCode']||0x1f4,'statusMessage':_0x4bbeef[_0xe9bd('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4bbeef['options']['headers']||{},'body':_0x4bbeef[_0xe9bd('0x77')][_0xe9bd('0x69')]||{}};_0x582cf3(null,_0x55aacf);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x78')]=function(_0xd8a604,_0x3bc2f2){scripts[_0xe9bd('0x78')](this[_0xe9bd('0xf')][_0xe9bd('0x37')],_0xd8a604['key'],_0xd8a604[_0xe9bd('0x59')],_0xd8a604['dialogflow_language']||'en')[_0xe9bd('0x14')](function(_0x433a98){_0x3bc2f2(null,_0x433a98);})[_0xe9bd('0x15')](function(_0x6fff03){_0x3bc2f2(_0x6fff03);});};AGIVertices[_0xe9bd('0x10')]['sestekNDA']=function(_0x5b14e5,_0x56d4eb){scripts[_0xe9bd('0x79')](this[_0xe9bd('0xf')],_0x5b14e5)['then'](function(_0x3c7875){_0x56d4eb(null,_0x3c7875);})[_0xe9bd('0x15')](function(_0x2bf2f0){_0x56d4eb(_0x2bf2f0);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x7a')]=function(_0x58c1e5,_0x821505){scripts[_0xe9bd('0x7a')](_0x58c1e5[_0xe9bd('0x7b')],_0x58c1e5[_0xe9bd('0x59')],_0x58c1e5[_0xe9bd('0x7c')]||_0xe9bd('0x5b'),_0x58c1e5[_0xe9bd('0x7d')])[_0xe9bd('0x14')](function(_0x45991e){_0x821505(null,_0x45991e);})[_0xe9bd('0x15')](function(_0x5f24c8){_0x821505(_0x5f24c8);});};AGIVertices['prototype']['ispeechASR']=function(_0x5b5c35,_0x4039c7,_0x2c7ecc){scripts[_0xe9bd('0x7e')](_0x4039c7,_0x5b5c35['key'],_0x5b5c35[_0xe9bd('0x7f')]||_0xe9bd('0x5b'),this['isConfigured'](_0x5b5c35['model'])?_0x5b5c35[_0xe9bd('0x80')]:undefined)[_0xe9bd('0x14')](function(_0x2a4937){_0x2c7ecc(null,_0x2a4937);})[_0xe9bd('0x15')](function(_0x23a145){_0x2c7ecc(_0x23a145);});};AGIVertices['prototype']['awsPolly']=function(_0x499771,_0x223f56){scripts[_0xe9bd('0x81')](_0x499771[_0xe9bd('0x82')],_0x499771[_0xe9bd('0x83')],_0x499771[_0xe9bd('0x84')],_0x499771[_0xe9bd('0x85')]||_0xe9bd('0x86'),_0x499771[_0xe9bd('0x59')],_0x499771[_0xe9bd('0x87')]||_0xe9bd('0x59'))['then'](function(_0xb1203d){_0x223f56(null,_0xb1203d);})['catch'](function(_0x116815){_0x223f56(_0x116815);});};AGIVertices['prototype']['awsLex']=function(_0x423e15,_0x4a6253){scripts[_0xe9bd('0x88')](this['channel'][_0xe9bd('0x37')],_0x423e15[_0xe9bd('0x82')],_0x423e15[_0xe9bd('0x83')],_0x423e15[_0xe9bd('0x89')],_0x423e15[_0xe9bd('0x59')],_0x423e15[_0xe9bd('0x8a')])['then'](function(_0x3b97a0){_0x4a6253(null,_0x3b97a0);})[_0xe9bd('0x15')](function(_0x4ee8a3){_0x4a6253(_0x4ee8a3);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x8b')]=function(_0x141fe2,_0x59897b,_0x342f9e){scripts[_0xe9bd('0x8b')](_0x59897b,_0x141fe2[_0xe9bd('0x7b')],_0x141fe2[_0xe9bd('0x8c')]||_0xe9bd('0x5b'))['then'](function(_0x45021c){_0x342f9e(null,_0x45021c);})[_0xe9bd('0x15')](function(_0x591c5f){_0x342f9e(_0x591c5f);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x8d')]=function(_0x396679,_0x4d9717,_0x50243f){scripts[_0xe9bd('0x8d')](_0x4d9717,_0x396679[_0xe9bd('0x8e')],_0x396679[_0xe9bd('0x8f')],_0x396679[_0xe9bd('0x70')])[_0xe9bd('0x14')](function(_0xb6582b){_0x50243f(null,_0xb6582b);})[_0xe9bd('0x15')](function(_0x56bdcd){_0x50243f(_0x56bdcd);});};AGIVertices[_0xe9bd('0x10')]['clear']=function(_0x33dcf6){var _0x3a2d9f=_[_0xe9bd('0x65')](verticesWithRetry,_0x33dcf6['agicommand'])?_0x33dcf6:_[_0xe9bd('0x90')](_0x33dcf6);for(var _0x4ae8d1 in _0x3a2d9f){if(_0x3a2d9f[_0xe9bd('0x91')](_0x4ae8d1)){if(_0x3a2d9f[_0x4ae8d1]&&_[_0xe9bd('0x92')](_0x3a2d9f[_0x4ae8d1])){if(_[_0xe9bd('0x65')](recursiveMapAttributes,_0x4ae8d1)){_0x3a2d9f[_0x4ae8d1]=this[_0xe9bd('0x93')](_0x3a2d9f[_0x4ae8d1]);}else{_0x3a2d9f[_0x4ae8d1]=this[_0xe9bd('0x94')](_0x3a2d9f[_0x4ae8d1]);}}}}return _0x3a2d9f;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x95')]=function(_0x2abd8f){for(var _0x14db25 in _0x2abd8f){if(_0x2abd8f[_0xe9bd('0x91')](_0x14db25)){if(_[_0xe9bd('0x96')](_0x2abd8f[_0x14db25])){return this['recursiveNodeIndex'](_0x2abd8f[_0x14db25]);}_0x2abd8f[_0x14db25]=this[_0xe9bd('0x94')](_0x2abd8f[_0x14db25]);}}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x97')]=function(_0x5dad5e,_0x97e5b1){for(var _0x16bcce in _0x5dad5e){if(_0x5dad5e['hasOwnProperty'](_0x16bcce)){if(_['isPlainObject'](_0x5dad5e[_0x16bcce])){if(!_['isEmpty'](_0x5dad5e[_0x16bcce])){this['saveRestApiResult'](_0x5dad5e[_0x16bcce],util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x97e5b1,_0x16bcce));}}else{if(_0x5dad5e[_0x16bcce]){this[_0xe9bd('0xf')]['setVariable'](util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x97e5b1,_0x16bcce),_0x5dad5e[_0x16bcce]);}}}}};AGIVertices['prototype'][_0xe9bd('0x93')]=function(_0x35894c){try{var _0x3fed2e=JSON[_0xe9bd('0x6a')](_0x35894c);this[_0xe9bd('0x95')](_0x3fed2e);return JSON['stringify'](_0x3fed2e);}catch(_0x1fcc3a){return this[_0xe9bd('0x94')](_0x35894c);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x54ffbd){var _0x4fbbd6=_0x54ffbd[_0xe9bd('0x99')]('{');for(var _0x26b67a=0x1;_0x26b67a<_0x4fbbd6[_0xe9bd('0x9a')];_0x26b67a+=0x1){var _0xae352d=_0x4fbbd6[_0x26b67a]['split']('}');if(_0xae352d['length']>0x1){_0x54ffbd=_0x54ffbd[_0xe9bd('0x9b')]('{'+_0xae352d[0x0]+'}',this[_0xe9bd('0xf')][_0xe9bd('0x11')](_0xae352d[0x0])['extra']||_0xae352d[0x0]);}}if(_0x4fbbd6[_0xe9bd('0x9a')]===0x1){return _0x54ffbd[_0xe9bd('0x4b')]();}return this['replaceAllVariables'](_0x54ffbd);};AGIVertices['prototype'][_0xe9bd('0x9c')]=function(_0x90b3d7,_0x346da7){var _0x3453c3=this[_0xe9bd('0xf')][_0xe9bd('0x11')](_0x90b3d7);if(_0x3453c3[_0xe9bd('0x9d')]===-0x1){return _0x3453c3;}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x346da7,_0x3453c3[_0xe9bd('0x9e')]));return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x346da7,_0x3453c3[_0xe9bd('0x9e')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xa0')]=function(_0x55f0d3){return _0x55f0d3&&_0x55f0d3!=='0'&&_0x55f0d3!=='-1'&&_0x55f0d3!=='';};AGIVertices[_0xe9bd('0x10')]['maxRetry']=function(_0x13e932){this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x13e932,'-');_0x13e932[_0xe9bd('0xa1')]=_0x13e932['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x7')]=function(_0x54a6c6){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xa2'),_0x54a6c6[_0xe9bd('0x38')]));return this['channel'][_0xe9bd('0x7')]([_0x54a6c6[_0xe9bd('0xa3')],_0x54a6c6['args']]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xa4')]=function(_0x2d5601){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0xa5'),_0x2d5601[_0xe9bd('0x38')]));if(this[_0xe9bd('0xa0')](_0x2d5601[_0xe9bd('0x63')])){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2d5601[_0xe9bd('0x63')]));var _0x2e1c0f=this[_0xe9bd('0xf')]['wait'](_0x2d5601[_0xe9bd('0x63')]);if(_0x2e1c0f['result']===-0x1){return _0x2e1c0f;}}return this['channel']['answer']();};AGIVertices[_0xe9bd('0x10')]['callback']=function(_0x516080){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x516080[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x516080['list_id'])){return this['channel'][_0xe9bd('0x2b')](_0x516080,'no\x20list\x20selected');}_0x516080['scheduledAt']=moment();if(this[_0xe9bd('0xa0')](_0x516080[_0xe9bd('0xa6')])){_0x516080[_0xe9bd('0x49')]=moment()[_0xe9bd('0xa7')](_0x516080[_0xe9bd('0xa6')],_0xe9bd('0xa8'));}if(!this[_0xe9bd('0xa0')](_0x516080['callback_priority'])){_0x516080[_0xe9bd('0x4c')]=0x2;}this['createCmContact']['sync'](this,_0x516080);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xaa'),_0x516080[_0xe9bd('0x47')],_0x516080['list_id'],_0x516080[_0xe9bd('0x49')]));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xab')]=function(_0x2a4f8a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2a4f8a[_0xe9bd('0x38')]));var _0x265dba=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0x2a4f8a[_0xe9bd('0xac')],_0x2a4f8a[_0xe9bd('0x77')]);if(_0x265dba['result']===-0x1){return _0x265dba;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0xad'),_0x2a4f8a[_0xe9bd('0xac')],_0x2a4f8a[_0xe9bd('0x77')]));};AGIVertices[_0xe9bd('0x10')]['lumenvoxtts']=function(_0x13b95b){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xae'),_0x13b95b[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x13b95b[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20text\x20configured');}var _0x2fa992='\x22'+_0x13b95b[_0xe9bd('0x59')]+'\x22';if(this[_0xe9bd('0xa0')](_0x13b95b[_0xe9bd('0x77')])){_0x2fa992+=','+_0x13b95b[_0xe9bd('0x77')];}var _0x1bda30=this[_0xe9bd('0xf')]['exec'](_0xe9bd('0xaf'),_0x2fa992);if(_0x1bda30['result']===-0x1){return _0x1bda30;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xb0'),_0x2fa992));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xb1')]=function(_0x5bf65b){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xb2'),_0x5bf65b['label']));if(!this[_0xe9bd('0xa0')](_0x5bf65b[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}var _0x7d2411='\x22'+_0x5bf65b[_0xe9bd('0x59')]+'\x22';if(this[_0xe9bd('0xa0')](_0x5bf65b[_0xe9bd('0x77')])){_0x7d2411+=','+_0x5bf65b[_0xe9bd('0x77')];}var _0x5c0b2d=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0xaf'),_0x7d2411);if(_0x5c0b2d['result']===-0x1){return _0x5c0b2d;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x7d2411));};AGIVertices['prototype'][_0xe9bd('0xb4')]=function(_0x183071){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xb5'),_0x183071[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x183071['grammar'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20grammar\x20configured');}var _0x767a44=_0x183071[_0xe9bd('0xb6')];if(this[_0xe9bd('0xa0')](_0x183071[_0xe9bd('0x77')])){_0x767a44+=','+_0x183071[_0xe9bd('0x77')];}var _0x142907=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0xb7'),_0x767a44);if(_0x142907[_0xe9bd('0x9d')]===-0x1){return _0x142907;}var _0x38ce72=this[_0xe9bd('0x9c')](_0xe9bd('0xb8'),_0xe9bd('0xb9'));if(_0x38ce72[_0xe9bd('0x9d')]===-0x1){return _0x38ce72;}var _0x58f68a=this[_0xe9bd('0x9c')](_0xe9bd('0xba'),_0xe9bd('0xbb'));if(_0x58f68a[_0xe9bd('0x9d')]===-0x1){return _0x58f68a;}var _0x217eff=this['getAndSetVariable'](_0xe9bd('0xbc'),_0xe9bd('0xbd'));if(_0x217eff[_0xe9bd('0x9d')]===-0x1){return _0x217eff;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x767a44));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xbf')]=function(_0xab57a8){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xc0'),_0xab57a8['label']));if(!this[_0xe9bd('0xa0')](_0xab57a8[_0xe9bd('0xb6')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc1'));}var _0x3541d0=_0xab57a8[_0xe9bd('0xb6')];if(this[_0xe9bd('0xa0')](_0xab57a8[_0xe9bd('0x77')])){_0x3541d0+=','+_0xab57a8[_0xe9bd('0x77')];}var _0xad2195=this[_0xe9bd('0xf')]['exec'](_0xe9bd('0xb7'),_0x3541d0);if(_0xad2195[_0xe9bd('0x9d')]===-0x1){return _0xad2195;}var _0x62dd82=this[_0xe9bd('0x9c')](_0xe9bd('0xb8'),'SESTEK_ASR_CONFIDENCE');if(_0x62dd82[_0xe9bd('0x9d')]===-0x1){return _0x62dd82;}var _0x43579b=this[_0xe9bd('0x9c')]('RECOG_INPUT()',_0xe9bd('0xc2'));if(_0x43579b[_0xe9bd('0x9d')]===-0x1){return _0x43579b;}var _0x496640=this['getAndSetVariable']('RECOG_INSTANCE()',_0xe9bd('0xc3'));if(_0x496640[_0xe9bd('0x9d')]===-0x1){return _0x496640;}return this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x3541d0));};AGIVertices['prototype'][_0xe9bd('0xc4')]=function(_0x3445f6){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3445f6[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x3445f6['odbc_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xc5'));}var _0x33d5cb=this['getSquareOdbc']['sync'](this,_0x3445f6['odbc_id']);if(!_0x33d5cb){return this[_0xe9bd('0xf')]['error'](_0x3445f6,_0xe9bd('0xc6'));}if(!this[_0xe9bd('0xa0')](_0x3445f6[_0xe9bd('0x2e')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xc7'));}var _0x53b73c=_0x3445f6[_0xe9bd('0x2e')][_0xe9bd('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xc8'),_0x53b73c));var _0x25def7=this['getQueryOdbc'][_0xe9bd('0x6f')](this,_0x33d5cb,_0x53b73c);this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3445f6,_0x53b73c);if(!this[_0xe9bd('0xa0')](_0x3445f6['variable_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}var _0x152070=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x3445f6[_0xe9bd('0xca')]);if(!_0x152070){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xcb'));}var _0x3cfa05=this;_0x25def7[_0xe9bd('0xcc')](function(_0x11a03d,_0x4eeb96){Object[_0xe9bd('0xcd')](_0x11a03d)[_0xe9bd('0xcc')](function(_0x571328){_0x3cfa05[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('%s[%s][%s]',_0x152070,_0x4eeb96,_0x571328),_0x11a03d[_0x571328]);});});this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xce'),_0x152070),_0x25def7['length']);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xcf'),_0x152070));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xd0')]=function(_0x58f73d){logger[_0xe9bd('0xd1')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x58f73d[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x58f73d[_0xe9bd('0xd2')])){return this['channel'][_0xe9bd('0x2b')](_0x58f73d,_0xe9bd('0xd3'));}var _0x5e60b0=this[_0xe9bd('0x1b')][_0xe9bd('0x6f')](this,_0x58f73d[_0xe9bd('0xd2')]);if(!_0x5e60b0){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x58f73d,_0xe9bd('0xd4'));}var _0x1d94e1=this['channel'][_0xe9bd('0x54')](_0xe9bd('0xd5'),[util[_0xe9bd('0x29')](_0xe9bd('0xd6'),_0x5e60b0),_0x58f73d[_0xe9bd('0x63')],_0x58f73d[_0xe9bd('0xd7')],_0x58f73d['url']]);if(_0x1d94e1[_0xe9bd('0x9d')]===-0x1){return _0x1d94e1;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xd8'),'DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x470071){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0xd9'),_0x470071['label']));if(!this[_0xe9bd('0xa0')](_0x470071[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xda'));}if(!this[_0xe9bd('0xa0')](_0x470071[_0xe9bd('0x59')])){return this['channel']['noop'](_0xe9bd('0xb3'));}this['channel']['bot']=!![];this[_0xe9bd('0x36')](_0x470071);this[_0xe9bd('0x41')](_0x470071[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xdb'),_0x470071[_0xe9bd('0x59')]));var _0xe55ad1=this[_0xe9bd('0x78')][_0xe9bd('0x6f')](this,_0x470071);if(_0xe55ad1){for(var _0x5b44bf in _0xe55ad1){if(_0xe55ad1[_0xe9bd('0x91')](_0x5b44bf)){this['channel'][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xdc'),_0x5b44bf[_0xe9bd('0x68')]()),_0xe55ad1[_0x5b44bf]);}}this['createSquareMessage'](_0xe55ad1[_0xe9bd('0xdd')],_0xe9bd('0xde'));return this[_0xe9bd('0xf')]['noop'](util['format'](_0xe9bd('0xdf'),_0xe55ad1[_0xe9bd('0xdd')]));}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x470071,_0xe9bd('0xe0'));};AGIVertices[_0xe9bd('0x10')]['sesteknda']=function(_0x2daedf){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xe1'),_0x2daedf['label']));if(!this[_0xe9bd('0xa0')](_0x2daedf[_0xe9bd('0xe2')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xe3'));}if(!this[_0xe9bd('0xa0')](_0x2daedf[_0xe9bd('0xe4')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xe5'));}if(!this[_0xe9bd('0xa0')](_0x2daedf['password'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xe6'));}if(!this[_0xe9bd('0xa0')](_0x2daedf['ndassistant_url'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')]['bot']=!![];this[_0xe9bd('0x36')](_0x2daedf);this['createSquareMessage'](_0x2daedf[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xe7'),_0x2daedf[_0xe9bd('0x59')]));var _0x103791=this[_0xe9bd('0x79')][_0xe9bd('0x6f')](this,_0x2daedf);if(_0x103791){for(var _0x53a060 in _0x103791){if(_0x103791['hasOwnProperty'](_0x53a060)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xe8'),_0x53a060[_0xe9bd('0x68')]()),_0x103791[_0x53a060]);}}this[_0xe9bd('0x41')](_0x103791[_0xe9bd('0xdd')],_0xe9bd('0xde'));if(_0x103791['audiofile']){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0xe9'),_0x103791['audiofile']));var _0x3b32f7=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x103791['audiofile']);try{fs[_0xe9bd('0xeb')](_0x103791[_0xe9bd('0xec')]+'.wav');}catch(_0x10d9ed){logger[_0xe9bd('0x2b')](_0x10d9ed);}return _0x3b32f7;}else{return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('SestekNDA\x20Result\x20%s',_0x103791[_0xe9bd('0xdd')]));}}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x2daedf,_0xe9bd('0xed'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xee')]=function(_0x551853){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0xef'),_0x551853['label']));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('end');};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xf0')]=function(_0x5a8d1a){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5a8d1a['label']));var _0x3a625d='';if(_0x5a8d1a[_0xe9bd('0xf1')]){if(!this['isConfigured'](_0x5a8d1a['trunk_id'])){return this[_0xe9bd('0xf')]['error'](_0x5a8d1a,_0xe9bd('0xf2'));}else{var _0x447743=parseInt(_0x5a8d1a['trunk_id'],0xa);if(isNaN(_0x447743)){_0x3a625d=_0x5a8d1a[_0xe9bd('0xf1')];}else{_0x3a625d=this[_0xe9bd('0x1c')][_0xe9bd('0x6f')](this,_0x5a8d1a[_0xe9bd('0xf1')]);if(!_0x3a625d){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5a8d1a,_0xe9bd('0xf3'));}}}}else if(_0x5a8d1a[_0xe9bd('0xf4')]){_0x3a625d=_0x5a8d1a[_0xe9bd('0xf4')];}else{return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5a8d1a,_0xe9bd('0xf2'));}var _0x430df1=this['channel'][_0xe9bd('0x54')](_0xe9bd('0xd5'),[util[_0xe9bd('0x29')](_0xe9bd('0xf5'),_0x3a625d,_0x5a8d1a[_0xe9bd('0x47')]),_0x5a8d1a['timeout'],_0x5a8d1a[_0xe9bd('0xd7')],_0x5a8d1a[_0xe9bd('0x62')]]);if(_0x430df1[_0xe9bd('0x9d')]===-0x1){return _0x430df1;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xd8'),'DIAL'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xf6')]=function(_0x49e80a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xf7'),_0x49e80a[_0xe9bd('0x38')]));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xf6'));};AGIVertices[_0xe9bd('0x10')]['getdigits']=function(_0x3e445d){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3e445d[_0xe9bd('0x38')]));if(_0x3e445d[_0xe9bd('0xa1')]===0x0){return this['maxRetry'](_0x3e445d);}_0x3e445d['retry']-=0x1;if(!this[_0xe9bd('0xa0')](_0x3e445d['file_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3e445d,_0xe9bd('0xf8'));}var _0x4feba7=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x3e445d[_0xe9bd('0xfa')]);if(!_0x4feba7){return this[_0xe9bd('0xf')]['error'](_0x3e445d,_0xe9bd('0xfb'));}if(!this[_0xe9bd('0xa0')](_0x3e445d[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0xe9bd('0xc9'));}var _0x4d2675=this[_0xe9bd('0xf')][_0xe9bd('0xfc')](_0x4feba7,_0x3e445d[_0xe9bd('0xfd')],_0x3e445d[_0xe9bd('0xfe')]);var _0x458fe0=_0x4d2675[_0xe9bd('0x9d')]?_0x4d2675[_0xe9bd('0x9d')][_0xe9bd('0x4b')]():'';logger['info']('test',JSON[_0xe9bd('0x72')](_0x4d2675));if(_0x4d2675[_0xe9bd('0x9d')]===-0x1){this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3e445d,_0x458fe0);return _0x4d2675;}else if(_0x4d2675[_0xe9bd('0x9e')]===_0xe9bd('0x63')){_0x4d2675[_0xe9bd('0x9d')]=_0x458fe0[_0xe9bd('0x9a')]>=parseInt(_0x3e445d[_0xe9bd('0xff')])?'x':'i';}else{_0x4d2675[_0xe9bd('0x9d')]=_0x458fe0['length']>=parseInt(_0x3e445d[_0xe9bd('0xff')])&&_0x458fe0[_0xe9bd('0x9a')]<=parseInt(_0x3e445d[_0xe9bd('0xfe')])?'x':'i';}var _0xd98d29=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x3e445d[_0xe9bd('0xca')]);if(!_0xd98d29){return this['channel'][_0xe9bd('0x2b')](_0x3e445d,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xd98d29,_0x458fe0);if(this[_0xe9bd('0xa0')](_0x3e445d['hiddendigitsnum'])){var _0x3be5d4=parseInt(_0x3e445d[_0xe9bd('0x100')],0xa);var _0x3fd3fb=rs[_0xe9bd('0x101')]({'charset':'*','length':_0x3be5d4});var _0x333e0e=_0x458fe0['length'];if(_0x333e0e>0x0){if(_0x333e0e>_0x3be5d4){this[_0xe9bd('0x36')]['sync'](this,_0x3e445d,_0x3e445d[_0xe9bd('0x102')]===_0xe9bd('0x103')?_0x3fd3fb+_0x458fe0[_0xe9bd('0x104')](_0x3be5d4):_0x458fe0['substr'](0x0,_0x333e0e-_0x3be5d4)+_0x3fd3fb);}else{this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x3e445d,rs[_0xe9bd('0x101')]({'charset':'*','length':_0x333e0e}));}}else{this[_0xe9bd('0x36')]['sync'](this,_0x3e445d,'');}}else{this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3e445d,_0x458fe0);}return _0x4d2675;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xe')]=function(_0x2e3595){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x105'),_0x2e3595[_0xe9bd('0x38')]));return this[_0xe9bd('0xd')](_0x2e3595);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x106')]=function(_0x3b5bca){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x107'),_0x3b5bca[_0xe9bd('0x38')]));this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x3b5bca,_0x3b5bca[_0xe9bd('0x108')]);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x109'),_0x3b5bca[_0xe9bd('0x108')]));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x10a')]=function(_0x52d59e){logger['info'](util[_0xe9bd('0x29')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x52d59e[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x82')])||!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x83')])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0x10b'));}if(!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x10c'),_0x52d59e[_0xe9bd('0x59')]));var _0x1b346d=this['awsPolly'][_0xe9bd('0x6f')](this,_0x52d59e);if(_0x1b346d){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x10d'),_0x1b346d));var _0x3e06f7=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x1b346d);try{fs[_0xe9bd('0xeb')](_0x1b346d+_0xe9bd('0x10e'));}catch(_0x1871eb){logger[_0xe9bd('0x2b')](_0x1871eb);}return _0x3e06f7;}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x52d59e,_0xe9bd('0x10f'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x110')]=function(_0x249e3a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x249e3a[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x249e3a[_0xe9bd('0x82')])||!this[_0xe9bd('0xa0')](_0x249e3a['aws_secret_access_key'])){return this[_0xe9bd('0xf')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x249e3a['aws_bot_name'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x111'));}if(!this['isConfigured'](_0x249e3a[_0xe9bd('0x59')])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0x112')]=!![];this['createSquareDetailsReport'](_0x249e3a);this['createSquareMessage'](_0x249e3a[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x113'),_0x249e3a['text']));var _0x7bf3ff=this['awsLex'][_0xe9bd('0x6f')](this,_0x249e3a);if(_0x7bf3ff){for(var _0x1c4e38 in _0x7bf3ff){if(_0x7bf3ff[_0xe9bd('0x91')](_0x1c4e38)&&_['isString'](_0x7bf3ff[_0x1c4e38])){this[_0xe9bd('0xf')]['setVariable'](util[_0xe9bd('0x29')](_0xe9bd('0x114'),_0x1c4e38[_0xe9bd('0x68')]()),_0x7bf3ff[_0x1c4e38]);}}if(_[_0xe9bd('0x44')](_0x7bf3ff[_0xe9bd('0x76')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x115'));}else{this[_0xe9bd('0x41')](_0x7bf3ff[_0xe9bd('0x76')],_0xe9bd('0xde'));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x116'),_0x7bf3ff[_0xe9bd('0x76')]));}}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x249e3a,_0xe9bd('0x117'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x118')]=function(_0x53eb33){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x53eb33[_0xe9bd('0x38')],_0x53eb33[_0xe9bd('0x63')]));if(!this[_0xe9bd('0xa0')](_0x53eb33[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xda'));}var _0x2d7c18=_0xe9bd('0x119');var _0x27c2aa=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,rs[_0xe9bd('0x101')](0x4));var _0xe8f186=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x27c2aa,_0x2d7c18);var _0x5564d7=!![];if(_0x53eb33[_0xe9bd('0x11b')]===_0xe9bd('0x11c')){_0x5564d7=![];}var _0x3b0650=this[_0xe9bd('0xf')][_0xe9bd('0x11d')](_0x27c2aa,_0x2d7c18,_0x53eb33[_0xe9bd('0x11e')],_0x53eb33[_0xe9bd('0x63')],undefined,_0x5564d7);if(_0x3b0650[_0xe9bd('0x9d')]!==-0x1){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x11f'),_0xe8f186));var _0x10ea33=this['googleASR'][_0xe9bd('0x6f')](this,_0x53eb33,_0xe8f186);if(_0x10ea33){for(var _0x3682d1 in _0x10ea33){if(_0x10ea33[_0xe9bd('0x91')](_0x3682d1)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0x120'),_0x3682d1[_0xe9bd('0x68')]()),_0x10ea33[_0x3682d1]);}}return this['channel'][_0xe9bd('0xa9')](util['format']('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x10ea33)));}}return _0x3b0650;};AGIVertices[_0xe9bd('0x10')]['tildeasr']=function(_0x28b74b){logger['info'](util['format'](_0xe9bd('0x121'),_0x28b74b['label']));if(!this[_0xe9bd('0xa0')](_0x28b74b[_0xe9bd('0x8e')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x122'));}if(!this[_0xe9bd('0xa0')](_0x28b74b['appsecret'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x123'));}var _0x51e0b5=_0xe9bd('0x119');var _0x3c0224=util['format'](_0xe9bd('0x11a'),FILES_PATH,rs[_0xe9bd('0x101')](0x4));var _0x44af86=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x3c0224,_0x51e0b5);var _0x53a617=!![];if(_0x28b74b['beep']===_0xe9bd('0x11c')){_0x53a617=![];}var _0x5d2b09=this['channel']['recordFile'](_0x3c0224,_0x51e0b5,_0x28b74b[_0xe9bd('0x11e')],_0x28b74b[_0xe9bd('0x63')],undefined,_0x53a617);if(_0x5d2b09[_0xe9bd('0x9d')]!==-0x1){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x124'),_0x44af86));var _0x49077e=this[_0xe9bd('0x8d')][_0xe9bd('0x6f')](this,_0x28b74b,_0x44af86);if(_0x49077e){for(var _0x95d14e in _0x49077e){if(_0x49077e['hasOwnProperty'](_0x95d14e)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('TILDE_ASR_%s',_0x95d14e[_0xe9bd('0x68')]()),_0x49077e[_0x95d14e]);}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x125'),JSON[_0xe9bd('0x72')](_0x49077e)));}}return _0x5d2b09;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x126')]=function(_0x550ac8){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x127'),_0x550ac8[_0xe9bd('0x38')]));return this['channel'][_0xe9bd('0x128')](_0x550ac8[_0xe9bd('0x3d')],_0x550ac8[_0xe9bd('0x3e')],_0x550ac8[_0xe9bd('0x129')]);};AGIVertices[_0xe9bd('0x10')]['gotoif']=function(_0x1377ec){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x12a'),_0x1377ec['label']));if(!this[_0xe9bd('0xa0')](_0x1377ec[_0xe9bd('0x12b')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x1377ec,'no\x20condition\x20configured');}try{var _0x3d7f65=eval(_0x1377ec[_0xe9bd('0x12b')])?_0xe9bd('0x12c'):_0xe9bd('0x12d');this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x12e'),_0x1377ec[_0xe9bd('0x12b')],_0x3d7f65));return{'code':0xc8,'result':_0x3d7f65};}catch(_0x18aee1){return{'code':0xc8,'result':_0xe9bd('0x12d')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x12f')]=function(_0x568937){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x130'),_0x568937[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x568937[_0xe9bd('0x131')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x568937,_0xe9bd('0x132'));}var _0x5ad4a6=this['getIntervals'][_0xe9bd('0x6f')](this,_0x568937['interval_id']);if(!_0x5ad4a6){return this['channel'][_0xe9bd('0x2b')](_0x568937,'no\x20intervals\x20found');}for(var _0x122413=0x0;_0x122413<_0x5ad4a6[_0xe9bd('0x9a')];_0x122413+=0x1){var _0x3e7830=this[_0xe9bd('0xf')][_0xe9bd('0x11')](util[_0xe9bd('0x29')](_0xe9bd('0x133'),_0x5ad4a6[_0x122413]));if(_0x3e7830[_0xe9bd('0x9d')]===-0x1){return _0x3e7830;}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],_0x3e7830[_0xe9bd('0x9e')]));if(_0x3e7830[_0xe9bd('0x9e')]===_0xe9bd('0x12c')){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('IFTIME\x20%s\x20%s',_0x5ad4a6[_0x122413],_0xe9bd('0x12c')));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],'true'));return{'code':0xc8,'result':_0xe9bd('0x12c')};}else{logger['info'](util['format'](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],_0xe9bd('0x12d')));this['channel']['noop'](util['format'](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xe9bd('0x10')]['hangup']=function(_0x3f709e){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x135'),_0x3f709e['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x136')]();};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x137')]=function(_0x13ea8a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x13ea8a['label']));if(!this['isConfigured'](_0x13ea8a['key'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xda'));}var _0x223d9b=_0xe9bd('0x119');var _0x446fe7=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,rs['generate'](0x4));var _0x99245c=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x446fe7,_0x223d9b);var _0x34c059=!![];if(_0x13ea8a[_0xe9bd('0x11b')]===_0xe9bd('0x11c')){_0x34c059=![];}var _0x510de3=this[_0xe9bd('0xf')][_0xe9bd('0x11d')](_0x446fe7,_0x223d9b,_0x13ea8a[_0xe9bd('0x11e')],_0x13ea8a[_0xe9bd('0x63')],undefined,_0x34c059);if(_0x510de3['result']!==-0x1){this['channel']['noop'](util[_0xe9bd('0x29')]('ispeech\x20%s\x20file\x20created',_0x99245c));var _0x47254a=this[_0xe9bd('0x7e')][_0xe9bd('0x6f')](this,_0x13ea8a,_0x99245c);if(_0x47254a){for(var _0xb30c8f in _0x47254a){if(_0x47254a[_0xe9bd('0x91')](_0xb30c8f)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('ISPEECH_ASR_%s',_0xb30c8f[_0xe9bd('0x68')]()),_0x47254a[_0xb30c8f]);}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x138'),JSON[_0xe9bd('0x72')](_0x47254a)));}}return _0x510de3;};AGIVertices[_0xe9bd('0x10')]['ispeechtts']=function(_0x9766f2){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x139'),_0x9766f2[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x9766f2[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x9766f2[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13a'),_0x9766f2[_0xe9bd('0x59')]));var _0x293858=this[_0xe9bd('0x7a')][_0xe9bd('0x6f')](this,_0x9766f2);if(_0x293858){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('ispeech\x20%s\x20file\x20created',_0x293858));var _0x3ebd5d=this[_0xe9bd('0xf')]['streamFile'](_0x293858,_0x9766f2[_0xe9bd('0x11e')]);try{fs[_0xe9bd('0xeb')](_0x293858+_0xe9bd('0x10e'));}catch(_0x148989){logger['error'](_0x148989);}return _0x3ebd5d;}return this[_0xe9bd('0xf')]['error'](_0x9766f2,_0xe9bd('0x13b'));};AGIVertices[_0xe9bd('0x10')]['login']=function(_0x143c72){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x143c72[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x143c72[_0xe9bd('0x13c')])){return this[_0xe9bd('0xf')]['error'](_0x143c72,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));var _0xe84682=this['agentLogin'][_0xe9bd('0x6f')](this,_0x143c72[_0xe9bd('0x13c')]);if(_0xe84682){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72['findBy']));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices['prototype'][_0xe9bd('0x142')]=function(_0x4ee2b7){logger['info'](util['format'](_0xe9bd('0x143'),_0x4ee2b7[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x4ee2b7[_0xe9bd('0x13c')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x4ee2b7,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this['channel'][_0xe9bd('0x3b')],_0x4ee2b7[_0xe9bd('0x13c')]));var _0x48af31=this[_0xe9bd('0x51')]['sync'](this,_0x4ee2b7['findBy']);if(_0x48af31){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this['channel']['callerid'],_0x4ee2b7[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x4ee2b7['findBy']));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this['channel'][_0xe9bd('0x3b')],_0x4ee2b7[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x4ee2b7['findBy']));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x145')]=function(_0x47c137){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x47c137[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x47c137[_0xe9bd('0x146')])){return this[_0xe9bd('0xf')]['error'](_0x47c137,'no\x20operation\x20configured');}this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x147'),_0x47c137['operation']));var _0x4b0a01=eval(_0x47c137['operation']);if(!this['isConfigured'](_0x47c137[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}var _0x253be2=this[_0xe9bd('0x11')]['sync'](this,_0x47c137['variable_id']);if(!_0x253be2){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x47c137,_0xe9bd('0xcb'));}if(_[_0xe9bd('0x148')](_0x4b0a01)){var _0x517e1d=this;_0x4b0a01['forEach'](function(_0x5a8333,_0x3c091e){_0x517e1d['channel'][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('%s[%s]',_0x253be2,_0x3c091e),_0x5a8333);});return this['channel'][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x149'),_0x253be2));}else{return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x253be2,_0x4b0a01);}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xc')]=function(_0x5482ad){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14a'),_0x5482ad[_0xe9bd('0x38')]));if(_0x5482ad[_0xe9bd('0xa1')]===0x0){return this[_0xe9bd('0x14b')](_0x5482ad);}_0x5482ad['retry']-=0x1;if(!this[_0xe9bd('0xa0')](_0x5482ad['file_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,_0xe9bd('0xf8'));}var _0x2b5eaa=this['getSound'][_0xe9bd('0x6f')](this,_0x5482ad[_0xe9bd('0xfa')]);if(!_0x2b5eaa){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,'no\x20file\x20audio\x20found');}var _0xf9e1e2=this[_0xe9bd('0xf')][_0xe9bd('0xfc')](_0x2b5eaa,_0x5482ad['response'],_0x5482ad[_0xe9bd('0x14c')]);var _0x2ce47d=_0xf9e1e2[_0xe9bd('0x9d')];if(_0xf9e1e2['result']===-0x1){this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x5482ad,'-1');return _0xf9e1e2;}else if(_0xf9e1e2[_0xe9bd('0x9e')]===_0xe9bd('0x63')){_0xf9e1e2[_0xe9bd('0x9d')]=_0xf9e1e2[_0xe9bd('0x9d')][_0xe9bd('0x9a')]>0x0?_0xf9e1e2['result']:'t';}else if(_['isEmpty'](_0xf9e1e2[_0xe9bd('0x9d')])){_0xf9e1e2[_0xe9bd('0x9d')]='#';_0x2ce47d='#';}if(!this[_0xe9bd('0xa0')](_0x5482ad['variable_id'])){this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}else{var _0x2e3586=this['getVariable'][_0xe9bd('0x6f')](this,_0x5482ad[_0xe9bd('0xca')]);if(!_0x2e3586){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x2e3586,_0x2ce47d);}this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x5482ad,_0x2ce47d);return _0xf9e1e2;};AGIVertices['prototype']['noop']=function(_0x22dd87){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14d'),_0x22dd87['label']));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0x22dd87[_0xe9bd('0x14e')]||_0x22dd87[_0xe9bd('0x38')]);};AGIVertices[_0xe9bd('0x10')]['pause']=function(_0x39e628){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14f'),_0x39e628['label']));if(!this['isConfigured'](_0x39e628[_0xe9bd('0x13c')])){return this['channel'][_0xe9bd('0x2b')](_0x39e628,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this['channel']['callerid'],_0x39e628[_0xe9bd('0x13c')]));var _0x5690ee=this[_0xe9bd('0x4d')][_0xe9bd('0x6f')](this,_0x39e628['pause_id']);var _0x5c26b7=this[_0xe9bd('0x4e')][_0xe9bd('0x6f')](this,_0x39e628[_0xe9bd('0x13c')],_0x5690ee);if(_0x5c26b7){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x39e628[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe9bd('0xf')]['callerid'],_0x39e628[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x39e628[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this['channel']['callerid'],_0x39e628[_0xe9bd('0x13c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x150')]=function(_0x43d731){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x151'),_0x43d731[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x43d731[_0xe9bd('0xfa')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x43d731,_0xe9bd('0xf8'));}var _0xc877fd=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x43d731[_0xe9bd('0xfa')]);if(!_0xc877fd){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x43d731,_0xe9bd('0xfb'));}var _0x57e43c=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x152'),[_0xc877fd,_0x43d731[_0xe9bd('0xd7')]]);if(_0x57e43c[_0xe9bd('0x9d')]===-0x1){return _0x57e43c;}return this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'PLAYBACK',_0xc877fd));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x153')]=function(_0x3cd856){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x154'),_0x3cd856[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x3cd856[_0xe9bd('0x155')])){return this[_0xe9bd('0xf')]['error'](_0x3cd856,_0xe9bd('0x156'));}var _0x912dfa='';var _0x1b633b=parseInt(_0x3cd856[_0xe9bd('0x155')],0xa);if(isNaN(_0x1b633b)){_0x912dfa=_0x3cd856[_0xe9bd('0x155')];}else{_0x912dfa=this[_0xe9bd('0x16')]['sync'](this,_0x3cd856[_0xe9bd('0x155')]);if(!_0x912dfa){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3cd856,_0xe9bd('0x157'));}}var _0x42d9cb='';if(this[_0xe9bd('0xa0')](_0x3cd856['file_id'])){var _0x1b9aa3=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x3cd856[_0xe9bd('0xfa')]);if(_0x1b9aa3){_0x42d9cb=_0x1b9aa3;}}this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3cd856,_0x912dfa);if(_0x3cd856[_0xe9bd('0xd7')]['indexOf']('x')<0x0){_0x3cd856[_0xe9bd('0xd7')]+='x';}if(_0x3cd856[_0xe9bd('0xd7')]['indexOf']('X')<0x0){_0x3cd856[_0xe9bd('0xd7')]+='X';}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xe9bd('0x158'),_0x912dfa?_0x912dfa[_0xe9bd('0x159')]():'');var _0xe27daf=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x15a'),[_0x912dfa,_0x3cd856['opts'],_0x3cd856['url'],_0x42d9cb,_0x3cd856['timeout'],_0x3cd856[_0xe9bd('0x7')],_0x3cd856[_0xe9bd('0x15b')],_0x3cd856[_0xe9bd('0x15c')],'',_0x3cd856['position']]);if(_0xe27daf[_0xe9bd('0x9d')]===-0x1){return _0xe27daf;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('Executed\x20command\x20%s\x20%s',_0xe9bd('0x15a'),_0x912dfa));};AGIVertices[_0xe9bd('0x10')]['record']=function(_0x13bb4f){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x13bb4f[_0xe9bd('0x38')]));var _0x7adf3a=_0x13bb4f[_0xe9bd('0x15d')]||'wav';var _0x4ca812=util[_0xe9bd('0x29')](_0xe9bd('0x15e'),this['channel'][_0xe9bd('0x37')],rs[_0xe9bd('0x101')](0x5));var _0x3b7324=util[_0xe9bd('0x29')](_0xe9bd('0x15f'),FILES_PATH,_0x4ca812,_0x7adf3a);var _0x126e2e=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,_0x4ca812);this[_0xe9bd('0x3c')][_0xe9bd('0x6f')](this,_0x13bb4f,_0x4ca812,_0x3b7324);this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xe9bd('0x160'),_0x4ca812);logger['info'](_0xe9bd('0x161'),_0x126e2e,_0x7adf3a,_0x13bb4f[_0xe9bd('0x162')],_0x13bb4f[_0xe9bd('0x63')]);return this[_0xe9bd('0xf')]['recordFile'](_0x126e2e,_0x7adf3a,_0x13bb4f[_0xe9bd('0x162')],_0x13bb4f['timeout'],undefined,!![]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x163')]=function(_0x258d43){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x164'),_0x258d43['label']));if(!this['isConfigured'](_0x258d43[_0xe9bd('0x62')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x165'));}var _0x3a5061=this[_0xe9bd('0x61')]['sync'](this,_0x258d43);logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x166'),util['inspect'](_0x3a5061,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x258d43[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x25cf50=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x258d43[_0xe9bd('0xca')]);if(!_0x25cf50){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x258d43,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0x167'),_0x25cf50),_0x3a5061[_0xe9bd('0x74')]?_0x3a5061[_0xe9bd('0x74')]:_0xe9bd('0x168'));this['channel']['setVariable'](util[_0xe9bd('0x29')]('%s_STATUS_MESSAGE',_0x25cf50),_0x3a5061['statusMessage']?_0x3a5061[_0xe9bd('0x75')]:'OK');if(_0x3a5061[_0xe9bd('0x69')]){try{this[_0xe9bd('0x97')](_0x3a5061[_0xe9bd('0x69')],_0x25cf50);}catch(_0x40b617){logger[_0xe9bd('0x2b')](util[_0xe9bd('0x29')](_0xe9bd('0x169'),_0x25cf50));}}return this[_0xe9bd('0xf')]['noop'](util['format']('variable\x20%s\x20set',_0x25cf50));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16a')]=function(_0x4637c3){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x16b'),_0x4637c3['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x16c')](_0x4637c3['digits']['replace'](/\s+/g,''),_0x4637c3[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16d')]=function(_0x4e7305){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4e7305['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x16e')](_0x4e7305[_0xe9bd('0x64')][_0xe9bd('0x56')](/\s+/g,''),_0x4e7305[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16f')]=function(_0x47e667){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x47e667['label']));return this['channel'][_0xe9bd('0x170')](_0x47e667[_0xe9bd('0x59')],_0x47e667[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x171')]=function(_0x48db15){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x48db15[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x48db15[_0xe9bd('0x172')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x173'));}var _0x430aaf=this[_0xe9bd('0x20')][_0xe9bd('0x6f')](this,_0x48db15[_0xe9bd('0x172')]);if(!_0x430aaf||!_0x430aaf[_0xe9bd('0x174')]){return this['channel'][_0xe9bd('0x2b')](_0x48db15,'no\x20mail\x20account\x20found');}var _0x569660={'from':util[_0xe9bd('0x29')](_0xe9bd('0x175'),_0x430aaf[_0xe9bd('0x18')],_0x430aaf[_0xe9bd('0x176')]||_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x177')]),'to':_0x48db15['to']||'','cc':_0x48db15['cc']||'','bcc':_0x48db15[_0xe9bd('0x178')]||'','subject':_0x48db15[_0xe9bd('0x179')],'html':_0x48db15['text'],'text':_0x48db15[_0xe9bd('0x59')]};var _0x3c38b5={'tls':{'rejectUnauthorized':![]}};if(_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x17a')]){_0x3c38b5[_0xe9bd('0x17a')]=_0x430aaf[_0xe9bd('0x174')]['service'];}else{_0x3c38b5[_0xe9bd('0x17b')]=_0x430aaf[_0xe9bd('0x174')]['host'];_0x3c38b5[_0xe9bd('0x17c')]=_0x430aaf[_0xe9bd('0x174')]['port'];_0x3c38b5[_0xe9bd('0x17d')]=_0x430aaf['Smtp']['secure'];}if(_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x17e')]){_0x3c38b5[_0xe9bd('0x17f')]={'user':_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x177')],'pass':_0x430aaf[_0xe9bd('0x174')]['pass']};}if(this['isConfigured'](_0x48db15[_0xe9bd('0x180')])){}logger[_0xe9bd('0xd1')](_0xe9bd('0x181'),JSON[_0xe9bd('0x72')](_0x569660));this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x48db15,_0x48db15['account_id']);this['channel']['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x182'),_0x430aaf[_0xe9bd('0x18')]));this[_0xe9bd('0x21')][_0xe9bd('0x6f')](this,_0x3c38b5,_0x569660);return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0x183'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x184')]=function(_0x42c0d5){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x185'),_0x42c0d5[_0xe9bd('0x38')]));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x186')]=function(_0x1000d1){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x187'),_0x1000d1[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x1000d1[_0xe9bd('0x188')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20sms\x20account\x20configured');}var _0x5504f5=this[_0xe9bd('0x33')]['sync'](this,_0x1000d1[_0xe9bd('0x188')]);if(!_0x5504f5){return this[_0xe9bd('0xf')]['error'](_0x1000d1,_0xe9bd('0x189'));}var _0x19cf5a={'body':_0x1000d1[_0xe9bd('0x18a')],'phone':_0x1000d1['to']||'','SmsAccountId':_0x5504f5['id']};logger['debug']('sendSMS\x20message',JSON[_0xe9bd('0x72')](_0x19cf5a));this[_0xe9bd('0x36')]['sync'](this,_0x1000d1,_0x1000d1[_0xe9bd('0x188')]);this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x18b'),_0x5504f5[_0xe9bd('0x18')]));this[_0xe9bd('0x35')][_0xe9bd('0x6f')](this,_0x19cf5a);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x18c'));};AGIVertices['prototype'][_0xe9bd('0x18d')]=function(_0x312523){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x18e'),_0x312523[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x312523[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')]['error'](_0x312523,'no\x20variable\x20selected');}var _0x447903=this[_0xe9bd('0x11')]['sync'](this,_0x312523['variable_id']);if(!_0x447903){return this['channel'][_0xe9bd('0x2b')](_0x312523,_0xe9bd('0xcb'));}return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x447903,_0x312523[_0xe9bd('0x18f')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x190')]=function(_0x27dc44){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x191'),_0x27dc44[_0xe9bd('0x38')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x192'));if(_0x27dc44['answer']==='yes'){this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('Answer');return this[_0xe9bd('0xf')][_0xe9bd('0xa4')]();}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x193'));};AGIVertices['prototype'][_0xe9bd('0x194')]=function(_0x5d4e3d){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x195'),_0x5d4e3d[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x5d4e3d[_0xe9bd('0x196')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5d4e3d,_0xe9bd('0x197'));}var _0x5b7666=this[_0xe9bd('0x198')]['sync'](this,_0x5d4e3d[_0xe9bd('0x196')]);if(!this[_0xe9bd('0xa0')](_0x5b7666)){return this['channel']['error'](_0x5d4e3d,util[_0xe9bd('0x29')](_0xe9bd('0x199'),_0x5d4e3d[_0xe9bd('0x196')]));}if(_0x5b7666===this[_0xe9bd('0xf')][_0xe9bd('0x3a')]){return this[_0xe9bd('0xf')]['error'](_0x5d4e3d,_0xe9bd('0x19a'));}this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x5d4e3d,_0x5b7666);var _0xa9de92=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x19b'),util[_0xe9bd('0x29')](_0xe9bd('0x19c'),config[_0xe9bd('0x7')][_0xe9bd('0x17b')]||_0xe9bd('0x19d'),_0x5b7666,this['channel']['arg_1']));if(_0xa9de92[_0xe9bd('0x9d')]===-0x1){return _0xa9de92;}return this['channel']['noop'](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'AGI',_0x5b7666));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x19e')]=function(_0x1b8df2){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1b8df2[_0xe9bd('0x38')]));var _0x4bf6f8=this[_0xe9bd('0x19f')][_0xe9bd('0x6f')](this,_0x1b8df2['command']);this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x1b8df2,_0x1b8df2['command']);if(this['isConfigured'](_0x1b8df2['variable_id'])){var _0x347d01=this['getVariable'][_0xe9bd('0x6f')](this,_0x1b8df2[_0xe9bd('0xca')]);if(_0x347d01){this[_0xe9bd('0xf')]['setVariable'](_0x347d01,_0x4bf6f8);return this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1b8df2[_0xe9bd('0xa3')],_0x347d01));}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1b8df2['command']));};AGIVertices[_0xe9bd('0x10')]['google_cloud_tts']=function(_0xf82d5f){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xf82d5f[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0xf82d5f[_0xe9bd('0x58')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0xf82d5f[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a0'),_0xf82d5f[_0xe9bd('0x59')]));var _0x27ed51=this[_0xe9bd('0x57')][_0xe9bd('0x6f')](this,_0xf82d5f);if(_0x27ed51){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a1'),_0x27ed51));var _0x3657f3=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x27ed51);try{fs[_0xe9bd('0xeb')](_0x27ed51+'.wav');}catch(_0x502a91){logger['error'](_0x502a91);}return _0x3657f3;}return this['channel'][_0xe9bd('0x2b')](_0xf82d5f,_0xe9bd('0x1a2'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1a3')]=function(_0x3bd62c){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x1a4'),_0x3bd62c['label']));if(!this[_0xe9bd('0xa0')](_0x3bd62c['text'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a5'),_0x3bd62c['text']));var _0x2980b6=this[_0xe9bd('0x60')][_0xe9bd('0x6f')](this,_0x3bd62c);if(_0x2980b6){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a6'),_0x2980b6));var _0x392c36=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x2980b6);try{fs['unlink'](_0x2980b6+_0xe9bd('0x10e'));}catch(_0x2d453b){logger[_0xe9bd('0x2b')](_0x2d453b);}return _0x392c36;}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3bd62c,_0xe9bd('0x1a7'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1a8')]=function(_0x405b45){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x1a9'),_0x405b45['label']));if(!this[_0xe9bd('0xa0')](_0x405b45['findBy'])){return this['channel'][_0xe9bd('0x2b')](_0x405b45,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));var _0x5710b5=this[_0xe9bd('0x50')]['sync'](this,_0x405b45[_0xe9bd('0x13c')]);if(_0x5710b5){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x140'),this[_0xe9bd('0xf')]['callerid'],_0x405b45[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1aa')]=function(_0x981d02){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x1ab'),_0x981d02[_0xe9bd('0x38')]));var _0xa800ed=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x1ac'),[_0x981d02['mailbox'],_0x981d02[_0xe9bd('0x77')]]);if(_0xa800ed[_0xe9bd('0x9d')]===-0x1){return _0xa800ed;}return this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'VOICEMAIL',_0x981d02[_0xe9bd('0x1ad')]));};AGIVertices['prototype'][_0xe9bd('0x1ae')]=function(_0x1e869c){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x1af'),_0x1e869c[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x1e869c[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x1e869c,'no\x20variable\x20selected');}var _0x2cacd4=this['getVariable'][_0xe9bd('0x6f')](this,_0x1e869c[_0xe9bd('0xca')]);if(!_0x2cacd4){return this['channel']['error'](_0x1e869c,_0xe9bd('0xcb'));}var _0x38abb0=this['channel'][_0xe9bd('0x11')](_0x2cacd4);return{'code':0xc8,'result':_0x38abb0['extra']?_0x38abb0[_0xe9bd('0x9e')]:'-'};};String[_0xe9bd('0x10')][_0xe9bd('0x9b')]=function(_0x23ed69,_0x564c4e){return this['split'](_0x23ed69)[_0xe9bd('0x1b0')](_0x564c4e);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index d6fa1be..67e804a 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['milliseconds','diff','seconds','prototype','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','info','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4b750d,_0xa30386){_0x4b750d=_0x4b750d-0x0;var _0x1fb37a=_0x8ef6[_0x4b750d];return _0x1fb37a;};'use strict';var util=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var ami=require(_0x68ef('0x3'));var logger=require(_0x68ef('0x4'))(_0x68ef('0x5'));var RpcUser=require(_0x68ef('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x27d0af){this[_0x68ef('0x7')]=_0x27d0af[_0x68ef('0x7')];this[_0x68ef('0x8')]=_0x27d0af['agents'];this['timers']=_0x27d0af[_0x68ef('0x9')];this[_0x68ef('0xa')]={};ami['on'](_0x68ef('0xb'),this['syncAgentConnect'][_0x68ef('0xc')](this));ami['on'](_0x68ef('0xd'),this[_0x68ef('0xe')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0xf'),this[_0x68ef('0x10')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x11'),this[_0x68ef('0x12')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x13'),this[_0x68ef('0x14')]['bind'](this));ami['on'](_0x68ef('0x15'),this[_0x68ef('0x16')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x17'),this[_0x68ef('0x18')][_0x68ef('0xc')](this));}function getDiff(_0x508671){var _0x3b48dd=moment()[_0x68ef('0x19')](0x0);var _0x2657c5=moment(_0x508671)['milliseconds'](0x0);return _0x3b48dd[_0x68ef('0x1a')](_0x2657c5,_0x68ef('0x1b'));}Acw[_0x68ef('0x1c')]['startAcw']=function(_0x35493d){try{var _0x37c4cc=this;var _0x3d1e90=this[_0x68ef('0xa')][_0x35493d]['interface'];var _0x2ada1c=this['channels'][_0x35493d]['queue'];var _0x2633c1=this[_0x68ef('0x7')][_0x2ada1c];var _0x4ade0d=![];var _0x527870=_0x68ef('0x1d');if(_0x2633c1[_0x68ef('0x1e')]){if(_0x2633c1[_0x68ef('0x1f')]['name']){_0x4ade0d=!![];_0x527870=_0x2633c1[_0x68ef('0x1f')][_0x68ef('0x20')];}}ami[_0x68ef('0x21')]({'action':'QueuePause','interface':_0x3d1e90,'paused':!![],'reason':_0x527870})[_0x68ef('0x22')](function(_0x3be4c0){if(_0x37c4cc['agents'][_0x3d1e90]){return RpcUser[_0x68ef('0x23')](_0x37c4cc[_0x68ef('0x8')][_0x3d1e90]['id'])[_0x68ef('0x22')](function(_0x5ddec7){if(_0x5ddec7&&!_0x5ddec7['voicePause']){logger['info'](_0x68ef('0x24'),_0x35493d,_0x3d1e90,_0x2ada1c);var _0x2023f2=_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x25')]&&_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x26')]?_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x26')]:_0x35493d;return RpcUser[_0x68ef('0x27')](_0x37c4cc[_0x68ef('0x8')][_0x3d1e90],_0x527870,_0x2023f2)['then'](function(_0x178460){if(!_0x4ade0d){_0x37c4cc['timers'][_0x3d1e90]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x35493d,_0x37c4cc[_0x68ef('0x7')][_0x2ada1c][_0x68ef('0x28')],_0x3d1e90,_0x2ada1c);_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x29')]=setTimeout(_0x37c4cc['stopAcw']['bind'](_0x37c4cc,_0x3d1e90),_0x37c4cc[_0x68ef('0x7')][_0x2ada1c][_0x68ef('0x28')]*0x3e8);_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2a')]=moment()[_0x68ef('0x2b')](_0x68ef('0x2c'));_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2d')]=_0x35493d;_0x37c4cc['timers'][_0x3d1e90][_0x68ef('0x2e')]=_0x2ada1c;_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2f')]=function(){var _0x4c25aa=getDiff(_0x37c4cc[_0x68ef('0x9')][_0x3d1e90]['lastPauseAt']);clearTimeout(_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x29')]);_0x37c4cc['timers'][_0x3d1e90]['timer']=![];RpcVoiceAgentReport[_0x68ef('0x30')]({'acwtime':_0x4c25aa},_0x37c4cc[_0x68ef('0x9')][_0x3d1e90]['uniqueid'],_0x3d1e90)[_0x68ef('0x22')](function(_0x8c0a06){logger[_0x68ef('0x31')](_0x68ef('0x32'),_0x35493d,_0x4c25aa,_0x8c0a06);})['catch'](function(_0x2c8bd0){logger[_0x68ef('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x35493d,_0x2c8bd0);});delete _0x37c4cc[_0x68ef('0x9')][_0x3d1e90];};}});}else{logger['info'](_0x68ef('0x34'),_0x35493d,_0x3d1e90,_0x2ada1c);}});}})[_0x68ef('0x35')](function(_0x4973c2){logger[_0x68ef('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x35493d,_0x37c4cc[_0x68ef('0x7')][_0x2ada1c]['acwTimeout'],_0x3d1e90,_0x2ada1c);})[_0x68ef('0x36')](function(){delete _0x37c4cc[_0x68ef('0xa')][_0x35493d];});}catch(_0x798276){logger['error'](_0x68ef('0x37'),_0x798276['message']);}};Acw[_0x68ef('0x1c')]['stopAcw']=function(_0x474ffa){try{var _0x362ef1=this;if(_0x362ef1[_0x68ef('0x9')][_0x474ffa]){_0x362ef1[_0x68ef('0x9')][_0x474ffa][_0x68ef('0x29')]=![];var _0xefd1d=_0x362ef1['timers'][_0x474ffa][_0x68ef('0x2d')];var _0x15a6ab=_0x362ef1[_0x68ef('0x9')][_0x474ffa]['queue'];var _0x32eddd=_0x362ef1[_0x68ef('0x7')][_0x15a6ab][_0x68ef('0x28')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x474ffa);RpcUser[_0x68ef('0x38')](this[_0x68ef('0x8')][_0x474ffa]);RpcVoiceAgentReport[_0x68ef('0x30')]({'acwtime':_0x32eddd,'agentacw':!![]},_0xefd1d,_0x474ffa)[_0x68ef('0x22')](function(_0x401459){logger[_0x68ef('0x31')](_0x68ef('0x32'),_0xefd1d,_0x32eddd,_0x401459);})['catch'](function(_0xaf7df1){logger[_0x68ef('0x33')](_0x68ef('0x39'),_0xefd1d,_0xaf7df1);});}else{logger[_0x68ef('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x474ffa);if(_0x362ef1[_0x68ef('0x9')]){logger[_0x68ef('0x31')](_0x68ef('0x3a'),JSON[_0x68ef('0x3b')](_0x362ef1[_0x68ef('0x9')]));}}}catch(_0x3b00ea){logger['error'](_0x68ef('0x3c'),_0x3b00ea[_0x68ef('0x3d')]);}};Acw[_0x68ef('0x1c')][_0x68ef('0x3e')]=function(_0x449f3c){try{if(this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]]&&(this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]]['acw']||this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]][_0x68ef('0x1e')])){if(this[_0x68ef('0x8')][_0x449f3c[_0x68ef('0x3f')]]){this[_0x68ef('0xa')][_0x449f3c[_0x68ef('0x2d')]]={'queue':_0x449f3c['queue'],'interface':_0x449f3c[_0x68ef('0x3f')],'destlinkedid':_0x449f3c['destlinkedid']};}}}catch(_0x13c088){logger[_0x68ef('0x33')](_0x68ef('0x40'),_0x13c088[_0x68ef('0x3d')]);}};Acw['prototype'][_0x68ef('0x18')]=function(_0x5a8231){try{if(this[_0x68ef('0x7')][_0x5a8231['queue']]&&(this[_0x68ef('0x7')][_0x5a8231[_0x68ef('0x2e')]][_0x68ef('0x5')]||this['voiceQueues'][_0x5a8231['queue']][_0x68ef('0x1e')])){if(this[_0x68ef('0x8')][_0x5a8231['interface']]){this['channels'][_0x5a8231['uniqueid']]={'queue':_0x5a8231[_0x68ef('0x2e')],'interface':_0x5a8231[_0x68ef('0x3f')]};}}}catch(_0x173fb7){logger[_0x68ef('0x33')](_0x68ef('0x41'),_0x173fb7['message']);}};Acw['prototype'][_0x68ef('0xe')]=function(_0x21f064){try{if(this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x2d')]]&&_['isUndefined'](this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x2d')]][_0x68ef('0x25')])){logger[_0x68ef('0x31')]('[%s][HANGUP:UNIQUEID]',_0x21f064['uniqueid']);this[_0x68ef('0x42')](_0x21f064[_0x68ef('0x2d')]);}else if(this['channels'][_0x21f064[_0x68ef('0x43')]]&&_[_0x68ef('0x44')](this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x43')]][_0x68ef('0x25')])){logger['info'](_0x68ef('0x45'),_0x21f064[_0x68ef('0x43')]);this[_0x68ef('0x42')](_0x21f064['linkedid']);}}catch(_0x8ef51b){logger[_0x68ef('0x33')](_0x68ef('0x46'),_0x8ef51b['message']);}};Acw[_0x68ef('0x1c')]['syncHangup']=function(_0x574573){try{if(this[_0x68ef('0xa')][_0x574573['uniqueid']]&&this[_0x68ef('0xa')][_0x574573[_0x68ef('0x2d')]][_0x68ef('0x25')]){logger[_0x68ef('0x31')](_0x68ef('0x47'),_0x574573[_0x68ef('0x2d')]);this[_0x68ef('0x42')](_0x574573[_0x68ef('0x2d')]);}else if(this[_0x68ef('0xa')][_0x574573[_0x68ef('0x43')]]&&this['channels'][_0x574573['linkedid']][_0x68ef('0x25')]){logger[_0x68ef('0x31')](_0x68ef('0x48'),_0x574573[_0x68ef('0x43')]);this[_0x68ef('0x42')](_0x574573[_0x68ef('0x43')]);}}catch(_0x15400c){logger[_0x68ef('0x33')](_0x68ef('0x49'),_0x15400c['message']);}};Acw['prototype'][_0x68ef('0x14')]=function(_0x5781c8){try{if(!_[_0x68ef('0x4a')](this['channels'][_0x5781c8[_0x68ef('0x4b')]])){this[_0x68ef('0x42')](_0x5781c8['transfereeuniqueid']);if(this[_0x68ef('0xa')][_0x5781c8['secondtransfereruniqueid']]){this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4c')]][_0x68ef('0x25')]=!![];this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4d')]]=this[_0x68ef('0xa')][_0x5781c8['secondtransfereruniqueid']];delete this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4c')]];}}else if(!_[_0x68ef('0x4a')](this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4d')]])){this[_0x68ef('0x42')](_0x5781c8['transfertargetuniqueid']);if(this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4e')]]){this['channels'][_0x5781c8[_0x68ef('0x4e')]][_0x68ef('0x25')]=!![];this[_0x68ef('0xa')][_0x5781c8['transfereeuniqueid']]=this[_0x68ef('0xa')][_0x5781c8['origtransfereruniqueid']];delete this['channels'][_0x5781c8[_0x68ef('0x4e')]];}}}catch(_0x540da5){logger[_0x68ef('0x33')]('[ACW][syncAttendedTransfer]\x20%s',_0x540da5[_0x68ef('0x3d')]);}};Acw[_0x68ef('0x1c')][_0x68ef('0x16')]=function(_0x3fbd39){try{if(this[_0x68ef('0xa')][_0x3fbd39[_0x68ef('0x4f')]]){logger['info'](_0x68ef('0x50'),JSON['stringify'](_0x3fbd39[_0x68ef('0x4f')]));this['startAcw'](_0x3fbd39[_0x68ef('0x4f')]);}else if(this[_0x68ef('0xa')][_0x3fbd39[_0x68ef('0x51')]]){logger[_0x68ef('0x31')](_0x68ef('0x52'),JSON[_0x68ef('0x3b')](_0x3fbd39[_0x68ef('0x51')]));this['startAcw'](_0x3fbd39[_0x68ef('0x51')]);}}catch(_0x11bab3){logger[_0x68ef('0x33')](_0x68ef('0x53'),_0x11bab3[_0x68ef('0x3d')]);}};Acw['prototype'][_0x68ef('0x12')]=function(_0x561e8d){try{if(this[_0x68ef('0x7')][_0x561e8d['queue']]&&this['voiceQueues'][_0x561e8d[_0x68ef('0x2e')]][_0x68ef('0x54')]===_0x68ef('0x55')){if(this[_0x68ef('0x8')][_0x561e8d['interface']]){logger[_0x68ef('0x31')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x561e8d[_0x68ef('0x2d')],_0x561e8d[_0x68ef('0x3f')],_0x561e8d[_0x68ef('0x2e')]);return RpcUser['savePause'](this['agents'][_0x561e8d[_0x68ef('0x3f')]],_0x68ef('0x56'),_0x561e8d[_0x68ef('0x2d')]);}}}catch(_0x454c6f){logger['error'](_0x68ef('0x57'),_0x454c6f[_0x68ef('0x3d')]);}};module[_0x68ef('0x58')]=Acw; \ No newline at end of file +var _0x5fd1=['../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','stopAcw','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami'];(function(_0x1dd34a,_0x2c051d){var _0x322a3d=function(_0x57c703){while(--_0x57c703){_0x1dd34a['push'](_0x1dd34a['shift']());}};_0x322a3d(++_0x2c051d);}(_0x5fd1,0x155));var _0x15fd=function(_0x371d6e,_0x47c636){_0x371d6e=_0x371d6e-0x0;var _0x3294ba=_0x5fd1[_0x371d6e];return _0x3294ba;};'use strict';var util=require(_0x15fd('0x0'));var _=require('lodash');var moment=require(_0x15fd('0x1'));var ami=require(_0x15fd('0x2'));var logger=require(_0x15fd('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x15fd('0x4'));function Acw(_0x3138f3){this[_0x15fd('0x5')]=_0x3138f3['voiceQueues'];this[_0x15fd('0x6')]=_0x3138f3[_0x15fd('0x6')];this[_0x15fd('0x7')]=_0x3138f3[_0x15fd('0x7')];this[_0x15fd('0x8')]={};ami['on']('agentconnect',this[_0x15fd('0x9')][_0x15fd('0xa')](this));ami['on'](_0x15fd('0xb'),this['syncHangupRequest'][_0x15fd('0xa')](this));ami['on']('hangup',this[_0x15fd('0xc')][_0x15fd('0xa')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x15fd('0xd'),this[_0x15fd('0xe')][_0x15fd('0xa')](this));ami['on'](_0x15fd('0xf'),this[_0x15fd('0x10')][_0x15fd('0xa')](this));ami['on'](_0x15fd('0x11'),this[_0x15fd('0x12')][_0x15fd('0xa')](this));}function getDiff(_0x4cb391){var _0x5b7af0=moment()['milliseconds'](0x0);var _0x3fda60=moment(_0x4cb391)[_0x15fd('0x13')](0x0);return _0x5b7af0[_0x15fd('0x14')](_0x3fda60,_0x15fd('0x15'));}Acw[_0x15fd('0x16')][_0x15fd('0x17')]=function(_0x2c5375){try{var _0x44a63a=this;var _0x5aae13=this['channels'][_0x2c5375][_0x15fd('0x18')];var _0x5ca5a2=this[_0x15fd('0x8')][_0x2c5375]['queue'];var _0x917fe4=this[_0x15fd('0x5')][_0x5ca5a2];var _0x855bae=![];var _0x49ceac=_0x15fd('0x19');if(_0x917fe4[_0x15fd('0x1a')]){if(_0x917fe4[_0x15fd('0x1b')][_0x15fd('0x1c')]){_0x855bae=!![];_0x49ceac=_0x917fe4[_0x15fd('0x1b')][_0x15fd('0x1c')];}}ami[_0x15fd('0x1d')]({'action':_0x15fd('0x1e'),'interface':_0x5aae13,'paused':!![],'reason':_0x49ceac})[_0x15fd('0x1f')](function(_0x1eab55){if(_0x44a63a[_0x15fd('0x6')][_0x5aae13]){return RpcUser['getAgent'](_0x44a63a['agents'][_0x5aae13]['id'])[_0x15fd('0x1f')](function(_0x36b21e){if(_0x36b21e&&!_0x36b21e[_0x15fd('0x20')]){logger[_0x15fd('0x21')](_0x15fd('0x22'),_0x2c5375,_0x5aae13,_0x5ca5a2);var _0x11496a=_0x44a63a[_0x15fd('0x8')][_0x2c5375]['attended']&&_0x44a63a[_0x15fd('0x8')][_0x2c5375][_0x15fd('0x23')]?_0x44a63a[_0x15fd('0x8')][_0x2c5375]['destlinkedid']:_0x2c5375;return RpcUser[_0x15fd('0x24')](_0x44a63a['agents'][_0x5aae13],_0x49ceac,_0x11496a)[_0x15fd('0x1f')](function(_0x1fc24f){if(!_0x855bae){_0x44a63a[_0x15fd('0x7')][_0x5aae13]={};logger['info'](_0x15fd('0x25'),_0x2c5375,_0x44a63a[_0x15fd('0x5')][_0x5ca5a2][_0x15fd('0x26')],_0x5aae13,_0x5ca5a2);_0x44a63a['timers'][_0x5aae13][_0x15fd('0x27')]=setTimeout(_0x44a63a['stopAcw'][_0x15fd('0xa')](_0x44a63a,_0x5aae13),_0x44a63a[_0x15fd('0x5')][_0x5ca5a2][_0x15fd('0x26')]*0x3e8);_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x28')]=moment()[_0x15fd('0x29')](_0x15fd('0x2a'));_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x2b')]=_0x2c5375;_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x2c')]=_0x5ca5a2;_0x44a63a['timers'][_0x5aae13][_0x15fd('0x2d')]=function(){var _0x2fe61e=getDiff(_0x44a63a['timers'][_0x5aae13][_0x15fd('0x28')]);clearTimeout(_0x44a63a[_0x15fd('0x7')][_0x5aae13]['timer']);_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x27')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2fe61e},_0x44a63a[_0x15fd('0x7')][_0x5aae13][_0x15fd('0x2b')],_0x5aae13)[_0x15fd('0x1f')](function(_0x476828){logger[_0x15fd('0x21')](_0x15fd('0x2e'),_0x2c5375,_0x2fe61e,_0x476828);})['catch'](function(_0x2d647c){logger[_0x15fd('0x2f')](_0x15fd('0x30'),_0x2c5375,_0x2d647c);});delete _0x44a63a[_0x15fd('0x7')][_0x5aae13];};}});}else{logger['info'](_0x15fd('0x31'),_0x2c5375,_0x5aae13,_0x5ca5a2);}});}})[_0x15fd('0x32')](function(_0x11b3a1){logger[_0x15fd('0x2f')](_0x15fd('0x25'),_0x2c5375,_0x44a63a[_0x15fd('0x5')][_0x5ca5a2]['acwTimeout'],_0x5aae13,_0x5ca5a2);})[_0x15fd('0x33')](function(){delete _0x44a63a[_0x15fd('0x8')][_0x2c5375];});}catch(_0x57c118){logger[_0x15fd('0x2f')](_0x15fd('0x34'),_0x57c118[_0x15fd('0x35')]);}};Acw['prototype'][_0x15fd('0x36')]=function(_0x309851){try{var _0x1732bc=this;if(_0x1732bc[_0x15fd('0x7')][_0x309851]){_0x1732bc[_0x15fd('0x7')][_0x309851][_0x15fd('0x27')]=![];var _0x4d7259=_0x1732bc['timers'][_0x309851]['uniqueid'];var _0x340d17=_0x1732bc[_0x15fd('0x7')][_0x309851][_0x15fd('0x2c')];var _0x4e608d=_0x1732bc['voiceQueues'][_0x340d17][_0x15fd('0x26')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x309851);RpcUser['saveUnpause'](this[_0x15fd('0x6')][_0x309851]);RpcVoiceAgentReport[_0x15fd('0x37')]({'acwtime':_0x4e608d,'agentacw':!![]},_0x4d7259,_0x309851)[_0x15fd('0x1f')](function(_0x59d0d7){logger[_0x15fd('0x21')](_0x15fd('0x2e'),_0x4d7259,_0x4e608d,_0x59d0d7);})[_0x15fd('0x32')](function(_0x5beb6e){logger[_0x15fd('0x2f')](_0x15fd('0x30'),_0x4d7259,_0x5beb6e);});}else{logger[_0x15fd('0x2f')](_0x15fd('0x38'),_0x309851);if(_0x1732bc[_0x15fd('0x7')]){logger[_0x15fd('0x21')](_0x15fd('0x39'),JSON[_0x15fd('0x3a')](_0x1732bc[_0x15fd('0x7')]));}}}catch(_0x5dd3c4){logger[_0x15fd('0x2f')](_0x15fd('0x3b'),_0x5dd3c4[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0x9')]=function(_0x5f9429){try{if(this[_0x15fd('0x5')][_0x5f9429[_0x15fd('0x2c')]]&&(this[_0x15fd('0x5')][_0x5f9429[_0x15fd('0x2c')]][_0x15fd('0x3c')]||this[_0x15fd('0x5')][_0x5f9429[_0x15fd('0x2c')]][_0x15fd('0x1a')])){if(this[_0x15fd('0x6')][_0x5f9429['interface']]){this[_0x15fd('0x8')][_0x5f9429[_0x15fd('0x2b')]]={'queue':_0x5f9429[_0x15fd('0x2c')],'interface':_0x5f9429[_0x15fd('0x18')],'destlinkedid':_0x5f9429[_0x15fd('0x23')]};}}}catch(_0x44d08b){logger[_0x15fd('0x2f')](_0x15fd('0x3d'),_0x44d08b['message']);}};Acw['prototype'][_0x15fd('0x12')]=function(_0x57bbd5){try{if(this[_0x15fd('0x5')][_0x57bbd5[_0x15fd('0x2c')]]&&(this['voiceQueues'][_0x57bbd5[_0x15fd('0x2c')]][_0x15fd('0x3c')]||this[_0x15fd('0x5')][_0x57bbd5[_0x15fd('0x2c')]][_0x15fd('0x1a')])){if(this[_0x15fd('0x6')][_0x57bbd5['interface']]){this[_0x15fd('0x8')][_0x57bbd5[_0x15fd('0x2b')]]={'queue':_0x57bbd5[_0x15fd('0x2c')],'interface':_0x57bbd5[_0x15fd('0x18')]};}}}catch(_0xcce802){logger[_0x15fd('0x2f')](_0x15fd('0x3e'),_0xcce802[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0x3f')]=function(_0x16b4f5){try{if(this[_0x15fd('0x8')][_0x16b4f5['uniqueid']]&&_[_0x15fd('0x40')](this['channels'][_0x16b4f5[_0x15fd('0x2b')]][_0x15fd('0x41')])){logger[_0x15fd('0x21')]('[%s][HANGUP:UNIQUEID]',_0x16b4f5[_0x15fd('0x2b')]);this[_0x15fd('0x17')](_0x16b4f5[_0x15fd('0x2b')]);}else if(this[_0x15fd('0x8')][_0x16b4f5['linkedid']]&&_[_0x15fd('0x40')](this[_0x15fd('0x8')][_0x16b4f5[_0x15fd('0x42')]][_0x15fd('0x41')])){logger['info'](_0x15fd('0x43'),_0x16b4f5[_0x15fd('0x42')]);this['startAcw'](_0x16b4f5['linkedid']);}}catch(_0x5da44c){logger[_0x15fd('0x2f')](_0x15fd('0x44'),_0x5da44c[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0xc')]=function(_0x33a128){try{if(this['channels'][_0x33a128[_0x15fd('0x2b')]]&&this[_0x15fd('0x8')][_0x33a128[_0x15fd('0x2b')]]['attended']){logger[_0x15fd('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x33a128[_0x15fd('0x2b')]);this[_0x15fd('0x17')](_0x33a128[_0x15fd('0x2b')]);}else if(this[_0x15fd('0x8')][_0x33a128[_0x15fd('0x42')]]&&this[_0x15fd('0x8')][_0x33a128[_0x15fd('0x42')]][_0x15fd('0x41')]){logger[_0x15fd('0x21')](_0x15fd('0x45'),_0x33a128[_0x15fd('0x42')]);this[_0x15fd('0x17')](_0x33a128[_0x15fd('0x42')]);}}catch(_0x5343b8){logger[_0x15fd('0x2f')]('[ACW][syncHangup]\x20%s',_0x5343b8[_0x15fd('0x35')]);}};Acw['prototype'][_0x15fd('0xe')]=function(_0x1fac7f){try{if(!_[_0x15fd('0x46')](this['channels'][_0x1fac7f['transfereeuniqueid']])){this[_0x15fd('0x17')](_0x1fac7f[_0x15fd('0x47')]);if(this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x48')]]){this['channels'][_0x1fac7f[_0x15fd('0x48')]][_0x15fd('0x41')]=!![];this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x49')]]=this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x48')]];delete this['channels'][_0x1fac7f[_0x15fd('0x48')]];}}else if(!_[_0x15fd('0x46')](this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x49')]])){this[_0x15fd('0x17')](_0x1fac7f[_0x15fd('0x49')]);if(this['channels'][_0x1fac7f['origtransfereruniqueid']]){this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x4a')]]['attended']=!![];this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x47')]]=this['channels'][_0x1fac7f[_0x15fd('0x4a')]];delete this[_0x15fd('0x8')][_0x1fac7f[_0x15fd('0x4a')]];}}}catch(_0x53bfd7){logger[_0x15fd('0x2f')](_0x15fd('0x4b'),_0x53bfd7[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0x10')]=function(_0x1f4581){try{if(this[_0x15fd('0x8')][_0x1f4581[_0x15fd('0x4c')]]){logger[_0x15fd('0x21')](_0x15fd('0x4d'),JSON['stringify'](_0x1f4581[_0x15fd('0x4c')]));this[_0x15fd('0x17')](_0x1f4581['transfereruniqueid']);}else if(this['channels'][_0x1f4581[_0x15fd('0x4e')]]){logger[_0x15fd('0x21')](_0x15fd('0x4f'),JSON[_0x15fd('0x3a')](_0x1f4581[_0x15fd('0x4e')]));this[_0x15fd('0x17')](_0x1f4581['transfererlinkedid']);}}catch(_0x41d398){logger[_0x15fd('0x2f')](_0x15fd('0x50'),_0x41d398[_0x15fd('0x35')]);}};Acw[_0x15fd('0x16')][_0x15fd('0x51')]=function(_0xf27ab4){try{if(this[_0x15fd('0x5')][_0xf27ab4[_0x15fd('0x2c')]]&&this[_0x15fd('0x5')][_0xf27ab4[_0x15fd('0x2c')]]['autopause']==='all'){if(this[_0x15fd('0x6')][_0xf27ab4[_0x15fd('0x18')]]){logger[_0x15fd('0x21')](_0x15fd('0x52'),_0xf27ab4[_0x15fd('0x2b')],_0xf27ab4[_0x15fd('0x18')],_0xf27ab4[_0x15fd('0x2c')]);return RpcUser['savePause'](this[_0x15fd('0x6')][_0xf27ab4['interface']],_0x15fd('0x53'),_0xf27ab4['uniqueid']);}}}catch(_0x1c2828){logger['error'](_0x15fd('0x54'),_0x1c2828[_0x15fd('0x35')]);}};module[_0x15fd('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 2257183..0775e03 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d1a=['sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','exports','asterisk-manager','moment','util','lodash','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry'];(function(_0x251f7b,_0x4bbad4){var _0x5ac901=function(_0x3e6495){while(--_0x3e6495){_0x251f7b['push'](_0x251f7b['shift']());}};_0x5ac901(++_0x4bbad4);}(_0x5d1a,0x1e8));var _0xa5d1=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0x5d1a[_0xb301d4];return _0x3b5bde;};'use strict';var Manager=require(_0xa5d1('0x0'));var BPromise=require('bluebird');var moment=require(_0xa5d1('0x1'));var util=require(_0xa5d1('0x2'));var _=require(_0xa5d1('0x3'));var logger=require('../../config/logger')(_0xa5d1('0x4'));var config=require(_0xa5d1('0x5'));var ami=new Manager(config[_0xa5d1('0x6')][_0xa5d1('0x7')],config[_0xa5d1('0x6')]['ip'],config['asterisk']['username'],config[_0xa5d1('0x6')][_0xa5d1('0x8')],!![]);ami['keepConnected']();ami[_0xa5d1('0x9')]=BPromise[_0xa5d1('0xa')](ami[_0xa5d1('0xb')]);function error(_0x2d52cd){logger[_0xa5d1('0xc')](util[_0xa5d1('0xd')](_0xa5d1('0xe'),config[_0xa5d1('0x6')][_0xa5d1('0xf')],config['asterisk']['ip'],config['asterisk'][_0xa5d1('0x7')],util[_0xa5d1('0x10')](_0x2d52cd,![],null)));}function close(){logger[_0xa5d1('0xc')](util[_0xa5d1('0xd')](_0xa5d1('0x11'),config[_0xa5d1('0x6')][_0xa5d1('0xf')],config[_0xa5d1('0x6')]['ip'],config['asterisk'][_0xa5d1('0x7')]));}ami[_0xa5d1('0x12')]=function(){return function(){return ami[_0xa5d1('0x9')]({'action':_0xa5d1('0x13')});};};ami[_0xa5d1('0x14')]=function(){return function(){return ami[_0xa5d1('0x9')]({'action':_0xa5d1('0x15')});};};ami[_0xa5d1('0x16')]=function(){return function(){return ami['Action']({'action':_0xa5d1('0x17')});};};ami[_0xa5d1('0x18')]=function(){return function(){return ami[_0xa5d1('0x9')]({'action':_0xa5d1('0x19')});};};ami[_0xa5d1('0x1a')]=function(){return function(){return ami[_0xa5d1('0x9')]({'action':_0xa5d1('0x1b')});};};function connect(_0x2bcc77){logger[_0xa5d1('0x1c')](util[_0xa5d1('0xd')](_0xa5d1('0x1d'),config['asterisk']['username'],config[_0xa5d1('0x6')]['ip'],config[_0xa5d1('0x6')][_0xa5d1('0x7')]));ami['once'](_0xa5d1('0xc'),error);ami[_0xa5d1('0x1e')](_0xa5d1('0x1f'),close);}ami['on'](_0xa5d1('0x20'),connect);ami['on']('shutdown',function(_0x4285c3){logger[_0xa5d1('0x1c')](util[_0xa5d1('0xd')](_0xa5d1('0x21'),config[_0xa5d1('0x6')]['username'],config['asterisk']['ip'],config[_0xa5d1('0x6')][_0xa5d1('0x7')],util['inspect'](_0x4285c3,![],null)));});ami['on']('fullybooted',function(_0x198494){logger['info'](util[_0xa5d1('0xd')](_0xa5d1('0x22'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xa5d1('0x6')]['port']));return BPromise[_0xa5d1('0x23')]()[_0xa5d1('0x24')](ami[_0xa5d1('0x12')]())[_0xa5d1('0x24')](ami[_0xa5d1('0x14')]())[_0xa5d1('0x24')](ami['actionSipPeerStatus']())[_0xa5d1('0x24')](ami[_0xa5d1('0x18')]())[_0xa5d1('0x24')](ami[_0xa5d1('0x1a')]())[_0xa5d1('0x25')](function(_0x1ae905){console['log'](_0x1ae905);});});ami[_0xa5d1('0x1e')](_0xa5d1('0xc'),error);ami[_0xa5d1('0x1e')](_0xa5d1('0x1f'),close);module[_0xa5d1('0x26')]=ami; \ No newline at end of file +var _0xced2=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','once','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port','password','keepConnected','promisify','action','format','username','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList'];(function(_0x1885b8,_0x3094b6){var _0x287481=function(_0x2d89d5){while(--_0x2d89d5){_0x1885b8['push'](_0x1885b8['shift']());}};_0x287481(++_0x3094b6);}(_0xced2,0x19a));var _0x2ced=function(_0x2cd368,_0x4a8c24){_0x2cd368=_0x2cd368-0x0;var _0x363036=_0xced2[_0x2cd368];return _0x363036;};'use strict';var Manager=require(_0x2ced('0x0'));var BPromise=require(_0x2ced('0x1'));var moment=require(_0x2ced('0x2'));var util=require(_0x2ced('0x3'));var _=require(_0x2ced('0x4'));var logger=require(_0x2ced('0x5'))('ami');var config=require(_0x2ced('0x6'));var ami=new Manager(config[_0x2ced('0x7')][_0x2ced('0x8')],config['asterisk']['ip'],config[_0x2ced('0x7')]['username'],config[_0x2ced('0x7')][_0x2ced('0x9')],!![]);ami[_0x2ced('0xa')]();ami['Action']=BPromise[_0x2ced('0xb')](ami[_0x2ced('0xc')]);function error(_0x4d70f9){logger['error'](util[_0x2ced('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x2ced('0xe')],config[_0x2ced('0x7')]['ip'],config[_0x2ced('0x7')][_0x2ced('0x8')],util[_0x2ced('0xf')](_0x4d70f9,![],null)));}function close(){logger[_0x2ced('0x10')](util[_0x2ced('0xd')](_0x2ced('0x11'),config[_0x2ced('0x7')][_0x2ced('0xe')],config[_0x2ced('0x7')]['ip'],config[_0x2ced('0x7')][_0x2ced('0x8')]));}ami[_0x2ced('0x12')]=function(){return function(){return ami[_0x2ced('0x13')]({'action':_0x2ced('0x14')});};};ami[_0x2ced('0x15')]=function(){return function(){return ami[_0x2ced('0x13')]({'action':_0x2ced('0x16')});};};ami[_0x2ced('0x17')]=function(){return function(){return ami[_0x2ced('0x13')]({'action':_0x2ced('0x18')});};};ami[_0x2ced('0x19')]=function(){return function(){return ami[_0x2ced('0x13')]({'action':_0x2ced('0x1a')});};};ami[_0x2ced('0x1b')]=function(){return function(){return ami[_0x2ced('0x13')]({'action':'coreshowchannels'});};};function connect(_0x16f53d){logger[_0x2ced('0x1c')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x2ced('0x7')]['username'],config[_0x2ced('0x7')]['ip'],config['asterisk'][_0x2ced('0x8')]));ami[_0x2ced('0x1d')](_0x2ced('0x10'),error);ami[_0x2ced('0x1d')]('close',close);}ami['on'](_0x2ced('0x1e'),connect);ami['on']('shutdown',function(_0x59c79c){logger[_0x2ced('0x1c')](util['format'](_0x2ced('0x1f'),config['asterisk'][_0x2ced('0xe')],config[_0x2ced('0x7')]['ip'],config[_0x2ced('0x7')][_0x2ced('0x8')],util[_0x2ced('0xf')](_0x59c79c,![],null)));});ami['on']('fullybooted',function(_0x4d114a){logger[_0x2ced('0x1c')](util[_0x2ced('0xd')](_0x2ced('0x20'),config[_0x2ced('0x7')][_0x2ced('0xe')],config[_0x2ced('0x7')]['ip'],config['asterisk']['port']));return BPromise[_0x2ced('0x21')]()[_0x2ced('0x22')](ami[_0x2ced('0x12')]())['then'](ami[_0x2ced('0x15')]())[_0x2ced('0x22')](ami[_0x2ced('0x17')]())[_0x2ced('0x22')](ami[_0x2ced('0x19')]())[_0x2ced('0x22')](ami[_0x2ced('0x1b')]())[_0x2ced('0x23')](function(_0x5cccf9){console['log'](_0x5cccf9);});});ami['once']('error',error);ami[_0x2ced('0x1d')]('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 2a52e84..2dcb9d9 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09bc=['bluebird','../../config/logger','ami','client','http','request','then','debug','rpc','memberReport','error','message','result','catch','exports'];(function(_0x156e99,_0x2bf27e){var _0x18870e=function(_0x3e6c3b){while(--_0x3e6c3b){_0x156e99['push'](_0x156e99['shift']());}};_0x18870e(++_0x2bf27e);}(_0x09bc,0x177));var _0xc09b=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x09bc[_0x126558];return _0x1f6d14;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc09b('0x0'));var logger=require(_0xc09b('0x1'))(_0xc09b('0x2'));var client=jayson[_0xc09b('0x3')][_0xc09b('0x4')]({'port':0x2329});client['Request']=function(_0x57d7ce,_0x7d4c28){return new BPromise(function(_0x16a96f,_0x44e52f){return client[_0xc09b('0x5')](_0x57d7ce,_0x7d4c28)[_0xc09b('0x6')](function(_0x28c6aa){logger[_0xc09b('0x7')]('rpc','memberReport',_0x57d7ce,_0x7d4c28,_0x28c6aa);if(_0x28c6aa['error']){logger['error'](_0xc09b('0x8'),_0xc09b('0x9'),_0x57d7ce,_0x28c6aa[_0xc09b('0xa')][_0xc09b('0xb')],_0x7d4c28);return _0x44e52f(_0x28c6aa['error'][_0xc09b('0xb')]);}else{return _0x16a96f(_0x28c6aa[_0xc09b('0xc')]);}})[_0xc09b('0xd')](function(_0x566629){logger[_0xc09b('0xa')]('rpc','memberReport',_0x57d7ce,_0x566629,_0x7d4c28);return _0x44e52f(_0x566629);});});};module[_0xc09b('0xe')]=client; \ No newline at end of file +var _0x92a9=['memberReport','error','message','exports','../../config/logger','ami','http','Request','request','then','debug','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x92a9,0x148));var _0x992a=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x92a9[_0x2aea9e];return _0x430b92;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x992a('0x0'))(_0x992a('0x1'));var client=jayson['client'][_0x992a('0x2')]({'port':0x2329});client[_0x992a('0x3')]=function(_0x4d9dbd,_0x21405f){return new BPromise(function(_0x348c00,_0x122778){return client[_0x992a('0x4')](_0x4d9dbd,_0x21405f)[_0x992a('0x5')](function(_0x2b5e20){logger[_0x992a('0x6')](_0x992a('0x7'),_0x992a('0x8'),_0x4d9dbd,_0x21405f,_0x2b5e20);if(_0x2b5e20[_0x992a('0x9')]){logger[_0x992a('0x9')](_0x992a('0x7'),'memberReport',_0x4d9dbd,_0x2b5e20[_0x992a('0x9')][_0x992a('0xa')],_0x21405f);return _0x122778(_0x2b5e20[_0x992a('0x9')]['message']);}else{return _0x348c00(_0x2b5e20['result']);}})['catch'](function(_0x13cc0e){logger[_0x992a('0x9')](_0x992a('0x7'),'memberReport',_0x4d9dbd,_0x13cc0e,_0x21405f);return _0x122778(_0x13cc0e);});});};module[_0x992a('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index e0ab0eb..ead8f77 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c50=['dialCutDigit','substring','getQueue','exports','util','moment','string','voiceQueue','uniqueid','phone','Contact','lastName','number','queue','name','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','getCaller','\x22%s\x22\x20<%s>'];(function(_0xa90af4,_0xc7865){var _0x35c112=function(_0x3b0cbe){while(--_0x3b0cbe){_0xa90af4['push'](_0xa90af4['shift']());}};_0x35c112(++_0xc7865);}(_0x6c50,0xe2));var _0x06c5=function(_0x3daf05,_0x1aba94){_0x3daf05=_0x3daf05-0x0;var _0x2eb44c=_0x6c50[_0x3daf05];return _0x2eb44c;};'use strict';var util=require(_0x06c5('0x0'));var _=require('lodash');var moment=require(_0x06c5('0x1'));function checkNameSurname(_0x20429c,_0x2e1f35,_0x2e7d01){var _0xed4983='';if(!_['isNil'](_0x2e1f35)&&_0x06c5('0x2')===typeof _0x2e1f35){_0xed4983+=_0x2e1f35;}if(!_['isNil'](_0x2e7d01)&&'string'===typeof _0x2e7d01){_0xed4983+='\x20'+_0x2e7d01;}if(_0xed4983!==''){return _0xed4983;}return _0x20429c;}function Action(_0x394f31,_0x47435d,_0x2372fd){this[_0x06c5('0x3')]=_0x394f31;this[_0x06c5('0x4')]=_0x2372fd||undefined;this['name']=checkNameSurname(_0x47435d['Contact'][_0x06c5('0x5')],_0x47435d['Contact']['firstName'],_0x47435d[_0x06c5('0x6')][_0x06c5('0x7')]);this[_0x06c5('0x8')]=_0x47435d[_0x06c5('0x6')][_0x06c5('0x5')];this[_0x06c5('0x9')]=_0x394f31[_0x06c5('0xa')];this['active']=_0x47435d['active']||![];this[_0x06c5('0xb')]=_0x394f31[_0x06c5('0xb')];this[_0x06c5('0xc')]=_0x394f31[_0x06c5('0xc')]||0x3;this[_0x06c5('0xd')]=_0x47435d[_0x06c5('0xd')];this['countbusyretry']=_0x47435d['countbusyretry'];this[_0x06c5('0xe')]=_0x47435d[_0x06c5('0xe')];this[_0x06c5('0xf')]=_0x47435d['countnoanswerretry'];this['ContactId']=_0x47435d[_0x06c5('0x10')];this[_0x06c5('0x11')]=_0x47435d['ListId'];this[_0x06c5('0x12')]=_0x47435d[_0x06c5('0x12')];this[_0x06c5('0x13')]=_0x47435d[_0x06c5('0x13')];this[_0x06c5('0x14')]=_0x47435d[_0x06c5('0x14')];this[_0x06c5('0x15')]=_0x47435d['id'];this[_0x06c5('0x16')]=_0x47435d[_0x06c5('0x6')][_0x06c5('0x17')]||'';this[_0x06c5('0x18')]=moment()[_0x06c5('0x19')](_0x06c5('0x1a'));this[_0x06c5('0x1b')]=_0x47435d['callback'];this[_0x06c5('0x1c')]=_0x47435d[_0x06c5('0x1c')];this['callbackat']=_0x47435d[_0x06c5('0x1d')];this['recallme']=_0x47435d[_0x06c5('0x1e')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype'][_0x06c5('0x1f')]=function(){return util[_0x06c5('0x19')](_0x06c5('0x20'),this[_0x06c5('0xa')],this[_0x06c5('0x3')][_0x06c5('0x21')]>0x0?this[_0x06c5('0x8')][_0x06c5('0x22')](this[_0x06c5('0x3')][_0x06c5('0x21')]):this[_0x06c5('0x8')]);};Action['prototype'][_0x06c5('0x23')]=function(){return this['queue'];};module[_0x06c5('0x24')]=Action; \ No newline at end of file +var _0xda11=['format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName'];(function(_0x377230,_0x36a967){var _0x5e5b18=function(_0x291672){while(--_0x291672){_0x377230['push'](_0x377230['shift']());}};_0x5e5b18(++_0x36a967);}(_0xda11,0x136));var _0x1da1=function(_0x629b48,_0xa2373b){_0x629b48=_0x629b48-0x0;var _0x4a4f13=_0xda11[_0x629b48];return _0x4a4f13;};'use strict';var util=require(_0x1da1('0x0'));var _=require(_0x1da1('0x1'));var moment=require(_0x1da1('0x2'));function checkNameSurname(_0x2edd31,_0x1a86c2,_0x5b3295){var _0x2cb702='';if(!_[_0x1da1('0x3')](_0x1a86c2)&&_0x1da1('0x4')===typeof _0x1a86c2){_0x2cb702+=_0x1a86c2;}if(!_[_0x1da1('0x3')](_0x5b3295)&&_0x1da1('0x4')===typeof _0x5b3295){_0x2cb702+='\x20'+_0x5b3295;}if(_0x2cb702!==''){return _0x2cb702;}return _0x2edd31;}function Action(_0x40c9b3,_0x41fd9f,_0x132bbf){this['voiceQueue']=_0x40c9b3;this[_0x1da1('0x5')]=_0x132bbf||undefined;this[_0x1da1('0x6')]=checkNameSurname(_0x41fd9f[_0x1da1('0x7')][_0x1da1('0x8')],_0x41fd9f[_0x1da1('0x7')][_0x1da1('0x9')],_0x41fd9f[_0x1da1('0x7')][_0x1da1('0xa')]);this['number']=_0x41fd9f[_0x1da1('0x7')][_0x1da1('0x8')];this[_0x1da1('0xb')]=_0x40c9b3['name'];this[_0x1da1('0xc')]=_0x41fd9f[_0x1da1('0xc')]||![];this[_0x1da1('0xd')]=_0x40c9b3[_0x1da1('0xd')];this[_0x1da1('0xe')]=_0x40c9b3[_0x1da1('0xe')]||0x3;this[_0x1da1('0xf')]=_0x41fd9f[_0x1da1('0xf')];this[_0x1da1('0x10')]=_0x41fd9f['countbusyretry'];this[_0x1da1('0x11')]=_0x41fd9f[_0x1da1('0x11')];this['countnoanswerretry']=_0x41fd9f[_0x1da1('0x12')];this[_0x1da1('0x13')]=_0x41fd9f[_0x1da1('0x13')];this[_0x1da1('0x14')]=_0x41fd9f[_0x1da1('0x14')];this[_0x1da1('0x15')]=_0x41fd9f['UserId'];this[_0x1da1('0x16')]=_0x41fd9f[_0x1da1('0x16')];this['CampaignId']=_0x41fd9f[_0x1da1('0x17')];this[_0x1da1('0x18')]=_0x41fd9f['id'];this[_0x1da1('0x19')]=_0x41fd9f[_0x1da1('0x7')][_0x1da1('0x9')]||'';this['starttime']=moment()[_0x1da1('0x1a')](_0x1da1('0x1b'));this[_0x1da1('0x1c')]=_0x41fd9f[_0x1da1('0x1c')];this[_0x1da1('0x1d')]=_0x41fd9f[_0x1da1('0x1d')];this[_0x1da1('0x1e')]=_0x41fd9f['callbackat'];this[_0x1da1('0x1f')]=_0x41fd9f[_0x1da1('0x1f')];this[_0x1da1('0x20')]='';this[_0x1da1('0x21')]='';}Action[_0x1da1('0x22')][_0x1da1('0x23')]=function(){return util[_0x1da1('0x1a')](_0x1da1('0x24'),this[_0x1da1('0x6')],this[_0x1da1('0x25')][_0x1da1('0x26')]>0x0?this['number'][_0x1da1('0x27')](this[_0x1da1('0x25')][_0x1da1('0x26')]):this['number']);};Action[_0x1da1('0x22')][_0x1da1('0x28')]=function(){return this['queue'];};module[_0x1da1('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 6dff925..6a3e538 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6b9=['responsetime','endtime','format','ringtime','holdtime','answertime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','uniqueid','calleridname','name','calleridnum','number','starttime'];(function(_0x4dd8b5,_0x3ff948){var _0x221aae=function(_0x5f4902){while(--_0x5f4902){_0x4dd8b5['push'](_0x4dd8b5['shift']());}};_0x221aae(++_0x3ff948);}(_0xc6b9,0xec));var _0x9c6b=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc6b9[_0x2e4aa2];return _0x5e6092;};'use strict';var util=require(_0x9c6b('0x0'));var _=require(_0x9c6b('0x1'));var moment=require(_0x9c6b('0x2'));function getSeconds(_0x59c557,_0xda5545){var _0x4c42f8=moment(_0x59c557)[_0x9c6b('0x3')](0x0);var _0x1133a8=moment(_0xda5545)[_0x9c6b('0x3')](0x0);return _0x4c42f8['diff'](_0x1133a8,_0x9c6b('0x4'));}function AgentComplete(_0x3765b5,_0x5725ca){this['state']=0x4;this[_0x9c6b('0x5')]=_0x9c6b('0x6');this[_0x9c6b('0x7')]=_0x3765b5[_0x9c6b('0x7')];this[_0x9c6b('0x8')]=_0x3765b5[_0x9c6b('0x8')];this[_0x9c6b('0x9')]=_0x3765b5[_0x9c6b('0x8')]===_0x9c6b('0xa')?_0x9c6b('0xb'):_0x3765b5['type'];this['countbusyretry']=_0x3765b5[_0x9c6b('0xc')];this['countcongestionretry']=_0x3765b5['countcongestionretry'];this[_0x9c6b('0xd')]=_0x3765b5['countnoanswerretry'];this[_0x9c6b('0xe')]=_0x3765b5[_0x9c6b('0xc')]+_0x3765b5[_0x9c6b('0xf')]+_0x3765b5['countnoanswerretry'];this['uniqueid']=_0x5725ca[_0x9c6b('0x10')];this[_0x9c6b('0x11')]=_0x3765b5[_0x9c6b('0x12')];this[_0x9c6b('0x13')]=_0x3765b5[_0x9c6b('0x14')];this[_0x9c6b('0x15')]=_0x3765b5[_0x9c6b('0x15')];this['responsetime']=_0x3765b5[_0x9c6b('0x16')];this['answertime']=_0x3765b5['answertime'];this[_0x9c6b('0x17')]=moment()[_0x9c6b('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9c6b('0x19')]=getSeconds(_0x3765b5[_0x9c6b('0x16')],_0x3765b5[_0x9c6b('0x15')]);this[_0x9c6b('0x1a')]=getSeconds(_0x3765b5[_0x9c6b('0x1b')],_0x3765b5[_0x9c6b('0x16')]);this[_0x9c6b('0x1c')]=getSeconds(this['endtime'],_0x3765b5['answertime']);this[_0x9c6b('0xb')]=_0x5725ca['queue'];this[_0x9c6b('0x1d')]=_0x5725ca[_0x9c6b('0x1d')];this[_0x9c6b('0x1e')]=_0x5725ca[_0x9c6b('0x1e')];this[_0x9c6b('0x1f')]=_0x3765b5[_0x9c6b('0x1f')];this[_0x9c6b('0x20')]=_0x3765b5[_0x9c6b('0x20')];this[_0x9c6b('0x21')]=_0x3765b5[_0x9c6b('0x21')];this[_0x9c6b('0x22')]=_0x3765b5[_0x9c6b('0x22')];this[_0x9c6b('0x23')]=_0x3765b5[_0x9c6b('0x23')];this[_0x9c6b('0x24')]=_0x3765b5['ListId'];this[_0x9c6b('0x25')]=_0x3765b5['UserId'];this[_0x9c6b('0x26')]=_0x3765b5['VoiceQueueId'];this['CampaignId']=_0x3765b5[_0x9c6b('0x27')];this[_0x9c6b('0x28')]=_0x3765b5['originatecalleridnum']||'';this['originatecalleridname']=_0x3765b5[_0x9c6b('0x29')]||'';}module[_0x9c6b('0x2a')]=AgentComplete; \ No newline at end of file +var _0x2196=['seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff'];(function(_0x3a4b7f,_0x5b9726){var _0x542e8a=function(_0x558298){while(--_0x558298){_0x3a4b7f['push'](_0x3a4b7f['shift']());}};_0x542e8a(++_0x5b9726);}(_0x2196,0x123));var _0x6219=function(_0x3337d6,_0x9174c9){_0x3337d6=_0x3337d6-0x0;var _0x27b6ca=_0x2196[_0x3337d6];return _0x27b6ca;};'use strict';var util=require(_0x6219('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x5b0841,_0x4e0ce7){var _0x23a836=moment(_0x5b0841)[_0x6219('0x1')](0x0);var _0x124df8=moment(_0x4e0ce7)[_0x6219('0x1')](0x0);return _0x23a836[_0x6219('0x2')](_0x124df8,_0x6219('0x3'));}function AgentComplete(_0x3f2df7,_0x4abe8c){this[_0x6219('0x4')]=0x4;this['statedesc']=_0x6219('0x5');this[_0x6219('0x6')]=_0x3f2df7[_0x6219('0x6')];this[_0x6219('0x7')]=_0x3f2df7[_0x6219('0x7')];this[_0x6219('0x8')]=_0x3f2df7[_0x6219('0x7')]===_0x6219('0x9')?_0x6219('0xa'):_0x3f2df7['type'];this['countbusyretry']=_0x3f2df7[_0x6219('0xb')];this[_0x6219('0xc')]=_0x3f2df7['countcongestionretry'];this[_0x6219('0xd')]=_0x3f2df7[_0x6219('0xd')];this[_0x6219('0xe')]=_0x3f2df7[_0x6219('0xb')]+_0x3f2df7[_0x6219('0xc')]+_0x3f2df7[_0x6219('0xd')];this[_0x6219('0xf')]=_0x4abe8c['uniqueid'];this[_0x6219('0x10')]=_0x3f2df7[_0x6219('0x11')];this[_0x6219('0x12')]=_0x3f2df7[_0x6219('0x13')];this[_0x6219('0x14')]=_0x3f2df7['starttime'];this[_0x6219('0x15')]=_0x3f2df7[_0x6219('0x15')];this[_0x6219('0x16')]=_0x3f2df7[_0x6219('0x16')];this[_0x6219('0x17')]=moment()[_0x6219('0x18')](_0x6219('0x19'));this[_0x6219('0x1a')]=getSeconds(_0x3f2df7[_0x6219('0x15')],_0x3f2df7[_0x6219('0x14')]);this['holdtime']=getSeconds(_0x3f2df7['answertime'],_0x3f2df7['responsetime']);this[_0x6219('0x1b')]=getSeconds(this['endtime'],_0x3f2df7[_0x6219('0x16')]);this[_0x6219('0xa')]=_0x4abe8c['queue'];this['membername']=_0x4abe8c[_0x6219('0x1c')];this[_0x6219('0x1d')]=_0x4abe8c[_0x6219('0x1d')];this[_0x6219('0x1e')]=_0x3f2df7[_0x6219('0x1e')];this[_0x6219('0x1f')]=_0x3f2df7[_0x6219('0x1f')];this[_0x6219('0x20')]=_0x3f2df7[_0x6219('0x20')];this[_0x6219('0x21')]=_0x3f2df7[_0x6219('0x21')];this['ContactId']=_0x3f2df7[_0x6219('0x22')];this[_0x6219('0x23')]=_0x3f2df7['ListId'];this[_0x6219('0x24')]=_0x3f2df7[_0x6219('0x24')];this[_0x6219('0x25')]=_0x3f2df7['VoiceQueueId'];this['CampaignId']=_0x3f2df7[_0x6219('0x26')];this[_0x6219('0x27')]=_0x3f2df7[_0x6219('0x27')]||'';this[_0x6219('0x28')]=_0x3f2df7[_0x6219('0x28')]||'';}module[_0x6219('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 4dfbf11..e861e6b 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa613=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countcongestionretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback'];(function(_0x14eaf8,_0x359399){var _0x2fbc70=function(_0x3abd2b){while(--_0x3abd2b){_0x14eaf8['push'](_0x14eaf8['shift']());}};_0x2fbc70(++_0x359399);}(_0xa613,0x8a));var _0x3a61=function(_0x3fb560,_0x1e301f){_0x3fb560=_0x3fb560-0x0;var _0x4999b3=_0xa613[_0x3fb560];return _0x4999b3;};'use strict';var util=require(_0x3a61('0x0'));var _=require('lodash');var moment=require(_0x3a61('0x1'));function getSeconds(_0x30d505,_0x30656d){var _0xd12059=moment(_0x30d505)[_0x3a61('0x2')](0x0);var _0x322b07=moment(_0x30656d)[_0x3a61('0x2')](0x0);return _0xd12059[_0x3a61('0x3')](_0x322b07,_0x3a61('0x4'));}function Final(_0x4208bf){this['uniqueid']=_0x4208bf[_0x3a61('0x5')];this[_0x3a61('0x6')]=_0x4208bf['scheduledat'];this[_0x3a61('0x7')]=_0x4208bf[_0x3a61('0x7')];this[_0x3a61('0x8')]=_0x4208bf[_0x3a61('0x7')]===_0x3a61('0x9')?'queue':_0x4208bf[_0x3a61('0x7')];this[_0x3a61('0xa')]=_0x4208bf['countbusyretry'];this['countcongestionretry']=_0x4208bf['countcongestionretry'];this[_0x3a61('0xb')]=_0x4208bf[_0x3a61('0xb')];this['countglobal']=_0x4208bf[_0x3a61('0xa')]+_0x4208bf[_0x3a61('0xc')]+_0x4208bf[_0x3a61('0xb')];this[_0x3a61('0xd')]=_0x4208bf[_0x3a61('0xd')];this[_0x3a61('0xe')]=_0x4208bf['calleridname'];this['calleridnum']=_0x4208bf[_0x3a61('0xf')];this[_0x3a61('0x10')]=_0x4208bf[_0x3a61('0x10')];this[_0x3a61('0x11')]=_0x4208bf[_0x3a61('0x11')];this['endtime']=_0x4208bf['responsetime'];this[_0x3a61('0x12')]=_0x4208bf['ringtime']||0x0;this[_0x3a61('0x13')]=_0x4208bf['holdtime']||0x0;this[_0x3a61('0x14')]=_0x4208bf[_0x3a61('0x14')]||0x0;this['callback']=_0x4208bf[_0x3a61('0x15')];this['callbackuniqueid']=_0x4208bf[_0x3a61('0x16')];this['callbackat']=_0x4208bf[_0x3a61('0x17')];this['recallme']=_0x4208bf[_0x3a61('0x18')];this[_0x3a61('0x19')]=_0x4208bf[_0x3a61('0x19')];this[_0x3a61('0x1a')]=_0x4208bf[_0x3a61('0x1a')];this[_0x3a61('0x1b')]=_0x4208bf[_0x3a61('0x1b')];this[_0x3a61('0x1c')]=_0x4208bf[_0x3a61('0x1c')];this[_0x3a61('0x1d')]=_0x4208bf[_0x3a61('0x1d')];this[_0x3a61('0x1e')]=_0x4208bf[_0x3a61('0x1e')]||'';this[_0x3a61('0x1f')]=_0x4208bf[_0x3a61('0x1f')]||'';}module['exports']=Final; \ No newline at end of file +var _0x6db4=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0xb10e4a,_0x4e6100){var _0x13d07c=function(_0x5cbb27){while(--_0x5cbb27){_0xb10e4a['push'](_0xb10e4a['shift']());}};_0x13d07c(++_0x4e6100);}(_0x6db4,0x111));var _0x46db=function(_0x402e66,_0x1067e1){_0x402e66=_0x402e66-0x0;var _0x5985f9=_0x6db4[_0x402e66];return _0x5985f9;};'use strict';var util=require('util');var _=require(_0x46db('0x0'));var moment=require(_0x46db('0x1'));function getSeconds(_0x327023,_0x34f8d9){var _0x260df=moment(_0x327023)[_0x46db('0x2')](0x0);var _0x5a9b9c=moment(_0x34f8d9)[_0x46db('0x2')](0x0);return _0x260df[_0x46db('0x3')](_0x5a9b9c,_0x46db('0x4'));}function Final(_0x41b529){this[_0x46db('0x5')]=_0x41b529[_0x46db('0x5')];this[_0x46db('0x6')]=_0x41b529['scheduledat'];this[_0x46db('0x7')]=_0x41b529[_0x46db('0x7')];this[_0x46db('0x8')]=_0x41b529[_0x46db('0x7')]===_0x46db('0x9')?_0x46db('0xa'):_0x41b529[_0x46db('0x7')];this[_0x46db('0xb')]=_0x41b529[_0x46db('0xb')];this[_0x46db('0xc')]=_0x41b529[_0x46db('0xc')];this[_0x46db('0xd')]=_0x41b529['countnoanswerretry'];this[_0x46db('0xe')]=_0x41b529[_0x46db('0xb')]+_0x41b529[_0x46db('0xc')]+_0x41b529[_0x46db('0xd')];this[_0x46db('0xa')]=_0x41b529[_0x46db('0xa')];this[_0x46db('0xf')]=_0x41b529[_0x46db('0xf')];this[_0x46db('0x10')]=_0x41b529['calleridnum'];this['starttime']=_0x41b529['starttime'];this[_0x46db('0x11')]=_0x41b529[_0x46db('0x11')];this['endtime']=_0x41b529[_0x46db('0x11')];this['ringtime']=_0x41b529[_0x46db('0x12')]||0x0;this['holdtime']=_0x41b529[_0x46db('0x13')]||0x0;this[_0x46db('0x14')]=_0x41b529['talktime']||0x0;this[_0x46db('0x15')]=_0x41b529[_0x46db('0x15')];this[_0x46db('0x16')]=_0x41b529[_0x46db('0x16')];this[_0x46db('0x17')]=_0x41b529[_0x46db('0x17')];this[_0x46db('0x18')]=_0x41b529[_0x46db('0x18')];this['ContactId']=_0x41b529[_0x46db('0x19')];this[_0x46db('0x1a')]=_0x41b529[_0x46db('0x1a')];this['UserId']=_0x41b529['UserId'];this['VoiceQueueId']=_0x41b529['VoiceQueueId'];this[_0x46db('0x1b')]=_0x41b529[_0x46db('0x1b')];this[_0x46db('0x1c')]=_0x41b529['originatecalleridnum']||'';this['originatecalleridname']=_0x41b529[_0x46db('0x1d')]||'';}module[_0x46db('0x1e')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index ba26ce8..69d437c 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x140357,_0x6670bd){var _0x4fdf00=function(_0x527977){while(--_0x527977){_0x140357['push'](_0x140357['shift']());}};_0x4fdf00(++_0x6670bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0xd55449,_0x182f85){var _0x3c9f15=function(_0x1e0ec4){while(--_0x1e0ec4){_0xd55449['push'](_0xd55449['shift']());}};_0x3c9f15(++_0x182f85);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index fbc0dbb..a9030df 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3022=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x54cfe9,_0x361e37){var _0x29f949=function(_0x1880d5){while(--_0x1880d5){_0x54cfe9['push'](_0x54cfe9['shift']());}};_0x29f949(++_0x361e37);}(_0x3022,0x6e));var _0x2302=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x3022[_0x342baa];return _0x1208f3;};'use strict';var util=require(_0x2302('0x0'));var _=require(_0x2302('0x1'));var moment=require(_0x2302('0x2'));function getSeconds(_0x2bce1d,_0x195792){var _0x32ded4=moment(_0x2bce1d)[_0x2302('0x3')](0x0);var _0x35d3f0=moment(_0x195792)[_0x2302('0x3')](0x0);return _0x32ded4[_0x2302('0x4')](_0x35d3f0,'seconds');}function History(_0x23ee2f){this['uniqueid']=_0x23ee2f['uniqueid'];this[_0x2302('0x5')]=_0x23ee2f['scheduledat']||undefined;this[_0x2302('0x6')]=_0x23ee2f[_0x2302('0x6')];this[_0x2302('0x7')]=_0x23ee2f[_0x2302('0x6')]===_0x2302('0x8')?_0x2302('0x9'):_0x23ee2f['type'];this['countbusyretry']=_0x23ee2f[_0x2302('0xa')];this[_0x2302('0xb')]=_0x23ee2f[_0x2302('0xb')];this[_0x2302('0xc')]=_0x23ee2f[_0x2302('0xc')];this[_0x2302('0xd')]=_0x23ee2f[_0x2302('0xa')]+_0x23ee2f[_0x2302('0xb')]+_0x23ee2f['countnoanswerretry'];this['queue']=_0x23ee2f[_0x2302('0x9')];this[_0x2302('0xe')]=_0x23ee2f[_0x2302('0xf')];this[_0x2302('0x10')]=_0x23ee2f[_0x2302('0x11')];this[_0x2302('0x12')]=_0x23ee2f['starttime'];this[_0x2302('0x13')]=_0x23ee2f[_0x2302('0x13')];this[_0x2302('0x14')]=_0x23ee2f[_0x2302('0x13')];this[_0x2302('0x15')]=getSeconds(_0x23ee2f[_0x2302('0x13')],_0x23ee2f[_0x2302('0x12')]);this['holdtime']=0x0;this[_0x2302('0x16')]=0x0;this[_0x2302('0x17')]=_0x23ee2f[_0x2302('0x17')];this[_0x2302('0x18')]=_0x23ee2f[_0x2302('0x18')];this[_0x2302('0x19')]=_0x23ee2f[_0x2302('0x19')];this[_0x2302('0x1a')]=_0x23ee2f[_0x2302('0x1a')];this[_0x2302('0x1b')]=_0x23ee2f[_0x2302('0x1b')];this[_0x2302('0x1c')]=_0x23ee2f[_0x2302('0x1c')];this[_0x2302('0x1d')]=_0x23ee2f[_0x2302('0x1d')];this[_0x2302('0x1e')]=_0x23ee2f[_0x2302('0x1e')];this[_0x2302('0x1f')]=_0x23ee2f['CampaignId'];this['originatecalleridnum']=_0x23ee2f[_0x2302('0x20')]||'';this[_0x2302('0x21')]=_0x23ee2f[_0x2302('0x21')]||'';}module['exports']=History; \ No newline at end of file +var _0x7b08=['countcongestionretry','countnoanswerretry','countglobal','countbusyretry','calleridname','name','calleridnum','number','starttime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x338b28,_0x483f2d){var _0x56f5d6=function(_0x1dbdfd){while(--_0x1dbdfd){_0x338b28['push'](_0x338b28['shift']());}};_0x56f5d6(++_0x483f2d);}(_0x7b08,0xf6));var _0x87b0=function(_0x128b59,_0x5d0f4e){_0x128b59=_0x128b59-0x0;var _0x369d1d=_0x7b08[_0x128b59];return _0x369d1d;};'use strict';var util=require(_0x87b0('0x0'));var _=require(_0x87b0('0x1'));var moment=require('moment');function getSeconds(_0x2ea876,_0x213ba7){var _0x448447=moment(_0x2ea876)[_0x87b0('0x2')](0x0);var _0x3a68f5=moment(_0x213ba7)[_0x87b0('0x2')](0x0);return _0x448447['diff'](_0x3a68f5,_0x87b0('0x3'));}function History(_0x256950){this['uniqueid']=_0x256950[_0x87b0('0x4')];this['scheduledat']=_0x256950[_0x87b0('0x5')]||undefined;this[_0x87b0('0x6')]=_0x256950[_0x87b0('0x6')];this[_0x87b0('0x7')]=_0x256950[_0x87b0('0x6')]===_0x87b0('0x8')?_0x87b0('0x9'):_0x256950['type'];this['countbusyretry']=_0x256950['countbusyretry'];this['countcongestionretry']=_0x256950[_0x87b0('0xa')];this[_0x87b0('0xb')]=_0x256950['countnoanswerretry'];this[_0x87b0('0xc')]=_0x256950[_0x87b0('0xd')]+_0x256950[_0x87b0('0xa')]+_0x256950[_0x87b0('0xb')];this['queue']=_0x256950[_0x87b0('0x9')];this[_0x87b0('0xe')]=_0x256950[_0x87b0('0xf')];this[_0x87b0('0x10')]=_0x256950[_0x87b0('0x11')];this[_0x87b0('0x12')]=_0x256950['starttime'];this['responsetime']=_0x256950['responsetime'];this[_0x87b0('0x13')]=_0x256950['responsetime'];this[_0x87b0('0x14')]=getSeconds(_0x256950['responsetime'],_0x256950[_0x87b0('0x12')]);this['holdtime']=0x0;this[_0x87b0('0x15')]=0x0;this[_0x87b0('0x16')]=_0x256950[_0x87b0('0x16')];this['callbackuniqueid']=_0x256950[_0x87b0('0x17')];this[_0x87b0('0x18')]=_0x256950[_0x87b0('0x18')];this['recallme']=_0x256950['recallme'];this[_0x87b0('0x19')]=_0x256950[_0x87b0('0x19')];this['ListId']=_0x256950[_0x87b0('0x1a')];this[_0x87b0('0x1b')]=_0x256950[_0x87b0('0x1b')];this['VoiceQueueId']=_0x256950['VoiceQueueId'];this[_0x87b0('0x1c')]=_0x256950[_0x87b0('0x1c')];this[_0x87b0('0x1d')]=_0x256950['originatecalleridnum']||'';this[_0x87b0('0x1e')]=_0x256950['originatecalleridname']||'';}module[_0x87b0('0x1f')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 11d474b..b1c812c 100644 --- a/server/services/ami/dialer/index.js +++ b/server/services/ami/dialer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5f4=['dialAMDMaximumWordLength','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originate','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','outboundOriginateFailureCallsDay','OriginateError','starttime','[originate][error]','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','stateGlobal','reason\x208\x20congestion','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','temp','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','clearZombieChannels','uniqueId','actions','isNil','Action','catch','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','statedesc','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','outboundAnswerCallsDay','AnswerAGI','AGI','dialQueueProject','cause-txt','reason','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','Drop','dropreason','TIMEOUT','dialQueueProject2','outboundDropCallsDayCallersExit','CALLEREXIT','channel','actionid','locked','status','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','CampaignId','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','Failure','isArray','iftime\x20%s,%s','interval','timezones','content','indexOf','true','command','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','pow','replace','random','match','actionOriginate','voiceQueue\x20is\x20undefine','Contact','phone','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH'];(function(_0x3f5f02,_0x3e4e7c){var _0x372009=function(_0x40dd43){while(--_0x40dd43){_0x3f5f02['push'](_0x3f5f02['shift']());}};_0x372009(++_0x3e4e7c);}(_0xc5f4,0x8d));var _0x4c5f=function(_0xfbd754,_0x316e6c){_0xfbd754=_0xfbd754-0x0;var _0x14372a=_0xc5f4[_0xfbd754];return _0x14372a;};'use strict';var util=require('util');var _=require(_0x4c5f('0x0'));var BPromise=require(_0x4c5f('0x1'));var uuid=require(_0x4c5f('0x2'));var moment=require(_0x4c5f('0x3'));var rr=require('rr');var md5=require(_0x4c5f('0x4'));var Redis=require(_0x4c5f('0x5'));var config=require('../../../config/environment/');var logger=require(_0x4c5f('0x6'))(_0x4c5f('0x7'));var loggerBooked=require(_0x4c5f('0x6'))(_0x4c5f('0x8'));var loggerPredictive=require(_0x4c5f('0x6'))(_0x4c5f('0x9'));var loggerPredictiveCalls=require(_0x4c5f('0x6'))(_0x4c5f('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x4c5f('0xb'));var ami=require(_0x4c5f('0xc'));config[_0x4c5f('0xd')]=_['defaults'](config[_0x4c5f('0xd')],{'host':_0x4c5f('0xe'),'port':0x18eb});var io=require(_0x4c5f('0xf'))(new Redis(config[_0x4c5f('0xd')]));var cmHopper=require(_0x4c5f('0x10'));var cmHopperFinal=require(_0x4c5f('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x4c5f('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x4c5f('0x13'));var History=require(_0x4c5f('0x14'));var Final=require(_0x4c5f('0x15'));var AgentComplete=require(_0x4c5f('0x16'));var QueueCallerAbandon=require(_0x4c5f('0x17'));var Hangup=require(_0x4c5f('0x18'));var ipAgi=process[_0x4c5f('0x19')][_0x4c5f('0x1a')]||'127.0.0.1';var strategy={'rrmemory':_0x4c5f('0x1b'),'roundrobin':_0x4c5f('0x1c')};var Sequence=function(){};Sequence[_0x4c5f('0x1d')][_0x4c5f('0x1e')]=function(_0x3648d7){this[_0x4c5f('0x1f')]=this[_0x4c5f('0x1f')]?this[_0x4c5f('0x1f')][_0x4c5f('0x20')](_0x3648d7):_0x3648d7();};function Dialer(_0x2e7c91,_0x331eba){this['sequence']=new Sequence();this['preview']=_0x331eba;this['voiceQueues']=_0x2e7c91[_0x4c5f('0x21')];this['campaigns']=_0x2e7c91[_0x4c5f('0x22')];this['agents']=_0x2e7c91[_0x4c5f('0x23')];this[_0x4c5f('0x24')]=_0x2e7c91[_0x4c5f('0x24')];this[_0x4c5f('0x25')]=config['maxNumberOriginate']||0x2;this[_0x4c5f('0x26')]={};this['actions']={};this[_0x4c5f('0x27')]={};this['uniqueId']={};this[_0x4c5f('0x28')]={};this[_0x4c5f('0x29')]={};this[_0x4c5f('0x2a')]={};this['ivrOriginated']={};this['queueBooked']={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x4c5f('0x2b')][_0x4c5f('0x2c')](this));ami['on'](_0x4c5f('0x2d'),this[_0x4c5f('0x2e')]['bind'](this));ami['on'](_0x4c5f('0x2f'),this[_0x4c5f('0x30')][_0x4c5f('0x2c')](this));ami['on'](_0x4c5f('0x31'),this[_0x4c5f('0x32')][_0x4c5f('0x2c')](this));ami['on'](_0x4c5f('0x33'),this[_0x4c5f('0xb')][_0x4c5f('0x2c')](this));ami['on'](_0x4c5f('0x34'),this[_0x4c5f('0x35')][_0x4c5f('0x2c')](this));ami['on']('newexten',this[_0x4c5f('0x36')][_0x4c5f('0x2c')](this));ami['on']('varset',this[_0x4c5f('0x37')][_0x4c5f('0x2c')](this));ami['on']('queuemember',this[_0x4c5f('0x38')]['bind'](this));ami['on'](_0x4c5f('0x39'),this[_0x4c5f('0x3a')]['bind'](this));this[_0x4c5f('0x3b')]();this[_0x4c5f('0x3c')]();}function isNotNull(_0x394495){return _0x394495!==null&&!_[_0x4c5f('0x3d')](_0x394495);}function checkIsLoggedIn(_0x597315,_0x487491){return function(){if(_0x487491<=0x0){_0x597315[_0x4c5f('0x3e')]=_0x4c5f('0x3f');throw _0x597315['name']+_0x4c5f('0x40');}};}function isActive(_0x2d266c){return _0x2d266c;}function checkIsActive(_0x4735d4,_0x2eb663){return function(){if(!isActive(_0x2eb663)){_0x4735d4[_0x4c5f('0x3e')]='NOT_ACTIVE';throw _0x4735d4[_0x4c5f('0x41')]+_0x4c5f('0x42');}};}function checkInterval(_0xf49f09){return function(){if(!isNotNull(_0xf49f09[_0x4c5f('0x43')])){_0xf49f09[_0x4c5f('0x3e')]=_0x4c5f('0x44');throw _0xf49f09[_0x4c5f('0x41')]+_0x4c5f('0x45');}if(!isNotNull(_0xf49f09[_0x4c5f('0x43')]['Intervals'])){_0xf49f09[_0x4c5f('0x3e')]='INTERVAL_IS_NULL';throw _0xf49f09[_0x4c5f('0x41')]+_0x4c5f('0x45');}if(!isNotNull(_['isEmpty'](_0xf49f09['Interval'][_0x4c5f('0x46')]))){_0xf49f09['message']='INTERVAL_IS_NULL';throw _0xf49f09[_0x4c5f('0x41')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x4bb0eb,_0x1598d4,_0x5d2286){return{'action':_0x4bb0eb,'response':_0x1598d4,'message':_0x5d2286,'stack':_0x5d2286};}function myreject(_0x30c3de){return function(_0x2dfe7b){return _0x30c3de(msgResponse(_0x4c5f('0x47'),_0x4c5f('0x48'),JSON[_0x4c5f('0x49')](_0x2dfe7b)));};}function getSeconds(_0x2405d9,_0x2f58e6){var _0x5a3c4f=moment(_0x2405d9)[_0x4c5f('0x4a')](0x0);var _0x203206=moment(_0x2f58e6)['milliseconds'](0x0);return _0x5a3c4f[_0x4c5f('0x4b')](_0x203206,_0x4c5f('0x4c'));}function emit(_0x350371,_0x325771,_0xa7fa5a){io['to'](_0x350371)[_0x4c5f('0x4d')](_0x325771,_0xa7fa5a);}function emitVoiceQueueSummary(_0xba407){if(_0xba407[_0x4c5f('0x4e')]===_0x4c5f('0x4f')){var _0x2e44b9={'id':_0xba407['id'],'name':_0xba407[_0x4c5f('0x41')],'strategy':_0xba407[_0x4c5f('0x50')],'answered':_0xba407[_0x4c5f('0x51')],'available':_0xba407[_0x4c5f('0x52')],'loggedIn':_0xba407[_0x4c5f('0x53')],'pTalking':_0xba407[_0x4c5f('0x54')],'sumBillable':_0xba407[_0x4c5f('0x55')],'sumDuration':_0xba407[_0x4c5f('0x56')],'sumHoldTime':_0xba407['sumHoldTime']||0x0,'talking':_0xba407[_0x4c5f('0x57')],'total':_0xba407[_0x4c5f('0x58')],'type':_0xba407[_0x4c5f('0x4e')],'unmanaged':_0xba407[_0x4c5f('0x59')],'abandoned':_0xba407[_0x4c5f('0x5a')],'waiting':_0xba407[_0x4c5f('0x5b')],'loggedInDb':_0xba407[_0x4c5f('0x5c')],'dialActive':_0xba407[_0x4c5f('0x5d')],'dialMethod':_0xba407[_0x4c5f('0x5e')],'dialOriginateCallerIdName':_0xba407[_0x4c5f('0x5f')],'dialOriginateCallerIdNumber':_0xba407['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xba407[_0x4c5f('0x60')],'dialPrefix':_0xba407[_0x4c5f('0x61')],'outboundAnswerAgiCallsDay':_0xba407[_0x4c5f('0x62')],'outboundAnswerCallsDay':_0xba407['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xba407['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0xba407[_0x4c5f('0x63')],'outboundCongestionCallsDay':_0xba407[_0x4c5f('0x64')],'outboundDropCallsDayACS':_0xba407[_0x4c5f('0x65')],'outboundDropCallsDayCallersExit':_0xba407['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0xba407[_0x4c5f('0x66')],'outboundNoAnswerCallsDay':_0xba407[_0x4c5f('0x67')],'outboundNoSuchCallsDay':_0xba407[_0x4c5f('0x68')],'outboundOriginateFailureCallsDay':_0xba407['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xba407[_0x4c5f('0x69')],'outboundRejectCallsDay':_0xba407['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0xba407[_0x4c5f('0x6a')],'predictiveIntervalAnsweredCalls':_0xba407[_0x4c5f('0x6b')],'predictiveIntervalAvgHoldtime':_0xba407['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xba407[_0x4c5f('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0xba407[_0x4c5f('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0xba407[_0x4c5f('0x6e')],'predictiveIntervalErlangCalls':_0xba407[_0x4c5f('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0xba407[_0x4c5f('0x70')],'predictiveIntervalHitRate':_0xba407[_0x4c5f('0x71')],'predictiveIntervalMultiplicativeFactor':_0xba407[_0x4c5f('0x72')],'predictiveIntervalPauses':_0xba407[_0x4c5f('0x73')],'predictiveIntervalAvailable':_0xba407[_0x4c5f('0x74')],'predictiveIntervalTotalCalls':_0xba407[_0x4c5f('0x75')],'message':_0xba407['message'],'originated':_0xba407[_0x4c5f('0x76')],'erlangCalls':_0xba407[_0x4c5f('0x77')],'erlangCallToSecond':_0xba407[_0x4c5f('0x78')],'erlangAbandonmentRate':_0xba407[_0x4c5f('0x79')],'erlangBusyFactor':_0xba407[_0x4c5f('0x7a')],'startPredictive':_0xba407[_0x4c5f('0x29')],'startProgressive':_0xba407['startProgressive']};if(_0xba407[_0x4c5f('0x7b')]){_0x2e44b9[_0x4c5f('0x7b')]={'id':_0xba407[_0x4c5f('0x7b')]['id'],'name':_0xba407[_0x4c5f('0x7b')][_0x4c5f('0x41')],'active':_0xba407[_0x4c5f('0x7b')][_0x4c5f('0x7c')],'callerid':_0xba407['Trunk'][_0x4c5f('0x7d')]};}if(_0xba407[_0x4c5f('0x43')]){_0x2e44b9[_0x4c5f('0x43')]={'id':_0xba407[_0x4c5f('0x43')]['id'],'name':_0xba407[_0x4c5f('0x43')]['name']};}var _0x92fe=md5(JSON[_0x4c5f('0x49')](_0x2e44b9));if(_0xba407[_0x4c5f('0x4')]!==_0x92fe){_0xba407[_0x4c5f('0x4')]=_0x92fe;emit(util[_0x4c5f('0x7e')]('voice:queue:%s',_0x2e44b9['name']),_0x4c5f('0x7f'),_0x2e44b9);}}}function emitCampaignSummary(_0x3d4b1d){if(_0x3d4b1d['type']==='ivr'){emit(util[_0x4c5f('0x7e')]('campaign:ivr:%s',_0x3d4b1d[_0x4c5f('0x41')]),'campaign:save',_0x3d4b1d);}}function checkGetDataPredictive(_0x500d01){if(isNotNull(_0x500d01)){if(!_[_0x4c5f('0x80')](_0x500d01)){loggerPredictive['info'](_0x4c5f('0x81'));loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x83'),_0x500d01['predictiveIntervalTotalCalls']);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x84'),_0x500d01[_0x4c5f('0x6b')]);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x85'),_0x500d01[_0x4c5f('0x6e')]);loggerPredictive['info'](_0x4c5f('0x86'),_0x500d01[_0x4c5f('0x6d')]);loggerPredictive['info'](_0x4c5f('0x87'),_0x500d01['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x88'),_0x500d01[_0x4c5f('0x6c')]);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x89'));if(_0x500d01[_0x4c5f('0x75')]>0x0){if(!_['isUndefined'](_0x500d01[_0x4c5f('0x6c')])&&_0x500d01['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x4c5f('0x82')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x4c5f('0x3d')](_0x500d01['predictiveIntervalAvgHoldtime'])&&_0x500d01[_0x4c5f('0x8a')]>0x0){return!![];}else{loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x8b'));}}else{loggerPredictive['info'](_0x4c5f('0x8c'));}}else{loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x8d'));}}else{loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x8d'));}return![];}function mergeDataErlangB(_0x954515){return function(_0x44ebcb){loggerPredictive[_0x4c5f('0x82')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x8e'),_0x44ebcb[_0x4c5f('0x77')]);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x8f'),_0x44ebcb[_0x4c5f('0x78')]);loggerPredictive[_0x4c5f('0x82')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44ebcb[_0x4c5f('0x79')]);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x90'),_0x44ebcb[_0x4c5f('0x7a')]);loggerPredictive[_0x4c5f('0x82')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44ebcb[_0x4c5f('0x79')]);loggerPredictive[_0x4c5f('0x82')]('---------------------------');_[_0x4c5f('0x91')](_0x954515,_0x44ebcb);};}function getDiff(_0x25f187){var _0x2adc26=moment()[_0x4c5f('0x4a')](0x0);var _0x1a42c7=moment(_0x25f187)[_0x4c5f('0x4a')](0x0);return _0x2adc26['diff'](_0x1a42c7,'seconds');}function ifInterval(_0x5968ad,_0x21e800){if(_[_0x4c5f('0x3d')](_0x21e800)){return![];}if(getDiff(_0x21e800)<_0x5968ad*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x165f07){if(isNotNull(_0x165f07)){if(!_['isUndefined'](_0x165f07[_0x4c5f('0x2a')])){_0x165f07[_0x4c5f('0x2a')]=undefined;loggerPredictive[_0x4c5f('0x82')](_0x165f07['name'],_0x4c5f('0x92'));}if(!_[_0x4c5f('0x3d')](_0x165f07[_0x4c5f('0x29')])){_0x165f07['startPredictive']=undefined;loggerPredictive[_0x4c5f('0x82')](_0x165f07[_0x4c5f('0x41')],_0x4c5f('0x93'));}if(!_['isUndefined'](_0x165f07[_0x4c5f('0x94')])){clearInterval(_0x165f07[_0x4c5f('0x94')]);_0x165f07['handlePredictive']=undefined;loggerPredictive['info'](_0x165f07[_0x4c5f('0x41')],_0x4c5f('0x95'));}}}function erlangb(_0x42bdf7,_0x3282f0){if(_0x3282f0===0x0){return 0x0;}var _0x6b0819=0x1;for(var _0x32270e=0x1;_0x32270e<=_0x3282f0;_0x32270e+=0x1){_0x6b0819=0x1+_0x6b0819*_0x32270e/_0x42bdf7;}return 0x1/_0x6b0819;}function isVoiceQueueOutbound(_0x4ce6e2){return _0x4ce6e2===_0x4c5f('0x4f');}function isNotPreview(_0x566a80){return _0x566a80!==_0x4c5f('0x96');}function isCampaignIvr(_0x144e6b){return _0x144e6b===_0x4c5f('0x97');}function getCallerId(_0x317088,_0x4f742c,_0x1502f8){if(!_[_0x4c5f('0x3d')](_0x1502f8)&&_0x4c5f('0x98')===typeof _0x1502f8&&!_['isEmpty'](_0x1502f8)){if(!_[_0x4c5f('0x3d')](_0x4f742c)&&_0x4c5f('0x98')===typeof _0x4f742c&&!_[_0x4c5f('0x80')](_0x4f742c)){return util[_0x4c5f('0x7e')]('\x22%s\x22\x20<%s>',_0x4f742c,_0x1502f8);}return util[_0x4c5f('0x7e')](_0x4c5f('0x99'),_0x1502f8,_0x1502f8);}if(!_['isUndefined'](_0x317088)&&_0x4c5f('0x98')===typeof _0x317088&&!_['isEmpty'](_0x317088)){return _0x317088;}return _0x4c5f('0x9a');}function loggerCatchQueueSummary(_0x4733a8,_0x50703b){return function(_0x414c21){freeVariablesPredictive(_0x50703b);emitVoiceQueueSummary(_0x50703b);emitCampaignSummary(_0x50703b);loggerSyncQueueSummary[_0x4c5f('0x9b')](_0x4733a8,util[_0x4c5f('0x9c')](_0x414c21,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3a1eef,_0x2649b3){return function(_0x3c344d){loggerPredictive[_0x4c5f('0x9b')](_0x2649b3[_0x4c5f('0x41')],_0x3a1eef);loggerPredictive[_0x4c5f('0x9b')](_0x3c344d[_0x4c5f('0x9d')]);freeVariablesPredictive(_0x2649b3);};}function loggerCatch(_0x323398){return function(_0x482db7){logger[_0x4c5f('0x9b')](_0x323398,util[_0x4c5f('0x9c')](_0x482db7,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x327921){return _0x327921&&!_[_0x4c5f('0x3d')](_0x327921)&&_0x327921[_0x4c5f('0x9e')]>0x0;}function decremetOriginate(_0x2b8fa8){if(!_['isUndefined'](_0x2b8fa8)&&_0x2b8fa8!==null){if(_0x2b8fa8[_0x4c5f('0x9f')](_0x4c5f('0x76'))){if(_0x2b8fa8[_0x4c5f('0x76')]>0x0){_0x2b8fa8['originated']-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x4c5f('0x9b')](_0x4c5f('0xa0'));}}function checkContactLowerLimitOriginate(_0x324104,_0x48d21d,_0x44360a){if(_0x48d21d>_0x44360a){for(var _0x4c3b10=0x0;_0x4c3b10<_0x48d21d-_0x44360a;_0x4c3b10+=0x1){decremetOriginate(_0x324104);}}}function loggerGetContactDialer(_0x19f4e4,_0x115c71,_0x37052b){return function(_0x2ac89b){checkContactLowerLimitOriginate(_0x115c71,_0x37052b,0x0);logger[_0x4c5f('0x9b')](_0x19f4e4,util[_0x4c5f('0x9c')](_0x2ac89b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x14e8f8){return function(_0x3485b6){if(isNotNull(_0x3485b6)&&isNotNull(_0x3485b6[0x0])){if(_0x3485b6[0x0]['contactsRescheduled']>0x0){_0x14e8f8[_0x4c5f('0x3e')]=_0x4c5f('0xa1');logger[_0x4c5f('0x82')](_0x4c5f('0xa2')+_0x14e8f8['name'],_0x3485b6[0x0][_0x4c5f('0xa3')],_0x4c5f('0xa4'));}else{_0x14e8f8[_0x4c5f('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4c5f('0x82')](_0x4c5f('0xa5')+_0x14e8f8[_0x4c5f('0x41')]);}}};}function notSendMessagesQueue(_0x45fa7d){if(_0x45fa7d[_0x4c5f('0xa6')]){freeVariablesPredictive(_0x45fa7d);if(_0x45fa7d[_0x4c5f('0x76')]===0x0&&_0x45fa7d[_0x4c5f('0x57')]===0x0&&_0x45fa7d[_0x4c5f('0x5b')]===0x0&&(_0x45fa7d[_0x4c5f('0x54')]||0x0)===0x0){_0x45fa7d[_0x4c5f('0xa6')]=![];_0x45fa7d['available']=0x0;_0x45fa7d['message']=_0x4c5f('0xa7');loggerSyncQueueSummary[_0x4c5f('0x9b')](_0x4c5f('0xa8'),_0x45fa7d['name'],_0x4c5f('0xa9'));}else{_0x45fa7d[_0x4c5f('0x3e')]=_0x4c5f('0xaa');loggerSyncQueueSummary[_0x4c5f('0x9b')](_0x4c5f('0xa8'),_0x45fa7d['name'],_0x4c5f('0xab'));}emitVoiceQueueSummary(_0x45fa7d);}}function notSendMessagesCampaign(_0xc9b6f4){if(_0xc9b6f4[_0x4c5f('0xa6')]){if(_0xc9b6f4[_0x4c5f('0x76')]===0x0){_0xc9b6f4[_0x4c5f('0xa6')]=![];_0xc9b6f4[_0x4c5f('0x3e')]=_0x4c5f('0xa7');loggerSyncQueueSummary[_0x4c5f('0x9b')](_0x4c5f('0xac'),_0xc9b6f4[_0x4c5f('0x41')],'is\x20not\x20active');}else{_0xc9b6f4['message']='IS_DISACTIVED';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xc9b6f4['name'],'is\x20disactive');}emitCampaignSummary(_0xc9b6f4);}}function createObjHistory(_0x1e5a4a,_0x5a5520,_0x265ac4,_0x53f695,_0x5834ec){_0x1e5a4a[_0x4c5f('0x3e')]=_0x265ac4;var _0x325ac8=new Action(_0x1e5a4a,_0x5a5520);var _0x444042=new History(_0x325ac8);_0x444042[_0x4c5f('0xad')]=_0x53f695;_0x444042['statedesc']=_0x5834ec;_0x444042[_0x4c5f('0xae')]=_0x325ac8['starttime'];return _0x444042;}Dialer['prototype'][_0x4c5f('0x3c')]=function(){var _0x1890ba=this;setInterval(function(){_0x1890ba[_0x4c5f('0xaf')](_0x1890ba[_0x4c5f('0xb0')],'[uniqueid]');_0x1890ba[_0x4c5f('0xaf')](_0x1890ba[_0x4c5f('0xb1')],'[actions]');},0x32c8);};Dialer[_0x4c5f('0x1d')]['clearZombieChannels']=function(_0x2781e6,_0xd797cb){var _0x5f35e0=this;for(var _0x533c85 in _0x2781e6){if(_0x2781e6[_0x4c5f('0x9f')](_0x533c85)){this['sequence'][_0x4c5f('0x1e')](function(){if(!_[_0x4c5f('0xb2')](_0x2781e6[_0x533c85])){return ami[_0x4c5f('0xb3')]({'action':'status','channel':_0x2781e6[_0x533c85]['channel']})[_0x4c5f('0xb4')](function(_0x5dd255){if(_0x5dd255[_0x4c5f('0x3e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2781e6[_0x533c85]&&_0x2781e6[_0x533c85][_0x4c5f('0x4e')]!==_0x4c5f('0x97')){_0x5f35e0['updateOriginated'](_0x5f35e0['voiceQueues'][_0x2781e6[_0x533c85][_0x4c5f('0xb5')]]);logger[_0x4c5f('0x9b')](_0x4c5f('0xb6'),_0xd797cb,_0x533c85,_0x2781e6[_0x533c85][_0x4c5f('0xb5')]);delete _0x2781e6[_0x533c85];}if(_0x2781e6[_0x533c85]&&_0x2781e6[_0x533c85]['type']===_0x4c5f('0x97')){_0x5f35e0[_0x4c5f('0xb7')](_0x5f35e0[_0x4c5f('0x22')][_0x2781e6[_0x533c85][_0x4c5f('0xb5')]]);logger['error'](_0x4c5f('0xb8'),_0xd797cb,_0x533c85,_0x2781e6[_0x533c85][_0x4c5f('0xb5')]);delete _0x2781e6[_0x533c85];}},0x2328);}});}});}}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xb9')]=function(_0x1d9842){return BPromise[_0x4c5f('0xba')]()[_0x4c5f('0xbb')](cmHopper[_0x4c5f('0xb9')](_0x1d9842))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xbc')));};Dialer['prototype'][_0x4c5f('0xbd')]=function(_0x66dc52){return BPromise['resolve']()[_0x4c5f('0xbb')](cmHopperBlack[_0x4c5f('0xbd')](_0x66dc52))['catch'](loggerCatch(_0x4c5f('0xbe')));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xbf')]=function(_0x1125a0){return BPromise[_0x4c5f('0xba')]()[_0x4c5f('0xbb')](cmHopperBlack['checkIsBlackListIvr'](_0x1125a0))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xc0')));};Dialer['prototype'][_0x4c5f('0xc1')]=function(_0x2bb43f){return BPromise[_0x4c5f('0xba')]()[_0x4c5f('0xbb')](cmHopperHistory[_0x4c5f('0xc2')](_0x2bb43f))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xc3')));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xc4')]=function(_0x580ca0){return BPromise[_0x4c5f('0xba')]()['then'](cmHopper[_0x4c5f('0xc4')](_0x580ca0))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xc5')));};Dialer[_0x4c5f('0x1d')]['getContactDialer']=function(_0x3f0a26,_0x3769c5,_0x28db43,_0x1a7920){return BPromise['resolve']()[_0x4c5f('0xbb')](cmHopper[_0x4c5f('0xc6')](_0x3f0a26,_0x3769c5,_0x28db43,_0x1a7920))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xc7')));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xc8')]=function(_0x133bbd,_0x6c75a8,_0x362afc){return BPromise[_0x4c5f('0xba')]()[_0x4c5f('0xbb')](cmHopper[_0x4c5f('0xc8')](_0x133bbd,_0x6c75a8,_0x362afc))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xc7')));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xc9')]=function(_0x5386b7){return BPromise[_0x4c5f('0xba')]()[_0x4c5f('0xbb')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5386b7))[_0x4c5f('0xb4')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x4c5f('0xca')]=function(_0x3367e){return BPromise[_0x4c5f('0xba')]()[_0x4c5f('0xbb')](cmHopper[_0x4c5f('0xca')](_0x3367e))[_0x4c5f('0xb4')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xcb')]=function(_0x4f68b3){return BPromise[_0x4c5f('0xba')]()[_0x4c5f('0xbb')](cmHopperHistory[_0x4c5f('0xcb')](_0x4f68b3))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xcc')));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xb7')]=function(_0x3f1f12){if(!_[_0x4c5f('0x3d')](_0x3f1f12)&&_0x3f1f12!==null){if(_0x3f1f12['hasOwnProperty']('originated')){if(_0x3f1f12[_0x4c5f('0x76')]>0x0){_0x3f1f12[_0x4c5f('0x76')]-=0x1;}else{logger[_0x4c5f('0x9b')](_0x4c5f('0xcd'));}}}else{logger['error'](_0x4c5f('0xce'));}};Dialer[_0x4c5f('0x1d')]['loggerHandler']=function(_0x1cf6b0,_0xa94b61){var _0x4b7bea=this;return function(_0x8a61b3){_0x4b7bea[_0x4c5f('0xb7')](_0xa94b61);logger['error'](_0x1cf6b0,util[_0x4c5f('0x9c')](_0x8a61b3,{'showHidden':![],'depth':null}));};};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xcf')]=function(_0x3040cd,_0x2b3562,_0x362a89){var _0xc618ef={'state':0x19,'statedesc':'notFound'};this[_0x4c5f('0xb7')](_0x2b3562);this[_0x4c5f('0xd0')](_[_0x4c5f('0x91')](_0xc618ef,_[_0x4c5f('0xd1')](_0x362a89,[_0x4c5f('0xd2'),_0x4c5f('0xd3'),_0x4c5f('0xd4'),_0x4c5f('0xd5'),'CampaignId'])),'[emptyContact][createHistory]',_0x4c5f('0xd6'));logger[_0x4c5f('0x9b')](_0x3040cd);};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xd7')]=function(_0x2002ea){return _0x2002ea===_0x4c5f('0xd8');};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xd9')]=function(_0x4b33bd){return!_[_0x4c5f('0x3d')](_0x4b33bd)&&_0x4b33bd&&!_['isUndefined'](_0x4b33bd[_0x4c5f('0x41')])&&!_[_0x4c5f('0x3d')](_0x4b33bd['active'])&&_0x4b33bd[_0x4c5f('0x7c')]&&(this['trunks'][util[_0x4c5f('0x7e')]('SIP/%s',_0x4b33bd['name'])]['status']===_0x4c5f('0xda')||this['trunks'][util[_0x4c5f('0x7e')](_0x4c5f('0xdb'),_0x4b33bd[_0x4c5f('0x41')])]['status']===_0x4c5f('0xdc'));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0xd0')]=function(_0x156877,_0x1f8e51,_0x1c230d){this[_0x4c5f('0xcb')](_0x156877)[_0x4c5f('0xb4')](loggerCatch(_0x1f8e51));this[_0x4c5f('0xca')](_0x156877)[_0x4c5f('0xb4')](loggerCatch(_0x1c230d));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x37')]=function(_0x306fdb){var _0x231aa3=this[_0x4c5f('0xb0')][_0x306fdb[_0x4c5f('0xdd')]];var _0x9295b9;if(!_['isNil'](_0x306fdb)&&!_[_0x4c5f('0xb2')](_0x306fdb['variable'])&&!_[_0x4c5f('0xb2')](_0x306fdb[_0x4c5f('0xde')][_0x4c5f('0xdf')])&&_0x306fdb[_0x4c5f('0xe0')]===_0x4c5f('0xe1')&&_0x231aa3){if(_0x231aa3[_0x4c5f('0x4e')]!==_0x4c5f('0x97')&&this[_0x4c5f('0x21')][_0x231aa3[_0x4c5f('0xb5')]]['dialAMDActive']&&_0x306fdb[_0x4c5f('0xe2')]===_0x4c5f('0xe3')){delete this[_0x4c5f('0xb0')][_0x306fdb[_0x4c5f('0xdd')]];this[_0x4c5f('0xb7')](this[_0x4c5f('0x21')][_0x231aa3[_0x4c5f('0xb5')]]);this[_0x4c5f('0x21')][_0x231aa3['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x4c5f('0x21')][_0x231aa3[_0x4c5f('0xb5')]][_0x4c5f('0x62')]+=0x1;_0x9295b9=new Hangup(_0x231aa3,_0x306fdb);_0x9295b9[_0x4c5f('0xad')]=0x12;_0x9295b9[_0x4c5f('0xe4')]=_0x4c5f('0xe5');_0x9295b9[_0x4c5f('0xe6')]=_0x4c5f('0xe7');this[_0x4c5f('0xd0')](_0x9295b9,_0x4c5f('0xe8'),_0x4c5f('0xe9'));}if(_0x231aa3[_0x4c5f('0x4e')]!=='ivr'&&this[_0x4c5f('0x21')][_0x231aa3[_0x4c5f('0xb5')]][_0x4c5f('0xea')]&&_0x306fdb[_0x4c5f('0xe2')]===_0x4c5f('0xeb')){delete this[_0x4c5f('0xb0')][_0x306fdb[_0x4c5f('0xdd')]];this[_0x4c5f('0xb7')](this[_0x4c5f('0x21')][_0x231aa3[_0x4c5f('0xb5')]]);this[_0x4c5f('0x21')][_0x231aa3[_0x4c5f('0xb5')]]['outboundAnswerCallsDay']+=0x1;this[_0x4c5f('0x21')][_0x231aa3[_0x4c5f('0xb5')]][_0x4c5f('0x62')]+=0x1;_0x9295b9=new Hangup(_0x231aa3,_0x306fdb);_0x9295b9[_0x4c5f('0xad')]=0x13;_0x9295b9[_0x4c5f('0xe4')]=_0x4c5f('0xec');_0x9295b9[_0x4c5f('0xe6')]=_0x4c5f('0xe7');_0x9295b9[_0x4c5f('0xed')]=!![];this[_0x4c5f('0xd0')](_0x9295b9,_0x4c5f('0xee'),_0x4c5f('0xef'));}if(_0x231aa3[_0x4c5f('0x4e')]===_0x4c5f('0x97')&&this[_0x4c5f('0x22')][_0x231aa3['queue']]['dialAMDActive']&&_0x306fdb[_0x4c5f('0xe2')]===_0x4c5f('0xe3')){delete this[_0x4c5f('0xb0')][_0x306fdb['uniqueid']];this['updateOriginated'](this[_0x4c5f('0x22')][_0x231aa3[_0x4c5f('0xb5')]]);_0x9295b9=new Hangup(_0x231aa3,_0x306fdb);_0x9295b9[_0x4c5f('0xad')]=0x12;_0x9295b9[_0x4c5f('0xe4')]='HangupInAMD';_0x9295b9[_0x4c5f('0xe6')]=_0x4c5f('0xe7');this['saveInDb'](_0x9295b9,_0x4c5f('0xf0'),_0x4c5f('0xf1'));}if(_0x231aa3[_0x4c5f('0x4e')]==='ivr'&&this[_0x4c5f('0x22')][_0x231aa3[_0x4c5f('0xb5')]][_0x4c5f('0xea')]&&_0x306fdb[_0x4c5f('0xe2')]===_0x4c5f('0xeb')){delete this[_0x4c5f('0xb0')][_0x306fdb[_0x4c5f('0xdd')]];this[_0x4c5f('0xb7')](this[_0x4c5f('0x22')][_0x231aa3[_0x4c5f('0xb5')]]);_0x9295b9=new Hangup(_0x231aa3,_0x306fdb);_0x9295b9[_0x4c5f('0xad')]=0x13;_0x9295b9[_0x4c5f('0xe4')]='Machine';_0x9295b9['membername']='AMD';_0x9295b9[_0x4c5f('0xed')]=!![];this['saveInDb'](_0x9295b9,'[syncMachineIvr][createHistory]',_0x4c5f('0xf2'));}}};Dialer['prototype'][_0x4c5f('0x35')]=function(_0x298f8e){var _0x3db25a=this[_0x4c5f('0xb0')][_0x298f8e[_0x4c5f('0xdd')]];var _0x5c1b06=this;var _0x52c75b;if(_0x3db25a&&_0x3db25a[_0x4c5f('0x4e')]===_0x4c5f('0x97')){delete this[_0x4c5f('0xb0')][_0x298f8e['uniqueid']];this[_0x4c5f('0xb7')](this[_0x4c5f('0x22')][_0x3db25a[_0x4c5f('0xb5')]]);this[_0x4c5f('0x22')][_0x3db25a[_0x4c5f('0xb5')]]['ivrAnswerCallsDay']+=0x1;_0x52c75b=new Hangup(_0x3db25a,_0x298f8e);this[_0x4c5f('0xcb')](_0x52c75b)['catch'](loggerCatch(_0x4c5f('0xf3')));this[_0x4c5f('0xca')](_0x52c75b)['catch'](loggerCatch(_0x4c5f('0xf4')));}if(_0x3db25a&&_0x3db25a[_0x4c5f('0x4e')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x3db25a[_0x4c5f('0xb5')]]['dialQueueProject'])){delete this[_0x4c5f('0xb0')][_0x298f8e[_0x4c5f('0xdd')]];this[_0x4c5f('0xb7')](this[_0x4c5f('0x21')][_0x3db25a['queue']]);this[_0x4c5f('0x21')][_0x3db25a[_0x4c5f('0xb5')]][_0x4c5f('0xf5')]+=0x1;this['voiceQueues'][_0x3db25a[_0x4c5f('0xb5')]][_0x4c5f('0x62')]+=0x1;_0x52c75b=new Hangup(_0x3db25a,_0x298f8e);_0x52c75b[_0x4c5f('0xad')]=0x10;_0x52c75b['statedesc']=_0x4c5f('0xf6');_0x52c75b[_0x4c5f('0xe6')]=_0x4c5f('0xf7');this[_0x4c5f('0xcb')](_0x52c75b)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x4c5f('0xca')](_0x52c75b)['catch'](loggerCatch(_0x4c5f('0xf4')));}if(_0x3db25a&&_0x3db25a[_0x4c5f('0x4e')]!==_0x4c5f('0x97')&&!isNotNull(this[_0x4c5f('0x21')][_0x3db25a[_0x4c5f('0xb5')]][_0x4c5f('0xf8')])){delete this[_0x4c5f('0xb0')][_0x298f8e[_0x4c5f('0xdd')]];this[_0x4c5f('0xb7')](this['voiceQueues'][_0x3db25a[_0x4c5f('0xb5')]]);this['voiceQueues'][_0x3db25a[_0x4c5f('0xb5')]]['outboundUnknownCallsDay']+=0x1;_0x52c75b=new Hangup(_0x3db25a,_0x298f8e);_0x52c75b[_0x4c5f('0xad')]=0xc;_0x52c75b[_0x4c5f('0xe4')]=_0x298f8e[_0x4c5f('0xf9')];_0x52c75b['membername']='Unknow';this[_0x4c5f('0xcb')](_0x52c75b)[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xf3')));this['moveContactManagedDialer'](_0x52c75b)[_0x4c5f('0xb4')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x4c5f('0x32')]=function(_0x163c09){var _0x3beec6=this[_0x4c5f('0xb0')][_0x163c09[_0x4c5f('0xdd')]];var _0x5b694e=this;if(this['voiceQueues'][_0x163c09['queue']]){if(_0x3beec6&&_0x3beec6[_0x4c5f('0x4e')]!==_0x4c5f('0x97')){delete this['uniqueId'][_0x163c09[_0x4c5f('0xdd')]];this[_0x4c5f('0x21')][_0x163c09[_0x4c5f('0xb5')]]['outboundAnswerCallsDay']+=0x1;var _0x30efce=new AgentComplete(_0x3beec6,_0x163c09);if(_0x163c09[_0x4c5f('0xfa')]==='agent'){_0x30efce[_0x4c5f('0xfb')]=this[_0x4c5f('0x21')][_0x163c09[_0x4c5f('0xb5')]]['dialQueueProject2']&&this[_0x4c5f('0x21')][_0x163c09[_0x4c5f('0xb5')]][_0x4c5f('0xfc')]?moment()[_0x4c5f('0x7e')](_0x4c5f('0xfd')):undefined;}this['createHistory'](_0x30efce)['catch'](loggerCatch(_0x4c5f('0xfe')));this[_0x4c5f('0xca')](_0x30efce)[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xff')));}}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x2b')]=function(_0x18af49){if(this[_0x4c5f('0x21')][_0x18af49['queue']]){if(this[_0x4c5f('0xb0')][_0x18af49[_0x4c5f('0xdd')]]&&this[_0x4c5f('0xb0')][_0x18af49['uniqueid']][_0x4c5f('0x4e')]!==_0x4c5f('0x97')){this[_0x4c5f('0xb7')](this[_0x4c5f('0x21')][_0x18af49[_0x4c5f('0xb5')]]);this[_0x4c5f('0xb0')][_0x18af49[_0x4c5f('0xdd')]][_0x4c5f('0x100')]=moment()['format'](_0x4c5f('0xfd'));}}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x101')]=function(_0x266efd){this['createHistory'](_0x266efd)[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xfe')));this[_0x4c5f('0xca')](_0x266efd)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x2e')]=function(_0x3d3093){var _0x8c4109=this[_0x4c5f('0xb0')][_0x3d3093[_0x4c5f('0xdd')]];var _0x5dccdd=this;if(this['voiceQueues'][_0x3d3093[_0x4c5f('0xb5')]]){if(_0x8c4109&&_0x8c4109[_0x4c5f('0x4e')]!==_0x4c5f('0x97')){delete this[_0x4c5f('0xb0')][_0x3d3093[_0x4c5f('0xdd')]];this[_0x4c5f('0xb7')](this[_0x4c5f('0x21')][_0x3d3093[_0x4c5f('0xb5')]]);_0x8c4109['droptime']=moment()[_0x4c5f('0x7e')](_0x4c5f('0xfd'));var _0x5b5081=new QueueCallerAbandon(_0x8c4109,_0x3d3093);if(getSeconds(_0x8c4109[_0x4c5f('0x102')],_0x8c4109['responsetime'])>=_0x8c4109['dialQueueTimeout']){this[_0x4c5f('0x21')][_0x3d3093[_0x4c5f('0xb5')]][_0x4c5f('0x6e')]+=0x1;this[_0x4c5f('0x21')][_0x3d3093[_0x4c5f('0xb5')]][_0x4c5f('0x66')]+=0x1;this[_0x4c5f('0x21')][_0x3d3093['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5b5081[_0x4c5f('0xad')]=0xa;_0x5b5081[_0x4c5f('0xe4')]=_0x4c5f('0x103');_0x5b5081[_0x4c5f('0x104')]=_0x4c5f('0x105');_0x5b5081[_0x4c5f('0xfb')]=this[_0x4c5f('0x21')][_0x3d3093[_0x4c5f('0xb5')]][_0x4c5f('0x106')]?moment()[_0x4c5f('0x7e')](_0x4c5f('0xfd')):undefined;this[_0x4c5f('0x101')](_0x5b5081);}else{this[_0x4c5f('0x21')][_0x3d3093[_0x4c5f('0xb5')]][_0x4c5f('0x6d')]+=0x1;this['voiceQueues'][_0x3d3093[_0x4c5f('0xb5')]][_0x4c5f('0x107')]+=0x1;_0x5b5081[_0x4c5f('0xad')]=0xb;_0x5b5081['statedesc']='Abandoned';_0x5b5081[_0x4c5f('0x104')]=_0x4c5f('0x108');this[_0x4c5f('0x101')](_0x5b5081);}}}};Dialer['prototype'][_0x4c5f('0x36')]=function(_0x4ef3cf){if(this[_0x4c5f('0xb1')][_0x4ef3cf[_0x4c5f('0xdd')]]){this[_0x4c5f('0xb1')][_0x4ef3cf[_0x4c5f('0xdd')]]['channel']=_0x4ef3cf[_0x4c5f('0x109')];}if(this[_0x4c5f('0xb0')][_0x4ef3cf[_0x4c5f('0xdd')]]){this[_0x4c5f('0xb0')][_0x4ef3cf[_0x4c5f('0xdd')]][_0x4c5f('0x109')]=_0x4ef3cf[_0x4c5f('0x109')];}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x38')]=function(_0x5bdd0b){if(strategy[this[_0x4c5f('0x21')][this['actions'][_0x5bdd0b[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]][_0x4c5f('0x50')]]===_0x4c5f('0x1c')){if(this[_0x4c5f('0xb1')][_0x5bdd0b[_0x4c5f('0x10a')]]&&_[_0x4c5f('0xb2')](this[_0x4c5f('0xb1')][_0x5bdd0b[_0x4c5f('0x10a')]][_0x4c5f('0x10b')])&&_0x5bdd0b[_0x4c5f('0x10c')]==='1'&&_0x5bdd0b[_0x4c5f('0x10d')]==='0'){if(this[_0x4c5f('0x23')][_0x5bdd0b['stateinterface']]){if(!this[_0x4c5f('0x23')][_0x5bdd0b[_0x4c5f('0x10e')]]['locked']){this[_0x4c5f('0x23')][_0x5bdd0b['stateinterface']]['locked']=!![];this[_0x4c5f('0xb1')][_0x5bdd0b[_0x4c5f('0x10a')]]['locked']=!![];this['actions'][_0x5bdd0b[_0x4c5f('0x10a')]][_0x4c5f('0x10e')]=_0x5bdd0b['stateinterface'];}}}}else if((strategy[this[_0x4c5f('0x21')][this[_0x4c5f('0xb1')][_0x5bdd0b[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]][_0x4c5f('0x50')]]||_0x4c5f('0x1b'))===_0x4c5f('0x1b')){if(this[_0x4c5f('0xb1')][_0x5bdd0b['actionid']]){if(this[_0x4c5f('0x23')][_0x5bdd0b['stateinterface']]){this['actions'][_0x5bdd0b[_0x4c5f('0x10a')]][_0x4c5f('0x10e')]=_0x5bdd0b['stateinterface'];if(_[_0x4c5f('0xb2')](this['queueBooked'][this[_0x4c5f('0xb1')][_0x5bdd0b['actionid']][_0x4c5f('0xb5')]])){this[_0x4c5f('0x10f')][this[_0x4c5f('0xb1')][_0x5bdd0b[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]]=[];}this[_0x4c5f('0x10f')][this[_0x4c5f('0xb1')][_0x5bdd0b[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]][_0x4c5f('0x110')](_['merge'](_[_0x4c5f('0xd1')](this[_0x4c5f('0xb1')][_0x5bdd0b[_0x4c5f('0x10a')]],[_0x4c5f('0x111'),'stateinterface']),{'status':_0x5bdd0b['status'],'paused':_0x5bdd0b[_0x4c5f('0x10d')]}));}}}};function unlockQueueStatus(_0x498edd,_0x407c45){setTimeout(function(){if(_[_0x4c5f('0x3d')](_0x498edd[_0x4c5f('0x112')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x407c45);}_0x498edd[_0x4c5f('0x112')]=!![];loggerBooked[_0x4c5f('0x82')](_0x4c5f('0x113'),_0x407c45,JSON['stringify'](_[_0x4c5f('0xd1')](_0x498edd,[_0x4c5f('0x41'),_0x4c5f('0x112')])));},0x1f3);}Dialer['prototype'][_0x4c5f('0x3a')]=function(_0x404011){var _0x2a8203=this;var _0x51f8c9=_0x2a8203['voiceQueues'][_0x2a8203['actions'][_0x404011[_0x4c5f('0x10a')]]['queue']];if(strategy[this['voiceQueues'][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]][_0x4c5f('0x50')]]===_0x4c5f('0x1c')){if(this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]]&&this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0x10e')]){this[_0x4c5f('0x96')][_0x4c5f('0x114')](this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0x111')],this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0x10e')])[_0x4c5f('0xb4')](function(_0x3a857f){logger[_0x4c5f('0x9b')](_0x4c5f('0x115'),util['inspect'](_0x3a857f,{'showHidden':![],'depth':null}));})[_0x4c5f('0x20')](function(){_0x2a8203['updateOriginated'](_0x2a8203[_0x4c5f('0x21')][_0x2a8203[_0x4c5f('0xb1')][_0x404011['actionid']][_0x4c5f('0xb5')]]);_0x2a8203['agents'][_0x2a8203[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0x10e')]][_0x4c5f('0x10b')]=![];delete _0x2a8203[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]];unlockQueueStatus(_0x51f8c9);});}else{this[_0x4c5f('0xb7')](this[_0x4c5f('0x21')][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]]);this[_0x4c5f('0xc4')]({'active':![],'ContactId':this[_0x4c5f('0xb1')][_0x404011['actionid']][_0x4c5f('0xd2')],'ListId':this['actions'][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0xd3')],'VoiceQueueId':this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0xd5')]||undefined,'CampaignId':this[_0x4c5f('0xb1')][_0x404011['actionid']][_0x4c5f('0x116')]||undefined})[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x117')));delete this['actions'][_0x404011[_0x4c5f('0x10a')]];unlockQueueStatus(_0x51f8c9);}}else if((strategy[this[_0x4c5f('0x21')][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]]['queue']][_0x4c5f('0x50')]]||_0x4c5f('0x1b'))==='rrmemory'){var _0x3fe426;if(this[_0x4c5f('0xb1')][_0x404011['actionid']]&&!_[_0x4c5f('0x80')](this[_0x4c5f('0x10f')][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]])){if(this[_0x4c5f('0x118')][_0x2a8203[_0x4c5f('0xb1')][_0x404011['actionid']][_0x4c5f('0xb5')]]){this[_0x4c5f('0x118')][_0x2a8203[_0x4c5f('0xb1')][_0x404011['actionid']][_0x4c5f('0xb5')]]=this['queueBookedRR'][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]]?this[_0x4c5f('0x118')][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]]['queue']]:this[_0x4c5f('0x10f')][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]]?this[_0x4c5f('0x10f')][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]]['queue']][_0x4c5f('0x119')]||0x0:0x0;}this[_0x4c5f('0x10f')][this[_0x4c5f('0xb1')][_0x404011[_0x4c5f('0x10a')]][_0x4c5f('0xb5')]]['_rr']=this[_0x4c5f('0x118')][this[_0x4c5f('0xb1')][_0x404011['actionid']]['queue']];for(var _0x5a63c1=0x0;_0x5a63c1=0x0?!![]:![];})[_0x4c5f('0xb4')](myreject(_0x36f8ab)));}}else{_0x3f3de4[_0x4c5f('0x110')](ami['Action']({'action':_0x4c5f('0x135'),'command':util[_0x4c5f('0x7e')](_0x4c5f('0x12f'),_0x3b7497,!_[_0x4c5f('0x3d')](config['timezones'][_0x3ebac7])?_0x3ebac7:'')})['then'](function(_0x4ff9ab){return _0x4ff9ab[_0x4c5f('0x132')][_0x4c5f('0x133')](_0x4c5f('0x134'))>=0x0?!![]:![];})['catch'](myreject(_0x36f8ab)));}BPromise[_0x4c5f('0x136')](_0x3f3de4)['then'](function(_0x1be510){var _0xc18dbe=_[_0x4c5f('0x137')](_0x1be510);if(_0xc18dbe){return _0x405d73(_0xc18dbe);}else{_0x445379[_0x4c5f('0x3e')]=_0x48df5d?_0x4c5f('0x138'):_0x4c5f('0x139');return _0x36f8ab(msgResponse('[ifTime][promiseAll]',_0x4c5f('0x12d'),_0x4c5f('0x13a')+_0x48df5d+'\x20'+_0x1697b2+_0x4c5f('0x13b')+util[_0x4c5f('0x9c')](_0x3b7497,{'showHidden':![],'depth':null})+_0x4c5f('0x13c')+_0x3ebac7));}})[_0x4c5f('0xb4')](function(_0x16cd1b){return _0x36f8ab(msgResponse(_0x4c5f('0x127'),_0x4c5f('0x12d'),JSON[_0x4c5f('0x49')](_0x16cd1b)));});});};Dialer['prototype'][_0x4c5f('0x13d')]=function(_0x200825){var _0x144da3=this;return function(){switch(_0x200825[_0x4c5f('0x5e')]){case'progressive':freeVariablesPredictive(_0x200825);_0x144da3[_0x4c5f('0x13e')](_0x200825,0x1);break;case _0x4c5f('0x13f'):freeVariablesPredictive(_0x200825);_0x144da3[_0x4c5f('0x13e')](_0x200825,_0x200825[_0x4c5f('0x140')]);break;case'predictive':_0x144da3[_0x4c5f('0x9')](_0x200825);break;case _0x4c5f('0x8'):freeVariablesPredictive(_0x200825);_0x144da3[_0x4c5f('0x13e')](_0x200825,0x1);break;default:freeVariablesPredictive(_0x200825);logger['error'](_0x4c5f('0x141'),_0x200825['name'],_0x4c5f('0x142'));}};};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x143')]=function(_0x41c338){var _0x5b2d4e=this;return function(){_0x5b2d4e['handleIvr'](_0x41c338);};};Dialer['prototype'][_0x4c5f('0xb')]=function(_0x55a27d){var _0x22f5b8=this;if(isNotPreview(_0x55a27d['dialMethod'])){if(isVoiceQueueOutbound(_0x55a27d['type'])&&isActive(_0x55a27d[_0x4c5f('0x5d')])){_0x55a27d['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x4c5f('0xbb')](checkIsLoggedIn(_0x55a27d,_0x55a27d[_0x4c5f('0x53')]))[_0x4c5f('0xbb')](checkIsActive(_0x55a27d,_0x55a27d['dialActive']))[_0x4c5f('0xbb')](checkInterval(_0x55a27d))['then'](_0x22f5b8[_0x4c5f('0x122')](_0x55a27d))[_0x4c5f('0xbb')](_0x22f5b8[_0x4c5f('0x126')](_0x55a27d[_0x4c5f('0x144')],_0x55a27d[_0x4c5f('0x145')],_0x55a27d[_0x4c5f('0x41')],_0x55a27d))[_0x4c5f('0xbb')](_0x22f5b8[_0x4c5f('0x128')](_0x55a27d[_0x4c5f('0x43')],_0x55a27d[_0x4c5f('0x145')],_0x55a27d[_0x4c5f('0x41')],_0x55a27d))[_0x4c5f('0xbb')](_0x22f5b8[_0x4c5f('0x13d')](_0x55a27d))[_0x4c5f('0xb4')](loggerCatchQueueSummary(_0x4c5f('0x146'),_0x55a27d));}else{notSendMessagesQueue(_0x55a27d);}}else{freeVariablesPredictive(_0x55a27d);}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x147')]=function(){var _0x4ae51a=this;var _0x3ae57c;for(var _0x4a5f64 in this['campaigns']){if(this[_0x4c5f('0x22')][_0x4c5f('0x9f')](_0x4a5f64)){_0x3ae57c=this[_0x4c5f('0x22')][_0x4a5f64];if(isCampaignIvr(_0x3ae57c[_0x4c5f('0x4e')])&&isActive(_0x3ae57c[_0x4c5f('0x7c')])){_0x3ae57c['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x4c5f('0xbb')](checkIsActive(_0x3ae57c,_0x3ae57c[_0x4c5f('0x7c')]))[_0x4c5f('0xbb')](checkInterval(_0x3ae57c))[_0x4c5f('0xbb')](_0x4ae51a['checkIsTrunkReachable'](_0x3ae57c))[_0x4c5f('0xbb')](_0x4ae51a[_0x4c5f('0x126')](_0x3ae57c[_0x4c5f('0x144')],_0x3ae57c[_0x4c5f('0x145')],_0x3ae57c[_0x4c5f('0x41')],_0x3ae57c))[_0x4c5f('0xbb')](_0x4ae51a['checkIfTimeIntervals'](_0x3ae57c[_0x4c5f('0x43')],_0x3ae57c['dialTimezone'],_0x3ae57c[_0x4c5f('0x41')],_0x3ae57c))[_0x4c5f('0xbb')](_0x4ae51a[_0x4c5f('0x143')](_0x3ae57c))[_0x4c5f('0xb4')](loggerCatchQueueSummary('[syncCampaigns]',_0x3ae57c));}else{notSendMessagesCampaign(_0x3ae57c);}}}};function getCallerIdRandom(_0x10e2c6,_0x3e893d){var _0x2d577d,_0x4da459,_0x39b874;if(_0x3e893d<=0x0){_0x3e893d=0x1;}_0x2d577d=new RegExp('\x5cw{0,'+_0x3e893d+'}$');_0x4da459=Math['pow'](0xa,_0x3e893d-0x1);_0x39b874=Math[_0x4c5f('0x148')](0xa,_0x3e893d)-0x1;return util[_0x4c5f('0x7e')]('%s',_[_0x4c5f('0x149')](_0x10e2c6,_0x2d577d,_[_0x4c5f('0x14a')](_0x4da459,_0x39b874)));}function extractCalleridName(_0x285eca){var _0x3dde33=_0x285eca[_0x4c5f('0x14b')](/"(.*?)"/);return _0x3dde33?_0x3dde33[0x1]:_0x285eca;}function extractCalleridNumber(_0x21163f){var _0x5a809b=_0x21163f[_0x4c5f('0x14b')](/<(.*?)>/);return _0x5a809b?_0x5a809b[0x1]:_0x21163f;}Dialer[_0x4c5f('0x1d')][_0x4c5f('0x14c')]=function(_0x3b9960,_0x5cf72c){var _0x2e3c72=this;var _0x5d7ec6=uuid['v4']();this[_0x4c5f('0xb1')][_0x5d7ec6]=new Action(_0x3b9960,_0x5cf72c,_0x5d7ec6);return new BPromise(function(_0x113d0e,_0x895b03){if(_[_0x4c5f('0x3d')](_0x3b9960)&&'object'!==typeof _0x3b9960){return _0x895b03(msgResponse('originate',_0x4c5f('0x12d'),_0x4c5f('0x14d')));}if(_['isUndefined'](_0x5cf72c[_0x4c5f('0x14e')][_0x4c5f('0x14f')])||_0x5cf72c['Contact'][_0x4c5f('0x14f')]===null){return _0x895b03(msgResponse('originate',_0x4c5f('0x12d'),'contact\x20is\x20undefine'));}var _0x4d0f61={'XMD-CALLERID':_0x2e3c72['actions'][_0x5d7ec6]['getCaller'](),'XMD-AGI':_0x3b9960['dialQueueProject']?util[_0x4c5f('0x7e')](_0x4c5f('0x150'),ipAgi,_0x3b9960[_0x4c5f('0xf8')]):_0x4c5f('0x151'),'XMD-AGIAFTER':_0x3b9960[_0x4c5f('0x106')]?util[_0x4c5f('0x7e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3b9960['dialQueueProject2']):_0x4c5f('0x151'),'XMD-QUEUE':_0x3b9960[_0x4c5f('0x4e')]==='outbound'?util[_0x4c5f('0x7e')](_0x4c5f('0x152'),_0x3b9960[_0x4c5f('0x41')],_0x3b9960['dialQueueOptions']||'',_0x3b9960[_0x4c5f('0xfc')]?'c':'',_0x3b9960['dialQueueTimeout']||0x3):_0x4c5f('0x151'),'XMD-CONTACTID':_0x5cf72c[_0x4c5f('0xd2')],'XMD-CDRTYPE':_0x4c5f('0x7'),'CALLERID(all)':_0x2e3c72[_0x4c5f('0xb1')][_0x5d7ec6][_0x4c5f('0x153')](),'XMD-AMD':_0x3b9960[_0x4c5f('0xea')]?_0x4c5f('0x154'):_0x4c5f('0x151'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x3b9960[_0x4c5f('0xea')]){_0x4d0f61[_0x4c5f('0x155')]=_0x3b9960[_0x4c5f('0x156')]||0x9c4;_0x4d0f61[_0x4c5f('0x157')]=_0x3b9960['dialAMDGreeting']||0x5dc;_0x4d0f61[_0x4c5f('0x158')]=_0x3b9960[_0x4c5f('0x159')]||0x320;_0x4d0f61[_0x4c5f('0x15a')]=_0x3b9960[_0x4c5f('0x15b')]||0x1388;_0x4d0f61[_0x4c5f('0x15c')]=_0x3b9960[_0x4c5f('0x15d')]||0x64;_0x4d0f61['XMD-AMDBETWEENWORDSSILENCE']=_0x3b9960[_0x4c5f('0x15e')]||0x32;_0x4d0f61['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3b9960[_0x4c5f('0x15f')]||0x3;_0x4d0f61[_0x4c5f('0x160')]=_0x3b9960[_0x4c5f('0x161')]||0x100;_0x4d0f61[_0x4c5f('0x162')]=_0x3b9960[_0x4c5f('0x163')]||0x1388;}if(_0x3b9960['type']===_0x4c5f('0x4f')){_0x4d0f61['XMD-VOICEQUEUEID']=_0x5cf72c[_0x4c5f('0xd5')];}else{_0x4d0f61['XMD-CAMPAIGNID']=_0x5cf72c[_0x4c5f('0x116')];}for(var _0x326a1d in _0x5cf72c['Contact']){if(_0x5cf72c['Contact'][_0x4c5f('0x9f')](_0x326a1d)){if(isNotNull(_0x5cf72c['Contact'][_0x326a1d])&&_0x326a1d!=='id'&&_0x326a1d!==_0x4c5f('0x164')&&_0x326a1d!==_0x4c5f('0x165')&&_0x326a1d!==_0x4c5f('0x166')){_0x4d0f61[util[_0x4c5f('0x7e')](_0x4c5f('0x167'),_0x4c5f('0x168'),_[_0x4c5f('0x169')](_0x326a1d))]=_0x5cf72c[_0x4c5f('0x14e')][_0x326a1d];}}}var _0x99ef43=_0x2e3c72[_0x4c5f('0xd9')](_0x3b9960[_0x4c5f('0x7b')])?getCallerId(_0x3b9960['Trunk'][_0x4c5f('0x7d')],_0x3b9960['dialOriginateCallerIdName'],_0x3b9960[_0x4c5f('0x16a')]>0x0?getCallerIdRandom(_0x3b9960['dialOriginateCallerIdNumber'],_0x3b9960[_0x4c5f('0x16a')]):_0x3b9960[_0x4c5f('0x16b')]):getCallerId(_[_0x4c5f('0xb2')](_0x3b9960[_0x4c5f('0x123')])?_0x3b9960['Trunk'][_0x4c5f('0x7d')]:_0x3b9960[_0x4c5f('0x123')]['callerid'],_0x3b9960[_0x4c5f('0x5f')],_0x3b9960[_0x4c5f('0x16a')]>0x0?getCallerIdRandom(_0x3b9960['dialOriginateCallerIdNumber'],_0x3b9960[_0x4c5f('0x16a')]):_0x3b9960[_0x4c5f('0x16b')]);if(_0x99ef43){_0x4d0f61[_0x4c5f('0x16c')]=_0x2e3c72[_0x4c5f('0xb1')][_0x5d7ec6][_0x4c5f('0x16d')]=extractCalleridName(_0x99ef43);_0x4d0f61['XMD-ORIGINATECALLERIDNUM']=_0x2e3c72[_0x4c5f('0xb1')][_0x5d7ec6]['originatecalleridnum']=extractCalleridNumber(_0x99ef43);}return ami['Action']({'actionid':_0x5d7ec6,'action':_0x4c5f('0x16e'),'channel':_0x2e3c72['isTrunkReachable'](_0x3b9960[_0x4c5f('0x7b')])?util[_0x4c5f('0x7e')]('SIP/%s/%s%s',_0x3b9960[_0x4c5f('0x7b')][_0x4c5f('0x41')],isNotNull(_0x3b9960['dialPrefix'])?_0x3b9960['dialPrefix'][_0x4c5f('0x16f')]()||'':'',_0x3b9960[_0x4c5f('0x170')]>0x0?_0x5cf72c[_0x4c5f('0x14e')][_0x4c5f('0x14f')][_0x4c5f('0x171')](_0x3b9960[_0x4c5f('0x170')]):_0x5cf72c[_0x4c5f('0x14e')][_0x4c5f('0x14f')]):util['format'](_0x4c5f('0x172'),_['isNil'](_0x3b9960['TrunkBackup'])?_0x3b9960[_0x4c5f('0x7b')]['name']:_0x3b9960[_0x4c5f('0x123')][_0x4c5f('0x41')],isNotNull(_0x3b9960[_0x4c5f('0x61')])?_0x3b9960['dialPrefix'][_0x4c5f('0x16f')]()||'':'',_0x3b9960['dialCutDigit']>0x0?_0x5cf72c[_0x4c5f('0x14e')]['phone']['substring'](_0x3b9960[_0x4c5f('0x170')]):_0x5cf72c['Contact'][_0x4c5f('0x14f')]),'callerid':_0x99ef43,'Exten':_0x4c5f('0xe1'),'Context':_0x4c5f('0x173'),'Priority':'1','variable':_0x4d0f61,'timeout':(_0x3b9960[_0x4c5f('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5d7ec6})[_0x4c5f('0xbb')](function(_0x16496e){return _0x113d0e(_0x16496e);})['catch'](function(_0xd5536){_0x3b9960[_0x4c5f('0x174')]+=0x1;var _0x2ba56c=new History(_0x2e3c72[_0x4c5f('0xb1')][_0x5d7ec6]);logger['error'](util[_0x4c5f('0x7e')]('[originateError]:\x20%s',JSON[_0x4c5f('0x49')](_0xd5536)));_0x2ba56c[_0x4c5f('0xad')]=0xe;_0x2ba56c[_0x4c5f('0xe4')]=_0x4c5f('0x175');_0x2ba56c[_0x4c5f('0x176')]=moment()['format'](_0x4c5f('0xfd'));_0x2ba56c[_0x4c5f('0xae')]=_0x2ba56c[_0x4c5f('0x176')];_0x2e3c72['createHistory'](_0x2ba56c)[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x177')));_0x2e3c72[_0x4c5f('0xca')](_0x2ba56c)[_0x4c5f('0xb4')](loggerCatch('[originate][error]'))[_0x4c5f('0x20')](function(){delete _0x2e3c72[_0x4c5f('0xb1')][_0x5d7ec6];return _0x895b03(msgResponse(_0x4c5f('0x16e'),_0x4c5f('0x48'),'originate\x20action\x20Error'));});});});};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x30')]=function(_0x16b293){var _0x53528e=this[_0x4c5f('0xb1')][_0x16b293[_0x4c5f('0x10a')]];var _0x131972=this;if(_0x53528e){delete this[_0x4c5f('0xb1')][_0x16b293[_0x4c5f('0x10a')]];_0x53528e[_0x4c5f('0x178')]=moment()[_0x4c5f('0x7e')](_0x4c5f('0xfd'));var _0xfa5d00=_0x53528e[_0x4c5f('0x4e')]==='ivr'?this[_0x4c5f('0x22')][_0x53528e['queue']]:this[_0x4c5f('0x21')][_0x53528e[_0x4c5f('0x179')]()];if(!this['isSuccess'](_0x16b293[_0x4c5f('0x17a')])){this[_0x4c5f('0xb7')](_0xfa5d00);return this[_0x4c5f('0x17b')](_0x53528e,_0xfa5d00,_0x16b293)[_0x4c5f('0xbb')](function(_0x4e0304){})['catch'](loggerCatch(_0x4c5f('0x17c')));}else{this['uniqueId'][_0x16b293[_0x4c5f('0xdd')]]=_0x53528e;}}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x17d')]=function(_0x4bcc91,_0x35a58a,_0x54e540){var _0x16a607=new History(_0x35a58a);if(_0x16a607[_0x4c5f('0x17e')]+_0x16a607[_0x4c5f('0x17f')]+_0x16a607[_0x4c5f('0x180')]>=_0x54e540[_0x4c5f('0x181')]-0x1){return!![];}switch(_0x4bcc91){case 0x3:if(_0x16a607[_0x4c5f('0x180')]>=_0x54e540[_0x4c5f('0x182')]-0x1){return!![];}else{this[_0x4c5f('0xc4')]({'active':![],'countnoanswerretry':_0x16a607[_0x4c5f('0x180')]+=0x1,'scheduledat':moment()[_0x4c5f('0x183')](_0x54e540[_0x4c5f('0x184')],_0x4c5f('0x185'))[_0x4c5f('0x7e')](_0x4c5f('0xfd')),'ContactId':_0x16a607['ContactId'],'ListId':_0x16a607[_0x4c5f('0xd3')],'VoiceQueueId':_0x16a607[_0x4c5f('0xd5')]||undefined,'CampaignId':_0x16a607[_0x4c5f('0x116')]||undefined})['catch'](loggerCatch(_0x4c5f('0x186')));}break;case 0x5:if(_0x16a607[_0x4c5f('0x17e')]>=_0x54e540['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x4c5f('0xc4')]({'active':![],'countbusyretry':_0x16a607[_0x4c5f('0x17e')]+=0x1,'scheduledat':moment()[_0x4c5f('0x183')](_0x54e540[_0x4c5f('0x187')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x16a607[_0x4c5f('0xd2')],'ListId':_0x16a607[_0x4c5f('0xd3')],'VoiceQueueId':_0x16a607[_0x4c5f('0xd5')]||undefined,'CampaignId':_0x16a607['CampaignId']||undefined})[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x188')));}break;case 0x8:if(_0x16a607[_0x4c5f('0x17f')]>=_0x54e540[_0x4c5f('0x189')]-0x1){return!![];}else{this[_0x4c5f('0xc4')]({'active':![],'countcongestionretry':_0x16a607[_0x4c5f('0x17f')]+=0x1,'scheduledat':moment()[_0x4c5f('0x183')](_0x54e540['dialCongestionRetryFrequency'],_0x4c5f('0x185'))[_0x4c5f('0x7e')](_0x4c5f('0xfd')),'ContactId':_0x16a607[_0x4c5f('0xd2')],'ListId':_0x16a607[_0x4c5f('0xd3')],'VoiceQueueId':_0x16a607[_0x4c5f('0xd5')]||undefined,'CampaignId':_0x16a607[_0x4c5f('0x116')]||undefined})[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x18a')));}break;default:return!![];}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x17b')]=function(_0x151bcf,_0x56ac7a,_0x5aef37){var _0x1964eb=this;var _0xd470c3=new History(_0x151bcf);return new BPromise(function(_0x5d1b54,_0x50f750){if(_[_0x4c5f('0x3d')](_0x56ac7a)&&_0x4c5f('0x18b')!==typeof _0x56ac7a){return _0x50f750(msgResponse(_0x4c5f('0x18c'),_0x4c5f('0x12d'),_0x4c5f('0x18d')));}if(_[_0x4c5f('0x3d')](_0x5aef37)&&_0x4c5f('0x18b')!==typeof _0x5aef37){return _0x50f750(msgResponse('[callProgressDetecting]',_0x4c5f('0x12d'),_0x4c5f('0x18e')));}switch(_0x5aef37[_0x4c5f('0xfa')]){case'0':_0x56ac7a[_0x4c5f('0x68')]+=0x1;_0xd470c3[_0x4c5f('0xad')]=0x0;_0xd470c3[_0x4c5f('0xe4')]=_0x4c5f('0x18f');_0x1964eb[_0x4c5f('0xcb')](_0xd470c3)[_0x4c5f('0xb4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1964eb['checkRetriveMax'](0x0,_0x151bcf,_0x56ac7a)){if(_0xd470c3[_0x4c5f('0x17e')]+_0xd470c3[_0x4c5f('0x17f')]+_0xd470c3[_0x4c5f('0x180')]>=_0x56ac7a[_0x4c5f('0x181')]){_0x1964eb['stateGlobal'](_0xd470c3,_0x5d1b54,_0x50f750,'reason\x200\x20no\x20such\x20number....');}else{_0x1964eb['createStateFinal'](_0xd470c3,_0x5d1b54,_0x50f750,_0x4c5f('0x190'));}}break;case'3':_0x56ac7a['outboundNoAnswerCallsDay']+=0x1;_0xd470c3[_0x4c5f('0xad')]=0x3;_0xd470c3[_0x4c5f('0xe4')]=_0x4c5f('0x191');_0xd470c3[_0x4c5f('0x180')]+=0x1;_0xd470c3[_0x4c5f('0x192')]+=0x1;_0x1964eb[_0x4c5f('0xcb')](_0xd470c3)[_0x4c5f('0xb4')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1964eb[_0x4c5f('0x17d')](0x3,_0x151bcf,_0x56ac7a)){if(_0xd470c3[_0x4c5f('0x180')]>=_0x56ac7a[_0x4c5f('0x182')]){_0x1964eb[_0x4c5f('0x193')](_0xd470c3,_0x5d1b54,_0x50f750,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1964eb['stateGlobal'](_0xd470c3,_0x5d1b54,_0x50f750,_0x4c5f('0x194'));}}break;case'5':_0x56ac7a[_0x4c5f('0x63')]+=0x1;_0xd470c3[_0x4c5f('0xad')]=0x5;_0xd470c3[_0x4c5f('0xe4')]=_0x4c5f('0x195');_0xd470c3[_0x4c5f('0x17e')]+=0x1;_0xd470c3['countglobal']+=0x1;_0x1964eb[_0x4c5f('0xcb')](_0xd470c3)[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x196')));if(_0x1964eb[_0x4c5f('0x17d')](0x5,_0x151bcf,_0x56ac7a)){if(_0xd470c3[_0x4c5f('0x17e')]>=_0x56ac7a[_0x4c5f('0x197')]){_0x1964eb['createStateFinal'](_0xd470c3,_0x5d1b54,_0x50f750,_0x4c5f('0x198'));}else{_0x1964eb[_0x4c5f('0x199')](_0xd470c3,_0x5d1b54,_0x50f750,_0x4c5f('0x198'));}}break;case'8':_0x56ac7a[_0x4c5f('0x64')]+=0x1;_0xd470c3[_0x4c5f('0xad')]=0x8;_0xd470c3[_0x4c5f('0xe4')]='Congestion';_0xd470c3[_0x4c5f('0x17f')]+=0x1;_0xd470c3[_0x4c5f('0x192')]+=0x1;_0x1964eb[_0x4c5f('0xcb')](_0xd470c3)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1964eb[_0x4c5f('0x17d')](0x8,_0x151bcf,_0x56ac7a)){if(_0xd470c3[_0x4c5f('0x17f')]>=_0x56ac7a[_0x4c5f('0x189')]){_0x1964eb[_0x4c5f('0x193')](_0xd470c3,_0x5d1b54,_0x50f750,'reason\x208\x20congestion');}else{_0x1964eb[_0x4c5f('0x199')](_0xd470c3,_0x5d1b54,_0x50f750,_0x4c5f('0x19a'));}}break;default:_0x56ac7a[_0x4c5f('0x6a')]+=0x1;_0xd470c3['state']=0xc;_0xd470c3[_0x4c5f('0xe4')]=_0x5aef37[_0x4c5f('0xfa')];_0x1964eb[_0x4c5f('0xcb')](_0xd470c3)[_0x4c5f('0xb4')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1964eb[_0x4c5f('0x17d')](_0x5aef37[_0x4c5f('0xfa')],_0x151bcf,_0x56ac7a)){if(_0xd470c3[_0x4c5f('0x17e')]+_0xd470c3[_0x4c5f('0x17f')]+_0xd470c3[_0x4c5f('0x180')]>=_0x56ac7a['dialGlobalMaxRetry']){_0x1964eb[_0x4c5f('0x199')](_0xd470c3,_0x5d1b54,_0x50f750,_0x5aef37[_0x4c5f('0xfa')]);}else{_0x1964eb[_0x4c5f('0x193')](_0xd470c3,_0x5d1b54,_0x50f750,_0x5aef37[_0x4c5f('0xfa')]);}}}});};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x199')]=function(_0x140564,_0x2796ff,_0x21398d,_0x161f52){var _0x26241e=new Final(_0x140564);_0x26241e['state']=0xf;_0x26241e['statedesc']=_0x4c5f('0x19b');this[_0x4c5f('0x193')](_0x26241e,_0x2796ff,_0x21398d,_0x161f52);};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x193')]=function(_0x3ddce4,_0x27b604,_0xee18ba,_0x5b3fef){this['moveContactManagedDialer'](_0x3ddce4)[_0x4c5f('0xbb')](function(_0x5b8050){return _0x27b604(msgResponse(_0x4c5f('0x18c'),_0x4c5f('0xd8'),_0x5b3fef));})[_0x4c5f('0xb4')](function(_0x277087){return _0xee18ba(msgResponse(_0x4c5f('0x19c'),_0x4c5f('0x12d'),_0x4c5f('0x19d')));});};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x9')]=function(_0x3dc34d){var _0x24b6ab=this;var _0x559858=_0x3dc34d[_0x4c5f('0x19e')]/0x64;var _0x160907=_0x3dc34d[_0x4c5f('0x66')]/(_0x3dc34d[_0x4c5f('0x66')]+_0x3dc34d[_0x4c5f('0xf5')]);var _0xa546e=Math[_0x4c5f('0x19f')](_0x3dc34d[_0x4c5f('0x74')]*(_0x3dc34d[_0x4c5f('0x1a0')]/0x64));var _0x4699ac=Math[_0x4c5f('0x19f')](_0x3dc34d[_0x4c5f('0x74')]*(_0x3dc34d['predictiveIntervalMinThreshold']/0x64));var _0x50cf1f=_0x3dc34d['available']+_0x3dc34d[_0x4c5f('0x57')];var _0x2012e9=Math[_0x4c5f('0x1a1')](_0x3dc34d[_0x4c5f('0x77')]*_0x3dc34d[_0x4c5f('0x79')]*_0x3dc34d[_0x4c5f('0x71')]*_0x3dc34d['predictiveIntervalMultiplicativeFactor']);if(_[_0x4c5f('0x3d')](_0x3dc34d[_0x4c5f('0x2a')])){if(!_[_0x4c5f('0x3d')](_0x3dc34d[_0x4c5f('0x29')])){_0x3dc34d[_0x4c5f('0x29')]=undefined;loggerPredictive[_0x4c5f('0x9b')]('[startMethodPredictive][StartProgressive]',_0x4c5f('0x1a2'));}if(!_[_0x4c5f('0x3d')](_0x3dc34d['handlePredictive'])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x4c5f('0x1a3'));clearInterval(_0x3dc34d[_0x4c5f('0x94')]);_0x3dc34d['handlePredictive']=undefined;}_0x3dc34d[_0x4c5f('0x2a')]=moment()[_0x4c5f('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4c5f('0x82')](_0x3dc34d[_0x4c5f('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x3dc34d['startProgressive']);this[_0x4c5f('0x13e')](_0x3dc34d,0x1);}else if(ifInterval(_0x3dc34d[_0x4c5f('0x1a4')],_0x3dc34d['startProgressive'])){this[_0x4c5f('0x13e')](_0x3dc34d,0x1);loggerPredictiveCalls[_0x4c5f('0x82')](_0x4c5f('0x1a5'),_0x3dc34d[_0x4c5f('0x2a')],_0x3dc34d['name']);_0x3dc34d[_0x4c5f('0x77')]=0x0;_0x3dc34d[_0x4c5f('0x70')]=0x0;}else if(_0x559858<_0x160907&&_0x3dc34d[_0x4c5f('0x1a6')]===_0x4c5f('0x1a7')){freeVariablesPredictive(_0x3dc34d);loggerPredictive['info'](_0x4c5f('0x1a8'),_0x4c5f('0x1a9'),_0x160907,_0x4c5f('0x2a'),_0x3dc34d['name']);}else if(_0x2012e9<_0x3dc34d[_0x4c5f('0x70')]&&_0x3dc34d[_0x4c5f('0x1a6')]===_0x4c5f('0x1a7')){freeVariablesPredictive(_0x3dc34d);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x4c5f('0x1aa'),_0x2012e9,'Drop\x20in\x20this\x20interval',_0x3dc34d[_0x4c5f('0x70')],_0x4c5f('0x2a'),_0x3dc34d[_0x4c5f('0x41')]);}else if(!ifInterval(_0x3dc34d['dialPredictiveInterval'],_0x3dc34d['startProgressive'])&&_[_0x4c5f('0x3d')](_0x3dc34d[_0x4c5f('0x29')])&&!_['isUndefined'](_0x3dc34d[_0x4c5f('0x2a')])){_0x3dc34d['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4c5f('0x82')](_0x3dc34d['name'],_0x4c5f('0x1ab'),_0x3dc34d[_0x4c5f('0x29')]);this[_0x4c5f('0xc1')](_0x3dc34d['dialPredictiveInterval'])['then'](this[_0x4c5f('0x1ac')](_0x3dc34d))[_0x4c5f('0xbb')](mergeDataErlangB(_0x3dc34d))['then'](this[_0x4c5f('0x1ad')](_0x3dc34d))[_0x4c5f('0xb4')](loggerCatchPredictive(_0x4c5f('0x1ae'),_0x3dc34d));}else if(!ifInterval(_0x3dc34d[_0x4c5f('0x1a4')],_0x3dc34d['startPredictive'])){_0x3dc34d[_0x4c5f('0x70')]=0x0;_0x3dc34d[_0x4c5f('0x29')]=moment()[_0x4c5f('0x7e')](_0x4c5f('0xfd'));loggerPredictive['info'](_0x3dc34d[_0x4c5f('0x41')],_0x4c5f('0x1af'),_0x3dc34d[_0x4c5f('0x29')]);clearInterval(_0x3dc34d[_0x4c5f('0x94')]);_0x3dc34d[_0x4c5f('0x94')]=undefined;this['averageHandleTime'](_0x3dc34d[_0x4c5f('0x1a4')])['then'](this['getDataPredictive'](_0x3dc34d))[_0x4c5f('0xbb')](mergeDataErlangB(_0x3dc34d))['then'](this[_0x4c5f('0x1ad')](_0x3dc34d))[_0x4c5f('0xb4')](loggerCatchPredictive(_0x4c5f('0x1b0'),_0x3dc34d));}else if(_0x3dc34d[_0x4c5f('0x74')]&&_0x50cf1f<_0x3dc34d['predictiveIntervalAvailable']-_0x4699ac){freeVariablesPredictive(_0x3dc34d);loggerPredictive[_0x4c5f('0x82')](_0x3dc34d['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x50cf1f,_0x4c5f('0x1b1'),_0x3dc34d['predictiveIntervalAvailable'],'-',_0x4699ac,'=',_0x3dc34d['predictiveIntervalAvailable']-_0x4699ac,')');}else if(_0x3dc34d[_0x4c5f('0x74')]&&_0x50cf1f>_0x3dc34d[_0x4c5f('0x74')]+_0xa546e){freeVariablesPredictive(_0x3dc34d);loggerPredictive['info'](_0x3dc34d['name'],_0x4c5f('0x1b2'),_0x50cf1f,')\x20are\x20more\x20than\x20threshold\x20(',_0x3dc34d['predictiveIntervalAvailable'],'+',_0xa546e,'=',_0x3dc34d['predictiveIntervalAvailable']+_0xa546e,')');}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x1ac')]=function(_0x399f8d){var _0x3a7086=this;return function(_0x3a8697){return new BPromise(function(_0x3e150b,_0x2cb4ee){_[_0x4c5f('0x91')](_0x399f8d,_0x3a8697[0x0]);if(checkGetDataPredictive(_0x3a8697[0x0])){var _0x14690d=_0x399f8d['predictiveIntervalAvailable']=_0x399f8d[_0x4c5f('0x57')]+_0x399f8d[_0x4c5f('0x52')];var _0x986e24=_0x399f8d[_0x4c5f('0x1a4')]*0x3c;var _0x4198f6=_0x3a8697[0x0][_0x4c5f('0x6c')]+_0x3a8697[0x0]['predictiveIntervalAvgHoldtime'];var _0x34507b=(_0x3a8697[0x0][_0x4c5f('0x6b')]+_0x3a8697[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3a8697[0x0][_0x4c5f('0x6d')])/_0x3a8697[0x0][_0x4c5f('0x75')];_0x399f8d['predictiveIntervalHitRate']=_0x34507b>0x0?_0x34507b:0x1;switch(_0x399f8d[_0x4c5f('0x1a6')]){case _0x4c5f('0x1a7'):var _0x595beb=_0x399f8d[_0x4c5f('0x19e')]/0x64;return _0x3a7086[_0x4c5f('0x1b3')](_0x14690d,_0x986e24,_0x4198f6,_0x34507b,_0x595beb)[_0x4c5f('0xbb')](function(_0x283de1){return _0x3e150b(_0x283de1);});case _0x4c5f('0x1b4'):var _0x46beaf=_0x399f8d[_0x4c5f('0x19e')]/0x64;return _0x3a7086[_0x4c5f('0x1b5')](_0x14690d,_0x986e24,_0x4198f6,_0x34507b,_0x46beaf)[_0x4c5f('0xbb')](function(_0x10b492){return _0x3e150b(_0x10b492);});default:return _0x2cb4ee(msgResponse(_0x4c5f('0x1b6'),_0x4c5f('0x12d'),'Unknown\x20Predictive'));}}else{return _0x2cb4ee(msgResponse(_0x4c5f('0x1b6'),_0x4c5f('0x12d'),_0x4c5f('0x1b7')));}});};};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x1b8')]=function(_0xb9f12d){var _0x3f7f42=this;return function(_0x47117d){return new BPromise(function(_0x2471a8,_0x515bb8){_[_0x4c5f('0x91')](_0xb9f12d,_0x47117d[0x0]);if(checkGetDataPredictive(_0x47117d[0x0])){loggerPredictive['info'](JSON['stringify'](_0x47117d[0x0]));if(_0xb9f12d[_0x4c5f('0x1a6')]===_0x4c5f('0x1a7')){return _0x3f7f42[_0x4c5f('0xc9')](_0xb9f12d['id'])[_0x4c5f('0xbb')](function(_0x18aa08){var _0x37290=_0xb9f12d[_0x4c5f('0x53')]-_0x18aa08[0x0]['outboundQueuePauses'];var _0x34be69=_0xb9f12d[_0x4c5f('0x1a4')]*0x3c;var _0x31e06c=_0x47117d[0x0][_0x4c5f('0x6c')]+_0x47117d[0x0][_0x4c5f('0x8a')];var _0x3bf1ba=(_0x47117d[0x0][_0x4c5f('0x6b')]+_0x47117d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x47117d[0x0][_0x4c5f('0x6d')])/_0x47117d[0x0][_0x4c5f('0x75')];var _0x3cb2fc=_0xb9f12d['dialPredictiveOptimizationPercentage']/0x64;_0xb9f12d[_0x4c5f('0x73')]=_0x18aa08[0x0][_0x4c5f('0x1b9')]||0x0;_0xb9f12d[_0x4c5f('0x71')]=_0x3bf1ba>0x0?_0x3bf1ba:0x1;return _0x3f7f42['abandonmentRate'](_0x37290,_0x34be69,_0x31e06c,_0x3bf1ba,_0x3cb2fc);})[_0x4c5f('0xbb')](function(_0x5dee86){return _0x2471a8(_0x5dee86);})[_0x4c5f('0xb4')](function(_0x491b5c){return _0x515bb8(msgResponse(_0x4c5f('0x1ba'),_0x4c5f('0x12d'),JSON[_0x4c5f('0x49')](_0x491b5c)));});}if(_0xb9f12d['dialPredictiveOptimization']===_0x4c5f('0x1b4')){return _0x3f7f42['getVoiceQueueRtPauses'](_0xb9f12d['id'])['then'](function(_0x4b5c18){var _0x4a56c5=_0xb9f12d[_0x4c5f('0x53')]-_0x4b5c18[0x0][_0x4c5f('0x1b9')];var _0xf6e316=_0xb9f12d[_0x4c5f('0x1a4')]*0x3c;var _0x2c0624=_0x47117d[0x0][_0x4c5f('0x6c')]+_0x47117d[0x0][_0x4c5f('0x8a')];var _0x1387e9=(_0x47117d[0x0][_0x4c5f('0x6b')]+_0x47117d[0x0][_0x4c5f('0x6e')]+_0x47117d[0x0][_0x4c5f('0x6d')])/_0x47117d[0x0][_0x4c5f('0x75')];var _0x1b9178=_0xb9f12d['dialPredictiveOptimizationPercentage']/0x64;_0xb9f12d['predictiveIntervalPauses']=_0x4b5c18[0x0]['outboundQueuePauses']||0x0;_0xb9f12d['predictiveIntervalHitRate']=_0x1387e9>0x0?_0x1387e9:0x1;return _0x3f7f42['busyFactor'](_0x4a56c5,_0xf6e316,_0x2c0624,_0x1387e9,_0x1b9178);})['then'](function(_0x4cd76a){return _0x2471a8(_0x4cd76a);})[_0x4c5f('0xb4')](function(_0x4c8395){return _0x515bb8(msgResponse(_0x4c5f('0x1ba'),_0x4c5f('0x12d'),JSON[_0x4c5f('0x49')](_0x4c8395)));});}}else{return _0x515bb8(msgResponse(_0x4c5f('0x1b6'),_0x4c5f('0x12d'),'check\x20failure'));}});};};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x1ad')]=function(_0x5c0613){var _0x14d551=this;return function(){var _0x3a1363=0x0;var _0x1bbf9a=Math[_0x4c5f('0x1a1')](_0x5c0613[_0x4c5f('0x78')]*0x3e8);if(_0x1bbf9a>0x0){_0x1bbf9a=_0x1bbf9a<0x64?0x64:_0x1bbf9a;loggerPredictive[_0x4c5f('0x82')](_0x5c0613[_0x4c5f('0x41')],_0x4c5f('0x1bb'),_0x1bbf9a,'milliseconds');_0x5c0613[_0x4c5f('0x94')]=setInterval(function(){_0x14d551[_0x4c5f('0x94')](_0x5c0613);loggerPredictiveCalls['info'](_0x4c5f('0x1bc'),_0x3a1363+=0x1);},_0x1bbf9a);}else{loggerPredictive[_0x4c5f('0x82')](_0x5c0613[_0x4c5f('0x41')],_0x4c5f('0x1bd'));}};};Dialer[_0x4c5f('0x1d')]['checkContactBlack']=function(_0x165833,_0x4879c9){var _0x2333a6=this;return function(_0x19037a){if(_[_0x4c5f('0x80')](_0x19037a)){if(_[_0x4c5f('0xb2')](_0x4879c9[_0x4c5f('0xd4')])||!_0x4879c9['recallme']){if(_0x165833[_0x4c5f('0x5e')]===_0x4c5f('0x8')){_0x165833[_0x4c5f('0x112')]=_[_0x4c5f('0x3d')](_0x165833[_0x4c5f('0x112')])?!![]:_0x165833[_0x4c5f('0x112')];var _0x16de0c=uuid['v4']();_0x2333a6[_0x4c5f('0xb1')][_0x16de0c]=new Action(_0x165833,_0x4879c9,_0x16de0c);loggerBooked[_0x4c5f('0x82')](_0x4c5f('0x1be'),_0x16de0c,'queueStatusComplete:\x20',JSON[_0x4c5f('0x49')](_0x165833['queueStatusComplete']),_0x4c5f('0x1bf'),_0x165833['name']);if(_0x165833['queueStatusComplete']){_0x165833[_0x4c5f('0x112')]=![];_0x2333a6[_0x4c5f('0x10f')][_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0xb5')]]=[];ami[_0x4c5f('0xb3')]({'actionid':_0x16de0c,'action':'queuestatus','queue':_0x165833[_0x4c5f('0x41')]})[_0x4c5f('0xb4')](function(_0x359136){_0x2333a6[_0x4c5f('0xb7')](_0x165833);_0x2333a6[_0x4c5f('0xc4')]({'active':![],'ContactId':_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0xd2')],'ListId':_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0xd3')],'VoiceQueueId':_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0xd5')]||undefined,'CampaignId':_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0x116')]||undefined})[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x1c0')));delete _0x2333a6[_0x4c5f('0xb1')][_0x16de0c];});}else{loggerBooked[_0x4c5f('0x82')](_0x4c5f('0x1c1'),JSON[_0x4c5f('0x49')](_0x165833[_0x4c5f('0x112')]),'Queue:\x20',_0x165833['name']);_0x2333a6[_0x4c5f('0xb7')](_0x165833);_0x2333a6[_0x4c5f('0xc4')]({'active':![],'ContactId':_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0xd2')],'ListId':_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0xd3')],'VoiceQueueId':_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0xd5')]||undefined,'CampaignId':_0x2333a6[_0x4c5f('0xb1')][_0x16de0c][_0x4c5f('0x116')]||undefined})[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x1c0')));delete _0x2333a6['actions'][_0x16de0c];}}else{return _0x2333a6['actionOriginate'](_0x165833,_0x4879c9);}}else{if(getDiff(_0x4879c9[_0x4c5f('0x1c2')])<_0x165833['dialRecallMeTimeout']*0x3c){_0x2333a6['preview']['run'](_0x4879c9['id'])[_0x4c5f('0x20')](function(){_0x2333a6[_0x4c5f('0xb7')](_0x165833);});}else{_0x165833[_0x4c5f('0x69')]+=0x1;_0x2333a6['updateOriginated'](_0x165833);if(_0x165833[_0x4c5f('0x1c3')]){_0x2333a6[_0x4c5f('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4879c9[_0x4c5f('0xd2')],'ListId':_0x4879c9['ListId'],'VoiceQueueId':_0x4879c9[_0x4c5f('0xd5')]||undefined,'CampaignId':_0x4879c9[_0x4c5f('0x116')]||undefined})[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x1c4')));_0x2333a6[_0x4c5f('0xcb')](createObjHistory(_0x165833,_0x4879c9,_0x4c5f('0x1c5'),0x17,_0x4c5f('0x1c6')))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0x1c7')));}else{_0x2333a6[_0x4c5f('0xd0')](createObjHistory(_0x165833,_0x4879c9,'RECALLFAILEDTIMEOUT',0x16,_0x4c5f('0x1c8')),_0x4c5f('0x1c9'),'[Originate][HistoryRecallClose]');}}}}else{_0x165833[_0x4c5f('0x1ca')]+=0x1;_0x2333a6['saveInDb'](createObjHistory(_0x165833,_0x4879c9,_0x4c5f('0x1cb'),0xd,_0x4c5f('0x1cc')),_0x4c5f('0x1cd'),_0x4c5f('0x1ce'));throw'inBlackList';}};};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x1cf')]=function(_0x497133){var _0x40548f=this;var _0xe5ab28=[];var _0x32ffc0=_0x497133['limitCalls']-_0x497133['originated']-_0x497133[_0x4c5f('0x1d0')];emitCampaignSummary(_0x497133);if(_0x32ffc0>0x0){if(_0x32ffc0>this['maxNumberOriginate']){_0x32ffc0=this[_0x4c5f('0x25')];}_0x497133['temp']+=_0x32ffc0;this['getContactDialerIvr'](_0x497133['id'],_0x32ffc0,_0x497133['dialOrderByScheduledAt'])[_0x4c5f('0xbb')](function(_0x53f165){_0x497133['temp']-=_0x32ffc0;_0x497133[_0x4c5f('0x1d0')]=_0x497133[_0x4c5f('0x1d0')]>0x0?_0x497133[_0x4c5f('0x1d0')]:0x0;if(!checkContactEmpty(_0x53f165)){_0x497133['message']=_0x4c5f('0x1d1');logger[_0x4c5f('0x82')](_0x4c5f('0x1d2')+_0x497133[_0x4c5f('0x41')]);}else{_0x497133[_0x4c5f('0x76')]+=_0x53f165[_0x4c5f('0x9e')];_0x497133['message']=_0x4c5f('0x1d3');for(var _0x4b25e7=0x0;_0x4b25e7<_0x53f165['length'];_0x4b25e7+=0x1){_0x497133[_0x4c5f('0x1d4')]+=0x1;if(_[_0x4c5f('0xb2')](_0x53f165[_0x4b25e7])||_['isNil'](_0x53f165[_0x4b25e7]['Contact'])||_[_0x4c5f('0xb2')](_0x53f165[_0x4b25e7][_0x4c5f('0x14e')][_0x4c5f('0x14f')])){_0x40548f['emptyContact'](_0x4c5f('0x1d5'),_0x497133,_0x53f165[_0x4b25e7]);}else{_0x40548f[_0x4c5f('0xbf')](_[_0x4c5f('0xd1')](_0x53f165[_0x4b25e7],[_0x4c5f('0x116'),_0x4c5f('0x1d6')]))['then'](_0x40548f[_0x4c5f('0x1d7')](_0x497133,_0x53f165[_0x4b25e7]))[_0x4c5f('0xb4')](_0x40548f[_0x4c5f('0x1d8')](_0x4c5f('0x1d9'),_0x497133));}}}})[_0x4c5f('0xb4')](loggerGetContactDialer(_0x4c5f('0x1da'),_0x497133,_0x32ffc0));}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x13e')]=function(_0x4c384a,_0xc1fd5c){var _0x5c8033=this;var _0x2957b6=[];var _0x4fc347=_0xc1fd5c>=0x1?_0xc1fd5c:0x1;var _0x28661e=[];if(_0x4c384a[_0x4c5f('0x5e')]===_0x4c5f('0x8')){_0x4fc347=0x1;}var _0x220b9a=Math[_0x4c5f('0x1a1')](_0x4c384a['available']*_0x4fc347)-_0x4c384a[_0x4c5f('0x76')]-_0x4c384a['temp'];emitVoiceQueueSummary(_0x4c384a);if(_0x4c384a[_0x4c5f('0x1db')]>0x0){var _0x8be794=_0x4c384a['dialLimitQueue']-_0x4c384a[_0x4c5f('0x76')]-_0x4c384a[_0x4c5f('0x57')]-_0x4c384a[_0x4c5f('0x1d0')]-_0x4c384a['pTalking'];if(_0x220b9a>_0x8be794){_0x220b9a=_0x8be794;}}if(_0x220b9a>0x0){if(_0x4c384a[_0x4c5f('0x5e')]===_0x4c5f('0x8')){_0x220b9a=0x1;}if(_0x220b9a>this[_0x4c5f('0x25')]){_0x220b9a=this[_0x4c5f('0x25')];}_0x4c384a[_0x4c5f('0x1d0')]+=_0x220b9a;for(var _0x1a14d2 in this[_0x4c5f('0x23')]){if(this[_0x4c5f('0x23')][_0x4c5f('0x9f')](_0x1a14d2)){if(this[_0x4c5f('0x23')][_0x1a14d2]['state']===_0x4c5f('0x1dc')&&this[_0x4c5f('0x23')][_0x1a14d2][_0x4c5f('0x10c')]==='reachable'){_0x2957b6['push'](this[_0x4c5f('0x23')][_0x1a14d2]['id']);}}}this['getContactDialer'](_0x4c384a['id'],_0x2957b6,_0x220b9a,_0x4c384a[_0x4c5f('0x1dd')])[_0x4c5f('0xbb')](function(_0x10f60d){_0x4c384a['temp']-=_0x220b9a;_0x4c384a[_0x4c5f('0x1d0')]=_0x4c384a['temp']>0x0?_0x4c384a[_0x4c5f('0x1d0')]:0x0;if(!checkContactEmpty(_0x10f60d)){_0x5c8033[_0x4c5f('0xb9')](_0x4c384a)[_0x4c5f('0xbb')](sendMessageReschedule(_0x4c384a))[_0x4c5f('0xb4')](loggerCatch('[countReScheduled]\x20'));}else{_0x4c384a[_0x4c5f('0x76')]+=_0x10f60d[_0x4c5f('0x9e')];_0x4c384a[_0x4c5f('0x3e')]=_0x4c384a[_0x4c5f('0x5e')]==='booked'?_0x4c5f('0x154'):_0x4c5f('0x1d3');for(var _0x2153ab=0x0;_0x2153ab<_0x10f60d[_0x4c5f('0x9e')];_0x2153ab+=0x1){if(_['isNil'](_0x10f60d[_0x2153ab])||_[_0x4c5f('0xb2')](_0x10f60d[_0x2153ab][_0x4c5f('0x14e')])||_[_0x4c5f('0xb2')](_0x10f60d[_0x2153ab][_0x4c5f('0x14e')][_0x4c5f('0x14f')])){_0x5c8033[_0x4c5f('0xcf')]('[actionOriginate]\x20',_0x4c384a,_0x10f60d[_0x2153ab]);}else{_0x5c8033['checkIsBlackList'](_['pick'](_0x10f60d[_0x2153ab],['VoiceQueueId',_0x4c5f('0x1d6')]))[_0x4c5f('0xbb')](_0x5c8033[_0x4c5f('0x1d7')](_0x4c384a,_0x10f60d[_0x2153ab]))[_0x4c5f('0xb4')](_0x5c8033[_0x4c5f('0x1d8')](_0x4c5f('0x1d5'),_0x4c384a));}}}})[_0x4c5f('0xb4')](loggerGetContactDialer(_0x4c5f('0x1de'),_0x4c384a,_0x220b9a));}};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x94')]=function(_0x6d26d0){var _0x4cc15c=this;if(_0x6d26d0[_0x4c5f('0x1db')]>0x0){var _0x1cbb41=_0x6d26d0[_0x4c5f('0x1db')]-_0x6d26d0[_0x4c5f('0x76')]-_0x6d26d0['talking'];if(_0x1cbb41>0x0){this[_0x4c5f('0x1df')](_0x6d26d0);}else{loggerPredictiveCalls[_0x4c5f('0x82')](_0x4c5f('0x1e0'));}}else{this[_0x4c5f('0x1df')](_0x6d26d0);}};Dialer['prototype'][_0x4c5f('0x1df')]=function(_0x3e74f1){var _0x65e5d9=this;var _0x58ba42=[];_0x3e74f1['originated']+=0x1;for(var _0x15a5ff in this[_0x4c5f('0x23')]){if(this['agents'][_0x4c5f('0x9f')](_0x15a5ff)){if(this[_0x4c5f('0x23')][_0x15a5ff][_0x4c5f('0xad')]===_0x4c5f('0x1dc')&&this['agents'][_0x15a5ff][_0x4c5f('0x10c')]===_0x4c5f('0xda')){_0x58ba42[_0x4c5f('0x110')](this[_0x4c5f('0x23')][_0x15a5ff]['id']);}}}this[_0x4c5f('0xc6')](_0x3e74f1['id'],_0x58ba42,0x1,_0x3e74f1[_0x4c5f('0x1dd')])['then'](function(_0x276e7){if(!checkContactEmpty(_0x276e7)){checkContactLowerLimitOriginate(_0x3e74f1,0x1,0x0);_0x65e5d9[_0x4c5f('0xb9')](_0x3e74f1)[_0x4c5f('0xbb')](sendMessageReschedule(_0x3e74f1))[_0x4c5f('0xb4')](loggerCatch(_0x4c5f('0xbc')));}else{_0x3e74f1['message']='RUNNING';if(_[_0x4c5f('0xb2')](_0x276e7[0x0])||_[_0x4c5f('0xb2')](_0x276e7[0x0][_0x4c5f('0x14e')])||_[_0x4c5f('0xb2')](_0x276e7[0x0][_0x4c5f('0x14e')][_0x4c5f('0x14f')])){_0x65e5d9[_0x4c5f('0xcf')]('[actionOriginate]\x20',_0x3e74f1,_0x276e7[0x0]);}else{_0x65e5d9['checkIsBlackList'](_['pick'](_0x276e7[0x0],[_0x4c5f('0xd5'),'Contact.phone']))[_0x4c5f('0xbb')](_0x65e5d9[_0x4c5f('0x1d7')](_0x3e74f1,_0x276e7[0x0]))[_0x4c5f('0xb4')](_0x65e5d9[_0x4c5f('0x1d8')]('[actionOriginatePredictive]\x20',_0x3e74f1));}}})[_0x4c5f('0xb4')](loggerGetContactDialer('[getContactDialerPredictive]',_0x3e74f1,0x1));emitVoiceQueueSummary(_0x3e74f1);};Dialer[_0x4c5f('0x1d')][_0x4c5f('0x1b3')]=function(_0x546132,_0x340308,_0x1b0ee2,_0x20f767,_0x32a9b3,_0x34eadc){loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x1e1'));loggerPredictive[_0x4c5f('0x82')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x546132);loggerPredictive['info'](_0x4c5f('0x1e2'),_0x340308);loggerPredictive['info'](_0x4c5f('0x1e3'),_0x1b0ee2);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x1e4'),_0x20f767);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x1e5'),_0x32a9b3);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x89'));return new BPromise(function(_0x5d7aeb,_0x2b92b6){if(_0x546132<=0x0||isNaN(_0x546132)){return _0x2b92b6(msgResponse(_0x4c5f('0x1e6'),'Error',_0x4c5f('0x1e7')+_0x546132));}if(_0x1b0ee2<=0x0||isNaN(_0x1b0ee2)){return _0x2b92b6(msgResponse(_0x4c5f('0x1e6'),_0x4c5f('0x48'),'Ts\x20=\x20'+_0x1b0ee2));}if(_0x20f767<=0x0||isNaN(_0x20f767)){return _0x2b92b6(msgResponse('[abandonmentRate]',_0x4c5f('0x48'),_0x4c5f('0x1e8')+_0x20f767));}if(_0x340308<=0x0||isNaN(_0x340308)){return _0x2b92b6(msgResponse(_0x4c5f('0x1e6'),_0x4c5f('0x48'),_0x4c5f('0x1e9')+_0x340308));}if(_0x32a9b3<=0x0||isNaN(_0x32a9b3)){return _0x2b92b6(msgResponse(_0x4c5f('0x1e6'),_0x4c5f('0x48'),_0x4c5f('0x1ea')+_0x32a9b3));}_0x34eadc=_0x34eadc||0x0;var _0x1a7e6a=0x1/_0x1b0ee2;var _0x5598af=0x0;var _0xb41d86=0x0;var _0x3e6c5e=0x0;var _0x498eb1=0x0;for(var _0x12e838=0x0;_0x3e6c5e<_0x32a9b3;_0x12e838+=0x1){_0xb41d86=_0x12e838/_0x340308;_0x5598af=(_0x20f767*_0xb41d86+_0x34eadc)/_0x1a7e6a;_0x3e6c5e=erlangb(_0x5598af,_0x546132);_0x498eb1=_0x5598af/_0x546132*(0x1-erlangb(_0x5598af,_0x546132));}return _0x5d7aeb({'erlangCalls':_0x12e838,'erlangCallToSecond':_0x340308/_0x12e838,'erlangAbandonmentRate':_0x3e6c5e,'erlangBusyFactor':_0x498eb1});});};Dialer['prototype'][_0x4c5f('0x1b5')]=function(_0x40a8cd,_0x5e1c6b,_0x1b7b42,_0x37850c,_0x57d5b4,_0x2cd7b6){loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x1eb'));loggerPredictive[_0x4c5f('0x82')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40a8cd);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x1e2'),_0x5e1c6b);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x1e3'),_0x1b7b42);loggerPredictive[_0x4c5f('0x82')](_0x4c5f('0x1e4'),_0x37850c);loggerPredictive[_0x4c5f('0x82')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57d5b4);loggerPredictive['info'](_0x4c5f('0x89'));return new BPromise(function(_0x24f42b,_0x73a817){if(_0x40a8cd<=0x0||isNaN(_0x40a8cd)){return _0x73a817(msgResponse('[busyFactor]',_0x4c5f('0x48'),_0x4c5f('0x1e7')+_0x40a8cd));}if(_0x1b7b42<=0x0||isNaN(_0x1b7b42)){return _0x73a817(msgResponse('[busyFactor]',_0x4c5f('0x48'),_0x4c5f('0x1ec')+_0x1b7b42));}if(_0x37850c<=0x0||isNaN(_0x37850c)){return _0x73a817(msgResponse(_0x4c5f('0x1ed'),_0x4c5f('0x48'),_0x4c5f('0x1e8')+_0x37850c));}if(_0x5e1c6b<=0x0||isNaN(_0x5e1c6b)){return _0x73a817(msgResponse(_0x4c5f('0x1ed'),_0x4c5f('0x48'),_0x4c5f('0x1e9')+_0x5e1c6b));}if(_0x57d5b4<=0x0||isNaN(_0x57d5b4)){return _0x73a817(msgResponse(_0x4c5f('0x1ed'),'Error',_0x4c5f('0x1ee')+_0x57d5b4));}_0x2cd7b6=_0x2cd7b6||0x0;var _0x2f5cef=0x1/_0x1b7b42;var _0x398679=0x0;var _0x4ccc68=0x0;var _0x4e9f76=0x0;var _0x5d9fd5=0x0;for(var _0x65fd42=0x0;_0x5d9fd5<_0x57d5b4;_0x65fd42+=0x1){_0x4ccc68=_0x65fd42/_0x5e1c6b;_0x398679=(_0x37850c*_0x4ccc68+_0x2cd7b6)/_0x2f5cef;_0x4e9f76=erlangb(_0x398679,_0x40a8cd);_0x5d9fd5=_0x398679/_0x40a8cd*(0x1-erlangb(_0x398679,_0x40a8cd));}return _0x24f42b({'erlangCalls':_0x65fd42,'erlangCallToSecond':_0x5e1c6b/_0x65fd42,'erlangAbandonmentRate':_0x4e9f76,'erlangBusyFactor':_0x5d9fd5});});};module[_0x4c5f('0x1ef')]=Dialer; \ No newline at end of file +var _0xabbb=['countbusyretry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','outboundBusyCallsDay','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalAnsweredCalls','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','RUNNING','[actionOriginate]\x20','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[busyFactor]','Umin\x20=\x20','util','lodash','uuid','md5','ioredis','../../../config/environment/','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','bind','custom:queuesummary','hangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','milliseconds','diff','seconds','emit','outbound','answered','available','loggedIn','sumBillable','sumDuration','type','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','then','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','Success','SIP/%s','status','reachable','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','outboundAnswerAgiCallsDay','Machine','amd','[syncMachine][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','Unknow','reason','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','syncQueueCallerAbandon','droptime','responsetime','predictiveIntervalDroppedCallsTimeout','TIMEOUT','outboundDropCallsDayCallersExit','CALLEREXIT','strategy','actionid','agents','stateinterface','locked','queueBooked','paused','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','VoiceQueueId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ifTime','Intervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','push','command','iftime\x20%s,%s','content','indexOf','true','timezones','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','dialMethod','progressive','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','checkIfTime','checkIfTimeIntervals','dialTimezone','checkDialMethod','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','object','originate','Contact','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','substring','dialCutDigit','phone','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','isSuccess','response','[callProgressDetecting]\x20','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry'];(function(_0x3b9c0a,_0x24b4f5){var _0x39258f=function(_0x5374e3){while(--_0x5374e3){_0x3b9c0a['push'](_0x3b9c0a['shift']());}};_0x39258f(++_0x24b4f5);}(_0xabbb,0x68));var _0xbabb=function(_0x16c8fa,_0xf108a){_0x16c8fa=_0x16c8fa-0x0;var _0x39ae2c=_0xabbb[_0x16c8fa];return _0x39ae2c;};'use strict';var util=require(_0xbabb('0x0'));var _=require(_0xbabb('0x1'));var BPromise=require('bluebird');var uuid=require(_0xbabb('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0xbabb('0x3'));var Redis=require(_0xbabb('0x4'));var config=require(_0xbabb('0x5'));var logger=require('../../../config/logger')(_0xbabb('0x6'));var loggerBooked=require('../../../config/logger')(_0xbabb('0x7'));var loggerPredictive=require(_0xbabb('0x8'))(_0xbabb('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xbabb('0xa'));var loggerSyncQueueSummary=require(_0xbabb('0x8'))(_0xbabb('0xb'));var ami=require(_0xbabb('0xc'));config[_0xbabb('0xd')]=_[_0xbabb('0xe')](config[_0xbabb('0xd')],{'host':_0xbabb('0xf'),'port':0x18eb});var io=require(_0xbabb('0x10'))(new Redis(config[_0xbabb('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xbabb('0x11'));var cmHopperHistory=require(_0xbabb('0x12'));var cmHopperBlack=require(_0xbabb('0x13'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xbabb('0x14'));var History=require('./history');var Final=require(_0xbabb('0x15'));var AgentComplete=require(_0xbabb('0x16'));var QueueCallerAbandon=require(_0xbabb('0x17'));var Hangup=require(_0xbabb('0x18'));var ipAgi=process[_0xbabb('0x19')][_0xbabb('0x1a')]||_0xbabb('0x1b');var strategy={'rrmemory':_0xbabb('0x1c'),'roundrobin':_0xbabb('0x1d')};var Sequence=function(){};Sequence[_0xbabb('0x1e')]['enqueue']=function(_0x233b62){this[_0xbabb('0x1f')]=this[_0xbabb('0x1f')]?this[_0xbabb('0x1f')][_0xbabb('0x20')](_0x233b62):_0x233b62();};function Dialer(_0xbaaed4,_0x180f9a){this[_0xbabb('0x21')]=new Sequence();this[_0xbabb('0x22')]=_0x180f9a;this[_0xbabb('0x23')]=_0xbaaed4[_0xbabb('0x23')];this[_0xbabb('0x24')]=_0xbaaed4[_0xbabb('0x24')];this['agents']=_0xbaaed4['agents'];this['trunks']=_0xbaaed4[_0xbabb('0x25')];this[_0xbabb('0x26')]=config['maxNumberOriginate']||0x2;this[_0xbabb('0x27')]={};this[_0xbabb('0x28')]={};this[_0xbabb('0x29')]={};this[_0xbabb('0x2a')]={};this[_0xbabb('0x2b')]={};this[_0xbabb('0x2c')]={};this[_0xbabb('0x2d')]={};this[_0xbabb('0x2e')]={};this['queueBooked']={};this[_0xbabb('0x2f')]={};ami['on'](_0xbabb('0x30'),this[_0xbabb('0x31')]['bind'](this));ami['on'](_0xbabb('0x32'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xbabb('0x33'),this[_0xbabb('0x34')]['bind'](this));ami['on'](_0xbabb('0x35'),this[_0xbabb('0x36')][_0xbabb('0x37')](this));ami['on'](_0xbabb('0x38'),this[_0xbabb('0xb')]['bind'](this));ami['on'](_0xbabb('0x39'),this['syncHangup'][_0xbabb('0x37')](this));ami['on'](_0xbabb('0x3a'),this[_0xbabb('0x3b')][_0xbabb('0x37')](this));ami['on'](_0xbabb('0x3c'),this[_0xbabb('0x3d')]['bind'](this));ami['on']('queuemember',this[_0xbabb('0x3e')][_0xbabb('0x37')](this));ami['on'](_0xbabb('0x3f'),this[_0xbabb('0x40')][_0xbabb('0x37')](this));this['loopCampaigns']();this[_0xbabb('0x41')]();}function isNotNull(_0xfef322){return _0xfef322!==null&&!_[_0xbabb('0x42')](_0xfef322);}function checkIsLoggedIn(_0x3fab8a,_0x4e35ac){return function(){if(_0x4e35ac<=0x0){_0x3fab8a[_0xbabb('0x43')]=_0xbabb('0x44');throw _0x3fab8a[_0xbabb('0x45')]+_0xbabb('0x46');}};}function isActive(_0x4471d){return _0x4471d;}function checkIsActive(_0x3addbe,_0x4511eb){return function(){if(!isActive(_0x4511eb)){_0x3addbe[_0xbabb('0x43')]=_0xbabb('0x47');throw _0x3addbe[_0xbabb('0x45')]+_0xbabb('0x48');}};}function checkInterval(_0x28a328){return function(){if(!isNotNull(_0x28a328[_0xbabb('0x49')])){_0x28a328[_0xbabb('0x43')]=_0xbabb('0x4a');throw _0x28a328[_0xbabb('0x45')]+_0xbabb('0x4b');}if(!isNotNull(_0x28a328['Interval']['Intervals'])){_0x28a328['message']='INTERVAL_IS_NULL';throw _0x28a328[_0xbabb('0x45')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xbabb('0x4c')](_0x28a328[_0xbabb('0x49')]['Intervals']))){_0x28a328[_0xbabb('0x43')]='INTERVAL_IS_NULL';throw _0x28a328[_0xbabb('0x45')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x385006,_0x115f03,_0x3a1e70){return{'action':_0x385006,'response':_0x115f03,'message':_0x3a1e70,'stack':_0x3a1e70};}function myreject(_0x37eb01){return function(_0x435a99){return _0x37eb01(msgResponse(_0xbabb('0x4d'),'Error',JSON['stringify'](_0x435a99)));};}function getSeconds(_0x179cca,_0xd423d9){var _0x9c67be=moment(_0x179cca)[_0xbabb('0x4e')](0x0);var _0x2c5569=moment(_0xd423d9)['milliseconds'](0x0);return _0x9c67be[_0xbabb('0x4f')](_0x2c5569,_0xbabb('0x50'));}function emit(_0x3300a9,_0x342427,_0x2d0f46){io['to'](_0x3300a9)[_0xbabb('0x51')](_0x342427,_0x2d0f46);}function emitVoiceQueueSummary(_0x40e7fe){if(_0x40e7fe['type']===_0xbabb('0x52')){var _0xcf8cad={'id':_0x40e7fe['id'],'name':_0x40e7fe['name'],'strategy':_0x40e7fe['strategy'],'answered':_0x40e7fe[_0xbabb('0x53')],'available':_0x40e7fe[_0xbabb('0x54')],'loggedIn':_0x40e7fe[_0xbabb('0x55')],'pTalking':_0x40e7fe['pTalking'],'sumBillable':_0x40e7fe[_0xbabb('0x56')],'sumDuration':_0x40e7fe[_0xbabb('0x57')],'sumHoldTime':_0x40e7fe['sumHoldTime']||0x0,'talking':_0x40e7fe['talking'],'total':_0x40e7fe['total'],'type':_0x40e7fe[_0xbabb('0x58')],'unmanaged':_0x40e7fe['unmanaged'],'abandoned':_0x40e7fe['abandoned'],'waiting':_0x40e7fe[_0xbabb('0x59')],'loggedInDb':_0x40e7fe[_0xbabb('0x5a')],'dialActive':_0x40e7fe[_0xbabb('0x5b')],'dialMethod':_0x40e7fe['dialMethod'],'dialOriginateCallerIdName':_0x40e7fe[_0xbabb('0x5c')],'dialOriginateCallerIdNumber':_0x40e7fe[_0xbabb('0x5d')],'dialOriginateTimeout':_0x40e7fe[_0xbabb('0x5e')],'dialPrefix':_0x40e7fe[_0xbabb('0x5f')],'outboundAnswerAgiCallsDay':_0x40e7fe['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x40e7fe[_0xbabb('0x60')],'outboundBlacklistCallsDay':_0x40e7fe[_0xbabb('0x61')],'outboundBusyCallsDay':_0x40e7fe['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x40e7fe[_0xbabb('0x62')],'outboundDropCallsDayACS':_0x40e7fe[_0xbabb('0x63')],'outboundDropCallsDayCallersExit':_0x40e7fe['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x40e7fe[_0xbabb('0x64')],'outboundNoAnswerCallsDay':_0x40e7fe['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x40e7fe['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x40e7fe['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x40e7fe[_0xbabb('0x65')],'outboundRejectCallsDay':_0x40e7fe[_0xbabb('0x66')],'outboundUnknownCallsDay':_0x40e7fe['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x40e7fe['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x40e7fe[_0xbabb('0x67')],'predictiveIntervalAvgTalktime':_0x40e7fe[_0xbabb('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x40e7fe[_0xbabb('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x40e7fe['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x40e7fe['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x40e7fe[_0xbabb('0x6a')],'predictiveIntervalHitRate':_0x40e7fe['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x40e7fe[_0xbabb('0x6b')],'predictiveIntervalPauses':_0x40e7fe[_0xbabb('0x6c')],'predictiveIntervalAvailable':_0x40e7fe[_0xbabb('0x6d')],'predictiveIntervalTotalCalls':_0x40e7fe['predictiveIntervalTotalCalls'],'message':_0x40e7fe[_0xbabb('0x43')],'originated':_0x40e7fe[_0xbabb('0x6e')],'erlangCalls':_0x40e7fe[_0xbabb('0x6f')],'erlangCallToSecond':_0x40e7fe[_0xbabb('0x70')],'erlangAbandonmentRate':_0x40e7fe[_0xbabb('0x71')],'erlangBusyFactor':_0x40e7fe[_0xbabb('0x72')],'startPredictive':_0x40e7fe[_0xbabb('0x2c')],'startProgressive':_0x40e7fe[_0xbabb('0x2d')]};if(_0x40e7fe[_0xbabb('0x73')]){_0xcf8cad[_0xbabb('0x73')]={'id':_0x40e7fe[_0xbabb('0x73')]['id'],'name':_0x40e7fe['Trunk'][_0xbabb('0x45')],'active':_0x40e7fe[_0xbabb('0x73')][_0xbabb('0x74')],'callerid':_0x40e7fe['Trunk'][_0xbabb('0x75')]};}if(_0x40e7fe[_0xbabb('0x49')]){_0xcf8cad[_0xbabb('0x49')]={'id':_0x40e7fe[_0xbabb('0x49')]['id'],'name':_0x40e7fe[_0xbabb('0x49')][_0xbabb('0x45')]};}var _0x2d10ad=md5(JSON[_0xbabb('0x76')](_0xcf8cad));if(_0x40e7fe[_0xbabb('0x3')]!==_0x2d10ad){_0x40e7fe[_0xbabb('0x3')]=_0x2d10ad;emit(util[_0xbabb('0x77')]('voice:queue:%s',_0xcf8cad[_0xbabb('0x45')]),_0xbabb('0x78'),_0xcf8cad);}}}function emitCampaignSummary(_0x2d42a2){if(_0x2d42a2['type']===_0xbabb('0x79')){emit(util[_0xbabb('0x77')]('campaign:ivr:%s',_0x2d42a2[_0xbabb('0x45')]),_0xbabb('0x7a'),_0x2d42a2);}}function checkGetDataPredictive(_0x46a4a4){if(isNotNull(_0x46a4a4)){if(!_[_0xbabb('0x4c')](_0x46a4a4)){loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x7c'));loggerPredictive[_0xbabb('0x7b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46a4a4[_0xbabb('0x7d')]);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x7e'),_0x46a4a4['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x7f'),_0x46a4a4['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xbabb('0x7b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46a4a4[_0xbabb('0x69')]);loggerPredictive['info'](_0xbabb('0x80'),_0x46a4a4[_0xbabb('0x67')]);loggerPredictive['info'](_0xbabb('0x81'),_0x46a4a4[_0xbabb('0x68')]);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x82'));if(_0x46a4a4['predictiveIntervalTotalCalls']>0x0){if(!_[_0xbabb('0x42')](_0x46a4a4['predictiveIntervalAvgTalktime'])&&_0x46a4a4[_0xbabb('0x68')]>0x0){return!![];}else{loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x83'));}if(!_['isUndefined'](_0x46a4a4[_0xbabb('0x67')])&&_0x46a4a4['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0xbabb('0x7b')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x84'));}}else{loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x85'));}}else{loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x85'));}return![];}function mergeDataErlangB(_0x5f54a1){return function(_0x158428){loggerPredictive['info'](_0xbabb('0x86'));loggerPredictive['info'](_0xbabb('0x87'),_0x158428[_0xbabb('0x6f')]);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x88'),_0x158428[_0xbabb('0x70')]);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x89'),_0x158428[_0xbabb('0x71')]);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x8a'),_0x158428['erlangBusyFactor']);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x89'),_0x158428[_0xbabb('0x71')]);loggerPredictive[_0xbabb('0x7b')]('---------------------------');_[_0xbabb('0x8b')](_0x5f54a1,_0x158428);};}function getDiff(_0x4d64ee){var _0x29af43=moment()[_0xbabb('0x4e')](0x0);var _0x3edad5=moment(_0x4d64ee)['milliseconds'](0x0);return _0x29af43[_0xbabb('0x4f')](_0x3edad5,_0xbabb('0x50'));}function ifInterval(_0x9bb6,_0xe5ee0d){if(_['isUndefined'](_0xe5ee0d)){return![];}if(getDiff(_0xe5ee0d)<_0x9bb6*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x138a32){if(isNotNull(_0x138a32)){if(!_['isUndefined'](_0x138a32[_0xbabb('0x2d')])){_0x138a32['startProgressive']=undefined;loggerPredictive[_0xbabb('0x7b')](_0x138a32[_0xbabb('0x45')],_0xbabb('0x8c'));}if(!_[_0xbabb('0x42')](_0x138a32[_0xbabb('0x2c')])){_0x138a32[_0xbabb('0x2c')]=undefined;loggerPredictive[_0xbabb('0x7b')](_0x138a32['name'],_0xbabb('0x8d'));}if(!_[_0xbabb('0x42')](_0x138a32[_0xbabb('0x8e')])){clearInterval(_0x138a32[_0xbabb('0x8e')]);_0x138a32['handlePredictive']=undefined;loggerPredictive[_0xbabb('0x7b')](_0x138a32[_0xbabb('0x45')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1c6c6b,_0x43e086){if(_0x43e086===0x0){return 0x0;}var _0x4cc9b5=0x1;for(var _0x30f7d1=0x1;_0x30f7d1<=_0x43e086;_0x30f7d1+=0x1){_0x4cc9b5=0x1+_0x4cc9b5*_0x30f7d1/_0x1c6c6b;}return 0x1/_0x4cc9b5;}function isVoiceQueueOutbound(_0x50837c){return _0x50837c===_0xbabb('0x52');}function isNotPreview(_0x50b0b9){return _0x50b0b9!=='preview';}function isCampaignIvr(_0x3c578c){return _0x3c578c===_0xbabb('0x79');}function getCallerId(_0x24c62d,_0x1969df,_0x474949){if(!_[_0xbabb('0x42')](_0x474949)&&'string'===typeof _0x474949&&!_[_0xbabb('0x4c')](_0x474949)){if(!_[_0xbabb('0x42')](_0x1969df)&&_0xbabb('0x8f')===typeof _0x1969df&&!_[_0xbabb('0x4c')](_0x1969df)){return util[_0xbabb('0x77')](_0xbabb('0x90'),_0x1969df,_0x474949);}return util['format']('\x22%s\x22\x20<%s>',_0x474949,_0x474949);}if(!_[_0xbabb('0x42')](_0x24c62d)&&_0xbabb('0x8f')===typeof _0x24c62d&&!_['isEmpty'](_0x24c62d)){return _0x24c62d;}return _0xbabb('0x91');}function loggerCatchQueueSummary(_0x53d878,_0x10ab88){return function(_0x4f6554){freeVariablesPredictive(_0x10ab88);emitVoiceQueueSummary(_0x10ab88);emitCampaignSummary(_0x10ab88);loggerSyncQueueSummary[_0xbabb('0x92')](_0x53d878,util['inspect'](_0x4f6554,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x766a5d,_0x3ba468){return function(_0x170c63){loggerPredictive[_0xbabb('0x92')](_0x3ba468[_0xbabb('0x45')],_0x766a5d);loggerPredictive[_0xbabb('0x92')](_0x170c63[_0xbabb('0x93')]);freeVariablesPredictive(_0x3ba468);};}function loggerCatch(_0x550b79){return function(_0x3d7ccb){logger[_0xbabb('0x92')](_0x550b79,util[_0xbabb('0x94')](_0x3d7ccb,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2b8caf){return _0x2b8caf&&!_['isUndefined'](_0x2b8caf)&&_0x2b8caf['length']>0x0;}function decremetOriginate(_0x42f705){if(!_[_0xbabb('0x42')](_0x42f705)&&_0x42f705!==null){if(_0x42f705[_0xbabb('0x95')](_0xbabb('0x6e'))){if(_0x42f705[_0xbabb('0x6e')]>0x0){_0x42f705[_0xbabb('0x6e')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0xbabb('0x96'));}}function checkContactLowerLimitOriginate(_0x1d98bf,_0x258197,_0x55bbbd){if(_0x258197>_0x55bbbd){for(var _0x13046d=0x0;_0x13046d<_0x258197-_0x55bbbd;_0x13046d+=0x1){decremetOriginate(_0x1d98bf);}}}function loggerGetContactDialer(_0x40b902,_0x403e96,_0x2c4811){return function(_0x30a7ae){checkContactLowerLimitOriginate(_0x403e96,_0x2c4811,0x0);logger[_0xbabb('0x92')](_0x40b902,util[_0xbabb('0x94')](_0x30a7ae,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x45699e){return function(_0xc874c5){if(isNotNull(_0xc874c5)&&isNotNull(_0xc874c5[0x0])){if(_0xc874c5[0x0][_0xbabb('0x97')]>0x0){_0x45699e[_0xbabb('0x43')]=_0xbabb('0x98');logger[_0xbabb('0x7b')](_0xbabb('0x99')+_0x45699e['name'],_0xc874c5[0x0][_0xbabb('0x97')],_0xbabb('0x9a'));}else{_0x45699e['message']='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xbabb('0x9b')+_0x45699e[_0xbabb('0x45')]);}}};}function notSendMessagesQueue(_0xfcda9b){if(_0xfcda9b[_0xbabb('0x9c')]){freeVariablesPredictive(_0xfcda9b);if(_0xfcda9b['originated']===0x0&&_0xfcda9b[_0xbabb('0x9d')]===0x0&&_0xfcda9b[_0xbabb('0x59')]===0x0&&(_0xfcda9b[_0xbabb('0x9e')]||0x0)===0x0){_0xfcda9b['sendMessageOneNotActive']=![];_0xfcda9b['available']=0x0;_0xfcda9b[_0xbabb('0x43')]=_0xbabb('0x47');loggerSyncQueueSummary['error'](_0xbabb('0x9f'),_0xfcda9b[_0xbabb('0x45')],'is\x20not\x20active');}else{_0xfcda9b[_0xbabb('0x43')]=_0xbabb('0xa0');loggerSyncQueueSummary[_0xbabb('0x92')](_0xbabb('0x9f'),_0xfcda9b[_0xbabb('0x45')],_0xbabb('0xa1'));}emitVoiceQueueSummary(_0xfcda9b);}}function notSendMessagesCampaign(_0x1f909e){if(_0x1f909e[_0xbabb('0x9c')]){if(_0x1f909e['originated']===0x0){_0x1f909e[_0xbabb('0x9c')]=![];_0x1f909e[_0xbabb('0x43')]=_0xbabb('0x47');loggerSyncQueueSummary[_0xbabb('0x92')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1f909e[_0xbabb('0x45')],_0xbabb('0xa2'));}else{_0x1f909e[_0xbabb('0x43')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xbabb('0xa3'),_0x1f909e[_0xbabb('0x45')],_0xbabb('0xa1'));}emitCampaignSummary(_0x1f909e);}}function createObjHistory(_0x3a7dd9,_0x4ecb6a,_0x5f4787,_0x18ccad,_0x2f1eec){_0x3a7dd9[_0xbabb('0x43')]=_0x5f4787;var _0x150f20=new Action(_0x3a7dd9,_0x4ecb6a);var _0x26fadc=new History(_0x150f20);_0x26fadc[_0xbabb('0xa4')]=_0x18ccad;_0x26fadc[_0xbabb('0xa5')]=_0x2f1eec;_0x26fadc[_0xbabb('0xa6')]=_0x150f20[_0xbabb('0xa7')];return _0x26fadc;}Dialer['prototype'][_0xbabb('0x41')]=function(){var _0x3ae8af=this;setInterval(function(){_0x3ae8af[_0xbabb('0xa8')](_0x3ae8af[_0xbabb('0x2a')],_0xbabb('0xa9'));_0x3ae8af[_0xbabb('0xa8')](_0x3ae8af[_0xbabb('0x28')],_0xbabb('0xaa'));},0x32c8);};Dialer[_0xbabb('0x1e')]['clearZombieChannels']=function(_0xc25540,_0x21acf0){var _0x4cf736=this;for(var _0x343d62 in _0xc25540){if(_0xc25540[_0xbabb('0x95')](_0x343d62)){this['sequence']['enqueue'](function(){if(!_[_0xbabb('0xab')](_0xc25540[_0x343d62])){return ami[_0xbabb('0xac')]({'action':'status','channel':_0xc25540[_0x343d62][_0xbabb('0xad')]})[_0xbabb('0xae')](function(_0xd05a99){if(_0xd05a99[_0xbabb('0x43')]===_0xbabb('0xaf')){setTimeout(function(){if(_0xc25540[_0x343d62]&&_0xc25540[_0x343d62][_0xbabb('0x58')]!=='ivr'){_0x4cf736['updateOriginated'](_0x4cf736[_0xbabb('0x23')][_0xc25540[_0x343d62][_0xbabb('0xb0')]]);logger[_0xbabb('0x92')](_0xbabb('0xb1'),_0x21acf0,_0x343d62,_0xc25540[_0x343d62]['queue']);delete _0xc25540[_0x343d62];}if(_0xc25540[_0x343d62]&&_0xc25540[_0x343d62][_0xbabb('0x58')]===_0xbabb('0x79')){_0x4cf736[_0xbabb('0xb2')](_0x4cf736[_0xbabb('0x24')][_0xc25540[_0x343d62]['queue']]);logger['error'](_0xbabb('0xb3'),_0x21acf0,_0x343d62,_0xc25540[_0x343d62][_0xbabb('0xb0')]);delete _0xc25540[_0x343d62];}},0x2328);}});}});}}};Dialer['prototype'][_0xbabb('0xb4')]=function(_0x4409c5){return BPromise[_0xbabb('0xb5')]()['then'](cmHopper[_0xbabb('0xb4')](_0x4409c5))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xb6')));};Dialer[_0xbabb('0x1e')][_0xbabb('0xb7')]=function(_0x2e30d6){return BPromise[_0xbabb('0xb5')]()['then'](cmHopperBlack[_0xbabb('0xb7')](_0x2e30d6))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xb8')));};Dialer[_0xbabb('0x1e')][_0xbabb('0xb9')]=function(_0x20d639){return BPromise[_0xbabb('0xb5')]()[_0xbabb('0xba')](cmHopperBlack['checkIsBlackListIvr'](_0x20d639))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xbb')));};Dialer['prototype'][_0xbabb('0xbc')]=function(_0xca5d1e){return BPromise[_0xbabb('0xb5')]()[_0xbabb('0xba')](cmHopperHistory['avgHandleTime'](_0xca5d1e))['catch'](loggerCatch(_0xbabb('0xbd')));};Dialer[_0xbabb('0x1e')]['rescheduleContact']=function(_0x28d504){return BPromise[_0xbabb('0xb5')]()[_0xbabb('0xba')](cmHopper[_0xbabb('0xbe')](_0x28d504))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xbf')));};Dialer['prototype'][_0xbabb('0xc0')]=function(_0xb24f1,_0x4d17a6,_0x35b78e,_0x53764e){return BPromise[_0xbabb('0xb5')]()[_0xbabb('0xba')](cmHopper[_0xbabb('0xc0')](_0xb24f1,_0x4d17a6,_0x35b78e,_0x53764e))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xc1')));};Dialer[_0xbabb('0x1e')][_0xbabb('0xc2')]=function(_0x48fe25,_0x5b12ba,_0x26d357){return BPromise[_0xbabb('0xb5')]()['then'](cmHopper[_0xbabb('0xc2')](_0x48fe25,_0x5b12ba,_0x26d357))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xc1')));};Dialer[_0xbabb('0x1e')][_0xbabb('0xc3')]=function(_0x3ab0c0){return BPromise[_0xbabb('0xb5')]()['then'](voiceQueueRt[_0xbabb('0xc3')](_0x3ab0c0))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xc4')));};Dialer[_0xbabb('0x1e')][_0xbabb('0xc5')]=function(_0x5722d1){return BPromise[_0xbabb('0xb5')]()[_0xbabb('0xba')](cmHopper['moveContactManagedDialer'](_0x5722d1))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xc6')));};Dialer[_0xbabb('0x1e')][_0xbabb('0xc7')]=function(_0x26451a){return BPromise['resolve']()['then'](cmHopperHistory[_0xbabb('0xc7')](_0x26451a))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xc8')));};Dialer[_0xbabb('0x1e')][_0xbabb('0xb2')]=function(_0x4b5ec2){if(!_['isUndefined'](_0x4b5ec2)&&_0x4b5ec2!==null){if(_0x4b5ec2[_0xbabb('0x95')](_0xbabb('0x6e'))){if(_0x4b5ec2['originated']>0x0){_0x4b5ec2['originated']-=0x1;}else{logger[_0xbabb('0x92')](_0xbabb('0xc9'));}}}else{logger[_0xbabb('0x92')](_0xbabb('0xca'));}};Dialer['prototype'][_0xbabb('0xcb')]=function(_0x163d27,_0xc86940){var _0x15dc93=this;return function(_0x531ad6){_0x15dc93['updateOriginated'](_0xc86940);logger['error'](_0x163d27,util[_0xbabb('0x94')](_0x531ad6,{'showHidden':![],'depth':null}));};};Dialer[_0xbabb('0x1e')][_0xbabb('0xcc')]=function(_0x735cf2,_0x2d1f43,_0xbad20d){var _0x1f4818={'state':0x19,'statedesc':_0xbabb('0xcd')};this[_0xbabb('0xb2')](_0x2d1f43);this[_0xbabb('0xce')](_['merge'](_0x1f4818,_[_0xbabb('0xcf')](_0xbad20d,[_0xbabb('0xd0'),_0xbabb('0xd1'),_0xbabb('0xd2'),'VoiceQueueId',_0xbabb('0xd3')])),_0xbabb('0xd4'),'[emptyContact]');logger['error'](_0x735cf2);};Dialer[_0xbabb('0x1e')]['isSuccess']=function(_0x14744a){return _0x14744a===_0xbabb('0xd5');};Dialer['prototype']['isTrunkReachable']=function(_0xd9da52){return!_[_0xbabb('0x42')](_0xd9da52)&&_0xd9da52&&!_['isUndefined'](_0xd9da52['name'])&&!_[_0xbabb('0x42')](_0xd9da52[_0xbabb('0x74')])&&_0xd9da52[_0xbabb('0x74')]&&(this[_0xbabb('0x25')][util['format'](_0xbabb('0xd6'),_0xd9da52[_0xbabb('0x45')])][_0xbabb('0xd7')]===_0xbabb('0xd8')||this[_0xbabb('0x25')][util[_0xbabb('0x77')](_0xbabb('0xd6'),_0xd9da52[_0xbabb('0x45')])][_0xbabb('0xd7')]===_0xbabb('0xd9'));};Dialer[_0xbabb('0x1e')][_0xbabb('0xce')]=function(_0x10e76e,_0x87327c,_0x5d2ff0){this[_0xbabb('0xc7')](_0x10e76e)[_0xbabb('0xae')](loggerCatch(_0x87327c));this['moveContactManagedDialer'](_0x10e76e)['catch'](loggerCatch(_0x5d2ff0));};Dialer[_0xbabb('0x1e')]['syncVarSet']=function(_0x153ed8){var _0x4567b2=this[_0xbabb('0x2a')][_0x153ed8[_0xbabb('0xda')]];var _0x17cc88;if(!_[_0xbabb('0xab')](_0x153ed8)&&!_[_0xbabb('0xab')](_0x153ed8[_0xbabb('0xdb')])&&!_['isNil'](_0x153ed8['variable']['amdstatus'])&&_0x153ed8[_0xbabb('0xdc')]===_0xbabb('0xdd')&&_0x4567b2){if(_0x4567b2[_0xbabb('0x58')]!==_0xbabb('0x79')&&this[_0xbabb('0x23')][_0x4567b2[_0xbabb('0xb0')]][_0xbabb('0xde')]&&_0x153ed8[_0xbabb('0xdf')]===_0xbabb('0xe0')){delete this[_0xbabb('0x2a')][_0x153ed8['uniqueid']];this[_0xbabb('0xb2')](this[_0xbabb('0x23')][_0x4567b2[_0xbabb('0xb0')]]);this[_0xbabb('0x23')][_0x4567b2['queue']][_0xbabb('0x60')]+=0x1;this[_0xbabb('0x23')][_0x4567b2[_0xbabb('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;_0x17cc88=new Hangup(_0x4567b2,_0x153ed8);_0x17cc88['state']=0x12;_0x17cc88[_0xbabb('0xa5')]=_0xbabb('0xe1');_0x17cc88[_0xbabb('0xe2')]=_0xbabb('0xe3');this['saveInDb'](_0x17cc88,_0xbabb('0xe4'),_0xbabb('0xe5'));}if(_0x4567b2[_0xbabb('0x58')]!==_0xbabb('0x79')&&this['voiceQueues'][_0x4567b2[_0xbabb('0xb0')]][_0xbabb('0xde')]&&_0x153ed8[_0xbabb('0xdf')]==='MACHINE'){delete this[_0xbabb('0x2a')][_0x153ed8[_0xbabb('0xda')]];this[_0xbabb('0xb2')](this['voiceQueues'][_0x4567b2['queue']]);this[_0xbabb('0x23')][_0x4567b2[_0xbabb('0xb0')]][_0xbabb('0x60')]+=0x1;this['voiceQueues'][_0x4567b2['queue']][_0xbabb('0xe6')]+=0x1;_0x17cc88=new Hangup(_0x4567b2,_0x153ed8);_0x17cc88['state']=0x13;_0x17cc88[_0xbabb('0xa5')]=_0xbabb('0xe7');_0x17cc88[_0xbabb('0xe2')]=_0xbabb('0xe3');_0x17cc88[_0xbabb('0xe8')]=!![];this[_0xbabb('0xce')](_0x17cc88,_0xbabb('0xe9'),'[syncMachine]');}if(_0x4567b2[_0xbabb('0x58')]===_0xbabb('0x79')&&this[_0xbabb('0x24')][_0x4567b2[_0xbabb('0xb0')]][_0xbabb('0xde')]&&_0x153ed8['value']===_0xbabb('0xe0')){delete this[_0xbabb('0x2a')][_0x153ed8[_0xbabb('0xda')]];this[_0xbabb('0xb2')](this[_0xbabb('0x24')][_0x4567b2[_0xbabb('0xb0')]]);_0x17cc88=new Hangup(_0x4567b2,_0x153ed8);_0x17cc88[_0xbabb('0xa4')]=0x12;_0x17cc88[_0xbabb('0xa5')]=_0xbabb('0xe1');_0x17cc88[_0xbabb('0xe2')]=_0xbabb('0xe3');this['saveInDb'](_0x17cc88,'[syncHangupInAMDIvr][createHistory]',_0xbabb('0xea'));}if(_0x4567b2[_0xbabb('0x58')]===_0xbabb('0x79')&&this[_0xbabb('0x24')][_0x4567b2[_0xbabb('0xb0')]][_0xbabb('0xde')]&&_0x153ed8[_0xbabb('0xdf')]==='MACHINE'){delete this['uniqueId'][_0x153ed8[_0xbabb('0xda')]];this[_0xbabb('0xb2')](this['campaigns'][_0x4567b2[_0xbabb('0xb0')]]);_0x17cc88=new Hangup(_0x4567b2,_0x153ed8);_0x17cc88['state']=0x13;_0x17cc88[_0xbabb('0xa5')]=_0xbabb('0xe7');_0x17cc88[_0xbabb('0xe2')]=_0xbabb('0xe3');_0x17cc88[_0xbabb('0xe8')]=!![];this['saveInDb'](_0x17cc88,'[syncMachineIvr][createHistory]',_0xbabb('0xeb'));}}};Dialer['prototype'][_0xbabb('0xec')]=function(_0x47d1e7){var _0x3c4ccb=this['uniqueId'][_0x47d1e7[_0xbabb('0xda')]];var _0x1511f4=this;var _0x41719f;if(_0x3c4ccb&&_0x3c4ccb[_0xbabb('0x58')]===_0xbabb('0x79')){delete this[_0xbabb('0x2a')][_0x47d1e7[_0xbabb('0xda')]];this[_0xbabb('0xb2')](this[_0xbabb('0x24')][_0x3c4ccb[_0xbabb('0xb0')]]);this[_0xbabb('0x24')][_0x3c4ccb['queue']][_0xbabb('0xed')]+=0x1;_0x41719f=new Hangup(_0x3c4ccb,_0x47d1e7);this[_0xbabb('0xc7')](_0x41719f)[_0xbabb('0xae')](loggerCatch(_0xbabb('0xee')));this[_0xbabb('0xc5')](_0x41719f)['catch'](loggerCatch(_0xbabb('0xef')));}if(_0x3c4ccb&&_0x3c4ccb[_0xbabb('0x58')]!==_0xbabb('0x79')&&isNotNull(this[_0xbabb('0x23')][_0x3c4ccb[_0xbabb('0xb0')]][_0xbabb('0xf0')])){delete this[_0xbabb('0x2a')][_0x47d1e7['uniqueid']];this['updateOriginated'](this[_0xbabb('0x23')][_0x3c4ccb[_0xbabb('0xb0')]]);this[_0xbabb('0x23')][_0x3c4ccb['queue']][_0xbabb('0x60')]+=0x1;this[_0xbabb('0x23')][_0x3c4ccb[_0xbabb('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;_0x41719f=new Hangup(_0x3c4ccb,_0x47d1e7);_0x41719f['state']=0x10;_0x41719f[_0xbabb('0xa5')]=_0xbabb('0xf1');_0x41719f[_0xbabb('0xe2')]='AGI';this[_0xbabb('0xc7')](_0x41719f)[_0xbabb('0xae')](loggerCatch(_0xbabb('0xee')));this[_0xbabb('0xc5')](_0x41719f)[_0xbabb('0xae')](loggerCatch(_0xbabb('0xef')));}if(_0x3c4ccb&&_0x3c4ccb[_0xbabb('0x58')]!==_0xbabb('0x79')&&!isNotNull(this['voiceQueues'][_0x3c4ccb[_0xbabb('0xb0')]][_0xbabb('0xf0')])){delete this[_0xbabb('0x2a')][_0x47d1e7[_0xbabb('0xda')]];this[_0xbabb('0xb2')](this['voiceQueues'][_0x3c4ccb[_0xbabb('0xb0')]]);this[_0xbabb('0x23')][_0x3c4ccb['queue']]['outboundUnknownCallsDay']+=0x1;_0x41719f=new Hangup(_0x3c4ccb,_0x47d1e7);_0x41719f[_0xbabb('0xa4')]=0xc;_0x41719f['statedesc']=_0x47d1e7['cause-txt'];_0x41719f[_0xbabb('0xe2')]=_0xbabb('0xf2');this[_0xbabb('0xc7')](_0x41719f)[_0xbabb('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xbabb('0xc5')](_0x41719f)[_0xbabb('0xae')](loggerCatch(_0xbabb('0xef')));}};Dialer[_0xbabb('0x1e')][_0xbabb('0x36')]=function(_0x30645c){var _0x424a22=this['uniqueId'][_0x30645c[_0xbabb('0xda')]];var _0x2d795d=this;if(this[_0xbabb('0x23')][_0x30645c[_0xbabb('0xb0')]]){if(_0x424a22&&_0x424a22[_0xbabb('0x58')]!==_0xbabb('0x79')){delete this[_0xbabb('0x2a')][_0x30645c[_0xbabb('0xda')]];this['voiceQueues'][_0x30645c['queue']]['outboundAnswerCallsDay']+=0x1;var _0xfc03f8=new AgentComplete(_0x424a22,_0x30645c);if(_0x30645c[_0xbabb('0xf3')]===_0xbabb('0xf4')){_0xfc03f8[_0xbabb('0xf5')]=this[_0xbabb('0x23')][_0x30645c[_0xbabb('0xb0')]][_0xbabb('0xf6')]&&this[_0xbabb('0x23')][_0x30645c[_0xbabb('0xb0')]]['dialAgiAfterHangupAgent']?moment()['format'](_0xbabb('0xf7')):undefined;}this[_0xbabb('0xc7')](_0xfc03f8)['catch'](loggerCatch(_0xbabb('0xf8')));this[_0xbabb('0xc5')](_0xfc03f8)[_0xbabb('0xae')](loggerCatch(_0xbabb('0xf9')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x2e6b98){if(this[_0xbabb('0x23')][_0x2e6b98[_0xbabb('0xb0')]]){if(this['uniqueId'][_0x2e6b98[_0xbabb('0xda')]]&&this[_0xbabb('0x2a')][_0x2e6b98[_0xbabb('0xda')]][_0xbabb('0x58')]!==_0xbabb('0x79')){this[_0xbabb('0xb2')](this['voiceQueues'][_0x2e6b98['queue']]);this[_0xbabb('0x2a')][_0x2e6b98[_0xbabb('0xda')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xbabb('0x1e')][_0xbabb('0xfa')]=function(_0x3aabde){this[_0xbabb('0xc7')](_0x3aabde)['catch'](loggerCatch(_0xbabb('0xf8')));this[_0xbabb('0xc5')](_0x3aabde)[_0xbabb('0xae')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0xbabb('0xfb')]=function(_0x5a15bf){var _0x36df62=this[_0xbabb('0x2a')][_0x5a15bf[_0xbabb('0xda')]];var _0x566039=this;if(this[_0xbabb('0x23')][_0x5a15bf[_0xbabb('0xb0')]]){if(_0x36df62&&_0x36df62[_0xbabb('0x58')]!==_0xbabb('0x79')){delete this[_0xbabb('0x2a')][_0x5a15bf['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x5a15bf['queue']]);_0x36df62['droptime']=moment()[_0xbabb('0x77')](_0xbabb('0xf7'));var _0x16e032=new QueueCallerAbandon(_0x36df62,_0x5a15bf);if(getSeconds(_0x36df62[_0xbabb('0xfc')],_0x36df62[_0xbabb('0xfd')])>=_0x36df62['dialQueueTimeout']){this[_0xbabb('0x23')][_0x5a15bf['queue']][_0xbabb('0xfe')]+=0x1;this[_0xbabb('0x23')][_0x5a15bf[_0xbabb('0xb0')]][_0xbabb('0x64')]+=0x1;this[_0xbabb('0x23')][_0x5a15bf[_0xbabb('0xb0')]][_0xbabb('0x6a')]+=0x1;_0x16e032['state']=0xa;_0x16e032[_0xbabb('0xa5')]='Drop';_0x16e032['dropreason']=_0xbabb('0xff');_0x16e032[_0xbabb('0xf5')]=this['voiceQueues'][_0x5a15bf[_0xbabb('0xb0')]]['dialQueueProject2']?moment()[_0xbabb('0x77')](_0xbabb('0xf7')):undefined;this[_0xbabb('0xfa')](_0x16e032);}else{this[_0xbabb('0x23')][_0x5a15bf['queue']][_0xbabb('0x69')]+=0x1;this[_0xbabb('0x23')][_0x5a15bf[_0xbabb('0xb0')]][_0xbabb('0x100')]+=0x1;_0x16e032[_0xbabb('0xa4')]=0xb;_0x16e032[_0xbabb('0xa5')]='Abandoned';_0x16e032['dropreason']=_0xbabb('0x101');this['queueCallerAbandonCreateState'](_0x16e032);}}}};Dialer['prototype'][_0xbabb('0x3b')]=function(_0x1e4e35){if(this[_0xbabb('0x28')][_0x1e4e35[_0xbabb('0xda')]]){this[_0xbabb('0x28')][_0x1e4e35[_0xbabb('0xda')]][_0xbabb('0xad')]=_0x1e4e35[_0xbabb('0xad')];}if(this[_0xbabb('0x2a')][_0x1e4e35[_0xbabb('0xda')]]){this[_0xbabb('0x2a')][_0x1e4e35['uniqueid']][_0xbabb('0xad')]=_0x1e4e35[_0xbabb('0xad')];}};Dialer[_0xbabb('0x1e')][_0xbabb('0x3e')]=function(_0x1d0b0e){if(strategy[this[_0xbabb('0x23')][this[_0xbabb('0x28')][_0x1d0b0e['actionid']]['queue']][_0xbabb('0x102')]]===_0xbabb('0x1d')){if(this[_0xbabb('0x28')][_0x1d0b0e[_0xbabb('0x103')]]&&_[_0xbabb('0xab')](this['actions'][_0x1d0b0e[_0xbabb('0x103')]]['locked'])&&_0x1d0b0e['status']==='1'&&_0x1d0b0e['paused']==='0'){if(this[_0xbabb('0x104')][_0x1d0b0e[_0xbabb('0x105')]]){if(!this['agents'][_0x1d0b0e[_0xbabb('0x105')]][_0xbabb('0x106')]){this[_0xbabb('0x104')][_0x1d0b0e[_0xbabb('0x105')]][_0xbabb('0x106')]=!![];this[_0xbabb('0x28')][_0x1d0b0e[_0xbabb('0x103')]][_0xbabb('0x106')]=!![];this[_0xbabb('0x28')][_0x1d0b0e[_0xbabb('0x103')]]['stateinterface']=_0x1d0b0e[_0xbabb('0x105')];}}}}else if((strategy[this[_0xbabb('0x23')][this[_0xbabb('0x28')][_0x1d0b0e['actionid']]['queue']]['strategy']]||_0xbabb('0x1c'))===_0xbabb('0x1c')){if(this[_0xbabb('0x28')][_0x1d0b0e[_0xbabb('0x103')]]){if(this[_0xbabb('0x104')][_0x1d0b0e[_0xbabb('0x105')]]){this[_0xbabb('0x28')][_0x1d0b0e['actionid']]['stateinterface']=_0x1d0b0e['stateinterface'];if(_['isNil'](this['queueBooked'][this[_0xbabb('0x28')][_0x1d0b0e[_0xbabb('0x103')]][_0xbabb('0xb0')]])){this[_0xbabb('0x107')][this[_0xbabb('0x28')][_0x1d0b0e[_0xbabb('0x103')]]['queue']]=[];}this[_0xbabb('0x107')][this[_0xbabb('0x28')][_0x1d0b0e['actionid']][_0xbabb('0xb0')]]['push'](_[_0xbabb('0x8b')](_[_0xbabb('0xcf')](this['actions'][_0x1d0b0e[_0xbabb('0x103')]],['idHopper',_0xbabb('0x105')]),{'status':_0x1d0b0e[_0xbabb('0xd7')],'paused':_0x1d0b0e[_0xbabb('0x108')]}));}}}};function unlockQueueStatus(_0xdd82d7,_0x5da6ec){setTimeout(function(){if(_[_0xbabb('0x42')](_0xdd82d7['queueStatusComplete'])){loggerBooked[_0xbabb('0x92')](_0xbabb('0x109'),_0x5da6ec);}_0xdd82d7[_0xbabb('0x10a')]=!![];loggerBooked[_0xbabb('0x7b')](_0xbabb('0x10b'),_0x5da6ec,JSON[_0xbabb('0x76')](_['pick'](_0xdd82d7,[_0xbabb('0x45'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0xbabb('0x40')]=function(_0x2da0a5){var _0x3ef1de=this;var _0x268328=_0x3ef1de[_0xbabb('0x23')][_0x3ef1de[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0xb0')]];if(strategy[this['voiceQueues'][this['actions'][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0xb0')]]['strategy']]===_0xbabb('0x1d')){if(this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]]&&this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0x105')]){this[_0xbabb('0x22')][_0xbabb('0x10c')](this[_0xbabb('0x28')][_0x2da0a5['actionid']][_0xbabb('0x10d')],this['actions'][_0x2da0a5[_0xbabb('0x103')]]['stateinterface'])['catch'](function(_0x448379){logger[_0xbabb('0x92')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x448379,{'showHidden':![],'depth':null}));})['finally'](function(){_0x3ef1de['updateOriginated'](_0x3ef1de['voiceQueues'][_0x3ef1de[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]]['queue']]);_0x3ef1de['agents'][_0x3ef1de[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]]['stateinterface']]['locked']=![];delete _0x3ef1de[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]];unlockQueueStatus(_0x268328);});}else{this[_0xbabb('0xb2')](this[_0xbabb('0x23')][this['actions'][_0x2da0a5[_0xbabb('0x103')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0xd0')],'ListId':this[_0xbabb('0x28')][_0x2da0a5['actionid']][_0xbabb('0xd1')],'VoiceQueueId':this['actions'][_0x2da0a5['actionid']][_0xbabb('0x10e')]||undefined,'CampaignId':this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0xd3')]||undefined})['catch'](loggerCatch(_0xbabb('0x10f')));delete this['actions'][_0x2da0a5[_0xbabb('0x103')]];unlockQueueStatus(_0x268328);}}else if((strategy[this[_0xbabb('0x23')][this[_0xbabb('0x28')][_0x2da0a5['actionid']]['queue']][_0xbabb('0x102')]]||_0xbabb('0x1c'))===_0xbabb('0x1c')){var _0x2f26ba;if(this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]]&&!_['isEmpty'](this['queueBooked'][this[_0xbabb('0x28')][_0x2da0a5['actionid']][_0xbabb('0xb0')]])){if(this[_0xbabb('0x2f')][_0x3ef1de[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0xb0')]]){this[_0xbabb('0x2f')][_0x3ef1de[_0xbabb('0x28')][_0x2da0a5['actionid']]['queue']]=this[_0xbabb('0x2f')][this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0xb0')]]?this[_0xbabb('0x2f')][this['actions'][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0xb0')]]:this[_0xbabb('0x107')][this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]][_0xbabb('0xb0')]]?this[_0xbabb('0x107')][this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]]['queue']][_0xbabb('0x110')]||0x0:0x0;}this[_0xbabb('0x107')][this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]]['queue']][_0xbabb('0x110')]=this[_0xbabb('0x2f')][this[_0xbabb('0x28')][_0x2da0a5[_0xbabb('0x103')]]['queue']];for(var _0x4f799b=0x0;_0x4f799b=0x0?!![]:![];})[_0xbabb('0xae')](myreject(_0xea07b5)));}}else{_0x276e2e['push'](ami['Action']({'action':'command','command':util[_0xbabb('0x77')](_0xbabb('0x12b'),_0xb13f8c,!_[_0xbabb('0x42')](config[_0xbabb('0x12f')][_0x431812])?_0x431812:'')})[_0xbabb('0xba')](function(_0x88bde8){return _0x88bde8[_0xbabb('0x12c')]['indexOf'](_0xbabb('0x12e'))>=0x0?!![]:![];})[_0xbabb('0xae')](myreject(_0xea07b5)));}BPromise[_0xbabb('0x130')](_0x276e2e)[_0xbabb('0xba')](function(_0x48fcc7){var _0x722c6c=_[_0xbabb('0x131')](_0x48fcc7);if(_0x722c6c){return _0x272acd(_0x722c6c);}else{_0x261249[_0xbabb('0x43')]=_0x167fe3?_0xbabb('0x132'):'INTERVAL_IS_OVERTIME';return _0xea07b5(msgResponse(_0xbabb('0x133'),'Failure',_0xbabb('0x134')+_0x167fe3+'\x20'+_0x134242+_0xbabb('0x135')+util[_0xbabb('0x94')](_0xb13f8c,{'showHidden':![],'depth':null})+_0xbabb('0x136')+_0x431812));}})['catch'](function(_0x287bf0){return _0xea07b5(msgResponse(_0xbabb('0x11f'),_0xbabb('0x123'),JSON['stringify'](_0x287bf0)));});});};Dialer[_0xbabb('0x1e')]['checkDialMethod']=function(_0x436b1c){var _0x252040=this;return function(){switch(_0x436b1c[_0xbabb('0x137')]){case _0xbabb('0x138'):freeVariablesPredictive(_0x436b1c);_0x252040['handlePower'](_0x436b1c,0x1);break;case _0xbabb('0x139'):freeVariablesPredictive(_0x436b1c);_0x252040[_0xbabb('0x13a')](_0x436b1c,_0x436b1c[_0xbabb('0x13b')]);break;case _0xbabb('0x9'):_0x252040[_0xbabb('0x9')](_0x436b1c);break;case _0xbabb('0x7'):freeVariablesPredictive(_0x436b1c);_0x252040[_0xbabb('0x13a')](_0x436b1c,0x1);break;default:freeVariablesPredictive(_0x436b1c);logger[_0xbabb('0x92')](_0xbabb('0x13c'),_0x436b1c[_0xbabb('0x45')],_0xbabb('0x13d'));}};};Dialer[_0xbabb('0x1e')][_0xbabb('0x13e')]=function(_0x5ccf20){var _0x38c8ef=this;return function(){_0x38c8ef[_0xbabb('0x13f')](_0x5ccf20);};};Dialer[_0xbabb('0x1e')][_0xbabb('0xb')]=function(_0x31bdfa){var _0x57d9ec=this;if(isNotPreview(_0x31bdfa['dialMethod'])){if(isVoiceQueueOutbound(_0x31bdfa[_0xbabb('0x58')])&&isActive(_0x31bdfa[_0xbabb('0x5b')])){_0x31bdfa[_0xbabb('0x9c')]=!![];BPromise[_0xbabb('0xb5')]()[_0xbabb('0xba')](checkIsLoggedIn(_0x31bdfa,_0x31bdfa[_0xbabb('0x55')]))[_0xbabb('0xba')](checkIsActive(_0x31bdfa,_0x31bdfa[_0xbabb('0x5b')]))[_0xbabb('0xba')](checkInterval(_0x31bdfa))[_0xbabb('0xba')](_0x57d9ec[_0xbabb('0x140')](_0x31bdfa))['then'](_0x57d9ec[_0xbabb('0x141')](_0x31bdfa['dialGlobalInterval'],_0x31bdfa['dialTimezone'],_0x31bdfa['name'],_0x31bdfa))['then'](_0x57d9ec[_0xbabb('0x142')](_0x31bdfa['Interval'],_0x31bdfa[_0xbabb('0x143')],_0x31bdfa['name'],_0x31bdfa))[_0xbabb('0xba')](_0x57d9ec[_0xbabb('0x144')](_0x31bdfa))[_0xbabb('0xae')](loggerCatchQueueSummary(_0xbabb('0x145'),_0x31bdfa));}else{notSendMessagesQueue(_0x31bdfa);}}else{freeVariablesPredictive(_0x31bdfa);}};Dialer['prototype'][_0xbabb('0x11b')]=function(){var _0x4987cc=this;var _0x41301a;for(var _0x1cfe28 in this[_0xbabb('0x24')]){if(this[_0xbabb('0x24')][_0xbabb('0x95')](_0x1cfe28)){_0x41301a=this[_0xbabb('0x24')][_0x1cfe28];if(isCampaignIvr(_0x41301a[_0xbabb('0x58')])&&isActive(_0x41301a[_0xbabb('0x74')])){_0x41301a[_0xbabb('0x9c')]=!![];BPromise[_0xbabb('0xb5')]()['then'](checkIsActive(_0x41301a,_0x41301a[_0xbabb('0x74')]))['then'](checkInterval(_0x41301a))['then'](_0x4987cc[_0xbabb('0x140')](_0x41301a))[_0xbabb('0xba')](_0x4987cc[_0xbabb('0x141')](_0x41301a['dialGlobalInterval'],_0x41301a['dialTimezone'],_0x41301a[_0xbabb('0x45')],_0x41301a))[_0xbabb('0xba')](_0x4987cc[_0xbabb('0x142')](_0x41301a['Interval'],_0x41301a['dialTimezone'],_0x41301a[_0xbabb('0x45')],_0x41301a))[_0xbabb('0xba')](_0x4987cc[_0xbabb('0x13e')](_0x41301a))[_0xbabb('0xae')](loggerCatchQueueSummary('[syncCampaigns]',_0x41301a));}else{notSendMessagesCampaign(_0x41301a);}}}};function getCallerIdRandom(_0x5bdea0,_0x3a1194){var _0x3ac8f7,_0x5eb416,_0x3ab5e2;if(_0x3a1194<=0x0){_0x3a1194=0x1;}_0x3ac8f7=new RegExp(_0xbabb('0x146')+_0x3a1194+'}$');_0x5eb416=Math[_0xbabb('0x147')](0xa,_0x3a1194-0x1);_0x3ab5e2=Math[_0xbabb('0x147')](0xa,_0x3a1194)-0x1;return util[_0xbabb('0x77')]('%s',_[_0xbabb('0x148')](_0x5bdea0,_0x3ac8f7,_[_0xbabb('0x149')](_0x5eb416,_0x3ab5e2)));}function extractCalleridName(_0xb94702){var _0x548998=_0xb94702[_0xbabb('0x14a')](/"(.*?)"/);return _0x548998?_0x548998[0x1]:_0xb94702;}function extractCalleridNumber(_0x152dbd){var _0x32729d=_0x152dbd['match'](/<(.*?)>/);return _0x32729d?_0x32729d[0x1]:_0x152dbd;}Dialer[_0xbabb('0x1e')]['actionOriginate']=function(_0x575618,_0x48087b){var _0x29ed94=this;var _0x491b7c=uuid['v4']();this[_0xbabb('0x28')][_0x491b7c]=new Action(_0x575618,_0x48087b,_0x491b7c);return new BPromise(function(_0x4a3eaf,_0x2b0095){if(_[_0xbabb('0x42')](_0x575618)&&_0xbabb('0x14b')!==typeof _0x575618){return _0x2b0095(msgResponse(_0xbabb('0x14c'),_0xbabb('0x123'),'voiceQueue\x20is\x20undefine'));}if(_[_0xbabb('0x42')](_0x48087b[_0xbabb('0x14d')]['phone'])||_0x48087b[_0xbabb('0x14d')]['phone']===null){return _0x2b0095(msgResponse(_0xbabb('0x14c'),_0xbabb('0x123'),'contact\x20is\x20undefine'));}var _0x50639e={'XMD-CALLERID':_0x29ed94['actions'][_0x491b7c]['getCaller'](),'XMD-AGI':_0x575618[_0xbabb('0xf0')]?util[_0xbabb('0x77')](_0xbabb('0x14e'),ipAgi,_0x575618[_0xbabb('0xf0')]):'NONE','XMD-AGIAFTER':_0x575618[_0xbabb('0xf6')]?util[_0xbabb('0x77')](_0xbabb('0x14e'),ipAgi,_0x575618['dialQueueProject2']):_0xbabb('0x14f'),'XMD-QUEUE':_0x575618[_0xbabb('0x58')]==='outbound'?util[_0xbabb('0x77')](_0xbabb('0x150'),_0x575618[_0xbabb('0x45')],_0x575618['dialQueueOptions']||'',_0x575618[_0xbabb('0x151')]?'c':'',_0x575618[_0xbabb('0x152')]||0x3):'NONE','XMD-CONTACTID':_0x48087b['ContactId'],'XMD-CDRTYPE':_0xbabb('0x6'),'CALLERID(all)':_0x29ed94[_0xbabb('0x28')][_0x491b7c]['getCaller'](),'XMD-AMD':_0x575618[_0xbabb('0xde')]?_0xbabb('0x153'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x575618[_0xbabb('0xde')]){_0x50639e[_0xbabb('0x154')]=_0x575618[_0xbabb('0x155')]||0x9c4;_0x50639e['XMD-AMDGREETING']=_0x575618['dialAMDGreeting']||0x5dc;_0x50639e[_0xbabb('0x156')]=_0x575618[_0xbabb('0x157')]||0x320;_0x50639e[_0xbabb('0x158')]=_0x575618[_0xbabb('0x159')]||0x1388;_0x50639e[_0xbabb('0x15a')]=_0x575618[_0xbabb('0x15b')]||0x64;_0x50639e[_0xbabb('0x15c')]=_0x575618[_0xbabb('0x15d')]||0x32;_0x50639e[_0xbabb('0x15e')]=_0x575618[_0xbabb('0x15f')]||0x3;_0x50639e[_0xbabb('0x160')]=_0x575618[_0xbabb('0x161')]||0x100;_0x50639e[_0xbabb('0x162')]=_0x575618['dialAMDMaximumWordLength']||0x1388;}if(_0x575618[_0xbabb('0x58')]==='outbound'){_0x50639e[_0xbabb('0x163')]=_0x48087b[_0xbabb('0x10e')];}else{_0x50639e['XMD-CAMPAIGNID']=_0x48087b[_0xbabb('0xd3')];}for(var _0x3e206c in _0x48087b[_0xbabb('0x14d')]){if(_0x48087b[_0xbabb('0x14d')]['hasOwnProperty'](_0x3e206c)){if(isNotNull(_0x48087b[_0xbabb('0x14d')][_0x3e206c])&&_0x3e206c!=='id'&&_0x3e206c!==_0xbabb('0x164')&&_0x3e206c!=='createdAt'&&_0x3e206c!==_0xbabb('0x165')){_0x50639e[util[_0xbabb('0x77')](_0xbabb('0x166'),_0xbabb('0x167'),_[_0xbabb('0x168')](_0x3e206c))]=_0x48087b[_0xbabb('0x14d')][_0x3e206c];}}}var _0x27ad1d=_0x29ed94['isTrunkReachable'](_0x575618[_0xbabb('0x73')])?getCallerId(_0x575618['Trunk'][_0xbabb('0x75')],_0x575618[_0xbabb('0x5c')],_0x575618[_0xbabb('0x169')]>0x0?getCallerIdRandom(_0x575618[_0xbabb('0x5d')],_0x575618[_0xbabb('0x169')]):_0x575618[_0xbabb('0x5d')]):getCallerId(_[_0xbabb('0xab')](_0x575618[_0xbabb('0x11d')])?_0x575618[_0xbabb('0x73')][_0xbabb('0x75')]:_0x575618['TrunkBackup'][_0xbabb('0x75')],_0x575618[_0xbabb('0x5c')],_0x575618[_0xbabb('0x169')]>0x0?getCallerIdRandom(_0x575618[_0xbabb('0x5d')],_0x575618[_0xbabb('0x169')]):_0x575618[_0xbabb('0x5d')]);if(_0x27ad1d){_0x50639e['XMD-ORIGINATECALLERIDNAME']=_0x29ed94[_0xbabb('0x28')][_0x491b7c]['originatecalleridname']=extractCalleridName(_0x27ad1d);_0x50639e[_0xbabb('0x16a')]=_0x29ed94['actions'][_0x491b7c]['originatecalleridnum']=extractCalleridNumber(_0x27ad1d);}return ami[_0xbabb('0xac')]({'actionid':_0x491b7c,'action':_0xbabb('0x14c'),'channel':_0x29ed94[_0xbabb('0x11c')](_0x575618[_0xbabb('0x73')])?util[_0xbabb('0x77')](_0xbabb('0x16b'),_0x575618[_0xbabb('0x73')][_0xbabb('0x45')],isNotNull(_0x575618[_0xbabb('0x5f')])?_0x575618[_0xbabb('0x5f')][_0xbabb('0x16c')]()||'':'',_0x575618['dialCutDigit']>0x0?_0x48087b[_0xbabb('0x14d')]['phone'][_0xbabb('0x16d')](_0x575618[_0xbabb('0x16e')]):_0x48087b[_0xbabb('0x14d')]['phone']):util[_0xbabb('0x77')](_0xbabb('0x16b'),_[_0xbabb('0xab')](_0x575618['TrunkBackup'])?_0x575618[_0xbabb('0x73')][_0xbabb('0x45')]:_0x575618[_0xbabb('0x11d')]['name'],isNotNull(_0x575618[_0xbabb('0x5f')])?_0x575618['dialPrefix'][_0xbabb('0x16c')]()||'':'',_0x575618[_0xbabb('0x16e')]>0x0?_0x48087b['Contact'][_0xbabb('0x16f')][_0xbabb('0x16d')](_0x575618[_0xbabb('0x16e')]):_0x48087b[_0xbabb('0x14d')]['phone']),'callerid':_0x27ad1d,'Exten':_0xbabb('0xdd'),'Context':_0xbabb('0x170'),'Priority':'1','variable':_0x50639e,'timeout':(_0x575618[_0xbabb('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x491b7c})['then'](function(_0x3e2094){return _0x4a3eaf(_0x3e2094);})[_0xbabb('0xae')](function(_0x56fecb){_0x575618[_0xbabb('0x171')]+=0x1;var _0x200b62=new History(_0x29ed94[_0xbabb('0x28')][_0x491b7c]);logger[_0xbabb('0x92')](util[_0xbabb('0x77')](_0xbabb('0x172'),JSON['stringify'](_0x56fecb)));_0x200b62[_0xbabb('0xa4')]=0xe;_0x200b62[_0xbabb('0xa5')]=_0xbabb('0x173');_0x200b62[_0xbabb('0xa7')]=moment()[_0xbabb('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x200b62[_0xbabb('0xa6')]=_0x200b62[_0xbabb('0xa7')];_0x29ed94[_0xbabb('0xc7')](_0x200b62)[_0xbabb('0xae')](loggerCatch(_0xbabb('0x174')));_0x29ed94[_0xbabb('0xc5')](_0x200b62)[_0xbabb('0xae')](loggerCatch('[originate][error]'))[_0xbabb('0x20')](function(){delete _0x29ed94[_0xbabb('0x28')][_0x491b7c];return _0x2b0095(msgResponse(_0xbabb('0x14c'),_0xbabb('0x175'),_0xbabb('0x176')));});});});};Dialer['prototype'][_0xbabb('0x34')]=function(_0x4f2c10){var _0x1f9e5d=this[_0xbabb('0x28')][_0x4f2c10[_0xbabb('0x103')]];var _0x5493ad=this;if(_0x1f9e5d){delete this[_0xbabb('0x28')][_0x4f2c10[_0xbabb('0x103')]];_0x1f9e5d[_0xbabb('0xfd')]=moment()[_0xbabb('0x77')](_0xbabb('0xf7'));var _0x582d81=_0x1f9e5d[_0xbabb('0x58')]==='ivr'?this[_0xbabb('0x24')][_0x1f9e5d[_0xbabb('0xb0')]]:this[_0xbabb('0x23')][_0x1f9e5d['getQueue']()];if(!this[_0xbabb('0x177')](_0x4f2c10[_0xbabb('0x178')])){this['updateOriginated'](_0x582d81);return this['callProgressDetecting'](_0x1f9e5d,_0x582d81,_0x4f2c10)[_0xbabb('0xba')](function(_0xd77b4d){})['catch'](loggerCatch(_0xbabb('0x179')));}else{this['uniqueId'][_0x4f2c10['uniqueid']]=_0x1f9e5d;}}};Dialer[_0xbabb('0x1e')]['checkRetriveMax']=function(_0x2b2b6f,_0x9a719b,_0x3a2cb0){var _0x2a73c8=new History(_0x9a719b);if(_0x2a73c8['countbusyretry']+_0x2a73c8[_0xbabb('0x17a')]+_0x2a73c8[_0xbabb('0x17b')]>=_0x3a2cb0[_0xbabb('0x17c')]-0x1){return!![];}switch(_0x2b2b6f){case 0x3:if(_0x2a73c8[_0xbabb('0x17b')]>=_0x3a2cb0[_0xbabb('0x17d')]-0x1){return!![];}else{this[_0xbabb('0xbe')]({'active':![],'countnoanswerretry':_0x2a73c8[_0xbabb('0x17b')]+=0x1,'scheduledat':moment()[_0xbabb('0x17e')](_0x3a2cb0[_0xbabb('0x17f')],'minutes')[_0xbabb('0x77')](_0xbabb('0xf7')),'ContactId':_0x2a73c8[_0xbabb('0xd0')],'ListId':_0x2a73c8[_0xbabb('0xd1')],'VoiceQueueId':_0x2a73c8[_0xbabb('0x10e')]||undefined,'CampaignId':_0x2a73c8[_0xbabb('0xd3')]||undefined})['catch'](loggerCatch(_0xbabb('0x180')));}break;case 0x5:if(_0x2a73c8['countbusyretry']>=_0x3a2cb0[_0xbabb('0x181')]-0x1){return!![];}else{this[_0xbabb('0xbe')]({'active':![],'countbusyretry':_0x2a73c8[_0xbabb('0x182')]+=0x1,'scheduledat':moment()[_0xbabb('0x17e')](_0x3a2cb0[_0xbabb('0x183')],'minutes')[_0xbabb('0x77')](_0xbabb('0xf7')),'ContactId':_0x2a73c8[_0xbabb('0xd0')],'ListId':_0x2a73c8[_0xbabb('0xd1')],'VoiceQueueId':_0x2a73c8['VoiceQueueId']||undefined,'CampaignId':_0x2a73c8['CampaignId']||undefined})[_0xbabb('0xae')](loggerCatch(_0xbabb('0x184')));}break;case 0x8:if(_0x2a73c8['countcongestionretry']>=_0x3a2cb0[_0xbabb('0x185')]-0x1){return!![];}else{this[_0xbabb('0xbe')]({'active':![],'countcongestionretry':_0x2a73c8[_0xbabb('0x17a')]+=0x1,'scheduledat':moment()[_0xbabb('0x17e')](_0x3a2cb0[_0xbabb('0x186')],'minutes')[_0xbabb('0x77')](_0xbabb('0xf7')),'ContactId':_0x2a73c8['ContactId'],'ListId':_0x2a73c8[_0xbabb('0xd1')],'VoiceQueueId':_0x2a73c8['VoiceQueueId']||undefined,'CampaignId':_0x2a73c8[_0xbabb('0xd3')]||undefined})[_0xbabb('0xae')](loggerCatch(_0xbabb('0x187')));}break;default:return!![];}};Dialer[_0xbabb('0x1e')][_0xbabb('0x188')]=function(_0x1f51af,_0x55e44f,_0x4360ab){var _0x1f9369=this;var _0x2940cf=new History(_0x1f51af);return new BPromise(function(_0x28bffb,_0x111911){if(_[_0xbabb('0x42')](_0x55e44f)&&_0xbabb('0x14b')!==typeof _0x55e44f){return _0x111911(msgResponse(_0xbabb('0x189'),'Failure',_0xbabb('0x18a')));}if(_[_0xbabb('0x42')](_0x4360ab)&&_0xbabb('0x14b')!==typeof _0x4360ab){return _0x111911(msgResponse(_0xbabb('0x189'),_0xbabb('0x123'),_0xbabb('0x18b')));}switch(_0x4360ab['reason']){case'0':_0x55e44f[_0xbabb('0x18c')]+=0x1;_0x2940cf['state']=0x0;_0x2940cf[_0xbabb('0xa5')]=_0xbabb('0x18d');_0x1f9369[_0xbabb('0xc7')](_0x2940cf)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1f9369[_0xbabb('0x18e')](0x0,_0x1f51af,_0x55e44f)){if(_0x2940cf['countbusyretry']+_0x2940cf[_0xbabb('0x17a')]+_0x2940cf['countnoanswerretry']>=_0x55e44f['dialGlobalMaxRetry']){_0x1f9369['stateGlobal'](_0x2940cf,_0x28bffb,_0x111911,_0xbabb('0x18f'));}else{_0x1f9369[_0xbabb('0x190')](_0x2940cf,_0x28bffb,_0x111911,_0xbabb('0x18f'));}}break;case'3':_0x55e44f['outboundNoAnswerCallsDay']+=0x1;_0x2940cf[_0xbabb('0xa4')]=0x3;_0x2940cf[_0xbabb('0xa5')]=_0xbabb('0x191');_0x2940cf[_0xbabb('0x17b')]+=0x1;_0x2940cf[_0xbabb('0x192')]+=0x1;_0x1f9369['createHistory'](_0x2940cf)[_0xbabb('0xae')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1f9369[_0xbabb('0x18e')](0x3,_0x1f51af,_0x55e44f)){if(_0x2940cf['countnoanswerretry']>=_0x55e44f[_0xbabb('0x17d')]){_0x1f9369[_0xbabb('0x190')](_0x2940cf,_0x28bffb,_0x111911,_0xbabb('0x193'));}else{_0x1f9369[_0xbabb('0x194')](_0x2940cf,_0x28bffb,_0x111911,_0xbabb('0x193'));}}break;case'5':_0x55e44f[_0xbabb('0x195')]+=0x1;_0x2940cf[_0xbabb('0xa4')]=0x5;_0x2940cf['statedesc']='Busy';_0x2940cf[_0xbabb('0x182')]+=0x1;_0x2940cf[_0xbabb('0x192')]+=0x1;_0x1f9369[_0xbabb('0xc7')](_0x2940cf)[_0xbabb('0xae')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1f9369[_0xbabb('0x18e')](0x5,_0x1f51af,_0x55e44f)){if(_0x2940cf[_0xbabb('0x182')]>=_0x55e44f[_0xbabb('0x181')]){_0x1f9369[_0xbabb('0x190')](_0x2940cf,_0x28bffb,_0x111911,_0xbabb('0x196'));}else{_0x1f9369[_0xbabb('0x194')](_0x2940cf,_0x28bffb,_0x111911,'reason\x205\x20busy');}}break;case'8':_0x55e44f['outboundCongestionCallsDay']+=0x1;_0x2940cf['state']=0x8;_0x2940cf[_0xbabb('0xa5')]='Congestion';_0x2940cf[_0xbabb('0x17a')]+=0x1;_0x2940cf[_0xbabb('0x192')]+=0x1;_0x1f9369[_0xbabb('0xc7')](_0x2940cf)[_0xbabb('0xae')](loggerCatch(_0xbabb('0x197')));if(_0x1f9369['checkRetriveMax'](0x8,_0x1f51af,_0x55e44f)){if(_0x2940cf[_0xbabb('0x17a')]>=_0x55e44f[_0xbabb('0x185')]){_0x1f9369['createStateFinal'](_0x2940cf,_0x28bffb,_0x111911,_0xbabb('0x198'));}else{_0x1f9369[_0xbabb('0x194')](_0x2940cf,_0x28bffb,_0x111911,_0xbabb('0x198'));}}break;default:_0x55e44f[_0xbabb('0x199')]+=0x1;_0x2940cf[_0xbabb('0xa4')]=0xc;_0x2940cf[_0xbabb('0xa5')]=_0x4360ab['reason'];_0x1f9369[_0xbabb('0xc7')](_0x2940cf)['catch'](loggerCatch(_0xbabb('0x19a')));if(_0x1f9369['checkRetriveMax'](_0x4360ab['reason'],_0x1f51af,_0x55e44f)){if(_0x2940cf[_0xbabb('0x182')]+_0x2940cf['countcongestionretry']+_0x2940cf[_0xbabb('0x17b')]>=_0x55e44f[_0xbabb('0x17c')]){_0x1f9369[_0xbabb('0x194')](_0x2940cf,_0x28bffb,_0x111911,_0x4360ab[_0xbabb('0xf3')]);}else{_0x1f9369[_0xbabb('0x190')](_0x2940cf,_0x28bffb,_0x111911,_0x4360ab[_0xbabb('0xf3')]);}}}});};Dialer['prototype']['stateGlobal']=function(_0x33583b,_0x58f564,_0x2d9f16,_0x48bb98){var _0x319694=new Final(_0x33583b);_0x319694[_0xbabb('0xa4')]=0xf;_0x319694[_0xbabb('0xa5')]='Global';this[_0xbabb('0x190')](_0x319694,_0x58f564,_0x2d9f16,_0x48bb98);};Dialer['prototype'][_0xbabb('0x190')]=function(_0x2f4f7f,_0x544dd7,_0x45e8cf,_0x194e0d){this[_0xbabb('0xc5')](_0x2f4f7f)[_0xbabb('0xba')](function(_0x49d45c){return _0x544dd7(msgResponse(_0xbabb('0x189'),_0xbabb('0xd5'),_0x194e0d));})[_0xbabb('0xae')](function(_0x5a7905){return _0x45e8cf(msgResponse(_0xbabb('0x19b'),_0xbabb('0x123'),_0xbabb('0x19c')));});};Dialer[_0xbabb('0x1e')]['predictive']=function(_0x3ae53c){var _0x240352=this;var _0x170172=_0x3ae53c[_0xbabb('0x19d')]/0x64;var _0x185a6e=_0x3ae53c[_0xbabb('0x64')]/(_0x3ae53c[_0xbabb('0x64')]+_0x3ae53c['outboundAnswerCallsDay']);var _0x254071=Math['round'](_0x3ae53c[_0xbabb('0x6d')]*(_0x3ae53c['predictiveIntervalMaxThreshold']/0x64));var _0x54c12e=Math[_0xbabb('0x19e')](_0x3ae53c[_0xbabb('0x6d')]*(_0x3ae53c['predictiveIntervalMinThreshold']/0x64));var _0x1943b9=_0x3ae53c['available']+_0x3ae53c[_0xbabb('0x9d')];var _0x1aac73=Math[_0xbabb('0x19f')](_0x3ae53c[_0xbabb('0x6f')]*_0x3ae53c[_0xbabb('0x71')]*_0x3ae53c[_0xbabb('0x1a0')]*_0x3ae53c['predictiveIntervalMultiplicativeFactor']);if(_[_0xbabb('0x42')](_0x3ae53c['startProgressive'])){if(!_['isUndefined'](_0x3ae53c['startPredictive'])){_0x3ae53c['startPredictive']=undefined;loggerPredictive[_0xbabb('0x92')](_0xbabb('0x1a1'),_0xbabb('0x1a2'));}if(!_['isUndefined'](_0x3ae53c[_0xbabb('0x8e')])){loggerPredictive[_0xbabb('0x92')](_0xbabb('0x1a1'),_0xbabb('0x1a3'));clearInterval(_0x3ae53c[_0xbabb('0x8e')]);_0x3ae53c[_0xbabb('0x8e')]=undefined;}_0x3ae53c[_0xbabb('0x2d')]=moment()['format'](_0xbabb('0xf7'));loggerPredictive[_0xbabb('0x7b')](_0x3ae53c[_0xbabb('0x45')],_0xbabb('0x1a4'),_0x3ae53c[_0xbabb('0x2d')]);this[_0xbabb('0x13a')](_0x3ae53c,0x1);}else if(ifInterval(_0x3ae53c[_0xbabb('0x1a5')],_0x3ae53c['startProgressive'])){this[_0xbabb('0x13a')](_0x3ae53c,0x1);loggerPredictiveCalls[_0xbabb('0x7b')]('[startMethodPredictive][StartProgressive][Loop]',_0x3ae53c[_0xbabb('0x2d')],_0x3ae53c[_0xbabb('0x45')]);_0x3ae53c['erlangCalls']=0x0;_0x3ae53c[_0xbabb('0x6a')]=0x0;}else if(_0x170172<_0x185a6e&&_0x3ae53c[_0xbabb('0x1a6')]===_0xbabb('0x1a7')){freeVariablesPredictive(_0x3ae53c);loggerPredictive['info'](_0xbabb('0x1a8'),_0xbabb('0x1a9'),_0x185a6e,_0xbabb('0x2d'),_0x3ae53c[_0xbabb('0x45')]);}else if(_0x1aac73<_0x3ae53c[_0xbabb('0x6a')]&&_0x3ae53c[_0xbabb('0x1a6')]===_0xbabb('0x1a7')){freeVariablesPredictive(_0x3ae53c);loggerPredictive['info'](_0xbabb('0x1aa'),'Max\x20Drop\x20',_0x1aac73,'Drop\x20in\x20this\x20interval',_0x3ae53c['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x3ae53c[_0xbabb('0x45')]);}else if(!ifInterval(_0x3ae53c[_0xbabb('0x1a5')],_0x3ae53c['startProgressive'])&&_[_0xbabb('0x42')](_0x3ae53c[_0xbabb('0x2c')])&&!_['isUndefined'](_0x3ae53c[_0xbabb('0x2d')])){_0x3ae53c[_0xbabb('0x2c')]=moment()[_0xbabb('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbabb('0x7b')](_0x3ae53c[_0xbabb('0x45')],'started\x20in\x20predictive\x20at',_0x3ae53c['startPredictive']);this[_0xbabb('0xbc')](_0x3ae53c[_0xbabb('0x1a5')])['then'](this[_0xbabb('0x1ab')](_0x3ae53c))['then'](mergeDataErlangB(_0x3ae53c))['then'](this['startMethodPredictive'](_0x3ae53c))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3ae53c));}else if(!ifInterval(_0x3ae53c['dialPredictiveInterval'],_0x3ae53c[_0xbabb('0x2c')])){_0x3ae53c[_0xbabb('0x6a')]=0x0;_0x3ae53c[_0xbabb('0x2c')]=moment()['format'](_0xbabb('0xf7'));loggerPredictive['info'](_0x3ae53c[_0xbabb('0x45')],'recalculate\x20predictive\x20at',_0x3ae53c[_0xbabb('0x2c')]);clearInterval(_0x3ae53c['handlePredictive']);_0x3ae53c[_0xbabb('0x8e')]=undefined;this['averageHandleTime'](_0x3ae53c[_0xbabb('0x1a5')])[_0xbabb('0xba')](this['getDataPredictive'](_0x3ae53c))[_0xbabb('0xba')](mergeDataErlangB(_0x3ae53c))[_0xbabb('0xba')](this[_0xbabb('0x1ac')](_0x3ae53c))[_0xbabb('0xae')](loggerCatchPredictive(_0xbabb('0x1ad'),_0x3ae53c));}else if(_0x3ae53c[_0xbabb('0x6d')]&&_0x1943b9<_0x3ae53c[_0xbabb('0x6d')]-_0x54c12e){freeVariablesPredictive(_0x3ae53c);loggerPredictive['info'](_0x3ae53c[_0xbabb('0x45')],_0xbabb('0x1ae'),_0x1943b9,')\x20are\x20less\x20than\x20threshold\x20(',_0x3ae53c[_0xbabb('0x6d')],'-',_0x54c12e,'=',_0x3ae53c['predictiveIntervalAvailable']-_0x54c12e,')');}else if(_0x3ae53c['predictiveIntervalAvailable']&&_0x1943b9>_0x3ae53c[_0xbabb('0x6d')]+_0x254071){freeVariablesPredictive(_0x3ae53c);loggerPredictive[_0xbabb('0x7b')](_0x3ae53c[_0xbabb('0x45')],_0xbabb('0x1ae'),_0x1943b9,_0xbabb('0x1af'),_0x3ae53c[_0xbabb('0x6d')],'+',_0x254071,'=',_0x3ae53c[_0xbabb('0x6d')]+_0x254071,')');}};Dialer[_0xbabb('0x1e')]['getDataPredictive']=function(_0x41db1d){var _0xb85fc6=this;return function(_0x177bea){return new BPromise(function(_0x8cb02b,_0x304f6d){_[_0xbabb('0x8b')](_0x41db1d,_0x177bea[0x0]);if(checkGetDataPredictive(_0x177bea[0x0])){var _0x5a1696=_0x41db1d['predictiveIntervalAvailable']=_0x41db1d[_0xbabb('0x9d')]+_0x41db1d[_0xbabb('0x54')];var _0x5523b6=_0x41db1d[_0xbabb('0x1a5')]*0x3c;var _0x51e332=_0x177bea[0x0][_0xbabb('0x68')]+_0x177bea[0x0][_0xbabb('0x67')];var _0x32c132=(_0x177bea[0x0]['predictiveIntervalAnsweredCalls']+_0x177bea[0x0][_0xbabb('0xfe')]+_0x177bea[0x0][_0xbabb('0x69')])/_0x177bea[0x0][_0xbabb('0x7d')];_0x41db1d['predictiveIntervalHitRate']=_0x32c132>0x0?_0x32c132:0x1;switch(_0x41db1d['dialPredictiveOptimization']){case'dropRate':var _0x5b4e1c=_0x41db1d['dialPredictiveOptimizationPercentage']/0x64;return _0xb85fc6[_0xbabb('0x1b0')](_0x5a1696,_0x5523b6,_0x51e332,_0x32c132,_0x5b4e1c)[_0xbabb('0xba')](function(_0x408768){return _0x8cb02b(_0x408768);});case _0xbabb('0x1b1'):var _0xd6da8a=_0x41db1d[_0xbabb('0x19d')]/0x64;return _0xb85fc6['busyFactor'](_0x5a1696,_0x5523b6,_0x51e332,_0x32c132,_0xd6da8a)[_0xbabb('0xba')](function(_0x1ec839){return _0x8cb02b(_0x1ec839);});default:return _0x304f6d(msgResponse(_0xbabb('0x1b2'),_0xbabb('0x123'),_0xbabb('0x1b3')));}}else{return _0x304f6d(msgResponse(_0xbabb('0x1b2'),_0xbabb('0x123'),_0xbabb('0x1b4')));}});};};Dialer[_0xbabb('0x1e')]['getDataPredictiveOld']=function(_0x1abf99){var _0x5d424d=this;return function(_0x184815){return new BPromise(function(_0xa50f5,_0x5a7b0b){_[_0xbabb('0x8b')](_0x1abf99,_0x184815[0x0]);if(checkGetDataPredictive(_0x184815[0x0])){loggerPredictive[_0xbabb('0x7b')](JSON['stringify'](_0x184815[0x0]));if(_0x1abf99['dialPredictiveOptimization']===_0xbabb('0x1a7')){return _0x5d424d[_0xbabb('0xc3')](_0x1abf99['id'])['then'](function(_0x274775){var _0x1db68d=_0x1abf99[_0xbabb('0x55')]-_0x274775[0x0][_0xbabb('0x1b5')];var _0x3e92e0=_0x1abf99[_0xbabb('0x1a5')]*0x3c;var _0x5e87d4=_0x184815[0x0][_0xbabb('0x68')]+_0x184815[0x0][_0xbabb('0x67')];var _0x1850c6=(_0x184815[0x0][_0xbabb('0x1b6')]+_0x184815[0x0][_0xbabb('0xfe')]+_0x184815[0x0][_0xbabb('0x69')])/_0x184815[0x0][_0xbabb('0x7d')];var _0x40696d=_0x1abf99[_0xbabb('0x19d')]/0x64;_0x1abf99[_0xbabb('0x6c')]=_0x274775[0x0][_0xbabb('0x1b5')]||0x0;_0x1abf99[_0xbabb('0x1a0')]=_0x1850c6>0x0?_0x1850c6:0x1;return _0x5d424d[_0xbabb('0x1b0')](_0x1db68d,_0x3e92e0,_0x5e87d4,_0x1850c6,_0x40696d);})[_0xbabb('0xba')](function(_0xc080a9){return _0xa50f5(_0xc080a9);})[_0xbabb('0xae')](function(_0x3cb937){return _0x5a7b0b(msgResponse('[CatchErlangB]','Failure',JSON[_0xbabb('0x76')](_0x3cb937)));});}if(_0x1abf99[_0xbabb('0x1a6')]===_0xbabb('0x1b1')){return _0x5d424d[_0xbabb('0xc3')](_0x1abf99['id'])[_0xbabb('0xba')](function(_0x25f35a){var _0x1c54cb=_0x1abf99['loggedIn']-_0x25f35a[0x0][_0xbabb('0x1b5')];var _0x4840b1=_0x1abf99[_0xbabb('0x1a5')]*0x3c;var _0x330bca=_0x184815[0x0][_0xbabb('0x68')]+_0x184815[0x0]['predictiveIntervalAvgHoldtime'];var _0x20fb1b=(_0x184815[0x0]['predictiveIntervalAnsweredCalls']+_0x184815[0x0][_0xbabb('0xfe')]+_0x184815[0x0][_0xbabb('0x69')])/_0x184815[0x0][_0xbabb('0x7d')];var _0x4e13be=_0x1abf99[_0xbabb('0x19d')]/0x64;_0x1abf99['predictiveIntervalPauses']=_0x25f35a[0x0][_0xbabb('0x1b5')]||0x0;_0x1abf99['predictiveIntervalHitRate']=_0x20fb1b>0x0?_0x20fb1b:0x1;return _0x5d424d['busyFactor'](_0x1c54cb,_0x4840b1,_0x330bca,_0x20fb1b,_0x4e13be);})[_0xbabb('0xba')](function(_0x45fb04){return _0xa50f5(_0x45fb04);})[_0xbabb('0xae')](function(_0x330c15){return _0x5a7b0b(msgResponse(_0xbabb('0x1b7'),_0xbabb('0x123'),JSON[_0xbabb('0x76')](_0x330c15)));});}}else{return _0x5a7b0b(msgResponse('[getDataPredictive]','Failure',_0xbabb('0x1b4')));}});};};Dialer[_0xbabb('0x1e')][_0xbabb('0x1ac')]=function(_0x46a025){var _0x179a51=this;return function(){var _0x4c9757=0x0;var _0x44824a=Math[_0xbabb('0x19f')](_0x46a025[_0xbabb('0x70')]*0x3e8);if(_0x44824a>0x0){_0x44824a=_0x44824a<0x64?0x64:_0x44824a;loggerPredictive[_0xbabb('0x7b')](_0x46a025[_0xbabb('0x45')],_0xbabb('0x1b8'),_0x44824a,_0xbabb('0x4e'));_0x46a025[_0xbabb('0x8e')]=setInterval(function(){_0x179a51[_0xbabb('0x8e')](_0x46a025);loggerPredictiveCalls[_0xbabb('0x7b')](_0xbabb('0x1b9'),_0x4c9757+=0x1);},_0x44824a);}else{loggerPredictive[_0xbabb('0x7b')](_0x46a025[_0xbabb('0x45')],_0xbabb('0x1ba'));}};};Dialer[_0xbabb('0x1e')][_0xbabb('0x1bb')]=function(_0x456514,_0x16f42c){var _0x3f9e97=this;return function(_0x2f4f2a){if(_[_0xbabb('0x4c')](_0x2f4f2a)){if(_[_0xbabb('0xab')](_0x16f42c[_0xbabb('0xd2')])||!_0x16f42c['recallme']){if(_0x456514[_0xbabb('0x137')]===_0xbabb('0x7')){_0x456514[_0xbabb('0x10a')]=_[_0xbabb('0x42')](_0x456514[_0xbabb('0x10a')])?!![]:_0x456514[_0xbabb('0x10a')];var _0x58971b=uuid['v4']();_0x3f9e97['actions'][_0x58971b]=new Action(_0x456514,_0x16f42c,_0x58971b);loggerBooked['info'](_0xbabb('0x1bc'),_0x58971b,_0xbabb('0x1bd'),JSON[_0xbabb('0x76')](_0x456514['queueStatusComplete']),_0xbabb('0x1be'),_0x456514['name']);if(_0x456514['queueStatusComplete']){_0x456514[_0xbabb('0x10a')]=![];_0x3f9e97['queueBooked'][_0x3f9e97[_0xbabb('0x28')][_0x58971b][_0xbabb('0xb0')]]=[];ami[_0xbabb('0xac')]({'actionid':_0x58971b,'action':'queuestatus','queue':_0x456514['name']})[_0xbabb('0xae')](function(_0x2b17de){_0x3f9e97[_0xbabb('0xb2')](_0x456514);_0x3f9e97[_0xbabb('0xbe')]({'active':![],'ContactId':_0x3f9e97[_0xbabb('0x28')][_0x58971b][_0xbabb('0xd0')],'ListId':_0x3f9e97['actions'][_0x58971b][_0xbabb('0xd1')],'VoiceQueueId':_0x3f9e97[_0xbabb('0x28')][_0x58971b][_0xbabb('0x10e')]||undefined,'CampaignId':_0x3f9e97[_0xbabb('0x28')][_0x58971b]['CampaignId']||undefined})[_0xbabb('0xae')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3f9e97[_0xbabb('0x28')][_0x58971b];});}else{loggerBooked[_0xbabb('0x7b')](_0xbabb('0x1bf'),JSON[_0xbabb('0x76')](_0x456514[_0xbabb('0x10a')]),_0xbabb('0x1be'),_0x456514[_0xbabb('0x45')]);_0x3f9e97[_0xbabb('0xb2')](_0x456514);_0x3f9e97['rescheduleContact']({'active':![],'ContactId':_0x3f9e97['actions'][_0x58971b][_0xbabb('0xd0')],'ListId':_0x3f9e97[_0xbabb('0x28')][_0x58971b][_0xbabb('0xd1')],'VoiceQueueId':_0x3f9e97[_0xbabb('0x28')][_0x58971b]['VoiceQueueId']||undefined,'CampaignId':_0x3f9e97[_0xbabb('0x28')][_0x58971b][_0xbabb('0xd3')]||undefined})[_0xbabb('0xae')](loggerCatch(_0xbabb('0x1c0')));delete _0x3f9e97[_0xbabb('0x28')][_0x58971b];}}else{return _0x3f9e97[_0xbabb('0x1c1')](_0x456514,_0x16f42c);}}else{if(getDiff(_0x16f42c[_0xbabb('0x1c2')])<_0x456514[_0xbabb('0x1c3')]*0x3c){_0x3f9e97['preview'][_0xbabb('0x10c')](_0x16f42c['id'])[_0xbabb('0x20')](function(){_0x3f9e97['updateOriginated'](_0x456514);});}else{_0x456514[_0xbabb('0x65')]+=0x1;_0x3f9e97['updateOriginated'](_0x456514);if(_0x456514['dialRecallInQueue']){_0x3f9e97['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16f42c[_0xbabb('0xd0')],'ListId':_0x16f42c[_0xbabb('0xd1')],'VoiceQueueId':_0x16f42c[_0xbabb('0x10e')]||undefined,'CampaignId':_0x16f42c[_0xbabb('0xd3')]||undefined})[_0xbabb('0xae')](loggerCatch(_0xbabb('0x1c4')));_0x3f9e97[_0xbabb('0xc7')](createObjHistory(_0x456514,_0x16f42c,_0xbabb('0x1c5'),0x17,_0xbabb('0x1c6')))['catch'](loggerCatch(_0xbabb('0x1c7')));}else{_0x3f9e97[_0xbabb('0xce')](createObjHistory(_0x456514,_0x16f42c,_0xbabb('0x1c8'),0x16,_0xbabb('0x1c9')),_0xbabb('0x1ca'),'[Originate][HistoryRecallClose]');}}}}else{_0x456514[_0xbabb('0x61')]+=0x1;_0x3f9e97[_0xbabb('0xce')](createObjHistory(_0x456514,_0x16f42c,_0xbabb('0x1cb'),0xd,_0xbabb('0x1cc')),'[Originate][historyBlacklist]',_0xbabb('0x1cd'));throw'inBlackList';}};};Dialer[_0xbabb('0x1e')][_0xbabb('0x13f')]=function(_0x402a98){var _0x13c9dc=this;var _0x17e8dd=[];var _0x12ed7b=_0x402a98['limitCalls']-_0x402a98[_0xbabb('0x6e')]-_0x402a98[_0xbabb('0x1ce')];emitCampaignSummary(_0x402a98);if(_0x12ed7b>0x0){if(_0x12ed7b>this[_0xbabb('0x26')]){_0x12ed7b=this[_0xbabb('0x26')];}_0x402a98['temp']+=_0x12ed7b;this[_0xbabb('0xc2')](_0x402a98['id'],_0x12ed7b,_0x402a98[_0xbabb('0x1cf')])[_0xbabb('0xba')](function(_0x383e69){_0x402a98[_0xbabb('0x1ce')]-=_0x12ed7b;_0x402a98['temp']=_0x402a98['temp']>0x0?_0x402a98['temp']:0x0;if(!checkContactEmpty(_0x383e69)){_0x402a98[_0xbabb('0x43')]=_0xbabb('0x1d0');logger[_0xbabb('0x7b')](_0xbabb('0x1d1')+_0x402a98[_0xbabb('0x45')]);}else{_0x402a98[_0xbabb('0x6e')]+=_0x383e69['length'];_0x402a98[_0xbabb('0x43')]='RUNNING';for(var _0x532ca4=0x0;_0x532ca4<_0x383e69[_0xbabb('0x128')];_0x532ca4+=0x1){_0x402a98['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x383e69[_0x532ca4])||_[_0xbabb('0xab')](_0x383e69[_0x532ca4][_0xbabb('0x14d')])||_[_0xbabb('0xab')](_0x383e69[_0x532ca4][_0xbabb('0x14d')][_0xbabb('0x16f')])){_0x13c9dc[_0xbabb('0xcc')]('[actionOriginate]\x20',_0x402a98,_0x383e69[_0x532ca4]);}else{_0x13c9dc[_0xbabb('0xb9')](_[_0xbabb('0xcf')](_0x383e69[_0x532ca4],[_0xbabb('0xd3'),_0xbabb('0x1d2')]))[_0xbabb('0xba')](_0x13c9dc['checkContactBlack'](_0x402a98,_0x383e69[_0x532ca4]))['catch'](_0x13c9dc[_0xbabb('0xcb')](_0xbabb('0x1d3'),_0x402a98));}}}})[_0xbabb('0xae')](loggerGetContactDialer(_0xbabb('0x1d4'),_0x402a98,_0x12ed7b));}};Dialer[_0xbabb('0x1e')][_0xbabb('0x13a')]=function(_0x31c28a,_0x640023){var _0x56ac4f=this;var _0x118e3e=[];var _0x5a8776=_0x640023>=0x1?_0x640023:0x1;var _0x28e3c8=[];if(_0x31c28a[_0xbabb('0x137')]===_0xbabb('0x7')){_0x5a8776=0x1;}var _0xa4b9b3=Math[_0xbabb('0x19f')](_0x31c28a[_0xbabb('0x54')]*_0x5a8776)-_0x31c28a['originated']-_0x31c28a['temp'];emitVoiceQueueSummary(_0x31c28a);if(_0x31c28a[_0xbabb('0x1d5')]>0x0){var _0x18fdfb=_0x31c28a['dialLimitQueue']-_0x31c28a[_0xbabb('0x6e')]-_0x31c28a[_0xbabb('0x9d')]-_0x31c28a[_0xbabb('0x1ce')]-_0x31c28a[_0xbabb('0x9e')];if(_0xa4b9b3>_0x18fdfb){_0xa4b9b3=_0x18fdfb;}}if(_0xa4b9b3>0x0){if(_0x31c28a[_0xbabb('0x137')]===_0xbabb('0x7')){_0xa4b9b3=0x1;}if(_0xa4b9b3>this[_0xbabb('0x26')]){_0xa4b9b3=this[_0xbabb('0x26')];}_0x31c28a[_0xbabb('0x1ce')]+=_0xa4b9b3;for(var _0x4e96b5 in this['agents']){if(this[_0xbabb('0x104')][_0xbabb('0x95')](_0x4e96b5)){if(this[_0xbabb('0x104')][_0x4e96b5][_0xbabb('0xa4')]==='not_inuse'&&this['agents'][_0x4e96b5]['status']===_0xbabb('0xd8')){_0x118e3e[_0xbabb('0x129')](this[_0xbabb('0x104')][_0x4e96b5]['id']);}}}this['getContactDialer'](_0x31c28a['id'],_0x118e3e,_0xa4b9b3,_0x31c28a['dialOrderByScheduledAt'])[_0xbabb('0xba')](function(_0x3414e7){_0x31c28a['temp']-=_0xa4b9b3;_0x31c28a[_0xbabb('0x1ce')]=_0x31c28a[_0xbabb('0x1ce')]>0x0?_0x31c28a['temp']:0x0;if(!checkContactEmpty(_0x3414e7)){_0x56ac4f[_0xbabb('0xb4')](_0x31c28a)['then'](sendMessageReschedule(_0x31c28a))[_0xbabb('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0x31c28a[_0xbabb('0x6e')]+=_0x3414e7[_0xbabb('0x128')];_0x31c28a[_0xbabb('0x43')]=_0x31c28a['dialMethod']==='booked'?_0xbabb('0x153'):_0xbabb('0x1d6');for(var _0x47496e=0x0;_0x47496e<_0x3414e7[_0xbabb('0x128')];_0x47496e+=0x1){if(_[_0xbabb('0xab')](_0x3414e7[_0x47496e])||_[_0xbabb('0xab')](_0x3414e7[_0x47496e][_0xbabb('0x14d')])||_[_0xbabb('0xab')](_0x3414e7[_0x47496e][_0xbabb('0x14d')][_0xbabb('0x16f')])){_0x56ac4f[_0xbabb('0xcc')](_0xbabb('0x1d7'),_0x31c28a,_0x3414e7[_0x47496e]);}else{_0x56ac4f[_0xbabb('0xb7')](_[_0xbabb('0xcf')](_0x3414e7[_0x47496e],[_0xbabb('0x10e'),'Contact.phone']))['then'](_0x56ac4f[_0xbabb('0x1bb')](_0x31c28a,_0x3414e7[_0x47496e]))[_0xbabb('0xae')](_0x56ac4f[_0xbabb('0xcb')](_0xbabb('0x1d7'),_0x31c28a));}}}})[_0xbabb('0xae')](loggerGetContactDialer(_0xbabb('0x1d8'),_0x31c28a,_0xa4b9b3));}};Dialer[_0xbabb('0x1e')][_0xbabb('0x8e')]=function(_0x45f2a9){var _0x2995c1=this;if(_0x45f2a9['dialLimitQueue']>0x0){var _0x3e8719=_0x45f2a9[_0xbabb('0x1d5')]-_0x45f2a9[_0xbabb('0x6e')]-_0x45f2a9[_0xbabb('0x9d')];if(_0x3e8719>0x0){this['tryOriginatePredictive'](_0x45f2a9);}else{loggerPredictiveCalls[_0xbabb('0x7b')](_0xbabb('0x1d9'));}}else{this['tryOriginatePredictive'](_0x45f2a9);}};Dialer['prototype'][_0xbabb('0x1da')]=function(_0x4ccde7){var _0x7f5eec=this;var _0x4a59d7=[];_0x4ccde7[_0xbabb('0x6e')]+=0x1;for(var _0x45ba02 in this[_0xbabb('0x104')]){if(this['agents'][_0xbabb('0x95')](_0x45ba02)){if(this['agents'][_0x45ba02]['state']===_0xbabb('0x1db')&&this[_0xbabb('0x104')][_0x45ba02]['status']===_0xbabb('0xd8')){_0x4a59d7[_0xbabb('0x129')](this[_0xbabb('0x104')][_0x45ba02]['id']);}}}this[_0xbabb('0xc0')](_0x4ccde7['id'],_0x4a59d7,0x1,_0x4ccde7['dialOrderByScheduledAt'])[_0xbabb('0xba')](function(_0x283cd3){if(!checkContactEmpty(_0x283cd3)){checkContactLowerLimitOriginate(_0x4ccde7,0x1,0x0);_0x7f5eec[_0xbabb('0xb4')](_0x4ccde7)[_0xbabb('0xba')](sendMessageReschedule(_0x4ccde7))[_0xbabb('0xae')](loggerCatch(_0xbabb('0xb6')));}else{_0x4ccde7[_0xbabb('0x43')]=_0xbabb('0x1d6');if(_[_0xbabb('0xab')](_0x283cd3[0x0])||_[_0xbabb('0xab')](_0x283cd3[0x0]['Contact'])||_['isNil'](_0x283cd3[0x0][_0xbabb('0x14d')]['phone'])){_0x7f5eec[_0xbabb('0xcc')](_0xbabb('0x1d7'),_0x4ccde7,_0x283cd3[0x0]);}else{_0x7f5eec[_0xbabb('0xb7')](_['pick'](_0x283cd3[0x0],['VoiceQueueId',_0xbabb('0x1d2')]))[_0xbabb('0xba')](_0x7f5eec['checkContactBlack'](_0x4ccde7,_0x283cd3[0x0]))['catch'](_0x7f5eec['loggerHandler'](_0xbabb('0x1dc'),_0x4ccde7));}}})[_0xbabb('0xae')](loggerGetContactDialer('[getContactDialerPredictive]',_0x4ccde7,0x1));emitVoiceQueueSummary(_0x4ccde7);};Dialer[_0xbabb('0x1e')][_0xbabb('0x1b0')]=function(_0x33968a,_0x500cda,_0x445608,_0x269b8a,_0x573725,_0x5cf3f3){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x1dd'),_0x33968a);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x1de'),_0x500cda);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x1df'),_0x445608);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x1e0'),_0x269b8a);loggerPredictive['info'](_0xbabb('0x1e1'),_0x573725);loggerPredictive['info'](_0xbabb('0x82'));return new BPromise(function(_0x326c79,_0x2270a0){if(_0x33968a<=0x0||isNaN(_0x33968a)){return _0x2270a0(msgResponse('[abandonmentRate]','Error','m\x20=\x20'+_0x33968a));}if(_0x445608<=0x0||isNaN(_0x445608)){return _0x2270a0(msgResponse(_0xbabb('0x1e2'),'Error',_0xbabb('0x1e3')+_0x445608));}if(_0x269b8a<=0x0||isNaN(_0x269b8a)){return _0x2270a0(msgResponse(_0xbabb('0x1e2'),_0xbabb('0x175'),'p\x20=\x20'+_0x269b8a));}if(_0x500cda<=0x0||isNaN(_0x500cda)){return _0x2270a0(msgResponse('[abandonmentRate]','Error',_0xbabb('0x1e4')+_0x500cda));}if(_0x573725<=0x0||isNaN(_0x573725)){return _0x2270a0(msgResponse('[abandonmentRate]',_0xbabb('0x175'),'Amax\x20=\x20'+_0x573725));}_0x5cf3f3=_0x5cf3f3||0x0;var _0xb44c96=0x1/_0x445608;var _0x3a5de5=0x0;var _0x286c83=0x0;var _0x533e81=0x0;var _0x5238e1=0x0;for(var _0xa191ea=0x0;_0x533e81<_0x573725;_0xa191ea+=0x1){_0x286c83=_0xa191ea/_0x500cda;_0x3a5de5=(_0x269b8a*_0x286c83+_0x5cf3f3)/_0xb44c96;_0x533e81=erlangb(_0x3a5de5,_0x33968a);_0x5238e1=_0x3a5de5/_0x33968a*(0x1-erlangb(_0x3a5de5,_0x33968a));}return _0x326c79({'erlangCalls':_0xa191ea,'erlangCallToSecond':_0x500cda/_0xa191ea,'erlangAbandonmentRate':_0x533e81,'erlangBusyFactor':_0x5238e1});});};Dialer[_0xbabb('0x1e')]['busyFactor']=function(_0x230312,_0x4b58d3,_0x36864d,_0x411e10,_0x3c0449,_0x1d9e1b){loggerPredictive['info'](_0xbabb('0x1e5'));loggerPredictive['info'](_0xbabb('0x1dd'),_0x230312);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x1de'),_0x4b58d3);loggerPredictive[_0xbabb('0x7b')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x36864d);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x1e0'),_0x411e10);loggerPredictive[_0xbabb('0x7b')](_0xbabb('0x1e6'),_0x3c0449);loggerPredictive['info'](_0xbabb('0x82'));return new BPromise(function(_0x1658b0,_0x4b8351){if(_0x230312<=0x0||isNaN(_0x230312)){return _0x4b8351(msgResponse('[busyFactor]',_0xbabb('0x175'),_0xbabb('0x1e7')+_0x230312));}if(_0x36864d<=0x0||isNaN(_0x36864d)){return _0x4b8351(msgResponse(_0xbabb('0x1e8'),_0xbabb('0x175'),_0xbabb('0x1e3')+_0x36864d));}if(_0x411e10<=0x0||isNaN(_0x411e10)){return _0x4b8351(msgResponse(_0xbabb('0x1e8'),_0xbabb('0x175'),'p\x20=\x20'+_0x411e10));}if(_0x4b58d3<=0x0||isNaN(_0x4b58d3)){return _0x4b8351(msgResponse(_0xbabb('0x1e8'),_0xbabb('0x175'),_0xbabb('0x1e4')+_0x4b58d3));}if(_0x3c0449<=0x0||isNaN(_0x3c0449)){return _0x4b8351(msgResponse('[busyFactor]','Error',_0xbabb('0x1e9')+_0x3c0449));}_0x1d9e1b=_0x1d9e1b||0x0;var _0x3a304c=0x1/_0x36864d;var _0x96021a=0x0;var _0x996222=0x0;var _0x3501b5=0x0;var _0x4e9795=0x0;for(var _0x53dbec=0x0;_0x4e9795<_0x3c0449;_0x53dbec+=0x1){_0x996222=_0x53dbec/_0x4b58d3;_0x96021a=(_0x411e10*_0x996222+_0x1d9e1b)/_0x3a304c;_0x3501b5=erlangb(_0x96021a,_0x230312);_0x4e9795=_0x96021a/_0x230312*(0x1-erlangb(_0x96021a,_0x230312));}return _0x1658b0({'erlangCalls':_0x53dbec,'erlangCallToSecond':_0x4b58d3/_0x53dbec,'erlangAbandonmentRate':_0x3501b5,'erlangBusyFactor':_0x4e9795});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 9b1a41f..91c425e 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d58=['originatecalleridname','exports','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x30a373,_0x438067){var _0x546814=function(_0x33c4ca){while(--_0x33c4ca){_0x30a373['push'](_0x30a373['shift']());}};_0x546814(++_0x438067);}(_0x4d58,0x92));var _0x84d5=function(_0x42bcac,_0x33ad7b){_0x42bcac=_0x42bcac-0x0;var _0x93a091=_0x4d58[_0x42bcac];return _0x93a091;};'use strict';var util=require('util');var _=require(_0x84d5('0x0'));var moment=require('moment');function getSeconds(_0x567259,_0x2d187d){var _0x301bbe=moment(_0x567259)[_0x84d5('0x1')](0x0);var _0x362bc4=moment(_0x2d187d)[_0x84d5('0x1')](0x0);return _0x301bbe['diff'](_0x362bc4,_0x84d5('0x2'));}function QueueCallerAbandon(_0x5b70ab,_0x8b7baa){this[_0x84d5('0x3')]=_0x5b70ab['scheduledat'];this[_0x84d5('0x4')]=_0x5b70ab[_0x84d5('0x4')];this[_0x84d5('0x5')]=_0x5b70ab[_0x84d5('0x4')]===_0x84d5('0x6')?_0x84d5('0x7'):_0x5b70ab[_0x84d5('0x4')];this[_0x84d5('0x8')]=_0x5b70ab['countbusyretry'];this['countcongestionretry']=_0x5b70ab[_0x84d5('0x9')];this[_0x84d5('0xa')]=_0x5b70ab[_0x84d5('0xa')];this[_0x84d5('0xb')]=_0x5b70ab['countbusyretry']+_0x5b70ab[_0x84d5('0x9')]+_0x5b70ab['countnoanswerretry'];this['uniqueid']=_0x8b7baa[_0x84d5('0xc')];this['calleridname']=_0x5b70ab['name'];this[_0x84d5('0xd')]=_0x5b70ab[_0x84d5('0xe')];this[_0x84d5('0xf')]=_0x5b70ab[_0x84d5('0xf')];this['responsetime']=_0x5b70ab[_0x84d5('0x10')];this[_0x84d5('0x11')]=_0x5b70ab['droptime'];this[_0x84d5('0x12')]=this[_0x84d5('0x11')];this[_0x84d5('0x13')]=getSeconds(_0x5b70ab[_0x84d5('0x10')],_0x5b70ab[_0x84d5('0xf')]);this[_0x84d5('0x14')]=getSeconds(this[_0x84d5('0x11')],_0x5b70ab[_0x84d5('0x10')]);this['talktime']=0x0;this[_0x84d5('0x7')]=_0x8b7baa[_0x84d5('0x7')];this[_0x84d5('0x15')]=_0x8b7baa[_0x84d5('0x16')];this['reason']=_0x8b7baa[_0x84d5('0x17')];this[_0x84d5('0x18')]=_0x5b70ab[_0x84d5('0x18')];this[_0x84d5('0x19')]=_0x5b70ab[_0x84d5('0x19')];this[_0x84d5('0x1a')]=_0x5b70ab[_0x84d5('0x1a')];this[_0x84d5('0x1b')]=_0x5b70ab[_0x84d5('0x1b')];this[_0x84d5('0x1c')]=_0x5b70ab[_0x84d5('0x1c')];this['ListId']=_0x5b70ab[_0x84d5('0x1d')];this[_0x84d5('0x1e')]=_0x5b70ab['UserId'];this[_0x84d5('0x1f')]=_0x5b70ab[_0x84d5('0x1f')];this[_0x84d5('0x20')]=_0x5b70ab[_0x84d5('0x20')];this[_0x84d5('0x21')]=_0x5b70ab[_0x84d5('0x21')]||'';this['originatecalleridname']=_0x5b70ab[_0x84d5('0x22')]||'';}module[_0x84d5('0x23')]=QueueCallerAbandon; \ No newline at end of file +var _0x9866=['responsetime','droptime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','number','starttime'];(function(_0x47bcdd,_0x5a74bd){var _0x5d8071=function(_0x4fab9f){while(--_0x4fab9f){_0x47bcdd['push'](_0x47bcdd['shift']());}};_0x5d8071(++_0x5a74bd);}(_0x9866,0x158));var _0x6986=function(_0x4e0dff,_0x8b11ae){_0x4e0dff=_0x4e0dff-0x0;var _0x176956=_0x9866[_0x4e0dff];return _0x176956;};'use strict';var util=require(_0x6986('0x0'));var _=require('lodash');var moment=require(_0x6986('0x1'));function getSeconds(_0x321025,_0x3b92b8){var _0x56d381=moment(_0x321025)['milliseconds'](0x0);var _0x4ddb0e=moment(_0x3b92b8)[_0x6986('0x2')](0x0);return _0x56d381['diff'](_0x4ddb0e,_0x6986('0x3'));}function QueueCallerAbandon(_0x363d46,_0x3dcf89){this[_0x6986('0x4')]=_0x363d46['scheduledat'];this['type']=_0x363d46[_0x6986('0x5')];this[_0x6986('0x6')]=_0x363d46[_0x6986('0x5')]===_0x6986('0x7')?'queue':_0x363d46[_0x6986('0x5')];this[_0x6986('0x8')]=_0x363d46[_0x6986('0x8')];this[_0x6986('0x9')]=_0x363d46[_0x6986('0x9')];this[_0x6986('0xa')]=_0x363d46['countnoanswerretry'];this[_0x6986('0xb')]=_0x363d46[_0x6986('0x8')]+_0x363d46[_0x6986('0x9')]+_0x363d46['countnoanswerretry'];this[_0x6986('0xc')]=_0x3dcf89['uniqueid'];this['calleridname']=_0x363d46[_0x6986('0xd')];this['calleridnum']=_0x363d46[_0x6986('0xe')];this[_0x6986('0xf')]=_0x363d46['starttime'];this[_0x6986('0x10')]=_0x363d46['responsetime'];this[_0x6986('0x11')]=_0x363d46['droptime'];this['endtime']=this[_0x6986('0x11')];this[_0x6986('0x12')]=getSeconds(_0x363d46[_0x6986('0x10')],_0x363d46[_0x6986('0xf')]);this['holdtime']=getSeconds(this['droptime'],_0x363d46[_0x6986('0x10')]);this[_0x6986('0x13')]=0x0;this[_0x6986('0x14')]=_0x3dcf89[_0x6986('0x14')];this[_0x6986('0x15')]=_0x3dcf89[_0x6986('0x16')];this['reason']=_0x3dcf89[_0x6986('0x17')];this[_0x6986('0x18')]=_0x363d46[_0x6986('0x18')];this[_0x6986('0x19')]=_0x363d46[_0x6986('0x19')];this['callbackat']=_0x363d46[_0x6986('0x1a')];this[_0x6986('0x1b')]=_0x363d46[_0x6986('0x1b')];this[_0x6986('0x1c')]=_0x363d46[_0x6986('0x1c')];this[_0x6986('0x1d')]=_0x363d46[_0x6986('0x1d')];this[_0x6986('0x1e')]=_0x363d46['UserId'];this[_0x6986('0x1f')]=_0x363d46[_0x6986('0x1f')];this[_0x6986('0x20')]=_0x363d46[_0x6986('0x20')];this[_0x6986('0x21')]=_0x363d46[_0x6986('0x21')]||'';this[_0x6986('0x22')]=_0x363d46['originatecalleridname']||'';}module[_0x6986('0x23')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 0149a93..fb630de 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5372=['moment','uniqueid','channel','format','%s/%s/%s','Trunk','localstationid','headerinfo','path','AttachmentId','util','lodash'];(function(_0x561e94,_0x538f28){var _0xd3cea3=function(_0x3c6066){while(--_0x3c6066){_0x561e94['push'](_0x561e94['shift']());}};_0xd3cea3(++_0x538f28);}(_0x5372,0x12a));var _0x2537=function(_0x22cb15,_0xd19206){_0x22cb15=_0x22cb15-0x0;var _0x3844b4=_0x5372[_0x22cb15];return _0x3844b4;};'use strict';var util=require(_0x2537('0x0'));var _=require(_0x2537('0x1'));var moment=require(_0x2537('0x2'));function Action(_0x5fb082,_0x444c2b,_0x43c03f){this[_0x2537('0x3')]=_0x5fb082||undefined;this[_0x2537('0x4')]=util[_0x2537('0x5')](_0x2537('0x6'),_0x444c2b['tech'],_0x444c2b[_0x2537('0x7')]['name'],_0x43c03f['fax']);this[_0x2537('0x8')]=_0x444c2b[_0x2537('0x8')];this[_0x2537('0x9')]=_0x444c2b[_0x2537('0x9')];this[_0x2537('0xa')]=_0x43c03f[_0x2537('0xa')];this['AttachmentId']=_0x43c03f[_0x2537('0xb')];}module['exports']=Action; \ No newline at end of file +var _0x9de2=['moment','format','%s/%s/%s','tech','Trunk','name','localstationid','headerinfo','path','AttachmentId','exports','util','lodash'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x9de2,0x102));var _0x29de=function(_0x3ac132,_0x90a111){_0x3ac132=_0x3ac132-0x0;var _0x12d6ca=_0x9de2[_0x3ac132];return _0x12d6ca;};'use strict';var util=require(_0x29de('0x0'));var _=require(_0x29de('0x1'));var moment=require(_0x29de('0x2'));function Action(_0x1f9cde,_0x14e7f4,_0x541cd3){this['uniqueid']=_0x1f9cde||undefined;this['channel']=util[_0x29de('0x3')](_0x29de('0x4'),_0x14e7f4[_0x29de('0x5')],_0x14e7f4[_0x29de('0x6')][_0x29de('0x7')],_0x541cd3['fax']);this[_0x29de('0x8')]=_0x14e7f4[_0x29de('0x8')];this[_0x29de('0x9')]=_0x14e7f4[_0x29de('0x9')];this[_0x29de('0xa')]=_0x541cd3[_0x29de('0xa')];this[_0x29de('0xb')]=_0x541cd3['AttachmentId'];}module[_0x29de('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 91b2c0c..04a5511 100644 --- a/server/services/ami/fax/index.js +++ b/server/services/ami/fax/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19a0=['FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','unmonitored','checkTrunk','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','syncVarSet','bind','newstate','newexten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','hasOwnProperty','exten','localstationid','uniqueid','channel','name','actions','info','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','operation','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','notify','calleridnum','catch','error','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','execOriginate'];(function(_0x588c33,_0xe686f7){var _0x5c639c=function(_0x128ccf){while(--_0x128ccf){_0x588c33['push'](_0x588c33['shift']());}};_0x5c639c(++_0xe686f7);}(_0x19a0,0x107));var _0x019a=function(_0x9f7958,_0x496d9f){_0x9f7958=_0x9f7958-0x0;var _0x53d281=_0x19a0[_0x9f7958];return _0x53d281;};'use strict';var util=require(_0x019a('0x0'));var _=require(_0x019a('0x1'));var BPromise=require(_0x019a('0x2'));var uuid=require(_0x019a('0x3'));var moment=require(_0x019a('0x4'));var path=require(_0x019a('0x5'));var tiff2pdf=require(_0x019a('0x6'));var gs=require(_0x019a('0x7'));var logger=require(_0x019a('0x8'))(_0x019a('0x9'));var ami=require(_0x019a('0xa'));var rpcDb=require(_0x019a('0xb'));var Channel=require(_0x019a('0xc'));var ut=require(_0x019a('0xd'));var Action=require(_0x019a('0xe'));var faxAccount=require(_0x019a('0xf'));var attachment=require(_0x019a('0x10'));var faxMessage=require(_0x019a('0x11'));function Fax(_0x1aa17b){this[_0x019a('0x12')]={};this[_0x019a('0x13')]=_0x1aa17b[_0x019a('0x13')];this[_0x019a('0x14')]=_0x1aa17b[_0x019a('0x14')];this['actions']={};ami['on']('newchannel',this['syncNewchannel']['bind'](this));ami['on']('varset',this[_0x019a('0x15')][_0x019a('0x16')](this));ami['on'](_0x019a('0x17'),this['syncNewState'][_0x019a('0x16')](this));ami['on'](_0x019a('0x18'),this['syncNewExten'][_0x019a('0x16')](this));ami['on']('faxstatus',this[_0x019a('0x19')]['bind'](this));ami['on'](_0x019a('0x1a'),this['syncReceiveFax'][_0x019a('0x16')](this));ami['on'](_0x019a('0x1b'),this[_0x019a('0x1c')]['bind'](this));ami['on'](_0x019a('0x1d'),this[_0x019a('0x1e')][_0x019a('0x16')](this));}Fax[_0x019a('0x1f')][_0x019a('0x20')]=function(_0x41c788){if(_0x41c788['context']==='from-voip-provider'){for(var _0x54a8ab in this['faxAccounts']){if(this[_0x019a('0x13')][_0x019a('0x21')](_0x54a8ab)){if(_0x41c788[_0x019a('0x22')]===this[_0x019a('0x13')][_0x54a8ab][_0x019a('0x23')]){this[_0x019a('0x12')][_0x41c788[_0x019a('0x24')]]={};this[_0x019a('0x12')][_0x41c788['uniqueid']][_0x019a('0x25')]=_0x41c788['channel'];this[_0x019a('0x12')][_0x41c788[_0x019a('0x24')]]['id']=this[_0x019a('0x13')][_0x54a8ab]['id'];this[_0x019a('0x12')][_0x41c788['uniqueid']][_0x019a('0x26')]=this[_0x019a('0x13')][_0x54a8ab][_0x019a('0x26')];logger['info'](_0x41c788[_0x019a('0x24')],'\x20syncNewchannel\x20');}}}}if(this[_0x019a('0x27')][_0x41c788[_0x019a('0x24')]]){this[_0x019a('0x12')][_0x41c788[_0x019a('0x24')]]={};this[_0x019a('0x12')][_0x41c788[_0x019a('0x24')]][_0x019a('0x25')]=_0x41c788['channel'];logger[_0x019a('0x28')](_0x41c788['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x019a('0x1f')][_0x019a('0x15')]=function(_0x453d98){if(this[_0x019a('0x12')][_0x453d98[_0x019a('0x24')]]){for(var _0x7c1d26 in _0x453d98[_0x019a('0x29')]){if(_0x453d98[_0x019a('0x29')][_0x019a('0x21')](_0x7c1d26)){this[_0x019a('0x12')][_0x453d98[_0x019a('0x24')]][_0x7c1d26]=_0x453d98[_0x019a('0x2a')];}}}};Fax[_0x019a('0x1f')][_0x019a('0x2b')]=function(_0x4e7d46){if(this[_0x019a('0x12')][_0x4e7d46['uniqueid']]){this[_0x019a('0x12')][_0x4e7d46['uniqueid']][_0x019a('0x2c')]=_0x4e7d46[_0x019a('0x2c')];this[_0x019a('0x12')][_0x4e7d46[_0x019a('0x24')]][_0x019a('0x2d')]=_0x4e7d46[_0x019a('0x2d')];}};Fax[_0x019a('0x1f')][_0x019a('0x2e')]=function(_0x5d12d1){if(this[_0x019a('0x12')][_0x5d12d1[_0x019a('0x24')]]){for(var _0x4068a6 in _0x5d12d1['variable']){if(_0x5d12d1['variable'][_0x019a('0x21')](_0x4068a6)){this['channels'][_0x5d12d1[_0x019a('0x24')]][_0x4068a6]=_0x5d12d1[_0x019a('0x2a')];}}}};Fax[_0x019a('0x1f')][_0x019a('0x19')]=function(_0x5bfc31){if(this['channels'][_0x5bfc31['uniqueid']]){this[_0x019a('0x12')][_0x5bfc31[_0x019a('0x24')]][_0x019a('0x2f')]=_0x5bfc31[_0x019a('0x2f')];this[_0x019a('0x12')][_0x5bfc31[_0x019a('0x24')]][_0x019a('0x30')]=_0x5bfc31[_0x019a('0x30')];this['channels'][_0x5bfc31['uniqueid']]['localstationid']=_0x5bfc31[_0x019a('0x23')];this['channels'][_0x5bfc31[_0x019a('0x24')]][_0x019a('0x31')]=_0x5bfc31[_0x019a('0x31')];logger[_0x019a('0x28')](_0x5bfc31['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x019a('0x1f')][_0x019a('0x32')]=function(_0x284f1a){var _0x1d9257=this;if(this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]]){var _0x6adbf7=this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]]['id'];this['channels'][_0x284f1a['uniqueid']][_0x019a('0x33')]=_0x284f1a['remotestationid'];this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]][_0x019a('0x34')]=_0x284f1a[_0x019a('0x34')];this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]][_0x019a('0x23')]=_0x284f1a[_0x019a('0x23')];this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]]['resolution']=_0x284f1a[_0x019a('0x35')];this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]]['transferrate']=_0x284f1a['transferrate'];this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]][_0x019a('0x31')]=_0x284f1a[_0x019a('0x31')];this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]]['calleridnum']=_0x284f1a['calleridnum'];if(this[_0x019a('0x12')][_0x284f1a[_0x019a('0x24')]][_0x019a('0x34')]>0x0){tiff2pdf(_0x284f1a[_0x019a('0x31')],_0x019a('0x36'),function(_0x3c3687){logger[_0x019a('0x28')](_0x284f1a[_0x019a('0x24')],_0x019a('0x37'),_0x3c3687[_0x019a('0x38')]);attachment['create']({'name':path['parse'](_0x284f1a[_0x019a('0x31')])['name'],'basename':path[_0x019a('0x39')](_0x284f1a[_0x019a('0x31')])[_0x019a('0x26')]+_0x019a('0x3a'),'type':'application/pdf'})['then'](function(_0x5cf0ee){faxAccount[_0x019a('0x3b')](_0x6adbf7,{'from':_0x284f1a[_0x019a('0x3c')],'mapKey':_0x019a('0x9'),'body':path[_0x019a('0x39')](_0x284f1a['filename'])[_0x019a('0x26')]+_0x019a('0x3a'),'AttachmentId':_0x5cf0ee['id']})[_0x019a('0x3d')](function(_0x1dd77f){logger[_0x019a('0x3e')](_0x284f1a[_0x019a('0x24')],'\x20notify\x20',JSON['stringify'](_0x1dd77f));});})[_0x019a('0x3d')](function(_0x131819){logger[_0x019a('0x3e')](_0x284f1a[_0x019a('0x24')],_0x019a('0x3f'),JSON['stringify'](_0x131819));});});}logger[_0x019a('0x28')](_0x284f1a[_0x019a('0x24')],'\x20receiveFax\x20');}};Fax[_0x019a('0x1f')][_0x019a('0x1e')]=function(_0x31f06b){if(this['actions'][_0x31f06b[_0x019a('0x24')]]){_[_0x019a('0x40')](this[_0x019a('0x12')][_0x31f06b[_0x019a('0x24')]],_[_0x019a('0x41')](_0x31f06b,['response',_0x019a('0x42')]));}};function updateStatus(_0x7f16a8){if(_0x7f16a8[_0x019a('0x43')]){faxMessage[_0x019a('0x44')](_0x7f16a8[_0x019a('0x43')],{'failMessage':_0x019a('0x45')})[_0x019a('0x46')](function(_0x449ce0){ut[_0x019a('0x47')]('[Fax][Message][Error][Updated]',_0x449ce0);})[_0x019a('0x3d')](function(_0x3155d9){ut[_0x019a('0x47')](_0x019a('0x48'),_0x3155d9);});}else{ut[_0x019a('0x47')](_0x019a('0x49'));}}Fax[_0x019a('0x1f')][_0x019a('0x4a')]=function(_0x16c3f0,_0x336ce5,_0x253f69){var _0x30bbed=this;var _0x3c9434={};if(_0x336ce5){_0x3c9434={'read':_0x336ce5};}else{_0x3c9434={'failMessage':_0x253f69};}if(this['actions'][_0x16c3f0][_0x019a('0x43')]){faxMessage[_0x019a('0x44')](this[_0x019a('0x27')][_0x16c3f0]['AttachmentId'],_0x3c9434)[_0x019a('0x46')](function(_0x404ed7){ut[_0x019a('0x47')](_0x019a('0x4b'),_0x404ed7);})['catch'](function(_0x3d6d9a){ut[_0x019a('0x47')](_0x019a('0x4c'),_0x3d6d9a);})[_0x019a('0x4d')](function(){delete _0x30bbed['channels'][_0x16c3f0];delete _0x30bbed[_0x019a('0x27')][_0x16c3f0];});}else{ut[_0x019a('0x47')](_0x019a('0x4e'));delete this[_0x019a('0x12')][_0x16c3f0];delete this[_0x019a('0x27')][_0x16c3f0];}};Fax['prototype']['syncHangup']=function(_0x48baf7){var _0x5b6219=this;if(this[_0x019a('0x12')][_0x48baf7[_0x019a('0x24')]]){if(this[_0x019a('0x27')][_0x48baf7['uniqueid']]){this[_0x019a('0x12')][_0x48baf7[_0x019a('0x24')]]['id']=this[_0x019a('0x27')][_0x48baf7['uniqueid']]['id'];this['channels'][_0x48baf7[_0x019a('0x24')]][_0x019a('0x26')]=this[_0x019a('0x27')][_0x48baf7['uniqueid']][_0x019a('0x26')];}logger[_0x019a('0x28')](_0x48baf7[_0x019a('0x24')],this['actions'][_0x48baf7['uniqueid']]?_0x019a('0x4f'):_0x019a('0x50'),JSON[_0x019a('0x51')](this[_0x019a('0x12')][_0x48baf7['uniqueid']]));if(this[_0x019a('0x27')][_0x48baf7['uniqueid']]){if(this[_0x019a('0x12')][_0x48baf7['uniqueid']][_0x019a('0x52')]>0x0&&this[_0x019a('0x12')][_0x48baf7['uniqueid']][_0x019a('0x53')]===_0x019a('0x54')){this['updateStatus'](_0x48baf7['uniqueid'],!![]);}else{this[_0x019a('0x4a')](_0x48baf7[_0x019a('0x24')],![],this[_0x019a('0x12')][_0x48baf7['uniqueid']]['faxstatusstring']?_0x019a('0x55')+this[_0x019a('0x12')][_0x48baf7[_0x019a('0x24')]][_0x019a('0x56')]:'SENDING\x20FAILED');}}}};Fax['prototype']['send']=function(_0x5c2a29){var _0x1c4b1f=this;return new BPromise(function(_0x1dad11,_0x513bb1){_0x1c4b1f[_0x019a('0x57')](_0x5c2a29,_0x1c4b1f['faxAccounts'][_0x5c2a29[_0x019a('0x58')]])[_0x019a('0x46')](function(_0x4df8a8){ut[_0x019a('0x47')](_0x019a('0x59'),_0x4df8a8);_0x1dad11(ut['message'](_0x019a('0x5a')));})[_0x019a('0x3d')](function(_0x1682ac){ut[_0x019a('0x47')](_0x019a('0x5b'),_0x1682ac);updateStatus(_0x5c2a29);_0x513bb1(ut[_0x019a('0x38')](_0x019a('0x5c')));});});};Fax['prototype'][_0x019a('0x5d')]=function(_0xee128e){var _0x197a86=this;return new BPromise(function(_0x3ac9bc,_0x5529b0){var _0x45e241=_0x197a86['checkTrunk'](_0x197a86[_0x019a('0x13')][_0xee128e[_0x019a('0x58')]][_0x019a('0x5e')],_0xee128e);if(_0x45e241[_0x019a('0x5f')]){_0x3ac9bc(ut[_0x019a('0x38')](_0x019a('0x60')));}else{_0x5529b0(ut[_0x019a('0x38')](_0x45e241[_0x019a('0x38')]));}});};function originate(_0xe993b3,_0x49dd37,_0x4cfa28){return new BPromise(function(_0x5d8f51,_0x359e35){if(_0x4cfa28){var _0xf7fdf9=util['format'](_0x019a('0x61'),path[_0x019a('0x39')](_0xe993b3[_0x019a('0x5')])[_0x019a('0x26')],_0xe993b3[_0x019a('0x5')]);gs[_0x019a('0x62')](_0xf7fdf9)[_0x019a('0x46')](function(){_0xe993b3[_0x019a('0x5')]=util[_0x019a('0x63')]('%s/%s.tif',path[_0x019a('0x39')](_0xe993b3[_0x019a('0x5')])['dir'],path[_0x019a('0x39')](_0xe993b3['path'])['name']);_0x49dd37[_0x019a('0x64')]=_0xe993b3['path'];ut[_0x019a('0x47')](_0x019a('0x65'),'');ami[_0x019a('0x66')](ut[_0x019a('0x67')](_0xe993b3,_0x49dd37))['then'](function(_0x594be0){_0x5d8f51(_0x594be0);})['catch'](function(_0x231328){_0x359e35(_0x231328);});})[_0x019a('0x3d')](function(_0x5d61ef){_0x359e35(_0x5d61ef);});}else{ami[_0x019a('0x66')](ut['variablesAction'](_0xe993b3,_0x49dd37))['then'](function(_0x1818da){_0x5d8f51(_0x1818da);})[_0x019a('0x3d')](function(_0x22e2c2){_0x359e35(_0x22e2c2);});}});}Fax[_0x019a('0x1f')][_0x019a('0x57')]=function(_0xdb6f71,_0x1bfff5){var _0x22bfc7=this;return new BPromise(function(_0x4b60e9,_0x2be1cc){var _0x54cc8f=uuid['v4']();var _0x16e55b=ut[_0x019a('0x68')](_0xdb6f71,_0x1bfff5);_0x22bfc7['actions'][_0x54cc8f]=new Action(_0x54cc8f,_0x1bfff5,_0xdb6f71);var _0x463c94=_0x22bfc7[_0x019a('0x27')][_0x54cc8f];if(path['parse'](_0xdb6f71[_0x019a('0x5')])[_0x019a('0x69')]===_0x019a('0x3a')){originate(_0x463c94,_0x16e55b,!![])[_0x019a('0x46')](function(_0x21a16d){_0x4b60e9(_0x21a16d);})[_0x019a('0x3d')](function(_0x5f4f4b){_0x2be1cc(_0x5f4f4b);});}else{originate(_0x463c94,_0x16e55b,![])[_0x019a('0x46')](function(_0x458aa2){_0x4b60e9(_0x458aa2);})['catch'](function(_0x2f6e84){_0x2be1cc(_0x2f6e84);});}});};Fax[_0x019a('0x1f')]['isTrunkReachable']=function(_0x22c711){return!_[_0x019a('0x6a')](_0x22c711)&&!_[_0x019a('0x6a')](_0x22c711[_0x019a('0x26')])&&!_[_0x019a('0x6a')](_0x22c711['active'])&&_0x22c711[_0x019a('0x6b')]&&!_[_0x019a('0x6a')](this[_0x019a('0x14')][util[_0x019a('0x63')](_0x019a('0x6c'),_0x22c711[_0x019a('0x26')])])&&!_[_0x019a('0x6a')](this['trunks'][util[_0x019a('0x63')](_0x019a('0x6c'),_0x22c711[_0x019a('0x26')])][_0x019a('0x30')])&&(this['trunks'][util['format'](_0x019a('0x6c'),_0x22c711[_0x019a('0x26')])][_0x019a('0x30')]==='reachable'||this[_0x019a('0x14')][util[_0x019a('0x63')](_0x019a('0x6c'),_0x22c711[_0x019a('0x26')])]['status']===_0x019a('0x6d'));};Fax[_0x019a('0x1f')][_0x019a('0x6e')]=function(_0x48ea55,_0x2ae232){if(!this['isTrunkReachable'](_0x48ea55)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x019a('0x6a')](_0x48ea55)?'':_0x48ea55[_0x019a('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x019a('0x6f')};}if(_[_0x019a('0x6a')](_0x2ae232[_0x019a('0x9')])){ut[_0x019a('0x47')](_0x019a('0x70'),JSON[_0x019a('0x51')](_0x2ae232));return{'isValid':![],'message':_0x019a('0x71')};}if(_['isNil'](_0x2ae232[_0x019a('0x5')])){ut[_0x019a('0x47')](_0x019a('0x72'),JSON['stringify'](_0x2ae232));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x019a('0x73')};};module[_0x019a('0x74')]=Fax; \ No newline at end of file +var _0x4e25=['SENDING\x20FAILED','execOriginate','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','dir','XMF-PATH','Action','addVariables','ext','isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncVarSet','bind','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','localstationid','filename','remotestationid','pagestransferred','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20'];(function(_0x2b7ffe,_0x3129be){var _0x1a009a=function(_0x1c0a18){while(--_0x1c0a18){_0x2b7ffe['push'](_0x2b7ffe['shift']());}};_0x1a009a(++_0x3129be);}(_0x4e25,0x175));var _0x54e2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4e25[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0x54e2('0x0'));var BPromise=require(_0x54e2('0x1'));var uuid=require('uuid');var moment=require(_0x54e2('0x2'));var path=require(_0x54e2('0x3'));var tiff2pdf=require(_0x54e2('0x4'));var gs=require('./util/gs');var logger=require(_0x54e2('0x5'))(_0x54e2('0x6'));var ami=require(_0x54e2('0x7'));var rpcDb=require(_0x54e2('0x8'));var Channel=require(_0x54e2('0x9'));var ut=require(_0x54e2('0xa'));var Action=require(_0x54e2('0xb'));var faxAccount=require(_0x54e2('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x54e2('0xd'));function Fax(_0x3f29fa){this['channels']={};this['faxAccounts']=_0x3f29fa[_0x54e2('0xe')];this[_0x54e2('0xf')]=_0x3f29fa[_0x54e2('0xf')];this[_0x54e2('0x10')]={};ami['on'](_0x54e2('0x11'),this['syncNewchannel']['bind'](this));ami['on']('varset',this[_0x54e2('0x12')][_0x54e2('0x13')](this));ami['on'](_0x54e2('0x14'),this[_0x54e2('0x15')][_0x54e2('0x13')](this));ami['on'](_0x54e2('0x16'),this['syncNewExten'][_0x54e2('0x13')](this));ami['on'](_0x54e2('0x17'),this[_0x54e2('0x18')]['bind'](this));ami['on'](_0x54e2('0x19'),this[_0x54e2('0x1a')][_0x54e2('0x13')](this));ami['on'](_0x54e2('0x1b'),this[_0x54e2('0x1c')][_0x54e2('0x13')](this));ami['on'](_0x54e2('0x1d'),this[_0x54e2('0x1e')][_0x54e2('0x13')](this));}Fax[_0x54e2('0x1f')][_0x54e2('0x20')]=function(_0x54844b){if(_0x54844b[_0x54e2('0x21')]==='from-voip-provider'){for(var _0x517d1f in this[_0x54e2('0xe')]){if(this[_0x54e2('0xe')][_0x54e2('0x22')](_0x517d1f)){if(_0x54844b[_0x54e2('0x23')]===this[_0x54e2('0xe')][_0x517d1f]['localstationid']){this[_0x54e2('0x24')][_0x54844b[_0x54e2('0x25')]]={};this[_0x54e2('0x24')][_0x54844b['uniqueid']][_0x54e2('0x26')]=_0x54844b[_0x54e2('0x26')];this[_0x54e2('0x24')][_0x54844b[_0x54e2('0x25')]]['id']=this['faxAccounts'][_0x517d1f]['id'];this[_0x54e2('0x24')][_0x54844b['uniqueid']]['name']=this[_0x54e2('0xe')][_0x517d1f][_0x54e2('0x27')];logger[_0x54e2('0x28')](_0x54844b[_0x54e2('0x25')],_0x54e2('0x29'));}}}}if(this[_0x54e2('0x10')][_0x54844b[_0x54e2('0x25')]]){this[_0x54e2('0x24')][_0x54844b[_0x54e2('0x25')]]={};this[_0x54e2('0x24')][_0x54844b[_0x54e2('0x25')]][_0x54e2('0x26')]=_0x54844b[_0x54e2('0x26')];logger[_0x54e2('0x28')](_0x54844b[_0x54e2('0x25')],_0x54e2('0x29'));}};Fax['prototype'][_0x54e2('0x12')]=function(_0x3a3751){if(this[_0x54e2('0x24')][_0x3a3751[_0x54e2('0x25')]]){for(var _0x3cb8c5 in _0x3a3751[_0x54e2('0x2a')]){if(_0x3a3751['variable'][_0x54e2('0x22')](_0x3cb8c5)){this['channels'][_0x3a3751[_0x54e2('0x25')]][_0x3cb8c5]=_0x3a3751[_0x54e2('0x2b')];}}}};Fax[_0x54e2('0x1f')]['syncNewState']=function(_0x4f4454){if(this[_0x54e2('0x24')][_0x4f4454[_0x54e2('0x25')]]){this[_0x54e2('0x24')][_0x4f4454[_0x54e2('0x25')]][_0x54e2('0x2c')]=_0x4f4454[_0x54e2('0x2c')];this[_0x54e2('0x24')][_0x4f4454[_0x54e2('0x25')]][_0x54e2('0x2d')]=_0x4f4454['channelstatedesc'];}};Fax['prototype'][_0x54e2('0x2e')]=function(_0x12ea16){if(this['channels'][_0x12ea16[_0x54e2('0x25')]]){for(var _0x5a10c7 in _0x12ea16[_0x54e2('0x2a')]){if(_0x12ea16[_0x54e2('0x2a')][_0x54e2('0x22')](_0x5a10c7)){this[_0x54e2('0x24')][_0x12ea16['uniqueid']][_0x5a10c7]=_0x12ea16[_0x54e2('0x2b')];}}}};Fax[_0x54e2('0x1f')][_0x54e2('0x18')]=function(_0x5e7c2e){if(this[_0x54e2('0x24')][_0x5e7c2e[_0x54e2('0x25')]]){this['channels'][_0x5e7c2e['uniqueid']]['operation']=_0x5e7c2e[_0x54e2('0x2f')];this[_0x54e2('0x24')][_0x5e7c2e[_0x54e2('0x25')]][_0x54e2('0x30')]=_0x5e7c2e[_0x54e2('0x30')];this['channels'][_0x5e7c2e['uniqueid']][_0x54e2('0x31')]=_0x5e7c2e[_0x54e2('0x31')];this[_0x54e2('0x24')][_0x5e7c2e[_0x54e2('0x25')]][_0x54e2('0x32')]=_0x5e7c2e[_0x54e2('0x32')];logger[_0x54e2('0x28')](_0x5e7c2e[_0x54e2('0x25')],'\x20syncFaxStatus\x20');}};Fax[_0x54e2('0x1f')][_0x54e2('0x1a')]=function(_0x473c14){var _0x1a84ad=this;if(this['channels'][_0x473c14[_0x54e2('0x25')]]){var _0x311d6f=this[_0x54e2('0x24')][_0x473c14[_0x54e2('0x25')]]['id'];this[_0x54e2('0x24')][_0x473c14[_0x54e2('0x25')]][_0x54e2('0x33')]=_0x473c14['remotestationid'];this['channels'][_0x473c14[_0x54e2('0x25')]][_0x54e2('0x34')]=_0x473c14[_0x54e2('0x34')];this[_0x54e2('0x24')][_0x473c14['uniqueid']]['localstationid']=_0x473c14[_0x54e2('0x31')];this['channels'][_0x473c14[_0x54e2('0x25')]]['resolution']=_0x473c14['resolution'];this[_0x54e2('0x24')][_0x473c14['uniqueid']]['transferrate']=_0x473c14['transferrate'];this[_0x54e2('0x24')][_0x473c14[_0x54e2('0x25')]][_0x54e2('0x32')]=_0x473c14['filename'];this[_0x54e2('0x24')][_0x473c14[_0x54e2('0x25')]][_0x54e2('0x35')]=_0x473c14[_0x54e2('0x35')];if(this['channels'][_0x473c14[_0x54e2('0x25')]][_0x54e2('0x34')]>0x0){tiff2pdf(_0x473c14[_0x54e2('0x32')],_0x54e2('0x36'),function(_0x3cd535){logger['info'](_0x473c14[_0x54e2('0x25')],_0x54e2('0x37'),_0x3cd535[_0x54e2('0x38')]);attachment['create']({'name':path['parse'](_0x473c14[_0x54e2('0x32')])['name'],'basename':path[_0x54e2('0x39')](_0x473c14[_0x54e2('0x32')])[_0x54e2('0x27')]+_0x54e2('0x3a'),'type':_0x54e2('0x3b')})['then'](function(_0x3ac2bd){faxAccount[_0x54e2('0x3c')](_0x311d6f,{'from':_0x473c14['calleridnum'],'mapKey':'fax','body':path[_0x54e2('0x39')](_0x473c14['filename'])[_0x54e2('0x27')]+_0x54e2('0x3a'),'AttachmentId':_0x3ac2bd['id']})[_0x54e2('0x3d')](function(_0x1839f9){logger[_0x54e2('0x3e')](_0x473c14[_0x54e2('0x25')],_0x54e2('0x3f'),JSON[_0x54e2('0x40')](_0x1839f9));});})[_0x54e2('0x3d')](function(_0x9a823d){logger[_0x54e2('0x3e')](_0x473c14['uniqueid'],_0x54e2('0x41'),JSON[_0x54e2('0x40')](_0x9a823d));});});}logger[_0x54e2('0x28')](_0x473c14[_0x54e2('0x25')],_0x54e2('0x41'));}};Fax[_0x54e2('0x1f')]['syncOriginateResponse']=function(_0x545be0){if(this[_0x54e2('0x10')][_0x545be0[_0x54e2('0x25')]]){_[_0x54e2('0x42')](this['channels'][_0x545be0[_0x54e2('0x25')]],_[_0x54e2('0x43')](_0x545be0,['response','reason']));}};function updateStatus(_0x465281){if(_0x465281[_0x54e2('0x44')]){faxMessage[_0x54e2('0x45')](_0x465281[_0x54e2('0x44')],{'failMessage':_0x54e2('0x46')})[_0x54e2('0x47')](function(_0x4fee15){ut['logger'](_0x54e2('0x48'),_0x4fee15);})[_0x54e2('0x3d')](function(_0x25beae){ut[_0x54e2('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x25beae);});}else{ut[_0x54e2('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x54e2('0x1f')][_0x54e2('0x4a')]=function(_0x34294e,_0x484cc2,_0x341d31){var _0x139c1d=this;var _0x5eb987={};if(_0x484cc2){_0x5eb987={'read':_0x484cc2};}else{_0x5eb987={'failMessage':_0x341d31};}if(this['actions'][_0x34294e][_0x54e2('0x44')]){faxMessage['update'](this[_0x54e2('0x10')][_0x34294e][_0x54e2('0x44')],_0x5eb987)[_0x54e2('0x47')](function(_0xcd1c42){ut[_0x54e2('0x49')](_0x54e2('0x4b'),_0xcd1c42);})[_0x54e2('0x3d')](function(_0xe86271){ut['logger'](_0x54e2('0x4c'),_0xe86271);})[_0x54e2('0x4d')](function(){delete _0x139c1d[_0x54e2('0x24')][_0x34294e];delete _0x139c1d['actions'][_0x34294e];});}else{ut[_0x54e2('0x49')](_0x54e2('0x4e'));delete this[_0x54e2('0x24')][_0x34294e];delete this[_0x54e2('0x10')][_0x34294e];}};Fax[_0x54e2('0x1f')]['syncHangup']=function(_0x2c6ce6){var _0x1f242f=this;if(this[_0x54e2('0x24')][_0x2c6ce6[_0x54e2('0x25')]]){if(this[_0x54e2('0x10')][_0x2c6ce6[_0x54e2('0x25')]]){this[_0x54e2('0x24')][_0x2c6ce6[_0x54e2('0x25')]]['id']=this['actions'][_0x2c6ce6[_0x54e2('0x25')]]['id'];this['channels'][_0x2c6ce6[_0x54e2('0x25')]]['name']=this[_0x54e2('0x10')][_0x2c6ce6['uniqueid']]['name'];}logger['info'](_0x2c6ce6['uniqueid'],this[_0x54e2('0x10')][_0x2c6ce6['uniqueid']]?_0x54e2('0x4f'):'\x20hangup\x20faxRiceive\x20',JSON[_0x54e2('0x40')](this[_0x54e2('0x24')][_0x2c6ce6[_0x54e2('0x25')]]));if(this[_0x54e2('0x10')][_0x2c6ce6[_0x54e2('0x25')]]){if(this[_0x54e2('0x24')][_0x2c6ce6[_0x54e2('0x25')]]['faxpages']>0x0&&this[_0x54e2('0x24')][_0x2c6ce6[_0x54e2('0x25')]][_0x54e2('0x17')]===_0x54e2('0x50')){this[_0x54e2('0x4a')](_0x2c6ce6[_0x54e2('0x25')],!![]);}else{this[_0x54e2('0x4a')](_0x2c6ce6[_0x54e2('0x25')],![],this[_0x54e2('0x24')][_0x2c6ce6[_0x54e2('0x25')]][_0x54e2('0x51')]?_0x54e2('0x52')+this[_0x54e2('0x24')][_0x2c6ce6[_0x54e2('0x25')]]['faxstatusstring']:_0x54e2('0x53'));}}}};Fax[_0x54e2('0x1f')]['send']=function(_0x3fda69){var _0x417baa=this;return new BPromise(function(_0x23642f,_0x47e494){_0x417baa[_0x54e2('0x54')](_0x3fda69,_0x417baa[_0x54e2('0xe')][_0x3fda69['FaxAccountId']])[_0x54e2('0x47')](function(_0x2cb75d){ut[_0x54e2('0x49')]('[Fax][execOriginate][success]',_0x2cb75d);_0x23642f(ut['message'](_0x54e2('0x55')));})[_0x54e2('0x3d')](function(_0x28325d){ut['logger'](_0x54e2('0x56'),_0x28325d);updateStatus(_0x3fda69);_0x47e494(ut[_0x54e2('0x38')](_0x54e2('0x57')));});});};Fax[_0x54e2('0x1f')][_0x54e2('0x58')]=function(_0x5227f0){var _0x2b9336=this;return new BPromise(function(_0x2a998a,_0x4c2df5){var _0x5da1f2=_0x2b9336[_0x54e2('0x59')](_0x2b9336[_0x54e2('0xe')][_0x5227f0[_0x54e2('0x5a')]][_0x54e2('0x5b')],_0x5227f0);if(_0x5da1f2['isValid']){_0x2a998a(ut[_0x54e2('0x38')](_0x54e2('0x5c')));}else{_0x4c2df5(ut[_0x54e2('0x38')](_0x5da1f2[_0x54e2('0x38')]));}});};function originate(_0x4e41b6,_0x37d9ef,_0x52e949){return new BPromise(function(_0x1f9180,_0x56effb){if(_0x52e949){var _0x3e5032=util['format'](_0x54e2('0x5d'),path['parse'](_0x4e41b6[_0x54e2('0x3')])['name'],_0x4e41b6[_0x54e2('0x3')]);gs[_0x54e2('0x5e')](_0x3e5032)['then'](function(){_0x4e41b6[_0x54e2('0x3')]=util[_0x54e2('0x5f')]('%s/%s.tif',path[_0x54e2('0x39')](_0x4e41b6['path'])[_0x54e2('0x60')],path['parse'](_0x4e41b6[_0x54e2('0x3')])[_0x54e2('0x27')]);_0x37d9ef[_0x54e2('0x61')]=_0x4e41b6[_0x54e2('0x3')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut['variablesAction'](_0x4e41b6,_0x37d9ef))[_0x54e2('0x47')](function(_0x91f9f){_0x1f9180(_0x91f9f);})[_0x54e2('0x3d')](function(_0xaedb39){_0x56effb(_0xaedb39);});})[_0x54e2('0x3d')](function(_0x5c1eff){_0x56effb(_0x5c1eff);});}else{ami[_0x54e2('0x62')](ut['variablesAction'](_0x4e41b6,_0x37d9ef))[_0x54e2('0x47')](function(_0x4f0fee){_0x1f9180(_0x4f0fee);})[_0x54e2('0x3d')](function(_0xb6bc49){_0x56effb(_0xb6bc49);});}});}Fax[_0x54e2('0x1f')][_0x54e2('0x54')]=function(_0x574c22,_0x323f7d){var _0x4510fb=this;return new BPromise(function(_0x379ee9,_0x314a9){var _0x2639ab=uuid['v4']();var _0x16ad1d=ut[_0x54e2('0x63')](_0x574c22,_0x323f7d);_0x4510fb[_0x54e2('0x10')][_0x2639ab]=new Action(_0x2639ab,_0x323f7d,_0x574c22);var _0x54b318=_0x4510fb[_0x54e2('0x10')][_0x2639ab];if(path['parse'](_0x574c22[_0x54e2('0x3')])[_0x54e2('0x64')]==='.pdf'){originate(_0x54b318,_0x16ad1d,!![])[_0x54e2('0x47')](function(_0x1ed281){_0x379ee9(_0x1ed281);})[_0x54e2('0x3d')](function(_0x39d20e){_0x314a9(_0x39d20e);});}else{originate(_0x54b318,_0x16ad1d,![])[_0x54e2('0x47')](function(_0x33bd70){_0x379ee9(_0x33bd70);})[_0x54e2('0x3d')](function(_0x1189f3){_0x314a9(_0x1189f3);});}});};Fax[_0x54e2('0x1f')]['isTrunkReachable']=function(_0x1384e1){return!_[_0x54e2('0x65')](_0x1384e1)&&!_[_0x54e2('0x65')](_0x1384e1[_0x54e2('0x27')])&&!_[_0x54e2('0x65')](_0x1384e1[_0x54e2('0x66')])&&_0x1384e1[_0x54e2('0x66')]&&!_[_0x54e2('0x65')](this[_0x54e2('0xf')][util[_0x54e2('0x5f')](_0x54e2('0x67'),_0x1384e1[_0x54e2('0x27')])])&&!_['isNil'](this[_0x54e2('0xf')][util[_0x54e2('0x5f')](_0x54e2('0x67'),_0x1384e1[_0x54e2('0x27')])][_0x54e2('0x30')])&&(this['trunks'][util[_0x54e2('0x5f')](_0x54e2('0x67'),_0x1384e1['name'])][_0x54e2('0x30')]==='reachable'||this['trunks'][util[_0x54e2('0x5f')](_0x54e2('0x67'),_0x1384e1[_0x54e2('0x27')])][_0x54e2('0x30')]===_0x54e2('0x68'));};Fax[_0x54e2('0x1f')]['checkTrunk']=function(_0x34d6e3,_0x29d417){if(!this[_0x54e2('0x69')](_0x34d6e3)){ut['logger'](_0x54e2('0x6a'),_[_0x54e2('0x65')](_0x34d6e3)?'':_0x34d6e3[_0x54e2('0x27')]+_0x54e2('0x6b'));return{'isValid':![],'message':_0x54e2('0x6c')};}if(_['isNil'](_0x29d417['fax'])){ut[_0x54e2('0x49')](_0x54e2('0x6d'),JSON['stringify'](_0x29d417));return{'isValid':![],'message':_0x54e2('0x6e')};}if(_['isNil'](_0x29d417[_0x54e2('0x3')])){ut['logger'](_0x54e2('0x6f'),JSON['stringify'](_0x29d417));return{'isValid':![],'message':_0x54e2('0x70')};}return{'isValid':!![],'message':_0x54e2('0x71')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index d4381d4..e9d184e 100644 --- a/server/services/ami/fax/rpcDb.js +++ b/server/services/ami/fax/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28f3=['then','[Notify]\x20','util','bluebird','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x32c19a,_0xb919e7){var _0x3b6712=function(_0x5a4b59){while(--_0x5a4b59){_0x32c19a['push'](_0x32c19a['shift']());}};_0x3b6712(++_0xb919e7);}(_0x28f3,0xfe));var _0x328f=function(_0x3a5588,_0x278045){_0x3a5588=_0x3a5588-0x0;var _0x2cddb5=_0x28f3[_0x3a5588];return _0x2cddb5;};'use strict';var util=require(_0x328f('0x0'));var BPromise=require(_0x328f('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x328f('0x2'));var faxAccount=require(_0x328f('0x3'));function loggerCatch(_0xdf97e6){return function(_0x3b678c){logger[_0x328f('0x4')](_0xdf97e6,util[_0x328f('0x5')](_0x3b678c,{'showHidden':![],'depth':null}));};}exports[_0x328f('0x6')]=function(_0x8eba1f,_0x58035b){return BPromise['resolve']()[_0x328f('0x7')](faxAccount[_0x328f('0x6')](_0x8eba1f,_0x58035b))['catch'](loggerCatch(_0x328f('0x8')));}; \ No newline at end of file +var _0x567d=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','bluebird'];(function(_0x4df9fb,_0x480c7c){var _0xcfedf6=function(_0x23715e){while(--_0x23715e){_0x4df9fb['push'](_0x4df9fb['shift']());}};_0xcfedf6(++_0x480c7c);}(_0x567d,0x1a3));var _0xd567=function(_0x38b6bd,_0x206cb8){_0x38b6bd=_0x38b6bd-0x0;var _0x287ab5=_0x567d[_0x38b6bd];return _0x287ab5;};'use strict';var util=require('util');var BPromise=require(_0xd567('0x0'));var logger=require(_0xd567('0x1'))(_0xd567('0x2'));var _=require(_0xd567('0x3'));var faxAccount=require(_0xd567('0x4'));function loggerCatch(_0x1047df){return function(_0x5dd20b){logger[_0xd567('0x5')](_0x1047df,util[_0xd567('0x6')](_0x5dd20b,{'showHidden':![],'depth':null}));};}exports[_0xd567('0x7')]=function(_0x234e32,_0x546d2d){return BPromise[_0xd567('0x8')]()[_0xd567('0x9')](faxAccount[_0xd567('0x7')](_0x234e32,_0x546d2d))[_0xd567('0xa')](loggerCatch(_0xd567('0xb')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 0aace87..0f7f596 100644 --- a/server/services/ami/fax/util/gs.js +++ b/server/services/ami/fax/util/gs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa683=['Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x3f0121,_0x52ed43){var _0x5d3300=function(_0xd142c1){while(--_0xd142c1){_0x3f0121['push'](_0x3f0121['shift']());}};_0x5d3300(++_0x52ed43);}(_0xa683,0xfc));var _0x3a68=function(_0x5a0586,_0x3c3634){_0x5a0586=_0x5a0586-0x0;var _0x27488c=_0xa683[_0x5a0586];return _0x27488c;};'use strict';var util=require(_0x3a68('0x0'));var logger=require(_0x3a68('0x1'))(_0x3a68('0x2'));var BPromise=require(_0x3a68('0x3'));var exec=require(_0x3a68('0x4'))[_0x3a68('0x5')];exports[_0x3a68('0x6')]=function(_0x3ab87a){return new BPromise(function(_0x47efdd,_0x3a4eaa){exec(_0x3ab87a,function(_0x512d36,_0x30c854,_0x34b6f2){logger[_0x3a68('0x7')](_0x3a68('0x8'),_0x30c854);if(_0x512d36){logger['info'](_0x3a68('0x8'),'\x20Error\x20:',util[_0x3a68('0x9')](_0x512d36,{'showHidden':![],'depth':null}),_0x30c854,_0x34b6f2);_0x3a4eaa(_0x512d36);}_0x47efdd(_0x30c854);});});}; \ No newline at end of file +var _0xe5af=['exec','Exec\x20gs','\x20Error\x20:','inspect','util','child_process'];(function(_0x4b8ef6,_0x55c659){var _0x40165c=function(_0x11fd8a){while(--_0x11fd8a){_0x4b8ef6['push'](_0x4b8ef6['shift']());}};_0x40165c(++_0x55c659);}(_0xe5af,0xe2));var _0xfe5a=function(_0x5e1efc,_0x3d4021){_0x5e1efc=_0x5e1efc-0x0;var _0x17e31f=_0xe5af[_0x5e1efc];return _0x17e31f;};'use strict';var util=require(_0xfe5a('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require('bluebird');var exec=require(_0xfe5a('0x1'))[_0xfe5a('0x2')];exports['execute']=function(_0x1a234f){return new BPromise(function(_0x2f9694,_0x79183a){exec(_0x1a234f,function(_0x3c8649,_0x30ef12,_0x563c92){logger['info'](_0xfe5a('0x3'),_0x30ef12);if(_0x3c8649){logger['info']('Exec\x20gs',_0xfe5a('0x4'),util[_0xfe5a('0x5')](_0x3c8649,{'showHidden':![],'depth':null}),_0x30ef12,_0x563c92);_0x79183a(_0x3c8649);}_0x2f9694(_0x30ef12);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index d0118d7..4d79436 100644 --- a/server/services/ami/fax/util/util.js +++ b/server/services/ami/fax/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf72b=['addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','util','moment','fax','message','logger','info','inspect'];(function(_0x594f24,_0x43318d){var _0x3aa503=function(_0x3fdfff){while(--_0x3fdfff){_0x594f24['push'](_0x594f24['shift']());}};_0x3aa503(++_0x43318d);}(_0xf72b,0x1d9));var _0xbf72=function(_0x762fe5,_0xfb9670){_0x762fe5=_0x762fe5-0x0;var _0x44fe4c=_0xf72b[_0x762fe5];return _0x44fe4c;};'use strict';var util=require(_0xbf72('0x0'));var _=require('lodash');var moment=require(_0xbf72('0x1'));var logger=require('../../../../config/logger')(_0xbf72('0x2'));exports[_0xbf72('0x3')]=function(_0x5a9feb){return{'message':_0x5a9feb};};exports[_0xbf72('0x4')]=function(_0x550a9e,_0x37afc8){logger[_0xbf72('0x5')](_0x550a9e,util[_0xbf72('0x6')](_0x37afc8,{'showHidden':![],'depth':null}));};exports[_0xbf72('0x7')]=function(_0x5ee060,_0x41c11d){var _0xc0842b={'XMF-ECM':_0x41c11d[_0xbf72('0x8')],'XMF-HEADERINFO':_0x41c11d[_0xbf72('0x9')],'XMF-MINRATE':_0x41c11d[_0xbf72('0xa')],'XMF-MAXRATE':_0x41c11d[_0xbf72('0xb')],'XMF-MODEM':util['format'](_0xbf72('0xc'),_0x41c11d['modem']),'XMF-GATEWAY':_0x41c11d[_0xbf72('0xd')],'XMF-FAXDETECT':_0x41c11d[_0xbf72('0xe')],'XMF-T38TIMEOUT':_0x41c11d['t38timeout'],'XMF-LOCALSTATIONID':_0x41c11d[_0xbf72('0xf')],'XMF-PATH':_0x5ee060[_0xbf72('0x10')]};return _0xc0842b;};exports[_0xbf72('0x11')]=function(_0x145acb,_0x2957c5){return{'actionid':_0x145acb[_0xbf72('0x12')],'action':_0xbf72('0x13'),'channel':_0x145acb[_0xbf72('0x14')],'Exten':'xcally-motion-fax','Context':_0xbf72('0x15'),'Priority':'1','callerid':util[_0xbf72('0x16')](_0xbf72('0x17'),_0x145acb['headerinfo']?_0x145acb[_0xbf72('0x9')]:'',_0x145acb['localstationid']),'variable':_0x2957c5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x145acb['uniqueid']};}; \ No newline at end of file +var _0xb821=['format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','message','info','inspect','ecm','headerinfo','minrate','maxrate'];(function(_0x2aa22d,_0x375edf){var _0x683fa5=function(_0x4b9643){while(--_0x4b9643){_0x2aa22d['push'](_0x2aa22d['shift']());}};_0x683fa5(++_0x375edf);}(_0xb821,0xa7));var _0x1b82=function(_0x45119d,_0x331352){_0x45119d=_0x45119d-0x0;var _0x2fc6c7=_0xb821[_0x45119d];return _0x2fc6c7;};'use strict';var util=require('util');var _=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var logger=require('../../../../config/logger')('fax');exports[_0x1b82('0x2')]=function(_0x578a10){return{'message':_0x578a10};};exports['logger']=function(_0x3b1d14,_0x1403ab){logger[_0x1b82('0x3')](_0x3b1d14,util[_0x1b82('0x4')](_0x1403ab,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3e27c4,_0x192434){var _0x202a5f={'XMF-ECM':_0x192434[_0x1b82('0x5')],'XMF-HEADERINFO':_0x192434[_0x1b82('0x6')],'XMF-MINRATE':_0x192434[_0x1b82('0x7')],'XMF-MAXRATE':_0x192434[_0x1b82('0x8')],'XMF-MODEM':util[_0x1b82('0x9')](_0x1b82('0xa'),_0x192434['modem']),'XMF-GATEWAY':_0x192434[_0x1b82('0xb')],'XMF-FAXDETECT':_0x192434[_0x1b82('0xc')],'XMF-T38TIMEOUT':_0x192434[_0x1b82('0xd')],'XMF-LOCALSTATIONID':_0x192434[_0x1b82('0xe')],'XMF-PATH':_0x3e27c4[_0x1b82('0xf')]};return _0x202a5f;};exports[_0x1b82('0x10')]=function(_0x739f99,_0x1ce719){return{'actionid':_0x739f99['uniqueid'],'action':_0x1b82('0x11'),'channel':_0x739f99[_0x1b82('0x12')],'Exten':_0x1b82('0x13'),'Context':_0x1b82('0x14'),'Priority':'1','callerid':util['format'](_0x1b82('0x15'),_0x739f99['headerinfo']?_0x739f99['headerinfo']:'',_0x739f99[_0x1b82('0xe')]),'variable':_0x1ce719,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x739f99['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 4a20d4b..efb4a09 100644 --- a/server/services/ami/index.js +++ b/server/services/ami/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb8f=['./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTrunks','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','moment','./report','./acw','./trigger','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales'];(function(_0x52a8da,_0x5d9213){var _0x5e9460=function(_0x191193){while(--_0x191193){_0x52a8da['push'](_0x52a8da['shift']());}};_0x5e9460(++_0x5d9213);}(_0xbb8f,0xa4));var _0xfbb8=function(_0x2513c1,_0x1a0ed6){_0x2513c1=_0x2513c1-0x0;var _0x16f893=_0xbb8f[_0x2513c1];return _0x16f893;};'use strict';var BPromise=require(_0xfbb8('0x0'));var util=require('util');var moment=require(_0xfbb8('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0xfbb8('0x2'));var Acw=require(_0xfbb8('0x3'));var Trigger=require(_0xfbb8('0x4'));var Dialer=require(_0xfbb8('0x5'));var Preview=require('./preview');var Fax=require(_0xfbb8('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0xfbb8('0x7'));var voiceQueueReport=require(_0xfbb8('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xfbb8('0x9'));var trigger=require(_0xfbb8('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0xfbb8('0xb'));var campaign=require(_0xfbb8('0xc'));var voiceExtension=require(_0xfbb8('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xfbb8('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xfbb8('0xf'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xfbb8('0x10'));var zoho=require(_0xfbb8('0x11'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xfbb8('0x12'));var servicenow=require(_0xfbb8('0x13'));var dynamics365=require(_0xfbb8('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfbb8('0x15')](_0xfbb8('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xfbb8('0x15')](_0xfbb8('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xfbb8('0x17')]()[_0xfbb8('0x18')](user[_0xfbb8('0x19')]())['then'](realtime[_0xfbb8('0x1a')]())[_0xfbb8('0x18')](user[_0xfbb8('0x1b')]())['then'](realtime['initTelephones']())[_0xfbb8('0x18')](trunk['getTrunks']())['then'](realtime[_0xfbb8('0x1c')]())[_0xfbb8('0x18')](voiceQueue['getVoiceQueues']())[_0xfbb8('0x18')](realtime['initVoiceQueues']())[_0xfbb8('0x18')](trigger['getTriggers']())[_0xfbb8('0x18')](realtime[_0xfbb8('0x1d')]())[_0xfbb8('0x18')](template[_0xfbb8('0x1e')]())['then'](realtime[_0xfbb8('0x1f')]())[_0xfbb8('0x18')](zendesk[_0xfbb8('0x20')]())['then'](realtime[_0xfbb8('0x21')]())['then'](salesforce['getSalesforceAccounts']())[_0xfbb8('0x18')](realtime[_0xfbb8('0x22')]())['then'](sugarcrm[_0xfbb8('0x23')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xfbb8('0x24')]())[_0xfbb8('0x18')](realtime['initFreshdeskAccounts']())[_0xfbb8('0x18')](desk[_0xfbb8('0x25')]())['then'](realtime[_0xfbb8('0x26')]())[_0xfbb8('0x18')](zoho[_0xfbb8('0x27')]())[_0xfbb8('0x18')](realtime['initZohoAccounts']())['then'](vtiger[_0xfbb8('0x28')]())['then'](realtime[_0xfbb8('0x29')]())[_0xfbb8('0x18')](freshsales[_0xfbb8('0x2a')]())[_0xfbb8('0x18')](realtime[_0xfbb8('0x2b')]())['then'](servicenow[_0xfbb8('0x2c')]())[_0xfbb8('0x18')](realtime[_0xfbb8('0x2d')]())[_0xfbb8('0x18')](dynamics365[_0xfbb8('0x2e')]())[_0xfbb8('0x18')](realtime[_0xfbb8('0x2f')]())[_0xfbb8('0x18')](campaign[_0xfbb8('0x30')]())['then'](realtime[_0xfbb8('0x31')]())['then'](voiceExtension[_0xfbb8('0x32')]())['then'](realtime[_0xfbb8('0x33')]())['then'](faxAccount['getFaxAccounts']())[_0xfbb8('0x18')](realtime['initFaxAccounts']())[_0xfbb8('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0xfbb8('0x17')]()[_0xfbb8('0x18')](voiceQueueReport['getVoiceQueueReports']())[_0xfbb8('0x18')](realtime[_0xfbb8('0x34')]())[_0xfbb8('0x18')](cmHopperHistory[_0xfbb8('0x35')]())[_0xfbb8('0x18')](realtime[_0xfbb8('0x36')]())[_0xfbb8('0x18')](cmHopperHistory['getCampaignHopperHistory']())[_0xfbb8('0x18')](realtime[_0xfbb8('0x37')]())['then'](voiceCallReport[_0xfbb8('0x38')]())[_0xfbb8('0x18')](realtime[_0xfbb8('0x39')]())[_0xfbb8('0x18')](function(_0xaa4005){})[_0xfbb8('0x3a')](function(_0x12be0f){console[_0xfbb8('0x3b')](_0x12be0f);});}function main(){return server[_0xfbb8('0x3c')](realtime,preview,fax)[_0xfbb8('0x18')](function(_0x28d23f){return initRealtime();})['then'](function(){return initParams();})[_0xfbb8('0x18')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x4e009b){console[_0xfbb8('0x3b')](_0x4e009b);});}main(); \ No newline at end of file +var _0x45a4=['initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','catch','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','then','getAgents','initAgents','getTelephones','getTrunks','getTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions'];(function(_0x275848,_0x5b0b0e){var _0x563fc5=function(_0x261d4d){while(--_0x261d4d){_0x275848['push'](_0x275848['shift']());}};_0x563fc5(++_0x5b0b0e);}(_0x45a4,0xc3));var _0x445a=function(_0x22eb15,_0x415aa1){_0x22eb15=_0x22eb15-0x0;var _0x4d9808=_0x45a4[_0x22eb15];return _0x4d9808;};'use strict';var BPromise=require('bluebird');var util=require(_0x445a('0x0'));var moment=require(_0x445a('0x1'));var server=require(_0x445a('0x2'));var Realtime=require(_0x445a('0x3'));var Report=require(_0x445a('0x4'));var Acw=require(_0x445a('0x5'));var Trigger=require(_0x445a('0x6'));var Dialer=require(_0x445a('0x7'));var Preview=require(_0x445a('0x8'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0x445a('0x9'));var voiceQueueReport=require(_0x445a('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x445a('0xb'));var trigger=require(_0x445a('0xc'));var template=require(_0x445a('0xd'));var cmHopperHistory=require(_0x445a('0xe'));var campaign=require(_0x445a('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x445a('0x10'));var salesforce=require(_0x445a('0x11'));var sugarcrm=require(_0x445a('0x12'));var freshdesk=require(_0x445a('0x13'));var desk=require(_0x445a('0x14'));var zoho=require(_0x445a('0x15'));var vtiger=require(_0x445a('0x16'));var freshsales=require(_0x445a('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x445a('0x18')](_0x445a('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x445a('0x18')](_0x445a('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x445a('0x1a')](user[_0x445a('0x1b')]())[_0x445a('0x1a')](realtime[_0x445a('0x1c')]())[_0x445a('0x1a')](user[_0x445a('0x1d')]())[_0x445a('0x1a')](realtime['initTelephones']())[_0x445a('0x1a')](trunk[_0x445a('0x1e')]())[_0x445a('0x1a')](realtime['initTrunks']())['then'](voiceQueue['getVoiceQueues']())[_0x445a('0x1a')](realtime['initVoiceQueues']())['then'](trigger['getTriggers']())[_0x445a('0x1a')](realtime['initTriggers']())[_0x445a('0x1a')](template[_0x445a('0x1f')]())[_0x445a('0x1a')](realtime['initTemplates']())['then'](zendesk[_0x445a('0x20')]())[_0x445a('0x1a')](realtime[_0x445a('0x21')]())['then'](salesforce['getSalesforceAccounts']())[_0x445a('0x1a')](realtime[_0x445a('0x22')]())[_0x445a('0x1a')](sugarcrm[_0x445a('0x23')]())[_0x445a('0x1a')](realtime[_0x445a('0x24')]())[_0x445a('0x1a')](freshdesk['getFreshdeskAccounts']())['then'](realtime['initFreshdeskAccounts']())[_0x445a('0x1a')](desk[_0x445a('0x25')]())[_0x445a('0x1a')](realtime['initDeskAccounts']())[_0x445a('0x1a')](zoho[_0x445a('0x26')]())['then'](realtime[_0x445a('0x27')]())['then'](vtiger[_0x445a('0x28')]())[_0x445a('0x1a')](realtime[_0x445a('0x29')]())['then'](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x445a('0x2a')]())[_0x445a('0x1a')](servicenow['getServicenowAccounts']())[_0x445a('0x1a')](realtime[_0x445a('0x2b')]())[_0x445a('0x1a')](dynamics365[_0x445a('0x2c')]())[_0x445a('0x1a')](realtime[_0x445a('0x2d')]())[_0x445a('0x1a')](campaign[_0x445a('0x2e')]())['then'](realtime[_0x445a('0x2f')]())[_0x445a('0x1a')](voiceExtension[_0x445a('0x30')]())[_0x445a('0x1a')](realtime[_0x445a('0x31')]())[_0x445a('0x1a')](faxAccount['getFaxAccounts']())[_0x445a('0x1a')](realtime[_0x445a('0x32')]())[_0x445a('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x445a('0x1a')](voiceQueueReport[_0x445a('0x33')]())[_0x445a('0x1a')](realtime['initVoiceQueueReports']())[_0x445a('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x445a('0x34')]())['then'](cmHopperHistory[_0x445a('0x35')]())[_0x445a('0x1a')](realtime[_0x445a('0x36')]())['then'](voiceCallReport[_0x445a('0x37')]())[_0x445a('0x1a')](realtime[_0x445a('0x38')]())[_0x445a('0x1a')](function(_0x5b754f){})['catch'](function(_0x25b58a){console[_0x445a('0x39')](_0x25b58a);});}function main(){return server[_0x445a('0x3a')](realtime,preview,fax)[_0x445a('0x1a')](function(_0x433c61){return initRealtime();})[_0x445a('0x1a')](function(){return initParams();})[_0x445a('0x1a')](function(){report[_0x445a('0x3b')]();setInterval(initRealtime,0x1388);})[_0x445a('0x3c')](function(_0x3b5e1a){console[_0x445a('0x39')](_0x3b5e1a);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 94b7627..043d64c 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0f=['redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','not_inuse','idle','inuse','talking','statePause','toNumber','format','stateTime','stringify','user:%s','emit','exports','lodash','moment','md5','ioredis','../../../config/environment'];(function(_0xd930ed,_0x54bd00){var _0x406004=function(_0x6e5f0){while(--_0x6e5f0){_0xd930ed['push'](_0xd930ed['shift']());}};_0x406004(++_0x54bd00);}(_0x6f0f,0x1be));var _0xf6f0=function(_0x282186,_0x433534){_0x282186=_0x282186-0x0;var _0x445ef5=_0x6f0f[_0x282186];return _0x445ef5;};'use strict';var _=require(_0xf6f0('0x0'));var util=require('util');var moment=require(_0xf6f0('0x1'));var md5=require(_0xf6f0('0x2'));var Redis=require(_0xf6f0('0x3'));var config=require(_0xf6f0('0x4'));config[_0xf6f0('0x5')]=_[_0xf6f0('0x6')](config[_0xf6f0('0x5')],{'host':_0xf6f0('0x7'),'port':0x18eb});var io=require(_0xf6f0('0x8'))(new Redis(config[_0xf6f0('0x5')]));function Agent(_0x340297){this['id']=_0x340297['id']||0x0;this[_0xf6f0('0x9')]=_0x340297['name']||'';this['email']=_0x340297[_0xf6f0('0xa')]||'';this[_0xf6f0('0xb')]=_0x340297[_0xf6f0('0xb')]||'';this[_0xf6f0('0xc')]=_0x340297['fullname']||'';this[_0xf6f0('0xd')]=_0xf6f0('0xe');this['stateTime']=0x0;this[_0xf6f0('0xf')]=_0xf6f0('0xe');this[_0xf6f0('0x10')]='';this[_0xf6f0('0x11')]='';this[_0xf6f0('0x12')]='';this[_0xf6f0('0x13')]='';this[_0xf6f0('0x14')]=_0x340297['online']||![];this[_0xf6f0('0x15')]=_0xf6f0('0xe');this[_0xf6f0('0x16')]=0x0;this[_0xf6f0('0x17')]='';this[_0xf6f0('0x18')]='';this[_0xf6f0('0x19')]=![];this[_0xf6f0('0x1a')]=![];this[_0xf6f0('0x2')]='';}Agent[_0xf6f0('0x1b')][_0xf6f0('0x1c')]=function(_0x369b2a){var _0xc7cbe6;if(_0x369b2a&&_0x369b2a[_0xf6f0('0xd')]){_0xc7cbe6=_0x369b2a[_0xf6f0('0xd')]['toLowerCase']();switch(_0xc7cbe6){case _0xf6f0('0x1d'):_0xc7cbe6=_0xf6f0('0x1e');break;case _0xf6f0('0x1f'):_0xc7cbe6=_0xf6f0('0x20');break;}}if(_0xc7cbe6&&this[_0xf6f0('0x15')]!==_0xc7cbe6||_0x369b2a[_0xf6f0('0x21')]){this[_0xf6f0('0x16')]=_[_0xf6f0('0x22')](moment()[_0xf6f0('0x23')]('x'));}if(_0xc7cbe6){this['voiceStatus']=_0xc7cbe6;}var _0x242908={'id':this['id'],'name':this[_0xf6f0('0x9')],'email':this['email'],'accountcode':this[_0xf6f0('0xb')],'fullname':this[_0xf6f0('0xc')],'state':this[_0xf6f0('0xd')],'stateTime':this[_0xf6f0('0x24')],'status':this['status'],'address':this[_0xf6f0('0x10')],'online':this[_0xf6f0('0x14')],'voiceStatus':this[_0xf6f0('0x15')],'voiceStatusTime':this[_0xf6f0('0x16')],'voiceStatusCallerIdNumber':this[_0xf6f0('0x17')],'voiceStatusQueue':this[_0xf6f0('0x18')],'interface':this[_0xf6f0('0x13')],'onhold':this[_0xf6f0('0x19')]};var _0x436d0e=md5(JSON[_0xf6f0('0x25')](_0x242908));if(this[_0xf6f0('0x2')]!==_0x436d0e){this[_0xf6f0('0x2')]=_0x436d0e;io['to'](util[_0xf6f0('0x23')](_0xf6f0('0x26'),_0x242908['name']))[_0xf6f0('0x27')]('user:save',_0x242908);}};module[_0xf6f0('0x28')]=Agent; \ No newline at end of file +var _0x453f=['stringify','user:%s','emit','user:save','exports','lodash','util','moment','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','stateTime','status','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','md5','prototype','updateStatusRealtime','state','idle','inuse','statePause','toNumber','format','voiceStatusTime','voiceStatusCallerIdNumber'];(function(_0x286f45,_0x39729e){var _0x332827=function(_0x1161ba){while(--_0x1161ba){_0x286f45['push'](_0x286f45['shift']());}};_0x332827(++_0x39729e);}(_0x453f,0x18b));var _0xf453=function(_0xfaeaf9,_0x15d117){_0xfaeaf9=_0xfaeaf9-0x0;var _0xe20b69=_0x453f[_0xfaeaf9];return _0xe20b69;};'use strict';var _=require(_0xf453('0x0'));var util=require(_0xf453('0x1'));var moment=require(_0xf453('0x2'));var md5=require('md5');var Redis=require(_0xf453('0x3'));var config=require('../../../config/environment');config[_0xf453('0x4')]=_[_0xf453('0x5')](config[_0xf453('0x4')],{'host':_0xf453('0x6'),'port':0x18eb});var io=require(_0xf453('0x7'))(new Redis(config['redis']));function Agent(_0x237f46){this['id']=_0x237f46['id']||0x0;this[_0xf453('0x8')]=_0x237f46[_0xf453('0x8')]||'';this[_0xf453('0x9')]=_0x237f46[_0xf453('0x9')]||'';this[_0xf453('0xa')]=_0x237f46[_0xf453('0xa')]||'';this[_0xf453('0xb')]=_0x237f46[_0xf453('0xb')]||'';this['state']='unknown';this[_0xf453('0xc')]=0x0;this[_0xf453('0xd')]=_0xf453('0xe');this[_0xf453('0xf')]='';this[_0xf453('0x10')]='';this[_0xf453('0x11')]='';this[_0xf453('0x12')]='';this[_0xf453('0x13')]=_0x237f46['online']||![];this[_0xf453('0x14')]=_0xf453('0xe');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0xf453('0x15')]='';this[_0xf453('0x16')]=![];this['local']=![];this[_0xf453('0x17')]='';}Agent[_0xf453('0x18')][_0xf453('0x19')]=function(_0x3a93ae){var _0x4a903b;if(_0x3a93ae&&_0x3a93ae[_0xf453('0x1a')]){_0x4a903b=_0x3a93ae[_0xf453('0x1a')]['toLowerCase']();switch(_0x4a903b){case'not_inuse':_0x4a903b=_0xf453('0x1b');break;case _0xf453('0x1c'):_0x4a903b='talking';break;}}if(_0x4a903b&&this[_0xf453('0x14')]!==_0x4a903b||_0x3a93ae[_0xf453('0x1d')]){this['voiceStatusTime']=_[_0xf453('0x1e')](moment()[_0xf453('0x1f')]('x'));}if(_0x4a903b){this[_0xf453('0x14')]=_0x4a903b;}var _0x4d81bd={'id':this['id'],'name':this[_0xf453('0x8')],'email':this[_0xf453('0x9')],'accountcode':this[_0xf453('0xa')],'fullname':this[_0xf453('0xb')],'state':this['state'],'stateTime':this[_0xf453('0xc')],'status':this[_0xf453('0xd')],'address':this[_0xf453('0xf')],'online':this[_0xf453('0x13')],'voiceStatus':this[_0xf453('0x14')],'voiceStatusTime':this[_0xf453('0x20')],'voiceStatusCallerIdNumber':this[_0xf453('0x21')],'voiceStatusQueue':this[_0xf453('0x15')],'interface':this[_0xf453('0x12')],'onhold':this['onhold']};var _0x11a98f=md5(JSON[_0xf453('0x22')](_0x4d81bd));if(this[_0xf453('0x17')]!==_0x11a98f){this[_0xf453('0x17')]=_0x11a98f;io['to'](util[_0xf453('0x1f')](_0xf453('0x23'),_0x4d81bd[_0xf453('0x8')]))[_0xf453('0x24')](_0xf453('0x25'),_0x4d81bd);}};module[_0xf453('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 4459976..1e96649 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0xd18631,_0x4e1fde){var _0x49fd50=function(_0x75aaf8){while(--_0x75aaf8){_0xd18631['push'](_0xd18631['shift']());}};_0x49fd50(++_0x4e1fde);}(_0xb10b,0x12a));var _0xbb10=function(_0x49f66e,_0x3e2369){_0x49f66e=_0x49f66e-0x0;var _0x55a1e2=_0xb10b[_0x49f66e];return _0x55a1e2;};'use strict';function Campaign(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'campaign';this[_0xbb10('0x2')]=0x0;this[_0xbb10('0x3')]=0x0;this[_0xbb10('0x4')]=0x0;this[_0xbb10('0x5')]=0x0;this[_0xbb10('0x6')]='';this[_0xbb10('0x7')]=!![];this['active']=_0x13ce8d[_0xbb10('0x8')];this[_0xbb10('0x9')]=_0x13ce8d['limitCalls'];this[_0xbb10('0xa')]=_0x13ce8d[_0xbb10('0xa')]||null;this[_0xbb10('0xb')]=_0x13ce8d[_0xbb10('0xb')]?_0x13ce8d[_0xbb10('0xb')]:null;this[_0xbb10('0xc')]=_0x13ce8d[_0xbb10('0xc')];this[_0xbb10('0xd')]=_0x13ce8d['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x13ce8d[_0xbb10('0xe')]||0x1e;this[_0xbb10('0xf')]=_0x13ce8d[_0xbb10('0xf')];this['dialCongestionRetryFrequency']=_0x13ce8d[_0xbb10('0x10')];this['dialBusyMaxRetry']=_0x13ce8d[_0xbb10('0x11')];this[_0xbb10('0x12')]=_0x13ce8d[_0xbb10('0x12')];this[_0xbb10('0x13')]=_0x13ce8d[_0xbb10('0x13')];this[_0xbb10('0x14')]=_0x13ce8d['dialNoAnswerRetryFrequency'];this[_0xbb10('0x15')]=_0x13ce8d[_0xbb10('0x15')];this[_0xbb10('0x16')]=_0x13ce8d[_0xbb10('0x16')]||_0xbb10('0x17');this[_0xbb10('0x18')]=_0x13ce8d[_0xbb10('0x18')]||undefined;this[_0xbb10('0x19')]=_0x13ce8d[_0xbb10('0x19')]||undefined;this[_0xbb10('0x1a')]=_0x13ce8d['dialCutDigit']||undefined;this[_0xbb10('0x1b')]=_0x13ce8d[_0xbb10('0x1b')]?_0x13ce8d[_0xbb10('0x1b')]:undefined;this[_0xbb10('0x1c')]=_0x13ce8d[_0xbb10('0x1c')]?_0x13ce8d[_0xbb10('0x1c')]:undefined;this[_0xbb10('0x1d')]=_0x13ce8d[_0xbb10('0x1d')]?_0x13ce8d[_0xbb10('0x1d')]:undefined;this[_0xbb10('0x1e')]=_0x13ce8d['SquareProject']?_0x13ce8d[_0xbb10('0x1e')]:undefined;this[_0xbb10('0x1f')]=_0x13ce8d[_0xbb10('0x1e')]?_0x13ce8d[_0xbb10('0x1e')][_0xbb10('0x0')]:undefined;this[_0xbb10('0x20')]=_0x13ce8d['dialAMDActive']||![];this[_0xbb10('0x21')]=_0x13ce8d[_0xbb10('0x21')];this['dialAMDGreeting']=_0x13ce8d['dialAMDGreeting'];this[_0xbb10('0x22')]=_0x13ce8d[_0xbb10('0x22')];this[_0xbb10('0x23')]=_0x13ce8d[_0xbb10('0x23')];this[_0xbb10('0x24')]=_0x13ce8d[_0xbb10('0x24')];this[_0xbb10('0x25')]=_0x13ce8d[_0xbb10('0x25')];this[_0xbb10('0x26')]=_0x13ce8d[_0xbb10('0x26')];this[_0xbb10('0x27')]=_0x13ce8d[_0xbb10('0x27')];this['dialAMDMaximumWordLength']=_0x13ce8d['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x0713=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active'];(function(_0x5e2798,_0x369f02){var _0x30948a=function(_0xb677c8){while(--_0xb677c8){_0x5e2798['push'](_0x5e2798['shift']());}};_0x30948a(++_0x369f02);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x4bf247){this['id']=_0x4bf247['id']||0x0;this['name']=_0x4bf247[_0x3071('0x0')]||'';this[_0x3071('0x1')]=_0x4bf247[_0x3071('0x1')]||_0x3071('0x2');this[_0x3071('0x3')]=0x0;this['temp']=0x0;this[_0x3071('0x4')]=0x0;this[_0x3071('0x5')]=0x0;this[_0x3071('0x6')]='';this[_0x3071('0x7')]=!![];this[_0x3071('0x8')]=_0x4bf247[_0x3071('0x8')];this[_0x3071('0x9')]=_0x4bf247[_0x3071('0x9')];this[_0x3071('0xa')]=_0x4bf247[_0x3071('0xa')]||null;this[_0x3071('0xb')]=_0x4bf247[_0x3071('0xb')]?_0x4bf247[_0x3071('0xb')]:null;this['dialOriginateCallerIdName']=_0x4bf247[_0x3071('0xc')];this[_0x3071('0xd')]=_0x4bf247[_0x3071('0xd')];this[_0x3071('0xe')]=_0x4bf247[_0x3071('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x4bf247[_0x3071('0xf')];this[_0x3071('0x10')]=_0x4bf247[_0x3071('0x10')];this[_0x3071('0x11')]=_0x4bf247[_0x3071('0x11')];this['dialBusyRetryFrequency']=_0x4bf247['dialBusyRetryFrequency'];this[_0x3071('0x12')]=_0x4bf247['dialNoAnswerMaxRetry'];this[_0x3071('0x13')]=_0x4bf247[_0x3071('0x13')];this['dialGlobalMaxRetry']=_0x4bf247[_0x3071('0x14')];this['dialOrderByScheduledAt']=_0x4bf247[_0x3071('0x15')]||_0x3071('0x16');this[_0x3071('0x17')]=_0x4bf247[_0x3071('0x17')]||undefined;this[_0x3071('0x18')]=_0x4bf247[_0x3071('0x18')]||undefined;this[_0x3071('0x19')]=_0x4bf247[_0x3071('0x19')]||undefined;this[_0x3071('0x1a')]=_0x4bf247[_0x3071('0x1a')]?_0x4bf247['TrunkBackup']:undefined;this[_0x3071('0x1b')]=_0x4bf247[_0x3071('0x1b')]?_0x4bf247[_0x3071('0x1b')]:undefined;this[_0x3071('0x1c')]=_0x4bf247[_0x3071('0x1c')]?_0x4bf247[_0x3071('0x1c')]:undefined;this[_0x3071('0x1d')]=_0x4bf247[_0x3071('0x1d')]?_0x4bf247['SquareProject']:undefined;this[_0x3071('0x1e')]=_0x4bf247[_0x3071('0x1d')]?_0x4bf247[_0x3071('0x1d')]['name']:undefined;this[_0x3071('0x1f')]=_0x4bf247['dialAMDActive']||![];this[_0x3071('0x20')]=_0x4bf247[_0x3071('0x20')];this[_0x3071('0x21')]=_0x4bf247[_0x3071('0x21')];this[_0x3071('0x22')]=_0x4bf247[_0x3071('0x22')];this[_0x3071('0x23')]=_0x4bf247[_0x3071('0x23')];this['dialAMDMinWordLength']=_0x4bf247['dialAMDMinWordLength'];this[_0x3071('0x24')]=_0x4bf247[_0x3071('0x24')];this[_0x3071('0x25')]=_0x4bf247[_0x3071('0x25')];this[_0x3071('0x26')]=_0x4bf247[_0x3071('0x26')];this[_0x3071('0x27')]=_0x4bf247[_0x3071('0x27')];}module[_0x3071('0x28')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index adb6f5e..1fcca0b 100644 --- a/server/services/ami/model/channel.js +++ b/server/services/ami/model/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc210=['accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x5125c5,_0x2b0f33){var _0x262e77=function(_0x518ddc){while(--_0x518ddc){_0x5125c5['push'](_0x5125c5['shift']());}};_0x262e77(++_0x2b0f33);}(_0xc210,0x7c));var _0x0c21=function(_0x567e69,_0x1dc29c){_0x567e69=_0x567e69-0x0;var _0x1bf534=_0xc210[_0x567e69];return _0x1bf534;};'use strict';function Channel(){this[_0x0c21('0x0')]=null;this[_0x0c21('0x1')]='';this['destinationchannel']='';this[_0x0c21('0x2')]=0x0;this[_0x0c21('0x3')]='';this[_0x0c21('0x4')]=undefined;this[_0x0c21('0x5')]=undefined;this[_0x0c21('0x6')]=0x0;this[_0x0c21('0x7')]='';this[_0x0c21('0x8')]=0x0;this[_0x0c21('0x9')]=0x0;this[_0x0c21('0xa')]=0x0;this[_0x0c21('0xb')]=![];this[_0x0c21('0xc')]=null;this[_0x0c21('0xd')]=null;this[_0x0c21('0xe')]=![];this['abandoned']=![];this[_0x0c21('0xf')]='';this['lastdata']='';this['duration']=0x0;this[_0x0c21('0x10')]=0x0;this[_0x0c21('0x11')]=0x0;this[_0x0c21('0x12')]=null;this[_0x0c21('0x13')]=null;this[_0x0c21('0x14')]=null;this[_0x0c21('0x15')]=![];this[_0x0c21('0x16')]=null;this['queue']=null;this[_0x0c21('0x17')]=[];this[_0x0c21('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this['mohtime']=0x0;}module[_0x0c21('0x19')]=Channel; \ No newline at end of file +var _0x7a02=['duration','holdtime','type','tag','disposition','monitorFilename','queue','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata'];(function(_0x445f10,_0x300f18){var _0x39ac77=function(_0x320742){while(--_0x320742){_0x445f10['push'](_0x445f10['shift']());}};_0x39ac77(++_0x300f18);}(_0x7a02,0x1ba));var _0x27a0=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x7a02[_0x1762b4];return _0x29beda;};'use strict';function Channel(){this['starttime']=null;this[_0x27a0('0x0')]='';this[_0x27a0('0x1')]='';this[_0x27a0('0x2')]=0x0;this[_0x27a0('0x3')]='';this[_0x27a0('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x27a0('0x5')]=0x0;this[_0x27a0('0x6')]='';this[_0x27a0('0x7')]=0x0;this[_0x27a0('0x8')]=0x0;this[_0x27a0('0x9')]=0x0;this[_0x27a0('0xa')]=![];this[_0x27a0('0xb')]=null;this[_0x27a0('0xc')]=null;this[_0x27a0('0xd')]=![];this[_0x27a0('0xe')]=![];this[_0x27a0('0xf')]='';this[_0x27a0('0x10')]='';this[_0x27a0('0x11')]=0x0;this['billableseconds']=0x0;this[_0x27a0('0x12')]=0x0;this[_0x27a0('0x13')]=null;this[_0x27a0('0x14')]=null;this[_0x27a0('0x15')]=null;this['monitor']=![];this[_0x27a0('0x16')]=null;this[_0x27a0('0x17')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x27a0('0x18')]=undefined;this[_0x27a0('0x19')]=0x0;}module[_0x27a0('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 345a83a..330a627 100644 --- a/server/services/ami/model/deskAccount.js +++ b/server/services/ami/model/deskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2ff=['Configurations','name','username','authType','password','consumerKey','token','tokenSecret','type','serverUrl'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb2ff[_0x3ab51d];return _0x29a04e;};'use strict';function DeskAccount(_0x43f84d){this['id']=_0x43f84d['id']||0x0;this[_0xfb2f('0x0')]=_0x43f84d['name']||'';this[_0xfb2f('0x1')]=_0x43f84d['username']||'';this['remoteUri']=_0x43f84d['remoteUri']||'';this[_0xfb2f('0x2')]=_0x43f84d['authType']||'';this[_0xfb2f('0x3')]=_0x43f84d[_0xfb2f('0x3')]||'';this[_0xfb2f('0x4')]=_0x43f84d[_0xfb2f('0x4')]||'';this['consumerSecret']=_0x43f84d['consumerSecret']||'';this[_0xfb2f('0x5')]=_0x43f84d['token']||'';this[_0xfb2f('0x6')]=_0x43f84d[_0xfb2f('0x6')]||'';this[_0xfb2f('0x7')]=_0x43f84d[_0xfb2f('0x7')]||'';this['serverUrl']=_0x43f84d[_0xfb2f('0x8')]||'';this['Configurations']=_0x43f84d[_0xfb2f('0x9')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xc3a8=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x2a7210,_0x2f3d23){_0x2a7210=_0x2a7210-0x0;var _0x460766=_0xc3a8[_0x2a7210];return _0x460766;};'use strict';function DeskAccount(_0x14444b){this['id']=_0x14444b['id']||0x0;this[_0x8c3a('0x0')]=_0x14444b[_0x8c3a('0x0')]||'';this['username']=_0x14444b[_0x8c3a('0x1')]||'';this['remoteUri']=_0x14444b[_0x8c3a('0x2')]||'';this[_0x8c3a('0x3')]=_0x14444b[_0x8c3a('0x3')]||'';this[_0x8c3a('0x4')]=_0x14444b['password']||'';this[_0x8c3a('0x5')]=_0x14444b[_0x8c3a('0x5')]||'';this[_0x8c3a('0x6')]=_0x14444b[_0x8c3a('0x6')]||'';this[_0x8c3a('0x7')]=_0x14444b[_0x8c3a('0x7')]||'';this['tokenSecret']=_0x14444b[_0x8c3a('0x8')]||'';this[_0x8c3a('0x9')]=_0x14444b[_0x8c3a('0x9')]||'';this[_0x8c3a('0xa')]=_0x14444b[_0x8c3a('0xa')]||'';this['Configurations']=_0x14444b[_0x8c3a('0xb')]||{};}module[_0x8c3a('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index b11d91f..b5772f1 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fa6=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x26d26f,_0x302cce){var _0x5c8c0e=function(_0x519b9d){while(--_0x519b9d){_0x26d26f['push'](_0x26d26f['shift']());}};_0x5c8c0e(++_0x302cce);}(_0x9fa6,0x1cf));var _0x69fa=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x9fa6[_0x17928f];return _0x500b63;};'use strict';function Dynamics365Account(_0x2176b8){this['id']=_0x2176b8['id']||0x0;this[_0x69fa('0x0')]=_0x2176b8[_0x69fa('0x0')]||'';this[_0x69fa('0x1')]=_0x2176b8[_0x69fa('0x1')]||'';this['password']=_0x2176b8[_0x69fa('0x2')]||'';this[_0x69fa('0x3')]=_0x2176b8[_0x69fa('0x3')]||'';this[_0x69fa('0x4')]=_0x2176b8['tenantId']||'';this[_0x69fa('0x5')]=_0x2176b8[_0x69fa('0x5')]||'';this[_0x69fa('0x6')]=_0x2176b8[_0x69fa('0x6')]||{};this['serverUrl']=_0x2176b8[_0x69fa('0x7')]||'';this[_0x69fa('0x8')]=_0x2176b8[_0x69fa('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x1324=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x4d3739,_0x4881ea){var _0x3866b0=function(_0x976979){while(--_0x976979){_0x4d3739['push'](_0x4d3739['shift']());}};_0x3866b0(++_0x4881ea);}(_0x1324,0x104));var _0x4132=function(_0x1dd8f6,_0x3ea487){_0x1dd8f6=_0x1dd8f6-0x0;var _0xf083b7=_0x1324[_0x1dd8f6];return _0xf083b7;};'use strict';function Dynamics365Account(_0x3006c7){this['id']=_0x3006c7['id']||0x0;this['name']=_0x3006c7[_0x4132('0x0')]||'';this[_0x4132('0x1')]=_0x3006c7[_0x4132('0x1')]||'';this[_0x4132('0x2')]=_0x3006c7[_0x4132('0x2')]||'';this['remoteUri']=_0x3006c7[_0x4132('0x3')]||'';this[_0x4132('0x4')]=_0x3006c7[_0x4132('0x4')]||'';this['clientId']=_0x3006c7[_0x4132('0x5')]||'';this['clientSecret']=_0x3006c7[_0x4132('0x6')]||{};this[_0x4132('0x7')]=_0x3006c7[_0x4132('0x7')]||'';this[_0x4132('0x8')]=_0x3006c7[_0x4132('0x8')]||{};}module[_0x4132('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 697ff09..661eb8b 100644 --- a/server/services/ami/model/faxAccount.js +++ b/server/services/ami/model/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x252e=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x1d3d5e,_0x2e898c){var _0x300bb8=function(_0x554618){while(--_0x554618){_0x1d3d5e['push'](_0x1d3d5e['shift']());}};_0x300bb8(++_0x2e898c);}(_0x252e,0x74));var _0xe252=function(_0x8764e1,_0x539da1){_0x8764e1=_0x8764e1-0x0;var _0x4cc6c4=_0x252e[_0x8764e1];return _0x4cc6c4;};'use strict';function FaxAccount(_0x53b715){this['id']=_0x53b715['id']||0x0;this[_0xe252('0x0')]=_0x53b715[_0xe252('0x0')]||'';this[_0xe252('0x1')]=_0x53b715[_0xe252('0x1')];this['ecm']=_0x53b715[_0xe252('0x2')];this['headerinfo']=_0x53b715[_0xe252('0x3')];this[_0xe252('0x4')]=_0x53b715[_0xe252('0x4')];this[_0xe252('0x5')]=_0x53b715['minrate']||0x960;this[_0xe252('0x6')]=_0x53b715[_0xe252('0x6')]||0x3840;this[_0xe252('0x7')]=_0x53b715[_0xe252('0x7')]||_0xe252('0x8');this['gateway']=_0x53b715[_0xe252('0x9')]||'no';this[_0xe252('0xa')]=_0x53b715[_0xe252('0xa')]||'no';this[_0xe252('0xb')]=_0x53b715[_0xe252('0xb')]||0x1388;this[_0xe252('0xc')]=_0x53b715[_0xe252('0xc')]||_0xe252('0xd');this[_0xe252('0xe')]=_0x53b715[_0xe252('0xe')]?_0x53b715[_0xe252('0xe')]:undefined;this['ListId']=_0x53b715[_0xe252('0xf')];this[_0xe252('0x10')]=_0x53b715[_0xe252('0x10')];}module[_0xe252('0x11')]=FaxAccount; \ No newline at end of file +var _0xd576=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd576,0xb1));var _0x6d57=function(_0x4bfc0c,_0x28c46c){_0x4bfc0c=_0x4bfc0c-0x0;var _0x3bf7ad=_0xd576[_0x4bfc0c];return _0x3bf7ad;};'use strict';function FaxAccount(_0x16b989){this['id']=_0x16b989['id']||0x0;this[_0x6d57('0x0')]=_0x16b989[_0x6d57('0x0')]||'';this['description']=_0x16b989[_0x6d57('0x1')];this[_0x6d57('0x2')]=_0x16b989[_0x6d57('0x2')];this[_0x6d57('0x3')]=_0x16b989['headerinfo'];this[_0x6d57('0x4')]=_0x16b989[_0x6d57('0x4')];this[_0x6d57('0x5')]=_0x16b989[_0x6d57('0x5')]||0x960;this['maxrate']=_0x16b989[_0x6d57('0x6')]||0x3840;this[_0x6d57('0x7')]=_0x16b989[_0x6d57('0x7')]||_0x6d57('0x8');this[_0x6d57('0x9')]=_0x16b989['gateway']||'no';this['faxdetect']=_0x16b989[_0x6d57('0xa')]||'no';this['t38timeout']=_0x16b989[_0x6d57('0xb')]||0x1388;this[_0x6d57('0xc')]=_0x16b989[_0x6d57('0xc')]||_0x6d57('0xd');this[_0x6d57('0xe')]=_0x16b989[_0x6d57('0xe')]?_0x16b989[_0x6d57('0xe')]:undefined;this[_0x6d57('0xf')]=_0x16b989[_0x6d57('0xf')];this[_0x6d57('0x10')]=_0x16b989[_0x6d57('0x10')];}module[_0x6d57('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 66c4dcb..cbaec70 100644 --- a/server/services/ami/model/freshdeskAccount.js +++ b/server/services/ami/model/freshdeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3560=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x40da2b,_0x4c8c73){var _0x122eb5=function(_0x2fc5f3){while(--_0x2fc5f3){_0x40da2b['push'](_0x40da2b['shift']());}};_0x122eb5(++_0x4c8c73);}(_0x3560,0xc5));var _0x0356=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0x3560[_0x11ba83];return _0x3f3925;};'use strict';function FreshdeskAccount(_0x2f3332){this['id']=_0x2f3332['id']||0x0;this[_0x0356('0x0')]=_0x2f3332[_0x0356('0x0')]||'';this[_0x0356('0x1')]=_0x2f3332[_0x0356('0x1')]||'';this[_0x0356('0x2')]=_0x2f3332[_0x0356('0x3')]||'';this['remoteUri']=_0x2f3332[_0x0356('0x4')]||'';this[_0x0356('0x5')]=_0x2f3332[_0x0356('0x5')]||'';this[_0x0356('0x6')]=_0x2f3332[_0x0356('0x6')]||{};}module[_0x0356('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x7c23=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0xe4c712,_0x1e26d5){var _0x101962=function(_0x1bfc5a){while(--_0x1bfc5a){_0xe4c712['push'](_0xe4c712['shift']());}};_0x101962(++_0x1e26d5);}(_0x7c23,0x14d));var _0x37c2=function(_0x3ea2cf,_0x269d78){_0x3ea2cf=_0x3ea2cf-0x0;var _0x535f53=_0x7c23[_0x3ea2cf];return _0x535f53;};'use strict';function FreshdeskAccount(_0x543c7c){this['id']=_0x543c7c['id']||0x0;this[_0x37c2('0x0')]=_0x543c7c[_0x37c2('0x0')]||'';this['username']=_0x543c7c[_0x37c2('0x1')]||'';this[_0x37c2('0x2')]=_0x543c7c['token']||'';this[_0x37c2('0x3')]=_0x543c7c[_0x37c2('0x3')]||'';this[_0x37c2('0x4')]=_0x543c7c['serverUrl']||'';this[_0x37c2('0x5')]=_0x543c7c[_0x37c2('0x5')]||{};}module[_0x37c2('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index f57a784..276c555 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb871=['username','apiKey','remoteUri','exports','name'];(function(_0x352f63,_0x4bbe67){var _0x4e883b=function(_0x134d96){while(--_0x134d96){_0x352f63['push'](_0x352f63['shift']());}};_0x4e883b(++_0x4bbe67);}(_0xb871,0x77));var _0x1b87=function(_0x52a9a8,_0x4c68b4){_0x52a9a8=_0x52a9a8-0x0;var _0xb139cc=_0xb871[_0x52a9a8];return _0xb139cc;};'use strict';function FreshsalesAccount(_0x5886de){this['id']=_0x5886de['id']||0x0;this[_0x1b87('0x0')]=_0x5886de['name']||'';this['username']=_0x5886de[_0x1b87('0x1')]||'';this[_0x1b87('0x2')]=_0x5886de['token']||'';this[_0x1b87('0x3')]=_0x5886de['remoteUri']||'';this['serverUrl']=_0x5886de['serverUrl']||'';this['Configurations']=_0x5886de['Configurations']||{};}module[_0x1b87('0x4')]=FreshsalesAccount; \ No newline at end of file +var _0xa24e=['serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x1df29f,_0x36135d){var _0x229937=function(_0x2f2f63){while(--_0x2f2f63){_0x1df29f['push'](_0x1df29f['shift']());}};_0x229937(++_0x36135d);}(_0xa24e,0x18f));var _0xea24=function(_0x5c27ae,_0x10dfb7){_0x5c27ae=_0x5c27ae-0x0;var _0x3eef82=_0xa24e[_0x5c27ae];return _0x3eef82;};'use strict';function FreshsalesAccount(_0x2745b7){this['id']=_0x2745b7['id']||0x0;this[_0xea24('0x0')]=_0x2745b7[_0xea24('0x0')]||'';this['username']=_0x2745b7[_0xea24('0x1')]||'';this[_0xea24('0x2')]=_0x2745b7['token']||'';this['remoteUri']=_0x2745b7['remoteUri']||'';this[_0xea24('0x3')]=_0x2745b7['serverUrl']||'';this['Configurations']=_0x2745b7[_0xea24('0x4')]||{};}module[_0xea24('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 5129c7d..220f721 100644 --- a/server/services/ami/model/queueReport.js +++ b/server/services/ami/model/queueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e63=['queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','context','exten','assigned','lastAssignedTo','mohtime','variables','exports','inbound','calleridnum','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt'];(function(_0x404890,_0x2b8500){var _0xbc89d2=function(_0x4905a4){while(--_0x4905a4){_0x404890['push'](_0x404890['shift']());}};_0xbc89d2(++_0x2b8500);}(_0x5e63,0x9f));var _0x35e6=function(_0x52a1a7,_0x64af9d){_0x52a1a7=_0x52a1a7-0x0;var _0x3c0843=_0x5e63[_0x52a1a7];return _0x3c0843;};'use strict';function QueueReport(){this['type']=_0x35e6('0x0');this['uniqueid']='';this[_0x35e6('0x1')]='';this['calleridname']='';this[_0x35e6('0x2')]='';this['queuecallerjoinAt']=null;this[_0x35e6('0x3')]=null;this[_0x35e6('0x4')]=0x1;this[_0x35e6('0x5')]=0x1;this[_0x35e6('0x6')]=![];this['queuecallerabandonAt']=null;this[_0x35e6('0x7')]=![];this[_0x35e6('0x8')]=null;this[_0x35e6('0x9')]=![];this[_0x35e6('0xa')]=null;this[_0x35e6('0xb')]=0x1;this['channel']='';this[_0x35e6('0xc')]='';this['connectedlinename']='';this[_0x35e6('0xd')]='';this[_0x35e6('0xe')]='';this[_0x35e6('0xf')]='';this['priority']='';this['holdtime']=0x0;this[_0x35e6('0x10')]=![];this[_0x35e6('0x11')]='';this[_0x35e6('0x12')]=0x0;this[_0x35e6('0x13')]={};}module[_0x35e6('0x14')]=QueueReport; \ No newline at end of file +var _0xf84f=['queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context','exten','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','position','count','queuecallerabandon'];(function(_0x26973e,_0x4d1d08){var _0x26893c=function(_0x55b60d){while(--_0x55b60d){_0x26973e['push'](_0x26973e['shift']());}};_0x26893c(++_0x4d1d08);}(_0xf84f,0xd3));var _0xff84=function(_0x162467,_0x1d7760){_0x162467=_0x162467-0x0;var _0x39c856=_0xf84f[_0x162467];return _0x39c856;};'use strict';function QueueReport(){this[_0xff84('0x0')]=_0xff84('0x1');this[_0xff84('0x2')]='';this[_0xff84('0x3')]='';this[_0xff84('0x4')]='';this[_0xff84('0x5')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xff84('0x6')]=0x1;this[_0xff84('0x7')]=0x1;this[_0xff84('0x8')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0xff84('0x9')]=null;this['queuecallerexit']=![];this[_0xff84('0xa')]=null;this[_0xff84('0xb')]=0x1;this[_0xff84('0xc')]='';this['connectedlinenum']='';this[_0xff84('0xd')]='';this[_0xff84('0xe')]='';this[_0xff84('0xf')]='';this[_0xff84('0x10')]='';this['priority']='';this['holdtime']=0x0;this[_0xff84('0x11')]=![];this[_0xff84('0x12')]='';this[_0xff84('0x13')]=0x0;this[_0xff84('0x14')]={};}module[_0xff84('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 665fb0c..c227a7a 100644 --- a/server/services/ami/model/salesforceAccount.js +++ b/server/services/ami/model/salesforceAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb04=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x462a58,_0x5c9479){var _0x47839b=function(_0x4fc50d){while(--_0x4fc50d){_0x462a58['push'](_0x462a58['shift']());}};_0x47839b(++_0x5c9479);}(_0xdb04,0x7d));var _0x4db0=function(_0x392d61,_0x5e29cd){_0x392d61=_0x392d61-0x0;var _0x3f5c1f=_0xdb04[_0x392d61];return _0x3f5c1f;};'use strict';function SalesforceAccount(_0x34eed9){this['id']=_0x34eed9['id']||0x0;this[_0x4db0('0x0')]=_0x34eed9[_0x4db0('0x0')]||'';this[_0x4db0('0x1')]=_0x34eed9[_0x4db0('0x1')]||'';this['remoteUri']=_0x34eed9[_0x4db0('0x2')]||'';this[_0x4db0('0x3')]=_0x34eed9[_0x4db0('0x3')]||'';this[_0x4db0('0x4')]=_0x34eed9[_0x4db0('0x4')]||'';this[_0x4db0('0x5')]=_0x34eed9[_0x4db0('0x5')]||'';this[_0x4db0('0x6')]=_0x34eed9['securityToken']||'';this[_0x4db0('0x7')]=_0x34eed9[_0x4db0('0x7')]||_0x4db0('0x8');this[_0x4db0('0x9')]=_0x34eed9[_0x4db0('0x9')]||'';this[_0x4db0('0xa')]=_0x34eed9[_0x4db0('0xa')]||{};}module[_0x4db0('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xcf3b=['remoteUri','password','clientId','clientSecret','type','integrationTab','serverUrl','exports','name','username'];(function(_0x42abb1,_0x169e9a){var _0x173050=function(_0x58f568){while(--_0x58f568){_0x42abb1['push'](_0x42abb1['shift']());}};_0x173050(++_0x169e9a);}(_0xcf3b,0xee));var _0xbcf3=function(_0x4cedd4,_0x2a8fc1){_0x4cedd4=_0x4cedd4-0x0;var _0x35c70c=_0xcf3b[_0x4cedd4];return _0x35c70c;};'use strict';function SalesforceAccount(_0x5150b2){this['id']=_0x5150b2['id']||0x0;this['name']=_0x5150b2[_0xbcf3('0x0')]||'';this[_0xbcf3('0x1')]=_0x5150b2[_0xbcf3('0x1')]||'';this[_0xbcf3('0x2')]=_0x5150b2[_0xbcf3('0x2')]||'';this[_0xbcf3('0x3')]=_0x5150b2['password']||'';this[_0xbcf3('0x4')]=_0x5150b2[_0xbcf3('0x4')]||'';this[_0xbcf3('0x5')]=_0x5150b2[_0xbcf3('0x5')]||'';this['securityToken']=_0x5150b2['securityToken']||'';this[_0xbcf3('0x6')]=_0x5150b2[_0xbcf3('0x6')]||_0xbcf3('0x7');this['serverUrl']=_0x5150b2[_0xbcf3('0x8')]||'';this['Configurations']=_0x5150b2['Configurations']||{};}module[_0xbcf3('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index e56f83b..e756b30 100644 --- a/server/services/ami/model/servicenowAccount.js +++ b/server/services/ami/model/servicenowAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c98=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x505684,_0x2c1dc9){var _0x4389b0=function(_0x86b26e){while(--_0x86b26e){_0x505684['push'](_0x505684['shift']());}};_0x4389b0(++_0x2c1dc9);}(_0x6c98,0xdf));var _0x86c9=function(_0x3413ce,_0xbe8cae){_0x3413ce=_0x3413ce-0x0;var _0x5367cd=_0x6c98[_0x3413ce];return _0x5367cd;};'use strict';function ServicenowAccount(_0x29f8c1){this['id']=_0x29f8c1['id']||0x0;this[_0x86c9('0x0')]=_0x29f8c1[_0x86c9('0x0')]||'';this[_0x86c9('0x1')]=_0x29f8c1[_0x86c9('0x1')]||'';this[_0x86c9('0x2')]=_0x29f8c1[_0x86c9('0x2')]||'';this[_0x86c9('0x3')]=_0x29f8c1['remoteUri']||'';this['serverUrl']=_0x29f8c1[_0x86c9('0x4')]||'';this[_0x86c9('0x5')]=_0x29f8c1[_0x86c9('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x5d79=['serverUrl','Configurations','exports','username','password','remoteUri'];(function(_0x14b52e,_0x92e6eb){var _0x81133b=function(_0x219781){while(--_0x219781){_0x14b52e['push'](_0x14b52e['shift']());}};_0x81133b(++_0x92e6eb);}(_0x5d79,0x1bf));var _0x95d7=function(_0x4a0f16,_0x21ba18){_0x4a0f16=_0x4a0f16-0x0;var _0x45d653=_0x5d79[_0x4a0f16];return _0x45d653;};'use strict';function ServicenowAccount(_0x21f01a){this['id']=_0x21f01a['id']||0x0;this['name']=_0x21f01a['name']||'';this[_0x95d7('0x0')]=_0x21f01a[_0x95d7('0x0')]||'';this[_0x95d7('0x1')]=_0x21f01a[_0x95d7('0x1')]||'';this[_0x95d7('0x2')]=_0x21f01a[_0x95d7('0x2')]||'';this[_0x95d7('0x3')]=_0x21f01a['serverUrl']||'';this[_0x95d7('0x4')]=_0x21f01a[_0x95d7('0x4')]||{};}module[_0x95d7('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 31b03c1..aec2c1c 100644 --- a/server/services/ami/model/sugarcrmAccount.js +++ b/server/services/ami/model/sugarcrmAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27c3=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x143e53,_0x2d2534){var _0x5d7d52=function(_0xcea7e1){while(--_0xcea7e1){_0x143e53['push'](_0x143e53['shift']());}};_0x5d7d52(++_0x2d2534);}(_0x27c3,0xa8));var _0x327c=function(_0x47199b,_0x16e824){_0x47199b=_0x47199b-0x0;var _0x390911=_0x27c3[_0x47199b];return _0x390911;};'use strict';function SugarcrmAccount(_0x34de38){this['id']=_0x34de38['id']||0x0;this[_0x327c('0x0')]=_0x34de38[_0x327c('0x0')]||'';this[_0x327c('0x1')]=_0x34de38['username']||'';this[_0x327c('0x2')]=_0x34de38[_0x327c('0x2')]||'';this[_0x327c('0x3')]=_0x34de38[_0x327c('0x3')]||'';this[_0x327c('0x4')]=_0x34de38[_0x327c('0x4')]||'';this['Configurations']=_0x34de38[_0x327c('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x56dd=['username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x43c256,_0x437fc6){var _0x591f40=function(_0x2ec315){while(--_0x2ec315){_0x43c256['push'](_0x43c256['shift']());}};_0x591f40(++_0x437fc6);}(_0x56dd,0x114));var _0xd56d=function(_0x5e031a,_0x44205e){_0x5e031a=_0x5e031a-0x0;var _0x563749=_0x56dd[_0x5e031a];return _0x563749;};'use strict';function SugarcrmAccount(_0xf5c982){this['id']=_0xf5c982['id']||0x0;this['name']=_0xf5c982['name']||'';this[_0xd56d('0x0')]=_0xf5c982[_0xd56d('0x0')]||'';this[_0xd56d('0x1')]=_0xf5c982[_0xd56d('0x1')]||'';this[_0xd56d('0x2')]=_0xf5c982[_0xd56d('0x2')]||'';this['serverUrl']=_0xf5c982[_0xd56d('0x3')]||'';this[_0xd56d('0x4')]=_0xf5c982[_0xd56d('0x4')]||{};}module[_0xd56d('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 6c97295..7fdcaf0 100644 --- a/server/services/ami/model/telephone.js +++ b/server/services/ami/model/telephone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22f9=['accountcode','state','stateTime','status','unknown','address','exports','name'];(function(_0x319891,_0x9b28dc){var _0x8df70c=function(_0x3301f4){while(--_0x3301f4){_0x319891['push'](_0x319891['shift']());}};_0x8df70c(++_0x9b28dc);}(_0x22f9,0x147));var _0x922f=function(_0x2b39f7,_0x576161){_0x2b39f7=_0x2b39f7-0x0;var _0x3d3e12=_0x22f9[_0x2b39f7];return _0x3d3e12;};'use strict';function Telephone(_0x4ba6f7){this['id']=_0x4ba6f7['id']||0x0;this['name']=_0x4ba6f7[_0x922f('0x0')]||'';this[_0x922f('0x1')]=_0x4ba6f7[_0x922f('0x1')]||'';this[_0x922f('0x2')]='unknown';this[_0x922f('0x3')]=0x0;this[_0x922f('0x4')]=_0x922f('0x5');this[_0x922f('0x6')]='';}module[_0x922f('0x7')]=Telephone; \ No newline at end of file +var _0xe1b5=['unknown','exports','name','accountcode','state','stateTime'];(function(_0x1cc2c3,_0x2eac29){var _0x355643=function(_0x181f17){while(--_0x181f17){_0x1cc2c3['push'](_0x1cc2c3['shift']());}};_0x355643(++_0x2eac29);}(_0xe1b5,0x12e));var _0x5e1b=function(_0x347097,_0x37a135){_0x347097=_0x347097-0x0;var _0x5dfd04=_0xe1b5[_0x347097];return _0x5dfd04;};'use strict';function Telephone(_0x5a6864){this['id']=_0x5a6864['id']||0x0;this['name']=_0x5a6864[_0x5e1b('0x0')]||'';this['accountcode']=_0x5a6864[_0x5e1b('0x1')]||'';this[_0x5e1b('0x2')]='unknown';this[_0x5e1b('0x3')]=0x0;this['status']=_0x5e1b('0x4');this['address']='';}module[_0x5e1b('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 2a57932..3b9bb61 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93e2=['exports','name','html'];(function(_0x4f4f31,_0x5cadd0){var _0x5ba659=function(_0x2bceae){while(--_0x2bceae){_0x4f4f31['push'](_0x4f4f31['shift']());}};_0x5ba659(++_0x5cadd0);}(_0x93e2,0x106));var _0x293e=function(_0x90fdd9,_0x126f21){_0x90fdd9=_0x90fdd9-0x0;var _0x16c8cd=_0x93e2[_0x90fdd9];return _0x16c8cd;};'use strict';function template(_0x2900a7){this['id']=_0x2900a7['id']||0x0;this[_0x293e('0x0')]=_0x2900a7[_0x293e('0x0')]||'';this[_0x293e('0x1')]=_0x2900a7[_0x293e('0x1')]||'';}module[_0x293e('0x2')]=template; \ No newline at end of file +var _0x8463=['html','exports'];(function(_0x5d824a,_0x595c3d){var _0x37ee5f=function(_0xca1e){while(--_0xca1e){_0x5d824a['push'](_0x5d824a['shift']());}};_0x37ee5f(++_0x595c3d);}(_0x8463,0x1b2));var _0x3846=function(_0x2fc694,_0x35ddce){_0x2fc694=_0x2fc694-0x0;var _0x2ff8fa=_0x8463[_0x2fc694];return _0x2ff8fa;};'use strict';function template(_0x20dccb){this['id']=_0x20dccb['id']||0x0;this['name']=_0x20dccb['name']||'';this[_0x3846('0x0')]=_0x20dccb[_0x3846('0x0')]||'';}module[_0x3846('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 7ed8311..132299a 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['AnyConditions','Actions','name','channel','voice','status','AllConditions'];(function(_0xd3a084,_0x5e1bb4){var _0x2f18b6=function(_0x45022f){while(--_0x45022f){_0xd3a084['push'](_0xd3a084['shift']());}};_0x2f18b6(++_0x5e1bb4);}(_0xa41a,0x6b));var _0xaa41=function(_0x78cb0b,_0x1cc164){_0x78cb0b=_0x78cb0b-0x0;var _0x1a1074=_0xa41a[_0x78cb0b];return _0x1a1074;};'use strict';function Trigger(_0x33e667){this['id']=_0x33e667['id']||0x0;this[_0xaa41('0x0')]=_0x33e667['name']||'';this[_0xaa41('0x1')]=_0x33e667[_0xaa41('0x1')]||_0xaa41('0x2');this[_0xaa41('0x3')]=_0x33e667[_0xaa41('0x3')]||![];this[_0xaa41('0x4')]=_0x33e667[_0xaa41('0x4')]||[];this[_0xaa41('0x5')]=_0x33e667['AnyConditions']||[];this[_0xaa41('0x6')]=_0x33e667[_0xaa41('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x9c44=['voice','status','AnyConditions','Actions','exports','name','channel'];(function(_0x37af86,_0x301a18){var _0x9f57e0=function(_0x4cc35a){while(--_0x4cc35a){_0x37af86['push'](_0x37af86['shift']());}};_0x9f57e0(++_0x301a18);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';function Trigger(_0x2fa01d){this['id']=_0x2fa01d['id']||0x0;this['name']=_0x2fa01d[_0x49c4('0x0')]||'';this[_0x49c4('0x1')]=_0x2fa01d[_0x49c4('0x1')]||_0x49c4('0x2');this[_0x49c4('0x3')]=_0x2fa01d[_0x49c4('0x3')]||![];this['AllConditions']=_0x2fa01d['AllConditions']||[];this[_0x49c4('0x4')]=_0x2fa01d['AnyConditions']||[];this[_0x49c4('0x5')]=_0x2fa01d[_0x49c4('0x5')]||[];}module[_0x49c4('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 2451a30..66f549b 100644 --- a/server/services/ami/model/trunk.js +++ b/server/services/ami/model/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf99f=['indexOf','split','host','port','domainport','refresh','exports','active','name','unknown','stateTime','status','registry'];(function(_0x356a2c,_0x529436){var _0x4a8f2c=function(_0x333e01){while(--_0x333e01){_0x356a2c['push'](_0x356a2c['shift']());}};_0x4a8f2c(++_0x529436);}(_0xf99f,0x180));var _0xff99=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0xf99f[_0x246115];return _0x385878;};'use strict';function Trunk(_0x57b43e){this['id']=_0x57b43e['id']||0x0;this[_0xff99('0x0')]=_0x57b43e[_0xff99('0x0')]||![];this[_0xff99('0x1')]=_0x57b43e[_0xff99('0x1')]||'';this['state']=_0xff99('0x2');this[_0xff99('0x3')]=0x0;this[_0xff99('0x4')]='unknown';this['registry']=_0x57b43e[_0xff99('0x5')]&&_0x57b43e[_0xff99('0x5')][_0xff99('0x6')](':')?_0x57b43e['registry'][_0xff99('0x7')](':')[0x0]:'';this[_0xff99('0x8')]='';this[_0xff99('0x9')]='';this['domain']='';this[_0xff99('0xa')]='';this[_0xff99('0xb')]='';this['stateRegistry']='unknown';this['registrationtime']='';this['address']='';}module[_0xff99('0xc')]=Trunk; \ No newline at end of file +var _0x34c7=['refresh','exports','active','name','stateTime','registry','indexOf','host','port','domain','domainport'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x34c7,0x1db));var _0x734c=function(_0x1306c0,_0x5aeef5){_0x1306c0=_0x1306c0-0x0;var _0x5a9616=_0x34c7[_0x1306c0];return _0x5a9616;};'use strict';function Trunk(_0x248339){this['id']=_0x248339['id']||0x0;this[_0x734c('0x0')]=_0x248339[_0x734c('0x0')]||![];this['name']=_0x248339[_0x734c('0x1')]||'';this['state']='unknown';this[_0x734c('0x2')]=0x0;this['status']='unknown';this[_0x734c('0x3')]=_0x248339[_0x734c('0x3')]&&_0x248339[_0x734c('0x3')][_0x734c('0x4')](':')?_0x248339[_0x734c('0x3')]['split'](':')[0x0]:'';this[_0x734c('0x5')]='';this[_0x734c('0x6')]='';this[_0x734c('0x7')]='';this[_0x734c('0x8')]='';this[_0x734c('0x9')]='';this['stateRegistry']='unknown';this['registrationtime']='';this['address']='';}module[_0x734c('0xa')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index fa92996..1b360aa 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d4e=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x34c9c1,_0x5f0146){var _0x12c293=function(_0x2d10d8){while(--_0x2d10d8){_0x34c9c1['push'](_0x34c9c1['shift']());}};_0x12c293(++_0x5f0146);}(_0x3d4e,0x13a));var _0xe3d4=function(_0xfd5dc4,_0x27520f){_0xfd5dc4=_0xfd5dc4-0x0;var _0x118fdd=_0x3d4e[_0xfd5dc4];return _0x118fdd;};'use strict';function voiceExtension(_0xa0730){this['id']=_0xa0730['id']||0x0;this[_0xe3d4('0x0')]=_0xa0730[_0xe3d4('0x0')]||'';this[_0xe3d4('0x1')]=_0xa0730[_0xe3d4('0x1')]||'none';this[_0xe3d4('0x2')]=_0xa0730[_0xe3d4('0x2')]||![];}module[_0xe3d4('0x3')]=voiceExtension; \ No newline at end of file +var _0x378c=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x378c,0x192));var _0xc378=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x378c[_0x24f31b];return _0x488401;};'use strict';function voiceExtension(_0x5d20ac){this['id']=_0x5d20ac['id']||0x0;this[_0xc378('0x0')]=_0x5d20ac[_0xc378('0x0')]||'';this[_0xc378('0x1')]=_0x5d20ac[_0xc378('0x1')]||_0xc378('0x2');this[_0xc378('0x3')]=_0x5d20ac['mandatoryDisposition']||![];}module[_0xc378('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 059f743..e4ec016 100644 --- a/server/services/ami/model/voiceQueue.js +++ b/server/services/ami/model/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe298=['erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','busy','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate'];(function(_0x26b568,_0x388b3a){var _0x5c21d6=function(_0x599289){while(--_0x599289){_0x26b568['push'](_0x26b568['shift']());}};_0x5c21d6(++_0x388b3a);}(_0xe298,0x1ac));var _0x8e29=function(_0x2a6b65,_0x133b91){_0x2a6b65=_0x2a6b65-0x0;var _0x203aeb=_0xe298[_0x2a6b65];return _0x203aeb;};'use strict';var statusDesc=['unknown','not_inuse','inuse',_0x8e29('0x0'),'invalid',_0x8e29('0x1'),_0x8e29('0x2'),'ringinuse',_0x8e29('0x3')];var monitorFormat={'wav':_0x8e29('0x4'),'wav49':_0x8e29('0x5'),'gsm':_0x8e29('0x6')};var strategy={'rrmemory':_0x8e29('0x7'),'roundrobin':_0x8e29('0x8')};function VoiceQueue(_0x22f6f5){this['id']=_0x22f6f5['id']||0x0;this['name']=_0x22f6f5[_0x8e29('0x9')]||'';this[_0x8e29('0xa')]=_0x22f6f5[_0x8e29('0xa')]||'';this['type']=_0x22f6f5[_0x8e29('0xb')]||_0x8e29('0xc');this[_0x8e29('0xd')]=0x0;this[_0x8e29('0xe')]=0x0;this[_0x8e29('0xf')]=0x0;this[_0x8e29('0x10')]=0x0;this[_0x8e29('0x11')]=0x0;this[_0x8e29('0x12')]=0x0;this[_0x8e29('0x13')]=0x0;this[_0x8e29('0x14')]=0x0;this['abandoned']=0x0;this[_0x8e29('0x15')]=0x0;this[_0x8e29('0x16')]=0x0;this[_0x8e29('0x17')]=_0x22f6f5[_0x8e29('0x17')]||![];this[_0x8e29('0x18')]=_0x22f6f5[_0x8e29('0x18')]||0xa;this['autopause']=_0x22f6f5[_0x8e29('0x19')]||'no';this[_0x8e29('0x1a')]=!![];this[_0x8e29('0x1b')]='';this[_0x8e29('0x1c')]=0x0;this[_0x8e29('0x1d')]=0x0;this[_0x8e29('0x1e')]=_0x22f6f5[_0x8e29('0x1e')]||null;this['dialGlobalInterval']=_0x22f6f5[_0x8e29('0x1f')]?_0x22f6f5['dialGlobalInterval']:null;this[_0x8e29('0x20')]=_0x22f6f5[_0x8e29('0x20')];this[_0x8e29('0x21')]=_0x22f6f5[_0x8e29('0x21')]||'progressive';this[_0x8e29('0x22')]=_0x22f6f5['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x22f6f5['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x22f6f5[_0x8e29('0x23')]||0x1;this[_0x8e29('0x24')]=_0x22f6f5[_0x8e29('0x24')]||_0x8e29('0x25');this['dialPredictiveOptimizationPercentage']=_0x22f6f5['dialPredictiveOptimizationPercentage']||0.03;this[_0x8e29('0x26')]=_0x22f6f5[_0x8e29('0x26')]||0x258;this[_0x8e29('0x27')]=_0x22f6f5[_0x8e29('0x27')]||_0x8e29('0x28');this[_0x8e29('0x29')]=_0x22f6f5[_0x8e29('0x29')]||_0x8e29('0x28');this[_0x8e29('0x2a')]=_0x22f6f5[_0x8e29('0x2a')]||0x1e;this[_0x8e29('0x2b')]=_0x22f6f5[_0x8e29('0x2b')]||_0x8e29('0x2c');this['dialQueueTimeout']=_0x22f6f5[_0x8e29('0x2d')]||0x3;this[_0x8e29('0x2e')]=_0x22f6f5[_0x8e29('0x2e')]||undefined;this[_0x8e29('0x2f')]=_0x22f6f5[_0x8e29('0x2f')]||0x3;this[_0x8e29('0x30')]=_0x22f6f5[_0x8e29('0x30')]||0x96;this[_0x8e29('0x31')]=_0x22f6f5[_0x8e29('0x31')]||0x3;this[_0x8e29('0x32')]=_0x22f6f5['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x22f6f5[_0x8e29('0x33')]||0x3;this['dialNoAnswerRetryFrequency']=_0x22f6f5[_0x8e29('0x34')]||0x96;this[_0x8e29('0x35')]=_0x22f6f5[_0x8e29('0x35')]||0x4;this[_0x8e29('0x36')]=_0x22f6f5[_0x8e29('0x36')]?_0x22f6f5['Trunk']:undefined;this['TrunkBackup']=_0x22f6f5[_0x8e29('0x37')]?_0x22f6f5[_0x8e29('0x37')]:undefined;this[_0x8e29('0x38')]=_0x22f6f5[_0x8e29('0x38')]||undefined;this[_0x8e29('0x39')]=_0x22f6f5['Interval']?_0x22f6f5[_0x8e29('0x39')]:undefined;this[_0x8e29('0x3a')]=_0x22f6f5[_0x8e29('0x3a')]||_0x8e29('0x3b');this[_0x8e29('0x3c')]=_0x22f6f5['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x8e29('0x3d')]=_0x22f6f5['dialCutDigit']||undefined;this[_0x8e29('0x3e')]=strategy[_0x22f6f5['strategy']]||_0x8e29('0x7');this[_0x8e29('0x3f')]=!![];this['dialAMDActive']=_0x22f6f5[_0x8e29('0x40')]||![];this['dialAMDInitialSilence']=_0x22f6f5[_0x8e29('0x41')];this[_0x8e29('0x42')]=_0x22f6f5[_0x8e29('0x42')];this['dialAMDAfterGreetingSilence']=_0x22f6f5[_0x8e29('0x43')];this[_0x8e29('0x44')]=_0x22f6f5[_0x8e29('0x44')];this[_0x8e29('0x45')]=_0x22f6f5[_0x8e29('0x45')];this[_0x8e29('0x46')]=_0x22f6f5['dialAMDBetweenWordsSilence'];this[_0x8e29('0x47')]=_0x22f6f5[_0x8e29('0x47')];this[_0x8e29('0x48')]=_0x22f6f5[_0x8e29('0x48')];this['dialAMDMaximumWordLength']=_0x22f6f5['dialAMDMaximumWordLength'];this[_0x8e29('0x49')]=0x0;this['pTalking']=0x0;this[_0x8e29('0x4a')]=_0x22f6f5['timeout'];this[_0x8e29('0x4b')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x8e29('0x4c')]=0x0;this[_0x8e29('0x4d')]=0x0;this[_0x8e29('0x4e')]=0x0;this[_0x8e29('0x4f')]=0x0;this[_0x8e29('0x50')]=0x0;this[_0x8e29('0x51')]=0x0;this[_0x8e29('0x52')]=0x0;this[_0x8e29('0x53')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x8e29('0x54')]=0x0;this[_0x8e29('0x55')]=undefined;this[_0x8e29('0x56')]=undefined;this[_0x8e29('0x57')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x8e29('0x58')]=0x0;this[_0x8e29('0x59')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x8e29('0x5a')]=_0x22f6f5[_0x8e29('0x5b')]||0x14;this[_0x8e29('0x5c')]=_0x22f6f5[_0x8e29('0x5b')]||0xa;this[_0x8e29('0x5d')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x8e29('0x5e')]=0x1;this[_0x8e29('0x5f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x8e29('0x60')]=0x0;this[_0x8e29('0x61')]=0x0;this[_0x8e29('0x62')]=_0x22f6f5[_0x8e29('0x62')]||0x1e;this[_0x8e29('0x63')]=_0x22f6f5['dialRecallInQueue']||![];this['dialQueueProject2']=_0x22f6f5[_0x8e29('0x64')]||undefined;this[_0x8e29('0x65')]=_0x22f6f5['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x22f6f5['dialAgiAfterHangupAgent']||![];this[_0x8e29('0xa')]=monitorFormat[_0x22f6f5[_0x8e29('0xa')]]?monitorFormat[_0x22f6f5[_0x8e29('0xa')]]:undefined;this['mandatoryDisposition']=_0x22f6f5[_0x8e29('0x66')]||![];this[_0x8e29('0x67')]=_0x22f6f5[_0x8e29('0x67')]?_0x22f6f5['mandatoryDispositionPause']:undefined;}module[_0x8e29('0x68')]=VoiceQueue; \ No newline at end of file +var _0xba2b=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','unavailable','ringing','ringinuse','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','erlangCalls'];(function(_0x3b6f7f,_0x2fac41){var _0x3de6fc=function(_0x17ae3f){while(--_0x17ae3f){_0x3b6f7f['push'](_0x3b6f7f['shift']());}};_0x3de6fc(++_0x2fac41);}(_0xba2b,0x15e));var _0xbba2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xba2b[_0x321bb2];return _0x9c12ed;};'use strict';var statusDesc=[_0xbba2('0x0'),_0xbba2('0x1'),_0xbba2('0x2'),'busy','invalid',_0xbba2('0x3'),_0xbba2('0x4'),_0xbba2('0x5'),'onhold'];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0xbba2('0x6')};var strategy={'rrmemory':_0xbba2('0x7'),'roundrobin':_0xbba2('0x8')};function VoiceQueue(_0x15267b){this['id']=_0x15267b['id']||0x0;this[_0xbba2('0x9')]=_0x15267b[_0xbba2('0x9')]||'';this['monitor_format']=_0x15267b[_0xbba2('0xa')]||'';this[_0xbba2('0xb')]=_0x15267b[_0xbba2('0xb')]||'inbound';this[_0xbba2('0xc')]=0x0;this['talking']=0x0;this[_0xbba2('0xd')]=0x0;this[_0xbba2('0xe')]=0x0;this[_0xbba2('0xf')]=0x0;this[_0xbba2('0x10')]=0x0;this[_0xbba2('0x11')]=0x0;this[_0xbba2('0x12')]=0x0;this[_0xbba2('0x13')]=0x0;this['loggedIn']=0x0;this[_0xbba2('0x14')]=0x0;this[_0xbba2('0x15')]=_0x15267b[_0xbba2('0x15')]||![];this[_0xbba2('0x16')]=_0x15267b['acwTimeout']||0xa;this['autopause']=_0x15267b[_0xbba2('0x17')]||'no';this[_0xbba2('0x18')]=!![];this[_0xbba2('0x19')]='';this['originated']=0x0;this[_0xbba2('0x1a')]=0x0;this['dialTimezone']=_0x15267b[_0xbba2('0x1b')]||null;this[_0xbba2('0x1c')]=_0x15267b[_0xbba2('0x1c')]?_0x15267b[_0xbba2('0x1c')]:null;this[_0xbba2('0x1d')]=_0x15267b[_0xbba2('0x1d')];this[_0xbba2('0x1e')]=_0x15267b[_0xbba2('0x1e')]||_0xbba2('0x1f');this[_0xbba2('0x20')]=_0x15267b[_0xbba2('0x20')]||0x0;this[_0xbba2('0x21')]=_0x15267b[_0xbba2('0x21')]||0x0;this[_0xbba2('0x22')]=_0x15267b[_0xbba2('0x22')]||0x1;this[_0xbba2('0x23')]=_0x15267b[_0xbba2('0x23')]||_0xbba2('0x24');this[_0xbba2('0x25')]=_0x15267b[_0xbba2('0x25')]||0.03;this[_0xbba2('0x26')]=_0x15267b[_0xbba2('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x15267b[_0xbba2('0x27')]||_0xbba2('0x28');this[_0xbba2('0x29')]=_0x15267b[_0xbba2('0x29')]||'anonymous';this[_0xbba2('0x2a')]=_0x15267b[_0xbba2('0x2a')]||0x1e;this['dialQueueOptions']=_0x15267b[_0xbba2('0x2b')]||_0xbba2('0x2c');this[_0xbba2('0x2d')]=_0x15267b[_0xbba2('0x2d')]||0x3;this[_0xbba2('0x2e')]=_0x15267b[_0xbba2('0x2e')]||undefined;this[_0xbba2('0x2f')]=_0x15267b[_0xbba2('0x2f')]||0x3;this[_0xbba2('0x30')]=_0x15267b[_0xbba2('0x30')]||0x96;this[_0xbba2('0x31')]=_0x15267b[_0xbba2('0x31')]||0x3;this[_0xbba2('0x32')]=_0x15267b[_0xbba2('0x32')]||0x96;this['dialNoAnswerMaxRetry']=_0x15267b[_0xbba2('0x33')]||0x3;this[_0xbba2('0x34')]=_0x15267b[_0xbba2('0x34')]||0x96;this[_0xbba2('0x35')]=_0x15267b[_0xbba2('0x35')]||0x4;this[_0xbba2('0x36')]=_0x15267b[_0xbba2('0x36')]?_0x15267b[_0xbba2('0x36')]:undefined;this[_0xbba2('0x37')]=_0x15267b[_0xbba2('0x37')]?_0x15267b[_0xbba2('0x37')]:undefined;this[_0xbba2('0x38')]=_0x15267b['dialPrefix']||undefined;this[_0xbba2('0x39')]=_0x15267b[_0xbba2('0x39')]?_0x15267b['Interval']:undefined;this[_0xbba2('0x3a')]=_0x15267b['dialOrderByScheduledAt']||_0xbba2('0x3b');this['dialRandomLastDigitCallerIdNumber']=_0x15267b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xbba2('0x3c')]=_0x15267b[_0xbba2('0x3c')]||undefined;this['strategy']=strategy[_0x15267b[_0xbba2('0x3d')]]||_0xbba2('0x7');this[_0xbba2('0x3e')]=!![];this[_0xbba2('0x3f')]=_0x15267b['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x15267b[_0xbba2('0x40')];this[_0xbba2('0x41')]=_0x15267b[_0xbba2('0x41')];this[_0xbba2('0x42')]=_0x15267b['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x15267b[_0xbba2('0x43')];this[_0xbba2('0x44')]=_0x15267b[_0xbba2('0x44')];this[_0xbba2('0x45')]=_0x15267b[_0xbba2('0x45')];this[_0xbba2('0x46')]=_0x15267b[_0xbba2('0x46')];this[_0xbba2('0x47')]=_0x15267b['dialAMDSilenceThreshold'];this[_0xbba2('0x48')]=_0x15267b[_0xbba2('0x48')];this[_0xbba2('0x49')]=0x0;this[_0xbba2('0x4a')]=0x0;this['timeout']=_0x15267b[_0xbba2('0x4b')];this[_0xbba2('0x4c')]=0x0;this[_0xbba2('0x4d')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xbba2('0x4e')]=0x0;this[_0xbba2('0x4f')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xbba2('0x50')]=0x0;this[_0xbba2('0x51')]=0x0;this[_0xbba2('0x52')]=0x0;this[_0xbba2('0x53')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xbba2('0x54')]=0x0;this[_0xbba2('0x55')]=0x0;this[_0xbba2('0x56')]=undefined;this[_0xbba2('0x57')]=undefined;this[_0xbba2('0x58')]=undefined;this[_0xbba2('0x59')]=1.05;this[_0xbba2('0x5a')]=0x0;this[_0xbba2('0x5b')]=0x0;this[_0xbba2('0x5c')]=0x0;this[_0xbba2('0x5d')]=0x0;this[_0xbba2('0x5e')]=0x0;this[_0xbba2('0x5f')]=0x0;this[_0xbba2('0x60')]=0x0;this[_0xbba2('0x61')]=0x0;this[_0xbba2('0x62')]=_0x15267b['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xbba2('0x63')]=_0x15267b[_0xbba2('0x64')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xbba2('0x65')]=0x0;this[_0xbba2('0x66')]=0x0;this[_0xbba2('0x67')]=0x0;this[_0xbba2('0x68')]=0x0;this[_0xbba2('0x69')]=_0x15267b[_0xbba2('0x69')]||0x1e;this[_0xbba2('0x6a')]=_0x15267b[_0xbba2('0x6a')]||![];this[_0xbba2('0x6b')]=_0x15267b['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x15267b[_0xbba2('0x6c')]||![];this['dialAgiAfterHangupAgent']=_0x15267b[_0xbba2('0x6d')]||![];this[_0xbba2('0xa')]=monitorFormat[_0x15267b[_0xbba2('0xa')]]?monitorFormat[_0x15267b['monitor_format']]:undefined;this[_0xbba2('0x6e')]=_0x15267b[_0xbba2('0x6e')]||![];this[_0xbba2('0x6f')]=_0x15267b[_0xbba2('0x6f')]?_0x15267b['mandatoryDispositionPause']:undefined;}module[_0xbba2('0x70')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index adcb91e..c588966 100644 --- a/server/services/ami/model/vtigerAccount.js +++ b/server/services/ami/model/vtigerAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9808=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x196995,_0x2575dd){var _0x1ff73a=function(_0x4b6aeb){while(--_0x4b6aeb){_0x196995['push'](_0x196995['shift']());}};_0x1ff73a(++_0x2575dd);}(_0x9808,0xb3));var _0x8980=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9808[_0x47aa64];return _0x549c7a;};'use strict';function VtigerAccount(_0x10e7be){this['id']=_0x10e7be['id']||0x0;this[_0x8980('0x0')]=_0x10e7be[_0x8980('0x0')]||'';this[_0x8980('0x1')]=_0x10e7be[_0x8980('0x1')]||'';this[_0x8980('0x2')]=_0x10e7be['accessKey']||'';this[_0x8980('0x3')]=_0x10e7be[_0x8980('0x3')]||'';this['serverUrl']=_0x10e7be[_0x8980('0x4')]||'';this['Configurations']=_0x10e7be[_0x8980('0x5')]||{};}module[_0x8980('0x6')]=VtigerAccount; \ No newline at end of file +var _0xbbf0=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x554b96,_0xa7f28){var _0xe445a8=function(_0x1c2dfb){while(--_0x1c2dfb){_0x554b96['push'](_0x554b96['shift']());}};_0xe445a8(++_0xa7f28);}(_0xbbf0,0xd0));var _0x0bbf=function(_0x276a8a,_0x35aaf5){_0x276a8a=_0x276a8a-0x0;var _0x1ca3de=_0xbbf0[_0x276a8a];return _0x1ca3de;};'use strict';function VtigerAccount(_0x15984c){this['id']=_0x15984c['id']||0x0;this['name']=_0x15984c[_0x0bbf('0x0')]||'';this['username']=_0x15984c[_0x0bbf('0x1')]||'';this[_0x0bbf('0x2')]=_0x15984c[_0x0bbf('0x2')]||'';this[_0x0bbf('0x3')]=_0x15984c[_0x0bbf('0x3')]||'';this[_0x0bbf('0x4')]=_0x15984c[_0x0bbf('0x4')]||'';this['Configurations']=_0x15984c[_0x0bbf('0x5')]||{};}module[_0x0bbf('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 84b88a5..bf90db1 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x2164f6,_0x58c8ca){_0x2164f6=_0x2164f6-0x0;var _0x31c69e=_0xdb28[_0x2164f6];return _0x31c69e;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x7a54=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0x7a54,0x106));var _0x47a5=function(_0x1a4cc5,_0xe7c7ea){_0x1a4cc5=_0x1a4cc5-0x0;var _0x8fe6f3=_0x7a54[_0x1a4cc5];return _0x8fe6f3;};'use strict';function ZendeskAccount(_0xe384a5){this['id']=_0xe384a5['id']||0x0;this[_0x47a5('0x0')]=_0xe384a5[_0x47a5('0x0')]||'';this['username']=_0xe384a5[_0x47a5('0x1')]||'';this[_0x47a5('0x2')]=_0xe384a5['password']||'';this[_0x47a5('0x3')]=_0xe384a5[_0x47a5('0x3')]||'';this[_0x47a5('0x4')]=_0xe384a5[_0x47a5('0x4')]||'';this[_0x47a5('0x5')]=_0xe384a5['authType']||'';this[_0x47a5('0x6')]=_0xe384a5['type']||_0x47a5('0x7');this[_0x47a5('0x8')]=_0xe384a5['serverUrl']||'';this[_0x47a5('0x9')]=_0xe384a5['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index d41f5c8..0679ce4 100644 --- a/server/services/ami/model/zohoAccount.js +++ b/server/services/ami/model/zohoAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5d7=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x82f6aa,_0xc6acd1){var _0x3ff4d0=function(_0x33c15f){while(--_0x33c15f){_0x82f6aa['push'](_0x82f6aa['shift']());}};_0x3ff4d0(++_0xc6acd1);}(_0xa5d7,0x1c3));var _0x7a5d=function(_0x487ec9,_0x351700){_0x487ec9=_0x487ec9-0x0;var _0x5224f1=_0xa5d7[_0x487ec9];return _0x5224f1;};'use strict';function ZohoAccount(_0x346daf){this['id']=_0x346daf['id']||0x0;this[_0x7a5d('0x0')]=_0x346daf[_0x7a5d('0x0')]||'';this[_0x7a5d('0x1')]=_0x346daf['description']||'';this[_0x7a5d('0x2')]=_0x346daf['host']||'';this[_0x7a5d('0x3')]=_0x346daf['zone']||'';this[_0x7a5d('0x4')]=_0x346daf['clientId']||'';this[_0x7a5d('0x5')]=_0x346daf[_0x7a5d('0x5')]||'';this[_0x7a5d('0x6')]=_0x346daf['serverUrl']||'';this[_0x7a5d('0x7')]=_0x346daf[_0x7a5d('0x7')]||'';this['refreshToken']=_0x346daf[_0x7a5d('0x8')]||'';this['Configurations']=_0x346daf[_0x7a5d('0x9')]||{};}module[_0x7a5d('0xa')]=ZohoAccount; \ No newline at end of file +var _0x9c32=['clientId','clientSecret','code','refreshToken','exports','name','description','zone'];(function(_0x3a3905,_0x298915){var _0x33735e=function(_0x47fc4e){while(--_0x47fc4e){_0x3a3905['push'](_0x3a3905['shift']());}};_0x33735e(++_0x298915);}(_0x9c32,0x15d));var _0x29c3=function(_0x400fe9,_0x2c15ff){_0x400fe9=_0x400fe9-0x0;var _0x5663a5=_0x9c32[_0x400fe9];return _0x5663a5;};'use strict';function ZohoAccount(_0x5747e7){this['id']=_0x5747e7['id']||0x0;this[_0x29c3('0x0')]=_0x5747e7[_0x29c3('0x0')]||'';this['description']=_0x5747e7[_0x29c3('0x1')]||'';this['host']=_0x5747e7['host']||'';this[_0x29c3('0x2')]=_0x5747e7[_0x29c3('0x2')]||'';this['clientId']=_0x5747e7[_0x29c3('0x3')]||'';this['clientSecret']=_0x5747e7[_0x29c3('0x4')]||'';this['serverUrl']=_0x5747e7['serverUrl']||'';this[_0x29c3('0x5')]=_0x5747e7[_0x29c3('0x5')]||'';this[_0x29c3('0x6')]=_0x5747e7['refreshToken']||'';this['Configurations']=_0x5747e7['Configurations']||{};}module[_0x29c3('0x7')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index b747752..f587864 100644 --- a/server/services/ami/preview/action.js +++ b/server/services/ami/preview/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee99=['Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','exports','lodash','moment','isNil','string','uniqueid','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname'];(function(_0x528410,_0x13ec15){var _0x247f04=function(_0x42c49b){while(--_0x42c49b){_0x528410['push'](_0x528410['shift']());}};_0x247f04(++_0x13ec15);}(_0xee99,0x13e));var _0x9ee9=function(_0x288a7f,_0x142d1d){_0x288a7f=_0x288a7f-0x0;var _0x345ed0=_0xee99[_0x288a7f];return _0x345ed0;};'use strict';var util=require('util');var _=require(_0x9ee9('0x0'));var moment=require(_0x9ee9('0x1'));function checkNameSurname(_0x55898f,_0x2711ec,_0x15da65){var _0xcc432a='';if(!_[_0x9ee9('0x2')](_0x2711ec)&&_0x9ee9('0x3')===typeof _0x2711ec){_0xcc432a+=_0x2711ec;}if(!_['isNil'](_0x15da65)&&_0x9ee9('0x3')===typeof _0x15da65){_0xcc432a+='\x20'+_0x15da65;}if(_0xcc432a!==''){return _0xcc432a;}return _0x55898f;}function Action(_0x1aa807,_0x210658,_0x1a126d,_0x2003fc,_0x53e096){this[_0x9ee9('0x4')]=_0x1a126d||undefined;this['idContact']=_0x1aa807['id'];this['queue']=_0x210658[_0x9ee9('0x5')];this[_0x9ee9('0x6')]=_0x210658[_0x9ee9('0x6')];this[_0x9ee9('0x7')]=_0x9ee9('0x8');this[_0x9ee9('0x9')]=![];this[_0x9ee9('0xa')]=_[_0x9ee9('0x2')](_0x1aa807[_0x9ee9('0xb')])?undefined:_0x1aa807[_0x9ee9('0xb')][_0x9ee9('0x5')];this[_0x9ee9('0xc')]=this[_0x9ee9('0xa')]?util['format'](_0x9ee9('0xd'),this[_0x9ee9('0xa')]):_0x2003fc||undefined;this[_0x9ee9('0xe')]=checkNameSurname(_0x1aa807[_0x9ee9('0xf')][_0x9ee9('0x10')],_0x1aa807[_0x9ee9('0xf')][_0x9ee9('0x11')],_0x1aa807[_0x9ee9('0xf')]['lastName']);this[_0x9ee9('0x12')]=_0x1aa807[_0x9ee9('0x12')]||![];this[_0x9ee9('0x13')]=_0x1aa807[_0x9ee9('0xf')][_0x9ee9('0x10')];this[_0x9ee9('0x14')]=_0x1aa807[_0x9ee9('0x14')];this[_0x9ee9('0x15')]=_0x1aa807[_0x9ee9('0x15')]||0x0;this[_0x9ee9('0x16')]=_0x1aa807['countcongestionretry']||0x0;this[_0x9ee9('0x17')]=_0x1aa807['countnoanswerretry']||0x0;this[_0x9ee9('0x18')]=(_0x1aa807[_0x9ee9('0x15')]||0x0)+(_0x1aa807['countcongestionretry']||0x0)+(_0x1aa807['countnoanswerretry']||0x0);this[_0x9ee9('0x19')]=_0x1aa807[_0x9ee9('0x19')];this['callbackuniqueid']=_0x1aa807[_0x9ee9('0x1a')];this[_0x9ee9('0x1b')]=_0x1aa807['callbackat'];this[_0x9ee9('0x1c')]=_0x1aa807[_0x9ee9('0x1c')];this[_0x9ee9('0x1d')]=_0x1aa807[_0x9ee9('0x1d')];this[_0x9ee9('0x1e')]=_0x1aa807[_0x9ee9('0x1e')];this[_0x9ee9('0x1f')]=_['isNil'](_0x1aa807[_0x9ee9('0xb')])?_0x1aa807[_0x9ee9('0x1f')]:_0x1aa807[_0x9ee9('0xb')]['id'];this[_0x9ee9('0x20')]=_0x1aa807[_0x9ee9('0x20')];this['originatecalleridnum']='';this[_0x9ee9('0x21')]='';}Action[_0x9ee9('0x22')][_0x9ee9('0x23')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x9ee9('0xe')],this['number']);};module[_0x9ee9('0x24')]=Action; \ No newline at end of file +var _0x8fe0=['idContact','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x8fe0,0x66));var _0x08fe=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8fe0[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x08fe('0x0'));var _=require(_0x08fe('0x1'));var moment=require(_0x08fe('0x2'));function checkNameSurname(_0x5632de,_0x2eff87,_0x55db33){var _0x22bfb0='';if(!_[_0x08fe('0x3')](_0x2eff87)&&_0x08fe('0x4')===typeof _0x2eff87){_0x22bfb0+=_0x2eff87;}if(!_[_0x08fe('0x3')](_0x55db33)&&_0x08fe('0x4')===typeof _0x55db33){_0x22bfb0+='\x20'+_0x55db33;}if(_0x22bfb0!==''){return _0x22bfb0;}return _0x5632de;}function Action(_0x2bbcae,_0x258c03,_0x50d6f0,_0x47c2d0,_0x6f6dac){this[_0x08fe('0x5')]=_0x50d6f0||undefined;this[_0x08fe('0x6')]=_0x2bbcae['id'];this['queue']=_0x258c03['name'];this['type']=_0x258c03[_0x08fe('0x7')];this[_0x08fe('0x8')]='queue';this[_0x08fe('0x9')]=![];this[_0x08fe('0xa')]=_[_0x08fe('0x3')](_0x2bbcae[_0x08fe('0xb')])?undefined:_0x2bbcae[_0x08fe('0xb')][_0x08fe('0xc')];this[_0x08fe('0xd')]=this[_0x08fe('0xa')]?util[_0x08fe('0xe')]('SIP/%s',this['membername']):_0x47c2d0||undefined;this['calleridname']=checkNameSurname(_0x2bbcae[_0x08fe('0xf')][_0x08fe('0x10')],_0x2bbcae[_0x08fe('0xf')]['firstName'],_0x2bbcae[_0x08fe('0xf')][_0x08fe('0x11')]);this[_0x08fe('0x12')]=_0x2bbcae[_0x08fe('0x12')]||![];this[_0x08fe('0x13')]=_0x2bbcae['Contact'][_0x08fe('0x10')];this[_0x08fe('0x14')]=_0x2bbcae['scheduledat'];this['countbusyretry']=_0x2bbcae[_0x08fe('0x15')]||0x0;this[_0x08fe('0x16')]=_0x2bbcae[_0x08fe('0x16')]||0x0;this[_0x08fe('0x17')]=_0x2bbcae['countnoanswerretry']||0x0;this['countglobal']=(_0x2bbcae[_0x08fe('0x15')]||0x0)+(_0x2bbcae[_0x08fe('0x16')]||0x0)+(_0x2bbcae[_0x08fe('0x17')]||0x0);this[_0x08fe('0x18')]=_0x2bbcae['callback'];this['callbackuniqueid']=_0x2bbcae['callbackuniqueid'];this[_0x08fe('0x19')]=_0x2bbcae[_0x08fe('0x19')];this[_0x08fe('0x1a')]=_0x2bbcae[_0x08fe('0x1a')];this[_0x08fe('0x1b')]=_0x2bbcae[_0x08fe('0x1b')];this[_0x08fe('0x1c')]=_0x2bbcae[_0x08fe('0x1c')];this[_0x08fe('0x1d')]=_['isNil'](_0x2bbcae[_0x08fe('0xb')])?_0x2bbcae[_0x08fe('0x1d')]:_0x2bbcae[_0x08fe('0xb')]['id'];this[_0x08fe('0x1e')]=_0x2bbcae['VoiceQueueId'];this[_0x08fe('0x1f')]='';this['originatecalleridname']='';}Action[_0x08fe('0x20')][_0x08fe('0x21')]=function(){return util[_0x08fe('0xe')](_0x08fe('0x22'),this['calleridname'],this['number']);};module[_0x08fe('0x23')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 2a0c6e4..15322d0 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6291=['[syncHangup][talking][decrement]','BUSY','countbusyretry','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countcongestionretry','outboundRejectCallsDay','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','logAgent','createAgentHistory','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','Queue:\x20','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','[Preview][getContactPreview]','Call\x20unsuccessful','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','Action','variablesAction','[originated][increment]','OriginateError','syncOriginateResponse','lookAgent','logLookAgent','clone','isFailure','response','disableContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','message','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','preview','booked','setMessage','recallMe','clearZombieChannel','sequence','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','stringify','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','agentReadyId','then','length','getDiff','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','createCustomerHistory','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime'];(function(_0x4eb3ec,_0x51b871){var _0x1a3de8=function(_0x179f80){while(--_0x179f80){_0x4eb3ec['push'](_0x4eb3ec['shift']());}};_0x1a3de8(++_0x51b871);}(_0x6291,0x81));var _0x1629=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x6291[_0x46401e];return _0x447cba;};'use strict';var util=require('util');var _=require(_0x1629('0x0'));var BPromise=require(_0x1629('0x1'));var uuid=require(_0x1629('0x2'));var moment=require(_0x1629('0x3'));var md5=require(_0x1629('0x4'));var Redis=require(_0x1629('0x5'));var config=require(_0x1629('0x6'));var logger=require(_0x1629('0x7'))('preview');var loggerAction=require(_0x1629('0x7'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0x1629('0x8'));var Action=require(_0x1629('0x9'));var ut=require(_0x1629('0xa'));config[_0x1629('0xb')]=_[_0x1629('0xc')](config[_0x1629('0xb')],{'host':_0x1629('0xd'),'port':0x18eb});var io=require(_0x1629('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x1629('0xf')][_0x1629('0x10')]=function(_0x2be0d6){this[_0x1629('0x11')]=this[_0x1629('0x11')]?this[_0x1629('0x11')]['finally'](_0x2be0d6):_0x2be0d6();};function Preview(_0x880db9){this['sequence']=new Sequence();this[_0x1629('0x12')]=_0x880db9[_0x1629('0x13')];this[_0x1629('0x14')]=_0x880db9[_0x1629('0x14')];this[_0x1629('0x15')]={};this['agents']=_0x880db9[_0x1629('0x16')];this[_0x1629('0x17')]=0x0;ami['on'](_0x1629('0x18'),this['syncOriginateResponse'][_0x1629('0x19')](this));ami['on'](_0x1629('0x1a'),this[_0x1629('0x1b')][_0x1629('0x19')](this));ami['on'](_0x1629('0x1c'),this['syncHangupRequest'][_0x1629('0x19')](this));ami['on'](_0x1629('0x1d'),this[_0x1629('0x1e')][_0x1629('0x19')](this));ami['on'](_0x1629('0x1f'),this[_0x1629('0x20')][_0x1629('0x19')](this));ami['on'](_0x1629('0x21'),this[_0x1629('0x22')][_0x1629('0x19')](this));ami['on'](_0x1629('0x23'),this[_0x1629('0x24')][_0x1629('0x19')](this));ami['on'](_0x1629('0x25'),this['syncBlindTransfer']['bind'](this));this[_0x1629('0x26')](this['campaignsPreview']);}function emit(_0xc68422,_0x5c34bd,_0x4c8014){io['to'](_0xc68422)[_0x1629('0x27')](_0x5c34bd,_0x4c8014);}function emitCampaignPreview(_0x313d4a){if(_0x313d4a[_0x1629('0x28')]===_0x1629('0x29')){var _0x251402={'id':_0x313d4a['id'],'name':_0x313d4a['name'],'strategy':_0x313d4a[_0x1629('0x2a')],'answered':_0x313d4a[_0x1629('0x2b')],'available':_0x313d4a[_0x1629('0x2c')],'loggedIn':_0x313d4a[_0x1629('0x2d')],'pTalking':_0x313d4a[_0x1629('0x2e')],'sumBillable':_0x313d4a[_0x1629('0x2f')],'sumDuration':_0x313d4a[_0x1629('0x30')],'sumHoldTime':_0x313d4a['sumHoldTime']||0x0,'talking':_0x313d4a['talking'],'total':_0x313d4a[_0x1629('0x31')],'type':_0x313d4a[_0x1629('0x28')],'unmanaged':_0x313d4a['unmanaged'],'abandoned':_0x313d4a[_0x1629('0x32')],'waiting':_0x313d4a[_0x1629('0x33')],'loggedInDb':_0x313d4a['loggedInDb'],'dialActive':_0x313d4a[_0x1629('0x34')],'dialMethod':_0x313d4a['dialMethod'],'dialOriginateCallerIdName':_0x313d4a[_0x1629('0x35')],'dialOriginateCallerIdNumber':_0x313d4a['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x313d4a['dialOriginateTimeout'],'dialPrefix':_0x313d4a[_0x1629('0x36')],'outboundAnswerAgiCallsDay':_0x313d4a['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x313d4a[_0x1629('0x37')],'outboundBlacklistCallsDay':_0x313d4a[_0x1629('0x38')],'outboundBusyCallsDay':_0x313d4a[_0x1629('0x39')],'outboundCongestionCallsDay':_0x313d4a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x313d4a['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x313d4a[_0x1629('0x3a')],'outboundDropCallsDayTimeout':_0x313d4a[_0x1629('0x3b')],'outboundNoAnswerCallsDay':_0x313d4a[_0x1629('0x3c')],'outboundNoSuchCallsDay':_0x313d4a[_0x1629('0x3d')],'outboundOriginateFailureCallsDay':_0x313d4a['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x313d4a['outboundReCallsDay'],'outboundRejectCallsDay':_0x313d4a['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x313d4a[_0x1629('0x3e')],'predictiveIntervalAnsweredCalls':_0x313d4a[_0x1629('0x3f')],'predictiveIntervalAvgHoldtime':_0x313d4a['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x313d4a['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x313d4a[_0x1629('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x313d4a[_0x1629('0x41')],'predictiveIntervalErlangCalls':_0x313d4a[_0x1629('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x313d4a['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x313d4a[_0x1629('0x43')],'predictiveIntervalMultiplicativeFactor':_0x313d4a[_0x1629('0x44')],'predictiveIntervalPauses':_0x313d4a['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x313d4a[_0x1629('0x45')],'predictiveIntervalTotalCalls':_0x313d4a[_0x1629('0x46')],'message':_0x313d4a['message'],'originated':_0x313d4a[_0x1629('0x47')],'erlangCalls':_0x313d4a[_0x1629('0x48')],'erlangCallToSecond':_0x313d4a[_0x1629('0x49')],'erlangAbandonmentRate':_0x313d4a[_0x1629('0x4a')],'erlangBusyFactor':_0x313d4a['erlangBusyFactor'],'startPredictive':_0x313d4a[_0x1629('0x4b')],'startProgressive':_0x313d4a[_0x1629('0x4c')]};if(_0x313d4a['Trunk']){_0x251402[_0x1629('0x4d')]={'id':_0x313d4a[_0x1629('0x4d')]['id'],'name':_0x313d4a[_0x1629('0x4d')][_0x1629('0x4e')],'active':_0x313d4a[_0x1629('0x4d')][_0x1629('0x4f')],'callerid':_0x313d4a[_0x1629('0x4d')][_0x1629('0x50')]};}if(_0x313d4a[_0x1629('0x51')]){_0x251402[_0x1629('0x51')]={'id':_0x313d4a[_0x1629('0x51')]['id'],'name':_0x313d4a[_0x1629('0x51')][_0x1629('0x4e')]};}var _0x343d0e=md5(JSON['stringify'](_0x251402));if(_0x313d4a['md5']!==_0x343d0e){_0x313d4a['md5']=_0x343d0e;emit(util[_0x1629('0x52')]('voice:queue:%s',_0x251402['name']),'voice_queue:save',_0x251402);}}}function emitVoiceQueueChannelRemove(_0x1ca7e0){emit(util[_0x1629('0x52')](_0x1629('0x53'),_0x1ca7e0[_0x1629('0x4e')]),_0x1629('0x54'),_0x1ca7e0);}function notSendMessagesQueue(_0x13cea6){if(_0x13cea6['sendMessageOneNotActive']){if(_0x13cea6[_0x1629('0x47')]===0x0&&_0x13cea6[_0x1629('0x2e')]===0x0){_0x13cea6[_0x1629('0x55')]=![];_0x13cea6[_0x1629('0x2c')]=0x0;_0x13cea6[_0x1629('0x56')]=0x0;_0x13cea6['message']=_0x1629('0x57');ut[_0x1629('0x58')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13cea6[_0x1629('0x4e')]+'\x20is\x20not\x20active');}else{_0x13cea6[_0x1629('0x59')]=_0x1629('0x5a');ut[_0x1629('0x58')](_0x1629('0x5b'),_0x13cea6[_0x1629('0x4e')]+_0x1629('0x5c'));}emitCampaignPreview(_0x13cea6);}}Preview[_0x1629('0xf')][_0x1629('0x26')]=function(){var _0x4c664c=this;setInterval(function(){_0x4c664c['syncCampaigns']();},0x7cf);};Preview[_0x1629('0xf')][_0x1629('0x5d')]=function(){var _0x50fe55=this[_0x1629('0x12')];this[_0x1629('0x17')]+=0x1;for(var _0x397147 in _0x50fe55){if(_0x50fe55[_0x1629('0x5e')](_0x397147)&&(_0x50fe55[_0x397147][_0x1629('0x5f')]===_0x1629('0x60')||_0x50fe55[_0x397147][_0x1629('0x5f')]===_0x1629('0x61'))&&_0x50fe55[_0x397147]['type']==='outbound'){if(this[_0x1629('0x17')]>0x7){this[_0x1629('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x50fe55[_0x1629('0x5e')](_0x397147)&&_0x50fe55[_0x397147][_0x1629('0x5f')]===_0x1629('0x60')&&_0x50fe55[_0x397147][_0x1629('0x28')]===_0x1629('0x29')){if(_0x50fe55[_0x397147]['dialActive']){this[_0x1629('0x62')](_0x50fe55[_0x397147]);this[_0x1629('0x63')](_0x50fe55[_0x397147]);}else{notSendMessagesQueue(_0x50fe55[_0x397147]);}}}};Preview[_0x1629('0xf')][_0x1629('0x64')]=function(_0x28c876){var _0x19d458=this;this[_0x1629('0x65')][_0x1629('0x10')](function(){if(!_[_0x1629('0x66')](_0x19d458[_0x1629('0x15')][_0x28c876])){loggerAction[_0x1629('0x67')](_0x1629('0x68'),_0x28c876,_0x1629('0x69'),_0x19d458['actions'][_0x28c876][_0x1629('0x6a')],_0x1629('0x6b'),JSON[_0x1629('0x6c')](_0x19d458[_0x1629('0x12')][_0x19d458[_0x1629('0x15')][_0x28c876][_0x1629('0x6a')]][_0x1629('0x47')]),_0x1629('0x6d'),JSON[_0x1629('0x6c')](_0x19d458[_0x1629('0x12')][_0x19d458[_0x1629('0x15')][_0x28c876][_0x1629('0x6a')]][_0x1629('0x2e')]),JSON[_0x1629('0x6c')](_0x19d458[_0x1629('0x15')][_0x28c876]['dialAnswer']),JSON['stringify'](_[_0x1629('0x6e')](_0x19d458[_0x1629('0x15')][_0x28c876],[_0x1629('0x6f'),_0x1629('0x70'),_0x1629('0x71'),_0x1629('0x72')])));return ami['Action']({'action':_0x1629('0x73'),'channel':_0x19d458[_0x1629('0x15')][_0x28c876][_0x1629('0x74')]})[_0x1629('0x75')](function(_0x500cb7){if(_0x500cb7['message']===_0x1629('0x76')){setTimeout(function(){if(_0x19d458[_0x1629('0x15')][_0x28c876]){ut['updateOriginated'](_0x19d458[_0x1629('0x12')][_0x19d458['actions'][_0x28c876]['queue']],_0x1629('0x77'));if(_0x19d458[_0x1629('0x15')][_0x28c876][_0x1629('0x78')]===!![]){ut[_0x1629('0x79')](_0x19d458[_0x1629('0x12')][_0x19d458[_0x1629('0x15')][_0x28c876]['queue']],_0x1629('0x77'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x28c876,_0x19d458[_0x1629('0x15')][_0x28c876][_0x1629('0x6a')]);}ut[_0x1629('0x7a')](_0x1629('0x7b')+_0x28c876,_0x19d458[_0x1629('0x15')][_0x28c876][_0x1629('0x6a')]);delete _0x19d458[_0x1629('0x15')][_0x28c876];}},0x2328);}});}});};Preview['prototype'][_0x1629('0x7c')]=function(){var _0x5d445f=this;loggerAction['info'](_0x1629('0x7d'),_[_0x1629('0x7e')](this[_0x1629('0x15')]));for(var _0x4e70d8 in this[_0x1629('0x15')]){if(_0x5d445f[_0x1629('0x15')][_0x1629('0x5e')](_0x4e70d8)){_0x5d445f[_0x1629('0x64')](_0x4e70d8);}}};Preview[_0x1629('0xf')][_0x1629('0x63')]=function(_0x4d6c4c){var _0x5b0cca=this;rpcDb['getContactRecallMe'](_0x4d6c4c['id'],ut[_0x1629('0x7f')](this[_0x1629('0x16')]))[_0x1629('0x80')](function(_0x278bcb){if(!_[_0x1629('0x66')](_0x278bcb)){for(var _0x153ad4=0x0;_0x153ad4<_0x278bcb[_0x1629('0x81')];_0x153ad4+=0x1){if(ut[_0x1629('0x82')](_0x278bcb[_0x153ad4]['scheduledat'])<_0x4d6c4c[_0x1629('0x83')]*0x3c){_0x5b0cca[_0x1629('0x84')](_0x278bcb[_0x153ad4]['id'])[_0x1629('0x80')](ut[_0x1629('0x85')](_0x1629('0x86')))[_0x1629('0x75')](ut[_0x1629('0x85')]('[RecallMe]'));}else{var _0x28e667=new Action(_0x278bcb[_0x153ad4],_0x4d6c4c);_0x28e667[_0x1629('0x87')]=moment()[_0x1629('0x52')](_0x1629('0x88'));_0x4d6c4c[_0x1629('0x89')]+=0x1;ut['logCustomer'](_0x28e667,0x17,_0x1629('0x8a'));if(_0x4d6c4c[_0x1629('0x8b')]){rpcDb[_0x1629('0x8c')](ut[_0x1629('0x8d')](_0x278bcb[_0x153ad4]));rpcDb['createCustomerHistory'](_0x28e667,_0x1629('0x8e'));}else{ut[_0x1629('0x8f')](_0x28e667,0x16,_0x1629('0x90'));rpcDb['createCustomerHistory'](_0x28e667,_0x1629('0x91'));rpcDb[_0x1629('0x92')](_0x28e667,_0x1629('0x91'));}}}}})['catch'](ut[_0x1629('0x85')](_0x1629('0x93')));};Preview[_0x1629('0xf')][_0x1629('0x62')]=function(_0x403dce){_0x403dce[_0x1629('0x55')]=!![];if(ut[_0x1629('0x94')](_0x403dce['loggedIn'])){_0x403dce[_0x1629('0x59')]=_0x1629('0x95');}else if(!ut[_0x1629('0x96')](_0x403dce[_0x1629('0x34')])){_0x403dce[_0x1629('0x59')]=_0x1629('0x57');}else if(!this[_0x1629('0x97')](_0x403dce[_0x1629('0x4d')])){if(!this['isTrunkReachable'](_0x403dce[_0x1629('0x98')])){_0x403dce[_0x1629('0x59')]=_0x1629('0x99');}else{_0x403dce[_0x1629('0x59')]=_0x1629('0x9a');}}else{_0x403dce[_0x1629('0x59')]=_0x1629('0x9a');}emitCampaignPreview(_0x403dce);};Preview['prototype'][_0x1629('0x9b')]=function(_0x338191,_0x2d6854,_0x10fc18){var _0x31dcc1=this;var _0x2d185b=this[_0x1629('0x15')][_0x2d6854];var _0x31e0e9=this[_0x1629('0x12')][_0x2d185b[_0x1629('0x6a')]];var _0x15da19;if(_0x31e0e9){switch(_0x10fc18){case'1':_0x31e0e9[_0x1629('0x3d')]+=0x1;_0x2d185b[_0x1629('0x9c')]=ut[_0x1629('0x9d')](_0x2d185b);ut[_0x1629('0x8f')](_0x2d185b,0x0,_0x1629('0x9e'));rpcDb[_0x1629('0x9f')](_0x2d185b,_0x1629('0xa0'));if(ut[_0x1629('0x9d')](_0x2d185b)>=_0x31e0e9[_0x1629('0xa1')]){_0x15da19=ut[_0x1629('0xa2')](_0x2d185b,0xf,_0x1629('0xa3'));rpcDb[_0x1629('0x92')](_0x15da19,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x1629('0x92')](_0x2d185b,_0x1629('0xa4'));}delete this[_0x1629('0x15')][_0x338191[_0x1629('0xa5')]];break;case _0x1629('0xa6'):var _0x386f6f=moment()[_0x1629('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d185b[_0x1629('0xa7')]=_0x386f6f;_0x2d185b[_0x1629('0xa8')]=_0x386f6f;_0x2d185b[_0x1629('0x78')]=!![];_0x31e0e9[_0x1629('0x2e')]+=0x1;logger[_0x1629('0x67')](_0x1629('0xa9'),_0x2d185b[_0x1629('0xaa')],_0x1629('0xab'),_0x31e0e9[_0x1629('0x4e')],'pTalking:\x20',_0x31e0e9[_0x1629('0x2e')]);ami[_0x1629('0x27')](_0x1629('0xac'),ut['buildObj'](_0x2d185b,_0x1629('0xad')));if(_0x31e0e9[_0x1629('0xae')]){ami['emit'](_0x1629('0xaf'),ut[_0x1629('0xb0')](_0x2d185b));}break;case'16':ami['emit'](_0x1629('0xb1'),ut[_0x1629('0xb2')](_0x2d185b,'complete'));emitVoiceQueueChannelRemove(ut[_0x1629('0xb2')](_0x2d185b,_0x1629('0xb3')));_0x31e0e9[_0x1629('0x37')]+=0x1;_0x31e0e9[_0x1629('0x31')]+=0x1;_0x31e0e9[_0x1629('0x2b')]+=0x1;ut[_0x1629('0x79')](_0x31e0e9,'[16]');_0x2d185b['countglobal']=ut['totalGlobal'](_0x2d185b);ut['logCustomer'](_0x2d185b,0x4,_0x1629('0xb4'));rpcDb[_0x1629('0x9f')](_0x2d185b,_0x1629('0xb5'));rpcDb[_0x1629('0x92')](_0x2d185b,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x1629('0xb6')](_0x2d185b);_0x31e0e9[_0x1629('0x30')]+=_0x2d185b[_0x1629('0xb7')];_0x31e0e9['sumBillable']+=_0x2d185b[_0x1629('0xb7')];logger[_0x1629('0x67')](_0x1629('0xb8'),_0x2d185b[_0x1629('0xaa')],_0x1629('0xab'),_0x31e0e9[_0x1629('0x4e')],_0x1629('0x6d'),_0x31e0e9['pTalking']);delete this[_0x1629('0x15')][_0x338191[_0x1629('0xa5')]];break;case _0x1629('0xb9'):_0x31e0e9['outboundBusyCallsDay']+=0x1;_0x2d185b[_0x1629('0xba')]+=0x1;_0x2d185b[_0x1629('0x9c')]=ut['totalGlobal'](_0x2d185b);ut[_0x1629('0x8f')](_0x2d185b,0x5,'Busy');rpcDb[_0x1629('0x9f')](_0x2d185b,_0x1629('0xbb'));if(ut['totalGlobal'](_0x2d185b)>=_0x31e0e9[_0x1629('0xa1')]){_0x15da19=ut[_0x1629('0xa2')](_0x2d185b,0xf,'Global');rpcDb[_0x1629('0x92')](_0x15da19,_0x1629('0xbc'));}else{if(_0x2d185b['countbusyretry']>=_0x31e0e9[_0x1629('0xbd')]){rpcDb[_0x1629('0x92')](_0x2d185b,_0x1629('0xbb'));}else{rpcDb[_0x1629('0xbe')](ut[_0x1629('0xbf')](_0x2d185b,_0x1629('0xba'),_0x31e0e9[_0x1629('0xc0')]),_0x2d185b[_0x1629('0xc1')],_0x2d185b[_0x1629('0xc2')]);}}break;case _0x1629('0xc3'):_0x31e0e9[_0x1629('0x3c')]+=0x1;_0x2d185b[_0x1629('0xc4')]+=0x1;_0x2d185b[_0x1629('0x9c')]=ut[_0x1629('0x9d')](_0x2d185b);ut[_0x1629('0x8f')](_0x2d185b,0x3,_0x1629('0xc5'));rpcDb[_0x1629('0x9f')](_0x2d185b,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x1629('0x9d')](_0x2d185b)>=_0x31e0e9[_0x1629('0xa1')]){_0x15da19=ut[_0x1629('0xa2')](_0x2d185b,0xf,_0x1629('0xa3'));rpcDb['createCustomerFinal'](_0x15da19,_0x1629('0xc6'));}else{if(_0x2d185b[_0x1629('0xc4')]>=_0x31e0e9[_0x1629('0xc7')]){rpcDb[_0x1629('0x92')](_0x2d185b,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x1629('0xbe')](ut[_0x1629('0xbf')](_0x2d185b,_0x1629('0xc4'),_0x31e0e9[_0x1629('0xc8')]),_0x2d185b[_0x1629('0xc1')],_0x2d185b['activeContact']);}}break;case'CONGESTION':_0x31e0e9['outboundCongestionCallsDay']+=0x1;_0x2d185b['countcongestionretry']+=0x1;_0x2d185b[_0x1629('0x9c')]=ut[_0x1629('0x9d')](_0x2d185b);ut['logCustomer'](_0x2d185b,0x8,_0x1629('0xc9'));rpcDb[_0x1629('0x9f')](_0x2d185b,_0x1629('0xca'));if(ut['totalGlobal'](_0x2d185b)>=_0x31e0e9['dialGlobalMaxRetry']){_0x15da19=ut[_0x1629('0xa2')](_0x2d185b,0xf,_0x1629('0xa3'));rpcDb[_0x1629('0x92')](_0x15da19,_0x1629('0xcb'));}else{if(_0x2d185b['countcongestionretry']>=_0x31e0e9[_0x1629('0xcc')]){rpcDb[_0x1629('0x92')](_0x2d185b,_0x1629('0xca'));}else{rpcDb[_0x1629('0xbe')](ut[_0x1629('0xbf')](_0x2d185b,_0x1629('0xcd'),_0x31e0e9[_0x1629('0xc0')]),_0x2d185b[_0x1629('0xc1')],_0x2d185b[_0x1629('0xc2')]);}}break;case'CANCEL':_0x31e0e9[_0x1629('0xce')]+=0x1;_0x2d185b[_0x1629('0x9c')]=ut[_0x1629('0x9d')](_0x2d185b);ut[_0x1629('0x8f')](_0x2d185b,0x14,'AgentReject');rpcDb[_0x1629('0x9f')](_0x2d185b,'[syncHangupRequest][logAgentReject]');if(_0x2d185b['unlockAgent']){rpcDb['unlockContact'](_0x2d185b[_0x1629('0xcf')]);}if(_0x2d185b['activeContact']){rpcDb['disableContact'](_0x2d185b[_0x1629('0xcf')]);}break;default:if(_0x2d185b[_0x1629('0x78')]){ut['decrementTalkink'](_0x31e0e9,_0x1629('0xd0'));ut[_0x1629('0x7a')](_0x1629('0xd1')+_0x31e0e9[_0x1629('0x4e')],_0x338191);}_0x31e0e9['outboundUnknownCallsDay']+=0x1;_0x2d185b[_0x1629('0x9c')]=ut[_0x1629('0x9d')](_0x2d185b);ut[_0x1629('0x8f')](_0x2d185b,0xc,_0x338191['cause-txt']||_0x338191[_0x1629('0xd2')]);rpcDb[_0x1629('0x9f')](_0x2d185b,_0x1629('0xd3'));if(ut[_0x1629('0x9d')](_0x2d185b)>=_0x31e0e9[_0x1629('0xa1')]){_0x15da19=ut[_0x1629('0xa2')](_0x2d185b,0xf,'Global');rpcDb[_0x1629('0x92')](_0x15da19,_0x1629('0xd4'));}else{rpcDb['createCustomerFinal'](_0x2d185b,_0x1629('0xd4'));}delete this[_0x1629('0x15')][_0x338191[_0x1629('0xa5')]];}if(!(_0x2d185b[_0x1629('0x78')]&&_0x10fc18==='16')){ut[_0x1629('0xd5')](_0x31e0e9,_0x1629('0xd6'));logger['info'](_0x1629('0xd7'),_0x2d185b[_0x1629('0xaa')],_0x1629('0xab'),_0x31e0e9['name'],_0x1629('0x6b'),_0x31e0e9[_0x1629('0x47')]);}if(_0x10fc18!==_0x1629('0xa6')){delete this['actions'][_0x338191['linkedid']];delete this[_0x1629('0x15')][_0x338191[_0x1629('0xd8')]];}}};Preview[_0x1629('0xf')]['callProgressDetectingAgent']=function(_0x9ffde2,_0x1c6f5d,_0x4af840){if(_[_0x1629('0xd9')](_0x1c6f5d)&&_0x1629('0xda')!==typeof _0x1c6f5d){return;}if(_[_0x1629('0xd9')](_0x4af840)&&_0x1629('0xda')!==typeof _0x4af840){return;}switch(_0x4af840['reason']){case'0':ut[_0x1629('0xdb')](_0x9ffde2,0x0,_0x1629('0x9e'));rpcDb[_0x1629('0xdc')](_0x9ffde2,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x1629('0xdb')](_0x9ffde2,0x3,'NoAnswer');rpcDb[_0x1629('0xdc')](_0x9ffde2,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x1629('0xdb')](_0x9ffde2,0x5,_0x1629('0xdd'));rpcDb[_0x1629('0xdc')](_0x9ffde2,_0x1629('0xde'));break;case'8':ut['logAgent'](_0x9ffde2,0x8,'Congestion');rpcDb[_0x1629('0xdc')](_0x9ffde2,_0x1629('0xdf'));break;case'22':ut[_0x1629('0xdb')](_0x9ffde2,0x16,_0x1629('0xe0'));rpcDb[_0x1629('0xdc')](_0x9ffde2,_0x1629('0xe1'));break;default:ut['logAgent'](_0x9ffde2,0xc,_0x4af840[_0x1629('0xe2')]);rpcDb[_0x1629('0xdc')](_0x9ffde2,_0x1629('0xdf'));}ut[_0x1629('0xd5')](_0x1c6f5d,_0x1629('0xe3'));logger[_0x1629('0x67')]('[originated][decrement][callProgressDetectingAgent]',_0x9ffde2[_0x1629('0xaa')],_0x1629('0xab'),_0x1c6f5d[_0x1629('0x4e')],_0x1629('0x6b'),_0x1c6f5d['originated']);delete this[_0x1629('0x15')][_0x9ffde2['uniqueid']];};Preview['prototype']['checkInBlack']=function(_0x2c8fd6,_0x2b7f92,_0x5dd2bd,_0x4f8380,_0x2220be){var _0x9b2e9a=this;return new BPromise(function(_0x2f29ec,_0x4ef862){if(_['isNil'](_0x2b7f92)||_[_0x1629('0x66')](_0x2b7f92[_0x1629('0xe4')])||_[_0x1629('0x66')](_0x2b7f92['Contact'][_0x1629('0xe5')])||_[_0x1629('0x66')](_0x2b7f92[_0x1629('0x71')])){_0x4ef862(ut[_0x1629('0x59')](_0x1629('0xe6'),_0x4f8380,_0x2220be));return;}var _0x53dfca=uuid['v4']();var _0xcea1d0=_0x9b2e9a[_0x1629('0x12')][_0x2b7f92['Queue']['name']];var _0x160e66=_0x5dd2bd?_0x9b2e9a[_0x1629('0x16')][_0x5dd2bd]['id']:undefined;_0x9b2e9a[_0x1629('0x15')][_0x53dfca]=new Action(_0x2b7f92,_0xcea1d0,_0x53dfca,_0x5dd2bd,_0x160e66);var _0x43e20f=_0x9b2e9a['actions'][_0x53dfca];_0x43e20f[_0x1629('0xc1')]=_0x4f8380;_0x43e20f['activeContact']=_0x2220be;_0x43e20f['lookAgent']=_0x5dd2bd;if(_['isEmpty'](_0x2c8fd6)){_0x9b2e9a['execCall'](_0x43e20f,_0xcea1d0,_0x2b7f92,_0x5dd2bd)[_0x1629('0x80')](function(_0x53c116){logger[_0x1629('0x67')]('[Preview][execCall][success]',_0x1629('0xe7')+_0x43e20f['queue']+_0x1629('0xe8')+_0x43e20f['idContact'],JSON[_0x1629('0x6c')](_0x53c116));ami[_0x1629('0x27')]('custom:agentcalled',ut[_0x1629('0xb2')](_0x43e20f,_0x1629('0xe9')));_0x2f29ec(ut[_0x1629('0x59')](_0x1629('0xea')));})[_0x1629('0x75')](function(_0x122f00){ut[_0x1629('0x58')](_0x1629('0xeb'),_0x122f00);_0x4ef862(ut[_0x1629('0x59')](_0x1629('0xec'),_0x4f8380,_0x2220be));});}else{_0xcea1d0[_0x1629('0x38')]+=0x1;ut[_0x1629('0xed')](_0x43e20f);rpcDb[_0x1629('0xee')](_0x43e20f,'[Blacklist][error]');delete _0x9b2e9a[_0x1629('0x15')][_0x53dfca];_0x4ef862(ut[_0x1629('0x59')](_0x1629('0xef'),_0x4f8380,_0x2220be));}});};Preview[_0x1629('0xf')]['isTrunkReachable']=function(_0x4ae7e6){return!_[_0x1629('0x66')](_0x4ae7e6)&&!_[_0x1629('0x66')](_0x4ae7e6[_0x1629('0x4e')])&&!_[_0x1629('0x66')](_0x4ae7e6[_0x1629('0x4f')])&&_0x4ae7e6[_0x1629('0x4f')]&&!_['isNil'](this['trunks'][util[_0x1629('0x52')](_0x1629('0xf0'),_0x4ae7e6[_0x1629('0x4e')])])&&!_['isNil'](this[_0x1629('0x14')][util[_0x1629('0x52')](_0x1629('0xf0'),_0x4ae7e6[_0x1629('0x4e')])]['status'])&&(this['trunks'][util[_0x1629('0x52')](_0x1629('0xf0'),_0x4ae7e6[_0x1629('0x4e')])][_0x1629('0x73')]===_0x1629('0xf1')||this[_0x1629('0x14')][util[_0x1629('0x52')](_0x1629('0xf0'),_0x4ae7e6[_0x1629('0x4e')])][_0x1629('0x73')]===_0x1629('0xf2'));};Preview[_0x1629('0xf')][_0x1629('0x84')]=function(_0x30f3d3,_0x29e382){var _0x1437bf=this;return new BPromise(function(_0x35ef43,_0x36e658){_0x1437bf[_0x1629('0xf3')](_0x30f3d3,_0x29e382)[_0x1629('0x80')](function(_0x2c5d5a){_0x35ef43(_[_0x1629('0x6e')](_0x2c5d5a,['message']));})[_0x1629('0x75')](function(_0x51a4d2){if(_0x51a4d2[_0x1629('0xf4')]){rpcDb[_0x1629('0xf5')](_0x30f3d3);}if(_0x51a4d2[_0x1629('0x4f')]){rpcDb['disableContact'](_0x30f3d3);}_0x36e658(_[_0x1629('0x6e')](_0x51a4d2,[_0x1629('0x59')]));});});};Preview[_0x1629('0xf')]['execRun']=function(_0x1ea995,_0x54f51f){var _0x5eef1c=this;return new BPromise(function(_0x308fca,_0x503f10){var _0x27bf85,_0x4fd39e;rpcDb['getContactPreview'](_0x1ea995)[_0x1629('0x80')](function(_0x58b81b){if(!_[_0x1629('0x66')](_0x58b81b[0x0])){_0x4fd39e=_0x58b81b[0x0][_0x1629('0xf6')]?![]:!![];_0x27bf85=_0x58b81b[0x0][_0x1629('0xf6')]?!![]:![];_0x27bf85=_0x54f51f?!![]:_0x27bf85;}var _0x41d431=_0x5eef1c[_0x1629('0xf7')](_0x58b81b);if(_0x41d431[_0x1629('0xf8')]){rpcDb[_0x1629('0xf9')](_[_0x1629('0x6e')](_0x58b81b[0x0],[_0x1629('0x71'),'Contact.phone']))[_0x1629('0x80')](function(_0x5217c5){_0x5eef1c[_0x1629('0xfa')](_0x5217c5,_0x58b81b[0x0],_0x54f51f,_0x4fd39e,_0x27bf85)[_0x1629('0x80')](function(_0x2f2602){_0x308fca(_0x2f2602);})['catch'](function(_0x2ca672){_0x503f10(_0x2ca672);});})['catch'](function(_0x39957c){ut['logger']('[Preview][checkIsBlackList]',_0x39957c);_0x503f10(ut[_0x1629('0x59')]('Call\x20unsuccessful',_0x4fd39e,_0x27bf85));});}else{_0x503f10(ut[_0x1629('0x59')](_0x41d431['message'],_0x4fd39e,_0x27bf85));}})[_0x1629('0x75')](function(_0x44efdb){ut['logger'](_0x1629('0xfb'),_0x44efdb);_0x503f10(ut[_0x1629('0x59')](_0x1629('0xfc'),![],!![]));});});};Preview[_0x1629('0xf')][_0x1629('0xf7')]=function(_0x442a76){if(_[_0x1629('0x66')](_0x442a76)||_[_0x1629('0xfd')](_0x442a76)||!_[_0x1629('0x66')](_0x442a76[0x0]['Agent'])&&_[_0x1629('0x66')](_0x442a76[0x0][_0x1629('0xfe')][_0x1629('0x4e')])){ut[_0x1629('0x58')](_0x1629('0xff'),_0x442a76);return{'isValid':![],'message':_0x1629('0x100')};}var _0x51b8d=this[_0x1629('0x12')][_0x442a76[0x0][_0x1629('0x69')]['name']];_0x51b8d['message']='ACTIVE';if(_['isNil'](_0x51b8d)){ut['logger'](_0x1629('0x101'),_0x51b8d);return{'isValid':![],'message':_0x1629('0x102')};}if(!this[_0x1629('0x97')](_0x51b8d['Trunk'])){ut['logger'](_0x1629('0x103'),_0x1629('0x104')+_0x51b8d['name']+_0x1629('0x105'));if(!this[_0x1629('0x97')](_0x51b8d[_0x1629('0x98')])){ut[_0x1629('0x58')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x51b8d[_0x1629('0x4e')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x1629('0x106')};}}if(!ut['isActive'](_0x51b8d[_0x1629('0x34')])){ut[_0x1629('0x58')](_0x1629('0x107'),_0x51b8d[_0x1629('0x4e')]+_0x1629('0x108'));return{'isValid':![],'message':_0x1629('0x104')+_0x51b8d[_0x1629('0x4e')]+_0x1629('0x108')};}return{'isValid':!![],'message':_0x1629('0x109')};};Preview['prototype']['execCall']=function(_0x28677c,_0x2e413e,_0x25d1e4,_0x1b0f6e){var _0x2e1cbb=this;return new BPromise(function(_0x501128,_0x3fadbf){var _0x333b7d=_0x28677c[_0x1629('0xaa')];var _0x1afaad=_0x2e1cbb[_0x1629('0x97')](_0x2e413e['Trunk'])?util['format'](_0x1629('0x10a'),_0x2e413e['Trunk'][_0x1629('0x4e')],_[_0x1629('0x66')](_0x2e413e['dialPrefix'])?'':_0x2e413e[_0x1629('0x36')]['trim']()||'',_0x2e413e[_0x1629('0x10b')]>0x0?_0x25d1e4['Contact']['phone'][_0x1629('0x10c')](_0x2e413e[_0x1629('0x10b')]):_0x25d1e4[_0x1629('0xe4')]['phone']):util['format'](_0x1629('0x10a'),_[_0x1629('0x66')](_0x2e413e[_0x1629('0x98')])?_0x2e413e[_0x1629('0x4d')][_0x1629('0x4e')]:_0x2e413e['TrunkBackup'][_0x1629('0x4e')],_[_0x1629('0x66')](_0x2e413e[_0x1629('0x36')])?'':_0x2e413e[_0x1629('0x36')][_0x1629('0x10d')]()||'',_0x2e413e[_0x1629('0x10b')]>0x0?_0x25d1e4[_0x1629('0xe4')][_0x1629('0xe5')][_0x1629('0x10c')](_0x2e413e[_0x1629('0x10b')]):_0x25d1e4[_0x1629('0xe4')][_0x1629('0xe5')]);var _0x2a6a30=_0x2e1cbb[_0x1629('0x97')](_0x2e413e[_0x1629('0x4d')])?ut[_0x1629('0x10e')](_0x2e413e[_0x1629('0x4d')]['callerid'],_0x2e413e[_0x1629('0x35')],_0x2e413e['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x1629('0x10f')](_0x2e413e['dialOriginateCallerIdNumber'],_0x2e413e[_0x1629('0x110')]):_0x2e413e['dialOriginateCallerIdNumber']):ut[_0x1629('0x10e')](_[_0x1629('0x66')](_0x2e413e[_0x1629('0x98')])?_0x2e413e[_0x1629('0x4d')][_0x1629('0x50')]:_0x2e413e[_0x1629('0x98')][_0x1629('0x50')],_0x2e413e[_0x1629('0x35')],_0x2e413e['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x1629('0x10f')](_0x2e413e[_0x1629('0x111')],_0x2e413e[_0x1629('0x110')]):_0x2e413e['dialOriginateCallerIdNumber']);if(_0x2a6a30){_0x28677c[_0x1629('0x112')]=ut[_0x1629('0x113')](_0x2a6a30);_0x28677c[_0x1629('0x114')]=ut['extractCalleridNumber'](_0x2a6a30);}var _0x10ae52=ut[_0x1629('0x115')](_0x2e413e,_0x25d1e4,_0x1afaad,_0x2a6a30,_0x333b7d,_0x28677c);_[_0x1629('0x116')](_0x28677c,ut['toLowerVariables'](_0x10ae52));_0x28677c[_0x1629('0x87')]=moment()['format'](_0x1629('0x88'));ami[_0x1629('0x117')](ut[_0x1629('0x118')](_0x28677c,_0x2e413e,_0x10ae52,_0x28677c['activeContact'],_0x1b0f6e))[_0x1629('0x80')](function(_0x1a1b9c){_0x2e413e[_0x1629('0x47')]+=0x1;logger['info'](_0x1629('0x119'),_0x333b7d,_0x1629('0xab'),_0x2e413e[_0x1629('0x4e')],_0x1629('0x6b'),_0x2e413e[_0x1629('0x47')]);_0x501128(_0x1a1b9c);})[_0x1629('0x75')](function(_0x392336){ut['logAgent'](_0x28677c,0xe,_0x1629('0x11a'));rpcDb[_0x1629('0xdc')](_0x28677c,'[originateFailure][logOriginateFailure]');_0x3fadbf(_0x392336);});});};Preview[_0x1629('0xf')][_0x1629('0x20')]=function(_0x1a8266){if(this[_0x1629('0x15')][_0x1a8266[_0x1629('0xa5')]]){this[_0x1629('0x15')][_0x1a8266[_0x1629('0xa5')]][_0x1629('0x74')]=_0x1a8266['channel'];}};Preview[_0x1629('0xf')][_0x1629('0x11b')]=function(_0x43d7e4){var _0x25eacb=this;var _0x3550f1=this['actions'][_0x43d7e4['actionid']];if(_0x3550f1){if(_0x3550f1[_0x1629('0x11c')]&&this[_0x1629('0x16')][_0x3550f1[_0x1629('0x11c')]]){ut[_0x1629('0x11d')](_0x3550f1,this[_0x1629('0x16')][_0x3550f1['lookAgent']][_0x1629('0x4e')],this[_0x1629('0x16')][_0x3550f1[_0x1629('0x11c')]]['id']);}var _0xd87ce4=_[_0x1629('0x11e')](_0x3550f1);_0xd87ce4['responsetime']=moment()['format'](_0x1629('0x88'));var _0x517eea=_0x25eacb[_0x1629('0x12')][_0x3550f1['queue']];if(ut[_0x1629('0x11f')](_0x43d7e4[_0x1629('0x120')])){if(_0x3550f1[_0x1629('0xc1')]){rpcDb[_0x1629('0xf5')](_0x3550f1['idContact']);}if(_0x3550f1[_0x1629('0xc2')]){rpcDb[_0x1629('0x121')](_0x3550f1[_0x1629('0xcf')]);}ami[_0x1629('0x27')](_0x1629('0x122'),ut['buildObj'](_0x3550f1,'rejected'));this['callProgressDetectingAgent'](_0xd87ce4,_0x517eea,_0x43d7e4);}else{_0x3550f1['starttime']=moment()[_0x1629('0x52')](_0x1629('0x88'));ut['logAgent'](_0xd87ce4,0x4,_0x1629('0xb4'));rpcDb[_0x1629('0xdc')](_0xd87ce4,_0x1629('0x123'));}}};Preview['prototype'][_0x1629('0x1b')]=function(_0x38e159){var _0xb08abf=this;var _0xa5105e=this[_0x1629('0x15')][_0x38e159[_0x1629('0xa5')]];var _0x32304f;if(_0xa5105e){_0x32304f=this[_0x1629('0x12')][_0xa5105e[_0x1629('0x6a')]];logger['info'](_0x1629('0x124'),_0x38e159[_0x1629('0xa5')],_0x1629('0xab'),_0x32304f[_0x1629('0x4e')],_0x1629('0x6d'),_0x32304f[_0x1629('0x2e')]);}if(this[_0x1629('0x15')][_0x38e159['linkedid']]&&_0x38e159[_0x1629('0xa5')]!==_0x38e159['uniqueid']){if(_0x38e159[_0x1629('0x125')]==='16'&&this[_0x1629('0x15')][_0x38e159[_0x1629('0xa5')]][_0x1629('0x78')]){this['callProgressDetectingCustomer'](_0x38e159,_0x38e159['linkedid'],_0x38e159[_0x1629('0x125')]);}else if(this['actions'][_0x38e159[_0x1629('0xa5')]][_0x1629('0x78')]){logger[_0x1629('0x67')](_0x1629('0x126'),_0x38e159[_0x1629('0xa5')],_0x38e159[_0x1629('0x125')],_0x1629('0xab'),_0x32304f[_0x1629('0x4e')],'pTalking:\x20',_0x32304f[_0x1629('0x2e')]);this['callProgressDetectingCustomer'](_0x38e159,_0x38e159[_0x1629('0xa5')],_0x38e159[_0x1629('0x125')]);}}else if(_0xa5105e&&_['isNil'](_0xa5105e[_0x1629('0x127')])&&_0x32304f[_0x1629('0x128')]&&_0x38e159[_0x1629('0xa5')]===_0x38e159[_0x1629('0xaa')]&&_[_0x1629('0x66')](_0x38e159[_0x1629('0xe2')])&&_0x38e159[_0x1629('0x125')]==='16'&&_0x38e159[_0x1629('0x129')]==='6'&&_['isUndefined'](_0xa5105e[_0x1629('0x12a')])){if(_0xa5105e[_0x1629('0xc1')]){rpcDb['unlockContact'](_0xa5105e['idContact']);}if(_0xa5105e[_0x1629('0xc2')]){rpcDb['disableContact'](_0xa5105e[_0x1629('0xcf')]);}_0x38e159[_0x1629('0xe2')]='22';this[_0x1629('0x12b')](_0xa5105e,_0x32304f,_0x38e159);}else if(_0xa5105e&&_0xa5105e[_0x1629('0x12a')]){if(_0x38e159[_0x1629('0x125')]==='16'&&this['actions'][_0x38e159[_0x1629('0xa5')]][_0x1629('0x78')]){logger[_0x1629('0x67')](_0x1629('0x12c'),_0x38e159[_0x1629('0xa5')],_0x38e159[_0x1629('0x125')],_0x1629('0xab'),_0x32304f[_0x1629('0x4e')],'pTalking:\x20',_0x32304f[_0x1629('0x2e')]);this[_0x1629('0x9b')](_0x38e159,_0x38e159['linkedid'],_0x38e159['cause']);}else if(this['actions'][_0x38e159[_0x1629('0xa5')]][_0x1629('0x78')]){logger[_0x1629('0x67')](_0x1629('0x126'),_0x38e159[_0x1629('0xa5')],_0x38e159[_0x1629('0x125')],_0x1629('0xab'),_0x32304f[_0x1629('0x4e')],_0x1629('0x6d'),_0x32304f['pTalking']);this[_0x1629('0x9b')](_0x38e159,_0x38e159[_0x1629('0xa5')],_0x38e159['cause']);}}};Preview[_0x1629('0xf')][_0x1629('0x1e')]=function(_0x118480){if(this['actions'][_0x118480[_0x1629('0xd8')]]&&_0x118480[_0x1629('0xd8')]!==_0x118480[_0x1629('0x12d')]){this[_0x1629('0x9b')](_0x118480,_0x118480[_0x1629('0xd8')],_0x118480['dialstatus']);}};Preview[_0x1629('0xf')]['syncHangupRequest']=function(_0x3fb78e){if(this['actions'][_0x3fb78e['linkedid']]&&_0x3fb78e[_0x1629('0xa5')]!==_0x3fb78e[_0x1629('0xaa')]&&!this['actions'][_0x3fb78e[_0x1629('0xa5')]]['dialAnswer']){if(_0x3fb78e[_0x1629('0x125')]==='1'){this[_0x1629('0x9b')](_0x3fb78e,_0x3fb78e[_0x1629('0xa5')],_0x3fb78e['cause']);}}};Preview[_0x1629('0xf')]['addVariable']=function(_0xe03704,_0x30f68c,_0x436a35){if(this[_0x1629('0x15')][_0xe03704]){if(_[_0x1629('0x66')](this[_0x1629('0x15')][_0xe03704][_0x1629('0x12e')])){this[_0x1629('0x15')][_0xe03704]['variables']={};}this['actions'][_0xe03704]['variables'][_0x30f68c]=_0x436a35;}};Preview[_0x1629('0xf')][_0x1629('0x22')]=function(_0x1637f1){try{if(!_[_0x1629('0x66')](_0x1637f1)){if(ut[_0x1629('0x12f')](_[_0x1629('0x130')](_0x1637f1[_0x1629('0x131')])[0x0])){this['addVariable'](_0x1637f1[_0x1629('0xaa')],_[_0x1629('0x130')](_0x1637f1[_0x1629('0x131')])[0x0],_0x1637f1[_0x1629('0x132')]);}}}catch(_0xc1db67){logger[_0x1629('0x133')](_0x1629('0x134'),util[_0x1629('0x135')](_0xc1db67,{'showHidden':![],'depth':null}));}};Preview[_0x1629('0xf')][_0x1629('0x24')]=function(_0x3c6ce8){if(_0x3c6ce8){if(this[_0x1629('0x15')][_0x3c6ce8[_0x1629('0x136')]]){this[_0x1629('0x15')][_0x3c6ce8['transfertargetlinkedid']][_0x1629('0x12a')]=!![];}}};Preview[_0x1629('0xf')][_0x1629('0x137')]=function(_0x102155){if(_0x102155){if(this[_0x1629('0x15')][_0x102155[_0x1629('0x138')]]){this[_0x1629('0x15')][_0x102155[_0x1629('0x138')]][_0x1629('0x12a')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xb3ef=['setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','custom:agentcomplete','complete','decrementTalkink','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','rescheduleContact','scheduledAt','dialNoAnswerRetryFrequency','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','outboundRejectCallsDay','[syncHangupRequest][logAgentReject]','unlockContact','disableContact','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','uniqueid','Contact','phone','Contact\x20is\x20undefined','Queue','isEmpty','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','run','execRun','unlock','getContactPreview','recallme','checkIsBlackList','Contact.phone','checkInBlack','[Preview][getContactPreview]','Call\x20unsuccessful','validateContact','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','syncOriginateResponse','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','md5','ioredis','../../../config/logger','actionPreview','../ami','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','agents','originateresponse','bind','hangup','syncHangup','syncHangupRequest','syncDialEnd','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','startPredictive','Trunk','active','callerid','Interval','name','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','campaignsPreview','clockClearZombieChannels','hasOwnProperty','preview','booked','outbound','clearZombieChannel','isNil','info','actions','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','recallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','logger2','[RecallMe]','starttime','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','catch','[getContactRecallMe]'];(function(_0x8806a6,_0x686e06){var _0x49cdd3=function(_0x1b0358){while(--_0x1b0358){_0x8806a6['push'](_0x8806a6['shift']());}};_0x49cdd3(++_0x686e06);}(_0xb3ef,0xb3));var _0xfb3e=function(_0x3416e9,_0x53973b){_0x3416e9=_0x3416e9-0x0;var _0x161860=_0xb3ef[_0x3416e9];return _0x161860;};'use strict';var util=require('util');var _=require(_0xfb3e('0x0'));var BPromise=require(_0xfb3e('0x1'));var uuid=require(_0xfb3e('0x2'));var moment=require('moment');var md5=require(_0xfb3e('0x3'));var Redis=require(_0xfb3e('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xfb3e('0x5'))(_0xfb3e('0x6'));var ami=require(_0xfb3e('0x7'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xfb3e('0x8'));config['redis']=_[_0xfb3e('0x9')](config[_0xfb3e('0xa')],{'host':_0xfb3e('0xb'),'port':0x18eb});var io=require(_0xfb3e('0xc'))(new Redis(config[_0xfb3e('0xa')]));var Sequence=function(){};Sequence[_0xfb3e('0xd')][_0xfb3e('0xe')]=function(_0x30ce52){this[_0xfb3e('0xf')]=this[_0xfb3e('0xf')]?this[_0xfb3e('0xf')][_0xfb3e('0x10')](_0x30ce52):_0x30ce52();};function Preview(_0x5e98d8){this[_0xfb3e('0x11')]=new Sequence();this['campaignsPreview']=_0x5e98d8[_0xfb3e('0x12')];this[_0xfb3e('0x13')]=_0x5e98d8[_0xfb3e('0x13')];this['actions']={};this[_0xfb3e('0x14')]=_0x5e98d8[_0xfb3e('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0xfb3e('0x15'),this['syncOriginateResponse'][_0xfb3e('0x16')](this));ami['on'](_0xfb3e('0x17'),this[_0xfb3e('0x18')]['bind'](this));ami['on']('hanguprequest',this[_0xfb3e('0x19')][_0xfb3e('0x16')](this));ami['on']('dialend',this[_0xfb3e('0x1a')][_0xfb3e('0x16')](this));ami['on']('newexten',this[_0xfb3e('0x1b')][_0xfb3e('0x16')](this));ami['on'](_0xfb3e('0x1c'),this['syncVarSet'][_0xfb3e('0x16')](this));ami['on'](_0xfb3e('0x1d'),this[_0xfb3e('0x1e')]['bind'](this));ami['on'](_0xfb3e('0x1f'),this[_0xfb3e('0x20')]['bind'](this));this[_0xfb3e('0x21')](this['campaignsPreview']);}function emit(_0x17516a,_0x468b35,_0x27007f){io['to'](_0x17516a)[_0xfb3e('0x22')](_0x468b35,_0x27007f);}function emitCampaignPreview(_0x427925){if(_0x427925[_0xfb3e('0x23')]==='outbound'){var _0x385011={'id':_0x427925['id'],'name':_0x427925['name'],'strategy':_0x427925[_0xfb3e('0x24')],'answered':_0x427925[_0xfb3e('0x25')],'available':_0x427925[_0xfb3e('0x26')],'loggedIn':_0x427925[_0xfb3e('0x27')],'pTalking':_0x427925[_0xfb3e('0x28')],'sumBillable':_0x427925[_0xfb3e('0x29')],'sumDuration':_0x427925['sumDuration'],'sumHoldTime':_0x427925[_0xfb3e('0x2a')]||0x0,'talking':_0x427925[_0xfb3e('0x2b')],'total':_0x427925['total'],'type':_0x427925[_0xfb3e('0x23')],'unmanaged':_0x427925[_0xfb3e('0x2c')],'abandoned':_0x427925[_0xfb3e('0x2d')],'waiting':_0x427925[_0xfb3e('0x2e')],'loggedInDb':_0x427925[_0xfb3e('0x2f')],'dialActive':_0x427925[_0xfb3e('0x30')],'dialMethod':_0x427925[_0xfb3e('0x31')],'dialOriginateCallerIdName':_0x427925[_0xfb3e('0x32')],'dialOriginateCallerIdNumber':_0x427925[_0xfb3e('0x33')],'dialOriginateTimeout':_0x427925[_0xfb3e('0x34')],'dialPrefix':_0x427925[_0xfb3e('0x35')],'outboundAnswerAgiCallsDay':_0x427925[_0xfb3e('0x36')],'outboundAnswerCallsDay':_0x427925[_0xfb3e('0x37')],'outboundBlacklistCallsDay':_0x427925[_0xfb3e('0x38')],'outboundBusyCallsDay':_0x427925['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x427925[_0xfb3e('0x39')],'outboundDropCallsDayACS':_0x427925[_0xfb3e('0x3a')],'outboundDropCallsDayCallersExit':_0x427925[_0xfb3e('0x3b')],'outboundDropCallsDayTimeout':_0x427925[_0xfb3e('0x3c')],'outboundNoAnswerCallsDay':_0x427925[_0xfb3e('0x3d')],'outboundNoSuchCallsDay':_0x427925[_0xfb3e('0x3e')],'outboundOriginateFailureCallsDay':_0x427925[_0xfb3e('0x3f')],'outboundReCallsDay':_0x427925[_0xfb3e('0x40')],'outboundRejectCallsDay':_0x427925['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x427925[_0xfb3e('0x41')],'predictiveIntervalAnsweredCalls':_0x427925['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x427925[_0xfb3e('0x42')],'predictiveIntervalAvgTalktime':_0x427925[_0xfb3e('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x427925[_0xfb3e('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x427925['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x427925['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x427925[_0xfb3e('0x45')],'predictiveIntervalHitRate':_0x427925[_0xfb3e('0x46')],'predictiveIntervalMultiplicativeFactor':_0x427925['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x427925['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x427925[_0xfb3e('0x47')],'predictiveIntervalTotalCalls':_0x427925[_0xfb3e('0x48')],'message':_0x427925['message'],'originated':_0x427925[_0xfb3e('0x49')],'erlangCalls':_0x427925[_0xfb3e('0x4a')],'erlangCallToSecond':_0x427925['erlangCallToSecond'],'erlangAbandonmentRate':_0x427925[_0xfb3e('0x4b')],'erlangBusyFactor':_0x427925['erlangBusyFactor'],'startPredictive':_0x427925[_0xfb3e('0x4c')],'startProgressive':_0x427925['startProgressive']};if(_0x427925['Trunk']){_0x385011['Trunk']={'id':_0x427925[_0xfb3e('0x4d')]['id'],'name':_0x427925['Trunk']['name'],'active':_0x427925[_0xfb3e('0x4d')][_0xfb3e('0x4e')],'callerid':_0x427925[_0xfb3e('0x4d')][_0xfb3e('0x4f')]};}if(_0x427925[_0xfb3e('0x50')]){_0x385011[_0xfb3e('0x50')]={'id':_0x427925[_0xfb3e('0x50')]['id'],'name':_0x427925[_0xfb3e('0x50')][_0xfb3e('0x51')]};}var _0x3d6e72=md5(JSON[_0xfb3e('0x52')](_0x385011));if(_0x427925['md5']!==_0x3d6e72){_0x427925[_0xfb3e('0x3')]=_0x3d6e72;emit(util[_0xfb3e('0x53')](_0xfb3e('0x54'),_0x385011[_0xfb3e('0x51')]),'voice_queue:save',_0x385011);}}}function emitVoiceQueueChannelRemove(_0x503bec){emit(util[_0xfb3e('0x53')]('voice:queue:%s',_0x503bec[_0xfb3e('0x51')]),_0xfb3e('0x55'),_0x503bec);}function notSendMessagesQueue(_0x1f1624){if(_0x1f1624[_0xfb3e('0x56')]){if(_0x1f1624['originated']===0x0&&_0x1f1624[_0xfb3e('0x28')]===0x0){_0x1f1624[_0xfb3e('0x56')]=![];_0x1f1624['available']=0x0;_0x1f1624[_0xfb3e('0x57')]=0x0;_0x1f1624[_0xfb3e('0x58')]='NOT_ACTIVE';ut[_0xfb3e('0x59')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1f1624[_0xfb3e('0x51')]+_0xfb3e('0x5a'));}else{_0x1f1624['message']=_0xfb3e('0x5b');ut[_0xfb3e('0x59')](_0xfb3e('0x5c'),_0x1f1624[_0xfb3e('0x51')]+_0xfb3e('0x5d'));}emitCampaignPreview(_0x1f1624);}}Preview[_0xfb3e('0xd')][_0xfb3e('0x21')]=function(){var _0x4a08b6=this;setInterval(function(){_0x4a08b6[_0xfb3e('0x5e')]();},0x7cf);};Preview['prototype'][_0xfb3e('0x5e')]=function(){var _0x101f66=this[_0xfb3e('0x5f')];this[_0xfb3e('0x60')]+=0x1;for(var _0x42787c in _0x101f66){if(_0x101f66[_0xfb3e('0x61')](_0x42787c)&&(_0x101f66[_0x42787c][_0xfb3e('0x31')]===_0xfb3e('0x62')||_0x101f66[_0x42787c][_0xfb3e('0x31')]===_0xfb3e('0x63'))&&_0x101f66[_0x42787c][_0xfb3e('0x23')]===_0xfb3e('0x64')){if(this[_0xfb3e('0x60')]>0x7){this[_0xfb3e('0x60')]=0x0;this['clearZombieChannels']();}}if(_0x101f66[_0xfb3e('0x61')](_0x42787c)&&_0x101f66[_0x42787c]['dialMethod']===_0xfb3e('0x62')&&_0x101f66[_0x42787c]['type']==='outbound'){if(_0x101f66[_0x42787c][_0xfb3e('0x30')]){this['setMessage'](_0x101f66[_0x42787c]);this['recallMe'](_0x101f66[_0x42787c]);}else{notSendMessagesQueue(_0x101f66[_0x42787c]);}}}};Preview[_0xfb3e('0xd')][_0xfb3e('0x65')]=function(_0x3fc70b){var _0x3a2555=this;this['sequence'][_0xfb3e('0xe')](function(){if(!_[_0xfb3e('0x66')](_0x3a2555['actions'][_0x3fc70b])){loggerAction[_0xfb3e('0x67')]('[clearZombieChannels][talking]',_0x3fc70b,'Queue',_0x3a2555[_0xfb3e('0x68')][_0x3fc70b][_0xfb3e('0x69')],_0xfb3e('0x6a'),JSON[_0xfb3e('0x52')](_0x3a2555[_0xfb3e('0x5f')][_0x3a2555[_0xfb3e('0x68')][_0x3fc70b]['queue']][_0xfb3e('0x49')]),_0xfb3e('0x6b'),JSON['stringify'](_0x3a2555[_0xfb3e('0x5f')][_0x3a2555[_0xfb3e('0x68')][_0x3fc70b][_0xfb3e('0x69')]][_0xfb3e('0x28')]),JSON['stringify'](_0x3a2555[_0xfb3e('0x68')][_0x3fc70b][_0xfb3e('0x6c')]),JSON[_0xfb3e('0x52')](_[_0xfb3e('0x6d')](_0x3a2555[_0xfb3e('0x68')][_0x3fc70b],[_0xfb3e('0x6e'),'UserId',_0xfb3e('0x6f'),_0xfb3e('0x70')])));return ami[_0xfb3e('0x71')]({'action':'status','channel':_0x3a2555[_0xfb3e('0x68')][_0x3fc70b]['channel']})['catch'](function(_0x12ee08){if(_0x12ee08[_0xfb3e('0x58')]===_0xfb3e('0x72')){setTimeout(function(){if(_0x3a2555[_0xfb3e('0x68')][_0x3fc70b]){ut['updateOriginated'](_0x3a2555[_0xfb3e('0x5f')][_0x3a2555['actions'][_0x3fc70b][_0xfb3e('0x69')]],_0xfb3e('0x73'));if(_0x3a2555[_0xfb3e('0x68')][_0x3fc70b]['dialAnswer']===!![]){ut['decrementTalkink'](_0x3a2555[_0xfb3e('0x5f')][_0x3a2555[_0xfb3e('0x68')][_0x3fc70b][_0xfb3e('0x69')]],_0xfb3e('0x73'));ut[_0xfb3e('0x74')](_0xfb3e('0x75')+_0x3fc70b,_0x3a2555[_0xfb3e('0x68')][_0x3fc70b][_0xfb3e('0x69')]);}ut[_0xfb3e('0x74')](_0xfb3e('0x76')+_0x3fc70b,_0x3a2555[_0xfb3e('0x68')][_0x3fc70b][_0xfb3e('0x69')]);delete _0x3a2555[_0xfb3e('0x68')][_0x3fc70b];}},0x2328);}});}});};Preview[_0xfb3e('0xd')][_0xfb3e('0x77')]=function(){var _0xc83777=this;loggerAction[_0xfb3e('0x67')](_0xfb3e('0x78'),_[_0xfb3e('0x79')](this[_0xfb3e('0x68')]));for(var _0x356f15 in this[_0xfb3e('0x68')]){if(_0xc83777[_0xfb3e('0x68')]['hasOwnProperty'](_0x356f15)){_0xc83777[_0xfb3e('0x65')](_0x356f15);}}};Preview['prototype'][_0xfb3e('0x7a')]=function(_0xe621a0){var _0x577753=this;rpcDb['getContactRecallMe'](_0xe621a0['id'],ut[_0xfb3e('0x7b')](this[_0xfb3e('0x14')]))[_0xfb3e('0x7c')](function(_0x180718){if(!_[_0xfb3e('0x66')](_0x180718)){for(var _0x4aea57=0x0;_0x4aea57<_0x180718[_0xfb3e('0x7d')];_0x4aea57+=0x1){if(ut[_0xfb3e('0x7e')](_0x180718[_0x4aea57][_0xfb3e('0x7f')])<_0xe621a0[_0xfb3e('0x80')]*0x3c){_0x577753['run'](_0x180718[_0x4aea57]['id'])[_0xfb3e('0x7c')](ut[_0xfb3e('0x81')]('[RecallMe]'))['catch'](ut[_0xfb3e('0x81')](_0xfb3e('0x82')));}else{var _0x59ec67=new Action(_0x180718[_0x4aea57],_0xe621a0);_0x59ec67[_0xfb3e('0x83')]=moment()[_0xfb3e('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0xe621a0['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x59ec67,0x17,_0xfb3e('0x84'));if(_0xe621a0[_0xfb3e('0x85')]){rpcDb['rescheduleContactInQueue'](ut[_0xfb3e('0x86')](_0x180718[_0x4aea57]));rpcDb['createCustomerHistory'](_0x59ec67,_0xfb3e('0x87'));}else{ut[_0xfb3e('0x88')](_0x59ec67,0x16,_0xfb3e('0x89'));rpcDb[_0xfb3e('0x8a')](_0x59ec67,_0xfb3e('0x8b'));rpcDb['createCustomerFinal'](_0x59ec67,_0xfb3e('0x8b'));}}}}})[_0xfb3e('0x8c')](ut[_0xfb3e('0x81')](_0xfb3e('0x8d')));};Preview['prototype'][_0xfb3e('0x8e')]=function(_0x12a555){_0x12a555[_0xfb3e('0x56')]=!![];if(ut[_0xfb3e('0x8f')](_0x12a555[_0xfb3e('0x27')])){_0x12a555['message']=_0xfb3e('0x90');}else if(!ut[_0xfb3e('0x91')](_0x12a555[_0xfb3e('0x30')])){_0x12a555['message']=_0xfb3e('0x92');}else if(!this['isTrunkReachable'](_0x12a555[_0xfb3e('0x4d')])){if(!this[_0xfb3e('0x93')](_0x12a555[_0xfb3e('0x94')])){_0x12a555[_0xfb3e('0x58')]=_0xfb3e('0x95');}else{_0x12a555['message']=_0xfb3e('0x96');}}else{_0x12a555[_0xfb3e('0x58')]='ACTIVE';}emitCampaignPreview(_0x12a555);};Preview[_0xfb3e('0xd')]['callProgressDetectingCustomer']=function(_0x5c519d,_0x56f978,_0xad9f40){var _0x420001=this;var _0x3e55a1=this[_0xfb3e('0x68')][_0x56f978];var _0x579525=this['campaignsPreview'][_0x3e55a1['queue']];var _0x26fed2;if(_0x579525){switch(_0xad9f40){case'1':_0x579525[_0xfb3e('0x3e')]+=0x1;_0x3e55a1[_0xfb3e('0x97')]=ut['totalGlobal'](_0x3e55a1);ut['logCustomer'](_0x3e55a1,0x0,_0xfb3e('0x98'));rpcDb['createCustomerHistory'](_0x3e55a1,_0xfb3e('0x99'));if(ut[_0xfb3e('0x9a')](_0x3e55a1)>=_0x579525[_0xfb3e('0x9b')]){_0x26fed2=ut['cloneAction'](_0x3e55a1,0xf,_0xfb3e('0x9c'));rpcDb[_0xfb3e('0x9d')](_0x26fed2,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['createCustomerFinal'](_0x3e55a1,_0xfb3e('0x9e'));}delete this['actions'][_0x5c519d[_0xfb3e('0x9f')]];break;case'ANSWER':var _0x4397e5=moment()[_0xfb3e('0x53')](_0xfb3e('0xa0'));_0x3e55a1[_0xfb3e('0xa1')]=_0x4397e5;_0x3e55a1[_0xfb3e('0xa2')]=_0x4397e5;_0x3e55a1[_0xfb3e('0x6c')]=!![];_0x579525['pTalking']+=0x1;logger['info'](_0xfb3e('0xa3'),_0x3e55a1['uniqueid'],_0xfb3e('0xa4'),_0x579525[_0xfb3e('0x51')],_0xfb3e('0x6b'),_0x579525[_0xfb3e('0x28')]);ami['emit'](_0xfb3e('0xa5'),ut[_0xfb3e('0xa6')](_0x3e55a1,'connect'));if(_0x579525[_0xfb3e('0xa7')]){ami[_0xfb3e('0x22')](_0xfb3e('0xa8'),ut['buildAcw'](_0x3e55a1));}break;case'16':ami[_0xfb3e('0x22')](_0xfb3e('0xa9'),ut[_0xfb3e('0xa6')](_0x3e55a1,_0xfb3e('0xaa')));emitVoiceQueueChannelRemove(ut[_0xfb3e('0xa6')](_0x3e55a1,'complete'));_0x579525[_0xfb3e('0x37')]+=0x1;_0x579525['total']+=0x1;_0x579525[_0xfb3e('0x25')]+=0x1;ut[_0xfb3e('0xab')](_0x579525,'[16]');_0x3e55a1[_0xfb3e('0x97')]=ut[_0xfb3e('0x9a')](_0x3e55a1);ut[_0xfb3e('0x88')](_0x3e55a1,0x4,'Answer');rpcDb[_0xfb3e('0x8a')](_0x3e55a1,_0xfb3e('0xac'));rpcDb[_0xfb3e('0x9d')](_0x3e55a1,_0xfb3e('0xad'));rpcDb['crateCustomerReportQueue'](_0x3e55a1);_0x579525[_0xfb3e('0xae')]+=_0x3e55a1[_0xfb3e('0xaf')];_0x579525['sumBillable']+=_0x3e55a1[_0xfb3e('0xaf')];logger[_0xfb3e('0x67')](_0xfb3e('0xb0'),_0x3e55a1['uniqueid'],'\x20Queue',_0x579525[_0xfb3e('0x51')],_0xfb3e('0x6b'),_0x579525[_0xfb3e('0x28')]);delete this[_0xfb3e('0x68')][_0x5c519d[_0xfb3e('0x9f')]];break;case _0xfb3e('0xb1'):_0x579525[_0xfb3e('0xb2')]+=0x1;_0x3e55a1[_0xfb3e('0xb3')]+=0x1;_0x3e55a1[_0xfb3e('0x97')]=ut[_0xfb3e('0x9a')](_0x3e55a1);ut[_0xfb3e('0x88')](_0x3e55a1,0x5,_0xfb3e('0xb4'));rpcDb[_0xfb3e('0x8a')](_0x3e55a1,_0xfb3e('0xb5'));if(ut[_0xfb3e('0x9a')](_0x3e55a1)>=_0x579525[_0xfb3e('0x9b')]){_0x26fed2=ut['cloneAction'](_0x3e55a1,0xf,_0xfb3e('0x9c'));rpcDb[_0xfb3e('0x9d')](_0x26fed2,_0xfb3e('0xb6'));}else{if(_0x3e55a1[_0xfb3e('0xb3')]>=_0x579525[_0xfb3e('0xb7')]){rpcDb[_0xfb3e('0x9d')](_0x3e55a1,_0xfb3e('0xb5'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3e55a1,_0xfb3e('0xb3'),_0x579525[_0xfb3e('0xb8')]),_0x3e55a1[_0xfb3e('0xb9')],_0x3e55a1[_0xfb3e('0xba')]);}}break;case _0xfb3e('0xbb'):_0x579525[_0xfb3e('0x3d')]+=0x1;_0x3e55a1[_0xfb3e('0xbc')]+=0x1;_0x3e55a1[_0xfb3e('0x97')]=ut[_0xfb3e('0x9a')](_0x3e55a1);ut[_0xfb3e('0x88')](_0x3e55a1,0x3,_0xfb3e('0xbd'));rpcDb['createCustomerHistory'](_0x3e55a1,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xfb3e('0x9a')](_0x3e55a1)>=_0x579525[_0xfb3e('0x9b')]){_0x26fed2=ut[_0xfb3e('0xbe')](_0x3e55a1,0xf,_0xfb3e('0x9c'));rpcDb[_0xfb3e('0x9d')](_0x26fed2,_0xfb3e('0xbf'));}else{if(_0x3e55a1[_0xfb3e('0xbc')]>=_0x579525['dialNoAnswerMaxRetry']){rpcDb[_0xfb3e('0x9d')](_0x3e55a1,_0xfb3e('0xc0'));}else{rpcDb[_0xfb3e('0xc1')](ut[_0xfb3e('0xc2')](_0x3e55a1,_0xfb3e('0xbc'),_0x579525[_0xfb3e('0xc3')]),_0x3e55a1[_0xfb3e('0xb9')],_0x3e55a1[_0xfb3e('0xba')]);}}break;case'CONGESTION':_0x579525[_0xfb3e('0x39')]+=0x1;_0x3e55a1[_0xfb3e('0xc4')]+=0x1;_0x3e55a1[_0xfb3e('0x97')]=ut[_0xfb3e('0x9a')](_0x3e55a1);ut[_0xfb3e('0x88')](_0x3e55a1,0x8,'Congestion');rpcDb[_0xfb3e('0x8a')](_0x3e55a1,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xfb3e('0x9a')](_0x3e55a1)>=_0x579525['dialGlobalMaxRetry']){_0x26fed2=ut[_0xfb3e('0xbe')](_0x3e55a1,0xf,_0xfb3e('0x9c'));rpcDb['createCustomerFinal'](_0x26fed2,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x3e55a1[_0xfb3e('0xc4')]>=_0x579525['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x3e55a1,_0xfb3e('0xc5'));}else{rpcDb['rescheduleContact'](ut[_0xfb3e('0xc2')](_0x3e55a1,_0xfb3e('0xc4'),_0x579525['dialBusyRetryFrequency']),_0x3e55a1[_0xfb3e('0xb9')],_0x3e55a1[_0xfb3e('0xba')]);}}break;case'CANCEL':_0x579525[_0xfb3e('0xc6')]+=0x1;_0x3e55a1['countglobal']=ut[_0xfb3e('0x9a')](_0x3e55a1);ut[_0xfb3e('0x88')](_0x3e55a1,0x14,'AgentReject');rpcDb[_0xfb3e('0x8a')](_0x3e55a1,_0xfb3e('0xc7'));if(_0x3e55a1['unlockAgent']){rpcDb[_0xfb3e('0xc8')](_0x3e55a1['idContact']);}if(_0x3e55a1[_0xfb3e('0xba')]){rpcDb[_0xfb3e('0xc9')](_0x3e55a1[_0xfb3e('0xca')]);}break;default:if(_0x3e55a1[_0xfb3e('0x6c')]){ut['decrementTalkink'](_0x579525,_0xfb3e('0xcb'));ut['loggerError'](_0xfb3e('0xcc')+_0x579525['name'],_0x5c519d);}_0x579525['outboundUnknownCallsDay']+=0x1;_0x3e55a1[_0xfb3e('0x97')]=ut[_0xfb3e('0x9a')](_0x3e55a1);ut[_0xfb3e('0x88')](_0x3e55a1,0xc,_0x5c519d[_0xfb3e('0xcd')]||_0x5c519d[_0xfb3e('0xce')]);rpcDb[_0xfb3e('0x8a')](_0x3e55a1,_0xfb3e('0xcf'));if(ut[_0xfb3e('0x9a')](_0x3e55a1)>=_0x579525[_0xfb3e('0x9b')]){_0x26fed2=ut[_0xfb3e('0xbe')](_0x3e55a1,0xf,_0xfb3e('0x9c'));rpcDb[_0xfb3e('0x9d')](_0x26fed2,_0xfb3e('0xd0'));}else{rpcDb[_0xfb3e('0x9d')](_0x3e55a1,_0xfb3e('0xd0'));}delete this[_0xfb3e('0x68')][_0x5c519d[_0xfb3e('0x9f')]];}if(!(_0x3e55a1[_0xfb3e('0x6c')]&&_0xad9f40==='16')){ut[_0xfb3e('0xd1')](_0x579525,_0xfb3e('0xd2'));logger['info'](_0xfb3e('0xd3'),_0x3e55a1['uniqueid'],_0xfb3e('0xa4'),_0x579525[_0xfb3e('0x51')],'originated:\x20',_0x579525[_0xfb3e('0x49')]);}if(_0xad9f40!==_0xfb3e('0xd4')){delete this['actions'][_0x5c519d[_0xfb3e('0x9f')]];delete this[_0xfb3e('0x68')][_0x5c519d[_0xfb3e('0xd5')]];}}};Preview[_0xfb3e('0xd')]['callProgressDetectingAgent']=function(_0x3ef0cf,_0x2bd614,_0x23434d){if(_[_0xfb3e('0xd6')](_0x2bd614)&&_0xfb3e('0xd7')!==typeof _0x2bd614){return;}if(_[_0xfb3e('0xd6')](_0x23434d)&&_0xfb3e('0xd7')!==typeof _0x23434d){return;}switch(_0x23434d[_0xfb3e('0xd8')]){case'0':ut[_0xfb3e('0xd9')](_0x3ef0cf,0x0,_0xfb3e('0x98'));rpcDb[_0xfb3e('0xda')](_0x3ef0cf,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xfb3e('0xd9')](_0x3ef0cf,0x3,_0xfb3e('0xbd'));rpcDb[_0xfb3e('0xda')](_0x3ef0cf,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x3ef0cf,0x5,_0xfb3e('0xb4'));rpcDb['createAgentHistory'](_0x3ef0cf,_0xfb3e('0xdb'));break;case'8':ut[_0xfb3e('0xd9')](_0x3ef0cf,0x8,_0xfb3e('0xdc'));rpcDb[_0xfb3e('0xda')](_0x3ef0cf,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xfb3e('0xd9')](_0x3ef0cf,0x16,_0xfb3e('0xdd'));rpcDb[_0xfb3e('0xda')](_0x3ef0cf,_0xfb3e('0xde'));break;default:ut[_0xfb3e('0xd9')](_0x3ef0cf,0xc,_0x23434d[_0xfb3e('0xd8')]);rpcDb[_0xfb3e('0xda')](_0x3ef0cf,_0xfb3e('0xdf'));}ut[_0xfb3e('0xd1')](_0x2bd614,_0xfb3e('0xe0'));logger[_0xfb3e('0x67')]('[originated][decrement][callProgressDetectingAgent]',_0x3ef0cf[_0xfb3e('0xe1')],_0xfb3e('0xa4'),_0x2bd614['name'],_0xfb3e('0x6a'),_0x2bd614['originated']);delete this[_0xfb3e('0x68')][_0x3ef0cf[_0xfb3e('0xe1')]];};Preview[_0xfb3e('0xd')]['checkInBlack']=function(_0x419d05,_0x567c0e,_0xb2ec48,_0x221d10,_0x59fd6e){var _0x3343df=this;return new BPromise(function(_0x24a38f,_0x1b405c){if(_[_0xfb3e('0x66')](_0x567c0e)||_[_0xfb3e('0x66')](_0x567c0e[_0xfb3e('0xe2')])||_[_0xfb3e('0x66')](_0x567c0e[_0xfb3e('0xe2')][_0xfb3e('0xe3')])||_[_0xfb3e('0x66')](_0x567c0e[_0xfb3e('0x6f')])){_0x1b405c(ut[_0xfb3e('0x58')](_0xfb3e('0xe4'),_0x221d10,_0x59fd6e));return;}var _0x5ed5b2=uuid['v4']();var _0x1cd359=_0x3343df[_0xfb3e('0x5f')][_0x567c0e[_0xfb3e('0xe5')][_0xfb3e('0x51')]];var _0x49e8a9=_0xb2ec48?_0x3343df[_0xfb3e('0x14')][_0xb2ec48]['id']:undefined;_0x3343df[_0xfb3e('0x68')][_0x5ed5b2]=new Action(_0x567c0e,_0x1cd359,_0x5ed5b2,_0xb2ec48,_0x49e8a9);var _0x33b778=_0x3343df[_0xfb3e('0x68')][_0x5ed5b2];_0x33b778[_0xfb3e('0xb9')]=_0x221d10;_0x33b778[_0xfb3e('0xba')]=_0x59fd6e;_0x33b778['lookAgent']=_0xb2ec48;if(_[_0xfb3e('0xe6')](_0x419d05)){_0x3343df['execCall'](_0x33b778,_0x1cd359,_0x567c0e,_0xb2ec48)[_0xfb3e('0x7c')](function(_0x58cd01){logger[_0xfb3e('0x67')](_0xfb3e('0xe7'),'Queue:\x20'+_0x33b778[_0xfb3e('0x69')]+'\x20IdHopper:\x20'+_0x33b778[_0xfb3e('0xca')],JSON[_0xfb3e('0x52')](_0x58cd01));ami['emit'](_0xfb3e('0xe8'),ut['buildObj'](_0x33b778,_0xfb3e('0xe9')));_0x24a38f(ut[_0xfb3e('0x58')](_0xfb3e('0xea')));})[_0xfb3e('0x8c')](function(_0x493975){ut[_0xfb3e('0x59')](_0xfb3e('0xeb'),_0x493975);_0x1b405c(ut['message']('Call\x20failed',_0x221d10,_0x59fd6e));});}else{_0x1cd359['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x33b778);rpcDb[_0xfb3e('0xec')](_0x33b778,_0xfb3e('0xed'));delete _0x3343df['actions'][_0x5ed5b2];_0x1b405c(ut[_0xfb3e('0x58')](_0xfb3e('0xee'),_0x221d10,_0x59fd6e));}});};Preview[_0xfb3e('0xd')][_0xfb3e('0x93')]=function(_0x140469){return!_['isNil'](_0x140469)&&!_['isNil'](_0x140469[_0xfb3e('0x51')])&&!_[_0xfb3e('0x66')](_0x140469[_0xfb3e('0x4e')])&&_0x140469[_0xfb3e('0x4e')]&&!_['isNil'](this[_0xfb3e('0x13')][util[_0xfb3e('0x53')]('SIP/%s',_0x140469[_0xfb3e('0x51')])])&&!_[_0xfb3e('0x66')](this[_0xfb3e('0x13')][util['format'](_0xfb3e('0xef'),_0x140469[_0xfb3e('0x51')])][_0xfb3e('0xf0')])&&(this['trunks'][util[_0xfb3e('0x53')](_0xfb3e('0xef'),_0x140469['name'])]['status']===_0xfb3e('0xf1')||this[_0xfb3e('0x13')][util[_0xfb3e('0x53')](_0xfb3e('0xef'),_0x140469[_0xfb3e('0x51')])][_0xfb3e('0xf0')]===_0xfb3e('0xf2'));};Preview[_0xfb3e('0xd')][_0xfb3e('0xf3')]=function(_0x59c7bb,_0x233afb){var _0x1b7a07=this;return new BPromise(function(_0x2fe67a,_0x8c4ec5){_0x1b7a07[_0xfb3e('0xf4')](_0x59c7bb,_0x233afb)['then'](function(_0x271a6c){_0x2fe67a(_[_0xfb3e('0x6d')](_0x271a6c,['message']));})[_0xfb3e('0x8c')](function(_0x14d957){if(_0x14d957[_0xfb3e('0xf5')]){rpcDb[_0xfb3e('0xc8')](_0x59c7bb);}if(_0x14d957[_0xfb3e('0x4e')]){rpcDb[_0xfb3e('0xc9')](_0x59c7bb);}_0x8c4ec5(_['pick'](_0x14d957,[_0xfb3e('0x58')]));});});};Preview['prototype'][_0xfb3e('0xf4')]=function(_0x252775,_0x1a670f){var _0x74d45=this;return new BPromise(function(_0x1835f1,_0x26e14f){var _0x215ee,_0x2976f5;rpcDb[_0xfb3e('0xf6')](_0x252775)['then'](function(_0x36911d){if(!_['isNil'](_0x36911d[0x0])){_0x2976f5=_0x36911d[0x0][_0xfb3e('0xf7')]?![]:!![];_0x215ee=_0x36911d[0x0][_0xfb3e('0xf7')]?!![]:![];_0x215ee=_0x1a670f?!![]:_0x215ee;}var _0x3a2806=_0x74d45['validateContact'](_0x36911d);if(_0x3a2806['isValid']){rpcDb[_0xfb3e('0xf8')](_[_0xfb3e('0x6d')](_0x36911d[0x0],[_0xfb3e('0x6f'),_0xfb3e('0xf9')]))[_0xfb3e('0x7c')](function(_0x3428ab){_0x74d45[_0xfb3e('0xfa')](_0x3428ab,_0x36911d[0x0],_0x1a670f,_0x2976f5,_0x215ee)[_0xfb3e('0x7c')](function(_0x23e716){_0x1835f1(_0x23e716);})[_0xfb3e('0x8c')](function(_0x56b394){_0x26e14f(_0x56b394);});})['catch'](function(_0x31a1f1){ut[_0xfb3e('0x59')]('[Preview][checkIsBlackList]',_0x31a1f1);_0x26e14f(ut[_0xfb3e('0x58')]('Call\x20unsuccessful',_0x2976f5,_0x215ee));});}else{_0x26e14f(ut[_0xfb3e('0x58')](_0x3a2806[_0xfb3e('0x58')],_0x2976f5,_0x215ee));}})[_0xfb3e('0x8c')](function(_0x4afcf1){ut['logger'](_0xfb3e('0xfb'),_0x4afcf1);_0x26e14f(ut[_0xfb3e('0x58')](_0xfb3e('0xfc'),![],!![]));});});};Preview[_0xfb3e('0xd')][_0xfb3e('0xfd')]=function(_0x30cde2){if(_[_0xfb3e('0x66')](_0x30cde2)||_[_0xfb3e('0xe6')](_0x30cde2)||!_[_0xfb3e('0x66')](_0x30cde2[0x0][_0xfb3e('0xfe')])&&_[_0xfb3e('0x66')](_0x30cde2[0x0][_0xfb3e('0xfe')]['name'])){ut[_0xfb3e('0x59')](_0xfb3e('0xff'),_0x30cde2);return{'isValid':![],'message':_0xfb3e('0x100')};}var _0xfde4f6=this['campaignsPreview'][_0x30cde2[0x0][_0xfb3e('0xe5')][_0xfb3e('0x51')]];_0xfde4f6['message']=_0xfb3e('0x96');if(_[_0xfb3e('0x66')](_0xfde4f6)){ut['logger'](_0xfb3e('0x101'),_0xfde4f6);return{'isValid':![],'message':_0xfb3e('0x102')};}if(!this['isTrunkReachable'](_0xfde4f6[_0xfb3e('0x4d')])){ut[_0xfb3e('0x59')](_0xfb3e('0x103'),_0xfb3e('0x104')+_0xfde4f6['name']+_0xfb3e('0x105'));if(!this[_0xfb3e('0x93')](_0xfde4f6[_0xfb3e('0x94')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0xfde4f6['name']+_0xfb3e('0x106'));return{'isValid':![],'message':_0xfb3e('0x107')};}}if(!ut[_0xfb3e('0x91')](_0xfde4f6[_0xfb3e('0x30')])){ut[_0xfb3e('0x59')](_0xfb3e('0x108'),_0xfde4f6[_0xfb3e('0x51')]+_0xfb3e('0x109'));return{'isValid':![],'message':_0xfb3e('0x104')+_0xfde4f6[_0xfb3e('0x51')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xfb3e('0x10a')};};Preview[_0xfb3e('0xd')][_0xfb3e('0x10b')]=function(_0x2809cc,_0x3556ee,_0x422d32,_0x1aa3b0){var _0x4f6e05=this;return new BPromise(function(_0x2090a4,_0x394fdf){var _0x3747ac=_0x2809cc['uniqueid'];var _0x5f5155=_0x4f6e05[_0xfb3e('0x93')](_0x3556ee[_0xfb3e('0x4d')])?util[_0xfb3e('0x53')]('SIP/%s/%s%s',_0x3556ee['Trunk']['name'],_['isNil'](_0x3556ee[_0xfb3e('0x35')])?'':_0x3556ee[_0xfb3e('0x35')][_0xfb3e('0x10c')]()||'',_0x3556ee[_0xfb3e('0x10d')]>0x0?_0x422d32['Contact'][_0xfb3e('0xe3')][_0xfb3e('0x10e')](_0x3556ee[_0xfb3e('0x10d')]):_0x422d32[_0xfb3e('0xe2')][_0xfb3e('0xe3')]):util['format'](_0xfb3e('0x10f'),_[_0xfb3e('0x66')](_0x3556ee['TrunkBackup'])?_0x3556ee[_0xfb3e('0x4d')][_0xfb3e('0x51')]:_0x3556ee[_0xfb3e('0x94')]['name'],_[_0xfb3e('0x66')](_0x3556ee['dialPrefix'])?'':_0x3556ee[_0xfb3e('0x35')][_0xfb3e('0x10c')]()||'',_0x3556ee[_0xfb3e('0x10d')]>0x0?_0x422d32[_0xfb3e('0xe2')]['phone'][_0xfb3e('0x10e')](_0x3556ee['dialCutDigit']):_0x422d32['Contact'][_0xfb3e('0xe3')]);var _0x597677=_0x4f6e05['isTrunkReachable'](_0x3556ee[_0xfb3e('0x4d')])?ut[_0xfb3e('0x110')](_0x3556ee[_0xfb3e('0x4d')][_0xfb3e('0x4f')],_0x3556ee[_0xfb3e('0x32')],_0x3556ee[_0xfb3e('0x111')]>0x0?ut[_0xfb3e('0x112')](_0x3556ee['dialOriginateCallerIdNumber'],_0x3556ee[_0xfb3e('0x111')]):_0x3556ee[_0xfb3e('0x33')]):ut[_0xfb3e('0x110')](_['isNil'](_0x3556ee['TrunkBackup'])?_0x3556ee[_0xfb3e('0x4d')]['callerid']:_0x3556ee[_0xfb3e('0x94')]['callerid'],_0x3556ee[_0xfb3e('0x32')],_0x3556ee['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x3556ee[_0xfb3e('0x33')],_0x3556ee[_0xfb3e('0x111')]):_0x3556ee[_0xfb3e('0x33')]);if(_0x597677){_0x2809cc[_0xfb3e('0x113')]=ut[_0xfb3e('0x114')](_0x597677);_0x2809cc[_0xfb3e('0x115')]=ut[_0xfb3e('0x116')](_0x597677);}var _0x306c0c=ut[_0xfb3e('0x117')](_0x3556ee,_0x422d32,_0x5f5155,_0x597677,_0x3747ac,_0x2809cc);_[_0xfb3e('0x118')](_0x2809cc,ut[_0xfb3e('0x119')](_0x306c0c));_0x2809cc['starttime']=moment()['format'](_0xfb3e('0xa0'));ami[_0xfb3e('0x71')](ut['variablesAction'](_0x2809cc,_0x3556ee,_0x306c0c,_0x2809cc[_0xfb3e('0xba')],_0x1aa3b0))[_0xfb3e('0x7c')](function(_0x248097){_0x3556ee['originated']+=0x1;logger[_0xfb3e('0x67')](_0xfb3e('0x11a'),_0x3747ac,_0xfb3e('0xa4'),_0x3556ee['name'],'originated:\x20',_0x3556ee['originated']);_0x2090a4(_0x248097);})[_0xfb3e('0x8c')](function(_0x5b5f7e){ut[_0xfb3e('0xd9')](_0x2809cc,0xe,_0xfb3e('0x11b'));rpcDb[_0xfb3e('0xda')](_0x2809cc,_0xfb3e('0x11c'));_0x394fdf(_0x5b5f7e);});});};Preview[_0xfb3e('0xd')][_0xfb3e('0x1b')]=function(_0xa9127d){if(this[_0xfb3e('0x68')][_0xa9127d[_0xfb3e('0x9f')]]){this[_0xfb3e('0x68')][_0xa9127d[_0xfb3e('0x9f')]][_0xfb3e('0x11d')]=_0xa9127d['channel'];}};Preview['prototype'][_0xfb3e('0x11e')]=function(_0x4888ad){var _0x315728=this;var _0x3805a8=this[_0xfb3e('0x68')][_0x4888ad[_0xfb3e('0x11f')]];if(_0x3805a8){if(_0x3805a8[_0xfb3e('0x120')]&&this['agents'][_0x3805a8['lookAgent']]){ut[_0xfb3e('0x121')](_0x3805a8,this[_0xfb3e('0x14')][_0x3805a8[_0xfb3e('0x120')]][_0xfb3e('0x51')],this[_0xfb3e('0x14')][_0x3805a8['lookAgent']]['id']);}var _0x4a487b=_[_0xfb3e('0x122')](_0x3805a8);_0x4a487b[_0xfb3e('0xa1')]=moment()[_0xfb3e('0x53')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2b9b6d=_0x315728['campaignsPreview'][_0x3805a8[_0xfb3e('0x69')]];if(ut[_0xfb3e('0x123')](_0x4888ad[_0xfb3e('0x124')])){if(_0x3805a8[_0xfb3e('0xb9')]){rpcDb[_0xfb3e('0xc8')](_0x3805a8[_0xfb3e('0xca')]);}if(_0x3805a8[_0xfb3e('0xba')]){rpcDb['disableContact'](_0x3805a8[_0xfb3e('0xca')]);}ami[_0xfb3e('0x22')](_0xfb3e('0x125'),ut[_0xfb3e('0xa6')](_0x3805a8,_0xfb3e('0x126')));this[_0xfb3e('0x127')](_0x4a487b,_0x2b9b6d,_0x4888ad);}else{_0x3805a8['starttime']=moment()[_0xfb3e('0x53')](_0xfb3e('0xa0'));ut[_0xfb3e('0xd9')](_0x4a487b,0x4,_0xfb3e('0x128'));rpcDb['createAgentHistory'](_0x4a487b,_0xfb3e('0x129'));}}};Preview[_0xfb3e('0xd')][_0xfb3e('0x18')]=function(_0xd920b7){var _0x29b21f=this;var _0x1086e3=this[_0xfb3e('0x68')][_0xd920b7[_0xfb3e('0x9f')]];var _0x509837;if(_0x1086e3){_0x509837=this[_0xfb3e('0x5f')][_0x1086e3[_0xfb3e('0x69')]];logger[_0xfb3e('0x67')](_0xfb3e('0x12a'),_0xd920b7[_0xfb3e('0x9f')],_0xfb3e('0xa4'),_0x509837['name'],_0xfb3e('0x6b'),_0x509837[_0xfb3e('0x28')]);}if(this['actions'][_0xd920b7[_0xfb3e('0x9f')]]&&_0xd920b7[_0xfb3e('0x9f')]!==_0xd920b7[_0xfb3e('0xe1')]){if(_0xd920b7[_0xfb3e('0x12b')]==='16'&&this[_0xfb3e('0x68')][_0xd920b7[_0xfb3e('0x9f')]][_0xfb3e('0x6c')]){this[_0xfb3e('0x12c')](_0xd920b7,_0xd920b7[_0xfb3e('0x9f')],_0xd920b7['cause']);}else if(this[_0xfb3e('0x68')][_0xd920b7[_0xfb3e('0x9f')]][_0xfb3e('0x6c')]){logger['info'](_0xfb3e('0x12d'),_0xd920b7[_0xfb3e('0x9f')],_0xd920b7[_0xfb3e('0x12b')],_0xfb3e('0xa4'),_0x509837[_0xfb3e('0x51')],'pTalking:\x20',_0x509837[_0xfb3e('0x28')]);this[_0xfb3e('0x12c')](_0xd920b7,_0xd920b7[_0xfb3e('0x9f')],_0xd920b7[_0xfb3e('0x12b')]);}}else if(_0x1086e3&&_[_0xfb3e('0x66')](_0x1086e3[_0xfb3e('0x12e')])&&_0x509837[_0xfb3e('0x12f')]&&_0xd920b7[_0xfb3e('0x9f')]===_0xd920b7[_0xfb3e('0xe1')]&&_[_0xfb3e('0x66')](_0xd920b7['reason'])&&_0xd920b7[_0xfb3e('0x12b')]==='16'&&_0xd920b7[_0xfb3e('0x130')]==='6'&&_[_0xfb3e('0xd6')](_0x1086e3[_0xfb3e('0x131')])){if(_0x1086e3[_0xfb3e('0xb9')]){rpcDb[_0xfb3e('0xc8')](_0x1086e3[_0xfb3e('0xca')]);}if(_0x1086e3['activeContact']){rpcDb[_0xfb3e('0xc9')](_0x1086e3['idContact']);}_0xd920b7[_0xfb3e('0xd8')]='22';this['callProgressDetectingAgent'](_0x1086e3,_0x509837,_0xd920b7);}else if(_0x1086e3&&_0x1086e3[_0xfb3e('0x131')]){if(_0xd920b7['cause']==='16'&&this[_0xfb3e('0x68')][_0xd920b7[_0xfb3e('0x9f')]][_0xfb3e('0x6c')]){logger[_0xfb3e('0x67')](_0xfb3e('0x132'),_0xd920b7['linkedid'],_0xd920b7[_0xfb3e('0x12b')],_0xfb3e('0xa4'),_0x509837['name'],_0xfb3e('0x6b'),_0x509837[_0xfb3e('0x28')]);this[_0xfb3e('0x12c')](_0xd920b7,_0xd920b7[_0xfb3e('0x9f')],_0xd920b7[_0xfb3e('0x12b')]);}else if(this[_0xfb3e('0x68')][_0xd920b7[_0xfb3e('0x9f')]][_0xfb3e('0x6c')]){logger['info'](_0xfb3e('0x12d'),_0xd920b7[_0xfb3e('0x9f')],_0xd920b7[_0xfb3e('0x12b')],_0xfb3e('0xa4'),_0x509837[_0xfb3e('0x51')],_0xfb3e('0x6b'),_0x509837['pTalking']);this[_0xfb3e('0x12c')](_0xd920b7,_0xd920b7[_0xfb3e('0x9f')],_0xd920b7['cause']);}}};Preview[_0xfb3e('0xd')]['syncDialEnd']=function(_0x210819){if(this[_0xfb3e('0x68')][_0x210819['destlinkedid']]&&_0x210819[_0xfb3e('0xd5')]!==_0x210819[_0xfb3e('0x133')]){this[_0xfb3e('0x12c')](_0x210819,_0x210819['destlinkedid'],_0x210819[_0xfb3e('0xce')]);}};Preview['prototype'][_0xfb3e('0x19')]=function(_0x4c75c1){if(this['actions'][_0x4c75c1[_0xfb3e('0x9f')]]&&_0x4c75c1['linkedid']!==_0x4c75c1[_0xfb3e('0xe1')]&&!this[_0xfb3e('0x68')][_0x4c75c1['linkedid']][_0xfb3e('0x6c')]){if(_0x4c75c1['cause']==='1'){this[_0xfb3e('0x12c')](_0x4c75c1,_0x4c75c1[_0xfb3e('0x9f')],_0x4c75c1[_0xfb3e('0x12b')]);}}};Preview[_0xfb3e('0xd')][_0xfb3e('0x134')]=function(_0x10842a,_0x5ab9e4,_0x465194){if(this[_0xfb3e('0x68')][_0x10842a]){if(_[_0xfb3e('0x66')](this[_0xfb3e('0x68')][_0x10842a][_0xfb3e('0x135')])){this[_0xfb3e('0x68')][_0x10842a][_0xfb3e('0x135')]={};}this[_0xfb3e('0x68')][_0x10842a][_0xfb3e('0x135')][_0x5ab9e4]=_0x465194;}};Preview[_0xfb3e('0xd')][_0xfb3e('0x136')]=function(_0x1e458c){try{if(!_[_0xfb3e('0x66')](_0x1e458c)){if(ut[_0xfb3e('0x137')](_[_0xfb3e('0x138')](_0x1e458c[_0xfb3e('0x139')])[0x0])){this[_0xfb3e('0x134')](_0x1e458c[_0xfb3e('0xe1')],_[_0xfb3e('0x138')](_0x1e458c['variable'])[0x0],_0x1e458c[_0xfb3e('0x13a')]);}}}catch(_0x461757){logger[_0xfb3e('0x13b')](_0xfb3e('0x13c'),util[_0xfb3e('0x13d')](_0x461757,{'showHidden':![],'depth':null}));}};Preview[_0xfb3e('0xd')]['syncAttendedTransfer']=function(_0x49643e){if(_0x49643e){if(this['actions'][_0x49643e[_0xfb3e('0x13e')]]){this[_0xfb3e('0x68')][_0x49643e[_0xfb3e('0x13e')]][_0xfb3e('0x131')]=!![];}}};Preview[_0xfb3e('0xd')][_0xfb3e('0x20')]=function(_0xcc4a78){if(_0xcc4a78){if(this[_0xfb3e('0x68')][_0xcc4a78[_0xfb3e('0x13f')]]){this[_0xfb3e('0x68')][_0xcc4a78['transfererlinkedid']][_0xfb3e('0x131')]=!![];}}};module[_0xfb3e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d402d13..f04c362 100644 --- a/server/services/ami/preview/rpcDb.js +++ b/server/services/ami/preview/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5178=['inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error'];(function(_0xf6a4e9,_0x4dd58a){var _0x5bf65c=function(_0xc5b14b){while(--_0xc5b14b){_0xf6a4e9['push'](_0xf6a4e9['shift']());}};_0x5bf65c(++_0x4dd58a);}(_0x5178,0x171));var _0x8517=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5178[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var BPromise=require(_0x8517('0x0'));var logger=require(_0x8517('0x1'))(_0x8517('0x2'));var _=require(_0x8517('0x3'));var cmHopper=require(_0x8517('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x8517('0x5'));var voiceQueueRt=require(_0x8517('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x8517('0x7'));function loggerCatch(_0x58ed7e){return function(_0x13ba05){logger[_0x8517('0x8')](_0x58ed7e,util[_0x8517('0x9')](_0x13ba05,{'showHidden':![],'depth':null}));};}function create(_0x10f918){return BPromise[_0x8517('0xa')]()['then'](cmHopperHistory[_0x8517('0xb')](_0x10f918))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x2d15fa){return BPromise[_0x8517('0xa')]()['then'](agentReportPreview[_0x8517('0xb')](_0x2d15fa))[_0x8517('0xc')](loggerCatch(_0x8517('0xd')));}function moveContact(_0x3be6b0){return BPromise[_0x8517('0xa')]()[_0x8517('0xe')](cmHopper[_0x8517('0xf')](_0x3be6b0,!![]))[_0x8517('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x8517('0x10')]=function(_0x7f429a){return BPromise[_0x8517('0xa')]()[_0x8517('0xe')](cmHopperBlack[_0x8517('0x10')](_0x7f429a))['catch'](loggerCatch(_0x8517('0x11')));};exports[_0x8517('0x12')]=function(_0x126e0b){return BPromise[_0x8517('0xa')]()[_0x8517('0xe')](cmHopper[_0x8517('0x12')](_0x126e0b))[_0x8517('0xc')](loggerCatch(_0x8517('0x13')));};exports[_0x8517('0xb')]=function(_0x2953dd,_0x22b687){create(_0x2953dd)[_0x8517('0xc')](loggerCatch(_0x22b687));moveContact(_0x2953dd)['catch'](loggerCatch(_0x22b687));};exports[_0x8517('0x14')]=function(_0x100b76,_0x38e0f3){createAgent(_0x100b76)[_0x8517('0xc')](loggerCatch(_0x38e0f3));};exports[_0x8517('0x15')]=function(_0x24ca7e,_0x1bfbc1){create(_0x24ca7e)['catch'](loggerCatch(_0x1bfbc1));};exports[_0x8517('0x16')]=function(_0x4cd0a5,_0x564571){moveContact(_0x4cd0a5)[_0x8517('0xc')](loggerCatch(_0x564571));};exports[_0x8517('0x17')]=function(_0xf35d95,_0x180d8d,_0x238d75){if(_0x180d8d){_0xf35d95[_0x8517('0x18')]=null;}if(_0x238d75){_0xf35d95['active']=![];}return BPromise['resolve']()[_0x8517('0xe')](cmHopper[_0x8517('0x17')](_0xf35d95))[_0x8517('0xc')](loggerCatch(_0x8517('0x19')));};exports[_0x8517('0x1a')]=function(_0x2e6e47){return BPromise['resolve']()[_0x8517('0xe')](cmHopper[_0x8517('0x1a')](_0x2e6e47))['catch'](loggerCatch(_0x8517('0x1b')));};exports[_0x8517('0x1c')]=function(_0x42c779){return BPromise['resolve']()[_0x8517('0xe')](cmHopper['unlockContact']({'UserId':null},_0x42c779,0x1))[_0x8517('0xc')](loggerCatch(_0x8517('0x1d')));};exports[_0x8517('0x1e')]=function(_0x2b0c19){return BPromise[_0x8517('0xa')]()[_0x8517('0xe')](cmHopper['unlockContact']({'active':![]},_0x2b0c19,0x1))[_0x8517('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0x8517('0x1f')]=function(_0x70ee9d){var _0x243fda={};_0x243fda[_0x8517('0x20')]=_0x70ee9d[_0x8517('0x20')];_0x243fda[_0x8517('0x21')]=_0x70ee9d['uniqueid'];_0x243fda[_0x8517('0x22')]=_0x70ee9d['calleridnum'];_0x243fda[_0x8517('0x23')]=_0x70ee9d[_0x8517('0x23')];_0x243fda[_0x8517('0x24')]=_0x70ee9d[_0x8517('0x24')];_0x243fda[_0x8517('0x25')]=_0x70ee9d[_0x8517('0x26')];_0x243fda[_0x8517('0x27')]=_0x70ee9d[_0x8517('0x26')];_0x243fda[_0x8517('0x28')]=0x1;_0x243fda['queuecallercompleteAt']=_0x70ee9d[_0x8517('0x29')];_0x243fda[_0x8517('0x2a')]=_0x70ee9d[_0x8517('0x2b')];_0x243fda['context']='from-sip';_0x243fda['exten']=_0x8517('0x2c');_0x243fda[_0x8517('0x2d')]=0x0;_0x243fda[_0x8517('0x2e')]=0x1;_0x243fda[_0x8517('0x2f')]=_0x70ee9d[_0x8517('0x2b')];_0x243fda[_0x8517('0x30')]='COMPLETED';return BPromise[_0x8517('0xa')]()[_0x8517('0xe')](voiceQueueReport[_0x8517('0x31')](_0x243fda))['catch'](loggerCatch(_0x8517('0x32')));};exports['getContactRecallMe']=function(_0x1253ef,_0x1e71ec){return BPromise['resolve']()['then'](cmHopper[_0x8517('0x33')](_0x1253ef,_0x1e71ec))[_0x8517('0xc')](loggerCatch(_0x8517('0x34')));};exports[_0x8517('0x35')]=function(_0x4f93bd){return BPromise['resolve']()[_0x8517('0xe')](cmHopper[_0x8517('0x17')](_0x4f93bd,!![],!![]))[_0x8517('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x5334=['[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[countReScheduled]\x20','unlockContact'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5334,0x84));var _0x4533=function(_0x179b51,_0x44c655){_0x179b51=_0x179b51-0x0;var _0x591c54=_0x5334[_0x179b51];return _0x591c54;};'use strict';var util=require(_0x4533('0x0'));var BPromise=require(_0x4533('0x1'));var logger=require(_0x4533('0x2'))(_0x4533('0x3'));var _=require(_0x4533('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x4533('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x4533('0x6'));var voiceQueueRt=require(_0x4533('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x51b4ce){return function(_0x201673){logger['error'](_0x51b4ce,util['inspect'](_0x201673,{'showHidden':![],'depth':null}));};}function create(_0x487906){return BPromise[_0x4533('0x8')]()[_0x4533('0x9')](cmHopperHistory[_0x4533('0xa')](_0x487906))[_0x4533('0xb')](loggerCatch(_0x4533('0xc')));}function createAgent(_0x21b22f){return BPromise[_0x4533('0x8')]()['then'](agentReportPreview[_0x4533('0xa')](_0x21b22f))[_0x4533('0xb')](loggerCatch(_0x4533('0xc')));}function moveContact(_0x12131a){return BPromise['resolve']()[_0x4533('0x9')](cmHopper['moveContactManagedDialer'](_0x12131a,!![]))[_0x4533('0xb')](loggerCatch(_0x4533('0xd')));}exports[_0x4533('0xe')]=function(_0x19b74e){return BPromise['resolve']()[_0x4533('0x9')](cmHopperBlack[_0x4533('0xe')](_0x19b74e))[_0x4533('0xb')](loggerCatch(_0x4533('0xf')));};exports['getContactPreview']=function(_0xe47213){return BPromise['resolve']()['then'](cmHopper[_0x4533('0x10')](_0xe47213))[_0x4533('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0x4533('0xa')]=function(_0x1e6a1a,_0x2a9877){create(_0x1e6a1a)['catch'](loggerCatch(_0x2a9877));moveContact(_0x1e6a1a)[_0x4533('0xb')](loggerCatch(_0x2a9877));};exports['createAgentHistory']=function(_0x3ddb36,_0x3d16a2){createAgent(_0x3ddb36)['catch'](loggerCatch(_0x3d16a2));};exports[_0x4533('0x11')]=function(_0x5a4e8f,_0x5c2c9c){create(_0x5a4e8f)[_0x4533('0xb')](loggerCatch(_0x5c2c9c));};exports[_0x4533('0x12')]=function(_0x49fb91,_0x53fe43){moveContact(_0x49fb91)[_0x4533('0xb')](loggerCatch(_0x53fe43));};exports[_0x4533('0x13')]=function(_0x3467ba,_0x1b08fa,_0x6766eb){if(_0x1b08fa){_0x3467ba[_0x4533('0x14')]=null;}if(_0x6766eb){_0x3467ba[_0x4533('0x15')]=![];}return BPromise['resolve']()[_0x4533('0x9')](cmHopper[_0x4533('0x13')](_0x3467ba))[_0x4533('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x138fd9){return BPromise[_0x4533('0x8')]()['then'](cmHopper['countReScheduled'](_0x138fd9))[_0x4533('0xb')](loggerCatch(_0x4533('0x16')));};exports[_0x4533('0x17')]=function(_0x4d8189){return BPromise[_0x4533('0x8')]()[_0x4533('0x9')](cmHopper[_0x4533('0x17')]({'UserId':null},_0x4d8189,0x1))[_0x4533('0xb')](loggerCatch(_0x4533('0x18')));};exports[_0x4533('0x19')]=function(_0x474c64){return BPromise[_0x4533('0x8')]()[_0x4533('0x9')](cmHopper['unlockContact']({'active':![]},_0x474c64,0x1))['catch'](loggerCatch(_0x4533('0x1a')));};exports['crateCustomerReportQueue']=function(_0x3fd76a){var _0x4e2b80={};_0x4e2b80[_0x4533('0x1b')]=_0x3fd76a[_0x4533('0x1b')];_0x4e2b80[_0x4533('0x1c')]=_0x3fd76a[_0x4533('0x1c')];_0x4e2b80[_0x4533('0x1d')]=_0x3fd76a[_0x4533('0x1d')];_0x4e2b80[_0x4533('0x1e')]=_0x3fd76a[_0x4533('0x1e')];_0x4e2b80[_0x4533('0x1f')]=_0x3fd76a[_0x4533('0x1f')];_0x4e2b80[_0x4533('0x20')]=_0x3fd76a[_0x4533('0x21')];_0x4e2b80[_0x4533('0x22')]=_0x3fd76a['answertime'];_0x4e2b80[_0x4533('0x23')]=0x1;_0x4e2b80['queuecallercompleteAt']=_0x3fd76a[_0x4533('0x24')];_0x4e2b80[_0x4533('0x25')]=_0x3fd76a[_0x4533('0x26')];_0x4e2b80[_0x4533('0x27')]=_0x4533('0x28');_0x4e2b80[_0x4533('0x29')]=_0x4533('0x2a');_0x4e2b80[_0x4533('0x2b')]=0x0;_0x4e2b80[_0x4533('0x2c')]=0x1;_0x4e2b80[_0x4533('0x2d')]=_0x3fd76a[_0x4533('0x26')];_0x4e2b80[_0x4533('0x2e')]='COMPLETED';return BPromise[_0x4533('0x8')]()[_0x4533('0x9')](voiceQueueReport[_0x4533('0x2f')](_0x4e2b80))[_0x4533('0xb')](loggerCatch(_0x4533('0x30')));};exports['getContactRecallMe']=function(_0x86c14d,_0x35aefe){return BPromise[_0x4533('0x8')]()[_0x4533('0x9')](cmHopper[_0x4533('0x31')](_0x86c14d,_0x35aefe))[_0x4533('0xb')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x4533('0x32')]=function(_0x36c289){return BPromise['resolve']()[_0x4533('0x9')](cmHopper[_0x4533('0x13')](_0x36c289,!![],!![]))[_0x4533('0xb')](loggerCatch(_0x4533('0x33')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 3bc9674..3845f0d 100644 --- a/server/services/ami/preview/util/util.js +++ b/server/services/ami/preview/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3297=['extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','logger','loggerError','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','ringtime','logLookAgent','UserId','logCustomer','endtime','answertime','RECALL','BOOKED','originate','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','interface','channelAgent','buildAcw','queue','uniqueid','agentReadyId','not_inuse','status','reachable','push','CampaignId','filterKey','idContact','type','dialAnswer','membername','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match'];(function(_0x3edfe4,_0x3301ef){var _0x44572b=function(_0x33b5a0){while(--_0x33b5a0){_0x3edfe4['push'](_0x3edfe4['shift']());}};_0x44572b(++_0x3301ef);}(_0x3297,0x19f));var _0x7329=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x3297[_0x5783f4];return _0x28e380;};'use strict';var util=require(_0x7329('0x0'));var _=require(_0x7329('0x1'));var moment=require(_0x7329('0x2'));var logger=require('../../../../config/logger')(_0x7329('0x3'));var ipAgi=process[_0x7329('0x4')][_0x7329('0x5')]||'127.0.0.1';function getSeconds(_0x341e43,_0x14664b){var _0x2b353e=moment(_0x341e43)[_0x7329('0x6')](0x0);var _0x2167b3=moment(_0x14664b)[_0x7329('0x6')](0x0);return _0x2b353e[_0x7329('0x7')](_0x2167b3,_0x7329('0x8'));}exports[_0x7329('0x9')]=function(_0x36ca4b){return function(_0x383ad4){logger[_0x7329('0xa')](_0x36ca4b,util['inspect'](_0x383ad4,{'showHidden':![],'depth':null}));};};exports[_0x7329('0xb')]=function(_0x581f1c,_0x3a4eee){logger['info'](_0x581f1c,util['inspect'](_0x3a4eee,{'showHidden':![],'depth':null}));};exports[_0x7329('0xc')]=function(_0x4ce8fe,_0x2ddbf5){logger[_0x7329('0xa')](_0x4ce8fe,util[_0x7329('0xd')](_0x2ddbf5,{'showHidden':![],'depth':null}));};exports[_0x7329('0xe')]=function(_0x36e7fc){return function(_0x3083c2){logger['info'](_0x36e7fc,util[_0x7329('0xd')](_0x3083c2,{'showHidden':![],'depth':null}));};};exports[_0x7329('0xf')]=function(_0x306a56,_0x24dbb9,_0x329311){return{'message':_0x306a56,'unlock':_0x24dbb9,'active':_0x329311};};exports[_0x7329('0x10')]=function(_0xa9d9d7,_0x2bcc36,_0x376c69){if(!_[_0x7329('0x11')](_0x376c69)&&'string'===typeof _0x376c69&&!_['isEmpty'](_0x376c69)){if(!_[_0x7329('0x11')](_0x2bcc36)&&_0x7329('0x12')===typeof _0x2bcc36&&!_[_0x7329('0x13')](_0x2bcc36)){return util['format'](_0x7329('0x14'),_0x2bcc36,_0x376c69);}return util[_0x7329('0x15')](_0x7329('0x14'),_0x376c69,_0x376c69);}if(!_[_0x7329('0x11')](_0xa9d9d7)&&_0x7329('0x12')===typeof _0xa9d9d7&&!_[_0x7329('0x13')](_0xa9d9d7)){return _0xa9d9d7;}return _0x7329('0x16');};exports[_0x7329('0x17')]=function(_0x2cffb6){if(_[_0x7329('0x18')](_0x2cffb6)){return![];}return _0x2cffb6;};exports[_0x7329('0x19')]=function(_0x4c81b7,_0x2f8378,_0x1e7ec0,_0x688309,_0x353f99,_0x4dafbf){var _0x438f21={'XMD-QUEUE':_0x2f8378[_0x7329('0x1a')]?_0x2f8378[_0x7329('0x1a')][_0x7329('0x1b')]:'','XMD-CALLERID':_0x688309,'XMD-CALLERID-PREVIEW':_0x4dafbf?util[_0x7329('0x15')](_0x7329('0x14'),_0x4dafbf[_0x7329('0x1c')],_0x4dafbf[_0x7329('0x1d')]):_0x688309,'XMD-DIALID':_0x353f99,'XMD-CONTACTID':_0x2f8378[_0x7329('0x1e')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x688309,'XMD-VOICEQUEUEID':_0x2f8378['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1e7ec0,'XMD-DIALTIMEOUT':_0x4c81b7[_0x7329('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x7329('0x15')](_0x7329('0x20'),_0x4c81b7[_0x7329('0x21')]?'g':'',_[_0x7329('0x13')](_0x4c81b7[_0x7329('0x22')])?'':_0x7329('0x23')),'XMD-DIALURL':_0x4c81b7[_0x7329('0x24')]||'','XMD-AGI':_0x4c81b7[_0x7329('0x25')]?util[_0x7329('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4c81b7[_0x7329('0x25')]):_0x7329('0x26'),'XMD-AGIAFTER':_0x4c81b7[_0x7329('0x21')]?util[_0x7329('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4c81b7['dialQueueProject2']):_0x7329('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x4dafbf?_0x4dafbf[_0x7329('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x4dafbf?_0x4dafbf[_0x7329('0x28')]:'','XMD-DESTINATION':_0x7329('0x29')};if(!_[_0x7329('0x13')](_0x4c81b7['monitor_format'])){_0x438f21[util[_0x7329('0x15')]('%s',_0x7329('0x2a'))]=_0x4c81b7[_0x7329('0x22')];_0x438f21[util[_0x7329('0x15')]('%s',_0x7329('0x2b'))]=_0x353f99;}if(_0x2f8378&&_0x2f8378[_0x7329('0x2c')]){for(var _0x3e7f42 in _0x2f8378[_0x7329('0x2c')]){if(_0x2f8378['Contact']['hasOwnProperty'](_0x3e7f42)){if(!_[_0x7329('0x18')](_0x2f8378[_0x7329('0x2c')][_0x3e7f42])&&_0x3e7f42!=='id'&&_0x3e7f42!==_0x7329('0x2d')&&_0x3e7f42!=='createdAt'&&_0x3e7f42!==_0x7329('0x2e')){_0x438f21[util[_0x7329('0x15')](_0x7329('0x2f'),_0x7329('0x30'),_[_0x7329('0x31')](_0x3e7f42))]=_0x2f8378[_0x7329('0x2c')][_0x3e7f42];}}}}return _0x438f21;};exports[_0x7329('0x32')]=function(_0xf2515c){var _0x2440fa={};for(var _0x376c64 in _0xf2515c){if(_0xf2515c[_0x7329('0x33')](_0x376c64)){_0x2440fa[util['format']('%s',_['toLower'](_0x376c64))]=_0xf2515c[_0x376c64];}}return{'variables':_0x2440fa};};exports['updateOriginated']=function(_0x561c83,_0x307529){if(!_[_0x7329('0x18')](_0x561c83)){if(_0x561c83[_0x7329('0x33')]('originated')){if(_0x561c83[_0x7329('0x34')]>0x0){_0x561c83['originated']-=0x1;}else{logger[_0x7329('0xa')](_0x7329('0x35'),_0x307529);}}}else{logger[_0x7329('0xa')](_0x7329('0x36'),_0x307529);}};exports['logBlacklist']=function(_0x19ed31){var _0x3ecb9a=moment()[_0x7329('0x15')](_0x7329('0x37'));_0x19ed31[_0x7329('0x38')]=0xd;_0x19ed31[_0x7329('0x39')]=_0x7329('0x3a');_0x19ed31[_0x7329('0x3b')]=_0x3ecb9a;_0x19ed31[_0x7329('0x3c')]=_0x3ecb9a;_0x19ed31['endtime']=_0x3ecb9a;};exports['logAgent']=function(_0x519776,_0x546df7,_0xae7974){var _0x17c66a=moment()['format'](_0x7329('0x37'));_0x519776[_0x7329('0x38')]=_0x546df7;_0x519776[_0x7329('0x39')]=_0xae7974;_0x519776[_0x7329('0x3c')]=_0x17c66a;_0x519776[_0x7329('0x3d')]=getSeconds(_0x519776[_0x7329('0x3c')],_0x519776['starttime']);};exports[_0x7329('0x3e')]=function(_0x165e50,_0x4eedb2,_0x409ee0){_0x165e50['membername']=_0x4eedb2;_0x165e50[_0x7329('0x3f')]=_0x409ee0;};exports[_0x7329('0x40')]=function(_0x5b83de,_0x46b548,_0x5ef3b2){var _0x20d502=moment()['format'](_0x7329('0x37'));_0x5b83de[_0x7329('0x38')]=_0x46b548;_0x5b83de[_0x7329('0x39')]=_0x5ef3b2;_0x5b83de[_0x7329('0x3c')]=_0x5b83de[_0x7329('0x3c')]?_0x5b83de[_0x7329('0x3c')]:_0x20d502;_0x5b83de['endtime']=_0x5b83de['endtime']?_0x5b83de[_0x7329('0x41')]:_0x20d502;_0x5b83de['ringtime']=getSeconds(_0x5b83de[_0x7329('0x3c')]||0x0,_0x5b83de[_0x7329('0x3b')]||0x0);_0x5b83de['talktime']=_0x5b83de[_0x7329('0x42')]?getSeconds(_0x5b83de[_0x7329('0x41')],_0x5b83de[_0x7329('0x42')]):0x0;};exports['isFailure']=function(_0x1f6be8){return _0x1f6be8==='Failure';};exports['variablesAction']=function(_0x48aec5,_0x37503,_0x26c690,_0x3da62f,_0x49dd7a){var _0x312dc6=_0x3da62f?_0x7329('0x43'):_0x48aec5[_0x7329('0x1c')];_0x312dc6=_0x49dd7a?_0x7329('0x44'):_0x312dc6;return{'actionid':_0x48aec5['uniqueid'],'action':_0x7329('0x45'),'channel':_0x48aec5['channelAgent'],'callerid':util[_0x7329('0x15')](_0x7329('0x14'),_0x312dc6,_0x48aec5[_0x7329('0x1d')]),'Exten':_0x7329('0x29'),'Context':'from-sip','Priority':'1','variable':_0x26c690,'timeout':(_0x37503['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x48aec5['uniqueid']};};exports[_0x7329('0x46')]=function(_0x3cdc76){return _0x3cdc76[_0x7329('0x47')]+_0x3cdc76[_0x7329('0x48')]+_0x3cdc76['countnoanswerretry'];};exports[_0x7329('0x49')]=function(_0x3f4ebe){var _0x5480c6=_[_0x7329('0x4a')](_0x3f4ebe);_0x5480c6[_0x7329('0x38')]=0xf;_0x5480c6[_0x7329('0x39')]=_0x7329('0x4b');return _0x5480c6;};exports[_0x7329('0x4c')]=function(_0x449f5e,_0x513a78,_0x290713){var _0x1259fe={};_0x1259fe[_0x513a78]=_0x449f5e[_0x513a78];_0x1259fe[_0x7329('0x4d')]=![];_0x1259fe[_0x7329('0x4e')]=moment()[_0x7329('0x4f')](_0x290713,_0x7329('0x50'))[_0x7329('0x15')](_0x7329('0x37'));_0x1259fe[_0x7329('0x1e')]=_0x449f5e[_0x7329('0x1e')];_0x1259fe[_0x7329('0x51')]=_0x449f5e[_0x7329('0x51')];_0x1259fe['VoiceQueueId']=_0x449f5e[_0x7329('0x52')]||undefined;return _0x1259fe;};exports[_0x7329('0x53')]=function(_0x4093d2,_0x390361){if(!_[_0x7329('0x18')](_0x4093d2)){if(_0x4093d2['pTalking']>0x0){_0x4093d2[_0x7329('0x54')]-=0x1;}else{logger[_0x7329('0xa')](_0x390361,_0x7329('0x55'));}}else{logger['error'](_0x390361,_0x7329('0x56'));}};exports['IsNotLoggedIn']=function(_0x15fe1f){if(_0x15fe1f<=0x0){return!![];}return![];};exports[_0x7329('0x57')]=function(_0x1dd671,_0x55e81b){_0x1dd671[_0x7329('0x58')]=_0x55e81b;_0x1dd671['name']=_0x1dd671['queue'];_0x1dd671[_0x7329('0x59')]=_0x1dd671[_0x7329('0x5a')];return _0x1dd671;};exports[_0x7329('0x5b')]=function(_0x3a901a){var _0x2be395={};_0x2be395[_0x7329('0x5c')]=_0x3a901a[_0x7329('0x5c')];_0x2be395[_0x7329('0x59')]=_0x3a901a[_0x7329('0x5a')];_0x2be395[_0x7329('0x5d')]=_0x3a901a[_0x7329('0x5d')];return _0x2be395;};exports[_0x7329('0x5e')]=function(_0x387433){var _0x5d03bb=[];for(var _0x58adb1 in _0x387433){if(_0x387433[_0x7329('0x33')](_0x58adb1)){if(!_[_0x7329('0x18')](_0x387433[_0x58adb1])&&_0x387433[_0x58adb1][_0x7329('0x38')]===_0x7329('0x5f')&&_0x387433[_0x58adb1][_0x7329('0x60')]===_0x7329('0x61')){_0x5d03bb[_0x7329('0x62')](_0x387433[_0x58adb1]['id']);}}}return _0x5d03bb;};exports['getDiff']=function(_0x2e4fb8){var _0x512189=moment()[_0x7329('0x6')](0x0);var _0x264a60=moment(_0x2e4fb8)[_0x7329('0x6')](0x0);return _0x512189[_0x7329('0x7')](_0x264a60,_0x7329('0x8'));};exports['createBody']=function(_0x5ff64){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5ff64[_0x7329('0x1e')],'ListId':_0x5ff64[_0x7329('0x51')],'VoiceQueueId':_0x5ff64[_0x7329('0x52')]||undefined,'CampaignId':_0x5ff64[_0x7329('0x63')]||undefined};};exports[_0x7329('0x64')]=function(_0x296efb){if(_0x296efb===_0x7329('0x5d')||_0x296efb===_0x7329('0x65')||_0x296efb===_0x7329('0x5c')||_0x296efb===_0x7329('0x66')||_0x296efb==='campaigntype'||_0x296efb===_0x7329('0x67')||_0x296efb===_0x7329('0x68')||_0x296efb===_0x7329('0x5a')||_0x296efb===_0x7329('0x1c')||_0x296efb==='active'||_0x296efb==='calleridnum'||_0x296efb===_0x7329('0x4e')||_0x296efb===_0x7329('0x47')||_0x296efb===_0x7329('0x48')||_0x296efb===_0x7329('0x69')||_0x296efb===_0x7329('0x6a')||_0x296efb===_0x7329('0x6b')||_0x296efb===_0x7329('0x6c')||_0x296efb===_0x7329('0x6d')||_0x296efb===_0x7329('0x6e')||_0x296efb===_0x7329('0x1e')||_0x296efb===_0x7329('0x51')||_0x296efb===_0x7329('0x3f')||_0x296efb===_0x7329('0x52')||_0x296efb===_0x7329('0x6f')||_0x296efb===_0x7329('0x70')||_0x296efb===_0x7329('0x71')||_0x296efb===_0x7329('0x72')||_0x296efb==='xmd-listid'||_0x296efb==='xmd-dialurl'||_0x296efb===_0x7329('0x73')||_0x296efb===_0x7329('0x74')||_0x296efb==='xmd-dialid'||_0x296efb===_0x7329('0x75')||_0x296efb===_0x7329('0x76')||_0x296efb===_0x7329('0x77')||_0x296efb==='xmd-callerid'||_0x296efb===_0x7329('0x78')||_0x296efb===_0x7329('0x79')||_0x296efb==='rtpaudioqos'||_0x296efb==='rtpaudioqosbridged'||_0x296efb==='rtpaudioqosjitter'||_0x296efb==='rtpaudioqosjitterbridged'||_0x296efb===_0x7329('0x7a')||_0x296efb===_0x7329('0x7b')||_0x296efb===_0x7329('0x7c')||_0x296efb===_0x7329('0x7d')||_0x296efb===_0x7329('0x7e')||_0x296efb===_0x7329('0x7f')||_0x296efb===_0x7329('0x80')||_0x296efb===_0x7329('0x81')||_0x296efb===_0x7329('0x7a')||_0x296efb===_0x7329('0x7b')||_0x296efb===_0x7329('0x7c')||_0x296efb===_0x7329('0x7d')||_0x296efb===_0x7329('0x82')||_0x296efb===_0x7329('0x83')||_0x296efb===_0x7329('0x38')||_0x296efb===_0x7329('0x39')){return![];}return!![];};exports[_0x7329('0x84')]=function(_0x187592,_0x14faf0){var _0x328b5b,_0x1b1f2c,_0x2f5aa1;if(_0x14faf0<=0x0){_0x14faf0=0x1;}_0x328b5b=new RegExp(_0x7329('0x85')+_0x14faf0+'}$');_0x1b1f2c=Math[_0x7329('0x86')](0xa,_0x14faf0-0x1);_0x2f5aa1=Math['pow'](0xa,_0x14faf0)-0x1;return util[_0x7329('0x15')]('%s',_[_0x7329('0x87')](_0x187592,_0x328b5b,_['random'](_0x1b1f2c,_0x2f5aa1)));};exports['extractCalleridName']=function(_0x32eaa3){var _0x45ac9b=_0x32eaa3[_0x7329('0x88')](/"(.*?)"/);return _0x45ac9b?_0x45ac9b[0x1]:_0x32eaa3;};exports[_0x7329('0x89')]=function(_0x25a5d1){var _0x2f4a65=_0x25a5d1['match'](/<(.*?)>/);return _0x2f4a65?_0x2f4a65[0x1]:_0x25a5d1;}; \ No newline at end of file +var _0x6208=['dialQueueProject2','originatecalleridnum','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','%s%s','XMD-','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','UserId','logCustomer','ringtime','talktime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','buildAcw','channelAgent','agentReadyId','not_inuse','reachable','push','diff','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','env','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE'];(function(_0x2234bd,_0x259d9d){var _0x2aa4bd=function(_0x418403){while(--_0x418403){_0x2234bd['push'](_0x2234bd['shift']());}};_0x2aa4bd(++_0x259d9d);}(_0x6208,0x17d));var _0x8620=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0x6208[_0x483ab9];return _0x35043b;};'use strict';var util=require(_0x8620('0x0'));var _=require('lodash');var moment=require(_0x8620('0x1'));var logger=require(_0x8620('0x2'))('preview');var ipAgi=process[_0x8620('0x3')]['XCALLY_IP_AGI']||_0x8620('0x4');function getSeconds(_0x360578,_0x196447){var _0x286b72=moment(_0x360578)[_0x8620('0x5')](0x0);var _0x373f95=moment(_0x196447)[_0x8620('0x5')](0x0);return _0x286b72['diff'](_0x373f95,_0x8620('0x6'));}exports[_0x8620('0x7')]=function(_0x92a9cb){return function(_0x4694f2){logger[_0x8620('0x8')](_0x92a9cb,util[_0x8620('0x9')](_0x4694f2,{'showHidden':![],'depth':null}));};};exports[_0x8620('0xa')]=function(_0x9a89f,_0x1e0bf7){logger['info'](_0x9a89f,util[_0x8620('0x9')](_0x1e0bf7,{'showHidden':![],'depth':null}));};exports[_0x8620('0xb')]=function(_0x50cbc6,_0x4ea300){logger[_0x8620('0x8')](_0x50cbc6,util[_0x8620('0x9')](_0x4ea300,{'showHidden':![],'depth':null}));};exports[_0x8620('0xc')]=function(_0xbc6f40){return function(_0x3d7a76){logger[_0x8620('0xd')](_0xbc6f40,util['inspect'](_0x3d7a76,{'showHidden':![],'depth':null}));};};exports[_0x8620('0xe')]=function(_0x5a1f8f,_0xdfa354,_0x2747b3){return{'message':_0x5a1f8f,'unlock':_0xdfa354,'active':_0x2747b3};};exports[_0x8620('0xf')]=function(_0x1e6721,_0x592551,_0x2c970a){if(!_[_0x8620('0x10')](_0x2c970a)&&'string'===typeof _0x2c970a&&!_['isEmpty'](_0x2c970a)){if(!_[_0x8620('0x10')](_0x592551)&&_0x8620('0x11')===typeof _0x592551&&!_['isEmpty'](_0x592551)){return util[_0x8620('0x12')]('\x22%s\x22\x20<%s>',_0x592551,_0x2c970a);}return util[_0x8620('0x12')](_0x8620('0x13'),_0x2c970a,_0x2c970a);}if(!_[_0x8620('0x10')](_0x1e6721)&&_0x8620('0x11')===typeof _0x1e6721&&!_[_0x8620('0x14')](_0x1e6721)){return _0x1e6721;}return _0x8620('0x15');};exports[_0x8620('0x16')]=function(_0x8e35ae){if(_[_0x8620('0x17')](_0x8e35ae)){return![];}return _0x8e35ae;};exports[_0x8620('0x18')]=function(_0xb73f31,_0x198c67,_0x3725f1,_0x7deddb,_0x1ff783,_0x186878){var _0x4443c1={'XMD-QUEUE':_0x198c67[_0x8620('0x19')]?_0x198c67[_0x8620('0x19')][_0x8620('0x1a')]:'','XMD-CALLERID':_0x7deddb,'XMD-CALLERID-PREVIEW':_0x186878?util['format'](_0x8620('0x13'),_0x186878[_0x8620('0x1b')],_0x186878[_0x8620('0x1c')]):_0x7deddb,'XMD-DIALID':_0x1ff783,'XMD-CONTACTID':_0x198c67[_0x8620('0x1d')],'XMD-CDRTYPE':_0x8620('0x1e'),'CALLERID(all)':_0x7deddb,'XMD-VOICEQUEUEID':_0x198c67[_0x8620('0x1f')],'XMD-DIALCHANNEL':_0x3725f1,'XMD-DIALTIMEOUT':_0xb73f31[_0x8620('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x8620('0x12')](_0x8620('0x21'),_0xb73f31['dialQueueProject2']?'g':'',_['isEmpty'](_0xb73f31['monitor_format'])?'':_0x8620('0x22')),'XMD-DIALURL':_0xb73f31[_0x8620('0x23')]||'','XMD-AGI':_0xb73f31[_0x8620('0x24')]?util['format'](_0x8620('0x25'),ipAgi,_0xb73f31[_0x8620('0x24')]):_0x8620('0x26'),'XMD-AGIAFTER':_0xb73f31[_0x8620('0x27')]?util[_0x8620('0x12')](_0x8620('0x25'),ipAgi,_0xb73f31[_0x8620('0x27')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x186878?_0x186878[_0x8620('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x186878?_0x186878['originatecalleridname']:'','XMD-DESTINATION':_0x8620('0x29')};if(!_[_0x8620('0x14')](_0xb73f31[_0x8620('0x2a')])){_0x4443c1[util['format']('%s',_0x8620('0x2b'))]=_0xb73f31['monitor_format'];_0x4443c1[util[_0x8620('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1ff783;}if(_0x198c67&&_0x198c67[_0x8620('0x2c')]){for(var _0x3c23c8 in _0x198c67[_0x8620('0x2c')]){if(_0x198c67[_0x8620('0x2c')][_0x8620('0x2d')](_0x3c23c8)){if(!_[_0x8620('0x17')](_0x198c67['Contact'][_0x3c23c8])&&_0x3c23c8!=='id'&&_0x3c23c8!=='tags'&&_0x3c23c8!=='createdAt'&&_0x3c23c8!=='updatedAt'){_0x4443c1[util[_0x8620('0x12')](_0x8620('0x2e'),_0x8620('0x2f'),_['toUpper'](_0x3c23c8))]=_0x198c67['Contact'][_0x3c23c8];}}}}return _0x4443c1;};exports['toLowerVariables']=function(_0x2f5697){var _0x4a0a13={};for(var _0x4cf4da in _0x2f5697){if(_0x2f5697['hasOwnProperty'](_0x4cf4da)){_0x4a0a13[util['format']('%s',_[_0x8620('0x30')](_0x4cf4da))]=_0x2f5697[_0x4cf4da];}}return{'variables':_0x4a0a13};};exports[_0x8620('0x31')]=function(_0x119866,_0x373071){if(!_[_0x8620('0x17')](_0x119866)){if(_0x119866[_0x8620('0x2d')](_0x8620('0x32'))){if(_0x119866[_0x8620('0x32')]>0x0){_0x119866[_0x8620('0x32')]-=0x1;}else{logger['error'](_0x8620('0x33'),_0x373071);}}}else{logger[_0x8620('0x8')](_0x8620('0x34'),_0x373071);}};exports[_0x8620('0x35')]=function(_0x597a18){var _0x454f34=moment()[_0x8620('0x12')](_0x8620('0x36'));_0x597a18[_0x8620('0x37')]=0xd;_0x597a18[_0x8620('0x38')]=_0x8620('0x39');_0x597a18[_0x8620('0x3a')]=_0x454f34;_0x597a18[_0x8620('0x3b')]=_0x454f34;_0x597a18[_0x8620('0x3c')]=_0x454f34;};exports[_0x8620('0x3d')]=function(_0x2aff1c,_0x16b1c7,_0x3068b7){var _0x362976=moment()[_0x8620('0x12')](_0x8620('0x36'));_0x2aff1c['state']=_0x16b1c7;_0x2aff1c[_0x8620('0x38')]=_0x3068b7;_0x2aff1c[_0x8620('0x3b')]=_0x362976;_0x2aff1c['ringtime']=getSeconds(_0x2aff1c['responsetime'],_0x2aff1c[_0x8620('0x3a')]);};exports[_0x8620('0x3e')]=function(_0x1353be,_0x1a95a7,_0x36a9fb){_0x1353be['membername']=_0x1a95a7;_0x1353be[_0x8620('0x3f')]=_0x36a9fb;};exports[_0x8620('0x40')]=function(_0x37bc12,_0x4cf27c,_0xce4cba){var _0x954c4=moment()['format'](_0x8620('0x36'));_0x37bc12[_0x8620('0x37')]=_0x4cf27c;_0x37bc12['statedesc']=_0xce4cba;_0x37bc12[_0x8620('0x3b')]=_0x37bc12[_0x8620('0x3b')]?_0x37bc12['responsetime']:_0x954c4;_0x37bc12[_0x8620('0x3c')]=_0x37bc12[_0x8620('0x3c')]?_0x37bc12['endtime']:_0x954c4;_0x37bc12[_0x8620('0x41')]=getSeconds(_0x37bc12['responsetime']||0x0,_0x37bc12[_0x8620('0x3a')]||0x0);_0x37bc12[_0x8620('0x42')]=_0x37bc12['answertime']?getSeconds(_0x37bc12[_0x8620('0x3c')],_0x37bc12['answertime']):0x0;};exports[_0x8620('0x43')]=function(_0x2094c3){return _0x2094c3===_0x8620('0x44');};exports['variablesAction']=function(_0x48dd6a,_0x4b4bab,_0x21e2dd,_0x35fe58,_0x9ac809){var _0xff849a=_0x35fe58?_0x8620('0x45'):_0x48dd6a['calleridname'];_0xff849a=_0x9ac809?_0x8620('0x46'):_0xff849a;return{'actionid':_0x48dd6a[_0x8620('0x47')],'action':_0x8620('0x48'),'channel':_0x48dd6a['channelAgent'],'callerid':util[_0x8620('0x12')](_0x8620('0x13'),_0xff849a,_0x48dd6a[_0x8620('0x1c')]),'Exten':'xcally-motion-preview','Context':_0x8620('0x49'),'Priority':'1','variable':_0x21e2dd,'timeout':(_0x4b4bab[_0x8620('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x48dd6a[_0x8620('0x47')]};};exports[_0x8620('0x4b')]=function(_0x52b246){return _0x52b246[_0x8620('0x4c')]+_0x52b246['countcongestionretry']+_0x52b246[_0x8620('0x4d')];};exports[_0x8620('0x4e')]=function(_0x484bea){var _0x20ca97=_[_0x8620('0x4f')](_0x484bea);_0x20ca97[_0x8620('0x37')]=0xf;_0x20ca97[_0x8620('0x38')]=_0x8620('0x50');return _0x20ca97;};exports[_0x8620('0x51')]=function(_0x3a3358,_0x5b9fff,_0x2d8ea9){var _0x4d5861={};_0x4d5861[_0x5b9fff]=_0x3a3358[_0x5b9fff];_0x4d5861[_0x8620('0x52')]=![];_0x4d5861[_0x8620('0x53')]=moment()['add'](_0x2d8ea9,'minutes')[_0x8620('0x12')](_0x8620('0x36'));_0x4d5861[_0x8620('0x1d')]=_0x3a3358[_0x8620('0x1d')];_0x4d5861[_0x8620('0x54')]=_0x3a3358[_0x8620('0x54')];_0x4d5861[_0x8620('0x1f')]=_0x3a3358['VoiceQueueId']||undefined;return _0x4d5861;};exports[_0x8620('0x55')]=function(_0xc8d4b,_0x3675fe){if(!_[_0x8620('0x17')](_0xc8d4b)){if(_0xc8d4b['pTalking']>0x0){_0xc8d4b[_0x8620('0x56')]-=0x1;}else{logger[_0x8620('0x8')](_0x3675fe,_0x8620('0x57'));}}else{logger['error'](_0x3675fe,_0x8620('0x58'));}};exports['IsNotLoggedIn']=function(_0x5d3b64){if(_0x5d3b64<=0x0){return!![];}return![];};exports[_0x8620('0x59')]=function(_0x32d7cc,_0x32d0cc){_0x32d7cc[_0x8620('0x5a')]=_0x32d0cc;_0x32d7cc[_0x8620('0x1a')]=_0x32d7cc[_0x8620('0x5b')];_0x32d7cc[_0x8620('0x5c')]=_0x32d7cc['channelAgent'];return _0x32d7cc;};exports[_0x8620('0x5d')]=function(_0x4df9d7){var _0x4ae682={};_0x4ae682[_0x8620('0x5b')]=_0x4df9d7[_0x8620('0x5b')];_0x4ae682[_0x8620('0x5c')]=_0x4df9d7[_0x8620('0x5e')];_0x4ae682[_0x8620('0x47')]=_0x4df9d7[_0x8620('0x47')];return _0x4ae682;};exports[_0x8620('0x5f')]=function(_0x14ef8d){var _0x40fbe1=[];for(var _0xa3a7c1 in _0x14ef8d){if(_0x14ef8d[_0x8620('0x2d')](_0xa3a7c1)){if(!_[_0x8620('0x17')](_0x14ef8d[_0xa3a7c1])&&_0x14ef8d[_0xa3a7c1]['state']===_0x8620('0x60')&&_0x14ef8d[_0xa3a7c1]['status']===_0x8620('0x61')){_0x40fbe1[_0x8620('0x62')](_0x14ef8d[_0xa3a7c1]['id']);}}}return _0x40fbe1;};exports['getDiff']=function(_0x3d1a8e){var _0x1d150b=moment()[_0x8620('0x5')](0x0);var _0x8e6711=moment(_0x3d1a8e)['milliseconds'](0x0);return _0x1d150b[_0x8620('0x63')](_0x8e6711,_0x8620('0x6'));};exports[_0x8620('0x64')]=function(_0x2ef201){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ef201[_0x8620('0x1d')],'ListId':_0x2ef201[_0x8620('0x54')],'VoiceQueueId':_0x2ef201[_0x8620('0x1f')]||undefined,'CampaignId':_0x2ef201[_0x8620('0x65')]||undefined};};exports[_0x8620('0x66')]=function(_0x1d5a1c){if(_0x1d5a1c==='uniqueid'||_0x1d5a1c==='idContact'||_0x1d5a1c===_0x8620('0x5b')||_0x1d5a1c===_0x8620('0x67')||_0x1d5a1c===_0x8620('0x68')||_0x1d5a1c===_0x8620('0x69')||_0x1d5a1c==='membername'||_0x1d5a1c===_0x8620('0x5e')||_0x1d5a1c==='calleridname'||_0x1d5a1c===_0x8620('0x52')||_0x1d5a1c===_0x8620('0x1c')||_0x1d5a1c===_0x8620('0x53')||_0x1d5a1c===_0x8620('0x4c')||_0x1d5a1c===_0x8620('0x6a')||_0x1d5a1c===_0x8620('0x4d')||_0x1d5a1c===_0x8620('0x6b')||_0x1d5a1c===_0x8620('0x6c')||_0x1d5a1c===_0x8620('0x6d')||_0x1d5a1c===_0x8620('0x6e')||_0x1d5a1c===_0x8620('0x6f')||_0x1d5a1c===_0x8620('0x1d')||_0x1d5a1c===_0x8620('0x54')||_0x1d5a1c===_0x8620('0x3f')||_0x1d5a1c===_0x8620('0x1f')||_0x1d5a1c===_0x8620('0x70')||_0x1d5a1c===_0x8620('0x71')||_0x1d5a1c==='xmd-queue'||_0x1d5a1c===_0x8620('0x72')||_0x1d5a1c===_0x8620('0x73')||_0x1d5a1c==='xmd-dialurl'||_0x1d5a1c===_0x8620('0x74')||_0x1d5a1c===_0x8620('0x75')||_0x1d5a1c===_0x8620('0x76')||_0x1d5a1c===_0x8620('0x77')||_0x1d5a1c===_0x8620('0x78')||_0x1d5a1c===_0x8620('0x79')||_0x1d5a1c===_0x8620('0x7a')||_0x1d5a1c==='xmd-agiafter'||_0x1d5a1c==='xmd-agi'||_0x1d5a1c===_0x8620('0x7b')||_0x1d5a1c===_0x8620('0x7c')||_0x1d5a1c==='rtpaudioqosjitter'||_0x1d5a1c===_0x8620('0x7d')||_0x1d5a1c===_0x8620('0x7e')||_0x1d5a1c==='rtpaudioqoslossbridged'||_0x1d5a1c===_0x8620('0x7f')||_0x1d5a1c===_0x8620('0x80')||_0x1d5a1c===_0x8620('0x7b')||_0x1d5a1c==='rtpaudioqosbridged'||_0x1d5a1c===_0x8620('0x81')||_0x1d5a1c==='rtpaudioqosjitterbridged'||_0x1d5a1c==='rtpaudioqosloss'||_0x1d5a1c===_0x8620('0x82')||_0x1d5a1c==='rtpaudioqosrtt'||_0x1d5a1c===_0x8620('0x80')||_0x1d5a1c===_0x8620('0x83')||_0x1d5a1c===_0x8620('0x84')||_0x1d5a1c===_0x8620('0x37')||_0x1d5a1c===_0x8620('0x38')){return![];}return!![];};exports[_0x8620('0x85')]=function(_0x535717,_0x295165){var _0x2131f3,_0x68a08d,_0x25e015;if(_0x295165<=0x0){_0x295165=0x1;}_0x2131f3=new RegExp(_0x8620('0x86')+_0x295165+'}$');_0x68a08d=Math[_0x8620('0x87')](0xa,_0x295165-0x1);_0x25e015=Math[_0x8620('0x87')](0xa,_0x295165)-0x1;return util[_0x8620('0x12')]('%s',_['replace'](_0x535717,_0x2131f3,_[_0x8620('0x88')](_0x68a08d,_0x25e015)));};exports[_0x8620('0x89')]=function(_0x7cef9){var _0x15145c=_0x7cef9[_0x8620('0x8a')](/"(.*?)"/);return _0x15145c?_0x15145c[0x1]:_0x7cef9;};exports[_0x8620('0x8b')]=function(_0x28e533){var _0x2e266d=_0x28e533[_0x8620('0x8a')](/<(.*?)>/);return _0x2e266d?_0x2e266d[0x1]:_0x28e533;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 3bc5818..1533f61 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x1272d4,_0x5bb306){var _0x2a0936=function(_0x5d2985){while(--_0x5d2985){_0x1272d4['push'](_0x1272d4['shift']());}};_0x2a0936(++_0x5bb306);}(_0x5f2f,0x73));var _0xf5f2=function(_0x226e5c,_0x3fea9e){_0x226e5c=_0x226e5c-0x0;var _0x24aec3=_0x5f2f[_0x226e5c];return _0x24aec3;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x23db3f,_0x1120b4){var _0x45c96e=function(_0x1afb76){while(--_0x1afb76){_0x23db3f['push'](_0x23db3f['shift']());}};_0x45c96e(++_0x1120b4);}(_0xb10b,0x12a));var _0xbb10=function(_0x358fb5,_0x4407b8){_0x358fb5=_0x358fb5-0x0;var _0x4abfeb=_0xb10b[_0x358fb5];return _0x4abfeb;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 4009691..170a705 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09ab=['util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','agents','telephones','trunks','outbound','voiceExtensions','channels','timers','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','isNil','interface','hasOwnProperty','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','initAgents','length','mergeFromDatabase','initTelephones','isUndefined','initVoiceQueues','voiceQueues','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','initVoiceExtensions','initCampaignHopperHistory','bluebird'];(function(_0x40a792,_0x146830){var _0x5e53d4=function(_0x17ddb7){while(--_0x17ddb7){_0x40a792['push'](_0x40a792['shift']());}};_0x5e53d4(++_0x146830);}(_0x09ab,0x193));var _0xb09a=function(_0x30c92b,_0x154324){_0x30c92b=_0x30c92b-0x0;var _0x33837b=_0x09ab[_0x30c92b];return _0x33837b;};'use strict';var BPromise=require(_0xb09a('0x0'));var util=require(_0xb09a('0x1'));var _=require(_0xb09a('0x2'));var moment=require(_0xb09a('0x3'));var Agent=require(_0xb09a('0x4'));var Telephone=require(_0xb09a('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xb09a('0x6'));var Trigger=require(_0xb09a('0x7'));var Template=require('../model/template');var Campaign=require(_0xb09a('0x8'));var VoiceExtension=require(_0xb09a('0x9'));var ZendeskAccount=require(_0xb09a('0xa'));var SalesforceAccount=require(_0xb09a('0xb'));var FreshdeskAccount=require(_0xb09a('0xc'));var SugarcrmAccount=require(_0xb09a('0xd'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xb09a('0xe'));var VtigerAccount=require(_0xb09a('0xf'));var ServicenowAccount=require(_0xb09a('0x10'));var Dynamics365Account=require(_0xb09a('0x11'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xb09a('0x12')]={};this[_0xb09a('0x13')]={};this[_0xb09a('0x14')]={};this['voiceQueues']={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0xb09a('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb09a('0x16')]={};this[_0xb09a('0x17')]={};this['queueChannels']={};this['outboundChannels']={};this[_0xb09a('0x18')]={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0xb09a('0x19')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0xb09a('0x1a')]={};this[_0xb09a('0x1b')]={};this[_0xb09a('0x1c')]={};this[_0xb09a('0x1d')]={};this[_0xb09a('0x1e')]={};this[_0xb09a('0x1f')]={};};function freeIsNotKey(_0x39d5e7,_0x4e413c,_0x288967){var _0x336c73=_[_0xb09a('0x20')](_0x39d5e7,function(_0x14ff3d,_0x578df3){return _0x14ff3d[_0x288967];});for(var _0x18edbc in _0x4e413c){if(_0x4e413c['hasOwnProperty'](_0x18edbc)){if(!_0x336c73[_0x18edbc]){delete _0x4e413c[_0x18edbc];}}}}function freeIsNotKeySip(_0x2dd48c,_0x14b506){var _0x47bf08=_[_0xb09a('0x20')](_0x2dd48c,function(_0x3edcec,_0x38d122){return util[_0xb09a('0x21')](_0xb09a('0x22'),_0x3edcec[_0xb09a('0x23')]);});for(var _0x19c55b in _0x14b506){if(_0x14b506['hasOwnProperty'](_0x19c55b)){if(!_0x47bf08[_0x19c55b]){delete _0x14b506[_0x19c55b];}}}}function freeIsNotKeyAgent(_0x59c589,_0x7f10f0){var _0x259b0b=_['mapKeys'](_0x59c589,function(_0x4249e0,_0x79a16b){var _0x44d267=_[_0xb09a('0x24')](_0x4249e0[_0xb09a('0x25')])?util[_0xb09a('0x21')](_0xb09a('0x22'),_0x4249e0[_0xb09a('0x23')]):_0x4249e0[_0xb09a('0x25')];return _0x44d267;});for(var _0x5a85cb in _0x7f10f0){if(_0x7f10f0[_0xb09a('0x26')](_0x5a85cb)){if(!_0x259b0b[_0x5a85cb]){delete _0x7f10f0[_0x5a85cb];}}}}function clearVoiceCallReports(_0x104ae2){_0x104ae2[_0xb09a('0x27')]=0x0;_0x104ae2[_0xb09a('0x28')]=0x0;_0x104ae2[_0xb09a('0x29')]=0x0;_0x104ae2[_0xb09a('0x2a')]=0x0;_0x104ae2['sumBillable']=0x0;}function clearCampaigns(_0x5307cf){if(!_[_0xb09a('0x2b')](_0x5307cf)){for(var _0x5a3d78 in _0x5307cf){if(_0x5307cf['hasOwnProperty'](_0x5a3d78)){_0x5307cf[_0x5a3d78][_0xb09a('0x2c')]=0x0;_0x5307cf[_0x5a3d78][_0xb09a('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x5cef07){if(!_[_0xb09a('0x2b')](_0x5cef07)){for(var _0x464ba1 in _0x5cef07){if(_0x5cef07[_0xb09a('0x26')](_0x464ba1)){_0x5cef07[_0x464ba1][_0xb09a('0x27')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x28')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x2e')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x2f')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x29')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x2a')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x30')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x31')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x32')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x33')]=0x0;_0x5cef07[_0x464ba1]['outboundCongestionCallsDay']=0x0;_0x5cef07[_0x464ba1]['outboundNoSuchCallsDay']=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x34')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x35')]=0x0;_0x5cef07[_0x464ba1]['outboundDropCallsDayCallersExit']=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x36')]=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x37')]=0x0;_0x5cef07[_0x464ba1]['outboundRejectCallsDay']=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x38')]=0x0;_0x5cef07[_0x464ba1]['outboundAnswerAgiCallsDay']=0x0;_0x5cef07[_0x464ba1][_0xb09a('0x39')]=0x0;_0x5cef07[_0x464ba1]['queueStatusComplete']=!![];}}}}Realtime[_0xb09a('0x3a')]['mergeFromDatabase']=function(_0x1971d3,_0x3e5217){for(var _0x4284ff in _0x3e5217){if(_0x1971d3[_0xb09a('0x26')](_0x4284ff)){_0x1971d3[_0x4284ff]=_0x3e5217[_0x4284ff];}}};Realtime[_0xb09a('0x3a')][_0xb09a('0x3b')]=function(){var _0x456ee1=this;return function(_0x3d5775){if(_0x3d5775){freeIsNotKeyAgent(_0x3d5775,_0x456ee1[_0xb09a('0x12')]);for(var _0x4a9788=0x0,_0x330d33={},_0x4939b1={};_0x4a9788<_0x3d5775[_0xb09a('0x3c')];_0x4a9788+=0x1){_0x330d33=_0x3d5775[_0x4a9788];var _0x59e9b5=_[_0xb09a('0x24')](_0x330d33[_0xb09a('0x25')])?util[_0xb09a('0x21')]('SIP/%s',_0x330d33['name']):_0x330d33[_0xb09a('0x25')];if(_['isUndefined'](_0x456ee1[_0xb09a('0x12')][_0x59e9b5])){_0x456ee1[_0xb09a('0x12')][_0x59e9b5]=new Agent(_0x330d33);}else{_0x456ee1[_0xb09a('0x3d')](_0x456ee1['agents'][_0x59e9b5],_0x330d33);}}}return _0x456ee1[_0xb09a('0x12')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x3e')]=function(){var _0x1b3625=this;return function(_0x23f619){if(_0x23f619){freeIsNotKeySip(_0x23f619,_0x1b3625[_0xb09a('0x13')]);for(var _0x58380c=0x0,_0x818cc5={},_0x32b859={};_0x58380c<_0x23f619[_0xb09a('0x3c')];_0x58380c+=0x1){_0x818cc5=_0x23f619[_0x58380c];if(_[_0xb09a('0x3f')](_0x1b3625[_0xb09a('0x13')][util[_0xb09a('0x21')]('SIP/%s',_0x818cc5[_0xb09a('0x23')])])){_0x1b3625['telephones'][util[_0xb09a('0x21')](_0xb09a('0x22'),_0x818cc5[_0xb09a('0x23')])]=new Telephone(_0x818cc5);}else{_0x1b3625[_0xb09a('0x3d')](_0x1b3625['telephones'][util[_0xb09a('0x21')](_0xb09a('0x22'),_0x818cc5['name'])],_0x818cc5);}}}return _0x1b3625['telephones'];};};Realtime['prototype']['initTrunks']=function(){var _0x34a81e=this;return function(_0x3b9c5a){if(_0x3b9c5a){freeIsNotKeySip(_0x3b9c5a,_0x34a81e[_0xb09a('0x14')]);for(var _0x23780c=0x0,_0x3e9922={},_0x53d693={};_0x23780c<_0x3b9c5a[_0xb09a('0x3c')];_0x23780c+=0x1){_0x3e9922=_0x3b9c5a[_0x23780c];if(_[_0xb09a('0x3f')](_0x34a81e[_0xb09a('0x14')][util['format'](_0xb09a('0x22'),_0x3e9922['name'])])){_0x34a81e[_0xb09a('0x14')][util[_0xb09a('0x21')]('SIP/%s',_0x3e9922[_0xb09a('0x23')])]=new Trunk(_0x3e9922);}else{_0x34a81e['mergeFromDatabase'](_0x34a81e[_0xb09a('0x14')][util[_0xb09a('0x21')](_0xb09a('0x22'),_0x3e9922[_0xb09a('0x23')])],_0x3e9922);}}}return _0x34a81e[_0xb09a('0x14')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x40')]=function(){var _0x29aa33=this;return function(_0x5b85f2){if(_0x5b85f2){freeIsNotKey(_0x5b85f2,_0x29aa33[_0xb09a('0x41')],_0xb09a('0x23'));for(var _0x278736=0x0,_0x4e1554={},_0x41cb78={};_0x278736<_0x5b85f2[_0xb09a('0x3c')];_0x278736+=0x1){_0x4e1554=_0x5b85f2[_0x278736];if(_[_0xb09a('0x3f')](_0x29aa33['voiceQueues'][_0x4e1554[_0xb09a('0x23')]])){_0x29aa33[_0xb09a('0x41')][_0x4e1554['name']]=new VoiceQueue(_0x4e1554);}else{_0x29aa33['mergeFromDatabase'](_0x29aa33[_0xb09a('0x41')][_0x4e1554['name']],_0x4e1554);}}}return _0x29aa33['voiceQueues'];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x42')]=function(){var _0x432020=this;return function(_0xb34e06){if(_0xb34e06){freeIsNotKey(_0xb34e06,_0x432020[_0xb09a('0x43')],'id');for(var _0x9c928=0x0,_0x2ee7a4={},_0x18e97f={};_0x9c928<_0xb34e06[_0xb09a('0x3c')];_0x9c928+=0x1){_0x2ee7a4=_0xb34e06[_0x9c928];if(_[_0xb09a('0x3f')](_0x432020['triggers'][_0x2ee7a4['id']])){_0x432020[_0xb09a('0x43')][_0x2ee7a4['id']]=new Trigger(_0x2ee7a4);}else{_0x432020[_0xb09a('0x3d')](_0x432020['triggers'][_0x2ee7a4['id']],_0x2ee7a4);}}}return _0x432020[_0xb09a('0x43')];};};Realtime['prototype'][_0xb09a('0x44')]=function(){var _0x4d4ad6=this;return function(_0x14d78f){if(_0x14d78f){freeIsNotKey(_0x14d78f,_0x4d4ad6[_0xb09a('0x45')],'id');for(var _0x486a09=0x0,_0x43b7db={},_0x447f6f={};_0x486a09<_0x14d78f[_0xb09a('0x3c')];_0x486a09+=0x1){_0x43b7db=_0x14d78f[_0x486a09];if(_['isUndefined'](_0x4d4ad6[_0xb09a('0x45')][_0x43b7db['id']])){_0x4d4ad6['templates'][_0x43b7db['id']]=new Template(_0x43b7db);}else{_0x4d4ad6[_0xb09a('0x3d')](_0x4d4ad6[_0xb09a('0x45')][_0x43b7db['id']],_0x43b7db);}}}return _0x4d4ad6[_0xb09a('0x45')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x46')]=function(){var _0x43a6b8=this;return function(_0x208be0){if(_0x208be0){freeIsNotKey(_0x208be0,_0x43a6b8[_0xb09a('0x47')],'id');for(var _0x29f8b2=0x0,_0xe37173={},_0xc47b3={};_0x29f8b2<_0x208be0[_0xb09a('0x3c')];_0x29f8b2+=0x1){_0xe37173=_0x208be0[_0x29f8b2];if(_[_0xb09a('0x3f')](_0x43a6b8[_0xb09a('0x47')][_0xe37173['id']])){_0x43a6b8[_0xb09a('0x47')][_0xe37173['id']]=new ZendeskAccount(_0xe37173);}else{_0x43a6b8[_0xb09a('0x3d')](_0x43a6b8['zendeskAccounts'][_0xe37173['id']],_0xe37173);}}}return _0x43a6b8['zendeskAccounts'];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x48')]=function(){var _0x141bfa=this;return function(_0x2463ae){if(_0x2463ae){freeIsNotKey(_0x2463ae,_0x141bfa['salesforceAccounts'],'id');for(var _0x3849e0=0x0,_0x164440={},_0x56d076={};_0x3849e0<_0x2463ae['length'];_0x3849e0+=0x1){_0x164440=_0x2463ae[_0x3849e0];if(_[_0xb09a('0x3f')](_0x141bfa['salesforceAccounts'][_0x164440['id']])){_0x141bfa[_0xb09a('0x49')][_0x164440['id']]=new SalesforceAccount(_0x164440);}else{_0x141bfa['mergeFromDatabase'](_0x141bfa[_0xb09a('0x49')][_0x164440['id']],_0x164440);}}}return _0x141bfa[_0xb09a('0x49')];};};Realtime['prototype'][_0xb09a('0x4a')]=function(){var _0x31b420=this;return function(_0x576648){if(_0x576648){freeIsNotKey(_0x576648,_0x31b420[_0xb09a('0x4b')],'id');for(var _0x27ff93=0x0,_0x915238={},_0x4c99ca={};_0x27ff93<_0x576648[_0xb09a('0x3c')];_0x27ff93+=0x1){_0x915238=_0x576648[_0x27ff93];if(_[_0xb09a('0x3f')](_0x31b420['freshdeskAccounts'][_0x915238['id']])){_0x31b420[_0xb09a('0x4b')][_0x915238['id']]=new FreshdeskAccount(_0x915238);}else{_0x31b420['mergeFromDatabase'](_0x31b420[_0xb09a('0x4b')][_0x915238['id']],_0x915238);}}}return _0x31b420[_0xb09a('0x4b')];};};Realtime[_0xb09a('0x3a')]['initZohoAccounts']=function(){var _0x387374=this;return function(_0x541a34){if(_0x541a34){freeIsNotKey(_0x541a34,_0x387374[_0xb09a('0x4c')],'id');for(var _0x3f1799=0x0,_0x4ef54c={},_0x4ae5fc={};_0x3f1799<_0x541a34['length'];_0x3f1799+=0x1){_0x4ef54c=_0x541a34[_0x3f1799];if(_[_0xb09a('0x3f')](_0x387374[_0xb09a('0x4c')][_0x4ef54c['id']])){_0x387374[_0xb09a('0x4c')][_0x4ef54c['id']]=new ZohoAccount(_0x4ef54c);}else{_0x387374[_0xb09a('0x3d')](_0x387374['zohoAccounts'][_0x4ef54c['id']],_0x4ef54c);}}}return _0x387374[_0xb09a('0x4c')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x4d')]=function(){var _0x17c6e1=this;return function(_0x3ad62e){if(_0x3ad62e){freeIsNotKey(_0x3ad62e,_0x17c6e1[_0xb09a('0x1a')],'id');for(var _0x181586=0x0,_0x3976cc={},_0x5a3b19={};_0x181586<_0x3ad62e[_0xb09a('0x3c')];_0x181586+=0x1){_0x3976cc=_0x3ad62e[_0x181586];if(_[_0xb09a('0x3f')](_0x17c6e1[_0xb09a('0x1a')][_0x3976cc['id']])){_0x17c6e1[_0xb09a('0x1a')][_0x3976cc['id']]=new DeskAccount(_0x3976cc);}else{_0x17c6e1[_0xb09a('0x3d')](_0x17c6e1['deskAccounts'][_0x3976cc['id']],_0x3976cc);}}}return _0x17c6e1['deskAccounts'];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x4e')]=function(){var _0x542543=this;return function(_0x52e3ff){if(_0x52e3ff){freeIsNotKey(_0x52e3ff,_0x542543['sugarcrmAccounts'],'id');for(var _0x19b499=0x0,_0x429e19={},_0x373b70={};_0x19b499<_0x52e3ff[_0xb09a('0x3c')];_0x19b499+=0x1){_0x429e19=_0x52e3ff[_0x19b499];if(_[_0xb09a('0x3f')](_0x542543[_0xb09a('0x19')][_0x429e19['id']])){_0x542543[_0xb09a('0x19')][_0x429e19['id']]=new SugarcrmAccount(_0x429e19);}else{_0x542543['mergeFromDatabase'](_0x542543['sugarcrmAccounts'][_0x429e19['id']],_0x429e19);}}}return _0x542543[_0xb09a('0x19')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x4f')]=function(){var _0x41bcd6=this;return function(_0x45d47d){if(_0x45d47d){freeIsNotKey(_0x45d47d,_0x41bcd6['vtigerAccounts'],'id');for(var _0x1a0529=0x0,_0x25fedb={},_0x5608fa={};_0x1a0529<_0x45d47d[_0xb09a('0x3c')];_0x1a0529+=0x1){_0x25fedb=_0x45d47d[_0x1a0529];if(_[_0xb09a('0x3f')](_0x41bcd6[_0xb09a('0x1b')][_0x25fedb['id']])){_0x41bcd6[_0xb09a('0x1b')][_0x25fedb['id']]=new VtigerAccount(_0x25fedb);}else{_0x41bcd6[_0xb09a('0x3d')](_0x41bcd6[_0xb09a('0x1b')][_0x25fedb['id']],_0x25fedb);}}}return _0x41bcd6[_0xb09a('0x1b')];};};Realtime[_0xb09a('0x3a')]['initServicenowAccounts']=function(){var _0x3f4f42=this;return function(_0x2fd1be){if(_0x2fd1be){freeIsNotKey(_0x2fd1be,_0x3f4f42[_0xb09a('0x1c')],'id');for(var _0x3e7dd0=0x0,_0x1e1ae3={},_0x42eed9={};_0x3e7dd0<_0x2fd1be[_0xb09a('0x3c')];_0x3e7dd0+=0x1){_0x1e1ae3=_0x2fd1be[_0x3e7dd0];if(_[_0xb09a('0x3f')](_0x3f4f42[_0xb09a('0x1c')][_0x1e1ae3['id']])){_0x3f4f42[_0xb09a('0x1c')][_0x1e1ae3['id']]=new ServicenowAccount(_0x1e1ae3);}else{_0x3f4f42[_0xb09a('0x3d')](_0x3f4f42[_0xb09a('0x1c')][_0x1e1ae3['id']],_0x1e1ae3);}}}return _0x3f4f42[_0xb09a('0x1c')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x50')]=function(){var _0x34958a=this;return function(_0xf71660){if(_0xf71660){freeIsNotKey(_0xf71660,_0x34958a['dynamics365Accounts'],'id');for(var _0x4304c6=0x0,_0x18c25e={},_0x5bab74={};_0x4304c6<_0xf71660[_0xb09a('0x3c')];_0x4304c6+=0x1){_0x18c25e=_0xf71660[_0x4304c6];if(_[_0xb09a('0x3f')](_0x34958a[_0xb09a('0x1d')][_0x18c25e['id']])){_0x34958a[_0xb09a('0x1d')][_0x18c25e['id']]=new Dynamics365Account(_0x18c25e);}else{_0x34958a[_0xb09a('0x3d')](_0x34958a[_0xb09a('0x1d')][_0x18c25e['id']],_0x18c25e);}}}return _0x34958a[_0xb09a('0x1d')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x277067=this;return function(_0xf57892){if(_0xf57892){freeIsNotKey(_0xf57892,_0x277067[_0xb09a('0x1e')],'id');for(var _0x34d552=0x0,_0x24beaf={},_0x5396ef={};_0x34d552<_0xf57892['length'];_0x34d552+=0x1){_0x24beaf=_0xf57892[_0x34d552];if(_['isUndefined'](_0x277067['freshsalesAccounts'][_0x24beaf['id']])){_0x277067[_0xb09a('0x1e')][_0x24beaf['id']]=new FreshsalesAccount(_0x24beaf);}else{_0x277067['mergeFromDatabase'](_0x277067[_0xb09a('0x1e')][_0x24beaf['id']],_0x24beaf);}}}return _0x277067[_0xb09a('0x1e')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x51')]=function(){var _0x18d0fd=this;return function(_0x26b709){for(var _0x2ff663=0x0;_0x2ff663<_0x26b709['length'];_0x2ff663+=0x1){_[_0xb09a('0x52')](_0x18d0fd[_0xb09a('0x41')][_0x26b709[_0x2ff663][_0xb09a('0x23')]],_0x26b709[_0x2ff663]);}return _0x18d0fd[_0xb09a('0x41')];};};Realtime['prototype'][_0xb09a('0x53')]=function(){var _0x456274=this;return function(_0x459f1e){clearVoiceQueues(_0x456274[_0xb09a('0x41')]);if(_0x459f1e){_0x459f1e=_[_0xb09a('0x54')](_0x459f1e,'uniqueid');for(var _0x3e7c74 in _0x459f1e){if(_0x459f1e[_0xb09a('0x26')](_0x3e7c74)){var _0x2f5ae8={};for(var _0xe5ed02=0x0;_0xe5ed02<_0x459f1e[_0x3e7c74]['length'];_0xe5ed02+=0x1){var _0x4117df=_0x459f1e[_0x3e7c74][_0xe5ed02]['queue'];if(_0x456274['voiceQueues'][_0x4117df]){if(_0x459f1e[_0x3e7c74][_0xe5ed02]['queuecallerexit']){_0x456274['voiceQueues'][_0x4117df]['unmanaged']+=0x1;}if(_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x55')]){_0x456274[_0xb09a('0x41')][_0x4117df][_0xb09a('0x2f')]+=0x1;}_0x456274[_0xb09a('0x41')][_0x4117df]['sumHoldTime']+=moment(_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x56')])[_0xb09a('0x57')](moment(_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x58')]),'seconds')||0x0;if(_0xe5ed02===_0x459f1e[_0x3e7c74]['length']-0x1){_0x456274[_0xb09a('0x41')][_0x4117df]['sumDuration']+=moment(_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x59')]||_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x5a')]||_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x5b')])['diff'](moment(_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x58')]),_0xb09a('0x5c'))||0x0;_0x456274['voiceQueues'][_0x4117df]['total']+=0x1;if(_0x459f1e[_0x3e7c74][_0xe5ed02]['queuecallercomplete']){_0x456274[_0xb09a('0x41')][_0x4117df][_0xb09a('0x28')]+=0x1;_0x456274[_0xb09a('0x41')][_0x4117df][_0xb09a('0x30')]+=moment(_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x59')])[_0xb09a('0x57')](moment(_0x459f1e[_0x3e7c74][_0xe5ed02][_0xb09a('0x56')]),'seconds')||0x0;}}else{_0x456274[_0xb09a('0x41')][_0x4117df][_0xb09a('0x2a')]+=_0x456274['voiceQueues'][_0x4117df][_0xb09a('0x29')]||0x0;}}}}}}return _0x456274[_0xb09a('0x41')];};};Realtime[_0xb09a('0x3a')]['initVoiceCallReports']=function(){var _0x5b347a=this;return function(_0xb393f2){clearVoiceCallReports(_0x5b347a[_0xb09a('0x15')]);if(_0xb393f2){for(var _0x3060b9=0x0;_0x3060b9<_0xb393f2['length'];_0x3060b9+=0x1){_0x5b347a[_0xb09a('0x15')][_0xb09a('0x27')]+=0x1;_0x5b347a[_0xb09a('0x15')][_0xb09a('0x2a')]+=_0xb393f2[_0x3060b9][_0xb09a('0x5d')];if(_0xb393f2[_0x3060b9][_0xb09a('0x5e')]===_0xb09a('0x5f')){_0x5b347a[_0xb09a('0x15')][_0xb09a('0x28')]+=0x1;_0x5b347a[_0xb09a('0x15')][_0xb09a('0x29')]+=_0xb393f2[_0x3060b9]['duration']-_0xb393f2[_0x3060b9][_0xb09a('0x60')]||0x0;_0x5b347a['outbound'][_0xb09a('0x30')]+=_0xb393f2[_0x3060b9][_0xb09a('0x60')];}}}return _0x5b347a[_0xb09a('0x15')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x61')]=function(){var _0x13bbe2=this;return function(_0x3ce1ea){if(_0x3ce1ea){freeIsNotKey(_0x3ce1ea,_0x13bbe2['campaigns'],'name');for(var _0x51af9c=0x0,_0x3b99ae={};_0x51af9c<_0x3ce1ea['length'];_0x51af9c+=0x1){_0x3b99ae=_0x3ce1ea[_0x51af9c];if(_[_0xb09a('0x3f')](_0x13bbe2[_0xb09a('0x62')][_0x3b99ae[_0xb09a('0x23')]])){_0x13bbe2['campaigns'][_0x3b99ae[_0xb09a('0x23')]]=new Campaign(_0x3b99ae);}else{_0x13bbe2[_0xb09a('0x3d')](_0x13bbe2['campaigns'][_0x3b99ae[_0xb09a('0x23')]],_0x3b99ae);}}}return _0x13bbe2[_0xb09a('0x62')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x63')]=function(){var _0x5afa7=this;return function(_0x6de779){if(_0x6de779){freeIsNotKey(_0x6de779,_0x5afa7[_0xb09a('0x16')],'id');for(var _0x103410=0x0,_0x3cafd3={};_0x103410<_0x6de779[_0xb09a('0x3c')];_0x103410+=0x1){_0x3cafd3=_0x6de779[_0x103410];if(_[_0xb09a('0x3f')](_0x5afa7[_0xb09a('0x16')][_0x3cafd3['id']])){_0x5afa7[_0xb09a('0x16')][_0x3cafd3['id']]=new VoiceExtension(_0x3cafd3);}else{_0x5afa7[_0xb09a('0x3d')](_0x5afa7[_0xb09a('0x16')][_0x3cafd3['id']],_0x3cafd3);}}}return _0x5afa7[_0xb09a('0x16')];};};Realtime[_0xb09a('0x3a')][_0xb09a('0x64')]=function(){var _0x15e860=this;return function(_0x5f437f){clearCampaigns(_0x15e860['campaigns']);for(var _0x44cc7b=0x0;_0x44cc7b<_0x5f437f['length'];_0x44cc7b+=0x1){_[_0xb09a('0x52')](_0x15e860[_0xb09a('0x62')][_0x5f437f[_0x44cc7b][_0xb09a('0x23')]],_0x5f437f[_0x44cc7b]);}return _0x15e860[_0xb09a('0x62')];};};Realtime[_0xb09a('0x3a')]['initFaxAccounts']=function(){var _0x180f15=this;return function(_0x30d514){if(_0x30d514){freeIsNotKey(_0x30d514,_0x180f15[_0xb09a('0x1f')],'id');for(var _0x254581=0x0,_0x28ea62={},_0x40301b={};_0x254581<_0x30d514[_0xb09a('0x3c')];_0x254581+=0x1){_0x28ea62=_0x30d514[_0x254581];if(_[_0xb09a('0x3f')](_0x180f15['faxAccounts'][_0x28ea62['id']])){_0x180f15[_0xb09a('0x1f')][_0x28ea62['id']]=new FaxAccount(_0x28ea62);}else{_0x180f15[_0xb09a('0x3d')](_0x180f15[_0xb09a('0x1f')][_0x28ea62['id']],_0x28ea62);}}}return _0x180f15[_0xb09a('0x1f')];};};module['exports']=Realtime; \ No newline at end of file +var _0x400c=['abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','name','isNil','total','answered','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','sumHoldTime','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','length','interface','isUndefined','initTrunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon'];(function(_0x5d9491,_0x2e8c2e){var _0x149737=function(_0xb724d2){while(--_0xb724d2){_0x5d9491['push'](_0x5d9491['shift']());}};_0x149737(++_0x2e8c2e);}(_0x400c,0x156));var _0xc400=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x400c[_0x3e5086];return _0xfeb102;};'use strict';var BPromise=require(_0xc400('0x0'));var util=require(_0xc400('0x1'));var _=require(_0xc400('0x2'));var moment=require(_0xc400('0x3'));var Agent=require(_0xc400('0x4'));var Telephone=require(_0xc400('0x5'));var Trunk=require(_0xc400('0x6'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xc400('0x7'));var Template=require(_0xc400('0x8'));var Campaign=require(_0xc400('0x9'));var VoiceExtension=require(_0xc400('0xa'));var ZendeskAccount=require(_0xc400('0xb'));var SalesforceAccount=require(_0xc400('0xc'));var FreshdeskAccount=require(_0xc400('0xd'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xc400('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xc400('0xf'));var ServicenowAccount=require(_0xc400('0x10'));var Dynamics365Account=require(_0xc400('0x11'));var FreshsalesAccount=require(_0xc400('0x12'));var FaxAccount=require(_0xc400('0x13'));var Realtime=function(){this[_0xc400('0x14')]={};this[_0xc400('0x15')]={};this[_0xc400('0x16')]={};this[_0xc400('0x17')]={};this[_0xc400('0x18')]={};this[_0xc400('0x19')]={};this[_0xc400('0x1a')]={};this[_0xc400('0x1b')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xc400('0x1c')]={};this['channels']={};this[_0xc400('0x1d')]={};this[_0xc400('0x1e')]={};this[_0xc400('0x1f')]={};this[_0xc400('0x20')]={};this['salesforceAccounts']={};this[_0xc400('0x21')]={};this[_0xc400('0x22')]={};this['zohoAccounts']={};this[_0xc400('0x23')]={};this[_0xc400('0x24')]={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this[_0xc400('0x25')]={};};function freeIsNotKey(_0xc597a4,_0x1075f0,_0x127ad9){var _0x4cef5a=_['mapKeys'](_0xc597a4,function(_0x380ded,_0xb4c49c){return _0x380ded[_0x127ad9];});for(var _0x5479f3 in _0x1075f0){if(_0x1075f0[_0xc400('0x26')](_0x5479f3)){if(!_0x4cef5a[_0x5479f3]){delete _0x1075f0[_0x5479f3];}}}}function freeIsNotKeySip(_0x1e993c,_0xaffc07){var _0x3ea6c1=_[_0xc400('0x27')](_0x1e993c,function(_0x298dee,_0x213d3){return util[_0xc400('0x28')](_0xc400('0x29'),_0x298dee[_0xc400('0x2a')]);});for(var _0x21cdc9 in _0xaffc07){if(_0xaffc07['hasOwnProperty'](_0x21cdc9)){if(!_0x3ea6c1[_0x21cdc9]){delete _0xaffc07[_0x21cdc9];}}}}function freeIsNotKeyAgent(_0x2ed3f5,_0x4b4caa){var _0xe85770=_[_0xc400('0x27')](_0x2ed3f5,function(_0x188977,_0x459bc5){var _0x2763fc=_[_0xc400('0x2b')](_0x188977['interface'])?util['format']('SIP/%s',_0x188977[_0xc400('0x2a')]):_0x188977['interface'];return _0x2763fc;});for(var _0x3cb822 in _0x4b4caa){if(_0x4b4caa[_0xc400('0x26')](_0x3cb822)){if(!_0xe85770[_0x3cb822]){delete _0x4b4caa[_0x3cb822];}}}}function clearVoiceCallReports(_0x6fcde5){_0x6fcde5[_0xc400('0x2c')]=0x0;_0x6fcde5[_0xc400('0x2d')]=0x0;_0x6fcde5['sumHoldTime']=0x0;_0x6fcde5[_0xc400('0x2e')]=0x0;_0x6fcde5[_0xc400('0x2f')]=0x0;}function clearCampaigns(_0x4ef3ca){if(!_['isEmpty'](_0x4ef3ca)){for(var _0x52ed2c in _0x4ef3ca){if(_0x4ef3ca['hasOwnProperty'](_0x52ed2c)){_0x4ef3ca[_0x52ed2c][_0xc400('0x30')]=0x0;_0x4ef3ca[_0x52ed2c][_0xc400('0x31')]=0x0;}}}}function clearVoiceQueues(_0x19462f){if(!_[_0xc400('0x32')](_0x19462f)){for(var _0xbf3cc0 in _0x19462f){if(_0x19462f[_0xc400('0x26')](_0xbf3cc0)){_0x19462f[_0xbf3cc0]['total']=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x2d')]=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x33')]=0x0;_0x19462f[_0xbf3cc0]['abandoned']=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x34')]=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x2e')]=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x2f')]=0x0;_0x19462f[_0xbf3cc0]['outboundAnswerAgiCallsDay']=0x0;_0x19462f[_0xbf3cc0]['outboundNoAnswerCallsDay']=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x35')]=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x36')]=0x0;_0x19462f[_0xbf3cc0]['outboundNoSuchCallsDay']=0x0;_0x19462f[_0xbf3cc0]['outboundUnknownCallsDay']=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x37')]=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x38')]=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x39')]=0x0;_0x19462f[_0xbf3cc0]['outboundOriginateFailureCallsDay']=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x3a')]=0x0;_0x19462f[_0xbf3cc0]['outboundReCallsDay']=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x3b')]=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x3c')]=0x0;_0x19462f[_0xbf3cc0][_0xc400('0x3d')]=!![];}}}}Realtime['prototype'][_0xc400('0x3e')]=function(_0x1c7a40,_0x25d4d9){for(var _0x344453 in _0x25d4d9){if(_0x1c7a40['hasOwnProperty'](_0x344453)){_0x1c7a40[_0x344453]=_0x25d4d9[_0x344453];}}};Realtime[_0xc400('0x3f')]['initAgents']=function(){var _0x426f9=this;return function(_0x306405){if(_0x306405){freeIsNotKeyAgent(_0x306405,_0x426f9[_0xc400('0x14')]);for(var _0x525d44=0x0,_0x516840={},_0xae93e3={};_0x525d44<_0x306405[_0xc400('0x40')];_0x525d44+=0x1){_0x516840=_0x306405[_0x525d44];var _0x1c6c7a=_['isNil'](_0x516840['interface'])?util[_0xc400('0x28')]('SIP/%s',_0x516840[_0xc400('0x2a')]):_0x516840[_0xc400('0x41')];if(_[_0xc400('0x42')](_0x426f9['agents'][_0x1c6c7a])){_0x426f9[_0xc400('0x14')][_0x1c6c7a]=new Agent(_0x516840);}else{_0x426f9[_0xc400('0x3e')](_0x426f9[_0xc400('0x14')][_0x1c6c7a],_0x516840);}}}return _0x426f9['agents'];};};Realtime[_0xc400('0x3f')]['initTelephones']=function(){var _0x4b9596=this;return function(_0xaf936e){if(_0xaf936e){freeIsNotKeySip(_0xaf936e,_0x4b9596[_0xc400('0x15')]);for(var _0x4e4b17=0x0,_0xeb2dd8={},_0x3d8829={};_0x4e4b17<_0xaf936e[_0xc400('0x40')];_0x4e4b17+=0x1){_0xeb2dd8=_0xaf936e[_0x4e4b17];if(_[_0xc400('0x42')](_0x4b9596['telephones'][util[_0xc400('0x28')]('SIP/%s',_0xeb2dd8[_0xc400('0x2a')])])){_0x4b9596[_0xc400('0x15')][util[_0xc400('0x28')](_0xc400('0x29'),_0xeb2dd8['name'])]=new Telephone(_0xeb2dd8);}else{_0x4b9596[_0xc400('0x3e')](_0x4b9596[_0xc400('0x15')][util['format'](_0xc400('0x29'),_0xeb2dd8[_0xc400('0x2a')])],_0xeb2dd8);}}}return _0x4b9596[_0xc400('0x15')];};};Realtime[_0xc400('0x3f')][_0xc400('0x43')]=function(){var _0x5c29bd=this;return function(_0x48999e){if(_0x48999e){freeIsNotKeySip(_0x48999e,_0x5c29bd[_0xc400('0x16')]);for(var _0x5b1683=0x0,_0x4fb4a3={},_0x25cb12={};_0x5b1683<_0x48999e['length'];_0x5b1683+=0x1){_0x4fb4a3=_0x48999e[_0x5b1683];if(_[_0xc400('0x42')](_0x5c29bd[_0xc400('0x16')][util[_0xc400('0x28')](_0xc400('0x29'),_0x4fb4a3[_0xc400('0x2a')])])){_0x5c29bd[_0xc400('0x16')][util[_0xc400('0x28')]('SIP/%s',_0x4fb4a3[_0xc400('0x2a')])]=new Trunk(_0x4fb4a3);}else{_0x5c29bd[_0xc400('0x3e')](_0x5c29bd['trunks'][util[_0xc400('0x28')]('SIP/%s',_0x4fb4a3[_0xc400('0x2a')])],_0x4fb4a3);}}}return _0x5c29bd[_0xc400('0x16')];};};Realtime[_0xc400('0x3f')]['initVoiceQueues']=function(){var _0xba8f9e=this;return function(_0x100eb0){if(_0x100eb0){freeIsNotKey(_0x100eb0,_0xba8f9e[_0xc400('0x17')],_0xc400('0x2a'));for(var _0x3c0716=0x0,_0x56911c={},_0x115bdc={};_0x3c0716<_0x100eb0[_0xc400('0x40')];_0x3c0716+=0x1){_0x56911c=_0x100eb0[_0x3c0716];if(_[_0xc400('0x42')](_0xba8f9e[_0xc400('0x17')][_0x56911c[_0xc400('0x2a')]])){_0xba8f9e[_0xc400('0x17')][_0x56911c['name']]=new VoiceQueue(_0x56911c);}else{_0xba8f9e[_0xc400('0x3e')](_0xba8f9e[_0xc400('0x17')][_0x56911c['name']],_0x56911c);}}}return _0xba8f9e[_0xc400('0x17')];};};Realtime[_0xc400('0x3f')]['initTriggers']=function(){var _0x4bb8e4=this;return function(_0x542429){if(_0x542429){freeIsNotKey(_0x542429,_0x4bb8e4['triggers'],'id');for(var _0x29a63e=0x0,_0x4a935a={},_0x42a8bf={};_0x29a63e<_0x542429[_0xc400('0x40')];_0x29a63e+=0x1){_0x4a935a=_0x542429[_0x29a63e];if(_[_0xc400('0x42')](_0x4bb8e4[_0xc400('0x18')][_0x4a935a['id']])){_0x4bb8e4[_0xc400('0x18')][_0x4a935a['id']]=new Trigger(_0x4a935a);}else{_0x4bb8e4[_0xc400('0x3e')](_0x4bb8e4[_0xc400('0x18')][_0x4a935a['id']],_0x4a935a);}}}return _0x4bb8e4['triggers'];};};Realtime['prototype'][_0xc400('0x44')]=function(){var _0x1a1843=this;return function(_0x542c67){if(_0x542c67){freeIsNotKey(_0x542c67,_0x1a1843[_0xc400('0x1a')],'id');for(var _0x291859=0x0,_0x5454ce={},_0x511dae={};_0x291859<_0x542c67[_0xc400('0x40')];_0x291859+=0x1){_0x5454ce=_0x542c67[_0x291859];if(_[_0xc400('0x42')](_0x1a1843[_0xc400('0x1a')][_0x5454ce['id']])){_0x1a1843['templates'][_0x5454ce['id']]=new Template(_0x5454ce);}else{_0x1a1843[_0xc400('0x3e')](_0x1a1843[_0xc400('0x1a')][_0x5454ce['id']],_0x5454ce);}}}return _0x1a1843[_0xc400('0x1a')];};};Realtime[_0xc400('0x3f')][_0xc400('0x45')]=function(){var _0x258df6=this;return function(_0x5e24bf){if(_0x5e24bf){freeIsNotKey(_0x5e24bf,_0x258df6[_0xc400('0x20')],'id');for(var _0x4d4844=0x0,_0x5642a2={},_0x24161e={};_0x4d4844<_0x5e24bf['length'];_0x4d4844+=0x1){_0x5642a2=_0x5e24bf[_0x4d4844];if(_[_0xc400('0x42')](_0x258df6['zendeskAccounts'][_0x5642a2['id']])){_0x258df6['zendeskAccounts'][_0x5642a2['id']]=new ZendeskAccount(_0x5642a2);}else{_0x258df6['mergeFromDatabase'](_0x258df6[_0xc400('0x20')][_0x5642a2['id']],_0x5642a2);}}}return _0x258df6[_0xc400('0x20')];};};Realtime[_0xc400('0x3f')][_0xc400('0x46')]=function(){var _0x54b79a=this;return function(_0x1958b9){if(_0x1958b9){freeIsNotKey(_0x1958b9,_0x54b79a[_0xc400('0x47')],'id');for(var _0x5a2b9c=0x0,_0x2287d5={},_0x32c51a={};_0x5a2b9c<_0x1958b9[_0xc400('0x40')];_0x5a2b9c+=0x1){_0x2287d5=_0x1958b9[_0x5a2b9c];if(_[_0xc400('0x42')](_0x54b79a[_0xc400('0x47')][_0x2287d5['id']])){_0x54b79a['salesforceAccounts'][_0x2287d5['id']]=new SalesforceAccount(_0x2287d5);}else{_0x54b79a[_0xc400('0x3e')](_0x54b79a[_0xc400('0x47')][_0x2287d5['id']],_0x2287d5);}}}return _0x54b79a[_0xc400('0x47')];};};Realtime[_0xc400('0x3f')][_0xc400('0x48')]=function(){var _0x3169fe=this;return function(_0x39e6a3){if(_0x39e6a3){freeIsNotKey(_0x39e6a3,_0x3169fe[_0xc400('0x22')],'id');for(var _0x22b6ac=0x0,_0x183593={},_0x217fe5={};_0x22b6ac<_0x39e6a3[_0xc400('0x40')];_0x22b6ac+=0x1){_0x183593=_0x39e6a3[_0x22b6ac];if(_['isUndefined'](_0x3169fe['freshdeskAccounts'][_0x183593['id']])){_0x3169fe[_0xc400('0x22')][_0x183593['id']]=new FreshdeskAccount(_0x183593);}else{_0x3169fe[_0xc400('0x3e')](_0x3169fe[_0xc400('0x22')][_0x183593['id']],_0x183593);}}}return _0x3169fe[_0xc400('0x22')];};};Realtime[_0xc400('0x3f')][_0xc400('0x49')]=function(){var _0x50bf14=this;return function(_0x594647){if(_0x594647){freeIsNotKey(_0x594647,_0x50bf14[_0xc400('0x4a')],'id');for(var _0x2fe4d2=0x0,_0x4bc27c={},_0x4f4636={};_0x2fe4d2<_0x594647[_0xc400('0x40')];_0x2fe4d2+=0x1){_0x4bc27c=_0x594647[_0x2fe4d2];if(_[_0xc400('0x42')](_0x50bf14[_0xc400('0x4a')][_0x4bc27c['id']])){_0x50bf14[_0xc400('0x4a')][_0x4bc27c['id']]=new ZohoAccount(_0x4bc27c);}else{_0x50bf14[_0xc400('0x3e')](_0x50bf14[_0xc400('0x4a')][_0x4bc27c['id']],_0x4bc27c);}}}return _0x50bf14[_0xc400('0x4a')];};};Realtime['prototype'][_0xc400('0x4b')]=function(){var _0x5d9b47=this;return function(_0x269102){if(_0x269102){freeIsNotKey(_0x269102,_0x5d9b47[_0xc400('0x23')],'id');for(var _0x3ed853=0x0,_0x590434={},_0x50af42={};_0x3ed853<_0x269102[_0xc400('0x40')];_0x3ed853+=0x1){_0x590434=_0x269102[_0x3ed853];if(_['isUndefined'](_0x5d9b47[_0xc400('0x23')][_0x590434['id']])){_0x5d9b47[_0xc400('0x23')][_0x590434['id']]=new DeskAccount(_0x590434);}else{_0x5d9b47['mergeFromDatabase'](_0x5d9b47['deskAccounts'][_0x590434['id']],_0x590434);}}}return _0x5d9b47[_0xc400('0x23')];};};Realtime[_0xc400('0x3f')]['initSugarcrmAccounts']=function(){var _0x2f3e46=this;return function(_0x2e0de6){if(_0x2e0de6){freeIsNotKey(_0x2e0de6,_0x2f3e46['sugarcrmAccounts'],'id');for(var _0x2cba99=0x0,_0x126026={},_0x122b88={};_0x2cba99<_0x2e0de6[_0xc400('0x40')];_0x2cba99+=0x1){_0x126026=_0x2e0de6[_0x2cba99];if(_[_0xc400('0x42')](_0x2f3e46['sugarcrmAccounts'][_0x126026['id']])){_0x2f3e46[_0xc400('0x21')][_0x126026['id']]=new SugarcrmAccount(_0x126026);}else{_0x2f3e46[_0xc400('0x3e')](_0x2f3e46[_0xc400('0x21')][_0x126026['id']],_0x126026);}}}return _0x2f3e46[_0xc400('0x21')];};};Realtime[_0xc400('0x3f')][_0xc400('0x4c')]=function(){var _0x2c6f3c=this;return function(_0x343f99){if(_0x343f99){freeIsNotKey(_0x343f99,_0x2c6f3c[_0xc400('0x24')],'id');for(var _0x48856e=0x0,_0x7559f2={},_0x102bdc={};_0x48856e<_0x343f99[_0xc400('0x40')];_0x48856e+=0x1){_0x7559f2=_0x343f99[_0x48856e];if(_[_0xc400('0x42')](_0x2c6f3c[_0xc400('0x24')][_0x7559f2['id']])){_0x2c6f3c[_0xc400('0x24')][_0x7559f2['id']]=new VtigerAccount(_0x7559f2);}else{_0x2c6f3c[_0xc400('0x3e')](_0x2c6f3c[_0xc400('0x24')][_0x7559f2['id']],_0x7559f2);}}}return _0x2c6f3c[_0xc400('0x24')];};};Realtime[_0xc400('0x3f')]['initServicenowAccounts']=function(){var _0x3a495b=this;return function(_0x4422d8){if(_0x4422d8){freeIsNotKey(_0x4422d8,_0x3a495b['servicenowAccounts'],'id');for(var _0x1c7cc3=0x0,_0x4c3d14={},_0x28103f={};_0x1c7cc3<_0x4422d8[_0xc400('0x40')];_0x1c7cc3+=0x1){_0x4c3d14=_0x4422d8[_0x1c7cc3];if(_['isUndefined'](_0x3a495b[_0xc400('0x4d')][_0x4c3d14['id']])){_0x3a495b[_0xc400('0x4d')][_0x4c3d14['id']]=new ServicenowAccount(_0x4c3d14);}else{_0x3a495b[_0xc400('0x3e')](_0x3a495b[_0xc400('0x4d')][_0x4c3d14['id']],_0x4c3d14);}}}return _0x3a495b[_0xc400('0x4d')];};};Realtime[_0xc400('0x3f')][_0xc400('0x4e')]=function(){var _0x3cc174=this;return function(_0x37b3e5){if(_0x37b3e5){freeIsNotKey(_0x37b3e5,_0x3cc174[_0xc400('0x4f')],'id');for(var _0x58ecf9=0x0,_0x240aeb={},_0x507c49={};_0x58ecf9<_0x37b3e5['length'];_0x58ecf9+=0x1){_0x240aeb=_0x37b3e5[_0x58ecf9];if(_[_0xc400('0x42')](_0x3cc174[_0xc400('0x4f')][_0x240aeb['id']])){_0x3cc174[_0xc400('0x4f')][_0x240aeb['id']]=new Dynamics365Account(_0x240aeb);}else{_0x3cc174[_0xc400('0x3e')](_0x3cc174['dynamics365Accounts'][_0x240aeb['id']],_0x240aeb);}}}return _0x3cc174[_0xc400('0x4f')];};};Realtime[_0xc400('0x3f')][_0xc400('0x50')]=function(){var _0x279bd7=this;return function(_0x469150){if(_0x469150){freeIsNotKey(_0x469150,_0x279bd7[_0xc400('0x51')],'id');for(var _0x5405a0=0x0,_0xdb4058={},_0xc7f9dc={};_0x5405a0<_0x469150[_0xc400('0x40')];_0x5405a0+=0x1){_0xdb4058=_0x469150[_0x5405a0];if(_[_0xc400('0x42')](_0x279bd7[_0xc400('0x51')][_0xdb4058['id']])){_0x279bd7['freshsalesAccounts'][_0xdb4058['id']]=new FreshsalesAccount(_0xdb4058);}else{_0x279bd7[_0xc400('0x3e')](_0x279bd7[_0xc400('0x51')][_0xdb4058['id']],_0xdb4058);}}}return _0x279bd7[_0xc400('0x51')];};};Realtime[_0xc400('0x3f')][_0xc400('0x52')]=function(){var _0x353b7e=this;return function(_0x2a5b57){for(var _0x4b680a=0x0;_0x4b680a<_0x2a5b57[_0xc400('0x40')];_0x4b680a+=0x1){_[_0xc400('0x53')](_0x353b7e[_0xc400('0x17')][_0x2a5b57[_0x4b680a][_0xc400('0x2a')]],_0x2a5b57[_0x4b680a]);}return _0x353b7e[_0xc400('0x17')];};};Realtime[_0xc400('0x3f')][_0xc400('0x54')]=function(){var _0x45315d=this;return function(_0x43f268){clearVoiceQueues(_0x45315d[_0xc400('0x17')]);if(_0x43f268){_0x43f268=_[_0xc400('0x55')](_0x43f268,_0xc400('0x56'));for(var _0xddc378 in _0x43f268){if(_0x43f268[_0xc400('0x26')](_0xddc378)){var _0xa419cc={};for(var _0x3b0318=0x0;_0x3b0318<_0x43f268[_0xddc378][_0xc400('0x40')];_0x3b0318+=0x1){var _0x28253a=_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x57')];if(_0x45315d[_0xc400('0x17')][_0x28253a]){if(_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x58')]){_0x45315d[_0xc400('0x17')][_0x28253a][_0xc400('0x33')]+=0x1;}if(_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x59')]){_0x45315d['voiceQueues'][_0x28253a][_0xc400('0x5a')]+=0x1;}_0x45315d[_0xc400('0x17')][_0x28253a][_0xc400('0x34')]+=moment(_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x5b')])[_0xc400('0x5c')](moment(_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x5d')]),_0xc400('0x5e'))||0x0;if(_0x3b0318===_0x43f268[_0xddc378][_0xc400('0x40')]-0x1){_0x45315d[_0xc400('0x17')][_0x28253a][_0xc400('0x2e')]+=moment(_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x5f')]||_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x60')]||_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x61')])[_0xc400('0x5c')](moment(_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x5d')]),_0xc400('0x5e'))||0x0;_0x45315d[_0xc400('0x17')][_0x28253a][_0xc400('0x2c')]+=0x1;if(_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x62')]){_0x45315d[_0xc400('0x17')][_0x28253a]['answered']+=0x1;_0x45315d[_0xc400('0x17')][_0x28253a][_0xc400('0x2f')]+=moment(_0x43f268[_0xddc378][_0x3b0318][_0xc400('0x5f')])['diff'](moment(_0x43f268[_0xddc378][_0x3b0318]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x45315d['voiceQueues'][_0x28253a]['sumDuration']+=_0x45315d[_0xc400('0x17')][_0x28253a][_0xc400('0x34')]||0x0;}}}}}}return _0x45315d[_0xc400('0x17')];};};Realtime['prototype'][_0xc400('0x63')]=function(){var _0x262d8c=this;return function(_0x2aab42){clearVoiceCallReports(_0x262d8c[_0xc400('0x1b')]);if(_0x2aab42){for(var _0x209fad=0x0;_0x209fad<_0x2aab42['length'];_0x209fad+=0x1){_0x262d8c[_0xc400('0x1b')][_0xc400('0x2c')]+=0x1;_0x262d8c[_0xc400('0x1b')][_0xc400('0x2e')]+=_0x2aab42[_0x209fad][_0xc400('0x64')];if(_0x2aab42[_0x209fad][_0xc400('0x65')]===_0xc400('0x66')){_0x262d8c['outbound'][_0xc400('0x2d')]+=0x1;_0x262d8c[_0xc400('0x1b')]['sumHoldTime']+=_0x2aab42[_0x209fad][_0xc400('0x64')]-_0x2aab42[_0x209fad][_0xc400('0x67')]||0x0;_0x262d8c[_0xc400('0x1b')][_0xc400('0x2f')]+=_0x2aab42[_0x209fad]['billableseconds'];}}}return _0x262d8c[_0xc400('0x1b')];};};Realtime[_0xc400('0x3f')]['initCampaigns']=function(){var _0x2860ca=this;return function(_0x2512f4){if(_0x2512f4){freeIsNotKey(_0x2512f4,_0x2860ca['campaigns'],'name');for(var _0x3693f3=0x0,_0x4a938c={};_0x3693f3<_0x2512f4[_0xc400('0x40')];_0x3693f3+=0x1){_0x4a938c=_0x2512f4[_0x3693f3];if(_[_0xc400('0x42')](_0x2860ca[_0xc400('0x19')][_0x4a938c[_0xc400('0x2a')]])){_0x2860ca[_0xc400('0x19')][_0x4a938c[_0xc400('0x2a')]]=new Campaign(_0x4a938c);}else{_0x2860ca[_0xc400('0x3e')](_0x2860ca[_0xc400('0x19')][_0x4a938c['name']],_0x4a938c);}}}return _0x2860ca[_0xc400('0x19')];};};Realtime[_0xc400('0x3f')][_0xc400('0x68')]=function(){var _0x4189f6=this;return function(_0x6edf15){if(_0x6edf15){freeIsNotKey(_0x6edf15,_0x4189f6[_0xc400('0x1c')],'id');for(var _0x2c5111=0x0,_0x57da1e={};_0x2c5111<_0x6edf15[_0xc400('0x40')];_0x2c5111+=0x1){_0x57da1e=_0x6edf15[_0x2c5111];if(_[_0xc400('0x42')](_0x4189f6[_0xc400('0x1c')][_0x57da1e['id']])){_0x4189f6[_0xc400('0x1c')][_0x57da1e['id']]=new VoiceExtension(_0x57da1e);}else{_0x4189f6[_0xc400('0x3e')](_0x4189f6[_0xc400('0x1c')][_0x57da1e['id']],_0x57da1e);}}}return _0x4189f6[_0xc400('0x1c')];};};Realtime[_0xc400('0x3f')][_0xc400('0x69')]=function(){var _0x597047=this;return function(_0x3be683){clearCampaigns(_0x597047[_0xc400('0x19')]);for(var _0x479f1d=0x0;_0x479f1d<_0x3be683[_0xc400('0x40')];_0x479f1d+=0x1){_['merge'](_0x597047['campaigns'][_0x3be683[_0x479f1d][_0xc400('0x2a')]],_0x3be683[_0x479f1d]);}return _0x597047[_0xc400('0x19')];};};Realtime[_0xc400('0x3f')][_0xc400('0x6a')]=function(){var _0x87ed84=this;return function(_0x37735c){if(_0x37735c){freeIsNotKey(_0x37735c,_0x87ed84[_0xc400('0x25')],'id');for(var _0x11f86a=0x0,_0x527e51={},_0x135530={};_0x11f86a<_0x37735c[_0xc400('0x40')];_0x11f86a+=0x1){_0x527e51=_0x37735c[_0x11f86a];if(_[_0xc400('0x42')](_0x87ed84[_0xc400('0x25')][_0x527e51['id']])){_0x87ed84['faxAccounts'][_0x527e51['id']]=new FaxAccount(_0x527e51);}else{_0x87ed84[_0xc400('0x3e')](_0x87ed84[_0xc400('0x25')][_0x527e51['id']],_0x527e51);}}}return _0x87ed84[_0xc400('0x25')];};};module[_0xc400('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 5078054..c731d20 100644 --- a/server/services/ami/report/index.js +++ b/server/services/ami/report/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc34d=['../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','bind','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','accountcode','interface','length','assigned','lastAssignedTo','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','voiceCallReport','destination','exten','type','lastapplication','lastdata','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','filename','createdAt','connectedlinename','connectedlinenum','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','bluebird','lodash','moment','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/memberReport'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc34d,0x102));var _0xdc34=function(_0x32002d,_0x247014){_0x32002d=_0x32002d-0x0;var _0x19ea80=_0xc34d[_0x32002d];return _0x19ea80;};'use strict';var BPromise=require(_0xdc34('0x0'));var _=require(_0xdc34('0x1'));var moment=require(_0xdc34('0x2'));var util=require('util');var config=require(_0xdc34('0x3'));var logger=require(_0xdc34('0x4'))(_0xdc34('0x5'));var ami=require(_0xdc34('0x6'));var RpcVoiceAgentReport=require(_0xdc34('0x7'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xdc34('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xdc34('0x9'));var RpcVoiceTransferReport=require(_0xdc34('0xa'));var VoiceQueueReport=require(_0xdc34('0xb'));var VoiceCallReport=require(_0xdc34('0xc'));var VoiceAgentReport=require(_0xdc34('0xd'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xdc34('0xe'));function Report(_0x75ad39){this['realtime']=_0x75ad39;this[_0xdc34('0xf')]=_0x75ad39[_0xdc34('0xf')];this[_0xdc34('0x10')]=_0x75ad39[_0xdc34('0x10')];}Report[_0xdc34('0x11')][_0xdc34('0x12')]=function(_0x58d1a6){var _0x53d8b9=new VoiceQueueReport(this['realtime']);var _0x49e3b5=new VoiceAgentReport(this[_0xdc34('0x13')]);var _0x56288c=new VoiceDialReport(this[_0xdc34('0x13')]);var _0x2f0098=new VoiceCallReport(this[_0xdc34('0x13')]);var _0x2ee617=new UserReport(this[_0xdc34('0x13')]);if(config['xdr']&&config[_0xdc34('0x14')]['disabled']){ami['on'](_0xdc34('0x15'),this[_0xdc34('0x16')]['bind'](this));ami['on'](_0xdc34('0x17'),this['voiceCallReport']['bind'](this));ami['on'](_0xdc34('0x18'),this[_0xdc34('0x19')]['bind'](this));ami['on'](_0xdc34('0x1a'),this[_0xdc34('0x1b')]['bind'](this));ami['on'](_0xdc34('0x1c'),this[_0xdc34('0x1d')][_0xdc34('0x1e')](this));ami['on'](_0xdc34('0x1f'),this[_0xdc34('0x20')]['bind'](this));}};Report[_0xdc34('0x11')][_0xdc34('0x21')]=function(_0x263c8b){var _0x46e0da=undefined;_0x46e0da=_[_0xdc34('0x22')](this['agents'],function(_0x191250){return _0x191250['accountcode']==_0x263c8b||_0x191250[_0xdc34('0x23')]==_0x263c8b;});if(_[_0xdc34('0x24')](_0x46e0da)){var _0x1d627f=_[_0xdc34('0x22')](this[_0xdc34('0x10')],function(_0x1c779d){return _0x1c779d[_0xdc34('0x25')]==_0x263c8b||_0x1c779d[_0xdc34('0x23')]==_0x263c8b;});if(_0x1d627f){_0x46e0da=_[_0xdc34('0x22')](this[_0xdc34('0xf')],function(_0xc09331){return _0xc09331[_0xdc34('0x26')]==util['format']('SIP/%s',_0x1d627f[_0xdc34('0x23')]);});}}return _0x46e0da;};Report[_0xdc34('0x11')]['voiceQueueReport']=function(_0x56a7b4){for(var _0x266fef=0x0;_0x266fef<_0x56a7b4[_0xdc34('0x27')];_0x266fef+=0x1){var _0x53b60a=this['findAgent'](_0x56a7b4[_0x266fef]['connectedlinenum']);if(_0x53b60a){_0x56a7b4[_0x266fef]['accountcode']=_0x53b60a[_0xdc34('0x25')];_0x56a7b4[_0x266fef][_0xdc34('0x28')]=!![];_0x56a7b4[_0x266fef][_0xdc34('0x29')]=_0x53b60a[_0xdc34('0x23')];_0x56a7b4[_0x266fef]['interface']=_[_0xdc34('0x24')](_0x53b60a['interface'])?util[_0xdc34('0x2a')](_0xdc34('0x2b'),_0x53b60a[_0xdc34('0x23')]):_0x53b60a[_0xdc34('0x26')];if(_0x56a7b4[_0x266fef][_0xdc34('0x2c')]){_0x56a7b4[_0x266fef][_0xdc34('0x2d')]=moment()[_0xdc34('0x2a')](_0xdc34('0x2e'));}if(_0x56a7b4[_0x266fef][_0xdc34('0x2f')]){_0x56a7b4[_0x266fef][_0xdc34('0x30')]=moment()[_0xdc34('0x2a')](_0xdc34('0x2e'));}RpcMemberReport[_0xdc34('0x16')](_0x56a7b4[_0x266fef]);}RpcVoiceQueueReport[_0xdc34('0x31')](_0x56a7b4[_0x266fef]);}};function extractCalleridNumber(_0x5e24ca){var _0xe5d263=_0x5e24ca['match'](/<(.*?)>/);return _0xe5d263?_0xe5d263[0x1]:_0x5e24ca;}Report[_0xdc34('0x11')][_0xdc34('0x32')]=function(_0x1f30ae){_0x1f30ae[_0xdc34('0x33')]=_0x1f30ae[_0xdc34('0x33')]||_0x1f30ae[_0xdc34('0x34')];if(_0x1f30ae[_0xdc34('0x35')]=='dialer'){_0x1f30ae[_0xdc34('0x36')]='queue';_0x1f30ae[_0xdc34('0x37')]=_0x1f30ae[_0xdc34('0x38')];if(_0x1f30ae[_0xdc34('0x39')]==_0xdc34('0x3a')){_0x1f30ae[_0xdc34('0x25')]='';_0x1f30ae['destination']=extractCalleridNumber(_0x1f30ae['callerid']);}else if(_0x1f30ae[_0xdc34('0x39')]==_0xdc34('0x3b')){if(_0x1f30ae[_0xdc34('0x33')]==_0xdc34('0x3c')){_0x1f30ae[_0xdc34('0x33')]=extractCalleridNumber(_0x1f30ae[_0xdc34('0x3d')]);_0x1f30ae[_0xdc34('0x3e')]=_0x1f30ae[_0xdc34('0x3f')];_0x1f30ae[_0xdc34('0x40')]=[_0x1f30ae[_0xdc34('0x41')],_0x1f30ae['channel']=_0x1f30ae[_0xdc34('0x40')]][0x0];_0x1f30ae[_0xdc34('0x42')]=_0x1f30ae[_0xdc34('0x3d')];}else{_0x1f30ae['destination']=_0x1f30ae[_0xdc34('0x3e')];_0x1f30ae[_0xdc34('0x3e')]=_0x1f30ae[_0xdc34('0x3f')];if(_0x1f30ae[_0xdc34('0x43')]==_0xdc34('0x44')){_0x1f30ae['accountcode']=_0x1f30ae['connectedlinenum'];}else{_0x1f30ae[_0xdc34('0x25')]='';}}}}else{_0x1f30ae[_0xdc34('0x42')]=util['format'](_0xdc34('0x45'),_0x1f30ae[_0xdc34('0x46')],_0x1f30ae[_0xdc34('0x3e')]);}RpcVoiceCallReport[_0xdc34('0x31')](_0x1f30ae);if(_0x1f30ae[_0xdc34('0x47')]){for(var _0x5870d1=0x0;_0x5870d1<_0x1f30ae[_0xdc34('0x48')][_0xdc34('0x27')];_0x5870d1+=0x1){_0x1f30ae['monitorFilename']=_0x1f30ae[_0xdc34('0x48')][_0x5870d1][_0xdc34('0x49')];_0x1f30ae['createdAt']=_0x1f30ae[_0xdc34('0x48')][_0x5870d1][_0xdc34('0x4a')];if(_0x1f30ae[_0xdc34('0x34')]==_0xdc34('0x3c')){_0x1f30ae[_0xdc34('0x3e')]=_0x1f30ae['connectedlinenum'];_0x1f30ae[_0xdc34('0x46')]=_0x1f30ae[_0xdc34('0x4b')];_0x1f30ae[_0xdc34('0x4c')]=_0x1f30ae[_0xdc34('0x25')];_0x1f30ae[_0xdc34('0x4b')]=_0x1f30ae[_0xdc34('0x4d')];_0x1f30ae[_0xdc34('0x34')]=_0x1f30ae[_0xdc34('0x3f')];}else if(_0x1f30ae[_0xdc34('0x34')]==_0xdc34('0x4e')){_0x1f30ae[_0xdc34('0x3e')]=_0x1f30ae['destination'];_0x1f30ae['exten']=_0x1f30ae['originatecalleridnum'];}RpcVoiceRecording[_0xdc34('0x31')](_0x1f30ae);}}};Report[_0xdc34('0x11')][_0xdc34('0x19')]=function(_0x2cf55a){if(_[_0xdc34('0x4f')](_0x2cf55a)){_0x2cf55a[_0xdc34('0x50')](function(_0x4e2c1e){RpcVoiceAgentReport[_0xdc34('0x31')](_0x4e2c1e);});}else{RpcVoiceAgentReport[_0xdc34('0x31')](_0x2cf55a);}};Report[_0xdc34('0x11')][_0xdc34('0x1b')]=function(_0x4872ce){RpcVoiceDialReport['create'](_0x4872ce);var _0x29b5d7=undefined;var _0x48f3d9=_0x4872ce['channel'];if(_[_0xdc34('0x51')](_0x48f3d9,_0xdc34('0x52'))){var _0x17f4c9=_0x48f3d9[_0xdc34('0x53')](_0x48f3d9[_0xdc34('0x54')]('/')+0x1,_0x48f3d9[_0xdc34('0x54')]('@'));_0x29b5d7=_[_0xdc34('0x22')](this[_0xdc34('0xf')],function(_0x56c375){return _0x56c375[_0xdc34('0x55')]==_0x17f4c9||_0x56c375[_0xdc34('0x56')]==_0x17f4c9||_0x56c375[_0xdc34('0x25')]==_0x17f4c9;});}else{var _0x17f4c9=_0x48f3d9['substring'](_0x48f3d9[_0xdc34('0x54')]('/')+0x1,_0x48f3d9[_0xdc34('0x57')]('-'));_0x29b5d7=this[_0xdc34('0x21')](_0x17f4c9);}if(_0x29b5d7){_0x4872ce[_0xdc34('0x26')]=_['isNil'](_0x29b5d7[_0xdc34('0x26')])?util[_0xdc34('0x2a')](_0xdc34('0x2b'),_0x29b5d7[_0xdc34('0x23')]):_0x29b5d7[_0xdc34('0x26')];_0x4872ce[_0xdc34('0x4d')]=_0x29b5d7['name'];_0x4872ce[_0xdc34('0x25')]=_0x29b5d7['accountcode'];RpcMemberReport['voiceDialReport'](_0x4872ce);}};Report['prototype'][_0xdc34('0x1d')]=function(_0x1c8e10){RpcVoiceTransferReport[_0xdc34('0x1d')](_0x1c8e10);};Report[_0xdc34('0x11')][_0xdc34('0x20')]=function(_0x46861f){RpcVoiceTransferReport[_0xdc34('0x20')](_0x46861f);};module[_0xdc34('0x58')]=Report; \ No newline at end of file +var _0x48f4=['realtime','agents','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','name','isNil','find','telephones','accountcode','interface','format','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','channel','startsWith','Local','substring','indexOf','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x48f4,0xe5));var _0x448f=function(_0x350744,_0x7d9b13){_0x350744=_0x350744-0x0;var _0x14ad39=_0x48f4[_0x350744];return _0x14ad39;};'use strict';var BPromise=require(_0x448f('0x0'));var _=require(_0x448f('0x1'));var moment=require(_0x448f('0x2'));var util=require(_0x448f('0x3'));var config=require(_0x448f('0x4'));var logger=require(_0x448f('0x5'))(_0x448f('0x6'));var ami=require(_0x448f('0x7'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x448f('0x8'));var RpcMemberReport=require(_0x448f('0x9'));var RpcVoiceQueueReport=require(_0x448f('0xa'));var RpcVoiceRecording=require(_0x448f('0xb'));var RpcVoiceTransferReport=require(_0x448f('0xc'));var VoiceQueueReport=require(_0x448f('0xd'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x448f('0xe'));var VoiceDialReport=require(_0x448f('0xf'));var UserReport=require(_0x448f('0x10'));function Report(_0x576336){this[_0x448f('0x11')]=_0x576336;this[_0x448f('0x12')]=_0x576336[_0x448f('0x12')];this['telephones']=_0x576336['telephones'];}Report[_0x448f('0x13')][_0x448f('0x14')]=function(_0x5ef436){var _0x1c2565=new VoiceQueueReport(this[_0x448f('0x11')]);var _0x45e06b=new VoiceAgentReport(this[_0x448f('0x11')]);var _0xe28224=new VoiceDialReport(this[_0x448f('0x11')]);var _0x7f71a=new VoiceCallReport(this[_0x448f('0x11')]);var _0x2b1c63=new UserReport(this['realtime']);if(config[_0x448f('0x15')]&&config['xdr'][_0x448f('0x16')]){ami['on']('custom:voiceQueueReport',this[_0x448f('0x17')][_0x448f('0x18')](this));ami['on'](_0x448f('0x19'),this[_0x448f('0x1a')][_0x448f('0x18')](this));ami['on'](_0x448f('0x1b'),this[_0x448f('0x1c')][_0x448f('0x18')](this));ami['on'](_0x448f('0x1d'),this[_0x448f('0x1e')]['bind'](this));ami['on'](_0x448f('0x1f'),this[_0x448f('0x20')][_0x448f('0x18')](this));ami['on']('attendedtransfer',this[_0x448f('0x21')][_0x448f('0x18')](this));}};Report['prototype'][_0x448f('0x22')]=function(_0x301160){var _0x46ca17=undefined;_0x46ca17=_['find'](this[_0x448f('0x12')],function(_0x200324){return _0x200324['accountcode']==_0x301160||_0x200324[_0x448f('0x23')]==_0x301160;});if(_[_0x448f('0x24')](_0x46ca17)){var _0x5d6b4a=_[_0x448f('0x25')](this[_0x448f('0x26')],function(_0x2153d8){return _0x2153d8[_0x448f('0x27')]==_0x301160||_0x2153d8[_0x448f('0x23')]==_0x301160;});if(_0x5d6b4a){_0x46ca17=_[_0x448f('0x25')](this[_0x448f('0x12')],function(_0x5dbf41){return _0x5dbf41[_0x448f('0x28')]==util[_0x448f('0x29')]('SIP/%s',_0x5d6b4a['name']);});}}return _0x46ca17;};Report['prototype'][_0x448f('0x17')]=function(_0x138e20){for(var _0x519659=0x0;_0x519659<_0x138e20[_0x448f('0x2a')];_0x519659+=0x1){var _0x3d5649=this[_0x448f('0x22')](_0x138e20[_0x519659][_0x448f('0x2b')]);if(_0x3d5649){_0x138e20[_0x519659][_0x448f('0x27')]=_0x3d5649[_0x448f('0x27')];_0x138e20[_0x519659][_0x448f('0x2c')]=!![];_0x138e20[_0x519659][_0x448f('0x2d')]=_0x3d5649[_0x448f('0x23')];_0x138e20[_0x519659]['interface']=_[_0x448f('0x24')](_0x3d5649[_0x448f('0x28')])?util[_0x448f('0x29')](_0x448f('0x2e'),_0x3d5649[_0x448f('0x23')]):_0x3d5649['interface'];if(_0x138e20[_0x519659][_0x448f('0x2f')]){_0x138e20[_0x519659]['queuecallercompleteAt']=moment()['format'](_0x448f('0x30'));}if(_0x138e20[_0x519659]['queuecallerexit']){_0x138e20[_0x519659][_0x448f('0x31')]=moment()[_0x448f('0x29')](_0x448f('0x30'));}RpcMemberReport[_0x448f('0x17')](_0x138e20[_0x519659]);}RpcVoiceQueueReport[_0x448f('0x32')](_0x138e20[_0x519659]);}};function extractCalleridNumber(_0x42168a){var _0x4fdc3d=_0x42168a[_0x448f('0x33')](/<(.*?)>/);return _0x4fdc3d?_0x4fdc3d[0x1]:_0x42168a;}Report[_0x448f('0x13')][_0x448f('0x1a')]=function(_0x2734ba){_0x2734ba[_0x448f('0x34')]=_0x2734ba[_0x448f('0x34')]||_0x2734ba[_0x448f('0x35')];if(_0x2734ba['type']=='dialer'){_0x2734ba[_0x448f('0x36')]=_0x448f('0x37');_0x2734ba[_0x448f('0x38')]=_0x2734ba[_0x448f('0x37')];if(_0x2734ba[_0x448f('0x39')]==_0x448f('0x3a')){_0x2734ba['accountcode']='';_0x2734ba['destination']=extractCalleridNumber(_0x2734ba[_0x448f('0x3b')]);}else if(_0x2734ba[_0x448f('0x39')]==_0x448f('0x3c')){if(_0x2734ba[_0x448f('0x34')]==_0x448f('0x3d')){_0x2734ba[_0x448f('0x34')]=extractCalleridNumber(_0x2734ba[_0x448f('0x3e')]);_0x2734ba[_0x448f('0x3f')]=_0x2734ba['originatecalleridnum'];_0x2734ba[_0x448f('0x40')]=[_0x2734ba['channel'],_0x2734ba['channel']=_0x2734ba[_0x448f('0x40')]][0x0];_0x2734ba[_0x448f('0x3b')]=_0x2734ba[_0x448f('0x3e')];}else{_0x2734ba[_0x448f('0x34')]=_0x2734ba[_0x448f('0x3f')];_0x2734ba[_0x448f('0x3f')]=_0x2734ba[_0x448f('0x41')];if(_0x2734ba['disposition']==_0x448f('0x42')){_0x2734ba[_0x448f('0x27')]=_0x2734ba[_0x448f('0x2b')];}else{_0x2734ba[_0x448f('0x27')]='';}}}}else{_0x2734ba[_0x448f('0x3b')]=util[_0x448f('0x29')](_0x448f('0x43'),_0x2734ba[_0x448f('0x44')],_0x2734ba[_0x448f('0x3f')]);}RpcVoiceCallReport['create'](_0x2734ba);if(_0x2734ba[_0x448f('0x45')]){for(var _0x11fb2c=0x0;_0x11fb2c<_0x2734ba['monitors']['length'];_0x11fb2c+=0x1){_0x2734ba[_0x448f('0x46')]=_0x2734ba['monitors'][_0x11fb2c]['filename'];_0x2734ba[_0x448f('0x47')]=_0x2734ba['monitors'][_0x11fb2c][_0x448f('0x47')];if(_0x2734ba[_0x448f('0x35')]==_0x448f('0x3d')){_0x2734ba[_0x448f('0x3f')]=_0x2734ba[_0x448f('0x2b')];_0x2734ba[_0x448f('0x44')]=_0x2734ba[_0x448f('0x48')];_0x2734ba[_0x448f('0x2b')]=_0x2734ba[_0x448f('0x27')];_0x2734ba[_0x448f('0x48')]=_0x2734ba[_0x448f('0x49')];_0x2734ba[_0x448f('0x35')]=_0x2734ba[_0x448f('0x41')];}else if(_0x2734ba[_0x448f('0x35')]==_0x448f('0x4a')){_0x2734ba['calleridnum']=_0x2734ba[_0x448f('0x34')];_0x2734ba[_0x448f('0x35')]=_0x2734ba[_0x448f('0x41')];}RpcVoiceRecording[_0x448f('0x32')](_0x2734ba);}}};Report[_0x448f('0x13')][_0x448f('0x1c')]=function(_0x467f1f){if(_[_0x448f('0x4b')](_0x467f1f)){_0x467f1f['forEach'](function(_0x228b4b){RpcVoiceAgentReport[_0x448f('0x32')](_0x228b4b);});}else{RpcVoiceAgentReport[_0x448f('0x32')](_0x467f1f);}};Report[_0x448f('0x13')][_0x448f('0x1e')]=function(_0x51a2ed){RpcVoiceDialReport[_0x448f('0x32')](_0x51a2ed);var _0x2552dc=undefined;var _0x32ee40=_0x51a2ed[_0x448f('0x4c')];if(_[_0x448f('0x4d')](_0x32ee40,_0x448f('0x4e'))){var _0x58409e=_0x32ee40[_0x448f('0x4f')](_0x32ee40['indexOf']('/')+0x1,_0x32ee40[_0x448f('0x50')]('@'));_0x2552dc=_[_0x448f('0x25')](this[_0x448f('0x12')],function(_0x275fdf){return _0x275fdf['mobile']==_0x58409e||_0x275fdf['phone']==_0x58409e||_0x275fdf[_0x448f('0x27')]==_0x58409e;});}else{var _0x58409e=_0x32ee40[_0x448f('0x4f')](_0x32ee40[_0x448f('0x50')]('/')+0x1,_0x32ee40['lastIndexOf']('-'));_0x2552dc=this[_0x448f('0x22')](_0x58409e);}if(_0x2552dc){_0x51a2ed[_0x448f('0x28')]=_[_0x448f('0x24')](_0x2552dc[_0x448f('0x28')])?util[_0x448f('0x29')]('SIP/%s',_0x2552dc[_0x448f('0x23')]):_0x2552dc[_0x448f('0x28')];_0x51a2ed[_0x448f('0x49')]=_0x2552dc['name'];_0x51a2ed[_0x448f('0x27')]=_0x2552dc[_0x448f('0x27')];RpcMemberReport[_0x448f('0x1e')](_0x51a2ed);}};Report['prototype']['blindTransfer']=function(_0x5ccb09){RpcVoiceTransferReport[_0x448f('0x20')](_0x5ccb09);};Report[_0x448f('0x13')][_0x448f('0x21')]=function(_0x27b847){RpcVoiceTransferReport[_0x448f('0x21')](_0x27b847);};module[_0x448f('0x51')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 2410c8b..f8da02e 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d0c=['name','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','telephone:save','trunk:save','startsWith','Local','substring','indexOf','mobile','peerstatus','peer','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','../../../config/environment','../../../config/logger','ami','defaults','localhost','redis','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','[loopSyncRealTimeShow]','error','inspect','prototype','catch','isNotNull','emit','find','username','omit','event','actionid','state','trunk:%s'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x2d0c,0xd8));var _0xc2d0=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x2d0c[_0x17882c];return _0x355a59;};'use strict';var _=require(_0xc2d0('0x0'));var moment=require(_0xc2d0('0x1'));var BPromise=require(_0xc2d0('0x2'));var util=require(_0xc2d0('0x3'));var Redis=require('ioredis');var config=require(_0xc2d0('0x4'));var logger=require(_0xc2d0('0x5'))(_0xc2d0('0x6'));var ami=require('../ami');config['redis']=_[_0xc2d0('0x7')](config['redis'],{'host':_0xc2d0('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc2d0('0x9')]));function UserReport(_0x2d6923){this[_0xc2d0('0xa')]=_0x2d6923[_0xc2d0('0xa')];this['agents']=_0x2d6923[_0xc2d0('0xb')];this[_0xc2d0('0xc')]=_0x2d6923[_0xc2d0('0xc')];ami['on'](_0xc2d0('0xd'),this[_0xc2d0('0xe')][_0xc2d0('0xf')](this));ami['on'](_0xc2d0('0x10'),this['syncRegistry']['bind'](this));ami['on'](_0xc2d0('0x11'),this[_0xc2d0('0x12')]['bind'](this));ami['on']('peerstatus',this[_0xc2d0('0x13')][_0xc2d0('0xf')](this));this[_0xc2d0('0x14')]();return BPromise[_0xc2d0('0x15')]()[_0xc2d0('0x16')](ami[_0xc2d0('0x17')]())[_0xc2d0('0x16')](ami[_0xc2d0('0x18')]())[_0xc2d0('0x16')](ami[_0xc2d0('0x19')]())['catch'](loggerCatch(_0xc2d0('0x1a')));}function loggerCatch(_0x264377){return function(_0x252216){logger[_0xc2d0('0x1b')](_0x264377,util[_0xc2d0('0x1c')](_0x252216,{'showHidden':![],'depth':null}));};}UserReport[_0xc2d0('0x1d')][_0xc2d0('0x14')]=function(){setInterval(function(){BPromise[_0xc2d0('0x15')]()['then'](ami[_0xc2d0('0x17')]())[_0xc2d0('0x16')](ami['actionDeviceStateList']())[_0xc2d0('0x16')](ami[_0xc2d0('0x19')]())[_0xc2d0('0x1e')](loggerCatch(_0xc2d0('0x1a')));},0x32c8);};UserReport[_0xc2d0('0x1d')][_0xc2d0('0x1f')]=function(_0x286415){return _0x286415!==null&&!_['isUndefined'](_0x286415);};UserReport[_0xc2d0('0x1d')]['emit']=function(_0x498d2f,_0x12b904,_0x24d837){io['to'](_0x498d2f)[_0xc2d0('0x20')](_0x12b904,_0x24d837);};UserReport[_0xc2d0('0x1d')][_0xc2d0('0xe')]=function(_0x3df661){try{if(this[_0xc2d0('0x1f')](_0x3df661)){var _0x5147c3=_[_0xc2d0('0x21')](this[_0xc2d0('0xa')],{'registry':_0x3df661[_0xc2d0('0x22')]});if(_0x5147c3){_0x3df661['stateRegistry']=_0x3df661['state'];_['merge'](_0x5147c3,_[_0xc2d0('0x23')](_0x3df661,[_0xc2d0('0x24'),_0xc2d0('0x25'),_0xc2d0('0x22'),_0xc2d0('0x26')]));this[_0xc2d0('0x20')](util['format'](_0xc2d0('0x27'),_0x5147c3[_0xc2d0('0x28')]),'trunk:save',_0x5147c3);}}}catch(_0x110abf){logger[_0xc2d0('0x1b')](_0xc2d0('0x29'),util[_0xc2d0('0x1c')](_0x110abf,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x53b493){try{if(this[_0xc2d0('0x1f')](_0x53b493)){if(this[_0xc2d0('0xb')][_0x53b493[_0xc2d0('0x2a')]]){if(!this[_0xc2d0('0xb')][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x2b')]||_0x53b493[_0xc2d0('0x26')][_0xc2d0('0x2c')]()==_0xc2d0('0x2d')){this[_0xc2d0('0xb')][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x2b')]=![];if(this[_0xc2d0('0xb')][_0x53b493[_0xc2d0('0x2a')]]['state']!==_0x53b493[_0xc2d0('0x26')][_0xc2d0('0x2c')]()){this[_0xc2d0('0xb')][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x2e')]=_[_0xc2d0('0x2f')](moment()[_0xc2d0('0x30')]('x'));}this['agents'][_0x53b493['device']]['state']=_0x53b493['state'][_0xc2d0('0x2c')]();this['agents'][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x31')](_0x53b493);}}else if(this[_0xc2d0('0xc')][_0x53b493[_0xc2d0('0x2a')]]){if(this[_0xc2d0('0xc')][_0x53b493[_0xc2d0('0x2a')]]['state']!==_0x53b493['state'][_0xc2d0('0x2c')]()){this['telephones'][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x2e')]=_[_0xc2d0('0x2f')](moment()[_0xc2d0('0x30')]('x'));}this[_0xc2d0('0xc')][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x26')]=_0x53b493[_0xc2d0('0x26')][_0xc2d0('0x2c')]();this[_0xc2d0('0x20')](util[_0xc2d0('0x30')](_0xc2d0('0x32'),this['telephones'][_0x53b493[_0xc2d0('0x2a')]]['name']),_0xc2d0('0x33'),this[_0xc2d0('0xc')][_0x53b493[_0xc2d0('0x2a')]]);}else if(this['trunks'][_0x53b493[_0xc2d0('0x2a')]]){if(this[_0xc2d0('0xa')][_0x53b493[_0xc2d0('0x2a')]]['state']!==_0x53b493['state']['toLowerCase']()){this['trunks'][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x2e')]=_[_0xc2d0('0x2f')](moment()[_0xc2d0('0x30')]('x'));}this[_0xc2d0('0xa')][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x26')]=_0x53b493[_0xc2d0('0x26')][_0xc2d0('0x2c')]();this[_0xc2d0('0x20')](util[_0xc2d0('0x30')](_0xc2d0('0x27'),this['trunks'][_0x53b493[_0xc2d0('0x2a')]][_0xc2d0('0x28')]),_0xc2d0('0x34'),this[_0xc2d0('0xa')][_0x53b493[_0xc2d0('0x2a')]]);}else if(_['startsWith'](_0x53b493[_0xc2d0('0x2a')],'Queue')){}else if(_[_0xc2d0('0x35')](_0x53b493[_0xc2d0('0x2a')],_0xc2d0('0x36'))){var _0x38a1c3=_0x53b493[_0xc2d0('0x2a')];var _0x44490b=_0x38a1c3[_0xc2d0('0x37')](_0x38a1c3[_0xc2d0('0x38')]('/')+0x1,_0x38a1c3['indexOf']('@'));var _0x180477=_[_0xc2d0('0x21')](this[_0xc2d0('0xb')],function(_0x5ce4b3){return _0x5ce4b3[_0xc2d0('0x39')]==_0x44490b||_0x5ce4b3['phone']==_0x44490b||_0x5ce4b3['accountcode']==_0x44490b;});if(_0x180477){if(_0x180477['state']!==_0x53b493['state'][_0xc2d0('0x2c')]()){_0x180477[_0xc2d0('0x2e')]=_[_0xc2d0('0x2f')](moment()[_0xc2d0('0x30')]('x'));}_0x180477[_0xc2d0('0x26')]=_0x53b493[_0xc2d0('0x26')][_0xc2d0('0x2c')]();_0x180477[_0xc2d0('0x2b')]=!![];_0x180477[_0xc2d0('0x31')](_0x53b493);}}else{}}}catch(_0x3b95bb){logger['error']('[syncDeviceState][UserReport]',util[_0xc2d0('0x1c')](_0x3b95bb,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xc2d0('0x13')]=function(_0xefb7f9){try{if(this[_0xc2d0('0x1f')](_0xefb7f9)&&this['isNotNull'](_0xefb7f9[_0xc2d0('0x3a')])){if(this[_0xc2d0('0xb')][_0xefb7f9[_0xc2d0('0x3b')]]){if(!this['agents'][_0xefb7f9[_0xc2d0('0x3b')]][_0xc2d0('0x2b')]||_0xefb7f9[_0xc2d0('0x3a')][_0xc2d0('0x2c')]()=='registered'){this[_0xc2d0('0xb')][_0xefb7f9['peer']][_0xc2d0('0x2b')]=![];this[_0xc2d0('0xb')][_0xefb7f9['peer']][_0xc2d0('0x3c')]=_0xefb7f9['peerstatus']['toLowerCase']();this[_0xc2d0('0xb')][_0xefb7f9[_0xc2d0('0x3b')]][_0xc2d0('0x3d')]=_0xefb7f9[_0xc2d0('0x3d')];this[_0xc2d0('0xb')][_0xefb7f9[_0xc2d0('0x3b')]]['updateStatusRealtime'](_0xefb7f9);}}else if(this[_0xc2d0('0xc')][_0xefb7f9[_0xc2d0('0x3b')]]){this[_0xc2d0('0xc')][_0xefb7f9['peer']]['status']=_0xefb7f9[_0xc2d0('0x3a')][_0xc2d0('0x2c')]();this[_0xc2d0('0xc')][_0xefb7f9[_0xc2d0('0x3b')]][_0xc2d0('0x3d')]=_0xefb7f9[_0xc2d0('0x3d')];this[_0xc2d0('0x20')](util[_0xc2d0('0x30')](_0xc2d0('0x32'),this[_0xc2d0('0xc')][_0xefb7f9[_0xc2d0('0x3b')]]['name']),_0xc2d0('0x33'),this[_0xc2d0('0xc')][_0xefb7f9[_0xc2d0('0x3b')]]);}else if(this[_0xc2d0('0xa')][_0xefb7f9['peer']]){this['trunks'][_0xefb7f9[_0xc2d0('0x3b')]][_0xc2d0('0x3c')]=_0xefb7f9[_0xc2d0('0x3a')][_0xc2d0('0x2c')]();this['trunks'][_0xefb7f9[_0xc2d0('0x3b')]][_0xc2d0('0x3d')]=_0xefb7f9[_0xc2d0('0x3d')];this[_0xc2d0('0x20')](util[_0xc2d0('0x30')]('trunk:%s',this[_0xc2d0('0xa')][_0xefb7f9[_0xc2d0('0x3b')]][_0xc2d0('0x28')]),_0xc2d0('0x34'),this[_0xc2d0('0xa')][_0xefb7f9[_0xc2d0('0x3b')]]);}else{}}}catch(_0x229b37){logger[_0xc2d0('0x1b')](_0xc2d0('0x3e'),util['inspect'](_0x229b37,{'showHidden':![],'depth':null}));}};module[_0xc2d0('0x3f')]=UserReport; \ No newline at end of file +var _0x2d2f=['Local','substring','indexOf','mobile','phone','[syncDeviceState][UserReport]','peer','registered','status','address','telephone:%s','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/logger','ami','redis','localhost','socket.io-emitter','trunks','telephones','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','actionSipShowRegistry','actionDeviceStateList','then','catch','[loopSyncRealTimeShow]','error','inspect','prototype','actionSipPeerStatus','isUndefined','emit','isNotNull','find','username','state','merge','omit','event','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','syncDeviceState','agents','device','local','inuse','toLowerCase','toNumber','updateStatusRealtime','stateTime','telephone:save','startsWith'];(function(_0x5dac46,_0x28e9dc){var _0x51095c=function(_0x5918c6){while(--_0x5918c6){_0x5dac46['push'](_0x5dac46['shift']());}};_0x51095c(++_0x28e9dc);}(_0x2d2f,0x199));var _0xf2d2=function(_0xebaafc,_0x186ef8){_0xebaafc=_0xebaafc-0x0;var _0x2690ee=_0x2d2f[_0xebaafc];return _0x2690ee;};'use strict';var _=require(_0xf2d2('0x0'));var moment=require(_0xf2d2('0x1'));var BPromise=require(_0xf2d2('0x2'));var util=require(_0xf2d2('0x3'));var Redis=require(_0xf2d2('0x4'));var config=require('../../../config/environment');var logger=require(_0xf2d2('0x5'))(_0xf2d2('0x6'));var ami=require('../ami');config['redis']=_['defaults'](config[_0xf2d2('0x7')],{'host':_0xf2d2('0x8'),'port':0x18eb});var io=require(_0xf2d2('0x9'))(new Redis(config[_0xf2d2('0x7')]));function UserReport(_0x719364){this[_0xf2d2('0xa')]=_0x719364['trunks'];this['agents']=_0x719364['agents'];this[_0xf2d2('0xb')]=_0x719364[_0xf2d2('0xb')];ami['on']('registryentry',this[_0xf2d2('0xc')]['bind'](this));ami['on']('registry',this['syncRegistry'][_0xf2d2('0xd')](this));ami['on'](_0xf2d2('0xe'),this['syncDeviceState'][_0xf2d2('0xd')](this));ami['on'](_0xf2d2('0xf'),this[_0xf2d2('0x10')][_0xf2d2('0xd')](this));this[_0xf2d2('0x11')]();return BPromise[_0xf2d2('0x12')]()['then'](ami[_0xf2d2('0x13')]())['then'](ami[_0xf2d2('0x14')]())[_0xf2d2('0x15')](ami['actionSipPeerStatus']())[_0xf2d2('0x16')](loggerCatch(_0xf2d2('0x17')));}function loggerCatch(_0x279777){return function(_0xdf5ff8){logger[_0xf2d2('0x18')](_0x279777,util[_0xf2d2('0x19')](_0xdf5ff8,{'showHidden':![],'depth':null}));};}UserReport[_0xf2d2('0x1a')][_0xf2d2('0x11')]=function(){setInterval(function(){BPromise[_0xf2d2('0x12')]()[_0xf2d2('0x15')](ami['actionSipShowRegistry']())[_0xf2d2('0x15')](ami[_0xf2d2('0x14')]())[_0xf2d2('0x15')](ami[_0xf2d2('0x1b')]())['catch'](loggerCatch(_0xf2d2('0x17')));},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x145830){return _0x145830!==null&&!_[_0xf2d2('0x1c')](_0x145830);};UserReport[_0xf2d2('0x1a')][_0xf2d2('0x1d')]=function(_0x52698f,_0x51d292,_0x4d4ea0){io['to'](_0x52698f)[_0xf2d2('0x1d')](_0x51d292,_0x4d4ea0);};UserReport[_0xf2d2('0x1a')]['syncRegistry']=function(_0x40f26a){try{if(this[_0xf2d2('0x1e')](_0x40f26a)){var _0x4bd33a=_[_0xf2d2('0x1f')](this[_0xf2d2('0xa')],{'registry':_0x40f26a[_0xf2d2('0x20')]});if(_0x4bd33a){_0x40f26a['stateRegistry']=_0x40f26a[_0xf2d2('0x21')];_[_0xf2d2('0x22')](_0x4bd33a,_[_0xf2d2('0x23')](_0x40f26a,[_0xf2d2('0x24'),'actionid',_0xf2d2('0x20'),'state']));this[_0xf2d2('0x1d')](util[_0xf2d2('0x25')](_0xf2d2('0x26'),_0x4bd33a[_0xf2d2('0x27')]),_0xf2d2('0x28'),_0x4bd33a);}}}catch(_0x9bab3f){logger[_0xf2d2('0x18')](_0xf2d2('0x29'),util[_0xf2d2('0x19')](_0x9bab3f,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xf2d2('0x2a')]=function(_0x518f66){try{if(this[_0xf2d2('0x1e')](_0x518f66)){if(this[_0xf2d2('0x2b')][_0x518f66[_0xf2d2('0x2c')]]){if(!this['agents'][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x2d')]||_0x518f66['state']['toLowerCase']()==_0xf2d2('0x2e')){this['agents'][_0x518f66['device']]['local']=![];if(this[_0xf2d2('0x2b')][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x21')]!==_0x518f66[_0xf2d2('0x21')][_0xf2d2('0x2f')]()){this[_0xf2d2('0x2b')][_0x518f66[_0xf2d2('0x2c')]]['stateTime']=_[_0xf2d2('0x30')](moment()['format']('x'));}this[_0xf2d2('0x2b')][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x21')]=_0x518f66[_0xf2d2('0x21')]['toLowerCase']();this[_0xf2d2('0x2b')][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x31')](_0x518f66);}}else if(this[_0xf2d2('0xb')][_0x518f66[_0xf2d2('0x2c')]]){if(this[_0xf2d2('0xb')][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x21')]!==_0x518f66[_0xf2d2('0x21')]['toLowerCase']()){this['telephones'][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x32')]=_[_0xf2d2('0x30')](moment()[_0xf2d2('0x25')]('x'));}this[_0xf2d2('0xb')][_0x518f66['device']][_0xf2d2('0x21')]=_0x518f66[_0xf2d2('0x21')]['toLowerCase']();this['emit'](util[_0xf2d2('0x25')]('telephone:%s',this[_0xf2d2('0xb')][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x27')]),_0xf2d2('0x33'),this[_0xf2d2('0xb')][_0x518f66[_0xf2d2('0x2c')]]);}else if(this[_0xf2d2('0xa')][_0x518f66[_0xf2d2('0x2c')]]){if(this[_0xf2d2('0xa')][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x21')]!==_0x518f66[_0xf2d2('0x21')][_0xf2d2('0x2f')]()){this[_0xf2d2('0xa')][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x32')]=_[_0xf2d2('0x30')](moment()['format']('x'));}this[_0xf2d2('0xa')][_0x518f66['device']][_0xf2d2('0x21')]=_0x518f66['state'][_0xf2d2('0x2f')]();this[_0xf2d2('0x1d')](util[_0xf2d2('0x25')]('trunk:%s',this[_0xf2d2('0xa')][_0x518f66[_0xf2d2('0x2c')]][_0xf2d2('0x27')]),_0xf2d2('0x28'),this[_0xf2d2('0xa')][_0x518f66[_0xf2d2('0x2c')]]);}else if(_['startsWith'](_0x518f66['device'],'Queue')){}else if(_[_0xf2d2('0x34')](_0x518f66[_0xf2d2('0x2c')],_0xf2d2('0x35'))){var _0x94a718=_0x518f66[_0xf2d2('0x2c')];var _0x161924=_0x94a718[_0xf2d2('0x36')](_0x94a718[_0xf2d2('0x37')]('/')+0x1,_0x94a718[_0xf2d2('0x37')]('@'));var _0xf55a30=_['find'](this[_0xf2d2('0x2b')],function(_0x3aa0ea){return _0x3aa0ea[_0xf2d2('0x38')]==_0x161924||_0x3aa0ea[_0xf2d2('0x39')]==_0x161924||_0x3aa0ea['accountcode']==_0x161924;});if(_0xf55a30){if(_0xf55a30[_0xf2d2('0x21')]!==_0x518f66[_0xf2d2('0x21')][_0xf2d2('0x2f')]()){_0xf55a30[_0xf2d2('0x32')]=_['toNumber'](moment()[_0xf2d2('0x25')]('x'));}_0xf55a30['state']=_0x518f66[_0xf2d2('0x21')][_0xf2d2('0x2f')]();_0xf55a30['local']=!![];_0xf55a30['updateStatusRealtime'](_0x518f66);}}else{}}}catch(_0x2145ad){logger[_0xf2d2('0x18')](_0xf2d2('0x3a'),util[_0xf2d2('0x19')](_0x2145ad,{'showHidden':![],'depth':null}));}};UserReport[_0xf2d2('0x1a')][_0xf2d2('0x10')]=function(_0x158c57){try{if(this['isNotNull'](_0x158c57)&&this[_0xf2d2('0x1e')](_0x158c57['peerstatus'])){if(this[_0xf2d2('0x2b')][_0x158c57[_0xf2d2('0x3b')]]){if(!this['agents'][_0x158c57[_0xf2d2('0x3b')]]['local']||_0x158c57[_0xf2d2('0xf')][_0xf2d2('0x2f')]()==_0xf2d2('0x3c')){this['agents'][_0x158c57['peer']][_0xf2d2('0x2d')]=![];this[_0xf2d2('0x2b')][_0x158c57[_0xf2d2('0x3b')]][_0xf2d2('0x3d')]=_0x158c57['peerstatus']['toLowerCase']();this['agents'][_0x158c57['peer']]['address']=_0x158c57[_0xf2d2('0x3e')];this[_0xf2d2('0x2b')][_0x158c57[_0xf2d2('0x3b')]]['updateStatusRealtime'](_0x158c57);}}else if(this[_0xf2d2('0xb')][_0x158c57[_0xf2d2('0x3b')]]){this['telephones'][_0x158c57[_0xf2d2('0x3b')]]['status']=_0x158c57[_0xf2d2('0xf')][_0xf2d2('0x2f')]();this[_0xf2d2('0xb')][_0x158c57['peer']]['address']=_0x158c57[_0xf2d2('0x3e')];this[_0xf2d2('0x1d')](util[_0xf2d2('0x25')](_0xf2d2('0x3f'),this[_0xf2d2('0xb')][_0x158c57[_0xf2d2('0x3b')]]['name']),_0xf2d2('0x33'),this[_0xf2d2('0xb')][_0x158c57[_0xf2d2('0x3b')]]);}else if(this[_0xf2d2('0xa')][_0x158c57[_0xf2d2('0x3b')]]){this[_0xf2d2('0xa')][_0x158c57['peer']][_0xf2d2('0x3d')]=_0x158c57['peerstatus']['toLowerCase']();this[_0xf2d2('0xa')][_0x158c57[_0xf2d2('0x3b')]][_0xf2d2('0x3e')]=_0x158c57[_0xf2d2('0x3e')];this[_0xf2d2('0x1d')](util[_0xf2d2('0x25')](_0xf2d2('0x26'),this[_0xf2d2('0xa')][_0x158c57[_0xf2d2('0x3b')]][_0xf2d2('0x27')]),_0xf2d2('0x28'),this[_0xf2d2('0xa')][_0x158c57[_0xf2d2('0x3b')]]);}else{}}}catch(_0x10cdf3){logger[_0xf2d2('0x18')](_0xf2d2('0x40'),util['inspect'](_0x10cdf3,{'showHidden':![],'depth':null}));}};module[_0xf2d2('0x41')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index f836bc1..f2ab262 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2751=['variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','seconds','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','exports','lodash','moment','ioredis','ami','../ami','redis','defaults','localhost','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','channels','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','merge','destuniqueid','omit','privilege','custom:agentcalled','user:%s','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentcomplete','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','error','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','agentcompleteAt','complete','talktime','transfer','agent','agentacw','acwtime','interface','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','addVariable'];(function(_0x42e152,_0x58ba37){var _0x132349=function(_0x25f919){while(--_0x25f919){_0x42e152['push'](_0x42e152['shift']());}};_0x132349(++_0x58ba37);}(_0x2751,0x11b));var _0x1275=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2751[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1275('0x0'));var moment=require(_0x1275('0x1'));var util=require('util');var Redis=require(_0x1275('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x1275('0x3'));var ami=require(_0x1275('0x4'));config[_0x1275('0x5')]=_[_0x1275('0x6')](config[_0x1275('0x5')],{'host':_0x1275('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1275('0x5')]));function VoiceAgentReport(_0x4c893c){this['channels']={};this[_0x1275('0x8')]=_0x4c893c[_0x1275('0x8')];this[_0x1275('0x9')]=_0x4c893c[_0x1275('0x9')];this[_0x1275('0xa')]={};ami['on'](_0x1275('0xb'),this[_0x1275('0xc')]['bind'](this));ami['on'](_0x1275('0xd'),this[_0x1275('0xe')][_0x1275('0xf')](this));ami['on'](_0x1275('0x10'),this[_0x1275('0x11')][_0x1275('0xf')](this));ami['on'](_0x1275('0x12'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('agentcomplete',this[_0x1275('0x13')][_0x1275('0xf')](this));ami['on'](_0x1275('0x14'),this['syncVarSet'][_0x1275('0xf')](this));ami['on'](_0x1275('0x15'),this[_0x1275('0x16')]['bind'](this));ami['on'](_0x1275('0x17'),this[_0x1275('0x18')][_0x1275('0xf')](this));ami['on']('musiconholdstop',this[_0x1275('0x19')][_0x1275('0xf')](this));ami['on']('attendedtransfer',this[_0x1275('0x1a')][_0x1275('0xf')](this));ami['on'](_0x1275('0x1b'),this[_0x1275('0x1c')][_0x1275('0xf')](this));}VoiceAgentReport[_0x1275('0x1d')]['emit']=function(_0x2d3bf7,_0x53ae8a,_0x3c0bcd){io['to'](_0x2d3bf7)[_0x1275('0x1e')](_0x53ae8a,_0x3c0bcd);};VoiceAgentReport[_0x1275('0x1d')][_0x1275('0x1f')]=function(_0x1e702a){return _0x1e702a!==null&&!_['isUndefined'](_0x1e702a);};VoiceAgentReport[_0x1275('0x1d')][_0x1275('0xc')]=function(_0x3d291a){try{if(this[_0x1275('0x1f')](_0x3d291a)){if(_[_0x1275('0x20')](this[_0x1275('0x21')][_0x3d291a[_0x1275('0x22')]])){this[_0x1275('0x21')][_0x3d291a[_0x1275('0x22')]]={};}if(_[_0x1275('0x20')](this[_0x1275('0x21')][_0x3d291a[_0x1275('0x22')]][_0x3d291a['destuniqueid']])){this[_0x1275('0x21')][_0x3d291a['uniqueid']][_0x3d291a['destuniqueid']]={'agentcalledAt':moment()[_0x1275('0x23')](_0x1275('0x24')),'lastevent':_0x1275('0x25'),'variables':this[_0x1275('0xa')][_0x3d291a[_0x1275('0x22')]],'type':this[_0x1275('0x8')][_0x3d291a[_0x1275('0x26')]]?this['voiceQueues'][_0x3d291a['queue']]['type']||_0x1275('0x27'):_0x1275('0x27')};}_[_0x1275('0x28')](this[_0x1275('0x21')][_0x3d291a['uniqueid']][_0x3d291a[_0x1275('0x29')]],_[_0x1275('0x2a')](_0x3d291a,['event',_0x1275('0x2b')]));ami[_0x1275('0x1e')](_0x1275('0x2c'),this['channels'][_0x3d291a[_0x1275('0x22')]][_0x3d291a['destuniqueid']]);this[_0x1275('0x1e')](util[_0x1275('0x23')](_0x1275('0x2d'),_0x3d291a[_0x1275('0x2e')]),_0x1275('0x2f'),this[_0x1275('0x21')][_0x3d291a[_0x1275('0x22')]][_0x3d291a[_0x1275('0x29')]]);}}catch(_0x577dcc){logger['error'](_0x1275('0x30'),util[_0x1275('0x31')](_0x577dcc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')]['syncAgentConnect']=function(_0x5c7d7b){try{if(this[_0x1275('0x1f')](_0x5c7d7b)){if(this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]]){for(var _0x1bf979 in this[_0x1275('0x21')][_0x5c7d7b['uniqueid']]){if(this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1275('0x32')](_0x1bf979)){if(_0x5c7d7b[_0x1275('0x29')]===_0x1bf979){this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979]['agentconnectAt']=moment()[_0x1275('0x23')](_0x1275('0x24'));this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979][_0x1275('0x33')]=_0x1275('0x34');this[_0x1275('0x21')][_0x5c7d7b['uniqueid']][_0x1bf979]['holdtime']=_0x5c7d7b[_0x1275('0x35')];this['channels'][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979][_0x1275('0x36')]=_0x5c7d7b[_0x1275('0x36')];this['channels'][_0x5c7d7b['uniqueid']][_0x1bf979]['connectedlinename']=_0x5c7d7b[_0x1275('0x37')];this[_0x1275('0x21')][_0x5c7d7b['uniqueid']][_0x1bf979][_0x1275('0x38')]=_0x5c7d7b['destchannelstate'];this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979][_0x1275('0x39')]=_0x5c7d7b[_0x1275('0x39')];_[_0x1275('0x28')](this[_0x1275('0x9')][_0x5c7d7b['interface']],_[_0x1275('0x3a')](_0x5c7d7b,[_0x1275('0x26'),_0x1275('0x3b')]));this[_0x1275('0x1e')](util['format'](_0x1275('0x2d'),_0x5c7d7b[_0x1275('0x2e')]),_0x1275('0x3c'),this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x5c7d7b[_0x1275('0x29')]]);ami[_0x1275('0x1e')](_0x1275('0x3d'),this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979]);}else if(!this['channels'][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979]['agentringnoanswer']&&!this[_0x1275('0x21')][_0x5c7d7b['uniqueid']][_0x1bf979][_0x1275('0x3e')]){this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979][_0x1275('0x10')]=!![];this[_0x1275('0x21')][_0x5c7d7b['uniqueid']][_0x1bf979][_0x1275('0x3f')]=moment()['format'](_0x1275('0x24'));this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979][_0x1275('0x40')]=_0x1275('0x41');this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979][_0x1275('0x33')]='answered_elsewhere';this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979]['answeredelsewheredestinationuniqueid']=_0x5c7d7b[_0x1275('0x29')];this[_0x1275('0x21')][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979][_0x1275('0x42')]=_0x5c7d7b[_0x1275('0x2e')];ami[_0x1275('0x1e')]('custom:agentansweredelsewhere',this['channels'][_0x5c7d7b[_0x1275('0x22')]][_0x1bf979]);}}}}}}catch(_0x660352){logger[_0x1275('0x43')](_0x1275('0x44'),util[_0x1275('0x31')](_0x660352,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')]['syncAgentRingNoAnswer']=function(_0x5be337){try{if(this[_0x1275('0x1f')](_0x5be337)){if(this['channels'][_0x5be337[_0x1275('0x22')]]&&this[_0x1275('0x21')][_0x5be337[_0x1275('0x22')]][_0x5be337[_0x1275('0x29')]]){this[_0x1275('0x21')][_0x5be337[_0x1275('0x22')]][_0x5be337[_0x1275('0x29')]][_0x1275('0x10')]=!![];this[_0x1275('0x21')][_0x5be337[_0x1275('0x22')]][_0x5be337[_0x1275('0x29')]]['agentringnoanswerAt']=moment()['format'](_0x1275('0x24'));this[_0x1275('0x21')][_0x5be337[_0x1275('0x22')]][_0x5be337[_0x1275('0x29')]][_0x1275('0x40')]='rejected';this[_0x1275('0x21')][_0x5be337[_0x1275('0x22')]][_0x5be337['destuniqueid']][_0x1275('0x33')]=_0x1275('0x45');ami[_0x1275('0x1e')](_0x1275('0x46'),this[_0x1275('0x21')][_0x5be337['uniqueid']][_0x5be337[_0x1275('0x29')]]);}}}catch(_0x4c4ef1){logger[_0x1275('0x43')](_0x1275('0x47'),util['inspect'](_0x4c4ef1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')][_0x1275('0x48')]=function(_0xa6ac9d){try{if(this[_0x1275('0x1f')](_0xa6ac9d)){if(this[_0x1275('0x21')][_0xa6ac9d['uniqueid']]){for(var _0x48c1ae in this[_0x1275('0x21')][_0xa6ac9d[_0x1275('0x22')]]){if(this[_0x1275('0x21')][_0xa6ac9d[_0x1275('0x22')]][_0x1275('0x32')](_0x48c1ae)&&!this[_0x1275('0x21')][_0xa6ac9d[_0x1275('0x22')]][_0x48c1ae][_0x1275('0x10')]&&!this[_0x1275('0x21')][_0xa6ac9d[_0x1275('0x22')]][_0x48c1ae][_0x1275('0x3e')]){this[_0x1275('0x21')][_0xa6ac9d[_0x1275('0x22')]][_0x48c1ae][_0x1275('0x10')]=!![];this[_0x1275('0x21')][_0xa6ac9d['uniqueid']][_0x48c1ae][_0x1275('0x3f')]=moment()['format'](_0x1275('0x24'));this[_0x1275('0x21')][_0xa6ac9d[_0x1275('0x22')]][_0x48c1ae]['reason']='abandoned';this[_0x1275('0x21')][_0xa6ac9d[_0x1275('0x22')]][_0x48c1ae][_0x1275('0x33')]='abandoned';ami[_0x1275('0x1e')](_0x1275('0x49'),this[_0x1275('0x21')][_0xa6ac9d['uniqueid']][_0x48c1ae]);}}}}}catch(_0x553552){logger[_0x1275('0x43')](_0x1275('0x4a'),util[_0x1275('0x31')](_0x553552,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')]['syncAgentComplete']=function(_0x1d8217){try{if(this[_0x1275('0x1f')](_0x1d8217)){if(this[_0x1275('0x21')][_0x1d8217[_0x1275('0x22')]]){for(var _0x72232f in this[_0x1275('0x21')][_0x1d8217['uniqueid']]){if(this[_0x1275('0x21')][_0x1d8217['uniqueid']][_0x1275('0x32')](_0x72232f)){if(this[_0x1275('0x21')][_0x1d8217[_0x1275('0x22')]][_0x72232f][_0x1275('0x4b')]&&!this[_0x1275('0x21')][_0x1d8217[_0x1275('0x22')]][_0x72232f][_0x1275('0x3e')]){this[_0x1275('0x21')][_0x1d8217[_0x1275('0x22')]][_0x72232f][_0x1275('0x3e')]=!![];this['channels'][_0x1d8217[_0x1275('0x22')]][_0x72232f][_0x1275('0x4c')]=moment()[_0x1275('0x23')](_0x1275('0x24'));this['channels'][_0x1d8217[_0x1275('0x22')]][_0x72232f][_0x1275('0x33')]=_0x1275('0x4d');this[_0x1275('0x21')][_0x1d8217[_0x1275('0x22')]][_0x72232f][_0x1275('0x4e')]=_0x1d8217[_0x1275('0x4e')];this[_0x1275('0x21')][_0x1d8217['uniqueid']][_0x72232f][_0x1275('0x40')]=_0x1d8217[_0x1275('0x40')]==_0x1275('0x4f')?_0x1275('0x50'):_0x1d8217[_0x1275('0x40')];if(this[_0x1275('0x8')][_0x1d8217[_0x1275('0x26')]]&&this[_0x1275('0x8')][_0x1d8217[_0x1275('0x26')]]['acw']){this[_0x1275('0x21')][_0x1d8217[_0x1275('0x22')]][_0x72232f][_0x1275('0x51')]=!![];this[_0x1275('0x21')][_0x1d8217[_0x1275('0x22')]][_0x72232f][_0x1275('0x52')]=this[_0x1275('0x8')][_0x1d8217['queue']]['acwTimeout'];}this[_0x1275('0x9')][_0x1d8217[_0x1275('0x53')]]=_[_0x1275('0x2a')](this['agents'][_0x1d8217[_0x1275('0x53')]],[_0x1275('0x26'),_0x1275('0x3b')]);this['emit'](util[_0x1275('0x23')](_0x1275('0x2d'),_0x1d8217['membername']),_0x1275('0x54'),this[_0x1275('0x21')][_0x1d8217['uniqueid']][_0x72232f]);ami[_0x1275('0x1e')](_0x1275('0x55'),this[_0x1275('0x21')][_0x1d8217[_0x1275('0x22')]][_0x72232f]);}}}}}}catch(_0x39521c){logger[_0x1275('0x43')](_0x1275('0x56'),util['inspect'](_0x39521c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')][_0x1275('0x57')]=function(_0x544d29){try{if(this['isNotNull'](_0x544d29)){this[_0x1275('0x58')](_0x544d29[_0x1275('0x22')],_['keys'](_0x544d29[_0x1275('0x59')])[0x0],_0x544d29[_0x1275('0x5a')]);if(this[_0x1275('0x21')][_0x544d29[_0x1275('0x22')]]){for(var _0x1a3a71 in this[_0x1275('0x21')][_0x544d29[_0x1275('0x22')]]){if(this[_0x1275('0x21')][_0x544d29[_0x1275('0x22')]][_0x1275('0x32')](_0x1a3a71)){if(_[_0x1275('0x20')](this[_0x1275('0x21')][_0x544d29[_0x1275('0x22')]][_0x1a3a71][_0x1275('0xa')])){this[_0x1275('0x21')][_0x544d29[_0x1275('0x22')]][_0x1a3a71][_0x1275('0xa')]={};}this[_0x1275('0x21')][_0x544d29[_0x1275('0x22')]][_0x1a3a71][_0x1275('0xa')]=this[_0x1275('0xa')][_0x544d29[_0x1275('0x22')]];}}}}}catch(_0x4caa33){logger[_0x1275('0x43')]('[syncVarSet][VoiceAgentReport]',util[_0x1275('0x31')](_0x4caa33,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')][_0x1275('0x58')]=function(_0x4b21e2,_0x3b3abe,_0x3ad3b3){var _0x1b1f2e=[_0x1275('0x5b'),_0x1275('0x5c'),_0x1275('0x5d'),_0x1275('0x5e'),_0x1275('0x5f'),_0x1275('0x60'),_0x1275('0x61'),_0x1275('0x62'),_0x1275('0x63'),_0x1275('0x64'),'bridgepeer','bridgepvtcallid',_0x1275('0x65'),'memberdynamic',_0x1275('0x66'),_0x1275('0x67'),'membername',_0x1275('0x68'),_0x1275('0x69')];if(!_[_0x1275('0x6a')](_0x3b3abe)&&!_[_0x1275('0x6b')](_0x1b1f2e,_0x3b3abe)){if(_[_0x1275('0x20')](this[_0x1275('0xa')][_0x4b21e2])){this[_0x1275('0xa')][_0x4b21e2]={};}this[_0x1275('0xa')][_0x4b21e2][_0x3b3abe]=_0x3ad3b3;}};VoiceAgentReport[_0x1275('0x1d')]['syncHangup']=function(_0x1d656f){try{if(this[_0x1275('0x1f')](_0x1d656f)){if(this[_0x1275('0x21')][_0x1d656f['uniqueid']]){for(var _0x361d16 in this[_0x1275('0x21')][_0x1d656f[_0x1275('0x22')]]){if(this['channels'][_0x1d656f[_0x1275('0x22')]][_0x1275('0x32')](_0x361d16)){if(this[_0x1275('0x21')][_0x1d656f['uniqueid']][_0x361d16][_0x1275('0x40')]=='transfer'&&this['channels'][_0x1d656f[_0x1275('0x22')]][_0x361d16]['agentcomplete']){this['channels'][_0x1d656f[_0x1275('0x22')]][_0x361d16][_0x1275('0x4c')]=moment()[_0x1275('0x23')](_0x1275('0x24'));}}}ami[_0x1275('0x1e')](_0x1275('0x6c'),_[_0x1275('0x6d')](this[_0x1275('0x21')][_0x1d656f[_0x1275('0x22')]]));delete this[_0x1275('0x21')][_0x1d656f[_0x1275('0x22')]];}if(this['variables'][_0x1d656f[_0x1275('0x22')]]){delete this[_0x1275('0xa')][_0x1d656f[_0x1275('0x22')]];}}}catch(_0x591145){logger['error'](_0x1275('0x6e'),util['inspect'](_0x591145,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1275('0x1a')]=function(_0xc3eed5){try{if(this['isNotNull'](_0xc3eed5)){if(this[_0x1275('0x21')][_0xc3eed5[_0x1275('0x6f')]]){for(var _0x48a2aa in this[_0x1275('0x21')][_0xc3eed5[_0x1275('0x6f')]]){if(this[_0x1275('0x21')][_0xc3eed5['transfereeuniqueid']][_0x1275('0x32')](_0x48a2aa)){if(_0xc3eed5[_0x1275('0x70')]===_0x48a2aa){var _0x3c283e=moment();this['channels'][_0xc3eed5['transfereeuniqueid']][_0x48a2aa][_0x1275('0x3e')]=!![];this['channels'][_0xc3eed5[_0x1275('0x6f')]][_0x48a2aa]['agentcompleteAt']=moment()[_0x1275('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1275('0x21')][_0xc3eed5[_0x1275('0x6f')]][_0x48a2aa][_0x1275('0x40')]=_0x1275('0x4f');this['channels'][_0xc3eed5[_0x1275('0x6f')]][_0x48a2aa]['lastevent']=_0x1275('0x4d');this[_0x1275('0x21')][_0xc3eed5['transfereeuniqueid']][_0x48a2aa][_0x1275('0x4e')]=_0x3c283e[_0x1275('0x71')](this[_0x1275('0x21')][_0xc3eed5['transfereeuniqueid']][_0x48a2aa][_0x1275('0x4b')],'seconds');}}}}if(this['channels'][_0xc3eed5['secondtransfereruniqueid']]){var _0x2cec1d=this[_0x1275('0x21')][_0xc3eed5['secondtransfereruniqueid']];this[_0x1275('0x21')][_0xc3eed5[_0x1275('0x72')]]=this['channels'][_0xc3eed5[_0x1275('0x6f')]];this[_0x1275('0x21')][_0xc3eed5[_0x1275('0x6f')]]=_0x2cec1d;}}}catch(_0x49c20a){logger[_0x1275('0x43')](_0x1275('0x73'),util[_0x1275('0x31')](_0x49c20a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')]['syncBlindTransfer']=function(_0x43bcc2){try{if(this[_0x1275('0x1f')](_0x43bcc2)){if(this[_0x1275('0x21')][_0x43bcc2[_0x1275('0x6f')]]){for(var _0x433c72 in this[_0x1275('0x21')][_0x43bcc2[_0x1275('0x6f')]]){if(this[_0x1275('0x21')][_0x43bcc2[_0x1275('0x6f')]]['hasOwnProperty'](_0x433c72)){if(_0x43bcc2[_0x1275('0x74')]===_0x433c72){var _0x370857=moment();this[_0x1275('0x21')][_0x43bcc2['transfereeuniqueid']][_0x433c72][_0x1275('0x3e')]=!![];this['channels'][_0x43bcc2[_0x1275('0x6f')]][_0x433c72][_0x1275('0x4c')]=_0x370857;this['channels'][_0x43bcc2[_0x1275('0x6f')]][_0x433c72][_0x1275('0x40')]=_0x1275('0x4f');this[_0x1275('0x21')][_0x43bcc2[_0x1275('0x6f')]][_0x433c72][_0x1275('0x33')]=_0x1275('0x4d');this[_0x1275('0x21')][_0x43bcc2['transfereeuniqueid']][_0x433c72]['talktime']=_0x370857[_0x1275('0x71')](this[_0x1275('0x21')][_0x43bcc2[_0x1275('0x6f')]][_0x433c72][_0x1275('0x4b')],_0x1275('0x75'));}}}}}}catch(_0x159269){logger[_0x1275('0x43')](_0x1275('0x76'),util[_0x1275('0x31')](_0x159269,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')][_0x1275('0x18')]=function(_0x374b89){var _0xc13881='';try{if(this[_0x1275('0x1f')](_0x374b89)){if(_0x374b89[_0x1275('0x77')]){_0xc13881=_0x374b89['channel'][_0x1275('0x78')](0x0,_0x374b89[_0x1275('0x77')][_0x1275('0x79')]('-'));if(this[_0x1275('0x9')][_0xc13881]){this[_0x1275('0x9')][_0xc13881][_0x1275('0x7a')]=!![];}}}}catch(_0x1409a7){logger[_0x1275('0x43')]('[syncMusicOnHoldStart][VoiceAgentReport]',util['inspect'](_0x1409a7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1275('0x1d')][_0x1275('0x19')]=function(_0x277c2f){var _0x1f6bbb='';try{if(this[_0x1275('0x1f')](_0x277c2f)){if(_0x277c2f['channel']){_0x1f6bbb=_0x277c2f[_0x1275('0x77')]['substring'](0x0,_0x277c2f[_0x1275('0x77')]['lastIndexOf']('-'));if(this[_0x1275('0x9')][_0x1f6bbb]){this[_0x1275('0x9')][_0x1f6bbb]['onhold']=![];}}}}catch(_0x5392f3){logger[_0x1275('0x43')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x1275('0x31')](_0x5392f3,{'showHidden':![],'depth':null}));}};module[_0x1275('0x7b')]=VoiceAgentReport; \ No newline at end of file +var _0x021e=['syncQueueCallerAbandon','syncAgentComplete','varset','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','syncAgentCalled','isNotNull','isUndefined','uniqueid','destuniqueid','format','called','queue','type','inbound','merge','event','privilege','custom:agentcalled','user:%s','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','agentcomplete','YYYY-MM-DD\x20HH:mm:ss','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','agentringnoanswerAt','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','acw','agentacw','acwtime','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','transfereruniqueid','diff','[syncBlindTransfer][VoiceAgentReport]','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon'];(function(_0x1df5d8,_0x8970f2){var _0x53aa6c=function(_0xc79d62){while(--_0xc79d62){_0x1df5d8['push'](_0x1df5d8['shift']());}};_0x53aa6c(++_0x8970f2);}(_0x021e,0x163));var _0xe021=function(_0x3f0330,_0x53f034){_0x3f0330=_0x3f0330-0x0;var _0x5b7908=_0x021e[_0x3f0330];return _0x5b7908;};'use strict';var _=require(_0xe021('0x0'));var moment=require(_0xe021('0x1'));var util=require('util');var Redis=require(_0xe021('0x2'));var config=require(_0xe021('0x3'));var logger=require(_0xe021('0x4'))('ami');var ami=require(_0xe021('0x5'));config[_0xe021('0x6')]=_[_0xe021('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe021('0x8'))(new Redis(config[_0xe021('0x6')]));function VoiceAgentReport(_0x6d4d16){this[_0xe021('0x9')]={};this[_0xe021('0xa')]=_0x6d4d16[_0xe021('0xa')];this['agents']=_0x6d4d16[_0xe021('0xb')];this[_0xe021('0xc')]={};ami['on'](_0xe021('0xd'),this['syncAgentCalled'][_0xe021('0xe')](this));ami['on'](_0xe021('0xf'),this[_0xe021('0x10')][_0xe021('0xe')](this));ami['on'](_0xe021('0x11'),this[_0xe021('0x12')][_0xe021('0xe')](this));ami['on'](_0xe021('0x13'),this[_0xe021('0x14')][_0xe021('0xe')](this));ami['on']('agentcomplete',this[_0xe021('0x15')]['bind'](this));ami['on'](_0xe021('0x16'),this['syncVarSet'][_0xe021('0xe')](this));ami['on'](_0xe021('0x17'),this['syncHangup'][_0xe021('0xe')](this));ami['on'](_0xe021('0x18'),this[_0xe021('0x19')]['bind'](this));ami['on'](_0xe021('0x1a'),this[_0xe021('0x1b')][_0xe021('0xe')](this));ami['on'](_0xe021('0x1c'),this[_0xe021('0x1d')]['bind'](this));ami['on']('blindtransfer',this[_0xe021('0x1e')][_0xe021('0xe')](this));}VoiceAgentReport['prototype'][_0xe021('0x1f')]=function(_0x33e919,_0x576add,_0x1639d8){io['to'](_0x33e919)[_0xe021('0x1f')](_0x576add,_0x1639d8);};VoiceAgentReport[_0xe021('0x20')]['isNotNull']=function(_0x2c28cc){return _0x2c28cc!==null&&!_['isUndefined'](_0x2c28cc);};VoiceAgentReport[_0xe021('0x20')][_0xe021('0x21')]=function(_0x50fa00){try{if(this[_0xe021('0x22')](_0x50fa00)){if(_[_0xe021('0x23')](this[_0xe021('0x9')][_0x50fa00['uniqueid']])){this[_0xe021('0x9')][_0x50fa00[_0xe021('0x24')]]={};}if(_['isUndefined'](this[_0xe021('0x9')][_0x50fa00[_0xe021('0x24')]][_0x50fa00[_0xe021('0x25')]])){this['channels'][_0x50fa00['uniqueid']][_0x50fa00['destuniqueid']]={'agentcalledAt':moment()[_0xe021('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xe021('0x27'),'variables':this[_0xe021('0xc')][_0x50fa00[_0xe021('0x24')]],'type':this['voiceQueues'][_0x50fa00[_0xe021('0x28')]]?this['voiceQueues'][_0x50fa00[_0xe021('0x28')]][_0xe021('0x29')]||_0xe021('0x2a'):'inbound'};}_[_0xe021('0x2b')](this[_0xe021('0x9')][_0x50fa00[_0xe021('0x24')]][_0x50fa00[_0xe021('0x25')]],_['omit'](_0x50fa00,[_0xe021('0x2c'),_0xe021('0x2d')]));ami['emit'](_0xe021('0x2e'),this[_0xe021('0x9')][_0x50fa00[_0xe021('0x24')]][_0x50fa00['destuniqueid']]);this['emit'](util[_0xe021('0x26')](_0xe021('0x2f'),_0x50fa00[_0xe021('0x30')]),_0xe021('0x31'),this[_0xe021('0x9')][_0x50fa00[_0xe021('0x24')]][_0x50fa00[_0xe021('0x25')]]);}}catch(_0x5c66be){logger['error'](_0xe021('0x32'),util[_0xe021('0x33')](_0x5c66be,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe021('0x20')][_0xe021('0x10')]=function(_0x560d25){try{if(this[_0xe021('0x22')](_0x560d25)){if(this['channels'][_0x560d25['uniqueid']]){for(var _0x244c19 in this['channels'][_0x560d25[_0xe021('0x24')]]){if(this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0xe021('0x34')](_0x244c19)){if(_0x560d25[_0xe021('0x25')]===_0x244c19){this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19][_0xe021('0x35')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xe021('0x9')][_0x560d25['uniqueid']][_0x244c19][_0xe021('0x36')]='connect';this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19][_0xe021('0x37')]=_0x560d25['holdtime'];this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19]['connectedlinenum']=_0x560d25[_0xe021('0x38')];this['channels'][_0x560d25['uniqueid']][_0x244c19]['connectedlinename']=_0x560d25[_0xe021('0x39')];this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19][_0xe021('0x3a')]=_0x560d25['destchannelstate'];this['channels'][_0x560d25[_0xe021('0x24')]][_0x244c19][_0xe021('0x3b')]=_0x560d25[_0xe021('0x3b')];_[_0xe021('0x2b')](this[_0xe021('0xb')][_0x560d25[_0xe021('0x3c')]],_[_0xe021('0x3d')](_0x560d25,['queue',_0xe021('0x3e')]));this['emit'](util['format'](_0xe021('0x2f'),_0x560d25['membername']),_0xe021('0x3f'),this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x560d25[_0xe021('0x25')]]);ami[_0xe021('0x1f')]('custom:agentconnect',this['channels'][_0x560d25[_0xe021('0x24')]][_0x244c19]);}else if(!this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19][_0xe021('0x11')]&&!this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19][_0xe021('0x40')]){this[_0xe021('0x9')][_0x560d25['uniqueid']][_0x244c19][_0xe021('0x11')]=!![];this[_0xe021('0x9')][_0x560d25['uniqueid']][_0x244c19]['agentringnoanswerAt']=moment()[_0xe021('0x26')](_0xe021('0x41'));this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19][_0xe021('0x42')]=_0xe021('0x43');this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19][_0xe021('0x36')]=_0xe021('0x43');this[_0xe021('0x9')][_0x560d25['uniqueid']][_0x244c19][_0xe021('0x44')]=_0x560d25[_0xe021('0x25')];this[_0xe021('0x9')][_0x560d25[_0xe021('0x24')]][_0x244c19]['answeredelsewheremembername']=_0x560d25[_0xe021('0x30')];ami['emit'](_0xe021('0x45'),this['channels'][_0x560d25[_0xe021('0x24')]][_0x244c19]);}}}}}}catch(_0x117c7d){logger[_0xe021('0x46')](_0xe021('0x47'),util[_0xe021('0x33')](_0x117c7d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe021('0x20')]['syncAgentRingNoAnswer']=function(_0x408db9){try{if(this[_0xe021('0x22')](_0x408db9)){if(this[_0xe021('0x9')][_0x408db9[_0xe021('0x24')]]&&this[_0xe021('0x9')][_0x408db9['uniqueid']][_0x408db9[_0xe021('0x25')]]){this[_0xe021('0x9')][_0x408db9[_0xe021('0x24')]][_0x408db9[_0xe021('0x25')]][_0xe021('0x11')]=!![];this[_0xe021('0x9')][_0x408db9[_0xe021('0x24')]][_0x408db9[_0xe021('0x25')]][_0xe021('0x48')]=moment()[_0xe021('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe021('0x9')][_0x408db9[_0xe021('0x24')]][_0x408db9[_0xe021('0x25')]][_0xe021('0x42')]='rejected';this[_0xe021('0x9')][_0x408db9['uniqueid']][_0x408db9['destuniqueid']][_0xe021('0x36')]=_0xe021('0x49');ami[_0xe021('0x1f')](_0xe021('0x4a'),this[_0xe021('0x9')][_0x408db9[_0xe021('0x24')]][_0x408db9[_0xe021('0x25')]]);}}}catch(_0x58d57c){logger[_0xe021('0x46')](_0xe021('0x4b'),util[_0xe021('0x33')](_0x58d57c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe021('0x20')][_0xe021('0x14')]=function(_0x4ba301){try{if(this[_0xe021('0x22')](_0x4ba301)){if(this[_0xe021('0x9')][_0x4ba301[_0xe021('0x24')]]){for(var _0x4b7de8 in this[_0xe021('0x9')][_0x4ba301[_0xe021('0x24')]]){if(this[_0xe021('0x9')][_0x4ba301['uniqueid']][_0xe021('0x34')](_0x4b7de8)&&!this[_0xe021('0x9')][_0x4ba301['uniqueid']][_0x4b7de8][_0xe021('0x11')]&&!this[_0xe021('0x9')][_0x4ba301[_0xe021('0x24')]][_0x4b7de8][_0xe021('0x40')]){this['channels'][_0x4ba301['uniqueid']][_0x4b7de8]['agentringnoanswer']=!![];this[_0xe021('0x9')][_0x4ba301['uniqueid']][_0x4b7de8][_0xe021('0x48')]=moment()[_0xe021('0x26')](_0xe021('0x41'));this[_0xe021('0x9')][_0x4ba301[_0xe021('0x24')]][_0x4b7de8][_0xe021('0x42')]=_0xe021('0x4c');this[_0xe021('0x9')][_0x4ba301[_0xe021('0x24')]][_0x4b7de8][_0xe021('0x36')]=_0xe021('0x4c');ami[_0xe021('0x1f')](_0xe021('0x4d'),this[_0xe021('0x9')][_0x4ba301['uniqueid']][_0x4b7de8]);}}}}}catch(_0x90074){logger['error'](_0xe021('0x4e'),util[_0xe021('0x33')](_0x90074,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe021('0x20')][_0xe021('0x15')]=function(_0x39398a){try{if(this[_0xe021('0x22')](_0x39398a)){if(this[_0xe021('0x9')][_0x39398a[_0xe021('0x24')]]){for(var _0x2a1dc6 in this[_0xe021('0x9')][_0x39398a[_0xe021('0x24')]]){if(this[_0xe021('0x9')][_0x39398a[_0xe021('0x24')]]['hasOwnProperty'](_0x2a1dc6)){if(this['channels'][_0x39398a[_0xe021('0x24')]][_0x2a1dc6][_0xe021('0x35')]&&!this[_0xe021('0x9')][_0x39398a['uniqueid']][_0x2a1dc6][_0xe021('0x40')]){this[_0xe021('0x9')][_0x39398a[_0xe021('0x24')]][_0x2a1dc6][_0xe021('0x40')]=!![];this[_0xe021('0x9')][_0x39398a['uniqueid']][_0x2a1dc6][_0xe021('0x4f')]=moment()[_0xe021('0x26')](_0xe021('0x41'));this[_0xe021('0x9')][_0x39398a['uniqueid']][_0x2a1dc6][_0xe021('0x36')]=_0xe021('0x50');this[_0xe021('0x9')][_0x39398a[_0xe021('0x24')]][_0x2a1dc6][_0xe021('0x51')]=_0x39398a[_0xe021('0x51')];this['channels'][_0x39398a[_0xe021('0x24')]][_0x2a1dc6][_0xe021('0x42')]=_0x39398a['reason']==_0xe021('0x52')?'agent':_0x39398a[_0xe021('0x42')];if(this[_0xe021('0xa')][_0x39398a[_0xe021('0x28')]]&&this[_0xe021('0xa')][_0x39398a[_0xe021('0x28')]][_0xe021('0x53')]){this[_0xe021('0x9')][_0x39398a['uniqueid']][_0x2a1dc6][_0xe021('0x54')]=!![];this[_0xe021('0x9')][_0x39398a[_0xe021('0x24')]][_0x2a1dc6][_0xe021('0x55')]=this[_0xe021('0xa')][_0x39398a['queue']]['acwTimeout'];}this['agents'][_0x39398a[_0xe021('0x3c')]]=_['omit'](this['agents'][_0x39398a[_0xe021('0x3c')]],['queue',_0xe021('0x3e')]);this[_0xe021('0x1f')](util[_0xe021('0x26')](_0xe021('0x2f'),_0x39398a['membername']),_0xe021('0x56'),this[_0xe021('0x9')][_0x39398a[_0xe021('0x24')]][_0x2a1dc6]);ami[_0xe021('0x1f')](_0xe021('0x57'),this['channels'][_0x39398a[_0xe021('0x24')]][_0x2a1dc6]);}}}}}}catch(_0x552ddd){logger['error'](_0xe021('0x58'),util['inspect'](_0x552ddd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe021('0x20')]['syncVarSet']=function(_0x46bfa2){try{if(this[_0xe021('0x22')](_0x46bfa2)){this[_0xe021('0x59')](_0x46bfa2[_0xe021('0x24')],_[_0xe021('0x5a')](_0x46bfa2[_0xe021('0x5b')])[0x0],_0x46bfa2[_0xe021('0x5c')]);if(this['channels'][_0x46bfa2[_0xe021('0x24')]]){for(var _0x2decc7 in this[_0xe021('0x9')][_0x46bfa2['uniqueid']]){if(this[_0xe021('0x9')][_0x46bfa2[_0xe021('0x24')]][_0xe021('0x34')](_0x2decc7)){if(_[_0xe021('0x23')](this[_0xe021('0x9')][_0x46bfa2['uniqueid']][_0x2decc7]['variables'])){this[_0xe021('0x9')][_0x46bfa2[_0xe021('0x24')]][_0x2decc7][_0xe021('0xc')]={};}this[_0xe021('0x9')][_0x46bfa2[_0xe021('0x24')]][_0x2decc7]['variables']=this[_0xe021('0xc')][_0x46bfa2['uniqueid']];}}}}}catch(_0x407074){logger[_0xe021('0x46')](_0xe021('0x5d'),util[_0xe021('0x33')](_0x407074,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe021('0x20')]['addVariable']=function(_0x4f9059,_0x1e998a,_0x2a1e99){var _0x56bf55=[_0xe021('0x5e'),_0xe021('0x5f'),'rtpaudioqosjitter',_0xe021('0x60'),_0xe021('0x61'),_0xe021('0x62'),_0xe021('0x63'),'rtpaudioqosrttbridged',_0xe021('0x64'),'sipuri',_0xe021('0x65'),_0xe021('0x66'),_0xe021('0x67'),_0xe021('0x68'),_0xe021('0x69'),_0xe021('0x6a'),_0xe021('0x30'),_0xe021('0x6b'),'memberrealtime'];if(!_[_0xe021('0x6c')](_0x1e998a)&&!_[_0xe021('0x6d')](_0x56bf55,_0x1e998a)){if(_['isUndefined'](this[_0xe021('0xc')][_0x4f9059])){this['variables'][_0x4f9059]={};}this[_0xe021('0xc')][_0x4f9059][_0x1e998a]=_0x2a1e99;}};VoiceAgentReport[_0xe021('0x20')]['syncHangup']=function(_0x2e7ef7){try{if(this[_0xe021('0x22')](_0x2e7ef7)){if(this[_0xe021('0x9')][_0x2e7ef7[_0xe021('0x24')]]){for(var _0x286cce in this[_0xe021('0x9')][_0x2e7ef7[_0xe021('0x24')]]){if(this[_0xe021('0x9')][_0x2e7ef7[_0xe021('0x24')]]['hasOwnProperty'](_0x286cce)){if(this['channels'][_0x2e7ef7[_0xe021('0x24')]][_0x286cce][_0xe021('0x42')]=='transfer'&&this[_0xe021('0x9')][_0x2e7ef7['uniqueid']][_0x286cce]['agentcomplete']){this[_0xe021('0x9')][_0x2e7ef7[_0xe021('0x24')]][_0x286cce][_0xe021('0x4f')]=moment()[_0xe021('0x26')](_0xe021('0x41'));}}}ami[_0xe021('0x1f')]('custom:voiceAgentReport',_[_0xe021('0x6e')](this[_0xe021('0x9')][_0x2e7ef7[_0xe021('0x24')]]));delete this[_0xe021('0x9')][_0x2e7ef7[_0xe021('0x24')]];}if(this['variables'][_0x2e7ef7['uniqueid']]){delete this[_0xe021('0xc')][_0x2e7ef7[_0xe021('0x24')]];}}}catch(_0x28d5e2){logger['error'](_0xe021('0x6f'),util[_0xe021('0x33')](_0x28d5e2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0x4bea05){try{if(this['isNotNull'](_0x4bea05)){if(this[_0xe021('0x9')][_0x4bea05[_0xe021('0x70')]]){for(var _0x1dc16e in this['channels'][_0x4bea05[_0xe021('0x70')]]){if(this[_0xe021('0x9')][_0x4bea05[_0xe021('0x70')]][_0xe021('0x34')](_0x1dc16e)){if(_0x4bea05[_0xe021('0x71')]===_0x1dc16e){var _0x224f6a=moment();this[_0xe021('0x9')][_0x4bea05[_0xe021('0x70')]][_0x1dc16e][_0xe021('0x40')]=!![];this[_0xe021('0x9')][_0x4bea05['transfereeuniqueid']][_0x1dc16e]['agentcompleteAt']=moment()[_0xe021('0x26')](_0xe021('0x41'));this[_0xe021('0x9')][_0x4bea05[_0xe021('0x70')]][_0x1dc16e][_0xe021('0x42')]=_0xe021('0x52');this['channels'][_0x4bea05[_0xe021('0x70')]][_0x1dc16e][_0xe021('0x36')]=_0xe021('0x50');this['channels'][_0x4bea05['transfereeuniqueid']][_0x1dc16e][_0xe021('0x51')]=_0x224f6a['diff'](this['channels'][_0x4bea05[_0xe021('0x70')]][_0x1dc16e][_0xe021('0x35')],_0xe021('0x72'));}}}}if(this[_0xe021('0x9')][_0x4bea05['secondtransfereruniqueid']]){var _0x534626=this[_0xe021('0x9')][_0x4bea05[_0xe021('0x73')]];this[_0xe021('0x9')][_0x4bea05['secondtransfereruniqueid']]=this['channels'][_0x4bea05[_0xe021('0x70')]];this['channels'][_0x4bea05[_0xe021('0x70')]]=_0x534626;}}}catch(_0x4e18a1){logger[_0xe021('0x46')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0xe021('0x33')](_0x4e18a1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe021('0x20')][_0xe021('0x1e')]=function(_0x48a4a0){try{if(this[_0xe021('0x22')](_0x48a4a0)){if(this['channels'][_0x48a4a0[_0xe021('0x70')]]){for(var _0x151242 in this[_0xe021('0x9')][_0x48a4a0[_0xe021('0x70')]]){if(this[_0xe021('0x9')][_0x48a4a0[_0xe021('0x70')]][_0xe021('0x34')](_0x151242)){if(_0x48a4a0[_0xe021('0x74')]===_0x151242){var _0x31210d=moment();this[_0xe021('0x9')][_0x48a4a0['transfereeuniqueid']][_0x151242][_0xe021('0x40')]=!![];this[_0xe021('0x9')][_0x48a4a0['transfereeuniqueid']][_0x151242][_0xe021('0x4f')]=_0x31210d;this[_0xe021('0x9')][_0x48a4a0[_0xe021('0x70')]][_0x151242][_0xe021('0x42')]=_0xe021('0x52');this['channels'][_0x48a4a0[_0xe021('0x70')]][_0x151242]['lastevent']=_0xe021('0x50');this[_0xe021('0x9')][_0x48a4a0['transfereeuniqueid']][_0x151242]['talktime']=_0x31210d[_0xe021('0x75')](this[_0xe021('0x9')][_0x48a4a0[_0xe021('0x70')]][_0x151242][_0xe021('0x35')],'seconds');}}}}}}catch(_0x57019b){logger[_0xe021('0x46')](_0xe021('0x76'),util[_0xe021('0x33')](_0x57019b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe021('0x20')][_0xe021('0x19')]=function(_0x1efe34){var _0x456c87='';try{if(this[_0xe021('0x22')](_0x1efe34)){if(_0x1efe34[_0xe021('0x77')]){_0x456c87=_0x1efe34[_0xe021('0x77')][_0xe021('0x78')](0x0,_0x1efe34[_0xe021('0x77')]['lastIndexOf']('-'));if(this['agents'][_0x456c87]){this['agents'][_0x456c87][_0xe021('0x79')]=!![];}}}}catch(_0x17a94b){logger[_0xe021('0x46')](_0xe021('0x7a'),util[_0xe021('0x33')](_0x17a94b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe021('0x1b')]=function(_0x42ae33){var _0x58c6c5='';try{if(this[_0xe021('0x22')](_0x42ae33)){if(_0x42ae33[_0xe021('0x77')]){_0x58c6c5=_0x42ae33[_0xe021('0x77')]['substring'](0x0,_0x42ae33['channel']['lastIndexOf']('-'));if(this[_0xe021('0xb')][_0x58c6c5]){this[_0xe021('0xb')][_0x58c6c5][_0xe021('0x79')]=![];}}}}catch(_0x4165dd){logger[_0xe021('0x46')](_0xe021('0x7b'),util['inspect'](_0x4165dd,{'showHidden':![],'depth':null}));}};module[_0xe021('0x7c')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index a3e9f69..f5aab99 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb338=['not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','socket.io-emitter','channels','agents','coreshowchannel','bind','newexten','newchannel','syncNewChannel','varset','syncVarSet','hangup','syncHangup','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isUndefined','emit','isNotNull','merge','pick','keys','uniqueid','[syncNewCallerId][VoiceCallReport]','linkedid','channel','OutgoingSpoolFailed','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','context','from-sip','split','destconnectedlinenum','exten','format','name','user:agentconnect','accountcode','error','[syncNewChannel][VoiceCallReport]','inspect','syncNewExten','toLowerCase','applicationdata','appdata','duration','seconds','includes','application','lastapplication','lastdata','startsWith','cdr(','match','queue','[syncNewExten][VoiceCallReport]','syncNewState','answered','starttime','holdtime','diff','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','membername','channelstate','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','replace','.wav49','.WAV','find','monitors','isNil','push','variable','value','calleridnum','callerid','xmd-cdrtype','type','xmd-queue','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','mixmonitor_filename','parse','[syncVarSet][VoiceCallReport]','endtime','billableseconds','omit','user:%s','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','answertime','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','lodash','moment','util','path','../../../config/environment','../ami','../model/channel','unknown'];(function(_0x3d7af5,_0x308d72){var _0x11b446=function(_0x3ff3e4){while(--_0x3ff3e4){_0x3d7af5['push'](_0x3d7af5['shift']());}};_0x11b446(++_0x308d72);}(_0xb338,0x130));var _0x8b33=function(_0x1ba4d1,_0x54fd0e){_0x1ba4d1=_0x1ba4d1-0x0;var _0x29a4a5=_0xb338[_0x1ba4d1];return _0x29a4a5;};'use strict';var BPromise=require('bluebird');var _=require(_0x8b33('0x0'));var moment=require(_0x8b33('0x1'));var util=require(_0x8b33('0x2'));var path=require(_0x8b33('0x3'));var Redis=require('ioredis');var config=require(_0x8b33('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x8b33('0x5'));var Channel=require(_0x8b33('0x6'));var statusDesc=[_0x8b33('0x7'),_0x8b33('0x8'),_0x8b33('0x9'),_0x8b33('0xa'),_0x8b33('0xb'),_0x8b33('0xc'),_0x8b33('0xd'),_0x8b33('0xe'),'onhold'];var applications=['set','queue','agi',_0x8b33('0xf'),_0x8b33('0x10'),_0x8b33('0x11')];var dispositions=['NO\x20ANSWER',_0x8b33('0x12'),_0x8b33('0x12'),'NO\x20ANSWER',_0x8b33('0x13'),'NO\x20ANSWER',_0x8b33('0x14'),_0x8b33('0x15'),_0x8b33('0x12'),_0x8b33('0x12'),_0x8b33('0x12')];var actions={};config[_0x8b33('0x16')]=_['defaults'](config[_0x8b33('0x16')],{'host':'localhost','port':0x18eb});var io=require(_0x8b33('0x17'))(new Redis(config['redis']));function VoiceCallReport(_0x70815f){this['channels']=_0x70815f[_0x8b33('0x18')];this[_0x8b33('0x19')]=_0x70815f[_0x8b33('0x19')];ami['on'](_0x8b33('0x1a'),this['syncNewExten'][_0x8b33('0x1b')](this));ami['on'](_0x8b33('0x1c'),this['syncNewExten'][_0x8b33('0x1b')](this));ami['on'](_0x8b33('0x1d'),this[_0x8b33('0x1e')][_0x8b33('0x1b')](this));ami['on']('newstate',this['syncNewState'][_0x8b33('0x1b')](this));ami['on'](_0x8b33('0x1f'),this[_0x8b33('0x20')]['bind'](this));ami['on'](_0x8b33('0x21'),this[_0x8b33('0x22')]['bind'](this));ami['on']('newcallerid',this['syncNewCallerId']['bind'](this));ami['on'](_0x8b33('0x23'),this['syncAttendedTransfer'][_0x8b33('0x1b')](this));ami['on'](_0x8b33('0x24'),this[_0x8b33('0x25')]['bind'](this));ami['on'](_0x8b33('0x26'),this[_0x8b33('0x27')][_0x8b33('0x1b')](this));ami['on'](_0x8b33('0x28'),this[_0x8b33('0x29')]['bind'](this));return BPromise[_0x8b33('0x2a')]()[_0x8b33('0x2b')](ami[_0x8b33('0x2c')]())[_0x8b33('0x2d')](function(_0x1a36cb){console[_0x8b33('0x2e')](_0x1a36cb);});}VoiceCallReport[_0x8b33('0x2f')]['isNotNull']=function(_0x3a15c2){return _0x3a15c2!==null&&!_[_0x8b33('0x30')](_0x3a15c2);};VoiceCallReport[_0x8b33('0x2f')]['emit']=function(_0x1c996f,_0x47c84e,_0x54027e){io['to'](_0x1c996f)[_0x8b33('0x31')](_0x47c84e,_0x54027e);};VoiceCallReport[_0x8b33('0x2f')]['syncNewCallerId']=function(_0x3e0388){try{if(this[_0x8b33('0x32')](_0x3e0388)){if(_0x3e0388['uniqueid']===_0x3e0388['linkedid']){if(!_[_0x8b33('0x30')](this[_0x8b33('0x18')][_0x3e0388['uniqueid']])){_[_0x8b33('0x33')](this[_0x8b33('0x18')][_0x3e0388['uniqueid']],_[_0x8b33('0x34')](_0x3e0388,_[_0x8b33('0x35')](this[_0x8b33('0x18')][_0x3e0388[_0x8b33('0x36')]])));}}}}catch(_0x2ebf00){logger['error'](_0x8b33('0x37'),util['inspect'](_0x2ebf00,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b33('0x2f')][_0x8b33('0x1e')]=function(_0x367db7){try{if(this['isNotNull'](_0x367db7)){if(_0x367db7[_0x8b33('0x36')]===_0x367db7[_0x8b33('0x38')]&&_0x367db7[_0x8b33('0x39')]!=_0x8b33('0x3a')){if(_['isUndefined'](this['channels'][_0x367db7[_0x8b33('0x36')]])){this['channels'][_0x367db7[_0x8b33('0x36')]]=new Channel();this[_0x8b33('0x18')][_0x367db7[_0x8b33('0x36')]]['starttime']=moment()['format'](_0x8b33('0x3b'));this[_0x8b33('0x18')][_0x367db7[_0x8b33('0x36')]][_0x8b33('0x3c')]=dispositions[_[_0x8b33('0x3d')](_0x367db7['channelstate'])];_[_0x8b33('0x33')](this[_0x8b33('0x18')][_0x367db7[_0x8b33('0x36')]],_[_0x8b33('0x34')](_0x367db7,_['keys'](this[_0x8b33('0x18')][_0x367db7['uniqueid']])));if(_0x367db7[_0x8b33('0x3e')]===_0x8b33('0x3f')){if(this['agents'][_0x367db7[_0x8b33('0x39')][_0x8b33('0x40')]('-')[0x0]]){this[_0x8b33('0x19')][_0x367db7['channel'][_0x8b33('0x40')]('-')[0x0]][_0x8b33('0x41')]=_0x367db7[_0x8b33('0x42')];this[_0x8b33('0x31')](util[_0x8b33('0x43')]('user:%s',this['agents'][_0x367db7[_0x8b33('0x39')][_0x8b33('0x40')]('-')[0x0]][_0x8b33('0x44')]),_0x8b33('0x45'),{'destaccountcode':this[_0x8b33('0x19')][_0x367db7[_0x8b33('0x39')]['split']('-')[0x0]][_0x8b33('0x46')],'destconnectedlinenum':_0x367db7[_0x8b33('0x42')]});}}}}}}catch(_0x1deb2d){logger[_0x8b33('0x47')](_0x8b33('0x48'),util[_0x8b33('0x49')](_0x1deb2d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b33('0x2f')][_0x8b33('0x4a')]=function(_0x26e6b9){try{if(this[_0x8b33('0x32')](_0x26e6b9)){if(_0x26e6b9[_0x8b33('0x36')]===_0x26e6b9[_0x8b33('0x38')]&&_0x26e6b9[_0x8b33('0x42')]!='h'&&_0x26e6b9[_0x8b33('0x39')]!=_0x8b33('0x3a')){_0x26e6b9['application']=_0x26e6b9['application'][_0x8b33('0x4b')]();_0x26e6b9[_0x8b33('0x4c')]=(_0x26e6b9[_0x8b33('0x4d')]||_0x26e6b9['applicationdata'])[_0x8b33('0x4b')]();if(_[_0x8b33('0x30')](this[_0x8b33('0x18')][_0x26e6b9[_0x8b33('0x36')]])){this['channels'][_0x26e6b9[_0x8b33('0x36')]]=new Channel();this[_0x8b33('0x18')][_0x26e6b9[_0x8b33('0x36')]]['starttime']=_0x26e6b9[_0x8b33('0x4e')]?moment()['subtract'](moment[_0x8b33('0x4e')](_0x26e6b9[_0x8b33('0x4e')])[_0x8b33('0x4f')](),_0x8b33('0x4f'))[_0x8b33('0x43')](_0x8b33('0x3b')):moment()[_0x8b33('0x43')](_0x8b33('0x3b'));this['channels'][_0x26e6b9[_0x8b33('0x36')]][_0x8b33('0x3c')]=_0x8b33('0x13');}_[_0x8b33('0x33')](this[_0x8b33('0x18')][_0x26e6b9[_0x8b33('0x36')]],_['pick'](_0x26e6b9,_[_0x8b33('0x35')](this['channels'][_0x26e6b9[_0x8b33('0x36')]])));if(_[_0x8b33('0x50')](applications,_0x26e6b9[_0x8b33('0x51')])){this['channels'][_0x26e6b9[_0x8b33('0x36')]][_0x8b33('0x52')]=_0x26e6b9[_0x8b33('0x51')];this[_0x8b33('0x18')][_0x26e6b9[_0x8b33('0x36')]][_0x8b33('0x53')]=_0x26e6b9[_0x8b33('0x4c')];if(_0x26e6b9[_0x8b33('0x51')]==='set'&&_[_0x8b33('0x54')](_0x26e6b9['applicationdata'],_0x8b33('0x55'))){var _0x365e75=_0x26e6b9['applicationdata'][_0x8b33('0x40')]('=');var _0x339e92=_0x365e75[0x0][_0x8b33('0x56')](/cdr\((.*)\)/);if(_0x339e92){this[_0x8b33('0x18')][_0x26e6b9['uniqueid']][_0x339e92[0x1]]=_0x365e75[0x1];}}else if(_0x26e6b9['application']===_0x8b33('0x57')){this['channels'][_0x26e6b9[_0x8b33('0x36')]][_0x8b33('0x57')]=_0x26e6b9[_0x8b33('0x4c')]['split'](',')[0x0];}}}}}catch(_0x12c9ae){logger['error'](_0x8b33('0x58'),util[_0x8b33('0x49')](_0x12c9ae,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b33('0x2f')][_0x8b33('0x59')]=function(_0x2cb569){try{if(this['isNotNull'](_0x2cb569)){if(_0x2cb569[_0x8b33('0x36')]!==_0x2cb569[_0x8b33('0x38')]){if(this['channels'][_0x2cb569['linkedid']]){if(_0x2cb569['channelstate']==='6'){if(!this[_0x8b33('0x18')][_0x2cb569['linkedid']][_0x8b33('0x5a')]){var _0x119efb=moment();this['channels'][_0x2cb569[_0x8b33('0x38')]][_0x8b33('0x5a')]=!![];this[_0x8b33('0x18')][_0x2cb569['linkedid']]['answertime']=_0x119efb[_0x8b33('0x43')](_0x8b33('0x3b'));if(this[_0x8b33('0x18')][_0x2cb569[_0x8b33('0x38')]][_0x8b33('0x5b')]){this[_0x8b33('0x18')][_0x2cb569[_0x8b33('0x38')]][_0x8b33('0x5c')]=_0x119efb[_0x8b33('0x5d')](this[_0x8b33('0x18')][_0x2cb569[_0x8b33('0x38')]]['starttime'],'seconds');}}this[_0x8b33('0x18')][_0x2cb569[_0x8b33('0x38')]][_0x8b33('0x38')]=_0x2cb569[_0x8b33('0x36')];if(_0x2cb569['calleridnum']!==_0x8b33('0x5e')){this['channels'][_0x2cb569['linkedid']][_0x8b33('0x5f')]=_0x2cb569['calleridnum'];}this[_0x8b33('0x18')][_0x2cb569[_0x8b33('0x38')]][_0x8b33('0x60')]=_0x2cb569[_0x8b33('0x61')];this['channels'][_0x2cb569[_0x8b33('0x38')]][_0x8b33('0x62')]=_0x2cb569[_0x8b33('0x39')];this[_0x8b33('0x18')][_0x2cb569[_0x8b33('0x38')]]['disposition']=dispositions[_[_0x8b33('0x3d')](_0x2cb569['channelstate'])];if(this[_0x8b33('0x19')][_0x2cb569[_0x8b33('0x39')][_0x8b33('0x40')]('-')[0x0]]){this['channels'][_0x2cb569[_0x8b33('0x38')]]['UserId']=this[_0x8b33('0x19')][_0x2cb569['channel']['split']('-')[0x0]]['id'];this[_0x8b33('0x18')][_0x2cb569['linkedid']][_0x8b33('0x63')]=this['agents'][_0x2cb569['channel'][_0x8b33('0x40')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x2cb569[_0x8b33('0x36')]]){if(_0x2cb569[_0x8b33('0x64')]==='6'){if(this[_0x8b33('0x19')][_0x2cb569[_0x8b33('0x39')][_0x8b33('0x40')]('-')[0x0]]){this[_0x8b33('0x18')][_0x2cb569[_0x8b33('0x36')]][_0x8b33('0x65')]=this[_0x8b33('0x19')][_0x2cb569[_0x8b33('0x39')][_0x8b33('0x40')]('-')[0x0]]['id'];this[_0x8b33('0x18')][_0x2cb569['uniqueid']][_0x8b33('0x63')]=this[_0x8b33('0x19')][_0x2cb569['channel']['split']('-')[0x0]][_0x8b33('0x44')];}}}}}}catch(_0x141ced){logger[_0x8b33('0x47')](_0x8b33('0x66'),util['inspect'](_0x141ced,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b33('0x2f')][_0x8b33('0x67')]=function(_0x42d144,_0xec1d0f){if(this['channels'][_0x42d144]){this[_0x8b33('0x18')][_0x42d144][_0x8b33('0x68')]=!![];if(_[_0x8b33('0x69')](_0xec1d0f,'.wav49')){_0xec1d0f=_0xec1d0f[_0x8b33('0x6a')](_0x8b33('0x6b'),_0x8b33('0x6c'));}this[_0x8b33('0x18')][_0x42d144]['monitorFilename']=_0xec1d0f;var _0x3db0b7=_[_0x8b33('0x6d')](this[_0x8b33('0x18')][_0x42d144][_0x8b33('0x6e')],{'filename':_0xec1d0f});if(_[_0x8b33('0x6f')](_0x3db0b7)){this[_0x8b33('0x18')][_0x42d144]['monitors'][_0x8b33('0x70')]({'filename':_0xec1d0f,'createdAt':moment()[_0x8b33('0x43')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x8b33('0x2f')][_0x8b33('0x20')]=function(_0x1f5c86){try{if(this[_0x8b33('0x32')](_0x1f5c86)){if(this[_0x8b33('0x18')][_0x1f5c86[_0x8b33('0x36')]]&&_0x1f5c86[_0x8b33('0x39')]!=_0x8b33('0x3a')){if(this[_0x8b33('0x32')](_0x1f5c86['variable'])){if(this['isNotNull'](_0x1f5c86[_0x8b33('0x71')]['mixmonitor_filename'])){this[_0x8b33('0x67')](_0x1f5c86['uniqueid'],_0x1f5c86[_0x8b33('0x72')]);}else if(this['isNotNull'](_0x1f5c86[_0x8b33('0x71')]['xmd-phone'])){this[_0x8b33('0x18')][_0x1f5c86[_0x8b33('0x36')]][_0x8b33('0x73')]=_0x1f5c86['value'];}else if(this[_0x8b33('0x32')](_0x1f5c86[_0x8b33('0x71')]['xmd-callerid'])){this[_0x8b33('0x18')][_0x1f5c86[_0x8b33('0x36')]][_0x8b33('0x74')]=_0x1f5c86[_0x8b33('0x72')];}else if(this['isNotNull'](_0x1f5c86[_0x8b33('0x71')][_0x8b33('0x75')])){this[_0x8b33('0x18')][_0x1f5c86[_0x8b33('0x36')]][_0x8b33('0x76')]=_0x1f5c86[_0x8b33('0x72')];}else if(this['isNotNull'](_0x1f5c86[_0x8b33('0x71')][_0x8b33('0x77')])){this['channels'][_0x1f5c86[_0x8b33('0x36')]][_0x8b33('0x57')]=_0x1f5c86[_0x8b33('0x72')][_0x8b33('0x40')](',')[0x0];}else if(this[_0x8b33('0x32')](_0x1f5c86['variable']['xmd-originatecalleridnum'])){this[_0x8b33('0x18')][_0x1f5c86[_0x8b33('0x36')]][_0x8b33('0x78')]=_0x1f5c86[_0x8b33('0x72')];}else if(this[_0x8b33('0x32')](_0x1f5c86[_0x8b33('0x71')]['xmd-destination'])){this[_0x8b33('0x18')][_0x1f5c86[_0x8b33('0x36')]][_0x8b33('0x79')]=_0x1f5c86['value'];}else if(this[_0x8b33('0x32')](_0x1f5c86[_0x8b33('0x71')][_0x8b33('0x7a')])){this[_0x8b33('0x18')][_0x1f5c86[_0x8b33('0x36')]][_0x8b33('0x7b')]=_0x1f5c86[_0x8b33('0x72')];}else if(this['isNotNull'](_0x1f5c86[_0x8b33('0x71')][_0x8b33('0x7c')])){this[_0x8b33('0x18')][_0x1f5c86[_0x8b33('0x36')]][_0x8b33('0x57')]=_0x1f5c86['value'];}else if(this[_0x8b33('0x32')](_0x1f5c86['variable'][_0x8b33('0x7d')])){this[_0x8b33('0x18')][_0x1f5c86['uniqueid']][_0x8b33('0x7e')]=_0x1f5c86['value'];}}}else if(this[_0x8b33('0x32')](_0x1f5c86['variable'][_0x8b33('0x7f')])){if(_0x1f5c86[_0x8b33('0x72')]){var _0x543a06=path[_0x8b33('0x80')](_0x1f5c86[_0x8b33('0x72')])[_0x8b33('0x44')];this[_0x8b33('0x67')](_0x543a06,_0x1f5c86[_0x8b33('0x72')]);}}else if(this['channels'][_0x1f5c86[_0x8b33('0x38')]]){if(this[_0x8b33('0x32')](_0x1f5c86[_0x8b33('0x71')])){if(this['isNotNull'](_0x1f5c86[_0x8b33('0x71')][_0x8b33('0x7d')])){this['channels'][_0x1f5c86['linkedid']]['sipcalllinkedid']=_0x1f5c86[_0x8b33('0x72')];}}}}}catch(_0x25326d){logger[_0x8b33('0x47')](_0x8b33('0x81'),util[_0x8b33('0x49')](_0x25326d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b33('0x2f')][_0x8b33('0x22')]=function(_0x5058e8){try{if(this[_0x8b33('0x32')](_0x5058e8)){if(this['channels'][_0x5058e8[_0x8b33('0x36')]]){var _0x20b69c=moment();this['channels'][_0x5058e8[_0x8b33('0x36')]][_0x8b33('0x82')]=_0x20b69c[_0x8b33('0x43')](_0x8b33('0x3b'));this[_0x8b33('0x18')][_0x5058e8[_0x8b33('0x36')]][_0x8b33('0x4e')]=_0x20b69c['diff'](this[_0x8b33('0x18')][_0x5058e8['uniqueid']]['starttime'],_0x8b33('0x4f'));if(this[_0x8b33('0x18')][_0x5058e8[_0x8b33('0x36')]]['answered']){this[_0x8b33('0x18')][_0x5058e8[_0x8b33('0x36')]][_0x8b33('0x83')]=_0x20b69c[_0x8b33('0x5d')](this[_0x8b33('0x18')][_0x5058e8[_0x8b33('0x36')]]['answertime'],_0x8b33('0x4f'));this['channels'][_0x5058e8[_0x8b33('0x36')]]['holdtime']=this[_0x8b33('0x18')][_0x5058e8['uniqueid']]['duration']-this[_0x8b33('0x18')][_0x5058e8[_0x8b33('0x36')]][_0x8b33('0x83')];}if(_0x5058e8[_0x8b33('0x3e')]===_0x8b33('0x3f')){if(this['agents'][_0x5058e8['channel']['split']('-')[0x0]]){this[_0x8b33('0x19')][_0x5058e8['channel'][_0x8b33('0x40')]('-')[0x0]]=_[_0x8b33('0x84')](this[_0x8b33('0x19')][_0x5058e8[_0x8b33('0x39')][_0x8b33('0x40')]('-')[0x0]],[_0x8b33('0x41')]);this['emit'](util[_0x8b33('0x43')](_0x8b33('0x85'),this['agents'][_0x5058e8['channel'][_0x8b33('0x40')]('-')[0x0]][_0x8b33('0x44')]),'user:agentcomplete',{'destaccountcode':this[_0x8b33('0x19')][_0x5058e8[_0x8b33('0x39')][_0x8b33('0x40')]('-')[0x0]][_0x8b33('0x46')]});}}ami['emit'](_0x8b33('0x86'),this['channels'][_0x5058e8[_0x8b33('0x36')]]);delete this[_0x8b33('0x18')][_0x5058e8[_0x8b33('0x36')]];}}}catch(_0x17b885){logger[_0x8b33('0x47')](_0x8b33('0x87'),util['inspect'](_0x17b885,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b33('0x2f')][_0x8b33('0x88')]=function(_0x2cfde2){try{if(this[_0x8b33('0x32')](_0x2cfde2)){if(this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x89')]]){this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x89')]]['transfercalleridnum']=_0x2cfde2[_0x8b33('0x8a')];this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x89')]][_0x8b33('0x8b')]=_0x2cfde2[_0x8b33('0x8c')];if(this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x8d')]]){var _0xa08f7=this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x8d')]];this['channels'][_0x2cfde2['secondtransfereruniqueid']]=this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x89')]];this[_0x8b33('0x18')][_0x2cfde2['transfereeuniqueid']]=_0xa08f7;}}else if(this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x8e')]]){this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x8e')]][_0x8b33('0x8f')]=_0x2cfde2[_0x8b33('0x8a')];this['channels'][_0x2cfde2['transfertargetuniqueid']][_0x8b33('0x8b')]=_0x2cfde2[_0x8b33('0x8c')];if(this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x90')]]){var _0xa08f7=this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x90')]];this[_0x8b33('0x18')][_0x2cfde2[_0x8b33('0x90')]]=this['channels'][_0x2cfde2[_0x8b33('0x8e')]];this[_0x8b33('0x18')][_0x2cfde2['transfertargetuniqueid']]=_0xa08f7;}}}}catch(_0x502c9b){logger[_0x8b33('0x47')](_0x8b33('0x91'),util[_0x8b33('0x49')](_0x502c9b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncBlindTransfer']=function(_0x3c71ec){try{if(this['isNotNull'](_0x3c71ec)){if(this['channels'][_0x3c71ec[_0x8b33('0x89')]]){this[_0x8b33('0x18')][_0x3c71ec[_0x8b33('0x89')]]['transfercalleridnum']=_0x3c71ec[_0x8b33('0x92')];this[_0x8b33('0x18')][_0x3c71ec[_0x8b33('0x89')]]['transferconnectedlinenum']=_0x3c71ec['extension'];this[_0x8b33('0x22')]({'event':_0x8b33('0x93'),'uniqueid':_0x3c71ec[_0x8b33('0x89')],'context':_0x3c71ec[_0x8b33('0x3e')],'channel':_0x3c71ec[_0x8b33('0x94')]});}}}catch(_0x4eeb9d){logger['error'](_0x8b33('0x95'),util[_0x8b33('0x49')](_0x4eeb9d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b33('0x2f')]['syncMusicOnHoldStart']=function(_0x36894e){try{if(this[_0x8b33('0x32')](_0x36894e)){if(this['channels'][_0x36894e[_0x8b33('0x36')]]){if(!_['isNil'](this[_0x8b33('0x18')][_0x36894e[_0x8b33('0x36')]][_0x8b33('0x96')])){this[_0x8b33('0x18')][_0x36894e[_0x8b33('0x36')]][_0x8b33('0x97')]=moment()['format'](_0x8b33('0x3b'));}}}}catch(_0x23a3ae){logger['error'](_0x8b33('0x98'),util[_0x8b33('0x49')](_0x23a3ae,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b33('0x2f')][_0x8b33('0x29')]=function(_0x57fda8){try{if(this[_0x8b33('0x32')](_0x57fda8)){if(this[_0x8b33('0x18')][_0x57fda8['uniqueid']]){if(!_['isNil'](this['channels'][_0x57fda8[_0x8b33('0x36')]]['mohstarttime'])){this['channels'][_0x57fda8[_0x8b33('0x36')]][_0x8b33('0x99')]+=moment()[_0x8b33('0x9a')](0x0)[_0x8b33('0x5d')](this[_0x8b33('0x18')][_0x57fda8[_0x8b33('0x36')]][_0x8b33('0x97')],_0x8b33('0x4f'));delete this[_0x8b33('0x18')][_0x57fda8[_0x8b33('0x36')]][_0x8b33('0x97')];}}}}catch(_0x228ed5){logger[_0x8b33('0x47')](_0x8b33('0x9b'),util[_0x8b33('0x49')](_0x228ed5,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x31dc=['monitorFilename','find','monitors','push','rec','OutgoingSpoolFailed','variable','value','xmd-callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','xmcs-queue','sipcallid','mixmonitor_filename','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','endtime','billableseconds','diff','holdtime','context','omit','destconnectedlinenum','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfercalleridnum','transfereecalleridnum','extension','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','moment','util','../../../config/logger','../ami','unknown','busy','ringing','ringinuse','onhold','set','agi','playback','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','varset','syncVarSet','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','then','catch','log','prototype','isUndefined','emit','isNotNull','uniqueid','error','inspect','linkedid','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','pick','keys','from-sip','split','exten','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','appdata','applicationdata','duration','subtract','seconds','includes','lastapplication','match','queue','syncNewState','answered','answertime','calleridnum','connectedlinenum','calleridname','destinationchannel','toNumber','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.WAV'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x31dc,0xc3));var _0xc31d=function(_0x56bf26,_0x3741cf){_0x56bf26=_0x56bf26-0x0;var _0x331b75=_0x31dc[_0x56bf26];return _0x331b75;};'use strict';var BPromise=require(_0xc31d('0x0'));var _=require(_0xc31d('0x1'));var moment=require(_0xc31d('0x2'));var util=require(_0xc31d('0x3'));var path=require('path');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xc31d('0x4'))('ami');var ami=require(_0xc31d('0x5'));var Channel=require('../model/channel');var statusDesc=[_0xc31d('0x6'),'not_inuse','inuse',_0xc31d('0x7'),'invalid','unavailable',_0xc31d('0x8'),_0xc31d('0x9'),_0xc31d('0xa')];var applications=[_0xc31d('0xb'),'queue',_0xc31d('0xc'),'dial',_0xc31d('0xd'),'voicemail'];var dispositions=['NO\x20ANSWER',_0xc31d('0xe'),_0xc31d('0xe'),_0xc31d('0xf'),_0xc31d('0xf'),_0xc31d('0xf'),_0xc31d('0x10'),_0xc31d('0x11'),'FAILED','FAILED',_0xc31d('0xe')];var actions={};config[_0xc31d('0x12')]=_[_0xc31d('0x13')](config['redis'],{'host':_0xc31d('0x14'),'port':0x18eb});var io=require(_0xc31d('0x15'))(new Redis(config[_0xc31d('0x12')]));function VoiceCallReport(_0x8ac7e7){this[_0xc31d('0x16')]=_0x8ac7e7['channels'];this[_0xc31d('0x17')]=_0x8ac7e7['agents'];ami['on'](_0xc31d('0x18'),this[_0xc31d('0x19')][_0xc31d('0x1a')](this));ami['on'](_0xc31d('0x1b'),this['syncNewExten'][_0xc31d('0x1a')](this));ami['on'](_0xc31d('0x1c'),this[_0xc31d('0x1d')][_0xc31d('0x1a')](this));ami['on']('newstate',this['syncNewState'][_0xc31d('0x1a')](this));ami['on'](_0xc31d('0x1e'),this[_0xc31d('0x1f')][_0xc31d('0x1a')](this));ami['on']('hangup',this['syncHangup'][_0xc31d('0x1a')](this));ami['on'](_0xc31d('0x20'),this[_0xc31d('0x21')]['bind'](this));ami['on'](_0xc31d('0x22'),this[_0xc31d('0x23')]['bind'](this));ami['on'](_0xc31d('0x24'),this[_0xc31d('0x25')]['bind'](this));ami['on'](_0xc31d('0x26'),this[_0xc31d('0x27')][_0xc31d('0x1a')](this));ami['on'](_0xc31d('0x28'),this[_0xc31d('0x29')][_0xc31d('0x1a')](this));return BPromise['resolve']()[_0xc31d('0x2a')](ami['actionCoreShowChannels']())[_0xc31d('0x2b')](function(_0x255d26){console[_0xc31d('0x2c')](_0x255d26);});}VoiceCallReport[_0xc31d('0x2d')]['isNotNull']=function(_0xb7b030){return _0xb7b030!==null&&!_[_0xc31d('0x2e')](_0xb7b030);};VoiceCallReport[_0xc31d('0x2d')][_0xc31d('0x2f')]=function(_0x1a5e7c,_0x2c742f,_0x190720){io['to'](_0x1a5e7c)[_0xc31d('0x2f')](_0x2c742f,_0x190720);};VoiceCallReport[_0xc31d('0x2d')][_0xc31d('0x21')]=function(_0x208ba9){try{if(this[_0xc31d('0x30')](_0x208ba9)){if(_0x208ba9['uniqueid']===_0x208ba9['linkedid']){if(!_['isUndefined'](this['channels'][_0x208ba9[_0xc31d('0x31')]])){_['merge'](this[_0xc31d('0x16')][_0x208ba9[_0xc31d('0x31')]],_['pick'](_0x208ba9,_['keys'](this[_0xc31d('0x16')][_0x208ba9['uniqueid']])));}}}}catch(_0x475f54){logger[_0xc31d('0x32')]('[syncNewCallerId][VoiceCallReport]',util[_0xc31d('0x33')](_0x475f54,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc31d('0x2d')][_0xc31d('0x1d')]=function(_0x1a4389){try{if(this['isNotNull'](_0x1a4389)){if(_0x1a4389[_0xc31d('0x31')]===_0x1a4389[_0xc31d('0x34')]&&_0x1a4389[_0xc31d('0x35')]!='OutgoingSpoolFailed'){if(_[_0xc31d('0x2e')](this['channels'][_0x1a4389[_0xc31d('0x31')]])){this[_0xc31d('0x16')][_0x1a4389[_0xc31d('0x31')]]=new Channel();this[_0xc31d('0x16')][_0x1a4389[_0xc31d('0x31')]][_0xc31d('0x36')]=moment()[_0xc31d('0x37')](_0xc31d('0x38'));this['channels'][_0x1a4389[_0xc31d('0x31')]][_0xc31d('0x39')]=dispositions[_['toNumber'](_0x1a4389[_0xc31d('0x3a')])];_[_0xc31d('0x3b')](this['channels'][_0x1a4389[_0xc31d('0x31')]],_[_0xc31d('0x3c')](_0x1a4389,_[_0xc31d('0x3d')](this['channels'][_0x1a4389[_0xc31d('0x31')]])));if(_0x1a4389['context']===_0xc31d('0x3e')){if(this[_0xc31d('0x17')][_0x1a4389[_0xc31d('0x35')]['split']('-')[0x0]]){this['agents'][_0x1a4389['channel'][_0xc31d('0x3f')]('-')[0x0]]['destconnectedlinenum']=_0x1a4389[_0xc31d('0x40')];this['emit'](util[_0xc31d('0x37')](_0xc31d('0x41'),this[_0xc31d('0x17')][_0x1a4389['channel']['split']('-')[0x0]][_0xc31d('0x42')]),_0xc31d('0x43'),{'destaccountcode':this[_0xc31d('0x17')][_0x1a4389[_0xc31d('0x35')][_0xc31d('0x3f')]('-')[0x0]][_0xc31d('0x44')],'destconnectedlinenum':_0x1a4389[_0xc31d('0x40')]});}}}}}}catch(_0xdc9f45){logger[_0xc31d('0x32')](_0xc31d('0x45'),util[_0xc31d('0x33')](_0xdc9f45,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc31d('0x2d')]['syncNewExten']=function(_0x49369c){try{if(this[_0xc31d('0x30')](_0x49369c)){if(_0x49369c['uniqueid']===_0x49369c['linkedid']&&_0x49369c[_0xc31d('0x40')]!='h'&&_0x49369c['channel']!='OutgoingSpoolFailed'){_0x49369c[_0xc31d('0x46')]=_0x49369c[_0xc31d('0x46')][_0xc31d('0x47')]();_0x49369c['applicationdata']=(_0x49369c[_0xc31d('0x48')]||_0x49369c[_0xc31d('0x49')])[_0xc31d('0x47')]();if(_[_0xc31d('0x2e')](this[_0xc31d('0x16')][_0x49369c[_0xc31d('0x31')]])){this[_0xc31d('0x16')][_0x49369c[_0xc31d('0x31')]]=new Channel();this['channels'][_0x49369c['uniqueid']]['starttime']=_0x49369c[_0xc31d('0x4a')]?moment()[_0xc31d('0x4b')](moment[_0xc31d('0x4a')](_0x49369c[_0xc31d('0x4a')])[_0xc31d('0x4c')](),_0xc31d('0x4c'))[_0xc31d('0x37')](_0xc31d('0x38')):moment()[_0xc31d('0x37')](_0xc31d('0x38'));this[_0xc31d('0x16')][_0x49369c[_0xc31d('0x31')]][_0xc31d('0x39')]='NO\x20ANSWER';}_['merge'](this[_0xc31d('0x16')][_0x49369c[_0xc31d('0x31')]],_[_0xc31d('0x3c')](_0x49369c,_[_0xc31d('0x3d')](this[_0xc31d('0x16')][_0x49369c['uniqueid']])));if(_[_0xc31d('0x4d')](applications,_0x49369c['application'])){this[_0xc31d('0x16')][_0x49369c[_0xc31d('0x31')]][_0xc31d('0x4e')]=_0x49369c[_0xc31d('0x46')];this['channels'][_0x49369c[_0xc31d('0x31')]]['lastdata']=_0x49369c[_0xc31d('0x49')];if(_0x49369c['application']===_0xc31d('0xb')&&_['startsWith'](_0x49369c[_0xc31d('0x49')],'cdr(')){var _0x24911f=_0x49369c[_0xc31d('0x49')][_0xc31d('0x3f')]('=');var _0x33e796=_0x24911f[0x0][_0xc31d('0x4f')](/cdr\((.*)\)/);if(_0x33e796){this[_0xc31d('0x16')][_0x49369c['uniqueid']][_0x33e796[0x1]]=_0x24911f[0x1];}}else if(_0x49369c[_0xc31d('0x46')]===_0xc31d('0x50')){this['channels'][_0x49369c['uniqueid']][_0xc31d('0x50')]=_0x49369c[_0xc31d('0x49')][_0xc31d('0x3f')](',')[0x0];}}}}}catch(_0x5f4eec){logger['error']('[syncNewExten][VoiceCallReport]',util[_0xc31d('0x33')](_0x5f4eec,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc31d('0x51')]=function(_0x5edfd5){try{if(this[_0xc31d('0x30')](_0x5edfd5)){if(_0x5edfd5[_0xc31d('0x31')]!==_0x5edfd5[_0xc31d('0x34')]){if(this[_0xc31d('0x16')][_0x5edfd5['linkedid']]){if(_0x5edfd5[_0xc31d('0x3a')]==='6'){if(!this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]][_0xc31d('0x52')]){var _0x324081=moment();this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]][_0xc31d('0x52')]=!![];this[_0xc31d('0x16')][_0x5edfd5['linkedid']][_0xc31d('0x53')]=_0x324081[_0xc31d('0x37')](_0xc31d('0x38'));if(this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]][_0xc31d('0x36')]){this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]]['holdtime']=_0x324081['diff'](this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]][_0xc31d('0x36')],_0xc31d('0x4c'));}}this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]]['linkedid']=_0x5edfd5[_0xc31d('0x31')];if(_0x5edfd5[_0xc31d('0x54')]!=='xcally-motion-preview'){this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]][_0xc31d('0x55')]=_0x5edfd5[_0xc31d('0x54')];}this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]]['connectedlinename']=_0x5edfd5[_0xc31d('0x56')];this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]][_0xc31d('0x57')]=_0x5edfd5['channel'];this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]]['disposition']=dispositions[_[_0xc31d('0x58')](_0x5edfd5[_0xc31d('0x3a')])];if(this[_0xc31d('0x17')][_0x5edfd5['channel'][_0xc31d('0x3f')]('-')[0x0]]){this['channels'][_0x5edfd5[_0xc31d('0x34')]][_0xc31d('0x59')]=this[_0xc31d('0x17')][_0x5edfd5[_0xc31d('0x35')][_0xc31d('0x3f')]('-')[0x0]]['id'];this[_0xc31d('0x16')][_0x5edfd5[_0xc31d('0x34')]][_0xc31d('0x5a')]=this[_0xc31d('0x17')][_0x5edfd5['channel'][_0xc31d('0x3f')]('-')[0x0]][_0xc31d('0x42')];}}}}else{if(this[_0xc31d('0x16')][_0x5edfd5['uniqueid']]){if(_0x5edfd5[_0xc31d('0x3a')]==='6'){if(this[_0xc31d('0x17')][_0x5edfd5[_0xc31d('0x35')]['split']('-')[0x0]]){this[_0xc31d('0x16')][_0x5edfd5['uniqueid']][_0xc31d('0x59')]=this[_0xc31d('0x17')][_0x5edfd5['channel'][_0xc31d('0x3f')]('-')[0x0]]['id'];this['channels'][_0x5edfd5[_0xc31d('0x31')]][_0xc31d('0x5a')]=this[_0xc31d('0x17')][_0x5edfd5['channel'][_0xc31d('0x3f')]('-')[0x0]][_0xc31d('0x42')];}}}}}}catch(_0x34f80d){logger[_0xc31d('0x32')](_0xc31d('0x5b'),util[_0xc31d('0x33')](_0x34f80d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc31d('0x5c')]=function(_0x23d22a,_0x121fc0){if(this[_0xc31d('0x16')][_0x23d22a]){this[_0xc31d('0x16')][_0x23d22a][_0xc31d('0x5d')]=!![];if(_['endsWith'](_0x121fc0,'.wav49')){_0x121fc0=_0x121fc0['replace']('.wav49',_0xc31d('0x5e'));}this['channels'][_0x23d22a][_0xc31d('0x5f')]=_0x121fc0;var _0x4f76a8=_[_0xc31d('0x60')](this[_0xc31d('0x16')][_0x23d22a][_0xc31d('0x61')],{'filename':_0x121fc0});if(_['isNil'](_0x4f76a8)){this[_0xc31d('0x16')][_0x23d22a][_0xc31d('0x61')][_0xc31d('0x62')]({'filename':_0x121fc0,'createdAt':moment()[_0xc31d('0x37')](_0xc31d('0x38')),'mixmonitorid':'','status':_0xc31d('0x63')});}}};VoiceCallReport[_0xc31d('0x2d')]['syncVarSet']=function(_0x1d8209){try{if(this[_0xc31d('0x30')](_0x1d8209)){if(this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]]&&_0x1d8209[_0xc31d('0x35')]!=_0xc31d('0x64')){if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')])){if(this[_0xc31d('0x30')](_0x1d8209['variable']['mixmonitor_filename'])){this['syncMixMonitorFilename'](_0x1d8209[_0xc31d('0x31')],_0x1d8209[_0xc31d('0x66')]);}else if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')]['xmd-phone'])){this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]][_0xc31d('0x54')]=_0x1d8209[_0xc31d('0x66')];}else if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')][_0xc31d('0x67')])){this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]]['callerid']=_0x1d8209['value'];}else if(this['isNotNull'](_0x1d8209[_0xc31d('0x65')][_0xc31d('0x68')])){this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]][_0xc31d('0x69')]=_0x1d8209['value'];}else if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')][_0xc31d('0x6a')])){this['channels'][_0x1d8209['uniqueid']][_0xc31d('0x50')]=_0x1d8209[_0xc31d('0x66')][_0xc31d('0x3f')](',')[0x0];}else if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')][_0xc31d('0x6b')])){this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]][_0xc31d('0x6c')]=_0x1d8209['value'];}else if(this['isNotNull'](_0x1d8209['variable'][_0xc31d('0x6d')])){this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]][_0xc31d('0x6e')]=_0x1d8209[_0xc31d('0x66')];}else if(this[_0xc31d('0x30')](_0x1d8209['variable'][_0xc31d('0x6f')])){this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]]['calleridpreview']=_0x1d8209[_0xc31d('0x66')];}else if(this['isNotNull'](_0x1d8209[_0xc31d('0x65')][_0xc31d('0x70')])){this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]]['queue']=_0x1d8209['value'];}else if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')][_0xc31d('0x71')])){this[_0xc31d('0x16')][_0x1d8209[_0xc31d('0x31')]]['sipcalluniqueid']=_0x1d8209[_0xc31d('0x66')];}}}else if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')][_0xc31d('0x72')])){if(_0x1d8209[_0xc31d('0x66')]){var _0x44fb26=path[_0xc31d('0x73')](_0x1d8209[_0xc31d('0x66')])[_0xc31d('0x42')];this[_0xc31d('0x5c')](_0x44fb26,_0x1d8209['value']);}}else if(this[_0xc31d('0x16')][_0x1d8209['linkedid']]){if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')])){if(this[_0xc31d('0x30')](_0x1d8209[_0xc31d('0x65')][_0xc31d('0x71')])){this[_0xc31d('0x16')][_0x1d8209['linkedid']][_0xc31d('0x74')]=_0x1d8209[_0xc31d('0x66')];}}}}}catch(_0x4b41e9){logger[_0xc31d('0x32')](_0xc31d('0x75'),util[_0xc31d('0x33')](_0x4b41e9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc31d('0x2d')][_0xc31d('0x76')]=function(_0x526c21){try{if(this[_0xc31d('0x30')](_0x526c21)){if(this['channels'][_0x526c21['uniqueid']]){var _0xbfe797=moment();this[_0xc31d('0x16')][_0x526c21['uniqueid']][_0xc31d('0x77')]=_0xbfe797[_0xc31d('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc31d('0x16')][_0x526c21[_0xc31d('0x31')]]['duration']=_0xbfe797['diff'](this[_0xc31d('0x16')][_0x526c21['uniqueid']]['starttime'],_0xc31d('0x4c'));if(this['channels'][_0x526c21[_0xc31d('0x31')]][_0xc31d('0x52')]){this[_0xc31d('0x16')][_0x526c21['uniqueid']][_0xc31d('0x78')]=_0xbfe797[_0xc31d('0x79')](this[_0xc31d('0x16')][_0x526c21[_0xc31d('0x31')]][_0xc31d('0x53')],_0xc31d('0x4c'));this[_0xc31d('0x16')][_0x526c21[_0xc31d('0x31')]][_0xc31d('0x7a')]=this[_0xc31d('0x16')][_0x526c21[_0xc31d('0x31')]][_0xc31d('0x4a')]-this[_0xc31d('0x16')][_0x526c21[_0xc31d('0x31')]][_0xc31d('0x78')];}if(_0x526c21[_0xc31d('0x7b')]==='from-sip'){if(this[_0xc31d('0x17')][_0x526c21['channel'][_0xc31d('0x3f')]('-')[0x0]]){this[_0xc31d('0x17')][_0x526c21[_0xc31d('0x35')][_0xc31d('0x3f')]('-')[0x0]]=_[_0xc31d('0x7c')](this['agents'][_0x526c21[_0xc31d('0x35')][_0xc31d('0x3f')]('-')[0x0]],[_0xc31d('0x7d')]);this[_0xc31d('0x2f')](util[_0xc31d('0x37')](_0xc31d('0x41'),this[_0xc31d('0x17')][_0x526c21['channel']['split']('-')[0x0]][_0xc31d('0x42')]),_0xc31d('0x7e'),{'destaccountcode':this['agents'][_0x526c21[_0xc31d('0x35')][_0xc31d('0x3f')]('-')[0x0]]['accountcode']});}}ami['emit'](_0xc31d('0x7f'),this[_0xc31d('0x16')][_0x526c21[_0xc31d('0x31')]]);delete this[_0xc31d('0x16')][_0x526c21['uniqueid']];}}}catch(_0x29715a){logger[_0xc31d('0x32')](_0xc31d('0x80'),util[_0xc31d('0x33')](_0x29715a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc31d('0x2d')][_0xc31d('0x23')]=function(_0xe3c5a5){try{if(this[_0xc31d('0x30')](_0xe3c5a5)){if(this['channels'][_0xe3c5a5[_0xc31d('0x81')]]){this[_0xc31d('0x16')][_0xe3c5a5[_0xc31d('0x81')]]['transfercalleridnum']=_0xe3c5a5[_0xc31d('0x82')];this[_0xc31d('0x16')][_0xe3c5a5[_0xc31d('0x81')]][_0xc31d('0x83')]=_0xe3c5a5[_0xc31d('0x84')];if(this[_0xc31d('0x16')][_0xe3c5a5[_0xc31d('0x85')]]){var _0x14feb8=this['channels'][_0xe3c5a5['secondtransfereruniqueid']];this[_0xc31d('0x16')][_0xe3c5a5[_0xc31d('0x85')]]=this[_0xc31d('0x16')][_0xe3c5a5['transfereeuniqueid']];this['channels'][_0xe3c5a5[_0xc31d('0x81')]]=_0x14feb8;}}else if(this['channels'][_0xe3c5a5[_0xc31d('0x86')]]){this['channels'][_0xe3c5a5[_0xc31d('0x86')]]['transfercalleridnum']=_0xe3c5a5[_0xc31d('0x82')];this[_0xc31d('0x16')][_0xe3c5a5['transfertargetuniqueid']][_0xc31d('0x83')]=_0xe3c5a5['transfertargetcalleridnum'];if(this[_0xc31d('0x16')][_0xe3c5a5[_0xc31d('0x87')]]){var _0x14feb8=this['channels'][_0xe3c5a5['origtransfereruniqueid']];this[_0xc31d('0x16')][_0xe3c5a5[_0xc31d('0x87')]]=this[_0xc31d('0x16')][_0xe3c5a5[_0xc31d('0x86')]];this[_0xc31d('0x16')][_0xe3c5a5[_0xc31d('0x86')]]=_0x14feb8;}}}}catch(_0x351a75){logger[_0xc31d('0x32')]('[syncAttendedTransfer][VoiceCallReport]',util[_0xc31d('0x33')](_0x351a75,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc31d('0x2d')][_0xc31d('0x25')]=function(_0x595b4f){try{if(this[_0xc31d('0x30')](_0x595b4f)){if(this[_0xc31d('0x16')][_0x595b4f[_0xc31d('0x81')]]){this['channels'][_0x595b4f[_0xc31d('0x81')]][_0xc31d('0x88')]=_0x595b4f[_0xc31d('0x89')];this[_0xc31d('0x16')][_0x595b4f[_0xc31d('0x81')]][_0xc31d('0x83')]=_0x595b4f[_0xc31d('0x8a')];this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x595b4f['transfereeuniqueid'],'context':_0x595b4f[_0xc31d('0x7b')],'channel':_0x595b4f[_0xc31d('0x8b')]});}}}catch(_0x3bbd21){logger[_0xc31d('0x32')]('[syncBlindTransfer][VoiceCallReport]',util[_0xc31d('0x33')](_0x3bbd21,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc31d('0x2d')]['syncMusicOnHoldStart']=function(_0x2be02c){try{if(this[_0xc31d('0x30')](_0x2be02c)){if(this['channels'][_0x2be02c['uniqueid']]){if(!_['isNil'](this[_0xc31d('0x16')][_0x2be02c[_0xc31d('0x31')]][_0xc31d('0x53')])){this[_0xc31d('0x16')][_0x2be02c['uniqueid']][_0xc31d('0x8c')]=moment()['format'](_0xc31d('0x38'));}}}}catch(_0x3756a2){logger[_0xc31d('0x32')](_0xc31d('0x8d'),util['inspect'](_0x3756a2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc31d('0x2d')][_0xc31d('0x29')]=function(_0x49c6cf){try{if(this[_0xc31d('0x30')](_0x49c6cf)){if(this[_0xc31d('0x16')][_0x49c6cf[_0xc31d('0x31')]]){if(!_['isNil'](this['channels'][_0x49c6cf[_0xc31d('0x31')]][_0xc31d('0x8c')])){this[_0xc31d('0x16')][_0x49c6cf[_0xc31d('0x31')]][_0xc31d('0x8e')]+=moment()[_0xc31d('0x8f')](0x0)[_0xc31d('0x79')](this[_0xc31d('0x16')][_0x49c6cf[_0xc31d('0x31')]][_0xc31d('0x8c')],'seconds');delete this[_0xc31d('0x16')][_0x49c6cf[_0xc31d('0x31')]]['mohstarttime'];}}}}catch(_0x1feb43){logger[_0xc31d('0x32')](_0xc31d('0x90'),util[_0xc31d('0x33')](_0x1feb43,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index df4c148..3b4fdd2 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['outboundChannels','outbound','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','channel','lastIndexOf','substring','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','custom:dialconnect','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','outboundrouteid','variables','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','endtime','diff','starttime','seconds','total','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','channels'];(function(_0x16fe93,_0x28b9df){var _0x5596d4=function(_0x3e3ef1){while(--_0x3e3ef1){_0x16fe93['push'](_0x16fe93['shift']());}};_0x5596d4(++_0x28b9df);}(_0x9c00,0x1a0));var _0x09c0=function(_0x1ad93b,_0x56bee2){_0x1ad93b=_0x1ad93b-0x0;var _0x5c83a3=_0x9c00[_0x1ad93b];return _0x5c83a3;};'use strict';var _=require(_0x09c0('0x0'));var moment=require(_0x09c0('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x09c0('0x2'));var logger=require(_0x09c0('0x3'))('ami');var ami=require(_0x09c0('0x4'));config[_0x09c0('0x5')]=_[_0x09c0('0x6')](config[_0x09c0('0x5')],{'host':_0x09c0('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x1f3d7e){this[_0x09c0('0x8')]=_0x1f3d7e[_0x09c0('0x9')];this[_0x09c0('0xa')]=_0x1f3d7e[_0x09c0('0xa')];this['variables']={};ami['on'](_0x09c0('0xb'),this[_0x09c0('0xc')][_0x09c0('0xd')](this));ami['on'](_0x09c0('0xe'),this[_0x09c0('0xf')][_0x09c0('0xd')](this));ami['on'](_0x09c0('0x10'),this[_0x09c0('0x11')][_0x09c0('0xd')](this));ami['on'](_0x09c0('0x12'),this[_0x09c0('0x13')][_0x09c0('0xd')](this));}VoiceDialReport[_0x09c0('0x14')][_0x09c0('0x15')]=function(_0x3b95cc){return _0x3b95cc!==null&&!_[_0x09c0('0x16')](_0x3b95cc);};VoiceDialReport[_0x09c0('0x14')][_0x09c0('0x17')]=function(_0x342ceb,_0x3649d2,_0x16e490){io['to'](_0x342ceb)[_0x09c0('0x17')](_0x3649d2,_0x16e490);};VoiceDialReport[_0x09c0('0x14')][_0x09c0('0xc')]=function(_0x33c3d6){try{if(this[_0x09c0('0x15')](_0x33c3d6)){if(this['channels'][_0x33c3d6['uniqueid']]){_['merge'](this[_0x09c0('0x8')][_0x33c3d6[_0x09c0('0x18')]],{'starttime':moment()[_0x09c0('0x19')](_0x09c0('0x1a')),'lastevent':'called','interface':_0x33c3d6[_0x09c0('0x1b')]['substring'](0x0,_0x33c3d6['channel'][_0x09c0('0x1c')]('-')),'membername':_0x33c3d6['channel'][_0x09c0('0x1d')](_0x33c3d6[_0x09c0('0x1b')][_0x09c0('0x1c')]('/')+0x1,_0x33c3d6['channel'][_0x09c0('0x1c')]('-'))},_[_0x09c0('0x1e')](_0x33c3d6,[_0x09c0('0x1f'),_0x09c0('0x20')]));this[_0x09c0('0x17')](_0x09c0('0x21'),_0x09c0('0x22'),this['channels'][_0x33c3d6[_0x09c0('0x18')]]);ami[_0x09c0('0x17')](_0x09c0('0x23'),this[_0x09c0('0x8')][_0x33c3d6['uniqueid']]);}}}catch(_0x4f6824){logger[_0x09c0('0x24')](_0x09c0('0x25'),util[_0x09c0('0x26')](_0x4f6824,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x09c0('0x14')]['syncDialEnd']=function(_0x42ebfc){try{if(this[_0x09c0('0x15')](_0x42ebfc)){if(this['channels'][_0x42ebfc[_0x09c0('0x18')]]){this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]][_0x09c0('0x27')]=_0x42ebfc[_0x09c0('0x27')];if(_0x42ebfc[_0x09c0('0x27')]===_0x09c0('0x28')){this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]][_0x09c0('0x29')]=_0x42ebfc[_0x09c0('0x29')];this['channels'][_0x42ebfc[_0x09c0('0x18')]][_0x09c0('0x2a')]=_0x42ebfc['connectedlinename'];this[_0x09c0('0x8')][_0x42ebfc['uniqueid']][_0x09c0('0x2b')]=moment()['format'](_0x09c0('0x1a'));this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]][_0x09c0('0x2c')]='connect';ami['emit'](_0x09c0('0x2d'),this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]]);}this['emit'](_0x09c0('0x21'),'voice_outbound_channel:save',this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]]);}}}catch(_0x16cf08){logger['error'](_0x09c0('0x2e'),util[_0x09c0('0x26')](_0x16cf08,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x09c0('0x14')][_0x09c0('0x11')]=function(_0x234f07){try{if(this[_0x09c0('0x15')](_0x234f07)){this[_0x09c0('0x2f')](_0x234f07['uniqueid'],_[_0x09c0('0x30')](_0x234f07[_0x09c0('0x31')])[0x0],_0x234f07[_0x09c0('0x32')]);if(this[_0x09c0('0x15')](_0x234f07[_0x09c0('0x31')])&&this['isNotNull'](_0x234f07[_0x09c0('0x31')][_0x09c0('0x33')])){if(_[_0x09c0('0x16')](this[_0x09c0('0x8')][_0x234f07[_0x09c0('0x18')]])){this['channels'][_0x234f07[_0x09c0('0x18')]]={'routeId':_0x234f07[_0x09c0('0x32')],'variables':this[_0x09c0('0x34')][_0x234f07[_0x09c0('0x18')]]};this[_0x09c0('0x17')](_0x09c0('0x21'),_0x09c0('0x22'),this['channels'][_0x234f07[_0x09c0('0x18')]]);}}}}catch(_0x2a93d2){logger[_0x09c0('0x24')](_0x09c0('0x35'),util[_0x09c0('0x26')](_0x2a93d2,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x5c3c09,_0x4a14dc,_0xd7a1eb){var _0x15c631=[_0x09c0('0x36'),_0x09c0('0x37'),_0x09c0('0x38'),'rtpaudioqosjitterbridged',_0x09c0('0x39'),_0x09c0('0x3a'),'rtpaudioqosrtt',_0x09c0('0x3b'),'sipcallid',_0x09c0('0x3c'),'bridgepeer',_0x09c0('0x3d'),_0x09c0('0x3e'),'memberdynamic',_0x09c0('0x3f'),_0x09c0('0x40'),'membername',_0x09c0('0x41'),_0x09c0('0x42')];if(!_[_0x09c0('0x43')](_0x4a14dc)&&!_[_0x09c0('0x44')](_0x15c631,_0x4a14dc)){if(_[_0x09c0('0x16')](this[_0x09c0('0x34')][_0x5c3c09])){this['variables'][_0x5c3c09]={};}this[_0x09c0('0x34')][_0x5c3c09][_0x4a14dc]=_0xd7a1eb;}};VoiceDialReport[_0x09c0('0x14')][_0x09c0('0x13')]=function(_0x57835c){try{if(this[_0x09c0('0x15')](_0x57835c)){if(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]){this['channels'][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x45')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['duration']=moment(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['endtime'])[_0x09c0('0x46')](this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x47')],_0x09c0('0x48'));this['channels'][_0x57835c[_0x09c0('0x18')]]['lastevent']='complete';this[_0x09c0('0xa')][_0x09c0('0x49')]+=0x1;if(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x2b')]){this[_0x09c0('0xa')]['answered']+=0x1;this['channels'][_0x57835c['uniqueid']][_0x09c0('0x4a')]=moment(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['answertime'])[_0x09c0('0x46')](this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x47')],_0x09c0('0x48'));this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x4b')]=moment(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x45')])[_0x09c0('0x46')](this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x2b')],_0x09c0('0x48'));this[_0x09c0('0xa')][_0x09c0('0x4c')]+=this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['holdtime']||0x0;this[_0x09c0('0xa')][_0x09c0('0x4d')]+=this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x4b')];}this['outbound'][_0x09c0('0x4e')]+=this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['duration'];ami[_0x09c0('0x17')](_0x09c0('0x4f'),this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]);ami[_0x09c0('0x17')](_0x09c0('0x50'),this[_0x09c0('0x8')][_0x57835c['uniqueid']]);this[_0x09c0('0x17')](_0x09c0('0x21'),_0x09c0('0x51'),this[_0x09c0('0xa')]);this[_0x09c0('0x17')](_0x09c0('0x21'),_0x09c0('0x52'),this['channels'][_0x57835c['uniqueid']]);delete this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]];}if(this[_0x09c0('0x34')][_0x57835c['uniqueid']]){delete this[_0x09c0('0x34')][_0x57835c['uniqueid']];}}}catch(_0x2fecec){logger[_0x09c0('0x24')](_0x09c0('0x53'),util[_0x09c0('0x26')](_0x2fecec,{'showHidden':![],'depth':null}));}};module[_0x09c0('0x54')]=VoiceDialReport; \ No newline at end of file +var _0xb469=['localhost','socket.io-emitter','outbound','variables','dialbegin','syncDialBegin','dialend','bind','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','channels','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','privilege','voice:outbound','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','custom:dialconnect','voice_outbound_channel:save','error','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','endtime','duration','diff','starttime','seconds','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults'];(function(_0x309b09,_0xe4c181){var _0x7b38d7=function(_0x3c2277){while(--_0x3c2277){_0x309b09['push'](_0x309b09['shift']());}};_0x7b38d7(++_0xe4c181);}(_0xb469,0x13b));var _0x9b46=function(_0x2ed854,_0x4d2b91){_0x2ed854=_0x2ed854-0x0;var _0x2ce20e=_0xb469[_0x2ed854];return _0x2ce20e;};'use strict';var _=require(_0x9b46('0x0'));var moment=require(_0x9b46('0x1'));var util=require(_0x9b46('0x2'));var Redis=require(_0x9b46('0x3'));var config=require(_0x9b46('0x4'));var logger=require(_0x9b46('0x5'))(_0x9b46('0x6'));var ami=require('../ami');config[_0x9b46('0x7')]=_[_0x9b46('0x8')](config['redis'],{'host':_0x9b46('0x9'),'port':0x18eb});var io=require(_0x9b46('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x1b2dd3){this['channels']=_0x1b2dd3['outboundChannels'];this[_0x9b46('0xb')]=_0x1b2dd3['outbound'];this[_0x9b46('0xc')]={};ami['on'](_0x9b46('0xd'),this[_0x9b46('0xe')]['bind'](this));ami['on'](_0x9b46('0xf'),this['syncDialEnd'][_0x9b46('0x10')](this));ami['on']('varset',this[_0x9b46('0x11')]['bind'](this));ami['on'](_0x9b46('0x12'),this[_0x9b46('0x13')]['bind'](this));}VoiceDialReport[_0x9b46('0x14')][_0x9b46('0x15')]=function(_0x5b65c2){return _0x5b65c2!==null&&!_[_0x9b46('0x16')](_0x5b65c2);};VoiceDialReport[_0x9b46('0x14')][_0x9b46('0x17')]=function(_0x467086,_0xa8f4ac,_0x35c5c1){io['to'](_0x467086)[_0x9b46('0x17')](_0xa8f4ac,_0x35c5c1);};VoiceDialReport[_0x9b46('0x14')][_0x9b46('0xe')]=function(_0x178293){try{if(this[_0x9b46('0x15')](_0x178293)){if(this[_0x9b46('0x18')][_0x178293[_0x9b46('0x19')]]){_['merge'](this['channels'][_0x178293['uniqueid']],{'starttime':moment()[_0x9b46('0x1a')](_0x9b46('0x1b')),'lastevent':_0x9b46('0x1c'),'interface':_0x178293['channel']['substring'](0x0,_0x178293[_0x9b46('0x1d')]['lastIndexOf']('-')),'membername':_0x178293['channel'][_0x9b46('0x1e')](_0x178293[_0x9b46('0x1d')]['lastIndexOf']('/')+0x1,_0x178293[_0x9b46('0x1d')][_0x9b46('0x1f')]('-'))},_['omit'](_0x178293,['event',_0x9b46('0x20')]));this[_0x9b46('0x17')](_0x9b46('0x21'),'voice_outbound_channel:save',this['channels'][_0x178293[_0x9b46('0x19')]]);ami['emit'](_0x9b46('0x22'),this[_0x9b46('0x18')][_0x178293['uniqueid']]);}}}catch(_0xadff19){logger['error'](_0x9b46('0x23'),util[_0x9b46('0x24')](_0xadff19,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x9b46('0x25')]=function(_0x31ca63){try{if(this[_0x9b46('0x15')](_0x31ca63)){if(this[_0x9b46('0x18')][_0x31ca63[_0x9b46('0x19')]]){this[_0x9b46('0x18')][_0x31ca63[_0x9b46('0x19')]]['dialstatus']=_0x31ca63[_0x9b46('0x26')];if(_0x31ca63[_0x9b46('0x26')]===_0x9b46('0x27')){this[_0x9b46('0x18')][_0x31ca63[_0x9b46('0x19')]][_0x9b46('0x28')]=_0x31ca63[_0x9b46('0x28')];this['channels'][_0x31ca63[_0x9b46('0x19')]][_0x9b46('0x29')]=_0x31ca63[_0x9b46('0x29')];this[_0x9b46('0x18')][_0x31ca63[_0x9b46('0x19')]][_0x9b46('0x2a')]=moment()[_0x9b46('0x1a')](_0x9b46('0x1b'));this[_0x9b46('0x18')][_0x31ca63[_0x9b46('0x19')]][_0x9b46('0x2b')]='connect';ami[_0x9b46('0x17')](_0x9b46('0x2c'),this[_0x9b46('0x18')][_0x31ca63[_0x9b46('0x19')]]);}this[_0x9b46('0x17')](_0x9b46('0x21'),_0x9b46('0x2d'),this[_0x9b46('0x18')][_0x31ca63[_0x9b46('0x19')]]);}}}catch(_0x451e47){logger[_0x9b46('0x2e')]('[syncDialEnd][VoiceDialReport]',util[_0x9b46('0x24')](_0x451e47,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x9b46('0x11')]=function(_0x3f3887){try{if(this[_0x9b46('0x15')](_0x3f3887)){this['addVariable'](_0x3f3887[_0x9b46('0x19')],_[_0x9b46('0x2f')](_0x3f3887[_0x9b46('0x30')])[0x0],_0x3f3887[_0x9b46('0x31')]);if(this[_0x9b46('0x15')](_0x3f3887['variable'])&&this['isNotNull'](_0x3f3887[_0x9b46('0x30')][_0x9b46('0x32')])){if(_[_0x9b46('0x16')](this[_0x9b46('0x18')][_0x3f3887['uniqueid']])){this[_0x9b46('0x18')][_0x3f3887['uniqueid']]={'routeId':_0x3f3887[_0x9b46('0x31')],'variables':this[_0x9b46('0xc')][_0x3f3887[_0x9b46('0x19')]]};this[_0x9b46('0x17')]('voice:outbound',_0x9b46('0x2d'),this['channels'][_0x3f3887[_0x9b46('0x19')]]);}}}}catch(_0x2da43f){logger[_0x9b46('0x2e')](_0x9b46('0x33'),util[_0x9b46('0x24')](_0x2da43f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9b46('0x14')][_0x9b46('0x34')]=function(_0x23f563,_0xd63f7c,_0xa3cce3){var _0x1c4147=['rtpaudioqos',_0x9b46('0x35'),'rtpaudioqosjitter',_0x9b46('0x36'),_0x9b46('0x37'),'rtpaudioqoslossbridged',_0x9b46('0x38'),'rtpaudioqosrttbridged',_0x9b46('0x39'),'sipuri',_0x9b46('0x3a'),_0x9b46('0x3b'),_0x9b46('0x3c'),_0x9b46('0x3d'),_0x9b46('0x3e'),'memberlastcall','membername',_0x9b46('0x3f'),'memberrealtime'];if(!_['isNil'](_0xd63f7c)&&!_['includes'](_0x1c4147,_0xd63f7c)){if(_['isUndefined'](this[_0x9b46('0xc')][_0x23f563])){this['variables'][_0x23f563]={};}this[_0x9b46('0xc')][_0x23f563][_0xd63f7c]=_0xa3cce3;}};VoiceDialReport['prototype'][_0x9b46('0x13')]=function(_0xe807bf){try{if(this[_0x9b46('0x15')](_0xe807bf)){if(this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]]){this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x40')]=moment()[_0x9b46('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x41')]=moment(this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x40')])[_0x9b46('0x42')](this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x43')],_0x9b46('0x44'));this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x2b')]='complete';this['outbound'][_0x9b46('0x45')]+=0x1;if(this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]]['answertime']){this['outbound'][_0x9b46('0x46')]+=0x1;this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x47')]=moment(this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]]['answertime'])[_0x9b46('0x42')](this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]]['starttime'],_0x9b46('0x44'));this['channels'][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x48')]=moment(this[_0x9b46('0x18')][_0xe807bf['uniqueid']][_0x9b46('0x40')])[_0x9b46('0x42')](this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x2a')],_0x9b46('0x44'));this['outbound'][_0x9b46('0x49')]+=this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x47')]||0x0;this[_0x9b46('0xb')][_0x9b46('0x4a')]+=this['channels'][_0xe807bf[_0x9b46('0x19')]]['billableseconds'];}this[_0x9b46('0xb')][_0x9b46('0x4b')]+=this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]][_0x9b46('0x41')];ami['emit'](_0x9b46('0x4c'),this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]]);ami[_0x9b46('0x17')](_0x9b46('0x4d'),this[_0x9b46('0x18')][_0xe807bf[_0x9b46('0x19')]]);this[_0x9b46('0x17')](_0x9b46('0x21'),_0x9b46('0x4e'),this[_0x9b46('0xb')]);this['emit']('voice:outbound','voice_outbound_channel:remove',this[_0x9b46('0x18')][_0xe807bf['uniqueid']]);delete this[_0x9b46('0x18')][_0xe807bf['uniqueid']];}if(this[_0x9b46('0xc')][_0xe807bf['uniqueid']]){delete this[_0x9b46('0xc')][_0xe807bf[_0x9b46('0x19')]];}}}catch(_0x15e3d6){logger[_0x9b46('0x2e')](_0x9b46('0x4f'),util['inspect'](_0x15e3d6,{'showHidden':![],'depth':null}));}};module[_0x9b46('0x50')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index aa99597..f376c0c 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd493=['syncAgentConnect','queuecallerexitreason','[syncAgentConnect][VoiceQueueReport]','queuecallerabandonAt','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','COMPLETEDBY','[syncAgentComplete][VoiceQueueReport]','syncVarSet','variable','value','queuestatus','CONTINUE','queueposition','[syncVarSet][VoiceQueueReport]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','membercalls','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','length','diff','sumDuration','total','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','syncMusicOnHoldStop','milliseconds','[syncMusicOnHoldStop][VoiceQueueReport]','lodash','moment','bluebird','util','../../../config/environment','../../../config/logger','../ami','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','agents','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','varset','hangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','clearZombieChannels','channels','switch','isNil','Action','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','queueReports','[voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','format','name','voice_queue_channel:save','voice:queue:%s','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','sumBillable','sumHoldTime','unmanaged','abandoned','Trunk','active','callerid','Interval','md5','voice_queue:save','isNotNull','queues','flagQueueSummary','then','[queuesummary]','queue','countBy','callers','toNumber','loggedIn','available','loggedin','custom:queuesummary','inspect','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','ABANDONED','lastAssignedTo','queuecallerleaveAt','connectedlinenum','connectedlinename'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd493,0x10d));var _0x3d49=function(_0x30a9ab,_0x1d23a8){_0x30a9ab=_0x30a9ab-0x0;var _0x26ef43=_0xd493[_0x30a9ab];return _0x26ef43;};'use strict';var _=require(_0x3d49('0x0'));var moment=require(_0x3d49('0x1'));var BPromise=require(_0x3d49('0x2'));var util=require(_0x3d49('0x3'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x3d49('0x4'));var logger=require(_0x3d49('0x5'))('ami');var ami=require(_0x3d49('0x6'));var QueueReport=require('../model/queueReport');config['redis']=_['defaults'](config[_0x3d49('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3d49('0x8'))(new Redis(config[_0x3d49('0x7')]));var Sequence=function(){};Sequence[_0x3d49('0x9')][_0x3d49('0xa')]=function(_0x59d06c){this[_0x3d49('0xb')]=this[_0x3d49('0xb')]?this[_0x3d49('0xb')][_0x3d49('0xc')](_0x59d06c):_0x59d06c();};function VoiceQueueReport(_0x1a2b7d){this[_0x3d49('0xd')]=new Sequence();this['queueReports']={};this[_0x3d49('0xe')]=_0x1a2b7d[_0x3d49('0xe')];this['channels']=_0x1a2b7d[_0x3d49('0xf')];this[_0x3d49('0x10')]=_0x1a2b7d[_0x3d49('0x10')];this['flagQueueSummary']=!![];this['campaigns']=_0x1a2b7d[_0x3d49('0x11')];this[_0x3d49('0x12')]={};ami['on'](_0x3d49('0x13'),this[_0x3d49('0x14')][_0x3d49('0x15')](this));ami['on'](_0x3d49('0x16'),this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0x3d49('0x17'),this[_0x3d49('0x18')][_0x3d49('0x15')](this));ami['on']('queuecallerabandon',this[_0x3d49('0x19')][_0x3d49('0x15')](this));ami['on'](_0x3d49('0x1a'),this['syncQueueCallerLeave'][_0x3d49('0x15')](this));ami['on'](_0x3d49('0x1b'),this[_0x3d49('0x1c')][_0x3d49('0x15')](this));ami['on'](_0x3d49('0x1d'),this['syncAgentConnect']['bind'](this));ami['on'](_0x3d49('0x1e'),this['syncVarSet'][_0x3d49('0x15')](this));ami['on'](_0x3d49('0x1f'),this['syncHangup'][_0x3d49('0x15')](this));ami['on'](_0x3d49('0x20'),this[_0x3d49('0x21')]['bind'](this));ami['on'](_0x3d49('0x22'),this[_0x3d49('0x23')][_0x3d49('0x15')](this));ami['on'](_0x3d49('0x24'),this['syncMusicOnHoldStop'][_0x3d49('0x15')](this));ami['on'](_0x3d49('0x25'),this[_0x3d49('0x26')][_0x3d49('0x15')](this));ami['on']('blindtransfer',this[_0x3d49('0x27')][_0x3d49('0x15')](this));this[_0x3d49('0x28')]();this[_0x3d49('0x29')]();}function isNotNull(_0x375fb2){return _0x375fb2!==null&&!_[_0x3d49('0x2a')](_0x375fb2);}function clearChannels(_0x38ae3a){if(!_[_0x3d49('0x2b')](_0x38ae3a)){for(var _0x4d91fe in _0x38ae3a){if(_0x38ae3a['hasOwnProperty'](_0x4d91fe)){delete _0x38ae3a[_0x4d91fe];}}}}function clearCampaigns(_0x39ffc8){if(!_[_0x3d49('0x2b')](_0x39ffc8)){for(var _0x280466 in _0x39ffc8){if(_0x39ffc8[_0x3d49('0x2c')](_0x280466)){_0x39ffc8[_0x280466][_0x3d49('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x146440){if(!_[_0x3d49('0x2b')](_0x146440)){for(var _0x2fdcb2 in _0x146440){if(_0x146440[_0x3d49('0x2c')](_0x2fdcb2)){_0x146440[_0x2fdcb2][_0x3d49('0x2d')]=0x0;_0x146440[_0x2fdcb2][_0x3d49('0x2e')]=0x0;_0x146440[_0x2fdcb2][_0x3d49('0x2f')]=0x0;_0x146440[_0x2fdcb2][_0x3d49('0x30')]=0x0;_0x146440[_0x2fdcb2][_0x3d49('0x31')]=!![];}}}}function clearAgentBooked(_0x277f2e){if(!_[_0x3d49('0x2b')](_0x277f2e)){for(var _0x1c1b1c in _0x277f2e){if(_0x277f2e[_0x3d49('0x2c')](_0x1c1b1c)){_0x277f2e[_0x1c1b1c]['unlockRR']=!![];}}}}VoiceQueueReport[_0x3d49('0x9')][_0x3d49('0x32')]=function(){var _0x984af4=this;for(var _0x238d4d in this[_0x3d49('0x33')]){if(this['channels'][_0x3d49('0x2c')](_0x238d4d)&&!this[_0x3d49('0x33')][_0x238d4d][_0x3d49('0x34')]){this[_0x3d49('0xd')][_0x3d49('0xa')](function(){if(!_[_0x3d49('0x35')](_0x984af4['channels'][_0x238d4d])){return ami[_0x3d49('0x36')]({'action':'status','channel':_0x984af4[_0x3d49('0x33')][_0x238d4d]['channel']})[_0x3d49('0x37')](function(_0x4e586f){if(_0x4e586f[_0x3d49('0x38')]===_0x3d49('0x39')){setTimeout(function(){if(_0x984af4[_0x3d49('0x33')][_0x238d4d]){delete _0x984af4[_0x3d49('0x33')][_0x238d4d];logger[_0x3d49('0x3a')](_0x3d49('0x3b'),_0x238d4d);}if(_0x984af4[_0x3d49('0x3c')][_0x238d4d]){delete _0x984af4[_0x3d49('0x3c')][_0x238d4d];logger[_0x3d49('0x3a')](_0x3d49('0x3d'),_0x238d4d);}if(_0x984af4['variables'][_0x238d4d]){delete _0x984af4[_0x3d49('0x12')][_0x238d4d];logger['error']('[voiceQueueReport][checkVariables]',_0x238d4d);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x3d49('0x21')]=function(){logger[_0x3d49('0x3a')](_0x3d49('0x3e'));clearChannels(this[_0x3d49('0x33')]);this[_0x3d49('0x3f')](this['queueReports']);clearAgentBooked(this[_0x3d49('0xe')]);clearVoiceQueues(this[_0x3d49('0x10')]);clearCampaigns(this[_0x3d49('0x11')]);};VoiceQueueReport['prototype']['clearQueueReport']=function(_0x121577){var _0x3d80df=this;if(!_[_0x3d49('0x2b')](_0x121577)){for(var _0x32768c in _0x121577){if(_0x121577['hasOwnProperty'](_0x32768c)){_0x3d80df[_0x3d49('0x40')](_0x121577[_0x32768c]);delete _0x121577[_0x32768c];}}}};function loggerCatch(_0x2036d6){return function(_0xbe2998){logger[_0x3d49('0x3a')](_0x2036d6,util['inspect'](_0xbe2998,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x3d49('0x9')]['emit']=function(_0x21ce42,_0x15366d,_0x53af58){io['to'](_0x21ce42)[_0x3d49('0x41')](_0x15366d,_0x53af58);};VoiceQueueReport['prototype'][_0x3d49('0x42')]=function(_0x3c12d7){this[_0x3d49('0x41')](util[_0x3d49('0x43')]('voice:queue:%s',_0x3c12d7[_0x3d49('0x44')]),_0x3d49('0x45'),_0x3c12d7);};VoiceQueueReport[_0x3d49('0x9')][_0x3d49('0x40')]=function(_0x173fc3){this[_0x3d49('0x41')](util[_0x3d49('0x43')](_0x3d49('0x46'),_0x173fc3[_0x3d49('0x44')]),_0x3d49('0x47'),_0x173fc3);};VoiceQueueReport[_0x3d49('0x9')][_0x3d49('0x48')]=function(_0x5e740d){if(_0x5e740d[_0x3d49('0x49')]===_0x3d49('0x4a')){var _0x41c0bc={'id':_0x5e740d['id'],'name':_0x5e740d[_0x3d49('0x44')],'strategy':_0x5e740d[_0x3d49('0x4b')],'answered':_0x5e740d[_0x3d49('0x4c')],'available':_0x5e740d['available'],'loggedIn':_0x5e740d['loggedIn'],'pTalking':_0x5e740d[_0x3d49('0x2f')],'sumBillable':_0x5e740d[_0x3d49('0x4d')],'sumDuration':_0x5e740d['sumDuration'],'sumHoldTime':_0x5e740d[_0x3d49('0x4e')]||0x0,'talking':_0x5e740d[_0x3d49('0x2e')],'total':_0x5e740d['total'],'type':_0x5e740d['type'],'unmanaged':_0x5e740d[_0x3d49('0x4f')],'abandoned':_0x5e740d[_0x3d49('0x50')],'waiting':_0x5e740d[_0x3d49('0x30')]};if(_0x5e740d['Trunk']){_0x41c0bc[_0x3d49('0x51')]={'id':_0x5e740d['Trunk']['id'],'name':_0x5e740d[_0x3d49('0x51')]['name'],'active':_0x5e740d[_0x3d49('0x51')][_0x3d49('0x52')],'callerid':_0x5e740d[_0x3d49('0x51')][_0x3d49('0x53')]};}if(_0x5e740d[_0x3d49('0x54')]){_0x41c0bc[_0x3d49('0x54')]={'id':_0x5e740d[_0x3d49('0x54')]['id'],'name':_0x5e740d['Interval'][_0x3d49('0x44')]};}var _0x3a79a5=md5(JSON['stringify'](_0x41c0bc));if(_0x5e740d[_0x3d49('0x55')]!==_0x3a79a5){_0x5e740d['md5']=_0x3a79a5;this[_0x3d49('0x41')](util[_0x3d49('0x43')](_0x3d49('0x46'),_0x41c0bc['name']),_0x3d49('0x56'),_0x41c0bc);}}};VoiceQueueReport['prototype'][_0x3d49('0x57')]=function(_0x90c7ee){return _0x90c7ee!==null&&!_[_0x3d49('0x2a')](_0x90c7ee);};VoiceQueueReport[_0x3d49('0x9')][_0x3d49('0x29')]=function(){var _0x2e4abe=this;setInterval(function(){_0x2e4abe[_0x3d49('0x32')]();ami[_0x3d49('0x36')]({'action':_0x3d49('0x58')})['catch'](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0x3d49('0x9')][_0x3d49('0x28')]=function(){var _0x523177=this;setInterval(function(){if(_0x523177[_0x3d49('0x59')]){return ami[_0x3d49('0x36')]({'action':_0x3d49('0x13')})[_0x3d49('0x5a')](function(_0x2d250a){_0x523177[_0x3d49('0x59')]=![];})['catch'](loggerCatch(_0x3d49('0x5b')));}},0x3e8);};VoiceQueueReport['prototype'][_0x3d49('0x14')]=function(_0x33a7f7){try{if(this['isNotNull'](_0x33a7f7)&&this['isNotNull'](_0x33a7f7[_0x3d49('0x5c')])){if(this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]]){var _0x32be4f=_[_0x3d49('0x5d')](this['channels'],'queue')[_0x33a7f7['queue']]||0x0;var _0x560094=_0x32be4f-_0x33a7f7[_0x3d49('0x5e')];if(this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]][_0x3d49('0x30')]!==_[_0x3d49('0x5f')](_0x33a7f7['callers'])||this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]][_0x3d49('0x60')]!==_[_0x3d49('0x5f')](_0x33a7f7['loggedin'])||this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]][_0x3d49('0x61')]!==_['toNumber'](_0x33a7f7[_0x3d49('0x61')])||this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]]['talking']!==_0x560094){this[_0x3d49('0x10')][_0x33a7f7['queue']][_0x3d49('0x30')]=_[_0x3d49('0x5f')](_0x33a7f7[_0x3d49('0x5e')]);this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]][_0x3d49('0x60')]=_[_0x3d49('0x5f')](_0x33a7f7[_0x3d49('0x62')]);this['voiceQueues'][_0x33a7f7[_0x3d49('0x5c')]][_0x3d49('0x61')]=_[_0x3d49('0x5f')](_0x33a7f7[_0x3d49('0x61')]);this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]][_0x3d49('0x2e')]=_0x560094>0x0?_0x560094:0x0;this['voiceQueues'][_0x33a7f7[_0x3d49('0x5c')]]['talking']=this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]][_0x3d49('0x2e')]>_[_0x3d49('0x5f')](_0x33a7f7[_0x3d49('0x62')])?_[_0x3d49('0x5f')](_0x33a7f7[_0x3d49('0x62')]):this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]][_0x3d49('0x2e')];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x33a7f7['queue']]);}ami['emit'](_0x3d49('0x63'),this[_0x3d49('0x10')][_0x33a7f7[_0x3d49('0x5c')]]);}}}catch(_0x18479f){logger[_0x3d49('0x3a')]('[syncQueueSummary][VoiceQueueReport]',util[_0x3d49('0x64')](_0x18479f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d49('0x9')]['syncQueueSummaryComplete']=function(_0x2b9d2d){this[_0x3d49('0x59')]=!![];};VoiceQueueReport[_0x3d49('0x9')][_0x3d49('0x65')]=function(_0x5c3dd7){};VoiceQueueReport['prototype'][_0x3d49('0x18')]=function(_0x1eae3d){try{if(this[_0x3d49('0x57')](_0x1eae3d)){if(_[_0x3d49('0x2a')](this[_0x3d49('0x3c')][_0x1eae3d[_0x3d49('0x66')]])){this['queueReports'][_0x1eae3d[_0x3d49('0x66')]]=[];this[_0x3d49('0x33')][_0x1eae3d[_0x3d49('0x66')]]={};}var _0x353cde=new QueueReport();_0x353cde['name']=_0x1eae3d[_0x3d49('0x5c')];_0x353cde[_0x3d49('0x49')]=this[_0x3d49('0x10')][_0x353cde[_0x3d49('0x44')]]&&this[_0x3d49('0x10')][_0x353cde['name']][_0x3d49('0x49')]?this[_0x3d49('0x10')][_0x353cde[_0x3d49('0x44')]][_0x3d49('0x49')]||_0x3d49('0x4a'):_0x3d49('0x4a');_0x353cde['queue']=_0x1eae3d[_0x3d49('0x5c')];_0x353cde[_0x3d49('0x67')]=moment()[_0x3d49('0x43')](_0x3d49('0x68'));_0x353cde[_0x3d49('0x69')]=_0x1eae3d[_0x3d49('0x69')];_0x353cde[_0x3d49('0x6a')]=_0x1eae3d[_0x3d49('0x6a')];_[_0x3d49('0x6b')](_0x353cde,_[_0x3d49('0x6c')](_0x1eae3d,_['keys'](_0x353cde)));this['queueReports'][_0x1eae3d['uniqueid']][_0x3d49('0x6d')](_0x353cde);this[_0x3d49('0x33')][_0x1eae3d['uniqueid']]=_0x353cde;this['emitVoiceQueueChannelSave'](_0x353cde);}}catch(_0x2d503c){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x3d49('0x64')](_0x2d503c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d49('0x9')]['syncQueueCallerAbandon']=function(_0x3c5d79){try{if(this['isNotNull'](_0x3c5d79)){if(this[_0x3d49('0x3c')][_0x3c5d79[_0x3d49('0x66')]]){var _0x434a84=_[_0x3d49('0x6e')](this['queueReports'][_0x3c5d79[_0x3d49('0x66')]]);_0x434a84[_0x3d49('0x6f')]=![];_0x434a84[_0x3d49('0x70')]=null;_0x434a84[_0x3d49('0x71')]=_0x3c5d79[_0x3d49('0x71')];_0x434a84[_0x3d49('0x72')]=_0x3c5d79['originalposition'];_0x434a84[_0x3d49('0x73')]=!![];_0x434a84['queuecallerabandonAt']=moment()['format'](_0x3d49('0x68'));_0x434a84['queuecallerexitreason']=_0x3d49('0x74');_0x434a84[_0x3d49('0x75')]=null;this['channels'][_0x3c5d79[_0x3d49('0x66')]]=_0x434a84;this[_0x3d49('0x40')](_0x434a84);}}}catch(_0x56a67a){logger[_0x3d49('0x3a')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x3d49('0x64')](_0x56a67a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d49('0x9')]['syncQueueCallerLeave']=function(_0x295121){try{if(this[_0x3d49('0x57')](_0x295121)){if(this[_0x3d49('0x3c')][_0x295121[_0x3d49('0x66')]]){var _0x10a25c=_[_0x3d49('0x6e')](this['queueReports'][_0x295121[_0x3d49('0x66')]]);_0x10a25c[_0x3d49('0x76')]=moment()['format'](_0x3d49('0x68'));_0x10a25c[_0x3d49('0x77')]=_0x295121[_0x3d49('0x77')];_0x10a25c[_0x3d49('0x78')]=_0x295121['connectedlinename'];this[_0x3d49('0x33')][_0x295121[_0x3d49('0x66')]]=_0x10a25c;this['emitVoiceQueueChannelSave'](_0x10a25c);}}}catch(_0x4e1adf){logger[_0x3d49('0x3a')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0x3d49('0x64')](_0x4e1adf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3d49('0x79')]=function(_0x65b743){try{if(this[_0x3d49('0x57')](_0x65b743)){if(this[_0x3d49('0x3c')][_0x65b743[_0x3d49('0x66')]]){var _0x4fc500=_[_0x3d49('0x6e')](this[_0x3d49('0x3c')][_0x65b743[_0x3d49('0x66')]]);_0x4fc500[_0x3d49('0x6f')]=!![];_0x4fc500[_0x3d49('0x7a')]='COMPLETEDBYAGENT';}}}catch(_0x5e3206){logger[_0x3d49('0x3a')](_0x3d49('0x7b'),util['inspect'](_0x5e3206,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3d49('0x1c')]=function(_0x52c472){try{if(this[_0x3d49('0x57')](_0x52c472)){if(this['queueReports'][_0x52c472[_0x3d49('0x66')]]){var _0x8d2d8a=_[_0x3d49('0x6e')](this[_0x3d49('0x3c')][_0x52c472['uniqueid']]);_0x8d2d8a[_0x3d49('0x73')]=![];_0x8d2d8a[_0x3d49('0x7c')]=null;_0x8d2d8a[_0x3d49('0x7d')]=!![];_0x8d2d8a[_0x3d49('0x75')]=_0x52c472[_0x3d49('0x7e')];_0x8d2d8a['holdtime']=_0x52c472[_0x3d49('0x71')];_0x8d2d8a[_0x3d49('0x6f')]=!![];_0x8d2d8a[_0x3d49('0x7f')]=![];_0x8d2d8a[_0x3d49('0x80')]=null;if(!_0x8d2d8a[_0x3d49('0x81')]){if(_0x52c472[_0x3d49('0x82')]==_0x3d49('0x81')){_0x8d2d8a[_0x3d49('0x7a')]=_0x3d49('0x83');}else{if(_[_0x3d49('0x84')](_0x52c472[_0x3d49('0x85')][_0x3d49('0x86')](),_0x3d49('0x87'))){if(this[_0x3d49('0x3c')][_0x52c472[_0x3d49('0x88')]]){var _0x1d4aa3=_[_0x3d49('0x6e')](this[_0x3d49('0x3c')][_0x52c472[_0x3d49('0x88')]]);_0x1d4aa3[_0x3d49('0x6f')]=![];_0x1d4aa3['queuecallerexit']=!![];_0x1d4aa3['queuecallerexitAt']=moment(_0x8d2d8a[_0x3d49('0x67')])[_0x3d49('0x89')](_0x52c472[_0x3d49('0x71')],_0x3d49('0x8a'))['format'](_0x3d49('0x68'));_0x1d4aa3[_0x3d49('0x7a')]=_0x3d49('0x8b');_0x1d4aa3[_0x3d49('0x81')]=!![];_0x1d4aa3[_0x3d49('0x8c')]='FORWARD';_0x1d4aa3[_0x3d49('0x8d')]=_0x52c472[_0x3d49('0x8e')];_0x1d4aa3['transferuniqueid']=_0x52c472['uniqueid'];var _0x11e8ba=this[_0x3d49('0x3c')][_0x52c472['linkedid']];this[_0x3d49('0x3c')][_0x52c472['linkedid']]=this['queueReports'][_0x52c472['uniqueid']];this[_0x3d49('0x3c')][_0x52c472['uniqueid']]=_0x11e8ba;}}else{_0x8d2d8a['queuecallerexitreason']=_0x3d49('0x8f')+_0x52c472[_0x3d49('0x82')]['toUpperCase']();}}}this[_0x3d49('0x33')][_0x52c472[_0x3d49('0x66')]]=_0x8d2d8a;this[_0x3d49('0x40')](_0x8d2d8a);}}}catch(_0x17bfa9){logger[_0x3d49('0x3a')](_0x3d49('0x90'),util['inspect'](_0x17bfa9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3d49('0x91')]=function(_0x12f222){try{if(this[_0x3d49('0x57')](_0x12f222)){this['addVariable'](_0x12f222[_0x3d49('0x66')],_['keys'](_0x12f222[_0x3d49('0x92')])[0x0],_0x12f222[_0x3d49('0x93')]);if(this['queueReports'][_0x12f222[_0x3d49('0x66')]]){var _0xc44d0e=_[_0x3d49('0x6e')](this[_0x3d49('0x3c')][_0x12f222[_0x3d49('0x66')]]);if(_0xc44d0e){if(this['isNotNull'](_0x12f222['variable'])&&this[_0x3d49('0x57')](_0x12f222[_0x3d49('0x92')][_0x3d49('0x94')])){switch(_0x12f222[_0x3d49('0x93')]){case _0x3d49('0x95'):_0xc44d0e['queuecallerexit']=![];_0xc44d0e['queuecallerexitAt']=null;break;default:_0xc44d0e[_0x3d49('0x7f')]=!![];_0xc44d0e[_0x3d49('0x80')]=moment()[_0x3d49('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0xc44d0e[_0x3d49('0x76')]=moment()[_0x3d49('0x43')]('YYYY-MM-DD\x20HH:mm:ss');}_0xc44d0e['queuecallerabandon']=![];_0xc44d0e['queuecallerabandonAt']=null;_0xc44d0e['queuecallerexitreason']=_0x12f222['value'];this[_0x3d49('0x33')][_0x12f222[_0x3d49('0x66')]]=_0xc44d0e;this[_0x3d49('0x40')](_0xc44d0e);}else if(this[_0x3d49('0x57')](_0x12f222[_0x3d49('0x92')])&&this[_0x3d49('0x57')](_0x12f222[_0x3d49('0x92')][_0x3d49('0x96')])){if(!_0xc44d0e[_0x3d49('0x73')]){_0xc44d0e['queuecallerexit']=!![];_0xc44d0e[_0x3d49('0x80')]=moment()['format'](_0x3d49('0x68'));_0xc44d0e[_0x3d49('0x7a')]='EXITWITHKEY';_0xc44d0e[_0x3d49('0x76')]=moment()[_0x3d49('0x43')](_0x3d49('0x68'));this[_0x3d49('0x33')][_0x12f222['uniqueid']]=_0xc44d0e;}}_0xc44d0e[_0x3d49('0x12')]=this[_0x3d49('0x12')][_0x12f222[_0x3d49('0x66')]];}}}}catch(_0x2c1d64){logger[_0x3d49('0x3a')](_0x3d49('0x97'),util[_0x3d49('0x64')](_0x2c1d64,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d49('0x9')][_0x3d49('0x98')]=function(_0x5deb07,_0x3caad4,_0x1404c3){var _0x55173c=[_0x3d49('0x99'),_0x3d49('0x9a'),_0x3d49('0x9b'),'rtpaudioqosjitterbridged',_0x3d49('0x9c'),_0x3d49('0x9d'),_0x3d49('0x9e'),'rtpaudioqosrttbridged',_0x3d49('0x9f'),_0x3d49('0xa0'),'bridgepeer','bridgepvtcallid',_0x3d49('0xa1'),'memberdynamic','memberinterface',_0x3d49('0xa2'),_0x3d49('0x7e'),_0x3d49('0xa3'),_0x3d49('0xa4')];if(!_[_0x3d49('0x35')](_0x3caad4)&&!_[_0x3d49('0xa5')](_0x55173c,_0x3caad4)){if(_['isUndefined'](this[_0x3d49('0x12')][_0x5deb07])){this[_0x3d49('0x12')][_0x5deb07]={};}this['variables'][_0x5deb07][_0x3caad4]=_0x1404c3;}};VoiceQueueReport[_0x3d49('0x9')][_0x3d49('0xa6')]=function(_0x2c54a9){try{if(this[_0x3d49('0x57')](_0x2c54a9)){if(this[_0x3d49('0x3c')][_0x2c54a9[_0x3d49('0x66')]]){for(var _0x4024d5=0x0,_0xc97fa2={};_0x4024d50x0?_0xdaa63e:0x0;this[_0x0949('0x10')][_0x3e857a[_0x0949('0x5e')]][_0x0949('0x30')]=this['voiceQueues'][_0x3e857a[_0x0949('0x5e')]][_0x0949('0x30')]>_['toNumber'](_0x3e857a[_0x0949('0x62')])?_['toNumber'](_0x3e857a['loggedin']):this['voiceQueues'][_0x3e857a[_0x0949('0x5e')]][_0x0949('0x30')];this[_0x0949('0x4a')](this[_0x0949('0x10')][_0x3e857a['queue']]);}ami[_0x0949('0x44')]('custom:queuesummary',this[_0x0949('0x10')][_0x3e857a['queue']]);}}}catch(_0x13b956){logger['error']('[syncQueueSummary][VoiceQueueReport]',util['inspect'](_0x13b956,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0949('0x34')][_0x0949('0x17')]=function(_0x2ffe35){this['flagQueueSummary']=!![];};VoiceQueueReport[_0x0949('0x34')]['syncNewExten']=function(_0x46421c){};VoiceQueueReport[_0x0949('0x34')][_0x0949('0x19')]=function(_0x103a9c){try{if(this[_0x0949('0x59')](_0x103a9c)){if(_[_0x0949('0x2c')](this[_0x0949('0xd')][_0x103a9c[_0x0949('0x63')]])){this[_0x0949('0xd')][_0x103a9c[_0x0949('0x63')]]=[];this[_0x0949('0xf')][_0x103a9c[_0x0949('0x63')]]={};}var _0x27b9c1=new QueueReport();_0x27b9c1['name']=_0x103a9c[_0x0949('0x5e')];_0x27b9c1[_0x0949('0x52')]=this[_0x0949('0x10')][_0x27b9c1[_0x0949('0x46')]]&&this[_0x0949('0x10')][_0x27b9c1['name']][_0x0949('0x52')]?this[_0x0949('0x10')][_0x27b9c1[_0x0949('0x46')]][_0x0949('0x52')]||_0x0949('0x4b'):_0x0949('0x4b');_0x27b9c1['queue']=_0x103a9c[_0x0949('0x5e')];_0x27b9c1['queuecallerjoinAt']=moment()[_0x0949('0x48')](_0x0949('0x64'));_0x27b9c1[_0x0949('0x65')]=_0x103a9c[_0x0949('0x65')];_0x27b9c1[_0x0949('0x66')]=_0x103a9c[_0x0949('0x66')];_[_0x0949('0x67')](_0x27b9c1,_[_0x0949('0x68')](_0x103a9c,_['keys'](_0x27b9c1)));this[_0x0949('0xd')][_0x103a9c[_0x0949('0x63')]]['push'](_0x27b9c1);this[_0x0949('0xf')][_0x103a9c['uniqueid']]=_0x27b9c1;this[_0x0949('0x43')](_0x27b9c1);}}catch(_0x35ff4d){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x0949('0x69')](_0x35ff4d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0949('0x34')]['syncQueueCallerAbandon']=function(_0x5a8288){try{if(this[_0x0949('0x59')](_0x5a8288)){if(this[_0x0949('0xd')][_0x5a8288[_0x0949('0x63')]]){var _0x4e1448=_['last'](this[_0x0949('0xd')][_0x5a8288[_0x0949('0x63')]]);_0x4e1448[_0x0949('0x6a')]=![];_0x4e1448[_0x0949('0x6b')]=null;_0x4e1448[_0x0949('0x6c')]=_0x5a8288[_0x0949('0x6c')];_0x4e1448['originalposition']=_0x5a8288[_0x0949('0x6d')];_0x4e1448['queuecallerabandon']=!![];_0x4e1448[_0x0949('0x6e')]=moment()['format'](_0x0949('0x64'));_0x4e1448['queuecallerexitreason']=_0x0949('0x6f');_0x4e1448['lastAssignedTo']=null;this[_0x0949('0xf')][_0x5a8288[_0x0949('0x63')]]=_0x4e1448;this[_0x0949('0x42')](_0x4e1448);}}}catch(_0x44912e){logger[_0x0949('0x3e')](_0x0949('0x70'),util[_0x0949('0x69')](_0x44912e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0949('0x1c')]=function(_0x482134){try{if(this[_0x0949('0x59')](_0x482134)){if(this[_0x0949('0xd')][_0x482134[_0x0949('0x63')]]){var _0x42d6ad=_[_0x0949('0x71')](this[_0x0949('0xd')][_0x482134[_0x0949('0x63')]]);_0x42d6ad[_0x0949('0x72')]=moment()[_0x0949('0x48')](_0x0949('0x64'));_0x42d6ad[_0x0949('0x73')]=_0x482134[_0x0949('0x73')];_0x42d6ad['connectedlinename']=_0x482134[_0x0949('0x74')];this[_0x0949('0xf')][_0x482134[_0x0949('0x63')]]=_0x42d6ad;this[_0x0949('0x43')](_0x42d6ad);}}}catch(_0x1d016e){logger['error'](_0x0949('0x75'),util[_0x0949('0x69')](_0x1d016e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0949('0x34')][_0x0949('0x76')]=function(_0x10b4b2){try{if(this['isNotNull'](_0x10b4b2)){if(this[_0x0949('0xd')][_0x10b4b2[_0x0949('0x63')]]){var _0x1c5762=_[_0x0949('0x71')](this[_0x0949('0xd')][_0x10b4b2['uniqueid']]);_0x1c5762[_0x0949('0x6a')]=!![];_0x1c5762[_0x0949('0x77')]='COMPLETEDBYAGENT';}}}catch(_0x289598){logger[_0x0949('0x3e')]('[syncAgentConnect][VoiceQueueReport]',util[_0x0949('0x69')](_0x289598,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0949('0x34')][_0x0949('0x1d')]=function(_0x3cffcf){try{if(this[_0x0949('0x59')](_0x3cffcf)){if(this[_0x0949('0xd')][_0x3cffcf[_0x0949('0x63')]]){var _0x413a9d=_[_0x0949('0x71')](this[_0x0949('0xd')][_0x3cffcf['uniqueid']]);_0x413a9d[_0x0949('0x1a')]=![];_0x413a9d['queuecallerabandonAt']=null;_0x413a9d[_0x0949('0x78')]=!![];_0x413a9d['lastAssignedTo']=_0x3cffcf[_0x0949('0x79')];_0x413a9d[_0x0949('0x6c')]=_0x3cffcf[_0x0949('0x6c')];_0x413a9d[_0x0949('0x6a')]=!![];_0x413a9d[_0x0949('0x7a')]=![];_0x413a9d['queuecallerexitAt']=null;if(!_0x413a9d[_0x0949('0x7b')]){if(_0x3cffcf['reason']=='transfer'){_0x413a9d['queuecallerexitreason']=_0x0949('0x7c');}else{if(_['startsWith'](_0x3cffcf[_0x0949('0x3a')]['toLowerCase'](),'local/')){if(this[_0x0949('0xd')][_0x3cffcf[_0x0949('0x7d')]]){var _0xb8160f=_[_0x0949('0x71')](this[_0x0949('0xd')][_0x3cffcf[_0x0949('0x7d')]]);_0xb8160f[_0x0949('0x6a')]=![];_0xb8160f['queuecallerexit']=!![];_0xb8160f[_0x0949('0x7e')]=moment(_0x413a9d[_0x0949('0x7f')])[_0x0949('0x80')](_0x3cffcf[_0x0949('0x6c')],_0x0949('0x81'))[_0x0949('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0xb8160f[_0x0949('0x77')]=_0x0949('0x82');_0xb8160f[_0x0949('0x7b')]=!![];_0xb8160f[_0x0949('0x83')]=_0x0949('0x84');_0xb8160f['transferexten']=_0x3cffcf[_0x0949('0x85')];_0xb8160f[_0x0949('0x86')]=_0x3cffcf[_0x0949('0x63')];var _0x175ee9=this[_0x0949('0xd')][_0x3cffcf[_0x0949('0x7d')]];this[_0x0949('0xd')][_0x3cffcf['linkedid']]=this[_0x0949('0xd')][_0x3cffcf['uniqueid']];this['queueReports'][_0x3cffcf[_0x0949('0x63')]]=_0x175ee9;}}else{_0x413a9d['queuecallerexitreason']='COMPLETEDBY'+_0x3cffcf[_0x0949('0x87')][_0x0949('0x88')]();}}}this[_0x0949('0xf')][_0x3cffcf['uniqueid']]=_0x413a9d;this['emitVoiceQueueChannelRemove'](_0x413a9d);}}}catch(_0x40abde){logger[_0x0949('0x3e')](_0x0949('0x89'),util[_0x0949('0x69')](_0x40abde,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0949('0x34')][_0x0949('0x1e')]=function(_0x1cfc0c){try{if(this[_0x0949('0x59')](_0x1cfc0c)){this[_0x0949('0x8a')](_0x1cfc0c[_0x0949('0x63')],_[_0x0949('0x8b')](_0x1cfc0c[_0x0949('0x8c')])[0x0],_0x1cfc0c['value']);if(this[_0x0949('0xd')][_0x1cfc0c[_0x0949('0x63')]]){var _0x8f0fdf=_[_0x0949('0x71')](this['queueReports'][_0x1cfc0c[_0x0949('0x63')]]);if(_0x8f0fdf){if(this[_0x0949('0x59')](_0x1cfc0c[_0x0949('0x8c')])&&this[_0x0949('0x59')](_0x1cfc0c['variable'][_0x0949('0x8d')])){switch(_0x1cfc0c[_0x0949('0x8e')]){case _0x0949('0x8f'):_0x8f0fdf[_0x0949('0x7a')]=![];_0x8f0fdf['queuecallerexitAt']=null;break;default:_0x8f0fdf['queuecallerexit']=!![];_0x8f0fdf['queuecallerexitAt']=moment()[_0x0949('0x48')](_0x0949('0x64'));_0x8f0fdf[_0x0949('0x72')]=moment()[_0x0949('0x48')](_0x0949('0x64'));}_0x8f0fdf[_0x0949('0x1a')]=![];_0x8f0fdf['queuecallerabandonAt']=null;_0x8f0fdf[_0x0949('0x77')]=_0x1cfc0c[_0x0949('0x8e')];this['channels'][_0x1cfc0c[_0x0949('0x63')]]=_0x8f0fdf;this[_0x0949('0x42')](_0x8f0fdf);}else if(this[_0x0949('0x59')](_0x1cfc0c[_0x0949('0x8c')])&&this[_0x0949('0x59')](_0x1cfc0c['variable'][_0x0949('0x90')])){if(!_0x8f0fdf[_0x0949('0x1a')]){_0x8f0fdf['queuecallerexit']=!![];_0x8f0fdf[_0x0949('0x7e')]=moment()[_0x0949('0x48')](_0x0949('0x64'));_0x8f0fdf['queuecallerexitreason']=_0x0949('0x91');_0x8f0fdf[_0x0949('0x72')]=moment()[_0x0949('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1cfc0c['uniqueid']]=_0x8f0fdf;}}_0x8f0fdf[_0x0949('0x13')]=this[_0x0949('0x13')][_0x1cfc0c[_0x0949('0x63')]];}}}}catch(_0x44393a){logger['error']('[syncVarSet][VoiceQueueReport]',util[_0x0949('0x69')](_0x44393a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0949('0x34')][_0x0949('0x8a')]=function(_0x38f873,_0x3627a6,_0x4e21c5){var _0x42d353=[_0x0949('0x92'),_0x0949('0x93'),_0x0949('0x94'),_0x0949('0x95'),_0x0949('0x96'),_0x0949('0x97'),_0x0949('0x98'),_0x0949('0x99'),_0x0949('0x9a'),'sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall',_0x0949('0x79'),_0x0949('0x9b'),'memberrealtime'];if(!_[_0x0949('0x37')](_0x3627a6)&&!_['includes'](_0x42d353,_0x3627a6)){if(_[_0x0949('0x2c')](this[_0x0949('0x13')][_0x38f873])){this[_0x0949('0x13')][_0x38f873]={};}this[_0x0949('0x13')][_0x38f873][_0x3627a6]=_0x4e21c5;}};VoiceQueueReport[_0x0949('0x34')][_0x0949('0x20')]=function(_0x371453){try{if(this[_0x0949('0x59')](_0x371453)){if(this['queueReports'][_0x371453[_0x0949('0x63')]]){for(var _0x4df8b0=0x0,_0x2ea7d4={};_0x4df8b0=0x0?moment(_0x3fcf96['endtime'])[_0xd4c7('0xe')](_0x3fcf96[_0xd4c7('0x19')],'seconds'):null,'data1':_0xd4c7('0x1b'),'data2':_0x3fcf96[_0xd4c7('0x13')],'data3':_0x3fcf96[_0xd4c7('0x1c')],'data4':_0x3fcf96[_0xd4c7('0x1d')]||null,'role':_0xd4c7('0x12'),'internal':_0x3fcf96[_0xd4c7('0x13')]?_['toNumber'](_0x3fcf96['accountcode']):undefined,'uniqueid':_0x3fcf96[_0xd4c7('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xd2f6=['exten','queue','accountcode','uniqueid','voiceDialReport','endtime','starttime','outbound','dialstring','agent','toNumber','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xd2f6,0x110));var _0x6d2f=function(_0x54a6ff,_0x435642){_0x54a6ff=_0x54a6ff-0x0;var _0x3f0d6a=_0xd2f6[_0x54a6ff];return _0x3f0d6a;};'use strict';var moment=require('moment');var _=require(_0x6d2f('0x0'));var util=require(_0x6d2f('0x1'));var client=require('../client');exports[_0x6d2f('0x2')]=function(_0x22dbd2){var _0x58cb4e=_0x22dbd2[_0x6d2f('0x3')]||_0x22dbd2[_0x6d2f('0x4')];return client[_0x6d2f('0x5')](_0x6d2f('0x6'),{'body':{'channel':_0x6d2f('0x7'),'membername':_0x22dbd2[_0x6d2f('0x8')],'interface':_[_0x6d2f('0x9')](_0x22dbd2[_0x6d2f('0xa')])?util[_0x6d2f('0xb')]('SIP/%s',_0x22dbd2[_0x6d2f('0x8')]):_0x22dbd2['interface'],'type':_0x6d2f('0xc'),'enterAt':_0x22dbd2[_0x6d2f('0xd')],'exitAt':_0x58cb4e,'duration':moment(_0x58cb4e)[_0x6d2f('0xe')](_0x22dbd2[_0x6d2f('0xd')],_0x6d2f('0xf')),'data1':_0x6d2f('0x10'),'data2':_0x22dbd2[_0x6d2f('0x11')],'data3':_0x22dbd2[_0x6d2f('0x12')],'data4':null,'data5':_0x22dbd2[_0x6d2f('0x13')],'role':'agent','internal':_0x22dbd2[_0x6d2f('0x14')]?_['toNumber'](_0x22dbd2['accountcode']):undefined,'uniqueid':_0x22dbd2[_0x6d2f('0x15')]},'log':'CreateMemberReport'});};exports[_0x6d2f('0x16')]=function(_0x273381){return client[_0x6d2f('0x5')](_0x6d2f('0x6'),{'body':{'channel':_0x6d2f('0x7'),'membername':_0x273381['membername'],'interface':_0x273381[_0x6d2f('0xa')],'type':_0x6d2f('0xc'),'enterAt':_0x273381['starttime'],'exitAt':_0x273381['endtime'],'duration':moment(_0x273381[_0x6d2f('0x17')])[_0x6d2f('0xe')](_0x273381[_0x6d2f('0x18')],_0x6d2f('0xf'))>=0x0?moment(_0x273381[_0x6d2f('0x17')])[_0x6d2f('0xe')](_0x273381[_0x6d2f('0x18')],'seconds'):null,'data1':_0x6d2f('0x19'),'data2':_0x273381['accountcode'],'data3':_0x273381[_0x6d2f('0x12')],'data4':_0x273381[_0x6d2f('0x1a')]||null,'role':_0x6d2f('0x1b'),'internal':_0x273381[_0x6d2f('0x14')]?_[_0x6d2f('0x1c')](_0x273381[_0x6d2f('0x14')]):undefined,'uniqueid':_0x273381[_0x6d2f('0x15')]},'log':_0x6d2f('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index cf59bcc..5500686 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbee3=['html','getTemplates','Request','GetTemplate'];(function(_0x1021c2,_0x3aa0b7){var _0x2f4dc6=function(_0x2ec18a){while(--_0x2ec18a){_0x1021c2['push'](_0x1021c2['shift']());}};_0x2f4dc6(++_0x3aa0b7);}(_0xbee3,0xd5));var _0x3bee=function(_0x53c7ad,_0x1c6f93){_0x53c7ad=_0x53c7ad-0x0;var _0x43dd7c=_0xbee3[_0x53c7ad];return _0x43dd7c;};'use strict';var client=require('../client');exports[_0x3bee('0x0')]=function(_0x49f52b){return function(_0x56a879){return client[_0x3bee('0x1')](_0x3bee('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x3bee('0x3')]},'log':_0x3bee('0x2')});};}; \ No newline at end of file +var _0xc788=['html','../client','getTemplates','GetTemplate','name'];(function(_0x54be57,_0x13ec32){var _0x34b498=function(_0x48b7da){while(--_0x48b7da){_0x54be57['push'](_0x54be57['shift']());}};_0x34b498(++_0x13ec32);}(_0xc788,0xc4));var _0x8c78=function(_0x378fc7,_0x5181a3){_0x378fc7=_0x378fc7-0x0;var _0x44dfec=_0xc788[_0x378fc7];return _0x44dfec;};'use strict';var client=require(_0x8c78('0x0'));exports[_0x8c78('0x1')]=function(_0x2344ba){return function(_0x4ecb26){return client['Request'](_0x8c78('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8c78('0x3'),_0x8c78('0x4')]},'log':_0x8c78('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7fe3686..8cdb8df 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe500=['data6','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','operator','value','field','Action','Actions','action','data1','data2','data3','data4','data5'];(function(_0x444d25,_0x16b7e0){var _0x39b419=function(_0x369e53){while(--_0x369e53){_0x444d25['push'](_0x444d25['shift']());}};_0x39b419(++_0x16b7e0);}(_0xe500,0x151));var _0x0e50=function(_0xe480f0,_0x4c0dc1){_0xe480f0=_0xe480f0-0x0;var _0x57b198=_0xe500[_0xe480f0];return _0x57b198;};'use strict';var client=require(_0x0e50('0x0'));exports[_0x0e50('0x1')]=function(_0x2163d2){return function(_0x281a56){return client[_0x0e50('0x2')](_0x0e50('0x3'),{'options':{'raw':![],'attributes':['id',_0x0e50('0x4'),_0x0e50('0x5'),_0x0e50('0x6')],'include':[{'model':_0x0e50('0x7'),'as':_0x0e50('0x8'),'attributes':['id','field',_0x0e50('0x9'),_0x0e50('0xa')]},{'model':_0x0e50('0x7'),'as':'AnyConditions','attributes':['id',_0x0e50('0xb'),'operator',_0x0e50('0xa')]},{'model':_0x0e50('0xc'),'as':_0x0e50('0xd'),'attributes':['id',_0x0e50('0xe'),_0x0e50('0xf'),_0x0e50('0x10'),_0x0e50('0x11'),_0x0e50('0x12'),_0x0e50('0x13'),_0x0e50('0x14'),'data7']}]},'log':_0x0e50('0x3')});};}; \ No newline at end of file +var _0x4b9f=['operator','Action','Actions','action','data1','data2','data3','data5','data6','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','value','AnyConditions','field'];(function(_0x3e9a1c,_0x2ec450){var _0x2511e6=function(_0x12f093){while(--_0x12f093){_0x3e9a1c['push'](_0x3e9a1c['shift']());}};_0x2511e6(++_0x2ec450);}(_0x4b9f,0x1ec));var _0xf4b9=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4b9f[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0xf4b9('0x0'));exports[_0xf4b9('0x1')]=function(_0x399817){return function(_0xece989){return client[_0xf4b9('0x2')](_0xf4b9('0x3'),{'options':{'raw':![],'attributes':['id',_0xf4b9('0x4'),_0xf4b9('0x5'),_0xf4b9('0x6')],'include':[{'model':_0xf4b9('0x7'),'as':_0xf4b9('0x8'),'attributes':['id','field','operator',_0xf4b9('0x9')]},{'model':_0xf4b9('0x7'),'as':_0xf4b9('0xa'),'attributes':['id',_0xf4b9('0xb'),_0xf4b9('0xc'),_0xf4b9('0x9')]},{'model':_0xf4b9('0xd'),'as':_0xf4b9('0xe'),'attributes':['id',_0xf4b9('0xf'),_0xf4b9('0x10'),_0xf4b9('0x11'),_0xf4b9('0x12'),'data4',_0xf4b9('0x13'),_0xf4b9('0x14'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e98b3d1..88b41ae 100644 --- a/server/services/ami/rpc/trunk.js +++ b/server/services/ami/rpc/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0d2=['name','getTrunks'];(function(_0x3a56d7,_0x8efe26){var _0x2e93e0=function(_0x139697){while(--_0x139697){_0x3a56d7['push'](_0x3a56d7['shift']());}};_0x2e93e0(++_0x8efe26);}(_0xb0d2,0xc3));var _0x2b0d=function(_0x14b26e,_0x1ad6cd){_0x14b26e=_0x14b26e-0x0;var _0x43878b=_0xb0d2[_0x14b26e];return _0x43878b;};'use strict';var client=require('../client');exports[_0x2b0d('0x0')]=function(_0x53d4e8){return function(_0x39ded0){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2b0d('0x1'),'registry']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x342e=['registry','../client','GetTrunk','name'];(function(_0x231637,_0xf56282){var _0x23f1d0=function(_0x2f69c6){while(--_0x2f69c6){_0x231637['push'](_0x231637['shift']());}};_0x23f1d0(++_0xf56282);}(_0x342e,0x115));var _0xe342=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x342e[_0x5dee2a];return _0x31e98e;};'use strict';var client=require(_0xe342('0x0'));exports['getTrunks']=function(_0x20825e){return function(_0x406860){return client['Request'](_0xe342('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe342('0x2'),_0xe342('0x3')]},'log':_0xe342('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index d77fd2e..ed98157 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb130=['name','accountcode','online','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','email','fullname','lastLoginAt','getAgent','../client','getAgents','Request','GetUser','agent'];(function(_0x30a959,_0x5bccb2){var _0x390fcd=function(_0x3bcfe6){while(--_0x3bcfe6){_0x30a959['push'](_0x30a959['shift']());}};_0x390fcd(++_0x5bccb2);}(_0xb130,0xaa));var _0x0b13=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0xb130[_0x176317];return _0xef2759;};'use strict';var client=require(_0x0b13('0x0'));exports[_0x0b13('0x1')]=function(){return function(){return client[_0x0b13('0x2')](_0x0b13('0x3'),{'options':{'raw':![],'where':{'role':_0x0b13('0x4')},'attributes':['id',_0x0b13('0x5'),'email',_0x0b13('0x6'),'fullname',_0x0b13('0x7'),'lastLoginAt',_0x0b13('0x8'),_0x0b13('0x9'),_0x0b13('0xa'),_0x0b13('0xb'),_0x0b13('0xc'),_0x0b13('0xd')]},'log':_0x0b13('0x1')});};};exports[_0x0b13('0xe')]=function(){return function(){return client[_0x0b13('0x2')](_0x0b13('0x3'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x0b13('0x5'),'accountcode',_0x0b13('0xf')]},'log':_0x0b13('0xe')});};};exports[_0x0b13('0x10')]=function(_0x36a008,_0x153f25,_0x1e770d){return client[_0x0b13('0x2')](_0x0b13('0x11'),{'body':{'type':_0x153f25,'uniqueid':_0x1e770d},'options':{'where':{'id':_0x36a008['id']}},'log':_0x0b13('0x10')});};exports[_0x0b13('0x12')]=function(_0x2e8e54){return client[_0x0b13('0x2')](_0x0b13('0x13'),{'body':{},'options':{'where':{'id':_0x2e8e54['id']}},'log':'savePause'});};exports['getAgent']=function(_0x76c5f0){return client[_0x0b13('0x2')](_0x0b13('0x14'),{'options':{'raw':![],'where':{'role':'agent','id':_0x76c5f0},'attributes':['id',_0x0b13('0x5'),_0x0b13('0x15'),_0x0b13('0x6'),_0x0b13('0x16'),_0x0b13('0x7'),_0x0b13('0x17'),_0x0b13('0x8'),_0x0b13('0x9'),_0x0b13('0xa'),_0x0b13('0xd')]},'log':_0x0b13('0x18')});}; \ No newline at end of file +var _0xc2ab=['voicePause','mobile','interface','getTelephones','telephone','internal','PauseUser','saveUnpause','UnpauseUser','savePause','ShowUser','lastPauseAt','getAgent','../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType'];(function(_0x159a87,_0x2e7eb8){var _0x1e8541=function(_0x466437){while(--_0x466437){_0x159a87['push'](_0x159a87['shift']());}};_0x1e8541(++_0x2e7eb8);}(_0xc2ab,0xe5));var _0xbc2a=function(_0x28015a,_0x37d2d7){_0x28015a=_0x28015a-0x0;var _0x43bbd5=_0xc2ab[_0x28015a];return _0x43bbd5;};'use strict';var client=require(_0xbc2a('0x0'));exports[_0xbc2a('0x1')]=function(){return function(){return client[_0xbc2a('0x2')](_0xbc2a('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0xbc2a('0x4'),_0xbc2a('0x5'),_0xbc2a('0x6'),_0xbc2a('0x7'),_0xbc2a('0x8'),_0xbc2a('0x9'),_0xbc2a('0xa'),'lastPauseAt',_0xbc2a('0xb'),'phone',_0xbc2a('0xc'),_0xbc2a('0xd')]},'log':_0xbc2a('0x1')});};};exports[_0xbc2a('0xe')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xbc2a('0xf')},'attributes':['id',_0xbc2a('0x4'),_0xbc2a('0x6'),_0xbc2a('0x10')]},'log':_0xbc2a('0xe')});};};exports['savePause']=function(_0x40673e,_0x3256b0,_0x42f99d){return client[_0xbc2a('0x2')](_0xbc2a('0x11'),{'body':{'type':_0x3256b0,'uniqueid':_0x42f99d},'options':{'where':{'id':_0x40673e['id']}},'log':'savePause'});};exports[_0xbc2a('0x12')]=function(_0x5be37f){return client[_0xbc2a('0x2')](_0xbc2a('0x13'),{'body':{},'options':{'where':{'id':_0x5be37f['id']}},'log':_0xbc2a('0x14')});};exports['getAgent']=function(_0xecd56f){return client['Request'](_0xbc2a('0x15'),{'options':{'raw':![],'where':{'role':'agent','id':_0xecd56f},'attributes':['id',_0xbc2a('0x4'),_0xbc2a('0x5'),'accountcode',_0xbc2a('0x7'),_0xbc2a('0x8'),_0xbc2a('0x9'),_0xbc2a('0xa'),_0xbc2a('0x16'),'voicePause','interface']},'log':_0xbc2a('0x17')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 4051e37..41d9233 100644 --- a/server/services/ami/rpc/voiceAgentReport.js +++ b/server/services/ami/rpc/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bd2=['UpdateVoiceAgentReport','../client','CreateVoiceAgentReport','update','Request'];(function(_0x4addaa,_0x443146){var _0x3eb2eb=function(_0x192442){while(--_0x192442){_0x4addaa['push'](_0x4addaa['shift']());}};_0x3eb2eb(++_0x443146);}(_0x7bd2,0xf6));var _0x27bd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7bd2[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x27bd('0x0'));exports['create']=function(_0x43fa60){return client['Request'](_0x27bd('0x1'),{'body':_0x43fa60,'log':_0x27bd('0x1')});};exports[_0x27bd('0x2')]=function(_0x396562,_0x170f8f,_0x3069f6){return client[_0x27bd('0x3')](_0x27bd('0x4'),{'body':_0x396562,'options':{'where':{'uniqueid':_0x170f8f,'interface':_0x3069f6}},'log':_0x27bd('0x4')});}; \ No newline at end of file +var _0xb199=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create'];(function(_0x5c859c,_0x4b594e){var _0x3aeda2=function(_0xb56e0b){while(--_0xb56e0b){_0x5c859c['push'](_0x5c859c['shift']());}};_0x3aeda2(++_0x4b594e);}(_0xb199,0xab));var _0x9b19=function(_0x1140ff,_0x4f02bf){_0x1140ff=_0x1140ff-0x0;var _0x48e42c=_0xb199[_0x1140ff];return _0x48e42c;};'use strict';var client=require('../client');exports[_0x9b19('0x0')]=function(_0x15208d){return client['Request'](_0x9b19('0x1'),{'body':_0x15208d,'log':_0x9b19('0x1')});};exports[_0x9b19('0x2')]=function(_0x28000b,_0x46e944,_0x1c7254){return client['Request'](_0x9b19('0x3'),{'body':_0x28000b,'options':{'where':{'uniqueid':_0x46e944,'interface':_0x1c7254}},'log':_0x9b19('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 86e33b5..5f5bc05 100644 --- a/server/services/ami/rpc/voiceCallReport.js +++ b/server/services/ami/rpc/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58cb=['getVoiceCallReports','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','GetVoiceCallReports','lodash','../client','create','Request','CreateVoiceCallReport','context'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x58cb,0x1da));var _0xb58c=function(_0xc86e23,_0x156fda){_0xc86e23=_0xc86e23-0x0;var _0x8656ad=_0x58cb[_0xc86e23];return _0x8656ad;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xb58c('0x0'));var client=require(_0xb58c('0x1'));exports[_0xb58c('0x2')]=function(_0x59cc8d){return client[_0xb58c('0x3')](_0xb58c('0x4'),{'body':_['merge'](_0x59cc8d,{'source':_0x59cc8d['calleridnum'],'destinationcontext':_0x59cc8d[_0xb58c('0x5')],'callerid':_0x59cc8d['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xb58c('0x4')});};exports[_0xb58c('0x6')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xb58c('0x7')],'createdAt':{'$between':[moment()['startOf']('day')[_0xb58c('0x8')](_0xb58c('0x9')),moment()[_0xb58c('0xa')](_0xb58c('0xb'))[_0xb58c('0x8')](_0xb58c('0x9'))]}},'attributes':[_0xb58c('0xc'),_0xb58c('0xd'),_0xb58c('0xe'),'billableseconds']},'log':_0xb58c('0xf')});};}; \ No newline at end of file +var _0x8e5a=['lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8e5a,0xda));var _0xa8e5=function(_0x39671a,_0x5a3f5b){_0x39671a=_0x39671a-0x0;var _0x1c8a6a=_0x8e5a[_0x39671a];return _0x1c8a6a;};'use strict';var moment=require(_0xa8e5('0x0'));var util=require(_0xa8e5('0x1'));var _=require(_0xa8e5('0x2'));var client=require('../client');exports[_0xa8e5('0x3')]=function(_0x51ddf2){return client[_0xa8e5('0x4')](_0xa8e5('0x5'),{'body':_[_0xa8e5('0x6')](_0x51ddf2,{'source':_0x51ddf2[_0xa8e5('0x7')],'destinationcontext':_0x51ddf2[_0xa8e5('0x8')],'callerid':_0x51ddf2[_0xa8e5('0x9')],'amaflags':_0xa8e5('0xa')}),'log':_0xa8e5('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xa8e5('0x4')](_0xa8e5('0xb'),{'options':{'where':{'type':[_0xa8e5('0xc')],'createdAt':{'$between':[moment()[_0xa8e5('0xd')](_0xa8e5('0xe'))[_0xa8e5('0xf')](_0xa8e5('0x10')),moment()['endOf'](_0xa8e5('0xe'))[_0xa8e5('0xf')](_0xa8e5('0x10'))]}},'attributes':[_0xa8e5('0x11'),_0xa8e5('0x12'),_0xa8e5('0x13'),_0xa8e5('0x14')]},'log':_0xa8e5('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d55bc44..0fe4a7d 100644 --- a/server/services/ami/rpc/voiceDialReport.js +++ b/server/services/ami/rpc/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc90c=['Request','../client','create'];(function(_0x598587,_0x1009cc){var _0x4e6a23=function(_0x2bdf56){while(--_0x2bdf56){_0x598587['push'](_0x598587['shift']());}};_0x4e6a23(++_0x1009cc);}(_0xc90c,0x121));var _0xcc90=function(_0x5e8785,_0x19b68){_0x5e8785=_0x5e8785-0x0;var _0x4df8b1=_0xc90c[_0x5e8785];return _0x4df8b1;};'use strict';var client=require(_0xcc90('0x0'));exports[_0xcc90('0x1')]=function(_0x14d5fa){return client[_0xcc90('0x2')]('CreateVoiceDialReport',{'body':_0x14d5fa,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x5eff=['create','Request','CreateVoiceDialReport','../client'];(function(_0x795e9a,_0x3bfe39){var _0x4d00b5=function(_0x2b0707){while(--_0x2b0707){_0x795e9a['push'](_0x795e9a['shift']());}};_0x4d00b5(++_0x3bfe39);}(_0x5eff,0x87));var _0xf5ef=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5eff[_0x465a0c];return _0x1e202e;};'use strict';var client=require(_0xf5ef('0x0'));exports[_0xf5ef('0x1')]=function(_0x5444ec){return client[_0xf5ef('0x2')]('CreateVoiceDialReport',{'body':_0x5444ec,'log':_0xf5ef('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index af82421..2510b2b 100644 --- a/server/services/ami/rpc/voiceExtension.js +++ b/server/services/ami/rpc/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb350=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x1bbb03,_0x27ac48){var _0x59a934=function(_0x32464f){while(--_0x32464f){_0x1bbb03['push'](_0x1bbb03['shift']());}};_0x59a934(++_0x27ac48);}(_0xb350,0x6f));var _0x0b35=function(_0xb1473e,_0x3ed6d7){_0xb1473e=_0xb1473e-0x0;var _0x9760f4=_0xb350[_0xb1473e];return _0x9760f4;};'use strict';var client=require(_0x0b35('0x0'));exports[_0x0b35('0x1')]=function(){return function(){return client[_0x0b35('0x2')](_0x0b35('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x0b35('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x18a9=['recordingFormat','getVoiceExtensions','../client','Request','exten'];(function(_0x4c217f,_0x82a1ae){var _0x4033b2=function(_0x4752cb){while(--_0x4752cb){_0x4c217f['push'](_0x4c217f['shift']());}};_0x4033b2(++_0x82a1ae);}(_0x18a9,0x17e));var _0x918a=function(_0x3ffd68,_0x86625b){_0x3ffd68=_0x3ffd68-0x0;var _0x629e97=_0x18a9[_0x3ffd68];return _0x629e97;};'use strict';var client=require(_0x918a('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x918a('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x918a('0x2'),_0x918a('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x918a('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 51c9d5c..25b857e 100644 --- a/server/services/ami/rpc/voiceQueue.js +++ b/server/services/ami/rpc/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1f6=['dialQueueProject2','strategy','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient'];(function(_0x33a47b,_0x25022a){var _0x3164d0=function(_0x1f070f){while(--_0x1f070f){_0x33a47b['push'](_0x33a47b['shift']());}};_0x3164d0(++_0x25022a);}(_0xd1f6,0x121));var _0x6d1f=function(_0x2fee56,_0x4ab378){_0x2fee56=_0x2fee56-0x0;var _0x446f0b=_0xd1f6[_0x2fee56];return _0x446f0b;};'use strict';var client=require(_0x6d1f('0x0'));exports[_0x6d1f('0x1')]=function(){return function(){return client['Request'](_0x6d1f('0x2'),{'options':{'raw':![],'attributes':['id',_0x6d1f('0x3'),_0x6d1f('0x4'),_0x6d1f('0x5'),_0x6d1f('0x6'),_0x6d1f('0x7'),_0x6d1f('0x8'),_0x6d1f('0x9'),_0x6d1f('0xa'),_0x6d1f('0xb'),'dialLimitQueue',_0x6d1f('0xc'),'dialPredictiveOptimization',_0x6d1f('0xd'),_0x6d1f('0xe'),_0x6d1f('0xf'),_0x6d1f('0x10'),'dialOriginateTimeout',_0x6d1f('0x11'),_0x6d1f('0x12'),_0x6d1f('0x13'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x6d1f('0x14'),_0x6d1f('0x15'),_0x6d1f('0x16'),_0x6d1f('0x17'),'dialGlobalMaxRetry',_0x6d1f('0x18'),'dialGlobalInterval',_0x6d1f('0x19'),_0x6d1f('0x1a'),_0x6d1f('0x1b'),_0x6d1f('0x1c'),_0x6d1f('0x1d'),_0x6d1f('0x1e'),_0x6d1f('0x1f'),_0x6d1f('0x20'),_0x6d1f('0x21'),_0x6d1f('0x22'),'dialAMDSilenceThreshold',_0x6d1f('0x23'),'timeout',_0x6d1f('0x24'),_0x6d1f('0x25'),_0x6d1f('0x26'),_0x6d1f('0x27'),_0x6d1f('0x28'),_0x6d1f('0x29'),'monitor_format',_0x6d1f('0x2a'),'dialRandomLastDigitCallerIdNumber',_0x6d1f('0x2b'),_0x6d1f('0x2c'),'dialPredictiveIntervalMaxThreshold',_0x6d1f('0x2d')],'include':[{'model':_0x6d1f('0x2e'),'as':_0x6d1f('0x2e'),'attributes':['id',_0x6d1f('0x3'),_0x6d1f('0x2f'),_0x6d1f('0x30')]},{'model':_0x6d1f('0x31'),'as':_0x6d1f('0x32'),'attributes':['id',_0x6d1f('0x3')]},{'model':_0x6d1f('0x2e'),'as':_0x6d1f('0x33'),'attributes':['id','name',_0x6d1f('0x2f'),'active']},{'model':_0x6d1f('0x34'),'as':_0x6d1f('0x34'),'attributes':['id',_0x6d1f('0x3')],'include':[{'model':_0x6d1f('0x34'),'as':_0x6d1f('0x35'),'attributes':['id',_0x6d1f('0x3'),_0x6d1f('0x36')]}]}]},'log':_0x6d1f('0x1')});};}; \ No newline at end of file +var _0x58ee=['dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x1f336d,_0x5d0bee){var _0x49199d=function(_0x3ea45c){while(--_0x3ea45c){_0x1f336d['push'](_0x1f336d['shift']());}};_0x49199d(++_0x5d0bee);}(_0x58ee,0x1ee));var _0xe58e=function(_0x4bc8c7,_0x48045a){_0x4bc8c7=_0x4bc8c7-0x0;var _0x1eeb02=_0x58ee[_0x4bc8c7];return _0x1eeb02;};'use strict';var client=require('../client');exports[_0xe58e('0x0')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xe58e('0x1'),_0xe58e('0x2'),_0xe58e('0x3'),'autopause',_0xe58e('0x4'),'type',_0xe58e('0x5'),_0xe58e('0x6'),_0xe58e('0x7'),_0xe58e('0x8'),'dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0xe58e('0x9'),_0xe58e('0xa'),'dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions',_0xe58e('0xb'),_0xe58e('0xc'),_0xe58e('0xd'),'dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xe58e('0xe'),_0xe58e('0xf'),'dialTimezone',_0xe58e('0x10'),_0xe58e('0x11'),'dialCheckDuplicateType',_0xe58e('0x12'),_0xe58e('0x13'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0xe58e('0x14'),_0xe58e('0x15'),'dialAMDBetweenWordsSilence',_0xe58e('0x16'),'dialAMDSilenceThreshold',_0xe58e('0x17'),_0xe58e('0x18'),'dialRecallMeTimeout',_0xe58e('0x19'),_0xe58e('0x1a'),'dialAgiAfterHangupAgent',_0xe58e('0x1b'),_0xe58e('0x1c'),_0xe58e('0x4'),_0xe58e('0x1d'),_0xe58e('0x1e'),_0xe58e('0x1f'),_0xe58e('0x20'),'dialPredictiveIntervalMaxThreshold',_0xe58e('0x21')],'include':[{'model':'Trunk','as':_0xe58e('0x22'),'attributes':['id',_0xe58e('0x1'),_0xe58e('0x23'),_0xe58e('0x24')]},{'model':_0xe58e('0x25'),'as':_0xe58e('0x26'),'attributes':['id',_0xe58e('0x1')]},{'model':_0xe58e('0x22'),'as':_0xe58e('0x27'),'attributes':['id',_0xe58e('0x1'),_0xe58e('0x23'),'active']},{'model':_0xe58e('0x28'),'as':'Interval','attributes':['id',_0xe58e('0x1')],'include':[{'model':_0xe58e('0x28'),'as':_0xe58e('0x29'),'attributes':['id',_0xe58e('0x1'),_0xe58e('0x2a')]}]}]},'log':_0xe58e('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 161143b..3c1c513 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b3c=['YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandonAt','GetVoiceQueueReports','lodash','../client','create','Request','CreateVoiceQueueReport','day','format','endOf'];(function(_0x25b194,_0x4e3c05){var _0x49b03e=function(_0x1501cb){while(--_0x1501cb){_0x25b194['push'](_0x25b194['shift']());}};_0x49b03e(++_0x4e3c05);}(_0x4b3c,0x1cc));var _0xc4b3=function(_0x2534cf,_0x545be6){_0x2534cf=_0x2534cf-0x0;var _0x221461=_0x4b3c[_0x2534cf];return _0x221461;};'use strict';var moment=require('moment');var _=require(_0xc4b3('0x0'));var client=require(_0xc4b3('0x1'));exports[_0xc4b3('0x2')]=function(_0x5ac233){return client[_0xc4b3('0x3')](_0xc4b3('0x4'),{'body':_0x5ac233,'log':'CreateVoiceQueueReport'});};exports['getVoiceQueueReports']=function(){return function(){return client['Request']('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xc4b3('0x5'))[_0xc4b3('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc4b3('0x7')]('day')['format'](_0xc4b3('0x8'))]}},'attributes':[_0xc4b3('0x9'),_0xc4b3('0xa'),_0xc4b3('0xb'),_0xc4b3('0xc'),_0xc4b3('0xd'),_0xc4b3('0xe'),_0xc4b3('0xf'),'queuecallerexitAt','queuecallerabandon',_0xc4b3('0x10')]},'log':_0xc4b3('0x11')});};}; \ No newline at end of file +var _0x896e=['queuecallerjoinAt','queuecallercomplete','queuecallerexit','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','uniqueid','queue'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x896e,0x1e9));var _0xe896=function(_0xde7c89,_0x3dd728){_0xde7c89=_0xde7c89-0x0;var _0x1015f5=_0x896e[_0xde7c89];return _0x1015f5;};'use strict';var moment=require(_0xe896('0x0'));var _=require(_0xe896('0x1'));var client=require(_0xe896('0x2'));exports[_0xe896('0x3')]=function(_0x36085e){return client[_0xe896('0x4')](_0xe896('0x5'),{'body':_0x36085e,'log':_0xe896('0x5')});};exports[_0xe896('0x6')]=function(){return function(){return client[_0xe896('0x4')](_0xe896('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xe896('0x8')]('day')[_0xe896('0x9')](_0xe896('0xa')),moment()[_0xe896('0xb')](_0xe896('0xc'))[_0xe896('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xe896('0xd'),_0xe896('0xe'),_0xe896('0xf'),'queuecallerleaveAt',_0xe896('0x10'),'queuecallercompleteAt',_0xe896('0x11'),'queuecallerexitAt',_0xe896('0x12'),_0xe896('0x13')]},'log':_0xe896('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 09f3652..36f19ae 100644 --- a/server/services/ami/rpc/voiceQueueRt.js +++ b/server/services/ami/rpc/voiceQueueRt.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x478c=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x478c,0x82));var _0xc478=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x478c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc478('0x0'));exports[_0xc478('0x1')]=function(_0x22acd5){return function(){return client['Request'](_0xc478('0x2'),{'options':{'where':{'VoiceQueueId':_0x22acd5,'paused':!![]},'raw':!![]},'log':_0xc478('0x1')});};}; \ No newline at end of file +var _0x6319=['Request','getVoiceQueueRtPauses'];(function(_0x5dd52e,_0x98ee28){var _0x4d2f78=function(_0x239648){while(--_0x239648){_0x5dd52e['push'](_0x5dd52e['shift']());}};_0x4d2f78(++_0x98ee28);}(_0x6319,0xdb));var _0x9631=function(_0x2e1544,_0x42cb50){_0x2e1544=_0x2e1544-0x0;var _0x22e3ef=_0x6319[_0x2e1544];return _0x22e3ef;};'use strict';var client=require('../client');exports[_0x9631('0x0')]=function(_0x3b5321){return function(){return client[_0x9631('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x3b5321,'paused':!![]},'raw':!![]},'log':_0x9631('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 562e2fc..80af75c 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccd0=['merge','monitorFilename','../client','Request','CreateVoiceRecording'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccd0,0x1d8));var _0x0ccd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xccd0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var client=require(_0x0ccd('0x0'));exports['create']=function(_0x16bbc6){return client[_0x0ccd('0x1')](_0x0ccd('0x2'),{'body':_[_0x0ccd('0x3')](_0x16bbc6,{'value':_0x16bbc6[_0x0ccd('0x4')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0xc8f5=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create','Request'];(function(_0x253a42,_0x117286){var _0x50a1e0=function(_0x5cacf0){while(--_0x5cacf0){_0x253a42['push'](_0x253a42['shift']());}};_0x50a1e0(++_0x117286);}(_0xc8f5,0x1b5));var _0x5c8f=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0xc8f5[_0x1ae491];return _0x4958a5;};'use strict';var _=require(_0x5c8f('0x0'));var client=require(_0x5c8f('0x1'));exports[_0x5c8f('0x2')]=function(_0x1c3601){return client[_0x5c8f('0x3')](_0x5c8f('0x4'),{'body':_[_0x5c8f('0x5')](_0x1c3601,{'value':_0x1c3601[_0x5c8f('0x6')]}),'log':_0x5c8f('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 2e03ed3..f1b00aa 100644 --- a/server/services/ami/rpc/voiceTransferReport.js +++ b/server/services/ami/rpc/voiceTransferReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b5b=['attended','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfereraccountcode','transferercontext','transfereechannel','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten'];(function(_0x37b737,_0x55ce87){var _0x11e28a=function(_0x57d647){while(--_0x57d647){_0x37b737['push'](_0x37b737['shift']());}};_0x11e28a(++_0x55ce87);}(_0x9b5b,0x16c));var _0xb9b5=function(_0x1bf6e9,_0x57eb91){_0x1bf6e9=_0x1bf6e9-0x0;var _0x9a31c4=_0x9b5b[_0x1bf6e9];return _0x9a31c4;};'use strict';var client=require('../client');exports[_0xb9b5('0x0')]=function(_0x17ae3b){return client[_0xb9b5('0x1')](_0xb9b5('0x2'),{'body':{'result':_0x17ae3b[_0xb9b5('0x3')],'transfererchannel':_0x17ae3b[_0xb9b5('0x4')],'transferercalleridnum':_0x17ae3b['transferercalleridnum'],'transferercalleridname':_0x17ae3b[_0xb9b5('0x5')],'transfererconnectedlinenum':_0x17ae3b['transfererconnectedlinenum'],'transfererconnectedlinename':_0x17ae3b['transfererconnectedlinename'],'transfereraccountcode':_0x17ae3b[_0xb9b5('0x6')],'transferercontext':_0x17ae3b[_0xb9b5('0x7')],'transfererexten':_0x17ae3b['transfererexten'],'transfererlinkedid':_0x17ae3b['transfererlinkedid'],'transfereechannel':_0x17ae3b[_0xb9b5('0x8')],'transfereecalleridnum':_0x17ae3b['transfereecalleridnum'],'transfereecalleridname':_0x17ae3b['transfereecalleridname'],'transfereeconnectedlinenum':_0x17ae3b[_0xb9b5('0x9')],'transfereeconnectedlinename':_0x17ae3b['transfereeconnectedlinename'],'transfereeaccountcode':_0x17ae3b[_0xb9b5('0xa')],'transfereecontext':_0x17ae3b['transfereecontext'],'transfereeexten':_0x17ae3b[_0xb9b5('0xb')],'transfereelinkedid':_0x17ae3b[_0xb9b5('0xc')],'isexternal':_0x17ae3b[_0xb9b5('0xd')],'context':_0x17ae3b['context'],'extension':_0x17ae3b[_0xb9b5('0xe')],'type':_0xb9b5('0xf')},'log':_0xb9b5('0x2')});};exports[_0xb9b5('0x10')]=function(_0x1b7c2a){return client[_0xb9b5('0x1')](_0xb9b5('0x2'),{'body':{'result':_0x1b7c2a['result'],'transfererchannel':_0x1b7c2a[_0xb9b5('0x11')],'transferercalleridnum':_0x1b7c2a['origtransferercalleridnum'],'transferercalleridname':_0x1b7c2a['origtransferercalleridname'],'transfererconnectedlinenum':_0x1b7c2a[_0xb9b5('0x12')],'transfererconnectedlinename':_0x1b7c2a[_0xb9b5('0x13')],'transfereraccountcode':_0x1b7c2a[_0xb9b5('0x14')],'transferercontext':_0x1b7c2a[_0xb9b5('0x15')],'transfererexten':_0x1b7c2a['secondtransfererexten'],'transfererlinkedid':_0x1b7c2a[_0xb9b5('0x16')],'transfereechannel':_0x1b7c2a[_0xb9b5('0x17')],'transfereecalleridnum':_0x1b7c2a[_0xb9b5('0x18')],'transfereecalleridname':_0x1b7c2a[_0xb9b5('0x19')],'transfereeconnectedlinenum':_0x1b7c2a[_0xb9b5('0x1a')],'transfereeconnectedlinename':_0x1b7c2a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1b7c2a[_0xb9b5('0x1b')],'transfereecontext':_0x1b7c2a[_0xb9b5('0x1c')],'transfereeexten':_0x1b7c2a[_0xb9b5('0x1d')],'transfereelinkedid':_0x1b7c2a['transfertargetlinkedid'],'isexternal':_0x1b7c2a[_0xb9b5('0xd')],'context':_0x1b7c2a[_0xb9b5('0x1e')],'extension':_0x1b7c2a[_0xb9b5('0x1f')],'type':_0xb9b5('0x20')},'log':_0xb9b5('0x2')});}; \ No newline at end of file +var _0x9d4e=['transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x713876,_0x50384f){var _0x12e51e=function(_0x2dc06e){while(--_0x2dc06e){_0x713876['push'](_0x713876['shift']());}};_0x12e51e(++_0x50384f);}(_0x9d4e,0x102));var _0xe9d4=function(_0x5ec634,_0xa835b9){_0x5ec634=_0x5ec634-0x0;var _0x5b94a9=_0x9d4e[_0x5ec634];return _0x5b94a9;};'use strict';var client=require(_0xe9d4('0x0'));exports[_0xe9d4('0x1')]=function(_0x1944cb){return client[_0xe9d4('0x2')](_0xe9d4('0x3'),{'body':{'result':_0x1944cb['result'],'transfererchannel':_0x1944cb['transfererchannel'],'transferercalleridnum':_0x1944cb[_0xe9d4('0x4')],'transferercalleridname':_0x1944cb[_0xe9d4('0x5')],'transfererconnectedlinenum':_0x1944cb[_0xe9d4('0x6')],'transfererconnectedlinename':_0x1944cb[_0xe9d4('0x7')],'transfereraccountcode':_0x1944cb[_0xe9d4('0x8')],'transferercontext':_0x1944cb[_0xe9d4('0x9')],'transfererexten':_0x1944cb[_0xe9d4('0xa')],'transfererlinkedid':_0x1944cb['transfererlinkedid'],'transfereechannel':_0x1944cb[_0xe9d4('0xb')],'transfereecalleridnum':_0x1944cb[_0xe9d4('0xc')],'transfereecalleridname':_0x1944cb[_0xe9d4('0xd')],'transfereeconnectedlinenum':_0x1944cb['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1944cb[_0xe9d4('0xe')],'transfereeaccountcode':_0x1944cb[_0xe9d4('0xf')],'transfereecontext':_0x1944cb[_0xe9d4('0x10')],'transfereeexten':_0x1944cb['transfereeexten'],'transfereelinkedid':_0x1944cb[_0xe9d4('0x11')],'isexternal':_0x1944cb[_0xe9d4('0x12')],'context':_0x1944cb[_0xe9d4('0x13')],'extension':_0x1944cb[_0xe9d4('0x14')],'type':_0xe9d4('0x15')},'log':_0xe9d4('0x3')});};exports['attendedTransfer']=function(_0x2a8a0b){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x2a8a0b[_0xe9d4('0x16')],'transfererchannel':_0x2a8a0b[_0xe9d4('0x17')],'transferercalleridnum':_0x2a8a0b[_0xe9d4('0x18')],'transferercalleridname':_0x2a8a0b['origtransferercalleridname'],'transfererconnectedlinenum':_0x2a8a0b[_0xe9d4('0x19')],'transfererconnectedlinename':_0x2a8a0b[_0xe9d4('0x1a')],'transfereraccountcode':_0x2a8a0b[_0xe9d4('0x1b')],'transferercontext':_0x2a8a0b[_0xe9d4('0x1c')],'transfererexten':_0x2a8a0b['secondtransfererexten'],'transfererlinkedid':_0x2a8a0b[_0xe9d4('0x1d')],'transfereechannel':_0x2a8a0b[_0xe9d4('0x1e')],'transfereecalleridnum':_0x2a8a0b[_0xe9d4('0x1f')],'transfereecalleridname':_0x2a8a0b[_0xe9d4('0x20')],'transfereeconnectedlinenum':_0x2a8a0b[_0xe9d4('0x21')],'transfereeconnectedlinename':_0x2a8a0b[_0xe9d4('0x22')],'transfereeaccountcode':_0x2a8a0b['transfertargetaccountcode'],'transfereecontext':_0x2a8a0b['transfertargetcontext'],'transfereeexten':_0x2a8a0b[_0xe9d4('0x23')],'transfereelinkedid':_0x2a8a0b['transfertargetlinkedid'],'isexternal':_0x2a8a0b[_0xe9d4('0x12')],'context':_0x2a8a0b[_0xe9d4('0x24')],'extension':_0x2a8a0b['origtransfererexten'],'type':_0xe9d4('0x25')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index e9a4b1d..9b1caac 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd91=['event','checkAfterSend','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','catch','command','voiceQueues','strategy','available','loggedIn','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','voicechannel','validate','map','find','channels','uniqueid','channel','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','rec','status','MixMonitor\x20Success','mixmonitorid','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','filename','wav','StopMixMonitor\x20Success','values','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','queueChannels','Redirect','exten','context','telephones','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcd91,0x94));var _0x1cd9=function(_0x1828ca,_0x2f8e40){_0x1828ca=_0x1828ca-0x0;var _0x316e18=_0xcd91[_0x1828ca];return _0x316e18;};'use strict';var _=require(_0x1cd9('0x0'));var util=require(_0x1cd9('0x1'));var jayson=require(_0x1cd9('0x2'));var schema=require('validate');var BPromise=require(_0x1cd9('0x3'));var moment=require(_0x1cd9('0x4'));var config=require(_0x1cd9('0x5'));var properties=require(_0x1cd9('0x6'));var ami=require('../ami');exports['listen']=function(_0x592185,_0x59b642,_0x195118){return new BPromise(function(_0x20b51c,_0x4e54c0){var _0x490da8={'QueuePause':function(_0x271bf8){return new Promise(function(_0x362b1c,_0x353a2d){var _0x53d9e8=util[_0x1cd9('0x7')](_0x1cd9('0x8'),_0x1cd9('0x9'),_0x271bf8[_0x1cd9('0xa')]);if(_0x592185['timers']&&_0x592185[_0x1cd9('0xb')][_0x53d9e8]&&_0x592185['timers'][_0x53d9e8][_0x1cd9('0xc')]){_0x592185[_0x1cd9('0xb')][_0x53d9e8][_0x1cd9('0xd')]();}if(_0x592185[_0x1cd9('0xe')][_0x53d9e8]){_0x592185[_0x1cd9('0xe')][_0x53d9e8][_0x1cd9('0xf')]({'statePause':_0x271bf8[_0x1cd9('0x10')]?!![]:![]});}_0x362b1c({'code':0xc8,'message':_0x1cd9('0x11')});});},'Reload':function(_0x2ae0d5){var _0x4ed08b=this;return new Promise(function(_0x5ef482,_0x4109f8){if(ami[_0x1cd9('0x12')]()==![]){return _0x4109f8(_0x4ed08b[_0x1cd9('0x13')](0x1f4,[config[_0x1cd9('0x14')]['ip'],config[_0x1cd9('0x14')][_0x1cd9('0x15')],_0x1cd9('0x16')][_0x1cd9('0x17')]('\x20')));}_0x2ae0d5=_[_0x1cd9('0x18')](_0x2ae0d5,_['keys'](properties[_0x1cd9('0x19')]));_0x2ae0d5[_0x1cd9('0x1a')]=_0x1cd9('0x1b');return ami[_0x1cd9('0x1c')](_0x2ae0d5)[_0x1cd9('0x1d')](function(_0x19e48c){_0x5ef482({'code':0xc8,'message':_0x19e48c[_0x1cd9('0x1e')]});})[_0x1cd9('0x1f')](function(_0x216e26){_0x4109f8(_0x4ed08b[_0x1cd9('0x13')](0x1f5,_0x216e26[_0x1cd9('0x1e')]));});});},'Command':function(_0x47e824){var _0x2f2c94=this;return new Promise(function(_0x5452f4,_0x5e3905){if(ami[_0x1cd9('0x12')]()==![]){return _0x5e3905(_0x2f2c94[_0x1cd9('0x13')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x1cd9('0x15')],_0x1cd9('0x16')]['join']('\x20')));}_0x47e824=_['pick'](_0x47e824,_0x1cd9('0x20'));_0x47e824['action']='Command';return ami['Action'](_0x47e824)[_0x1cd9('0x1d')](function(_0x18fee2){_0x5452f4({'code':0xc8,'message':_0x18fee2['content']});})['catch'](function(_0x421523){_0x5e3905(_0x2f2c94[_0x1cd9('0x13')](0x1f5,_0x421523[_0x1cd9('0x1e')]));});});},'VoiceQueues':function(_0x4b4628){return new Promise(function(_0x52289d,_0x75e6dd){var _0x59a02f=[];for(var _0x6c7bdd in _0x592185['voiceQueues']){if(_0x592185[_0x1cd9('0x21')]['hasOwnProperty'](_0x6c7bdd)){var _0x22a96a=_0x592185[_0x1cd9('0x21')][_0x6c7bdd];var _0x46c5ba={'id':_0x22a96a['id'],'name':_0x22a96a[_0x1cd9('0xa')],'strategy':_0x22a96a[_0x1cd9('0x22')],'answered':_0x22a96a['answered'],'available':_0x22a96a[_0x1cd9('0x23')],'loggedIn':_0x22a96a[_0x1cd9('0x24')],'pTalking':_0x22a96a['pTalking'],'sumBillable':_0x22a96a['sumBillable'],'sumDuration':_0x22a96a[_0x1cd9('0x25')],'sumHoldTime':_0x22a96a[_0x1cd9('0x26')]||0x0,'talking':_0x22a96a[_0x1cd9('0x27')],'total':_0x22a96a['total'],'type':_0x22a96a[_0x1cd9('0x28')],'unmanaged':_0x22a96a[_0x1cd9('0x29')],'abandoned':_0x22a96a['abandoned'],'waiting':_0x22a96a[_0x1cd9('0x2a')],'loggedInDb':_0x22a96a[_0x1cd9('0x2b')]};if(_0x22a96a[_0x1cd9('0x28')]===_0x1cd9('0x2c')){_0x46c5ba[_0x1cd9('0x2d')]=_0x22a96a[_0x1cd9('0x2d')];_0x46c5ba[_0x1cd9('0x2e')]=_0x22a96a['dialMethod'];_0x46c5ba[_0x1cd9('0x2f')]=_0x22a96a[_0x1cd9('0x2f')];_0x46c5ba[_0x1cd9('0x30')]=_0x22a96a[_0x1cd9('0x30')];_0x46c5ba['dialOriginateTimeout']=_0x22a96a[_0x1cd9('0x31')];_0x46c5ba[_0x1cd9('0x32')]=_0x22a96a['dialPrefix'];_0x46c5ba[_0x1cd9('0x33')]=_0x22a96a['outboundAnswerAgiCallsDay'];_0x46c5ba[_0x1cd9('0x34')]=_0x22a96a[_0x1cd9('0x34')];_0x46c5ba[_0x1cd9('0x35')]=_0x22a96a[_0x1cd9('0x35')];_0x46c5ba[_0x1cd9('0x36')]=_0x22a96a['outboundBusyCallsDay'];_0x46c5ba[_0x1cd9('0x37')]=_0x22a96a[_0x1cd9('0x37')];_0x46c5ba[_0x1cd9('0x38')]=_0x22a96a[_0x1cd9('0x38')];_0x46c5ba[_0x1cd9('0x39')]=_0x22a96a[_0x1cd9('0x39')];_0x46c5ba[_0x1cd9('0x3a')]=_0x22a96a[_0x1cd9('0x3a')];_0x46c5ba[_0x1cd9('0x3b')]=_0x22a96a[_0x1cd9('0x3b')];_0x46c5ba['outboundNoSuchCallsDay']=_0x22a96a['outboundNoSuchCallsDay'];_0x46c5ba[_0x1cd9('0x3c')]=_0x22a96a['outboundOriginateFailureCallsDay'];_0x46c5ba[_0x1cd9('0x3d')]=_0x22a96a['outboundReCallsDay'];_0x46c5ba[_0x1cd9('0x3e')]=_0x22a96a['outboundRejectCallsDay'];_0x46c5ba[_0x1cd9('0x3f')]=_0x22a96a['outboundUnknownCallsDay'];_0x46c5ba['predictiveIntervalAnsweredCalls']=_0x22a96a[_0x1cd9('0x40')];_0x46c5ba['predictiveIntervalAvgHoldtime']=_0x22a96a[_0x1cd9('0x41')];_0x46c5ba[_0x1cd9('0x42')]=_0x22a96a['predictiveIntervalAvgTalktime'];_0x46c5ba['predictiveIntervalDroppedCallsCallersExit']=_0x22a96a[_0x1cd9('0x43')];_0x46c5ba[_0x1cd9('0x44')]=_0x22a96a[_0x1cd9('0x44')];_0x46c5ba['predictiveIntervalErlangCalls']=_0x22a96a[_0x1cd9('0x45')];_0x46c5ba['predictiveIntervalErlangCallsDroppedCalls']=_0x22a96a[_0x1cd9('0x46')];_0x46c5ba['predictiveIntervalHitRate']=_0x22a96a[_0x1cd9('0x47')];_0x46c5ba['predictiveIntervalMultiplicativeFactor']=_0x22a96a[_0x1cd9('0x48')];_0x46c5ba[_0x1cd9('0x49')]=_0x22a96a['predictiveIntervalPauses'];_0x46c5ba[_0x1cd9('0x4a')]=_0x22a96a[_0x1cd9('0x4a')];_0x46c5ba[_0x1cd9('0x4b')]=_0x22a96a['predictiveIntervalTotalCalls'];_0x46c5ba[_0x1cd9('0x1e')]=_0x22a96a[_0x1cd9('0x1e')];_0x46c5ba[_0x1cd9('0x4c')]=_0x22a96a['originated'];_0x46c5ba[_0x1cd9('0x4d')]=_0x22a96a[_0x1cd9('0x4d')];_0x46c5ba[_0x1cd9('0x4e')]=_0x22a96a[_0x1cd9('0x4e')];_0x46c5ba[_0x1cd9('0x4f')]=_0x22a96a[_0x1cd9('0x4f')];_0x46c5ba[_0x1cd9('0x50')]=_0x22a96a[_0x1cd9('0x50')];_0x46c5ba[_0x1cd9('0x51')]=_0x22a96a[_0x1cd9('0x51')];_0x46c5ba[_0x1cd9('0x52')]=_0x22a96a[_0x1cd9('0x52')];}if(_0x22a96a[_0x1cd9('0x53')]){_0x46c5ba['Trunk']={'id':_0x22a96a[_0x1cd9('0x53')]['id'],'name':_0x22a96a[_0x1cd9('0x53')][_0x1cd9('0xa')],'active':_0x22a96a['Trunk'][_0x1cd9('0x54')],'callerid':_0x22a96a[_0x1cd9('0x53')][_0x1cd9('0x55')]};}if(_0x22a96a[_0x1cd9('0x56')]){_0x46c5ba[_0x1cd9('0x56')]={'id':_0x22a96a['Interval']['id'],'name':_0x22a96a[_0x1cd9('0x56')][_0x1cd9('0xa')]};}_0x59a02f[_0x1cd9('0x57')](_0x46c5ba);}}_0x52289d({'count':_0x59a02f[_0x1cd9('0x58')],'rows':_0x59a02f});});},'VoiceChannels':function(_0x20fbdb){return new Promise(function(_0x14cb4d,_0x403618){var _0x22de0b=_['values'](_0x592185['channels']);_0x14cb4d({'count':_0x22de0b[_0x1cd9('0x58')],'rows':_0x22de0b});});},'VoiceChannelMixMonitor':function(_0x4060e8){var _0xb6495c=this;return new Promise(function(_0x264448,_0x54e8b1){if(ami['isConnected']()==![]){return _0x54e8b1(_0xb6495c[_0x1cd9('0x13')](0x1f4,[config[_0x1cd9('0x14')]['ip'],config[_0x1cd9('0x14')][_0x1cd9('0x15')],'ami\x20disconnected'][_0x1cd9('0x17')]('\x20')));}var _0x141012=schema(properties[_0x1cd9('0x59')])[_0x1cd9('0x5a')](_0x4060e8);if(_0x141012[_0x1cd9('0x58')]>0x0){return _0x54e8b1(_0xb6495c[_0x1cd9('0x13')](0x1f4,_[_0x1cd9('0x5b')](_0x141012,_0x1cd9('0x1e'))[_0x1cd9('0x17')](',\x20')));}var _0x331588=_[_0x1cd9('0x5c')](_0x592185[_0x1cd9('0x5d')],{'uniqueid':_0x4060e8[_0x1cd9('0x5e')]});if(_0x331588&&_0x331588[_0x1cd9('0x5f')]){var _0xc3d0be=util[_0x1cd9('0x7')]('%s.%s',_0x4060e8['filename']||_0x4060e8[_0x1cd9('0x5e')],_0x4060e8[_0x1cd9('0x7')]||'wav');return ami[_0x1cd9('0x1c')]({'action':_0x1cd9('0x60'),'channel':_0x331588[_0x1cd9('0x5f')],'file':_0xc3d0be,'options':_0x1cd9('0x61')})[_0x1cd9('0x1d')](function(_0x5647e3){var _0xb2aff6=_['find'](_0x331588[_0x1cd9('0x62')],{'filename':_0x1cd9('0x63')+_0xc3d0be[_0x1cd9('0x64')]()});if(_[_0x1cd9('0x65')](_0xb2aff6)){_0x331588[_0x1cd9('0x62')][_0x1cd9('0x57')]({'filename':_0x1cd9('0x63')+_0xc3d0be[_0x1cd9('0x64')](),'createdAt':moment()[_0x1cd9('0x7')](_0x1cd9('0x66')),'mixmonitorid':_0x5647e3['mixmonitorid'],'status':_0x1cd9('0x67')});}else{_0xb2aff6['mixmonitorid']=_0x5647e3['mixmonitorid'];_0xb2aff6[_0x1cd9('0x68')]='rec';}_0x264448({'code':0xc8,'message':[_0x4060e8['uniqueid'],_0x1cd9('0x69'),_0x5647e3[_0x1cd9('0x6a')]][_0x1cd9('0x17')]('\x20'),'mixmonitorid':_0x5647e3['mixmonitorid']});})[_0x1cd9('0x1f')](function(_0x24348b){_0x54e8b1(_0xb6495c[_0x1cd9('0x13')](0x1f5,[_0x4060e8[_0x1cd9('0x5e')],_0x24348b['message'][_0x1cd9('0x64')]()][_0x1cd9('0x17')]('\x20')));});}else{return _0x54e8b1(_0xb6495c[_0x1cd9('0x13')](0x1f5,_0x1cd9('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x343e84){var _0x477059=this;return new Promise(function(_0x4ea67d,_0x67c71a){if(ami['isConnected']()==![]){return _0x67c71a(_0x477059[_0x1cd9('0x13')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x1cd9('0x15')],_0x1cd9('0x16')][_0x1cd9('0x17')]('\x20')));}var _0x2675d2=schema(properties['voicechannel'])[_0x1cd9('0x5a')](_0x343e84);if(_0x2675d2['length']>0x0){return _0x67c71a(_0x477059[_0x1cd9('0x13')](0x1f4,_[_0x1cd9('0x5b')](_0x2675d2,_0x1cd9('0x1e'))[_0x1cd9('0x17')](',\x20')));}var _0x3eedad=_[_0x1cd9('0x5c')](_0x592185['channels'],{'uniqueid':_0x343e84[_0x1cd9('0x5e')]});if(_0x3eedad){return BPromise[_0x1cd9('0x6c')]()[_0x1cd9('0x1d')](function(){if(_0x3eedad[_0x1cd9('0x5f')]){return ami[_0x1cd9('0x1c')]({'action':_0x1cd9('0x6d'),'channel':_0x3eedad['channel'],'mixmonitorid':_0x343e84[_0x1cd9('0x6a')]})['catch'](function(_0x370170){});}})['then'](function(){if(_0x3eedad[_0x1cd9('0x6e')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x3eedad['destinationchannel'],'mixmonitorid':_0x343e84['mixmonitorid']})[_0x1cd9('0x1f')](function(_0x258538){});}})[_0x1cd9('0x1d')](function(_0x446f50){var _0x189d91=_[_0x1cd9('0x5c')](_0x3eedad[_0x1cd9('0x62')],{'mixmonitorid':_0x343e84[_0x1cd9('0x6a')]});if(_0x189d91){_0x189d91[_0x1cd9('0x68')]=_0x1cd9('0x6f');}})[_0x1cd9('0x1d')](function(){var _0x30f230=util[_0x1cd9('0x7')](_0x1cd9('0x70'),_0x343e84[_0x1cd9('0x71')]||_0x343e84[_0x1cd9('0x5e')],_0x343e84[_0x1cd9('0x7')]||_0x1cd9('0x72'));var _0x26fc71=_[_0x1cd9('0x5c')](_0x3eedad['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x30f230['toLowerCase']()});if(_0x26fc71){_0x26fc71[_0x1cd9('0x68')]='stop';}})[_0x1cd9('0x1d')](function(){_0x4ea67d({'code':0xc8,'message':[_0x343e84[_0x1cd9('0x5e')],_0x1cd9('0x73')]['join']('\x20')});})[_0x1cd9('0x1f')](function(_0x55e3d){_0x67c71a(_0x477059[_0x1cd9('0x13')](0x1f5,[_0x343e84['uniqueid'],_0x55e3d['message'][_0x1cd9('0x64')]()][_0x1cd9('0x17')]('\x20')));});}else{return _0x67c71a(_0x477059['error'](0x1f5,_0x1cd9('0x6b')));}});},'VoiceQueuesChannels':function(_0x5125cd){return new Promise(function(_0x261169,_0x575545){var _0xe1e139=_[_0x1cd9('0x74')](_0x592185['queueChannels']);_0x261169({'count':_0xe1e139[_0x1cd9('0x58')],'rows':_0xe1e139});});},'VoiceQueuesChannel':function(_0x1d47ba){var _0x3e386c=this;return new Promise(function(_0x5b60f6,_0x5cf1cd){var _0x1ca397=schema(properties[_0x1cd9('0x75')])[_0x1cd9('0x5a')](_0x1d47ba);if(_0x1ca397[_0x1cd9('0x58')]>0x0){return _0x5cf1cd(_0x3e386c[_0x1cd9('0x13')](0x1f4,_[_0x1cd9('0x5b')](_0x1ca397,_0x1cd9('0x1e'))[_0x1cd9('0x17')](',\x20')));}var _0x4bb7bc=_[_0x1cd9('0x5c')](_0x592185['queueChannels'],{'uniqueid':_0x1d47ba['uniqueid']});if(_0x4bb7bc){_0x5b60f6(_0x4bb7bc);}else{return _0x5cf1cd(_0x3e386c[_0x1cd9('0x13')](0x1f5,_0x1cd9('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x353e30){var _0x5a72a5=this;return new Promise(function(_0x5b632d,_0x2a46aa){if(ami[_0x1cd9('0x12')]()==![]){return _0x2a46aa(_0x5a72a5[_0x1cd9('0x13')](0x1f4,[config[_0x1cd9('0x14')]['ip'],config[_0x1cd9('0x14')][_0x1cd9('0x15')],_0x1cd9('0x16')][_0x1cd9('0x17')]('\x20')));}var _0x3505e5=schema(properties[_0x1cd9('0x76')])[_0x1cd9('0x5a')](_0x353e30);if(_0x3505e5[_0x1cd9('0x58')]>0x0){return _0x2a46aa(_0x5a72a5[_0x1cd9('0x13')](0x1f4,_[_0x1cd9('0x5b')](_0x3505e5,_0x1cd9('0x1e'))['join'](',\x20')));}var _0x1cac45=_['find'](_0x592185['queueChannels'],{'uniqueid':_0x353e30[_0x1cd9('0x5e')]});if(_0x1cac45&&_0x1cac45[_0x1cd9('0x5f')]){return ami['Action']({'action':_0x1cd9('0x77'),'channel':_0x1cac45[_0x1cd9('0x5f')]})[_0x1cd9('0x1d')](function(_0x162d7d){_0x5b632d({'code':0xc8,'message':[_0x353e30[_0x1cd9('0x5e')],_0x162d7d[_0x1cd9('0x1e')][_0x1cd9('0x64')]()][_0x1cd9('0x17')]('\x20')});})['catch'](function(_0x42c2ac){_0x2a46aa(_0x5a72a5[_0x1cd9('0x13')](0x1f5,[_0x353e30['uniqueid'],_0x42c2ac['message'][_0x1cd9('0x64')]()][_0x1cd9('0x17')]('\x20')));});}else{return _0x2a46aa(_0x5a72a5['error'](0x1f5,_0x1cd9('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x1e9718){var _0x3d5507=this;return new Promise(function(_0x3b3d75,_0x2c2078){if(ami[_0x1cd9('0x12')]()==![]){return _0x2c2078(_0x3d5507[_0x1cd9('0x13')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x1cd9('0x15')],_0x1cd9('0x16')][_0x1cd9('0x17')]('\x20')));}var _0x47abdb=schema(properties[_0x1cd9('0x78')])[_0x1cd9('0x5a')](_0x1e9718);if(_0x47abdb[_0x1cd9('0x58')]>0x0){return _0x2c2078(_0x3d5507[_0x1cd9('0x13')](0x1f4,_[_0x1cd9('0x5b')](_0x47abdb,_0x1cd9('0x1e'))[_0x1cd9('0x17')](',\x20')));}var _0x26bfe5=_['find'](_0x592185[_0x1cd9('0x79')],{'uniqueid':_0x1e9718[_0x1cd9('0x5e')]});if(_0x26bfe5&&_0x26bfe5['channel']){return ami[_0x1cd9('0x1c')]({'action':_0x1cd9('0x7a'),'channel':_0x26bfe5[_0x1cd9('0x5f')],'exten':_0x1e9718[_0x1cd9('0x7b')],'context':_0x1e9718[_0x1cd9('0x7c')]||_0x26bfe5[_0x1cd9('0x7c')],'priority':0x1})['then'](function(_0x4ab506){_0x3b3d75({'code':0xc8,'message':[_0x1e9718[_0x1cd9('0x5e')],_0x4ab506[_0x1cd9('0x1e')][_0x1cd9('0x64')]()][_0x1cd9('0x17')]('\x20')});})[_0x1cd9('0x1f')](function(_0x303df6){_0x2c2078(_0x3d5507[_0x1cd9('0x13')](0x1f5,[_0x1e9718[_0x1cd9('0x5e')],_0x303df6[_0x1cd9('0x1e')][_0x1cd9('0x64')]()][_0x1cd9('0x17')]('\x20')));});}else{return _0x2c2078(_0x3d5507[_0x1cd9('0x13')](0x1f5,_0x1cd9('0x6b')));}});},'Agents':function(_0x20ea25){return new Promise(function(_0x2d7409,_0x45d7ca){var _0x40a0d0=_[_0x1cd9('0x74')](_0x592185[_0x1cd9('0xe')]);_0x2d7409({'count':_0x40a0d0[_0x1cd9('0x58')],'rows':_0x40a0d0});});},'Telephones':function(_0x557a8c){return new Promise(function(_0x362c88,_0x489ced){var _0x2080b5=_['values'](_0x592185[_0x1cd9('0x7d')]);_0x362c88({'count':_0x2080b5[_0x1cd9('0x58')],'rows':_0x2080b5});});},'Trunks':function(_0x544a89){return new Promise(function(_0xe87e20,_0x451d28){var _0x12561c=_[_0x1cd9('0x74')](_0x592185['trunks']);_0xe87e20({'count':_0x12561c['length'],'rows':_0x12561c});});},'OutboundChannels':function(_0x492b28){return new Promise(function(_0x80e2ee,_0xdf44df){var _0x4c5e57=_['values'](_0x592185[_0x1cd9('0x7e')]);_0x80e2ee({'count':_0x4c5e57[_0x1cd9('0x58')],'rows':_0x4c5e57});});},'Outbound':function(_0x2e2d08){return new Promise(function(_0x1fb86a,_0x517db1){_0x1fb86a(_0x592185[_0x1cd9('0x2c')]);});},'Campaigns':function(_0x194597){return new Promise(function(_0x17679d,_0x548e04){var _0x9724d2=_[_0x1cd9('0x74')](_0x592185[_0x1cd9('0x7f')]);_0x17679d({'count':_0x9724d2[_0x1cd9('0x58')],'rows':_0x9724d2});});},'VoiceQueuesPreview':function(_0x868bfc){var _0x79d1f6=this;return new Promise(function(_0x15d0b5,_0x28024a){_0x59b642[_0x1cd9('0x80')](_0x868bfc['id'])[_0x1cd9('0x1d')](function(_0x4a6936){_0x15d0b5({'code':0xc8,'message':_0x4a6936[_0x1cd9('0x1e')]});})[_0x1cd9('0x1f')](function(_0x163944){_0x28024a(_0x79d1f6[_0x1cd9('0x13')](0x1f4,_0x163944[_0x1cd9('0x1e')]));});});},'EventManager':function(_0x434bef){var _0x166472=this;return new Promise(function(_0x48d38f,_0x2b64ea){if(!_0x434bef['event']){return _0x2b64ea(_0x166472[_0x1cd9('0x13')](0x1f4,_0x1cd9('0x81')));}ami[_0x1cd9('0x82')](_0x1cd9('0x83')+_0x434bef[_0x1cd9('0x84')],_0x434bef[_0x1cd9('0x1e')]);_0x48d38f({'code':0xc8,'message':_0x434bef});});},'FaxAccounts':function(_0x407828){return new Promise(function(_0x214ba6,_0x2a2942){var _0x1a176a=_[_0x1cd9('0x74')](_0x592185['faxAccounts']);_0x214ba6({'count':_0x1a176a[_0x1cd9('0x58')],'rows':_0x1a176a});});},'SendFax':function(_0xa8b91e){var _0x4b881e=this;return new Promise(function(_0x195cc9,_0x1f6da8){_0x195118['send'](_0xa8b91e)['then'](function(_0x3e9d90){_0x195cc9({'code':0xc8,'message':_0x3e9d90[_0x1cd9('0x1e')]});})[_0x1cd9('0x1f')](function(_0x1bca43){_0x1f6da8(_0x4b881e['error'](0x1f4,_0x1bca43[_0x1cd9('0x1e')]));});});},'CheckAfterSend':function(_0x26243b){var _0x319a9e=this;return new Promise(function(_0x5b0509,_0x39a20f){_0x195118[_0x1cd9('0x85')](_0x26243b)[_0x1cd9('0x1d')](function(_0x88000d){_0x5b0509({'code':0xc8,'message':_0x88000d[_0x1cd9('0x1e')]});})[_0x1cd9('0x1f')](function(_0x3860a9){_0x39a20f(_0x319a9e['error'](0x1f4,_0x3860a9[_0x1cd9('0x1e')]));});});}};var _0x4dfef3=jayson['server'](_0x490da8)[_0x1cd9('0x86')]();_0x4dfef3['on'](_0x1cd9('0x13'),function(_0x282898){return _0x4e54c0(_0x282898);});_0x4dfef3[_0x1cd9('0x87')](0x232a,_0x1cd9('0x88'),function(){console[_0x1cd9('0x89')](_0x1cd9('0x8a'),0x232a);return _0x20b51c(_0x1cd9('0x8b')+0x232a);});});}; \ No newline at end of file +var _0xe0cb=['asterisk','username','keys','module','message','join','command','Command','Action','catch','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','sumHoldTime','talking','total','type','unmanaged','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','channels','ami\x20disconnected','voicechannel','uniqueid','format','%s.%s','filename','wav','channel','ai(mixmonitorid)','then','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','voicequeuechannelredirect','Redirect','exten','context','values','telephones','trunks','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','server','http','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','validate','bluebird','moment','../../../config/environment','../ami','%s/%s','SIP','timers','agents','updateStatusRealtime','isConnected','error'];(function(_0x56003c,_0x280817){var _0x3eb098=function(_0x781511){while(--_0x781511){_0x56003c['push'](_0x56003c['shift']());}};_0x3eb098(++_0x280817);}(_0xe0cb,0xf5));var _0xbe0c=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0xe0cb[_0x35e75a];return _0xb23c7f;};'use strict';var _=require(_0xbe0c('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require(_0xbe0c('0x1'));var BPromise=require(_0xbe0c('0x2'));var moment=require(_0xbe0c('0x3'));var config=require(_0xbe0c('0x4'));var properties=require('../properties');var ami=require(_0xbe0c('0x5'));exports['listen']=function(_0x34b889,_0x52c695,_0x30b85e){return new BPromise(function(_0xfe4139,_0x2659bf){var _0x2a53fa={'QueuePause':function(_0x223b3c){return new Promise(function(_0x20ae55,_0xbc4343){var _0x58209e=util['format'](_0xbe0c('0x6'),_0xbe0c('0x7'),_0x223b3c['name']);if(_0x34b889[_0xbe0c('0x8')]&&_0x34b889['timers'][_0x58209e]&&_0x34b889[_0xbe0c('0x8')][_0x58209e]['timer']){_0x34b889[_0xbe0c('0x8')][_0x58209e]['updateAcw']();}if(_0x34b889[_0xbe0c('0x9')][_0x58209e]){_0x34b889[_0xbe0c('0x9')][_0x58209e][_0xbe0c('0xa')]({'statePause':_0x223b3c['pause']?!![]:![]});}_0x20ae55({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x3b59d0){var _0x25e4a3=this;return new Promise(function(_0x2b14b3,_0x4a443e){if(ami[_0xbe0c('0xb')]()==![]){return _0x4a443e(_0x25e4a3[_0xbe0c('0xc')](0x1f4,[config['asterisk']['ip'],config[_0xbe0c('0xd')][_0xbe0c('0xe')],'ami\x20disconnected']['join']('\x20')));}_0x3b59d0=_['pick'](_0x3b59d0,_[_0xbe0c('0xf')](properties[_0xbe0c('0x10')]));_0x3b59d0['action']='Reload';return ami['Action'](_0x3b59d0)['then'](function(_0x2ffeaa){_0x2b14b3({'code':0xc8,'message':_0x2ffeaa[_0xbe0c('0x11')]});})['catch'](function(_0x108fd1){_0x4a443e(_0x25e4a3[_0xbe0c('0xc')](0x1f5,_0x108fd1[_0xbe0c('0x11')]));});});},'Command':function(_0x22638a){var _0x2bc200=this;return new Promise(function(_0x52072a,_0xbd71d1){if(ami[_0xbe0c('0xb')]()==![]){return _0xbd71d1(_0x2bc200[_0xbe0c('0xc')](0x1f4,[config[_0xbe0c('0xd')]['ip'],config[_0xbe0c('0xd')][_0xbe0c('0xe')],'ami\x20disconnected'][_0xbe0c('0x12')]('\x20')));}_0x22638a=_['pick'](_0x22638a,_0xbe0c('0x13'));_0x22638a['action']=_0xbe0c('0x14');return ami[_0xbe0c('0x15')](_0x22638a)['then'](function(_0x3120a4){_0x52072a({'code':0xc8,'message':_0x3120a4['content']});})[_0xbe0c('0x16')](function(_0x45a52a){_0xbd71d1(_0x2bc200[_0xbe0c('0xc')](0x1f5,_0x45a52a[_0xbe0c('0x11')]));});});},'VoiceQueues':function(_0x46b379){return new Promise(function(_0x20ff51,_0x527b5d){var _0xffe156=[];for(var _0x4266a5 in _0x34b889[_0xbe0c('0x17')]){if(_0x34b889[_0xbe0c('0x17')][_0xbe0c('0x18')](_0x4266a5)){var _0x4cdc16=_0x34b889[_0xbe0c('0x17')][_0x4266a5];var _0x4ff2de={'id':_0x4cdc16['id'],'name':_0x4cdc16[_0xbe0c('0x19')],'strategy':_0x4cdc16[_0xbe0c('0x1a')],'answered':_0x4cdc16[_0xbe0c('0x1b')],'available':_0x4cdc16[_0xbe0c('0x1c')],'loggedIn':_0x4cdc16[_0xbe0c('0x1d')],'pTalking':_0x4cdc16['pTalking'],'sumBillable':_0x4cdc16['sumBillable'],'sumDuration':_0x4cdc16['sumDuration'],'sumHoldTime':_0x4cdc16[_0xbe0c('0x1e')]||0x0,'talking':_0x4cdc16[_0xbe0c('0x1f')],'total':_0x4cdc16[_0xbe0c('0x20')],'type':_0x4cdc16[_0xbe0c('0x21')],'unmanaged':_0x4cdc16[_0xbe0c('0x22')],'abandoned':_0x4cdc16['abandoned'],'waiting':_0x4cdc16['waiting'],'loggedInDb':_0x4cdc16[_0xbe0c('0x23')]};if(_0x4cdc16[_0xbe0c('0x21')]==='outbound'){_0x4ff2de['dialActive']=_0x4cdc16['dialActive'];_0x4ff2de['dialMethod']=_0x4cdc16[_0xbe0c('0x24')];_0x4ff2de[_0xbe0c('0x25')]=_0x4cdc16[_0xbe0c('0x25')];_0x4ff2de[_0xbe0c('0x26')]=_0x4cdc16[_0xbe0c('0x26')];_0x4ff2de[_0xbe0c('0x27')]=_0x4cdc16[_0xbe0c('0x27')];_0x4ff2de[_0xbe0c('0x28')]=_0x4cdc16[_0xbe0c('0x28')];_0x4ff2de[_0xbe0c('0x29')]=_0x4cdc16[_0xbe0c('0x29')];_0x4ff2de[_0xbe0c('0x2a')]=_0x4cdc16[_0xbe0c('0x2a')];_0x4ff2de[_0xbe0c('0x2b')]=_0x4cdc16[_0xbe0c('0x2b')];_0x4ff2de['outboundBusyCallsDay']=_0x4cdc16[_0xbe0c('0x2c')];_0x4ff2de[_0xbe0c('0x2d')]=_0x4cdc16[_0xbe0c('0x2d')];_0x4ff2de[_0xbe0c('0x2e')]=_0x4cdc16['outboundDropCallsDayACS'];_0x4ff2de[_0xbe0c('0x2f')]=_0x4cdc16[_0xbe0c('0x2f')];_0x4ff2de[_0xbe0c('0x30')]=_0x4cdc16[_0xbe0c('0x30')];_0x4ff2de[_0xbe0c('0x31')]=_0x4cdc16[_0xbe0c('0x31')];_0x4ff2de[_0xbe0c('0x32')]=_0x4cdc16[_0xbe0c('0x32')];_0x4ff2de['outboundOriginateFailureCallsDay']=_0x4cdc16[_0xbe0c('0x33')];_0x4ff2de[_0xbe0c('0x34')]=_0x4cdc16[_0xbe0c('0x34')];_0x4ff2de['outboundRejectCallsDay']=_0x4cdc16['outboundRejectCallsDay'];_0x4ff2de[_0xbe0c('0x35')]=_0x4cdc16[_0xbe0c('0x35')];_0x4ff2de[_0xbe0c('0x36')]=_0x4cdc16[_0xbe0c('0x36')];_0x4ff2de[_0xbe0c('0x37')]=_0x4cdc16[_0xbe0c('0x37')];_0x4ff2de[_0xbe0c('0x38')]=_0x4cdc16[_0xbe0c('0x38')];_0x4ff2de[_0xbe0c('0x39')]=_0x4cdc16[_0xbe0c('0x39')];_0x4ff2de[_0xbe0c('0x3a')]=_0x4cdc16[_0xbe0c('0x3a')];_0x4ff2de[_0xbe0c('0x3b')]=_0x4cdc16[_0xbe0c('0x3b')];_0x4ff2de[_0xbe0c('0x3c')]=_0x4cdc16[_0xbe0c('0x3c')];_0x4ff2de['predictiveIntervalHitRate']=_0x4cdc16[_0xbe0c('0x3d')];_0x4ff2de[_0xbe0c('0x3e')]=_0x4cdc16[_0xbe0c('0x3e')];_0x4ff2de[_0xbe0c('0x3f')]=_0x4cdc16[_0xbe0c('0x3f')];_0x4ff2de[_0xbe0c('0x40')]=_0x4cdc16[_0xbe0c('0x40')];_0x4ff2de[_0xbe0c('0x41')]=_0x4cdc16['predictiveIntervalTotalCalls'];_0x4ff2de[_0xbe0c('0x11')]=_0x4cdc16['message'];_0x4ff2de[_0xbe0c('0x42')]=_0x4cdc16[_0xbe0c('0x42')];_0x4ff2de[_0xbe0c('0x43')]=_0x4cdc16[_0xbe0c('0x43')];_0x4ff2de[_0xbe0c('0x44')]=_0x4cdc16[_0xbe0c('0x44')];_0x4ff2de[_0xbe0c('0x45')]=_0x4cdc16[_0xbe0c('0x45')];_0x4ff2de[_0xbe0c('0x46')]=_0x4cdc16[_0xbe0c('0x46')];_0x4ff2de[_0xbe0c('0x47')]=_0x4cdc16[_0xbe0c('0x47')];_0x4ff2de[_0xbe0c('0x48')]=_0x4cdc16[_0xbe0c('0x48')];}if(_0x4cdc16[_0xbe0c('0x49')]){_0x4ff2de[_0xbe0c('0x49')]={'id':_0x4cdc16[_0xbe0c('0x49')]['id'],'name':_0x4cdc16[_0xbe0c('0x49')][_0xbe0c('0x19')],'active':_0x4cdc16[_0xbe0c('0x49')][_0xbe0c('0x4a')],'callerid':_0x4cdc16[_0xbe0c('0x49')]['callerid']};}if(_0x4cdc16[_0xbe0c('0x4b')]){_0x4ff2de[_0xbe0c('0x4b')]={'id':_0x4cdc16[_0xbe0c('0x4b')]['id'],'name':_0x4cdc16[_0xbe0c('0x4b')][_0xbe0c('0x19')]};}_0xffe156[_0xbe0c('0x4c')](_0x4ff2de);}}_0x20ff51({'count':_0xffe156[_0xbe0c('0x4d')],'rows':_0xffe156});});},'VoiceChannels':function(_0x26ba31){return new Promise(function(_0x2fe145,_0x2b8d23){var _0x228b76=_['values'](_0x34b889[_0xbe0c('0x4e')]);_0x2fe145({'count':_0x228b76[_0xbe0c('0x4d')],'rows':_0x228b76});});},'VoiceChannelMixMonitor':function(_0x293a39){var _0x3cfbe5=this;return new Promise(function(_0x1abe4f,_0x4b9ff3){if(ami['isConnected']()==![]){return _0x4b9ff3(_0x3cfbe5[_0xbe0c('0xc')](0x1f4,[config[_0xbe0c('0xd')]['ip'],config[_0xbe0c('0xd')][_0xbe0c('0xe')],_0xbe0c('0x4f')][_0xbe0c('0x12')]('\x20')));}var _0x5b86aa=schema(properties[_0xbe0c('0x50')])[_0xbe0c('0x1')](_0x293a39);if(_0x5b86aa[_0xbe0c('0x4d')]>0x0){return _0x4b9ff3(_0x3cfbe5[_0xbe0c('0xc')](0x1f4,_['map'](_0x5b86aa,_0xbe0c('0x11'))[_0xbe0c('0x12')](',\x20')));}var _0x54c8b6=_['find'](_0x34b889[_0xbe0c('0x4e')],{'uniqueid':_0x293a39[_0xbe0c('0x51')]});if(_0x54c8b6&&_0x54c8b6['channel']){var _0x4d311c=util[_0xbe0c('0x52')](_0xbe0c('0x53'),_0x293a39[_0xbe0c('0x54')]||_0x293a39[_0xbe0c('0x51')],_0x293a39['format']||_0xbe0c('0x55'));return ami['Action']({'action':'MixMonitor','channel':_0x54c8b6[_0xbe0c('0x56')],'file':_0x4d311c,'options':_0xbe0c('0x57')})[_0xbe0c('0x58')](function(_0x3121b3){var _0x1891bf=_[_0xbe0c('0x59')](_0x54c8b6[_0xbe0c('0x5a')],{'filename':_0xbe0c('0x5b')+_0x4d311c[_0xbe0c('0x5c')]()});if(_[_0xbe0c('0x5d')](_0x1891bf)){_0x54c8b6[_0xbe0c('0x5a')][_0xbe0c('0x4c')]({'filename':_0xbe0c('0x5b')+_0x4d311c['toLowerCase'](),'createdAt':moment()[_0xbe0c('0x52')](_0xbe0c('0x5e')),'mixmonitorid':_0x3121b3[_0xbe0c('0x5f')],'status':_0xbe0c('0x60')});}else{_0x1891bf[_0xbe0c('0x5f')]=_0x3121b3[_0xbe0c('0x5f')];_0x1891bf[_0xbe0c('0x61')]=_0xbe0c('0x60');}_0x1abe4f({'code':0xc8,'message':[_0x293a39[_0xbe0c('0x51')],_0xbe0c('0x62'),_0x3121b3[_0xbe0c('0x5f')]][_0xbe0c('0x12')]('\x20'),'mixmonitorid':_0x3121b3[_0xbe0c('0x5f')]});})[_0xbe0c('0x16')](function(_0x31d82a){_0x4b9ff3(_0x3cfbe5[_0xbe0c('0xc')](0x1f5,[_0x293a39[_0xbe0c('0x51')],_0x31d82a['message']['toLowerCase']()][_0xbe0c('0x12')]('\x20')));});}else{return _0x4b9ff3(_0x3cfbe5[_0xbe0c('0xc')](0x1f5,_0xbe0c('0x63')));}});},'VoiceChannelStopMixMonitor':function(_0x2c6239){var _0x3628ad=this;return new Promise(function(_0x1b117c,_0x196b6f){if(ami[_0xbe0c('0xb')]()==![]){return _0x196b6f(_0x3628ad['error'](0x1f4,[config['asterisk']['ip'],config[_0xbe0c('0xd')][_0xbe0c('0xe')],_0xbe0c('0x4f')]['join']('\x20')));}var _0x1b5b8e=schema(properties['voicechannel'])[_0xbe0c('0x1')](_0x2c6239);if(_0x1b5b8e[_0xbe0c('0x4d')]>0x0){return _0x196b6f(_0x3628ad[_0xbe0c('0xc')](0x1f4,_[_0xbe0c('0x64')](_0x1b5b8e,_0xbe0c('0x11'))[_0xbe0c('0x12')](',\x20')));}var _0x5ad462=_[_0xbe0c('0x59')](_0x34b889[_0xbe0c('0x4e')],{'uniqueid':_0x2c6239[_0xbe0c('0x51')]});if(_0x5ad462){return BPromise[_0xbe0c('0x65')]()[_0xbe0c('0x58')](function(){if(_0x5ad462[_0xbe0c('0x56')]){return ami['Action']({'action':_0xbe0c('0x66'),'channel':_0x5ad462[_0xbe0c('0x56')],'mixmonitorid':_0x2c6239[_0xbe0c('0x5f')]})[_0xbe0c('0x16')](function(_0x3f53b0){});}})[_0xbe0c('0x58')](function(){if(_0x5ad462[_0xbe0c('0x67')]){return ami[_0xbe0c('0x15')]({'action':_0xbe0c('0x66'),'channel':_0x5ad462[_0xbe0c('0x67')],'mixmonitorid':_0x2c6239[_0xbe0c('0x5f')]})[_0xbe0c('0x16')](function(_0x1ef142){});}})[_0xbe0c('0x58')](function(_0x2073fb){var _0x28fdfc=_[_0xbe0c('0x59')](_0x5ad462[_0xbe0c('0x5a')],{'mixmonitorid':_0x2c6239[_0xbe0c('0x5f')]});if(_0x28fdfc){_0x28fdfc[_0xbe0c('0x61')]=_0xbe0c('0x68');}})[_0xbe0c('0x58')](function(){var _0x1bf4a6=util[_0xbe0c('0x52')](_0xbe0c('0x53'),_0x2c6239[_0xbe0c('0x54')]||_0x2c6239['uniqueid'],_0x2c6239[_0xbe0c('0x52')]||_0xbe0c('0x55'));var _0x71924f=_['find'](_0x5ad462[_0xbe0c('0x5a')],{'filename':_0xbe0c('0x5b')+_0x1bf4a6[_0xbe0c('0x5c')]()});if(_0x71924f){_0x71924f['status']=_0xbe0c('0x68');}})[_0xbe0c('0x58')](function(){_0x1b117c({'code':0xc8,'message':[_0x2c6239[_0xbe0c('0x51')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbe0c('0x16')](function(_0x4afa37){_0x196b6f(_0x3628ad['error'](0x1f5,[_0x2c6239[_0xbe0c('0x51')],_0x4afa37[_0xbe0c('0x11')][_0xbe0c('0x5c')]()][_0xbe0c('0x12')]('\x20')));});}else{return _0x196b6f(_0x3628ad['error'](0x1f5,_0xbe0c('0x63')));}});},'VoiceQueuesChannels':function(_0x5be816){return new Promise(function(_0x1fc8e6,_0x55f463){var _0x3aed01=_['values'](_0x34b889[_0xbe0c('0x69')]);_0x1fc8e6({'count':_0x3aed01[_0xbe0c('0x4d')],'rows':_0x3aed01});});},'VoiceQueuesChannel':function(_0xb0a556){var _0x2b53f0=this;return new Promise(function(_0x2c87b5,_0x1dff6e){var _0x38243c=schema(properties[_0xbe0c('0x6a')])[_0xbe0c('0x1')](_0xb0a556);if(_0x38243c[_0xbe0c('0x4d')]>0x0){return _0x1dff6e(_0x2b53f0['error'](0x1f4,_[_0xbe0c('0x64')](_0x38243c,'message')['join'](',\x20')));}var _0x19a6de=_[_0xbe0c('0x59')](_0x34b889[_0xbe0c('0x69')],{'uniqueid':_0xb0a556[_0xbe0c('0x51')]});if(_0x19a6de){_0x2c87b5(_0x19a6de);}else{return _0x1dff6e(_0x2b53f0[_0xbe0c('0xc')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x43349f){var _0x161e27=this;return new Promise(function(_0x3de983,_0x26f785){if(ami[_0xbe0c('0xb')]()==![]){return _0x26f785(_0x161e27[_0xbe0c('0xc')](0x1f4,[config[_0xbe0c('0xd')]['ip'],config[_0xbe0c('0xd')][_0xbe0c('0xe')],'ami\x20disconnected'][_0xbe0c('0x12')]('\x20')));}var _0x5286e2=schema(properties['voicequeuechannelhangup'])[_0xbe0c('0x1')](_0x43349f);if(_0x5286e2[_0xbe0c('0x4d')]>0x0){return _0x26f785(_0x161e27[_0xbe0c('0xc')](0x1f4,_[_0xbe0c('0x64')](_0x5286e2,_0xbe0c('0x11'))['join'](',\x20')));}var _0x1c8f03=_['find'](_0x34b889[_0xbe0c('0x69')],{'uniqueid':_0x43349f[_0xbe0c('0x51')]});if(_0x1c8f03&&_0x1c8f03['channel']){return ami[_0xbe0c('0x15')]({'action':'Hangup','channel':_0x1c8f03[_0xbe0c('0x56')]})[_0xbe0c('0x58')](function(_0x5b80c8){_0x3de983({'code':0xc8,'message':[_0x43349f[_0xbe0c('0x51')],_0x5b80c8[_0xbe0c('0x11')][_0xbe0c('0x5c')]()][_0xbe0c('0x12')]('\x20')});})[_0xbe0c('0x16')](function(_0x45c6e9){_0x26f785(_0x161e27[_0xbe0c('0xc')](0x1f5,[_0x43349f[_0xbe0c('0x51')],_0x45c6e9[_0xbe0c('0x11')][_0xbe0c('0x5c')]()][_0xbe0c('0x12')]('\x20')));});}else{return _0x26f785(_0x161e27['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2dc626){var _0x214409=this;return new Promise(function(_0x1053f6,_0x18e457){if(ami['isConnected']()==![]){return _0x18e457(_0x214409[_0xbe0c('0xc')](0x1f4,[config[_0xbe0c('0xd')]['ip'],config[_0xbe0c('0xd')]['username'],_0xbe0c('0x4f')][_0xbe0c('0x12')]('\x20')));}var _0x1bc0c0=schema(properties[_0xbe0c('0x6b')])['validate'](_0x2dc626);if(_0x1bc0c0[_0xbe0c('0x4d')]>0x0){return _0x18e457(_0x214409['error'](0x1f4,_[_0xbe0c('0x64')](_0x1bc0c0,_0xbe0c('0x11'))['join'](',\x20')));}var _0x416883=_[_0xbe0c('0x59')](_0x34b889[_0xbe0c('0x69')],{'uniqueid':_0x2dc626[_0xbe0c('0x51')]});if(_0x416883&&_0x416883[_0xbe0c('0x56')]){return ami[_0xbe0c('0x15')]({'action':_0xbe0c('0x6c'),'channel':_0x416883[_0xbe0c('0x56')],'exten':_0x2dc626[_0xbe0c('0x6d')],'context':_0x2dc626[_0xbe0c('0x6e')]||_0x416883[_0xbe0c('0x6e')],'priority':0x1})[_0xbe0c('0x58')](function(_0x5a042d){_0x1053f6({'code':0xc8,'message':[_0x2dc626['uniqueid'],_0x5a042d[_0xbe0c('0x11')]['toLowerCase']()][_0xbe0c('0x12')]('\x20')});})[_0xbe0c('0x16')](function(_0xf4e2c6){_0x18e457(_0x214409[_0xbe0c('0xc')](0x1f5,[_0x2dc626['uniqueid'],_0xf4e2c6['message'][_0xbe0c('0x5c')]()][_0xbe0c('0x12')]('\x20')));});}else{return _0x18e457(_0x214409[_0xbe0c('0xc')](0x1f5,_0xbe0c('0x63')));}});},'Agents':function(_0xfa88af){return new Promise(function(_0x4dfa87,_0x191689){var _0xe39e4e=_[_0xbe0c('0x6f')](_0x34b889[_0xbe0c('0x9')]);_0x4dfa87({'count':_0xe39e4e[_0xbe0c('0x4d')],'rows':_0xe39e4e});});},'Telephones':function(_0x1e17c5){return new Promise(function(_0x472640,_0x60f8d1){var _0x6cf171=_[_0xbe0c('0x6f')](_0x34b889[_0xbe0c('0x70')]);_0x472640({'count':_0x6cf171['length'],'rows':_0x6cf171});});},'Trunks':function(_0x3b01dd){return new Promise(function(_0x47d820,_0x45f68d){var _0x44f5eb=_[_0xbe0c('0x6f')](_0x34b889[_0xbe0c('0x71')]);_0x47d820({'count':_0x44f5eb[_0xbe0c('0x4d')],'rows':_0x44f5eb});});},'OutboundChannels':function(_0x374e98){return new Promise(function(_0x336242,_0x173e6c){var _0x5bb8ce=_[_0xbe0c('0x6f')](_0x34b889[_0xbe0c('0x72')]);_0x336242({'count':_0x5bb8ce[_0xbe0c('0x4d')],'rows':_0x5bb8ce});});},'Outbound':function(_0x4aea13){return new Promise(function(_0x33ac5d,_0x5a9761){_0x33ac5d(_0x34b889[_0xbe0c('0x73')]);});},'Campaigns':function(_0x48bc40){return new Promise(function(_0x20bdbd,_0x4ab6eb){var _0x594e23=_['values'](_0x34b889[_0xbe0c('0x74')]);_0x20bdbd({'count':_0x594e23[_0xbe0c('0x4d')],'rows':_0x594e23});});},'VoiceQueuesPreview':function(_0x30208b){var _0x4375f2=this;return new Promise(function(_0x383f34,_0x428afb){_0x52c695[_0xbe0c('0x75')](_0x30208b['id'])['then'](function(_0x4c3815){_0x383f34({'code':0xc8,'message':_0x4c3815[_0xbe0c('0x11')]});})[_0xbe0c('0x16')](function(_0xafb7e4){_0x428afb(_0x4375f2[_0xbe0c('0xc')](0x1f4,_0xafb7e4[_0xbe0c('0x11')]));});});},'EventManager':function(_0x25e1c7){var _0x18e8a7=this;return new Promise(function(_0xc1366a,_0x4dedcd){if(!_0x25e1c7[_0xbe0c('0x76')]){return _0x4dedcd(_0x18e8a7[_0xbe0c('0xc')](0x1f4,_0xbe0c('0x77')));}ami[_0xbe0c('0x78')]('custom:'+_0x25e1c7[_0xbe0c('0x76')],_0x25e1c7[_0xbe0c('0x11')]);_0xc1366a({'code':0xc8,'message':_0x25e1c7});});},'FaxAccounts':function(_0x558dda){return new Promise(function(_0x98ee1b,_0x37135f){var _0x2b28ce=_[_0xbe0c('0x6f')](_0x34b889[_0xbe0c('0x79')]);_0x98ee1b({'count':_0x2b28ce[_0xbe0c('0x4d')],'rows':_0x2b28ce});});},'SendFax':function(_0x10000c){var _0x3d2722=this;return new Promise(function(_0x252a84,_0x17a076){_0x30b85e['send'](_0x10000c)['then'](function(_0x3120eb){_0x252a84({'code':0xc8,'message':_0x3120eb['message']});})[_0xbe0c('0x16')](function(_0x2617b8){_0x17a076(_0x3d2722[_0xbe0c('0xc')](0x1f4,_0x2617b8['message']));});});},'CheckAfterSend':function(_0x4e15e5){var _0x108e5a=this;return new Promise(function(_0x57818c,_0x22dad8){_0x30b85e[_0xbe0c('0x7a')](_0x4e15e5)[_0xbe0c('0x58')](function(_0x4bc62f){_0x57818c({'code':0xc8,'message':_0x4bc62f[_0xbe0c('0x11')]});})[_0xbe0c('0x16')](function(_0x1f7cc1){_0x22dad8(_0x108e5a['error'](0x1f4,_0x1f7cc1[_0xbe0c('0x11')]));});});}};var _0x12ceef=jayson[_0xbe0c('0x7b')](_0x2a53fa)[_0xbe0c('0x7c')]();_0x12ceef['on'](_0xbe0c('0xc'),function(_0x75c665){return _0x2659bf(_0x75c665);});_0x12ceef[_0xbe0c('0x7d')](0x232a,_0xbe0c('0x7e'),function(){console[_0xbe0c('0x7f')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xfe4139(_0xbe0c('0x80')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 9b071f3..f021518 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd945=['phone','resolve','then','omit','xmd-contactid2','format','user:%s','name','trigger:%s','action','toLowerCase','merge','createContact','error','Error\x20creating\x20contact','bluebird','util','lodash','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','stringify','exec','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum'];(function(_0x9bdf9e,_0x51f25b){var _0x6d874=function(_0x5e59e6){while(--_0x5e59e6){_0x9bdf9e['push'](_0x9bdf9e['shift']());}};_0x6d874(++_0x51f25b);}(_0xd945,0x84));var _0x5d94=function(_0x159d9f,_0xfe580d){_0x159d9f=_0x159d9f-0x0;var _0x16aadf=_0xd945[_0x159d9f];return _0x16aadf;};'use strict';var BPromise=require(_0x5d94('0x0'));var util=require(_0x5d94('0x1'));var _=require(_0x5d94('0x2'));var Redis=require('ioredis');var config=require(_0x5d94('0x3'));var logger=require(_0x5d94('0x4'))(_0x5d94('0x5'));var cmContactRpc=require(_0x5d94('0x6'));config[_0x5d94('0x7')]=_['defaults'](config[_0x5d94('0x7')],{'host':_0x5d94('0x8'),'port':0x18eb});var io=require(_0x5d94('0x9'))(new Redis(config[_0x5d94('0x7')]));function emit(_0x3635a6,_0x54af94,_0x430607){logger[_0x5d94('0xa')](_0x3635a6,_0x54af94,JSON[_0x5d94('0xb')](_0x430607));io['to'](_0x3635a6)['emit'](_0x54af94,_0x430607);}exports[_0x5d94('0xc')]=function(_0x3dd79e,_0x320db2,_0x3b76f4){_0x3b76f4['autoCreate']=0x0;if(_0x320db2[_0x5d94('0xd')]&&parseInt(_0x320db2['data2'],0xa)){var _0x2257e1={'ListId':parseInt(_0x320db2[_0x5d94('0xe')],0xa),'phone':_0x3b76f4[_0x5d94('0xf')]};if(_[_0x5d94('0x10')](_0x3b76f4[_0x5d94('0x11')])){_0x2257e1[_0x5d94('0x12')]=_0x3b76f4[_0x5d94('0x13')]&&_0x3b76f4[_0x5d94('0x13')]!==_0x5d94('0x14')?_0x3b76f4[_0x5d94('0x13')]:_0x3b76f4['calleridnum']||_0x3b76f4[_0x5d94('0x15')];}else{_0x2257e1[_0x5d94('0x12')]=_0x3b76f4['destcalleridname']&&_0x3b76f4[_0x5d94('0x16')]!==_0x5d94('0x14')?_0x3b76f4[_0x5d94('0x16')]:_0x3b76f4[_0x5d94('0x17')]||_0x3b76f4[_0x5d94('0x15')];_0x2257e1[_0x5d94('0x18')]=_0x3b76f4['destcalleridname']&&_0x3b76f4['destcalleridname']!==''?_0x3b76f4[_0x5d94('0x16')]:_0x3b76f4[_0x5d94('0x17')]||_0x3b76f4[_0x5d94('0x15')];}BPromise[_0x5d94('0x19')]()[_0x5d94('0x1a')](cmContactRpc['showContact']({'where':_[_0x5d94('0x1b')](_0x2257e1,[_0x5d94('0x12')])}))[_0x5d94('0x1a')](function(_0x6c8f02){if(_0x6c8f02){_0x3b76f4[_0x5d94('0x1c')]=_0x6c8f02['id'];emit(util[_0x5d94('0x1d')](_0x5d94('0x1e'),_0x3dd79e[_0x5d94('0x1f')]),util[_0x5d94('0x1d')](_0x5d94('0x20'),_0x320db2[_0x5d94('0x21')][_0x5d94('0x22')]()),_[_0x5d94('0x23')](_0x3b76f4,{'ListId':parseInt(_0x320db2['data1'],0xa)}));return;}else{return BPromise[_0x5d94('0x19')]()[_0x5d94('0x1a')](cmContactRpc[_0x5d94('0x24')](_0x2257e1));}})[_0x5d94('0x1a')](function(_0x2b867b){if(_0x2b867b){_0x3b76f4[_0x5d94('0x1c')]=_0x2b867b['id'];emit(util[_0x5d94('0x1d')](_0x5d94('0x1e'),_0x3dd79e[_0x5d94('0x1f')]),util[_0x5d94('0x1d')](_0x5d94('0x20'),_0x320db2[_0x5d94('0x21')][_0x5d94('0x22')]()),_[_0x5d94('0x23')](_0x3b76f4,{'ListId':parseInt(_0x320db2[_0x5d94('0xe')],0xa)}));}})['catch'](function(_0x374c3f){logger[_0x5d94('0x25')](_0x5d94('0x26'),JSON[_0x5d94('0xb')](_0x374c3f));});}else{if(_0x3dd79e){emit(util[_0x5d94('0x1d')](_0x5d94('0x1e'),_0x3dd79e[_0x5d94('0x1f')]),util[_0x5d94('0x1d')](_0x5d94('0x20'),_0x320db2[_0x5d94('0x21')][_0x5d94('0x22')]()),_['merge']({'ListId':parseInt(_0x320db2['data1'],0xa)},_0x3b76f4));}}}; \ No newline at end of file +var _0xf811=['firstName','calleridname','','uniqueid','destcalleridname','phone','destcalleridnum','then','showContact','xmd-contactid2','format','name','trigger:%s','action','toLowerCase','merge','resolve','createContact','user:%s','catch','error','Error\x20creating\x20contact','stringify','bluebird','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId'];(function(_0xf6018,_0x31cdcb){var _0x50e761=function(_0x40f7bd){while(--_0x40f7bd){_0xf6018['push'](_0xf6018['shift']());}};_0x50e761(++_0x31cdcb);}(_0xf811,0x6f));var _0x1f81=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xf811[_0x465a0c];return _0x1e202e;};'use strict';var BPromise=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var _=require(_0x1f81('0x2'));var Redis=require(_0x1f81('0x3'));var config=require(_0x1f81('0x4'));var logger=require(_0x1f81('0x5'))(_0x1f81('0x6'));var cmContactRpc=require(_0x1f81('0x7'));config[_0x1f81('0x8')]=_[_0x1f81('0x9')](config[_0x1f81('0x8')],{'host':_0x1f81('0xa'),'port':0x18eb});var io=require(_0x1f81('0xb'))(new Redis(config[_0x1f81('0x8')]));function emit(_0x57c512,_0x2238b2,_0x42b31b){logger[_0x1f81('0xc')](_0x57c512,_0x2238b2,JSON['stringify'](_0x42b31b));io['to'](_0x57c512)[_0x1f81('0xd')](_0x2238b2,_0x42b31b);}exports[_0x1f81('0xe')]=function(_0x4af394,_0x2ce4d7,_0x56b05d){_0x56b05d[_0x1f81('0xf')]=0x0;if(_0x2ce4d7[_0x1f81('0x10')]&&parseInt(_0x2ce4d7[_0x1f81('0x10')],0xa)){var _0x1025bf={'ListId':parseInt(_0x2ce4d7[_0x1f81('0x11')],0xa),'phone':_0x56b05d[_0x1f81('0x12')]};if(_[_0x1f81('0x13')](_0x56b05d[_0x1f81('0x14')])){_0x1025bf[_0x1f81('0x15')]=_0x56b05d[_0x1f81('0x16')]&&_0x56b05d[_0x1f81('0x16')]!==_0x1f81('0x17')?_0x56b05d[_0x1f81('0x16')]:_0x56b05d[_0x1f81('0x12')]||_0x56b05d[_0x1f81('0x18')];}else{_0x1025bf[_0x1f81('0x15')]=_0x56b05d['destcalleridname']&&_0x56b05d[_0x1f81('0x19')]!==_0x1f81('0x17')?_0x56b05d['destcalleridname']:_0x56b05d['destcalleridnum']||_0x56b05d[_0x1f81('0x18')];_0x1025bf[_0x1f81('0x1a')]=_0x56b05d['destcalleridname']&&_0x56b05d[_0x1f81('0x19')]!==_0x1f81('0x17')?_0x56b05d[_0x1f81('0x19')]:_0x56b05d[_0x1f81('0x1b')]||_0x56b05d['uniqueid'];}BPromise['resolve']()[_0x1f81('0x1c')](cmContactRpc[_0x1f81('0x1d')]({'where':_['omit'](_0x1025bf,[_0x1f81('0x15')])}))['then'](function(_0x25df22){if(_0x25df22){_0x56b05d[_0x1f81('0x1e')]=_0x25df22['id'];emit(util[_0x1f81('0x1f')]('user:%s',_0x4af394[_0x1f81('0x20')]),util[_0x1f81('0x1f')](_0x1f81('0x21'),_0x2ce4d7[_0x1f81('0x22')][_0x1f81('0x23')]()),_[_0x1f81('0x24')](_0x56b05d,{'ListId':parseInt(_0x2ce4d7['data1'],0xa)}));return;}else{return BPromise[_0x1f81('0x25')]()[_0x1f81('0x1c')](cmContactRpc[_0x1f81('0x26')](_0x1025bf));}})['then'](function(_0x4a57e6){if(_0x4a57e6){_0x56b05d[_0x1f81('0x1e')]=_0x4a57e6['id'];emit(util['format'](_0x1f81('0x27'),_0x4af394['name']),util['format'](_0x1f81('0x21'),_0x2ce4d7['action'][_0x1f81('0x23')]()),_['merge'](_0x56b05d,{'ListId':parseInt(_0x2ce4d7[_0x1f81('0x11')],0xa)}));}})[_0x1f81('0x28')](function(_0x147695){logger[_0x1f81('0x29')](_0x1f81('0x2a'),JSON[_0x1f81('0x2b')](_0x147695));});}else{if(_0x4af394){emit(util[_0x1f81('0x1f')](_0x1f81('0x27'),_0x4af394[_0x1f81('0x20')]),util[_0x1f81('0x1f')]('trigger:%s',_0x2ce4d7[_0x1f81('0x22')]['toLowerCase']()),_[_0x1f81('0x24')]({'ListId':parseInt(_0x2ce4d7[_0x1f81('0x11')],0xa)},_0x56b05d));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index f91644f..e195468 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4840=['exec','integration','queue','routeId','urlforward','script','parse','merge','query','search','replace','checkTrigger','AllConditions','checkConditions','AnyConditions','some','channel','field','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','clone','checkTriggers','interface','hasOwnProperty','status','variables','Actions','length','action','toLowerCase','motionbar','data1','popup','TemplateId','data2','render','html','uri','buildUri','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winapp','winApplication','winArguments','trigger:%s:%s','jscripty','format','user:%s','name','trigger:%s'];(function(_0x398ec3,_0x403e6c){var _0x231f76=function(_0x4b3321){while(--_0x4b3321){_0x398ec3['push'](_0x398ec3['shift']());}};_0x231f76(++_0x403e6c);}(_0x4840,0x1f1));var _0x0484=function(_0x401701,_0x149dce){_0x401701=_0x401701-0x0;var _0x3da178=_0x4840[_0x401701];return _0x3da178;};'use strict';var util=require(_0x0484('0x0'));var _=require(_0x0484('0x1'));var url=require(_0x0484('0x2'));var Mustache=require(_0x0484('0x3'));var Redis=require(_0x0484('0x4'));var urlforward=require(_0x0484('0x5'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x0484('0x6'));var cmContactRpc=require(_0x0484('0x7'));var config=require(_0x0484('0x8'));var logger=require(_0x0484('0x9'))(_0x0484('0xa'));var ami=require(_0x0484('0xb'));config[_0x0484('0xc')]=_[_0x0484('0xd')](config[_0x0484('0xc')],{'host':_0x0484('0xe'),'port':0x18eb});var io=require(_0x0484('0xf'))(new Redis(config[_0x0484('0xc')]));var operators={'equals':function(_0x2e6d9d,_0xb38133){return _0x2e6d9d==_0xb38133;},'not_equals':function(_0x1b471e,_0x18f07c){return _0x1b471e!=_0x18f07c;}};var barAndWebActions=['popup',_0x0484('0x2'),'winapp'];function Trigger(_0x2bdd2e){this[_0x0484('0x10')]=_0x2bdd2e[_0x0484('0x10')];this[_0x0484('0x11')]=_0x2bdd2e[_0x0484('0x11')];this[_0x0484('0x12')]=_0x2bdd2e[_0x0484('0x12')];this[_0x0484('0x13')]=_0x2bdd2e['templates'];this[_0x0484('0x14')]=_0x2bdd2e[_0x0484('0x14')];this[_0x0484('0x15')]=_0x2bdd2e[_0x0484('0x15')];this[_0x0484('0x16')]=_0x2bdd2e['freshdeskAccounts'];this['salesforceAccounts']=_0x2bdd2e[_0x0484('0x17')];this[_0x0484('0x18')]=_0x2bdd2e[_0x0484('0x18')];this['zohoAccounts']=_0x2bdd2e[_0x0484('0x19')];this[_0x0484('0x1a')]=_0x2bdd2e[_0x0484('0x1a')];this[_0x0484('0x1b')]=_0x2bdd2e[_0x0484('0x1b')];this[_0x0484('0x1c')]=_0x2bdd2e[_0x0484('0x1c')];this[_0x0484('0x1d')]=_0x2bdd2e[_0x0484('0x1d')];this[_0x0484('0x1e')]=_0x2bdd2e[_0x0484('0x1e')];this[_0x0484('0x1f')]={'zendesk':this[_0x0484('0x15')],'salesforce':this[_0x0484('0x17')],'freshdesk':this[_0x0484('0x16')],'sugarcrm':this[_0x0484('0x18')],'zoho':this[_0x0484('0x19')],'desk':this[_0x0484('0x1a')],'vtiger':this[_0x0484('0x1b')],'dynamics365':this[_0x0484('0x1d')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0x0484('0x20'),this[_0x0484('0x21')][_0x0484('0x22')](this));ami['on']('custom:agentconnect',this[_0x0484('0x21')][_0x0484('0x22')](this));ami['on'](_0x0484('0x23'),this[_0x0484('0x21')][_0x0484('0x22')](this));ami['on'](_0x0484('0x24'),this['syncCustomEvent'][_0x0484('0x22')](this));ami['on'](_0x0484('0x25'),this['syncCustomEvent'][_0x0484('0x22')](this));ami['on'](_0x0484('0x26'),this[_0x0484('0x27')]['bind'](this));ami['on'](_0x0484('0x28'),this['syncAgentDial'][_0x0484('0x22')](this));ami['on'](_0x0484('0x29'),this[_0x0484('0x27')][_0x0484('0x22')](this));ami['on'](_0x0484('0x2a'),this[_0x0484('0x21')]['bind'](this));ami['on'](_0x0484('0x2b'),this['syncCustomEvent'][_0x0484('0x22')](this));ami['on'](_0x0484('0x2c'),this[_0x0484('0x21')]['bind'](this));ami['on'](_0x0484('0x2d'),this[_0x0484('0x21')][_0x0484('0x22')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0x0484('0x22')](this));ami['on'](_0x0484('0x2e'),this[_0x0484('0x21')][_0x0484('0x22')](this));}Trigger[_0x0484('0x2f')][_0x0484('0x30')]=function(_0x3da7d3,_0x1a48fc,_0x37e044){logger[_0x0484('0x31')](_0x3da7d3,_0x1a48fc,JSON['stringify'](_0x37e044));io['to'](_0x3da7d3)[_0x0484('0x30')](_0x1a48fc,_0x37e044);};Trigger[_0x0484('0x2f')][_0x0484('0x21')]=function(_0x55acaa){var _0x5d5e28=_[_0x0484('0x32')](_0x55acaa);this[_0x0484('0x33')](_0x5d5e28);};Trigger['prototype'][_0x0484('0x27')]=function(_0x47a76a){if(this['agents'][_0x47a76a[_0x0484('0x34')]]){this[_0x0484('0x21')](_0x47a76a);}};Trigger['prototype'][_0x0484('0x33')]=function(_0x57697a){var _0x5d1236;for(var _0x102655 in this[_0x0484('0x10')]){if(this['triggers'][_0x0484('0x35')](_0x102655)){if(this['triggers'][_0x102655][_0x0484('0x36')]){_0x5d1236=this['checkTrigger'](this[_0x0484('0x10')][_0x102655],_0x57697a);if(_0x5d1236){_['merge'](_0x57697a,_0x57697a[_0x0484('0x37')]);for(var _0xfc7abc=0x0,_0x4eb639,_0x10cfb4,_0x27147c;_0xfc7abc0x0){_0x18b572=_[_0xe02c('0x2a')](_0x148e2b,_0x481e02);}return _0x18b572;}function getCustomFields(_0x287f7e,_0x1e7eab){var _0x35a309=[];var _0x22a285={'custom_fields':{}};if(_0x287f7e[_0xe02c('0x29')]>0x0){_[_0xe02c('0x2b')](_0x287f7e,function(_0x288004){if(_0x288004[_0xe02c('0x2c')]==='string'&&_0x288004[_0xe02c('0x2d')]&&!_0x288004[_0xe02c('0x2e')]){_0x22a285[_0x288004[_0xe02c('0x2d')][_0xe02c('0x2f')]()]=_0x288004[_0xe02c('0x30')][_0xe02c('0x31')]();}else if(_0x288004['type']===_0xe02c('0x32')&&_0x288004[_0xe02c('0x33')]&&_0x288004['customField']){_0x22a285[_0xe02c('0x34')][_0x288004[_0xe02c('0x33')]]=_0x288004[_0xe02c('0x30')][_0xe02c('0x31')]();}else if(_0x288004[_0xe02c('0x2c')]==='variable'&&_0x288004['variableName']&&_0x288004[_0xe02c('0x33')]&&_0x288004[_0xe02c('0x2e')]){_0x1e7eab[_0x288004['variableName']]&&(_0x22a285[_0xe02c('0x34')][_0x288004['idField']]=_0x1e7eab[_0x288004[_0xe02c('0x35')]][_0xe02c('0x31')]());}else if(_0x288004[_0xe02c('0x2c')]===_0xe02c('0x36')&&_0x288004[_0xe02c('0x37')]&&_0x288004['Variable'][_0xe02c('0x38')]&&_0x288004['idField']&&_0x288004[_0xe02c('0x2e')]){_0x1e7eab[_0x288004[_0xe02c('0x37')][_0xe02c('0x38')][_0xe02c('0x2f')]()]&&(_0x22a285[_0xe02c('0x34')][_0x288004[_0xe02c('0x33')]]=_0x1e7eab[_0x288004['Variable'][_0xe02c('0x38')][_0xe02c('0x2f')]()]['toString']());}});}if(_0x22a285[_0xe02c('0x39')]){_0x22a285[_0xe02c('0x39')]=Number(_0x22a285['priority']);}return _0x22a285;}function getTicket(_0x396a06,_0x4e4df6,_0x2bf07b,_0x12b3e5,_0x5b05e1){logger[_0xe02c('0xe')](_0xe02c('0x3a'));var _0x2502c8=_[_0xe02c('0x3b')]({'subject':intUtil[_0xe02c('0x3c')](_0x12b3e5[_0xe02c('0x3d')],_0x5b05e1,'\x20'),'type':'phone','status':_0xe02c('0x3e'),'labels':['xCALLY','Motion',_0xe02c('0x3f')][_0xe02c('0x40')](getTags(_0x12b3e5[_0xe02c('0x41')],_0xe02c('0x38'))),'description':intUtil['getString'](_0x12b3e5[_0xe02c('0x42')],_0x5b05e1,'\x0a'),'_links':{'assigned_user':{'href':util[_0xe02c('0x10')](_0xe02c('0x43'),_0x4e4df6['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x12b3e5[_0xe02c('0x42')],_0x5b05e1,'\x0a')}},getCustomFields(_0x12b3e5[_0xe02c('0x44')],_0x5b05e1));return request({'uri':util[_0xe02c('0x10')](_0xe02c('0x45'),_0x396a06[_0xe02c('0x12')],_0x2bf07b['id']),'method':_0xe02c('0x27'),'body':_0x2502c8});}exports[_0xe02c('0x46')]=function(_0x27ac9e,_0x21d66e,_0x53d123,_0xc7e935,_0x5ef4a1,_0x4d4be5){var _0x17d4af,_0x320f34;_0x4d4be5[_0xe02c('0x12')]=intUtil[_0xe02c('0x47')](_0x4d4be5[_0xe02c('0x12')]);_0x4d4be5[_0xe02c('0x48')]=intUtil[_0xe02c('0x47')](_0x4d4be5[_0xe02c('0x48')]);if(_0x5ef4a1&&_0x5ef4a1['monitor_format']){logger['info'](_0xe02c('0x49'),_0xe02c('0x4a'));_0x21d66e[_0xe02c('0x4b')]=util['format'](_0xe02c('0x4c'),_0x4d4be5[_0xe02c('0x48')],_0x21d66e[_0xe02c('0x4d')],md5(_0x21d66e[_0xe02c('0x4d')]));}else{_0x21d66e[_0xe02c('0x4b')]='';}headers[_0xe02c('0x4e')]=getAuth(_0x4d4be5);return getUser(_0x4d4be5,_0xc7e935[_0xe02c('0x4f')])[_0xe02c('0x13')](function(_0x41d5d1){_0x17d4af=_0x41d5d1;logger[_0xe02c('0xe')]('The\x20User\x20ID\x20is:',_0x17d4af['id']);return getEndUser(_0x4d4be5,_0x21d66e[_0xe02c('0x50')],_0x21d66e[_0xe02c('0x51')]);})[_0xe02c('0x13')](function(_0x1a39ea){_0x320f34=_0x1a39ea;logger[_0xe02c('0xe')](_0xe02c('0x52'),_0x320f34['id']);return getTicket(_0x4d4be5,_0x17d4af,_0x320f34,_0x53d123,_0x21d66e);})[_0xe02c('0x13')](function(_0x3502a5){if(_0x3502a5){logger[_0xe02c('0xe')](_0xe02c('0x53'));logger[_0xe02c('0xe')](_0xe02c('0x54'),_0x3502a5['id']);switch(_0x4d4be5[_0xe02c('0x2c')]){case'integrationTab':logger[_0xe02c('0xe')]('[QUEUE]',_0xe02c('0x55'));emit(util[_0xe02c('0x10')](_0xe02c('0x56'),_0xc7e935[_0xe02c('0x38')]),_0xe02c('0x57'),{'recordId':_0x3502a5['id']});break;case _0xe02c('0x58'):logger[_0xe02c('0xe')](_0xe02c('0x49'),_0xe02c('0x59'));emit(util[_0xe02c('0x10')]('user:%s',_0xc7e935[_0xe02c('0x38')]),_0xe02c('0x5a'),{'uri':util[_0xe02c('0x10')]('https://xcally.desk.com/web/agent/case/%d',_0x3502a5['id'])});break;default:logger[_0xe02c('0x5b')]('[QUEUE]',_0xe02c('0x5c'));}}})['catch'](function(_0x5b41e4){console['error'](_0x5b41e4);logger['error']('[QUEUE]',JSON['stringify'](_0x5b41e4));});};exports[_0xe02c('0x5d')]=function(_0x3ac0a5,_0x1510aa,_0x35fbe2,_0x5d963d,_0x274beb,_0x133f3a,_0x4d2bff){var _0x37ef7d,_0x3ce6fd;_0x133f3a[_0xe02c('0x12')]=intUtil['stripTrailingSlash'](_0x133f3a['remoteUri']);_0x133f3a[_0xe02c('0x48')]=intUtil[_0xe02c('0x47')](_0x133f3a[_0xe02c('0x48')]);if(_0x4d2bff&&_0x4d2bff['recordingFormat']&&_0x4d2bff[_0xe02c('0x5e')]!=='none'){logger['info'](_0xe02c('0x5f'),_0xe02c('0x4a'));_0x1510aa['recordingURL']=util[_0xe02c('0x10')](_0xe02c('0x4c'),_0x133f3a[_0xe02c('0x48')],_0x1510aa['uniqueid'],md5(_0x1510aa[_0xe02c('0x4d')]));}headers[_0xe02c('0x4e')]=getAuth(_0x133f3a);return getUser(_0x133f3a,_0x5d963d['email'])[_0xe02c('0x13')](function(_0x31ba51){_0x37ef7d=_0x31ba51;logger[_0xe02c('0xe')](_0xe02c('0x60'),_0x37ef7d['id']);return getEndUser(_0x133f3a,_0x1510aa[_0xe02c('0x61')],_0x1510aa[_0xe02c('0x62')]);})[_0xe02c('0x13')](function(_0x4303e2){_0x3ce6fd=_0x4303e2;logger[_0xe02c('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3ce6fd['id']);return getTicket(_0x133f3a,_0x37ef7d,_0x3ce6fd,_0x35fbe2,_0x1510aa);})['then'](function(_0x47f61c){if(_0x47f61c){logger[_0xe02c('0xe')](_0xe02c('0x53'));logger[_0xe02c('0xe')]('The\x20Ticket\x20ID\x20is:',_0x47f61c['id']);switch(_0x133f3a['type']){case _0xe02c('0x63'):logger[_0xe02c('0xe')](_0xe02c('0x49'),_0xe02c('0x55'));emit(util[_0xe02c('0x10')]('user:%s',_0x5d963d[_0xe02c('0x38')]),_0xe02c('0x57'),{'recordId':_0x47f61c['id']});break;case'newTab':logger['info'](_0xe02c('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x5d963d[_0xe02c('0x38')]),_0xe02c('0x5a'),{'uri':util[_0xe02c('0x10')](_0xe02c('0x64'),_0x133f3a[_0xe02c('0x12')],_0x47f61c['id'])});break;default:logger[_0xe02c('0x5b')]('[OUTBOUND]',_0xe02c('0x5c'));}}})['catch'](function(_0x4f3c9a){logger[_0xe02c('0x5b')](_0xe02c('0x5f'),JSON[_0xe02c('0x1a')](_0x4f3c9a));});};exports[_0xe02c('0x65')]=function(_0x5b6979,_0x12d638,_0x31c287,_0x5d2119,_0xa7133f,_0x44bfd0){var _0x4cc74d,_0xc3c539;_0x44bfd0[_0xe02c('0x12')]=intUtil[_0xe02c('0x47')](_0x44bfd0[_0xe02c('0x12')]);_0x44bfd0[_0xe02c('0x48')]=intUtil[_0xe02c('0x47')](_0x44bfd0[_0xe02c('0x48')]);if(_0xa7133f&&_0xa7133f['monitor_format']){logger[_0xe02c('0xe')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x12d638['recordingURL']=util[_0xe02c('0x10')](_0xe02c('0x4c'),_0x44bfd0[_0xe02c('0x48')],_0x12d638[_0xe02c('0x4d')],md5(_0x12d638['uniqueid']));}else{_0x12d638[_0xe02c('0x4b')]='';}headers[_0xe02c('0x4e')]=getAuth(_0x44bfd0);return getUser(_0x44bfd0)['then'](function(_0x597a64){_0x4cc74d=_0x597a64;logger['info'](_0xe02c('0x60'),_0x4cc74d['id']);return getEndUser(_0x44bfd0,_0x12d638[_0xe02c('0x50')],_0x12d638['calleridnum']);})['then'](function(_0x38789c){_0xc3c539=_0x38789c;logger[_0xe02c('0xe')](_0xe02c('0x52'),_0xc3c539['id']);return getTicket(_0x44bfd0,_0x4cc74d,_0xc3c539,_0x31c287,_0x12d638);})[_0xe02c('0x13')](function(_0x96a289){if(_0x96a289){logger['info'](_0xe02c('0x53'));logger[_0xe02c('0xe')](_0xe02c('0x54'),_0x96a289['id']);}})[_0xe02c('0x66')](function(_0x11c506){logger[_0xe02c('0x5b')]('[ABANDONED]',JSON[_0xe02c('0x1a')](_0x11c506));});}; \ No newline at end of file +var _0x2032=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','error','abandoned','Recording\x20is\x20enabled!','[ABANDONED]','request-promise','md5','util','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','emit','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','find','Agent\x20found!','format','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','basic','%s:%s','username','password','authType','token','Basic\x20%s','base64','%s/customers/search','Enduser\x20found!','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','work','length','map','forEach','type','string','nameField','customField','toLowerCase','content','custom_fields','idField','toString','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','phone','new','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','%s/customers/%d/cases','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','user:%s','trigger:desk:display','newTab'];(function(_0x154928,_0x50b95e){var _0x50f0af=function(_0x556d5d){while(--_0x556d5d){_0x154928['push'](_0x154928['shift']());}};_0x50f0af(++_0x50b95e);}(_0x2032,0xd9));var _0x2203=function(_0x5e24ce,_0x107b78){_0x5e24ce=_0x5e24ce-0x0;var _0x5c0a63=_0x2032[_0x5e24ce];return _0x5c0a63;};'use strict';var _=require('lodash');var rp=require(_0x2203('0x0'));var md5=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var Redis=require('ioredis');var intUtil=require(_0x2203('0x3'));var config=require(_0x2203('0x4'));var logger=require('../../../../config/logger')(_0x2203('0x5'));config[_0x2203('0x6')]=_[_0x2203('0x7')](config[_0x2203('0x6')],{'host':_0x2203('0x8'),'port':0x18eb});var io=require(_0x2203('0x9'))(new Redis(config[_0x2203('0x6')]));function emit(_0x2676aa,_0x18c4d6,_0x2049ff){io['to'](_0x2676aa)[_0x2203('0xa')](_0x18c4d6,_0x2049ff);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x10f055,_0x549908){if(intUtil[_0x2203('0xb')](_0x549908)===!![]){logger[_0x2203('0xc')](_0x2203('0xd'),_0x549908);return request({'uri':util['format'](_0x2203('0xe'),_0x10f055['remoteUri'])})[_0x2203('0xf')](function(_0x4b73be){if(_0x4b73be[_0x2203('0x10')]){return _[_0x2203('0x11')](_0x4b73be['_embedded']['entries'],{'email':_0x549908});}})['then'](function(_0x5f56ff){if(_0x5f56ff){logger['info'](_0x2203('0x12'));return _0x5f56ff;}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2203('0x13')](_0x2203('0x14'),_0x10f055[_0x2203('0x15')])});}});}else{logger[_0x2203('0xc')](_0x2203('0x16'));return request({'uri':util[_0x2203('0x13')](_0x2203('0x14'),_0x10f055[_0x2203('0x15')])});}}function request(_0xdf9d0b){logger[_0x2203('0x17')]('[HTTP]',JSON[_0x2203('0x18')](_0xdf9d0b));return rp(_[_0x2203('0x7')](_0xdf9d0b,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x3f9ef6){var _0x8906e1;if(_0x3f9ef6['authType']===_0x2203('0x19')){_0x8906e1=util['format'](_0x2203('0x1a'),_0x3f9ef6[_0x2203('0x1b')],_0x3f9ef6[_0x2203('0x1c')]);}else if(_0x3f9ef6[_0x2203('0x1d')]===_0x2203('0x1e')){_0x8906e1=util[_0x2203('0x13')]('%s/token:%s',_0x3f9ef6[_0x2203('0x1b')],_0x3f9ef6['token']);}return util['format'](_0x2203('0x1f'),new Buffer(_0x8906e1)['toString'](_0x2203('0x20')));}function getEndUser(_0x5bfe61,_0x5d4c4e,_0x3ee25b){logger['info']('Searching\x20enduser\x20with\x20phone',_0x3ee25b);return request({'uri':util[_0x2203('0x13')](_0x2203('0x21'),_0x5bfe61[_0x2203('0x15')]),'qs':{'phone':_0x3ee25b}})[_0x2203('0xf')](function(_0x1244f4){if(_0x1244f4[_0x2203('0x10')]){logger[_0x2203('0xc')](_0x2203('0x22'));return _0x1244f4['_embedded'][_0x2203('0x23')][0x0];}else{logger[_0x2203('0xc')](_0x2203('0x24'));return request({'uri':util['format'](_0x2203('0x25'),_0x5bfe61[_0x2203('0x15')]),'method':'POST','body':{'first_name':_0x5d4c4e,'title':_0x5d4c4e,'phone_numbers':[{'type':_0x2203('0x26'),'value':_0x3ee25b}]}});}});}function getTags(_0xd91f5d,_0x1c6a77){var _0x46b8b9=[];if(_0xd91f5d&&_0xd91f5d[_0x2203('0x27')]>0x0){_0x46b8b9=_[_0x2203('0x28')](_0xd91f5d,_0x1c6a77);}return _0x46b8b9;}function getCustomFields(_0x9c53f,_0x5a95c1){var _0x34b8ba=[];var _0x616ed8={'custom_fields':{}};if(_0x9c53f[_0x2203('0x27')]>0x0){_[_0x2203('0x29')](_0x9c53f,function(_0x52a426){if(_0x52a426[_0x2203('0x2a')]===_0x2203('0x2b')&&_0x52a426[_0x2203('0x2c')]&&!_0x52a426[_0x2203('0x2d')]){_0x616ed8[_0x52a426['nameField'][_0x2203('0x2e')]()]=_0x52a426[_0x2203('0x2f')]['toString']();}else if(_0x52a426['type']===_0x2203('0x2b')&&_0x52a426['idField']&&_0x52a426['customField']){_0x616ed8[_0x2203('0x30')][_0x52a426[_0x2203('0x31')]]=_0x52a426[_0x2203('0x2f')][_0x2203('0x32')]();}else if(_0x52a426[_0x2203('0x2a')]==='variable'&&_0x52a426[_0x2203('0x33')]&&_0x52a426[_0x2203('0x31')]&&_0x52a426['customField']){_0x5a95c1[_0x52a426[_0x2203('0x33')]]&&(_0x616ed8[_0x2203('0x30')][_0x52a426[_0x2203('0x31')]]=_0x5a95c1[_0x52a426[_0x2203('0x33')]][_0x2203('0x32')]());}else if(_0x52a426[_0x2203('0x2a')]===_0x2203('0x34')&&_0x52a426[_0x2203('0x35')]&&_0x52a426[_0x2203('0x35')]['name']&&_0x52a426[_0x2203('0x31')]&&_0x52a426[_0x2203('0x2d')]){_0x5a95c1[_0x52a426['Variable']['name'][_0x2203('0x2e')]()]&&(_0x616ed8['custom_fields'][_0x52a426[_0x2203('0x31')]]=_0x5a95c1[_0x52a426[_0x2203('0x35')][_0x2203('0x36')]['toLowerCase']()]['toString']());}});}if(_0x616ed8[_0x2203('0x37')]){_0x616ed8['priority']=Number(_0x616ed8[_0x2203('0x37')]);}return _0x616ed8;}function getTicket(_0x5cfe5e,_0x11451e,_0x4b6fc5,_0x86097c,_0x13ed9e){logger[_0x2203('0xc')](_0x2203('0x38'));var _0x1e3ce7=_['merge']({'subject':intUtil['getString'](_0x86097c['Subjects'],_0x13ed9e,'\x20'),'type':_0x2203('0x39'),'status':_0x2203('0x3a'),'labels':[_0x2203('0x3b'),_0x2203('0x3c'),_0x2203('0x3d')][_0x2203('0x3e')](getTags(_0x86097c[_0x2203('0x3f')],'name')),'description':intUtil[_0x2203('0x40')](_0x86097c[_0x2203('0x41')],_0x13ed9e,'\x0a'),'_links':{'assigned_user':{'href':util[_0x2203('0x13')](_0x2203('0x42'),_0x11451e['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x86097c[_0x2203('0x41')],_0x13ed9e,'\x0a')}},getCustomFields(_0x86097c['Fields'],_0x13ed9e));return request({'uri':util[_0x2203('0x13')](_0x2203('0x43'),_0x5cfe5e[_0x2203('0x15')],_0x4b6fc5['id']),'method':'POST','body':_0x1e3ce7});}exports['queue']=function(_0x1e7ebc,_0x3739f6,_0x368444,_0x1e09f3,_0x372709,_0x1fa734){var _0x5cd573,_0x15d3b6;_0x1fa734[_0x2203('0x15')]=intUtil[_0x2203('0x44')](_0x1fa734[_0x2203('0x15')]);_0x1fa734[_0x2203('0x45')]=intUtil[_0x2203('0x44')](_0x1fa734[_0x2203('0x45')]);if(_0x372709&&_0x372709[_0x2203('0x46')]){logger[_0x2203('0xc')](_0x2203('0x47'),'Recording\x20is\x20enabled!');_0x3739f6[_0x2203('0x48')]=util[_0x2203('0x13')](_0x2203('0x49'),_0x1fa734[_0x2203('0x45')],_0x3739f6['uniqueid'],md5(_0x3739f6['uniqueid']));}else{_0x3739f6[_0x2203('0x48')]='';}headers['Authorization']=getAuth(_0x1fa734);return getUser(_0x1fa734,_0x1e09f3[_0x2203('0x4a')])[_0x2203('0xf')](function(_0xc2944f){_0x5cd573=_0xc2944f;logger[_0x2203('0xc')]('The\x20User\x20ID\x20is:',_0x5cd573['id']);return getEndUser(_0x1fa734,_0x3739f6[_0x2203('0x4b')],_0x3739f6[_0x2203('0x4c')]);})['then'](function(_0x29bd91){_0x15d3b6=_0x29bd91;logger[_0x2203('0xc')](_0x2203('0x4d'),_0x15d3b6['id']);return getTicket(_0x1fa734,_0x5cd573,_0x15d3b6,_0x368444,_0x3739f6);})[_0x2203('0xf')](function(_0x5a71a5){if(_0x5a71a5){logger['info'](_0x2203('0x4e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5a71a5['id']);switch(_0x1fa734[_0x2203('0x2a')]){case _0x2203('0x4f'):logger[_0x2203('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x2203('0x13')](_0x2203('0x50'),_0x1e09f3[_0x2203('0x36')]),_0x2203('0x51'),{'recordId':_0x5a71a5['id']});break;case _0x2203('0x52'):logger[_0x2203('0xc')]('[QUEUE]',_0x2203('0x53'));emit(util['format'](_0x2203('0x50'),_0x1e09f3[_0x2203('0x36')]),_0x2203('0x54'),{'uri':util[_0x2203('0x13')]('https://xcally.desk.com/web/agent/case/%d',_0x5a71a5['id'])});break;default:logger['error'](_0x2203('0x47'),_0x2203('0x55'));}}})[_0x2203('0x56')](function(_0x1a1c00){console['error'](_0x1a1c00);logger['error']('[QUEUE]',JSON[_0x2203('0x18')](_0x1a1c00));});};exports[_0x2203('0x57')]=function(_0x57b891,_0x7f61df,_0x267627,_0x538d17,_0x32b1db,_0xb47204,_0x172c6a){var _0x6a1877,_0x4bb6f1;_0xb47204[_0x2203('0x15')]=intUtil['stripTrailingSlash'](_0xb47204[_0x2203('0x15')]);_0xb47204[_0x2203('0x45')]=intUtil['stripTrailingSlash'](_0xb47204[_0x2203('0x45')]);if(_0x172c6a&&_0x172c6a[_0x2203('0x58')]&&_0x172c6a[_0x2203('0x58')]!==_0x2203('0x59')){logger[_0x2203('0xc')](_0x2203('0x5a'),'Recording\x20is\x20enabled!');_0x7f61df['recordingURL']=util[_0x2203('0x13')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb47204['serverUrl'],_0x7f61df[_0x2203('0x5b')],md5(_0x7f61df[_0x2203('0x5b')]));}headers[_0x2203('0x5c')]=getAuth(_0xb47204);return getUser(_0xb47204,_0x538d17['email'])[_0x2203('0xf')](function(_0x4b2788){_0x6a1877=_0x4b2788;logger['info'](_0x2203('0x5d'),_0x6a1877['id']);return getEndUser(_0xb47204,_0x7f61df['destcalleridname'],_0x7f61df['destcalleridnum']);})['then'](function(_0x13526f){_0x4bb6f1=_0x13526f;logger[_0x2203('0xc')](_0x2203('0x4d'),_0x4bb6f1['id']);return getTicket(_0xb47204,_0x6a1877,_0x4bb6f1,_0x267627,_0x7f61df);})[_0x2203('0xf')](function(_0x26d3d9){if(_0x26d3d9){logger[_0x2203('0xc')](_0x2203('0x4e'));logger[_0x2203('0xc')](_0x2203('0x5e'),_0x26d3d9['id']);switch(_0xb47204[_0x2203('0x2a')]){case _0x2203('0x4f'):logger[_0x2203('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x2203('0x13')](_0x2203('0x50'),_0x538d17[_0x2203('0x36')]),_0x2203('0x51'),{'recordId':_0x26d3d9['id']});break;case _0x2203('0x52'):logger[_0x2203('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2203('0x13')](_0x2203('0x50'),_0x538d17[_0x2203('0x36')]),_0x2203('0x54'),{'uri':util[_0x2203('0x13')](_0x2203('0x5f'),_0xb47204[_0x2203('0x15')],_0x26d3d9['id'])});break;default:logger[_0x2203('0x60')](_0x2203('0x5a'),_0x2203('0x55'));}}})[_0x2203('0x56')](function(_0x48bed1){logger[_0x2203('0x60')](_0x2203('0x5a'),JSON[_0x2203('0x18')](_0x48bed1));});};exports[_0x2203('0x61')]=function(_0x41a938,_0x44e7ab,_0x52c159,_0x544756,_0x286121,_0x35b7b9){var _0x49e795,_0x6ea7e8;_0x35b7b9[_0x2203('0x15')]=intUtil[_0x2203('0x44')](_0x35b7b9[_0x2203('0x15')]);_0x35b7b9[_0x2203('0x45')]=intUtil[_0x2203('0x44')](_0x35b7b9[_0x2203('0x45')]);if(_0x286121&&_0x286121[_0x2203('0x46')]){logger[_0x2203('0xc')]('[ABANDONED]',_0x2203('0x62'));_0x44e7ab[_0x2203('0x48')]=util[_0x2203('0x13')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35b7b9[_0x2203('0x45')],_0x44e7ab[_0x2203('0x5b')],md5(_0x44e7ab[_0x2203('0x5b')]));}else{_0x44e7ab[_0x2203('0x48')]='';}headers[_0x2203('0x5c')]=getAuth(_0x35b7b9);return getUser(_0x35b7b9)['then'](function(_0x38b077){_0x49e795=_0x38b077;logger[_0x2203('0xc')](_0x2203('0x5d'),_0x49e795['id']);return getEndUser(_0x35b7b9,_0x44e7ab['calleridname'],_0x44e7ab['calleridnum']);})['then'](function(_0x485e5b){_0x6ea7e8=_0x485e5b;logger['info'](_0x2203('0x4d'),_0x6ea7e8['id']);return getTicket(_0x35b7b9,_0x49e795,_0x6ea7e8,_0x52c159,_0x44e7ab);})[_0x2203('0xf')](function(_0x27dd95){if(_0x27dd95){logger[_0x2203('0xc')](_0x2203('0x4e'));logger[_0x2203('0xc')](_0x2203('0x5e'),_0x27dd95['id']);}})[_0x2203('0x56')](function(_0x56dcbe){logger['error'](_0x2203('0x63'),JSON[_0x2203('0x18')](_0x56dcbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 496e91a..2e1cee3 100644 --- a/server/services/ami/trigger/integration/dynamics365.js +++ b/server/services/ami/trigger/integration/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa87=['userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','destcalleridnum','calleridnum','contacts','headers','odata-entityid','substring','lastIndexOf','GET','length','outbound','enduserId','forEach','string','nameField','idField','indexOf','content','ticketType','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecalls','queue','callDirection','ticketId','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','tenantId','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','abandoned','inspect','lodash','bluebird','util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','isdisabled','info',']\x20Agent\x20found\x20'];(function(_0x2c0a79,_0x27f913){var _0x45a813=function(_0x27c124){while(--_0x27c124){_0x2c0a79['push'](_0x2c0a79['shift']());}};_0x45a813(++_0x27f913);}(_0xfa87,0x19f));var _0x7fa8=function(_0x34651f,_0x1b07dd){_0x34651f=_0x34651f-0x0;var _0x2d88fe=_0xfa87[_0x34651f];return _0x2d88fe;};'use strict';var _=require(_0x7fa8('0x0'));var BPromise=require(_0x7fa8('0x1'));var rp=require('request-promise');var util=require(_0x7fa8('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x7fa8('0x3'));var logger=require(_0x7fa8('0x4'))(_0x7fa8('0x5'));var config=require(_0x7fa8('0x6'));config[_0x7fa8('0x7')]=_[_0x7fa8('0x8')](config[_0x7fa8('0x7')],{'host':_0x7fa8('0x9'),'port':0x18eb});var io=require(_0x7fa8('0xa'))(new Redis(config[_0x7fa8('0x7')]));function getAuthToken(_0x3274f4,_0x2b6621,_0x148a1e){var _0x40c764={'method':_0x7fa8('0xb'),'uri':_0x2b6621,'form':{'client_id':_0x3274f4[_0x7fa8('0xc')],'resource':_0x3274f4[_0x7fa8('0xd')],'username':_0x3274f4[_0x7fa8('0xe')],'password':_0x3274f4[_0x7fa8('0xf')],'grant_type':'password','client_secret':_0x3274f4[_0x7fa8('0x10')]},'json':!![]};return rp(_0x40c764)[_0x7fa8('0x11')](function(_0x4ff4c2){return _0x4ff4c2[_0x7fa8('0x12')];})[_0x7fa8('0x13')](function(_0x19383f){logger[_0x7fa8('0x14')]('['+[_0x148a1e[_0x7fa8('0x15')]()]+_0x7fa8('0x16'));return _0x19383f[_0x7fa8('0x17')];});}function getUser(_0x4e3216,_0x18316d,_0x3009fe,_0x38c9bb,_0x24552e,_0x87a822){return new BPromise(function(_0x4d3e90,_0x3bbec5){return getAuthToken(_0x18316d,_0x38c9bb,_0x87a822)['then'](function(_0x3db15c){var _0x27119e={'method':'GET','uri':_0x24552e+_0x7fa8('0x18'),'headers':{'Authorization':_0x7fa8('0x19')+_0x3db15c,'OData-Version':_0x7fa8('0x1a')},'json':!![]};return rp(_0x27119e);})[_0x7fa8('0x11')](function(_0xdcd8a5){var _0x14e059=_0xdcd8a5[_0x7fa8('0x1b')];var _0x8240ee=![];var _0x2264ef=null;if(!_[_0x7fa8('0x1c')](_0x3009fe)){if(intUtil[_0x7fa8('0x1d')](_0x3009fe[_0x7fa8('0x1e')])){_0x4e3216[_0x7fa8('0x1f')]=_0x3009fe['email'];for(_0x2264ef=0x0;_0x2264ef<_0x14e059['length'];_0x2264ef++){if(_0x14e059[_0x2264ef]['internalemailaddress']===_0x3009fe[_0x7fa8('0x1e')]&&!_0x14e059[_0x2264ef][_0x7fa8('0x20')]){_0x8240ee=!![];logger[_0x7fa8('0x21')]('['+[_0x87a822['toUpperCase']()]+_0x7fa8('0x22')+_0x14e059[_0x2264ef]['systemuserid']+'!');_0x4e3216[_0x7fa8('0x23')]=_0x14e059[_0x2264ef][_0x7fa8('0x24')];}}}}if(!_0x8240ee){logger['info']('['+[_0x87a822[_0x7fa8('0x15')]()]+_0x7fa8('0x25'));_0x4e3216[_0x7fa8('0x1f')]=_0x18316d[_0x7fa8('0xe')];for(_0x2264ef=0x0;_0x2264ef<_0x14e059['length'];_0x2264ef++){if(_0x14e059[_0x2264ef][_0x7fa8('0x26')]===_0x18316d[_0x7fa8('0xe')]){_0x4e3216[_0x7fa8('0x23')]=_0x14e059[_0x2264ef][_0x7fa8('0x24')];}}}_0x4d3e90(_0x4e3216);})['catch'](function(_0x4ded6e){_0x3bbec5(_0x4ded6e[_0x7fa8('0x17')]);});});}function createEndUser(_0xe71d4e,_0x151489,_0x4441bb,_0x1b7bef,_0x3d8360,_0x2b7c4f){return new BPromise(function(_0x2f9a59,_0x48f035){return getAuthToken(_0x151489,_0x4441bb,_0x2b7c4f)[_0x7fa8('0x11')](function(_0xca15bf){var _0x38e4c3=_0x2b7c4f[_0x7fa8('0x27')]()==='outbound'?_0x3d8360[_0x7fa8('0x28')]:_0x3d8360[_0x7fa8('0x29')];var _0x121ff0={'method':_0x7fa8('0xb'),'uri':_0x1b7bef+_0x7fa8('0x2a'),'body':{'telephone1':_0x38e4c3,'fullname':_0x38e4c3,'firstname':_0x38e4c3,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0xe71d4e[_0x7fa8('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0xca15bf,'OData-Version':_0x7fa8('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x121ff0);})[_0x7fa8('0x11')](function(_0x2558de){var _0x4c4b01=_0x2558de[_0x7fa8('0x2b')][_0x7fa8('0x2c')];var _0x50fc80=_0x4c4b01[_0x7fa8('0x2d')](_0x4c4b01[_0x7fa8('0x2e')]('(')+0x1,_0x4c4b01[_0x7fa8('0x2e')](')'));_0xe71d4e['enduserId']=_0x50fc80;_0x2f9a59(_0xe71d4e);})['catch'](function(_0x398dbc){_0x48f035(_0x398dbc[_0x7fa8('0x17')]);});});}function getEndUser(_0x8f198f,_0x216829,_0x13cd52,_0x3649f9,_0x1e065f,_0xa370f6){return new BPromise(function(_0x444684,_0x47b25b){return getAuthToken(_0x216829,_0x13cd52,_0xa370f6)[_0x7fa8('0x11')](function(_0x5d4852){var _0x57bb6d={'method':_0x7fa8('0x2f'),'uri':_0x3649f9+'contacts?$select=telephone1','headers':{'Authorization':'Bearer\x20'+_0x5d4852,'If-None-Match':null,'OData-Version':_0x7fa8('0x1a')},'json':!![]};return rp(_0x57bb6d);})[_0x7fa8('0x11')](function(_0x1ae71c){var _0x210e02=null;if(_0x1ae71c){var _0x2cbcf2=_0x1ae71c[_0x7fa8('0x1b')];var _0x17ea52=![];for(_0x210e02=0x0;_0x210e02<_0x2cbcf2[_0x7fa8('0x30')];_0x210e02++){var _0x4990f8=_0xa370f6[_0x7fa8('0x27')]()===_0x7fa8('0x31')?_0x1e065f[_0x7fa8('0x28')]:_0x1e065f[_0x7fa8('0x29')];if(_0x2cbcf2[_0x210e02]['telephone1']===_0x4990f8){_0x17ea52=!![];_0x8f198f['enduserId']=_0x2cbcf2[_0x210e02]['contactid'];}}if(_0x17ea52){_0x444684(_0x8f198f);}else{return createEndUser(_0x8f198f,_0x216829,_0x13cd52,_0x3649f9,_0x1e065f,_0xa370f6)[_0x7fa8('0x11')](function(_0x223a42){logger[_0x7fa8('0x21')]('['+[_0xa370f6['toUpperCase']()]+']\x20Enduser\x20created!',_0x223a42[_0x7fa8('0x32')]);_0x444684(_0x223a42);});}}else{return createEndUser(_0x8f198f,_0x216829,_0x13cd52,_0x3649f9,_0x1e065f,_0xa370f6)['then'](function(_0x5858fe){logger[_0x7fa8('0x21')]('['+[_0xa370f6[_0x7fa8('0x15')]()]+']\x20Enduser\x20Created!',_0x5858fe[_0x7fa8('0x32')]);_0x444684(_0x5858fe);});}});});}function getCustomFields(_0x4de555,_0x435919,_0x27e2ea){var _0x13fa93={};if(_0x4de555[_0x7fa8('0x30')]>0x0){_[_0x7fa8('0x33')](_0x4de555,function(_0x55ea14){if(_0x55ea14['type']===_0x7fa8('0x34')&&_0x55ea14[_0x7fa8('0x35')]&&!_0x55ea14['customField']){var _0x38027f=_0x55ea14[_0x7fa8('0x36')]['toLowerCase']();var _0x4055e9=_0x38027f[_0x7fa8('0x2d')](0x0,_0x38027f[_0x7fa8('0x37')]('_'));var _0x1d4bdd=_0x38027f[_0x7fa8('0x2d')](_0x38027f[_0x7fa8('0x37')]('_')+0x1);if(_0x4055e9===_0x27e2ea){_0x13fa93[_0x1d4bdd]=_0x55ea14[_0x7fa8('0x38')];}}});}return _0x13fa93;}function getTicket(_0x77181e,_0x15c3a8,_0x3f880a,_0x16d5e2,_0x1104f0,_0x21adc1,_0x2dd599){return new BPromise(function(_0xcd97d,_0x100e24){var _0x273dbf;return getAuthToken(_0x15c3a8,_0x3f880a,_0x2dd599)[_0x7fa8('0x11')](function(_0x585ce5){if(_0x21adc1[_0x7fa8('0x39')]==='incident'){_0x273dbf={'method':'POST','uri':_0x16d5e2+'incidents','body':Object[_0x7fa8('0x3a')]({},{'title':intUtil[_0x7fa8('0x3b')](_0x21adc1[_0x7fa8('0x3c')],_0x1104f0,'\x20'),'description':intUtil[_0x7fa8('0x3b')](_0x21adc1[_0x7fa8('0x3d')],_0x1104f0,'\x0a'),'customerid_contact@odata.bind':_0x7fa8('0x3e')+_0x77181e[_0x7fa8('0x32')]+')','ownerid@odata.bind':_0x7fa8('0x3f')+_0x77181e[_0x7fa8('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x21adc1[_0x7fa8('0x40')],_0x1104f0,_0x21adc1[_0x7fa8('0x39')])),'headers':{'Authorization':_0x7fa8('0x19')+_0x585ce5,'OData-Version':_0x7fa8('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x21adc1[_0x7fa8('0x39')]==='phonecall'){_0x273dbf={'method':'POST','uri':_0x16d5e2+_0x7fa8('0x41'),'body':Object[_0x7fa8('0x3a')]({},{'subject':intUtil[_0x7fa8('0x3b')](_0x21adc1[_0x7fa8('0x3c')],_0x1104f0,'\x20'),'phonenumber':String(_0x1104f0['calleridnum']),'description':intUtil[_0x7fa8('0x3b')](_0x21adc1[_0x7fa8('0x3d')],_0x1104f0,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x77181e[_0x7fa8('0x32')]+')','ownerid@odata.bind':_0x7fa8('0x3f')+_0x77181e[_0x7fa8('0x23')]+')','directioncode':_0x77181e['callDirection']===_0x7fa8('0x42')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x7fa8('0x3f')+_0x77181e[_0x7fa8('0x23')]+')','participationtypemask':_0x77181e[_0x7fa8('0x43')]===_0x7fa8('0x42')?0x2:0x1},{'partyid_contact@odata.bind':_0x7fa8('0x3e')+_0x77181e['enduserId']+')','participationtypemask':_0x77181e['callDirection']===_0x7fa8('0x42')?0x1:0x2}]},getCustomFields(_0x21adc1[_0x7fa8('0x40')],_0x1104f0,_0x21adc1[_0x7fa8('0x39')])),'headers':{'Authorization':_0x7fa8('0x19')+_0x585ce5,'OData-Version':_0x7fa8('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x273dbf);})[_0x7fa8('0x11')](function(_0x15da9b){var _0x5e3958=_0x15da9b['headers'][_0x7fa8('0x2c')];var _0x57c3da=_0x5e3958[_0x7fa8('0x2d')](_0x5e3958[_0x7fa8('0x2e')]('(')+0x1,_0x5e3958[_0x7fa8('0x2e')](')'));_0x77181e[_0x7fa8('0x44')]=_0x57c3da;_0xcd97d(_0x77181e);})['catch'](function(_0x30b150){_0x100e24(_0x30b150[_0x7fa8('0x17')]);});});}function emit(_0x26f72c,_0x1386a1,_0x1605b0,_0x197f8f){var _0x222a51={'uri':util[_0x7fa8('0x45')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x26f72c,_0x1605b0,_0x197f8f)};io['to'](util[_0x7fa8('0x45')](_0x7fa8('0x46'),_0x1386a1))['emit'](_0x7fa8('0x47'),_0x222a51);}exports['cs']=function(_0x5eebe3,_0x457040,_0x5c26f0,_0x5169f5,_0x322d64,_0x244d9d,_0x1d994f,_0x5c4a10){var _0x59b306={};_0x244d9d[_0x7fa8('0xd')]=intUtil[_0x7fa8('0x48')](_0x244d9d['remoteUri']);_0x244d9d[_0x7fa8('0x49')]=intUtil['stripTrailingSlash'](_0x244d9d[_0x7fa8('0x49')]);_0x59b306[_0x7fa8('0x43')]=_0x5c4a10===_0x7fa8('0x42')||_0x5c4a10==='abandoned'?_0x7fa8('0x42'):_0x7fa8('0x31');var _0x388e7f=util[_0x7fa8('0x45')](_0x7fa8('0x4a'),_0x244d9d[_0x7fa8('0xd')]);var _0x1b3fd4=util[_0x7fa8('0x45')]('https://login.microsoftonline.com/%s/oauth2/token',_0x244d9d[_0x7fa8('0x4b')]);var _0x521636=util[_0x7fa8('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x244d9d[_0x7fa8('0x49')],_0x457040[_0x7fa8('0x4c')],md5(_0x457040['uniqueid']));if(_0x322d64&&_0x322d64['monitor_format']){logger[_0x7fa8('0x21')](_0x7fa8('0x4d'),_0x7fa8('0x4e'));_0x457040[_0x7fa8('0x4f')]=_0x521636;}else if(_0x1d994f&&_0x1d994f[_0x7fa8('0x50')]&&_0x1d994f[_0x7fa8('0x50')]!==_0x7fa8('0x51')){logger[_0x7fa8('0x21')]('[OUTBOUND]',_0x7fa8('0x4e'));_0x457040[_0x7fa8('0x4f')]=_0x521636;}else{_0x457040['recordingURL']='';}return getUser(_0x59b306,_0x244d9d,_0x5169f5,_0x1b3fd4,_0x388e7f,_0x5c4a10)[_0x7fa8('0x11')](function(_0x46f60f){logger['info']('['+_0x5c4a10[_0x7fa8('0x15')]()+_0x7fa8('0x52'),_0x46f60f[_0x7fa8('0x23')]);logger[_0x7fa8('0x21')]('['+_0x5c4a10[_0x7fa8('0x15')]()+_0x7fa8('0x53'),_0x46f60f[_0x7fa8('0x1f')]);return getEndUser(_0x46f60f,_0x244d9d,_0x1b3fd4,_0x388e7f,_0x457040,_0x5c4a10);})[_0x7fa8('0x11')](function(_0x4bf907){logger['info']('['+_0x5c4a10['toUpperCase']()+_0x7fa8('0x54'),_0x4bf907[_0x7fa8('0x32')]);logger[_0x7fa8('0x21')]('['+_0x5c4a10['toUpperCase']()+_0x7fa8('0x55'),_0x457040[_0x7fa8('0x29')]);return getTicket(_0x4bf907,_0x244d9d,_0x1b3fd4,_0x388e7f,_0x457040,_0x5c26f0,_0x5c4a10);})[_0x7fa8('0x11')](function(_0x239470){logger[_0x7fa8('0x21')](util[_0x7fa8('0x45')]('['+_0x5c4a10[_0x7fa8('0x15')]()+_0x7fa8('0x56'),_0x5c26f0[_0x7fa8('0x39')],_0x239470[_0x7fa8('0x44')]));logger[_0x7fa8('0x21')](util[_0x7fa8('0x45')]('['+_0x5c4a10['toUpperCase']()+_0x7fa8('0x57'),_0x5c4a10));if(_0x5c4a10!==_0x7fa8('0x58')){logger[_0x7fa8('0x21')]('['+_0x5c4a10[_0x7fa8('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x244d9d[_0x7fa8('0xd')],_0x5169f5['name'],_0x5c26f0[_0x7fa8('0x39')],_0x239470[_0x7fa8('0x44')]);}})[_0x7fa8('0x13')](function(_0x1da49f){logger['error']('['+_0x5c4a10[_0x7fa8('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x7fa8('0x59')](_0x1da49f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x441a=['forEach','nameField','customField','idField','substring','indexOf','content','ticketType','incident','assign','getString','/contacts(','phonecalls','Subjects','Descriptions','callDirection','queue','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','inspect','lodash','./util','md5','../../../../config/logger','dynamics365','defaults','redis','localhost','socket.io-emitter','POST','username','password','clientSecret','then','catch','error','toUpperCase','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','message','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1','length','outbound','contactid',']\x20Enduser\x20created!'];(function(_0x217d3,_0x58ad03){var _0xde79e3=function(_0x418a46){while(--_0x418a46){_0x217d3['push'](_0x217d3['shift']());}};_0xde79e3(++_0x58ad03);}(_0x441a,0x87));var _0xa441=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x441a[_0x2d364e];return _0x1b9312;};'use strict';var _=require(_0xa441('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require('util');var intUtil=require(_0xa441('0x1'));var md5=require(_0xa441('0x2'));var Redis=require('ioredis');var logger=require(_0xa441('0x3'))(_0xa441('0x4'));var config=require('../../../../config/environment');config['redis']=_[_0xa441('0x5')](config[_0xa441('0x6')],{'host':_0xa441('0x7'),'port':0x18eb});var io=require(_0xa441('0x8'))(new Redis(config[_0xa441('0x6')]));function getAuthToken(_0x2c28ed,_0x88d1,_0x194955){var _0x150d43={'method':_0xa441('0x9'),'uri':_0x88d1,'form':{'client_id':_0x2c28ed['clientId'],'resource':_0x2c28ed['remoteUri'],'username':_0x2c28ed[_0xa441('0xa')],'password':_0x2c28ed[_0xa441('0xb')],'grant_type':_0xa441('0xb'),'client_secret':_0x2c28ed[_0xa441('0xc')]},'json':!![]};return rp(_0x150d43)[_0xa441('0xd')](function(_0x5b9a62){return _0x5b9a62['access_token'];})[_0xa441('0xe')](function(_0x120547){logger[_0xa441('0xf')]('['+[_0x194955[_0xa441('0x10')]()]+']\x20Wrong\x20credentials!');return _0x120547['message'];});}function getUser(_0x23af65,_0x243ac4,_0x1d9e7f,_0x433849,_0x2eb7e4,_0x5399b8){return new BPromise(function(_0x553e03,_0x18cc4f){return getAuthToken(_0x243ac4,_0x433849,_0x5399b8)[_0xa441('0xd')](function(_0x5595f1){var _0xf6f53={'method':_0xa441('0x11'),'uri':_0x2eb7e4+_0xa441('0x12'),'headers':{'Authorization':'Bearer\x20'+_0x5595f1,'OData-Version':_0xa441('0x13')},'json':!![]};return rp(_0xf6f53);})[_0xa441('0xd')](function(_0x11da4a){var _0xdf6f95=_0x11da4a[_0xa441('0x14')];var _0x145408=![];var _0x16ea81=null;if(!_[_0xa441('0x15')](_0x1d9e7f)){if(intUtil[_0xa441('0x16')](_0x1d9e7f[_0xa441('0x17')])){_0x23af65[_0xa441('0x18')]=_0x1d9e7f[_0xa441('0x17')];for(_0x16ea81=0x0;_0x16ea81<_0xdf6f95['length'];_0x16ea81++){if(_0xdf6f95[_0x16ea81][_0xa441('0x19')]===_0x1d9e7f[_0xa441('0x17')]&&!_0xdf6f95[_0x16ea81][_0xa441('0x1a')]){_0x145408=!![];logger[_0xa441('0x1b')]('['+[_0x5399b8['toUpperCase']()]+_0xa441('0x1c')+_0xdf6f95[_0x16ea81][_0xa441('0x1d')]+'!');_0x23af65[_0xa441('0x1e')]=_0xdf6f95[_0x16ea81][_0xa441('0x1d')];}}}}if(!_0x145408){logger[_0xa441('0x1b')]('['+[_0x5399b8['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x23af65[_0xa441('0x18')]=_0x243ac4['username'];for(_0x16ea81=0x0;_0x16ea81<_0xdf6f95['length'];_0x16ea81++){if(_0xdf6f95[_0x16ea81][_0xa441('0x19')]===_0x243ac4[_0xa441('0xa')]){_0x23af65['userId']=_0xdf6f95[_0x16ea81][_0xa441('0x1d')];}}}_0x553e03(_0x23af65);})[_0xa441('0xe')](function(_0x5fa6f0){_0x18cc4f(_0x5fa6f0[_0xa441('0x1f')]);});});}function createEndUser(_0x2c48d8,_0x1e693b,_0x237c6f,_0x2c0ff9,_0x21221b,_0x447be2){return new BPromise(function(_0x2aa9a2,_0x7030dc){return getAuthToken(_0x1e693b,_0x237c6f,_0x447be2)[_0xa441('0xd')](function(_0x29f456){var _0x14a5d0=_0x447be2[_0xa441('0x20')]()==='outbound'?_0x21221b[_0xa441('0x21')]:_0x21221b[_0xa441('0x22')];var _0x6fe715={'method':_0xa441('0x9'),'uri':_0x2c0ff9+_0xa441('0x23'),'body':{'telephone1':_0x14a5d0,'fullname':_0x14a5d0,'firstname':_0x14a5d0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa441('0x24')+_0x2c48d8[_0xa441('0x1e')]+')'},'headers':{'Authorization':_0xa441('0x25')+_0x29f456,'OData-Version':_0xa441('0x13')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x6fe715);})[_0xa441('0xd')](function(_0x4e5925){var _0x2901cc=_0x4e5925[_0xa441('0x26')][_0xa441('0x27')];var _0x43a04b=_0x2901cc['substring'](_0x2901cc['lastIndexOf']('(')+0x1,_0x2901cc[_0xa441('0x28')](')'));_0x2c48d8[_0xa441('0x29')]=_0x43a04b;_0x2aa9a2(_0x2c48d8);})[_0xa441('0xe')](function(_0x19419e){_0x7030dc(_0x19419e[_0xa441('0x1f')]);});});}function getEndUser(_0xbcd8af,_0x5846f8,_0x317ca4,_0x494fb6,_0x11402e,_0x3d27e5){return new BPromise(function(_0xeeaed9,_0x3b5a10){return getAuthToken(_0x5846f8,_0x317ca4,_0x3d27e5)['then'](function(_0x349105){var _0x4fe820={'method':'GET','uri':_0x494fb6+_0xa441('0x2a'),'headers':{'Authorization':_0xa441('0x25')+_0x349105,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4fe820);})[_0xa441('0xd')](function(_0x866321){var _0x4a8aa3=null;if(_0x866321){var _0x5ab0f6=_0x866321[_0xa441('0x14')];var _0x26f1bd=![];for(_0x4a8aa3=0x0;_0x4a8aa3<_0x5ab0f6[_0xa441('0x2b')];_0x4a8aa3++){var _0x5821e9=_0x3d27e5[_0xa441('0x20')]()===_0xa441('0x2c')?_0x11402e['destcalleridnum']:_0x11402e[_0xa441('0x22')];if(_0x5ab0f6[_0x4a8aa3]['telephone1']===_0x5821e9){_0x26f1bd=!![];_0xbcd8af[_0xa441('0x29')]=_0x5ab0f6[_0x4a8aa3][_0xa441('0x2d')];}}if(_0x26f1bd){_0xeeaed9(_0xbcd8af);}else{return createEndUser(_0xbcd8af,_0x5846f8,_0x317ca4,_0x494fb6,_0x11402e,_0x3d27e5)[_0xa441('0xd')](function(_0x279912){logger['info']('['+[_0x3d27e5[_0xa441('0x10')]()]+_0xa441('0x2e'),_0x279912[_0xa441('0x29')]);_0xeeaed9(_0x279912);});}}else{return createEndUser(_0xbcd8af,_0x5846f8,_0x317ca4,_0x494fb6,_0x11402e,_0x3d27e5)[_0xa441('0xd')](function(_0xea3267){logger[_0xa441('0x1b')]('['+[_0x3d27e5['toUpperCase']()]+']\x20Enduser\x20Created!',_0xea3267[_0xa441('0x29')]);_0xeeaed9(_0xea3267);});}});});}function getCustomFields(_0x372cb9,_0x34d578,_0x457694){var _0x2abff1={};if(_0x372cb9[_0xa441('0x2b')]>0x0){_[_0xa441('0x2f')](_0x372cb9,function(_0x5df8ad){if(_0x5df8ad['type']==='string'&&_0x5df8ad[_0xa441('0x30')]&&!_0x5df8ad[_0xa441('0x31')]){var _0x904786=_0x5df8ad[_0xa441('0x32')]['toLowerCase']();var _0x14010e=_0x904786[_0xa441('0x33')](0x0,_0x904786['indexOf']('_'));var _0x42c731=_0x904786[_0xa441('0x33')](_0x904786[_0xa441('0x34')]('_')+0x1);if(_0x14010e===_0x457694){_0x2abff1[_0x42c731]=_0x5df8ad[_0xa441('0x35')];}}});}return _0x2abff1;}function getTicket(_0x45767b,_0x201d0f,_0x2986d7,_0xecd08e,_0x1b2092,_0xfd4967,_0x5d1f20){return new BPromise(function(_0x17b66c,_0x141e63){var _0x7a0ded;return getAuthToken(_0x201d0f,_0x2986d7,_0x5d1f20)[_0xa441('0xd')](function(_0x2a9588){if(_0xfd4967[_0xa441('0x36')]===_0xa441('0x37')){_0x7a0ded={'method':_0xa441('0x9'),'uri':_0xecd08e+'incidents','body':Object[_0xa441('0x38')]({},{'title':intUtil['getString'](_0xfd4967['Subjects'],_0x1b2092,'\x20'),'description':intUtil[_0xa441('0x39')](_0xfd4967['Descriptions'],_0x1b2092,'\x0a'),'customerid_contact@odata.bind':_0xa441('0x3a')+_0x45767b['enduserId']+')','ownerid@odata.bind':_0xa441('0x24')+_0x45767b[_0xa441('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0xfd4967['Fields'],_0x1b2092,_0xfd4967[_0xa441('0x36')])),'headers':{'Authorization':_0xa441('0x25')+_0x2a9588,'OData-Version':_0xa441('0x13')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xfd4967[_0xa441('0x36')]==='phonecall'){_0x7a0ded={'method':'POST','uri':_0xecd08e+_0xa441('0x3b'),'body':Object['assign']({},{'subject':intUtil[_0xa441('0x39')](_0xfd4967[_0xa441('0x3c')],_0x1b2092,'\x20'),'phonenumber':String(_0x1b2092[_0xa441('0x22')]),'description':intUtil['getString'](_0xfd4967[_0xa441('0x3d')],_0x1b2092,'\x0a'),'regardingobjectid_contact@odata.bind':_0xa441('0x3a')+_0x45767b[_0xa441('0x29')]+')','ownerid@odata.bind':'/systemusers('+_0x45767b[_0xa441('0x1e')]+')','directioncode':_0x45767b[_0xa441('0x3e')]===_0xa441('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xa441('0x24')+_0x45767b[_0xa441('0x1e')]+')','participationtypemask':_0x45767b['callDirection']===_0xa441('0x3f')?0x2:0x1},{'partyid_contact@odata.bind':_0xa441('0x3a')+_0x45767b[_0xa441('0x29')]+')','participationtypemask':_0x45767b[_0xa441('0x3e')]===_0xa441('0x3f')?0x1:0x2}]},getCustomFields(_0xfd4967[_0xa441('0x40')],_0x1b2092,_0xfd4967[_0xa441('0x36')])),'headers':{'Authorization':_0xa441('0x25')+_0x2a9588,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x7a0ded);})[_0xa441('0xd')](function(_0x2a4e5d){var _0x43ee3e=_0x2a4e5d[_0xa441('0x26')][_0xa441('0x27')];var _0x2b9ee9=_0x43ee3e['substring'](_0x43ee3e[_0xa441('0x28')]('(')+0x1,_0x43ee3e[_0xa441('0x28')](')'));_0x45767b[_0xa441('0x41')]=_0x2b9ee9;_0x17b66c(_0x45767b);})[_0xa441('0xe')](function(_0x5e6725){_0x141e63(_0x5e6725['message']);});});}function emit(_0x142138,_0x334b1e,_0x1c924b,_0x512434){var _0x586819={'uri':util[_0xa441('0x42')](_0xa441('0x43'),_0x142138,_0x1c924b,_0x512434)};io['to'](util['format'](_0xa441('0x44'),_0x334b1e))[_0xa441('0x45')](_0xa441('0x46'),_0x586819);}exports['cs']=function(_0x1c4e6f,_0x2af0bd,_0x6f54c5,_0x50037e,_0x56af0c,_0x7fcd87,_0x4e9636,_0x59f265){var _0x3783f0={};_0x7fcd87[_0xa441('0x47')]=intUtil[_0xa441('0x48')](_0x7fcd87[_0xa441('0x47')]);_0x7fcd87[_0xa441('0x49')]=intUtil[_0xa441('0x48')](_0x7fcd87['serverUrl']);_0x3783f0['callDirection']=_0x59f265===_0xa441('0x3f')||_0x59f265===_0xa441('0x4a')?'queue':_0xa441('0x2c');var _0x2aa847=util['format']('%s/api/data/v9.0/',_0x7fcd87[_0xa441('0x47')]);var _0x190311=util[_0xa441('0x42')](_0xa441('0x4b'),_0x7fcd87[_0xa441('0x4c')]);var _0x3648b6=util['format'](_0xa441('0x4d'),_0x7fcd87[_0xa441('0x49')],_0x2af0bd['uniqueid'],md5(_0x2af0bd[_0xa441('0x4e')]));if(_0x56af0c&&_0x56af0c['monitor_format']){logger[_0xa441('0x1b')](_0xa441('0x4f'),_0xa441('0x50'));_0x2af0bd['recordingURL']=_0x3648b6;}else if(_0x4e9636&&_0x4e9636[_0xa441('0x51')]&&_0x4e9636[_0xa441('0x51')]!=='none'){logger[_0xa441('0x1b')](_0xa441('0x52'),_0xa441('0x50'));_0x2af0bd['recordingURL']=_0x3648b6;}else{_0x2af0bd[_0xa441('0x53')]='';}return getUser(_0x3783f0,_0x7fcd87,_0x50037e,_0x190311,_0x2aa847,_0x59f265)[_0xa441('0xd')](function(_0x12a20d){logger['info']('['+_0x59f265[_0xa441('0x10')]()+_0xa441('0x54'),_0x12a20d[_0xa441('0x1e')]);logger[_0xa441('0x1b')]('['+_0x59f265[_0xa441('0x10')]()+_0xa441('0x55'),_0x12a20d[_0xa441('0x18')]);return getEndUser(_0x12a20d,_0x7fcd87,_0x190311,_0x2aa847,_0x2af0bd,_0x59f265);})[_0xa441('0xd')](function(_0x13db52){logger['info']('['+_0x59f265[_0xa441('0x10')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x13db52['enduserId']);logger[_0xa441('0x1b')]('['+_0x59f265[_0xa441('0x10')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x2af0bd['calleridnum']);return getTicket(_0x13db52,_0x7fcd87,_0x190311,_0x2aa847,_0x2af0bd,_0x6f54c5,_0x59f265);})['then'](function(_0x1e7be3){logger['info'](util[_0xa441('0x42')]('['+_0x59f265['toUpperCase']()+_0xa441('0x56'),_0x6f54c5[_0xa441('0x36')],_0x1e7be3['ticketId']));logger[_0xa441('0x1b')](util['format']('['+_0x59f265[_0xa441('0x10')]()+_0xa441('0x57'),_0x59f265));if(_0x59f265!=='abandoned'){logger['info']('['+_0x59f265[_0xa441('0x10')]()+']',_0xa441('0x58'));emit(_0x7fcd87[_0xa441('0x47')],_0x50037e[_0xa441('0x59')],_0x6f54c5[_0xa441('0x36')],_0x1e7be3[_0xa441('0x41')]);}})[_0xa441('0xe')](function(_0x5a3d25){logger['error']('['+_0x59f265[_0xa441('0x10')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xa441('0x5a')](_0x5a3d25,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index f2ec63f..726cee6 100644 --- a/server/services/ami/trigger/integration/freshdesk.js +++ b/server/services/ami/trigger/integration/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2abf=['format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','%s/api/v2/tickets','remoteUri','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Basic\x20%s','toString','base64','debug','stringify','map','forEach','string','toLowerCase','content','type','custom_fields','push','idField','variableName','customField','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','serverUrl','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','error','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','catch','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','md5','util','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','merge'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x2abf,0x13f));var _0xf2ab=function(_0x4f0d36,_0x7cf10f){_0x4f0d36=_0x4f0d36-0x0;var _0x1f89af=_0x2abf[_0x4f0d36];return _0x1f89af;};'use strict';var _=require(_0xf2ab('0x0'));var rp=require(_0xf2ab('0x1'));var md5=require(_0xf2ab('0x2'));var util=require(_0xf2ab('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xf2ab('0x4'))(_0xf2ab('0x5'));config[_0xf2ab('0x6')]=_[_0xf2ab('0x7')](config['redis'],{'host':_0xf2ab('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xf2ab('0x9'),'Accept':_0xf2ab('0x9')};function emit(_0x177d62,_0x4b0206,_0x4a239d){io['to'](_0x177d62)['emit'](_0x4b0206,_0x4a239d);}function getTicket(_0x2db2f2,_0x1696a3,_0x441067,_0x556e2e,_0x39dbc5){logger[_0xf2ab('0xa')](_0xf2ab('0xb'));var _0x433564=_[_0xf2ab('0xc')]({'responder_id':_0x1696a3['id'],'requester_id':_0x441067['id'],'name':util[_0xf2ab('0xd')](_0xf2ab('0xe'),_0x39dbc5['calleridname']),'phone':_0x39dbc5[_0xf2ab('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf2ab('0x10')](_0x556e2e[_0xf2ab('0x11')],_0x39dbc5,'\x20'),'description':intUtil[_0xf2ab('0x10')](_0x556e2e[_0xf2ab('0x12')],_0x39dbc5,_0xf2ab('0x13')),'tags':getTags(_0x556e2e[_0xf2ab('0x14')],_0xf2ab('0x15'))},getCustomFields(_0x556e2e[_0xf2ab('0x16')],_0x39dbc5));_0x433564['custom_fields']=_['mapValues'](_['keyBy'](_0x433564['custom_fields'],'id'),'value');return request({'uri':util[_0xf2ab('0xd')](_0xf2ab('0x17'),_0x2db2f2[_0xf2ab('0x18')]),'method':'POST','body':_0x433564})['then'](function(_0x2129de){logger['info'](_0xf2ab('0x19'));return _0x2129de;});}function getUser(_0x36ead9,_0x1071c4){if(intUtil[_0xf2ab('0x1a')](_0x1071c4)){return request({'uri':util[_0xf2ab('0xd')](_0xf2ab('0x1b'),_0x36ead9[_0xf2ab('0x18')]),'qs':{'email':_0x1071c4}})[_0xf2ab('0x1c')](function(_0x471f67){if(_0x471f67[_0xf2ab('0x1d')]){logger[_0xf2ab('0xa')](_0xf2ab('0x1e'));return _[_0xf2ab('0x1f')](_0x471f67,function(_0x40b808){return _0x40b808['contact'][_0xf2ab('0x20')]===_0x1071c4;});}else{logger[_0xf2ab('0xa')](_0xf2ab('0x21'));return request({'uri':util[_0xf2ab('0xd')](_0xf2ab('0x22'),_0x36ead9['remoteUri'])})['then'](function(_0x4f76a6){logger[_0xf2ab('0xa')]('Admin\x20account\x20selected.');return _0x4f76a6;});}});}else{logger[_0xf2ab('0xa')](_0xf2ab('0x23'));return request({'uri':util[_0xf2ab('0xd')]('%s/api/v2/agents/me',_0x36ead9[_0xf2ab('0x18')])})[_0xf2ab('0x1c')](function(_0xfea9b8){logger['info']('Admin\x20account\x20selected.');return _0xfea9b8;});}}function getEndUser(_0x22ec86,_0x161174,_0x254ee7){logger[_0xf2ab('0xa')](_0xf2ab('0x24'),_0x254ee7);return request({'uri':util[_0xf2ab('0xd')](_0xf2ab('0x25'),_0x22ec86['remoteUri']),'qs':{'phone':_0x254ee7}})[_0xf2ab('0x1c')](function(_0x1768a6){if(_0x1768a6[_0xf2ab('0x1d')]){logger[_0xf2ab('0xa')](_0xf2ab('0x26'));return _[_0xf2ab('0x1f')](_0x1768a6,{'phone':_0x254ee7});}else{logger[_0xf2ab('0xa')](_0xf2ab('0x27'));return request({'uri':util[_0xf2ab('0xd')]('%s/api/v2/contacts',_0x22ec86[_0xf2ab('0x18')]),'method':_0xf2ab('0x28'),'body':{'name':_0x161174,'phone':_0x254ee7}})['then'](function(_0x24eaa8){logger[_0xf2ab('0xa')]('Enduser\x20created.');return _0x24eaa8;});}});}function getAuth(_0x71c1d9){return util[_0xf2ab('0xd')](_0xf2ab('0x29'),new Buffer(_0x71c1d9['apiKey']+':X')[_0xf2ab('0x2a')](_0xf2ab('0x2b')));}function request(_0x31212f){logger[_0xf2ab('0x2c')]('[HTTP]',JSON[_0xf2ab('0x2d')](_0x31212f));return rp(_[_0xf2ab('0x7')](_0x31212f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xcb94b5,_0x135fab){var _0x108da9=[];if(_0xcb94b5&&_0xcb94b5['length']>0x0){_0x108da9=_[_0xf2ab('0x2e')](_0xcb94b5,_0x135fab);}return _0x108da9;}function getCustomFields(_0x59128f,_0x163b8e){var _0x2e0f0c=[];var _0xba9672={'custom_fields':[]};if(_0x59128f[_0xf2ab('0x1d')]>0x0){_[_0xf2ab('0x2f')](_0x59128f,function(_0x1d7135){if(_0x1d7135['type']===_0xf2ab('0x30')&&_0x1d7135['nameField']&&!_0x1d7135['customField']){_0xba9672[_0x1d7135['nameField'][_0xf2ab('0x31')]()]=_0x1d7135[_0xf2ab('0x32')]['toString']();}else if(_0x1d7135[_0xf2ab('0x33')]==='string'&&_0x1d7135['idField']&&_0x1d7135['customField']){_0xba9672[_0xf2ab('0x34')][_0xf2ab('0x35')]({'id':_0x1d7135[_0xf2ab('0x36')],'value':_0x1d7135[_0xf2ab('0x32')]['toString']()});}else if(_0x1d7135[_0xf2ab('0x33')]==='variable'&&_0x1d7135[_0xf2ab('0x37')]&&_0x1d7135[_0xf2ab('0x36')]&&_0x1d7135[_0xf2ab('0x38')]){_0x163b8e[_0x1d7135[_0xf2ab('0x37')]]&&_0xba9672[_0xf2ab('0x34')]['push']({'id':_0x1d7135[_0xf2ab('0x36')],'value':_0x163b8e[_0x1d7135['variableName']][_0xf2ab('0x2a')]()});}else if(_0x1d7135[_0xf2ab('0x33')]===_0xf2ab('0x39')&&_0x1d7135[_0xf2ab('0x3a')]&&_0x1d7135[_0xf2ab('0x3a')][_0xf2ab('0x15')]&&_0x1d7135[_0xf2ab('0x36')]&&_0x1d7135[_0xf2ab('0x38')]){_0x163b8e[_0x1d7135[_0xf2ab('0x3a')][_0xf2ab('0x15')]['toLowerCase']()]&&_0xba9672[_0xf2ab('0x34')][_0xf2ab('0x35')]({'id':_0x1d7135['idField'],'value':_0x163b8e[_0x1d7135[_0xf2ab('0x3a')][_0xf2ab('0x15')][_0xf2ab('0x31')]()][_0xf2ab('0x2a')]()});}});}return _0xba9672;}exports[_0xf2ab('0x3b')]=function(_0x12a677,_0x1f22c6,_0x11625c,_0x4f45cc,_0x9a8f1b,_0x1eeb24){var _0x5ee94e,_0x70983d;_0x1eeb24[_0xf2ab('0x18')]=intUtil[_0xf2ab('0x3c')](_0x1eeb24[_0xf2ab('0x18')]);_0x1eeb24['serverUrl']=intUtil[_0xf2ab('0x3c')](_0x1eeb24['serverUrl']);if(_0x9a8f1b&&_0x9a8f1b[_0xf2ab('0x3d')]){logger['info'](_0xf2ab('0x3e'),_0xf2ab('0x3f'));_0x1f22c6['recordingURL']=util[_0xf2ab('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1eeb24[_0xf2ab('0x40')],_0x1f22c6[_0xf2ab('0x41')],md5(_0x1f22c6[_0xf2ab('0x41')]));}else{_0x1f22c6[_0xf2ab('0x42')]='';}headers[_0xf2ab('0x43')]=getAuth(_0x1eeb24);return getUser(_0x1eeb24,_0x4f45cc[_0xf2ab('0x20')])['then'](function(_0x54ea73){_0x5ee94e=_0x54ea73;logger['info'](_0xf2ab('0x44'),_0x5ee94e['id']);return getEndUser(_0x1eeb24,_0x1f22c6[_0xf2ab('0x45')],_0x1f22c6[_0xf2ab('0xf')]);})[_0xf2ab('0x1c')](function(_0x18f2c9){_0x70983d=_0x18f2c9;logger[_0xf2ab('0xa')](_0xf2ab('0x46'),_0x70983d['id']);return getTicket(_0x1eeb24,_0x5ee94e,_0x70983d,_0x11625c,_0x1f22c6);})[_0xf2ab('0x1c')](function(_0x5a0ef7){if(_0x5a0ef7&&_0x5a0ef7['id']){logger[_0xf2ab('0xa')](_0xf2ab('0x19'));logger[_0xf2ab('0xa')](_0xf2ab('0x47'),_0x5a0ef7['id']);logger[_0xf2ab('0xa')](_0xf2ab('0x3e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf2ab('0xd')](_0xf2ab('0x48'),_0x4f45cc['name']),_0xf2ab('0x49'),{'uri':util[_0xf2ab('0xd')]('%s/helpdesk/tickets/%d',_0x1eeb24[_0xf2ab('0x18')],_0x5a0ef7['id'])});}})['catch'](function(_0x500f15){logger[_0xf2ab('0x4a')](_0xf2ab('0x3e'),JSON[_0xf2ab('0x2d')](_0x500f15));});};exports['outbound']=function(_0x49cabc,_0x5344f1,_0xb89b7d,_0x1ee295,_0x454adc,_0x3ea3a1,_0x372f4b){var _0x31f7c7,_0x30800a;_0x3ea3a1[_0xf2ab('0x18')]=intUtil['stripTrailingSlash'](_0x3ea3a1['remoteUri']);_0x3ea3a1[_0xf2ab('0x40')]=intUtil[_0xf2ab('0x3c')](_0x3ea3a1[_0xf2ab('0x40')]);if(_0x372f4b&&_0x372f4b[_0xf2ab('0x4b')]&&_0x372f4b[_0xf2ab('0x4b')]!=='none'){logger[_0xf2ab('0xa')](_0xf2ab('0x4c'),'Recording\x20is\x20enabled!');_0x5344f1[_0xf2ab('0x42')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ea3a1['serverUrl'],_0x5344f1[_0xf2ab('0x41')],md5(_0x5344f1[_0xf2ab('0x41')]));}headers[_0xf2ab('0x43')]=getAuth(_0x3ea3a1);return getUser(_0x3ea3a1,_0x1ee295['email'])['then'](function(_0x59ca81){_0x31f7c7=_0x59ca81;logger[_0xf2ab('0xa')]('The\x20User\x20ID\x20is:',_0x31f7c7['id']);return getEndUser(_0x3ea3a1,_0x5344f1[_0xf2ab('0x4d')],_0x5344f1[_0xf2ab('0x4e')]);})[_0xf2ab('0x1c')](function(_0x4fa358){_0x30800a=_0x4fa358;logger['info'](_0xf2ab('0x46'),_0x30800a['id']);return getTicket(_0x3ea3a1,_0x31f7c7,_0x30800a,_0xb89b7d,_0x5344f1);})['then'](function(_0x57bb62){if(_0x57bb62&&_0x57bb62['id']){logger[_0xf2ab('0xa')](_0xf2ab('0x19'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x57bb62['id']);logger['info'](_0xf2ab('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xf2ab('0x48'),_0x1ee295[_0xf2ab('0x15')]),_0xf2ab('0x49'),{'uri':util[_0xf2ab('0xd')](_0xf2ab('0x4f'),_0x3ea3a1[_0xf2ab('0x18')],_0x57bb62['id'])});}})[_0xf2ab('0x50')](function(_0x3bca6a){logger['error'](_0xf2ab('0x4c'),JSON[_0xf2ab('0x2d')](_0x3bca6a));});};exports['abandoned']=function(_0x46d1dc,_0x21939b,_0xad6f4e,_0x2b0304,_0x332c1b,_0x318b2d){var _0x527de5,_0x205836;_0x318b2d[_0xf2ab('0x18')]=intUtil[_0xf2ab('0x3c')](_0x318b2d[_0xf2ab('0x18')]);_0x318b2d[_0xf2ab('0x40')]=intUtil[_0xf2ab('0x3c')](_0x318b2d['serverUrl']);if(_0x332c1b&&_0x332c1b[_0xf2ab('0x3d')]){logger[_0xf2ab('0xa')](_0xf2ab('0x51'),_0xf2ab('0x3f'));_0x21939b[_0xf2ab('0x42')]=util[_0xf2ab('0xd')](_0xf2ab('0x52'),_0x318b2d[_0xf2ab('0x40')],_0x21939b[_0xf2ab('0x41')],md5(_0x21939b[_0xf2ab('0x41')]));}else{_0x21939b[_0xf2ab('0x42')]='';}headers[_0xf2ab('0x43')]=getAuth(_0x318b2d);return getUser(_0x318b2d,'')[_0xf2ab('0x1c')](function(_0xf429b0){_0x527de5=_0xf429b0;logger['info'](_0xf2ab('0x44'),_0x527de5['id']);return getEndUser(_0x318b2d,_0x21939b[_0xf2ab('0x45')],_0x21939b[_0xf2ab('0xf')]);})[_0xf2ab('0x1c')](function(_0x5b7777){_0x205836=_0x5b7777;logger['info'](_0xf2ab('0x46'),_0x205836['id']);return getTicket(_0x318b2d,_0x527de5,_0x205836,_0xad6f4e,_0x21939b);})['then'](function(_0x41cee6){if(_0x41cee6){logger[_0xf2ab('0xa')](_0xf2ab('0x19'));logger[_0xf2ab('0xa')]('The\x20Ticket\x20ID\x20is:',_0x41cee6['id']);}})[_0xf2ab('0x50')](function(_0x29629b){logger[_0xf2ab('0x4a')](_0xf2ab('0x51'),JSON[_0xf2ab('0x2d')](_0x29629b));});}; \ No newline at end of file +var _0x1211=['Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','[OUTBOUND]','destcalleridname','user:%s','catch','abandoned','monitor_format','[ABANDONED]','request-promise','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','apiKey','base64','debug','[HTTP]','stringify','GET','map','type','string','nameField','customField','toLowerCase','toString','idField','content','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x1211,0xc7));var _0x1121=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1211[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var rp=require(_0x1121('0x0'));var md5=require('md5');var util=require(_0x1121('0x1'));var Redis=require(_0x1121('0x2'));var intUtil=require(_0x1121('0x3'));var config=require('../../../../config/environment');var logger=require(_0x1121('0x4'))('freshdesk');config[_0x1121('0x5')]=_[_0x1121('0x6')](config[_0x1121('0x5')],{'host':_0x1121('0x7'),'port':0x18eb});var io=require(_0x1121('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0x1121('0x9'),'Accept':_0x1121('0x9')};function emit(_0x2b2195,_0x36d6c9,_0x834a9e){io['to'](_0x2b2195)[_0x1121('0xa')](_0x36d6c9,_0x834a9e);}function getTicket(_0x4738f0,_0x534f30,_0x51f581,_0x5e77d7,_0x404874){logger['info'](_0x1121('0xb'));var _0xf16413=_[_0x1121('0xc')]({'responder_id':_0x534f30['id'],'requester_id':_0x51f581['id'],'name':util[_0x1121('0xd')](_0x1121('0xe'),_0x404874['calleridname']),'phone':_0x404874[_0x1121('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1121('0x10')](_0x5e77d7[_0x1121('0x11')],_0x404874,'\x20'),'description':intUtil['getString'](_0x5e77d7[_0x1121('0x12')],_0x404874,_0x1121('0x13')),'tags':getTags(_0x5e77d7['Tags'],_0x1121('0x14'))},getCustomFields(_0x5e77d7[_0x1121('0x15')],_0x404874));_0xf16413[_0x1121('0x16')]=_[_0x1121('0x17')](_[_0x1121('0x18')](_0xf16413[_0x1121('0x16')],'id'),_0x1121('0x19'));return request({'uri':util[_0x1121('0xd')](_0x1121('0x1a'),_0x4738f0['remoteUri']),'method':'POST','body':_0xf16413})[_0x1121('0x1b')](function(_0x2ed370){logger[_0x1121('0x1c')](_0x1121('0x1d'));return _0x2ed370;});}function getUser(_0x402739,_0x20a64d){if(intUtil[_0x1121('0x1e')](_0x20a64d)){return request({'uri':util[_0x1121('0xd')](_0x1121('0x1f'),_0x402739[_0x1121('0x20')]),'qs':{'email':_0x20a64d}})[_0x1121('0x1b')](function(_0x48d82d){if(_0x48d82d[_0x1121('0x21')]){logger[_0x1121('0x1c')](_0x1121('0x22'));return _[_0x1121('0x23')](_0x48d82d,function(_0x1c008b){return _0x1c008b[_0x1121('0x24')][_0x1121('0x25')]===_0x20a64d;});}else{logger['info'](_0x1121('0x26'));return request({'uri':util[_0x1121('0xd')](_0x1121('0x27'),_0x402739[_0x1121('0x20')])})[_0x1121('0x1b')](function(_0x306c41){logger['info'](_0x1121('0x28'));return _0x306c41;});}});}else{logger[_0x1121('0x1c')](_0x1121('0x29'));return request({'uri':util[_0x1121('0xd')](_0x1121('0x27'),_0x402739['remoteUri'])})['then'](function(_0x549cfb){logger['info'](_0x1121('0x28'));return _0x549cfb;});}}function getEndUser(_0x23cbc2,_0x1a4961,_0x396f8e){logger[_0x1121('0x1c')](_0x1121('0x2a'),_0x396f8e);return request({'uri':util[_0x1121('0xd')](_0x1121('0x2b'),_0x23cbc2['remoteUri']),'qs':{'phone':_0x396f8e}})[_0x1121('0x1b')](function(_0xce225c){if(_0xce225c[_0x1121('0x21')]){logger['info'](_0x1121('0x2c'));return _['find'](_0xce225c,{'phone':_0x396f8e});}else{logger[_0x1121('0x1c')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x1121('0xd')](_0x1121('0x2b'),_0x23cbc2['remoteUri']),'method':'POST','body':{'name':_0x1a4961,'phone':_0x396f8e}})[_0x1121('0x1b')](function(_0x21bdbc){logger[_0x1121('0x1c')](_0x1121('0x2d'));return _0x21bdbc;});}});}function getAuth(_0x29ec79){return util[_0x1121('0xd')]('Basic\x20%s',new Buffer(_0x29ec79[_0x1121('0x2e')]+':X')['toString'](_0x1121('0x2f')));}function request(_0x17f38d){logger[_0x1121('0x30')](_0x1121('0x31'),JSON[_0x1121('0x32')](_0x17f38d));return rp(_[_0x1121('0x6')](_0x17f38d,{'method':_0x1121('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x243e5b,_0x4da542){var _0x415a2d=[];if(_0x243e5b&&_0x243e5b[_0x1121('0x21')]>0x0){_0x415a2d=_[_0x1121('0x34')](_0x243e5b,_0x4da542);}return _0x415a2d;}function getCustomFields(_0x796374,_0x3da403){var _0x39aa39=[];var _0x2b3e63={'custom_fields':[]};if(_0x796374[_0x1121('0x21')]>0x0){_['forEach'](_0x796374,function(_0x176160){if(_0x176160[_0x1121('0x35')]===_0x1121('0x36')&&_0x176160[_0x1121('0x37')]&&!_0x176160[_0x1121('0x38')]){_0x2b3e63[_0x176160[_0x1121('0x37')][_0x1121('0x39')]()]=_0x176160['content'][_0x1121('0x3a')]();}else if(_0x176160[_0x1121('0x35')]==='string'&&_0x176160[_0x1121('0x3b')]&&_0x176160[_0x1121('0x38')]){_0x2b3e63[_0x1121('0x16')]['push']({'id':_0x176160[_0x1121('0x3b')],'value':_0x176160[_0x1121('0x3c')][_0x1121('0x3a')]()});}else if(_0x176160['type']==='variable'&&_0x176160[_0x1121('0x3d')]&&_0x176160[_0x1121('0x3b')]&&_0x176160[_0x1121('0x38')]){_0x3da403[_0x176160[_0x1121('0x3d')]]&&_0x2b3e63[_0x1121('0x16')]['push']({'id':_0x176160[_0x1121('0x3b')],'value':_0x3da403[_0x176160[_0x1121('0x3d')]]['toString']()});}else if(_0x176160[_0x1121('0x35')]===_0x1121('0x3e')&&_0x176160[_0x1121('0x3f')]&&_0x176160[_0x1121('0x3f')][_0x1121('0x14')]&&_0x176160[_0x1121('0x3b')]&&_0x176160[_0x1121('0x38')]){_0x3da403[_0x176160[_0x1121('0x3f')]['name'][_0x1121('0x39')]()]&&_0x2b3e63[_0x1121('0x16')]['push']({'id':_0x176160['idField'],'value':_0x3da403[_0x176160[_0x1121('0x3f')][_0x1121('0x14')]['toLowerCase']()][_0x1121('0x3a')]()});}});}return _0x2b3e63;}exports[_0x1121('0x40')]=function(_0x554181,_0x5f37f2,_0x447056,_0x1d76ed,_0x4061a3,_0x515758){var _0x453403,_0x3bc5c7;_0x515758[_0x1121('0x20')]=intUtil[_0x1121('0x41')](_0x515758[_0x1121('0x20')]);_0x515758[_0x1121('0x42')]=intUtil[_0x1121('0x41')](_0x515758[_0x1121('0x42')]);if(_0x4061a3&&_0x4061a3['monitor_format']){logger['info'](_0x1121('0x43'),_0x1121('0x44'));_0x5f37f2[_0x1121('0x45')]=util[_0x1121('0xd')](_0x1121('0x46'),_0x515758['serverUrl'],_0x5f37f2[_0x1121('0x47')],md5(_0x5f37f2['uniqueid']));}else{_0x5f37f2[_0x1121('0x45')]='';}headers[_0x1121('0x48')]=getAuth(_0x515758);return getUser(_0x515758,_0x1d76ed[_0x1121('0x25')])[_0x1121('0x1b')](function(_0x17aaff){_0x453403=_0x17aaff;logger[_0x1121('0x1c')](_0x1121('0x49'),_0x453403['id']);return getEndUser(_0x515758,_0x5f37f2[_0x1121('0x4a')],_0x5f37f2[_0x1121('0xf')]);})[_0x1121('0x1b')](function(_0x4fca8c){_0x3bc5c7=_0x4fca8c;logger['info'](_0x1121('0x4b'),_0x3bc5c7['id']);return getTicket(_0x515758,_0x453403,_0x3bc5c7,_0x447056,_0x5f37f2);})[_0x1121('0x1b')](function(_0x3d65ea){if(_0x3d65ea&&_0x3d65ea['id']){logger[_0x1121('0x1c')]('Ticket\x20created!');logger[_0x1121('0x1c')](_0x1121('0x4c'),_0x3d65ea['id']);logger[_0x1121('0x1c')](_0x1121('0x43'),_0x1121('0x4d'));emit(util[_0x1121('0xd')]('user:%s',_0x1d76ed['name']),_0x1121('0x4e'),{'uri':util['format'](_0x1121('0x4f'),_0x515758[_0x1121('0x20')],_0x3d65ea['id'])});}})['catch'](function(_0x2a0305){logger[_0x1121('0x50')](_0x1121('0x43'),JSON[_0x1121('0x32')](_0x2a0305));});};exports['outbound']=function(_0x2af839,_0x4e528c,_0x18179f,_0x442621,_0x1f50eb,_0x49e04e,_0x30f838){var _0xa4daba,_0x2b80e1;_0x49e04e[_0x1121('0x20')]=intUtil[_0x1121('0x41')](_0x49e04e[_0x1121('0x20')]);_0x49e04e[_0x1121('0x42')]=intUtil[_0x1121('0x41')](_0x49e04e[_0x1121('0x42')]);if(_0x30f838&&_0x30f838[_0x1121('0x51')]&&_0x30f838[_0x1121('0x51')]!=='none'){logger[_0x1121('0x1c')](_0x1121('0x52'),_0x1121('0x44'));_0x4e528c[_0x1121('0x45')]=util['format'](_0x1121('0x46'),_0x49e04e[_0x1121('0x42')],_0x4e528c['uniqueid'],md5(_0x4e528c[_0x1121('0x47')]));}headers[_0x1121('0x48')]=getAuth(_0x49e04e);return getUser(_0x49e04e,_0x442621[_0x1121('0x25')])['then'](function(_0x5480e3){_0xa4daba=_0x5480e3;logger['info'](_0x1121('0x49'),_0xa4daba['id']);return getEndUser(_0x49e04e,_0x4e528c[_0x1121('0x53')],_0x4e528c['destcalleridnum']);})[_0x1121('0x1b')](function(_0x3433a4){_0x2b80e1=_0x3433a4;logger[_0x1121('0x1c')](_0x1121('0x4b'),_0x2b80e1['id']);return getTicket(_0x49e04e,_0xa4daba,_0x2b80e1,_0x18179f,_0x4e528c);})['then'](function(_0x3020f8){if(_0x3020f8&&_0x3020f8['id']){logger[_0x1121('0x1c')](_0x1121('0x1d'));logger['info'](_0x1121('0x4c'),_0x3020f8['id']);logger[_0x1121('0x1c')](_0x1121('0x52'),_0x1121('0x4d'));emit(util[_0x1121('0xd')](_0x1121('0x54'),_0x442621[_0x1121('0x14')]),_0x1121('0x4e'),{'uri':util[_0x1121('0xd')]('%s/helpdesk/tickets/%d',_0x49e04e['remoteUri'],_0x3020f8['id'])});}})[_0x1121('0x55')](function(_0x3a1259){logger[_0x1121('0x50')](_0x1121('0x52'),JSON[_0x1121('0x32')](_0x3a1259));});};exports[_0x1121('0x56')]=function(_0x22e2de,_0x2266e8,_0x42081c,_0x381be6,_0x425e02,_0x328d27){var _0x55ad27,_0x2da9ef;_0x328d27[_0x1121('0x20')]=intUtil[_0x1121('0x41')](_0x328d27['remoteUri']);_0x328d27[_0x1121('0x42')]=intUtil[_0x1121('0x41')](_0x328d27[_0x1121('0x42')]);if(_0x425e02&&_0x425e02[_0x1121('0x57')]){logger[_0x1121('0x1c')](_0x1121('0x58'),'Recording\x20is\x20enabled!');_0x2266e8[_0x1121('0x45')]=util[_0x1121('0xd')](_0x1121('0x46'),_0x328d27['serverUrl'],_0x2266e8[_0x1121('0x47')],md5(_0x2266e8[_0x1121('0x47')]));}else{_0x2266e8[_0x1121('0x45')]='';}headers[_0x1121('0x48')]=getAuth(_0x328d27);return getUser(_0x328d27,'')[_0x1121('0x1b')](function(_0x2aa5e0){_0x55ad27=_0x2aa5e0;logger['info'](_0x1121('0x49'),_0x55ad27['id']);return getEndUser(_0x328d27,_0x2266e8[_0x1121('0x4a')],_0x2266e8[_0x1121('0xf')]);})[_0x1121('0x1b')](function(_0x478fd1){_0x2da9ef=_0x478fd1;logger[_0x1121('0x1c')](_0x1121('0x4b'),_0x2da9ef['id']);return getTicket(_0x328d27,_0x55ad27,_0x2da9ef,_0x42081c,_0x2266e8);})[_0x1121('0x1b')](function(_0x38d627){if(_0x38d627){logger[_0x1121('0x1c')](_0x1121('0x1d'));logger[_0x1121('0x1c')](_0x1121('0x4c'),_0x38d627['id']);}})[_0x1121('0x55')](function(_0x43022b){logger[_0x1121('0x50')](_0x1121('0x58'),JSON['stringify'](_0x43022b));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 4e324df..a2bfad0 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6182=['endUserId','Contact\x20created:','POST','/api/contacts','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','outbound','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','abandoned','inspect','lodash','md5','util','bluebird','./util','../../../../config/environment','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','message','/api/contacts/filters','Getting\x20contacts\x20filter','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','work_number','mobile_number'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x6182,0x123));var _0x2618=function(_0xf982b5,_0x195883){_0xf982b5=_0xf982b5-0x0;var _0x444cbe=_0x6182[_0xf982b5];return _0x444cbe;};'use strict';var _=require(_0x2618('0x0'));var rp=require('request-promise');var md5=require(_0x2618('0x1'));var util=require(_0x2618('0x2'));var moment=require('moment');var Promise=require(_0x2618('0x3'));var intUtil=require(_0x2618('0x4'));var config=require(_0x2618('0x5'));var logger=require('../../../../config/logger')(_0x2618('0x6'));config[_0x2618('0x7')]=_['defaults'](config[_0x2618('0x7')],{'host':_0x2618('0x8'),'port':0x18eb});var io=require(_0x2618('0x9'))(new Redis(config['redis']));function getAdminId(_0x1a7761,_0x5cd7e6,_0x321f63,_0x120b74){return new Promise(function(_0x2c6465,_0x2541c6){var _0x407ccd=![];var _0x8e580e={'method':_0x2618('0xa'),'uri':_0x120b74+_0x2618('0xb'),'json':!![]};_0x8e580e[_0x2618('0xc')]=_0x321f63;logger[_0x2618('0xd')]('Getting\x20admin\x20information');return rp(_0x8e580e)[_0x2618('0xe')](function(_0x4148e6){if(_0x4148e6){var _0x4ceee6=_0x4148e6[_0x2618('0xf')];var _0x41a7b7=null;for(_0x41a7b7=0x0;_0x41a7b7<_0x4ceee6[_0x2618('0x10')];_0x41a7b7++){if(_0x4ceee6[_0x41a7b7][_0x2618('0x11')]===_0x1a7761[_0x2618('0x12')]){_0x1a7761[_0x2618('0x13')]=_0x4ceee6[_0x41a7b7]['id'];_0x407ccd=!![];}}if(_0x407ccd){logger[_0x2618('0xd')](_0x2618('0x14'),_0x1a7761[_0x2618('0x13')]);_0x2c6465(_0x1a7761);}else{_0x2541c6({'statusCode':0x194,'message':_0x2618('0x15')});}}else{_0x2541c6({'statusCode':0x194,'message':_0x2618('0x15')});}})[_0x2618('0x16')](function(_0x3461ea){logger[_0x2618('0x17')]('['+[_0x5cd7e6[_0x2618('0x18')]()]+']',_0x3461ea['message']);_0x2541c6(_0x3461ea);});});}function getUser(_0x3ab720,_0x44747f,_0x1e92b4){return function(_0x1841a1){return new Promise(function(_0x242bd1,_0x1e11e0){var _0x4f0ac4={'method':_0x2618('0xa'),'uri':_0x1e92b4+_0x2618('0xb'),'json':!![]};_0x4f0ac4[_0x2618('0xc')]=_0x44747f;logger[_0x2618('0xd')](_0x2618('0x19'));return rp(_0x4f0ac4)['then'](function(_0x495cbe){if(_0x495cbe){var _0x48d994=_0x495cbe[_0x2618('0xf')];var _0x235687=![];var _0x4bd0b8=null;if(_0x1841a1[_0x2618('0x1a')]!==null){logger['info'](_0x2618('0x1b'),_0x1841a1[_0x2618('0x1a')]);_0x1841a1[_0x2618('0x1c')]=_0x1841a1[_0x2618('0x1a')];for(_0x4bd0b8=0x0;_0x4bd0b8<_0x48d994[_0x2618('0x10')];_0x4bd0b8++){if(_0x48d994[_0x4bd0b8]['email']===_0x1841a1[_0x2618('0x1a')]){_0x235687=!![];_0x1841a1[_0x2618('0x1d')]=_0x48d994[_0x4bd0b8]['id'];logger[_0x2618('0xd')](_0x2618('0x1e'),_0x1841a1[_0x2618('0x1d')]);}}}if(!_0x235687){logger['info']('Admin\x20selected');_0x1841a1[_0x2618('0x1c')]=_0x1841a1[_0x2618('0x12')];_0x1841a1[_0x2618('0x1d')]=_0x1841a1[_0x2618('0x13')];_0x235687=!![];}if(_0x235687){_0x242bd1(_0x1841a1);}else{_0x1e11e0({'statusCode':0x194,'message':_0x2618('0x15')});}}else{_0x1e11e0({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x2618('0x16')](function(_0x4c57a9){logger[_0x2618('0x17')]('['+[_0x3ab720[_0x2618('0x18')]()]+']',_0x4c57a9[_0x2618('0x1f')]);_0x1e11e0(_0x4c57a9);});});};}function getEndUser(_0xfc782,_0x3bcc12,_0x194eb5){return function(_0x218957){return new Promise(function(_0x3e0ae5,_0x9e8833){var _0x243956=0x0;var _0x59ec9c={'method':'GET','uri':_0x194eb5+_0x2618('0x20'),'json':!![]};_0x59ec9c[_0x2618('0xc')]=_0x3bcc12;logger['info'](_0x2618('0x21'));return rp(_0x59ec9c)[_0x2618('0xe')](function(_0x756cd6){_0x756cd6['filters'][_0x2618('0x22')](function(_0x4734f1){if(_0x4734f1[_0x2618('0x23')]===_0x2618('0x24')){_0x243956=_0x4734f1['id'];}});})[_0x2618('0xe')](function(){logger[_0x2618('0xd')](_0x2618('0x25'));var _0x30206e={'method':_0x2618('0xa'),'uri':_0x194eb5+_0x2618('0x26')+_0x243956,'json':!![]};_0x30206e['headers']=_0x3bcc12;return rp(_0x30206e);})[_0x2618('0xe')](function(_0x31ddf5){logger[_0x2618('0xd')](_0x2618('0x27'),_0x218957[_0x2618('0x28')]);if(_0x31ddf5[_0x2618('0x29')][_0x2618('0x10')]>0x0){var _0x357b02=_[_0x2618('0x2a')](_0x31ddf5[_0x2618('0x29')],function(_0x878b95){if(_0x878b95[_0x2618('0x2b')]===_0x218957[_0x2618('0x28')]||_0x878b95[_0x2618('0x2c')]===_0x218957[_0x2618('0x28')]){return _0x878b95;}});if(_0x357b02){_0x218957[_0x2618('0x2d')]=_0x357b02['id'];logger[_0x2618('0xd')]('Contact\x20found:',_0x218957[_0x2618('0x2d')]);_0x3e0ae5(_0x218957);}else{return createEndUser(_0x218957,_0xfc782,_0x3bcc12,_0x194eb5)[_0x2618('0xe')](function(_0x51481a){logger[_0x2618('0xd')](_0x2618('0x2e'),_0x218957[_0x2618('0x2d')]);_0x3e0ae5(_0x51481a);});}}else{return createEndUser(_0x218957,_0xfc782,_0x3bcc12,_0x194eb5)[_0x2618('0xe')](function(_0x885fba){logger[_0x2618('0xd')]('Contact\x20created:',_0x218957['endUserId']);_0x3e0ae5(_0x885fba);});}})[_0x2618('0x16')](function(_0x2c8b32){throw new Error(_0x2c8b32[_0x2618('0x1f')]);});});};}function createEndUser(_0x14d7f8,_0x24bb66,_0x6da42a,_0xb6f430){return new Promise(function(_0x2279a4,_0x4424eb){var _0x450ca9=moment();var _0x3fe49a={'method':_0x2618('0x2f'),'uri':_0xb6f430+_0x2618('0x30'),'body':{'contact':{'last_name':_0x14d7f8[_0x2618('0x28')],'work_number':_0x14d7f8[_0x2618('0x28')],'mobile_number':_0x14d7f8[_0x2618('0x28')],'owner_id':_0x14d7f8[_0x2618('0x1d')],'created_at':_0x450ca9[_0x2618('0x31')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x3fe49a[_0x2618('0xc')]=_0x6da42a;logger['info'](_0x2618('0x32'));return rp(_0x3fe49a)[_0x2618('0xe')](function(_0x137859){_0x14d7f8[_0x2618('0x2d')]=_0x137859[_0x2618('0x33')]['id'];_0x2279a4(_0x14d7f8);})['catch'](function(_0x349e04){logger[_0x2618('0x17')]('['+[_0x24bb66[_0x2618('0x18')]()]+']',_0x349e04[_0x2618('0x1f')]);_0x4424eb(_0x349e04[_0x2618('0x1f')]);});});}function getTicket(_0x56b277,_0x2b7aba,_0x2c3bc2,_0x175aa7,_0x39acaf){return function(_0x5ae95c){logger[_0x2618('0xd')](_0x2618('0x34'));return new Promise(function(_0x332e69,_0x1f846a){var _0x249d90=moment();var _0x162a8c={'method':_0x2618('0x2f'),'uri':_0x2c3bc2+_0x2618('0x35'),'body':{'title':intUtil[_0x2618('0x36')](_0x175aa7[_0x2618('0x37')],_0x39acaf,'\x20'),'description':intUtil['getString'](_0x175aa7['Descriptions'],_0x39acaf,'\x0a'),'owner_id':_0x5ae95c['userId'],'creater_id':_0x5ae95c[_0x2618('0x13')],'targetable_id':_0x5ae95c[_0x2618('0x2d')],'targetable_type':'Contact','created_at':_0x249d90[_0x2618('0x31')](_0x2618('0x38')),'due_date':_0x249d90[_0x2618('0x39')](0x1e,'m')[_0x2618('0x31')](_0x2618('0x38'))},'json':!![]};_0x162a8c[_0x2618('0xc')]=_0x2b7aba;return rp(_0x162a8c)['then'](function(_0x17282b){_0x5ae95c[_0x2618('0x3a')]=_0x17282b[_0x2618('0x3b')]['id'];logger['info'](_0x2618('0x3c'),_0x5ae95c[_0x2618('0x3a')]);_0x332e69(_0x5ae95c);})[_0x2618('0x16')](function(_0x2037ef){logger[_0x2618('0x17')]('['+[_0x56b277[_0x2618('0x18')]()]+']',_0x2037ef['message']);_0x1f846a(_0x2037ef[_0x2618('0x1f')]);});});};}function emit(_0x1fa3ef,_0x44e36e,_0x5b3405){var _0x113b19={'uri':_0x1fa3ef+_0x2618('0x3d')+_0x5b3405};io['to'](util[_0x2618('0x31')](_0x2618('0x3e'),_0x44e36e))[_0x2618('0x3f')](_0x2618('0x40'),_0x113b19);}exports['cs']=function(_0x10bed4,_0x420d7c,_0x736c9,_0x29d885,_0x873cb0,_0x3df5c6,_0x4409c7,_0x2c5611){var _0x428350={};var _0x3c0557={'Authorization':_0x2618('0x41')+_0x3df5c6[_0x2618('0x42')]};_0x3df5c6['remoteUri']=intUtil['stripTrailingSlash'](_0x3df5c6[_0x2618('0x43')]);_0x3df5c6[_0x2618('0x44')]=intUtil['stripTrailingSlash'](_0x3df5c6['serverUrl']);var _0x36e842=_0x3df5c6[_0x2618('0x43')];_0x428350[_0x2618('0x12')]=_0x3df5c6[_0x2618('0x45')];_0x428350[_0x2618('0x28')]=_0x2c5611[_0x2618('0x46')]()==='outbound'?_0x420d7c[_0x2618('0x47')]:_0x420d7c[_0x2618('0x48')];_0x428350[_0x2618('0x49')]=_0x2c5611===_0x2618('0x4a')||_0x2c5611==='abandoned'?_0x2618('0x4a'):_0x2618('0x4b');if(_0x29d885){_0x428350['agentEmail']=_0x29d885[_0x2618('0x11')];}var _0x1774b9=util[_0x2618('0x31')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3df5c6[_0x2618('0x44')],_0x420d7c['uniqueid'],md5(_0x420d7c['uniqueid']));if(_0x873cb0&&_0x873cb0['monitor_format']){logger['info'](_0x2618('0x4c'),_0x2618('0x4d'));_0x420d7c[_0x2618('0x4e')]=_0x1774b9;}else if(_0x4409c7&&_0x4409c7[_0x2618('0x4f')]&&_0x4409c7[_0x2618('0x4f')]!==_0x2618('0x50')){logger[_0x2618('0xd')]('[OUTBOUND]',_0x2618('0x4d'));_0x420d7c[_0x2618('0x4e')]=_0x1774b9;}else{_0x420d7c['recordingURL']='';}return getAdminId(_0x428350,_0x2c5611,_0x3c0557,_0x36e842)[_0x2618('0xe')](getUser(_0x2c5611,_0x3c0557,_0x36e842))[_0x2618('0xe')](getEndUser(_0x2c5611,_0x3c0557,_0x36e842))[_0x2618('0xe')](getTicket(_0x2c5611,_0x3c0557,_0x36e842,_0x736c9,_0x420d7c))[_0x2618('0xe')](function(_0x1cf3e1){logger[_0x2618('0xd')](util['format'](_0x2618('0x51'),_0x1cf3e1[_0x2618('0x3a')]));if(_0x2c5611!==_0x2618('0x52')){logger[_0x2618('0xd')]('['+[_0x2c5611[_0x2618('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x36e842,_0x29d885[_0x2618('0x23')],_0x1cf3e1['endUserId']);}})[_0x2618('0x16')](function(_0x37449f){logger[_0x2618('0x17')]('['+[_0x2c5611[_0x2618('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x2618('0x53')](_0x37449f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9dd6=['length','email','info','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','GET','Getting\x20user\x20list','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','adminEmail','toUpperCase','/api/contacts/filters','Getting\x20contacts\x20filter','forEach','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','/api/contacts','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','format','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','destcalleridnum','queue','abandoned','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','moment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','/api/selector/owners','headers','Getting\x20admin\x20information','then','users'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9dd6,0x1cd));var _0x69dd=function(_0x36408e,_0x3eba0d){_0x36408e=_0x36408e-0x0;var _0x5e75f4=_0x9dd6[_0x36408e];return _0x5e75f4;};'use strict';var _=require(_0x69dd('0x0'));var rp=require('request-promise');var md5=require(_0x69dd('0x1'));var util=require('util');var moment=require(_0x69dd('0x2'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x69dd('0x3'))(_0x69dd('0x4'));config[_0x69dd('0x5')]=_['defaults'](config[_0x69dd('0x5')],{'host':_0x69dd('0x6'),'port':0x18eb});var io=require(_0x69dd('0x7'))(new Redis(config[_0x69dd('0x5')]));function getAdminId(_0xe09f09,_0x3b4cfb,_0x1522e5,_0xa5fa0a){return new Promise(function(_0x100a05,_0x3feffc){var _0x15e30a=![];var _0x1560d1={'method':'GET','uri':_0xa5fa0a+_0x69dd('0x8'),'json':!![]};_0x1560d1[_0x69dd('0x9')]=_0x1522e5;logger['info'](_0x69dd('0xa'));return rp(_0x1560d1)[_0x69dd('0xb')](function(_0x560878){if(_0x560878){var _0x12fa76=_0x560878[_0x69dd('0xc')];var _0xaead40=null;for(_0xaead40=0x0;_0xaead40<_0x12fa76[_0x69dd('0xd')];_0xaead40++){if(_0x12fa76[_0xaead40][_0x69dd('0xe')]===_0xe09f09['adminEmail']){_0xe09f09['adminId']=_0x12fa76[_0xaead40]['id'];_0x15e30a=!![];}}if(_0x15e30a){logger[_0x69dd('0xf')]('Admin\x20found:',_0xe09f09[_0x69dd('0x10')]);_0x100a05(_0xe09f09);}else{_0x3feffc({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3feffc({'statusCode':0x194,'message':_0x69dd('0x11')});}})[_0x69dd('0x12')](function(_0x39f5bf){logger[_0x69dd('0x13')]('['+[_0x3b4cfb['toUpperCase']()]+']',_0x39f5bf[_0x69dd('0x14')]);_0x3feffc(_0x39f5bf);});});}function getUser(_0x300f6e,_0x2f8f55,_0xd5ede5){return function(_0x1d1f7f){return new Promise(function(_0xad131d,_0x594883){var _0x42c77a={'method':_0x69dd('0x15'),'uri':_0xd5ede5+'/api/selector/owners','json':!![]};_0x42c77a[_0x69dd('0x9')]=_0x2f8f55;logger[_0x69dd('0xf')](_0x69dd('0x16'));return rp(_0x42c77a)[_0x69dd('0xb')](function(_0x1cf93f){if(_0x1cf93f){var _0x1c7cb0=_0x1cf93f[_0x69dd('0xc')];var _0x1f7fd0=![];var _0x19ed3=null;if(_0x1d1f7f[_0x69dd('0x17')]!==null){logger[_0x69dd('0xf')]('Getting\x20user\x20with\x20email',_0x1d1f7f[_0x69dd('0x17')]);_0x1d1f7f['userEmail']=_0x1d1f7f[_0x69dd('0x17')];for(_0x19ed3=0x0;_0x19ed3<_0x1c7cb0[_0x69dd('0xd')];_0x19ed3++){if(_0x1c7cb0[_0x19ed3][_0x69dd('0xe')]===_0x1d1f7f[_0x69dd('0x17')]){_0x1f7fd0=!![];_0x1d1f7f[_0x69dd('0x18')]=_0x1c7cb0[_0x19ed3]['id'];logger[_0x69dd('0xf')](_0x69dd('0x19'),_0x1d1f7f[_0x69dd('0x18')]);}}}if(!_0x1f7fd0){logger[_0x69dd('0xf')](_0x69dd('0x1a'));_0x1d1f7f[_0x69dd('0x1b')]=_0x1d1f7f[_0x69dd('0x1c')];_0x1d1f7f[_0x69dd('0x18')]=_0x1d1f7f[_0x69dd('0x10')];_0x1f7fd0=!![];}if(_0x1f7fd0){_0xad131d(_0x1d1f7f);}else{_0x594883({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x594883({'statusCode':0x194,'message':_0x69dd('0x11')});}})[_0x69dd('0x12')](function(_0x177a78){logger[_0x69dd('0x13')]('['+[_0x300f6e[_0x69dd('0x1d')]()]+']',_0x177a78[_0x69dd('0x14')]);_0x594883(_0x177a78);});});};}function getEndUser(_0x393b90,_0x196718,_0x138190){return function(_0x26afc4){return new Promise(function(_0x5d0643,_0x4e338e){var _0x39edbb=0x0;var _0x1e00c3={'method':_0x69dd('0x15'),'uri':_0x138190+_0x69dd('0x1e'),'json':!![]};_0x1e00c3[_0x69dd('0x9')]=_0x196718;logger[_0x69dd('0xf')](_0x69dd('0x1f'));return rp(_0x1e00c3)[_0x69dd('0xb')](function(_0x4238c5){_0x4238c5['filters'][_0x69dd('0x20')](function(_0x47fd72){if(_0x47fd72['name']==='All\x20Contacts'){_0x39edbb=_0x47fd72['id'];}});})['then'](function(){logger[_0x69dd('0xf')](_0x69dd('0x21'));var _0x4ca000={'method':_0x69dd('0x15'),'uri':_0x138190+_0x69dd('0x22')+_0x39edbb,'json':!![]};_0x4ca000['headers']=_0x196718;return rp(_0x4ca000);})['then'](function(_0x1ef677){logger[_0x69dd('0xf')](_0x69dd('0x23'),_0x26afc4[_0x69dd('0x24')]);if(_0x1ef677[_0x69dd('0x25')]['length']>0x0){var _0x402d21=_[_0x69dd('0x26')](_0x1ef677['contacts'],function(_0x2b8ec3){if(_0x2b8ec3[_0x69dd('0x27')]===_0x26afc4['contactNumber']||_0x2b8ec3[_0x69dd('0x28')]===_0x26afc4[_0x69dd('0x24')]){return _0x2b8ec3;}});if(_0x402d21){_0x26afc4[_0x69dd('0x29')]=_0x402d21['id'];logger[_0x69dd('0xf')](_0x69dd('0x2a'),_0x26afc4[_0x69dd('0x29')]);_0x5d0643(_0x26afc4);}else{return createEndUser(_0x26afc4,_0x393b90,_0x196718,_0x138190)[_0x69dd('0xb')](function(_0x34345f){logger[_0x69dd('0xf')]('Contact\x20created:',_0x26afc4[_0x69dd('0x29')]);_0x5d0643(_0x34345f);});}}else{return createEndUser(_0x26afc4,_0x393b90,_0x196718,_0x138190)[_0x69dd('0xb')](function(_0x64bbec){logger['info'](_0x69dd('0x2b'),_0x26afc4[_0x69dd('0x29')]);_0x5d0643(_0x64bbec);});}})[_0x69dd('0x12')](function(_0x4ab24e){throw new Error(_0x4ab24e[_0x69dd('0x14')]);});});};}function createEndUser(_0x4ae801,_0x4dcc03,_0x474c6a,_0x3419f0){return new Promise(function(_0x356e0b,_0x4070d0){var _0x2d6bc1=moment();var _0x3cdd6a={'method':'POST','uri':_0x3419f0+_0x69dd('0x2c'),'body':{'contact':{'last_name':_0x4ae801[_0x69dd('0x24')],'work_number':_0x4ae801[_0x69dd('0x24')],'mobile_number':_0x4ae801[_0x69dd('0x24')],'owner_id':_0x4ae801[_0x69dd('0x18')],'created_at':_0x2d6bc1['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x3cdd6a[_0x69dd('0x9')]=_0x474c6a;logger[_0x69dd('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3cdd6a)[_0x69dd('0xb')](function(_0x25b99a){_0x4ae801[_0x69dd('0x29')]=_0x25b99a[_0x69dd('0x2d')]['id'];_0x356e0b(_0x4ae801);})[_0x69dd('0x12')](function(_0x3ca6f3){logger[_0x69dd('0x13')]('['+[_0x4dcc03[_0x69dd('0x1d')]()]+']',_0x3ca6f3[_0x69dd('0x14')]);_0x4070d0(_0x3ca6f3['message']);});});}function getTicket(_0x53b184,_0x3ead45,_0x275214,_0x4093e6,_0x5f0977){return function(_0x49ebe4){logger[_0x69dd('0xf')](_0x69dd('0x2e'));return new Promise(function(_0x1e0a68,_0x1158e6){var _0x57dca9=moment();var _0x1343d7={'method':_0x69dd('0x2f'),'uri':_0x275214+_0x69dd('0x30'),'body':{'title':intUtil[_0x69dd('0x31')](_0x4093e6[_0x69dd('0x32')],_0x5f0977,'\x20'),'description':intUtil[_0x69dd('0x31')](_0x4093e6[_0x69dd('0x33')],_0x5f0977,'\x0a'),'owner_id':_0x49ebe4[_0x69dd('0x18')],'creater_id':_0x49ebe4[_0x69dd('0x10')],'targetable_id':_0x49ebe4[_0x69dd('0x29')],'targetable_type':_0x69dd('0x34'),'created_at':_0x57dca9[_0x69dd('0x35')](_0x69dd('0x36')),'due_date':_0x57dca9[_0x69dd('0x37')](0x1e,'m')[_0x69dd('0x35')](_0x69dd('0x36'))},'json':!![]};_0x1343d7[_0x69dd('0x9')]=_0x3ead45;return rp(_0x1343d7)[_0x69dd('0xb')](function(_0x55cb22){_0x49ebe4[_0x69dd('0x38')]=_0x55cb22[_0x69dd('0x39')]['id'];logger[_0x69dd('0xf')]('Task\x20created:',_0x49ebe4[_0x69dd('0x38')]);_0x1e0a68(_0x49ebe4);})['catch'](function(_0x3b76a9){logger[_0x69dd('0x13')]('['+[_0x53b184[_0x69dd('0x1d')]()]+']',_0x3b76a9[_0x69dd('0x14')]);_0x1158e6(_0x3b76a9[_0x69dd('0x14')]);});});};}function emit(_0xf4cb7f,_0x3a424a,_0x355fa6){var _0x450da8={'uri':_0xf4cb7f+'/contacts/'+_0x355fa6};io['to'](util[_0x69dd('0x35')](_0x69dd('0x3a'),_0x3a424a))['emit'](_0x69dd('0x3b'),_0x450da8);}exports['cs']=function(_0x113475,_0x116c68,_0x1e969c,_0x148823,_0x147c01,_0x37057e,_0x5a2e4b,_0x22ba52){var _0x4e5ce9={};var _0x34d688={'Authorization':_0x69dd('0x3c')+_0x37057e['apiKey']};_0x37057e[_0x69dd('0x3d')]=intUtil[_0x69dd('0x3e')](_0x37057e[_0x69dd('0x3d')]);_0x37057e['serverUrl']=intUtil['stripTrailingSlash'](_0x37057e['serverUrl']);var _0x21c0ba=_0x37057e[_0x69dd('0x3d')];_0x4e5ce9[_0x69dd('0x1c')]=_0x37057e['username'];_0x4e5ce9[_0x69dd('0x24')]=_0x22ba52['toLowerCase']()==='outbound'?_0x116c68[_0x69dd('0x3f')]:_0x116c68['calleridnum'];_0x4e5ce9['callDirection']=_0x22ba52===_0x69dd('0x40')||_0x22ba52===_0x69dd('0x41')?'queue':_0x69dd('0x42');if(_0x148823){_0x4e5ce9['agentEmail']=_0x148823[_0x69dd('0xe')];}var _0x188b76=util[_0x69dd('0x35')](_0x69dd('0x43'),_0x37057e[_0x69dd('0x44')],_0x116c68[_0x69dd('0x45')],md5(_0x116c68[_0x69dd('0x45')]));if(_0x147c01&&_0x147c01[_0x69dd('0x46')]){logger['info'](_0x69dd('0x47'),_0x69dd('0x48'));_0x116c68['recordingURL']=_0x188b76;}else if(_0x5a2e4b&&_0x5a2e4b[_0x69dd('0x49')]&&_0x5a2e4b['recordingFormat']!=='none'){logger[_0x69dd('0xf')](_0x69dd('0x4a'),_0x69dd('0x48'));_0x116c68[_0x69dd('0x4b')]=_0x188b76;}else{_0x116c68['recordingURL']='';}return getAdminId(_0x4e5ce9,_0x22ba52,_0x34d688,_0x21c0ba)[_0x69dd('0xb')](getUser(_0x22ba52,_0x34d688,_0x21c0ba))['then'](getEndUser(_0x22ba52,_0x34d688,_0x21c0ba))[_0x69dd('0xb')](getTicket(_0x22ba52,_0x34d688,_0x21c0ba,_0x1e969c,_0x116c68))['then'](function(_0x4eb84a){logger['info'](util[_0x69dd('0x35')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4eb84a[_0x69dd('0x38')]));if(_0x22ba52!==_0x69dd('0x41')){logger[_0x69dd('0xf')]('['+[_0x22ba52[_0x69dd('0x1d')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x21c0ba,_0x148823[_0x69dd('0x4c')],_0x4eb84a[_0x69dd('0x29')]);}})[_0x69dd('0x12')](function(_0x242ab2){logger[_0x69dd('0x13')]('['+[_0x22ba52['toUpperCase']()]+_0x69dd('0x4d'),util[_0x69dd('0x4e')](_0x242ab2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 041604f..bc0dc8b 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0xd3f402,_0x5044d3){var _0x2772ea=function(_0x428080){while(--_0x428080){_0xd3f402['push'](_0xd3f402['shift']());}};_0x2772ea(++_0x5044d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x582733,_0x166403){var _0x4e5599=function(_0x2156d6){while(--_0x2156d6){_0x582733['push'](_0x582733['shift']());}};_0x4e5599(++_0x166403);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index f35eb20..010f7f9 100644 --- a/server/services/ami/trigger/integration/salesforce.js +++ b/server/services/ami/trigger/integration/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31be=['concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','stringify','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','[ABANDONED]','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','salesforce','redis','emit','ticketType','Task','assign','getString','Subjects','Descriptions','WhoId','Case','ContactId','create','validateEmail','sobject','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','contact_lead','Contact','Lead','contact','lead','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','type','string','idField','toString','variableName','customVariable','Variable','name','toLowerCase','password'];(function(_0x1fa2ca,_0x45df7e){var _0x27bacf=function(_0x22bb4f){while(--_0x22bb4f){_0x1fa2ca['push'](_0x1fa2ca['shift']());}};_0x27bacf(++_0x45df7e);}(_0x31be,0xfd));var _0xe31b=function(_0x20a3fd,_0x1e7e92){_0x20a3fd=_0x20a3fd-0x0;var _0x2b74b9=_0x31be[_0x20a3fd];return _0x2b74b9;};'use strict';var _=require('lodash');var rp=require(_0xe31b('0x0'));var moment=require(_0xe31b('0x1'));var BPromise=require(_0xe31b('0x2'));var md5=require(_0xe31b('0x3'));var jsforce=require(_0xe31b('0x4'));var util=require('util');var Redis=require(_0xe31b('0x5'));var intUtil=require(_0xe31b('0x6'));var config=require(_0xe31b('0x7'));var logger=require('../../../../config/logger')(_0xe31b('0x8'));config[_0xe31b('0x9')]=_['defaults'](config[_0xe31b('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe31b('0x9')]));function emit(_0x38b8e5,_0x15b0b6,_0x1c42d7){io['to'](_0x38b8e5)[_0xe31b('0xa')](_0x15b0b6,_0x1c42d7);}function getTicket(_0x2d05d3,_0x5abedb,_0x3f4e34,_0x566d36,_0x2791cc,_0x33de78,_0xeb94aa,_0x17c685){var _0xfe8076={};if(_0x566d36[_0xe31b('0xb')]===_0xe31b('0xc')){_0xfe8076=Object[_0xe31b('0xd')]({},{'OwnerId':_0x5abedb['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xe31b('0xe')](_0x566d36[_0xe31b('0xf')],_0x2791cc,'\x20'),'Description':intUtil[_0xe31b('0xe')](_0x566d36[_0xe31b('0x10')],_0x2791cc,'\x0a')},getCustomFields(_0x33de78,_0x2791cc));if(_0x3f4e34){_0xfe8076[_0xe31b('0x11')]=_0x3f4e34['id'];}}else if(_0x566d36['ticketType']===_0xe31b('0x12')){_0xfe8076=Object[_0xe31b('0xd')]({},{'OwnerId':_0x5abedb['id'],'Subject':intUtil[_0xe31b('0xe')](_0x566d36[_0xe31b('0xf')],_0x2791cc,'\x20'),'Description':intUtil[_0xe31b('0xe')](_0x566d36[_0xe31b('0x10')],_0x2791cc,'\x0a')},getCustomFields(_0x33de78,_0x2791cc));if(_0x3f4e34){_0xfe8076[_0xe31b('0x13')]=_0x3f4e34['id'];}}return _0xeb94aa['sobject'](_0x566d36[_0xe31b('0xb')])[_0xe31b('0x14')](_0xfe8076);}function getUser(_0x520842,_0x310462,_0x556b18){if(!_['isNil'](_0x310462)&&intUtil[_0xe31b('0x15')](_0x310462)){var _0x5debf0={'Email':_0x310462};var _0xcc1b2f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x556b18[_0xe31b('0x16')]('User')[_0xe31b('0x17')](_0x5debf0,_0xcc1b2f)[_0xe31b('0x18')]()[_0xe31b('0x19')](function(_0x4ecd72){if(_0x4ecd72[_0xe31b('0x1a')]){var _0x5b169e=_['find'](_0x4ecd72,function(_0x47a2de){return _0x47a2de[_0xe31b('0x1b')]===_0x310462;});if(_0x5b169e){logger[_0xe31b('0x1c')](_0xe31b('0x1d'),_0x310462);return BPromise[_0xe31b('0x1e')]({'id':_0x5b169e['Id'],'name':_0x5b169e[_0xe31b('0x1f')]});}}else{logger[_0xe31b('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x310462);return _0x556b18[_0xe31b('0x20')]()[_0xe31b('0x19')](function(_0x360c18){return BPromise[_0xe31b('0x1e')]({'id':_0x360c18[_0xe31b('0x21')],'name':_0x360c18[_0xe31b('0x22')]});});}});}else{logger[_0xe31b('0x1c')](_0xe31b('0x23'),_0x310462);return _0x556b18['identity']()[_0xe31b('0x19')](function(_0x5b6ed7){return BPromise[_0xe31b('0x1e')]({'id':_0x5b6ed7[_0xe31b('0x21')],'name':_0x5b6ed7['display_name']});});}}function getEndUser(_0x4df37c,_0x46338f,_0x52c3b5,_0x4f2784,_0x37e4f5){var _0xea72c={'Phone':_0x4f2784};var _0x22cfef={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){if(_0x46338f[_0xe31b('0xb')]==='Task'){logger[_0xe31b('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x4f2784,_0x46338f[_0xe31b('0x24')]);switch(_0x46338f['moduleSearch']){case _0xe31b('0x25'):return _0x37e4f5['sobject'](_0xe31b('0x26'))[_0xe31b('0x17')](_0xea72c,_0x22cfef)[_0xe31b('0x18')]()[_0xe31b('0x19')](function(_0x250746){if(_0x250746&&_0x250746[_0xe31b('0x1a')]){return _0x250746;}else{return _0x37e4f5[_0xe31b('0x16')](_0xe31b('0x27'))[_0xe31b('0x17')](_0xea72c,_0x22cfef);}});case _0xe31b('0x28'):return _0x37e4f5['sobject'](_0xe31b('0x26'))[_0xe31b('0x17')](_0xea72c,_0x22cfef)['execute']();case _0xe31b('0x29'):return _0x37e4f5['sobject'](_0xe31b('0x27'))[_0xe31b('0x17')](_0xea72c,_0x22cfef);default:return null;}}else if(_0x46338f[_0xe31b('0xb')]===_0xe31b('0x12')){logger[_0xe31b('0x1c')](_0xe31b('0x2a'),_0x4f2784,_0xe31b('0x28'));return _0x37e4f5[_0xe31b('0x16')](_0xe31b('0x26'))[_0xe31b('0x17')](_0xea72c,_0x22cfef)[_0xe31b('0x18')]();}})[_0xe31b('0x19')](function(_0x5272f8){if(_0x5272f8&&_0x5272f8['length']){var _0x32cd6a=_[_0xe31b('0x17')](_0x5272f8,function(_0x123db0){return _0x123db0['Phone']===_0x4f2784;});if(_0x32cd6a){return BPromise[_0xe31b('0x1e')]({'id':_0x32cd6a['Id'],'name':_0x32cd6a['Name'],'phone':_0x32cd6a[_0xe31b('0x2b')]});}}})[_0xe31b('0x19')](function(_0x2718ea){if(_0x2718ea){logger['info'](_0xe31b('0x2c'),_0x4f2784);return BPromise[_0xe31b('0x1e')](_0x2718ea);}else{logger[_0xe31b('0x1c')](_0xe31b('0x2d'),_0x4f2784);var _0x1ca0dc={'LastName':_0x52c3b5!==_0xe31b('0x2e')?_0x52c3b5:util[_0xe31b('0x2f')](_0xe31b('0x30'),_0x4f2784),'Phone':_0x4f2784};if(_0x46338f[_0xe31b('0x31')]){if(_0x46338f[_0xe31b('0x31')]===_0xe31b('0x28')){logger[_0xe31b('0x1c')](_0xe31b('0x32'),_0x4f2784,_0x46338f[_0xe31b('0x31')]);}else if(_0x46338f[_0xe31b('0x31')]===_0xe31b('0x29')&&_0x46338f[_0xe31b('0xb')]===_0xe31b('0xc')){logger[_0xe31b('0x1c')](_0xe31b('0x32'),_0x4f2784,_0x46338f[_0xe31b('0x31')]);_0x1ca0dc[_0xe31b('0x33')]=_0xe31b('0x34');}else{return null;}}return _0x37e4f5['sobject'](_[_0xe31b('0x35')](_0x46338f['moduleCreate']))[_0xe31b('0x14')](_0x1ca0dc);}});}function getCustomFields(_0x346c0f,_0x3a2fc5){var _0x31bfbe={};if(_0x346c0f[_0xe31b('0x1a')]>0x0){_[_0xe31b('0x36')](_0x346c0f,function(_0x231d55){if(_0x231d55[_0xe31b('0x37')]===_0xe31b('0x38')&&_0x231d55[_0xe31b('0x39')]){_0x31bfbe[_0x231d55['idField']]=_0x231d55['content'][_0xe31b('0x3a')]();}else if(_0x231d55[_0xe31b('0x37')]==='variable'&&_0x231d55[_0xe31b('0x3b')]&&_0x231d55['idField']){_0x3a2fc5[_0x231d55[_0xe31b('0x3b')]]&&(_0x31bfbe[_0x231d55[_0xe31b('0x39')]]=_0x3a2fc5[_0x231d55[_0xe31b('0x3b')]][_0xe31b('0x3a')]());}else if(_0x231d55[_0xe31b('0x37')]===_0xe31b('0x3c')&&_0x231d55['Variable']&&_0x231d55[_0xe31b('0x3d')][_0xe31b('0x3e')]&&_0x231d55[_0xe31b('0x39')]){_0x3a2fc5[_0x231d55['Variable'][_0xe31b('0x3e')][_0xe31b('0x3f')]()]&&(_0x31bfbe[_0x231d55['idField']]=_0x3a2fc5[_0x231d55[_0xe31b('0x3d')][_0xe31b('0x3e')]['toLowerCase']()][_0xe31b('0x3a')]());}});}return _0x31bfbe;}function getConnection(_0x956e74){var _0xb63d50=_0x956e74[_0xe31b('0x40')][_0xe31b('0x41')](_0x956e74[_0xe31b('0x42')]);var _0x2d76bb=new jsforce['Connection']({'oauth2':{'loginUrl':_0x956e74[_0xe31b('0x43')]||_0xe31b('0x44'),'clientId':_0x956e74[_0xe31b('0x45')],'clientSecret':_0x956e74[_0xe31b('0x46')]}});return _0x2d76bb[_0xe31b('0x47')](_0x956e74[_0xe31b('0x48')],_0xb63d50)[_0xe31b('0x19')](function(){logger[_0xe31b('0x1c')]('Connection\x20established.');return _0x2d76bb;});}exports[_0xe31b('0x49')]=function(_0x5660e8,_0x48dd75,_0x2bd211,_0x173191,_0x271d6c,_0xa4ce34){var _0xb2e83e,_0x39cb1d,_0x2ef76d,_0x384dcf;_0xa4ce34[_0xe31b('0x4a')]=intUtil[_0xe31b('0x4b')](_0xa4ce34[_0xe31b('0x4a')]);_0xa4ce34[_0xe31b('0x43')]=intUtil[_0xe31b('0x4b')](_0xa4ce34[_0xe31b('0x43')]);if(_0x271d6c&&_0x271d6c[_0xe31b('0x4c')]){logger[_0xe31b('0x1c')]('[QUEUE]','Recording\x20is\x20enabled!');_0x48dd75[_0xe31b('0x4d')]=util[_0xe31b('0x2f')](_0xe31b('0x4e'),_0xa4ce34[_0xe31b('0x4a')],_0x48dd75['uniqueid'],md5(_0x48dd75['uniqueid']));}else{_0x48dd75[_0xe31b('0x4d')]='';}return getConnection(_0xa4ce34)[_0xe31b('0x19')](function(_0x3f6597){_0x384dcf=_0x3f6597;return getUser(_0xa4ce34,_0x173191[_0xe31b('0x4f')],_0x384dcf);})['then'](function(_0x3e6882){_0xb2e83e=_0x3e6882;return getEndUser(_0xa4ce34,_0x2bd211,_0x48dd75[_0xe31b('0x50')],_0x48dd75[_0xe31b('0x51')],_0x384dcf);})[_0xe31b('0x19')](function(_0x169d43){_0x39cb1d=_0x169d43;return getTicket(_0xa4ce34,_0xb2e83e,_0x39cb1d,_0x2bd211,_0x48dd75,_0x2bd211[_0xe31b('0x52')],_0x384dcf,_0xe31b('0x49'));})[_0xe31b('0x19')](function(_0x435a21){_0x2ef76d=_0x435a21;logger[_0xe31b('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x2ef76d['id']);logger[_0xe31b('0x1c')](_0xe31b('0x53'),_0x2ef76d['id'],_0x173191['name'],_0xa4ce34[_0xe31b('0x37')]);switch(_0xa4ce34[_0xe31b('0x37')]){case'integrationTab':emit(util[_0xe31b('0x2f')](_0xe31b('0x54'),_0x173191['name']),_0xe31b('0x55'),{'recordId':_0x2ef76d['id']});break;case _0xe31b('0x56'):emit(util[_0xe31b('0x2f')]('user:%s',_0x173191['name']),'trigger:browser:url',{'uri':util['format'](_0xe31b('0x57'),_0x384dcf[_0xe31b('0x58')],_0x2ef76d['id'])});break;default:logger[_0xe31b('0x59')](_0xe31b('0x5a'));}})[_0xe31b('0x5b')](function(_0x1ec270){logger[_0xe31b('0x59')](_0xe31b('0x5c'),JSON[_0xe31b('0x5d')](_0x1ec270));});};exports[_0xe31b('0x5e')]=function(_0x8ecdec,_0x35568e,_0x10fec0,_0x4b76f4,_0x16c406,_0x5960de,_0x112129){var _0x1cf5d9,_0x40bc03,_0x49cf0b,_0x36407d;_0x5960de[_0xe31b('0x4a')]=intUtil[_0xe31b('0x4b')](_0x5960de['serverUrl']);_0x5960de[_0xe31b('0x43')]=intUtil[_0xe31b('0x4b')](_0x5960de[_0xe31b('0x43')]);if(_0x112129&&_0x112129[_0xe31b('0x5f')]&&_0x112129[_0xe31b('0x5f')]!=='none'){logger[_0xe31b('0x1c')](_0xe31b('0x60'),_0xe31b('0x61'));_0x35568e[_0xe31b('0x4d')]=util[_0xe31b('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5960de[_0xe31b('0x4a')],_0x35568e[_0xe31b('0x62')],md5(_0x35568e[_0xe31b('0x62')]));}return getConnection(_0x5960de)[_0xe31b('0x19')](function(_0x1a614e){_0x36407d=_0x1a614e;return getUser(_0x5960de,_0x4b76f4['email'],_0x36407d);})[_0xe31b('0x19')](function(_0x349b56){_0x1cf5d9=_0x349b56;return getEndUser(_0x5960de,_0x10fec0,_0x35568e[_0xe31b('0x63')],_0x35568e[_0xe31b('0x64')],_0x36407d);})['then'](function(_0x50b5a3){_0x40bc03=_0x50b5a3;return getTicket(_0x5960de,_0x1cf5d9,_0x40bc03,_0x10fec0,_0x35568e,_0x10fec0[_0xe31b('0x52')],_0x36407d,_0xe31b('0x5e'));})[_0xe31b('0x19')](function(_0x3a3747){_0x49cf0b=_0x3a3747;logger['info'](_0xe31b('0x65'),_0x49cf0b['id']);logger['info'](_0xe31b('0x66'),_0x49cf0b['id'],_0x4b76f4[_0xe31b('0x3e')],_0x5960de['type']);switch(_0x5960de[_0xe31b('0x37')]){case'integrationTab':emit(util[_0xe31b('0x2f')](_0xe31b('0x54'),_0x4b76f4['name']),_0xe31b('0x55'),{'recordId':_0x49cf0b['id']});break;case _0xe31b('0x56'):emit(util[_0xe31b('0x2f')](_0xe31b('0x54'),_0x4b76f4['name']),'trigger:browser:url',{'uri':util[_0xe31b('0x2f')]('%s/%s/e',_0x36407d[_0xe31b('0x58')],_0x49cf0b['id'])});break;default:logger[_0xe31b('0x59')](_0xe31b('0x60'),_0xe31b('0x67'));}})[_0xe31b('0x5b')](function(_0x4f4d0c){logger[_0xe31b('0x59')](_0xe31b('0x60'),JSON[_0xe31b('0x5d')](_0x4f4d0c));});};exports[_0xe31b('0x68')]=function(_0x1ba412,_0x60b540,_0x57820b,_0x434c2b,_0x50e54c,_0x563d70){var _0x8cea09,_0x1572e8,_0x311370,_0x5afcc2;_0x563d70[_0xe31b('0x4a')]=intUtil[_0xe31b('0x4b')](_0x563d70['serverUrl']);_0x563d70[_0xe31b('0x43')]=intUtil[_0xe31b('0x4b')](_0x563d70[_0xe31b('0x43')]);if(_0x50e54c&&_0x50e54c[_0xe31b('0x4c')]){logger[_0xe31b('0x1c')](_0xe31b('0x69'),_0xe31b('0x61'));_0x60b540['recordingURL']=util[_0xe31b('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x563d70[_0xe31b('0x4a')],_0x60b540[_0xe31b('0x62')],md5(_0x60b540[_0xe31b('0x62')]));}else{_0x60b540[_0xe31b('0x4d')]='';}return getConnection(_0x563d70)[_0xe31b('0x19')](function(_0x1ce4ea){_0x5afcc2=_0x1ce4ea;if(!_['isNil'](_0x434c2b)){return getUser(_0x563d70,_0x434c2b['name'],_0x5afcc2);}else{return getUser(_0x563d70,null,_0x5afcc2);}})[_0xe31b('0x19')](function(_0x5a6da6){_0x8cea09=_0x5a6da6;return getEndUser(_0x563d70,_0x57820b,_0x60b540[_0xe31b('0x50')],_0x60b540[_0xe31b('0x51')],_0x5afcc2);})[_0xe31b('0x19')](function(_0x3eff19){_0x1572e8=_0x3eff19;return getTicket(_0x563d70,_0x8cea09,_0x1572e8,_0x57820b,_0x60b540,_0x57820b[_0xe31b('0x52')],_0x5afcc2);})[_0xe31b('0x19')](function(_0x329516){_0x311370=_0x329516;logger['info']('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x311370['id']);logger[_0xe31b('0x1c')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x563d70[_0xe31b('0x37')]);})[_0xe31b('0x5b')](function(_0xbcb18f){logger['error'](_0xe31b('0x69'),JSON['stringify'](_0xbcb18f));});}; \ No newline at end of file +var _0xc6bb=['trigger:browser:url','%s/%s/e','instanceUrl','error','catch','recordingFormat','none','[OUTBOUND]','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','Task','utc','getString','Subjects','WhoId','ticketType','Case','assign','Descriptions','ContactId','sobject','isNil','validateEmail','User','find','execute','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','display_name','info','resolve','user_id','moduleSearch','contact_lead','Contact','length','Lead','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','type','string','idField','toString','variable','variableName','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','format','user:%s','trigger:salesforce:display'];(function(_0x2badfc,_0x21dec9){var _0x29f9cb=function(_0xed0f05){while(--_0xed0f05){_0x2badfc['push'](_0x2badfc['shift']());}};_0x29f9cb(++_0x21dec9);}(_0xc6bb,0xd9));var _0xbc6b=function(_0x447984,_0x561732){_0x447984=_0x447984-0x0;var _0x777ad9=_0xc6bb[_0x447984];return _0x777ad9;};'use strict';var _=require(_0xbc6b('0x0'));var rp=require(_0xbc6b('0x1'));var moment=require(_0xbc6b('0x2'));var BPromise=require(_0xbc6b('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require(_0xbc6b('0x4'));var intUtil=require(_0xbc6b('0x5'));var config=require(_0xbc6b('0x6'));var logger=require(_0xbc6b('0x7'))(_0xbc6b('0x8'));config[_0xbc6b('0x9')]=_[_0xbc6b('0xa')](config[_0xbc6b('0x9')],{'host':_0xbc6b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbc6b('0x9')]));function emit(_0x1cc7f0,_0x5e4809,_0x2672f2){io['to'](_0x1cc7f0)[_0xbc6b('0xc')](_0x5e4809,_0x2672f2);}function getTicket(_0x21218e,_0x57761b,_0x523cfa,_0x32e4a2,_0x2859f6,_0x274068,_0x376250,_0x5517a4){var _0x483235={};if(_0x32e4a2['ticketType']===_0xbc6b('0xd')){_0x483235=Object['assign']({},{'OwnerId':_0x57761b['id'],'ActivityDate':moment[_0xbc6b('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xbc6b('0xf')](_0x32e4a2[_0xbc6b('0x10')],_0x2859f6,'\x20'),'Description':intUtil[_0xbc6b('0xf')](_0x32e4a2['Descriptions'],_0x2859f6,'\x0a')},getCustomFields(_0x274068,_0x2859f6));if(_0x523cfa){_0x483235[_0xbc6b('0x11')]=_0x523cfa['id'];}}else if(_0x32e4a2[_0xbc6b('0x12')]===_0xbc6b('0x13')){_0x483235=Object[_0xbc6b('0x14')]({},{'OwnerId':_0x57761b['id'],'Subject':intUtil[_0xbc6b('0xf')](_0x32e4a2[_0xbc6b('0x10')],_0x2859f6,'\x20'),'Description':intUtil[_0xbc6b('0xf')](_0x32e4a2[_0xbc6b('0x15')],_0x2859f6,'\x0a')},getCustomFields(_0x274068,_0x2859f6));if(_0x523cfa){_0x483235[_0xbc6b('0x16')]=_0x523cfa['id'];}}return _0x376250[_0xbc6b('0x17')](_0x32e4a2['ticketType'])['create'](_0x483235);}function getUser(_0xff7257,_0x45decd,_0x47646c){if(!_[_0xbc6b('0x18')](_0x45decd)&&intUtil[_0xbc6b('0x19')](_0x45decd)){var _0x23a77c={'Email':_0x45decd};var _0x209d50={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x47646c[_0xbc6b('0x17')](_0xbc6b('0x1a'))[_0xbc6b('0x1b')](_0x23a77c,_0x209d50)[_0xbc6b('0x1c')]()['then'](function(_0x5dc7c5){if(_0x5dc7c5['length']){var _0x25cc28=_['find'](_0x5dc7c5,function(_0x4bddb2){return _0x4bddb2['Email']===_0x45decd;});if(_0x25cc28){logger['info']('Agent\x20%s\x20found.',_0x45decd);return BPromise['resolve']({'id':_0x25cc28['Id'],'name':_0x25cc28[_0xbc6b('0x1d')]});}}else{logger['info'](_0xbc6b('0x1e'),_0x45decd);return _0x47646c[_0xbc6b('0x1f')]()[_0xbc6b('0x20')](function(_0x319b75){return BPromise['resolve']({'id':_0x319b75['user_id'],'name':_0x319b75[_0xbc6b('0x21')]});});}});}else{logger[_0xbc6b('0x22')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x45decd);return _0x47646c[_0xbc6b('0x1f')]()['then'](function(_0x3bbdaa){return BPromise[_0xbc6b('0x23')]({'id':_0x3bbdaa[_0xbc6b('0x24')],'name':_0x3bbdaa[_0xbc6b('0x21')]});});}}function getEndUser(_0x20e74b,_0x139a02,_0x5be8e4,_0x2ee584,_0x3b30a3){var _0x71a5e7={'Phone':_0x2ee584};var _0x933ee2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbc6b('0x23')]()[_0xbc6b('0x20')](function(){if(_0x139a02[_0xbc6b('0x12')]===_0xbc6b('0xd')){logger[_0xbc6b('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x2ee584,_0x139a02[_0xbc6b('0x25')]);switch(_0x139a02[_0xbc6b('0x25')]){case _0xbc6b('0x26'):return _0x3b30a3[_0xbc6b('0x17')](_0xbc6b('0x27'))['find'](_0x71a5e7,_0x933ee2)[_0xbc6b('0x1c')]()[_0xbc6b('0x20')](function(_0x587a9e){if(_0x587a9e&&_0x587a9e[_0xbc6b('0x28')]){return _0x587a9e;}else{return _0x3b30a3['sobject'](_0xbc6b('0x29'))[_0xbc6b('0x1b')](_0x71a5e7,_0x933ee2);}});case _0xbc6b('0x2a'):return _0x3b30a3[_0xbc6b('0x17')](_0xbc6b('0x27'))[_0xbc6b('0x1b')](_0x71a5e7,_0x933ee2)[_0xbc6b('0x1c')]();case'lead':return _0x3b30a3[_0xbc6b('0x17')](_0xbc6b('0x29'))['find'](_0x71a5e7,_0x933ee2);default:return null;}}else if(_0x139a02[_0xbc6b('0x12')]===_0xbc6b('0x13')){logger[_0xbc6b('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x2ee584,_0xbc6b('0x2a'));return _0x3b30a3['sobject']('Contact')['find'](_0x71a5e7,_0x933ee2)[_0xbc6b('0x1c')]();}})[_0xbc6b('0x20')](function(_0xb279ba){if(_0xb279ba&&_0xb279ba['length']){var _0x56fa65=_[_0xbc6b('0x1b')](_0xb279ba,function(_0x514eeb){return _0x514eeb['Phone']===_0x2ee584;});if(_0x56fa65){return BPromise[_0xbc6b('0x23')]({'id':_0x56fa65['Id'],'name':_0x56fa65[_0xbc6b('0x1d')],'phone':_0x56fa65[_0xbc6b('0x2b')]});}}})['then'](function(_0x44a187){if(_0x44a187){logger[_0xbc6b('0x22')](_0xbc6b('0x2c'),_0x2ee584);return BPromise[_0xbc6b('0x23')](_0x44a187);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x2ee584);var _0x2c2641={'LastName':_0x5be8e4!==_0xbc6b('0x2d')?_0x5be8e4:util['format'](_0xbc6b('0x2e'),_0x2ee584),'Phone':_0x2ee584};if(_0x139a02[_0xbc6b('0x2f')]){if(_0x139a02[_0xbc6b('0x2f')]===_0xbc6b('0x2a')){logger['info'](_0xbc6b('0x30'),_0x2ee584,_0x139a02[_0xbc6b('0x2f')]);}else if(_0x139a02[_0xbc6b('0x2f')]==='lead'&&_0x139a02[_0xbc6b('0x12')]===_0xbc6b('0xd')){logger['info'](_0xbc6b('0x30'),_0x2ee584,_0x139a02['moduleCreate']);_0x2c2641[_0xbc6b('0x31')]=_0xbc6b('0x32');}else{return null;}}return _0x3b30a3[_0xbc6b('0x17')](_[_0xbc6b('0x33')](_0x139a02[_0xbc6b('0x2f')]))['create'](_0x2c2641);}});}function getCustomFields(_0x110ca9,_0x6d0292){var _0x4c31b8={};if(_0x110ca9[_0xbc6b('0x28')]>0x0){_['forEach'](_0x110ca9,function(_0x1d145e){if(_0x1d145e[_0xbc6b('0x34')]===_0xbc6b('0x35')&&_0x1d145e[_0xbc6b('0x36')]){_0x4c31b8[_0x1d145e[_0xbc6b('0x36')]]=_0x1d145e['content'][_0xbc6b('0x37')]();}else if(_0x1d145e[_0xbc6b('0x34')]===_0xbc6b('0x38')&&_0x1d145e[_0xbc6b('0x39')]&&_0x1d145e[_0xbc6b('0x36')]){_0x6d0292[_0x1d145e[_0xbc6b('0x39')]]&&(_0x4c31b8[_0x1d145e[_0xbc6b('0x36')]]=_0x6d0292[_0x1d145e[_0xbc6b('0x39')]][_0xbc6b('0x37')]());}else if(_0x1d145e[_0xbc6b('0x34')]==='customVariable'&&_0x1d145e[_0xbc6b('0x3a')]&&_0x1d145e[_0xbc6b('0x3a')]['name']&&_0x1d145e[_0xbc6b('0x36')]){_0x6d0292[_0x1d145e[_0xbc6b('0x3a')][_0xbc6b('0x3b')]['toLowerCase']()]&&(_0x4c31b8[_0x1d145e[_0xbc6b('0x36')]]=_0x6d0292[_0x1d145e['Variable'][_0xbc6b('0x3b')]['toLowerCase']()]['toString']());}});}return _0x4c31b8;}function getConnection(_0x27ae83){var _0x333529=_0x27ae83[_0xbc6b('0x3c')][_0xbc6b('0x3d')](_0x27ae83['securityToken']);var _0x1fe070=new jsforce['Connection']({'oauth2':{'loginUrl':_0x27ae83[_0xbc6b('0x3e')]||_0xbc6b('0x3f'),'clientId':_0x27ae83[_0xbc6b('0x40')],'clientSecret':_0x27ae83[_0xbc6b('0x41')]}});return _0x1fe070['login'](_0x27ae83[_0xbc6b('0x42')],_0x333529)[_0xbc6b('0x20')](function(){logger[_0xbc6b('0x22')](_0xbc6b('0x43'));return _0x1fe070;});}exports['queue']=function(_0x33dafa,_0x1d6191,_0x368e32,_0x2e4068,_0x39d8e9,_0x336bf3){var _0x1d475,_0x2b190d,_0x2ba318,_0x4ecd87;_0x336bf3[_0xbc6b('0x44')]=intUtil[_0xbc6b('0x45')](_0x336bf3[_0xbc6b('0x44')]);_0x336bf3[_0xbc6b('0x3e')]=intUtil['stripTrailingSlash'](_0x336bf3[_0xbc6b('0x3e')]);if(_0x39d8e9&&_0x39d8e9['monitor_format']){logger['info'](_0xbc6b('0x46'),_0xbc6b('0x47'));_0x1d6191[_0xbc6b('0x48')]=util['format'](_0xbc6b('0x49'),_0x336bf3[_0xbc6b('0x44')],_0x1d6191[_0xbc6b('0x4a')],md5(_0x1d6191[_0xbc6b('0x4a')]));}else{_0x1d6191['recordingURL']='';}return getConnection(_0x336bf3)[_0xbc6b('0x20')](function(_0x25ca6d){_0x4ecd87=_0x25ca6d;return getUser(_0x336bf3,_0x2e4068[_0xbc6b('0x4b')],_0x4ecd87);})[_0xbc6b('0x20')](function(_0x41dece){_0x1d475=_0x41dece;return getEndUser(_0x336bf3,_0x368e32,_0x1d6191[_0xbc6b('0x4c')],_0x1d6191[_0xbc6b('0x4d')],_0x4ecd87);})[_0xbc6b('0x20')](function(_0xfab6e0){_0x2b190d=_0xfab6e0;return getTicket(_0x336bf3,_0x1d475,_0x2b190d,_0x368e32,_0x1d6191,_0x368e32[_0xbc6b('0x4e')],_0x4ecd87,_0xbc6b('0x4f'));})['then'](function(_0x427942){_0x2ba318=_0x427942;logger[_0xbc6b('0x22')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x2ba318['id']);logger[_0xbc6b('0x22')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2ba318['id'],_0x2e4068[_0xbc6b('0x3b')],_0x336bf3['type']);switch(_0x336bf3['type']){case'integrationTab':emit(util[_0xbc6b('0x50')](_0xbc6b('0x51'),_0x2e4068[_0xbc6b('0x3b')]),_0xbc6b('0x52'),{'recordId':_0x2ba318['id']});break;case'newTab':emit(util[_0xbc6b('0x50')]('user:%s',_0x2e4068[_0xbc6b('0x3b')]),_0xbc6b('0x53'),{'uri':util[_0xbc6b('0x50')](_0xbc6b('0x54'),_0x4ecd87[_0xbc6b('0x55')],_0x2ba318['id'])});break;default:logger[_0xbc6b('0x56')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xbc6b('0x57')](function(_0x2c9c35){logger['error']('[QUEUE]',JSON['stringify'](_0x2c9c35));});};exports['outbound']=function(_0xbc1ed9,_0x5ec030,_0x16609c,_0x3724a1,_0x4c862e,_0x16c1af,_0x3fa539){var _0x2f659d,_0xbc3fce,_0x498255,_0x59f5ff;_0x16c1af[_0xbc6b('0x44')]=intUtil['stripTrailingSlash'](_0x16c1af[_0xbc6b('0x44')]);_0x16c1af[_0xbc6b('0x3e')]=intUtil[_0xbc6b('0x45')](_0x16c1af[_0xbc6b('0x3e')]);if(_0x3fa539&&_0x3fa539['recordingFormat']&&_0x3fa539[_0xbc6b('0x58')]!==_0xbc6b('0x59')){logger[_0xbc6b('0x22')](_0xbc6b('0x5a'),_0xbc6b('0x47'));_0x5ec030[_0xbc6b('0x48')]=util[_0xbc6b('0x50')](_0xbc6b('0x49'),_0x16c1af['serverUrl'],_0x5ec030['uniqueid'],md5(_0x5ec030[_0xbc6b('0x4a')]));}return getConnection(_0x16c1af)[_0xbc6b('0x20')](function(_0x55c82d){_0x59f5ff=_0x55c82d;return getUser(_0x16c1af,_0x3724a1[_0xbc6b('0x4b')],_0x59f5ff);})[_0xbc6b('0x20')](function(_0x5a19eb){_0x2f659d=_0x5a19eb;return getEndUser(_0x16c1af,_0x16609c,_0x5ec030['destcalleridname'],_0x5ec030[_0xbc6b('0x5b')],_0x59f5ff);})[_0xbc6b('0x20')](function(_0xc95022){_0xbc3fce=_0xc95022;return getTicket(_0x16c1af,_0x2f659d,_0xbc3fce,_0x16609c,_0x5ec030,_0x16609c[_0xbc6b('0x4e')],_0x59f5ff,_0xbc6b('0x5c'));})['then'](function(_0x3a1acc){_0x498255=_0x3a1acc;logger[_0xbc6b('0x22')](_0xbc6b('0x5d'),_0x498255['id']);logger[_0xbc6b('0x22')](_0xbc6b('0x5e'),_0x498255['id'],_0x3724a1[_0xbc6b('0x3b')],_0x16c1af[_0xbc6b('0x34')]);switch(_0x16c1af[_0xbc6b('0x34')]){case'integrationTab':emit(util[_0xbc6b('0x50')]('user:%s',_0x3724a1['name']),_0xbc6b('0x52'),{'recordId':_0x498255['id']});break;case _0xbc6b('0x5f'):emit(util[_0xbc6b('0x50')](_0xbc6b('0x51'),_0x3724a1[_0xbc6b('0x3b')]),'trigger:browser:url',{'uri':util[_0xbc6b('0x50')]('%s/%s/e',_0x59f5ff[_0xbc6b('0x55')],_0x498255['id'])});break;default:logger['error'](_0xbc6b('0x5a'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xbc6b('0x57')](function(_0x1e5157){logger[_0xbc6b('0x56')](_0xbc6b('0x5a'),JSON[_0xbc6b('0x60')](_0x1e5157));});};exports[_0xbc6b('0x61')]=function(_0x3f6990,_0x50b791,_0x351153,_0xbf1e6b,_0x587d6f,_0x51f038){var _0x4bc9e6,_0xa932c3,_0xf972d4,_0x34f5f7;_0x51f038['serverUrl']=intUtil[_0xbc6b('0x45')](_0x51f038[_0xbc6b('0x44')]);_0x51f038[_0xbc6b('0x3e')]=intUtil['stripTrailingSlash'](_0x51f038[_0xbc6b('0x3e')]);if(_0x587d6f&&_0x587d6f['monitor_format']){logger['info'](_0xbc6b('0x62'),_0xbc6b('0x47'));_0x50b791['recordingURL']=util[_0xbc6b('0x50')](_0xbc6b('0x49'),_0x51f038[_0xbc6b('0x44')],_0x50b791[_0xbc6b('0x4a')],md5(_0x50b791[_0xbc6b('0x4a')]));}else{_0x50b791[_0xbc6b('0x48')]='';}return getConnection(_0x51f038)[_0xbc6b('0x20')](function(_0xbc743a){_0x34f5f7=_0xbc743a;if(!_[_0xbc6b('0x18')](_0xbf1e6b)){return getUser(_0x51f038,_0xbf1e6b['name'],_0x34f5f7);}else{return getUser(_0x51f038,null,_0x34f5f7);}})[_0xbc6b('0x20')](function(_0x283adf){_0x4bc9e6=_0x283adf;return getEndUser(_0x51f038,_0x351153,_0x50b791[_0xbc6b('0x4c')],_0x50b791['calleridnum'],_0x34f5f7);})[_0xbc6b('0x20')](function(_0x41a2fd){_0xa932c3=_0x41a2fd;return getTicket(_0x51f038,_0x4bc9e6,_0xa932c3,_0x351153,_0x50b791,_0x351153[_0xbc6b('0x4e')],_0x34f5f7);})['then'](function(_0x153200){_0xf972d4=_0x153200;logger[_0xbc6b('0x22')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0xf972d4['id']);logger['info'](_0xbc6b('0x63'),_0x51f038['type']);})[_0xbc6b('0x57')](function(_0x1d3198){logger[_0xbc6b('0x56')](_0xbc6b('0x62'),JSON[_0xbc6b('0x60')](_0x1d3198));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index 342c8bb..700d7fd 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 3df4d26..896652e 100644 --- a/server/services/ami/trigger/integration/sugarcrm.js +++ b/server/services/ami/trigger/integration/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7ee=['stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','Enduser\x20found!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','nameField','customField','content','type','custom_fields','variable','push','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','abandoned','[ABANDONED]','lodash','bluebird','ioredis','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_minutes','parent_id','Contacts','parent_name','direction','forEach','variableName','idField','set_entry','JSON'];(function(_0x1857c8,_0x49b887){var _0x5c7288=function(_0x1cb5dc){while(--_0x1cb5dc){_0x1857c8['push'](_0x1857c8['shift']());}};_0x5c7288(++_0x49b887);}(_0xc7ee,0xd4));var _0xec7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7ee[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec7e('0x0'));var rp=require('request-promise');var BPromise=require(_0xec7e('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xec7e('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('sugarcrm');config[_0xec7e('0x3')]=_[_0xec7e('0x4')](config[_0xec7e('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xec7e('0x5'))(new Redis(config[_0xec7e('0x3')]));var def={'method':_0xec7e('0x6'),'json':!![]};function emit(_0x25b41c,_0x4875b1,_0x8f550a){io['to'](_0x25b41c)[_0xec7e('0x7')](_0x4875b1,_0x8f550a);}function getTicket(_0x476208,_0x5b0775,_0x212ad2,_0x6a633f,_0x8567d3,_0x4d2dba,_0x29ab6f,_0x1bb691){logger[_0xec7e('0x8')](_0xec7e('0x9'));var _0xbbef5c=new Date();var _0x2d1087=[{'name':_0xec7e('0xa'),'value':intUtil[_0xec7e('0xb')](_0x6a633f[_0xec7e('0xc')],_0x8567d3,'\x20')},{'name':_0xec7e('0xd'),'value':_0x5b0775['id']},{'name':_0xec7e('0xe'),'value':_0x5b0775['id']},{'name':_0xec7e('0xf'),'value':intUtil[_0xec7e('0xb')](_0x6a633f[_0xec7e('0x10')],_0x8567d3,'\x0a')},{'name':_0xec7e('0x11'),'value':_0xbbef5c['toISOString']()[_0xec7e('0x12')](0x0,0x13)[_0xec7e('0x13')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xec7e('0x14'),'value':'15'},{'name':_0xec7e('0x15'),'value':_0x212ad2['id']},{'name':'parent_type','value':_0xec7e('0x16')},{'name':_0xec7e('0x17'),'value':_0x212ad2['name']},{'name':_0xec7e('0x18'),'value':_0x1bb691}];if(_0x4d2dba['length']){_[_0xec7e('0x19')](_0x4d2dba,function(_0x2b6d5d){if(_0x8567d3[_0x2b6d5d[_0xec7e('0x1a')]]){_0x2d1087['push']({'name':_0x2b6d5d[_0xec7e('0x1b')],'value':_0x8567d3[_0x2b6d5d[_0xec7e('0x1a')]]});}});}return request({'form':{'method':_0xec7e('0x1c'),'input_type':_0xec7e('0x1d'),'response_type':'JSON','rest_data':JSON[_0xec7e('0x1e')]({'session':_0x29ab6f['id'],'module_name':_0xec7e('0x1f'),'name_value_list':_0x2d1087})}});}function getAuth(_0x36d589){return util[_0xec7e('0x20')](_0xec7e('0x21'),new Buffer(_0x36d589[_0xec7e('0x22')]+':X')[_0xec7e('0x23')](_0xec7e('0x24')));}function getServerInfo(_0x581f8d){return request({'form':{'method':'get_server_info','input_type':_0xec7e('0x1d'),'response_type':_0xec7e('0x1d'),'rest_data':JSON['stringify']({'session':_0x581f8d['id']})}});}function getUser(_0x4cd59b,_0x16765e,_0x152626){if(!_[_0xec7e('0x25')](_0x16765e)){logger['info'](_0xec7e('0x26'),_0x16765e);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xec7e('0x1d'),'rest_data':JSON['stringify']({'session':_0x152626['id'],'module_name':_0xec7e('0x27'),'query':util[_0xec7e('0x20')](_0xec7e('0x28'),_0x16765e),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xec7e('0x29')](function(_0x3cb5dc){if(_0x3cb5dc[_0xec7e('0x2a')]['length']){var _0x81774b=_[_0xec7e('0x2b')](_0x3cb5dc[_0xec7e('0x2a')],function(_0x52d02d){return _0x52d02d[_0xec7e('0x2c')][_0xec7e('0x2d')][_0xec7e('0x2e')]===_0x16765e;});if(_0x81774b){logger[_0xec7e('0x8')](_0xec7e('0x2f'));return BPromise[_0xec7e('0x30')]({'id':_0x81774b[_0xec7e('0x2c')]['id'][_0xec7e('0x2e')],'name':_0x81774b[_0xec7e('0x2c')][_0xec7e('0xa')][_0xec7e('0x2e')]});}}logger[_0xec7e('0x8')](_0xec7e('0x31'));return BPromise[_0xec7e('0x30')]({'id':_0x152626['name_value_list'][_0xec7e('0x32')][_0xec7e('0x2e')],'name':_0x152626[_0xec7e('0x2c')][_0xec7e('0x2d')]['value']});});}else{logger[_0xec7e('0x8')](_0xec7e('0x33'));return BPromise[_0xec7e('0x30')]({'id':_0x152626['name_value_list'][_0xec7e('0x32')][_0xec7e('0x2e')],'name':_0x152626[_0xec7e('0x2c')][_0xec7e('0x2d')][_0xec7e('0x2e')]});}}function getEndUser(_0x352dd7,_0x606eee,_0x2dce3e,_0x14f751){logger[_0xec7e('0x8')](_0xec7e('0x34'),_0x2dce3e);return request({'form':{'method':'get_entry_list','input_type':_0xec7e('0x1d'),'response_type':_0xec7e('0x1d'),'rest_data':JSON[_0xec7e('0x1e')]({'session':_0x14f751['id'],'module_name':'Contacts','query':util[_0xec7e('0x20')](_0xec7e('0x35'),_0x2dce3e),'order_by':'','offset':'0','select_fields':['id','name',_0xec7e('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xec7e('0x29')](function(_0x59d56b){if(_0x59d56b[_0xec7e('0x2a')][_0xec7e('0x37')]){var _0x5159d4=_['find'](_0x59d56b['entry_list'],function(_0x2857c0){return _0x2857c0['name_value_list'][_0xec7e('0x36')][_0xec7e('0x2e')]===_0x2dce3e;});if(_0x5159d4){logger[_0xec7e('0x8')](_0xec7e('0x38'));return BPromise[_0xec7e('0x30')]({'id':_0x5159d4[_0xec7e('0x2c')]['id'][_0xec7e('0x2e')],'name':_0x5159d4[_0xec7e('0x2c')][_0xec7e('0xa')][_0xec7e('0x2e')],'phone':_0x5159d4[_0xec7e('0x2c')][_0xec7e('0x36')][_0xec7e('0x2e')]});}}else{logger[_0xec7e('0x8')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xec7e('0x1c'),'input_type':'JSON','response_type':_0xec7e('0x1d'),'rest_data':JSON['stringify']({'session':_0x14f751['id'],'module_name':_0xec7e('0x16'),'name_value_list':[{'name':_0xec7e('0x39'),'value':_0x606eee!==_0xec7e('0x3a')?_0x606eee:util[_0xec7e('0x20')](_0xec7e('0x3b'),_0x2dce3e)},{'name':_0xec7e('0x36'),'value':_0x2dce3e}]})}})[_0xec7e('0x29')](function(_0xad7e8b){logger['info'](_0xec7e('0x3c'));return BPromise[_0xec7e('0x30')]({'id':_0xad7e8b['id'],'name':_0xad7e8b['entry_list'][_0xec7e('0x39')]['value'],'phone':_0xad7e8b[_0xec7e('0x2a')][_0xec7e('0x36')][_0xec7e('0x2e')]});});}});}function request(_0x30984b){logger[_0xec7e('0x3d')](_0xec7e('0x3e'),JSON['stringify'](_0x30984b));return rp(_[_0xec7e('0x3f')](def,_0x30984b));}function getTags(_0x372e01,_0x4528ee){var _0x52b73e=[];if(_0x372e01&&_0x372e01[_0xec7e('0x37')]>0x0){_0x52b73e=_[_0xec7e('0x40')](_0x372e01,_0x4528ee);}return _0x52b73e;}function getCustomFields(_0x1eebea,_0xa84654){var _0x2d110c=[];var _0x167944={'custom_fields':[]};if(_0x1eebea[_0xec7e('0x37')]>0x0){_['forEach'](_0x1eebea,function(_0x29b8c9){if(_0x29b8c9['type']===_0xec7e('0x41')&&_0x29b8c9[_0xec7e('0x42')]&&!_0x29b8c9[_0xec7e('0x43')]){_0x167944[_0x29b8c9['nameField']['toLowerCase']()]=_0x29b8c9[_0xec7e('0x44')][_0xec7e('0x23')]();}else if(_0x29b8c9[_0xec7e('0x45')]==='string'&&_0x29b8c9[_0xec7e('0x1b')]&&_0x29b8c9['customField']){_0x167944[_0xec7e('0x46')]['push']({'id':_0x29b8c9[_0xec7e('0x1b')],'value':_0x29b8c9[_0xec7e('0x44')]['toString']()});}else if(_0x29b8c9[_0xec7e('0x45')]===_0xec7e('0x47')&&_0x29b8c9[_0xec7e('0x1a')]&&_0x29b8c9['idField']&&_0x29b8c9[_0xec7e('0x43')]){_0xa84654[_0x29b8c9[_0xec7e('0x1a')]]&&_0x167944['custom_fields'][_0xec7e('0x48')]({'id':_0x29b8c9[_0xec7e('0x1b')],'value':_0xa84654[_0x29b8c9[_0xec7e('0x1a')]][_0xec7e('0x23')]()});}else if(_0x29b8c9[_0xec7e('0x45')]===_0xec7e('0x49')&&_0x29b8c9[_0xec7e('0x4a')]&&_0x29b8c9[_0xec7e('0x4a')][_0xec7e('0xa')]&&_0x29b8c9[_0xec7e('0x1b')]&&_0x29b8c9[_0xec7e('0x43')]){_0xa84654[_0x29b8c9[_0xec7e('0x4a')]['name'][_0xec7e('0x4b')]()]&&_0x167944[_0xec7e('0x46')][_0xec7e('0x48')]({'id':_0x29b8c9[_0xec7e('0x1b')],'value':_0xa84654[_0x29b8c9[_0xec7e('0x4a')][_0xec7e('0xa')][_0xec7e('0x4b')]()][_0xec7e('0x23')]()});}});}return _0x167944;}function getConnection(_0x36db70){return request({'method':_0xec7e('0x6'),'form':{'method':_0xec7e('0x4c'),'input_type':_0xec7e('0x1d'),'response_type':_0xec7e('0x1d'),'rest_data':JSON[_0xec7e('0x1e')]({'user_auth':{'user_name':_0x36db70[_0xec7e('0x4d')],'password':_0x36db70[_0xec7e('0x4e')],'encryption':_0xec7e('0x4f')},'application':_0xec7e('0x50')})}})[_0xec7e('0x29')](function(_0x4b887b){var _0x4b45e3=_0x4b887b;if(_0x4b45e3['id']){def['sessionID']=_0x4b45e3['id'];return BPromise[_0xec7e('0x30')](_0x4b45e3);}else{throw new Error(util[_0xec7e('0x20')](_0xec7e('0x51'),_0x36db70['id']));}});}function setRelationship(_0x52ffe7,_0x477fd5,_0xe5268,_0x5c7290){return request({'form':{'method':_0xec7e('0x52'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xec7e('0x1e')]({'session':_0x52ffe7['id'],'module_name':_0xec7e('0x1f'),'module_id':_0xe5268['id'],'link_field_name':_0x5c7290,'related_ids':[_0x477fd5['id']]})}});}exports[_0xec7e('0x53')]=function(_0xf48b83,_0x96a77e,_0x2e7e3d,_0x8446ef,_0x3d04ab,_0x258063){var _0x35b9f2,_0x1d1547,_0xbdfa34,_0xc6dc7e;_0x258063[_0xec7e('0x54')]=intUtil['stripTrailingSlash'](_0x258063['remoteUri']);_0x258063[_0xec7e('0x55')]=intUtil[_0xec7e('0x56')](_0x258063[_0xec7e('0x55')]);def[_0xec7e('0x57')]=util['format'](_0xec7e('0x58'),_0x258063[_0xec7e('0x54')]);if(_0x3d04ab&&_0x3d04ab[_0xec7e('0x59')]){logger[_0xec7e('0x8')](_0xec7e('0x5a'),_0xec7e('0x5b'));_0x96a77e['recordingURL']=util[_0xec7e('0x20')](_0xec7e('0x5c'),_0x258063['serverUrl'],_0x96a77e[_0xec7e('0x5d')],md5(_0x96a77e[_0xec7e('0x5d')]));}else{_0x96a77e[_0xec7e('0x5e')]='';}return getConnection(_0x258063)['then'](function(_0x53a519){_0xc6dc7e=_0x53a519;return getUser(_0x258063,_0x8446ef['name'],_0xc6dc7e);})[_0xec7e('0x29')](function(_0x20b768){_0x35b9f2=_0x20b768;logger['info'](_0xec7e('0x5f'),_0x35b9f2['id']);return getEndUser(_0x258063,_0x96a77e[_0xec7e('0x60')],_0x96a77e[_0xec7e('0x61')],_0xc6dc7e);})[_0xec7e('0x29')](function(_0x3eb37b){_0x1d1547=_0x3eb37b;logger[_0xec7e('0x8')]('The\x20Enduser\x20ID\x20is:',_0x1d1547['id']);return getTicket(_0x258063,_0x35b9f2,_0x1d1547,_0x2e7e3d,_0x96a77e,_0x2e7e3d[_0xec7e('0x62')],_0xc6dc7e,_0xec7e('0x63'));})[_0xec7e('0x29')](function(_0x22e32f){_0xbdfa34=_0x22e32f;logger[_0xec7e('0x8')](_0xec7e('0x64'));logger[_0xec7e('0x8')](_0xec7e('0x65'),_0xbdfa34['id']);return setRelationship(_0xc6dc7e,_0x35b9f2,_0xbdfa34,_0xec7e('0x66'));})[_0xec7e('0x29')](function(){return setRelationship(_0xc6dc7e,_0x1d1547,_0xbdfa34,_0xec7e('0x67'));})[_0xec7e('0x29')](function(){return getServerInfo(_0xc6dc7e);})[_0xec7e('0x29')](function(_0x4d4c42){var _0x2f6c11=parseInt(_0x4d4c42[_0xec7e('0x68')]['charAt'](0x0));var _0xc4c3ea=util[_0xec7e('0x20')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x258063[_0xec7e('0x54')],_0xbdfa34['id']);if(_0x2f6c11>0x6){_0xc4c3ea=util[_0xec7e('0x20')](_0xec7e('0x69'),_0x258063[_0xec7e('0x54')],_0xbdfa34['id']);}logger[_0xec7e('0x8')](_0xec7e('0x5a'),_0xec7e('0x6a'));emit(util[_0xec7e('0x20')](_0xec7e('0x6b'),_0x8446ef['name']),_0xec7e('0x6c'),{'uri':_0xc4c3ea});})[_0xec7e('0x6d')](function(_0x510b38){logger[_0xec7e('0x6e')]('[QUEUE]',JSON[_0xec7e('0x1e')](_0x510b38));});};exports[_0xec7e('0x6f')]=function(_0x357a72,_0x311d75,_0x2df4d1,_0x11326d,_0xabfcab,_0x3831b1,_0x4d4739){var _0x3713a3,_0x4c0fe3,_0x4aff03,_0x3a30ba;_0x3831b1[_0xec7e('0x54')]=intUtil[_0xec7e('0x56')](_0x3831b1[_0xec7e('0x54')]);_0x3831b1[_0xec7e('0x55')]=intUtil['stripTrailingSlash'](_0x3831b1[_0xec7e('0x55')]);def[_0xec7e('0x57')]=util['format'](_0xec7e('0x58'),_0x3831b1[_0xec7e('0x54')]);if(_0x4d4739&&_0x4d4739['recordingFormat']&&_0x4d4739['recordingFormat']!=='none'){logger[_0xec7e('0x8')](_0xec7e('0x70'),_0xec7e('0x5b'));_0x311d75[_0xec7e('0x5e')]=util['format'](_0xec7e('0x5c'),_0x3831b1[_0xec7e('0x55')],_0x311d75[_0xec7e('0x5d')],md5(_0x311d75[_0xec7e('0x5d')]));}return getConnection(_0x3831b1)[_0xec7e('0x29')](function(_0x1c0c51){_0x3a30ba=_0x1c0c51;return getUser(_0x3831b1,_0x11326d[_0xec7e('0xa')],_0x3a30ba);})[_0xec7e('0x29')](function(_0x414087){_0x3713a3=_0x414087;logger[_0xec7e('0x8')](_0xec7e('0x5f'),_0x3713a3['id']);return getEndUser(_0x3831b1,_0x311d75[_0xec7e('0x71')],_0x311d75[_0xec7e('0x72')],_0x3a30ba);})[_0xec7e('0x29')](function(_0x1d4987){_0x4c0fe3=_0x1d4987;logger[_0xec7e('0x8')](_0xec7e('0x73'),_0x4c0fe3['id']);return getTicket(_0x3831b1,_0x3713a3,_0x4c0fe3,_0x2df4d1,_0x311d75,_0x2df4d1[_0xec7e('0x62')],_0x3a30ba,_0xec7e('0x74'));})[_0xec7e('0x29')](function(_0x4ba9c2){_0x4aff03=_0x4ba9c2;logger[_0xec7e('0x8')](_0xec7e('0x64'));logger[_0xec7e('0x8')](_0xec7e('0x65'),_0x4aff03['id']);return setRelationship(_0x3a30ba,_0x3713a3,_0x4aff03,'users');})[_0xec7e('0x29')](function(){return setRelationship(_0x3a30ba,_0x4c0fe3,_0x4aff03,'contacts');})[_0xec7e('0x29')](function(){return getServerInfo(_0x3a30ba);})[_0xec7e('0x29')](function(_0x4b648a){var _0x31cac0=parseInt(_0x4b648a['version'][_0xec7e('0x75')](0x0));var _0xf5a8bd=util[_0xec7e('0x20')](_0xec7e('0x76'),_0x3831b1[_0xec7e('0x54')],_0x4aff03['id']);if(_0x31cac0>0x6){_0xf5a8bd=util[_0xec7e('0x20')](_0xec7e('0x69'),_0x3831b1[_0xec7e('0x54')],_0x4aff03['id']);}logger['info'](_0xec7e('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xec7e('0x20')](_0xec7e('0x6b'),_0x11326d[_0xec7e('0xa')]),_0xec7e('0x6c'),{'uri':_0xf5a8bd});})[_0xec7e('0x6d')](function(_0xa7be96){logger[_0xec7e('0x6e')]('[OUTBOUND]',JSON[_0xec7e('0x1e')](_0xa7be96));});};exports[_0xec7e('0x77')]=function(_0x30135b,_0x2431ca,_0x5ef4d2,_0x5ec7a6,_0x307c86,_0x1adbf2){var _0x2bfaac,_0x40f4d4,_0x270460,_0x377edb;_0x1adbf2['remoteUri']=intUtil[_0xec7e('0x56')](_0x1adbf2['remoteUri']);_0x1adbf2[_0xec7e('0x55')]=intUtil[_0xec7e('0x56')](_0x1adbf2[_0xec7e('0x55')]);def[_0xec7e('0x57')]=util[_0xec7e('0x20')](_0xec7e('0x58'),_0x1adbf2['remoteUri']);if(_0x307c86&&_0x307c86[_0xec7e('0x59')]){logger[_0xec7e('0x8')]('[ABANDONED]',_0xec7e('0x5b'));_0x2431ca[_0xec7e('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1adbf2['serverUrl'],_0x2431ca[_0xec7e('0x5d')],md5(_0x2431ca[_0xec7e('0x5d')]));}else{_0x2431ca[_0xec7e('0x5e')]='';}return getConnection(_0x1adbf2)[_0xec7e('0x29')](function(_0x4310cf){_0x377edb=_0x4310cf;if(!_['isNil'](_0x5ec7a6)){return getUser(_0x1adbf2,_0x5ec7a6[_0xec7e('0xa')],_0x377edb);}else{return getUser(_0x1adbf2,null,_0x377edb);}})[_0xec7e('0x29')](function(_0x556b28){_0x2bfaac=_0x556b28;logger[_0xec7e('0x8')]('The\x20User\x20ID\x20is:',_0x2bfaac['id']);return getEndUser(_0x1adbf2,_0x2431ca['calleridname'],_0x2431ca[_0xec7e('0x61')],_0x377edb);})[_0xec7e('0x29')](function(_0x16f393){_0x40f4d4=_0x16f393;logger[_0xec7e('0x8')](_0xec7e('0x73'),_0x40f4d4['id']);return getTicket(_0x1adbf2,_0x2bfaac,_0x40f4d4,_0x5ef4d2,_0x2431ca,_0x5ef4d2[_0xec7e('0x62')],_0x377edb,_0xec7e('0x63'));})['then'](function(_0xd0cb1f){_0x270460=_0xd0cb1f;logger[_0xec7e('0x8')](_0xec7e('0x64'));logger[_0xec7e('0x8')](_0xec7e('0x65'),_0x270460['id']);return setRelationship(_0x377edb,_0x2bfaac,_0x270460,_0xec7e('0x66'));})[_0xec7e('0x29')](function(){return setRelationship(_0x377edb,_0x40f4d4,_0x270460,'contacts');})[_0xec7e('0x29')](function(){return getServerInfo(_0x377edb);})[_0xec7e('0x6d')](function(_0x26d6f4){logger[_0xec7e('0x6e')](_0xec7e('0x78'),JSON['stringify'](_0x26d6f4));});}; \ No newline at end of file +var _0x20b2=['getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','format','Basic\x20%s','apiKey','base64','get_server_info','stringify','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','merge','type','string','nameField','customField','toLowerCase','content','toString','idField','custom_fields','variable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','then','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','catch','error','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','The\x20Ticket\x20ID\x20is:','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','[ABANDONED]','isNil','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name'];(function(_0x2277bc,_0x445533){var _0x7da71=function(_0x14121a){while(--_0x14121a){_0x2277bc['push'](_0x2277bc['shift']());}};_0x7da71(++_0x445533);}(_0x20b2,0x1d7));var _0x220b=function(_0x5334c1,_0x2d4242){_0x5334c1=_0x5334c1-0x0;var _0x11e59d=_0x20b2[_0x5334c1];return _0x11e59d;};'use strict';var _=require(_0x220b('0x0'));var rp=require('request-promise');var BPromise=require(_0x220b('0x1'));var md5=require(_0x220b('0x2'));var util=require(_0x220b('0x3'));var Redis=require(_0x220b('0x4'));var intUtil=require(_0x220b('0x5'));var config=require(_0x220b('0x6'));var logger=require(_0x220b('0x7'))(_0x220b('0x8'));config[_0x220b('0x9')]=_[_0x220b('0xa')](config[_0x220b('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x220b('0xb'))(new Redis(config[_0x220b('0x9')]));var def={'method':_0x220b('0xc'),'json':!![]};function emit(_0x598c79,_0x4851c7,_0x448b4d){io['to'](_0x598c79)[_0x220b('0xd')](_0x4851c7,_0x448b4d);}function getTicket(_0x3d8604,_0x5c8c33,_0x41e784,_0x2587fb,_0x5d1fee,_0x54cbee,_0x4e068d,_0x5ea290){logger[_0x220b('0xe')](_0x220b('0xf'));var _0x141ad3=new Date();var _0x1b02a1=[{'name':_0x220b('0x10'),'value':intUtil[_0x220b('0x11')](_0x2587fb[_0x220b('0x12')],_0x5d1fee,'\x20')},{'name':_0x220b('0x13'),'value':_0x5c8c33['id']},{'name':_0x220b('0x14'),'value':_0x5c8c33['id']},{'name':'description','value':intUtil[_0x220b('0x11')](_0x2587fb[_0x220b('0x15')],_0x5d1fee,'\x0a')},{'name':_0x220b('0x16'),'value':_0x141ad3[_0x220b('0x17')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x220b('0x18'),'value':'0'},{'name':_0x220b('0x19'),'value':'15'},{'name':_0x220b('0x1a'),'value':_0x41e784['id']},{'name':_0x220b('0x1b'),'value':'Contacts'},{'name':_0x220b('0x1c'),'value':_0x41e784[_0x220b('0x10')]},{'name':_0x220b('0x1d'),'value':_0x5ea290}];if(_0x54cbee[_0x220b('0x1e')]){_[_0x220b('0x1f')](_0x54cbee,function(_0x1637dd){if(_0x5d1fee[_0x1637dd[_0x220b('0x20')]]){_0x1b02a1[_0x220b('0x21')]({'name':_0x1637dd['idField'],'value':_0x5d1fee[_0x1637dd['variableName']]});}});}return request({'form':{'method':_0x220b('0x22'),'input_type':_0x220b('0x23'),'response_type':_0x220b('0x23'),'rest_data':JSON['stringify']({'session':_0x4e068d['id'],'module_name':'Calls','name_value_list':_0x1b02a1})}});}function getAuth(_0x5e7218){return util[_0x220b('0x24')](_0x220b('0x25'),new Buffer(_0x5e7218[_0x220b('0x26')]+':X')['toString'](_0x220b('0x27')));}function getServerInfo(_0xde0c0b){return request({'form':{'method':_0x220b('0x28'),'input_type':_0x220b('0x23'),'response_type':_0x220b('0x23'),'rest_data':JSON['stringify']({'session':_0xde0c0b['id']})}});}function getUser(_0x20098f,_0x410b1a,_0x4bb059){if(!_['isNil'](_0x410b1a)){logger[_0x220b('0xe')]('Getting\x20agent\x20with\x20name',_0x410b1a);return request({'form':{'method':'get_entry_list','input_type':_0x220b('0x23'),'response_type':_0x220b('0x23'),'rest_data':JSON[_0x220b('0x29')]({'session':_0x4bb059['id'],'module_name':_0x220b('0x2a'),'query':util['format'](_0x220b('0x2b'),_0x410b1a),'order_by':'','offset':'0','select_fields':['id',_0x220b('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x44b191){if(_0x44b191[_0x220b('0x2c')][_0x220b('0x1e')]){var _0x1e5fb2=_[_0x220b('0x2d')](_0x44b191['entry_list'],function(_0x31ea21){return _0x31ea21[_0x220b('0x2e')]['user_name'][_0x220b('0x2f')]===_0x410b1a;});if(_0x1e5fb2){logger[_0x220b('0xe')]('Agent\x20found!');return BPromise[_0x220b('0x30')]({'id':_0x1e5fb2['name_value_list']['id'][_0x220b('0x2f')],'name':_0x1e5fb2[_0x220b('0x2e')][_0x220b('0x10')][_0x220b('0x2f')]});}}logger['info'](_0x220b('0x31'));return BPromise['resolve']({'id':_0x4bb059['name_value_list']['user_id'][_0x220b('0x2f')],'name':_0x4bb059[_0x220b('0x2e')][_0x220b('0x32')][_0x220b('0x2f')]});});}else{logger[_0x220b('0xe')](_0x220b('0x33'));return BPromise['resolve']({'id':_0x4bb059['name_value_list']['user_id'][_0x220b('0x2f')],'name':_0x4bb059[_0x220b('0x2e')]['user_name'][_0x220b('0x2f')]});}}function getEndUser(_0x3f417d,_0x22c504,_0x470171,_0x247b4e){logger[_0x220b('0xe')](_0x220b('0x34'),_0x470171);return request({'form':{'method':'get_entry_list','input_type':_0x220b('0x23'),'response_type':_0x220b('0x23'),'rest_data':JSON[_0x220b('0x29')]({'session':_0x247b4e['id'],'module_name':_0x220b('0x35'),'query':util[_0x220b('0x24')](_0x220b('0x36'),_0x470171),'order_by':'','offset':'0','select_fields':['id',_0x220b('0x10'),_0x220b('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x478ac5){if(_0x478ac5[_0x220b('0x2c')][_0x220b('0x1e')]){var _0x27b50a=_['find'](_0x478ac5[_0x220b('0x2c')],function(_0x3765b3){return _0x3765b3[_0x220b('0x2e')][_0x220b('0x37')][_0x220b('0x2f')]===_0x470171;});if(_0x27b50a){logger[_0x220b('0xe')](_0x220b('0x38'));return BPromise[_0x220b('0x30')]({'id':_0x27b50a[_0x220b('0x2e')]['id']['value'],'name':_0x27b50a[_0x220b('0x2e')][_0x220b('0x10')][_0x220b('0x2f')],'phone':_0x27b50a['name_value_list'][_0x220b('0x37')][_0x220b('0x2f')]});}}else{logger[_0x220b('0xe')](_0x220b('0x39'));return request({'form':{'method':_0x220b('0x22'),'input_type':_0x220b('0x23'),'response_type':_0x220b('0x23'),'rest_data':JSON['stringify']({'session':_0x247b4e['id'],'module_name':_0x220b('0x35'),'name_value_list':[{'name':_0x220b('0x3a'),'value':_0x22c504!==''?_0x22c504:util[_0x220b('0x24')](_0x220b('0x3b'),_0x470171)},{'name':_0x220b('0x37'),'value':_0x470171}]})}})['then'](function(_0x24d74c){logger[_0x220b('0xe')](_0x220b('0x3c'));return BPromise[_0x220b('0x30')]({'id':_0x24d74c['id'],'name':_0x24d74c[_0x220b('0x2c')][_0x220b('0x3a')][_0x220b('0x2f')],'phone':_0x24d74c[_0x220b('0x2c')]['phone_home'][_0x220b('0x2f')]});});}});}function request(_0x4f2129){logger['debug']('[HTTP]',JSON['stringify'](_0x4f2129));return rp(_[_0x220b('0x3d')](def,_0x4f2129));}function getTags(_0x101927,_0x2b6ad8){var _0x5152ca=[];if(_0x101927&&_0x101927['length']>0x0){_0x5152ca=_['map'](_0x101927,_0x2b6ad8);}return _0x5152ca;}function getCustomFields(_0x236a73,_0x212a92){var _0x1a86dc=[];var _0x150ef9={'custom_fields':[]};if(_0x236a73[_0x220b('0x1e')]>0x0){_['forEach'](_0x236a73,function(_0x4ab11f){if(_0x4ab11f[_0x220b('0x3e')]===_0x220b('0x3f')&&_0x4ab11f[_0x220b('0x40')]&&!_0x4ab11f[_0x220b('0x41')]){_0x150ef9[_0x4ab11f[_0x220b('0x40')][_0x220b('0x42')]()]=_0x4ab11f[_0x220b('0x43')][_0x220b('0x44')]();}else if(_0x4ab11f[_0x220b('0x3e')]===_0x220b('0x3f')&&_0x4ab11f[_0x220b('0x45')]&&_0x4ab11f[_0x220b('0x41')]){_0x150ef9[_0x220b('0x46')][_0x220b('0x21')]({'id':_0x4ab11f[_0x220b('0x45')],'value':_0x4ab11f['content'][_0x220b('0x44')]()});}else if(_0x4ab11f['type']===_0x220b('0x47')&&_0x4ab11f[_0x220b('0x20')]&&_0x4ab11f[_0x220b('0x45')]&&_0x4ab11f[_0x220b('0x41')]){_0x212a92[_0x4ab11f[_0x220b('0x20')]]&&_0x150ef9[_0x220b('0x46')][_0x220b('0x21')]({'id':_0x4ab11f['idField'],'value':_0x212a92[_0x4ab11f['variableName']][_0x220b('0x44')]()});}else if(_0x4ab11f[_0x220b('0x3e')]==='customVariable'&&_0x4ab11f[_0x220b('0x48')]&&_0x4ab11f[_0x220b('0x48')]['name']&&_0x4ab11f[_0x220b('0x45')]&&_0x4ab11f['customField']){_0x212a92[_0x4ab11f['Variable'][_0x220b('0x10')][_0x220b('0x42')]()]&&_0x150ef9['custom_fields']['push']({'id':_0x4ab11f['idField'],'value':_0x212a92[_0x4ab11f['Variable'][_0x220b('0x10')][_0x220b('0x42')]()][_0x220b('0x44')]()});}});}return _0x150ef9;}function getConnection(_0x5f2d15){return request({'method':_0x220b('0xc'),'form':{'method':_0x220b('0x49'),'input_type':_0x220b('0x23'),'response_type':'JSON','rest_data':JSON[_0x220b('0x29')]({'user_auth':{'user_name':_0x5f2d15[_0x220b('0x4a')],'password':_0x5f2d15['password'],'encryption':_0x220b('0x4b')},'application':_0x220b('0x4c')})}})[_0x220b('0x4d')](function(_0x4ec93b){var _0x16f637=_0x4ec93b;if(_0x16f637['id']){def[_0x220b('0x4e')]=_0x16f637['id'];return BPromise[_0x220b('0x30')](_0x16f637);}else{throw new Error(util['format'](_0x220b('0x4f'),_0x5f2d15['id']));}});}function setRelationship(_0x150327,_0x3a3851,_0x2c12cf,_0x2d4625){return request({'form':{'method':_0x220b('0x50'),'input_type':'JSON','response_type':_0x220b('0x23'),'rest_data':JSON['stringify']({'session':_0x150327['id'],'module_name':_0x220b('0x51'),'module_id':_0x2c12cf['id'],'link_field_name':_0x2d4625,'related_ids':[_0x3a3851['id']]})}});}exports[_0x220b('0x52')]=function(_0x374998,_0x171253,_0x470a7a,_0x225d68,_0x42645c,_0x2ec36d){var _0x15c5b3,_0x3ead96,_0x24dab0,_0x413344;_0x2ec36d[_0x220b('0x53')]=intUtil[_0x220b('0x54')](_0x2ec36d[_0x220b('0x53')]);_0x2ec36d[_0x220b('0x55')]=intUtil[_0x220b('0x54')](_0x2ec36d[_0x220b('0x55')]);def[_0x220b('0x56')]=util['format'](_0x220b('0x57'),_0x2ec36d[_0x220b('0x53')]);if(_0x42645c&&_0x42645c[_0x220b('0x58')]){logger[_0x220b('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x171253[_0x220b('0x59')]=util[_0x220b('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ec36d[_0x220b('0x55')],_0x171253[_0x220b('0x5a')],md5(_0x171253[_0x220b('0x5a')]));}else{_0x171253[_0x220b('0x59')]='';}return getConnection(_0x2ec36d)[_0x220b('0x4d')](function(_0x2b6820){_0x413344=_0x2b6820;return getUser(_0x2ec36d,_0x225d68[_0x220b('0x10')],_0x413344);})[_0x220b('0x4d')](function(_0x2c086d){_0x15c5b3=_0x2c086d;logger['info'](_0x220b('0x5b'),_0x15c5b3['id']);return getEndUser(_0x2ec36d,_0x171253[_0x220b('0x5c')],_0x171253[_0x220b('0x5d')],_0x413344);})[_0x220b('0x4d')](function(_0x514a4c){_0x3ead96=_0x514a4c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3ead96['id']);return getTicket(_0x2ec36d,_0x15c5b3,_0x3ead96,_0x470a7a,_0x171253,_0x470a7a[_0x220b('0x5e')],_0x413344,_0x220b('0x5f'));})[_0x220b('0x4d')](function(_0x22234c){_0x24dab0=_0x22234c;logger['info'](_0x220b('0x60'));logger[_0x220b('0xe')]('The\x20Ticket\x20ID\x20is:',_0x24dab0['id']);return setRelationship(_0x413344,_0x15c5b3,_0x24dab0,_0x220b('0x61'));})[_0x220b('0x4d')](function(){return setRelationship(_0x413344,_0x3ead96,_0x24dab0,_0x220b('0x62'));})[_0x220b('0x4d')](function(){return getServerInfo(_0x413344);})[_0x220b('0x4d')](function(_0x378f5f){var _0x5b3e62=parseInt(_0x378f5f['version'][_0x220b('0x63')](0x0));var _0x2d19ea=util['format'](_0x220b('0x64'),_0x2ec36d[_0x220b('0x53')],_0x24dab0['id']);if(_0x5b3e62>0x6){_0x2d19ea=util[_0x220b('0x24')](_0x220b('0x65'),_0x2ec36d[_0x220b('0x53')],_0x24dab0['id']);}logger[_0x220b('0xe')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x225d68[_0x220b('0x10')]),_0x220b('0x66'),{'uri':_0x2d19ea});})[_0x220b('0x67')](function(_0x55fb2c){logger[_0x220b('0x68')](_0x220b('0x69'),JSON[_0x220b('0x29')](_0x55fb2c));});};exports[_0x220b('0x6a')]=function(_0x10b712,_0x1193a1,_0x3aff36,_0x4778e9,_0x1667eb,_0x128e54,_0xf76af5){var _0x4445a7,_0x22454a,_0x413ae6,_0xa0fad6;_0x128e54[_0x220b('0x53')]=intUtil[_0x220b('0x54')](_0x128e54[_0x220b('0x53')]);_0x128e54[_0x220b('0x55')]=intUtil[_0x220b('0x54')](_0x128e54[_0x220b('0x55')]);def['uri']=util[_0x220b('0x24')](_0x220b('0x57'),_0x128e54[_0x220b('0x53')]);if(_0xf76af5&&_0xf76af5['recordingFormat']&&_0xf76af5[_0x220b('0x6b')]!==_0x220b('0x6c')){logger['info'](_0x220b('0x6d'),_0x220b('0x6e'));_0x1193a1[_0x220b('0x59')]=util[_0x220b('0x24')](_0x220b('0x6f'),_0x128e54[_0x220b('0x55')],_0x1193a1['uniqueid'],md5(_0x1193a1[_0x220b('0x5a')]));}return getConnection(_0x128e54)[_0x220b('0x4d')](function(_0x176d22){_0xa0fad6=_0x176d22;return getUser(_0x128e54,_0x4778e9[_0x220b('0x10')],_0xa0fad6);})[_0x220b('0x4d')](function(_0x1bc9fa){_0x4445a7=_0x1bc9fa;logger['info']('The\x20User\x20ID\x20is:',_0x4445a7['id']);return getEndUser(_0x128e54,_0x1193a1[_0x220b('0x70')],_0x1193a1[_0x220b('0x71')],_0xa0fad6);})['then'](function(_0x4aebc3){_0x22454a=_0x4aebc3;logger[_0x220b('0xe')](_0x220b('0x72'),_0x22454a['id']);return getTicket(_0x128e54,_0x4445a7,_0x22454a,_0x3aff36,_0x1193a1,_0x3aff36['Fields'],_0xa0fad6,_0x220b('0x73'));})['then'](function(_0x1ff57e){_0x413ae6=_0x1ff57e;logger[_0x220b('0xe')](_0x220b('0x60'));logger[_0x220b('0xe')](_0x220b('0x74'),_0x413ae6['id']);return setRelationship(_0xa0fad6,_0x4445a7,_0x413ae6,_0x220b('0x61'));})['then'](function(){return setRelationship(_0xa0fad6,_0x22454a,_0x413ae6,_0x220b('0x62'));})[_0x220b('0x4d')](function(){return getServerInfo(_0xa0fad6);})[_0x220b('0x4d')](function(_0x2ff485){var _0x1c1a92=parseInt(_0x2ff485[_0x220b('0x75')]['charAt'](0x0));var _0x2344c9=util[_0x220b('0x24')](_0x220b('0x64'),_0x128e54[_0x220b('0x53')],_0x413ae6['id']);if(_0x1c1a92>0x6){_0x2344c9=util[_0x220b('0x24')](_0x220b('0x65'),_0x128e54['remoteUri'],_0x413ae6['id']);}logger['info'](_0x220b('0x6d'),_0x220b('0x76'));emit(util[_0x220b('0x24')](_0x220b('0x77'),_0x4778e9[_0x220b('0x10')]),'trigger:browser:url',{'uri':_0x2344c9});})[_0x220b('0x67')](function(_0x3664cd){logger[_0x220b('0x68')](_0x220b('0x6d'),JSON['stringify'](_0x3664cd));});};exports['abandoned']=function(_0x139060,_0x4c652e,_0x52230d,_0x17245c,_0x155163,_0xf8bcf6){var _0x366d91,_0x32e2e2,_0x3ab160,_0x2c0b5f;_0xf8bcf6[_0x220b('0x53')]=intUtil['stripTrailingSlash'](_0xf8bcf6['remoteUri']);_0xf8bcf6[_0x220b('0x55')]=intUtil['stripTrailingSlash'](_0xf8bcf6[_0x220b('0x55')]);def[_0x220b('0x56')]=util[_0x220b('0x24')]('%s/service/v4_1/rest.php',_0xf8bcf6['remoteUri']);if(_0x155163&&_0x155163['monitor_format']){logger['info'](_0x220b('0x78'),_0x220b('0x6e'));_0x4c652e['recordingURL']=util[_0x220b('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf8bcf6[_0x220b('0x55')],_0x4c652e[_0x220b('0x5a')],md5(_0x4c652e[_0x220b('0x5a')]));}else{_0x4c652e['recordingURL']='';}return getConnection(_0xf8bcf6)[_0x220b('0x4d')](function(_0x51e139){_0x2c0b5f=_0x51e139;if(!_[_0x220b('0x79')](_0x17245c)){return getUser(_0xf8bcf6,_0x17245c['name'],_0x2c0b5f);}else{return getUser(_0xf8bcf6,null,_0x2c0b5f);}})[_0x220b('0x4d')](function(_0x46a950){_0x366d91=_0x46a950;logger[_0x220b('0xe')](_0x220b('0x5b'),_0x366d91['id']);return getEndUser(_0xf8bcf6,_0x4c652e[_0x220b('0x5c')],_0x4c652e[_0x220b('0x5d')],_0x2c0b5f);})[_0x220b('0x4d')](function(_0x2e8211){_0x32e2e2=_0x2e8211;logger[_0x220b('0xe')](_0x220b('0x72'),_0x32e2e2['id']);return getTicket(_0xf8bcf6,_0x366d91,_0x32e2e2,_0x52230d,_0x4c652e,_0x52230d[_0x220b('0x5e')],_0x2c0b5f,'Inbound');})[_0x220b('0x4d')](function(_0x5177ea){_0x3ab160=_0x5177ea;logger[_0x220b('0xe')](_0x220b('0x60'));logger[_0x220b('0xe')](_0x220b('0x74'),_0x3ab160['id']);return setRelationship(_0x2c0b5f,_0x366d91,_0x3ab160,_0x220b('0x61'));})[_0x220b('0x4d')](function(){return setRelationship(_0x2c0b5f,_0x32e2e2,_0x3ab160,_0x220b('0x62'));})[_0x220b('0x4d')](function(){return getServerInfo(_0x2c0b5f);})['catch'](function(_0x5b336c){logger['error'](_0x220b('0x78'),JSON['stringify'](_0x5b336c));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index 0340b46..2c5ade6 100644 --- a/server/services/ami/trigger/integration/util.js +++ b/server/services/ami/trigger/integration/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38f0=['stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','util','getString','length','sortBy','string','content','variable','variableName','toString','type','customVariable','Variable','name','push','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','join'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x38f0,0x1aa));var _0x038f=function(_0xe5f6e8,_0x4a8900){_0xe5f6e8=_0xe5f6e8-0x0;var _0x18aa99=_0x38f0[_0xe5f6e8];return _0x18aa99;};'use strict';var _=require('lodash');var util=require(_0x038f('0x0'));exports[_0x038f('0x1')]=function(_0x305dbd,_0x42ca90,_0x321a5c){var _0x2bdce3=[];if(_0x305dbd[_0x038f('0x2')]>0x0){var _0x52fa18=_[_0x038f('0x3')](_0x305dbd,['id']);for(var _0x52e2b9=0x0;_0x52e2b9<_0x52fa18[_0x038f('0x2')];_0x52e2b9++){var _0x21ab51=_0x52fa18[_0x52e2b9];if(_0x21ab51['type']===_0x038f('0x4')){_0x2bdce3['push'](_0x21ab51[_0x038f('0x5')]);}else if(_0x21ab51['type']===_0x038f('0x6')&&_0x21ab51[_0x038f('0x7')]){_0x42ca90[_0x21ab51[_0x038f('0x7')]]&&_0x2bdce3['push'](_0x42ca90[_0x21ab51[_0x038f('0x7')]][_0x038f('0x8')]());}else if(_0x21ab51[_0x038f('0x9')]===_0x038f('0xa')&&_0x21ab51[_0x038f('0xb')]&&_0x21ab51['Variable']['name']){_0x42ca90[_0x21ab51['Variable'][_0x038f('0xc')]['toLowerCase']()]&&_0x2bdce3[_0x038f('0xd')](_0x42ca90[_0x21ab51[_0x038f('0xb')][_0x038f('0xc')][_0x038f('0xe')]()]['toString']());}else if(_0x21ab51[_0x038f('0x9')]===_0x038f('0xf')){if(_0x21ab51['keyType']===_0x038f('0x4')&&_0x21ab51[_0x038f('0x10')]){_0x2bdce3[_0x038f('0xd')](util[_0x038f('0x11')](_0x038f('0x12'),_0x21ab51[_0x038f('0x10')],_0x21ab51[_0x038f('0x13')]));}else if(_0x21ab51['keyType']===_0x038f('0x6')&&_0x21ab51[_0x038f('0x7')]&&_0x21ab51[_0x038f('0x10')]){_0x42ca90[_0x21ab51[_0x038f('0x7')]]&&_0x2bdce3[_0x038f('0xd')](util[_0x038f('0x11')](_0x038f('0x12'),_0x21ab51[_0x038f('0x10')],_0x42ca90[_0x21ab51[_0x038f('0x7')]]));}else if(_0x21ab51[_0x038f('0x14')]===_0x038f('0xa')&&_0x21ab51[_0x038f('0xb')]&&_0x21ab51[_0x038f('0xb')][_0x038f('0xc')]&&_0x21ab51[_0x038f('0x10')]){_0x42ca90[_0x21ab51[_0x038f('0xb')][_0x038f('0xc')][_0x038f('0xe')]()]&&_0x2bdce3[_0x038f('0xd')](util[_0x038f('0x11')](_0x038f('0x12'),_0x21ab51[_0x038f('0x10')],_0x42ca90[_0x21ab51[_0x038f('0xb')][_0x038f('0xc')]['toLowerCase']()]));}}}}return _0x2bdce3[_0x038f('0x15')](_0x321a5c);};exports[_0x038f('0x16')]=function(_0x47ce42){var _0x4c7501=_0x47ce42[_0x038f('0x17')](-0x1);if(_0x4c7501==='/'){_0x47ce42=_0x47ce42[_0x038f('0x18')](0x0,_0x47ce42[_0x038f('0x19')](_0x4c7501));}return _0x47ce42;};exports[_0x038f('0x1a')]=function(_0x191094){if(!_[_0x038f('0x1b')](_0x191094)&&_0x191094!==''){var _0x49ee93=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x49ee93['test'](String(_0x191094)[_0x038f('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x6397=['type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','lastIndexOf','validateEmail','isNil','length'];(function(_0x4b80f7,_0x52dd11){var _0xef87a2=function(_0x1071f8){while(--_0x1071f8){_0x4b80f7['push'](_0x4b80f7['shift']());}};_0xef87a2(++_0x52dd11);}(_0x6397,0x186));var _0x7639=function(_0x24c859,_0x4a65e7){_0x24c859=_0x24c859-0x0;var _0xa5e5bd=_0x6397[_0x24c859];return _0xa5e5bd;};'use strict';var _=require('lodash');var util=require('util');exports['getString']=function(_0x32bf44,_0x14f3c5,_0x3c3606){var _0x4a88f5=[];if(_0x32bf44[_0x7639('0x0')]>0x0){var _0x47a2fc=_['sortBy'](_0x32bf44,['id']);for(var _0x5e6215=0x0;_0x5e6215<_0x47a2fc[_0x7639('0x0')];_0x5e6215++){var _0x5d624e=_0x47a2fc[_0x5e6215];if(_0x5d624e[_0x7639('0x1')]===_0x7639('0x2')){_0x4a88f5[_0x7639('0x3')](_0x5d624e[_0x7639('0x4')]);}else if(_0x5d624e[_0x7639('0x1')]==='variable'&&_0x5d624e[_0x7639('0x5')]){_0x14f3c5[_0x5d624e[_0x7639('0x5')]]&&_0x4a88f5['push'](_0x14f3c5[_0x5d624e['variableName']][_0x7639('0x6')]());}else if(_0x5d624e[_0x7639('0x1')]===_0x7639('0x7')&&_0x5d624e[_0x7639('0x8')]&&_0x5d624e[_0x7639('0x8')][_0x7639('0x9')]){_0x14f3c5[_0x5d624e[_0x7639('0x8')]['name'][_0x7639('0xa')]()]&&_0x4a88f5[_0x7639('0x3')](_0x14f3c5[_0x5d624e['Variable'][_0x7639('0x9')][_0x7639('0xa')]()]['toString']());}else if(_0x5d624e[_0x7639('0x1')]===_0x7639('0xb')){if(_0x5d624e[_0x7639('0xc')]===_0x7639('0x2')&&_0x5d624e[_0x7639('0xd')]){_0x4a88f5[_0x7639('0x3')](util[_0x7639('0xe')](_0x7639('0xf'),_0x5d624e['key'],_0x5d624e[_0x7639('0x10')]));}else if(_0x5d624e[_0x7639('0xc')]===_0x7639('0x11')&&_0x5d624e['variableName']&&_0x5d624e[_0x7639('0xd')]){_0x14f3c5[_0x5d624e['variableName']]&&_0x4a88f5['push'](util[_0x7639('0xe')](_0x7639('0xf'),_0x5d624e[_0x7639('0xd')],_0x14f3c5[_0x5d624e[_0x7639('0x5')]]));}else if(_0x5d624e['keyType']===_0x7639('0x7')&&_0x5d624e[_0x7639('0x8')]&&_0x5d624e[_0x7639('0x8')][_0x7639('0x9')]&&_0x5d624e['key']){_0x14f3c5[_0x5d624e[_0x7639('0x8')][_0x7639('0x9')][_0x7639('0xa')]()]&&_0x4a88f5[_0x7639('0x3')](util['format'](_0x7639('0xf'),_0x5d624e['key'],_0x14f3c5[_0x5d624e['Variable']['name'][_0x7639('0xa')]()]));}}}}return _0x4a88f5[_0x7639('0x12')](_0x3c3606);};exports[_0x7639('0x13')]=function(_0x39d727){var _0x134281=_0x39d727['slice'](-0x1);if(_0x134281==='/'){_0x39d727=_0x39d727['substring'](0x0,_0x39d727[_0x7639('0x14')](_0x134281));}return _0x39d727;};exports[_0x7639('0x15')]=function(_0x1b81b1){if(!_[_0x7639('0x16')](_0x1b81b1)&&_0x1b81b1!==''){var _0x9de61d=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x9de61d['test'](String(_0x1b81b1)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index d20c8a5..f568723 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['Normal','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','username','stringify','then','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','Agent\x20found!','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','userId','admin','getUser','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','create','Enduser\x20created.','lastname','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Ticket\x20created!','[OUTBOUND]','user:%s','abandoned','[ABANDONED]','lodash','bluebird','md5','util','../../../../config/environment','vTiger','redis','defaults','localhost','emit','forEach','string','idField','content','type','variable','variableName','toString','Variable','name','info','Creating\x20new\x20ticket...','merge'];(function(_0x5c0977,_0x925a5c){var _0xfe49ee=function(_0x31331a){while(--_0x31331a){_0x5c0977['push'](_0x5c0977['shift']());}};_0xfe49ee(++_0x925a5c);}(_0x3e74,0x175));var _0x43e7=function(_0x5f4497,_0x646041){_0x5f4497=_0x5f4497-0x0;var _0x261d23=_0x3e74[_0x5f4497];return _0x261d23;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var BPromise=require(_0x43e7('0x1'));var md5=require(_0x43e7('0x2'));var util=require(_0x43e7('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x43e7('0x4'));var logger=require('../../../../config/logger')(_0x43e7('0x5'));config[_0x43e7('0x6')]=_[_0x43e7('0x7')](config[_0x43e7('0x6')],{'host':_0x43e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0x6')]));function emit(_0x3491d6,_0x2ede2d,_0x8528fc){io['to'](_0x3491d6)[_0x43e7('0x9')](_0x2ede2d,_0x8528fc);}function getCustomFields(_0x516b4d,_0x212c6c){var _0x554d44={};if(_0x516b4d['length']>0x0){_[_0x43e7('0xa')](_0x516b4d,function(_0x4139c9){if(_0x4139c9['type']===_0x43e7('0xb')&&_0x4139c9['idField']){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x4139c9[_0x43e7('0xd')]['toString']();}else if(_0x4139c9[_0x43e7('0xe')]===_0x43e7('0xf')&&_0x4139c9[_0x43e7('0x10')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9['variableName']]){_0x554d44[_0x4139c9['idField']]=_0x212c6c[_0x4139c9[_0x43e7('0x10')]][_0x43e7('0x11')]();}else if(_0x4139c9[_0x43e7('0xe')]==='customVariable'&&_0x4139c9['Variable']&&_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9[_0x43e7('0x12')]['name']['toLowerCase']()]){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x212c6c[_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]['toLowerCase']()]['toString']();}});}return _0x554d44;}function createTicket(_0x446986,_0x1ca758,_0x9037d3,_0x140657,_0x3776f5,_0x1f24fb,_0x619236){logger[_0x43e7('0x14')](_0x43e7('0x15'));var _0xab63cf=_[_0x43e7('0x16')]({'parent_id':'','assigned_user_id':_0x1ca758['id'],'ticketpriorities':_0x43e7('0x17'),'ticketstatus':'Open','ticket_title':intUtil[_0x43e7('0x18')](_0x140657[_0x43e7('0x19')],_0x3776f5,'\x20'),'description':intUtil['getString'](_0x140657[_0x43e7('0x1a')],_0x3776f5,'\x0a'),'contact_id':_0x9037d3['id']},getCustomFields(_0x1f24fb,_0x3776f5));var _0x3e281e={'method':_0x43e7('0x1b'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986[_0x43e7('0x1e')]),'form':{'operation':'create','username':_0x446986[_0x43e7('0x1f')],'sessionName':_0x619236['sessionName'],'elementType':'HelpDesk','element':JSON[_0x43e7('0x20')](_0xab63cf)},'json':!![]};return request(_0x3e281e)[_0x43e7('0x21')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x22')]){return BPromise['resolve']({'id':_0x4b2b9f[_0x43e7('0x23')]['id']});}else{throw new Error(util['format'](_0x43e7('0x24'),JSON[_0x43e7('0x20')](_0x4b2b9f[_0x43e7('0x25')])));}})[_0x43e7('0x26')](function(_0x51f4d7){var _0x52b7b3=_0x51f4d7[_0x43e7('0x27')]||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x29'),_0x52b7b3,JSON[_0x43e7('0x20')](_0x51f4d7));});}function getUser(_0xb1fc63,_0x5087d7,_0x33a1a5){if(intUtil[_0x43e7('0x2a')](_0x5087d7)){logger[_0x43e7('0x14')](_0x43e7('0x2b'),_0x5087d7);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0xb1fc63[_0x43e7('0x1e')]),'qs':{'operation':_0x43e7('0x2d'),'username':_0xb1fc63[_0x43e7('0x1f')],'sessionName':_0x33a1a5[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x2f'),_0x5087d7)},'json':!![]})[_0x43e7('0x21')](function(_0x4bdb17){if(_0x4bdb17[_0x43e7('0x22')]&&_0x4bdb17[_0x43e7('0x23')][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x31'));return BPromise['resolve']({'id':_0x4bdb17[_0x43e7('0x23')][0x0]['id'],'email':_0x4bdb17[_0x43e7('0x23')][0x0][_0x43e7('0x32')],'name':_0x4bdb17[_0x43e7('0x23')][0x0]['first_name']+'\x20'+_0x4bdb17['result']['last_name']});}else{logger[_0x43e7('0x14')](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')});}})['catch'](function(_0x47baee){var _0x4ac23d=_0x47baee['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x4ac23d,JSON[_0x43e7('0x20')](_0x47baee));});}else{logger['info'](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')})[_0x43e7('0x26')](function(_0x101d45){var _0x4f1a5f=_0x101d45['statusCode']||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x37'),_0x4f1a5f,JSON[_0x43e7('0x20')](_0x101d45));});}}function getEndUser(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589){logger[_0x43e7('0x14')]('Searching\x20end\x20user\x20with\x20phone',_0x1ed538);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x16cdba[_0x43e7('0x1e')]),'qs':{'operation':'query','username':_0x16cdba[_0x43e7('0x1f')],'sessionName':_0x1d4589[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x38'),_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538)},'json':!![]})[_0x43e7('0x21')](function(_0x234d8f){if(_0x234d8f['success']&&_0x234d8f['result'][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x39'));return BPromise[_0x43e7('0x34')]({'id':_0x234d8f[_0x43e7('0x23')][0x0]['id'],'name':_0x234d8f['result'][0x0][_0x43e7('0x3a')]+'\x20'+_0x234d8f[_0x43e7('0x23')][0x0]['lastname'],'phone':_0x1ed538});}else{logger[_0x43e7('0x14')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x43e7('0x1b'),'uri':util['format'](_0x43e7('0x1d'),_0x16cdba[_0x43e7('0x1e')]),'form':{'operation':_0x43e7('0x3b'),'sessionName':_0x1d4589[_0x43e7('0x2e')],'elementType':'Contacts','element':JSON['stringify']({'lastname':_0x1b1440,'phone':_0x1ed538,'assigned_user_id':'\x20'})},'json':!![]})[_0x43e7('0x21')](function(_0x40c509){logger[_0x43e7('0x14')](_0x43e7('0x3c'));return BPromise['resolve']({'id':_0x40c509['result']['id'],'name':_0x40c509['result'][_0x43e7('0x3d')],'phone':_0x40c509['result'][_0x43e7('0x3e')]});})['catch'](function(_0x5b28db){var _0x46b2e6=_0x5b28db['statusCode']||0x1f4;logger[_0x43e7('0x25')](_0x43e7('0x28'),_0x43e7('0x3f'),_0x46b2e6,JSON[_0x43e7('0x20')](_0x5b28db));});}});}function getConnection(_0x4fc5e8){var _0x91f1e4=_0x4fc5e8[_0x43e7('0x1f')];var _0x23a611=_0x4fc5e8[_0x43e7('0x40')];return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x4fc5e8['remoteUri']),'qs':{'operation':_0x43e7('0x41'),'username':_0x91f1e4},'json':!![]})[_0x43e7('0x21')](function(_0x212841){if(_0x212841['success']){return request({'method':'POST','uri':util['format'](_0x43e7('0x1d'),_0x4fc5e8[_0x43e7('0x1e')]),'form':{'operation':'login','username':_0x91f1e4,'accessKey':md5(_0x212841[_0x43e7('0x23')][_0x43e7('0x42')]+_0x23a611)},'json':!![]});}})[_0x43e7('0x21')](function(_0x560329){if(_0x560329['success']){return BPromise['resolve'](_0x560329['result']);}else{throw new Error(util[_0x43e7('0x1c')](_0x43e7('0x43'),_0x4fc5e8['id']));}})['catch'](function(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x27')]||0x1f4;logger[_0x43e7('0x25')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x43e7('0x44'),_0x82d32f,JSON['stringify'](_0x23e7cb));});}function request(_0x4bebd4){logger[_0x43e7('0x14')](_0x43e7('0x45'),JSON[_0x43e7('0x20')](_0x4bebd4));return rp(_0x4bebd4);}exports[_0x43e7('0x46')]=function(_0x13503c,_0x2351cf,_0x1cd87c,_0x256ddd,_0x473fca,_0x2b5515){var _0x58dfd0,_0x119d34,_0x46c910,_0x499c03;_0x2b5515[_0x43e7('0x1e')]=intUtil['stripTrailingSlash'](_0x2b5515[_0x43e7('0x1e')]);if(_0x473fca&&_0x473fca[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x48'),_0x43e7('0x49'));_0x2351cf['recordingURL']=util['format'](_0x43e7('0x4a'),_0x2b5515[_0x43e7('0x4b')],_0x2351cf[_0x43e7('0x4c')],md5(_0x2351cf[_0x43e7('0x4c')]));}else{_0x2351cf[_0x43e7('0x4d')]='';}return getConnection(_0x2b5515)[_0x43e7('0x21')](function(_0xa47464){_0x499c03=_0xa47464;return getUser(_0x2b5515,_0x256ddd[_0x43e7('0x4e')],_0x499c03);})[_0x43e7('0x21')](function(_0x24e758){_0x58dfd0=_0x24e758;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x58dfd0['id']);return getEndUser(_0x2b5515,_0x2351cf[_0x43e7('0x4f')],_0x2351cf[_0x43e7('0x50')],_0x499c03);})['then'](function(_0x4314d8){_0x119d34=_0x4314d8;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x119d34['id']);return createTicket(_0x2b5515,_0x58dfd0,_0x119d34,_0x1cd87c,_0x2351cf,_0x1cd87c['Fields'],_0x499c03);})['then'](function(_0x459c13){_0x46c910=_0x459c13;logger[_0x43e7('0x14')]('Ticket\x20created!');logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x46c910['id']);var _0x49a6ce=util[_0x43e7('0x1c')](_0x43e7('0x52'),_0x2b5515[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x46c910['id'],'x')[0x1]);logger[_0x43e7('0x14')]('[QUEUE]',_0x43e7('0x54'));emit(util[_0x43e7('0x1c')]('user:%s',_0x256ddd[_0x43e7('0x13')]),_0x43e7('0x55'),{'uri':_0x49a6ce});})[_0x43e7('0x26')](function(_0x5bb536){logger['error']('[QUEUE]',JSON[_0x43e7('0x20')](_0x5bb536));});};exports[_0x43e7('0x56')]=function(_0x323cf7,_0x3a6404,_0x52ea9c,_0x5a50fc,_0x1b27da,_0x8b50bb,_0x140438){var _0x5dd349,_0x5ea0db,_0x4438c0,_0x1a7cb5;_0x8b50bb[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x1e')]);_0x8b50bb[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x4b')]);if(_0x140438&&_0x140438[_0x43e7('0x58')]&&_0x140438[_0x43e7('0x58')]!==_0x43e7('0x59')){logger['info']('[OUTBOUND]',_0x43e7('0x49'));_0x3a6404['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8b50bb[_0x43e7('0x4b')],_0x3a6404[_0x43e7('0x4c')],md5(_0x3a6404['uniqueid']));}return getConnection(_0x8b50bb)[_0x43e7('0x21')](function(_0x135791){_0x1a7cb5=_0x135791;return getUser(_0x8b50bb,_0x5a50fc[_0x43e7('0x4e')],_0x1a7cb5);})['then'](function(_0x2b7406){_0x5dd349=_0x2b7406;logger[_0x43e7('0x14')](_0x43e7('0x5a'),_0x5dd349['id']);return getEndUser(_0x8b50bb,_0x3a6404[_0x43e7('0x5b')],_0x3a6404[_0x43e7('0x5c')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x1e02fa){_0x5ea0db=_0x1e02fa;logger['info'](_0x43e7('0x51'),_0x5ea0db['id']);return createTicket(_0x8b50bb,_0x5dd349,_0x5ea0db,_0x52ea9c,_0x3a6404,_0x52ea9c[_0x43e7('0x5d')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x549f4e){_0x4438c0=_0x549f4e;logger['info'](_0x43e7('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4438c0['id']);var _0x1b793d=util[_0x43e7('0x1c')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x8b50bb[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x4438c0['id'],'x')[0x1]);logger[_0x43e7('0x14')](_0x43e7('0x5f'),_0x43e7('0x54'));emit(util[_0x43e7('0x1c')](_0x43e7('0x60'),_0x5a50fc['name']),_0x43e7('0x55'),{'uri':_0x1b793d});})[_0x43e7('0x26')](function(_0x4e5956){logger[_0x43e7('0x25')]('[OUTBOUND]',JSON[_0x43e7('0x20')](_0x4e5956));});};exports[_0x43e7('0x61')]=function(_0x37301b,_0x1ca24b,_0x506361,_0x2d25b5,_0x2646c2,_0xf929a5){var _0x556001,_0x17889c,_0x38fa5b,_0x219dc6;_0xf929a5[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0xf929a5['remoteUri']);_0xf929a5[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0xf929a5[_0x43e7('0x4b')]);if(_0x2646c2&&_0x2646c2[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x62'),_0x43e7('0x49'));_0x1ca24b['recordingURL']=util['format'](_0x43e7('0x4a'),_0xf929a5['serverUrl'],_0x1ca24b['uniqueid'],md5(_0x1ca24b['uniqueid']));}else{_0x1ca24b[_0x43e7('0x4d')]='';}return getConnection(_0xf929a5)[_0x43e7('0x21')](function(_0x230fda){_0x219dc6=_0x230fda;return getUser(_0xf929a5,'',_0x219dc6);})[_0x43e7('0x21')](function(_0x18713b){_0x556001=_0x18713b;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x556001['id']);return getEndUser(_0xf929a5,_0x1ca24b[_0x43e7('0x4f')],_0x1ca24b[_0x43e7('0x50')],_0x219dc6);})[_0x43e7('0x21')](function(_0x5b4c76){_0x17889c=_0x5b4c76;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x17889c['id']);return createTicket(_0xf929a5,_0x556001,_0x17889c,_0x506361,_0x1ca24b,_0x506361[_0x43e7('0x5d')],_0x219dc6);})[_0x43e7('0x21')](function(_0x1afea6){_0x38fa5b=_0x1afea6;logger[_0x43e7('0x14')](_0x43e7('0x5e'));logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x38fa5b['id']);})['catch'](function(_0x55990c){logger[_0x43e7('0x25')](_0x43e7('0x62'),JSON['stringify'](_0x55990c));});}; \ No newline at end of file +var _0x008c=['util','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','merge','Descriptions','POST','format','%s/webservice.php','remoteUri','username','stringify','then','success','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','createTicket','validateEmail','info','Getting\x20agent\x20with\x20email','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','length','Agent\x20found!','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','firstname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','create','Contacts','Enduser\x20created.','lastname','phone','getEndUser','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','split','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','lodash','request-promise','bluebird','md5'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x008c,0x188));var _0xc008=function(_0x566622,_0x399507){_0x566622=_0x566622-0x0;var _0x1851dd=_0x008c[_0x566622];return _0x1851dd;};'use strict';var _=require(_0xc008('0x0'));var rp=require(_0xc008('0x1'));var BPromise=require(_0xc008('0x2'));var md5=require(_0xc008('0x3'));var util=require(_0xc008('0x4'));var Redis=require('ioredis');var intUtil=require(_0xc008('0x5'));var config=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));config[_0xc008('0x9')]=_[_0xc008('0xa')](config[_0xc008('0x9')],{'host':_0xc008('0xb'),'port':0x18eb});var io=require(_0xc008('0xc'))(new Redis(config['redis']));function emit(_0x428fa9,_0x5aa09b,_0x30be38){io['to'](_0x428fa9)['emit'](_0x5aa09b,_0x30be38);}function getCustomFields(_0x52041f,_0x27830d){var _0x7231b4={};if(_0x52041f['length']>0x0){_['forEach'](_0x52041f,function(_0x543eb8){if(_0x543eb8[_0xc008('0xd')]===_0xc008('0xe')&&_0x543eb8['idField']){_0x7231b4[_0x543eb8[_0xc008('0xf')]]=_0x543eb8[_0xc008('0x10')][_0xc008('0x11')]();}else if(_0x543eb8[_0xc008('0xd')]===_0xc008('0x12')&&_0x543eb8[_0xc008('0x13')]&&_0x543eb8[_0xc008('0xf')]&&_0x27830d[_0x543eb8['variableName']]){_0x7231b4[_0x543eb8['idField']]=_0x27830d[_0x543eb8[_0xc008('0x13')]]['toString']();}else if(_0x543eb8[_0xc008('0xd')]===_0xc008('0x14')&&_0x543eb8[_0xc008('0x15')]&&_0x543eb8[_0xc008('0x15')][_0xc008('0x16')]&&_0x543eb8['idField']&&_0x27830d[_0x543eb8['Variable']['name'][_0xc008('0x17')]()]){_0x7231b4[_0x543eb8[_0xc008('0xf')]]=_0x27830d[_0x543eb8[_0xc008('0x15')][_0xc008('0x16')]['toLowerCase']()]['toString']();}});}return _0x7231b4;}function createTicket(_0x540e45,_0x5c2668,_0x46042b,_0x462af5,_0x501137,_0x813397,_0x5906e6){logger['info']('Creating\x20new\x20ticket...');var _0x50261c=_[_0xc008('0x18')]({'parent_id':'','assigned_user_id':_0x5c2668['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil['getString'](_0x462af5['Subjects'],_0x501137,'\x20'),'description':intUtil['getString'](_0x462af5[_0xc008('0x19')],_0x501137,'\x0a'),'contact_id':_0x46042b['id']},getCustomFields(_0x813397,_0x501137));var _0x4777a6={'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x540e45[_0xc008('0x1d')]),'form':{'operation':'create','username':_0x540e45[_0xc008('0x1e')],'sessionName':_0x5906e6['sessionName'],'elementType':'HelpDesk','element':JSON[_0xc008('0x1f')](_0x50261c)},'json':!![]};return request(_0x4777a6)[_0xc008('0x20')](function(_0x2e3cfb){if(_0x2e3cfb[_0xc008('0x21')]){return BPromise['resolve']({'id':_0x2e3cfb['result']['id']});}else{throw new Error(util['format'](_0xc008('0x22'),JSON[_0xc008('0x1f')](_0x2e3cfb[_0xc008('0x23')])));}})[_0xc008('0x24')](function(_0x5bebd9){var _0x5e2aca=_0x5bebd9['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xc008('0x25'),_0x5e2aca,JSON[_0xc008('0x1f')](_0x5bebd9));});}function getUser(_0x25eae4,_0x529961,_0x24c14c){if(intUtil[_0xc008('0x26')](_0x529961)){logger[_0xc008('0x27')](_0xc008('0x28'),_0x529961);return request({'method':'GET','uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x25eae4['remoteUri']),'qs':{'operation':'query','username':_0x25eae4['username'],'sessionName':_0x24c14c[_0xc008('0x29')],'query':util[_0xc008('0x1b')](_0xc008('0x2a'),_0x529961)},'json':!![]})[_0xc008('0x20')](function(_0x1de04b){if(_0x1de04b[_0xc008('0x21')]&&_0x1de04b[_0xc008('0x2b')][_0xc008('0x2c')]){logger[_0xc008('0x27')](_0xc008('0x2d'));return BPromise[_0xc008('0x2e')]({'id':_0x1de04b[_0xc008('0x2b')][0x0]['id'],'email':_0x1de04b['result'][0x0][_0xc008('0x2f')],'name':_0x1de04b[_0xc008('0x2b')][0x0]['first_name']+'\x20'+_0x1de04b[_0xc008('0x2b')][_0xc008('0x30')]});}else{logger[_0xc008('0x27')](_0xc008('0x31'));return BPromise[_0xc008('0x2e')]({'id':_0x24c14c[_0xc008('0x32')],'email':_0x25eae4[_0xc008('0x1e')],'name':_0xc008('0x33')});}})[_0xc008('0x24')](function(_0x4f14d2){var _0x415b87=_0x4f14d2[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')](_0xc008('0x35'),_0xc008('0x36'),_0x415b87,JSON[_0xc008('0x1f')](_0x4f14d2));});}else{logger[_0xc008('0x27')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc008('0x2e')]({'id':_0x24c14c[_0xc008('0x32')],'email':_0x25eae4['username'],'name':_0xc008('0x33')})[_0xc008('0x24')](function(_0x5e38d5){var _0x263473=_0x5e38d5[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x263473,JSON['stringify'](_0x5e38d5));});}}function getEndUser(_0x234f2a,_0x518024,_0x3dd0ac,_0x3884dd){logger[_0xc008('0x27')](_0xc008('0x37'),_0x3dd0ac);return request({'method':_0xc008('0x38'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x234f2a[_0xc008('0x1d')]),'qs':{'operation':_0xc008('0x39'),'username':_0x234f2a[_0xc008('0x1e')],'sessionName':_0x3884dd[_0xc008('0x29')],'query':util[_0xc008('0x1b')](_0xc008('0x3a'),_0x3dd0ac,_0x3dd0ac,_0x3dd0ac,_0x3dd0ac,_0x3dd0ac)},'json':!![]})[_0xc008('0x20')](function(_0x4cace5){if(_0x4cace5[_0xc008('0x21')]&&_0x4cace5[_0xc008('0x2b')][_0xc008('0x2c')]){logger[_0xc008('0x27')]('Enduser\x20found!');return BPromise[_0xc008('0x2e')]({'id':_0x4cace5[_0xc008('0x2b')][0x0]['id'],'name':_0x4cace5[_0xc008('0x2b')][0x0][_0xc008('0x3b')]+'\x20'+_0x4cace5[_0xc008('0x2b')][0x0]['lastname'],'phone':_0x3dd0ac});}else{logger[_0xc008('0x27')](_0xc008('0x3c'));return request({'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x234f2a['remoteUri']),'form':{'operation':_0xc008('0x3d'),'sessionName':_0x3884dd[_0xc008('0x29')],'elementType':_0xc008('0x3e'),'element':JSON[_0xc008('0x1f')]({'lastname':_0x518024,'phone':_0x3dd0ac,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x26cd05){logger[_0xc008('0x27')](_0xc008('0x3f'));return BPromise['resolve']({'id':_0x26cd05[_0xc008('0x2b')]['id'],'name':_0x26cd05['result'][_0xc008('0x40')],'phone':_0x26cd05['result'][_0xc008('0x41')]});})[_0xc008('0x24')](function(_0x5a5d85){var _0x31007c=_0x5a5d85[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xc008('0x42'),_0x31007c,JSON[_0xc008('0x1f')](_0x5a5d85));});}});}function getConnection(_0x200469){var _0x44fc5d=_0x200469[_0xc008('0x1e')];var _0x372305=_0x200469['accessKey'];return request({'method':'GET','uri':util['format'](_0xc008('0x1c'),_0x200469[_0xc008('0x1d')]),'qs':{'operation':_0xc008('0x43'),'username':_0x44fc5d},'json':!![]})[_0xc008('0x20')](function(_0x25289f){if(_0x25289f[_0xc008('0x21')]){return request({'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')]('%s/webservice.php',_0x200469['remoteUri']),'form':{'operation':'login','username':_0x44fc5d,'accessKey':md5(_0x25289f[_0xc008('0x2b')][_0xc008('0x44')]+_0x372305)},'json':!![]});}})[_0xc008('0x20')](function(_0x511383){if(_0x511383[_0xc008('0x21')]){return BPromise[_0xc008('0x2e')](_0x511383[_0xc008('0x2b')]);}else{throw new Error(util[_0xc008('0x1b')](_0xc008('0x45'),_0x200469['id']));}})[_0xc008('0x24')](function(_0x17ec90){var _0x405e87=_0x17ec90[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s','getConnection',_0x405e87,JSON[_0xc008('0x1f')](_0x17ec90));});}function request(_0x51cb14){logger[_0xc008('0x27')](_0xc008('0x46'),JSON[_0xc008('0x1f')](_0x51cb14));return rp(_0x51cb14);}exports['queue']=function(_0x144ab2,_0x32b435,_0xee64,_0x8b9775,_0x750cc9,_0x51105f){var _0x3a7b3b,_0x27b022,_0x4b4c6d,_0x24f775;_0x51105f[_0xc008('0x1d')]=intUtil['stripTrailingSlash'](_0x51105f['remoteUri']);if(_0x750cc9&&_0x750cc9[_0xc008('0x47')]){logger[_0xc008('0x27')](_0xc008('0x48'),_0xc008('0x49'));_0x32b435[_0xc008('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51105f[_0xc008('0x4b')],_0x32b435['uniqueid'],md5(_0x32b435[_0xc008('0x4c')]));}else{_0x32b435[_0xc008('0x4a')]='';}return getConnection(_0x51105f)[_0xc008('0x20')](function(_0x2f1105){_0x24f775=_0x2f1105;return getUser(_0x51105f,_0x8b9775[_0xc008('0x4d')],_0x24f775);})[_0xc008('0x20')](function(_0x49d8b0){_0x3a7b3b=_0x49d8b0;logger[_0xc008('0x27')](_0xc008('0x4e'),_0x3a7b3b['id']);return getEndUser(_0x51105f,_0x32b435[_0xc008('0x4f')],_0x32b435[_0xc008('0x50')],_0x24f775);})[_0xc008('0x20')](function(_0x5aa385){_0x27b022=_0x5aa385;logger[_0xc008('0x27')]('The\x20Enduser\x20ID\x20is:',_0x27b022['id']);return createTicket(_0x51105f,_0x3a7b3b,_0x27b022,_0xee64,_0x32b435,_0xee64['Fields'],_0x24f775);})['then'](function(_0x89bb20){_0x4b4c6d=_0x89bb20;logger[_0xc008('0x27')](_0xc008('0x51'));logger['info'](_0xc008('0x52'),_0x4b4c6d['id']);var _0x2d8361=util[_0xc008('0x1b')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x51105f[_0xc008('0x1d')],_[_0xc008('0x53')](_0x4b4c6d['id'],'x')[0x1]);logger[_0xc008('0x27')](_0xc008('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc008('0x1b')]('user:%s',_0x8b9775[_0xc008('0x16')]),_0xc008('0x54'),{'uri':_0x2d8361});})[_0xc008('0x24')](function(_0x943c91){logger[_0xc008('0x23')](_0xc008('0x48'),JSON['stringify'](_0x943c91));});};exports[_0xc008('0x55')]=function(_0x570001,_0x5bf4a9,_0x37ce5e,_0x30aa1e,_0x56e755,_0xb1befa,_0xb8ba7){var _0x3e373e,_0x4517c0,_0x21ee6d,_0x31a339;_0xb1befa[_0xc008('0x1d')]=intUtil['stripTrailingSlash'](_0xb1befa[_0xc008('0x1d')]);_0xb1befa[_0xc008('0x4b')]=intUtil[_0xc008('0x56')](_0xb1befa[_0xc008('0x4b')]);if(_0xb8ba7&&_0xb8ba7[_0xc008('0x57')]&&_0xb8ba7[_0xc008('0x57')]!==_0xc008('0x58')){logger[_0xc008('0x27')](_0xc008('0x59'),_0xc008('0x49'));_0x5bf4a9[_0xc008('0x4a')]=util[_0xc008('0x1b')](_0xc008('0x5a'),_0xb1befa[_0xc008('0x4b')],_0x5bf4a9['uniqueid'],md5(_0x5bf4a9[_0xc008('0x4c')]));}return getConnection(_0xb1befa)[_0xc008('0x20')](function(_0x3d3a7e){_0x31a339=_0x3d3a7e;return getUser(_0xb1befa,_0x30aa1e['email'],_0x31a339);})[_0xc008('0x20')](function(_0x3214df){_0x3e373e=_0x3214df;logger['info']('The\x20User\x20ID\x20is:',_0x3e373e['id']);return getEndUser(_0xb1befa,_0x5bf4a9[_0xc008('0x5b')],_0x5bf4a9[_0xc008('0x5c')],_0x31a339);})[_0xc008('0x20')](function(_0x39083c){_0x4517c0=_0x39083c;logger[_0xc008('0x27')](_0xc008('0x5d'),_0x4517c0['id']);return createTicket(_0xb1befa,_0x3e373e,_0x4517c0,_0x37ce5e,_0x5bf4a9,_0x37ce5e[_0xc008('0x5e')],_0x31a339);})[_0xc008('0x20')](function(_0x39e219){_0x21ee6d=_0x39e219;logger[_0xc008('0x27')](_0xc008('0x51'));logger['info'](_0xc008('0x52'),_0x21ee6d['id']);var _0x25a52b=util[_0xc008('0x1b')](_0xc008('0x5f'),_0xb1befa['remoteUri'],_[_0xc008('0x53')](_0x21ee6d['id'],'x')[0x1]);logger['info'](_0xc008('0x59'),_0xc008('0x60'));emit(util[_0xc008('0x1b')]('user:%s',_0x30aa1e[_0xc008('0x16')]),_0xc008('0x54'),{'uri':_0x25a52b});})[_0xc008('0x24')](function(_0x553f5c){logger[_0xc008('0x23')]('[OUTBOUND]',JSON[_0xc008('0x1f')](_0x553f5c));});};exports[_0xc008('0x61')]=function(_0x23012c,_0x6fe732,_0x295ec7,_0x4ca4a6,_0x3c30db,_0x3f2342){var _0x49493b,_0x3efb77,_0x5233bb,_0x278cbe;_0x3f2342['remoteUri']=intUtil[_0xc008('0x56')](_0x3f2342['remoteUri']);_0x3f2342[_0xc008('0x4b')]=intUtil[_0xc008('0x56')](_0x3f2342[_0xc008('0x4b')]);if(_0x3c30db&&_0x3c30db[_0xc008('0x47')]){logger['info'](_0xc008('0x62'),_0xc008('0x49'));_0x6fe732[_0xc008('0x4a')]=util[_0xc008('0x1b')](_0xc008('0x5a'),_0x3f2342[_0xc008('0x4b')],_0x6fe732[_0xc008('0x4c')],md5(_0x6fe732[_0xc008('0x4c')]));}else{_0x6fe732['recordingURL']='';}return getConnection(_0x3f2342)[_0xc008('0x20')](function(_0x530c2f){_0x278cbe=_0x530c2f;return getUser(_0x3f2342,'',_0x278cbe);})['then'](function(_0x4c84da){_0x49493b=_0x4c84da;logger[_0xc008('0x27')](_0xc008('0x4e'),_0x49493b['id']);return getEndUser(_0x3f2342,_0x6fe732[_0xc008('0x4f')],_0x6fe732[_0xc008('0x50')],_0x278cbe);})[_0xc008('0x20')](function(_0x2e9646){_0x3efb77=_0x2e9646;logger[_0xc008('0x27')](_0xc008('0x5d'),_0x3efb77['id']);return createTicket(_0x3f2342,_0x49493b,_0x3efb77,_0x295ec7,_0x6fe732,_0x295ec7[_0xc008('0x5e')],_0x278cbe);})['then'](function(_0x38b603){_0x5233bb=_0x38b603;logger[_0xc008('0x27')](_0xc008('0x51'));logger[_0xc008('0x27')](_0xc008('0x52'),_0x5233bb['id']);})[_0xc008('0x24')](function(_0x23d4ff){logger[_0xc008('0x23')](_0xc008('0x62'),JSON[_0xc008('0x1f')](_0x23d4ff));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index f1f3c0f..a6228f0 100644 --- a/server/services/ami/trigger/integration/zendesk.js +++ b/server/services/ami/trigger/integration/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x984b=['push','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','error','abandoned','[ABANDONED]','The\x20User\x20ID\x20is:','util','ioredis','./util','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','toString','debug','stringify','GET','map','forEach','type','string','customField','nameField','toLowerCase','content','idField','custom_fields','variable','variableName'];(function(_0x57911a,_0x2686ad){var _0x53040d=function(_0x42fce9){while(--_0x42fce9){_0x57911a['push'](_0x57911a['shift']());}};_0x53040d(++_0x2686ad);}(_0x984b,0xee));var _0xb984=function(_0x341e62,_0x26997e){_0x341e62=_0x341e62-0x0;var _0x1b1323=_0x984b[_0x341e62];return _0x1b1323;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xb984('0x0'));var Redis=require(_0xb984('0x1'));var intUtil=require(_0xb984('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xb984('0x3'));config[_0xb984('0x4')]=_['defaults'](config['redis'],{'host':_0xb984('0x5'),'port':0x18eb});var io=require(_0xb984('0x6'))(new Redis(config['redis']));function emit(_0x7405cd,_0x1a00d6,_0x4d72b7){io['to'](_0x7405cd)[_0xb984('0x7')](_0x1a00d6,_0x4d72b7);}var headers={'Content-Type':'application/json','Accept':_0xb984('0x8')};function getTicket(_0x42dfd9,_0x124143,_0x2f4e77,_0xf66bad,_0x382f2b){logger[_0xb984('0x9')](_0xb984('0xa'));return request({'uri':util[_0xb984('0xb')](_0xb984('0xc'),_0x42dfd9[_0xb984('0xd')]),'method':_0xb984('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x2f4e77['id'],'submitter_id':_0x124143?_0x124143['id']:undefined,'assignee_id':_0x124143?_0x124143['id']:undefined,'tags':getTags(_0xf66bad[_0xb984('0xf')],'name'),'subject':intUtil[_0xb984('0x10')](_0xf66bad[_0xb984('0x11')],_0x382f2b,'\x20'),'description':intUtil['getString'](_0xf66bad[_0xb984('0x12')],_0x382f2b,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb984('0x10')](_0xf66bad['Descriptions'],_0x382f2b,'\x0a')}},getCustomFields(_0xf66bad[_0xb984('0x13')],_0x382f2b))}})[_0xb984('0x14')](function(_0x549791){logger[_0xb984('0x9')](_0xb984('0x15'));return _0x549791['ticket'];});}function getUser(_0x6fae41,_0x5cd1aa){if(intUtil[_0xb984('0x16')](_0x5cd1aa)){logger[_0xb984('0x9')](_0xb984('0x17'),_0x5cd1aa);return request({'uri':util[_0xb984('0xb')]('%s/search.json',_0x6fae41[_0xb984('0xd')]),'qs':{'query':util[_0xb984('0xb')](_0xb984('0x18'),_0x5cd1aa)}})[_0xb984('0x14')](function(_0x229a40){if(_0x229a40[_0xb984('0x19')]){logger['info'](_0xb984('0x1a'));return _[_0xb984('0x1b')](_0x229a40[_0xb984('0x1c')],{'email':_0x5cd1aa,'role':_0xb984('0x1d')});}else{logger[_0xb984('0x9')](_0xb984('0x1e'));return request({'uri':util['format'](_0xb984('0x1f'),_0x6fae41[_0xb984('0xd')])})['then'](function(_0x44b570){logger[_0xb984('0x9')](_0xb984('0x20'));return _0x44b570[_0xb984('0x21')];});}});}else{logger[_0xb984('0x9')](_0xb984('0x1e'));return request({'uri':util[_0xb984('0xb')]('%s/users/me.json',_0x6fae41[_0xb984('0xd')])})[_0xb984('0x14')](function(_0x1b6be3){logger['info'](_0xb984('0x20'));return _0x1b6be3[_0xb984('0x21')];});}}function getEndUser(_0x1cb2c2,_0x2d0450,_0x1f7b62){logger[_0xb984('0x9')](_0xb984('0x22'),_0x1f7b62);return request({'uri':util[_0xb984('0xb')]('%s/search.json',_0x1cb2c2[_0xb984('0xd')]),'qs':{'query':util[_0xb984('0xb')](_0xb984('0x23'),_0x1f7b62)}})[_0xb984('0x14')](function(_0x4fb896){var _0xa44895;if(_0x4fb896[_0xb984('0x1c')][_0xb984('0x24')]){_0x4fb896['results']=_[_0xb984('0x25')](_0x4fb896[_0xb984('0x1c')],{'suspended':![],'role':_0xb984('0x26')});if(_0x4fb896[_0xb984('0x1c')]['length']){_0xa44895=_['first'](_0x4fb896['results']);}}if(_0xa44895){logger[_0xb984('0x9')](_0xb984('0x27'));return _0xa44895;}else{logger['info'](_0xb984('0x28'));return request({'uri':util[_0xb984('0xb')](_0xb984('0x29'),_0x1cb2c2[_0xb984('0xd')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0xb984('0xb')](_0xb984('0x2a'),_0x2d0450||_0x1f7b62),'phone':_0x1f7b62}}})[_0xb984('0x14')](function(_0x135435){logger['info'](_0xb984('0x2b'));return _0x135435[_0xb984('0x21')];});}});}function getAuth(_0x1805e4){var _0x3c4687;if(_0x1805e4[_0xb984('0x2c')]===_0xb984('0x2d')){_0x3c4687=util['format'](_0xb984('0x2e'),_0x1805e4[_0xb984('0x2f')],_0x1805e4[_0xb984('0x2d')]);}else if(_0x1805e4[_0xb984('0x2c')]===_0xb984('0x30')){_0x3c4687=util[_0xb984('0xb')]('%s/token:%s',_0x1805e4[_0xb984('0x2f')],_0x1805e4[_0xb984('0x30')]);}return util['format']('Basic\x20%s',new Buffer(_0x3c4687)[_0xb984('0x31')]('base64'));}function request(_0xad9e0c){logger[_0xb984('0x32')]('[HTTP]',JSON[_0xb984('0x33')](_0xad9e0c));return rp(_['defaults'](_0xad9e0c,{'method':_0xb984('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x5c25a9,_0x19bd91){var _0x557302=[];if(_0x5c25a9&&_0x5c25a9['length']>0x0){_0x557302=_[_0xb984('0x35')](_0x5c25a9,_0x19bd91);}return _0x557302;}function getCustomFields(_0x4b0438,_0x4dac3f){var _0x26b36c=[];var _0x1fd248={'custom_fields':[]};if(_0x4b0438['length']>0x0){_[_0xb984('0x36')](_0x4b0438,function(_0x446f45){if(_0x446f45[_0xb984('0x37')]===_0xb984('0x38')&&_0x446f45['nameField']&&!_0x446f45[_0xb984('0x39')]){_0x1fd248[_0x446f45[_0xb984('0x3a')][_0xb984('0x3b')]()]=_0x446f45[_0xb984('0x3c')][_0xb984('0x31')]();}else if(_0x446f45[_0xb984('0x37')]===_0xb984('0x38')&&_0x446f45[_0xb984('0x3d')]&&_0x446f45[_0xb984('0x39')]){_0x1fd248[_0xb984('0x3e')]['push']({'id':_0x446f45[_0xb984('0x3d')],'value':_0x446f45[_0xb984('0x3c')][_0xb984('0x31')]()});}else if(_0x446f45[_0xb984('0x37')]===_0xb984('0x3f')&&_0x446f45[_0xb984('0x40')]&&_0x446f45[_0xb984('0x3d')]&&_0x446f45[_0xb984('0x39')]){_0x4dac3f[_0x446f45['variableName']]&&_0x1fd248['custom_fields'][_0xb984('0x41')]({'id':_0x446f45['idField'],'value':_0x4dac3f[_0x446f45[_0xb984('0x40')]][_0xb984('0x31')]()});}else if(_0x446f45[_0xb984('0x37')]===_0xb984('0x42')&&_0x446f45['Variable']&&_0x446f45[_0xb984('0x43')][_0xb984('0x44')]&&_0x446f45['idField']&&_0x446f45[_0xb984('0x39')]){_0x4dac3f[_0x446f45[_0xb984('0x43')][_0xb984('0x44')][_0xb984('0x3b')]()]&&_0x1fd248[_0xb984('0x3e')][_0xb984('0x41')]({'id':_0x446f45[_0xb984('0x3d')],'value':_0x4dac3f[_0x446f45['Variable'][_0xb984('0x44')][_0xb984('0x3b')]()]['toString']()});}});}return _0x1fd248;}exports['queue']=function(_0x1ddb47,_0x6396b5,_0x3f1ea9,_0x248800,_0x1acc7a,_0x56a3bf){var _0x664cb1,_0x40666f;_0x56a3bf[_0xb984('0xd')]=intUtil[_0xb984('0x45')](_0x56a3bf[_0xb984('0xd')]);_0x56a3bf[_0xb984('0x46')]=intUtil[_0xb984('0x45')](_0x56a3bf[_0xb984('0x46')]);if(_0x1acc7a&&_0x1acc7a[_0xb984('0x47')]){logger[_0xb984('0x9')]('[QUEUE]',_0xb984('0x48'));_0x6396b5[_0xb984('0x49')]=util['format'](_0xb984('0x4a'),_0x56a3bf[_0xb984('0x46')],_0x6396b5[_0xb984('0x4b')],md5(_0x6396b5[_0xb984('0x4b')]));}else{_0x6396b5[_0xb984('0x49')]='';}headers[_0xb984('0x4c')]=getAuth(_0x56a3bf);return getUser(_0x56a3bf,_0x248800[_0xb984('0x4d')])[_0xb984('0x14')](function(_0x2989f3){_0x664cb1=_0x2989f3;logger[_0xb984('0x9')]('The\x20User\x20ID\x20is:',_0x664cb1['id']);return getEndUser(_0x56a3bf,_0x6396b5[_0xb984('0x4e')],_0x6396b5[_0xb984('0x4f')]);})[_0xb984('0x14')](function(_0x2ae0d8){_0x40666f=_0x2ae0d8;logger[_0xb984('0x9')](_0xb984('0x50'),_0x40666f['id']);return getTicket(_0x56a3bf,_0x664cb1,_0x40666f,_0x3f1ea9,_0x6396b5);})[_0xb984('0x14')](function(_0x445f90){if(_0x445f90){logger[_0xb984('0x9')]('The\x20Ticket\x20ID\x20is:',_0x445f90['id']);switch(_0x56a3bf[_0xb984('0x37')]){case _0xb984('0x51'):logger[_0xb984('0x9')]('[QUEUE]',_0xb984('0x52'));return request({'uri':util[_0xb984('0xb')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x56a3bf[_0xb984('0xd')],_0x664cb1['id'],_0x445f90['id']),'method':'POST'});case _0xb984('0x53'):logger[_0xb984('0x9')]('[QUEUE]',_0xb984('0x54'));emit(util[_0xb984('0xb')](_0xb984('0x55'),_0x248800[_0xb984('0x44')]),_0xb984('0x56'),{'uri':util[_0xb984('0xb')]('%s/agent/tickets/%s',_0x56a3bf[_0xb984('0xd')],_0x445f90['id'])});break;default:logger['error'](_0xb984('0x57'),_0xb984('0x58'));}}})[_0xb984('0x59')](function(_0x5cf038){logger['error'](_0xb984('0x5a'),util[_0xb984('0x5b')](_0x5cf038,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x493a8b,_0x1e8847,_0x30c135,_0x38cca4,_0x3daaa0,_0x404c4a,_0x3369b1){var _0x5b4c3c,_0x502480;_0x404c4a[_0xb984('0xd')]=intUtil[_0xb984('0x45')](_0x404c4a['remoteUri']);_0x404c4a[_0xb984('0x46')]=intUtil[_0xb984('0x45')](_0x404c4a[_0xb984('0x46')]);if(_0x3369b1&&_0x3369b1[_0xb984('0x5c')]&&_0x3369b1['recordingFormat']!=='none'){logger[_0xb984('0x9')](_0xb984('0x5d'),_0xb984('0x48'));_0x1e8847[_0xb984('0x49')]=util[_0xb984('0xb')](_0xb984('0x4a'),_0x404c4a['serverUrl'],_0x1e8847[_0xb984('0x4b')],md5(_0x1e8847[_0xb984('0x4b')]));}headers[_0xb984('0x4c')]=getAuth(_0x404c4a);return getUser(_0x404c4a,_0x38cca4[_0xb984('0x4d')])[_0xb984('0x14')](function(_0xdb7a50){_0x5b4c3c=_0xdb7a50;logger['info']('The\x20User\x20ID\x20is:',_0x5b4c3c['id']);return getEndUser(_0x404c4a,_0x1e8847['destcalleridname'],_0x1e8847[_0xb984('0x5e')]);})[_0xb984('0x14')](function(_0x36ca94){_0x502480=_0x36ca94;logger[_0xb984('0x9')](_0xb984('0x50'),_0x502480['id']);return getTicket(_0x404c4a,_0x5b4c3c,_0x502480,_0x30c135,_0x1e8847);})['then'](function(_0x434bca){if(_0x434bca){logger[_0xb984('0x9')](_0xb984('0x5f'),_0x434bca['id']);switch(_0x404c4a['type']){case _0xb984('0x51'):logger[_0xb984('0x9')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xb984('0xb')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x404c4a['remoteUri'],_0x5b4c3c['id'],_0x434bca['id']),'method':_0xb984('0xe')});case'newTab':logger[_0xb984('0x9')](_0xb984('0x5d'),_0xb984('0x54'));emit(util[_0xb984('0xb')](_0xb984('0x55'),_0x38cca4[_0xb984('0x44')]),_0xb984('0x56'),{'uri':util[_0xb984('0xb')](_0xb984('0x60'),_0x404c4a[_0xb984('0xd')],_0x434bca['id'])});break;default:logger[_0xb984('0x61')](_0xb984('0x5d'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xb984('0x59')](function(_0x5f126e){logger[_0xb984('0x61')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x5f126e,{'showHidden':!![],'depth':null}));});};exports[_0xb984('0x62')]=function(_0x285e1e,_0x74fc95,_0x531c9f,_0x284f41,_0x35132b,_0x323d6b){var _0x3508cb,_0x434c5c;_0x323d6b[_0xb984('0xd')]=intUtil[_0xb984('0x45')](_0x323d6b[_0xb984('0xd')]);_0x323d6b[_0xb984('0x46')]=intUtil[_0xb984('0x45')](_0x323d6b[_0xb984('0x46')]);if(_0x35132b&&_0x35132b[_0xb984('0x47')]){logger[_0xb984('0x9')](_0xb984('0x63'),'Recording\x20is\x20enabled!');_0x74fc95[_0xb984('0x49')]=util['format'](_0xb984('0x4a'),_0x323d6b['serverUrl'],_0x74fc95[_0xb984('0x4b')],md5(_0x74fc95[_0xb984('0x4b')]));}else{_0x74fc95[_0xb984('0x49')]='';}headers[_0xb984('0x4c')]=getAuth(_0x323d6b);return getUser(_0x323d6b)[_0xb984('0x14')](function(_0x32e1c2){_0x3508cb=_0x32e1c2;logger[_0xb984('0x9')](_0xb984('0x64'),_0x3508cb['id']);return getEndUser(_0x323d6b,_0x74fc95[_0xb984('0x4e')],_0x74fc95[_0xb984('0x4f')]);})[_0xb984('0x14')](function(_0x4247e7){_0x434c5c=_0x4247e7;logger[_0xb984('0x9')]('The\x20Enduser\x20ID\x20is:',_0x434c5c['id']);return getTicket(_0x323d6b,_0x3508cb,_0x434c5c,_0x531c9f,_0x74fc95);})['then'](function(_0x917c53){if(_0x917c53){logger[_0xb984('0x9')](_0xb984('0x5f'),_0x917c53['id']);}})['catch'](function(_0x45ee77){logger[_0xb984('0x61')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x45ee77,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4a80=['info','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','%s/users.json','Enduser\x20created.','authType','%s:%s','password','%s/token:%s','token','Basic\x20%s','base64','[HTTP]','stringify','forEach','type','customField','nameField','toLowerCase','content','toString','string','custom_fields','idField','variable','variableName','push','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','destcalleridnum','[OUTBOUND]','abandoned','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields'];(function(_0x508c0e,_0x537a56){var _0x11848c=function(_0x1b76e6){while(--_0x1b76e6){_0x508c0e['push'](_0x508c0e['shift']());}};_0x11848c(++_0x537a56);}(_0x4a80,0xbe));var _0x04a8=function(_0x33ec17,_0x1fd9e9){_0x33ec17=_0x33ec17-0x0;var _0x46eceb=_0x4a80[_0x33ec17];return _0x46eceb;};'use strict';var _=require(_0x04a8('0x0'));var rp=require('request-promise');var md5=require(_0x04a8('0x1'));var util=require(_0x04a8('0x2'));var Redis=require('ioredis');var intUtil=require(_0x04a8('0x3'));var config=require(_0x04a8('0x4'));var logger=require(_0x04a8('0x5'))(_0x04a8('0x6'));config[_0x04a8('0x7')]=_[_0x04a8('0x8')](config[_0x04a8('0x7')],{'host':_0x04a8('0x9'),'port':0x18eb});var io=require(_0x04a8('0xa'))(new Redis(config[_0x04a8('0x7')]));function emit(_0x59079a,_0x40de61,_0x103ebc){io['to'](_0x59079a)[_0x04a8('0xb')](_0x40de61,_0x103ebc);}var headers={'Content-Type':_0x04a8('0xc'),'Accept':_0x04a8('0xc')};function getTicket(_0x155a50,_0x163b3b,_0x32bd4f,_0xf45b2d,_0x1e522c){logger['info'](_0x04a8('0xd'));return request({'uri':util[_0x04a8('0xe')](_0x04a8('0xf'),_0x155a50['remoteUri']),'method':_0x04a8('0x10'),'body':{'ticket':_[_0x04a8('0x11')]({'requester_id':_0x32bd4f['id'],'submitter_id':_0x163b3b?_0x163b3b['id']:undefined,'assignee_id':_0x163b3b?_0x163b3b['id']:undefined,'tags':getTags(_0xf45b2d[_0x04a8('0x12')],_0x04a8('0x13')),'subject':intUtil[_0x04a8('0x14')](_0xf45b2d[_0x04a8('0x15')],_0x1e522c,'\x20'),'description':intUtil[_0x04a8('0x14')](_0xf45b2d['Descriptions'],_0x1e522c,'\x0a'),'comment':{'public':![],'body':intUtil[_0x04a8('0x14')](_0xf45b2d[_0x04a8('0x16')],_0x1e522c,'\x0a')}},getCustomFields(_0xf45b2d[_0x04a8('0x17')],_0x1e522c))}})['then'](function(_0x5f35c4){logger[_0x04a8('0x18')](_0x04a8('0x19'));return _0x5f35c4['ticket'];});}function getUser(_0x998f9f,_0x4dae1b){if(intUtil[_0x04a8('0x1a')](_0x4dae1b)){logger['info'](_0x04a8('0x1b'),_0x4dae1b);return request({'uri':util[_0x04a8('0xe')]('%s/search.json',_0x998f9f[_0x04a8('0x1c')]),'qs':{'query':util[_0x04a8('0xe')]('type:user\x20role:agent\x20email:%s',_0x4dae1b)}})['then'](function(_0x48860b){if(_0x48860b[_0x04a8('0x1d')]){logger[_0x04a8('0x18')](_0x04a8('0x1e'));return _[_0x04a8('0x1f')](_0x48860b[_0x04a8('0x20')],{'email':_0x4dae1b,'role':_0x04a8('0x21')});}else{logger['info'](_0x04a8('0x22'));return request({'uri':util[_0x04a8('0xe')](_0x04a8('0x23'),_0x998f9f[_0x04a8('0x1c')])})[_0x04a8('0x24')](function(_0x477b24){logger[_0x04a8('0x18')](_0x04a8('0x25'));return _0x477b24['user'];});}});}else{logger[_0x04a8('0x18')](_0x04a8('0x22'));return request({'uri':util[_0x04a8('0xe')]('%s/users/me.json',_0x998f9f['remoteUri'])})[_0x04a8('0x24')](function(_0x47a464){logger['info'](_0x04a8('0x25'));return _0x47a464[_0x04a8('0x26')];});}}function getEndUser(_0x266ab2,_0x4da867,_0x3eb222){logger[_0x04a8('0x18')](_0x04a8('0x27'),_0x3eb222);return request({'uri':util['format'](_0x04a8('0x28'),_0x266ab2[_0x04a8('0x1c')]),'qs':{'query':util['format'](_0x04a8('0x29'),_0x3eb222)}})[_0x04a8('0x24')](function(_0x10e576){var _0x22d1b8;if(_0x10e576[_0x04a8('0x20')][_0x04a8('0x2a')]){_0x10e576[_0x04a8('0x20')]=_[_0x04a8('0x2b')](_0x10e576[_0x04a8('0x20')],{'suspended':![],'role':_0x04a8('0x2c')});if(_0x10e576[_0x04a8('0x20')][_0x04a8('0x2a')]){_0x22d1b8=_['first'](_0x10e576['results']);}}if(_0x22d1b8){logger[_0x04a8('0x18')](_0x04a8('0x2d'));return _0x22d1b8;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x04a8('0xe')](_0x04a8('0x2e'),_0x266ab2[_0x04a8('0x1c')]),'method':_0x04a8('0x10'),'body':{'user':{'role':'end-user','name':util[_0x04a8('0xe')]('Caller\x20-\x20%s',_0x4da867||_0x3eb222),'phone':_0x3eb222}}})[_0x04a8('0x24')](function(_0x1b30f5){logger[_0x04a8('0x18')](_0x04a8('0x2f'));return _0x1b30f5[_0x04a8('0x26')];});}});}function getAuth(_0x2f2940){var _0xe25542;if(_0x2f2940[_0x04a8('0x30')]==='password'){_0xe25542=util[_0x04a8('0xe')](_0x04a8('0x31'),_0x2f2940['username'],_0x2f2940[_0x04a8('0x32')]);}else if(_0x2f2940[_0x04a8('0x30')]==='token'){_0xe25542=util[_0x04a8('0xe')](_0x04a8('0x33'),_0x2f2940['username'],_0x2f2940[_0x04a8('0x34')]);}return util[_0x04a8('0xe')](_0x04a8('0x35'),new Buffer(_0xe25542)['toString'](_0x04a8('0x36')));}function request(_0xc5e0b){logger['debug'](_0x04a8('0x37'),JSON[_0x04a8('0x38')](_0xc5e0b));return rp(_[_0x04a8('0x8')](_0xc5e0b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x214061,_0x8182dd){var _0x2700cf=[];if(_0x214061&&_0x214061['length']>0x0){_0x2700cf=_['map'](_0x214061,_0x8182dd);}return _0x2700cf;}function getCustomFields(_0xc6c1dd,_0x4cf86f){var _0x4ec643=[];var _0x126ce={'custom_fields':[]};if(_0xc6c1dd[_0x04a8('0x2a')]>0x0){_[_0x04a8('0x39')](_0xc6c1dd,function(_0x3b99a0){if(_0x3b99a0[_0x04a8('0x3a')]==='string'&&_0x3b99a0['nameField']&&!_0x3b99a0[_0x04a8('0x3b')]){_0x126ce[_0x3b99a0[_0x04a8('0x3c')][_0x04a8('0x3d')]()]=_0x3b99a0[_0x04a8('0x3e')][_0x04a8('0x3f')]();}else if(_0x3b99a0['type']===_0x04a8('0x40')&&_0x3b99a0['idField']&&_0x3b99a0[_0x04a8('0x3b')]){_0x126ce[_0x04a8('0x41')]['push']({'id':_0x3b99a0[_0x04a8('0x42')],'value':_0x3b99a0[_0x04a8('0x3e')]['toString']()});}else if(_0x3b99a0[_0x04a8('0x3a')]===_0x04a8('0x43')&&_0x3b99a0[_0x04a8('0x44')]&&_0x3b99a0[_0x04a8('0x42')]&&_0x3b99a0[_0x04a8('0x3b')]){_0x4cf86f[_0x3b99a0['variableName']]&&_0x126ce['custom_fields'][_0x04a8('0x45')]({'id':_0x3b99a0[_0x04a8('0x42')],'value':_0x4cf86f[_0x3b99a0[_0x04a8('0x44')]]['toString']()});}else if(_0x3b99a0[_0x04a8('0x3a')]===_0x04a8('0x46')&&_0x3b99a0[_0x04a8('0x47')]&&_0x3b99a0[_0x04a8('0x47')][_0x04a8('0x13')]&&_0x3b99a0['idField']&&_0x3b99a0[_0x04a8('0x3b')]){_0x4cf86f[_0x3b99a0[_0x04a8('0x47')][_0x04a8('0x13')]['toLowerCase']()]&&_0x126ce['custom_fields'][_0x04a8('0x45')]({'id':_0x3b99a0['idField'],'value':_0x4cf86f[_0x3b99a0[_0x04a8('0x47')]['name'][_0x04a8('0x3d')]()][_0x04a8('0x3f')]()});}});}return _0x126ce;}exports['queue']=function(_0x28fe9f,_0x3d320e,_0x5c6f63,_0x585d4f,_0x594b1f,_0x8302b5){var _0x3b5881,_0x489ce9;_0x8302b5[_0x04a8('0x1c')]=intUtil[_0x04a8('0x48')](_0x8302b5[_0x04a8('0x1c')]);_0x8302b5[_0x04a8('0x49')]=intUtil['stripTrailingSlash'](_0x8302b5[_0x04a8('0x49')]);if(_0x594b1f&&_0x594b1f[_0x04a8('0x4a')]){logger['info'](_0x04a8('0x4b'),_0x04a8('0x4c'));_0x3d320e[_0x04a8('0x4d')]=util['format'](_0x04a8('0x4e'),_0x8302b5['serverUrl'],_0x3d320e['uniqueid'],md5(_0x3d320e[_0x04a8('0x4f')]));}else{_0x3d320e[_0x04a8('0x4d')]='';}headers[_0x04a8('0x50')]=getAuth(_0x8302b5);return getUser(_0x8302b5,_0x585d4f[_0x04a8('0x51')])[_0x04a8('0x24')](function(_0x4b1fb1){_0x3b5881=_0x4b1fb1;logger[_0x04a8('0x18')](_0x04a8('0x52'),_0x3b5881['id']);return getEndUser(_0x8302b5,_0x3d320e[_0x04a8('0x53')],_0x3d320e[_0x04a8('0x54')]);})[_0x04a8('0x24')](function(_0x463306){_0x489ce9=_0x463306;logger['info'](_0x04a8('0x55'),_0x489ce9['id']);return getTicket(_0x8302b5,_0x3b5881,_0x489ce9,_0x5c6f63,_0x3d320e);})[_0x04a8('0x24')](function(_0x552b07){if(_0x552b07){logger['info'](_0x04a8('0x56'),_0x552b07['id']);switch(_0x8302b5['type']){case _0x04a8('0x57'):logger[_0x04a8('0x18')](_0x04a8('0x4b'),_0x04a8('0x58'));return request({'uri':util['format'](_0x04a8('0x59'),_0x8302b5['remoteUri'],_0x3b5881['id'],_0x552b07['id']),'method':'POST'});case _0x04a8('0x5a'):logger[_0x04a8('0x18')]('[QUEUE]',_0x04a8('0x5b'));emit(util['format'](_0x04a8('0x5c'),_0x585d4f[_0x04a8('0x13')]),_0x04a8('0x5d'),{'uri':util[_0x04a8('0xe')](_0x04a8('0x5e'),_0x8302b5[_0x04a8('0x1c')],_0x552b07['id'])});break;default:logger[_0x04a8('0x5f')]('[QUEUE]',_0x04a8('0x60'));}}})[_0x04a8('0x61')](function(_0x1690ac){logger[_0x04a8('0x5f')](_0x04a8('0x62'),util[_0x04a8('0x63')](_0x1690ac,{'showHidden':!![],'depth':null}));});};exports[_0x04a8('0x64')]=function(_0x1d42cb,_0x3bfe6b,_0x51c919,_0x458a6e,_0x5d7709,_0x197985,_0xec126b){var _0x34530e,_0x35f1ed;_0x197985[_0x04a8('0x1c')]=intUtil['stripTrailingSlash'](_0x197985[_0x04a8('0x1c')]);_0x197985['serverUrl']=intUtil[_0x04a8('0x48')](_0x197985['serverUrl']);if(_0xec126b&&_0xec126b[_0x04a8('0x65')]&&_0xec126b['recordingFormat']!==_0x04a8('0x66')){logger[_0x04a8('0x18')]('[OUTBOUND]',_0x04a8('0x4c'));_0x3bfe6b['recordingURL']=util[_0x04a8('0xe')](_0x04a8('0x4e'),_0x197985[_0x04a8('0x49')],_0x3bfe6b[_0x04a8('0x4f')],md5(_0x3bfe6b[_0x04a8('0x4f')]));}headers[_0x04a8('0x50')]=getAuth(_0x197985);return getUser(_0x197985,_0x458a6e[_0x04a8('0x51')])['then'](function(_0x33e9f0){_0x34530e=_0x33e9f0;logger[_0x04a8('0x18')]('The\x20User\x20ID\x20is:',_0x34530e['id']);return getEndUser(_0x197985,_0x3bfe6b['destcalleridname'],_0x3bfe6b[_0x04a8('0x67')]);})['then'](function(_0x5de9c9){_0x35f1ed=_0x5de9c9;logger['info'](_0x04a8('0x55'),_0x35f1ed['id']);return getTicket(_0x197985,_0x34530e,_0x35f1ed,_0x51c919,_0x3bfe6b);})[_0x04a8('0x24')](function(_0x5b5c2b){if(_0x5b5c2b){logger[_0x04a8('0x18')](_0x04a8('0x56'),_0x5b5c2b['id']);switch(_0x197985['type']){case _0x04a8('0x57'):logger['info'](_0x04a8('0x68'),_0x04a8('0x58'));return request({'uri':util['format'](_0x04a8('0x59'),_0x197985[_0x04a8('0x1c')],_0x34530e['id'],_0x5b5c2b['id']),'method':_0x04a8('0x10')});case _0x04a8('0x5a'):logger[_0x04a8('0x18')](_0x04a8('0x68'),_0x04a8('0x5b'));emit(util[_0x04a8('0xe')](_0x04a8('0x5c'),_0x458a6e[_0x04a8('0x13')]),_0x04a8('0x5d'),{'uri':util['format']('%s/agent/tickets/%s',_0x197985[_0x04a8('0x1c')],_0x5b5c2b['id'])});break;default:logger[_0x04a8('0x5f')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x04a8('0x61')](function(_0x259299){logger[_0x04a8('0x5f')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x04a8('0x63')](_0x259299,{'showHidden':!![],'depth':null}));});};exports[_0x04a8('0x69')]=function(_0x5afbfe,_0x3cd67c,_0x66eab9,_0x47911a,_0x2d83f8,_0xeda8e){var _0x32aa43,_0x37d0eb;_0xeda8e[_0x04a8('0x1c')]=intUtil[_0x04a8('0x48')](_0xeda8e[_0x04a8('0x1c')]);_0xeda8e[_0x04a8('0x49')]=intUtil[_0x04a8('0x48')](_0xeda8e[_0x04a8('0x49')]);if(_0x2d83f8&&_0x2d83f8[_0x04a8('0x4a')]){logger[_0x04a8('0x18')]('[ABANDONED]',_0x04a8('0x4c'));_0x3cd67c['recordingURL']=util[_0x04a8('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xeda8e[_0x04a8('0x49')],_0x3cd67c[_0x04a8('0x4f')],md5(_0x3cd67c[_0x04a8('0x4f')]));}else{_0x3cd67c[_0x04a8('0x4d')]='';}headers[_0x04a8('0x50')]=getAuth(_0xeda8e);return getUser(_0xeda8e)[_0x04a8('0x24')](function(_0xbb1cd6){_0x32aa43=_0xbb1cd6;logger[_0x04a8('0x18')](_0x04a8('0x52'),_0x32aa43['id']);return getEndUser(_0xeda8e,_0x3cd67c['calleridname'],_0x3cd67c[_0x04a8('0x54')]);})['then'](function(_0x59397d){_0x37d0eb=_0x59397d;logger[_0x04a8('0x18')](_0x04a8('0x55'),_0x37d0eb['id']);return getTicket(_0xeda8e,_0x32aa43,_0x37d0eb,_0x66eab9,_0x3cd67c);})[_0x04a8('0x24')](function(_0x4ded34){if(_0x4ded34){logger['info']('The\x20Ticket\x20ID\x20is:',_0x4ded34['id']);}})['catch'](function(_0x79ee5b){logger[_0x04a8('0x5f')](_0x04a8('0x6a'),util[_0x04a8('0x63')](_0x79ee5b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index 97ec043..d9fad02 100644 --- a/server/services/ami/trigger/integration/zoho.js +++ b/server/services/ami/trigger/integration/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b63=['last_name','code','SUCCESS','details','The\x20failing\x20result\x20is','Error\x20on\x20Lead\x20retrieve:\x20','Owner','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','format','mm:ss','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','user:%s','[ABANDONED]','lodash','util','./util','moment','ioredis','../../../../config/logger','zoho','redis','defaults','localhost','emit','[HTTP]','stringify','length','forEach','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','ActiveUsers','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','info','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Zoho-oauthtoken\x20','data','enduserType','Contacts','End\x20user\x20found\x20(Contact)','GET','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','End\x20user\x20found\x20(Lead)','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','moduleCreate','role','first_name'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0b63,0xe7));var _0x30b6=function(_0x3c28ca,_0x13457b){_0x3c28ca=_0x3c28ca-0x0;var _0x5ceb53=_0x0b63[_0x3c28ca];return _0x5ceb53;};'use strict';var _=require(_0x30b6('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x30b6('0x1'));var intUtil=require(_0x30b6('0x2'));var moment=require(_0x30b6('0x3'));var Redis=require(_0x30b6('0x4'));var config=require('../../../../config/environment');var logger=require(_0x30b6('0x5'))(_0x30b6('0x6'));config[_0x30b6('0x7')]=_[_0x30b6('0x8')](config[_0x30b6('0x7')],{'host':_0x30b6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x30b6('0x7')]));function emit(_0x520533,_0x4488c6,_0x4eb0af){io['to'](_0x520533)[_0x30b6('0xa')](_0x4488c6,_0x4eb0af);}function request(_0x123054){logger['debug'](_0x30b6('0xb'),JSON[_0x30b6('0xc')](_0x123054));return rp(_0x123054);}function getCustomFields(_0x5b0567,_0x299f08){var _0x32295b={};if(_0x5b0567[_0x30b6('0xd')]>0x0){_[_0x30b6('0xe')](_0x5b0567,function(_0x1acd7f){if(_0x1acd7f[_0x30b6('0xf')]==='string'&&_0x1acd7f[_0x30b6('0x10')]){_0x32295b[_0x1acd7f[_0x30b6('0x10')]]=_0x1acd7f[_0x30b6('0x11')][_0x30b6('0x12')]();}else if(_0x1acd7f['type']===_0x30b6('0x13')&&_0x1acd7f['variableName']&&_0x1acd7f['idField']&&_0x299f08[_0x1acd7f[_0x30b6('0x14')]]){_0x32295b[_0x1acd7f[_0x30b6('0x10')]]=_0x299f08[_0x1acd7f[_0x30b6('0x14')]]['toString']();}else if(_0x1acd7f['type']===_0x30b6('0x15')&&_0x1acd7f[_0x30b6('0x16')]&&_0x1acd7f['Variable'][_0x30b6('0x17')]&&_0x1acd7f['idField']&&_0x299f08[_0x1acd7f[_0x30b6('0x16')][_0x30b6('0x17')][_0x30b6('0x18')]()]){_0x32295b[_0x1acd7f[_0x30b6('0x10')]]=_0x299f08[_0x1acd7f[_0x30b6('0x16')]['name'][_0x30b6('0x18')]()][_0x30b6('0x12')]();}});}return _0x32295b;}function getName(_0x3cec44){if(_0x3cec44[_0x30b6('0x19')]('\x20')>0x0){var _0xae7d94=_0x3cec44[_0x30b6('0x1a')](/ (.+)/);if(_0xae7d94[0x1]){return _0xae7d94;}}return[_0x3cec44,_0x3cec44];}var accountsTokens={};function getAccessToken(_0x2a0f9e){return new Promise(function(_0x53417f,_0x46d6bb){if(!_[_0x30b6('0x1b')](accountsTokens[_0x2a0f9e['id']])&&!_[_0x30b6('0x1b')](accountsTokens[_0x2a0f9e['id']][_0x30b6('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x2a0f9e['id']][_0x30b6('0x1d')])){_0x53417f(accountsTokens[_0x2a0f9e['id']][_0x30b6('0x1c')]);}}var _0x4e9a9d;switch(_0x2a0f9e[_0x30b6('0x1e')]){case'US':_0x4e9a9d=_0x30b6('0x1f');break;case'AU':_0x4e9a9d=_0x30b6('0x20');break;case'EU':_0x4e9a9d=_0x30b6('0x21');break;case'IN':_0x4e9a9d='https://accounts.zoho.in';break;case'CN':_0x4e9a9d=_0x30b6('0x22');break;default:_0x4e9a9d='https://accounts.zoho.eu';break;}var _0x45fe86={'method':_0x30b6('0x23'),'uri':_0x4e9a9d+_0x30b6('0x24'),'qs':{'refresh_token':_0x2a0f9e[_0x30b6('0x25')],'client_id':_0x2a0f9e['clientId'],'client_secret':_0x2a0f9e[_0x30b6('0x26')],'grant_type':_0x30b6('0x27')},'json':!![]};return rp(_0x45fe86)['then'](function(_0xb8845e){accountsTokens[_0x2a0f9e['id']]={'access_token':_0xb8845e['access_token'],'expires_in':moment()[_0x30b6('0x28')](_0xb8845e[_0x30b6('0x1d')],_0x30b6('0x29'))};_0x53417f(_0xb8845e['access_token']);})[_0x30b6('0x2a')](function(_0x169966){logger[_0x30b6('0x2b')](_0x30b6('0x2c'),_0x169966[_0x30b6('0x2d')]);_0x46d6bb(_0x169966);});});}function getUser(_0x2bf84d,_0x329b17,_0x21939c,_0x38f855){logger['info'](_0x30b6('0x2e'));return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x329b17),'qs':{'type':_0x30b6('0x2f')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2bf84d},'json':!![]})[_0x30b6('0x30')](function(_0x42a104){if(_0x42a104[_0x30b6('0x31')]){var _0x316574=-0x1;if(_[_0x30b6('0x32')](_0x42a104[_0x30b6('0x31')])){if(!_[_0x30b6('0x1b')](_0x38f855)){_0x316574=_[_0x30b6('0x33')](_0x42a104[_0x30b6('0x31')],function(_0x2c117b){return _0x2c117b[_0x30b6('0x34')]===_0x38f855;});}if(_0x316574>=0x0){logger['info'](_0x30b6('0x35'));}else{logger[_0x30b6('0x36')]('Using\x20the\x20admin\x20account!');_0x316574=_['findIndex'](_0x42a104['users'],function(_0x4a7672){return _0x4a7672[_0x30b6('0x37')][_0x30b6('0x17')]===_0x30b6('0x38');});}return _0x42a104['users'][_0x316574];}else{if(_0x42a104[_0x30b6('0x39')]['profile']['name']===_0x30b6('0x38')){logger[_0x30b6('0x36')]('Using\x20the\x20admin\x20account!');user=_0x42a104['user'];return user;}else{logger[_0x30b6('0x2b')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x42a104));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x30b6('0xc')](_0x42a104));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x30b6('0xc')](_0x42a104));throw new Error(_0x30b6('0x3a')+JSON[_0x30b6('0xc')](_0x42a104));}})[_0x30b6('0x2a')](function(_0x171019){console['error'](_0x171019);});}function getEndUser(_0x42191a,_0x304332,_0x206e09,_0x8a0f5b,_0x130d10,_0x5cc07a,_0x195479){logger['info'](_0x30b6('0x3b'));return request({'method':'GET','uri':_0x30b6('0x3c')+_0x304332+_0x30b6('0x3d')+_0x130d10+'))','headers':{'Authorization':_0x30b6('0x3e')+_0x42191a},'json':!![]})['then'](function(_0x1f57e9){if(_0x1f57e9){var _0x300953=_0x1f57e9[_0x30b6('0x3f')][0x0];_0x300953[_0x30b6('0x40')]=_0x30b6('0x41');logger[_0x30b6('0x36')](_0x30b6('0x42'));return _0x300953;}else{return request({'method':_0x30b6('0x43'),'uri':_0x30b6('0x3c')+_0x304332+_0x30b6('0x44')+_0x130d10+'))','headers':{'Authorization':_0x30b6('0x3e')+_0x42191a},'json':!![]})[_0x30b6('0x30')](function(_0x17b4fc){if(_0x17b4fc){var _0x58d72e=_0x17b4fc[_0x30b6('0x3f')][0x0];_0x58d72e[_0x30b6('0x40')]=_0x30b6('0x45');logger['info'](_0x30b6('0x46'));return _0x58d72e;}else{logger['info'](_0x30b6('0x47'));_0x8a0f5b=getName(_0x8a0f5b);return request({'method':_0x30b6('0x23'),'uri':_0x30b6('0x3c')+_0x304332+'/crm/v2/'+_0x195479[_0x30b6('0x48')],'body':{'data':[{'Last_Name':_0x8a0f5b[0x1],'First_Name':_0x8a0f5b[0x0],'Phone':_0x130d10,'Owner':{'name':!_[_0x30b6('0x1b')](_0x5cc07a[_0x30b6('0x49')]['name'])?_0x5cc07a['role'][_0x30b6('0x17')]:!_[_0x30b6('0x1b')](_0x5cc07a[_0x30b6('0x4a')])?_0x5cc07a[_0x30b6('0x4a')]+'\x20'+_0x5cc07a['last_name']:_0x5cc07a[_0x30b6('0x4b')],'id':_0x5cc07a['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x42191a},'json':!![]})['then'](function(_0x583545){if(_0x583545&&_0x583545[_0x30b6('0x3f')][0x0][_0x30b6('0x4c')]===_0x30b6('0x4d')){var _0x5cb4ba=_0x583545[_0x30b6('0x3f')][0x0][_0x30b6('0x4e')];_0x5cb4ba[_0x30b6('0x40')]=_0x195479[_0x30b6('0x48')];return _0x5cb4ba;}logger['error'](_0x30b6('0x4f'),JSON[_0x30b6('0xc')](_0x583545));throw new Error(_0x30b6('0x50')+JSON[_0x30b6('0xc')](_0x583545));});}});}});}function getCall(_0x5b7aa2,_0x42d460,_0x1badfb,_0x1841cb,_0x28420f,_0x1b59db,_0x5ef04b,_0x43574c){logger['info']('Creating\x20new\x20call...');var _0x454cef={};_0x454cef[_0x30b6('0x51')]={'name':!_['isNil'](_0x1841cb[_0x30b6('0x49')][_0x30b6('0x17')])&&!_[_0x30b6('0x1b')](_0x1841cb[_0x30b6('0x37')][_0x30b6('0x17')])&&_0x1841cb[_0x30b6('0x37')][_0x30b6('0x17')]===_0x30b6('0x52')?_0x1841cb['role'][_0x30b6('0x17')]:!_['isNil'](_0x1841cb[_0x30b6('0x4a')])?_0x1841cb[_0x30b6('0x4a')]+'\x20'+_0x1841cb[_0x30b6('0x4b')]:_0x1841cb['last_name'],'id':_0x1841cb['id']};_0x454cef['Subject']=intUtil[_0x30b6('0x53')](_0x1b59db[_0x30b6('0x54')],_0x5ef04b,'\x20');_0x454cef[_0x30b6('0x55')]=intUtil['getString'](_0x1b59db[_0x30b6('0x56')],_0x5ef04b,'\x0a');if(_0x28420f['enduserType']===_0x30b6('0x41')){_0x454cef[_0x30b6('0x57')]={'name':!_[_0x30b6('0x1b')](_0x28420f[_0x30b6('0x58')])?_0x28420f[_0x30b6('0x58')]:!_[_0x30b6('0x1b')](_0x28420f[_0x30b6('0x59')])?_0x28420f[_0x30b6('0x59')]+'\x20'+_0x28420f['Last_Name']:_0x28420f[_0x30b6('0x5a')],'id':_0x28420f['id']};}if(_0x28420f[_0x30b6('0x40')]===_0x30b6('0x45')){_0x454cef[_0x30b6('0x5b')]={'name':!_[_0x30b6('0x1b')](_0x28420f[_0x30b6('0x58')])?_0x28420f['Full_Name']:!_['isNil'](_0x28420f[_0x30b6('0x59')])?_0x28420f[_0x30b6('0x59')]+'\x20'+_0x28420f['Last_Name']:_0x28420f[_0x30b6('0x5a')],'id':_0x28420f['id']};_0x454cef[_0x30b6('0x5c')]=_0x28420f[_0x30b6('0x40')];}if(_0x5ef04b['talktime']){_0x454cef[_0x30b6('0x5d')]=moment[_0x30b6('0x5e')](parseInt(_0x5ef04b[_0x30b6('0x5f')])*0x3e8)['format']('mm:ss');}else if(_0x5ef04b[_0x30b6('0x60')]&&_0x5ef04b['endtime']){_0x454cef[_0x30b6('0x5d')]=moment[_0x30b6('0x5e')](moment(_0x5ef04b[_0x30b6('0x61')],_0x30b6('0x62'))[_0x30b6('0x63')](moment(_0x5ef04b[_0x30b6('0x64')],_0x30b6('0x62'))))[_0x30b6('0x65')](_0x30b6('0x66'));}switch(_0x5ef04b[_0x30b6('0x67')]){case _0x30b6('0x68'):_0x454cef[_0x30b6('0x69')]=_0x30b6('0x6a');break;case _0x30b6('0x6b'):case _0x30b6('0x6c'):_0x454cef[_0x30b6('0x69')]='Answered';break;case _0x30b6('0x6d'):_0x454cef[_0x30b6('0x69')]=_0x30b6('0x6e');break;case _0x30b6('0x6f'):_0x454cef[_0x30b6('0x69')]=_0x30b6('0x70');break;default:}_0x454cef[_0x30b6('0x71')]=(_0x43574c===_0x30b6('0x72')?moment(_0x5ef04b[_0x30b6('0x64')])[_0x30b6('0x65')](_0x30b6('0x62')):moment(_0x5ef04b[_0x30b6('0x73')])[_0x30b6('0x65')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x30b6('0x62'));_0x454cef['Call_Type']=_0x43574c||'Inbound';_0x454cef=_[_0x30b6('0x74')](_0x454cef,getCustomFields(_0x1b59db[_0x30b6('0x75')],_0x5ef04b));return request({'method':_0x30b6('0x23'),'uri':_0x30b6('0x3c')+_0x42d460+_0x30b6('0x76'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5b7aa2},'body':{'data':[_0x454cef]},'json':!![]})[_0x30b6('0x30')](function(_0x501098){if(_0x501098&&_0x501098[_0x30b6('0x3f')][0x0][_0x30b6('0x4c')]==='SUCCESS'){logger['info'](_0x30b6('0x77'));return{'id':_0x501098[_0x30b6('0x3f')][0x0][_0x30b6('0x4e')]['id']};}})[_0x30b6('0x2a')](function(_0x8371c8){logger['info'](_0x30b6('0x78'),_0x8371c8[_0x30b6('0x2d')]);console[_0x30b6('0x79')](_0x30b6('0x78'),_0x8371c8);});}exports[_0x30b6('0x7a')]=function(_0x2fc671,_0x575420,_0x1d2750,_0x53ad44,_0x288a63,_0x468999){var _0x2efef7,_0x596831,_0x5d13db;_0x468999[_0x30b6('0x7b')]=intUtil[_0x30b6('0x7c')](_0x468999['host']);_0x468999[_0x30b6('0x7d')]=intUtil[_0x30b6('0x7c')](_0x468999[_0x30b6('0x7d')]);if(_0x288a63&&_0x288a63[_0x30b6('0x7e')]){logger[_0x30b6('0x36')](_0x30b6('0x7f'),_0x30b6('0x80'));_0x575420['recordingURL']=_0x468999[_0x30b6('0x7d')]+_0x30b6('0x81')+_0x575420['uniqueid']+_0x30b6('0x82')+md5(_0x575420[_0x30b6('0x83')]);}else{_0x575420[_0x30b6('0x84')]='';}var _0x4c6a45=_0x468999['host']===_0x30b6('0x85')?'eu':_0x30b6('0x86');return getAccessToken(_0x468999)[_0x30b6('0x30')](function(_0x1dba18){_0x5d13db=_0x1dba18;return getUser(_0x5d13db,_0x4c6a45,_0x468999,_0x53ad44[_0x30b6('0x34')]);})[_0x30b6('0x30')](function(_0x14db05){_0x2efef7=_0x14db05;logger[_0x30b6('0x36')](_0x30b6('0x87'),_0x2efef7['id']);return getEndUser(_0x5d13db,_0x4c6a45,_0x468999,_0x575420[_0x30b6('0x88')],_0x575420[_0x30b6('0x89')],_0x2efef7,_0x1d2750);})[_0x30b6('0x30')](function(_0x2470d0){_0x596831=_0x2470d0;logger[_0x30b6('0x36')](_0x30b6('0x8a'),_0x596831['id']);return getCall(_0x5d13db,_0x4c6a45,_0x468999,_0x2efef7,_0x596831,_0x1d2750,_0x575420,_0x30b6('0x8b'));})[_0x30b6('0x30')](function(_0x3d02a7){if(_0x3d02a7){logger[_0x30b6('0x36')](_0x30b6('0x8c'),_0x3d02a7['id']);logger[_0x30b6('0x36')]('[QUEUE]',_0x30b6('0x8d'));emit(util['format']('user:%s',_0x53ad44[_0x30b6('0x17')]),_0x30b6('0x8e'),{'uri':_0x30b6('0x8f')+_0x468999[_0x30b6('0x7b')]+_0x30b6('0x90')+_0x3d02a7['id']});}})[_0x30b6('0x2a')](function(_0x5d0246){logger[_0x30b6('0x2b')]('[QUEUE]',JSON[_0x30b6('0xc')](_0x5d0246));});};exports[_0x30b6('0x72')]=function(_0x363076,_0x452dc0,_0x3b1703,_0x3c9035,_0x2e9faa,_0x85ddfa,_0x447e05){var _0x2acc9c,_0xd09a8d,_0x5ab33b;_0x85ddfa['host']=intUtil[_0x30b6('0x7c')](_0x85ddfa['host']);_0x85ddfa[_0x30b6('0x7d')]=intUtil['stripTrailingSlash'](_0x85ddfa[_0x30b6('0x7d')]);if(_0x447e05&&_0x447e05[_0x30b6('0x91')]&&_0x447e05['recordingFormat']!==_0x30b6('0x92')){logger[_0x30b6('0x36')](_0x30b6('0x93'),_0x30b6('0x80'));_0x452dc0[_0x30b6('0x84')]=_0x85ddfa[_0x30b6('0x7d')]+'/api/voice/recordings/'+_0x452dc0[_0x30b6('0x83')]+_0x30b6('0x82')+md5(_0x452dc0[_0x30b6('0x83')]);}var _0x2e2639=_0x85ddfa['host']===_0x30b6('0x85')?'eu':'com';return getAccessToken(_0x85ddfa)['then'](function(_0x32e0f0){_0x5ab33b=_0x32e0f0;return getUser(_0x5ab33b,_0x2e2639,_0x85ddfa,_0x3c9035[_0x30b6('0x34')]);})['then'](function(_0x4fe3d3){_0x2acc9c=_0x4fe3d3;logger[_0x30b6('0x36')](_0x30b6('0x87'),_0x2acc9c['id']);return getEndUser(_0x5ab33b,_0x2e2639,_0x85ddfa,_0x452dc0[_0x30b6('0x94')],_0x452dc0[_0x30b6('0x95')],_0x2acc9c,_0x3b1703);})[_0x30b6('0x30')](function(_0x449968){_0xd09a8d=_0x449968;logger[_0x30b6('0x36')](_0x30b6('0x8a'),_0xd09a8d['id']);return getCall(_0x5ab33b,_0x2e2639,_0x85ddfa,_0x2acc9c,_0xd09a8d,_0x3b1703,_0x452dc0,_0x30b6('0x96'));})[_0x30b6('0x30')](function(_0x120edb){if(_0x120edb){logger[_0x30b6('0x36')]('The\x20Call\x20ID\x20is:',_0x120edb['id']);logger[_0x30b6('0x36')]('[OUTBOUND]',_0x30b6('0x8d'));emit(util[_0x30b6('0x65')](_0x30b6('0x97'),_0x3c9035[_0x30b6('0x17')]),_0x30b6('0x8e'),{'uri':_0x30b6('0x8f')+_0x85ddfa[_0x30b6('0x7b')]+_0x30b6('0x90')+_0x120edb['id']});}})[_0x30b6('0x2a')](function(_0x18e6f5){logger[_0x30b6('0x2b')]('[OUTBOUND]',JSON[_0x30b6('0xc')](_0x18e6f5));});};exports['abandoned']=function(_0x1be586,_0x3035a5,_0x2443c9,_0x3bea34,_0x6c773e,_0x1289ab){var _0x354569,_0x2d164f,_0x3fcc68;_0x1289ab[_0x30b6('0x7b')]=intUtil[_0x30b6('0x7c')](_0x1289ab['host']);_0x1289ab[_0x30b6('0x7d')]=intUtil[_0x30b6('0x7c')](_0x1289ab[_0x30b6('0x7d')]);if(_0x6c773e&&_0x6c773e['monitor_format']){logger[_0x30b6('0x36')]('[ABANDONED]',_0x30b6('0x80'));_0x3035a5['recordingURL']=_0x1289ab[_0x30b6('0x7d')]+_0x30b6('0x81')+_0x3035a5[_0x30b6('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x3035a5[_0x30b6('0x83')]);}else{_0x3035a5[_0x30b6('0x84')]='';}var _0x4650c7=_0x1289ab[_0x30b6('0x7b')]===_0x30b6('0x85')?'eu':_0x30b6('0x86');return getAccessToken(_0x1289ab)['then'](function(_0xd4293e){_0x3fcc68=_0xd4293e;return getUser(_0x3fcc68,_0x4650c7,_0x1289ab);})[_0x30b6('0x30')](function(_0x332dba){_0x354569=_0x332dba;logger[_0x30b6('0x36')](_0x30b6('0x87'),_0x354569['id']);return getEndUser(_0x3fcc68,_0x4650c7,_0x1289ab,_0x3035a5[_0x30b6('0x88')],_0x3035a5[_0x30b6('0x89')],_0x354569,_0x2443c9);})['then'](function(_0x5ce6a4){_0x2d164f=_0x5ce6a4;logger[_0x30b6('0x36')](_0x30b6('0x8a'),_0x2d164f['id']);return getCall(_0x3fcc68,_0x4650c7,_0x1289ab,_0x354569,_0x2d164f,_0x2443c9,_0x3035a5,_0x30b6('0x8b'));})[_0x30b6('0x30')](function(_0x6d285a){if(_0x6d285a){logger[_0x30b6('0x36')]('The\x20Call\x20ID\x20is:',_0x6d285a['id']);}})[_0x30b6('0x2a')](function(_0x42dc85){logger[_0x30b6('0x2b')](_0x30b6('0x98'),JSON[_0x30b6('0xc')](_0x42dc85));});}; \ No newline at end of file +var _0x09b0=['endtime','diff','YYYY-MM-DDTHH:mm:ss','mm:ss','lastevent','Call_Result','Called','complete','connect','rejected','Abandoned','Call_Start_Time','outbound','starttime','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','abandoned','[ABANDONED]','/downloads?type=uniqueid&token=','lodash','md5','./util','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','type','string','idField','variable','variableName','customVariable','Variable','name','toLowerCase','toString','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','data','enduserType','End\x20user\x20found\x20(Contact)','/crm/v2/Leads/search?criteria=((Phone:equals:','End\x20user\x20found\x20(Lead)','/crm/v2/','moduleCreate','first_name','code','SUCCESS','details','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','role','administrator','last_name','Subject','Subjects','Description','getString','Descriptions','Contacts','Who_Id','First_Name','Last_Name','Leads','What_Id','Full_Name','talktime','Call_Duration','utc'];(function(_0x355c90,_0x5a71b1){var _0x43596c=function(_0x2390c2){while(--_0x2390c2){_0x355c90['push'](_0x355c90['shift']());}};_0x43596c(++_0x5a71b1);}(_0x09b0,0x1f3));var _0x009b=function(_0x34ed70,_0x217364){_0x34ed70=_0x34ed70-0x0;var _0x57f5ba=_0x09b0[_0x34ed70];return _0x57f5ba;};'use strict';var _=require(_0x009b('0x0'));var rp=require('request-promise');var md5=require(_0x009b('0x1'));var util=require('util');var intUtil=require(_0x009b('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x009b('0x3'));var logger=require(_0x009b('0x4'))(_0x009b('0x5'));config['redis']=_[_0x009b('0x6')](config[_0x009b('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x009b('0x8'))(new Redis(config[_0x009b('0x7')]));function emit(_0x476ef9,_0x2cb43c,_0x1fd0da){io['to'](_0x476ef9)[_0x009b('0x9')](_0x2cb43c,_0x1fd0da);}function request(_0xf7301c){logger[_0x009b('0xa')](_0x009b('0xb'),JSON[_0x009b('0xc')](_0xf7301c));return rp(_0xf7301c);}function getCustomFields(_0x1e5d18,_0x3dd246){var _0x20223f={};if(_0x1e5d18[_0x009b('0xd')]>0x0){_[_0x009b('0xe')](_0x1e5d18,function(_0x5a977e){if(_0x5a977e[_0x009b('0xf')]===_0x009b('0x10')&&_0x5a977e[_0x009b('0x11')]){_0x20223f[_0x5a977e[_0x009b('0x11')]]=_0x5a977e['content']['toString']();}else if(_0x5a977e[_0x009b('0xf')]===_0x009b('0x12')&&_0x5a977e[_0x009b('0x13')]&&_0x5a977e[_0x009b('0x11')]&&_0x3dd246[_0x5a977e[_0x009b('0x13')]]){_0x20223f[_0x5a977e[_0x009b('0x11')]]=_0x3dd246[_0x5a977e['variableName']]['toString']();}else if(_0x5a977e[_0x009b('0xf')]===_0x009b('0x14')&&_0x5a977e['Variable']&&_0x5a977e['Variable']['name']&&_0x5a977e[_0x009b('0x11')]&&_0x3dd246[_0x5a977e[_0x009b('0x15')][_0x009b('0x16')][_0x009b('0x17')]()]){_0x20223f[_0x5a977e[_0x009b('0x11')]]=_0x3dd246[_0x5a977e[_0x009b('0x15')][_0x009b('0x16')][_0x009b('0x17')]()][_0x009b('0x18')]();}});}return _0x20223f;}function getName(_0x3a70ec){if(_0x3a70ec[_0x009b('0x19')]('\x20')>0x0){var _0x50d6e0=_0x3a70ec[_0x009b('0x1a')](/ (.+)/);if(_0x50d6e0[0x1]){return _0x50d6e0;}}return[_0x3a70ec,_0x3a70ec];}var accountsTokens={};function getAccessToken(_0x27a6e2){return new Promise(function(_0x5f57b5,_0x3d431b){if(!_[_0x009b('0x1b')](accountsTokens[_0x27a6e2['id']])&&!_[_0x009b('0x1b')](accountsTokens[_0x27a6e2['id']][_0x009b('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x27a6e2['id']][_0x009b('0x1d')])){_0x5f57b5(accountsTokens[_0x27a6e2['id']][_0x009b('0x1c')]);}}var _0x16341c;switch(_0x27a6e2[_0x009b('0x1e')]){case'US':_0x16341c=_0x009b('0x1f');break;case'AU':_0x16341c=_0x009b('0x20');break;case'EU':_0x16341c=_0x009b('0x21');break;case'IN':_0x16341c=_0x009b('0x22');break;case'CN':_0x16341c=_0x009b('0x23');break;default:_0x16341c='https://accounts.zoho.eu';break;}var _0xe0e0a7={'method':_0x009b('0x24'),'uri':_0x16341c+_0x009b('0x25'),'qs':{'refresh_token':_0x27a6e2[_0x009b('0x26')],'client_id':_0x27a6e2[_0x009b('0x27')],'client_secret':_0x27a6e2[_0x009b('0x28')],'grant_type':_0x009b('0x29')},'json':!![]};return rp(_0xe0e0a7)[_0x009b('0x2a')](function(_0x287a52){accountsTokens[_0x27a6e2['id']]={'access_token':_0x287a52[_0x009b('0x1c')],'expires_in':moment()[_0x009b('0x2b')](_0x287a52['expires_in'],'seconds')};_0x5f57b5(_0x287a52[_0x009b('0x1c')]);})[_0x009b('0x2c')](function(_0x444874){logger[_0x009b('0x2d')](_0x009b('0x2e'),_0x444874['stack']);_0x3d431b(_0x444874);});});}function getUser(_0x4d3728,_0x5956be,_0x12be16,_0x2672e3){logger[_0x009b('0x2f')](_0x009b('0x30'));return request({'method':_0x009b('0x31'),'uri':util[_0x009b('0x32')](_0x009b('0x33'),_0x5956be),'qs':{'type':_0x009b('0x34')},'headers':{'Authorization':_0x009b('0x35')+_0x4d3728},'json':!![]})[_0x009b('0x2a')](function(_0x2ad439){if(_0x2ad439[_0x009b('0x36')]){var _0x3b32fd=-0x1;if(_[_0x009b('0x37')](_0x2ad439[_0x009b('0x36')])){if(!_['isNil'](_0x2672e3)){_0x3b32fd=_[_0x009b('0x38')](_0x2ad439[_0x009b('0x36')],function(_0x44c97b){return _0x44c97b[_0x009b('0x39')]===_0x2672e3;});}if(_0x3b32fd>=0x0){logger[_0x009b('0x2f')]('Agent\x20found!');}else{logger[_0x009b('0x2f')](_0x009b('0x3a'));_0x3b32fd=_[_0x009b('0x38')](_0x2ad439[_0x009b('0x36')],function(_0x4dc745){return _0x4dc745[_0x009b('0x3b')][_0x009b('0x16')]==='Administrator';});}return _0x2ad439[_0x009b('0x36')][_0x3b32fd];}else{if(_0x2ad439[_0x009b('0x3c')]['profile'][_0x009b('0x16')]==='Administrator'){logger[_0x009b('0x2f')](_0x009b('0x3a'));user=_0x2ad439[_0x009b('0x3c')];return user;}else{logger['error'](_0x009b('0x3d'),JSON[_0x009b('0xc')](_0x2ad439));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x009b('0xc')](_0x2ad439));}}}else{logger[_0x009b('0x2d')](_0x009b('0x3d'),JSON['stringify'](_0x2ad439));throw new Error(_0x009b('0x3e')+JSON['stringify'](_0x2ad439));}})[_0x009b('0x2c')](function(_0x1c34a8){console['error'](_0x1c34a8);});}function getEndUser(_0x1e0ed1,_0x27aa73,_0xa5313a,_0x4d8177,_0x89a3de,_0x8dfef8,_0x62cf87){logger[_0x009b('0x2f')](_0x009b('0x3f'));return request({'method':_0x009b('0x31'),'uri':_0x009b('0x40')+_0x27aa73+_0x009b('0x41')+_0x89a3de+'))','headers':{'Authorization':_0x009b('0x35')+_0x1e0ed1},'json':!![]})[_0x009b('0x2a')](function(_0x4eb970){if(_0x4eb970){var _0x535952=_0x4eb970[_0x009b('0x42')][0x0];_0x535952[_0x009b('0x43')]='Contacts';logger[_0x009b('0x2f')](_0x009b('0x44'));return _0x535952;}else{return request({'method':'GET','uri':'https://www.zohoapis.'+_0x27aa73+_0x009b('0x45')+_0x89a3de+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1e0ed1},'json':!![]})[_0x009b('0x2a')](function(_0x5581ec){if(_0x5581ec){var _0x55bb2c=_0x5581ec['data'][0x0];_0x55bb2c[_0x009b('0x43')]='Leads';logger[_0x009b('0x2f')](_0x009b('0x46'));return _0x55bb2c;}else{logger[_0x009b('0x2f')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x4d8177=getName(_0x4d8177);return request({'method':_0x009b('0x24'),'uri':_0x009b('0x40')+_0x27aa73+_0x009b('0x47')+_0x62cf87[_0x009b('0x48')],'body':{'data':[{'Last_Name':_0x4d8177[0x1],'First_Name':_0x4d8177[0x0],'Phone':_0x89a3de,'Owner':{'name':!_['isNil'](_0x8dfef8['role'][_0x009b('0x16')])?_0x8dfef8['role'][_0x009b('0x16')]:!_[_0x009b('0x1b')](_0x8dfef8[_0x009b('0x49')])?_0x8dfef8[_0x009b('0x49')]+'\x20'+_0x8dfef8['last_name']:_0x8dfef8['last_name'],'id':_0x8dfef8['id']}}]},'headers':{'Authorization':_0x009b('0x35')+_0x1e0ed1},'json':!![]})[_0x009b('0x2a')](function(_0x196e3d){if(_0x196e3d&&_0x196e3d['data'][0x0][_0x009b('0x4a')]===_0x009b('0x4b')){var _0x7a0f2e=_0x196e3d['data'][0x0][_0x009b('0x4c')];_0x7a0f2e[_0x009b('0x43')]=_0x62cf87['moduleCreate'];return _0x7a0f2e;}logger[_0x009b('0x2d')](_0x009b('0x3d'),JSON[_0x009b('0xc')](_0x196e3d));throw new Error(_0x009b('0x4d')+JSON[_0x009b('0xc')](_0x196e3d));});}});}});}function getCall(_0x1f6648,_0x2c6c1b,_0x3507f4,_0xbcba61,_0x5d9057,_0x11a187,_0x1dece2,_0x37dd52){logger[_0x009b('0x2f')](_0x009b('0x4e'));var _0x1e13cc={};_0x1e13cc['Owner']={'name':!_['isNil'](_0xbcba61[_0x009b('0x4f')][_0x009b('0x16')])&&!_['isNil'](_0xbcba61[_0x009b('0x3b')]['name'])&&_0xbcba61['profile'][_0x009b('0x16')]===_0x009b('0x50')?_0xbcba61[_0x009b('0x4f')][_0x009b('0x16')]:!_[_0x009b('0x1b')](_0xbcba61[_0x009b('0x49')])?_0xbcba61[_0x009b('0x49')]+'\x20'+_0xbcba61[_0x009b('0x51')]:_0xbcba61[_0x009b('0x51')],'id':_0xbcba61['id']};_0x1e13cc[_0x009b('0x52')]=intUtil['getString'](_0x11a187[_0x009b('0x53')],_0x1dece2,'\x20');_0x1e13cc[_0x009b('0x54')]=intUtil[_0x009b('0x55')](_0x11a187[_0x009b('0x56')],_0x1dece2,'\x0a');if(_0x5d9057['enduserType']===_0x009b('0x57')){_0x1e13cc[_0x009b('0x58')]={'name':!_[_0x009b('0x1b')](_0x5d9057['Full_Name'])?_0x5d9057['Full_Name']:!_[_0x009b('0x1b')](_0x5d9057['First_Name'])?_0x5d9057[_0x009b('0x59')]+'\x20'+_0x5d9057[_0x009b('0x5a')]:_0x5d9057[_0x009b('0x5a')],'id':_0x5d9057['id']};}if(_0x5d9057['enduserType']===_0x009b('0x5b')){_0x1e13cc[_0x009b('0x5c')]={'name':!_['isNil'](_0x5d9057[_0x009b('0x5d')])?_0x5d9057['Full_Name']:!_['isNil'](_0x5d9057[_0x009b('0x59')])?_0x5d9057[_0x009b('0x59')]+'\x20'+_0x5d9057[_0x009b('0x5a')]:_0x5d9057[_0x009b('0x5a')],'id':_0x5d9057['id']};_0x1e13cc['$se_module']=_0x5d9057[_0x009b('0x43')];}if(_0x1dece2[_0x009b('0x5e')]){_0x1e13cc[_0x009b('0x5f')]=moment[_0x009b('0x60')](parseInt(_0x1dece2[_0x009b('0x5e')])*0x3e8)[_0x009b('0x32')]('mm:ss');}else if(_0x1dece2['answertime']&&_0x1dece2[_0x009b('0x61')]){_0x1e13cc[_0x009b('0x5f')]=moment['utc'](moment(_0x1dece2[_0x009b('0x61')],'YYYY-MM-DDTHH:mm:ss')[_0x009b('0x62')](moment(_0x1dece2['starttime'],_0x009b('0x63'))))['format'](_0x009b('0x64'));}switch(_0x1dece2[_0x009b('0x65')]){case'called':_0x1e13cc[_0x009b('0x66')]=_0x009b('0x67');break;case _0x009b('0x68'):case _0x009b('0x69'):_0x1e13cc[_0x009b('0x66')]='Answered';break;case _0x009b('0x6a'):_0x1e13cc['Call_Result']='Rejected';break;case'abandoned':_0x1e13cc[_0x009b('0x66')]=_0x009b('0x6b');break;default:}_0x1e13cc[_0x009b('0x6c')]=(_0x37dd52===_0x009b('0x6d')?moment(_0x1dece2[_0x009b('0x6e')])[_0x009b('0x32')](_0x009b('0x63')):moment(_0x1dece2['agentcalledAt'])['format'](_0x009b('0x63')))||moment()[_0x009b('0x32')](_0x009b('0x63'));_0x1e13cc[_0x009b('0x6f')]=_0x37dd52||'Inbound';_0x1e13cc=_[_0x009b('0x70')](_0x1e13cc,getCustomFields(_0x11a187[_0x009b('0x71')],_0x1dece2));return request({'method':_0x009b('0x24'),'uri':_0x009b('0x40')+_0x2c6c1b+_0x009b('0x72'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1f6648},'body':{'data':[_0x1e13cc]},'json':!![]})[_0x009b('0x2a')](function(_0x591a72){if(_0x591a72&&_0x591a72[_0x009b('0x42')][0x0][_0x009b('0x4a')]==='SUCCESS'){logger[_0x009b('0x2f')](_0x009b('0x73'));return{'id':_0x591a72[_0x009b('0x42')][0x0][_0x009b('0x4c')]['id']};}})['catch'](function(_0x427f51){logger['info'](_0x009b('0x74'),_0x427f51['stack']);console[_0x009b('0x75')](_0x009b('0x74'),_0x427f51);});}exports[_0x009b('0x76')]=function(_0x33804b,_0x4fd8df,_0x1f5bc8,_0x2e8275,_0x524f6e,_0x1e6e77){var _0x391630,_0x53099e,_0x3420c1;_0x1e6e77[_0x009b('0x77')]=intUtil[_0x009b('0x78')](_0x1e6e77[_0x009b('0x77')]);_0x1e6e77[_0x009b('0x79')]=intUtil[_0x009b('0x78')](_0x1e6e77[_0x009b('0x79')]);if(_0x524f6e&&_0x524f6e[_0x009b('0x7a')]){logger[_0x009b('0x2f')]('[QUEUE]',_0x009b('0x7b'));_0x4fd8df[_0x009b('0x7c')]=_0x1e6e77[_0x009b('0x79')]+_0x009b('0x7d')+_0x4fd8df[_0x009b('0x7e')]+'/downloads?type=uniqueid&token='+md5(_0x4fd8df[_0x009b('0x7e')]);}else{_0x4fd8df['recordingURL']='';}var _0x325cb5=_0x1e6e77[_0x009b('0x77')]===_0x009b('0x7f')?'eu':_0x009b('0x80');return getAccessToken(_0x1e6e77)[_0x009b('0x2a')](function(_0x36c48d){_0x3420c1=_0x36c48d;return getUser(_0x3420c1,_0x325cb5,_0x1e6e77,_0x2e8275[_0x009b('0x39')]);})[_0x009b('0x2a')](function(_0x23a97e){_0x391630=_0x23a97e;logger[_0x009b('0x2f')]('The\x20User\x20ID\x20is:',_0x391630['id']);return getEndUser(_0x3420c1,_0x325cb5,_0x1e6e77,_0x4fd8df[_0x009b('0x81')],_0x4fd8df[_0x009b('0x82')],_0x391630,_0x1f5bc8);})[_0x009b('0x2a')](function(_0x2f7763){_0x53099e=_0x2f7763;logger[_0x009b('0x2f')](_0x009b('0x83'),_0x53099e['id']);return getCall(_0x3420c1,_0x325cb5,_0x1e6e77,_0x391630,_0x53099e,_0x1f5bc8,_0x4fd8df,_0x009b('0x84'));})[_0x009b('0x2a')](function(_0x3c985a){if(_0x3c985a){logger[_0x009b('0x2f')]('The\x20Call\x20ID\x20is:',_0x3c985a['id']);logger[_0x009b('0x2f')]('[QUEUE]',_0x009b('0x85'));emit(util['format'](_0x009b('0x86'),_0x2e8275[_0x009b('0x16')]),_0x009b('0x87'),{'uri':_0x009b('0x88')+_0x1e6e77[_0x009b('0x77')]+_0x009b('0x89')+_0x3c985a['id']});}})['catch'](function(_0x3c79c2){logger[_0x009b('0x2d')](_0x009b('0x8a'),JSON['stringify'](_0x3c79c2));});};exports[_0x009b('0x6d')]=function(_0x472f94,_0x519551,_0x2faefd,_0x4ad44f,_0x4e3252,_0x595a58,_0x134f8a){var _0x169e40,_0x5464ce,_0x294f84;_0x595a58[_0x009b('0x77')]=intUtil[_0x009b('0x78')](_0x595a58[_0x009b('0x77')]);_0x595a58['serverUrl']=intUtil[_0x009b('0x78')](_0x595a58[_0x009b('0x79')]);if(_0x134f8a&&_0x134f8a[_0x009b('0x8b')]&&_0x134f8a['recordingFormat']!=='none'){logger['info'](_0x009b('0x8c'),'Recording\x20is\x20enabled!');_0x519551[_0x009b('0x7c')]=_0x595a58[_0x009b('0x79')]+_0x009b('0x7d')+_0x519551[_0x009b('0x7e')]+'/downloads?type=uniqueid&token='+md5(_0x519551[_0x009b('0x7e')]);}var _0x2af084=_0x595a58['host']===_0x009b('0x7f')?'eu':_0x009b('0x80');return getAccessToken(_0x595a58)[_0x009b('0x2a')](function(_0x3ae1ef){_0x294f84=_0x3ae1ef;return getUser(_0x294f84,_0x2af084,_0x595a58,_0x4ad44f['email']);})[_0x009b('0x2a')](function(_0x3c20c4){_0x169e40=_0x3c20c4;logger[_0x009b('0x2f')](_0x009b('0x8d'),_0x169e40['id']);return getEndUser(_0x294f84,_0x2af084,_0x595a58,_0x519551[_0x009b('0x8e')],_0x519551[_0x009b('0x8f')],_0x169e40,_0x2faefd);})[_0x009b('0x2a')](function(_0x1cc7e4){_0x5464ce=_0x1cc7e4;logger[_0x009b('0x2f')](_0x009b('0x83'),_0x5464ce['id']);return getCall(_0x294f84,_0x2af084,_0x595a58,_0x169e40,_0x5464ce,_0x2faefd,_0x519551,_0x009b('0x90'));})['then'](function(_0x4c67ed){if(_0x4c67ed){logger[_0x009b('0x2f')](_0x009b('0x91'),_0x4c67ed['id']);logger['info']('[OUTBOUND]',_0x009b('0x85'));emit(util[_0x009b('0x32')](_0x009b('0x86'),_0x4ad44f['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x595a58[_0x009b('0x77')]+'/crm/EntityInfo.do?module=Calls&id='+_0x4c67ed['id']});}})[_0x009b('0x2c')](function(_0x44915f){logger[_0x009b('0x2d')]('[OUTBOUND]',JSON[_0x009b('0xc')](_0x44915f));});};exports[_0x009b('0x92')]=function(_0x518b2d,_0x33e9b2,_0x233a2d,_0x13ab6b,_0x68239a,_0x39275d){var _0x4c5fbb,_0x6eafa5,_0x5d8b57;_0x39275d[_0x009b('0x77')]=intUtil[_0x009b('0x78')](_0x39275d[_0x009b('0x77')]);_0x39275d[_0x009b('0x79')]=intUtil['stripTrailingSlash'](_0x39275d[_0x009b('0x79')]);if(_0x68239a&&_0x68239a['monitor_format']){logger[_0x009b('0x2f')](_0x009b('0x93'),'Recording\x20is\x20enabled!');_0x33e9b2[_0x009b('0x7c')]=_0x39275d[_0x009b('0x79')]+_0x009b('0x7d')+_0x33e9b2[_0x009b('0x7e')]+_0x009b('0x94')+md5(_0x33e9b2[_0x009b('0x7e')]);}else{_0x33e9b2[_0x009b('0x7c')]='';}var _0x1142d0=_0x39275d[_0x009b('0x77')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x39275d)[_0x009b('0x2a')](function(_0x39883f){_0x5d8b57=_0x39883f;return getUser(_0x5d8b57,_0x1142d0,_0x39275d);})[_0x009b('0x2a')](function(_0x22e554){_0x4c5fbb=_0x22e554;logger[_0x009b('0x2f')]('The\x20User\x20ID\x20is:',_0x4c5fbb['id']);return getEndUser(_0x5d8b57,_0x1142d0,_0x39275d,_0x33e9b2['calleridname'],_0x33e9b2[_0x009b('0x82')],_0x4c5fbb,_0x233a2d);})[_0x009b('0x2a')](function(_0x576c92){_0x6eafa5=_0x576c92;logger[_0x009b('0x2f')](_0x009b('0x83'),_0x6eafa5['id']);return getCall(_0x5d8b57,_0x1142d0,_0x39275d,_0x4c5fbb,_0x6eafa5,_0x233a2d,_0x33e9b2,_0x009b('0x84'));})['then'](function(_0x17c65e){if(_0x17c65e){logger['info']('The\x20Call\x20ID\x20is:',_0x17c65e['id']);}})['catch'](function(_0x558e7d){logger[_0x009b('0x2d')](_0x009b('0x93'),JSON['stringify'](_0x558e7d));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 55ff107..3fff253 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x2af28b,_0xd987cf){var _0x50e668=function(_0x3b74c7){while(--_0x3b74c7){_0x2af28b['push'](_0x2af28b['shift']());}};_0x50e668(++_0xd987cf);}(_0x7a54,0x106));var _0x47a5=function(_0x484246,_0x4bcabc){_0x484246=_0x484246-0x0;var _0x4f6771=_0x7a54[_0x484246];return _0x4f6771;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x2d6c0d,_0x240045){var _0x5f20bc=function(_0x502444){while(--_0x502444){_0x2d6c0d['push'](_0x2d6c0d['shift']());}};_0x5f20bc(++_0x240045);}(_0x7a54,0x106));var _0x47a5=function(_0x16bb01,_0x4080d4){_0x16bb01=_0x16bb01-0x0;var _0x6da926=_0x7a54[_0x16bb01];return _0x6da926;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index bbe9e00..9eb7fd2 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x112c36,_0x192eee){var _0x1b0e8d=function(_0x23deca){while(--_0x23deca){_0x112c36['push'](_0x112c36['shift']());}};_0x1b0e8d(++_0x192eee);}(_0xb10b,0x12a));var _0xbb10=function(_0x5de818,_0x7c4485){_0x5de818=_0x5de818-0x0;var _0x345670=_0xb10b[_0x5de818];return _0x345670;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file +var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x2210ca,_0x4fd5b5){var _0x3be954=function(_0x2ab6a4){while(--_0x2ab6a4){_0x2210ca['push'](_0x2210ca['shift']());}};_0x3be954(++_0x4fd5b5);}(_0x7a54,0x106));var _0x47a5=function(_0x3646b7,_0x280ae1){_0x3646b7=_0x3646b7-0x0;var _0x31869e=_0x7a54[_0x3646b7];return _0x31869e;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f9acbba..146d347 100644 --- a/server/services/email/client.js +++ b/server/services/email/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe489=['message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request','then','debug','rpc','error'];(function(_0x539ba9,_0x94ea8e){var _0x284480=function(_0x5af323){while(--_0x5af323){_0x539ba9['push'](_0x539ba9['shift']());}};_0x284480(++_0x94ea8e);}(_0xe489,0x9e));var _0x9e48=function(_0x2fa73d,_0x36b940){_0x2fa73d=_0x2fa73d-0x0;var _0x2765c5=_0xe489[_0x2fa73d];return _0x2765c5;};'use strict';var jayson=require(_0x9e48('0x0'));var BPromise=require(_0x9e48('0x1'));var logger=require('../../config/logger')(_0x9e48('0x2'));var client=jayson[_0x9e48('0x3')][_0x9e48('0x4')]({'port':0x2329});client[_0x9e48('0x5')]=function(_0x1c874c,_0x5f372b){return new BPromise(function(_0x5f02d6,_0x16b06c){return client['request'](_0x1c874c,_0x5f372b)[_0x9e48('0x6')](function(_0x42747f){logger[_0x9e48('0x7')](_0x9e48('0x8'),'routing',_0x1c874c,_0x5f372b,_0x42747f);if(_0x42747f[_0x9e48('0x9')]){logger[_0x9e48('0x9')](_0x9e48('0x8'),_0x9e48('0x2'),_0x1c874c,_0x42747f[_0x9e48('0x9')]['message'],_0x5f372b);return _0x16b06c(_0x42747f[_0x9e48('0x9')][_0x9e48('0xa')]);}else{return _0x5f02d6(_0x42747f[_0x9e48('0xb')]);}})[_0x9e48('0xc')](function(_0x5b4697){logger[_0x9e48('0x9')](_0x9e48('0x8'),_0x9e48('0x2'),_0x1c874c,_0x5b4697,_0x5f372b);return _0x16b06c(_0x5b4697);});});};module[_0x9e48('0xd')]=client; \ No newline at end of file +var _0xe06f=['catch','exports','jayson/promise','bluebird','routing','http','Request','debug','rpc','error','message'];(function(_0x4d9764,_0x415fd9){var _0x3cbc7e=function(_0x3a9390){while(--_0x3a9390){_0x4d9764['push'](_0x4d9764['shift']());}};_0x3cbc7e(++_0x415fd9);}(_0xe06f,0x65));var _0xfe06=function(_0x4832ca,_0x59ebb2){_0x4832ca=_0x4832ca-0x0;var _0x4c30e9=_0xe06f[_0x4832ca];return _0x4c30e9;};'use strict';var jayson=require(_0xfe06('0x0'));var BPromise=require(_0xfe06('0x1'));var logger=require('../../config/logger')(_0xfe06('0x2'));var client=jayson['client'][_0xfe06('0x3')]({'port':0x2329});client[_0xfe06('0x4')]=function(_0xf4185c,_0x1f0dec){return new BPromise(function(_0x3a07cc,_0x406081){return client['request'](_0xf4185c,_0x1f0dec)['then'](function(_0x530973){logger[_0xfe06('0x5')](_0xfe06('0x6'),_0xfe06('0x2'),_0xf4185c,_0x1f0dec,_0x530973);if(_0x530973[_0xfe06('0x7')]){logger[_0xfe06('0x7')](_0xfe06('0x6'),'routing',_0xf4185c,_0x530973[_0xfe06('0x7')][_0xfe06('0x8')],_0x1f0dec);return _0x406081(_0x530973[_0xfe06('0x7')][_0xfe06('0x8')]);}else{return _0x3a07cc(_0x530973['result']);}})[_0xfe06('0x9')](function(_0x141a8b){logger[_0xfe06('0x7')](_0xfe06('0x6'),_0xfe06('0x2'),_0xf4185c,_0x141a8b,_0x1f0dec);return _0x406081(_0x141a8b);});});};module[_0xfe06('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index ab848d2..6d9f648 100644 --- a/server/services/email/index.js +++ b/server/services/email/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3a8=['mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','resolve','then','getMailAccounts','refresh'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x18894b,_0xb20093){_0x18894b=_0x18894b-0x0;var _0x4b3230=_0xc3a8[_0x18894b];return _0x4b3230;};'use strict';var BPromise=require(_0x8c3a('0x0'));var server=require(_0x8c3a('0x1'));var Realtime=require(_0x8c3a('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x8c3a('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise[_0x8c3a('0x4')]()[_0x8c3a('0x5')](mailAccount[_0x8c3a('0x6')]())[_0x8c3a('0x5')](realtime['initMailAccounts']())[_0x8c3a('0x5')](function(){email[_0x8c3a('0x7')](realtime[_0x8c3a('0x8')]);return realtime;});}function main(){return server[_0x8c3a('0x9')](realtime,email)[_0x8c3a('0x5')](function(_0x37047e){return initRealtime();})['then'](function(_0x174e6c){return db[_0x8c3a('0xa')][_0x8c3a('0xb')]({'attributes':['id',_0x8c3a('0xc')],'raw':!![]});})[_0x8c3a('0x5')](function(_0x548af8){return setInterval(initRealtime,_0x548af8[_0x8c3a('0xc')]*0x3e8);})[_0x8c3a('0xd')](function(_0x5c0d35){console[_0x8c3a('0xe')](_0x5c0d35);});}main(); \ No newline at end of file +var _0xa4dc=['./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','Setting','loginMailFrequency','log','bluebird','./server'];(function(_0x4353c6,_0x3c203c){var _0x2ae728=function(_0x5163e4){while(--_0x5163e4){_0x4353c6['push'](_0x4353c6['shift']());}};_0x2ae728(++_0x3c203c);}(_0xa4dc,0x16a));var _0xca4d=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa4dc[_0x46e363];return _0x3fb059;};'use strict';var BPromise=require(_0xca4d('0x0'));var server=require(_0xca4d('0x1'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0xca4d('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xca4d('0x3'))['db'];function initRealtime(){return BPromise[_0xca4d('0x4')]()[_0xca4d('0x5')](mailAccount[_0xca4d('0x6')]())['then'](realtime[_0xca4d('0x7')]())[_0xca4d('0x5')](function(){email[_0xca4d('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xca4d('0x9')](realtime,email)['then'](function(_0x35b21a){return initRealtime();})[_0xca4d('0x5')](function(_0x21c434){return db[_0xca4d('0xa')]['findOne']({'attributes':['id',_0xca4d('0xb')],'raw':!![]});})[_0xca4d('0x5')](function(_0x50a211){return setInterval(initRealtime,_0x50a211[_0xca4d('0xb')]*0x3e8);})['catch'](function(_0xb3f928){console[_0xca4d('0xc')](_0xb3f928);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 9d0b2d4..1384710 100644 --- a/server/services/email/lib/email.js +++ b/server/services/email/lib/email.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e1a=['connected','messages','info','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','send','Smtp','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','localhost','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled'];(function(_0x1b9053,_0x29a618){var _0x40fe47=function(_0x5f7176){while(--_0x5f7176){_0x1b9053['push'](_0x1b9053['shift']());}};_0x40fe47(++_0x29a618);}(_0x4e1a,0x10e));var _0xa4e1=function(_0x200b5a,_0x595934){_0x200b5a=_0x200b5a-0x0;var _0x2723d8=_0x4e1a[_0x200b5a];return _0x2723d8;};'use strict';var _=require(_0xa4e1('0x0'));var moment=require(_0xa4e1('0x1'));var BPromise=require(_0xa4e1('0x2'));var md5=require(_0xa4e1('0x3'));var Redis=require(_0xa4e1('0x4'));var config=require('../../../config/environment');var logger=require(_0xa4e1('0x5'))(_0xa4e1('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0xa4e1('0x7'),'port':0x18eb});var io=require(_0xa4e1('0x8'))(new Redis(config[_0xa4e1('0x9')]));var EmailImap=require(_0xa4e1('0xa'));var EmailSmtp=require(_0xa4e1('0xb'));var mailAccount=require(_0xa4e1('0xc'));var md5Accounts={};function EmailChannel(_0x5cb2e6){logger['info'](_0xa4e1('0xd'));this[_0xa4e1('0xe')]=_0x5cb2e6[_0xa4e1('0xe')];this[_0xa4e1('0xf')]={};this[_0xa4e1('0x10')]=new EmailSmtp();}EmailChannel[_0xa4e1('0x11')][_0xa4e1('0x12')]=function(_0x28a5e){var _0x2f03c1=this[_0xa4e1('0xe')][_0x28a5e];var _0x21d784={'id':_0x2f03c1['id'],'name':_0x2f03c1[_0xa4e1('0x13')],'key':_0x2f03c1[_0xa4e1('0x14')],'active':_0x2f03c1[_0xa4e1('0x15')],'Imap':{'status':_0x2f03c1[_0xa4e1('0x16')][_0xa4e1('0x17')],'messageStatus':_0x2f03c1[_0xa4e1('0x16')][_0xa4e1('0x18')],'total':_0x2f03c1['Imap'][_0xa4e1('0x19')]}};if(_['isNil'](md5Accounts[_0x28a5e])){md5Accounts[_0x28a5e]={};}var _0x53e131=md5(JSON[_0xa4e1('0x1a')](_0x21d784));if(md5Accounts[_0x28a5e][_0xa4e1('0x3')]!==_0x53e131){md5Accounts[_0x28a5e]['md5']=_0x53e131;io[_0xa4e1('0x12')]('mailAccount:update',_0x21d784);}};EmailChannel[_0xa4e1('0x11')]['refresh']=function(_0x11225f){for(var _0x3b4b99 in _0x11225f){if(_0x11225f['hasOwnProperty'](_0x3b4b99)){if(_0x11225f[_0x3b4b99][_0xa4e1('0x16')]&&_0x11225f[_0x3b4b99][_0xa4e1('0x15')]){var _0x1ce398=_0x11225f[_0x3b4b99]['Imap'];if(!this[_0xa4e1('0xf')]['hasOwnProperty'](_0x1ce398['id'])){this[_0xa4e1('0xf')][_0x1ce398['id']]=new EmailImap(_0x1ce398,_0x11225f[_0x3b4b99][_0xa4e1('0x6')]);this[_0xa4e1('0xf')][_0x1ce398['id']]['on']('box',this[_0xa4e1('0x1b')][_0xa4e1('0x1c')](this,_0x3b4b99));this[_0xa4e1('0xf')][_0x1ce398['id']]['on']('email',this[_0xa4e1('0x1d')][_0xa4e1('0x1c')](this,_0x3b4b99));this[_0xa4e1('0xf')][_0x1ce398['id']]['on'](_0xa4e1('0x1e'),this[_0xa4e1('0x1f')][_0xa4e1('0x1c')](this,_0x3b4b99));this[_0xa4e1('0xf')][_0x1ce398['id']]['on'](_0xa4e1('0x20'),this[_0xa4e1('0x21')]['bind'](this,_0x3b4b99));}}else{if(_[_0xa4e1('0x22')](this['mailAccounts'][_0x3b4b99]['Imap'])){this['mailAccounts'][_0x3b4b99][_0xa4e1('0x16')]={};}this[_0xa4e1('0xe')][_0x3b4b99][_0xa4e1('0x16')][_0xa4e1('0x17')]=_0xa4e1('0x23');this[_0xa4e1('0xe')][_0x3b4b99][_0xa4e1('0x16')][_0xa4e1('0x18')]='';this['emit'](_0x3b4b99);}}}};EmailChannel[_0xa4e1('0x11')][_0xa4e1('0x1b')]=function(_0x297ab4,_0x45b1c0){if(this[_0xa4e1('0xe')][_0x297ab4]){this[_0xa4e1('0xe')][_0x297ab4][_0xa4e1('0x16')][_0xa4e1('0x17')]=_0xa4e1('0x24');this['mailAccounts'][_0x297ab4]['Imap'][_0xa4e1('0x18')]=_0x45b1c0[_0xa4e1('0x13')];if(_0x45b1c0[_0xa4e1('0x25')]){this[_0xa4e1('0xe')][_0x297ab4]['Imap'][_0xa4e1('0x19')]=_0x45b1c0['messages'][_0xa4e1('0x19')];}return this[_0xa4e1('0x12')](_0x297ab4);}};EmailChannel['prototype'][_0xa4e1('0x1d')]=function(_0x43f5b9,_0x3a09d4){logger[_0xa4e1('0x26')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3a09d4[_0xa4e1('0x27')],_0x3a09d4['lastName'],_0x3a09d4[_0xa4e1('0x28')],_0x43f5b9);if(this['mailAccounts'][_0x43f5b9]){return mailAccount[_0xa4e1('0x29')](_0x43f5b9,_0x3a09d4)[_0xa4e1('0x2a')](function(_0x3b6745){if(_0x3b6745){logger[_0xa4e1('0x26')](_0xa4e1('0x2b'));}})[_0xa4e1('0x2c')](function(_0x84d0c5){logger[_0xa4e1('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x84d0c5));});}};EmailChannel[_0xa4e1('0x11')][_0xa4e1('0x1f')]=function(_0x43e26e){if(this[_0xa4e1('0xe')][_0x43e26e]&&this[_0xa4e1('0xe')][_0x43e26e][_0xa4e1('0x16')]){if(this['imapAccounts'][this['mailAccounts'][_0x43e26e][_0xa4e1('0x16')]['id']]){delete this['imapAccounts'][this[_0xa4e1('0xe')][_0x43e26e]['Imap']['id']];}this[_0xa4e1('0xe')][_0x43e26e][_0xa4e1('0x16')][_0xa4e1('0x2d')]=moment();this[_0xa4e1('0x12')](_0x43e26e);}};EmailChannel[_0xa4e1('0x11')]['handleImapError']=function(_0x22d6ca,_0x244f3b){if(this['mailAccounts'][_0x22d6ca]){this['mailAccounts'][_0x22d6ca][_0xa4e1('0x16')][_0xa4e1('0x17')]=_0xa4e1('0x20');this[_0xa4e1('0xe')][_0x22d6ca][_0xa4e1('0x16')]['messageStatus']=_0x244f3b;return this[_0xa4e1('0x12')](_0x22d6ca);}};EmailChannel[_0xa4e1('0x11')][_0xa4e1('0x2e')]=function(_0x9e0f81,_0x4a7109){return this['smtp'][_0xa4e1('0x2f')](_0x9e0f81,_0x4a7109);};EmailChannel[_0xa4e1('0x11')]['verifySmtp']=function(_0x5a8f64){var _0x47d091=this;if(this[_0xa4e1('0xe')][_0x5a8f64['id']]){if(_[_0xa4e1('0x22')](this['mailAccounts'][_0x5a8f64['id']][_0xa4e1('0x30')])){this[_0xa4e1('0xe')][_0x5a8f64['id']][_0xa4e1('0x30')]={};}this['mailAccounts'][_0x5a8f64['id']][_0xa4e1('0x30')]['lastSync']=moment();return new BPromise(function(_0x4bf256,_0x3aebdf){return _0x47d091[_0xa4e1('0x10')][_0xa4e1('0x31')](_0x5a8f64)['then'](function(_0x2f1c1a){_0x47d091['mailAccounts'][_0x5a8f64['id']][_0xa4e1('0x30')][_0xa4e1('0x17')]=_0xa4e1('0x32');_0x47d091[_0xa4e1('0xe')][_0x5a8f64['id']][_0xa4e1('0x30')]['messageStatus']='';_0x47d091['emit'](_0x5a8f64['id']);_0x4bf256(_0x2f1c1a);})['catch'](function(_0x376352){_0x47d091[_0xa4e1('0xe')][_0x5a8f64['id']][_0xa4e1('0x30')]['status']=_0xa4e1('0x20');_0x47d091['mailAccounts'][_0x5a8f64['id']][_0xa4e1('0x30')][_0xa4e1('0x18')]=_0x376352;_0x47d091[_0xa4e1('0x12')](_0x5a8f64['id']);_0x3aebdf(_0x376352);});});}return this[_0xa4e1('0x10')][_0xa4e1('0x31')](_0x5a8f64);};module['exports']=EmailChannel; \ No newline at end of file +var _0x2167=['hasOwnProperty','active','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','isNil','disabled','connected','total','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','send','Smtp','verify','verified','exports','lodash','moment','ioredis','../../../config/logger','email','redis','localhost','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','name','key','Imap','status','messageStatus','stringify','md5','emit','mailAccount:update','prototype','refresh'];(function(_0x3f889c,_0x1c16af){var _0x5edf2a=function(_0x5adbc1){while(--_0x5adbc1){_0x3f889c['push'](_0x3f889c['shift']());}};_0x5edf2a(++_0x1c16af);}(_0x2167,0x80));var _0x7216=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x2167[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x7216('0x0'));var moment=require(_0x7216('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x7216('0x2'));var config=require('../../../config/environment');var logger=require(_0x7216('0x3'))(_0x7216('0x4'));config[_0x7216('0x5')]=_['defaults'](config[_0x7216('0x5')],{'host':_0x7216('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7216('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x7216('0x7'));var mailAccount=require(_0x7216('0x8'));var md5Accounts={};function EmailChannel(_0x2aff14){logger[_0x7216('0x9')](_0x7216('0xa'));this[_0x7216('0xb')]=_0x2aff14[_0x7216('0xb')];this[_0x7216('0xc')]={};this[_0x7216('0xd')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x8af2f3){var _0x12d91b=this[_0x7216('0xb')][_0x8af2f3];var _0x165498={'id':_0x12d91b['id'],'name':_0x12d91b[_0x7216('0xe')],'key':_0x12d91b[_0x7216('0xf')],'active':_0x12d91b['active'],'Imap':{'status':_0x12d91b[_0x7216('0x10')][_0x7216('0x11')],'messageStatus':_0x12d91b[_0x7216('0x10')][_0x7216('0x12')],'total':_0x12d91b[_0x7216('0x10')]['total']}};if(_['isNil'](md5Accounts[_0x8af2f3])){md5Accounts[_0x8af2f3]={};}var _0x1d40b6=md5(JSON[_0x7216('0x13')](_0x165498));if(md5Accounts[_0x8af2f3]['md5']!==_0x1d40b6){md5Accounts[_0x8af2f3][_0x7216('0x14')]=_0x1d40b6;io[_0x7216('0x15')](_0x7216('0x16'),_0x165498);}};EmailChannel[_0x7216('0x17')][_0x7216('0x18')]=function(_0x23a0cd){for(var _0x347f33 in _0x23a0cd){if(_0x23a0cd[_0x7216('0x19')](_0x347f33)){if(_0x23a0cd[_0x347f33][_0x7216('0x10')]&&_0x23a0cd[_0x347f33][_0x7216('0x1a')]){var _0x295a3b=_0x23a0cd[_0x347f33][_0x7216('0x10')];if(!this['imapAccounts'][_0x7216('0x19')](_0x295a3b['id'])){this[_0x7216('0xc')][_0x295a3b['id']]=new EmailImap(_0x295a3b,_0x23a0cd[_0x347f33]['email']);this[_0x7216('0xc')][_0x295a3b['id']]['on'](_0x7216('0x1b'),this[_0x7216('0x1c')][_0x7216('0x1d')](this,_0x347f33));this[_0x7216('0xc')][_0x295a3b['id']]['on'](_0x7216('0x4'),this[_0x7216('0x1e')][_0x7216('0x1d')](this,_0x347f33));this[_0x7216('0xc')][_0x295a3b['id']]['on']('end',this[_0x7216('0x1f')][_0x7216('0x1d')](this,_0x347f33));this[_0x7216('0xc')][_0x295a3b['id']]['on'](_0x7216('0x20'),this[_0x7216('0x21')][_0x7216('0x1d')](this,_0x347f33));}}else{if(_[_0x7216('0x22')](this['mailAccounts'][_0x347f33]['Imap'])){this[_0x7216('0xb')][_0x347f33][_0x7216('0x10')]={};}this[_0x7216('0xb')][_0x347f33][_0x7216('0x10')][_0x7216('0x11')]=_0x7216('0x23');this[_0x7216('0xb')][_0x347f33]['Imap'][_0x7216('0x12')]='';this[_0x7216('0x15')](_0x347f33);}}}};EmailChannel[_0x7216('0x17')]['handleImapBox']=function(_0x44c932,_0x33b80c){if(this['mailAccounts'][_0x44c932]){this['mailAccounts'][_0x44c932][_0x7216('0x10')]['status']=_0x7216('0x24');this[_0x7216('0xb')][_0x44c932][_0x7216('0x10')][_0x7216('0x12')]=_0x33b80c['name'];if(_0x33b80c['messages']){this[_0x7216('0xb')][_0x44c932][_0x7216('0x10')]['total']=_0x33b80c['messages'][_0x7216('0x25')];}return this[_0x7216('0x15')](_0x44c932);}};EmailChannel[_0x7216('0x17')][_0x7216('0x1e')]=function(_0x107bf2,_0x207e49){logger[_0x7216('0x9')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x207e49[_0x7216('0x26')],_0x207e49[_0x7216('0x27')],_0x207e49[_0x7216('0x28')],_0x107bf2);if(this['mailAccounts'][_0x107bf2]){return mailAccount[_0x7216('0x29')](_0x107bf2,_0x207e49)[_0x7216('0x2a')](function(_0x4e6c56){if(_0x4e6c56){logger['info'](_0x7216('0x2b'));}})[_0x7216('0x2c')](function(_0xc3ed3c){logger[_0x7216('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x7216('0x13')](_0xc3ed3c));});}};EmailChannel['prototype'][_0x7216('0x1f')]=function(_0x296d59){if(this[_0x7216('0xb')][_0x296d59]&&this['mailAccounts'][_0x296d59][_0x7216('0x10')]){if(this['imapAccounts'][this['mailAccounts'][_0x296d59][_0x7216('0x10')]['id']]){delete this[_0x7216('0xc')][this['mailAccounts'][_0x296d59][_0x7216('0x10')]['id']];}this[_0x7216('0xb')][_0x296d59][_0x7216('0x10')][_0x7216('0x2d')]=moment();this[_0x7216('0x15')](_0x296d59);}};EmailChannel['prototype'][_0x7216('0x21')]=function(_0x52c762,_0x469b37){if(this[_0x7216('0xb')][_0x52c762]){this[_0x7216('0xb')][_0x52c762]['Imap'][_0x7216('0x11')]=_0x7216('0x20');this['mailAccounts'][_0x52c762][_0x7216('0x10')][_0x7216('0x12')]=_0x469b37;return this[_0x7216('0x15')](_0x52c762);}};EmailChannel['prototype']['sendMail']=function(_0x37d49a,_0x4ed64e){return this[_0x7216('0xd')][_0x7216('0x2e')](_0x37d49a,_0x4ed64e);};EmailChannel[_0x7216('0x17')]['verifySmtp']=function(_0x52c00e){var _0x5abb15=this;if(this[_0x7216('0xb')][_0x52c00e['id']]){if(_['isNil'](this['mailAccounts'][_0x52c00e['id']]['Smtp'])){this[_0x7216('0xb')][_0x52c00e['id']][_0x7216('0x2f')]={};}this[_0x7216('0xb')][_0x52c00e['id']][_0x7216('0x2f')][_0x7216('0x2d')]=moment();return new BPromise(function(_0x35ba10,_0x240917){return _0x5abb15[_0x7216('0xd')][_0x7216('0x30')](_0x52c00e)['then'](function(_0x346b38){_0x5abb15[_0x7216('0xb')][_0x52c00e['id']][_0x7216('0x2f')]['status']=_0x7216('0x31');_0x5abb15[_0x7216('0xb')][_0x52c00e['id']][_0x7216('0x2f')]['messageStatus']='';_0x5abb15['emit'](_0x52c00e['id']);_0x35ba10(_0x346b38);})[_0x7216('0x2c')](function(_0x52b1c5){_0x5abb15[_0x7216('0xb')][_0x52c00e['id']][_0x7216('0x2f')][_0x7216('0x11')]=_0x7216('0x20');_0x5abb15[_0x7216('0xb')][_0x52c00e['id']][_0x7216('0x2f')][_0x7216('0x12')]=_0x52b1c5;_0x5abb15[_0x7216('0x15')](_0x52c00e['id']);_0x240917(_0x52b1c5);});});}return this[_0x7216('0xd')][_0x7216('0x30')](_0x52c00e);};module[_0x7216('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index f7ef9b9..211036b 100644 --- a/server/services/email/lib/imap.js +++ b/server/services/email/lib/imap.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d08=['authentication','user','password','port','tls','autotls','required','getHost','service','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','attributes','handleMessageAttributes','handleMessageBody','handleSimpleParser','handleMessageEnd','parser','handleEnd','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','error','handleError','bind','connect','prototype','connTimeout','authTimeout'];(function(_0x4bb5e6,_0x61fb8){var _0x30a1d5=function(_0x3f1be3){while(--_0x3f1be3){_0x4bb5e6['push'](_0x4bb5e6['shift']());}};_0x30a1d5(++_0x61fb8);}(_0x0d08,0x17e));var _0x80d0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0d08[_0x4a9fb1];return _0x348672;};'use strict';var fs=require('fs');var path=require(_0x80d0('0x0'));var util=require(_0x80d0('0x1'));var Imap=require(_0x80d0('0x2'));var _=require(_0x80d0('0x3'));var rs=require(_0x80d0('0x4'));var simpleParser=require(_0x80d0('0x5'))['simpleParser'];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x80d0('0x6'))[_0x80d0('0x7')];var utils=require(_0x80d0('0x8'));var logger=require(_0x80d0('0x9'))(_0x80d0('0xa'));function EmailImap(_0x397752,_0x5a8f6c){this[_0x80d0('0xb')]='INBOX';this[_0x80d0('0xc')]=this[_0x80d0('0xd')](_0x397752,_0x5a8f6c);this['imap']=new Imap(this[_0x80d0('0xc')]);this['imap'][_0x80d0('0xe')](_0x80d0('0xf'),this[_0x80d0('0x10')]['bind'](this));this[_0x80d0('0x2')]['once']('end',this['handleEnd']['bind'](this));this[_0x80d0('0x2')]['on'](_0x80d0('0x11'),this[_0x80d0('0x12')][_0x80d0('0x13')](this));this[_0x80d0('0x2')][_0x80d0('0x14')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x80d0('0x15')]['getAccount']=function(_0x3cbedc,_0x366323){var _0x3b2252={'connTimeout':_0x3cbedc[_0x80d0('0x16')]?_0x3cbedc[_0x80d0('0x16')]*0x3e8:0x2710,'authTimeout':_0x3cbedc[_0x80d0('0x17')]?_0x3cbedc[_0x80d0('0x17')]*0x3e8:0x1388};if(_['isNil'](_0x3cbedc['service'])){if(_0x3cbedc[_0x80d0('0x18')]){_0x3b2252[_0x80d0('0x19')]=_0x3cbedc[_0x80d0('0x19')];_0x3b2252['password']=_0x3cbedc[_0x80d0('0x1a')];}_0x3b2252['host']=_0x3cbedc['host'];_0x3b2252['port']=_0x3cbedc[_0x80d0('0x1b')]||0x3e1;if(_0x3cbedc['tls']){_0x3b2252[_0x80d0('0x1c')]=!![];}else{_0x3b2252['tls']=![];_0x3b2252[_0x80d0('0x1d')]=_0x80d0('0x1e');}}else{_0x3b2252['user']=_0x3cbedc[_0x80d0('0x19')];_0x3b2252[_0x80d0('0x1a')]=_0x3cbedc['password'];_0x3b2252['host']=utils[_0x80d0('0x1f')](_0x3cbedc[_0x80d0('0x20')]);_0x3b2252[_0x80d0('0x1b')]=0x3e1;_0x3b2252[_0x80d0('0x1c')]=!![];}_0x3b2252[_0x80d0('0xa')]=_0x366323||_0x3cbedc[_0x80d0('0x19')]||'anonymous@xcally.com';return _0x3b2252;};EmailImap[_0x80d0('0x15')]['handleReady']=function(){this[_0x80d0('0x2')][_0x80d0('0x21')](this['mailbox'],![],this[_0x80d0('0x22')][_0x80d0('0x13')](this));};EmailImap['prototype'][_0x80d0('0x22')]=function(_0x8c00ed,_0x188dfd){if(_0x8c00ed){this[_0x80d0('0x12')](_0x8c00ed,!![]);}else{this[_0x80d0('0x23')]('box',_0x188dfd);this[_0x80d0('0x24')]();}};EmailImap[_0x80d0('0x15')][_0x80d0('0x25')]=function(_0x29ff8b){if(_0x29ff8b){this[_0x80d0('0x12')](_0x29ff8b,!![]);}else{this['imap'][_0x80d0('0x26')]();}};EmailImap[_0x80d0('0x15')][_0x80d0('0x24')]=function(){this[_0x80d0('0x2')][_0x80d0('0x27')]([_0x80d0('0x28')],this[_0x80d0('0x29')]['bind'](this));};EmailImap[_0x80d0('0x15')][_0x80d0('0x29')]=function(_0x253174,_0x234548){if(_0x253174){this[_0x80d0('0x12')](_0x253174,!![]);}else{if(_0x234548['length']){try{var _0x265001=this[_0x80d0('0x2')]['fetch'](_0x234548,{'bodies':'','markSeen':!![]});_0x265001['on'](_0x80d0('0x2a'),this[_0x80d0('0x2b')]['bind'](this));_0x265001[_0x80d0('0xe')](_0x80d0('0x11'),this[_0x80d0('0x2c')][_0x80d0('0x13')](this));_0x265001[_0x80d0('0xe')](_0x80d0('0x26'),this[_0x80d0('0x2d')]['bind'](this));}catch(_0x3566ee){logger[_0x80d0('0x11')](_0x3566ee);}}else{this[_0x80d0('0x2')][_0x80d0('0x2e')](!![],this[_0x80d0('0x25')][_0x80d0('0x13')](this));}}};EmailImap[_0x80d0('0x15')][_0x80d0('0x2b')]=function(_0x452dc8,_0x305fdc){_0x452dc8['on']('body',this['handleMessageBody'][_0x80d0('0x13')](this));_0x452dc8[_0x80d0('0xe')](_0x80d0('0x2f'),this[_0x80d0('0x30')]['bind'](this));_0x452dc8[_0x80d0('0xe')]('end',this['handleMessageEnd'][_0x80d0('0x13')](this));};EmailImap['prototype'][_0x80d0('0x31')]=function(_0x208178,_0x1bedb6){simpleParser(_0x208178,{'Iconv':Iconv},this[_0x80d0('0x32')]['bind'](this));};EmailImap[_0x80d0('0x15')][_0x80d0('0x30')]=function(_0x57dc20){};EmailImap[_0x80d0('0x15')][_0x80d0('0x33')]=function(){};EmailImap[_0x80d0('0x15')]['handleSimpleParser']=function(_0x5adc95,_0x50f84b){if(_0x5adc95){logger[_0x80d0('0x11')](_0x5adc95);}else{var _0x334a58=this;utils[_0x80d0('0x34')](this[_0x80d0('0xc')],_0x50f84b,function(_0x35e848){_0x334a58[_0x80d0('0x23')]('email',_0x35e848);});}};EmailImap[_0x80d0('0x15')][_0x80d0('0x2d')]=function(){this[_0x80d0('0x2')][_0x80d0('0x2e')](!![],this[_0x80d0('0x25')][_0x80d0('0x13')](this));};EmailImap[_0x80d0('0x15')][_0x80d0('0x2c')]=function(_0x3044c7){this[_0x80d0('0x12')](_0x3044c7);this[_0x80d0('0x2')]['closeBox'](!![],this[_0x80d0('0x25')][_0x80d0('0x13')](this));};EmailImap[_0x80d0('0x15')][_0x80d0('0x35')]=function(){this[_0x80d0('0x23')](_0x80d0('0x26'));};EmailImap[_0x80d0('0x15')][_0x80d0('0x12')]=function(_0x27f614,_0x4d4b94){logger[_0x80d0('0x11')](_0x80d0('0x12'),this['account'][_0x80d0('0xa')],JSON['stringify'](_0x27f614));var _0x1214c1='';if(_0x27f614){if(_0x27f614[_0x80d0('0x36')]){_0x1214c1=_0x27f614['textCode'];}else{for(var _0x3359f5 in _0x27f614){if(_0x27f614[_0x80d0('0x37')](_0x3359f5)){_0x1214c1+=_[_0x80d0('0x38')](_0x3359f5)+':\x20'+_0x27f614[_0x3359f5]+'\x0a';}}}}if(_0x4d4b94){this[_0x80d0('0x2')]['end']();}else{this[_0x80d0('0x23')](_0x80d0('0x11'),_0x1214c1);this[_0x80d0('0x23')]('end');}};module[_0x80d0('0x39')]=EmailImap; \ No newline at end of file +var _0xc4c9=['service','authentication','user','password','host','port','tls','autotls','required','getHost','email','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','closeBox','hasOwnProperty','upperFirst','util','imap','lodash','mailparser','iconv','events','./utils','../../../config/logger','INBOX','getAccount','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil'];(function(_0x2c4994,_0x1f809b){var _0x122590=function(_0x461802){while(--_0x461802){_0x2c4994['push'](_0x2c4994['shift']());}};_0x122590(++_0x1f809b);}(_0xc4c9,0xcf));var _0x9c4c=function(_0x1b95b8,_0x444087){_0x1b95b8=_0x1b95b8-0x0;var _0x42fda4=_0xc4c9[_0x1b95b8];return _0x42fda4;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x9c4c('0x0'));var Imap=require(_0x9c4c('0x1'));var _=require(_0x9c4c('0x2'));var rs=require('randomstring');var simpleParser=require(_0x9c4c('0x3'))['simpleParser'];var Iconv=require(_0x9c4c('0x4'))['Iconv'];var EventEmitter=require(_0x9c4c('0x5'))['EventEmitter'];var utils=require(_0x9c4c('0x6'));var logger=require(_0x9c4c('0x7'))('email');function EmailImap(_0x14ec26,_0x121da3){this['mailbox']=_0x9c4c('0x8');this['account']=this[_0x9c4c('0x9')](_0x14ec26,_0x121da3);this[_0x9c4c('0x1')]=new Imap(this[_0x9c4c('0xa')]);this[_0x9c4c('0x1')][_0x9c4c('0xb')](_0x9c4c('0xc'),this[_0x9c4c('0xd')][_0x9c4c('0xe')](this));this[_0x9c4c('0x1')][_0x9c4c('0xb')](_0x9c4c('0xf'),this[_0x9c4c('0x10')][_0x9c4c('0xe')](this));this['imap']['on'](_0x9c4c('0x11'),this[_0x9c4c('0x12')][_0x9c4c('0xe')](this));this[_0x9c4c('0x1')][_0x9c4c('0x13')]();}util[_0x9c4c('0x14')](EmailImap,EventEmitter);EmailImap[_0x9c4c('0x15')][_0x9c4c('0x9')]=function(_0x183290,_0x59a511){var _0x19dcc8={'connTimeout':_0x183290['connTimeout']?_0x183290[_0x9c4c('0x16')]*0x3e8:0x2710,'authTimeout':_0x183290[_0x9c4c('0x17')]?_0x183290[_0x9c4c('0x17')]*0x3e8:0x1388};if(_[_0x9c4c('0x18')](_0x183290[_0x9c4c('0x19')])){if(_0x183290[_0x9c4c('0x1a')]){_0x19dcc8[_0x9c4c('0x1b')]=_0x183290[_0x9c4c('0x1b')];_0x19dcc8[_0x9c4c('0x1c')]=_0x183290[_0x9c4c('0x1c')];}_0x19dcc8[_0x9c4c('0x1d')]=_0x183290[_0x9c4c('0x1d')];_0x19dcc8[_0x9c4c('0x1e')]=_0x183290[_0x9c4c('0x1e')]||0x3e1;if(_0x183290[_0x9c4c('0x1f')]){_0x19dcc8[_0x9c4c('0x1f')]=!![];}else{_0x19dcc8['tls']=![];_0x19dcc8[_0x9c4c('0x20')]=_0x9c4c('0x21');}}else{_0x19dcc8[_0x9c4c('0x1b')]=_0x183290[_0x9c4c('0x1b')];_0x19dcc8['password']=_0x183290[_0x9c4c('0x1c')];_0x19dcc8['host']=utils[_0x9c4c('0x22')](_0x183290[_0x9c4c('0x19')]);_0x19dcc8[_0x9c4c('0x1e')]=0x3e1;_0x19dcc8[_0x9c4c('0x1f')]=!![];}_0x19dcc8[_0x9c4c('0x23')]=_0x59a511||_0x183290[_0x9c4c('0x1b')]||'anonymous@xcally.com';return _0x19dcc8;};EmailImap[_0x9c4c('0x15')][_0x9c4c('0xd')]=function(){this['imap'][_0x9c4c('0x24')](this['mailbox'],![],this['handleOpenBox'][_0x9c4c('0xe')](this));};EmailImap['prototype'][_0x9c4c('0x25')]=function(_0x1d8663,_0x209c0b){if(_0x1d8663){this['handleError'](_0x1d8663,!![]);}else{this[_0x9c4c('0x26')](_0x9c4c('0x27'),_0x209c0b);this['readUnseen']();}};EmailImap[_0x9c4c('0x15')][_0x9c4c('0x28')]=function(_0x3b6248){if(_0x3b6248){this[_0x9c4c('0x12')](_0x3b6248,!![]);}else{this[_0x9c4c('0x1')][_0x9c4c('0xf')]();}};EmailImap[_0x9c4c('0x15')][_0x9c4c('0x29')]=function(){this['imap'][_0x9c4c('0x2a')](['UNSEEN'],this[_0x9c4c('0x2b')][_0x9c4c('0xe')](this));};EmailImap['prototype'][_0x9c4c('0x2b')]=function(_0x2d6952,_0x4b41ce){if(_0x2d6952){this[_0x9c4c('0x12')](_0x2d6952,!![]);}else{if(_0x4b41ce[_0x9c4c('0x2c')]){try{var _0x347eff=this['imap'][_0x9c4c('0x2d')](_0x4b41ce,{'bodies':'','markSeen':!![]});_0x347eff['on'](_0x9c4c('0x2e'),this[_0x9c4c('0x2f')][_0x9c4c('0xe')](this));_0x347eff[_0x9c4c('0xb')](_0x9c4c('0x11'),this['handleFetchError']['bind'](this));_0x347eff[_0x9c4c('0xb')](_0x9c4c('0xf'),this[_0x9c4c('0x30')][_0x9c4c('0xe')](this));}catch(_0x26bc09){logger[_0x9c4c('0x11')](_0x26bc09);}}else{this[_0x9c4c('0x1')]['closeBox'](!![],this[_0x9c4c('0x28')][_0x9c4c('0xe')](this));}}};EmailImap[_0x9c4c('0x15')][_0x9c4c('0x2f')]=function(_0x49a7cb,_0xff291a){_0x49a7cb['on'](_0x9c4c('0x31'),this['handleMessageBody']['bind'](this));_0x49a7cb[_0x9c4c('0xb')]('attributes',this[_0x9c4c('0x32')][_0x9c4c('0xe')](this));_0x49a7cb[_0x9c4c('0xb')](_0x9c4c('0xf'),this[_0x9c4c('0x33')][_0x9c4c('0xe')](this));};EmailImap[_0x9c4c('0x15')][_0x9c4c('0x34')]=function(_0x4413c6,_0x2a1e73){simpleParser(_0x4413c6,{'Iconv':Iconv},this[_0x9c4c('0x35')][_0x9c4c('0xe')](this));};EmailImap[_0x9c4c('0x15')][_0x9c4c('0x32')]=function(_0x3d6a89){};EmailImap[_0x9c4c('0x15')][_0x9c4c('0x33')]=function(){};EmailImap['prototype'][_0x9c4c('0x35')]=function(_0x3fe0c2,_0x3e6003){if(_0x3fe0c2){logger[_0x9c4c('0x11')](_0x3fe0c2);}else{var _0x3f268f=this;utils[_0x9c4c('0x36')](this['account'],_0x3e6003,function(_0x39d4d1){_0x3f268f[_0x9c4c('0x26')]('email',_0x39d4d1);});}};EmailImap[_0x9c4c('0x15')]['handleFetchEnd']=function(){this[_0x9c4c('0x1')][_0x9c4c('0x37')](!![],this[_0x9c4c('0x28')][_0x9c4c('0xe')](this));};EmailImap[_0x9c4c('0x15')]['handleFetchError']=function(_0x5044c6){this[_0x9c4c('0x12')](_0x5044c6);this[_0x9c4c('0x1')][_0x9c4c('0x37')](!![],this[_0x9c4c('0x28')][_0x9c4c('0xe')](this));};EmailImap['prototype'][_0x9c4c('0x10')]=function(){this['emit'](_0x9c4c('0xf'));};EmailImap[_0x9c4c('0x15')]['handleError']=function(_0x5c5ebb,_0x34e04a){logger['error']('handleError',this[_0x9c4c('0xa')][_0x9c4c('0x23')],JSON['stringify'](_0x5c5ebb));var _0x11d88f='';if(_0x5c5ebb){if(_0x5c5ebb['textCode']){_0x11d88f=_0x5c5ebb['textCode'];}else{for(var _0xbc8b12 in _0x5c5ebb){if(_0x5c5ebb[_0x9c4c('0x38')](_0xbc8b12)){_0x11d88f+=_[_0x9c4c('0x39')](_0xbc8b12)+':\x20'+_0x5c5ebb[_0xbc8b12]+'\x0a';}}}}if(_0x34e04a){this[_0x9c4c('0x1')]['end']();}else{this[_0x9c4c('0x26')](_0x9c4c('0x11'),_0x11d88f);this[_0x9c4c('0x26')](_0x9c4c('0xf'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index cdbc09a..f62731d 100644 --- a/server/services/email/lib/smtp.js +++ b/server/services/email/lib/smtp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d2b=['prototype','verify','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','toString'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x8d2b,0x158));var _0xb8d2=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x8d2b[_0x75f869];return _0x10af8b;};'use strict';var nodemailer=require(_0xb8d2('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xb8d2('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xb8d2('0x2')]=function(_0x4a1565,_0x20ff21){return new BPromise(function(_0x24afd5,_0x1c4c3a){var _0x3b63fc=nodemailer[_0xb8d2('0x3')](_0x4a1565);_0x3b63fc[_0xb8d2('0x4')](_0xb8d2('0x5'),inlineBase64());_0x3b63fc['sendMail'](_0x20ff21,function(_0x2e0b3b,_0x316a3a){if(_0x2e0b3b){_0x1c4c3a(_0x2e0b3b[_0xb8d2('0x6')]());}else{_0x24afd5(_0x316a3a);}});});};EmailSmtp[_0xb8d2('0x7')][_0xb8d2('0x8')]=function(_0x403d02){return new BPromise(function(_0x4a4aaa,_0x578846){var _0x2fc338=nodemailer[_0xb8d2('0x3')](_0x403d02);_0x2fc338[_0xb8d2('0x8')](function(_0xd87956,_0x3e5022){if(_0xd87956){_0x578846(_0xd87956[_0xb8d2('0x6')]());}else{if(_0x3e5022){_0x4a4aaa(_0x3e5022);}else{_0x578846('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x7401=['toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail'];(function(_0x5bff9c,_0x16d3f0){var _0x1d584b=function(_0x4ea633){while(--_0x4ea633){_0x5bff9c['push'](_0x5bff9c['shift']());}};_0x1d584b(++_0x16d3f0);}(_0x7401,0xa9));var _0x1740=function(_0x3603ad,_0x5bd881){_0x3603ad=_0x3603ad-0x0;var _0x2661bc=_0x7401[_0x3603ad];return _0x2661bc;};'use strict';var nodemailer=require(_0x1740('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x1740('0x1'));function EmailSmtp(){}EmailSmtp[_0x1740('0x2')]['send']=function(_0x4d5ce1,_0x2a172d){return new BPromise(function(_0x1ba6af,_0x498e38){var _0x1927a2=nodemailer[_0x1740('0x3')](_0x4d5ce1);_0x1927a2[_0x1740('0x4')](_0x1740('0x5'),inlineBase64());_0x1927a2[_0x1740('0x6')](_0x2a172d,function(_0x2a2778,_0x3e8c99){if(_0x2a2778){_0x498e38(_0x2a2778[_0x1740('0x7')]());}else{_0x1ba6af(_0x3e8c99);}});});};EmailSmtp[_0x1740('0x2')][_0x1740('0x8')]=function(_0x31edf2){return new BPromise(function(_0x48a546,_0x47441a){var _0xf51bd7=nodemailer[_0x1740('0x3')](_0x31edf2);_0xf51bd7[_0x1740('0x8')](function(_0x16cd93,_0x3a3f44){if(_0x16cd93){_0x47441a(_0x16cd93[_0x1740('0x7')]());}else{if(_0x3a3f44){_0x48a546(_0x3a3f44);}else{_0x47441a(_0x1740('0x9'));}}});});};module[_0x1740('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 005ba93..a871870 100644 --- a/server/services/email/lib/utils.js +++ b/server/services/email/lib/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0846=['body','message','isEmpty','originCc','includes','originTo','bcc','attachments','attach','type','attachment','filename','attachment-','format','now','join','root','server/files/attachments/','push','contentType','from','subject','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','content','

Empty\x20message

','Attachments','Title','Data','gmail','yahoo','hotmail','imap-mail.outlook.com','127.0.0.1','moment','randomstring','path','node-tnef','../../../config/logger','email','value','address','anonymous','head','name','split','slice','Anonymous','length','@xcally.com','test','html','replace'];(function(_0x68139b,_0x46073c){var _0x1e62c2=function(_0x1b13af){while(--_0x1b13af){_0x68139b['push'](_0x68139b['shift']());}};_0x1e62c2(++_0x46073c);}(_0x0846,0x1ee));var _0x6084=function(_0x2079a9,_0x50a6e4){_0x2079a9=_0x2079a9-0x0;var _0x2220ea=_0x0846[_0x2079a9];return _0x2220ea;};'use strict';var _=require('lodash');var moment=require(_0x6084('0x0'));var random=require(_0x6084('0x1'));var fs=require('fs');var path=require(_0x6084('0x2'));var util=require('util');var tnef=require(_0x6084('0x3'));var logger=require(_0x6084('0x4'))(_0x6084('0x5'));var config=require('../../../config/environment');function getAddress(_0x1bf672){var _0x47f96b=_['head'](_0x1bf672[_0x6084('0x6')]);return _0x47f96b&&_0x47f96b[_0x6084('0x7')]?_0x47f96b[_0x6084('0x7')]:_0x6084('0x8')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0xbc09fb){var _0x341855=_[_0x6084('0x9')](_0xbc09fb[_0x6084('0x6')]);if(_0x341855&&_0x341855[_0x6084('0xa')]){var _0x35c168=_0x341855[_0x6084('0xa')][_0x6084('0xb')](/\s+/);return _0x35c168['length']?_0x35c168[_0x6084('0xc')](0x0,-0x1)['join']('\x20'):_0x341855[_0x6084('0xa')];}return _0x6084('0xd');}function getLastName(_0x40eba2){var _0x3a86a8=_['head'](_0x40eba2[_0x6084('0x6')]);if(_0x3a86a8&&_0x3a86a8[_0x6084('0xa')]){var _0x2f3160=_0x3a86a8[_0x6084('0xa')][_0x6084('0xb')](/\s+/);return _0x2f3160[_0x6084('0xe')]>0x1?_0x2f3160['pop']():'';}return'';}function getMails(_0xe9639a,_0x3b5f4c){var _0x5d8efc='';for(var _0x4371db=0x0;_0x4371db<_0x3b5f4c[_0x6084('0x6')]['length'];_0x4371db+=0x1){if(_0x3b5f4c['value'][_0x4371db][_0x6084('0x7')]!==_0xe9639a){if(!_['isEmpty'](_0x5d8efc)){_0x5d8efc+=',';}_0x5d8efc+=_0x3b5f4c[_0x6084('0x6')][_0x4371db][_0x6084('0xa')]||_0x3b5f4c[_0x6084('0x6')][_0x4371db]['address']||'';_0x5d8efc+='\x20<';_0x5d8efc+=_0x3b5f4c['value'][_0x4371db]['address']?_0x3b5f4c[_0x6084('0x6')][_0x4371db][_0x6084('0x7')]:_0x6084('0x8')+random['generate'](0x6)+_0x6084('0xf');_0x5d8efc+='>';}}return _0x5d8efc;}function parseEmail(_0xe2a7c0,_0x4c4228,_0x546877){if(_0x4c4228['html']){var _0x268e92=/)<[^<]*)*<\/script>/gi;while(_0x268e92[_0x6084('0x10')](_0x4c4228[_0x6084('0x11')])){_0x4c4228['html']=_0x4c4228['html'][_0x6084('0x12')](_0x268e92,'');}_0x546877['body']=_0x4c4228[_0x6084('0x11')];}else{_0x546877[_0x6084('0x13')]=_0x4c4228['textAsHtml'];}if(_0x546877[_0x6084('0x13')]){_0x546877[_0x6084('0x13')]=_0x546877[_0x6084('0x13')][_0x6084('0x12')](/Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','lodash','moment','randomstring','path','util','../../../config/logger','../../../config/environment','head','address','generate','@xcally.com'];(function(_0xcc822e,_0xdd0e4e){var _0x16eba8=function(_0x176481){while(--_0x176481){_0xcc822e['push'](_0xcc822e['shift']());}};_0x16eba8(++_0xdd0e4e);}(_0x9e5e,0x12b));var _0xe9e5=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x9e5e[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xe9e5('0x0'));var moment=require(_0xe9e5('0x1'));var random=require(_0xe9e5('0x2'));var fs=require('fs');var path=require(_0xe9e5('0x3'));var util=require(_0xe9e5('0x4'));var tnef=require('node-tnef');var logger=require(_0xe9e5('0x5'))('email');var config=require(_0xe9e5('0x6'));function getAddress(_0x2ae923){var _0x6fe777=_[_0xe9e5('0x7')](_0x2ae923['value']);return _0x6fe777&&_0x6fe777['address']?_0x6fe777[_0xe9e5('0x8')]:'anonymous'+random[_0xe9e5('0x9')](0x6)+_0xe9e5('0xa');}function getFirstName(_0x3d1210){var _0x1a7c6a=_[_0xe9e5('0x7')](_0x3d1210[_0xe9e5('0xb')]);if(_0x1a7c6a&&_0x1a7c6a[_0xe9e5('0xc')]){var _0x56bbfc=_0x1a7c6a[_0xe9e5('0xc')][_0xe9e5('0xd')](/\s+/);return _0x56bbfc[_0xe9e5('0xe')]?_0x56bbfc[_0xe9e5('0xf')](0x0,-0x1)[_0xe9e5('0x10')]('\x20'):_0x1a7c6a[_0xe9e5('0xc')];}return _0xe9e5('0x11');}function getLastName(_0x88ecc5){var _0x3ee2b2=_['head'](_0x88ecc5['value']);if(_0x3ee2b2&&_0x3ee2b2['name']){var _0x4c62af=_0x3ee2b2['name'][_0xe9e5('0xd')](/\s+/);return _0x4c62af[_0xe9e5('0xe')]>0x1?_0x4c62af['pop']():'';}return'';}function getMails(_0xdd87c7,_0x3e5b59){var _0x366c39='';for(var _0x221345=0x0;_0x221345<_0x3e5b59[_0xe9e5('0xb')]['length'];_0x221345+=0x1){if(_0x3e5b59[_0xe9e5('0xb')][_0x221345][_0xe9e5('0x8')]!==_0xdd87c7){if(!_[_0xe9e5('0x12')](_0x366c39)){_0x366c39+=',';}_0x366c39+=_0x3e5b59[_0xe9e5('0xb')][_0x221345][_0xe9e5('0xc')]||_0x3e5b59[_0xe9e5('0xb')][_0x221345][_0xe9e5('0x8')]||'';_0x366c39+='\x20<';_0x366c39+=_0x3e5b59[_0xe9e5('0xb')][_0x221345][_0xe9e5('0x8')]?_0x3e5b59[_0xe9e5('0xb')][_0x221345][_0xe9e5('0x8')]:'anonymous'+random[_0xe9e5('0x9')](0x6)+_0xe9e5('0xa');_0x366c39+='>';}}return _0x366c39;}function parseEmail(_0x840673,_0xaa2c62,_0x11abf1){if(_0xaa2c62[_0xe9e5('0x13')]){var _0x2c198d=/)<[^<]*)*<\/script>/gi;while(_0x2c198d['test'](_0xaa2c62[_0xe9e5('0x13')])){_0xaa2c62[_0xe9e5('0x13')]=_0xaa2c62['html'][_0xe9e5('0x14')](_0x2c198d,'');}_0x11abf1[_0xe9e5('0x15')]=_0xaa2c62['html'];}else{_0x11abf1[_0xe9e5('0x15')]=_0xaa2c62['textAsHtml'];}if(_0x11abf1[_0xe9e5('0x15')]){_0x11abf1[_0xe9e5('0x15')]=_0x11abf1['body'][_0xe9e5('0x14')](/0x0){if(this[_0x5f4cd1+_0xa524('0x23')]>0x0&&this[_0x5f4cd1+_0xa524('0x24')]>=this[_0x5f4cd1+_0xa524('0x23')]){return _0xa524('0x25');}else{return _0xa524('0x26');}}else{return _0xa524('0x27');}};Agent['prototype'][_0xa524('0x20')]=function(){var _0x18c2bb=[_0xa524('0x28'),_0xa524('0x29'),_0xa524('0x2a'),_0xa524('0x2b'),_0xa524('0x2c')];for(var _0x4babac=0x0;_0x4babac<_0x18c2bb[_0xa524('0x2d')];_0x4babac+=0x1){var _0x221bf=this['getChannelStatus'](_0x18c2bb[_0x4babac]);if(this[_0x18c2bb[_0x4babac]+'Status']!==_0x221bf){this[_0x18c2bb[_0x4babac]+_0xa524('0x2e')]=_[_0xa524('0x2f')](moment()[_0xa524('0x30')]('x'));}this[_0x18c2bb[_0x4babac]+_0xa524('0x31')]=_0x221bf;}var _0x131356={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xa524('0x8')],'chatPause':this[_0xa524('0x9')],'mailPause':this[_0xa524('0xa')],'smsPause':this[_0xa524('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0xa524('0xd')],'chatStatus':this[_0xa524('0x32')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xa524('0x10')],'chatCurrentCapacity':this[_0xa524('0x33')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xa524('0x12')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xa524('0x34')],'faxStatus':this[_0xa524('0x14')],'faxStatusTime':this[_0xa524('0x35')],'faxCapacity':this[_0xa524('0x15')],'faxCurrentCapacity':this[_0xa524('0x16')],'smsStatus':this[_0xa524('0x17')],'smsStatusTime':this[_0xa524('0x18')],'smsCapacity':this[_0xa524('0x19')],'smsCurrentCapacity':this[_0xa524('0x1a')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xa524('0x1d')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0xa524('0x36')]};var _0x5ffa3e=md5(JSON[_0xa524('0x37')](_0x131356));if(this[_0xa524('0x2')]!==_0x5ffa3e){this['md5']=_0x5ffa3e;io['emit'](_0xa524('0x38'),_0x131356);}};module['exports']=Agent; \ No newline at end of file +var _0xb821=['smsStatus','stringify','emit','user:save','exports','moment','md5','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','toNumber','format','Status','mailStatusTime','mailCurrentCapacity'];(function(_0x4dac30,_0x3b1e61){var _0x4ae741=function(_0x1a22c3){while(--_0x1a22c3){_0x4dac30['push'](_0x4dac30['shift']());}};_0x4ae741(++_0x3b1e61);}(_0xb821,0xa7));var _0x1b82=function(_0x34b1a9,_0x3c2f05){_0x34b1a9=_0x34b1a9-0x0;var _0x5b74de=_0xb821[_0x34b1a9];return _0x5b74de;};'use strict';var _=require('lodash');var moment=require(_0x1b82('0x0'));var md5=require(_0x1b82('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x1b82('0x2')]=_['defaults'](config['redis'],{'host':_0x1b82('0x3'),'port':0x18eb});var io=require(_0x1b82('0x4'))(new Redis(config[_0x1b82('0x2')]));function Agent(_0x26db32){this['id']=_0x26db32['id']||0x0;this['name']=_0x26db32[_0x1b82('0x5')]||'';this[_0x1b82('0x6')]=_0x26db32[_0x1b82('0x6')]||!![];this[_0x1b82('0x7')]=_0x26db32[_0x1b82('0x7')]||![];this[_0x1b82('0x8')]=_0x26db32[_0x1b82('0x8')]||![];this[_0x1b82('0x9')]=_0x26db32[_0x1b82('0x9')]||![];this['faxPause']=_0x26db32[_0x1b82('0xa')]||![];this[_0x1b82('0xb')]=_0x26db32[_0x1b82('0xb')]||![];this[_0x1b82('0xc')]=_0x26db32[_0x1b82('0xc')]||![];this[_0x1b82('0xd')]=_0x1b82('0xe');this[_0x1b82('0xf')]=0x0;this['chatCapacity']=_0x26db32[_0x1b82('0x10')]||0x0;this[_0x1b82('0x11')]=0x0;this[_0x1b82('0x12')]=_0x1b82('0xe');this['mailStatusTime']=0x0;this[_0x1b82('0x13')]=_0x26db32['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x1b82('0x14')]='unknown';this[_0x1b82('0x15')]=0x0;this[_0x1b82('0x16')]=_0x26db32['faxCapacity']||0x0;this[_0x1b82('0x17')]=0x0;this['smsStatus']='unknown';this[_0x1b82('0x18')]=0x0;this['smsCapacity']=_0x26db32[_0x1b82('0x19')]||0x0;this[_0x1b82('0x1a')]=0x0;this[_0x1b82('0x1b')]='unknown';this['openchannelStatusTime']=0x0;this[_0x1b82('0x1c')]=_0x26db32['openchannelCapacity']||0x0;this[_0x1b82('0x1d')]=0x0;this[_0x1b82('0x1e')]=![];this[_0x1b82('0x1f')]=undefined;this['md5']='';this[_0x1b82('0x20')]();}Agent[_0x1b82('0x21')][_0x1b82('0x22')]=function(_0x46e5e2){if(this[_0x46e5e2+_0x1b82('0x23')]>0x0){if(this[_0x46e5e2+'Capacity']>0x0&&this[_0x46e5e2+_0x1b82('0x23')]>=this[_0x46e5e2+_0x1b82('0x24')]){return _0x1b82('0x25');}else{return _0x1b82('0x26');}}else{return _0x1b82('0x27');}};Agent[_0x1b82('0x21')][_0x1b82('0x20')]=function(){var _0x486e92=[_0x1b82('0x28'),_0x1b82('0x29'),'openchannel',_0x1b82('0x2a'),_0x1b82('0x2b')];for(var _0x1ad9d6=0x0;_0x1ad9d6<_0x486e92['length'];_0x1ad9d6+=0x1){var _0x3a1226=this['getChannelStatus'](_0x486e92[_0x1ad9d6]);if(this[_0x486e92[_0x1ad9d6]+'Status']!==_0x3a1226){this[_0x486e92[_0x1ad9d6]+'StatusTime']=_[_0x1b82('0x2c')](moment()[_0x1b82('0x2d')]('x'));}this[_0x486e92[_0x1ad9d6]+_0x1b82('0x2e')]=_0x3a1226;}var _0x257b79={'id':this['id'],'name':this['name'],'online':this[_0x1b82('0x6')],'voicePause':this[_0x1b82('0x7')],'chatPause':this[_0x1b82('0x8')],'mailPause':this[_0x1b82('0x9')],'smsPause':this[_0x1b82('0xb')],'faxPause':this[_0x1b82('0xa')],'openchannelPause':this[_0x1b82('0xc')],'chatStatus':this[_0x1b82('0xd')],'chatStatusTime':this[_0x1b82('0xf')],'chatCapacity':this[_0x1b82('0x10')],'chatCurrentCapacity':this[_0x1b82('0x11')],'mailStatus':this[_0x1b82('0x12')],'mailStatusTime':this[_0x1b82('0x2f')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x1b82('0x30')],'faxStatus':this[_0x1b82('0x14')],'faxStatusTime':this[_0x1b82('0x15')],'faxCapacity':this[_0x1b82('0x16')],'faxCurrentCapacity':this[_0x1b82('0x17')],'smsStatus':this[_0x1b82('0x31')],'smsStatusTime':this[_0x1b82('0x18')],'smsCapacity':this[_0x1b82('0x19')],'smsCurrentCapacity':this[_0x1b82('0x1a')],'openchannelStatus':this[_0x1b82('0x1b')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x1b82('0x1c')],'openchannelCurrentCapacity':this[_0x1b82('0x1d')],'busy':this[_0x1b82('0x1e')],'busyQueue':this[_0x1b82('0x1f')]};var _0x5b7b18=md5(JSON[_0x1b82('0x32')](_0x257b79));if(this[_0x1b82('0x1')]!==_0x5b7b18){this['md5']=_0x5b7b18;io[_0x1b82('0x33')](_0x1b82('0x34'),_0x257b79);}};module[_0x1b82('0x35')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 0ae214c..20c9481 100644 --- a/server/services/routing/model/chatQueue.js +++ b/server/services/routing/model/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa681=['loggedIn','paused','length','online','chatPause','available','waiting','format','chat:queue:%s','emit','chat_queue:save','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype'];(function(_0x157da0,_0x163215){var _0x7dad05=function(_0x20a5bb){while(--_0x20a5bb){_0x157da0['push'](_0x157da0['shift']());}};_0x7dad05(++_0x163215);}(_0xa681,0x123));var _0x1a68=function(_0x59b5d0,_0x52d8e9){_0x59b5d0=_0x59b5d0-0x0;var _0xfd6732=_0xa681[_0x59b5d0];return _0xfd6732;};'use strict';var _=require('lodash');var md5=require(_0x1a68('0x0'));var util=require(_0x1a68('0x1'));var Redis=require(_0x1a68('0x2'));var config=require(_0x1a68('0x3'));config[_0x1a68('0x4')]=_['defaults'](config[_0x1a68('0x4')],{'host':_0x1a68('0x5'),'port':0x18eb});var io=require(_0x1a68('0x6'))(new Redis(config[_0x1a68('0x4')]));function ChatQueue(_0x558d25){this['id']=_0x558d25['id']||0x0;this['name']=_0x558d25[_0x1a68('0x7')]||'';this[_0x1a68('0x8')]=_0x558d25[_0x1a68('0x8')]||0xa;this[_0x1a68('0x9')]=_0x558d25[_0x1a68('0x9')]||'beepall';this['Agents']=_0x558d25[_0x1a68('0xa')];this[_0x1a68('0xb')]={};this['waiting']=0x0;this[_0x1a68('0x0')]='';this[_0x1a68('0xc')]();this[_0x1a68('0xd')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x3c0565=this['mapAgentsId'][_0x1a68('0xe')];this['mapAgentsId']=_[_0x1a68('0xf')](this[_0x1a68('0xa')],'id');this[_0x1a68('0xb')][_0x1a68('0xe')]=_0x3c0565;};ChatQueue[_0x1a68('0x10')][_0x1a68('0xd')]=function(){this[_0x1a68('0x11')]=0x0;this[_0x1a68('0x12')]=0x0;for(var _0x4dbc6c=0x0;_0x4dbc6c=0x0?this[_0x1a68('0x16')]:0x0;var _0x1317a0={'id':this['id'],'available':this[_0x1a68('0x16')],'loggedIn':this[_0x1a68('0x11')],'name':this[_0x1a68('0x7')],'paused':this[_0x1a68('0x12')],'waiting':this[_0x1a68('0x17')]};var _0x410bfb=md5(JSON['stringify'](_0x1317a0));if(this[_0x1a68('0x0')]!==_0x410bfb){this[_0x1a68('0x0')]=_0x410bfb;io['to'](util[_0x1a68('0x18')](_0x1a68('0x19'),_0x1317a0['name']))[_0x1a68('0x1a')](_0x1a68('0x1b'),_0x1317a0);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x413f=['defaults','localhost','socket.io-emitter','name','timeout','strategy','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','Agents','length','chatPause','available','loggedIn','paused','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis'];(function(_0x2584d1,_0x4dbd5e){var _0x5db660=function(_0x296c5a){while(--_0x296c5a){_0x2584d1['push'](_0x2584d1['shift']());}};_0x5db660(++_0x4dbd5e);}(_0x413f,0xeb));var _0xf413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x413f[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var md5=require(_0xf413('0x0'));var util=require(_0xf413('0x1'));var Redis=require(_0xf413('0x2'));var config=require(_0xf413('0x3'));config[_0xf413('0x4')]=_[_0xf413('0x5')](config['redis'],{'host':_0xf413('0x6'),'port':0x18eb});var io=require(_0xf413('0x7'))(new Redis(config[_0xf413('0x4')]));function ChatQueue(_0x44bef7){this['id']=_0x44bef7['id']||0x0;this[_0xf413('0x8')]=_0x44bef7[_0xf413('0x8')]||'';this[_0xf413('0x9')]=_0x44bef7['timeout']||0xa;this[_0xf413('0xa')]=_0x44bef7[_0xf413('0xa')]||'beepall';this['Agents']=_0x44bef7['Agents'];this['mapAgentsId']={};this[_0xf413('0xb')]=0x0;this[_0xf413('0x0')]='';this[_0xf413('0xc')]();this[_0xf413('0xd')]();}ChatQueue[_0xf413('0xe')][_0xf413('0xc')]=function(){var _0x1dc502=this[_0xf413('0xf')][_0xf413('0x10')];this[_0xf413('0xf')]=_[_0xf413('0x11')](this[_0xf413('0x12')],'id');this[_0xf413('0xf')][_0xf413('0x10')]=_0x1dc502;};ChatQueue[_0xf413('0xe')][_0xf413('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x411f84=0x0;_0x411f84=0x0?this['available']:0x0;var _0x30b819={'id':this['id'],'available':this[_0xf413('0x15')],'loggedIn':this[_0xf413('0x16')],'name':this['name'],'paused':this[_0xf413('0x17')],'waiting':this['waiting']};var _0x47e454=md5(JSON[_0xf413('0x18')](_0x30b819));if(this[_0xf413('0x0')]!==_0x47e454){this[_0xf413('0x0')]=_0x47e454;io['to'](util[_0xf413('0x19')](_0xf413('0x1a'),_0x30b819[_0xf413('0x8')]))[_0xf413('0x1b')](_0xf413('0x1c'),_0x30b819);}};module[_0xf413('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 6e1147e..4c00156 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x49c943,_0x1bf2c2){var _0x317b3f=function(_0xcf67eb){while(--_0xcf67eb){_0x49c943['push'](_0x49c943['shift']());}};_0x317b3f(++_0x1bf2c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x219c84,_0x230ae4){var _0x44cf27=function(_0x49c576){while(--_0x49c576){_0x219c84['push'](_0x219c84['shift']());}};_0x44cf27(++_0x230ae4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 5701880..7e1000b 100644 --- a/server/services/routing/model/interval.js +++ b/server/services/routing/model/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18fc=['Intervals','exports','name'];(function(_0x5b0747,_0x4092be){var _0x359eb5=function(_0x24f991){while(--_0x24f991){_0x5b0747['push'](_0x5b0747['shift']());}};_0x359eb5(++_0x4092be);}(_0x18fc,0x1b8));var _0xc18f=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x18fc[_0x396466];return _0x5e9ab4;};'use strict';function Interval(_0x5feea2){this['id']=_0x5feea2['id']||0x0;this[_0xc18f('0x0')]=_0x5feea2[_0xc18f('0x0')]||'';this[_0xc18f('0x1')]=_0x5feea2[_0xc18f('0x1')]||{};}module[_0xc18f('0x2')]=Interval; \ No newline at end of file +var _0x1052=['Intervals','exports','name'];(function(_0x5cf7f9,_0x41177b){var _0x1a2cf1=function(_0x255a71){while(--_0x255a71){_0x5cf7f9['push'](_0x5cf7f9['shift']());}};_0x1a2cf1(++_0x41177b);}(_0x1052,0x77));var _0x2105=function(_0x1fcc7d,_0x4eb620){_0x1fcc7d=_0x1fcc7d-0x0;var _0x3daa39=_0x1052[_0x1fcc7d];return _0x3daa39;};'use strict';function Interval(_0x578685){this['id']=_0x578685['id']||0x0;this[_0x2105('0x0')]=_0x578685[_0x2105('0x0')]||'';this[_0x2105('0x1')]=_0x578685[_0x2105('0x1')]||{};}module[_0x2105('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 63942bf..6b285b2 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x260d=['mailPause','available','stringify','format','mail:queue:%s','emit','exports','ioredis','defaults','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online'];(function(_0x128f01,_0x2a9d35){var _0xd22946=function(_0x3e5a7e){while(--_0x3e5a7e){_0x128f01['push'](_0x128f01['shift']());}};_0xd22946(++_0x2a9d35);}(_0x260d,0xc4));var _0xd260=function(_0x4f858a,_0x6a0bbc){_0x4f858a=_0x4f858a-0x0;var _0x1df4a5=_0x260d[_0x4f858a];return _0x1df4a5;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0xd260('0x0'));var config=require('../../../config/environment');config['redis']=_[_0xd260('0x1')](config[_0xd260('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xd260('0x3'))(new Redis(config[_0xd260('0x2')]));function MailQueue(_0x2d028b){this['id']=_0x2d028b['id']||0x0;this['name']=_0x2d028b[_0xd260('0x4')]||'';this[_0xd260('0x5')]=_0x2d028b[_0xd260('0x5')]||0xa;this[_0xd260('0x6')]=_0x2d028b['strategy']||'beepall';this['Agents']=_0x2d028b[_0xd260('0x7')];this[_0xd260('0x8')]={};this[_0xd260('0x9')]=0x0;this[_0xd260('0xa')]='';this[_0xd260('0xb')]();this[_0xd260('0xc')]();}MailQueue[_0xd260('0xd')][_0xd260('0xb')]=function(){var _0x4fc666=this['mapAgentsId'][_0xd260('0xe')];this[_0xd260('0x8')]=_[_0xd260('0xf')](this[_0xd260('0x7')],'id');this[_0xd260('0x8')][_0xd260('0xe')]=_0x4fc666;};MailQueue[_0xd260('0xd')][_0xd260('0xc')]=function(){this[_0xd260('0x10')]=0x0;this[_0xd260('0x11')]=0x0;for(var _0x2cc44c=0x0;_0x2cc44c=0x0?this['available']:0x0;var _0x40a4bf={'id':this['id'],'available':this[_0xd260('0x15')],'loggedIn':this[_0xd260('0x10')],'name':this[_0xd260('0x4')],'paused':this[_0xd260('0x11')],'waiting':this[_0xd260('0x9')]};var _0x4732ca=md5(JSON[_0xd260('0x16')](_0x40a4bf));if(this['md5']!==_0x4732ca){this[_0xd260('0xa')]=_0x4732ca;io['to'](util[_0xd260('0x17')](_0xd260('0x18'),_0x40a4bf[_0xd260('0x4')]))[_0xd260('0x19')]('mail_queue:save',_0x40a4bf);}};module[_0xd260('0x1a')]=MailQueue; \ No newline at end of file +var _0x96ae=['map','prototype','paused','online','loggedIn','mailPause','available','stringify','emit','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr'];(function(_0x42c00c,_0xdf2664){var _0x50304d=function(_0x3fdc84){while(--_0x3fdc84){_0x42c00c['push'](_0x42c00c['shift']());}};_0x50304d(++_0xdf2664);}(_0x96ae,0xda));var _0xe96a=function(_0x24ae03,_0x334660){_0x24ae03=_0x24ae03-0x0;var _0x38a29e=_0x96ae[_0x24ae03];return _0x38a29e;};'use strict';var _=require(_0xe96a('0x0'));var md5=require(_0xe96a('0x1'));var util=require(_0xe96a('0x2'));var Redis=require(_0xe96a('0x3'));var config=require('../../../config/environment');config[_0xe96a('0x4')]=_[_0xe96a('0x5')](config['redis'],{'host':_0xe96a('0x6'),'port':0x18eb});var io=require(_0xe96a('0x7'))(new Redis(config[_0xe96a('0x4')]));function MailQueue(_0x11511c){this['id']=_0x11511c['id']||0x0;this[_0xe96a('0x8')]=_0x11511c[_0xe96a('0x8')]||'';this['timeout']=_0x11511c['timeout']||0xa;this[_0xe96a('0x9')]=_0x11511c[_0xe96a('0x9')]||_0xe96a('0xa');this[_0xe96a('0xb')]=_0x11511c[_0xe96a('0xb')];this[_0xe96a('0xc')]={};this['waiting']=0x0;this[_0xe96a('0x1')]='';this[_0xe96a('0xd')]();this[_0xe96a('0xe')]();}MailQueue['prototype'][_0xe96a('0xd')]=function(){var _0x5f2c63=this[_0xe96a('0xc')][_0xe96a('0xf')];this[_0xe96a('0xc')]=_[_0xe96a('0x10')](this['Agents'],'id');this[_0xe96a('0xc')][_0xe96a('0xf')]=_0x5f2c63;};MailQueue[_0xe96a('0x11')][_0xe96a('0xe')]=function(){this['loggedIn']=0x0;this[_0xe96a('0x12')]=0x0;for(var _0x355dad=0x0;_0x355dad=0x0?this[_0xe96a('0x16')]:0x0;var _0x5b66c5={'id':this['id'],'available':this[_0xe96a('0x16')],'loggedIn':this[_0xe96a('0x14')],'name':this[_0xe96a('0x8')],'paused':this[_0xe96a('0x12')],'waiting':this['waiting']};var _0x40b1c3=md5(JSON[_0xe96a('0x17')](_0x5b66c5));if(this[_0xe96a('0x1')]!==_0x40b1c3){this[_0xe96a('0x1')]=_0x40b1c3;io['to'](util['format']('mail:queue:%s',_0x5b66c5[_0xe96a('0x8')]))[_0xe96a('0x18')]('mail_queue:save',_0x5b66c5);}};module[_0xe96a('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index ce2929e..df95755 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4de=['openchannel_queue:save','exports','lodash','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','prototype','loggedIn','paused','length','online','available','stringify','format','openchannel:queue:%s'];(function(_0x27f0bb,_0x1f200d){var _0x37601c=function(_0x3dae8c){while(--_0x3dae8c){_0x27f0bb['push'](_0x27f0bb['shift']());}};_0x37601c(++_0x1f200d);}(_0xa4de,0x1e8));var _0xea4d=function(_0x59ee50,_0x2f47f2){_0x59ee50=_0x59ee50-0x0;var _0x1aa0bc=_0xa4de[_0x59ee50];return _0x1aa0bc;};'use strict';var _=require(_0xea4d('0x0'));var md5=require(_0xea4d('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xea4d('0x2'));config[_0xea4d('0x3')]=_['defaults'](config[_0xea4d('0x3')],{'host':_0xea4d('0x4'),'port':0x18eb});var io=require(_0xea4d('0x5'))(new Redis(config[_0xea4d('0x3')]));function OpenchannelQueue(_0x1367e9){this['id']=_0x1367e9['id']||0x0;this['name']=_0x1367e9[_0xea4d('0x6')]||'';this[_0xea4d('0x7')]=_0x1367e9[_0xea4d('0x7')]||0xa;this[_0xea4d('0x8')]=_0x1367e9[_0xea4d('0x8')]||_0xea4d('0x9');this[_0xea4d('0xa')]=_0x1367e9['Agents'];this[_0xea4d('0xb')]={};this[_0xea4d('0xc')]=0x0;this[_0xea4d('0x1')]='';this[_0xea4d('0xd')]();this[_0xea4d('0xe')]();}OpenchannelQueue['prototype'][_0xea4d('0xd')]=function(){var _0x1fb083=this[_0xea4d('0xb')]['_rr'];this['mapAgentsId']=_[_0xea4d('0xf')](this[_0xea4d('0xa')],'id');this[_0xea4d('0xb')]['_rr']=_0x1fb083;};OpenchannelQueue[_0xea4d('0x10')]['updateRealtime']=function(){this[_0xea4d('0x11')]=0x0;this[_0xea4d('0x12')]=0x0;for(var _0x535808=0x0;_0x535808=0x0?this[_0xea4d('0x15')]:0x0;var _0x3a8b68={'id':this['id'],'available':this[_0xea4d('0x15')],'loggedIn':this[_0xea4d('0x11')],'name':this[_0xea4d('0x6')],'paused':this[_0xea4d('0x12')],'waiting':this[_0xea4d('0xc')]};var _0x4162d8=md5(JSON[_0xea4d('0x16')](_0x3a8b68));if(this[_0xea4d('0x1')]!==_0x4162d8){this['md5']=_0x4162d8;io['to'](util[_0xea4d('0x17')](_0xea4d('0x18'),_0x3a8b68['name']))['emit'](_0xea4d('0x19'),_0x3a8b68);}};module[_0xea4d('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x7e17=['util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','waiting','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','paused','length','online','openchannelPause','available','stringify','format','emit','openchannel_queue:save','lodash','md5'];(function(_0xa53884,_0x1a8648){var _0x355b2d=function(_0x2e9610){while(--_0x2e9610){_0xa53884['push'](_0xa53884['shift']());}};_0x355b2d(++_0x1a8648);}(_0x7e17,0x1eb));var _0x77e1=function(_0x3979d4,_0x2f816f){_0x3979d4=_0x3979d4-0x0;var _0x381f3c=_0x7e17[_0x3979d4];return _0x381f3c;};'use strict';var _=require(_0x77e1('0x0'));var md5=require(_0x77e1('0x1'));var util=require(_0x77e1('0x2'));var Redis=require(_0x77e1('0x3'));var config=require(_0x77e1('0x4'));config[_0x77e1('0x5')]=_[_0x77e1('0x6')](config['redis'],{'host':_0x77e1('0x7'),'port':0x18eb});var io=require(_0x77e1('0x8'))(new Redis(config[_0x77e1('0x5')]));function OpenchannelQueue(_0x5ea4f9){this['id']=_0x5ea4f9['id']||0x0;this['name']=_0x5ea4f9[_0x77e1('0x9')]||'';this[_0x77e1('0xa')]=_0x5ea4f9[_0x77e1('0xa')]||0xa;this['strategy']=_0x5ea4f9['strategy']||_0x77e1('0xb');this[_0x77e1('0xc')]=_0x5ea4f9['Agents'];this['mapAgentsId']={};this[_0x77e1('0xd')]=0x0;this[_0x77e1('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x77e1('0xe')]=function(){var _0x1ffde8=this[_0x77e1('0xf')][_0x77e1('0x10')];this[_0x77e1('0xf')]=_[_0x77e1('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x77e1('0x10')]=_0x1ffde8;};OpenchannelQueue[_0x77e1('0x12')][_0x77e1('0x13')]=function(){this['loggedIn']=0x0;this[_0x77e1('0x14')]=0x0;for(var _0x10a865=0x0;_0x10a865=0x0?this[_0x77e1('0x18')]:0x0;var _0x121d9e={'id':this['id'],'available':this[_0x77e1('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x77e1('0x9')],'paused':this[_0x77e1('0x14')],'waiting':this[_0x77e1('0xd')]};var _0x1395d2=md5(JSON[_0x77e1('0x19')](_0x121d9e));if(this[_0x77e1('0x1')]!==_0x1395d2){this[_0x77e1('0x1')]=_0x1395d2;io['to'](util[_0x77e1('0x1a')]('openchannel:queue:%s',_0x121d9e[_0x77e1('0x9')]))[_0x77e1('0x1b')](_0x77e1('0x1c'),_0x121d9e);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index fba3768..acd6487 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['online','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var md5=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var Redis=require(_0x0baf('0x2'));var config=require(_0x0baf('0x3'));config[_0x0baf('0x4')]=_[_0x0baf('0x5')](config['redis'],{'host':_0x0baf('0x6'),'port':0x18eb});var io=require(_0x0baf('0x7'))(new Redis(config[_0x0baf('0x4')]));function SmsQueue(_0x39b8f3){this['id']=_0x39b8f3['id']||0x0;this[_0x0baf('0x8')]=_0x39b8f3[_0x0baf('0x8')]||'';this[_0x0baf('0x9')]=_0x39b8f3[_0x0baf('0x9')]||0xa;this[_0x0baf('0xa')]=_0x39b8f3['strategy']||_0x0baf('0xb');this['Agents']=_0x39b8f3[_0x0baf('0xc')];this[_0x0baf('0xd')]={};this[_0x0baf('0xe')]=0x0;this[_0x0baf('0x0')]='';this[_0x0baf('0xf')]();this[_0x0baf('0x10')]();}SmsQueue[_0x0baf('0x11')][_0x0baf('0xf')]=function(){var _0x1fc6b2=this[_0x0baf('0xd')][_0x0baf('0x12')];this['mapAgentsId']=_['map'](this[_0x0baf('0xc')],'id');this[_0x0baf('0xd')][_0x0baf('0x12')]=_0x1fc6b2;};SmsQueue[_0x0baf('0x11')]['updateRealtime']=function(){this[_0x0baf('0x13')]=0x0;this['paused']=0x0;for(var _0x1c76a8=0x0;_0x1c76a8=0x0?this['available']:0x0;var _0x63c820={'id':this['id'],'available':this[_0x0baf('0x17')],'loggedIn':this[_0x0baf('0x13')],'name':this[_0x0baf('0x8')],'paused':this[_0x0baf('0x16')],'waiting':this[_0x0baf('0xe')]};var _0x4ff793=md5(JSON['stringify'](_0x63c820));if(this[_0x0baf('0x0')]!==_0x4ff793){this[_0x0baf('0x0')]=_0x4ff793;io['to'](util[_0x0baf('0x18')](_0x0baf('0x19'),_0x63c820[_0x0baf('0x8')]))[_0x0baf('0x1a')](_0x0baf('0x1b'),_0x63c820);}};module[_0x0baf('0x1c')]=SmsQueue; \ No newline at end of file +var _0xd8b0=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x529236,_0x1a397b){var _0x557ffe=function(_0x403c89){while(--_0x403c89){_0x529236['push'](_0x529236['shift']());}};_0x557ffe(++_0x1a397b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var md5=require(_0x0d8b('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0d8b('0x2')]=_[_0x0d8b('0x3')](config[_0x0d8b('0x2')],{'host':_0x0d8b('0x4'),'port':0x18eb});var io=require(_0x0d8b('0x5'))(new Redis(config['redis']));function SmsQueue(_0x5e15e6){this['id']=_0x5e15e6['id']||0x0;this[_0x0d8b('0x6')]=_0x5e15e6[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5e15e6['timeout']||0xa;this[_0x0d8b('0x8')]=_0x5e15e6[_0x0d8b('0x8')]||'beepall';this[_0x0d8b('0x9')]=_0x5e15e6[_0x0d8b('0x9')];this[_0x0d8b('0xa')]={};this[_0x0d8b('0xb')]=0x0;this[_0x0d8b('0x1')]='';this[_0x0d8b('0xc')]();this[_0x0d8b('0xd')]();}SmsQueue[_0x0d8b('0xe')]['updateRouting']=function(){var _0x3c4bfa=this['mapAgentsId'][_0x0d8b('0xf')];this[_0x0d8b('0xa')]=_[_0x0d8b('0x10')](this[_0x0d8b('0x9')],'id');this[_0x0d8b('0xa')][_0x0d8b('0xf')]=_0x3c4bfa;};SmsQueue[_0x0d8b('0xe')][_0x0d8b('0xd')]=function(){this[_0x0d8b('0x11')]=0x0;this[_0x0d8b('0x12')]=0x0;for(var _0x5ad086=0x0;_0x5ad086=0x0?this[_0x0d8b('0x15')]:0x0;var _0x333674={'id':this['id'],'available':this[_0x0d8b('0x15')],'loggedIn':this[_0x0d8b('0x11')],'name':this[_0x0d8b('0x6')],'paused':this['paused'],'waiting':this[_0x0d8b('0xb')]};var _0x23d58f=md5(JSON[_0x0d8b('0x16')](_0x333674));if(this[_0x0d8b('0x1')]!==_0x23d58f){this[_0x0d8b('0x1')]=_0x23d58f;io['to'](util[_0x0d8b('0x17')](_0x0d8b('0x18'),_0x333674[_0x0d8b('0x6')]))['emit']('sms_queue:save',_0x333674);}};module[_0x0d8b('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 8a07eba..9e9adc9 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfee8=['mergeFromDatabase','initIntervals','isUndefined','initOpenchannelQueues','updateRealtime','initChatQueues','initSmsQueues','updateRouting','initMailQueues','mailQueues','exports','bluebird','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length'];(function(_0x13b55e,_0x30ed26){var _0x3ff5c8=function(_0x4e0a10){while(--_0x4e0a10){_0x13b55e['push'](_0x13b55e['shift']());}};_0x3ff5c8(++_0x30ed26);}(_0xfee8,0xb0));var _0x8fee=function(_0x3c4087,_0x5c764b){_0x3c4087=_0x3c4087-0x0;var _0x23ad1f=_0xfee8[_0x3c4087];return _0x23ad1f;};'use strict';var BPromise=require(_0x8fee('0x0'));var util=require('util');var _=require('lodash');var moment=require(_0x8fee('0x1'));var Agent=require(_0x8fee('0x2'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0x8fee('0x3'));var ChatQueue=require(_0x8fee('0x4'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0x8fee('0x5'));var FaxQueue=require(_0x8fee('0x6'));var Realtime=function(){this[_0x8fee('0x7')]={};this[_0x8fee('0x8')]={};this[_0x8fee('0x9')]={};this[_0x8fee('0xa')]={};this[_0x8fee('0xb')]={};this['mailQueues']={};this[_0x8fee('0xc')]={};this[_0x8fee('0xd')]={};this[_0x8fee('0xe')]={};this[_0x8fee('0xf')]={};this[_0x8fee('0x10')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x74727,_0x51010b,_0x51bea3){var _0x4033bd=_[_0x8fee('0x11')](_0x74727,function(_0x43bf95,_0x1af67c){return _0x43bf95[_0x51bea3];});for(var _0x118655 in _0x51010b){if(_0x51010b[_0x8fee('0x12')](_0x118655)){if(!_0x4033bd[_0x118655]){delete _0x51010b[_0x118655];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x1f8588,_0x27b474){for(var _0x1d9345 in _0x27b474){if(_0x1f8588[_0x8fee('0x12')](_0x1d9345)){_0x1f8588[_0x1d9345]=_0x27b474[_0x1d9345];}}};Realtime[_0x8fee('0x13')][_0x8fee('0x14')]=function(){var _0x512017=this;return function(_0x1ebe27){if(_0x1ebe27){freeIsNotKey(_0x1ebe27,_0x512017['agents'],'id');for(var _0x5efac3=0x0,_0x194b0c={},_0x5453b4={};_0x5efac3<_0x1ebe27[_0x8fee('0x15')];_0x5efac3+=0x1){_0x194b0c=_0x1ebe27[_0x5efac3];if(_['isUndefined'](_0x512017[_0x8fee('0x7')][_0x194b0c['id']])){_0x512017[_0x8fee('0x7')][_0x194b0c['id']]=new Agent(_0x194b0c);}else{_0x512017[_0x8fee('0x16')](_0x512017[_0x8fee('0x7')][_0x194b0c['id']],_0x194b0c);}}}return _0x512017[_0x8fee('0x7')];};};Realtime['prototype'][_0x8fee('0x17')]=function(){var _0x46625a=this;return function(_0x33bacf){if(_0x33bacf){freeIsNotKey(_0x33bacf,_0x46625a['intervals'],'id');for(var _0x3d0b58=0x0,_0x13d968={},_0x25021c={};_0x3d0b58<_0x33bacf['length'];_0x3d0b58+=0x1){_0x13d968=_0x33bacf[_0x3d0b58];if(_[_0x8fee('0x18')](_0x46625a[_0x8fee('0x8')][_0x13d968['id']])){_0x46625a[_0x8fee('0x8')][_0x13d968['id']]=new Interval(_0x13d968);}else{_0x46625a[_0x8fee('0x16')](_0x46625a[_0x8fee('0x8')][_0x13d968['id']],_0x13d968);}}}return _0x46625a['intervals'];};};Realtime['prototype'][_0x8fee('0x19')]=function(){var _0x33b434=this;return function(_0x2729a1){if(_0x2729a1){freeIsNotKey(_0x2729a1,_0x33b434[_0x8fee('0x9')],'id');for(var _0x232250=0x0,_0x3fa2cc={},_0x5bfa59={};_0x232250<_0x2729a1['length'];_0x232250+=0x1){_0x3fa2cc=_0x2729a1[_0x232250];if(_[_0x8fee('0x18')](_0x33b434[_0x8fee('0x9')][_0x3fa2cc['id']])){_0x33b434[_0x8fee('0x9')][_0x3fa2cc['id']]=new OpenchannelQueue(_0x3fa2cc);}else{_0x33b434[_0x8fee('0x16')](_0x33b434[_0x8fee('0x9')][_0x3fa2cc['id']],_0x3fa2cc);}_0x33b434[_0x8fee('0x9')][_0x3fa2cc['id']]['updateRouting']();_0x33b434[_0x8fee('0x9')][_0x3fa2cc['id']][_0x8fee('0x1a')]();}}return _0x33b434[_0x8fee('0x9')];};};Realtime[_0x8fee('0x13')][_0x8fee('0x1b')]=function(){var _0xca2f18=this;return function(_0x2c39b1){if(_0x2c39b1){freeIsNotKey(_0x2c39b1,_0xca2f18[_0x8fee('0xa')],'id');for(var _0x2191b5=0x0,_0x3aa41c={},_0x1158ae={};_0x2191b5<_0x2c39b1[_0x8fee('0x15')];_0x2191b5+=0x1){_0x3aa41c=_0x2c39b1[_0x2191b5];if(_['isUndefined'](_0xca2f18[_0x8fee('0xa')][_0x3aa41c['id']])){_0xca2f18[_0x8fee('0xa')][_0x3aa41c['id']]=new ChatQueue(_0x3aa41c);}else{_0xca2f18[_0x8fee('0x16')](_0xca2f18['chatQueues'][_0x3aa41c['id']],_0x3aa41c);}_0xca2f18[_0x8fee('0xa')][_0x3aa41c['id']]['updateRouting']();_0xca2f18[_0x8fee('0xa')][_0x3aa41c['id']]['updateRealtime']();}}return _0xca2f18['chatQueues'];};};Realtime['prototype'][_0x8fee('0x1c')]=function(){var _0x3c4244=this;return function(_0x4355e7){if(_0x4355e7){freeIsNotKey(_0x4355e7,_0x3c4244[_0x8fee('0xb')],'id');for(var _0x538c63=0x0,_0x3eedd9={},_0x13f05a={};_0x538c63<_0x4355e7[_0x8fee('0x15')];_0x538c63+=0x1){_0x3eedd9=_0x4355e7[_0x538c63];if(_[_0x8fee('0x18')](_0x3c4244[_0x8fee('0xb')][_0x3eedd9['id']])){_0x3c4244[_0x8fee('0xb')][_0x3eedd9['id']]=new SmsQueue(_0x3eedd9);}else{_0x3c4244['mergeFromDatabase'](_0x3c4244[_0x8fee('0xb')][_0x3eedd9['id']],_0x3eedd9);}_0x3c4244[_0x8fee('0xb')][_0x3eedd9['id']][_0x8fee('0x1d')]();_0x3c4244[_0x8fee('0xb')][_0x3eedd9['id']]['updateRealtime']();}}return _0x3c4244[_0x8fee('0xb')];};};Realtime[_0x8fee('0x13')][_0x8fee('0x1e')]=function(){var _0x45e16d=this;return function(_0x277705){if(_0x277705){freeIsNotKey(_0x277705,_0x45e16d[_0x8fee('0x1f')],'id');for(var _0x2d9100=0x0,_0x3fb7b1={},_0x20e2b1={};_0x2d9100<_0x277705[_0x8fee('0x15')];_0x2d9100+=0x1){_0x3fb7b1=_0x277705[_0x2d9100];if(_[_0x8fee('0x18')](_0x45e16d[_0x8fee('0x1f')][_0x3fb7b1['id']])){_0x45e16d[_0x8fee('0x1f')][_0x3fb7b1['id']]=new MailQueue(_0x3fb7b1);}else{_0x45e16d[_0x8fee('0x16')](_0x45e16d[_0x8fee('0x1f')][_0x3fb7b1['id']],_0x3fb7b1);}_0x45e16d['mailQueues'][_0x3fb7b1['id']][_0x8fee('0x1d')]();_0x45e16d[_0x8fee('0x1f')][_0x3fb7b1['id']][_0x8fee('0x1a')]();}}return _0x45e16d[_0x8fee('0x1f')];};};Realtime[_0x8fee('0x13')]['initFaxQueues']=function(){var _0x3aed1a=this;return function(_0x464598){if(_0x464598){freeIsNotKey(_0x464598,_0x3aed1a[_0x8fee('0xc')],'id');for(var _0x30e091=0x0,_0xf65926={},_0x505156={};_0x30e091<_0x464598['length'];_0x30e091+=0x1){_0xf65926=_0x464598[_0x30e091];if(_[_0x8fee('0x18')](_0x3aed1a[_0x8fee('0xc')][_0xf65926['id']])){_0x3aed1a[_0x8fee('0xc')][_0xf65926['id']]=new FaxQueue(_0xf65926);}else{_0x3aed1a['mergeFromDatabase'](_0x3aed1a[_0x8fee('0xc')][_0xf65926['id']],_0xf65926);}_0x3aed1a[_0x8fee('0xc')][_0xf65926['id']][_0x8fee('0x1d')]();_0x3aed1a[_0x8fee('0xc')][_0xf65926['id']][_0x8fee('0x1a')]();}}return _0x3aed1a[_0x8fee('0xc')];};};module[_0x8fee('0x20')]=Realtime; \ No newline at end of file +var _0x85b3=['../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','faxQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length','mergeFromDatabase','initIntervals','isUndefined','initOpenchannelQueues','updateRouting','updateRealtime','mailQueues','exports','util','moment'];(function(_0x26ac98,_0x124a91){var _0x852d89=function(_0x4d55b1){while(--_0x4d55b1){_0x26ac98['push'](_0x26ac98['shift']());}};_0x852d89(++_0x124a91);}(_0x85b3,0xd0));var _0x385b=function(_0x29cf0f,_0x432bfd){_0x29cf0f=_0x29cf0f-0x0;var _0xe43d52=_0x85b3[_0x29cf0f];return _0xe43d52;};'use strict';var BPromise=require('bluebird');var util=require(_0x385b('0x0'));var _=require('lodash');var moment=require(_0x385b('0x1'));var Agent=require(_0x385b('0x2'));var Interval=require(_0x385b('0x3'));var OpenchannelQueue=require(_0x385b('0x4'));var ChatQueue=require(_0x385b('0x5'));var SmsQueue=require(_0x385b('0x6'));var MailQueue=require(_0x385b('0x7'));var FaxQueue=require(_0x385b('0x8'));var Realtime=function(){this[_0x385b('0x9')]={};this[_0x385b('0xa')]={};this[_0x385b('0xb')]={};this[_0x385b('0xc')]={};this[_0x385b('0xd')]={};this['mailQueues']={};this[_0x385b('0xe')]={};this['chatQueuesWaitingInteractions']={};this['mailQueuesWaitingInteractions']={};this[_0x385b('0xf')]={};this[_0x385b('0x10')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x18fef9,_0x2f72d3,_0x167135){var _0x2a0d39=_[_0x385b('0x11')](_0x18fef9,function(_0x245a7d,_0x31858e){return _0x245a7d[_0x167135];});for(var _0x344249 in _0x2f72d3){if(_0x2f72d3[_0x385b('0x12')](_0x344249)){if(!_0x2a0d39[_0x344249]){delete _0x2f72d3[_0x344249];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x1f0bea,_0x1a7b06){for(var _0x4e3e56 in _0x1a7b06){if(_0x1f0bea[_0x385b('0x12')](_0x4e3e56)){_0x1f0bea[_0x4e3e56]=_0x1a7b06[_0x4e3e56];}}};Realtime[_0x385b('0x13')][_0x385b('0x14')]=function(){var _0x499204=this;return function(_0x3a9ee5){if(_0x3a9ee5){freeIsNotKey(_0x3a9ee5,_0x499204['agents'],'id');for(var _0x50562a=0x0,_0x5e6678={},_0x4dedb4={};_0x50562a<_0x3a9ee5[_0x385b('0x15')];_0x50562a+=0x1){_0x5e6678=_0x3a9ee5[_0x50562a];if(_['isUndefined'](_0x499204[_0x385b('0x9')][_0x5e6678['id']])){_0x499204[_0x385b('0x9')][_0x5e6678['id']]=new Agent(_0x5e6678);}else{_0x499204[_0x385b('0x16')](_0x499204['agents'][_0x5e6678['id']],_0x5e6678);}}}return _0x499204[_0x385b('0x9')];};};Realtime['prototype'][_0x385b('0x17')]=function(){var _0x2a766e=this;return function(_0x51fabe){if(_0x51fabe){freeIsNotKey(_0x51fabe,_0x2a766e[_0x385b('0xa')],'id');for(var _0x46eba5=0x0,_0x552b3d={},_0xb76171={};_0x46eba5<_0x51fabe['length'];_0x46eba5+=0x1){_0x552b3d=_0x51fabe[_0x46eba5];if(_[_0x385b('0x18')](_0x2a766e['intervals'][_0x552b3d['id']])){_0x2a766e['intervals'][_0x552b3d['id']]=new Interval(_0x552b3d);}else{_0x2a766e[_0x385b('0x16')](_0x2a766e[_0x385b('0xa')][_0x552b3d['id']],_0x552b3d);}}}return _0x2a766e['intervals'];};};Realtime['prototype'][_0x385b('0x19')]=function(){var _0x1b9e91=this;return function(_0x38437e){if(_0x38437e){freeIsNotKey(_0x38437e,_0x1b9e91[_0x385b('0xb')],'id');for(var _0x51c438=0x0,_0x133cbb={},_0x161ec3={};_0x51c438<_0x38437e[_0x385b('0x15')];_0x51c438+=0x1){_0x133cbb=_0x38437e[_0x51c438];if(_['isUndefined'](_0x1b9e91[_0x385b('0xb')][_0x133cbb['id']])){_0x1b9e91[_0x385b('0xb')][_0x133cbb['id']]=new OpenchannelQueue(_0x133cbb);}else{_0x1b9e91[_0x385b('0x16')](_0x1b9e91[_0x385b('0xb')][_0x133cbb['id']],_0x133cbb);}_0x1b9e91[_0x385b('0xb')][_0x133cbb['id']][_0x385b('0x1a')]();_0x1b9e91[_0x385b('0xb')][_0x133cbb['id']][_0x385b('0x1b')]();}}return _0x1b9e91[_0x385b('0xb')];};};Realtime['prototype']['initChatQueues']=function(){var _0x2ae110=this;return function(_0x23c9d9){if(_0x23c9d9){freeIsNotKey(_0x23c9d9,_0x2ae110['chatQueues'],'id');for(var _0x1985bc=0x0,_0xd851f2={},_0x1c59b6={};_0x1985bc<_0x23c9d9[_0x385b('0x15')];_0x1985bc+=0x1){_0xd851f2=_0x23c9d9[_0x1985bc];if(_['isUndefined'](_0x2ae110[_0x385b('0xc')][_0xd851f2['id']])){_0x2ae110['chatQueues'][_0xd851f2['id']]=new ChatQueue(_0xd851f2);}else{_0x2ae110['mergeFromDatabase'](_0x2ae110[_0x385b('0xc')][_0xd851f2['id']],_0xd851f2);}_0x2ae110[_0x385b('0xc')][_0xd851f2['id']][_0x385b('0x1a')]();_0x2ae110[_0x385b('0xc')][_0xd851f2['id']][_0x385b('0x1b')]();}}return _0x2ae110[_0x385b('0xc')];};};Realtime[_0x385b('0x13')]['initSmsQueues']=function(){var _0x220703=this;return function(_0x78fad1){if(_0x78fad1){freeIsNotKey(_0x78fad1,_0x220703['smsQueues'],'id');for(var _0x21ef14=0x0,_0x8c2bc9={},_0x17310={};_0x21ef14<_0x78fad1[_0x385b('0x15')];_0x21ef14+=0x1){_0x8c2bc9=_0x78fad1[_0x21ef14];if(_['isUndefined'](_0x220703[_0x385b('0xd')][_0x8c2bc9['id']])){_0x220703[_0x385b('0xd')][_0x8c2bc9['id']]=new SmsQueue(_0x8c2bc9);}else{_0x220703[_0x385b('0x16')](_0x220703[_0x385b('0xd')][_0x8c2bc9['id']],_0x8c2bc9);}_0x220703['smsQueues'][_0x8c2bc9['id']][_0x385b('0x1a')]();_0x220703['smsQueues'][_0x8c2bc9['id']]['updateRealtime']();}}return _0x220703[_0x385b('0xd')];};};Realtime[_0x385b('0x13')]['initMailQueues']=function(){var _0x5934fe=this;return function(_0x4cc32d){if(_0x4cc32d){freeIsNotKey(_0x4cc32d,_0x5934fe['mailQueues'],'id');for(var _0x4a23cf=0x0,_0x1d64b3={},_0x50610d={};_0x4a23cf<_0x4cc32d[_0x385b('0x15')];_0x4a23cf+=0x1){_0x1d64b3=_0x4cc32d[_0x4a23cf];if(_[_0x385b('0x18')](_0x5934fe[_0x385b('0x1c')][_0x1d64b3['id']])){_0x5934fe[_0x385b('0x1c')][_0x1d64b3['id']]=new MailQueue(_0x1d64b3);}else{_0x5934fe[_0x385b('0x16')](_0x5934fe[_0x385b('0x1c')][_0x1d64b3['id']],_0x1d64b3);}_0x5934fe[_0x385b('0x1c')][_0x1d64b3['id']]['updateRouting']();_0x5934fe[_0x385b('0x1c')][_0x1d64b3['id']][_0x385b('0x1b')]();}}return _0x5934fe[_0x385b('0x1c')];};};Realtime[_0x385b('0x13')]['initFaxQueues']=function(){var _0x507a9a=this;return function(_0x2735c8){if(_0x2735c8){freeIsNotKey(_0x2735c8,_0x507a9a[_0x385b('0xe')],'id');for(var _0x30c4f8=0x0,_0x5268f2={},_0x4f5c1b={};_0x30c4f8<_0x2735c8['length'];_0x30c4f8+=0x1){_0x5268f2=_0x2735c8[_0x30c4f8];if(_[_0x385b('0x18')](_0x507a9a[_0x385b('0xe')][_0x5268f2['id']])){_0x507a9a[_0x385b('0xe')][_0x5268f2['id']]=new FaxQueue(_0x5268f2);}else{_0x507a9a['mergeFromDatabase'](_0x507a9a['faxQueues'][_0x5268f2['id']],_0x5268f2);}_0x507a9a['faxQueues'][_0x5268f2['id']][_0x385b('0x1a')]();_0x507a9a['faxQueues'][_0x5268f2['id']][_0x385b('0x1b')]();}}return _0x507a9a[_0x385b('0xe')];};};module[_0x385b('0x1d')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 278d21a..d90ea4d 100644 --- a/server/services/routing/rpc/chatInteraction.js +++ b/server/services/routing/rpc/chatInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3019=['addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction'];(function(_0x1d7966,_0x359208){var _0x27bbf7=function(_0x4ea9dc){while(--_0x4ea9dc){_0x1d7966['push'](_0x1d7966['shift']());}};_0x27bbf7(++_0x359208);}(_0x3019,0x12d));var _0x9301=function(_0x56bfcd,_0x1bb62d){_0x56bfcd=_0x56bfcd-0x0;var _0x44f712=_0x3019[_0x56bfcd];return _0x44f712;};'use strict';var client=require('../client');exports[_0x9301('0x0')]=function(_0x2b9a49,_0x5196e1){return client[_0x9301('0x1')](_0x9301('0x2'),{'body':_0x5196e1,'options':{'where':{'id':_0x2b9a49}},'log':_0x9301('0x3')});};exports['addTags']=function(_0x5c1d96,_0x5503a0){return client[_0x9301('0x1')](_0x9301('0x4'),{'body':_0x5503a0,'options':{'where':{'id':_0x5c1d96}},'log':_0x9301('0x5')});}; \ No newline at end of file +var _0xbe88=['AddTagsToChatInteraction','addTagsToChatInteraction','update','UpdateChatInteraction','updateChatInteraction','addTags','Request'];(function(_0x27398c,_0x4ea33f){var _0x155fc5=function(_0x1e1c53){while(--_0x1e1c53){_0x27398c['push'](_0x27398c['shift']());}};_0x155fc5(++_0x4ea33f);}(_0xbe88,0x1ad));var _0x8be8=function(_0x4254e7,_0x4fc342){_0x4254e7=_0x4254e7-0x0;var _0x5e0844=_0xbe88[_0x4254e7];return _0x5e0844;};'use strict';var client=require('../client');exports[_0x8be8('0x0')]=function(_0x32327d,_0x52088b){return client['Request'](_0x8be8('0x1'),{'body':_0x52088b,'options':{'where':{'id':_0x32327d}},'log':_0x8be8('0x2')});};exports[_0x8be8('0x3')]=function(_0x4070a7,_0x25bf21){return client[_0x8be8('0x4')](_0x8be8('0x5'),{'body':_0x25bf21,'options':{'where':{'id':_0x4070a7}},'log':_0x8be8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 12b73c4..142e874 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd69c=['Request','createChatMessage','../client','create'];(function(_0x4704a3,_0x3ffae7){var _0x43c7ef=function(_0x1cffaf){while(--_0x1cffaf){_0x4704a3['push'](_0x4704a3['shift']());}};_0x43c7ef(++_0x3ffae7);}(_0xd69c,0x6e));var _0xcd69=function(_0xb76fea,_0x275d34){_0xb76fea=_0xb76fea-0x0;var _0x3bff5d=_0xd69c[_0xb76fea];return _0x3bff5d;};'use strict';var client=require(_0xcd69('0x0'));exports[_0xcd69('0x1')]=function(_0x5deecb){return client[_0xcd69('0x2')]('CreateChatMessage',{'body':_0x5deecb,'log':_0xcd69('0x3')});}; \ No newline at end of file +var _0xca57=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x41c66d,_0x512755){var _0x4b3302=function(_0x5e6307){while(--_0x5e6307){_0x41c66d['push'](_0x41c66d['shift']());}};_0x4b3302(++_0x512755);}(_0xca57,0x157));var _0x7ca5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xca57[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7ca5('0x0'));exports[_0x7ca5('0x1')]=function(_0x29b7ad){return client['Request'](_0x7ca5('0x2'),{'body':_0x29b7ad,'log':_0x7ca5('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 87d9c98..1102ebd 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70cd=['name','timeout','strategy','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x120b6b,_0xe249bd){var _0x3d08be=function(_0x1312fe){while(--_0x1312fe){_0x120b6b['push'](_0x120b6b['shift']());}};_0x3d08be(++_0xe249bd);}(_0x70cd,0x1c4));var _0xd70c=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x70cd[_0x77773a];return _0x1091a2;};'use strict';var client=require(_0xd70c('0x0'));exports[_0xd70c('0x1')]=function(){return function(){return client[_0xd70c('0x2')](_0xd70c('0x3'),{'options':{'raw':![],'attributes':['id',_0xd70c('0x4'),_0xd70c('0x5'),_0xd70c('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id','name','online',_0xd70c('0x7')]}]},'log':_0xd70c('0x1')});};}; \ No newline at end of file +var _0x0426=['Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User'];(function(_0x31550c,_0x2ae0be){var _0x468f55=function(_0x4b49dc){while(--_0x4b49dc){_0x31550c['push'](_0x31550c['shift']());}};_0x468f55(++_0x2ae0be);}(_0x0426,0x1c6));var _0x6042=function(_0x2c19a1,_0x4d7941){_0x2c19a1=_0x2c19a1-0x0;var _0x5882c9=_0x0426[_0x2c19a1];return _0x5882c9;};'use strict';var client=require(_0x6042('0x0'));exports[_0x6042('0x1')]=function(){return function(){return client[_0x6042('0x2')](_0x6042('0x3'),{'options':{'raw':![],'attributes':['id',_0x6042('0x4'),_0x6042('0x5'),_0x6042('0x6')],'include':[{'model':_0x6042('0x7'),'as':_0x6042('0x8'),'attributes':['id',_0x6042('0x4'),_0x6042('0x9'),_0x6042('0xa')]}]},'log':_0x6042('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index b2c3e81..0cd67cc 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17ba=['update','UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x41148f,_0x1efa7d){var _0xf61e8=function(_0x37ea73){while(--_0x37ea73){_0x41148f['push'](_0x41148f['shift']());}};_0xf61e8(++_0x1efa7d);}(_0x17ba,0xab));var _0xa17b=function(_0x30be02,_0x675334){_0x30be02=_0x30be02-0x0;var _0x3dbf06=_0x17ba[_0x30be02];return _0x3dbf06;};'use strict';var client=require(_0xa17b('0x0'));exports[_0xa17b('0x1')]=function(_0x4a2032){return client[_0xa17b('0x2')](_0xa17b('0x3'),{'body':_0x4a2032,'log':_0xa17b('0x3')});};exports[_0xa17b('0x4')]=function(_0x106b5b,_0x38c13c){return client[_0xa17b('0x2')](_0xa17b('0x5'),{'body':_0x38c13c,'options':{'where':{'uniqueid':_0x106b5b},'order':[['id',_0xa17b('0x6')]],'limit':0x1},'log':_0xa17b('0x5')});}; \ No newline at end of file +var _0x0c6d=['update','UpdateChatQueueReport','create','Request','CreateChatQueueReport'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x3d7f50,_0xb9cb3c){_0x3d7f50=_0x3d7f50-0x0;var _0x446d21=_0x0c6d[_0x3d7f50];return _0x446d21;};'use strict';var client=require('../client');exports[_0xd0c6('0x0')]=function(_0x92af03){return client[_0xd0c6('0x1')](_0xd0c6('0x2'),{'body':_0x92af03,'log':_0xd0c6('0x2')});};exports[_0xd0c6('0x3')]=function(_0x5790fc,_0x434cdd){return client['Request']('UpdateChatQueueReport',{'body':_0x434cdd,'options':{'where':{'uniqueid':_0x5790fc},'order':[['id','DESC']],'limit':0x1},'log':_0xd0c6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e467009..e33450b 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c67=['updateFaxInteraction','addTags','Request','UpdateFaxInteraction'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x6c67,0xba));var _0x76c6=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x6c67[_0x411017];return _0x2adeea;};'use strict';var client=require('../client');exports['update']=function(_0x1644b7,_0x50d123){return client[_0x76c6('0x0')](_0x76c6('0x1'),{'body':_0x50d123,'options':{'where':{'id':_0x1644b7}},'log':_0x76c6('0x2')});};exports[_0x76c6('0x3')]=function(_0x4f285e,_0x416a83){return client[_0x76c6('0x0')]('AddTagsToFaxInteraction',{'body':_0x416a83,'options':{'where':{'id':_0x4f285e}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x5578=['addTagsToFaxInteraction','Request','UpdateFaxInteraction','updateFaxInteraction'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0x5578,0x10d));var _0x8557=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x5578[_0x44b3bd];return _0x1efc4a;};'use strict';var client=require('../client');exports['update']=function(_0x58fa55,_0x8a0575){return client[_0x8557('0x0')](_0x8557('0x1'),{'body':_0x8a0575,'options':{'where':{'id':_0x58fa55}},'log':_0x8557('0x2')});};exports['addTags']=function(_0x1114bc,_0x48dd33){return client['Request']('AddTagsToFaxInteraction',{'body':_0x48dd33,'options':{'where':{'id':_0x1114bc}},'log':_0x8557('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 15b7f79..c5a5074 100644 --- a/server/services/routing/rpc/faxMessage.js +++ b/server/services/routing/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x633d=['Request','CreateFaxMessage','../client','create'];(function(_0x11ae62,_0x4d5ae7){var _0x469cd9=function(_0x41efbf){while(--_0x41efbf){_0x11ae62['push'](_0x11ae62['shift']());}};_0x469cd9(++_0x4d5ae7);}(_0x633d,0x152));var _0xd633=function(_0x30060f,_0x364743){_0x30060f=_0x30060f-0x0;var _0x69db02=_0x633d[_0x30060f];return _0x69db02;};'use strict';var client=require(_0xd633('0x0'));exports[_0xd633('0x1')]=function(_0x1345f0){return client[_0xd633('0x2')](_0xd633('0x3'),{'body':_0x1345f0,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x90a5=['CreateFaxMessage','../client','create','Request'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x90a5,0x1a1));var _0x590a=function(_0x274066,_0x44b9f1){_0x274066=_0x274066-0x0;var _0x177b17=_0x90a5[_0x274066];return _0x177b17;};'use strict';var client=require(_0x590a('0x0'));exports[_0x590a('0x1')]=function(_0x1027c3){return client[_0x590a('0x2')](_0x590a('0x3'),{'body':_0x1027c3,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 8ec3dd1..5b61e85 100644 --- a/server/services/routing/rpc/faxQueue.js +++ b/server/services/routing/rpc/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x006b=['strategy','User','faxPause','getFaxQueues','Request','name','timeout'];(function(_0x322c2f,_0x254da0){var _0x33994f=function(_0x149571){while(--_0x149571){_0x322c2f['push'](_0x322c2f['shift']());}};_0x33994f(++_0x254da0);}(_0x006b,0x6c));var _0xb006=function(_0x165c8a,_0x1c3dc4){_0x165c8a=_0x165c8a-0x0;var _0x4b749f=_0x006b[_0x165c8a];return _0x4b749f;};'use strict';var client=require('../client');exports[_0xb006('0x0')]=function(){return function(){return client[_0xb006('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xb006('0x2'),_0xb006('0x3'),_0xb006('0x4')],'include':[{'model':_0xb006('0x5'),'as':'Agents','attributes':['id',_0xb006('0x2'),'online',_0xb006('0x6')]}]},'log':_0xb006('0x0')});};}; \ No newline at end of file +var _0x9b79=['../client','getFaxQueues','Request','timeout','strategy','User','Agents','name','online','faxPause'];(function(_0x4187a0,_0x5ef61a){var _0x5aca5b=function(_0x4b8add){while(--_0x4b8add){_0x4187a0['push'](_0x4187a0['shift']());}};_0x5aca5b(++_0x5ef61a);}(_0x9b79,0xaa));var _0x99b7=function(_0x4db7e0,_0x2daee0){_0x4db7e0=_0x4db7e0-0x0;var _0x46f087=_0x9b79[_0x4db7e0];return _0x46f087;};'use strict';var client=require(_0x99b7('0x0'));exports[_0x99b7('0x1')]=function(){return function(){return client[_0x99b7('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x99b7('0x3'),_0x99b7('0x4')],'include':[{'model':_0x99b7('0x5'),'as':_0x99b7('0x6'),'attributes':['id',_0x99b7('0x7'),_0x99b7('0x8'),_0x99b7('0x9')]}]},'log':_0x99b7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 22644e7..64ea655 100644 --- a/server/services/routing/rpc/faxQueueReport.js +++ b/server/services/routing/rpc/faxQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc44c=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x1a74ca,_0x269e82){var _0x294023=function(_0x312671){while(--_0x312671){_0x1a74ca['push'](_0x1a74ca['shift']());}};_0x294023(++_0x269e82);}(_0xc44c,0xfb));var _0xcc44=function(_0x4c27b4,_0x1aee86){_0x4c27b4=_0x4c27b4-0x0;var _0x522237=_0xc44c[_0x4c27b4];return _0x522237;};'use strict';var client=require(_0xcc44('0x0'));exports[_0xcc44('0x1')]=function(_0x161753){return client[_0xcc44('0x2')](_0xcc44('0x3'),{'body':_0x161753,'log':'CreateFaxQueueReport'});};exports[_0xcc44('0x4')]=function(_0x3eb3fa,_0x210e20){return client[_0xcc44('0x2')](_0xcc44('0x5'),{'body':_0x210e20,'options':{'where':{'uniqueid':_0x3eb3fa},'order':[['id',_0xcc44('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x84cf=['DESC','UpdateFaxQueueReport','../client','Request','CreateFaxQueueReport','update'];(function(_0x1572c1,_0x1a3a3c){var _0x4ff168=function(_0x323aa4){while(--_0x323aa4){_0x1572c1['push'](_0x1572c1['shift']());}};_0x4ff168(++_0x1a3a3c);}(_0x84cf,0x176));var _0xf84c=function(_0x430239,_0x16c552){_0x430239=_0x430239-0x0;var _0x553c34=_0x84cf[_0x430239];return _0x553c34;};'use strict';var client=require(_0xf84c('0x0'));exports['create']=function(_0x3b9687){return client[_0xf84c('0x1')](_0xf84c('0x2'),{'body':_0x3b9687,'log':_0xf84c('0x2')});};exports[_0xf84c('0x3')]=function(_0x7d7835,_0x11c37d){return client[_0xf84c('0x1')]('UpdateFaxQueueReport',{'body':_0x11c37d,'options':{'where':{'uniqueid':_0x7d7835},'order':[['id',_0xf84c('0x4')]],'limit':0x1},'log':_0xf84c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b588173..d02640a 100644 --- a/server/services/routing/rpc/interval.js +++ b/server/services/routing/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93e6=['Interval','name','interval','getIntervals','../client','GetInterval'];(function(_0x6d40ac,_0x37cb32){var _0x32fc0e=function(_0x45d5e5){while(--_0x45d5e5){_0x6d40ac['push'](_0x6d40ac['shift']());}};_0x32fc0e(++_0x37cb32);}(_0x93e6,0x11e));var _0x693e=function(_0x2b4cd0,_0x457878){_0x2b4cd0=_0x2b4cd0-0x0;var _0x474616=_0x93e6[_0x2b4cd0];return _0x474616;};'use strict';var client=require(_0x693e('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x693e('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x693e('0x2'),'as':'Intervals','attributes':['id',_0x693e('0x3'),_0x693e('0x4')]}]},'log':_0x693e('0x5')});};}; \ No newline at end of file +var _0xa45c=['getIntervals','name','Intervals','interval','../client'];(function(_0x276d2e,_0x17bdbb){var _0x406fed=function(_0x44f7c3){while(--_0x44f7c3){_0x276d2e['push'](_0x276d2e['shift']());}};_0x406fed(++_0x17bdbb);}(_0xa45c,0x6d));var _0xca45=function(_0x130eab,_0x34ecb7){_0x130eab=_0x130eab-0x0;var _0x50bff0=_0xa45c[_0x130eab];return _0x50bff0;};'use strict';var client=require(_0xca45('0x0'));exports[_0xca45('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xca45('0x2')],'include':[{'model':'Interval','as':_0xca45('0x3'),'attributes':['id','name',_0xca45('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index a07ee7c..2e3d825 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8478=['../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8478,0xe0));var _0x8847=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8478[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0x8847('0x0'));exports[_0x8847('0x1')]=function(_0x34dd4e,_0x31ada1){return client[_0x8847('0x2')](_0x8847('0x3'),{'body':_0x31ada1,'options':{'where':{'id':_0x34dd4e}},'log':_0x8847('0x4')});};exports[_0x8847('0x5')]=function(_0x440114,_0x214e40){return client[_0x8847('0x2')](_0x8847('0x6'),{'body':_0x214e40,'options':{'where':{'id':_0x440114}},'log':_0x8847('0x7')});}; \ No newline at end of file +var _0x5ae8=['addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x471f84,_0x18b225){var _0x2840d0=function(_0x468b53){while(--_0x468b53){_0x471f84['push'](_0x471f84['shift']());}};_0x2840d0(++_0x18b225);}(_0x5ae8,0x197));var _0x85ae=function(_0x4b980d,_0x32fc6a){_0x4b980d=_0x4b980d-0x0;var _0x5c7974=_0x5ae8[_0x4b980d];return _0x5c7974;};'use strict';var client=require('../client');exports[_0x85ae('0x0')]=function(_0x11811e,_0x37aa12){return client[_0x85ae('0x1')](_0x85ae('0x2'),{'body':_0x37aa12,'options':{'where':{'id':_0x11811e}},'log':_0x85ae('0x3')});};exports[_0x85ae('0x4')]=function(_0x3127d8,_0x47c906){return client[_0x85ae('0x1')](_0x85ae('0x5'),{'body':_0x47c906,'options':{'where':{'id':_0x3127d8}},'log':_0x85ae('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 66fd096..6581b5e 100644 --- a/server/services/routing/rpc/mailMessage.js +++ b/server/services/routing/rpc/mailMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1085=['Request','CreateMailMessage','createMailMessage','../client'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x1085,0xf7));var _0x5108=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1085[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5108('0x0'));exports['create']=function(_0x420fab){return client[_0x5108('0x1')](_0x5108('0x2'),{'body':_0x420fab,'log':_0x5108('0x3')});}; \ No newline at end of file +var _0x0c18=['CreateMailMessage','createMailMessage','../client','Request'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0x0c18,0x152));var _0x80c1=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x0c18[_0xc77819];return _0x1c9434;};'use strict';var client=require(_0x80c1('0x0'));exports['create']=function(_0x414305){return client[_0x80c1('0x1')](_0x80c1('0x2'),{'body':_0x414305,'log':_0x80c1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 2444afa..48c17eb 100644 --- a/server/services/routing/rpc/mailQueue.js +++ b/server/services/routing/rpc/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9acf=['timeout','strategy','User','name','online','mailPause','getMailQueues','../client','Request','GetMailQueue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9acf,0x1b5));var _0xf9ac=function(_0x25e630,_0x3db4c7){_0x25e630=_0x25e630-0x0;var _0x5a1b56=_0x9acf[_0x25e630];return _0x5a1b56;};'use strict';var client=require(_0xf9ac('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xf9ac('0x1')](_0xf9ac('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xf9ac('0x3'),_0xf9ac('0x4')],'include':[{'model':_0xf9ac('0x5'),'as':'Agents','attributes':['id',_0xf9ac('0x6'),_0xf9ac('0x7'),_0xf9ac('0x8')]}]},'log':_0xf9ac('0x9')});};}; \ No newline at end of file +var _0x3bca=['../client','getMailQueues','strategy','User','mailPause'];(function(_0x16aae8,_0x16b3d0){var _0x32a6e0=function(_0x241ac5){while(--_0x241ac5){_0x16aae8['push'](_0x16aae8['shift']());}};_0x32a6e0(++_0x16b3d0);}(_0x3bca,0x18b));var _0xa3bc=function(_0x2e521f,_0x13e1a0){_0x2e521f=_0x2e521f-0x0;var _0x5b889f=_0x3bca[_0x2e521f];return _0x5b889f;};'use strict';var client=require(_0xa3bc('0x0'));exports[_0xa3bc('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0xa3bc('0x2')],'include':[{'model':_0xa3bc('0x3'),'as':'Agents','attributes':['id','name','online',_0xa3bc('0x4')]}]},'log':_0xa3bc('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 4219996..fe91ea0 100644 --- a/server/services/routing/rpc/mailQueueReport.js +++ b/server/services/routing/rpc/mailQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe266=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0xe266,0x71));var _0x6e26=function(_0x57d074,_0x444670){_0x57d074=_0x57d074-0x0;var _0x1aa706=_0xe266[_0x57d074];return _0x1aa706;};'use strict';var client=require(_0x6e26('0x0'));exports[_0x6e26('0x1')]=function(_0x3c3eb6){return client[_0x6e26('0x2')](_0x6e26('0x3'),{'body':_0x3c3eb6,'log':_0x6e26('0x3')});};exports[_0x6e26('0x4')]=function(_0x17ccdc,_0x32e3c5){return client[_0x6e26('0x2')](_0x6e26('0x5'),{'body':_0x32e3c5,'options':{'where':{'uniqueid':_0x17ccdc},'order':[['id',_0x6e26('0x6')]],'limit':0x1},'log':_0x6e26('0x5')});}; \ No newline at end of file +var _0x3be3=['../client','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x8ee0b7,_0x3a8341){var _0x405a1e=function(_0x170fc7){while(--_0x170fc7){_0x8ee0b7['push'](_0x8ee0b7['shift']());}};_0x405a1e(++_0x3a8341);}(_0x3be3,0x10c));var _0x33be=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x3be3[_0x21205e];return _0x136ebb;};'use strict';var client=require(_0x33be('0x0'));exports['create']=function(_0x5ed28a){return client[_0x33be('0x1')]('CreateMailQueueReport',{'body':_0x5ed28a,'log':_0x33be('0x2')});};exports['update']=function(_0x4a0a71,_0x8f90b2){return client['Request']('UpdateMailQueueReport',{'body':_0x8f90b2,'options':{'where':{'uniqueid':_0x4a0a71},'order':[['id','DESC']],'limit':0x1},'log':_0x33be('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 199d1f1..1def8eb 100644 --- a/server/services/routing/rpc/openchannelInteraction.js +++ b/server/services/routing/rpc/openchannelInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c96=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x6c96,0xfa));var _0x66c9=function(_0xf99ba0,_0x3d399e){_0xf99ba0=_0xf99ba0-0x0;var _0x2c426f=_0x6c96[_0xf99ba0];return _0x2c426f;};'use strict';var client=require('../client');exports[_0x66c9('0x0')]=function(_0x3950a6,_0x5ad154){return client[_0x66c9('0x1')]('UpdateOpenchannelInteraction',{'body':_0x5ad154,'options':{'where':{'id':_0x3950a6}},'log':_0x66c9('0x2')});};exports[_0x66c9('0x3')]=function(_0x555509,_0x7cb342){return client[_0x66c9('0x1')](_0x66c9('0x4'),{'body':_0x7cb342,'options':{'where':{'id':_0x555509}},'log':_0x66c9('0x5')});}; \ No newline at end of file +var _0xb142=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xb142,0xb7));var _0x2b14=function(_0x41ceed,_0x44f8f4){_0x41ceed=_0x41ceed-0x0;var _0x367a15=_0xb142[_0x41ceed];return _0x367a15;};'use strict';var client=require(_0x2b14('0x0'));exports[_0x2b14('0x1')]=function(_0x15bbd1,_0x15fdf){return client[_0x2b14('0x2')](_0x2b14('0x3'),{'body':_0x15fdf,'options':{'where':{'id':_0x15bbd1}},'log':_0x2b14('0x4')});};exports[_0x2b14('0x5')]=function(_0x4c18b9,_0x3b0a04){return client[_0x2b14('0x2')](_0x2b14('0x6'),{'body':_0x3b0a04,'options':{'where':{'id':_0x4c18b9}},'log':_0x2b14('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 0d7dbb9..bc86087 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf109=['../client','create'];(function(_0x4b281a,_0x1733de){var _0x3149a7=function(_0x3a6b40){while(--_0x3a6b40){_0x4b281a['push'](_0x4b281a['shift']());}};_0x3149a7(++_0x1733de);}(_0xf109,0xce));var _0x9f10=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xf109[_0x2aea9e];return _0x430b92;};'use strict';var client=require(_0x9f10('0x0'));exports[_0x9f10('0x1')]=function(_0x44c4f2){return client['Request']('CreateOpenchannelMessage',{'body':_0x44c4f2,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xedd9=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0xedd9,0xfc));var _0x9edd=function(_0x26eb78,_0x571a8c){_0x26eb78=_0x26eb78-0x0;var _0xfbe852=_0xedd9[_0x26eb78];return _0xfbe852;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 91a7d1f..a8c96c3 100644 --- a/server/services/routing/rpc/openchannelQueue.js +++ b/server/services/routing/rpc/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e03=['User','Agents','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x2988d7,_0x3004ff){var _0x536bfb=function(_0xe70f9d){while(--_0xe70f9d){_0x2988d7['push'](_0x2988d7['shift']());}};_0x536bfb(++_0x3004ff);}(_0x1e03,0x1bd));var _0x31e0=function(_0x1e6804,_0x46bb86){_0x1e6804=_0x1e6804-0x0;var _0x3bf3e2=_0x1e03[_0x1e6804];return _0x3bf3e2;};'use strict';var client=require(_0x31e0('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x31e0('0x1')](_0x31e0('0x2'),{'options':{'raw':![],'attributes':['id',_0x31e0('0x3'),_0x31e0('0x4'),_0x31e0('0x5')],'include':[{'model':_0x31e0('0x6'),'as':_0x31e0('0x7'),'attributes':['id',_0x31e0('0x3'),_0x31e0('0x8'),_0x31e0('0x9')]}]},'log':_0x31e0('0xa')});};}; \ No newline at end of file +var _0xf8d9=['timeout','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','name'];(function(_0x52c2ba,_0x48f4a1){var _0x3cbd9a=function(_0x1f6145){while(--_0x1f6145){_0x52c2ba['push'](_0x52c2ba['shift']());}};_0x3cbd9a(++_0x48f4a1);}(_0xf8d9,0x15b));var _0x9f8d=function(_0x49b076,_0x4fb74e){_0x49b076=_0x49b076-0x0;var _0xa3609=_0xf8d9[_0x49b076];return _0xa3609;};'use strict';var client=require(_0x9f8d('0x0'));exports[_0x9f8d('0x1')]=function(){return function(){return client['Request'](_0x9f8d('0x2'),{'options':{'raw':![],'attributes':['id',_0x9f8d('0x3'),_0x9f8d('0x4'),_0x9f8d('0x5')],'include':[{'model':_0x9f8d('0x6'),'as':_0x9f8d('0x7'),'attributes':['id','name','online',_0x9f8d('0x8')]}]},'log':_0x9f8d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 8b2183e..ea2d227 100644 --- a/server/services/routing/rpc/openchannelQueueReport.js +++ b/server/services/routing/rpc/openchannelQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b32=['DESC','../client','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x41cd0b,_0x535e98){var _0x34f2f0=function(_0x3f60e1){while(--_0x3f60e1){_0x41cd0b['push'](_0x41cd0b['shift']());}};_0x34f2f0(++_0x535e98);}(_0x3b32,0x1f0));var _0x23b3=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x3b32[_0x178e48];return _0x440d7e;};'use strict';var client=require(_0x23b3('0x0'));exports['create']=function(_0x3ce348){return client[_0x23b3('0x1')](_0x23b3('0x2'),{'body':_0x3ce348,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x3c0368,_0x5371ee){return client[_0x23b3('0x1')](_0x23b3('0x3'),{'body':_0x5371ee,'options':{'where':{'uniqueid':_0x3c0368},'order':[['id',_0x23b3('0x4')]],'limit':0x1},'log':_0x23b3('0x3')});}; \ No newline at end of file +var _0x489c=['UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport'];(function(_0x1acfd5,_0x197c2d){var _0x41b319=function(_0x4c172c){while(--_0x4c172c){_0x1acfd5['push'](_0x1acfd5['shift']());}};_0x41b319(++_0x197c2d);}(_0x489c,0x1c9));var _0xc489=function(_0x532127,_0xfd6f56){_0x532127=_0x532127-0x0;var _0x29cd22=_0x489c[_0x532127];return _0x29cd22;};'use strict';var client=require('../client');exports[_0xc489('0x0')]=function(_0x2d8fc8){return client[_0xc489('0x1')]('CreateOpenchannelQueueReport',{'body':_0x2d8fc8,'log':_0xc489('0x2')});};exports['update']=function(_0x4800ef,_0x451009){return client[_0xc489('0x1')](_0xc489('0x3'),{'body':_0x451009,'options':{'where':{'uniqueid':_0x4800ef},'order':[['id','DESC']],'limit':0x1},'log':_0xc489('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index a99a6b3..2abc5bb 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc053=['addTags','addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc053,0x170));var _0x3c05=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0xc053[_0x34f701];return _0x3e2429;};'use strict';var client=require(_0x3c05('0x0'));exports[_0x3c05('0x1')]=function(_0x304e25,_0x48a287){return client[_0x3c05('0x2')]('UpdateSmsInteraction',{'body':_0x48a287,'options':{'where':{'id':_0x304e25}},'log':_0x3c05('0x3')});};exports[_0x3c05('0x4')]=function(_0x2f7ca0,_0x4151a3){return client['Request']('AddTagsToSmsInteraction',{'body':_0x4151a3,'options':{'where':{'id':_0x2f7ca0}},'log':_0x3c05('0x5')});}; \ No newline at end of file +var _0x59ec=['update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x59ec,0x102));var _0xc59e=function(_0x3850ed,_0x2fc793){_0x3850ed=_0x3850ed-0x0;var _0x3e433b=_0x59ec[_0x3850ed];return _0x3e433b;};'use strict';var client=require(_0xc59e('0x0'));exports[_0xc59e('0x1')]=function(_0x58ab61,_0x1805c4){return client[_0xc59e('0x2')]('UpdateSmsInteraction',{'body':_0x1805c4,'options':{'where':{'id':_0x58ab61}},'log':_0xc59e('0x3')});};exports[_0xc59e('0x4')]=function(_0x113025,_0x1ff852){return client[_0xc59e('0x2')](_0xc59e('0x5'),{'body':_0x1ff852,'options':{'where':{'id':_0x113025}},'log':_0xc59e('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9d43585..b26065d 100644 --- a/server/services/routing/rpc/smsMessage.js +++ b/server/services/routing/rpc/smsMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fbc=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x5d8472,_0x46e8f7){var _0x496f0d=function(_0x16c6b5){while(--_0x16c6b5){_0x5d8472['push'](_0x5d8472['shift']());}};_0x496f0d(++_0x46e8f7);}(_0x2fbc,0x106));var _0xc2fb=function(_0xa1e2fd,_0x1c9305){_0xa1e2fd=_0xa1e2fd-0x0;var _0x218880=_0x2fbc[_0xa1e2fd];return _0x218880;};'use strict';var client=require(_0xc2fb('0x0'));exports[_0xc2fb('0x1')]=function(_0x1f8105){return client[_0xc2fb('0x2')](_0xc2fb('0x3'),{'body':_0x1f8105,'log':_0xc2fb('0x4')});}; \ No newline at end of file +var _0x1d25=['Request','CreateSmsMessage','../client','create'];(function(_0x1f3fd8,_0x330562){var _0x2d9d33=function(_0x34061f){while(--_0x34061f){_0x1f3fd8['push'](_0x1f3fd8['shift']());}};_0x2d9d33(++_0x330562);}(_0x1d25,0xba));var _0x51d2=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0x1d25[_0x556634];return _0x4429fd;};'use strict';var client=require(_0x51d2('0x0'));exports[_0x51d2('0x1')]=function(_0x153698){return client[_0x51d2('0x2')](_0x51d2('0x3'),{'body':_0x153698,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 60d132d..691bd0d 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7953=['name','strategy','Agents','online','../client','getSmsQueues','Request'];(function(_0x4761d8,_0x5783ac){var _0x15ffa1=function(_0x31d527){while(--_0x31d527){_0x4761d8['push'](_0x4761d8['shift']());}};_0x15ffa1(++_0x5783ac);}(_0x7953,0x1c4));var _0x3795=function(_0x4aa662,_0x1cc90c){_0x4aa662=_0x4aa662-0x0;var _0x336478=_0x7953[_0x4aa662];return _0x336478;};'use strict';var client=require(_0x3795('0x0'));exports[_0x3795('0x1')]=function(){return function(){return client[_0x3795('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x3795('0x3'),'timeout',_0x3795('0x4')],'include':[{'model':'User','as':_0x3795('0x5'),'attributes':['id',_0x3795('0x3'),_0x3795('0x6'),'smsPause']}]},'log':_0x3795('0x1')});};}; \ No newline at end of file +var _0xdc68=['smsPause','../client','getSmsQueues','GetSmsQueue','name','timeout','strategy','User','Agents','online'];(function(_0x23f642,_0x3c8f66){var _0x4ba0d0=function(_0x507a88){while(--_0x507a88){_0x23f642['push'](_0x23f642['shift']());}};_0x4ba0d0(++_0x3c8f66);}(_0xdc68,0x1d7));var _0x8dc6=function(_0x203c80,_0x4bf87f){_0x203c80=_0x203c80-0x0;var _0x211015=_0xdc68[_0x203c80];return _0x211015;};'use strict';var client=require(_0x8dc6('0x0'));exports[_0x8dc6('0x1')]=function(){return function(){return client['Request'](_0x8dc6('0x2'),{'options':{'raw':![],'attributes':['id',_0x8dc6('0x3'),_0x8dc6('0x4'),_0x8dc6('0x5')],'include':[{'model':_0x8dc6('0x6'),'as':_0x8dc6('0x7'),'attributes':['id','name',_0x8dc6('0x8'),_0x8dc6('0x9')]}]},'log':_0x8dc6('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 70e7c77..9825ebf 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ba6=['../client','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x21b902,_0xced0ba){var _0x16b5ae=function(_0x1211ba){while(--_0x1211ba){_0x21b902['push'](_0x21b902['shift']());}};_0x16b5ae(++_0xced0ba);}(_0x9ba6,0x13b));var _0x69ba=function(_0xa8332,_0x23ab4a){_0xa8332=_0xa8332-0x0;var _0x4619bf=_0x9ba6[_0xa8332];return _0x4619bf;};'use strict';var client=require(_0x69ba('0x0'));exports['create']=function(_0x3b900f){return client['Request'](_0x69ba('0x1'),{'body':_0x3b900f,'log':'CreateSmsQueueReport'});};exports[_0x69ba('0x2')]=function(_0x37b459,_0x484d94){return client['Request'](_0x69ba('0x3'),{'body':_0x484d94,'options':{'where':{'uniqueid':_0x37b459},'order':[['id',_0x69ba('0x4')]],'limit':0x1},'log':_0x69ba('0x3')});}; \ No newline at end of file +var _0x7906=['create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC','../client'];(function(_0xc97e0,_0x5eb956){var _0x20ea86=function(_0x54e105){while(--_0x54e105){_0xc97e0['push'](_0xc97e0['shift']());}};_0x20ea86(++_0x5eb956);}(_0x7906,0x15d));var _0x6790=function(_0x36bfb5,_0x330e06){_0x36bfb5=_0x36bfb5-0x0;var _0x4fa247=_0x7906[_0x36bfb5];return _0x4fa247;};'use strict';var client=require(_0x6790('0x0'));exports[_0x6790('0x1')]=function(_0x1261c7){return client['Request'](_0x6790('0x2'),{'body':_0x1261c7,'log':'CreateSmsQueueReport'});};exports[_0x6790('0x3')]=function(_0x579675,_0x3091f0){return client[_0x6790('0x4')](_0x6790('0x5'),{'body':_0x3091f0,'options':{'where':{'uniqueid':_0x579675},'order':[['id',_0x6790('0x6')]],'limit':0x1},'log':_0x6790('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 1902dc8..32384f0 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbde1=['name','online','pauseType','voicePause','chatPause','faxPause','smsPause','openchannelPause','mailCapacity','faxCapacity','getAgents','../client','Request','agent'];(function(_0xf65c65,_0x9fce2c){var _0x57d984=function(_0x270a21){while(--_0x270a21){_0xf65c65['push'](_0xf65c65['shift']());}};_0x57d984(++_0x9fce2c);}(_0xbde1,0x107));var _0x1bde=function(_0x3d0293,_0x3d3c80){_0x3d0293=_0x3d0293-0x0;var _0x5aa8d3=_0xbde1[_0x3d0293];return _0x5aa8d3;};'use strict';var client=require(_0x1bde('0x0'));exports['getAgents']=function(){return function(){return client[_0x1bde('0x1')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x1bde('0x2')},'attributes':['id',_0x1bde('0x3'),_0x1bde('0x4'),_0x1bde('0x5'),'lastPauseAt',_0x1bde('0x6'),_0x1bde('0x7'),'mailPause',_0x1bde('0x8'),_0x1bde('0x9'),_0x1bde('0xa'),'chatCapacity',_0x1bde('0xb'),_0x1bde('0xc'),'smsCapacity','openchannelCapacity']},'log':_0x1bde('0xd')});};}; \ No newline at end of file +var _0xdc6a=['faxPause','smsPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','agent','name','online','pauseType','lastPauseAt','chatPause','mailPause'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xdc6a,0x127));var _0xadc6=function(_0x2c4ca8,_0x3fb1f6){_0x2c4ca8=_0x2c4ca8-0x0;var _0xc46ed7=_0xdc6a[_0x2c4ca8];return _0xc46ed7;};'use strict';var client=require('../client');exports[_0xadc6('0x0')]=function(){return function(){return client[_0xadc6('0x1')]('GetUser',{'options':{'raw':!![],'where':{'role':_0xadc6('0x2')},'attributes':['id',_0xadc6('0x3'),_0xadc6('0x4'),_0xadc6('0x5'),_0xadc6('0x6'),'voicePause',_0xadc6('0x7'),_0xadc6('0x8'),_0xadc6('0x9'),_0xadc6('0xa'),_0xadc6('0xb'),'chatCapacity',_0xadc6('0xc'),_0xadc6('0xd'),_0xadc6('0xe'),_0xadc6('0xf')]},'log':_0xadc6('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index f2fc2e4..9f84466 100644 --- a/server/services/routing/server/applications/agent.js +++ b/server/services/routing/server/applications/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7eed=['./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','name','toLowerCase','consequence','length','error','map','message','join','stop','find','timeout','createQueue','atimeout','channel','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','validate','lodash','util','../../../../config/logger','routing'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x7eed,0xeb));var _0xd7ee=function(_0x590a0c,_0xab1f66){_0x590a0c=_0x590a0c-0x0;var _0x32add4=_0x7eed[_0x590a0c];return _0x32add4;};'use strict';var schema=require(_0xd7ee('0x0'));var _=require(_0xd7ee('0x1'));var util=require(_0xd7ee('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xd7ee('0x3'))(_0xd7ee('0x4'));var strategy=require(_0xd7ee('0x5'));var queue=schema({'name':{'type':_0xd7ee('0x6'),'required':!![],'message':_0xd7ee('0x7')},'timeout':{'type':_0xd7ee('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x26a366,_0x363be5,_0x1b669d){return logger[_0xd7ee('0x9')](util[_0xd7ee('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x26a366,_0x363be5[_0xd7ee('0xb')],_0x1b669d));}function handleFindAgent(_0x4bb0fb){return function(_0x48b3d7){return _0x48b3d7[_0xd7ee('0xb')][_0xd7ee('0xc')]()===_0x4bb0fb[_0xd7ee('0xc')]();};}exports[_0xd7ee('0xd')]=function(_0x1741a3,_0x5c606c,_0x3cd07e,_0x2e7b12){return function(_0x235170){try{var _0x56188d={'name':_0x5c606c[0x0],'timeout':_0x5c606c[0x1]};var _0x44063b=queue[_0xd7ee('0x0')](_0x56188d,{'typecast':!![]});if(_0x44063b[_0xd7ee('0xe')]){logger[_0xd7ee('0xf')]('[%s][AGENT]\x20%s',_0x1741a3,_[_0xd7ee('0x10')](_0x44063b,_0xd7ee('0x11'))[_0xd7ee('0x12')](',\x20'));_0x235170[_0xd7ee('0x13')]();}else{var _0xed2291=_[_0xd7ee('0x14')](_0x3cd07e['agents'],handleFindAgent(_0x56188d['name']));if(_0xed2291){var _0x3b5be9=(_0x56188d[_0xd7ee('0x15')]||0xa)*0x3e8;var _0x18fa05,_0x1f619d;var _0x11f15d=seqqueue[_0xd7ee('0x16')](_0x3b5be9);_0x11f15d['id']=_0x1741a3;_0x11f15d[_0xd7ee('0x17')]=_0x3b5be9;_0x11f15d['channel']=_0x2e7b12[_0xd7ee('0x18')];writeLog(_0x1741a3,_0xed2291,util['format']('START:%s',_0x3b5be9));_0x3cd07e['rules'][_0x1741a3]['on']('end',function(){_0x11f15d[_0xd7ee('0x19')]();clearTimeout(_0x1f619d);_0x1f619d=undefined;if(_0x3cd07e['rules'][_0x1741a3]){delete _0x3cd07e['rules'][_0x1741a3];}logger[_0xd7ee('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x1741a3);_0x235170['stop']();});_0x1f619d=setTimeout(function(){clearTimeout(_0x1f619d);_0x11f15d['close']();logger[_0xd7ee('0x9')](_0xd7ee('0x1a'),_0x1741a3);_0x235170[_0xd7ee('0x1b')]();},_0x3b5be9);strategy[_0xd7ee('0x1c')](_0x11f15d,_0xed2291,_0x3cd07e,_0x2e7b12);}else{logger[_0xd7ee('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1741a3,_0x56188d[_0xd7ee('0xb')]);_0x235170[_0xd7ee('0x13')]();}}}catch(_0x4c0c24){console[_0xd7ee('0x1d')](_0x4c0c24);logger[_0xd7ee('0xf')]('[%s][QUEUE]\x20%s',_0x1741a3,_0x4c0c24['stack']);_0x235170[_0xd7ee('0x13')]();}};}; \ No newline at end of file +var _0xa89a=['timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','message','stop','find','agents','timeout','createQueue','atimeout','channel','format','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa89a,0x101));var _0xaa89=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xa89a[_0x1969a7];return _0x3d665f;};'use strict';var schema=require(_0xaa89('0x0'));var _=require('lodash');var util=require(_0xaa89('0x1'));var seqqueue=require(_0xaa89('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xaa89('0x3'));var queue=schema({'name':{'type':_0xaa89('0x4'),'required':!![],'message':_0xaa89('0x5')},'timeout':{'type':_0xaa89('0x6'),'message':_0xaa89('0x7')}});function writeLog(_0x3091b0,_0x578bc3,_0x20a1ae){return logger[_0xaa89('0x8')](util['format'](_0xaa89('0x9'),_0x3091b0,_0x578bc3[_0xaa89('0xa')],_0x20a1ae));}function handleFindAgent(_0x40d567){return function(_0x3103ed){return _0x3103ed[_0xaa89('0xa')][_0xaa89('0xb')]()===_0x40d567[_0xaa89('0xb')]();};}exports[_0xaa89('0xc')]=function(_0x417cbd,_0x2ffb69,_0x472039,_0x1413e8){return function(_0x3ed868){try{var _0x37204f={'name':_0x2ffb69[0x0],'timeout':_0x2ffb69[0x1]};var _0xbf75c0=queue[_0xaa89('0x0')](_0x37204f,{'typecast':!![]});if(_0xbf75c0[_0xaa89('0xd')]){logger[_0xaa89('0xe')]('[%s][AGENT]\x20%s',_0x417cbd,_['map'](_0xbf75c0,_0xaa89('0xf'))['join'](',\x20'));_0x3ed868[_0xaa89('0x10')]();}else{var _0xe57aac=_[_0xaa89('0x11')](_0x472039[_0xaa89('0x12')],handleFindAgent(_0x37204f[_0xaa89('0xa')]));if(_0xe57aac){var _0x520896=(_0x37204f[_0xaa89('0x13')]||0xa)*0x3e8;var _0x2b884f,_0x1fa708;var _0x331b28=seqqueue[_0xaa89('0x14')](_0x520896);_0x331b28['id']=_0x417cbd;_0x331b28[_0xaa89('0x15')]=_0x520896;_0x331b28[_0xaa89('0x16')]=_0x1413e8[_0xaa89('0x16')];writeLog(_0x417cbd,_0xe57aac,util[_0xaa89('0x17')]('START:%s',_0x520896));_0x472039[_0xaa89('0x18')][_0x417cbd]['on']('end',function(){_0x331b28['close']();clearTimeout(_0x1fa708);_0x1fa708=undefined;if(_0x472039[_0xaa89('0x18')][_0x417cbd]){delete _0x472039[_0xaa89('0x18')][_0x417cbd];}logger[_0xaa89('0x8')](_0xaa89('0x19'),_0x417cbd);_0x3ed868['stop']();});_0x1fa708=setTimeout(function(){clearTimeout(_0x1fa708);_0x331b28[_0xaa89('0x1a')]();logger['info'](_0xaa89('0x1b'),_0x417cbd);_0x3ed868[_0xaa89('0x1c')]();},_0x520896);strategy[_0xaa89('0x1d')](_0x331b28,_0xe57aac,_0x472039,_0x1413e8);}else{logger[_0xaa89('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x417cbd,_0x37204f['name']);_0x3ed868['stop']();}}}catch(_0x1af89b){console[_0xaa89('0x1e')](_0x1af89b);logger['error'](_0xaa89('0x1f'),_0x417cbd,_0x1af89b[_0xaa89('0x20')]);_0x3ed868['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 866eab3..210840a 100644 --- a/server/services/routing/server/applications/amazonlex.js +++ b/server/services/routing/server/applications/amazonlex.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbd9=['error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','message','toString','postText','create','dialogState','Failed','stringify','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','body','Message','then','catch'];(function(_0x21f9f0,_0x289183){var _0x388790=function(_0x5a3730){while(--_0x5a3730){_0x21f9f0['push'](_0x21f9f0['shift']());}};_0x388790(++_0x289183);}(_0xfbd9,0x83));var _0x9fbd=function(_0x1a8f82,_0x3e6b50){_0x1a8f82=_0x1a8f82-0x0;var _0x35c5ba=_0xfbd9[_0x1a8f82];return _0x35c5ba;};'use strict';var _=require(_0x9fbd('0x0'));var moment=require(_0x9fbd('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x9fbd('0x2'))(_0x9fbd('0x3'));var rpc={'chatMessage':require(_0x9fbd('0x4')),'openchannelMessage':require(_0x9fbd('0x5')),'mailMessage':require(_0x9fbd('0x6')),'smsMessage':require(_0x9fbd('0x7')),'faxMessage':require(_0x9fbd('0x8'))};exports[_0x9fbd('0x9')]=function(_0xb8ef00,_0x3229e9){return function(_0x1ccbfd){try{if(!_['isNil'](this['interaction'][_0x9fbd('0xa')])){logger[_0x9fbd('0xb')](_0x9fbd('0xc'),_0xb8ef00,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1ccbfd[_0x9fbd('0xd')]();}var _0xd339dd={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9fbd('0xe')](_0x9fbd('0xf')),'direction':'out'};var _0x225c45=this[_0x9fbd('0x10')];if(_0x225c45===_0x9fbd('0x11')){_0xd339dd[_0x9fbd('0x12')]=this['account']['id'];}else{_0xd339dd[_[_0x9fbd('0x13')](_0x225c45)+_0x9fbd('0x14')]=this['account']['id'];}_0xd339dd[_['upperFirst'](_0x225c45)+_0x9fbd('0x15')]=this[_0x9fbd('0x16')]['id'];if(this[_0x9fbd('0x16')][_0x9fbd('0x17')]){var _0x48a3c7=_0x3229e9[0x4];if(!_[_0x9fbd('0x18')](_0x48a3c7)){_0xd339dd[_0x9fbd('0x19')]=utils['getMustacheRender'](_0x48a3c7,this);return rpc[_0x225c45+_0x9fbd('0x1a')]['create'](_0xd339dd)[_0x9fbd('0x1b')](function(_0xba8fc3){logger[_0x9fbd('0xb')](_0x9fbd('0xc'),_0xb8ef00,_0xd339dd['body']);})[_0x9fbd('0x1c')](function(_0x578f61){logger[_0x9fbd('0x1d')](_0x9fbd('0xc'),_0xb8ef00,JSON['stringify'](_0x578f61));})[_0x9fbd('0x1e')](function(){logger['info'](_0x9fbd('0x1f'),_0xb8ef00);_0x1ccbfd['stop']();});}else{logger[_0x9fbd('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xb8ef00);_0x1ccbfd['stop']();}}else{var _0x1d955c=this;var _0x449f3b=new AWS['LexRuntime']({'accessKeyId':_0x3229e9[0x0],'secretAccessKey':_0x3229e9[0x1],'region':_0x3229e9[0x2]});var _0x398343={'botAlias':'$LATEST','botName':_0x3229e9[0x3],'inputText':this[_0x9fbd('0x20')]['body'],'userId':this[_0x9fbd('0x16')]['id'][_0x9fbd('0x21')]()};_0x449f3b[_0x9fbd('0x22')](_0x398343,function(_0x4604d0,_0x3248e7){if(_0x4604d0){logger[_0x9fbd('0x1d')](_0x9fbd('0xc'),_0xb8ef00,_0x4604d0[_0x9fbd('0x20')]);_0x1ccbfd[_0x9fbd('0xd')]();}else if(_0x3248e7&&_0x3248e7['message']){_0x1d955c[_0x9fbd('0x19')]['amazonlex']=_0x3248e7;_0xd339dd[_0x9fbd('0x19')]=_0x3248e7[_0x9fbd('0x20')];return rpc[_0x225c45+_0x9fbd('0x1a')][_0x9fbd('0x23')](_0xd339dd)['then'](function(_0x562bf7){logger[_0x9fbd('0xb')](_0x9fbd('0xc'),_0xb8ef00,_0xd339dd[_0x9fbd('0x19')]);if(_0x3248e7[_0x9fbd('0x24')]==_0x9fbd('0x25')){_0x1ccbfd[_0x9fbd('0xd')]();}else{_0x1ccbfd['stop']();}})['catch'](function(_0x550f17){logger[_0x9fbd('0x1d')](_0x9fbd('0xc'),_0xb8ef00,JSON[_0x9fbd('0x26')](_0x550f17));_0x1ccbfd[_0x9fbd('0xd')]();});}else{_0x1ccbfd[_0x9fbd('0xd')]();}});}}catch(_0x2c51b4){logger[_0x9fbd('0x1d')](_0x9fbd('0xc'),_0xb8ef00,JSON['stringify'](_0x2c51b4));_0x1ccbfd[_0x9fbd('0x27')]();}};}; \ No newline at end of file +var _0x6140=['stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','Failed','error','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','chat','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','info','[%s][AMAZONLEX]\x20%s','catch','stringify'];(function(_0x5a40d8,_0x6ae357){var _0x8e56d6=function(_0x4edb62){while(--_0x4edb62){_0x5a40d8['push'](_0x5a40d8['shift']());}};_0x8e56d6(++_0x6ae357);}(_0x6140,0xb2));var _0x0614=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6140[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0614('0x0'));var moment=require(_0x0614('0x1'));var AWS=require(_0x0614('0x2'));var utils=require(_0x0614('0x3'));var logger=require(_0x0614('0x4'))(_0x0614('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0614('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0614('0x7')),'faxMessage':require(_0x0614('0x8'))};exports[_0x0614('0x9')]=function(_0x5ea7d3,_0x2d7272){return function(_0x3dd224){try{if(!_[_0x0614('0xa')](this[_0x0614('0xb')][_0x0614('0xc')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x5ea7d3,_0x0614('0xd'));return _0x3dd224[_0x0614('0xe')]();}var _0x4d6c0d={'ContactId':this[_0x0614('0xf')]['id'],'sentAt':moment()['format'](_0x0614('0x10')),'direction':'out'};var _0x1b7b0c=this[_0x0614('0x11')];if(_0x1b7b0c===_0x0614('0x12')){_0x4d6c0d['ChatWebsiteId']=this[_0x0614('0x13')]['id'];}else{_0x4d6c0d[_[_0x0614('0x14')](_0x1b7b0c)+_0x0614('0x15')]=this['account']['id'];}_0x4d6c0d[_[_0x0614('0x14')](_0x1b7b0c)+_0x0614('0x16')]=this[_0x0614('0xb')]['id'];if(this['interaction'][_0x0614('0x17')]){var _0x5f46a4=_0x2d7272[0x4];if(!_['isEmpty'](_0x5f46a4)){_0x4d6c0d[_0x0614('0x18')]=utils[_0x0614('0x19')](_0x5f46a4,this);return rpc[_0x1b7b0c+_0x0614('0x1a')][_0x0614('0x1b')](_0x4d6c0d)['then'](function(_0x5c69c1){logger[_0x0614('0x1c')](_0x0614('0x1d'),_0x5ea7d3,_0x4d6c0d[_0x0614('0x18')]);})[_0x0614('0x1e')](function(_0x5518b8){logger['error'](_0x0614('0x1d'),_0x5ea7d3,JSON[_0x0614('0x1f')](_0x5518b8));})['finally'](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5ea7d3);_0x3dd224[_0x0614('0x20')]();});}else{logger[_0x0614('0x1c')](_0x0614('0x21'),_0x5ea7d3);_0x3dd224[_0x0614('0x20')]();}}else{var _0x1d8ce5=this;var _0x1e81c6=new AWS[(_0x0614('0x22'))]({'accessKeyId':_0x2d7272[0x0],'secretAccessKey':_0x2d7272[0x1],'region':_0x2d7272[0x2]});var _0xb8d161={'botAlias':_0x0614('0x23'),'botName':_0x2d7272[0x3],'inputText':this[_0x0614('0x24')][_0x0614('0x18')],'userId':this[_0x0614('0xb')]['id'][_0x0614('0x25')]()};_0x1e81c6[_0x0614('0x26')](_0xb8d161,function(_0x542e20,_0x5cad0b){if(_0x542e20){logger['error'](_0x0614('0x1d'),_0x5ea7d3,_0x542e20[_0x0614('0x24')]);_0x3dd224[_0x0614('0xe')]();}else if(_0x5cad0b&&_0x5cad0b['message']){_0x1d8ce5[_0x0614('0x18')][_0x0614('0x27')]=_0x5cad0b;_0x4d6c0d[_0x0614('0x18')]=_0x5cad0b['message'];return rpc[_0x1b7b0c+_0x0614('0x1a')][_0x0614('0x1b')](_0x4d6c0d)['then'](function(_0x51e921){logger[_0x0614('0x1c')](_0x0614('0x1d'),_0x5ea7d3,_0x4d6c0d[_0x0614('0x18')]);if(_0x5cad0b['dialogState']==_0x0614('0x28')){_0x3dd224[_0x0614('0xe')]();}else{_0x3dd224[_0x0614('0x20')]();}})[_0x0614('0x1e')](function(_0x166074){logger[_0x0614('0x29')](_0x0614('0x1d'),_0x5ea7d3,JSON[_0x0614('0x1f')](_0x166074));_0x3dd224['next']();});}else{_0x3dd224[_0x0614('0xe')]();}});}}catch(_0x28568b){logger['error'](_0x0614('0x1d'),_0x5ea7d3,JSON[_0x0614('0x1f')](_0x28568b));_0x3dd224['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index ff96a3b..b86071b 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['stop']();}};}; \ No newline at end of file +var _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index b59ae79..b3d0731 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85de=['system','Interaction','channel','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x47edbb,_0x4120cb){var _0x2748bf=function(_0x58ffd8){while(--_0x58ffd8){_0x47edbb['push'](_0x47edbb['shift']());}};_0x2748bf(++_0x4120cb);}(_0x85de,0x1f0));var _0xe85d=function(_0xe91f41,_0x407ad6){_0xe91f41=_0xe91f41-0x0;var _0x14b2e5=_0x85de[_0xe91f41];return _0x14b2e5;};'use strict';var moment=require(_0xe85d('0x0'));var logger=require(_0xe85d('0x1'))(_0xe85d('0x2'));var rpc={'chatInteraction':require(_0xe85d('0x3')),'openchannelInteraction':require(_0xe85d('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xe85d('0x5')),'faxInteraction':require('../../rpc/faxInteraction')};exports['consequence']=function(_0x46f08a,_0x2a28a9,_0x514fc9,_0x1e9dea){return function(_0xb70e1d){try{logger[_0xe85d('0x6')](_0xe85d('0x7'),_0x46f08a,_0x2a28a9[0x0]);var _0x4608f4={'closed':0x1,'closedAt':moment()[_0xe85d('0x8')](_0xe85d('0x9')),'closeReason':_0xe85d('0xa'),'disposition':_0x2a28a9[0x0]};if(rpc[_0x1e9dea['channel']+_0xe85d('0xb')]){rpc[_0x1e9dea[_0xe85d('0xc')]+_0xe85d('0xb')][_0xe85d('0xd')](_0x1e9dea[_0xe85d('0xe')]['id'],_0x4608f4)['then'](function(_0x1499e5){logger['info'](_0xe85d('0xf'),_0x46f08a,_0x1e9dea['interaction']['id']);})[_0xe85d('0x10')](function(_0x548209){logger[_0xe85d('0x11')](_0xe85d('0x12'),_0x46f08a,JSON[_0xe85d('0x13')](_0x548209));})[_0xe85d('0x14')](function(){_0xb70e1d[_0xe85d('0x15')]();});}}catch(_0x17a529){logger[_0xe85d('0x11')]('[%s][CLOSE]\x20%s',_0x46f08a,JSON[_0xe85d('0x13')](_0x17a529));_0xb70e1d[_0xe85d('0x15')]();}};}; \ No newline at end of file +var _0xaa5e=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','update','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x3b32f7,_0x1f5a7a){_0x3b32f7=_0x3b32f7-0x0;var _0x40fce8=_0xaa5e[_0x3b32f7];return _0x40fce8;};'use strict';var moment=require(_0xeaa5('0x0'));var logger=require(_0xeaa5('0x1'))('routing');var rpc={'chatInteraction':require(_0xeaa5('0x2')),'openchannelInteraction':require(_0xeaa5('0x3')),'smsInteraction':require(_0xeaa5('0x4')),'mailInteraction':require(_0xeaa5('0x5')),'faxInteraction':require(_0xeaa5('0x6'))};exports['consequence']=function(_0x2c111f,_0xd64e9f,_0x33d376,_0x382868){return function(_0x553f20){try{logger['info'](_0xeaa5('0x7'),_0x2c111f,_0xd64e9f[0x0]);var _0x2c9696={'closed':0x1,'closedAt':moment()['format'](_0xeaa5('0x8')),'closeReason':_0xeaa5('0x9'),'disposition':_0xd64e9f[0x0]};if(rpc[_0x382868['channel']+_0xeaa5('0xa')]){rpc[_0x382868['channel']+_0xeaa5('0xa')][_0xeaa5('0xb')](_0x382868['interaction']['id'],_0x2c9696)[_0xeaa5('0xc')](function(_0x299f44){logger[_0xeaa5('0xd')](_0xeaa5('0xe'),_0x2c111f,_0x382868[_0xeaa5('0xf')]['id']);})[_0xeaa5('0x10')](function(_0x119d7f){logger[_0xeaa5('0x11')](_0xeaa5('0x12'),_0x2c111f,JSON['stringify'](_0x119d7f));})[_0xeaa5('0x13')](function(){_0x553f20[_0xeaa5('0x14')]();});}}catch(_0x3d8b80){logger[_0xeaa5('0x11')](_0xeaa5('0x12'),_0x2c111f,JSON['stringify'](_0x3d8b80));_0x553f20[_0xeaa5('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 388131c..c381479 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45a9=['account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','[%s][DIALOGFLOW]\x20%s','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','create','metadata','endConversation','catch','lodash','moment','apiai-promise','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','ChatWebsiteId'];(function(_0x18605e,_0xd1ecd8){var _0x36add2=function(_0x584ddc){while(--_0x584ddc){_0x18605e['push'](_0x18605e['shift']());}};_0x36add2(++_0xd1ecd8);}(_0x45a9,0xd3));var _0x945a=function(_0x22cf81,_0x5869f7){_0x22cf81=_0x22cf81-0x0;var _0x3bbc4c=_0x45a9[_0x22cf81];return _0x3bbc4c;};'use strict';var _=require(_0x945a('0x0'));var moment=require(_0x945a('0x1'));var apiai=require(_0x945a('0x2'));var md5=require('md5');var utils=require(_0x945a('0x3'));var logger=require('../../../../config/logger')(_0x945a('0x4'));var rpc={'chatMessage':require(_0x945a('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x945a('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x945a('0x7'))};exports[_0x945a('0x8')]=function(_0x5bbdfa,_0x35426d){return function(_0x337074){try{if(!_[_0x945a('0x9')](this[_0x945a('0xa')]['UserId'])){logger[_0x945a('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x5bbdfa,_0x945a('0xc'));return _0x337074[_0x945a('0xd')]();}var _0x4432f0={'ContactId':this[_0x945a('0xe')]['id'],'sentAt':moment()[_0x945a('0xf')](_0x945a('0x10')),'direction':'out'};var _0x2a612f=this[_0x945a('0x11')];if(_0x2a612f==='chat'){_0x4432f0[_0x945a('0x12')]=this[_0x945a('0x13')]['id'];}else{_0x4432f0[_['upperFirst'](_0x2a612f)+_0x945a('0x14')]=this[_0x945a('0x13')]['id'];}_0x4432f0[_[_0x945a('0x15')](_0x2a612f)+_0x945a('0x16')]=this[_0x945a('0xa')]['id'];if(this['interaction'][_0x945a('0x17')]){var _0x190529=_0x35426d[0x2];if(!_[_0x945a('0x18')](_0x190529)){_0x4432f0[_0x945a('0x19')]=utils[_0x945a('0x1a')](_0x190529,this);return rpc[_0x2a612f+_0x945a('0x1b')]['create'](_0x4432f0)[_0x945a('0x1c')](function(_0x2f8076){logger[_0x945a('0xb')](_0x945a('0x1d'),_0x5bbdfa,_0x4432f0['body']);})['catch'](function(_0x32b313){logger[_0x945a('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x5bbdfa,JSON[_0x945a('0x1f')](_0x32b313));})[_0x945a('0x20')](function(){logger['info'](_0x945a('0x21'),_0x5bbdfa);_0x337074[_0x945a('0x22')]();});}else{logger['info'](_0x945a('0x23'),_0x5bbdfa);_0x337074[_0x945a('0x22')]();}}else{var _0x55a8f3=this;var _0x3855c0=apiai(_0x35426d[0x0],{'language':_0x35426d[0x1]||'en'});return _0x3855c0[_0x945a('0x24')](this[_0x945a('0x25')]['body'],{'sessionId':md5(this[_0x945a('0xa')]['id'])})[_0x945a('0x1c')](function(_0x229ba9){_0x55a8f3[_0x945a('0x19')][_0x945a('0x26')]=_0x229ba9;_0x4432f0[_0x945a('0x19')]=_0x229ba9[_0x945a('0x27')][_0x945a('0x28')][_0x945a('0x29')];return rpc[_0x2a612f+'Message'][_0x945a('0x2a')](_0x4432f0)[_0x945a('0x1c')](function(_0x4ec46d){logger[_0x945a('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x5bbdfa,_0x4432f0[_0x945a('0x19')]);if(_0x229ba9[_0x945a('0x27')][_0x945a('0x2b')][_0x945a('0x2c')]){_0x337074[_0x945a('0xd')]();}else{_0x337074[_0x945a('0x22')]();}})['catch'](function(_0x36f5b6){logger[_0x945a('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x5bbdfa,JSON[_0x945a('0x1f')](_0x36f5b6));_0x337074['next']();});})[_0x945a('0x2d')](function(_0x51f047){logger['error'](_0x945a('0x1d'),_0x5bbdfa,_0x51f047[_0x945a('0x25')]);_0x337074[_0x945a('0xd')]();});}}catch(_0x4b516c){logger[_0x945a('0x1e')](_0x945a('0x1d'),_0x5bbdfa,JSON[_0x945a('0x1f')](_0x4b516c));_0x337074[_0x945a('0x22')]();}};}; \ No newline at end of file +var _0xe1cc=['finally','stop','textRequest','message','result','fulfillment','speech','endConversation','next','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xe1cc,0x1e2));var _0xce1c=function(_0x796d59,_0x108662){_0x796d59=_0x796d59-0x0;var _0x248ed8=_0xe1cc[_0x796d59];return _0x248ed8;};'use strict';var _=require(_0xce1c('0x0'));var moment=require(_0xce1c('0x1'));var apiai=require(_0xce1c('0x2'));var md5=require('md5');var utils=require(_0xce1c('0x3'));var logger=require(_0xce1c('0x4'))(_0xce1c('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xce1c('0x6')),'mailMessage':require(_0xce1c('0x7')),'smsMessage':require(_0xce1c('0x8')),'faxMessage':require(_0xce1c('0x9'))};exports[_0xce1c('0xa')]=function(_0x381de2,_0x201fe8){return function(_0x5db031){try{if(!_['isNil'](this[_0xce1c('0xb')][_0xce1c('0xc')])){logger[_0xce1c('0xd')](_0xce1c('0xe'),_0x381de2,_0xce1c('0xf'));return _0x5db031['next']();}var _0x1d6b4e={'ContactId':this[_0xce1c('0x10')]['id'],'sentAt':moment()[_0xce1c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xce1c('0x12')};var _0x491721=this['channel'];if(_0x491721===_0xce1c('0x13')){_0x1d6b4e[_0xce1c('0x14')]=this[_0xce1c('0x15')]['id'];}else{_0x1d6b4e[_[_0xce1c('0x16')](_0x491721)+'AccountId']=this[_0xce1c('0x15')]['id'];}_0x1d6b4e[_[_0xce1c('0x16')](_0x491721)+_0xce1c('0x17')]=this[_0xce1c('0xb')]['id'];if(this[_0xce1c('0xb')][_0xce1c('0x18')]){var _0x221ddd=_0x201fe8[0x2];if(!_[_0xce1c('0x19')](_0x221ddd)){_0x1d6b4e[_0xce1c('0x1a')]=utils[_0xce1c('0x1b')](_0x221ddd,this);return rpc[_0x491721+_0xce1c('0x1c')][_0xce1c('0x1d')](_0x1d6b4e)[_0xce1c('0x1e')](function(_0x97e746){logger[_0xce1c('0xd')](_0xce1c('0xe'),_0x381de2,_0x1d6b4e[_0xce1c('0x1a')]);})[_0xce1c('0x1f')](function(_0x48c96e){logger[_0xce1c('0x20')](_0xce1c('0xe'),_0x381de2,JSON[_0xce1c('0x21')](_0x48c96e));})[_0xce1c('0x22')](function(){logger[_0xce1c('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x381de2);_0x5db031[_0xce1c('0x23')]();});}else{logger[_0xce1c('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x381de2);_0x5db031[_0xce1c('0x23')]();}}else{var _0x270838=this;var _0x512719=apiai(_0x201fe8[0x0],{'language':_0x201fe8[0x1]||'en'});return _0x512719[_0xce1c('0x24')](this[_0xce1c('0x25')]['body'],{'sessionId':md5(this['interaction']['id'])})[_0xce1c('0x1e')](function(_0x2e4fdb){_0x270838[_0xce1c('0x1a')]['dialogflow']=_0x2e4fdb;_0x1d6b4e[_0xce1c('0x1a')]=_0x2e4fdb[_0xce1c('0x26')][_0xce1c('0x27')][_0xce1c('0x28')];return rpc[_0x491721+_0xce1c('0x1c')]['create'](_0x1d6b4e)[_0xce1c('0x1e')](function(_0x2635b2){logger[_0xce1c('0xd')](_0xce1c('0xe'),_0x381de2,_0x1d6b4e[_0xce1c('0x1a')]);if(_0x2e4fdb[_0xce1c('0x26')]['metadata'][_0xce1c('0x29')]){_0x5db031[_0xce1c('0x2a')]();}else{_0x5db031['stop']();}})[_0xce1c('0x1f')](function(_0x137cd7){logger[_0xce1c('0x20')](_0xce1c('0xe'),_0x381de2,JSON[_0xce1c('0x21')](_0x137cd7));_0x5db031[_0xce1c('0x2a')]();});})['catch'](function(_0x1dbd16){logger[_0xce1c('0x20')](_0xce1c('0xe'),_0x381de2,_0x1dbd16[_0xce1c('0x25')]);_0x5db031[_0xce1c('0x2a')]();});}}catch(_0x13dbfe){logger[_0xce1c('0x20')](_0xce1c('0xe'),_0x381de2,JSON[_0xce1c('0x21')](_0x13dbfe));_0x5db031[_0xce1c('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 4192760..c3b90ec 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff13=['priorityTrue','priorityFalse','next','findIndex','info','message','stringify','validate','lodash','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','stop','condition'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0xff13,0x165));var _0x3ff1=function(_0x558238,_0x235bad){_0x558238=_0x558238-0x0;var _0x1fc112=_0xff13[_0x558238];return _0x1fc112;};'use strict';var schema=require(_0x3ff1('0x0'));var _=require(_0x3ff1('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x3ff1('0x2'));var logger=require(_0x3ff1('0x3'))(_0x3ff1('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x3ff1('0x5')},'priorityTrue':{'type':_0x3ff1('0x6'),'message':_0x3ff1('0x7')},'priorityFalse':{'type':_0x3ff1('0x6'),'message':_0x3ff1('0x8')}});exports[_0x3ff1('0x9')]=function(_0x59dee,_0x2050e0){return function(_0x3f1574){try{var _0x20584c={'condition':htmlToText[_0x3ff1('0xa')](utils['getMustacheRender'](_0x2050e0[0x0],this),{'wordwrap':![]})[_0x3ff1('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2050e0[0x1],'priorityFalse':_0x2050e0[0x2]};var _0x239ef4=gotoif['validate'](_0x20584c,{'typecast':!![]});if(_0x239ef4[_0x3ff1('0xc')]){logger[_0x3ff1('0xd')](_0x3ff1('0xe'),_0x59dee,_[_0x3ff1('0xf')](_0x239ef4,'message')['join'](',\x20'));_0x3f1574[_0x3ff1('0x10')]();}else{try{var _0x6d1c0d=eval('('+_0x20584c[_0x3ff1('0x11')]+')');var _0x3877a5=_0x6d1c0d?_0x20584c[_0x3ff1('0x12')]:_0x20584c[_0x3ff1('0x13')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x59dee,_0x20584c[_0x3ff1('0x11')],_0x6d1c0d,_0x3877a5||_0x3ff1('0x14'));if(_0x3877a5){var _0x473f6e=_[_0x3ff1('0x15')](_0x3f1574['rules'](),{'p':_0x3877a5});if(_0x473f6e>=0x0){logger[_0x3ff1('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x59dee,_0x3877a5||_0x3ff1('0x14'),_0x473f6e);_0x3f1574[_0x3ff1('0x14')](_0x473f6e);}else{logger[_0x3ff1('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x59dee,_0x3877a5||_0x3ff1('0x14'));_0x3f1574[_0x3ff1('0x10')]();}}else{_0x3f1574[_0x3ff1('0x14')]();}}catch(_0x4f2cd8){logger[_0x3ff1('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x59dee,_0x4f2cd8[_0x3ff1('0x17')]);_0x3f1574['stop']();}}}catch(_0x59e082){logger[_0x3ff1('0xd')]('[%s][GOTOIF]\x20%s',_0x59dee,JSON[_0x3ff1('0x18')](_0x59e082));_0x3f1574[_0x3ff1('0x10')]();}};}; \ No newline at end of file +var _0x1c58=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next'];(function(_0xa99bcc,_0x168148){var _0x1554df=function(_0x48cd35){while(--_0x48cd35){_0xa99bcc['push'](_0xa99bcc['shift']());}};_0x1554df(++_0x168148);}(_0x1c58,0x7b));var _0x81c5=function(_0x43b9c3,_0x2dbb34){_0x43b9c3=_0x43b9c3-0x0;var _0xb30f08=_0x1c58[_0x43b9c3];return _0xb30f08;};'use strict';var schema=require(_0x81c5('0x0'));var _=require(_0x81c5('0x1'));var htmlToText=require(_0x81c5('0x2'));var utils=require(_0x81c5('0x3'));var logger=require('../../../../config/logger')(_0x81c5('0x4'));var gotoif=schema({'condition':{'type':_0x81c5('0x5'),'required':!![],'message':_0x81c5('0x6')},'priorityTrue':{'type':_0x81c5('0x7'),'message':_0x81c5('0x8')},'priorityFalse':{'type':'number','message':_0x81c5('0x9')}});exports[_0x81c5('0xa')]=function(_0x3dfe0e,_0x904983){return function(_0xbe9353){try{var _0x5a20b8={'condition':htmlToText[_0x81c5('0xb')](utils['getMustacheRender'](_0x904983[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x904983[0x1],'priorityFalse':_0x904983[0x2]};var _0x71aef6=gotoif[_0x81c5('0x0')](_0x5a20b8,{'typecast':!![]});if(_0x71aef6[_0x81c5('0xc')]){logger[_0x81c5('0xd')](_0x81c5('0xe'),_0x3dfe0e,_[_0x81c5('0xf')](_0x71aef6,'message')[_0x81c5('0x10')](',\x20'));_0xbe9353[_0x81c5('0x11')]();}else{try{var _0x36636b=eval('('+_0x5a20b8[_0x81c5('0x12')]+')');var _0x2a9b00=_0x36636b?_0x5a20b8['priorityTrue']:_0x5a20b8['priorityFalse'];logger[_0x81c5('0x13')](_0x81c5('0x14'),_0x3dfe0e,_0x5a20b8[_0x81c5('0x12')],_0x36636b,_0x2a9b00||_0x81c5('0x15'));if(_0x2a9b00){var _0x583ecb=_[_0x81c5('0x16')](_0xbe9353[_0x81c5('0x17')](),{'p':_0x2a9b00});if(_0x583ecb>=0x0){logger[_0x81c5('0x13')](_0x81c5('0x18'),_0x3dfe0e,_0x2a9b00||'next',_0x583ecb);_0xbe9353[_0x81c5('0x15')](_0x583ecb);}else{logger[_0x81c5('0x13')](_0x81c5('0x19'),_0x3dfe0e,_0x2a9b00||'next');_0xbe9353[_0x81c5('0x11')]();}}else{_0xbe9353[_0x81c5('0x15')]();}}catch(_0x602a0d){logger[_0x81c5('0xd')](_0x81c5('0x1a'),_0x3dfe0e,_0x602a0d[_0x81c5('0x1b')]);_0xbe9353[_0x81c5('0x11')]();}}}catch(_0x814a6){logger[_0x81c5('0xd')](_0x81c5('0xe'),_0x3dfe0e,JSON[_0x81c5('0x1c')](_0x814a6));_0xbe9353[_0x81c5('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 59b3847..f9e4904 100644 --- a/server/services/routing/server/applications/gotop.js +++ b/server/services/routing/server/applications/gotop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5553=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','validate','lodash','routing'];(function(_0x4304ee,_0x2ea2eb){var _0x3ee9c2=function(_0x516dfe){while(--_0x516dfe){_0x4304ee['push'](_0x4304ee['shift']());}};_0x3ee9c2(++_0x2ea2eb);}(_0x5553,0xce));var _0x3555=function(_0x3e6763,_0x5996c1){_0x3e6763=_0x3e6763-0x0;var _0x1cbaca=_0x5553[_0x3e6763];return _0x1cbaca;};'use strict';var schema=require(_0x3555('0x0'));var _=require(_0x3555('0x1'));var logger=require('../../../../config/logger')(_0x3555('0x2'));var gotop=schema({'priority':{'type':_0x3555('0x3'),'required':!![],'message':_0x3555('0x4')}});exports['consequence']=function(_0x198677,_0x128de4){return function(_0x13d4c3){try{var _0x87e684={'priority':_0x128de4[0x0]};var _0xcc01e8=gotop[_0x3555('0x0')](_0x87e684,{'typecast':!![]});if(_0xcc01e8[_0x3555('0x5')]){logger['error'](_0x3555('0x6'),_0x198677,_[_0x3555('0x7')](_0xcc01e8,'message')[_0x3555('0x8')](',\x20'));_0x13d4c3[_0x3555('0x9')]();}else{logger[_0x3555('0xa')](_0x3555('0xb'),_0x198677,_0x87e684['priority']);if(_0x87e684[_0x3555('0xc')]){var _0x33a282=_[_0x3555('0xd')](_0x13d4c3[_0x3555('0xe')](),{'p':_0x87e684[_0x3555('0xc')]});if(_0x33a282>=0x0){logger['info'](_0x3555('0xf'),_0x198677,_0x87e684[_0x3555('0xc')]||_0x3555('0x10'),_0x33a282);_0x13d4c3[_0x3555('0x10')](_0x33a282);}else{logger[_0x3555('0xa')](_0x3555('0x11'),_0x198677,_0x87e684[_0x3555('0xc')]||_0x3555('0x10'));_0x13d4c3[_0x3555('0x9')]();}}else{_0x13d4c3[_0x3555('0x10')]();}}}catch(_0x2788f3){logger[_0x3555('0x12')]('[%s][GOTOP]\x20%s',_0x198677,JSON['stringify'](_0x2788f3));_0x13d4c3[_0x3555('0x9')]();}};}; \ No newline at end of file +var _0x72a9=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules'];(function(_0x18819b,_0x7beb0){var _0xe437cd=function(_0x55de2f){while(--_0x55de2f){_0x18819b['push'](_0x18819b['shift']());}};_0xe437cd(++_0x7beb0);}(_0x72a9,0x1d2));var _0x972a=function(_0x3bd728,_0x592212){_0x3bd728=_0x3bd728-0x0;var _0x43205d=_0x72a9[_0x3bd728];return _0x43205d;};'use strict';var schema=require(_0x972a('0x0'));var _=require(_0x972a('0x1'));var logger=require(_0x972a('0x2'))(_0x972a('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x972a('0x4')}});exports['consequence']=function(_0x5836ea,_0x55b07f){return function(_0x34c82d){try{var _0x20e8c6={'priority':_0x55b07f[0x0]};var _0x38248c=gotop[_0x972a('0x0')](_0x20e8c6,{'typecast':!![]});if(_0x38248c[_0x972a('0x5')]){logger[_0x972a('0x6')](_0x972a('0x7'),_0x5836ea,_[_0x972a('0x8')](_0x38248c,_0x972a('0x9'))[_0x972a('0xa')](',\x20'));_0x34c82d[_0x972a('0xb')]();}else{logger[_0x972a('0xc')](_0x972a('0xd'),_0x5836ea,_0x20e8c6[_0x972a('0xe')]);if(_0x20e8c6['priority']){var _0x17001e=_[_0x972a('0xf')](_0x34c82d[_0x972a('0x10')](),{'p':_0x20e8c6[_0x972a('0xe')]});if(_0x17001e>=0x0){logger[_0x972a('0xc')](_0x972a('0x11'),_0x5836ea,_0x20e8c6[_0x972a('0xe')]||_0x972a('0x12'),_0x17001e);_0x34c82d['next'](_0x17001e);}else{logger[_0x972a('0xc')](_0x972a('0x13'),_0x5836ea,_0x20e8c6[_0x972a('0xe')]||_0x972a('0x12'));_0x34c82d[_0x972a('0xb')]();}}else{_0x34c82d[_0x972a('0x12')]();}}}catch(_0x3458d6){logger[_0x972a('0x6')]('[%s][GOTOP]\x20%s',_0x5836ea,JSON[_0x972a('0x14')](_0x3458d6));_0x34c82d[_0x972a('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index c7d646f..b3e2f36 100644 --- a/server/services/routing/server/applications/message.js +++ b/server/services/routing/server/applications/message.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b17=['contact','channel','chat','account','upperFirst','AccountId','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','next','stringify','error','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0b17,0x1a0));var _0x70b1=function(_0xa86f0e,_0x48f50b){_0xa86f0e=_0xa86f0e-0x0;var _0x31815f=_0x0b17[_0xa86f0e];return _0x31815f;};'use strict';var _=require(_0x70b1('0x0'));var utils=require(_0x70b1('0x1'));var logger=require('../../../../config/logger')(_0x70b1('0x2'));var rpc={'chatMessage':require(_0x70b1('0x3')),'openchannelMessage':require(_0x70b1('0x4')),'mailMessage':require(_0x70b1('0x5')),'smsMessage':require(_0x70b1('0x6')),'faxMessage':require(_0x70b1('0x7'))};exports['consequence']=function(_0x25a3d1,_0x172a52){return function(_0x65b400){try{var _0x45a472={'body':utils[_0x70b1('0x8')](_0x172a52[0x0],this),'ContactId':this[_0x70b1('0x9')]['id']};if(this[_0x70b1('0xa')]===_0x70b1('0xb')){_0x45a472['ChatWebsiteId']=this[_0x70b1('0xc')]['id'];}else{_0x45a472[_[_0x70b1('0xd')](this[_0x70b1('0xa')])+_0x70b1('0xe')]=this['account']['id'];}_0x45a472[_[_0x70b1('0xd')](this[_0x70b1('0xa')])+_0x70b1('0xf')]=this['interaction']['id'];if(rpc[this[_0x70b1('0xa')]+_0x70b1('0x10')]){return rpc[this[_0x70b1('0xa')]+_0x70b1('0x10')][_0x70b1('0x11')](_0x45a472)[_0x70b1('0x12')](function(_0xa14eff){logger[_0x70b1('0x13')](_0x70b1('0x14'),_0x25a3d1,_0x45a472['body']);_0x65b400[_0x70b1('0x15')]();})['catch'](function(_0x49a535){logger['error'](_0x70b1('0x14'),_0x25a3d1,JSON[_0x70b1('0x16')](_0x49a535));_0x65b400['stop']();});}}catch(_0x31003b){logger[_0x70b1('0x17')](_0x70b1('0x14'),_0x25a3d1,JSON[_0x70b1('0x16')](_0x31003b));_0x65b400[_0x70b1('0x18')]();}};}; \ No newline at end of file +var _0x1999=['ChatWebsiteId','account','channel','upperFirst','InteractionId','Message','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x1999,0x17e));var _0x9199=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x1999[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x9199('0x0'));var utils=require(_0x9199('0x1'));var logger=require(_0x9199('0x2'))(_0x9199('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9199('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9199('0x5'))};exports[_0x9199('0x6')]=function(_0x1a06bf,_0x158e40){return function(_0x4cd8e0){try{var _0x3e11c3={'body':utils[_0x9199('0x7')](_0x158e40[0x0],this),'ContactId':this[_0x9199('0x8')]['id']};if(this['channel']==='chat'){_0x3e11c3[_0x9199('0x9')]=this[_0x9199('0xa')]['id'];}else{_0x3e11c3[_['upperFirst'](this[_0x9199('0xb')])+'AccountId']=this[_0x9199('0xa')]['id'];}_0x3e11c3[_[_0x9199('0xc')](this[_0x9199('0xb')])+_0x9199('0xd')]=this['interaction']['id'];if(rpc[this[_0x9199('0xb')]+_0x9199('0xe')]){return rpc[this[_0x9199('0xb')]+_0x9199('0xe')]['create'](_0x3e11c3)[_0x9199('0xf')](function(_0x199498){logger['info'](_0x9199('0x10'),_0x1a06bf,_0x3e11c3[_0x9199('0x11')]);_0x4cd8e0[_0x9199('0x12')]();})[_0x9199('0x13')](function(_0x55a187){logger[_0x9199('0x14')](_0x9199('0x10'),_0x1a06bf,JSON[_0x9199('0x15')](_0x55a187));_0x4cd8e0[_0x9199('0x16')]();});}}catch(_0x4236e9){logger[_0x9199('0x14')](_0x9199('0x10'),_0x1a06bf,JSON[_0x9199('0x15')](_0x4236e9));_0x4cd8e0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 25fda68..792cc92 100644 --- a/server/services/routing/server/applications/noop.js +++ b/server/services/routing/server/applications/noop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x866e=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stop','./utils','routing','consequence'];(function(_0x51679b,_0x2d621c){var _0x4085f3=function(_0x14c945){while(--_0x14c945){_0x51679b['push'](_0x51679b['shift']());}};_0x4085f3(++_0x2d621c);}(_0x866e,0x85));var _0xe866=function(_0x49318e,_0x165bc7){_0x49318e=_0x49318e-0x0;var _0x245484=_0x866e[_0x49318e];return _0x245484;};'use strict';var utils=require(_0xe866('0x0'));var logger=require('../../../../config/logger')(_0xe866('0x1'));exports[_0xe866('0x2')]=function(_0x5bc7ce,_0xd7e0e3){return function(_0x16bcf1){try{logger['info'](_0xe866('0x3'),_0x5bc7ce,utils[_0xe866('0x4')](_0xd7e0e3[0x0],this));_0x16bcf1[_0xe866('0x5')]();}catch(_0x39ed91){logger[_0xe866('0x6')](_0xe866('0x3'),_0x5bc7ce,JSON['stringify'](_0x39ed91));_0x16bcf1[_0xe866('0x7')]();}};}; \ No newline at end of file +var _0x48a0=['info','[%s][NOOP]\x20%s','getMustacheRender','error','stop','../../../../config/logger','routing','consequence'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x48a0,0x1cd));var _0x048a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x48a0[_0x321bb2];return _0x9c12ed;};'use strict';var utils=require('./utils');var logger=require(_0x048a('0x0'))(_0x048a('0x1'));exports[_0x048a('0x2')]=function(_0x2e7d63,_0x12740f){return function(_0x5a3ba8){try{logger[_0x048a('0x3')](_0x048a('0x4'),_0x2e7d63,utils[_0x048a('0x5')](_0x12740f[0x0],this));_0x5a3ba8['next']();}catch(_0x101358){logger[_0x048a('0x6')]('[%s][NOOP]\x20%s',_0x2e7d63,JSON['stringify'](_0x101358));_0x5a3ba8[_0x048a('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 2939344..93ced61 100644 --- a/server/services/routing/server/applications/queue.js +++ b/server/services/routing/server/applications/queue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2be=['update','catch','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','close','strategy','rrmemory','beepall','stop','log','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','queue','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/mailQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','contact','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','name','QueueReport','create','error','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]'];(function(_0x4db767,_0x4aa893){var _0x1b5eb9=function(_0x101716){while(--_0x101716){_0x4db767['push'](_0x4db767['shift']());}};_0x1b5eb9(++_0x4aa893);}(_0xe2be,0xe5));var _0xee2b=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xe2be[_0x1cfa0d];return _0xe33279;};'use strict';var schema=require('validate');var _=require(_0xee2b('0x0'));var util=require(_0xee2b('0x1'));var seqqueue=require(_0xee2b('0x2'));var moment=require(_0xee2b('0x3'));var Redis=require(_0xee2b('0x4'));var config=require(_0xee2b('0x5'));var logger=require(_0xee2b('0x6'))('routing');var strategy=require(_0xee2b('0x7'));config[_0xee2b('0x8')]=_[_0xee2b('0x9')](config[_0xee2b('0x8')],{'host':_0xee2b('0xa'),'port':0x18eb});var io=require(_0xee2b('0xb'))(new Redis(config[_0xee2b('0x8')]));var attributes=['id',_0xee2b('0xc'),_0xee2b('0xd'),'queue',_0xee2b('0xe'),_0xee2b('0xf')];function emit(_0x3be618,_0x2bf0d0,_0x399261){io['to'](_0x3be618)['emit'](_0x2bf0d0,_0x399261);}function emitChannelQueueInteraction(_0x160378,_0x32aae7,_0xbf5448,_0x523456,_0x109548,_0x198261,_0x56fe98,_0x3cf6b3){_0xbf5448[_0xee2b('0xc')]=_0x3cf6b3;_0xbf5448[_0xee2b('0x10')]=_0x32aae7;_0xbf5448[_0xee2b('0xd')]=_0x523456;_0xbf5448['id']=_0x109548;if(_0x198261){_0x56fe98[util['format'](_0xee2b('0x11'),_0x160378)][_0x109548]=_[_0xee2b('0x12')](_0xbf5448,attributes);}else{delete _0x56fe98[util[_0xee2b('0x13')](_0xee2b('0x11'),_0x160378)][_0x109548];}emit(util[_0xee2b('0x13')](_0xee2b('0x14'),_0x160378,_0x32aae7),util[_0xee2b('0x13')](_0xee2b('0x15'),_0x160378,_0x198261?'save':_0xee2b('0x16')),_[_0xee2b('0x12')](_0xbf5448,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xee2b('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0xee2b('0x18'),'required':!![],'message':_0xee2b('0x19')},'timeout':{'type':_0xee2b('0x1a'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x51299b,_0x45034c,_0x28a6ff,_0x312ae1){if(_0x51299b&&_0x45034c&&_0x28a6ff){_0x45034c['waiting']+=0x1;var _0x562bac={'uniqueid':_0x51299b,'from':_0x28a6ff[_0xee2b('0x1b')]?_0x28a6ff['body'][_0xee2b('0xe')]:'','joinAt':moment()[_0xee2b('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x28a6ff[_0xee2b('0x1c')]?_0x28a6ff[_0xee2b('0x1c')]['id']:null,'ListId':_0x28a6ff['list']?_0x28a6ff['list']['id']:null};_0x562bac[_['upperFirst'](_0x28a6ff[_0xee2b('0x1d')])+_0xee2b('0x1e')]=_0x45034c['id']||null;_0x562bac[_[_0xee2b('0x1f')](_0x28a6ff[_0xee2b('0x1d')])+_0xee2b('0x20')]=_0x28a6ff[_0xee2b('0x21')]?_0x28a6ff[_0xee2b('0x21')]['id']:null;_0x562bac[_[_0xee2b('0x1f')](_0x28a6ff[_0xee2b('0x1d')])+_0xee2b('0x22')]=_0x28a6ff[_0xee2b('0x23')]?_0x28a6ff[_0xee2b('0x23')]['id']:null;_0x562bac[_[_0xee2b('0x1f')](_0x28a6ff[_0xee2b('0x1d')])+(_0x28a6ff[_0xee2b('0x1d')]!==_0xee2b('0x24')?'AccountId':_0xee2b('0x25'))]=_0x28a6ff['account']?_0x28a6ff['account']['id']:null;logger[_0xee2b('0x26')](util[_0xee2b('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x51299b,_0x45034c[_0xee2b('0x27')]));emitChannelQueueInteraction(_0x28a6ff['channel'],_0x45034c['name'],_0x562bac,_0x28a6ff[_0xee2b('0xd')][_0xee2b('0x27')],_0x28a6ff[_0xee2b('0x23')]['id'],!![],_0x312ae1,_0x45034c['id']);if(rpc[_0x28a6ff['channel']+_0xee2b('0x28')]){return rpc[_0x28a6ff[_0xee2b('0x1d')]+_0xee2b('0x28')][_0xee2b('0x29')](_0x562bac)['catch'](function(_0x1e6f50){logger[_0xee2b('0x2a')]('create\x20queue\x20report');});}}}function stopRouting(_0x4c26be,_0x3e3131,_0x49b117,_0x532111){if(_0x4c26be&&_0x3e3131){_0x3e3131[_0xee2b('0x2b')]-=0x1;var _0x999943={'leaveAt':moment()[_0xee2b('0x13')](_0xee2b('0x2c')),'acceptAt':moment()[_0xee2b('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xee2b('0x2d')};logger[_0xee2b('0x26')](util['format'](_0xee2b('0x2e'),_0x4c26be,_0x3e3131['name']));emitChannelQueueInteraction(_0x49b117[_0xee2b('0x1d')],_0x3e3131['name'],_0x49b117[_0xee2b('0x1b')],_0x49b117[_0xee2b('0xd')][_0xee2b('0x27')],_0x49b117[_0xee2b('0x23')]['id'],![],_0x532111,_0x3e3131['id']);if(rpc[_0x49b117[_0xee2b('0x1d')]+_0xee2b('0x28')]){return rpc[_0x49b117[_0xee2b('0x1d')]+_0xee2b('0x28')][_0xee2b('0x2f')](_0x4c26be,_0x999943)[_0xee2b('0x30')](function(_0x2ee5ad){logger[_0xee2b('0x2a')]('update\x20queue\x20report');});}}}function endRouting(_0x1ea0a9,_0x3d67de,_0x501d10,_0x1ab416){if(_0x1ea0a9&&_0x3d67de){_0x3d67de['waiting']-=0x1;var _0x13f87c={'leaveAt':moment()['format'](_0xee2b('0x2c')),'exitAt':moment()[_0xee2b('0x13')](_0xee2b('0x2c')),'reason':'timeout'};logger['info'](util[_0xee2b('0x13')](_0xee2b('0x31'),_0x1ea0a9,_0x3d67de[_0xee2b('0x27')]));emitChannelQueueInteraction(_0x501d10[_0xee2b('0x1d')],_0x3d67de[_0xee2b('0x27')],_0x501d10[_0xee2b('0x1b')],_0x501d10[_0xee2b('0xd')][_0xee2b('0x27')],_0x501d10[_0xee2b('0x23')]['id'],![],_0x1ab416);if(rpc[_0x501d10[_0xee2b('0x1d')]+_0xee2b('0x28')]){return rpc[_0x501d10[_0xee2b('0x1d')]+_0xee2b('0x28')][_0xee2b('0x2f')](_0x1ea0a9,_0x13f87c)[_0xee2b('0x30')](function(_0x5b07f8){logger[_0xee2b('0x2a')](_0xee2b('0x32'));});}}}function handleFindQueue(_0x5c6b3b){return function(_0x51b2af){return _0x51b2af['name'][_0xee2b('0x33')]()===_0x5c6b3b[_0xee2b('0x33')]();};}exports[_0xee2b('0x34')]=function(_0x49a2fe,_0x5aa128,_0x3ab2c7,_0x5cb9fa){return function(_0x1405b4){try{var _0x5a8586={'name':_0x5aa128[0x0],'timeout':_0x5aa128[0x1]};var _0x4f1dbd=queue['validate'](_0x5a8586,{'typecast':!![]});if(_0x4f1dbd[_0xee2b('0x35')]){logger[_0xee2b('0x2a')](_0xee2b('0x36'),_0x49a2fe,_[_0xee2b('0x37')](_0x4f1dbd,'message')['join'](',\x20'));_0x1405b4['stop']();}else{var _0x3eb3da=_['find'](_0x3ab2c7[_0x5cb9fa[_0xee2b('0x1d')]+_0xee2b('0x38')],handleFindQueue(_0x5a8586[_0xee2b('0x27')]));if(_0x3eb3da){startRouting(_0x49a2fe,_0x3eb3da,_0x5cb9fa,_0x3ab2c7);var _0x5600b6=(_0x3eb3da[_0xee2b('0x39')]||0xa)*0x3e8;var _0x261f6a=(_0x5a8586[_0xee2b('0x39')]||0x14)*0x3e8;var _0x534fbf,_0x19a226;if(_0x5600b6>_0x261f6a){_0x261f6a=_0x5600b6;}var _0x106e36=seqqueue[_0xee2b('0x3a')](_0x5600b6);_0x106e36['id']=_0x49a2fe;_0x106e36[_0xee2b('0x3b')]=_0x5600b6;_0x106e36[_0xee2b('0x3c')]=_0x261f6a;_0x106e36['channel']=_0x5cb9fa['channel'];_0x3ab2c7[_0xee2b('0x3d')][_0x49a2fe]['on'](_0xee2b('0x3e'),function(){stopRouting(_0x49a2fe,_0x3eb3da,_0x5cb9fa,_0x3ab2c7);_0x106e36[_0xee2b('0x3f')](!![]);clearTimeout(_0x534fbf);_0x534fbf=undefined;if(_0x3ab2c7[_0xee2b('0x3d')][_0x49a2fe]){delete _0x3ab2c7[_0xee2b('0x3d')][_0x49a2fe];}logger[_0xee2b('0x26')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x49a2fe);_0x1405b4['stop']();});_0x534fbf=setTimeout(function(){endRouting(_0x49a2fe,_0x3eb3da,_0x5cb9fa,_0x3ab2c7);clearTimeout(_0x534fbf);_0x106e36[_0xee2b('0x3f')](!![]);logger[_0xee2b('0x26')]('[%s][QUEUE]\x20ROUTING\x20END',_0x49a2fe);_0x1405b4['next']();},_0x261f6a);switch(_0x3eb3da[_0xee2b('0x40')]){case'rrmemory':strategy[_0xee2b('0x41')](_0x106e36,_0x3eb3da,_0x3ab2c7,_0x5cb9fa);break;default:strategy[_0xee2b('0x42')](_0x106e36,_0x3eb3da,_0x3ab2c7,_0x5cb9fa);}}else{logger[_0xee2b('0x2a')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x49a2fe,_0x5a8586[_0xee2b('0x27')]);_0x1405b4[_0xee2b('0x43')]();}}}catch(_0xe720c4){console[_0xee2b('0x44')](_0xe720c4);logger[_0xee2b('0x2a')](_0xee2b('0x36'),_0x49a2fe,_0xe720c4['stack']);_0x1405b4['stop']();}};}; \ No newline at end of file +var _0xecad=['catch','error','create\x20queue\x20report','waiting','accepted','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','end','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create'];(function(_0xda8538,_0x51b96b){var _0x4d5c4e=function(_0x268f73){while(--_0x268f73){_0xda8538['push'](_0xda8538['shift']());}};_0x4d5c4e(++_0x51b96b);}(_0xecad,0x1b2));var _0xdeca=function(_0x55d7c2,_0x4ce6fb){_0x55d7c2=_0x55d7c2-0x0;var _0x1755ef=_0xecad[_0x55d7c2];return _0x1755ef;};'use strict';var schema=require(_0xdeca('0x0'));var _=require(_0xdeca('0x1'));var util=require(_0xdeca('0x2'));var seqqueue=require(_0xdeca('0x3'));var moment=require('moment');var Redis=require(_0xdeca('0x4'));var config=require(_0xdeca('0x5'));var logger=require(_0xdeca('0x6'))(_0xdeca('0x7'));var strategy=require(_0xdeca('0x8'));config[_0xdeca('0x9')]=_[_0xdeca('0xa')](config[_0xdeca('0x9')],{'host':_0xdeca('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdeca('0x9')]));var attributes=['id',_0xdeca('0xc'),_0xdeca('0xd'),_0xdeca('0xe'),_0xdeca('0xf'),_0xdeca('0x10')];function emit(_0x232093,_0x47dc39,_0x1cb76d){io['to'](_0x232093)[_0xdeca('0x11')](_0x47dc39,_0x1cb76d);}function emitChannelQueueInteraction(_0x3f4107,_0x5aad53,_0x39e00f,_0x210221,_0x4aeec4,_0x33594d,_0x19ab1a,_0x391a5d){_0x39e00f[_0xdeca('0xc')]=_0x391a5d;_0x39e00f['queue']=_0x5aad53;_0x39e00f['account']=_0x210221;_0x39e00f['id']=_0x4aeec4;if(_0x33594d){_0x19ab1a[util['format'](_0xdeca('0x12'),_0x3f4107)][_0x4aeec4]=_[_0xdeca('0x13')](_0x39e00f,attributes);}else{delete _0x19ab1a[util[_0xdeca('0x14')](_0xdeca('0x12'),_0x3f4107)][_0x4aeec4];}emit(util[_0xdeca('0x14')](_0xdeca('0x15'),_0x3f4107,_0x5aad53),util['format'](_0xdeca('0x16'),_0x3f4107,_0x33594d?_0xdeca('0x17'):_0xdeca('0x18')),_['pick'](_0x39e00f,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xdeca('0x19')),'chatQueueReport':require(_0xdeca('0x1a')),'smsQueueReport':require(_0xdeca('0x1b')),'faxQueueReport':require(_0xdeca('0x1c'))};var queue=schema({'name':{'type':_0xdeca('0x1d'),'required':!![],'message':_0xdeca('0x1e')},'timeout':{'type':_0xdeca('0x1f'),'message':_0xdeca('0x20')}});function startRouting(_0xf72019,_0x18be0b,_0x347007,_0x9b86e1){if(_0xf72019&&_0x18be0b&&_0x347007){_0x18be0b['waiting']+=0x1;var _0x4e4bbd={'uniqueid':_0xf72019,'from':_0x347007['body']?_0x347007[_0xdeca('0x21')]['from']:'','joinAt':moment()[_0xdeca('0x14')](_0xdeca('0x22')),'ContactId':_0x347007['contact']?_0x347007[_0xdeca('0x23')]['id']:null,'ListId':_0x347007[_0xdeca('0x24')]?_0x347007[_0xdeca('0x24')]['id']:null};_0x4e4bbd[_['upperFirst'](_0x347007[_0xdeca('0x25')])+_0xdeca('0x26')]=_0x18be0b['id']||null;_0x4e4bbd[_[_0xdeca('0x27')](_0x347007[_0xdeca('0x25')])+_0xdeca('0x28')]=_0x347007[_0xdeca('0x29')]?_0x347007['interaction']['id']:null;_0x4e4bbd[_[_0xdeca('0x27')](_0x347007[_0xdeca('0x25')])+_0xdeca('0x2a')]=_0x347007[_0xdeca('0x2b')]?_0x347007[_0xdeca('0x2b')]['id']:null;_0x4e4bbd[_['upperFirst'](_0x347007[_0xdeca('0x25')])+(_0x347007[_0xdeca('0x25')]!==_0xdeca('0x2c')?_0xdeca('0x2d'):_0xdeca('0x2e'))]=_0x347007[_0xdeca('0xd')]?_0x347007[_0xdeca('0xd')]['id']:null;logger[_0xdeca('0x2f')](util[_0xdeca('0x14')](_0xdeca('0x30'),_0xf72019,_0x18be0b[_0xdeca('0x31')]));emitChannelQueueInteraction(_0x347007['channel'],_0x18be0b['name'],_0x4e4bbd,_0x347007[_0xdeca('0xd')]['name'],_0x347007[_0xdeca('0x2b')]['id'],!![],_0x9b86e1,_0x18be0b['id']);if(rpc[_0x347007[_0xdeca('0x25')]+_0xdeca('0x32')]){return rpc[_0x347007[_0xdeca('0x25')]+_0xdeca('0x32')][_0xdeca('0x33')](_0x4e4bbd)[_0xdeca('0x34')](function(_0x2ff48a){logger[_0xdeca('0x35')](_0xdeca('0x36'));});}}}function stopRouting(_0x4a7649,_0x53caf6,_0x53691f,_0x575c31){if(_0x4a7649&&_0x53caf6){_0x53caf6[_0xdeca('0x37')]-=0x1;var _0x135cb0={'leaveAt':moment()[_0xdeca('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xdeca('0x14')](_0xdeca('0x22')),'reason':_0xdeca('0x38')};logger[_0xdeca('0x2f')](util[_0xdeca('0x14')]('[%s][STOP:QUEUE][NAME:%s]',_0x4a7649,_0x53caf6[_0xdeca('0x31')]));emitChannelQueueInteraction(_0x53691f[_0xdeca('0x25')],_0x53caf6[_0xdeca('0x31')],_0x53691f[_0xdeca('0x21')],_0x53691f[_0xdeca('0xd')]['name'],_0x53691f[_0xdeca('0x2b')]['id'],![],_0x575c31,_0x53caf6['id']);if(rpc[_0x53691f[_0xdeca('0x25')]+_0xdeca('0x32')]){return rpc[_0x53691f[_0xdeca('0x25')]+_0xdeca('0x32')][_0xdeca('0x39')](_0x4a7649,_0x135cb0)[_0xdeca('0x34')](function(_0x29485a){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x23265f,_0x17ca7f,_0x925638,_0x84cc){if(_0x23265f&&_0x17ca7f){_0x17ca7f[_0xdeca('0x37')]-=0x1;var _0x463fa8={'leaveAt':moment()[_0xdeca('0x14')](_0xdeca('0x22')),'exitAt':moment()[_0xdeca('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xdeca('0x3a')};logger['info'](util['format'](_0xdeca('0x3b'),_0x23265f,_0x17ca7f['name']));emitChannelQueueInteraction(_0x925638['channel'],_0x17ca7f[_0xdeca('0x31')],_0x925638[_0xdeca('0x21')],_0x925638[_0xdeca('0xd')][_0xdeca('0x31')],_0x925638[_0xdeca('0x2b')]['id'],![],_0x84cc);if(rpc[_0x925638[_0xdeca('0x25')]+_0xdeca('0x32')]){return rpc[_0x925638[_0xdeca('0x25')]+_0xdeca('0x32')][_0xdeca('0x39')](_0x23265f,_0x463fa8)[_0xdeca('0x34')](function(_0x35376a){logger[_0xdeca('0x35')](_0xdeca('0x3c'));});}}}function handleFindQueue(_0x12f131){return function(_0x522c1e){return _0x522c1e[_0xdeca('0x31')][_0xdeca('0x3d')]()===_0x12f131[_0xdeca('0x3d')]();};}exports['consequence']=function(_0x11ba47,_0x6e27e1,_0x2a620a,_0x191772){return function(_0x3cf452){try{var _0x87af9f={'name':_0x6e27e1[0x0],'timeout':_0x6e27e1[0x1]};var _0x358230=queue['validate'](_0x87af9f,{'typecast':!![]});if(_0x358230['length']){logger[_0xdeca('0x35')](_0xdeca('0x3e'),_0x11ba47,_[_0xdeca('0x3f')](_0x358230,_0xdeca('0x2b'))[_0xdeca('0x40')](',\x20'));_0x3cf452[_0xdeca('0x41')]();}else{var _0xa6fd76=_[_0xdeca('0x42')](_0x2a620a[_0x191772['channel']+_0xdeca('0x43')],handleFindQueue(_0x87af9f[_0xdeca('0x31')]));if(_0xa6fd76){startRouting(_0x11ba47,_0xa6fd76,_0x191772,_0x2a620a);var _0x33b6c8=(_0xa6fd76['timeout']||0xa)*0x3e8;var _0x5c59e7=(_0x87af9f[_0xdeca('0x3a')]||0x14)*0x3e8;var _0x274d28,_0x6f4e8;if(_0x33b6c8>_0x5c59e7){_0x5c59e7=_0x33b6c8;}var _0x614154=seqqueue[_0xdeca('0x44')](_0x33b6c8);_0x614154['id']=_0x11ba47;_0x614154[_0xdeca('0x45')]=_0x33b6c8;_0x614154[_0xdeca('0x46')]=_0x5c59e7;_0x614154['channel']=_0x191772[_0xdeca('0x25')];_0x2a620a['rules'][_0x11ba47]['on'](_0xdeca('0x47'),function(){stopRouting(_0x11ba47,_0xa6fd76,_0x191772,_0x2a620a);_0x614154[_0xdeca('0x48')](!![]);clearTimeout(_0x274d28);_0x274d28=undefined;if(_0x2a620a[_0xdeca('0x49')][_0x11ba47]){delete _0x2a620a[_0xdeca('0x49')][_0x11ba47];}logger['info'](_0xdeca('0x4a'),_0x11ba47);_0x3cf452[_0xdeca('0x41')]();});_0x274d28=setTimeout(function(){endRouting(_0x11ba47,_0xa6fd76,_0x191772,_0x2a620a);clearTimeout(_0x274d28);_0x614154[_0xdeca('0x48')](!![]);logger[_0xdeca('0x2f')](_0xdeca('0x4b'),_0x11ba47);_0x3cf452[_0xdeca('0x4c')]();},_0x5c59e7);switch(_0xa6fd76[_0xdeca('0x4d')]){case _0xdeca('0x4e'):strategy[_0xdeca('0x4e')](_0x614154,_0xa6fd76,_0x2a620a,_0x191772);break;default:strategy[_0xdeca('0x4f')](_0x614154,_0xa6fd76,_0x2a620a,_0x191772);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x11ba47,_0x87af9f[_0xdeca('0x31')]);_0x3cf452['stop']();}}}catch(_0x4c1eb9){console['log'](_0x4c1eb9);logger['error'](_0xdeca('0x3e'),_0x11ba47,_0x4c1eb9[_0xdeca('0x50')]);_0x3cf452[_0xdeca('0x41')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 552a14b..303268e 100644 --- a/server/services/routing/server/applications/strategy/agent.js +++ b/server/services/routing/server/applications/strategy/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fda=['[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','../../../../../config/logger','routing','agent','realtime','squeue','push','handleRun','handleTimeout','bind','timeout','prototype','handleDrained'];(function(_0x3e6060,_0x6a7cec){var _0x2e2aa7=function(_0x289f4d){while(--_0x289f4d){_0x3e6060['push'](_0x3e6060['shift']());}};_0x2e2aa7(++_0x6a7cec);}(_0x2fda,0x186));var _0xa2fd=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2fda[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xa2fd('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0xa2fd('0x1'))(_0xa2fd('0x2'));var Agent=function(_0x25ffbf,_0x329784,_0x34cafb,_0x5a36d9){this['notificationId']=uuid['v4']();this['squeue']=_0x25ffbf;this[_0xa2fd('0x3')]=_0x329784;this[_0xa2fd('0x4')]=_0x34cafb;this['routing']=_0x5a36d9;this[_0xa2fd('0x5')][_0xa2fd('0x6')](this[_0xa2fd('0x7')]['bind'](this),this[_0xa2fd('0x8')][_0xa2fd('0x9')](this));this[_0xa2fd('0x5')]['on'](_0xa2fd('0xa'),this[_0xa2fd('0x8')][_0xa2fd('0x9')](this));this['squeue']['on']('drained',this['handleDrained'][_0xa2fd('0x9')](this));};Agent['prototype'][_0xa2fd('0x6')]=function(){this[_0xa2fd('0x5')]['push'](this['handleRun'][_0xa2fd('0x9')](this),this[_0xa2fd('0x8')][_0xa2fd('0x9')](this));};Agent[_0xa2fd('0xb')][_0xa2fd('0xc')]=function(){this[_0xa2fd('0x8')](!![]);};Agent['prototype']['handleRun']=function(_0x3a1708){logger['info'](_0xa2fd('0xd'),this['squeue']['id'],this[_0xa2fd('0x3')]['id']);if(_[_0xa2fd('0xe')](this[_0xa2fd('0x4')][_0xa2fd('0xf')][this['agent']['id']])){logger[_0xa2fd('0x10')](_0xa2fd('0x11'),this[_0xa2fd('0x5')]['id'],this[_0xa2fd('0x3')]['id']);setTimeout(this[_0xa2fd('0x6')]['bind'](this),0x3e8);}else{if(this[_0xa2fd('0x2')][_0xa2fd('0x12')]||util[_0xa2fd('0x13')](this[_0xa2fd('0x5')]['id'],this[_0xa2fd('0x4')][_0xa2fd('0xf')][this[_0xa2fd('0x3')]['id']],this[_0xa2fd('0x5')][_0xa2fd('0x14')],![])){this[_0xa2fd('0x4')][_0xa2fd('0xf')][this['agent']['id']][_0xa2fd('0x15')]=!![];this[_0xa2fd('0x4')][_0xa2fd('0xf')][this[_0xa2fd('0x3')]['id']][_0xa2fd('0x16')]=undefined;util['showNotification'](this[_0xa2fd('0x17')],this[_0xa2fd('0x5')]['id'],this[_0xa2fd('0x4')][_0xa2fd('0xf')][this[_0xa2fd('0x3')]['id']],null,this[_0xa2fd('0x2')]);util[_0xa2fd('0x18')](this[_0xa2fd('0x5')]['id'],this[_0xa2fd('0x4')]['agents'][this[_0xa2fd('0x3')]['id']],_0xa2fd('0x19')+(this[_0xa2fd('0x2')]['forcedOwnership']?':FORCED':''));}else{logger[_0xa2fd('0x10')](_0xa2fd('0x1a'),this[_0xa2fd('0x5')]['id'],this[_0xa2fd('0x3')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0xa2fd('0xb')][_0xa2fd('0x8')]=function(_0x359250){if(_[_0xa2fd('0xe')](this[_0xa2fd('0x4')][_0xa2fd('0xf')][this['agent']['id']])){return logger[_0xa2fd('0x10')](_0xa2fd('0x11'),this[_0xa2fd('0x5')]['id'],this[_0xa2fd('0x3')]['id']);}else{logger[_0xa2fd('0x10')](_0xa2fd('0x1b'),this['squeue']['id'],this[_0xa2fd('0x3')]['id']);util[_0xa2fd('0x1c')](this[_0xa2fd('0x17')],this[_0xa2fd('0x5')]['id'],this[_0xa2fd('0x4')][_0xa2fd('0xf')][this[_0xa2fd('0x3')]['id']],null,this[_0xa2fd('0x2')]);this['realtime'][_0xa2fd('0xf')][this[_0xa2fd('0x3')]['id']][_0xa2fd('0x15')]=![];this[_0xa2fd('0x4')]['agents'][this['agent']['id']]['busyQueue']=undefined;util[_0xa2fd('0x18')](this['squeue']['id'],this['realtime'][_0xa2fd('0xf')][this[_0xa2fd('0x3')]['id']],_0x359250?'STOP':_0xa2fd('0x1d'));}if(!_0x359250){setTimeout(this[_0xa2fd('0x6')][_0xa2fd('0x9')](this),0x3e8);}};function agent(_0x5bee76,_0x395713,_0x3ea243,_0x1722ef){return new Agent(_0x5bee76,_0x395713,_0x3ea243,_0x1722ef);}module[_0xa2fd('0x1e')]=agent; \ No newline at end of file +var _0x7122=['push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','writeLog','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','realtime','squeue'];(function(_0x4b0342,_0x5b071c){var _0xc62aa3=function(_0x501b2e){while(--_0x501b2e){_0x4b0342['push'](_0x4b0342['shift']());}};_0xc62aa3(++_0x5b071c);}(_0x7122,0x1a5));var _0x2712=function(_0x3f167e,_0x4ac069){_0x3f167e=_0x3f167e-0x0;var _0x61f8c8=_0x7122[_0x3f167e];return _0x61f8c8;};'use strict';var _=require(_0x2712('0x0'));var uuid=require(_0x2712('0x1'));var util=require(_0x2712('0x2'));var logger=require(_0x2712('0x3'))(_0x2712('0x4'));var Agent=function(_0x109dfd,_0x4849de,_0x1c02f2,_0x46736c){this[_0x2712('0x5')]=uuid['v4']();this['squeue']=_0x109dfd;this['agent']=_0x4849de;this[_0x2712('0x6')]=_0x1c02f2;this[_0x2712('0x4')]=_0x46736c;this[_0x2712('0x7')][_0x2712('0x8')](this[_0x2712('0x9')][_0x2712('0xa')](this),this['handleTimeout'][_0x2712('0xa')](this));this[_0x2712('0x7')]['on']('timeout',this[_0x2712('0xb')][_0x2712('0xa')](this));this[_0x2712('0x7')]['on'](_0x2712('0xc'),this[_0x2712('0xd')][_0x2712('0xa')](this));};Agent[_0x2712('0xe')][_0x2712('0x8')]=function(){this[_0x2712('0x7')]['push'](this[_0x2712('0x9')][_0x2712('0xa')](this),this['handleTimeout'][_0x2712('0xa')](this));};Agent['prototype']['handleDrained']=function(){this[_0x2712('0xb')](!![]);};Agent[_0x2712('0xe')]['handleRun']=function(_0x39090b){logger[_0x2712('0xf')](_0x2712('0x10'),this[_0x2712('0x7')]['id'],this[_0x2712('0x11')]['id']);if(_[_0x2712('0x12')](this[_0x2712('0x6')][_0x2712('0x13')][this[_0x2712('0x11')]['id']])){logger[_0x2712('0xf')](_0x2712('0x14'),this[_0x2712('0x7')]['id'],this['agent']['id']);setTimeout(this[_0x2712('0x8')]['bind'](this),0x3e8);}else{if(this[_0x2712('0x4')][_0x2712('0x15')]||util[_0x2712('0x16')](this[_0x2712('0x7')]['id'],this[_0x2712('0x6')]['agents'][this[_0x2712('0x11')]['id']],this[_0x2712('0x7')][_0x2712('0x17')],![])){this[_0x2712('0x6')][_0x2712('0x13')][this[_0x2712('0x11')]['id']][_0x2712('0x18')]=!![];this[_0x2712('0x6')]['agents'][this['agent']['id']][_0x2712('0x19')]=undefined;util[_0x2712('0x1a')](this[_0x2712('0x5')],this[_0x2712('0x7')]['id'],this[_0x2712('0x6')][_0x2712('0x13')][this[_0x2712('0x11')]['id']],null,this[_0x2712('0x4')]);util['writeLog'](this['squeue']['id'],this[_0x2712('0x6')][_0x2712('0x13')][this[_0x2712('0x11')]['id']],'RINGING'+(this[_0x2712('0x4')][_0x2712('0x15')]?_0x2712('0x1b'):''));}else{logger[_0x2712('0xf')](_0x2712('0x1c'),this['squeue']['id'],this[_0x2712('0x11')]['id']);setTimeout(this[_0x2712('0x8')][_0x2712('0xa')](this),0x3e8);}}};Agent[_0x2712('0xe')]['handleTimeout']=function(_0x5c3d1f){if(_[_0x2712('0x12')](this[_0x2712('0x6')][_0x2712('0x13')][this[_0x2712('0x11')]['id']])){return logger[_0x2712('0xf')](_0x2712('0x14'),this[_0x2712('0x7')]['id'],this['agent']['id']);}else{logger[_0x2712('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x2712('0x7')]['id'],this[_0x2712('0x11')]['id']);util[_0x2712('0x1d')](this[_0x2712('0x5')],this[_0x2712('0x7')]['id'],this['realtime'][_0x2712('0x13')][this['agent']['id']],null,this[_0x2712('0x4')]);this[_0x2712('0x6')][_0x2712('0x13')][this[_0x2712('0x11')]['id']][_0x2712('0x18')]=![];this['realtime']['agents'][this[_0x2712('0x11')]['id']][_0x2712('0x19')]=undefined;util[_0x2712('0x1e')](this['squeue']['id'],this['realtime'][_0x2712('0x13')][this[_0x2712('0x11')]['id']],_0x5c3d1f?'STOP':_0x2712('0x1f'));}if(!_0x5c3d1f){setTimeout(this[_0x2712('0x8')][_0x2712('0xa')](this),0x3e8);}};function agent(_0x5ad130,_0x2738d0,_0x3d4211,_0x24d559){return new Agent(_0x5ad130,_0x2738d0,_0x3d4211,_0x24d559);}module[_0x2712('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index c216582..db6e8ab 100644 --- a/server/services/routing/server/applications/strategy/beepall.js +++ b/server/services/routing/server/applications/strategy/beepall.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x657b=['routing','squeue','realtime','push','handleTimeout','bind','handleDrained','prototype','handleRun','isNil','queue','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','busy','busyQueue','name','showNotification','notificationId','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger'];(function(_0x408762,_0x1e2f39){var _0x5e9e3e=function(_0x1e4e3e){while(--_0x1e4e3e){_0x408762['push'](_0x408762['shift']());}};_0x5e9e3e(++_0x1e2f39);}(_0x657b,0x1ec));var _0xb657=function(_0x5043e1,_0x16e621){_0x5043e1=_0x5043e1-0x0;var _0x5cf1c5=_0x657b[_0x5043e1];return _0x5cf1c5;};'use strict';var _=require(_0xb657('0x0'));var uuid=require(_0xb657('0x1'));var util=require('./util');var logger=require(_0xb657('0x2'))(_0xb657('0x3'));var Beepall=function(_0x301c65,_0x497d40,_0xbbee35,_0xc76fe9){this['notificationId']=uuid['v4']();this[_0xb657('0x4')]=_0x301c65;this['queue']=_0x497d40;this[_0xb657('0x5')]=_0xbbee35;this[_0xb657('0x3')]=_0xc76fe9;this[_0xb657('0x4')][_0xb657('0x6')](this['handleRun']['bind'](this),this[_0xb657('0x7')][_0xb657('0x8')](this));this['squeue']['on']('timeout',this[_0xb657('0x7')][_0xb657('0x8')](this));this[_0xb657('0x4')]['on']('drained',this[_0xb657('0x9')][_0xb657('0x8')](this));};Beepall[_0xb657('0xa')][_0xb657('0x6')]=function(){this[_0xb657('0x4')][_0xb657('0x6')](this[_0xb657('0xb')]['bind'](this),this[_0xb657('0x7')][_0xb657('0x8')](this));};Beepall['prototype'][_0xb657('0x9')]=function(_0x3f1654){this[_0xb657('0x7')](!![]);};Beepall[_0xb657('0xa')][_0xb657('0xb')]=function(_0x4d94cb){var _0x525459=!![];if(!_[_0xb657('0xc')](this[_0xb657('0xd')])&&!_[_0xb657('0xc')](this[_0xb657('0xd')][_0xb657('0xe')])&&this[_0xb657('0xd')]['Agents']['length']>0x0){for(var _0x3d05c=0x0,_0x247b27;_0x3d05c0x0){for(var _0x45440b=0x0,_0x27f500;_0x45440b0x0&&_0x3e94b5[_0x465d88+_0xf153('0x29')]>=_0x3e94b5[_0x465d88+'Capacity']){writeLog(_0x5c9f44,_0x3e94b5,_0x465d88[_0xf153('0x2a')]()+_0xf153('0x2b'));return![];}}return!![];};exports['showNotification']=function(_0x16cdcd,_0x1c8590,_0x4e45f9,_0x17305d,_0x10295e){return sendNotification(!![],_0x16cdcd,_0x1c8590,_0x4e45f9,_0x17305d,_0x10295e);};exports[_0xf153('0x2c')]=function(_0x2b9a9c,_0x339e96,_0x258976,_0x441436,_0x3b5f4f){return sendNotification(![],_0x2b9a9c,_0x339e96,_0x258976,_0x441436,_0x3b5f4f);};exports[_0xf153('0x2d')]=writeLog; \ No newline at end of file +var _0x99e8=['toUpperCase','\x20MAXCAPACITY','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','split','name','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','notification:%s','save','info','isAgentAvailable','busy','BUSY','online','OFFLINE','hasOwnProperty','Capacity','CurrentCapacity'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x99e8,0x11b));var _0x899e=function(_0xea0f59,_0x5b7eaa){_0xea0f59=_0xea0f59-0x0;var _0x5b7f8f=_0x99e8[_0xea0f59];return _0x5b7f8f;};'use strict';var _=require(_0x899e('0x0'));var util=require(_0x899e('0x1'));var utils=require(_0x899e('0x2'));var Mustache=require(_0x899e('0x3'));var Redis=require(_0x899e('0x4'));var config=require(_0x899e('0x5'));var logger=require(_0x899e('0x6'))(_0x899e('0x7'));config['redis']=_[_0x899e('0x8')](config[_0x899e('0x9')],{'host':_0x899e('0xa'),'port':0x18eb});var io=require(_0x899e('0xb'))(new Redis(config[_0x899e('0x9')]));function emit(_0x348112,_0x3cc04e,_0x2f37cb){io['to'](_0x348112)[_0x899e('0xc')](_0x3cc04e,_0x2f37cb);}function sendNotification(_0x196ba9,_0x326b37,_0x87126a,_0x2d2dd3,_0x1e0bf3,_0x5bc53a){io['to'](util['format']('user:%s',_0x2d2dd3['name']))['emit']('user:save',_0x2d2dd3);var _0x4e1caa=_0x5bc53a||{};var _0x4df359=_0x87126a[_0x899e('0xd')]('.');var _0x2cf2b7={'uniqueid':_0x326b37,'channel':_0x4df359[0x0],'id':_0x4df359[0x1],'title':_0x4df359[0x0]+'\x20interaction','interactionId':_0x4df359[0x2],'queue':_0x1e0bf3?_0x1e0bf3[_0x899e('0xe')]:null,'sound':_0x4e1caa[_0x899e('0xf')][_0x899e('0x10')],'shake':_0x4e1caa[_0x899e('0xf')][_0x899e('0x11')]};try{if(!_0x4e1caa[_0x899e('0x12')]){_0x4e1caa[_0x899e('0x12')]={};}if(_0x1e0bf3){_0x4e1caa['body'][_0x899e('0x13')]=_0x1e0bf3;}else if(_0x4e1caa['body'][_0x899e('0x13')]){delete _0x4e1caa['body'][_0x899e('0x13')];}_0x2cf2b7[_0x899e('0x14')]=utils['getMustacheRender'](_0x4e1caa[_0x899e('0xf')][_0x899e('0x15')],_0x4e1caa);}catch(_0x1f96db){_0x2cf2b7[_0x899e('0x14')]=_0x899e('0x16');logger[_0x899e('0x17')](util[_0x899e('0x18')](_0x899e('0x19'),_0x326b37,_0x1f96db['message']));}io['to'](util[_0x899e('0x18')]('user:%s',_0x2d2dd3[_0x899e('0xe')]))['emit'](util[_0x899e('0x18')](_0x899e('0x1a'),_0x196ba9?_0x899e('0x1b'):'remove'),_0x2cf2b7);}function writeLog(_0x549574,_0x5acc4e,_0xb28f92){return logger[_0x899e('0x1c')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x549574,_0x5acc4e[_0x899e('0xe')],_0xb28f92));}exports[_0x899e('0x1d')]=function(_0x2466a3,_0x1f0530,_0x1dc6ec,_0x25a67d){if(_0x1f0530[_0x899e('0x1e')]){writeLog(_0x2466a3,_0x1f0530,_0x899e('0x1f'));return![];}if(!_0x1f0530[_0x899e('0x20')]){writeLog(_0x2466a3,_0x1f0530,_0x899e('0x21'));return![];}if(_0x1f0530[_0x1dc6ec+'Pause']){writeLog(_0x2466a3,_0x1f0530,'PAUSE');return![];}if(_0x25a67d&&_0x1f0530[_0x899e('0x22')](_0x1dc6ec+_0x899e('0x23'))&&_0x1f0530[_0x899e('0x22')](_0x1dc6ec+'CurrentCapacity')){if(_0x1f0530[_0x1dc6ec+_0x899e('0x23')]>0x0&&_0x1f0530[_0x1dc6ec+_0x899e('0x24')]>=_0x1f0530[_0x1dc6ec+'Capacity']){writeLog(_0x2466a3,_0x1f0530,_0x1dc6ec[_0x899e('0x25')]()+_0x899e('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x4123cb,_0x44fada,_0x119c46,_0x155717,_0x3ee4a9){return sendNotification(!![],_0x4123cb,_0x44fada,_0x119c46,_0x155717,_0x3ee4a9);};exports['hideNotification']=function(_0x394ed2,_0xa21f65,_0x274d01,_0x219dab,_0x39d3ff){return sendNotification(![],_0x394ed2,_0xa21f65,_0x274d01,_0x219dab,_0x39d3ff);};exports[_0x899e('0x27')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 43bc1bb..f89c622 100644 --- a/server/services/routing/server/applications/system.js +++ b/server/services/routing/server/applications/system.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ddf=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x563a40,_0x1d5d73){var _0xabe98f=function(_0xbd78c5){while(--_0xbd78c5){_0x563a40['push'](_0x563a40['shift']());}};_0xabe98f(++_0x1d5d73);}(_0x9ddf,0xfa));var _0xf9dd=function(_0x1779d1,_0x55acb6){_0x1779d1=_0x1779d1-0x0;var _0x2884e3=_0x9ddf[_0x1779d1];return _0x2884e3;};'use strict';var schema=require(_0xf9dd('0x0'));var sh=require(_0xf9dd('0x1'));var _=require('lodash');var utils=require(_0xf9dd('0x2'));var logger=require(_0xf9dd('0x3'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0xf9dd('0x4')}});exports['consequence']=function(_0x342c4c,_0xefebdb){return function(_0x43d3f4){try{var _0x38bf1e={'command':_0xefebdb[0x0]};var _0x2efa5f=system[_0xf9dd('0x0')](_0x38bf1e,{'typecast':!![]});if(_0x2efa5f['length']){logger[_0xf9dd('0x5')](_0xf9dd('0x6'),_0x342c4c,_[_0xf9dd('0x7')](_0x2efa5f,_0xf9dd('0x8'))[_0xf9dd('0x9')](',\x20'));logger[_0xf9dd('0xa')](_0xf9dd('0xb'),_0x342c4c);_0x43d3f4[_0xf9dd('0xc')]();}else{var _0x3442b1=this;var _0x3ee68a=utils[_0xf9dd('0xd')](_0xefebdb[0x0],this);logger[_0xf9dd('0xa')](_0xf9dd('0xe'),_0x342c4c,_0x3ee68a);sh[_0xf9dd('0xf')](_[_0xf9dd('0x10')](_0x3ee68a),function(_0xc25657,_0x81899e){logger[_0xf9dd('0xa')](_0xf9dd('0x11'),_0x342c4c,_0xc25657);if(_0xc25657==0x0){var _0x8006eb=_0x81899e[_0xf9dd('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0xefebdb[0x1])||_[_0xf9dd('0x13')](_0xefebdb[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x342c4c);_0x3442b1['body'][_0xefebdb[0x1]]=_0x8006eb;}else{logger[_0xf9dd('0xa')](_0xf9dd('0x14'),_0x342c4c,_0xefebdb[0x1],_0x8006eb);_0x3442b1[_0xf9dd('0x15')][_0xefebdb[0x1]]=_0x8006eb;}}_0x43d3f4[_0xf9dd('0xc')]();});}}catch(_0x2416f0){logger[_0xf9dd('0x5')](_0xf9dd('0x6'),_0x342c4c,_[_0xf9dd('0x16')](_0x2416f0)?JSON[_0xf9dd('0x17')](_0x2416f0):_0x2416f0);logger[_0xf9dd('0xa')](_0xf9dd('0xb'),_0x342c4c);_0x43d3f4['next']();}};}; \ No newline at end of file +var _0xacf9=['length','error','map','message','info','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','[%s][SYSTEM]\x20%s','stringify','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x2c286f,_0x5c75ce){var _0x5d8f64=function(_0x436490){while(--_0x436490){_0x2c286f['push'](_0x2c286f['shift']());}};_0x5d8f64(++_0x5c75ce);}(_0xacf9,0x1c1));var _0x9acf=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xacf9[_0x1d1779];return _0x2377e9;};'use strict';var schema=require('validate');var sh=require(_0x9acf('0x0'));var _=require(_0x9acf('0x1'));var utils=require(_0x9acf('0x2'));var logger=require(_0x9acf('0x3'))('routing');var system=schema({'command':{'type':_0x9acf('0x4'),'required':!![],'message':_0x9acf('0x5')}});exports[_0x9acf('0x6')]=function(_0x591210,_0x3e5ce9){return function(_0x3f6a1c){try{var _0xe11b5e={'command':_0x3e5ce9[0x0]};var _0x891e42=system['validate'](_0xe11b5e,{'typecast':!![]});if(_0x891e42[_0x9acf('0x7')]){logger[_0x9acf('0x8')]('[%s][SYSTEM]\x20%s',_0x591210,_[_0x9acf('0x9')](_0x891e42,_0x9acf('0xa'))['join'](',\x20'));logger[_0x9acf('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x591210);_0x3f6a1c[_0x9acf('0xc')]();}else{var _0x361414=this;var _0x25bbef=utils['getMustacheRender'](_0x3e5ce9[0x0],this);logger['info'](_0x9acf('0xd'),_0x591210,_0x25bbef);sh[_0x9acf('0xe')](_[_0x9acf('0xf')](_0x25bbef),function(_0x4baed6,_0x139f7a){logger[_0x9acf('0xb')](_0x9acf('0x10'),_0x591210,_0x4baed6);if(_0x4baed6==0x0){var _0x141779=_0x139f7a[_0x9acf('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x9acf('0x12')](_0x3e5ce9[0x1])||_[_0x9acf('0x13')](_0x3e5ce9[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x591210);_0x361414['body'][_0x3e5ce9[0x1]]=_0x141779;}else{logger[_0x9acf('0xb')](_0x9acf('0x14'),_0x591210,_0x3e5ce9[0x1],_0x141779);_0x361414[_0x9acf('0x15')][_0x3e5ce9[0x1]]=_0x141779;}}_0x3f6a1c[_0x9acf('0xc')]();});}}catch(_0x243178){logger['error'](_0x9acf('0x16'),_0x591210,_['isObject'](_0x243178)?JSON[_0x9acf('0x17')](_0x243178):_0x243178);logger[_0x9acf('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x591210);_0x3f6a1c[_0x9acf('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 52515f5..33e9e4b 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x4ee799,_0x22e2c2){var _0x26fe5b=function(_0x52b3e9){while(--_0x52b3e9){_0x4ee799['push'](_0x4ee799['shift']());}};_0x26fe5b(++_0x22e2c2);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file +var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x52683f,_0x5a0038){var _0x380ed4=function(_0x48e147){while(--_0x48e147){_0x52683f['push'](_0x52683f['shift']());}};_0x380ed4(++_0x5a0038);}(_0x7a54,0x106));var _0x47a5=function(_0x27ecf2,_0x52387c){_0x27ecf2=_0x27ecf2-0x0;var _0x4d83d3=_0x7a54[_0x27ecf2];return _0x4d83d3;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index d57b99c..5168b47 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ab4=['merge','body','contact','message','account','interaction','mustache','lodash','exports'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0x5ab4,0x9f));var _0x45ab=function(_0x159370,_0x3edec2){_0x159370=_0x159370-0x0;var _0x4a3c40=_0x5ab4[_0x159370];return _0x4a3c40;};'use strict';var Mustache=require(_0x45ab('0x0'));var _=require(_0x45ab('0x1'));module[_0x45ab('0x2')]={'getMustacheRender':function(_0x3be6fb,_0x40cdb2){return Mustache['render'](_0x3be6fb,_[_0x45ab('0x3')](_0x40cdb2[_0x45ab('0x4')],{'contact':_0x40cdb2[_0x45ab('0x5')],'message':_0x40cdb2[_0x45ab('0x6')],'account':_0x40cdb2[_0x45ab('0x7')],'interaction':_0x40cdb2[_0x45ab('0x8')],'list':_0x40cdb2['list']}))||'';}}; \ No newline at end of file +var _0x1c4d=['exports','render','merge','body','contact','account','list','lodash'];(function(_0x2042bc,_0x45d393){var _0x1ef98b=function(_0xfd0f52){while(--_0xfd0f52){_0x2042bc['push'](_0x2042bc['shift']());}};_0x1ef98b(++_0x45d393);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0xed40ad,_0x37a6af){_0xed40ad=_0xed40ad-0x0;var _0x546f6b=_0x1c4d[_0xed40ad];return _0x546f6b;};'use strict';var Mustache=require('mustache');var _=require(_0xd1c4('0x0'));module[_0xd1c4('0x1')]={'getMustacheRender':function(_0xb3a470,_0x4f505c){return Mustache[_0xd1c4('0x2')](_0xb3a470,_[_0xd1c4('0x3')](_0x4f505c[_0xd1c4('0x4')],{'contact':_0x4f505c[_0xd1c4('0x5')],'message':_0x4f505c['message'],'account':_0x4f505c[_0xd1c4('0x6')],'interaction':_0x4f505c['interaction'],'list':_0x4f505c[_0xd1c4('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index ab8b277..905c5ba 100644 --- a/server/services/routing/server/index.js +++ b/server/services/routing/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1725=['No\x20applications\x20to\x20execute','stack','channel','QueueReport','update','catch','message\x20is\x20empty','agents','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','appdata','split','push','dialogflow','slice','tag','TagId','format','%s:%s:%s','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','info','Applications\x20executed','stringify','matchPath','emit','end'];(function(_0xc769bd,_0x6dee19){var _0x55d784=function(_0x15e491){while(--_0x15e491){_0xc769bd['push'](_0xc769bd['shift']());}};_0x55d784(++_0x6dee19);}(_0x1725,0x134));var _0x5172=function(_0x1f2a61,_0x2b49ab){_0x1f2a61=_0x1f2a61-0x0;var _0x5013a9=_0x1725[_0x1f2a61];return _0x5013a9;};'use strict';var _=require(_0x5172('0x0'));var util=require(_0x5172('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x5172('0x2'));var BPromise=require(_0x5172('0x3'));var uuid=require(_0x5172('0x4'));var config=require(_0x5172('0x5'));var logger=require(_0x5172('0x6'))(_0x5172('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require(_0x5172('0x8')),'mailQueueReport':require(_0x5172('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x5172('0xa')),'faxQueueReport':require(_0x5172('0xb'))};var RuleEngine=require(_0x5172('0xc'));function getId(_0x2b13f3,_0x4b31ff,_0x2a0efd){return util['format'](_0x5172('0xd'),_0x2b13f3,_0x4b31ff||0x0,_0x2a0efd||0x0);}function getIntervals(_0x579669,_0x35454b){var _0x4e281a=[];if(!_[_0x5172('0xe')](_0x35454b[_0x5172('0xf')])&&!_[_0x5172('0xe')](_0x579669[_0x35454b[_0x5172('0xf')]])&&!_[_0x5172('0xe')](_0x579669[_0x35454b[_0x5172('0xf')]][_0x5172('0x10')])){_0x4e281a=_[_0x5172('0x11')](_0x579669[_0x35454b['IntervalId']][_0x5172('0x10')],'interval');}else if(!_[_0x5172('0xe')](_0x35454b[_0x5172('0x12')])){_0x4e281a=[_0x35454b['interval']];}return _0x4e281a;}exports[_0x5172('0x13')]=function(_0x57c4aa){_0x57c4aa[_0x5172('0x14')]={};return new BPromise(function(_0x2885cc,_0x389838){var _0x1b1637={'Start':function(_0x2c3172){var _0x683e64=this;return new Promise(function(_0x422917,_0xb8380){if(_0x2c3172){try{var _0x6b75ec=[];var _0x218b88=getId(_0x2c3172['channel'],_0x2c3172['message']?_0x2c3172[_0x5172('0x15')]['id']:0x0,_0x2c3172[_0x5172('0x16')]?_0x2c3172['interaction']['id']:0x0);if(_0x2c3172[_0x5172('0x17')]&&_[_0x5172('0x18')](_0x2c3172['applications'])&&_0x2c3172[_0x5172('0x17')][_0x5172('0x19')]){for(var _0x34c8b6=0x0;_0x34c8b6<_0x2c3172[_0x5172('0x17')][_0x5172('0x19')];_0x34c8b6+=0x1){var _0x466e72=_0x2c3172[_0x5172('0x17')][_0x34c8b6];if(fs[_0x5172('0x1a')](path[_0x5172('0x1b')](__dirname,_0x5172('0x17'),_0x466e72[_0x5172('0x1c')]+'.js'))){var _0x5cd8c1=[];switch(_0x466e72[_0x5172('0x1c')][_0x5172('0x1d')]()){case'autoreply':var _0x6acbb9=_0x466e72[_0x5172('0x1e')][_0x5172('0x1f')](',');_0x5cd8c1[_0x5172('0x20')](_0x6acbb9[0x0]);_0x5cd8c1[_0x5172('0x20')](_0x6acbb9['slice'](0x1,_0x6acbb9[_0x5172('0x19')])[_0x5172('0x1b')](','));break;case _0x5172('0x21'):var _0x6acbb9=_0x466e72['appdata']['split'](',');_0x5cd8c1[_0x5172('0x20')](_0x6acbb9[0x0]);_0x5cd8c1['push'](_0x6acbb9[0x1]);_0x5cd8c1[_0x5172('0x20')](_0x6acbb9['slice'](0x2,_0x6acbb9[_0x5172('0x19')])['join'](','));break;case'amazonlex':var _0x6acbb9=_0x466e72[_0x5172('0x1e')][_0x5172('0x1f')](',');_0x5cd8c1[_0x5172('0x20')](_0x6acbb9[0x0]);_0x5cd8c1[_0x5172('0x20')](_0x6acbb9[0x1]);_0x5cd8c1[_0x5172('0x20')](_0x6acbb9[0x2]);_0x5cd8c1[_0x5172('0x20')](_0x6acbb9[0x3]);_0x5cd8c1[_0x5172('0x20')](_0x6acbb9[_0x5172('0x22')](0x4,_0x6acbb9['length'])[_0x5172('0x1b')](','));break;case _0x5172('0x15'):_0x5cd8c1[_0x5172('0x20')](_0x466e72[_0x5172('0x1e')]);break;case _0x5172('0x23'):_0x5cd8c1[_0x5172('0x20')](_0x466e72[_0x5172('0x24')]);_0x5cd8c1['push'](_0x466e72[_0x5172('0x1e')]);break;default:_0x5cd8c1=_['isNil'](_0x466e72[_0x5172('0x1e')])?[]:_0x466e72['appdata'][_0x5172('0x1f')](',');}var _0x31b56c={'id':util[_0x5172('0x25')](_0x5172('0x26'),_0x218b88,_0x466e72['id'],_0x466e72[_0x5172('0x1c')]),'condition':require('./interval')[_0x5172('0x27')](_0x218b88,getIntervals(_0x57c4aa[_0x5172('0x28')],_0x466e72),_0x57c4aa),'consequence':require(_0x5172('0x29')+_0x466e72[_0x5172('0x1c')])[_0x5172('0x2a')](_0x218b88,_0x5cd8c1,_0x57c4aa,_0x2c3172),'p':_0x466e72[_0x5172('0x2b')]||0x0};logger['info'](_0x5172('0x2c'),_0x31b56c['id'],'on\x20interval',getIntervals(_0x57c4aa['intervals'],_0x466e72)[_0x5172('0x1b')](_0x5172('0x2d')));_0x6b75ec[_0x5172('0x20')](_0x31b56c);}else{logger[_0x5172('0x2e')](_0x5172('0x2f'),path['join'](__dirname,'applications',_0x466e72[_0x5172('0x1c')]+_0x5172('0x30')));}}_0x57c4aa[_0x5172('0x14')][_0x218b88]=new RuleEngine(_0x6b75ec);_0x57c4aa['rules'][_0x218b88][_0x5172('0x31')](_0x2c3172,function(_0x29ba23){logger[_0x5172('0x32')](_0x5172('0x33'),JSON[_0x5172('0x34')](_0x29ba23[_0x5172('0x35')]));if(_0x57c4aa[_0x5172('0x14')][_0x218b88]){_0x57c4aa['rules'][_0x218b88][_0x5172('0x36')](_0x5172('0x37'));}});return _0x422917({'code':0xc8,'message':_0x2c3172});}else{logger[_0x5172('0x32')](_0x5172('0x38'));return _0x422917({'code':0xc8,'message':_0x2c3172});}}catch(_0x110b01){logger[_0x5172('0x2e')](_0x110b01[_0x5172('0x39')]);return _0xb8380(_0x683e64['error'](0x1f4,_0x110b01));}}return _0xb8380('routing\x20is\x20empty');});},'AcceptMessage':function(_0x43f392){var _0x2c9b8f=this;return new Promise(function(_0x4d3bc5,_0x566122){if(_0x43f392[_0x5172('0x15')]&&_0x43f392['message']['id']){try{var _0x4ed28b=getId(_0x43f392[_0x5172('0x3a')],_0x43f392['message']?_0x43f392[_0x5172('0x15')]['id']:0x0,_0x43f392[_0x5172('0x16')]?_0x43f392[_0x5172('0x16')]['id']:0x0);if(_0x57c4aa[_0x5172('0x14')][_0x4ed28b]){_0x57c4aa['rules'][_0x4ed28b]['emit'](_0x5172('0x37'));if(rpc[_0x43f392['channel']+_0x5172('0x3b')]){rpc[_0x43f392[_0x5172('0x3a')]+_0x5172('0x3b')][_0x5172('0x3c')](_0x4ed28b,{'UserId':_0x43f392['message']['UserId']})[_0x5172('0x3d')](function(_0x20c529){logger['error']('error\x20update\x20queue\x20report');});}}return _0x4d3bc5({'code':0xc8,'message':_0x43f392});}catch(_0x52fb7f){logger[_0x5172('0x2e')](_0x52fb7f[_0x5172('0x39')]);return _0x566122(_0x2c9b8f['error'](0x1f4,_0x52fb7f));}}logger[_0x5172('0x2e')](_0x5172('0x3e'));return _0x566122(_0x2c9b8f[_0x5172('0x2e')](0x1f4,_0x5172('0x3e')));});},'RejectMessage':function(_0xb2daff){var _0x236966=this;return new Promise(function(_0x140348,_0x323fef){if(_0xb2daff['agent']&&_0xb2daff['agent']['id']){try{if(_0x57c4aa[_0x5172('0x3f')][_0xb2daff['agent']['id']]){_0x57c4aa[_0x5172('0x3f')][_0xb2daff['agent']['id']][_0x5172('0x40')]=![];_0x57c4aa[_0x5172('0x3f')][_0xb2daff['agent']['id']]['busyQueue']=undefined;}return _0x140348({'code':0xc8,'message':_0xb2daff});}catch(_0x7785b8){logger[_0x5172('0x2e')](_0x7785b8[_0x5172('0x39')]);return _0x323fef(_0x236966[_0x5172('0x2e')](0x1f4,_0x7785b8));}}logger[_0x5172('0x2e')]('message\x20is\x20empty');return _0x323fef(_0x236966[_0x5172('0x2e')](0x1f4,_0x5172('0x3e')));});},'AbandonInteraction':function(_0x444f02){var _0x54f457=this;return new Promise(function(_0x3e5cc4,_0x38a94c){if(_0x444f02['channel']&&_0x444f02[_0x5172('0x16')]&&_0x444f02[_0x5172('0x16')]['id']){try{var _0x93e62=getId(_0x444f02['channel'],_0x444f02[_0x5172('0x15')]?_0x444f02[_0x5172('0x15')]['id']:0x0,_0x444f02[_0x5172('0x16')]?_0x444f02[_0x5172('0x16')]['id']:0x0);if(_0x57c4aa[_0x5172('0x14')][_0x93e62]){_0x57c4aa['rules'][_0x93e62][_0x5172('0x36')](_0x5172('0x37'));}return _0x3e5cc4({'code':0xc8,'message':_0x444f02});}catch(_0x2bdebf){logger[_0x5172('0x2e')](_0x2bdebf['stack']);return _0x38a94c(_0x54f457[_0x5172('0x2e')](0x1f4,_0x2bdebf));}}logger[_0x5172('0x2e')]('message\x20is\x20empty');return _0x38a94c(_0x54f457[_0x5172('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3f67aa){var _0x16638b=this;return new Promise(function(_0x30eca4,_0x566e2c){if(_0x57c4aa['agents'][_0x5172('0x41')](_0x3f67aa['id'])){for(var _0xa54c09 in _0x3f67aa[_0x5172('0x42')]){if(_0x3f67aa[_0x5172('0x42')][_0x5172('0x41')](_0xa54c09)){if(_0x57c4aa['agents'][_0x3f67aa['id']][_0x5172('0x41')](_0xa54c09+_0x5172('0x43'))){_0x57c4aa[_0x5172('0x3f')][_0x3f67aa['id']][_0xa54c09+_0x5172('0x43')]=parseInt(_0x3f67aa['capacity'][_0xa54c09],0xa);}}}_0x57c4aa[_0x5172('0x3f')][_0x3f67aa['id']][_0x5172('0x44')]();return _0x30eca4({'code':0xc8,'message':_0x57c4aa[_0x5172('0x3f')][_0x3f67aa['id']]});}else{return _0x566e2c(_0x16638b['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x119f63){return new Promise(function(_0x160cfc,_0x58915a){var _0x10db50=_[_0x5172('0x45')](_0x57c4aa[_0x5172('0x3f')]);_0x160cfc({'count':_0x10db50[_0x5172('0x19')],'rows':_0x10db50});});},'ChatQueues':function(_0x182847){return new Promise(function(_0x346e78,_0x3784fa){var _0x250ea8=[];for(var _0x3f3fc4 in _0x57c4aa[_0x5172('0x46')]){if(_0x57c4aa['chatQueues'][_0x5172('0x41')](_0x3f3fc4)){var _0x2a481c=_0x57c4aa['chatQueues'][_0x3f3fc4];var _0x47ba75={'id':_0x2a481c['id'],'available':_0x2a481c[_0x5172('0x47')],'loggedIn':_0x2a481c[_0x5172('0x48')],'name':_0x2a481c[_0x5172('0x49')],'paused':_0x2a481c[_0x5172('0x4a')],'waiting':_0x2a481c[_0x5172('0x4b')]};_0x250ea8['push'](_0x47ba75);}}_0x346e78({'count':_0x250ea8['length'],'rows':_0x250ea8});});},'MailQueues':function(_0xe2027a){return new Promise(function(_0x3c5870,_0x5daf9d){var _0x488f29=[];for(var _0x42e86f in _0x57c4aa[_0x5172('0x4c')]){if(_0x57c4aa[_0x5172('0x4c')][_0x5172('0x41')](_0x42e86f)){var _0x22eea3=_0x57c4aa[_0x5172('0x4c')][_0x42e86f];var _0x2303d1={'id':_0x22eea3['id'],'available':_0x22eea3[_0x5172('0x47')],'loggedIn':_0x22eea3[_0x5172('0x48')],'name':_0x22eea3['name'],'paused':_0x22eea3['paused'],'waiting':_0x22eea3['waiting']};_0x488f29[_0x5172('0x20')](_0x2303d1);}}_0x3c5870({'count':_0x488f29[_0x5172('0x19')],'rows':_0x488f29});});},'OpenchannelQueues':function(_0x1e36e4){return new Promise(function(_0x49cd60,_0x3be3c2){var _0x513127=[];for(var _0x5d8af1 in _0x57c4aa[_0x5172('0x4d')]){if(_0x57c4aa[_0x5172('0x4d')][_0x5172('0x41')](_0x5d8af1)){var _0x4914e3=_0x57c4aa[_0x5172('0x4d')][_0x5d8af1];var _0x2e79bb={'id':_0x4914e3['id'],'available':_0x4914e3[_0x5172('0x47')],'loggedIn':_0x4914e3[_0x5172('0x48')],'name':_0x4914e3[_0x5172('0x49')],'paused':_0x4914e3[_0x5172('0x4a')],'waiting':_0x4914e3[_0x5172('0x4b')]};_0x513127['push'](_0x2e79bb);}}_0x49cd60({'count':_0x513127[_0x5172('0x19')],'rows':_0x513127});});},'SmsQueues':function(_0x3f3221){return new Promise(function(_0x4bf516,_0x528497){var _0x293c98=[];for(var _0x51960b in _0x57c4aa[_0x5172('0x4e')]){if(_0x57c4aa['smsQueues'][_0x5172('0x41')](_0x51960b)){var _0x25707c=_0x57c4aa[_0x5172('0x4e')][_0x51960b];var _0x36710d={'id':_0x25707c['id'],'available':_0x25707c['available'],'loggedIn':_0x25707c[_0x5172('0x48')],'name':_0x25707c[_0x5172('0x49')],'paused':_0x25707c[_0x5172('0x4a')],'waiting':_0x25707c[_0x5172('0x4b')]};_0x293c98[_0x5172('0x20')](_0x36710d);}}_0x4bf516({'count':_0x293c98[_0x5172('0x19')],'rows':_0x293c98});});},'FaxQueues':function(_0xab4a81){return new Promise(function(_0x49c86e,_0xb755cf){var _0x5cd407=[];for(var _0x437313 in _0x57c4aa['faxQueues']){if(_0x57c4aa['faxQueues'][_0x5172('0x41')](_0x437313)){var _0x361e31=_0x57c4aa[_0x5172('0x4f')][_0x437313];var _0xdb8363={'id':_0x361e31['id'],'available':_0x361e31[_0x5172('0x47')],'loggedIn':_0x361e31['loggedIn'],'name':_0x361e31['name'],'paused':_0x361e31['paused'],'waiting':_0x361e31['waiting']};_0x5cd407['push'](_0xdb8363);}}_0x49c86e({'count':_0x5cd407[_0x5172('0x19')],'rows':_0x5cd407});});},'ChatQueuesWaitingInteractions':function(_0x376785){return new Promise(function(_0x4b40bc,_0x511349){var _0x3c3218=_[_0x5172('0x45')](_0x57c4aa[_0x5172('0x50')]);_0x4b40bc({'count':_0x3c3218[_0x5172('0x19')],'rows':_0x3c3218});});},'MailQueuesWaitingInteractions':function(_0x19107f){return new Promise(function(_0x3fbe12,_0x67d85a){var _0x425e9b=_[_0x5172('0x45')](_0x57c4aa[_0x5172('0x51')]);_0x3fbe12({'count':_0x425e9b[_0x5172('0x19')],'rows':_0x425e9b});});},'OpenchannelQueuesWaitingInteractions':function(_0x5f1fd5){return new Promise(function(_0x5591cc,_0xf38786){var _0x3449cd=_[_0x5172('0x45')](_0x57c4aa[_0x5172('0x52')]);_0x5591cc({'count':_0x3449cd[_0x5172('0x19')],'rows':_0x3449cd});});},'SmsQueuesWaitingInteractions':function(_0xe63302){return new Promise(function(_0x59ee1b,_0x4f2558){var _0x703b0e=_[_0x5172('0x45')](_0x57c4aa[_0x5172('0x53')]);_0x59ee1b({'count':_0x703b0e[_0x5172('0x19')],'rows':_0x703b0e});});},'FaxQueuesWaitingInteractions':function(_0x3093bd){return new Promise(function(_0x528a2c,_0x346e4e){var _0x377242=_[_0x5172('0x45')](_0x57c4aa[_0x5172('0x54')]);_0x528a2c({'count':_0x377242['length'],'rows':_0x377242});});}};var _0x5f25d9=jayson[_0x5172('0x55')](_0x1b1637)[_0x5172('0x56')]();_0x5f25d9['on'](_0x5172('0x2e'),function(_0x4f8b4b){logger[_0x5172('0x2e')](JSON[_0x5172('0x34')](_0x4f8b4b));return _0x389838(_0x4f8b4b);});_0x5f25d9['listen'](0x232c,_0x5172('0x57'),function(){console[_0x5172('0x58')](_0x5172('0x59'),0x232c);return _0x2885cc(_0x5172('0x5a')+0x232c);});});}; \ No newline at end of file +var _0xb74a=['consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','Applications\x20executed','stringify','matchPath','emit','end','routing\x20is\x20empty','channel','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agent','busy','agents','busyQueue','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','available','smsQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','lodash','util','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','message','interaction','applications','length','existsSync','app','appdata','split','push','slice','join','dialogflow','amazonlex','tag','%s:%s:%s','./interval','intervals'];(function(_0x2389aa,_0x5b3b19){var _0x86ec03=function(_0x38117b){while(--_0x38117b){_0x2389aa['push'](_0x2389aa['shift']());}};_0x86ec03(++_0x5b3b19);}(_0xb74a,0x11a));var _0xab74=function(_0x18cb92,_0x30f801){_0x18cb92=_0x18cb92-0x0;var _0x3e4570=_0xb74a[_0x18cb92];return _0x3e4570;};'use strict';var _=require(_0xab74('0x0'));var util=require(_0xab74('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xab74('0x2'));var uuid=require('uuid');var config=require(_0xab74('0x3'));var logger=require('../../../config/logger')(_0xab74('0x4'));var rpc={'openchannelQueueReport':require(_0xab74('0x5'))};var rpc={'openchannelQueueReport':require(_0xab74('0x5')),'mailQueueReport':require(_0xab74('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xab74('0x7')),'faxQueueReport':require(_0xab74('0x8'))};var RuleEngine=require(_0xab74('0x9'));function getId(_0x419fe1,_0x166cf8,_0x13298e){return util['format'](_0xab74('0xa'),_0x419fe1,_0x166cf8||0x0,_0x13298e||0x0);}function getIntervals(_0x58820f,_0x17bc15){var _0x16b8f7=[];if(!_['isNil'](_0x17bc15[_0xab74('0xb')])&&!_[_0xab74('0xc')](_0x58820f[_0x17bc15['IntervalId']])&&!_[_0xab74('0xc')](_0x58820f[_0x17bc15['IntervalId']][_0xab74('0xd')])){_0x16b8f7=_['map'](_0x58820f[_0x17bc15[_0xab74('0xb')]][_0xab74('0xd')],_0xab74('0xe'));}else if(!_[_0xab74('0xc')](_0x17bc15[_0xab74('0xe')])){_0x16b8f7=[_0x17bc15['interval']];}return _0x16b8f7;}exports[_0xab74('0xf')]=function(_0x5335aa){_0x5335aa[_0xab74('0x10')]={};return new BPromise(function(_0x96f9ce,_0x15f329){var _0xda5d2b={'Start':function(_0x11f6f7){var _0xd9ee7=this;return new Promise(function(_0x1b969f,_0x288965){if(_0x11f6f7){try{var _0x3619c5=[];var _0xc41277=getId(_0x11f6f7['channel'],_0x11f6f7[_0xab74('0x11')]?_0x11f6f7['message']['id']:0x0,_0x11f6f7[_0xab74('0x12')]?_0x11f6f7[_0xab74('0x12')]['id']:0x0);if(_0x11f6f7['applications']&&_['isArray'](_0x11f6f7['applications'])&&_0x11f6f7[_0xab74('0x13')][_0xab74('0x14')]){for(var _0x28d777=0x0;_0x28d777<_0x11f6f7[_0xab74('0x13')]['length'];_0x28d777+=0x1){var _0x2021aa=_0x11f6f7[_0xab74('0x13')][_0x28d777];if(fs[_0xab74('0x15')](path['join'](__dirname,_0xab74('0x13'),_0x2021aa[_0xab74('0x16')]+'.js'))){var _0x31514a=[];switch(_0x2021aa['app']['toLowerCase']()){case'autoreply':var _0x1cddc3=_0x2021aa[_0xab74('0x17')][_0xab74('0x18')](',');_0x31514a['push'](_0x1cddc3[0x0]);_0x31514a[_0xab74('0x19')](_0x1cddc3[_0xab74('0x1a')](0x1,_0x1cddc3[_0xab74('0x14')])[_0xab74('0x1b')](','));break;case _0xab74('0x1c'):var _0x1cddc3=_0x2021aa['appdata'][_0xab74('0x18')](',');_0x31514a[_0xab74('0x19')](_0x1cddc3[0x0]);_0x31514a['push'](_0x1cddc3[0x1]);_0x31514a[_0xab74('0x19')](_0x1cddc3[_0xab74('0x1a')](0x2,_0x1cddc3[_0xab74('0x14')])['join'](','));break;case _0xab74('0x1d'):var _0x1cddc3=_0x2021aa[_0xab74('0x17')][_0xab74('0x18')](',');_0x31514a[_0xab74('0x19')](_0x1cddc3[0x0]);_0x31514a[_0xab74('0x19')](_0x1cddc3[0x1]);_0x31514a[_0xab74('0x19')](_0x1cddc3[0x2]);_0x31514a[_0xab74('0x19')](_0x1cddc3[0x3]);_0x31514a[_0xab74('0x19')](_0x1cddc3[_0xab74('0x1a')](0x4,_0x1cddc3['length'])[_0xab74('0x1b')](','));break;case _0xab74('0x11'):_0x31514a['push'](_0x2021aa[_0xab74('0x17')]);break;case _0xab74('0x1e'):_0x31514a[_0xab74('0x19')](_0x2021aa['TagId']);_0x31514a[_0xab74('0x19')](_0x2021aa[_0xab74('0x17')]);break;default:_0x31514a=_[_0xab74('0xc')](_0x2021aa[_0xab74('0x17')])?[]:_0x2021aa['appdata'][_0xab74('0x18')](',');}var _0x3dd528={'id':util['format'](_0xab74('0x1f'),_0xc41277,_0x2021aa['id'],_0x2021aa['app']),'condition':require(_0xab74('0x20'))['condition'](_0xc41277,getIntervals(_0x5335aa[_0xab74('0x21')],_0x2021aa),_0x5335aa),'consequence':require('./applications/'+_0x2021aa[_0xab74('0x16')])[_0xab74('0x22')](_0xc41277,_0x31514a,_0x5335aa,_0x11f6f7),'p':_0x2021aa['priority']||0x0};logger[_0xab74('0x23')](_0xab74('0x24'),_0x3dd528['id'],_0xab74('0x25'),getIntervals(_0x5335aa[_0xab74('0x21')],_0x2021aa)[_0xab74('0x1b')](_0xab74('0x26')));_0x3619c5[_0xab74('0x19')](_0x3dd528);}else{logger[_0xab74('0x27')](_0xab74('0x28'),path[_0xab74('0x1b')](__dirname,_0xab74('0x13'),_0x2021aa[_0xab74('0x16')]+_0xab74('0x29')));}}_0x5335aa[_0xab74('0x10')][_0xc41277]=new RuleEngine(_0x3619c5);_0x5335aa['rules'][_0xc41277]['execute'](_0x11f6f7,function(_0x179286){logger[_0xab74('0x23')](_0xab74('0x2a'),JSON[_0xab74('0x2b')](_0x179286[_0xab74('0x2c')]));if(_0x5335aa['rules'][_0xc41277]){_0x5335aa[_0xab74('0x10')][_0xc41277][_0xab74('0x2d')](_0xab74('0x2e'));}});return _0x1b969f({'code':0xc8,'message':_0x11f6f7});}else{logger[_0xab74('0x23')]('No\x20applications\x20to\x20execute');return _0x1b969f({'code':0xc8,'message':_0x11f6f7});}}catch(_0x355434){logger[_0xab74('0x27')](_0x355434['stack']);return _0x288965(_0xd9ee7[_0xab74('0x27')](0x1f4,_0x355434));}}return _0x288965(_0xab74('0x2f'));});},'AcceptMessage':function(_0x3e0917){var _0x2ec349=this;return new Promise(function(_0x2de828,_0x428faa){if(_0x3e0917[_0xab74('0x11')]&&_0x3e0917[_0xab74('0x11')]['id']){try{var _0x1cea41=getId(_0x3e0917[_0xab74('0x30')],_0x3e0917[_0xab74('0x11')]?_0x3e0917[_0xab74('0x11')]['id']:0x0,_0x3e0917[_0xab74('0x12')]?_0x3e0917[_0xab74('0x12')]['id']:0x0);if(_0x5335aa[_0xab74('0x10')][_0x1cea41]){_0x5335aa[_0xab74('0x10')][_0x1cea41][_0xab74('0x2d')](_0xab74('0x2e'));if(rpc[_0x3e0917[_0xab74('0x30')]+_0xab74('0x31')]){rpc[_0x3e0917['channel']+_0xab74('0x31')][_0xab74('0x32')](_0x1cea41,{'UserId':_0x3e0917[_0xab74('0x11')][_0xab74('0x33')]})[_0xab74('0x34')](function(_0x4b30ed){logger[_0xab74('0x27')](_0xab74('0x35'));});}}return _0x2de828({'code':0xc8,'message':_0x3e0917});}catch(_0x432352){logger[_0xab74('0x27')](_0x432352[_0xab74('0x36')]);return _0x428faa(_0x2ec349[_0xab74('0x27')](0x1f4,_0x432352));}}logger[_0xab74('0x27')](_0xab74('0x37'));return _0x428faa(_0x2ec349[_0xab74('0x27')](0x1f4,_0xab74('0x37')));});},'RejectMessage':function(_0x48dd03){var _0x39eba0=this;return new Promise(function(_0x385fde,_0x1cf89a){if(_0x48dd03[_0xab74('0x38')]&&_0x48dd03[_0xab74('0x38')]['id']){try{if(_0x5335aa['agents'][_0x48dd03[_0xab74('0x38')]['id']]){_0x5335aa['agents'][_0x48dd03[_0xab74('0x38')]['id']][_0xab74('0x39')]=![];_0x5335aa[_0xab74('0x3a')][_0x48dd03[_0xab74('0x38')]['id']][_0xab74('0x3b')]=undefined;}return _0x385fde({'code':0xc8,'message':_0x48dd03});}catch(_0x1aed70){logger[_0xab74('0x27')](_0x1aed70[_0xab74('0x36')]);return _0x1cf89a(_0x39eba0[_0xab74('0x27')](0x1f4,_0x1aed70));}}logger['error'](_0xab74('0x37'));return _0x1cf89a(_0x39eba0[_0xab74('0x27')](0x1f4,_0xab74('0x37')));});},'AbandonInteraction':function(_0x2f4306){var _0x2e3dea=this;return new Promise(function(_0x1e3070,_0x2c3876){if(_0x2f4306[_0xab74('0x30')]&&_0x2f4306[_0xab74('0x12')]&&_0x2f4306[_0xab74('0x12')]['id']){try{var _0x4df410=getId(_0x2f4306[_0xab74('0x30')],_0x2f4306[_0xab74('0x11')]?_0x2f4306[_0xab74('0x11')]['id']:0x0,_0x2f4306[_0xab74('0x12')]?_0x2f4306[_0xab74('0x12')]['id']:0x0);if(_0x5335aa[_0xab74('0x10')][_0x4df410]){_0x5335aa[_0xab74('0x10')][_0x4df410]['emit']('end');}return _0x1e3070({'code':0xc8,'message':_0x2f4306});}catch(_0x39eca4){logger[_0xab74('0x27')](_0x39eca4[_0xab74('0x36')]);return _0x2c3876(_0x2e3dea[_0xab74('0x27')](0x1f4,_0x39eca4));}}logger[_0xab74('0x27')](_0xab74('0x37'));return _0x2c3876(_0x2e3dea['error'](0x1f4,_0xab74('0x37')));});},'AgentCapacity':function(_0x41ed6b){var _0x12af01=this;return new Promise(function(_0x598fa2,_0x191868){if(_0x5335aa[_0xab74('0x3a')]['hasOwnProperty'](_0x41ed6b['id'])){for(var _0x42948f in _0x41ed6b[_0xab74('0x3c')]){if(_0x41ed6b['capacity']['hasOwnProperty'](_0x42948f)){if(_0x5335aa[_0xab74('0x3a')][_0x41ed6b['id']][_0xab74('0x3d')](_0x42948f+_0xab74('0x3e'))){_0x5335aa[_0xab74('0x3a')][_0x41ed6b['id']][_0x42948f+_0xab74('0x3e')]=parseInt(_0x41ed6b[_0xab74('0x3c')][_0x42948f],0xa);}}}_0x5335aa[_0xab74('0x3a')][_0x41ed6b['id']]['updateRealtime']();return _0x598fa2({'code':0xc8,'message':_0x5335aa[_0xab74('0x3a')][_0x41ed6b['id']]});}else{return _0x191868(_0x12af01[_0xab74('0x27')](0x1f4,_0xab74('0x3f')));}});},'Agents':function(_0x57d5f6){return new Promise(function(_0xf69ebe,_0x52606e){var _0x263ba7=_[_0xab74('0x40')](_0x5335aa[_0xab74('0x3a')]);_0xf69ebe({'count':_0x263ba7[_0xab74('0x14')],'rows':_0x263ba7});});},'ChatQueues':function(_0x2a3bc6){return new Promise(function(_0x3a012a,_0x165b77){var _0x4e36a8=[];for(var _0x168a08 in _0x5335aa[_0xab74('0x41')]){if(_0x5335aa['chatQueues'][_0xab74('0x3d')](_0x168a08)){var _0x49305f=_0x5335aa[_0xab74('0x41')][_0x168a08];var _0x276056={'id':_0x49305f['id'],'available':_0x49305f['available'],'loggedIn':_0x49305f[_0xab74('0x42')],'name':_0x49305f[_0xab74('0x43')],'paused':_0x49305f[_0xab74('0x44')],'waiting':_0x49305f[_0xab74('0x45')]};_0x4e36a8[_0xab74('0x19')](_0x276056);}}_0x3a012a({'count':_0x4e36a8[_0xab74('0x14')],'rows':_0x4e36a8});});},'MailQueues':function(_0x17ffb1){return new Promise(function(_0x1bf7a7,_0x3a28a9){var _0x422c96=[];for(var _0x1a82ac in _0x5335aa[_0xab74('0x46')]){if(_0x5335aa[_0xab74('0x46')][_0xab74('0x3d')](_0x1a82ac)){var _0x502656=_0x5335aa['mailQueues'][_0x1a82ac];var _0x56c26b={'id':_0x502656['id'],'available':_0x502656['available'],'loggedIn':_0x502656['loggedIn'],'name':_0x502656[_0xab74('0x43')],'paused':_0x502656[_0xab74('0x44')],'waiting':_0x502656[_0xab74('0x45')]};_0x422c96['push'](_0x56c26b);}}_0x1bf7a7({'count':_0x422c96[_0xab74('0x14')],'rows':_0x422c96});});},'OpenchannelQueues':function(_0x187144){return new Promise(function(_0x379259,_0x4c6ac6){var _0x1a1e1e=[];for(var _0x3922e3 in _0x5335aa[_0xab74('0x47')]){if(_0x5335aa[_0xab74('0x47')][_0xab74('0x3d')](_0x3922e3)){var _0x25bab8=_0x5335aa[_0xab74('0x47')][_0x3922e3];var _0x58cdc9={'id':_0x25bab8['id'],'available':_0x25bab8[_0xab74('0x48')],'loggedIn':_0x25bab8[_0xab74('0x42')],'name':_0x25bab8['name'],'paused':_0x25bab8[_0xab74('0x44')],'waiting':_0x25bab8[_0xab74('0x45')]};_0x1a1e1e['push'](_0x58cdc9);}}_0x379259({'count':_0x1a1e1e['length'],'rows':_0x1a1e1e});});},'SmsQueues':function(_0x20c730){return new Promise(function(_0x30ef6a,_0x1a2b6a){var _0x5b97e7=[];for(var _0x3968ee in _0x5335aa[_0xab74('0x49')]){if(_0x5335aa[_0xab74('0x49')]['hasOwnProperty'](_0x3968ee)){var _0x39fa9e=_0x5335aa['smsQueues'][_0x3968ee];var _0x49c448={'id':_0x39fa9e['id'],'available':_0x39fa9e[_0xab74('0x48')],'loggedIn':_0x39fa9e['loggedIn'],'name':_0x39fa9e[_0xab74('0x43')],'paused':_0x39fa9e['paused'],'waiting':_0x39fa9e[_0xab74('0x45')]};_0x5b97e7[_0xab74('0x19')](_0x49c448);}}_0x30ef6a({'count':_0x5b97e7[_0xab74('0x14')],'rows':_0x5b97e7});});},'FaxQueues':function(_0x4c02c8){return new Promise(function(_0x166824,_0x282c96){var _0x576eb2=[];for(var _0x2f3762 in _0x5335aa['faxQueues']){if(_0x5335aa[_0xab74('0x4a')][_0xab74('0x3d')](_0x2f3762)){var _0x39862f=_0x5335aa[_0xab74('0x4a')][_0x2f3762];var _0x476b60={'id':_0x39862f['id'],'available':_0x39862f[_0xab74('0x48')],'loggedIn':_0x39862f[_0xab74('0x42')],'name':_0x39862f[_0xab74('0x43')],'paused':_0x39862f[_0xab74('0x44')],'waiting':_0x39862f['waiting']};_0x576eb2['push'](_0x476b60);}}_0x166824({'count':_0x576eb2[_0xab74('0x14')],'rows':_0x576eb2});});},'ChatQueuesWaitingInteractions':function(_0x2df923){return new Promise(function(_0x536fb1,_0x4eff2b){var _0x9f50d=_['values'](_0x5335aa[_0xab74('0x4b')]);_0x536fb1({'count':_0x9f50d[_0xab74('0x14')],'rows':_0x9f50d});});},'MailQueuesWaitingInteractions':function(_0x24901e){return new Promise(function(_0xac5c59,_0x5c1a57){var _0x17de0b=_[_0xab74('0x40')](_0x5335aa['mailQueuesWaitingInteractions']);_0xac5c59({'count':_0x17de0b['length'],'rows':_0x17de0b});});},'OpenchannelQueuesWaitingInteractions':function(_0x5339d4){return new Promise(function(_0x763421,_0x5e8830){var _0x595816=_[_0xab74('0x40')](_0x5335aa[_0xab74('0x4c')]);_0x763421({'count':_0x595816[_0xab74('0x14')],'rows':_0x595816});});},'SmsQueuesWaitingInteractions':function(_0x31eae9){return new Promise(function(_0x149ea9,_0x5c6451){var _0x4adcf0=_[_0xab74('0x40')](_0x5335aa[_0xab74('0x4d')]);_0x149ea9({'count':_0x4adcf0['length'],'rows':_0x4adcf0});});},'FaxQueuesWaitingInteractions':function(_0x508944){return new Promise(function(_0x16969f,_0x62ce2d){var _0x454e83=_[_0xab74('0x40')](_0x5335aa[_0xab74('0x4e')]);_0x16969f({'count':_0x454e83[_0xab74('0x14')],'rows':_0x454e83});});}};var _0x23e467=jayson['server'](_0xda5d2b)['http']();_0x23e467['on']('error',function(_0x346157){logger['error'](JSON[_0xab74('0x2b')](_0x346157));return _0x15f329(_0x346157);});_0x23e467['listen'](0x232c,'127.0.0.1',function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x96f9ce('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index e033c0f..cb06a0c 100644 --- a/server/services/routing/server/interval.js +++ b/server/services/routing/server/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5deb=['push','Command','format','message','indexOf','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','then','error','result','catch','condition','rules','info','stop','length'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x5deb,0x194));var _0xb5de=function(_0x3fc31d,_0x432bc9){_0x3fc31d=_0x3fc31d-0x0;var _0x31bb91=_0x5deb[_0x3fc31d];return _0x31bb91;};'use strict';var util=require(_0xb5de('0x0'));var BPromise=require(_0xb5de('0x1'));var jayson=require(_0xb5de('0x2'));var _=require(_0xb5de('0x3'));var logger=require(_0xb5de('0x4'))('routing');var client=jayson[_0xb5de('0x5')][_0xb5de('0x6')]({'port':0x232a});function request(_0x31204d,_0x15ab3f){return new BPromise(function(_0x419c19,_0x1f3d7b){return client['request'](_0x31204d,_0x15ab3f)[_0xb5de('0x7')](function(_0x5677f8){if(_0x5677f8[_0xb5de('0x8')]){return _0x1f3d7b(_0x5677f8[_0xb5de('0x8')]['message']);}else{return _0x419c19(_0x5677f8[_0xb5de('0x9')]);}})[_0xb5de('0xa')](function(_0x5c38e1){return _0x1f3d7b(_0x5c38e1);});});}exports[_0xb5de('0xb')]=function(_0x24aa12,_0xc271e8,_0x526ae2){return function(_0x2e77b3){if(_0x526ae2[_0xb5de('0xc')]&&!_0x526ae2[_0xb5de('0xc')][_0x24aa12]){logger[_0xb5de('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x24aa12);return _0x2e77b3[_0xb5de('0xe')]();}var _0x4ec8bd=[];for(var _0x8c760c=0x0;_0x8c760c<_0xc271e8[_0xb5de('0xf')];_0x8c760c+=0x1){_0x4ec8bd[_0xb5de('0x10')](request(_0xb5de('0x11'),{'command':util[_0xb5de('0x12')]('iftime\x20%s',_0xc271e8[_0x8c760c])})['then'](function(_0x40ec73){return _0x40ec73&&_0x40ec73['message']&&_0x40ec73[_0xb5de('0x13')][_0xb5de('0x14')]('true')>=0x0?!![]:![];})[_0xb5de('0xa')](function(_0x3d2601){logger[_0xb5de('0x8')](_0xb5de('0x15'),_0x24aa12,_0xc271e8[_0x8c760c]);}));}BPromise[_0xb5de('0x16')](_0x4ec8bd)[_0xb5de('0x7')](function(_0x5a5698){var _0x202109=_[_0xb5de('0x17')](_0x5a5698);logger[_0xb5de('0xd')](_0xb5de('0x18'),_0x24aa12,_0xc271e8[_0xb5de('0x19')](_0xb5de('0x1a')),_0x202109);_0x2e77b3['when'](_0x202109);})[_0xb5de('0xa')](function(_0x3dc414){console['log'](_0x3dc414);logger[_0xb5de('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x24aa12,_0xc271e8['join']('\x20|\x20'),_0x3dc414[_0xb5de('0x1b')]);_0x2e77b3[_0xb5de('0xe')]();});};}; \ No newline at end of file +var _0xbcb2=['length','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop'];(function(_0x2cfd00,_0x164f6a){var _0x1fe12b=function(_0x1af1dc){while(--_0x1af1dc){_0x2cfd00['push'](_0x2cfd00['shift']());}};_0x1fe12b(++_0x164f6a);}(_0xbcb2,0xf8));var _0x2bcb=function(_0x3f3410,_0x395333){_0x3f3410=_0x3f3410-0x0;var _0x21e08b=_0xbcb2[_0x3f3410];return _0x21e08b;};'use strict';var util=require(_0x2bcb('0x0'));var BPromise=require(_0x2bcb('0x1'));var jayson=require(_0x2bcb('0x2'));var _=require(_0x2bcb('0x3'));var logger=require(_0x2bcb('0x4'))('routing');var client=jayson[_0x2bcb('0x5')][_0x2bcb('0x6')]({'port':0x232a});function request(_0x389d9d,_0x2574e7){return new BPromise(function(_0x4378d5,_0x2812a7){return client['request'](_0x389d9d,_0x2574e7)[_0x2bcb('0x7')](function(_0x3495bd){if(_0x3495bd[_0x2bcb('0x8')]){return _0x2812a7(_0x3495bd[_0x2bcb('0x8')]['message']);}else{return _0x4378d5(_0x3495bd[_0x2bcb('0x9')]);}})[_0x2bcb('0xa')](function(_0x2d1c16){return _0x2812a7(_0x2d1c16);});});}exports[_0x2bcb('0xb')]=function(_0x440fc5,_0x1ba630,_0x350580){return function(_0x37c2d7){if(_0x350580[_0x2bcb('0xc')]&&!_0x350580[_0x2bcb('0xc')][_0x440fc5]){logger[_0x2bcb('0xd')](_0x2bcb('0xe'),_0x440fc5);return _0x37c2d7[_0x2bcb('0xf')]();}var _0x59bff6=[];for(var _0x573bb6=0x0;_0x573bb6<_0x1ba630[_0x2bcb('0x10')];_0x573bb6+=0x1){_0x59bff6[_0x2bcb('0x11')](request(_0x2bcb('0x12'),{'command':util[_0x2bcb('0x13')](_0x2bcb('0x14'),_0x1ba630[_0x573bb6])})['then'](function(_0x5ba219){return _0x5ba219&&_0x5ba219[_0x2bcb('0x15')]&&_0x5ba219['message'][_0x2bcb('0x16')](_0x2bcb('0x17'))>=0x0?!![]:![];})[_0x2bcb('0xa')](function(_0x4ba65b){logger['error'](_0x2bcb('0x18'),_0x440fc5,_0x1ba630[_0x573bb6]);}));}BPromise[_0x2bcb('0x19')](_0x59bff6)[_0x2bcb('0x7')](function(_0x336873){var _0x4695d3=_[_0x2bcb('0x1a')](_0x336873);logger[_0x2bcb('0xd')](_0x2bcb('0x1b'),_0x440fc5,_0x1ba630[_0x2bcb('0x1c')](_0x2bcb('0x1d')),_0x4695d3);_0x37c2d7[_0x2bcb('0x1e')](_0x4695d3);})[_0x2bcb('0xa')](function(_0xdb24e9){console[_0x2bcb('0x1f')](_0xdb24e9);logger[_0x2bcb('0x8')](_0x2bcb('0x1b'),_0x440fc5,_0x1ba630[_0x2bcb('0x1c')](_0x2bcb('0x1d')),_0xdb24e9[_0x2bcb('0x20')]);_0x37c2d7[_0x2bcb('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index badb1b7..d27dabc 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40be=['isNil','agentringnoanswerAt','now','rejected','reason','stack','queuecallerabandon','forIn','abandoned','holdtime','talktime','agentconnect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','complete','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','origtransfereruniqueid','ATTENDED','transferexten','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','./utils','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','called','error','agentringnoanswer'];(function(_0x15165e,_0x47648c){var _0x3383e3=function(_0x250cb0){while(--_0x250cb0){_0x15165e['push'](_0x15165e['shift']());}};_0x3383e3(++_0x47648c);}(_0x40be,0x100));var _0xe40b=function(_0x5b63e9,_0x39e176){_0x5b63e9=_0x5b63e9-0x0;var _0x588e6d=_0x40be[_0x5b63e9];return _0x588e6d;};'use strict';var _=require(_0xe40b('0x0'));var util=require(_0xe40b('0x1'));var utils=require(_0xe40b('0x2'));var agents={};var transfers={};function writeDB(_0x3100a7,_0x647572){utils['info'](util[_0xe40b('0x3')](_0xe40b('0x4'),_0x3100a7[_0xe40b('0x5')],_0x3100a7[_0xe40b('0x6')],_0x3100a7[_0xe40b('0x7')],_0x3100a7[_0xe40b('0x8')],_0x3100a7[_0xe40b('0x9')],_0x3100a7[_0xe40b('0xa')],_0x3100a7[_0xe40b('0xb')],_0x3100a7[_0xe40b('0xc')]));if(_0x3100a7[_0xe40b('0x7')]){utils[_0xe40b('0xd')](_0x3100a7['queue'])[_0xe40b('0xe')](function(_0xa575a2){if(_0xa575a2){_0x3100a7['type']=_0xa575a2['type'];_0x3100a7[_0xe40b('0xf')]=_0x3100a7[_0xe40b('0x10')]?_0xa575a2[_0xe40b('0x11')]:![];_0x3100a7[_0xe40b('0x12')]=_0x3100a7[_0xe40b('0xf')]?_0xa575a2[_0xe40b('0x13')]:0x0;}utils[_0xe40b('0x14')](_0xe40b('0x15'),_0x3100a7);});}else{utils[_0xe40b('0x14')](_0xe40b('0x15'),_0x3100a7);}if(_0x647572){delete transfers[_0x3100a7['uniqueid']];}else{delete agents[_0x3100a7[_0xe40b('0x16')]];}}exports[_0xe40b('0x17')]=function(_0x23c760){try{agents[_0x23c760[_0xe40b('0x16')]]=_0x23c760;agents[_0x23c760[_0xe40b('0x16')]][_0xe40b('0x18')]=utils['now']();agents[_0x23c760[_0xe40b('0x16')]]['lastevent']=_0xe40b('0x19');agents[_0x23c760[_0xe40b('0x16')]]['connectedlinenum']=null;agents[_0x23c760['destuniqueid']]['connectedlinename']=null;}catch(_0x345ba1){utils[_0xe40b('0x1a')](_0x345ba1['stack']);}};exports[_0xe40b('0x1b')]=function(_0x36ca25){try{if(!_[_0xe40b('0x1c')](agents[_0x36ca25[_0xe40b('0x16')]])){agents[_0x36ca25['destuniqueid']][_0xe40b('0x1b')]=!![];agents[_0x36ca25[_0xe40b('0x16')]][_0xe40b('0x1d')]=utils[_0xe40b('0x1e')]();agents[_0x36ca25['destuniqueid']][_0xe40b('0xc')]=_0xe40b('0x1f');agents[_0x36ca25['destuniqueid']][_0xe40b('0x20')]=_0xe40b('0x1f');agents[_0x36ca25['destuniqueid']]['holdtime']=_0x36ca25['ringtime']?parseInt(_0x36ca25['ringtime'])/0x3e8:0x0;agents[_0x36ca25[_0xe40b('0x16')]]['talktime']=0x0;writeDB(agents[_0x36ca25['destuniqueid']]);}}catch(_0x5aaf2b){utils[_0xe40b('0x1a')](_0x5aaf2b[_0xe40b('0x21')]);}};exports[_0xe40b('0x22')]=function(_0x277039){try{_[_0xe40b('0x23')](agents,function(_0x352bf5,_0x3939da){if(_0x352bf5[_0xe40b('0x5')]==_0x277039[_0xe40b('0x5')]){_0x352bf5['agentringnoanswer']=!![];_0x352bf5[_0xe40b('0x1d')]=utils[_0xe40b('0x1e')]();_0x352bf5[_0xe40b('0xc')]='abandoned';_0x352bf5[_0xe40b('0x20')]=_0xe40b('0x24');_0x352bf5['holdtime']=_0x277039[_0xe40b('0x25')];_0x352bf5[_0xe40b('0x26')]=0x0;writeDB(_0x352bf5);}});}catch(_0x2dee6b){utils[_0xe40b('0x1a')](_0x2dee6b['stack']);}};exports[_0xe40b('0x27')]=function(_0x599b8c){try{if(agents[_0x599b8c[_0xe40b('0x16')]]){agents[_0x599b8c[_0xe40b('0x16')]][_0xe40b('0x28')]=utils[_0xe40b('0x1e')]();agents[_0x599b8c[_0xe40b('0x16')]]['connectedlinenum']=_0x599b8c['connectedlinenum'];agents[_0x599b8c[_0xe40b('0x16')]]['connectedlinename']=_0x599b8c['connectedlinename'];agents[_0x599b8c[_0xe40b('0x16')]][_0xe40b('0x25')]=_0x599b8c[_0xe40b('0x29')];agents[_0x599b8c[_0xe40b('0x16')]]['lastevent']=_0xe40b('0x2a');_[_0xe40b('0x23')](agents,function(_0x2a373b,_0x3ee88c){if(_0x2a373b['destuniqueid']!=_0x599b8c[_0xe40b('0x16')]&&_0x2a373b[_0xe40b('0x5')]==_0x599b8c['uniqueid']){_0x2a373b['talktime']=0x0;_0x2a373b[_0xe40b('0x25')]=_0x599b8c[_0xe40b('0x29')];_0x2a373b[_0xe40b('0x1b')]=!![];_0x2a373b[_0xe40b('0x1d')]=utils[_0xe40b('0x1e')]();_0x2a373b[_0xe40b('0xc')]=_0xe40b('0x2b');_0x2a373b[_0xe40b('0x20')]=_0xe40b('0x2b');_0x2a373b[_0xe40b('0x2c')]=_0x599b8c[_0xe40b('0x16')];_0x2a373b[_0xe40b('0x2d')]=_0x599b8c['membername'];writeDB(_0x2a373b);}});}}catch(_0x39a032){utils[_0xe40b('0x1a')](_0x39a032['stack']);}};exports[_0xe40b('0x10')]=function(_0x122b1c){try{if(!_[_0xe40b('0x1c')](agents[_0x122b1c[_0xe40b('0x16')]])){agents[_0x122b1c[_0xe40b('0x16')]][_0xe40b('0x10')]=!![];agents[_0x122b1c[_0xe40b('0x16')]][_0xe40b('0x2e')]=utils['now']();agents[_0x122b1c[_0xe40b('0x16')]][_0xe40b('0x26')]=utils[_0xe40b('0x2f')](agents[_0x122b1c[_0xe40b('0x16')]]['agentcompleteAt'],agents[_0x122b1c[_0xe40b('0x16')]]['agentconnectAt']);agents[_0x122b1c[_0xe40b('0x16')]][_0xe40b('0x20')]=_0x122b1c[_0xe40b('0x20')];agents[_0x122b1c[_0xe40b('0x16')]][_0xe40b('0xc')]=_0xe40b('0x30');writeDB(agents[_0x122b1c[_0xe40b('0x16')]]);}}catch(_0x4e6d7b){utils[_0xe40b('0x1a')](_0x4e6d7b[_0xe40b('0x21')]);}};exports['blindtransfer']=function(_0x6f9d0){try{if(!_[_0xe40b('0x1c')](agents[_0x6f9d0['transfereruniqueid']])){agents[_0x6f9d0[_0xe40b('0x31')]][_0xe40b('0x32')]=!![];agents[_0x6f9d0[_0xe40b('0x31')]][_0xe40b('0x33')]=_0xe40b('0x34');agents[_0x6f9d0['transfereruniqueid']]['transferexten']=_0x6f9d0[_0xe40b('0x35')];agents[_0x6f9d0['transfereruniqueid']][_0xe40b('0x36')]=agents[_0x6f9d0[_0xe40b('0x31')]][_0xe40b('0x5')];}}catch(_0x27b514){utils['error'](_0x27b514[_0xe40b('0x21')]);}};exports[_0xe40b('0x37')]=function(_0xa1414){try{if(_0xa1414['origtransfereruniqueid']==_0xa1414[_0xe40b('0x38')]){if(!_[_0xe40b('0x1c')](agents[_0xa1414[_0xe40b('0x39')]])){agents[_0xa1414['secondtransfereruniqueid']][_0xe40b('0x32')]=!![];agents[_0xa1414[_0xe40b('0x39')]][_0xe40b('0x33')]='ATTENDED';agents[_0xa1414[_0xe40b('0x39')]]['transferexten']=_0xa1414[_0xe40b('0x3a')];agents[_0xa1414['secondtransfereruniqueid']][_0xe40b('0x36')]=_0xa1414['origtransfereruniqueid'];}if(_0xa1414[_0xe40b('0x3b')]&&agents[_0xa1414['transfereeuniqueid']]){agents[_0xa1414[_0xe40b('0x3b')]]['agententerreason']=0x1;transfers[_0xa1414[_0xe40b('0x3b')]]=_[_0xe40b('0x3c')](agents[_0xa1414['transfereeuniqueid']]);transfers[_0xa1414[_0xe40b('0x3b')]][_0xe40b('0xa')]=agents[_0xa1414[_0xe40b('0x39')]][_0xe40b('0xa')];transfers[_0xa1414[_0xe40b('0x3b')]]['calleridname']=agents[_0xa1414[_0xe40b('0x39')]][_0xe40b('0x3d')];transfers[_0xa1414[_0xe40b('0x3b')]]['agentcalledAt']=utils['now']();transfers[_0xa1414[_0xe40b('0x3b')]][_0xe40b('0x28')]=utils[_0xe40b('0x1e')]();transfers[_0xa1414[_0xe40b('0x3b')]][_0xe40b('0x25')]=0x0;transfers[_0xa1414[_0xe40b('0x3b')]][_0xe40b('0x3e')]=0x2;}}else if(_0xa1414[_0xe40b('0x39')]==_0xa1414[_0xe40b('0x3f')]){if(!_[_0xe40b('0x1c')](agents[_0xa1414[_0xe40b('0x40')]])){agents[_0xa1414[_0xe40b('0x40')]][_0xe40b('0x32')]=!![];agents[_0xa1414[_0xe40b('0x40')]]['transfertype']=_0xe40b('0x41');agents[_0xa1414['origtransfereruniqueid']][_0xe40b('0x42')]=_0xa1414[_0xe40b('0x43')];agents[_0xa1414[_0xe40b('0x40')]]['transferuniqueid']=_0xa1414[_0xe40b('0x39')];}if(_0xa1414[_0xe40b('0x44')]&&agents[_0xa1414[_0xe40b('0x44')]]){agents[_0xa1414['transfertargetuniqueid']][_0xe40b('0x3e')]=0x1;transfers[_0xa1414[_0xe40b('0x44')]]=_[_0xe40b('0x3c')](agents[_0xa1414[_0xe40b('0x44')]]);transfers[_0xa1414[_0xe40b('0x44')]]['calleridnum']=agents[_0xa1414[_0xe40b('0x40')]][_0xe40b('0xa')];transfers[_0xa1414[_0xe40b('0x44')]][_0xe40b('0x3d')]=agents[_0xa1414['origtransfereruniqueid']]['calleridname'];transfers[_0xa1414['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0xa1414[_0xe40b('0x44')]][_0xe40b('0x28')]=utils[_0xe40b('0x1e')]();transfers[_0xa1414[_0xe40b('0x44')]][_0xe40b('0x25')]=0x0;transfers[_0xa1414[_0xe40b('0x44')]][_0xe40b('0x3e')]=0x2;}}}catch(_0xc3f50c){utils[_0xe40b('0x1a')](_0xc3f50c[_0xe40b('0x21')]);}};exports[_0xe40b('0x45')]=function(_0x29ea76){try{if(transfers[_0x29ea76[_0xe40b('0x5')]]){transfers[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x10')]=!![];transfers[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x2e')]=utils[_0xe40b('0x1e')]();transfers[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x26')]=utils[_0xe40b('0x2f')](transfers[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x2e')],transfers[_0x29ea76['uniqueid']]['agentconnectAt']);transfers[_0x29ea76['uniqueid']][_0xe40b('0x20')]=_0xe40b('0x46');transfers[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0xc')]=_0xe40b('0x30');writeDB(transfers[_0x29ea76['uniqueid']],!![]);}if(agents[_0x29ea76[_0xe40b('0x5')]]&&agents[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x28')]){agents[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x10')]=!![];agents[_0x29ea76[_0xe40b('0x5')]]['agentcompleteAt']=utils['now']();agents[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x26')]=utils['diffTime'](agents[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x2e')],agents[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x28')]);agents[_0x29ea76[_0xe40b('0x5')]][_0xe40b('0x20')]=agents[_0x29ea76[_0xe40b('0x5')]]['transfer']?_0xe40b('0x32'):'agent';agents[_0x29ea76[_0xe40b('0x5')]]['lastevent']='complete';writeDB(agents[_0x29ea76[_0xe40b('0x5')]]);}}catch(_0x2480ff){utils[_0xe40b('0x1a')](_0x2480ff[_0xe40b('0x21')]);}}; \ No newline at end of file +var _0x2608=['interface','calleridnum','connectedlinenum','lastevent','queue','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','connectedlinename','error','stack','agentringnoanswer','isNil','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','agentringnoanswerAt','abandoned','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','complete','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','./utils','format','uniqueid','channel','membername'];(function(_0x5e4a6a,_0x287632){var _0xc8879f=function(_0x4a5f5a){while(--_0x4a5f5a){_0x5e4a6a['push'](_0x5e4a6a['shift']());}};_0xc8879f(++_0x287632);}(_0x2608,0x1c8));var _0x8260=function(_0x3100be,_0x17cf28){_0x3100be=_0x3100be-0x0;var _0x503847=_0x2608[_0x3100be];return _0x503847;};'use strict';var _=require(_0x8260('0x0'));var util=require('util');var utils=require(_0x8260('0x1'));var agents={};var transfers={};function writeDB(_0x3a00f7,_0x649ff7){utils['info'](util[_0x8260('0x2')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x3a00f7[_0x8260('0x3')],_0x3a00f7[_0x8260('0x4')],_0x3a00f7['queue'],_0x3a00f7[_0x8260('0x5')],_0x3a00f7[_0x8260('0x6')],_0x3a00f7[_0x8260('0x7')],_0x3a00f7[_0x8260('0x8')],_0x3a00f7[_0x8260('0x9')]));if(_0x3a00f7[_0x8260('0xa')]){utils['getVoiceQueueByName'](_0x3a00f7['queue'])['then'](function(_0x832fbd){if(_0x832fbd){_0x3a00f7['type']=_0x832fbd[_0x8260('0xb')];_0x3a00f7[_0x8260('0xc')]=_0x3a00f7[_0x8260('0xd')]?_0x832fbd[_0x8260('0xe')]:![];_0x3a00f7[_0x8260('0xf')]=_0x3a00f7[_0x8260('0xc')]?_0x832fbd[_0x8260('0x10')]:0x0;}utils[_0x8260('0x11')](_0x8260('0x12'),_0x3a00f7);});}else{utils[_0x8260('0x11')](_0x8260('0x12'),_0x3a00f7);}if(_0x649ff7){delete transfers[_0x3a00f7['uniqueid']];}else{delete agents[_0x3a00f7['destuniqueid']];}}exports[_0x8260('0x13')]=function(_0x1c6af5){try{agents[_0x1c6af5[_0x8260('0x14')]]=_0x1c6af5;agents[_0x1c6af5[_0x8260('0x14')]][_0x8260('0x15')]=utils[_0x8260('0x16')]();agents[_0x1c6af5[_0x8260('0x14')]]['lastevent']='called';agents[_0x1c6af5[_0x8260('0x14')]]['connectedlinenum']=null;agents[_0x1c6af5['destuniqueid']][_0x8260('0x17')]=null;}catch(_0x2e4098){utils[_0x8260('0x18')](_0x2e4098[_0x8260('0x19')]);}};exports[_0x8260('0x1a')]=function(_0x1a156a){try{if(!_[_0x8260('0x1b')](agents[_0x1a156a[_0x8260('0x14')]])){agents[_0x1a156a['destuniqueid']]['agentringnoanswer']=!![];agents[_0x1a156a['destuniqueid']]['agentringnoanswerAt']=utils[_0x8260('0x16')]();agents[_0x1a156a[_0x8260('0x14')]]['lastevent']=_0x8260('0x1c');agents[_0x1a156a[_0x8260('0x14')]][_0x8260('0x1d')]='rejected';agents[_0x1a156a[_0x8260('0x14')]][_0x8260('0x1e')]=_0x1a156a[_0x8260('0x1f')]?parseInt(_0x1a156a[_0x8260('0x1f')])/0x3e8:0x0;agents[_0x1a156a[_0x8260('0x14')]][_0x8260('0x20')]=0x0;writeDB(agents[_0x1a156a[_0x8260('0x14')]]);}}catch(_0x1717e2){utils[_0x8260('0x18')](_0x1717e2[_0x8260('0x19')]);}};exports[_0x8260('0x21')]=function(_0x4c078e){try{_['forIn'](agents,function(_0x166aa0,_0x4f3736){if(_0x166aa0[_0x8260('0x3')]==_0x4c078e[_0x8260('0x3')]){_0x166aa0[_0x8260('0x1a')]=!![];_0x166aa0[_0x8260('0x22')]=utils[_0x8260('0x16')]();_0x166aa0[_0x8260('0x9')]=_0x8260('0x23');_0x166aa0['reason']=_0x8260('0x23');_0x166aa0[_0x8260('0x1e')]=_0x4c078e[_0x8260('0x1e')];_0x166aa0[_0x8260('0x20')]=0x0;writeDB(_0x166aa0);}});}catch(_0x43fe69){utils['error'](_0x43fe69['stack']);}};exports['agentconnect']=function(_0xe4a66a){try{if(agents[_0xe4a66a['destuniqueid']]){agents[_0xe4a66a[_0x8260('0x14')]][_0x8260('0x24')]=utils[_0x8260('0x16')]();agents[_0xe4a66a['destuniqueid']][_0x8260('0x8')]=_0xe4a66a[_0x8260('0x8')];agents[_0xe4a66a[_0x8260('0x14')]][_0x8260('0x17')]=_0xe4a66a[_0x8260('0x17')];agents[_0xe4a66a['destuniqueid']][_0x8260('0x1e')]=_0xe4a66a[_0x8260('0x1f')];agents[_0xe4a66a[_0x8260('0x14')]][_0x8260('0x9')]=_0x8260('0x25');_[_0x8260('0x26')](agents,function(_0x2c9d66,_0x17b3f6){if(_0x2c9d66['destuniqueid']!=_0xe4a66a[_0x8260('0x14')]&&_0x2c9d66[_0x8260('0x3')]==_0xe4a66a['uniqueid']){_0x2c9d66[_0x8260('0x20')]=0x0;_0x2c9d66[_0x8260('0x1e')]=_0xe4a66a[_0x8260('0x1f')];_0x2c9d66[_0x8260('0x1a')]=!![];_0x2c9d66[_0x8260('0x22')]=utils[_0x8260('0x16')]();_0x2c9d66[_0x8260('0x9')]=_0x8260('0x27');_0x2c9d66['reason']=_0x8260('0x27');_0x2c9d66[_0x8260('0x28')]=_0xe4a66a['destuniqueid'];_0x2c9d66[_0x8260('0x29')]=_0xe4a66a[_0x8260('0x5')];writeDB(_0x2c9d66);}});}}catch(_0x512a7a){utils[_0x8260('0x18')](_0x512a7a[_0x8260('0x19')]);}};exports[_0x8260('0xd')]=function(_0x50377b){try{if(!_[_0x8260('0x1b')](agents[_0x50377b[_0x8260('0x14')]])){agents[_0x50377b['destuniqueid']][_0x8260('0xd')]=!![];agents[_0x50377b[_0x8260('0x14')]][_0x8260('0x2a')]=utils[_0x8260('0x16')]();agents[_0x50377b['destuniqueid']][_0x8260('0x20')]=utils[_0x8260('0x2b')](agents[_0x50377b[_0x8260('0x14')]][_0x8260('0x2a')],agents[_0x50377b[_0x8260('0x14')]][_0x8260('0x24')]);agents[_0x50377b[_0x8260('0x14')]][_0x8260('0x1d')]=_0x50377b[_0x8260('0x1d')];agents[_0x50377b[_0x8260('0x14')]]['lastevent']=_0x8260('0x2c');writeDB(agents[_0x50377b[_0x8260('0x14')]]);}}catch(_0x3d5b9){utils[_0x8260('0x18')](_0x3d5b9[_0x8260('0x19')]);}};exports['blindtransfer']=function(_0x475af4){try{if(!_[_0x8260('0x1b')](agents[_0x475af4[_0x8260('0x2d')]])){agents[_0x475af4[_0x8260('0x2d')]][_0x8260('0x2e')]=!![];agents[_0x475af4[_0x8260('0x2d')]][_0x8260('0x2f')]=_0x8260('0x30');agents[_0x475af4[_0x8260('0x2d')]][_0x8260('0x31')]=_0x475af4[_0x8260('0x32')];agents[_0x475af4[_0x8260('0x2d')]][_0x8260('0x33')]=agents[_0x475af4['transfereruniqueid']]['uniqueid'];}}catch(_0xf9530d){utils['error'](_0xf9530d['stack']);}};exports[_0x8260('0x34')]=function(_0x22e07c){try{if(_0x22e07c[_0x8260('0x35')]==_0x22e07c['origtransfererlinkedid']){if(!_['isNil'](agents[_0x22e07c['secondtransfereruniqueid']])){agents[_0x22e07c[_0x8260('0x36')]]['transfer']=!![];agents[_0x22e07c[_0x8260('0x36')]][_0x8260('0x2f')]=_0x8260('0x37');agents[_0x22e07c[_0x8260('0x36')]]['transferexten']=_0x22e07c[_0x8260('0x38')];agents[_0x22e07c[_0x8260('0x36')]][_0x8260('0x33')]=_0x22e07c[_0x8260('0x35')];}if(_0x22e07c[_0x8260('0x39')]&&agents[_0x22e07c[_0x8260('0x39')]]){agents[_0x22e07c[_0x8260('0x39')]][_0x8260('0x3a')]=0x1;transfers[_0x22e07c['transfereeuniqueid']]=_[_0x8260('0x3b')](agents[_0x22e07c[_0x8260('0x39')]]);transfers[_0x22e07c[_0x8260('0x39')]][_0x8260('0x7')]=agents[_0x22e07c[_0x8260('0x36')]]['calleridnum'];transfers[_0x22e07c[_0x8260('0x39')]][_0x8260('0x3c')]=agents[_0x22e07c[_0x8260('0x36')]][_0x8260('0x3c')];transfers[_0x22e07c[_0x8260('0x39')]][_0x8260('0x15')]=utils[_0x8260('0x16')]();transfers[_0x22e07c[_0x8260('0x39')]][_0x8260('0x24')]=utils[_0x8260('0x16')]();transfers[_0x22e07c[_0x8260('0x39')]][_0x8260('0x1e')]=0x0;transfers[_0x22e07c[_0x8260('0x39')]][_0x8260('0x3a')]=0x2;}}else if(_0x22e07c[_0x8260('0x36')]==_0x22e07c[_0x8260('0x3d')]){if(!_['isNil'](agents[_0x22e07c['origtransfereruniqueid']])){agents[_0x22e07c[_0x8260('0x35')]]['transfer']=!![];agents[_0x22e07c['origtransfereruniqueid']][_0x8260('0x2f')]=_0x8260('0x37');agents[_0x22e07c[_0x8260('0x35')]][_0x8260('0x31')]=_0x22e07c[_0x8260('0x3e')];agents[_0x22e07c[_0x8260('0x35')]]['transferuniqueid']=_0x22e07c['secondtransfereruniqueid'];}if(_0x22e07c[_0x8260('0x3f')]&&agents[_0x22e07c['transfertargetuniqueid']]){agents[_0x22e07c['transfertargetuniqueid']][_0x8260('0x3a')]=0x1;transfers[_0x22e07c[_0x8260('0x3f')]]=_[_0x8260('0x3b')](agents[_0x22e07c[_0x8260('0x3f')]]);transfers[_0x22e07c[_0x8260('0x3f')]][_0x8260('0x7')]=agents[_0x22e07c['origtransfereruniqueid']]['calleridnum'];transfers[_0x22e07c[_0x8260('0x3f')]][_0x8260('0x3c')]=agents[_0x22e07c[_0x8260('0x35')]][_0x8260('0x3c')];transfers[_0x22e07c['transfertargetuniqueid']][_0x8260('0x15')]=utils[_0x8260('0x16')]();transfers[_0x22e07c[_0x8260('0x3f')]][_0x8260('0x24')]=utils[_0x8260('0x16')]();transfers[_0x22e07c[_0x8260('0x3f')]][_0x8260('0x1e')]=0x0;transfers[_0x22e07c['transfertargetuniqueid']][_0x8260('0x3a')]=0x2;}}}catch(_0x272354){utils[_0x8260('0x18')](_0x272354['stack']);}};exports[_0x8260('0x40')]=function(_0x53f640){try{if(transfers[_0x53f640[_0x8260('0x3')]]){transfers[_0x53f640[_0x8260('0x3')]][_0x8260('0xd')]=!![];transfers[_0x53f640[_0x8260('0x3')]][_0x8260('0x2a')]=utils['now']();transfers[_0x53f640[_0x8260('0x3')]][_0x8260('0x20')]=utils[_0x8260('0x2b')](transfers[_0x53f640[_0x8260('0x3')]][_0x8260('0x2a')],transfers[_0x53f640[_0x8260('0x3')]][_0x8260('0x24')]);transfers[_0x53f640[_0x8260('0x3')]][_0x8260('0x1d')]='agent';transfers[_0x53f640[_0x8260('0x3')]]['lastevent']=_0x8260('0x2c');writeDB(transfers[_0x53f640[_0x8260('0x3')]],!![]);}if(agents[_0x53f640[_0x8260('0x3')]]&&agents[_0x53f640[_0x8260('0x3')]]['agentconnectAt']){agents[_0x53f640['uniqueid']][_0x8260('0xd')]=!![];agents[_0x53f640[_0x8260('0x3')]][_0x8260('0x2a')]=utils[_0x8260('0x16')]();agents[_0x53f640[_0x8260('0x3')]][_0x8260('0x20')]=utils[_0x8260('0x2b')](agents[_0x53f640[_0x8260('0x3')]]['agentcompleteAt'],agents[_0x53f640[_0x8260('0x3')]]['agentconnectAt']);agents[_0x53f640[_0x8260('0x3')]][_0x8260('0x1d')]=agents[_0x53f640[_0x8260('0x3')]][_0x8260('0x2e')]?'transfer':_0x8260('0x41');agents[_0x53f640[_0x8260('0x3')]]['lastevent']=_0x8260('0x2c');writeDB(agents[_0x53f640[_0x8260('0x3')]]);}}catch(_0x440e03){utils[_0x8260('0x18')](_0x440e03['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index bd00b69..c4e41e2 100644 --- a/server/services/xdr/calls.controller.js +++ b/server/services/xdr/calls.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb42=['execif','set','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','CALL|%s|%s|%s|%s|%s|%s|%s|%s','type','accountcode','source','disposition','getUserByInternal','then','CreateVoiceCallReport','request','uniqueid','newchannel','linkedid','channel','OutgoingSpoolFailed','calleridnum','exten','context','DOCUMENTATION','error','stack','newstate','isNil','channelstate','systemanswertime','now','transfer','answertime','callerid','calleridname','endtime','diffTime','billableseconds','attendedtransfer','localtwolinkedid','destinationchannel','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','value','variable','xmd-phone','xmd-callerid','xmd-queue','xmcs-queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','routeid','newexten','application','startsWith','appdata','toLowerCase','split','substring','lastIndexOf','includes','hangup','noop'];(function(_0x263f2f,_0x3dcae7){var _0x2c9ea2=function(_0x114788){while(--_0x114788){_0x263f2f['push'](_0x263f2f['shift']());}};_0x2c9ea2(++_0x3dcae7);}(_0xdb42,0x1d7));var _0x2db4=function(_0x474bd5,_0x6bb4c2){_0x474bd5=_0x474bd5-0x0;var _0x1bd3a4=_0xdb42[_0x474bd5];return _0x1bd3a4;};'use strict';var _=require(_0x2db4('0x0'));var util=require(_0x2db4('0x1'));var utils=require(_0x2db4('0x2'));var dispositions=[_0x2db4('0x3'),_0x2db4('0x4'),_0x2db4('0x4'),_0x2db4('0x3'),_0x2db4('0x3'),_0x2db4('0x3'),_0x2db4('0x5'),_0x2db4('0x6'),_0x2db4('0x4'),_0x2db4('0x4'),_0x2db4('0x4')];var channels={};function writeDB(_0x5a3089){utils['info'](util['format'](_0x2db4('0x7'),_0x5a3089['uniqueid'],_0x5a3089['channel'],_0x5a3089[_0x2db4('0x8')],_0x5a3089[_0x2db4('0x9')],_0x5a3089[_0x2db4('0xa')],_0x5a3089['destination'],_0x5a3089['callerid'],_0x5a3089[_0x2db4('0xb')]));if(_0x5a3089[_0x2db4('0x9')]){utils[_0x2db4('0xc')](_0x5a3089[_0x2db4('0x9')])[_0x2db4('0xd')](function(_0x496faf){if(_0x496faf){_0x5a3089['UserId']=_0x496faf['id'];}utils['request'](_0x2db4('0xe'),_0x5a3089);});}else{utils[_0x2db4('0xf')](_0x2db4('0xe'),_0x5a3089);}if(channels[_0x5a3089[_0x2db4('0x10')]]){delete channels[_0x5a3089[_0x2db4('0x10')]];}}exports[_0x2db4('0x11')]=function(_0x12d965){try{if(_0x12d965[_0x2db4('0x10')]==_0x12d965[_0x2db4('0x12')]&&_0x12d965[_0x2db4('0x13')]!=_0x2db4('0x14')){channels[_0x12d965[_0x2db4('0x10')]]={'uniqueid':_0x12d965[_0x2db4('0x10')],'accountcode':_0x12d965['accountcode'],'source':_0x12d965[_0x2db4('0x15')],'destination':_0x12d965[_0x2db4('0x16')],'destinationcontext':_0x12d965[_0x2db4('0x17')],'channel':_0x12d965[_0x2db4('0x13')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x2db4('0x18')};}}catch(_0xff3790){utils[_0x2db4('0x19')](_0xff3790[_0x2db4('0x1a')]);}};exports[_0x2db4('0x1b')]=function(_0x3864fb){try{if(!_[_0x2db4('0x1c')](channels[_0x3864fb['uniqueid']])&&_0x3864fb[_0x2db4('0x1d')]==0x6){if(_['isNil'](channels[_0x3864fb[_0x2db4('0x10')]][_0x2db4('0x1e')])){channels[_0x3864fb[_0x2db4('0x10')]][_0x2db4('0x1e')]=utils[_0x2db4('0x1f')]();}}else if(!_['isNil'](channels[_0x3864fb['linkedid']])&&_0x3864fb[_0x2db4('0x1d')]==0x6&&_0x3864fb[_0x2db4('0x17')]!=_0x2db4('0x20')){channels[_0x3864fb['linkedid']][_0x2db4('0x9')]=_0x3864fb[_0x2db4('0x9')];channels[_0x3864fb[_0x2db4('0x12')]]['destinationchannel']=_0x3864fb[_0x2db4('0x13')];if(_[_0x2db4('0x1c')](channels[_0x3864fb['linkedid']][_0x2db4('0x21')])){channels[_0x3864fb[_0x2db4('0x12')]][_0x2db4('0x21')]=utils[_0x2db4('0x1f')]();}channels[_0x3864fb[_0x2db4('0x12')]][_0x2db4('0xb')]=dispositions[_['toNumber'](_0x3864fb[_0x2db4('0x1d')])]||_0x2db4('0x5');}}catch(_0x3e6ab5){utils[_0x2db4('0x19')](_0x3e6ab5[_0x2db4('0x1a')]);}};exports['hangup']=function(_0x16e966){try{if(!_[_0x2db4('0x1c')](channels[_0x16e966[_0x2db4('0x10')]])){if(_['isNil'](channels[_0x16e966[_0x2db4('0x10')]][_0x2db4('0x22')])){channels[_0x16e966[_0x2db4('0x10')]][_0x2db4('0x22')]=_0x16e966[_0x2db4('0x23')]+'\x20<'+_0x16e966['calleridnum']+'>';}channels[_0x16e966[_0x2db4('0x10')]][_0x2db4('0x24')]=utils['now']();channels[_0x16e966[_0x2db4('0x10')]]['duration']=utils[_0x2db4('0x25')](channels[_0x16e966[_0x2db4('0x10')]][_0x2db4('0x24')],channels[_0x16e966['uniqueid']]['starttime']);channels[_0x16e966['uniqueid']][_0x2db4('0x26')]=channels[_0x16e966[_0x2db4('0x10')]][_0x2db4('0x21')]?utils[_0x2db4('0x25')](channels[_0x16e966[_0x2db4('0x10')]][_0x2db4('0x24')],channels[_0x16e966[_0x2db4('0x10')]][_0x2db4('0x21')]):0x0;writeDB(channels[_0x16e966[_0x2db4('0x10')]]);}}catch(_0x557100){utils[_0x2db4('0x19')](_0x557100[_0x2db4('0x1a')]);}};exports[_0x2db4('0x27')]=function(_0x49e183){try{if(!_[_0x2db4('0x1c')](channels[_0x49e183[_0x2db4('0x28')]])){if(channels[_0x49e183[_0x2db4('0x28')]][_0x2db4('0x13')]==_0x49e183['transfereechannel']){channels[_0x49e183['localtwolinkedid']][_0x2db4('0x29')]=_0x49e183[_0x2db4('0x2a')];channels[_0x49e183['localtwolinkedid']]['userfield']=_0x2db4('0x2b');}else if(channels[_0x49e183['localtwolinkedid']][_0x2db4('0x13')]=_0x49e183[_0x2db4('0x2c')]){channels[_0x49e183[_0x2db4('0x28')]][_0x2db4('0x29')]=_0x49e183[_0x2db4('0x2d')];channels[_0x49e183[_0x2db4('0x28')]][_0x2db4('0x2e')]=_0x2db4('0x2b');}}}catch(_0x56f719){utils[_0x2db4('0x19')](_0x56f719[_0x2db4('0x1a')]);}};exports[_0x2db4('0x2f')]=function(_0x4e5fd5){try{if(!_[_0x2db4('0x1c')](channels[_0x4e5fd5['uniqueid']])){channels[_0x4e5fd5[_0x2db4('0x10')]][_0x2db4('0x30')]=utils[_0x2db4('0x1f')]();}}catch(_0x4153d4){utils[_0x2db4('0x19')](_0x4153d4['stack']);}};exports[_0x2db4('0x31')]=function(_0xa18ac5){try{if(!_[_0x2db4('0x1c')](channels[_0xa18ac5['uniqueid']])){if(!_['isNil'](channels[_0xa18ac5[_0x2db4('0x10')]][_0x2db4('0x30')])){channels[_0xa18ac5[_0x2db4('0x10')]][_0x2db4('0x32')]+=utils[_0x2db4('0x25')](utils[_0x2db4('0x1f')](),channels[_0xa18ac5['uniqueid']][_0x2db4('0x30')]);delete channels[_0xa18ac5['uniqueid']][_0x2db4('0x30')];}}}catch(_0x3bcc63){utils[_0x2db4('0x19')](_0x3bcc63[_0x2db4('0x1a')]);}};exports['varset']=function(_0x9b574a){try{if(!_[_0x2db4('0x1c')](channels[_0x9b574a[_0x2db4('0x10')]])){if(!_['isNil'](_0x9b574a['variable']['xmd-originatecalleridnum'])){channels[_0x9b574a['uniqueid']][_0x2db4('0xa')]=_0x9b574a[_0x2db4('0x33')];}if(!_[_0x2db4('0x1c')](_0x9b574a[_0x2db4('0x34')][_0x2db4('0x35')])){channels[_0x9b574a[_0x2db4('0x10')]]['destination']=_0x9b574a[_0x2db4('0x33')];channels[_0x9b574a[_0x2db4('0x10')]][_0x2db4('0x22')]='\x22'+_0x9b574a[_0x2db4('0x33')]+'\x22\x20<'+_0x9b574a[_0x2db4('0x33')]+'>';}if(!_[_0x2db4('0x1c')](_0x9b574a[_0x2db4('0x34')]['xmd-callerid-preview'])||!_[_0x2db4('0x1c')](_0x9b574a[_0x2db4('0x34')][_0x2db4('0x36')])){channels[_0x9b574a[_0x2db4('0x10')]]['callerid']=_0x9b574a[_0x2db4('0x33')];}if(!_['isNil'](_0x9b574a['variable'][_0x2db4('0x37')])||!_[_0x2db4('0x1c')](_0x9b574a['variable'][_0x2db4('0x38')])){channels[_0x9b574a[_0x2db4('0x10')]]['lastapplication']='Queue';channels[_0x9b574a[_0x2db4('0x10')]][_0x2db4('0x39')]=_0x9b574a[_0x2db4('0x33')];channels[_0x9b574a[_0x2db4('0x10')]][_0x2db4('0x3a')]=!![];}if(!_['isNil'](_0x9b574a[_0x2db4('0x34')][_0x2db4('0x3b')])){channels[_0x9b574a[_0x2db4('0x10')]][_0x2db4('0x3c')]=_0x9b574a[_0x2db4('0x33')];}if(!_[_0x2db4('0x1c')](_0x9b574a[_0x2db4('0x34')][_0x2db4('0x3d')])){channels[_0x9b574a[_0x2db4('0x10')]]['type']=_0x9b574a[_0x2db4('0x33')];}if(!_[_0x2db4('0x1c')](_0x9b574a['variable'][_0x2db4('0x3e')])){channels[_0x9b574a[_0x2db4('0x10')]][_0x2db4('0x3f')]=_0x9b574a[_0x2db4('0x33')];}if(!_['isNil'](_0x9b574a[_0x2db4('0x34')]['sipcallid'])){channels[_0x9b574a['uniqueid']]['sipcallid']=_0x9b574a[_0x2db4('0x33')];}}}catch(_0x3cdcae){utils[_0x2db4('0x19')](_0x3cdcae[_0x2db4('0x1a')]);}};exports[_0x2db4('0x40')]=function(_0x26a9a8){try{if(!_[_0x2db4('0x1c')](channels[_0x26a9a8[_0x2db4('0x10')]])){if(_0x26a9a8[_0x2db4('0x41')]['toLowerCase']()=='set'&&_[_0x2db4('0x42')](_0x26a9a8[_0x2db4('0x43')][_0x2db4('0x44')](),'cdr')){var _0x1da3c7=_0x26a9a8[_0x2db4('0x43')][_0x2db4('0x45')]('=');var _0x20baed=_0x1da3c7[0x0][_0x2db4('0x46')](_0x1da3c7[0x0][_0x2db4('0x47')]('(')+0x1,_0x1da3c7[0x0][_0x2db4('0x47')](')'));var _0x3e5d31=_0x1da3c7[0x1];channels[_0x26a9a8[_0x2db4('0x10')]][_0x20baed]=_0x3e5d31;}if(!_[_0x2db4('0x48')]([_0x2db4('0x49'),_0x2db4('0x4a'),_0x2db4('0x4b'),_0x2db4('0x4c'),_0x2db4('0x4d')],_0x26a9a8[_0x2db4('0x41')][_0x2db4('0x44')]())){channels[_0x26a9a8['uniqueid']]['lastapplication']=_0x26a9a8[_0x2db4('0x41')];channels[_0x26a9a8[_0x2db4('0x10')]][_0x2db4('0x39')]=_0x26a9a8[_0x2db4('0x43')];}}}catch(_0x4b2b13){utils[_0x2db4('0x19')](_0x4b2b13[_0x2db4('0x1a')]);}}; \ No newline at end of file +var _0xf99c=['linkedid','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','stack','newstate','channelstate','isNil','systemanswertime','transfer','answertime','toNumber','ANSWERED','hangup','callerid','calleridname','endtime','duration','diffTime','starttime','attendedtransfer','transfereechannel','localtwolinkedid','destinationchannel','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','musiconholdstop','musiconholdstartAt','mohtime','varset','variable','value','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','appdata','toLowerCase','cdr','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','destination','disposition','then','request','newchannel'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0xf99c,0x8c));var _0xcf99=function(_0x402aef,_0xffe1f6){_0x402aef=_0x402aef-0x0;var _0x231b1c=_0xf99c[_0x402aef];return _0x231b1c;};'use strict';var _=require(_0xcf99('0x0'));var util=require(_0xcf99('0x1'));var utils=require(_0xcf99('0x2'));var dispositions=[_0xcf99('0x3'),_0xcf99('0x4'),_0xcf99('0x4'),_0xcf99('0x3'),_0xcf99('0x3'),_0xcf99('0x3'),'ANSWERED',_0xcf99('0x5'),_0xcf99('0x4'),_0xcf99('0x4'),'FAILED'];var channels={};function writeDB(_0x20c9f7){utils[_0xcf99('0x6')](util[_0xcf99('0x7')](_0xcf99('0x8'),_0x20c9f7[_0xcf99('0x9')],_0x20c9f7[_0xcf99('0xa')],_0x20c9f7['type'],_0x20c9f7[_0xcf99('0xb')],_0x20c9f7[_0xcf99('0xc')],_0x20c9f7[_0xcf99('0xd')],_0x20c9f7['callerid'],_0x20c9f7[_0xcf99('0xe')]));if(_0x20c9f7[_0xcf99('0xb')]){utils['getUserByInternal'](_0x20c9f7[_0xcf99('0xb')])[_0xcf99('0xf')](function(_0x2c3c4f){if(_0x2c3c4f){_0x20c9f7['UserId']=_0x2c3c4f['id'];}utils[_0xcf99('0x10')]('CreateVoiceCallReport',_0x20c9f7);});}else{utils[_0xcf99('0x10')]('CreateVoiceCallReport',_0x20c9f7);}if(channels[_0x20c9f7[_0xcf99('0x9')]]){delete channels[_0x20c9f7[_0xcf99('0x9')]];}}exports[_0xcf99('0x11')]=function(_0x3e7a61){try{if(_0x3e7a61[_0xcf99('0x9')]==_0x3e7a61[_0xcf99('0x12')]&&_0x3e7a61[_0xcf99('0xa')]!=_0xcf99('0x13')){channels[_0x3e7a61['uniqueid']]={'uniqueid':_0x3e7a61[_0xcf99('0x9')],'accountcode':_0x3e7a61[_0xcf99('0xb')],'source':_0x3e7a61[_0xcf99('0x14')],'destination':_0x3e7a61[_0xcf99('0x15')],'destinationcontext':_0x3e7a61[_0xcf99('0x16')],'channel':_0x3e7a61[_0xcf99('0xa')],'starttime':utils[_0xcf99('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xcf99('0x3'),'amaflags':_0xcf99('0x18')};}}catch(_0x3713f8){utils[_0xcf99('0x19')](_0x3713f8[_0xcf99('0x1a')]);}};exports[_0xcf99('0x1b')]=function(_0x3d3d41){try{if(!_['isNil'](channels[_0x3d3d41[_0xcf99('0x9')]])&&_0x3d3d41[_0xcf99('0x1c')]==0x6){if(_[_0xcf99('0x1d')](channels[_0x3d3d41['uniqueid']][_0xcf99('0x1e')])){channels[_0x3d3d41[_0xcf99('0x9')]][_0xcf99('0x1e')]=utils[_0xcf99('0x17')]();}}else if(!_['isNil'](channels[_0x3d3d41['linkedid']])&&_0x3d3d41[_0xcf99('0x1c')]==0x6&&_0x3d3d41[_0xcf99('0x16')]!=_0xcf99('0x1f')){channels[_0x3d3d41[_0xcf99('0x12')]][_0xcf99('0xb')]=_0x3d3d41[_0xcf99('0xb')];channels[_0x3d3d41[_0xcf99('0x12')]]['destinationchannel']=_0x3d3d41[_0xcf99('0xa')];if(_[_0xcf99('0x1d')](channels[_0x3d3d41[_0xcf99('0x12')]][_0xcf99('0x20')])){channels[_0x3d3d41[_0xcf99('0x12')]][_0xcf99('0x20')]=utils[_0xcf99('0x17')]();}channels[_0x3d3d41[_0xcf99('0x12')]][_0xcf99('0xe')]=dispositions[_[_0xcf99('0x21')](_0x3d3d41['channelstate'])]||_0xcf99('0x22');}}catch(_0x3ffb06){utils[_0xcf99('0x19')](_0x3ffb06['stack']);}};exports[_0xcf99('0x23')]=function(_0x33397c){try{if(!_[_0xcf99('0x1d')](channels[_0x33397c[_0xcf99('0x9')]])){if(_[_0xcf99('0x1d')](channels[_0x33397c[_0xcf99('0x9')]]['callerid'])){channels[_0x33397c[_0xcf99('0x9')]][_0xcf99('0x24')]=_0x33397c[_0xcf99('0x25')]+'\x20<'+_0x33397c['calleridnum']+'>';}channels[_0x33397c[_0xcf99('0x9')]][_0xcf99('0x26')]=utils['now']();channels[_0x33397c['uniqueid']][_0xcf99('0x27')]=utils[_0xcf99('0x28')](channels[_0x33397c[_0xcf99('0x9')]][_0xcf99('0x26')],channels[_0x33397c[_0xcf99('0x9')]][_0xcf99('0x29')]);channels[_0x33397c[_0xcf99('0x9')]]['billableseconds']=channels[_0x33397c[_0xcf99('0x9')]][_0xcf99('0x20')]?utils['diffTime'](channels[_0x33397c['uniqueid']]['endtime'],channels[_0x33397c[_0xcf99('0x9')]][_0xcf99('0x20')]):0x0;writeDB(channels[_0x33397c[_0xcf99('0x9')]]);}}catch(_0x2ba210){utils[_0xcf99('0x19')](_0x2ba210['stack']);}};exports[_0xcf99('0x2a')]=function(_0x4a8d23){try{if(!_[_0xcf99('0x1d')](channels[_0x4a8d23['localtwolinkedid']])){if(channels[_0x4a8d23['localtwolinkedid']][_0xcf99('0xa')]==_0x4a8d23[_0xcf99('0x2b')]){channels[_0x4a8d23[_0xcf99('0x2c')]][_0xcf99('0x2d')]=_0x4a8d23[_0xcf99('0x2e')];channels[_0x4a8d23['localtwolinkedid']][_0xcf99('0x2f')]=_0xcf99('0x30');}else if(channels[_0x4a8d23['localtwolinkedid']][_0xcf99('0xa')]=_0x4a8d23['transfertargetchannel']){channels[_0x4a8d23[_0xcf99('0x2c')]][_0xcf99('0x2d')]=_0x4a8d23[_0xcf99('0x31')];channels[_0x4a8d23['localtwolinkedid']]['userfield']=_0xcf99('0x30');}}}catch(_0x5c7696){utils[_0xcf99('0x19')](_0x5c7696[_0xcf99('0x1a')]);}};exports[_0xcf99('0x32')]=function(_0x2d82a2){try{if(!_['isNil'](channels[_0x2d82a2[_0xcf99('0x9')]])){channels[_0x2d82a2[_0xcf99('0x9')]]['musiconholdstartAt']=utils['now']();}}catch(_0xca9548){utils['error'](_0xca9548['stack']);}};exports[_0xcf99('0x33')]=function(_0x164fb5){try{if(!_['isNil'](channels[_0x164fb5['uniqueid']])){if(!_[_0xcf99('0x1d')](channels[_0x164fb5[_0xcf99('0x9')]][_0xcf99('0x34')])){channels[_0x164fb5['uniqueid']][_0xcf99('0x35')]+=utils[_0xcf99('0x28')](utils[_0xcf99('0x17')](),channels[_0x164fb5[_0xcf99('0x9')]]['musiconholdstartAt']);delete channels[_0x164fb5['uniqueid']][_0xcf99('0x34')];}}}catch(_0x33e5d0){utils['error'](_0x33e5d0[_0xcf99('0x1a')]);}};exports[_0xcf99('0x36')]=function(_0x38ae94){try{if(!_[_0xcf99('0x1d')](channels[_0x38ae94[_0xcf99('0x9')]])){if(!_[_0xcf99('0x1d')](_0x38ae94[_0xcf99('0x37')]['xmd-originatecalleridnum'])){channels[_0x38ae94[_0xcf99('0x9')]]['source']=_0x38ae94['value'];}if(!_[_0xcf99('0x1d')](_0x38ae94[_0xcf99('0x37')]['xmd-phone'])){channels[_0x38ae94[_0xcf99('0x9')]][_0xcf99('0xd')]=_0x38ae94['value'];channels[_0x38ae94[_0xcf99('0x9')]][_0xcf99('0x24')]='\x22'+_0x38ae94[_0xcf99('0x38')]+'\x22\x20<'+_0x38ae94['value']+'>';}if(!_[_0xcf99('0x1d')](_0x38ae94[_0xcf99('0x37')][_0xcf99('0x39')])||!_['isNil'](_0x38ae94[_0xcf99('0x37')][_0xcf99('0x3a')])){channels[_0x38ae94['uniqueid']][_0xcf99('0x24')]=_0x38ae94[_0xcf99('0x38')];}if(!_[_0xcf99('0x1d')](_0x38ae94[_0xcf99('0x37')][_0xcf99('0x3b')])||!_['isNil'](_0x38ae94['variable'][_0xcf99('0x3c')])){channels[_0x38ae94[_0xcf99('0x9')]][_0xcf99('0x3d')]=_0xcf99('0x3e');channels[_0x38ae94[_0xcf99('0x9')]][_0xcf99('0x3f')]=_0x38ae94[_0xcf99('0x38')];channels[_0x38ae94[_0xcf99('0x9')]][_0xcf99('0x40')]=!![];}if(!_['isNil'](_0x38ae94['variable']['xmd-contactid'])){channels[_0x38ae94[_0xcf99('0x9')]]['ContactId']=_0x38ae94[_0xcf99('0x38')];}if(!_[_0xcf99('0x1d')](_0x38ae94[_0xcf99('0x37')][_0xcf99('0x41')])){channels[_0x38ae94['uniqueid']]['type']=_0x38ae94[_0xcf99('0x38')];}if(!_[_0xcf99('0x1d')](_0x38ae94[_0xcf99('0x37')][_0xcf99('0x42')])){channels[_0x38ae94[_0xcf99('0x9')]][_0xcf99('0x43')]=_0x38ae94[_0xcf99('0x38')];}if(!_[_0xcf99('0x1d')](_0x38ae94[_0xcf99('0x37')][_0xcf99('0x44')])){channels[_0x38ae94[_0xcf99('0x9')]][_0xcf99('0x44')]=_0x38ae94[_0xcf99('0x38')];}}}catch(_0x48c990){utils[_0xcf99('0x19')](_0x48c990['stack']);}};exports[_0xcf99('0x45')]=function(_0xe0b9d9){try{if(!_[_0xcf99('0x1d')](channels[_0xe0b9d9['uniqueid']])){if(_0xe0b9d9[_0xcf99('0x46')]['toLowerCase']()=='set'&&_['startsWith'](_0xe0b9d9[_0xcf99('0x47')][_0xcf99('0x48')](),_0xcf99('0x49'))){var _0x26fd7e=_0xe0b9d9[_0xcf99('0x47')]['split']('=');var _0x3ca3a8=_0x26fd7e[0x0]['substring'](_0x26fd7e[0x0]['lastIndexOf']('(')+0x1,_0x26fd7e[0x0][_0xcf99('0x4a')](')'));var _0x1bf729=_0x26fd7e[0x1];channels[_0xe0b9d9[_0xcf99('0x9')]][_0x3ca3a8]=_0x1bf729;}if(!_[_0xcf99('0x4b')]([_0xcf99('0x23'),_0xcf99('0x4c'),_0xcf99('0x4d'),'set',_0xcf99('0x4e')],_0xe0b9d9[_0xcf99('0x46')][_0xcf99('0x48')]())){channels[_0xe0b9d9[_0xcf99('0x9')]][_0xcf99('0x3d')]=_0xe0b9d9[_0xcf99('0x46')];channels[_0xe0b9d9['uniqueid']]['lastdata']=_0xe0b9d9[_0xcf99('0x47')];}}}catch(_0x2f978b){utils['error'](_0x2f978b[_0xcf99('0x1a')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index a3ec784..678051c 100644 --- a/server/services/xdr/core.controller.js +++ b/server/services/xdr/core.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeda8=['shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','lodash','info','CONNECTED'];(function(_0x7cf8eb,_0x5a470e){var _0x24e417=function(_0x10caea){while(--_0x10caea){_0x7cf8eb['push'](_0x7cf8eb['shift']());}};_0x24e417(++_0x5a470e);}(_0xeda8,0x104));var _0x8eda=function(_0x5a58da,_0x5a6913){_0x5a58da=_0x5a58da-0x0;var _0x4471e7=_0xeda8[_0x5a58da];return _0x4471e7;};'use strict';var utils=require(_0x8eda('0x0'));var _=require(_0x8eda('0x1'));exports['connect']=function(){utils[_0x8eda('0x2')](_0x8eda('0x3'));};exports[_0x8eda('0x4')]=function(){utils[_0x8eda('0x2')](_0x8eda('0x5'));};exports[_0x8eda('0x6')]=function(){utils[_0x8eda('0x2')](_0x8eda('0x7'));};exports[_0x8eda('0x8')]=function(_0x1f3556){utils[_0x8eda('0x8')](_0x1f3556);};exports[_0x8eda('0x9')]=function(){utils['info'](_0x8eda('0xa'));};exports[_0x8eda('0xb')]=function(_0x5aa93d){}; \ No newline at end of file +var _0x5fab=['managerevent','./utils','lodash','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','CLOSE'];(function(_0x18eec1,_0x7ebb75){var _0x4c229e=function(_0x314406){while(--_0x314406){_0x18eec1['push'](_0x18eec1['shift']());}};_0x4c229e(++_0x7ebb75);}(_0x5fab,0x177));var _0xb5fa=function(_0x337537,_0x4ea7b8){_0x337537=_0x337537-0x0;var _0x4fdd67=_0x5fab[_0x337537];return _0x4fdd67;};'use strict';var utils=require(_0xb5fa('0x0'));var _=require(_0xb5fa('0x1'));exports['connect']=function(){utils[_0xb5fa('0x2')](_0xb5fa('0x3'));};exports[_0xb5fa('0x4')]=function(){utils[_0xb5fa('0x2')](_0xb5fa('0x5'));};exports[_0xb5fa('0x6')]=function(){utils[_0xb5fa('0x2')](_0xb5fa('0x7'));};exports[_0xb5fa('0x8')]=function(_0x44df89){utils['error'](_0x44df89);};exports['close']=function(){utils[_0xb5fa('0x2')](_0xb5fa('0x9'));};exports[_0xb5fa('0xa')]=function(_0x56d018){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index dcd16c5..e4108ec 100644 --- a/server/services/xdr/dials.controller.js +++ b/server/services/xdr/dials.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a6a=['split','error','stack','varset','isNil','variable','value','assign','starttime','now','lastevent','called','dialend','dialstatus','answertime','connect','hangup','complete','holdtime','diffTime','billableseconds','util','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x9a6a,0xce));var _0xa9a6=function(_0xf6fc7c,_0x4c29ab){_0xf6fc7c=_0xf6fc7c-0x0;var _0xccc936=_0x9a6a[_0xf6fc7c];return _0xccc936;};'use strict';var _=require('lodash');var util=require(_0xa9a6('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x2835b7){utils[_0xa9a6('0x1')](util['format'](_0xa9a6('0x2'),_0x2835b7[_0xa9a6('0x3')],_0x2835b7[_0xa9a6('0x4')],_0x2835b7[_0xa9a6('0x5')],_0x2835b7[_0xa9a6('0x6')],_0x2835b7['connectedlinenum'],_0x2835b7['dialstatus']));utils[_0xa9a6('0x7')](_0xa9a6('0x8'),_0x2835b7);delete dials[_0x2835b7[_0xa9a6('0x3')]];}exports[_0xa9a6('0x9')]=function(_0x4ea0ea){try{if(_0x4ea0ea[_0xa9a6('0xa')][_0xa9a6('0xb')]()==_0xa9a6('0xc')&&_[_0xa9a6('0xd')](_0x4ea0ea[_0xa9a6('0xe')][_0xa9a6('0xb')](),_0xa9a6('0xf'))){var _0x22bbc9=_0x4ea0ea[_0xa9a6('0xe')][_0xa9a6('0x10')]('=');dials[_0x4ea0ea[_0xa9a6('0x3')]]={'routeId':_0x22bbc9[0x1]};}}catch(_0x45d8a4){utils[_0xa9a6('0x11')](_0x45d8a4[_0xa9a6('0x12')]);}};exports[_0xa9a6('0x13')]=function(_0x109122){try{if(!_[_0xa9a6('0x14')](_0x109122[_0xa9a6('0x15')]['outboundrouteid'])){dials[_0x109122[_0xa9a6('0x3')]]={'routeId':_0x109122[_0xa9a6('0x16')]};}}catch(_0x11356f){utils[_0xa9a6('0x11')](_0x11356f['stack']);}};exports['dialbegin']=function(_0x12dd24){try{if(!_['isNil'](dials[_0x12dd24[_0xa9a6('0x3')]])){dials[_0x12dd24[_0xa9a6('0x3')]]=_[_0xa9a6('0x17')](dials[_0x12dd24[_0xa9a6('0x3')]],_0x12dd24);dials[_0x12dd24[_0xa9a6('0x3')]][_0xa9a6('0x18')]=utils[_0xa9a6('0x19')]();dials[_0x12dd24[_0xa9a6('0x3')]][_0xa9a6('0x1a')]=_0xa9a6('0x1b');}}catch(_0x29d64d){utils[_0xa9a6('0x11')](_0x29d64d[_0xa9a6('0x12')]);}};exports[_0xa9a6('0x1c')]=function(_0x321bad){try{if(!_['isNil'](dials[_0x321bad['uniqueid']])){dials[_0x321bad[_0xa9a6('0x3')]][_0xa9a6('0x1d')]=_0x321bad[_0xa9a6('0x1d')];if(_0x321bad[_0xa9a6('0x1d')]=='ANSWER'){dials[_0x321bad[_0xa9a6('0x3')]]=_[_0xa9a6('0x17')](dials[_0x321bad[_0xa9a6('0x3')]],_0x321bad);dials[_0x321bad[_0xa9a6('0x3')]][_0xa9a6('0x1e')]=utils[_0xa9a6('0x19')]();dials[_0x321bad['uniqueid']]['lastevent']=_0xa9a6('0x1f');}}}catch(_0x5c53b1){utils[_0xa9a6('0x11')](_0x5c53b1[_0xa9a6('0x12')]);}};exports[_0xa9a6('0x20')]=function(_0x753d50){try{if(!_[_0xa9a6('0x14')](dials[_0x753d50[_0xa9a6('0x3')]])){dials[_0x753d50[_0xa9a6('0x3')]]=_[_0xa9a6('0x17')](dials[_0x753d50[_0xa9a6('0x3')]],{'endtime':utils[_0xa9a6('0x19')](),'lastevent':_0xa9a6('0x21')});dials[_0x753d50[_0xa9a6('0x3')]]['duration']=utils['diffTime'](dials[_0x753d50['uniqueid']]['endtime'],dials[_0x753d50[_0xa9a6('0x3')]][_0xa9a6('0x18')]);dials[_0x753d50[_0xa9a6('0x3')]][_0xa9a6('0x22')]=utils[_0xa9a6('0x23')](dials[_0x753d50[_0xa9a6('0x3')]]['answertime']||dials[_0x753d50[_0xa9a6('0x3')]]['endtime'],dials[_0x753d50[_0xa9a6('0x3')]]['starttime']);dials[_0x753d50['uniqueid']][_0xa9a6('0x24')]=dials[_0x753d50[_0xa9a6('0x3')]][_0xa9a6('0x1e')]?utils[_0xa9a6('0x23')](dials[_0x753d50[_0xa9a6('0x3')]]['endtime'],dials[_0x753d50[_0xa9a6('0x3')]]['answertime']):0x0;writeDB(dials[_0x753d50[_0xa9a6('0x3')]]);}}catch(_0x25dcba){utils['error'](_0x25dcba['stack']);}}; \ No newline at end of file +var _0xbfa6=['split','error','stack','varset','isNil','variable','outboundrouteid','value','dialbegin','assign','starttime','called','ANSWER','answertime','now','lastevent','connect','hangup','complete','duration','endtime','holdtime','diffTime','billableseconds','lodash','util','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','toLowerCase','set','startsWith','appdata','cdr(routeid)'];(function(_0x49dc71,_0x4a9ba3){var _0x2552d7=function(_0x25683){while(--_0x25683){_0x49dc71['push'](_0x49dc71['shift']());}};_0x2552d7(++_0x4a9ba3);}(_0xbfa6,0x1d0));var _0x6bfa=function(_0xc6ea98,_0x1f0fe7){_0xc6ea98=_0xc6ea98-0x0;var _0x154999=_0xbfa6[_0xc6ea98];return _0x154999;};'use strict';var _=require(_0x6bfa('0x0'));var util=require(_0x6bfa('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x4c83d7){utils['info'](util[_0x6bfa('0x2')](_0x6bfa('0x3'),_0x4c83d7[_0x6bfa('0x4')],_0x4c83d7['channel'],_0x4c83d7[_0x6bfa('0x5')],_0x4c83d7[_0x6bfa('0x6')],_0x4c83d7[_0x6bfa('0x7')],_0x4c83d7[_0x6bfa('0x8')]));utils[_0x6bfa('0x9')](_0x6bfa('0xa'),_0x4c83d7);delete dials[_0x4c83d7[_0x6bfa('0x4')]];}exports['newexten']=function(_0x1ad59f){try{if(_0x1ad59f['application'][_0x6bfa('0xb')]()==_0x6bfa('0xc')&&_[_0x6bfa('0xd')](_0x1ad59f[_0x6bfa('0xe')][_0x6bfa('0xb')](),_0x6bfa('0xf'))){var _0x2091b7=_0x1ad59f[_0x6bfa('0xe')][_0x6bfa('0x10')]('=');dials[_0x1ad59f[_0x6bfa('0x4')]]={'routeId':_0x2091b7[0x1]};}}catch(_0x570bdb){utils[_0x6bfa('0x11')](_0x570bdb[_0x6bfa('0x12')]);}};exports[_0x6bfa('0x13')]=function(_0x4a0ad1){try{if(!_[_0x6bfa('0x14')](_0x4a0ad1[_0x6bfa('0x15')][_0x6bfa('0x16')])){dials[_0x4a0ad1[_0x6bfa('0x4')]]={'routeId':_0x4a0ad1[_0x6bfa('0x17')]};}}catch(_0x5d2c05){utils[_0x6bfa('0x11')](_0x5d2c05['stack']);}};exports[_0x6bfa('0x18')]=function(_0x255c89){try{if(!_[_0x6bfa('0x14')](dials[_0x255c89[_0x6bfa('0x4')]])){dials[_0x255c89[_0x6bfa('0x4')]]=_[_0x6bfa('0x19')](dials[_0x255c89[_0x6bfa('0x4')]],_0x255c89);dials[_0x255c89[_0x6bfa('0x4')]][_0x6bfa('0x1a')]=utils['now']();dials[_0x255c89[_0x6bfa('0x4')]]['lastevent']=_0x6bfa('0x1b');}}catch(_0xa99566){utils[_0x6bfa('0x11')](_0xa99566[_0x6bfa('0x12')]);}};exports['dialend']=function(_0x508196){try{if(!_['isNil'](dials[_0x508196['uniqueid']])){dials[_0x508196[_0x6bfa('0x4')]]['dialstatus']=_0x508196[_0x6bfa('0x8')];if(_0x508196[_0x6bfa('0x8')]==_0x6bfa('0x1c')){dials[_0x508196[_0x6bfa('0x4')]]=_[_0x6bfa('0x19')](dials[_0x508196[_0x6bfa('0x4')]],_0x508196);dials[_0x508196[_0x6bfa('0x4')]][_0x6bfa('0x1d')]=utils[_0x6bfa('0x1e')]();dials[_0x508196[_0x6bfa('0x4')]][_0x6bfa('0x1f')]=_0x6bfa('0x20');}}}catch(_0xa24a21){utils[_0x6bfa('0x11')](_0xa24a21[_0x6bfa('0x12')]);}};exports[_0x6bfa('0x21')]=function(_0x4db75d){try{if(!_[_0x6bfa('0x14')](dials[_0x4db75d[_0x6bfa('0x4')]])){dials[_0x4db75d['uniqueid']]=_[_0x6bfa('0x19')](dials[_0x4db75d[_0x6bfa('0x4')]],{'endtime':utils[_0x6bfa('0x1e')](),'lastevent':_0x6bfa('0x22')});dials[_0x4db75d[_0x6bfa('0x4')]][_0x6bfa('0x23')]=utils['diffTime'](dials[_0x4db75d['uniqueid']][_0x6bfa('0x24')],dials[_0x4db75d[_0x6bfa('0x4')]][_0x6bfa('0x1a')]);dials[_0x4db75d[_0x6bfa('0x4')]][_0x6bfa('0x25')]=utils[_0x6bfa('0x26')](dials[_0x4db75d[_0x6bfa('0x4')]][_0x6bfa('0x1d')]||dials[_0x4db75d[_0x6bfa('0x4')]][_0x6bfa('0x24')],dials[_0x4db75d[_0x6bfa('0x4')]]['starttime']);dials[_0x4db75d[_0x6bfa('0x4')]][_0x6bfa('0x27')]=dials[_0x4db75d['uniqueid']][_0x6bfa('0x1d')]?utils['diffTime'](dials[_0x4db75d[_0x6bfa('0x4')]][_0x6bfa('0x24')],dials[_0x4db75d[_0x6bfa('0x4')]][_0x6bfa('0x1d')]):0x0;writeDB(dials[_0x4db75d[_0x6bfa('0x4')]]);}}catch(_0x23ab8a){utils['error'](_0x23ab8a[_0x6bfa('0x12')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 8c5fc7f..2faac7e 100644 --- a/server/services/xdr/index.js +++ b/server/services/xdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd349=['agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','asterisk','port','username','password','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','agentringnoanswer','agentconnect'];(function(_0x167302,_0x36e3d1){var _0x19a908=function(_0x2bcc1b){while(--_0x2bcc1b){_0x167302['push'](_0x167302['shift']());}};_0x19a908(++_0x36e3d1);}(_0xd349,0x1d3));var _0x9d34=function(_0x56fbda,_0x534837){_0x56fbda=_0x56fbda-0x0;var _0xd89ac5=_0xd349[_0x56fbda];return _0xd89ac5;};var AsteriskManager=require(_0x9d34('0x0'));var config=require(_0x9d34('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x9d34('0x2')][_0x9d34('0x3')],config[_0x9d34('0x2')]['ip'],config[_0x9d34('0x2')][_0x9d34('0x4')],config[_0x9d34('0x2')][_0x9d34('0x5')],!![]);ami['keepConnected']();if(config[_0x9d34('0x6')]&&config['xdr'][_0x9d34('0x7')]){utils[_0x9d34('0x8')](_0x9d34('0x9'));}else{var agents=require(_0x9d34('0xa'));var calls=require('./calls.controller');var queues=require(_0x9d34('0xb'));var recordings=require(_0x9d34('0xc'));var members=require(_0x9d34('0xd'));var dials=require(_0x9d34('0xe'));var transfers=require(_0x9d34('0xf'));var core=require(_0x9d34('0x10'));ami['on'](_0x9d34('0x11'),core['connect']);ami['on'](_0x9d34('0x12'),core['shutdown']);ami['on']('fullybooted',core[_0x9d34('0x13')]);ami['on'](_0x9d34('0x14'),core[_0x9d34('0x14')]);ami['on'](_0x9d34('0x15'),core[_0x9d34('0x15')]);ami['on'](_0x9d34('0x16'),core[_0x9d34('0x16')]);ami['on']('devicestatechange',function(_0x3522d9){try{members['devicestatechange'](_0x3522d9);}catch(_0x53f77d){utils[_0x9d34('0x14')](_0x53f77d);}});ami['on']('agentcalled',function(_0x34b06e){try{agents['agentcalled'](_0x34b06e);}catch(_0x1e18a5){utils[_0x9d34('0x14')](_0x1e18a5);}});ami['on'](_0x9d34('0x17'),function(_0x2ae66b){try{agents[_0x9d34('0x17')](_0x2ae66b);}catch(_0x2ba483){utils['error'](_0x2ba483);}});ami['on'](_0x9d34('0x18'),function(_0x460d47){try{agents[_0x9d34('0x18')](_0x460d47);queues[_0x9d34('0x18')](_0x460d47);}catch(_0x406c2c){utils['error'](_0x406c2c);}});ami['on'](_0x9d34('0x19'),function(_0x40f624){try{agents[_0x9d34('0x19')](_0x40f624);queues[_0x9d34('0x19')](_0x40f624);members[_0x9d34('0x19')](_0x40f624);}catch(_0x3107bb){utils[_0x9d34('0x14')](_0x3107bb);}});ami['on']('queuecallerabandon',function(_0x1017d8){try{agents['queuecallerabandon'](_0x1017d8);queues[_0x9d34('0x1a')](_0x1017d8);}catch(_0x19b351){utils[_0x9d34('0x14')](_0x19b351);}});ami['on'](_0x9d34('0x1b'),function(_0x43ad7a){try{queues['queuecallerjoin'](_0x43ad7a);recordings['queuecallerjoin'](_0x43ad7a);}catch(_0x224098){utils[_0x9d34('0x14')](_0x224098);}});ami['on'](_0x9d34('0x1c'),function(_0x665b5e){try{queues['queuecallerleave'](_0x665b5e);}catch(_0x1a6196){utils[_0x9d34('0x14')](_0x1a6196);}});ami['on']('musiconholdstart',function(_0x389d6e){try{queues[_0x9d34('0x1d')](_0x389d6e);calls['musiconholdstart'](_0x389d6e);}catch(_0x4dc13f){utils['error'](_0x4dc13f);}});ami['on'](_0x9d34('0x1e'),function(_0x57d7cb){try{queues['musiconholdstop'](_0x57d7cb);calls[_0x9d34('0x1e')](_0x57d7cb);}catch(_0x146d48){utils[_0x9d34('0x14')](_0x146d48);}});ami['on']('newstate',function(_0x5706ca){try{calls[_0x9d34('0x1f')](_0x5706ca);recordings['newstate'](_0x5706ca);}catch(_0xbef4f7){utils[_0x9d34('0x14')](_0xbef4f7);}});ami['on']('hangup',function(_0x5b23b1){try{calls[_0x9d34('0x20')](_0x5b23b1);recordings[_0x9d34('0x20')](_0x5b23b1);dials[_0x9d34('0x20')](_0x5b23b1);agents[_0x9d34('0x20')](_0x5b23b1);queues[_0x9d34('0x20')](_0x5b23b1);}catch(_0x7f4dfa){utils[_0x9d34('0x14')](_0x7f4dfa);}});ami['on'](_0x9d34('0x21'),function(_0x301a18){try{members[_0x9d34('0x21')](_0x301a18);}catch(_0x479e2f){utils[_0x9d34('0x14')](_0x479e2f);}});ami['on']('blindtransfer',function(_0x15d71a){try{queues['blindtransfer'](_0x15d71a);agents[_0x9d34('0x22')](_0x15d71a);transfers[_0x9d34('0x22')](_0x15d71a);}catch(_0x59c43a){utils[_0x9d34('0x14')](_0x59c43a);}});ami['on']('attendedtransfer',function(_0x547e62){try{queues[_0x9d34('0x23')](_0x547e62);transfers[_0x9d34('0x23')](_0x547e62);agents['attendedtransfer'](_0x547e62);calls['attendedtransfer'](_0x547e62);}catch(_0x1c1837){utils[_0x9d34('0x14')](_0x1c1837);}});ami['on']('varset',function(_0x186abe){try{queues[_0x9d34('0x24')](_0x186abe);recordings[_0x9d34('0x24')](_0x186abe);calls[_0x9d34('0x24')](_0x186abe);dials[_0x9d34('0x24')](_0x186abe);}catch(_0x36388c){utils[_0x9d34('0x14')](_0x36388c);}});ami['on'](_0x9d34('0x25'),function(_0x2bf81b){try{calls[_0x9d34('0x25')](_0x2bf81b);recordings[_0x9d34('0x25')](_0x2bf81b);dials[_0x9d34('0x25')](_0x2bf81b);}catch(_0x541e1a){utils[_0x9d34('0x14')](_0x541e1a);}});ami['on'](_0x9d34('0x26'),function(_0x4ef1fd){try{calls['newchannel'](_0x4ef1fd);recordings[_0x9d34('0x26')](_0x4ef1fd);}catch(_0x24dad7){utils['error'](_0x24dad7);}});ami['on'](_0x9d34('0x27'),function(_0x16b36d){try{dials[_0x9d34('0x27')](_0x16b36d);}catch(_0x2f08b3){utils['error'](_0x2f08b3);}});ami['on'](_0x9d34('0x28'),function(_0x414e80){try{dials[_0x9d34('0x28')](_0x414e80);}catch(_0x3dfb74){utils[_0x9d34('0x14')](_0x3dfb74);}});} \ No newline at end of file +var _0xec87=['./queues.controller','./recordings.controller','./members.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','keepConnected','disabled','info','./agents.controller','./calls.controller'];(function(_0x201115,_0x14a7dc){var _0x50436d=function(_0x11a18c){while(--_0x11a18c){_0x201115['push'](_0x201115['shift']());}};_0x50436d(++_0x14a7dc);}(_0xec87,0xc1));var _0x7ec8=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0xec87[_0x13137e];return _0x346261;};var AsteriskManager=require(_0x7ec8('0x0'));var config=require(_0x7ec8('0x1'));var utils=require(_0x7ec8('0x2'));var ami=new AsteriskManager(config[_0x7ec8('0x3')][_0x7ec8('0x4')],config['asterisk']['ip'],config[_0x7ec8('0x3')][_0x7ec8('0x5')],config[_0x7ec8('0x3')][_0x7ec8('0x6')],!![]);ami[_0x7ec8('0x7')]();if(config['xdr']&&config['xdr'][_0x7ec8('0x8')]){utils[_0x7ec8('0x9')]('XDR\x20DISABLED');}else{var agents=require(_0x7ec8('0xa'));var calls=require(_0x7ec8('0xb'));var queues=require(_0x7ec8('0xc'));var recordings=require(_0x7ec8('0xd'));var members=require(_0x7ec8('0xe'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0x7ec8('0xf'),core[_0x7ec8('0xf')]);ami['on'](_0x7ec8('0x10'),core[_0x7ec8('0x10')]);ami['on'](_0x7ec8('0x11'),core['fullybooted']);ami['on'](_0x7ec8('0x12'),core[_0x7ec8('0x12')]);ami['on'](_0x7ec8('0x13'),core[_0x7ec8('0x13')]);ami['on'](_0x7ec8('0x14'),core[_0x7ec8('0x14')]);ami['on'](_0x7ec8('0x15'),function(_0x1cf86a){try{members[_0x7ec8('0x15')](_0x1cf86a);}catch(_0x39797b){utils['error'](_0x39797b);}});ami['on'](_0x7ec8('0x16'),function(_0x435a68){try{agents[_0x7ec8('0x16')](_0x435a68);}catch(_0x130a93){utils[_0x7ec8('0x12')](_0x130a93);}});ami['on'](_0x7ec8('0x17'),function(_0x1f5554){try{agents[_0x7ec8('0x17')](_0x1f5554);}catch(_0x36bbc8){utils['error'](_0x36bbc8);}});ami['on'](_0x7ec8('0x18'),function(_0xa8adab){try{agents['agentconnect'](_0xa8adab);queues['agentconnect'](_0xa8adab);}catch(_0x4fe015){utils[_0x7ec8('0x12')](_0x4fe015);}});ami['on'](_0x7ec8('0x19'),function(_0xf6b896){try{agents['agentcomplete'](_0xf6b896);queues[_0x7ec8('0x19')](_0xf6b896);members[_0x7ec8('0x19')](_0xf6b896);}catch(_0x47eea6){utils[_0x7ec8('0x12')](_0x47eea6);}});ami['on']('queuecallerabandon',function(_0x533a38){try{agents['queuecallerabandon'](_0x533a38);queues[_0x7ec8('0x1a')](_0x533a38);}catch(_0x22dd26){utils[_0x7ec8('0x12')](_0x22dd26);}});ami['on'](_0x7ec8('0x1b'),function(_0x3901fe){try{queues[_0x7ec8('0x1b')](_0x3901fe);recordings['queuecallerjoin'](_0x3901fe);}catch(_0x290db4){utils[_0x7ec8('0x12')](_0x290db4);}});ami['on'](_0x7ec8('0x1c'),function(_0x3e0801){try{queues[_0x7ec8('0x1c')](_0x3e0801);}catch(_0x35593b){utils[_0x7ec8('0x12')](_0x35593b);}});ami['on'](_0x7ec8('0x1d'),function(_0x351f04){try{queues[_0x7ec8('0x1d')](_0x351f04);calls[_0x7ec8('0x1d')](_0x351f04);}catch(_0x200eb2){utils['error'](_0x200eb2);}});ami['on']('musiconholdstop',function(_0x36423f){try{queues[_0x7ec8('0x1e')](_0x36423f);calls[_0x7ec8('0x1e')](_0x36423f);}catch(_0x5a3ed9){utils[_0x7ec8('0x12')](_0x5a3ed9);}});ami['on'](_0x7ec8('0x1f'),function(_0x21c3e1){try{calls['newstate'](_0x21c3e1);recordings['newstate'](_0x21c3e1);}catch(_0x286ac9){utils['error'](_0x286ac9);}});ami['on']('hangup',function(_0x1aefe5){try{calls['hangup'](_0x1aefe5);recordings[_0x7ec8('0x20')](_0x1aefe5);dials[_0x7ec8('0x20')](_0x1aefe5);agents[_0x7ec8('0x20')](_0x1aefe5);queues[_0x7ec8('0x20')](_0x1aefe5);}catch(_0x5efb00){utils['error'](_0x5efb00);}});ami['on']('cdr',function(_0x35687e){try{members[_0x7ec8('0x21')](_0x35687e);}catch(_0x153782){utils[_0x7ec8('0x12')](_0x153782);}});ami['on'](_0x7ec8('0x22'),function(_0x32d561){try{queues[_0x7ec8('0x22')](_0x32d561);agents[_0x7ec8('0x22')](_0x32d561);transfers['blindtransfer'](_0x32d561);}catch(_0xe09e8e){utils['error'](_0xe09e8e);}});ami['on']('attendedtransfer',function(_0x189353){try{queues[_0x7ec8('0x23')](_0x189353);transfers[_0x7ec8('0x23')](_0x189353);agents[_0x7ec8('0x23')](_0x189353);calls[_0x7ec8('0x23')](_0x189353);}catch(_0x5bdeff){utils[_0x7ec8('0x12')](_0x5bdeff);}});ami['on'](_0x7ec8('0x24'),function(_0x2cdd8a){try{queues['varset'](_0x2cdd8a);recordings['varset'](_0x2cdd8a);calls[_0x7ec8('0x24')](_0x2cdd8a);dials[_0x7ec8('0x24')](_0x2cdd8a);}catch(_0x571745){utils[_0x7ec8('0x12')](_0x571745);}});ami['on']('newexten',function(_0x5dd653){try{calls[_0x7ec8('0x25')](_0x5dd653);recordings[_0x7ec8('0x25')](_0x5dd653);dials[_0x7ec8('0x25')](_0x5dd653);}catch(_0x54e7f5){utils[_0x7ec8('0x12')](_0x54e7f5);}});ami['on'](_0x7ec8('0x26'),function(_0x14316c){try{calls[_0x7ec8('0x26')](_0x14316c);recordings[_0x7ec8('0x26')](_0x14316c);}catch(_0x28433d){utils[_0x7ec8('0x12')](_0x28433d);}});ami['on'](_0x7ec8('0x27'),function(_0x35b4c){try{dials[_0x7ec8('0x27')](_0x35b4c);}catch(_0x40554b){utils['error'](_0x40554b);}});ami['on'](_0x7ec8('0x28'),function(_0x247087){try{dials[_0x7ec8('0x28')](_0x247087);}catch(_0x29ef9b){utils[_0x7ec8('0x12')](_0x29ef9b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index fb2d3f0..a27eaba 100644 --- a/server/services/xdr/members.controller.js +++ b/server/services/xdr/members.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0f4=['now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','queue','cdr','assign','data1','type','data3','destination','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','Queue:','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','getUserByInterface','request','CreateMemberReport','getUserByName','split','then','membername','name','internal','catch','error','INUSE','BUSY','device','voice','TALKING'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xc0f4,0xb9));var _0x4c0f=function(_0x5b62b9,_0x2abc35){_0x5b62b9=_0x5b62b9-0x0;var _0x469070=_0xc0f4[_0x5b62b9];return _0x469070;};'use strict';var _=require(_0x4c0f('0x0'));var util=require(_0x4c0f('0x1'));var utils=require(_0x4c0f('0x2'));var members={};var exclude=[_0x4c0f('0x3'),_0x4c0f('0x4')];function writeDB(_0x5a7613){utils['info'](util['format'](_0x4c0f('0x5'),_0x5a7613[_0x4c0f('0x6')],_0x5a7613[_0x4c0f('0x7')],_0x5a7613['channel'],_0x5a7613[_0x4c0f('0x8')],_0x5a7613['membername'],_0x5a7613['type']));if(_0x5a7613[_0x4c0f('0x7')]){utils[_0x4c0f('0x9')](_0x5a7613[_0x4c0f('0x7')])['then'](function(_0x35a7b9){if(_0x35a7b9){_0x5a7613['membername']=_0x35a7b9['name'];_0x5a7613['internal']=_0x35a7b9['internal'];utils[_0x4c0f('0xa')](_0x4c0f('0xb'),_0x5a7613);}else{utils[_0x4c0f('0xc')](_0x5a7613[_0x4c0f('0x7')][_0x4c0f('0xd')]('/')[0x1])[_0x4c0f('0xe')](function(_0x2bec32){if(_0x2bec32){_0x5a7613[_0x4c0f('0xf')]=_0x2bec32[_0x4c0f('0x10')];_0x5a7613['internal']=_0x2bec32[_0x4c0f('0x11')];utils[_0x4c0f('0xa')](_0x4c0f('0xb'),_0x5a7613);}});}})[_0x4c0f('0x12')](function(_0x2b8ccd){utils[_0x4c0f('0x13')](_0x2b8ccd);});}delete members[_0x5a7613[_0x4c0f('0x7')]];}function startsWith(_0x548229,_0x19c1c4){return _['some'](_0x548229,function(_0x35d839){return _['startsWith'](_0x19c1c4,_0x35d839);});}exports['devicestatechange']=function(_0x44064b){switch(_0x44064b['state']){case _0x4c0f('0x14'):case _0x4c0f('0x15'):if(!startsWith(exclude,_0x44064b[_0x4c0f('0x16')])){members[_0x44064b[_0x4c0f('0x16')]]={'channel':_0x4c0f('0x17'),'interface':_0x44064b[_0x4c0f('0x16')],'type':_0x4c0f('0x18'),'enterAt':utils[_0x4c0f('0x19')](),'role':_0x4c0f('0x1a')};}break;case _0x4c0f('0x1b'):if(!_[_0x4c0f('0x1c')](members[_0x44064b[_0x4c0f('0x16')]])){members[_0x44064b['device']][_0x4c0f('0x1d')]=utils[_0x4c0f('0x19')]();members[_0x44064b[_0x4c0f('0x16')]]['duration']=utils[_0x4c0f('0x1e')](members[_0x44064b[_0x4c0f('0x16')]][_0x4c0f('0x1d')],members[_0x44064b[_0x4c0f('0x16')]][_0x4c0f('0x1f')]);if(members[_0x44064b[_0x4c0f('0x16')]]['uniqueid']){writeDB(members[_0x44064b[_0x4c0f('0x16')]]);}}default:break;}};exports[_0x4c0f('0x20')]=function(_0x2351a8){if(!_[_0x4c0f('0x1c')](members[_0x2351a8[_0x4c0f('0x7')]])){members[_0x2351a8[_0x4c0f('0x7')]]=_['assign'](members[_0x2351a8[_0x4c0f('0x7')]],{'data4':_0x2351a8[_0x4c0f('0x21')],'uniqueid':_0x2351a8[_0x4c0f('0x6')]});}};exports[_0x4c0f('0x22')]=function(_0x2ed954){if(_0x2ed954['channel']){var _0x14a27e=_0x2ed954['channel'][_0x4c0f('0xd')]('-')[0x0];if(!_[_0x4c0f('0x1c')](members[_0x14a27e])){members[_0x14a27e]=_[_0x4c0f('0x23')](members[_0x14a27e],{'data1':members[_0x14a27e][_0x4c0f('0x24')]||_0x2ed954[_0x4c0f('0x25')],'data2':members[_0x14a27e]['data2']||_0x2ed954['source'],'data3':members[_0x14a27e][_0x4c0f('0x26')]||_0x2ed954[_0x4c0f('0x27')],'uniqueid':members[_0x14a27e]['uniqueid']||_0x2ed954['uniqueid']});if(members[_0x14a27e][_0x4c0f('0x1d')]){writeDB(members[_0x14a27e]);}}}if(_0x2ed954[_0x4c0f('0x28')]){var _0x24b901=_0x2ed954[_0x4c0f('0x28')][_0x4c0f('0xd')]('-')[0x0];if(!_[_0x4c0f('0x1c')](members[_0x24b901])){members[_0x24b901]=_['assign'](members[_0x24b901],{'data1':members[_0x24b901]['data1']||_0x2ed954[_0x4c0f('0x25')],'data2':members[_0x24b901]['data2']||_0x2ed954[_0x4c0f('0x29')],'data3':members[_0x24b901][_0x4c0f('0x26')]||_0x2ed954[_0x4c0f('0x27')],'uniqueid':members[_0x24b901][_0x4c0f('0x6')]||_0x2ed954[_0x4c0f('0x6')]});if(members[_0x24b901][_0x4c0f('0x1d')]){writeDB(members[_0x24b901]);}}}}; \ No newline at end of file +var _0x2512=['destination','destinationchannel','source','lodash','./utils','Local/_attended@transfer','Queue:','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','split','catch','error','state','BUSY','device','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','data3'];(function(_0x361ef,_0x2e7a4a){var _0x2d824d=function(_0x3fd679){while(--_0x3fd679){_0x361ef['push'](_0x361ef['shift']());}};_0x2d824d(++_0x2e7a4a);}(_0x2512,0x19d));var _0x2251=function(_0x540f3c,_0xc117d8){_0x540f3c=_0x540f3c-0x0;var _0x2c3ad3=_0x2512[_0x540f3c];return _0x2c3ad3;};'use strict';var _=require(_0x2251('0x0'));var util=require('util');var utils=require(_0x2251('0x1'));var members={};var exclude=[_0x2251('0x2'),_0x2251('0x3')];function writeDB(_0x152693){utils['info'](util[_0x2251('0x4')](_0x2251('0x5'),_0x152693[_0x2251('0x6')],_0x152693[_0x2251('0x7')],_0x152693[_0x2251('0x8')],_0x152693[_0x2251('0x9')],_0x152693[_0x2251('0xa')],_0x152693[_0x2251('0xb')]));if(_0x152693[_0x2251('0x7')]){utils[_0x2251('0xc')](_0x152693[_0x2251('0x7')])[_0x2251('0xd')](function(_0x3c2c0e){if(_0x3c2c0e){_0x152693[_0x2251('0xa')]=_0x3c2c0e[_0x2251('0xe')];_0x152693[_0x2251('0xf')]=_0x3c2c0e[_0x2251('0xf')];utils[_0x2251('0x10')]('CreateMemberReport',_0x152693);}else{utils['getUserByName'](_0x152693[_0x2251('0x7')][_0x2251('0x11')]('/')[0x1])[_0x2251('0xd')](function(_0x306d0c){if(_0x306d0c){_0x152693[_0x2251('0xa')]=_0x306d0c['name'];_0x152693[_0x2251('0xf')]=_0x306d0c[_0x2251('0xf')];utils[_0x2251('0x10')]('CreateMemberReport',_0x152693);}});}})[_0x2251('0x12')](function(_0x3db5e0){utils[_0x2251('0x13')](_0x3db5e0);});}delete members[_0x152693[_0x2251('0x7')]];}function startsWith(_0x1932b9,_0x413dcd){return _['some'](_0x1932b9,function(_0x40f88b){return _['startsWith'](_0x413dcd,_0x40f88b);});}exports['devicestatechange']=function(_0x27295c){switch(_0x27295c[_0x2251('0x14')]){case'INUSE':case _0x2251('0x15'):if(!startsWith(exclude,_0x27295c[_0x2251('0x16')])){members[_0x27295c[_0x2251('0x16')]]={'channel':'voice','interface':_0x27295c[_0x2251('0x16')],'type':_0x2251('0x17'),'enterAt':utils[_0x2251('0x18')](),'role':_0x2251('0x19')};}break;case _0x2251('0x1a'):if(!_[_0x2251('0x1b')](members[_0x27295c[_0x2251('0x16')]])){members[_0x27295c[_0x2251('0x16')]][_0x2251('0x1c')]=utils['now']();members[_0x27295c[_0x2251('0x16')]][_0x2251('0x1d')]=utils[_0x2251('0x1e')](members[_0x27295c[_0x2251('0x16')]]['exitAt'],members[_0x27295c[_0x2251('0x16')]][_0x2251('0x1f')]);if(members[_0x27295c[_0x2251('0x16')]][_0x2251('0x6')]){writeDB(members[_0x27295c['device']]);}}default:break;}};exports[_0x2251('0x20')]=function(_0x3f816f){if(!_[_0x2251('0x1b')](members[_0x3f816f[_0x2251('0x7')]])){members[_0x3f816f[_0x2251('0x7')]]=_[_0x2251('0x21')](members[_0x3f816f['interface']],{'data4':_0x3f816f[_0x2251('0x22')],'uniqueid':_0x3f816f['uniqueid']});}};exports[_0x2251('0x23')]=function(_0x31694d){if(_0x31694d[_0x2251('0x8')]){var _0x3280f6=_0x31694d[_0x2251('0x8')][_0x2251('0x11')]('-')[0x0];if(!_['isNil'](members[_0x3280f6])){members[_0x3280f6]=_['assign'](members[_0x3280f6],{'data1':members[_0x3280f6][_0x2251('0x24')]||_0x31694d[_0x2251('0xb')],'data2':members[_0x3280f6][_0x2251('0x9')]||_0x31694d['source'],'data3':members[_0x3280f6][_0x2251('0x25')]||_0x31694d[_0x2251('0x26')],'uniqueid':members[_0x3280f6][_0x2251('0x6')]||_0x31694d[_0x2251('0x6')]});if(members[_0x3280f6][_0x2251('0x1c')]){writeDB(members[_0x3280f6]);}}}if(_0x31694d[_0x2251('0x27')]){var _0x360c70=_0x31694d['destinationchannel'][_0x2251('0x11')]('-')[0x0];if(!_[_0x2251('0x1b')](members[_0x360c70])){members[_0x360c70]=_[_0x2251('0x21')](members[_0x360c70],{'data1':members[_0x360c70]['data1']||_0x31694d[_0x2251('0xb')],'data2':members[_0x360c70][_0x2251('0x9')]||_0x31694d[_0x2251('0x28')],'data3':members[_0x360c70][_0x2251('0x25')]||_0x31694d[_0x2251('0x26')],'uniqueid':members[_0x360c70][_0x2251('0x6')]||_0x31694d[_0x2251('0x6')]});if(members[_0x360c70][_0x2251('0x1c')]){writeDB(members[_0x360c70]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index e5fdb80..5b88889 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8529=['queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','membername','agentcomplete','queuecallercomplete','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','ATTENDED','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','transfertype','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','clone','mohtime','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','./utils','info','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','position','now','isNil','queuecallerleaveAt','queuecallerexit','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','varset','variable','queuestatus','queuecallerexitAt','value','toUpperCase','queuecallerabandonAt','EXITWITHKEY','queuecallerabandon'];(function(_0x5b2a95,_0x175f25){var _0x40db19=function(_0xb87ac0){while(--_0xb87ac0){_0x5b2a95['push'](_0x5b2a95['shift']());}};_0x40db19(++_0x175f25);}(_0x8529,0x73));var _0x9852=function(_0x710030,_0x306e4a){_0x710030=_0x710030-0x0;var _0x2b8d36=_0x8529[_0x710030];return _0x2b8d36;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9852('0x0'));var queues={};function writeDB(_0x22ebdc){utils[_0x9852('0x1')](util['format']('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x22ebdc[_0x9852('0x2')],_0x22ebdc[_0x9852('0x3')],_0x22ebdc[_0x9852('0x4')],_0x22ebdc[_0x9852('0x5')],_0x22ebdc[_0x9852('0x6')],_0x22ebdc[_0x9852('0x7')],_0x22ebdc['queuecallerexitreason']));if(_0x22ebdc['queue']){utils[_0x9852('0x8')](_0x22ebdc[_0x9852('0x4')])['then'](function(_0x5d0fce){if(_0x5d0fce){_0x22ebdc[_0x9852('0x9')]=_0x5d0fce[_0x9852('0x9')];}utils['request'](_0x9852('0xa'),_0x22ebdc);});}else{utils[_0x9852('0xb')]('CreateVoiceQueueReport',_0x22ebdc);}if(_0x22ebdc[_0x9852('0xc')]){delete queues[_0x22ebdc['transfereduniqueid']];}else{delete queues[_0x22ebdc[_0x9852('0x2')]];}}exports[_0x9852('0xd')]=function(_0x2313e0){queues[_0x2313e0[_0x9852('0x2')]]=_['assign'](_0x2313e0,{'originalposition':_0x2313e0[_0x9852('0xe')],'queuecallerjoinAt':utils[_0x9852('0xf')](),'mohtime':0x0});};exports['hangup']=function(_0x363eb6){if(!_[_0x9852('0x10')](queues[_0x363eb6[_0x9852('0x2')]])){if(queues[_0x363eb6[_0x9852('0x2')]][_0x9852('0x11')]){if(!queues[_0x363eb6[_0x9852('0x2')]]['queuecallerabandon']&&!queues[_0x363eb6[_0x9852('0x2')]][_0x9852('0x12')]){queues[_0x363eb6[_0x9852('0x2')]]['queuecallercomplete']=!![];queues[_0x363eb6[_0x9852('0x2')]][_0x9852('0x13')]=utils[_0x9852('0xf')]();queues[_0x363eb6[_0x9852('0x2')]][_0x9852('0x14')]=_0x9852('0x15');}writeDB(queues[_0x363eb6[_0x9852('0x2')]]);}else{if(queues[_0x363eb6['uniqueid']][_0x9852('0xc')]){queues[queues[_0x363eb6['uniqueid']][_0x9852('0xc')]]=queues[_0x363eb6[_0x9852('0x2')]];queues[queues[_0x363eb6[_0x9852('0x2')]][_0x9852('0xc')]]['queuecallerenterreason']=0x2;delete queues[_0x363eb6[_0x9852('0x2')]];}}}};exports[_0x9852('0x16')]=function(_0x2e12d2){if(!_[_0x9852('0x10')](_0x2e12d2[_0x9852('0x17')][_0x9852('0x18')])){if(!_['isNil'](queues[_0x2e12d2[_0x9852('0x2')]])){queues[_0x2e12d2[_0x9852('0x2')]]['queuecallerabandon']=![];queues[_0x2e12d2[_0x9852('0x2')]]['queuecallerabandonAt']=null;queues[_0x2e12d2['uniqueid']][_0x9852('0x12')]=!![];queues[_0x2e12d2[_0x9852('0x2')]][_0x9852('0x19')]=utils[_0x9852('0xf')]();queues[_0x2e12d2[_0x9852('0x2')]][_0x9852('0x14')]=_0x2e12d2[_0x9852('0x1a')][_0x9852('0x1b')]();writeDB(queues[_0x2e12d2[_0x9852('0x2')]]);}}else if(!_[_0x9852('0x10')](_0x2e12d2[_0x9852('0x17')]['queueposition'])){if(!_['isNil'](queues[_0x2e12d2[_0x9852('0x2')]])&&!queues[_0x2e12d2[_0x9852('0x2')]]['queuecallerabandon']){queues[_0x2e12d2[_0x9852('0x2')]]['queuecallerabandon']=![];queues[_0x2e12d2[_0x9852('0x2')]][_0x9852('0x1c')]=null;queues[_0x2e12d2[_0x9852('0x2')]][_0x9852('0x12')]=!![];queues[_0x2e12d2[_0x9852('0x2')]][_0x9852('0x19')]=utils[_0x9852('0xf')]();queues[_0x2e12d2[_0x9852('0x2')]]['queuecallerexitreason']=_0x9852('0x1d');}}};exports['queuecallerabandon']=function(_0x460205){if(!_[_0x9852('0x10')](queues[_0x460205[_0x9852('0x2')]])){queues[_0x460205['uniqueid']][_0x9852('0x12')]=![];queues[_0x460205[_0x9852('0x2')]]['queuecallerexitAt']=null;queues[_0x460205[_0x9852('0x2')]][_0x9852('0x1e')]=!![];queues[_0x460205[_0x9852('0x2')]]['queuecallerabandonAt']=utils[_0x9852('0xf')]();queues[_0x460205[_0x9852('0x2')]][_0x9852('0x14')]='ABANDONED';}};exports[_0x9852('0x1f')]=function(_0x4edbd0){if(!_['isNil'](queues[_0x4edbd0[_0x9852('0x2')]])){queues[_0x4edbd0['uniqueid']][_0x9852('0x1f')]=!![];queues[_0x4edbd0[_0x9852('0x2')]][_0x9852('0x11')]=utils[_0x9852('0xf')]();queues[_0x4edbd0[_0x9852('0x2')]][_0x9852('0x20')]=utils[_0x9852('0x21')](queues[_0x4edbd0[_0x9852('0x2')]][_0x9852('0x11')],queues[_0x4edbd0[_0x9852('0x2')]][_0x9852('0x22')]);queues[_0x4edbd0[_0x9852('0x2')]][_0x9852('0xe')]=_0x4edbd0['position'];queues[_0x4edbd0[_0x9852('0x2')]][_0x9852('0x23')]=_0x4edbd0[_0x9852('0x23')];queues[_0x4edbd0[_0x9852('0x2')]][_0x9852('0x24')]=_0x4edbd0['connectedlinenum'];queues[_0x4edbd0[_0x9852('0x2')]]['connectedlinename']=_0x4edbd0[_0x9852('0x25')];}};exports[_0x9852('0x26')]=function(_0xd616ea){if(!_['isNil'](queues[_0xd616ea[_0x9852('0x2')]])){queues[_0xd616ea['uniqueid']][_0x9852('0x1e')]=![];queues[_0xd616ea[_0x9852('0x2')]][_0x9852('0x1e')]=![];queues[_0xd616ea['uniqueid']][_0x9852('0x1c')]=null;queues[_0xd616ea[_0x9852('0x2')]][_0x9852('0x12')]=![];queues[_0xd616ea['uniqueid']][_0x9852('0x19')]=null;queues[_0xd616ea[_0x9852('0x2')]][_0x9852('0x27')]=!![];queues[_0xd616ea[_0x9852('0x2')]]['accountcode']=_0xd616ea[_0x9852('0x28')];queues[_0xd616ea['uniqueid']][_0x9852('0x5')]=_0xd616ea[_0x9852('0x29')];}};exports[_0x9852('0x2a')]=function(_0x374979){if(!_[_0x9852('0x10')](queues[_0x374979[_0x9852('0x2')]])){if(queues[_0x374979[_0x9852('0x2')]][_0x9852('0x11')]){queues[_0x374979[_0x9852('0x2')]][_0x9852('0x1e')]=![];queues[_0x374979[_0x9852('0x2')]][_0x9852('0x1e')]=![];queues[_0x374979[_0x9852('0x2')]]['queuecallerabandonAt']=null;queues[_0x374979[_0x9852('0x2')]][_0x9852('0x12')]=![];queues[_0x374979['uniqueid']][_0x9852('0x19')]=null;queues[_0x374979[_0x9852('0x2')]][_0x9852('0x27')]=!![];queues[_0x374979['uniqueid']][_0x9852('0x5')]=_0x374979['membername'];queues[_0x374979[_0x9852('0x2')]][_0x9852('0x2b')]=!![];queues[_0x374979[_0x9852('0x2')]]['queuecallercompleteAt']=utils[_0x9852('0xf')]();if(_0x374979['reason']==_0x9852('0x2c')){if(!queues[_0x374979[_0x9852('0x2')]]['transfer']){queues[_0x374979[_0x9852('0x2')]][_0x9852('0x14')]=_0x9852('0x2d');}}else{queues[_0x374979['uniqueid']][_0x9852('0x14')]=_0x9852('0x2e')+_0x374979['reason'][_0x9852('0x1b')]();}writeDB(queues[_0x374979[_0x9852('0x2')]]);}}};exports[_0x9852('0x2f')]=function(_0x1fd1a5){if(!_[_0x9852('0x10')](queues[_0x1fd1a5[_0x9852('0x30')]])){queues[_0x1fd1a5['transfereeuniqueid']]['transfer']=!![];queues[_0x1fd1a5[_0x9852('0x30')]]['transfertype']='BLIND';queues[_0x1fd1a5[_0x9852('0x30')]][_0x9852('0x31')]=_0x1fd1a5[_0x9852('0x32')];queues[_0x1fd1a5[_0x9852('0x30')]][_0x9852('0x33')]=_0x1fd1a5[_0x9852('0x30')];queues[_0x1fd1a5['transfereeuniqueid']]['queuecallerexitreason']=_0x9852('0x34');}};exports[_0x9852('0x35')]=function(_0x2162e3){try{if(_0x2162e3[_0x9852('0x36')]==_0x2162e3['origtransfererlinkedid']){if(!_[_0x9852('0x10')](queues[_0x2162e3[_0x9852('0x37')]])){queues[_0x2162e3[_0x9852('0x37')]][_0x9852('0x2c')]=!![];queues[_0x2162e3['secondtransfererlinkedid']]['transfertype']=_0x9852('0x38');queues[_0x2162e3['secondtransfererlinkedid']][_0x9852('0x31')]=_0x2162e3['origtransfererexten'];queues[_0x2162e3[_0x9852('0x37')]][_0x9852('0x33')]=_0x2162e3[_0x9852('0x36')];queues[_0x2162e3[_0x9852('0x37')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x2162e3[_0x9852('0x39')]])){if(_0x2162e3[_0x9852('0x3a')]&&queues[_0x2162e3[_0x9852('0x3a')]]){queues[_0x2162e3[_0x9852('0x3a')]][_0x9852('0x3b')]=0x1;queues[_0x2162e3[_0x9852('0x30')]]=_['clone'](queues[_0x2162e3['transfereelinkedid']]);queues[_0x2162e3[_0x9852('0x30')]]['transfereduniqueid']=_0x2162e3[_0x9852('0x3c')];queues[_0x2162e3[_0x9852('0x30')]][_0x9852('0x3b')]=0x2;queues[_0x2162e3[_0x9852('0x30')]][_0x9852('0x6')]=queues[_0x2162e3[_0x9852('0x37')]][_0x9852('0x6')];queues[_0x2162e3['transfereeuniqueid']][_0x9852('0x3d')]=queues[_0x2162e3[_0x9852('0x37')]][_0x9852('0x3d')];queues[_0x2162e3['transfereeuniqueid']][_0x9852('0x22')]=utils[_0x9852('0xf')]();queues[_0x2162e3[_0x9852('0x30')]][_0x9852('0x11')]=utils['now']();queues[_0x2162e3['transfereeuniqueid']]['holdtime']=0x0;queues[_0x2162e3['transfereeuniqueid']]['mohtime']=0x0;}else{queues[_0x2162e3['origtransfererlinkedid']][_0x9852('0xc')]=_0x2162e3['secondtransfererlinkedid'];}}}else if(_0x2162e3['secondtransfereruniqueid']==_0x2162e3[_0x9852('0x37')]){if(!_[_0x9852('0x10')](queues[_0x2162e3[_0x9852('0x39')]])){queues[_0x2162e3['origtransfererlinkedid']][_0x9852('0x2c')]=!![];queues[_0x2162e3[_0x9852('0x39')]][_0x9852('0x3e')]=_0x9852('0x38');queues[_0x2162e3['origtransfererlinkedid']][_0x9852('0x31')]=_0x2162e3[_0x9852('0x3f')];queues[_0x2162e3[_0x9852('0x39')]][_0x9852('0x33')]=_0x2162e3[_0x9852('0x40')];queues[_0x2162e3[_0x9852('0x39')]][_0x9852('0x14')]=_0x9852('0x41');}if(!_[_0x9852('0x10')](queues[_0x2162e3[_0x9852('0x37')]])){if(_0x2162e3['transfertargetlinkedid']&&queues[_0x2162e3[_0x9852('0x42')]]){queues[_0x2162e3['transfertargetlinkedid']][_0x9852('0x3b')]=0x1;queues[_0x2162e3[_0x9852('0x3c')]]=_[_0x9852('0x43')](queues[_0x2162e3['transfertargetlinkedid']]);queues[_0x2162e3[_0x9852('0x3c')]]['transfereduniqueid']=_0x2162e3[_0x9852('0x3c')];queues[_0x2162e3[_0x9852('0x3c')]][_0x9852('0x3b')]=0x2;queues[_0x2162e3[_0x9852('0x3c')]][_0x9852('0x6')]=queues[_0x2162e3['origtransfererlinkedid']]['calleridnum'];queues[_0x2162e3[_0x9852('0x3c')]][_0x9852('0x3d')]=queues[_0x2162e3[_0x9852('0x39')]]['calleridname'];queues[_0x2162e3[_0x9852('0x3c')]][_0x9852('0x22')]=utils[_0x9852('0xf')]();queues[_0x2162e3[_0x9852('0x3c')]][_0x9852('0x11')]=utils['now']();queues[_0x2162e3['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x2162e3[_0x9852('0x3c')]][_0x9852('0x44')]=0x0;}else{queues[_0x2162e3[_0x9852('0x37')]][_0x9852('0xc')]=_0x2162e3[_0x9852('0x39')];}}}}catch(_0x16e3f1){utils['error'](_0x16e3f1[_0x9852('0x45')]);}};exports[_0x9852('0x46')]=function(_0x1287b7){if(!_['isNil'](queues[_0x1287b7[_0x9852('0x2')]])){queues[_0x1287b7[_0x9852('0x2')]][_0x9852('0x47')]=utils[_0x9852('0xf')]();}};exports[_0x9852('0x48')]=function(_0x123776){if(!_[_0x9852('0x10')](queues[_0x123776[_0x9852('0x2')]])){if(!_['isNil'](queues[_0x123776[_0x9852('0x2')]]['musiconholdstartAt'])){queues[_0x123776[_0x9852('0x2')]]['mohtime']+=utils['diffTime'](utils[_0x9852('0xf')](),queues[_0x123776[_0x9852('0x2')]][_0x9852('0x47')]);delete queues[_0x123776[_0x9852('0x2')]]['musiconholdstartAt'];}}}; \ No newline at end of file +var _0xadf7=['destaccountcode','membername','agentcomplete','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','./utils','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','accountcode','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','position','now','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallerenterreason','varset','isNil','variable','queuestatus','queuecallerabandonAt','queuecallerexitAt','value','toUpperCase','queueposition','queuecallerexitreason','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned'];(function(_0x2b5663,_0x2ba2d8){var _0x57921c=function(_0x4f3032){while(--_0x4f3032){_0x2b5663['push'](_0x2b5663['shift']());}};_0x57921c(++_0x2ba2d8);}(_0xadf7,0xb5));var _0x7adf=function(_0x1d5ccb,_0x136776){_0x1d5ccb=_0x1d5ccb-0x0;var _0x49fc07=_0xadf7[_0x1d5ccb];return _0x49fc07;};'use strict';var _=require(_0x7adf('0x0'));var util=require('util');var utils=require(_0x7adf('0x1'));var queues={};function writeDB(_0x53a009){utils['info'](util[_0x7adf('0x2')](_0x7adf('0x3'),_0x53a009[_0x7adf('0x4')],_0x53a009[_0x7adf('0x5')],_0x53a009[_0x7adf('0x6')],_0x53a009[_0x7adf('0x7')],_0x53a009['calleridnum'],_0x53a009[_0x7adf('0x8')],_0x53a009['queuecallerexitreason']));if(_0x53a009['queue']){utils[_0x7adf('0x9')](_0x53a009[_0x7adf('0x6')])[_0x7adf('0xa')](function(_0x239caa){if(_0x239caa){_0x53a009[_0x7adf('0xb')]=_0x239caa[_0x7adf('0xb')];}utils['request'](_0x7adf('0xc'),_0x53a009);});}else{utils[_0x7adf('0xd')](_0x7adf('0xc'),_0x53a009);}if(_0x53a009['transfereduniqueid']){delete queues[_0x53a009[_0x7adf('0xe')]];}else{delete queues[_0x53a009[_0x7adf('0x4')]];}}exports['queuecallerjoin']=function(_0x223708){queues[_0x223708[_0x7adf('0x4')]]=_['assign'](_0x223708,{'originalposition':_0x223708[_0x7adf('0xf')],'queuecallerjoinAt':utils[_0x7adf('0x10')](),'mohtime':0x0});};exports[_0x7adf('0x11')]=function(_0x1e3b4f){if(!_['isNil'](queues[_0x1e3b4f[_0x7adf('0x4')]])){if(queues[_0x1e3b4f[_0x7adf('0x4')]][_0x7adf('0x12')]){if(!queues[_0x1e3b4f['uniqueid']][_0x7adf('0x13')]&&!queues[_0x1e3b4f[_0x7adf('0x4')]][_0x7adf('0x14')]){queues[_0x1e3b4f[_0x7adf('0x4')]][_0x7adf('0x15')]=!![];queues[_0x1e3b4f[_0x7adf('0x4')]]['queuecallercompleteAt']=utils[_0x7adf('0x10')]();queues[_0x1e3b4f[_0x7adf('0x4')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}writeDB(queues[_0x1e3b4f[_0x7adf('0x4')]]);}else{if(queues[_0x1e3b4f[_0x7adf('0x4')]][_0x7adf('0xe')]){queues[queues[_0x1e3b4f[_0x7adf('0x4')]][_0x7adf('0xe')]]=queues[_0x1e3b4f[_0x7adf('0x4')]];queues[queues[_0x1e3b4f['uniqueid']][_0x7adf('0xe')]][_0x7adf('0x16')]=0x2;delete queues[_0x1e3b4f[_0x7adf('0x4')]];}}}};exports[_0x7adf('0x17')]=function(_0x21c1ea){if(!_[_0x7adf('0x18')](_0x21c1ea[_0x7adf('0x19')][_0x7adf('0x1a')])){if(!_[_0x7adf('0x18')](queues[_0x21c1ea['uniqueid']])){queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x13')]=![];queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x1b')]=null;queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x14')]=!![];queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x1c')]=utils[_0x7adf('0x10')]();queues[_0x21c1ea[_0x7adf('0x4')]]['queuecallerexitreason']=_0x21c1ea[_0x7adf('0x1d')][_0x7adf('0x1e')]();writeDB(queues[_0x21c1ea[_0x7adf('0x4')]]);}}else if(!_[_0x7adf('0x18')](_0x21c1ea['variable'][_0x7adf('0x1f')])){if(!_[_0x7adf('0x18')](queues[_0x21c1ea[_0x7adf('0x4')]])&&!queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x13')]){queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x13')]=![];queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x1b')]=null;queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x14')]=!![];queues[_0x21c1ea['uniqueid']]['queuecallerexitAt']=utils[_0x7adf('0x10')]();queues[_0x21c1ea[_0x7adf('0x4')]][_0x7adf('0x20')]=_0x7adf('0x21');}}};exports[_0x7adf('0x13')]=function(_0x31c202){if(!_[_0x7adf('0x18')](queues[_0x31c202[_0x7adf('0x4')]])){queues[_0x31c202[_0x7adf('0x4')]][_0x7adf('0x14')]=![];queues[_0x31c202[_0x7adf('0x4')]]['queuecallerexitAt']=null;queues[_0x31c202[_0x7adf('0x4')]][_0x7adf('0x13')]=!![];queues[_0x31c202[_0x7adf('0x4')]][_0x7adf('0x1b')]=utils['now']();queues[_0x31c202[_0x7adf('0x4')]][_0x7adf('0x20')]=_0x7adf('0x22');}};exports['queuecallerleave']=function(_0x33bd02){if(!_[_0x7adf('0x18')](queues[_0x33bd02[_0x7adf('0x4')]])){queues[_0x33bd02[_0x7adf('0x4')]][_0x7adf('0x23')]=!![];queues[_0x33bd02[_0x7adf('0x4')]][_0x7adf('0x12')]=utils['now']();queues[_0x33bd02[_0x7adf('0x4')]][_0x7adf('0x24')]=utils[_0x7adf('0x25')](queues[_0x33bd02[_0x7adf('0x4')]][_0x7adf('0x12')],queues[_0x33bd02[_0x7adf('0x4')]][_0x7adf('0x26')]);queues[_0x33bd02[_0x7adf('0x4')]][_0x7adf('0xf')]=_0x33bd02['position'];queues[_0x33bd02[_0x7adf('0x4')]]['count']=_0x33bd02[_0x7adf('0x27')];queues[_0x33bd02[_0x7adf('0x4')]][_0x7adf('0x28')]=_0x33bd02[_0x7adf('0x28')];queues[_0x33bd02[_0x7adf('0x4')]][_0x7adf('0x29')]=_0x33bd02[_0x7adf('0x29')];}};exports[_0x7adf('0x2a')]=function(_0x128a3a){if(!_['isNil'](queues[_0x128a3a[_0x7adf('0x4')]])){queues[_0x128a3a[_0x7adf('0x4')]][_0x7adf('0x13')]=![];queues[_0x128a3a[_0x7adf('0x4')]][_0x7adf('0x13')]=![];queues[_0x128a3a[_0x7adf('0x4')]][_0x7adf('0x1b')]=null;queues[_0x128a3a['uniqueid']][_0x7adf('0x14')]=![];queues[_0x128a3a[_0x7adf('0x4')]][_0x7adf('0x1c')]=null;queues[_0x128a3a[_0x7adf('0x4')]][_0x7adf('0x2b')]=!![];queues[_0x128a3a['uniqueid']][_0x7adf('0x8')]=_0x128a3a[_0x7adf('0x2c')];queues[_0x128a3a[_0x7adf('0x4')]]['lastAssignedTo']=_0x128a3a[_0x7adf('0x2d')];}};exports[_0x7adf('0x2e')]=function(_0x31b59d){if(!_[_0x7adf('0x18')](queues[_0x31b59d[_0x7adf('0x4')]])){if(queues[_0x31b59d['uniqueid']][_0x7adf('0x12')]){queues[_0x31b59d[_0x7adf('0x4')]]['queuecallerabandon']=![];queues[_0x31b59d[_0x7adf('0x4')]][_0x7adf('0x13')]=![];queues[_0x31b59d[_0x7adf('0x4')]][_0x7adf('0x1b')]=null;queues[_0x31b59d[_0x7adf('0x4')]][_0x7adf('0x14')]=![];queues[_0x31b59d[_0x7adf('0x4')]]['queuecallerexitAt']=null;queues[_0x31b59d[_0x7adf('0x4')]][_0x7adf('0x2b')]=!![];queues[_0x31b59d[_0x7adf('0x4')]]['lastAssignedTo']=_0x31b59d[_0x7adf('0x2d')];queues[_0x31b59d[_0x7adf('0x4')]][_0x7adf('0x15')]=!![];queues[_0x31b59d[_0x7adf('0x4')]]['queuecallercompleteAt']=utils[_0x7adf('0x10')]();if(_0x31b59d['reason']==_0x7adf('0x2f')){if(!queues[_0x31b59d[_0x7adf('0x4')]][_0x7adf('0x2f')]){queues[_0x31b59d[_0x7adf('0x4')]][_0x7adf('0x20')]=_0x7adf('0x30');}}else{queues[_0x31b59d[_0x7adf('0x4')]]['queuecallerexitreason']=_0x7adf('0x31')+_0x31b59d['reason'][_0x7adf('0x1e')]();}writeDB(queues[_0x31b59d[_0x7adf('0x4')]]);}}};exports[_0x7adf('0x32')]=function(_0x39b7e4){if(!_['isNil'](queues[_0x39b7e4['transfereeuniqueid']])){queues[_0x39b7e4[_0x7adf('0x33')]][_0x7adf('0x2f')]=!![];queues[_0x39b7e4[_0x7adf('0x33')]][_0x7adf('0x34')]=_0x7adf('0x35');queues[_0x39b7e4[_0x7adf('0x33')]][_0x7adf('0x36')]=_0x39b7e4['extension'];queues[_0x39b7e4[_0x7adf('0x33')]][_0x7adf('0x37')]=_0x39b7e4['transfereeuniqueid'];queues[_0x39b7e4[_0x7adf('0x33')]][_0x7adf('0x20')]=_0x7adf('0x38');}};exports['attendedtransfer']=function(_0x2feda6){try{if(_0x2feda6[_0x7adf('0x39')]==_0x2feda6[_0x7adf('0x3a')]){if(!_[_0x7adf('0x18')](queues[_0x2feda6[_0x7adf('0x3b')]])){queues[_0x2feda6['secondtransfererlinkedid']]['transfer']=!![];queues[_0x2feda6[_0x7adf('0x3b')]][_0x7adf('0x34')]=_0x7adf('0x3c');queues[_0x2feda6[_0x7adf('0x3b')]]['transferexten']=_0x2feda6[_0x7adf('0x3d')];queues[_0x2feda6[_0x7adf('0x3b')]]['transferuniqueid']=_0x2feda6[_0x7adf('0x39')];queues[_0x2feda6[_0x7adf('0x3b')]][_0x7adf('0x20')]=_0x7adf('0x3e');}if(!_['isNil'](queues[_0x2feda6[_0x7adf('0x3a')]])){if(_0x2feda6[_0x7adf('0x3f')]&&queues[_0x2feda6[_0x7adf('0x3f')]]){queues[_0x2feda6['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x2feda6[_0x7adf('0x33')]]=_[_0x7adf('0x40')](queues[_0x2feda6[_0x7adf('0x3f')]]);queues[_0x2feda6[_0x7adf('0x33')]][_0x7adf('0xe')]=_0x2feda6[_0x7adf('0x41')];queues[_0x2feda6['transfereeuniqueid']][_0x7adf('0x16')]=0x2;queues[_0x2feda6[_0x7adf('0x33')]][_0x7adf('0x42')]=queues[_0x2feda6['secondtransfererlinkedid']]['calleridnum'];queues[_0x2feda6['transfereeuniqueid']]['calleridname']=queues[_0x2feda6[_0x7adf('0x3b')]][_0x7adf('0x43')];queues[_0x2feda6[_0x7adf('0x33')]][_0x7adf('0x26')]=utils[_0x7adf('0x10')]();queues[_0x2feda6[_0x7adf('0x33')]][_0x7adf('0x12')]=utils[_0x7adf('0x10')]();queues[_0x2feda6[_0x7adf('0x33')]]['holdtime']=0x0;queues[_0x2feda6[_0x7adf('0x33')]][_0x7adf('0x44')]=0x0;}else{queues[_0x2feda6[_0x7adf('0x3a')]][_0x7adf('0xe')]=_0x2feda6[_0x7adf('0x3b')];}}}else if(_0x2feda6['secondtransfereruniqueid']==_0x2feda6[_0x7adf('0x3b')]){if(!_[_0x7adf('0x18')](queues[_0x2feda6[_0x7adf('0x3a')]])){queues[_0x2feda6['origtransfererlinkedid']]['transfer']=!![];queues[_0x2feda6[_0x7adf('0x3a')]][_0x7adf('0x34')]=_0x7adf('0x3c');queues[_0x2feda6[_0x7adf('0x3a')]]['transferexten']=_0x2feda6[_0x7adf('0x45')];queues[_0x2feda6[_0x7adf('0x3a')]][_0x7adf('0x37')]=_0x2feda6[_0x7adf('0x46')];queues[_0x2feda6[_0x7adf('0x3a')]][_0x7adf('0x20')]=_0x7adf('0x3e');}if(!_[_0x7adf('0x18')](queues[_0x2feda6[_0x7adf('0x3b')]])){if(_0x2feda6[_0x7adf('0x47')]&&queues[_0x2feda6[_0x7adf('0x47')]]){queues[_0x2feda6[_0x7adf('0x47')]]['queuecallerenterreason']=0x1;queues[_0x2feda6[_0x7adf('0x41')]]=_[_0x7adf('0x40')](queues[_0x2feda6[_0x7adf('0x47')]]);queues[_0x2feda6[_0x7adf('0x41')]][_0x7adf('0xe')]=_0x2feda6[_0x7adf('0x41')];queues[_0x2feda6[_0x7adf('0x41')]]['queuecallerenterreason']=0x2;queues[_0x2feda6['transfertargetuniqueid']][_0x7adf('0x42')]=queues[_0x2feda6[_0x7adf('0x3a')]]['calleridnum'];queues[_0x2feda6[_0x7adf('0x41')]]['calleridname']=queues[_0x2feda6[_0x7adf('0x3a')]][_0x7adf('0x43')];queues[_0x2feda6[_0x7adf('0x41')]][_0x7adf('0x26')]=utils['now']();queues[_0x2feda6[_0x7adf('0x41')]][_0x7adf('0x12')]=utils['now']();queues[_0x2feda6[_0x7adf('0x41')]][_0x7adf('0x24')]=0x0;queues[_0x2feda6[_0x7adf('0x41')]][_0x7adf('0x44')]=0x0;}else{queues[_0x2feda6[_0x7adf('0x3b')]][_0x7adf('0xe')]=_0x2feda6['origtransfererlinkedid'];}}}}catch(_0x2dec16){utils['error'](_0x2dec16['stack']);}};exports[_0x7adf('0x48')]=function(_0x205f62){if(!_[_0x7adf('0x18')](queues[_0x205f62[_0x7adf('0x4')]])){queues[_0x205f62['uniqueid']][_0x7adf('0x49')]=utils[_0x7adf('0x10')]();}};exports[_0x7adf('0x4a')]=function(_0x187b60){if(!_[_0x7adf('0x18')](queues[_0x187b60[_0x7adf('0x4')]])){if(!_['isNil'](queues[_0x187b60[_0x7adf('0x4')]][_0x7adf('0x49')])){queues[_0x187b60[_0x7adf('0x4')]]['mohtime']+=utils[_0x7adf('0x25')](utils[_0x7adf('0x10')](),queues[_0x187b60[_0x7adf('0x4')]]['musiconholdstartAt']);delete queues[_0x187b60[_0x7adf('0x4')]][_0x7adf('0x49')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d0dda3c..1051925 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0x97f097,_0x5981f6){var _0x2eaf40=function(_0x828b93){while(--_0x828b93){_0x97f097['push'](_0x97f097['shift']());}};_0x2eaf40(++_0x5981f6);}(_0xedd9,0xfc));var _0x9edd=function(_0x475e64,_0x4c0555){_0x475e64=_0x475e64-0x0;var _0x353461=_0xedd9[_0x475e64];return _0x353461;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file +var _0x70e0=['.WAV','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','set','appdata','toLowerCase','split','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','accountcode','then','name','request','newchannel','uniqueid','linkedid','channel','error','stack','newstate','isNil','channelstate','transfer','variable','endsWith','value','.wav49'];(function(_0x29e265,_0x118e54){var _0x5a403d=function(_0x50db6c){while(--_0x50db6c){_0x29e265['push'](_0x29e265['shift']());}};_0x5a403d(++_0x118e54);}(_0x70e0,0x17b));var _0x070e=function(_0x572a9a,_0x3b6235){_0x572a9a=_0x572a9a-0x0;var _0x38358f=_0x70e0[_0x572a9a];return _0x38358f;};'use strict';var _=require(_0x070e('0x0'));var utils=require(_0x070e('0x1'));var recordings={};function writeDB(_0x198c2e){utils['debug'](_0x198c2e);if(_0x198c2e['accountcode']){utils[_0x070e('0x2')](_0x198c2e[_0x070e('0x3')])[_0x070e('0x4')](function(_0x2593e5){if(_0x2593e5){_0x198c2e['membername']=_0x2593e5[_0x070e('0x5')];_0x198c2e['UserId']=_0x2593e5['id'];}utils[_0x070e('0x6')]('CreateVoiceRecording',_0x198c2e);});}else{utils['request']('CreateVoiceRecording',_0x198c2e);}}exports[_0x070e('0x7')]=function(_0x1e11f0){try{if(_0x1e11f0[_0x070e('0x8')]==_0x1e11f0[_0x070e('0x9')]){recordings[_0x1e11f0[_0x070e('0x8')]]={'uniqueid':_0x1e11f0[_0x070e('0x8')],'accountcode':_0x1e11f0[_0x070e('0x3')],'exten':_0x1e11f0['exten'],'context':_0x1e11f0['context'],'channel':_0x1e11f0[_0x070e('0xa')],'monitors':[]};}}catch(_0x2e3e5e){utils[_0x070e('0xb')](_0x2e3e5e[_0x070e('0xc')]);}};exports[_0x070e('0xd')]=function(_0xffcdd6){try{if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x8')]])&&_0xffcdd6[_0x070e('0xf')]==0x6){}else if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x9')]])&&_0xffcdd6['channelstate']==0x6&&_0xffcdd6['context']!=_0x070e('0x10')){recordings[_0xffcdd6['linkedid']]['accountcode']=_0xffcdd6['accountcode'];}}catch(_0x11d2ce){utils[_0x070e('0xb')](_0x11d2ce['stack']);}};exports['varset']=function(_0x373d86){try{if(!_[_0x070e('0xe')](_0x373d86[_0x070e('0x11')])&&!_[_0x070e('0xe')](_0x373d86['variable']['mixmonitor_filename'])){if(_[_0x070e('0x12')](_0x373d86[_0x070e('0x13')],_0x070e('0x14'))){_0x373d86[_0x070e('0x13')]=_0x373d86[_0x070e('0x13')]['replace'](_0x070e('0x14'),_0x070e('0x15'));}if(recordings[_0x373d86[_0x070e('0x9')]]){var _0x3ea105=_[_0x070e('0x16')](recordings[_0x373d86['linkedid']]['monitors'],{'value':_0x373d86['value']});if(_[_0x070e('0xe')](_0x3ea105)){recordings[_0x373d86[_0x070e('0x9')]][_0x070e('0x17')]['push']({'value':_0x373d86[_0x070e('0x13')]});}}}}catch(_0x5dc5d2){utils[_0x070e('0xb')](_0x5dc5d2[_0x070e('0xc')]);}};exports[_0x070e('0x18')]=function(_0x33e8c6){try{if(!_[_0x070e('0xe')](recordings[_0x33e8c6[_0x070e('0x8')]])){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x19')]=_0x33e8c6['calleridnum'];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1a')]=_0x33e8c6[_0x070e('0x1a')];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1b')]=_0x33e8c6['connectedlinenum'];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1c')]=_0x33e8c6[_0x070e('0x1c')];if(recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1d')]==_0x070e('0x1e')&&recordings[_0x33e8c6['uniqueid']][_0x070e('0x3')]){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1b')]=recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x3')];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1c')]='';}recordings[_0x33e8c6[_0x070e('0x8')]]['monitors'][_0x070e('0x1f')](_0x351641=>{var _0x3a16d0=_['clone'](recordings[_0x33e8c6['uniqueid']]);_0x3a16d0[_0x070e('0x13')]=_0x351641[_0x070e('0x13')];writeDB(_0x3a16d0);});delete recordings[_0x33e8c6[_0x070e('0x8')]];}}catch(_0x51402c){utils[_0x070e('0xb')](_0x51402c[_0x070e('0xc')]);}};exports[_0x070e('0x20')]=function(_0x5f2bee){try{if(!_['isNil'](recordings[_0x5f2bee['uniqueid']])){if(_0x5f2bee['application']['toLowerCase']()==_0x070e('0x21')&&_['startsWith'](_0x5f2bee[_0x070e('0x22')][_0x070e('0x23')](),'cdr')){var _0x47a739=_0x5f2bee[_0x070e('0x22')][_0x070e('0x24')]('=');var _0x55288a=_0x47a739[0x0]['substring'](_0x47a739[0x0][_0x070e('0x25')]('(')+0x1,_0x47a739[0x0][_0x070e('0x25')](')'));var _0x444d02=_0x47a739[0x1];recordings[_0x5f2bee[_0x070e('0x8')]][_0x55288a]=_0x444d02;}}}catch(_0x18f0ad){utils['error'](_0x18f0ad['stack']);}};exports[_0x070e('0x26')]=function(_0x3011c4){try{if(!_[_0x070e('0xe')](recordings[_0x3011c4[_0x070e('0x8')]])){recordings[_0x3011c4[_0x070e('0x8')]]['queue']=_0x3011c4[_0x070e('0x27')];}}catch(_0x1927f4){utils['error'](_0x1927f4[_0x070e('0xc')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 8100298..e79290e 100644 --- a/server/services/xdr/transfers.controller.js +++ b/server/services/xdr/transfers.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa663=['assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','info','format','blindtransfer','blind','error','stack','attendedtransfer'];(function(_0x286fd7,_0x1daf42){var _0x477cbe=function(_0xba988a){while(--_0xba988a){_0x286fd7['push'](_0x286fd7['shift']());}};_0x477cbe(++_0x1daf42);}(_0xa663,0xc7));var _0x3a66=function(_0x3877c1,_0x238c29){_0x3877c1=_0x3877c1-0x0;var _0x59056a=_0xa663[_0x3877c1];return _0x59056a;};'use strict';var _=require(_0x3a66('0x0'));var util=require(_0x3a66('0x1'));var utils=require('./utils');function writeDB(_0x22d68d){utils[_0x3a66('0x2')](util[_0x3a66('0x3')]('TRANSFER|%s',_0x22d68d['type']));utils['request']('CreateVoiceTransferReport',_0x22d68d);}exports[_0x3a66('0x4')]=function(_0x31c9d9){try{_0x31c9d9['type']=_0x3a66('0x5');writeDB(_0x31c9d9);}catch(_0x5473d5){utils[_0x3a66('0x6')](_0x5473d5[_0x3a66('0x7')]);}};exports[_0x3a66('0x8')]=function(_0x521b82){try{_0x521b82=_[_0x3a66('0x9')](_0x521b82,{'transfererchannel':_0x521b82[_0x3a66('0xa')],'transferercalleridnum':_0x521b82['origtransferercalleridnum'],'transferercalleridname':_0x521b82[_0x3a66('0xb')],'transfererconnectedlinenum':_0x521b82['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x521b82[_0x3a66('0xc')],'transfereraccountcode':_0x521b82['origtransfereraccountcode'],'transferercontext':_0x521b82[_0x3a66('0xd')],'transfererexten':_0x521b82['secondtransfererexten'],'transfererlinkedid':_0x521b82[_0x3a66('0xe')],'context':_0x521b82['origtransferercontext'],'extension':_0x521b82[_0x3a66('0xf')],'type':'attended'});if(_[_0x3a66('0x10')](_0x521b82[_0x3a66('0x11')])){_0x521b82=_[_0x3a66('0x9')](_0x521b82,{'transfereechannel':_0x521b82[_0x3a66('0x12')],'transfereecalleridnum':_0x521b82[_0x3a66('0x13')],'transfereecalleridname':_0x521b82[_0x3a66('0x14')],'transfereeconnectedlinenum':_0x521b82[_0x3a66('0x15')],'transfereeconnectedlinename':_0x521b82[_0x3a66('0x16')],'transfereeaccountcode':_0x521b82[_0x3a66('0x17')],'transfereecontext':_0x521b82[_0x3a66('0x18')],'transfereeexten':_0x521b82[_0x3a66('0x19')],'transfereelinkedid':_0x521b82['transfertargetlinkedid']});}writeDB(_0x521b82);}catch(_0x5d837e){utils[_0x3a66('0x6')](_0x5d837e[_0x3a66('0x7')]);}}; \ No newline at end of file +var _0x94c4=['blind','error','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetlinkedid','lodash','util','info','TRANSFER|%s','type','request'];(function(_0x425606,_0x290b02){var _0x54b8de=function(_0x26c47e){while(--_0x26c47e){_0x425606['push'](_0x425606['shift']());}};_0x54b8de(++_0x290b02);}(_0x94c4,0x11a));var _0x494c=function(_0x5be53d,_0x113d4b){_0x5be53d=_0x5be53d-0x0;var _0x352e62=_0x94c4[_0x5be53d];return _0x352e62;};'use strict';var _=require(_0x494c('0x0'));var util=require(_0x494c('0x1'));var utils=require('./utils');function writeDB(_0x51d830){utils[_0x494c('0x2')](util['format'](_0x494c('0x3'),_0x51d830[_0x494c('0x4')]));utils[_0x494c('0x5')]('CreateVoiceTransferReport',_0x51d830);}exports['blindtransfer']=function(_0x5f0a91){try{_0x5f0a91[_0x494c('0x4')]=_0x494c('0x6');writeDB(_0x5f0a91);}catch(_0x5f4d98){utils[_0x494c('0x7')](_0x5f4d98['stack']);}};exports[_0x494c('0x8')]=function(_0x32917f){try{_0x32917f=_[_0x494c('0x9')](_0x32917f,{'transfererchannel':_0x32917f[_0x494c('0xa')],'transferercalleridnum':_0x32917f[_0x494c('0xb')],'transferercalleridname':_0x32917f['origtransferercalleridname'],'transfererconnectedlinenum':_0x32917f[_0x494c('0xc')],'transfererconnectedlinename':_0x32917f['secondtransfererconnectedlinename'],'transfereraccountcode':_0x32917f[_0x494c('0xd')],'transferercontext':_0x32917f[_0x494c('0xe')],'transfererexten':_0x32917f[_0x494c('0xf')],'transfererlinkedid':_0x32917f['origtransfererlinkedid'],'context':_0x32917f['origtransferercontext'],'extension':_0x32917f[_0x494c('0x10')],'type':'attended'});if(_[_0x494c('0x11')](_0x32917f['transfereechannel'])){_0x32917f=_[_0x494c('0x9')](_0x32917f,{'transfereechannel':_0x32917f[_0x494c('0x12')],'transfereecalleridnum':_0x32917f[_0x494c('0x13')],'transfereecalleridname':_0x32917f[_0x494c('0x14')],'transfereeconnectedlinenum':_0x32917f[_0x494c('0x15')],'transfereeconnectedlinename':_0x32917f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x32917f[_0x494c('0x16')],'transfereecontext':_0x32917f['transfertargetcontext'],'transfereeexten':_0x32917f['transfertargetexten'],'transfereelinkedid':_0x32917f[_0x494c('0x17')]});}writeDB(_0x32917f);}catch(_0x243f8d){utils[_0x494c('0x7')](_0x243f8d['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index db02093..d1cc4cb 100644 --- a/server/services/xdr/utils.js +++ b/server/services/xdr/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9fe=['then','debug','stringify','catch','GetUser','internal','name','interface','GETUSER|','FOUND','NOTFOUND','result','getUserByInternal','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','length','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','seconds','diffTime','sumTime','now','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr','info','error','stack','request'];(function(_0x21ce8f,_0x532a31){var _0x388457=function(_0x3084bb){while(--_0x3084bb){_0x21ce8f['push'](_0x21ce8f['shift']());}};_0x388457(++_0x532a31);}(_0xb9fe,0xbd));var _0xeb9f=function(_0x176e38,_0x138541){_0x176e38=_0x176e38-0x0;var _0x2d1689=_0xb9fe[_0x176e38];return _0x2d1689;};'use strict';var jayson=require(_0xeb9f('0x0'));var moment=require(_0xeb9f('0x1'));var BPromise=require(_0xeb9f('0x2'));var client=jayson[_0xeb9f('0x3')][_0xeb9f('0x4')]({'port':0x2329});var logger=require(_0xeb9f('0x5'))(_0xeb9f('0x6'));exports['info']=function(_0x4b53bd){logger[_0xeb9f('0x7')](_0x4b53bd);};exports['debug']=function(_0x278ac5){logger['debug'](JSON['stringify'](_0x278ac5));};exports[_0xeb9f('0x8')]=function(_0x51a9f1){logger[_0xeb9f('0x8')](_0x51a9f1[_0xeb9f('0x9')]);};exports[_0xeb9f('0xa')]=function(_0xa094cb,_0x1c43cf){return client[_0xeb9f('0xa')](_0xa094cb,{'body':_0x1c43cf})[_0xeb9f('0xb')](function(_0x59cfca){logger[_0xeb9f('0xc')](JSON[_0xeb9f('0xd')](_0x59cfca));})[_0xeb9f('0xe')](function(_0x155508){logger['error'](_0x155508[_0xeb9f('0x9')]);});};function getUser(_0x51de6a){return client['request'](_0xeb9f('0xf'),{'options':{'raw':!![],'attributes':['id',_0xeb9f('0x10'),_0xeb9f('0x11'),_0xeb9f('0x12')],'where':_0x51de6a,'limit':0x1}})['then'](function(_0x159aa6){logger[_0xeb9f('0x7')](_0xeb9f('0x13')+JSON['stringify'](_0x51de6a)+'|'+(_0x159aa6['result']['length']?_0xeb9f('0x14'):_0xeb9f('0x15')));return _0x159aa6[_0xeb9f('0x16')]['length']?_0x159aa6['result'][0x0]:null;});}exports[_0xeb9f('0x17')]=function(_0x4c98d4){return new BPromise(function(_0x3324a2,_0x12482a){if(_0x4c98d4){return getUser({'internal':_0x4c98d4})['then'](function(_0x22c598){return _0x3324a2(_0x22c598);})[_0xeb9f('0xe')](function(_0x53a303){logger[_0xeb9f('0x8')](_0x53a303['stack']);return _0x3324a2(null);});}else{return _0x3324a2(null);}});};exports['getUserByInterface']=function(_0x2bde59){return new BPromise(function(_0x2090cd,_0x1789e8){if(_0x2bde59){return getUser({'interface':_0x2bde59})[_0xeb9f('0xb')](function(_0x387758){return _0x2090cd(_0x387758);})[_0xeb9f('0xe')](function(_0x3154cf){logger['error'](_0x3154cf['stack']);return _0x2090cd(null);});}else{return _0x2090cd(null);}});};exports[_0xeb9f('0x18')]=function(_0x3c889b){return new BPromise(function(_0x5bf058,_0x20d372){if(_0x3c889b){return getUser({'name':_0x3c889b})[_0xeb9f('0xb')](function(_0x4b5bfe){return _0x5bf058(_0x4b5bfe);})[_0xeb9f('0xe')](function(_0x15132d){logger[_0xeb9f('0x8')](_0x15132d[_0xeb9f('0x9')]);return _0x5bf058(null);});}else{return _0x5bf058(null);}});};exports[_0xeb9f('0x19')]=function(_0x5da622){return new BPromise(function(_0x4af6e5,_0x1f12e2){if(_0x5da622){return client[_0xeb9f('0xa')](_0xeb9f('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xeb9f('0x11'),_0xeb9f('0x1b'),_0xeb9f('0x1c'),_0xeb9f('0x1d')],'where':{'name':_0x5da622},'limit':0x1}})[_0xeb9f('0xb')](function(_0x3cc1ab){logger[_0xeb9f('0x7')]('GETVOICEQUEUEBYNAME|'+_0x5da622+'|'+(_0x3cc1ab[_0xeb9f('0x16')][_0xeb9f('0x1e')]?'FOUND':_0xeb9f('0x15')));return _0x4af6e5(_0x3cc1ab['result'][_0xeb9f('0x1e')]?_0x3cc1ab['result'][0x0]:null);})[_0xeb9f('0xe')](function(_0x46069d){logger[_0xeb9f('0x8')](_0x46069d['stack']);return _0x4af6e5(null);});}else{return _0x4af6e5(null);}});};exports[_0xeb9f('0x1f')]=function(_0x7c11a1,_0x3ecd13){return moment(_0x7c11a1)[_0xeb9f('0x20')](_0x3ecd13,'seconds')[_0xeb9f('0x21')](_0xeb9f('0x22'));};exports['subtractTime']=function(_0x3eef9c,_0x78181c){return moment(_0x3eef9c)['subtract'](_0x78181c,_0xeb9f('0x23'))[_0xeb9f('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xeb9f('0x24')]=function(_0x4c425d,_0x13131e){return moment(_0x4c425d)['diff'](moment(_0x13131e),_0xeb9f('0x23'));};exports[_0xeb9f('0x25')]=function(_0x5c9a39,_0x1930b9){return parseInt(_0x5c9a39,0xa)+parseInt(_0x1930b9,0xa);};exports[_0xeb9f('0x26')]=function(){return moment()[_0xeb9f('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x3c0b44,_0x26399f){if(_0x26399f){return moment(_0x3c0b44)['isAfter'](_0x26399f);}else{return!![];}};exports[_0xeb9f('0x27')]=function(_0x5ec21c,_0xa6d035){if(_0xa6d035){return moment(_0x5ec21c)[_0xeb9f('0x27')](_0xa6d035);}else if(_0x5ec21c){return!![];}else{return![];}}; \ No newline at end of file +var _0x28d7=['now','isAfter','isBefore','moment','bluebird','client','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','internal','name','interface','result','length','FOUND','NOTFOUND','getUserByInternal','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','seconds','sumTime'];(function(_0x3aee02,_0x89f68c){var _0x1a4405=function(_0x3b0fed){while(--_0x3b0fed){_0x3aee02['push'](_0x3aee02['shift']());}};_0x1a4405(++_0x89f68c);}(_0x28d7,0x1d7));var _0x728d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28d7[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var moment=require(_0x728d('0x0'));var BPromise=require(_0x728d('0x1'));var client=jayson[_0x728d('0x2')]['http']({'port':0x2329});var logger=require(_0x728d('0x3'))(_0x728d('0x4'));exports[_0x728d('0x5')]=function(_0xfe94b6){logger[_0x728d('0x5')](_0xfe94b6);};exports[_0x728d('0x6')]=function(_0x3e1e91){logger[_0x728d('0x6')](JSON[_0x728d('0x7')](_0x3e1e91));};exports['error']=function(_0x27e2fc){logger[_0x728d('0x8')](_0x27e2fc[_0x728d('0x9')]);};exports[_0x728d('0xa')]=function(_0x420470,_0x5fa338){return client[_0x728d('0xa')](_0x420470,{'body':_0x5fa338})[_0x728d('0xb')](function(_0x28ad06){logger[_0x728d('0x6')](JSON[_0x728d('0x7')](_0x28ad06));})[_0x728d('0xc')](function(_0x2c3d62){logger[_0x728d('0x8')](_0x2c3d62['stack']);});};function getUser(_0x22c51d){return client[_0x728d('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x728d('0xd'),_0x728d('0xe'),_0x728d('0xf')],'where':_0x22c51d,'limit':0x1}})[_0x728d('0xb')](function(_0x3a4eb5){logger[_0x728d('0x5')]('GETUSER|'+JSON[_0x728d('0x7')](_0x22c51d)+'|'+(_0x3a4eb5[_0x728d('0x10')][_0x728d('0x11')]?_0x728d('0x12'):_0x728d('0x13')));return _0x3a4eb5[_0x728d('0x10')][_0x728d('0x11')]?_0x3a4eb5[_0x728d('0x10')][0x0]:null;});}exports[_0x728d('0x14')]=function(_0x3d6b67){return new BPromise(function(_0x1487d1,_0x2a08ff){if(_0x3d6b67){return getUser({'internal':_0x3d6b67})[_0x728d('0xb')](function(_0x240231){return _0x1487d1(_0x240231);})[_0x728d('0xc')](function(_0x28300e){logger['error'](_0x28300e[_0x728d('0x9')]);return _0x1487d1(null);});}else{return _0x1487d1(null);}});};exports['getUserByInterface']=function(_0x161c05){return new BPromise(function(_0x143c79,_0x4de02a){if(_0x161c05){return getUser({'interface':_0x161c05})['then'](function(_0x24e515){return _0x143c79(_0x24e515);})[_0x728d('0xc')](function(_0x2811d4){logger[_0x728d('0x8')](_0x2811d4[_0x728d('0x9')]);return _0x143c79(null);});}else{return _0x143c79(null);}});};exports['getUserByName']=function(_0x34cec4){return new BPromise(function(_0x45a6a6,_0xe49c58){if(_0x34cec4){return getUser({'name':_0x34cec4})['then'](function(_0x19e208){return _0x45a6a6(_0x19e208);})[_0x728d('0xc')](function(_0x1dbcc4){logger[_0x728d('0x8')](_0x1dbcc4[_0x728d('0x9')]);return _0x45a6a6(null);});}else{return _0x45a6a6(null);}});};exports[_0x728d('0x15')]=function(_0x1b189a){return new BPromise(function(_0x5bd85c,_0xa7996a){if(_0x1b189a){return client['request'](_0x728d('0x16'),{'options':{'raw':!![],'attributes':['id',_0x728d('0xe'),_0x728d('0x17'),_0x728d('0x18'),_0x728d('0x19')],'where':{'name':_0x1b189a},'limit':0x1}})['then'](function(_0x166417){logger[_0x728d('0x5')]('GETVOICEQUEUEBYNAME|'+_0x1b189a+'|'+(_0x166417[_0x728d('0x10')][_0x728d('0x11')]?_0x728d('0x12'):'NOTFOUND'));return _0x5bd85c(_0x166417['result'][_0x728d('0x11')]?_0x166417['result'][0x0]:null);})[_0x728d('0xc')](function(_0x52f18d){logger[_0x728d('0x8')](_0x52f18d['stack']);return _0x5bd85c(null);});}else{return _0x5bd85c(null);}});};exports['addTime']=function(_0x3b7d57,_0x304a5b){return moment(_0x3b7d57)[_0x728d('0x1a')](_0x304a5b,'seconds')['format'](_0x728d('0x1b'));};exports[_0x728d('0x1c')]=function(_0x5c0d85,_0x314f51){return moment(_0x5c0d85)['subtract'](_0x314f51,'seconds')[_0x728d('0x1d')](_0x728d('0x1b'));};exports[_0x728d('0x1e')]=function(_0x14c552,_0x373653){return moment(_0x14c552)['diff'](moment(_0x373653),_0x728d('0x1f'));};exports[_0x728d('0x20')]=function(_0x99d4c9,_0x1bce01){return parseInt(_0x99d4c9,0xa)+parseInt(_0x1bce01,0xa);};exports[_0x728d('0x21')]=function(){return moment()[_0x728d('0x1d')](_0x728d('0x1b'));};exports[_0x728d('0x22')]=function(_0x1c74a6,_0x52d92e){if(_0x52d92e){return moment(_0x1c74a6)['isAfter'](_0x52d92e);}else{return!![];}};exports[_0x728d('0x23')]=function(_0x30ad8b,_0x224aba){if(_0x224aba){return moment(_0x30ad8b)[_0x728d('0x23')](_0x224aba);}else if(_0x30ad8b){return!![];}else{return![];}}; \ No newline at end of file -- 1.7.1